summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2007-06-14 18:17:26 -0400
committerunknown <cmiller@zippy.cornsilk.net>2007-06-14 18:17:26 -0400
commit578b81bb5b72e7b01b4091ba3e5770a198f8b482 (patch)
tree72e7c1a8261bde33ec6c4ca60f1474482de94771
parent4a009817ab562e3bc20edf496a6d0fda62ac3c1d (diff)
parentda4e864c7c3ea0906569af6d367a6d226c373cee (diff)
downloadmariadb-git-578b81bb5b72e7b01b4091ba3e5770a198f8b482.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint configure.in: Auto merged sql/mysqld.cc: Auto merged
-rw-r--r--.bzrignore1
-rw-r--r--BUILD/Makefile.am2
-rw-r--r--BUILD/compile-amd64-max-sci8
-rw-r--r--BUILD/compile-pentium64-max-sci9
-rwxr-xr-xBitKeeper/triggers/pre-outgoing.crash-protect.pl82
-rwxr-xr-xBitKeeper/triggers/pre-resolve.crash-protect.pl82
-rwxr-xr-xCMakeLists.txt8
-rw-r--r--Makefile.am2
-rw-r--r--client/Makefile.am14
-rw-r--r--client/mysqldump.c74
-rw-r--r--client/mysqltest.c262
-rw-r--r--cmd-line-utils/libedit/el_term.h10
-rw-r--r--config/ac-macros/ha_ndbcluster.m42
-rw-r--r--configure.in35
-rw-r--r--heap/hp_hash.c25
-rw-r--r--include/decimal.h1
-rw-r--r--include/m_string.h3
-rw-r--r--include/my_global.h11
-rw-r--r--include/my_sys.h2
-rw-r--r--include/my_time.h1
-rw-r--r--include/mysql_com.h5
-rw-r--r--include/thr_lock.h5
-rw-r--r--include/violite.h1
-rwxr-xr-xlibmysql/CMakeLists.txt4
-rw-r--r--libmysql/libmysql.c6
-rw-r--r--libmysqld/Makefile.am8
-rw-r--r--libmysqld/examples/Makefile.am3
-rw-r--r--myisam/mi_check.c13
-rw-r--r--myisam/sort.c3
-rw-r--r--mysql-test/include/have_log_bin.inc4
-rw-r--r--mysql-test/include/is_debug_build.inc4
-rw-r--r--mysql-test/include/master-slave.inc3
-rw-r--r--mysql-test/include/show_binlog_events.inc4
-rw-r--r--mysql-test/include/uses_vardir.inc14
-rw-r--r--mysql-test/lib/mtr_cases.pl20
-rwxr-xr-xmysql-test/mysql-test-run.pl47
-rw-r--r--mysql-test/ndb/ndb_config_1_node.ini4
-rw-r--r--mysql-test/ndb/ndb_config_2_node.ini4
-rw-r--r--mysql-test/ndb/ndb_config_4_node.ini4
-rw-r--r--mysql-test/r/alter_table.result19
-rw-r--r--mysql-test/r/analyse.result24
-rw-r--r--mysql-test/r/auto_increment.result4
-rw-r--r--mysql-test/r/bigint.result10
-rw-r--r--mysql-test/r/binlog.result4
-rw-r--r--mysql-test/r/binlog_killed.result12
-rw-r--r--mysql-test/r/blackhole.result4
-rw-r--r--mysql-test/r/cast.result14
-rw-r--r--mysql-test/r/create.result96
-rw-r--r--mysql-test/r/ctype_cp932_binlog.result15
-rw-r--r--mysql-test/r/ctype_cp932_notembedded.result17
-rw-r--r--mysql-test/r/ctype_ucs2_def.result8
-rw-r--r--mysql-test/r/date_formats.result18
-rw-r--r--mysql-test/r/func_date_add.result11
-rw-r--r--mysql-test/r/func_gconcat.result73
-rw-r--r--mysql-test/r/func_group.result47
-rw-r--r--mysql-test/r/func_in.result28
-rw-r--r--mysql-test/r/func_sapdb.result6
-rw-r--r--mysql-test/r/grant.result19
-rw-r--r--mysql-test/r/grant2.result24
-rw-r--r--mysql-test/r/have_log_bin.require2
-rw-r--r--mysql-test/r/heap_hash.result16
-rw-r--r--mysql-test/r/innodb_mysql.result81
-rw-r--r--mysql-test/r/insert.result118
-rw-r--r--mysql-test/r/insert_select.result4
-rw-r--r--mysql-test/r/insert_update.result57
-rw-r--r--mysql-test/r/join.result50
-rw-r--r--mysql-test/r/join_outer.result40
-rw-r--r--mysql-test/r/key.result12
-rw-r--r--mysql-test/r/kill.result84
-rw-r--r--mysql-test/r/limit.result11
-rw-r--r--mysql-test/r/loaddata.result19
-rw-r--r--mysql-test/r/long_tmpdir.result3
-rw-r--r--mysql-test/r/metadata.result11
-rw-r--r--mysql-test/r/mix_innodb_myisam_binlog.result30
-rw-r--r--mysql-test/r/myisam.result26
-rw-r--r--mysql-test/r/mysql_upgrade.result19
-rw-r--r--mysql-test/r/mysqldump.result19
-rw-r--r--mysql-test/r/mysqltest.result134
-rw-r--r--mysql-test/r/ndb_basic.result6
-rw-r--r--mysql-test/r/ndb_insert.result8
-rw-r--r--mysql-test/r/null.result18
-rw-r--r--mysql-test/r/null_key.result2
-rw-r--r--mysql-test/r/olap.result4
-rw-r--r--mysql-test/r/outfile.resultbin1382 -> 2135 bytes
-rw-r--r--mysql-test/r/ps.result37
-rw-r--r--mysql-test/r/ps_1general.result6
-rw-r--r--mysql-test/r/ps_2myisam.result41
-rw-r--r--mysql-test/r/ps_3innodb.result41
-rw-r--r--mysql-test/r/ps_4heap.result41
-rw-r--r--mysql-test/r/ps_5merge.result82
-rw-r--r--mysql-test/r/ps_6bdb.result41
-rw-r--r--mysql-test/r/ps_7ndb.result41
-rw-r--r--mysql-test/r/query_cache.result101
-rw-r--r--mysql-test/r/rpl_loaddata.result4
-rw-r--r--mysql-test/r/rpl_rotate_logs.result5
-rw-r--r--mysql-test/r/rpl_user_variables.result40
-rw-r--r--mysql-test/r/rpl_view.result6
-rw-r--r--mysql-test/r/sp-code.result113
-rw-r--r--mysql-test/r/sp-error.result6
-rw-r--r--mysql-test/r/sp-prelocking.result13
-rw-r--r--mysql-test/r/sp-vars.result45
-rw-r--r--mysql-test/r/sp.result31
-rw-r--r--mysql-test/r/sp_trans.result21
-rw-r--r--mysql-test/r/sp_trans_log.result20
-rw-r--r--mysql-test/r/strict.result22
-rw-r--r--mysql-test/r/subselect.result47
-rw-r--r--mysql-test/r/subselect3.result49
-rw-r--r--mysql-test/r/trigger.result63
-rw-r--r--mysql-test/r/type_date.result26
-rw-r--r--mysql-test/r/type_datetime.result147
-rw-r--r--mysql-test/r/type_enum.result7
-rw-r--r--mysql-test/r/type_float.result33
-rw-r--r--mysql-test/r/type_newdecimal.result41
-rw-r--r--mysql-test/r/user_var.result36
-rw-r--r--mysql-test/r/view.result107
-rw-r--r--mysql-test/r/view_grant.result4
-rw-r--r--mysql-test/r/warnings.result6
-rw-r--r--mysql-test/suite/funcs_1/datadict/datadict_load.inc3
-rw-r--r--mysql-test/suite/funcs_1/datadict/datadict_master.inc61
-rw-r--r--mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc2
-rw-r--r--mysql-test/suite/funcs_1/r/a_version_check.result11
-rw-r--r--mysql-test/suite/funcs_1/r/innodb__datadict.result1609
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_func_view.result12
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_08.result5
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_views.result27
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_views.warnings2
-rw-r--r--mysql-test/suite/funcs_1/r/memory__datadict.result1609
-rw-r--r--mysql-test/suite/funcs_1/r/memory_func_view.result12
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_08.result5
-rw-r--r--mysql-test/suite/funcs_1/r/memory_views.result27
-rw-r--r--mysql-test/suite/funcs_1/r/memory_views.warnings2
-rw-r--r--mysql-test/suite/funcs_1/r/myisam__datadict.result1609
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_func_view.result12
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_08.result5
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_views.result27
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_views.warnings2
-rwxr-xr-xmysql-test/suite/funcs_1/t/a_version_check.test29
-rw-r--r--mysql-test/suite/funcs_1/t/disabled.def6
-rw-r--r--mysql-test/suite/funcs_1/views/views_master.inc8
-rw-r--r--mysql-test/t/alter_table.test22
-rw-r--r--mysql-test/t/backup.test5
-rw-r--r--mysql-test/t/bigint.test6
-rw-r--r--mysql-test/t/binlog.test5
-rw-r--r--mysql-test/t/binlog_killed.test248
-rw-r--r--mysql-test/t/blackhole.test20
-rw-r--r--mysql-test/t/cast.test14
-rw-r--r--mysql-test/t/create.test111
-rw-r--r--mysql-test/t/ctype_cp932_binlog.test3
-rw-r--r--mysql-test/t/ctype_cp932_notembedded.test32
-rw-r--r--mysql-test/t/ctype_ucs2_def.test16
-rw-r--r--mysql-test/t/ctype_ucs_binlog.test1
-rw-r--r--mysql-test/t/date_formats.test2
-rw-r--r--mysql-test/t/disabled.def6
-rw-r--r--mysql-test/t/drop_temp_table.test4
-rw-r--r--mysql-test/t/flush_block_commit_notembedded.test2
-rw-r--r--mysql-test/t/func_date_add.test10
-rw-r--r--mysql-test/t/func_gconcat.test44
-rw-r--r--mysql-test/t/func_group.test34
-rw-r--r--mysql-test/t/func_in.test31
-rw-r--r--mysql-test/t/func_sapdb.test2
-rw-r--r--mysql-test/t/grant.test27
-rw-r--r--mysql-test/t/grant2.test44
-rw-r--r--mysql-test/t/heap_hash.test25
-rw-r--r--mysql-test/t/innodb.test1
-rw-r--r--mysql-test/t/innodb_mysql.test87
-rw-r--r--mysql-test/t/insert.test139
-rw-r--r--mysql-test/t/insert_select-binlog.test1
-rw-r--r--mysql-test/t/insert_update.test43
-rw-r--r--mysql-test/t/join.test24
-rw-r--r--mysql-test/t/join_outer.test36
-rw-r--r--mysql-test/t/key.test12
-rw-r--r--mysql-test/t/kill.test185
-rw-r--r--mysql-test/t/limit.test17
-rw-r--r--mysql-test/t/loaddata.test26
-rw-r--r--mysql-test/t/long_tmpdir-master.opt1
-rw-r--r--mysql-test/t/long_tmpdir-master.sh3
-rw-r--r--mysql-test/t/long_tmpdir.test9
-rw-r--r--mysql-test/t/metadata.test11
-rw-r--r--mysql-test/t/mix_innodb_myisam_binlog.test54
-rw-r--r--mysql-test/t/myisam.test16
-rw-r--r--mysql-test/t/mysql.test2
-rw-r--r--mysql-test/t/mysql_upgrade.test13
-rw-r--r--mysql-test/t/mysqlbinlog-cp932.test1
-rw-r--r--mysql-test/t/mysqlbinlog.test3
-rw-r--r--mysql-test/t/mysqlbinlog2.test3
-rw-r--r--mysql-test/t/mysqldump.test8
-rw-r--r--mysql-test/t/mysqltest.test264
-rw-r--r--mysql-test/t/ndb_basic.test15
-rw-r--r--mysql-test/t/ndb_insert.test9
-rw-r--r--mysql-test/t/order_by.test4
-rw-r--r--mysql-test/t/outfile.test47
-rw-r--r--mysql-test/t/ps.test32
-rw-r--r--mysql-test/t/ps_1general.test6
-rw-r--r--mysql-test/t/query_cache.test96
-rw-r--r--mysql-test/t/row.test2
-rw-r--r--mysql-test/t/rpl000015.test2
-rw-r--r--mysql-test/t/rpl000017.test2
-rw-r--r--mysql-test/t/rpl_loaddata.test10
-rw-r--r--mysql-test/t/rpl_packet.test2
-rw-r--r--mysql-test/t/rpl_rotate_logs.test17
-rw-r--r--mysql-test/t/rpl_user_variables.test45
-rw-r--r--mysql-test/t/rpl_view.test12
-rw-r--r--mysql-test/t/sp-code.test77
-rw-r--r--mysql-test/t/sp-error.test6
-rw-r--r--mysql-test/t/sp-prelocking.test31
-rw-r--r--mysql-test/t/sp-vars.test44
-rw-r--r--mysql-test/t/sp.test33
-rw-r--r--mysql-test/t/sp_trans.test31
-rw-r--r--mysql-test/t/sp_trans_log.test33
-rw-r--r--mysql-test/t/strict.test12
-rw-r--r--mysql-test/t/subselect.test46
-rw-r--r--mysql-test/t/subselect3.test47
-rw-r--r--mysql-test/t/trigger.test85
-rw-r--r--mysql-test/t/type_date.test13
-rw-r--r--mysql-test/t/type_datetime.test93
-rw-r--r--mysql-test/t/type_enum.test8
-rw-r--r--mysql-test/t/type_float.test20
-rw-r--r--mysql-test/t/type_newdecimal.test32
-rw-r--r--mysql-test/t/user_var-binlog.test3
-rw-r--r--mysql-test/t/user_var.test15
-rw-r--r--mysql-test/t/view.test99
-rw-r--r--mysys/my_init.c36
-rw-r--r--mysys/my_seek.c17
-rw-r--r--mysys/my_thr_init.c36
-rw-r--r--ndb/include/mgmapi/ndbd_exit_codes.h2
-rw-r--r--ndb/include/ndbapi/NdbRecAttr.hpp28
-rw-r--r--ndb/src/common/transporter/Packer.cpp5
-rw-r--r--ndb/src/common/transporter/SCI_Transporter.cpp216
-rw-r--r--ndb/src/common/transporter/SCI_Transporter.hpp18
-rw-r--r--ndb/src/common/transporter/TCP_Transporter.hpp4
-rw-r--r--ndb/src/common/transporter/TransporterRegistry.cpp74
-rw-r--r--ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp17
-rw-r--r--ndb/src/kernel/blocks/dbdict/Dbdict.cpp42
-rw-r--r--ndb/src/kernel/blocks/dblqh/Dblqh.hpp3
-rw-r--r--ndb/src/kernel/blocks/dblqh/DblqhMain.cpp28
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp6
-rw-r--r--ndb/src/kernel/blocks/qmgr/QmgrMain.cpp2
-rw-r--r--ndb/src/kernel/error/TimeModule.cpp2
-rw-r--r--ndb/src/kernel/error/ndbd_exit_codes.c3
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.cpp10
-rw-r--r--ndb/src/ndbapi/ClusterMgr.cpp13
-rw-r--r--ndb/src/ndbapi/ClusterMgr.hpp2
-rw-r--r--ndb/src/ndbapi/NdbRecAttr.cpp6
-rw-r--r--ndb/test/ndbapi/testNdbApi.cpp34
-rw-r--r--ndb/test/run-test/daily-basic-tests.txt4
-rw-r--r--netware/Makefile.am6
-rw-r--r--scripts/Makefile.am16
-rw-r--r--scripts/make_binary_distribution.sh72
-rwxr-xr-xscripts/make_win_bin_dist34
-rw-r--r--scripts/mysql_system_tables_fix.sql1
-rw-r--r--server-tools/instance-manager/mysql_connection.cc4
-rw-r--r--sql-common/client.c12
-rw-r--r--sql-common/my_time.c35
-rwxr-xr-xsql/CMakeLists.txt2
-rw-r--r--sql/field.cc280
-rw-r--r--sql/field.h58
-rw-r--r--sql/field_conv.cc17
-rw-r--r--sql/filesort.cc21
-rw-r--r--sql/ha_blackhole.h3
-rw-r--r--sql/ha_ndbcluster.cc128
-rw-r--r--sql/ha_ndbcluster.h1
-rw-r--r--sql/handler.cc7
-rw-r--r--sql/handler.h1
-rw-r--r--sql/init.cc13
-rw-r--r--sql/item.cc88
-rw-r--r--sql/item.h38
-rw-r--r--sql/item_cmpfunc.cc291
-rw-r--r--sql/item_cmpfunc.h102
-rw-r--r--sql/item_create.cc17
-rw-r--r--sql/item_create.h3
-rw-r--r--sql/item_func.cc200
-rw-r--r--sql/item_func.h29
-rw-r--r--sql/item_subselect.cc102
-rw-r--r--sql/item_sum.cc23
-rw-r--r--sql/item_timefunc.cc240
-rw-r--r--sql/item_timefunc.h48
-rw-r--r--sql/lock.cc33
-rw-r--r--sql/log_event.cc38
-rw-r--r--sql/log_event.h3
-rw-r--r--sql/my_decimal.cc2
-rw-r--r--sql/my_decimal.h32
-rw-r--r--sql/mysql_priv.h70
-rw-r--r--sql/mysqld.cc27
-rw-r--r--sql/net_serv.cc22
-rw-r--r--sql/opt_sum.cc86
-rw-r--r--sql/protocol.cc12
-rw-r--r--sql/protocol.h18
-rw-r--r--sql/set_var.cc19
-rw-r--r--sql/slave.cc3
-rw-r--r--sql/sp.cc11
-rw-r--r--sql/sp_head.cc60
-rw-r--r--sql/sp_head.h12
-rw-r--r--sql/sql_acl.cc24
-rw-r--r--sql/sql_base.cc455
-rw-r--r--sql/sql_cache.cc18
-rw-r--r--sql/sql_class.cc2
-rw-r--r--sql/sql_class.h37
-rw-r--r--sql/sql_client.cc7
-rw-r--r--sql/sql_handler.cc25
-rw-r--r--sql/sql_insert.cc643
-rw-r--r--sql/sql_lex.cc335
-rw-r--r--sql/sql_lex.h91
-rw-r--r--sql/sql_load.cc10
-rw-r--r--sql/sql_parse.cc178
-rw-r--r--sql/sql_prepare.cc70
-rw-r--r--sql/sql_repl.cc4
-rw-r--r--sql/sql_select.cc260
-rw-r--r--sql/sql_select.h8
-rw-r--r--sql/sql_show.cc4
-rw-r--r--sql/sql_table.cc251
-rw-r--r--sql/sql_trigger.cc10
-rw-r--r--sql/sql_union.cc10
-rw-r--r--sql/sql_update.cc178
-rw-r--r--sql/sql_view.cc143
-rw-r--r--sql/sql_yacc.yy252
-rw-r--r--sql/structs.h3
-rw-r--r--sql/table.cc79
-rw-r--r--sql/table.h65
-rw-r--r--sql/time.cc38
-rw-r--r--sql/tztime.cc88
-rw-r--r--sql/tztime.h10
-rw-r--r--sql/udf_example.c3
-rw-r--r--sql/unireg.cc4
-rw-r--r--strings/ctype-bin.c25
-rw-r--r--strings/ctype-mb.c7
-rw-r--r--strings/ctype-ucs2.c5
-rw-r--r--strings/decimal.c17
-rw-r--r--strings/strtod.c57
-rw-r--r--support-files/mysql.spec.sh2
-rw-r--r--tests/mysql_client_test.c64
-rw-r--r--vio/vio_priv.h1
-rw-r--r--vio/viosocket.c42
-rwxr-xr-xwin/Makefile.am2
-rwxr-xr-xwin/create_manifest.js7
334 files changed, 12373 insertions, 5236 deletions
diff --git a/.bzrignore b/.bzrignore
index d1de21857db..8c632f8f890 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -708,7 +708,6 @@ mysql-test/r/*.err
mysql-test/r/*.log
mysql-test/r/*.out
mysql-test/r/*.reject
-mysql-test/r/*.warnings
mysql-test/r/alter_table.err
mysql-test/r/archive.err
mysql-test/r/bdb-alter-table-1.err
diff --git a/BUILD/Makefile.am b/BUILD/Makefile.am
index 3fd61790903..d06106d4431 100644
--- a/BUILD/Makefile.am
+++ b/BUILD/Makefile.am
@@ -28,6 +28,7 @@ EXTRA_DIST = FINISH.sh \
compile-alpha-debug \
compile-amd64-debug-max \
compile-amd64-max \
+ compile-amd64-max-sci \
compile-darwin-mwcc \
compile-dist \
compile-hpux11-parisc2-aCC \
@@ -53,6 +54,7 @@ EXTRA_DIST = FINISH.sh \
compile-pentium-valgrind-max \
compile-pentium64-debug \
compile-pentium64-debug-max \
+ compile-pentium64-max-sci \
compile-pentium64-valgrind-max \
compile-ppc \
compile-ppc-debug \
diff --git a/BUILD/compile-amd64-max-sci b/BUILD/compile-amd64-max-sci
new file mode 100644
index 00000000000..4afa9004742
--- /dev/null
+++ b/BUILD/compile-amd64-max-sci
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+extra_flags="$amd64_cflags $fast_cflags -g"
+extra_configs="$amd64_configs $max_configs --with-ndb-sci=/opt/DIS"
+
+. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium64-max-sci b/BUILD/compile-pentium64-max-sci
new file mode 100644
index 00000000000..9ebb1988475
--- /dev/null
+++ b/BUILD/compile-pentium64-max-sci
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+
+extra_flags="$pentium64_cflags $fast_cflags -g"
+extra_configs="$pentium_configs $max_configs --with-ndb-sci=/opt/DIS"
+
+. "$path/FINISH.sh"
diff --git a/BitKeeper/triggers/pre-outgoing.crash-protect.pl b/BitKeeper/triggers/pre-outgoing.crash-protect.pl
new file mode 100755
index 00000000000..b83e356e3f8
--- /dev/null
+++ b/BitKeeper/triggers/pre-outgoing.crash-protect.pl
@@ -0,0 +1,82 @@
+#! /usr/bin/perl
+
+use strict;
+use warnings;
+
+my $event= $ENV{BK_EVENT};
+unless($event eq 'outgoing pull' || $event eq 'outgoing push' ||
+ $event eq 'resolve') {
+ exit 0;
+}
+
+my @bad_csets=
+ ( 'monty@mysql.com|ChangeSet|20060418090255|16983',
+ 'monty@mysql.com|ChangeSet|20060418090458|02628',
+ 'monty@mysql.com|ChangeSet|20060419084236|49576',
+ 'monty@mysql.com|ChangeSet|20060503164655|51444',
+ 'monty@mysql.com|ChangeSet|20060503225814|60133',
+ 'monty@mysql.com|ChangeSet|20060504033006|54878',
+ 'monty@mysql.com|ChangeSet|20060504130520|48660',
+ 'monty@mysql.com|ChangeSet|20060504164102|03511',
+ 'monty@mysql.com|ChangeSet|20060504193112|04109',
+ 'monty@mysql.com|ChangeSet|20060505015314|02799',
+ 'monty@mysql.com|ChangeSet|20060505084007|16704',
+ 'monty@mysql.com|ChangeSet|20060505104008|16695',
+ 'monty@mysql.com|ChangeSet|20060505171041|13924',
+ 'monty@mysql.com|ChangeSet|20060508121933|13866',
+ 'monty@mysql.com|ChangeSet|20060508160902|15029',
+ 'monty@mysql.com|ChangeSet|20060509145448|38636',
+ 'monty@mysql.com|ChangeSet|20060509224111|40037',
+ 'monty@mysql.com|ChangeSet|20060510090758|40678',
+ 'monty@mysql.com|ChangeSet|20060515164104|46760',
+ 'monty@mysql.com|ChangeSet|20060530114549|35852',
+ 'monty@mysql.com|ChangeSet|20060605032828|23579',
+ 'monty@mysql.com|ChangeSet|20060605033011|10641',
+ 'monty@mysql.com|ChangeSet|20060605060652|09843',
+ 'msvensson@neptunus.(none)|ChangeSet|20060605094744|10838',
+ 'msvensson@neptunus.(none)|ChangeSet|20060605105746|11800',
+ 'msvensson@neptunus.(none)|ChangeSet|20060605122345|12772',
+ 'jmiller@mysql.com|ChangeSet|20060531210831|36442',
+ 'jmiller@mysql.com|ChangeSet|20060602151941|36118',
+ 'jmiller@mysql.com|ChangeSet|20060602152136|27762',
+ 'jmiller@mysql.com|ChangeSet|20060605121748|12864',
+ 'jmiller@mysql.com|ChangeSet|20060605160304|14798',
+ 'jimw@mysql.com|ChangeSet|20060605210201|14667',
+ 'igor@rurik.mysql.com|ChangeSet|20060605220727|15265',
+ 'igor@rurik.mysql.com|ChangeSet|20060605221206|15134',
+ 'stewart@mysql.com|ChangeSet|20060525073521|11169',
+ 'stewart@mysql.com|ChangeSet|20060605154220|12975',
+ 'stewart@mysql.com|ChangeSet|20060606040001|15337',
+ 'hartmut@mysql.com/linux.site|ChangeSet|20070413121444|50289'
+ );
+
+# Read the list of changesets.
+my $csetlist = $ENV{BK_CSETLIST};
+if(!defined($csetlist) || !open(FH, '<', $csetlist)) {
+ die "Failed to open list of incoming changesets '$csetlist': $!.\n";
+}
+my @csets = <FH>;
+close FH;
+
+# Reject any attempt to push/pull a bad changeset.
+for my $cs (@csets) {
+ # Do this the raw way, don't want to be bitten by different EOL conventions
+ # on server and client (Unix/Windows/Mac).
+ $cs =~ s/\x0d?\x0a?$//s;
+ if(grep($_ eq $cs, @bad_csets)) {
+ print <<END;
+BAD CHANGESET DETECTED! $event REJECTED!
+
+The changeset with key '$cs' was detected in the attempted push or pull.
+This changeset is from the corrupt part of the crashed mysql-5.1-new tree.
+Pushing or pulling this changeset would result in corruption of the new tree,
+and therefore the operation has been rejected.
+
+Contact Kristian Nielsen (knielsen\@mysql.com, IRC knielsen) if you have any
+questions regarding this.
+END
+ exit 1;
+ }
+}
+
+exit 0;
diff --git a/BitKeeper/triggers/pre-resolve.crash-protect.pl b/BitKeeper/triggers/pre-resolve.crash-protect.pl
new file mode 100755
index 00000000000..b83e356e3f8
--- /dev/null
+++ b/BitKeeper/triggers/pre-resolve.crash-protect.pl
@@ -0,0 +1,82 @@
+#! /usr/bin/perl
+
+use strict;
+use warnings;
+
+my $event= $ENV{BK_EVENT};
+unless($event eq 'outgoing pull' || $event eq 'outgoing push' ||
+ $event eq 'resolve') {
+ exit 0;
+}
+
+my @bad_csets=
+ ( 'monty@mysql.com|ChangeSet|20060418090255|16983',
+ 'monty@mysql.com|ChangeSet|20060418090458|02628',
+ 'monty@mysql.com|ChangeSet|20060419084236|49576',
+ 'monty@mysql.com|ChangeSet|20060503164655|51444',
+ 'monty@mysql.com|ChangeSet|20060503225814|60133',
+ 'monty@mysql.com|ChangeSet|20060504033006|54878',
+ 'monty@mysql.com|ChangeSet|20060504130520|48660',
+ 'monty@mysql.com|ChangeSet|20060504164102|03511',
+ 'monty@mysql.com|ChangeSet|20060504193112|04109',
+ 'monty@mysql.com|ChangeSet|20060505015314|02799',
+ 'monty@mysql.com|ChangeSet|20060505084007|16704',
+ 'monty@mysql.com|ChangeSet|20060505104008|16695',
+ 'monty@mysql.com|ChangeSet|20060505171041|13924',
+ 'monty@mysql.com|ChangeSet|20060508121933|13866',
+ 'monty@mysql.com|ChangeSet|20060508160902|15029',
+ 'monty@mysql.com|ChangeSet|20060509145448|38636',
+ 'monty@mysql.com|ChangeSet|20060509224111|40037',
+ 'monty@mysql.com|ChangeSet|20060510090758|40678',
+ 'monty@mysql.com|ChangeSet|20060515164104|46760',
+ 'monty@mysql.com|ChangeSet|20060530114549|35852',
+ 'monty@mysql.com|ChangeSet|20060605032828|23579',
+ 'monty@mysql.com|ChangeSet|20060605033011|10641',
+ 'monty@mysql.com|ChangeSet|20060605060652|09843',
+ 'msvensson@neptunus.(none)|ChangeSet|20060605094744|10838',
+ 'msvensson@neptunus.(none)|ChangeSet|20060605105746|11800',
+ 'msvensson@neptunus.(none)|ChangeSet|20060605122345|12772',
+ 'jmiller@mysql.com|ChangeSet|20060531210831|36442',
+ 'jmiller@mysql.com|ChangeSet|20060602151941|36118',
+ 'jmiller@mysql.com|ChangeSet|20060602152136|27762',
+ 'jmiller@mysql.com|ChangeSet|20060605121748|12864',
+ 'jmiller@mysql.com|ChangeSet|20060605160304|14798',
+ 'jimw@mysql.com|ChangeSet|20060605210201|14667',
+ 'igor@rurik.mysql.com|ChangeSet|20060605220727|15265',
+ 'igor@rurik.mysql.com|ChangeSet|20060605221206|15134',
+ 'stewart@mysql.com|ChangeSet|20060525073521|11169',
+ 'stewart@mysql.com|ChangeSet|20060605154220|12975',
+ 'stewart@mysql.com|ChangeSet|20060606040001|15337',
+ 'hartmut@mysql.com/linux.site|ChangeSet|20070413121444|50289'
+ );
+
+# Read the list of changesets.
+my $csetlist = $ENV{BK_CSETLIST};
+if(!defined($csetlist) || !open(FH, '<', $csetlist)) {
+ die "Failed to open list of incoming changesets '$csetlist': $!.\n";
+}
+my @csets = <FH>;
+close FH;
+
+# Reject any attempt to push/pull a bad changeset.
+for my $cs (@csets) {
+ # Do this the raw way, don't want to be bitten by different EOL conventions
+ # on server and client (Unix/Windows/Mac).
+ $cs =~ s/\x0d?\x0a?$//s;
+ if(grep($_ eq $cs, @bad_csets)) {
+ print <<END;
+BAD CHANGESET DETECTED! $event REJECTED!
+
+The changeset with key '$cs' was detected in the attempted push or pull.
+This changeset is from the corrupt part of the crashed mysql-5.1-new tree.
+Pushing or pulling this changeset would result in corruption of the new tree,
+and therefore the operation has been rejected.
+
+Contact Kristian Nielsen (knielsen\@mysql.com, IRC knielsen) if you have any
+questions regarding this.
+END
+ exit 1;
+ }
+}
+
+exit 0;
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 68238ea157c..54df0befad9 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -120,6 +120,9 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG
${CMAKE_CXX_FLAGS_DEBUG})
+ # generate map files
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MAP /MAPINFO:EXPORTS")
+
# remove support for Exception handling
STRING(REPLACE "/GX" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
@@ -151,6 +154,11 @@ IF(EMBED_MANIFESTS)
# Disable automatic manifest generation.
STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
${CMAKE_EXE_LINKER_FLAGS})
+ # Explicitly disable it since it is the default for newer versions of VS
+ STRING(REGEX MATCH "MANIFEST:NO" tmp_manifest ${CMAKE_EXE_LINKER_FLAGS})
+ IF(NOT tmp_manifest)
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
+ ENDIF(NOT tmp_manifest)
# Set the processor architecture.
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
SET(PROCESSOR_ARCH "X64")
diff --git a/Makefile.am b/Makefile.am
index 992a6f6d755..6cb080aed5a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -157,6 +157,8 @@ test-bt:
@PERL@ ./mysql-test-run.pl --force --comment=funcs1_ps --ps-protocol --suite=funcs_1
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2
+ -cd mysql-test ; MTR_BUILD_THREAD=auto \
+ @PERL@ ./mysql-test-run.pl --force --comment=rowlock --suite=row_lock
test-bt-debug:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
diff --git a/client/Makefile.am b/client/Makefile.am
index 5f1569ba2c4..c7663c7da82 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -64,13 +64,13 @@ link_sources:
for f in $(sql_src) ; do \
rm -f $$f; \
@LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
- done; \
- for f in $(strings_src) ; do \
- rm -f $(srcdir)/$$f; \
- @LN_CP_F@ $(top_srcdir)/strings/$$f $$f; \
- done; \
- rm -f $(srcdir)/my_user.c; \
- @LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c;
+ done; \
+ for f in $(strings_src) ; do \
+ rm -f $(srcdir)/$$f; \
+ @LN_CP_F@ $(top_srcdir)/strings/$$f $$f; \
+ done; \
+ rm -f $(srcdir)/my_user.c; \
+ @LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c;
# Don't update the files from bitkeeper
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 4f908b531b1..fc461a5f559 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1456,6 +1456,9 @@ static uint dump_routines_for_db(char *db)
if (lock_tables)
mysql_query(mysql, "LOCK TABLES mysql.proc READ");
+ if (opt_compact)
+ fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n");
+
fprintf(sql_file, "DELIMITER ;;\n");
/* 0, retrieve and dump functions, 1, procedures */
@@ -2106,8 +2109,11 @@ static void dump_triggers_for_table(char *table,
DBUG_VOID_RETURN;
}
if (mysql_num_rows(result))
- fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n\
-DELIMITER ;;\n");
+ {
+ if (opt_compact)
+ fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n");
+ fprintf(sql_file, "\nDELIMITER ;;\n");
+ }
while ((row= mysql_fetch_row(result)))
{
fprintf(sql_file,
@@ -2529,15 +2535,18 @@ static void dump_table(char *table, char *db)
plus 2 bytes for '0x' prefix.
- In non-HEX mode we need up to 2 bytes per character,
plus 2 bytes for leading and trailing '\'' characters.
+ Also we need to reserve 1 byte for terminating '\0'.
*/
- dynstr_realloc_checked(&extended_row,length * 2+2);
+ dynstr_realloc_checked(&extended_row,length * 2 + 2 + 1);
if (opt_hex_blob && is_blob)
{
dynstr_append_checked(&extended_row, "0x");
extended_row.length+= mysql_hex_string(extended_row.str +
extended_row.length,
row[i], length);
- extended_row.str[extended_row.length]= '\0';
+ DBUG_ASSERT(extended_row.length+1 <= extended_row.max_length);
+ /* mysql_hex_string() already terminated string by '\0' */
+ DBUG_ASSERT(extended_row.str[extended_row.length] == '\0');
}
else
{
@@ -3262,10 +3271,41 @@ static int do_unlock_tables(MYSQL *mysql_con)
return mysql_query_with_error_report(mysql_con, 0, "UNLOCK TABLES");
}
+static int get_bin_log_name(MYSQL *mysql_con,
+ char* buff_log_name, uint buff_len)
+{
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+
+ if (mysql_query(mysql_con, "SHOW MASTER STATUS") ||
+ !(res= mysql_store_result(mysql)))
+ return 1;
-static int do_reset_master(MYSQL *mysql_con)
+ if (!(row= mysql_fetch_row(res)))
+ {
+ mysql_free_result(res);
+ return 1;
+ }
+ /*
+ Only one row is returned, and the first column is the name of the
+ active log.
+ */
+ strmake(buff_log_name, row[0], buff_len - 1);
+
+ mysql_free_result(res);
+ return 0;
+}
+
+static int purge_bin_logs_to(MYSQL *mysql_con, char* log_name)
{
- return mysql_query_with_error_report(mysql_con, 0, "RESET MASTER");
+ DYNAMIC_STRING str;
+ int err;
+ init_dynamic_string_checked(&str, "PURGE BINARY LOGS TO '", 1024, 1024);
+ dynstr_append_checked(&str, log_name);
+ dynstr_append_checked(&str, "'");
+ err = mysql_query_with_error_report(mysql_con, 0, str.str);
+ dynstr_free(&str);
+ return err;
}
@@ -3789,6 +3829,7 @@ static void dynstr_realloc_checked(DYNAMIC_STRING *str, ulong additional_size)
int main(int argc, char **argv)
{
+ char bin_log_name[FN_REFLEN];
int exit_code;
MY_INIT("mysqldump");
@@ -3825,8 +3866,13 @@ int main(int argc, char **argv)
goto err;
if (opt_single_transaction && start_transaction(mysql))
goto err;
- if (opt_delete_master_logs && do_reset_master(mysql))
- goto err;
+ if (opt_delete_master_logs)
+ {
+ if (mysql_refresh(mysql, REFRESH_LOG) ||
+ get_bin_log_name(mysql, bin_log_name, sizeof(bin_log_name)))
+ goto err;
+ flush_logs= 0;
+ }
if (opt_lock_all_tables || opt_master_data)
{
if (flush_logs && mysql_refresh(mysql, REFRESH_LOG))
@@ -3850,6 +3896,18 @@ int main(int argc, char **argv)
/* One or more databases, all tables */
dump_databases(argv);
}
+
+ /* ensure dumped data flushed */
+ if (md_result_file && fflush(md_result_file))
+ {
+ if (!first_error)
+ first_error= EX_MYSQLERR;
+ goto err;
+ }
+ /* everything successful, purge the old logs files */
+ if (opt_delete_master_logs && purge_bin_logs_to(mysql, bin_log_name))
+ goto err;
+
#ifdef HAVE_SMEM
my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
#endif
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 6f6412e1f02..2d9ee74891c 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -271,7 +271,7 @@ enum enum_commands {
Q_EXEC, Q_DELIMITER,
Q_DISABLE_ABORT_ON_ERROR, Q_ENABLE_ABORT_ON_ERROR,
Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS,
- Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_QUERY_SORTED,
+ Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_SORTED_RESULT,
Q_START_TIMER, Q_END_TIMER,
Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL,
Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT,
@@ -341,7 +341,7 @@ const char *command_names[]=
"horizontal_results",
"query_vertical",
"query_horizontal",
- "query_sorted",
+ "sorted_result",
"start_timer",
"end_timer",
"character_set",
@@ -1143,6 +1143,50 @@ void check_require(DYNAMIC_STRING* ds, const char *fname)
}
+/*
+ Remove surrounding chars from string
+
+ Return 1 if first character is found but not last
+*/
+static int strip_surrounding(char* str, char c1, char c2)
+{
+ char* ptr= str;
+
+ /* Check if the first non space character is c1 */
+ while(*ptr && my_isspace(charset_info, *ptr))
+ ptr++;
+ if (*ptr == c1)
+ {
+ /* Replace it with a space */
+ *ptr= ' ';
+
+ /* Last non space charecter should be c2 */
+ ptr= strend(str)-1;
+ while(*ptr && my_isspace(charset_info, *ptr))
+ ptr--;
+ if (*ptr == c2)
+ {
+ /* Replace it with \0 */
+ *ptr= 0;
+ }
+ else
+ {
+ /* Mismatch detected */
+ return 1;
+ }
+ }
+ return 0;
+}
+
+
+static void strip_parentheses(struct st_command *command)
+{
+ if (strip_surrounding(command->first_argument, '(', ')'))
+ die("%.*s - argument list started with '%c' must be ended with '%c'",
+ command->first_word_len, command->query, '(', ')');
+}
+
+
static byte *get_var_key(const byte* var, uint* len,
my_bool __attribute__((unused)) t)
{
@@ -1398,12 +1442,11 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
init_dynamic_string(&ds_query, 0, (end - query) + 32, 256);
do_eval(&ds_query, query, end, FALSE);
- if (mysql_real_query(mysql, ds_query.str, ds_query.length) ||
- !(res = mysql_store_result(mysql)))
- {
+ if (mysql_real_query(mysql, ds_query.str, ds_query.length))
die("Error running query '%s': %d %s", ds_query.str,
mysql_errno(mysql), mysql_error(mysql));
- }
+ if (!(res= mysql_store_result(mysql)))
+ die("Query '%s' didn't return a result set", ds_query.str);
dynstr_free(&ds_query);
if ((row = mysql_fetch_row(res)) && row[0])
@@ -1457,6 +1500,130 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
}
+/*
+ Set variable from the result of a field in a query
+
+ This function is useful when checking for a certain value
+ in the output from a query that can't be restricted to only
+ return some values. A very good example of that is most SHOW
+ commands.
+
+ SYNOPSIS
+ var_set_query_get_value()
+
+ DESCRIPTION
+ let $variable= query_get_value(<query to run>,<column name>,<row no>);
+
+ <query to run> - The query that should be sent to the server
+ <column name> - Name of the column that holds the field be compared
+ against the expected value
+ <row no> - Number of the row that holds the field to be
+ compared against the expected value
+
+*/
+
+void var_set_query_get_value(struct st_command *command, VAR *var)
+{
+ ulong row_no;
+ int col_no= -1;
+ MYSQL_RES* res;
+ MYSQL* mysql= &cur_con->mysql;
+
+ static DYNAMIC_STRING ds_query;
+ static DYNAMIC_STRING ds_col;
+ static DYNAMIC_STRING ds_row;
+ const struct command_arg query_get_value_args[] = {
+ "query", ARG_STRING, TRUE, &ds_query, "Query to run",
+ "column name", ARG_STRING, TRUE, &ds_col, "Name of column",
+ "row number", ARG_STRING, TRUE, &ds_row, "Number for row",
+ };
+
+ DBUG_ENTER("var_set_query_get_value");
+ LINT_INIT(res);
+
+ strip_parentheses(command);
+ DBUG_PRINT("info", ("query: %s", command->query));
+ check_command_args(command, command->first_argument, query_get_value_args,
+ sizeof(query_get_value_args)/sizeof(struct command_arg),
+ ',');
+
+ DBUG_PRINT("info", ("query: %s", ds_query.str));
+ DBUG_PRINT("info", ("col: %s", ds_col.str));
+
+ /* Convert row number to int */
+ if (!str2int(ds_row.str, 10, (long) 0, (long) INT_MAX, &row_no))
+ die("Invalid row number: '%s'", ds_row.str);
+ DBUG_PRINT("info", ("row: %s, row_no: %ld", ds_row.str, row_no));
+ dynstr_free(&ds_row);
+
+ /* Remove any surrounding "'s from the query - if there is any */
+ if (strip_surrounding(ds_query.str, '"', '"'))
+ die("Mismatched \"'s around query '%s'", ds_query.str);
+
+ /* Run the query */
+ if (mysql_real_query(mysql, ds_query.str, ds_query.length))
+ die("Error running query '%s': %d %s", ds_query.str,
+ mysql_errno(mysql), mysql_error(mysql));
+ if (!(res= mysql_store_result(mysql)))
+ die("Query '%s' didn't return a result set", ds_query.str);
+
+ {
+ /* Find column number from the given column name */
+ uint i;
+ uint num_fields= mysql_num_fields(res);
+ MYSQL_FIELD *fields= mysql_fetch_fields(res);
+
+ for (i= 0; i < num_fields; i++)
+ {
+ if (strcmp(fields[i].name, ds_col.str) == 0 &&
+ strlen(fields[i].name) == ds_col.length)
+ {
+ col_no= i;
+ break;
+ }
+ }
+ if (col_no == -1)
+ {
+ mysql_free_result(res);
+ die("Could not find column '%s' in the result of '%s'",
+ ds_col.str, ds_query.str);
+ }
+ DBUG_PRINT("info", ("Found column %d with name '%s'",
+ i, fields[i].name));
+ }
+ dynstr_free(&ds_col);
+
+ {
+ /* Get the value */
+ MYSQL_ROW row;
+ ulong rows= 0;
+ const char* value= "No such row";
+
+ while ((row= mysql_fetch_row(res)))
+ {
+ if (++rows == row_no)
+ {
+
+ DBUG_PRINT("info", ("At row %ld, column %d is '%s'",
+ row_no, col_no, row[col_no]));
+ /* Found the row to get */
+ if (row[col_no])
+ value= row[col_no];
+ else
+ value= "NULL";
+
+ break;
+ }
+ }
+ eval_expr(var, value, 0);
+ }
+ dynstr_free(&ds_query);
+ mysql_free_result(res);
+
+ DBUG_VOID_RETURN;
+}
+
+
void var_copy(VAR *dest, VAR *src)
{
dest->int_val= src->int_val;
@@ -1480,26 +1647,47 @@ void var_copy(VAR *dest, VAR *src)
void eval_expr(VAR *v, const char *p, const char **p_end)
{
- static int MIN_VAR_ALLOC= 32; /* MASV why 32? */
- VAR *vp;
+
+ DBUG_ENTER("eval_expr");
+ DBUG_PRINT("enter", ("p: '%s'", p));
+
if (*p == '$')
{
+ VAR *vp;
if ((vp= var_get(p, p_end, 0, 0)))
- {
var_copy(v, vp);
- return;
- }
+ DBUG_VOID_RETURN;
}
- else if (*p == '`')
+
+ if (*p == '`')
{
var_query_set(v, p, p_end);
+ DBUG_VOID_RETURN;
}
- else
+
+ {
+ /* Check if this is a "let $var= query_get_value()" */
+ const char* get_value_str= "query_get_value";
+ const size_t len= strlen(get_value_str);
+ if (strncmp(p, get_value_str, len)==0)
+ {
+ struct st_command command;
+ memset(&command, 0, sizeof(command));
+ command.query= (char*)p;
+ command.first_word_len= len;
+ command.first_argument= command.query + len;
+ command.end= (char*)*p_end;
+ var_set_query_get_value(&command, v);
+ DBUG_VOID_RETURN;
+ }
+ }
+
{
int new_val_len = (p_end && *p_end) ?
(int) (*p_end - p) : (int) strlen(p);
if (new_val_len + 1 >= v->alloced_len)
{
+ static int MIN_VAR_ALLOC= 32;
v->alloced_len = (new_val_len < MIN_VAR_ALLOC - 1) ?
MIN_VAR_ALLOC : new_val_len + 1;
if (!(v->str_val =
@@ -1512,9 +1700,10 @@ void eval_expr(VAR *v, const char *p, const char **p_end)
memcpy(v->str_val, p, new_val_len);
v->str_val[new_val_len] = 0;
v->int_val=atoi(p);
+ DBUG_PRINT("info", ("atoi on '%s', returns: %d", p, v->int_val));
v->int_dirty=0;
}
- return;
+ DBUG_VOID_RETURN;
}
@@ -3453,7 +3642,6 @@ void do_connect(struct st_command *command)
int con_port= opt_port;
char *con_options;
bool con_ssl= 0, con_compress= 0;
- char *ptr;
static DYNAMIC_STRING ds_connection_name;
static DYNAMIC_STRING ds_host;
@@ -3481,20 +3669,7 @@ void do_connect(struct st_command *command)
DBUG_ENTER("do_connect");
DBUG_PRINT("enter",("connect: %s", command->first_argument));
- /* Remove parenteses around connect arguments */
- if ((ptr= strstr(command->first_argument, "(")))
- {
- /* Replace it with a space */
- *ptr= ' ';
- if ((ptr= strstr(command->first_argument, ")")))
- {
- /* Replace it with \0 */
- *ptr= 0;
- }
- else
- die("connect - argument list started with '(' must be ended with ')'");
- }
-
+ strip_parentheses(command);
check_command_args(command, command->first_argument, connect_args,
sizeof(connect_args)/sizeof(struct command_arg),
',');
@@ -4192,16 +4367,12 @@ int read_command(struct st_command** command_ptr)
DBUG_RETURN(0);
}
if (!(*command_ptr= command=
- (struct st_command*) my_malloc(sizeof(*command), MYF(MY_WME))) ||
+ (struct st_command*) my_malloc(sizeof(*command),
+ MYF(MY_WME|MY_ZEROFILL))) ||
insert_dynamic(&q_lines, (gptr) &command))
die(NullS);
-
- command->require_file[0]= 0;
- command->first_word_len= 0;
- command->query_len= 0;
-
command->type= Q_UNKNOWN;
- command->query_buf= command->query= 0;
+
read_command_buf[0]= 0;
if (read_line(read_command_buf, sizeof(read_command_buf)))
{
@@ -6040,6 +6211,11 @@ int main(int argc, char **argv)
init_dynamic_string(&ds_warning_messages, "", 0, 2048);
parse_args(argc, argv);
+ var_set_int("$PS_PROTOCOL", ps_protocol);
+ var_set_int("$SP_PROTOCOL", sp_protocol);
+ var_set_int("$VIEW_PROTOCOL", view_protocol);
+ var_set_int("$CURSOR_PROTOCOL", cursor_protocol);
+
DBUG_PRINT("info",("result_file: '%s'",
result_file_name ? result_file_name : ""));
if (mysql_server_init(embedded_server_arg_count,
@@ -6176,13 +6352,19 @@ int main(int argc, char **argv)
case Q_DISPLAY_HORIZONTAL_RESULTS:
display_result_vertically= FALSE;
break;
+ case Q_SORTED_RESULT:
+ /*
+ Turn on sorting of result set, will be reset after next
+ command
+ */
+ display_result_sorted= TRUE;
+ break;
case Q_LET: do_let(command); break;
case Q_EVAL_RESULT:
eval_result = 1; break;
case Q_EVAL:
case Q_QUERY_VERTICAL:
case Q_QUERY_HORIZONTAL:
- case Q_QUERY_SORTED:
if (command->query == command->query_buf)
{
/* Skip the first part of command, i.e query_xxx */
@@ -6194,7 +6376,6 @@ int main(int argc, char **argv)
case Q_REAP:
{
my_bool old_display_result_vertically= display_result_vertically;
- my_bool old_display_result_sorted= display_result_sorted;
/* Default is full query, both reap and send */
int flags= QUERY_REAP_FLAG | QUERY_SEND_FLAG;
@@ -6211,7 +6392,6 @@ int main(int argc, char **argv)
/* Check for special property for this query */
display_result_vertically|= (command->type == Q_QUERY_VERTICAL);
- display_result_sorted= (command->type == Q_QUERY_SORTED);
if (save_file[0])
{
@@ -6224,7 +6404,6 @@ int main(int argc, char **argv)
/* Restore settings */
display_result_vertically= old_display_result_vertically;
- display_result_sorted= old_display_result_sorted;
break;
}
@@ -6385,6 +6564,9 @@ int main(int argc, char **argv)
the replace structures should be cleared
*/
free_all_replace();
+
+ /* Also reset "sorted_result" */
+ display_result_sorted= FALSE;
}
last_command_executed= command_executed;
diff --git a/cmd-line-utils/libedit/el_term.h b/cmd-line-utils/libedit/el_term.h
index 9e5588ee96f..00ca48e38e2 100644
--- a/cmd-line-utils/libedit/el_term.h
+++ b/cmd-line-utils/libedit/el_term.h
@@ -90,6 +90,16 @@ extern char* tgoto(const char*, int, int);
extern char* tgetstr(char*, char**);
#endif
+
+#if !HAVE_DECL_TGOTO
+/*
+ 'tgoto' is not declared in the system header files, this causes
+ problems on 64-bit systems. The function returns a 64 bit pointer
+ but caller see it as "int" and it's thus truncated to 32-bit
+*/
+extern char* tgoto(const char*, int, int);
+#endif
+
protected void term_move_to_line(EditLine *, int);
protected void term_move_to_char(EditLine *, int);
protected void term_clear_EOL(EditLine *, int);
diff --git a/config/ac-macros/ha_ndbcluster.m4 b/config/ac-macros/ha_ndbcluster.m4
index a4963a5e20e..55fe6ad8350 100644
--- a/config/ac-macros/ha_ndbcluster.m4
+++ b/config/ac-macros/ha_ndbcluster.m4
@@ -22,7 +22,7 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
if test -f "$mysql_sci_dir/lib/libsisci.a" -a \
-f "$mysql_sci_dir/include/sisci_api.h"; then
NDB_SCI_INCLUDES="-I$mysql_sci_dir/include"
- NDB_SCI_LIBS="-L$mysql_sci_dir/lib -lsisci"
+ NDB_SCI_LIBS="$mysql_sci_dir/lib/libsisci.a"
AC_MSG_RESULT([-- including sci transporter])
AC_DEFINE([NDB_SCI_TRANSPORTER], [1],
[Including Ndb Cluster DB sci transporter])
diff --git a/configure.in b/configure.in
index 812bcff0d97..979ed7066d6 100644
--- a/configure.in
+++ b/configure.in
@@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
# remember to also change ndb version below and update version.c in ndb
-AM_INIT_AUTOMAKE(mysql, 5.0.42)
+AM_INIT_AUTOMAKE(mysql, 5.0.44)
AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10
@@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0
# ndb version
NDB_VERSION_MAJOR=5
NDB_VERSION_MINOR=0
-NDB_VERSION_BUILD=42
+NDB_VERSION_BUILD=44
NDB_VERSION_STATUS=""
# Set all version vars based on $VERSION. How do we do this more elegant ?
@@ -1947,6 +1947,19 @@ else
fi
AC_SUBST(TERMCAP_LIB)
+# Check if the termcap function 'tgoto' is already declared in
+# system header files or if it need to be declared locally
+AC_CHECK_DECLS(tgoto,,,[
+#ifdef HAVE_CURSES_H
+# include <curses.h>
+#elif HAVE_NCURSES_H
+# include <ncurses.h>
+#endif
+#ifdef HAVE_TERM_H
+# include <term.h>
+#endif
+])
+
LIBEDIT_LOBJECTS=""
AC_CHECK_FUNC(strunvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS unvis.o"])
AC_CHECK_FUNC(strvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS vis.o"])
@@ -2007,12 +2020,20 @@ case "$target" in
;;
esac
-# isinf() could be a function or a macro (HPUX)
-AC_MSG_CHECKING(for isinf with <math.h>)
+# Check that isinf() is available in math.h and can be used in both C and C++
+# code
+AC_MSG_CHECKING(for isinf in <math.h>)
AC_TRY_LINK([#include <math.h>], [float f = 0.0; int r = isinf(f); return r],
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]),
- AC_MSG_RESULT(no))
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING(whether isinf() can be used in C++ code)
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_LINK([#include <math.h>], [float f = 0.0; int r = isinf(f); return r],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]),
+ AC_MSG_RESULT(no))
+ AC_LANG_RESTORE,
+ AC_MSG_RESULT(no))
CFLAGS="$ORG_CFLAGS"
diff --git a/heap/hp_hash.c b/heap/hp_hash.c
index c5a30a3ef65..d8eee9c794c 100644
--- a/heap/hp_hash.c
+++ b/heap/hp_hash.c
@@ -379,7 +379,13 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
{
- register ulong nr=0;
+ /*
+ Note, if a key consists of a combination of numeric and
+ a text columns, it most likely won't work well.
+ Making text columns work with NEW_HASH_FUNCTION
+ needs also changes in strings/ctype-xxx.c.
+ */
+ ulong nr= 1, nr2= 4;
HA_KEYSEG *seg,*endseg;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
@@ -401,14 +407,15 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
}
if (seg->type == HA_KEYTYPE_TEXT)
{
- seg->charset->hash_sort(seg->charset,pos,((uchar*)key)-pos,&nr,NULL);
+ seg->charset->coll->hash_sort(seg->charset, pos, ((uchar*)key)-pos,
+ &nr, &nr2);
}
else if (seg->type == HA_KEYTYPE_VARTEXT1) /* Any VARCHAR segments */
{
uint pack_length= 2; /* Key packing is constant */
uint length= uint2korr(pos);
- seg->charset->hash_sort(seg->charset, pos+pack_length, length, &nr,
- NULL);
+ seg->charset->coll->hash_sort(seg->charset, pos+pack_length, length,
+ &nr, &nr2);
key+= pack_length;
}
else
@@ -428,7 +435,7 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
{
- register ulong nr=0;
+ ulong nr= 1, nr2= 4;
HA_KEYSEG *seg,*endseg;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
@@ -444,14 +451,16 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
}
if (seg->type == HA_KEYTYPE_TEXT)
{
- seg->charset->hash_sort(seg->charset,pos,((uchar*)key)-pos,&nr,NULL);
+ uint char_length= seg->length; /* TODO: fix to use my_charpos() */
+ seg->charset->coll->hash_sort(seg->charset, pos, char_length,
+ &nr, &nr2);
}
else if (seg->type == HA_KEYTYPE_VARTEXT1) /* Any VARCHAR segments */
{
uint pack_length= seg->bit_start;
uint length= (pack_length == 1 ? (uint) *(uchar*) pos : uint2korr(pos));
- seg->charset->hash_sort(seg->charset, pos+pack_length,
- length, &nr, NULL);
+ seg->charset->coll->hash_sort(seg->charset, pos+pack_length,
+ length, &nr, &nr2);
}
else
{
diff --git a/include/decimal.h b/include/decimal.h
index 56962009025..c5385b58658 100644
--- a/include/decimal.h
+++ b/include/decimal.h
@@ -47,6 +47,7 @@ int decimal_bin_size(int precision, int scale);
int decimal_result_size(decimal_t *from1, decimal_t *from2, char op,
int param);
+int decimal_intg(decimal_t *from);
int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to);
int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to);
int decimal_cmp(decimal_t *from1, decimal_t *from2);
diff --git a/include/m_string.h b/include/m_string.h
index 349084ab21e..981111b8718 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -105,6 +105,9 @@ extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */
extern char NEAR _dig_vec_upper[];
extern char NEAR _dig_vec_lower[];
+/* Defined in strtod.c */
+extern const double log_10[309];
+
#ifdef BAD_STRING_COMPILER
#define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1)
#else
diff --git a/include/my_global.h b/include/my_global.h
index e9b371d8d30..f32a987ffb1 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -792,12 +792,11 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define isnan(x) ((x) != (x))
#endif
-#if !defined(HAVE_ISINF)
-/* The configure check for "isinf with math.h" has failed */
-#ifdef isinf
-#undef isinf
-#endif
-#define isinf(X) (!finite(X) && !isnan(X))
+#ifdef HAVE_ISINF
+/* isinf() can be used in both C and C++ code */
+#define my_isinf(X) isinf(X)
+#else
+#define my_isinf(X) (!finite(X) && !isnan(X))
#endif
/* Define missing math constants. */
diff --git a/include/my_sys.h b/include/my_sys.h
index 615a074e814..7df2718c7b1 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -66,8 +66,8 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MY_ALLOW_ZERO_PTR 64 /* my_realloc() ; zero ptr -> malloc */
#define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */
#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
-#define MY_THREADSAFE 128 /* pread/pwrite: Don't allow interrupts */
#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */
+#define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
#define MY_GIVE_INFO 2 /* Give time info about process*/
diff --git a/include/my_time.h b/include/my_time.h
index 0e57b3d4af4..99eb5c36c6b 100644
--- a/include/my_time.h
+++ b/include/my_time.h
@@ -92,6 +92,7 @@ int check_time_range(struct st_mysql_time *, int *warning);
long calc_daynr(uint year,uint month,uint day);
uint calc_days_in_year(uint year);
+uint year_2000_handling(uint year);
void init_time(void);
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 93409b2ea1d..889579e3622 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -345,6 +345,11 @@ my_bool net_write_command(NET *net,unsigned char command,
int net_real_write(NET *net,const char *packet,unsigned long len);
unsigned long my_net_read(NET *net);
+#ifdef _global_h
+void my_net_set_write_timeout(NET *net, uint timeout);
+void my_net_set_read_timeout(NET *net, uint timeout);
+#endif
+
/*
The following function is not meant for normal usage
Currently it's used internally by manager.c
diff --git a/include/thr_lock.h b/include/thr_lock.h
index 966522fe3e3..aa5eb7426ae 100644
--- a/include/thr_lock.h
+++ b/include/thr_lock.h
@@ -54,6 +54,11 @@ enum thr_lock_type { TL_IGNORE=-1,
TL_WRITE_CONCURRENT_INSERT,
/* Write used by INSERT DELAYED. Allows READ locks */
TL_WRITE_DELAYED,
+ /*
+ parser only! Late bound low_priority flag.
+ At open_tables() becomes thd->update_lock_default.
+ */
+ TL_WRITE_DEFAULT,
/* WRITE lock that has lower priority than TL_READ */
TL_WRITE_LOW_PRIORITY,
/* Normal WRITE lock */
diff --git a/include/violite.h b/include/violite.h
index 63388c170c9..e0172008565 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -88,7 +88,6 @@ my_bool vio_peer_addr(Vio* vio, char *buf, uint16 *port);
/* Remotes in_addr */
void vio_in_addr(Vio *vio, struct in_addr *in);
my_bool vio_poll_read(Vio *vio,uint timeout);
-void vio_timeout(Vio *vio,uint which, uint timeout);
#ifdef HAVE_OPENSSL
#include <openssl/opensslv.h>
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index 647f6bd5e33..3b18531f6c0 100755
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -18,6 +18,10 @@ INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
# storage does not work properly in DLLs.
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
+SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
+SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
+SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
+SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/zlib
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index e80684a1b1e..e426d2c549e 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -67,8 +67,6 @@
ulong net_buffer_length=8192;
ulong max_allowed_packet= 1024L*1024L*1024L;
-ulong net_read_timeout= CLIENT_NET_READ_TIMEOUT;
-ulong net_write_timeout= CLIENT_NET_WRITE_TIMEOUT;
#ifdef EMBEDDED_LIBRARY
@@ -1528,8 +1526,8 @@ my_bool STDCALL mysql_embedded(void)
void my_net_local_init(NET *net)
{
net->max_packet= (uint) net_buffer_length;
- net->read_timeout= (uint) net_read_timeout;
- net->write_timeout=(uint) net_write_timeout;
+ my_net_set_read_timeout(net, CLIENT_NET_READ_TIMEOUT);
+ my_net_set_write_timeout(net, CLIENT_NET_WRITE_TIMEOUT);
net->retry_count= 1;
net->max_packet_size= max(net_buffer_length, max_allowed_packet);
}
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index 330e72e5507..81da1e43cc9 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -81,7 +81,7 @@ INC_LIB= $(top_builddir)/regex/libregex.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a \
$(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/vio/libvio.a
+ $(top_builddir)/vio/libvio.a @NDB_SCI_LIBS@
#
@@ -127,11 +127,11 @@ link_sources:
for f in $(sqlsources); do \
rm -f $$f; \
if test -e $(top_srcdir)/sql/$$f ; \
- then \
+ then \
@LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
- else \
+ else \
@LN_CP_F@ $(top_builddir)/sql/$$f $$f; \
- fi ; \
+ fi ; \
done; \
for f in $(libmysqlsources); do \
rm -f $$f; \
diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am
index f30951a5d81..e0dd8491688 100644
--- a/libmysqld/examples/Makefile.am
+++ b/libmysqld/examples/Makefile.am
@@ -35,7 +35,8 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) \
-I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \
$(openssl_includes)
LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs)
-LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS)
+LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS) \
+ @NDB_SCI_LIBS@
mysqltest_embedded_LINK = $(CXXLINK)
mysqltest_embedded_SOURCES = mysqltest.c
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index 444dc2a1da9..ed0a84e737d 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -335,7 +335,7 @@ int chk_size(MI_CHECK *param, register MI_INFO *info)
flush_key_blocks(info->s->key_cache,
info->s->kfile, FLUSH_FORCE_WRITE);
- size=my_seek(info->s->kfile,0L,MY_SEEK_END,MYF(0));
+ size= my_seek(info->s->kfile, 0L, MY_SEEK_END, MYF(MY_THREADSAFE));
if ((skr=(my_off_t) info->state->key_file_length) != size)
{
/* Don't give error if file generated by myisampack */
@@ -595,7 +595,8 @@ static int chk_index_down(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
{
/* purecov: begin tested */
/* Give it a chance to fit in the real file size. */
- my_off_t max_length= my_seek(info->s->kfile, 0L, MY_SEEK_END, MYF(0));
+ my_off_t max_length= my_seek(info->s->kfile, 0L, MY_SEEK_END,
+ MYF(MY_THREADSAFE));
mi_check_print_error(param, "Invalid key block position: %s "
"key block size: %u file_length: %s",
llstr(page, llbuff), keyinfo->block_length,
@@ -4052,10 +4053,10 @@ int test_if_almost_full(MI_INFO *info)
{
if (info->s->options & HA_OPTION_COMPRESS_RECORD)
return 0;
- return (my_seek(info->s->kfile,0L,MY_SEEK_END,MYF(0))/10*9 >
- (my_off_t) (info->s->base.max_key_file_length) ||
- my_seek(info->dfile,0L,MY_SEEK_END,MYF(0))/10*9 >
- (my_off_t) info->s->base.max_data_file_length);
+ return my_seek(info->s->kfile, 0L, MY_SEEK_END, MYF(MY_THREADSAFE)) / 10 * 9 >
+ (my_off_t) info->s->base.max_key_file_length ||
+ my_seek(info->dfile, 0L, MY_SEEK_END, MYF(0)) / 10 * 9 >
+ (my_off_t) info->s->base.max_data_file_length;
}
/* Recreate table with bigger more alloced record-data */
diff --git a/myisam/sort.c b/myisam/sort.c
index 3cb48b47b2c..f918283503e 100644
--- a/myisam/sort.c
+++ b/myisam/sort.c
@@ -773,7 +773,7 @@ static int NEAR_F merge_many_buff(MI_SORT_PARAM *info, uint keys,
{
if (merge_buffers(info,keys,from_file,to_file,sort_keys,lastbuff++,
buffpek+i,buffpek+i+MERGEBUFF-1))
- break; /* purecov: inspected */
+ goto cleanup;
}
if (merge_buffers(info,keys,from_file,to_file,sort_keys,lastbuff++,
buffpek+i,buffpek+ *maxbuffer))
@@ -783,6 +783,7 @@ static int NEAR_F merge_many_buff(MI_SORT_PARAM *info, uint keys,
temp=from_file; from_file=to_file; to_file=temp;
*maxbuffer= (int) (lastbuff-buffpek)-1;
}
+cleanup:
close_cached_file(to_file); /* This holds old result */
if (to_file == t_file)
*t_file=t_file2; /* Copy result file */
diff --git a/mysql-test/include/have_log_bin.inc b/mysql-test/include/have_log_bin.inc
new file mode 100644
index 00000000000..11530dc953e
--- /dev/null
+++ b/mysql-test/include/have_log_bin.inc
@@ -0,0 +1,4 @@
+-- require r/have_log_bin.require
+disable_query_log;
+show variables like "log_bin";
+enable_query_log;
diff --git a/mysql-test/include/is_debug_build.inc b/mysql-test/include/is_debug_build.inc
deleted file mode 100644
index 23a2814e2bb..00000000000
--- a/mysql-test/include/is_debug_build.inc
+++ /dev/null
@@ -1,4 +0,0 @@
--- require r/is_debug_build.require
---disable_query_log
-select instr(version(), "debug") > 0;
---enable_query_log
diff --git a/mysql-test/include/master-slave.inc b/mysql-test/include/master-slave.inc
index ea09f4e842b..0c27a1d8225 100644
--- a/mysql-test/include/master-slave.inc
+++ b/mysql-test/include/master-slave.inc
@@ -1,3 +1,6 @@
+# Replication tests need binlog
+source include/have_log_bin.inc;
+
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
diff --git a/mysql-test/include/show_binlog_events.inc b/mysql-test/include/show_binlog_events.inc
new file mode 100644
index 00000000000..5d60fb19cb5
--- /dev/null
+++ b/mysql-test/include/show_binlog_events.inc
@@ -0,0 +1,4 @@
+--let $binlog_start=98
+--replace_column 5 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\//
+--eval show binlog events from $binlog_start
diff --git a/mysql-test/include/uses_vardir.inc b/mysql-test/include/uses_vardir.inc
new file mode 100644
index 00000000000..950de698a43
--- /dev/null
+++ b/mysql-test/include/uses_vardir.inc
@@ -0,0 +1,14 @@
+#
+# Some tests uses LOAD DATA with a relative path
+# and need to see for example ../std_data
+#
+# Also if an absolute path was used, the server might be started
+# with --secure-file-priv and wouldn't be allowed to LOAD a file
+# outside of it's vardir anyway
+#
+
+
+if (`select LOCATE('$MYSQLTEST_VARDIR', REPLACE(@@datadir, '\\\\', '/')) != 1`)
+{
+ skip Need mysqld in MYSQLTEST_VARDIR;
+}
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index 1d157ea3401..5e176dce109 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -596,6 +596,25 @@ sub collect_one_test_case($$$$$$$) {
}
}
+ if ( $tinfo->{'need_binlog'} )
+ {
+ if (grep(/^--skip-log-bin/, @::opt_extra_mysqld_opt) )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "Test need binlog";
+ return;
+ }
+ }
+ else
+ {
+ if ( $::mysql_version_id >= 50100 )
+ {
+ # Test does not need binlog, add --skip-binlog to
+ # the options used when starting it
+ push(@{$tinfo->{'master_opt'}}, "--skip-log-bin");
+ }
+ }
+
}
}
@@ -608,6 +627,7 @@ our @tags=
["include/have_binlog_format_row.inc", "binlog_format", "row"],
["include/have_binlog_format_statement.inc", "binlog_format", "stmt"],
["include/have_binlog_format_mixed.inc", "binlog_format", "mixed"],
+ ["include/have_log_bin.inc", "need_binlog", 1],
["include/big_test.inc", "big_test", 1],
["include/have_debug.inc", "need_debug", 1],
["include/have_ndb.inc", "ndb_test", 1],
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index c494626bbae..2304a40978c 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -903,6 +903,9 @@ sub command_line_setup () {
$opt_skip_ndbcluster= 1; # Turn off use of NDB cluster
$opt_skip_ssl= 1; # Turn off use of SSL
+ # Turn off use of bin log
+ push(@opt_extra_mysqld_opt, "--skip-log-bin");
+
if ( $opt_extern )
{
mtr_error("Can't use --extern with --embedded-server");
@@ -1071,7 +1074,7 @@ sub command_line_setup () {
# On some operating systems, there is a limit to the length of a
# UNIX domain socket's path far below PATH_MAX, so try to avoid long
# socket path names.
- $sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) >= 80 );
+ $sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) >= 70 );
$master->[0]=
{
@@ -1784,6 +1787,17 @@ sub environment_setup () {
split(':', $ENV{'DYLD_LIBRARY_PATH'}) : ());
mtr_debug("DYLD_LIBRARY_PATH: $ENV{'DYLD_LIBRARY_PATH'}");
+ # The environment variable used for shared libs on AIX
+ $ENV{'SHLIB_PATH'}= join(":", @ld_library_paths,
+ $ENV{'SHLIB_PATH'} ?
+ split(':', $ENV{'SHLIB_PATH'}) : ());
+ mtr_debug("SHLIB_PATH: $ENV{'SHLIB_PATH'}");
+
+ # The environment variable used for shared libs on hp-ux
+ $ENV{'LIBPATH'}= join(":", @ld_library_paths,
+ $ENV{'LIBPATH'} ?
+ split(':', $ENV{'LIBPATH'}) : ());
+ mtr_debug("LIBPATH: $ENV{'LIBPATH'}");
# --------------------------------------------------------------------------
# Also command lines in .opt files may contain env vars
@@ -1792,6 +1806,18 @@ sub environment_setup () {
$ENV{'CHARSETSDIR'}= $path_charsetsdir;
$ENV{'UMASK'}= "0660"; # The octal *string*
$ENV{'UMASK_DIR'}= "0770"; # The octal *string*
+
+ #
+ # MySQL tests can produce output in various character sets
+ # (especially, ctype_xxx.test). To avoid confusing Perl
+ # with output which is incompatible with the current locale
+ # settings, we reset the current values of LC_ALL and LC_CTYPE to "C".
+ # For details, please see
+ # Bug#27636 tests fails if LC_* variables set to *_*.UTF-8
+ #
+ $ENV{'LC_ALL'}= "C";
+ $ENV{'LC_CTYPE'}= "C";
+
$ENV{'LC_COLLATE'}= "C";
$ENV{'USE_RUNNING_SERVER'}= $opt_extern;
$ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir;
@@ -2307,16 +2333,23 @@ sub check_running_as_root () {
close FILE;
}
- chmod(oct("0755"), $test_file);
- unlink($test_file);
+ # Some filesystems( for example CIFS) allows reading a file
+ # although mode was set to 0000, but in that case a stat on
+ # the file will not return 0000
+ my $file_mode= (stat($test_file))[2] & 07777;
$ENV{'MYSQL_TEST_ROOT'}= "NO";
- if ($result eq "MySQL")
+ mtr_verbose("result: $result, file_mode: $file_mode");
+ if ($result eq "MySQL" && $file_mode == 0)
{
mtr_warning("running this script as _root_ will cause some " .
"tests to be skipped");
$ENV{'MYSQL_TEST_ROOT'}= "YES";
}
+
+ chmod(oct("0755"), $test_file);
+ unlink($test_file);
+
}
@@ -3600,6 +3633,9 @@ sub do_before_start_master ($) {
# FIXME what about second master.....
+ # Don't delete anything if starting dirty
+ return if ($opt_start_dirty);
+
foreach my $bin ( glob("$opt_vardir/log/master*-bin*") )
{
unlink($bin);
@@ -3631,6 +3667,9 @@ sub do_before_start_slave ($) {
my $tname= $tinfo->{'name'};
my $init_script= $tinfo->{'master_sh'};
+ # Don't delete anything if starting dirty
+ return if ($opt_start_dirty);
+
foreach my $bin ( glob("$opt_vardir/log/slave*-bin*") )
{
unlink($bin);
diff --git a/mysql-test/ndb/ndb_config_1_node.ini b/mysql-test/ndb/ndb_config_1_node.ini
index 7b0d2829530..68533396930 100644
--- a/mysql-test/ndb/ndb_config_1_node.ini
+++ b/mysql-test/ndb/ndb_config_1_node.ini
@@ -13,9 +13,11 @@ TimeBetweenGlobalCheckpoints= 500
NoOfFragmentLogFiles= 3
#
-# Increase deadlock-timeout to cater for slow test-machines
+# Increase timeouts to cater for slow test-machines
# (possibly running several tests in parallell)
#
+HeartbeatIntervalDbDb= 30000
+HeartbeatIntervalDbApi= 30000
#TransactionDeadlockDetectionTimeout= 7500
[ndbd]
diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini
index aafed28dbc6..55c9c285310 100644
--- a/mysql-test/ndb/ndb_config_2_node.ini
+++ b/mysql-test/ndb/ndb_config_2_node.ini
@@ -13,9 +13,11 @@ TimeBetweenGlobalCheckpoints= 500
NoOfFragmentLogFiles= 3
#
-# Increase deadlock-timeout to cater for slow test-machines
+# Increase timeouts to cater for slow test-machines
# (possibly running several tests in parallell)
#
+HeartbeatIntervalDbDb= 30000
+HeartbeatIntervalDbApi= 30000
#TransactionDeadlockDetectionTimeout= 7500
[ndbd]
diff --git a/mysql-test/ndb/ndb_config_4_node.ini b/mysql-test/ndb/ndb_config_4_node.ini
index 2154475aa37..779432e1660 100644
--- a/mysql-test/ndb/ndb_config_4_node.ini
+++ b/mysql-test/ndb/ndb_config_4_node.ini
@@ -13,9 +13,11 @@ TimeBetweenGlobalCheckpoints= 500
NoOfFragmentLogFiles= 3
#
-# Increase deadlock-timeout to cater for slow test-machines
+# Increase timeouts to cater for slow test-machines
# (possibly running several tests in parallell)
#
+HeartbeatIntervalDbDb= 30000
+HeartbeatIntervalDbApi= 30000
#TransactionDeadlockDetectionTimeout= 7500
[ndbd]
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 280cedb8b89..4eace9ac628 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -884,3 +884,22 @@ id
50
51
drop table t1;
+set @orig_sql_mode = @@sql_mode;
+set sql_mode="no_zero_date";
+create table t1(f1 int);
+alter table t1 add column f2 datetime not null, add column f21 date not null;
+insert into t1 values(1,'2000-01-01','2000-01-01');
+alter table t1 add column f3 datetime not null;
+ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'f3' at row 1
+alter table t1 add column f3 date not null;
+ERROR 22007: Incorrect date value: '0000-00-00' for column 'f3' at row 1
+alter table t1 add column f4 datetime not null default '2002-02-02',
+add column f41 date not null;
+ERROR 22007: Incorrect date value: '0000-00-00' for column 'f41' at row 1
+alter table t1 add column f4 datetime not null default '2002-02-02',
+add column f41 date not null default '2002-02-02';
+select * from t1;
+f1 f2 f21 f4 f41
+1 2000-01-01 00:00:00 2000-01-01 2002-02-02 00:00:00 2002-02-02
+drop table t1;
+set sql_mode= @orig_sql_mode;
diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result
index 0ecc462fb70..49722d5b0ab 100644
--- a/mysql-test/r/analyse.result
+++ b/mysql-test/r/analyse.result
@@ -39,10 +39,10 @@ t2 CREATE TABLE `t2` (
`Field_name` varbinary(255) NOT NULL default '',
`Min_value` varbinary(255) default NULL,
`Max_value` varbinary(255) default NULL,
- `Min_length` int(11) NOT NULL default '0',
- `Max_length` int(11) NOT NULL default '0',
- `Empties_or_zeros` int(11) NOT NULL default '0',
- `Nulls` int(11) NOT NULL default '0',
+ `Min_length` bigint(11) NOT NULL default '0',
+ `Max_length` bigint(11) NOT NULL default '0',
+ `Empties_or_zeros` bigint(11) NOT NULL default '0',
+ `Nulls` bigint(11) NOT NULL default '0',
`Avg_value_or_avg_length` varbinary(255) NOT NULL default '',
`Std` varbinary(255) default NULL,
`Optimal_fieldtype` varbinary(64) NOT NULL default ''
@@ -58,10 +58,10 @@ t2 CREATE TABLE `t2` (
`Field_name` varbinary(255) NOT NULL default '',
`Min_value` varbinary(255) default NULL,
`Max_value` varbinary(255) default NULL,
- `Min_length` int(11) NOT NULL default '0',
- `Max_length` int(11) NOT NULL default '0',
- `Empties_or_zeros` int(11) NOT NULL default '0',
- `Nulls` int(11) NOT NULL default '0',
+ `Min_length` bigint(11) NOT NULL default '0',
+ `Max_length` bigint(11) NOT NULL default '0',
+ `Empties_or_zeros` bigint(11) NOT NULL default '0',
+ `Nulls` bigint(11) NOT NULL default '0',
`Avg_value_or_avg_length` varbinary(255) NOT NULL default '',
`Std` varbinary(255) default NULL,
`Optimal_fieldtype` varbinary(64) NOT NULL default ''
@@ -81,10 +81,10 @@ t2 CREATE TABLE `t2` (
`Field_name` varbinary(255) NOT NULL default '',
`Min_value` varbinary(255) default NULL,
`Max_value` varbinary(255) default NULL,
- `Min_length` int(11) NOT NULL default '0',
- `Max_length` int(11) NOT NULL default '0',
- `Empties_or_zeros` int(11) NOT NULL default '0',
- `Nulls` int(11) NOT NULL default '0',
+ `Min_length` bigint(11) NOT NULL default '0',
+ `Max_length` bigint(11) NOT NULL default '0',
+ `Empties_or_zeros` bigint(11) NOT NULL default '0',
+ `Nulls` bigint(11) NOT NULL default '0',
`Avg_value_or_avg_length` varbinary(255) NOT NULL default '',
`Std` varbinary(255) default NULL,
`Optimal_fieldtype` varbinary(64) NOT NULL default ''
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result
index d0058118e4c..90ba00e1019 100644
--- a/mysql-test/r/auto_increment.result
+++ b/mysql-test/r/auto_increment.result
@@ -232,7 +232,7 @@ a b
delete from t1 where a=0;
update t1 set a=NULL where b=6;
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 4
+Warning 1048 Column 'a' cannot be null
update t1 set a=300 where b=7;
SET SQL_MODE='';
insert into t1(a,b)values(NULL,8);
@@ -274,7 +274,7 @@ a b
delete from t1 where a=0;
update t1 set a=NULL where b=13;
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 9
+Warning 1048 Column 'a' cannot be null
update t1 set a=500 where b=14;
select * from t1 order by b;
a b
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index 541a15561e2..f18d1c9b583 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -352,3 +352,13 @@ select c1 mod 50 as result from t1;
result
6
drop table t1;
+select cast(19999999999999999999 as signed);
+cast(19999999999999999999 as signed)
+9223372036854775807
+Warnings:
+Error 1292 Truncated incorrect DECIMAL value: ''
+select cast(-19999999999999999999 as signed);
+cast(-19999999999999999999 as signed)
+-9223372036854775808
+Warnings:
+Error 1292 Truncated incorrect DECIMAL value: ''
diff --git a/mysql-test/r/binlog.result b/mysql-test/r/binlog.result
index 25930c31735..4ed6c50c7f6 100644
--- a/mysql-test/r/binlog.result
+++ b/mysql-test/r/binlog.result
@@ -17,7 +17,7 @@ master-bin.000001 # Query 1 # use `test`; insert t1 values (5)
master-bin.000001 # Query 1 # use `test`; COMMIT
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert t2 values (5)
-master-bin.000001 # Xid 1 # COMMIT /* xid=12 */
+master-bin.000001 # Xid 1 # COMMIT /* xid=13 */
drop table t1,t2;
reset master;
create table t1 (n int) engine=innodb;
@@ -128,7 +128,7 @@ master-bin.000001 # Query 1 # use `test`; insert into t1 values(4 + 4)
master-bin.000001 # Query 1 # use `test`; insert into t1 values(3 + 4)
master-bin.000001 # Query 1 # use `test`; insert into t1 values(2 + 4)
master-bin.000001 # Query 1 # use `test`; insert into t1 values(1 + 4)
-master-bin.000001 # Xid 1 # COMMIT /* xid=19 */
+master-bin.000001 # Xid 1 # COMMIT /* xid=20 */
master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
show binlog events in 'master-bin.000002' from 98;
Log_name Pos Event_type Server_id End_log_pos Info
diff --git a/mysql-test/r/binlog_killed.result b/mysql-test/r/binlog_killed.result
new file mode 100644
index 00000000000..ba4f38fb4c1
--- /dev/null
+++ b/mysql-test/r/binlog_killed.result
@@ -0,0 +1,12 @@
+create table t1 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB;
+create table t2 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=MyISAM;
+create table t3 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB;
+select get_lock("a", 20);
+get_lock("a", 20)
+1
+reset master;
+insert into t2 values (null, null), (null, get_lock("a", 10));
+select @result /* must be zero either way */;
+@result
+0
+drop table t1,t2,t3;
diff --git a/mysql-test/r/blackhole.result b/mysql-test/r/blackhole.result
index 0ee5f326e0f..5ab4931b53b 100644
--- a/mysql-test/r/blackhole.result
+++ b/mysql-test/r/blackhole.result
@@ -123,6 +123,10 @@ master-bin.000001 # Query 1 # use `test`; create table t3 like t1
master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t3
master-bin.000001 # Query 1 # use `test`; replace into t1 select * from t3
drop table t1,t2,t3;
+CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
+INSERT DELAYED INTO t1 VALUES(1);
+ERROR HY000: Table storage engine for 't1' doesn't have this option
+DROP TABLE t1;
CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE;
DELETE FROM t1 WHERE a=10;
ALTER TABLE t1 ADD INDEX(a);
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index d8e50128902..6eceeff87e2 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -103,7 +103,7 @@ Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'a'
select 10.0+cast('a' as decimal);
10.0+cast('a' as decimal)
-10.00
+10.0
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: 'a'
select 10E+0+'a';
@@ -351,6 +351,12 @@ DROP TABLE t1;
select isnull(date(NULL)), isnull(cast(NULL as DATE));
isnull(date(NULL)) isnull(cast(NULL as DATE))
1 1
+SELECT CAST(cast('01-01-01' as date) AS UNSIGNED);
+CAST(cast('01-01-01' as date) AS UNSIGNED)
+20010101
+SELECT CAST(cast('01-01-01' as date) AS SIGNED);
+CAST(cast('01-01-01' as date) AS SIGNED)
+20010101
End of 4.1 tests
select cast('1.2' as decimal(3,2));
cast('1.2' as decimal(3,2))
@@ -372,7 +378,9 @@ create table t1(s1 time);
insert into t1 values ('11:11:11');
select cast(s1 as decimal(7,2)) from t1;
cast(s1 as decimal(7,2))
-111111.00
+99999.99
+Warnings:
+Error 1264 Out of range value adjusted for column 'cast(s1 as decimal(7,2))' at row 1
drop table t1;
CREATE TABLE t1 (v varchar(10), tt tinytext, t text,
mt mediumtext, lt longtext);
@@ -380,7 +388,7 @@ INSERT INTO t1 VALUES ('1.01', '2.02', '3.03', '4.04', '5.05');
SELECT CAST(v AS DECIMAL), CAST(tt AS DECIMAL), CAST(t AS DECIMAL),
CAST(mt AS DECIMAL), CAST(lt AS DECIMAL) from t1;
CAST(v AS DECIMAL) CAST(tt AS DECIMAL) CAST(t AS DECIMAL) CAST(mt AS DECIMAL) CAST(lt AS DECIMAL)
-1.01 2.02 3.03 4.04 5.05
+1 2 3 4 5
DROP TABLE t1;
select cast(NULL as decimal(6)) as t1;
t1
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index afa005e74c0..c1f72ce317c 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -13,7 +13,7 @@ Warnings:
Note 1050 Table 't1' already exists
insert into t1 values (""),(null);
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'b' at row 2
+Warning 1048 Column 'b' cannot be null
select * from t1;
b
@@ -769,6 +769,100 @@ t1 CREATE TABLE `t1` (
`i` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MAX_ROWS=4294967295
drop table t1;
+create table t1 select * from t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
+create table t1 select * from t1;
+ERROR HY000: You can't specify target table 't1' for update in FROM clause
+create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation 'coalesce'
+create table t1 (primary key(a)) select "b" as b;
+ERROR 42000: Key column 'a' doesn't exist in table
+create table t1 (a int);
+create table if not exists t1 select 1 as a, 2 as b;
+ERROR 21S01: Column count doesn't match value count at row 1
+drop table t1;
+create table t1 (primary key (a)) (select 1 as a) union all (select 1 as a);
+ERROR 23000: Duplicate entry '1' for key 1
+create table t1 (i int);
+create table t1 select 1 as i;
+ERROR 42S01: Table 't1' already exists
+create table if not exists t1 select 1 as i;
+Warnings:
+Note 1050 Table 't1' already exists
+select * from t1;
+i
+1
+create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation 'coalesce'
+select * from t1;
+i
+1
+alter table t1 add primary key (i);
+create table if not exists t1 (select 2 as i) union all (select 2 as i);
+ERROR 23000: Duplicate entry '2' for key 1
+select * from t1;
+i
+1
+2
+drop table t1;
+create temporary table t1 (j int);
+create table if not exists t1 select 1;
+Warnings:
+Note 1050 Table 't1' already exists
+select * from t1;
+j
+1
+drop temporary table t1;
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+drop table t1;
+ERROR 42S02: Unknown table 't1'
+create table t1 (i int);
+insert into t1 values (1), (2);
+lock tables t1 read;
+create table t2 select * from t1;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+create table if not exists t2 select * from t1;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+unlock tables;
+create table t2 (j int);
+lock tables t1 read;
+create table t2 select * from t1;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+create table if not exists t2 select * from t1;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+unlock tables;
+lock table t1 read, t2 read;
+create table t2 select * from t1;
+ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
+create table if not exists t2 select * from t1;
+ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
+unlock tables;
+lock table t1 read, t2 write;
+create table t2 select * from t1;
+ERROR 42S01: Table 't2' already exists
+create table if not exists t2 select * from t1;
+Warnings:
+Note 1050 Table 't2' already exists
+select * from t1;
+i
+1
+2
+unlock tables;
+drop table t2;
+lock tables t1 read;
+create temporary table t2 select * from t1;
+create temporary table if not exists t2 select * from t1;
+Warnings:
+Note 1050 Table 't2' already exists
+select * from t2;
+i
+1
+2
+1
+2
+unlock tables;
+drop table t1, t2;
create table t1 (upgrade int);
drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/ctype_cp932_binlog.result b/mysql-test/r/ctype_cp932_binlog.result
index ff295961008..3385cd20ec4 100644
--- a/mysql-test/r/ctype_cp932_binlog.result
+++ b/mysql-test/r/ctype_cp932_binlog.result
@@ -9,8 +9,7 @@ EXECUTE stmt1 USING @var1;
SHOW BINLOG EVENTS FROM 98;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 188 use `test`; CREATE TABLE t1(f1 blob)
-master-bin.000001 188 User var 1 227 @`var1`=_binary 0x8300 COLLATE binary
-master-bin.000001 227 Query 1 323 use `test`; INSERT INTO t1 VALUES(@'var1')
+master-bin.000001 188 Query 1 283 use `test`; INSERT INTO t1 VALUES(0x8300)
SELECT HEX(f1) FROM t1;
HEX(f1)
8300
@@ -30,17 +29,17 @@ HEX(s1) HEX(s2) d
466F6F2773206120426172 ED40ED41ED42 47.93
DROP PROCEDURE bug18293|
DROP TABLE t4|
-SHOW BINLOG EVENTS FROM 402|
+SHOW BINLOG EVENTS FROM 362|
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 402 Query 1 568 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
+master-bin.000001 362 Query 1 528 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
s2 CHAR(50) CHARACTER SET cp932,
d DECIMAL(10,2))
-master-bin.000001 568 Query 1 816 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE bug18293 (IN ins1 CHAR(50),
+master-bin.000001 528 Query 1 776 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE bug18293 (IN ins1 CHAR(50),
IN ins2 CHAR(50) CHARACTER SET cp932,
IN ind DECIMAL(10,2))
BEGIN
INSERT INTO t4 VALUES (ins1, ins2, ind);
END
-master-bin.000001 816 Query 1 1035 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
-master-bin.000001 1035 Query 1 1124 use `test`; DROP PROCEDURE bug18293
-master-bin.000001 1124 Query 1 1203 use `test`; DROP TABLE t4
+master-bin.000001 776 Query 1 995 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
+master-bin.000001 995 Query 1 1084 use `test`; DROP PROCEDURE bug18293
+master-bin.000001 1084 Query 1 1163 use `test`; DROP TABLE t4
diff --git a/mysql-test/r/ctype_cp932_notembedded.result b/mysql-test/r/ctype_cp932_notembedded.result
deleted file mode 100644
index c58bfc65454..00000000000
--- a/mysql-test/r/ctype_cp932_notembedded.result
+++ /dev/null
@@ -1,17 +0,0 @@
-drop table if exists t1;
-set names cp932;
-set character_set_database = cp932;
-RESET MASTER;
-CREATE TABLE t1(f1 blob);
-PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
-SET @var1= x'8300';
-EXECUTE stmt1 USING @var1;
-SHOW BINLOG EVENTS FROM 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 188 use `test`; CREATE TABLE t1(f1 blob)
-master-bin.000001 188 User var 1 227 @`var1`=_binary 0x8300 COLLATE binary
-master-bin.000001 227 Query 1 323 use `test`; INSERT INTO t1 VALUES(@'var1')
-SELECT HEX(f1) FROM t1;
-HEX(f1)
-8300
-DROP table t1;
diff --git a/mysql-test/r/ctype_ucs2_def.result b/mysql-test/r/ctype_ucs2_def.result
index 2f9dc4ae616..c076ca36cdb 100644
--- a/mysql-test/r/ctype_ucs2_def.result
+++ b/mysql-test/r/ctype_ucs2_def.result
@@ -7,3 +7,11 @@ character_set_server ucs2
DROP TABLE IF EXISTS t1;
create table t1 (a int);
drop table t1;
+CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL,
+col2 VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL,
+UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES('A', 'A'), ('B', 'B'), ('C', 'C');
+INSERT INTO t1 VALUES('A ', 'A ');
+ERROR 23000: Duplicate entry '' for key 1
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index f4ec6830cd5..d62c865bb3c 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -88,6 +88,8 @@ create table t1 (date char(30), format char(30) not null);
insert into t1 values
('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'),
('03-01-02 8:11:2.123456', '%y-%m-%d %H:%i:%S.%#'),
+('0003-01-02 8:11:2.123456', '%Y-%m-%d %H:%i:%S.%#'),
+('03-01-02 8:11:2.123456', '%Y-%m-%d %H:%i:%S.%#'),
('2003-01-02 10:11:12 PM', '%Y-%m-%d %h:%i:%S %p'),
('2003-01-02 01:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f%p'),
('2003-01-02 02:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f %p'),
@@ -119,6 +121,8 @@ select date,format,str_to_date(date, format) as str_to_date from t1;
date format str_to_date
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 10:11:12
03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02
+0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 0003-01-02 08:11:02
+03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02
2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12
2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.123450
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450
@@ -150,6 +154,8 @@ select date,format,concat('',str_to_date(date, format)) as con from t1;
date format con
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 10:11:12
03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02
+0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 0003-01-02 08:11:02
+03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02
2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12
2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.123450
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450
@@ -181,6 +187,8 @@ select date,format,cast(str_to_date(date, format) as datetime) as datetime from
date format datetime
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 10:11:12
03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02
+0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 0003-01-02 08:11:02
+03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02
2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12
2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.123450
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450
@@ -212,6 +220,8 @@ select date,format,DATE(str_to_date(date, format)) as date2 from t1;
date format date2
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02
03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02
+0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 0003-01-02
+03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 2003-01-02
2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02
2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02
@@ -243,6 +253,8 @@ select date,format,TIME(str_to_date(date, format)) as time from t1;
date format time
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12
03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 08:11:02
+0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02
+03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02
2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 22:11:12
2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 01:11:12.123450
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450
@@ -274,6 +286,8 @@ select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1;
date format time2
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12
03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 08:11:02
+0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02
+03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02
2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 22:11:12
2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 01:11:12.123450
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450
@@ -399,14 +413,14 @@ select date,format,str_to_date(date, format) as str_to_date from t1;
date format str_to_date
10:20:10AM %h:%i:%s 0000-00-00 10:20:10
2003-01-02 10:11:12 %Y-%m-%d %h:%i:%S 2003-01-02 10:11:12
-03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 0003-01-02 22:11:12
+03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12
Warnings:
Warning 1292 Truncated incorrect datetime value: '10:20:10AM'
select date,format,concat(str_to_date(date, format),'') as con from t1;
date format con
10:20:10AM %h:%i:%s 0000-00-00 10:20:10
2003-01-02 10:11:12 %Y-%m-%d %h:%i:%S 2003-01-02 10:11:12
-03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 0003-01-02 22:11:12
+03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12
Warnings:
Warning 1292 Truncated incorrect datetime value: '10:20:10AM'
drop table t1;
diff --git a/mysql-test/r/func_date_add.result b/mysql-test/r/func_date_add.result
index ac5709260fd..a7f2383848d 100644
--- a/mysql-test/r/func_date_add.result
+++ b/mysql-test/r/func_date_add.result
@@ -84,4 +84,15 @@ CAST('2006-09-26' AS DATE) + INTERVAL 1 YEAR
SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 WEEK;
CAST('2006-09-26' AS DATE) + INTERVAL 1 WEEK
2006-10-03
+create table t1 (a int, b varchar(10));
+insert into t1 values (1, '2001-01-01'),(2, '2002-02-02');
+select '2007-01-01' + interval a day from t1;
+'2007-01-01' + interval a day
+2007-01-02
+2007-01-03
+select b + interval a day from t1;
+b + interval a day
+2001-01-02
+2002-02-04
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 71419b5b2c3..8b71ad1940e 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -737,4 +737,77 @@ SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1;
GROUP_CONCAT(DISTINCT UCASE(b))
ONE.1,TWO.2,ONE.3
DROP TABLE t1;
+CREATE TABLE t1( a VARCHAR( 10 ), b INT );
+INSERT INTO t1 VALUES ( repeat( 'a', 10 ), 1),
+( repeat( 'b', 10 ), 2);
+SET group_concat_max_len = 20;
+SELECT GROUP_CONCAT( a ) FROM t1;
+GROUP_CONCAT( a )
+aaaaaaaaaa,bbbbbbbbb
+Warnings:
+Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+SELECT GROUP_CONCAT( DISTINCT a ) FROM t1;
+GROUP_CONCAT( DISTINCT a )
+aaaaaaaaaa,bbbbbbbbb
+Warnings:
+Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
+GROUP_CONCAT( a ORDER BY b )
+aaaaaaaaaa,bbbbbbbbb
+Warnings:
+Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1;
+GROUP_CONCAT( DISTINCT a ORDER BY b )
+aaaaaaaaaa,bbbbbbbbb
+Warnings:
+Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+SET group_concat_max_len = DEFAULT;
+DROP TABLE t1;
+SET group_concat_max_len= 65535;
+CREATE TABLE t1( a TEXT, b INTEGER );
+INSERT INTO t1 VALUES ( 'a', 0 ), ( 'b', 1 );
+SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
+GROUP_CONCAT( a ORDER BY b )
+a,b
+SELECT GROUP_CONCAT(DISTINCT a ORDER BY b) FROM t1;
+GROUP_CONCAT(DISTINCT a ORDER BY b)
+a,b
+SELECT GROUP_CONCAT(DISTINCT a) FROM t1;
+GROUP_CONCAT(DISTINCT a)
+a,b
+SET group_concat_max_len= 10;
+SELECT GROUP_CONCAT(a ORDER BY b) FROM t1;
+GROUP_CONCAT(a ORDER BY b)
+a,b
+SELECT GROUP_CONCAT(DISTINCT a ORDER BY b) FROM t1;
+GROUP_CONCAT(DISTINCT a ORDER BY b)
+a,b
+SELECT GROUP_CONCAT(DISTINCT a) FROM t1;
+GROUP_CONCAT(DISTINCT a)
+a,b
+SET group_concat_max_len= 65535;
+CREATE TABLE t2( a TEXT );
+INSERT INTO t2 VALUES( REPEAT( 'a', 5000 ) );
+INSERT INTO t2 VALUES( REPEAT( 'b', 5000 ) );
+INSERT INTO t2 VALUES( REPEAT( 'a', 5000 ) );
+SELECT LENGTH( GROUP_CONCAT( DISTINCT a ) ) FROM t2;
+LENGTH( GROUP_CONCAT( DISTINCT a ) )
+10001
+CREATE TABLE t3( a TEXT, b INT );
+INSERT INTO t3 VALUES( REPEAT( 'a', 65534 ), 1 );
+INSERT INTO t3 VALUES( REPEAT( 'a', 65535 ), 2 );
+INSERT INTO t3 VALUES( REPEAT( 'a', 65536 ), 3 );
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 1;
+LENGTH( GROUP_CONCAT( a ) )
+65534
+SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 2;
+LENGTH( GROUP_CONCAT( a ) )
+65535
+SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 3;
+LENGTH( GROUP_CONCAT( a ) )
+65535
+SET group_concat_max_len= DEFAULT;
+DROP TABLE t1, t2, t3;
End of 5.0 tests
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index f245d272ede..e5720cc1ee0 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -1330,4 +1330,51 @@ SELECT a,AVG(DISTINCT b) AS average FROM t1 GROUP BY a HAVING average > 50;
a average
1 32768.5000
DROP TABLE t1;
+CREATE TABLE t1 ( a INT, b INT, KEY(a) );
+INSERT INTO t1 VALUES (NULL, 1), (NULL, 2);
+EXPLAIN SELECT MIN(a), MIN(b) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2
+SELECT MIN(a), MIN(b) FROM t1;
+MIN(a) MIN(b)
+NULL 1
+CREATE TABLE t2( a INT, b INT, c INT, KEY(a, b) );
+INSERT INTO t2 ( a, b, c ) VALUES ( 1, NULL, 2 ), ( 1, 3, 4 ), ( 1, 4, 4 );
+EXPLAIN SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref a a 5 const 2 Using where
+SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
+MIN(b) MIN(c)
+3 2
+CREATE TABLE t3 (a INT, b INT, c int, KEY(a, b));
+INSERT INTO t3 VALUES (1, NULL, 1), (2, NULL, 2), (2, NULL, 2), (3, NULL, 3);
+EXPLAIN SELECT MIN(a), MIN(b) FROM t3 where a = 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+SELECT MIN(a), MIN(b) FROM t3 where a = 2;
+MIN(a) MIN(b)
+2 NULL
+CREATE TABLE t4 (a INT, b INT, c int, KEY(a, b));
+INSERT INTO t4 VALUES (1, 1, 1), (2, NULL, 2), (2, NULL, 2), (3, 1, 3);
+EXPLAIN SELECT MIN(a), MIN(b) FROM t4 where a = 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+SELECT MIN(a), MIN(b) FROM t4 where a = 2;
+MIN(a) MIN(b)
+2 NULL
+SELECT MIN(b), min(c) FROM t4 where a = 2;
+MIN(b) min(c)
+NULL 2
+CREATE TABLE t5( a INT, b INT, KEY( a, b) );
+INSERT INTO t5 VALUES( 1, 1 ), ( 1, 2 );
+EXPLAIN SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
+MIN(a) MIN(b)
+1 1
+SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1 and b > 1;
+MIN(a) MIN(b)
+1 2
+DROP TABLE t1, t2, t3, t4, t5;
End of 5.0 tests
diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result
index 87855091699..99b16d29eb9 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -431,15 +431,17 @@ insert into t2 values(13491727406643098568),
(0x8000000400000001),
(0x8000004000000001),
(0x8000040000000001);
-SELECT HEX(a) FROM t2 WHERE a IN (0xBB3C3E98175D33C8, 42);
+SELECT HEX(a) FROM t2 WHERE a IN
+(CAST(0xBB3C3E98175D33C8 AS UNSIGNED),
+42);
HEX(a)
BB3C3E98175D33C8
SELECT HEX(a) FROM t2 WHERE a IN
-(0xBB3C3E98175D33C8,
-0x7fffffffffffffff,
-0x8000000000000000,
-0x8000000000000400,
-0x8000000000000401,
+(CAST(0xBB3C3E98175D33C8 AS UNSIGNED),
+CAST(0x7fffffffffffffff AS UNSIGNED),
+CAST(0x8000000000000000 AS UNSIGNED),
+CAST(0x8000000000000400 AS UNSIGNED),
+CAST(0x8000000000000401 AS UNSIGNED),
42);
HEX(a)
BB3C3E98175D33C8
@@ -447,15 +449,22 @@ BB3C3E98175D33C8
8000000000000000
8000000000000400
8000000000000401
-SELECT HEX(a) FROM t2 WHERE a IN (0x7fffffffffffffff,0x8000000000000001);
+SELECT HEX(a) FROM t2 WHERE a IN
+(CAST(0x7fffffffffffffff AS UNSIGNED),
+CAST(0x8000000000000001 AS UNSIGNED));
HEX(a)
7FFFFFFFFFFFFFFF
8000000000000001
-SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff);
+SELECT HEX(a) FROM t2 WHERE a IN
+(CAST(0x7ffffffffffffffe AS UNSIGNED),
+CAST(0x7fffffffffffffff AS UNSIGNED));
HEX(a)
7FFFFFFFFFFFFFFE
7FFFFFFFFFFFFFFF
-SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff,'abc');
+SELECT HEX(a) FROM t2 WHERE a IN
+(0x7ffffffffffffffe,
+0x7fffffffffffffff,
+'abc');
HEX(a)
7FFFFFFFFFFFFFFE
7FFFFFFFFFFFFFFF
@@ -467,6 +476,7 @@ CREATE TABLE t4 (a DATE);
INSERT INTO t4 VALUES ('1972-02-06'), ('1972-07-29');
SELECT * FROM t4 WHERE a IN ('1972-02-06','19772-07-29');
a
+1972-02-06
Warnings:
Warning 1292 Incorrect date value: '19772-07-29' for column 'a' at row 1
DROP TABLE t1,t2,t3,t4;
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
index 4a6ec9a7ba0..dbae7e551e5 100644
--- a/mysql-test/r/func_sapdb.result
+++ b/mysql-test/r/func_sapdb.result
@@ -75,6 +75,12 @@ NULL
select weekofyear("1997-11-30 23:59:59.000001");
weekofyear("1997-11-30 23:59:59.000001")
48
+select makedate(03,1);
+makedate(03,1)
+2003-01-01
+select makedate('0003',1);
+makedate('0003',1)
+2003-01-01
select makedate(1997,1);
makedate(1997,1)
1997-01-01
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 6d014fbb71b..a4c51cca277 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -1105,4 +1105,23 @@ ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table '
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
DROP USER mysqltest_1@localhost;
+use test;
+CREATE TABLE t1 (f1 int, f2 int);
+INSERT INTO t1 VALUES(1,1), (2,2);
+CREATE DATABASE db27878;
+GRANT UPDATE(f1) ON t1 TO 'mysqltest_1'@'localhost';
+GRANT SELECT ON `test`.* TO 'mysqltest_1'@'localhost';
+GRANT ALL ON db27878.* TO 'mysqltest_1'@'localhost';
+use db27878;
+CREATE SQL SECURITY INVOKER VIEW db27878.v1 AS SELECT * FROM test.t1;
+use db27878;
+UPDATE v1 SET f2 = 4;
+ERROR HY000: View 'db27878.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+SELECT * FROM test.t1;
+f1 f2
+1 1
+2 2
+DROP DATABASE db27878;
+use test;
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result
index ff9b7bc6f1f..93098e68070 100644
--- a/mysql-test/r/grant2.result
+++ b/mysql-test/r/grant2.result
@@ -380,3 +380,27 @@ drop function f2;
drop table t2;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
drop user `a@`@localhost;
+drop database if exists mysqltest_1;
+drop database if exists mysqltest_2;
+drop user mysqltest_u1@localhost;
+create database mysqltest_1;
+create database mysqltest_2;
+grant all on mysqltest_1.* to mysqltest_u1@localhost;
+use mysqltest_2;
+create table t1 (i int);
+show create table mysqltest_2.t1;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1'
+create table t1 like mysqltest_2.t1;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1'
+grant select on mysqltest_2.t1 to mysqltest_u1@localhost;
+show create table mysqltest_2.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create table t1 like mysqltest_2.t1;
+use test;
+drop database mysqltest_1;
+drop database mysqltest_2;
+drop user mysqltest_u1@localhost;
+End of 5.0 tests
diff --git a/mysql-test/r/have_log_bin.require b/mysql-test/r/have_log_bin.require
new file mode 100644
index 00000000000..d4fd77e4f8d
--- /dev/null
+++ b/mysql-test/r/have_log_bin.require
@@ -0,0 +1,2 @@
+Variable_name Value
+log_bin ON
diff --git a/mysql-test/r/heap_hash.result b/mysql-test/r/heap_hash.result
index 80abcebbfea..cb47573b502 100644
--- a/mysql-test/r/heap_hash.result
+++ b/mysql-test/r/heap_hash.result
@@ -366,3 +366,19 @@ explain select a from t1 where a in (1,3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 4 Using where
drop table t1;
+End of 4.1 tests
+CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+col2 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES('A', 'A');
+INSERT INTO t1 VALUES('A ', 'A ');
+ERROR 23000: Duplicate entry 'A -A ' for key 1
+DROP TABLE t1;
+CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
+col2 VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
+UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES('A', 'A');
+INSERT INTO t1 VALUES('A ', 'A ');
+ERROR 23000: Duplicate entry 'A -A ' for key 1
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 009ae8776c3..34eb831e7db 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -144,6 +144,27 @@ SELECT * FROM t1;
c1 cnt
1a 2
DROP TABLE t1;
+CREATE TABLE t1 (
+a1 decimal(10,0) DEFAULT NULL,
+a2 blob,
+a3 time DEFAULT NULL,
+a4 blob,
+a5 char(175) DEFAULT NULL,
+a6 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+a7 tinyblob,
+INDEX idx (a6,a7(239),a5)
+) ENGINE=InnoDB;
+EXPLAIN SELECT a4 FROM t1 WHERE
+a6=NULL AND
+a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+EXPLAIN SELECT t1.a4 FROM t1, t1 t WHERE
+t.a6=t.a6 AND t1.a6=NULL AND
+t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+DROP TABLE t1;
End of 4.1 tests
create table t1m (a int) engine=myisam;
create table t1i (a int) engine=innodb;
@@ -544,4 +565,64 @@ id c counter
3 b 2
4 a 2
drop table t1;
+CREATE TABLE t1(
+id int AUTO_INCREMENT PRIMARY KEY,
+stat_id int NOT NULL,
+acct_id int DEFAULT NULL,
+INDEX idx1 (stat_id, acct_id),
+INDEX idx2 (acct_id)
+) ENGINE=MyISAM;
+CREATE TABLE t2(
+id int AUTO_INCREMENT PRIMARY KEY,
+stat_id int NOT NULL,
+acct_id int DEFAULT NULL,
+INDEX idx1 (stat_id, acct_id),
+INDEX idx2 (acct_id)
+) ENGINE=InnoDB;
+INSERT INTO t1(stat_id,acct_id) VALUES
+(1,759), (2,831), (3,785), (4,854), (1,921),
+(1,553), (2,589), (3,743), (2,827), (2,545),
+(4,779), (4,783), (1,597), (1,785), (4,832),
+(1,741), (1,833), (3,788), (2,973), (1,907);
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+UPDATE t1 SET acct_id=785
+WHERE MOD(stat_id,2)=0 AND MOD(id,stat_id)=MOD(acct_id,stat_id);
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+40960
+SELECT COUNT(*) FROM t1 WHERE acct_id=785;
+COUNT(*)
+8702
+EXPLAIN SELECT COUNT(*) FROM t1 WHERE stat_id IN (1,3) AND acct_id=785;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx1,idx2 idx1 9 NULL 2 Using where; Using index
+INSERT INTO t2 SELECT * FROM t1;
+OPTIMIZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 optimize status OK
+EXPLAIN SELECT COUNT(*) FROM t2 WHERE stat_id IN (1,3) AND acct_id=785;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range idx1,idx2 idx1 9 NULL 2 Using where; Using index
+DROP TABLE t1,t2;
+create table t1(a int) engine=innodb;
+alter table t1 comment '123';
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) default NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='123'
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index 7900e0b7695..8a0a3ba848c 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -63,7 +63,7 @@ insert into t1 values(NULL);
ERROR 23000: Column 'id' cannot be null
insert into t1 values (1), (NULL), (2);
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'id' at row 2
+Warning 1048 Column 'id' cannot be null
select * from t1;
id
1
@@ -346,3 +346,119 @@ f1 f2
12 NULL
drop view v1;
drop table t1,t2;
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+CREATE TABLE t1 (i INT);
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+INSERT INTO t1 VALUES (1);
+RETURN 1;
+END |
+CREATE FUNCTION f2() RETURNS INT
+BEGIN
+INSERT DELAYED INTO t1 VALUES (2);
+RETURN 1;
+END |
+SELECT f1();
+f1()
+1
+SELECT f2();
+f2()
+1
+INSERT INTO t1 VALUES (3);
+INSERT DELAYED INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (f1());
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+INSERT DELAYED INTO t1 VALUES (f1());
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+INSERT INTO t1 VALUES (f2());
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+INSERT DELAYED INTO t1 VALUES (f2());
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+INSERT INTO t1 VALUES (NEW.i);
+INSERT INTO t1 VALUES (1);
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+INSERT DELAYED INTO t1 VALUES (1);
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+SELECT * FROM t1;
+i
+1
+2
+3
+4
+DROP FUNCTION f2;
+DROP FUNCTION f1;
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (i INT);
+CREATE TABLE t2 (i INT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+INSERT DELAYED INTO t2 VALUES (NEW.i);
+CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
+INSERT DELAYED INTO t2 VALUES (NEW.i);
+CREATE TRIGGER t1_bd BEFORE DELETE ON t1 FOR EACH ROW
+INSERT DELAYED INTO t2 VALUES (OLD.i);
+INSERT INTO t1 VALUES (1);
+INSERT DELAYED INTO t1 VALUES (2);
+SELECT * FROM t1;
+i
+1
+2
+UPDATE t1 SET i = 3 WHERE i = 1;
+SELECT * FROM t1;
+i
+3
+2
+DELETE FROM t1 WHERE i = 3;
+SELECT * FROM t1;
+i
+2
+SELECT * FROM t2;
+i
+1
+2
+3
+3
+DROP TABLE t1, t2;
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (i INT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+SET @a= NEW.i;
+SET @a= 0;
+INSERT DELAYED INTO t1 VALUES (1);
+SELECT @a;
+@a
+1
+INSERT DELAYED INTO t1 VALUES (2);
+SELECT @a;
+@a
+2
+DROP TABLE t1;
+CREATE TABLE t1 (i INT);
+CREATE TABLE t2 (i INT);
+CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
+INSERT INTO t2 VALUES (NEW.i);
+CREATE TRIGGER t1_au AFTER UPDATE ON t1 FOR EACH ROW
+INSERT DELAYED INTO t2 VALUES (NEW.i);
+CREATE TRIGGER t1_ad AFTER DELETE ON t1 FOR EACH ROW
+INSERT DELAYED INTO t2 VALUES (OLD.i);
+INSERT DELAYED INTO t1 VALUES (1);
+SELECT * FROM t1;
+i
+1
+UPDATE t1 SET i = 2 WHERE i = 1;
+SELECT * FROM t1;
+i
+2
+DELETE FROM t1 WHERE i = 2;
+SELECT * FROM t1;
+i
+SELECT * FROM t2;
+i
+1
+2
+2
+DROP TABLE t1, t2;
+End of 5.0 tests.
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index a96add7eb9a..08a865e0b94 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -606,8 +606,8 @@ NULL 2 100
create table t2(No int not null, Field int not null, Count int not null);
insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2;
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'No' at row 1
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'No' at row 2
+Warning 1048 Column 'No' cannot be null
+Warning 1048 Column 'No' cannot be null
select * from t2;
No Field Count
0 1 100
diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result
index fd70fcb9084..b3bca7517f3 100644
--- a/mysql-test/r/insert_update.result
+++ b/mysql-test/r/insert_update.result
@@ -336,3 +336,60 @@ id f1
0 test1
DROP TABLE t1;
SET SQL_MODE='';
+CREATE TABLE t1 (
+id INT AUTO_INCREMENT PRIMARY KEY,
+c1 CHAR(1) UNIQUE KEY,
+cnt INT DEFAULT 1
+);
+INSERT INTO t1 (c1) VALUES ('A'), ('B'), ('C');
+SELECT * FROM t1;
+id c1 cnt
+1 A 1
+2 B 1
+3 C 1
+INSERT INTO t1 (c1) VALUES ('A'), ('X'), ('Y'), ('Z')
+ON DUPLICATE KEY UPDATE cnt=cnt+1;
+SELECT * FROM t1;
+id c1 cnt
+1 A 2
+2 B 1
+3 C 1
+4 X 1
+5 Y 1
+6 Z 1
+DROP TABLE t1;
+CREATE TABLE t1 (
+id INT AUTO_INCREMENT PRIMARY KEY,
+c1 INT NOT NULL,
+cnt INT DEFAULT 1
+);
+INSERT INTO t1 (id,c1) VALUES (1,10);
+SELECT * FROM t1;
+id c1 cnt
+1 10 1
+CREATE TABLE t2 (id INT, c1 INT);
+INSERT INTO t2 VALUES (1,NULL), (2,2);
+INSERT INTO t1 (id,c1) SELECT 1,NULL
+ON DUPLICATE KEY UPDATE c1=NULL;
+ERROR 23000: Column 'c1' cannot be null
+SELECT * FROM t1;
+id c1 cnt
+1 10 1
+INSERT IGNORE INTO t1 (id,c1) SELECT 1,NULL
+ON DUPLICATE KEY UPDATE c1=NULL, cnt=cnt+1;
+Warnings:
+Warning 1048 Column 'c1' cannot be null
+Error 1048 Column 'c1' cannot be null
+SELECT * FROM t1;
+id c1 cnt
+1 0 2
+INSERT IGNORE INTO t1 (id,c1) SELECT * FROM t2
+ON DUPLICATE KEY UPDATE c1=NULL, cnt=cnt+1;
+Warnings:
+Warning 1048 Column 'c1' cannot be null
+Error 1048 Column 'c1' cannot be null
+SELECT * FROM t1;
+id c1 cnt
+1 0 3
+2 2 1
+DROP TABLE t1;
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index c785c3be379..80dd055a170 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -391,6 +391,56 @@ i i i
2 NULL 4
2 2 2
drop table t1,t2,t3;
+CREATE TABLE t1 (a int, b int default 0, c int default 1);
+INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+INSERT INTO t1 (a) SELECT a + 8 FROM t1;
+INSERT INTO t1 (a) SELECT a + 16 FROM t1;
+CREATE TABLE t2 (a int, d int, e int default 0);
+INSERT INTO t2 (a, d) VALUES (1,1),(2,2),(3,3),(4,4);
+INSERT INTO t2 (a, d) SELECT a+4, a+4 FROM t2;
+INSERT INTO t2 (a, d) SELECT a+8, a+8 FROM t2;
+EXPLAIN
+SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e
+ORDER BY t1.b, t1.c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort
+1 SIMPLE t2 ALL NULL NULL NULL NULL 16 Using where
+SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e
+ORDER BY t1.b, t1.c;
+e
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+DROP TABLE t1,t2;
create table t1 (c int, b int);
create table t2 (a int, b int);
create table t3 (b int, c int);
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index df66336bd81..1366a8fe97a 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -1214,3 +1214,43 @@ SELECT * FROM t1 LEFT JOIN t2 USING(f1) WHERE f1='Bla';
f1 f2 f3
bla blah sheep
DROP TABLE t1,t2;
+CREATE TABLE t1 (id int PRIMARY KEY, a varchar(8));
+CREATE TABLE t2 (id int NOT NULL, b int NOT NULL, INDEX idx(id));
+INSERT INTO t1 VALUES
+(1,'aaaaaaa'), (5,'eeeeeee'), (4,'ddddddd'), (2,'bbbbbbb'), (3,'ccccccc');
+INSERT INTO t2 VALUES
+(3,10), (2,20), (5,30), (3,20), (5,10), (3,40), (3,30), (2,10), (2,40);
+EXPLAIN
+SELECT t1.id, a FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.b IS NULL;
+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 idx idx 4 test.t1.id 2 Using where; Not exists
+flush status;
+SELECT t1.id, a FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.b IS NULL;
+id a
+1 aaaaaaa
+4 ddddddd
+show status like 'Handler_read%';
+Variable_name Value
+Handler_read_first 0
+Handler_read_key 5
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 0
+Handler_read_rnd_next 6
+DROP TABLE t1,t2;
+CREATE TABLE t1 (c int PRIMARY KEY, e int NOT NULL);
+INSERT INTO t1 VALUES (1,0), (2,1);
+CREATE TABLE t2 (d int PRIMARY KEY);
+INSERT INTO t2 VALUES (1), (2), (3);
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d IS NULL;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
+1 SIMPLE t2 index NULL PRIMARY 4 NULL 3 Using where; Using index; Not exists
+SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d IS NULL;
+c e d
+1 0 NULL
+SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d<=>NULL;
+c e d
+1 0 NULL
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index ec15eaa97f5..5a707770ab8 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -159,8 +159,8 @@ CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,
UNIQUE (c,i));
INSERT INTO t1 (c) VALUES (NULL),(NULL);
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'c' at row 1
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'c' at row 2
+Warning 1048 Column 'c' cannot be null
+Warning 1048 Column 'c' cannot be null
SELECT * FROM t1;
c i
1
@@ -455,3 +455,11 @@ ORDER BY c.b, c.d
a b c d e f g h i j a b c d
2 2 1 2004-11-30 12:00:00 1 0 0 0 0 0 2 3388000 -553000 NULL
DROP TABLE t1, t2;
+CREATE TABLE t1( a TINYINT, KEY(a) ) ENGINE=MyISAM;
+INSERT INTO t1 VALUES( 1 );
+ALTER TABLE t1 DISABLE KEYS;
+EXPLAIN SELECT MAX(a) FROM t1 FORCE INDEX(a);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1
+DROP TABLE t1;
+End of 5.0 tests.
diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result
index cf5486d1091..a4966d9d5ec 100644
--- a/mysql-test/r/kill.result
+++ b/mysql-test/r/kill.result
@@ -41,3 +41,87 @@ select 1;
select RELEASE_LOCK("a");
RELEASE_LOCK("a")
1
+create table t1(f1 int);
+create function bug27563() returns int(11)
+deterministic
+begin
+declare continue handler for sqlstate '70100' set @a:= 'killed';
+declare continue handler for sqlexception set @a:= 'exception';
+set @a= get_lock("lock27563", 10);
+return 1;
+end|
+select get_lock("lock27563",10);
+get_lock("lock27563",10)
+1
+insert into t1 values (bug27563());
+ERROR 70100: Query execution was interrupted
+select @a;
+@a
+NULL
+select * from t1;
+f1
+insert into t1 values(0);
+update t1 set f1= bug27563();
+ERROR 70100: Query execution was interrupted
+select @a;
+@a
+NULL
+select * from t1;
+f1
+0
+insert into t1 values(1);
+delete from t1 where bug27563() is null;
+ERROR 70100: Query execution was interrupted
+select @a;
+@a
+NULL
+select * from t1;
+f1
+0
+1
+select * from t1 where f1= bug27563();
+ERROR 70100: Query execution was interrupted
+select @a;
+@a
+NULL
+create procedure proc27563()
+begin
+declare continue handler for sqlstate '70100' set @a:= 'killed';
+declare continue handler for sqlexception set @a:= 'exception';
+select get_lock("lock27563",10);
+select "shouldn't be selected";
+end|
+call proc27563();
+get_lock("lock27563",10)
+NULL
+ERROR 70100: Query execution was interrupted
+select @a;
+@a
+NULL
+create table t2 (f2 int);
+create trigger trg27563 before insert on t1 for each row
+begin
+declare continue handler for sqlstate '70100' set @a:= 'killed';
+declare continue handler for sqlexception set @a:= 'exception';
+set @a:= get_lock("lock27563",10);
+insert into t2 values(1);
+end|
+insert into t1 values(2),(3);
+ERROR 70100: Query execution was interrupted
+select @a;
+@a
+NULL
+select * from t1;
+f1
+0
+1
+select * from t2;
+f2
+select release_lock("lock27563");
+release_lock("lock27563")
+1
+drop table t1, t2;
+drop function bug27563;
+drop procedure proc27563;
+PREPARE stmt FROM 'EXPLAIN SELECT * FROM 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 WHERE a1=a2 AND a2=a3 AND a3=a4 AND a4=a5 AND a5=a6 AND a6=a7 AND a7=a8 AND a8=a9 AND a9=a10 AND a10=a11 AND a11=a12 AND a12=a13 AND a13=a14 AND a14=a15 AND a15=a16 AND a16=a17 AND a17=a18 AND a18=a19 AND a19=a20 AND a20=a21 AND a21=a22 AND a22=a23 AND a23=a24 AND a24=a25 AND a25=a26 AND a26=a27 AND a27=a28 AND a28=a29 AND a29=a30 AND a30=a31 AND a31=a32 AND a32=a33 AND a33=a34 AND a34=a35 AND a35=a36 AND a36=a37 AND a37=a38 AND a38=a39 AND a39=a40 ';
+EXECUTE stmt;
diff --git a/mysql-test/r/limit.result b/mysql-test/r/limit.result
index ac96ac8ff17..01d7d7ca218 100644
--- a/mysql-test/r/limit.result
+++ b/mysql-test/r/limit.result
@@ -91,3 +91,14 @@ select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
c
28
drop table t1;
+prepare s from "select 1 limit ?";
+set @a='qwe';
+execute s using @a;
+ERROR HY000: Incorrect arguments to EXECUTE
+prepare s from "select 1 limit 1, ?";
+execute s using @a;
+ERROR HY000: Incorrect arguments to EXECUTE
+prepare s from "select 1 limit ?, ?";
+execute s using @a, @a;
+ERROR HY000: Incorrect arguments to EXECUTE
+End of 5.0 tests
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 0478e48025f..a02aaccf8f6 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -165,3 +165,22 @@ f2
2
SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1,t2;
+create table t1(f1 int, f2 timestamp not null default current_timestamp);
+create table t2(f1 int);
+insert into t2 values(1),(2);
+Warnings:
+Warning 1261 Row 1 doesn't contain data for all columns
+Warning 1261 Row 2 doesn't contain data for all columns
+select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
+f1
+1
+2
+delete from t1;
+Warnings:
+Warning 1261 Row 1 doesn't contain data for all columns
+Warning 1261 Row 2 doesn't contain data for all columns
+select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
+f1
+1
+2
+drop table t1,t2;
diff --git a/mysql-test/r/long_tmpdir.result b/mysql-test/r/long_tmpdir.result
new file mode 100644
index 00000000000..7e6dd34ced1
--- /dev/null
+++ b/mysql-test/r/long_tmpdir.result
@@ -0,0 +1,3 @@
+create view v1 as select table_name from information_schema.tables;
+drop view v1;
+End of 5.0 tests
diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result
index 34e961395c4..d33fb038b79 100644
--- a/mysql-test/r/metadata.result
+++ b/mysql-test/r/metadata.result
@@ -130,3 +130,14 @@ def v3 renamed 8 12 0 Y 32896 0 63
renamed
drop table t1;
drop view v1,v2,v3;
+select a.* from (select 2147483648 as v_large) a;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def a v_large v_large 8 10 10 N 32769 0 63
+v_large
+2147483648
+select a.* from (select 214748364 as v_small) a;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def a v_small v_small 3 9 9 N 32769 0 63
+v_small
+214748364
+End of 5.0 tests
diff --git a/mysql-test/r/mix_innodb_myisam_binlog.result b/mysql-test/r/mix_innodb_myisam_binlog.result
index a8b132ae927..8fc5bfca3ef 100644
--- a/mysql-test/r/mix_innodb_myisam_binlog.result
+++ b/mysql-test/r/mix_innodb_myisam_binlog.result
@@ -11,7 +11,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 # use `test`; BEGIN
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(1)
master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
-master-bin.000001 347 Xid 1 # COMMIT /* xid=8 */
+master-bin.000001 347 Xid 1 # COMMIT /* XID */
delete from t1;
delete from t2;
reset master;
@@ -47,7 +47,7 @@ master-bin.000001 253 Query 1 # use `test`; savepoint my_savepoint
master-bin.000001 338 Query 1 # use `test`; insert into t1 values(4)
master-bin.000001 425 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 519 Query 1 # use `test`; rollback to savepoint my_savepoint
-master-bin.000001 616 Xid 1 # COMMIT /* xid=25 */
+master-bin.000001 616 Xid 1 # COMMIT /* XID */
delete from t1;
delete from t2;
reset master;
@@ -74,7 +74,7 @@ master-bin.000001 338 Query 1 # use `test`; insert into t1 values(6)
master-bin.000001 425 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 519 Query 1 # use `test`; rollback to savepoint my_savepoint
master-bin.000001 616 Query 1 # use `test`; insert into t1 values(7)
-master-bin.000001 703 Xid 1 # COMMIT /* xid=37 */
+master-bin.000001 703 Xid 1 # COMMIT /* XID */
delete from t1;
delete from t2;
reset master;
@@ -101,7 +101,7 @@ insert into t2 select * from t1;
show binlog events from 98;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 # use `test`; insert into t1 values(9)
-master-bin.000001 185 Xid 1 # COMMIT /* xid=60 */
+master-bin.000001 185 Xid 1 # COMMIT /* XID */
master-bin.000001 212 Query 1 # use `test`; insert into t2 select * from t1
delete from t1;
delete from t2;
@@ -112,18 +112,18 @@ insert into t2 select * from t1;
show binlog events from 98;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 # use `test`; insert into t1 values(10)
-master-bin.000001 186 Xid 1 # COMMIT /* xid=66 */
+master-bin.000001 186 Xid 1 # COMMIT /* XID */
master-bin.000001 213 Query 1 # use `test`; insert into t2 select * from t1
insert into t1 values(11);
commit;
show binlog events from 98;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 # use `test`; insert into t1 values(10)
-master-bin.000001 186 Xid 1 # COMMIT /* xid=66 */
+master-bin.000001 186 Xid 1 # COMMIT /* XID */
master-bin.000001 213 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 307 Query 1 # use `test`; BEGIN
master-bin.000001 375 Query 1 # use `test`; insert into t1 values(11)
-master-bin.000001 463 Xid 1 # COMMIT /* xid=68 */
+master-bin.000001 463 Xid 1 # COMMIT /* XID */
alter table t2 engine=INNODB;
delete from t1;
delete from t2;
@@ -137,7 +137,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 # use `test`; BEGIN
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(12)
master-bin.000001 254 Query 1 # use `test`; insert into t2 select * from t1
-master-bin.000001 348 Xid 1 # COMMIT /* xid=78 */
+master-bin.000001 348 Xid 1 # COMMIT /* XID */
delete from t1;
delete from t2;
reset master;
@@ -161,7 +161,7 @@ show binlog events from 98;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 # use `test`; BEGIN
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(14)
-master-bin.000001 254 Xid 1 # COMMIT /* xid=94 */
+master-bin.000001 254 Xid 1 # COMMIT /* XID */
delete from t1;
delete from t2;
reset master;
@@ -182,7 +182,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 # use `test`; BEGIN
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(16)
master-bin.000001 254 Query 1 # use `test`; insert into t1 values(18)
-master-bin.000001 342 Xid 1 # COMMIT /* xid=105 */
+master-bin.000001 342 Xid 1 # COMMIT /* XID */
delete from t1;
delete from t2;
alter table t2 type=MyISAM;
@@ -234,19 +234,19 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 # use `test`; BEGIN
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(16)
master-bin.000001 254 Query 1 # use `test`; insert into t1 values(18)
-master-bin.000001 342 Xid 1 # COMMIT /* xid=105 */
+master-bin.000001 342 Xid 1 # COMMIT /* XID */
master-bin.000001 369 Query 1 # use `test`; delete from t1
-master-bin.000001 446 Xid 1 # COMMIT /* xid=114 */
+master-bin.000001 446 Xid 1 # COMMIT /* XID */
master-bin.000001 473 Query 1 # use `test`; delete from t2
-master-bin.000001 550 Xid 1 # COMMIT /* xid=115 */
+master-bin.000001 550 Xid 1 # COMMIT /* XID */
master-bin.000001 577 Query 1 # use `test`; alter table t2 type=MyISAM
master-bin.000001 666 Query 1 # use `test`; insert into t1 values (1)
-master-bin.000001 754 Xid 1 # COMMIT /* xid=117 */
+master-bin.000001 754 Xid 1 # COMMIT /* XID */
master-bin.000001 781 Query 1 # use `test`; insert into t2 values (20)
master-bin.000001 870 Query 1 # use `test`; drop table t1,t2
master-bin.000001 949 Query 1 # use `test`; create temporary table ti (a int) engine=innodb
master-bin.000001 1059 Query 1 # use `test`; insert into ti values(1)
-master-bin.000001 1146 Xid 1 # COMMIT /* xid=132 */
+master-bin.000001 1146 Xid 1 # COMMIT /* XID */
master-bin.000001 1173 Query 1 # use `test`; create temporary table t1 (a int) engine=myisam
master-bin.000001 1283 Query 1 # use `test`; insert t1 values (1)
master-bin.000001 1366 Query 1 # use `test`; create table t0 (n int)
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 94f2f1f72b3..7fc29cd13ca 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -1780,4 +1780,30 @@ create table t3 (c1 int) engine=myisam pack_keys=default;
create table t4 (c1 int) engine=myisam pack_keys=2;
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 '2' at line 1
drop table t1, t2, t3;
+CREATE TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
+INSERT INTO t1(a,b) VALUES (1,1),(2,2),(3,3),(4,4),(5,5);
+SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
+a
+1
+ALTER TABLE t1 DISABLE KEYS;
+SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
+a
+1
+SELECT a FROM t1 USE INDEX (inx) WHERE a=1;
+a
+1
+SELECT b FROM t1 FORCE INDEX (uinx) WHERE b=1;
+b
+1
+SELECT b FROM t1 USE INDEX (uinx) WHERE b=1;
+b
+1
+SELECT a FROM t1 FORCE INDEX (inx,uinx) WHERE a=1;
+a
+1
+ALTER TABLE t1 ENABLE KEYS;
+SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
+a
+1
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index 0c32f413bd8..b3b606bd1fc 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -60,3 +60,22 @@ DROP USER mysqltest1@'%';
Run mysql_upgrade with a non existing server socket
mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect
FATAL ERROR: Upgrade failed
+set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
+mysql.columns_priv OK
+mysql.db OK
+mysql.func OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.host OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.user OK
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index d9198ffeb48..7865148905e 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -2238,7 +2238,6 @@ INSERT INTO `t1` VALUES (1,NULL),(2,NULL),(4,NULL),(11,NULL);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
-/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trg1` BEFORE INSERT ON `t1` FOR EACH ROW begin
@@ -2272,7 +2271,6 @@ LOCK TABLES `t2` WRITE;
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
UNLOCK TABLES;
-/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
DELIMITER ;;
/*!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 */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trg4` BEFORE INSERT ON `t2` FOR EACH ROW begin
@@ -2630,7 +2628,6 @@ INSERT INTO "t1 test" VALUES (1),(2),(3);
/*!40000 ALTER TABLE "t1 test" ENABLE KEYS */;
UNLOCK TABLES;
-/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN
@@ -2791,7 +2788,6 @@ LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
-/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="IGNORE_SPACE" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `tr1` BEFORE INSERT ON `t1` FOR EACH ROW BEGIN
@@ -3293,12 +3289,16 @@ create database mysqldump_test_db;
grant all privileges on mysqldump_test_db.* to user1;
grant all privileges on mysqldump_test_db.* to user2;
create procedure mysqldump_test_db.sp1() select 'hello';
+
+/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
DELIMITER ;;
-- insufficient privileges to SHOW CREATE PROCEDURE `sp1`
-- does user2 have permissions on mysql.proc?
DELIMITER ;
+
+/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
DELIMITER ;;
/*!50003 SET SESSION SQL_MODE=""*/;;
/*!50003 CREATE*/ /*!50020 DEFINER=`user1`@`%`*/ /*!50003 PROCEDURE `sp1`()
@@ -3310,5 +3310,16 @@ drop user user1;
drop user user2;
drop database mysqldump_test_db;
#
+# Bug #28522: buffer overrun by '\0' byte using --hex-blob.
+#
+CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
+INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
+CREATE TABLE `t1` (
+ `c1` int(11) default NULL,
+ `c2` longblob
+);
+INSERT INTO `t1` VALUES (11,0x7171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171);
+DROP TABLE t1;
+#
# End of 5.0 tests
#
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index c4ed4d8b19d..6f283677bf7 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -410,7 +410,6 @@ mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a 1'
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1 b c '
mysqltest: At line 1: Invalid integer argument "10!"
-mysqltest: At line 1: End of line junk detected: "!"
mysqltest: At line 1: Invalid integer argument "a"
mysqltest: At line 1: Missing required argument 'connection name' to command 'connect'
mysqltest: At line 1: Missing required argument 'connection name' to command 'connect'
@@ -557,6 +556,12 @@ a b c
2 Part 2 2007-04-05 00:00:00
2 Part 3 2007-04-05 00:00:00
select * from t1;
+a b c
+1 Line 1 2007-04-05 00:00:00
+2 Part 2 2007-04-05 00:00:00
+1 Line 1 2007-04-05 00:00:00
+2 Part 3 2007-04-05 00:00:00
+select * from t1;
select '';
@@ -572,4 +577,131 @@ hep
select "hepp";
hepp
hepp
+drop table t1;
+SELECT 2 as "my_col"
+UNION
+SELECT 1;
+my_col
+1
+2
+SELECT 2 as "my_col" UNION SELECT 1;
+my_col
+1
+2
+SELECT 2 as "my_col"
+UNION
+SELECT 1;
+my_col
+1
+2
+SELECT '2' as "3"
+UNION
+SELECT '1';
+3
+1
+2
+CREATE TABLE t1( a CHAR);
+SELECT * FROM t1;
+a
+DROP TABLE t1;
+SELECT NULL as "my_col1",2 AS "my_col2"
+UNION
+SELECT NULL,1;
+my_col1 my_col2
+NULL 2
+NULL 1
+SELECT NULL as "my_col1",2 AS "my_col2"
+UNION
+SELECT NULL,1;
+my_col1 my_col2
+NULL 1
+NULL 2
+SELECT 2 as "my_col1",NULL AS "my_col2"
+UNION
+SELECT 1,NULL;
+my_col1 my_col2
+2 NULL
+1 NULL
+SELECT 2 as "my_col1",NULL AS "my_col2"
+UNION
+SELECT 1,NULL;
+my_col1 my_col2
+1 NULL
+2 NULL
+SET @a = 17;
+SELECT 2 as "my_col"
+UNION
+SELECT 1;
+my_col
+2
+1
+SELECT 2 as "my_col"
+UNION
+SELECT 1;
+my_col
+1
+2
+SELECT '2' as "my_col1",2 as "my_col2"
+UNION
+SELECT '1',1 from t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
+SELECT '1' as "my_col1",2 as "my_col2"
+UNION
+SELECT '2',1;
+my_col1 my_col2
+# 1
+# 2
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 SET f1 = 1024;
+INSERT INTO t1 SELECT f1 - 1 FROM t1;
+INSERT INTO t1 SELECT f1 - 2 FROM t1;
+INSERT INTO t1 SELECT f1 - 4 FROM t1;
+INSERT INTO t1 SELECT f1 - 8 FROM t1;
+INSERT INTO t1 SELECT f1 - 16 FROM t1;
+INSERT INTO t1 SELECT f1 - 32 FROM t1;
+INSERT INTO t1 SELECT f1 - 64 FROM t1;
+INSERT INTO t1 SELECT f1 - 128 FROM t1;
+INSERT INTO t1 SELECT f1 - 256 FROM t1;
+INSERT INTO t1 SELECT f1 - 512 FROM t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+CREATE TABLE t1(
+a int, b varchar(255), c datetime
+);
+SHOW COLUMNS FROM t1;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+b varchar(255) YES NULL
+c datetime YES NULL
+statement=SHOW COLUMNS FROM t1 row_number=1, column_name="Type", Value=int(11)
+statement="SHOW COLUMNS FROM t1" row_number=1, column_name="Type", Value=int(11)
+statement=SHOW COLUMNS FROM t1 row_number=1, column_name=Default, Value=NULL
+value= ->A B<-
+value= 1
+mysqltest: At line 1: query_get_value - argument list started with '(' must be ended with ')'
+mysqltest: At line 1: Missing required argument 'query' to command 'query_get_value'
+mysqltest: At line 1: Missing required argument 'column name' to command 'query_get_value'
+mysqltest: At line 1: Missing required argument 'row number' to command 'query_get_value'
+value= No such row
+value= No such row
+mysqltest: At line 1: Invalid row number: 'notnumber'
+mysqltest: At line 1: Could not find column 'column_not_exists' in the result of 'SHOW COLUMNS FROM t1'
+mysqltest: At line 1: Query 'SET @A = 1' didn't return a result set
+mysqltest: At line 1: Could not find column '1 AS B' in the result of 'SELECT 1 AS A'
+value= No such row
+mysqltest: At line 1: Error running query 'SHOW COLNS FROM t1': 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLNS FROM t1' at line 1
+
+Field Type Null Key Default Extra
+a int(11) YES -><- NULL
+b varchar(255) YES -><- NULL
+c datetime YES -><- NULL
+
+Number of columns with Default NULL: 3
+
+SHOW COLUMNS FROM t1;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+b varchar(255) YES NULL
+c datetime YES NULL
+drop table t1;
End of tests
diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result
index fab10867acd..75ccc6cd39e 100644
--- a/mysql-test/r/ndb_basic.result
+++ b/mysql-test/r/ndb_basic.result
@@ -667,6 +667,12 @@ counter datavalue
57 newval
58 newval
drop table t1;
+create table t1 (a int primary key auto_increment) engine = ndb;
+insert into t1() values (),(),(),(),(),(),(),(),(),(),(),();
+insert into t1(a) values (20),(28);
+insert into t1() values (),(),(),(),(),(),(),(),(),(),(),();
+insert into t1() values (21), (22);
+drop table t1;
CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
select * from t1;
b
diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result
index 0818f9ce9ac..e7275bde2b8 100644
--- a/mysql-test/r/ndb_insert.result
+++ b/mysql-test/r/ndb_insert.result
@@ -649,3 +649,11 @@ pk a
6 NULL
7 4
DROP TABLE t1;
+create table t1(a int primary key, b int, unique key(b)) engine=ndb;
+insert ignore into t1 values (1,0), (2,0), (2,null), (3,null);
+select * from t1 order by a;
+a b
+1 0
+2 NULL
+3 NULL
+drop table t1;
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result
index daedfa50b80..c33adee76b2 100644
--- a/mysql-test/r/null.result
+++ b/mysql-test/r/null.result
@@ -97,39 +97,39 @@ Warnings:
Warning 1265 Data truncated for column 'd' at row 1
UPDATE t1 SET d=NULL;
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'd' at row 1
+Warning 1048 Column 'd' cannot be null
INSERT INTO t1 (a) values (null);
ERROR 23000: Column 'a' cannot be null
INSERT INTO t1 (a) values (1/null);
ERROR 23000: Column 'a' cannot be null
INSERT INTO t1 (a) values (null),(null);
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 1
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 2
+Warning 1048 Column 'a' cannot be null
+Warning 1048 Column 'a' cannot be null
INSERT INTO t1 (b) values (null);
ERROR 23000: Column 'b' cannot be null
INSERT INTO t1 (b) values (1/null);
ERROR 23000: Column 'b' cannot be null
INSERT INTO t1 (b) values (null),(null);
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'b' at row 1
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'b' at row 2
+Warning 1048 Column 'b' cannot be null
+Warning 1048 Column 'b' cannot be null
INSERT INTO t1 (c) values (null);
ERROR 23000: Column 'c' cannot be null
INSERT INTO t1 (c) values (1/null);
ERROR 23000: Column 'c' cannot be null
INSERT INTO t1 (c) values (null),(null);
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'c' at row 1
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'c' at row 2
+Warning 1048 Column 'c' cannot be null
+Warning 1048 Column 'c' cannot be null
INSERT INTO t1 (d) values (null);
ERROR 23000: Column 'd' cannot be null
INSERT INTO t1 (d) values (1/null);
ERROR 23000: Column 'd' cannot be null
INSERT INTO t1 (d) values (null),(null);
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'd' at row 1
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'd' at row 2
+Warning 1048 Column 'd' cannot be null
+Warning 1048 Column 'd' cannot be null
select * from t1;
a b c d
0 0000-00-00 00:00:00 0
diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result
index 0b4ed15f659..8a440284c53 100644
--- a/mysql-test/r/null_key.result
+++ b/mysql-test/r/null_key.result
@@ -342,7 +342,7 @@ index (id2)
);
insert into t1 values(null,null),(1,1);
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'id2' at row 1
+Warning 1048 Column 'id2' cannot be null
select * from t1;
id id2
NULL 0
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index b1c29a5aadb..4a54b17316d 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -696,8 +696,8 @@ CREATE VIEW v1 AS
SELECT a, LENGTH(a), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
DESC v1;
Field Type Null Key Default Extra
-a int(11) YES 0
-LENGTH(a) int(10) YES NULL
+a bigint(11) YES NULL
+LENGTH(a) bigint(10) YES NULL
COUNT(*) bigint(21) NO 0
SELECT * FROM v1;
a LENGTH(a) COUNT(*)
diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result
index 023c4ea205f..8503df545d2 100644
--- a/mysql-test/r/outfile.result
+++ b/mysql-test/r/outfile.result
Binary files differ
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 20bff6bda1c..482c9f42f42 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -26,11 +26,11 @@ ERROR HY000: Unknown prepared statement handler (no_such_statement) given to DEA
execute stmt1;
ERROR HY000: Incorrect arguments to EXECUTE
prepare stmt2 from 'prepare nested_stmt from "select 1"';
-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 '"select 1"' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt2 from 'execute stmt1';
-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 'stmt1' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt2 from 'deallocate prepare z';
-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 'z' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt3 from 'insert into t1 values (?,?)';
set @arg1=5, @arg2='five';
execute stmt3 using @arg1, @arg2;
@@ -1114,6 +1114,28 @@ execute stmt;
show create table t1;
drop table t1;
deallocate prepare stmt;
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (2), (3), (1);
+PREPARE st1 FROM
+'(SELECT a FROM t1) UNION (SELECT a+10 FROM t1) ORDER BY RAND()*0+a';
+EXECUTE st1;
+a
+1
+2
+3
+11
+12
+13
+EXECUTE st1;
+a
+1
+2
+3
+11
+12
+13
+DEALLOCATE PREPARE st1;
+DROP TABLE t1;
End of 4.1 tests.
create table t1 (a varchar(20));
insert into t1 values ('foo');
@@ -1661,4 +1683,13 @@ execute stmt;
ERROR 42S22: Unknown column 'y.value' in 'field list'
deallocate prepare stmt;
drop tables t1;
+prepare stmt from "create table t1 select ?";
+set @a=1.0;
+execute stmt using @a;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `?` decimal(2,1) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
End of 5.0 tests.
diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
index ac8ae6def9f..df4ec793325 100644
--- a/mysql-test/r/ps_1general.result
+++ b/mysql-test/r/ps_1general.result
@@ -391,11 +391,11 @@ drop table t5 ;
deallocate prepare stmt_do ;
deallocate prepare stmt_set ;
prepare stmt1 from ' prepare stmt2 from '' select 1 '' ' ;
-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 '' select 1 '' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' execute stmt2 ' ;
-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 'stmt2' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' deallocate prepare never_prepared ' ;
-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 'never_prepared' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt4 from ' use test ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt3 from ' create database mysqltest ';
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index 2b2a29b2122..06941cf6497 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -1304,7 +1304,7 @@ set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 1
+Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
0 two
@@ -1927,8 +1927,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -1974,8 +1974,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2024,8 +2024,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2064,8 +2064,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2112,8 +2112,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2156,8 +2156,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2202,8 +2202,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2240,8 +2240,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2961,20 +2961,26 @@ delete from t9 ;
test_sequence
-- insert into date/time columns --
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1264 Out of range value adjusted for column 'c13' at row 1
@@ -3005,6 +3011,7 @@ Warning 1265 Data truncated for column 'c15' at row 1
Warning 1264 Out of range value adjusted for column 'c16' at row 1
Warning 1264 Out of range value adjusted for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c15' at row 1
Warning 1264 Out of range value adjusted for column 'c16' at row 1
Warning 1264 Out of range value adjusted for column 'c17' at row 1
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index f30262ef219..235660cbbaf 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -1287,7 +1287,7 @@ set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 1
+Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
0 two
@@ -1910,8 +1910,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -1957,8 +1957,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2007,8 +2007,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2047,8 +2047,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2095,8 +2095,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2139,8 +2139,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2185,8 +2185,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2223,8 +2223,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2944,20 +2944,26 @@ delete from t9 ;
test_sequence
-- insert into date/time columns --
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1264 Out of range value adjusted for column 'c13' at row 1
@@ -2988,6 +2994,7 @@ Warning 1265 Data truncated for column 'c15' at row 1
Warning 1264 Out of range value adjusted for column 'c16' at row 1
Warning 1264 Out of range value adjusted for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c15' at row 1
Warning 1264 Out of range value adjusted for column 'c16' at row 1
Warning 1264 Out of range value adjusted for column 'c17' at row 1
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index a012e516404..bf77ec7acf2 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -1288,7 +1288,7 @@ set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 1
+Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
0 two
@@ -1911,8 +1911,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -1958,8 +1958,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2008,8 +2008,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2048,8 +2048,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2096,8 +2096,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2140,8 +2140,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2186,8 +2186,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2224,8 +2224,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2945,20 +2945,26 @@ delete from t9 ;
test_sequence
-- insert into date/time columns --
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1264 Out of range value adjusted for column 'c13' at row 1
@@ -2989,6 +2995,7 @@ Warning 1265 Data truncated for column 'c15' at row 1
Warning 1264 Out of range value adjusted for column 'c16' at row 1
Warning 1264 Out of range value adjusted for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c15' at row 1
Warning 1264 Out of range value adjusted for column 'c16' at row 1
Warning 1264 Out of range value adjusted for column 'c17' at row 1
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index ac9c8ae55ff..f6aa716d932 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -1330,7 +1330,7 @@ set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 1
+Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
0 two
@@ -1847,8 +1847,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -1894,8 +1894,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -1944,8 +1944,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -1984,8 +1984,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2032,8 +2032,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2076,8 +2076,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2122,8 +2122,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2160,8 +2160,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2881,20 +2881,26 @@ delete from t9 ;
test_sequence
-- insert into date/time columns --
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1264 Out of range value adjusted for column 'c13' at row 1
@@ -2925,6 +2931,7 @@ Warning 1265 Data truncated for column 'c15' at row 1
Warning 1264 Out of range value adjusted for column 'c16' at row 1
Warning 1264 Out of range value adjusted for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c15' at row 1
Warning 1264 Out of range value adjusted for column 'c16' at row 1
Warning 1264 Out of range value adjusted for column 'c17' at row 1
@@ -4344,7 +4351,7 @@ set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 1
+Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
0 two
@@ -4861,8 +4868,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -4908,8 +4915,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -4958,8 +4965,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -4998,8 +5005,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -5046,8 +5053,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -5090,8 +5097,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -5136,8 +5143,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -5174,8 +5181,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -5895,20 +5902,26 @@ delete from t9 ;
test_sequence
-- insert into date/time columns --
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1264 Out of range value adjusted for column 'c13' at row 1
@@ -5939,6 +5952,7 @@ Warning 1265 Data truncated for column 'c15' at row 1
Warning 1264 Out of range value adjusted for column 'c16' at row 1
Warning 1264 Out of range value adjusted for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c15' at row 1
Warning 1264 Out of range value adjusted for column 'c16' at row 1
Warning 1264 Out of range value adjusted for column 'c17' at row 1
diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result
index 407dddb6f53..2c8b40e8818 100644
--- a/mysql-test/r/ps_6bdb.result
+++ b/mysql-test/r/ps_6bdb.result
@@ -1287,7 +1287,7 @@ set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 1
+Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
0 two
@@ -1910,8 +1910,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -1957,8 +1957,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2007,8 +2007,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2047,8 +2047,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2095,8 +2095,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2139,8 +2139,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2185,8 +2185,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2223,8 +2223,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2944,20 +2944,26 @@ delete from t9 ;
test_sequence
-- insert into date/time columns --
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1264 Out of range value adjusted for column 'c13' at row 1
@@ -2988,6 +2994,7 @@ Warning 1265 Data truncated for column 'c15' at row 1
Warning 1264 Out of range value adjusted for column 'c16' at row 1
Warning 1264 Out of range value adjusted for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c15' at row 1
Warning 1264 Out of range value adjusted for column 'c16' at row 1
Warning 1264 Out of range value adjusted for column 'c17' at row 1
diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result
index 2673448489a..a0bbeed34ee 100644
--- a/mysql-test/r/ps_7ndb.result
+++ b/mysql-test/r/ps_7ndb.result
@@ -1287,7 +1287,7 @@ set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 1
+Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
0 two
@@ -1910,8 +1910,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -1957,8 +1957,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2007,8 +2007,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2047,8 +2047,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2095,8 +2095,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2139,8 +2139,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2185,8 +2185,8 @@ def @arg07 253 23 1 Y 128 31 63
def @arg08 253 23 1 Y 128 31 63
def @arg09 253 23 1 Y 128 31 63
def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
+def @arg11 253 83 6 Y 128 30 63
+def @arg12 253 83 6 Y 128 30 63
def @arg13 253 8192 10 Y 128 31 63
def @arg14 253 8192 19 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2223,8 +2223,8 @@ def @arg07 253 23 0 Y 128 31 63
def @arg08 253 23 0 Y 128 31 63
def @arg09 253 23 0 Y 128 31 63
def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
+def @arg11 253 83 0 Y 128 30 63
+def @arg12 253 83 0 Y 128 30 63
def @arg13 253 8192 0 Y 128 31 63
def @arg14 253 8192 0 Y 128 31 63
def @arg15 253 8192 19 Y 128 31 63
@@ -2944,20 +2944,26 @@ delete from t9 ;
test_sequence
-- insert into date/time columns --
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c17' at row 1
Warnings:
Warning 1264 Out of range value adjusted for column 'c13' at row 1
@@ -2988,6 +2994,7 @@ Warning 1265 Data truncated for column 'c15' at row 1
Warning 1264 Out of range value adjusted for column 'c16' at row 1
Warning 1264 Out of range value adjusted for column 'c17' at row 1
Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
Warning 1265 Data truncated for column 'c15' at row 1
Warning 1264 Out of range value adjusted for column 'c16' at row 1
Warning 1264 Out of range value adjusted for column 'c17' at row 1
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 151ddd95f84..53a0977a16a 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -1315,3 +1315,104 @@ insert into t1(c1) select c1 from v1;
drop table t1, t2, t3;
drop view v1;
set global query_cache_size=0;
+create table t1 (a int);
+insert into t1 values (1),(2),(3);
+set GLOBAL query_cache_type=1;
+set GLOBAL query_cache_limit=10000;
+set GLOBAL query_cache_min_res_unit=0;
+set GLOBAL query_cache_size= 100000;
+reset query cache;
+set LOCAL default_week_format = 0;
+select week('2007-01-04');
+week('2007-01-04')
+0
+select week('2007-01-04') from t1;
+week('2007-01-04')
+0
+0
+0
+select extract(WEEK FROM '2007-01-04') from t1;
+extract(WEEK FROM '2007-01-04')
+0
+0
+0
+set LOCAL default_week_format = 2;
+select week('2007-01-04');
+week('2007-01-04')
+53
+select week('2007-01-04') from t1;
+week('2007-01-04')
+53
+53
+53
+select extract(WEEK FROM '2007-01-04') from t1;
+extract(WEEK FROM '2007-01-04')
+53
+53
+53
+reset query cache;
+set LOCAL div_precision_increment=2;
+select 1/7;
+1/7
+0.14
+select 1/7 from t1;
+1/7
+0.14
+0.14
+0.14
+set LOCAL div_precision_increment=4;
+select 1/7;
+1/7
+0.1429
+select 1/7 from t1;
+1/7
+0.1429
+0.1429
+0.1429
+drop table t1;
+CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
+INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
+('Full-text indexes', 'are called collections'),
+('Only MyISAM tables','support collections'),
+('Function MATCH ... AGAINST()','is used to do a search'),
+('Full-text search in MySQL', 'implements vector space model');
+set GLOBAL ft_boolean_syntax='+ -><()~*:""&|';
+select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1;
+a b x
+MySQL has now support for full-text search 0
+Full-text indexes are called collections 1
+Only MyISAM tables support collections 0
+Function MATCH ... AGAINST() is used to do a search 0
+Full-text search in MySQL implements vector space model 0
+set GLOBAL ft_boolean_syntax='- +><()~*:""&|';
+select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1;
+a b x
+MySQL has now support for full-text search 0
+Full-text indexes are called collections 0
+Only MyISAM tables support collections 0
+Function MATCH ... AGAINST() is used to do a search 0
+Full-text search in MySQL implements vector space model 0
+create function change_global() returns integer
+begin
+set global ft_boolean_syntax='+ -><()~*:""&|';
+return 1;
+end|
+select *, change_global() from t1;
+a b change_global()
+MySQL has now support for full-text search 1
+Full-text indexes are called collections 1
+Only MyISAM tables support collections 1
+Function MATCH ... AGAINST() is used to do a search 1
+Full-text search in MySQL implements vector space model 1
+drop function change_global;
+drop table t1;
+set GLOBAL query_cache_type=default;
+set GLOBAL query_cache_limit=default;
+set GLOBAL query_cache_min_res_unit=default;
+set GLOBAL query_cache_size= default;
+set GLOBAL query_cache_size=1000000;
+create table t1 (a char);
+insert into t1 values ('c');
+a
+drop table t1;
+set GLOBAL query_cache_size= default;
diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/r/rpl_loaddata.result
index d69786c00a1..be137079c7a 100644
--- a/mysql-test/r/rpl_loaddata.result
+++ b/mysql-test/r/rpl_loaddata.result
@@ -80,3 +80,7 @@ ERROR 23000: Duplicate entry '2003-03-22' for key 1
drop table t2;
drop table t2;
drop table t1;
+CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
+LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;
+ERROR 23000: Duplicate entry 'Aarhus' for key 1
+DROP TABLE t1;
diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result
index bf2ef98c87f..df42e76a0c8 100644
--- a/mysql-test/r/rpl_rotate_logs.result
+++ b/mysql-test/r/rpl_rotate_logs.result
@@ -50,7 +50,10 @@ show binary logs;
Log_name File_size
master-bin.000002 363
master-bin.000003 407
-purge master logs before now();
+select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
+from information_schema.tables
+where TABLE_SCHEMA="test" and TABLE_NAME="t2";
+purge master logs before (@time_for_purge);
show binary logs;
Log_name File_size
master-bin.000003 407
diff --git a/mysql-test/r/rpl_user_variables.result b/mysql-test/r/rpl_user_variables.result
index 05f2b68042e..26ac2b26aaa 100644
--- a/mysql-test/r/rpl_user_variables.result
+++ b/mysql-test/r/rpl_user_variables.result
@@ -253,10 +253,44 @@ SELECT * from t2;
k
100
42
+drop table t1, t2;
+reset master;
+create table t1 (a int);
+prepare s from "insert into t1 values (@a),(?)";
+set @a=98;
+execute s using @a;
+prepare s from "insert into t1 values (?)";
+set @a=99;
+execute s using @a;
+prepare s from "insert into t1 select 100 limit ?";
+set @a=100;
+execute s using @a;
+show binlog events from 98;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 98 Query 1 184 use `test`; create table t1 (a int)
+slave-bin.000001 184 User var 2 226 @`a`=98
+slave-bin.000001 226 Query 1 320 use `test`; insert into t1 values (@a),(98)
+slave-bin.000001 320 Query 1 409 use `test`; insert into t1 values (99)
+slave-bin.000001 409 Query 1 507 use `test`; insert into t1 select 100 limit 100
+select * from t1;
+a
+98
+98
+99
+100
+drop table t1;
+create table t1(a int, b int);
+prepare s1 from 'insert into t1 values (@x:=@x+1, ?)';
+set @x=1;
+execute s1 using @x;
+select * from t1;
+a b
+2 1
+select * from t1;
+a b
+2 1
+drop table t1;
End of 5.0 tests.
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE IF EXISTS t1;
DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f2;
CREATE TABLE t1 (i INT);
diff --git a/mysql-test/r/rpl_view.result b/mysql-test/r/rpl_view.result
index be03f3f080a..be7ed6e8c2a 100644
--- a/mysql-test/r/rpl_view.result
+++ b/mysql-test/r/rpl_view.result
@@ -106,4 +106,10 @@ a b
1 6
drop table t1;
drop view v1;
+CREATE TABLE t1(a INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE VIEW v1 AS SELECT * FROM t1;
+ERROR 42S01: Table 'v1' already exists
+DROP VIEW v1;
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result
index 9d86a6bc08d..219f3c9b37a 100644
--- a/mysql-test/r/sp-code.result
+++ b/mysql-test/r/sp-code.result
@@ -620,4 +620,117 @@ SHOW PROCEDURE CODE p1;
Pos Instruction
0 stmt 2 "CREATE INDEX idx ON t1 (c1)"
DROP PROCEDURE p1;
+drop table if exists t1;
+drop procedure if exists proc_26977_broken;
+drop procedure if exists proc_26977_works;
+create table t1(a int unique);
+create procedure proc_26977_broken(v int)
+begin
+declare i int default 5;
+declare continue handler for sqlexception
+begin
+select 'caught something';
+retry:
+while i > 0 do
+begin
+set i = i - 1;
+select 'looping', i;
+end;
+end while retry;
+end;
+select 'do something';
+insert into t1 values (v);
+select 'do something again';
+insert into t1 values (v);
+end//
+create procedure proc_26977_works(v int)
+begin
+declare i int default 5;
+declare continue handler for sqlexception
+begin
+select 'caught something';
+retry:
+while i > 0 do
+begin
+set i = i - 1;
+select 'looping', i;
+end;
+end while retry;
+select 'optimizer: keep hreturn';
+end;
+select 'do something';
+insert into t1 values (v);
+select 'do something again';
+insert into t1 values (v);
+end//
+show procedure code proc_26977_broken;
+Pos Instruction
+0 set i@1 5
+1 hpush_jump 8 2 CONTINUE
+2 stmt 0 "select 'caught something'"
+3 jump_if_not 7(7) (i@1 > 0)
+4 set i@1 (i@1 - 1)
+5 stmt 0 "select 'looping', i"
+6 jump 3
+7 hreturn 2
+8 stmt 0 "select 'do something'"
+9 stmt 5 "insert into t1 values (v)"
+10 stmt 0 "select 'do something again'"
+11 stmt 5 "insert into t1 values (v)"
+12 hpop 1
+show procedure code proc_26977_works;
+Pos Instruction
+0 set i@1 5
+1 hpush_jump 9 2 CONTINUE
+2 stmt 0 "select 'caught something'"
+3 jump_if_not 7(7) (i@1 > 0)
+4 set i@1 (i@1 - 1)
+5 stmt 0 "select 'looping', i"
+6 jump 3
+7 stmt 0 "select 'optimizer: keep hreturn'"
+8 hreturn 2
+9 stmt 0 "select 'do something'"
+10 stmt 5 "insert into t1 values (v)"
+11 stmt 0 "select 'do something again'"
+12 stmt 5 "insert into t1 values (v)"
+13 hpop 1
+call proc_26977_broken(1);
+do something
+do something
+do something again
+do something again
+caught something
+caught something
+looping i
+looping 4
+looping i
+looping 3
+looping i
+looping 2
+looping i
+looping 1
+looping i
+looping 0
+call proc_26977_works(2);
+do something
+do something
+do something again
+do something again
+caught something
+caught something
+looping i
+looping 4
+looping i
+looping 3
+looping i
+looping 2
+looping i
+looping 1
+looping i
+looping 0
+optimizer: keep hreturn
+optimizer: keep hreturn
+drop table t1;
+drop procedure proc_26977_broken;
+drop procedure proc_26977_works;
End of 5.0 tests.
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index bdcb51c4db8..7a2f812cde4 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1030,7 +1030,7 @@ select bug12329();
bug12329()
101
execute stmt1;
-ERROR HY000: Table 't2' was not locked with LOCK TABLES
+ERROR 42S02: Table 'test.t2' doesn't exist
deallocate prepare stmt1;
drop function bug12329;
drop table t1, t2;
@@ -1152,12 +1152,12 @@ create trigger t1_ai after insert on t1 for each row insert into t2 values (new.
create view v1 as select * from t1;
drop table t2;
insert into v1 values (1);
-ERROR HY000: Table 't2' was not locked with LOCK TABLES
+ERROR 42S02: Table 'test.t2' doesn't exist
drop trigger t1_ai;
create function bug11555_1() returns int return (select max(i) from t2);
create trigger t1_ai after insert on t1 for each row set @a:=bug11555_1();
insert into v1 values (2);
-ERROR HY000: Table 't2' was not locked with LOCK TABLES
+ERROR 42S02: Table 'test.t2' doesn't exist
drop function bug11555_1;
drop table t1;
drop view v1;
diff --git a/mysql-test/r/sp-prelocking.result b/mysql-test/r/sp-prelocking.result
index 7d8dd862748..5eac54803f0 100644
--- a/mysql-test/r/sp-prelocking.result
+++ b/mysql-test/r/sp-prelocking.result
@@ -254,4 +254,17 @@ execute stmt;
deallocate prepare stmt;
drop function bug19634;
drop table t1, t2, t3;
+drop table if exists bug_27907_logs;
+drop table if exists bug_27907_t1;
+create table bug_27907_logs (a int);
+create table bug_27907_t1 (a int);
+create trigger bug_27907_t1_ai after insert on bug_27907_t1
+for each row
+begin
+insert into bug_27907_logs (a) values (1);
+end|
+drop table bug_27907_logs;
+insert into bug_27907_t1(a) values (1);
+ERROR 42S02: Table 'test.bug_27907_logs' doesn't exist
+drop table bug_27907_t1;
End of 5.0 tests
diff --git a/mysql-test/r/sp-vars.result b/mysql-test/r/sp-vars.result
index 6090dfdf737..f3eb40b3d70 100644
--- a/mysql-test/r/sp-vars.result
+++ b/mysql-test/r/sp-vars.result
@@ -690,12 +690,12 @@ END|
CALL p1(NOW());
Table Create Table
t1 CREATE TABLE "t1" (
- "x" varbinary(19) default NULL
+ "x" datetime default NULL
)
CALL p1('test');
Table Create Table
t1 CREATE TABLE "t1" (
- "x" varbinary(19) default NULL
+ "x" datetime default NULL
)
Warnings:
Warning 1264 Out of range value adjusted for column 'x' at row 1
@@ -1161,3 +1161,44 @@ CALL p1();
v_text
abc|def
DROP PROCEDURE p1;
+DROP PROCEDURE IF EXISTS bug27415_text_test|
+DROP PROCEDURE IF EXISTS bug27415_text_test2|
+CREATE PROCEDURE bug27415_text_test(entity_id_str_in text)
+BEGIN
+DECLARE str_remainder text;
+SET str_remainder = entity_id_str_in;
+select 'before substr', str_remainder;
+SET str_remainder = SUBSTRING(str_remainder, 3);
+select 'after substr', str_remainder;
+END|
+CREATE PROCEDURE bug27415_text_test2(entity_id_str_in text)
+BEGIN
+DECLARE str_remainder text;
+DECLARE str_remainder2 text;
+SET str_remainder2 = entity_id_str_in;
+select 'before substr', str_remainder2;
+SET str_remainder = SUBSTRING(str_remainder2, 3);
+select 'after substr', str_remainder;
+END|
+CALL bug27415_text_test('a,b,c')|
+before substr str_remainder
+before substr a,b,c
+after substr str_remainder
+after substr b,c
+CALL bug27415_text_test('a,b,c')|
+before substr str_remainder
+before substr a,b,c
+after substr str_remainder
+after substr b,c
+CALL bug27415_text_test2('a,b,c')|
+before substr str_remainder2
+before substr a,b,c
+after substr str_remainder
+after substr b,c
+CALL bug27415_text_test('a,b,c')|
+before substr str_remainder
+before substr a,b,c
+after substr str_remainder
+after substr b,c
+DROP PROCEDURE bug27415_text_test|
+DROP PROCEDURE bug27415_text_test2|
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 9ba6a356db2..b23cc146f60 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -4909,7 +4909,7 @@ create table t3 as select * from v1|
show create table t3|
Table Create Table
t3 CREATE TABLE `t3` (
- `j` int(11) default NULL
+ `j` bigint(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t3|
j
@@ -6018,6 +6018,8 @@ select bug20777(9223372036854775810) as '9223372036854775810 2**63+2';
select bug20777(-9223372036854775808) as 'lower bounds signed bigint';
lower bounds signed bigint
0
+Warnings:
+Warning 1264 Out of range value adjusted for column 'f1' at row 1
select bug20777(9223372036854775807) as 'upper bounds signed bigint';
upper bounds signed bigint
9223372036854775807
@@ -6030,9 +6032,13 @@ upper bounds unsigned bigint
select bug20777(18446744073709551616) as 'upper bounds unsigned bigint + 1';
upper bounds unsigned bigint + 1
18446744073709551615
+Warnings:
+Warning 1264 Out of range value adjusted for column 'f1' at row 1
select bug20777(-1) as 'lower bounds unsigned bigint - 1';
lower bounds unsigned bigint - 1
0
+Warnings:
+Warning 1264 Out of range value adjusted for column 'f1' at row 1
create table examplebug20777 as select
0 as 'i',
bug20777(9223372036854775806) as '2**63-2',
@@ -6044,7 +6050,12 @@ bug20777(18446744073709551615) as '2**64-1',
bug20777(18446744073709551616) as '2**64',
bug20777(0) as '0',
bug20777(-1) as '-1';
+Warnings:
+Warning 1264 Out of range value adjusted for column 'f1' at row 1
+Warning 1264 Out of range value adjusted for column 'f1' at row 1
insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809, 18446744073709551614, 18446744073709551615, 8446744073709551616, 0, -1);
+Warnings:
+Warning 1264 Out of range value adjusted for column '-1' at row 1
show create table examplebug20777;
Table Create Table
examplebug20777 CREATE TABLE `examplebug20777` (
@@ -6118,6 +6129,13 @@ Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
DROP FUNCTION bug5274_f1|
DROP FUNCTION bug5274_f2|
+drop procedure if exists proc_21513|
+create procedure proc_21513()`my_label`:BEGIN END|
+show create procedure proc_21513|
+Procedure sql_mode Create Procedure
+proc_21513 CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_21513`()
+`my_label`:BEGIN END
+drop procedure proc_21513|
End of 5.0 tests.
drop table t1,t2;
CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM;
@@ -6145,3 +6163,14 @@ count(*)
3
drop table t1,t2;
drop function bug27354;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE FUNCTION metered(a INT) RETURNS INT RETURN 12;
+CREATE VIEW v1 AS SELECT test.metered(a) as metered FROM t1;
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`metered`(`t1`.`a`) AS `metered` from `t1`
+DROP VIEW v1;
+DROP FUNCTION metered;
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result
index f09645703ba..564e31c9e32 100644
--- a/mysql-test/r/sp_trans.result
+++ b/mysql-test/r/sp_trans.result
@@ -530,24 +530,3 @@ count(*)
drop table t3, t4|
drop procedure bug14210|
set @@session.max_heap_table_size=default|
-drop function if exists bug23333|
-drop table if exists t1,t2|
-CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
-CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
-insert into t2 values (1,1)|
-create function bug23333()
-RETURNS int(11)
-DETERMINISTIC
-begin
-insert into t1 values (null);
-select count(*) from t1 into @a;
-return @a;
-end|
-reset master|
-insert into t2 values (bug23333(),1)|
-ERROR 23000: Duplicate entry '1' for key 1
-show binlog events from 98 /* with fixes for #23333 will show there is the query */|
-Log_name Pos Event_type Server_id End_log_pos Info
-select count(*),@a from t1 /* must be 1,1 */|
-count(*) @a
-1 1
diff --git a/mysql-test/r/sp_trans_log.result b/mysql-test/r/sp_trans_log.result
new file mode 100644
index 00000000000..96e6f76b23c
--- /dev/null
+++ b/mysql-test/r/sp_trans_log.result
@@ -0,0 +1,20 @@
+CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
+CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
+insert into t2 values (1,1)|
+create function bug23333()
+RETURNS int(11)
+DETERMINISTIC
+begin
+insert into t1 values (null);
+select count(*) from t1 into @a;
+return @a;
+end|
+reset master|
+insert into t2 values (bug23333(),1)|
+ERROR 23000: Duplicate entry '1' for key 1
+show binlog events from 98 /* with fixes for #23333 will show there is the query */|
+Log_name Pos Event_type Server_id End_log_pos Info
+select count(*),@a from t1 /* must be 1,1 */|
+count(*) @a
+1 1
+drop table t1, t2|
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index eecdc545be7..34869862a63 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -3,7 +3,7 @@ set @@sql_mode='ansi,traditional';
select @@sql_mode;
@@sql_mode
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,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 IF EXISTS t1;
+DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (col1 date);
INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29');
INSERT INTO t1 VALUES('0000-10-31');
@@ -206,6 +206,8 @@ INSERT INTO t1 (col1) VALUES (STR_TO_DATE('15.10.2004','%d.%m.%Y'));
INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
+Warnings:
+Note 1265 Data truncated for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
ERROR 22007: Incorrect date value: '2004-00-31 15:30:00' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
@@ -991,16 +993,16 @@ ERROR 23000: Column 'col2' cannot be null
INSERT INTO t1 VALUES (103,'',NULL);
ERROR 23000: Column 'col3' cannot be null
UPDATE t1 SET col1=NULL WHERE col1 =100;
-ERROR 22004: Column was set to data type implicit default; NULL supplied for NOT NULL column 'col1' at row 1
+ERROR 23000: Column 'col1' cannot be null
UPDATE t1 SET col2 =NULL WHERE col2 ='hello';
-ERROR 22004: Column was set to data type implicit default; NULL supplied for NOT NULL column 'col2' at row 1
+ERROR 23000: Column 'col2' cannot be null
UPDATE t1 SET col2 =NULL where col3 IS NOT NULL;
-ERROR 22004: Column was set to data type implicit default; NULL supplied for NOT NULL column 'col2' at row 1
+ERROR 23000: Column 'col2' cannot be null
INSERT IGNORE INTO t1 values (NULL,NULL,NULL);
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'col1' at row 1
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'col2' at row 1
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'col3' at row 1
+Warning 1048 Column 'col1' cannot be null
+Warning 1048 Column 'col2' cannot be null
+Warning 1048 Column 'col3' cannot be null
SELECT * FROM t1;
col1 col2 col3
100 hello 2004-08-20
@@ -1025,11 +1027,11 @@ ERROR HY000: Field 'col2' doesn't have a default value
INSERT INTO t1 (col1) SELECT 1;
ERROR HY000: Field 'col2' doesn't have a default value
INSERT INTO t1 SELECT 1,NULL;
-ERROR 22004: Column was set to data type implicit default; NULL supplied for NOT NULL column 'col2' at row 1
+ERROR 23000: Column 'col2' cannot be null
INSERT IGNORE INTO t1 values (NULL,NULL);
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'col1' at row 1
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'col2' at row 1
+Warning 1048 Column 'col1' cannot be null
+Warning 1048 Column 'col2' cannot be null
INSERT IGNORE INTO t1 (col1) values (3);
Warnings:
Warning 1364 Field 'col2' doesn't have a default value
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 06ff23b32b7..ba487cb859d 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -4034,4 +4034,51 @@ SUM( (SELECT AVG( (SELECT COUNT(*) FROM t1 t HAVING XXA < 12) ) FROM t2) )
FROM t1;
ERROR HY000: Invalid use of group function
DROP TABLE t1,t2;
+CREATE TABLE t1 (a int, b int, KEY (a));
+INSERT INTO t1 VALUES (1,1),(2,1);
+EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref a a 5 const 1 Using where; Using index
+2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+DROP TABLE t1;
+CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id));
+INSERT INTO t1 VALUES
+(3,'FL'), (2,'GA'), (4,'FL'), (1,'GA'), (5,'NY'), (7,'FL'), (6,'NY');
+CREATE TABLE t2 (id int NOT NULL, INDEX idx(id));
+INSERT INTO t2 VALUES (7), (5), (1), (3);
+SELECT id, st FROM t1
+WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
+id st
+3 FL
+1 GA
+7 FL
+SELECT id, st FROM t1
+WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
+GROUP BY id;
+id st
+1 GA
+3 FL
+7 FL
+SELECT id, st FROM t1
+WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
+id st
+2 GA
+4 FL
+SELECT id, st FROM t1
+WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
+GROUP BY id;
+id st
+2 GA
+4 FL
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (1), (2);
+EXPLAIN EXTENDED
+SELECT * FROM (SELECT count(*) FROM t1 GROUP BY a) as res;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
+2 DERIVED t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+Warnings:
+Note 1003 select `res`.`count(*)` AS `count(*)` from (select count(0) AS `count(*)` from `test`.`t1` group by `test`.`t1`.`a`) `res`
+DROP TABLE t1;
End of 5.0 tests.
diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
index f52249db8a1..098dacc8189 100644
--- a/mysql-test/r/subselect3.result
+++ b/mysql-test/r/subselect3.result
@@ -711,3 +711,52 @@ a
1
4
DROP TABLE t1,t2;
+CREATE TABLE t1 (id int);
+CREATE TABLE t2 (id int PRIMARY KEY);
+CREATE TABLE t3 (id int PRIMARY KEY, name varchar(10));
+INSERT INTO t1 VALUES (2), (NULL), (3), (1);
+INSERT INTO t2 VALUES (234), (345), (457);
+INSERT INTO t3 VALUES (222,'bbb'), (333,'ccc'), (111,'aaa');
+EXPLAIN
+SELECT * FROM t1
+WHERE t1.id NOT IN (SELECT t2.id FROM t2,t3
+WHERE t3.name='xxx' AND t2.id=t3.id);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+2 DEPENDENT SUBQUERY t2 eq_ref PRIMARY PRIMARY 4 func 1 Using where; Using index; Full scan on NULL key
+2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 func 1 Using where; Full scan on NULL key
+SELECT * FROM t1
+WHERE t1.id NOT IN (SELECT t2.id FROM t2,t3
+WHERE t3.name='xxx' AND t2.id=t3.id);
+id
+2
+NULL
+3
+1
+SELECT (t1.id IN (SELECT t2.id FROM t2,t3
+WHERE t3.name='xxx' AND t2.id=t3.id)) AS x
+FROM t1;
+x
+0
+0
+0
+0
+DROP TABLE t1,t2,t3;
+CREATE TABLE t1 (a INT NOT NULL);
+INSERT INTO t1 VALUES (1),(-1), (65),(66);
+CREATE TABLE t2 (a INT UNSIGNED NOT NULL PRIMARY KEY);
+INSERT INTO t2 VALUES (65),(66);
+SELECT a FROM t1 WHERE a NOT IN (65,66);
+a
+1
+-1
+SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
+a
+1
+-1
+EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY PRIMARY 4 func 1 Using index
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index 0a0be41927a..fd9b15ab8ed 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -820,9 +820,9 @@ call p1();
drop trigger t1_bi;
create trigger t1_bi after insert on t1 for each row insert into t3 values (new.id);
execute stmt1;
-ERROR HY000: Table 't3' was not locked with LOCK TABLES
+ERROR 42S02: Table 'test.t3' doesn't exist
call p1();
-ERROR HY000: Table 't3' was not locked with LOCK TABLES
+ERROR 42S02: Table 'test.t3' doesn't exist
deallocate prepare stmt1;
drop procedure p1;
drop table t1, t2, t3;
@@ -1414,4 +1414,63 @@ id val
DROP TRIGGER trg27006_a_insert;
DROP TRIGGER trg27006_a_update;
drop table t1,t2;
+drop table if exists t1, t2, t3;
+create table t1 (i int);
+create trigger t1_bi before insert on t1 for each row set new.i = 7;
+create trigger t1_ai after insert on t1 for each row set @a := 7;
+create table t2 (j int);
+insert into t2 values (1), (2);
+set @a:="";
+create table if not exists t1 select * from t2;
+Warnings:
+Note 1050 Table 't1' already exists
+select * from t1;
+i
+7
+7
+select @a;
+@a
+7
+drop trigger t1_bi;
+drop trigger t1_ai;
+create table t3 (isave int);
+create trigger t1_bi before insert on t1 for each row insert into t3 values (new.i);
+create table if not exists t1 select * from t2;
+Warnings:
+Note 1050 Table 't1' already exists
+select * from t1;
+i
+7
+7
+1
+2
+select * from t3;
+isave
+1
+2
+drop table t1, t2, t3;
+CREATE TABLE t1 (id INTEGER);
+CREATE TABLE t2 (id INTEGER);
+INSERT INTO t2 VALUES (1),(2);
+CREATE TRIGGER t1_test AFTER INSERT ON t1 FOR EACH ROW
+INSERT INTO t2 VALUES (new.id);
+SELECT GET_LOCK('B26162',20);
+GET_LOCK('B26162',20)
+1
+SELECT 'rl_acquirer', GET_LOCK('B26162',5), id FROM t2 WHERE id = 1;
+SET SESSION LOW_PRIORITY_UPDATES=1;
+SET GLOBAL LOW_PRIORITY_UPDATES=1;
+INSERT INTO t1 VALUES (5);
+SELECT 'rl_contender', id FROM t2 WHERE id > 1;
+SELECT RELEASE_LOCK('B26162');
+RELEASE_LOCK('B26162')
+0
+rl_acquirer GET_LOCK('B26162',5) id
+rl_acquirer 0 1
+rl_contender id
+rl_contender 2
+DROP TRIGGER t1_test;
+DROP TABLE t1,t2;
+SET SESSION LOW_PRIORITY_UPDATES=DEFAULT;
+SET GLOBAL LOW_PRIORITY_UPDATES=DEFAULT;
End of 5.0 tests
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index 644d4d971c6..9f51fc0371c 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -110,3 +110,29 @@ select 1 from t1 where cast('2000-01-01 12:01:01' as datetime) between start_dat
1
1
drop table t1;
+select @d:=1111, year(@d), month(@d), day(@d), cast(@d as date);
+@d:=1111 year(@d) month(@d) day(@d) cast(@d as date)
+1111 2000 11 11 2000-11-11
+select @d:=011111, year(@d), month(@d), day(@d), cast(@d as date);
+@d:=011111 year(@d) month(@d) day(@d) cast(@d as date)
+11111 2001 11 11 2001-11-11
+select @d:=1311, year(@d), month(@d), day(@d), cast(@d as date);
+@d:=1311 year(@d) month(@d) day(@d) cast(@d as date)
+1311 NULL NULL NULL NULL
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '1311'
+Warning 1292 Truncated incorrect datetime value: '1311'
+Warning 1292 Truncated incorrect datetime value: '1311'
+Warning 1292 Truncated incorrect datetime value: '1311'
+create table t1 (d date , dt datetime , ts timestamp);
+insert into t1 values (9912101,9912101,9912101);
+Warnings:
+Warning 1264 Out of range value adjusted for column 'd' at row 1
+Warning 1264 Out of range value adjusted for column 'dt' at row 1
+Warning 1265 Data truncated for column 'ts' at row 1
+insert into t1 values (11111,11111,11111);
+select * from t1;
+d dt ts
+0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00
+2001-11-11 2001-11-11 00:00:00 2001-11-11 00:00:00
+drop table t1;
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index 3a28410b7dc..ba02f19712a 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -192,6 +192,41 @@ CAST(CAST('2006-08-10 10:11:12' AS DATETIME) + INTERVAL 14 MICROSECOND AS DECIMA
SELECT CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6));
CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6))
101112.098700
+set @org_mode=@@sql_mode;
+create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03');
+Warnings:
+Note 1265 Data truncated for column 'da' at row 1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `da` date default '1962-03-03',
+ `dt` datetime default '1962-03-03 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ();
+insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
+Warnings:
+Note 1265 Data truncated for column 'da' at row 1
+set @@sql_mode='ansi,traditional';
+insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
+Warnings:
+Note 1265 Data truncated for column 'da' at row 1
+insert into t1 set dt='2007-03-23 13:49:38',da=dt;
+Warnings:
+Note 1265 Data truncated for column 'da' at row 1
+insert into t1 values ('2007-03-32','2007-03-23 13:49:38');
+ERROR 22007: Incorrect date value: '2007-03-32' for column 'da' at row 1
+select * from t1;
+da dt
+1962-03-03 1962-03-03 00:00:00
+2007-03-23 2007-03-23 13:49:38
+2007-03-23 2007-03-23 13:49:38
+2007-03-23 2007-03-23 13:49:38
+drop table t1;
+create table t1 (da date default '1962-03-32 23:33:34', dt datetime default '1962-03-03');
+ERROR 42000: Invalid default value for 'da'
+create table t1 (t time default '916:00:00 a');
+ERROR 42000: Invalid default value for 't'
+set @@sql_mode= @org_mode;
create table t1 (f1 date, f2 datetime, f3 timestamp);
insert into t1(f1) values(curdate());
select curdate() < now(), f1 < now(), cast(f1 as date) < now() from t1;
@@ -264,3 +299,115 @@ f2
SELECT 1 from dual where NOW() BETWEEN CURRENT_DATE() - INTERVAL 1 DAY AND CURRENT_DATE();
1
drop table t1;
+create table t1 (f1 date);
+insert into t1 values('01-01-01'),('01-01-02'),('01-01-03');
+select * from t1 where f1 in ('01-01-01','2001-01-02','2001-01-03 00:00:00');
+f1
+2001-01-01
+2001-01-02
+2001-01-03
+create table t2(f2 datetime);
+insert into t2 values('01-01-01 00:00:00'),('01-02-03 12:34:56'),('02-04-06 11:22:33');
+select * from t2 where f2 in ('01-01-01','01-02-03 12:34:56','01-02-03');
+f2
+2001-01-01 00:00:00
+2001-02-03 12:34:56
+select * from t1,t2 where '01-01-02' in (f1, cast(f2 as date));
+f1 f2
+2001-01-02 2001-01-01 00:00:00
+2001-01-02 2001-02-03 12:34:56
+2001-01-02 2002-04-06 11:22:33
+select * from t1,t2 where '01-01-01' in (f1, '01-02-03');
+f1 f2
+2001-01-01 2001-01-01 00:00:00
+2001-01-01 2001-02-03 12:34:56
+2001-01-01 2002-04-06 11:22:33
+select * from t1,t2 where if(1,'01-02-03 12:34:56','') in (f1, f2);
+f1 f2
+2001-01-01 2001-02-03 12:34:56
+2001-01-02 2001-02-03 12:34:56
+2001-01-03 2001-02-03 12:34:56
+create table t3(f3 varchar(20));
+insert into t3 select * from t2;
+select * from t2,t3 where f2 in (f3,'03-04-05');
+f2 f3
+2001-01-01 00:00:00 2001-01-01 00:00:00
+2001-02-03 12:34:56 2001-02-03 12:34:56
+2002-04-06 11:22:33 2002-04-06 11:22:33
+select f1,f2,f3 from t1,t2,t3 where (f1,'1') in ((f2,'1'),(f3,'1'));
+f1 f2 f3
+2001-01-01 2001-01-01 00:00:00 2001-01-01 00:00:00
+2001-01-01 2001-02-03 12:34:56 2001-01-01 00:00:00
+2001-01-01 2002-04-06 11:22:33 2001-01-01 00:00:00
+2001-01-01 2001-01-01 00:00:00 2001-02-03 12:34:56
+2001-01-01 2001-01-01 00:00:00 2002-04-06 11:22:33
+select f1 from t1 where ('1',f1) in (('1','01-01-01'),('1','2001-1-1 0:0:0'),('1','02-02-02'));
+f1
+2001-01-01
+drop table t1,t2,t3;
+select least(cast('01-01-01' as date), '01-01-02');
+least(cast('01-01-01' as date), '01-01-02')
+2001-01-01
+select greatest(cast('01-01-01' as date), '01-01-02');
+greatest(cast('01-01-01' as date), '01-01-02')
+01-01-02
+select least(cast('01-01-01' as date), '01-01-02') + 0;
+least(cast('01-01-01' as date), '01-01-02') + 0
+20010101
+select greatest(cast('01-01-01' as date), '01-01-02') + 0;
+greatest(cast('01-01-01' as date), '01-01-02') + 0
+20010102
+select least(cast('01-01-01' as datetime), '01-01-02') + 0;
+least(cast('01-01-01' as datetime), '01-01-02') + 0
+20010101000000
+select cast(least(cast('01-01-01' as datetime), '01-01-02') as signed);
+cast(least(cast('01-01-01' as datetime), '01-01-02') as signed)
+20010101000000
+select cast(least(cast('01-01-01' as datetime), '01-01-02') as decimal(20,2));
+cast(least(cast('01-01-01' as datetime), '01-01-02') as decimal(20,2))
+20010101000000.00
+DROP PROCEDURE IF EXISTS test27759 ;
+CREATE PROCEDURE test27759()
+BEGIN
+declare v_a date default '2007-4-10';
+declare v_b date default '2007-4-11';
+declare v_c datetime default '2004-4-9 0:0:0';
+select v_a as a,v_b as b,
+least( v_a, v_b ) as a_then_b,
+least( v_b, v_a ) as b_then_a,
+least( v_c, v_a ) as c_then_a;
+END;|
+call test27759();
+a b a_then_b b_then_a c_then_a
+2007-04-10 2007-04-11 2007-04-10 2007-04-10 2004-04-09 00:00:00
+drop procedure test27759;
+create table t1 (f1 date);
+insert into t1 values (curdate());
+select left(f1,10) = curdate() from t1;
+left(f1,10) = curdate()
+1
+drop table t1;
+create table t1(f1 date);
+insert into t1 values('01-01-01'),('02-02-02'),('01-01-01'),('02-02-02');
+set @bug28261='';
+select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
+if(@bug28261 = f1, '', @bug28261:= f1)
+2001-01-01
+2002-02-02
+2001-01-01
+2002-02-02
+Warnings:
+Warning 1292 Incorrect date value: '' for column 'f1' at row 1
+select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
+if(@bug28261 = f1, '', @bug28261:= f1)
+2001-01-01
+2002-02-02
+2001-01-01
+2002-02-02
+select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
+if(@bug28261 = f1, '', @bug28261:= f1)
+2001-01-01
+2002-02-02
+2001-01-01
+2002-02-02
+drop table t1;
diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result
index 2683201e25e..0b420c42cc7 100644
--- a/mysql-test/r/type_enum.result
+++ b/mysql-test/r/type_enum.result
@@ -1779,3 +1779,10 @@ create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
 !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\€','zz‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'));
ERROR 42000: Field separator argument is not what is expected; check the manual
End of 4.1 tests
+create table t1(f1 set('a','b'), index(f1));
+insert into t1 values(''),(''),('a'),('b');
+select * from t1 where f1='';
+f1
+
+
+drop table t1;
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index 188963c5bdf..53844d2cfe2 100644
--- a/mysql-test/r/type_float.result
+++ b/mysql-test/r/type_float.result
@@ -344,3 +344,36 @@ create table t1 (s1 float(0,2));
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1').
create table t1 (s1 float(1,2));
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1').
+create table t1 (f1 double(200, 0));
+insert into t1 values (1e199), (-1e199);
+insert into t1 values (1e200), (-1e200);
+insert into t1 values (2e200), (-2e200);
+Warnings:
+Warning 1264 Out of range value adjusted for column 'f1' at row 1
+Warning 1264 Out of range value adjusted for column 'f1' at row 2
+select f1 + 0e0 from t1;
+f1 + 0e0
+1e+199
+-1e+199
+1e+200
+-1e+200
+1e+200
+-1e+200
+drop table t1;
+create table t1 (f1 float(30, 0));
+insert into t1 values (1e29), (-1e29);
+insert into t1 values (1e30), (-1e30);
+insert into t1 values (2e30), (-2e30);
+Warnings:
+Warning 1264 Out of range value adjusted for column 'f1' at row 1
+Warning 1264 Out of range value adjusted for column 'f1' at row 2
+select f1 + 0e0 from t1;
+f1 + 0e0
+1.0000000150475e+29
+-1.0000000150475e+29
+1.0000000150475e+30
+-1.0000000150475e+30
+1.0000000150475e+30
+-1.0000000150475e+30
+drop table t1;
+End of 5.0 tests
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index c103de81bd7..9e165721033 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -1430,4 +1430,45 @@ select * from t1;
a
123456789012345678
drop table t1;
+select cast(11.1234 as DECIMAL(3,2));
+cast(11.1234 as DECIMAL(3,2))
+9.99
+Warnings:
+Error 1264 Out of range value adjusted for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
+select * from (select cast(11.1234 as DECIMAL(3,2))) t;
+cast(11.1234 as DECIMAL(3,2))
+9.99
+Warnings:
+Error 1264 Out of range value adjusted for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
+select cast(a as DECIMAL(3,2))
+from (select 11.1233 as a
+UNION select 11.1234
+UNION select 12.1234
+) t;
+cast(a as DECIMAL(3,2))
+9.99
+9.99
+9.99
+Warnings:
+Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1
+Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1
+Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1
+select cast(a as DECIMAL(3,2)), count(*)
+from (select 11.1233 as a
+UNION select 11.1234
+UNION select 12.1234
+) t group by 1;
+cast(a as DECIMAL(3,2)) count(*)
+9.99 3
+Warnings:
+Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1
+Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1
+Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1
+Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1
+create table t1 (s varchar(100));
+insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875);
+drop table t1;
+SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b;
+a b
+0.9999999999999800000000000000 0.9999999999999800000000000000
End of 5.0 tests
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index 753c982155c..80b5dccc198 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -317,3 +317,39 @@ SHOW COUNT(*) WARNINGS;
SHOW COUNT(*) ERRORS;
@@session.error_count
1
+create table t1(f1 int, f2 varchar(2), f3 float, f4 decimal(2,1));
+insert into t1 values
+(1, "a", 1.5, 1.6), (1, "a", 1.5, 1.6), (2, "b", 2.5, 2.6),
+(3, "c", 3.5, 3.6), (4, "d", 4.5, 4.6), (1, "a", 1.5, 1.6),
+(3, "c", 3.5, 3.6), (1, "a", 1.5, 1.6);
+select @a:=f1, count(f1) from t1 group by 1 desc;
+@a:=f1 count(f1)
+4 1
+3 2
+2 1
+1 4
+select @a:=f1, count(f1) from t1 group by 1 asc;
+@a:=f1 count(f1)
+1 4
+2 1
+3 2
+4 1
+select @a:=f2, count(f2) from t1 group by 1 desc;
+@a:=f2 count(f2)
+d 1
+c 2
+b 1
+a 4
+select @a:=f3, count(f3) from t1 group by 1 desc;
+@a:=f3 count(f3)
+4.5 1
+3.5 2
+2.5 1
+1.5 4
+select @a:=f4, count(f4) from t1 group by 1 desc;
+@a:=f4 count(f4)
+4.6 1
+3.6 2
+2.6 1
+1.6 4
+drop table t1;
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 70dd6b2550f..43e147724c8 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -1497,7 +1497,7 @@ insert into v3(b) values (10);
insert into v3(a) select a from t2;
insert into v3(b) select b from t2;
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 2
+Warning 1048 Column 'a' cannot be null
insert into v3(a) values (1) on duplicate key update a=a+10000+VALUES(a);
select * from t1;
a b
@@ -1789,7 +1789,7 @@ drop table t1;
create view v1 as select cast(1 as decimal);
select * from v1;
cast(1 as decimal)
-1.00
+1
drop view v1;
create table t1(f1 int);
create table t2(f2 int);
@@ -2779,7 +2779,7 @@ CREATE TABLE t1 (i int, j int);
CREATE VIEW v1 AS SELECT COALESCE(i,j) FROM t1;
DESCRIBE v1;
Field Type Null Key Default Extra
-COALESCE(i,j) int(11) YES NULL
+COALESCE(i,j) bigint(11) YES NULL
CREATE TABLE t2 SELECT COALESCE(i,j) FROM t1;
DESCRIBE t2;
Field Type Null Key Default Extra
@@ -3354,4 +3354,105 @@ id select_type table type possible_keys key key_len ref rows Extra
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL Using filesort
DROP VIEW v1;
DROP TABLE t1;
+CREATE VIEW v1 AS SELECT CAST( 1.23456789 AS DECIMAL( 7,5 ) ) AS col;
+SELECT * FROM v1;
+col
+1.23457
+DESCRIBE v1;
+Field Type Null Key Default Extra
+col decimal(7,5) NO 0.00000
+DROP VIEW v1;
+CREATE VIEW v1 AS SELECT CAST(1.23456789 AS DECIMAL(8,0)) AS col;
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(1.23456789 as decimal(8,0)) AS `col`
+DROP VIEW v1;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT, c INT DEFAULT 0);
+INSERT INTO t1 (a) VALUES (1), (2);
+INSERT INTO t2 (b) VALUES (1), (2);
+CREATE VIEW v1 AS SELECT t2.b,t2.c FROM t1, t2
+WHERE t1.a=t2.b AND t2.b < 3 WITH CHECK OPTION;
+SELECT * FROM v1;
+b c
+1 0
+2 0
+UPDATE v1 SET c=1 WHERE b=1;
+SELECT * FROM v1;
+b c
+1 1
+2 0
+DROP VIEW v1;
+DROP TABLE t1,t2;
+CREATE TABLE t1 (id int);
+CREATE TABLE t2 (id int, c int DEFAULT 0);
+INSERT INTO t1 (id) VALUES (1);
+INSERT INTO t2 (id) VALUES (1);
+CREATE VIEW v1 AS
+SELECT t2.c FROM t1, t2
+WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
+UPDATE v1 SET c=1;
+DROP VIEW v1;
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a1 INT, c INT DEFAULT 0);
+CREATE TABLE t2 (a2 INT);
+CREATE TABLE t3 (a3 INT);
+CREATE TABLE t4 (a4 INT);
+INSERT INTO t1 (a1) VALUES (1),(2);
+INSERT INTO t2 (a2) VALUES (1),(2);
+INSERT INTO t3 (a3) VALUES (1),(2);
+INSERT INTO t4 (a4) VALUES (1),(2);
+CREATE VIEW v1 AS
+SELECT t1.a1, t1.c FROM t1 JOIN t2 ON t1.a1=t2.a2 AND t1.c < 3
+WITH CHECK OPTION;
+SELECT * FROM v1;
+a1 c
+1 0
+2 0
+UPDATE v1 SET c=3;
+ERROR HY000: CHECK OPTION failed 'test.v1'
+PREPARE t FROM 'UPDATE v1 SET c=3';
+EXECUTE t;
+ERROR HY000: CHECK OPTION failed 'test.v1'
+EXECUTE t;
+ERROR HY000: CHECK OPTION failed 'test.v1'
+INSERT INTO v1(a1, c) VALUES (3, 3);
+ERROR HY000: CHECK OPTION failed 'test.v1'
+UPDATE v1 SET c=1 WHERE a1=1;
+SELECT * FROM v1;
+a1 c
+1 1
+2 0
+SELECT * FROM t1;
+a1 c
+1 1
+2 0
+CREATE VIEW v2 AS SELECT t1.a1, t1.c
+FROM (t1 JOIN t2 ON t1.a1=t2.a2 AND t1.c < 3)
+JOIN (t3 JOIN t4 ON t3.a3=t4.a4)
+ON t2.a2=t3.a3 WITH CHECK OPTION;
+SELECT * FROM v2;
+a1 c
+1 1
+2 0
+UPDATE v2 SET c=3;
+ERROR HY000: CHECK OPTION failed 'test.v2'
+PREPARE t FROM 'UPDATE v2 SET c=3';
+EXECUTE t;
+ERROR HY000: CHECK OPTION failed 'test.v2'
+EXECUTE t;
+ERROR HY000: CHECK OPTION failed 'test.v2'
+INSERT INTO v2(a1, c) VALUES (3, 3);
+ERROR HY000: CHECK OPTION failed 'test.v2'
+UPDATE v2 SET c=2 WHERE a1=1;
+SELECT * FROM v2;
+a1 c
+1 2
+2 0
+SELECT * FROM t1;
+a1 c
+1 2
+2 0
+DROP VIEW v1,v2;
+DROP TABLE t1,t2,t3,t4;
End of 5.0 tests.
diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result
index 32dffa305e5..0f9ce47dec6 100644
--- a/mysql-test/r/view_grant.result
+++ b/mysql-test/r/view_grant.result
@@ -601,9 +601,9 @@ Warnings:
Note 1449 There is no 'no-such-user'@'localhost' registered
SHOW CREATE VIEW v;
View Create View
-v CREATE ALGORITHM=UNDEFINED DEFINER=`no-such-user`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `t1`.`a` AS `a` from `t1`
+v CREATE ALGORITHM=UNDEFINED DEFINER=`no-such-user`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `test`.`t1`.`a` AS `a` from `t1`
Warnings:
-Note 1449 There is no 'no-such-user'@'localhost' registered
+Warning 1356 View 'test.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM v;
ERROR HY000: There is no 'no-such-user'@'localhost' registered
DROP VIEW v;
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index d0ad4ca6648..9ce1f9c825d 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -86,7 +86,7 @@ drop table t1;
create table t1(a tinyint NOT NULL, b tinyint unsigned, c char(5));
insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 1
+Warning 1048 Column 'a' cannot be null
Warning 1264 Out of range value adjusted for column 'b' at row 2
Warning 1265 Data truncated for column 'c' at row 2
Warning 1264 Out of range value adjusted for column 'a' at row 3
@@ -99,7 +99,7 @@ Warning 1265 Data truncated for column 'c' at row 2
alter table t1 add d char(2);
update t1 set a=NULL where a=10;
Warnings:
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 2
+Warning 1048 Column 'a' cannot be null
update t1 set c='mysql ab' where c='test';
Warnings:
Warning 1265 Data truncated for column 'c' at row 4
@@ -115,7 +115,7 @@ Warnings:
Warning 1265 Data truncated for column 'b' at row 1
Warning 1265 Data truncated for column 'b' at row 2
Warning 1265 Data truncated for column 'b' at row 3
-Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 4
+Warning 1048 Column 'a' cannot be null
Warning 1265 Data truncated for column 'b' at row 4
insert into t2(b) values('mysqlab');
Warnings:
diff --git a/mysql-test/suite/funcs_1/datadict/datadict_load.inc b/mysql-test/suite/funcs_1/datadict/datadict_load.inc
index 2842703f2f8..4a9bdc9356d 100644
--- a/mysql-test/suite/funcs_1/datadict/datadict_load.inc
+++ b/mysql-test/suite/funcs_1/datadict/datadict_load.inc
@@ -44,7 +44,8 @@ if (0)
# ------------------------------------------------------------------------------
# prepare a variable to be able to suppress machine dependant diffs
# this can be used in: --replace_result $SERVER_NAME <SERVER_NAME>
-let $SERVER_NAME= `SELECT DISTINCT host FROM mysql.user WHERE host LIKE "%\%" AND host NOT In ("localhost", "127.0.0.1", "%")`;
+# let $SERVER_NAME= `SELECT DISTINCT host FROM mysql.user WHERE host LIKE "%\%" AND host NOT In ("localhost", "127.0.0.1", "%")`;
+let $SERVER_NAME= `SELECT DISTINCT host FROM mysql.user WHERE host NOT In ("localhost", "127.0.0.1", "%")`;
################################################################################
diff --git a/mysql-test/suite/funcs_1/datadict/datadict_master.inc b/mysql-test/suite/funcs_1/datadict/datadict_master.inc
index 96185cafdda..03d3eeb3777 100644
--- a/mysql-test/suite/funcs_1/datadict/datadict_master.inc
+++ b/mysql-test/suite/funcs_1/datadict/datadict_master.inc
@@ -105,7 +105,7 @@ SELECT DISTINCT u,
AS Server_Clean
FROM db_datadict.vu1;
--replace_result $SERVER_NAME <SERVER_NAME>
-SELECT * FROM db_datadict.vu;
+SELECT * FROM db_datadict.vu order by u;
delimiter //;
CREATE PROCEDURE db_datadict.sp_1()
@@ -141,8 +141,9 @@ if ($have_bug_11589)
# 13 DATA_FREE
# 15 CREATE_TIME
# 16 UPDATE_TIME
+# 17 CHECK_TIME
# 20 CREATE_OPTIONS
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
+--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
SELECT * FROM tables
WHERE table_schema = 'information_schema';
# 9 AVG_ROW_LENGTH
@@ -152,7 +153,8 @@ SELECT * FROM tables
# 13 DATA_FREE
# 15 CREATE_TIME
# 16 UPDATE_TIME
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss"
+# 17 CHECK_TIME
+--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
SELECT * FROM tables
WHERE NOT( table_schema = 'information_schema');
--horizontal_results
@@ -177,7 +179,7 @@ select count(*) from routines;
select * from statistics;
select * from views;
--replace_result $SERVER_NAME <SERVER_NAME>
-select * from user_privileges;
+select * from user_privileges order by grantee, privilege_type;
select * from schema_privileges;
select * from table_privileges;
select * from column_privileges;
@@ -199,7 +201,8 @@ select concat("Table or view '", table_name,
--replace_result $SERVER_NAME <SERVER_NAME>
select grantee as "user's having select privilege",
substring( grantee, length(SUBSTRING_INDEX(grantee,_utf8'@',1))+2 )
- from user_privileges where privilege_type = 'select';
+ from user_privileges where privilege_type = 'select'
+ order by grantee;
select all table_schema from schema_privileges limit 0,5;
@@ -293,13 +296,14 @@ select * from information_schema.schemata ORDER BY 2 DESC;
# 13 DATA_FREE
# 15 CREATE_TIME
# 16 UPDATE_TIME
+# 17 CHRCK_TIME
# 20 CREATE_OPTIONS
if ($have_bug_11589)
{
--disable_ps_protocol
}
--vertical_results
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
+--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
# 9 AVG_ROW_LENGTH
@@ -309,7 +313,8 @@ SELECT * FROM information_schema.tables
# 13 DATA_FREE
# 15 CREATE_TIME
# 16 UPDATE_TIME
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss"
+# 17 CHRCK_TIME
+--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
--horizontal_results
@@ -385,7 +390,7 @@ select concat(table_schema, ', ', table_name) "Table_info"
from tables ORDER BY 1;
--replace_result $SERVER_NAME <SERVER_NAME>
-select distinct grantee from user_privileges;
+select distinct grantee from user_privileges order by grantee, privilege_type;
select * from schema_privileges where table_catalog is null limit 0, 5;
select * from table_privileges where grantee like '%r%' limit 0, 5;
@@ -399,7 +404,7 @@ select * from schemata limit 0,5;
--replace_result $SERVER_NAME <SERVER_NAME>
select distinct grantee from user_privileges;
--replace_result $SERVER_NAME <SERVER_NAME>
-select all grantee from user_privileges;
+select all grantee from user_privileges order by grantee, privilege_type;
select id , character_set_name from collations order by id asc limit 10;
@@ -455,8 +460,9 @@ eval SELECT *
LINES TERMINATED BY '\n'
FROM information_schema.schemata
WHERE schema_name LIKE 'db_%';
-# FIXME: why do we get different error numbers with and without OUTFILE ?
-#FIXME this should fail! --error 1146
+# The above will fail with access error as long as
+# BUBG#28181 - a regression introduced in 5.0.42 is not fixed
+
eval SELECT *
FROM information_schema.schemata
WHERE schema_name LIKE 'db_%';
@@ -469,7 +475,9 @@ eval SELECT *
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM schemata LIMIT 0, 5;
-# FIXME 3.2.1.2: why do we get different error numbers with and without OUTFILE ?
+# The above will fail with access error as long as
+# BUBG#28181 - a regression introduced in 5.0.42 is not fixed
+
eval SELECT *
FROM schemata LIMIT 0, 5;
@@ -479,8 +487,9 @@ eval SELECT *
LINES TERMINATED BY '\n'
FROM information_schema.schemata
WHERE schema_name LIKE 'db_%';
-# FIXME: why do we get different error numbers with and without OUTFILE ?
-#FIXME this should fail! --error 1146
+# The above will fail with access error as long as
+# BUBG#28181 - a regression introduced in 5.0.42 is not fixed
+
eval SELECT *
FROM information_schema.schemata
WHERE schema_name LIKE 'db_%';
@@ -3014,12 +3023,13 @@ GRANT SELECT ON db_datadict.v3 to 'user_3'@'localhost';
# 13 DATA_FREE
# 15 CREATE_TIME
# 16 UPDATE_TIME
+# 17 CHECK_TIME
# 20 CREATE_OPTIONS
if ($have_bug_11589)
{
--disable_ps_protocol
}
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
+--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
# 9 AVG_ROW_LENGTH
@@ -3029,7 +3039,8 @@ SELECT * FROM information_schema.tables
# 13 DATA_FREE
# 15 CREATE_TIME
# 16 UPDATE_TIME
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss"
+# 17 CHECK_TIME
+--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
--enable_ps_protocol
@@ -3049,12 +3060,13 @@ connect (user_12_2, localhost, user_2, , db_datadict);
# 13 DATA_FREE
# 15 CREATE_TIME
# 16 UPDATE_TIME
+# 17 CHECK_TIME
# 20 CREATE_OPTIONS
if ($have_bug_11589)
{
--disable_ps_protocol
}
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
+--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
# 9 AVG_ROW_LENGTH
@@ -3064,7 +3076,8 @@ SELECT * FROM information_schema.tables
# 13 DATA_FREE
# 15 CREATE_TIME
# 16 UPDATE_TIME
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss"
+# 17 CHECK_TIME
+--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
--enable_ps_protocol
@@ -3085,12 +3098,13 @@ connect (user_12_3, localhost, user_3, , db_datadict);
# 13 DATA_FREE
# 15 CREATE_TIME
# 16 UPDATE_TIME
+# 17 CHECK_TIME
# 20 CREATE_OPTIONS
if ($have_bug_11589)
{
--disable_ps_protocol
}
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
+--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
# 9 AVG_ROW_LENGTH
@@ -3100,7 +3114,8 @@ SELECT * FROM information_schema.tables
# 13 DATA_FREE
# 15 CREATE_TIME
# 16 UPDATE_TIME
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss"
+# 17 CHECK_TIME
+--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
--enable_ps_protocol
@@ -3121,12 +3136,13 @@ connection default;
# 13 DATA_FREE
# 15 CREATE_TIME
# 16 UPDATE_TIME
+# 17 CHECK_TIME
# 20 CREATE_OPTIONS
if ($have_bug_11589)
{
--disable_ps_protocol
}
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
+--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
# 9 AVG_ROW_LENGTH
@@ -3136,7 +3152,8 @@ SELECT * FROM information_schema.tables
# 13 DATA_FREE
# 15 CREATE_TIME
# 16 UPDATE_TIME
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss"
+# 17 CHECK_TIME
+--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
--enable_ps_protocol
diff --git a/mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc b/mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc
index 06b2d6fed45..260119f030f 100644
--- a/mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc
+++ b/mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc
@@ -36,7 +36,7 @@ eval select table_name, index_schema, index_name, index_type
--replace_result $SERVER_NAME <SERVER_NAME>
eval select *
- from information_schema.user_privileges;
+ from information_schema.user_privileges order by grantee, privilege_type;
# where grantee="'u_6_401013'@'%'";
eval select *
diff --git a/mysql-test/suite/funcs_1/r/a_version_check.result b/mysql-test/suite/funcs_1/r/a_version_check.result
deleted file mode 100644
index 865569f9e69..00000000000
--- a/mysql-test/suite/funcs_1/r/a_version_check.result
+++ /dev/null
@@ -1,11 +0,0 @@
-
-. Just show the version string for which the results in suite
-. funcs_1 have been checked.
-.
-. I know that the .result file of this check needs to
-. updated with each new version --- THIS IS INTENDED!
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-funcs_1 checked with version: 5.0.36
-Warnings:
-Warning 1466 Leading spaces are removed from name ' '
diff --git a/mysql-test/suite/funcs_1/r/innodb__datadict.result b/mysql-test/suite/funcs_1/r/innodb__datadict.result
index f1bf8e6e25b..675f30da14a 100644
--- a/mysql-test/suite/funcs_1/r/innodb__datadict.result
+++ b/mysql-test/suite/funcs_1/r/innodb__datadict.result
@@ -418,13 +418,11 @@ LENGTH( SUBSTRING( u,
LENGTH( SUBSTRING_INDEX(u, _utf8'@',1)) +3 )) - 1 )
AS Server_Clean
FROM db_datadict.vu1;
-SELECT * FROM db_datadict.vu;
+SELECT * FROM db_datadict.vu order by u;
u server Server_Clean
-'root'@'localhost' localhost' localhost
'root'@'127.0.0.1' 127.0.0.1' 127.0.0.1
-''@'localhost' localhost' localhost
'root'@'<SERVER_NAME>' <SERVER_NAME>' <SERVER_NAME>
-''@'<SERVER_NAME>' <SERVER_NAME>' <SERVER_NAME>
+'root'@'localhost' localhost' localhost
CREATE PROCEDURE db_datadict.sp_1()
BEGIN
SELECT * FROM db_datadict.v1;
@@ -474,7 +472,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -495,7 +493,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -516,7 +514,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -537,7 +535,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -558,7 +556,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -579,7 +577,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -600,7 +598,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -621,7 +619,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -642,7 +640,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -663,7 +661,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -684,7 +682,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -705,7 +703,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -726,7 +724,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -747,7 +745,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -768,7 +766,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -789,7 +787,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -812,7 +810,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -833,7 +831,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -854,7 +852,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -875,7 +873,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -896,7 +894,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -917,7 +915,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -938,7 +936,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -959,7 +957,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -980,7 +978,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1001,7 +999,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1022,7 +1020,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -1043,7 +1041,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1064,7 +1062,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -1085,7 +1083,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -1106,7 +1104,7 @@ DATA_FREE #DF#
AUTO_INCREMENT 6
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1127,7 +1125,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1148,7 +1146,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1169,7 +1167,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1190,7 +1188,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1202,7 +1200,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 5
+TABLE_ROWS 3
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1211,7 +1209,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -1232,7 +1230,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1253,7 +1251,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1274,7 +1272,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1295,7 +1293,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1316,7 +1314,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1337,7 +1335,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1358,7 +1356,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1379,7 +1377,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1400,7 +1398,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1421,7 +1419,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1442,7 +1440,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1463,7 +1461,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1484,7 +1482,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1505,7 +1503,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1526,7 +1524,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -2100,9 +2098,9 @@ NULL mysql proc language 5 SQL NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('
NULL mysql proc sql_data_access 6 CONTAINS_SQL NO enum 17 51 NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') select,insert,update,references
NULL mysql proc is_deterministic 7 NO NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
NULL mysql proc security_type 8 DEFINER NO enum 7 21 NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER') select,insert,update,references
-NULL mysql proc param_list 9 NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
+NULL mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
NULL mysql proc returns 10 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
-NULL mysql proc body 11 NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
NULL mysql proc definer 12 NO char 77 231 NULL NULL utf8 utf8_bin char(77) select,insert,update,references
NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
NULL mysql proc modified 14 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
@@ -2565,7 +2563,7 @@ NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A 0 NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 2 Db A NULL NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 3 User A 2 NULL NULL BTREE
-NULL mysql db 1 mysql User 1 User A NULL NULL NULL BTREE
+NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
@@ -2599,91 +2597,89 @@ NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A 393 NULL NUL
NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A NULL NULL NULL BTREE
NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A 31 NULL NULL BTREE
NULL mysql user 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
-NULL mysql user 0 mysql PRIMARY 2 User A 5 NULL NULL BTREE
+NULL mysql user 0 mysql PRIMARY 2 User A 3 NULL NULL BTREE
select * from views;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ select `tables`.`TABLE_CATALOG` AS `TABLE_CATALOG`,`tables`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`tables`.`TABLE_NAME` AS `TABLE_NAME`,`tables`.`TABLE_TYPE` AS `TABLE_TYPE`,`tables`.`ENGINE` AS `ENGINE`,`tables`.`VERSION` AS `VERSION`,`tables`.`ROW_FORMAT` AS `ROW_FORMAT`,`tables`.`TABLE_ROWS` AS `TABLE_ROWS`,`tables`.`AVG_ROW_LENGTH` AS `AVG_ROW_LENGTH`,`tables`.`DATA_LENGTH` AS `DATA_LENGTH`,`tables`.`MAX_DATA_LENGTH` AS `MAX_DATA_LENGTH`,`tables`.`INDEX_LENGTH` AS `INDEX_LENGTH`,`tables`.`DATA_FREE` AS `DATA_FREE`,`tables`.`AUTO_INCREMENT` AS `AUTO_INCREMENT`,`tables`.`CREATE_TIME` AS `CREATE_TIME`,`tables`.`UPDATE_TIME` AS `UPDATE_TIME`,`tables`.`CHECK_TIME` AS `CHECK_TIME`,`tables`.`TABLE_COLLATION` AS `TABLE_COLLATION`,`tables`.`CHECKSUM` AS `CHECKSUM`,`tables`.`CREATE_OPTIONS` AS `CREATE_OPTIONS`,`tables`.`TABLE_COMMENT` AS `TABLE_COMMENT` from `information_schema`.`tables` NONE NO root@localhost DEFINER
NULL db_datadict vu /* ALGORITHM=UNDEFINED */ select distinct `vu1`.`u` AS `u`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3)) AS `server`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3),(length(substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3))) - 1)) AS `Server_Clean` from `db_datadict`.`vu1` NONE NO root@localhost DEFINER
NULL db_datadict vu1 /* ALGORITHM=UNDEFINED */ select `user_privileges`.`GRANTEE` AS `u` from `information_schema`.`user_privileges` NONE NO root@localhost DEFINER
-select * from user_privileges;
+select * from user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select * from schema_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
''@'%' NULL test SELECT NO
@@ -2853,11 +2849,12 @@ Table or view 'tb2' is associated with the database 'test1'.
Table or view 't6' is associated with the database 'test4'.
select grantee as "user's having select privilege",
substring( grantee, length(SUBSTRING_INDEX(grantee,_utf8'@',1))+2 )
-from user_privileges where privilege_type = 'select';
+from user_privileges where privilege_type = 'select'
+ order by grantee;
user's having select privilege substring( grantee, length(SUBSTRING_INDEX(grantee,_utf8'@',1))+2 )
-'root'@'localhost' 'localhost'
'root'@'127.0.0.1' '127.0.0.1'
'root'@'<SERVER_NAME>' '<SERVER_NAME>'
+'root'@'localhost' 'localhost'
select all table_schema from schema_privileges limit 0,5;
table_schema
test
@@ -3090,7 +3087,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3111,7 +3108,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3132,7 +3129,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3153,7 +3150,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3174,7 +3171,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3195,7 +3192,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3216,7 +3213,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3237,7 +3234,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3258,7 +3255,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3279,7 +3276,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3300,7 +3297,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3321,7 +3318,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3342,7 +3339,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3363,7 +3360,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3384,7 +3381,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3405,7 +3402,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3428,7 +3425,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -3449,7 +3446,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -3470,7 +3467,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -3491,7 +3488,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3512,7 +3509,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3533,7 +3530,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3554,7 +3551,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3575,7 +3572,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3596,7 +3593,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3617,7 +3614,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3638,7 +3635,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3659,7 +3656,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3680,7 +3677,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3701,7 +3698,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3722,7 +3719,7 @@ DATA_FREE #DF#
AUTO_INCREMENT 6
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3743,7 +3740,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3764,7 +3761,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3785,7 +3782,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3806,7 +3803,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3818,7 +3815,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 5
+TABLE_ROWS 3
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -3827,7 +3824,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3848,7 +3845,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3869,7 +3866,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3890,7 +3887,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3911,7 +3908,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3932,7 +3929,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3953,7 +3950,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3974,7 +3971,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3995,7 +3992,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4016,7 +4013,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4037,7 +4034,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4058,7 +4055,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4079,7 +4076,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4100,7 +4097,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4121,7 +4118,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4142,7 +4139,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4570,7 +4567,7 @@ COUNT(*)
3
SELECT COUNT(*) FROM information_schema. user_privileges ;
COUNT(*)
-77
+75
SELECT COUNT(*) FROM information_schema. schema_privileges ;
COUNT(*)
28
@@ -4639,7 +4636,7 @@ TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_
NULL mysql procs_priv 1 mysql Grantor 1 Grantor A NULL NULL NULL BTREE
NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
-NULL mysql db 1 mysql User 1 User A NULL NULL NULL BTREE
+NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
select concat(table_schema, ', ', table_name, ', ', view_definition) view_info
from views;
view_info
@@ -4694,13 +4691,11 @@ test, tb3
test, tb4
test1, tb2
test4, t6
-select distinct grantee from user_privileges;
+select distinct grantee from user_privileges order by grantee, privilege_type;
grantee
-'root'@'localhost'
'root'@'127.0.0.1'
-''@'localhost'
'root'@'<SERVER_NAME>'
-''@'<SERVER_NAME>'
+'root'@'localhost'
select * from schema_privileges where table_catalog is null limit 0, 5;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
''@'%' NULL test SELECT NO
@@ -4737,37 +4732,10 @@ NULL test1 latin1 latin1_swedish_ci NULL
select distinct grantee from user_privileges;
grantee
'root'@'localhost'
-'root'@'127.0.0.1'
-''@'localhost'
'root'@'<SERVER_NAME>'
-''@'<SERVER_NAME>'
-select all grantee from user_privileges;
+'root'@'127.0.0.1'
+select all grantee from user_privileges order by grantee, privilege_type;
grantee
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
'root'@'127.0.0.1'
'root'@'127.0.0.1'
'root'@'127.0.0.1'
@@ -4793,7 +4761,6 @@ grantee
'root'@'127.0.0.1'
'root'@'127.0.0.1'
'root'@'127.0.0.1'
-''@'localhost'
'root'@'<SERVER_NAME>'
'root'@'<SERVER_NAME>'
'root'@'<SERVER_NAME>'
@@ -4819,7 +4786,31 @@ grantee
'root'@'<SERVER_NAME>'
'root'@'<SERVER_NAME>'
'root'@'<SERVER_NAME>'
-''@'<SERVER_NAME>'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
select id , character_set_name from collations order by id asc limit 10;
id character_set_name
1 big5
@@ -6292,85 +6283,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -6439,86 +6428,84 @@ where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
res_t_401013 db_datadict i_6_401013 BTREE
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-'u_6_401013'@'localhost' NULL USAGE NO
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
+'u_6_401013'@'localhost' NULL USAGE NO
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -6572,85 +6559,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -6717,85 +6702,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -6858,85 +6841,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -7012,86 +6993,84 @@ where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
res_t_401015 db_datadict i_6_401015 BTREE
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-'u_6_401015'@'localhost' NULL USAGE NO
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
+'u_6_401015'@'localhost' NULL USAGE NO
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -7144,85 +7123,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -9135,9 +9112,9 @@ NULL mysql proc language 5 SQL NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('
NULL mysql proc sql_data_access 6 CONTAINS_SQL NO enum 17 51 NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') select,insert,update,references
NULL mysql proc is_deterministic 7 NO NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
NULL mysql proc security_type 8 DEFINER NO enum 7 21 NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER') select,insert,update,references
-NULL mysql proc param_list 9 NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
+NULL mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
NULL mysql proc returns 10 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
-NULL mysql proc body 11 NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
NULL mysql proc definer 12 NO char 77 231 NULL NULL utf8 utf8_bin char(77) select,insert,update,references
NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
NULL mysql proc modified 14 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
@@ -12028,178 +12005,178 @@ GRANT SELECT ON db_datadict.v3 to 'user_3'@'localhost';
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
+NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL NULL VIEW
-NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW
+NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
connect(localhost,user_2,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
+NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
connect(localhost,user_3,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
+NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL NULL VIEW
-NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW
+NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
root@localhost db_datadict
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
+NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL NULL VIEW
-NULL mysql columns_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Column privileges
-NULL mysql db BASE TABLE MyISAM 10 Fixed 3 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Database privileges
-NULL mysql func BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL User defined functions
-NULL mysql help_category BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL help categories
-NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL help keywords
-NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL keyword-topic relation
-NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL help topics
-NULL mysql host BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Host privileges; Merged with database privileges
-NULL mysql proc BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Stored Procedures
-NULL mysql procs_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Procedure privileges
-NULL mysql tables_priv BASE TABLE MyISAM 10 Fixed 5 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Table privileges
-NULL mysql time_zone BASE TABLE MyISAM 10 Fixed 5 #ARL# #DL# #MDL# #IL# #DF# 6 YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Time zones
-NULL mysql time_zone_leap_second BASE TABLE MyISAM 10 Fixed 22 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Leap seconds information for time zones
-NULL mysql time_zone_name BASE TABLE MyISAM 10 Fixed 6 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Time zone names
-NULL mysql time_zone_transition BASE TABLE MyISAM 10 Fixed 393 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Time zone transitions
-NULL mysql time_zone_transition_type BASE TABLE MyISAM 10 Fixed 31 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Time zone transition types
-NULL mysql user BASE TABLE MyISAM 10 Dynamic 8 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Users and global privileges
-NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test1 tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test4 t6 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW
+NULL mysql columns_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Column privileges
+NULL mysql db BASE TABLE MyISAM 10 Fixed 3 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Database privileges
+NULL mysql func BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL User defined functions
+NULL mysql help_category BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
+NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
+NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
+NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
+NULL mysql host BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Host privileges; Merged with database privileges
+NULL mysql proc BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Stored Procedures
+NULL mysql procs_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Procedure privileges
+NULL mysql tables_priv BASE TABLE MyISAM 10 Fixed 5 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Table privileges
+NULL mysql time_zone BASE TABLE MyISAM 10 Fixed 5 #ARL# #DL# #MDL# #IL# #DF# 6 YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zones
+NULL mysql time_zone_leap_second BASE TABLE MyISAM 10 Fixed 22 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Leap seconds information for time zones
+NULL mysql time_zone_name BASE TABLE MyISAM 10 Fixed 6 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone names
+NULL mysql time_zone_transition BASE TABLE MyISAM 10 Fixed 393 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone transitions
+NULL mysql time_zone_transition_type BASE TABLE MyISAM 10 Fixed 31 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone transition types
+NULL mysql user BASE TABLE MyISAM 10 Dynamic 6 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Users and global privileges
+NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test1 tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test4 t6 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
DROP USER 'user_1'@'localhost';
DROP USER 'user_2'@'localhost';
DROP USER 'user_3'@'localhost';
@@ -12411,7 +12388,7 @@ NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A 0 NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 2 Db A NULL NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 3 User A 2 NULL NULL BTREE
-NULL mysql db 1 mysql User 1 User A NULL NULL NULL BTREE
+NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
@@ -12445,7 +12422,7 @@ NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A 393 NULL NUL
NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A NULL NULL NULL BTREE
NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A 31 NULL NULL BTREE
NULL mysql user 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
-NULL mysql user 0 mysql PRIMARY 2 User A 7 NULL NULL BTREE
+NULL mysql user 0 mysql PRIMARY 2 User A 5 NULL NULL BTREE
user_1@localhost test
SELECT * FROM information_schema.statistics;
diff --git a/mysql-test/suite/funcs_1/r/innodb_func_view.result b/mysql-test/suite/funcs_1/r/innodb_func_view.result
index 764aac53414..5fac88b8f14 100644
--- a/mysql-test/suite/funcs_1/r/innodb_func_view.result
+++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result
@@ -3814,13 +3814,11 @@ CAST(my_time AS DATETIME) my_time id
NULL NULL 1
0000-00-00 00:00:00 -838:59:59 2
0000-00-00 00:00:00 838:59:59 3
-0000-00-00 00:00:00 13:00:00 4
-0000-00-00 00:00:00 10:00:00 5
+0000-00-00 13:00:00 13:00:00 4
+0000-00-00 10:00:00 10:00:00 5
Warnings:
Warning 1292 Truncated incorrect datetime value: '0000-00-00 838:59:59'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 838:59:59'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00 13:00:00'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:00:00'
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as datetime) AS `CAST(my_time AS DATETIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
@@ -3831,13 +3829,11 @@ CAST(my_time AS DATETIME) my_time id
NULL NULL 1
0000-00-00 00:00:00 -838:59:59 2
0000-00-00 00:00:00 838:59:59 3
-0000-00-00 00:00:00 13:00:00 4
-0000-00-00 00:00:00 10:00:00 5
+0000-00-00 13:00:00 13:00:00 4
+0000-00-00 10:00:00 10:00:00 5
Warnings:
Warning 1292 Truncated incorrect datetime value: '0000-00-00 838:59:59'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 838:59:59'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00 13:00:00'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:00:00'
DROP VIEW v1;
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_08.result b/mysql-test/suite/funcs_1/r/innodb_trig_08.result
index bb087d5882e..0f2d54f01ba 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_08.result
@@ -484,8 +484,9 @@ BEGIN
WHILE @counter1 < new.f136
SET @counter1 = @counter1 + 1;
END//
-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 'SET @counter1 = @counter1 + 1;
-END' at line 4
+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 'WHILE @counter1 < new.f136
+SET @counter1 = @counter1 + 1;
+END' at line 3
delete from tb3 where f122='Test 3.5.8.5-while';
drop trigger trg7;
diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result
index fe133f06da7..63d1c8a3131 100644
--- a/mysql-test/suite/funcs_1/r/innodb_views.result
+++ b/mysql-test/suite/funcs_1/r/innodb_views.result
@@ -448,7 +448,8 @@ SET @x=0;
CREATE or REPLACE VIEW v1 AS Select 1 INTO @x;
ERROR HY000: View's SELECT contains a 'INTO' clause
Select @x;
-ERROR HY000: View's SELECT contains a variable or parameter
+@x
+0
CREATE or REPLACE VIEW v1 AS Select 1
FROM (SELECT 1 FROM t1) my_table;
ERROR HY000: View's SELECT contains a subquery in the FROM clause
@@ -585,7 +586,9 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
CREATE or REPLACE view v1 as Select f59, f60
from tb2 by group f59 ;
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 'by group f59' at line 2
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.5
+--------------------------------------------------------------------------------
DROP VIEW IF EXISTS v1 ;
CREATE VIEW v1 SELECT * FROM tb2 limit 100 ;
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 'SELECT * FROM tb2 limit 100' at line 1
@@ -605,7 +608,9 @@ CREATE VIEW v1 SELECT 1;
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 'SELECT 1' at line 1
CREATE VIEW v1 AS ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.6
+--------------------------------------------------------------------------------
DROP VIEW IF EXISTS v1 ;
CREATE or REPLACE VIEW v1
as SELECT * from tb2 limit 100 ;
@@ -1790,7 +1795,9 @@ ERROR HY000: View's SELECT contains a subquery in the FROM clause
SELECT * FROM test.v1 ;
ERROR 42S02: Table 'test.v1' doesn't exist
Drop view if exists test.v1 ;
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.40
+--------------------------------------------------------------------------------
Drop view if exists test.v1 ;
Set @var1 = 'ABC' ;
Set @var2 = 'XYZ' ;
@@ -1799,7 +1806,9 @@ ERROR HY000: View's SELECT contains a variable or parameter
CREATE VIEW test.v1 AS SELECT @@global.sort_buffer_size;
ERROR HY000: View's SELECT contains a variable or parameter
Drop view if exists test.v1 ;
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.41
+--------------------------------------------------------------------------------
Drop view if exists test.v1 ;
Drop procedure if exists sp1 ;
Create procedure sp1() DETERMINISTIC
@@ -1816,7 +1825,9 @@ Warnings:
Note 1051 Unknown table 'test.v1'
Drop procedure sp1 ;
ERROR 42000: PROCEDURE test.sp1 does not exist
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.42
+--------------------------------------------------------------------------------
Drop VIEW if exists test.v1 ;
CREATE TEMPORARY VIEW test.v1 AS
SELECT * FROM test.tb2 limit 2 ;
@@ -1828,7 +1839,9 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SELECT * FROM test.tb2 limit 2' at line 1
Drop view if exists test.v1 ;
Use test;
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.43
+--------------------------------------------------------------------------------
Drop view if exists test.v1 ;
CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2;
INSERT INTO test.v1 values(122,432);
diff --git a/mysql-test/suite/funcs_1/r/innodb_views.warnings b/mysql-test/suite/funcs_1/r/innodb_views.warnings
deleted file mode 100644
index 2c9dc825a5d..00000000000
--- a/mysql-test/suite/funcs_1/r/innodb_views.warnings
+++ /dev/null
@@ -1,2 +0,0 @@
-mysqltest: Warning detected in included file ./suite/funcs_1/views/views_master.inc at line 3039: Suspicious command '--eror 1116' detected, was this intentional? Use # instead of -- to avoid this warning
-mysqltest: Warning detected in included file ./suite/funcs_1/views/views_master.inc at line 3050: Suspicious command '--eror 1116' detected, was this intentional? Use # instead of -- to avoid this warning
diff --git a/mysql-test/suite/funcs_1/r/memory__datadict.result b/mysql-test/suite/funcs_1/r/memory__datadict.result
index deb6550802d..1dea8a5f4a9 100644
--- a/mysql-test/suite/funcs_1/r/memory__datadict.result
+++ b/mysql-test/suite/funcs_1/r/memory__datadict.result
@@ -416,13 +416,11 @@ LENGTH( SUBSTRING( u,
LENGTH( SUBSTRING_INDEX(u, _utf8'@',1)) +3 )) - 1 )
AS Server_Clean
FROM db_datadict.vu1;
-SELECT * FROM db_datadict.vu;
+SELECT * FROM db_datadict.vu order by u;
u server Server_Clean
-'root'@'localhost' localhost' localhost
'root'@'127.0.0.1' 127.0.0.1' 127.0.0.1
-''@'localhost' localhost' localhost
'root'@'<SERVER_NAME>' <SERVER_NAME>' <SERVER_NAME>
-''@'<SERVER_NAME>' <SERVER_NAME>' <SERVER_NAME>
+'root'@'localhost' localhost' localhost
CREATE PROCEDURE db_datadict.sp_1()
BEGIN
SELECT * FROM db_datadict.v1;
@@ -472,7 +470,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -493,7 +491,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -514,7 +512,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -535,7 +533,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -556,7 +554,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -577,7 +575,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -598,7 +596,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -619,7 +617,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -640,7 +638,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -661,7 +659,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -682,7 +680,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -703,7 +701,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -724,7 +722,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -745,7 +743,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -766,7 +764,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -787,7 +785,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -810,7 +808,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -831,7 +829,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -852,7 +850,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -873,7 +871,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -894,7 +892,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -915,7 +913,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -936,7 +934,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -957,7 +955,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -978,7 +976,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -999,7 +997,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1020,7 +1018,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -1041,7 +1039,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1062,7 +1060,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -1083,7 +1081,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -1104,7 +1102,7 @@ DATA_FREE #DF#
AUTO_INCREMENT 6
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1125,7 +1123,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1146,7 +1144,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1167,7 +1165,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1188,7 +1186,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1200,7 +1198,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 5
+TABLE_ROWS 3
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1209,7 +1207,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -1230,7 +1228,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1251,7 +1249,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1272,7 +1270,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1293,7 +1291,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1314,7 +1312,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1335,7 +1333,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1356,7 +1354,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1377,7 +1375,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1398,7 +1396,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1419,7 +1417,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1440,7 +1438,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1461,7 +1459,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1482,7 +1480,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1503,7 +1501,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1524,7 +1522,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -2098,9 +2096,9 @@ NULL mysql proc language 5 SQL NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('
NULL mysql proc sql_data_access 6 CONTAINS_SQL NO enum 17 51 NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') select,insert,update,references
NULL mysql proc is_deterministic 7 NO NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
NULL mysql proc security_type 8 DEFINER NO enum 7 21 NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER') select,insert,update,references
-NULL mysql proc param_list 9 NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
+NULL mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
NULL mysql proc returns 10 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
-NULL mysql proc body 11 NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
NULL mysql proc definer 12 NO char 77 231 NULL NULL utf8 utf8_bin char(77) select,insert,update,references
NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
NULL mysql proc modified 14 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
@@ -2548,7 +2546,7 @@ NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A 0 NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 2 Db A NULL NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 3 User A 2 NULL NULL BTREE
-NULL mysql db 1 mysql User 1 User A NULL NULL NULL BTREE
+NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
@@ -2582,91 +2580,89 @@ NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A 393 NULL NUL
NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A NULL NULL NULL BTREE
NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A 31 NULL NULL BTREE
NULL mysql user 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
-NULL mysql user 0 mysql PRIMARY 2 User A 5 NULL NULL BTREE
+NULL mysql user 0 mysql PRIMARY 2 User A 3 NULL NULL BTREE
select * from views;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ select `tables`.`TABLE_CATALOG` AS `TABLE_CATALOG`,`tables`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`tables`.`TABLE_NAME` AS `TABLE_NAME`,`tables`.`TABLE_TYPE` AS `TABLE_TYPE`,`tables`.`ENGINE` AS `ENGINE`,`tables`.`VERSION` AS `VERSION`,`tables`.`ROW_FORMAT` AS `ROW_FORMAT`,`tables`.`TABLE_ROWS` AS `TABLE_ROWS`,`tables`.`AVG_ROW_LENGTH` AS `AVG_ROW_LENGTH`,`tables`.`DATA_LENGTH` AS `DATA_LENGTH`,`tables`.`MAX_DATA_LENGTH` AS `MAX_DATA_LENGTH`,`tables`.`INDEX_LENGTH` AS `INDEX_LENGTH`,`tables`.`DATA_FREE` AS `DATA_FREE`,`tables`.`AUTO_INCREMENT` AS `AUTO_INCREMENT`,`tables`.`CREATE_TIME` AS `CREATE_TIME`,`tables`.`UPDATE_TIME` AS `UPDATE_TIME`,`tables`.`CHECK_TIME` AS `CHECK_TIME`,`tables`.`TABLE_COLLATION` AS `TABLE_COLLATION`,`tables`.`CHECKSUM` AS `CHECKSUM`,`tables`.`CREATE_OPTIONS` AS `CREATE_OPTIONS`,`tables`.`TABLE_COMMENT` AS `TABLE_COMMENT` from `information_schema`.`tables` NONE NO root@localhost DEFINER
NULL db_datadict vu /* ALGORITHM=UNDEFINED */ select distinct `vu1`.`u` AS `u`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3)) AS `server`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3),(length(substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3))) - 1)) AS `Server_Clean` from `db_datadict`.`vu1` NONE NO root@localhost DEFINER
NULL db_datadict vu1 /* ALGORITHM=UNDEFINED */ select `user_privileges`.`GRANTEE` AS `u` from `information_schema`.`user_privileges` NONE NO root@localhost DEFINER
-select * from user_privileges;
+select * from user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select * from schema_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
''@'%' NULL test SELECT NO
@@ -2836,11 +2832,12 @@ Table or view 'tb2' is associated with the database 'test1'.
Table or view 't6' is associated with the database 'test4'.
select grantee as "user's having select privilege",
substring( grantee, length(SUBSTRING_INDEX(grantee,_utf8'@',1))+2 )
-from user_privileges where privilege_type = 'select';
+from user_privileges where privilege_type = 'select'
+ order by grantee;
user's having select privilege substring( grantee, length(SUBSTRING_INDEX(grantee,_utf8'@',1))+2 )
-'root'@'localhost' 'localhost'
'root'@'127.0.0.1' '127.0.0.1'
'root'@'<SERVER_NAME>' '<SERVER_NAME>'
+'root'@'localhost' 'localhost'
select all table_schema from schema_privileges limit 0,5;
table_schema
test
@@ -3073,7 +3070,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3094,7 +3091,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3115,7 +3112,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3136,7 +3133,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3157,7 +3154,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3178,7 +3175,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3199,7 +3196,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3220,7 +3217,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3241,7 +3238,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3262,7 +3259,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3283,7 +3280,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3304,7 +3301,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3325,7 +3322,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3346,7 +3343,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3367,7 +3364,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3388,7 +3385,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3411,7 +3408,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -3432,7 +3429,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -3453,7 +3450,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -3474,7 +3471,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3495,7 +3492,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3516,7 +3513,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3537,7 +3534,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3558,7 +3555,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3579,7 +3576,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3600,7 +3597,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3621,7 +3618,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3642,7 +3639,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3663,7 +3660,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3684,7 +3681,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3705,7 +3702,7 @@ DATA_FREE #DF#
AUTO_INCREMENT 6
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3726,7 +3723,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3747,7 +3744,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3768,7 +3765,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3789,7 +3786,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3801,7 +3798,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 5
+TABLE_ROWS 3
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -3810,7 +3807,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3831,7 +3828,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3852,7 +3849,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3873,7 +3870,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3894,7 +3891,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3915,7 +3912,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3936,7 +3933,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3957,7 +3954,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3978,7 +3975,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3999,7 +3996,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4020,7 +4017,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4041,7 +4038,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4062,7 +4059,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4083,7 +4080,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4104,7 +4101,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4125,7 +4122,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4553,7 +4550,7 @@ COUNT(*)
3
SELECT COUNT(*) FROM information_schema. user_privileges ;
COUNT(*)
-77
+75
SELECT COUNT(*) FROM information_schema. schema_privileges ;
COUNT(*)
28
@@ -4622,7 +4619,7 @@ TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_
NULL mysql procs_priv 1 mysql Grantor 1 Grantor A NULL NULL NULL BTREE
NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
-NULL mysql db 1 mysql User 1 User A NULL NULL NULL BTREE
+NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
select concat(table_schema, ', ', table_name, ', ', view_definition) view_info
from views;
view_info
@@ -4677,13 +4674,11 @@ test, tb3
test, tb4
test1, tb2
test4, t6
-select distinct grantee from user_privileges;
+select distinct grantee from user_privileges order by grantee, privilege_type;
grantee
-'root'@'localhost'
'root'@'127.0.0.1'
-''@'localhost'
'root'@'<SERVER_NAME>'
-''@'<SERVER_NAME>'
+'root'@'localhost'
select * from schema_privileges where table_catalog is null limit 0, 5;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
''@'%' NULL test SELECT NO
@@ -4720,37 +4715,10 @@ NULL test1 latin1 latin1_swedish_ci NULL
select distinct grantee from user_privileges;
grantee
'root'@'localhost'
-'root'@'127.0.0.1'
-''@'localhost'
'root'@'<SERVER_NAME>'
-''@'<SERVER_NAME>'
-select all grantee from user_privileges;
+'root'@'127.0.0.1'
+select all grantee from user_privileges order by grantee, privilege_type;
grantee
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
'root'@'127.0.0.1'
'root'@'127.0.0.1'
'root'@'127.0.0.1'
@@ -4776,7 +4744,6 @@ grantee
'root'@'127.0.0.1'
'root'@'127.0.0.1'
'root'@'127.0.0.1'
-''@'localhost'
'root'@'<SERVER_NAME>'
'root'@'<SERVER_NAME>'
'root'@'<SERVER_NAME>'
@@ -4802,7 +4769,31 @@ grantee
'root'@'<SERVER_NAME>'
'root'@'<SERVER_NAME>'
'root'@'<SERVER_NAME>'
-''@'<SERVER_NAME>'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
select id , character_set_name from collations order by id asc limit 10;
id character_set_name
1 big5
@@ -6275,85 +6266,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -6422,86 +6411,84 @@ where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
res_t_401013 db_datadict i_6_401013 HASH
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-'u_6_401013'@'localhost' NULL USAGE NO
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
+'u_6_401013'@'localhost' NULL USAGE NO
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -6555,85 +6542,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -6700,85 +6685,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -6841,85 +6824,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -6995,86 +6976,84 @@ where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
res_t_401015 db_datadict i_6_401015 BTREE
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-'u_6_401015'@'localhost' NULL USAGE NO
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
+'u_6_401015'@'localhost' NULL USAGE NO
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -7127,85 +7106,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -9103,9 +9080,9 @@ NULL mysql proc language 5 SQL NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('
NULL mysql proc sql_data_access 6 CONTAINS_SQL NO enum 17 51 NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') select,insert,update,references
NULL mysql proc is_deterministic 7 NO NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
NULL mysql proc security_type 8 DEFINER NO enum 7 21 NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER') select,insert,update,references
-NULL mysql proc param_list 9 NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
+NULL mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
NULL mysql proc returns 10 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
-NULL mysql proc body 11 NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
NULL mysql proc definer 12 NO char 77 231 NULL NULL utf8 utf8_bin char(77) select,insert,update,references
NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
NULL mysql proc modified 14 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
@@ -11926,178 +11903,178 @@ GRANT SELECT ON db_datadict.v3 to 'user_3'@'localhost';
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
+NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL NULL VIEW
-NULL test t1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t10 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t11 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t7 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t8 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t9 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
+NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW
+NULL test t1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
connect(localhost,user_2,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
+NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t10 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t11 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t7 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t8 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t9 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
+NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
connect(localhost,user_3,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
+NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL NULL VIEW
-NULL test t1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t10 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t11 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t7 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t8 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t9 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
+NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW
+NULL test t1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
root@localhost db_datadict
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
+NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL NULL VIEW
-NULL mysql columns_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Column privileges
-NULL mysql db BASE TABLE MyISAM 10 Fixed 3 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Database privileges
-NULL mysql func BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL User defined functions
-NULL mysql help_category BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL help categories
-NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL help keywords
-NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL keyword-topic relation
-NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL help topics
-NULL mysql host BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Host privileges; Merged with database privileges
-NULL mysql proc BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Stored Procedures
-NULL mysql procs_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Procedure privileges
-NULL mysql tables_priv BASE TABLE MyISAM 10 Fixed 5 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Table privileges
-NULL mysql time_zone BASE TABLE MyISAM 10 Fixed 5 #ARL# #DL# #MDL# #IL# #DF# 6 YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Time zones
-NULL mysql time_zone_leap_second BASE TABLE MyISAM 10 Fixed 22 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Leap seconds information for time zones
-NULL mysql time_zone_name BASE TABLE MyISAM 10 Fixed 6 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Time zone names
-NULL mysql time_zone_transition BASE TABLE MyISAM 10 Fixed 393 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Time zone transitions
-NULL mysql time_zone_transition_type BASE TABLE MyISAM 10 Fixed 31 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Time zone transition types
-NULL mysql user BASE TABLE MyISAM 10 Dynamic 8 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Users and global privileges
-NULL test t1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t10 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t11 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t7 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t8 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t9 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test1 tb2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test4 t6 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
+NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW
+NULL mysql columns_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Column privileges
+NULL mysql db BASE TABLE MyISAM 10 Fixed 3 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Database privileges
+NULL mysql func BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL User defined functions
+NULL mysql help_category BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
+NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
+NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
+NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
+NULL mysql host BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Host privileges; Merged with database privileges
+NULL mysql proc BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Stored Procedures
+NULL mysql procs_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Procedure privileges
+NULL mysql tables_priv BASE TABLE MyISAM 10 Fixed 5 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Table privileges
+NULL mysql time_zone BASE TABLE MyISAM 10 Fixed 5 #ARL# #DL# #MDL# #IL# #DF# 6 YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zones
+NULL mysql time_zone_leap_second BASE TABLE MyISAM 10 Fixed 22 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Leap seconds information for time zones
+NULL mysql time_zone_name BASE TABLE MyISAM 10 Fixed 6 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone names
+NULL mysql time_zone_transition BASE TABLE MyISAM 10 Fixed 393 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone transitions
+NULL mysql time_zone_transition_type BASE TABLE MyISAM 10 Fixed 31 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone transition types
+NULL mysql user BASE TABLE MyISAM 10 Dynamic 6 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Users and global privileges
+NULL test t1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb1 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb3 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb4 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test1 tb2 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test4 t6 BASE TABLE MEMORY 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
DROP USER 'user_1'@'localhost';
DROP USER 'user_2'@'localhost';
DROP USER 'user_3'@'localhost';
@@ -12309,7 +12286,7 @@ NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A 0 NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 2 Db A NULL NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 3 User A 2 NULL NULL BTREE
-NULL mysql db 1 mysql User 1 User A NULL NULL NULL BTREE
+NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
@@ -12343,7 +12320,7 @@ NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A 393 NULL NUL
NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A NULL NULL NULL BTREE
NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A 31 NULL NULL BTREE
NULL mysql user 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
-NULL mysql user 0 mysql PRIMARY 2 User A 7 NULL NULL BTREE
+NULL mysql user 0 mysql PRIMARY 2 User A 5 NULL NULL BTREE
user_1@localhost test
SELECT * FROM information_schema.statistics;
diff --git a/mysql-test/suite/funcs_1/r/memory_func_view.result b/mysql-test/suite/funcs_1/r/memory_func_view.result
index 50caa20e8c7..08e49d1bf6f 100644
--- a/mysql-test/suite/funcs_1/r/memory_func_view.result
+++ b/mysql-test/suite/funcs_1/r/memory_func_view.result
@@ -3814,13 +3814,11 @@ CAST(my_time AS DATETIME) my_time id
NULL NULL 1
0000-00-00 00:00:00 -838:59:59 2
0000-00-00 00:00:00 838:59:59 3
-0000-00-00 00:00:00 13:00:00 4
-0000-00-00 00:00:00 10:00:00 5
+0000-00-00 13:00:00 13:00:00 4
+0000-00-00 10:00:00 10:00:00 5
Warnings:
Warning 1292 Truncated incorrect datetime value: '0000-00-00 838:59:59'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 838:59:59'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00 13:00:00'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:00:00'
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as datetime) AS `CAST(my_time AS DATETIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
@@ -3831,13 +3829,11 @@ CAST(my_time AS DATETIME) my_time id
NULL NULL 1
0000-00-00 00:00:00 -838:59:59 2
0000-00-00 00:00:00 838:59:59 3
-0000-00-00 00:00:00 13:00:00 4
-0000-00-00 00:00:00 10:00:00 5
+0000-00-00 13:00:00 13:00:00 4
+0000-00-00 10:00:00 10:00:00 5
Warnings:
Warning 1292 Truncated incorrect datetime value: '0000-00-00 838:59:59'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 838:59:59'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00 13:00:00'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:00:00'
DROP VIEW v1;
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_08.result b/mysql-test/suite/funcs_1/r/memory_trig_08.result
index a842bbc3ac7..9a14845d0eb 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_08.result
@@ -480,8 +480,9 @@ BEGIN
WHILE @counter1 < new.f136
SET @counter1 = @counter1 + 1;
END//
-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 'SET @counter1 = @counter1 + 1;
-END' at line 4
+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 'WHILE @counter1 < new.f136
+SET @counter1 = @counter1 + 1;
+END' at line 3
delete from tb3 where f122='Test 3.5.8.5-while';
drop trigger trg7;
diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result
index dac9e877e48..516eef24439 100644
--- a/mysql-test/suite/funcs_1/r/memory_views.result
+++ b/mysql-test/suite/funcs_1/r/memory_views.result
@@ -452,7 +452,8 @@ SET @x=0;
CREATE or REPLACE VIEW v1 AS Select 1 INTO @x;
ERROR HY000: View's SELECT contains a 'INTO' clause
Select @x;
-ERROR HY000: View's SELECT contains a variable or parameter
+@x
+0
CREATE or REPLACE VIEW v1 AS Select 1
FROM (SELECT 1 FROM t1) my_table;
ERROR HY000: View's SELECT contains a subquery in the FROM clause
@@ -589,7 +590,9 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
CREATE or REPLACE view v1 as Select f59, f60
from tb2 by group f59 ;
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 'by group f59' at line 2
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.5
+--------------------------------------------------------------------------------
DROP VIEW IF EXISTS v1 ;
CREATE VIEW v1 SELECT * FROM tb2 limit 100 ;
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 'SELECT * FROM tb2 limit 100' at line 1
@@ -609,7 +612,9 @@ CREATE VIEW v1 SELECT 1;
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 'SELECT 1' at line 1
CREATE VIEW v1 AS ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.6
+--------------------------------------------------------------------------------
DROP VIEW IF EXISTS v1 ;
CREATE or REPLACE VIEW v1
as SELECT * from tb2 limit 100 ;
@@ -1794,7 +1799,9 @@ ERROR HY000: View's SELECT contains a subquery in the FROM clause
SELECT * FROM test.v1 ;
ERROR 42S02: Table 'test.v1' doesn't exist
Drop view if exists test.v1 ;
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.40
+--------------------------------------------------------------------------------
Drop view if exists test.v1 ;
Set @var1 = 'ABC' ;
Set @var2 = 'XYZ' ;
@@ -1803,7 +1810,9 @@ ERROR HY000: View's SELECT contains a variable or parameter
CREATE VIEW test.v1 AS SELECT @@global.sort_buffer_size;
ERROR HY000: View's SELECT contains a variable or parameter
Drop view if exists test.v1 ;
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.41
+--------------------------------------------------------------------------------
Drop view if exists test.v1 ;
Drop procedure if exists sp1 ;
Create procedure sp1() DETERMINISTIC
@@ -1820,7 +1829,9 @@ Warnings:
Note 1051 Unknown table 'test.v1'
Drop procedure sp1 ;
ERROR 42000: PROCEDURE test.sp1 does not exist
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.42
+--------------------------------------------------------------------------------
Drop VIEW if exists test.v1 ;
CREATE TEMPORARY VIEW test.v1 AS
SELECT * FROM test.tb2 limit 2 ;
@@ -1832,7 +1843,9 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SELECT * FROM test.tb2 limit 2' at line 1
Drop view if exists test.v1 ;
Use test;
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.43
+--------------------------------------------------------------------------------
Drop view if exists test.v1 ;
CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2;
INSERT INTO test.v1 values(122,432);
diff --git a/mysql-test/suite/funcs_1/r/memory_views.warnings b/mysql-test/suite/funcs_1/r/memory_views.warnings
deleted file mode 100644
index 2c9dc825a5d..00000000000
--- a/mysql-test/suite/funcs_1/r/memory_views.warnings
+++ /dev/null
@@ -1,2 +0,0 @@
-mysqltest: Warning detected in included file ./suite/funcs_1/views/views_master.inc at line 3039: Suspicious command '--eror 1116' detected, was this intentional? Use # instead of -- to avoid this warning
-mysqltest: Warning detected in included file ./suite/funcs_1/views/views_master.inc at line 3050: Suspicious command '--eror 1116' detected, was this intentional? Use # instead of -- to avoid this warning
diff --git a/mysql-test/suite/funcs_1/r/myisam__datadict.result b/mysql-test/suite/funcs_1/r/myisam__datadict.result
index 484b7a7f5e9..e9082e7aee7 100644
--- a/mysql-test/suite/funcs_1/r/myisam__datadict.result
+++ b/mysql-test/suite/funcs_1/r/myisam__datadict.result
@@ -446,13 +446,11 @@ LENGTH( SUBSTRING( u,
LENGTH( SUBSTRING_INDEX(u, _utf8'@',1)) +3 )) - 1 )
AS Server_Clean
FROM db_datadict.vu1;
-SELECT * FROM db_datadict.vu;
+SELECT * FROM db_datadict.vu order by u;
u server Server_Clean
-'root'@'localhost' localhost' localhost
'root'@'127.0.0.1' 127.0.0.1' 127.0.0.1
-''@'localhost' localhost' localhost
'root'@'<SERVER_NAME>' <SERVER_NAME>' <SERVER_NAME>
-''@'<SERVER_NAME>' <SERVER_NAME>' <SERVER_NAME>
+'root'@'localhost' localhost' localhost
CREATE PROCEDURE db_datadict.sp_1()
BEGIN
SELECT * FROM db_datadict.v1;
@@ -502,7 +500,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -523,7 +521,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -544,7 +542,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -565,7 +563,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -586,7 +584,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -607,7 +605,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -628,7 +626,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -649,7 +647,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -670,7 +668,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -691,7 +689,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -712,7 +710,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -733,7 +731,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -754,7 +752,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -775,7 +773,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -796,7 +794,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -817,7 +815,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -840,7 +838,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -861,7 +859,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -882,7 +880,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -903,7 +901,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -924,7 +922,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -945,7 +943,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -966,7 +964,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -987,7 +985,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1008,7 +1006,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1029,7 +1027,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1050,7 +1048,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -1071,7 +1069,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1092,7 +1090,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -1113,7 +1111,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -1134,7 +1132,7 @@ DATA_FREE #DF#
AUTO_INCREMENT 6
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1155,7 +1153,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1176,7 +1174,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1197,7 +1195,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1218,7 +1216,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1230,7 +1228,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 5
+TABLE_ROWS 3
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1239,7 +1237,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -1260,7 +1258,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1281,7 +1279,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1302,7 +1300,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1323,7 +1321,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1344,7 +1342,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1365,7 +1363,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1386,7 +1384,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1407,7 +1405,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1428,7 +1426,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1449,7 +1447,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1470,7 +1468,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1491,7 +1489,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1512,7 +1510,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1533,7 +1531,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -1554,7 +1552,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -2128,9 +2126,9 @@ NULL mysql proc language 5 SQL NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('
NULL mysql proc sql_data_access 6 CONTAINS_SQL NO enum 17 51 NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') select,insert,update,references
NULL mysql proc is_deterministic 7 NO NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
NULL mysql proc security_type 8 DEFINER NO enum 7 21 NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER') select,insert,update,references
-NULL mysql proc param_list 9 NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
+NULL mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
NULL mysql proc returns 10 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
-NULL mysql proc body 11 NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
NULL mysql proc definer 12 NO char 77 231 NULL NULL utf8 utf8_bin char(77) select,insert,update,references
NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
NULL mysql proc modified 14 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
@@ -2618,7 +2616,7 @@ NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A 0 NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 2 Db A NULL NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 3 User A 2 NULL NULL BTREE
-NULL mysql db 1 mysql User 1 User A NULL NULL NULL BTREE
+NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
@@ -2652,91 +2650,89 @@ NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A 393 NULL NUL
NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A NULL NULL NULL BTREE
NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A 31 NULL NULL BTREE
NULL mysql user 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
-NULL mysql user 0 mysql PRIMARY 2 User A 5 NULL NULL BTREE
+NULL mysql user 0 mysql PRIMARY 2 User A 3 NULL NULL BTREE
select * from views;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ select `tables`.`TABLE_CATALOG` AS `TABLE_CATALOG`,`tables`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`tables`.`TABLE_NAME` AS `TABLE_NAME`,`tables`.`TABLE_TYPE` AS `TABLE_TYPE`,`tables`.`ENGINE` AS `ENGINE`,`tables`.`VERSION` AS `VERSION`,`tables`.`ROW_FORMAT` AS `ROW_FORMAT`,`tables`.`TABLE_ROWS` AS `TABLE_ROWS`,`tables`.`AVG_ROW_LENGTH` AS `AVG_ROW_LENGTH`,`tables`.`DATA_LENGTH` AS `DATA_LENGTH`,`tables`.`MAX_DATA_LENGTH` AS `MAX_DATA_LENGTH`,`tables`.`INDEX_LENGTH` AS `INDEX_LENGTH`,`tables`.`DATA_FREE` AS `DATA_FREE`,`tables`.`AUTO_INCREMENT` AS `AUTO_INCREMENT`,`tables`.`CREATE_TIME` AS `CREATE_TIME`,`tables`.`UPDATE_TIME` AS `UPDATE_TIME`,`tables`.`CHECK_TIME` AS `CHECK_TIME`,`tables`.`TABLE_COLLATION` AS `TABLE_COLLATION`,`tables`.`CHECKSUM` AS `CHECKSUM`,`tables`.`CREATE_OPTIONS` AS `CREATE_OPTIONS`,`tables`.`TABLE_COMMENT` AS `TABLE_COMMENT` from `information_schema`.`tables` NONE NO root@localhost DEFINER
NULL db_datadict vu /* ALGORITHM=UNDEFINED */ select distinct `vu1`.`u` AS `u`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3)) AS `server`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3),(length(substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3))) - 1)) AS `Server_Clean` from `db_datadict`.`vu1` NONE NO root@localhost DEFINER
NULL db_datadict vu1 /* ALGORITHM=UNDEFINED */ select `user_privileges`.`GRANTEE` AS `u` from `information_schema`.`user_privileges` NONE NO root@localhost DEFINER
-select * from user_privileges;
+select * from user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select * from schema_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
''@'%' NULL test SELECT NO
@@ -2906,11 +2902,12 @@ Table or view 'tb2' is associated with the database 'test1'.
Table or view 't6' is associated with the database 'test4'.
select grantee as "user's having select privilege",
substring( grantee, length(SUBSTRING_INDEX(grantee,_utf8'@',1))+2 )
-from user_privileges where privilege_type = 'select';
+from user_privileges where privilege_type = 'select'
+ order by grantee;
user's having select privilege substring( grantee, length(SUBSTRING_INDEX(grantee,_utf8'@',1))+2 )
-'root'@'localhost' 'localhost'
'root'@'127.0.0.1' '127.0.0.1'
'root'@'<SERVER_NAME>' '<SERVER_NAME>'
+'root'@'localhost' 'localhost'
select all table_schema from schema_privileges limit 0,5;
table_schema
test
@@ -3143,7 +3140,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3164,7 +3161,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3185,7 +3182,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3206,7 +3203,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3227,7 +3224,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3248,7 +3245,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3269,7 +3266,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3290,7 +3287,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3311,7 +3308,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3332,7 +3329,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3353,7 +3350,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3374,7 +3371,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3395,7 +3392,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3416,7 +3413,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3437,7 +3434,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3458,7 +3455,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
@@ -3481,7 +3478,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -3502,7 +3499,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -3523,7 +3520,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
@@ -3544,7 +3541,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3565,7 +3562,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3586,7 +3583,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3607,7 +3604,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3628,7 +3625,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3649,7 +3646,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3670,7 +3667,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3691,7 +3688,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3712,7 +3709,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3733,7 +3730,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3754,7 +3751,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3775,7 +3772,7 @@ DATA_FREE #DF#
AUTO_INCREMENT 6
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3796,7 +3793,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3817,7 +3814,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3838,7 +3835,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3859,7 +3856,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3871,7 +3868,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 5
+TABLE_ROWS 3
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -3880,7 +3877,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION utf8_bin
CHECKSUM NULL
CREATE_OPTIONS
@@ -3901,7 +3898,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3922,7 +3919,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3943,7 +3940,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3964,7 +3961,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -3985,7 +3982,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4006,7 +4003,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4027,7 +4024,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4048,7 +4045,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4069,7 +4066,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4090,7 +4087,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4111,7 +4108,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4132,7 +4129,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4153,7 +4150,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4174,7 +4171,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4195,7 +4192,7 @@ DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME YYYY-MM-DD hh:mm:ss
UPDATE_TIME YYYY-MM-DD hh:mm:ss
-CHECK_TIME NULL
+CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
@@ -4623,7 +4620,7 @@ COUNT(*)
3
SELECT COUNT(*) FROM information_schema. user_privileges ;
COUNT(*)
-77
+75
SELECT COUNT(*) FROM information_schema. schema_privileges ;
COUNT(*)
28
@@ -4692,7 +4689,7 @@ TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_
NULL mysql procs_priv 1 mysql Grantor 1 Grantor A NULL NULL NULL BTREE
NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
-NULL mysql db 1 mysql User 1 User A NULL NULL NULL BTREE
+NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
select concat(table_schema, ', ', table_name, ', ', view_definition) view_info
from views;
view_info
@@ -4747,13 +4744,11 @@ test, tb3
test, tb4
test1, tb2
test4, t6
-select distinct grantee from user_privileges;
+select distinct grantee from user_privileges order by grantee, privilege_type;
grantee
-'root'@'localhost'
'root'@'127.0.0.1'
-''@'localhost'
'root'@'<SERVER_NAME>'
-''@'<SERVER_NAME>'
+'root'@'localhost'
select * from schema_privileges where table_catalog is null limit 0, 5;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
''@'%' NULL test SELECT NO
@@ -4790,37 +4785,10 @@ NULL test1 latin1 latin1_swedish_ci NULL
select distinct grantee from user_privileges;
grantee
'root'@'localhost'
-'root'@'127.0.0.1'
-''@'localhost'
'root'@'<SERVER_NAME>'
-''@'<SERVER_NAME>'
-select all grantee from user_privileges;
+'root'@'127.0.0.1'
+select all grantee from user_privileges order by grantee, privilege_type;
grantee
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
-'root'@'localhost'
'root'@'127.0.0.1'
'root'@'127.0.0.1'
'root'@'127.0.0.1'
@@ -4846,7 +4814,6 @@ grantee
'root'@'127.0.0.1'
'root'@'127.0.0.1'
'root'@'127.0.0.1'
-''@'localhost'
'root'@'<SERVER_NAME>'
'root'@'<SERVER_NAME>'
'root'@'<SERVER_NAME>'
@@ -4872,7 +4839,31 @@ grantee
'root'@'<SERVER_NAME>'
'root'@'<SERVER_NAME>'
'root'@'<SERVER_NAME>'
-''@'<SERVER_NAME>'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
+'root'@'localhost'
select id , character_set_name from collations order by id asc limit 10;
id character_set_name
1 big5
@@ -6345,85 +6336,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -6492,86 +6481,84 @@ where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
res_t_401013 db_datadict i_6_401013 BTREE
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-'u_6_401013'@'localhost' NULL USAGE NO
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
+'u_6_401013'@'localhost' NULL USAGE NO
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -6625,85 +6612,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -6770,85 +6755,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -6911,85 +6894,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -7065,86 +7046,84 @@ where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
res_t_401015 db_datadict i_6_401015 BTREE
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-'u_6_401015'@'localhost' NULL USAGE NO
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
+'u_6_401015'@'localhost' NULL USAGE NO
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -7197,85 +7176,83 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges;
+from information_schema.user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'root'@'localhost' NULL SELECT YES
-'root'@'localhost' NULL INSERT YES
-'root'@'localhost' NULL UPDATE YES
-'root'@'localhost' NULL DELETE YES
-'root'@'localhost' NULL CREATE YES
-'root'@'localhost' NULL DROP YES
-'root'@'localhost' NULL RELOAD YES
-'root'@'localhost' NULL SHUTDOWN YES
-'root'@'localhost' NULL PROCESS YES
-'root'@'localhost' NULL FILE YES
-'root'@'localhost' NULL REFERENCES YES
-'root'@'localhost' NULL INDEX YES
-'root'@'localhost' NULL ALTER YES
-'root'@'localhost' NULL SHOW DATABASES YES
-'root'@'localhost' NULL SUPER YES
-'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
-'root'@'localhost' NULL LOCK TABLES YES
-'root'@'localhost' NULL EXECUTE YES
-'root'@'localhost' NULL REPLICATION SLAVE YES
-'root'@'localhost' NULL REPLICATION CLIENT YES
-'root'@'localhost' NULL CREATE VIEW YES
-'root'@'localhost' NULL SHOW VIEW YES
-'root'@'localhost' NULL CREATE ROUTINE YES
-'root'@'localhost' NULL ALTER ROUTINE YES
-'root'@'localhost' NULL CREATE USER YES
-'root'@'127.0.0.1' NULL SELECT YES
-'root'@'127.0.0.1' NULL INSERT YES
-'root'@'127.0.0.1' NULL UPDATE YES
-'root'@'127.0.0.1' NULL DELETE YES
+'root'@'127.0.0.1' NULL ALTER YES
+'root'@'127.0.0.1' NULL ALTER ROUTINE YES
'root'@'127.0.0.1' NULL CREATE YES
+'root'@'127.0.0.1' NULL CREATE ROUTINE YES
+'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL CREATE USER YES
+'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL DELETE YES
'root'@'127.0.0.1' NULL DROP YES
-'root'@'127.0.0.1' NULL RELOAD YES
-'root'@'127.0.0.1' NULL SHUTDOWN YES
-'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL EXECUTE YES
'root'@'127.0.0.1' NULL FILE YES
-'root'@'127.0.0.1' NULL REFERENCES YES
'root'@'127.0.0.1' NULL INDEX YES
-'root'@'127.0.0.1' NULL ALTER YES
-'root'@'127.0.0.1' NULL SHOW DATABASES YES
-'root'@'127.0.0.1' NULL SUPER YES
-'root'@'127.0.0.1' NULL CREATE TEMPORARY TABLES YES
+'root'@'127.0.0.1' NULL INSERT YES
'root'@'127.0.0.1' NULL LOCK TABLES YES
-'root'@'127.0.0.1' NULL EXECUTE YES
-'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL PROCESS YES
+'root'@'127.0.0.1' NULL REFERENCES YES
+'root'@'127.0.0.1' NULL RELOAD YES
'root'@'127.0.0.1' NULL REPLICATION CLIENT YES
-'root'@'127.0.0.1' NULL CREATE VIEW YES
+'root'@'127.0.0.1' NULL REPLICATION SLAVE YES
+'root'@'127.0.0.1' NULL SELECT YES
+'root'@'127.0.0.1' NULL SHOW DATABASES YES
'root'@'127.0.0.1' NULL SHOW VIEW YES
-'root'@'127.0.0.1' NULL CREATE ROUTINE YES
-'root'@'127.0.0.1' NULL ALTER ROUTINE YES
-'root'@'127.0.0.1' NULL CREATE USER YES
-''@'localhost' NULL USAGE NO
-'root'@'<SERVER_NAME>' NULL SELECT YES
-'root'@'<SERVER_NAME>' NULL INSERT YES
-'root'@'<SERVER_NAME>' NULL UPDATE YES
-'root'@'<SERVER_NAME>' NULL DELETE YES
+'root'@'127.0.0.1' NULL SHUTDOWN YES
+'root'@'127.0.0.1' NULL SUPER YES
+'root'@'127.0.0.1' NULL UPDATE YES
+'root'@'<SERVER_NAME>' NULL ALTER YES
+'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
'root'@'<SERVER_NAME>' NULL CREATE YES
+'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
+'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL CREATE USER YES
+'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL DELETE YES
'root'@'<SERVER_NAME>' NULL DROP YES
-'root'@'<SERVER_NAME>' NULL RELOAD YES
-'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
-'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL EXECUTE YES
'root'@'<SERVER_NAME>' NULL FILE YES
-'root'@'<SERVER_NAME>' NULL REFERENCES YES
'root'@'<SERVER_NAME>' NULL INDEX YES
-'root'@'<SERVER_NAME>' NULL ALTER YES
-'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
-'root'@'<SERVER_NAME>' NULL SUPER YES
-'root'@'<SERVER_NAME>' NULL CREATE TEMPORARY TABLES YES
+'root'@'<SERVER_NAME>' NULL INSERT YES
'root'@'<SERVER_NAME>' NULL LOCK TABLES YES
-'root'@'<SERVER_NAME>' NULL EXECUTE YES
-'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL PROCESS YES
+'root'@'<SERVER_NAME>' NULL REFERENCES YES
+'root'@'<SERVER_NAME>' NULL RELOAD YES
'root'@'<SERVER_NAME>' NULL REPLICATION CLIENT YES
-'root'@'<SERVER_NAME>' NULL CREATE VIEW YES
+'root'@'<SERVER_NAME>' NULL REPLICATION SLAVE YES
+'root'@'<SERVER_NAME>' NULL SELECT YES
+'root'@'<SERVER_NAME>' NULL SHOW DATABASES YES
'root'@'<SERVER_NAME>' NULL SHOW VIEW YES
-'root'@'<SERVER_NAME>' NULL CREATE ROUTINE YES
-'root'@'<SERVER_NAME>' NULL ALTER ROUTINE YES
-'root'@'<SERVER_NAME>' NULL CREATE USER YES
-''@'<SERVER_NAME>' NULL USAGE NO
+'root'@'<SERVER_NAME>' NULL SHUTDOWN YES
+'root'@'<SERVER_NAME>' NULL SUPER YES
+'root'@'<SERVER_NAME>' NULL UPDATE YES
+'root'@'localhost' NULL ALTER YES
+'root'@'localhost' NULL ALTER ROUTINE YES
+'root'@'localhost' NULL CREATE YES
+'root'@'localhost' NULL CREATE ROUTINE YES
+'root'@'localhost' NULL CREATE TEMPORARY TABLES YES
+'root'@'localhost' NULL CREATE USER YES
+'root'@'localhost' NULL CREATE VIEW YES
+'root'@'localhost' NULL DELETE YES
+'root'@'localhost' NULL DROP YES
+'root'@'localhost' NULL EXECUTE YES
+'root'@'localhost' NULL FILE YES
+'root'@'localhost' NULL INDEX YES
+'root'@'localhost' NULL INSERT YES
+'root'@'localhost' NULL LOCK TABLES YES
+'root'@'localhost' NULL PROCESS YES
+'root'@'localhost' NULL REFERENCES YES
+'root'@'localhost' NULL RELOAD YES
+'root'@'localhost' NULL REPLICATION CLIENT YES
+'root'@'localhost' NULL REPLICATION SLAVE YES
+'root'@'localhost' NULL SELECT YES
+'root'@'localhost' NULL SHOW DATABASES YES
+'root'@'localhost' NULL SHOW VIEW YES
+'root'@'localhost' NULL SHUTDOWN YES
+'root'@'localhost' NULL SUPER YES
+'root'@'localhost' NULL UPDATE YES
select *
from information_schema.column_privileges
where table_schema like 'db_datadict%';
@@ -9205,9 +9182,9 @@ NULL mysql proc language 5 SQL NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('
NULL mysql proc sql_data_access 6 CONTAINS_SQL NO enum 17 51 NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') select,insert,update,references
NULL mysql proc is_deterministic 7 NO NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
NULL mysql proc security_type 8 DEFINER NO enum 7 21 NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER') select,insert,update,references
-NULL mysql proc param_list 9 NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
+NULL mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
NULL mysql proc returns 10 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
-NULL mysql proc body 11 NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
+NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
NULL mysql proc definer 12 NO char 77 231 NULL NULL utf8 utf8_bin char(77) select,insert,update,references
NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
NULL mysql proc modified 14 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
@@ -12180,178 +12157,178 @@ GRANT SELECT ON db_datadict.v3 to 'user_3'@'localhost';
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
+NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL NULL VIEW
-NULL test t1 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t10 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t11 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t2 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t3 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t4 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t7 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t8 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t9 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb2 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb3 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb4 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
+NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW
+NULL test t1 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb2 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb3 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb4 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
connect(localhost,user_2,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
+NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t1 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t10 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t11 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t2 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t3 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t4 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t7 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t8 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t9 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb2 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb3 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb4 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
+NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t1 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb2 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb3 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb4 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
connect(localhost,user_3,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
+NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL NULL VIEW
-NULL test t1 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t10 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t11 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t2 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t3 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t4 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t7 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t8 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t9 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb2 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb3 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb4 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
+NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW
+NULL test t1 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb2 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb3 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb4 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
root@localhost db_datadict
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
-NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL #CO#
+NULL information_schema CHARACTER_SETS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATIONS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMNS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema COLUMN_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema ROUTINES SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema STATISTICS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TABLE_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 0 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema VIEWS SYSTEM VIEW MyISAM 0 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
SELECT * FROM information_schema.tables
WHERE NOT( table_schema = 'information_schema');
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL NULL VIEW
-NULL mysql columns_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Column privileges
-NULL mysql db BASE TABLE MyISAM 10 Fixed 3 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Database privileges
-NULL mysql func BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL User defined functions
-NULL mysql help_category BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL help categories
-NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL help keywords
-NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL keyword-topic relation
-NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL help topics
-NULL mysql host BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Host privileges; Merged with database privileges
-NULL mysql proc BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Stored Procedures
-NULL mysql procs_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Procedure privileges
-NULL mysql tables_priv BASE TABLE MyISAM 10 Fixed 5 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Table privileges
-NULL mysql time_zone BASE TABLE MyISAM 10 Fixed 5 #ARL# #DL# #MDL# #IL# #DF# 6 YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Time zones
-NULL mysql time_zone_leap_second BASE TABLE MyISAM 10 Fixed 22 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Leap seconds information for time zones
-NULL mysql time_zone_name BASE TABLE MyISAM 10 Fixed 6 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Time zone names
-NULL mysql time_zone_transition BASE TABLE MyISAM 10 Fixed 393 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Time zone transitions
-NULL mysql time_zone_transition_type BASE TABLE MyISAM 10 Fixed 31 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_general_ci NULL Time zone transition types
-NULL mysql user BASE TABLE MyISAM 10 Dynamic 8 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL utf8_bin NULL Users and global privileges
-NULL test t1 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t10 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t11 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t2 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t3 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t4 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t7 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t8 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test t9 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb2 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb3 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test tb4 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test1 tb2 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
-NULL test4 t6 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL latin1_swedish_ci NULL
+NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW
+NULL mysql columns_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Column privileges
+NULL mysql db BASE TABLE MyISAM 10 Fixed 3 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Database privileges
+NULL mysql func BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL User defined functions
+NULL mysql help_category BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
+NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
+NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
+NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
+NULL mysql host BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Host privileges; Merged with database privileges
+NULL mysql proc BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Stored Procedures
+NULL mysql procs_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Procedure privileges
+NULL mysql tables_priv BASE TABLE MyISAM 10 Fixed 5 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Table privileges
+NULL mysql time_zone BASE TABLE MyISAM 10 Fixed 5 #ARL# #DL# #MDL# #IL# #DF# 6 YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zones
+NULL mysql time_zone_leap_second BASE TABLE MyISAM 10 Fixed 22 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Leap seconds information for time zones
+NULL mysql time_zone_name BASE TABLE MyISAM 10 Fixed 6 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone names
+NULL mysql time_zone_transition BASE TABLE MyISAM 10 Fixed 393 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone transitions
+NULL mysql time_zone_transition_type BASE TABLE MyISAM 10 Fixed 31 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone transition types
+NULL mysql user BASE TABLE MyISAM 10 Dynamic 6 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Users and global privileges
+NULL test t1 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb2 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb3 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb4 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test1 tb2 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test4 t6 BASE TABLE MyISAM 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
DROP USER 'user_1'@'localhost';
DROP USER 'user_2'@'localhost';
DROP USER 'user_3'@'localhost';
@@ -12563,7 +12540,7 @@ NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A 0 NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 2 Db A NULL NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 3 User A 2 NULL NULL BTREE
-NULL mysql db 1 mysql User 1 User A NULL NULL NULL BTREE
+NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
@@ -12597,7 +12574,7 @@ NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A 393 NULL NUL
NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A NULL NULL NULL BTREE
NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A 31 NULL NULL BTREE
NULL mysql user 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
-NULL mysql user 0 mysql PRIMARY 2 User A 7 NULL NULL BTREE
+NULL mysql user 0 mysql PRIMARY 2 User A 5 NULL NULL BTREE
user_1@localhost test
SELECT * FROM information_schema.statistics;
diff --git a/mysql-test/suite/funcs_1/r/myisam_func_view.result b/mysql-test/suite/funcs_1/r/myisam_func_view.result
index 13fffecd365..4f8a1b23bc0 100644
--- a/mysql-test/suite/funcs_1/r/myisam_func_view.result
+++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result
@@ -3814,13 +3814,11 @@ CAST(my_time AS DATETIME) my_time id
NULL NULL 1
0000-00-00 00:00:00 -838:59:59 2
0000-00-00 00:00:00 838:59:59 3
-0000-00-00 00:00:00 13:00:00 4
-0000-00-00 00:00:00 10:00:00 5
+0000-00-00 13:00:00 13:00:00 4
+0000-00-00 10:00:00 10:00:00 5
Warnings:
Warning 1292 Truncated incorrect datetime value: '0000-00-00 838:59:59'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 838:59:59'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00 13:00:00'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:00:00'
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as datetime) AS `CAST(my_time AS DATETIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
@@ -3831,13 +3829,11 @@ CAST(my_time AS DATETIME) my_time id
NULL NULL 1
0000-00-00 00:00:00 -838:59:59 2
0000-00-00 00:00:00 838:59:59 3
-0000-00-00 00:00:00 13:00:00 4
-0000-00-00 00:00:00 10:00:00 5
+0000-00-00 13:00:00 13:00:00 4
+0000-00-00 10:00:00 10:00:00 5
Warnings:
Warning 1292 Truncated incorrect datetime value: '0000-00-00 838:59:59'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 838:59:59'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00 13:00:00'
-Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:00:00'
DROP VIEW v1;
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_08.result b/mysql-test/suite/funcs_1/r/myisam_trig_08.result
index 8a13e91d71d..ec8e12ff32d 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_08.result
@@ -484,8 +484,9 @@ BEGIN
WHILE @counter1 < new.f136
SET @counter1 = @counter1 + 1;
END//
-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 'SET @counter1 = @counter1 + 1;
-END' at line 4
+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 'WHILE @counter1 < new.f136
+SET @counter1 = @counter1 + 1;
+END' at line 3
delete from tb3 where f122='Test 3.5.8.5-while';
drop trigger trg7;
diff --git a/mysql-test/suite/funcs_1/r/myisam_views.result b/mysql-test/suite/funcs_1/r/myisam_views.result
index 3a76024cf80..1dbebbccb29 100644
--- a/mysql-test/suite/funcs_1/r/myisam_views.result
+++ b/mysql-test/suite/funcs_1/r/myisam_views.result
@@ -470,7 +470,8 @@ SET @x=0;
CREATE or REPLACE VIEW v1 AS Select 1 INTO @x;
ERROR HY000: View's SELECT contains a 'INTO' clause
Select @x;
-ERROR HY000: View's SELECT contains a variable or parameter
+@x
+0
CREATE or REPLACE VIEW v1 AS Select 1
FROM (SELECT 1 FROM t1) my_table;
ERROR HY000: View's SELECT contains a subquery in the FROM clause
@@ -607,7 +608,9 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
CREATE or REPLACE view v1 as Select f59, f60
from tb2 by group f59 ;
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 'by group f59' at line 2
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.5
+--------------------------------------------------------------------------------
DROP VIEW IF EXISTS v1 ;
CREATE VIEW v1 SELECT * FROM tb2 limit 100 ;
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 'SELECT * FROM tb2 limit 100' at line 1
@@ -627,7 +630,9 @@ CREATE VIEW v1 SELECT 1;
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 'SELECT 1' at line 1
CREATE VIEW v1 AS ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.6
+--------------------------------------------------------------------------------
DROP VIEW IF EXISTS v1 ;
CREATE or REPLACE VIEW v1
as SELECT * from tb2 limit 100 ;
@@ -1812,7 +1817,9 @@ ERROR HY000: View's SELECT contains a subquery in the FROM clause
SELECT * FROM test.v1 ;
ERROR 42S02: Table 'test.v1' doesn't exist
Drop view if exists test.v1 ;
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.40
+--------------------------------------------------------------------------------
Drop view if exists test.v1 ;
Set @var1 = 'ABC' ;
Set @var2 = 'XYZ' ;
@@ -1821,7 +1828,9 @@ ERROR HY000: View's SELECT contains a variable or parameter
CREATE VIEW test.v1 AS SELECT @@global.sort_buffer_size;
ERROR HY000: View's SELECT contains a variable or parameter
Drop view if exists test.v1 ;
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.41
+--------------------------------------------------------------------------------
Drop view if exists test.v1 ;
Drop procedure if exists sp1 ;
Create procedure sp1() DETERMINISTIC
@@ -1838,7 +1847,9 @@ Warnings:
Note 1051 Unknown table 'test.v1'
Drop procedure sp1 ;
ERROR 42000: PROCEDURE test.sp1 does not exist
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.42
+--------------------------------------------------------------------------------
Drop VIEW if exists test.v1 ;
CREATE TEMPORARY VIEW test.v1 AS
SELECT * FROM test.tb2 limit 2 ;
@@ -1850,7 +1861,9 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SELECT * FROM test.tb2 limit 2' at line 1
Drop view if exists test.v1 ;
Use test;
-ERROR HY000: View's SELECT contains a variable or parameter
+
+Testcase 3.3.1.43
+--------------------------------------------------------------------------------
Drop view if exists test.v1 ;
CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2;
INSERT INTO test.v1 values(122,432);
diff --git a/mysql-test/suite/funcs_1/r/myisam_views.warnings b/mysql-test/suite/funcs_1/r/myisam_views.warnings
deleted file mode 100644
index 2c9dc825a5d..00000000000
--- a/mysql-test/suite/funcs_1/r/myisam_views.warnings
+++ /dev/null
@@ -1,2 +0,0 @@
-mysqltest: Warning detected in included file ./suite/funcs_1/views/views_master.inc at line 3039: Suspicious command '--eror 1116' detected, was this intentional? Use # instead of -- to avoid this warning
-mysqltest: Warning detected in included file ./suite/funcs_1/views/views_master.inc at line 3050: Suspicious command '--eror 1116' detected, was this intentional? Use # instead of -- to avoid this warning
diff --git a/mysql-test/suite/funcs_1/t/a_version_check.test b/mysql-test/suite/funcs_1/t/a_version_check.test
deleted file mode 100755
index 60bd5b3c161..00000000000
--- a/mysql-test/suite/funcs_1/t/a_version_check.test
+++ /dev/null
@@ -1,29 +0,0 @@
-#### suite/funcs_1/t/a_version_check.test
-#
-# just a simple check of the version to be sure the correct server version is
-# checked against the funcs_1 tests.
-
-# just show machine and version to be sure we are testing the correct files
-#
-let $message= . Just show the version string for which the results in suite
- . funcs_1 have been checked.
- .
- . I know that the .result file of this check needs to
- . updated with each new version --- THIS IS INTENDED!;
---source include/show_msg.inc
-
---disable_query_log
-SELECT CONCAT('funcs_1 checked with version: ', SUBSTR(version(), 1, 6 ) ) AS " ";
-#SELECT CONCAT('aa = ', 'bb');
-#SELECT CONCAT('aa = ', 'bb') AS " ";
-
-if (0)
-{
- # these more detailed results create differences between the OS.
- # mioght be used later when we enable OS dependent .result files
- --vertical_results
- SELECT @@version_compile_os AS 'vers_comp_os', current_date;
- SHOW VARIABLES LIKE 'vers%';
- --horizontal_results
-}
-
diff --git a/mysql-test/suite/funcs_1/t/disabled.def b/mysql-test/suite/funcs_1/t/disabled.def
index e65cc8e934c..6833178a353 100644
--- a/mysql-test/suite/funcs_1/t/disabled.def
+++ b/mysql-test/suite/funcs_1/t/disabled.def
@@ -10,6 +10,6 @@
#
##############################################################################
-innodb_storedproc: switched off (too much changed output from WL#2984, needs to be checked)
-memory_storedproc: switched off (too much changed output from WL#2984, needs to be checked)
-myisam_storedproc: switched off (too much changed output from WL#2984, needs to be checked)
+innodb_storedproc: (changes of WL#2984, using storeproc_nn instead)
+memory_storedproc: (changes of WL#2984, using storeproc_nn instead)
+myisam_storedproc: (changes of WL#2984, using storeproc_nn instead)
diff --git a/mysql-test/suite/funcs_1/views/views_master.inc b/mysql-test/suite/funcs_1/views/views_master.inc
index f01b1b01c1f..b06873af159 100644
--- a/mysql-test/suite/funcs_1/views/views_master.inc
+++ b/mysql-test/suite/funcs_1/views/views_master.inc
@@ -3036,7 +3036,9 @@ let $sublevel= `SELECT @max_level`;
eval CREATE VIEW test1.v$level AS SELECT f1, f2
FROM test3.t1 tab1 NATURAL JOIN test1.v$sublevel tab2;
eval SHOW CREATE VIEW test1.v$level;
---eror 1116
+# the following line as written as '--eror 1116' and the command
+# is successful so assuming no expected error was intended
+# --error 1116
eval SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v$level;
let $message= The output of following EXPLAIN is deactivated, because the result
@@ -3047,7 +3049,9 @@ if (1)
{
--disable_result_log
}
---eror 1116
+# the following line as written as '--eror 1116' and the command
+# is successful so assuming no expected error was intended
+# --error 1116
eval EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v$level;
if (1)
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 83686f31e9e..3ced1087757 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -662,3 +662,25 @@ insert into t1 values (null);
select * from t1;
drop table t1;
+
+#
+# Bug#27507: Wrong DATETIME value was allowed by ALTER TABLE in the
+# NO_ZERO_DATE mode.
+#
+set @orig_sql_mode = @@sql_mode;
+set sql_mode="no_zero_date";
+create table t1(f1 int);
+alter table t1 add column f2 datetime not null, add column f21 date not null;
+insert into t1 values(1,'2000-01-01','2000-01-01');
+--error 1292
+alter table t1 add column f3 datetime not null;
+--error 1292
+alter table t1 add column f3 date not null;
+--error 1292
+alter table t1 add column f4 datetime not null default '2002-02-02',
+ add column f41 date not null;
+alter table t1 add column f4 datetime not null default '2002-02-02',
+ add column f41 date not null default '2002-02-02';
+select * from t1;
+drop table t1;
+set sql_mode= @orig_sql_mode;
diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test
index a3339ecce69..6ff4144aaf2 100644
--- a/mysql-test/t/backup.test
+++ b/mysql-test/t/backup.test
@@ -1,3 +1,8 @@
+
+# The server need to be started in $MYSQLTEST_VARDIR since it
+# uses ../std_data_ln/
+-- source include/uses_vardir.inc
+
#
# This test is a bit tricky as we can't use backup table to overwrite an old
# table
diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test
index 6c1229db83f..9a5fb11229d 100644
--- a/mysql-test/t/bigint.test
+++ b/mysql-test/t/bigint.test
@@ -288,3 +288,9 @@ insert into t1 values (10000002383263201056);
select c1 mod 50 as result from t1;
drop table t1;
+#
+# Bug #8663 cant use bgint unsigned as input to cast
+#
+
+select cast(19999999999999999999 as signed);
+select cast(-19999999999999999999 as signed);
diff --git a/mysql-test/t/binlog.test b/mysql-test/t/binlog.test
index 1063940d378..7c307cb3f94 100644
--- a/mysql-test/t/binlog.test
+++ b/mysql-test/t/binlog.test
@@ -4,6 +4,7 @@
-- source include/not_embedded.inc
-- source include/have_bdb.inc
-- source include/have_innodb.inc
+-- source include/have_log_bin.inc
--disable_warnings
drop table if exists t1, t2;
@@ -19,7 +20,7 @@ begin;
insert t2 values (5);
commit;
# first COMMIT must be Query_log_event, second - Xid_log_event
---replace_result "xid=21" "xid=12"
+--replace_result "xid=22" "xid=13"
--replace_column 2 # 5 #
show binlog events from 98;
drop table t1,t2;
@@ -41,7 +42,7 @@ while ($1)
--enable_query_log
commit;
drop table t1;
---replace_result "xid=32" "xid=19"
+--replace_result "xid=33" "xid=20"
--replace_column 2 # 5 #
show binlog events in 'master-bin.000001' from 98;
--replace_column 2 # 5 #
diff --git a/mysql-test/t/binlog_killed.test b/mysql-test/t/binlog_killed.test
new file mode 100644
index 00000000000..034895f17cb
--- /dev/null
+++ b/mysql-test/t/binlog_killed.test
@@ -0,0 +1,248 @@
+-- source include/have_innodb.inc
+--source include/not_embedded.inc
+--source include/have_log_bin.inc
+
+###
+### bug#22725 : incorrect killed error in binlogged query
+###
+
+connect (con1, localhost, root,,);
+connect (con2, localhost, root,,);
+
+create table t1 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB;
+create table t2 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=MyISAM;
+create table t3 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB;
+
+#
+# effective test for bug#22725
+#
+
+connection con1;
+select get_lock("a", 20);
+
+connection con2;
+let $ID= `select connection_id()`;
+reset master;
+send insert into t2 values (null, null), (null, get_lock("a", 10));
+
+
+connection con1;
+
+disable_abort_on_error;
+disable_query_log;
+disable_result_log;
+
+eval kill query $ID;
+
+connection con2;
+--error 0,ER_QUERY_INTERRUPTED
+reap;
+let $rows= `select count(*) from t2 /* must be 2 or 0 */`;
+
+--exec $MYSQL_BINLOG --start-position=126 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval select
+(@a:=load_file("$MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog"))
+is not null;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+let $error_code= `select @a like "%#%error_code=0%" /* must return 1 or 0*/`;
+let $insert_binlogged= `select @a like "%insert into%" /* must return 1 or 0 */`;
+eval set @result= $rows- $error_code - $insert_binlogged;
+
+enable_abort_on_error;
+enable_query_log;
+enable_result_log;
+
+select @result /* must be zero either way */;
+
+# the functions are either *insensitive* to killing or killing can cause
+# strange problmes with the error propagation out of SF's stack
+# Bug#27563, Bug#27565, BUG#24971
+#
+# TODO: use if's block as regression test for the bugs or remove
+#
+if (0)
+{
+delimiter |;
+create function bug27563()
+RETURNS int(11)
+DETERMINISTIC
+begin
+ select get_lock("a", 10) into @a;
+ return 1;
+end|
+delimiter ;|
+
+# the function is sensitive to killing requiring innodb though with wrong client error
+# TO FIX in BUG#27565; TODO: remove --error 1105 afterwards
+delimiter |;
+create function bug27565()
+RETURNS int(11)
+DETERMINISTIC
+begin
+ select a from t1 where a=1 into @a for update;
+ return 1;
+end|
+delimiter ;|
+
+reset master;
+
+
+### ta table case: killing causes rollback
+
+# A. autocommit ON
+connection con1;
+select get_lock("a", 20);
+
+connection con2;
+let $ID= `select connection_id()`;
+send insert into t1 values (bug27563(),1);
+
+connection con1;
+eval kill query $ID;
+
+connection con2;
+# todo (re-record test): after bugs 27563,27565 got fixed affected rows will report zero
+--enable_info
+# todo: remove 0 return after fixing Bug#27563
+--error 0,ER_QUERY_INTERRUPTED
+reap; ### pb: wrong error
+--disable_info
+###--replace_column 2 # 5 #
+### show binlog events from 98 /* nothing in binlog unless Bug#27563 */;
+show master status /* must be only FD event unless Bug#27563 */;
+select count(*) from t1 /* must be zero unless Bug#27563 */;
+
+# M. multi-statement-ta
+connection con2;
+let $ID= `select connection_id()`;
+begin;
+send insert into t1 values (bug27563(),1);
+
+connection con1;
+eval kill query $ID;
+connection con2;
+# todo (re-record test): after bugs 27563,27565 got fixed affected rows will report zero
+--enable_info
+# todo: remove 0 return after fixing Bug#27563
+--error 0,ER_QUERY_INTERRUPTED
+reap;
+--disable_info
+select count(*) from t1 /* must be zero unless Bug#27563 */;
+commit;
+
+
+### non-ta table case: killing must be recorded in binlog
+
+reset master;
+
+connection con2;
+let $ID= `select connection_id()`;
+send insert into t2 values (bug27563(),1);
+
+connection con1;
+eval kill query $ID;
+
+connection con2;
+# todo: remove 0 return after fixing Bug#27563
+--error 0,ER_QUERY_INTERRUPTED
+reap;
+select count(*) from t2 /* must be one */;
+#show binlog events from 98 /* must have the insert on non-ta table */;
+show master status /* must have the insert event more to FD */;
+# the value of the error flag of KILLED_QUERY is tested further
+
+connection con1;
+select RELEASE_LOCK("a");
+
+### test with effective killing of SF()
+
+delete from t1;
+delete from t2;
+insert into t1 values (1,1);
+insert into t2 values (1,1);
+
+#
+# Bug#27565
+# test where KILL is propagated as error to the top level
+# still another bug with the error message to the user
+# todo: fix reexecute the result file after fixing
+#
+begin; update t1 set b=0 where a=1;
+
+connection con2;
+let $ID= `select connection_id()`;
+send update t2 set b=bug27565()-1 where a=1;
+
+connection con1;
+eval kill query $ID;
+commit;
+
+connection con2;
+# todo: fix Bug #27565 killed query of SF() is not reported correctly and
+# remove 1105 (wrong)
+#--error ER_QUERY_INTERRUPTED
+--error 1105,ER_QUERY_INTERRUPTED
+reap; ### pb: wrong error
+select * from t1 /* must be: (1,0) */;
+select * from t2 /* must be as before: (1,1) */;
+
+## bug#22725 with effective and propagating killing
+#
+# top-level ta-table
+connection con1;
+delete from t3;
+reset master;
+begin; update t1 set b=0 where a=1;
+
+connection con2;
+let $ID= `select connection_id()`;
+# the query won't perform completely since the function gets interrupted
+send insert into t3 values (0,0),(1,bug27565());
+
+connection con1;
+eval kill query $ID;
+rollback;
+
+connection con2;
+# todo: fix Bug #27565 killed query of SF() is not reported correctly and
+# remove 1105 (wrong)
+#--error ER_QUERY_INTERRUPTED
+--error 1105,ER_QUERY_INTERRUPTED
+reap; ### pb: wrong error
+select count(*) from t3 /* must be zero */;
+show master status /* nothing in binlog */;
+
+# top-level non-ta-table
+connection con1;
+delete from t2;
+reset master;
+begin; update t1 set b=0 where a=1;
+
+connection con2;
+let $ID= `select connection_id()`;
+# the query won't perform completely since the function gets intrurrupted
+send insert into t2 values (0,0),(1,bug27565()) /* non-ta t2 */;
+
+connection con1;
+eval kill query $ID;
+rollback;
+
+connection con2;
+# todo: fix Bug #27565 killed query of SF() is not reported correctly and
+# remove 1105 (wrong)
+#--error ER_QUERY_INTERRUPTED
+--error 1105,ER_QUERY_INTERRUPTED
+reap; ### pb: wrong error
+
+select count(*) from t2 /* count must be one */;
+show master status /* insert into non-ta must be in binlog */;
+
+drop function bug27563;
+drop function bug27565;
+}
+
+system rm $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog ;
+
+drop table t1,t2,t3;
+
diff --git a/mysql-test/t/blackhole.test b/mysql-test/t/blackhole.test
index 4bafad2d777..d8ffdeb8312 100644
--- a/mysql-test/t/blackhole.test
+++ b/mysql-test/t/blackhole.test
@@ -4,6 +4,11 @@
#
-- source include/not_embedded.inc
-- source include/have_blackhole.inc
+-- source include/have_log_bin.inc
+
+# The server need to be started in $MYSQLTEST_VARDIR since it
+# uses ../std_data_ln/
+-- source include/uses_vardir.inc
--disable_warnings
drop table if exists t1,t2;
@@ -109,7 +114,7 @@ insert into t1 values(1);
insert ignore into t1 values(1);
replace into t1 values(100);
create table t2 (a varchar(200)) engine=blackhole;
-load data infile '../std_data_ln/words.dat' into table t2;
+eval load data infile '../std_data_ln/words.dat' into table t2;
alter table t1 add b int;
alter table t1 drop b;
create table t3 like t1;
@@ -128,6 +133,17 @@ show binlog events;
drop table t1,t2,t3;
#
+# BUG#27998 - mysqld crashed when executing INSERT DELAYED on a BLACKHOLE
+# table
+#
+CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
+--error 1031
+INSERT DELAYED INTO t1 VALUES(1);
+DROP TABLE t1;
+
+# End of 4.1 tests
+
+#
#Bug#19717: DELETE Query Error on BLACKHOLE when using WHERE on column with UNIQUE INDEX
#
CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE;
@@ -142,4 +158,4 @@ ALTER TABLE t1 ADD PRIMARY KEY(a);
DELETE FROM t1 WHERE a=10;
DROP TABLE t1;
-# End of 4.1 tests
+# End of 5.0 tests
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index 502c5781f1f..b665eb86656 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -10,7 +10,13 @@ select cast(-5 as unsigned) -1, cast(-5 as unsigned) + 1;
select ~5, cast(~5 as signed);
explain extended select ~5, cast(~5 as signed);
select cast(5 as unsigned) -6.0;
-select cast(NULL as signed), cast(1/0 as signed);
+select cast(NULL as signed), cast(1/0 as signed);
+#
+# Bug #28250: Run-Time Check Failure #3 - The variable 'value' is being used
+# without being def
+#
+# The following line causes Run-Time Check Failure on
+# binaries built with Visual C++ 2005
select cast(NULL as unsigned), cast(1/0 as unsigned);
select cast("A" as binary) = "a", cast(BINARY "a" as CHAR) = "A";
select cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME);
@@ -182,6 +188,12 @@ DROP TABLE t1;
select isnull(date(NULL)), isnull(cast(NULL as DATE));
+#
+# Bug#23656: Wrong result of CAST from DATE to int
+#
+SELECT CAST(cast('01-01-01' as date) AS UNSIGNED);
+SELECT CAST(cast('01-01-01' as date) AS SIGNED);
+
--echo End of 4.1 tests
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index ba5f56e12b1..35198c793b8 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -669,6 +669,117 @@ alter table t1 max_rows=100000000000;
show create table t1;
drop table t1;
+
+#
+# Tests for errors happening at various stages of CREATE TABLES ... SELECT
+#
+# (Also checks that it behaves atomically in the sense that in case
+# of error it is automatically dropped if it has not existed before.)
+#
+# Error during open_and_lock_tables() of tables
+--error ER_NO_SUCH_TABLE
+create table t1 select * from t2;
+# Rather special error which also caught during open tables pahse
+--error ER_UPDATE_TABLE_USED
+create table t1 select * from t1;
+# Error which happens before select_create::prepare()
+--error ER_CANT_AGGREGATE_2COLLATIONS
+create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
+# Error during table creation
+--error ER_KEY_COLUMN_DOES_NOT_EXITS
+create table t1 (primary key(a)) select "b" as b;
+# Error in select_create::prepare() which is not related to table creation
+create table t1 (a int);
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+create table if not exists t1 select 1 as a, 2 as b;
+drop table t1;
+# Finally error which happens during insert
+--error ER_DUP_ENTRY
+create table t1 (primary key (a)) (select 1 as a) union all (select 1 as a);
+# What happens if table already exists ?
+create table t1 (i int);
+--error ER_TABLE_EXISTS_ERROR
+create table t1 select 1 as i;
+create table if not exists t1 select 1 as i;
+select * from t1;
+# Error before select_create::prepare()
+--error ER_CANT_AGGREGATE_2COLLATIONS
+create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
+select * from t1;
+# Error which happens during insertion of rows
+alter table t1 add primary key (i);
+--error ER_DUP_ENTRY
+create table if not exists t1 (select 2 as i) union all (select 2 as i);
+select * from t1;
+drop table t1;
+
+
+# Base vs temporary tables dillema (a.k.a. bug#24508 "Inconsistent
+# results of CREATE TABLE ... SELECT when temporary table exists").
+# In this situation we either have to create non-temporary table and
+# insert data in it or insert data in temporary table without creation
+# of permanent table. Since currently temporary tables always shadow
+# permanent tables we adopt second approach.
+create temporary table t1 (j int);
+create table if not exists t1 select 1;
+select * from t1;
+drop temporary table t1;
+--error ER_NO_SUCH_TABLE
+select * from t1;
+--error ER_BAD_TABLE_ERROR
+drop table t1;
+
+
+#
+# CREATE TABLE ... SELECT and LOCK TABLES
+#
+# There is little sense in using CREATE TABLE ... SELECT under
+# LOCK TABLES as it mostly does not work. At least we check that
+# the server doesn't crash, hang and produces sensible errors.
+# Includes test for bug #20662 "Infinite loop in CREATE TABLE
+# IF NOT EXISTS ... SELECT with locked tables".
+create table t1 (i int);
+insert into t1 values (1), (2);
+lock tables t1 read;
+--error ER_TABLE_NOT_LOCKED
+create table t2 select * from t1;
+--error ER_TABLE_NOT_LOCKED
+create table if not exists t2 select * from t1;
+unlock tables;
+create table t2 (j int);
+lock tables t1 read;
+--error ER_TABLE_NOT_LOCKED
+create table t2 select * from t1;
+# This should not be ever allowed as it will undermine
+# lock-all-at-once approach
+--error ER_TABLE_NOT_LOCKED
+create table if not exists t2 select * from t1;
+unlock tables;
+lock table t1 read, t2 read;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+create table t2 select * from t1;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+create table if not exists t2 select * from t1;
+unlock tables;
+lock table t1 read, t2 write;
+--error ER_TABLE_EXISTS_ERROR
+create table t2 select * from t1;
+# This is the only case which really works.
+create table if not exists t2 select * from t1;
+select * from t1;
+unlock tables;
+drop table t2;
+
+# OTOH CREATE TEMPORARY TABLE ... SELECT should work
+# well under LOCK TABLES.
+lock tables t1 read;
+create temporary table t2 select * from t1;
+create temporary table if not exists t2 select * from t1;
+select * from t2;
+unlock tables;
+drop table t1, t2;
+
+
#
# Bug#21772: can not name a column 'upgrade' when create a table
#
diff --git a/mysql-test/t/ctype_cp932_binlog.test b/mysql-test/t/ctype_cp932_binlog.test
index ee0e588fdae..7db8f311800 100644
--- a/mysql-test/t/ctype_cp932_binlog.test
+++ b/mysql-test/t/ctype_cp932_binlog.test
@@ -1,5 +1,6 @@
-- source include/not_embedded.inc
-- source include/have_cp932.inc
+-- source include/have_log_bin.inc
--character_set cp932
--disable_warnings
@@ -51,7 +52,7 @@ CALL bug18293("Foo's a Bar", _cp932 0xED40ED41ED42, 47.93)|
SELECT HEX(s1),HEX(s2),d FROM t4|
DROP PROCEDURE bug18293|
DROP TABLE t4|
-SHOW BINLOG EVENTS FROM 402|
+SHOW BINLOG EVENTS FROM 362|
delimiter ;|
# End of 5.0 tests
diff --git a/mysql-test/t/ctype_cp932_notembedded.test b/mysql-test/t/ctype_cp932_notembedded.test
deleted file mode 100644
index 52e7acc3f01..00000000000
--- a/mysql-test/t/ctype_cp932_notembedded.test
+++ /dev/null
@@ -1,32 +0,0 @@
--- source include/not_embedded.inc
--- source include/have_cp932.inc
-
---character_set cp932
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-set names cp932;
-set character_set_database = cp932;
-
-# Test prepared statement with 0x8300 sequence in parameter while
-# running with cp932 client character set.
-RESET MASTER;
-CREATE TABLE t1(f1 blob);
-PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
-SET @var1= x'8300';
-# TODO: Note that this doesn't actually test the code which was added for
-# bug#11338 because this syntax for prepared statements causes the PS to
-# be replicated differently than if we executed the PS from C or Java.
-# Using this syntax, variable names are inserted into the binlog instead
-# of values. The real goal of this test is to check the code that was
-# added to Item_param::query_val_str() in order to do hex encoding of
-# PS parameters when the client character set is cp932;
-# Bug#11338 has an example java program which can be used to verify this
-# code (and I have used it to test the fix) until there is some way to
-# exercise this code from mysql-test-run.
-EXECUTE stmt1 USING @var1;
-SHOW BINLOG EVENTS FROM 98;
-SELECT HEX(f1) FROM t1;
-DROP table t1;
-# end test for bug#11338
diff --git a/mysql-test/t/ctype_ucs2_def.test b/mysql-test/t/ctype_ucs2_def.test
index e435d1fb07d..050710b208b 100644
--- a/mysql-test/t/ctype_ucs2_def.test
+++ b/mysql-test/t/ctype_ucs2_def.test
@@ -14,3 +14,19 @@ DROP TABLE IF EXISTS t1;
--enable_warnings
create table t1 (a int);
drop table t1;
+
+#
+# Bug #27643: query failed : 1114 (The table '' is full)
+#
+# Check that HASH indexes ignore trailing spaces when comparing
+# strings with the ucs2_bin collation
+
+CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL,
+ col2 VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL,
+ UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES('A', 'A'), ('B', 'B'), ('C', 'C');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES('A ', 'A ');
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/ctype_ucs_binlog.test b/mysql-test/t/ctype_ucs_binlog.test
index 2467d34386c..92d4458a9c2 100644
--- a/mysql-test/t/ctype_ucs_binlog.test
+++ b/mysql-test/t/ctype_ucs_binlog.test
@@ -1,5 +1,6 @@
--source include/not_embedded.inc
--source include/have_ucs2.inc
+--source include/have_log_bin.inc
#
# Check correct binlogging of UCS2 user variables (BUG#3875)
diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test
index 3054ec53faa..faa6d4242db 100644
--- a/mysql-test/t/date_formats.test
+++ b/mysql-test/t/date_formats.test
@@ -129,6 +129,8 @@ create table t1 (date char(30), format char(30) not null);
insert into t1 values
('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'),
('03-01-02 8:11:2.123456', '%y-%m-%d %H:%i:%S.%#'),
+('0003-01-02 8:11:2.123456', '%Y-%m-%d %H:%i:%S.%#'),
+('03-01-02 8:11:2.123456', '%Y-%m-%d %H:%i:%S.%#'),
('2003-01-02 10:11:12 PM', '%Y-%m-%d %h:%i:%S %p'),
('2003-01-02 01:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f%p'),
('2003-01-02 02:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f %p'),
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index df56165950f..9d6a9b57e9a 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -10,5 +10,9 @@
#
##############################################################################
-ndb_load : Bug#17233
user_limits : Bug#23921 random failure of user_limits.test
+im_life_cycle : Bug#27851: Instance manager test im_life_cycle fails randomly
+im_daemon_life_cycle : Bug#20294: Instance manager tests fail randomly
+im_options_set : Bug#20294: Instance manager tests fail randomly
+im_options_unset : Bug#20294: Instance manager tests fail randomly
+im_utils : Bug#20294: Instance manager tests fail randomly
diff --git a/mysql-test/t/drop_temp_table.test b/mysql-test/t/drop_temp_table.test
index bc06de4096c..86bdc0eeecc 100644
--- a/mysql-test/t/drop_temp_table.test
+++ b/mysql-test/t/drop_temp_table.test
@@ -1,5 +1,5 @@
-# Embedded server doesn't support binlog
--- source include/not_embedded.inc
+--source include/have_log_bin.inc
+
--disable_warnings
drop database if exists `drop-temp+table-test`;
diff --git a/mysql-test/t/flush_block_commit_notembedded.test b/mysql-test/t/flush_block_commit_notembedded.test
index 4650a5a15a8..e3b59e0fc45 100644
--- a/mysql-test/t/flush_block_commit_notembedded.test
+++ b/mysql-test/t/flush_block_commit_notembedded.test
@@ -4,7 +4,7 @@
# This is intended to mimick how mysqldump and innobackup work.
# And it requires InnoDB
--- source include/not_embedded.inc
+-- source include/have_log_bin.inc
-- source include/have_innodb.inc
connect (con1,localhost,root,,);
diff --git a/mysql-test/t/func_date_add.test b/mysql-test/t/func_date_add.test
index b575eeececa..fc5a5cb2823 100644
--- a/mysql-test/t/func_date_add.test
+++ b/mysql-test/t/func_date_add.test
@@ -77,4 +77,14 @@ SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 MONTH;
SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 YEAR;
SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 WEEK;
+#
+# Bug#28450: The Item_date_add_interval in select list may fail the field
+# type assertion.
+#
+create table t1 (a int, b varchar(10));
+insert into t1 values (1, '2001-01-01'),(2, '2002-02-02');
+select '2007-01-01' + interval a day from t1;
+select b + interval a day from t1;
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 0dd82864520..767df5ae233 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -507,4 +507,48 @@ SELECT GROUP_CONCAT(DISTINCT UCASE(a)) FROM t1;
SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1;
DROP TABLE t1;
+#
+# Bug #28273: GROUP_CONCAT and ORDER BY: No warning when result gets truncated.
+#
+CREATE TABLE t1( a VARCHAR( 10 ), b INT );
+INSERT INTO t1 VALUES ( repeat( 'a', 10 ), 1),
+ ( repeat( 'b', 10 ), 2);
+SET group_concat_max_len = 20;
+SELECT GROUP_CONCAT( a ) FROM t1;
+SELECT GROUP_CONCAT( DISTINCT a ) FROM t1;
+SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
+SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1;
+SET group_concat_max_len = DEFAULT;
+DROP TABLE t1;
+# Bug #23856:GROUP_CONCAT and ORDER BY: junk from previous rows for query on I_S
+#
+SET group_concat_max_len= 65535;
+CREATE TABLE t1( a TEXT, b INTEGER );
+INSERT INTO t1 VALUES ( 'a', 0 ), ( 'b', 1 );
+SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
+SELECT GROUP_CONCAT(DISTINCT a ORDER BY b) FROM t1;
+SELECT GROUP_CONCAT(DISTINCT a) FROM t1;
+SET group_concat_max_len= 10;
+SELECT GROUP_CONCAT(a ORDER BY b) FROM t1;
+SELECT GROUP_CONCAT(DISTINCT a ORDER BY b) FROM t1;
+SELECT GROUP_CONCAT(DISTINCT a) FROM t1;
+
+SET group_concat_max_len= 65535;
+CREATE TABLE t2( a TEXT );
+INSERT INTO t2 VALUES( REPEAT( 'a', 5000 ) );
+INSERT INTO t2 VALUES( REPEAT( 'b', 5000 ) );
+INSERT INTO t2 VALUES( REPEAT( 'a', 5000 ) );
+SELECT LENGTH( GROUP_CONCAT( DISTINCT a ) ) FROM t2;
+
+CREATE TABLE t3( a TEXT, b INT );
+INSERT INTO t3 VALUES( REPEAT( 'a', 65534 ), 1 );
+INSERT INTO t3 VALUES( REPEAT( 'a', 65535 ), 2 );
+INSERT INTO t3 VALUES( REPEAT( 'a', 65536 ), 3 );
+SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 1;
+SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 2;
+SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 3;
+
+SET group_concat_max_len= DEFAULT;
+DROP TABLE t1, t2, t3;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 654bb8bb75d..2293ac71454 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -827,4 +827,38 @@ SELECT a,AVG(DISTINCT b) AS average FROM t1 GROUP BY a HAVING average > 50;
DROP TABLE t1;
+#
+# Bug #27573: MIN() on an indexed column which is always NULL sets _other_
+# results to NULL
+#
+CREATE TABLE t1 ( a INT, b INT, KEY(a) );
+INSERT INTO t1 VALUES (NULL, 1), (NULL, 2);
+EXPLAIN SELECT MIN(a), MIN(b) FROM t1;
+SELECT MIN(a), MIN(b) FROM t1;
+
+CREATE TABLE t2( a INT, b INT, c INT, KEY(a, b) );
+INSERT INTO t2 ( a, b, c ) VALUES ( 1, NULL, 2 ), ( 1, 3, 4 ), ( 1, 4, 4 );
+EXPLAIN SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
+SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
+
+CREATE TABLE t3 (a INT, b INT, c int, KEY(a, b));
+INSERT INTO t3 VALUES (1, NULL, 1), (2, NULL, 2), (2, NULL, 2), (3, NULL, 3);
+EXPLAIN SELECT MIN(a), MIN(b) FROM t3 where a = 2;
+SELECT MIN(a), MIN(b) FROM t3 where a = 2;
+
+CREATE TABLE t4 (a INT, b INT, c int, KEY(a, b));
+INSERT INTO t4 VALUES (1, 1, 1), (2, NULL, 2), (2, NULL, 2), (3, 1, 3);
+EXPLAIN SELECT MIN(a), MIN(b) FROM t4 where a = 2;
+SELECT MIN(a), MIN(b) FROM t4 where a = 2;
+SELECT MIN(b), min(c) FROM t4 where a = 2;
+
+CREATE TABLE t5( a INT, b INT, KEY( a, b) );
+INSERT INTO t5 VALUES( 1, 1 ), ( 1, 2 );
+EXPLAIN SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
+SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
+SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1 and b > 1;
+
+DROP TABLE t1, t2, t3, t4, t5;
+
+###
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index 77592d015eb..a84ffada1ee 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -335,19 +335,28 @@ insert into t2 values(13491727406643098568),
(0x8000004000000001),
(0x8000040000000001);
-SELECT HEX(a) FROM t2 WHERE a IN (0xBB3C3E98175D33C8, 42);
+SELECT HEX(a) FROM t2 WHERE a IN
+ (CAST(0xBB3C3E98175D33C8 AS UNSIGNED),
+ 42);
SELECT HEX(a) FROM t2 WHERE a IN
-(0xBB3C3E98175D33C8,
- 0x7fffffffffffffff,
- 0x8000000000000000,
- 0x8000000000000400,
- 0x8000000000000401,
- 42);
-
-SELECT HEX(a) FROM t2 WHERE a IN (0x7fffffffffffffff,0x8000000000000001);
-SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff);
-SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff,'abc');
+ (CAST(0xBB3C3E98175D33C8 AS UNSIGNED),
+ CAST(0x7fffffffffffffff AS UNSIGNED),
+ CAST(0x8000000000000000 AS UNSIGNED),
+ CAST(0x8000000000000400 AS UNSIGNED),
+ CAST(0x8000000000000401 AS UNSIGNED),
+ 42);
+
+SELECT HEX(a) FROM t2 WHERE a IN
+ (CAST(0x7fffffffffffffff AS UNSIGNED),
+ CAST(0x8000000000000001 AS UNSIGNED));
+SELECT HEX(a) FROM t2 WHERE a IN
+ (CAST(0x7ffffffffffffffe AS UNSIGNED),
+ CAST(0x7fffffffffffffff AS UNSIGNED));
+SELECT HEX(a) FROM t2 WHERE a IN
+ (0x7ffffffffffffffe,
+ 0x7fffffffffffffff,
+ 'abc');
CREATE TABLE t3 (a BIGINT UNSIGNED);
INSERT INTO t3 VALUES (9223372036854775551);
diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test
index 77d7366afe6..bb65cbaa774 100644
--- a/mysql-test/t/func_sapdb.test
+++ b/mysql-test/t/func_sapdb.test
@@ -41,6 +41,8 @@ select datediff("1997-11-30 23:59:59.000001",null);
select weekofyear("1997-11-30 23:59:59.000001");
+select makedate(03,1);
+select makedate('0003',1);
select makedate(1997,1);
select makedate(1997,0);
select makedate(9999,365);
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 197f20db76e..32eb262fd51 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -413,6 +413,7 @@ connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user1;
-- error 1142
alter table t1 rename t2;
+disconnect user1;
connection root;
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
@@ -889,7 +890,7 @@ REVOKE EXECUTE ON PROCEDURE t1 FROM some_user_name@1234567890abcdefghij123456789
# Bug #6774: Replication fails with Wrong usage of DB GRANT and GLOBAL PRIVILEGES
#
# Check if GRANT ... ON * ... fails when no database is selected
-connect (con1, localhost, root,,*NO-ONE*)
+connect (con1, localhost, root,,*NO-ONE*);
connection con1;
--error ER_NO_DB_ERROR
GRANT PROCESS ON * TO user@localhost;
@@ -1122,5 +1123,29 @@ DROP DATABASE mysqltest2;
DROP USER mysqltest_1@localhost;
+#
+# Bug#27878: Unchecked privileges on a view referring to a table from another
+# database.
+#
+use test;
+CREATE TABLE t1 (f1 int, f2 int);
+INSERT INTO t1 VALUES(1,1), (2,2);
+CREATE DATABASE db27878;
+GRANT UPDATE(f1) ON t1 TO 'mysqltest_1'@'localhost';
+GRANT SELECT ON `test`.* TO 'mysqltest_1'@'localhost';
+GRANT ALL ON db27878.* TO 'mysqltest_1'@'localhost';
+use db27878;
+CREATE SQL SECURITY INVOKER VIEW db27878.v1 AS SELECT * FROM test.t1;
+connect (user1,localhost,mysqltest_1,,test);
+connection user1;
+use db27878;
+--error 1356
+UPDATE v1 SET f2 = 4;
+SELECT * FROM test.t1;
+disconnect user1;
+connection default;
+DROP DATABASE db27878;
+use test;
+DROP TABLE t1;
--echo End of 5.0 tests
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index d08a9e3f83d..4a3324b1833 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -513,3 +513,47 @@ disconnect bug13310;
connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
drop user `a@`@localhost;
+
+
+#
+# Bug#25578 "CREATE TABLE LIKE does not require any privileges on source table"
+#
+--disable_warnings
+drop database if exists mysqltest_1;
+drop database if exists mysqltest_2;
+--enable_warnings
+--error 0,ER_CANNOT_USER
+drop user mysqltest_u1@localhost;
+
+create database mysqltest_1;
+create database mysqltest_2;
+grant all on mysqltest_1.* to mysqltest_u1@localhost;
+use mysqltest_2;
+create table t1 (i int);
+
+# Connect as user with all rights on mysqltest_1 but with no rights on mysqltest_2.
+connect (user1,localhost,mysqltest_u1,,mysqltest_1);
+connection user1;
+# As expected error is emitted
+--error ER_TABLEACCESS_DENIED_ERROR
+show create table mysqltest_2.t1;
+# This should emit error as well
+--error ER_TABLEACCESS_DENIED_ERROR
+create table t1 like mysqltest_2.t1;
+
+# Now let us check that SELECT privilege on the source is enough
+connection default;
+grant select on mysqltest_2.t1 to mysqltest_u1@localhost;
+connection user1;
+show create table mysqltest_2.t1;
+create table t1 like mysqltest_2.t1;
+
+# Clean-up
+connection default;
+use test;
+drop database mysqltest_1;
+drop database mysqltest_2;
+drop user mysqltest_u1@localhost;
+
+--echo End of 5.0 tests
+
diff --git a/mysql-test/t/heap_hash.test b/mysql-test/t/heap_hash.test
index 28a75a5ee11..c0f37fe490e 100644
--- a/mysql-test/t/heap_hash.test
+++ b/mysql-test/t/heap_hash.test
@@ -260,4 +260,27 @@ 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
+--echo End of 4.1 tests
+
+#
+# Bug #27643: query failed : 1114 (The table '' is full)
+#
+# Check that HASH indexes disregard trailing spaces when comparing
+# strings with binary collations
+
+CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+ col2 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+ UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES('A', 'A');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES('A ', 'A ');
+DROP TABLE t1;
+CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
+ col2 VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
+ UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES('A', 'A');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES('A ', 'A ');
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index f7fa7366101..b7f264578f2 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -12,6 +12,7 @@
#######################################################################
-- source include/have_innodb.inc
+-- source include/have_log_bin.inc
#
# Small basic test with ignore
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index c9e1de8c3ab..e6d94fe1627 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -169,6 +169,31 @@ INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
SELECT * FROM t1;
DROP TABLE t1;
+#
+# Bug #28272: EXPLAIN for SELECT from an empty InnoDB table
+#
+
+CREATE TABLE t1 (
+ a1 decimal(10,0) DEFAULT NULL,
+ a2 blob,
+ a3 time DEFAULT NULL,
+ a4 blob,
+ a5 char(175) DEFAULT NULL,
+ a6 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ a7 tinyblob,
+ INDEX idx (a6,a7(239),a5)
+) ENGINE=InnoDB;
+
+EXPLAIN SELECT a4 FROM t1 WHERE
+a6=NULL AND
+a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
+
+EXPLAIN SELECT t1.a4 FROM t1, t1 t WHERE
+t.a6=t.a6 AND t1.a6=NULL AND
+t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
+
+DROP TABLE t1;
+
--echo End of 4.1 tests
#
# Bug #12882 min/max inconsistent on empty table
@@ -518,4 +543,66 @@ select * from t1;
drop table t1;
+#
+# Bug #28189: optimizer erroniously prefers ref access to range access
+# for an InnoDB table
+#
+
+CREATE TABLE t1(
+ id int AUTO_INCREMENT PRIMARY KEY,
+ stat_id int NOT NULL,
+ acct_id int DEFAULT NULL,
+ INDEX idx1 (stat_id, acct_id),
+ INDEX idx2 (acct_id)
+) ENGINE=MyISAM;
+
+CREATE TABLE t2(
+ id int AUTO_INCREMENT PRIMARY KEY,
+ stat_id int NOT NULL,
+ acct_id int DEFAULT NULL,
+ INDEX idx1 (stat_id, acct_id),
+ INDEX idx2 (acct_id)
+) ENGINE=InnoDB;
+
+INSERT INTO t1(stat_id,acct_id) VALUES
+ (1,759), (2,831), (3,785), (4,854), (1,921),
+ (1,553), (2,589), (3,743), (2,827), (2,545),
+ (4,779), (4,783), (1,597), (1,785), (4,832),
+ (1,741), (1,833), (3,788), (2,973), (1,907);
+
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+UPDATE t1 SET acct_id=785
+ WHERE MOD(stat_id,2)=0 AND MOD(id,stat_id)=MOD(acct_id,stat_id);
+OPTIMIZE TABLE t1;
+
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t1 WHERE acct_id=785;
+
+EXPLAIN SELECT COUNT(*) FROM t1 WHERE stat_id IN (1,3) AND acct_id=785;
+
+INSERT INTO t2 SELECT * FROM t1;
+OPTIMIZE TABLE t2;
+
+EXPLAIN SELECT COUNT(*) FROM t2 WHERE stat_id IN (1,3) AND acct_id=785;
+
+DROP TABLE t1,t2;
+
+#
+# Bug #28652: assert when alter innodb table operation
+#
+create table t1(a int) engine=innodb;
+alter table t1 comment '123';
+show create table t1;
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index 0a8e184ea5c..76177403bd0 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -216,3 +216,142 @@ select * from t1;
drop view v1;
drop table t1,t2;
+
+#
+# BUG#21483: Server abort or deadlock on INSERT DELAYED with another
+# implicit insert
+#
+# The solution is to downgrade INSERT DELAYED to normal INSERT if the
+# statement uses functions and access tables or triggers, or is called
+# from a function or a trigger.
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+--enable_warnings
+
+CREATE TABLE t1 (i INT);
+delimiter |;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ INSERT INTO t1 VALUES (1);
+ RETURN 1;
+END |
+CREATE FUNCTION f2() RETURNS INT
+BEGIN
+ INSERT DELAYED INTO t1 VALUES (2);
+ RETURN 1;
+END |
+delimiter ;|
+
+SELECT f1();
+SELECT f2();
+INSERT INTO t1 VALUES (3);
+INSERT DELAYED INTO t1 VALUES (4);
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+INSERT INTO t1 VALUES (f1());
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+INSERT DELAYED INTO t1 VALUES (f1());
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+INSERT INTO t1 VALUES (f2());
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+INSERT DELAYED INTO t1 VALUES (f2());
+
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+ INSERT INTO t1 VALUES (NEW.i);
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+INSERT INTO t1 VALUES (1);
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+INSERT DELAYED INTO t1 VALUES (1);
+
+SELECT * FROM t1;
+
+DROP FUNCTION f2;
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+#
+# BUG#20497: Trigger with INSERT DELAYED causes Error 1165
+#
+# Fixed by the patch for Bug#21483
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+CREATE TABLE t1 (i INT);
+CREATE TABLE t2 (i INT);
+
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+ INSERT DELAYED INTO t2 VALUES (NEW.i);
+
+CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
+ INSERT DELAYED INTO t2 VALUES (NEW.i);
+
+CREATE TRIGGER t1_bd BEFORE DELETE ON t1 FOR EACH ROW
+ INSERT DELAYED INTO t2 VALUES (OLD.i);
+
+INSERT INTO t1 VALUES (1);
+INSERT DELAYED INTO t1 VALUES (2);
+SELECT * FROM t1;
+UPDATE t1 SET i = 3 WHERE i = 1;
+SELECT * FROM t1;
+DELETE FROM t1 WHERE i = 3;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+DROP TABLE t1, t2;
+
+#
+# BUG#21714: Wrong NEW.value and server abort on INSERT DELAYED to a
+# table with a trigger
+#
+# Fixed by the patch for Bug#21483
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+CREATE TABLE t1 (i INT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+ SET @a= NEW.i;
+
+SET @a= 0;
+INSERT DELAYED INTO t1 VALUES (1);
+SELECT @a;
+INSERT DELAYED INTO t1 VALUES (2);
+SELECT @a;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (i INT);
+CREATE TABLE t2 (i INT);
+
+CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
+ INSERT INTO t2 VALUES (NEW.i);
+
+CREATE TRIGGER t1_au AFTER UPDATE ON t1 FOR EACH ROW
+ INSERT DELAYED INTO t2 VALUES (NEW.i);
+
+CREATE TRIGGER t1_ad AFTER DELETE ON t1 FOR EACH ROW
+ INSERT DELAYED INTO t2 VALUES (OLD.i);
+
+INSERT DELAYED INTO t1 VALUES (1);
+SELECT * FROM t1;
+UPDATE t1 SET i = 2 WHERE i = 1;
+SELECT * FROM t1;
+DELETE FROM t1 WHERE i = 2;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+DROP TABLE t1, t2;
+
+--echo End of 5.0 tests.
+
diff --git a/mysql-test/t/insert_select-binlog.test b/mysql-test/t/insert_select-binlog.test
index d4041f86ab5..4bff09577a7 100644
--- a/mysql-test/t/insert_select-binlog.test
+++ b/mysql-test/t/insert_select-binlog.test
@@ -1,5 +1,6 @@
# Embedded server doesn't support binlog
-- source include/not_embedded.inc
+-- source include/have_log_bin.inc
# Check if a partly-completed INSERT SELECT in a MyISAM table goes into the
# binlog
diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test
index 76df4502769..725fbdb25d7 100644
--- a/mysql-test/t/insert_update.test
+++ b/mysql-test/t/insert_update.test
@@ -247,3 +247,46 @@ REPLACE INTO t1 VALUES (0,"test1",null);
SELECT id, f1 FROM t1;
DROP TABLE t1;
SET SQL_MODE='';
+
+#
+# Bug#27954: multi-row INSERT ... ON DUPLICATE with duplicated
+# row at the first place into table with AUTO_INCREMENT and
+# additional UNIQUE key.
+#
+CREATE TABLE t1 (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ c1 CHAR(1) UNIQUE KEY,
+ cnt INT DEFAULT 1
+);
+INSERT INTO t1 (c1) VALUES ('A'), ('B'), ('C');
+SELECT * FROM t1;
+INSERT INTO t1 (c1) VALUES ('A'), ('X'), ('Y'), ('Z')
+ ON DUPLICATE KEY UPDATE cnt=cnt+1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# Bug#28000: INSERT IGNORE ... SELECT ... ON DUPLICATE
+# with erroneous UPDATE: NOT NULL field with NULL value.
+#
+CREATE TABLE t1 (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ c1 INT NOT NULL,
+ cnt INT DEFAULT 1
+);
+INSERT INTO t1 (id,c1) VALUES (1,10);
+SELECT * FROM t1;
+CREATE TABLE t2 (id INT, c1 INT);
+INSERT INTO t2 VALUES (1,NULL), (2,2);
+--error 1048
+INSERT INTO t1 (id,c1) SELECT 1,NULL
+ ON DUPLICATE KEY UPDATE c1=NULL;
+SELECT * FROM t1;
+INSERT IGNORE INTO t1 (id,c1) SELECT 1,NULL
+ ON DUPLICATE KEY UPDATE c1=NULL, cnt=cnt+1;
+SELECT * FROM t1;
+INSERT IGNORE INTO t1 (id,c1) SELECT * FROM t2
+ ON DUPLICATE KEY UPDATE c1=NULL, cnt=cnt+1;
+SELECT * FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index a0fc7059179..68b97854c3b 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -333,6 +333,30 @@ 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;
+#
+# Bug #27531: Query performance degredation in 4.1.22 and greater
+#
+CREATE TABLE t1 (a int, b int default 0, c int default 1);
+
+INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+INSERT INTO t1 (a) SELECT a + 8 FROM t1;
+INSERT INTO t1 (a) SELECT a + 16 FROM t1;
+
+CREATE TABLE t2 (a int, d int, e int default 0);
+
+INSERT INTO t2 (a, d) VALUES (1,1),(2,2),(3,3),(4,4);
+INSERT INTO t2 (a, d) SELECT a+4, a+4 FROM t2;
+INSERT INTO t2 (a, d) SELECT a+8, a+8 FROM t2;
+
+# should use join cache
+EXPLAIN
+SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e
+ ORDER BY t1.b, t1.c;
+SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e
+ ORDER BY t1.b, t1.c;
+
+DROP TABLE t1,t2;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index a0620e144c2..1a59dbf8fc2 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -825,3 +825,39 @@ SELECT * FROM t1 LEFT JOIN t2 USING(f1) WHERE f1='bla';
SELECT * FROM t1 LEFT JOIN t2 USING(f1) WHERE f1='Bla';
DROP TABLE t1,t2;
+
+#
+# Bug 28188: 'not exists' optimization for outer joins
+#
+
+CREATE TABLE t1 (id int PRIMARY KEY, a varchar(8));
+CREATE TABLE t2 (id int NOT NULL, b int NOT NULL, INDEX idx(id));
+INSERT INTO t1 VALUES
+ (1,'aaaaaaa'), (5,'eeeeeee'), (4,'ddddddd'), (2,'bbbbbbb'), (3,'ccccccc');
+INSERT INTO t2 VALUES
+ (3,10), (2,20), (5,30), (3,20), (5,10), (3,40), (3,30), (2,10), (2,40);
+
+EXPLAIN
+SELECT t1.id, a FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.b IS NULL;
+
+flush status;
+SELECT t1.id, a FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.b IS NULL;
+show status like 'Handler_read%';
+
+DROP TABLE t1,t2;
+
+#
+# Bug 28571: outer join with false on condition over constant tables
+#
+
+CREATE TABLE t1 (c int PRIMARY KEY, e int NOT NULL);
+INSERT INTO t1 VALUES (1,0), (2,1);
+CREATE TABLE t2 (d int PRIMARY KEY);
+INSERT INTO t2 VALUES (1), (2), (3);
+
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d IS NULL;
+SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d IS NULL;
+SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d<=>NULL;
+
+DROP TABLE t1,t2;
+
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test
index e84b2071ab1..3d0e68dc0f3 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -432,3 +432,15 @@ ORDER BY c.b, c.d
;
DROP TABLE t1, t2;
+
+
+#
+# Bug #20604: Test for disabled keys with aggregate functions and FORCE INDEX.
+#
+CREATE TABLE t1( a TINYINT, KEY(a) ) ENGINE=MyISAM;
+INSERT INTO t1 VALUES( 1 );
+ALTER TABLE t1 DISABLE KEYS;
+EXPLAIN SELECT MAX(a) FROM t1 FORCE INDEX(a);
+DROP TABLE t1;
+
+--echo End of 5.0 tests.
diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test
index 1e99911a7e3..5f6bae00254 100644
--- a/mysql-test/t/kill.test
+++ b/mysql-test/t/kill.test
@@ -117,3 +117,188 @@ reap;
select 1;
connection con1;
select RELEASE_LOCK("a");
+
+#
+# Bug#27563: Stored functions and triggers wasn't throwing an error when killed.
+#
+create table t1(f1 int);
+delimiter |;
+create function bug27563() returns int(11)
+deterministic
+begin
+ declare continue handler for sqlstate '70100' set @a:= 'killed';
+ declare continue handler for sqlexception set @a:= 'exception';
+ set @a= get_lock("lock27563", 10);
+ return 1;
+end|
+delimiter ;|
+# Test stored functions
+# Test INSERT
+connection con1;
+select get_lock("lock27563",10);
+connection con2;
+let $ID= `select connection_id()`;
+send insert into t1 values (bug27563());
+real_sleep 2;
+connection con1;
+disable_query_log;
+eval kill query $ID;
+enable_query_log;
+connection con2;
+--error 1317
+reap;
+select @a;
+connection con1;
+select * from t1;
+
+# Test UPDATE
+insert into t1 values(0);
+connection con2;
+send update t1 set f1= bug27563();
+real_sleep 2;
+connection con1;
+disable_query_log;
+eval kill query $ID;
+enable_query_log;
+connection con2;
+--error 1317
+reap;
+select @a;
+connection con1;
+select * from t1;
+
+# Test DELETE
+insert into t1 values(1);
+connection con2;
+send delete from t1 where bug27563() is null;
+real_sleep 2;
+connection con1;
+disable_query_log;
+eval kill query $ID;
+enable_query_log;
+connection con2;
+--error 1317
+reap;
+select @a;
+connection con1;
+select * from t1;
+
+# Test SELECT
+connection con2;
+send select * from t1 where f1= bug27563();
+real_sleep 2;
+connection con1;
+disable_query_log;
+eval kill query $ID;
+enable_query_log;
+connection con2;
+--error 1317
+reap;
+select @a;
+
+# Test PROCEDURE
+connection con2;
+delimiter |;
+create procedure proc27563()
+begin
+ declare continue handler for sqlstate '70100' set @a:= 'killed';
+ declare continue handler for sqlexception set @a:= 'exception';
+ select get_lock("lock27563",10);
+ select "shouldn't be selected";
+end|
+delimiter ;|
+send call proc27563();
+real_sleep 2;
+connection con1;
+disable_query_log;
+eval kill query $ID;
+enable_query_log;
+connection con2;
+--error 1317
+reap;
+select @a;
+
+# Test TRIGGERS
+connection con2;
+create table t2 (f2 int);
+delimiter |;
+create trigger trg27563 before insert on t1 for each row
+begin
+ declare continue handler for sqlstate '70100' set @a:= 'killed';
+ declare continue handler for sqlexception set @a:= 'exception';
+ set @a:= get_lock("lock27563",10);
+ insert into t2 values(1);
+end|
+delimiter ;|
+send insert into t1 values(2),(3);
+real_sleep 2;
+connection con1;
+disable_query_log;
+eval kill query $ID;
+enable_query_log;
+connection con2;
+--error 1317
+reap;
+select @a;
+connection con1;
+select * from t1;
+select * from t2;
+
+# Cleanup
+select release_lock("lock27563");
+drop table t1, t2;
+drop function bug27563;
+drop procedure proc27563;
+
+#
+# Bug#28598: mysqld crash when killing a long-running explain query.
+#
+--disable_query_log
+connection con1;
+let $ID= `select connection_id()`;
+let $tab_count= 40;
+
+let $i= $tab_count;
+while ($i)
+{
+ eval CREATE TABLE t$i (a$i int, KEY(a$i));
+ eval INSERT INTO t$i VALUES (1),(2),(3),(4),(5),(6),(7);
+ dec $i ;
+}
+set session optimizer_search_depth=0;
+
+let $i=$tab_count;
+while ($i)
+{
+ let $a= a$i;
+ let $t= t$i;
+ dec $i;
+ if ($i)
+ {
+ let $comma=,;
+ let $from=$comma$t$from;
+ let $where=a$i=$a $and $where;
+ }
+ if (!$i)
+ {
+ let $from=FROM $t$from;
+ let $where=WHERE $where;
+ }
+ let $and=AND;
+}
+
+--enable_query_log
+eval PREPARE stmt FROM 'EXPLAIN SELECT * $from $where';
+send EXECUTE stmt;
+--disable_query_log
+
+connection con2;
+real_sleep 2;
+eval kill query $ID;
+let $i= $tab_count;
+while ($i)
+{
+ eval DROP TABLE t$i;
+ dec $i ;
+}
+--enable_query_log
diff --git a/mysql-test/t/limit.test b/mysql-test/t/limit.test
index bc599b20d36..286c04785ff 100644
--- a/mysql-test/t/limit.test
+++ b/mysql-test/t/limit.test
@@ -71,3 +71,20 @@ explain select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
drop table t1;
# End of 4.1 tests
+
+#
+# Bug #28464: a string argument to 'limit ?' PS
+#
+
+prepare s from "select 1 limit ?";
+set @a='qwe';
+--error 1210
+execute s using @a;
+prepare s from "select 1 limit 1, ?";
+--error 1210
+execute s using @a;
+prepare s from "select 1 limit ?, ?";
+--error 1210
+execute s using @a, @a;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index e6788cd7798..2757a37b881 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -152,4 +152,30 @@ select * from t2;
--exec rm $MYSQLTEST_VARDIR/tmp/t1
SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1,t2;
+
+#
+# Bug#27670: LOAD DATA does not set CURRENT_TIMESTAMP default value for a
+# TIMESTAMP field when no value has been provided.
+#
+create table t1(f1 int, f2 timestamp not null default current_timestamp);
+create table t2(f1 int);
+insert into t2 values(1),(2);
+disable_query_log;
+eval select * into outfile '$MYSQLTEST_VARDIR/tmp/t2' from t2;
+eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' into table t1;
+enable_query_log;
+select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
+--exec rm $MYSQLTEST_VARDIR/tmp/t2
+delete from t1;
+disable_query_log;
+eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t2'
+FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'
+FROM t2;
+eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' into table t1
+FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n';
+enable_query_log;
+select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
+--exec rm $MYSQLTEST_VARDIR/tmp/t2
+drop table t1,t2;
+
# End of 5.0 tests
diff --git a/mysql-test/t/long_tmpdir-master.opt b/mysql-test/t/long_tmpdir-master.opt
new file mode 100644
index 00000000000..398abfc4632
--- /dev/null
+++ b/mysql-test/t/long_tmpdir-master.opt
@@ -0,0 +1 @@
+--tmpdir=$MYSQLTEST_VARDIR/tmp/long_temporary_directory_path_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
diff --git a/mysql-test/t/long_tmpdir-master.sh b/mysql-test/t/long_tmpdir-master.sh
new file mode 100644
index 00000000000..318955fbcca
--- /dev/null
+++ b/mysql-test/t/long_tmpdir-master.sh
@@ -0,0 +1,3 @@
+d="$MYSQLTEST_VARDIR/tmp/long_temporary_directory_path_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789"
+test -d "$d" || mkdir "$d"
+rm -f "$d"/*
diff --git a/mysql-test/t/long_tmpdir.test b/mysql-test/t/long_tmpdir.test
new file mode 100644
index 00000000000..cf0bed29918
--- /dev/null
+++ b/mysql-test/t/long_tmpdir.test
@@ -0,0 +1,9 @@
+#
+# Bug #29015: Stack overflow in processing temporary table name when tmpdir path
+# is long
+#
+
+create view v1 as select table_name from information_schema.tables;
+drop view v1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/metadata.test b/mysql-test/t/metadata.test
index a6ebfdc14c1..df4acec2021 100644
--- a/mysql-test/t/metadata.test
+++ b/mysql-test/t/metadata.test
@@ -81,3 +81,14 @@ drop view v1,v2,v3;
--disable_metadata
# End of 4.1 tests
+
+#
+# Bug #28492: subselect returns LONG in >5.0.24a and LONGLONG in <=5.0.24a
+#
+--enable_metadata
+select a.* from (select 2147483648 as v_large) a;
+select a.* from (select 214748364 as v_small) a;
+--disable_metadata
+
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/mix_innodb_myisam_binlog.test b/mysql-test/t/mix_innodb_myisam_binlog.test
index 8bced9f069c..428aba92342 100644
--- a/mysql-test/t/mix_innodb_myisam_binlog.test
+++ b/mysql-test/t/mix_innodb_myisam_binlog.test
@@ -5,9 +5,7 @@
# did some tests manually on a slave; tables are replicated fine and
# Exec_Master_Log_Pos advances as expected.
-# Embedded server doesn't support binlogging
--- source include/not_embedded.inc
-
+-- source include/have_log_bin.inc
-- source include/have_innodb.inc
--disable_warnings
@@ -28,9 +26,7 @@ insert into t1 values(1);
insert into t2 select * from t1;
commit;
---replace_column 5 #
---replace_result "xid=14" "xid=8"
-show binlog events from 98;
+source include/show_binlog_events.inc;
delete from t1;
delete from t2;
@@ -42,8 +38,7 @@ insert into t2 select * from t1;
# should say some changes to non-transact1onal tables couldn't be rolled back
rollback;
---replace_column 5 #
-show binlog events from 98;
+source include/show_binlog_events.inc;
delete from t1;
delete from t2;
@@ -57,9 +52,7 @@ insert into t2 select * from t1;
rollback to savepoint my_savepoint;
commit;
---replace_column 5 #
---replace_result "xid=47" "xid=25"
-show binlog events from 98;
+source include/show_binlog_events.inc;
delete from t1;
delete from t2;
@@ -75,9 +68,7 @@ insert into t1 values(7);
commit;
select a from t1 order by a; # check that savepoints work :)
---replace_column 5 #
---replace_result "xid=69" "xid=37"
-show binlog events from 98;
+source include/show_binlog_events.inc;
# and when ROLLBACK is not explicit?
delete from t1;
@@ -97,8 +88,7 @@ connection con2;
# so SHOW BINLOG EVENTS may come before con1 does the loggin. To be sure that
# logging has been done, we use a user lock.
select get_lock("a",10);
---replace_column 5 #
-show binlog events from 98;
+source include/show_binlog_events.inc;
# and when not in a transact1on?
delete from t1;
@@ -108,9 +98,7 @@ reset master;
insert into t1 values(9);
insert into t2 select * from t1;
---replace_column 5 #
---replace_result "xid=117" "xid=60"
-show binlog events from 98;
+source include/show_binlog_events.inc;
# Check that when the query updat1ng the MyISAM table is the first in the
# transaction, we log it immediately.
@@ -121,16 +109,11 @@ reset master;
insert into t1 values(10); # first make t1 non-empty
begin;
insert into t2 select * from t1;
---replace_column 5 #
---replace_result "xid=131" "xid=66"
-show binlog events from 98;
+source include/show_binlog_events.inc;
insert into t1 values(11);
commit;
---replace_column 5 #
---replace_result "xid=131" "xid=66" "xid=134" "xid=68"
-show binlog events from 98;
-
+source include/show_binlog_events.inc;
# Check that things work like before this BEGIN/ROLLBACK code was added,
# when t2 is INNODB
@@ -146,9 +129,7 @@ insert into t1 values(12);
insert into t2 select * from t1;
commit;
---replace_column 5 #
---replace_result "xid=153" "xid=78"
-show binlog events from 98;
+source include/show_binlog_events.inc;
delete from t1;
delete from t2;
@@ -159,8 +140,7 @@ insert into t1 values(13);
insert into t2 select * from t1;
rollback;
---replace_column 5 #
-show binlog events from 98;
+source include/show_binlog_events.inc;
delete from t1;
delete from t2;
@@ -174,9 +154,7 @@ insert into t2 select * from t1;
rollback to savepoint my_savepoint;
commit;
---replace_column 5 #
---replace_result "xid=185" "xid=94"
-show binlog events from 98;
+source include/show_binlog_events.inc;
delete from t1;
delete from t2;
@@ -192,9 +170,7 @@ insert into t1 values(18);
commit;
select a from t1 order by a; # check that savepoints work :)
---replace_column 5 #
---replace_result "xid=206" "xid=105"
-show binlog events from 98;
+source include/show_binlog_events.inc;
# Test for BUG#5714, where a MyISAM update in the transaction used to
# release row-level locks in InnoDB
@@ -253,9 +229,7 @@ insert into t2 values (3);
disconnect con2;
connection con3;
select get_lock("lock1",60);
---replace_column 5 #
---replace_result "xid=206" "xid=105" "xid=224" "xid=114" "xid=227" "xid=115" "xid=231" "xid=117" "xid=258" "xid=132"
-show binlog events from 98;
+source include/show_binlog_events.inc;
do release_lock("lock1");
drop table t0,t2;
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 82d10059c65..12b9423be21 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -1145,4 +1145,20 @@ create table t3 (c1 int) engine=myisam pack_keys=default;
create table t4 (c1 int) engine=myisam pack_keys=2;
drop table t1, t2, t3;
+#
+# Bug#28476: force index on a disabled myisam index gives error 124
+#
+CREATE TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
+INSERT INTO t1(a,b) VALUES (1,1),(2,2),(3,3),(4,4),(5,5);
+SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
+ALTER TABLE t1 DISABLE KEYS;
+SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
+SELECT a FROM t1 USE INDEX (inx) WHERE a=1;
+SELECT b FROM t1 FORCE INDEX (uinx) WHERE b=1;
+SELECT b FROM t1 USE INDEX (uinx) WHERE b=1;
+SELECT a FROM t1 FORCE INDEX (inx,uinx) WHERE a=1;
+ALTER TABLE t1 ENABLE KEYS;
+SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
+DROP TABLE t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 0732559e7e1..37bbca77d9f 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -262,7 +262,7 @@ EOF
--exec $MYSQL test -e "show status" 2>&1 > /dev/null
--exec $MYSQL --help 2>&1 > /dev/null
--exec $MYSQL --version 2>&1 > /dev/null
---enable_quary_log
+--enable_query_log
#
# bug #26851: Mysql Client --pager Buffer Overflow
diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test
index 3f9626fcc42..233e8c7c256 100644
--- a/mysql-test/t/mysql_upgrade.test
+++ b/mysql-test/t/mysql_upgrade.test
@@ -55,3 +55,16 @@ DROP USER mysqltest1@'%';
--replace_regex /.*mysqlcheck.*: Got/mysqlcheck: Got/ /\([0-9]*\)/(errno)/
--error 1
--exec $MYSQL_UPGRADE --skip-verbose --force --host=not_existing_host 2>&1
+
+#
+# Bug #28401 mysql_upgrade Failed with STRICT_ALL_TABLES, ANSI_QUOTES and NO_ZERO_DATE
+#
+
+# The SQL commands used by mysql_upgrade are written to be run
+# with sql_mode set to '' - thus the scripts should change sql_mode
+# for the session to make sure the SQL is legal.
+
+# Test by setting sql_mode before running mysql_upgrade
+set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
+--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
+eval set GLOBAL sql_mode=default;
diff --git a/mysql-test/t/mysqlbinlog-cp932.test b/mysql-test/t/mysqlbinlog-cp932.test
index 1487606a6c2..ca938be7d76 100644
--- a/mysql-test/t/mysqlbinlog-cp932.test
+++ b/mysql-test/t/mysqlbinlog-cp932.test
@@ -1,6 +1,7 @@
# disabled in embedded until tools running is fixed with embedded
--source include/not_embedded.inc
-- source include/have_cp932.inc
+-- source include/have_log_bin.inc
# Bug#16217 (mysql client did not know how not switch its internal charset)
flush logs;
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index a7b3f413f23..ba161ddbb89 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -1,7 +1,6 @@
# We are using .opt file since we need small binlog size
-# Embedded server doesn't support binlogging
--- source include/not_embedded.inc
+-- source include/have_log_bin.inc
# we need this for getting fixed timestamps inside of this test
set timestamp=1000000000;
diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test
index 14b213cd9cc..c6869d67da1 100644
--- a/mysql-test/t/mysqlbinlog2.test
+++ b/mysql-test/t/mysqlbinlog2.test
@@ -1,8 +1,7 @@
# Test for the new options --start-datetime, stop-datetime,
# and a few others.
-# Embedded server doesn't support binlogging
--- source include/not_embedded.inc
+-- source include/have_log_bin.inc
--disable_warnings
drop table if exists t1;
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 4c4690520c6..7681e5a6295 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -1,5 +1,6 @@
# Embedded server doesn't support external clients
--source include/not_embedded.inc
+--source include/have_log_bin.inc
--disable_warnings
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3;
@@ -1528,7 +1529,14 @@ drop user user2;
drop database mysqldump_test_db;
+--echo #
+--echo # Bug #28522: buffer overrun by '\0' byte using --hex-blob.
+--echo #
+CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
+INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
+--exec $MYSQL_DUMP --skip-create --compact --hex-blob test t1
+DROP TABLE t1;
--echo #
--echo # End of 5.0 tests
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 328206626df..d7c9945fe18 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -46,11 +46,6 @@ select otto from (select 1 as otto) as t1;
--error 0
select otto from (select 1 as otto) as t1;
-# expectation <> response
--- // --error 1054
--- // select otto from (select 1 as otto) as t1;
-
-
# ----------------------------------------------------------------------------
# Negative case(statement):
# The derived table t1 does not contain a column named 'friedrich' .
@@ -331,9 +326,9 @@ select 3 from t1 ;
# This is a comment
# This is a ; comment
# This is a -- comment
--- This is also a comment
--- # This is also a comment
--- This is also a ; comment
+# -- This is also a comment
+# -- # This is also a comment
+# -- This is also a ; comment
# ----------------------------------------------------------------------------
# Test comments with embedded command
@@ -1227,11 +1222,9 @@ select "a" as col1, "c" as col2;
# Test sync_with_master
# ----------------------------------------------------------------------------
--error 1
---exec echo "save_master_pos; sync_with_master 10!;" | $MYSQL_TEST 2>&1
+--exec echo "sync_with_master 10!;" | $MYSQL_TEST 2>&1
--error 1
---exec echo "save_master_pos; sync_with_master 10 !;" | $MYSQL_TEST 2>&1
---error 1
---exec echo "save_master_pos; sync_with_master a;" | $MYSQL_TEST 2>&1
+--exec echo "sync_with_master a;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test connect
@@ -1740,23 +1733,130 @@ EOF
--exec echo "echo Some output; exit; echo Not this;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
-# test for query_sorted
+# test for sorted_result
# ----------------------------------------------------------------------------
create table t1( a int, b char(255), c timestamp);
insert into t1 values(1, 'Line 1', '2007-04-05'), (2, "Part 2", '2007-04-05');
insert into t1 values(1, 'Line 1', '2007-04-05'), (2, "Part 3", '2007-04-05');
select * from t1;
-query_sorted select * from t1;
+--sorted_result
+select * from t1;
+# Should not be sorted
+select * from t1;
disable_result_log;
-query_sorted select * from t1;
+sorted_result;
+select * from t1;
enable_result_log;
-query_sorted select '';
-query_sorted select "h";
-query_sorted select "he";
-query_sorted select "hep";
-query_sorted select "hepp";
+--sorted_result
+select '';
+sorted_result;
+select "h";
+--sorted_result
+select "he";
+--sorted_result
+select "hep";
+--sorted_result
+select "hepp";
+drop table t1;
+
+# 1. Assignment of result set sorting
+sorted_result;
+ SELECT 2 as "my_col"
+UNION
+SELECT 1;
+#
+--sorted_result
+SELECT 2 as "my_col" UNION SELECT 1;
+--sorted_result
+SELECT 2 as "my_col"
+UNION
+SELECT 1;
+
+# 2. Ensure that the table header will be not sorted into the result
+--sorted_result
+SELECT '2' as "3"
+UNION
+SELECT '1';
+
+# 3. Ensure that an empty result set does not cause problems
+CREATE TABLE t1( a CHAR);
+--sorted_result
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# 4. Ensure that NULL values within the result set do not cause problems
+SELECT NULL as "my_col1",2 AS "my_col2"
+UNION
+SELECT NULL,1;
+--sorted_result
+SELECT NULL as "my_col1",2 AS "my_col2"
+UNION
+SELECT NULL,1;
+#
+SELECT 2 as "my_col1",NULL AS "my_col2"
+UNION
+SELECT 1,NULL;
+--sorted_result
+SELECT 2 as "my_col1",NULL AS "my_col2"
+UNION
+SELECT 1,NULL;
+
+# 5. "sorted_result" changes nothing when applied to a non query statement.
+sorted_result;
+ SET @a = 17;
+#
+# 6. Show that "sorted_result;" before the "SET @a = 17;" above does not affect
+# the now following query.
+SELECT 2 as "my_col"
+UNION
+SELECT 1;
+
+# 7. Ensure that "sorted_result" in combination with $variables works
+let $my_stmt=SELECT 2 as "my_col"
+UNION
+SELECT 1;
+--sorted_result
+eval $my_stmt;
+
+# 8. Ensure that "sorted_result " does not change the semantics of
+# "--error ...." or the protocol output after such an expected failure
+--sorted_result
+--error 1146
+SELECT '2' as "my_col1",2 as "my_col2"
+UNION
+SELECT '1',1 from t2;
+
+# 9. Ensure that several result formatting options including "sorted_result"
+# - have all an effect
+# - "--sorted_result" does not need to be direct before the statement
+# - Row sorting is applied after modification of the column content
+--sorted_result
+--replace_column 1 #
+SELECT '1' as "my_col1",2 as "my_col2"
+UNION
+SELECT '2',1;
+
+# 10. Ensure that at least 1024 rows within a result set do not cause problems
+#
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 SET f1 = 1024;
+INSERT INTO t1 SELECT f1 - 1 FROM t1;
+INSERT INTO t1 SELECT f1 - 2 FROM t1;
+INSERT INTO t1 SELECT f1 - 4 FROM t1;
+INSERT INTO t1 SELECT f1 - 8 FROM t1;
+INSERT INTO t1 SELECT f1 - 16 FROM t1;
+INSERT INTO t1 SELECT f1 - 32 FROM t1;
+INSERT INTO t1 SELECT f1 - 64 FROM t1;
+INSERT INTO t1 SELECT f1 - 128 FROM t1;
+INSERT INTO t1 SELECT f1 - 256 FROM t1;
+INSERT INTO t1 SELECT f1 - 512 FROM t1;
+--disable_result_log
+--sorted_result
+SELECT * FROM t1;
+--enable_result_log
+DROP TABLE t1;
# ----------------------------------------------------------------------------
# Some coverage tests
# ----------------------------------------------------------------------------
@@ -1764,10 +1864,132 @@ query_sorted select "hepp";
--disable_query_log
--exec $MYSQL_TEST --help 2>&1 > /dev/null
--exec $MYSQL_TEST --version 2>&1 > /dev/null
---enable_quary_log
+--enable_query_log
--disable_abort_on_error
--error 1
--exec $MYSQL_TEST a b c 2>&1 > /dev/null
--enable_abort_on_error
+--enable_query_log
+
+# ----------------------------------------------------------------------------
+# test for query_get_value
+# ----------------------------------------------------------------------------
+
+CREATE TABLE t1(
+ a int, b varchar(255), c datetime
+);
+SHOW COLUMNS FROM t1;
+
+#------------ Positive tests ------------
+# 1. constant parameters
+# value is simple string without spaces
+let $value= query_get_value(SHOW COLUMNS FROM t1, Type, 1);
+--echo statement=SHOW COLUMNS FROM t1 row_number=1, column_name="Type", Value=$value
+let $value= query_get_value("SHOW COLUMNS FROM t1", Type, 1);
+--echo statement="SHOW COLUMNS FROM t1" row_number=1, column_name="Type", Value=$value
+#
+# 2. $variables as parameters
+# value IS NULL
+let $my_show= SHOW COLUMNS FROM t1;
+let $column_name= Default;
+let $row_number= 1;
+let $value= query_get_value($my_show, $column_name, $row_number);
+--echo statement=$my_show row_number=$row_number, column_name=$column_name, Value=$value
+#
+# 3. result set of a SELECT (not recommended, because projection and
+# selection could be done much better by pure SELECT functionality)
+# value is string with space in the middle
+let $value= query_get_value(SELECT 'A B' AS "MyColumn", MyColumn, 1);
+--echo value= ->$value<-
+#
+# 4. column name with space
+let $value= query_get_value(SELECT 1 AS "My Column", My Column, 1);
+--echo value= $value
+#
+#------------ Negative tests ------------
+# 5. Incomplete statement including missing parameters
+# 5.1 incomplete statement
+--error 1
+--exec echo "let \$value= query_get_value(SHOW;" | $MYSQL_TEST 2>&1
+# 5.2 missing query
+--error 1
+--exec echo "let \$value= query_get_value;" | $MYSQL_TEST 2>&1
+# 5.3 missing column name
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLUMNS FROM t1);" | $MYSQL_TEST 2>&1
+# 5.4 missing row number
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLUMNS FROM t1, Field);" | $MYSQL_TEST 2>&1
+#
+# 6. Somehow "wrong" value of parameters
+# 6.1 row parameter
+# 6.1.1 non sense number 0
+let $value= initialized;
+let $value= query_get_value(SHOW COLUMNS FROM t1, Field, 0);
+--echo value= $value
+# 6.1.2 after the last row
+let $value= initialized;
+let $value= query_get_value(SHOW COLUMNS FROM t1, Field, 10);
+--echo value= $value
+# 6.1.3 invalid row number
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLUMNS FROM t1, Field, notnumber);" | $MYSQL_TEST 2>&1
+# 6.2 column name parameter, name of not existing column
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLUMNS FROM t1, column_not_exists, 1);" | $MYSQL_TEST 2>&1
+# 6.3. statement which never gives a result set
+--error 1
+--exec echo "let \$value= query_get_value(SET @A = 1, Field, 1);" | $MYSQL_TEST 2>&1
+# 6.4. statement contains a ","
+# Note: There is no need to improve this, because we need query_get_value
+# for SHOW commands only.
+--error 1
+--exec echo "let \$value= query_get_value(SELECT 1 AS "A", 1 AS "B", 1);" | $MYSQL_TEST 2>&1
+#
+# 7. empty result set
+let $value= initialized;
+let $value= query_get_value(SELECT a FROM t1, a, 1);
+--echo value= $value
+#
+# 9. failing statement
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLNS FROM t1, Field, 1);" | $MYSQL_TEST 2>&1
+#
+# 10. Artificial example how to process a complete SHOW result set:
+let $show_statement= SHOW COLUMNS FROM t1;
+let $rowno= 1;
+let $run=1;
+let $count= 0;
+--echo
+--echo Field Type Null Key Default Extra
+while ($run)
+{
+ let $Field= query_get_value($show_statement, Field, $rowno);
+ if (`SELECT '$Field' = 'No such row'`)
+ {
+ let $run= 0;
+ }
+ if (`SELECT '$Field' <> 'No such row'`)
+ {
+ let $Type= query_get_value($show_statement, Type, $rowno);
+ let $Null= query_get_value($show_statement, Null, $rowno);
+ if (`SELECT '$Null' = 'YES'`)
+ {
+ inc $count;
+ }
+ let $Key= query_get_value($show_statement, Key, $rowno);
+ let $Default= query_get_value($show_statement, Default, $rowno);
+ let $Extra= query_get_value($show_statement, Extra, $rowno);
+ --echo $Field $Type $Null ->$Key<- $Default $Extra
+ inc $rowno;
+ }
+}
+--echo
+--echo Number of columns with Default NULL: $count
+--echo
+eval $show_statement;
+
+drop table t1;
--echo End of tests
+
diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test
index 8fda2ede948..70fbfbfe733 100644
--- a/mysql-test/t/ndb_basic.test
+++ b/mysql-test/t/ndb_basic.test
@@ -607,6 +607,21 @@ select * from t1 order by counter;
drop table t1;
#
+# bug#27437
+connection con1;
+create table t1 (a int primary key auto_increment) engine = ndb;
+insert into t1() values (),(),(),(),(),(),(),(),(),(),(),();
+connection con2;
+insert into t1(a) values (20),(28);
+connection con1;
+insert into t1() values (),(),(),(),(),(),(),(),(),(),(),();
+connection con2;
+insert into t1() values (21), (22);
+connection con1;
+
+drop table t1;
+
+#
# BUG#14514 Creating table with packed key fails silently
#
diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test
index bf25ca9a133..f346b7dc4ab 100644
--- a/mysql-test/t/ndb_insert.test
+++ b/mysql-test/t/ndb_insert.test
@@ -630,4 +630,13 @@ INSERT IGNORE INTO t1 VALUES (4,NULL),(5,NULL),(6,NULL),(7,4);
SELECT * FROM t1 ORDER BY pk;
DROP TABLE t1;
+#
+# Bug #27980 INSERT IGNORE wrongly ignores NULLs in unique index
+#
+
+create table t1(a int primary key, b int, unique key(b)) engine=ndb;
+insert ignore into t1 values (1,0), (2,0), (2,null), (3,null);
+select * from t1 order by a;
+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 3e8fa07dfb7..29a290c7fbf 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -719,10 +719,10 @@ CREATE TABLE t1 (a INT UNSIGNED NOT NULL, b TIME);
INSERT INTO t1 (a) VALUES (100000), (0), (100), (1000000),(10000), (1000), (10);
UPDATE t1 SET b = SEC_TO_TIME(a);
--- Correct ORDER
+# Correct ORDER
SELECT a, b FROM t1 ORDER BY b DESC;
--- must be ordered as the above
+# must be ordered as the above
SELECT a, b FROM t1 ORDER BY SEC_TO_TIME(a) DESC;
DROP TABLE t1;
diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test
index 7c90fd32909..2b80b0b9d93 100644
--- a/mysql-test/t/outfile.test
+++ b/mysql-test/t/outfile.test
@@ -41,9 +41,9 @@ eval select * into dumpfile "../tmp/outfile-test.2" from t1;
eval select * into dumpfile "../tmp/outfile-test.3" from t1;
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.1
---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.2
---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.3
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.1
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.2
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.3
drop table t1;
# Bug#8191
@@ -51,7 +51,7 @@ disable_query_log;
eval select 1 into outfile "../tmp/outfile-test.4";
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.4"));
---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
#
# Bug #5382: 'explain select into outfile' crashes the server
@@ -75,7 +75,7 @@ eval SELECT * INTO OUTFILE "../tmp/outfile-test.4"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM information_schema.schemata LIMIT 0, 5;
# enable_query_log;
---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
use information_schema;
# disable_query_log;
@@ -83,7 +83,7 @@ eval SELECT * INTO OUTFILE "../tmp/outfile-test.4"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM schemata LIMIT 0, 5;
enable_query_log;
---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
use test;
#
@@ -96,3 +96,38 @@ create table t1(a int);
eval select * into outfile "$MYSQL_TEST_DIR/outfile-test1" from t1;
drop table t1;
+#
+# Bug#28181 Access denied to 'information_schema when
+# select into out file (regression)
+#
+create database mysqltest;
+create user user_1@localhost;
+grant all on mysqltest.* to user_1@localhost;
+connect (con28181_1,localhost,user_1,,mysqltest);
+
+--error 1044
+eval select schema_name
+into outfile "../tmp/outfile-test.4"
+fields terminated by ',' optionally enclosed by '"'
+ lines terminated by '\n'
+from information_schema.schemata
+where schema_name like 'mysqltest';
+
+connection default;
+grant file on *.* to user_1@localhost;
+
+connect (con28181_2,localhost,user_1,,mysqltest);
+eval select schema_name
+into outfile "../tmp/outfile-test.4"
+fields terminated by ',' optionally enclosed by '"'
+ lines terminated by '\n'
+from information_schema.schemata
+where schema_name like 'mysqltest';
+
+connection default;
+--exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4
+use test;
+revoke all privileges on *.* from user_1@localhost;
+drop user user_1@localhost;
+drop database mysqltest;
+
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 3fbcf84a1f9..93a89c2b275 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -33,13 +33,13 @@ deallocate prepare no_such_statement;
execute stmt1;
# Nesting ps commands is not allowed:
---error 1064
+--error ER_UNSUPPORTED_PS
prepare stmt2 from 'prepare nested_stmt from "select 1"';
---error 1064
+--error ER_UNSUPPORTED_PS
prepare stmt2 from 'execute stmt1';
---error 1064
+--error ER_UNSUPPORTED_PS
prepare stmt2 from 'deallocate prepare z';
# PS insert
@@ -1194,6 +1194,24 @@ show create table t1;
--enable_warnings
drop table t1;
deallocate prepare stmt;
+#
+
+#
+# Bug #27937: crash on the second execution for prepared statement
+# from UNION with ORDER BY an expression containing RAND()
+#
+
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (2), (3), (1);
+
+PREPARE st1 FROM
+ '(SELECT a FROM t1) UNION (SELECT a+10 FROM t1) ORDER BY RAND()*0+a';
+
+EXECUTE st1;
+EXECUTE st1;
+
+DEALLOCATE PREPARE st1;
+DROP TABLE t1;
--echo End of 4.1 tests.
@@ -1773,5 +1791,13 @@ execute stmt;
deallocate prepare stmt;
drop tables t1;
+#
+# Bug #28509: strange behaviour: passing a decimal value to PS
+#
+prepare stmt from "create table t1 select ?";
+set @a=1.0;
+execute stmt using @a;
+show create table t1;
+drop table t1;
--echo End of 5.0 tests.
diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test
index d4e6a62c09e..2e7fea2ff3d 100644
--- a/mysql-test/t/ps_1general.test
+++ b/mysql-test/t/ps_1general.test
@@ -416,11 +416,11 @@ deallocate prepare stmt_do ;
deallocate prepare stmt_set ;
## nonsense like prepare of prepare,execute or deallocate
---error 1064
+--error ER_UNSUPPORTED_PS
prepare stmt1 from ' prepare stmt2 from '' select 1 '' ' ;
---error 1064
+--error ER_UNSUPPORTED_PS
prepare stmt1 from ' execute stmt2 ' ;
---error 1064
+--error ER_UNSUPPORTED_PS
prepare stmt1 from ' deallocate prepare never_prepared ' ;
## switch the database connection
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index 427334805ce..342ef5b6990 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -899,3 +899,99 @@ insert into t1(c1) select c1 from v1;
drop table t1, t2, t3;
drop view v1;
set global query_cache_size=0;
+
+#
+# Query cache and changes to system variables
+#
+
+create table t1 (a int);
+insert into t1 values (1),(2),(3);
+set GLOBAL query_cache_type=1;
+set GLOBAL query_cache_limit=10000;
+set GLOBAL query_cache_min_res_unit=0;
+set GLOBAL query_cache_size= 100000;
+
+# default_week_format
+reset query cache;
+set LOCAL default_week_format = 0;
+select week('2007-01-04');
+select week('2007-01-04') from t1;
+select extract(WEEK FROM '2007-01-04') from t1;
+
+set LOCAL default_week_format = 2;
+select week('2007-01-04');
+select week('2007-01-04') from t1;
+select extract(WEEK FROM '2007-01-04') from t1;
+
+# div_precision_increment
+reset query cache;
+set LOCAL div_precision_increment=2;
+select 1/7;
+select 1/7 from t1;
+
+set LOCAL div_precision_increment=4;
+select 1/7;
+select 1/7 from t1;
+
+drop table t1;
+
+CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
+INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
+ ('Full-text indexes', 'are called collections'),
+ ('Only MyISAM tables','support collections'),
+ ('Function MATCH ... AGAINST()','is used to do a search'),
+ ('Full-text search in MySQL', 'implements vector space model');
+
+
+set GLOBAL ft_boolean_syntax='+ -><()~*:""&|';
+
+select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1;
+
+# swap +/-
+set GLOBAL ft_boolean_syntax='- +><()~*:""&|';
+
+select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1;
+
+# If in the future we need to cache queries with functions
+# be sure not to cause dead lock if the query cache is flushed
+# while inserting a query in the query cache.
+delimiter |;
+create function change_global() returns integer
+begin
+ set global ft_boolean_syntax='+ -><()~*:""&|';
+ return 1;
+end|
+delimiter ;|
+select *, change_global() from t1;
+drop function change_global;
+
+drop table t1;
+
+set GLOBAL query_cache_type=default;
+set GLOBAL query_cache_limit=default;
+set GLOBAL query_cache_min_res_unit=default;
+set GLOBAL query_cache_size= default;
+
+
+#
+# Bug #28897 UUID() returns non-unique values when query cache is enabled
+#
+
+set GLOBAL query_cache_size=1000000;
+
+create table t1 (a char);
+insert into t1 values ('c');
+
+let $q1= `select UUID(), a from t1`;
+let $q2= `select UUID(), a from t1`;
+
+# disabling the logging of the query because the UUIDs are different each run.
+--disable_query_log
+eval select a from t1 where "$q1" = "$q2";
+--enable_query_log
+
+drop table t1;
+
+set GLOBAL query_cache_size= default;
+
+# End of 5.0 tests
diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test
index d2750fecbac..20d044306a6 100644
--- a/mysql-test/t/row.test
+++ b/mysql-test/t/row.test
@@ -7,10 +7,8 @@ select (1,2,3) IN ((3,2,3), (1,2,3), (1,3,3));
select row(10,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3));
select row(1,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3));
select row(10,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3));
---disable_ps_warnings
select row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a'));
select row('a',0,3) IN (row(3,2,3), row('a','a','3'), row(1,3,3));
---enable_ps_warnings
select row('a',0,3) IN (row(3,2,3), row('a','0','3'), row(1,3,3));
select row('a',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3));
select row('b',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3));
diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test
index d05e4df66b1..e103d40943f 100644
--- a/mysql-test/t/rpl000015.test
+++ b/mysql-test/t/rpl000015.test
@@ -1,3 +1,5 @@
+-- source include/have_log_bin.inc
+
connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
connection master;
diff --git a/mysql-test/t/rpl000017.test b/mysql-test/t/rpl000017.test
index c1d36d53501..4488cbad230 100644
--- a/mysql-test/t/rpl000017.test
+++ b/mysql-test/t/rpl000017.test
@@ -1,3 +1,5 @@
+-- source include/have_log_bin.inc
+
connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
connection master;
diff --git a/mysql-test/t/rpl_loaddata.test b/mysql-test/t/rpl_loaddata.test
index 5ebdec6f761..a4781ed4faa 100644
--- a/mysql-test/t/rpl_loaddata.test
+++ b/mysql-test/t/rpl_loaddata.test
@@ -12,6 +12,7 @@
# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986)
source include/master-slave.inc;
+source include/have_innodb.inc;
connection slave;
reset master;
@@ -150,5 +151,14 @@ drop table t2;
connection master;
drop table t2;
drop table t1;
+
+# BUG#17233 LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed
+CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
+
+--error 1062
+LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;
+
+DROP TABLE t1;
+
sync_with_master;
# End of 4.1 tests
diff --git a/mysql-test/t/rpl_packet.test b/mysql-test/t/rpl_packet.test
index db6f475dc94..f410b561663 100644
--- a/mysql-test/t/rpl_packet.test
+++ b/mysql-test/t/rpl_packet.test
@@ -56,7 +56,7 @@ START SLAVE;
# Reconnect to master for new setting to take effect
disconnect master;
-connect (master, localhost, root)
+connect (master, localhost, root);
connection master;
CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test
index 5d9f1c29fe2..69614b45693 100644
--- a/mysql-test/t/rpl_rotate_logs.test
+++ b/mysql-test/t/rpl_rotate_logs.test
@@ -1,6 +1,8 @@
# This test uses chmod, can't be run with root permissions
-- source include/not_as_root.inc
+-- source include/have_log_bin.inc
+
#
# Test is run with max_binlog_size=2048 to force automatic rotation of the
# binary log
@@ -107,9 +109,18 @@ show master logs;
# we just tests if synonyms are accepted
purge binary logs to 'master-bin.000002';
show binary logs;
-# sleeping 10 seconds or more would make the slave believe connection is down
---real_sleep 1
-purge master logs before now();
+
+# Calculate time to use in "purge master logs before" by taking
+# last modification time of t2 and adding 1 second
+# This is donw in order to handle the case where file system
+# time differs from mysqld's time
+--disable_result_log
+select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
+ from information_schema.tables
+ where TABLE_SCHEMA="test" and TABLE_NAME="t2";
+--enable_result_log
+
+purge master logs before (@time_for_purge);
show binary logs;
insert into t2 values (65);
sync_slave_with_master;
diff --git a/mysql-test/t/rpl_user_variables.test b/mysql-test/t/rpl_user_variables.test
index b2f4bfbb29d..8f8f0accbd1 100644
--- a/mysql-test/t/rpl_user_variables.test
+++ b/mysql-test/t/rpl_user_variables.test
@@ -296,13 +296,48 @@ SELECT * from t1;
SELECT * from t2;
connection master;
+drop table t1, t2;
---echo End of 5.0 tests.
+#
+# Bug #26842: master binary log contains invalid queries - replication fails
+#
+save_master_pos;
+connection slave;
+sync_with_master;
+reset master;
-# Cleanup
+connection master;
+create table t1 (a int);
+prepare s from "insert into t1 values (@a),(?)";
+set @a=98; execute s using @a;
+prepare s from "insert into t1 values (?)";
+set @a=99; execute s using @a;
+prepare s from "insert into t1 select 100 limit ?";
+set @a=100; execute s using @a;
-DROP TABLE t1;
-DROP TABLE t2;
+save_master_pos;
+connection slave;
+sync_with_master;
+show binlog events from 98;
+select * from t1;
+connection master;
+drop table t1;
+
+#
+# Bug #12826: Possible to get inconsistent slave using SQL syntax Prepared Statements
+#
+connection master;
+create table t1(a int, b int);
+prepare s1 from 'insert into t1 values (@x:=@x+1, ?)';
+set @x=1; execute s1 using @x;
+select * from t1;
+sync_slave_with_master;
+connection slave;
+select * from t1;
+connection master;
+drop table t1;
+
+--echo End of 5.0 tests.
# This test uses a stored function that uses user-defined variables to return data
# The test ensures the value of the user-defined variable is replicated correctly
@@ -310,7 +345,6 @@ DROP TABLE t2;
# This test was constructed for BUG#20141
--disable_warnings
-DROP TABLE IF EXISTS t1;
DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f2;
--enable_warnings
@@ -358,4 +392,3 @@ DROP TABLE t1;
sync_slave_with_master;
stop slave;
-
diff --git a/mysql-test/t/rpl_view.test b/mysql-test/t/rpl_view.test
index 812e5d44d58..21748586130 100644
--- a/mysql-test/t/rpl_view.test
+++ b/mysql-test/t/rpl_view.test
@@ -149,4 +149,16 @@ drop view v1;
sync_slave_with_master;
+#
+# BUG#28244 CREATE VIEW breaks replication when view exists
+#
+connection master;
+CREATE TABLE t1(a INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+--error ER_TABLE_EXISTS_ERROR
+CREATE VIEW v1 AS SELECT * FROM t1;
+DROP VIEW v1;
+DROP TABLE t1;
+sync_slave_with_master;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/sp-code.test b/mysql-test/t/sp-code.test
index 97bc29fcad2..10755f2bf8a 100644
--- a/mysql-test/t/sp-code.test
+++ b/mysql-test/t/sp-code.test
@@ -2,7 +2,7 @@
# Test the debugging feature "show procedure/function code <name>"
#
--- source include/is_debug_build.inc
+-- source include/have_debug.inc
--disable_warnings
drop procedure if exists empty;
@@ -446,4 +446,79 @@ SHOW PROCEDURE CODE p1;
DROP PROCEDURE p1;
+#
+# Bug#26977 exception handlers never hreturn
+#
+--disable_warnings
+drop table if exists t1;
+drop procedure if exists proc_26977_broken;
+drop procedure if exists proc_26977_works;
+--enable_warnings
+
+create table t1(a int unique);
+
+delimiter //;
+
+create procedure proc_26977_broken(v int)
+begin
+ declare i int default 5;
+
+ declare continue handler for sqlexception
+ begin
+ select 'caught something';
+ retry:
+ while i > 0 do
+ begin
+ set i = i - 1;
+ select 'looping', i;
+ end;
+ end while retry;
+ end;
+
+ select 'do something';
+ insert into t1 values (v);
+ select 'do something again';
+ insert into t1 values (v);
+end//
+
+create procedure proc_26977_works(v int)
+begin
+ declare i int default 5;
+
+ declare continue handler for sqlexception
+ begin
+ select 'caught something';
+ retry:
+ while i > 0 do
+ begin
+ set i = i - 1;
+ select 'looping', i;
+ end;
+ end while retry;
+ select 'optimizer: keep hreturn';
+ end;
+
+ select 'do something';
+ insert into t1 values (v);
+ select 'do something again';
+ insert into t1 values (v);
+end//
+delimiter ;//
+
+show procedure code proc_26977_broken;
+
+show procedure code proc_26977_works;
+
+## This caust an error because of jump short cut
+## optimization.
+call proc_26977_broken(1);
+
+## This works
+call proc_26977_works(2);
+
+drop table t1;
+drop procedure proc_26977_broken;
+drop procedure proc_26977_works;
+
+
--echo End of 5.0 tests.
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index 9e5c795d586..ec91be13ba0 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -1454,7 +1454,7 @@ select bug12329();
# Until we implement proper mechanism for invalidation of PS/SP when table
# or SP's are changed the following statement will fail with 'Table ... was
# not locked' error (this mechanism should be based on the new TDC).
---error 1100
+--error ER_NO_SUCH_TABLE
execute stmt1;
deallocate prepare stmt1;
drop function bug12329;
@@ -1639,13 +1639,13 @@ create trigger t1_ai after insert on t1 for each row insert into t2 values (new.
create view v1 as select * from t1;
drop table t2;
# Limitation, the desired error is ER_VIEW_INVALID
---error ER_TABLE_NOT_LOCKED
+--error ER_NO_SUCH_TABLE
insert into v1 values (1);
drop trigger t1_ai;
create function bug11555_1() returns int return (select max(i) from t2);
create trigger t1_ai after insert on t1 for each row set @a:=bug11555_1();
# Limitation, the desired error is ER_VIEW_INVALID
---error ER_TABLE_NOT_LOCKED
+--error ER_NO_SUCH_TABLE
insert into v1 values (2);
drop function bug11555_1;
drop table t1;
diff --git a/mysql-test/t/sp-prelocking.test b/mysql-test/t/sp-prelocking.test
index cc3e3b93e06..ec5b7fbad7c 100644
--- a/mysql-test/t/sp-prelocking.test
+++ b/mysql-test/t/sp-prelocking.test
@@ -301,5 +301,36 @@ deallocate prepare stmt;
drop function bug19634;
drop table t1, t2, t3;
+#
+# Bug #27907 Misleading error message when opening/locking tables
+#
+
+--disable_warnings
+drop table if exists bug_27907_logs;
+drop table if exists bug_27907_t1;
+--enable_warnings
+
+create table bug_27907_logs (a int);
+create table bug_27907_t1 (a int);
+
+delimiter |;
+
+create trigger bug_27907_t1_ai after insert on bug_27907_t1
+for each row
+begin
+ insert into bug_27907_logs (a) values (1);
+end|
+
+delimiter ;|
+
+drop table bug_27907_logs;
+
+#
+# was failing before with error ER_NOT_LOCKED
+#
+--error ER_NO_SUCH_TABLE
+insert into bug_27907_t1(a) values (1);
+
+drop table bug_27907_t1;
--echo End of 5.0 tests
diff --git a/mysql-test/t/sp-vars.test b/mysql-test/t/sp-vars.test
index 0014dc1f6af..2cc68b054d5 100644
--- a/mysql-test/t/sp-vars.test
+++ b/mysql-test/t/sp-vars.test
@@ -1367,4 +1367,48 @@ CALL p1();
DROP PROCEDURE p1;
+#
+# Bug #27415 Text Variables in stored procedures
+# If the SP varible was also referenced on the right side
+# the result was corrupted.
+#
+DELIMITER |;
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS bug27415_text_test|
+DROP PROCEDURE IF EXISTS bug27415_text_test2|
+--enable_warnings
+
+CREATE PROCEDURE bug27415_text_test(entity_id_str_in text)
+BEGIN
+ DECLARE str_remainder text;
+
+ SET str_remainder = entity_id_str_in;
+
+ select 'before substr', str_remainder;
+ SET str_remainder = SUBSTRING(str_remainder, 3);
+ select 'after substr', str_remainder;
+END|
+
+CREATE PROCEDURE bug27415_text_test2(entity_id_str_in text)
+BEGIN
+ DECLARE str_remainder text;
+ DECLARE str_remainder2 text;
+
+ SET str_remainder2 = entity_id_str_in;
+ select 'before substr', str_remainder2;
+ SET str_remainder = SUBSTRING(str_remainder2, 3);
+ select 'after substr', str_remainder;
+END|
+
+CALL bug27415_text_test('a,b,c')|
+CALL bug27415_text_test('a,b,c')|
+CALL bug27415_text_test2('a,b,c')|
+CALL bug27415_text_test('a,b,c')|
+
+DROP PROCEDURE bug27415_text_test|
+DROP PROCEDURE bug27415_text_test2|
+
+DELIMITER ;|
+
# End of 5.0 tests.
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index c94a526e10c..0de416cdffa 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -6975,7 +6975,7 @@ use test|
--disable_warnings
drop function if exists bug20777|
drop table if exists examplebug20777|
---enabled_warnings
+--enable_warnings
create function bug20777(f1 bigint unsigned) returns bigint unsigned
begin
set f1 = (f1 - 10); set f1 = (f1 + 10);
@@ -7054,6 +7054,17 @@ SELECT bug5274_f2()|
DROP FUNCTION bug5274_f1|
DROP FUNCTION bug5274_f2|
+#
+# Bug#21513 (SP having body starting with quoted label rendered unusable)
+#
+--disable_warnings
+drop procedure if exists proc_21513|
+--enable_warnings
+
+create procedure proc_21513()`my_label`:BEGIN END|
+show create procedure proc_21513|
+
+drop procedure proc_21513|
###
--echo End of 5.0 tests.
@@ -7101,3 +7112,23 @@ select count(*) from t1 /* must be 3 */;
drop table t1,t2;
drop function bug27354;
+
+#
+# Bug #28605: SHOW CREATE VIEW with views using stored_procedures no longer
+# showing SP names.
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE FUNCTION metered(a INT) RETURNS INT RETURN 12;
+
+CREATE VIEW v1 AS SELECT test.metered(a) as metered FROM t1;
+
+SHOW CREATE VIEW v1;
+
+DROP VIEW v1;
+DROP FUNCTION metered;
+DROP TABLE t1;
+
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test
index d9b34c303ae..1ea32316f1e 100644
--- a/mysql-test/t/sp_trans.test
+++ b/mysql-test/t/sp_trans.test
@@ -554,37 +554,6 @@ set @@session.max_heap_table_size=default|
#
-# Bug #13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog
-# Bug #23333 stored function + non-transac table + transac table =
-# breaks stmt-based binlog
-# Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF()
-#
---disable_warnings
-drop function if exists bug23333|
-drop table if exists t1,t2|
---enable_warnings
- CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
- CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
-
-insert into t2 values (1,1)|
-
-create function bug23333()
-RETURNS int(11)
-DETERMINISTIC
-begin
- insert into t1 values (null);
- select count(*) from t1 into @a;
- return @a;
-end|
-
-reset master|
---error ER_DUP_ENTRY
-insert into t2 values (bug23333(),1)|
---replace_column 2 # 5 # 6 #
-show binlog events from 98 /* with fixes for #23333 will show there is the query */|
-select count(*),@a from t1 /* must be 1,1 */|
-
-#
# BUG#NNNN: New bug synopsis
#
#--disable_warnings
diff --git a/mysql-test/t/sp_trans_log.test b/mysql-test/t/sp_trans_log.test
new file mode 100644
index 00000000000..3e440b3ccc1
--- /dev/null
+++ b/mysql-test/t/sp_trans_log.test
@@ -0,0 +1,33 @@
+-- source include/have_innodb.inc
+-- source include/have_log_bin.inc
+
+delimiter |;
+
+#
+# Bug #13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog
+# Bug #23333 stored function + non-transac table + transac table =
+# breaks stmt-based binlog
+# Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF()
+#
+CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
+CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
+
+insert into t2 values (1,1)|
+
+create function bug23333()
+RETURNS int(11)
+DETERMINISTIC
+begin
+ insert into t1 values (null);
+ select count(*) from t1 into @a;
+ return @a;
+end|
+
+reset master|
+--error ER_DUP_ENTRY
+insert into t2 values (bug23333(),1)|
+--replace_column 2 # 5 # 6 #
+show binlog events from 98 /* with fixes for #23333 will show there is the query */|
+select count(*),@a from t1 /* must be 1,1 */|
+drop table t1, t2|
+
diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test
index faca9e7b080..2b71bf1093c 100644
--- a/mysql-test/t/strict.test
+++ b/mysql-test/t/strict.test
@@ -7,7 +7,7 @@ set @@sql_mode='ansi,traditional';
select @@sql_mode;
--disable_warnings
-DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t1, t2;
--enable_warnings
# Test INSERT with DATE
@@ -890,11 +890,11 @@ INSERT INTO t1 (col1,col2,col3) VALUES (NULL, '', '2004-01-01');
INSERT INTO t1 (col1,col2,col3) VALUES (102, NULL, '2004-01-01');
--error 1048
INSERT INTO t1 VALUES (103,'',NULL);
---error 1263
+--error 1048
UPDATE t1 SET col1=NULL WHERE col1 =100;
---error 1263
+--error 1048
UPDATE t1 SET col2 =NULL WHERE col2 ='hello';
---error 1263
+--error 1048
UPDATE t1 SET col2 =NULL where col3 IS NOT NULL;
INSERT IGNORE INTO t1 values (NULL,NULL,NULL);
SELECT * FROM t1;
@@ -914,7 +914,7 @@ INSERT INTO t1 (col1) VALUES (2);
INSERT INTO t1 VALUES(default(col1),default(col2));
--error 1364
INSERT INTO t1 (col1) SELECT 1;
---error 1263
+--error 1048
INSERT INTO t1 SELECT 1,NULL;
INSERT IGNORE INTO t1 values (NULL,NULL);
INSERT IGNORE INTO t1 (col1) values (3);
@@ -975,9 +975,7 @@ select * from t1;
# Check that select don't abort even in strict mode (for now)
set sql_mode='traditional';
---disable_ps_warnings
select count(*) from t1 where STR_TO_DATE('2004.12.12 10:22:61','%Y.%m.%d %T') IS NULL;
---enable_ps_warnings
drop table t1;
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 5cd2cd5fa7d..d565070835e 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -2874,4 +2874,50 @@ FROM t1;
DROP TABLE t1,t2;
+#
+# Bug #27807: Server crash when executing subquery with EXPLAIN
+#
+CREATE TABLE t1 (a int, b int, KEY (a));
+INSERT INTO t1 VALUES (1,1),(2,1);
+EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b);
+DROP TABLE t1;
+
+#
+# Bug #28377: grouping query with a correlated subquery in WHERE condition
+#
+
+CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id));
+INSERT INTO t1 VALUES
+ (3,'FL'), (2,'GA'), (4,'FL'), (1,'GA'), (5,'NY'), (7,'FL'), (6,'NY');
+CREATE TABLE t2 (id int NOT NULL, INDEX idx(id));
+INSERT INTO t2 VALUES (7), (5), (1), (3);
+
+SELECT id, st FROM t1
+ WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
+SELECT id, st FROM t1
+ WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
+ GROUP BY id;
+
+SELECT id, st FROM t1
+ WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
+SELECT id, st FROM t1
+ WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
+ GROUP BY id;
+
+DROP TABLE t1,t2;
+
+#
+# Bug #28728: crash with EXPLAIN EXTENDED for a query with a derived table
+# over a grouping subselect
+#
+
+CREATE TABLE t1 (a int);
+
+INSERT INTO t1 VALUES (1), (2);
+
+EXPLAIN EXTENDED
+SELECT * FROM (SELECT count(*) FROM t1 GROUP BY a) as res;
+
+DROP TABLE t1;
+
--echo End of 5.0 tests.
diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test
index dfe09968fa2..2f844c9cc21 100644
--- a/mysql-test/t/subselect3.test
+++ b/mysql-test/t/subselect3.test
@@ -260,11 +260,11 @@ insert into t2 values
('dd', 1, NULL);
alter table t1 add index idx(ie1,ie2);
---cc 3 NULL NULL
+# cc 3 NULL NULL
select oref, a, b, (a,b) in (select ie1,ie2 from t1 where oref=t2.oref) Z from t2 where a=3 and b is null ;
insert into t2 values ('new1', 10,10);
insert into t1 values ('new1', 1234, 10, NULL);
--- new1, 10, 10, NULL,
+# new1, 10, 10, NULL,
select oref, a, b, (a,b) in (select ie1,ie2 from t1 where oref=t2.oref) Z from t2 where a=10 and b=10;
explain extended
select oref, a, b, (a,b) in (select ie1,ie2 from t1 where oref=t2.oref) Z from t2 where a=10 and b=10;
@@ -546,3 +546,46 @@ SELECT a FROM t1, t2 WHERE a=b AND (b NOT IN (SELECT a FROM t1));
SELECT a FROM t1, t2 WHERE a=b AND (b NOT IN (SELECT a FROM t1 WHERE a > 4));
DROP TABLE t1,t2;
+
+#
+# Bug #28375: crash for NOT IN subquery predicate when left operand becomes NULL
+#
+
+CREATE TABLE t1 (id int);
+CREATE TABLE t2 (id int PRIMARY KEY);
+CREATE TABLE t3 (id int PRIMARY KEY, name varchar(10));
+INSERT INTO t1 VALUES (2), (NULL), (3), (1);
+INSERT INTO t2 VALUES (234), (345), (457);
+INSERT INTO t3 VALUES (222,'bbb'), (333,'ccc'), (111,'aaa');
+
+EXPLAIN
+SELECT * FROM t1
+ WHERE t1.id NOT IN (SELECT t2.id FROM t2,t3
+ WHERE t3.name='xxx' AND t2.id=t3.id);
+SELECT * FROM t1
+ WHERE t1.id NOT IN (SELECT t2.id FROM t2,t3
+ WHERE t3.name='xxx' AND t2.id=t3.id);
+
+SELECT (t1.id IN (SELECT t2.id FROM t2,t3
+ WHERE t3.name='xxx' AND t2.id=t3.id)) AS x
+ FROM t1;
+
+DROP TABLE t1,t2,t3;
+
+#
+# Bug #22855: Optimizer doesn't rewrite NOT IN subselects to a correlated
+# subquery
+#
+CREATE TABLE t1 (a INT NOT NULL);
+INSERT INTO t1 VALUES (1),(-1), (65),(66);
+
+CREATE TABLE t2 (a INT UNSIGNED NOT NULL PRIMARY KEY);
+INSERT INTO t2 VALUES (65),(66);
+
+SELECT a FROM t1 WHERE a NOT IN (65,66);
+SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
+EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
+
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index a01efba11db..363df94eeb3 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -1000,9 +1000,9 @@ create trigger t1_bi after insert on t1 for each row insert into t3 values (new.
# Until we implement proper mechanism for invalidation of PS/SP when table
# or SP's are changed these two statements will fail with 'Table ... was
# not locked' error (this mechanism should be based on the new TDC).
---error 1100 #ER_TABLE_NOT_LOCKED
+--error ER_NO_SUCH_TABLE
execute stmt1;
---error 1100 #ER_TABLE_NOT_LOCKED
+--error ER_NO_SUCH_TABLE
call p1();
deallocate prepare stmt1;
drop procedure p1;
@@ -1737,4 +1737,85 @@ DROP TRIGGER trg27006_a_insert;
DROP TRIGGER trg27006_a_update;
drop table t1,t2;
+#
+# Bug #20903 "Crash when using CREATE TABLE .. SELECT and triggers"
+#
+
+--disable_warnings
+drop table if exists t1, t2, t3;
+--enable_warnings
+create table t1 (i int);
+create trigger t1_bi before insert on t1 for each row set new.i = 7;
+create trigger t1_ai after insert on t1 for each row set @a := 7;
+create table t2 (j int);
+insert into t2 values (1), (2);
+set @a:="";
+create table if not exists t1 select * from t2;
+select * from t1;
+select @a;
+# Let us check that trigger that involves table also works ok.
+drop trigger t1_bi;
+drop trigger t1_ai;
+create table t3 (isave int);
+create trigger t1_bi before insert on t1 for each row insert into t3 values (new.i);
+create table if not exists t1 select * from t2;
+select * from t1;
+select * from t3;
+drop table t1, t2, t3;
+
+#
+# Bug #26162: Trigger DML ignores low_priority_updates setting
+#
+CREATE TABLE t1 (id INTEGER);
+CREATE TABLE t2 (id INTEGER);
+
+INSERT INTO t2 VALUES (1),(2);
+
+# trigger that produces the high priority insert, but should be low, adding
+# LOW_PRIORITY fixes this
+CREATE TRIGGER t1_test AFTER INSERT ON t1 FOR EACH ROW
+ INSERT INTO t2 VALUES (new.id);
+
+CONNECT (rl_acquirer, localhost, root,,);
+CONNECT (wl_acquirer, localhost, root,,);
+CONNECT (rl_contender, localhost, root,,);
+
+SELECT GET_LOCK('B26162',20);
+
+CONNECTION rl_acquirer;
+--send
+SELECT 'rl_acquirer', GET_LOCK('B26162',5), id FROM t2 WHERE id = 1;
+
+CONNECTION wl_acquirer;
+SET SESSION LOW_PRIORITY_UPDATES=1;
+SET GLOBAL LOW_PRIORITY_UPDATES=1;
+--send
+INSERT INTO t1 VALUES (5);
+
+CONNECTION rl_contender;
+# must not "see" the row inserted by the INSERT (as it must run before the
+# INSERT)
+--send
+SELECT 'rl_contender', id FROM t2 WHERE id > 1;
+
+CONNECTION default;
+SELECT RELEASE_LOCK('B26162');
+
+CONNECTION wl_acquirer;
+--reap
+CONNECTION rl_acquirer;
+--reap
+CONNECTION rl_contender;
+--reap
+
+CONNECTION default;
+DISCONNECT rl_acquirer;
+DISCONNECT wl_acquirer;
+DISCONNECT rl_contender;
+
+DROP TRIGGER t1_test;
+DROP TABLE t1,t2;
+SET SESSION LOW_PRIORITY_UPDATES=DEFAULT;
+SET GLOBAL LOW_PRIORITY_UPDATES=DEFAULT;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index c6050753943..02cd07e3c16 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -123,3 +123,16 @@ insert into t1 values ('2000-01-01','2000-01-02');
select 1 from t1 where cast('2000-01-01 12:01:01' as datetime) between start_date and end_date;
drop table t1;
# End of 4.1 tests
+
+#
+# Bug #23093: Implicit conversion of 9912101 to date does not match
+# cast(9912101 as date)
+#
+select @d:=1111, year(@d), month(@d), day(@d), cast(@d as date);
+select @d:=011111, year(@d), month(@d), day(@d), cast(@d as date);
+select @d:=1311, year(@d), month(@d), day(@d), cast(@d as date);
+create table t1 (d date , dt datetime , ts timestamp);
+insert into t1 values (9912101,9912101,9912101);
+insert into t1 values (11111,11111,11111);
+select * from t1;
+drop table t1;
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index fc7b20d77a4..d420afbde37 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -141,6 +141,31 @@ SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME) AS DECIMAL(20,6));
SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME) + INTERVAL 14 MICROSECOND AS DECIMAL(20,6));
SELECT CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6));
+
+#
+# Test of storing datetime into date fields
+#
+
+set @org_mode=@@sql_mode;
+create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03');
+show create table t1;
+insert into t1 values ();
+insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
+set @@sql_mode='ansi,traditional';
+insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
+insert into t1 set dt='2007-03-23 13:49:38',da=dt;
+# Test error handling
+--error 1292
+insert into t1 values ('2007-03-32','2007-03-23 13:49:38');
+select * from t1;
+drop table t1;
+--error 1067
+create table t1 (da date default '1962-03-32 23:33:34', dt datetime default '1962-03-03');
+--error 1067
+create table t1 (t time default '916:00:00 a');
+set @@sql_mode= @org_mode;
+
+
#
# Bug#27590: Wrong DATE/DATETIME comparison.
#
@@ -178,3 +203,71 @@ select f2, f3 from t1 where '01-03-10' between f2 and f3;
select f2 from t1 where DATE(f2) between "2001-4-15" AND "01-4-15";
SELECT 1 from dual where NOW() BETWEEN CURRENT_DATE() - INTERVAL 1 DAY AND CURRENT_DATE();
drop table t1;
+
+#
+# Bug#28133: Wrong DATE/DATETIME comparison in IN() function.
+#
+create table t1 (f1 date);
+insert into t1 values('01-01-01'),('01-01-02'),('01-01-03');
+select * from t1 where f1 in ('01-01-01','2001-01-02','2001-01-03 00:00:00');
+create table t2(f2 datetime);
+insert into t2 values('01-01-01 00:00:00'),('01-02-03 12:34:56'),('02-04-06 11:22:33');
+select * from t2 where f2 in ('01-01-01','01-02-03 12:34:56','01-02-03');
+select * from t1,t2 where '01-01-02' in (f1, cast(f2 as date));
+select * from t1,t2 where '01-01-01' in (f1, '01-02-03');
+select * from t1,t2 where if(1,'01-02-03 12:34:56','') in (f1, f2);
+create table t3(f3 varchar(20));
+insert into t3 select * from t2;
+select * from t2,t3 where f2 in (f3,'03-04-05');
+select f1,f2,f3 from t1,t2,t3 where (f1,'1') in ((f2,'1'),(f3,'1'));
+select f1 from t1 where ('1',f1) in (('1','01-01-01'),('1','2001-1-1 0:0:0'),('1','02-02-02'));
+drop table t1,t2,t3;
+
+#
+# Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions.
+#
+select least(cast('01-01-01' as date), '01-01-02');
+select greatest(cast('01-01-01' as date), '01-01-02');
+select least(cast('01-01-01' as date), '01-01-02') + 0;
+select greatest(cast('01-01-01' as date), '01-01-02') + 0;
+select least(cast('01-01-01' as datetime), '01-01-02') + 0;
+select cast(least(cast('01-01-01' as datetime), '01-01-02') as signed);
+select cast(least(cast('01-01-01' as datetime), '01-01-02') as decimal(20,2));
+--disable_warnings
+DROP PROCEDURE IF EXISTS test27759 ;
+--enable_warnings
+DELIMITER |;
+CREATE PROCEDURE test27759()
+BEGIN
+declare v_a date default '2007-4-10';
+declare v_b date default '2007-4-11';
+declare v_c datetime default '2004-4-9 0:0:0';
+select v_a as a,v_b as b,
+ least( v_a, v_b ) as a_then_b,
+ least( v_b, v_a ) as b_then_a,
+ least( v_c, v_a ) as c_then_a;
+END;|
+DELIMITER ;|
+call test27759();
+drop procedure test27759;
+
+#
+# Bug#28208: Wrong result of a non-const STRING function with a const
+# DATETIME function.
+#
+create table t1 (f1 date);
+insert into t1 values (curdate());
+select left(f1,10) = curdate() from t1;
+drop table t1;
+
+#
+# Bug#28261: Wrong DATETIME comparison result when the GET_USER_VAR function
+# is involved.
+#
+create table t1(f1 date);
+insert into t1 values('01-01-01'),('02-02-02'),('01-01-01'),('02-02-02');
+set @bug28261='';
+select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
+select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
+select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
+drop table t1;
diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test
index 4b3429d9ea0..45da469cf2d 100644
--- a/mysql-test/t/type_enum.test
+++ b/mysql-test/t/type_enum.test
@@ -157,3 +157,11 @@ create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
 !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\€','zz‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'));
--echo End of 4.1 tests
+
+#
+# Bug#28729: Field_enum wrongly reported an error while storing an empty string.
+#
+create table t1(f1 set('a','b'), index(f1));
+insert into t1 values(''),(''),('a'),('b');
+select * from t1 where f1='';
+drop table t1;
diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test
index f790bcf6daa..a55200c8853 100644
--- a/mysql-test/t/type_float.test
+++ b/mysql-test/t/type_float.test
@@ -222,3 +222,23 @@ drop table t1;
create table t1 (s1 float(0,2));
--error 1427
create table t1 (s1 float(1,2));
+
+#
+# Bug #28121 "INSERT or UPDATE into DOUBLE(200,0) field being truncated to 31 digits"
+#
+
+create table t1 (f1 double(200, 0));
+insert into t1 values (1e199), (-1e199);
+insert into t1 values (1e200), (-1e200);
+insert into t1 values (2e200), (-2e200);
+select f1 + 0e0 from t1;
+drop table t1;
+
+create table t1 (f1 float(30, 0));
+insert into t1 values (1e29), (-1e29);
+insert into t1 values (1e30), (-1e30);
+insert into t1 values (2e30), (-2e30);
+select f1 + 0e0 from t1;
+drop table t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index 4c6098d2121..d2b808bd5e0 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -1130,4 +1130,36 @@ alter table t1 modify column a decimal(19);
select * from t1;
drop table t1;
+#
+# Bug #27957 cast as decimal does not check overflow, also inconsistent with group, subselect
+#
+
+select cast(11.1234 as DECIMAL(3,2));
+select * from (select cast(11.1234 as DECIMAL(3,2))) t;
+
+select cast(a as DECIMAL(3,2))
+ from (select 11.1233 as a
+ UNION select 11.1234
+ UNION select 12.1234
+ ) t;
+
+select cast(a as DECIMAL(3,2)), count(*)
+ from (select 11.1233 as a
+ UNION select 11.1234
+ UNION select 12.1234
+ ) t group by 1;
+
+#
+# Bug #28361 Buffer overflow in DECIMAL code on Windows
+#
+
+create table t1 (s varchar(100));
+insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875);
+drop table t1;
+
+#
+# Bug #27984 Long Decimal Maths produces truncated results
+#
+
+SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b;
--echo End of 5.0 tests
diff --git a/mysql-test/t/user_var-binlog.test b/mysql-test/t/user_var-binlog.test
index 12a5e616fa2..57bf9df2fb0 100644
--- a/mysql-test/t/user_var-binlog.test
+++ b/mysql-test/t/user_var-binlog.test
@@ -1,5 +1,4 @@
-# Embedded server does not support binlogging
---source include/not_embedded.inc
+-- source include/have_log_bin.inc
# Check that user variables are binlogged correctly (BUG#3875)
create table t1 (a varchar(50));
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index 70f57fdf283..3a3e8f88f83 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -222,3 +222,18 @@ drop table t1,t2;
insert into city 'blah';
SHOW COUNT(*) WARNINGS;
SHOW COUNT(*) ERRORS;
+
+#
+# Bug#28494: Grouping by Item_func_set_user_var produces incorrect result.
+#
+create table t1(f1 int, f2 varchar(2), f3 float, f4 decimal(2,1));
+insert into t1 values
+ (1, "a", 1.5, 1.6), (1, "a", 1.5, 1.6), (2, "b", 2.5, 2.6),
+ (3, "c", 3.5, 3.6), (4, "d", 4.5, 4.6), (1, "a", 1.5, 1.6),
+ (3, "c", 3.5, 3.6), (1, "a", 1.5, 1.6);
+select @a:=f1, count(f1) from t1 group by 1 desc;
+select @a:=f1, count(f1) from t1 group by 1 asc;
+select @a:=f2, count(f2) from t1 group by 1 desc;
+select @a:=f3, count(f3) from t1 group by 1 desc;
+select @a:=f4, count(f4) from t1 group by 1 desc;
+drop table t1;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index e5bf9de13eb..f574451af08 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3221,4 +3221,103 @@ EXPLAIN SELECT * FROM t1 UNION SELECT * FROM v1 ORDER BY a;
DROP VIEW v1;
DROP TABLE t1;
+#
+# Bug #27921 View ignores precision for CAST()
+#
+CREATE VIEW v1 AS SELECT CAST( 1.23456789 AS DECIMAL( 7,5 ) ) AS col;
+SELECT * FROM v1;
+DESCRIBE v1;
+DROP VIEW v1;
+
+CREATE VIEW v1 AS SELECT CAST(1.23456789 AS DECIMAL(8,0)) AS col;
+SHOW CREATE VIEW v1;
+DROP VIEW v1;
+
+#
+# Bug #28716: CHECK OPTION expression is evaluated over expired record buffers
+# when VIEW is updated via temporary tables
+#
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT, c INT DEFAULT 0);
+INSERT INTO t1 (a) VALUES (1), (2);
+INSERT INTO t2 (b) VALUES (1), (2);
+CREATE VIEW v1 AS SELECT t2.b,t2.c FROM t1, t2
+ WHERE t1.a=t2.b AND t2.b < 3 WITH CHECK OPTION;
+SELECT * FROM v1;
+UPDATE v1 SET c=1 WHERE b=1;
+SELECT * FROM v1;
+DROP VIEW v1;
+DROP TABLE t1,t2;
+
+#
+# Bug #28561: update on multi-table view with CHECK OPTION and
+# a subquery in WHERE condition
+#
+
+CREATE TABLE t1 (id int);
+CREATE TABLE t2 (id int, c int DEFAULT 0);
+INSERT INTO t1 (id) VALUES (1);
+INSERT INTO t2 (id) VALUES (1);
+
+CREATE VIEW v1 AS
+ SELECT t2.c FROM t1, t2
+ WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
+
+UPDATE v1 SET c=1;
+
+DROP VIEW v1;
+DROP TABLE t1,t2;
+
+#
+# Bug #27827: CHECK OPTION ignores ON conditions when updating
+# a multi-table view with CHECK OPTION.
+#
+
+CREATE TABLE t1 (a1 INT, c INT DEFAULT 0);
+CREATE TABLE t2 (a2 INT);
+CREATE TABLE t3 (a3 INT);
+CREATE TABLE t4 (a4 INT);
+INSERT INTO t1 (a1) VALUES (1),(2);
+INSERT INTO t2 (a2) VALUES (1),(2);
+INSERT INTO t3 (a3) VALUES (1),(2);
+INSERT INTO t4 (a4) VALUES (1),(2);
+
+CREATE VIEW v1 AS
+ SELECT t1.a1, t1.c FROM t1 JOIN t2 ON t1.a1=t2.a2 AND t1.c < 3
+ WITH CHECK OPTION;
+SELECT * FROM v1;
+--error 1369
+UPDATE v1 SET c=3;
+PREPARE t FROM 'UPDATE v1 SET c=3';
+--error 1369
+EXECUTE t;
+--error 1369
+EXECUTE t;
+--error 1369
+INSERT INTO v1(a1, c) VALUES (3, 3);
+UPDATE v1 SET c=1 WHERE a1=1;
+SELECT * FROM v1;
+SELECT * FROM t1;
+
+CREATE VIEW v2 AS SELECT t1.a1, t1.c
+ FROM (t1 JOIN t2 ON t1.a1=t2.a2 AND t1.c < 3)
+ JOIN (t3 JOIN t4 ON t3.a3=t4.a4)
+ ON t2.a2=t3.a3 WITH CHECK OPTION;
+SELECT * FROM v2;
+--error 1369
+UPDATE v2 SET c=3;
+PREPARE t FROM 'UPDATE v2 SET c=3';
+--error 1369
+EXECUTE t;
+--error 1369
+EXECUTE t;
+--error 1369
+INSERT INTO v2(a1, c) VALUES (3, 3);
+UPDATE v2 SET c=2 WHERE a1=1;
+SELECT * FROM v2;
+SELECT * FROM t1;
+
+DROP VIEW v1,v2;
+DROP TABLE t1,t2,t3,t4;
+
--echo End of 5.0 tests.
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 2bcf5f44c4d..32d3f07fd31 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -262,6 +262,34 @@ void my_parameter_handler(const wchar_t * expression, const wchar_t * function,
}
+#ifdef __MSVC_RUNTIME_CHECKS
+#include <rtcapi.h>
+
+/* Turn off runtime checks for 'handle_rtc_failure' */
+#pragma runtime_checks("", off)
+
+/*
+ handle_rtc_failure
+ Catch the RTC error and dump it to stderr
+*/
+
+int handle_rtc_failure(int err_type, const char *file, int line,
+ const char* module, const char *format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ fprintf(stderr, "Error:");
+ vfprintf(stderr, format, args);
+ fprintf(stderr, " At %s:%d\n", file, line);
+ va_end(args);
+ (void) fflush(stderr);
+
+ return 0; /* Error is handled */
+}
+#pragma runtime_checks("", on)
+#endif
+
+
static void my_win_init(void)
{
HKEY hSoftMysql ;
@@ -292,6 +320,14 @@ static void my_win_init(void)
_set_invalid_parameter_handler(my_parameter_handler);
#endif
#endif
+#ifdef __MSVC_RUNTIME_CHECKS
+ /*
+ Install handler to send RTC (Runtime Error Check) warnings
+ to log file
+ */
+ _RTC_SetErrorFunc(handle_rtc_failure);
+#endif
+
_tzset();
/* apre la chiave HKEY_LOCAL_MACHINES\software\MySQL */
diff --git a/mysys/my_seek.c b/mysys/my_seek.c
index 2be4812a2bd..3d415400aa2 100644
--- a/mysys/my_seek.c
+++ b/mysys/my_seek.c
@@ -23,7 +23,9 @@
my_off_t pos The expected position (absolute or relative)
int whence A direction parameter and one of
{SEEK_SET, SEEK_CUR, SEEK_END}
- myf MyFlags Not used.
+ myf MyFlags MY_THREADSAFE must be set in case my_seek may be mixed
+ with my_pread/my_pwrite calls and fd is shared among
+ threads.
DESCRIPTION
The my_seek function is a wrapper around the system call lseek and
@@ -54,9 +56,16 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
Make sure we are using a valid file descriptor!
*/
DBUG_ASSERT(fd != -1);
-
- newpos= lseek(fd, pos, whence);
-
+#if defined(THREAD) && !defined(HAVE_PREAD)
+ if (MyFlags & MY_THREADSAFE)
+ {
+ pthread_mutex_lock(&my_file_info[fd].mutex);
+ newpos= lseek(fd, pos, whence);
+ pthread_mutex_unlock(&my_file_info[fd].mutex);
+ }
+ else
+#endif
+ newpos= lseek(fd, pos, whence);
if (newpos == (os_off_t) -1)
{
my_errno=errno;
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 07a92e34dd3..cf7ea0a800f 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -87,27 +87,31 @@ my_bool my_thread_global_init(void)
fprintf(stderr,"Can't initialize threads: error %d\n", pth_ret);
return 1;
}
-
-#ifdef NPTL_PTHREAD_EXIT_BUG
-
-/*
- BUG#24507: Race conditions inside current NPTL pthread_exit() implementation.
- To avoid a possible segmentation fault during concurrent executions of
- pthread_exit(), a dummy thread is spawned which initializes internal variables
- of pthread lib. See bug description for thoroughfull explanation.
-
- TODO: Remove this code when fixed versions of glibc6 are in common use.
-*/
+#ifdef NPTL_PTHREAD_EXIT_BUG
+ /*
+ BUG#24507: Race conditions inside current NPTL pthread_exit()
+ implementation.
- pthread_t dummy_thread;
- pthread_attr_t dummy_thread_attr;
+ To avoid a possible segmentation fault during concurrent
+ executions of pthread_exit(), a dummy thread is spawned which
+ initializes internal variables of pthread lib. See bug description
+ for a full explanation.
- pthread_attr_init(&dummy_thread_attr);
- pthread_attr_setdetachstate(&dummy_thread_attr,PTHREAD_CREATE_DETACHED);
+ TODO: Remove this code when fixed versions of glibc6 are in common
+ use.
+ */
+ if (thd_lib_detected == THD_LIB_NPTL)
+ {
+ pthread_t dummy_thread;
+ pthread_attr_t dummy_thread_attr;
- pthread_create(&dummy_thread,&dummy_thread_attr,nptl_pthread_exit_hack_handler,NULL);
+ pthread_attr_init(&dummy_thread_attr);
+ pthread_attr_setdetachstate(&dummy_thread_attr, PTHREAD_CREATE_DETACHED);
+ pthread_create(&dummy_thread,&dummy_thread_attr,
+ nptl_pthread_exit_hack_handler, NULL);
+ }
#endif
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
diff --git a/ndb/include/mgmapi/ndbd_exit_codes.h b/ndb/include/mgmapi/ndbd_exit_codes.h
index 874bf0aa253..1051fd9e394 100644
--- a/ndb/include/mgmapi/ndbd_exit_codes.h
+++ b/ndb/include/mgmapi/ndbd_exit_codes.h
@@ -79,6 +79,8 @@ typedef ndbd_exit_classification_enum ndbd_exit_classification;
#define NDBD_EXIT_NO_MORE_UNDOLOG 2312
#define NDBD_EXIT_SR_UNDOLOG 2313
#define NDBD_EXIT_SINGLE_USER_MODE 2314
+#define NDBD_EXIT_NODE_DECLARED_DEAD 2315
+#define NDBD_EXIT_SR_SCHEMAFILE 2316
#define NDBD_EXIT_MEMALLOC 2327
#define NDBD_EXIT_BLOCK_JBUFCONGESTION 2334
#define NDBD_EXIT_TIME_QUEUE_SHORT 2335
diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp
index f5777cdddb3..9679d3995d3 100644
--- a/ndb/include/ndbapi/NdbRecAttr.hpp
+++ b/ndb/include/ndbapi/NdbRecAttr.hpp
@@ -169,6 +169,13 @@ public:
/**
* Get value stored in NdbRecAttr object.
*
+ * @return Int8 value.
+ */
+ Int8 int8_value() const;
+
+ /**
+ * Get value stored in NdbRecAttr object.
+ *
* @return 64 bit unsigned value.
*/
Uint64 u_64_value() const;
@@ -204,6 +211,13 @@ public:
/**
* Get value stored in NdbRecAttr object.
*
+ * @return Uint8 value.
+ */
+ Uint8 u_8_value() const;
+
+ /**
+ * Get value stored in NdbRecAttr object.
+ *
* @return Float value.
*/
float float_value() const;
@@ -347,6 +361,13 @@ NdbRecAttr::char_value() const
}
inline
+Int8
+NdbRecAttr::int8_value() const
+{
+ return *(Int8*)theRef;
+}
+
+inline
Uint32
NdbRecAttr::u_32_value() const
{
@@ -368,6 +389,13 @@ NdbRecAttr::u_char_value() const
}
inline
+Uint8
+NdbRecAttr::u_8_value() const
+{
+ return *(Uint8*)theRef;
+}
+
+inline
void
NdbRecAttr::release()
{
diff --git a/ndb/src/common/transporter/Packer.cpp b/ndb/src/common/transporter/Packer.cpp
index 66c00b0af89..d471167b0e7 100644
--- a/ndb/src/common/transporter/Packer.cpp
+++ b/ndb/src/common/transporter/Packer.cpp
@@ -20,7 +20,12 @@
#include <TransporterCallback.hpp>
#include <RefConvert.hpp>
+#ifdef ERROR_INSERT
+Uint32 MAX_RECEIVED_SIGNALS = 1024;
+#else
#define MAX_RECEIVED_SIGNALS 1024
+#endif
+
Uint32
TransporterRegistry::unpack(Uint32 * readPtr,
Uint32 sizeOfData,
diff --git a/ndb/src/common/transporter/SCI_Transporter.cpp b/ndb/src/common/transporter/SCI_Transporter.cpp
index 138b79acb51..0720fe84973 100644
--- a/ndb/src/common/transporter/SCI_Transporter.cpp
+++ b/ndb/src/common/transporter/SCI_Transporter.cpp
@@ -65,13 +65,10 @@ SCI_Transporter::SCI_Transporter(TransporterRegistry &t_reg,
m_initLocal=false;
- m_swapCounter=0;
m_failCounter=0;
m_remoteNodes[0]=remoteSciNodeId0;
m_remoteNodes[1]=remoteSciNodeId1;
m_adapters = nAdapters;
- // The maximum number of times to try and create,
- // start and destroy a sequence
m_ActiveAdapterId=0;
m_StandbyAdapterId=1;
@@ -102,8 +99,6 @@ SCI_Transporter::SCI_Transporter(TransporterRegistry &t_reg,
DBUG_VOID_RETURN;
}
-
-
void SCI_Transporter::disconnectImpl()
{
DBUG_ENTER("SCI_Transporter::disconnectImpl");
@@ -129,7 +124,8 @@ void SCI_Transporter::disconnectImpl()
if(err != SCI_ERR_OK) {
report_error(TE_SCI_UNABLE_TO_CLOSE_CHANNEL);
- DBUG_PRINT("error", ("Cannot close channel to the driver. Error code 0x%x",
+ DBUG_PRINT("error",
+ ("Cannot close channel to the driver. Error code 0x%x",
err));
}
}
@@ -164,19 +160,18 @@ bool SCI_Transporter::initTransporter() {
m_sendBuffer.m_buffer = new Uint32[m_sendBuffer.m_sendBufferSize / 4];
m_sendBuffer.m_dataSize = 0;
- DBUG_PRINT("info", ("Created SCI Send Buffer with buffer size %d and packet size %d",
+ DBUG_PRINT("info",
+ ("Created SCI Send Buffer with buffer size %d and packet size %d",
m_sendBuffer.m_sendBufferSize, m_PacketSize * 4));
if(!getLinkStatus(m_ActiveAdapterId) ||
(m_adapters > 1 &&
!getLinkStatus(m_StandbyAdapterId))) {
- DBUG_PRINT("error", ("The link is not fully operational. Check the cables and the switches"));
- //reportDisconnect(remoteNodeId, 0);
- //doDisconnect();
+ DBUG_PRINT("error",
+ ("The link is not fully operational. Check the cables and the switches"));
//NDB should terminate
report_error(TE_SCI_LINK_ERROR);
DBUG_RETURN(false);
}
-
DBUG_RETURN(true);
} // initTransporter()
@@ -235,7 +230,8 @@ sci_error_t SCI_Transporter::initLocalSegment() {
DBUG_PRINT("info", ("SCInode iD %d adapter %d\n",
sciAdapters[i].localSciNodeId, i));
if(err != SCI_ERR_OK) {
- DBUG_PRINT("error", ("Cannot open an SCI virtual device. Error code 0x%x",
+ DBUG_PRINT("error",
+ ("Cannot open an SCI virtual device. Error code 0x%x",
err));
DBUG_RETURN(err);
}
@@ -269,7 +265,8 @@ sci_error_t SCI_Transporter::initLocalSegment() {
&err);
if(err != SCI_ERR_OK) {
- DBUG_PRINT("error", ("Local Segment is not accessible by an SCI adapter. Error code 0x%x\n",
+ DBUG_PRINT("error",
+ ("Local Segment is not accessible by an SCI adapter. Error code 0x%x\n",
err));
DBUG_RETURN(err);
}
@@ -303,15 +300,13 @@ sci_error_t SCI_Transporter::initLocalSegment() {
&err);
if(err != SCI_ERR_OK) {
- DBUG_PRINT("error", ("Local Segment is not available for remote connections. Error code 0x%x\n",
+ DBUG_PRINT("error",
+ ("Local Segment is not available for remote connections. Error code 0x%x\n",
err));
DBUG_RETURN(err);
}
}
-
-
setupLocalSegment();
-
DBUG_RETURN(err);
} // initLocalSegment()
@@ -343,12 +338,6 @@ bool SCI_Transporter::doSend() {
if(sizeToSend==4097)
i4097++;
#endif
- if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) {
- DBUG_PRINT("error", ("Start sequence failed"));
- report_error(TE_SCI_UNABLE_TO_START_SEQUENCE);
- return false;
- }
-
tryagain:
retry++;
@@ -374,119 +363,36 @@ bool SCI_Transporter::doSend() {
SCI_FLAG_ERROR_CHECK,
&err);
-
if (err != SCI_ERR_OK) {
- if(err == SCI_ERR_OUT_OF_RANGE) {
- DBUG_PRINT("error", ("Data transfer : out of range error"));
- goto tryagain;
- }
- if(err == SCI_ERR_SIZE_ALIGNMENT) {
- DBUG_PRINT("error", ("Data transfer : alignment error"));
- DBUG_PRINT("info", ("sendPtr 0x%x, sizeToSend = %d", sendPtr, sizeToSend));
- goto tryagain;
- }
- if(err == SCI_ERR_OFFSET_ALIGNMENT) {
- DBUG_PRINT("error", ("Data transfer : offset alignment"));
- goto tryagain;
- }
- if(err == SCI_ERR_TRANSFER_FAILED) {
- //(m_TargetSegm[m_StandbyAdapterId].writer)->heavyLock();
- if(getLinkStatus(m_ActiveAdapterId)) {
- goto tryagain;
- }
- if (m_adapters == 1) {
- DBUG_PRINT("error", ("SCI Transfer failed"));
+ if (err == SCI_ERR_OUT_OF_RANGE ||
+ err == SCI_ERR_SIZE_ALIGNMENT ||
+ err == SCI_ERR_OFFSET_ALIGNMENT) {
+ DBUG_PRINT("error", ("Data transfer error = %d", err));
report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
return false;
- }
- m_failCounter++;
- Uint32 temp=m_ActiveAdapterId;
- switch(m_swapCounter) {
- case 0:
- /**swap from active (0) to standby (1)*/
- if(getLinkStatus(m_StandbyAdapterId)) {
- DBUG_PRINT("error", ("Swapping from adapter 0 to 1"));
+ }
+ if(err == SCI_ERR_TRANSFER_FAILED) {
+ if(getLinkStatus(m_ActiveAdapterId))
+ goto tryagain;
+ if (m_adapters == 1) {
+ DBUG_PRINT("error", ("SCI Transfer failed"));
+ report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
+ return false;
+ }
+ m_failCounter++;
+ Uint32 temp=m_ActiveAdapterId;
+ if (getLinkStatus(m_StandbyAdapterId)) {
failoverShmWriter();
SCIStoreBarrier(m_TargetSegm[m_StandbyAdapterId].sequence,0);
m_ActiveAdapterId=m_StandbyAdapterId;
m_StandbyAdapterId=temp;
- SCIRemoveSequence((m_TargetSegm[m_StandbyAdapterId].sequence),
- FLAGS,
- &err);
- if(err!=SCI_ERR_OK) {
- report_error(TE_SCI_UNABLE_TO_REMOVE_SEQUENCE);
- DBUG_PRINT("error", ("Unable to remove sequence"));
- return false;
- }
- if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) {
- DBUG_PRINT("error", ("Start sequence failed"));
- report_error(TE_SCI_UNABLE_TO_START_SEQUENCE);
- return false;
- }
- m_swapCounter++;
- DBUG_PRINT("info", ("failover complete"));
- goto tryagain;
- } else {
- report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
- DBUG_PRINT("error", ("SCI Transfer failed"));
- return false;
- }
- return false;
- break;
- case 1:
- /** swap back from 1 to 0
- must check that the link is up */
-
- if(getLinkStatus(m_StandbyAdapterId)) {
- failoverShmWriter();
- m_ActiveAdapterId=m_StandbyAdapterId;
- m_StandbyAdapterId=temp;
- DBUG_PRINT("info", ("Swapping from 1 to 0"));
- if(createSequence(m_ActiveAdapterId)!=SCI_ERR_OK) {
- DBUG_PRINT("error", ("Unable to create sequence"));
- report_error(TE_SCI_UNABLE_TO_CREATE_SEQUENCE);
- return false;
- }
- if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) {
- DBUG_PRINT("error", ("startSequence failed... disconnecting"));
- report_error(TE_SCI_UNABLE_TO_START_SEQUENCE);
- return false;
- }
-
- SCIRemoveSequence((m_TargetSegm[m_StandbyAdapterId].sequence)
- , FLAGS,
- &err);
- if(err!=SCI_ERR_OK) {
- DBUG_PRINT("error", ("Unable to remove sequence"));
- report_error(TE_SCI_UNABLE_TO_REMOVE_SEQUENCE);
- return false;
- }
-
- if(createSequence(m_StandbyAdapterId)!=SCI_ERR_OK) {
- DBUG_PRINT("error", ("Unable to create sequence on standby"));
- report_error(TE_SCI_UNABLE_TO_CREATE_SEQUENCE);
- return false;
- }
-
- m_swapCounter=0;
-
- DBUG_PRINT("info", ("failover complete.."));
- goto tryagain;
-
+ DBUG_PRINT("error", ("Swapping from adapter %u to %u",
+ m_StandbyAdapterId, m_ActiveAdapterId));
} else {
- DBUG_PRINT("error", ("Unrecoverable data transfer error"));
report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
- return false;
+ DBUG_PRINT("error", ("SCI Transfer failed"));
}
-
- break;
- default:
- DBUG_PRINT("error", ("Unrecoverable data transfer error"));
- report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
- return false;
- break;
- }
- }
+ }
} else {
SHM_Writer * writer = (m_TargetSegm[m_ActiveAdapterId].writer);
writer->updateWritePtr(sizeToSend);
@@ -497,7 +403,6 @@ bool SCI_Transporter::doSend() {
m_sendBuffer.m_dataSize = 0;
m_sendBuffer.m_forceSendLimit = sendLimit;
}
-
} else {
/**
* If we end up here, the SCI segment is full.
@@ -552,15 +457,12 @@ void SCI_Transporter::setupLocalSegment()
DBUG_VOID_RETURN;
} //setupLocalSegment
-
-
void SCI_Transporter::setupRemoteSegment()
{
DBUG_ENTER("SCI_Transporter::setupRemoteSegment");
Uint32 sharedSize = 0;
sharedSize =4096; //start of the buffer is page aligned
-
Uint32 sizeOfBuffer = m_BufferSize;
const Uint32 slack = MAX_MESSAGE_SIZE;
sizeOfBuffer -= sharedSize;
@@ -666,7 +568,6 @@ SCI_Transporter::init_remote()
DBUG_PRINT("error", ("Error connecting segment, err 0x%x", err));
DBUG_RETURN(false);
}
-
}
// Map the remote memory segment into program space
for(Uint32 i=0; i < m_adapters ; i++) {
@@ -679,13 +580,14 @@ SCI_Transporter::init_remote()
FLAGS,
&err);
-
- if(err!= SCI_ERR_OK) {
- DBUG_PRINT("error", ("Cannot map a segment to the remote node %d. Error code 0x%x",m_RemoteSciNodeId, err));
- //NDB SHOULD TERMINATE AND COMPUTER REBOOTED!
- report_error(TE_SCI_CANNOT_MAP_REMOTESEGMENT);
- DBUG_RETURN(false);
- }
+ if(err!= SCI_ERR_OK) {
+ DBUG_PRINT("error",
+ ("Cannot map a segment to the remote node %d. Error code 0x%x",
+ m_RemoteSciNodeId, err));
+ //NDB SHOULD TERMINATE AND COMPUTER REBOOTED!
+ report_error(TE_SCI_CANNOT_MAP_REMOTESEGMENT);
+ DBUG_RETURN(false);
+ }
}
m_mapped=true;
setupRemoteSegment();
@@ -713,7 +615,6 @@ SCI_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd)
NDB_CLOSE_SOCKET(sockfd);
DBUG_RETURN(false);
}
-
if (!init_local()) {
NDB_CLOSE_SOCKET(sockfd);
DBUG_RETURN(false);
@@ -788,29 +689,9 @@ sci_error_t SCI_Transporter::createSequence(Uint32 adapterid) {
&(m_TargetSegm[adapterid].sequence),
SCI_FLAG_FAST_BARRIER,
&err);
-
-
return err;
} // createSequence()
-
-sci_error_t SCI_Transporter::startSequence(Uint32 adapterid) {
-
- sci_error_t err;
- /** Perform preliminary error check on an SCI adapter before starting a
- * sequence of read and write operations on the mapped segment.
- */
- m_SequenceStatus = SCIStartSequence(
- (m_TargetSegm[adapterid].sequence),
- FLAGS, &err);
-
-
- // If there still is an error then data cannot be safely send
- return err;
-} // startSequence()
-
-
-
bool SCI_Transporter::disconnectLocal()
{
DBUG_ENTER("SCI_Transporter::disconnectLocal");
@@ -878,9 +759,6 @@ SCI_Transporter::~SCI_Transporter() {
DBUG_VOID_RETURN;
} // ~SCI_Transporter()
-
-
-
void SCI_Transporter::closeSCI() {
// Termination of SCI
sci_error_t err;
@@ -897,8 +775,9 @@ void SCI_Transporter::closeSCI() {
SCIClose(activeSCIDescriptor, FLAGS, &err);
if(err != SCI_ERR_OK) {
- DBUG_PRINT("error", ("Cannot close SCI channel to the driver. Error code 0x%x",
- err));
+ DBUG_PRINT("error",
+ ("Cannot close SCI channel to the driver. Error code 0x%x",
+ err));
}
SCITerminate();
DBUG_VOID_RETURN;
@@ -973,7 +852,6 @@ SCI_Transporter::getConnectionStatus() {
return false;
}
-
void
SCI_Transporter::setConnected() {
*m_remoteStatusFlag = SCICONNECTED;
@@ -983,7 +861,6 @@ SCI_Transporter::setConnected() {
*m_localStatusFlag = SCICONNECTED;
}
-
void
SCI_Transporter::setDisconnect() {
if(getLinkStatus(m_ActiveAdapterId))
@@ -994,7 +871,6 @@ SCI_Transporter::setDisconnect() {
}
}
-
bool
SCI_Transporter::checkConnected() {
if (*m_localStatusFlag == SCIDISCONNECT) {
@@ -1015,8 +891,9 @@ SCI_Transporter::initSCI() {
SCIInitialize(0, &error);
if(error != SCI_ERR_OK) {
DBUG_PRINT("error", ("Cannot initialize SISCI library."));
- DBUG_PRINT("error", ("Inconsistency between SISCI library and SISCI driver. Error code 0x%x",
- error));
+ DBUG_PRINT("error",
+ ("Inconsistency between SISCI library and SISCI driver. Error code 0x%x",
+ error));
DBUG_RETURN(false);
}
init = true;
@@ -1029,3 +906,4 @@ SCI_Transporter::get_free_buffer() const
{
return (m_TargetSegm[m_ActiveAdapterId].writer)->get_free_buffer();
}
+
diff --git a/ndb/src/common/transporter/SCI_Transporter.hpp b/ndb/src/common/transporter/SCI_Transporter.hpp
index fbba2ac4516..f774186f238 100644
--- a/ndb/src/common/transporter/SCI_Transporter.hpp
+++ b/ndb/src/common/transporter/SCI_Transporter.hpp
@@ -54,12 +54,12 @@
* local segment, the SCI transporter connects to a segment created by another
* transporter at a remote node, and the maps the remote segment into its
* virtual address space. However, since NDB Cluster relies on redundancy
- * at the network level, by using dual SCI adapters communica
- *
+ * at the network level, by using dual SCI adapters communication can be
+ * maintained even if one of the adapter cards fails (or anything on the
+ * network this adapter card exists in e.g. an SCI switch failure).
*
*/
-
/**
* class SCITransporter
* @brief - main class for the SCI transporter.
@@ -84,16 +84,6 @@ public:
sci_error_t createSequence(Uint32 adapterid);
- /**
- * starts a sequence for error checking.
- * The actual checking that a sequence is correct is done implicitly
- * in SCIMemCpy (in doSend).
- * @param adapterid the adapter on which to start the sequence.
- * @return SCI_ERR_OK if ok, otherwize something else.
- */
- sci_error_t startSequence(Uint32 adapterid);
-
-
/** Initiate Local Segment: create a memory segment,
* prepare a memory segment, map the local segment
* into memory space and make segment available.
@@ -159,7 +149,6 @@ private:
bool m_mapped;
bool m_initLocal;
bool m_sciinit;
- Uint32 m_swapCounter;
Uint32 m_failCounter;
/**
* For statistics on transfered packets
@@ -195,7 +184,6 @@ private:
*/
Uint32 m_reportFreq;
-
Uint32 m_adapters;
Uint32 m_numberOfRemoteNodes;
diff --git a/ndb/src/common/transporter/TCP_Transporter.hpp b/ndb/src/common/transporter/TCP_Transporter.hpp
index 4e0de15bdbe..7b6fd0b2323 100644
--- a/ndb/src/common/transporter/TCP_Transporter.hpp
+++ b/ndb/src/common/transporter/TCP_Transporter.hpp
@@ -102,6 +102,10 @@ private:
virtual void updateReceiveDataPtr(Uint32 bytesRead);
virtual Uint32 get_free_buffer() const;
+
+ inline bool hasReceiveData () const {
+ return receiveBuffer.sizeOfData > 0;
+ }
protected:
/**
* Setup client/server and perform connect/accept
diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp
index bd2ff0d3062..55b31becd8f 100644
--- a/ndb/src/common/transporter/TransporterRegistry.cpp
+++ b/ndb/src/common/transporter/TransporterRegistry.cpp
@@ -841,28 +841,13 @@ TransporterRegistry::poll_OSE(Uint32 timeOutMillis)
Uint32
TransporterRegistry::poll_TCP(Uint32 timeOutMillis)
{
+ bool hasdata = false;
if (false && nTCPTransporters == 0)
{
tcpReadSelectReply = 0;
return 0;
}
- struct timeval timeout;
-#ifdef NDB_OSE
- // Return directly if there are no TCP transporters configured
-
- if(timeOutMillis <= 1){
- timeout.tv_sec = 0;
- timeout.tv_usec = 1025;
- } else {
- timeout.tv_sec = timeOutMillis / 1000;
- timeout.tv_usec = (timeOutMillis % 1000) * 1000;
- }
-#else
- timeout.tv_sec = timeOutMillis / 1000;
- timeout.tv_usec = (timeOutMillis % 1000) * 1000;
-#endif
-
NDB_SOCKET_TYPE maxSocketValue = -1;
// Needed for TCP/IP connections
@@ -885,8 +870,27 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis)
// Put the connected transporters in the socket read-set
FD_SET(socket, &tcpReadset);
}
+ hasdata |= t->hasReceiveData();
}
+ timeOutMillis = hasdata ? 0 : timeOutMillis;
+
+ struct timeval timeout;
+#ifdef NDB_OSE
+ // Return directly if there are no TCP transporters configured
+
+ if(timeOutMillis <= 1){
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 1025;
+ } else {
+ timeout.tv_sec = timeOutMillis / 1000;
+ timeout.tv_usec = (timeOutMillis % 1000) * 1000;
+ }
+#else
+ timeout.tv_sec = timeOutMillis / 1000;
+ timeout.tv_usec = (timeOutMillis % 1000) * 1000;
+#endif
+
// The highest socket value plus one
maxSocketValue++;
@@ -901,7 +905,7 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis)
}
#endif
- return tcpReadSelectReply;
+ return tcpReadSelectReply || hasdata;
}
#endif
@@ -937,26 +941,26 @@ TransporterRegistry::performReceive()
#endif
#ifdef NDB_TCP_TRANSPORTER
- if(tcpReadSelectReply > 0)
+ for (int i=0; i<nTCPTransporters; i++)
{
- for (int i=0; i<nTCPTransporters; i++)
- {
- checkJobBuffer();
- TCP_Transporter *t = theTCPTransporters[i];
- const NodeId nodeId = t->getRemoteNodeId();
- const NDB_SOCKET_TYPE socket = t->getSocket();
- if(is_connected(nodeId)){
- if(t->isConnected() && FD_ISSET(socket, &tcpReadset))
+ checkJobBuffer();
+ TCP_Transporter *t = theTCPTransporters[i];
+ const NodeId nodeId = t->getRemoteNodeId();
+ const NDB_SOCKET_TYPE socket = t->getSocket();
+ if(is_connected(nodeId)){
+ if(t->isConnected())
+ {
+ if (FD_ISSET(socket, &tcpReadset))
{
- const int receiveSize = t->doReceive();
- if(receiveSize > 0)
- {
- Uint32 * ptr;
- Uint32 sz = t->getReceiveData(&ptr);
- transporter_recv_from(callbackObj, nodeId);
- Uint32 szUsed = unpack(ptr, sz, nodeId, ioStates[nodeId]);
- t->updateReceiveDataPtr(szUsed);
- }
+ t->doReceive();
+ }
+
+ if (t->hasReceiveData())
+ {
+ Uint32 * ptr;
+ Uint32 sz = t->getReceiveData(&ptr);
+ Uint32 szUsed = unpack(ptr, sz, nodeId, ioStates[nodeId]);
+ t->updateReceiveDataPtr(szUsed);
}
}
}
diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
index 9579700663b..1b5e7a27a0c 100644
--- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
+++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
@@ -132,6 +132,7 @@ Cmvmi::~Cmvmi()
#ifdef ERROR_INSERT
NodeBitmask c_error_9000_nodes_mask;
+extern Uint32 MAX_RECEIVED_SIGNALS;
#endif
void Cmvmi::execNDB_TAMPER(Signal* signal)
@@ -161,6 +162,22 @@ void Cmvmi::execNDB_TAMPER(Signal* signal)
kill(getpid(), SIGABRT);
}
#endif
+
+#ifdef ERROR_INSERT
+ if (signal->theData[0] == 9003)
+ {
+ if (MAX_RECEIVED_SIGNALS < 1024)
+ {
+ MAX_RECEIVED_SIGNALS = 1024;
+ }
+ else
+ {
+ MAX_RECEIVED_SIGNALS = 1 + (rand() % 128);
+ }
+ ndbout_c("MAX_RECEIVED_SIGNALS: %d", MAX_RECEIVED_SIGNALS);
+ CLEAR_ERROR_INSERT_VALUE;
+ }
+#endif
}//execNDB_TAMPER()
void Cmvmi::execSET_LOGLEVELORD(Signal* signal)
diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
index a039c1bdbe7..d86f32dc8d1 100644
--- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
@@ -79,6 +79,9 @@
#include <NdbSleep.h>
#include <signaldata/ApiBroadcast.hpp>
+#include <EventLogger.hpp>
+extern EventLogger g_eventLogger;
+
#define ZNOT_FOUND 626
#define ZALREADYEXIST 630
@@ -1069,17 +1072,36 @@ void Dbdict::readSchemaConf(Signal* signal,
for (Uint32 n = 0; n < xsf->noOfPages; n++) {
SchemaFile * sf = &xsf->schemaPage[n];
- bool ok =
- memcmp(sf->Magic, NDB_SF_MAGIC, sizeof(sf->Magic)) == 0 &&
- sf->FileSize != 0 &&
- sf->FileSize % NDB_SF_PAGE_SIZE == 0 &&
- sf->FileSize == sf0->FileSize &&
- sf->PageNumber == n &&
- computeChecksum((Uint32*)sf, NDB_SF_PAGE_SIZE_IN_WORDS) == 0;
- ndbrequire(ok || !crashInd);
- if (! ok) {
+ bool ok = false;
+ const char *reason;
+ if (memcmp(sf->Magic, NDB_SF_MAGIC, sizeof(sf->Magic)) != 0)
+ { jam(); reason = "magic code"; }
+ else if (sf->FileSize == 0)
+ { jam(); reason = "file size == 0"; }
+ else if (sf->FileSize % NDB_SF_PAGE_SIZE != 0)
+ { jam(); reason = "invalid size multiple"; }
+ else if (sf->FileSize != sf0->FileSize)
+ { jam(); reason = "invalid size"; }
+ else if (sf->PageNumber != n)
+ { jam(); reason = "invalid page number"; }
+ else if (computeChecksum((Uint32*)sf, NDB_SF_PAGE_SIZE_IN_WORDS) != 0)
+ { jam(); reason = "invalid checksum"; }
+ else
+ ok = true;
+
+ if (!ok)
+ {
+ char reason_msg[128];
+ snprintf(reason_msg, sizeof(reason_msg),
+ "schema file corrupt, page %u (%s, "
+ "sz=%u sz0=%u pn=%u)",
+ n, reason, sf->FileSize, sf0->FileSize, sf->PageNumber);
+ if (crashInd)
+ progError(__LINE__, NDBD_EXIT_SR_SCHEMAFILE, reason_msg);
+ ndbrequireErr(fsPtr.p->fsState == FsConnectRecord::READ_SCHEMA1,
+ NDBD_EXIT_SR_SCHEMAFILE);
jam();
- ndbrequire(fsPtr.p->fsState == FsConnectRecord::READ_SCHEMA1);
+ infoEvent("primary %s, trying backup", reason_msg);
readSchemaRef(signal, fsPtr);
return;
}
diff --git a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
index 00367a7aa9d..4474d226a27 100644
--- a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
+++ b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
@@ -2059,6 +2059,9 @@ public:
Uint8 simpleRead;
Uint8 seqNoReplica;
Uint8 tcNodeFailrec;
+#ifdef VM_TRACE
+ Uint8 tupkeyref;
+#endif
}; /* p2c: size = 280 bytes */
typedef Ptr<TcConnectionrec> TcConnectionrecPtr;
diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
index 9944adf4ede..684598364ab 100644
--- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
+++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
@@ -2765,6 +2765,12 @@ void Dblqh::execTUPKEYREF(Signal* signal)
tcConnectptr.i = tupKeyRef->userRef;
terrorCode = tupKeyRef->errorCode;
ptrCheckGuard(tcConnectptr, ctcConnectrecFileSize, tcConnectionrec);
+
+#ifdef VM_TRACE
+ ndbrequire(tcConnectptr.p->tupkeyref == 0);
+ tcConnectptr.p->tupkeyref = 1;
+#endif
+
switch (tcConnectptr.p->transactionState) {
case TcConnectionrec::WAIT_TUP:
jam();
@@ -3330,6 +3336,10 @@ void Dblqh::seizeTcrec()
locTcConnectptr.p->tcTimer = cLqhTimeOutCount;
locTcConnectptr.p->tableref = RNIL;
locTcConnectptr.p->savePointId = 0;
+#ifdef VM_TRACE
+ locTcConnectptr.p->tupkeyref = 1;
+#endif
+
cfirstfreeTcConrec = nextTc;
tcConnectptr = locTcConnectptr;
locTcConnectptr.p->connectState = TcConnectionrec::CONNECTED;
@@ -4049,6 +4059,9 @@ void Dblqh::execACCKEYCONF(Signal* signal)
tupKeyReq->tcOpIndex = tcConnectptr.p->tcOprec;
tupKeyReq->savePointId = tcConnectptr.p->savePointId;
+#ifdef VM_TRACE
+ tcConnectptr.p->tupkeyref = 0;
+#endif
EXECUTE_DIRECT(tup, GSN_TUPKEYREQ, signal, TupKeyReq::SignalLength);
}//Dblqh::execACCKEYCONF()
@@ -5860,6 +5873,10 @@ void Dblqh::completeUnusualLab(Signal* signal)
void Dblqh::releaseTcrec(Signal* signal, TcConnectionrecPtr locTcConnectptr)
{
jam();
+#ifdef VM_TRACE
+ locTcConnectptr.p->tupkeyref = 1;
+#endif
+
locTcConnectptr.p->tcTimer = 0;
locTcConnectptr.p->transactionState = TcConnectionrec::TC_NOT_CONNECTED;
locTcConnectptr.p->nextTcConnectrec = cfirstfreeTcConrec;
@@ -5882,6 +5899,9 @@ void Dblqh::releaseTcrec(Signal* signal, TcConnectionrecPtr locTcConnectptr)
void Dblqh::releaseTcrecLog(Signal* signal, TcConnectionrecPtr locTcConnectptr)
{
jam();
+#ifdef VM_TRACE
+ locTcConnectptr.p->tupkeyref = 1;
+#endif
locTcConnectptr.p->tcTimer = 0;
locTcConnectptr.p->transactionState = TcConnectionrec::TC_NOT_CONNECTED;
locTcConnectptr.p->nextTcConnectrec = cfirstfreeTcConrec;
@@ -8336,8 +8356,11 @@ void Dblqh::nextScanConfLoopLab(Signal* signal)
tupKeyReq->tcOpIndex = tcConnectptr.p->tcOprec;
tupKeyReq->savePointId = tcConnectptr.p->savePointId;
Uint32 blockNo = refToBlock(tcConnectptr.p->tcTupBlockref);
+#ifdef VM_TRACE
+ tcConnectptr.p->tupkeyref = 0;
+#endif
EXECUTE_DIRECT(blockNo, GSN_TUPKEYREQ, signal,
- TupKeyReq::SignalLength);
+ TupKeyReq::SignalLength);
}
}
@@ -9455,6 +9478,9 @@ void Dblqh::copySendTupkeyReqLab(Signal* signal)
tupKeyReq->tcOpIndex = tcConnectptr.p->tcOprec;
tupKeyReq->savePointId = tcConnectptr.p->savePointId;
Uint32 blockNo = refToBlock(tcConnectptr.p->tcTupBlockref);
+#ifdef VM_TRACE
+ tcConnectptr.p->tupkeyref = 0;
+#endif
EXECUTE_DIRECT(blockNo, GSN_TUPKEYREQ, signal,
TupKeyReq::SignalLength);
}
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
index 72ef9a274ec..28f3b987e7b 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
@@ -1138,7 +1138,11 @@ Dbtup::updateStartLab(Signal* signal,
regOperPtr->attrinbufLen);
} else {
jam();
- retValue = interpreterStartLab(signal, pagePtr, regOperPtr->pageOffset);
+ if (interpreterStartLab(signal, pagePtr, regOperPtr->pageOffset) == -1)
+ {
+ jam();
+ return -1;
+ }
}//if
if (retValue == -1) {
diff --git a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
index a0a19620a05..a76838f7007 100644
--- a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
+++ b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
@@ -2816,7 +2816,7 @@ void Qmgr::failReportLab(Signal* signal, Uint16 aFailedNode,
if (failedNodePtr.i == getOwnNodeId()) {
jam();
- Uint32 code = 0;
+ Uint32 code = NDBD_EXIT_NODE_DECLARED_DEAD;
const char * msg = 0;
char extra[100];
switch(aFailCause){
diff --git a/ndb/src/kernel/error/TimeModule.cpp b/ndb/src/kernel/error/TimeModule.cpp
index 1c01f91f86b..2be734842ba 100644
--- a/ndb/src/kernel/error/TimeModule.cpp
+++ b/ndb/src/kernel/error/TimeModule.cpp
@@ -18,7 +18,7 @@
#include <ndb_global.h>
#include "TimeModule.hpp"
-static const char* cMonth[] = { "x", "January", "February", "Mars", "April", "May", "June",
+static const char* cMonth[] = { "x", "January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"};
static const char* cDay[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
diff --git a/ndb/src/kernel/error/ndbd_exit_codes.c b/ndb/src/kernel/error/ndbd_exit_codes.c
index 37a54e33350..92bee522d24 100644
--- a/ndb/src/kernel/error/ndbd_exit_codes.c
+++ b/ndb/src/kernel/error/ndbd_exit_codes.c
@@ -57,12 +57,15 @@ static const ErrStruct errArray[] =
"error(s) on other node(s)"},
{NDBD_EXIT_PARTITIONED_SHUTDOWN, XAE, "Partitioned cluster detected. "
"Please check if cluster is already running"},
+ {NDBD_EXIT_NODE_DECLARED_DEAD, XAE,
+ "Node declared dead. See error log for details"},
{NDBD_EXIT_POINTER_NOTINRANGE, XIE, "Pointer too large"},
{NDBD_EXIT_SR_OTHERNODEFAILED, XRE, "Another node failed during system "
"restart, please investigate error(s) on other node(s)"},
{NDBD_EXIT_NODE_NOT_DEAD, XRE, "Internal node state conflict, "
"most probably resolved by restarting node again"},
{NDBD_EXIT_SR_REDOLOG, XFI, "Error while reading the REDO log"},
+ {NDBD_EXIT_SR_SCHEMAFILE, XFI, "Error while reading the schema file"},
/* Currently unused? */
{2311, XIE, "Conflict when selecting restart type"},
{NDBD_EXIT_NO_MORE_UNDOLOG, XCR,
diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp
index 3d7eb5bd4f1..409694fead1 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -627,6 +627,16 @@ MgmtSrvr::start(BaseString &error_string)
ndbout_c("This is probably a bug.");
}
+ /*
+ set api reg req frequency quite high:
+
+ 100 ms interval to make sure we have fairly up-to-date
+ info from the nodes. This to make sure that this info
+ is not dependent on heart beat settings in the
+ configuration
+ */
+ theFacade->theClusterMgr->set_max_api_reg_req_interval(100);
+
TransporterRegistry *reg = theFacade->get_registry();
for(unsigned int i=0;i<reg->m_transporter_interface.size();i++) {
BaseString msg;
diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp
index 7ab3ee07197..d3946dddfb7 100644
--- a/ndb/src/ndbapi/ClusterMgr.cpp
+++ b/ndb/src/ndbapi/ClusterMgr.cpp
@@ -68,6 +68,7 @@ ClusterMgr::ClusterMgr(TransporterFacade & _facade):
clusterMgrThreadMutex = NdbMutex_Create();
waitForHBCond= NdbCondition_Create();
waitingForHB= false;
+ m_max_api_reg_req_interval= 0xFFFFFFFF; // MAX_INT
noOfAliveNodes= 0;
noOfConnectedNodes= 0;
theClusterMgrThread= 0;
@@ -251,7 +252,7 @@ ClusterMgr::threadMain( ){
* Start of Secure area for use of Transporter
*/
theFacade.lock_mutex();
- for (int i = 1; i < MAX_NODES; i++){
+ for (int i = 1; i < MAX_NDB_NODES; i++){
/**
* Send register request (heartbeat) to all available nodes
* at specified timing intervals
@@ -272,7 +273,8 @@ ClusterMgr::threadMain( ){
}
theNode.hbCounter += timeSlept;
- if (theNode.hbCounter >= theNode.hbFrequency) {
+ if (theNode.hbCounter >= m_max_api_reg_req_interval ||
+ theNode.hbCounter >= theNode.hbFrequency) {
/**
* It is now time to send a new Heartbeat
*/
@@ -281,13 +283,6 @@ ClusterMgr::threadMain( ){
theNode.hbCounter = 0;
}
- /**
- * If the node is of type REP,
- * then the receiver of the signal should be API_CLUSTERMGR
- */
- if (theNode.m_info.m_type == NodeInfo::REP) {
- signal.theReceiversBlockNumber = API_CLUSTERMGR;
- }
#ifdef DEBUG_REG
ndbout_c("ClusterMgr: Sending API_REGREQ to node %d", (int)nodeId);
#endif
diff --git a/ndb/src/ndbapi/ClusterMgr.hpp b/ndb/src/ndbapi/ClusterMgr.hpp
index f5d84fee01d..467b18f2330 100644
--- a/ndb/src/ndbapi/ClusterMgr.hpp
+++ b/ndb/src/ndbapi/ClusterMgr.hpp
@@ -50,6 +50,7 @@ public:
void startThread();
void forceHB();
+ void set_max_api_reg_req_interval(unsigned int millisec) { m_max_api_reg_req_interval = millisec; }
private:
void threadMain();
@@ -83,6 +84,7 @@ public:
Uint32 m_connect_count;
private:
+ Uint32 m_max_api_reg_req_interval;
Uint32 noOfAliveNodes;
Uint32 noOfConnectedNodes;
Node theNodes[MAX_NODES];
diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp
index 996c0256baa..8de163d1c22 100644
--- a/ndb/src/ndbapi/NdbRecAttr.cpp
+++ b/ndb/src/ndbapi/NdbRecAttr.cpp
@@ -272,7 +272,7 @@ ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r,
out << r.u_short_value();
break;
case NdbDictionary::Column::Tinyunsigned:
- out << (unsigned) r.u_char_value();
+ out << (unsigned) r.u_8_value();
break;
case NdbDictionary::Column::Bigint:
out << r.int64_value();
@@ -287,7 +287,7 @@ ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r,
out << r.short_value();
break;
case NdbDictionary::Column::Tinyint:
- out << (int) r.char_value();
+ out << (int) r.int8_value();
break;
case NdbDictionary::Column::Binary:
if (!f.hex_format)
@@ -413,7 +413,7 @@ ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r,
break;
case NdbDictionary::Column::Year:
{
- uint year = 1900 + r.u_char_value();
+ uint year = 1900 + r.u_8_value();
char buf[40];
sprintf(buf, "%04d", year);
out << buf;
diff --git a/ndb/test/ndbapi/testNdbApi.cpp b/ndb/test/ndbapi/testNdbApi.cpp
index aee668039fe..ec510c8b270 100644
--- a/ndb/test/ndbapi/testNdbApi.cpp
+++ b/ndb/test/ndbapi/testNdbApi.cpp
@@ -1306,6 +1306,36 @@ int runTestExecuteAsynch(NDBT_Context* ctx, NDBT_Step* step){
template class Vector<NdbScanOperation*>;
+int
+runBug28443(NDBT_Context* ctx, NDBT_Step* step)
+{
+ int result = NDBT_OK;
+ int records = ctx->getNumRecords();
+
+ NdbRestarter restarter;
+
+ restarter.insertErrorInAllNodes(9003);
+
+ for (Uint32 i = 0; i<ctx->getNumLoops(); i++)
+ {
+ HugoTransactions hugoTrans(*ctx->getTab());
+ if (hugoTrans.loadTable(GETNDB(step), records, 2048) != 0)
+ {
+ result = NDBT_FAILED;
+ goto done;
+ }
+ if (runClearTable(ctx, step) != 0)
+ {
+ result = NDBT_FAILED;
+ goto done;
+ }
+ }
+
+done:
+ restarter.insertErrorInAllNodes(9003);
+
+ return result;
+}
NDBT_TESTSUITE(testNdbApi);
TESTCASE("MaxNdb",
@@ -1396,6 +1426,10 @@ TESTCASE("ExecuteAsynch",
"Check that executeAsync() works (BUG#27495)\n"){
INITIALIZER(runTestExecuteAsynch);
}
+TESTCASE("Bug28443",
+ ""){
+ INITIALIZER(runBug28443);
+}
NDBT_TESTSUITE_END(testNdbApi);
int main(int argc, const char** argv){
diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt
index e1a69d923cb..c40c96209f4 100644
--- a/ndb/test/run-test/daily-basic-tests.txt
+++ b/ndb/test/run-test/daily-basic-tests.txt
@@ -629,6 +629,10 @@ max-time: 500
cmd: testNdbApi
args: -n ExecuteAsynch T1
+max-time: 1000
+cmd: testNdbApi
+args: -n BugBug28443
+
#max-time: 500
#cmd: testInterpreter
#args: T1
diff --git a/netware/Makefile.am b/netware/Makefile.am
index c83a5b389ab..3ec9c7794bf 100644
--- a/netware/Makefile.am
+++ b/netware/Makefile.am
@@ -90,20 +90,20 @@ EXTRA_DIST= $(BUILT_SOURCES) comp_err.def install_test_db.ncf \
# Build init_db.sql from the files that contain
# the system tables for this version of MySQL plus any commands
init_db.sql: $(top_srcdir)/scripts/mysql_system_tables.sql \
- $(top_srcdir)/scripts/mysql_system_tables_data.sql
+ $(top_srcdir)/scripts/mysql_system_tables_data.sql
@echo "Building $@";
@echo "CREATE DATABASE mysql;" > $@;
@echo "CREATE DATABASE test;" >> $@;
@echo "use mysql;" >> $@;
@cat $(top_srcdir)/scripts/mysql_system_tables.sql \
- $(top_srcdir)/scripts/mysql_system_tables_fix.sql >> $@;
+ $(top_srcdir)/scripts/mysql_system_tables_fix.sql >> $@;
# Build test_db.sql from init_db.sql plus
# some test data
test_db.sql: init_db.sql $(top_srcdir)/scripts/mysql_test_data_timezone.sql
@echo "Building $@";
@cat init_db.sql \
- $(top_srcdir)/scripts/mysql_test_data_timezone.sql >> $@;
+ $(top_srcdir)/scripts/mysql_test_data_timezone.sql >> $@;
endif
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 79f4666f855..d4944962884 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -16,9 +16,9 @@
## Process this file with automake to create Makefile.in
BUILT_SOURCES = mysql_fix_privilege_tables.sql \
- mysql_fix_privilege_tables_sql.c
+ mysql_fix_privilege_tables_sql.c
-noinst_PROGRAMS = comp_sql
+EXTRA_PROGRAMS = comp_sql
bin_SCRIPTS = @server_scripts@ \
msql2mysql \
@@ -70,6 +70,7 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \
mysqlaccess.conf \
mysqlbug \
make_win_bin_dist \
+ mysql_fix_privilege_tables_sql.c \
mysql_system_tables_fix.sql \
CMakeLists.txt
@@ -98,13 +99,11 @@ CLEANFILES = @server_scripts@ \
mysql_tableinfo \
mysql_upgrade_shell \
mysqld_multi \
- make_win_src_distribution \
- mysql_fix_privilege_tables.sql \
- mysql_fix_privilege_tables_sql.c
+ make_win_src_distribution
# mysqlbug should be distributed built so that people can report build
# failures with it.
-DISTCLEANFILES = mysqlbug
+DISTCLEANFILES = $(BUILT_SOURCES) mysqlbug
# We want the right version and configure comand line in mysqlbug
mysqlbug: ${top_builddir}/config.status mysqlbug.sh
@@ -120,11 +119,14 @@ mysql_fix_privilege_tables.sql: mysql_system_tables.sql \
#
# Build mysql_fix_privilege_tables_sql.c from
# mysql_fix_privileges_tables.sql using comp_sql
+# The "sleep" ensures the generated file has a younger timestamp than its source
+# (which may have been generated in this very same "make" run).
#
mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql
$(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT)
+ sleep 2
$(top_builddir)/scripts/comp_sql$(EXEEXT) \
- mysql_fix_privilege_tables \
+ mysql_fix_privilege_tables \
$(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index e8bf39bd016..77f51c51c19 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -102,11 +102,41 @@ case $system in
;;
esac
+# This is needed to prefer GNU tar over platform tar because that can't
+# always handle long filenames
+
+PATH_DIRS=`echo $PATH | \
+ sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' `
+
+which_1 ()
+{
+ for cmd
+ do
+ for d in $PATH_DIRS
+ do
+ for file in $d/$cmd
+ do
+ if [ -x $file -a ! -d $file ] ; then
+ echo $file
+ exit 0
+ fi
+ done
+ done
+ done
+ exit 1
+}
+
+tar=`which_1 gnutar gtar`
+if [ "$?" = "1" -o x"$tar" = x"" ] ; then
+ tar=tar
+fi
+
mkdir $BASE $BASE/bin $BASE/docs \
$BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \
$BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \
- $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib
+ $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib \
+ $BASE/mysql-test/suite
if [ $BASE_SYSTEM != "netware" ] ; then
mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \
@@ -117,8 +147,8 @@ fi
# Copy files if they exists, warn for those that don't.
# Note that when listing files to copy, we might list the file name
-# twice, once in the directory location where it is build, and a
-# second time in the ".libs" location. In the case the firs one
+# twice, once in the directory location where it is built, and a
+# second time in the ".libs" location. In the case the first one
# is a wrapper script, the second one will overwrite it with the
# binary file.
copyfileto()
@@ -274,6 +304,13 @@ $CP mysql-test/t/*.test mysql-test/t/*.imtest \
$CP mysql-test/r/*.result mysql-test/r/*.require \
$BASE/mysql-test/r
+# Copy the additional suites "as is", they are in flux
+$tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - )
+# Clean up if we did this from a bk tree
+if [ -d mysql-test/SCCS ] ; then
+ find $BASE/mysql-test -name SCCS -print | xargs rm -rf
+fi
+
if [ $BASE_SYSTEM != "netware" ] ; then
chmod a+x $BASE/bin/*
copyfileto $BASE/bin scripts/*
@@ -374,41 +411,12 @@ if [ x$DEBUG = x1 ] ; then
exit
fi
-# This is needed to prefere gnu tar instead of tar because tar can't
-# always handle long filenames
-
-PATH_DIRS=`echo $PATH | \
- sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' `
-
-which_1 ()
-{
- for cmd
- do
- for d in $PATH_DIRS
- do
- for file in $d/$cmd
- do
- if [ -x $file -a ! -d $file ] ; then
- echo $file
- exit 0
- fi
- done
- done
- done
- exit 1
-}
-
if [ $BASE_SYSTEM != "netware" ] ; then
#
# Create the result tar file
#
- tar=`which_1 gnutar gtar`
- if [ "$?" = "1" -o x"$tar" = x"" ] ; then
- tar=tar
- fi
-
echo "Using $tar to create archive"
OPT=cvf
diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist
index 87d35a0850b..30127b0043f 100755
--- a/scripts/make_win_bin_dist
+++ b/scripts/make_win_bin_dist
@@ -39,7 +39,7 @@ The "package-base-name" argument should be something like
mysql-noinstall-5.0.25-win32 (or winx64)
-and will be the name of the directory of the unpacked ZIP (stripping
+and will become the name of the directory of the unpacked ZIP (stripping
away the "noinstall" part of the ZIP file name if any) and the base
for the resulting package name.
@@ -51,6 +51,7 @@ Options are
--no-embedded Don't pack the embedded server even if built
--debug Pack the debug binaries and give error if not built.
+ The default is to pack them if they are built.
--no-debug Don't pack the debug binaries even if built
@@ -58,10 +59,10 @@ Options are
want to replace the normal binaries with debug
versions, i.e. no separate "debug" directories.
- --exe-suffix=SUF Add a suffix to the "mysqld" binary.
+ --exe-suffix=SUF Add a suffix to the filename part of the "mysqld" binary.
As you might want to include files of directories from other builds
-(like a "mysqld-max.exe" server), you can instruct this script do copy
+(like a "mysqld-max.exe" server), you can instruct this script to copy
them in for you. This is the "copy-def" arguments, and they are of the
form
@@ -172,10 +173,10 @@ else
BASENAME="mysqld" # New style CMake build
fi
-if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/$BASENAME.exe" -o \
- x"$PACK_DEBUG" = "yes" ] ; then
+if [ x"$PACK_DEBUG" = x"" -a -f "sql/debug/$BASENAME.exe" -o \
+ x"$PACK_DEBUG" = x"yes" ] ; then
cp sql/debug/$BASENAME.exe $DESTDIR/bin/mysqld-debug.exe
- cp sql/debug/$BASENAME.pdb $DESTDIR/bin/mysqld-debug.pdb
+ cp sql/debug/$BASENAME.pdb $DESTDIR/bin/mysqld-debug.pdb || true
cp sql/debug/$BASENAME.map $DESTDIR/bin/mysqld-debug.map || true
fi
@@ -221,8 +222,8 @@ copy_embedded()
cp libmysqld/$TARGET/libmysqld.exp $DESTDIR/Embedded/DLL/release/
cp libmysqld/$TARGET/libmysqld.lib $DESTDIR/Embedded/DLL/release/
- if [ x"$PACK_DEBUG" = "" -a -f "libmysqld/debug/libmysqld.lib" -o \
- x"$PACK_DEBUG" = "yes" ] ; then
+ if [ x"$PACK_DEBUG" = x"" -a -f "libmysqld/debug/libmysqld.lib" -o \
+ x"$PACK_DEBUG" = x"yes" ] ; then
mkdir -p $DESTDIR/Embedded/DLL/debug
cp libmysqld/debug/libmysqld.dll $DESTDIR/Embedded/DLL/debug/
cp libmysqld/debug/libmysqld.exp $DESTDIR/Embedded/DLL/debug/
@@ -230,10 +231,10 @@ copy_embedded()
fi
}
-if [ x"$PACK_EMBEDDED" = "" -a \
+if [ x"$PACK_EMBEDDED" = x"" -a \
-f "libmysqld/$TARGET/mysqlserver.lib" -a \
-f "libmysqld/$TARGET/libmysqld.lib" -o \
- x"$PACK_EMBEDDED" = "yes" ] ; then
+ x"$PACK_EMBEDDED" = x"yes" ] ; then
copy_embedded
fi
@@ -271,8 +272,8 @@ cp libmysql/$TARGET/libmysql.dll \
strings/$TARGET/strings.lib \
zlib/$TARGET/zlib.lib $DESTDIR/lib/opt/
-if [ x"$PACK_DEBUG" = "" -a -f "libmysql/debug/libmysql.lib" -o \
- x"$PACK_DEBUG" = "yes" ] ; then
+if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \
+ x"$PACK_DEBUG" = x"yes" ] ; then
mkdir -p $DESTDIR/lib/debug
cp libmysql/debug/libmysql.dll \
libmysql/debug/libmysql.lib \
@@ -329,12 +330,11 @@ fi
# ----------------------------------------------------------------------
# Copy what could be usable in the "scripts" directory. Currently
-# only SQL files, others are bourne shell scripts or Perl scripts
+# only SQL files, others are Bourne shell scripts or Perl scripts
# not really usable on Windows.
#
# But to be nice to the few Cygwin users we might have in 5.0 we
-# continue to copy the stuff, but don't include it include it in
-# the WiX install.
+# continue to copy the stuff, but don't include it in the WiX install.
# ----------------------------------------------------------------------
mkdir -p $DESTDIR/scripts
@@ -360,7 +360,7 @@ fi
cp -pR sql-bench $DESTDIR/
rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile*
-# The SQL initiation code is really expected to be in "share"
+# The SQL initialisation code is really expected to be in "share"
mv $DESTDIR/scripts/*.sql $DESTDIR/share/ || true
# ----------------------------------------------------------------------
@@ -381,7 +381,7 @@ for arg do
done
# ----------------------------------------------------------------------
-# Finally creat the ZIP archive
+# Finally create the ZIP archive
# ----------------------------------------------------------------------
rm -f $NOINST_NAME.zip
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index 205bc93efea..c8334339b32 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -9,6 +9,7 @@
# this sql script.
# On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
+set sql_mode='';
set storage_engine=MyISAM;
ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
diff --git a/server-tools/instance-manager/mysql_connection.cc b/server-tools/instance-manager/mysql_connection.cc
index 3e1694e24ee..2b377d60ad0 100644
--- a/server-tools/instance-manager/mysql_connection.cc
+++ b/server-tools/instance-manager/mysql_connection.cc
@@ -112,8 +112,8 @@ C_MODE_START
void my_net_local_init(NET *net)
{
net->max_packet= net_buffer_length;
- net->read_timeout= net_read_timeout;
- net->write_timeout= net_write_timeout;
+ my_net_set_read_timeout(net, (uint)net_read_timeout);
+ my_net_set_write_timeout(net, (uint)net_write_timeout);
net->retry_count= net_retry_count;
net->max_packet_size= max_allowed_packet;
}
diff --git a/sql-common/client.c b/sql-common/client.c
index 3342db4bcfe..3e5ceb1a738 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -416,7 +416,7 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
shared_memory_base_name is unique value for each server
unique_part is uniquel value for each object (events and file-mapping)
*/
- suffix_pos = strxmov(tmp,shared_memory_base_name,"_",NullS);
+ suffix_pos = strxmov(tmp, "Global\\", shared_memory_base_name, "_", NullS);
strmov(suffix_pos, "CONNECT_REQUEST");
if (!(event_connect_request= OpenEvent(event_access_rights, FALSE, tmp)))
{
@@ -470,8 +470,8 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
unique_part is uniquel value for each object (events and file-mapping)
number_of_connection is number of connection between server and client
*/
- suffix_pos = strxmov(tmp,shared_memory_base_name,"_",connect_number_char,
- "_",NullS);
+ suffix_pos = strxmov(tmp, "Global\\", shared_memory_base_name, "_", connect_number_char,
+ "_", NullS);
strmov(suffix_pos, "DATA");
if ((handle_file_map = OpenFileMapping(FILE_MAP_WRITE,FALSE,tmp)) == NULL)
{
@@ -2047,13 +2047,11 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
/* If user set read_timeout, let it override the default */
if (mysql->options.read_timeout)
- net->read_timeout= mysql->options.read_timeout;
- vio_timeout(net->vio, 0, net->read_timeout);
+ my_net_set_read_timeout(net, mysql->options.read_timeout);
/* If user set write_timeout, let it override the default */
if (mysql->options.write_timeout)
- net->write_timeout= mysql->options.write_timeout;
- vio_timeout(net->vio, 1, net->write_timeout);
+ my_net_set_write_timeout(net, mysql->options.write_timeout);
if (mysql->options.max_allowed_packet)
net->max_packet_size= mysql->options.max_allowed_packet;
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index 4032c273e35..f5d5828e024 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -727,7 +727,39 @@ void init_time(void)
}
- /* Calculate nr of day since year 0 in new date-system (from 1615) */
+/*
+ Handle 2 digit year conversions
+
+ SYNOPSIS
+ year_2000_handling()
+ year 2 digit year
+
+ RETURN
+ Year between 1970-2069
+*/
+
+uint year_2000_handling(uint year)
+{
+ if ((year=year+1900) < 1900+YY_PART_YEAR)
+ year+=100;
+ return year;
+}
+
+
+/*
+ Calculate nr of day since year 0 in new date-system (from 1615)
+
+ SYNOPSIS
+ calc_daynr()
+ year Year (exact 4 digit year, no year conversions)
+ month Month
+ day Day
+
+ NOTES: 0000-00-00 is a valid date, and will return 0
+
+ RETURN
+ Days since 0000-00-00
+*/
long calc_daynr(uint year,uint month,uint day)
{
@@ -1120,6 +1152,7 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res,
ok:
part1=(long) (nr/LL(1000000));
part2=(long) (nr - (longlong) part1*LL(1000000));
+ bzero((char*) time_res, sizeof(*time_res));
time_res->year= (int) (part1/10000L); part1%=10000L;
time_res->month= (int) part1 / 100;
time_res->day= (int) part1 % 100;
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index e77b4c5765e..1f02e3afc67 100755
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -86,7 +86,7 @@ TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg mysys yassl zlib dbug yassl
taocrypt strings vio regex wsock32)
IF(EMBED_MANIFESTS)
- MYSQL_EMBED_MANIFEST("mysqld" "requireAdministrator")
+ MYSQL_EMBED_MANIFEST("mysqld" "asInvoker")
ENDIF(EMBED_MANIFESTS)
IF(WITH_EXAMPLE_STORAGE_ENGINE)
diff --git a/sql/field.cc b/sql/field.cc
index b2def4ca8d2..83c17c43ee4 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1550,7 +1550,7 @@ uint Field::fill_cache_field(CACHE_FIELD *copy)
}
-bool Field::get_date(TIME *ltime,uint fuzzydate)
+bool Field::get_date(MYSQL_TIME *ltime,uint fuzzydate)
{
char buff[40];
String tmp(buff,sizeof(buff),&my_charset_bin),*res;
@@ -1561,7 +1561,7 @@ bool Field::get_date(TIME *ltime,uint fuzzydate)
return 0;
}
-bool Field::get_time(TIME *ltime)
+bool Field::get_time(MYSQL_TIME *ltime)
{
char buff[40];
String tmp(buff,sizeof(buff),&my_charset_bin),*res;
@@ -1578,7 +1578,7 @@ bool Field::get_time(TIME *ltime)
Needs to be changed if/when we want to support different time formats
*/
-int Field::store_time(TIME *ltime, timestamp_type type_arg)
+int Field::store_time(MYSQL_TIME *ltime, timestamp_type type_arg)
{
char buff[MAX_DATE_STRING_REP_LENGTH];
uint length= (uint) my_TIME_to_str(ltime, buff);
@@ -2504,7 +2504,7 @@ int Field_new_decimal::store_decimal(const my_decimal *decimal_value)
}
-int Field_new_decimal::store_time(TIME *ltime, timestamp_type t_type)
+int Field_new_decimal::store_time(MYSQL_TIME *ltime, timestamp_type t_type)
{
my_decimal decimal_value;
return store_value(date2my_decimal(ltime, &decimal_value));
@@ -3675,56 +3675,9 @@ int Field_float::store(const char *from,uint len,CHARSET_INFO *cs)
int Field_float::store(double nr)
{
- float j;
- int error= 0;
+ int error= truncate(&nr, FLT_MAX);
+ float j= (float)nr;
- if (isnan(nr))
- {
- j= 0;
- set_null();
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- else if (unsigned_flag && nr < 0)
- {
- j= 0;
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- else
- {
- double max_value;
- if (dec >= NOT_FIXED_DEC)
- {
- max_value= FLT_MAX;
- }
- else
- {
- uint tmp=min(field_length,array_elements(log_10)-1);
- max_value= (log_10[tmp]-1)/log_10[dec];
- /*
- The following comparison is needed to not get an overflow if nr
- is close to FLT_MAX
- */
- if (fabs(nr) < FLT_MAX/10.0e+32)
- nr= floor(nr*log_10[dec]+0.5)/log_10[dec];
- }
- if (nr < -max_value)
- {
- j= (float)-max_value;
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- else if (nr > max_value)
- {
- j= (float)max_value;
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- else
- j= (float) nr;
- }
-
#ifdef WORDS_BIGENDIAN
if (table->s->db_low_byte_first)
{
@@ -3963,48 +3916,7 @@ int Field_double::store(const char *from,uint len,CHARSET_INFO *cs)
int Field_double::store(double nr)
{
- int error= 0;
-
- if (isnan(nr))
- {
- nr= 0;
- set_null();
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- else if (unsigned_flag && nr < 0)
- {
- nr= 0;
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- else
- {
- double max_value;
- if (not_fixed)
- {
- max_value= DBL_MAX;
- }
- else
- {
- uint tmp=min(field_length,array_elements(log_10)-1);
- max_value= (log_10[tmp]-1)/log_10[dec];
- if (fabs(nr) < DBL_MAX/10.0e+32)
- nr= floor(nr*log_10[dec]+0.5)/log_10[dec];
- }
- if (nr < -max_value)
- {
- nr= -max_value;
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- else if (nr > max_value)
- {
- nr= max_value;
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- }
+ int error= truncate(&nr, DBL_MAX);
#ifdef WORDS_BIGENDIAN
if (table->s->db_low_byte_first)
@@ -4023,6 +3935,63 @@ int Field_double::store(longlong nr, bool unsigned_val)
return store(unsigned_val ? ulonglong2double((ulonglong) nr) : (double) nr);
}
+/*
+ If a field has fixed length, truncate the double argument pointed to by 'nr'
+ appropriately.
+ Also ensure that the argument is within [-max_value; max_value] range.
+*/
+
+int Field_real::truncate(double *nr, double max_value)
+{
+ int error= 1;
+ double res= *nr;
+
+ if (isnan(res))
+ {
+ res= 0;
+ set_null();
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
+ goto end;
+ }
+ else if (unsigned_flag && res < 0)
+ {
+ res= 0;
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
+ goto end;
+ }
+
+ if (!not_fixed)
+ {
+ uint order= field_length - dec;
+ uint step= array_elements(log_10) - 1;
+ max_value= 1.0;
+ for (; order > step; order-= step)
+ max_value*= log_10[step];
+ max_value*= log_10[order];
+ max_value-= 1.0 / log_10[dec];
+
+ double tmp= rint((res - floor(res)) * log_10[dec]) / log_10[dec];
+ res= floor(res) + tmp;
+ }
+
+ if (res < -max_value)
+ {
+ res= -max_value;
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
+ }
+ else if (res > max_value)
+ {
+ res= max_value;
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
+ }
+ else
+ error= 0;
+
+end:
+ *nr= res;
+ return error;
+}
+
int Field_real::store_decimal(const my_decimal *dm)
{
@@ -4359,7 +4328,8 @@ timestamp_auto_set_type Field_timestamp::get_auto_set_type() const
int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs)
{
- TIME l_time;
+
+ MYSQL_TIME l_time;
my_time_t tmp= 0;
int error;
bool have_smth_to_conv;
@@ -4429,7 +4399,7 @@ int Field_timestamp::store(double nr)
int Field_timestamp::store(longlong nr, bool unsigned_val)
{
- TIME l_time;
+ MYSQL_TIME l_time;
my_time_t timestamp= 0;
int error;
my_bool in_dst_time_gap;
@@ -4486,7 +4456,7 @@ double Field_timestamp::val_real(void)
longlong Field_timestamp::val_int(void)
{
uint32 temp;
- TIME time_tmp;
+ MYSQL_TIME time_tmp;
THD *thd= table ? table->in_use : current_thd;
#ifdef WORDS_BIGENDIAN
@@ -4511,7 +4481,7 @@ longlong Field_timestamp::val_int(void)
String *Field_timestamp::val_str(String *val_buffer, String *val_ptr)
{
uint32 temp, temp2;
- TIME time_tmp;
+ MYSQL_TIME time_tmp;
THD *thd= table ? table->in_use : current_thd;
char *to;
@@ -4580,7 +4550,7 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr)
}
-bool Field_timestamp::get_date(TIME *ltime, uint fuzzydate)
+bool Field_timestamp::get_date(MYSQL_TIME *ltime, uint fuzzydate)
{
long temp;
THD *thd= table ? table->in_use : current_thd;
@@ -4604,7 +4574,7 @@ bool Field_timestamp::get_date(TIME *ltime, uint fuzzydate)
return 0;
}
-bool Field_timestamp::get_time(TIME *ltime)
+bool Field_timestamp::get_time(MYSQL_TIME *ltime)
{
return Field_timestamp::get_date(ltime,0);
}
@@ -4612,7 +4582,7 @@ bool Field_timestamp::get_time(TIME *ltime)
bool Field_timestamp::send_binary(Protocol *protocol)
{
- TIME tm;
+ MYSQL_TIME tm;
Field_timestamp::get_date(&tm, 0);
return protocol->store(&tm);
}
@@ -4688,7 +4658,7 @@ void Field_timestamp::set_time()
int Field_time::store(const char *from,uint len,CHARSET_INFO *cs)
{
- TIME ltime;
+ MYSQL_TIME ltime;
long tmp;
int error= 0;
int warning;
@@ -4703,9 +4673,12 @@ int Field_time::store(const char *from,uint len,CHARSET_INFO *cs)
else
{
if (warning & MYSQL_TIME_WARN_TRUNCATED)
- set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
+ {
+ set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
WARN_DATA_TRUNCATED,
from, len, MYSQL_TIMESTAMP_TIME, 1);
+ error= 1;
+ }
if (warning & MYSQL_TIME_WARN_OUT_OF_RANGE)
{
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -4716,8 +4689,6 @@ int Field_time::store(const char *from,uint len,CHARSET_INFO *cs)
if (ltime.month)
ltime.day=0;
tmp=(ltime.day*24L+ltime.hour)*10000L+(ltime.minute*100+ltime.second);
- if (error > 1)
- error= 2;
}
if (ltime.neg)
@@ -4727,7 +4698,7 @@ int Field_time::store(const char *from,uint len,CHARSET_INFO *cs)
}
-int Field_time::store_time(TIME *ltime, timestamp_type time_type)
+int Field_time::store_time(MYSQL_TIME *ltime, timestamp_type time_type)
{
long tmp= ((ltime->month ? 0 : ltime->day * 24L) + ltime->hour) * 10000L +
(ltime->minute * 100 + ltime->second);
@@ -4831,7 +4802,7 @@ longlong Field_time::val_int(void)
String *Field_time::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- TIME ltime;
+ MYSQL_TIME ltime;
val_buffer->alloc(19);
long tmp=(long) sint3korr(ptr);
ltime.neg= 0;
@@ -4855,7 +4826,7 @@ String *Field_time::val_str(String *val_buffer,
DATE_FORMAT(time, "%l.%i %p")
*/
-bool Field_time::get_date(TIME *ltime, uint fuzzydate)
+bool Field_time::get_date(MYSQL_TIME *ltime, uint fuzzydate)
{
long tmp;
THD *thd= table ? table->in_use : current_thd;
@@ -4883,7 +4854,7 @@ bool Field_time::get_date(TIME *ltime, uint fuzzydate)
}
-bool Field_time::get_time(TIME *ltime)
+bool Field_time::get_time(MYSQL_TIME *ltime)
{
long tmp=(long) sint3korr(ptr);
ltime->neg=0;
@@ -4905,7 +4876,7 @@ bool Field_time::get_time(TIME *ltime)
bool Field_time::send_binary(Protocol *protocol)
{
- TIME tm;
+ MYSQL_TIME tm;
Field_time::get_time(&tm);
tm.day= tm.hour/24; // Move hours to days
tm.hour-= tm.day*24;
@@ -5058,7 +5029,7 @@ void Field_year::sql_type(String &res) const
int Field_date::store(const char *from, uint len,CHARSET_INFO *cs)
{
- TIME l_time;
+ MYSQL_TIME l_time;
uint32 tmp;
int error;
THD *thd= table ? table->in_use : current_thd;
@@ -5114,7 +5085,7 @@ int Field_date::store(double nr)
int Field_date::store(longlong nr, bool unsigned_val)
{
- TIME not_used;
+ MYSQL_TIME not_used;
int error;
longlong initial_nr= nr;
THD *thd= table ? table->in_use : current_thd;
@@ -5155,7 +5126,7 @@ int Field_date::store(longlong nr, bool unsigned_val)
bool Field_date::send_binary(Protocol *protocol)
{
longlong tmp= Field_date::val_int();
- TIME tm;
+ MYSQL_TIME tm;
tm.year= (uint32) tmp/10000L % 10000;
tm.month= (uint32) tmp/100 % 100;
tm.day= (uint32) tmp % 100;
@@ -5192,7 +5163,7 @@ longlong Field_date::val_int(void)
String *Field_date::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- TIME ltime;
+ MYSQL_TIME ltime;
val_buffer->alloc(field_length);
int32 tmp;
#ifdef WORDS_BIGENDIAN
@@ -5261,9 +5232,26 @@ void Field_date::sql_type(String &res) const
** In number context: YYYYMMDD
****************************************************************************/
+/*
+ Store string into a date field
+
+ SYNOPSIS
+ Field_newdate::store()
+ from Date string
+ len Length of date field
+ cs Character set (not used)
+
+ RETURN
+ 0 ok
+ 1 Value was cut during conversion
+ 2 Wrong date string
+ 3 Datetime value that was cut (warning level NOTE)
+*/
+
int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs)
{
- TIME l_time;
+ long tmp;
+ MYSQL_TIME l_time;
int error;
THD *thd= table ? table->in_use : current_thd;
enum enum_mysql_timestamp_type ret;
@@ -5274,20 +5262,23 @@ int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs)
MODE_INVALID_DATES))),
&error)) <= MYSQL_TIMESTAMP_ERROR)
{
- int3store(ptr,0L);
+ tmp= 0;
error= 2;
}
else
{
- int3store(ptr, l_time.day + l_time.month*32 + l_time.year*16*32);
- if(!error && (ret != MYSQL_TIMESTAMP_DATE))
- return 2;
+ tmp= l_time.day + l_time.month*32 + l_time.year*16*32;
+ if (!error && (ret != MYSQL_TIMESTAMP_DATE))
+ error= 3; // Datetime was cut (note)
}
if (error)
- set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED,
+ set_datetime_warning(error == 3 ? MYSQL_ERROR::WARN_LEVEL_NOTE :
+ MYSQL_ERROR::WARN_LEVEL_WARN,
+ WARN_DATA_TRUNCATED,
from, len, MYSQL_TIMESTAMP_DATE, 1);
+ int3store(ptr, tmp);
return error;
}
@@ -5307,7 +5298,7 @@ int Field_newdate::store(double nr)
int Field_newdate::store(longlong nr, bool unsigned_val)
{
- TIME l_time;
+ MYSQL_TIME l_time;
longlong tmp;
int error;
THD *thd= table ? table->in_use : current_thd;
@@ -5334,7 +5325,7 @@ int Field_newdate::store(longlong nr, bool unsigned_val)
}
-int Field_newdate::store_time(TIME *ltime, timestamp_type time_type)
+int Field_newdate::store_time(MYSQL_TIME *ltime, timestamp_type time_type)
{
long tmp;
int error= 0;
@@ -5368,7 +5359,7 @@ int Field_newdate::store_time(TIME *ltime, timestamp_type time_type)
bool Field_newdate::send_binary(Protocol *protocol)
{
- TIME tm;
+ MYSQL_TIME tm;
Field_newdate::get_date(&tm,0);
return protocol->store_date(&tm);
}
@@ -5416,7 +5407,7 @@ String *Field_newdate::val_str(String *val_buffer,
}
-bool Field_newdate::get_date(TIME *ltime,uint fuzzydate)
+bool Field_newdate::get_date(MYSQL_TIME *ltime,uint fuzzydate)
{
uint32 tmp=(uint32) uint3korr(ptr);
ltime->day= tmp & 31;
@@ -5429,7 +5420,7 @@ bool Field_newdate::get_date(TIME *ltime,uint fuzzydate)
}
-bool Field_newdate::get_time(TIME *ltime)
+bool Field_newdate::get_time(MYSQL_TIME *ltime)
{
return Field_newdate::get_date(ltime,0);
}
@@ -5467,7 +5458,7 @@ void Field_newdate::sql_type(String &res) const
int Field_datetime::store(const char *from,uint len,CHARSET_INFO *cs)
{
- TIME time_tmp;
+ MYSQL_TIME time_tmp;
int error;
ulonglong tmp= 0;
enum enum_mysql_timestamp_type func_res;
@@ -5519,7 +5510,7 @@ int Field_datetime::store(double nr)
int Field_datetime::store(longlong nr, bool unsigned_val)
{
- TIME not_used;
+ MYSQL_TIME not_used;
int error;
longlong initial_nr= nr;
THD *thd= table ? table->in_use : current_thd;
@@ -5554,12 +5545,12 @@ int Field_datetime::store(longlong nr, bool unsigned_val)
}
-int Field_datetime::store_time(TIME *ltime,timestamp_type time_type)
+int Field_datetime::store_time(MYSQL_TIME *ltime,timestamp_type time_type)
{
longlong tmp;
int error= 0;
/*
- We don't perform range checking here since values stored in TIME
+ We don't perform range checking here since values stored in MYSQL_TIME
structure always fit into DATETIME range.
*/
if (time_type == MYSQL_TIMESTAMP_DATE ||
@@ -5599,7 +5590,7 @@ int Field_datetime::store_time(TIME *ltime,timestamp_type time_type)
bool Field_datetime::send_binary(Protocol *protocol)
{
- TIME tm;
+ MYSQL_TIME tm;
Field_datetime::get_date(&tm, TIME_FUZZY_DATE);
return protocol->store(&tm);
}
@@ -5671,7 +5662,7 @@ String *Field_datetime::val_str(String *val_buffer,
return val_buffer;
}
-bool Field_datetime::get_date(TIME *ltime, uint fuzzydate)
+bool Field_datetime::get_date(MYSQL_TIME *ltime, uint fuzzydate)
{
longlong tmp=Field_datetime::val_int();
uint32 part1,part2;
@@ -5690,7 +5681,7 @@ bool Field_datetime::get_date(TIME *ltime, uint fuzzydate)
return (!(fuzzydate & TIME_FUZZY_DATE) && (!ltime->month || !ltime->day)) ? 1 : 0;
}
-bool Field_datetime::get_time(TIME *ltime)
+bool Field_datetime::get_time(MYSQL_TIME *ltime)
{
return Field_datetime::get_date(ltime,0);
}
@@ -7621,6 +7612,8 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
tmp=0;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
}
+ if (!table->in_use->count_cuted_fields)
+ err= 0;
}
else
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
@@ -8426,8 +8419,7 @@ bool create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
case FIELD_TYPE_NULL:
break;
case FIELD_TYPE_NEWDECIMAL:
- if (!fld_length && !decimals)
- length= 10;
+ my_decimal_trim(&length, &decimals);
if (length > DECIMAL_MAX_PRECISION)
{
my_error(ER_TOO_BIG_PRECISION, MYF(0), length, fld_name,
@@ -9060,10 +9052,13 @@ uint32 Field_blob::max_display_length()
NOTE
This function won't produce warning and increase cut fields counter
- if count_cuted_fields == FIELD_CHECK_IGNORE for current thread.
+ if count_cuted_fields == CHECK_FIELD_IGNORE for current thread.
+
+ if count_cuted_fields == CHECK_FIELD_IGNORE then we ignore notes.
+ This allows us to avoid notes in optimisation, like convert_constant_item().
RETURN VALUE
- 1 if count_cuted_fields == FIELD_CHECK_IGNORE
+ 1 if count_cuted_fields == CHECK_FIELD_IGNORE and error level is not NOTE
0 otherwise
*/
@@ -9083,7 +9078,7 @@ Field::set_warning(MYSQL_ERROR::enum_warning_level level, uint code,
thd->row_count);
return 0;
}
- return 1;
+ return level >= MYSQL_ERROR::WARN_LEVEL_WARN;
}
@@ -9111,9 +9106,10 @@ Field::set_datetime_warning(MYSQL_ERROR::enum_warning_level level, uint code,
timestamp_type ts_type, int cuted_increment)
{
THD *thd= table ? table->in_use : current_thd;
- if (thd->really_abort_on_warning() ||
+ if ((thd->really_abort_on_warning() &&
+ level >= MYSQL_ERROR::WARN_LEVEL_WARN) ||
set_warning(level, code, cuted_increment))
- make_truncated_value_warning(thd, str, str_length, ts_type,
+ make_truncated_value_warning(thd, level, str, str_length, ts_type,
field_name);
}
@@ -9146,7 +9142,7 @@ Field::set_datetime_warning(MYSQL_ERROR::enum_warning_level level, uint code,
{
char str_nr[22];
char *str_end= longlong10_to_str(nr, str_nr, -10);
- make_truncated_value_warning(thd, str_nr, (uint) (str_end - str_nr),
+ make_truncated_value_warning(thd, level, str_nr, (uint) (str_end - str_nr),
ts_type, field_name);
}
}
@@ -9179,7 +9175,7 @@ Field::set_datetime_warning(MYSQL_ERROR::enum_warning_level level, uint code,
/* DBL_DIG is enough to print '-[digits].E+###' */
char str_nr[DBL_DIG + 8];
uint str_len= my_sprintf(str_nr, (str_nr, "%g", nr));
- make_truncated_value_warning(thd, str_nr, str_len, ts_type,
+ make_truncated_value_warning(thd, level, str_nr, str_len, ts_type,
field_name);
}
}
diff --git a/sql/field.h b/sql/field.h
index 47f61c1fe8b..46efb150205 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -98,7 +98,7 @@ public:
virtual int store(double nr)=0;
virtual int store(longlong nr, bool unsigned_val)=0;
virtual int store_decimal(const my_decimal *d)=0;
- virtual int store_time(TIME *ltime, timestamp_type t_type);
+ virtual int store_time(MYSQL_TIME *ltime, timestamp_type t_type);
virtual double val_real(void)=0;
virtual longlong val_int(void)=0;
virtual my_decimal *val_decimal(my_decimal *);
@@ -326,8 +326,8 @@ public:
uint offset(); // Should be inline ...
void copy_from_tmp(int offset);
uint fill_cache_field(struct st_cache_field *copy);
- virtual bool get_date(TIME *ltime,uint fuzzydate);
- virtual bool get_time(TIME *ltime);
+ virtual bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ virtual bool get_time(MYSQL_TIME *ltime);
virtual CHARSET_INFO *charset(void) const { return &my_charset_bin; }
virtual CHARSET_INFO *sort_charset(void) const { return charset(); }
virtual bool has_charset(void) const { return FALSE; }
@@ -453,6 +453,7 @@ public:
/* base class for float and double and decimal (old one) */
class Field_real :public Field_num {
public:
+ my_bool not_fixed;
Field_real(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, utype unireg_check_arg,
@@ -460,13 +461,16 @@ public:
struct st_table *table_arg,
uint8 dec_arg, bool zero_arg, bool unsigned_arg)
:Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
- field_name_arg, table_arg, dec_arg, zero_arg, unsigned_arg)
+ field_name_arg, table_arg, dec_arg, zero_arg, unsigned_arg),
+ not_fixed(dec_arg >= NOT_FIXED_DEC)
{}
int store_decimal(const my_decimal *);
my_decimal *val_decimal(my_decimal *);
+ int truncate(double *nr, double max_length);
uint32 max_display_length() { return field_length; }
+ uint size_of() const { return sizeof(*this); }
};
@@ -529,7 +533,7 @@ public:
int store(const char *to, uint length, CHARSET_INFO *charset);
int store(double nr);
int store(longlong nr, bool unsigned_val);
- int store_time(TIME *ltime, timestamp_type t_type);
+ int store_time(MYSQL_TIME *ltime, timestamp_type t_type);
int store_decimal(const my_decimal *);
double val_real(void);
longlong val_int(void);
@@ -675,7 +679,7 @@ public:
void sort_string(char *buff,uint length);
uint32 pack_length() const { return 4; }
void sql_type(String &str) const;
- uint32 max_display_length() { return 11; }
+ uint32 max_display_length() { return MY_INT32_NUM_DECIMAL_DIGITS; }
};
@@ -758,7 +762,6 @@ public:
class Field_double :public Field_real {
public:
- my_bool not_fixed;
Field_double(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
@@ -766,21 +769,18 @@ public:
uint8 dec_arg,bool zero_arg,bool unsigned_arg)
:Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, table_arg,
- dec_arg, zero_arg, unsigned_arg),
- not_fixed(dec_arg >= NOT_FIXED_DEC)
+ dec_arg, zero_arg, unsigned_arg)
{}
Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
struct st_table *table_arg, uint8 dec_arg)
:Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
- NONE, field_name_arg, table_arg, dec_arg, 0, 0),
- not_fixed(dec_arg >= NOT_FIXED_DEC)
+ NONE, field_name_arg, table_arg, dec_arg, 0, 0)
{}
Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
- struct st_table *table_arg, uint8 dec_arg, my_bool not_fixed_srg)
+ struct st_table *table_arg, uint8 dec_arg, my_bool not_fixed_arg)
:Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
- NONE, field_name_arg, table_arg, dec_arg, 0, 0),
- not_fixed(not_fixed_srg)
- {}
+ NONE, field_name_arg, table_arg, dec_arg, 0, 0)
+ {not_fixed= not_fixed_arg; }
enum_field_types type() const { return FIELD_TYPE_DOUBLE;}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; }
int store(const char *to,uint length,CHARSET_INFO *charset);
@@ -795,7 +795,6 @@ public:
void sort_string(char *buff,uint length);
uint32 pack_length() const { return sizeof(double); }
void sql_type(String &str) const;
- uint size_of() const { return sizeof(*this); }
};
@@ -879,8 +878,8 @@ public:
longget(tmp,ptr);
return tmp;
}
- bool get_date(TIME *ltime,uint fuzzydate);
- bool get_time(TIME *ltime);
+ bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_time(MYSQL_TIME *ltime);
timestamp_auto_set_type get_auto_set_type() const;
};
@@ -953,7 +952,7 @@ public:
int store(const char *to,uint length,CHARSET_INFO *charset);
int store(double nr);
int store(longlong nr, bool unsigned_val);
- int store_time(TIME *ltime, timestamp_type type);
+ int store_time(MYSQL_TIME *ltime, timestamp_type type);
int reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return 0; }
double val_real(void);
longlong val_int(void);
@@ -965,8 +964,8 @@ public:
void sql_type(String &str) const;
bool can_be_compared_as_longlong() const { return TRUE; }
bool zero_pack() const { return 1; }
- bool get_date(TIME *ltime,uint fuzzydate);
- bool get_time(TIME *ltime);
+ bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_time(MYSQL_TIME *ltime);
};
@@ -985,7 +984,7 @@ public:
enum_field_types type() const { return FIELD_TYPE_TIME;}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_INT24; }
enum Item_result cmp_type () const { return INT_RESULT; }
- int store_time(TIME *ltime, timestamp_type type);
+ int store_time(MYSQL_TIME *ltime, timestamp_type type);
int store(const char *to,uint length,CHARSET_INFO *charset);
int store(double nr);
int store(longlong nr, bool unsigned_val);
@@ -993,9 +992,9 @@ public:
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
- bool get_date(TIME *ltime, uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
bool send_binary(Protocol *protocol);
- bool get_time(TIME *ltime);
+ bool get_time(MYSQL_TIME *ltime);
int cmp(const char *,const char*);
void sort_string(char *buff,uint length);
uint32 pack_length() const { return 3; }
@@ -1026,7 +1025,7 @@ public:
int store(const char *to,uint length,CHARSET_INFO *charset);
int store(double nr);
int store(longlong nr, bool unsigned_val);
- int store_time(TIME *ltime, timestamp_type type);
+ int store_time(MYSQL_TIME *ltime, timestamp_type type);
int reset(void)
{
ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0;
@@ -1042,8 +1041,8 @@ public:
void sql_type(String &str) const;
bool can_be_compared_as_longlong() const { return TRUE; }
bool zero_pack() const { return 1; }
- bool get_date(TIME *ltime,uint fuzzydate);
- bool get_time(TIME *ltime);
+ bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_time(MYSQL_TIME *ltime);
};
@@ -1108,6 +1107,11 @@ public:
class Field_varstring :public Field_longstr {
public:
+ /*
+ The maximum space available in a Field_varstring, in bytes. See
+ length_bytes.
+ */
+ static const uint MAX_SIZE= UINT_MAX16;
/* Store number of bytes used to store length (1 or 2) */
uint32 length_bytes;
Field_varstring(char *ptr_arg,
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 5670b1e0676..410db357510 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -177,8 +177,7 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
}
if (current_thd->count_cuted_fields == CHECK_FIELD_WARN)
{
- field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_WARN_NULL_TO_NOTNULL, 1);
+ field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_BAD_NULL_ERROR, 1);
return 0;
}
if (!current_thd->no_errors)
@@ -530,7 +529,21 @@ void Copy_field::set(char *to,Field *from)
}
+/*
+ To do:
+
+ If 'save\ is set to true and the 'from' is a blob field, do_copy is set to
+ do_save_blob rather than do_conv_blob. The only differences between them
+ appears to be:
+ - do_save_blob allocates and uses an intermediate buffer before calling
+ Field_blob::store. Is this in order to trigger the call to
+ well_formed_copy_nchars, by changing the pointer copy->tmp.ptr()?
+ That call will take place anyway in all known cases.
+
+ - The above causes a truncation to MAX_FIELD_WIDTH. Is this the intended
+ effect? Truncation is handled by well_formed_copy_nchars anyway.
+ */
void Copy_field::set(Field *to,Field *from,bool save)
{
if (to->type() == FIELD_TYPE_NULL)
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 23d652cb8cc..a4bf04a6786 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -249,7 +249,8 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
open_cached_file(outfile,mysql_tmpdir,TEMP_PREFIX,READ_RECORD_BUFFER,
MYF(MY_WME)))
goto err;
- reinit_io_cache(outfile,WRITE_CACHE,0L,0,0);
+ if (reinit_io_cache(outfile,WRITE_CACHE,0L,0,0))
+ goto err;
/*
Use also the space previously used by string pointers in sort_buffer
@@ -369,6 +370,8 @@ static BUFFPEK *read_buffpek_from_file(IO_CACHE *buffpek_pointers, uint count)
ulong length;
BUFFPEK *tmp;
DBUG_ENTER("read_buffpek_from_file");
+ if (count > UINT_MAX/sizeof(BUFFPEK))
+ return 0; /* sizeof(BUFFPEK)*count will overflow */
tmp=(BUFFPEK*) my_malloc(length=sizeof(BUFFPEK)*count, MYF(MY_WME));
if (tmp)
{
@@ -600,6 +603,9 @@ write_keys(SORTPARAM *param, register uchar **sort_keys, uint count,
open_cached_file(tempfile, mysql_tmpdir, TEMP_PREFIX, DISK_BUFFER_SIZE,
MYF(MY_WME)))
goto err; /* purecov: inspected */
+ /* check we won't have more buffpeks than we can possibly keep in memory */
+ if (my_b_tell(buffpek_pointers) + sizeof(BUFFPEK) > (ulonglong)UINT_MAX)
+ goto err;
buffpek.file_pos= my_b_tell(tempfile);
if ((ha_rows) count > param->max_rows)
count=(uint) param->max_rows; /* purecov: inspected */
@@ -907,7 +913,7 @@ static bool save_index(SORTPARAM *param, uchar **sort_keys, uint count,
int merge_many_buff(SORTPARAM *param, uchar *sort_buffer,
BUFFPEK *buffpek, uint *maxbuffer, IO_CACHE *t_file)
{
- register int i;
+ register uint i;
IO_CACHE t_file2,*from_file,*to_file,*temp;
BUFFPEK *lastbuff;
DBUG_ENTER("merge_many_buff");
@@ -922,14 +928,16 @@ int merge_many_buff(SORTPARAM *param, uchar *sort_buffer,
from_file= t_file ; to_file= &t_file2;
while (*maxbuffer >= MERGEBUFF2)
{
- reinit_io_cache(from_file,READ_CACHE,0L,0,0);
- reinit_io_cache(to_file,WRITE_CACHE,0L,0,0);
+ if (reinit_io_cache(from_file,READ_CACHE,0L,0,0))
+ goto cleanup;
+ if (reinit_io_cache(to_file,WRITE_CACHE,0L,0,0))
+ goto cleanup;
lastbuff=buffpek;
- for (i=0 ; i <= (int) *maxbuffer-MERGEBUFF*3/2 ; i+=MERGEBUFF)
+ for (i=0 ; i <= *maxbuffer-MERGEBUFF*3/2 ; i+=MERGEBUFF)
{
if (merge_buffers(param,from_file,to_file,sort_buffer,lastbuff++,
buffpek+i,buffpek+i+MERGEBUFF-1,0))
- break; /* purecov: inspected */
+ goto cleanup;
}
if (merge_buffers(param,from_file,to_file,sort_buffer,lastbuff++,
buffpek+i,buffpek+ *maxbuffer,0))
@@ -941,6 +949,7 @@ int merge_many_buff(SORTPARAM *param, uchar *sort_buffer,
setup_io_cache(to_file);
*maxbuffer= (uint) (lastbuff-buffpek)-1;
}
+cleanup:
close_cached_file(to_file); // This holds old result
if (to_file == t_file)
{
diff --git a/sql/ha_blackhole.h b/sql/ha_blackhole.h
index 0046a57d10a..4dcb37c637d 100644
--- a/sql/ha_blackhole.h
+++ b/sql/ha_blackhole.h
@@ -43,8 +43,7 @@ public:
{
return(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
HA_DUPP_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
- HA_FILE_BASED | HA_CAN_GEOMETRY | HA_READ_RND_SAME |
- HA_CAN_INSERT_DELAYED);
+ HA_FILE_BASED | HA_CAN_GEOMETRY | HA_READ_RND_SAME);
}
ulong index_flags(uint inx, uint part, bool all_parts) const
{
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 8701a216b8e..0f3a42bbce7 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -1630,6 +1630,34 @@ bool ha_ndbcluster::check_all_operations_for_error(NdbTransaction *trans,
DBUG_RETURN(true);
}
+
+/**
+ * Check if record contains any null valued columns that are part of a key
+ */
+static
+int
+check_null_in_record(const KEY* key_info, const byte *record)
+{
+ KEY_PART_INFO *curr_part, *end_part;
+ curr_part= key_info->key_part;
+ end_part= curr_part + key_info->key_parts;
+
+ while (curr_part != end_part)
+ {
+ if (curr_part->null_bit &&
+ (record[curr_part->null_offset] & curr_part->null_bit))
+ return 1;
+ curr_part++;
+ }
+ return 0;
+ /*
+ We could instead pre-compute a bitmask in table_share with one bit for
+ every null-bit in the key, and so check this just by OR'ing the bitmask
+ with the null bitmap in the record.
+ But not sure it's worth it.
+ */
+}
+
/*
* Peek to check if any rows already exist with conflicting
* primary key or unique index values
@@ -1671,7 +1699,17 @@ int ha_ndbcluster::peek_indexed_rows(const byte *record, bool check_pk)
if (i != table->s->primary_key &&
key_info->flags & HA_NOSAME)
{
- // A unique index is defined on table
+ /*
+ A unique index is defined on table.
+ We cannot look up a NULL field value in a unique index. But since
+ keys with NULLs are not indexed, such rows cannot conflict anyway, so
+ we just skip the index in this case.
+ */
+ if (check_null_in_record(key_info, record))
+ {
+ DBUG_PRINT("info", ("skipping check for key with NULL"));
+ continue;
+ }
NdbIndexOperation *iop;
NDBINDEX *unique_index = (NDBINDEX *) m_index[i].unique_index;
key_part= key_info->key_part;
@@ -2271,16 +2309,24 @@ int ha_ndbcluster::write_row(byte *record)
{
// Table has hidden primary key
Ndb *ndb= get_ndb();
- int ret;
Uint64 auto_value;
uint retries= NDB_AUTO_INCREMENT_RETRIES;
- do {
- ret= ndb->getAutoIncrementValue((const NDBTAB *) m_table, auto_value, 1);
- } while (ret == -1 &&
- --retries &&
- ndb->getNdbError().status == NdbError::TemporaryError);
- if (ret == -1)
- ERR_RETURN(ndb->getNdbError());
+ int retry_sleep= 30; /* 30 milliseconds, transaction */
+ for (;;)
+ {
+ if (ndb->getAutoIncrementValue((const NDBTAB *) m_table,
+ auto_value, 1) == -1)
+ {
+ if (--retries &&
+ ndb->getNdbError().status == NdbError::TemporaryError);
+ {
+ my_sleep(retry_sleep);
+ continue;
+ }
+ ERR_RETURN(ndb->getNdbError());
+ }
+ break;
+ }
if (set_hidden_key(op, table->s->fields, (const byte*)&auto_value))
ERR_RETURN(op->getNdbError());
}
@@ -2816,7 +2862,7 @@ int ha_ndbcluster::index_end()
}
/**
- * Check if key contains null
+ * Check if key contains nullable columns
*/
static
int
@@ -4817,22 +4863,27 @@ ulonglong ha_ndbcluster::get_auto_increment()
m_rows_to_insert - m_rows_inserted :
((m_rows_to_insert > m_autoincrement_prefetch) ?
m_rows_to_insert : m_autoincrement_prefetch));
- int ret;
uint retries= NDB_AUTO_INCREMENT_RETRIES;
- do {
- ret=
- m_skip_auto_increment ?
- ndb->readAutoIncrementValue((const NDBTAB *) m_table, auto_value) :
- ndb->getAutoIncrementValue((const NDBTAB *) m_table, auto_value, cache_size);
- } while (ret == -1 &&
- --retries &&
- ndb->getNdbError().status == NdbError::TemporaryError);
- if (ret == -1)
- {
- const NdbError err= ndb->getNdbError();
- sql_print_error("Error %lu in ::get_auto_increment(): %s",
- (ulong) err.code, err.message);
- DBUG_RETURN(~(ulonglong) 0);
+ int retry_sleep= 30; /* 30 milliseconds, transaction */
+ for (;;)
+ {
+ if (m_skip_auto_increment &&
+ ndb->readAutoIncrementValue((const NDBTAB *) m_table, auto_value) ||
+ ndb->getAutoIncrementValue((const NDBTAB *) m_table,
+ auto_value, cache_size))
+ {
+ if (--retries &&
+ ndb->getNdbError().status == NdbError::TemporaryError);
+ {
+ my_sleep(retry_sleep);
+ continue;
+ }
+ const NdbError err= ndb->getNdbError();
+ sql_print_error("Error %lu in ::get_auto_increment(): %s",
+ (ulong) err.code, err.message);
+ DBUG_RETURN(~(ulonglong) 0);
+ }
+ break;
}
DBUG_RETURN((longlong)auto_value);
}
@@ -4973,27 +5024,36 @@ int ha_ndbcluster::open(const char *name, int mode, uint test_if_locked)
set_dbname(name);
set_tabname(name);
- if (check_ndb_connection()) {
- free_share(m_share); m_share= 0;
- DBUG_RETURN(HA_ERR_NO_CONNECTION);
+ if ((res= check_ndb_connection()) ||
+ (res= get_metadata(name)))
+ {
+ free_share(m_share);
+ m_share= 0;
+ DBUG_RETURN(res);
}
-
- res= get_metadata(name);
- if (!res)
+ while (1)
{
Ndb *ndb= get_ndb();
if (ndb->setDatabaseName(m_dbname))
{
- ERR_RETURN(ndb->getNdbError());
+ res= ndb_to_mysql_error(&ndb->getNdbError());
+ break;
}
struct Ndb_statistics stat;
res= ndb_get_table_statistics(NULL, false, ndb, m_tabname, &stat);
records= stat.row_count;
if(!res)
res= info(HA_STATUS_CONST);
+ break;
}
-
- DBUG_RETURN(res);
+ if (res)
+ {
+ free_share(m_share);
+ m_share= 0;
+ release_metadata();
+ DBUG_RETURN(res);
+ }
+ DBUG_RETURN(0);
}
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index 47510337bf4..81cbdcd8fea 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -40,6 +40,7 @@ class ha_ndbcluster_cond;
// connectstring to cluster if given by mysqld
extern const char *ndbcluster_connectstring;
extern ulong ndb_cache_check_time;
+extern char opt_ndb_constrbuf[];
typedef enum ndb_index_type {
UNDEFINED_INDEX = 0,
diff --git a/sql/handler.cc b/sql/handler.cc
index c6c31593a5f..867ac7ff778 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1685,7 +1685,14 @@ void handler::restore_auto_increment()
{
THD *thd= table->in_use;
if (thd->next_insert_id)
+ {
thd->next_insert_id= thd->prev_insert_id;
+ if (thd->next_insert_id == 0)
+ {
+ /* we didn't generate a value, engine will be called again */
+ thd->clear_next_insert_id= 0;
+ }
+ }
}
diff --git a/sql/handler.h b/sql/handler.h
index 9863d541b5f..a59b7a09740 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -162,6 +162,7 @@
#define HA_LEX_CREATE_TMP_TABLE 1
#define HA_LEX_CREATE_IF_NOT_EXISTS 2
+#define HA_LEX_CREATE_TABLE_LIKE 4
#define HA_OPTION_NO_CHECKSUM (1L << 17)
#define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18)
#define HA_MAX_REC_LENGTH 65535
diff --git a/sql/init.cc b/sql/init.cc
index ad55a2a8b24..b3b68926683 100644
--- a/sql/init.cc
+++ b/sql/init.cc
@@ -21,8 +21,6 @@
void unireg_init(ulong options)
{
- uint i;
- double nr;
DBUG_ENTER("unireg_init");
MYSYS_PROGRAM_DONT_USE_CURSES();
@@ -39,16 +37,5 @@ void unireg_init(ulong options)
VOID(strmov(reg_ext,".frm"));
specialflag=SPECIAL_SAME_DB_NAME | options; /* Set options from argv */
- /* Make a tab of powers of 10 */
- for (i=0,nr=1.0; i < array_elements(log_10) ; i++)
- { /* It's used by filesort... */
- log_10[i]= nr ; nr*= 10.0;
- }
- /* Make a tab of powers of 0.1 */
- for (i= 0, nr= 0.1; i < array_elements(log_01); i++)
- {
- log_01[i]= nr;
- nr*= 0.1;
- }
DBUG_VOID_RETURN;
}
diff --git a/sql/item.cc b/sql/item.cc
index 28729e9936f..a5dfa0db6b6 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -270,7 +270,7 @@ my_decimal *Item::val_decimal_from_string(my_decimal *decimal_value)
my_decimal *Item::val_decimal_from_date(my_decimal *decimal_value)
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (get_date(&ltime, TIME_FUZZY_DATE))
{
my_decimal_set_zero(decimal_value);
@@ -283,7 +283,7 @@ my_decimal *Item::val_decimal_from_date(my_decimal *decimal_value)
my_decimal *Item::val_decimal_from_time(my_decimal *decimal_value)
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (get_time(&ltime))
{
my_decimal_set_zero(decimal_value);
@@ -318,7 +318,7 @@ longlong Item::val_int_from_decimal()
int Item::save_time_in_field(Field *field)
{
- TIME ltime;
+ MYSQL_TIME ltime;
if (get_time(&ltime))
return set_field_to_null(field);
field->set_notnull();
@@ -328,7 +328,7 @@ int Item::save_time_in_field(Field *field)
int Item::save_date_in_field(Field *field)
{
- TIME ltime;
+ MYSQL_TIME ltime;
if (get_date(&ltime, TIME_FUZZY_DATE))
return set_field_to_null(field);
field->set_notnull();
@@ -836,22 +836,40 @@ bool Item_string::eq(const Item *item, bool binary_cmp) const
/*
- Get the value of the function as a TIME structure.
+ Get the value of the function as a MYSQL_TIME structure.
As a extra convenience the time structure is reset on error!
*/
-bool Item::get_date(TIME *ltime,uint fuzzydate)
+bool Item::get_date(MYSQL_TIME *ltime,uint fuzzydate)
{
- char buff[40];
- String tmp(buff,sizeof(buff), &my_charset_bin),*res;
- if (!(res=val_str(&tmp)) ||
- str_to_datetime_with_warn(res->ptr(), res->length(),
- ltime, fuzzydate) <= MYSQL_TIMESTAMP_ERROR)
+ if (result_type() == STRING_RESULT)
{
- bzero((char*) ltime,sizeof(*ltime));
- return 1;
+ char buff[40];
+ String tmp(buff,sizeof(buff), &my_charset_bin),*res;
+ if (!(res=val_str(&tmp)) ||
+ str_to_datetime_with_warn(res->ptr(), res->length(),
+ ltime, fuzzydate) <= MYSQL_TIMESTAMP_ERROR)
+ goto err;
+ }
+ else
+ {
+ longlong value= val_int();
+ int was_cut;
+ if (number_to_datetime(value, ltime, fuzzydate, &was_cut) == LL(-1))
+ {
+ char buff[22], *end;
+ end= longlong10_to_str(value, buff, -10);
+ make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ buff, (int) (end-buff), MYSQL_TIMESTAMP_NONE,
+ NullS);
+ goto err;
+ }
}
return 0;
+
+err:
+ bzero((char*) ltime,sizeof(*ltime));
+ return 1;
}
/*
@@ -859,7 +877,7 @@ bool Item::get_date(TIME *ltime,uint fuzzydate)
As a extra convenience the time structure is reset on error!
*/
-bool Item::get_time(TIME *ltime)
+bool Item::get_time(MYSQL_TIME *ltime)
{
char buff[40];
String tmp(buff,sizeof(buff),&my_charset_bin),*res;
@@ -1011,6 +1029,7 @@ Item_splocal::Item_splocal(const LEX_STRING &sp_var_name,
maybe_null= TRUE;
m_type= sp_map_item_type(sp_var_type);
+ m_field_type= sp_var_type;
m_result_type= sp_map_result_type(sp_var_type);
}
@@ -1837,7 +1856,7 @@ String *Item_field::str_result(String *str)
return result_field->val_str(str,&str_value);
}
-bool Item_field::get_date(TIME *ltime,uint fuzzydate)
+bool Item_field::get_date(MYSQL_TIME *ltime,uint fuzzydate)
{
if ((null_value=field->is_null()) || field->get_date(ltime,fuzzydate))
{
@@ -1847,7 +1866,7 @@ bool Item_field::get_date(TIME *ltime,uint fuzzydate)
return 0;
}
-bool Item_field::get_date_result(TIME *ltime,uint fuzzydate)
+bool Item_field::get_date_result(MYSQL_TIME *ltime,uint fuzzydate)
{
if ((null_value=result_field->is_null()) ||
result_field->get_date(ltime,fuzzydate))
@@ -1858,7 +1877,7 @@ bool Item_field::get_date_result(TIME *ltime,uint fuzzydate)
return 0;
}
-bool Item_field::get_time(TIME *ltime)
+bool Item_field::get_time(MYSQL_TIME *ltime)
{
if ((null_value=field->is_null()) || field->get_time(ltime))
{
@@ -2294,6 +2313,7 @@ default_set_param_func(Item_param *param,
Item_param::Item_param(unsigned pos_in_query_arg) :
+ strict_type(FALSE),
state(NO_VALUE),
item_result_type(STRING_RESULT),
/* Don't pretend to be a literal unless value for this item is set. */
@@ -2385,7 +2405,7 @@ void Item_param::set_decimal(const char *str, ulong length)
/*
- Set parameter value from TIME value.
+ Set parameter value from MYSQL_TIME value.
SYNOPSIS
set_time()
@@ -2399,7 +2419,7 @@ void Item_param::set_decimal(const char *str, ulong length)
the fact that even wrong value sent over binary protocol fits into
MAX_DATE_STRING_REP_LENGTH buffer.
*/
-void Item_param::set_time(TIME *tm, timestamp_type time_type,
+void Item_param::set_time(MYSQL_TIME *tm, timestamp_type time_type,
uint32 max_length_arg)
{
DBUG_ENTER("Item_param::set_time");
@@ -2414,7 +2434,8 @@ void Item_param::set_time(TIME *tm, timestamp_type time_type,
{
char buff[MAX_DATE_STRING_REP_LENGTH];
uint length= my_TIME_to_str(&value.time, buff);
- make_truncated_value_warning(current_thd, buff, length, time_type, 0);
+ make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ buff, length, time_type, 0);
set_zero_time(&value.time, MYSQL_TIMESTAMP_ERROR);
}
@@ -2487,16 +2508,16 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry)
if (entry && entry->value)
{
item_result_type= entry->type;
- switch (entry->type) {
+ if (strict_type && required_result_type != item_result_type)
+ DBUG_RETURN(1);
+ switch (item_result_type) {
case REAL_RESULT:
set_double(*(double*)entry->value);
item_type= Item::REAL_ITEM;
- item_result_type= REAL_RESULT;
break;
case INT_RESULT:
set_int(*(longlong*)entry->value, MY_INT64_NUM_DECIMAL_DIGITS);
item_type= Item::INT_ITEM;
- item_result_type= INT_RESULT;
break;
case STRING_RESULT:
{
@@ -2518,7 +2539,6 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry)
charset of connection, so we have to set it later.
*/
item_type= Item::STRING_ITEM;
- item_result_type= STRING_RESULT;
if (set_str((const char *)entry->value, entry->length))
DBUG_RETURN(1);
@@ -2532,6 +2552,7 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry)
decimals= ent_value->frac;
max_length= my_decimal_precision_to_length(ent_value->precision(),
decimals, unsigned_flag);
+ item_type= Item::DECIMAL_ITEM;
break;
}
default:
@@ -2615,7 +2636,7 @@ int Item_param::save_in_field(Field *field, bool no_conversions)
}
-bool Item_param::get_time(TIME *res)
+bool Item_param::get_time(MYSQL_TIME *res)
{
if (state == TIME_VALUE)
{
@@ -2630,7 +2651,7 @@ bool Item_param::get_time(TIME *res)
}
-bool Item_param::get_date(TIME *res, uint fuzzydate)
+bool Item_param::get_date(MYSQL_TIME *res, uint fuzzydate)
{
if (state == TIME_VALUE)
{
@@ -3056,7 +3077,7 @@ String* Item_ref_null_helper::val_str(String* s)
}
-bool Item_ref_null_helper::get_date(TIME *ltime, uint fuzzydate)
+bool Item_ref_null_helper::get_date(MYSQL_TIME *ltime, uint fuzzydate)
{
return (owner->was_null|= null_value= (*ref)->get_date(ltime, fuzzydate));
}
@@ -3502,7 +3523,8 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
prev_subselect_item->const_item_cache= 0;
set_field(*from_field);
if (!last_checked_context->select_lex->having_fix_field &&
- select->group_list.elements)
+ select->group_list.elements &&
+ (place == SELECT_LIST || place == IN_HAVING))
{
Item_outer_ref *rf;
/*
@@ -4621,7 +4643,6 @@ inline uint char_val(char X)
Item_hex_string::Item_hex_string(const char *str, uint str_length)
{
- name=(char*) str-2; // Lex makes this start with 0x
max_length=(str_length+1)/2;
char *ptr=(char*) sql_alloc(max_length+1);
if (!ptr)
@@ -4732,7 +4753,6 @@ Item_bin_string::Item_bin_string(const char *str, uint str_length)
uchar bits= 0;
uint power= 1;
- name= (char*) str - 2;
max_length= (str_length + 7) >> 3;
char *ptr= (char*) sql_alloc(max_length + 1);
if (!ptr)
@@ -4852,7 +4872,7 @@ bool Item::send(Protocol *protocol, String *buffer)
case MYSQL_TYPE_DATE:
case MYSQL_TYPE_TIMESTAMP:
{
- TIME tm;
+ MYSQL_TIME tm;
get_date(&tm, TIME_FUZZY_DATE);
if (!null_value)
{
@@ -4865,7 +4885,7 @@ bool Item::send(Protocol *protocol, String *buffer)
}
case MYSQL_TYPE_TIME:
{
- TIME tm;
+ MYSQL_TIME tm;
get_time(&tm);
if (!null_value)
result= protocol->store_time(&tm);
@@ -5437,7 +5457,7 @@ bool Item_ref::is_null()
}
-bool Item_ref::get_date(TIME *ltime,uint fuzzydate)
+bool Item_ref::get_date(MYSQL_TIME *ltime,uint fuzzydate)
{
return (null_value=(*ref)->get_date_result(ltime,fuzzydate));
}
@@ -5536,7 +5556,7 @@ bool Item_direct_ref::is_null()
}
-bool Item_direct_ref::get_date(TIME *ltime,uint fuzzydate)
+bool Item_direct_ref::get_date(MYSQL_TIME *ltime,uint fuzzydate)
{
return (null_value=(*ref)->get_date(ltime,fuzzydate));
}
diff --git a/sql/item.h b/sql/item.h
index 43afbd30d47..a1704aa6103 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -689,9 +689,9 @@ public:
/* Called for items that really have to be split */
void split_sum_func2(THD *thd, Item **ref_pointer_array, List<Item> &fields,
Item **ref, bool skip_registered);
- virtual bool get_date(TIME *ltime,uint fuzzydate);
- virtual bool get_time(TIME *ltime);
- virtual bool get_date_result(TIME *ltime,uint fuzzydate)
+ virtual bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ virtual bool get_time(MYSQL_TIME *ltime);
+ virtual bool get_date_result(MYSQL_TIME *ltime,uint fuzzydate)
{ return get_date(ltime,fuzzydate); }
/*
The method allows to determine nullness of a complex expression
@@ -946,7 +946,7 @@ class Item_splocal :public Item_sp_variable,
Type m_type;
Item_result m_result_type;
-
+ enum_field_types m_field_type;
public:
/*
Position of this reference to SP variable in the statement (the
@@ -978,6 +978,7 @@ public:
inline enum Type type() const;
inline Item_result result_type() const;
+ inline enum_field_types field_type() const { return m_field_type; }
private:
bool set_value(THD *thd, sp_rcontext *ctx, Item **it);
@@ -1272,9 +1273,9 @@ public:
}
Field *get_tmp_table_field() { return result_field; }
Field *tmp_table_field(TABLE *t_arg) { return result_field; }
- bool get_date(TIME *ltime,uint fuzzydate);
- bool get_date_result(TIME *ltime,uint fuzzydate);
- bool get_time(TIME *ltime);
+ bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_date_result(MYSQL_TIME *ltime,uint fuzzydate);
+ bool get_time(MYSQL_TIME *ltime);
bool is_null() { return field->is_null(); }
void update_null_value();
Item *get_tmp_table_item(THD *thd);
@@ -1358,8 +1359,10 @@ class Item_param :public Item
char cnvbuf[MAX_FIELD_WIDTH];
String cnvstr;
Item *cnvitem;
-public:
+ bool strict_type;
+ enum Item_result required_result_type;
+public:
enum enum_item_param_state
{
NO_VALUE, NULL_VALUE, INT_VALUE, REAL_VALUE,
@@ -1401,7 +1404,7 @@ public:
*/
CHARSET_INFO *final_character_set_of_str_value;
} cs_info;
- TIME time;
+ MYSQL_TIME time;
} value;
/* Cached values for virtual methods to save us one switch. */
@@ -1433,8 +1436,8 @@ public:
longlong val_int();
my_decimal *val_decimal(my_decimal*);
String *val_str(String*);
- bool get_time(TIME *tm);
- bool get_date(TIME *tm, uint fuzzydate);
+ bool get_time(MYSQL_TIME *tm);
+ bool get_date(MYSQL_TIME *tm, uint fuzzydate);
int save_in_field(Field *field, bool no_conversions);
void set_null();
@@ -1443,7 +1446,7 @@ public:
void set_decimal(const char *str, ulong length);
bool set_str(const char *str, ulong length);
bool set_longdata(const char *str, ulong length);
- void set_time(TIME *tm, timestamp_type type, uint32 max_length_arg);
+ void set_time(MYSQL_TIME *tm, timestamp_type type, uint32 max_length_arg);
bool set_from_user_var(THD *thd, const user_var_entry *entry);
void reset();
/*
@@ -1487,6 +1490,11 @@ public:
Otherwise return FALSE.
*/
bool eq(const Item *item, bool binary_cmp) const;
+ void set_strict_type(enum Item_result result_type_arg)
+ {
+ strict_type= TRUE;
+ required_result_type= result_type_arg;
+ }
};
@@ -1876,7 +1884,7 @@ public:
bool val_bool();
String *val_str(String* tmp);
bool is_null();
- bool get_date(TIME *ltime,uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
double val_result();
longlong val_int_result();
String *str_result(String* tmp);
@@ -1953,7 +1961,7 @@ public:
my_decimal *val_decimal(my_decimal *);
bool val_bool();
bool is_null();
- bool get_date(TIME *ltime,uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
virtual Ref_Type ref_type() { return DIRECT_REF; }
};
@@ -2058,7 +2066,7 @@ public:
String* val_str(String* s);
my_decimal *val_decimal(my_decimal *);
bool val_bool();
- bool get_date(TIME *ltime, uint fuzzydate);
+ bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
void print(String *str);
/*
we add RAND_TABLE_BIT to prevent moving this item from HAVING to WHERE
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 66c73dd910e..516d0fcf3e1 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -316,8 +316,10 @@ static bool convert_constant_item(THD *thd, Field *field, Item **item)
{
/* For comparison purposes allow invalid dates like 2000-01-32 */
ulong orig_sql_mode= thd->variables.sql_mode;
+ enum_check_fields orig_count_cuted_fields= thd->count_cuted_fields;
thd->variables.sql_mode= (orig_sql_mode & ~MODE_NO_ZERO_DATE) |
MODE_INVALID_DATES;
+ thd->count_cuted_fields= CHECK_FIELD_IGNORE;
if (!(*item)->save_in_field(field, 1) && !((*item)->null_value))
{
Item *tmp=new Item_int_with_ref(field->val_int(), *item,
@@ -328,6 +330,7 @@ static bool convert_constant_item(THD *thd, Field *field, Item **item)
return 1; // Item was replaced
}
thd->variables.sql_mode= orig_sql_mode;
+ thd->count_cuted_fields= orig_count_cuted_fields;
}
return 0;
}
@@ -504,7 +507,7 @@ int Arg_comparator::set_compare_func(Item_bool_func2 *item, Item_result type)
{
if ((*a)->decimals < NOT_FIXED_DEC && (*b)->decimals < NOT_FIXED_DEC)
{
- precision= 5 * log_01[max((*a)->decimals, (*b)->decimals)];
+ precision= 5 / log_10[max((*a)->decimals, (*b)->decimals) + 1];
if (func == &Arg_comparator::compare_real)
func= &Arg_comparator::compare_real_fixed;
else if (func == &Arg_comparator::compare_e_real)
@@ -564,8 +567,9 @@ get_date_from_str(THD *thd, String *str, timestamp_type warn_type,
if (error || *error_arg)
{
- make_truncated_value_warning(thd, str->ptr(), str->length(), warn_type,
- warn_name);
+ make_truncated_value_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ str->ptr(), str->length(),
+ warn_type, warn_name);
*error_arg= TRUE;
}
return value;
@@ -633,7 +637,13 @@ Arg_comparator::can_compare_as_dates(Item *a, Item *b, ulonglong *const_value)
if (cmp_type != CMP_DATE_DFLT)
{
- if (cmp_type != CMP_DATE_WITH_DATE && str_arg->const_item())
+ /*
+ Do not cache GET_USER_VAR() function as its const_item() may return TRUE
+ for the current thread but it still may change during the execution.
+ */
+ if (cmp_type != CMP_DATE_WITH_DATE && str_arg->const_item() &&
+ (str_arg->type() != Item::FUNC_ITEM ||
+ ((Item_func*)str_arg)->functype() != Item_func::GUSERVAR_FUNC))
{
THD *thd= current_thd;
ulonglong value;
@@ -661,7 +671,7 @@ int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg,
Item_result type)
{
enum enum_date_cmp_type cmp_type;
- ulonglong const_value;
+ ulonglong const_value= (ulonglong)-1;
a= a1;
b= a2;
@@ -674,8 +684,7 @@ int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg,
a_cache= 0;
b_cache= 0;
- if (cmp_type != CMP_DATE_WITH_DATE &&
- ((*b)->const_item() || (*a)->const_item()))
+ if (const_value != (ulonglong)-1)
{
Item_cache_int *cache= new Item_cache_int();
/* Mark the cache as non-const to prevent re-caching. */
@@ -745,7 +754,7 @@ void Arg_comparator::set_datetime_cmp_func(Item **a1, Item **b1)
obtained value
*/
-static ulonglong
+ulonglong
get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
Item *warn_item, bool *is_null)
{
@@ -757,7 +766,12 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
{
value= item->val_int();
*is_null= item->null_value;
- if (item->field_type() == MYSQL_TYPE_DATE)
+ /*
+ Item_date_add_interval may return MYSQL_TYPE_STRING as the result
+ field type. To detect that the DATE value has been returned we
+ compare it with 1000000L - any DATE value should be less than it.
+ */
+ if (item->field_type() == MYSQL_TYPE_DATE || value < 100000000L)
value*= 1000000L;
}
else
@@ -781,7 +795,12 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
MYSQL_TYPE_DATE ? MYSQL_TIMESTAMP_DATE : MYSQL_TIMESTAMP_DATETIME;
value= get_date_from_str(thd, str, t_type, warn_item->name, &error);
}
- if (item->const_item())
+ /*
+ Do not cache GET_USER_VAR() function as its const_item() may return TRUE
+ for the current thread but it still may change during the execution.
+ */
+ if (item->const_item() && cache_arg && (item->type() != Item::FUNC_ITEM ||
+ ((Item_func*)item)->functype() != Item_func::GUSERVAR_FUNC))
{
Item_cache_int *cache= new Item_cache_int();
/* Mark the cache as non-const to prevent re-caching. */
@@ -2786,7 +2805,6 @@ in_row::in_row(uint elements, Item * item)
base= (char*) new cmp_item_row[count= elements];
size= sizeof(cmp_item_row);
compare= (qsort2_cmp) cmp_row;
- tmp.store_value(item);
/*
We need to reset these as otherwise we will call sort() with
uninitialized (even if not used) elements
@@ -2838,6 +2856,27 @@ byte *in_longlong::get_value(Item *item)
return (byte*) &tmp;
}
+void in_datetime::set(uint pos,Item *item)
+{
+ Item **tmp= &item;
+ bool is_null;
+ struct packed_longlong *buff= &((packed_longlong*) base)[pos];
+
+ buff->val= get_datetime_value(thd, &tmp, 0, warn_item, &is_null);
+ buff->unsigned_flag= 1L;
+}
+
+byte *in_datetime::get_value(Item *item)
+{
+ bool is_null;
+ Item **tmp_item= lval_cache ? &lval_cache : &item;
+ tmp.val= get_datetime_value(thd, &tmp_item, &lval_cache, warn_item, &is_null);
+ if (item->null_value)
+ return 0;
+ tmp.unsigned_flag= 1L;
+ return (byte*) &tmp;
+}
+
in_double::in_double(uint elements)
:in_vector(elements,sizeof(double),(qsort2_cmp) cmp_double, 0)
{}
@@ -2942,12 +2981,18 @@ cmp_item_row::~cmp_item_row()
}
+void cmp_item_row::alloc_comparators()
+{
+ if (!comparators)
+ comparators= (cmp_item **) current_thd->calloc(sizeof(cmp_item *)*n);
+}
+
+
void cmp_item_row::store_value(Item *item)
{
DBUG_ENTER("cmp_item_row::store_value");
n= item->cols();
- if (!comparators)
- comparators= (cmp_item **) current_thd->calloc(sizeof(cmp_item *)*n);
+ alloc_comparators();
if (comparators)
{
item->bring_value();
@@ -3059,6 +3104,36 @@ cmp_item* cmp_item_decimal::make_same()
}
+void cmp_item_datetime::store_value(Item *item)
+{
+ bool is_null;
+ Item **tmp_item= lval_cache ? &lval_cache : &item;
+ value= get_datetime_value(thd, &tmp_item, &lval_cache, warn_item, &is_null);
+}
+
+
+int cmp_item_datetime::cmp(Item *arg)
+{
+ bool is_null;
+ Item **tmp_item= &arg;
+ return value !=
+ get_datetime_value(thd, &tmp_item, 0, warn_item, &is_null);
+}
+
+
+int cmp_item_datetime::compare(cmp_item *ci)
+{
+ cmp_item_datetime *l_cmp= (cmp_item_datetime *)ci;
+ return (value < l_cmp->value) ? -1 : ((value == l_cmp->value) ? 0 : 1);
+}
+
+
+cmp_item *cmp_item_datetime::make_same()
+{
+ return new cmp_item_datetime(warn_item);
+}
+
+
bool Item_func_in::nulls_in_row()
{
Item **arg,**arg_end;
@@ -3134,7 +3209,11 @@ void Item_func_in::fix_length_and_dec()
Item **arg, **arg_end;
uint const_itm= 1;
THD *thd= current_thd;
-
+ bool datetime_found= FALSE;
+ /* TRUE <=> arguments values will be compared as DATETIMEs. */
+ bool compare_as_datetime= FALSE;
+ Item *date_arg= 0;
+
if (agg_cmp_type(thd, &cmp_type, args, arg_count))
return;
@@ -3150,58 +3229,148 @@ void Item_func_in::fix_length_and_dec()
break;
}
}
+ /*
+ When comparing rows create the row comparator object beforehand to ease
+ the DATETIME comparison detection procedure.
+ */
+ if (cmp_type == ROW_RESULT)
+ {
+ cmp_item_row *cmp= 0;
+ if (const_itm && !nulls_in_row())
+ {
+ array= new in_row(arg_count-1, 0);
+ cmp= &((in_row*)array)->tmp;
+ }
+ else
+ {
+ if (!(cmp= new cmp_item_row))
+ return;
+ in_item= cmp;
+ }
+ cmp->n= args[0]->cols();
+ cmp->alloc_comparators();
+ }
+ /* All DATE/DATETIME fields/functions has the STRING result type. */
+ if (cmp_type == STRING_RESULT || cmp_type == ROW_RESULT)
+ {
+ uint col, cols= args[0]->cols();
+ for (col= 0; col < cols; col++)
+ {
+ bool skip_column= FALSE;
+ /*
+ Check that all items to be compared has the STRING result type and at
+ least one of them is a DATE/DATETIME item.
+ */
+ for (arg= args, arg_end= args + arg_count; arg != arg_end ; arg++)
+ {
+ Item *itm= ((cmp_type == STRING_RESULT) ? arg[0] :
+ arg[0]->element_index(col));
+ if (itm->result_type() != STRING_RESULT)
+ {
+ skip_column= TRUE;
+ break;
+ }
+ else if (itm->is_datetime())
+ {
+ datetime_found= TRUE;
+ /*
+ Internally all DATE/DATETIME values are converted to the DATETIME
+ type. So try to find a DATETIME item to issue correct warnings.
+ */
+ if (!date_arg)
+ date_arg= itm;
+ else if (itm->field_type() == MYSQL_TYPE_DATETIME)
+ {
+ date_arg= itm;
+ /* All arguments are already checked to have the STRING result. */
+ if (cmp_type == STRING_RESULT)
+ break;
+ }
+ }
+ }
+ if (skip_column)
+ continue;
+ if (datetime_found)
+ {
+ if (cmp_type == ROW_RESULT)
+ {
+ cmp_item **cmp= 0;
+ if (array)
+ cmp= ((in_row*)array)->tmp.comparators + col;
+ else
+ cmp= ((cmp_item_row*)in_item)->comparators + col;
+ *cmp= new cmp_item_datetime(date_arg);
+ /* Reset variables for the next column. */
+ date_arg= 0;
+ datetime_found= FALSE;
+ }
+ else
+ compare_as_datetime= TRUE;
+ }
+ }
+ }
/*
Row item with NULLs inside can return NULL or FALSE =>
they can't be processed as static
*/
if (const_itm && !nulls_in_row())
{
- /*
- IN must compare INT/DATE/DATETIME/TIMESTAMP columns and constants
- as int values (the same way as equality does).
- So we must check here if the column on the left and all the constant
- values on the right can be compared as integers and adjust the
- comparison type accordingly.
- */
- if (args[0]->real_item()->type() == FIELD_ITEM &&
- thd->lex->sql_command != SQLCOM_CREATE_VIEW &&
- thd->lex->sql_command != SQLCOM_SHOW_CREATE &&
- cmp_type != INT_RESULT)
+ if (compare_as_datetime)
+ array= new in_datetime(date_arg, arg_count - 1);
+ else
{
- Field *field= ((Item_field*) (args[0]->real_item()))->field;
- if (field->can_be_compared_as_longlong())
+ /*
+ IN must compare INT columns and constants as int values (the same
+ way as equality does).
+ So we must check here if the column on the left and all the constant
+ values on the right can be compared as integers and adjust the
+ comparison type accordingly.
+ */
+ if (args[0]->real_item()->type() == FIELD_ITEM &&
+ thd->lex->sql_command != SQLCOM_CREATE_VIEW &&
+ thd->lex->sql_command != SQLCOM_SHOW_CREATE &&
+ cmp_type != INT_RESULT)
{
- bool all_converted= TRUE;
- for (arg=args+1, arg_end=args+arg_count; arg != arg_end ; arg++)
+ Field *field= ((Item_field*) (args[0]->real_item()))->field;
+ if (field->can_be_compared_as_longlong())
{
- if (!convert_constant_item (thd, field, &arg[0]))
- all_converted= FALSE;
+ bool all_converted= TRUE;
+ for (arg=args+1, arg_end=args+arg_count; arg != arg_end ; arg++)
+ {
+ if (!convert_constant_item (thd, field, &arg[0]))
+ all_converted= FALSE;
+ }
+ if (all_converted)
+ cmp_type= INT_RESULT;
}
- if (all_converted)
- cmp_type= INT_RESULT;
}
- }
- switch (cmp_type) {
- case STRING_RESULT:
- array=new in_string(arg_count-1,(qsort2_cmp) srtcmp_in,
- cmp_collation.collation);
- break;
- case INT_RESULT:
- array= new in_longlong(arg_count-1);
- break;
- case REAL_RESULT:
- array= new in_double(arg_count-1);
- break;
- case ROW_RESULT:
- array= new in_row(arg_count-1, args[0]);
- break;
- case DECIMAL_RESULT:
- array= new in_decimal(arg_count - 1);
- break;
- default:
- DBUG_ASSERT(0);
- return;
+ switch (cmp_type) {
+ case STRING_RESULT:
+ array=new in_string(arg_count-1,(qsort2_cmp) srtcmp_in,
+ cmp_collation.collation);
+ break;
+ case INT_RESULT:
+ array= new in_longlong(arg_count-1);
+ break;
+ case REAL_RESULT:
+ array= new in_double(arg_count-1);
+ break;
+ case ROW_RESULT:
+ /*
+ The row comparator was created at the beginning but only DATETIME
+ items comparators were initialized. Call store_value() to setup
+ others.
+ */
+ ((in_row*)array)->tmp.store_value(args[0]);
+ break;
+ case DECIMAL_RESULT:
+ array= new in_decimal(arg_count - 1);
+ break;
+ default:
+ DBUG_ASSERT(0);
+ return;
+ }
}
if (array && !(thd->is_fatal_error)) // If not EOM
{
@@ -3220,7 +3389,19 @@ void Item_func_in::fix_length_and_dec()
}
else
{
- in_item= cmp_item::get_comparator(cmp_type, cmp_collation.collation);
+ if (in_item)
+ {
+ /*
+ The row comparator was created at the beginning but only DATETIME
+ items comparators were initialized. Call store_value() to setup
+ others.
+ */
+ in_item->store_value(args[0]);
+ }
+ else if (compare_as_datetime)
+ in_item= new cmp_item_datetime(date_arg);
+ else
+ in_item= cmp_item::get_comparator(cmp_type, cmp_collation.collation);
if (cmp_type == STRING_RESULT)
in_item->cmp_charset= cmp_collation.collation;
}
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 761ca90d0a7..79091b9c87d 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -833,6 +833,7 @@ public:
class in_longlong :public in_vector
{
+protected:
/*
Here we declare a temporary variable (tmp) of the same type as the
elements of this vector. tmp is used in finding if a given value is in
@@ -866,6 +867,30 @@ public:
friend int cmp_longlong(void *cmp_arg, packed_longlong *a,packed_longlong *b);
};
+
+/*
+ Class to represent a vector of constant DATE/DATETIME values.
+ Values are obtained with help of the get_datetime_value() function.
+ If the left item is a constant one then its value is cached in the
+ lval_cache variable.
+*/
+class in_datetime :public in_longlong
+{
+public:
+ THD *thd;
+ /* An item used to issue warnings. */
+ Item *warn_item;
+ /* Cache for the left item. */
+ Item *lval_cache;
+
+ in_datetime(Item *warn_item_arg, uint elements)
+ :in_longlong(elements), thd(current_thd), warn_item(warn_item_arg),
+ lval_cache(0) {};
+ void set(uint pos,Item *item);
+ byte *get_value(Item *item);
+ friend int cmp_longlong(void *cmp_arg, packed_longlong *a,packed_longlong *b);
+};
+
class in_double :public in_vector
{
double tmp;
@@ -986,6 +1011,30 @@ public:
cmp_item *make_same();
};
+/*
+ Compare items in the DATETIME context.
+ Values are obtained with help of the get_datetime_value() function.
+ If the left item is a constant one then its value is cached in the
+ lval_cache variable.
+*/
+class cmp_item_datetime :public cmp_item
+{
+ ulonglong value;
+public:
+ THD *thd;
+ /* Item used for issuing warnings. */
+ Item *warn_item;
+ /* Cache for the left item. */
+ Item *lval_cache;
+
+ cmp_item_datetime(Item *warn_item_arg)
+ :thd(current_thd), warn_item(warn_item_arg), lval_cache(0) {}
+ void store_value(Item *item);
+ int cmp(Item *arg);
+ int compare(cmp_item *ci);
+ cmp_item *make_same();
+};
+
class cmp_item_real :public cmp_item
{
double value;
@@ -1020,31 +1069,6 @@ public:
};
-class cmp_item_row :public cmp_item
-{
- cmp_item **comparators;
- uint n;
-public:
- cmp_item_row(): comparators(0), n(0) {}
- ~cmp_item_row();
- void store_value(Item *item);
- int cmp(Item *arg);
- int compare(cmp_item *arg);
- cmp_item *make_same();
- void store_value_by_template(cmp_item *tmpl, Item *);
-};
-
-
-class in_row :public in_vector
-{
- cmp_item_row tmp;
-public:
- in_row(uint elements, Item *);
- ~in_row();
- void set(uint pos,Item *item);
- byte *get_value(Item *item);
-};
-
/*
cmp_item for optimized IN with row (right part string, which never
be changed)
@@ -1120,6 +1144,34 @@ public:
CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
};
+class cmp_item_row :public cmp_item
+{
+ cmp_item **comparators;
+ uint n;
+public:
+ cmp_item_row(): comparators(0), n(0) {}
+ ~cmp_item_row();
+ void store_value(Item *item);
+ inline void alloc_comparators();
+ int cmp(Item *arg);
+ int compare(cmp_item *arg);
+ cmp_item *make_same();
+ void store_value_by_template(cmp_item *tmpl, Item *);
+ friend void Item_func_in::fix_length_and_dec();
+};
+
+
+class in_row :public in_vector
+{
+ cmp_item_row tmp;
+public:
+ in_row(uint elements, Item *);
+ ~in_row();
+ void set(uint pos,Item *item);
+ byte *get_value(Item *item);
+ friend void Item_func_in::fix_length_and_dec();
+};
+
/* Functions used by where clause */
class Item_func_isnull :public Item_bool_func
diff --git a/sql/item_create.cc b/sql/item_create.cc
index c1a81da0285..42cbdc8c280 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -418,6 +418,7 @@ Item *create_func_unhex(Item* a)
Item *create_func_uuid(void)
{
+ current_thd->lex->safe_to_cache_query= 0;
return new Item_func_uuid();
}
@@ -445,11 +446,13 @@ Item *create_load_file(Item* a)
}
-Item *create_func_cast(Item *a, Cast_target cast_type, int len, int dec,
+Item *create_func_cast(Item *a, Cast_target cast_type,
+ const char *c_len, const char *c_dec,
CHARSET_INFO *cs)
{
Item *res;
- int tmp_len;
+ ulong len;
+ uint dec;
LINT_INIT(res);
switch (cast_type) {
@@ -460,15 +463,18 @@ Item *create_func_cast(Item *a, Cast_target cast_type, int len, int dec,
case ITEM_CAST_TIME: res= new Item_time_typecast(a); break;
case ITEM_CAST_DATETIME: res= new Item_datetime_typecast(a); break;
case ITEM_CAST_DECIMAL:
- tmp_len= (len>0) ? len : 10;
- if (tmp_len < dec)
+ len= c_len ? atoi(c_len) : 0;
+ dec= c_dec ? atoi(c_dec) : 0;
+ my_decimal_trim(&len, &dec);
+ if (len < dec)
{
my_error(ER_M_BIGGER_THAN_D, MYF(0), "");
return 0;
}
- res= new Item_decimal_typecast(a, tmp_len, dec ? dec : 2);
+ res= new Item_decimal_typecast(a, len, dec);
break;
case ITEM_CAST_CHAR:
+ len= c_len ? atoi(c_len) : -1;
res= new Item_char_typecast(a, len, cs ? cs :
current_thd->variables.collation_connection);
break;
@@ -476,6 +482,7 @@ Item *create_func_cast(Item *a, Cast_target cast_type, int len, int dec,
return res;
}
+
Item *create_func_is_free_lock(Item* a)
{
current_thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
diff --git a/sql/item_create.h b/sql/item_create.h
index 2ff849263c6..46b209b3e49 100644
--- a/sql/item_create.h
+++ b/sql/item_create.h
@@ -27,7 +27,8 @@ Item *create_func_bit_length(Item* a);
Item *create_func_coercibility(Item* a);
Item *create_func_ceiling(Item* a);
Item *create_func_char_length(Item* a);
-Item *create_func_cast(Item *a, Cast_target cast_type, int len, int dec,
+Item *create_func_cast(Item *a, Cast_target cast_type,
+ const char *len, const char *dec,
CHARSET_INFO *cs);
Item *create_func_connection_id(void);
Item *create_func_conv(Item* a, Item *b, Item *c);
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 14a4c4dcf4b..580d19fbd4e 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -958,7 +958,8 @@ longlong Item_func_signed::val_int()
longlong value;
int error;
- if (args[0]->cast_to_int_type() != STRING_RESULT)
+ if (args[0]->cast_to_int_type() != STRING_RESULT ||
+ args[0]->result_as_longlong())
{
value= args[0]->val_int();
null_value= args[0]->null_value;
@@ -995,9 +996,12 @@ longlong Item_func_unsigned::val_int()
my_decimal tmp, *dec= args[0]->val_decimal(&tmp);
if (!(null_value= args[0]->null_value))
my_decimal2int(E_DEC_FATAL_ERROR, dec, 1, &value);
+ else
+ value= 0;
return value;
}
- else if (args[0]->cast_to_int_type() != STRING_RESULT)
+ else if (args[0]->cast_to_int_type() != STRING_RESULT ||
+ args[0]->result_as_longlong())
{
value= args[0]->val_int();
null_value= args[0]->null_value;
@@ -1048,18 +1052,61 @@ longlong Item_decimal_typecast::val_int()
my_decimal *Item_decimal_typecast::val_decimal(my_decimal *dec)
{
my_decimal tmp_buf, *tmp= args[0]->val_decimal(&tmp_buf);
+ bool sign;
+ uint precision;
+
if ((null_value= args[0]->null_value))
return NULL;
my_decimal_round(E_DEC_FATAL_ERROR, tmp, decimals, FALSE, dec);
+ sign= dec->sign();
+ if (unsigned_flag)
+ {
+ if (sign)
+ {
+ my_decimal_set_zero(dec);
+ goto err;
+ }
+ }
+ precision= my_decimal_length_to_precision(max_length,
+ decimals, unsigned_flag);
+ if (precision - decimals < (uint) my_decimal_intg(dec))
+ {
+ max_my_decimal(dec, precision, decimals);
+ dec->sign(sign);
+ goto err;
+ }
+ return dec;
+
+err:
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ ER_WARN_DATA_OUT_OF_RANGE,
+ ER(ER_WARN_DATA_OUT_OF_RANGE),
+ name, 1);
return dec;
}
void Item_decimal_typecast::print(String *str)
{
+ char len_buf[20*3 + 1];
+ char *end;
+
+ uint precision= my_decimal_length_to_precision(max_length, decimals,
+ unsigned_flag);
str->append(STRING_WITH_LEN("cast("));
args[0]->print(str);
- str->append(STRING_WITH_LEN(" as decimal)"));
+ str->append(STRING_WITH_LEN(" as decimal("));
+
+ end=int10_to_str(precision, len_buf,10);
+ str->append(len_buf, (uint32) (end - len_buf));
+
+ str->append(',');
+
+ end=int10_to_str(decimals, len_buf,10);
+ str->append(len_buf, (uint32) (end - len_buf));
+
+ str->append(')');
+ str->append(')');
}
@@ -1980,9 +2027,9 @@ double my_double_round(double value, longlong dec, bool dec_unsigned,
tmp=(abs_dec < array_elements(log_10) ?
log_10[abs_dec] : pow(10.0,(double) abs_dec));
- if (dec_negative && isinf(tmp))
+ if (dec_negative && my_isinf(tmp))
tmp2= 0;
- else if (!dec_negative && isinf(value * tmp))
+ else if (!dec_negative && my_isinf(value * tmp))
tmp2= value;
else if (truncate)
{
@@ -2161,6 +2208,7 @@ double Item_func_units::val_real()
void Item_func_min_max::fix_length_and_dec()
{
int max_int_part=0;
+ bool datetime_found= FALSE;
decimals=0;
max_length=0;
maybe_null=0;
@@ -2174,18 +2222,88 @@ void Item_func_min_max::fix_length_and_dec()
if (args[i]->maybe_null)
maybe_null=1;
cmp_type=item_cmp_type(cmp_type,args[i]->result_type());
+ if (args[i]->result_type() != ROW_RESULT && args[i]->is_datetime())
+ {
+ datetime_found= TRUE;
+ if (!datetime_item || args[i]->field_type() == MYSQL_TYPE_DATETIME)
+ datetime_item= args[i];
+ }
}
if (cmp_type == STRING_RESULT)
+ {
agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV, 1);
+ if (datetime_found)
+ {
+ thd= current_thd;
+ compare_as_dates= TRUE;
+ }
+ }
else if ((cmp_type == DECIMAL_RESULT) || (cmp_type == INT_RESULT))
max_length= my_decimal_precision_to_length(max_int_part+decimals, decimals,
unsigned_flag);
}
+/*
+ Compare item arguments in the DATETIME context.
+
+ SYNOPSIS
+ cmp_datetimes()
+ value [out] found least/greatest DATE/DATETIME value
+
+ DESCRIPTION
+ Compare item arguments as DATETIME values and return the index of the
+ least/greatest argument in the arguments array.
+ The correct integer DATE/DATETIME value of the found argument is
+ stored to the value pointer, if latter is provided.
+
+ RETURN
+ 0 If one of arguments is NULL
+ # index of the least/greatest argument
+*/
+
+uint Item_func_min_max::cmp_datetimes(ulonglong *value)
+{
+ ulonglong min_max;
+ uint min_max_idx= 0;
+ LINT_INIT(min_max);
+
+ for (uint i=0; i < arg_count ; i++)
+ {
+ Item **arg= args + i;
+ bool is_null;
+ ulonglong res= get_datetime_value(thd, &arg, 0, datetime_item, &is_null);
+ if ((null_value= args[i]->null_value))
+ return 0;
+ if (i == 0 || (res < min_max ? cmp_sign : -cmp_sign) > 0)
+ {
+ min_max= res;
+ min_max_idx= i;
+ }
+ }
+ if (value)
+ {
+ *value= min_max;
+ if (datetime_item->field_type() == MYSQL_TYPE_DATE)
+ *value/= 1000000L;
+ }
+ return min_max_idx;
+}
+
+
String *Item_func_min_max::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
+ if (compare_as_dates)
+ {
+ String *str_res;
+ uint min_max_idx= cmp_datetimes(NULL);
+ if (null_value)
+ return 0;
+ str_res= args[min_max_idx]->val_str(str);
+ str_res->set_charset(collation.collation);
+ return str_res;
+ }
switch (cmp_type) {
case INT_RESULT:
{
@@ -2253,6 +2371,12 @@ double Item_func_min_max::val_real()
{
DBUG_ASSERT(fixed == 1);
double value=0.0;
+ if (compare_as_dates)
+ {
+ ulonglong result= 0;
+ (void)cmp_datetimes(&result);
+ return (double)result;
+ }
for (uint i=0; i < arg_count ; i++)
{
if (i == 0)
@@ -2274,6 +2398,12 @@ longlong Item_func_min_max::val_int()
{
DBUG_ASSERT(fixed == 1);
longlong value=0;
+ if (compare_as_dates)
+ {
+ ulonglong result= 0;
+ (void)cmp_datetimes(&result);
+ return (longlong)result;
+ }
for (uint i=0; i < arg_count ; i++)
{
if (i == 0)
@@ -2297,6 +2427,13 @@ my_decimal *Item_func_min_max::val_decimal(my_decimal *dec)
my_decimal tmp_buf, *tmp, *res;
LINT_INIT(res);
+ if (compare_as_dates)
+ {
+ ulonglong value= 0;
+ (void)cmp_datetimes(&value);
+ ulonglong2decimal(value, dec);
+ return dec;
+ }
for (uint i=0; i < arg_count ; i++)
{
if (i == 0)
@@ -3926,8 +4063,8 @@ bool
Item_func_set_user_var::check(bool use_result_field)
{
DBUG_ENTER("Item_func_set_user_var::check");
- if (use_result_field)
- DBUG_ASSERT(result_field);
+ if (use_result_field && !result_field)
+ use_result_field= FALSE;
switch (cached_result_type) {
case REAL_RESULT:
@@ -4071,6 +4208,40 @@ my_decimal *Item_func_set_user_var::val_decimal(my_decimal *val)
}
+double Item_func_set_user_var::val_result()
+{
+ DBUG_ASSERT(fixed == 1);
+ check(TRUE);
+ update(); // Store expression
+ return entry->val_real(&null_value);
+}
+
+longlong Item_func_set_user_var::val_int_result()
+{
+ DBUG_ASSERT(fixed == 1);
+ check(TRUE);
+ update(); // Store expression
+ return entry->val_int(&null_value);
+}
+
+String *Item_func_set_user_var::str_result(String *str)
+{
+ DBUG_ASSERT(fixed == 1);
+ check(TRUE);
+ update(); // Store expression
+ return entry->val_str(&null_value, str, decimals);
+}
+
+
+my_decimal *Item_func_set_user_var::val_decimal_result(my_decimal *val)
+{
+ DBUG_ASSERT(fixed == 1);
+ check(TRUE);
+ update(); // Store expression
+ return entry->val_decimal(&null_value, val);
+}
+
+
void Item_func_set_user_var::print(String *str)
{
str->append(STRING_WITH_LEN("(@"));
@@ -4153,9 +4324,11 @@ void Item_func_set_user_var::make_field(Send_field *tmp_field)
TRUE Error
*/
-int Item_func_set_user_var::save_in_field(Field *field, bool no_conversions)
+int Item_func_set_user_var::save_in_field(Field *field, bool no_conversions,
+ bool can_use_result_field)
{
- bool use_result_field= (result_field && result_field != field);
+ bool use_result_field= (!can_use_result_field ? 0 :
+ (result_field && result_field != field));
int error;
/* Update the value of the user variable */
@@ -4315,7 +4488,7 @@ int get_var_with_binlog(THD *thd, enum_sql_command sql_command,
List<set_var_base> tmp_var_list;
LEX *sav_lex= thd->lex, lex_tmp;
thd->lex= &lex_tmp;
- lex_start(thd, NULL, 0);
+ lex_start(thd);
tmp_var_list.push_back(new set_var_user(new Item_func_set_user_var(name,
new Item_null())));
/* Create the variable */
@@ -5078,10 +5251,11 @@ Item_func_sp::func_name() const
{
THD *thd= current_thd;
/* Calculate length to avoid reallocation of string for sure */
- uint len= ((m_name->m_explicit_name ? m_name->m_db.length : 0 +
+ uint len= (((m_name->m_explicit_name ? m_name->m_db.length : 0) +
m_name->m_name.length)*2 + //characters*quoting
2 + // ` and `
- 1 + // .
+ (m_name->m_explicit_name ?
+ 3 : 0) + // '`', '`' and '.' for the db
1 + // end of string
ALIGN_SIZE(1)); // to avoid String reallocation
String qname((char *)alloc_root(thd->mem_root, len), len,
@@ -5212,6 +5386,8 @@ Item_func_sp::execute()
{
null_value= 1;
context->process_error(thd);
+ if (thd->killed)
+ thd->send_kill_message();
return TRUE;
}
diff --git a/sql/item_func.h b/sql/item_func.h
index 2d70f57d0e9..9a0201cb28b 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -147,11 +147,11 @@ public:
void count_only_length();
void count_real_length();
void count_decimal_length();
- inline bool get_arg0_date(TIME *ltime, uint fuzzy_date)
+ inline bool get_arg0_date(MYSQL_TIME *ltime, uint fuzzy_date)
{
return (null_value=args[0]->get_date(ltime, fuzzy_date));
}
- inline bool get_arg0_time(TIME *ltime)
+ inline bool get_arg0_time(MYSQL_TIME *ltime)
{
return (null_value=args[0]->get_time(ltime));
}
@@ -331,8 +331,8 @@ class Item_decimal_typecast :public Item_func
public:
Item_decimal_typecast(Item *a, int len, int dec) :Item_func(a)
{
- max_length= len + 2;
decimals= dec;
+ max_length= my_decimal_precision_to_length(len, dec, unsigned_flag);
}
String *val_str(String *str);
double val_real();
@@ -687,15 +687,24 @@ class Item_func_min_max :public Item_func
Item_result cmp_type;
String tmp_value;
int cmp_sign;
+ /* TRUE <=> arguments should be compared in the DATETIME context. */
+ bool compare_as_dates;
+ /* An item used for issuing warnings while string to DATETIME conversion. */
+ Item *datetime_item;
+ THD *thd;
+
public:
Item_func_min_max(List<Item> &list,int cmp_sign_arg) :Item_func(list),
- cmp_type(INT_RESULT), cmp_sign(cmp_sign_arg) {}
+ cmp_type(INT_RESULT), cmp_sign(cmp_sign_arg), compare_as_dates(FALSE),
+ datetime_item(0) {}
double val_real();
longlong val_int();
String *val_str(String *);
my_decimal *val_decimal(my_decimal *);
void fix_length_and_dec();
enum Item_result result_type () const { return cmp_type; }
+ bool result_as_longlong() { return compare_as_dates; };
+ uint cmp_datetimes(ulonglong *value);
};
class Item_func_min :public Item_func_min_max
@@ -1199,6 +1208,10 @@ public:
longlong val_int();
String *val_str(String *str);
my_decimal *val_decimal(my_decimal *);
+ double val_result();
+ longlong val_int_result();
+ String *str_result(String *str);
+ my_decimal *val_decimal_result(my_decimal *);
bool update_hash(void *ptr, uint length, enum Item_result type,
CHARSET_INFO *cs, Derivation dv, bool unsigned_arg);
bool send(Protocol *protocol, String *str_arg);
@@ -1211,7 +1224,13 @@ public:
void print(String *str);
void print_as_stmt(String *str);
const char *func_name() const { return "set_user_var"; }
- int save_in_field(Field *field, bool no_conversions);
+ int save_in_field(Field *field, bool no_conversions,
+ bool can_use_result_field);
+ int save_in_field(Field *field, bool no_conversions)
+ {
+ return save_in_field(field, no_conversions, 1);
+ }
+ void save_org_in_field(Field *field) { (void)save_in_field(field, 1, 0); }
};
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index b3744d6eb96..3f4ba16a18d 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -775,6 +775,11 @@ bool Item_in_subselect::val_bool()
if (exec())
{
reset();
+ /*
+ Must mark the IN predicate as NULL so as to make sure an enclosing NOT
+ predicate will return FALSE. See the comments in
+ subselect_uniquesubquery_engine::copy_ref_key for further details.
+ */
null_value= 1;
return 0;
}
@@ -1774,6 +1779,21 @@ int subselect_single_select_engine::exec()
thd->lex->current_select= save_select;
DBUG_RETURN(join->error ? join->error : 1);
}
+ if (!select_lex->uncacheable && thd->lex->describe &&
+ !(join->select_options & SELECT_DESCRIBE) &&
+ join->need_tmp && item->const_item())
+ {
+ /*
+ Force join->join_tmp creation, because this subquery will be replaced
+ by a simple select from the materialization temp table by optimize()
+ called by EXPLAIN and we need to preserve the initial query structure
+ so we can display it.
+ */
+ select_lex->uncacheable|= UNCACHEABLE_EXPLAIN;
+ select_lex->master_unit()->uncacheable|= UNCACHEABLE_EXPLAIN;
+ if (join->init_save_join_tab())
+ DBUG_RETURN(1); /* purecov: inspected */
+ }
if (item->engine_changed)
{
DBUG_RETURN(1);
@@ -1814,6 +1834,8 @@ int subselect_single_select_engine::exec()
if (cond_guard && !*cond_guard)
{
/* Change the access method to full table scan */
+ tab->save_read_first_record= tab->read_first_record;
+ tab->save_read_record= tab->read_record.read_record;
tab->read_first_record= init_read_record_seq;
tab->read_record.record= tab->table->record[0];
tab->read_record.thd= join->thd;
@@ -1834,8 +1856,8 @@ int subselect_single_select_engine::exec()
JOIN_TAB *tab= *ptab;
tab->read_record.record= 0;
tab->read_record.ref_length= 0;
- tab->read_first_record= join_read_always_key_or_null;
- tab->read_record.read_record= join_read_next_same_or_null;
+ tab->read_first_record= tab->save_read_first_record;
+ tab->read_record.read_record= tab->save_read_record;
}
executed= 1;
thd->where= save_where;
@@ -1919,10 +1941,38 @@ int subselect_uniquesubquery_engine::scan_table()
DESCRIPTION
Copy ref key and check for null parts in it.
+ Depending on the nullability and conversion problems this function
+ recognizes and processes the following states :
+ 1. Partial match on top level. This means IN has a value of FALSE
+ regardless of the data in the subquery table.
+ Detected by finding a NULL in the left IN operand of a top level
+ expression.
+ We may actually skip reading the subquery, so return TRUE to skip
+ the table scan in subselect_uniquesubquery_engine::exec and make
+ the value of the IN predicate a NULL (that is equal to FALSE on
+ top level).
+ 2. No exact match when IN is nested inside another predicate.
+ Detected by finding a NULL in the left IN operand when IN is not
+ a top level predicate.
+ We cannot have an exact match. But we must proceed further with a
+ table scan to find out if it's a partial match (and IN has a value
+ of NULL) or no match (and IN has a value of FALSE).
+ So we return FALSE to continue with the scan and see if there are
+ any record that would constitute a partial match (as we cannot
+ determine that from the index).
+ 3. Error converting the left IN operand to the column type of the
+ right IN operand. This counts as no match (and IN has the value of
+ FALSE). We mark the subquery table cursor as having no more rows
+ (to ensure that the processing that follows will not find a match)
+ and return FALSE, so IN is not treated as returning NULL.
+
RETURN
- FALSE - ok, index lookup key without keys copied.
- TRUE - an error occured while copying the key
+ FALSE - The value of the IN predicate is not known. Proceed to find the
+ value of the IN predicate using the determined values of
+ null_keypart and table->status.
+ TRUE - IN predicate has a value of NULL. Stop the processing right there
+ and return NULL to the outer predicates.
*/
bool subselect_uniquesubquery_engine::copy_ref_key()
@@ -1942,13 +1992,37 @@ bool subselect_uniquesubquery_engine::copy_ref_key()
function.
*/
null_keypart= (*copy)->null_key;
- bool top_level= ((Item_in_subselect *) item)->is_top_level_item();
- if (null_keypart && !top_level)
- break;
- if ((tab->ref.key_err) & 1 || (null_keypart && top_level))
+ if (null_keypart)
{
+ bool top_level= ((Item_in_subselect *) item)->is_top_level_item();
+ if (top_level)
+ {
+ /* Partial match on top level */
+ DBUG_RETURN(1);
+ }
+ else
+ {
+ /* No exact match when IN is nested inside another predicate */
+ break;
+ }
+ }
+
+ /*
+ Check if the error is equal to STORE_KEY_FATAL. This is not expressed
+ using the store_key::store_key_result enum because ref.key_err is a
+ boolean and we want to detect both TRUE and STORE_KEY_FATAL from the
+ space of the union of the values of [TRUE, FALSE] and
+ store_key::store_key_result.
+ TODO: fix the variable an return types.
+ */
+ if (tab->ref.key_err & 1)
+ {
+ /*
+ Error converting the left IN operand to the column type of the right
+ IN operand.
+ */
tab->table->status= STATUS_NOT_FOUND;
- DBUG_RETURN(1);
+ break;
}
}
DBUG_RETURN(0);
@@ -1991,10 +2065,20 @@ int subselect_uniquesubquery_engine::exec()
int error;
TABLE *table= tab->table;
empty_result_set= TRUE;
+ table->status= 0;
/* TODO: change to use of 'full_scan' here? */
if (copy_ref_key())
DBUG_RETURN(1);
+ if (table->status)
+ {
+ /*
+ We know that there will be no rows even if we scan.
+ Can be set in copy_ref_key.
+ */
+ ((Item_in_subselect *) item)->value= 0;
+ DBUG_RETURN(0);
+ }
if (null_keypart)
DBUG_RETURN(scan_table());
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 4579ecd48ae..ea2a14ffb63 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -432,7 +432,7 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table,
2-byte lenght.
*/
if (max_length/collation.collation->mbmaxlen > 255 &&
- convert_blob_length < UINT_MAX16 && convert_blob_length)
+ convert_blob_length <= Field_varstring::MAX_SIZE && convert_blob_length)
return new Field_varstring(convert_blob_length, maybe_null,
name, table,
collation.collation);
@@ -3269,14 +3269,20 @@ bool Item_func_group_concat::setup(THD *thd)
tmp_table_param->force_copy_fields= force_copy_fields;
DBUG_ASSERT(table == 0);
/*
+ Currently we have to force conversion of BLOB values to VARCHAR's
+ if we are to store them in TREE objects used for ORDER BY and
+ DISTINCT. This leads to truncation if the BLOB's size exceeds
+ Field_varstring::MAX_SIZE.
+ */
+ if (arg_count_order > 0 || distinct)
+ set_if_smaller(tmp_table_param->convert_blob_length,
+ Field_varstring::MAX_SIZE);
+ /*
We have to create a temporary table to get descriptions of fields
(types, sizes and so on).
Note that in the table, we first have the ORDER BY fields, then the
field list.
-
- We need to set set_sum_field in true for storing value of blob in buffer
- of a record instead of a pointer of one.
*/
if (!(table= create_tmp_table(thd, tmp_table_param, all_fields,
(ORDER*) 0, 0, TRUE,
@@ -3339,6 +3345,10 @@ String* Item_func_group_concat::val_str(String* str)
DBUG_ASSERT(fixed == 1);
if (null_value)
return 0;
+ if (!result.length() && tree)
+ /* Tree is used for sorting as in ORDER BY */
+ tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this,
+ left_root_right);
if (count_cut_values && !warning)
{
/*
@@ -3350,11 +3360,6 @@ String* Item_func_group_concat::val_str(String* str)
ER_CUT_VALUE_GROUP_CONCAT,
ER(ER_CUT_VALUE_GROUP_CONCAT));
}
- if (result.length())
- return &result;
- if (tree)
- tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this,
- left_root_right);
return &result;
}
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 194fb6445fa..9aabd068d25 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -46,7 +46,7 @@
the microseconds twice.
*/
-static bool make_datetime(date_time_format_types format, TIME *ltime,
+static bool make_datetime(date_time_format_types format, MYSQL_TIME *ltime,
String *str)
{
char *buff;
@@ -95,7 +95,7 @@ static bool make_datetime(date_time_format_types format, TIME *ltime,
/*
- Wrapper over make_datetime() with validation of the input TIME value
+ Wrapper over make_datetime() with validation of the input MYSQL_TIME value
NOTE
see make_datetime() for more information
@@ -105,7 +105,7 @@ static bool make_datetime(date_time_format_types format, TIME *ltime,
0 otherwise
*/
-static bool make_datetime_with_warn(date_time_format_types format, TIME *ltime,
+static bool make_datetime_with_warn(date_time_format_types format, MYSQL_TIME *ltime,
String *str)
{
int warning= 0;
@@ -117,14 +117,15 @@ static bool make_datetime_with_warn(date_time_format_types format, TIME *ltime,
if (!warning)
return 0;
- make_truncated_value_warning(current_thd, str->ptr(), str->length(),
+ make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ str->ptr(), str->length(),
MYSQL_TIMESTAMP_TIME, NullS);
return make_datetime(format, ltime, str);
}
/*
- Wrapper over make_time() with validation of the input TIME value
+ Wrapper over make_time() with validation of the input MYSQL_TIME value
NOTE
see make_time() for more info
@@ -135,7 +136,7 @@ static bool make_datetime_with_warn(date_time_format_types format, TIME *ltime,
*/
static bool make_time_with_warn(const DATE_TIME_FORMAT *format,
- TIME *l_time, String *str)
+ MYSQL_TIME *l_time, String *str)
{
int warning= 0;
make_time(format, l_time, str);
@@ -143,7 +144,8 @@ static bool make_time_with_warn(const DATE_TIME_FORMAT *format,
return 1;
if (warning)
{
- make_truncated_value_warning(current_thd, str->ptr(), str->length(),
+ make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ str->ptr(), str->length(),
MYSQL_TIMESTAMP_TIME, NullS);
make_time(format, l_time, str);
}
@@ -153,16 +155,16 @@ static bool make_time_with_warn(const DATE_TIME_FORMAT *format,
/*
- Convert seconds to TIME value with overflow checking
+ Convert seconds to MYSQL_TIME value with overflow checking
SYNOPSIS:
sec_to_time()
seconds number of seconds
unsigned_flag 1, if 'seconds' is unsigned, 0, otherwise
- ltime output TIME value
+ ltime output MYSQL_TIME value
DESCRIPTION
- If the 'seconds' argument is inside TIME data range, convert it to a
+ If the 'seconds' argument is inside MYSQL_TIME data range, convert it to a
corresponding value.
Otherwise, truncate the resulting value to the nearest endpoint, and
produce a warning message.
@@ -172,7 +174,7 @@ static bool make_time_with_warn(const DATE_TIME_FORMAT *format,
0 otherwise
*/
-static bool sec_to_time(longlong seconds, bool unsigned_flag, TIME *ltime)
+static bool sec_to_time(longlong seconds, bool unsigned_flag, MYSQL_TIME *ltime)
{
uint sec;
@@ -205,7 +207,8 @@ overflow:
char buf[22];
int len= (int)(longlong10_to_str(seconds, buf, unsigned_flag ? 10 : -10)
- buf);
- make_truncated_value_warning(current_thd, buf, len, MYSQL_TIMESTAMP_TIME,
+ make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ buf, len, MYSQL_TIMESTAMP_TIME,
NullS);
return 1;
@@ -224,7 +227,7 @@ static DATE_TIME_FORMAT time_24hrs_format= {{0}, '\0', 0,
{(char *)"%H:%i:%S", 8}};
/*
- Extract datetime value to TIME struct from string value
+ Extract datetime value to MYSQL_TIME struct from string value
according to format string.
SYNOPSIS
@@ -257,7 +260,7 @@ static DATE_TIME_FORMAT time_24hrs_format= {{0}, '\0', 0,
*/
static bool extract_date_time(DATE_TIME_FORMAT *format,
- const char *val, uint length, TIME *l_time,
+ const char *val, uint length, MYSQL_TIME *l_time,
timestamp_type cached_timestamp_type,
const char **sub_pattern_end,
const char *date_time_type)
@@ -305,13 +308,15 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
case 'Y':
tmp= (char*) val + min(4, val_len);
l_time->year= (int) my_strtoll10(val, &tmp, &error);
+ if ((int) (tmp-val) <= 2)
+ l_time->year= year_2000_handling(l_time->year);
val= tmp;
break;
case 'y':
tmp= (char*) val + min(2, val_len);
l_time->year= (int) my_strtoll10(val, &tmp, &error);
val= tmp;
- l_time->year+= (l_time->year < YY_PART_YEAR ? 2000 : 1900);
+ l_time->year= year_2000_handling(l_time->year);
break;
/* Month */
@@ -514,7 +519,8 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
if (yearday > 0)
{
- uint days= calc_daynr(l_time->year,1,1) + yearday - 1;
+ uint days;
+ days= calc_daynr(l_time->year,1,1) + yearday - 1;
if (days <= 0 || days > MAX_DAY_NUMBER)
goto err;
get_date_from_daynr(days,&l_time->year,&l_time->month,&l_time->day);
@@ -576,7 +582,8 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
{
if (!my_isspace(&my_charset_latin1,*val))
{
- make_truncated_value_warning(current_thd, val_begin, length,
+ make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ val_begin, length,
cached_timestamp_type, NullS);
break;
}
@@ -600,7 +607,7 @@ err:
Create a formated date/time value in a string
*/
-bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
+bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
timestamp_type type, String *str)
{
char intbuff[15];
@@ -915,8 +922,8 @@ static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
*/
-static bool calc_time_diff(TIME *l_time1, TIME *l_time2, int l_sign,
- longlong *seconds_out, long *microseconds_out)
+bool calc_time_diff(MYSQL_TIME *l_time1, MYSQL_TIME *l_time2, int l_sign,
+ longlong *seconds_out, long *microseconds_out)
{
long days;
bool neg;
@@ -996,7 +1003,7 @@ longlong Item_func_period_diff::val_int()
longlong Item_func_to_days::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (get_arg0_date(&ltime, TIME_NO_ZERO_DATE))
return 0;
return (longlong) calc_daynr(ltime.year,ltime.month,ltime.day);
@@ -1005,7 +1012,7 @@ longlong Item_func_to_days::val_int()
longlong Item_func_dayofyear::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (get_arg0_date(&ltime,TIME_NO_ZERO_DATE))
return 0;
return (longlong) calc_daynr(ltime.year,ltime.month,ltime.day) -
@@ -1015,7 +1022,7 @@ longlong Item_func_dayofyear::val_int()
longlong Item_func_dayofmonth::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
(void) get_arg0_date(&ltime, TIME_FUZZY_DATE);
return (longlong) ltime.day;
}
@@ -1023,7 +1030,7 @@ longlong Item_func_dayofmonth::val_int()
longlong Item_func_month::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
(void) get_arg0_date(&ltime, TIME_FUZZY_DATE);
return (longlong) ltime.month;
}
@@ -1053,7 +1060,7 @@ String* Item_func_monthname::val_str(String* str)
longlong Item_func_quarter::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (get_arg0_date(&ltime, TIME_FUZZY_DATE))
return 0;
return (longlong) ((ltime.month+2)/3);
@@ -1062,7 +1069,7 @@ longlong Item_func_quarter::val_int()
longlong Item_func_hour::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
(void) get_arg0_time(&ltime);
return ltime.hour;
}
@@ -1070,7 +1077,7 @@ longlong Item_func_hour::val_int()
longlong Item_func_minute::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
(void) get_arg0_time(&ltime);
return ltime.minute;
}
@@ -1079,7 +1086,7 @@ longlong Item_func_minute::val_int()
longlong Item_func_second::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
(void) get_arg0_time(&ltime);
return ltime.second;
}
@@ -1126,7 +1133,7 @@ longlong Item_func_week::val_int()
{
DBUG_ASSERT(fixed == 1);
uint year;
- TIME ltime;
+ MYSQL_TIME ltime;
if (get_arg0_date(&ltime, TIME_NO_ZERO_DATE))
return 0;
return (longlong) calc_week(&ltime,
@@ -1139,7 +1146,7 @@ longlong Item_func_yearweek::val_int()
{
DBUG_ASSERT(fixed == 1);
uint year,week;
- TIME ltime;
+ MYSQL_TIME ltime;
if (get_arg0_date(&ltime, TIME_NO_ZERO_DATE))
return 0;
week= calc_week(&ltime,
@@ -1152,7 +1159,7 @@ longlong Item_func_yearweek::val_int()
longlong Item_func_weekday::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (get_arg0_date(&ltime, TIME_NO_ZERO_DATE))
return 0;
@@ -1182,7 +1189,7 @@ String* Item_func_dayname::val_str(String* str)
longlong Item_func_year::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
(void) get_arg0_date(&ltime, TIME_FUZZY_DATE);
return (longlong) ltime.year;
}
@@ -1190,7 +1197,7 @@ longlong Item_func_year::val_int()
longlong Item_func_unix_timestamp::val_int()
{
- TIME ltime;
+ MYSQL_TIME ltime;
my_bool not_used;
DBUG_ASSERT(fixed == 1);
@@ -1221,7 +1228,7 @@ longlong Item_func_unix_timestamp::val_int()
longlong Item_func_time_to_sec::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
longlong seconds;
(void) get_arg0_time(&ltime);
seconds=ltime.hour*3600L+ltime.minute*60+ltime.second;
@@ -1390,7 +1397,7 @@ static bool get_interval_value(Item *args,interval_type int_type,
String *Item_date::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (get_date(&ltime, TIME_FUZZY_DATE))
return (String *) 0;
if (str->alloc(11))
@@ -1406,19 +1413,19 @@ String *Item_date::val_str(String *str)
longlong Item_date::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (get_date(&ltime, TIME_FUZZY_DATE))
return 0;
return (longlong) (ltime.year*10000L+ltime.month*100+ltime.day);
}
-bool Item_func_from_days::get_date(TIME *ltime, uint fuzzy_date)
+bool Item_func_from_days::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
{
longlong value=args[0]->val_int();
if ((null_value=args[0]->null_value))
return 1;
- bzero(ltime, sizeof(TIME));
+ bzero(ltime, sizeof(MYSQL_TIME));
get_date_from_daynr((long) value, &ltime->year, &ltime->month, &ltime->day);
ltime->time_type= MYSQL_TIMESTAMP_DATE;
return 0;
@@ -1452,10 +1459,10 @@ String *Item_func_curdate::val_str(String *str)
}
/*
- Converts current time in my_time_t to TIME represenatation for local
+ Converts current time in my_time_t to MYSQL_TIME represenatation for local
time zone. Defines time zone (local) used for whole CURDATE function.
*/
-void Item_func_curdate_local::store_now_in_TIME(TIME *now_time)
+void Item_func_curdate_local::store_now_in_TIME(MYSQL_TIME *now_time)
{
THD *thd= current_thd;
thd->variables.time_zone->gmt_sec_to_TIME(now_time,
@@ -1465,10 +1472,10 @@ void Item_func_curdate_local::store_now_in_TIME(TIME *now_time)
/*
- Converts current time in my_time_t to TIME represenatation for UTC
+ Converts current time in my_time_t to MYSQL_TIME represenatation for UTC
time zone. Defines time zone (UTC) used for whole UTC_DATE function.
*/
-void Item_func_curdate_utc::store_now_in_TIME(TIME *now_time)
+void Item_func_curdate_utc::store_now_in_TIME(MYSQL_TIME *now_time)
{
my_tz_UTC->gmt_sec_to_TIME(now_time,
(my_time_t)(current_thd->query_start()));
@@ -1479,7 +1486,7 @@ void Item_func_curdate_utc::store_now_in_TIME(TIME *now_time)
}
-bool Item_func_curdate::get_date(TIME *res,
+bool Item_func_curdate::get_date(MYSQL_TIME *res,
uint fuzzy_date __attribute__((unused)))
{
*res=ltime;
@@ -1497,7 +1504,7 @@ String *Item_func_curtime::val_str(String *str)
void Item_func_curtime::fix_length_and_dec()
{
- TIME ltime;
+ MYSQL_TIME ltime;
decimals= DATETIME_DEC;
collation.set(&my_charset_bin);
@@ -1509,10 +1516,10 @@ void Item_func_curtime::fix_length_and_dec()
/*
- Converts current time in my_time_t to TIME represenatation for local
+ Converts current time in my_time_t to MYSQL_TIME represenatation for local
time zone. Defines time zone (local) used for whole CURTIME function.
*/
-void Item_func_curtime_local::store_now_in_TIME(TIME *now_time)
+void Item_func_curtime_local::store_now_in_TIME(MYSQL_TIME *now_time)
{
THD *thd= current_thd;
thd->variables.time_zone->gmt_sec_to_TIME(now_time,
@@ -1522,10 +1529,10 @@ void Item_func_curtime_local::store_now_in_TIME(TIME *now_time)
/*
- Converts current time in my_time_t to TIME represenatation for UTC
+ Converts current time in my_time_t to MYSQL_TIME represenatation for UTC
time zone. Defines time zone (UTC) used for whole UTC_TIME function.
*/
-void Item_func_curtime_utc::store_now_in_TIME(TIME *now_time)
+void Item_func_curtime_utc::store_now_in_TIME(MYSQL_TIME *now_time)
{
my_tz_UTC->gmt_sec_to_TIME(now_time,
(my_time_t)(current_thd->query_start()));
@@ -1558,10 +1565,10 @@ void Item_func_now::fix_length_and_dec()
/*
- Converts current time in my_time_t to TIME represenatation for local
+ Converts current time in my_time_t to MYSQL_TIME represenatation for local
time zone. Defines time zone (local) used for whole NOW function.
*/
-void Item_func_now_local::store_now_in_TIME(TIME *now_time)
+void Item_func_now_local::store_now_in_TIME(MYSQL_TIME *now_time)
{
THD *thd= current_thd;
thd->variables.time_zone->gmt_sec_to_TIME(now_time,
@@ -1571,10 +1578,10 @@ void Item_func_now_local::store_now_in_TIME(TIME *now_time)
/*
- Converts current time in my_time_t to TIME represenatation for UTC
+ Converts current time in my_time_t to MYSQL_TIME represenatation for UTC
time zone. Defines time zone (UTC) used for whole UTC_TIMESTAMP function.
*/
-void Item_func_now_utc::store_now_in_TIME(TIME *now_time)
+void Item_func_now_utc::store_now_in_TIME(MYSQL_TIME *now_time)
{
my_tz_UTC->gmt_sec_to_TIME(now_time,
(my_time_t)(current_thd->query_start()));
@@ -1585,7 +1592,7 @@ void Item_func_now_utc::store_now_in_TIME(TIME *now_time)
}
-bool Item_func_now::get_date(TIME *res,
+bool Item_func_now::get_date(MYSQL_TIME *res,
uint fuzzy_date __attribute__((unused)))
{
*res= ltime;
@@ -1602,10 +1609,10 @@ int Item_func_now::save_in_field(Field *to, bool no_conversions)
/*
- Converts current time in my_time_t to TIME represenatation for local
+ Converts current time in my_time_t to MYSQL_TIME represenatation for local
time zone. Defines time zone (local) used for whole SYSDATE function.
*/
-void Item_func_sysdate_local::store_now_in_TIME(TIME *now_time)
+void Item_func_sysdate_local::store_now_in_TIME(MYSQL_TIME *now_time)
{
THD *thd= current_thd;
thd->variables.time_zone->gmt_sec_to_TIME(now_time, (my_time_t) time(NULL));
@@ -1647,7 +1654,7 @@ void Item_func_sysdate_local::fix_length_and_dec()
}
-bool Item_func_sysdate_local::get_date(TIME *res,
+bool Item_func_sysdate_local::get_date(MYSQL_TIME *res,
uint fuzzy_date __attribute__((unused)))
{
store_now_in_TIME(&ltime);
@@ -1668,7 +1675,7 @@ int Item_func_sysdate_local::save_in_field(Field *to, bool no_conversions)
String *Item_func_sec_to_time::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
longlong arg_val= args[0]->val_int();
if ((null_value=args[0]->null_value) || str->alloc(19))
@@ -1687,7 +1694,7 @@ String *Item_func_sec_to_time::val_str(String *str)
longlong Item_func_sec_to_time::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
longlong arg_val= args[0]->val_int();
if ((null_value=args[0]->null_value))
@@ -1829,7 +1836,7 @@ uint Item_func_date_format::format_length(const String *format)
String *Item_func_date_format::val_str(String *str)
{
String *format;
- TIME l_time;
+ MYSQL_TIME l_time;
uint size;
DBUG_ASSERT(fixed == 1);
@@ -1892,7 +1899,7 @@ void Item_func_from_unixtime::fix_length_and_dec()
String *Item_func_from_unixtime::val_str(String *str)
{
- TIME time_tmp;
+ MYSQL_TIME time_tmp;
DBUG_ASSERT(fixed == 1);
@@ -1912,7 +1919,7 @@ String *Item_func_from_unixtime::val_str(String *str)
longlong Item_func_from_unixtime::val_int()
{
- TIME time_tmp;
+ MYSQL_TIME time_tmp;
DBUG_ASSERT(fixed == 1);
@@ -1922,7 +1929,7 @@ longlong Item_func_from_unixtime::val_int()
return (longlong) TIME_to_ulonglong_datetime(&time_tmp);
}
-bool Item_func_from_unixtime::get_date(TIME *ltime,
+bool Item_func_from_unixtime::get_date(MYSQL_TIME *ltime,
uint fuzzy_date __attribute__((unused)))
{
ulonglong tmp= (ulonglong)(args[0]->val_int());
@@ -1963,7 +1970,7 @@ Item_func_convert_tz::fix_fields(THD *thd_arg, Item **ref)
String *Item_func_convert_tz::val_str(String *str)
{
- TIME time_tmp;
+ MYSQL_TIME time_tmp;
if (get_date(&time_tmp, 0))
return 0;
@@ -1981,7 +1988,7 @@ String *Item_func_convert_tz::val_str(String *str)
longlong Item_func_convert_tz::val_int()
{
- TIME time_tmp;
+ MYSQL_TIME time_tmp;
if (get_date(&time_tmp, 0))
return 0;
@@ -1990,7 +1997,7 @@ longlong Item_func_convert_tz::val_int()
}
-bool Item_func_convert_tz::get_date(TIME *ltime,
+bool Item_func_convert_tz::get_date(MYSQL_TIME *ltime,
uint fuzzy_date __attribute__((unused)))
{
my_time_t my_time_tmp;
@@ -2051,7 +2058,7 @@ void Item_date_add_interval::fix_length_and_dec()
- If first arg is a MYSQL_TYPE_DATE and the interval type uses hours,
minutes or seconds then type is MYSQL_TYPE_DATETIME.
- Otherwise the result is MYSQL_TYPE_STRING
- (This is because you can't know if the string contains a DATE, TIME or
+ (This is because you can't know if the string contains a DATE, MYSQL_TIME or
DATETIME argument)
*/
cached_field_type= MYSQL_TYPE_STRING;
@@ -2071,7 +2078,7 @@ void Item_date_add_interval::fix_length_and_dec()
/* Here arg[1] is a Item_interval object */
-bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
+bool Item_date_add_interval::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
{
long period,sign;
INTERVAL interval;
@@ -2173,27 +2180,6 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
default:
goto null_date;
}
-
- /* Adjust cached_field_type according to the detected type. */
- if (cached_field_type == MYSQL_TYPE_STRING)
- {
- switch (ltime->time_type)
- {
- case MYSQL_TIMESTAMP_DATE:
- cached_field_type= MYSQL_TYPE_DATE;
- break;
- case MYSQL_TIMESTAMP_DATETIME:
- cached_field_type= MYSQL_TYPE_DATETIME;
- break;
- case MYSQL_TIMESTAMP_TIME:
- cached_field_type= MYSQL_TYPE_TIME;
- break;
- default:
- /* Shouldn't get here. */
- DBUG_ASSERT(0);
- break;
- }
- }
return 0; // Ok
invalid_date:
@@ -2209,7 +2195,7 @@ invalid_date:
String *Item_date_add_interval::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
enum date_time_format_types format;
if (Item_date_add_interval::get_date(&ltime, TIME_NO_ZERO_DATE))
@@ -2233,7 +2219,7 @@ String *Item_date_add_interval::val_str(String *str)
longlong Item_date_add_interval::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
longlong date;
if (Item_date_add_interval::get_date(&ltime, TIME_NO_ZERO_DATE))
return (longlong) 0;
@@ -2322,7 +2308,7 @@ void Item_extract::fix_length_and_dec()
longlong Item_extract::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
uint year;
ulong week_format;
long neg;
@@ -2574,7 +2560,7 @@ void Item_char_typecast::fix_length_and_dec()
String *Item_datetime_typecast::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (!get_arg0_date(&ltime, TIME_FUZZY_DATE) &&
!make_datetime(ltime.second_part ? DATE_TIME_MICROSECOND : DATE_TIME,
&ltime, str))
@@ -2588,7 +2574,7 @@ String *Item_datetime_typecast::val_str(String *str)
longlong Item_datetime_typecast::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (get_arg0_date(&ltime,1))
{
null_value= 1;
@@ -2599,7 +2585,7 @@ longlong Item_datetime_typecast::val_int()
}
-bool Item_time_typecast::get_time(TIME *ltime)
+bool Item_time_typecast::get_time(MYSQL_TIME *ltime)
{
bool res= get_arg0_time(ltime);
/*
@@ -2615,7 +2601,7 @@ bool Item_time_typecast::get_time(TIME *ltime)
longlong Item_time_typecast::val_int()
{
- TIME ltime;
+ MYSQL_TIME ltime;
if (get_time(&ltime))
{
null_value= 1;
@@ -2627,7 +2613,7 @@ longlong Item_time_typecast::val_int()
String *Item_time_typecast::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (!get_arg0_time(&ltime) &&
!make_datetime(ltime.second_part ? TIME_MICROSECOND : TIME_ONLY,
@@ -2639,7 +2625,7 @@ String *Item_time_typecast::val_str(String *str)
}
-bool Item_date_typecast::get_date(TIME *ltime, uint fuzzy_date)
+bool Item_date_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
{
bool res= get_arg0_date(ltime, TIME_FUZZY_DATE);
ltime->hour= ltime->minute= ltime->second= ltime->second_part= 0;
@@ -2651,7 +2637,7 @@ bool Item_date_typecast::get_date(TIME *ltime, uint fuzzy_date)
String *Item_date_typecast::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (!get_arg0_date(&ltime, TIME_FUZZY_DATE) && !str->alloc(11))
{
@@ -2666,7 +2652,7 @@ String *Item_date_typecast::val_str(String *str)
longlong Item_date_typecast::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (args[0]->get_date(&ltime, TIME_FUZZY_DATE))
{
null_value= 1;
@@ -2678,21 +2664,29 @@ longlong Item_date_typecast::val_int()
/*
MAKEDATE(a,b) is a date function that creates a date value
from a year and day value.
+
+ NOTES:
+ As arguments are integers, we can't know if the year is a 2 digit or 4 digit year.
+ In this case we treat all years < 100 as 2 digit years. Ie, this is not safe
+ for dates between 0000-01-01 and 0099-12-31
*/
String *Item_func_makedate::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
- TIME l_time;
+ MYSQL_TIME l_time;
long daynr= (long) args[1]->val_int();
- long yearnr= (long) args[0]->val_int();
+ long year= (long) args[0]->val_int();
long days;
if (args[0]->null_value || args[1]->null_value ||
- yearnr < 0 || daynr <= 0)
+ year < 0 || daynr <= 0)
goto err;
- days= calc_daynr(yearnr,1,1) + daynr - 1;
+ if (year < 100)
+ year= year_2000_handling(year);
+
+ days= calc_daynr(year,1,1) + daynr - 1;
/* Day number from year 0 to 9999-12-31 */
if (days >= 0 && days <= MAX_DAY_NUMBER)
{
@@ -2710,19 +2704,32 @@ err:
}
+/*
+ MAKEDATE(a,b) is a date function that creates a date value
+ from a year and day value.
+
+ NOTES:
+ As arguments are integers, we can't know if the year is a 2 digit or 4 digit year.
+ In this case we treat all years < 100 as 2 digit years. Ie, this is not safe
+ for dates between 0000-01-01 and 0099-12-31
+*/
+
longlong Item_func_makedate::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME l_time;
+ MYSQL_TIME l_time;
long daynr= (long) args[1]->val_int();
- long yearnr= (long) args[0]->val_int();
+ long year= (long) args[0]->val_int();
long days;
if (args[0]->null_value || args[1]->null_value ||
- yearnr < 0 || daynr <= 0)
+ year < 0 || daynr <= 0)
goto err;
- days= calc_daynr(yearnr,1,1) + daynr - 1;
+ if (year < 100)
+ year= year_2000_handling(year);
+
+ days= calc_daynr(year,1,1) + daynr - 1;
/* Day number from year 0 to 9999-12-31 */
if (days >= 0 && days < MAX_DAY_NUMBER)
{
@@ -2777,7 +2784,7 @@ void Item_func_add_time::fix_length_and_dec()
String *Item_func_add_time::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
- TIME l_time1, l_time2, l_time3;
+ MYSQL_TIME l_time1, l_time2, l_time3;
bool is_time= 0;
long days, microseconds;
longlong seconds;
@@ -2879,7 +2886,7 @@ String *Item_func_timediff::val_str(String *str)
longlong seconds;
long microseconds;
int l_sign= 1;
- TIME l_time1 ,l_time2, l_time3;
+ MYSQL_TIME l_time1 ,l_time2, l_time3;
null_value= 0;
if (args[0]->get_time(&l_time1) ||
@@ -2924,7 +2931,7 @@ null_date:
String *Item_func_maketime::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
bool overflow= 0;
longlong hour= args[0]->val_int();
@@ -2968,7 +2975,8 @@ String *Item_func_maketime::val_str(String *str)
char *ptr= longlong10_to_str(hour, buf, args[0]->unsigned_flag ? 10 : -10);
int len = (int)(ptr - buf) +
my_sprintf(ptr, (ptr, ":%02u:%02u", (uint)minute, (uint)second));
- make_truncated_value_warning(current_thd, buf, len, MYSQL_TIMESTAMP_TIME,
+ make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ buf, len, MYSQL_TIMESTAMP_TIME,
NullS);
}
@@ -2992,7 +3000,7 @@ String *Item_func_maketime::val_str(String *str)
longlong Item_func_microsecond::val_int()
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (!get_arg0_time(&ltime))
return ltime.second_part;
return 0;
@@ -3001,7 +3009,7 @@ longlong Item_func_microsecond::val_int()
longlong Item_func_timestamp_diff::val_int()
{
- TIME ltime1, ltime2;
+ MYSQL_TIME ltime1, ltime2;
longlong seconds;
long microseconds;
long months= 0;
@@ -3319,7 +3327,7 @@ void Item_func_str_to_date::fix_length_and_dec()
}
}
-bool Item_func_str_to_date::get_date(TIME *ltime, uint fuzzy_date)
+bool Item_func_str_to_date::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
{
DATE_TIME_FORMAT date_time_format;
char val_buff[64], format_buff[64];
@@ -3360,7 +3368,7 @@ null_date:
String *Item_func_str_to_date::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
- TIME ltime;
+ MYSQL_TIME ltime;
if (Item_func_str_to_date::get_date(&ltime, TIME_FUZZY_DATE))
return 0;
@@ -3373,7 +3381,7 @@ String *Item_func_str_to_date::val_str(String *str)
}
-bool Item_func_last_day::get_date(TIME *ltime, uint fuzzy_date)
+bool Item_func_last_day::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
{
if (get_arg0_date(ltime, fuzzy_date & ~TIME_FUZZY_DATE) ||
(ltime->month == 0))
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 14ceb8dcb28..8e925a0156f 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -432,9 +432,9 @@ public:
/*
Abstract method that defines which time zone is used for conversion.
Converts time current time in my_time_t representation to broken-down
- TIME representation using UTC-SYSTEM or per-thread time zone.
+ MYSQL_TIME representation using UTC-SYSTEM or per-thread time zone.
*/
- virtual void store_now_in_TIME(TIME *now_time)=0;
+ virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0;
bool result_as_longlong() { return TRUE; }
};
@@ -445,7 +445,7 @@ public:
Item_func_curtime_local() :Item_func_curtime() {}
Item_func_curtime_local(Item *a) :Item_func_curtime(a) {}
const char *func_name() const { return "curtime"; }
- virtual void store_now_in_TIME(TIME *now_time);
+ virtual void store_now_in_TIME(MYSQL_TIME *now_time);
};
@@ -455,7 +455,7 @@ public:
Item_func_curtime_utc() :Item_func_curtime() {}
Item_func_curtime_utc(Item *a) :Item_func_curtime(a) {}
const char *func_name() const { return "utc_time"; }
- virtual void store_now_in_TIME(TIME *now_time);
+ virtual void store_now_in_TIME(MYSQL_TIME *now_time);
};
@@ -464,14 +464,14 @@ public:
class Item_func_curdate :public Item_date
{
longlong value;
- TIME ltime;
+ MYSQL_TIME ltime;
public:
Item_func_curdate() :Item_date() {}
longlong val_int() { DBUG_ASSERT(fixed == 1); return (value) ; }
String *val_str(String *str);
void fix_length_and_dec();
- bool get_date(TIME *res, uint fuzzy_date);
- virtual void store_now_in_TIME(TIME *now_time)=0;
+ bool get_date(MYSQL_TIME *res, uint fuzzy_date);
+ virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0;
};
@@ -480,7 +480,7 @@ class Item_func_curdate_local :public Item_func_curdate
public:
Item_func_curdate_local() :Item_func_curdate() {}
const char *func_name() const { return "curdate"; }
- void store_now_in_TIME(TIME *now_time);
+ void store_now_in_TIME(MYSQL_TIME *now_time);
};
@@ -489,7 +489,7 @@ class Item_func_curdate_utc :public Item_func_curdate
public:
Item_func_curdate_utc() :Item_func_curdate() {}
const char *func_name() const { return "utc_date"; }
- void store_now_in_TIME(TIME *now_time);
+ void store_now_in_TIME(MYSQL_TIME *now_time);
};
@@ -501,7 +501,7 @@ protected:
longlong value;
char buff[20*2+32]; // +32 to make my_snprintf_{8bit|ucs2} happy
uint buff_length;
- TIME ltime;
+ MYSQL_TIME ltime;
public:
Item_func_now() :Item_date_func() {}
Item_func_now(Item *a) :Item_date_func(a) {}
@@ -510,8 +510,8 @@ public:
int save_in_field(Field *to, bool no_conversions);
String *val_str(String *str);
void fix_length_and_dec();
- bool get_date(TIME *res, uint fuzzy_date);
- virtual void store_now_in_TIME(TIME *now_time)=0;
+ bool get_date(MYSQL_TIME *res, uint fuzzy_date);
+ virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0;
};
@@ -521,7 +521,7 @@ public:
Item_func_now_local() :Item_func_now() {}
Item_func_now_local(Item *a) :Item_func_now(a) {}
const char *func_name() const { return "now"; }
- virtual void store_now_in_TIME(TIME *now_time);
+ virtual void store_now_in_TIME(MYSQL_TIME *now_time);
virtual enum Functype functype() const { return NOW_FUNC; }
};
@@ -532,7 +532,7 @@ public:
Item_func_now_utc() :Item_func_now() {}
Item_func_now_utc(Item *a) :Item_func_now(a) {}
const char *func_name() const { return "utc_timestamp"; }
- virtual void store_now_in_TIME(TIME *now_time);
+ virtual void store_now_in_TIME(MYSQL_TIME *now_time);
};
@@ -547,13 +547,13 @@ public:
Item_func_sysdate_local(Item *a) :Item_func_now(a) {}
bool const_item() const { return 0; }
const char *func_name() const { return "sysdate"; }
- void store_now_in_TIME(TIME *now_time);
+ void store_now_in_TIME(MYSQL_TIME *now_time);
double val_real();
longlong val_int();
int save_in_field(Field *to, bool no_conversions);
String *val_str(String *str);
void fix_length_and_dec();
- bool get_date(TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, uint fuzzy_date);
void update_used_tables()
{
Item_func_now::update_used_tables();
@@ -567,7 +567,7 @@ class Item_func_from_days :public Item_date
public:
Item_func_from_days(Item *a) :Item_date(a) {}
const char *func_name() const { return "from_days"; }
- bool get_date(TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, uint fuzzy_date);
};
@@ -597,7 +597,7 @@ class Item_func_from_unixtime :public Item_date_func
String *val_str(String *str);
const char *func_name() const { return "from_unixtime"; }
void fix_length_and_dec();
- bool get_date(TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, uint fuzzy_date);
};
@@ -635,7 +635,7 @@ class Item_func_convert_tz :public Item_date_func
const char *func_name() const { return "convert_tz"; }
bool fix_fields(THD *, Item **);
void fix_length_and_dec();
- bool get_date(TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, uint fuzzy_date);
void cleanup();
};
@@ -694,7 +694,7 @@ public:
void fix_length_and_dec();
enum_field_types field_type() const { return cached_field_type; }
longlong val_int();
- bool get_date(TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, uint fuzzy_date);
bool eq(const Item *item, bool binary_cmp) const;
void print(String *str);
};
@@ -778,7 +778,7 @@ public:
Item_date_typecast(Item *a) :Item_typecast_maybe_null(a) {}
const char *func_name() const { return "cast_as_date"; }
String *val_str(String *str);
- bool get_date(TIME *ltime, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *ltime, uint fuzzy_date);
const char *cast_type() const { return "date"; }
enum_field_types field_type() const { return MYSQL_TYPE_DATE; }
Field *tmp_table_field(TABLE *t_arg)
@@ -812,7 +812,7 @@ public:
Item_time_typecast(Item *a) :Item_typecast_maybe_null(a) {}
const char *func_name() const { return "cast_as_time"; }
String *val_str(String *str);
- bool get_time(TIME *ltime);
+ bool get_time(MYSQL_TIME *ltime);
const char *cast_type() const { return "time"; }
enum_field_types field_type() const { return MYSQL_TYPE_TIME; }
Field *tmp_table_field(TABLE *t_arg)
@@ -1033,7 +1033,7 @@ public:
:Item_str_func(a, b)
{}
String *val_str(String *str);
- bool get_date(TIME *ltime, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *ltime, uint fuzzy_date);
const char *func_name() const { return "str_to_date"; }
enum_field_types field_type() const { return cached_field_type; }
void fix_length_and_dec();
@@ -1046,5 +1046,5 @@ class Item_func_last_day :public Item_date
public:
Item_func_last_day(Item *a) :Item_date(a) {}
const char *func_name() const { return "last_day"; }
- bool get_date(TIME *res, uint fuzzy_date);
+ bool get_date(MYSQL_TIME *res, uint fuzzy_date);
};
diff --git a/sql/lock.cc b/sql/lock.cc
index 233d12d9cc4..9298b33b4d2 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -853,7 +853,6 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list)
TABLE *table;
char key[MAX_DBKEY_LENGTH];
char *db= table_list->db;
- int table_in_key_offset;
uint key_length;
HASH_SEARCH_STATE state;
DBUG_ENTER("lock_table_name");
@@ -861,10 +860,8 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list)
safe_mutex_assert_owner(&LOCK_open);
- table_in_key_offset= strmov(key, db) - key + 1;
- key_length= (uint)(strmov(key + table_in_key_offset, table_list->table_name)
- - key) + 1;
-
+ key_length= (uint)(strmov(strmov(key, db) + 1, table_list->table_name) -
+ key) + 1;
/* Only insert the table if we haven't insert it already */
for (table=(TABLE*) hash_first(&open_cache, (byte*)key, key_length, &state);
@@ -873,29 +870,11 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list)
if (table->in_use == thd)
DBUG_RETURN(0);
- /*
- Create a table entry with the right key and with an old refresh version
- Note that we must use my_malloc() here as this is freed by the table
- cache
- */
- if (!(table= (TABLE*) my_malloc(sizeof(*table)+key_length,
- MYF(MY_WME | MY_ZEROFILL))))
- DBUG_RETURN(-1);
- table->s= &table->share_not_to_be_used;
- memcpy((table->s->table_cache_key= (char*) (table+1)), key, key_length);
- table->s->db= table->s->table_cache_key;
- table->s->table_name= table->s->table_cache_key + table_in_key_offset;
- table->s->key_length=key_length;
- table->in_use=thd;
- table->locked_by_name=1;
- table_list->table=table;
-
- if (my_hash_insert(&open_cache, (byte*) table))
- {
- my_free((gptr) table,MYF(0));
+ if (!(table= table_cache_insert_placeholder(thd, key, key_length)))
DBUG_RETURN(-1);
- }
-
+
+ table_list->table= table;
+
/* Return 1 if table is in use */
DBUG_RETURN(test(remove_table_from_cache(thd, db, table_list->table_name,
RTFC_NO_FLAG)));
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 8bb63e72bde..6eb247488b0 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1279,20 +1279,31 @@ Query_log_event::Query_log_event()
/*
- Query_log_event::Query_log_event()
+ SYNOPSIS
+ Query_log_event::Query_log_event()
+ thd - thread handle
+ query_arg - array of char representing the query
+ query_length - size of the `query_arg' array
+ using_trans - there is a modified transactional table
+ suppress_use - suppress the generation of 'USE' statements
+ killed_status_arg - an optional with default to THD::KILLED_NO_VALUE
+ if the value is different from the default, the arg
+ is set to the current thd->killed value.
+ A caller might need to masquerade thd->killed with
+ THD::NOT_KILLED.
+ DESCRIPTION
+ Creates an event for binlogging
+ The value for local `killed_status' can be supplied by caller.
*/
Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
ulong query_length, bool using_trans,
- bool suppress_use)
+ bool suppress_use, THD::killed_state killed_status_arg)
:Log_event(thd_arg,
((thd_arg->tmp_table_used ? LOG_EVENT_THREAD_SPECIFIC_F : 0)
| (suppress_use ? LOG_EVENT_SUPPRESS_USE_F : 0)),
using_trans),
data_buf(0), query(query_arg), catalog(thd_arg->catalog),
db(thd_arg->db), q_len((uint32) query_length),
- error_code((thd_arg->killed != THD::NOT_KILLED) ?
- ((thd_arg->system_thread & SYSTEM_THREAD_DELAYED_INSERT) ?
- 0 : thd->killed_errno()) : thd_arg->net.last_errno),
thread_id(thd_arg->thread_id),
/* save the original thread id; we already know the server id */
slave_proxy_id(thd_arg->variables.pseudo_thread_id),
@@ -1304,6 +1315,14 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
charset_database_number(0)
{
time_t end_time;
+
+ if (killed_status_arg == THD::KILLED_NO_VALUE)
+ killed_status_arg= thd_arg->killed;
+ error_code=
+ (killed_status_arg == THD::NOT_KILLED) ? thd_arg->net.last_errno :
+ ((thd_arg->system_thread & SYSTEM_THREAD_DELAYED_INSERT) ? 0 :
+ thd->killed_errno());
+
time(&end_time);
exec_time = (ulong) (end_time - thd->start_time);
catalog_len = (catalog) ? (uint32) strlen(catalog) : 0;
@@ -1879,7 +1898,8 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli,
thd->variables.collation_database= thd->db_charset;
/* Execute the query (note that we bypass dispatch_command()) */
- mysql_parse(thd, thd->query, thd->query_length);
+ const char* found_semicolon= NULL;
+ mysql_parse(thd, thd->query, thd->query_length, &found_semicolon);
}
else
@@ -2987,10 +3007,12 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli,
thd->query_error= 0;
clear_all_errors(thd, rli);
/*
- Usually mysql_init_query() is called by mysql_parse(), but we need it here
+ Usually lex_start() is called by mysql_parse(), but we need it here
as the present method does not call mysql_parse().
*/
- mysql_init_query(thd, 0, 0);
+ lex_start(thd);
+ mysql_reset_thd_for_next_command(thd);
+
if (!use_rli_only_for_errors)
{
/* Saved for InnoDB, see comment in Query_log_event::exec_event() */
diff --git a/sql/log_event.h b/sql/log_event.h
index a1e7adb6487..04aac5d08fc 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -804,7 +804,8 @@ public:
#ifndef MYSQL_CLIENT
Query_log_event(THD* thd_arg, const char* query_arg, ulong query_length,
- bool using_trans, bool suppress_use);
+ bool using_trans, bool suppress_use,
+ THD::killed_state killed_err_arg= THD::KILLED_NO_VALUE);
const char* get_db() { return db; }
#ifdef HAVE_REPLICATION
void pack_info(Protocol* protocol);
diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc
index 0ef1f9794ba..4ef2ae5cf95 100644
--- a/sql/my_decimal.cc
+++ b/sql/my_decimal.cc
@@ -191,7 +191,7 @@ int str2my_decimal(uint mask, const char *from, uint length,
}
-my_decimal *date2my_decimal(TIME *ltime, my_decimal *dec)
+my_decimal *date2my_decimal(MYSQL_TIME *ltime, my_decimal *dec)
{
longlong date;
date = (ltime->year*100L + ltime->month)*100L + ltime->day;
diff --git a/sql/my_decimal.h b/sql/my_decimal.h
index 45270150d22..c661579ea66 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -36,13 +36,17 @@ C_MODE_END
/* maximum length of buffer in our big digits (uint32) */
#define DECIMAL_BUFF_LENGTH 9
+
+/* the number of digits that my_decimal can possibly contain */
+#define DECIMAL_MAX_POSSIBLE_PRECISION (DECIMAL_BUFF_LENGTH * 9)
+
/*
maximum guaranteed precision of number in decimal digits (number of our
digits * number of decimal digits in one our big digit - number of decimal
- digits in one our big digit decreased on 1 (because we always put decimal
+ digits in one our big digit decreased by 1 (because we always put decimal
point on the border of our big digits))
*/
-#define DECIMAL_MAX_PRECISION ((DECIMAL_BUFF_LENGTH * 9) - 8*2)
+#define DECIMAL_MAX_PRECISION (DECIMAL_MAX_POSSIBLE_PRECISION - 8*2)
#define DECIMAL_MAX_SCALE 30
#define DECIMAL_NOT_SPECIFIED 31
@@ -50,7 +54,7 @@ C_MODE_END
maximum length of string representation (number of maximum decimal
digits + 1 position for sign + 1 position for decimal point)
*/
-#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_PRECISION + 2)
+#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_POSSIBLE_PRECISION + 2)
/*
maximum size of packet length
*/
@@ -296,7 +300,7 @@ int string2my_decimal(uint mask, const String *str, my_decimal *d)
}
-my_decimal *date2my_decimal(TIME *ltime, my_decimal *dec);
+my_decimal *date2my_decimal(MYSQL_TIME *ltime, my_decimal *dec);
#endif /*defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY) */
@@ -387,5 +391,25 @@ int my_decimal_cmp(const my_decimal *a, const my_decimal *b)
return decimal_cmp((decimal_t*) a, (decimal_t*) b);
}
+
+inline
+int my_decimal_intg(const my_decimal *a)
+{
+ return decimal_intg((decimal_t*) a);
+}
+
+
+inline
+void my_decimal_trim(ulong *precision, uint *scale)
+{
+ if (!(*precision) && !(*scale))
+ {
+ *precision= 10;
+ *scale= 0;
+ return;
+ }
+}
+
+
#endif /*my_decimal_h*/
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 7ab683134e0..0aaa1744fe1 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -89,9 +89,6 @@ void kill_one_thread(THD *thd, ulong id, bool only_kill_query);
bool net_request_file(NET* net, const char* fname);
char* query_table_status(THD *thd,const char *db,const char *table_name);
-void net_set_write_timeout(NET *net, uint timeout);
-void net_set_read_timeout(NET *net, uint timeout);
-
#define x_free(A) { my_free((gptr) (A),MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); }
#define safeFree(x) { if(x) { my_free((gptr) x,MYF(0)); x = NULL; } }
#define PREV_BITS(type,A) ((type) (((type) 1 << (A)) -1))
@@ -179,7 +176,7 @@ MY_LOCALE *my_locale_by_number(uint number);
#define STACK_MIN_SIZE 12000 // Abort if less stack during eval.
#define STACK_MIN_SIZE_FOR_OPEN 1024*80
-#define STACK_BUFF_ALLOC 256 // For stack overrun checks
+#define STACK_BUFF_ALLOC 352 // For stack overrun checks
#ifndef MYSQLD_NET_RETRY_COUNT
#define MYSQLD_NET_RETRY_COUNT 10 // Abort read after this many int.
#endif
@@ -640,6 +637,8 @@ struct Query_cache_query_flags
ulong sql_mode;
ulong max_sort_length;
ulong group_concat_max_len;
+ ulong default_week_format;
+ ulong div_precision_increment;
MY_LOCALE *lc_time_names;
};
#define QUERY_CACHE_FLAGS_SIZE sizeof(Query_cache_query_flags)
@@ -674,6 +673,8 @@ struct Query_cache_query_flags
#define query_cache_invalidate_by_MyISAM_filename_ref NULL
#endif /*HAVE_QUERY_CACHE*/
+uint build_table_path(char *buff, size_t bufflen, const char *db,
+ const char *table, const char *ext);
bool mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create, bool silent);
bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create);
bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent);
@@ -694,13 +695,15 @@ bool do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db,
bool skip_error);
bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name,
bool force_switch);
-void mysql_parse(THD *thd,char *inBuf,uint length);
+
+void mysql_parse(THD *thd, const char *inBuf, uint length,
+ const char ** semicolon);
+
bool mysql_test_parse_for_slave(THD *thd,char *inBuf,uint length);
bool is_update_query(enum enum_sql_command command);
bool alloc_query(THD *thd, const char *packet, uint packet_length);
void mysql_init_select(LEX *lex);
void mysql_reset_thd_for_next_command(THD *thd);
-void mysql_init_query(THD *thd, uchar *buf, uint length);
bool mysql_new_select(LEX *lex, bool move_down);
void create_select_for_variable(const char *var_name);
void mysql_init_multi_delete(LEX *lex);
@@ -810,9 +813,8 @@ bool mysql_alter_table(THD *thd, char *new_db, char *new_name,
Alter_info *alter_info,
uint order_num, ORDER *order, bool ignore);
bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list);
-bool mysql_create_like_table(THD *thd, TABLE_LIST *table,
- HA_CREATE_INFO *create_info,
- Table_ident *src_table);
+bool mysql_create_like_table(THD *thd, TABLE_LIST *table, TABLE_LIST *src_table,
+ HA_CREATE_INFO *create_info);
bool mysql_rename_table(enum db_type base,
const char *old_db,
const char * old_name,
@@ -854,12 +856,14 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create);
TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type update);
TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT* mem,
bool *refresh, uint flags);
-bool reopen_name_locked_table(THD* thd, TABLE_LIST* table);
+bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list, bool link_in);
+TABLE *table_cache_insert_placeholder(THD *thd, const char *key,
+ uint key_length);
+bool table_cache_has_open_placeholder(THD *thd, const char *db,
+ const char *table_name);
TABLE *find_locked_table(THD *thd, const char *db,const char *table_name);
bool reopen_table(TABLE *table,bool locked);
bool reopen_tables(THD *thd,bool get_locks,bool in_refresh);
-void close_old_data_files(THD *thd, TABLE *table, bool abort_locks,
- bool send_refresh);
bool close_data_tables(THD *thd,const char *db, const char *table_name);
bool wait_for_tables(THD *thd);
bool table_is_used(TABLE *table, bool wait_for_name_lock);
@@ -1015,6 +1019,8 @@ void add_join_natural(TABLE_LIST *a,TABLE_LIST *b,List<String> *using_fields,
SELECT_LEX *lex);
bool add_proc_to_list(THD *thd, Item *item);
TABLE *unlink_open_table(THD *thd,TABLE *list,TABLE *find);
+void drop_open_table(THD *thd, TABLE *table, const char *db_name,
+ const char *table_name);
void update_non_unique_table_error(TABLE_LIST *update,
const char *operation,
TABLE_LIST *duplicate);
@@ -1262,12 +1268,10 @@ extern char language[FN_REFLEN], reg_ext[FN_EXTLEN];
extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN];
extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file;
extern char log_error_file[FN_REFLEN], *opt_tc_log_file;
-extern double log_10[32];
-extern double log_01[32];
extern ulonglong log_10_int[20];
extern ulonglong keybuff_size;
extern ulonglong thd_startup_options;
-extern ulong refresh_version,flush_version, thread_id;
+extern ulong flush_version, thread_id;
extern ulong binlog_cache_use, binlog_cache_disk_use;
extern ulong aborted_threads,aborted_connects;
extern ulong delayed_insert_timeout;
@@ -1441,7 +1445,7 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **table, uint count,
#define MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK 0x0001
#define MYSQL_LOCK_IGNORE_FLUSH 0x0002
#define MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN 0x0004
-#define MYSQL_OPEN_IGNORE_LOCKED_TABLES 0x0008
+#define MYSQL_OPEN_TEMPORARY_ONLY 0x0008
void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock);
void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock);
@@ -1500,16 +1504,22 @@ ulong convert_period_to_month(ulong period);
ulong convert_month_to_period(ulong month);
void get_date_from_daynr(long daynr,uint *year, uint *month,
uint *day);
-my_time_t TIME_to_timestamp(THD *thd, const TIME *t, my_bool *not_exist);
-bool str_to_time_with_warn(const char *str,uint length,TIME *l_time);
+my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, my_bool *not_exist);
+bool str_to_time_with_warn(const char *str,uint length,MYSQL_TIME *l_time);
timestamp_type str_to_datetime_with_warn(const char *str, uint length,
- TIME *l_time, uint flags);
-void localtime_to_TIME(TIME *to, struct tm *from);
-void calc_time_from_sec(TIME *to, long seconds, long microseconds);
+ MYSQL_TIME *l_time, uint flags);
+void localtime_to_TIME(MYSQL_TIME *to, struct tm *from);
+void calc_time_from_sec(MYSQL_TIME *to, long seconds, long microseconds);
+
+void make_truncated_value_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
+ const char *str_val,
+ uint str_length, timestamp_type time_type,
+ const char *field_name);
+
+bool date_add_interval(MYSQL_TIME *ltime, interval_type int_type, INTERVAL interval);
+bool calc_time_diff(MYSQL_TIME *l_time1, MYSQL_TIME *l_time2, int l_sign,
+ longlong *seconds_out, long *microseconds_out);
-void make_truncated_value_warning(THD *thd, const char *str_val,
- uint str_length, timestamp_type time_type,
- const char *field_name);
extern DATE_TIME_FORMAT *date_time_format_make(timestamp_type format_type,
const char *format_str,
uint format_length);
@@ -1517,14 +1527,16 @@ extern DATE_TIME_FORMAT *date_time_format_copy(THD *thd,
DATE_TIME_FORMAT *format);
const char *get_date_time_format_str(KNOWN_DATE_TIME_FORMAT *format,
timestamp_type type);
-extern bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
+extern bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
timestamp_type type, String *str);
-void make_datetime(const DATE_TIME_FORMAT *format, const TIME *l_time,
+void make_datetime(const DATE_TIME_FORMAT *format, const MYSQL_TIME *l_time,
String *str);
-void make_date(const DATE_TIME_FORMAT *format, const TIME *l_time,
+void make_date(const DATE_TIME_FORMAT *format, const MYSQL_TIME *l_time,
String *str);
-void make_time(const DATE_TIME_FORMAT *format, const TIME *l_time,
+void make_time(const DATE_TIME_FORMAT *format, const MYSQL_TIME *l_time,
String *str);
+ulonglong get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
+ Item *warn_item, bool *is_null);
int test_if_number(char *str,int *res,bool allow_wildcards);
void change_byte(byte *,uint,char,char);
@@ -1543,7 +1555,7 @@ double my_double_round(double value, longlong dec, bool dec_unsigned,
bool truncate);
int get_quick_record(SQL_SELECT *select);
int calc_weekday(long daynr,bool sunday_first_day_of_week);
-uint calc_week(TIME *l_time, uint week_behaviour, uint *year);
+uint calc_week(MYSQL_TIME *l_time, uint week_behaviour, uint *year);
void find_date(char *pos,uint *vek,uint flag);
TYPELIB *convert_strings_to_array_type(my_string *typelibs, my_string *end);
TYPELIB *typelib(MEM_ROOT *mem_root, List<String> &strings);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index b7f00afbcd2..2d45a24f0ee 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -349,7 +349,15 @@ bool opt_endinfo, using_udf_functions;
my_bool locked_in_memory;
bool opt_using_transactions, using_update_log;
bool volatile abort_loop;
-bool volatile shutdown_in_progress, grant_option;
+bool volatile shutdown_in_progress;
+/**
+ @brief 'grant_option' is used to indicate if privileges needs
+ to be checked, in which case the lock, LOCK_grant, is used
+ to protect access to the grant table.
+ @note This flag is dropped in 5.1
+ @see grant_init()
+ */
+bool volatile grant_option;
my_bool opt_skip_slave_start = 0; // If set, slave is not autostarted
my_bool opt_reckless_slave = 0;
@@ -437,8 +445,6 @@ ulong slow_launch_threads = 0, sync_binlog_period;
ulong expire_logs_days = 0;
ulong rpl_recovery_rank=0;
-double log_10[32]; /* 10 potences */
-double log_01[32];
time_t server_start_time;
char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];
@@ -2160,6 +2166,16 @@ later when used with nscd), disable LDAP in your nsswitch.conf, or use a\n\
mysqld that is not statically linked.\n");
#endif
+#ifdef HAVE_NPTL
+ if (thd_lib_detected == THD_LIB_LT && !getenv("LD_ASSUME_KERNEL"))
+ fprintf(stderr,"\n\
+You are running a statically-linked LinuxThreads binary on an NPTL system.\n\
+This can result in crashes on some distributions due to LT/NPTL conflicts.\n\
+You should either build a dynamically-linked binary, or force LinuxThreads\n\
+to be used with the LD_ASSUME_KERNEL environment variable. Please consult\n\
+the documentation for your distribution on how to do that.\n");
+#endif
+
if (locked_in_memory)
{
fprintf(stderr, "\n\
@@ -3586,6 +3602,11 @@ we force server id to 2, but this MySQL server will not act as a slave.");
freopen(log_error_file,"a+",stderr);
FreeConsole(); // Remove window
}
+ else
+ {
+ /* Don't show error dialog box when on foreground: it stops the server */
+ SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
+ }
#endif
/*
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index a635d058cd5..c56e9c0b073 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -609,10 +609,10 @@ net_real_write(NET *net,const char *packet,ulong len)
#ifndef NO_ALARM
thr_alarm_init(&alarmed);
if (net_blocking)
- thr_alarm(&alarmed,(uint) net->write_timeout,&alarm_buff);
+ thr_alarm(&alarmed, net->write_timeout, &alarm_buff);
#else
alarmed=0;
- /* Write timeout is set in net_set_write_timeout */
+ /* Write timeout is set in my_net_set_write_timeout */
#endif /* NO_ALARM */
pos=(char*) packet; end=pos+len;
@@ -624,7 +624,7 @@ net_real_write(NET *net,const char *packet,ulong len)
#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2))
if ((interrupted || length==0) && !thr_alarm_in_use(&alarmed))
{
- if (!thr_alarm(&alarmed,(uint) net->write_timeout,&alarm_buff))
+ if (!thr_alarm(&alarmed, net->write_timeout, &alarm_buff))
{ /* Always true for client */
my_bool old_mode;
while (vio_blocking(net->vio, TRUE, &old_mode) < 0)
@@ -805,7 +805,7 @@ my_real_read(NET *net, ulong *complen)
if (net_blocking)
thr_alarm(&alarmed,net->read_timeout,&alarm_buff);
#else
- /* Read timeout is set in net_set_read_timeout */
+ /* Read timeout is set in my_net_set_read_timeout */
#endif /* NO_ALARM */
pos = net->buff + net->where_b; /* net->packet -4 */
@@ -1117,25 +1117,27 @@ my_net_read(NET *net)
}
-void net_set_read_timeout(NET *net, uint timeout)
+void my_net_set_read_timeout(NET *net, uint timeout)
{
- DBUG_ENTER("net_set_read_timeout");
+ DBUG_ENTER("my_net_set_read_timeout");
DBUG_PRINT("enter", ("timeout: %d", timeout));
net->read_timeout= timeout;
#ifdef NO_ALARM
- vio_timeout(net->vio, 0, timeout);
+ if (net->vio)
+ vio_timeout(net->vio, 0, timeout);
#endif
DBUG_VOID_RETURN;
}
-void net_set_write_timeout(NET *net, uint timeout)
+void my_net_set_write_timeout(NET *net, uint timeout)
{
- DBUG_ENTER("net_set_write_timeout");
+ DBUG_ENTER("my_net_set_write_timeout");
DBUG_PRINT("enter", ("timeout: %d", timeout));
net->write_timeout= timeout;
#ifdef NO_ALARM
- vio_timeout(net->vio, 1, timeout);
+ if (net->vio)
+ vio_timeout(net->vio, 1, timeout);
#endif
DBUG_VOID_RETURN;
}
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 9222e15ff91..b9de54dbf5c 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -206,12 +206,68 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
if (!ref.key_length)
error= table->file->index_first(table->record[0]);
- else
- error= table->file->index_read(table->record[0],key_buff,
- ref.key_length,
- range_fl & NEAR_MIN ?
- HA_READ_AFTER_KEY :
- HA_READ_KEY_OR_NEXT);
+ else
+ {
+ /*
+ Use index to replace MIN/MAX functions with their values
+ according to the following rules:
+
+ 1) Insert the minimum non-null values where the WHERE clause still
+ matches, or
+ 2) a NULL value if there are only NULL values for key_part_k.
+ 3) Fail, producing a row of nulls
+
+ Implementation: Read the smallest value using the search key. If
+ the interval is open, read the next value after the search
+ key. If read fails, and we're looking for a MIN() value for a
+ nullable column, test if there is an exact match for the key.
+ */
+ if (!(range_fl & NEAR_MIN))
+ /*
+ Closed interval: Either The MIN argument is non-nullable, or
+ we have a >= predicate for the MIN argument.
+ */
+ error= table->file->index_read(table->record[0], ref.key_buff,
+ ref.key_length,
+ HA_READ_KEY_OR_NEXT);
+ else
+ {
+ /*
+ Open interval: There are two cases:
+ 1) We have only MIN() and the argument column is nullable, or
+ 2) there is a > predicate on it, nullability is irrelevant.
+ We need to scan the next bigger record first.
+ */
+ error= table->file->index_read(table->record[0], ref.key_buff,
+ ref.key_length, HA_READ_AFTER_KEY);
+ /*
+ If the found record is outside the group formed by the search
+ prefix, or there is no such record at all, check if all
+ records in that group have NULL in the MIN argument
+ column. If that is the case return that NULL.
+
+ Check if case 1 from above holds. If it does, we should read
+ the skipped tuple.
+ */
+ if (ref.key_buff[prefix_len] == 1 &&
+ /*
+ Last keypart (i.e. the argument to MIN) is set to NULL by
+ find_key_for_maxmin only if all other keyparts are bound
+ to constants in a conjunction of equalities. Hence, we
+ can detect this by checking only if the last keypart is
+ NULL.
+ */
+ (error == HA_ERR_KEY_NOT_FOUND ||
+ key_cmp_if_same(table, ref.key_buff, ref.key, prefix_len)))
+ {
+ DBUG_ASSERT(item_field->field->real_maybe_null());
+ error= table->file->index_read(table->record[0], ref.key_buff,
+ ref.key_length,
+ HA_READ_KEY_EXACT);
+ }
+ }
+ }
+ /* Verify that the read tuple indeed matches the search key */
if (!error && reckey_in_range(0, &ref, item_field->field,
conds, range_fl, prefix_len))
error= HA_ERR_KEY_NOT_FOUND;
@@ -739,14 +795,24 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
if (!max_fl && key_part_used == key_part_to_use && part->null_bit)
{
/*
- SELECT MIN(key_part2) FROM t1 WHERE key_part1=const
- If key_part2 may be NULL, then we want to find the first row
- that is not null
+ The query is on this form:
+
+ SELECT MIN(key_part_k)
+ FROM t1
+ WHERE key_part_1 = const and ... and key_part_k-1 = const
+
+ If key_part_k is nullable, we want to find the first matching row
+ where key_part_k is not null. The key buffer is now {const, ...,
+ NULL}. This will be passed to the handler along with a flag
+ indicating open interval. If a tuple is read that does not match
+ these search criteria, an attempt will be made to read an exact
+ match for the key buffer.
*/
+ /* Set the first byte of key_part_k to 1, that means NULL */
ref->key_buff[ref->key_length]= 1;
ref->key_length+= part->store_length;
*range_fl&= ~NO_MIN_RANGE;
- *range_fl|= NEAR_MIN; // > NULL
+ *range_fl|= NEAR_MIN; // Open interval
}
/*
The following test is false when the key in the key tree is
diff --git a/sql/protocol.cc b/sql/protocol.cc
index f9ba734a48d..ced6d78519a 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -948,7 +948,7 @@ bool Protocol_simple::store(Field *field)
*/
-bool Protocol_simple::store(TIME *tm)
+bool Protocol_simple::store(MYSQL_TIME *tm)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
@@ -971,7 +971,7 @@ bool Protocol_simple::store(TIME *tm)
}
-bool Protocol_simple::store_date(TIME *tm)
+bool Protocol_simple::store_date(MYSQL_TIME *tm)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
@@ -990,7 +990,7 @@ bool Protocol_simple::store_date(TIME *tm)
we support 0-6 decimals for time.
*/
-bool Protocol_simple::store_time(TIME *tm)
+bool Protocol_simple::store_time(MYSQL_TIME *tm)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
@@ -1162,7 +1162,7 @@ bool Protocol_prep::store(Field *field)
}
-bool Protocol_prep::store(TIME *tm)
+bool Protocol_prep::store(MYSQL_TIME *tm)
{
char buff[12],*pos;
uint length;
@@ -1188,7 +1188,7 @@ bool Protocol_prep::store(TIME *tm)
return packet->append(buff, length+1, PACKET_BUFFER_EXTRA_ALLOC);
}
-bool Protocol_prep::store_date(TIME *tm)
+bool Protocol_prep::store_date(MYSQL_TIME *tm)
{
tm->hour= tm->minute= tm->second=0;
tm->second_part= 0;
@@ -1196,7 +1196,7 @@ bool Protocol_prep::store_date(TIME *tm)
}
-bool Protocol_prep::store_time(TIME *tm)
+bool Protocol_prep::store_time(MYSQL_TIME *tm)
{
char buff[13], *pos;
uint length;
diff --git a/sql/protocol.h b/sql/protocol.h
index 0e00a7c21e0..f8e7f490d1b 100644
--- a/sql/protocol.h
+++ b/sql/protocol.h
@@ -86,9 +86,9 @@ public:
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)=0;
virtual bool store(float from, uint32 decimals, String *buffer)=0;
virtual bool store(double from, uint32 decimals, String *buffer)=0;
- virtual bool store(TIME *time)=0;
- virtual bool store_date(TIME *time)=0;
- virtual bool store_time(TIME *time)=0;
+ virtual bool store(MYSQL_TIME *time)=0;
+ virtual bool store_date(MYSQL_TIME *time)=0;
+ virtual bool store_time(MYSQL_TIME *time)=0;
virtual bool store(Field *field)=0;
#ifdef EMBEDDED_LIBRARY
int begin_dataset();
@@ -116,9 +116,9 @@ public:
virtual bool store(const char *from, uint length, CHARSET_INFO *cs);
virtual bool store(const char *from, uint length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
- virtual bool store(TIME *time);
- virtual bool store_date(TIME *time);
- virtual bool store_time(TIME *time);
+ virtual bool store(MYSQL_TIME *time);
+ virtual bool store_date(MYSQL_TIME *time);
+ virtual bool store_time(MYSQL_TIME *time);
virtual bool store(float nr, uint32 decimals, String *buffer);
virtual bool store(double from, uint32 decimals, String *buffer);
virtual bool store(Field *field);
@@ -150,9 +150,9 @@ public:
virtual bool store(const char *from,uint length, CHARSET_INFO *cs);
virtual bool store(const char *from, uint length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
- virtual bool store(TIME *time);
- virtual bool store_date(TIME *time);
- virtual bool store_time(TIME *time);
+ virtual bool store(MYSQL_TIME *time);
+ virtual bool store_date(MYSQL_TIME *time);
+ virtual bool store_time(MYSQL_TIME *time);
virtual bool store(float nr, uint32 decimals, String *buffer);
virtual bool store(double from, uint32 decimals, String *buffer);
virtual bool store(Field *field);
diff --git a/sql/set_var.cc b/sql/set_var.cc
index c7eddcdd317..09cdc34f803 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -475,6 +475,8 @@ sys_var_thd_bool
sys_ndb_use_transactions("ndb_use_transactions", &SV::ndb_use_transactions);
sys_var_long_ptr
sys_ndb_cache_check_time("ndb_cache_check_time", &ndb_cache_check_time);
+sys_var_const_str
+sys_ndb_connectstring("ndb_connectstring", opt_ndb_constrbuf);
#endif
/* Time/date/datetime formats */
@@ -792,6 +794,7 @@ sys_var *sys_variables[]=
#ifdef HAVE_NDBCLUSTER_DB
&sys_ndb_autoincrement_prefetch_sz,
&sys_ndb_cache_check_time,
+ &sys_ndb_connectstring,
&sys_ndb_force_send,
&sys_ndb_use_exact_count,
&sys_ndb_use_transactions,
@@ -996,6 +999,7 @@ struct show_var_st init_vars[]= {
{sys_ndb_use_exact_count.name,(char*) &sys_ndb_use_exact_count, SHOW_SYS},
{sys_ndb_use_transactions.name,(char*) &sys_ndb_use_transactions, SHOW_SYS},
{sys_ndb_cache_check_time.name,(char*) &sys_ndb_cache_check_time, SHOW_SYS},
+ {sys_ndb_connectstring.name,(char*) &sys_ndb_connectstring, SHOW_SYS},
#endif
{sys_net_buffer_length.name,(char*) &sys_net_buffer_length, SHOW_SYS},
{sys_net_read_timeout.name, (char*) &sys_net_read_timeout, SHOW_SYS},
@@ -1200,6 +1204,11 @@ static bool sys_update_ftb_syntax(THD *thd, set_var * var)
{
strmake(ft_boolean_syntax, var->value->str_value.c_ptr(),
sizeof(ft_boolean_syntax)-1);
+
+#ifdef HAVE_QUERY_CACHE
+ query_cache.flush();
+#endif /* HAVE_QUERY_CACHE */
+
return 0;
}
@@ -1217,7 +1226,11 @@ static void sys_default_ftb_syntax(THD *thd, enum_var_type type)
static void fix_low_priority_updates(THD *thd, enum_var_type type)
{
- if (type != OPT_GLOBAL)
+ if (type == OPT_GLOBAL)
+ thr_upgraded_concurrent_insert_lock=
+ (global_system_variables.low_priority_updates ?
+ TL_WRITE_LOW_PRIORITY : TL_WRITE);
+ else
thd->update_lock_default= (thd->variables.low_priority_updates ?
TL_WRITE_LOW_PRIORITY : TL_WRITE);
}
@@ -1282,14 +1295,14 @@ static int check_completion_type(THD *thd, set_var *var)
static void fix_net_read_timeout(THD *thd, enum_var_type type)
{
if (type != OPT_GLOBAL)
- net_set_read_timeout(&thd->net, thd->variables.net_read_timeout);
+ my_net_set_read_timeout(&thd->net, thd->variables.net_read_timeout);
}
static void fix_net_write_timeout(THD *thd, enum_var_type type)
{
if (type != OPT_GLOBAL)
- net_set_write_timeout(&thd->net, thd->variables.net_write_timeout);
+ my_net_set_write_timeout(&thd->net, thd->variables.net_write_timeout);
}
static void fix_net_retry_count(THD *thd, enum_var_type type)
diff --git a/sql/slave.cc b/sql/slave.cc
index 97615165803..84f409d7f34 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1517,6 +1517,7 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
handler *file;
ulonglong save_options;
NET *net= &mysql->net;
+ const char *found_semicolon= NULL;
DBUG_ENTER("create_table_from_dump");
packet_len= my_net_read(net); // read create table statement
@@ -1567,7 +1568,7 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
save_db_length= thd->db_length;
DBUG_ASSERT(db != 0);
thd->reset_db((char*)db, strlen(db));
- mysql_parse(thd, thd->query, packet_len); // run create table
+ mysql_parse(thd, thd->query, packet_len, &found_semicolon); // run create table
thd->db = save_db; // leave things the way the were before
thd->db_length= save_db_length;
thd->options = save_options;
diff --git a/sql/sp.cc b/sql/sp.cc
index 4fc9ea1f602..de786a77275 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -434,10 +434,15 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
if ((ret= sp_use_new_db(thd, name->m_db, &old_db, 1, &dbchanged)))
goto end;
- lex_start(thd, (uchar*)defstr.c_ptr(), defstr.length());
+ {
+ Lex_input_stream lip(thd, defstr.c_ptr(), defstr.length());
+ thd->m_lip= &lip;
+ lex_start(thd);
+ ret= MYSQLparse(thd);
+ }
thd->spcont= 0;
- if (MYSQLparse(thd) || thd->is_fatal_error || newlex.sphead == NULL)
+ if (ret || thd->is_fatal_error || newlex.sphead == NULL)
{
sp_head *sp= newlex.sphead;
@@ -752,7 +757,7 @@ print_field_values(THD *thd, TABLE *table,
switch (used_field->field_type) {
case MYSQL_TYPE_TIMESTAMP:
{
- TIME tmp_time;
+ MYSQL_TIME tmp_time;
bzero((char *)&tmp_time, sizeof(tmp_time));
((Field_timestamp *) used_field->field)->get_time(&tmp_time);
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 338b2eb84bb..a98fe5027c9 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -512,6 +512,8 @@ sp_head::init_sp_name(THD *thd, sp_name *spname)
m_qname.length= spname->m_qname.length;
m_qname.str= strmake_root(thd->mem_root, spname->m_qname.str,
m_qname.length);
+
+ DBUG_VOID_RETURN;
}
@@ -519,9 +521,10 @@ void
sp_head::init_strings(THD *thd, LEX *lex)
{
DBUG_ENTER("sp_head::init_strings");
- uchar *endp; /* Used to trim the end */
+ const char *endp; /* Used to trim the end */
/* During parsing, we must use thd->mem_root */
MEM_ROOT *root= thd->mem_root;
+ Lex_input_stream *lip=thd->m_lip;
if (m_param_begin && m_param_end)
{
@@ -531,17 +534,17 @@ sp_head::init_strings(THD *thd, LEX *lex)
}
/* If ptr has overrun end_of_query then end_of_query is the end */
- endp= (lex->ptr > lex->end_of_query ? lex->end_of_query : lex->ptr);
+ endp= (lip->ptr > lip->end_of_query ? lip->end_of_query : lip->ptr);
/*
Trim "garbage" at the end. This is sometimes needed with the
"/ * ! VERSION... * /" wrapper in dump files.
*/
- endp= skip_rear_comments(m_body_begin, endp);
+ endp= skip_rear_comments(thd->charset(), (char*) m_body_begin, (char*) endp);
m_body.length= endp - m_body_begin;
- m_body.str= strmake_root(root, (char *)m_body_begin, m_body.length);
- m_defstr.length= endp - lex->buf;
- m_defstr.str= strmake_root(root, (char *)lex->buf, m_defstr.length);
+ m_body.str= strmake_root(root, m_body_begin, m_body.length);
+ m_defstr.length= endp - lip->buf;
+ m_defstr.str= strmake_root(root, lip->buf, m_defstr.length);
DBUG_VOID_RETURN;
}
@@ -1318,6 +1321,9 @@ err_with_cleanup:
free_root(&call_mem_root, MYF(0));
thd->spcont= octx;
+ if (thd->killed)
+ thd->send_kill_message();
+
DBUG_RETURN(err_status);
}
@@ -1756,24 +1762,13 @@ sp_head::reset_lex(THD *thd)
DBUG_ENTER("sp_head::reset_lex");
LEX *sublex;
LEX *oldlex= thd->lex;
- my_lex_states org_next_state= oldlex->next_state;
(void)m_lex.push_front(oldlex);
thd->lex= sublex= new st_lex;
- /* Reset most stuff. The length arguments doesn't matter here. */
- lex_start(thd, oldlex->buf, (ulong) (oldlex->end_of_query - oldlex->ptr));
+ /* Reset most stuff. */
+ lex_start(thd);
- /*
- next_state is normally the same (0), but it happens that we swap lex in
- "mid-sentence", so we must restore it.
- */
- sublex->next_state= org_next_state;
- /* We must reset ptr and end_of_query again */
- sublex->ptr= oldlex->ptr;
- sublex->end_of_query= oldlex->end_of_query;
- sublex->tok_start= oldlex->tok_start;
- sublex->yylineno= oldlex->yylineno;
/* And keep the SP stuff too */
sublex->sphead= oldlex->sphead;
sublex->spcont= oldlex->spcont;
@@ -1806,9 +1801,6 @@ sp_head::restore_lex(THD *thd)
if (! oldlex)
return; // Nothing to restore
- // Update some state in the old one first
- oldlex->ptr= sublex->ptr;
- oldlex->next_state= sublex->next_state;
oldlex->trg_table_fields.push_back(&sublex->trg_table_fields);
/*
@@ -2995,10 +2987,20 @@ sp_instr_hreturn::print(String *str)
uint
sp_instr_hreturn::opt_mark(sp_head *sp, List<sp_instr> *leads)
{
- if (m_dest)
- return sp_instr_jump::opt_mark(sp, leads);
-
marked= 1;
+
+ if (m_dest)
+ {
+ /*
+ This is an EXIT handler; next instruction step is in m_dest.
+ */
+ return m_dest;
+ }
+
+ /*
+ This is a CONTINUE handler; next instruction step will come from
+ the handler stack and not from opt_mark.
+ */
return UINT_MAX;
}
@@ -3491,6 +3493,14 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check)
tname[tlen]= '\0';
/*
+ Upgrade the lock type because this table list will be used
+ only in pre-locked mode, in which DELAYED inserts are always
+ converted to normal inserts.
+ */
+ if (table->lock_type == TL_WRITE_DELAYED)
+ table->lock_type= TL_WRITE;
+
+ /*
We ignore alias when we check if table was already marked as temporary
(and therefore should not be prelocked). Otherwise we will erroneously
treat table with same name but with different alias as non-temporary.
diff --git a/sql/sp_head.h b/sql/sp_head.h
index cce400d6a14..ed99885ae9a 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -125,7 +125,7 @@ public:
create_field m_return_field_def; /* This is used for FUNCTIONs only. */
- uchar *m_tmp_query; // Temporary pointer to sub query string
+ const char *m_tmp_query; // Temporary pointer to sub query string
uint m_old_cmq; // Old CLIENT_MULTI_QUERIES value
st_sp_chistics *m_chistics;
ulong m_sql_mode; // For SHOW CREATE and execution
@@ -174,7 +174,9 @@ public:
*/
HASH m_sroutines;
// Pointers set during parsing
- uchar *m_param_begin, *m_param_end, *m_body_begin;
+ const char *m_param_begin;
+ const char *m_param_end;
+ const char *m_body_begin;
/*
Security context for stored routine which should be run under
@@ -971,6 +973,12 @@ public:
virtual void print(String *str);
+ /* This instruction will not be short cut optimized. */
+ virtual uint opt_shortcut_jump(sp_head *sp, sp_instr *start)
+ {
+ return m_ip;
+ }
+
virtual uint opt_mark(sp_head *sp, List<sp_instr> *leads);
private:
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index ebf9385d177..cae1f6eb243 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -978,14 +978,15 @@ bool acl_getroot_no_password(Security_context *sctx, char *user, char *host,
*/
for (i=0 ; i < acl_users.elements ; i++)
{
- acl_user= dynamic_element(&acl_users,i,ACL_USER*);
- if ((!acl_user->user && !user[0]) ||
- (acl_user->user && strcmp(user, acl_user->user) == 0))
+ ACL_USER *acl_user_tmp= dynamic_element(&acl_users,i,ACL_USER*);
+ if ((!acl_user_tmp->user && !user[0]) ||
+ (acl_user_tmp->user && strcmp(user, acl_user_tmp->user) == 0))
{
- if (compare_hostname(&acl_user->host, host, ip))
+ if (compare_hostname(&acl_user_tmp->host, host, ip))
{
- res= 0;
- break;
+ acl_user= acl_user_tmp;
+ res= 0;
+ break;
}
}
}
@@ -2995,7 +2996,7 @@ bool mysql_table_grant(THD *thd, TABLE_LIST *table_list,
}
}
}
- grant_option=TRUE;
+
thd->mem_root= old_root;
pthread_mutex_unlock(&acl_cache->lock);
@@ -3162,7 +3163,7 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc,
continue;
}
}
- grant_option=TRUE;
+
thd->mem_root= old_root;
pthread_mutex_unlock(&acl_cache->lock);
if (!result && !no_error)
@@ -3338,6 +3339,8 @@ my_bool grant_init()
delete thd;
/* Remember that we don't have a THD */
my_pthread_setspecific_ptr(THR_THD, 0);
+ /* Set the grant option flag so we will check grants */
+ grant_option= TRUE;
DBUG_RETURN(return_val);
}
@@ -3367,7 +3370,6 @@ static my_bool grant_load(TABLE_LIST *tables)
THR_MALLOC);
DBUG_ENTER("grant_load");
- grant_option = FALSE;
(void) hash_init(&column_priv_hash,system_charset_info,
0,0,0, (hash_get_key) get_grant_table,
(hash_free_key) free_grant_table,0);
@@ -3478,7 +3480,6 @@ static my_bool grant_load(TABLE_LIST *tables)
}
while (!p_table->file->index_next(p_table->record[0]));
}
- grant_option= TRUE;
return_val=0; // Return ok
end_unlock:
@@ -3511,7 +3512,6 @@ my_bool grant_reload(THD *thd)
{
TABLE_LIST tables[3];
HASH old_column_priv_hash, old_proc_priv_hash, old_func_priv_hash;
- bool old_grant_option;
MEM_ROOT old_mem;
my_bool return_val= 1;
DBUG_ENTER("grant_reload");
@@ -3541,7 +3541,6 @@ my_bool grant_reload(THD *thd)
old_column_priv_hash= column_priv_hash;
old_proc_priv_hash= proc_priv_hash;
old_func_priv_hash= func_priv_hash;
- old_grant_option= grant_option;
old_mem= memex;
if ((return_val= grant_load(tables)))
@@ -3551,7 +3550,6 @@ my_bool grant_reload(THD *thd)
column_priv_hash= old_column_priv_hash; /* purecov: deadcode */
proc_priv_hash= old_proc_priv_hash;
func_priv_hash= old_func_priv_hash;
- grant_option= old_grant_option; /* purecov: deadcode */
memex= old_mem; /* purecov: deadcode */
}
else
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 6e6611d54d2..ed006714143 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -94,6 +94,8 @@ static bool open_new_frm(THD *thd, const char *path, const char *alias,
uint db_stat, uint prgflag,
uint ha_open_flags, TABLE *outparam,
TABLE_LIST *table_desc, MEM_ROOT *mem_root);
+static void close_old_data_files(THD *thd, TABLE *table, bool morph_locks,
+ bool send_refresh);
extern "C" byte *table_cache_key(const byte *record,uint *length,
my_bool not_used __attribute__((unused)))
@@ -374,7 +376,21 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh,
for (uint idx=0 ; idx < open_cache.records ; idx++)
{
TABLE *table=(TABLE*) hash_element(&open_cache,idx);
- if ((table->s->version) < refresh_version && table->db_stat)
+ /*
+ Note that we wait here only for tables which are actually open, and
+ not for placeholders with TABLE::open_placeholder set. Waiting for
+ latter will cause deadlock in the following scenario, for example:
+
+ conn1: lock table t1 write;
+ conn2: lock table t2 write;
+ conn1: flush tables;
+ conn2: flush tables;
+
+ It also does not make sense to wait for those of placeholders that
+ are employed by CREATE TABLE as in this case table simply does not
+ exist yet.
+ */
+ if (table->needs_reopen_or_name_lock() && table->db_stat)
{
found=1;
DBUG_PRINT("signal", ("Waiting for COND_refresh"));
@@ -616,10 +632,10 @@ bool close_thread_table(THD *thd, TABLE **table_ptr)
TABLE *table= *table_ptr;
DBUG_ENTER("close_thread_table");
DBUG_ASSERT(table->key_read == 0);
- DBUG_ASSERT(table->file->inited == handler::NONE);
+ DBUG_ASSERT(!table->file || table->file->inited == handler::NONE);
*table_ptr=table->next;
- if (table->s->version != refresh_version ||
+ if (table->needs_reopen_or_name_lock() ||
thd->version != refresh_version || !table->db_stat)
{
VOID(hash_delete(&open_cache,(byte*) table));
@@ -627,6 +643,12 @@ bool close_thread_table(THD *thd, TABLE **table_ptr)
}
else
{
+ /*
+ Open placeholders have TABLE::db_stat set to 0, so they should be
+ handled by the first alternative.
+ */
+ DBUG_ASSERT(!table->open_placeholder);
+
if (table->s->flush_version != flush_version)
{
table->s->flush_version= flush_version;
@@ -1114,6 +1136,43 @@ TABLE *unlink_open_table(THD *thd, TABLE *list, TABLE *find)
}
+/**
+ @brief Auxiliary routine which closes and drops open table.
+
+ @param thd Thread handle
+ @param table TABLE object for table to be dropped
+ @param db_name Name of database for this table
+ @param table_name Name of this table
+
+ @note This routine assumes that table to be closed is open only
+ by calling thread so we needn't wait until other threads
+ will close the table. Also unless called under implicit or
+ explicit LOCK TABLES mode it assumes that table to be
+ dropped is already unlocked. In the former case it will
+ also remove lock on the table. But one should not rely on
+ this behaviour as it may change in future.
+*/
+
+void drop_open_table(THD *thd, TABLE *table, const char *db_name,
+ const char *table_name)
+{
+ if (table->s->tmp_table)
+ close_temporary_table(thd, db_name, table_name);
+ else
+ {
+ enum db_type table_type= table->s->db_type;
+ VOID(pthread_mutex_lock(&LOCK_open));
+ /*
+ unlink_open_table() also tells threads waiting for refresh or close
+ that something has happened.
+ */
+ thd->open_tables= unlink_open_table(thd, thd->open_tables, table);
+ quick_rm_table(table_type, db_name, table_name);
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ }
+}
+
+
/*
When we call the following function we must have a lock on
LOCK_open ; This lock will be unlocked on return.
@@ -1152,6 +1211,11 @@ void wait_for_refresh(THD *thd)
table_list TABLE_LIST object for table to be open, TABLE_LIST::table
member should point to TABLE object which was used for
name-locking.
+ link_in TRUE - if TABLE object for table to be opened should be
+ linked into THD::open_tables list.
+ FALSE - placeholder used for name-locking is already in
+ this list so we only need to preserve TABLE::next
+ pointer.
NOTE
This function assumes that its caller already acquired LOCK_open mutex.
@@ -1161,7 +1225,7 @@ void wait_for_refresh(THD *thd)
TRUE - Error
*/
-bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
+bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list, bool link_in)
{
TABLE *table= table_list->table;
TABLE_SHARE *share;
@@ -1199,12 +1263,33 @@ bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
share= table->s;
share->db= share->table_cache_key;
share->key_length=key_length;
+ /*
+ We want to prevent other connections from opening this table until end
+ of statement as it is likely that modifications of table's metadata are
+ not yet finished (for example CREATE TRIGGER have to change .TRG file,
+ or we might want to drop table if CREATE TABLE ... SELECT fails).
+ This also allows us to assume that no other connection will sneak in
+ before we will get table-level lock on this table.
+ */
share->version=0;
share->flush_version=0;
table->in_use = thd;
check_unused();
- table->next = thd->open_tables;
- thd->open_tables = table;
+
+ if (link_in)
+ {
+ table->next= thd->open_tables;
+ thd->open_tables= table;
+ }
+ else
+ {
+ /*
+ TABLE object should be already in THD::open_tables list so we just
+ need to set TABLE::next correctly.
+ */
+ table->next= orig_table.next;
+ }
+
table->tablenr=thd->current_tablenr++;
table->used_fields=0;
table->const_table=0;
@@ -1216,6 +1301,167 @@ bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
}
+/**
+ @brief Create and insert into table cache placeholder for table
+ which will prevent its opening (or creation) (a.k.a lock
+ table name).
+
+ @param thd Thread context
+ @param key Table cache key for name to be locked
+ @param key_length Table cache key length
+
+ @return Pointer to TABLE object used for name locking or 0 in
+ case of failure.
+*/
+
+TABLE *table_cache_insert_placeholder(THD *thd, const char *key,
+ uint key_length)
+{
+ TABLE *table;
+ char *key_buff;
+ DBUG_ENTER("table_cache_insert_placeholder");
+
+ safe_mutex_assert_owner(&LOCK_open);
+
+ /*
+ Create a table entry with the right key and with an old refresh version
+ Note that we must use my_multi_malloc() here as this is freed by the
+ table cache
+ */
+ if (!my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
+ &table, sizeof(*table),
+ &key_buff, key_length,
+ NULL))
+ DBUG_RETURN(NULL);
+
+ table->s= &table->share_not_to_be_used;
+ memcpy(key_buff, key, key_length);
+ table->s->table_cache_key= key_buff;
+ table->s->db= table->s->table_cache_key;
+ table->s->table_name= table->s->table_cache_key + strlen(table->s->db) + 1;
+ table->s->key_length= key_length;
+ table->in_use= thd;
+ table->locked_by_name= 1;
+
+ if (my_hash_insert(&open_cache, (byte*)table))
+ {
+ my_free((gptr) table, MYF(0));
+ DBUG_RETURN(NULL);
+ }
+
+ DBUG_RETURN(table);
+}
+
+
+/**
+ @brief Check if table cache contains an open placeholder for the
+ table and if this placeholder was created by another thread.
+
+ @param thd Thread context
+ @param db Name of database for table in question
+ @param table_name Table name
+
+ @note The presence of open placeholder indicates that either some
+ other thread is trying to create table in question and obtained
+ an exclusive name-lock on it or that this table already exists
+ and is being flushed at the moment.
+
+ @note One should acquire LOCK_open mutex before calling this function.
+
+ @note This function is a hack which was introduced in 5.0 only to
+ minimize code changes. It doesn't present in 5.1.
+
+ @retval TRUE Table cache contains open placeholder for the table
+ which was created by some other thread.
+ @retval FALSE Otherwise.
+*/
+
+bool table_cache_has_open_placeholder(THD *thd, const char *db,
+ const char *table_name)
+{
+ char key[MAX_DBKEY_LENGTH];
+ uint key_length;
+ HASH_SEARCH_STATE state;
+ TABLE *search;
+ DBUG_ENTER("table_cache_has_open_placeholder");
+
+ safe_mutex_assert_owner(&LOCK_open);
+
+ key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1;
+ for (search= (TABLE*) hash_first(&open_cache, (byte*) key, key_length,
+ &state);
+ search ;
+ search= (TABLE*) hash_next(&open_cache, (byte*) key, key_length,
+ &state))
+ {
+ if (search->in_use == thd)
+ continue;
+ if (search->open_placeholder)
+ DBUG_RETURN(1);
+ }
+ DBUG_RETURN(0);
+}
+
+
+/**
+ @brief Check that table exists on disk or in some storage engine.
+
+ @param thd Thread context
+ @param table Table list element
+ @param exists[out] Out parameter which is set to TRUE if table
+ exists and to FALSE otherwise.
+
+ @note This function assumes that caller owns LOCK_open mutex.
+ It also assumes that the fact that there are no name-locks
+ on the table was checked beforehand.
+
+ @note If there is no .FRM file for the table but it exists in one
+ of engines (e.g. it was created on another node of NDB cluster)
+ this function will fetch and create proper .FRM file for it.
+
+ @retval TRUE Some error occured
+ @retval FALSE No error. 'exists' out parameter set accordingly.
+*/
+
+bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool *exists)
+{
+ char path[FN_REFLEN];
+ int rc;
+ DBUG_ENTER("check_if_table_exists");
+
+ safe_mutex_assert_owner(&LOCK_open);
+
+ *exists= TRUE;
+
+ build_table_path(path, sizeof(path), table->db, table->table_name, reg_ext);
+
+ if (!access(path, F_OK))
+ DBUG_RETURN(FALSE);
+
+ /* .FRM file doesn't exist. Check if some engine can provide it. */
+
+ rc= ha_create_table_from_engine(thd, table->db, table->table_name);
+
+ if (rc < 0)
+ {
+ /* Table does not exists in engines as well. */
+ *exists= FALSE;
+ DBUG_RETURN(FALSE);
+ }
+ else if (!rc)
+ {
+ /* Table exists in some engine and .FRM for it was created. */
+ DBUG_RETURN(FALSE);
+ }
+ else /* (rc > 0) */
+ {
+ my_printf_error(ER_UNKNOWN_ERROR, "Failed to open '%-.64s', error while "
+ "unpacking from engine", MYF(0), table->table_name);
+ DBUG_RETURN(TRUE);
+ }
+}
+
+
/*
Open a table.
@@ -1231,12 +1477,17 @@ bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
MYSQL_LOCK_IGNORE_FLUSH - Open table even if
someone has done a flush or namelock on it.
No version number checking is done.
- MYSQL_OPEN_IGNORE_LOCKED_TABLES - Open table
- ignoring set of locked tables and prelocked mode.
+ MYSQL_OPEN_TEMPORARY_ONLY - Open only temporary
+ table not the base table or view.
IMPLEMENTATION
Uses a cache of open tables to find a table not in use.
+ If table list element for the table to be opened has "create" flag
+ set and table does not exist, this function will automatically insert
+ a placeholder for exclusive name lock into the open tables cache and
+ will return the TABLE instance that corresponds to this placeholder.
+
RETURN
NULL Open failed. If refresh is set then one should close
all other tables and retry the open.
@@ -1254,6 +1505,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
HASH_SEARCH_STATE state;
DBUG_ENTER("open_table");
+ DBUG_ASSERT (table_list->lock_type != TL_WRITE_DEFAULT);
/* find a unused table in the open table cache */
if (refresh)
*refresh=0;
@@ -1305,6 +1557,12 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
}
}
+ if (flags & MYSQL_OPEN_TEMPORARY_ONLY)
+ {
+ my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db, table_list->table_name);
+ DBUG_RETURN(0);
+ }
+
/*
The table is not temporary - if we're in pre-locked or LOCK TABLES
mode, let's try to find the requested table in the list of pre-opened
@@ -1312,8 +1570,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
open not pre-opened tables in pre-locked/LOCK TABLES mode.
TODO: move this block into a separate function.
*/
- if (!(flags & MYSQL_OPEN_IGNORE_LOCKED_TABLES) &&
- (thd->locked_tables || thd->prelocked_mode))
+ if (thd->locked_tables || thd->prelocked_mode)
{ // Using table locks
TABLE *best_table= 0;
int best_distance= INT_MIN;
@@ -1413,10 +1670,17 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
VOID(pthread_mutex_unlock(&LOCK_open));
}
}
- if ((thd->locked_tables) && (thd->locked_tables->lock_count > 0))
- my_error(ER_TABLE_NOT_LOCKED, MYF(0), alias);
- else
+ /*
+ No table in the locked tables list. In case of explicit LOCK TABLES
+ this can happen if a user did not include the able into the list.
+ In case of pre-locked mode locked tables list is generated automatically,
+ so we may only end up here if the table did not exist when
+ locked tables list was created.
+ */
+ if (thd->prelocked_mode == PRELOCKED)
my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db, table_list->alias);
+ else
+ my_error(ER_TABLE_NOT_LOCKED, MYF(0), alias);
DBUG_RETURN(0);
}
@@ -1495,7 +1759,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
c1: name lock t2; -- blocks
c2: open t1; -- blocks
*/
- if (table->s->version != refresh_version)
+ if (table->needs_reopen_or_name_lock())
{
DBUG_PRINT("note",
("Found table '%s.%s' with different refresh version",
@@ -1507,6 +1771,14 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
continue;
}
+ /* Avoid self-deadlocks by detecting self-dependencies. */
+ if (table->open_placeholder && table->in_use == thd)
+ {
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ my_error(ER_UPDATE_TABLE_USED, MYF(0), table->s->table_name);
+ DBUG_RETURN(0);
+ }
+
/*
Back off, part 1: mark the table as "unused" for the
purpose of name-locking by setting table->db_stat to 0. Do
@@ -1523,6 +1795,14 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
and wait till the operation is complete: when any
operation that juggles with table->s->version completes,
it broadcasts COND_refresh condition variable.
+ If 'old' table we met is in use by current thread we return
+ without waiting since in this situation it's this thread
+ which is responsible for broadcasting on COND_refresh
+ (and this was done already in close_old_data_files()).
+ Good example of such situation is when we have statement
+ that needs two instances of table and FLUSH TABLES comes
+ after we open first instance but before we open second
+ instance.
*/
if (table->in_use != thd)
{
@@ -1564,6 +1844,40 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
while (open_cache.records > table_cache_size && unused_tables)
VOID(hash_delete(&open_cache,(byte*) unused_tables)); /* purecov: tested */
+ if (table_list->create)
+ {
+ bool exists;
+
+ if (check_if_table_exists(thd, table_list, &exists))
+ {
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ DBUG_RETURN(NULL);
+ }
+
+ if (!exists)
+ {
+ /*
+ Table to be created, so we need to create placeholder in table-cache.
+ */
+ if (!(table= table_cache_insert_placeholder(thd, key, key_length)))
+ {
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ DBUG_RETURN(NULL);
+ }
+ /*
+ Link placeholder to the open tables list so it will be automatically
+ removed once tables are closed. Also mark it so it won't be ignored
+ by other trying to take name-lock.
+ */
+ table->open_placeholder= 1;
+ table->next= thd->open_tables;
+ thd->open_tables= table;
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ DBUG_RETURN(table);
+ }
+ /* Table exists. Let us try to open it. */
+ }
+
/* make a new table */
if (!(table=(TABLE*) my_malloc(sizeof(*table),MYF(MY_WME))))
{
@@ -1794,9 +2108,24 @@ bool close_data_tables(THD *thd,const char *db, const char *table_name)
}
-/*
- Reopen all tables with closed data files
- One should have lock on LOCK_open when calling this
+/**
+ @brief Reopen all tables with closed data files.
+
+ @param thd Thread context
+ @param get_locks Should we get locks after reopening tables ?
+ @param in_refresh Are we in FLUSH TABLES ? TODO: It seems that
+ we can remove this parameter.
+
+ @note Since this function can't properly handle prelocking and
+ create placeholders it should be used in very special
+ situations like FLUSH TABLES or ALTER TABLE. In general
+ case one should just repeat open_tables()/lock_tables()
+ combination when one needs tables to be reopened (for
+ example see open_and_lock_tables()).
+
+ @note One should have lock on LOCK_open when calling this.
+
+ @return FALSE in case of success, TRUE - otherwise.
*/
bool reopen_tables(THD *thd,bool get_locks,bool in_refresh)
@@ -1841,7 +2170,7 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh)
if (in_refresh)
{
table->s->version=0;
- table->locked_by_flush=0;
+ table->open_placeholder= 0;
}
}
}
@@ -1867,35 +2196,71 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh)
DBUG_RETURN(error);
}
-/*
- Close handlers for tables in list, but leave the TABLE structure
- intact so that we can re-open these quickly
- abort_locks is set if called from flush_tables.
+
+/**
+ @brief Close handlers for tables in list, but leave the TABLE structure
+ intact so that we can re-open these quickly.
+
+ @param thd Thread context
+ @param table Head of the list of TABLE objects
+ @param morph_locks TRUE - remove locks which we have on tables being closed
+ but ensure that no DML or DDL will sneak in before
+ we will re-open the table (i.e. temporarily morph
+ our table-level locks into name-locks).
+ FALSE - otherwise
+ @param send_refresh Should we awake waiters even if we didn't close any tables?
*/
-void close_old_data_files(THD *thd, TABLE *table, bool abort_locks,
+void close_old_data_files(THD *thd, TABLE *table, bool morph_locks,
bool send_refresh)
{
DBUG_ENTER("close_old_data_files");
bool found=send_refresh;
for (; table ; table=table->next)
{
- if (table->s->version != refresh_version)
+ if (table->needs_reopen_or_name_lock())
{
found=1;
- if (!abort_locks) // If not from flush tables
+ /*
+ Note that it is safe to update version even for open placeholders
+ as later in this function we reset TABLE::open_placeholder and thus
+ effectively remove them from the table cache.
+ */
+ if (!morph_locks) // If not from flush tables
table->s->version= refresh_version; // Let other threads use table
if (table->db_stat)
{
- if (abort_locks)
- {
- mysql_lock_abort(thd,table); // Close waiting threads
- mysql_lock_remove(thd, thd->locked_tables,table);
- table->locked_by_flush=1; // Will be reopened with locks
- }
+ if (morph_locks)
+ {
+ /*
+ Wake up threads waiting for table-level lock on this table
+ so they won't sneak in when we will temporarily remove our
+ lock on it. This will also give them a chance to close their
+ instances of this table.
+ */
+ mysql_lock_abort(thd, table);
+ mysql_lock_remove(thd, thd->locked_tables, table);
+ /*
+ We want to protect the table from concurrent DDL operations
+ (like RENAME TABLE) until we will re-open and re-lock it.
+ */
+ table->open_placeholder= 1;
+ }
table->file->close();
table->db_stat=0;
}
+ else if (table->open_placeholder)
+ {
+ /*
+ We come here only in close-for-back-off scenario. So we have to
+ "close" create placeholder here to avoid deadlocks (for example,
+ in case of concurrent execution of CREATE TABLE t1 SELECT * FROM t2
+ and RENAME TABLE t2 TO t1). In close-for-re-open scenario we will
+ probably want to let it stay.
+ */
+ DBUG_ASSERT(!morph_locks);
+ table->open_placeholder= 0;
+ }
}
}
if (found)
@@ -1923,9 +2288,8 @@ bool table_is_used(TABLE *table, bool wait_for_name_lock)
search= (TABLE*) hash_next(&open_cache, (byte*) key,
key_length, &state))
{
- if (search->locked_by_flush ||
- search->locked_by_name && wait_for_name_lock ||
- search->db_stat && search->s->version < refresh_version)
+ if (search->locked_by_name && wait_for_name_lock ||
+ search->is_name_opened() && search->needs_reopen_or_name_lock())
return 1; // Table is used
}
} while ((table=table->next));
@@ -2277,7 +2641,7 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
*/
if (!thd->prelocked_mode && !thd->lex->requires_prelocking() &&
- thd->lex->sroutines_list.elements)
+ thd->lex->uses_stored_routines())
{
bool first_no_prelocking, need_prelocking, tabs_changed;
TABLE_LIST **save_query_tables_last= thd->lex->query_tables_last;
@@ -2311,6 +2675,12 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
for (tables= *start; tables ;tables= tables->next_global)
{
safe_to_ignore_table= FALSE; // 'FALSE', as per coding style
+
+ if (tables->lock_type == TL_WRITE_DEFAULT)
+ {
+ tables->lock_type= thd->update_lock_default;
+ DBUG_ASSERT (tables->lock_type >= TL_WRITE_ALLOW_WRITE);
+ }
/*
Ignore placeholders for derived tables. After derived tables
processing, link to created temporary table will be put here.
@@ -2465,7 +2835,7 @@ process_view_routines:
*/
if (tables->view && !thd->prelocked_mode &&
!thd->lex->requires_prelocking() &&
- tables->view->sroutines_list.elements)
+ tables->view->uses_stored_routines())
{
/* We have at least one table in TL here. */
if (!query_tables_last_own)
@@ -4811,7 +5181,12 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
get_key_map_from_key_list(&map, table, table_list->use_index);
if (map.is_set_all())
DBUG_RETURN(1);
- table->keys_in_use_for_query=map;
+ /*
+ Don't introduce keys in keys_in_use_for_query that weren't there
+ before. FORCE/USE INDEX should not add keys, it should only remove
+ all keys except the key(s) specified in the hint.
+ */
+ table->keys_in_use_for_query.intersect(map);
}
if (table_list->ignore_index)
{
@@ -5444,13 +5819,13 @@ fill_record(THD *thd, Field **ptr, List<Item> &values, bool ignore_errors)
table= (*ptr)->table;
table->auto_increment_field_not_null= FALSE;
}
- while ((field = *ptr++))
+ while ((field = *ptr++) && !thd->net.report_error)
{
value=v++;
table= field->table;
if (field == table->next_number_field)
table->auto_increment_field_not_null= TRUE;
- if (value->save_in_field(field, 0) == -1)
+ if (value->save_in_field(field, 0) < 0)
goto err;
}
DBUG_RETURN(thd->net.report_error);
@@ -5661,7 +6036,7 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
else if (in_use != thd)
{
in_use->some_tables_deleted=1;
- if (table->db_stat)
+ if (table->is_name_opened())
{
DBUG_PRINT("info", ("Found another active instance of the table"));
result=1;
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 795711b34d8..33d658ce6a1 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -865,9 +865,12 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
flags.max_sort_length= thd->variables.max_sort_length;
flags.lc_time_names= thd->variables.lc_time_names;
flags.group_concat_max_len= thd->variables.group_concat_max_len;
+ flags.div_precision_increment= thd->variables.div_precincrement;
+ flags.default_week_format= thd->variables.default_week_format;
DBUG_PRINT("qcache", ("long %d, 4.1: %d, more results %d, pkt_nr: %d, \
CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \
-sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
+sql mode: 0x%lx, sort len: %lu, conncat len: %lu, div_precision: %lu, \
+def_week_frmt: %lu",
(int)flags.client_long_flag,
(int)flags.client_protocol_41,
(int)flags.more_results_exists,
@@ -879,7 +882,9 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
(ulong) flags.time_zone,
flags.sql_mode,
flags.max_sort_length,
- flags.group_concat_max_len));
+ flags.group_concat_max_len,
+ flags.div_precision_increment,
+ flags.default_week_format));
/*
Make InnoDB to release the adaptive hash index latch before
acquiring the query cache mutex.
@@ -1107,10 +1112,13 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
flags.sql_mode= thd->variables.sql_mode;
flags.max_sort_length= thd->variables.max_sort_length;
flags.group_concat_max_len= thd->variables.group_concat_max_len;
+ flags.div_precision_increment= thd->variables.div_precincrement;
+ flags.default_week_format= thd->variables.default_week_format;
flags.lc_time_names= thd->variables.lc_time_names;
DBUG_PRINT("qcache", ("long %d, 4.1: %d, more results %d, pkt_nr: %d, \
CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \
-sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
+sql mode: 0x%lx, sort len: %lu, conncat len: %lu, div_precision: %lu, \
+def_week_frmt: %lu",
(int)flags.client_long_flag,
(int)flags.client_protocol_41,
(int)flags.more_results_exists,
@@ -1122,7 +1130,9 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
(ulong) flags.time_zone,
flags.sql_mode,
flags.max_sort_length,
- flags.group_concat_max_len));
+ flags.group_concat_max_len,
+ flags.div_precision_increment,
+ flags.default_week_format));
memcpy((void *)(sql + (tot_length - QUERY_CACHE_FLAGS_SIZE)),
&flags, QUERY_CACHE_FLAGS_SIZE);
query_block = (Query_cache_block *) hash_search(&queries, (byte*) sql,
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 6ec14426162..010dc101e0d 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -176,7 +176,7 @@ THD::THD()
rand_used(0), time_zone_used(0),
last_insert_id_used(0), last_insert_id_used_bin_log(0), insert_id_used(0),
clear_next_insert_id(0), in_lock_tables(0), bootstrap(0),
- derived_tables_processing(FALSE), spcont(NULL)
+ derived_tables_processing(FALSE), spcont(NULL), m_lip(NULL)
{
ulong tmp;
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 12d7cb2368f..2ff5448f3e4 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -28,6 +28,7 @@ class Slave_log_event;
class Format_description_log_event;
class sp_rcontext;
class sp_cache;
+class Lex_input_stream;
enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE };
enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME };
@@ -494,7 +495,7 @@ public:
};
-class delayed_insert;
+class Delayed_insert;
class select_result;
#define THD_SENTRY_MAGIC 0xfeedd1ff
@@ -593,7 +594,7 @@ struct system_variables
Time_zone *time_zone;
- /* DATE, DATETIME and TIME formats */
+ /* DATE, DATETIME and MYSQL_TIME formats */
DATE_TIME_FORMAT *date_format;
DATE_TIME_FORMAT *datetime_format;
DATE_TIME_FORMAT *time_format;
@@ -1247,7 +1248,7 @@ public:
time_t start_time,time_after_lock,user_time;
time_t connect_time,thr_create_time; // track down slow pthread_create
thr_lock_type update_lock_default;
- delayed_insert *di;
+ Delayed_insert *di;
/* <> 0 if we are inside of trigger or stored function. */
uint in_sub_stmt;
@@ -1396,7 +1397,14 @@ public:
DYNAMIC_ARRAY user_var_events; /* For user variables replication */
MEM_ROOT *user_var_events_alloc; /* Allocate above array elements here */
- enum killed_state { NOT_KILLED=0, KILL_BAD_DATA=1, KILL_CONNECTION=ER_SERVER_SHUTDOWN, KILL_QUERY=ER_QUERY_INTERRUPTED };
+ enum killed_state
+ {
+ NOT_KILLED=0,
+ KILL_BAD_DATA=1,
+ KILL_CONNECTION=ER_SERVER_SHUTDOWN,
+ KILL_QUERY=ER_QUERY_INTERRUPTED,
+ KILLED_NO_VALUE /* means neither of the states */
+ };
killed_state volatile killed;
/* scramble - random string sent to client on handshake */
@@ -1431,6 +1439,10 @@ public:
*/
bool insert_id_used;
+ /*
+ clear_next_insert_id is set if engine was called at least once
+ for this statement to generate auto_increment value.
+ */
bool clear_next_insert_id;
/* for IS NULL => = last_insert_id() fix in remove_eq_conds() */
bool substitute_null_with_insert_id;
@@ -1496,6 +1508,15 @@ public:
query_id_t first_query_id;
} binlog_evt_union;
+ /**
+ Character input stream consumed by the lexical analyser,
+ used during parsing.
+ Note that since the parser is not re-entrant, we keep only one input
+ stream here. This member is valid only when executing code during parsing,
+ and may point to invalid memory after that.
+ */
+ Lex_input_stream *m_lip;
+
THD();
~THD();
@@ -1656,7 +1677,8 @@ public:
void end_statement();
inline int killed_errno() const
{
- return killed != KILL_BAD_DATA ? killed : 0;
+ killed_state killed_val; /* to cache the volatile 'killed' */
+ return (killed_val= killed) != KILL_BAD_DATA ? killed_val : 0;
}
inline void send_kill_message() const
{
@@ -2269,6 +2291,11 @@ class multi_update :public select_result_interceptor
List <Item> *fields, *values;
List <Item> **fields_for_table, **values_for_table;
uint table_count;
+ /*
+ List of tables referenced in the CHECK OPTION condition of
+ the updated view excluding the updated table.
+ */
+ List <TABLE> unupdated_check_opt_tables;
Copy_field *copy_field;
enum enum_duplicates handle_duplicates;
bool do_update, trans_safe;
diff --git a/sql/sql_client.cc b/sql/sql_client.cc
index d6f1183806e..032a2e26e3a 100644
--- a/sql/sql_client.cc
+++ b/sql/sql_client.cc
@@ -28,8 +28,11 @@ void my_net_local_init(NET *net)
{
#ifndef EMBEDDED_LIBRARY
net->max_packet= (uint) global_system_variables.net_buffer_length;
- net->read_timeout= (uint) global_system_variables.net_read_timeout;
- net->write_timeout=(uint) global_system_variables.net_write_timeout;
+
+ my_net_set_read_timeout(net, (uint)global_system_variables.net_read_timeout);
+ my_net_set_write_timeout(net,
+ (uint)global_system_variables.net_write_timeout);
+
net->retry_count= (uint) global_system_variables.net_retry_count;
net->max_packet_size= max(global_system_variables.net_buffer_length,
global_system_variables.max_allowed_packet);
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index d1a5ab7dfa8..e1318aa2736 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -670,7 +670,7 @@ int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags,
while (*table_ptr)
{
if ((mode_flags & MYSQL_HA_FLUSH_ALL) ||
- ((*table_ptr)->s->version != refresh_version))
+ (*table_ptr)->needs_reopen_or_name_lock())
{
/* The first time it is required, lock for close_thread_table(). */
if (! did_lock && ! is_locked)
@@ -771,15 +771,22 @@ void mysql_ha_mark_tables_for_reopen(THD *thd, TABLE *table)
safe_mutex_assert_owner(&LOCK_open);
for (; table; table= table->next)
{
- TABLE_LIST *hash_tables;
- if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash,
- (byte*) table->alias,
- strlen(table->alias) + 1)))
+ /*
+ Some elements in open table list, for example placeholders used for
+ name-locking, can have alias set to 0.
+ */
+ if (table->alias)
{
- /* Mark table as ready for reopen. */
- hash_tables->table= NULL;
- /* End open index/table scans. */
- table->file->ha_index_or_rnd_end();
+ TABLE_LIST *hash_tables;
+ if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash,
+ (byte*) table->alias,
+ strlen(table->alias) + 1)))
+ {
+ /* Mark table as ready for reopen. */
+ hash_tables->table= NULL;
+ /* End open index/table scans. */
+ table->file->ha_index_or_rnd_end();
+ }
}
}
DBUG_VOID_RETURN;
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index f1d86224adb..bf37a3d6d69 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -29,7 +29,7 @@
waited for to open and lock the table.
If accessing the thread succeeded, in
- delayed_insert::get_local_table() the table of the thread is copied
+ Delayed_insert::get_local_table() the table of the thread is copied
for local use. A copy is required because the normal insert logic
works on a target table, but the other threads table object must not
be used. The insert logic uses the record buffer to create a record.
@@ -61,7 +61,7 @@
#include "slave.h"
#ifndef EMBEDDED_LIBRARY
-static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list);
+static bool delayed_get_table(THD *thd, TABLE_LIST *table_list);
static int write_delayed(THD *thd,TABLE *table, enum_duplicates dup, bool ignore,
char *query, uint query_length, bool log_on);
static void end_delayed_insert(THD *thd);
@@ -401,6 +401,154 @@ void mark_fields_used_by_triggers_for_insert_stmt(THD *thd, TABLE *table,
}
+/**
+ Upgrade table-level lock of INSERT statement to TL_WRITE if
+ a more concurrent lock is infeasible for some reason. This is
+ necessary for engines without internal locking support (MyISAM).
+ An engine with internal locking implementation might later
+ downgrade the lock in handler::store_lock() method.
+*/
+
+static
+void upgrade_lock_type(THD *thd, thr_lock_type *lock_type,
+ enum_duplicates duplic,
+ bool is_multi_insert)
+{
+ if (duplic == DUP_UPDATE ||
+ duplic == DUP_REPLACE && *lock_type == TL_WRITE_CONCURRENT_INSERT)
+ {
+ *lock_type= TL_WRITE;
+ return;
+ }
+
+ if (*lock_type == TL_WRITE_DELAYED)
+ {
+ /*
+ We do not use delayed threads if:
+ - we're running in the safe mode or skip-new mode -- the
+ feature is disabled in these modes
+ - we're executing this statement on a replication slave --
+ we need to ensure serial execution of queries on the
+ slave
+ - it is INSERT .. ON DUPLICATE KEY UPDATE - in this case the
+ insert cannot be concurrent
+ - this statement is directly or indirectly invoked from
+ a stored function or trigger (under pre-locking) - to
+ avoid deadlocks, since INSERT DELAYED involves a lock
+ upgrade (TL_WRITE_DELAYED -> TL_WRITE) which we should not
+ attempt while keeping other table level locks.
+ - this statement itself may require pre-locking.
+ We should upgrade the lock even though in most cases
+ delayed functionality may work. Unfortunately, we can't
+ easily identify whether the subject table is not used in
+ the statement indirectly via a stored function or trigger:
+ if it is used, that will lead to a deadlock between the
+ client connection and the delayed thread.
+ */
+ if (specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE) ||
+ thd->slave_thread ||
+ thd->variables.max_insert_delayed_threads == 0 ||
+ thd->prelocked_mode ||
+ thd->lex->uses_stored_routines())
+ {
+ *lock_type= TL_WRITE;
+ return;
+ }
+ bool log_on= (thd->options & OPTION_BIN_LOG ||
+ ! (thd->security_ctx->master_access & SUPER_ACL));
+ if (log_on && mysql_bin_log.is_open() && is_multi_insert)
+ {
+ /*
+ Statement-based binary logging does not work in this case, because:
+ a) two concurrent statements may have their rows intermixed in the
+ queue, leading to autoincrement replication problems on slave (because
+ the values generated used for one statement don't depend only on the
+ value generated for the first row of this statement, so are not
+ replicable)
+ b) if first row of the statement has an error the full statement is
+ not binlogged, while next rows of the statement may be inserted.
+ c) if first row succeeds, statement is binlogged immediately with a
+ zero error code (i.e. "no error"), if then second row fails, query
+ will fail on slave too and slave will stop (wrongly believing that the
+ master got no error).
+ So we fall back to non-delayed INSERT.
+ */
+ *lock_type= TL_WRITE;
+ }
+ }
+}
+
+
+/**
+ Find or create a delayed insert thread for the first table in
+ the table list, then open and lock the remaining tables.
+ If a table can not be used with insert delayed, upgrade the lock
+ and open and lock all tables using the standard mechanism.
+
+ @param thd thread context
+ @param table_list list of "descriptors" for tables referenced
+ directly in statement SQL text.
+ The first element in the list corresponds to
+ the destination table for inserts, remaining
+ tables, if any, are usually tables referenced
+ by sub-queries in the right part of the
+ INSERT.
+
+ @return Status of the operation. In case of success 'table'
+ member of every table_list element points to an instance of
+ class TABLE.
+
+ @sa open_and_lock_tables for more information about MySQL table
+ level locking
+*/
+
+static
+bool open_and_lock_for_insert_delayed(THD *thd, TABLE_LIST *table_list)
+{
+ DBUG_ENTER("open_and_lock_for_insert_delayed");
+
+#ifndef EMBEDDED_LIBRARY
+ if (delayed_get_table(thd, table_list))
+ DBUG_RETURN(TRUE);
+
+ if (table_list->table)
+ {
+ /*
+ Open tables used for sub-selects or in stored functions, will also
+ cache these functions.
+ */
+ if (open_and_lock_tables(thd, table_list->next_global))
+ {
+ end_delayed_insert(thd);
+ DBUG_RETURN(TRUE);
+ }
+ /*
+ First table was not processed by open_and_lock_tables(),
+ we need to set updatability flag "by hand".
+ */
+ if (!table_list->derived && !table_list->view)
+ table_list->updatable= 1; // usual table
+ DBUG_RETURN(FALSE);
+ }
+#endif
+ /*
+ * This is embedded library and we don't have auxiliary
+ threads OR
+ * a lock upgrade was requested inside delayed_get_table
+ because
+ - there are too many delayed insert threads OR
+ - the table has triggers.
+ Use a normal insert.
+ */
+ table_list->lock_type= TL_WRITE;
+ DBUG_RETURN(open_and_lock_tables(thd, table_list));
+}
+
+
+/**
+ INSERT statement implementation
+*/
+
bool mysql_insert(THD *thd,TABLE_LIST *table_list,
List<Item> &fields,
List<List_item> &values_list,
@@ -410,11 +558,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
bool ignore)
{
int error, res;
- /*
- log_on is about delayed inserts only.
- By default, both logs are enabled (this won't cause problems if the server
- runs without --log-update or --log-bin).
- */
bool transactional_table, joins_freed= FALSE;
bool changed;
uint value_count;
@@ -428,92 +571,49 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
Name_resolution_context_state ctx_state;
#ifndef EMBEDDED_LIBRARY
char *query= thd->query;
-#endif
+ /*
+ log_on is about delayed inserts only.
+ By default, both logs are enabled (this won't cause problems if the server
+ runs without --log-update or --log-bin).
+ */
bool log_on= (thd->options & OPTION_BIN_LOG) ||
(!(thd->security_ctx->master_access & SUPER_ACL));
+#endif
thr_lock_type lock_type = table_list->lock_type;
Item *unused_conds= 0;
DBUG_ENTER("mysql_insert");
/*
- in safe mode or with skip-new change delayed insert to be regular
- if we are told to replace duplicates, the insert cannot be concurrent
- delayed insert changed to regular in slave thread
- */
-#ifdef EMBEDDED_LIBRARY
- if (lock_type == TL_WRITE_DELAYED)
- lock_type=TL_WRITE;
-#else
- if ((lock_type == TL_WRITE_DELAYED &&
- ((specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE)) ||
- thd->slave_thread || !thd->variables.max_insert_delayed_threads)) ||
- (lock_type == TL_WRITE_CONCURRENT_INSERT && duplic == DUP_REPLACE) ||
- (duplic == DUP_UPDATE))
- lock_type=TL_WRITE;
-#endif
- if ((lock_type == TL_WRITE_DELAYED) &&
- log_on && mysql_bin_log.is_open() &&
- (values_list.elements > 1))
+ Upgrade lock type if the requested lock is incompatible with
+ the current connection mode or table operation.
+ */
+ upgrade_lock_type(thd, &table_list->lock_type, duplic,
+ values_list.elements > 1);
+
+ /*
+ We can't write-delayed into a table locked with LOCK TABLES:
+ this will lead to a deadlock, since the delayed thread will
+ never be able to get a lock on the table. QQQ: why not
+ upgrade the lock here instead?
+ */
+ if (table_list->lock_type == TL_WRITE_DELAYED && thd->locked_tables &&
+ find_locked_table(thd, table_list->db, table_list->table_name))
{
- /*
- Statement-based binary logging does not work in this case, because:
- a) two concurrent statements may have their rows intermixed in the
- queue, leading to autoincrement replication problems on slave (because
- the values generated used for one statement don't depend only on the
- value generated for the first row of this statement, so are not
- replicable)
- b) if first row of the statement has an error the full statement is
- not binlogged, while next rows of the statement may be inserted.
- c) if first row succeeds, statement is binlogged immediately with a
- zero error code (i.e. "no error"), if then second row fails, query
- will fail on slave too and slave will stop (wrongly believing that the
- master got no error).
- So we fallback to non-delayed INSERT.
- */
- lock_type= TL_WRITE;
+ my_error(ER_DELAYED_INSERT_TABLE_LOCKED, MYF(0),
+ table_list->table_name);
+ DBUG_RETURN(TRUE);
}
- table_list->lock_type= lock_type;
-#ifndef EMBEDDED_LIBRARY
- if (lock_type == TL_WRITE_DELAYED)
+ if (table_list->lock_type == TL_WRITE_DELAYED)
{
- res= 1;
- if (thd->locked_tables)
- {
- DBUG_ASSERT(table_list->db); /* Must be set in the parser */
- if (find_locked_table(thd, table_list->db, table_list->table_name))
- {
- my_error(ER_DELAYED_INSERT_TABLE_LOCKED, MYF(0),
- table_list->table_name);
- DBUG_RETURN(TRUE);
- }
- }
- if ((table= delayed_get_table(thd,table_list)) && !thd->is_fatal_error)
- {
- /*
- Open tables used for sub-selects or in stored functions, will also
- cache these functions.
- */
- res= open_and_lock_tables(thd, table_list->next_global);
- /*
- First is not processed by open_and_lock_tables() => we need set
- updateability flags "by hands".
- */
- if (!table_list->derived && !table_list->view)
- table_list->updatable= 1; // usual table
- }
- else if (thd->net.last_errno != ER_WRONG_OBJECT)
- {
- /* Too many delayed insert threads; Use a normal insert */
- table_list->lock_type= lock_type= TL_WRITE;
- res= open_and_lock_tables(thd, table_list);
- }
+ if (open_and_lock_for_insert_delayed(thd, table_list))
+ DBUG_RETURN(TRUE);
}
else
-#endif /* EMBEDDED_LIBRARY */
- res= open_and_lock_tables(thd, table_list);
- if (res || thd->is_fatal_error)
- DBUG_RETURN(TRUE);
+ {
+ if (open_and_lock_tables(thd, table_list))
+ DBUG_RETURN(TRUE);
+ }
thd->proc_info="init";
thd->used_tables=0;
@@ -531,6 +631,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
/* mysql_prepare_insert set table_list->table if it was not set */
table= table_list->table;
+ lock_type= table_list->lock_type;
context= &thd->lex->select_lex.context;
/*
@@ -769,9 +870,35 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
if (mysql_bin_log.is_open())
{
if (error <= 0)
+ {
+ /*
+ [Guilhem wrote] Temporary errors may have filled
+ thd->net.last_error/errno. For example if there has
+ been a disk full error when writing the row, and it was
+ MyISAM, then thd->net.last_error/errno will be set to
+ "disk full"... and the my_pwrite() will wait until free
+ space appears, and so when it finishes then the
+ write_row() was entirely successful
+ */
+ /* todo: consider removing */
thd->clear_error();
+ }
+ /* bug#22725:
+
+ A query which per-row-loop can not be interrupted with
+ KILLED, like INSERT, and that does not invoke stored
+ routines can be binlogged with neglecting the KILLED error.
+
+ If there was no error (error == zero) until after the end of
+ inserting loop the KILLED flag that appeared later can be
+ disregarded since previously possible invocation of stored
+ routines did not result in any error due to the KILLED. In
+ such case the flag is ignored for constructing binlog event.
+ */
Query_log_event qinfo(thd, thd->query, thd->query_length,
- transactional_table, FALSE);
+ transactional_table, FALSE,
+ (error>0) ? thd->killed : THD::NOT_KILLED);
+ DBUG_ASSERT(thd->killed != THD::KILL_BAD_DATA || error > 0);
if (mysql_bin_log.write(&qinfo) && transactional_table)
error=1;
}
@@ -1258,7 +1385,8 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
DBUG_ASSERT(info->update_fields->elements ==
info->update_values->elements);
if (fill_record_n_invoke_before_triggers(thd, *info->update_fields,
- *info->update_values, 0,
+ *info->update_values,
+ info->ignore,
table->triggers,
TRG_EVENT_UPDATE))
goto before_trg_err;
@@ -1460,8 +1588,14 @@ public:
}
};
+/**
+ Delayed_insert - context of a thread responsible for delayed insert
+ into one table. When processing delayed inserts, we create an own
+ thread for every distinct table. Later on all delayed inserts directed
+ into that table are handled by a dedicated thread.
+*/
-class delayed_insert :public ilink {
+class Delayed_insert :public ilink {
uint locks_in_memory;
public:
THD thd;
@@ -1475,7 +1609,7 @@ public:
ulong group_count;
TABLE_LIST table_list; // Argument
- delayed_insert()
+ Delayed_insert()
:locks_in_memory(0),
table(0),tables_in_use(0),stacked_inserts(0), status(0), dead(0),
group_count(0)
@@ -1500,7 +1634,7 @@ public:
delayed_insert_threads++;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
}
- ~delayed_insert()
+ ~Delayed_insert()
{
/* The following is not really needed, but just for safety */
delayed_row *row;
@@ -1548,15 +1682,21 @@ public:
};
-I_List<delayed_insert> delayed_threads;
+I_List<Delayed_insert> delayed_threads;
-delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list)
+/**
+ Return an instance of delayed insert thread that can handle
+ inserts into a given table, if it exists. Otherwise return NULL.
+*/
+
+static
+Delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list)
{
thd->proc_info="waiting for delay_list";
pthread_mutex_lock(&LOCK_delayed_insert); // Protect master list
- I_List_iterator<delayed_insert> it(delayed_threads);
- delayed_insert *tmp;
+ I_List_iterator<Delayed_insert> it(delayed_threads);
+ Delayed_insert *tmp;
while ((tmp=it++))
{
if (!strcmp(tmp->thd.db,table_list->db) &&
@@ -1571,11 +1711,36 @@ delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list)
}
-static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list)
+/**
+ Attempt to find or create a delayed insert thread to handle inserts
+ into this table.
+
+ @return In case of success, table_list->table points to a local copy
+ of the delayed table or is set to NULL, which indicates a
+ request for lock upgrade. In case of failure, value of
+ table_list->table is undefined.
+ @retval TRUE - this thread ran out of resources OR
+ - a newly created delayed insert thread ran out of
+ resources OR
+ - the created thread failed to open and lock the table
+ (e.g. because it does not exist) OR
+ - the table opened in the created thread turned out to
+ be a view
+ @retval FALSE - table successfully opened OR
+ - too many delayed insert threads OR
+ - the table has triggers and we have to fall back to
+ a normal INSERT
+ Two latter cases indicate a request for lock upgrade.
+
+ XXX: why do we regard INSERT DELAYED into a view as an error and
+ do not simply a lock upgrade?
+*/
+
+static
+bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
{
int error;
- delayed_insert *tmp;
- TABLE *table;
+ Delayed_insert *tmp;
DBUG_ENTER("delayed_get_table");
/* Must be set in the parser */
@@ -1598,10 +1763,11 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list)
*/
if (! (tmp= find_handler(thd, table_list)))
{
- if (!(tmp=new delayed_insert()))
+ if (!(tmp=new Delayed_insert()))
{
- my_error(ER_OUTOFMEMORY,MYF(0),sizeof(delayed_insert));
- goto err1;
+ my_error(ER_OUTOFMEMORY,MYF(0),sizeof(Delayed_insert));
+ thd->fatal_error();
+ goto end_create;
}
pthread_mutex_lock(&LOCK_thread_count);
thread_count++;
@@ -1610,9 +1776,10 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list)
tmp->thd.query= my_strdup(table_list->table_name,MYF(MY_WME));
if (tmp->thd.db == NULL || tmp->thd.query == NULL)
{
+ /* The error is reported */
delete tmp;
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
- goto err1;
+ thd->fatal_error();
+ goto end_create;
}
tmp->table_list= *table_list; // Needed to open table
tmp->table_list.alias= tmp->table_list.table_name= tmp->thd.query;
@@ -1628,7 +1795,8 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list)
tmp->unlock();
delete tmp;
my_error(ER_CANT_CREATE_THREAD, MYF(0), error);
- goto err1;
+ thd->fatal_error();
+ goto end_create;
}
/* Wait until table is open */
@@ -1641,57 +1809,69 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list)
thd->proc_info="got old table";
if (tmp->thd.killed)
{
- if (tmp->thd.is_fatal_error)
+ if (tmp->thd.net.report_error)
{
- /* Copy error message and abort */
- thd->fatal_error();
- strmov(thd->net.last_error,tmp->thd.net.last_error);
- thd->net.last_errno=tmp->thd.net.last_errno;
+ /*
+ Copy the error message. Note that we don't treat fatal
+ errors in the delayed thread as fatal errors in the
+ main thread. Use of my_message will enable stored
+ procedures continue handlers.
+ */
+ my_message(tmp->thd.net.last_errno, tmp->thd.net.last_error,
+ MYF(0));
}
tmp->unlock();
- goto err;
+ goto end_create;
}
if (thd->killed)
{
tmp->unlock();
- goto err;
+ goto end_create;
}
}
pthread_mutex_unlock(&LOCK_delayed_create);
}
pthread_mutex_lock(&tmp->mutex);
- table= tmp->get_local_table(thd);
+ table_list->table= tmp->get_local_table(thd);
pthread_mutex_unlock(&tmp->mutex);
- if (table)
+ if (table_list->table)
+ {
+ DBUG_ASSERT(thd->net.report_error == 0);
thd->di=tmp;
- else if (tmp->thd.is_fatal_error)
- thd->fatal_error();
+ }
/* Unlock the delayed insert object after its last access. */
tmp->unlock();
- DBUG_RETURN((table_list->table=table));
+ DBUG_RETURN(table_list->table == NULL);
- err1:
- thd->fatal_error();
- err:
+end_create:
pthread_mutex_unlock(&LOCK_delayed_create);
- DBUG_RETURN(0); // Continue with normal insert
+ DBUG_RETURN(thd->net.report_error);
}
-/*
- As we can't let many threads modify the same TABLE structure, we create
- an own structure for each tread. This includes a row buffer to save the
- column values and new fields that points to the new row buffer.
- The memory is allocated in the client thread and is freed automaticly.
+/**
+ As we can't let many client threads modify the same TABLE
+ structure of the dedicated delayed insert thread, we create an
+ own structure for each client thread. This includes a row
+ buffer to save the column values and new fields that point to
+ the new row buffer. The memory is allocated in the client
+ thread and is freed automatically.
+
+ @pre This function is called from the client thread. Delayed
+ insert thread mutex must be acquired before invoking this
+ function.
+
+ @return Not-NULL table object on success. NULL in case of an error,
+ which is set in client_thd.
*/
-TABLE *delayed_insert::get_local_table(THD* client_thd)
+TABLE *Delayed_insert::get_local_table(THD* client_thd)
{
my_ptrdiff_t adjust_ptrs;
Field **field,**org_field, *found_next_number_field;
TABLE *copy;
- DBUG_ENTER("delayed_insert::get_local_table");
+ DBUG_ENTER("Delayed_insert::get_local_table");
/* First request insert thread to get a lock */
status=1;
@@ -1709,8 +1889,7 @@ TABLE *delayed_insert::get_local_table(THD* client_thd)
goto error;
if (dead)
{
- strmov(client_thd->net.last_error,thd.net.last_error);
- client_thd->net.last_errno=thd.net.last_errno;
+ my_message(thd.net.last_errno, thd.net.last_error, MYF(0));
goto error;
}
}
@@ -1755,7 +1934,7 @@ TABLE *delayed_insert::get_local_table(THD* client_thd)
for (org_field= table->field; *org_field; org_field++, field++)
{
if (!(*field= (*org_field)->new_field(client_thd->mem_root, copy, 1)))
- DBUG_RETURN(0);
+ goto error;
(*field)->orig_table= copy; // Remove connection
(*field)->move_field(adjust_ptrs); // Point at copy->record[0]
if (*org_field == found_next_number_field)
@@ -1795,11 +1974,12 @@ TABLE *delayed_insert::get_local_table(THD* client_thd)
/* Put a question in queue */
-static int write_delayed(THD *thd,TABLE *table,enum_duplicates duplic, bool ignore,
- char *query, uint query_length, bool log_on)
+static
+int write_delayed(THD *thd,TABLE *table,enum_duplicates duplic, bool ignore,
+ char *query, uint query_length, bool log_on)
{
delayed_row *row=0;
- delayed_insert *di=thd->di;
+ Delayed_insert *di=thd->di;
DBUG_ENTER("write_delayed");
thd->proc_info="waiting for handler insert";
@@ -1863,11 +2043,15 @@ static int write_delayed(THD *thd,TABLE *table,enum_duplicates duplic, bool igno
DBUG_RETURN(1);
}
+/**
+ Signal the delayed insert thread that this user connection
+ is finished using it for this statement.
+*/
static void end_delayed_insert(THD *thd)
{
DBUG_ENTER("end_delayed_insert");
- delayed_insert *di=thd->di;
+ Delayed_insert *di=thd->di;
pthread_mutex_lock(&di->mutex);
DBUG_PRINT("info",("tables in use: %d",di->tables_in_use));
if (!--di->tables_in_use || di->thd.killed)
@@ -1886,8 +2070,8 @@ void kill_delayed_threads(void)
{
VOID(pthread_mutex_lock(&LOCK_delayed_insert)); // For unlink from list
- I_List_iterator<delayed_insert> it(delayed_threads);
- delayed_insert *tmp;
+ I_List_iterator<Delayed_insert> it(delayed_threads);
+ Delayed_insert *tmp;
while ((tmp=it++))
{
tmp->thd.killed= THD::KILL_CONNECTION;
@@ -1919,7 +2103,7 @@ void kill_delayed_threads(void)
pthread_handler_t handle_delayed_insert(void *arg)
{
- delayed_insert *di=(delayed_insert*) arg;
+ Delayed_insert *di=(Delayed_insert*) arg;
THD *thd= &di->thd;
pthread_detach_this_thread();
@@ -1975,6 +2159,15 @@ pthread_handler_t handle_delayed_insert(void *arg)
my_error(ER_ILLEGAL_HA, MYF(0), di->table_list.table_name);
goto end;
}
+ if (di->table->triggers)
+ {
+ /*
+ Table has triggers. This is not an error, but we do
+ not support triggers with delayed insert. Terminate the delayed
+ thread without an error and thus request lock upgrade.
+ */
+ goto end;
+ }
di->table->copy_blobs=1;
/* One can now use this */
@@ -2155,7 +2348,7 @@ static void free_delayed_insert_blobs(register TABLE *table)
}
-bool delayed_insert::handle_inserts(void)
+bool Delayed_insert::handle_inserts(void)
{
int error;
ulong max_rows;
@@ -2179,7 +2372,7 @@ bool delayed_insert::handle_inserts(void)
thd.proc_info="insert";
max_rows= delayed_insert_limit;
- if (thd.killed || table->s->version != refresh_version)
+ if (thd.killed || table->needs_reopen_or_name_lock())
{
thd.killed= THD::KILL_CONNECTION;
max_rows= ~(ulong)0; // Do as much as possible
@@ -2791,8 +2984,8 @@ bool select_insert::send_eof()
***************************************************************************/
/*
- Create table from lists of fields and items (or open existing table
- with same name).
+ Create table from lists of fields and items (or just return TABLE
+ object for pre-opened existing table).
SYNOPSIS
create_table_from_items()
@@ -2807,18 +3000,24 @@ bool select_insert::send_eof()
of fields for the table (corresponding fields will
be added to the end of alter_info->create_list)
lock out Pointer to the MYSQL_LOCK object for table created
- (open) will be returned in this parameter. Since
- this table is not included in THD::lock caller is
- responsible for explicitly unlocking this table.
+ (or open temporary table) will be returned in this
+ parameter. Since this table is not included in
+ THD::lock caller is responsible for explicitly
+ unlocking this table.
NOTES
- If 'create_info->options' bitmask has HA_LEX_CREATE_IF_NOT_EXISTS
- flag and table with name provided already exists then this function will
- simply open existing table.
- Also note that create, open and lock sequence in this function is not
- atomic and thus contains gap for deadlock and can cause other troubles.
- Since this function contains some logic specific to CREATE TABLE ... SELECT
- it should be changed before it can be used in other contexts.
+ This function behaves differently for base and temporary tables:
+ - For base table we assume that either table exists and was pre-opened
+ and locked at open_and_lock_tables() stage (and in this case we just
+ emit error or warning and return pre-opened TABLE object) or special
+ placeholder was put in table cache that guarantees that this table
+ won't be created or opened until the placeholder will be removed
+ (so there is an exclusive lock on this table).
+ - We don't pre-open existing temporary table, instead we either open
+ or create and then open table in this function.
+
+ Since this function contains some logic specific to CREATE TABLE ...
+ SELECT it should be changed before it can be used in other contexts.
RETURN VALUES
non-zero Pointer to TABLE object for table created or opened
@@ -2841,6 +3040,25 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
bool not_used;
DBUG_ENTER("create_table_from_items");
+ DBUG_EXECUTE_IF("sleep_create_select_before_check_if_exists", my_sleep(6000000););
+
+ if (!(create_info->options & HA_LEX_CREATE_TMP_TABLE) &&
+ create_table->table->db_stat)
+ {
+ /* Table already exists and was open at open_and_lock_tables() stage. */
+ if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
+ {
+ create_info->table_existed= 1; // Mark that table existed
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
+ create_table->table_name);
+ DBUG_RETURN(create_table->table);
+ }
+
+ my_error(ER_TABLE_EXISTS_ERROR, MYF(0), create_table->table_name);
+ DBUG_RETURN(0);
+ }
+
tmp_table.alias= 0;
tmp_table.timestamp_field= 0;
tmp_table.s= &tmp_table.share_not_to_be_used;
@@ -2869,8 +3087,15 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
cr_field->flags &= ~NOT_NULL_FLAG;
alter_info->create_list.push_back(cr_field);
}
+
+ DBUG_EXECUTE_IF("sleep_create_select_before_create", my_sleep(6000000););
+
/*
- create and lock table
+ Create and lock table.
+
+ Note that we either creating (or opening existing) temporary table or
+ creating base table on which name we have exclusive lock. So code below
+ should not cause deadlocks or races.
We don't log the statement, it will be logged later.
@@ -2880,59 +3105,70 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
don't want to delete from it) 2) it would be written before the CREATE
TABLE, which is a wrong order. So we keep binary logging disabled when we
open_table().
- NOTE: By locking table which we just have created (or for which we just have
- have found that it already exists) separately from other tables used by the
- statement we create potential window for deadlock.
- TODO: create and open should be done atomic !
*/
{
tmp_disable_binlog(thd);
if (!mysql_create_table(thd, create_table->db, create_table->table_name,
create_info, alter_info, 0, select_field_count))
{
- /*
- If we are here in prelocked mode we either create temporary table
- or prelocked mode is caused by the SELECT part of this statement.
- */
- DBUG_ASSERT(!thd->prelocked_mode ||
- create_info->options & HA_LEX_CREATE_TMP_TABLE ||
- thd->lex->requires_prelocking());
- /*
- NOTE: We don't want to ignore set of locked tables here if we are
- under explicit LOCK TABLES since it will open gap for deadlock
- too wide (and also is not backward compatible).
- */
- if (! (table= open_table(thd, create_table, thd->mem_root, (bool*) 0,
- (MYSQL_LOCK_IGNORE_FLUSH |
- ((thd->prelocked_mode == PRELOCKED) ?
- MYSQL_OPEN_IGNORE_LOCKED_TABLES:0)))))
- quick_rm_table(create_info->db_type, create_table->db,
- table_case_name(create_info, create_table->table_name));
+ if (create_info->table_existed &&
+ !(create_info->options & HA_LEX_CREATE_TMP_TABLE))
+ {
+ /*
+ This means that someone created table underneath server
+ or it was created via different mysqld front-end to the
+ cluster. We don't have much options but throw an error.
+ */
+ my_error(ER_TABLE_EXISTS_ERROR, MYF(0), create_table->table_name);
+ DBUG_RETURN(0);
+ }
+
+ DBUG_EXECUTE_IF("sleep_create_select_before_open", my_sleep(6000000););
+
+ if (!(create_info->options & HA_LEX_CREATE_TMP_TABLE))
+ {
+ VOID(pthread_mutex_lock(&LOCK_open));
+ if (reopen_name_locked_table(thd, create_table, FALSE))
+ {
+ quick_rm_table(create_info->db_type, create_table->db,
+ table_case_name(create_info,
+ create_table->table_name));
+ }
+ else
+ table= create_table->table;
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ }
+ else
+ {
+ if (!(table= open_table(thd, create_table, thd->mem_root, (bool*) 0,
+ MYSQL_OPEN_TEMPORARY_ONLY)) &&
+ !create_info->table_existed)
+ {
+ /*
+ This shouldn't happen as creation of temporary table should make
+ it preparable for open. But let us do close_temporary_table() here
+ just in case.
+ */
+ close_temporary_table(thd, create_table->db, create_table->table_name);
+ }
+ }
}
reenable_binlog(thd);
if (!table) // open failed
DBUG_RETURN(0);
}
- /*
- FIXME: What happens if trigger manages to be created while we are
- obtaining this lock ? May be it is sensible just to disable
- trigger execution in this case ? Or will MYSQL_LOCK_IGNORE_FLUSH
- save us from that ?
- */
+ DBUG_EXECUTE_IF("sleep_create_select_before_lock", my_sleep(6000000););
+
table->reginfo.lock_type=TL_WRITE;
if (! ((*lock)= mysql_lock_tables(thd, &table, 1,
MYSQL_LOCK_IGNORE_FLUSH, &not_used)))
{
- VOID(pthread_mutex_lock(&LOCK_open));
- hash_delete(&open_cache,(byte*) table);
- VOID(pthread_mutex_unlock(&LOCK_open));
- quick_rm_table(create_info->db_type, create_table->db,
- table_case_name(create_info, create_table->table_name));
+ if (!create_info->table_existed)
+ drop_open_table(thd, table, create_table->db, create_table->table_name);
DBUG_RETURN(0);
}
- table->file->extra(HA_EXTRA_WRITE_CACHE);
DBUG_RETURN(table);
}
@@ -2983,8 +3219,10 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES)));
- DBUG_RETURN(check_that_all_fields_are_given_values(thd, table,
- table_list));
+ if (check_that_all_fields_are_given_values(thd, table, table_list))
+ DBUG_RETURN(1);
+ table->file->extra(HA_EXTRA_WRITE_CACHE);
+ DBUG_RETURN(0);
}
@@ -3016,31 +3254,18 @@ bool select_create::send_eof()
{
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
- VOID(pthread_mutex_lock(&LOCK_open));
- mysql_unlock_tables(thd, lock);
- /*
- TODO:
- Check if we can remove the following two rows.
- We should be able to just keep the table in the table cache.
- */
- if (!table->s->tmp_table)
+ if (lock)
{
- ulong version= table->s->version;
- hash_delete(&open_cache,(byte*) table);
- /* Tell threads waiting for refresh that something has happened */
- if (version != refresh_version)
- broadcast_refresh();
+ mysql_unlock_tables(thd, lock);
+ lock= 0;
}
- lock=0;
- table=0;
- VOID(pthread_mutex_unlock(&LOCK_open));
}
return tmp;
}
+
void select_create::abort()
{
- VOID(pthread_mutex_lock(&LOCK_open));
if (lock)
{
mysql_unlock_tables(thd, lock);
@@ -3050,22 +3275,10 @@ void select_create::abort()
{
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
- enum db_type table_type=table->s->db_type;
- if (!table->s->tmp_table)
- {
- ulong version= table->s->version;
- hash_delete(&open_cache,(byte*) table);
- if (!create_info->table_existed)
- quick_rm_table(table_type, create_table->db, create_table->table_name);
- /* Tell threads waiting for refresh that something has happened */
- if (version != refresh_version)
- broadcast_refresh();
- }
- else if (!create_info->table_existed)
- close_temporary_table(thd, create_table->db, create_table->table_name);
+ if (!create_info->table_existed)
+ drop_open_table(thd, table, create_table->db, create_table->table_name);
table=0;
}
- VOID(pthread_mutex_unlock(&LOCK_open));
}
@@ -3076,8 +3289,8 @@ void select_create::abort()
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
template class List_iterator_fast<List_item>;
#ifndef EMBEDDED_LIBRARY
-template class I_List<delayed_insert>;
-template class I_List_iterator<delayed_insert>;
+template class I_List<Delayed_insert>;
+template class I_List_iterator<Delayed_insert>;
template class I_List<delayed_row>;
#endif /* EMBEDDED_LIBRARY */
#endif /* HAVE_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 3be844b6761..cbfba3d4d80 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -32,13 +32,13 @@ sys_var_long_ptr trg_new_row_fake_var(0, 0);
/* Macros to look like lex */
-#define yyGet() *(lex->ptr++)
-#define yyGetLast() lex->ptr[-1]
-#define yyPeek() lex->ptr[0]
-#define yyPeek2() lex->ptr[1]
-#define yyUnget() lex->ptr--
-#define yySkip() lex->ptr++
-#define yyLength() ((uint) (lex->ptr - lex->tok_start)-1)
+#define yyGet() *(lip->ptr++)
+#define yyGetLast() lip->ptr[-1]
+#define yyPeek() lip->ptr[0]
+#define yyPeek2() lip->ptr[1]
+#define yyUnget() lip->ptr--
+#define yySkip() lip->ptr++
+#define yyLength() ((uint) (lip->ptr - lip->tok_start)-1)
/* Longest standard keyword name */
#define TOCK_NAME_LENGTH 24
@@ -108,6 +108,29 @@ st_parsing_options::reset()
allows_derived= TRUE;
}
+Lex_input_stream::Lex_input_stream(THD *thd,
+ const char* buffer,
+ unsigned int length)
+: m_thd(thd),
+ yylineno(1),
+ yytoklen(0),
+ yylval(NULL),
+ ptr(buffer),
+ tok_start(NULL),
+ tok_end(NULL),
+ end_of_query(buffer + length),
+ tok_start_prev(NULL),
+ buf(buffer),
+ next_state(MY_LEX_START),
+ found_semicolon(NULL),
+ ignore_space(test(thd->variables.sql_mode & MODE_IGNORE_SPACE)),
+ stmt_prepare_mode(FALSE)
+{
+}
+
+Lex_input_stream::~Lex_input_stream()
+{}
+
/*
This is called before every query that is to be parsed.
@@ -115,14 +138,12 @@ st_parsing_options::reset()
(We already do too much here)
*/
-void lex_start(THD *thd, uchar *buf,uint length)
+void lex_start(THD *thd)
{
LEX *lex= thd->lex;
DBUG_ENTER("lex_start");
lex->thd= lex->unit.thd= thd;
- lex->buf= lex->ptr= buf;
- lex->end_of_query= buf+length;
lex->context_stack.empty();
lex->unit.init_query();
@@ -152,18 +173,15 @@ void lex_start(THD *thd, uchar *buf,uint length)
lex->describe= 0;
lex->subqueries= FALSE;
lex->view_prepare_mode= FALSE;
- lex->stmt_prepare_mode= FALSE;
lex->derived_tables= 0;
lex->lock_option= TL_READ;
- lex->found_semicolon= 0;
lex->safe_to_cache_query= 1;
lex->time_zone_tables_used= 0;
lex->leaf_tables_insert= 0;
lex->parsing_options.reset();
lex->empty_field_list_on_rset= 0;
lex->select_lex.select_number= 1;
- lex->next_state=MY_LEX_START;
- lex->yylineno = 1;
+
lex->in_comment=0;
lex->length=0;
lex->select_lex.in_sum_expr=0;
@@ -175,7 +193,6 @@ void lex_start(THD *thd, uchar *buf,uint length)
lex->select_lex.udf_list.empty();
lex->current_select= &lex->select_lex;
lex->yacc_yyss=lex->yacc_yyvs=0;
- lex->ignore_space=test(thd->variables.sql_mode & MODE_IGNORE_SPACE);
lex->sql_command= lex->orig_sql_command= SQLCOM_END;
lex->duplicates= DUP_ERROR;
lex->ignore= 0;
@@ -201,22 +218,22 @@ void lex_end(LEX *lex)
}
-static int find_keyword(LEX *lex, uint len, bool function)
+static int find_keyword(Lex_input_stream *lip, uint len, bool function)
{
- uchar *tok=lex->tok_start;
+ const char *tok= lip->tok_start;
- SYMBOL *symbol = get_hash_symbol((const char *)tok,len,function);
+ SYMBOL *symbol= get_hash_symbol(tok, len, function);
if (symbol)
{
- lex->yylval->symbol.symbol=symbol;
- lex->yylval->symbol.str= (char*) tok;
- lex->yylval->symbol.length=len;
+ lip->yylval->symbol.symbol=symbol;
+ lip->yylval->symbol.str= (char*) tok;
+ lip->yylval->symbol.length=len;
if ((symbol->tok == NOT_SYM) &&
- (lex->thd->variables.sql_mode & MODE_HIGH_NOT_PRECEDENCE))
+ (lip->m_thd->variables.sql_mode & MODE_HIGH_NOT_PRECEDENCE))
return NOT2_SYM;
if ((symbol->tok == OR_OR_SYM) &&
- !(lex->thd->variables.sql_mode & MODE_PIPES_AS_CONCAT))
+ !(lip->m_thd->variables.sql_mode & MODE_PIPES_AS_CONCAT))
return OR2_SYM;
return symbol->tok;
@@ -245,12 +262,12 @@ bool is_keyword(const char *name, uint len)
/* make a copy of token before ptr and set yytoklen */
-static LEX_STRING get_token(LEX *lex,uint length)
+static LEX_STRING get_token(Lex_input_stream *lip, uint skip, uint length)
{
LEX_STRING tmp;
yyUnget(); // ptr points now after last token char
- tmp.length=lex->yytoklen=length;
- tmp.str=(char*) lex->thd->strmake((char*) lex->tok_start,tmp.length);
+ tmp.length=lip->yytoklen=length;
+ tmp.str= lip->m_thd->strmake(lip->tok_start + skip, tmp.length);
return tmp;
}
@@ -261,16 +278,19 @@ static LEX_STRING get_token(LEX *lex,uint length)
future to operate multichar strings (like ucs2)
*/
-static LEX_STRING get_quoted_token(LEX *lex,uint length, char quote)
+static LEX_STRING get_quoted_token(Lex_input_stream *lip,
+ uint skip,
+ uint length, char quote)
{
LEX_STRING tmp;
byte *from, *to, *end;
yyUnget(); // ptr points now after last token char
- tmp.length=lex->yytoklen=length;
- tmp.str=(char*) lex->thd->alloc(tmp.length+1);
- for (from= (byte*) lex->tok_start, to= (byte*) tmp.str, end= to+length ;
- to != end ;
- )
+ tmp.length=lip->yytoklen=length;
+ tmp.str=(char*) lip->m_thd->alloc(tmp.length+1);
+ from= (byte*) lip->tok_start + skip;
+ to= (byte*) tmp.str;
+ end= to+length;
+ for ( ; to != end; )
{
if ((*to++= *from++) == quote)
from++; // Skip double quotes
@@ -285,15 +305,14 @@ static LEX_STRING get_quoted_token(LEX *lex,uint length, char quote)
Fix sometimes to do only one scan of the string
*/
-static char *get_text(LEX *lex)
+static char *get_text(Lex_input_stream *lip)
{
reg1 uchar c,sep;
uint found_escape=0;
- CHARSET_INFO *cs= lex->thd->charset();
+ CHARSET_INFO *cs= lip->m_thd->charset();
sep= yyGetLast(); // String should end with this
- //lex->tok_start=lex->ptr-1; // Remember '
- while (lex->ptr != lex->end_of_query)
+ while (lip->ptr != lip->end_of_query)
{
c = yyGet();
#ifdef USE_MB
@@ -301,18 +320,18 @@ static char *get_text(LEX *lex)
int l;
if (use_mb(cs) &&
(l = my_ismbchar(cs,
- (const char *)lex->ptr-1,
- (const char *)lex->end_of_query))) {
- lex->ptr += l-1;
+ lip->ptr-1,
+ lip->end_of_query))) {
+ lip->ptr += l-1;
continue;
}
}
#endif
if (c == '\\' &&
- !(lex->thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES))
+ !(lip->m_thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES))
{ // Escaped character
found_escape=1;
- if (lex->ptr == lex->end_of_query)
+ if (lip->ptr == lip->end_of_query)
return 0;
yySkip();
}
@@ -327,21 +346,23 @@ static char *get_text(LEX *lex)
yyUnget();
/* Found end. Unescape and return string */
- uchar *str,*end,*start;
+ const char *str;
+ const char *end;
+ char *start;
- str=lex->tok_start+1;
- end=lex->ptr-1;
- if (!(start=(uchar*) lex->thd->alloc((uint) (end-str)+1)))
+ str=lip->tok_start+1;
+ end=lip->ptr-1;
+ if (!(start=(char*) lip->m_thd->alloc((uint) (end-str)+1)))
return (char*) ""; // Sql_alloc has set error flag
if (!found_escape)
{
- lex->yytoklen=(uint) (end-str);
- memcpy(start,str,lex->yytoklen);
- start[lex->yytoklen]=0;
+ lip->yytoklen=(uint) (end-str);
+ memcpy(start,str,lip->yytoklen);
+ start[lip->yytoklen]=0;
}
else
{
- uchar *to;
+ char *to;
for (to=start ; str != end ; str++)
{
@@ -356,7 +377,7 @@ static char *get_text(LEX *lex)
continue;
}
#endif
- if (!(lex->thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) &&
+ if (!(lip->m_thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) &&
*str == '\\' && str+1 != end)
{
switch(*++str) {
@@ -393,7 +414,7 @@ static char *get_text(LEX *lex)
*to++ = *str;
}
*to=0;
- lex->yytoklen=(uint) (to-start);
+ lip->yytoklen=(uint) (to-start);
}
return (char*) start;
}
@@ -506,20 +527,21 @@ int MYSQLlex(void *arg, void *yythd)
int tokval, result_state;
uint length;
enum my_lex_states state;
- LEX *lex= ((THD *)yythd)->lex;
+ THD *thd= (THD *)yythd;
+ Lex_input_stream *lip= thd->m_lip;
+ LEX *lex= thd->lex;
YYSTYPE *yylval=(YYSTYPE*) arg;
- CHARSET_INFO *cs= ((THD *) yythd)->charset();
+ CHARSET_INFO *cs= thd->charset();
uchar *state_map= cs->state_map;
uchar *ident_map= cs->ident_map;
- lex->yylval=yylval; // The global state
+ lip->yylval=yylval; // The global state
- lex->tok_end_prev= lex->tok_end;
- lex->tok_start_prev= lex->tok_start;
+ lip->tok_start_prev= lip->tok_start;
- lex->tok_start=lex->tok_end=lex->ptr;
- state=lex->next_state;
- lex->next_state=MY_LEX_OPERATOR_OR_IDENT;
+ lip->tok_start=lip->tok_end=lip->ptr;
+ state=lip->next_state;
+ lip->next_state=MY_LEX_OPERATOR_OR_IDENT;
LINT_INIT(c);
for (;;)
{
@@ -530,9 +552,9 @@ int MYSQLlex(void *arg, void *yythd)
for (c=yyGet() ; (state_map[c] == MY_LEX_SKIP) ; c= yyGet())
{
if (c == '\n')
- lex->yylineno++;
+ lip->yylineno++;
}
- lex->tok_start=lex->ptr-1; // Start of real token
+ lip->tok_start=lip->ptr-1; // Start of real token
state= (enum my_lex_states) state_map[c];
break;
case MY_LEX_ESCAPE:
@@ -551,20 +573,20 @@ int MYSQLlex(void *arg, void *yythd)
state=MY_LEX_COMMENT;
break;
}
- yylval->lex_str.str=(char*) (lex->ptr=lex->tok_start);// Set to first chr
+ yylval->lex_str.str=(char*) (lip->ptr=lip->tok_start);// Set to first chr
yylval->lex_str.length=1;
c=yyGet();
if (c != ')')
- lex->next_state= MY_LEX_START; // Allow signed numbers
+ lip->next_state= MY_LEX_START; // Allow signed numbers
if (c == ',')
- lex->tok_start=lex->ptr; // Let tok_start point at next item
+ lip->tok_start=lip->ptr; // Let tok_start point at next item
/*
Check for a placeholder: it should not precede a possible identifier
because of binlogging: when a placeholder is replaced with
its value in a query for the binlog, the query must stay
grammatically correct.
*/
- else if (c == '?' && lex->stmt_prepare_mode && !ident_map[yyPeek()])
+ else if (c == '?' && lip->stmt_prepare_mode && !ident_map[yyPeek()])
return(PARAM_MARKER);
return((int) c);
@@ -575,14 +597,14 @@ int MYSQLlex(void *arg, void *yythd)
break;
}
/* Found N'string' */
- lex->tok_start++; // Skip N
+ lip->tok_start++; // Skip N
yySkip(); // Skip '
- if (!(yylval->lex_str.str = get_text(lex)))
+ if (!(yylval->lex_str.str = get_text(lip)))
{
state= MY_LEX_CHAR; // Read char by char
break;
}
- yylval->lex_str.length= lex->yytoklen;
+ yylval->lex_str.length= lip->yytoklen;
return(NCHAR_STRING);
case MY_LEX_IDENT_OR_HEX:
@@ -598,7 +620,7 @@ int MYSQLlex(void *arg, void *yythd)
break;
}
case MY_LEX_IDENT:
- uchar *start;
+ const char *start;
#if defined(USE_MB) && defined(USE_MB_IDENT)
if (use_mb(cs))
{
@@ -606,13 +628,13 @@ int MYSQLlex(void *arg, void *yythd)
if (my_mbcharlen(cs, yyGetLast()) > 1)
{
int l = my_ismbchar(cs,
- (const char *)lex->ptr-1,
- (const char *)lex->end_of_query);
+ lip->ptr-1,
+ lip->end_of_query);
if (l == 0) {
state = MY_LEX_CHAR;
continue;
}
- lex->ptr += l - 1;
+ lip->ptr += l - 1;
}
while (ident_map[c=yyGet()])
{
@@ -620,10 +642,10 @@ int MYSQLlex(void *arg, void *yythd)
{
int l;
if ((l = my_ismbchar(cs,
- (const char *)lex->ptr-1,
- (const char *)lex->end_of_query)) == 0)
+ lip->ptr-1,
+ lip->end_of_query)) == 0)
break;
- lex->ptr += l-1;
+ lip->ptr += l-1;
}
}
}
@@ -634,9 +656,9 @@ int MYSQLlex(void *arg, void *yythd)
/* If there were non-ASCII characters, mark that we must convert */
result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT;
}
- length= (uint) (lex->ptr - lex->tok_start)-1;
- start= lex->ptr;
- if (lex->ignore_space)
+ length= (uint) (lip->ptr - lip->tok_start)-1;
+ start= lip->ptr;
+ if (lip->ignore_space)
{
/*
If we find a space then this can't be an identifier. We notice this
@@ -644,19 +666,19 @@ int MYSQLlex(void *arg, void *yythd)
*/
for (; state_map[c] == MY_LEX_SKIP ; c= yyGet());
}
- if (start == lex->ptr && c == '.' && ident_map[yyPeek()])
- lex->next_state=MY_LEX_IDENT_SEP;
+ if (start == lip->ptr && c == '.' && ident_map[yyPeek()])
+ lip->next_state=MY_LEX_IDENT_SEP;
else
{ // '(' must follow directly if function
yyUnget();
- if ((tokval = find_keyword(lex,length,c == '(')))
+ if ((tokval = find_keyword(lip, length, c == '(')))
{
- lex->next_state= MY_LEX_START; // Allow signed numbers
+ lip->next_state= MY_LEX_START; // Allow signed numbers
return(tokval); // Was keyword
}
yySkip(); // next state does a unget
}
- yylval->lex_str=get_token(lex,length);
+ yylval->lex_str=get_token(lip, 0, length);
/*
Note: "SELECT _bla AS 'alias'"
@@ -673,12 +695,12 @@ int MYSQLlex(void *arg, void *yythd)
return(result_state); // IDENT or IDENT_QUOTED
case MY_LEX_IDENT_SEP: // Found ident and now '.'
- yylval->lex_str.str=(char*) lex->ptr;
+ yylval->lex_str.str=(char*) lip->ptr;
yylval->lex_str.length=1;
c=yyGet(); // should be '.'
- lex->next_state= MY_LEX_IDENT_START;// Next is an ident (not a keyword)
+ lip->next_state= MY_LEX_IDENT_START;// Next is an ident (not a keyword)
if (!ident_map[yyPeek()]) // Probably ` or "
- lex->next_state= MY_LEX_START;
+ lip->next_state= MY_LEX_START;
return((int) c);
case MY_LEX_NUMBER_IDENT: // number or ident which num-start
@@ -698,36 +720,32 @@ int MYSQLlex(void *arg, void *yythd)
{
yySkip();
while (my_isdigit(cs,yyGet())) ;
- yylval->lex_str=get_token(lex,yyLength());
+ yylval->lex_str=get_token(lip, 0, yyLength());
return(FLOAT_NUM);
}
}
yyUnget(); /* purecov: inspected */
}
- else if (c == 'x' && (lex->ptr - lex->tok_start) == 2 &&
- lex->tok_start[0] == '0' )
+ else if (c == 'x' && (lip->ptr - lip->tok_start) == 2 &&
+ lip->tok_start[0] == '0' )
{ // Varbinary
while (my_isxdigit(cs,(c = yyGet()))) ;
- if ((lex->ptr - lex->tok_start) >= 4 && !ident_map[c])
+ if ((lip->ptr - lip->tok_start) >= 4 && !ident_map[c])
{
- yylval->lex_str=get_token(lex,yyLength());
- yylval->lex_str.str+=2; // Skip 0x
- yylval->lex_str.length-=2;
- lex->yytoklen-=2;
+ /* skip '0x' */
+ yylval->lex_str=get_token(lip, 2, yyLength()-2);
return (HEX_NUM);
}
yyUnget();
}
- else if (c == 'b' && (lex->ptr - lex->tok_start) == 2 &&
- lex->tok_start[0] == '0' )
+ else if (c == 'b' && (lip->ptr - lip->tok_start) == 2 &&
+ lip->tok_start[0] == '0' )
{ // b'bin-number'
while (my_isxdigit(cs,(c = yyGet()))) ;
- if ((lex->ptr - lex->tok_start) >= 4 && !ident_map[c])
+ if ((lip->ptr - lip->tok_start) >= 4 && !ident_map[c])
{
- yylval->lex_str= get_token(lex, yyLength());
- yylval->lex_str.str+= 2; // Skip 0x
- yylval->lex_str.length-= 2;
- lex->yytoklen-= 2;
+ /* Skip '0b' */
+ yylval->lex_str= get_token(lip, 2, yyLength()-2);
return (BIN_NUM);
}
yyUnget();
@@ -745,10 +763,10 @@ int MYSQLlex(void *arg, void *yythd)
{
int l;
if ((l = my_ismbchar(cs,
- (const char *)lex->ptr-1,
- (const char *)lex->end_of_query)) == 0)
+ lip->ptr-1,
+ lip->end_of_query)) == 0)
break;
- lex->ptr += l-1;
+ lip->ptr += l-1;
}
}
}
@@ -760,16 +778,15 @@ int MYSQLlex(void *arg, void *yythd)
result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT;
}
if (c == '.' && ident_map[yyPeek()])
- lex->next_state=MY_LEX_IDENT_SEP;// Next is '.'
+ lip->next_state=MY_LEX_IDENT_SEP;// Next is '.'
- yylval->lex_str= get_token(lex,yyLength());
+ yylval->lex_str= get_token(lip, 0, yyLength());
return(result_state);
case MY_LEX_USER_VARIABLE_DELIMITER: // Found quote char
{
uint double_quotes= 0;
char quote_char= c; // Used char
- lex->tok_start=lex->ptr; // Skip first `
while ((c=yyGet()))
{
int var_length;
@@ -789,23 +806,24 @@ int MYSQLlex(void *arg, void *yythd)
#ifdef USE_MB
else if (var_length < 1)
break; // Error
- lex->ptr+= var_length-1;
+ lip->ptr+= var_length-1;
#endif
}
if (double_quotes)
- yylval->lex_str=get_quoted_token(lex,yyLength() - double_quotes,
+ yylval->lex_str=get_quoted_token(lip, 1,
+ yyLength() - double_quotes -1,
quote_char);
else
- yylval->lex_str=get_token(lex,yyLength());
+ yylval->lex_str=get_token(lip, 1, yyLength() -1);
if (c == quote_char)
yySkip(); // Skip end `
- lex->next_state= MY_LEX_START;
+ lip->next_state= MY_LEX_START;
return(IDENT_QUOTED);
}
- case MY_LEX_INT_OR_REAL: // Compleat int or incompleat real
+ case MY_LEX_INT_OR_REAL: // Complete int or incomplete real
if (c != '.')
{ // Found complete integer number.
- yylval->lex_str=get_token(lex,yyLength());
+ yylval->lex_str=get_token(lip, 0, yyLength());
return int_token(yylval->lex_str.str,yylval->lex_str.length);
}
// fall through
@@ -823,47 +841,45 @@ int MYSQLlex(void *arg, void *yythd)
break;
}
while (my_isdigit(cs,yyGet())) ;
- yylval->lex_str=get_token(lex,yyLength());
+ yylval->lex_str=get_token(lip, 0, yyLength());
return(FLOAT_NUM);
}
- yylval->lex_str=get_token(lex,yyLength());
+ yylval->lex_str=get_token(lip, 0, yyLength());
return(DECIMAL_NUM);
case MY_LEX_HEX_NUMBER: // Found x'hexstring'
yyGet(); // Skip '
while (my_isxdigit(cs,(c = yyGet()))) ;
- length=(lex->ptr - lex->tok_start); // Length of hexnum+3
+ length=(lip->ptr - lip->tok_start); // Length of hexnum+3
if (!(length & 1) || c != '\'')
{
return(ABORT_SYM); // Illegal hex constant
}
yyGet(); // get_token makes an unget
- yylval->lex_str=get_token(lex,length);
- yylval->lex_str.str+=2; // Skip x'
- yylval->lex_str.length-=3; // Don't count x' and last '
- lex->yytoklen-=3;
+ yylval->lex_str=get_token(lip,
+ 2, // skip x'
+ length-3); // don't count x' and last '
return (HEX_NUM);
case MY_LEX_BIN_NUMBER: // Found b'bin-string'
yyGet(); // Skip '
while ((c= yyGet()) == '0' || c == '1');
- length= (lex->ptr - lex->tok_start); // Length of bin-num + 3
+ length= (lip->ptr - lip->tok_start); // Length of bin-num + 3
if (c != '\'')
return(ABORT_SYM); // Illegal hex constant
yyGet(); // get_token makes an unget
- yylval->lex_str= get_token(lex, length);
- yylval->lex_str.str+= 2; // Skip b'
- yylval->lex_str.length-= 3; // Don't count b' and last '
- lex->yytoklen-= 3;
- return (BIN_NUM);
+ yylval->lex_str= get_token(lip,
+ 2, // skip b'
+ length-3); // don't count b' and last '
+ return (BIN_NUM);
case MY_LEX_CMP_OP: // Incomplete comparison operator
if (state_map[yyPeek()] == MY_LEX_CMP_OP ||
state_map[yyPeek()] == MY_LEX_LONG_CMP_OP)
yySkip();
- if ((tokval = find_keyword(lex,(uint) (lex->ptr - lex->tok_start),0)))
+ if ((tokval = find_keyword(lip,(uint) (lip->ptr - lip->tok_start),0)))
{
- lex->next_state= MY_LEX_START; // Allow signed numbers
+ lip->next_state= MY_LEX_START; // Allow signed numbers
return(tokval);
}
state = MY_LEX_CHAR; // Something fishy found
@@ -877,9 +893,9 @@ int MYSQLlex(void *arg, void *yythd)
if (state_map[yyPeek()] == MY_LEX_CMP_OP)
yySkip();
}
- if ((tokval = find_keyword(lex,(uint) (lex->ptr - lex->tok_start),0)))
+ if ((tokval = find_keyword(lip,(uint) (lip->ptr - lip->tok_start),0)))
{
- lex->next_state= MY_LEX_START; // Found long op
+ lip->next_state= MY_LEX_START; // Found long op
return(tokval);
}
state = MY_LEX_CHAR; // Something fishy found
@@ -892,24 +908,24 @@ int MYSQLlex(void *arg, void *yythd)
break;
}
yySkip();
- tokval = find_keyword(lex,2,0); // Is a bool operator
- lex->next_state= MY_LEX_START; // Allow signed numbers
+ tokval = find_keyword(lip,2,0); // Is a bool operator
+ lip->next_state= MY_LEX_START; // Allow signed numbers
return(tokval);
case MY_LEX_STRING_OR_DELIMITER:
- if (((THD *) yythd)->variables.sql_mode & MODE_ANSI_QUOTES)
+ if (thd->variables.sql_mode & MODE_ANSI_QUOTES)
{
state= MY_LEX_USER_VARIABLE_DELIMITER;
break;
}
/* " used for strings */
case MY_LEX_STRING: // Incomplete text string
- if (!(yylval->lex_str.str = get_text(lex)))
+ if (!(yylval->lex_str.str = get_text(lip)))
{
state= MY_LEX_CHAR; // Read char by char
break;
}
- yylval->lex_str.length=lex->yytoklen;
+ yylval->lex_str.length=lip->yytoklen;
return(TEXT_STRING);
case MY_LEX_COMMENT: // Comment
@@ -933,7 +949,7 @@ int MYSQLlex(void *arg, void *yythd)
state=MY_LEX_START;
if (my_isdigit(cs,yyPeek()))
{ // Version number
- version=strtol((char*) lex->ptr,(char**) &lex->ptr,10);
+ version=strtol((char*) lip->ptr,(char**) &lip->ptr,10);
}
if (version <= MYSQL_VERSION_ID)
{
@@ -941,13 +957,13 @@ int MYSQLlex(void *arg, void *yythd)
break;
}
}
- while (lex->ptr != lex->end_of_query &&
+ while (lip->ptr != lip->end_of_query &&
((c=yyGet()) != '*' || yyPeek() != '/'))
{
if (c == '\n')
- lex->yylineno++;
+ lip->yylineno++;
}
- if (lex->ptr != lex->end_of_query)
+ if (lip->ptr != lip->end_of_query)
yySkip(); // remove last '/'
state = MY_LEX_START; // Try again
break;
@@ -972,14 +988,13 @@ int MYSQLlex(void *arg, void *yythd)
case MY_LEX_SEMICOLON: // optional line terminator
if (yyPeek())
{
- THD* thd= (THD*)yythd;
if ((thd->client_capabilities & CLIENT_MULTI_STATEMENTS) &&
- !lex->stmt_prepare_mode)
+ !lip->stmt_prepare_mode)
{
lex->safe_to_cache_query= 0;
- lex->found_semicolon=(char*) lex->ptr;
+ lip->found_semicolon= lip->ptr;
thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
- lex->next_state= MY_LEX_END;
+ lip->next_state= MY_LEX_END;
return (END_OF_INPUT);
}
state= MY_LEX_CHAR; // Return ';'
@@ -987,15 +1002,15 @@ int MYSQLlex(void *arg, void *yythd)
}
/* fall true */
case MY_LEX_EOL:
- if (lex->ptr >= lex->end_of_query)
+ if (lip->ptr >= lip->end_of_query)
{
- lex->next_state=MY_LEX_END; // Mark for next loop
+ lip->next_state=MY_LEX_END; // Mark for next loop
return(END_OF_INPUT);
}
state=MY_LEX_CHAR;
break;
case MY_LEX_END:
- lex->next_state=MY_LEX_END;
+ lip->next_state=MY_LEX_END;
return(0); // We found end of input last time
/* Actually real shouldn't start with . but allow them anyhow */
@@ -1015,26 +1030,26 @@ int MYSQLlex(void *arg, void *yythd)
case MY_LEX_STRING_OR_DELIMITER:
break;
case MY_LEX_USER_END:
- lex->next_state=MY_LEX_SYSTEM_VAR;
+ lip->next_state=MY_LEX_SYSTEM_VAR;
break;
default:
- lex->next_state=MY_LEX_HOSTNAME;
+ lip->next_state=MY_LEX_HOSTNAME;
break;
}
- yylval->lex_str.str=(char*) lex->ptr;
+ yylval->lex_str.str=(char*) lip->ptr;
yylval->lex_str.length=1;
return((int) '@');
case MY_LEX_HOSTNAME: // end '@' of user@hostname
for (c=yyGet() ;
my_isalnum(cs,c) || c == '.' || c == '_' || c == '$';
c= yyGet()) ;
- yylval->lex_str=get_token(lex,yyLength());
+ yylval->lex_str=get_token(lip, 0, yyLength());
return(LEX_HOSTNAME);
case MY_LEX_SYSTEM_VAR:
- yylval->lex_str.str=(char*) lex->ptr;
+ yylval->lex_str.str=(char*) lip->ptr;
yylval->lex_str.length=1;
yySkip(); // Skip '@'
- lex->next_state= (state_map[yyPeek()] ==
+ lip->next_state= (state_map[yyPeek()] ==
MY_LEX_USER_VARIABLE_DELIMITER ?
MY_LEX_OPERATOR_OR_IDENT :
MY_LEX_IDENT_OR_KEYWORD);
@@ -1051,16 +1066,16 @@ int MYSQLlex(void *arg, void *yythd)
result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT;
if (c == '.')
- lex->next_state=MY_LEX_IDENT_SEP;
- length= (uint) (lex->ptr - lex->tok_start)-1;
+ lip->next_state=MY_LEX_IDENT_SEP;
+ length= (uint) (lip->ptr - lip->tok_start)-1;
if (length == 0)
return(ABORT_SYM); // Names must be nonempty.
- if ((tokval= find_keyword(lex,length,0)))
+ if ((tokval= find_keyword(lip, length,0)))
{
yyUnget(); // Put back 'c'
return(tokval); // Was keyword
}
- yylval->lex_str=get_token(lex,length);
+ yylval->lex_str=get_token(lip, 0, length);
return(result_state);
}
}
@@ -1083,6 +1098,7 @@ Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root)
SYNOPSIS
skip_rear_comments()
+ cs character set
begin pointer to the beginning of statement
end pointer to the end of statement
@@ -1093,10 +1109,11 @@ Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root)
Pointer to the last non-comment symbol of the statement.
*/
-uchar *skip_rear_comments(uchar *begin, uchar *end)
+char *skip_rear_comments(CHARSET_INFO *cs, char *begin, char *end)
{
- while (begin < end && (end[-1] <= ' ' || end[-1] == '*' ||
- end[-1] == '/' || end[-1] == ';'))
+ while (begin < end && (end[-1] == '*' ||
+ end[-1] == '/' || end[-1] == ';' ||
+ my_isspace(cs, end[-1])))
end-= 1;
return end;
}
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 2ff29d684d1..f8405ef14ca 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -470,7 +470,7 @@ public:
void set_thd(THD *thd_arg) { thd= thd_arg; }
inline bool is_union ();
- friend void lex_start(THD *thd, uchar *buf, uint length);
+ friend void lex_start(THD *thd);
friend int subselect_union_engine::exec();
List<Item> *get_unit_column_types();
@@ -676,7 +676,7 @@ public:
void cut_subtree() { slave= 0; }
bool test_limit();
- friend void lex_start(THD *thd, uchar *buf, uint length);
+ friend void lex_start(THD *thd);
st_select_lex() : n_sum_items(0), n_child_sum_items(0) {}
void make_empty_select()
{
@@ -886,6 +886,12 @@ public:
query_tables_own_last= 0;
}
}
+ /**
+ true if the parsed tree contains references to stored procedures
+ or functions, false otherwise
+ */
+ bool uses_stored_routines() const
+ { return sroutines_list.elements != 0; }
};
@@ -906,30 +912,78 @@ struct st_parsing_options
};
+/**
+ This class represents the character input stream consumed during
+ lexical analysis.
+*/
+class Lex_input_stream
+{
+public:
+ Lex_input_stream(THD *thd, const char* buff, unsigned int length);
+ ~Lex_input_stream();
+
+ /** Current thread. */
+ THD *m_thd;
+
+ /** Current line number. */
+ uint yylineno;
+
+ /** Length of the last token parsed. */
+ uint yytoklen;
+
+ /** Interface with bison, value of the last token parsed. */
+ LEX_YYSTYPE yylval;
+
+ /** Pointer to the current position in the input stream. */
+ const char* ptr;
+
+ /** Starting position of the last token parsed. */
+ const char* tok_start;
+
+ /** Ending position of the last token parsed. */
+ const char* tok_end;
+
+ /** End of the query text in the input stream. */
+ const char* end_of_query;
+
+ /** Starting position of the previous token parsed. */
+ const char* tok_start_prev;
+
+ /** Begining of the query text in the input stream. */
+ const char* buf;
+
+ /** Current state of the lexical analyser. */
+ enum my_lex_states next_state;
+
+ /** Position of ';' in the stream, to delimit multiple queries. */
+ const char* found_semicolon;
+
+ /** SQL_MODE = IGNORE_SPACE. */
+ bool ignore_space;
+ /*
+ TRUE if we're parsing a prepared statement: in this mode
+ we should allow placeholders and disallow multi-statements.
+ */
+ bool stmt_prepare_mode;
+};
+
+
/* The state of the lex parsing. This is saved in the THD struct */
typedef struct st_lex : public Query_tables_list
{
- uint yylineno,yytoklen; /* Simulate lex */
- LEX_YYSTYPE yylval;
SELECT_LEX_UNIT unit; /* most upper unit */
SELECT_LEX select_lex; /* first SELECT_LEX */
/* current SELECT_LEX in parsing */
SELECT_LEX *current_select;
/* list of all SELECT_LEX */
SELECT_LEX *all_selects_list;
- uchar *buf; /* The beginning of string, used by SPs */
- uchar *ptr,*tok_start,*tok_end,*end_of_query;
-
- /* The values of tok_start/tok_end as they were one call of MYSQLlex before */
- uchar *tok_start_prev, *tok_end_prev;
char *length,*dec,*change,*name;
char *help_arg;
char *backup_dir; /* For RESTORE/BACKUP */
char* to_log; /* For PURGE MASTER LOGS TO */
char* x509_subject,*x509_issuer,*ssl_cipher;
- char* found_semicolon; /* For multi queries - next query */
String *wild;
sql_exchange *exchange;
select_result *result;
@@ -998,7 +1052,6 @@ typedef struct st_lex : public Query_tables_list
enum_sql_command sql_command, orig_sql_command;
thr_lock_type lock_option;
enum SSL_type ssl_type; /* defined in violite.h */
- enum my_lex_states next_state;
enum enum_duplicates duplicates;
enum enum_tx_isolation tx_isolation;
enum enum_ha_read_modes ha_read_mode;
@@ -1030,7 +1083,7 @@ typedef struct st_lex : public Query_tables_list
uint8 create_view_algorithm;
uint8 create_view_check;
bool drop_if_exists, drop_temporary, local_file, one_shot_set;
- bool in_comment, ignore_space, verbose, no_write_to_binlog;
+ bool in_comment, verbose, no_write_to_binlog;
bool tx_chain, tx_release;
/*
Special JOIN::prepare mode: changing of query is prohibited.
@@ -1040,11 +1093,6 @@ typedef struct st_lex : public Query_tables_list
to an .frm file. We need this definition to stay untouched.
*/
bool view_prepare_mode;
- /*
- TRUE if we're parsing a prepared statement: in this mode
- we should allow placeholders and disallow multistatements.
- */
- bool stmt_prepare_mode;
bool safe_to_cache_query;
bool subqueries, ignore;
st_parsing_options parsing_options;
@@ -1109,8 +1157,9 @@ typedef struct st_lex : public Query_tables_list
Pointers to part of LOAD DATA statement that should be rewritten
during replication ("LOCAL 'filename' REPLACE INTO" part).
*/
- uchar *fname_start, *fname_end;
-
+ const char *fname_start;
+ const char *fname_end;
+
bool escape_used;
st_lex();
@@ -1219,7 +1268,7 @@ struct st_lex_local: public st_lex
extern void lex_init(void);
extern void lex_free(void);
-extern void lex_start(THD *thd, uchar *buf,uint length);
+extern void lex_start(THD *thd);
extern void lex_end(LEX *lex);
extern int MYSQLlex(void *arg, void *yythd);
-extern uchar *skip_rear_comments(uchar *begin, uchar *end);
+extern char *skip_rear_comments(CHARSET_INFO *cs, char *begin, char *end);
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index ee6d2d0a572..c2267ba5dfc 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -414,9 +414,6 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
if (error)
{
- if (transactional_table)
- ha_autocommit_or_rollback(thd,error);
-
if (read_file_from_client)
while (!read_info.next_line())
;
@@ -460,6 +457,9 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
}
}
#endif /*!EMBEDDED_LIBRARY*/
+ if (transactional_table)
+ ha_autocommit_or_rollback(thd,error);
+
error= -1; // Error on read
goto err;
}
@@ -585,6 +585,8 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_TOO_FEW_RECORDS,
ER(ER_WARN_TOO_FEW_RECORDS), thd->row_count);
+ if (!field->maybe_null() && field->type() == FIELD_TYPE_TIMESTAMP)
+ ((Field_timestamp*) field)->set_time();
}
else
{
@@ -770,6 +772,8 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
thd->row_count);
DBUG_RETURN(1);
}
+ if (!field->maybe_null() && field->type() == FIELD_TYPE_TIMESTAMP)
+ ((Field_timestamp*) field)->set_time();
/*
QQ: We probably should not throw warning for each field.
But how about intention to always have the same number
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 35089bbb251..709083f736a 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -75,6 +75,7 @@ static bool check_db_used(THD *thd,TABLE_LIST *tables);
static void remove_escape(char *name);
static bool append_file_to_dir(THD *thd, const char **filename_ptr,
const char *table_name);
+static bool check_show_create_table_access(THD *thd, TABLE_LIST *table);
const char *any_db="*any*"; // Special symbol for check_access
@@ -1008,9 +1009,12 @@ static int check_connection(THD *thd)
Old clients send null-terminated string as password; new clients send
the size (1 byte) + string (not null-terminated). Hence in case of empty
password both send '\0'.
+
+ Cast *passwd to an unsigned char, so that it doesn't extend the sign for
+ *passwd > 127 and become 2**32-127 after casting to uint.
*/
uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
- *passwd++ : strlen(passwd);
+ (uchar)(*passwd++) : strlen(passwd);
db= thd->client_capabilities & CLIENT_CONNECT_WITH_DB ?
db + passwd_len + 1 : 0;
uint db_len= db ? strlen(db) : 0;
@@ -1139,8 +1143,8 @@ pthread_handler_t handle_one_connection(void *arg)
net->no_send_error= 0;
/* Use "connect_timeout" value during connection phase */
- net_set_read_timeout(net, connect_timeout);
- net_set_write_timeout(net, connect_timeout);
+ my_net_set_read_timeout(net, connect_timeout);
+ my_net_set_write_timeout(net, connect_timeout);
if ((error=check_connection(thd)))
{ // Wrong permissions
@@ -1183,8 +1187,8 @@ pthread_handler_t handle_one_connection(void *arg)
}
/* Connect completed, set read/write timeouts back to tdefault */
- net_set_read_timeout(net, thd->variables.net_read_timeout);
- net_set_write_timeout(net, thd->variables.net_write_timeout);
+ my_net_set_read_timeout(net, thd->variables.net_read_timeout);
+ my_net_set_write_timeout(net, thd->variables.net_write_timeout);
while (!net->error && net->vio != 0 &&
!(thd->killed == THD::KILL_CONNECTION))
@@ -1238,6 +1242,7 @@ pthread_handler_t handle_bootstrap(void *arg)
THD *thd=(THD*) arg;
FILE *file=bootstrap_file;
char *buff;
+ const char* found_semicolon= NULL;
/* The following must be called before DBUG_ENTER */
thd->thread_stack= (char*) &thd;
@@ -1314,7 +1319,7 @@ pthread_handler_t handle_bootstrap(void *arg)
*/
thd->query_id=next_query_id();
thd->set_time();
- mysql_parse(thd,thd->query,length);
+ mysql_parse(thd, thd->query, length, & found_semicolon);
close_thread_tables(thd); // Free tables
if (thd->is_fatal_error)
@@ -1535,7 +1540,7 @@ bool do_command(THD *thd)
the client, the connection is closed or "net_wait_timeout"
number of seconds has passed
*/
- net_set_read_timeout(net, thd->variables.net_wait_timeout);
+ my_net_set_read_timeout(net, thd->variables.net_wait_timeout);
thd->clear_error(); // Clear error message
@@ -1567,7 +1572,7 @@ bool do_command(THD *thd)
}
/* Restore read timeout value */
- net_set_read_timeout(net, thd->variables.net_read_timeout);
+ my_net_set_read_timeout(net, thd->variables.net_read_timeout);
/*
packet_length contains length of data, as it was stored in packet
@@ -1695,11 +1700,14 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
Old clients send null-terminated string ('\0' for empty string) for
password. New clients send the size (1 byte) + string (not null
terminated, so also '\0' for empty string).
+
+ Cast *passwd to an unsigned char, so that it doesn't extend the sign
+ for *passwd > 127 and become 2**32-127 after casting to uint.
*/
char db_buff[NAME_LEN+1]; // buffer to store db in utf8
char *db= passwd;
uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
- *passwd++ : strlen(passwd);
+ (uchar)(*passwd++) : strlen(passwd);
db+= passwd_len + 1;
#ifndef EMBEDDED_LIBRARY
/* Small check for incoming packet */
@@ -1793,17 +1801,19 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
char *packet_end= thd->query + thd->query_length;
/* 'b' stands for 'buffer' parameter', special for 'my_snprintf' */
const char *format= "%.*b";
+ const char* found_semicolon= NULL;
+
mysql_log.write(thd,command, format, thd->query_length, thd->query);
DBUG_PRINT("query",("%-.4096s",thd->query));
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),QUERY_PRIOR);
- mysql_parse(thd,thd->query, thd->query_length);
+ mysql_parse(thd, thd->query, thd->query_length, & found_semicolon);
- while (!thd->killed && thd->lex->found_semicolon && !thd->net.report_error)
+ while (!thd->killed && found_semicolon && !thd->net.report_error)
{
- char *next_packet= thd->lex->found_semicolon;
+ char *next_packet= (char*) found_semicolon;
net->no_send_error= 0;
/*
Multiple queries exits, execute them individually
@@ -1828,7 +1838,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->set_time(); /* Reset the query start time. */
/* TODO: set thd->lex->sql_command to SQLCOM_END here */
VOID(pthread_mutex_unlock(&LOCK_thread_count));
- mysql_parse(thd, next_packet, length);
+ mysql_parse(thd, next_packet, length, & found_semicolon);
}
if (!(specialflag & SPECIAL_NO_PRIOR))
@@ -1849,7 +1859,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
LEX_STRING conv_name;
/* used as fields initializator */
- lex_start(thd, 0, 0);
+ lex_start(thd);
statistic_increment(thd->status_var.com_stat[SQLCOM_SHOW_FIELDS],
&LOCK_status);
@@ -1886,7 +1896,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break;
/* init structures for VIEW processing */
table_list.select_lex= &(thd->lex->select_lex);
- mysql_init_query(thd, (uchar*)"", 0);
+
+ lex_start(thd);
+ mysql_reset_thd_for_next_command(thd);
+
thd->lex->
select_lex.table_list.link_in_list((byte*) &table_list,
(byte**) &table_list.next_local);
@@ -3008,7 +3021,13 @@ mysql_execute_command(THD *thd)
select_lex->options|= SELECT_NO_UNLOCK;
unit->set_limit(select_lex);
- if (!(res= open_and_lock_tables(thd, select_tables)))
+ if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))
+ {
+ lex->link_first_table_back(create_table, link_to_local);
+ create_table->create= TRUE;
+ }
+
+ if (!(res= open_and_lock_tables(thd, lex->query_tables)))
{
/*
Is table which we are changing used somewhere in other parts
@@ -3017,6 +3036,7 @@ mysql_execute_command(THD *thd)
if (!(create_info.options & HA_LEX_CREATE_TMP_TABLE))
{
TABLE_LIST *duplicate;
+ create_table= lex->unlink_first_table(&link_to_local);
if ((duplicate= unique_table(thd, create_table, select_tables, 0)))
{
update_non_unique_table_error(create_table, "CREATE", duplicate);
@@ -3060,13 +3080,16 @@ mysql_execute_command(THD *thd)
delete sel_result;
}
}
+ else if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))
+ create_table= lex->unlink_first_table(&link_to_local);
+
}
else
{
/* regular create */
- if (lex->name)
- res= mysql_create_like_table(thd, create_table, &create_info,
- (Table_ident *)lex->name);
+ if (lex->create_info.options & HA_LEX_CREATE_TABLE_LIKE)
+ res= mysql_create_like_table(thd, create_table, select_tables,
+ &create_info);
else
{
res= mysql_create_table(thd, create_table->db,
@@ -3303,11 +3326,7 @@ end_with_restore_list:
first_table->skip_temporary= 1;
if (check_db_used(thd, all_tables) ||
- check_access(thd, SELECT_ACL | EXTRA_ACL, first_table->db,
- &first_table->grant.privilege, 0, 0,
- test(first_table->schema_table)))
- goto error;
- if (grant_option && check_grant(thd, SELECT_ACL, all_tables, 2, UINT_MAX, 0))
+ check_show_create_table_access(thd, first_table))
goto error;
res= mysqld_show_create(thd, first_table);
break;
@@ -5261,7 +5280,8 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
if (schema_db)
{
- if (want_access & ~(SELECT_ACL | EXTRA_ACL))
+ if (!(sctx->master_access & FILE_ACL) && (want_access & FILE_ACL) ||
+ (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
{
if (!no_errors)
{
@@ -5774,20 +5794,6 @@ bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, ulong *yystacksize)
}
-/****************************************************************************
- Initialize global thd variables needed for query
-****************************************************************************/
-
-void
-mysql_init_query(THD *thd, uchar *buf, uint length)
-{
- DBUG_ENTER("mysql_init_query");
- lex_start(thd, buf, length);
- mysql_reset_thd_for_next_command(thd);
- DBUG_VOID_RETURN;
-}
-
-
/*
Reset THD part responsible for command processing state.
@@ -5974,21 +5980,55 @@ void mysql_init_multi_delete(LEX *lex)
mysql_test_parse_for_slave() in this same file.
*/
-void mysql_parse(THD *thd, char *inBuf, uint length)
+/**
+ Parse a query.
+ @param thd Current thread
+ @param inBuf Begining of the query text
+ @param length Length of the query text
+ @param [out] semicolon For multi queries, position of the character of
+ the next query in the query text.
+*/
+
+void mysql_parse(THD *thd, const char *inBuf, uint length,
+ const char ** found_semicolon)
{
DBUG_ENTER("mysql_parse");
DBUG_EXECUTE_IF("parser_debug", turn_parser_debug_on(););
- mysql_init_query(thd, (uchar*) inBuf, length);
- if (query_cache_send_result_to_client(thd, inBuf, length) <= 0)
+ /*
+ Warning.
+ The purpose of query_cache_send_result_to_client() is to lookup the
+ query in the query cache first, to avoid parsing and executing it.
+ So, the natural implementation would be to:
+ - first, call query_cache_send_result_to_client,
+ - second, if caching failed, initialise the lexical and syntactic parser.
+ The problem is that the query cache depends on a clean initialization
+ of (among others) lex->safe_to_cache_query and thd->server_status,
+ which are reset respectively in
+ - lex_start()
+ - mysql_reset_thd_for_next_command()
+ So, initializing the lexical analyser *before* using the query cache
+ is required for the cache to work properly.
+ FIXME: cleanup the dependencies in the code to simplify this.
+ */
+ lex_start(thd);
+ mysql_reset_thd_for_next_command(thd);
+
+ if (query_cache_send_result_to_client(thd, (char*) inBuf, length) <= 0)
{
LEX *lex= thd->lex;
-
+
sp_cache_flush_obsolete(&thd->sp_proc_cache);
sp_cache_flush_obsolete(&thd->sp_func_cache);
-
- if (!MYSQLparse((void *)thd) && ! thd->is_fatal_error)
+
+ Lex_input_stream lip(thd, inBuf, length);
+ thd->m_lip= &lip;
+
+ int err= MYSQLparse(thd);
+ *found_semicolon= lip.found_semicolon;
+
+ if (!err && ! thd->is_fatal_error)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (mqh_used && thd->user_connect &&
@@ -6011,8 +6051,8 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
PROCESSLIST.
Note that we don't need LOCK_thread_count to modify query_length.
*/
- if (lex->found_semicolon &&
- (thd->query_length= (ulong)(lex->found_semicolon - thd->query)))
+ if (lip.found_semicolon &&
+ (thd->query_length= (ulong)(lip.found_semicolon - thd->query)))
thd->query_length--;
/* Actually execute the query */
mysql_execute_command(thd);
@@ -6039,6 +6079,12 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
thd->cleanup_after_query();
DBUG_ASSERT(thd->change_list.is_empty());
}
+ else
+ {
+ /* There are no multi queries in the cache. */
+ *found_semicolon= NULL;
+ }
+
DBUG_VOID_RETURN;
}
@@ -6059,8 +6105,13 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length)
bool error= 0;
DBUG_ENTER("mysql_test_parse_for_slave");
- mysql_init_query(thd, (uchar*) inBuf, length);
- if (!MYSQLparse((void*) thd) && ! thd->is_fatal_error &&
+ Lex_input_stream lip(thd, inBuf, length);
+ thd->m_lip= &lip;
+ lex_start(thd);
+ mysql_reset_thd_for_next_command(thd);
+ int err= MYSQLparse((void*) thd);
+
+ if (!err && ! thd->is_fatal_error &&
all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first))
error= 1; /* Ignore question */
thd->end_statement();
@@ -7119,8 +7170,9 @@ bool check_simple_select()
if (lex->current_select != &lex->select_lex)
{
char command[80];
- strmake(command, lex->yylval->symbol.str,
- min(lex->yylval->symbol.length, sizeof(command)-1));
+ Lex_input_stream *lip= thd->m_lip;
+ strmake(command, lip->yylval->symbol.str,
+ min(lip->yylval->symbol.length, sizeof(command)-1));
my_error(ER_CANT_USE_OPTION_HERE, MYF(0), command);
return 1;
}
@@ -7470,6 +7522,25 @@ bool insert_precheck(THD *thd, TABLE_LIST *tables)
}
+/**
+ @brief Check privileges for SHOW CREATE TABLE statement.
+
+ @param thd Thread context
+ @param table Target table
+
+ @retval TRUE Failure
+ @retval FALSE Success
+*/
+
+static bool check_show_create_table_access(THD *thd, TABLE_LIST *table)
+{
+ return check_access(thd, SELECT_ACL | EXTRA_ACL, table->db,
+ &table->grant.privilege, 0, 0,
+ test(table->schema_table)) ||
+ grant_option && check_grant(thd, SELECT_ACL, table, 2, UINT_MAX, 0);
+}
+
+
/*
CREATE TABLE query pre-check
@@ -7534,6 +7605,11 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
if (tables && check_table_access(thd, SELECT_ACL, tables,0))
goto err;
}
+ else if (lex->create_info.options & HA_LEX_CREATE_TABLE_LIKE)
+ {
+ if (check_show_create_table_access(thd, tables))
+ goto err;
+ }
error= FALSE;
err:
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 1ec65743b0f..d2f90141fa6 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -969,6 +969,7 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt,
String buf;
const String *val;
uint32 length= 0;
+ THD *thd= stmt->thd;
DBUG_ENTER("insert_params_from_vars");
@@ -979,34 +980,20 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt,
{
Item_param *param= *it;
varname= var_it++;
- if (get_var_with_binlog(stmt->thd, stmt->lex->sql_command,
- *varname, &entry))
- DBUG_RETURN(1);
- if (param->set_from_user_var(stmt->thd, entry))
+ entry= (user_var_entry *) hash_search(&thd->user_vars, (byte*) varname->str,
+ varname->length);
+ /*
+ We have to call the setup_one_conversion_function() here to set
+ the parameter's members that might be needed further
+ (e.g. value.cs_info.character_set_client is used in the query_val_str()).
+ */
+ setup_one_conversion_function(thd, param, param->param_type);
+ if (param->set_from_user_var(thd, entry))
DBUG_RETURN(1);
- /* Insert @'escaped-varname' instead of parameter in the query */
- if (entry)
- {
- char *start, *ptr;
- buf.length(0);
- if (buf.reserve(entry->name.length*2+3))
- DBUG_RETURN(1);
-
- start= ptr= buf.c_ptr_quick();
- *ptr++= '@';
- *ptr++= '\'';
- ptr+= escape_string_for_mysql(&my_charset_utf8_general_ci,
- ptr, 0, entry->name.str,
- entry->name.length);
- *ptr++= '\'';
- buf.length(ptr - start);
- val= &buf;
- }
- else
- val= &my_null_string;
+ val= param->query_val_str(&buf);
- if (param->convert_str_value(stmt->thd))
+ if (param->convert_str_value(thd))
DBUG_RETURN(1); /* out of memory */
if (query->replace(param->pos_in_query+length, 1, *val))
@@ -1164,8 +1151,9 @@ static int mysql_test_update(Prepared_statement *stmt,
goto error;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- /* TABLE_LIST contain right privilages request */
- want_privilege= table_list->grant.want_privilege;
+ /* Force privilege re-checking for views after they have been opened. */
+ want_privilege= (table_list->view ? UPDATE_ACL :
+ table_list->grant.want_privilege);
#endif
if (mysql_prepare_update(thd, table_list, &select->where,
@@ -1491,8 +1479,21 @@ static bool mysql_test_create_table(Prepared_statement *stmt)
if (select_lex->item_list.elements)
{
+ if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))
+ {
+ lex->link_first_table_back(create_table, link_to_local);
+ create_table->create= TRUE;
+ }
+
+ if (open_and_lock_tables(stmt->thd, lex->query_tables))
+ DBUG_RETURN(TRUE);
+
+ if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))
+ create_table= lex->unlink_first_table(&link_to_local);
+
select_lex->context.resolve_in_select_list= TRUE;
- res= select_like_stmt_test_with_open_n_lock(stmt, tables, 0, 0);
+
+ res= select_like_stmt_test(stmt, 0, 0);
}
/* put tables back for PS rexecuting */
@@ -1762,6 +1763,9 @@ static bool check_prepared_statement(Prepared_statement *stmt,
case SQLCOM_OPTIMIZE:
break;
+ case SQLCOM_PREPARE:
+ case SQLCOM_EXECUTE:
+ case SQLCOM_DEALLOCATE_PREPARE:
default:
/* All other statements are not supported yet. */
my_message(ER_UNSUPPORTED_PS, ER(ER_UNSUPPORTED_PS), MYF(0));
@@ -2799,11 +2803,15 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
old_stmt_arena= thd->stmt_arena;
thd->stmt_arena= this;
- lex_start(thd, (uchar*) thd->query, thd->query_length);
+
+ Lex_input_stream lip(thd, thd->query, thd->query_length);
+ lip.stmt_prepare_mode= TRUE;
+ thd->m_lip= &lip;
+ lex_start(thd);
lex->safe_to_cache_query= FALSE;
- lex->stmt_prepare_mode= TRUE;
+ int err= MYSQLparse((void *)thd);
- error= MYSQLparse((void *)thd) || thd->is_fatal_error ||
+ error= err || thd->is_fatal_error ||
thd->net.report_error || init_param_array(this);
/*
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index b451c612398..86ededd5587 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -94,7 +94,7 @@ static int send_file(THD *thd)
the job
*/
old_timeout= net->read_timeout;
- net_set_read_timeout(net, thd->variables.net_wait_timeout);
+ my_net_set_read_timeout(net, thd->variables.net_wait_timeout);
/*
We need net_flush here because the client will not know it needs to send
@@ -138,7 +138,7 @@ static int send_file(THD *thd)
error = 0;
err:
- net_set_read_timeout(net, old_timeout);
+ my_net_set_read_timeout(net, old_timeout);
if (fd >= 0)
(void) my_close(fd, MYF(0));
if (errmsg)
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index b7ac2130784..35d8c69ba34 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -49,15 +49,15 @@ static int sort_keyuse(KEYUSE *a,KEYUSE *b);
static void set_position(JOIN *join,uint index,JOIN_TAB *table,KEYUSE *key);
static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
table_map used_tables);
-static void choose_plan(JOIN *join,table_map join_tables);
+static bool choose_plan(JOIN *join,table_map join_tables);
static void best_access_path(JOIN *join, JOIN_TAB *s, THD *thd,
table_map remaining_tables, uint idx,
double record_count, double read_time);
static void optimize_straight_join(JOIN *join, table_map join_tables);
-static void greedy_search(JOIN *join, table_map remaining_tables,
+static bool greedy_search(JOIN *join, table_map remaining_tables,
uint depth, uint prune_level);
-static void best_extension_by_limited_search(JOIN *join,
+static bool best_extension_by_limited_search(JOIN *join,
table_map remaining_tables,
uint idx, double record_count,
double read_time, uint depth,
@@ -69,7 +69,7 @@ static int join_tab_cmp_straight(const void* ptr1, const void* ptr2);
TODO: 'find_best' is here only temporarily until 'greedy_search' is
tested and approved.
*/
-static void find_best(JOIN *join,table_map rest_tables,uint index,
+static bool find_best(JOIN *join,table_map rest_tables,uint index,
double record_count,double read_time);
static uint cache_record_length(JOIN *join,uint index);
static double prev_record_reads(JOIN *join,table_map found_ref);
@@ -976,6 +976,12 @@ JOIN::optimize()
}
}
+ if (conds &&!outer_join && const_table_map != found_const_table_map &&
+ (select_options & SELECT_DESCRIBE) &&
+ select_lex->master_unit() == &thd->lex->unit) // upper level SELECT
+ {
+ conds=new Item_int((longlong) 0,1); // Always false
+ }
if (make_join_select(this, select, conds))
{
zero_result_cause=
@@ -1426,14 +1432,13 @@ JOIN::optimize()
}
}
- if (select_lex->uncacheable && !is_top_level_join())
- {
- /* If this join belongs to an uncacheable subquery */
- if (!(tmp_join= (JOIN*)thd->alloc(sizeof(JOIN))))
- DBUG_RETURN(-1);
- error= 0; // Ensure that tmp_join.error= 0
- restore_tmp();
- }
+ /*
+ If this join belongs to an uncacheable subquery save
+ the original join
+ */
+ if (select_lex->uncacheable && !is_top_level_join() &&
+ init_save_join_tab())
+ DBUG_RETURN(-1); /* purecov: inspected */
}
error= 0;
@@ -1495,6 +1500,27 @@ JOIN::reinit()
DBUG_RETURN(0);
}
+/**
+ @brief Save the original join layout
+
+ @details Saves the original join layout so it can be reused in
+ re-execution and for EXPLAIN.
+
+ @return Operation status
+ @retval 0 success.
+ @retval 1 error occurred.
+*/
+
+bool
+JOIN::init_save_join_tab()
+{
+ if (!(tmp_join= (JOIN*)thd->alloc(sizeof(JOIN))))
+ return 1; /* purecov: inspected */
+ error= 0; // Ensure that tmp_join.error= 0
+ restore_tmp();
+ return 0;
+}
+
bool
JOIN::save_join_tab()
@@ -2049,6 +2075,17 @@ JOIN::exec()
thd->examined_row_count+= curr_join->examined_rows;
DBUG_PRINT("counts", ("thd->examined_row_count: %lu",
(ulong) thd->examined_row_count));
+
+ /*
+ With EXPLAIN EXTENDED we have to restore original ref_array
+ for a derived table which is always materialized.
+ Otherwise we would not be able to print the query correctly.
+ */
+ if (items0 &&
+ (thd->lex->describe & DESCRIBE_EXTENDED) &&
+ select_lex->linkage == DERIVED_TABLE_TYPE)
+ set_items_ref_array(items0);
+
DBUG_VOID_RETURN;
}
@@ -2691,7 +2728,8 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
if (join->const_tables != join->tables)
{
optimize_keyuse(join, keyuse_array);
- choose_plan(join, all_table_map & ~join->const_table_map);
+ if (choose_plan(join, all_table_map & ~join->const_table_map))
+ DBUG_RETURN(TRUE);
}
else
{
@@ -4169,7 +4207,7 @@ best_access_path(JOIN *join,
!(s->quick && best_key && s->quick->index == best_key->key && // (2)
best_max_key_part >= s->table->quick_key_parts[best_key->key]) &&// (2)
!((s->table->file->table_flags() & HA_TABLE_SCAN_ON_INDEX) && // (3)
- ! s->table->used_keys.is_clear_all() && best_key) && // (3)
+ ! s->table->used_keys.is_clear_all() && best_key && !s->quick) &&// (3)
!(s->table->force_index && best_key && !s->quick)) // (4)
{ // Check full join
ha_rows rnd_records= s->found_records;
@@ -4281,11 +4319,12 @@ best_access_path(JOIN *join,
the array 'join->best_positions', and the cost of the plan in
'join->best_read'.
- RETURN
- None
+ RETURN VALUES
+ FALSE ok
+ TRUE Fatal error
*/
-static void
+static bool
choose_plan(JOIN *join, table_map join_tables)
{
uint search_depth= join->thd->variables.optimizer_search_depth;
@@ -4318,14 +4357,16 @@ choose_plan(JOIN *join, table_map join_tables)
the greedy version. Will be removed when greedy_search is approved.
*/
join->best_read= DBL_MAX;
- find_best(join, join_tables, join->const_tables, 1.0, 0.0);
+ if (find_best(join, join_tables, join->const_tables, 1.0, 0.0))
+ DBUG_RETURN(TRUE);
}
else
{
if (search_depth == 0)
/* Automatically determine a reasonable value for 'search_depth' */
search_depth= determine_search_depth(join);
- greedy_search(join, join_tables, search_depth, prune_level);
+ if (greedy_search(join, join_tables, search_depth, prune_level))
+ DBUG_RETURN(TRUE);
}
}
@@ -4335,7 +4376,7 @@ choose_plan(JOIN *join, table_map join_tables)
*/
if (join->thd->lex->orig_sql_command != SQLCOM_SHOW_STATUS)
join->thd->status_var.last_query_cost= join->best_read;
- DBUG_VOID_RETURN;
+ DBUG_RETURN(FALSE);
}
@@ -4563,11 +4604,12 @@ optimize_straight_join(JOIN *join, table_map join_tables)
In the future, 'greedy_search' might be extended to support other
implementations of 'best_extension', e.g. some simpler quadratic procedure.
- RETURN
- None
+ RETURN VALUES
+ FALSE ok
+ TRUE Fatal error
*/
-static void
+static bool
greedy_search(JOIN *join,
table_map remaining_tables,
uint search_depth,
@@ -4589,8 +4631,9 @@ greedy_search(JOIN *join,
do {
/* Find the extension of the current QEP with the lowest cost */
join->best_read= DBL_MAX;
- best_extension_by_limited_search(join, remaining_tables, idx, record_count,
- read_time, search_depth, prune_level);
+ if (best_extension_by_limited_search(join, remaining_tables, idx, record_count,
+ read_time, search_depth, prune_level))
+ DBUG_RETURN(TRUE);
if (size_remain <= search_depth)
{
@@ -4601,7 +4644,7 @@ greedy_search(JOIN *join,
DBUG_EXECUTE("opt", print_plan(join, join->tables,
record_count, read_time, read_time,
"optimal"););
- DBUG_VOID_RETURN;
+ DBUG_RETURN(FALSE);
}
/* select the first table in the optimal extension as most promising */
@@ -4746,11 +4789,12 @@ greedy_search(JOIN *join,
The parameter 'search_depth' provides control over the recursion
depth, and thus the size of the resulting optimal plan.
- RETURN
- None
+ RETURN VALUES
+ FALSE ok
+ TRUE Fatal error
*/
-static void
+static bool
best_extension_by_limited_search(JOIN *join,
table_map remaining_tables,
uint idx,
@@ -4759,11 +4803,11 @@ best_extension_by_limited_search(JOIN *join,
uint search_depth,
uint prune_level)
{
+ DBUG_ENTER("best_extension_by_limited_search");
+
THD *thd= join->thd;
if (thd->killed) // Abort
- return;
-
- DBUG_ENTER("best_extension_by_limited_search");
+ DBUG_RETURN(TRUE);
/*
'join' is a partial plan with lower cost than the best plan so far,
@@ -4843,15 +4887,14 @@ best_extension_by_limited_search(JOIN *join,
if ( (search_depth > 1) && (remaining_tables & ~real_table_bit) )
{ /* Recursively expand the current partial plan */
swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
- best_extension_by_limited_search(join,
- remaining_tables & ~real_table_bit,
- idx + 1,
- current_record_count,
- current_read_time,
- search_depth - 1,
- prune_level);
- if (thd->killed)
- DBUG_VOID_RETURN;
+ if (best_extension_by_limited_search(join,
+ remaining_tables & ~real_table_bit,
+ idx + 1,
+ current_record_count,
+ current_read_time,
+ search_depth - 1,
+ prune_level))
+ DBUG_RETURN(TRUE);
swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
}
else
@@ -4880,19 +4923,26 @@ best_extension_by_limited_search(JOIN *join,
restore_prev_nj_state(s);
}
}
- DBUG_VOID_RETURN;
+ DBUG_RETURN(FALSE);
}
/*
TODO: this function is here only temporarily until 'greedy_search' is
tested and accepted.
+
+ RETURN VALUES
+ FALSE ok
+ TRUE Fatal error
*/
-static void
+static bool
find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
double read_time)
{
+ DBUG_ENTER("find_best");
THD *thd= join->thd;
+ if (thd->killed)
+ DBUG_RETURN(TRUE);
if (!rest_tables)
{
DBUG_PRINT("best",("read_time: %g record_count: %g",read_time,
@@ -4909,10 +4959,10 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
sizeof(POSITION)*idx);
join->best_read= read_time - 0.001;
}
- return;
+ DBUG_RETURN(FALSE);
}
if (read_time+record_count/(double) TIME_FOR_COMPARE >= join->best_read)
- return; /* Found better before */
+ DBUG_RETURN(FALSE); /* Found better before */
JOIN_TAB *s;
double best_record_count=DBL_MAX,best_read_time=DBL_MAX;
@@ -4945,10 +4995,9 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
best_read_time=current_read_time;
}
swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
- find_best(join,rest_tables & ~real_table_bit,idx+1,
- current_record_count,current_read_time);
- if (thd->killed)
- return;
+ if (find_best(join,rest_tables & ~real_table_bit,idx+1,
+ current_record_count,current_read_time))
+ DBUG_RETURN(TRUE);
swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
}
restore_prev_nj_state(s);
@@ -4956,6 +5005,7 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
break; // Don't test all combinations
}
}
+ DBUG_RETURN(FALSE);
}
@@ -5640,28 +5690,6 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
join->const_table_map,
(table_map) 0);
DBUG_EXECUTE("where",print_where(const_cond,"constants"););
- for (JOIN_TAB *tab= join->join_tab+join->const_tables;
- tab < join->join_tab+join->tables ; tab++)
- {
- if (*tab->on_expr_ref)
- {
- JOIN_TAB *cond_tab= tab->first_inner;
- COND *tmp= make_cond_for_table(*tab->on_expr_ref,
- join->const_table_map,
- ( table_map) 0);
- if (!tmp)
- continue;
- tmp= new Item_func_trig_cond(tmp, &cond_tab->not_null_compl);
- if (!tmp)
- DBUG_RETURN(1);
- tmp->quick_fix_field();
- cond_tab->select_cond= !cond_tab->select_cond ? tmp :
- new Item_cond_and(cond_tab->select_cond,tmp);
- if (!cond_tab->select_cond)
- DBUG_RETURN(1);
- cond_tab->select_cond->quick_fix_field();
- }
- }
if (const_cond && !const_cond->val_int())
{
DBUG_PRINT("info",("Found impossible WHERE condition"));
@@ -5892,13 +5920,39 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
}
/*
- Push down all predicates from on expressions.
- Each of these predicated are guarded by a variable
+ Push down conditions from all on expressions.
+ Each of these conditions are guarded by a variable
that turns if off just before null complemented row for
- outer joins is formed. Thus, the predicates from an
+ outer joins is formed. Thus, the condition from an
'on expression' are guaranteed not to be checked for
the null complemented row.
*/
+
+ /* First push down constant conditions from on expressions */
+ for (JOIN_TAB *join_tab= join->join_tab+join->const_tables;
+ join_tab < join->join_tab+join->tables ; join_tab++)
+ {
+ if (*join_tab->on_expr_ref)
+ {
+ JOIN_TAB *cond_tab= join_tab->first_inner;
+ COND *tmp= make_cond_for_table(*join_tab->on_expr_ref,
+ join->const_table_map,
+ (table_map) 0);
+ if (!tmp)
+ continue;
+ tmp= new Item_func_trig_cond(tmp, &cond_tab->not_null_compl);
+ if (!tmp)
+ DBUG_RETURN(1);
+ tmp->quick_fix_field();
+ cond_tab->select_cond= !cond_tab->select_cond ? tmp :
+ new Item_cond_and(cond_tab->select_cond,tmp);
+ if (!cond_tab->select_cond)
+ DBUG_RETURN(1);
+ cond_tab->select_cond->quick_fix_field();
+ }
+ }
+
+ /* Push down non-constant conditions from on expressions */
JOIN_TAB *last_tab= tab;
while (first_inner_tab && first_inner_tab->last_inner == last_tab)
{
@@ -5980,11 +6034,14 @@ make_join_readinfo(JOIN *join, ulonglong options)
disable join cache because it will change the ordering of the results.
Code handles sort table that is at any location (not only first after
the const tables) despite the fact that it's currently prohibited.
+ We must disable join cache if the first non-const table alone is
+ ordered. If there is a temp table the ordering is done as a last
+ operation and doesn't prevent join cache usage.
*/
- if (!ordered_set &&
- (table == join->sort_by_table &&
+ if (!ordered_set && !join->need_tmp &&
+ ((table == join->sort_by_table &&
(!join->order || join->skip_sort_order)) ||
- (join->sort_by_table == (TABLE *) 1 && i != join->const_tables))
+ (join->sort_by_table == (TABLE *) 1 && i != join->const_tables)))
ordered_set= 1;
switch (tab->type) {
@@ -6346,7 +6403,6 @@ void JOIN::cleanup(bool full)
for (tab= join_tab, end= tab+tables; tab != end; tab++)
tab->cleanup();
table= 0;
- tables= 0;
}
else
{
@@ -8771,7 +8827,7 @@ Field* create_tmp_field_from_field(THD *thd, Field* org_field,
Make sure that the blob fits into a Field_varstring which has
2-byte lenght.
*/
- if (convert_blob_length && convert_blob_length < UINT_MAX16 &&
+ if (convert_blob_length && convert_blob_length <= Field_varstring::MAX_SIZE &&
(org_field->flags & BLOB_FLAG))
new_field= new Field_varstring(convert_blob_length,
org_field->maybe_null(),
@@ -8837,8 +8893,13 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
item->name, table, item->decimals, TRUE);
break;
case INT_RESULT:
- /* Select an integer type with the minimal fit precision */
- if (item->max_length > MY_INT32_NUM_DECIMAL_DIGITS)
+ /*
+ Select an integer type with the minimal fit precision.
+ MY_INT32_NUM_DECIMAL_DIGITS is sign inclusive, don't consider the sign.
+ Values with MY_INT32_NUM_DECIMAL_DIGITS digits may or may not fit into
+ Field_long : make them Field_longlong.
+ */
+ if (item->max_length >= (MY_INT32_NUM_DECIMAL_DIGITS - 1))
new_field=new Field_longlong(item->max_length, maybe_null,
item->name, table, item->unsigned_flag);
else
@@ -8862,7 +8923,8 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
2-byte lenght.
*/
else if (item->max_length/item->collation.collation->mbmaxlen > 255 &&
- convert_blob_length < UINT_MAX16 && convert_blob_length)
+ convert_blob_length <= Field_varstring::MAX_SIZE &&
+ convert_blob_length)
new_field= new Field_varstring(convert_blob_length, maybe_null,
item->name, table,
item->collation.collation);
@@ -9102,7 +9164,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
bool using_unique_constraint= 0;
bool use_packed_rows= 0;
bool not_all_columns= !(select_options & TMP_TABLE_ALL_COLUMNS);
- char *tmpname,path[FN_REFLEN];
+ char *tmpname, *tmppath, path[FN_REFLEN], table_name[NAME_LEN+1];
byte *pos,*group_buff;
uchar *null_flags;
Field **reg_field, **from_field, **default_field;
@@ -9125,12 +9187,12 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
temp_pool_slot = bitmap_set_next(&temp_pool);
if (temp_pool_slot != MY_BIT_NONE) // we got a slot
- sprintf(path, "%s_%lx_%i", tmp_file_prefix,
- current_pid, temp_pool_slot);
+ sprintf(table_name, "%s_%lx_%i", tmp_file_prefix,
+ current_pid, temp_pool_slot);
else
{
/* if we run out of slots or we are not using tempool */
- sprintf(path,"%s%lx_%lx_%x", tmp_file_prefix,current_pid,
+ sprintf(table_name, "%s%lx_%lx_%x", tmp_file_prefix,current_pid,
thd->thread_id, thd->tmp_table++);
}
@@ -9138,7 +9200,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
No need to change table name to lower case as we are only creating
MyISAM or HEAP tables here
*/
- fn_format(path, path, mysql_tmpdir, "", MY_REPLACE_EXT|MY_UNPACK_FILENAME);
+ fn_format(path, table_name, mysql_tmpdir, "",
+ MY_REPLACE_EXT|MY_UNPACK_FILENAME);
if (group)
{
@@ -9183,7 +9246,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
sizeof(*key_part_info)*(param->group_parts+1),
&param->start_recinfo,
sizeof(*param->recinfo)*(field_count*2+4),
- &tmpname, (uint) strlen(path)+1,
+ &tmppath, (uint) strlen(path)+1,
+ &tmpname, (uint) strlen(table_name)+1,
&group_buff, group && ! using_unique_constraint ?
param->group_length : 0,
NullS))
@@ -9201,7 +9265,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
DBUG_RETURN(NULL); /* purecov: inspected */
}
param->items_to_copy= copy_func;
- strmov(tmpname,path);
+ strmov(tmppath, path);
+ strmov(tmpname, table_name);
/* make table according to fields */
bzero((char*) table,sizeof(*table));
@@ -9227,7 +9292,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
table->s= &table->share_not_to_be_used;
table->s->blob_field= blob_field;
- table->s->table_name= table->s->path= tmpname;
+ table->s->table_name= tmpname;
+ table->s->path= tmppath;
table->s->db= "";
table->s->blob_ptr_size= mi_portable_sizeof_char_ptr;
table->s->tmp_table= NON_TRANSACTIONAL_TMP_TABLE;
@@ -10112,7 +10178,7 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
err:
DBUG_PRINT("error",("Got error: %d",write_err));
- table->file->print_error(error,MYF(0)); // Give table is full error
+ table->file->print_error(write_err, MYF(0));
(void) table->file->ha_rnd_end();
(void) new_table.file->close();
err1:
@@ -10526,7 +10592,6 @@ static enum_nested_loop_state
evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
int error, my_bool *report_error)
{
- bool not_exists_optimize= join_tab->table->reginfo.not_exists_optimize;
bool not_used_in_distinct=join_tab->not_used_in_distinct;
ha_rows found_records=join->found_records;
COND *select_cond= join_tab->select_cond;
@@ -10563,6 +10628,8 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
first_unmatched->found= 1;
for (JOIN_TAB *tab= first_unmatched; tab <= join_tab; tab++)
{
+ if (tab->table->reginfo.not_exists_optimize)
+ return NESTED_LOOP_NO_MORE_ROWS;
/* Check all predicates that has just been activated. */
/*
Actually all predicates non-guarded by first_unmatched->found
@@ -10608,8 +10675,6 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
if (found)
{
enum enum_nested_loop_state rc;
- if (not_exists_optimize)
- return NESTED_LOOP_NO_MORE_ROWS;
/* A match from join_tab is found for the current partial join. */
rc= (*join_tab->next_select)(join, join_tab+1, 0);
if (rc != NESTED_LOOP_OK && rc != NESTED_LOOP_NO_MORE_ROWS)
@@ -12218,10 +12283,11 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
LINT_INIT(ref_key_parts);
/*
- Check which keys can be used to resolve ORDER BY.
- We must not try to use disabled keys.
+ Keys disabled by ALTER TABLE ... DISABLE KEYS should have already
+ been taken into account.
*/
- usable_keys= table->s->keys_in_use;
+ usable_keys= table->keys_in_use_for_query;
+ DBUG_ASSERT(usable_keys.is_subset(table->s->keys_in_use));
for (ORDER *tmp_order=order; tmp_order ; tmp_order=tmp_order->next)
{
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 9aa6fc1cfcd..3cdd265df9a 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -159,6 +159,13 @@ typedef struct st_join_table {
Read_record_func read_first_record;
Next_select_func next_select;
READ_RECORD read_record;
+ /*
+ Currently the following two fields are used only for a [NOT] IN subquery
+ if it is executed by an alternative full table scan when the left operand of
+ the subquery predicate is evaluated to NULL.
+ */
+ Read_record_func save_read_first_record;/* to save read_first_record */
+ int (*save_read_record) (READ_RECORD *);/* to save read_record.read_record */
double worst_seeks;
key_map const_keys; /* Keys with constant part */
key_map checked_keys; /* Keys checked in find_best */
@@ -434,6 +441,7 @@ public:
void cleanup(bool full);
void clear();
bool save_join_tab();
+ bool init_save_join_tab();
bool send_row_on_empty_set()
{
return (do_send_rows && tmp_table_param.sum_func_count != 0 &&
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index be1355699ba..16ed20cd479 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2433,7 +2433,7 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
const char *file_name)
{
const char *tmp_buff;
- TIME time;
+ MYSQL_TIME time;
CHARSET_INFO *cs= system_charset_info;
DBUG_ENTER("get_schema_tables_record");
@@ -2939,7 +2939,7 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
{
String tmp_string;
String sp_db, sp_name, definer;
- TIME time;
+ MYSQL_TIME time;
LEX *lex= thd->lex;
CHARSET_INFO *cs= system_charset_info;
get_field(thd->mem_root, proc_table->field[0], &sp_db);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 42d59a10712..202882d9a48 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -37,7 +37,8 @@ static int copy_data_between_tables(TABLE *from,TABLE *to,
List<create_field> &create, bool ignore,
uint order_num, ORDER *order,
ha_rows *copied,ha_rows *deleted,
- enum enum_enable_or_disable keys_onoff);
+ enum enum_enable_or_disable keys_onoff,
+ bool error_if_not_empty);
static bool prepare_blob_field(THD *thd, create_field *sql_field);
static bool check_engine(THD *thd, const char *table_name,
@@ -62,8 +63,8 @@ static void set_tmp_file_path(char *buf, size_t bufsize, THD *thd);
# Size of path
*/
-static uint build_table_path(char *buff, size_t bufflen, const char *db,
- const char *table, const char *ext)
+uint build_table_path(char *buff, size_t bufflen, const char *db,
+ const char *table, const char *ext)
{
strxnmov(buff, bufflen-1, mysql_data_home, "/", db, "/", table, ext,
NullS);
@@ -1722,7 +1723,14 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
VOID(pthread_mutex_lock(&LOCK_open));
if (!internal_tmp_table && !(create_info->options & HA_LEX_CREATE_TMP_TABLE))
{
- if (!access(path,F_OK))
+ /*
+ Inspecting table cache for placeholders created by concurrent
+ CREATE TABLE ... SELECT statements to avoid interfering with them
+ is 5.0-only solution. Starting from 5.1 we solve this problem by
+ obtaining name-lock on the table to be created first.
+ */
+ if (table_cache_has_open_placeholder(thd, db, table_name) ||
+ !access(path, F_OK))
{
if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
goto warn;
@@ -2051,7 +2059,7 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table,
to finish the restore in the handler later on
*/
pthread_mutex_lock(&LOCK_open);
- if (reopen_name_locked_table(thd, table))
+ if (reopen_name_locked_table(thd, table, TRUE))
{
unlock_table_name(thd, table);
pthread_mutex_unlock(&LOCK_open);
@@ -2158,7 +2166,7 @@ static int prepare_for_repair(THD* thd, TABLE_LIST *table_list,
to finish the repair in the handler later on.
*/
pthread_mutex_lock(&LOCK_open);
- if (reopen_name_locked_table(thd, table_list))
+ if (reopen_name_locked_table(thd, table_list, TRUE))
{
unlock_table_name(thd, table_list);
pthread_mutex_unlock(&LOCK_open);
@@ -2711,7 +2719,8 @@ bool mysql_preload_keys(THD* thd, TABLE_LIST* tables)
SYNOPSIS
mysql_create_like_table()
thd Thread object
- table Table list (one table only)
+ table Table list element for target table
+ src_table Table list element for source table
create_info Create info
table_ident Src table_ident
@@ -2720,61 +2729,52 @@ bool mysql_preload_keys(THD* thd, TABLE_LIST* tables)
TRUE error
*/
-bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
- HA_CREATE_INFO *create_info,
- Table_ident *table_ident)
+bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST *src_table,
+ HA_CREATE_INFO *create_info)
{
TABLE **tmp_table;
char src_path[FN_REFLEN], dst_path[FN_REFLEN];
char *db= table->db;
char *table_name= table->table_name;
- char *src_db;
- char *src_table= table_ident->table.str;
int err;
bool res= TRUE;
db_type not_used;
-
- TABLE_LIST src_tables_list;
DBUG_ENTER("mysql_create_like_table");
- DBUG_ASSERT(table_ident->db.str); /* Must be set in the parser */
- src_db= table_ident->db.str;
/*
- Validate the source table
+ By taking name-lock on the source table and holding LOCK_open mutex we
+ ensure that no concurrent DDL operation will mess with this table. Note
+ that holding only name-lock is not enough for this, because it won't block
+ other DDL statements that only take name-locks on the table and don't
+ open it (simple name-locks are not exclusive between each other).
+
+ Unfortunately, simply opening this table is not enough for our purproses,
+ since in 5.0 ALTER TABLE may change .FRM files on disk even if there are
+ connections that still have old version of table open. This 'optimization'
+ was removed in 5.1 so there we open the source table instead of taking
+ name-lock on it.
+
+ We also have to acquire LOCK_open to make copying of .frm file, call to
+ ha_create_table() and binlogging atomic against concurrent DML and DDL
+ operations on the target table.
*/
- if (table_ident->table.length > NAME_LEN ||
- (table_ident->table.length &&
- check_table_name(src_table,table_ident->table.length)))
- {
- my_error(ER_WRONG_TABLE_NAME, MYF(0), src_table);
- DBUG_RETURN(TRUE);
- }
- if (!src_db || check_db_name(src_db))
- {
- my_error(ER_WRONG_DB_NAME, MYF(0), src_db ? src_db : "NULL");
- DBUG_RETURN(-1);
- }
-
- bzero((gptr)&src_tables_list, sizeof(src_tables_list));
- src_tables_list.db= src_db;
- src_tables_list.table_name= src_table;
-
- if (lock_and_wait_for_table_name(thd, &src_tables_list))
+ if (lock_and_wait_for_table_name(thd, src_table))
goto err;
- if ((tmp_table= find_temporary_table(thd, src_db, src_table)))
+ pthread_mutex_lock(&LOCK_open);
+
+ if ((tmp_table= find_temporary_table(thd, src_table->db,
+ src_table->table_name)))
strxmov(src_path, (*tmp_table)->s->path, reg_ext, NullS);
else
{
- strxmov(src_path, mysql_data_home, "/", src_db, "/", src_table,
- reg_ext, NullS);
+ strxmov(src_path, mysql_data_home, "/", src_table->db, "/",
+ src_table->table_name, reg_ext, NullS);
/* Resolve symlinks (for windows) */
fn_format(src_path, src_path, "", "", MYF(MY_UNPACK_FILENAME));
- if (lower_case_table_names)
- my_casedn_str(files_charset_info, src_path);
if (access(src_path, F_OK))
{
- my_error(ER_BAD_TABLE_ERROR, MYF(0), src_table);
+ my_error(ER_BAD_TABLE_ERROR, MYF(0), src_table->table_name);
goto err;
}
}
@@ -2784,10 +2784,13 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
*/
if (mysql_frm_type(thd, src_path, &not_used) != FRMTYPE_TABLE)
{
- my_error(ER_WRONG_OBJECT, MYF(0), src_db, src_table, "BASE TABLE");
+ my_error(ER_WRONG_OBJECT, MYF(0), src_table->db, src_table->table_name,
+ "BASE TABLE");
goto err;
}
+ DBUG_EXECUTE_IF("sleep_create_like_before_check_if_exists", my_sleep(6000000););
+
/*
Validate the destination table
@@ -2806,10 +2809,19 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
strxmov(dst_path, mysql_data_home, "/", db, "/", table_name,
reg_ext, NullS);
fn_format(dst_path, dst_path, "", "", MYF(MY_UNPACK_FILENAME));
- if (!access(dst_path, F_OK))
+
+ /*
+ Note that starting from 5.1 we obtain name-lock on target
+ table instead of inspecting table cache for presence
+ of open placeholders (see comment in mysql_create_table()).
+ */
+ if (table_cache_has_open_placeholder(thd, db, table_name) ||
+ !access(dst_path, F_OK))
goto table_exists;
}
+ DBUG_EXECUTE_IF("sleep_create_like_before_copy", my_sleep(6000000););
+
/*
Create a new table by copying from source table
*/
@@ -2822,6 +2834,8 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
goto err;
}
+ DBUG_EXECUTE_IF("sleep_create_like_before_ha_create", my_sleep(6000000););
+
/*
As mysql_truncate don't work on a new table at this stage of
creation, instead create the table directly (for both normal
@@ -2846,6 +2860,8 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
goto err; /* purecov: inspected */
}
+ DBUG_EXECUTE_IF("sleep_create_like_before_binlogging", my_sleep(6000000););
+
// Must be written before unlock
if (mysql_bin_log.is_open())
{
@@ -2870,8 +2886,7 @@ table_exists:
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
err:
- pthread_mutex_lock(&LOCK_open);
- unlock_table_name(thd, &src_tables_list);
+ unlock_table_name(thd, src_table);
pthread_mutex_unlock(&LOCK_open);
DBUG_RETURN(res);
}
@@ -3056,6 +3071,16 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
bool need_copy_table;
bool no_table_reopen= FALSE, varchar= FALSE;
frm_type_enum frm_type;
+ /*
+ Throw an error if the table to be altered isn't empty.
+ Used in DATE/DATETIME fields default value checking.
+ */
+ bool error_if_not_empty= FALSE;
+ /*
+ A field used for error reporting in DATE/DATETIME fields default
+ value checking.
+ */
+ create_field *new_datetime_field= 0;
DBUG_ENTER("mysql_alter_table");
thd->proc_info="init";
@@ -3160,9 +3185,14 @@ view_err:
else
{
char dir_buff[FN_REFLEN];
+ bool exists;
strxnmov(dir_buff, FN_REFLEN, mysql_real_data_home, new_db, NullS);
- if (!access(fn_format(new_name_buff,new_name_buff,dir_buff,reg_ext,0),
- F_OK))
+ VOID(pthread_mutex_lock(&LOCK_open));
+ exists= (table_cache_has_open_placeholder(thd, new_db, new_name) ||
+ !access(fn_format(new_name_buff, new_name_buff, dir_buff,
+ reg_ext, 0), F_OK));
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ if (exists)
{
/* Table will be closed in do_command() */
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_alias);
@@ -3247,8 +3277,22 @@ view_err:
if (!error && (new_name != table_name || new_db != db))
{
thd->proc_info="rename";
- /* Then do a 'simple' rename of the table */
- if (!access(new_name_buff,F_OK))
+ /*
+ Then do a 'simple' rename of the table. First we need to close all
+ instances of 'source' table.
+ */
+ close_cached_table(thd, table);
+ /*
+ Then, we want check once again that target table does not exist.
+ Note that we can't fully rely on results of previous check since
+ no lock was taken on target table during it. We also can't do this
+ before calling close_cached_table() as the latter temporarily
+ releases LOCK_open mutex.
+ Also note that starting from 5.1 we use approach with obtaining
+ of name-lock on target table.
+ */
+ if (table_cache_has_open_placeholder(thd, new_db, new_name) ||
+ !access(new_name_buff,F_OK))
{
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_name);
error= -1;
@@ -3256,7 +3300,6 @@ view_err:
else
{
*fn_ext(new_name)=0;
- close_cached_table(thd, table);
if (mysql_rename_table(old_db_type,db,table_name,new_db,new_alias))
error= -1;
else if (Table_triggers_list::change_table_name(thd, db, table_name,
@@ -3406,6 +3449,22 @@ view_err:
my_error(ER_BAD_FIELD_ERROR, MYF(0), def->change, table_name);
DBUG_RETURN(TRUE);
}
+ /*
+ Check that the DATE/DATETIME not null field we are going to add is
+ either has a default value or the '0000-00-00' is allowed by the
+ set sql mode.
+ If the '0000-00-00' value isn't allowed then raise the error_if_not_empty
+ flag to allow ALTER TABLE only if the table to be altered is empty.
+ */
+ if ((def->sql_type == MYSQL_TYPE_DATE ||
+ def->sql_type == MYSQL_TYPE_NEWDATE ||
+ def->sql_type == MYSQL_TYPE_DATETIME) && !new_datetime_field &&
+ !(~def->flags & (NO_DEFAULT_VALUE_FLAG | NOT_NULL_FLAG)) &&
+ thd->variables.sql_mode & MODE_NO_ZERO_DATE)
+ {
+ new_datetime_field= def;
+ error_if_not_empty= TRUE;
+ }
if (!def->after)
new_info.create_list.push_back(def);
else if (def->after == first_keyword)
@@ -3726,7 +3785,8 @@ view_err:
new_table->next_number_field=new_table->found_next_number_field;
error= copy_data_between_tables(table, new_table, new_info.create_list,
ignore, order_num, order,
- &copied, &deleted, alter_info->keys_onoff);
+ &copied, &deleted, alter_info->keys_onoff,
+ error_if_not_empty);
}
else if (!new_table)
{
@@ -3737,6 +3797,9 @@ view_err:
alter_info->keys_onoff);
table->file->external_lock(thd, F_UNLCK);
VOID(pthread_mutex_unlock(&LOCK_open));
+ error= ha_commit_stmt(thd);
+ if (ha_commit(thd))
+ error= 1;
}
thd->last_insert_id=next_insert_id; // Needed for correct log
@@ -3806,17 +3869,6 @@ view_err:
current_pid, thd->thread_id);
if (lower_case_table_names)
my_casedn_str(files_charset_info, old_name);
- if (new_name != table_name || new_db != db)
- {
- if (!access(new_name_buff,F_OK))
- {
- error=1;
- my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_name_buff);
- VOID(quick_rm_table(new_db_type,new_db,tmp_name));
- VOID(pthread_mutex_unlock(&LOCK_open));
- goto err;
- }
- }
#if (!defined( __WIN__) && !defined( __EMX__) && !defined( OS2))
if (table->file->has_transactions())
@@ -3835,6 +3887,22 @@ view_err:
table->file->extra(HA_EXTRA_FORCE_REOPEN); // Don't use this file anymore
#endif
+ if (new_name != table_name || new_db != db)
+ {
+ /*
+ Check that there is no table with target name. See the
+ comment describing code for 'simple' ALTER TABLE ... RENAME.
+ */
+ if (table_cache_has_open_placeholder(thd, new_db, new_name) ||
+ !access(new_name_buff,F_OK))
+ {
+ error=1;
+ my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_name_buff);
+ VOID(quick_rm_table(new_db_type,new_db,tmp_name));
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ goto err;
+ }
+ }
error=0;
if (!need_copy_table)
@@ -3902,16 +3970,6 @@ view_err:
goto err;
}
}
- /* The ALTER TABLE is always in its own transaction */
- error = ha_commit_stmt(thd);
- if (ha_commit(thd))
- error=1;
- if (error)
- {
- VOID(pthread_mutex_unlock(&LOCK_open));
- broadcast_refresh();
- goto err;
- }
thd->proc_info="end";
if (mysql_bin_log.is_open())
{
@@ -3955,6 +4013,38 @@ end_temporary:
DBUG_RETURN(FALSE);
err:
+ /*
+ No default value was provided for a DATE/DATETIME field, the
+ current sql_mode doesn't allow the '0000-00-00' value and
+ the table to be altered isn't empty.
+ Report error here.
+ */
+ if (error_if_not_empty && thd->row_count)
+ {
+ const char *f_val= 0;
+ enum enum_mysql_timestamp_type t_type= MYSQL_TIMESTAMP_DATE;
+ switch (new_datetime_field->sql_type)
+ {
+ case MYSQL_TYPE_DATE:
+ case MYSQL_TYPE_NEWDATE:
+ f_val= "0000-00-00";
+ t_type= MYSQL_TIMESTAMP_DATE;
+ break;
+ case MYSQL_TYPE_DATETIME:
+ f_val= "0000-00-00 00:00:00";
+ t_type= MYSQL_TIMESTAMP_DATETIME;
+ break;
+ default:
+ /* Shouldn't get here. */
+ DBUG_ASSERT(0);
+ }
+ bool save_abort_on_warning= thd->abort_on_warning;
+ thd->abort_on_warning= TRUE;
+ make_truncated_value_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ f_val, strlength(f_val), t_type,
+ new_datetime_field->field_name);
+ thd->abort_on_warning= save_abort_on_warning;
+ }
DBUG_RETURN(TRUE);
}
@@ -3966,7 +4056,8 @@ copy_data_between_tables(TABLE *from,TABLE *to,
uint order_num, ORDER *order,
ha_rows *copied,
ha_rows *deleted,
- enum enum_enable_or_disable keys_onoff)
+ enum enum_enable_or_disable keys_onoff,
+ bool error_if_not_empty)
{
int error;
Copy_field *copy,*copy_end;
@@ -4081,6 +4172,12 @@ copy_data_between_tables(TABLE *from,TABLE *to,
break;
}
thd->row_count++;
+ /* Return error if source table isn't empty. */
+ if (error_if_not_empty)
+ {
+ error= 1;
+ break;
+ }
if (to->next_number_field)
{
if (auto_increment_field_copied)
@@ -4121,8 +4218,12 @@ copy_data_between_tables(TABLE *from,TABLE *to,
}
to->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
- ha_enable_transaction(thd,TRUE);
-
+ if (ha_enable_transaction(thd, TRUE))
+ {
+ error= 1;
+ goto err;
+ }
+
/*
Ensure that the new table is saved properly to disk so that we
can do a rename
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 55d51ad07b7..cf6db22fbcb 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -271,7 +271,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
/* We also don't allow creation of triggers on views. */
tables->required_type= FRMTYPE_TABLE;
- if (reopen_name_locked_table(thd, tables))
+ if (reopen_name_locked_table(thd, tables, TRUE))
{
unlock_table_name(thd, tables);
goto end;
@@ -978,10 +978,14 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
LEX_STRING *trg_definer= it_definer++;
thd->variables.sql_mode= (ulong)*trg_sql_mode;
- lex_start(thd, (uchar*)trg_create_str->str, trg_create_str->length);
+ Lex_input_stream lip(thd, trg_create_str->str, trg_create_str->length);
+ thd->m_lip= &lip;
+ lex_start(thd);
thd->spcont= 0;
- if (MYSQLparse((void *)thd) || thd->is_fatal_error)
+ int err= MYSQLparse((void *)thd);
+
+ if (err || thd->is_fatal_error)
{
/* Currently sphead is always deleted in case of a parse error */
DBUG_ASSERT(lex.sphead == 0);
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 7fb75732012..373b03d45e6 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -147,8 +147,16 @@ st_select_lex_unit::init_prepare_fake_select_lex(THD *thd_arg)
fake_select_lex->table_list.link_in_list((byte *)&result_table_list,
(byte **)
&result_table_list.next_local);
- fake_select_lex->context.table_list= fake_select_lex->context.first_name_resolution_table=
+ fake_select_lex->context.table_list=
+ fake_select_lex->context.first_name_resolution_table=
fake_select_lex->get_table_list();
+ if (!fake_select_lex->first_execution)
+ {
+ for (ORDER *order= (ORDER *) global_parameters->order_list.first;
+ order;
+ order= order->next)
+ order->item= &order->item_ptr;
+ }
for (ORDER *order= (ORDER *)global_parameters->order_list.first;
order;
order=order->next)
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index e17c71ae541..8be495fd0fb 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -173,8 +173,9 @@ int mysql_update(THD *thd,
table->quick_keys.clear_all();
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- /* TABLE_LIST contain right privilages request */
- want_privilege= table_list->grant.want_privilege;
+ /* Force privilege re-checking for views after they have been opened. */
+ want_privilege= (table_list->view ? UPDATE_ACL :
+ table_list->grant.want_privilege);
#endif
if (mysql_prepare_update(thd, table_list, &conds, order_num, order))
DBUG_RETURN(1);
@@ -520,6 +521,37 @@ int mysql_update(THD *thd,
table->file->unlock_row();
thd->row_count++;
}
+
+ /*
+ todo bug#27571: to avoid asynchronization of `error' and
+ `error_code' of binlog event constructor
+
+ The concept, which is a bit different for insert(!), is to
+ replace `error' assignment with the following lines
+
+ killed_status= thd->killed; // get the status of the volatile
+
+ Notice: thd->killed is type of "state" whereas the lhs has
+ "status" the suffix which translates according to WordNet: a state
+ at a particular time - at the time of the end of per-row loop in
+ our case. Binlogging ops are conducted with the status.
+
+ error= (killed_status == THD::NOT_KILLED)? error : 1;
+
+ which applies to most mysql_$query functions.
+ Event's constructor will accept `killed_status' as an argument:
+
+ Query_log_event qinfo(..., killed_status);
+
+ thd->killed might be changed after killed_status had got cached and this
+ won't affect binlogging event but other effects remain.
+
+ Open issue: In a case the error happened not because of KILLED -
+ and then KILLED was caught later still within the loop - we shall
+ do something to avoid binlogging of incorrect ER_SERVER_SHUTDOWN
+ error_code.
+ */
+
if (thd->killed && !error)
error= 1; // Aborted
end_read_record(&info);
@@ -969,6 +1001,7 @@ int multi_update::prepare(List<Item> &not_used_values,
List_iterator_fast<Item> field_it(*fields);
List_iterator_fast<Item> value_it(*values);
uint i, max_fields;
+ uint leaf_table_count= 0;
DBUG_ENTER("multi_update::prepare");
thd->count_cuted_fields= CHECK_FIELD_WARN;
@@ -1002,6 +1035,7 @@ int multi_update::prepare(List<Item> &not_used_values,
{
/* TODO: add support of view of join support */
TABLE *table=table_ref->table;
+ leaf_table_count++;
if (tables_to_update & table->map)
{
TABLE_LIST *tl= (TABLE_LIST*) thd->memdup((char*) table_ref,
@@ -1066,7 +1100,7 @@ int multi_update::prepare(List<Item> &not_used_values,
/* Allocate copy fields */
max_fields=0;
for (i=0 ; i < table_count ; i++)
- set_if_bigger(max_fields, fields_for_table[i]->elements);
+ set_if_bigger(max_fields, fields_for_table[i]->elements + leaf_table_count);
copy_field= new Copy_field[max_fields];
DBUG_RETURN(thd->is_fatal_error != 0);
}
@@ -1159,13 +1193,22 @@ multi_update::initialize_tables(JOIN *join)
trans_safe= transactional_tables= main_table->file->has_transactions();
table_to_update= 0;
+ /* Any update has at least one pair (field, value) */
+ DBUG_ASSERT(fields->elements);
+ /*
+ Only one table may be modified by UPDATE of an updatable view.
+ For an updatable view first_table_for_update indicates this
+ table.
+ For a regular multi-update it refers to some updated table.
+ */
+ TABLE *first_table_for_update= ((Item_field *) fields->head())->field->table;
+
/* Create a temporary table for keys to all tables, except main table */
for (table_ref= update_tables; table_ref; table_ref= table_ref->next_local)
{
TABLE *table=table_ref->table;
uint cnt= table_ref->shared;
- Item_field *ifield;
- List<Item> temp_fields= *fields_for_table[cnt];
+ List<Item> temp_fields;
ORDER group;
if (ignore)
@@ -1173,34 +1216,63 @@ multi_update::initialize_tables(JOIN *join)
if (table == main_table) // First table in join
{
if (safe_update_on_fly(thd, join->join_tab, table_ref, all_tables,
- &temp_fields))
+ fields_for_table[cnt]))
{
table_to_update= main_table; // Update table on the fly
continue;
}
}
+ if (table == first_table_for_update && table_ref->check_option)
+ {
+ table_map unupdated_tables= table_ref->check_option->used_tables() &
+ ~first_table_for_update->map;
+ for (TABLE_LIST *tbl_ref =leaves;
+ unupdated_tables && tbl_ref;
+ tbl_ref= tbl_ref->next_leaf)
+ {
+ if (unupdated_tables & tbl_ref->table->map)
+ unupdated_tables&= ~tbl_ref->table->map;
+ else
+ continue;
+ if (unupdated_check_opt_tables.push_back(tbl_ref->table))
+ DBUG_RETURN(1);
+ }
+ }
+
TMP_TABLE_PARAM *tmp_param= tmp_table_param+cnt;
/*
Create a temporary table to store all fields that are changed for this
table. The first field in the temporary table is a pointer to the
- original row so that we can find and update it
+ original row so that we can find and update it. For the updatable
+ VIEW a few following fields are rowids of tables used in the CHECK
+ OPTION condition.
*/
- /* ok to be on stack as this is not referenced outside of this func */
- Field_string offset(table->file->ref_length, 0, "offset",
- table, &my_charset_bin);
- /*
- The field will be converted to varstring when creating tmp table if
- table to be updated was created by mysql 4.1. Deny this.
- */
- offset.can_alter_field_type= 0;
- if (!(ifield= new Item_field(((Field *) &offset))))
- DBUG_RETURN(1);
- ifield->maybe_null= 0;
- if (temp_fields.push_front(ifield))
- DBUG_RETURN(1);
+ List_iterator_fast<TABLE> tbl_it(unupdated_check_opt_tables);
+ TABLE *tbl= table;
+ do
+ {
+ Field_string *field= new Field_string(tbl->file->ref_length, 0,
+ tbl->alias,
+ tbl, &my_charset_bin);
+ if (!field)
+ DBUG_RETURN(1);
+ /*
+ The field will be converted to varstring when creating tmp table if
+ table to be updated was created by mysql 4.1. Deny this.
+ */
+ field->can_alter_field_type= 0;
+ Item_field *ifield= new Item_field((Field *) field);
+ if (!ifield)
+ DBUG_RETURN(1);
+ ifield->maybe_null= 0;
+ if (temp_fields.push_back(ifield))
+ DBUG_RETURN(1);
+ } while ((tbl= tbl_it++));
+
+ temp_fields.concat(fields_for_table[cnt]);
/* Make an unique key over the first field to avoid duplicated updates */
bzero((char*) &group, sizeof(group));
@@ -1349,10 +1421,26 @@ bool multi_update::send_data(List<Item> &not_used_values)
{
int error;
TABLE *tmp_table= tmp_tables[offset];
- fill_record(thd, tmp_table->field+1, *values_for_table[offset], 1);
- /* Store pointer to row */
- memcpy((char*) tmp_table->field[0]->ptr,
- (char*) table->file->ref, table->file->ref_length);
+ /* Store regular updated fields in the row. */
+ fill_record(thd,
+ tmp_table->field + 1 + unupdated_check_opt_tables.elements,
+ *values_for_table[offset], 1);
+ /*
+ For updatable VIEW store rowid of the updated table and
+ rowids of tables used in the CHECK OPTION condition.
+ */
+ uint field_num= 0;
+ List_iterator_fast<TABLE> tbl_it(unupdated_check_opt_tables);
+ TABLE *tbl= table;
+ do
+ {
+ if (tbl != table)
+ tbl->file->position(tbl->record[0]);
+ memcpy((char*) tmp_table->field[field_num]->ptr,
+ (char*) tbl->file->ref, tbl->file->ref_length);
+ field_num++;
+ } while ((tbl= tbl_it++));
+
/* Write row, ignoring duplicated updates to a row */
error= tmp_table->file->write_row(tmp_table->record[0]);
if (error != HA_ERR_FOUND_DUPP_KEY && error != HA_ERR_FOUND_DUPP_UNIQUE)
@@ -1402,9 +1490,10 @@ void multi_update::send_error(uint errcode,const char *err)
int multi_update::do_updates(bool from_send_error)
{
TABLE_LIST *cur_table;
- int local_error;
+ int local_error= 0;
ha_rows org_updated;
TABLE *table, *tmp_table;
+ List_iterator_fast<TABLE> check_opt_it(unupdated_check_opt_tables);
DBUG_ENTER("do_updates");
do_update= 0; // Don't retry this function
@@ -1412,8 +1501,8 @@ int multi_update::do_updates(bool from_send_error)
DBUG_RETURN(0);
for (cur_table= update_tables; cur_table; cur_table= cur_table->next_local)
{
- byte *ref_pos;
bool can_compare_record;
+ uint offset= cur_table->shared;
table = cur_table->table;
if (table == table_to_update)
@@ -1424,11 +1513,20 @@ int multi_update::do_updates(bool from_send_error)
(void) table->file->ha_rnd_init(0);
table->file->extra(HA_EXTRA_NO_CACHE);
+ check_opt_it.rewind();
+ while(TABLE *tbl= check_opt_it++)
+ {
+ if (tbl->file->ha_rnd_init(1))
+ goto err;
+ tbl->file->extra(HA_EXTRA_CACHE);
+ }
+
/*
Setup copy functions to copy fields from temporary table
*/
- List_iterator_fast<Item> field_it(*fields_for_table[cur_table->shared]);
- Field **field= tmp_table->field+1; // Skip row pointer
+ List_iterator_fast<Item> field_it(*fields_for_table[offset]);
+ Field **field= tmp_table->field +
+ 1 + unupdated_check_opt_tables.elements; // Skip row pointers
Copy_field *copy_field_ptr= copy_field, *copy_field_end;
for ( ; *field ; field++)
{
@@ -1443,7 +1541,6 @@ int multi_update::do_updates(bool from_send_error)
can_compare_record= !(table->file->table_flags() &
HA_PARTIAL_COLUMN_READ);
- ref_pos= (byte*) tmp_table->field[0]->ptr;
for (;;)
{
if (thd->killed && trans_safe)
@@ -1456,8 +1553,20 @@ int multi_update::do_updates(bool from_send_error)
continue; // May happen on dup key
goto err;
}
- if ((local_error= table->file->rnd_pos(table->record[0], ref_pos)))
- goto err;
+
+ /* call rnd_pos() using rowids from temporary table */
+ check_opt_it.rewind();
+ TABLE *tbl= table;
+ uint field_num= 0;
+ do
+ {
+ if((local_error=
+ tbl->file->rnd_pos(tbl->record[0],
+ (byte *) tmp_table->field[field_num]->ptr)))
+ goto err;
+ field_num++;
+ } while((tbl= check_opt_it++));
+
table->status|= STATUS_UPDATED;
store_record(table,record[1]);
@@ -1507,6 +1616,10 @@ int multi_update::do_updates(bool from_send_error)
}
(void) table->file->ha_rnd_end();
(void) tmp_table->file->ha_rnd_end();
+ check_opt_it.rewind();
+ while (TABLE *tbl= check_opt_it++)
+ tbl->file->ha_rnd_end();
+
}
DBUG_RETURN(0);
@@ -1520,6 +1633,9 @@ err:
err2:
(void) table->file->ha_rnd_end();
(void) tmp_table->file->ha_rnd_end();
+ check_opt_it.rewind();
+ while (TABLE *tbl= check_opt_it++)
+ tbl->file->ha_rnd_end();
if (updated != org_updated)
{
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index d717aea9a3e..40f54799295 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -692,6 +692,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
bool can_be_merged;
char dir_buff[FN_REFLEN], file_buff[FN_REFLEN];
LEX_STRING dir, file;
+ int error= 0;
DBUG_ENTER("mysql_register_view");
/* print query */
@@ -702,9 +703,58 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
lex->unit.print(&str);
thd->variables.sql_mode|= sql_mode;
}
- str.append('\0');
DBUG_PRINT("info", ("View: %s", str.ptr()));
+ /* fill structure */
+ view->query.str= str.c_ptr_safe();
+ view->query.length= str.length();
+ view->source.str= thd->query + thd->lex->create_view_select_start;
+ view->source.length= (char *)skip_rear_comments(thd->charset(),
+ (char *)view->source.str,
+ (char *)thd->query +
+ thd->query_length) -
+ view->source.str;
+ view->file_version= 1;
+ view->calc_md5(md5);
+ view->md5.str= md5;
+ view->md5.length= 32;
+ can_be_merged= lex->can_be_merged();
+ if (lex->create_view_algorithm == VIEW_ALGORITHM_MERGE &&
+ !lex->can_be_merged())
+ {
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_VIEW_MERGE,
+ ER(ER_WARN_VIEW_MERGE));
+ lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED;
+ }
+ view->algorithm= lex->create_view_algorithm;
+ view->definer.user= lex->definer->user;
+ view->definer.host= lex->definer->host;
+ view->view_suid= lex->create_view_suid;
+ view->with_check= lex->create_view_check;
+ if ((view->updatable_view= (can_be_merged &&
+ view->algorithm != VIEW_ALGORITHM_TMPTABLE)))
+ {
+ /* TODO: change here when we will support UNIONs */
+ for (TABLE_LIST *tbl= (TABLE_LIST *)lex->select_lex.table_list.first;
+ tbl;
+ tbl= tbl->next_local)
+ {
+ if ((tbl->view && !tbl->updatable_view) || tbl->schema_table)
+ {
+ view->updatable_view= 0;
+ break;
+ }
+ for (TABLE_LIST *up= tbl; up; up= up->embedding)
+ {
+ if (up->outer_join)
+ {
+ view->updatable_view= 0;
+ goto loop_out;
+ }
+ }
+ }
+ }
+loop_out:
/* print file name */
(void) my_snprintf(dir_buff, FN_REFLEN, "%s/%s/",
mysql_data_home, view->db);
@@ -734,16 +784,21 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
if (mode == VIEW_CREATE_NEW)
{
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), view->alias);
- DBUG_RETURN(-1);
+ error= -1;
+ goto err;
}
if (!(parser= sql_parse_prepare(&path, thd->mem_root, 0)))
- DBUG_RETURN(1);
+ {
+ error= 1;
+ goto err;
+ }
if (!parser->ok() || !is_equal(&view_type, parser->type()))
{
my_error(ER_WRONG_OBJECT, MYF(0), view->db, view->table_name, "VIEW");
- DBUG_RETURN(-1);
+ error= -1;
+ goto err;
}
/*
@@ -756,67 +811,21 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
view_parameters + revision_number_position, 1,
&file_parser_dummy_hook))
{
- DBUG_RETURN(thd->net.report_error? -1 : 0);
+ error= thd->net.report_error? -1 : 0;
+ goto err;
}
}
else
- {
+ {
if (mode == VIEW_ALTER)
{
my_error(ER_NO_SUCH_TABLE, MYF(0), view->db, view->alias);
- DBUG_RETURN(-1);
- }
- }
- }
- /* fill structure */
- view->query.str= (char*)str.ptr();
- view->query.length= str.length()-1; // we do not need last \0
- view->source.str= thd->query + thd->lex->create_view_select_start;
- view->source.length= (char *)skip_rear_comments((uchar *)view->source.str,
- (uchar *)thd->query +
- thd->query_length) -
- view->source.str;
- view->file_version= 1;
- view->calc_md5(md5);
- view->md5.str= md5;
- view->md5.length= 32;
- can_be_merged= lex->can_be_merged();
- if (lex->create_view_algorithm == VIEW_ALGORITHM_MERGE &&
- !lex->can_be_merged())
- {
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_VIEW_MERGE,
- ER(ER_WARN_VIEW_MERGE));
- lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED;
- }
- view->algorithm= lex->create_view_algorithm;
- view->definer.user= lex->definer->user;
- view->definer.host= lex->definer->host;
- view->view_suid= lex->create_view_suid;
- view->with_check= lex->create_view_check;
- if ((view->updatable_view= (can_be_merged &&
- view->algorithm != VIEW_ALGORITHM_TMPTABLE)))
- {
- /* TODO: change here when we will support UNIONs */
- for (TABLE_LIST *tbl= (TABLE_LIST *)lex->select_lex.table_list.first;
- tbl;
- tbl= tbl->next_local)
- {
- if ((tbl->view && !tbl->updatable_view) || tbl->schema_table)
- {
- view->updatable_view= 0;
- break;
- }
- for (TABLE_LIST *up= tbl; up; up= up->embedding)
- {
- if (up->outer_join)
- {
- view->updatable_view= 0;
- goto loop_out;
- }
+ error= -1;
+ goto err;
}
}
}
-loop_out:
+
/*
Check that table of main select do not used in subqueries.
@@ -841,15 +850,23 @@ loop_out:
!view->updatable_view)
{
my_error(ER_VIEW_NONUPD_CHECK, MYF(0), view->db, view->table_name);
- DBUG_RETURN(-1);
+ error= -1;
+ goto err;
}
if (sql_create_definition_file(&dir, &file, view_file_type,
(gptr)view, view_parameters, num_view_backups))
{
- DBUG_RETURN(thd->net.report_error? -1 : 1);
+ error= thd->net.report_error? -1 : 1;
+ goto err;
}
DBUG_RETURN(0);
+err:
+ view->query.str= NULL;
+ view->query.length= 0;
+ view->md5.str= NULL;
+ view->md5.length= 0;
+ DBUG_RETURN(error);
}
@@ -984,10 +1001,14 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
now Lex placed in statement memory
*/
table->view= lex= thd->lex= (LEX*) new(thd->mem_root) st_lex_local;
- lex_start(thd, (uchar*)table->query.str, table->query.length);
- view_select= &lex->select_lex;
- view_select->select_number= ++thd->select_number;
+
{
+ Lex_input_stream lip(thd, table->query.str, table->query.length);
+ thd->m_lip= &lip;
+ lex_start(thd);
+ view_select= &lex->select_lex;
+ view_select->select_number= ++thd->select_number;
+
ulong save_mode= thd->variables.sql_mode;
/* switch off modes which can prevent normal parsing of VIEW
- MODE_REAL_AS_FLOAT affect only CREATE TABLE parsing
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 4a50a602121..d1da36dfa5b 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -86,12 +86,13 @@ const LEX_STRING null_lex_str={0,0};
void my_parse_error(const char *s)
{
THD *thd= current_thd;
+ Lex_input_stream *lip= thd->m_lip;
- char *yytext= (char*) thd->lex->tok_start;
+ const char *yytext= lip->tok_start;
/* Push an error into the error stack */
my_printf_error(ER_PARSE_ERROR, ER(ER_PARSE_ERROR), MYF(0), s,
- (yytext ? (char*) yytext : ""),
- thd->lex->yylineno);
+ (yytext ? yytext : ""),
+ lip->yylineno);
}
/**
@@ -1275,11 +1276,6 @@ deallocate:
{
THD *thd=YYTHD;
LEX *lex= thd->lex;
- if (lex->stmt_prepare_mode)
- {
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
lex->sql_command= SQLCOM_DEALLOCATE_PREPARE;
lex->prepared_stmt_name= $3;
};
@@ -1295,11 +1291,6 @@ prepare:
{
THD *thd=YYTHD;
LEX *lex= thd->lex;
- if (lex->stmt_prepare_mode)
- {
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
lex->sql_command= SQLCOM_PREPARE;
lex->prepared_stmt_name= $2;
};
@@ -1325,11 +1316,6 @@ execute:
{
THD *thd=YYTHD;
LEX *lex= thd->lex;
- if (lex->stmt_prepare_mode)
- {
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
lex->sql_command= SQLCOM_EXECUTE;
lex->prepared_stmt_name= $2;
}
@@ -1488,9 +1474,7 @@ create:
lex->sql_command= SQLCOM_CREATE_TABLE;
if (!lex->select_lex.add_table_to_list(thd, $5, NULL,
TL_OPTION_UPDATING,
- (using_update_log ?
- TL_READ_NO_INSERT:
- TL_READ)))
+ TL_WRITE))
MYSQL_YYABORT;
lex->alter_info.reset();
lex->col_list.empty();
@@ -1499,7 +1483,6 @@ create:
lex->create_info.options=$2 | $4;
lex->create_info.db_type= (enum db_type) lex->thd->variables.table_type;
lex->create_info.default_table_charset= NULL;
- lex->name=0;
}
create2
{ Lex->current_select= &Lex->select_lex; }
@@ -1619,7 +1602,9 @@ create_function_tail:
}
| '('
{
- LEX *lex= Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
sp_head *sp;
/*
@@ -1639,9 +1624,9 @@ create_function_tail:
}
/* Order is important here: new - reset - init */
sp= new sp_head();
- sp->reset_thd_mem_root(YYTHD);
+ sp->reset_thd_mem_root(thd);
sp->init(lex);
- sp->init_sp_name(YYTHD, lex->spname);
+ sp->init_sp_name(thd, lex->spname);
sp->m_type= TYPE_ENUM_FUNCTION;
lex->sphead= sp;
@@ -1650,15 +1635,17 @@ create_function_tail:
* stored procedure, otherwise yylex will chop it into pieces
* at each ';'.
*/
- sp->m_old_cmq= YYTHD->client_capabilities & CLIENT_MULTI_QUERIES;
- YYTHD->client_capabilities &= ~CLIENT_MULTI_QUERIES;
- lex->sphead->m_param_begin= lex->tok_start+1;
+ sp->m_old_cmq= thd->client_capabilities & CLIENT_MULTI_QUERIES;
+ thd->client_capabilities &= ~CLIENT_MULTI_QUERIES;
+ lex->sphead->m_param_begin= lip->tok_start+1;
}
sp_fdparam_list ')'
{
- LEX *lex= Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
- lex->sphead->m_param_end= lex->tok_start;
+ lex->sphead->m_param_end= lip->tok_start;
}
RETURNS_SYM
{
@@ -1682,10 +1669,12 @@ create_function_tail:
}
sp_c_chistics
{
- LEX *lex= Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
lex->sphead->m_chistics= &lex->sp_chistics;
- lex->sphead->m_body_begin= lex->tok_start;
+ lex->sphead->m_body_begin= lip->tok_start;
}
sp_proc_stmt
{
@@ -2233,14 +2222,18 @@ sp_opt_default:
sp_proc_stmt:
{
- LEX *lex= Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
- lex->sphead->reset_lex(YYTHD);
- lex->sphead->m_tmp_query= lex->tok_start;
+ lex->sphead->reset_lex(thd);
+ lex->sphead->m_tmp_query= lip->tok_start;
}
statement
{
- LEX *lex= Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
sp_head *sp= lex->sphead;
sp->m_flags|= sp_get_flags_for_command(lex);
@@ -2267,15 +2260,15 @@ sp_proc_stmt:
lex->tok_end otherwise.
*/
if (yychar == YYEMPTY)
- i->m_query.length= lex->ptr - sp->m_tmp_query;
+ i->m_query.length= lip->ptr - sp->m_tmp_query;
else
- i->m_query.length= lex->tok_end - sp->m_tmp_query;
- i->m_query.str= strmake_root(YYTHD->mem_root,
- (char *)sp->m_tmp_query,
+ i->m_query.length= lip->tok_end - sp->m_tmp_query;
+ i->m_query.str= strmake_root(thd->mem_root,
+ sp->m_tmp_query,
i->m_query.length);
sp->add_instr(i);
}
- sp->restore_lex(YYTHD);
+ sp->restore_lex(thd);
}
| RETURN_SYM
{ Lex->sphead->reset_lex(YYTHD); }
@@ -2769,27 +2762,15 @@ create2:
| opt_create_table_options create3 {}
| LIKE table_ident
{
- LEX *lex=Lex;
- THD *thd= lex->thd;
- if (!(lex->name= (char *)$2))
+ Lex->create_info.options|= HA_LEX_CREATE_TABLE_LIKE;
+ if (!Lex->select_lex.add_table_to_list(YYTHD, $2, NULL, 0, TL_READ))
MYSQL_YYABORT;
- if ($2->db.str == NULL &&
- thd->copy_db_to(&($2->db.str), &($2->db.length)))
- {
- MYSQL_YYABORT;
- }
}
| '(' LIKE table_ident ')'
{
- LEX *lex=Lex;
- THD *thd= lex->thd;
- if (!(lex->name= (char *)$3))
+ Lex->create_info.options|= HA_LEX_CREATE_TABLE_LIKE;
+ if (!Lex->select_lex.add_table_to_list(YYTHD, $3, NULL, 0, TL_READ))
MYSQL_YYABORT;
- if ($3->db.str == NULL &&
- thd->copy_db_to(&($3->db.str), &($3->db.length)))
- {
- MYSQL_YYABORT;
- }
}
;
@@ -4428,26 +4409,36 @@ select_item_list:
select_item:
remember_name select_item2 remember_end select_alias
{
- if (add_item_to_list(YYTHD, $2))
+ THD *thd= YYTHD;
+ DBUG_ASSERT($1 < $3);
+
+ if (add_item_to_list(thd, $2))
MYSQL_YYABORT;
if ($4.str)
{
$2->is_autogenerated_name= FALSE;
$2->set_name($4.str, $4.length, system_charset_info);
}
- else if (!$2->name) {
- char *str = $1;
- if (str[-1] == '`')
- str--;
- $2->set_name(str,(uint) ($3 - str), YYTHD->charset());
+ else if (!$2->name)
+ {
+ $2->set_name($1, (uint) ($3 - $1), thd->charset());
}
};
+
remember_name:
- { $$=(char*) Lex->tok_start; };
+ {
+ THD *thd= YYTHD;
+ Lex_input_stream *lip= thd->m_lip;
+ $$= (char*) lip->tok_start;
+ };
remember_end:
- { $$=(char*) Lex->tok_end; };
+ {
+ THD *thd= YYTHD;
+ Lex_input_stream *lip= thd->m_lip;
+ $$=(char*) lip->tok_end;
+ };
select_item2:
table_wild { $$=$1; } /* table.* */
@@ -4699,15 +4690,12 @@ simple_expr:
| ASCII_SYM '(' expr ')' { $$= new Item_func_ascii($3); }
| BINARY simple_expr %prec NEG
{
- $$= create_func_cast($2, ITEM_CAST_CHAR, -1, 0, &my_charset_bin);
+ $$= create_func_cast($2, ITEM_CAST_CHAR, NULL, NULL, &my_charset_bin);
}
| CAST_SYM '(' expr AS cast_type ')'
{
LEX *lex= Lex;
- $$= create_func_cast($3, $5,
- lex->length ? atoi(lex->length) : -1,
- lex->dec ? atoi(lex->dec) : 0,
- lex->charset);
+ $$= create_func_cast($3, $5, lex->length, lex->dec, lex->charset);
if (!$$)
MYSQL_YYABORT;
}
@@ -4715,10 +4703,7 @@ simple_expr:
{ $$= new Item_func_case(* $3, $2, $4 ); }
| CONVERT_SYM '(' expr ',' cast_type ')'
{
- $$= create_func_cast($3, $5,
- Lex->length ? atoi(Lex->length) : -1,
- Lex->dec ? atoi(Lex->dec) : 0,
- Lex->charset);
+ $$= create_func_cast($3, $5, Lex->length, Lex->dec, Lex->charset);
if (!$$)
MYSQL_YYABORT;
}
@@ -6216,6 +6201,9 @@ limit_options:
;
limit_option:
param_marker
+ {
+ ((Item_param *) $1)->set_strict_type(INT_RESULT);
+ }
| ULONGLONG_NUM { $$= new Item_uint($1.str, $1.length); }
| LONG_NUM { $$= new Item_uint($1.str, $1.length); }
| NUM { $$= new Item_uint($1.str, $1.length); }
@@ -6292,12 +6280,14 @@ procedure_list2:
procedure_item:
remember_name expr
{
- LEX *lex= Lex;
- if (add_proc_to_list(lex->thd, $2))
+ THD *thd= YYTHD;
+ Lex_input_stream *lip= thd->m_lip;
+
+ if (add_proc_to_list(thd, $2))
MYSQL_YYABORT;
if (!$2->name)
- $2->set_name($1,(uint) ((char*) lex->tok_end - $1),
- YYTHD->charset());
+ $2->set_name($1,(uint) ((char*) lip->tok_end - $1),
+ thd->charset());
}
;
@@ -6561,7 +6551,7 @@ insert_lock_option:
insert visible only after the table unlocking but everyone can
read table.
*/
- $$= (Lex->sphead ? TL_WRITE :TL_WRITE_CONCURRENT_INSERT);
+ $$= (Lex->sphead ? TL_WRITE_DEFAULT : TL_WRITE_CONCURRENT_INSERT);
#else
$$= TL_WRITE_CONCURRENT_INSERT;
#endif
@@ -6739,7 +6729,7 @@ insert_update_elem:
};
opt_low_priority:
- /* empty */ { $$= YYTHD->update_lock_default; }
+ /* empty */ { $$= TL_WRITE_DEFAULT; }
| LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; };
/* Delete rows from a table */
@@ -6750,7 +6740,7 @@ delete:
LEX *lex= Lex;
lex->sql_command= SQLCOM_DELETE;
mysql_init_select(lex);
- lex->lock_option= lex->thd->update_lock_default;
+ lex->lock_option= TL_WRITE_DEFAULT;
lex->ignore= 0;
lex->select_lex.init_order();
}
@@ -7337,13 +7327,16 @@ use: USE_SYM ident
load: LOAD DATA_SYM
{
- LEX *lex=Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+
if (lex->sphead)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "LOAD DATA");
MYSQL_YYABORT;
}
- lex->fname_start= lex->ptr;
+ lex->fname_start= lip->ptr;
}
load_data
{}
@@ -7378,8 +7371,10 @@ load_data:
}
opt_duplicate INTO
{
- LEX *lex=Lex;
- lex->fname_end= lex->ptr;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+ lex->fname_end= lip->ptr;
}
TABLE_SYM table_ident
{
@@ -7410,7 +7405,7 @@ opt_local:
| LOCAL_SYM { $$=1;};
load_data_lock:
- /* empty */ { $$= YYTHD->update_lock_default; }
+ /* empty */ { $$= TL_WRITE_DEFAULT; }
| CONCURRENT
{
#ifdef HAVE_QUERY_CACHE
@@ -7418,7 +7413,7 @@ load_data_lock:
Ignore this option in SP to avoid problem with query cache
*/
if (Lex->sphead != 0)
- $$= YYTHD->update_lock_default;
+ $$= TL_WRITE_DEFAULT;
else
#endif
$$= TL_WRITE_CONCURRENT_INSERT;
@@ -7559,15 +7554,16 @@ text_string:
param_marker:
PARAM_MARKER
{
- THD *thd=YYTHD;
+ THD *thd= YYTHD;
LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
Item_param *item;
if (! lex->parsing_options.allows_variable)
{
my_error(ER_VIEW_SELECT_VARIABLE, MYF(0));
MYSQL_YYABORT;
}
- item= new Item_param((uint) (lex->tok_start - (uchar *) thd->query));
+ item= new Item_param((uint) (lip->tok_start - thd->query));
if (!($$= item) || lex->param_list.push_back(item))
{
my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
@@ -7590,8 +7586,11 @@ signed_literal:
literal:
text_literal { $$ = $1; }
| NUM_literal { $$ = $1; }
- | NULL_SYM { $$ = new Item_null();
- Lex->next_state=MY_LEX_OPERATOR_OR_IDENT;}
+ | NULL_SYM
+ {
+ $$ = new Item_null();
+ YYTHD->m_lip->next_state=MY_LEX_OPERATOR_OR_IDENT;
+ }
| FALSE_SYM { $$= new Item_int((char*) "FALSE",0,1); }
| TRUE_SYM { $$= new Item_int((char*) "TRUE",1,1); }
| HEX_NUM { $$ = new Item_hex_string($1.str, $1.length);}
@@ -7681,8 +7680,10 @@ order_ident:
simple_ident:
ident
{
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
sp_variable_t *spv;
- LEX *lex = Lex;
sp_pcontext *spc = lex->spcont;
if (spc && (spv = spc->find_variable(&$1)))
{
@@ -7695,7 +7696,7 @@ simple_ident:
Item_splocal *splocal;
splocal= new Item_splocal($1, spv->offset, spv->type,
- lex->tok_start_prev -
+ lip->tok_start_prev -
lex->sphead->m_tmp_query);
#ifndef DBUG_OFF
if (splocal)
@@ -8291,7 +8292,11 @@ option_value_list:
option_type_value:
{
- if (Lex->sphead)
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+
+ if (lex->sphead)
{
/*
If we are in SP we want have own LEX for each assignment.
@@ -8303,9 +8308,8 @@ option_type_value:
QQ: May be we should simply prohibit group assignments in SP?
*/
- LEX *lex;
- Lex->sphead->reset_lex(YYTHD);
- lex= Lex;
+ Lex->sphead->reset_lex(thd);
+ lex= thd->lex;
/* Set new LEX as if we at start of set rule. */
lex->sql_command= SQLCOM_SET_OPTION;
@@ -8313,12 +8317,14 @@ option_type_value:
lex->option_type=OPT_SESSION;
lex->var_list.empty();
lex->one_shot_set= 0;
- lex->sphead->m_tmp_query= lex->tok_start;
+ lex->sphead->m_tmp_query= lip->tok_start;
}
}
ext_option_value
{
- LEX *lex= Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
if (lex->sphead)
{
@@ -8340,24 +8346,24 @@ option_type_value:
/*
Extract the query statement from the tokenizer. The
- end is either lex->ptr, if there was no lookahead,
- lex->tok_end otherwise.
+ end is either lip->ptr, if there was no lookahead,
+ lip->tok_end otherwise.
*/
if (yychar == YYEMPTY)
- qbuff.length= lex->ptr - sp->m_tmp_query;
+ qbuff.length= lip->ptr - sp->m_tmp_query;
else
- qbuff.length= lex->tok_end - sp->m_tmp_query;
+ qbuff.length= lip->tok_end - sp->m_tmp_query;
- if (!(qbuff.str= alloc_root(YYTHD->mem_root, qbuff.length + 5)))
+ if (!(qbuff.str= alloc_root(thd->mem_root, qbuff.length + 5)))
MYSQL_YYABORT;
- strmake(strmake(qbuff.str, "SET ", 4), (char *)sp->m_tmp_query,
+ strmake(strmake(qbuff.str, "SET ", 4), sp->m_tmp_query,
qbuff.length);
qbuff.length+= 4;
i->m_query= qbuff;
sp->add_instr(i);
}
- lex->sphead->restore_lex(YYTHD);
+ lex->sphead->restore_lex(thd);
}
};
@@ -8720,7 +8726,7 @@ table_lock:
lock_option:
READ_SYM { $$=TL_READ_NO_INSERT; }
- | WRITE_SYM { $$=YYTHD->update_lock_default; }
+ | WRITE_SYM { $$=TL_WRITE_DEFAULT; }
| LOW_PRIORITY WRITE_SYM { $$=TL_WRITE_LOW_PRIORITY; }
| READ_SYM LOCAL_SYM { $$= TL_READ; }
;
@@ -9615,7 +9621,9 @@ trigger_tail:
TRIGGER_SYM remember_name sp_name trg_action_time trg_event
ON remember_name table_ident FOR_SYM remember_name EACH_SYM ROW_SYM
{
- LEX *lex= Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
sp_head *sp;
if (lex->sphead)
@@ -9626,9 +9634,9 @@ trigger_tail:
if (!(sp= new sp_head()))
MYSQL_YYABORT;
- sp->reset_thd_mem_root(YYTHD);
+ sp->reset_thd_mem_root(thd);
sp->init(lex);
- sp->init_sp_name(YYTHD, $3);
+ sp->init_sp_name(thd, $3);
lex->stmt_definition_begin= $2;
lex->ident.str= $7;
@@ -9642,12 +9650,12 @@ trigger_tail:
stored procedure, otherwise yylex will chop it into pieces
at each ';'.
*/
- sp->m_old_cmq= YYTHD->client_capabilities & CLIENT_MULTI_QUERIES;
- YYTHD->client_capabilities &= ~CLIENT_MULTI_QUERIES;
+ sp->m_old_cmq= thd->client_capabilities & CLIENT_MULTI_QUERIES;
+ thd->client_capabilities &= ~CLIENT_MULTI_QUERIES;
bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
lex->sphead->m_chistics= &lex->sp_chistics;
- lex->sphead->m_body_begin= lex->ptr;
+ lex->sphead->m_body_begin= lip->ptr;
while (my_isspace(system_charset_info, lex->sphead->m_body_begin[0]))
++lex->sphead->m_body_begin;
}
@@ -9726,24 +9734,30 @@ sp_tail:
}
'('
{
- LEX *lex= Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
- lex->sphead->m_param_begin= lex->tok_start+1;
+ lex->sphead->m_param_begin= lip->tok_start+1;
}
sp_pdparam_list
')'
{
- LEX *lex= Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
- lex->sphead->m_param_end= lex->tok_start;
+ lex->sphead->m_param_end= lip->tok_start;
bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
}
sp_c_chistics
{
- LEX *lex= Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
lex->sphead->m_chistics= &lex->sp_chistics;
- lex->sphead->m_body_begin= lex->tok_start;
+ lex->sphead->m_body_begin= lip->tok_start;
}
sp_proc_stmt
{
diff --git a/sql/structs.h b/sql/structs.h
index 2dcafdef615..de4cc25db9f 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -142,12 +142,11 @@ typedef struct st_read_record { /* Parameter to read_record */
/*
- Originally MySQL used TIME structure inside server only, but since
+ Originally MySQL used MYSQL_TIME structure inside server only, but since
4.1 it's exported to user in the new client API. Define aliases for
new names to keep existing code simple.
*/
-typedef struct st_mysql_time TIME;
typedef enum enum_mysql_timestamp_type timestamp_type;
diff --git a/sql/table.cc b/sql/table.cc
index fb2012a79d1..9868aa9b9c1 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1986,6 +1986,47 @@ bool st_table_list::prep_where(THD *thd, Item **conds,
/*
+ Merge ON expressions for a view
+
+ SYNOPSIS
+ merge_on_conds()
+ thd thread handle
+ table table for the VIEW
+ is_cascaded TRUE <=> merge ON expressions from underlying views
+
+ DESCRIPTION
+ This function returns the result of ANDing the ON expressions
+ of the given view and all underlying views. The ON expressions
+ of the underlying views are added only if is_cascaded is TRUE.
+
+ RETURN
+ Pointer to the built expression if there is any.
+ Otherwise and in the case of a failure NULL is returned.
+*/
+
+static Item *
+merge_on_conds(THD *thd, TABLE_LIST *table, bool is_cascaded)
+{
+ DBUG_ENTER("merge_on_conds");
+
+ Item *cond= NULL;
+ DBUG_PRINT("info", ("alias: %s", table->alias));
+ if (table->on_expr)
+ cond= table->on_expr->copy_andor_structure(thd);
+ if (!table->nested_join)
+ DBUG_RETURN(cond);
+ List_iterator<TABLE_LIST> li(table->nested_join->join_list);
+ while (TABLE_LIST *tbl= li++)
+ {
+ if (tbl->view && !is_cascaded)
+ continue;
+ cond= and_conds(cond, merge_on_conds(thd, tbl, is_cascaded));
+ }
+ DBUG_RETURN(cond);
+}
+
+
+/*
Prepare check option expression of table
SYNOPSIS
@@ -2001,8 +2042,8 @@ bool st_table_list::prep_where(THD *thd, Item **conds,
VIEW_CHECK_LOCAL option.
NOTE
- This method build check options for every call
- (usual execution or every SP/PS call)
+ This method builds check option condition to use it later on
+ every call (usual execution or every SP/PS call).
This method have to be called after WHERE preparation
(st_table_list::prep_where)
@@ -2014,38 +2055,42 @@ bool st_table_list::prep_where(THD *thd, Item **conds,
bool st_table_list::prep_check_option(THD *thd, uint8 check_opt_type)
{
DBUG_ENTER("st_table_list::prep_check_option");
+ bool is_cascaded= check_opt_type == VIEW_CHECK_CASCADED;
for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
/* see comment of check_opt_type parameter */
- if (tbl->view &&
- tbl->prep_check_option(thd,
- ((check_opt_type == VIEW_CHECK_CASCADED) ?
- VIEW_CHECK_CASCADED :
- VIEW_CHECK_NONE)))
- {
+ if (tbl->view && tbl->prep_check_option(thd, (is_cascaded ?
+ VIEW_CHECK_CASCADED :
+ VIEW_CHECK_NONE)))
DBUG_RETURN(TRUE);
- }
}
- if (check_opt_type)
+ if (check_opt_type && !check_option_processed)
{
- Item *item= 0;
+ Query_arena *arena= thd->stmt_arena, backup;
+ arena= thd->activate_stmt_arena_if_needed(&backup); // For easier test
+
if (where)
{
DBUG_ASSERT(where->fixed);
- item= where->copy_andor_structure(thd);
+ check_option= where->copy_andor_structure(thd);
}
- if (check_opt_type == VIEW_CHECK_CASCADED)
+ if (is_cascaded)
{
for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
if (tbl->check_option)
- item= and_conds(item, tbl->check_option);
+ check_option= and_conds(check_option, tbl->check_option);
}
}
- if (item)
- thd->change_item_tree(&check_option, item);
+ check_option= and_conds(check_option,
+ merge_on_conds(thd, this, is_cascaded));
+
+ if (arena)
+ thd->restore_active_arena(arena, &backup);
+ check_option_processed= TRUE;
+
}
if (check_option)
@@ -2150,7 +2195,7 @@ void st_table_list::cleanup_items()
check CHECK OPTION condition
SYNOPSIS
- check_option()
+ st_table_list::view_check_option()
ignore_failure ignore check option fail
RETURN
diff --git a/sql/table.h b/sql/table.h
index 61232a39f0e..d4dc3e8c0b8 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -137,7 +137,12 @@ typedef struct st_table_share
const char *table_name; /* Table name (for open) */
const char *path; /* Path to .frm file (from datadir) */
LEX_STRING connect_string;
- key_map keys_in_use; /* Keys in use for table */
+
+ /*
+ Set of keys in use, implemented as a Bitmap.
+ Excludes keys disabled by ALTER TABLE ... DISABLE KEYS.
+ */
+ key_map keys_in_use;
key_map keys_for_keyread;
ulong avg_row_length; /* create information */
ulong raid_chunksize;
@@ -188,6 +193,8 @@ typedef struct st_table_share
} TABLE_SHARE;
+extern ulong refresh_version;
+
/* Information for one open table */
struct st_table {
@@ -206,7 +213,21 @@ struct st_table {
byte *record[2]; /* Pointer to records */
byte *insert_values; /* used by INSERT ... UPDATE */
- key_map quick_keys, used_keys, keys_in_use_for_query;
+ key_map quick_keys, used_keys;
+
+ /*
+ A set of keys that can be used in the query that references this
+ table
+
+ All indexes disabled on the table's TABLE_SHARE (see TABLE::s) will be
+ subtracted from this set upon instantiation. Thus for any TABLE t it holds
+ that t.keys_in_use_for_query is a subset of t.s.keys_in_use. Generally we
+ must not introduce any new keys here (see setup_tables).
+
+ The set is implemented as a bitmap.
+ */
+ key_map keys_in_use_for_query;
+ key_map merge_keys;
KEY *key_info; /* data of keys in database */
Field *next_number_field, /* Set if next_number is activated */
@@ -268,7 +289,24 @@ struct st_table {
my_bool force_index;
my_bool distinct,const_table,no_rows;
my_bool key_read, no_keyread;
- my_bool locked_by_flush;
+ /*
+ Placeholder for an open table which prevents other connections
+ from taking name-locks on this table. Typically used with
+ TABLE_SHARE::version member to take an exclusive name-lock on
+ this table name -- a name lock that not only prevents other
+ threads from opening the table, but also blocks other name
+ locks. This is achieved by:
+ - setting open_placeholder to 1 - this will block other name
+ locks, as wait_for_locked_table_name will be forced to wait,
+ see table_is_used for details.
+ - setting version to 0 - this will force other threads to close
+ the instance of this table and wait (this is the same approach
+ as used for usual name locks).
+ An exclusively name-locked table currently can have no handler
+ object associated with it (db_stat is always 0), but please do
+ not rely on that.
+ */
+ my_bool open_placeholder;
my_bool locked_by_name;
my_bool fulltext_searched;
my_bool no_cache;
@@ -291,6 +329,13 @@ struct st_table {
bool fill_item_list(List<Item> *item_list) const;
void reset_item_list(List<Item> *item_list) const;
+ /* Is table open or should be treated as such by name-locking? */
+ inline bool is_name_opened() { return db_stat || open_placeholder; }
+ /*
+ Is this instance of the table should be reopen or represents a name-lock?
+ */
+ inline bool needs_reopen_or_name_lock()
+ { return s->version != refresh_version; }
};
enum enum_schema_table_state
@@ -640,6 +685,8 @@ typedef struct st_table_list
bool compact_view_format; /* Use compact format for SHOW CREATE VIEW */
/* view where processed */
bool where_processed;
+ /* TRUE <=> VIEW CHECK OPTION expression has been processed */
+ bool check_option_processed;
/* FRMTYPE_ERROR if any type is acceptable */
enum frm_type_enum required_type;
char timestamp_buffer[20]; /* buffer for timestamp (19+1) */
@@ -648,6 +695,12 @@ typedef struct st_table_list
used for implicit LOCK TABLES only and won't be used in real statement.
*/
bool prelocking_placeholder;
+ /*
+ This TABLE_LIST object corresponds to the table to be created
+ so it is possible that it does not exist (used in CREATE TABLE
+ ... SELECT implementation).
+ */
+ bool create;
enum enum_schema_table_state schema_table_state;
void calc_md5(char *buffer);
@@ -655,7 +708,11 @@ typedef struct st_table_list
int view_check_option(THD *thd, bool ignore_failure);
bool setup_underlying(THD *thd);
void cleanup_items();
- bool placeholder() {return derived || view || schema_table || !table; }
+ bool placeholder()
+ {
+ return derived || view || schema_table || create && !table->db_stat ||
+ !table;
+ }
void print(THD *thd, String *str);
bool check_single_table(st_table_list **table, table_map map,
st_table_list *view);
diff --git a/sql/time.cc b/sql/time.cc
index a46f2fc237d..b4a8b047998 100644
--- a/sql/time.cc
+++ b/sql/time.cc
@@ -61,7 +61,7 @@ int calc_weekday(long daynr,bool sunday_first_day_of_week)
next week is week 1.
*/
-uint calc_week(TIME *l_time, uint week_behaviour, uint *year)
+uint calc_week(MYSQL_TIME *l_time, uint week_behaviour, uint *year)
{
uint days;
ulong daynr=calc_daynr(l_time->year,l_time->month,l_time->day);
@@ -179,7 +179,7 @@ ulong convert_month_to_period(ulong month)
/*
- Convert a timestamp string to a TIME value and produce a warning
+ Convert a timestamp string to a MYSQL_TIME value and produce a warning
if string was truncated during conversion.
NOTE
@@ -187,7 +187,7 @@ ulong convert_month_to_period(ulong month)
*/
timestamp_type
-str_to_datetime_with_warn(const char *str, uint length, TIME *l_time,
+str_to_datetime_with_warn(const char *str, uint length, MYSQL_TIME *l_time,
uint flags)
{
int was_cut;
@@ -200,13 +200,14 @@ str_to_datetime_with_warn(const char *str, uint length, TIME *l_time,
MODE_NO_ZERO_DATE))),
&was_cut);
if (was_cut || ts_type <= MYSQL_TIMESTAMP_ERROR)
- make_truncated_value_warning(current_thd, str, length, ts_type, NullS);
+ make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ str, length, ts_type, NullS);
return ts_type;
}
/*
- Convert a datetime from broken-down TIME representation to corresponding
+ Convert a datetime from broken-down MYSQL_TIME representation to corresponding
TIMESTAMP value.
SYNOPSIS
@@ -222,7 +223,7 @@ str_to_datetime_with_warn(const char *str, uint length, TIME *l_time,
0 - t contains datetime value which is out of TIMESTAMP range.
*/
-my_time_t TIME_to_timestamp(THD *thd, const TIME *t, my_bool *in_dst_time_gap)
+my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, my_bool *in_dst_time_gap)
{
my_time_t timestamp;
@@ -241,20 +242,20 @@ my_time_t TIME_to_timestamp(THD *thd, const TIME *t, my_bool *in_dst_time_gap)
/*
- Convert a time string to a TIME struct and produce a warning
+ Convert a time string to a MYSQL_TIME struct and produce a warning
if string was cut during conversion.
NOTE
See str_to_time() for more info.
*/
bool
-str_to_time_with_warn(const char *str, uint length, TIME *l_time)
+str_to_time_with_warn(const char *str, uint length, MYSQL_TIME *l_time)
{
int warning;
bool ret_val= str_to_time(str, length, l_time, &warning);
if (ret_val || warning)
- make_truncated_value_warning(current_thd, str, length,
- MYSQL_TIMESTAMP_TIME, NullS);
+ make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ str, length, MYSQL_TIMESTAMP_TIME, NullS);
return ret_val;
}
@@ -263,7 +264,7 @@ str_to_time_with_warn(const char *str, uint length, TIME *l_time)
Convert a system time structure to TIME
*/
-void localtime_to_TIME(TIME *to, struct tm *from)
+void localtime_to_TIME(MYSQL_TIME *to, struct tm *from)
{
to->neg=0;
to->second_part=0;
@@ -275,7 +276,7 @@ void localtime_to_TIME(TIME *to, struct tm *from)
to->second= (int) from->tm_sec;
}
-void calc_time_from_sec(TIME *to, long seconds, long microseconds)
+void calc_time_from_sec(MYSQL_TIME *to, long seconds, long microseconds)
{
long t_seconds;
to->hour= seconds/3600L;
@@ -644,7 +645,7 @@ const char *get_date_time_format_str(KNOWN_DATE_TIME_FORMAT *format,
MySQL doesn't support comparing of date/time/datetime strings that
are not in arbutary order as dates are compared as strings in some
context)
- This functions don't check that given TIME structure members are
+ This functions don't check that given MYSQL_TIME structure members are
in valid range. If they are not, return value won't reflect any
valid date either. Additionally, make_time doesn't take into
account time->day member: it's assumed that days have been converted
@@ -652,7 +653,7 @@ const char *get_date_time_format_str(KNOWN_DATE_TIME_FORMAT *format,
****************************************************************************/
void make_time(const DATE_TIME_FORMAT *format __attribute__((unused)),
- const TIME *l_time, String *str)
+ const MYSQL_TIME *l_time, String *str)
{
uint length= (uint) my_time_to_str(l_time, (char*) str->ptr());
str->length(length);
@@ -661,7 +662,7 @@ void make_time(const DATE_TIME_FORMAT *format __attribute__((unused)),
void make_date(const DATE_TIME_FORMAT *format __attribute__((unused)),
- const TIME *l_time, String *str)
+ const MYSQL_TIME *l_time, String *str)
{
uint length= (uint) my_date_to_str(l_time, (char*) str->ptr());
str->length(length);
@@ -670,7 +671,7 @@ void make_date(const DATE_TIME_FORMAT *format __attribute__((unused)),
void make_datetime(const DATE_TIME_FORMAT *format __attribute__((unused)),
- const TIME *l_time, String *str)
+ const MYSQL_TIME *l_time, String *str)
{
uint length= (uint) my_datetime_to_str(l_time, (char*) str->ptr());
str->length(length);
@@ -678,7 +679,8 @@ void make_datetime(const DATE_TIME_FORMAT *format __attribute__((unused)),
}
-void make_truncated_value_warning(THD *thd, const char *str_val,
+void make_truncated_value_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
+ const char *str_val,
uint str_length, timestamp_type time_type,
const char *field_name)
{
@@ -710,7 +712,7 @@ void make_truncated_value_warning(THD *thd, const char *str_val,
cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff),
ER(ER_TRUNCATED_WRONG_VALUE),
type_str, str.c_ptr());
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ push_warning(thd, level,
ER_TRUNCATED_WRONG_VALUE, warn_buff);
}
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 70f7cc5ea86..bedbf921cae 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -77,7 +77,7 @@ typedef struct lsinfo
/*
Structure with information describing ranges of my_time_t shifted to local
- time (my_time_t + offset). Used for local TIME -> my_time_t conversion.
+ time (my_time_t + offset). Used for local MYSQL_TIME -> my_time_t conversion.
See comments for TIME_to_gmt_sec() for more info.
*/
typedef struct revtinfo
@@ -292,9 +292,9 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage)
be used if there are no transitions or we have moment in time before
any transitions.
Second task is to build "shifted my_time_t" -> my_time_t map used in
- TIME -> my_time_t conversion.
+ MYSQL_TIME -> my_time_t conversion.
Note: See description of TIME_to_gmt_sec() function first.
- In order to perform TIME -> my_time_t conversion we need to build table
+ In order to perform MYSQL_TIME -> my_time_t conversion we need to build table
which defines "shifted by tz offset and leap seconds my_time_t" ->
my_time_t function wich is almost the same (except ranges of ambiguity)
as reverse function to piecewise linear function used for my_time_t ->
@@ -531,14 +531,14 @@ static const uint year_lengths[2]=
offset - local time zone offset
DESCRIPTION
- Convert my_time_t with offset to TIME struct. Differs from timesub
+ Convert my_time_t with offset to MYSQL_TIME struct. Differs from timesub
(from elsie code) because doesn't contain any leap correction and
TM_GMTOFF and is_dst setting and contains some MySQL specific
initialization. Funny but with removing of these we almost have
glibc's offtime function.
*/
static void
-sec_to_TIME(TIME * tmp, my_time_t t, long offset)
+sec_to_TIME(MYSQL_TIME * tmp, my_time_t t, long offset)
{
long days;
long rem;
@@ -594,7 +594,7 @@ sec_to_TIME(TIME * tmp, my_time_t t, long offset)
tmp->month++;
tmp->day= (uint)(days + 1);
- /* filling MySQL specific TIME members */
+ /* filling MySQL specific MYSQL_TIME members */
tmp->neg= 0; tmp->second_part= 0;
tmp->time_type= MYSQL_TIMESTAMP_DATETIME;
}
@@ -686,7 +686,7 @@ find_transition_type(my_time_t t, const TIME_ZONE_INFO *sp)
/*
Converts time in my_time_t representation (seconds in UTC since Epoch) to
- broken down TIME representation in local time zone.
+ broken down MYSQL_TIME representation in local time zone.
SYNOPSIS
gmt_sec_to_TIME()
@@ -701,12 +701,12 @@ find_transition_type(my_time_t t, const TIME_ZONE_INFO *sp)
(60th and 61st second, look how we calculate them as "hit" in this
function).
Under realistic assumptions about frequency of transitions the same array
- can be used fot TIME -> my_time_t conversion. For this we need to
+ can be used fot MYSQL_TIME -> my_time_t conversion. For this we need to
implement tweaked binary search which will take into account that some
- TIME has two matching my_time_t ranges and some of them have none.
+ MYSQL_TIME has two matching my_time_t ranges and some of them have none.
*/
static void
-gmt_sec_to_TIME(TIME *tmp, my_time_t sec_in_utc, const TIME_ZONE_INFO *sp)
+gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t sec_in_utc, const TIME_ZONE_INFO *sp)
{
const TRAN_TYPE_INFO *ttisp;
const LS_INFO *lp;
@@ -809,7 +809,7 @@ sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec)
/*
- Converts local time in broken down TIME representation to my_time_t
+ Converts local time in broken down MYSQL_TIME representation to my_time_t
representation.
SYNOPSIS
@@ -851,7 +851,7 @@ sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec)
We use completely different approach. It is better since it is both
faster than iterative implementations and fully determenistic. If you
- look at my_time_t to TIME conversion then you'll find that it consist
+ look at my_time_t to MYSQL_TIME conversion then you'll find that it consist
of two steps:
The first is calculating shifted my_time_t value and the second - TIME
calculation from shifted my_time_t value (well it is a bit simplified
@@ -881,7 +881,7 @@ sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec)
0 in case of error.
*/
static my_time_t
-TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp,
+TIME_to_gmt_sec(const MYSQL_TIME *t, const TIME_ZONE_INFO *sp,
my_bool *in_dst_time_gap)
{
my_time_t local_t;
@@ -1008,20 +1008,20 @@ class Time_zone_system : public Time_zone
{
public:
Time_zone_system() {} /* Remove gcc warning */
- virtual my_time_t TIME_to_gmt_sec(const TIME *t,
+ virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t,
my_bool *in_dst_time_gap) const;
- virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const;
+ virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const;
virtual const String * get_name() const;
};
/*
- Converts local time in system time zone in TIME representation
+ Converts local time in system time zone in MYSQL_TIME representation
to its my_time_t representation.
SYNOPSIS
TIME_to_gmt_sec()
- t - pointer to TIME structure with local time in
+ t - pointer to MYSQL_TIME structure with local time in
broken-down representation.
in_dst_time_gap - pointer to bool which is set to true if datetime
value passed doesn't really exist (i.e. falls into
@@ -1029,7 +1029,7 @@ public:
DESCRIPTION
This method uses system function (localtime_r()) for conversion
- local time in system time zone in TIME structure to its my_time_t
+ local time in system time zone in MYSQL_TIME structure to its my_time_t
representation. Unlike the same function for Time_zone_db class
it it won't handle unnormalized input properly. Still it will
return lowest possible my_time_t in case of ambiguity or if we
@@ -1041,7 +1041,7 @@ public:
Corresponding my_time_t value or 0 in case of error
*/
my_time_t
-Time_zone_system::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
+Time_zone_system::TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const
{
long not_used;
return my_system_gmt_sec(t, &not_used, in_dst_time_gap);
@@ -1054,7 +1054,7 @@ Time_zone_system::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
SYNOPSIS
gmt_sec_to_TIME()
- tmp - pointer to TIME structure to fill-in
+ tmp - pointer to MYSQL_TIME structure to fill-in
t - my_time_t value to be converted
NOTE
@@ -1065,7 +1065,7 @@ Time_zone_system::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
the 1902 easily.
*/
void
-Time_zone_system::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const
+Time_zone_system::gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const
{
struct tm tmp_tm;
time_t tmp_t= (time_t)t;
@@ -1095,26 +1095,26 @@ Time_zone_system::get_name() const
/*
Instance of this class represents UTC time zone. It uses system gmtime_r
function for conversions and is always available. It is used only for
- my_time_t -> TIME conversions in various UTC_... functions, it is not
- intended for TIME -> my_time_t conversions and shouldn't be exposed to user.
+ my_time_t -> MYSQL_TIME conversions in various UTC_... functions, it is not
+ intended for MYSQL_TIME -> my_time_t conversions and shouldn't be exposed to user.
*/
class Time_zone_utc : public Time_zone
{
public:
Time_zone_utc() {} /* Remove gcc warning */
- virtual my_time_t TIME_to_gmt_sec(const TIME *t,
+ virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t,
my_bool *in_dst_time_gap) const;
- virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const;
+ virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const;
virtual const String * get_name() const;
};
/*
- Convert UTC time from TIME representation to its my_time_t representation.
+ Convert UTC time from MYSQL_TIME representation to its my_time_t representation.
SYNOPSIS
TIME_to_gmt_sec()
- t - pointer to TIME structure with local time
+ t - pointer to MYSQL_TIME structure with local time
in broken-down representation.
in_dst_time_gap - pointer to bool which is set to true if datetime
value passed doesn't really exist (i.e. falls into
@@ -1129,7 +1129,7 @@ public:
0
*/
my_time_t
-Time_zone_utc::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
+Time_zone_utc::TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const
{
/* Should be never called */
DBUG_ASSERT(0);
@@ -1143,14 +1143,14 @@ Time_zone_utc::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
SYNOPSIS
gmt_sec_to_TIME()
- tmp - pointer to TIME structure to fill-in
+ tmp - pointer to MYSQL_TIME structure to fill-in
t - my_time_t value to be converted
NOTE
See note for apropriate Time_zone_system method.
*/
void
-Time_zone_utc::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const
+Time_zone_utc::gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const
{
struct tm tmp_tm;
time_t tmp_t= (time_t)t;
@@ -1191,9 +1191,9 @@ class Time_zone_db : public Time_zone
{
public:
Time_zone_db(TIME_ZONE_INFO *tz_info_arg, const String * tz_name_arg);
- virtual my_time_t TIME_to_gmt_sec(const TIME *t,
+ virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t,
my_bool *in_dst_time_gap) const;
- virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const;
+ virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const;
virtual const String * get_name() const;
private:
TIME_ZONE_INFO *tz_info;
@@ -1227,7 +1227,7 @@ Time_zone_db::Time_zone_db(TIME_ZONE_INFO *tz_info_arg,
SYNOPSIS
TIME_to_gmt_sec()
- t - pointer to TIME structure with local time
+ t - pointer to MYSQL_TIME structure with local time
in broken-down representation.
in_dst_time_gap - pointer to bool which is set to true if datetime
value passed doesn't really exist (i.e. falls into
@@ -1241,7 +1241,7 @@ Time_zone_db::Time_zone_db(TIME_ZONE_INFO *tz_info_arg,
Corresponding my_time_t value or 0 in case of error
*/
my_time_t
-Time_zone_db::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
+Time_zone_db::TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const
{
return ::TIME_to_gmt_sec(t, tz_info, in_dst_time_gap);
}
@@ -1253,11 +1253,11 @@ Time_zone_db::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
SYNOPSIS
gmt_sec_to_TIME()
- tmp - pointer to TIME structure to fill-in
+ tmp - pointer to MYSQL_TIME structure to fill-in
t - my_time_t value to be converted
*/
void
-Time_zone_db::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const
+Time_zone_db::gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const
{
::gmt_sec_to_TIME(tmp, t, tz_info);
}
@@ -1287,9 +1287,9 @@ class Time_zone_offset : public Time_zone
{
public:
Time_zone_offset(long tz_offset_arg);
- virtual my_time_t TIME_to_gmt_sec(const TIME *t,
+ virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t,
my_bool *in_dst_time_gap) const;
- virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const;
+ virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const;
virtual const String * get_name() const;
/*
This have to be public because we want to be able to access it from
@@ -1324,11 +1324,11 @@ Time_zone_offset::Time_zone_offset(long tz_offset_arg):
/*
Converts local time in time zone described as offset from UTC
- from TIME representation to its my_time_t representation.
+ from MYSQL_TIME representation to its my_time_t representation.
SYNOPSIS
TIME_to_gmt_sec()
- t - pointer to TIME structure with local time
+ t - pointer to MYSQL_TIME structure with local time
in broken-down representation.
in_dst_time_gap - pointer to bool which should be set to true if
datetime value passed doesn't really exist
@@ -1340,7 +1340,7 @@ Time_zone_offset::Time_zone_offset(long tz_offset_arg):
Corresponding my_time_t value or 0 in case of error
*/
my_time_t
-Time_zone_offset::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
+Time_zone_offset::TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const
{
my_time_t local_t;
int shift= 0;
@@ -1385,11 +1385,11 @@ Time_zone_offset::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
SYNOPSIS
gmt_sec_to_TIME()
- tmp - pointer to TIME structure to fill-in
+ tmp - pointer to MYSQL_TIME structure to fill-in
t - my_time_t value to be converted
*/
void
-Time_zone_offset::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const
+Time_zone_offset::gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const
{
sec_to_TIME(tmp, t, offset);
}
@@ -2651,7 +2651,7 @@ main(int argc, char **argv)
my_bool localtime_negative;
TIME_ZONE_INFO tz_info;
struct tm tmp;
- TIME time_tmp;
+ MYSQL_TIME time_tmp;
time_t t, t1, t2;
char fullname[FN_REFLEN+1];
char *str_end;
diff --git a/sql/tztime.h b/sql/tztime.h
index d1f33843810..32a942a26e1 100644
--- a/sql/tztime.h
+++ b/sql/tztime.h
@@ -22,7 +22,7 @@
/*
This class represents abstract time zone and provides
- basic interface for TIME <-> my_time_t conversion.
+ basic interface for MYSQL_TIME <-> my_time_t conversion.
Actual time zones which are specified by DB, or via offset
or use system functions are its descendants.
*/
@@ -31,18 +31,18 @@ class Time_zone: public Sql_alloc
public:
Time_zone() {} /* Remove gcc warning */
/*
- Converts local time in broken down TIME representation to
+ Converts local time in broken down MYSQL_TIME representation to
my_time_t (UTC seconds since Epoch) represenation.
Returns 0 in case of error. Sets in_dst_time_gap to true if date provided
falls into spring time-gap (or lefts it untouched otherwise).
*/
- virtual my_time_t TIME_to_gmt_sec(const TIME *t,
+ virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t,
my_bool *in_dst_time_gap) const = 0;
/*
Converts time in my_time_t representation to local time in
- broken down TIME representation.
+ broken down MYSQL_TIME representation.
*/
- virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const = 0;
+ virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const = 0;
/*
Because of constness of String returned by get_name() time zone name
have to be already zeroended to be able to use String::ptr() instead
diff --git a/sql/udf_example.c b/sql/udf_example.c
index 2bb4fe92d2f..0f28c2a14b0 100644
--- a/sql/udf_example.c
+++ b/sql/udf_example.c
@@ -130,7 +130,8 @@ typedef long long longlong;
#include <m_string.h> /* To get strmov() */
#else
/* when compiled as standalone */
-#define strmov(a,b) strcpy(a,b)
+#include <string.h>
+#define strmov(a,b) stpcpy(a,b)
#define bzero(a,b) memset(a,0,b)
#define memcpy_fixed(a,b,c) memcpy(a,b,c)
#endif
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 06b2e0c10a2..c01e6a0f00c 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -859,7 +859,9 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type,
(regfield->real_type() != FIELD_TYPE_YEAR ||
field->def->val_int() != 0))
{
- if (field->def->save_in_field(regfield, 1))
+ int res= field->def->save_in_field(regfield, 1);
+ /* If not ok or warning of level 'note' */
+ if (res != 0 && res != 3)
{
my_error(ER_INVALID_DEFAULT, MYF(0), regfield->field_name);
error= 1;
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c
index e9de0ade557..f9d29ca1739 100644
--- a/strings/ctype-bin.c
+++ b/strings/ctype-bin.c
@@ -271,6 +271,29 @@ static int my_wc_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
}
+void my_hash_sort_8bit_bin(CHARSET_INFO *cs __attribute__((unused)),
+ const uchar *key, uint len,ulong *nr1, ulong *nr2)
+{
+ const uchar *pos = key;
+
+ key+= len;
+
+ /*
+ Remove trailing spaces. We have to do this to be able to compare
+ 'A ' and 'A' as identical
+ */
+ while (key > pos && key[-1] == ' ')
+ key--;
+
+ for (; pos < (uchar*) key ; pos++)
+ {
+ nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) *
+ ((uint)*pos)) + (nr1[0] << 8);
+ nr2[0]+=3;
+ }
+}
+
+
void my_hash_sort_bin(CHARSET_INFO *cs __attribute__((unused)),
const uchar *key, uint len,ulong *nr1, ulong *nr2)
{
@@ -471,7 +494,7 @@ MY_COLLATION_HANDLER my_collation_8bit_bin_handler =
my_wildcmp_bin,
my_strcasecmp_bin,
my_instr_bin,
- my_hash_sort_bin,
+ my_hash_sort_8bit_bin,
my_propagate_simple
};
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index 40cec669766..c12426b555f 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -467,6 +467,13 @@ static void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
key+= len;
+ /*
+ Remove trailing spaces. We have to do this to be able to compare
+ 'A ' and 'A' as identical
+ */
+ while (key > pos && key[-1] == ' ')
+ key--;
+
for (; pos < (uchar*) key ; pos++)
{
nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) *
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index 6b1ba3c1ef6..f3abbaa6e7e 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1484,7 +1484,10 @@ void my_hash_sort_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
const uchar *pos = key;
key+= len;
-
+
+ while (key > pos+1 && key[-1] == ' ' && key[-2] == '\0')
+ key-= 2;
+
for (; pos < (uchar*) key ; pos++)
{
nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) *
diff --git a/strings/decimal.c b/strings/decimal.c
index ea92174bfc8..f1f02f3a071 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1083,7 +1083,11 @@ int decimal2longlong(decimal_t *from, longlong *to)
x=x*DIG_BASE - *buf++;
if (unlikely(y < (LONGLONG_MIN/DIG_BASE) || x > y))
{
- *to= from->sign ? y : -y;
+ /*
+ the decimal is bigger than any possible integer
+ return border integer depending on the sign
+ */
+ *to= from->sign ? LONGLONG_MIN : LONGLONG_MAX;
return E_DEC_OVERFLOW;
}
}
@@ -1513,9 +1517,10 @@ decimal_round(decimal_t *from, decimal_t *to, int scale,
dec1 *p0= buf0+intg0+max(frac1, frac0);
dec1 *p1= buf1+intg1+max(frac1, frac0);
- to->buf[0]= 0;
while (buf0 < p0)
*(--p1) = *(--p0);
+ if (unlikely(intg1 > intg0))
+ to->buf[0]= 0;
intg0= intg1;
buf0=to->buf;
@@ -1911,6 +1916,14 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
return error;
}
+int decimal_intg(decimal_t *from)
+{
+ int res;
+ dec1 *tmp_res;
+ tmp_res= remove_leading_zeroes(from, &res);
+ return res;
+}
+
int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to)
{
if (likely(from1->sign == from2->sign))
diff --git a/strings/strtod.c b/strings/strtod.c
index 15707a9b944..5fe59d10bd2 100644
--- a/strings/strtod.c
+++ b/strings/strtod.c
@@ -31,13 +31,40 @@
#define MAX_DBL_EXP 308
#define MAX_RESULT_FOR_MAX_EXP 1.7976931348623157
-static double scaler10[] = {
- 1.0, 1e10, 1e20, 1e30, 1e40, 1e50, 1e60, 1e70, 1e80, 1e90
-};
-static double scaler1[] = {
- 1.0, 10.0, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9
-};
+const double log_10[] = {
+ 1e000, 1e001, 1e002, 1e003, 1e004, 1e005, 1e006, 1e007, 1e008, 1e009,
+ 1e010, 1e011, 1e012, 1e013, 1e014, 1e015, 1e016, 1e017, 1e018, 1e019,
+ 1e020, 1e021, 1e022, 1e023, 1e024, 1e025, 1e026, 1e027, 1e028, 1e029,
+ 1e030, 1e031, 1e032, 1e033, 1e034, 1e035, 1e036, 1e037, 1e038, 1e039,
+ 1e040, 1e041, 1e042, 1e043, 1e044, 1e045, 1e046, 1e047, 1e048, 1e049,
+ 1e050, 1e051, 1e052, 1e053, 1e054, 1e055, 1e056, 1e057, 1e058, 1e059,
+ 1e060, 1e061, 1e062, 1e063, 1e064, 1e065, 1e066, 1e067, 1e068, 1e069,
+ 1e070, 1e071, 1e072, 1e073, 1e074, 1e075, 1e076, 1e077, 1e078, 1e079,
+ 1e080, 1e081, 1e082, 1e083, 1e084, 1e085, 1e086, 1e087, 1e088, 1e089,
+ 1e090, 1e091, 1e092, 1e093, 1e094, 1e095, 1e096, 1e097, 1e098, 1e099,
+ 1e100, 1e101, 1e102, 1e103, 1e104, 1e105, 1e106, 1e107, 1e108, 1e109,
+ 1e110, 1e111, 1e112, 1e113, 1e114, 1e115, 1e116, 1e117, 1e118, 1e119,
+ 1e120, 1e121, 1e122, 1e123, 1e124, 1e125, 1e126, 1e127, 1e128, 1e129,
+ 1e130, 1e131, 1e132, 1e133, 1e134, 1e135, 1e136, 1e137, 1e138, 1e139,
+ 1e140, 1e141, 1e142, 1e143, 1e144, 1e145, 1e146, 1e147, 1e148, 1e149,
+ 1e150, 1e151, 1e152, 1e153, 1e154, 1e155, 1e156, 1e157, 1e158, 1e159,
+ 1e160, 1e161, 1e162, 1e163, 1e164, 1e165, 1e166, 1e167, 1e168, 1e169,
+ 1e170, 1e171, 1e172, 1e173, 1e174, 1e175, 1e176, 1e177, 1e178, 1e179,
+ 1e180, 1e181, 1e182, 1e183, 1e184, 1e185, 1e186, 1e187, 1e188, 1e189,
+ 1e190, 1e191, 1e192, 1e193, 1e194, 1e195, 1e196, 1e197, 1e198, 1e199,
+ 1e200, 1e201, 1e202, 1e203, 1e204, 1e205, 1e206, 1e207, 1e208, 1e209,
+ 1e210, 1e211, 1e212, 1e213, 1e214, 1e215, 1e216, 1e217, 1e218, 1e219,
+ 1e220, 1e221, 1e222, 1e223, 1e224, 1e225, 1e226, 1e227, 1e228, 1e229,
+ 1e230, 1e231, 1e232, 1e233, 1e234, 1e235, 1e236, 1e237, 1e238, 1e239,
+ 1e240, 1e241, 1e242, 1e243, 1e244, 1e245, 1e246, 1e247, 1e248, 1e249,
+ 1e250, 1e251, 1e252, 1e253, 1e254, 1e255, 1e256, 1e257, 1e258, 1e259,
+ 1e260, 1e261, 1e262, 1e263, 1e264, 1e265, 1e266, 1e267, 1e268, 1e269,
+ 1e270, 1e271, 1e272, 1e273, 1e274, 1e275, 1e276, 1e277, 1e278, 1e279,
+ 1e280, 1e281, 1e282, 1e283, 1e284, 1e285, 1e286, 1e287, 1e288, 1e289,
+ 1e290, 1e291, 1e292, 1e293, 1e294, 1e295, 1e296, 1e297, 1e298, 1e299,
+ 1e300, 1e301, 1e302, 1e303, 1e304, 1e305, 1e306, 1e307, 1e308
+};
/*
Convert string to double (string doesn't have to be null terminated)
@@ -57,7 +84,7 @@ double my_strtod(const char *str, char **end_ptr, int *error)
{
double result= 0.0;
uint negative= 0, ndigits, dec_digits= 0, neg_exp= 0;
- int exponent= 0, digits_after_dec_point= 0, tmp_exp;
+ int exponent= 0, digits_after_dec_point= 0, tmp_exp, step;
const char *old_str, *end= *end_ptr, *start_of_number;
char next_char;
my_bool overflow=0;
@@ -179,22 +206,16 @@ double my_strtod(const char *str, char **end_ptr, int *error)
exponent= -exponent;
neg_exp= 1; /* neg_exp was 0 before */
}
- while (exponent >= 100)
- {
- result= neg_exp ? result/1.0e100 : result*1.0e100;
- exponent-= 100;
- }
- scaler= scaler10[exponent/10]*scaler1[exponent%10];
- if (neg_exp)
- result/= scaler;
- else
- result*= scaler;
+ step= array_elements(log_10) - 1;
+ for (; exponent > step; exponent-= step)
+ result= neg_exp ? result / log_10[step] : result * log_10[step];
+ result= neg_exp ? result / log_10[exponent] : result * log_10[exponent];
}
done:
*end_ptr= (char*) str; /* end of number */
- if (overflow || isinf(result))
+ if (overflow || my_isinf(result))
{
result= DBL_MAX;
*error= EOVERFLOW;
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index 54e2a6adba6..ddeb29bec8c 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -534,7 +534,7 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/mysqld_multi.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_privilege_tables.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_install_db.1
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_install_db.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_upgrade.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlhotcopy.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlman.1*
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 38346ad0dbc..e56dd693287 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -15561,6 +15561,69 @@ static void test_bug24179()
/*
+ Bug#27876 (SF with cyrillic variable name fails during execution (regression))
+*/
+static void test_bug27876()
+{
+ int rc;
+ MYSQL_RES *result;
+
+ char utf8_func[] =
+ {
+ 0xd1, 0x84, 0xd1, 0x83, 0xd0, 0xbd, 0xd0, 0xba,
+ 0xd1, 0x86, 0xd0, 0xb8, 0xd0, 0xb9, 0xd0, 0xba,
+ 0xd0, 0xb0,
+ 0x00
+ };
+
+ char utf8_param[] =
+ {
+ 0xd0, 0xbf, 0xd0, 0xb0, 0xd1, 0x80, 0xd0, 0xb0,
+ 0xd0, 0xbc, 0xd0, 0xb5, 0xd1, 0x82, 0xd1, 0x8a,
+ 0xd1, 0x80, 0x5f, 0xd0, 0xb2, 0xd0, 0xb5, 0xd1,
+ 0x80, 0xd1, 0x81, 0xd0, 0xb8, 0xd1, 0x8f,
+ 0x00
+ };
+
+ char query[500];
+
+ DBUG_ENTER("test_bug27876");
+ myheader("test_bug27876");
+
+ rc= mysql_query(mysql, "set names utf8");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "select version()");
+ myquery(rc);
+ result= mysql_store_result(mysql);
+ mytest(result);
+
+ sprintf(query, "DROP FUNCTION IF EXISTS %s", utf8_func);
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+
+ sprintf(query,
+ "CREATE FUNCTION %s( %s VARCHAR(25))"
+ " RETURNS VARCHAR(25) DETERMINISTIC RETURN %s",
+ utf8_func, utf8_param, utf8_param);
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+ sprintf(query, "SELECT %s(VERSION())", utf8_func);
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+ result= mysql_store_result(mysql);
+ mytest(result);
+
+ sprintf(query, "DROP FUNCTION %s", utf8_func);
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+
+ rc= mysql_query(mysql, "set names default");
+ myquery(rc);
+}
+
+
+/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -15840,6 +15903,7 @@ static struct my_tests_st my_tests[]= {
{ "test_bug23383", test_bug23383 },
{ "test_bug21635", test_bug21635 },
{ "test_bug24179", test_bug24179 },
+ { "test_bug27876", test_bug27876 },
{ 0, 0 }
};
diff --git a/vio/vio_priv.h b/vio/vio_priv.h
index 4a272e519a3..9036952d575 100644
--- a/vio/vio_priv.h
+++ b/vio/vio_priv.h
@@ -23,6 +23,7 @@
#include <violite.h>
void vio_ignore_timeout(Vio *vio, uint which, uint timeout);
+void vio_timeout(Vio *vio,uint which, uint timeout);
#ifdef HAVE_OPENSSL
#include "my_net.h" /* needed because of struct in_addr */
diff --git a/vio/viosocket.c b/vio/viosocket.c
index 01abde6e0f7..84fdd6f57e4 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -204,13 +204,14 @@ int vio_fastsend(Vio * vio __attribute__((unused)))
{
#ifdef __WIN__
BOOL nodelay= 1;
- r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (const char*) &nodelay,
- sizeof(nodelay));
#else
int nodelay = 1;
- r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (void*) &nodelay,
+#endif
+
+ r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY,
+ IF_WIN(const char*, void*) &nodelay,
sizeof(nodelay));
-#endif /* __WIN__ */
+
}
if (r)
{
@@ -380,28 +381,39 @@ my_bool vio_poll_read(Vio *vio,uint timeout)
void vio_timeout(Vio *vio, uint which, uint timeout)
{
-/* TODO: some action should be taken if socket timeouts are not supported. */
#if defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO)
+ int r;
+ DBUG_ENTER("vio_timeout");
+ {
#ifdef __WIN__
-
- /* Windows expects time in milliseconds as int. */
+ /* Windows expects time in milliseconds as int */
int wait_timeout= (int) timeout * 1000;
-
-#else /* ! __WIN__ */
-
+#else
/* POSIX specifies time as struct timeval. */
struct timeval wait_timeout;
wait_timeout.tv_sec= timeout;
wait_timeout.tv_usec= 0;
+#endif
+
+ r= setsockopt(vio->sd, SOL_SOCKET, which ? SO_SNDTIMEO : SO_RCVTIMEO,
+ IF_WIN(const char*, const void*)&wait_timeout,
+ sizeof(wait_timeout));
-#endif /* ! __WIN__ */
+ }
- /* TODO: return value should be checked. */
- (void) setsockopt(vio->sd, SOL_SOCKET, which ? SO_SNDTIMEO : SO_RCVTIMEO,
- (char*) &wait_timeout, sizeof(wait_timeout));
+#ifndef DBUG_OFF
+ if (r != 0)
+ DBUG_PRINT("error", ("setsockopt failed: %d, errno: %d", r, socket_errno));
+#endif
-#endif /* defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO) */
+ DBUG_VOID_RETURN;
+#else
+/*
+ Platforms not suporting setting of socket timeout should either use
+ thr_alarm or just run without read/write timeout(s)
+*/
+#endif
}
diff --git a/win/Makefile.am b/win/Makefile.am
index c6632737d7b..89f0d65b528 100755
--- a/win/Makefile.am
+++ b/win/Makefile.am
@@ -14,7 +14,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
## Process this file with automake to create Makefile.in
-EXTRA_DIST = build-vs71.bat build-vs8.bat build-vs8_x64.bat configure.js README \
+EXTRA_DIST = build-vs71.bat build-vs8.bat build-vs8_x64.bat configure.js README \
mysql_manifest.cmake create_manifest.js
# Don't update the files from bitkeeper
diff --git a/win/create_manifest.js b/win/create_manifest.js
index 5605f57ef74..520ecec21b8 100755
--- a/win/create_manifest.js
+++ b/win/create_manifest.js
@@ -27,7 +27,12 @@ try
var app_name= parts[1];
break;
case "version":
- var app_version= parts[1];
+ var supp_version= parts[1];
+ // Clean up the supplied version string.
+ var end= supp_version.indexOf("-");
+ if (end == -1) end= supp_version.length;
+ var app_version= supp_version.substring(0, end);
+ app_version+= ".0";
break;
case "arch":
var app_arch= parts[1];