summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <pappa@c-8b0ae253.1238-1-64736c10.cust.bredbandsbolaget.se>2005-08-05 18:01:34 -0400
committerunknown <pappa@c-8b0ae253.1238-1-64736c10.cust.bredbandsbolaget.se>2005-08-05 18:01:34 -0400
commitaca6f88ebb4fb6118b8f12a696111fce167762d3 (patch)
treef2bca76ddf241e417c5d8e8f0ab325105e97cbae /mysql-test
parent9216f5f25926197a4b40ac4fd4aeb9ad48a2a247 (diff)
parente13fa8ebbb095970b9a5a206001eeb06273567de (diff)
downloadmariadb-git-aca6f88ebb4fb6118b8f12a696111fce167762d3.tar.gz
Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.0
into c-8b0ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-5.1 BitKeeper/etc/config: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/information_schema_db.result: Auto merged mysql-test/t/disabled.def: Auto merged mysys/default.c: Auto merged scripts/Makefile.am: Auto merged scripts/mysql_create_system_tables.sh: Auto merged scripts/mysql_fix_privilege_tables.sql: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/ha_federated.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_innodb.h: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/handler.cc: Auto merged sql/item.cc: Auto merged sql/lock.cc: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/set_var.h: Auto merged sql/slave.cc: Auto merged sql/slave.h: Auto merged sql/sp.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged sql/tztime.cc: Auto merged sql/unireg.cc: Auto merged storage/innobase/buf/buf0buf.c: Auto merged storage/innobase/include/os0file.h: Auto merged storage/innobase/include/read0read.h: Auto merged storage/innobase/include/read0types.h: Auto merged storage/innobase/include/trx0trx.h: Auto merged storage/innobase/os/os0file.c: Auto merged storage/innobase/read/read0read.c: Auto merged storage/innobase/row/row0sel.c: Auto merged storage/innobase/srv/srv0srv.c: Auto merged storage/innobase/srv/srv0start.c: Auto merged storage/innobase/trx/trx0sys.c: Auto merged storage/innobase/trx/trx0trx.c: Auto merged storage/myisam/mi_create.c: Auto merged storage/myisam/sort.c: Auto merged storage/ndb/include/mgmapi/mgmapi.h: Auto merged storage/ndb/include/mgmapi/mgmapi_config_parameters.h: Auto merged storage/ndb/src/common/portlib/NdbMutex.c: Auto merged storage/ndb/src/common/portlib/NdbThread.c: Auto merged storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: Auto merged storage/ndb/src/mgmapi/mgmapi.cpp: Auto merged storage/ndb/src/mgmsrv/ConfigInfo.cpp: Auto merged storage/ndb/src/mgmsrv/ConfigInfo.hpp: Auto merged strings/ctype-big5.c: Auto merged strings/ctype-ucs2.c: Auto merged support-files/mysql.spec.sh: Auto merged configure.in: Manual merge 5.0 -> 5.1 mysql-test/t/alter_table.test: Manual merge 5.0 -> 5.1 sql/share/errmsg.txt: Manual merge 5.0 -> 5.1 storage/ndb/tools/Makefile.am: Manual merge 5.0 -> 5.1
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/have_lowercase0.inc4
-rw-r--r--mysql-test/include/not_windows.inc4
-rw-r--r--mysql-test/lib/init_db.sql8
-rw-r--r--mysql-test/r/create.result11
-rw-r--r--mysql-test/r/ctype_big5.result6
-rw-r--r--mysql-test/r/delayed.result7
-rw-r--r--mysql-test/r/flush_table.result3
-rw-r--r--mysql-test/r/fulltext.result8
-rw-r--r--mysql-test/r/func_gconcat.result55
-rw-r--r--mysql-test/r/func_group.result52
-rw-r--r--mysql-test/r/func_math.result13
-rw-r--r--mysql-test/r/func_str.result15
-rw-r--r--mysql-test/r/gis.result5
-rw-r--r--mysql-test/r/information_schema.result80
-rw-r--r--mysql-test/r/information_schema_db.result20
-rw-r--r--mysql-test/r/innodb.result8
-rw-r--r--mysql-test/r/key.result25
-rw-r--r--mysql-test/r/key_cache.result6
-rw-r--r--mysql-test/r/myisam.result2
-rw-r--r--mysql-test/r/mysqldump.result314
-rw-r--r--mysql-test/r/mysqltest.result2
-rw-r--r--mysql-test/r/ndb_condition_pushdown.result2
-rw-r--r--mysql-test/r/ndb_config.result5
-rw-r--r--mysql-test/r/not_embedded_server.result5
-rw-r--r--mysql-test/r/null_key.result60
-rw-r--r--mysql-test/r/ps_1general.result2
-rw-r--r--mysql-test/r/ps_grant.result6
-rw-r--r--mysql-test/r/query_cache.result179
-rw-r--r--mysql-test/r/query_cache_notembedded.result83
-rw-r--r--mysql-test/r/rpl_slave_status.result54
-rw-r--r--mysql-test/r/select.result231
-rw-r--r--mysql-test/r/select_safe.result3
-rw-r--r--mysql-test/r/sp-big.result15
-rw-r--r--mysql-test/r/sp-prelocking.result215
-rw-r--r--mysql-test/r/sp-threads.result2
-rw-r--r--mysql-test/r/sp.result83
-rw-r--r--mysql-test/r/strict.result28
-rw-r--r--mysql-test/r/subselect.result12
-rw-r--r--mysql-test/r/system_mysql_db.result2
-rw-r--r--mysql-test/r/trigger.result40
-rw-r--r--mysql-test/r/type_datetime.result10
-rw-r--r--mysql-test/r/type_newdecimal.result17
-rw-r--r--mysql-test/r/user_var.result24
-rw-r--r--mysql-test/r/variables.result24
-rw-r--r--mysql-test/r/view.result41
-rw-r--r--mysql-test/r/view_grant.result8
-rw-r--r--mysql-test/t/alias.test2
-rw-r--r--mysql-test/t/alter_table.test2
-rw-r--r--mysql-test/t/analyse.test2
-rw-r--r--mysql-test/t/analyze.test21
-rw-r--r--mysql-test/t/ansi.test2
-rw-r--r--mysql-test/t/archive.test2
-rw-r--r--mysql-test/t/auto_increment.test2
-rw-r--r--mysql-test/t/backup.test2
-rw-r--r--mysql-test/t/bdb-alter-table-1.test2
-rw-r--r--mysql-test/t/bdb-alter-table-2.test2
-rw-r--r--mysql-test/t/bdb-crash.test2
-rw-r--r--mysql-test/t/bdb-deadlock.test2
-rw-r--r--mysql-test/t/bdb-deadlock.tminus2
-rw-r--r--mysql-test/t/bdb.test2
-rw-r--r--mysql-test/t/bdb_cache.test2
-rw-r--r--mysql-test/t/bench_count_distinct.test2
-rw-r--r--mysql-test/t/bigint.test2
-rw-r--r--mysql-test/t/binary.test2
-rw-r--r--mysql-test/t/blackhole.test2
-rw-r--r--mysql-test/t/bool.test2
-rw-r--r--mysql-test/t/bulk_replace.test1
-rw-r--r--mysql-test/t/case.test3
-rw-r--r--mysql-test/t/cast.test3
-rw-r--r--mysql-test/t/check.test2
-rw-r--r--mysql-test/t/comments.test2
-rw-r--r--mysql-test/t/compare.test2
-rw-r--r--mysql-test/t/connect.test2
-rw-r--r--mysql-test/t/consistent_snapshot.test2
-rw-r--r--mysql-test/t/constraints.test2
-rw-r--r--mysql-test/t/count_distinct.test2
-rw-r--r--mysql-test/t/count_distinct2.test1
-rw-r--r--mysql-test/t/count_distinct3.test2
-rw-r--r--mysql-test/t/create.test16
-rw-r--r--mysql-test/t/create_select_tmp.test2
-rw-r--r--mysql-test/t/csv.test2
-rw-r--r--mysql-test/t/ctype_big5.test10
-rw-r--r--mysql-test/t/ctype_collate.test2
-rw-r--r--mysql-test/t/ctype_cp1250_ch.test2
-rw-r--r--mysql-test/t/ctype_cp1251.test2
-rw-r--r--mysql-test/t/ctype_create.test2
-rw-r--r--mysql-test/t/ctype_gbk.test2
-rw-r--r--mysql-test/t/ctype_latin1.test2
-rw-r--r--mysql-test/t/ctype_latin1_de.test2
-rw-r--r--mysql-test/t/ctype_latin2.test2
-rw-r--r--mysql-test/t/ctype_many.test2
-rw-r--r--mysql-test/t/ctype_mb.test2
-rw-r--r--mysql-test/t/ctype_recoding.test2
-rw-r--r--mysql-test/t/ctype_sjis.test2
-rw-r--r--mysql-test/t/ctype_tis620.test2
-rw-r--r--mysql-test/t/ctype_uca.test2
-rw-r--r--mysql-test/t/ctype_ucs.test2
-rw-r--r--mysql-test/t/ctype_ucs_binlog.test2
-rw-r--r--mysql-test/t/ctype_ujis.test2
-rw-r--r--mysql-test/t/ctype_utf8.test2
-rw-r--r--mysql-test/t/date_formats.test2
-rw-r--r--mysql-test/t/delayed.test11
-rw-r--r--mysql-test/t/delete.test2
-rw-r--r--mysql-test/t/derived.test2
-rw-r--r--mysql-test/t/dirty_close.test2
-rw-r--r--mysql-test/t/disabled.def2
-rw-r--r--mysql-test/t/distinct.test2
-rw-r--r--mysql-test/t/drop.test2
-rw-r--r--mysql-test/t/drop_temp_table.test2
-rw-r--r--mysql-test/t/empty_table.test2
-rw-r--r--mysql-test/t/endspace.test2
-rw-r--r--mysql-test/t/errors.test2
-rw-r--r--mysql-test/t/exampledb.test2
-rw-r--r--mysql-test/t/explain.test2
-rw-r--r--mysql-test/t/flush.test2
-rw-r--r--mysql-test/t/flush_block_commit.test2
-rw-r--r--mysql-test/t/flush_table.test9
-rw-r--r--mysql-test/t/foreign_key.test2
-rw-r--r--mysql-test/t/fulltext.test13
-rw-r--r--mysql-test/t/fulltext2.test1
-rw-r--r--mysql-test/t/fulltext_cache.test2
-rw-r--r--mysql-test/t/fulltext_distinct.test2
-rw-r--r--mysql-test/t/fulltext_left_join.test1
-rw-r--r--mysql-test/t/fulltext_multi.test2
-rw-r--r--mysql-test/t/fulltext_order_by.test1
-rw-r--r--mysql-test/t/fulltext_update.test2
-rw-r--r--mysql-test/t/fulltext_var.test1
-rw-r--r--mysql-test/t/func_compress.test1
-rw-r--r--mysql-test/t/func_concat.test1
-rw-r--r--mysql-test/t/func_crypt.test2
-rw-r--r--mysql-test/t/func_date_add.test2
-rw-r--r--mysql-test/t/func_default.test2
-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_encrypt_nossl.test1
-rw-r--r--mysql-test/t/func_equal.test2
-rw-r--r--mysql-test/t/func_gconcat.test52
-rw-r--r--mysql-test/t/func_group.test64
-rw-r--r--mysql-test/t/func_if.test2
-rw-r--r--mysql-test/t/func_in.test2
-rw-r--r--mysql-test/t/func_isnull.test2
-rw-r--r--mysql-test/t/func_like.test1
-rw-r--r--mysql-test/t/func_math.test17
-rw-r--r--mysql-test/t/func_misc.test8
-rw-r--r--mysql-test/t/func_op.test2
-rw-r--r--mysql-test/t/func_regexp.test2
-rw-r--r--mysql-test/t/func_sapdb.test2
-rw-r--r--mysql-test/t/func_set.test1
-rw-r--r--mysql-test/t/func_str.test13
-rw-r--r--mysql-test/t/func_system.test2
-rw-r--r--mysql-test/t/func_test.test2
-rw-r--r--mysql-test/t/func_time.test3
-rw-r--r--mysql-test/t/func_timestamp.test2
-rw-r--r--mysql-test/t/gcc296.test2
-rw-r--r--mysql-test/t/gis-rtree.test2
-rw-r--r--mysql-test/t/gis.test12
-rw-r--r--mysql-test/t/grant.test2
-rw-r--r--mysql-test/t/grant2.test2
-rw-r--r--mysql-test/t/grant_cache.test2
-rw-r--r--mysql-test/t/group_by.test2
-rw-r--r--mysql-test/t/handler.test2
-rw-r--r--mysql-test/t/having.test2
-rw-r--r--mysql-test/t/heap.test2
-rw-r--r--mysql-test/t/heap_auto_increment.test2
-rw-r--r--mysql-test/t/heap_btree.test2
-rw-r--r--mysql-test/t/heap_hash.test2
-rw-r--r--mysql-test/t/help.test2
-rw-r--r--mysql-test/t/information_schema.test53
-rw-r--r--mysql-test/t/init_connect.test2
-rw-r--r--mysql-test/t/init_file.test2
-rw-r--r--mysql-test/t/innodb-deadlock.test2
-rw-r--r--mysql-test/t/innodb-lock.test2
-rw-r--r--mysql-test/t/innodb-replace.test1
-rw-r--r--mysql-test/t/innodb.test3
-rw-r--r--mysql-test/t/innodb_cache.test1
-rw-r--r--mysql-test/t/innodb_handler.test1
-rw-r--r--mysql-test/t/insert.test6
-rw-r--r--mysql-test/t/insert_select-binlog.test1
-rw-r--r--mysql-test/t/insert_select.test2
-rw-r--r--mysql-test/t/insert_update.test2
-rw-r--r--mysql-test/t/join.test2
-rw-r--r--mysql-test/t/join_crash.test2
-rw-r--r--mysql-test/t/join_outer.test5
-rw-r--r--mysql-test/t/key.test18
-rw-r--r--mysql-test/t/key_cache.test2
-rw-r--r--mysql-test/t/key_diff.test2
-rw-r--r--mysql-test/t/key_primary.test2
-rw-r--r--mysql-test/t/keywords.test2
-rw-r--r--mysql-test/t/kill.test2
-rw-r--r--mysql-test/t/limit.test2
-rw-r--r--mysql-test/t/loaddata.test2
-rw-r--r--mysql-test/t/lock.test2
-rw-r--r--mysql-test/t/lock_multi.test3
-rw-r--r--mysql-test/t/lock_tables_lost_commit.test2
-rw-r--r--mysql-test/t/lowercase_table.test1
-rw-r--r--mysql-test/t/lowercase_table2.test2
-rw-r--r--mysql-test/t/lowercase_table3.test10
-rw-r--r--mysql-test/t/lowercase_table_grant.test2
-rw-r--r--mysql-test/t/lowercase_table_qcache.test2
-rw-r--r--mysql-test/t/merge.test1
-rw-r--r--mysql-test/t/metadata.test2
-rw-r--r--mysql-test/t/mix_innodb_myisam_binlog.test2
-rw-r--r--mysql-test/t/multi_statement.test2
-rw-r--r--mysql-test/t/multi_update.test2
-rw-r--r--mysql-test/t/myisam-blob.test2
-rw-r--r--mysql-test/t/myisam.test3
-rw-r--r--mysql-test/t/mysql_client_test.test2
-rw-r--r--mysql-test/t/mysql_protocols.test1
-rw-r--r--mysql-test/t/mysqlbinlog.test1
-rw-r--r--mysql-test/t/mysqlbinlog2.test2
-rw-r--r--mysql-test/t/mysqldump.test91
-rw-r--r--mysql-test/t/mysqltest.test14
-rw-r--r--mysql-test/t/ndb_alter_table.test2
-rw-r--r--mysql-test/t/ndb_autodiscover.test2
-rw-r--r--mysql-test/t/ndb_autodiscover2.test1
-rw-r--r--mysql-test/t/ndb_basic.test1
-rw-r--r--mysql-test/t/ndb_blob.test2
-rw-r--r--mysql-test/t/ndb_cache.test2
-rw-r--r--mysql-test/t/ndb_charset.test2
-rw-r--r--mysql-test/t/ndb_config.test9
-rw-r--r--mysql-test/t/ndb_database.test2
-rw-r--r--mysql-test/t/ndb_grant.later2
-rw-r--r--mysql-test/t/ndb_index.test3
-rw-r--r--mysql-test/t/ndb_index_ordered.test2
-rw-r--r--mysql-test/t/ndb_index_unique.test2
-rw-r--r--mysql-test/t/ndb_insert.test2
-rw-r--r--mysql-test/t/ndb_limit.test2
-rw-r--r--mysql-test/t/ndb_lock.test1
-rw-r--r--mysql-test/t/ndb_minmax.test4
-rw-r--r--mysql-test/t/ndb_multi.test2
-rw-r--r--mysql-test/t/ndb_replace.test2
-rw-r--r--mysql-test/t/ndb_restore.test2
-rw-r--r--mysql-test/t/ndb_subquery.test5
-rw-r--r--mysql-test/t/ndb_transaction.test2
-rw-r--r--mysql-test/t/ndb_truncate.test2
-rw-r--r--mysql-test/t/ndb_types.test2
-rw-r--r--mysql-test/t/ndb_update.test2
-rw-r--r--mysql-test/t/negation_elimination.test2
-rw-r--r--mysql-test/t/not_embedded_server.test18
-rw-r--r--mysql-test/t/null.test2
-rw-r--r--mysql-test/t/null_key.test47
-rw-r--r--mysql-test/t/odbc.test2
-rw-r--r--mysql-test/t/olap.test2
-rw-r--r--mysql-test/t/openssl_1.test2
-rw-r--r--mysql-test/t/order_by.test2
-rw-r--r--mysql-test/t/order_fill_sortbuf.test2
-rw-r--r--mysql-test/t/outfile.test2
-rw-r--r--mysql-test/t/overflow.test2
-rw-r--r--mysql-test/t/packet.test5
-rw-r--r--mysql-test/t/preload.test2
-rw-r--r--mysql-test/t/ps.test2
-rw-r--r--mysql-test/t/ps_10nestset.test2
-rw-r--r--mysql-test/t/ps_11bugs.test1
-rw-r--r--mysql-test/t/ps_1general.test2
-rw-r--r--mysql-test/t/ps_2myisam.test2
-rw-r--r--mysql-test/t/ps_3innodb.test2
-rw-r--r--mysql-test/t/ps_4heap.test2
-rw-r--r--mysql-test/t/ps_5merge.test2
-rw-r--r--mysql-test/t/ps_6bdb.test2
-rw-r--r--mysql-test/t/ps_7ndb.test2
-rw-r--r--mysql-test/t/ps_grant.test15
-rw-r--r--mysql-test/t/query_cache.test115
-rw-r--r--mysql-test/t/query_cache_merge.test2
-rw-r--r--mysql-test/t/query_cache_notembedded.test81
-rw-r--r--mysql-test/t/raid.test2
-rw-r--r--mysql-test/t/range.test2
-rw-r--r--mysql-test/t/rename.test2
-rw-r--r--mysql-test/t/repair.test2
-rw-r--r--mysql-test/t/replace.test2
-rw-r--r--mysql-test/t/rollback.test2
-rw-r--r--mysql-test/t/row.test2
-rw-r--r--mysql-test/t/rpl000001.test2
-rw-r--r--mysql-test/t/rpl000002.test2
-rw-r--r--mysql-test/t/rpl000004.test2
-rw-r--r--mysql-test/t/rpl000005.test2
-rw-r--r--mysql-test/t/rpl000006.test2
-rw-r--r--mysql-test/t/rpl000008.test2
-rw-r--r--mysql-test/t/rpl000009.test2
-rw-r--r--mysql-test/t/rpl000010.test1
-rw-r--r--mysql-test/t/rpl000011.test2
-rw-r--r--mysql-test/t/rpl000012.test2
-rw-r--r--mysql-test/t/rpl000013.test2
-rw-r--r--mysql-test/t/rpl000015.test2
-rw-r--r--mysql-test/t/rpl000017.test2
-rw-r--r--mysql-test/t/rpl000018.test2
-rw-r--r--mysql-test/t/rpl_EE_error.test2
-rw-r--r--mysql-test/t/rpl_alter.test2
-rw-r--r--mysql-test/t/rpl_chain_temp_table.test2
-rw-r--r--mysql-test/t/rpl_change_master.test2
-rw-r--r--mysql-test/t/rpl_charset.test2
-rw-r--r--mysql-test/t/rpl_commit_after_flush.test2
-rw-r--r--mysql-test/t/rpl_create_database.test2
-rw-r--r--mysql-test/t/rpl_ddl.test2
-rw-r--r--mysql-test/t/rpl_deadlock.test2
-rw-r--r--mysql-test/t/rpl_delete_all.test2
-rw-r--r--mysql-test/t/rpl_do_grant.test2
-rw-r--r--mysql-test/t/rpl_drop.test2
-rw-r--r--mysql-test/t/rpl_drop_temp.test1
-rw-r--r--mysql-test/t/rpl_empty_master_crash.test2
-rw-r--r--mysql-test/t/rpl_error_ignored_table.test2
-rw-r--r--mysql-test/t/rpl_failed_optimize.test2
-rw-r--r--mysql-test/t/rpl_failsafe.test2
-rw-r--r--mysql-test/t/rpl_flush_log_loop.test2
-rw-r--r--mysql-test/t/rpl_flush_tables.test7
-rw-r--r--mysql-test/t/rpl_free_items.test2
-rw-r--r--mysql-test/t/rpl_get_lock.test2
-rw-r--r--mysql-test/t/rpl_heap.test2
-rw-r--r--mysql-test/t/rpl_ignore_grant.test2
-rw-r--r--mysql-test/t/rpl_init_slave.test2
-rw-r--r--mysql-test/t/rpl_innodb.test2
-rw-r--r--mysql-test/t/rpl_insert_id.test4
-rw-r--r--mysql-test/t/rpl_insert_ignore.test2
-rw-r--r--mysql-test/t/rpl_loaddata.test2
-rw-r--r--mysql-test/t/rpl_loaddata_rule_m.test2
-rw-r--r--mysql-test/t/rpl_loaddata_rule_s.test2
-rw-r--r--mysql-test/t/rpl_loaddatalocal.test2
-rw-r--r--mysql-test/t/rpl_log.test2
-rw-r--r--mysql-test/t/rpl_log_pos.test2
-rw-r--r--mysql-test/t/rpl_many_optimize.test2
-rw-r--r--mysql-test/t/rpl_master_pos_wait.test2
-rw-r--r--mysql-test/t/rpl_max_relay_size.test2
-rw-r--r--mysql-test/t/rpl_misc_functions.test2
-rw-r--r--mysql-test/t/rpl_multi_delete.test2
-rw-r--r--mysql-test/t/rpl_multi_delete2.test2
-rw-r--r--mysql-test/t/rpl_multi_query.test2
-rw-r--r--mysql-test/t/rpl_multi_update.test2
-rw-r--r--mysql-test/t/rpl_multi_update2.test2
-rw-r--r--mysql-test/t/rpl_multi_update3.test2
-rw-r--r--mysql-test/t/rpl_mystery22.test1
-rw-r--r--mysql-test/t/rpl_openssl.test2
-rw-r--r--mysql-test/t/rpl_optimize.test2
-rw-r--r--mysql-test/t/rpl_ps.test1
-rw-r--r--mysql-test/t/rpl_redirect.test2
-rw-r--r--mysql-test/t/rpl_relayrotate.test2
-rw-r--r--mysql-test/t/rpl_relayspace.test2
-rw-r--r--mysql-test/t/rpl_replicate_do.test1
-rw-r--r--mysql-test/t/rpl_reset_slave.test2
-rw-r--r--mysql-test/t/rpl_rewrite_db.test1
-rw-r--r--mysql-test/t/rpl_rotate_logs.test1
-rw-r--r--mysql-test/t/rpl_server_id1.test2
-rw-r--r--mysql-test/t/rpl_server_id2.test2
-rw-r--r--mysql-test/t/rpl_set_charset.test2
-rw-r--r--mysql-test/t/rpl_skip_error.test2
-rw-r--r--mysql-test/t/rpl_slave_status.test30
-rw-r--r--mysql-test/t/rpl_sporadic_master.test2
-rw-r--r--mysql-test/t/rpl_start_stop_slave.test2
-rw-r--r--mysql-test/t/rpl_temporary.test2
-rw-r--r--mysql-test/t/rpl_timezone.test2
-rw-r--r--mysql-test/t/rpl_until.test2
-rw-r--r--mysql-test/t/rpl_user_variables.test2
-rw-r--r--mysql-test/t/rpl_variables.test2
-rw-r--r--mysql-test/t/select.test208
-rw-r--r--mysql-test/t/select_found.test2
-rw-r--r--mysql-test/t/select_safe.test3
-rw-r--r--mysql-test/t/show_check.test2
-rw-r--r--mysql-test/t/skip_name_resolve.test2
-rw-r--r--mysql-test/t/sp-big.test33
-rw-r--r--mysql-test/t/sp-prelocking.test242
-rw-r--r--mysql-test/t/sp.test388
-rw-r--r--mysql-test/t/sql_mode.test2
-rw-r--r--mysql-test/t/status.test2
-rw-r--r--mysql-test/t/strict.test25
-rw-r--r--mysql-test/t/subselect.test2
-rw-r--r--mysql-test/t/subselect2.test3
-rw-r--r--mysql-test/t/subselect_gis.test2
-rw-r--r--mysql-test/t/subselect_innodb.test2
-rw-r--r--mysql-test/t/symlink.test2
-rw-r--r--mysql-test/t/synchronization.test2
-rw-r--r--mysql-test/t/system_mysql_db.test2
-rw-r--r--mysql-test/t/system_mysql_db_fix.test2
-rw-r--r--mysql-test/t/system_mysql_db_refs.test2
-rw-r--r--mysql-test/t/tablelock.test2
-rw-r--r--mysql-test/t/temp_table.test2
-rw-r--r--mysql-test/t/timezone.test2
-rw-r--r--mysql-test/t/timezone2.test2
-rw-r--r--mysql-test/t/timezone3.test2
-rw-r--r--mysql-test/t/timezone_grant.test1
-rw-r--r--mysql-test/t/trigger.test32
-rw-r--r--mysql-test/t/truncate.test2
-rw-r--r--mysql-test/t/type_blob.test2
-rw-r--r--mysql-test/t/type_date.test2
-rw-r--r--mysql-test/t/type_datetime.test12
-rw-r--r--mysql-test/t/type_decimal.test4
-rw-r--r--mysql-test/t/type_enum.test2
-rw-r--r--mysql-test/t/type_float.test2
-rw-r--r--mysql-test/t/type_nchar.test1
-rw-r--r--mysql-test/t/type_newdecimal.test12
-rw-r--r--mysql-test/t/type_ranges.test2
-rw-r--r--mysql-test/t/type_set.test2
-rw-r--r--mysql-test/t/type_time.test2
-rw-r--r--mysql-test/t/type_timestamp.test1
-rw-r--r--mysql-test/t/type_uint.test2
-rw-r--r--mysql-test/t/type_year.test2
-rw-r--r--mysql-test/t/union.test2
-rw-r--r--mysql-test/t/update.test2
-rw-r--r--mysql-test/t/user_var-binlog.test2
-rw-r--r--mysql-test/t/user_var.test23
-rw-r--r--mysql-test/t/varbinary.test2
-rw-r--r--mysql-test/t/variables.test12
-rw-r--r--mysql-test/t/view.test62
-rw-r--r--mysql-test/t/warnings.test2
401 files changed, 3152 insertions, 1083 deletions
diff --git a/mysql-test/include/have_lowercase0.inc b/mysql-test/include/have_lowercase0.inc
new file mode 100644
index 00000000000..f967c18928b
--- /dev/null
+++ b/mysql-test/include/have_lowercase0.inc
@@ -0,0 +1,4 @@
+--require r/lowercase0.require
+--disable_query_log;
+show variables like "lower_case_%";
+--enable_query_log;
diff --git a/mysql-test/include/not_windows.inc b/mysql-test/include/not_windows.inc
new file mode 100644
index 00000000000..54e9e0e817a
--- /dev/null
+++ b/mysql-test/include/not_windows.inc
@@ -0,0 +1,4 @@
+--require r/true.require
+disable_query_log;
+select convert(@@version_compile_os using latin1) NOT IN ("Win32","Win64","Windows") as "TRUE";
+enable_query_log;
diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql
index fa02b350425..a71de229ee9 100644
--- a/mysql-test/lib/init_db.sql
+++ b/mysql-test/lib/init_db.sql
@@ -504,7 +504,7 @@ comment='Procedure privileges';
CREATE TABLE proc (
- db char(64) binary DEFAULT '' NOT NULL,
+ 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,
@@ -519,7 +519,7 @@ CREATE TABLE proc (
param_list blob DEFAULT '' NOT NULL,
returns char(64) DEFAULT '' NOT NULL,
body blob DEFAULT '' NOT NULL,
- definer char(77) binary DEFAULT '' NOT NULL,
+ definer char(77) collate utf8_bin DEFAULT '' NOT NULL,
created timestamp,
modified timestamp,
sql_mode set(
@@ -554,6 +554,6 @@ CREATE TABLE proc (
'NO_AUTO_CREATE_USER',
'HIGH_NOT_PRECEDENCE'
) DEFAULT '' NOT NULL,
- comment char(64) binary DEFAULT '' NOT NULL,
+ comment char(64) collate utf8_bin DEFAULT '' NOT NULL,
PRIMARY KEY (db,name,type)
-) comment='Stored Procedures';
+) character set utf8 comment='Stored Procedures';
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index d622127e8f0..82a5ccc3e82 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -37,7 +37,7 @@ Note 1051 Unknown table 't1'
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap;
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
create table not_existing_database.test (a int);
-Got one of the listed errors
+ERROR 42000: Unknown database 'not_existing_database'
create table `a/a` (a int);
ERROR 42000: Incorrect table name 'a/a'
create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int);
@@ -358,7 +358,7 @@ create table t3 like t1;
create table t3 like mysqltest.t3;
ERROR 42S01: Table 't3' already exists
create table non_existing_database.t1 like t1;
-Got one of the listed errors
+ERROR 42000: Unknown database 'non_existing_database'
create table t3 like non_existing_table;
ERROR 42S02: Unknown table 'non_existing_table'
create temporary table t3 like t1;
@@ -602,3 +602,10 @@ drop database mysqltest;
create table test.t1 like x;
ERROR 42000: Incorrect database name 'NULL'
drop table if exists test.t1;
+create database mysqltest;
+use mysqltest;
+create view v1 as select 'foo' from dual;
+create table t1 like v1;
+ERROR HY000: 'mysqltest.v1' is not BASE TABLE
+drop view v1;
+drop database mysqltest;
diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result
index 8d2c39df853..01b59b93b52 100644
--- a/mysql-test/r/ctype_big5.result
+++ b/mysql-test/r/ctype_big5.result
@@ -128,3 +128,9 @@ SELECT * FROM t1;
a
łŲ
DROP TABLE t1;
+CREATE TABLE t1 (a CHAR(50) CHARACTER SET big5 NOT NULL, FULLTEXT(a));
+INSERT INTO t1 VALUES(0xA741ADCCA66EB6DC20A7DAADCCABDCA66E);
+SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST (0xA741ADCCA66EB6DC IN BOOLEAN MODE);
+HEX(a)
+A741ADCCA66EB6DC20A7DAADCCABDCA66E
+DROP TABLE t1;
diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result
index e9766622cf6..f8ae61b03fb 100644
--- a/mysql-test/r/delayed.result
+++ b/mysql-test/r/delayed.result
@@ -32,3 +32,10 @@ a b
3 d
4 e
drop table t1;
+create table t1 (a int not null primary key);
+insert into t1 values (1);
+insert delayed into t1 values (1);
+select * from t1;
+a
+1
+drop table t1;
diff --git a/mysql-test/r/flush_table.result b/mysql-test/r/flush_table.result
index 2ef4ab5b52b..db54d2e53ef 100644
--- a/mysql-test/r/flush_table.result
+++ b/mysql-test/r/flush_table.result
@@ -101,3 +101,6 @@ table_id
Record-02
handler t1 close;
drop table t1;
+FLUSH TABLES WITH READ LOCK ;
+FLUSH TABLES WITH READ LOCK ;
+UNLOCK TABLES;
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 1a79f6d9736..6a41035eb7b 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -422,3 +422,11 @@ SELECT COUNT(*) FROM t1 WHERE MATCH(t) AGAINST ('"osnabrück"' IN BOOLEAN MODE);
COUNT(*)
1
DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(30), FULLTEXT(a));
+INSERT INTO t1 VALUES('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
+SET myisam_repair_threads=2;
+REPAIR TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+SET myisam_repair_threads=@@global.myisam_repair_threads;
+DROP TABLE t1;
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 10afb61ba1d..184bd07b066 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -445,6 +445,30 @@ group_concat(distinct b order by b)
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
drop table t1;
+create table t1 (a varchar(255) character set cp1250 collate cp1250_general_ci,
+b varchar(255) character set koi8r);
+insert into t1 values ('xxx','yyy');
+select collation(a) from t1;
+collation(a)
+cp1250_general_ci
+select collation(group_concat(a)) from t1;
+collation(group_concat(a))
+cp1250_general_ci
+create table t2 select group_concat(a) as a from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` varchar(400) character set cp1250 default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select collation(group_concat(a,_koi8r'test')) from t1;
+collation(group_concat(a,_koi8r'test'))
+cp1250_general_ci
+select collation(group_concat(a,_koi8r 0xC1C2)) from t1;
+ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation 'group_concat'
+select collation(group_concat(a,b)) from t1;
+ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,IMPLICIT) for operation 'group_concat'
+drop table t1;
+drop table t2;
CREATE TABLE t1 (id int);
SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL;
gc
@@ -500,3 +524,34 @@ group_concat(a)
ABW
ABW
drop table t1;
+CREATE TABLE t1 (
+aID smallint(5) unsigned NOT NULL auto_increment,
+sometitle varchar(255) NOT NULL default '',
+bID smallint(5) unsigned NOT NULL,
+PRIMARY KEY (aID),
+UNIQUE KEY sometitle (sometitle)
+);
+INSERT INTO t1 SET sometitle = 'title1', bID = 1;
+INSERT INTO t1 SET sometitle = 'title2', bID = 1;
+CREATE TABLE t2 (
+bID smallint(5) unsigned NOT NULL auto_increment,
+somename varchar(255) NOT NULL default '',
+PRIMARY KEY (bID),
+UNIQUE KEY somename (somename)
+);
+INSERT INTO t2 SET somename = 'test';
+SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
+FROM t1 JOIN t2 ON t1.bID = t2.bID;
+COUNT(*) GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
+2 test
+INSERT INTO t2 SET somename = 'test2';
+SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
+FROM t1 JOIN t2 ON t1.bID = t2.bID;
+COUNT(*) GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
+2 test
+DELETE FROM t2 WHERE somename = 'test2';
+SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
+FROM t1 JOIN t2 ON t1.bID = t2.bID;
+COUNT(*) GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
+2 test
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 0db2ceb0e6b..1542794798a 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -795,6 +795,32 @@ show columns from t2;
Field Type Null Key Default Extra
f2 datetime NO 0000-00-00 00:00:00
drop table t2, t1;
+CREATE TABLE t1(
+id int PRIMARY KEY,
+a int,
+b int,
+INDEX i_b_id(a,b,id),
+INDEX i_id(a,id)
+);
+INSERT INTO t1 VALUES
+(1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1);
+SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
+MAX(id)
+NULL
+DROP TABLE t1;
+CREATE TABLE t1(
+id int PRIMARY KEY,
+a int,
+b int,
+INDEX i_id(a,id),
+INDEX i_b_id(a,b,id)
+);
+INSERT INTO t1 VALUES
+(1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1);
+SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
+MAX(id)
+NULL
+DROP TABLE t1;
create table t2 (ff double);
insert into t2 values (2.2);
select cast(sum(distinct ff) as decimal(5,2)) from t2;
@@ -860,32 +886,6 @@ select col1,sum(col1),max(col1),min(col1) from t1 group by col1;
col1 sum(col1) max(col1) min(col1)
5.000000000010 10.000000000020 5.000000000010 5.000000000010
DROP TABLE t1;
-CREATE TABLE t1(
-id int PRIMARY KEY,
-a int,
-b int,
-INDEX i_b_id(a,b,id),
-INDEX i_id(a,id)
-);
-INSERT INTO t1 VALUES
-(1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1);
-SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
-MAX(id)
-NULL
-DROP TABLE t1;
-CREATE TABLE t1(
-id int PRIMARY KEY,
-a int,
-b int,
-INDEX i_id(a,id),
-INDEX i_b_id(a,b,id)
-);
-INSERT INTO t1 VALUES
-(1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1);
-SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
-MAX(id)
-NULL
-DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(400));
INSERT INTO t1 (a) VALUES ("A"), ("a"), ("a "), ("a "),
("B"), ("b"), ("b "), ("b ");
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index b7188092b41..0149911e36b 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -152,3 +152,16 @@ ceil(0.09)
select ceil(0.000000000000000009);
ceil(0.000000000000000009)
1
+create table t1 select round(1, 6);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `round(1, 6)` decimal(7,6) NOT NULL default '0.000000'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+round(1, 6)
+1.000000
+drop table t1;
+select abs(-2) * -2;
+abs(-2) * -2
+-4
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 5335f53d382..57942d1fcdf 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -879,3 +879,18 @@ drop table t1;
select hex(29223372036854775809), hex(-29223372036854775809);
hex(29223372036854775809) hex(-29223372036854775809)
FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF
+create table t1 (i int);
+insert into t1 values (1000000000),(1);
+select lpad(i, 7, ' ') as t from t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def t 253 7 7 Y 128 31 63
+t
+1000000
+ 1
+select rpad(i, 7, ' ') as t from t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def t 253 7 7 Y 128 31 63
+t
+1000000
+1
+drop table t1;
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 93216fe2003..dfe375fd694 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -665,3 +665,8 @@ 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
drop table t1;
+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);
+ERROR 23000: Column 's1' cannot be null
+drop table t1;
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 89b3df0a83b..5688d8c2145 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -33,22 +33,22 @@ create table mysqltest.t4(a int);
create view v1 (c) as select table_name from information_schema.TABLES;
select * from v1;
c
-SCHEMATA
-TABLES
-COLUMNS
CHARACTER_SETS
COLLATIONS
COLLATION_CHARACTER_SET_APPLICABILITY
+COLUMNS
+COLUMN_PRIVILEGES
+KEY_COLUMN_USAGE
ROUTINES
-STATISTICS
-VIEWS
-USER_PRIVILEGES
+SCHEMATA
SCHEMA_PRIVILEGES
-TABLE_PRIVILEGES
-COLUMN_PRIVILEGES
+STATISTICS
+TABLES
TABLE_CONSTRAINTS
-KEY_COLUMN_USAGE
+TABLE_PRIVILEGES
TRIGGERS
+VIEWS
+USER_PRIVILEGES
columns_priv
db
func
@@ -76,8 +76,8 @@ inner join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
c table_name
TABLES TABLES
-TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_CONSTRAINTS TABLE_CONSTRAINTS
+TABLE_PRIVILEGES TABLE_PRIVILEGES
TRIGGERS TRIGGERS
tables_priv tables_priv
time_zone time_zone
@@ -94,8 +94,8 @@ left join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
c table_name
TABLES TABLES
-TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_CONSTRAINTS TABLE_CONSTRAINTS
+TABLE_PRIVILEGES TABLE_PRIVILEGES
TRIGGERS TRIGGERS
tables_priv tables_priv
time_zone time_zone
@@ -112,8 +112,8 @@ right join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
c table_name
TABLES TABLES
-TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_CONSTRAINTS TABLE_CONSTRAINTS
+TABLE_PRIVILEGES TABLE_PRIVILEGES
TRIGGERS TRIGGERS
tables_priv tables_priv
time_zone time_zone
@@ -545,7 +545,7 @@ proc is_deterministic enum('YES','NO')
proc security_type enum('INVOKER','DEFINER')
proc param_list blob
proc returns char(64)
-proc body blob
+proc body longblob
proc definer char(77)
proc created timestamp
proc modified timestamp
@@ -577,13 +577,13 @@ select TABLE_NAME,TABLE_TYPE,ENGINE
from information_schema.tables
where table_schema='information_schema' limit 2;
TABLE_NAME TABLE_TYPE ENGINE
-SCHEMATA TEMPORARY MEMORY
-TABLES TEMPORARY MEMORY
+CHARACTER_SETS TEMPORARY MEMORY
+COLLATIONS TEMPORARY MEMORY
show tables from information_schema like "T%";
Tables_in_information_schema (T%)
TABLES
-TABLE_PRIVILEGES
TABLE_CONSTRAINTS
+TABLE_PRIVILEGES
TRIGGERS
create database information_schema;
ERROR HY000: Can't create database 'information_schema'; database exists
@@ -591,8 +591,8 @@ use information_schema;
show full tables like "T%";
Tables_in_information_schema (T%) Table_type
TABLES TEMPORARY
-TABLE_PRIVILEGES TEMPORARY
TABLE_CONSTRAINTS TEMPORARY
+TABLE_PRIVILEGES TEMPORARY
TRIGGERS TEMPORARY
create table t1(a int);
ERROR 42S02: Unknown table 't1' in information_schema
@@ -603,8 +603,8 @@ use information_schema;
show tables like "T%";
Tables_in_information_schema (T%)
TABLES
-TABLE_PRIVILEGES
TABLE_CONSTRAINTS
+TABLE_PRIVILEGES
TRIGGERS
select table_name from tables where table_name='user';
table_name
@@ -689,7 +689,7 @@ show variables where variable_name like "skip_show_databas";
Variable_name Value
show global status like "Threads_running";
Variable_name Value
-Threads_running 1
+Threads_running #
create table t1(f1 int);
create table t2(f2 int);
create view v1 as select * from t1, t2;
@@ -710,17 +710,18 @@ table_schema table_name column_name
information_schema COLUMNS COLUMN_TYPE
information_schema ROUTINES ROUTINE_DEFINITION
information_schema ROUTINES SQL_MODE
-information_schema VIEWS VIEW_DEFINITION
information_schema TRIGGERS ACTION_CONDITION
information_schema TRIGGERS ACTION_STATEMENT
+information_schema TRIGGERS SQL_MODE
+information_schema VIEWS VIEW_DEFINITION
select table_name, column_name, data_type from information_schema.columns
where data_type = 'datetime';
table_name column_name data_type
+ROUTINES CREATED datetime
+ROUTINES LAST_ALTERED datetime
TABLES CREATE_TIME datetime
TABLES UPDATE_TIME datetime
TABLES CHECK_TIME datetime
-ROUTINES CREATED datetime
-ROUTINES LAST_ALTERED datetime
TRIGGERS CREATED datetime
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES A
WHERE NOT EXISTS
@@ -755,14 +756,14 @@ grant select on test.* to mysqltest_4@localhost;
SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS
where COLUMN_NAME='TABLE_NAME';
TABLE_NAME COLUMN_NAME PRIVILEGES
-TABLES TABLE_NAME select
COLUMNS TABLE_NAME select
-STATISTICS TABLE_NAME select
-VIEWS TABLE_NAME select
-TABLE_PRIVILEGES TABLE_NAME select
COLUMN_PRIVILEGES TABLE_NAME select
-TABLE_CONSTRAINTS TABLE_NAME select
KEY_COLUMN_USAGE TABLE_NAME select
+STATISTICS TABLE_NAME select
+TABLES TABLE_NAME select
+TABLE_CONSTRAINTS TABLE_NAME select
+TABLE_PRIVILEGES TABLE_NAME select
+VIEWS TABLE_NAME select
delete from mysql.user where user='mysqltest_4';
delete from mysql.db where user='mysqltest_4';
flush privileges;
@@ -790,45 +791,45 @@ set @fired:= "Yes";
end if;
end|
show triggers;
-Trigger Event Table Statement Timing Created
+Trigger Event Table Statement Timing Created sql_mode
trg1 INSERT t1
begin
if new.j > 10 then
set new.j := 10;
end if;
-end BEFORE NULL
+end BEFORE NULL
trg2 UPDATE t1
begin
if old.i % 2 = 0 then
set new.j := -1;
end if;
-end BEFORE NULL
+end BEFORE NULL
trg3 UPDATE t1
begin
if new.j = -1 then
set @fired:= "Yes";
end if;
-end AFTER NULL
+end AFTER NULL
select * from information_schema.triggers;
-TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED
+TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE
NULL test trg1 INSERT NULL test t1 0 NULL
begin
if new.j > 10 then
set new.j := 10;
end if;
-end ROW BEFORE NULL NULL OLD NEW NULL
+end ROW BEFORE NULL NULL OLD NEW NULL
NULL test trg2 UPDATE NULL test t1 0 NULL
begin
if old.i % 2 = 0 then
set new.j := -1;
end if;
-end ROW BEFORE NULL NULL OLD NEW NULL
+end ROW BEFORE NULL NULL OLD NEW NULL
NULL test trg3 UPDATE NULL test t1 0 NULL
begin
if new.j = -1 then
set @fired:= "Yes";
end if;
-end ROW AFTER NULL NULL OLD NEW NULL
+end ROW AFTER NULL NULL OLD NEW NULL
drop trigger trg1;
drop trigger trg2;
drop trigger trg3;
@@ -940,3 +941,12 @@ f5 19 NULL
f6 1 NULL
f7 64 NULL
drop table t1;
+create table t1 (f1 integer);
+create trigger tr1 after insert on t1 for each row set @test_var=42;
+use information_schema;
+select trigger_schema, trigger_name from triggers where
+trigger_name='tr1';
+trigger_schema trigger_name
+test tr1
+use test;
+drop table t1;
diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result
index ece30924055..d3ff310b812 100644
--- a/mysql-test/r/information_schema_db.result
+++ b/mysql-test/r/information_schema_db.result
@@ -1,27 +1,27 @@
use INFORMATION_SCHEMA;
show tables;
Tables_in_information_schema
-SCHEMATA
-TABLES
-COLUMNS
CHARACTER_SETS
COLLATIONS
COLLATION_CHARACTER_SET_APPLICABILITY
+COLUMNS
+COLUMN_PRIVILEGES
+KEY_COLUMN_USAGE
ROUTINES
-STATISTICS
-VIEWS
-USER_PRIVILEGES
+SCHEMATA
SCHEMA_PRIVILEGES
-TABLE_PRIVILEGES
-COLUMN_PRIVILEGES
+STATISTICS
+TABLES
TABLE_CONSTRAINTS
-KEY_COLUMN_USAGE
+TABLE_PRIVILEGES
TRIGGERS
+VIEWS
+USER_PRIVILEGES
show tables from INFORMATION_SCHEMA like 'T%';
Tables_in_information_schema (T%)
TABLES
-TABLE_PRIVILEGES
TABLE_CONSTRAINTS
+TABLE_PRIVILEGES
TRIGGERS
create database `inf%`;
use `inf%`;
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 2c73cbeeea4..2bdec5125dd 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1452,16 +1452,16 @@ Error 1146 Table 'test.t4' doesn't exist
checksum table t1, t2, t3, t4;
Table Checksum
test.t1 2948697075
-test.t2 1157260244
-test.t3 1157260244
+test.t2 3835700799
+test.t3 3835700799
test.t4 NULL
Warnings:
Error 1146 Table 'test.t4' doesn't exist
checksum table t1, t2, t3, t4 extended;
Table Checksum
test.t1 3092701434
-test.t2 1157260244
-test.t3 1157260244
+test.t2 3835700799
+test.t3 3835700799
test.t4 NULL
Warnings:
Error 1146 Table 'test.t4' doesn't exist
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index 3ad8571aadd..bce02a1cb0f 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -354,3 +354,28 @@ t1 CREATE TABLE `t1` (
KEY `a` (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+create table t1 (a int not null primary key, b varchar(20) not null unique);
+desc t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI
+b varchar(20) NO UNI
+drop table t1;
+create table t1 (a int not null primary key, b int not null unique);
+desc t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI
+b int(11) NO UNI
+drop table t1;
+create table t1 (a int not null primary key, b varchar(20) not null, unique (b(10)));
+desc t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI
+b varchar(20) NO UNI
+drop table t1;
+create table t1 (a int not null primary key, b varchar(20) not null, c varchar(20) not null, unique(b(10),c(10)));
+desc t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI
+b varchar(20) NO MUL
+c varchar(20) NO
+drop table t1;
diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result
index 7c286ced58a..b3aa4c5061c 100644
--- a/mysql-test/r/key_cache.result
+++ b/mysql-test/r/key_cache.result
@@ -23,13 +23,13 @@ SELECT @@global.default.key_buffer_size;
@@global.default.key_buffer_size
16777216
SELECT @@global.default.`key_buffer_size`;
-@@global.default.key_buffer_size
+@@global.default.`key_buffer_size`
16777216
SELECT @@global.`default`.`key_buffer_size`;
-@@global.default.key_buffer_size
+@@global.`default`.`key_buffer_size`
16777216
SELECT @@`default`.key_buffer_size;
-@@default.key_buffer_size
+@@`default`.key_buffer_size
16777216
SELECT @@small.key_buffer_size;
@@small.key_buffer_size
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 8239202fc04..71cb76fe844 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -506,7 +506,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct
drop table t1,t2;
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM;
-ERROR 42000: This version of MySQL doesn't yet support 'RTREE INDEX'
+Got one of the listed errors
create table t1 (a int, b varchar(200), c text not null) checksum=1;
create table t2 (a int, b varchar(200), c text not null) checksum=0;
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index bf783402921..917724580cf 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -1,6 +1,5 @@
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa;
drop database if exists mysqldump_test_db;
-drop database if exists db1;
drop view if exists v1, v2, v3;
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2);
@@ -357,46 +356,6 @@ CREATE TABLE `t1` (
2
3
drop table t1;
-create table t1(a int);
-create view v1 as select * from t1;
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-DROP TABLE IF EXISTS `t1`;
-CREATE TABLE `t1` (
- `a` int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-
-
-/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-LOCK TABLES `t1` WRITE;
-UNLOCK TABLES;
-/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
-DROP TABLE IF EXISTS `v1`;
-DROP VIEW IF EXISTS `v1`;
-CREATE TABLE `v1` (
- `a` int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-DROP TABLE IF EXISTS `v1`;
-DROP VIEW IF EXISTS `v1`;
-CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from `test`.`t1`;
-
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
-/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-
-drop view v1;
-drop table t1;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -605,38 +564,6 @@ UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE t1;
-CREATE TABLE t1 (a char(10));
-INSERT INTO t1 VALUES ('\'');
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-DROP TABLE IF EXISTS `t1`;
-CREATE TABLE `t1` (
- `a` char(10) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-
-
-/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-LOCK TABLES `t1` WRITE;
-INSERT INTO `t1` VALUES ('\'');
-UNLOCK TABLES;
-/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
-
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
-/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-
-DROP TABLE t1;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t1 VALUES (4),(5),(6);
@@ -1428,59 +1355,6 @@ UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE t1;
-create database db1;
-use db1;
-CREATE TABLE t2 (
-a varchar(30) default NULL,
-KEY a (a(5))
-);
-INSERT INTO t2 VALUES ('alfred');
-INSERT INTO t2 VALUES ('angie');
-INSERT INTO t2 VALUES ('bingo');
-INSERT INTO t2 VALUES ('waffle');
-INSERT INTO t2 VALUES ('lemon');
-create view v2 as select * from t2 where a like 'a%' with check option;
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-DROP TABLE IF EXISTS `t2`;
-CREATE TABLE `t2` (
- `a` varchar(30) default NULL,
- KEY `a` (`a`(5))
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-
-
-/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
-LOCK TABLES `t2` WRITE;
-INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon');
-UNLOCK TABLES;
-/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
-DROP TABLE IF EXISTS `v2`;
-DROP VIEW IF EXISTS `v2`;
-CREATE TABLE `v2` (
- `a` varchar(30) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-DROP TABLE IF EXISTS `v2`;
-DROP VIEW IF EXISTS `v2`;
-CREATE ALGORITHM=UNDEFINED VIEW `db1`.`v2` AS select `db1`.`t2`.`a` AS `a` from `db1`.`t2` where (`db1`.`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION;
-
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
-/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-
-drop table t2;
-drop view v2;
-drop database db1;
CREATE DATABASE mysqldump_test_db;
USE mysqldump_test_db;
CREATE TABLE t1 ( a INT );
@@ -1647,6 +1521,132 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir
</database>
</mysqldump>
drop table t1, t2;
+create table t1(a int);
+create view v1 as select * from t1;
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `a` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+LOCK TABLES `t1` WRITE;
+UNLOCK TABLES;
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+DROP TABLE IF EXISTS `v1`;
+/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 CREATE TABLE `v1` (
+ `a` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1*/;
+/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from `test`.`t1`*/;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+drop view v1;
+drop table t1;
+create database mysqldump_test_db;
+use mysqldump_test_db;
+CREATE TABLE t2 (
+a varchar(30) default NULL,
+KEY a (a(5))
+);
+INSERT INTO t2 VALUES ('alfred');
+INSERT INTO t2 VALUES ('angie');
+INSERT INTO t2 VALUES ('bingo');
+INSERT INTO t2 VALUES ('waffle');
+INSERT INTO t2 VALUES ('lemon');
+create view v2 as select * from t2 where a like 'a%' with check option;
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS `t2`;
+CREATE TABLE `t2` (
+ `a` varchar(30) default NULL,
+ KEY `a` (`a`(5))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+
+/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
+LOCK TABLES `t2` WRITE;
+INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon');
+UNLOCK TABLES;
+/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
+DROP TABLE IF EXISTS `v2`;
+/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 CREATE TABLE `v2` (
+ `a` varchar(30) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1*/;
+/*!50001 DROP TABLE IF EXISTS `v2`*/;
+/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 CREATE ALGORITHM=UNDEFINED VIEW `mysqldump_test_db`.`v2` AS select `mysqldump_test_db`.`t2`.`a` AS `a` from `mysqldump_test_db`.`t2` where (`mysqldump_test_db`.`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION*/;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+drop table t2;
+drop view v2;
+drop database mysqldump_test_db;
+use test;
+CREATE TABLE t1 (a char(10));
+INSERT INTO t1 VALUES ('\'');
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `a` char(10) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+LOCK TABLES `t1` WRITE;
+INSERT INTO `t1` VALUES ('\'');
+UNLOCK TABLES;
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+DROP TABLE t1;
create table t1(a int, b int, c varchar(30));
insert into t1 values(1, 2, "one"), (2, 4, "two"), (3, 6, "three");
create view v3 as
@@ -1685,6 +1685,7 @@ end|
create trigger trg2 before update on t1 for each row begin
if old.a % 2 = 0 then set new.b := 12; end if;
end|
+set sql_mode="traditional"|
create trigger trg3 after update on t1 for each row
begin
if new.a = -1 then
@@ -1697,24 +1698,25 @@ if new.a > 10 then
set @fired:= "No";
end if;
end|
+set sql_mode=default|
show triggers like "t1";
-Trigger Event Table Statement Timing Created
+Trigger Event Table Statement Timing Created sql_mode
trg1 INSERT t1
begin
if new.a > 10 then
set new.a := 10;
set new.a := 11;
end if;
-end BEFORE 0000-00-00 00:00:00
+end BEFORE 0000-00-00 00:00:00
trg2 UPDATE t1 begin
if old.a % 2 = 0 then set new.b := 12; end if;
-end BEFORE 0000-00-00 00:00:00
+end BEFORE 0000-00-00 00:00:00
trg3 UPDATE t1
begin
if new.a = -1 then
set @fired:= "Yes";
end if;
-end AFTER 0000-00-00 00:00:00
+end AFTER 0000-00-00 00:00:00 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
INSERT INTO t1 (a) VALUES (1),(2),(3),(22);
update t1 set a = 4 where a=3;
@@ -1736,30 +1738,32 @@ CREATE TABLE `t1` (
`b` bigint(20) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
DELIMITER //;
-CREATE TRIGGER `trg1` BEFORE INSERT ON `t1`
-FOR EACH ROW
+/*!50003 SET SESSION SQL_MODE=""*/ //
+/*!50003 CREATE TRIGGER `trg1` BEFORE INSERT ON `t1` FOR EACH ROW
begin
if new.a > 10 then
set new.a := 10;
set new.a := 11;
end if;
-end//
+end*/ //
-CREATE TRIGGER `trg2` BEFORE UPDATE ON `t1`
-FOR EACH ROW begin
+/*!50003 SET SESSION SQL_MODE=""*/ //
+/*!50003 CREATE TRIGGER `trg2` BEFORE UPDATE ON `t1` FOR EACH ROW begin
if old.a % 2 = 0 then set new.b := 12; end if;
-end//
+end*/ //
-CREATE TRIGGER `trg3` AFTER UPDATE ON `t1`
-FOR EACH ROW
+/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER"*/ //
+/*!50003 CREATE TRIGGER `trg3` AFTER UPDATE ON `t1` FOR EACH ROW
begin
if new.a = -1 then
set @fired:= "Yes";
end if;
-end//
+end*/ //
DELIMITER ;//
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
LOCK TABLES `t1` WRITE;
@@ -1771,16 +1775,18 @@ CREATE TABLE `t2` (
`a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
DELIMITER //;
-CREATE TRIGGER `trg4` BEFORE INSERT ON `t2`
-FOR EACH ROW
+/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER"*/ //
+/*!50003 CREATE TRIGGER `trg4` BEFORE INSERT ON `t2` FOR EACH ROW
begin
if new.a > 10 then
set @fired:= "No";
end if;
-end//
+end*/ //
DELIMITER ;//
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
LOCK TABLES `t2` WRITE;
@@ -1844,4 +1850,28 @@ show tables;
Tables_in_test
t1
t2
+show triggers;
+Trigger Event Table Statement Timing Created sql_mode
+trg1 INSERT t1
+begin
+if new.a > 10 then
+set new.a := 10;
+set new.a := 11;
+end if;
+end BEFORE #
+trg2 UPDATE t1 begin
+if old.a % 2 = 0 then set new.b := 12; end if;
+end BEFORE #
+trg3 UPDATE t1
+begin
+if new.a = -1 then
+set @fired:= "Yes";
+end if;
+end AFTER # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+trg4 INSERT t2
+begin
+if new.a > 10 then
+set @fired:= "No";
+end if;
+end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
DROP TABLE t1, t2;
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 2b171229096..256576704b5 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -164,3 +164,5 @@ root@localhost
. - is longer then 80 characters and
. - consists of several lines
--------------------------------------------------------------------------------
+this will be executed
+this will be executed
diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/r/ndb_condition_pushdown.result
index 14cd4666528..1c3da1b486f 100644
--- a/mysql-test/r/ndb_condition_pushdown.result
+++ b/mysql-test/r/ndb_condition_pushdown.result
@@ -1514,7 +1514,7 @@ select auto from t1 where
'1901-01-01 01:01:01' in(date_time)
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort
+1 SIMPLE t1 ref medium_index medium_index 3 const 10 Using where with pushed condition; Using filesort
select auto from t1 where
"aaaa" in(string) and
"aaaa" in(vstring) and
diff --git a/mysql-test/r/ndb_config.result b/mysql-test/r/ndb_config.result
new file mode 100644
index 00000000000..c2557f85c0b
--- /dev/null
+++ b/mysql-test/r/ndb_config.result
@@ -0,0 +1,5 @@
+ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysqld,6, mysqld,7,
+1,localhost,41943040,12582912 2,localhost,41943040,12582912
+1 localhost 41943040 12582912
+2 localhost 41943040 12582912
+1 2
diff --git a/mysql-test/r/not_embedded_server.result b/mysql-test/r/not_embedded_server.result
new file mode 100644
index 00000000000..082ebe72ba4
--- /dev/null
+++ b/mysql-test/r/not_embedded_server.result
@@ -0,0 +1,5 @@
+prepare stmt1 from ' show full processlist ';
+execute stmt1;
+Id User Host db Command Time State Info
+number root localhost test Execute time NULL show full processlist
+deallocate prepare stmt1;
diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result
index b9824cc4b81..7f746a3dbd8 100644
--- a/mysql-test/r/null_key.result
+++ b/mysql-test/r/null_key.result
@@ -369,3 +369,63 @@ select * from t1;
id id2
1 1
drop table t1;
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int, b int, INDEX idx(a));
+CREATE TABLE t3 (b int, INDEX idx(b));
+CREATE TABLE t4 (b int, INDEX idx(b));
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+INSERT INTO t2 VALUES (1, 1), (3, 1);
+INSERT INTO t3 VALUES
+(NULL), (NULL), (NULL), (NULL), (NULL),
+(NULL), (NULL), (NULL), (NULL), (NULL);
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t3 VALUES (2), (3);
+ANALYZE table t1, t2, t3;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+test.t2 analyze status OK
+test.t3 analyze status OK
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+15972
+EXPLAIN SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
+LEFT JOIN t3 ON t2.b=t3.b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4
+1 SIMPLE t2 ref idx idx 5 test.t1.a 1
+1 SIMPLE t3 ref idx idx 5 test.t2.b 1 Using index
+FLUSH STATUS ;
+SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
+LEFT JOIN t3 ON t2.b=t3.b;
+a a b b
+1 1 1 NULL
+2 NULL NULL NULL
+3 3 1 NULL
+4 NULL NULL NULL
+SELECT FOUND_ROWS();
+FOUND_ROWS()
+4
+SHOW STATUS LIKE "handler_read%";
+Variable_name Value
+Handler_read_first 0
+Handler_read_key 6
+Handler_read_next 2
+Handler_read_prev 0
+Handler_read_rnd 0
+Handler_read_rnd_next 5
+DROP TABLE t1,t2,t3,t4;
diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
index f2d60ac5025..7fb1e1b4df4 100644
--- a/mysql-test/r/ps_1general.result
+++ b/mysql-test/r/ps_1general.result
@@ -349,7 +349,7 @@ execute stmt1 ;
ERROR 42S02: Unknown table 't5'
prepare stmt1 from ' SELECT @@version ' ;
execute stmt1 ;
-@@VERSION
+@@version
<version>
prepare stmt_do from ' do @var:= (1 in (select a from t1)) ' ;
prepare stmt_set from ' set @var= (1 in (select a from t1)) ' ;
diff --git a/mysql-test/r/ps_grant.result b/mysql-test/r/ps_grant.result
index 651ac171e5d..fdc1f97bb4c 100644
--- a/mysql-test/r/ps_grant.result
+++ b/mysql-test/r/ps_grant.result
@@ -54,6 +54,7 @@ my_col
4
execute s_t9 ;
ERROR 42S02: Table 'mysqltest.t9' doesn't exist
+deallocate prepare s_t9;
revoke all privileges on mysqltest.t1 from second_user@localhost
identified by 'looser' ;
show grants for second_user@localhost ;
@@ -87,8 +88,3 @@ revoke all privileges on test.t1 from drop_user@localhost ;
prepare stmt3 from ' drop user drop_user@localhost ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
drop user drop_user@localhost;
-prepare stmt4 from ' show full processlist ';
-execute stmt4;
-Id User Host db Command Time State Info
-number root localhost test Execute time NULL show full processlist
-deallocate prepare stmt4;
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 699d81d4cef..6ff49951d27 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -152,82 +152,6 @@ show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
drop table t1, t2, t3;
-create table t1 (a int not null);
-insert into t1 values (1),(2),(3);
-create table t2 (a int not null);
-insert into t2 values (1),(2),(3);
-select * from t1;
-a
-1
-2
-3
-select * from t2;
-a
-1
-2
-3
-insert into t1 values (4);
-show status like "Qcache_free_blocks";
-Variable_name Value
-Qcache_free_blocks 2
-flush query cache;
-show status like "Qcache_free_blocks";
-Variable_name Value
-Qcache_free_blocks 1
-drop table t1, t2;
-create table t1 (a text not null);
-create table t11 (a text not null);
-create table t2 (a text not null);
-create table t21 (a text not null);
-create table t3 (a text not null);
-insert into t1 values("1111111111111111111111111111111111111111111111111111");
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t11 select * from t1;
-insert into t21 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t3 select * from t1;
-insert into t3 select * from t2;
-insert into t3 select * from t1;
-select * from t11;
-select * from t21;
-show status like "Qcache_total_blocks";
-Variable_name Value
-Qcache_total_blocks 7
-show status like "Qcache_free_blocks";
-Variable_name Value
-Qcache_free_blocks 1
-insert into t11 values("");
-select * from t3;
-show status like "Qcache_total_blocks";
-Variable_name Value
-Qcache_total_blocks 8
-show status like "Qcache_free_blocks";
-Variable_name Value
-Qcache_free_blocks 1
-flush query cache;
-show status like "Qcache_total_blocks";
-Variable_name Value
-Qcache_total_blocks 7
-show status like "Qcache_free_blocks";
-Variable_name Value
-Qcache_free_blocks 1
-drop table t1, t2, t3, t11, t21;
set query_cache_type=demand;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
@@ -852,6 +776,7 @@ Qcache_hits 6
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 4
+SET NAMES default;
DROP TABLE t1;
CREATE TABLE t1 (a int(1));
CREATE DATABASE mysqltest;
@@ -1007,6 +932,8 @@ abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab
zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba
flush query cache;
drop table t1, t2;
+set GLOBAL query_cache_size=1355776
+#;
flush status;
CREATE TABLE t1 (
`date` datetime NOT NULL default '0000-00-00 00:00:00',
@@ -1014,24 +941,30 @@ KEY `date` (`date`)
) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('20050326');
INSERT INTO t1 VALUES ('20050325');
-SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 0:0:0';
+SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid';
COUNT(*)
0
Warnings:
-Warning 1292 Incorrect datetime value: '20050327 0:0:0' for column 'date' at row 1
-Warning 1292 Incorrect datetime value: '20050327 0:0:0' for column 'date' at row 1
-SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 0:0:0';
+Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
+Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
+Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid'
+Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid'
+SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 invalid';
COUNT(*)
0
Warnings:
-Warning 1292 Incorrect datetime value: '20050328 0:0:0' for column 'date' at row 1
-Warning 1292 Incorrect datetime value: '20050328 0:0:0' for column 'date' at row 1
-SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 0:0:0';
+Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1
+Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1
+Warning 1292 Truncated incorrect INTEGER value: '20050328 invalid'
+Warning 1292 Truncated incorrect INTEGER value: '20050328 invalid'
+SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid';
COUNT(*)
0
Warnings:
-Warning 1292 Incorrect datetime value: '20050327 0:0:0' for column 'date' at row 1
-Warning 1292 Incorrect datetime value: '20050327 0:0:0' for column 'date' at row 1
+Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
+Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
+Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid'
+Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid'
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
@@ -1123,4 +1056,80 @@ a f1()
2 2
drop procedure p1//
drop table t1//
+flush query cache;
+reset query cache;
+flush status;
+create table t1 (s1 int)//
+create procedure f1 () begin
+select sql_cache * from t1;
+select sql_cache * from t1;
+end;//
+call f1();
+s1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+call f1();
+s1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+call f1();
+s1
+select sql_cache * from t1;
+s1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 5
+insert into t1 values (1);
+select sql_cache * from t1;
+s1
+1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 3
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 5
+call f1();
+s1
+1
+call f1();
+s1
+1
+select sql_cache * from t1;
+s1
+1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 4
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 9
+drop procedure f1;
+drop table t1;
set GLOBAL query_cache_size=0;
diff --git a/mysql-test/r/query_cache_notembedded.result b/mysql-test/r/query_cache_notembedded.result
new file mode 100644
index 00000000000..16a397f78b6
--- /dev/null
+++ b/mysql-test/r/query_cache_notembedded.result
@@ -0,0 +1,83 @@
+set GLOBAL query_cache_size=1355776;
+flush query cache;
+flush query cache;
+reset query cache;
+flush status;
+drop table if exists t1, t2, t3, t11, t21;
+create table t1 (a int not null);
+insert into t1 values (1),(2),(3);
+create table t2 (a int not null);
+insert into t2 values (1),(2),(3);
+select * from t1;
+a
+1
+2
+3
+select * from t2;
+a
+1
+2
+3
+insert into t1 values (4);
+show status like "Qcache_free_blocks";
+Variable_name Value
+Qcache_free_blocks 2
+flush query cache;
+show status like "Qcache_free_blocks";
+Variable_name Value
+Qcache_free_blocks 1
+drop table t1, t2;
+create table t1 (a text not null);
+create table t11 (a text not null);
+create table t2 (a text not null);
+create table t21 (a text not null);
+create table t3 (a text not null);
+insert into t1 values("1111111111111111111111111111111111111111111111111111");
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t11 select * from t1;
+insert into t21 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t3 select * from t1;
+insert into t3 select * from t2;
+insert into t3 select * from t1;
+select * from t11;
+select * from t21;
+show status like "Qcache_total_blocks";
+Variable_name Value
+Qcache_total_blocks 7
+show status like "Qcache_free_blocks";
+Variable_name Value
+Qcache_free_blocks 1
+insert into t11 values("");
+select * from t3;
+show status like "Qcache_total_blocks";
+Variable_name Value
+Qcache_total_blocks 8
+show status like "Qcache_free_blocks";
+Variable_name Value
+Qcache_free_blocks 1
+flush query cache;
+show status like "Qcache_total_blocks";
+Variable_name Value
+Qcache_total_blocks 7
+show status like "Qcache_free_blocks";
+Variable_name Value
+Qcache_free_blocks 1
+drop table t1, t2, t3, t11, t21;
+set GLOBAL query_cache_size=0;
diff --git a/mysql-test/r/rpl_slave_status.result b/mysql-test/r/rpl_slave_status.result
new file mode 100644
index 00000000000..8badbab85ff
--- /dev/null
+++ b/mysql-test/r/rpl_slave_status.result
@@ -0,0 +1,54 @@
+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 rpl@127.0.0.1 identified by 'rpl';
+stop slave;
+change master to master_user='rpl',master_password='rpl';
+start slave;
+drop table if exists t1;
+create table t1 (n int);
+insert into t1 values (1);
+select * from t1;
+n
+1
+delete from mysql.user where user='rpl';
+flush privileges;
+stop slave;
+start slave;
+show slave status;
+Slave_IO_State Connecting to master
+Master_Host 127.0.0.1
+Master_User rpl
+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 No
+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 No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master NULL
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 14c45270b04..a0f6bb7084f 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2492,6 +2492,99 @@ select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid
id name gid uid ident level
1 fs NULL NULL 0 READ
drop table t1,t2,t3;
+CREATE TABLE t1 (
+acct_id int(11) NOT NULL default '0',
+profile_id smallint(6) default NULL,
+UNIQUE KEY t1$acct_id (acct_id),
+KEY t1$profile_id (profile_id)
+);
+INSERT INTO t1 VALUES (132,17),(133,18);
+CREATE TABLE t2 (
+profile_id smallint(6) default NULL,
+queue_id int(11) default NULL,
+seq int(11) default NULL,
+KEY t2$queue_id (queue_id)
+);
+INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1);
+CREATE TABLE t3 (
+id int(11) NOT NULL default '0',
+qtype int(11) default NULL,
+seq int(11) default NULL,
+warn_lvl int(11) default NULL,
+crit_lvl int(11) default NULL,
+rr1 tinyint(4) NOT NULL default '0',
+rr2 int(11) default NULL,
+default_queue tinyint(4) NOT NULL default '0',
+KEY t3$qtype (qtype),
+KEY t3$id (id)
+);
+INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0),
+(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0);
+SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q
+WHERE
+(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND
+(pq.queue_id = q.id) AND (q.rr1 <> 1);
+COUNT(*)
+4
+drop table t1,t2,t3;
+create table t1 (f1 int);
+insert into t1 values (1),(NULL);
+create table t2 (f2 int, f3 int, f4 int);
+create index idx1 on t2 (f4);
+insert into t2 values (1,2,3),(2,4,6);
+select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3)
+from t2 C where A.f4 = C.f4) or A.f3 IS NULL;
+f2
+1
+NULL
+drop table t1,t2;
+create table t2 (a tinyint unsigned);
+create index t2i on t2(a);
+insert into t2 values (0), (254), (255);
+explain select * from t2 where a > -1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index
+select * from t2 where a > -1;
+a
+0
+254
+255
+drop table t2;
+CREATE TABLE t1 (a int, b int, c int);
+INSERT INTO t1
+SELECT 50, 3, 3 FROM DUAL
+WHERE NOT EXISTS
+(SELECT * FROM t1 WHERE a = 50 AND b = 3);
+SELECT * FROM t1;
+a b c
+50 3 3
+INSERT INTO t1
+SELECT 50, 3, 3 FROM DUAL
+WHERE NOT EXISTS
+(SELECT * FROM t1 WHERE a = 50 AND b = 3);
+select found_rows();
+found_rows()
+0
+SELECT * FROM t1;
+a b c
+50 3 3
+select count(*) from t1;
+count(*)
+1
+select found_rows();
+found_rows()
+1
+select count(*) from t1 limit 2,3;
+count(*)
+select found_rows();
+found_rows()
+0
+select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3;
+count(*)
+select found_rows();
+found_rows()
+1
+DROP TABLE t1;
CREATE TABLE t1 ( city char(30) );
INSERT INTO t1 VALUES ('London');
INSERT INTO t1 VALUES ('Paris');
@@ -2579,25 +2672,6 @@ K2C4 K4N4 F2I4
WART 0100 1
WART 0200 1
WART 0300 3
-select found_rows();
-found_rows()
-3
-select count(*) from t1;
-count(*)
-15
-select found_rows();
-found_rows()
-1
-select count(*) from t1 limit 2,3;
-count(*)
-select found_rows();
-found_rows()
-0
-select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3;
-count(*)
-select found_rows();
-found_rows()
-1
DROP TABLE t1;
CREATE TABLE t1 ( a BLOB, INDEX (a(20)) );
CREATE TABLE t2 ( a BLOB, INDEX (a(20)) );
@@ -2612,51 +2686,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
1 SIMPLE t2 ref a a 23 test.t1.a 2
DROP TABLE t1, t2;
-CREATE TABLE t1 ( city char(30) );
-INSERT INTO t1 VALUES ('London');
-INSERT INTO t1 VALUES ('Paris');
-SELECT * FROM t1 WHERE city='London';
-city
-London
-SELECT * FROM t1 WHERE city='london';
-city
-London
-EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
-SELECT * FROM t1 WHERE city='London' AND city='london';
-city
-London
-EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
-SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
-city
-London
-DROP TABLE t1;
-create table t1 (a int(11) unsigned, b int(11) unsigned);
-insert into t1 values (1,0), (1,1), (1,2);
-select a-b from t1 order by 1;
-a-b
-0
-1
-18446744073709551615
-select a-b , (a-b < 0) from t1 order by 1;
-a-b (a-b < 0)
-0 0
-1 0
-18446744073709551615 0
-select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0;
-d (a-b >= 0) b
-1 1 0
-0 1 1
-18446744073709551615 1 2
-select cast((a - b) as unsigned) from t1 order by 1;
-cast((a - b) as unsigned)
-0
-1
-18446744073709551615
-drop table t1;
create table t1 (a int, b int);
create table t2 like t1;
select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1;
@@ -2730,77 +2759,3 @@ DROP TABLE t1,t2;
select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0;
x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0
16 16 2 2
-CREATE TABLE t1 (
-acct_id int(11) NOT NULL default '0',
-profile_id smallint(6) default NULL,
-UNIQUE KEY t1$acct_id (acct_id),
-KEY t1$profile_id (profile_id)
-);
-INSERT INTO t1 VALUES (132,17),(133,18);
-CREATE TABLE t2 (
-profile_id smallint(6) default NULL,
-queue_id int(11) default NULL,
-seq int(11) default NULL,
-KEY t2$queue_id (queue_id)
-);
-INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1);
-CREATE TABLE t3 (
-id int(11) NOT NULL default '0',
-qtype int(11) default NULL,
-seq int(11) default NULL,
-warn_lvl int(11) default NULL,
-crit_lvl int(11) default NULL,
-rr1 tinyint(4) NOT NULL default '0',
-rr2 int(11) default NULL,
-default_queue tinyint(4) NOT NULL default '0',
-KEY t3$qtype (qtype),
-KEY t3$id (id)
-);
-INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0),
-(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0);
-SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q
-WHERE
-(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND
-(pq.queue_id = q.id) AND (q.rr1 <> 1);
-COUNT(*)
-4
-drop table t1,t2,t3;
-create table t1 (f1 int);
-insert into t1 values (1),(NULL);
-create table t2 (f2 int, f3 int, f4 int);
-create index idx1 on t2 (f4);
-insert into t2 values (1,2,3),(2,4,6);
-select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3)
-from t2 C where A.f4 = C.f4) or A.f3 IS NULL;
-f2
-1
-NULL
-drop table t1,t2;
-create table t2 (a tinyint unsigned);
-create index t2i on t2(a);
-insert into t2 values (0), (254), (255);
-explain select * from t2 where a > -1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index
-select * from t2 where a > -1;
-a
-0
-254
-255
-drop table t2;
-CREATE TABLE t1 (a int, b int, c int);
-INSERT INTO t1
-SELECT 50, 3, 3 FROM DUAL
-WHERE NOT EXISTS
-(SELECT * FROM t1 WHERE a = 50 AND b = 3);
-SELECT * FROM t1;
-a b c
-50 3 3
-INSERT INTO t1
-SELECT 50, 3, 3 FROM DUAL
-WHERE NOT EXISTS
-(SELECT * FROM t1 WHERE a = 50 AND b = 3);
-SELECT * FROM t1;
-a b c
-50 3 3
-DROP TABLE t1;
diff --git a/mysql-test/r/select_safe.result b/mysql-test/r/select_safe.result
index 7a29db42dd9..5d458c40f34 100644
--- a/mysql-test/r/select_safe.result
+++ b/mysql-test/r/select_safe.result
@@ -60,9 +60,6 @@ a b
3 a
4 a
5 a
-SELECT @@MAX_SEEKS_FOR_KEY;
-@@MAX_SEEKS_FOR_KEY
-4294967295
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
diff --git a/mysql-test/r/sp-big.result b/mysql-test/r/sp-big.result
new file mode 100644
index 00000000000..004ff586aab
--- /dev/null
+++ b/mysql-test/r/sp-big.result
@@ -0,0 +1,15 @@
+drop procedure if exists test.longprocedure;
+drop table if exists t1;
+create table t1 (a int);
+insert into t1 values (1),(2),(3);
+length
+107520
+select length(routine_definition) from information_schema.routines where routine_schema = 'test' and routine_name = 'longprocedure';
+length(routine_definition)
+107530
+call test.longprocedure(@value);
+select @value;
+@value
+3
+drop procedure test.longprocedure;
+drop table t1;
diff --git a/mysql-test/r/sp-prelocking.result b/mysql-test/r/sp-prelocking.result
new file mode 100644
index 00000000000..32d6d4e6264
--- /dev/null
+++ b/mysql-test/r/sp-prelocking.result
@@ -0,0 +1,215 @@
+drop database if exists mysqltest;
+drop table if exists t1, t2, t3, t4;
+drop procedure if exists sp1;
+drop procedure if exists sp2;
+drop procedure if exists sp3;
+drop procedure if exists sp4;
+drop function if exists f1;
+drop function if exists f2;
+drop function if exists f3;
+create database mysqltest;
+use mysqltest//
+create procedure sp1 ()
+begin
+drop table if exists t1;
+select 1 as "my-col";
+end;
+//
+select database();
+database()
+mysqltest
+call sp1();
+my-col
+1
+Warnings:
+Note 1051 Unknown table 't1'
+select database();
+database()
+mysqltest
+use test;
+select database();
+database()
+test
+call mysqltest.sp1();
+my-col
+1
+Warnings:
+Note 1051 Unknown table 't1'
+select database();
+database()
+test
+drop procedure mysqltest.sp1;
+drop database mysqltest;
+create procedure sp1()
+begin
+create table t1 (a int);
+insert into t1 values (10);
+end//
+create procedure sp2()
+begin
+create table t2(a int);
+insert into t2 values(1);
+call sp1();
+end//
+create function f1() returns int
+begin
+return (select max(a) from t1);
+end//
+create procedure sp3()
+begin
+call sp1();
+select 'func', f1();
+end//
+call sp1();
+select 't1',a from t1;
+t1 a
+t1 10
+drop table t1;
+call sp2();
+select 't1',a from t1;
+t1 a
+t1 10
+select 't2',a from t2;
+t2 a
+t2 1
+drop table t1, t2;
+call sp3();
+func f1()
+func 10
+select 't1',a from t1;
+t1 a
+t1 10
+drop table t1;
+drop procedure sp1;
+drop procedure sp2;
+drop procedure sp3;
+drop function f1;
+create procedure sp1()
+begin
+create temporary table t2(a int);
+insert into t2 select * from t1;
+end//
+create procedure sp2()
+begin
+create temporary table t1 (a int);
+insert into t1 values(1);
+call sp1();
+select 't1', a from t1;
+select 't2', a from t2;
+drop table t1;
+drop table t2;
+end//
+call sp2();
+t1 a
+t1 1
+t2 a
+t2 1
+drop procedure sp1;
+drop procedure sp2;
+create table t1 (a int);
+insert into t1 values(1),(2);
+create table t2 as select * from t1;
+create table t3 as select * from t1;
+create table t4 as select * from t1;
+create procedure sp1(a int)
+begin
+select a;
+end //
+create function f1() returns int
+begin
+return (select max(a) from t1);
+end //
+CALL sp1(f1());
+a
+2
+create procedure sp2(a int)
+begin
+select * from t3;
+select a;
+end //
+create procedure sp3()
+begin
+select * from t1;
+call sp2(5);
+end //
+create procedure sp4()
+begin
+select * from t2;
+call sp3();
+end //
+call sp4();
+a
+1
+2
+a
+1
+2
+a
+1
+2
+a
+5
+drop procedure sp1;
+drop procedure sp2;
+drop procedure sp3;
+drop procedure sp4;
+drop function f1;
+drop view if exists v1;
+create function f1(ab int) returns int
+begin
+declare i int;
+set i= (select max(a) from t1 where a < ab) ;
+return i;
+end //
+create function f2(ab int) returns int
+begin
+declare i int;
+set i= (select max(a) from t2 where a < ab) ;
+return i;
+end //
+create view v1 as
+select t3.a as x, t4.a as y, f2(3) as z
+from t3, t4 where t3.a = t4.a //
+create procedure sp1()
+begin
+declare a int;
+set a= (select f1(4) + count(*) A from t1, v1);
+end //
+create function f3() returns int
+begin
+call sp1();
+return 1;
+end //
+call sp1() //
+select f3() //
+f3()
+1
+select f3() //
+f3()
+1
+call sp1() //
+drop procedure sp1//
+drop function f3//
+create procedure sp1()
+begin
+declare x int;
+declare c cursor for select f1(3) + count(*) from v1;
+open c;
+fetch c into x;
+end;//
+create function f3() returns int
+begin
+call sp1();
+return 1;
+end //
+call sp1() //
+call sp1() //
+select f3() //
+f3()
+1
+call sp1() //
+drop table t1,t2,t3;
+drop function f1;
+drop function f2;
+drop function f3;
+drop procedure sp1;
diff --git a/mysql-test/r/sp-threads.result b/mysql-test/r/sp-threads.result
index e6b8128c336..2f7e8021aa7 100644
--- a/mysql-test/r/sp-threads.result
+++ b/mysql-test/r/sp-threads.result
@@ -35,7 +35,7 @@ lock tables t2 write;
show processlist;
Id User Host db Command Time State Info
# root localhost test Sleep # NULL
-# root localhost test Query # Locked call bug9486()
+# root localhost test Query # Locked update t1, t2 set val= 1 where id1=id2
# root localhost test Query # NULL show processlist
unlock tables;
drop procedure bug9486;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index fd63204e32f..e04f8fce5c4 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -1,10 +1,9 @@
use test;
-drop table if exists t1;
+drop table if exists t1,t2,t3,t4;
create table t1 (
id char(16) not null default '',
data int not null
);
-drop table if exists t2;
create table t2 (
s char(16),
i int,
@@ -85,7 +84,6 @@ foo 1
kaka 3
delete from t1|
drop procedure setcontext|
-drop table if exists t3|
create table t3 ( d date, i int, f double, s varchar(32) )|
drop procedure if exists nullset|
create procedure nullset()
@@ -521,7 +519,6 @@ select data into x from test.t1 limit 1;
insert into test.t3 values ("into4", x);
end|
delete from t1|
-drop table if exists t3|
create table t3 ( s char(16), d int)|
call into_test4()|
Warnings:
@@ -565,13 +562,12 @@ insert into test.t1 values (x, y);
create temporary table test.t3 select * from test.t1;
insert into test.t3 values (concat(x, "2"), y+2);
end|
-drop table if exists t3|
call create_select("cs", 90)|
select * from t1, t3|
id data id data
cs 90 cs 90
cs 90 cs2 92
-drop table if exists t3|
+drop table t3|
delete from t1|
drop procedure create_select|
drop function if exists e|
@@ -702,7 +698,6 @@ id data
hndlr3 13
delete from t1|
drop procedure hndlr3|
-drop table if exists t3|
create table t3 ( id char(16), data int )|
drop procedure if exists hndlr4|
create procedure hndlr4()
@@ -745,7 +740,6 @@ foo 40
bar 15
zap 663
drop procedure cur1|
-drop table if exists t3|
create table t3 ( s char(16), i int )|
drop procedure if exists cur2|
create procedure cur2()
@@ -1309,7 +1303,6 @@ select t1max()|
t1max()
5
drop function t1max|
-drop table if exists t3|
create table t3 (
v char(16) not null primary key,
c int unsigned not null
@@ -1430,7 +1423,6 @@ select @1, @2|
2 NULL
drop table t70|
drop procedure bug1656|
-drop table if exists t3|
create table t3(a int)|
drop procedure if exists bug1862|
create procedure bug1862()
@@ -1555,7 +1547,6 @@ select @x|
42
drop procedure bug2776_1|
drop procedure bug2776_2|
-drop table if exists t3|
create table t3 (s1 smallint)|
insert into t3 values (123456789012)|
Warnings:
@@ -1616,7 +1607,6 @@ f1 rc t3
drop procedure bug1863|
drop temporary table temp_t1;
drop table t3, t4|
-drop table if exists t3, t4|
create table t3 (
OrderID int not null,
MarketID int,
@@ -1694,7 +1684,6 @@ select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|
@i time
2 01-01-1970 03:16:40
drop procedure bug3426|
-drop table if exists t3, t4|
create table t3 (
a int primary key,
ach char(1)
@@ -1724,7 +1713,6 @@ a ach b bch
1 a 1 b
drop procedure bug3448|
drop table t3, t4|
-drop table if exists t3|
create table t3 (
id int unsigned auto_increment not null primary key,
title VARCHAR(200),
@@ -1873,7 +1861,6 @@ select 1+2|
1+2
3
drop procedure bug3843|
-drop table if exists t3|
create table t3 ( s1 char(10) )|
insert into t3 values ('a'), ('b')|
drop procedure if exists bug3368|
@@ -1889,7 +1876,6 @@ group_concat(v)
yz,yz
drop procedure bug3368|
drop table t3|
-drop table if exists t3|
create table t3 (f1 int, f2 int)|
insert into t3 values (1,1)|
drop procedure if exists bug4579_1|
@@ -1914,7 +1900,6 @@ Warning 1329 No data to FETCH
drop procedure bug4579_1|
drop procedure bug4579_2|
drop table t3|
-drop table if exists t3|
drop procedure if exists bug2773|
create function bug2773() returns int return null|
create table t3 as select bug2773()|
@@ -1936,7 +1921,6 @@ select bug3788()|
bug3788()
5
drop function bug3788|
-drop table if exists t3|
create table t3 (f1 int, f2 int, f3 int)|
insert into t3 values (1,1,1)|
drop procedure if exists bug4726|
@@ -2097,7 +2081,6 @@ call bug4902_2()|
Id User Host db Command Time State Info
# root localhost test Query # NULL show processlist
drop procedure bug4902_2|
-drop table if exists t3|
drop procedure if exists bug4904|
create procedure bug4904()
begin
@@ -2286,7 +2269,6 @@ flush status|
flush query cache|
delete from t1|
drop procedure bug3583|
-drop table if exists t3|
drop procedure if exists bug4905|
create table t3 (s1 int,primary key (s1))|
drop procedure if exists bug4905|
@@ -2344,7 +2326,6 @@ call bug8540()|
y z
1 1
drop procedure bug8540|
-drop table if exists t3|
create table t3 (s1 int)|
drop procedure if exists bug6642|
create procedure bug6642()
@@ -2427,7 +2408,6 @@ call bug7992_2()|
drop procedure bug7992_1|
drop procedure bug7992_2|
drop table t3|
-drop table if exists t3|
create table t3 ( userid bigint(20) not null default 0 )|
drop procedure if exists bug8116|
create procedure bug8116(in _userid int)
@@ -2588,7 +2568,6 @@ delete from t1|
drop procedure if exists bug6900|
drop procedure if exists bug9074|
drop procedure if exists bug6900_9074|
-drop table if exists t3|
create table t3 (w char unique, x char)|
insert into t3 values ('a', 'b')|
create procedure bug6900()
@@ -2658,20 +2637,20 @@ call avg ()|
drop procedure avg|
drop procedure if exists bug6129|
set @old_mode= @@sql_mode;
-set @@sql_mode= "";
+set @@sql_mode= "ERROR_FOR_DIVISION_BY_ZERO";
create procedure bug6129()
select @@sql_mode|
call bug6129()|
@@sql_mode
-
+ERROR_FOR_DIVISION_BY_ZERO
set @@sql_mode= "NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO"|
call bug6129()|
@@sql_mode
-NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO
+ERROR_FOR_DIVISION_BY_ZERO
set @@sql_mode= "NO_ZERO_IN_DATE"|
call bug6129()|
@@sql_mode
-NO_ZERO_IN_DATE
+ERROR_FOR_DIVISION_BY_ZERO
set @@sql_mode=@old_mode;
drop procedure bug6129|
drop procedure if exists bug9856|
@@ -3042,32 +3021,6 @@ drop procedure bug11529|
drop procedure if exists bug6063|
drop procedure if exists bug7088_1|
drop procedure if exists bug7088_2|
-create procedure bug6063()
-lābel: begin end|
-call bug6063()|
-show create procedure bug6063|
-Procedure sql_mode Create Procedure
-bug6063 CREATE PROCEDURE `test`.`bug6063`()
-l?bel: begin end
-set character set utf8|
-create procedure bug7088_1()
-label1: begin end label1|
-create procedure bug7088_2()
-lƤbel1: begin end|
-call bug7088_1()|
-call bug7088_2()|
-set character set default|
-show create procedure bug7088_1|
-Procedure sql_mode Create Procedure
-bug7088_1 CREATE PROCEDURE `test`.`bug7088_1`()
-label1: begin end label1
-show create procedure bug7088_2|
-Procedure sql_mode Create Procedure
-bug7088_2 CREATE PROCEDURE `test`.`bug7088_2`()
-läbel1: begin end
-drop procedure bug6063|
-drop procedure bug7088_1|
-drop procedure bug7088_2|
drop procedure if exists bug9565_sub|
drop procedure if exists bug9565|
create procedure bug9565_sub()
@@ -3099,4 +3052,28 @@ select @@sort_buffer_size|
1000000
set @@sort_buffer_size = @x|
drop procedure bug9538|
+drop procedure if exists bug8692|
+create table t3 (c1 varchar(5), c2 char(5), c3 enum('one','two'), c4 text, c5 blob, c6 char(5), c7 varchar(5))|
+insert into t3 values ('', '', '', '', '', '', NULL)|
+Warnings:
+Warning 1265 Data truncated for column 'c3' at row 1
+create procedure bug8692()
+begin
+declare v1 VARCHAR(10);
+declare v2 VARCHAR(10);
+declare v3 VARCHAR(10);
+declare v4 VARCHAR(10);
+declare v5 VARCHAR(10);
+declare v6 VARCHAR(10);
+declare v7 VARCHAR(10);
+declare c8692 cursor for select c1,c2,c3,c4,c5,c6,c7 from t3;
+open c8692;
+fetch c8692 into v1,v2,v3,v4,v5,v6,v7;
+select v1, v2, v3, v4, v5, v6, v7;
+end|
+call bug8692()|
+v1 v2 v3 v4 v5 v6 v7
+ NULL
+drop procedure bug8692|
+drop table t3|
drop table t1,t2;
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index 49f118b1d96..6299e8dcc88 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -1258,3 +1258,31 @@ select * from t1;
d
2000-10-01
drop table t1;
+set @@sql_mode='traditional';
+create table t1(a int, b timestamp);
+alter table t1 add primary key(a);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL default '0',
+ `b` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1(a int, b timestamp default 20050102030405);
+alter table t1 add primary key(a);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL default '0',
+ `b` timestamp NOT NULL default '2005-01-02 03:04:05',
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set @@sql_mode='traditional';
+create table t1(a bit(2));
+insert into t1 values(b'101');
+ERROR 22001: Data too long for column 'a' at row 1
+select * from t1;
+a
+drop table t1;
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 693146c869e..bbca9c905df 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -1087,24 +1087,24 @@ CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT 1)) a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(20) NOT NULL default '0',
- `(SELECT 1)` bigint(20) NOT NULL default '0'
+ `a` bigint(1) NOT NULL default '0',
+ `(SELECT 1)` bigint(1) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a)) a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(20) NOT NULL default '0',
- `(SELECT a)` bigint(20) NOT NULL default '0'
+ `a` bigint(1) NOT NULL default '0',
+ `(SELECT a)` bigint(1) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(20) NOT NULL default '0',
- `(SELECT a+0)` bigint(20) NOT NULL default '0'
+ `a` bigint(1) NOT NULL default '0',
+ `(SELECT a+0)` bigint(3) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a;
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index 277115733d4..d2872878cb9 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -172,7 +172,7 @@ proc CREATE TABLE `proc` (
`security_type` enum('INVOKER','DEFINER') NOT NULL default 'DEFINER',
`param_list` blob NOT NULL,
`returns` char(64) NOT NULL default '',
- `body` blob NOT NULL,
+ `body` longblob NOT NULL,
`definer` char(77) character set utf8 collate utf8_bin NOT NULL default '',
`created` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL default '0000-00-00 00:00:00',
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index 7e3a6fa65d4..52bf307a686 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -595,3 +595,43 @@ update t1 set col2 = 4;
ERROR 42000: FUNCTION test.bug5893 does not exist
drop trigger t1_bu;
drop table t1;
+set sql_mode='ansi';
+create table t1 ("t1 column" int);
+create trigger t1_bi before insert on t1 for each row set new."t1 column" = 5;
+set sql_mode="";
+insert into t1 values (0);
+create trigger t1_af after insert on t1 for each row set @a=10;
+insert into t1 values (0);
+select * from t1;
+t1 column
+5
+5
+select @a;
+@a
+10
+show triggers;
+Trigger Event Table Statement Timing Created sql_mode
+t1_bi INSERT t1 set new."t1 column" = 5 BEFORE # REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
+t1_af INSERT t1 set @a=10 AFTER #
+drop table t1;
+set sql_mode="traditional";
+create table t1 (a date);
+insert into t1 values ('2004-01-00');
+ERROR 22007: Incorrect date value: '2004-01-00' for column 'a' at row 1
+set sql_mode="";
+create trigger t1_bi before insert on t1 for each row set new.a = '2004-01-00';
+set sql_mode="traditional";
+insert into t1 values ('2004-01-01');
+select * from t1;
+a
+2004-01-00
+set sql_mode=default;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` date default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show triggers;
+Trigger Event Table Statement Timing Created sql_mode
+t1_bi INSERT t1 set new.a = '2004-01-00' BEFORE #
+drop table t1;
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index 33c7e837997..788478de77e 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -153,3 +153,13 @@ dt
0000-00-00 00:00:00
0000-00-00 00:00:00
drop table t1;
+create table t1 (dt datetime);
+insert into t1 values ("20010101T010101");
+insert into t1 values ("2001-01-01T01:01:01");
+insert into t1 values ("2001-1-1T1:01:01");
+select * from t1;
+dt
+2001-01-01 01:01:01
+2001-01-01 01:01:01
+2001-01-01 01:01:01
+drop table t1;
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index c1039189a43..d39d2e3401d 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -946,6 +946,13 @@ t1 CREATE TABLE `t1` (
`sl` decimal(5,5) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+create table t1 (sl decimal(65, 30));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `sl` decimal(65,30) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
create table t1 (
f1 decimal unsigned not null default 17.49,
f2 decimal unsigned not null default 17.68,
@@ -969,3 +976,13 @@ select * from t1;
f1 f2 f3 f4 f5 f6 f7 f8
1 18 99 100 104 200 1000 10000
drop table t1;
+create table t1 (
+f0 decimal (30,30) zerofill not null DEFAULT 0,
+f1 decimal (0,0) zerofill not null default 0);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f0` decimal(30,30) unsigned zerofill NOT NULL default '0.000000000000000000000000000000',
+ `f1` decimal(10,0) unsigned zerofill NOT NULL default '0000000000'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index df71c97033f..acdc793fb69 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -183,6 +183,30 @@ set session @honk=99;
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 '@honk=99' at line 1
set one_shot @honk=99;
ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
+select @@local.max_allowed_packet;
+@@local.max_allowed_packet
+#
+select @@session.max_allowed_packet;
+@@session.max_allowed_packet
+#
+select @@global.max_allowed_packet;
+@@global.max_allowed_packet
+#
+select @@max_allowed_packet;
+@@max_allowed_packet
+#
+select @@Max_Allowed_Packet;
+@@Max_Allowed_Packet
+#
+select @@version;
+@@version
+#
+select @@global.version;
+@@global.version
+#
+select @@session.VERSION;
+@@session.VERSION
+#
set @first_var= NULL;
create table t1 select @first_var;
show create table t1;
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 5468508165c..a7c96d89f0d 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -92,7 +92,7 @@ Variable_name Value
max_join_size HA_POS_ERROR
set @@max_join_size=1000, @@global.max_join_size=2000;
select @@local.max_join_size, @@global.max_join_size;
-@@session.max_join_size @@global.max_join_size
+@@local.max_join_size @@global.max_join_size
1000 2000
select @@identity, length(@@version)>0;
@@identity length(@@version)>0
@@ -428,23 +428,23 @@ Variable_name Value
myisam_max_sort_file_size MAX_FILE_SIZE
set global myisam_max_sort_file_size=default;
select @@global.max_user_connections,@@local.max_join_size;
-@@global.max_user_connections @@session.max_join_size
+@@global.max_user_connections @@local.max_join_size
100 200
set @svc=@@global.max_user_connections, @svj=@@local.max_join_size;
select @@global.max_user_connections,@@local.max_join_size;
-@@global.max_user_connections @@session.max_join_size
+@@global.max_user_connections @@local.max_join_size
100 200
set @@global.max_user_connections=111,@@local.max_join_size=222;
select @@global.max_user_connections,@@local.max_join_size;
-@@global.max_user_connections @@session.max_join_size
+@@global.max_user_connections @@local.max_join_size
111 222
set @@global.max_user_connections=@@local.max_join_size,@@local.max_join_size=@@global.max_user_connections;
select @@global.max_user_connections,@@local.max_join_size;
-@@global.max_user_connections @@session.max_join_size
+@@global.max_user_connections @@local.max_join_size
222 111
set @@global.max_user_connections=@svc, @@local.max_join_size=@svj;
select @@global.max_user_connections,@@local.max_join_size;
-@@global.max_user_connections @@session.max_join_size
+@@global.max_user_connections @@local.max_join_size
100 200
set @a=1, @b=2;
set @a=@b, @b=@a;
@@ -525,3 +525,15 @@ set @@warning_count=1;
ERROR HY000: Variable 'warning_count' is a read only variable
set @@global.error_count=1;
ERROR HY000: Variable 'error_count' is a read only variable
+set @@max_heap_table_size= 4294967296;
+select @@max_heap_table_size > 0;
+@@max_heap_table_size > 0
+1
+set global max_heap_table_size= 4294967296;
+select @@max_heap_table_size > 0;
+@@max_heap_table_size > 0
+1
+set @@max_heap_table_size= 4294967296;
+select @@max_heap_table_size > 0;
+@@max_heap_table_size > 0
+1
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index c8078a0604e..f6b5018cf3a 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -566,7 +566,7 @@ select * from v1;
col1
describe v1;
Field Type Null Key Default Extra
-col1 varchar(2) YES NULL
+col1 char(2) YES NULL
drop view v1;
drop table `t1a``b`;
create table t1 (col1 char(5),col2 char(5));
@@ -581,6 +581,11 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function
drop view v1;
create view v1 (a,a) as select 'a','a';
ERROR 42S21: Duplicate column name 'a'
+drop procedure if exists p1;
+create procedure p1 () begin declare v int; create view v1 as select v; end;//
+call p1();
+ERROR HY000: View's SELECT contains a variable or parameter
+drop procedure p1;
create table t1 (col1 int,col2 char(22));
insert into t1 values(5,'Hello, world of views');
create view v1 as select * from t1;
@@ -2016,6 +2021,17 @@ CALL p1();
DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;
+create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
+create view v1 as select * from t1;
+desc v1;
+Field Type Null Key Default Extra
+f1 tinyint(1) YES NULL
+f2 char(1) YES NULL
+f3 varchar(1) YES NULL
+f4 geometry YES NULL
+f5 datetime YES NULL
+drop view v1;
+drop table t1;
create table t1(f1 datetime);
insert into t1 values('2005.01.01 12:0:0');
create view v1 as select f1, subtime(f1, '1:1:1') as sb from t1;
@@ -2024,3 +2040,26 @@ f1 sb
2005-01-01 12:00:00 2005-01-01 10:58:59
drop view v1;
drop table t1;
+CREATE TABLE t1 (
+aid int PRIMARY KEY,
+fn varchar(20) NOT NULL,
+ln varchar(20) NOT NULL
+);
+CREATE TABLE t2 (
+aid int NOT NULL,
+pid int NOT NULL
+);
+INSERT INTO t1 VALUES(1,'a','b'), (2,'c','d');
+INSERT INTO t2 values (1,1), (2,1), (2,2);
+CREATE VIEW v1 AS SELECT t1.*,t2.pid FROM t1,t2 WHERE t1.aid = t2.aid;
+SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM t1,t2
+WHERE t1.aid = t2.aid GROUP BY pid;
+pid GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1)
+1 a b,c d
+2 c d
+SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM v1 GROUP BY pid;
+pid GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1)
+1 a b,c d
+2 c d
+DROP VIEW v1;
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result
index b77ee59b3ff..71f0f28e59f 100644
--- a/mysql-test/r/view_grant.result
+++ b/mysql-test/r/view_grant.result
@@ -72,12 +72,12 @@ select c from mysqltest.v4;
c
show columns from mysqltest.v1;
Field Type Null Key Default Extra
-c bigint(20) YES NULL
-d bigint(20) YES NULL
+c bigint(12) YES NULL
+d bigint(12) YES NULL
show columns from mysqltest.v2;
Field Type Null Key Default Extra
-c bigint(20) YES NULL
-d bigint(20) YES NULL
+c bigint(12) YES NULL
+d bigint(12) YES NULL
explain select c from mysqltest.v1;
ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
show create view mysqltest.v1;
diff --git a/mysql-test/t/alias.test b/mysql-test/t/alias.test
index cfa8ec7f18a..2746409c7e5 100644
--- a/mysql-test/t/alias.test
+++ b/mysql-test/t/alias.test
@@ -86,3 +86,5 @@ UPDATE t1 SET t1.xstatus_vor = Greatest(t1.xstatus_vor,1) WHERE t1.aufnr =
ASC LIMIT 1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index edce4d6eaf5..3c521adcf8e 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -361,6 +361,8 @@ create table t1 ( a timestamp );
alter table t1 add unique ( a(1) );
drop table t1;
+# End of 4.1 tests
+
#
# Some additional tests for new, faster alter table.
# Note that most of the whole alter table code is being
diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test
index f5523f83226..2003feee163 100644
--- a/mysql-test/t/analyse.test
+++ b/mysql-test/t/analyse.test
@@ -48,6 +48,8 @@ insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),(
select * from t1 procedure analyse();
drop table t1;
+# End of 4.1 tests
+
#decimal-related test
create table t1 (df decimal(5,1));
diff --git a/mysql-test/t/analyze.test b/mysql-test/t/analyze.test
index faf30279c68..3c3b3933bc3 100644
--- a/mysql-test/t/analyze.test
+++ b/mysql-test/t/analyze.test
@@ -1,16 +1,18 @@
#
# Bug #10901 Analyze Table on new table destroys table
# This is minimal test case to get error
-# The problem was that analyze table wrote the shared state to the file and this
-# didn't include the inserts while locked. A check was needed to ensure that
-# state information was not updated when executing analyze table for a locked table.
-# The analyze table had to be within locks and check table had to be after unlocking
-# since then it brings the wrong state from disk rather than from the currently
-# correct internal state. The insert is needed since it changes the file state,
-# number of records.
-# The fix is to synchronise the state of the shared state and the current state before
-# calling mi_state_info_write
+# The problem was that analyze table wrote the shared state to the
+# file and this didn't include the inserts while locked. A check was
+# needed to ensure that state information was not updated when
+# executing analyze table for a locked table. The analyze table had
+# to be within locks and check table had to be after unlocking since
+# then it brings the wrong state from disk rather than from the
+# currently correct internal state. The insert is needed since it
+# changes the file state, number of records. The fix is to
+# synchronise the state of the shared state and the current state
+# before calling mi_state_info_write
#
+
create table t1 (a bigint);
lock tables t1 write;
insert into t1 values(0);
@@ -37,3 +39,4 @@ check table t1;
drop table t1;
+# End of 4.1 tests
diff --git a/mysql-test/t/ansi.test b/mysql-test/t/ansi.test
index 9d235df5b46..444bf982b8a 100644
--- a/mysql-test/t/ansi.test
+++ b/mysql-test/t/ansi.test
@@ -25,3 +25,5 @@ SELECT id FROM t1 GROUP BY id2;
drop table t1;
SET @@SQL_MODE="";
+
+# End of 4.1 tests
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index a42a42b2a4e..d756bf765be 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1333,3 +1333,5 @@ INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''
# Cleanup, test is over
#
drop table t1, t2, t4;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test
index afc4c722051..b20fe80303d 100644
--- a/mysql-test/t/auto_increment.test
+++ b/mysql-test/t/auto_increment.test
@@ -219,6 +219,8 @@ INSERT INTO t1 (b) VALUES ('bbbb');
CHECK TABLE t1;
DROP TABLE IF EXISTS t1;
+# End of 4.1 tests
+
#
# Bug #11080 & #11005 Multi-row REPLACE fails on a duplicate key error
#
diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test
index 8b3a46724ab..3034129ad4b 100644
--- a/mysql-test/t/backup.test
+++ b/mysql-test/t/backup.test
@@ -52,3 +52,5 @@ unlock tables;
connection con1;
reap;
drop table t5;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/bdb-alter-table-1.test b/mysql-test/t/bdb-alter-table-1.test
index 18b6c70758f..9cb469a8df6 100644
--- a/mysql-test/t/bdb-alter-table-1.test
+++ b/mysql-test/t/bdb-alter-table-1.test
@@ -14,3 +14,5 @@ select * from t1;
alter table t1 drop column test;
# Now we do a reboot and continue with the next test
+
+# End of 4.1 tests
diff --git a/mysql-test/t/bdb-alter-table-2.test b/mysql-test/t/bdb-alter-table-2.test
index a474efe42e1..15b8938a11d 100644
--- a/mysql-test/t/bdb-alter-table-2.test
+++ b/mysql-test/t/bdb-alter-table-2.test
@@ -6,3 +6,5 @@
-- source include/have_bdb.inc
select * from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/bdb-crash.test b/mysql-test/t/bdb-crash.test
index 3cd78821000..75f4d04d5df 100644
--- a/mysql-test/t/bdb-crash.test
+++ b/mysql-test/t/bdb-crash.test
@@ -47,3 +47,5 @@ set autocommit=0;
insert into t1 values(1);
analyze table t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/bdb-deadlock.test b/mysql-test/t/bdb-deadlock.test
index 5e6ca666cc2..88243cfc860 100644
--- a/mysql-test/t/bdb-deadlock.test
+++ b/mysql-test/t/bdb-deadlock.test
@@ -55,3 +55,5 @@ select * from t2;
commit;
drop table t1,t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/bdb-deadlock.tminus b/mysql-test/t/bdb-deadlock.tminus
index d86403fcffc..3918a8ffe9d 100644
--- a/mysql-test/t/bdb-deadlock.tminus
+++ b/mysql-test/t/bdb-deadlock.tminus
@@ -55,3 +55,5 @@ select * from t2;
commit;
drop table t1,t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test
index f4895318818..c1abe011be4 100644
--- a/mysql-test/t/bdb.test
+++ b/mysql-test/t/bdb.test
@@ -937,6 +937,8 @@ SELECT id FROM t1 WHERE (list_id = 1) AND (term = "lettera");
SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd");
DROP TABLE t1;
+# End of 4.1 tests
+
#
# alter temp table
#
diff --git a/mysql-test/t/bdb_cache.test b/mysql-test/t/bdb_cache.test
index 401456711ac..85328920d71 100644
--- a/mysql-test/t/bdb_cache.test
+++ b/mysql-test/t/bdb_cache.test
@@ -49,3 +49,5 @@ show status like "Qcache_hits";
commit;
show status like "Qcache_queries_in_cache";
drop table if exists t1, t2, t3;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/bench_count_distinct.test b/mysql-test/t/bench_count_distinct.test
index 3ffb95a69c2..131208f1fa1 100644
--- a/mysql-test/t/bench_count_distinct.test
+++ b/mysql-test/t/bench_count_distinct.test
@@ -18,3 +18,5 @@ enable_query_log;
select count(distinct n) from t1;
explain extended select count(distinct n) from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test
index 99c8a13d0b5..5c06ef89676 100644
--- a/mysql-test/t/bigint.test
+++ b/mysql-test/t/bigint.test
@@ -104,6 +104,8 @@ t2.value64=t1.value64;
drop table t1, t2;
+# End of 4.1 tests
+
#
# Test of CREATE ... SELECT and unsigned integers
#
diff --git a/mysql-test/t/binary.test b/mysql-test/t/binary.test
index 54ad8e92237..02773b32302 100644
--- a/mysql-test/t/binary.test
+++ b/mysql-test/t/binary.test
@@ -87,3 +87,5 @@ drop table t1;
create table t1 (a binary);
show create table t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/blackhole.test b/mysql-test/t/blackhole.test
index d1fcfc971a9..257770d311c 100644
--- a/mysql-test/t/blackhole.test
+++ b/mysql-test/t/blackhole.test
@@ -125,3 +125,5 @@ let $VERSION=`select version()`;
show binlog events;
drop table t1,t2,t3;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/bool.test b/mysql-test/t/bool.test
index 53230dd5fa3..34c51c648d3 100644
--- a/mysql-test/t/bool.test
+++ b/mysql-test/t/bool.test
@@ -58,3 +58,5 @@ select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnul
select ifnull(A=1, 'N') as A, ifnull(B=1, 'N') as B, ifnull(not (A=1), 'N') as nA, ifnull(not (B=1), 'N') as nB, ifnull((A=1) and (B=1), 'N') as AB, ifnull(not ((A=1) and (B=1)), 'N') as `n(AB)`, ifnull((not (A=1) or not (B=1)), 'N') as nAonB, ifnull((A=1) or (B=1), 'N') as AoB, ifnull(not((A=1) or (B=1)), 'N') as `n(AoB)`, ifnull(not (A=1) and not (B=1), 'N') as nAnB from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/bulk_replace.test b/mysql-test/t/bulk_replace.test
index 755d34083f8..4e567c43104 100644
--- a/mysql-test/t/bulk_replace.test
+++ b/mysql-test/t/bulk_replace.test
@@ -11,3 +11,4 @@ select * from t1;
check table t1;
drop table t1;
+# End of 4.1 tests
diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test
index e942333d5fe..555e34d5cf2 100644
--- a/mysql-test/t/case.test
+++ b/mysql-test/t/case.test
@@ -122,6 +122,9 @@ SELECT 'case+union+test'
UNION
SELECT CASE '1' WHEN '2' THEN 'BUG' ELSE 'nobug' END;
+# End of 4.1 tests
+
+
#
# Tests for bug #9939: conversion of the arguments for COALESCE and IFNULL
#
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index 356b69daf38..2049c17580e 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -156,6 +156,9 @@ select cast(concat('184467440','73709551615') as signed);
select cast(repeat('1',20) as unsigned);
select cast(repeat('1',20) as signed);
+# End of 4.1 tests
+
+
#decimal-related additions
select cast('1.2' as decimal(3,2));
select 1e18 * cast('1.2' as decimal(3,2));
diff --git a/mysql-test/t/check.test b/mysql-test/t/check.test
index c502655818d..8d9d70bd29a 100644
--- a/mysql-test/t/check.test
+++ b/mysql-test/t/check.test
@@ -22,6 +22,8 @@ connection con1;
reap;
drop table t1;
+# End of 4.1 tests
+
#
# Bug #9897 Views: 'Check Table' crashes MySQL, with a view and a table
# in the statement
diff --git a/mysql-test/t/comments.test b/mysql-test/t/comments.test
index 087df60f3f5..52273ec9523 100644
--- a/mysql-test/t/comments.test
+++ b/mysql-test/t/comments.test
@@ -17,3 +17,5 @@ select 1 --2
select 1 # The rest of the row will be ignored
;
/* line with only comment */;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test
index bc20786227b..a42ba5ac88a 100644
--- a/mysql-test/t/compare.test
+++ b/mysql-test/t/compare.test
@@ -35,3 +35,5 @@ DROP TABLE t1;
SELECT CHAR(31) = '', '' = CHAR(31);
# Extra test
SELECT CHAR(30) = '', '' = CHAR(30);
+
+# End of 4.1 tests
diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test
index 5d2d53a2a90..64b170970ca 100644
--- a/mysql-test/t/connect.test
+++ b/mysql-test/t/connect.test
@@ -76,3 +76,5 @@ show tables;
delete from mysql.user where user=_binary"test";
flush privileges;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/consistent_snapshot.test b/mysql-test/t/consistent_snapshot.test
index 7afdae36325..8da8e9ce660 100644
--- a/mysql-test/t/consistent_snapshot.test
+++ b/mysql-test/t/consistent_snapshot.test
@@ -39,3 +39,5 @@ select * from t1; # if consistent snapshot was not set, as expected, we
commit;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/constraints.test b/mysql-test/t/constraints.test
index dbc34a0dff1..ed268ab5846 100644
--- a/mysql-test/t/constraints.test
+++ b/mysql-test/t/constraints.test
@@ -27,3 +27,5 @@ alter table t1 add constraint unique key_1(a);
alter table t1 add constraint constraint_2 unique key_2(a);
show create table t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/count_distinct.test b/mysql-test/t/count_distinct.test
index be67026e268..e63bdabdb95 100644
--- a/mysql-test/t/count_distinct.test
+++ b/mysql-test/t/count_distinct.test
@@ -55,6 +55,8 @@ create table t1 (f int);
select count(distinct f) from t1;
drop table t1;
+# End of 4.1 tests
+
#
# Bug #6515
#
diff --git a/mysql-test/t/count_distinct2.test b/mysql-test/t/count_distinct2.test
index 2b982e3e620..8dcb2a70065 100644
--- a/mysql-test/t/count_distinct2.test
+++ b/mysql-test/t/count_distinct2.test
@@ -79,3 +79,4 @@ select count(distinct s) from t1;
show status like 'Created_tmp_disk_tables';
drop table t1;
+# End of 4.1 tests
diff --git a/mysql-test/t/count_distinct3.test b/mysql-test/t/count_distinct3.test
index 9d2bb0d139a..52a4f271dac 100644
--- a/mysql-test/t/count_distinct3.test
+++ b/mysql-test/t/count_distinct3.test
@@ -56,3 +56,5 @@ SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
DROP TABLE t1;
set @@read_buffer_size=default;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index d870ff368d3..bc281d1e027 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -39,7 +39,7 @@ drop table if exists t1;
--error 1075
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap;
--- error 1044,1
+-- error 1049
create table not_existing_database.test (a int);
--error 1103
create table `a/a` (a int);
@@ -305,7 +305,7 @@ select * from t2;
create table t3 like t1;
--error 1050
create table t3 like mysqltest.t3;
---error ER_DBACCESS_DENIED_ERROR,1
+--error 1049
create table non_existing_database.t1 like t1;
--error 1051
create table t3 like non_existing_table;
@@ -514,3 +514,15 @@ create table test.t1 like x;
--disable_warnings
drop table if exists test.t1;
--enable_warnings
+
+#
+# Bug #6859: Bogus error message on attempt to CREATE TABLE t LIKE view
+#
+create database mysqltest;
+use mysqltest;
+create view v1 as select 'foo' from dual;
+--error 1347
+create table t1 like v1;
+drop view v1;
+drop database mysqltest;
+# End of 4.1 tests
diff --git a/mysql-test/t/create_select_tmp.test b/mysql-test/t/create_select_tmp.test
index d81a3799d98..2e4c0f22997 100644
--- a/mysql-test/t/create_select_tmp.test
+++ b/mysql-test/t/create_select_tmp.test
@@ -27,3 +27,5 @@ select * from t2;
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
--error 1146;
select * from t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index 591fab3961a..2ac46d75f9a 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1313,3 +1313,5 @@ INSERT INTO t1 VALUES (9410,9412);
select period from t1;
drop table if exists t1,t2,t3,t4;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test
index da31a8f3245..73d9f06042c 100644
--- a/mysql-test/t/ctype_big5.test
+++ b/mysql-test/t/ctype_big5.test
@@ -27,3 +27,13 @@ CREATE TABLE t1 (a text) character set big5;
INSERT INTO t1 VALUES ('łŲ');
SELECT * FROM t1;
DROP TABLE t1;
+
+#
+# BUG#12075 - FULLTEXT non-functional for big5 strings
+#
+CREATE TABLE t1 (a CHAR(50) CHARACTER SET big5 NOT NULL, FULLTEXT(a));
+INSERT INTO t1 VALUES(0xA741ADCCA66EB6DC20A7DAADCCABDCA66E);
+SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST (0xA741ADCCA66EB6DC IN BOOLEAN MODE);
+DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_collate.test b/mysql-test/t/ctype_collate.test
index b65067a36cf..e59693680bf 100644
--- a/mysql-test/t/ctype_collate.test
+++ b/mysql-test/t/ctype_collate.test
@@ -206,3 +206,5 @@ EXPLAIN SELECT * FROM t1 WHERE s1 LIKE 'a' COLLATE latin1_german1_ci;
EXPLAIN SELECT * FROM t1 WHERE s2 LIKE 'a' COLLATE latin1_german1_ci;
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_cp1250_ch.test b/mysql-test/t/ctype_cp1250_ch.test
index 814da628fb7..ea4b35a44a3 100644
--- a/mysql-test/t/ctype_cp1250_ch.test
+++ b/mysql-test/t/ctype_cp1250_ch.test
@@ -22,3 +22,5 @@ INSERT INTO t1 VALUES ('2005-01-1');
SELECT * FROM t1 WHERE popisek = '2005-01-1';
SELECT * FROM t1 WHERE popisek LIKE '2005-01-1';
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test
index 76873e6fa0e..1aafe7b7266 100644
--- a/mysql-test/t/ctype_cp1251.test
+++ b/mysql-test/t/ctype_cp1251.test
@@ -46,3 +46,5 @@ insert into t1 (a) values ('air'),
select * from t1 where a like 'we_%';
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_create.test b/mysql-test/t/ctype_create.test
index e97017ab416..e88004bbb8c 100644
--- a/mysql-test/t/ctype_create.test
+++ b/mysql-test/t/ctype_create.test
@@ -98,3 +98,5 @@ show create database mysqltest2;
drop database mysqltest2;
--error 1046
ALTER DATABASE DEFAULT CHARACTER SET latin2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_gbk.test b/mysql-test/t/ctype_gbk.test
index 82a2e61879e..2210891454e 100644
--- a/mysql-test/t/ctype_gbk.test
+++ b/mysql-test/t/ctype_gbk.test
@@ -28,3 +28,5 @@ CREATE TABLE t1 (a text) character set gbk;
INSERT INTO t1 VALUES (0xA3A0),(0xA1A1);
SELECT hex(a) FROM t1 ORDER BY a;
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test
index 6006ee4c527..1b83373da29 100644
--- a/mysql-test/t/ctype_latin1.test
+++ b/mysql-test/t/ctype_latin1.test
@@ -75,3 +75,5 @@ SET collation_connection='latin1_bin';
--error 1064
CREATE TABLE „a (a int);
SELECT '„a' as str;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test
index 88eb840a787..d6a11a22857 100644
--- a/mysql-test/t/ctype_latin1_de.test
+++ b/mysql-test/t/ctype_latin1_de.test
@@ -133,6 +133,8 @@ ALTER TABLE t1 ADD KEY ifword(col1);
SELECT * FROM t1 WHERE col1='ß' ORDER BY col1, BINARY col1;
DROP TABLE t1;
+# End of 4.1 tests
+
#
# Bug#9509
#
diff --git a/mysql-test/t/ctype_latin2.test b/mysql-test/t/ctype_latin2.test
index cc232adeaec..676b472e7b8 100644
--- a/mysql-test/t/ctype_latin2.test
+++ b/mysql-test/t/ctype_latin2.test
@@ -48,3 +48,5 @@ a, lower(a) l, upper(a) u from t1 order by ha;
#
SELECT group_concat(a collate latin2_croatian_ci order by binary a) from t1 group by a collate latin2_croatian_ci;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test
index 454e2c63cbb..22e844c6868 100644
--- a/mysql-test/t/ctype_many.test
+++ b/mysql-test/t/ctype_many.test
@@ -209,3 +209,5 @@ SET CHARACTER SET 'binary';
SELECT * FROM t1;
SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f;
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_mb.test b/mysql-test/t/ctype_mb.test
index b0ccab8e345..6e369e3fa0b 100644
--- a/mysql-test/t/ctype_mb.test
+++ b/mysql-test/t/ctype_mb.test
@@ -24,3 +24,5 @@ ALTER TABLE t1 CHANGE a a CHAR(4) CHARACTER SET utf8;
SHOW CREATE TABLE t1;
SHOW KEYS FROM t1;
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test
index 0e5e954c720..9949ef88da4 100644
--- a/mysql-test/t/ctype_recoding.test
+++ b/mysql-test/t/ctype_recoding.test
@@ -179,3 +179,5 @@ select rpad(c1,3,'ö'), rpad('ö',3,c1) from t1;
# TODO
#select case c1 when 'ß' then 'ß' when 'ö' then 'ö' else 'c' end from t1;
#select export_set(5,c1,'ö'), export_set(5,'ö',c1) from t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_sjis.test b/mysql-test/t/ctype_sjis.test
index 9b53d448374..252f0a0b6c8 100644
--- a/mysql-test/t/ctype_sjis.test
+++ b/mysql-test/t/ctype_sjis.test
@@ -77,3 +77,5 @@ SET collation_connection='sjis_bin';
--character_set sjis
SET NAMES sjis;
SELECT HEX('²“‘@\Œ\') FROM DUAL;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_tis620.test b/mysql-test/t/ctype_tis620.test
index 87047db9b54..d649828eda3 100644
--- a/mysql-test/t/ctype_tis620.test
+++ b/mysql-test/t/ctype_tis620.test
@@ -157,3 +157,5 @@ SET collation_connection='tis620_thai_ci';
-- source include/ctype_filesort.inc
SET collation_connection='tis620_bin';
-- source include/ctype_filesort.inc
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test
index e5c2acc8b4e..098ea33c6b2 100644
--- a/mysql-test/t/ctype_uca.test
+++ b/mysql-test/t/ctype_uca.test
@@ -456,6 +456,8 @@ drop table t1;
SET collation_connection='utf8_unicode_ci';
-- source include/ctype_filesort.inc
+# End of 4.1 tests
+
#
# Check UPPER/LOWER changeing length
#
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index d032c1249df..668edb3fafe 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -419,6 +419,8 @@ insert into t1 values (0x005b);
select hex(a) from t1;
drop table t1;
+# End of 4.1 tests
+
#
# Conversion from an UCS2 string to a decimal column
#
diff --git a/mysql-test/t/ctype_ucs_binlog.test b/mysql-test/t/ctype_ucs_binlog.test
index 226f128c1c2..1ce55edd469 100644
--- a/mysql-test/t/ctype_ucs_binlog.test
+++ b/mysql-test/t/ctype_ucs_binlog.test
@@ -17,4 +17,4 @@ show binlog events from 98;
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001
drop table t2;
-
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test
index 8657d5eaa86..88386500c9f 100644
--- a/mysql-test/t/ctype_ujis.test
+++ b/mysql-test/t/ctype_ujis.test
@@ -1149,3 +1149,5 @@ SET collation_connection='ujis_japanese_ci';
SET collation_connection='ujis_bin';
-- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index b361b056332..ce259f465d9 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -843,6 +843,8 @@ insert into t1 values (_utf8 0x5b);
select hex(a) from t1;
drop table t1;
+# End of 4.1 tests
+
#
# Test for bug #11484: wrong results for a DISTINCT varchar column in uft8.
#
diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test
index e8bd8965b96..f76f51fd12d 100644
--- a/mysql-test/t/date_formats.test
+++ b/mysql-test/t/date_formats.test
@@ -260,3 +260,5 @@ select str_to_date("2003-01-02 10:11:12.0012ABCD", "%Y-%m-%d %H:%i:%S.%f") as f1
select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1,
str_to_date("2003-04-05 10:11:12.101010234567", "%Y-%m-%d %H:%i:%S.%f") as f2;
--enable_ps_protocol
+
+# End of 4.1 tests
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index 513de990165..ca34cc020f3 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -36,3 +36,14 @@ insert delayed into t1 values (3,"this will give an","error");
show status like 'not_flushed_delayed_rows';
select * from t1;
drop table t1;
+
+# End of 4.1 tests
+
+#
+# Bug #12226: Crash when a delayed insert fails due to a duplicate key
+#
+create table t1 (a int not null primary key);
+insert into t1 values (1);
+insert delayed into t1 values (1);
+select * from t1;
+drop table t1;
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index 265089adfa2..4284bd2a06d 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -153,6 +153,8 @@ DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1;
SELECT * FROM t1;
DROP TABLE t1;
+# End of 4.1 tests
+
#
# Test of multi-delete where we are not scanning the first table
#
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index 1e3ffd5160b..8d51b4666e7 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -248,3 +248,5 @@ insert into t3 values(3),(3);
select * from t1 union distinct select * from t2 union all select * from t3;
select * from (select * from t1 union distinct select * from t2 union all select * from t3) X;
drop table t1, t2, t3;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/dirty_close.test b/mysql-test/t/dirty_close.test
index f965df8cfea..f1c2c88ae83 100644
--- a/mysql-test/t/dirty_close.test
+++ b/mysql-test/t/dirty_close.test
@@ -12,3 +12,5 @@ create table t1 (n int);
insert into t1 values (1),(2),(3);
select * from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 7d397ff2112..60543fe55f9 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -11,4 +11,4 @@
##############################################################################
sp-goto:GOTO is currently is disabled - will be fixed in the future
-ndb_condition_pushdown:Bug #12021
+
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index 057c9bd9239..562926d160c 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -340,3 +340,5 @@ create table t1 (id int, dsc varchar(50));
insert into t1 values (1, "line number one"), (2, "line number two"), (3, "line number three");
select distinct id, IFNULL(dsc, '-') from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test
index 5e123ca0de8..2cd7866caf5 100644
--- a/mysql-test/t/drop.test
+++ b/mysql-test/t/drop.test
@@ -79,3 +79,5 @@ unlock tables;
create table t1(n int);
show tables;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/drop_temp_table.test b/mysql-test/t/drop_temp_table.test
index dbe7959acb2..38c13e3e5e4 100644
--- a/mysql-test/t/drop_temp_table.test
+++ b/mysql-test/t/drop_temp_table.test
@@ -23,3 +23,5 @@ let $VERSION=`select version()`;
--replace_column 2 # 5 #
show binlog events;
drop database `drop-temp+table-test`;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/empty_table.test b/mysql-test/t/empty_table.test
index db0a8e6a247..e8e532832f4 100644
--- a/mysql-test/t/empty_table.test
+++ b/mysql-test/t/empty_table.test
@@ -11,3 +11,5 @@ select count(*) from t1;
select * from t1;
select * from t1 limit 0;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/endspace.test b/mysql-test/t/endspace.test
index 3d27c44c3b9..c4d53450910 100644
--- a/mysql-test/t/endspace.test
+++ b/mysql-test/t/endspace.test
@@ -94,3 +94,5 @@ select text1, length(text1) from t1 where text1='teststring' or text1 like 'test
select text1, length(text1) from t1 where text1='teststring' or text1 >= 'teststring\t';
select concat('|', text1, '|') from t1 order by text1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test
index b558c90b0c6..93668ffdd3d 100644
--- a/mysql-test/t/errors.test
+++ b/mysql-test/t/errors.test
@@ -29,3 +29,5 @@ select 1 from t1 order by t1.b;
--error 1054
select count(*),b from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/exampledb.test b/mysql-test/t/exampledb.test
index c60a9d7f930..946d25325dc 100644
--- a/mysql-test/t/exampledb.test
+++ b/mysql-test/t/exampledb.test
@@ -14,3 +14,5 @@ CREATE TABLE t1 (
) ENGINE=example;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test
index 050939e5ad2..2a3a23c5f96 100644
--- a/mysql-test/t/explain.test
+++ b/mysql-test/t/explain.test
@@ -41,3 +41,5 @@ insert into ŌĮĀ (ĖĻĢ0) values (2);
explain select ĖĻĢ0 from ŌĮĀ where ĖĻĢ0=1;
drop table ŌĮĀ;
set names latin1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test
index 62af9d4932b..f2bfa45ba59 100644
--- a/mysql-test/t/flush.test
+++ b/mysql-test/t/flush.test
@@ -69,3 +69,5 @@ connection con2;
insert into t1 values (345);
select * from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/flush_block_commit.test b/mysql-test/t/flush_block_commit.test
index 29ef7b8a0b9..ebb48242a4d 100644
--- a/mysql-test/t/flush_block_commit.test
+++ b/mysql-test/t/flush_block_commit.test
@@ -77,6 +77,8 @@ show create database test;
drop table t1;
+# End of 4.1 tests
+
# FLUSH TABLES WITH READ LOCK should block writes to binlog too
connection con1;
create table t1 (a int) engine=innodb;
diff --git a/mysql-test/t/flush_table.test b/mysql-test/t/flush_table.test
index afb30d21da7..e46b67ad3d0 100644
--- a/mysql-test/t/flush_table.test
+++ b/mysql-test/t/flush_table.test
@@ -72,3 +72,12 @@ handler t1 read next limit 1;
handler t1 read next limit 1;
handler t1 close;
drop table t1;
+
+#
+# Bug #11934 Two sequential FLUSH TABLES WITH READ LOCK hangs client
+#
+FLUSH TABLES WITH READ LOCK ;
+FLUSH TABLES WITH READ LOCK ;
+UNLOCK TABLES;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/foreign_key.test b/mysql-test/t/foreign_key.test
index 8c35fd65f74..0a3708e6dc8 100644
--- a/mysql-test/t/foreign_key.test
+++ b/mysql-test/t/foreign_key.test
@@ -21,3 +21,5 @@ create table t1 (
create index a on t1 (a);
create unique index b on t1 (a,b);
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 3c4d5dc93da..300bea1c917 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -338,3 +338,16 @@ SET NAMES latin1;
INSERT INTO t1 VALUES('Mit freundlichem Grüß aus Osnabrück');
SELECT COUNT(*) FROM t1 WHERE MATCH(t) AGAINST ('"osnabrück"' IN BOOLEAN MODE);
DROP TABLE t1;
+
+#
+# BUG#11684 - repair crashes mysql when table has fulltext index
+#
+
+CREATE TABLE t1 (a VARCHAR(30), FULLTEXT(a));
+INSERT INTO t1 VALUES('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
+SET myisam_repair_threads=2;
+REPAIR TABLE t1;
+SET myisam_repair_threads=@@global.myisam_repair_threads;
+DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/fulltext2.test b/mysql-test/t/fulltext2.test
index 1d3a5307412..bcd39b9ea04 100644
--- a/mysql-test/t/fulltext2.test
+++ b/mysql-test/t/fulltext2.test
@@ -182,3 +182,4 @@ select count(*) from t1 where match a against ('aaazzz' in boolean mode);
drop table t1;
+# End of 4.1 tests
diff --git a/mysql-test/t/fulltext_cache.test b/mysql-test/t/fulltext_cache.test
index b01f0d18b76..ea05f699506 100644
--- a/mysql-test/t/fulltext_cache.test
+++ b/mysql-test/t/fulltext_cache.test
@@ -42,3 +42,5 @@ SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)
as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
drop table t1, t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/fulltext_distinct.test b/mysql-test/t/fulltext_distinct.test
index 1f4cb8cd7bc..bf773c36844 100644
--- a/mysql-test/t/fulltext_distinct.test
+++ b/mysql-test/t/fulltext_distinct.test
@@ -42,3 +42,5 @@ WHERE MATCH (t1.value) AGAINST ('baz333' IN BOOLEAN MODE)
AND t1.id = t2.id_t1;
DROP TABLE t1, t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/fulltext_left_join.test b/mysql-test/t/fulltext_left_join.test
index 96751ef8678..3bb1f0b7309 100644
--- a/mysql-test/t/fulltext_left_join.test
+++ b/mysql-test/t/fulltext_left_join.test
@@ -45,3 +45,4 @@ select * from t1 left join t2 on (venue_id = entity_id and match(name) against('
select * from t1 left join t2 on (venue_id = entity_id and match(name) against('aberdeen')) where dt = '2003-05-23 19:30:00';
drop table t1,t2;
+# End of 4.1 tests
diff --git a/mysql-test/t/fulltext_multi.test b/mysql-test/t/fulltext_multi.test
index 3a622a551bc..fe64fe88599 100644
--- a/mysql-test/t/fulltext_multi.test
+++ b/mysql-test/t/fulltext_multi.test
@@ -21,3 +21,5 @@ SELECT a, round(MATCH b AGAINST ('lala lkjh'),5) FROM t1;
SELECT a, round(MATCH c AGAINST ('lala lkjh'),5) FROM t1;
SELECT a, round(MATCH b,c AGAINST ('lala lkjh'),5) FROM t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/fulltext_order_by.test b/mysql-test/t/fulltext_order_by.test
index 3101242613a..a0bd7954674 100644
--- a/mysql-test/t/fulltext_order_by.test
+++ b/mysql-test/t/fulltext_order_by.test
@@ -137,3 +137,4 @@ order by
drop table t1,t2,t3;
+# End of 4.1 tests
diff --git a/mysql-test/t/fulltext_update.test b/mysql-test/t/fulltext_update.test
index a1d133ba3fe..14eb0de58a5 100644
--- a/mysql-test/t/fulltext_update.test
+++ b/mysql-test/t/fulltext_update.test
@@ -25,3 +25,5 @@ update test set url='test', shortdesc='ggg', longdesc='mmm',
description='ddd', name='nam' where gnr=2;
check table test;
drop table test;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/fulltext_var.test b/mysql-test/t/fulltext_var.test
index 8cc8acf60a6..6b0b8aa463b 100644
--- a/mysql-test/t/fulltext_var.test
+++ b/mysql-test/t/fulltext_var.test
@@ -25,3 +25,4 @@ set global ft_boolean_syntax='@ -><()~*:""@|';
set global ft_boolean_syntax='+ -><()~*:""@!|';
drop table t1;
+# End of 4.1 tests
diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test
index 9c32313e967..a78017ddb2f 100644
--- a/mysql-test/t/func_compress.test
+++ b/mysql-test/t/func_compress.test
@@ -47,3 +47,4 @@ set @@max_allowed_packet=1048576*100;
--replace_result "''" XXX "'1'" XXX
eval select compress(repeat('aaaaaaaaaa', IF('$LOW_MEMORY', 10, 10000000))) is null;
+# End of 4.1 tests
diff --git a/mysql-test/t/func_concat.test b/mysql-test/t/func_concat.test
index 4f13ce7513c..37fc0e105b8 100644
--- a/mysql-test/t/func_concat.test
+++ b/mysql-test/t/func_concat.test
@@ -52,3 +52,4 @@ select 'a' union select concat('a', -0.0);
--replace_result a-0.0000 a0.0000
select 'a' union select concat('a', -0.0000);
+# End of 4.1 tests
diff --git a/mysql-test/t/func_crypt.test b/mysql-test/t/func_crypt.test
index f352a98e3cd..5e0283feb28 100644
--- a/mysql-test/t/func_crypt.test
+++ b/mysql-test/t/func_crypt.test
@@ -48,3 +48,5 @@ select old_password('idkfa');
select old_password(' i d k f a ');
explain extended select password('idkfa '), old_password('idkfa');
+
+# End of 4.1 tests
diff --git a/mysql-test/t/func_date_add.test b/mysql-test/t/func_date_add.test
index 29c13793b78..b768e4fec61 100644
--- a/mysql-test/t/func_date_add.test
+++ b/mysql-test/t/func_date_add.test
@@ -40,3 +40,5 @@ having mts < DATE_SUB(NOW(),INTERVAL 3 MONTH);
select visitor_id,max(ts) as mts from t1 group by visitor_id
having DATE_ADD(mts,INTERVAL 3 MONTH) < NOW();
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/func_default.test b/mysql-test/t/func_default.test
index af7ebcf588b..7bebd4b4b72 100644
--- a/mysql-test/t/func_default.test
+++ b/mysql-test/t/func_default.test
@@ -18,6 +18,8 @@ explain select * from t1 where str <> default(str);
drop table t1;
+# End of 4.1 tests
+
#
# Bug #11314 (HAVING DEFAULT() hangs)
#
diff --git a/mysql-test/t/func_des_encrypt.test b/mysql-test/t/func_des_encrypt.test
index 201a0051c58..5d102bd02eb 100644
--- a/mysql-test/t/func_des_encrypt.test
+++ b/mysql-test/t/func_des_encrypt.test
@@ -7,3 +7,5 @@
# Bug #11643: des_encrypt() causes server to die
#
select des_encrypt('hello');
+
+# End of 4.1 tests
diff --git a/mysql-test/t/func_encrypt.test b/mysql-test/t/func_encrypt.test
index 52aca7f9dcb..a7364fa43da 100644
--- a/mysql-test/t/func_encrypt.test
+++ b/mysql-test/t/func_encrypt.test
@@ -86,3 +86,5 @@ select hex(des_decrypt(des_encrypt("hello",4),'password2'));
select hex(des_decrypt(des_encrypt("hello","hidden")));
explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_decrypt(des_encrypt("hello","hidden"));
+
+# End of 4.1 tests
diff --git a/mysql-test/t/func_encrypt_nossl.test b/mysql-test/t/func_encrypt_nossl.test
index 95c104ce046..11866db1da7 100644
--- a/mysql-test/t/func_encrypt_nossl.test
+++ b/mysql-test/t/func_encrypt_nossl.test
@@ -35,3 +35,4 @@ select hex("hello");
select hex(des_decrypt(des_encrypt("hello",4),'password2'));
select hex(des_decrypt(des_encrypt("hello","hidden")));
+# End of 4.1 tests
diff --git a/mysql-test/t/func_equal.test b/mysql-test/t/func_equal.test
index f446e277c92..4c88ed170a1 100644
--- a/mysql-test/t/func_equal.test
+++ b/mysql-test/t/func_equal.test
@@ -33,3 +33,5 @@ select * from t1 where id <=>id;
select * from t1 where value <=> value;
select * from t1 where id <=> value or value<=>id;
drop table t1,t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 96cd51f58db..e30dcfae973 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -264,6 +264,24 @@ select group_concat(distinct b order by b) from t1 group by a;
drop table t1;
#
+# Bug#10201
+#
+create table t1 (a varchar(255) character set cp1250 collate cp1250_general_ci,
+ b varchar(255) character set koi8r);
+insert into t1 values ('xxx','yyy');
+select collation(a) from t1;
+select collation(group_concat(a)) from t1;
+create table t2 select group_concat(a) as a from t1;
+show create table t2;
+select collation(group_concat(a,_koi8r'test')) from t1;
+--error 1267
+select collation(group_concat(a,_koi8r 0xC1C2)) from t1;
+--error 1267
+select collation(group_concat(a,b)) from t1;
+drop table t1;
+drop table t2;
+
+#
# bug #7769: group_concat returning null is checked in having
#
CREATE TABLE t1 (id int);
@@ -299,3 +317,37 @@ create table t1 (a char(3), b char(20), primary key (a, b));
insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
select group_concat(a) from t1 group by b;
drop table t1;
+#
+# Bug #12095: GROUP_CONCAT for one row table
+#
+
+CREATE TABLE t1 (
+ aID smallint(5) unsigned NOT NULL auto_increment,
+ sometitle varchar(255) NOT NULL default '',
+ bID smallint(5) unsigned NOT NULL,
+ PRIMARY KEY (aID),
+ UNIQUE KEY sometitle (sometitle)
+);
+INSERT INTO t1 SET sometitle = 'title1', bID = 1;
+INSERT INTO t1 SET sometitle = 'title2', bID = 1;
+
+CREATE TABLE t2 (
+ bID smallint(5) unsigned NOT NULL auto_increment,
+ somename varchar(255) NOT NULL default '',
+ PRIMARY KEY (bID),
+ UNIQUE KEY somename (somename)
+);
+INSERT INTO t2 SET somename = 'test';
+
+SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
+ FROM t1 JOIN t2 ON t1.bID = t2.bID;
+INSERT INTO t2 SET somename = 'test2';
+SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
+ FROM t1 JOIN t2 ON t1.bID = t2.bID;
+DELETE FROM t2 WHERE somename = 'test2';
+SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
+ FROM t1 JOIN t2 ON t1.bID = t2.bID;
+
+DROP TABLE t1,t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 459a40cfe87..fb9470c16dd 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -509,7 +509,41 @@ create table t2 select f2 from (select now() f2 from t1) a;
show columns from t2;
drop table t2, t1;
+#
+# Bug 8893: wrong result for min/max optimization with 2 indexes
+#
+
+CREATE TABLE t1(
+ id int PRIMARY KEY,
+ a int,
+ b int,
+ INDEX i_b_id(a,b,id),
+ INDEX i_id(a,id)
+);
+INSERT INTO t1 VALUES
+ (1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1);
+SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
+DROP TABLE t1;
+
+# change the order of the last two index definitions
+
+CREATE TABLE t1(
+ id int PRIMARY KEY,
+ a int,
+ b int,
+ INDEX i_id(a,id),
+ INDEX i_b_id(a,b,id)
+);
+INSERT INTO t1 VALUES
+ (1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1);
+SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
+DROP TABLE t1;
+
+# End of 4.1 tests
+
+#
# decimal-related tests
+#
create table t2 (ff double);
insert into t2 values (2.2);
select cast(sum(distinct ff) as decimal(5,2)) from t2;
@@ -566,36 +600,6 @@ select col1,sum(col1),max(col1),min(col1) from t1 group by col1;
DROP TABLE t1;
#
-# Bug 8893: wrong result for min/max optimization with 2 indexes
-#
-
-CREATE TABLE t1(
- id int PRIMARY KEY,
- a int,
- b int,
- INDEX i_b_id(a,b,id),
- INDEX i_id(a,id)
-);
-INSERT INTO t1 VALUES
- (1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1);
-SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
-DROP TABLE t1;
-
-# change the order of the last two index definitions
-
-CREATE TABLE t1(
- id int PRIMARY KEY,
- a int,
- b int,
- INDEX i_id(a,id),
- INDEX i_b_id(a,b,id)
-);
-INSERT INTO t1 VALUES
- (1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1);
-SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
-DROP TABLE t1;
-
-#
# Test that new VARCHAR correctly works with COUNT(DISTINCT)
#
diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test
index 03590dea8d1..4e0f426c10b 100644
--- a/mysql-test/t/func_if.test
+++ b/mysql-test/t/func_if.test
@@ -87,3 +87,5 @@ SELECT a, NULLIF(a,'') FROM t1;
SELECT a, NULLIF(a,'') FROM t1 WHERE NULLIF(a,'') IS NULL;
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index 3a6b6653098..7bf737402ef 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -102,6 +102,8 @@ insert into t1 values ('aa'), ('bb');
select * from t1 where a in (NULL, 'aa');
drop table t1;
+# End of 4.1 tests
+
#
# Bug #11885: WHERE condition with NOT IN (one element)
#
diff --git a/mysql-test/t/func_isnull.test b/mysql-test/t/func_isnull.test
index 506efada0eb..6218efb882f 100644
--- a/mysql-test/t/func_isnull.test
+++ b/mysql-test/t/func_isnull.test
@@ -11,3 +11,5 @@ insert into t1 values (0,"2002-05-01"),(0,"2002-05-01"),(0,"2002-05-01");
flush tables;
select * from t1 where isnull(to_days(mydate));
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test
index 4ca2f28fa6e..684d7032038 100644
--- a/mysql-test/t/func_like.test
+++ b/mysql-test/t/func_like.test
@@ -96,3 +96,4 @@ DROP TABLE t1;
#
select _cp866'aaaaaaaaa' like _cp866'%aaaa%' collate cp866_bin;
+# End of 4.1 tests
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index da4b8335e07..bf692325a6a 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -68,6 +68,8 @@ explain extended select degrees(pi()),radians(360);
--error 1054
select rand(rand);
+# End of 4.1 tests
+
#
# Bug #8459 (FORMAT returns incorrect result)
#
@@ -91,3 +93,18 @@ select round(150, 2);
select ceil(0.09);
select ceil(0.000000000000000009);
+#
+# Bug #9837: problem with round()
+#
+
+create table t1 select round(1, 6);
+show create table t1;
+select * from t1;
+drop table t1;
+
+#
+# Bug #11402: abs() forces rest of calculation to unsigned
+#
+select abs(-2) * -2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 78ff0907b39..5079e2605ce 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -38,11 +38,11 @@ select a from t1 where mid(a+0,6,3) = ( mid(20040106123400,6,3) );
drop table t1;
+# End of 4.1 tests
+
+#
# Test for BUG#9535
+#
create table t1 as select uuid(), length(uuid());
show create table t1;
drop table t1;
-
-
-
-
diff --git a/mysql-test/t/func_op.test b/mysql-test/t/func_op.test
index 33a2884b424..24266150e4c 100644
--- a/mysql-test/t/func_op.test
+++ b/mysql-test/t/func_op.test
@@ -16,3 +16,5 @@ select 1 | -1, 1 ^ -1, 1 & -1;
select 0 | -1, 0 ^ -1, 0 & -1;
select -1 >> 0, -1 << 0;
select -1 >> 1, -1 << 1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/func_regexp.test b/mysql-test/t/func_regexp.test
index 1a771d466fa..23070c71fe9 100644
--- a/mysql-test/t/func_regexp.test
+++ b/mysql-test/t/func_regexp.test
@@ -73,3 +73,5 @@ set @a="^R.*";
execute stmt1 using @a;
deallocate prepare stmt1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test
index bb9159eefbe..6189712b5fe 100644
--- a/mysql-test/t/func_sapdb.test
+++ b/mysql-test/t/func_sapdb.test
@@ -128,3 +128,5 @@ select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a;
--disable_ps_protocol
select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f");
--enable_ps_protocol
+
+# End of 4.1 tests
diff --git a/mysql-test/t/func_set.test b/mysql-test/t/func_set.test
index 0c79dec7cc2..710b9b90a05 100644
--- a/mysql-test/t/func_set.test
+++ b/mysql-test/t/func_set.test
@@ -54,3 +54,4 @@ select find_in_set(binary 'a', 'A,B,C');
#
select find_in_set('1','3,1,');
+# End of 4.1 tests
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index efad2721ae5..c66f3eaa294 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -613,3 +613,16 @@ drop table t1;
# Bug #9854 hex() and out of range handling
#
select hex(29223372036854775809), hex(-29223372036854775809);
+
+#
+# Bug #11311: Incorrect length returned from LPAD() and RPAD()
+#
+create table t1 (i int);
+insert into t1 values (1000000000),(1);
+--enable_metadata
+select lpad(i, 7, ' ') as t from t1;
+select rpad(i, 7, ' ') as t from t1;
+--disable_metadata
+drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/func_system.test b/mysql-test/t/func_system.test
index bbfef25bcfe..d7e215f5d48 100644
--- a/mysql-test/t/func_system.test
+++ b/mysql-test/t/func_system.test
@@ -41,3 +41,5 @@ select * from t1 where a=user();
insert into t1 values ('a');
select left(concat(a,version()),1) from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/func_test.test b/mysql-test/t/func_test.test
index 732cdc12cae..424c0d1456b 100644
--- a/mysql-test/t/func_test.test
+++ b/mysql-test/t/func_test.test
@@ -108,6 +108,8 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3;
select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3;
+# End of 4.1 tests
+
#
# Bug#6726: NOT BETWEEN parse failure
#
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 66ff460fc61..0538e6111b9 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -334,6 +334,9 @@ INSERT INTO t1 VALUES (NOW());
SELECT count(*) FROM t1 WHERE d>FROM_DAYS(TO_DAYS(@TMP)) AND d<=FROM_DAYS(TO_DAYS(@TMP)+1);
DROP TABLE t1;
+
+# 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;
diff --git a/mysql-test/t/func_timestamp.test b/mysql-test/t/func_timestamp.test
index 8583c16073d..e1bb7e878ee 100644
--- a/mysql-test/t/func_timestamp.test
+++ b/mysql-test/t/func_timestamp.test
@@ -13,3 +13,5 @@ SELECT CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit) AS Date,
UNIX_TIMESTAMP(CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit)) AS Unix
FROM t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/gcc296.test b/mysql-test/t/gcc296.test
index ebca4dbc897..bfcd56ff396 100644
--- a/mysql-test/t/gcc296.test
+++ b/mysql-test/t/gcc296.test
@@ -18,3 +18,5 @@ INSERT INTO t1 VALUES ('0104000000','xxx','XXX');
select * from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index 522f7a6f637..52fe6add3b8 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -171,3 +171,5 @@ CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
--error 1416
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
drop table t1, t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index b7071019e9d..202042d0257 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -371,3 +371,15 @@ insert into t1 values ("qwerty");
insert into t1 values (pointfromtext('point(1,1)'));
drop table t1;
+
+# End of 4.1 tests
+
+#
+# Bug #12281 (Geometry: crash in trigger)
+#
+
+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;
+--error 1048
+insert into t1 values (null,null);
+drop table t1;
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index bb21873a0c4..05094b29589 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -479,3 +479,5 @@ insert into tables_priv values ('','test_db','mysqltest_1','test_table','test_gr
flush privileges;
delete from tables_priv where host = '' and user = 'mysqltest_1';
flush privileges;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index 07bd6d53c4e..c6b8bfe2916 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -312,3 +312,5 @@ connection default;
REVOKE ALL ON mysqltest_1.t1 FROM mysqltest_1@'127.0.0.0/255.0.0.0';
drop table mysqltest_1.t1;
drop database mysqltest_1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/grant_cache.test b/mysql-test/t/grant_cache.test
index f4423a68717..7e17a03ec21 100644
--- a/mysql-test/t/grant_cache.test
+++ b/mysql-test/t/grant_cache.test
@@ -149,3 +149,5 @@ drop table test.t1,mysqltest.t1,mysqltest.t2;
drop database mysqltest;
set GLOBAL query_cache_size=default;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 6f1880ae8fb..bfbdd098426 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -592,6 +592,8 @@ SELECT n+1 AS n FROM t1 GROUP BY n;
--enable_ps_protocol
DROP TABLE t1;
+# End of 4.1 tests
+
#
# Bug#11211: Ambiguous column reference in GROUP BY.
#
diff --git a/mysql-test/t/handler.test b/mysql-test/t/handler.test
index 3de8e8ae784..eb970e7a710 100644
--- a/mysql-test/t/handler.test
+++ b/mysql-test/t/handler.test
@@ -346,3 +346,5 @@ drop table t2;
drop table t3;
drop table t4;
drop table t5;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test
index 3221b0d4624..fb223d2a9af 100644
--- a/mysql-test/t/having.test
+++ b/mysql-test/t/having.test
@@ -123,6 +123,7 @@ group by a.id, a.description
having (a.description is not null) and (c=0);
drop table t1,t2,t3;
+# End of 4.1 tests
#
# Tests for WL#1972 CORRECT EVALUATION OF COLUMN REFERENCES IN THE HAVING CLAUSE
@@ -233,7 +234,6 @@ where t1.col2 in
group by col_t1
having col_t1 <= 20;
-
#
# nested HAVING clauses
#
diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test
index 75ef5a73cb0..6a9ff5c8284 100644
--- a/mysql-test/t/heap.test
+++ b/mysql-test/t/heap.test
@@ -435,3 +435,5 @@ insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd
--error 1062
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/heap_auto_increment.test b/mysql-test/t/heap_auto_increment.test
index 9d0fefa4d52..016bc946209 100644
--- a/mysql-test/t/heap_auto_increment.test
+++ b/mysql-test/t/heap_auto_increment.test
@@ -31,3 +31,5 @@ insert into t1 values (NULL, "hey");
select * from t1;
select _rowid,t1._rowid,skey,sval from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test
index 6fec2ac1703..5e493c2643b 100644
--- a/mysql-test/t/heap_btree.test
+++ b/mysql-test/t/heap_btree.test
@@ -163,3 +163,5 @@ INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
DELETE from t1 where a < 100;
SELECT * from t1;
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/heap_hash.test b/mysql-test/t/heap_hash.test
index 21ac69ef3a1..28a75a5ee11 100644
--- a/mysql-test/t/heap_hash.test
+++ b/mysql-test/t/heap_hash.test
@@ -259,3 +259,5 @@ insert into t1 values (1),(2),(3),(4),(5);
select a from t1 where a in (1,3);
explain select a from t1 where a in (1,3);
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/help.test b/mysql-test/t/help.test
index 3f3e99e1556..ff431fb4ebd 100644
--- a/mysql-test/t/help.test
+++ b/mysql-test/t/help.test
@@ -113,3 +113,5 @@ delete from mysql.help_relation where help_keyword_id=@keyword1_id and help_topi
delete from mysql.help_relation where help_keyword_id=@keyword2_id and help_topic_id=@topic1_id;
delete from mysql.help_relation where help_keyword_id=@keyword3_id and help_topic_id=@topic3_id;
delete from mysql.help_relation where help_keyword_id=@keyword3_id and help_topic_id=@topic4_id;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index f13a29f07ad..cf089f0089e 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -249,25 +249,27 @@ flush privileges;
# QQ This results in NULLs instead of the version numbers when
# QQ a LOCK TABLES is in effect when selecting from
-# QQ information_schema.tables. Until this bug has been fixed,
-# QQ this test is disabled /pem
-#delimiter //;
-#create procedure px5 ()
-#begin
-#declare v int;
-#declare c cursor for select version from
-#information_schema.tables where table_schema <> 'information_schema';
-#open c;
-#fetch c into v;
-#select v;
-#close c;
-#end;//
-#
-#call px5()//
-#call px5()//
-#delimiter ;//
-#select sql_mode from information_schema.ROUTINES;
-#drop procedure px5;
+# QQ information_schema.tables.
+
+--disable_parsing until bug is fixes
+delimiter //;
+create procedure px5 ()
+begin
+declare v int;
+declare c cursor for select version from
+information_schema.tables where table_schema <> 'information_schema';
+open c;
+fetch c into v;
+select v;
+close c;
+end;//
+
+call px5()//
+call px5()//
+delimiter ;//
+select sql_mode from information_schema.ROUTINES;
+drop procedure px5;
+--enable_parsing
create table t1 (a int not null auto_increment,b int, primary key (a));
insert into t1 values (1,1),(NULL,3),(NULL,4);
@@ -409,6 +411,8 @@ show variables where variable_name like "skip_show_databas";
#
# Bug #7981:SHOW GLOBAL STATUS crashes server
#
+# We don't actually care about the value, just that it doesn't crash.
+--replace_column 2 #
show global status like "Threads_running";
#
@@ -622,3 +626,14 @@ select column_name, NUMERIC_PRECISION, NUMERIC_SCALE
from information_schema.columns
where table_name='t1';
drop table t1;
+
+#
+# Bug #12127 triggers do not show in info_schema before they are used if set to the database
+#
+create table t1 (f1 integer);
+create trigger tr1 after insert on t1 for each row set @test_var=42;
+use information_schema;
+select trigger_schema, trigger_name from triggers where
+trigger_name='tr1';
+use test;
+drop table t1;
diff --git a/mysql-test/t/init_connect.test b/mysql-test/t/init_connect.test
index d9682eb8122..2e3c67a7d38 100644
--- a/mysql-test/t/init_connect.test
+++ b/mysql-test/t/init_connect.test
@@ -32,3 +32,5 @@ connection con5;
select @a;
connection con0;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/init_file.test b/mysql-test/t/init_file.test
index 604d0a01794..de6aca455bd 100644
--- a/mysql-test/t/init_file.test
+++ b/mysql-test/t/init_file.test
@@ -5,3 +5,5 @@
# See mysql-test/std_data/init_file.dat and
# mysql-test/t/init_file-master.opt for the actual test
#
+
+# End of 4.1 tests
diff --git a/mysql-test/t/innodb-deadlock.test b/mysql-test/t/innodb-deadlock.test
index 7a7f657f35d..9d15a23da3c 100644
--- a/mysql-test/t/innodb-deadlock.test
+++ b/mysql-test/t/innodb-deadlock.test
@@ -113,3 +113,5 @@ select * from t1;
commit;
drop table t1, t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/innodb-lock.test b/mysql-test/t/innodb-lock.test
index 887a664e262..dd7f4319892 100644
--- a/mysql-test/t/innodb-lock.test
+++ b/mysql-test/t/innodb-lock.test
@@ -100,3 +100,5 @@ reap;
commit;
select * from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/innodb-replace.test b/mysql-test/t/innodb-replace.test
index 516f058a68e..51b70f34b65 100644
--- a/mysql-test/t/innodb-replace.test
+++ b/mysql-test/t/innodb-replace.test
@@ -19,3 +19,4 @@ replace delayed into t1 (c1, c2) values ( "text1","12"),( "text2","13"),( "text
select * from t1;
drop table t1;
+# End of 4.1 tests
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 2d0e2a4dd65..05f47f36e42 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1230,6 +1230,8 @@ SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t
DROP TABLE t2;
DROP TABLE t1;
+# End of 4.1 tests
+
#
# range optimizer problem
#
@@ -1368,7 +1370,6 @@ insert into t1 (val) values ('1'),('2');
select * from t1;
drop table t1;
-
#
# Test that update does not change internal auto-increment value
#
diff --git a/mysql-test/t/innodb_cache.test b/mysql-test/t/innodb_cache.test
index 101dde37f89..a811d660bd7 100644
--- a/mysql-test/t/innodb_cache.test
+++ b/mysql-test/t/innodb_cache.test
@@ -80,3 +80,4 @@ commit;
select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc;
drop table t3,t2,t1;
+# End of 4.1 tests
diff --git a/mysql-test/t/innodb_handler.test b/mysql-test/t/innodb_handler.test
index 65728519e7b..18cec97af0d 100644
--- a/mysql-test/t/innodb_handler.test
+++ b/mysql-test/t/innodb_handler.test
@@ -93,3 +93,4 @@ HANDLER t1 READ `primary` = (1, 1000);
HANDLER t1 READ `primary` PREV;
DROP TABLE t1;
+# End of 4.1 tests
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index e977de94871..51d936f5b4f 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -151,6 +151,12 @@ insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@val
drop table t1;
--enable_ps_protocol
+# End of 4.1 tests
+
+#
+# Test automatic result buffering with INSERT INTO t1 ... SELECT ... FROM t1
+#
+
create table t1(id1 int not null auto_increment primary key, t char(12));
create table t2(id2 int not null, t char(12));
create table t3(id3 int not null, t char(12), index(id3));
diff --git a/mysql-test/t/insert_select-binlog.test b/mysql-test/t/insert_select-binlog.test
index 9bb1ec274ef..d4041f86ab5 100644
--- a/mysql-test/t/insert_select-binlog.test
+++ b/mysql-test/t/insert_select-binlog.test
@@ -32,3 +32,4 @@ let $VERSION=`select version()`;
show binlog events;
drop table t1;
+# End of 4.1 tests
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index 92e8c7f1231..4a463c1d52e 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -201,3 +201,5 @@ insert into t1 select t2.a from t2 on duplicate key update t2.a= a + t2.b;
--error 1109
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b;
drop table t1,t2,t3;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test
index 64a76aafa5e..5948f92d4e0 100644
--- a/mysql-test/t/insert_update.test
+++ b/mysql-test/t/insert_update.test
@@ -100,3 +100,5 @@ insert into t1 select a from t1 on duplicate key update a=a+1 ;
--error 1052
insert ignore into t1 select a from t1 on duplicate key update a=t1.a+1 ;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index 1d18e020543..2715f30b6cf 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -325,3 +325,5 @@ select * from t1,t2 right join t3 on (t2.i=t3.i) order by t1.i,t2.i,t3.i;
select t1.i,t2.i,t3.i from t2 natural right join t3,t1 order by t1.i,t2.i,t3.i;
select t1.i,t2.i,t3.i from t2 right join t3 on (t2.i=t3.i),t1 order by t1.i,t2.i,t3.i;
drop table t1,t2,t3;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/join_crash.test b/mysql-test/t/join_crash.test
index 2d2222ad67a..68fd9226e41 100644
--- a/mysql-test/t/join_crash.test
+++ b/mysql-test/t/join_crash.test
@@ -124,3 +124,5 @@ from
client_name asc,
project_name asc;
DROP TABLE t1,t2,t3,t4;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 7dd35f164d5..f48ae985e56 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -662,6 +662,8 @@ select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a;
drop table t1, t2;
set group_concat_max_len=default;
+# End of 4.1 tests
+
#
# BUG#10162 - ON is merged with WHERE, left join is convered to a regular join
#
@@ -706,8 +708,5 @@ CREATE TABLE t1 (c11 int);
CREATE TABLE t2 (c21 int);
INSERT INTO t1 VALUES (30), (40), (50);
INSERT INTO t2 VALUES (300), (400), (500);
-
SELECT * FROM t1 LEFT JOIN t2 ON (c11=c21 AND c21=30) WHERE c11=40;
-
DROP TABLE t1, t2;
-
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test
index 9db1523be51..91bd1ada8a4 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -337,3 +337,21 @@ show create table t1;
alter table t1 modify a varchar(20);
show create table t1;
drop table t1;
+
+#
+# Bug #11227: Incorrectly reporting 'MUL' vs. 'UNI' on varchar
+#
+create table t1 (a int not null primary key, b varchar(20) not null unique);
+desc t1;
+drop table t1;
+create table t1 (a int not null primary key, b int not null unique);
+desc t1;
+drop table t1;
+create table t1 (a int not null primary key, b varchar(20) not null, unique (b(10)));
+desc t1;
+drop table t1;
+create table t1 (a int not null primary key, b varchar(20) not null, c varchar(20) not null, unique(b(10),c(10)));
+desc t1;
+drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test
index 5ff26b315e2..5d0f904a716 100644
--- a/mysql-test/t/key_cache.test
+++ b/mysql-test/t/key_cache.test
@@ -167,3 +167,5 @@ set GLOBAL key_cache_block_size=2048;
check table t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/key_diff.test b/mysql-test/t/key_diff.test
index b4e4339ae33..b490c613c61 100644
--- a/mysql-test/t/key_diff.test
+++ b/mysql-test/t/key_diff.test
@@ -20,3 +20,5 @@ explain select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B;
select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B order by binary t1.a,t2.a;
select * from t1 where a='a';
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/key_primary.test b/mysql-test/t/key_primary.test
index 816365c517c..1ca2059b871 100644
--- a/mysql-test/t/key_primary.test
+++ b/mysql-test/t/key_primary.test
@@ -16,3 +16,5 @@ select * from t1 where t1 like "a_\%";
describe select * from t1 where t1="ABC";
describe select * from t1 where t1="ABCD";
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/keywords.test b/mysql-test/t/keywords.test
index 3392bfa1b3b..de0159a950e 100644
--- a/mysql-test/t/keywords.test
+++ b/mysql-test/t/keywords.test
@@ -17,3 +17,5 @@ create table events(binlog int);
insert into events values(1);
select events.binlog from events;
drop table events;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test
index 37e11e14df5..09ad3f59c10 100644
--- a/mysql-test/t/kill.test
+++ b/mysql-test/t/kill.test
@@ -39,6 +39,8 @@ connection con2;
select 4;
drop table t1;
+# End of 4.1 tests
+
#
# test of blocking of sending ERROR after OK or EOF
#
diff --git a/mysql-test/t/limit.test b/mysql-test/t/limit.test
index 3dc56295375..6df865278f6 100644
--- a/mysql-test/t/limit.test
+++ b/mysql-test/t/limit.test
@@ -59,3 +59,5 @@ insert into t1 values (1);
select 1 as a from t1 union all select 1 from dual limit 1;
(select 1 as a from t1) union all (select 1 from dual) limit 1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index 14ef749c802..fe6828916a3 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -31,6 +31,8 @@ load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated
select * from t1;
drop table t1;
+# End of 4.1 tests
+
#
# Let us test extended LOAD DATA features
#
diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test
index 127cbb54a88..4815c1a30b7 100644
--- a/mysql-test/t/lock.test
+++ b/mysql-test/t/lock.test
@@ -73,3 +73,5 @@ delete from t2 using t1,t2 where t1.a=t2.a;
--error 1099
delete t2 from t1,t2 where t1.a=t2.a;
drop table t1,t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index 43cff90332b..0d2266fc2ae 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -95,10 +95,11 @@ reap;
connection locker;
drop table t1;
+# End of 4.1 tests
#
# BUG#9998 - MySQL client hangs on USE "database"
-
+#
create table t1(a int);
lock tables t1 write;
connection reader;
diff --git a/mysql-test/t/lock_tables_lost_commit.test b/mysql-test/t/lock_tables_lost_commit.test
index 8c1ad97c0cc..d31b4b7dfb5 100644
--- a/mysql-test/t/lock_tables_lost_commit.test
+++ b/mysql-test/t/lock_tables_lost_commit.test
@@ -20,3 +20,5 @@ connection con2;
# binlog-ignore-db
select * from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/lowercase_table.test b/mysql-test/t/lowercase_table.test
index 9332c47cb2f..e6f681e4f90 100644
--- a/mysql-test/t/lowercase_table.test
+++ b/mysql-test/t/lowercase_table.test
@@ -94,3 +94,4 @@ use com1;
--error 1049
use prn;
+# End of 4.1 tests
diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test
index f5cf292482e..c02ae8f5073 100644
--- a/mysql-test/t/lowercase_table2.test
+++ b/mysql-test/t/lowercase_table2.test
@@ -137,3 +137,5 @@ create table t2aA (col1 int);
create table t1Aa (col1 int);
select t1Aa.col1 from t1aA,t2Aa where t1Aa.col1 = t2aA.col1;
drop table t2aA, t1Aa;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test
index 9841059a26b..75f6e5188c5 100644
--- a/mysql-test/t/lowercase_table3.test
+++ b/mysql-test/t/lowercase_table3.test
@@ -5,12 +5,8 @@
#
--source include/have_innodb.inc
---require r/lowercase0.require
-disable_query_log;
-show variables like "lower_case_%";
---require r/true.require
-select convert(@@version_compile_os using latin1) NOT IN ("NT","WIN2000","Win95/Win98","XP") as "TRUE";
-enable_query_log;
+--source include/have_lowercase0.inc
+--source include/not_windows.inc
--disable_warnings
DROP TABLE IF EXISTS t1,T1;
@@ -35,3 +31,5 @@ CREATE TABLE t1 (a int) ENGINE=INNODB;
--error 1146
SELECT * from T1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/lowercase_table_grant.test b/mysql-test/t/lowercase_table_grant.test
index 3d6adb477a3..7449231fca5 100644
--- a/mysql-test/t/lowercase_table_grant.test
+++ b/mysql-test/t/lowercase_table_grant.test
@@ -26,3 +26,5 @@ flush privileges;
drop user mysqltest_1@localhost;
drop database MYSQLtest;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/lowercase_table_qcache.test b/mysql-test/t/lowercase_table_qcache.test
index 5077a41402a..e63ad3b2c16 100644
--- a/mysql-test/t/lowercase_table_qcache.test
+++ b/mysql-test/t/lowercase_table_qcache.test
@@ -27,3 +27,5 @@ enable_result_log;
show status like "Qcache_queries_in_cache";
set GLOBAL query_cache_size=0;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 165c16823a2..7d708243a10 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -320,3 +320,4 @@ INSERT INTO t2 (b) VALUES (1) ON DUPLICATE KEY UPDATE b=3;
SELECT b FROM t2;
DROP TABLE t1, t2;
+# End of 4.1 tests
diff --git a/mysql-test/t/metadata.test b/mysql-test/t/metadata.test
index ebd58ef4ebb..b4edd15f5ef 100644
--- a/mysql-test/t/metadata.test
+++ b/mysql-test/t/metadata.test
@@ -48,3 +48,5 @@ select * from (select 1 union select 1) aaa;
drop table t1;
--disable_metadata
+
+# End of 4.1 tests
diff --git a/mysql-test/t/mix_innodb_myisam_binlog.test b/mysql-test/t/mix_innodb_myisam_binlog.test
index 0641acb552f..2e804f4c986 100644
--- a/mysql-test/t/mix_innodb_myisam_binlog.test
+++ b/mysql-test/t/mix_innodb_myisam_binlog.test
@@ -229,3 +229,5 @@ select (@after-@before) >= 2;
# cleanup
drop table t1,t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/multi_statement.test b/mysql-test/t/multi_statement.test
index 2abec332878..eb8d867f3f0 100644
--- a/mysql-test/t/multi_statement.test
+++ b/mysql-test/t/multi_statement.test
@@ -29,3 +29,5 @@ show status like 'Slow_queries'||||
drop table t1||||
delimiter ;||||
+
+# End of 4.1 tests
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 0ca42e86204..5e3be6d45eb 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -452,6 +452,8 @@ insert into t2 values(1,null);
delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1';
drop table t1, t2;
+# End of 4.1 tests
+
#
# Test for bug #1980.
#
diff --git a/mysql-test/t/myisam-blob.test b/mysql-test/t/myisam-blob.test
index 7af8c661c02..ac1b45b8c6c 100644
--- a/mysql-test/t/myisam-blob.test
+++ b/mysql-test/t/myisam-blob.test
@@ -39,3 +39,5 @@ INSERT INTO t1 (data) VALUES (NULL);
UPDATE t1 set data=repeat('a',18*1024*1024);
select length(data) from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index fccc7642eb0..dfb00d5686c 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -479,7 +479,7 @@ drop table t1,t2;
#
# Test RTREE index
#
---error 1235
+--error 1235, 1289
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM;
# INSERT INTO t1 VALUES (1,1),(1,1);
# DELETE FROM rt WHERE a<1;
@@ -675,3 +675,4 @@ show keys from t1;
drop table t1;
+# End of 4.1 tests
diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test
index 3639fc2e262..ccf5e0bf66a 100644
--- a/mysql-test/t/mysql_client_test.test
+++ b/mysql-test/t/mysql_client_test.test
@@ -8,3 +8,5 @@
--disable_result_log
--exec echo $MYSQL_CLIENT_TEST
--exec $MYSQL_CLIENT_TEST
+
+# End of 4.1 tests
diff --git a/mysql-test/t/mysql_protocols.test b/mysql-test/t/mysql_protocols.test
index 6e2d4f20429..0253c2b5d17 100644
--- a/mysql-test/t/mysql_protocols.test
+++ b/mysql-test/t/mysql_protocols.test
@@ -10,3 +10,4 @@
--exec echo "select ' ok' as 'MEMORY'" | $MYSQL --protocol=MEMORY 2>&1 || true
--exec echo "select ' ok' as 'NullS'" | $MYSQL --protocol=NullS 2>&1 || true
+# End of 4.1 tests
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index 49b8237d99f..e5bd8c554cb 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -110,3 +110,4 @@ select "--- reading stdin --" as "";
# clean up
drop table t1, t2;
+# End of 4.1 tests
diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test
index 6e2eda07695..a2f1aba05b0 100644
--- a/mysql-test/t/mysqlbinlog2.test
+++ b/mysql-test/t/mysqlbinlog2.test
@@ -157,3 +157,5 @@ select "--- to-last-log --" as "";
select "--- end of test --" as "";
--enable_query_log
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 81000c17d98..27bea937dcf 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -4,7 +4,6 @@
--disable_warnings
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa;
drop database if exists mysqldump_test_db;
-drop database if exists db1;
drop view if exists v1, v2, v3;
--enable_warnings
@@ -135,15 +134,6 @@ insert into t1 values (1),(2),(3);
drop table t1;
#
-# dump of view
-#
-create table t1(a int);
-create view v1 as select * from t1;
---exec $MYSQL_DUMP --skip-comments test
-drop view v1;
-drop table t1;
-
-#
# Bug #6101: create database problem
#
@@ -198,15 +188,6 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A);
DROP TABLE t1;
#
-# Bug #9756
-#
-
-CREATE TABLE t1 (a char(10));
-INSERT INTO t1 VALUES ('\'');
---exec $MYSQL_DUMP --skip-comments test t1
-DROP TABLE t1;
-
-#
# Test for --insert-ignore
#
@@ -564,29 +545,6 @@ CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1),(2),(3);
--exec $MYSQL_DUMP --add-drop-database --skip-comments --databases test
DROP TABLE t1;
-
-#
-# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
-#
-
-create database db1;
-use db1;
-
-CREATE TABLE t2 (
- a varchar(30) default NULL,
- KEY a (a(5))
-);
-
-INSERT INTO t2 VALUES ('alfred');
-INSERT INTO t2 VALUES ('angie');
-INSERT INTO t2 VALUES ('bingo');
-INSERT INTO t2 VALUES ('waffle');
-INSERT INTO t2 VALUES ('lemon');
-create view v2 as select * from t2 where a like 'a%' with check option;
---exec $MYSQL_DUMP --skip-comments db1
-drop table t2;
-drop view v2;
-drop database db1;
#
# Bug #9558 mysqldump --no-data db t1 t2 format still dumps data
#
@@ -620,6 +578,7 @@ select '------ Testing with illegal table names ------' as test_sequence ;
--enable_query_log
--error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1
+
--error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\t1" 2>&1
@@ -678,6 +637,50 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir
--exec $MYSQL_DUMP --skip-comments --xml --no-create-info test
drop table t1, t2;
+# End of 4.1 tests
+
+#
+# dump of view
+#
+create table t1(a int);
+create view v1 as select * from t1;
+--exec $MYSQL_DUMP --skip-comments test
+drop view v1;
+drop table t1;
+
+#
+# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
+#
+
+create database mysqldump_test_db;
+use mysqldump_test_db;
+
+CREATE TABLE t2 (
+ a varchar(30) default NULL,
+ KEY a (a(5))
+);
+
+INSERT INTO t2 VALUES ('alfred');
+INSERT INTO t2 VALUES ('angie');
+INSERT INTO t2 VALUES ('bingo');
+INSERT INTO t2 VALUES ('waffle');
+INSERT INTO t2 VALUES ('lemon');
+create view v2 as select * from t2 where a like 'a%' with check option;
+--exec $MYSQL_DUMP --skip-comments mysqldump_test_db
+drop table t2;
+drop view v2;
+drop database mysqldump_test_db;
+use test;
+
+#
+# Bug #9756
+#
+
+CREATE TABLE t1 (a char(10));
+INSERT INTO t1 VALUES ('\'');
+--exec $MYSQL_DUMP --skip-comments test t1
+DROP TABLE t1;
+
#
# Bug #10927 mysqldump: Can't reload dump with view that consist of other view
#
@@ -726,6 +729,7 @@ end|
create trigger trg2 before update on t1 for each row begin
if old.a % 2 = 0 then set new.b := 12; end if;
end|
+set sql_mode="traditional"|
create trigger trg3 after update on t1 for each row
begin
if new.a = -1 then
@@ -738,6 +742,7 @@ begin
set @fired:= "No";
end if;
end|
+set sql_mode=default|
delimiter ;|
--replace_column 6 '0000-00-00 00:00:00'
show triggers like "t1";
@@ -753,4 +758,6 @@ drop table t1;
--exec $MYSQL test < var/tmp/mysqldump.sql
# Check that tables have been reloaded
show tables;
+--replace_column 6 #
+show triggers;
DROP TABLE t1, t2;
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 14b8c1d1127..08e51aadc24 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -287,6 +287,7 @@ select 3 from t1 ;
#
#select 3 from t1 ;
+# End of 4.1 tests
#
# Bug #10251: Identifiers containing quotes not handled correctly
@@ -296,8 +297,6 @@ select 1 as `a'b`, 2 as `a"b`;
# Test escaping of quotes
select 'aaa\\','aa''a',"aa""a";
-
-
#
# Check of include/show_msg.inc and include/show_msg80.inc
#
@@ -325,3 +324,14 @@ let $message= . Here comes a very very long message that
. - consists of several lines;
--source include/show_msg80.inc
+#
+# Test --enable_parsning / disable_parsning
+#
+--disable_query_log
+--disable_parsing
+# The following will not enable query logging
+--enable_query_log
+select "this will not be executed";
+--enable_parsing
+select "this will be executed";
+--enable_query_log
diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test
index 2e5e2293b5c..bfc278d709b 100644
--- a/mysql-test/t/ndb_alter_table.test
+++ b/mysql-test/t/ndb_alter_table.test
@@ -179,3 +179,5 @@ drop table t1;
#truncate table t2;
#select count(*) from t2;
#drop table t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test
index c2068329d41..6bbb1c2f2f2 100644
--- a/mysql-test/t/ndb_autodiscover.test
+++ b/mysql-test/t/ndb_autodiscover.test
@@ -544,3 +544,5 @@ create table t10 (
insert into t10 values (1, 'kalle');
--exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test `$NDB_TOOLS_DIR/ndb_show_tables --no-defaults | grep BLOB` >> $NDB_TOOLS_OUTPUT 2>&1 || true
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_autodiscover2.test b/mysql-test/t/ndb_autodiscover2.test
index 76baa31a2a9..f12d3d31fdd 100644
--- a/mysql-test/t/ndb_autodiscover2.test
+++ b/mysql-test/t/ndb_autodiscover2.test
@@ -18,3 +18,4 @@ drop table t9;
select * from t10;
drop table t10;
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test
index c0d5b14c2ea..1c78a4b8744 100644
--- a/mysql-test/t/ndb_basic.test
+++ b/mysql-test/t/ndb_basic.test
@@ -606,6 +606,7 @@ select * from t1 order by counter;
drop table t1;
+# End of 4.1 tests
#
# Test long table name
diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test
index b265809b75f..a12ebee2f0d 100644
--- a/mysql-test/t/ndb_blob.test
+++ b/mysql-test/t/ndb_blob.test
@@ -404,3 +404,5 @@ Proper fix: Set inline bytes to multiple of mbmaxlen and
validate it (after the 8 byte length).');
select * from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_cache.test b/mysql-test/t/ndb_cache.test
index b61422a58fb..9c299b61c24 100644
--- a/mysql-test/t/ndb_cache.test
+++ b/mysql-test/t/ndb_cache.test
@@ -119,4 +119,4 @@ show status like "Qcache_queries_in_cache";
SET GLOBAL query_cache_size=0;
-
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_charset.test b/mysql-test/t/ndb_charset.test
index becbe9a4d06..fb43e1831f3 100644
--- a/mysql-test/t/ndb_charset.test
+++ b/mysql-test/t/ndb_charset.test
@@ -246,3 +246,5 @@ replace into t1 values ('jonas % ');
replace into t1 values ('jonas % ');
select * from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_config.test b/mysql-test/t/ndb_config.test
new file mode 100644
index 00000000000..66287bf6d29
--- /dev/null
+++ b/mysql-test/t/ndb_config.test
@@ -0,0 +1,9 @@
+-- source include/have_ndb.inc
+-- source include/not_embedded.inc
+
+--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=type,nodeid,host 2> /dev/null
+--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null
+--exec $NDB_TOOLS_DIR/ndb_config --no-defaults -r \\n -f " " --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null
+--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --type=ndbd --host=localhost 2> /dev/null
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_database.test b/mysql-test/t/ndb_database.test
index 1264c3fa73b..2e924ba2dcc 100644
--- a/mysql-test/t/ndb_database.test
+++ b/mysql-test/t/ndb_database.test
@@ -48,3 +48,5 @@ show tables;
drop table if exists t1;
drop database if exists mysqltest;
--enable_warnings
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_grant.later b/mysql-test/t/ndb_grant.later
index b4885d2c5fc..5431d94e1f8 100644
--- a/mysql-test/t/ndb_grant.later
+++ b/mysql-test/t/ndb_grant.later
@@ -381,3 +381,5 @@ alter table time_zone_transition_type engine=myisam;
alter table user engine=myisam;
use test;
flush privileges;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_index.test b/mysql-test/t/ndb_index.test
index 93085dea587..272f30e3e6f 100644
--- a/mysql-test/t/ndb_index.test
+++ b/mysql-test/t/ndb_index.test
@@ -126,5 +126,6 @@ select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessno
select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' and customer_id='kllopmn';
select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' and customer_id='foo';
-
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test
index 9c9d5d5a84f..9b70919ab2a 100644
--- a/mysql-test/t/ndb_index_ordered.test
+++ b/mysql-test/t/ndb_index_ordered.test
@@ -348,3 +348,5 @@ connection con1;
select a from t1 where b = 2;
show tables;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/t/ndb_index_unique.test
index d6de013c1e2..2185276c2c6 100644
--- a/mysql-test/t/ndb_index_unique.test
+++ b/mysql-test/t/ndb_index_unique.test
@@ -308,3 +308,5 @@ INSERT INTO t1 (month, year, code) VALUES (5,2004,'12');
select * from t1 where code = '12' and month = 4 and year = 2004 ;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test
index 68f3817e134..92bc51bcf4f 100644
--- a/mysql-test/t/ndb_insert.test
+++ b/mysql-test/t/ndb_insert.test
@@ -616,3 +616,5 @@ INSERT IGNORE INTO t1 VALUES (1);
INSERT IGNORE INTO t1 VALUES (1);
SELECT * FROM t1;
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_limit.test b/mysql-test/t/ndb_limit.test
index 0df3b2f7566..01613606d66 100644
--- a/mysql-test/t/ndb_limit.test
+++ b/mysql-test/t/ndb_limit.test
@@ -81,3 +81,5 @@ SELECT DATE_FORMAT(day, '%Y%m%d') as date, DATE_FORMAT(day, '%d-%m-%Y')
as date_formatted FROM t2 GROUP BY day ORDER BY day DESC LIMIT 2;
drop table t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_lock.test b/mysql-test/t/ndb_lock.test
index b93abbd564b..6945f91ee39 100644
--- a/mysql-test/t/ndb_lock.test
+++ b/mysql-test/t/ndb_lock.test
@@ -69,3 +69,4 @@ insert into t1 values (1,1,1);
drop table t1;
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_minmax.test b/mysql-test/t/ndb_minmax.test
index 97ea84f98ef..a3ac677cd2a 100644
--- a/mysql-test/t/ndb_minmax.test
+++ b/mysql-test/t/ndb_minmax.test
@@ -62,6 +62,4 @@ select MAX(c) from t2;
select * from t2 order by a;
drop table t2;
-
-
-
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_multi.test b/mysql-test/t/ndb_multi.test
index 85950c72cf9..760150c6f6a 100644
--- a/mysql-test/t/ndb_multi.test
+++ b/mysql-test/t/ndb_multi.test
@@ -68,4 +68,4 @@ drop table t1, t2, t3, t4;
connection server2;
drop table t1, t3, t4;
-
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_replace.test b/mysql-test/t/ndb_replace.test
index 1c06a9a6633..b97a0322a6a 100644
--- a/mysql-test/t/ndb_replace.test
+++ b/mysql-test/t/ndb_replace.test
@@ -26,3 +26,5 @@ insert into t1 (gesuchnr,benutzer_id) values (1,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
select * from t1 order by gesuchnr;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_restore.test b/mysql-test/t/ndb_restore.test
index 0173fabd46f..049b07d5a8b 100644
--- a/mysql-test/t/ndb_restore.test
+++ b/mysql-test/t/ndb_restore.test
@@ -215,3 +215,5 @@ drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
#
--exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults -d sys -D , SYSTAB_0 | grep 520093696
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_subquery.test b/mysql-test/t/ndb_subquery.test
index 095fdbcfa13..93c45c521a0 100644
--- a/mysql-test/t/ndb_subquery.test
+++ b/mysql-test/t/ndb_subquery.test
@@ -38,8 +38,11 @@ drop table t2;
# bug#5367
##########
-###
+# End of 4.1 tests
+
+#
# bug#11205
+#
create table t1 (p int not null primary key, u int not null) engine=ndb;
insert into t1 values (1,1),(2,2),(3,3);
diff --git a/mysql-test/t/ndb_transaction.test b/mysql-test/t/ndb_transaction.test
index ae02059786d..d3ebadb1a78 100644
--- a/mysql-test/t/ndb_transaction.test
+++ b/mysql-test/t/ndb_transaction.test
@@ -295,4 +295,4 @@ select count(*) from t2;
drop table test.t1, t2;
drop database mysqltest;
-
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_truncate.test b/mysql-test/t/ndb_truncate.test
index 7c0f79bcc59..73af70d0d0f 100644
--- a/mysql-test/t/ndb_truncate.test
+++ b/mysql-test/t/ndb_truncate.test
@@ -32,3 +32,5 @@ truncate table t2;
select count(*) from t2;
drop table t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_types.test b/mysql-test/t/ndb_types.test
index d4bf4133807..3446a409b2a 100644
--- a/mysql-test/t/ndb_types.test
+++ b/mysql-test/t/ndb_types.test
@@ -81,3 +81,5 @@ from t1;
select time_stamp>@now from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test
index 5453e41f937..45e3add4639 100644
--- a/mysql-test/t/ndb_update.test
+++ b/mysql-test/t/ndb_update.test
@@ -32,3 +32,5 @@ select * from t1 order by pk1;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
+
+# End of 4.1 tests
diff --git a/mysql-test/t/negation_elimination.test b/mysql-test/t/negation_elimination.test
index c50a9678edb..0e0d8891e1f 100644
--- a/mysql-test/t/negation_elimination.test
+++ b/mysql-test/t/negation_elimination.test
@@ -70,3 +70,5 @@ select a, not(not(a)) from t1;
explain extended select a, not(not(a)), not(a <= 2 and not(a)), not(a not like "1"), not (a not in (1,2)), not(a != 2) from t1 where not(not(a)) having not(not(a));
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/not_embedded_server.test b/mysql-test/t/not_embedded_server.test
new file mode 100644
index 00000000000..83ec03d6706
--- /dev/null
+++ b/mysql-test/t/not_embedded_server.test
@@ -0,0 +1,18 @@
+#
+# Here we collect tests that doesn't work with the embedded server
+#
+
+-- source include/not_embedded.inc
+
+#
+# Show full process list with prepare
+# To not show other connections, this must be the first test and we must
+# have a server restart before this one
+#
+
+prepare stmt1 from ' show full processlist ';
+--replace_column 1 number 6 time 3 localhost
+execute stmt1;
+deallocate prepare stmt1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test
index 4cd20979319..183308880ed 100644
--- a/mysql-test/t/null.test
+++ b/mysql-test/t/null.test
@@ -189,3 +189,5 @@ select
# Restore charset to the default value.
set names latin1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/null_key.test b/mysql-test/t/null_key.test
index d7f6a634d1e..e15aec01d2a 100644
--- a/mysql-test/t/null_key.test
+++ b/mysql-test/t/null_key.test
@@ -193,3 +193,50 @@ select * from t1 where id2 is null or id2 > 0;
delete from t1 where id <=> NULL;
select * from t1;
drop table t1;
+
+#
+# Test for bug #12144: optimizations for key access with null keys
+# used for outer joins
+#
+
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int, b int, INDEX idx(a));
+CREATE TABLE t3 (b int, INDEX idx(b));
+CREATE TABLE t4 (b int, INDEX idx(b));
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+INSERT INTO t2 VALUES (1, 1), (3, 1);
+INSERT INTO t3 VALUES
+ (NULL), (NULL), (NULL), (NULL), (NULL),
+ (NULL), (NULL), (NULL), (NULL), (NULL);
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t4 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t4;
+INSERT INTO t3 VALUES (2), (3);
+
+ANALYZE table t1, t2, t3;
+
+SELECT COUNT(*) FROM t3;
+
+EXPLAIN SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
+ LEFT JOIN t3 ON t2.b=t3.b;
+FLUSH STATUS ;
+SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
+ LEFT JOIN t3 ON t2.b=t3.b;
+SELECT FOUND_ROWS();
+SHOW STATUS LIKE "handler_read%";
+
+DROP TABLE t1,t2,t3,t4;
+# End of 4.1 tests
diff --git a/mysql-test/t/odbc.test b/mysql-test/t/odbc.test
index 9aac5948359..d4b6fc35e74 100644
--- a/mysql-test/t/odbc.test
+++ b/mysql-test/t/odbc.test
@@ -20,3 +20,5 @@ select * from t1 where a is null and b=2;
select * from t1 where a is null;
explain select * from t1 where b is null;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test
index f3017978588..2e09bc5b3a3 100644
--- a/mysql-test/t/olap.test
+++ b/mysql-test/t/olap.test
@@ -276,3 +276,5 @@ INSERT INTO t1 VALUES (1, 2);
SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP;
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index 2262395d586..96c92615430 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -43,3 +43,5 @@ delete from mysql.user where user='ssl_user%';
delete from mysql.db where user='ssl_user%';
flush privileges;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index 36eee6e43b7..e3b26a3e47f 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -549,3 +549,5 @@ INSERT INTO t1 VALUES (2), (1), (1), (2), (1);
SELECT a FROM t1 ORDER BY a;
(SELECT a FROM t1) ORDER BY a;
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/order_fill_sortbuf.test b/mysql-test/t/order_fill_sortbuf.test
index 37620ebe331..f13cf8cf350 100644
--- a/mysql-test/t/order_fill_sortbuf.test
+++ b/mysql-test/t/order_fill_sortbuf.test
@@ -22,3 +22,5 @@ enable_query_log;
create table t2 select id2 from t1 order by id3;
select count(*) from t2;
drop table t1,t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test
index 4b12f9e4e50..a74bebe1460 100644
--- a/mysql-test/t/outfile.test
+++ b/mysql-test/t/outfile.test
@@ -63,3 +63,5 @@ EXPLAIN
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
FROM t1;
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/overflow.test b/mysql-test/t/overflow.test
index 17e443d51f8..c930707413b 100644
--- a/mysql-test/t/overflow.test
+++ b/mysql-test/t/overflow.test
@@ -2,3 +2,5 @@ connect (con1,localhost,boo,,);
connection con1;
-- error 1064,1102,1280
drop database AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/packet.test b/mysql-test/t/packet.test
index c7f10d75d74..4de284b7824 100644
--- a/mysql-test/t/packet.test
+++ b/mysql-test/t/packet.test
@@ -1,5 +1,8 @@
# Embedded server doesn't support external clients
--source include/not_embedded.inc
+# Windows fails because it disconnects on too-large packets instead of just
+# swallowing them and returning an error
+--source include/not_windows.inc
#
# Check protocol handling
@@ -31,3 +34,5 @@ set global net_buffer_length=default;
set net_buffer_length=default;
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
select length(repeat('a',2000));
+
+# End of 4.1 tests
diff --git a/mysql-test/t/preload.test b/mysql-test/t/preload.test
index 7a049d06a86..1b7f3c5b9eb 100644
--- a/mysql-test/t/preload.test
+++ b/mysql-test/t/preload.test
@@ -98,3 +98,5 @@ load index into cache t3 key (b), t2 key (c) ;
show status like "key_read%";
drop table t1, t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index de92c67518e..b4c04e4432a 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -828,3 +828,5 @@ execute stmt;
set @@tx_isolation=default;
execute stmt;
deallocate prepare stmt;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ps_10nestset.test b/mysql-test/t/ps_10nestset.test
index 53e84f7a47d..46a88653da3 100644
--- a/mysql-test/t/ps_10nestset.test
+++ b/mysql-test/t/ps_10nestset.test
@@ -69,3 +69,5 @@ execute st_round using @arg_round, @arg_round;
select * from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ps_11bugs.test b/mysql-test/t/ps_11bugs.test
index 5945b140645..e214afeaaf3 100644
--- a/mysql-test/t/ps_11bugs.test
+++ b/mysql-test/t/ps_11bugs.test
@@ -129,3 +129,4 @@ drop table t1, t2;
# end of bug#1676
+# End of 4.1 tests
diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test
index ab133e4c347..6abfd8f28a7 100644
--- a/mysql-test/t/ps_1general.test
+++ b/mysql-test/t/ps_1general.test
@@ -930,3 +930,5 @@ drop table t5, t9;
# Thank you for reading these rules of thumb.
#
# Matthias
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ps_2myisam.test b/mysql-test/t/ps_2myisam.test
index 534703efc14..0a335bd02a3 100644
--- a/mysql-test/t/ps_2myisam.test
+++ b/mysql-test/t/ps_2myisam.test
@@ -40,3 +40,5 @@ drop table t2 ;
-- source include/ps_conv.inc
drop table t1, t9;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ps_3innodb.test b/mysql-test/t/ps_3innodb.test
index f83b61914a2..e25a8b1f469 100644
--- a/mysql-test/t/ps_3innodb.test
+++ b/mysql-test/t/ps_3innodb.test
@@ -22,3 +22,5 @@ let $type= 'InnoDB' ;
-- source include/ps_conv.inc
drop table t1, t9;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ps_4heap.test b/mysql-test/t/ps_4heap.test
index 3ce3bea8265..f16d4599a74 100644
--- a/mysql-test/t/ps_4heap.test
+++ b/mysql-test/t/ps_4heap.test
@@ -47,3 +47,5 @@ eval create table t9
-- source include/ps_conv.inc
drop table t1, t9;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ps_5merge.test b/mysql-test/t/ps_5merge.test
index 7e94ede41d1..e6ce9bf42d3 100644
--- a/mysql-test/t/ps_5merge.test
+++ b/mysql-test/t/ps_5merge.test
@@ -82,3 +82,5 @@ INSERT_METHOD=LAST;
drop table t1, t1_1, t1_2,
t9_1, t9_2, t9;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ps_6bdb.test b/mysql-test/t/ps_6bdb.test
index 5db3349279e..49dd7aa924b 100644
--- a/mysql-test/t/ps_6bdb.test
+++ b/mysql-test/t/ps_6bdb.test
@@ -21,3 +21,5 @@ let $type= 'BDB' ;
-- source include/ps_conv.inc
drop table t1, t9;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ps_7ndb.test b/mysql-test/t/ps_7ndb.test
index b558f2f3c21..e3f65ec2c4e 100644
--- a/mysql-test/t/ps_7ndb.test
+++ b/mysql-test/t/ps_7ndb.test
@@ -21,3 +21,5 @@ let $type= 'NDB' ;
-- source include/ps_conv.inc
drop table t1, t9;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ps_grant.test b/mysql-test/t/ps_grant.test
index 0b33a2dadde..81c842de459 100644
--- a/mysql-test/t/ps_grant.test
+++ b/mysql-test/t/ps_grant.test
@@ -1,7 +1,6 @@
# Can't test grants with embedded server
-- source include/not_embedded.inc
-
let $type= 'MYISAM' ;
################ GRANT/REVOKE/DROP affecting a parallel session ################
@@ -80,6 +79,7 @@ execute s_t1 ;
######## Question 2: The table t9 does not exist. ########
--error 1146
execute s_t9 ;
+deallocate prepare s_t9;
#### revoke the access rights to t1
@@ -112,8 +112,11 @@ show grants for second_user@localhost ;
drop database mysqltest;
+# End of 4.1 tests
-## grant/revoke + drop user
+#
+# grant/revoke + drop user
+#
--error 1295
prepare stmt3 from ' grant all on test.t1 to drop_user@localhost
identified by ''looser'' ';
@@ -126,11 +129,3 @@ revoke all privileges on test.t1 from drop_user@localhost ;
--error 1295
prepare stmt3 from ' drop user drop_user@localhost ';
drop user drop_user@localhost;
-
-# This test must be the last one, otherwise it may produce extra
-# rows in the processlist under high load.
-# Tested here simply so it is not tested with embedded server
-prepare stmt4 from ' show full processlist ';
---replace_column 1 number 6 time 3 localhost
-execute stmt4;
-deallocate prepare stmt4;
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index 3a0ac08b1ba..822c27fe40d 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -79,68 +79,6 @@ delete from t3 where a=10;
show status like "Qcache_queries_in_cache";
drop table t1, t2, t3;
#
-# FLUSH QUERY CACHE
-#
-create table t1 (a int not null);
-insert into t1 values (1),(2),(3);
-create table t2 (a int not null);
-insert into t2 values (1),(2),(3);
-select * from t1;
-select * from t2;
-insert into t1 values (4);
-show status like "Qcache_free_blocks";
-flush query cache;
-show status like "Qcache_free_blocks";
-drop table t1, t2;
-# With join results...
-create table t1 (a text not null);
-create table t11 (a text not null);
-create table t2 (a text not null);
-create table t21 (a text not null);
-create table t3 (a text not null);
-insert into t1 values("1111111111111111111111111111111111111111111111111111");
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-# t11 and t21 must be over 4Kb (QUERY_CACHE_MIN_RESULT_DATA_SIZE)
-insert into t11 select * from t1;
-insert into t21 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-#results of t3 must be > 0.5Mb
-insert into t3 select * from t1;
-insert into t3 select * from t2;
-insert into t3 select * from t1;
-disable_result_log;
-select * from t11;
-select * from t21;
-enable_result_log;
-show status like "Qcache_total_blocks";
-show status like "Qcache_free_blocks";
-disable_result_log;
-insert into t11 values("");
-select * from t3;
-enable_result_log;
-show status like "Qcache_total_blocks";
-show status like "Qcache_free_blocks";
-flush query cache;
-show status like "Qcache_total_blocks";
-show status like "Qcache_free_blocks";
-drop table t1, t2, t3, t11, t21;
-#
# SELECT SQL_CACHE ...
#
set query_cache_type=demand;
@@ -616,6 +554,7 @@ set character_set_results=cp1251;
SELECT a,'Ā','ā'='Ā' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
+SET NAMES default;
DROP TABLE t1;
@@ -711,9 +650,10 @@ repair table t1;
show status like 'qcache_queries_in_cache';
drop table t1;
+#
# Bug #9549: Make sure cached queries that span more than one cache block
# are handled properly in the embedded server.
-
+#
# We just want a small query cache, so we can fragment it easily
set GLOBAL query_cache_size=64*1024;
# This actually gives us a usable cache size of about 48K
@@ -755,6 +695,8 @@ select a from t1;
flush query cache;
drop table t1, t2;
+set GLOBAL query_cache_size=1355776
+
#
# Query with warning prohibited to query cache (BUG#9414)
@@ -767,9 +709,9 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES ('20050326');
INSERT INTO t1 VALUES ('20050325');
-SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 0:0:0';
-SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 0:0:0';
-SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 0:0:0';
+SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid';
+SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 invalid';
+SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid';
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
@@ -832,4 +774,45 @@ drop procedure p1//
drop table t1//
delimiter ;//
+#
+# query in QC from normal execution and SP (BUG#6897)
+#
+flush query cache;
+reset query cache;
+flush status;
+delimiter //;
+create table t1 (s1 int)//
+create procedure f1 () begin
+select sql_cache * from t1;
+select sql_cache * from t1;
+end;//
+delimiter ;//
+call f1();
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+call f1();
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+call f1();
+select sql_cache * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+insert into t1 values (1);
+select sql_cache * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+call f1();
+call f1();
+select sql_cache * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+drop procedure f1;
+drop table t1;
set GLOBAL query_cache_size=0;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/query_cache_merge.test b/mysql-test/t/query_cache_merge.test
index fef3f18df60..36b8662f088 100644
--- a/mysql-test/t/query_cache_merge.test
+++ b/mysql-test/t/query_cache_merge.test
@@ -36,3 +36,5 @@ show status like "Qcache_queries_in_cache";
drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t257,t00;
SET @@global.query_cache_size=0;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/query_cache_notembedded.test b/mysql-test/t/query_cache_notembedded.test
new file mode 100644
index 00000000000..d29dc10ccae
--- /dev/null
+++ b/mysql-test/t/query_cache_notembedded.test
@@ -0,0 +1,81 @@
+-- source include/have_query_cache.inc
+-- source include/not_embedded.inc
+
+#
+# Tests with query cache
+#
+set GLOBAL query_cache_size=1355776;
+
+# Reset query cache variables.
+
+flush query cache; # This crashed in some versions
+flush query cache; # This crashed in some versions
+reset query cache;
+flush status;
+--disable_warnings
+drop table if exists t1, t2, t3, t11, t21;
+--enable_warnings
+#
+# FLUSH QUERY CACHE
+#
+create table t1 (a int not null);
+insert into t1 values (1),(2),(3);
+create table t2 (a int not null);
+insert into t2 values (1),(2),(3);
+select * from t1;
+select * from t2;
+insert into t1 values (4);
+show status like "Qcache_free_blocks";
+flush query cache;
+show status like "Qcache_free_blocks";
+drop table t1, t2;
+# With join results...
+create table t1 (a text not null);
+create table t11 (a text not null);
+create table t2 (a text not null);
+create table t21 (a text not null);
+create table t3 (a text not null);
+insert into t1 values("1111111111111111111111111111111111111111111111111111");
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+# t11 and t21 must be over 4Kb (QUERY_CACHE_MIN_RESULT_DATA_SIZE)
+insert into t11 select * from t1;
+insert into t21 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t1;
+insert into t1 select * from t2;
+#results of t3 must be > 0.5Mb
+insert into t3 select * from t1;
+insert into t3 select * from t2;
+insert into t3 select * from t1;
+disable_result_log;
+select * from t11;
+select * from t21;
+enable_result_log;
+show status like "Qcache_total_blocks";
+show status like "Qcache_free_blocks";
+disable_result_log;
+insert into t11 values("");
+select * from t3;
+enable_result_log;
+show status like "Qcache_total_blocks";
+show status like "Qcache_free_blocks";
+flush query cache;
+show status like "Qcache_total_blocks";
+show status like "Qcache_free_blocks";
+drop table t1, t2, t3, t11, t21;
+
+set GLOBAL query_cache_size=0;
diff --git a/mysql-test/t/raid.test b/mysql-test/t/raid.test
index 14a55db0c34..3ca5adaaaea 100644
--- a/mysql-test/t/raid.test
+++ b/mysql-test/t/raid.test
@@ -220,3 +220,5 @@ ALTER TABLE t1 RENAME t2;
ALTER TABLE t2 CHANGE COLUMN c c VARCHAR(251) NOT NULL;
select count(*) from t2;
DROP TABLE t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 065cef659b8..12dda022cb9 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -490,6 +490,8 @@ SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 1' OR ARG1 != ' 2');
SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 2' OR ARG1 != ' 1');
drop table t1;
+# End of 4.1 tests
+
#
# Test for optimization request #10561: to use keys for
# NOT IN (c1,...,cn) and NOT BETWEEN c1 AND c2
diff --git a/mysql-test/t/rename.test b/mysql-test/t/rename.test
index 6fa208f37ec..5caecef176e 100644
--- a/mysql-test/t/rename.test
+++ b/mysql-test/t/rename.test
@@ -65,3 +65,5 @@ sleep 1;
show tables;
drop table t2, t4;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test
index ef7043febbc..5e39e0b6a50 100644
--- a/mysql-test/t/repair.test
+++ b/mysql-test/t/repair.test
@@ -33,3 +33,5 @@ system echo 1 > $MYSQL_TEST_DIR/var/master-data/test/t1.MYI ;
repair table t1;
repair table t1 use_frm;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/replace.test b/mysql-test/t/replace.test
index 2b3775f4f67..10703eaafb8 100644
--- a/mysql-test/t/replace.test
+++ b/mysql-test/t/replace.test
@@ -33,3 +33,5 @@ replace into t1 values (126,"first updated");
replace into t1 values (63,default);
select * from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rollback.test b/mysql-test/t/rollback.test
index 3cb1ea3024b..3b8ad901907 100644
--- a/mysql-test/t/rollback.test
+++ b/mysql-test/t/rollback.test
@@ -21,3 +21,5 @@ select * from t1;
select @@warning_count;
show warnings;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test
index afcaaef6811..4becef1c2b7 100644
--- a/mysql-test/t/row.test
+++ b/mysql-test/t/row.test
@@ -84,3 +84,5 @@ select a, MAX(b), (1, MAX(b)) = (1, 4) from t1 group by a;
drop table t1;
SELECT ROW(2,10) <=> ROW(3,4);
SELECT ROW(NULL,10) <=> ROW(3,NULL);
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test
index e9a87529706..13dba142d54 100644
--- a/mysql-test/t/rpl000001.test
+++ b/mysql-test/t/rpl000001.test
@@ -126,3 +126,5 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000002.test b/mysql-test/t/rpl000002.test
index 4fbb6a595a4..bafd8a30159 100644
--- a/mysql-test/t/rpl000002.test
+++ b/mysql-test/t/rpl000002.test
@@ -37,3 +37,5 @@ show create table t5;
connection master;
drop table t2,t3,t5;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000004.test b/mysql-test/t/rpl000004.test
index 8fc2977faab..f2a02bd4dd6 100644
--- a/mysql-test/t/rpl000004.test
+++ b/mysql-test/t/rpl000004.test
@@ -21,3 +21,5 @@ connection slave;
sync_with_master;
create table t1(n int);
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000005.test b/mysql-test/t/rpl000005.test
index b94695c72e1..e81ad739402 100644
--- a/mysql-test/t/rpl000005.test
+++ b/mysql-test/t/rpl000005.test
@@ -20,3 +20,5 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000006.test b/mysql-test/t/rpl000006.test
index 898ef309f50..334ed575835 100644
--- a/mysql-test/t/rpl000006.test
+++ b/mysql-test/t/rpl000006.test
@@ -43,3 +43,5 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000008.test b/mysql-test/t/rpl000008.test
index ea782b99d28..fe030f90411 100644
--- a/mysql-test/t/rpl000008.test
+++ b/mysql-test/t/rpl000008.test
@@ -34,3 +34,5 @@ save_master_pos;
connection slave;
sync_with_master;
drop table mysqltest_foo,mysqltest_bar,t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test
index 59451bc888d..a51a64979fa 100644
--- a/mysql-test/t/rpl000009.test
+++ b/mysql-test/t/rpl000009.test
@@ -170,3 +170,5 @@ sync_with_master;
# These has to be droped on slave as they are not replicated
drop database mysqltest2;
drop database mysqltest3;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000010.test b/mysql-test/t/rpl000010.test
index 0725214694a..261b9148774 100644
--- a/mysql-test/t/rpl000010.test
+++ b/mysql-test/t/rpl000010.test
@@ -16,3 +16,4 @@ save_master_pos;
connection slave;
sync_with_master;
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000011.test b/mysql-test/t/rpl000011.test
index 3b00afe10e4..32f6227f7c5 100644
--- a/mysql-test/t/rpl000011.test
+++ b/mysql-test/t/rpl000011.test
@@ -13,3 +13,5 @@ select * from t1;
connection master;
drop table t1;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000012.test b/mysql-test/t/rpl000012.test
index 7f440eaaa13..2c1c65e4202 100644
--- a/mysql-test/t/rpl000012.test
+++ b/mysql-test/t/rpl000012.test
@@ -41,3 +41,5 @@ drop table if exists t1,t2;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000013.test b/mysql-test/t/rpl000013.test
index 94d5feb3925..eca4803c6bc 100644
--- a/mysql-test/t/rpl000013.test
+++ b/mysql-test/t/rpl000013.test
@@ -39,3 +39,5 @@ drop table if exists t1,t2;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test
index da73c5f4db2..a53049386af 100644
--- a/mysql-test/t/rpl000015.test
+++ b/mysql-test/t/rpl000015.test
@@ -37,3 +37,5 @@ select * from t1;
connection master;
drop table t1;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000017.test b/mysql-test/t/rpl000017.test
index 3b39a6b49a6..3b4574e9547 100644
--- a/mysql-test/t/rpl000017.test
+++ b/mysql-test/t/rpl000017.test
@@ -17,3 +17,5 @@ select * from t1;
connection master;
drop table t1;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000018.test b/mysql-test/t/rpl000018.test
index fd2be2399a5..bc6d887cc99 100644
--- a/mysql-test/t/rpl000018.test
+++ b/mysql-test/t/rpl000018.test
@@ -25,3 +25,5 @@ select * from t1;
connection master;
drop table t1;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_EE_error.test b/mysql-test/t/rpl_EE_error.test
index 90d8c36685f..683ccf1bc40 100644
--- a/mysql-test/t/rpl_EE_error.test
+++ b/mysql-test/t/rpl_EE_error.test
@@ -28,3 +28,5 @@ drop table t1;
save_master_pos;
connection slave;
wait_for_slave_to_stop;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_alter.test b/mysql-test/t/rpl_alter.test
index a913f01cd81..576376a0264 100644
--- a/mysql-test/t/rpl_alter.test
+++ b/mysql-test/t/rpl_alter.test
@@ -20,3 +20,5 @@ drop database mysqltest;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_chain_temp_table.test b/mysql-test/t/rpl_chain_temp_table.test
index 007b018e9d8..96e228a17a1 100644
--- a/mysql-test/t/rpl_chain_temp_table.test
+++ b/mysql-test/t/rpl_chain_temp_table.test
@@ -97,3 +97,5 @@ sync_with_master;
# memory they use is freed (it should) by mysqld before it terminates).
# If they wouldn't be cleaned up, you would see some "still reachable" blocks in
# Valgrind.
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_change_master.test b/mysql-test/t/rpl_change_master.test
index 23866447c98..45a6d2c0c28 100644
--- a/mysql-test/t/rpl_change_master.test
+++ b/mysql-test/t/rpl_change_master.test
@@ -33,3 +33,5 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_charset.test b/mysql-test/t/rpl_charset.test
index ee54bc72a65..e5ddf084461 100644
--- a/mysql-test/t/rpl_charset.test
+++ b/mysql-test/t/rpl_charset.test
@@ -169,3 +169,5 @@ set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_commit_after_flush.test b/mysql-test/t/rpl_commit_after_flush.test
index 62c89b3aae6..6129e5485a6 100644
--- a/mysql-test/t/rpl_commit_after_flush.test
+++ b/mysql-test/t/rpl_commit_after_flush.test
@@ -15,3 +15,5 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_create_database.test b/mysql-test/t/rpl_create_database.test
index c63b0bc85ef..cfccc4567b5 100644
--- a/mysql-test/t/rpl_create_database.test
+++ b/mysql-test/t/rpl_create_database.test
@@ -69,3 +69,5 @@ DROP DATABASE IF EXISTS mysqltest_prometheus;
DROP DATABASE IF EXISTS mysqltest_sisyfos;
DROP DATABASE IF EXISTS mysqltest_bob;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_ddl.test b/mysql-test/t/rpl_ddl.test
index d043d40d96e..9521ba3d4c1 100644
--- a/mysql-test/t/rpl_ddl.test
+++ b/mysql-test/t/rpl_ddl.test
@@ -348,3 +348,5 @@ DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3;
--enable_warnings
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_deadlock.test b/mysql-test/t/rpl_deadlock.test
index eb4c5c33714..d31ef3a5bef 100644
--- a/mysql-test/t/rpl_deadlock.test
+++ b/mysql-test/t/rpl_deadlock.test
@@ -109,3 +109,5 @@ show slave status;
connection master;
drop table t1,t2,t3,t4;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_delete_all.test b/mysql-test/t/rpl_delete_all.test
index ad2ce29c610..db33ee3bb86 100644
--- a/mysql-test/t/rpl_delete_all.test
+++ b/mysql-test/t/rpl_delete_all.test
@@ -39,3 +39,5 @@ select * from t1;
connection master;
drop table t1;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_do_grant.test b/mysql-test/t/rpl_do_grant.test
index 27a22874497..54287a67657 100644
--- a/mysql-test/t/rpl_do_grant.test
+++ b/mysql-test/t/rpl_do_grant.test
@@ -44,3 +44,5 @@ sync_with_master;
# no need to delete manually, as the DELETEs must have done some real job on
# master (updated binlog)
flush privileges;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_drop.test b/mysql-test/t/rpl_drop.test
index ab5b608cab6..2544599208e 100644
--- a/mysql-test/t/rpl_drop.test
+++ b/mysql-test/t/rpl_drop.test
@@ -10,3 +10,5 @@ drop table t1, t2;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_drop_temp.test b/mysql-test/t/rpl_drop_temp.test
index cf663367b78..18fc17ed064 100644
--- a/mysql-test/t/rpl_drop_temp.test
+++ b/mysql-test/t/rpl_drop_temp.test
@@ -14,3 +14,4 @@ show status like 'Slave_open_temp_tables';
connection default;
drop database mysqltest;
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_empty_master_crash.test b/mysql-test/t/rpl_empty_master_crash.test
index 98a630c69ca..5f26bedc9fe 100644
--- a/mysql-test/t/rpl_empty_master_crash.test
+++ b/mysql-test/t/rpl_empty_master_crash.test
@@ -11,3 +11,5 @@ load table t1 from master;
connection slave;
--error 1188
load table t1 from master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_error_ignored_table.test b/mysql-test/t/rpl_error_ignored_table.test
index 5388b6af8d4..7d948e96c39 100644
--- a/mysql-test/t/rpl_error_ignored_table.test
+++ b/mysql-test/t/rpl_error_ignored_table.test
@@ -55,3 +55,5 @@ connection slave;
# SQL slave thread should not have stopped (because table of the killed
# query is in the ignore list).
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_failed_optimize.test b/mysql-test/t/rpl_failed_optimize.test
index d245d1bacbb..57afaa89e83 100644
--- a/mysql-test/t/rpl_failed_optimize.test
+++ b/mysql-test/t/rpl_failed_optimize.test
@@ -16,3 +16,5 @@ OPTIMIZE TABLE t1;
OPTIMIZE TABLE non_existing;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_failsafe.test b/mysql-test/t/rpl_failsafe.test
index ae61b061153..4336d897fc0 100644
--- a/mysql-test/t/rpl_failsafe.test
+++ b/mysql-test/t/rpl_failsafe.test
@@ -20,3 +20,5 @@ start slave;
sync_with_master;
show variables like 'rpl_recovery_rank';
show status like 'Rpl_status';
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_flush_log_loop.test b/mysql-test/t/rpl_flush_log_loop.test
index ccaae8ad765..ff599af89a3 100644
--- a/mysql-test/t/rpl_flush_log_loop.test
+++ b/mysql-test/t/rpl_flush_log_loop.test
@@ -20,3 +20,5 @@ sleep 5;
--replace_result $SLAVE_MYPORT SLAVE_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_flush_tables.test b/mysql-test/t/rpl_flush_tables.test
index eb16ddcd8de..48fda818890 100644
--- a/mysql-test/t/rpl_flush_tables.test
+++ b/mysql-test/t/rpl_flush_tables.test
@@ -3,7 +3,10 @@
# RENAME TABLE work with MERGE tables on the slave.
# Test of FLUSH NO_WRITE_TO_BINLOG by the way.
#
-source include/master-slave.inc;
+--source include/master-slave.inc
+# Skipped on Windows because it can't handle a table underlying an open
+# merge table getting renamed.
+--source include/not_windows.inc
create table t1 (a int);
insert into t1 values (10);
@@ -35,3 +38,5 @@ sync_with_master;
select * from t3;
# Note that all this confusion may cause warnings 'table xx is open on rename'
# in the .err files; these are not fatal and are not reported by mysql-test-run.
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_free_items.test b/mysql-test/t/rpl_free_items.test
index 3228ffd9cde..043e84160b8 100644
--- a/mysql-test/t/rpl_free_items.test
+++ b/mysql-test/t/rpl_free_items.test
@@ -18,3 +18,5 @@ connection master;
drop table t1;
drop table t2;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_get_lock.test b/mysql-test/t/rpl_get_lock.test
index 847e7145be6..945bd98c993 100644
--- a/mysql-test/t/rpl_get_lock.test
+++ b/mysql-test/t/rpl_get_lock.test
@@ -39,3 +39,5 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_heap.test b/mysql-test/t/rpl_heap.test
index 3452f3990bf..3ee335fe58d 100644
--- a/mysql-test/t/rpl_heap.test
+++ b/mysql-test/t/rpl_heap.test
@@ -47,3 +47,5 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_ignore_grant.test b/mysql-test/t/rpl_ignore_grant.test
index 9b012d08df3..2e6e2ce9a31 100644
--- a/mysql-test/t/rpl_ignore_grant.test
+++ b/mysql-test/t/rpl_ignore_grant.test
@@ -55,3 +55,5 @@ sync_with_master;
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_init_slave.test b/mysql-test/t/rpl_init_slave.test
index 3ea04117ced..cefb04a7b75 100644
--- a/mysql-test/t/rpl_init_slave.test
+++ b/mysql-test/t/rpl_init_slave.test
@@ -24,3 +24,5 @@ save_master_pos;
connection slave;
sync_with_master;
stop slave;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_innodb.test b/mysql-test/t/rpl_innodb.test
index b171dced26e..551657fd7e3 100644
--- a/mysql-test/t/rpl_innodb.test
+++ b/mysql-test/t/rpl_innodb.test
@@ -44,3 +44,5 @@ connection master;
DROP TABLE t4;
--enable_query_log
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/t/rpl_insert_id.test
index a4506e32963..704de1a423b 100644
--- a/mysql-test/t/rpl_insert_id.test
+++ b/mysql-test/t/rpl_insert_id.test
@@ -74,6 +74,4 @@ SET FOREIGN_KEY_CHECKS=0;
INSERT INTO t1 VALUES (1),(1);
sync_slave_with_master;
-
-
-
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_insert_ignore.test b/mysql-test/t/rpl_insert_ignore.test
index 58eaa287817..a6cc69b1df8 100644
--- a/mysql-test/t/rpl_insert_ignore.test
+++ b/mysql-test/t/rpl_insert_ignore.test
@@ -69,3 +69,5 @@ SELECT * FROM t1 ORDER BY a;
connection master;
drop table t1, t2;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_loaddata.test b/mysql-test/t/rpl_loaddata.test
index 3d54897adda..1b5980eb92e 100644
--- a/mysql-test/t/rpl_loaddata.test
+++ b/mysql-test/t/rpl_loaddata.test
@@ -149,3 +149,5 @@ wait_for_slave_to_stop;
drop table t2;
connection master;
drop table t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_loaddata_rule_m.test b/mysql-test/t/rpl_loaddata_rule_m.test
index 97c984c4369..68024c340a8 100644
--- a/mysql-test/t/rpl_loaddata_rule_m.test
+++ b/mysql-test/t/rpl_loaddata_rule_m.test
@@ -25,3 +25,5 @@ load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
--replace_column 2 # 5 #
show binlog events from 98;
drop database mysqltest;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_loaddata_rule_s.test b/mysql-test/t/rpl_loaddata_rule_s.test
index 9802c00d35f..98fad3cc06f 100644
--- a/mysql-test/t/rpl_loaddata_rule_s.test
+++ b/mysql-test/t/rpl_loaddata_rule_s.test
@@ -18,3 +18,5 @@ connection slave;
sync_with_master;
select count(*) from t1; # check that LOAD was replicated
show binlog events from 98; # should be nothing
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_loaddatalocal.test b/mysql-test/t/rpl_loaddatalocal.test
index f9325b39af6..0b54de8462e 100644
--- a/mysql-test/t/rpl_loaddatalocal.test
+++ b/mysql-test/t/rpl_loaddatalocal.test
@@ -35,6 +35,8 @@ save_master_pos;
connection slave;
sync_with_master;
+# End of 4.1 tests
+
#
# Now let us test how well we replicate LOAD DATA LOCAL in situation when
# we met duplicates in tables to which we are adding rows.
diff --git a/mysql-test/t/rpl_log.test b/mysql-test/t/rpl_log.test
index 8cb99d5432e..899f812535a 100644
--- a/mysql-test/t/rpl_log.test
+++ b/mysql-test/t/rpl_log.test
@@ -108,3 +108,5 @@ show slave status;
--error 1220
show binlog events in 'slave-bin.000005' from 4;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_log_pos.test b/mysql-test/t/rpl_log_pos.test
index 2a03497846b..979b146bb22 100644
--- a/mysql-test/t/rpl_log_pos.test
+++ b/mysql-test/t/rpl_log_pos.test
@@ -45,3 +45,5 @@ select * from t1;
connection master;
drop table t1;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_many_optimize.test b/mysql-test/t/rpl_many_optimize.test
index 525e23abe15..91fab0b27a8 100644
--- a/mysql-test/t/rpl_many_optimize.test
+++ b/mysql-test/t/rpl_many_optimize.test
@@ -18,3 +18,5 @@ enable_query_log;
drop table t1;
# Bug was that slave segfaulted after ~ a hundred of OPTIMIZE (or ANALYZE)
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_master_pos_wait.test b/mysql-test/t/rpl_master_pos_wait.test
index 4d4d51b04ab..893c8746efc 100644
--- a/mysql-test/t/rpl_master_pos_wait.test
+++ b/mysql-test/t/rpl_master_pos_wait.test
@@ -14,3 +14,5 @@ connection slave1;
stop slave sql_thread;
connection slave;
reap;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_max_relay_size.test b/mysql-test/t/rpl_max_relay_size.test
index 963a76fb959..8b54cf5ab7f 100644
--- a/mysql-test/t/rpl_max_relay_size.test
+++ b/mysql-test/t/rpl_max_relay_size.test
@@ -91,3 +91,5 @@ connection master;
# test that the absence of relay logs does not make a master crash
flush logs;
show master status;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_misc_functions.test b/mysql-test/t/rpl_misc_functions.test
index 12eadbb25ed..f20d0aa83e4 100644
--- a/mysql-test/t/rpl_misc_functions.test
+++ b/mysql-test/t/rpl_misc_functions.test
@@ -28,3 +28,5 @@ load data local infile './var/master-data/test/rpl_misc_functions.outfile' into
# compare them with the replica; the SELECT below should return no row
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
stop slave;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_multi_delete.test b/mysql-test/t/rpl_multi_delete.test
index 299cb720b62..2fd7b820b1a 100644
--- a/mysql-test/t/rpl_multi_delete.test
+++ b/mysql-test/t/rpl_multi_delete.test
@@ -21,3 +21,5 @@ drop table t1,t2;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_multi_delete2.test b/mysql-test/t/rpl_multi_delete2.test
index c5128833843..62d95a3a90f 100644
--- a/mysql-test/t/rpl_multi_delete2.test
+++ b/mysql-test/t/rpl_multi_delete2.test
@@ -21,3 +21,5 @@ select * from t2;
connection master;
drop table t1,t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_multi_query.test b/mysql-test/t/rpl_multi_query.test
index 2ddd61ce7ba..fa94928e13a 100644
--- a/mysql-test/t/rpl_multi_query.test
+++ b/mysql-test/t/rpl_multi_query.test
@@ -27,3 +27,5 @@ connection master;
show binlog events from 98;
drop database mysqltest;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_multi_update.test b/mysql-test/t/rpl_multi_update.test
index 88994aa66bd..dd75edb3055 100644
--- a/mysql-test/t/rpl_multi_update.test
+++ b/mysql-test/t/rpl_multi_update.test
@@ -22,3 +22,5 @@ UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_multi_update2.test b/mysql-test/t/rpl_multi_update2.test
index bba7700a88e..f92c5504f43 100644
--- a/mysql-test/t/rpl_multi_update2.test
+++ b/mysql-test/t/rpl_multi_update2.test
@@ -31,3 +31,5 @@ connection slave;
sync_with_master;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_multi_update3.test b/mysql-test/t/rpl_multi_update3.test
index 80b0603eb60..64e46882c16 100644
--- a/mysql-test/t/rpl_multi_update3.test
+++ b/mysql-test/t/rpl_multi_update3.test
@@ -157,3 +157,5 @@ SELECT * FROM t1;
connection master;
DROP TABLE t1, t2, t3;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_mystery22.test b/mysql-test/t/rpl_mystery22.test
index d49f1a210f4..f190968a03c 100644
--- a/mysql-test/t/rpl_mystery22.test
+++ b/mysql-test/t/rpl_mystery22.test
@@ -37,3 +37,4 @@ connection master;
drop table t1;
sync_slave_with_master;
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_openssl.test b/mysql-test/t/rpl_openssl.test
index 779ec4e84bf..78731e4dc7d 100644
--- a/mysql-test/t/rpl_openssl.test
+++ b/mysql-test/t/rpl_openssl.test
@@ -60,3 +60,5 @@ sync_with_master;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_optimize.test b/mysql-test/t/rpl_optimize.test
index 9f02b715885..6858f52abab 100644
--- a/mysql-test/t/rpl_optimize.test
+++ b/mysql-test/t/rpl_optimize.test
@@ -41,3 +41,5 @@ sync_with_master;
# If the machine is so fast that slave syncs before OPTIMIZE
# starts, this test wil demonstrate nothing but will pass.
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_ps.test b/mysql-test/t/rpl_ps.test
index 79f48381a4f..adf39b1e4ab 100644
--- a/mysql-test/t/rpl_ps.test
+++ b/mysql-test/t/rpl_ps.test
@@ -41,3 +41,4 @@ connection slave;
sync_with_master;
stop slave;
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_redirect.test b/mysql-test/t/rpl_redirect.test
index d505351cc69..beb18348b40 100644
--- a/mysql-test/t/rpl_redirect.test
+++ b/mysql-test/t/rpl_redirect.test
@@ -41,3 +41,5 @@ select * from t1;
drop table t1;
connection master;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_relayrotate.test b/mysql-test/t/rpl_relayrotate.test
index 2fde590356a..b66cf7a6e0d 100644
--- a/mysql-test/t/rpl_relayrotate.test
+++ b/mysql-test/t/rpl_relayrotate.test
@@ -75,3 +75,5 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_relayspace.test b/mysql-test/t/rpl_relayspace.test
index bb82781b511..70315c14f34 100644
--- a/mysql-test/t/rpl_relayspace.test
+++ b/mysql-test/t/rpl_relayspace.test
@@ -30,3 +30,5 @@ start slave;
# also the slave will probably not cooperate to shutdown
# (as 2 threads are locked)
select master_pos_wait('master-bin.001',200,6)=-1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_replicate_do.test b/mysql-test/t/rpl_replicate_do.test
index 108dd54ce0a..ff5af71ea5b 100644
--- a/mysql-test/t/rpl_replicate_do.test
+++ b/mysql-test/t/rpl_replicate_do.test
@@ -36,3 +36,4 @@ sync_with_master;
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_reset_slave.test b/mysql-test/t/rpl_reset_slave.test
index 1b27e059f92..aeac1b50110 100644
--- a/mysql-test/t/rpl_reset_slave.test
+++ b/mysql-test/t/rpl_reset_slave.test
@@ -46,3 +46,5 @@ reset slave;
start slave;
sync_with_master;
show status like 'slave_open_temp_tables';
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_rewrite_db.test b/mysql-test/t/rpl_rewrite_db.test
index b77d57294fa..1e8e5a992d8 100644
--- a/mysql-test/t/rpl_rewrite_db.test
+++ b/mysql-test/t/rpl_rewrite_db.test
@@ -78,3 +78,4 @@ drop database rewrite;
connection master;
drop table t1;
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test
index 2355e92e58b..26cb5ac8631 100644
--- a/mysql-test/t/rpl_rotate_logs.test
+++ b/mysql-test/t/rpl_rotate_logs.test
@@ -153,3 +153,4 @@ connection master;
drop table if exists t1,t2,t3,t4;
sync_slave_with_master;
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_server_id1.test b/mysql-test/t/rpl_server_id1.test
index 4d504325294..3583f05284c 100644
--- a/mysql-test/t/rpl_server_id1.test
+++ b/mysql-test/t/rpl_server_id1.test
@@ -22,3 +22,5 @@ insert into t1 values (1);
sleep 2; # enough time for the event to be replicated (it should not)
show status like "slave_running";
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_server_id2.test b/mysql-test/t/rpl_server_id2.test
index 7bbac358ada..0f2eb560d18 100644
--- a/mysql-test/t/rpl_server_id2.test
+++ b/mysql-test/t/rpl_server_id2.test
@@ -22,3 +22,5 @@ select * from t1; # check that indeed 2 were inserted
# (not critical).
stop slave;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_set_charset.test b/mysql-test/t/rpl_set_charset.test
index 269074b1c42..c70eb2681f5 100644
--- a/mysql-test/t/rpl_set_charset.test
+++ b/mysql-test/t/rpl_set_charset.test
@@ -31,3 +31,5 @@ drop database mysqltest1;
save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_skip_error.test b/mysql-test/t/rpl_skip_error.test
index 86c89c70314..e0e569a65b7 100644
--- a/mysql-test/t/rpl_skip_error.test
+++ b/mysql-test/t/rpl_skip_error.test
@@ -12,3 +12,5 @@ save_master_pos;
connection slave;
sync_with_master;
select * from t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_slave_status.test b/mysql-test/t/rpl_slave_status.test
new file mode 100644
index 00000000000..7e16097edd0
--- /dev/null
+++ b/mysql-test/t/rpl_slave_status.test
@@ -0,0 +1,30 @@
+# Test case for BUG #10780
+source include/master-slave.inc
+connection master;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+connection slave;
+stop slave;
+change master to master_user='rpl',master_password='rpl';
+start slave;
+connection master;
+--disable_warnings
+drop table if exists t1;
+--enable_warning
+create table t1 (n int);
+insert into t1 values (1);
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from t1;
+connection master;
+delete from mysql.user where user='rpl';
+flush privileges;
+connection slave;
+stop slave;
+start slave;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+--replace_column 7 # 8 # 9 # 22 # 23 #
+--vertical_results
+show slave status;
+
+# end of 4.1 tests
diff --git a/mysql-test/t/rpl_sporadic_master.test b/mysql-test/t/rpl_sporadic_master.test
index b24901c62a9..26b633a1c4f 100644
--- a/mysql-test/t/rpl_sporadic_master.test
+++ b/mysql-test/t/rpl_sporadic_master.test
@@ -22,3 +22,5 @@ select * from t1;
connection master;
drop table t1,t2;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_start_stop_slave.test b/mysql-test/t/rpl_start_stop_slave.test
index 903ff204194..19988cf902a 100644
--- a/mysql-test/t/rpl_start_stop_slave.test
+++ b/mysql-test/t/rpl_start_stop_slave.test
@@ -32,3 +32,5 @@ save_master_pos;
connection slave;
sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_temporary.test b/mysql-test/t/rpl_temporary.test
index e65469de7e0..fcb2391a9d8 100644
--- a/mysql-test/t/rpl_temporary.test
+++ b/mysql-test/t/rpl_temporary.test
@@ -130,3 +130,5 @@ create temporary table t3 (f int);
sync_with_master;
# The server will now close done
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_timezone.test b/mysql-test/t/rpl_timezone.test
index a7547f7afc6..2e9883141d8 100644
--- a/mysql-test/t/rpl_timezone.test
+++ b/mysql-test/t/rpl_timezone.test
@@ -122,3 +122,5 @@ select * from t2;
connection master;
drop table t1, t2;
sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_until.test b/mysql-test/t/rpl_until.test
index c1aee2cb1db..5bc7a040b1b 100644
--- a/mysql-test/t/rpl_until.test
+++ b/mysql-test/t/rpl_until.test
@@ -83,3 +83,5 @@ start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
# Warning should be given for second command
start slave sql_thread;
start slave until master_log_file='master-bin.000001', master_log_pos=776;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_user_variables.test b/mysql-test/t/rpl_user_variables.test
index 711d83219a6..e8985397703 100644
--- a/mysql-test/t/rpl_user_variables.test
+++ b/mysql-test/t/rpl_user_variables.test
@@ -54,3 +54,5 @@ save_master_pos;
connection slave;
sync_with_master;
stop slave;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_variables.test b/mysql-test/t/rpl_variables.test
index ea40181ecd3..57ae2b9c3c4 100644
--- a/mysql-test/t/rpl_variables.test
+++ b/mysql-test/t/rpl_variables.test
@@ -3,6 +3,8 @@ source include/master-slave.inc;
set global slave_net_timeout=100;
set global sql_slave_skip_counter=100;
+# End of 4.1 tests
+
# BUG #7800: Add various-slave related variables to SHOW VARIABLES
show variables like 'slave_compressed_protocol';
--replace_column 2 SLAVE_LOAD_TMPDIR
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index ef26712af06..eac76749589 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2080,6 +2080,96 @@ select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid
drop table t1,t2,t3;
+# Test for BUG#11700
+CREATE TABLE t1 (
+ acct_id int(11) NOT NULL default '0',
+ profile_id smallint(6) default NULL,
+ UNIQUE KEY t1$acct_id (acct_id),
+ KEY t1$profile_id (profile_id)
+);
+INSERT INTO t1 VALUES (132,17),(133,18);
+
+CREATE TABLE t2 (
+ profile_id smallint(6) default NULL,
+ queue_id int(11) default NULL,
+ seq int(11) default NULL,
+ KEY t2$queue_id (queue_id)
+);
+INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1);
+
+CREATE TABLE t3 (
+ id int(11) NOT NULL default '0',
+ qtype int(11) default NULL,
+ seq int(11) default NULL,
+ warn_lvl int(11) default NULL,
+ crit_lvl int(11) default NULL,
+ rr1 tinyint(4) NOT NULL default '0',
+ rr2 int(11) default NULL,
+ default_queue tinyint(4) NOT NULL default '0',
+ KEY t3$qtype (qtype),
+ KEY t3$id (id)
+);
+
+INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0),
+ (36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0);
+
+SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q
+WHERE
+ (pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND
+ (pq.queue_id = q.id) AND (q.rr1 <> 1);
+
+drop table t1,t2,t3;
+
+#
+# Bug #11482 Wrongly applied optimization was erroneously rejecting valid
+# rows
+create table t1 (f1 int);
+insert into t1 values (1),(NULL);
+create table t2 (f2 int, f3 int, f4 int);
+create index idx1 on t2 (f4);
+insert into t2 values (1,2,3),(2,4,6);
+select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3)
+from t2 C where A.f4 = C.f4) or A.f3 IS NULL;
+drop table t1,t2;
+
+#
+# Bug #11521 Negative integer keys incorrectly substituted for 0 during
+# range analysis.
+
+create table t2 (a tinyint unsigned);
+create index t2i on t2(a);
+insert into t2 values (0), (254), (255);
+explain select * from t2 where a > -1;
+select * from t2 where a > -1;
+drop table t2;
+
+#
+# Bug #11745: SELECT ... FROM DUAL with WHERE condition
+#
+
+CREATE TABLE t1 (a int, b int, c int);
+INSERT INTO t1
+ SELECT 50, 3, 3 FROM DUAL
+ WHERE NOT EXISTS
+ (SELECT * FROM t1 WHERE a = 50 AND b = 3);
+SELECT * FROM t1;
+INSERT INTO t1
+ SELECT 50, 3, 3 FROM DUAL
+ WHERE NOT EXISTS
+ (SELECT * FROM t1 WHERE a = 50 AND b = 3);
+select found_rows();
+SELECT * FROM t1;
+select count(*) from t1;
+select found_rows();
+select count(*) from t1 limit 2,3;
+select found_rows();
+select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3;
+select found_rows();
+
+DROP TABLE t1;
+
+# End of 4.1 tests
+
#
# Test case for bug 7098: substitution of a constant for a string field
#
@@ -2154,15 +2244,6 @@ SELECT K2C4, K4N4, F2I4 FROM t1
(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200'));
SELECT K2C4, K4N4, F2I4 FROM t1
WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200');
-
-select found_rows();
-select count(*) from t1;
-select found_rows();
-select count(*) from t1 limit 2,3;
-select found_rows();
-select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3;
-select found_rows();
-
DROP TABLE t1;
#
@@ -2180,36 +2261,6 @@ EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
DROP TABLE t1, t2;
-
-#
-# Test case for bug 7098: substitution of a constant for a string field
-#
-
-CREATE TABLE t1 ( city char(30) );
-INSERT INTO t1 VALUES ('London');
-INSERT INTO t1 VALUES ('Paris');
-
-SELECT * FROM t1 WHERE city='London';
-SELECT * FROM t1 WHERE city='london';
-EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london';
-SELECT * FROM t1 WHERE city='London' AND city='london';
-EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
-SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
-
-DROP TABLE t1;
-
-#
-# Bug#7425 inconsistent sort order on unsigned columns result of substraction
-#
-
-create table t1 (a int(11) unsigned, b int(11) unsigned);
-insert into t1 values (1,0), (1,1), (1,2);
-select a-b from t1 order by 1;
-select a-b , (a-b < 0) from t1 order by 1;
-select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0;
-select cast((a - b) as unsigned) from t1 order by 1;
-drop table t1;
-
#
# Bug#8670
#
@@ -2297,82 +2348,3 @@ DROP TABLE t1,t2;
#
select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0;
-# Test for BUG#11700
-CREATE TABLE t1 (
- acct_id int(11) NOT NULL default '0',
- profile_id smallint(6) default NULL,
- UNIQUE KEY t1$acct_id (acct_id),
- KEY t1$profile_id (profile_id)
-);
-INSERT INTO t1 VALUES (132,17),(133,18);
-
-CREATE TABLE t2 (
- profile_id smallint(6) default NULL,
- queue_id int(11) default NULL,
- seq int(11) default NULL,
- KEY t2$queue_id (queue_id)
-);
-INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1);
-
-CREATE TABLE t3 (
- id int(11) NOT NULL default '0',
- qtype int(11) default NULL,
- seq int(11) default NULL,
- warn_lvl int(11) default NULL,
- crit_lvl int(11) default NULL,
- rr1 tinyint(4) NOT NULL default '0',
- rr2 int(11) default NULL,
- default_queue tinyint(4) NOT NULL default '0',
- KEY t3$qtype (qtype),
- KEY t3$id (id)
-);
-
-INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0),
- (36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0);
-
-SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q
-WHERE
- (pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND
- (pq.queue_id = q.id) AND (q.rr1 <> 1);
-
-drop table t1,t2,t3;
-
-#
-# Bug #11482 Wrongly applied optimization was erroneously rejecting valid
-# rows
-create table t1 (f1 int);
-insert into t1 values (1),(NULL);
-create table t2 (f2 int, f3 int, f4 int);
-create index idx1 on t2 (f4);
-insert into t2 values (1,2,3),(2,4,6);
-select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3)
-from t2 C where A.f4 = C.f4) or A.f3 IS NULL;
-drop table t1,t2;
-#
-# Bug #11521 Negative integer keys incorrectly substituted for 0 during
-# range analysis.
-
-create table t2 (a tinyint unsigned);
-create index t2i on t2(a);
-insert into t2 values (0), (254), (255);
-explain select * from t2 where a > -1;
-select * from t2 where a > -1;
-drop table t2;
-
-#
-# Bug #11745: SELECT ... FROM DUAL with WHERE condition
-#
-
-CREATE TABLE t1 (a int, b int, c int);
-INSERT INTO t1
- SELECT 50, 3, 3 FROM DUAL
- WHERE NOT EXISTS
- (SELECT * FROM t1 WHERE a = 50 AND b = 3);
-SELECT * FROM t1;
-INSERT INTO t1
- SELECT 50, 3, 3 FROM DUAL
- WHERE NOT EXISTS
- (SELECT * FROM t1 WHERE a = 50 AND b = 3);
-SELECT * FROM t1;
-
-DROP TABLE t1;
diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test
index 91879015b51..e4bc54a5538 100644
--- a/mysql-test/t/select_found.test
+++ b/mysql-test/t/select_found.test
@@ -191,3 +191,5 @@ INSERT INTO t1 VALUES (1,2), (1,3), (1,4), (1,5);
SELECT SQL_CALC_FOUND_ROWS DISTINCT 'a' FROM t1 GROUP BY b LIMIT 2;
SELECT FOUND_ROWS();
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/select_safe.test b/mysql-test/t/select_safe.test
index 5b2dfb00bb7..1da700c9adf 100644
--- a/mysql-test/t/select_safe.test
+++ b/mysql-test/t/select_safe.test
@@ -56,7 +56,6 @@ SELECT * from t1;
#
# Test MAX_SEEKS_FOR_KEY
#
-SELECT @@MAX_SEEKS_FOR_KEY;
analyze table t1;
insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
@@ -87,3 +86,5 @@ select * from (select 1 union select 2 union select 3) x;
drop table t1;
SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index d591f90dd65..efe3504ad7d 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -385,3 +385,5 @@ create table t1 (
);
SHOW CREATE TABLE t1;
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/skip_name_resolve.test b/mysql-test/t/skip_name_resolve.test
index b669579acbf..02339ca14c5 100644
--- a/mysql-test/t/skip_name_resolve.test
+++ b/mysql-test/t/skip_name_resolve.test
@@ -6,3 +6,5 @@ GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255';
SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255';
REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255';
DROP USER mysqltest_1@'127.0.0.1/255.255.255.255';
+
+# End of 4.1 tests
diff --git a/mysql-test/t/sp-big.test b/mysql-test/t/sp-big.test
new file mode 100644
index 00000000000..769d77dbef9
--- /dev/null
+++ b/mysql-test/t/sp-big.test
@@ -0,0 +1,33 @@
+#
+# Bug #11602: SP with very large body not handled well
+#
+
+--disable_warnings
+drop procedure if exists test.longprocedure;
+drop table if exists t1;
+--enable_warnings
+
+create table t1 (a int);
+insert into t1 values (1),(2),(3);
+
+let $body=`select repeat('select count(*) into out1 from t1;\n', 3072)`;
+
+delimiter //;
+--disable_query_log
+eval select length('$body') as length//
+eval create procedure test.longprocedure (out out1 int) deterministic
+begin
+ $body
+end//
+--enable_query_log
+
+delimiter ;//
+
+# this is larger than the length above, because it includes the 'begin' and
+# 'end' bits and some whitespace
+select length(routine_definition) from information_schema.routines where routine_schema = 'test' and routine_name = 'longprocedure';
+
+call test.longprocedure(@value); select @value;
+
+drop procedure test.longprocedure;
+drop table t1;
diff --git a/mysql-test/t/sp-prelocking.test b/mysql-test/t/sp-prelocking.test
new file mode 100644
index 00000000000..e5f35b19fa7
--- /dev/null
+++ b/mysql-test/t/sp-prelocking.test
@@ -0,0 +1,242 @@
+#
+# Tests of prelocking-free execution of stored procedures.
+# Currently two properties of prelocking-free SP execution are checked:
+# - It is possible to execute DDL statements in prelocking-free stored
+# procedure
+# - The same procedure can be called in prelocking-free mode and
+# in prelocked mode (from within a function).
+
+--disable_warnings
+drop database if exists mysqltest;
+drop table if exists t1, t2, t3, t4;
+drop procedure if exists sp1;
+drop procedure if exists sp2;
+drop procedure if exists sp3;
+drop procedure if exists sp4;
+drop function if exists f1;
+drop function if exists f2;
+drop function if exists f3;
+--enable_warnings
+
+# BUG#8072
+
+create database mysqltest;
+delimiter //;
+use mysqltest//
+create procedure sp1 ()
+begin
+ drop table if exists t1;
+ select 1 as "my-col";
+end;
+//
+delimiter ;//
+
+select database();
+call sp1();
+select database();
+
+use test;
+select database();
+call mysqltest.sp1();
+select database();
+
+drop procedure mysqltest.sp1;
+drop database mysqltest;
+
+# BUG#8766
+
+delimiter //;
+create procedure sp1()
+begin
+ create table t1 (a int);
+ insert into t1 values (10);
+end//
+
+create procedure sp2()
+begin
+ create table t2(a int);
+ insert into t2 values(1);
+ call sp1();
+end//
+
+create function f1() returns int
+begin
+ return (select max(a) from t1);
+end//
+
+create procedure sp3()
+begin
+ call sp1();
+ select 'func', f1();
+end//
+
+delimiter ;//
+
+call sp1();
+select 't1',a from t1;
+
+drop table t1;
+call sp2();
+select 't1',a from t1;
+select 't2',a from t2;
+drop table t1, t2;
+
+call sp3();
+select 't1',a from t1;
+
+drop table t1;
+
+drop procedure sp1;
+drop procedure sp2;
+drop procedure sp3;
+drop function f1;
+
+delimiter //;
+create procedure sp1()
+begin
+ create temporary table t2(a int);
+ insert into t2 select * from t1;
+end//
+
+create procedure sp2()
+begin
+ create temporary table t1 (a int);
+ insert into t1 values(1);
+ call sp1();
+ select 't1', a from t1;
+ select 't2', a from t2;
+ drop table t1;
+ drop table t2;
+end//
+
+delimiter ;//
+call sp2();
+
+drop procedure sp1;
+drop procedure sp2;
+
+# Miscelaneous tests
+create table t1 (a int);
+insert into t1 values(1),(2);
+create table t2 as select * from t1;
+create table t3 as select * from t1;
+create table t4 as select * from t1;
+delimiter //;
+create procedure sp1(a int)
+begin
+ select a;
+end //
+
+create function f1() returns int
+begin
+ return (select max(a) from t1);
+end //
+
+delimiter ;//
+
+CALL sp1(f1());
+
+#############
+delimiter //;
+create procedure sp2(a int)
+begin
+ select * from t3;
+ select a;
+end //
+
+create procedure sp3()
+begin
+ select * from t1;
+ call sp2(5);
+end //
+
+create procedure sp4()
+begin
+ select * from t2;
+ call sp3();
+end //
+
+delimiter ;//
+call sp4();
+
+drop procedure sp1;
+drop procedure sp2;
+drop procedure sp3;
+drop procedure sp4;
+drop function f1;
+
+# Test that prelocking state restoration works with cursors
+--disable_warnings
+drop view if exists v1;
+--enable_warnings
+delimiter //;
+
+create function f1(ab int) returns int
+begin
+ declare i int;
+ set i= (select max(a) from t1 where a < ab) ;
+ return i;
+end //
+
+create function f2(ab int) returns int
+begin
+ declare i int;
+ set i= (select max(a) from t2 where a < ab) ;
+ return i;
+end //
+
+create view v1 as
+ select t3.a as x, t4.a as y, f2(3) as z
+ from t3, t4 where t3.a = t4.a //
+
+create procedure sp1()
+begin
+ declare a int;
+ set a= (select f1(4) + count(*) A from t1, v1);
+end //
+
+
+create function f3() returns int
+begin
+ call sp1();
+ return 1;
+end //
+
+call sp1() //
+
+select f3() //
+select f3() //
+
+call sp1() //
+
+---------------
+drop procedure sp1//
+drop function f3//
+
+create procedure sp1()
+begin
+ declare x int;
+ declare c cursor for select f1(3) + count(*) from v1;
+ open c;
+ fetch c into x;
+end;//
+
+create function f3() returns int
+begin
+ call sp1();
+ return 1;
+end //
+
+call sp1() //
+call sp1() //
+
+select f3() //
+call sp1() //
+
+delimiter ;//
+drop table t1,t2,t3;
+drop function f1;
+drop function f2;
+drop function f3;
+drop procedure sp1;
+
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index d9e6163cbc7..fe1dc613249 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -22,15 +22,12 @@ use test;
# t3 and up are created and dropped when needed.
#
--disable_warnings
-drop table if exists t1;
+drop table if exists t1,t2,t3,t4;
--enable_warnings
create table t1 (
id char(16) not null default '',
data int not null
);
---disable_warnings
-drop table if exists t2;
---enable_warnings
create table t2 (
s char(16),
i int,
@@ -150,9 +147,6 @@ drop procedure setcontext|
# Set things to null
---disable_warnings
-drop table if exists t3|
---enable_warnings
create table t3 ( d date, i int, f double, s varchar(32) )|
--disable_warnings
@@ -686,9 +680,6 @@ begin
end|
delete from t1|
---disable_warnings
-drop table if exists t3|
---enable_warnings
create table t3 ( s char(16), d int)|
call into_test4()|
select * from t3|
@@ -744,14 +735,9 @@ begin
insert into test.t3 values (concat(x, "2"), y+2);
end|
---disable_warnings
-drop table if exists t3|
---enable_warnings
call create_select("cs", 90)|
select * from t1, t3|
---disable_warnings
-drop table if exists t3|
---enable_warnings
+drop table t3|
delete from t1|
drop procedure create_select|
@@ -925,9 +911,6 @@ drop procedure hndlr3|
# Variables might be uninitialized when using handlers
# (Otherwise the compiler can detect if a variable is not set, but
# not in this case.)
---disable_warnings
-drop table if exists t3|
---enable_warnings
create table t3 ( id char(16), data int )|
--disable_warnings
@@ -980,9 +963,6 @@ call cur1()|
select * from t1|
drop procedure cur1|
---disable_warnings
-drop table if exists t3|
---enable_warnings
create table t3 ( s char(16), i int )|
--disable_warnings
@@ -1232,12 +1212,14 @@ begin
end|
select f5(1)|
# This should generate an error about insuficient number of tables locked
-# Nuw this crash server, comented until bug#11394 fix
-#--error 1100
-#select f5(2)|
+# Now this crash server
+--disable_parsing until bug#11394 fix
+--error 1100
+select f5(2)|
# But now it simply miserably fails because we are trying to use the same
# lex on the next iteration :/ It should generate some error too...
-# select f5(3)|
+select f5(3)|
+--enable_parsing
# OTOH this should work
create function f6() returns int
@@ -1285,9 +1267,11 @@ create function f1() returns int
return (select sum(data) from t1) + (select sum(data) from v1)|
# This queries will crash server because we can't use LEX in
# reenterable fashion yet. Patch disabling recursion will heal this.
-#select f1()|
-#select * from v1|
-#select * from v2|
+--disable_parsing
+select f1()|
+select * from v1|
+select * from v2|
+--enable_parsing
# Back to the normal cases
drop function f1|
create function f1() returns int
@@ -1499,54 +1483,55 @@ show procedure status like '%p%'|
#
# This part of test is disabled until we implement support for
# recursive stored procedures.
-#--disable_warnings
-#drop table if exists fib|
-#--enable_warnings
-#create table fib ( f bigint unsigned not null )|
-#
-## We deliberately do it the awkward way, fetching the last two
-## values from the table, in order to exercise various statements
-## and table accesses at each turn.
-#--disable_warnings
-#drop procedure if exists fib|
-#--enable_warnings
-#create procedure fib(n int unsigned)
-#begin
-# if n > 1 then
-# begin
-# declare x, y bigint unsigned;
-# declare c cursor for select f from fib order by f desc limit 2;
-#
-# open c;
-# fetch c into y;
-# fetch c into x;
-# close c;
-# insert into fib values (x+y);
-# call fib(n-1);
-# end;
-# end if;
-#end|
-#
-## Minimum test: recursion of 3 levels
-#
-#insert into fib values (0), (1)|
-#
-#call fib(3)|
-#
-#select * from fib order by f asc|
-#
-#delete from fib|
-#
-## Original test: 20 levels (may run into memory limits!)
-#
-#insert into fib values (0), (1)|
-#
-#call fib(20)|
-#
-#select * from fib order by f asc|
-#drop table fib|
-#drop procedure fib|
+--disable_parsing
+--disable_warnings
+drop table if exists fib|
+--enable_warnings
+create table fib ( f bigint unsigned not null )|
+# We deliberately do it the awkward way, fetching the last two
+# values from the table, in order to exercise various statements
+# and table accesses at each turn.
+--disable_warnings
+drop procedure if exists fib|
+--enable_warnings
+create procedure fib(n int unsigned)
+begin
+ if n > 1 then
+ begin
+ declare x, y bigint unsigned;
+ declare c cursor for select f from fib order by f desc limit 2;
+
+ open c;
+ fetch c into y;
+ fetch c into x;
+ close c;
+ insert into fib values (x+y);
+ call fib(n-1);
+ end;
+ end if;
+end|
+
+# Minimum test: recursion of 3 levels
+
+insert into fib values (0), (1)|
+
+call fib(3)|
+
+select * from fib order by f asc|
+
+delete from fib|
+
+# Original test: 20 levels (may run into memory limits!)
+
+insert into fib values (0), (1)|
+
+call fib(20)|
+
+select * from fib order by f asc|
+drop table fib|
+drop procedure fib|
+--enable_parsing
#
# Comment & suid
@@ -1614,9 +1599,6 @@ insert into t1 values ("foo", 3), ("bar", 2), ("zip", 5), ("zap", 1)|
select t1max()|
drop function t1max|
---disable_warnings
-drop table if exists t3|
---enable_warnings
create table t3 (
v char(16) not null primary key,
c int unsigned not null
@@ -1750,9 +1732,6 @@ drop procedure bug1656|
#
# BUG#1862
#
---disable_warnings
-drop table if exists t3|
---enable_warnings
create table t3(a int)|
--disable_warnings
@@ -1830,49 +1809,51 @@ drop procedure bug2260|
# FIXME: Other solution would be to use preopened proc table
# instead of opening it anew.
#
-#--disable_warnings
-#drop procedure if exists bug2267_1|
-#--enable_warnings
-#create procedure bug2267_1()
-#begin
-# show procedure status;
-#end|
-#
-#--disable_warnings
-#drop procedure if exists bug2267_2|
-#--enable_warnings
-#create procedure bug2267_2()
-#begin
-# show function status;
-#end|
-#
-#--disable_warnings
-#drop procedure if exists bug2267_3|
-#--enable_warnings
-#create procedure bug2267_3()
-#begin
-# show create procedure bug2267_1;
-#end|
-#
-#--disable_warnings
-#drop procedure if exists bug2267_4|
-#--enable_warnings
-#create procedure bug2267_4()
-#begin
-# show create function fac;
-#end|
-#
-#--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
-#call bug2267_1()|
-#--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
-#call bug2267_2()|
-#call bug2267_3()|
-#call bug2267_4()|
-#
-#drop procedure bug2267_1|
-#drop procedure bug2267_2|
-#drop procedure bug2267_3|
-#drop procedure bug2267_4|
+--disable_parsing
+--disable_warnings
+drop procedure if exists bug2267_1|
+--enable_warnings
+create procedure bug2267_1()
+begin
+ show procedure status;
+end|
+
+--disable_warnings
+drop procedure if exists bug2267_2|
+--enable_warnings
+create procedure bug2267_2()
+begin
+ show function status;
+end|
+
+--disable_warnings
+drop procedure if exists bug2267_3|
+--enable_warnings
+create procedure bug2267_3()
+begin
+ show create procedure bug2267_1;
+end|
+
+--disable_warnings
+drop procedure if exists bug2267_4|
+--enable_warnings
+create procedure bug2267_4()
+begin
+ show create function fac;
+end|
+
+--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+call bug2267_1()|
+--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+call bug2267_2()|
+call bug2267_3()|
+call bug2267_4()|
+
+drop procedure bug2267_1|
+drop procedure bug2267_2|
+drop procedure bug2267_3|
+drop procedure bug2267_4|
+--enable_parsing
#
# BUG#2227
@@ -1901,23 +1882,25 @@ drop procedure bug2227|
# QQ For this reason we can't run this test any more (i.e., if we modify
# QQ it, it's no longer a test case for the bug), but we keep it here
# QQ anyway, for tracability.
-#--disable_warnings
-#drop procedure if exists bug2614|
-#--enable_warnings
-#create procedure bug2614()
-#begin
-# drop temporary table if exists t3;
-# create temporary table t3 (id int default '0' not null);
-# insert into t3 select 12;
-# insert into t3 select * from t3;
-#end|
-#
-#--disable_warnings
-#call bug2614()|
-#--enable_warnings
-#call bug2614()|
-#drop temporary table t3|
-#drop procedure bug2614|
+--disable_parsing
+--disable_warnings
+drop procedure if exists bug2614|
+--enable_warnings
+create procedure bug2614()
+begin
+ drop temporary table if exists t3;
+ create temporary table t3 (id int default '0' not null);
+ insert into t3 select 12;
+ insert into t3 select * from t3;
+end|
+
+--disable_warnings
+call bug2614()|
+--enable_warnings
+call bug2614()|
+drop temporary table t3|
+drop procedure bug2614|
+--enable_parsing
#
# BUG#2674
@@ -2009,9 +1992,6 @@ drop procedure bug2776_2|
#
# BUG#2780
#
---disable_warnings
-drop table if exists t3|
---enable_warnings
create table t3 (s1 smallint)|
insert into t3 values (123456789012)|
@@ -2085,9 +2065,6 @@ drop table t3, t4|
#
# BUG#2656
#
---disable_warnings
-drop table if exists t3, t4|
---enable_warnings
create table t3 (
OrderID int not null,
@@ -2175,8 +2152,6 @@ drop procedure bug3426|
# BUG#3448
#
--disable_warnings
-drop table if exists t3, t4|
-
create table t3 (
a int primary key,
ach char(1)
@@ -2208,9 +2183,6 @@ drop table t3, t4|
#
# BUG#3734
#
---disable_warnings
-drop table if exists t3|
---enable_warnings
create table t3 (
id int unsigned auto_increment not null primary key,
title VARCHAR(200),
@@ -2386,9 +2358,6 @@ drop procedure bug3843|
#
# BUG#3368
#
---disable_warnings
-drop table if exists t3|
---enable_warnings
create table t3 ( s1 char(10) )|
insert into t3 values ('a'), ('b')|
@@ -2408,9 +2377,6 @@ drop table t3|
#
# BUG#4579
#
---disable_warnings
-drop table if exists t3|
---enable_warnings
create table t3 (f1 int, f2 int)|
insert into t3 values (1,1)|
@@ -2445,7 +2411,6 @@ drop table t3|
# BUG#2773: Function's data type ignored in stored procedures
#
--disable_warnings
-drop table if exists t3|
drop procedure if exists bug2773|
--enable_warnings
@@ -2474,10 +2439,6 @@ drop function bug3788|
#
# BUG#4726
#
---disable_warnings
-drop table if exists t3|
---enable_warnings
-
create table t3 (f1 int, f2 int, f3 int)|
insert into t3 values (1,1,1)|
@@ -2508,9 +2469,6 @@ drop table t3|
# BUG#4318
#
#QQ Don't know if HANDLER commands can work with SPs, or at all...
-#--disable_warnings
-#drop table if exists t3|
-#--enable_warnings
#
#create table t3 (s1 int)|
#insert into t3 values (3), (4)|
@@ -2563,11 +2521,13 @@ begin
show variables like 'foo';
show warnings;
end|
-#show binlog events;
-#show storage engines;
-#show master status;
-#show slave hosts;
-#show slave status;
+--disable_parsing
+show binlog events;
+show storage engines;
+show master status;
+show slave hosts;
+show slave status;
+--enable_parsing
call bug4902()|
call bug4902()|
@@ -2592,10 +2552,6 @@ drop procedure bug4902_2|
# BUG#4904
#
--disable_warnings
-drop table if exists t3|
---enable_warnings
-
---disable_warnings
drop procedure if exists bug4904|
--enable_warnings
create procedure bug4904()
@@ -2848,7 +2804,6 @@ drop procedure bug3583|
# BUG#4905: Stored procedure doesn't clear for "Rows affected"
#
--disable_warnings
-drop table if exists t3|
drop procedure if exists bug4905|
--enable_warnings
@@ -2948,9 +2903,6 @@ drop procedure bug8540|
#
# BUG#6642: Stored procedure crash if expression with set function
#
---disable_warnings
-drop table if exists t3|
---enable_warnings
create table t3 (s1 int)|
--disable_warnings
@@ -3038,9 +2990,6 @@ drop table t3|
# BUG#8116: calling simple stored procedure twice in a row results
# in server crash
#
---disable_warnings
-drop table if exists t3|
---enable_warnings
create table t3 ( userid bigint(20) not null default 0 )|
--disable_warnings
@@ -3283,7 +3232,6 @@ delete from t1|
drop procedure if exists bug6900|
drop procedure if exists bug9074|
drop procedure if exists bug6900_9074|
-drop table if exists t3|
--enable_warnings
create table t3 (w char unique, x char)|
@@ -3378,7 +3326,7 @@ drop procedure avg|
drop procedure if exists bug6129|
--enable_warnings
set @old_mode= @@sql_mode;
-set @@sql_mode= "";
+set @@sql_mode= "ERROR_FOR_DIVISION_BY_ZERO";
create procedure bug6129()
select @@sql_mode|
call bug6129()|
@@ -3812,26 +3760,27 @@ drop procedure if exists bug7088_1|
drop procedure if exists bug7088_2|
--enable_warnings
-create procedure bug6063()
- lābel: begin end|
-call bug6063()|
-# QQ Known bug: this will not show the label correctly.
-show create procedure bug6063|
-
-set character set utf8|
-create procedure bug7088_1()
- label1: begin end label1|
-create procedure bug7088_2()
- lƤbel1: begin end|
-call bug7088_1()|
-call bug7088_2()|
-set character set default|
-show create procedure bug7088_1|
-show create procedure bug7088_2|
-
-drop procedure bug6063|
-drop procedure bug7088_1|
-drop procedure bug7088_2|
+# psergey: temporarily disabled until Bar fixes BUG#11986
+# create procedure bug6063()
+# lābel: begin end|
+# call bug6063()|
+# # QQ Known bug: this will not show the label correctly.
+# show create procedure bug6063|
+#
+# set character set utf8|
+# create procedure bug7088_1()
+# label1: begin end label1|
+# create procedure bug7088_2()
+# lƤbel1: begin end|
+# call bug7088_1()|
+# call bug7088_2()|
+# set character set default|
+# show create procedure bug7088_1|
+# show create procedure bug7088_2|
+#
+# drop procedure bug6063|
+# drop procedure bug7088_1|
+# drop procedure bug7088_2|
#
# BUG#9565: "Wrong locking in stored procedure if a sub-sequent procedure
@@ -3877,6 +3826,34 @@ drop procedure bug9538|
#
+# BUG#8692: Cursor fetch of empty string
+#
+--disable_warnings
+drop procedure if exists bug8692|
+--enable_warnings
+create table t3 (c1 varchar(5), c2 char(5), c3 enum('one','two'), c4 text, c5 blob, c6 char(5), c7 varchar(5))|
+insert into t3 values ('', '', '', '', '', '', NULL)|
+
+create procedure bug8692()
+begin
+ declare v1 VARCHAR(10);
+ declare v2 VARCHAR(10);
+ declare v3 VARCHAR(10);
+ declare v4 VARCHAR(10);
+ declare v5 VARCHAR(10);
+ declare v6 VARCHAR(10);
+ declare v7 VARCHAR(10);
+ declare c8692 cursor for select c1,c2,c3,c4,c5,c6,c7 from t3;
+ open c8692;
+ fetch c8692 into v1,v2,v3,v4,v5,v6,v7;
+ select v1, v2, v3, v4, v5, v6, v7;
+end|
+
+call bug8692()|
+drop procedure bug8692|
+drop table t3|
+
+#
# BUG#NNNN: New bug synopsis
#
#--disable_warnings
@@ -3884,7 +3861,6 @@ drop procedure bug9538|
#--enable_warnings
#create procedure bugNNNN...
-
# Add bugs above this line. Use existing tables t1 and t2 when
# practical, or create table t3, t4 etc temporarily (and drop them).
delimiter ;|
diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test
index f8ab521e665..10db520cd12 100644
--- a/mysql-test/t/sql_mode.test
+++ b/mysql-test/t/sql_mode.test
@@ -86,6 +86,8 @@ drop table t1 ;
--error 1231
set @@SQL_MODE=NULL;
+# End of 4.1 tests
+
#
# test for
# WL 1941 "NO_C_ESCAPES sql_mode"
diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test
index 31d9c8154d5..7fea51c9327 100644
--- a/mysql-test/t/status.test
+++ b/mysql-test/t/status.test
@@ -35,3 +35,5 @@ connection con1;
reap;
show status like 'Table_lock%';
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test
index 71b57424e75..ca57ca646f2 100644
--- a/mysql-test/t/strict.test
+++ b/mysql-test/t/strict.test
@@ -1118,3 +1118,28 @@ insert into t1 values ('2000-10-01');
update t1 set d = 1100;
select * from t1;
drop table t1;
+
+#
+# Bug #11964: alter table with timestamp field
+#
+
+set @@sql_mode='traditional';
+create table t1(a int, b timestamp);
+alter table t1 add primary key(a);
+show create table t1;
+drop table t1;
+create table t1(a int, b timestamp default 20050102030405);
+alter table t1 add primary key(a);
+show create table t1;
+drop table t1;
+
+#
+# BIT fields
+#
+
+set @@sql_mode='traditional';
+create table t1(a bit(2));
+--error 1406
+insert into t1 values(b'101');
+select * from t1;
+drop table t1;
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index ecb3432753d..41cdf9f1c64 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -1867,3 +1867,5 @@ insert into t1 values ('1');
select * from (select max(fld) from t1) as foo;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/subselect2.test b/mysql-test/t/subselect2.test
index 2d42320334a..839e94206d0 100644
--- a/mysql-test/t/subselect2.test
+++ b/mysql-test/t/subselect2.test
@@ -146,4 +146,5 @@ SELECT t2.*, t4.DOCTYPENAME, t1.CONTENTSIZE,t1.MIMETYPE FROM t2 INNER JOIN t4 ON
EXPLAIN SELECT t2.*, t4.DOCTYPENAME, t1.CONTENTSIZE,t1.MIMETYPE FROM t2 INNER JOIN t4 ON t2.DOCTYPEID = t4.DOCTYPEID LEFT OUTER JOIN t1 ON t2.DOCID = t1.DOCID WHERE t2.FOLDERID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID='2f6161e879db43c1a5b82c21ddc49089' AND t3.FOLDERNAME = 'Level1') AND t3.FOLDERNAME = 'Level2') AND t3.FOLDERNAME = 'Level3') AND t3.FOLDERNAME = 'CopiedFolder') AND t3.FOLDERNAME = 'Movie Reviews') AND t2.DOCNAME = 'Last Discussion';
-drop table t1, t2, t3, t4; \ No newline at end of file
+drop table t1, t2, t3, t4;
+# End of 4.1 tests
diff --git a/mysql-test/t/subselect_gis.test b/mysql-test/t/subselect_gis.test
index 338051029c4..1ab139b7822 100644
--- a/mysql-test/t/subselect_gis.test
+++ b/mysql-test/t/subselect_gis.test
@@ -13,3 +13,5 @@ select City from t1 where (select
intersects(GeomFromText(AsText(Location)),GeomFromText('Polygon((2 50, 2.5
50, 2.5 47, 2 47, 2 50))'))=0);
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test
index 5d796988178..3b1d2f393c2 100644
--- a/mysql-test/t/subselect_innodb.test
+++ b/mysql-test/t/subselect_innodb.test
@@ -159,3 +159,5 @@ EXECUTE my_stmt;
EXECUTE my_stmt;
deallocate prepare my_stmt;
drop table t1,t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index f477fc378c6..b7a7e83d569 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -136,3 +136,5 @@ eval create table t1 (i int) index directory = "$MYSQL_TEST_DIR/var/master-data/
enable_query_log;
show create table t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/synchronization.test b/mysql-test/t/synchronization.test
index 09324b32b97..c7696195ee0 100644
--- a/mysql-test/t/synchronization.test
+++ b/mysql-test/t/synchronization.test
@@ -36,3 +36,5 @@ while ($1)
dec $1;
}
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/system_mysql_db.test b/mysql-test/t/system_mysql_db.test
index acd19f47728..27c17da2731 100644
--- a/mysql-test/t/system_mysql_db.test
+++ b/mysql-test/t/system_mysql_db.test
@@ -16,3 +16,5 @@ use test;
-- enable_query_log
# keep results same with system_mysql_db_fix
show tables;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/system_mysql_db_fix.test b/mysql-test/t/system_mysql_db_fix.test
index f47b4cba6e6..3b19df5f756 100644
--- a/mysql-test/t/system_mysql_db_fix.test
+++ b/mysql-test/t/system_mysql_db_fix.test
@@ -91,3 +91,5 @@ DROP TABLE db, host, user, func, tables_priv, columns_priv, procs_priv, help_cat
# check that we droped all system tables
show tables;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/system_mysql_db_refs.test b/mysql-test/t/system_mysql_db_refs.test
index 9e2c5a20b54..c5146e1b043 100644
--- a/mysql-test/t/system_mysql_db_refs.test
+++ b/mysql-test/t/system_mysql_db_refs.test
@@ -99,3 +99,5 @@ drop table test_func;
drop table test_host;
drop table test_user;
drop table test_db;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/tablelock.test b/mysql-test/t/tablelock.test
index fbc5d685096..95533903b45 100644
--- a/mysql-test/t/tablelock.test
+++ b/mysql-test/t/tablelock.test
@@ -47,3 +47,5 @@ CREATE TABLE t2 (a int);
lock tables t1 write,t1 as b write, t2 write, t2 as c read;
drop table t2,t1;
unlock tables;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test
index da7ce9b4722..9a7678ed712 100644
--- a/mysql-test/t/temp_table.test
+++ b/mysql-test/t/temp_table.test
@@ -112,3 +112,5 @@ insert into t1 values (3,1),(3,2);
insert into t2 values (NULL, 'foo'), (NULL, 'bar');
select d, c from t1 left join t2 on b = c where a = 3 order by d;
drop table t1, t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/timezone.test b/mysql-test/t/timezone.test
index ffc2e3a3ebf..34bbb365c70 100644
--- a/mysql-test/t/timezone.test
+++ b/mysql-test/t/timezone.test
@@ -58,3 +58,5 @@ select unix_timestamp('1970-01-01 01:00:00'),
unix_timestamp('1970-01-01 01:00:01'),
unix_timestamp('2038-01-01 00:59:59'),
unix_timestamp('2038-01-01 01:00:00');
+
+# End of 4.1 tests
diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test
index 40fcd153877..069c19341e4 100644
--- a/mysql-test/t/timezone2.test
+++ b/mysql-test/t/timezone2.test
@@ -220,3 +220,5 @@ select convert_tz('2005-01-14 17:00:00', 'UTC', custTimeZone) from (select 'UTC'
create table t1 select convert_tz(NULL, NULL, NULL);
select * from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/timezone3.test b/mysql-test/t/timezone3.test
index 8910783cd85..0aedbafcec4 100644
--- a/mysql-test/t/timezone3.test
+++ b/mysql-test/t/timezone3.test
@@ -57,3 +57,5 @@ create table t1 (ts timestamp);
insert into t1 values (19730101235900), (20040101235900);
select * from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/timezone_grant.test b/mysql-test/t/timezone_grant.test
index 5dbf457e1f1..f94d86eb266 100644
--- a/mysql-test/t/timezone_grant.test
+++ b/mysql-test/t/timezone_grant.test
@@ -81,3 +81,4 @@ delete from mysql.tables_priv where user like 'mysqltest\_%';
flush privileges;
drop table t1, t2;
+# End of 4.1 tests
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index f6b3c714d28..7bf8b1a4e2b 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -610,3 +610,35 @@ update t1 set col2 = 4;
# This should not crash server too.
drop trigger t1_bu;
drop table t1;
+
+#
+# storing and restoring parsing modes for triggers (BUG#5891)
+#
+set sql_mode='ansi';
+create table t1 ("t1 column" int);
+create trigger t1_bi before insert on t1 for each row set new."t1 column" = 5;
+set sql_mode="";
+insert into t1 values (0);
+# create trigger with different sql_mode
+create trigger t1_af after insert on t1 for each row set @a=10;
+insert into t1 values (0);
+select * from t1;
+select @a;
+--replace_column 6 #
+show triggers;
+drop table t1;
+# check that rigger preserve sql_mode during execution
+set sql_mode="traditional";
+create table t1 (a date);
+-- error 1292
+insert into t1 values ('2004-01-00');
+set sql_mode="";
+create trigger t1_bi before insert on t1 for each row set new.a = '2004-01-00';
+set sql_mode="traditional";
+insert into t1 values ('2004-01-01');
+select * from t1;
+set sql_mode=default;
+show create table t1;
+--replace_column 6 #
+show triggers;
+drop table t1;
diff --git a/mysql-test/t/truncate.test b/mysql-test/t/truncate.test
index b7ec506ecf1..f806bd8ec17 100644
--- a/mysql-test/t/truncate.test
+++ b/mysql-test/t/truncate.test
@@ -50,3 +50,5 @@ delete from t1;
insert into t1 (a) values (NULL),(NULL);
SELECT * from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index 80aabf6c5e0..1ec5c600296 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -394,6 +394,8 @@ INSERT t1 (i, c) VALUES (1,''),(2,''),(3,'asdfh'),(4,'');
select max(i) from t1 where c = '';
drop table t1;
+# End of 4.1 tests
+
#
# Bug#11657: Creation of secondary index fails
#
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 304ed19b971..78bdd9b8a80 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -114,3 +114,5 @@ CREATE TABLE t1 (y YEAR);
INSERT INTO t1 VALUES ('abc');
SELECT * FROM t1;
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index a7eb78cb292..ca70e35d3cd 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -101,3 +101,15 @@ insert into t1 values ("12-00-00"), ("00-00-00 01:00:00");
insert into t1 values ("00-00-00"), ("00-00-00 00:00:00");
select * from t1;
drop table t1;
+
+#
+# Bug #7308: ISO-8601 date format not handled correctly
+#
+create table t1 (dt datetime);
+insert into t1 values ("20010101T010101");
+insert into t1 values ("2001-01-01T01:01:01");
+insert into t1 values ("2001-1-1T1:01:01");
+select * from t1;
+drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test
index 2901592fd9e..44032fde46f 100644
--- a/mysql-test/t/type_decimal.test
+++ b/mysql-test/t/type_decimal.test
@@ -268,7 +268,11 @@ insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000
select * from t1;
drop table t1;
+# End of 4.1 tests
+
+#
# Test for BUG#8397: decimal type in subselects (Item_cache_decimal)
+#
CREATE TABLE t1
(EMPNUM CHAR(3) NOT NULL,
HOURS DECIMAL(5));
diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test
index 6b2183df069..0d479f312cd 100644
--- a/mysql-test/t/type_enum.test
+++ b/mysql-test/t/type_enum.test
@@ -126,3 +126,5 @@ create table t1 (a set('x','y') default 'x');
--error 1067
alter table t1 alter a set default 'z';
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test
index a27fd4c58b4..c0f1854d5b2 100644
--- a/mysql-test/t/type_float.test
+++ b/mysql-test/t/type_float.test
@@ -145,3 +145,5 @@ select * from t1 where reckey=1.08E2;
select * from t1 where reckey=109;
select * from t1 where reckey=1.09E2;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/type_nchar.test b/mysql-test/t/type_nchar.test
index e85609e3f0c..f2258830450 100644
--- a/mysql-test/t/type_nchar.test
+++ b/mysql-test/t/type_nchar.test
@@ -33,3 +33,4 @@ create table t1 (c nchar varying(10));
show create table t1;
drop table t1;
+# End of 4.1 tests
diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index f295311fe4e..81e06c70c7d 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -986,6 +986,10 @@ create table t1 (sl decimal(0,30));
create table t1 (sl decimal(5, 5));
show create table t1;
drop table t1;
+# Test limits
+create table t1 (sl decimal(65, 30));
+show create table t1;
+drop table t1;
#
# Bug 11557 (DEFAULT values rounded improperly
@@ -1003,3 +1007,11 @@ insert into t1 (f1) values (1);
select * from t1;
drop table t1;
+#
+# Bug 12173 (show create table fails)
+#
+create table t1 (
+ f0 decimal (30,30) zerofill not null DEFAULT 0,
+ f1 decimal (0,0) zerofill not null default 0);
+show create table t1;
+drop table t1;
diff --git a/mysql-test/t/type_ranges.test b/mysql-test/t/type_ranges.test
index a2deb367e14..c1a5ac382ec 100644
--- a/mysql-test/t/type_ranges.test
+++ b/mysql-test/t/type_ranges.test
@@ -165,3 +165,5 @@ drop table t3;
create table t3 select t1.id as id_A, t2.id as id_B from t1 left join t2 using ( id );
select * from t3;
drop table t1,t2,t3;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/type_set.test b/mysql-test/t/type_set.test
index b6410a9ea3d..56df3328246 100644
--- a/mysql-test/t/type_set.test
+++ b/mysql-test/t/type_set.test
@@ -37,3 +37,5 @@ INSERT INTO t1 VALUES ('ae,oe,ue,ss');
SELECT c FROM t1 ORDER BY c;
SELECT c FROM t1 ORDER BY concat(c);
DROP TABLE t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test
index 2f342f8bf67..7ae3f65f7cc 100644
--- a/mysql-test/t/type_time.test
+++ b/mysql-test/t/type_time.test
@@ -20,3 +20,5 @@ insert into t1 values ('09:00:00'),('13:00:00'),('19:38:34'), ('13:00:00'),('09:
select t, time_to_sec(t),sec_to_time(time_to_sec(t)) from t1;
select sec_to_time(time_to_sec(t)) from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test
index 01d18afc5af..f96beedbebc 100644
--- a/mysql-test/t/type_timestamp.test
+++ b/mysql-test/t/type_timestamp.test
@@ -321,3 +321,4 @@ insert into t1 (a, c) values (4, '2004-04-04 00:00:00'),
select * from t1;
drop table t1;
+# End of 4.1 tests
diff --git a/mysql-test/t/type_uint.test b/mysql-test/t/type_uint.test
index b1f59242e8e..a9212183cb6 100644
--- a/mysql-test/t/type_uint.test
+++ b/mysql-test/t/type_uint.test
@@ -13,3 +13,5 @@ insert into t1 values (-1);
insert into t1 values ('5000000000');
select * from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test
index c67b8447494..9744da24c02 100644
--- a/mysql-test/t/type_year.test
+++ b/mysql-test/t/type_year.test
@@ -20,3 +20,5 @@ create table t1 (y year);
insert into t1 values (now());
select if(y = now(), 1, 0) from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 4da19622dcb..227d1cddcfa 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -793,3 +793,5 @@ insert into t1 (col1) values (2),(3),(4),(5),(6);
select 99 union all select id from t1 order by 1;
select id from t1 union all select 99 order by 1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test
index 66b3a2886b6..dd6c36d8414 100644
--- a/mysql-test/t/update.test
+++ b/mysql-test/t/update.test
@@ -214,3 +214,5 @@ insert into t2 values(1,1),(2,2);
UPDATE t1 SET t1.f2=(SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1);
select * from t1;
drop table t1,t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/user_var-binlog.test b/mysql-test/t/user_var-binlog.test
index 916a7dfa47b..004154339b2 100644
--- a/mysql-test/t/user_var-binlog.test
+++ b/mysql-test/t/user_var-binlog.test
@@ -17,3 +17,5 @@ show binlog events from 98;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index f8c441c7564..e3b5b4ef33e 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -122,6 +122,29 @@ set session @honk=99;
set one_shot @honk=99;
#
+# Bug #10724 @@local not preserved in column name of select
+#
+# The value doesn't actually matter, we just care about the column name
+--replace_column 1 #
+select @@local.max_allowed_packet;
+--replace_column 1 #
+select @@session.max_allowed_packet;
+--replace_column 1 #
+select @@global.max_allowed_packet;
+--replace_column 1 #
+select @@max_allowed_packet;
+--replace_column 1 #
+select @@Max_Allowed_Packet;
+--replace_column 1 #
+select @@version;
+--replace_column 1 #
+select @@global.version;
+--replace_column 1 #
+select @@session.VERSION;
+
+# End of 4.1 tests
+
+#
# Bug #6598: problem with cast(NULL as signed integer);
#
diff --git a/mysql-test/t/varbinary.test b/mysql-test/t/varbinary.test
index 9425bd7bd99..5fbd116d7b8 100644
--- a/mysql-test/t/varbinary.test
+++ b/mysql-test/t/varbinary.test
@@ -35,3 +35,5 @@ select 0xfg;
create table t1 select 1 as x, 2 as xx;
select x,xx from t1;
drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index c3ffdc79c16..9d68b7c8172 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -390,6 +390,8 @@ SET GLOBAL table_cache=-1;
SHOW VARIABLES LIKE 'table_cache';
SET GLOBAL table_cache=DEFAULT;
+# End of 4.1 tests
+
#
# Bug#6282 Packet error with SELECT INTO
#
@@ -406,3 +408,13 @@ drop table t1;
set @@warning_count=1;
--error 1238
set @@global.error_count=1;
+
+#
+# Bug #10351: Setting ulong variable to > MAX_ULONG fails on 32-bit platform
+#
+set @@max_heap_table_size= 4294967296;
+select @@max_heap_table_size > 0;
+set global max_heap_table_size= 4294967296;
+select @@max_heap_table_size > 0;
+set @@max_heap_table_size= 4294967296;
+select @@max_heap_table_size > 0;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 16a94820596..9885566442f 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -147,10 +147,11 @@ insert into t1 values (1), (2), (3);
create view v1 (a) as select a+1 from t1;
create view v2 (a) as select a-1 from t1;
-# WL #2486 should enable these tests
-#select * from t1 natural left join v1;
-#select * from v2 natural left join t1;
-#select * from v2 natural left join v1;
+--disable_parsing WL #2486 should enable these tests
+select * from t1 natural left join v1;
+select * from v2 natural left join t1;
+select * from v2 natural left join v1;
+--enable_parsing
drop view v1, v2;
drop table t1;
@@ -490,15 +491,15 @@ create view v1 (a,a) as select 'a','a';
#
# SP variables inside view test
#
-# QQ This can't be tested with the new table locking for functions,
-# QQ since views created in an SP can't be used within the same SP
-# QQ (just as for tables). Instead it fails with error 1146.
-#delimiter //;
-#create procedure p1 () begin declare v int; create view v1 as select v; end;//
-#delimiter ;//
-#-- error 1351
-#call p1();
-#drop procedure p1;
+--disable_warnings
+drop procedure if exists p1;
+--enable_warnings
+delimiter //;
+create procedure p1 () begin declare v int; create view v1 as select v; end;//
+delimiter ;//
+-- error 1351
+call p1();
+drop procedure p1;
#
# updatablity should be transitive
@@ -1855,6 +1856,15 @@ DROP VIEW v1;
DROP TABLE t1;
#
+# Bug #11335 View redefines column types
+#
+create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
+create view v1 as select * from t1;
+desc v1;
+drop view v1;
+drop table t1;
+
+#
# Bug #11760 Typo in Item_func_add_time::print() results in NULLs returned
# subtime() in view
create table t1(f1 datetime);
@@ -1862,4 +1872,28 @@ insert into t1 values('2005.01.01 12:0:0');
create view v1 as select f1, subtime(f1, '1:1:1') as sb from t1;
select * from v1;
drop view v1;
-drop table t1;
+drop table t1;
+
+#
+# Test for bug #11412: query over a multitable view with GROUP_CONCAT
+#
+CREATE TABLE t1 (
+ aid int PRIMARY KEY,
+ fn varchar(20) NOT NULL,
+ ln varchar(20) NOT NULL
+);
+CREATE TABLE t2 (
+ aid int NOT NULL,
+ pid int NOT NULL
+);
+INSERT INTO t1 VALUES(1,'a','b'), (2,'c','d');
+INSERT INTO t2 values (1,1), (2,1), (2,2);
+
+CREATE VIEW v1 AS SELECT t1.*,t2.pid FROM t1,t2 WHERE t1.aid = t2.aid;
+
+SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM t1,t2
+ WHERE t1.aid = t2.aid GROUP BY pid;
+SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM v1 GROUP BY pid;
+
+DROP VIEW v1;
+DROP TABLE t1,t2;
diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test
index 314432af83e..f6ae7cdaf30 100644
--- a/mysql-test/t/warnings.test
+++ b/mysql-test/t/warnings.test
@@ -151,3 +151,5 @@ select * from t1 limit 0;
select * from t1 limit 1, 0;
select * from t1 limit 0, 0;
drop table t1;
+
+# End of 4.1 tests