summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore5
-rw-r--r--BUILD/Makefile.am2
-rw-r--r--BUILD/compile-amd64-max-sci8
-rwxr-xr-xBUILD/compile-pentium-debug3
-rwxr-xr-xBUILD/compile-pentium-debug-max3
-rwxr-xr-xBUILD/compile-pentium-debug-max-no-ndb3
-rwxr-xr-xBUILD/compile-pentium64-debug3
-rwxr-xr-xBUILD/compile-pentium64-debug-max3
-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.txt42
-rw-r--r--Makefile.am13
-rw-r--r--VC++Files/mysql.sln1
-rwxr-xr-xclient/CMakeLists.txt15
-rw-r--r--client/Makefile.am14
-rw-r--r--client/mysql.cc4
-rw-r--r--client/mysql_upgrade.c1160
-rw-r--r--client/mysqldump.c23
-rw-r--r--client/mysqltest.c303
-rw-r--r--config/ac-macros/ha_ndbcluster.m42
-rw-r--r--configure.in119
-rw-r--r--dbug/dbug_analyze.c4
-rw-r--r--debian/Makefile.am118
-rw-r--r--debian/README.Maintainer99
-rw-r--r--debian/additions/my.cnf134
-rw-r--r--debian/additions/mysql-server.lintian-overrides2
-rw-r--r--debian/additions/ndb_mgmd.cnf35
-rw-r--r--debian/changelog3275
-rw-r--r--debian/compat1
-rw-r--r--debian/control.in353
-rw-r--r--debian/copyright139
-rw-r--r--debian/copyright.more60
-rw-r--r--debian/defs.mk.in14
-rw-r--r--debian/libmysqlclientSLIB-dev.README.Maintainer.in4
-rw-r--r--debian/libmysqlclientSLIB-dev.dirs.in2
-rw-r--r--debian/libmysqlclientSLIB-dev.docs.in1
-rw-r--r--debian/libmysqlclientSLIB-dev.examples.in1
-rw-r--r--debian/libmysqlclientSLIB-dev.files.in7
-rw-r--r--debian/libmysqlclientSLIB-dev.links.in2
-rw-r--r--debian/libmysqlclientSLIBoff.README.Debian.in30
-rw-r--r--debian/libmysqlclientSLIBoff.dirs.in1
-rw-r--r--debian/libmysqlclientSLIBoff.docs.in1
-rw-r--r--debian/libmysqlclientSLIBoff.files.in1
-rw-r--r--debian/libmysqlclientSLIBoff.postinst.in12
-rw-r--r--debian/libndbclientNLIB-dev.dirs.in3
-rw-r--r--debian/libndbclientNLIB-dev.files.in3
-rw-r--r--debian/libndbclientNLIB-dev.links.in1
-rw-r--r--debian/libndbclientNLIB.README.Debian.in30
-rw-r--r--debian/libndbclientNLIB.dirs.in1
-rw-r--r--debian/libndbclientNLIB.files.in1
-rw-r--r--debian/libndbclientNLIB.postinst.in12
-rw-r--r--debian/mysql-client-BASE.NEWS.in6
-rw-r--r--debian/mysql-client-BASE.README.Debian.in4
-rw-r--r--debian/mysql-client-BASE.dirs.in2
-rw-r--r--debian/mysql-client-BASE.docs.in2
-rw-r--r--debian/mysql-client-BASE.files.in18
-rw-r--r--debian/mysql-client-BASE.lintian-overrides.in1
-rw-r--r--debian/mysql-common.README.Debian.in20
-rw-r--r--debian/mysql-common.dirs.in1
-rw-r--r--debian/mysql-common.files.in2
-rw-r--r--debian/mysql-common.postrm.in7
-rw-r--r--debian/mysql-common.preinst.in215
-rw-r--r--debian/mysql-extra-BASE.dirs.in1
-rw-r--r--debian/mysql-extra-BASE.files.in3
-rw-r--r--debian/mysql-management-BASE.dirs.in1
-rw-r--r--debian/mysql-management-BASE.files.in1
-rw-r--r--debian/mysql-management-BASE.mysql-management.init.in86
-rw-r--r--debian/mysql-server-BASE.NEWS.in10
-rw-r--r--debian/mysql-server-BASE.README.Debian.in125
-rw-r--r--debian/mysql-server-BASE.config.in39
-rw-r--r--debian/mysql-server-BASE.dirs.in13
-rw-r--r--debian/mysql-server-BASE.docs.in2
-rw-r--r--debian/mysql-server-BASE.files.in50
-rw-r--r--debian/mysql-server-BASE.links.in1
-rw-r--r--debian/mysql-server-BASE.lintian-overrides.in4
-rw-r--r--debian/mysql-server-BASE.logcheck.ignore.paranoid.in10
-rw-r--r--debian/mysql-server-BASE.logcheck.ignore.server.in31
-rw-r--r--debian/mysql-server-BASE.logcheck.ignore.workstation.in31
-rw-r--r--debian/mysql-server-BASE.mysql-server.logrotate.in28
-rw-r--r--debian/mysql-server-BASE.postinst.in276
-rw-r--r--debian/mysql-server-BASE.postrm.in92
-rw-r--r--debian/mysql-server-BASE.preinst.in167
-rw-r--r--debian/mysql-server-BASE.prerm.in8
-rw-r--r--debian/mysql-server-BASE.templates.in71
-rw-r--r--debian/mysql-server-PREV.preinst.in191
-rw-r--r--debian/mysql-server.preinst.in191
-rw-r--r--debian/mysql-storage-BASE.dirs.in1
-rw-r--r--debian/mysql-storage-BASE.files.in1
-rw-r--r--debian/mysql-storage-BASE.mysql-storage.init.in85
-rw-r--r--debian/mysql-test-BASE.dirs.in2
-rw-r--r--debian/mysql-test-BASE.files.in6
-rw-r--r--debian/mysql-tools-BASE.dirs.in2
-rw-r--r--debian/mysql-tools-BASE.files.in13
-rw-r--r--debian/po/POTFILES.in.in1
-rw-r--r--debian/po/ca.po290
-rw-r--r--debian/po/cs.po259
-rw-r--r--debian/po/da.po283
-rw-r--r--debian/po/de.po195
-rw-r--r--debian/po/es.po288
-rw-r--r--debian/po/eu.po163
-rw-r--r--debian/po/fr.po204
-rw-r--r--debian/po/gl.po279
-rw-r--r--debian/po/it.po184
-rw-r--r--debian/po/ja.po278
-rw-r--r--debian/po/nb.po179
-rw-r--r--debian/po/nl.po187
-rw-r--r--debian/po/pt.po198
-rw-r--r--debian/po/pt_BR.po339
-rw-r--r--debian/po/ro.po193
-rw-r--r--debian/po/ru.po172
-rw-r--r--debian/po/sv.po225
-rw-r--r--debian/po/templates.pot155
-rw-r--r--debian/po/tr.po290
-rwxr-xr-xdebian/rules405
-rw-r--r--debian/source.lintian-overrides.in6
-rw-r--r--debian/watch3
-rwxr-xr-xextra/CMakeLists.txt7
-rw-r--r--extra/my_print_defaults.c23
-rw-r--r--extra/yassl/taocrypt/src/misc.cpp37
-rw-r--r--include/Makefile.am6
-rw-r--r--include/abi_check0
-rw-r--r--include/decimal.h1
-rw-r--r--include/m_ctype.h2
-rw-r--r--include/my_attribute.h63
-rw-r--r--include/my_global.h61
-rw-r--r--include/my_sys.h5
-rw-r--r--include/my_time.h1
-rw-r--r--innobase/configure.in2
-rw-r--r--innobase/os/os0file.c207
-rwxr-xr-xlibmysql/CMakeLists.txt9
-rw-r--r--libmysqld/Makefile.am8
-rw-r--r--libmysqld/examples/Makefile.am3
-rwxr-xr-xmyisam/CMakeLists.txt8
-rw-r--r--myisam/mi_check.c13
-rw-r--r--myisam/mi_info.c6
-rw-r--r--myisam/mi_rkey.c4
-rw-r--r--myisam/myisamdef.h1
-rw-r--r--myisam/sort.c11
-rw-r--r--myisammrg/myrg_rkey.c4
-rw-r--r--mysql-test/Makefile.am9
-rw-r--r--mysql-test/include/have_log_bin.inc4
-rw-r--r--mysql-test/include/have_lowercase1.inc4
-rw-r--r--mysql-test/include/ps_conv.inc4
-rw-r--r--mysql-test/lib/mtr_cases.pl7
-rw-r--r--mysql-test/lib/mtr_process.pl7
-rw-r--r--mysql-test/lib/mtr_report.pl16
-rwxr-xr-xmysql-test/mysql-test-run.pl19
-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.result24
-rw-r--r--mysql-test/r/bigint.result10
-rw-r--r--mysql-test/r/blackhole.result4
-rw-r--r--mysql-test/r/cast.result14
-rw-r--r--mysql-test/r/create.result94
-rw-r--r--mysql-test/r/date_formats.result18
-rw-r--r--mysql-test/r/distinct.result2
-rw-r--r--mysql-test/r/fix_priv_tabs.result0
-rw-r--r--mysql-test/r/fulltext.result7
-rw-r--r--mysql-test/r/func_gconcat.result26
-rw-r--r--mysql-test/r/func_group.result47
-rw-r--r--mysql-test/r/func_in.result1
-rw-r--r--mysql-test/r/func_math.result95
-rw-r--r--mysql-test/r/func_sapdb.result6
-rw-r--r--mysql-test/r/func_str.result69
-rw-r--r--mysql-test/r/grant.result30
-rw-r--r--mysql-test/r/group_by.result12
-rw-r--r--mysql-test/r/have_log_bin.require2
-rw-r--r--mysql-test/r/innodb.result25
-rw-r--r--mysql-test/r/innodb_mysql.result171
-rw-r--r--mysql-test/r/insert.result116
-rw-r--r--mysql-test/r/insert_update.result57
-rw-r--r--mysql-test/r/join.result78
-rw-r--r--mysql-test/r/join_outer.result25
-rw-r--r--mysql-test/r/key.result41
-rw-r--r--mysql-test/r/loaddata.result19
-rw-r--r--mysql-test/r/lowercase1.require2
-rw-r--r--mysql-test/r/lowercase_mixed_tmpdir.result6
-rw-r--r--mysql-test/r/merge.result11
-rw-r--r--mysql-test/r/mysql.result2
-rw-r--r--mysql-test/r/mysql_upgrade.result106
-rw-r--r--mysql-test/r/mysqldump.result35
-rw-r--r--mysql-test/r/mysqltest.result128
-rw-r--r--mysql-test/r/ndb_basic.result6
-rw-r--r--mysql-test/r/ndb_insert.result8
-rw-r--r--mysql-test/r/ndb_single_user.result5
-rw-r--r--mysql-test/r/olap.result61
-rw-r--r--mysql-test/r/openssl_1.result108
-rw-r--r--mysql-test/r/outfile.resultbin1382 -> 2135 bytes
-rw-r--r--mysql-test/r/ps.result28
-rw-r--r--mysql-test/r/ps_1general.result6
-rw-r--r--mysql-test/r/ps_2myisam.result11
-rw-r--r--mysql-test/r/ps_3innodb.result11
-rw-r--r--mysql-test/r/ps_4heap.result11
-rw-r--r--mysql-test/r/ps_5merge.result22
-rw-r--r--mysql-test/r/ps_6bdb.result11
-rw-r--r--mysql-test/r/ps_7ndb.result11
-rw-r--r--mysql-test/r/query_cache.result106
-rw-r--r--mysql-test/r/repair.result4
-rw-r--r--mysql-test/r/row.result97
-rw-r--r--mysql-test/r/rpl_ssl.result5
-rw-r--r--mysql-test/r/sp-code.result113
-rw-r--r--mysql-test/r/sp-vars.result45
-rw-r--r--mysql-test/r/sp.result57
-rw-r--r--mysql-test/r/sp_trans.result3
-rw-r--r--mysql-test/r/strict.result10
-rw-r--r--mysql-test/r/subselect.result64
-rw-r--r--mysql-test/r/subselect3.result50
-rw-r--r--mysql-test/r/trigger.result35
-rw-r--r--mysql-test/r/truncate.result26
-rw-r--r--mysql-test/r/type_date.result26
-rw-r--r--mysql-test/r/type_datetime.result219
-rw-r--r--mysql-test/r/type_newdecimal.result37
-rw-r--r--mysql-test/r/update.result35
-rw-r--r--mysql-test/r/variables-big.result20
-rw-r--r--mysql-test/r/view.result50
-rw-r--r--mysql-test/r/windows.result7
-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.test26
-rw-r--r--mysql-test/t/bigint.test6
-rw-r--r--mysql-test/t/blackhole.test13
-rw-r--r--mysql-test/t/cast.test6
-rw-r--r--mysql-test/t/create.test111
-rw-r--r--mysql-test/t/date_formats.test2
-rw-r--r--mysql-test/t/disabled.def2
-rw-r--r--mysql-test/t/fix_priv_tables.test7
-rw-r--r--mysql-test/t/fulltext.test10
-rw-r--r--mysql-test/t/func_gconcat.test14
-rw-r--r--mysql-test/t/func_group.test34
-rw-r--r--mysql-test/t/func_math.test39
-rw-r--r--mysql-test/t/func_sapdb.test2
-rw-r--r--mysql-test/t/func_str.test18
-rw-r--r--mysql-test/t/grant.test48
-rw-r--r--mysql-test/t/group_by.test14
-rw-r--r--mysql-test/t/innodb.test20
-rw-r--r--mysql-test/t/innodb_mysql.test185
-rw-r--r--mysql-test/t/insert.test139
-rw-r--r--mysql-test/t/insert_update.test43
-rw-r--r--mysql-test/t/join.test47
-rw-r--r--mysql-test/t/join_outer.test20
-rw-r--r--mysql-test/t/key.test48
-rw-r--r--mysql-test/t/loaddata.test26
-rw-r--r--mysql-test/t/lowercase_mixed_tmpdir-master.opt2
-rw-r--r--mysql-test/t/lowercase_mixed_tmpdir-master.sh6
-rw-r--r--mysql-test/t/lowercase_mixed_tmpdir.test12
-rw-r--r--mysql-test/t/merge.test13
-rw-r--r--mysql-test/t/mysql.test9
-rw-r--r--mysql-test/t/mysql_upgrade.test57
-rw-r--r--mysql-test/t/mysqldump.test35
-rw-r--r--mysql-test/t/mysqltest.test140
-rw-r--r--mysql-test/t/ndb_basic.test15
-rw-r--r--mysql-test/t/ndb_insert.test9
-rw-r--r--mysql-test/t/ndb_single_user.test7
-rw-r--r--mysql-test/t/olap.test22
-rw-r--r--mysql-test/t/openssl_1.test48
-rw-r--r--mysql-test/t/outfile.test47
-rw-r--r--mysql-test/t/ps.test24
-rw-r--r--mysql-test/t/ps_1general.test6
-rw-r--r--mysql-test/t/query_cache.test72
-rw-r--r--mysql-test/t/row.test45
-rw-r--r--mysql-test/t/rpl_ssl.test3
-rw-r--r--mysql-test/t/sp-code.test75
-rw-r--r--mysql-test/t/sp-vars.test44
-rw-r--r--mysql-test/t/sp.test52
-rw-r--r--mysql-test/t/sp_trans.test9
-rw-r--r--mysql-test/t/strict.test10
-rw-r--r--mysql-test/t/subselect.test62
-rw-r--r--mysql-test/t/subselect3.test43
-rw-r--r--mysql-test/t/system_mysql_db_fix30020.test8
-rw-r--r--mysql-test/t/system_mysql_db_fix40123.test7
-rw-r--r--mysql-test/t/trigger.test26
-rw-r--r--mysql-test/t/truncate.test31
-rw-r--r--mysql-test/t/type_date.test13
-rw-r--r--mysql-test/t/type_datetime.test130
-rw-r--r--mysql-test/t/type_newdecimal.test19
-rw-r--r--mysql-test/t/update.test55
-rw-r--r--mysql-test/t/variables-big.test20
-rw-r--r--mysql-test/t/view.test28
-rw-r--r--mysql-test/t/windows.test8
-rw-r--r--mysys/charset.c8
-rw-r--r--mysys/default.c2
-rw-r--r--mysys/my_alloc.c4
-rw-r--r--mysys/my_copy.c7
-rw-r--r--mysys/my_seek.c17
-rw-r--r--mysys/my_thr_init.c5
-rw-r--r--ndb/include/kernel/signaldata/ScanTab.hpp44
-rw-r--r--ndb/include/mgmapi/ndbd_exit_codes.h2
-rw-r--r--ndb/include/ndbapi/Ndb.hpp13
-rw-r--r--ndb/include/ndbapi/NdbOperation.hpp2
-rw-r--r--ndb/include/ndbapi/NdbRecAttr.hpp28
-rw-r--r--ndb/include/ndbapi/NdbScanOperation.hpp1
-rw-r--r--ndb/include/ndbapi/NdbTransaction.hpp8
-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.cpp43
-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/NdbBlob.cpp4
-rw-r--r--ndb/src/ndbapi/NdbImpl.hpp15
-rw-r--r--ndb/src/ndbapi/NdbOperationDefine.cpp30
-rw-r--r--ndb/src/ndbapi/NdbRecAttr.cpp6
-rw-r--r--ndb/src/ndbapi/NdbScanOperation.cpp66
-rw-r--r--ndb/src/ndbapi/NdbTransaction.cpp11
-rw-r--r--ndb/test/ndbapi/testBlobs.cpp201
-rw-r--r--ndb/test/ndbapi/testNdbApi.cpp108
-rw-r--r--ndb/test/ndbapi/testScanFilter.cpp5
-rw-r--r--ndb/test/run-test/daily-basic-tests.txt16
-rw-r--r--netware/Makefile.am6
-rwxr-xr-xscripts/CMakeLists.txt42
-rw-r--r--scripts/Makefile.am29
-rw-r--r--scripts/comp_sql.c125
-rw-r--r--scripts/make_binary_distribution.sh72
-rwxr-xr-xscripts/make_win_bin_dist36
-rw-r--r--scripts/mysql_install_db.sh17
-rw-r--r--scripts/mysql_system_tables.sql5
-rw-r--r--scripts/mysql_system_tables_data.sql22
-rw-r--r--scripts/mysql_system_tables_fix.sql1
-rw-r--r--scripts/mysqld_multi.sh312
-rwxr-xr-xserver-tools/instance-manager/CMakeLists.txt5
-rw-r--r--sql-common/my_time.c35
-rwxr-xr-xsql/CMakeLists.txt5
-rw-r--r--sql/Makefile.am5
-rw-r--r--sql/field.cc169
-rw-r--r--sql/field.h74
-rw-r--r--sql/filesort.cc21
-rw-r--r--sql/ha_blackhole.h3
-rw-r--r--sql/ha_innodb.cc16
-rw-r--r--sql/ha_innodb.h1
-rw-r--r--sql/ha_myisam.cc8
-rw-r--r--sql/ha_ndbcluster.cc1626
-rw-r--r--sql/ha_ndbcluster.h448
-rw-r--r--sql/ha_ndbcluster_cond.cc1426
-rw-r--r--sql/ha_ndbcluster_cond.h470
-rw-r--r--sql/handler.cc7
-rw-r--r--sql/item.cc130
-rw-r--r--sql/item.h32
-rw-r--r--sql/item_cmpfunc.cc687
-rw-r--r--sql/item_cmpfunc.h138
-rw-r--r--sql/item_create.cc16
-rw-r--r--sql/item_create.h3
-rw-r--r--sql/item_func.cc260
-rw-r--r--sql/item_func.h54
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/item_strfunc.h2
-rw-r--r--sql/item_subselect.cc21
-rw-r--r--sql/item_subselect.h6
-rw-r--r--sql/item_sum.cc25
-rw-r--r--sql/item_timefunc.cc240
-rw-r--r--sql/item_timefunc.h48
-rw-r--r--sql/key.cc23
-rw-r--r--sql/lock.cc33
-rw-r--r--sql/log.cc2
-rw-r--r--sql/log_event.cc9
-rw-r--r--sql/my_decimal.cc2
-rw-r--r--sql/my_decimal.h22
-rw-r--r--sql/mysql_priv.h63
-rw-r--r--sql/mysqld.cc7
-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.cc9
-rw-r--r--sql/slave.cc3
-rw-r--r--sql/sp.cc11
-rw-r--r--sql/sp_head.cc57
-rw-r--r--sql/sp_head.h12
-rw-r--r--sql/sql_base.cc431
-rw-r--r--sql/sql_cache.cc18
-rw-r--r--sql/sql_class.cc2
-rw-r--r--sql/sql_class.h20
-rw-r--r--sql/sql_delete.cc9
-rw-r--r--sql/sql_handler.cc25
-rw-r--r--sql/sql_insert.cc615
-rw-r--r--sql/sql_lex.cc330
-rw-r--r--sql/sql_lex.h99
-rw-r--r--sql/sql_load.cc4
-rw-r--r--sql/sql_parse.cc121
-rw-r--r--sql/sql_prepare.cc33
-rw-r--r--sql/sql_select.cc114
-rw-r--r--sql/sql_select.h8
-rw-r--r--sql/sql_show.cc40
-rw-r--r--sql/sql_table.cc120
-rw-r--r--sql/sql_trigger.cc10
-rw-r--r--sql/sql_union.cc10
-rw-r--r--sql/sql_update.cc24
-rw-r--r--sql/sql_view.cc23
-rw-r--r--sql/sql_yacc.yy216
-rw-r--r--sql/structs.h3
-rw-r--r--sql/table.cc11
-rw-r--r--sql/table.h40
-rw-r--r--sql/time.cc38
-rw-r--r--sql/tztime.cc88
-rw-r--r--sql/tztime.h10
-rw-r--r--sql/unireg.cc4
-rw-r--r--strings/decimal.c14
-rw-r--r--strings/strtod.c2
-rw-r--r--support-files/mysql.server.sh52
-rw-r--r--support-files/mysql.spec.sh2
-rw-r--r--tests/mysql_client_test.c20
-rw-r--r--vio/viosslfactories.c9
-rwxr-xr-xwin/Makefile.am3
-rw-r--r--win/README2
-rwxr-xr-xwin/configure.js1
-rwxr-xr-xwin/create_manifest.js86
-rwxr-xr-xwin/mysql_manifest.cmake20
437 files changed, 26420 insertions, 7499 deletions
diff --git a/.bzrignore b/.bzrignore
index c75109c401c..d1de21857db 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -4,7 +4,8 @@
*.bb
*.bbg
*.bin
-*.cmake
+*.vcproj.cmake
+cmake_install.cmake
*.core
*.d
*.da
@@ -1085,6 +1086,7 @@ repl-tests/test-repl/sum-wlen-slave.master.re
repl-tests/test-repl/sum-wlen-slave.master.reje
replace/*.ds?
replace/*.vcproj
+scripts/comp_sql
scripts/fill_func_tables
scripts/fill_func_tables.sql
scripts/fill_help_tables
@@ -1102,6 +1104,7 @@ scripts/mysql_find_rows
scripts/mysql_fix_extensions
scripts/mysql_fix_privilege_tables
scripts/mysql_fix_privilege_tables.sql
+scripts/mysql_fix_privilege_tables_sql.c
scripts/mysql_install_db
scripts/mysql_secure_installation
scripts/mysql_setpermission
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-pentium-debug b/BUILD/compile-pentium-debug
index 7957caead29..e31cb59a8a4 100755
--- a/BUILD/compile-pentium-debug
+++ b/BUILD/compile-pentium-debug
@@ -1,7 +1,8 @@
#! /bin/sh
path=`dirname $0`
-. "$path/SETUP.sh" $@ --with-debug=full
+set -- "$@" --with-debug=full
+. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
diff --git a/BUILD/compile-pentium-debug-max b/BUILD/compile-pentium-debug-max
index a69513ac6bb..56e24617abb 100755
--- a/BUILD/compile-pentium-debug-max
+++ b/BUILD/compile-pentium-debug-max
@@ -1,7 +1,8 @@
#! /bin/sh
path=`dirname $0`
-. "$path/SETUP.sh" $@ --with-debug=full
+set -- "$@" --with-debug=full
+. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags $max_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
diff --git a/BUILD/compile-pentium-debug-max-no-ndb b/BUILD/compile-pentium-debug-max-no-ndb
index 26ec7eacc9d..92a388f9cb9 100755
--- a/BUILD/compile-pentium-debug-max-no-ndb
+++ b/BUILD/compile-pentium-debug-max-no-ndb
@@ -1,7 +1,8 @@
#! /bin/sh
path=`dirname $0`
-. "$path/SETUP.sh" $@ --with-debug=full
+set -- "$@" --with-debug=full
+. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags $max_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
diff --git a/BUILD/compile-pentium64-debug b/BUILD/compile-pentium64-debug
index 0299669f79a..1edc9827366 100755
--- a/BUILD/compile-pentium64-debug
+++ b/BUILD/compile-pentium64-debug
@@ -1,7 +1,8 @@
#! /bin/sh
path=`dirname $0`
-. "$path/SETUP.sh" $@ --with-debug=full
+set -- "$@" --with-debug=full
+. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $debug_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
diff --git a/BUILD/compile-pentium64-debug-max b/BUILD/compile-pentium64-debug-max
index f0745c88c90..656825d8494 100755
--- a/BUILD/compile-pentium64-debug-max
+++ b/BUILD/compile-pentium64-debug-max
@@ -1,7 +1,8 @@
#! /bin/sh
path=`dirname $0`
-. "$path/SETUP.sh" $@ --with-debug=full
+set -- "$@" --with-debug=full
+. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $debug_cflags $max_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
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 3a286071bb0..890ee2676e8 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,10 @@ ADD_DEFINITIONS(-D WITH_MYISAM_STORAGE_ENGINE)
ADD_DEFINITIONS(-D CMAKE_BUILD)
ADD_DEFINITIONS(-D HAVE_YASSL)
+# Set debug options
+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFORCE_INIT_OF_VARS")
+SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DFORCE_INIT_OF_VARS")
+
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisam_plugin")
@@ -116,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})
@@ -128,15 +135,48 @@ ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D _CRT_SECURE_NO_DEPRECATE")
+IF(EMBED_MANIFESTS)
+ # Search for the Manifest tool. CMake will first search it's defaults
+ # (CMAKE_FRAMEWORK_PATH, CMAKE_APPBUNDLE_PATH, CMAKE_PROGRAM_PATH and
+ # the system PATH) followed by the listed paths which are the current
+ # possible defaults and should be updated when necessary. The custom
+ # manifests are designed to be compatible with all mt versions.
+ FIND_PROGRAM(HAVE_MANIFEST_TOOL NAMES mt
+ PATHS
+ "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/VC/bin"
+ "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin"
+ "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin")
+ IF(HAVE_MANIFEST_TOOL)
+ MESSAGE(STATUS "Found Mainfest Tool. Embedding custom manifests.")
+ ELSE(HAVE_MANIFEST_TOOL)
+ MESSAGE(FATAL_ERROR "Manifest tool, mt.exe, can't be found.")
+ ENDIF(HAVE_MANIFEST_TOOL)
+ # 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(tmp_manifest)
+ # Set the processor architecture.
+ IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
+ SET(PROCESSOR_ARCH "X64")
+ ELSE(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
+ SET(PROCESSOR_ARCH "X86")
+ ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
+ENDIF(EMBED_MANIFESTS)
+
ADD_SUBDIRECTORY(vio)
ADD_SUBDIRECTORY(dbug)
ADD_SUBDIRECTORY(strings)
ADD_SUBDIRECTORY(regex)
ADD_SUBDIRECTORY(mysys)
+ADD_SUBDIRECTORY(scripts)
+ADD_SUBDIRECTORY(zlib)
ADD_SUBDIRECTORY(extra/yassl)
ADD_SUBDIRECTORY(extra/yassl/taocrypt)
ADD_SUBDIRECTORY(extra)
-ADD_SUBDIRECTORY(zlib)
ADD_SUBDIRECTORY(heap)
ADD_SUBDIRECTORY(myisam)
ADD_SUBDIRECTORY(myisammrg)
diff --git a/Makefile.am b/Makefile.am
index ed54b630aea..6cb080aed5a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,9 +21,9 @@ AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \
README COPYING EXCEPTIONS-CLIENT CMakeLists.txt
SUBDIRS = . include @docs_dirs@ @zlib_dir@ @yassl_dir@ \
- @readline_topdir@ sql-common \
+ @readline_topdir@ sql-common scripts \
@thread_dirs@ pstack \
- @sql_union_dirs@ scripts @man_dirs@ tests \
+ @sql_union_dirs@ @man_dirs@ tests \
netware @libmysqld_dirs@ \
@bench_dirs@ support-files @tools_dirs@
@@ -32,7 +32,8 @@ DIST_SUBDIRS = . include @docs_dirs@ zlib \
@thread_dirs@ pstack \
@sql_union_dirs@ scripts @man_dirs@ tests SSL\
BUILD netware os2 @libmysqld_dirs@ \
- @bench_dirs@ support-files @tools_dirs@ win
+ @bench_dirs@ support-files @tools_dirs@ win \
+ debian
# Run these targets before any others, also make part of clean target,
# to make sure we create new links after a clean.
@@ -152,6 +153,12 @@ test-bt:
@PERL@ ./mysql-test-run.pl --force --comment=normal --report-features
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=ps --ps-protocol
+ -cd mysql-test ; MTR_BUILD_THREAD=auto \
+ @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/VC++Files/mysql.sln b/VC++Files/mysql.sln
index 31b9232e2ec..f9b22b6dcc9 100644
--- a/VC++Files/mysql.sln
+++ b/VC++Files/mysql.sln
@@ -733,6 +733,7 @@ Global
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Debug 98.ActiveCfg = Debug 98|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Debug 98.Build.0 = Debug 98|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Enterprise.ActiveCfg = Release|Win32
+ {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Enterprise.Build.0 = Release|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Enterprise Debug.ActiveCfg = Debug|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Enterprise Debug.Build.0 = Debug|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Enterprise GPL.ActiveCfg = Release|Win32
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index 785bba738bf..6e37d02ecd8 100755
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -12,6 +12,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
@@ -83,6 +84,7 @@ TARGET_LINK_LIBRARIES(mysqlimport mysqlclient mysys dbug yassl taocrypt zlib wso
ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c ../mysys/my_getpagesize.c)
TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient mysys dbug yassl taocrypt zlib wsock32)
+ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs)
ADD_EXECUTABLE(mysqlshow mysqlshow.c)
TARGET_LINK_LIBRARIES(mysqlshow mysqlclient mysys dbug yassl taocrypt zlib wsock32)
@@ -97,3 +99,16 @@ TARGET_LINK_LIBRARIES(mysqladmin mysqlclient mysys dbug yassl taocrypt zlib wsoc
ADD_EXECUTABLE(echo echo.c)
+IF(EMBED_MANIFESTS)
+ MYSQL_EMBED_MANIFEST("mysql" "asInvoker")
+ MYSQL_EMBED_MANIFEST("mysqltest" "asInvoker")
+ MYSQL_EMBED_MANIFEST("mysqlcheck" "asInvoker")
+ MYSQL_EMBED_MANIFEST("mysqldump" "asInvoker")
+ MYSQL_EMBED_MANIFEST("mysqlimport" "asInvoker")
+ MYSQL_EMBED_MANIFEST("mysql_upgrade" "asInvoker")
+ MYSQL_EMBED_MANIFEST("mysqlshow" "asInvoker")
+ MYSQL_EMBED_MANIFEST("mysqlbinlog" "asInvoker")
+ MYSQL_EMBED_MANIFEST("mysqladmin" "asInvoker")
+ MYSQL_EMBED_MANIFEST("echo" "asInvoker")
+ENDIF(EMBED_MANIFESTS)
+
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/mysql.cc b/client/mysql.cc
index 6b37bb7b6f5..368fce30d67 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -808,7 +808,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
#endif
case OPT_CHARSETS_DIR:
- strmov(mysql_charsets_dir, argument);
+ strmake(mysql_charsets_dir, argument, sizeof(mysql_charsets_dir) - 1);
charsets_dir = mysql_charsets_dir;
break;
case OPT_DEFAULT_CHARSET:
@@ -861,7 +861,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
if (argument && strlen(argument))
{
default_pager_set= 1;
- strmov(pager, argument);
+ strmake(pager, argument, sizeof(pager) - 1);
strmov(default_pager, pager);
}
else if (default_pager_set)
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 0c921c8e0d8..64de3d19882 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -14,57 +14,51 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "client_priv.h"
-#include <my_dir.h>
-#include <my_list.h>
#include <sslopt-vars.h>
+#include "../scripts/mysql_fix_privilege_tables_sql.c"
-#define UPGRADE_DEFAULTS_NAME "mysql_upgrade_defaults"
-#define MYSQL_UPGRADE_INFO_NAME "mysql_upgrade_info"
-#define MYSQL_FIX_PRIV_TABLES_NAME "mysql_fix_privilege_tables.sql"
-
-#define MY_PARENT (1 << 0)
-#define MY_ISDIR (1 << 1)
-#define MY_SEARCH_SELF (1 << 2)
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
-#ifdef __WIN__
-const char *mysqlcheck_name= "mysqlcheck.exe";
-const char *mysql_name= "mysql.exe";
-const char *mysqld_name= "mysqld.exe";
-#define EXTRA_CLIENT_PATHS "client/release", "client/debug"
-#else
-const char *mysqlcheck_name= "mysqlcheck";
-const char *mysql_name= "mysql";
-const char *mysqld_name= "mysqld";
-#define EXTRA_CLIENT_PATHS "client"
-#endif /*__WIN__*/
-
-extern TYPELIB sql_protocol_typelib;
-
-static my_bool opt_force= 0, opt_verbose= 0, opt_compress= 0;
-static char *user= (char*) "root", *basedir= 0, *datadir= 0, *opt_password= 0;
-static char *current_host= 0;
-static char *opt_default_charset= 0, *opt_charsets_dir= 0;
-#ifdef HAVE_SMEM
-static char *shared_memory_base_name= 0;
+#ifndef WEXITSTATUS
+# ifdef __WIN__
+# define WEXITSTATUS(stat_val) (stat_val)
+# else
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+# endif
#endif
-static char *opt_protocol= 0;
-static my_string opt_mysql_port= 0, opt_mysql_unix_port= 0;
+
+static char mysql_path[FN_REFLEN];
+static char mysqlcheck_path[FN_REFLEN];
+
+static my_bool opt_force, opt_verbose;
+static char *opt_user= (char*)"root";
+
+static DYNAMIC_STRING ds_args;
+
+static char *opt_password= 0;
+static my_bool tty_password= 0;
+
#ifndef DBUG_OFF
static char *default_dbug_option= (char*) "d:t:O,/tmp/mysql_upgrade.trace";
#endif
-static my_bool info_flag= 0, tty_password= 0;
static char **defaults_argv;
+static my_bool not_used; /* Can't use GET_BOOL without a value pointer */
+
+#include <help_start.h>
+
static struct my_option my_long_options[]=
{
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"basedir", 'b', "Specifies the directory where MySQL is installed",
- (gptr*) &basedir,
- (gptr*) &basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"datadir", 'd', "Specifies the data directory", (gptr*) &datadir,
- (gptr*) &datadir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"basedir", 'b', "Not used by mysql_upgrade. Only for backward compatibilty",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"datadir", 'd',
+ "Not used by mysql_upgrade. Only for backward compatibilty",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit",
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -72,638 +66,720 @@ static struct my_option my_long_options[]=
{"debug", '#', "Output debug log", (gptr *) & default_dbug_option,
(gptr *) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"debug-info", 'T', "Print some debug info at exit.", (gptr *) & info_flag,
- (gptr *) & info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
- "Set the default character set.", (gptr*) &opt_default_charset,
- (gptr*) &opt_default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"force", 'f', "Force execution of mysqlcheck even if mysql_upgrade "
- "has already been executed for the current version of MySQL.",
- (gptr*) &opt_force, (gptr*) &opt_force, 0, GET_BOOL, NO_ARG, 0, 0,
- 0, 0, 0, 0},
+ "Set the default character set.", 0,
+ 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (gptr*) &opt_charsets_dir,
- (gptr*) &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Directory where character sets are.", 0,
+ 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
- (gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
- 0, 0, 0},
- {"host",'h', "Connect to host.", (gptr*) &current_host,
- (gptr*) &current_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (gptr*)&not_used, (gptr*)&not_used, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"force", 'f', "Force execution of mysqlcheck even if mysql_upgrade "
+ "has already been executed for the current version of MySQL.",
+ (gptr*)&opt_force, (gptr*)&opt_force, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"host",'h', "Connect to host.", 0,
+ 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given"
- " it's solicited on the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ " it's solicited on the tty.", (gptr*) &opt_password,(gptr*) &opt_password,
+ 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __WIN__
- {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0,
+ {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
- (gptr*) &opt_mysql_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"port", 'P', "Port number to use for connection.", 0,
+ 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL,
"The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
- "Base name of shared memory.", (gptr*) &shared_memory_base_name,
- (gptr*) &shared_memory_base_name, 0,
- GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Base name of shared memory.", 0,
+ 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"socket", 'S', "Socket file to use for connection.",
- (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0,
- GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"user", 'u', "User for login if not current user.", (gptr*) &user,
- (gptr*) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"user", 'u', "User for login if not current user.", (gptr*) &opt_user,
+ (gptr*) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h>
- {"verbose", 'v', "Display more output about the process",
- (gptr*) &opt_verbose, (gptr*) &opt_verbose, 0,
- GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"verbose", 'v', "Display more output about the process",
+ (gptr*) &opt_verbose, (gptr*) &opt_verbose, 0,
+ GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
-static const char *load_default_groups[]=
+#include <help_end.h>
+
+
+static void free_used_memory(void)
{
- "mysql_upgrade", 0
-};
+ /* Free memory allocated by 'load_defaults' */
+ free_defaults(defaults_argv);
-#include <help_end.h>
+ dynstr_free(&ds_args);
+}
-static LIST *extra_defaults= NULL;
-typedef struct _extra_default
+static void die(const char *fmt, ...)
{
- int id;
- const char *name;
- int n_len;
- const char *value;
- int v_len;
-} extra_default_t;
-
-static inline
-void set_extra_default(int id, const struct my_option *opt)
+ va_list args;
+ DBUG_ENTER("die");
+
+ /* Print the error message */
+ va_start(args, fmt);
+ if (fmt)
+ {
+ fprintf(stderr, "FATAL ERROR: ");
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
+ fflush(stderr);
+ }
+ va_end(args);
+
+ free_used_memory();
+ my_end(MY_CHECK_ERROR);
+ exit(1);
+}
+
+
+static void verbose(const char *fmt, ...)
{
- switch (id) {
- case 'b': case 'd': /* these are ours */
- case 'f': /* --force is ours */
- case 'u': /* --user passed on cmdline */
- case 'T': /* --debug-info is not accepted by mysqlcheck */
- case 'p': /* --password may change yet */
- /* so, do nothing */
- break;
- default:
- {
- LIST *l;
- extra_default_t *d;
-
- /*
- Remove any earlier duplicates: they can
- refer to invalid memory addresses (stale pointers)
- */
- l= extra_defaults;
- while (l)
- {
- LIST *n= l->next;
-
- d= l->data;
- if (d->id == id)
- {
- extra_defaults= list_delete(extra_defaults, l);
- my_free((gptr)l, MYF(0));
- my_free((gptr)d, MYF(0));
- }
- l= n;
- }
+ va_list args;
- d= (extra_default_t *)my_malloc(sizeof(extra_default_t),
- MYF(MY_FAE | MY_ZEROFILL));
- d->id= id;
- d->name= opt->name;
- d->n_len= strlen(opt->name);
- if (opt->arg_type != NO_ARG && opt->value)
- switch (opt->var_type & GET_TYPE_MASK) {
- case GET_BOOL:
- if (*((int *)opt->value))
- {
- d->value= "true";
- d->v_len= 4;
- }
- break;
- case GET_STR:
- case GET_STR_ALLOC:
- d->value= *opt->value;
- d->v_len= strlen(d->value);
- break;
- default:
- my_printf_error(0, "Error: internal error at %s:%d", MYF(0),
- __FILE__, __LINE__);
- exit(1);
- }
- list_push(extra_defaults, d);
+ if (!opt_verbose)
+ return;
+
+ /* Print the verbose message */
+ va_start(args, fmt);
+ if (fmt)
+ {
+ vfprintf(stdout, fmt, args);
+ fprintf(stdout, "\n");
+ fflush(stdout);
+ }
+ va_end(args);
+}
+
+
+/*
+ Add one option - passed to mysql_upgrade on command line
+ or by defaults file(my.cnf) - to a dynamic string, in
+ this way we pass the same arguments on to mysql and mysql_check
+*/
+
+static void add_one_option(DYNAMIC_STRING* ds,
+ const struct my_option *opt,
+ const char* argument)
+
+{
+ const char* eq= NullS;
+ const char* arg= NullS;
+ if (opt->arg_type != NO_ARG)
+ {
+ eq= "=";
+ switch (opt->var_type & GET_TYPE_MASK) {
+ case GET_STR:
+ arg= argument;
+ break;
+ default:
+ die("internal error at %s: %d",__FILE__, __LINE__);
}
}
+ dynstr_append_os_quoted(ds, "--", opt->name, eq, arg, NullS);
+ dynstr_append(&ds_args, " ");
}
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__ ((unused)),
+get_one_option(int optid, const struct my_option *opt,
char *argument)
{
+ my_bool add_option= TRUE;
+
switch (optid) {
+
case '?':
- puts
- ("MySQL utility to upgrade database to the current server version");
- puts("");
+ printf("MySQL utility for upgrading database to MySQL version %s\n",
+ MYSQL_SERVER_VERSION);
my_print_help(my_long_options);
exit(0);
+ break;
+
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
+ add_option= FALSE;
break;
+
case 'p':
tty_password= 1;
+ add_option= FALSE;
if (argument)
{
- char *start= argument;
- my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
- opt_password= my_strdup(argument, MYF(MY_FAE));
+ /* Add password to ds_args before overwriting the arg with x's */
+ add_one_option(&ds_args, opt, argument);
while (*argument)
*argument++= 'x'; /* Destroy argument */
- if (*start)
- start[1]= 0; /* Cut length of argument */
tty_password= 0;
}
break;
-#ifdef __WIN__
- case 'W':
- my_free(opt_protocol, MYF(MY_ALLOW_ZERO_PTR));
- opt_protocol= my_strdup("pipe", MYF(MY_FAE));
+
+ case 'b': /* --basedir */
+ case 'v': /* --verbose */
+ case 'd': /* --datadir */
+ case 'f': /* --force */
+ add_option= FALSE;
break;
-#endif
- case OPT_MYSQL_PROTOCOL:
- if (find_type(argument, &sql_protocol_typelib, 0) > 0)
+ }
+
+ if (add_option)
+ {
+ /*
+ This is an option that is accpted by mysql_upgrade just so
+ it can be passed on to "mysql" and "mysqlcheck"
+ Save it in the ds_args string
+ */
+ add_one_option(&ds_args, opt, argument);
+ }
+ return 0;
+}
+
+
+static int run_command(char* cmd,
+ DYNAMIC_STRING *ds_res)
+{
+ char buf[512]= {0};
+ FILE *res_file;
+ int error;
+
+ if (!(res_file= popen(cmd, "r")))
+ die("popen(\"%s\", \"r\") failed", cmd);
+
+ while (fgets(buf, sizeof(buf), res_file))
+ {
+ DBUG_PRINT("info", ("buf: %s", buf));
+ if(ds_res)
{
- my_free(opt_protocol, MYF(MY_ALLOW_ZERO_PTR));
- opt_protocol= my_strdup(argument, MYF(MY_FAE));
+ /* Save the output of this command in the supplied string */
+ dynstr_append(ds_res, buf);
}
- else
+ else
{
- fprintf(stderr, "Unknown option to protocol: %s\n", argument);
- exit(1);
+ /* Print it directly on screen */
+ fprintf(stdout, "%s", buf);
}
- break;
-#include <sslopt-case.h>
- default:;
}
- set_extra_default(opt->id, opt);
- return 0;
+
+ error= pclose(res_file);
+ return WEXITSTATUS(error);
}
-static int create_check_file(const char *path)
+static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...)
{
int ret;
- File fd;
-
- fd= my_open(path, O_CREAT | O_WRONLY, MYF(MY_FAE | MY_WME));
- if (fd < 0) {
- ret= 1;
- goto error;
+ const char* arg;
+ va_list args;
+ DYNAMIC_STRING ds_cmdline;
+
+ DBUG_ENTER("run_tool");
+ DBUG_PRINT("enter", ("tool_path: %s", tool_path));
+
+ if (init_dynamic_string(&ds_cmdline, IF_WIN("\"", ""), FN_REFLEN, FN_REFLEN))
+ die("Out of memory");
+
+ dynstr_append_os_quoted(&ds_cmdline, tool_path, NullS);
+ dynstr_append(&ds_cmdline, " ");
+
+ va_start(args, ds_res);
+
+ while ((arg= va_arg(args, char *)))
+ {
+ /* Options should be os quoted */
+ if (strncmp(arg, "--", 2) == 0)
+ dynstr_append_os_quoted(&ds_cmdline, arg, NullS);
+ else
+ dynstr_append(&ds_cmdline, arg);
+ dynstr_append(&ds_cmdline, " ");
}
- ret= my_write(fd, MYSQL_SERVER_VERSION,
- sizeof(MYSQL_SERVER_VERSION) - 1,
- MYF(MY_WME | MY_FNABP));
- ret|= my_close(fd, MYF(MY_FAE | MY_WME));
-error:
- return ret;
+
+ va_end(args);
+
+#ifdef __WIN__
+ dynstr_append(&ds_cmdline, "\"");
+#endif
+
+ DBUG_PRINT("info", ("Running: %s", ds_cmdline.str));
+ ret= run_command(ds_cmdline.str, ds_res);
+ DBUG_PRINT("exit", ("ret: %d", ret));
+ dynstr_free(&ds_cmdline);
+ DBUG_RETURN(ret);
}
-static int create_defaults_file(const char *path, const char *forced_path)
+/*
+ Try to get the full path to this exceutable
+
+ Return 0 if path found
+
+*/
+
+static my_bool get_full_path_to_executable(char* path)
{
- int ret;
- uint cnt;
- File forced_file, defaults_file;
-
- DYNAMIC_STRING buf;
- extra_default_t *d;
-
- DBUG_ENTER("create_defaults_file");
- DBUG_PRINT("enter", ("path: %s, forced_path: %s", path, forced_path));
-
- /* Delete any previous defaults file generated by mysql_upgrade */
- my_delete(path, MYF(0));
-
- defaults_file= my_open(path, O_BINARY | O_CREAT | O_WRONLY | O_EXCL,
- MYF(MY_FAE | MY_WME));
- if (defaults_file < 0)
- {
- ret= 1;
- goto out;
- }
+ my_bool ret;
+ DBUG_ENTER("get_full_path_to_executable");
+#ifdef __WIN__
+ ret= (GetModuleFileName(NULL, path, FN_REFLEN) == 0);
+#else
+ /* my_readlink returns 0 if a symlink was read */
+ ret= (my_readlink(path, "/proc/self/exe", MYF(0)) != 0);
+ /* Might also want to try with /proc/$$/exe if the above fails */
+#endif
+ DBUG_PRINT("exit", ("path: %s", path));
+ DBUG_RETURN(ret);
+}
- if (init_dynamic_string(&buf, NULL, my_getpagesize(), FN_REFLEN))
- {
- ret= 1;
- goto error;
- }
- /* Copy forced_path file into the defaults_file being generated */
- if (forced_path)
- {
- forced_file= my_open(forced_path, O_RDONLY, MYF(MY_FAE | MY_WME));
- if (forced_file < 0)
- {
- ret= 1;
- goto error;
- }
- DBUG_PRINT("info", ("Copying from %s to %s", forced_path, path));
- do
- {
- cnt= my_read(forced_file, buf.str, buf.max_length, MYF(MY_WME));
- if ((cnt == MY_FILE_ERROR)
- || my_write(defaults_file, buf.str, cnt, MYF(MY_FNABP | MY_WME)))
- {
- ret= 1;
- my_close(forced_file, MYF(0));
- goto error;
- }
- DBUG_PRINT("info", ("%s", buf.str));
- } while (cnt == buf.max_length);
- my_close(forced_file, MYF(0));
- }
+/*
+ Look for the tool in the same directory as mysql_upgrade.
- /* Write all extra_default options into the [client] section */
- dynstr_set(&buf, "\n[client]");
- if (opt_password)
+ When running in a not yet installed build the the program
+ will exist but it need to be invoked via it's libtool wrapper.
+ Check if the found tool can executed and if not look in the
+ directory one step higher up where the libtool wrapper normally
+ is found
+*/
+
+static void find_tool(char *tool_path, const char *tool_name)
+{
+ char path[FN_REFLEN];
+ DYNAMIC_STRING ds_tmp;
+ DBUG_ENTER("find_tool");
+ DBUG_PRINT("enter", ("progname: %s", my_progname));
+
+ if (init_dynamic_string(&ds_tmp, "", 32, 32))
+ die("Out of memory");
+
+ /* Initialize path with the full path to this program */
+ if (get_full_path_to_executable(path))
{
- if (dynstr_append(&buf, "\npassword=")
- || dynstr_append(&buf, opt_password))
+ /*
+ Easy way to get full executable path failed, try
+ other methods
+ */
+ if (my_progname[0] == FN_LIBCHAR)
{
- ret = 1;
- goto error;
+ /* 1. my_progname contains full path */
+ strmake(path, my_progname, FN_REFLEN);
}
- }
- DBUG_PRINT("info", ("Writing extra_defaults to file"));
- while (extra_defaults)
- {
- int len;
-
- d= extra_defaults->data;
- len= d->n_len + d->v_len + 1;
- if (buf.length + len >= buf.max_length) /* to avoid realloc() */
+ else if (my_progname[0] == '.')
{
-
- if (my_write(defaults_file, buf.str, buf.length, MYF(MY_FNABP | MY_WME)))
- {
- ret= 1;
- goto error;
- }
- dynstr_set(&buf, NULL);
+ /* 2. my_progname contains relative path, prepend wd */
+ char buf[FN_REFLEN];
+ my_getwd(buf, FN_REFLEN, MYF(0));
+ my_snprintf(path, FN_REFLEN, "%s%s", buf, my_progname);
}
- if (dynstr_append_mem(&buf, "\n", 1) ||
- dynstr_append_mem(&buf, d->name, d->n_len) ||
- (d->v_len && (dynstr_append_mem(&buf, "=", 1) ||
- dynstr_append_mem(&buf, d->value, d->v_len))))
+ else
{
- ret= 1;
- goto error;
+ /* 3. Just go for it and hope tool is in path */
+ path[0]= 0;
}
- DBUG_PRINT("info", ("%s", buf.str));
- my_free((gptr)d, MYF(0));
- list_pop(extra_defaults); /* pop off the head */
}
- if (my_write(defaults_file, buf.str, buf.length, MYF(MY_FNABP | MY_WME)))
+ do
{
- ret= 1;
- goto error;
+ DBUG_PRINT("enter", ("path: %s", path));
+
+ /* Chop off last char(since it might be a /) */
+ path[max((strlen(path)-1), 0)]= 0;
+
+ /* Chop off last dir part */
+ dirname_part(path, path);
+
+ /* Format name of the tool to search for */
+ fn_format(tool_path, tool_name,
+ path, "", MYF(MY_REPLACE_DIR));
+
+ verbose("Looking for '%s' in: %s", tool_name, tool_path);
+
+ /* Make sure the tool exists */
+ if (my_access(tool_path, F_OK) != 0)
+ die("Can't find '%s'", tool_path);
+
+ /*
+ Make sure it can be executed, otherwise try again
+ in higher level directory
+ */
}
- /* everything's all right */
- ret= 0;
-error:
- dynstr_free(&buf);
-
- if (defaults_file >= 0)
- ret|= my_close(defaults_file, MYF(MY_WME));
-
- if (ret)
- my_delete(path, MYF(0));
-
-out:
+ while(run_tool(tool_path,
+ &ds_tmp, /* Get output from command, discard*/
+ "--help",
+ "2>&1",
+ IF_WIN("> NUL", "> /dev/null"),
+ NULL));
+
+ dynstr_free(&ds_tmp);
+
+ DBUG_VOID_RETURN;
+}
+
+
+/*
+ Run query using "mysql"
+*/
+
+static int run_query(const char *query, DYNAMIC_STRING *ds_res,
+ my_bool force)
+{
+ int ret;
+ File fd;
+ char query_file_path[FN_REFLEN];
+ DBUG_ENTER("run_query");
+ DBUG_PRINT("enter", ("query: %s", query));
+ if ((fd= create_temp_file(query_file_path, NULL,
+ "sql", O_CREAT | O_SHARE | O_RDWR,
+ MYF(MY_WME))) < 0)
+ die("Failed to create temporary file for defaults");
+
+ if (my_write(fd, query, strlen(query),
+ MYF(MY_FNABP | MY_WME)))
+ die("Failed to write to '%s'", query_file_path);
+
+ ret= run_tool(mysql_path,
+ ds_res,
+ ds_args.str,
+ "--database=mysql",
+ "--batch", /* Turns off pager etc. */
+ force ? "--force": "--skip-force",
+ ds_res ? "--silent": "",
+ "<",
+ query_file_path,
+ "2>&1",
+ NULL);
+
+ my_close(fd, MYF(0));
+
DBUG_RETURN(ret);
}
-/* Compare filenames */
-static int comp_names(struct fileinfo *a, struct fileinfo *b)
+/*
+ Extract the value returned from result of "show variable like ..."
+*/
+
+static int extract_variable_from_show(DYNAMIC_STRING* ds, char* value)
{
- return (strcmp(a->name,b->name));
+ char *value_start, *value_end;
+ /*
+ The query returns "datadir\t<datadir>\n", skip past
+ the tab
+ */
+ if ((value_start= strchr(ds->str, '\t')) == NULL)
+ return 1; /* Unexpected result */
+ value_start++;
+
+ /* Don't copy the ending newline */
+ if ((value_end= strchr(value_start, '\n')) == NULL)
+ return 1; /* Unexpected result */
+
+ strncpy(value, value_start, min(FN_REFLEN, value_end-value_start));
+ return 0;
}
-static int find_file(const char *name, const char *root,
- uint flags, char *result, size_t len, ...)
+static int get_upgrade_info_file_name(char* name)
{
- int ret= 1;
- va_list va;
- const char *subdir;
- char *cp;
- FILEINFO key;
-
- /* Init key with name of the file to look for */
- key.name= (char*)name;
-
- DBUG_ASSERT(root != NULL);
-
- cp= strmake(result, root, len);
- if (cp[-1] != FN_LIBCHAR)
- *cp++= FN_LIBCHAR;
-
- va_start(va, len);
- subdir= (!(flags & MY_SEARCH_SELF)) ? va_arg(va, char *) : "";
- while (subdir)
+ DYNAMIC_STRING ds_datadir;
+ DBUG_ENTER("get_upgrade_info_file_name");
+
+ if (init_dynamic_string(&ds_datadir, NULL, 32, 32))
+ die("Out of memory");
+
+ if (run_query("show variables like 'datadir'",
+ &ds_datadir, FALSE) ||
+ extract_variable_from_show(&ds_datadir, name))
{
- MY_DIR *dir;
- FILEINFO *match;
- char *cp1;
-
- cp1= strnmov(cp, subdir, len - (cp - result) - 1);
-
- dir= my_dir(result, (flags & MY_ISDIR) ? MY_WANT_STAT : MYF(0));
- if (dir)
- {
- match= bsearch(&key, dir->dir_entry, dir->number_off_files,
- sizeof(FILEINFO), (qsort_cmp)comp_names);
- if (match)
- {
- ret= (flags & MY_ISDIR) ? !MY_S_ISDIR(match->mystat->st_mode) : 0;
- if (!ret)
- {
- if (cp1[-1] != FN_LIBCHAR)
- *cp1++= FN_LIBCHAR;
-
- if (!(flags & MY_PARENT))
- strnmov(cp1, name, len - (cp1 - result));
- else
- *cp1= '\0';
-
- my_dirend(dir);
- break;
- }
- }
- my_dirend(dir);
- }
- subdir= va_arg(va, char *);
+ dynstr_free(&ds_datadir);
+ DBUG_RETURN(1); /* Query failed */
}
- va_end(va);
- return ret;
+
+ dynstr_free(&ds_datadir);
+
+ fn_format(name, "mysql_upgrade_info", name, "", MYF(0));
+ DBUG_PRINT("exit", ("name: %s", name));
+ DBUG_RETURN(0);
}
-int main(int argc, char **argv)
+/*
+ Read the content of mysql_upgrade_info file and
+ compare the version number form file against
+ version number wich mysql_upgrade was compiled for
+
+ NOTE
+ This is an optimization to avoid running mysql_upgrade
+ when it's already been performed for the particular
+ version of MySQL.
+
+ In case the MySQL server can't return the upgrade info
+ file it's always better to report that the upgrade hasn't
+ been performed.
+
+*/
+
+static int upgrade_already_done(void)
{
- int ret;
-
- char *forced_defaults_file;
- char *forced_extra_defaults;
- char *local_defaults_group_suffix;
- int no_defaults;
- char path[FN_REFLEN], upgrade_defaults_path[FN_REFLEN];
+ FILE *in;
+ char upgrade_info_file[FN_REFLEN]= {0};
+ char buf[sizeof(MYSQL_SERVER_VERSION)+1];
- DYNAMIC_STRING cmdline;
+ if (get_upgrade_info_file_name(upgrade_info_file))
+ return 0; /* Could not get filename => not sure */
- MY_INIT(argv[0]);
-#ifdef __NETWARE__
- setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
-#endif
+ if (!(in= my_fopen(upgrade_info_file, O_RDONLY, MYF(0))))
+ return 0; /* Could not open file => not sure */
- /* Check if we are forced to use specific defaults */
- no_defaults= 0;
- if (argc >= 2 && !strcmp(argv[1],"--no-defaults"))
- no_defaults= 1;
+ /*
+ Read from file, don't care if it fails since it
+ will be detected by the strncmp
+ */
+ bzero(buf, sizeof(buf));
+ fgets(buf, sizeof(buf), in);
- get_defaults_options(argc, argv,
- &forced_defaults_file, &forced_extra_defaults,
- &local_defaults_group_suffix);
-
- load_defaults("my", load_default_groups, &argc, &argv);
- defaults_argv= argv;
-
- /*
- Must init_dynamic_string before handle_options because string is freed
- at error label.
- */
- if (init_dynamic_string(&cmdline, NULL, 2 * FN_REFLEN + 128, FN_REFLEN) ||
- handle_options(&argc, &argv, my_long_options, get_one_option))
- {
- ret= 1;
- goto error;
- }
- if (tty_password)
- opt_password= get_tty_password(NullS);
+ my_fclose(in, MYF(0));
- if (!basedir)
- {
- my_getwd(path, sizeof(path), MYF(0));
- basedir= my_strdup(path, MYF(0));
- if (find_file("errmsg.sys", basedir, MYF(0), path, sizeof(path),
- "share/mysql/english", NullS)
- || find_file(mysqld_name, basedir, MYF(0), path, sizeof(path),
- "bin", "libexec", NullS))
- {
- my_free((gptr)basedir, MYF(0));
- basedir= (char *)DEFAULT_MYSQL_HOME;
- }
- }
+ return (strncmp(buf, MYSQL_SERVER_VERSION,
+ sizeof(MYSQL_SERVER_VERSION)-1)==0);
+}
- if (!datadir)
- {
- if (!find_file("mysql", basedir, MYF(MY_ISDIR|MY_PARENT),
- path, sizeof(path),
- "data", "var", NullS))
- datadir= my_strdup(path, MYF(0));
- else
- datadir= (char *)DATADIR;
- }
- if (find_file("user.frm", datadir, MYF(0), path, sizeof(path),
- "mysql", NullS))
+
+/*
+ Write mysql_upgrade_info file in servers data dir indicating that
+ upgrade has been done for this version
+
+ NOTE
+ This might very well fail but since it's just an optimization
+ to run mysql_upgrade only when necessary the error can be
+ ignored.
+
+*/
+
+static void create_mysql_upgrade_info_file(void)
+{
+ FILE *out;
+ char upgrade_info_file[FN_REFLEN]= {0};
+
+ if (get_upgrade_info_file_name(upgrade_info_file))
+ return; /* Could not get filename => skip */
+
+ if (!(out= my_fopen(upgrade_info_file, O_TRUNC | O_WRONLY, MYF(0))))
{
- ret= 1;
fprintf(stderr,
- "Can't find data directory. Please restart with"
- " --datadir=path-to-writable-data-dir");
- goto error;
+ "Could not create the upgrade info file '%s' in "
+ "the MySQL Servers datadir, errno: %d\n",
+ upgrade_info_file, errno);
+ return;
}
- /*
- Create the modified defaults file to be used by mysqlcheck
- and mysql command line client
- */
- fn_format(upgrade_defaults_path, UPGRADE_DEFAULTS_NAME, datadir, "", MYF(0));
- create_defaults_file(upgrade_defaults_path, forced_extra_defaults);
-
+ /* Write new version to file */
+ fputs(MYSQL_SERVER_VERSION, out);
+ my_fclose(out, MYF(0));
/*
- Read the mysql_upgrade_info file to check if mysql_upgrade
- already has been done
- Maybe this could be done a little earlier?
+ Check if the upgrad_info_file was properly created/updated
+ It's not a fatal error -> just print a message if it fails
*/
- if (!find_file(MYSQL_UPGRADE_INFO_NAME, datadir, MY_SEARCH_SELF,
- path, sizeof(path), NULL, NullS)
- && !opt_force)
- {
- char buf[sizeof(MYSQL_SERVER_VERSION)];
- int fd, cnt;
-
- fd= my_open(path, O_RDONLY, MYF(0));
- cnt= my_read(fd, buf, sizeof(buf) - 1, MYF(0));
- my_close(fd, MYF(0));
- buf[cnt]= 0;
- if (!strcmp(buf, MYSQL_SERVER_VERSION))
- {
- if (opt_verbose)
- puts("mysql_upgrade has already been done for this version");
- goto fix_priv_tables;
- }
- }
+ if (!upgrade_already_done())
+ fprintf(stderr,
+ "Could not write to the upgrade info file '%s' in "
+ "the MySQL Servers datadir, errno: %d\n",
+ upgrade_info_file, errno);
+ return;
+}
- /* Find mysqlcheck */
- if (find_file(mysqlcheck_name, basedir, MYF(0), path, sizeof(path),
- "bin", EXTRA_CLIENT_PATHS, NullS))
- {
- ret= 1;
- fprintf(stderr,
- "Can't find program '%s'\n"
- "Please restart with --basedir=mysql-install-directory",
- mysqlcheck_name);
- goto error;
- }
- else
+/*
+ Check and upgrade(if neccessary) all tables
+ in the server using "mysqlcheck --check-upgrade .."
+*/
+
+static int run_mysqlcheck_upgrade(void)
+{
+ verbose("Running 'mysqlcheck'...");
+ return run_tool(mysqlcheck_path,
+ NULL, /* Send output from mysqlcheck directly to screen */
+ ds_args.str,
+ "--check-upgrade",
+ "--all-databases",
+ "--auto-repair",
+ NULL);
+}
+
+
+static const char *expected_errors[]=
+{
+ "ERROR 1060", /* Duplicate column name */
+ "ERROR 1061", /* Duplicate key name */
+ "ERROR 1054", /* Unknown column */
+ 0
+};
+
+
+static my_bool is_expected_error(const char* line)
+{
+ const char** error= expected_errors;
+ while (*error)
{
-#ifdef __WIN__
- /* Windows requires an extra pair of quotes around the entire string. */
- dynstr_set(&cmdline, "\"");
-#else
- dynstr_set(&cmdline, "");
-#endif /* __WIN__ */
- dynstr_append_os_quoted(&cmdline, path, NullS);
+ /*
+ Check if lines starting with ERROR
+ are in the list of expected errors
+ */
+ if (strncmp(line, "ERROR", 5) != 0 ||
+ strncmp(line, *error, strlen(*error)) == 0)
+ return 1; /* Found expected error */
+ error++;
}
+ return 0;
+}
- /*
- All settings have been written to the "upgrade_defaults_path"
- instruct mysqlcheck to only read options from that file
- */
- dynstr_append(&cmdline, " ");
- dynstr_append_os_quoted(&cmdline,
- (no_defaults ? "--defaults-file=" :
- "--defaults-extra-file="),
- upgrade_defaults_path, NullS);
- dynstr_append(&cmdline, " ");
- dynstr_append_os_quoted(&cmdline, "--check-upgrade", NullS);
- dynstr_append(&cmdline, " ");
- dynstr_append_os_quoted(&cmdline, "--all-databases", NullS);
- dynstr_append(&cmdline, " ");
- dynstr_append_os_quoted(&cmdline, "--auto-repair", NullS);
- dynstr_append(&cmdline, " ");
- dynstr_append_os_quoted(&cmdline, "--user=", user, NullS);
-#ifdef __WIN__
- dynstr_append(&cmdline, "\"");
-#endif /* __WIN__ */
-
- /* Execute mysqlcheck */
- if (opt_verbose)
- printf("Running %s\n", cmdline.str);
- DBUG_PRINT("info", ("Running: %s", cmdline.str));
- ret= system(cmdline.str);
- if (ret)
+
+static char* get_line(char* line)
+{
+ while (*line && *line != '\n')
+ line++;
+ if (*line)
+ line++;
+ return line;
+}
+
+
+/* Print the current line to stderr */
+static void print_line(char* line)
+{
+ while (*line && *line != '\n')
{
- fprintf(stderr, "Error executing '%s'\n", cmdline.str);
- goto error;
+ fputc(*line, stderr);
+ line++;
}
+ fputc('\n', stderr);
+}
- fn_format(path, MYSQL_UPGRADE_INFO_NAME, datadir, "", MYF(0));
- ret= create_check_file(path);
- if (ret)
- goto error;
-fix_priv_tables:
- /* Find mysql */
- if (find_file(mysql_name, basedir, MYF(0), path, sizeof(path),
- "bin", EXTRA_CLIENT_PATHS, NullS))
+/*
+ Update all system tables in MySQL Server to current
+ version using "mysql" to execute all the SQL commands
+ compiled into the mysql_fix_privilege_tables array
+*/
+
+static int run_sql_fix_privilege_tables(void)
+{
+ int found_real_errors= 0;
+ DYNAMIC_STRING ds_result;
+ DBUG_ENTER("run_sql_fix_privilege_tables");
+
+ if (init_dynamic_string(&ds_result, "", 512, 512))
+ die("Out of memory");
+
+ verbose("Running 'mysql_fix_privilege_tables'...");
+ run_query(mysql_fix_privilege_tables,
+ &ds_result, /* Collect result */
+ TRUE);
+
{
- ret= 1;
- fprintf(stderr,
- "Could not find MySQL command-line client (mysql).\n"
- "Please use --basedir to specify the directory"
- " where MySQL is installed.");
- goto error;
+ /*
+ Scan each line of the result for real errors
+ and ignore the expected one(s) like "Duplicate column name",
+ "Unknown column" and "Duplicate key name" since they just
+ indicate the system tables are already up to date
+ */
+ char *line= ds_result.str;
+ do
+ {
+ if (!is_expected_error(line))
+ {
+ /* Something unexpected failed, dump error line to screen */
+ found_real_errors++;
+ print_line(line);
+ }
+ } while ((line= get_line(line)) && *line);
}
- else
+
+ dynstr_free(&ds_result);
+ return found_real_errors;
+}
+
+
+static const char *load_default_groups[]=
+{
+ "client", /* Read settings how to connect to server */
+ "mysql_upgrade", /* Read special settings for mysql_upgrade*/
+ 0
+};
+
+
+int main(int argc, char **argv)
+{
+ MY_INIT(argv[0]);
+#ifdef __NETWARE__
+ setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
+#endif
+
+ if (init_dynamic_string(&ds_args, "", 512, 256))
+ die("Out of memory");
+
+ load_defaults("my", load_default_groups, &argc, &argv);
+ defaults_argv= argv; /* Must be freed by 'free_defaults' */
+
+ if (handle_options(&argc, &argv, my_long_options, get_one_option))
+ die(NULL);
+
+ if (tty_password)
{
-#ifdef __WIN__
- /* Windows requires an extra pair of quotes around the entire string. */
- dynstr_set(&cmdline, "\"");
-#else
- dynstr_set(&cmdline, "");
-#endif /* __WIN__ */
- dynstr_append_os_quoted(&cmdline, path, NullS);
+ opt_password= get_tty_password(NullS);
+ /* add password to defaults file */
+ dynstr_append_os_quoted(&ds_args, "--password=", opt_password, NullS);
+ dynstr_append(&ds_args, " ");
}
+ /* add user to defaults file */
+ dynstr_append_os_quoted(&ds_args, "--user=", opt_user, NullS);
+ dynstr_append(&ds_args, " ");
+
+ /* Find mysql */
+ find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"));
- /* Find mysql_fix_privililege_tables.sql */
- if (find_file(MYSQL_FIX_PRIV_TABLES_NAME, basedir, MYF(0),
- path, sizeof(path),
- "support_files", "share", "share/mysql", "scripts",
- NullS)
- && find_file(MYSQL_FIX_PRIV_TABLES_NAME, "/usr/local/mysql", MYF(0),
- path, sizeof(path),
- "share/mysql", NullS))
+ /* Find mysqlcheck */
+ find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"));
+
+ /*
+ Read the mysql_upgrade_info file to check if mysql_upgrade
+ already has been run for this installation of MySQL
+ */
+ if (!opt_force && upgrade_already_done())
{
- ret= 1;
- fprintf(stderr,
- "Could not find file " MYSQL_FIX_PRIV_TABLES_NAME "\n"
- "Please use --basedir to specify the directory"
- " where MySQL is installed");
- goto error;
+ printf("This installation of MySQL is already upgraded to %s, "
+ "use --force if you still need to run mysql_upgrade\n",
+ MYSQL_SERVER_VERSION);
+ die(NULL);
}
/*
- All settings have been written to the "upgrade_defaults_path",
- instruct mysql to only read options from that file
+ Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
*/
- dynstr_append(&cmdline, " ");
- dynstr_append_os_quoted(&cmdline,
- (no_defaults ? "--defaults-file=" :
- "--defaults-extra-file="),
- upgrade_defaults_path, NullS);
- dynstr_append(&cmdline, " ");
- dynstr_append_os_quoted(&cmdline, "--force", NullS);
- dynstr_append(&cmdline, " ");
- dynstr_append_os_quoted(&cmdline, "--no-auto-rehash", NullS);
- dynstr_append(&cmdline, " ");
- dynstr_append_os_quoted(&cmdline, "--batch", NullS);
- dynstr_append(&cmdline, " ");
- dynstr_append_os_quoted(&cmdline, "--user=", user, NullS);
- dynstr_append(&cmdline, " ");
- dynstr_append_os_quoted(&cmdline, "--database=mysql", NullS);
- dynstr_append(&cmdline, " < ");
- dynstr_append_os_quoted(&cmdline, path, NullS);
-#ifdef __WIN__
- dynstr_append(&cmdline, "\"");
-#endif /* __WIN__ */
-
- /* Execute "mysql --force < mysql_fix_privilege_tables.sql" */
- if (opt_verbose)
- printf("Running %s\n", cmdline.str);
- DBUG_PRINT("info", ("Running: %s", cmdline.str));
- ret= system(cmdline.str);
- if (ret)
- fprintf(stderr, "Error executing '%s'\n", cmdline.str);
-
-error:
- dynstr_free(&cmdline);
+ if (run_mysqlcheck_upgrade() ||
+ run_sql_fix_privilege_tables())
+ {
+ /*
+ The upgrade failed to complete in some way or another,
+ significant error message should have been printed to the screen
+ */
+ die("Upgrade failed" );
+ }
+ verbose("OK");
- /* Delete the generated defaults file */
- my_delete(upgrade_defaults_path, MYF(0));
+ /* Create a file indicating upgrade has been performed */
+ create_mysql_upgrade_info_file();
- free_defaults(defaults_argv);
- my_end(info_flag ? MY_CHECK_ERROR : 0);
- return ret;
+ free_used_memory();
+ my_end(MY_CHECK_ERROR);
+ exit(0);
}
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 63db2cc268e..f1e6a825257 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 */
@@ -1489,8 +1492,15 @@ static uint dump_routines_for_db(char *db)
routine body of other routines that are not the creator of!
*/
DBUG_PRINT("info",("length of body for %s row[2] '%s' is %d",
- routine_name, row[2], (int) strlen(row[2])));
- if (strlen(row[2]))
+ routine_name, row[2] ? row[2] : "(null)",
+ row[2] ? (int) strlen(row[2]) : 0));
+ if (row[2] == NULL)
+ {
+ fprintf(sql_file, "\n-- insufficient privileges to %s\n", query_buff);
+ fprintf(sql_file, "-- does %s have permissions on mysql.proc?\n\n", current_user);
+ maybe_die(EX_MYSQLERR,"%s has insufficent privileges to %s!", current_user, query_buff);
+ }
+ else if (strlen(row[2]))
{
char *query_str= NULL;
char *definer_begin;
@@ -1540,7 +1550,7 @@ static uint dump_routines_for_db(char *db)
/*
we need to change sql_mode only for the CREATE
PROCEDURE/FUNCTION otherwise we may need to re-quote routine_name
- */;
+ */
fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\"*/;;\n",
row[1] /* sql_mode */);
fprintf(sql_file, "/*!50003 %s */;;\n",
@@ -2099,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,
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 568d33f7385..5640d0c24ba 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -85,12 +85,13 @@ enum {
OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_PS_PROTOCOL,
OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL,
OPT_SSL_VERIFY_SERVER_CERT, OPT_MAX_CONNECT_RETRIES,
- OPT_MARK_PROGRESS, OPT_CHARSETS_DIR
+ OPT_MARK_PROGRESS, OPT_CHARSETS_DIR, OPT_LOG_DIR
};
static int record= 0, opt_sleep= -1;
static char *opt_db= 0, *opt_pass= 0;
const char *opt_user= 0, *opt_host= 0, *unix_sock= 0, *opt_basedir= "./";
+const char *opt_logdir= "";
const char *opt_include= 0, *opt_charsets_dir;
static int opt_port= 0;
static int opt_max_connect_retries;
@@ -102,7 +103,8 @@ static my_bool sp_protocol= 0, sp_protocol_enabled= 0;
static my_bool view_protocol= 0, view_protocol_enabled= 0;
static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0;
static my_bool parsing_disabled= 0;
-static my_bool display_result_vertically= FALSE, display_metadata= FALSE;
+static my_bool display_result_vertically= FALSE,
+ display_metadata= FALSE, display_result_sorted= FALSE;
static my_bool disable_query_log= 0, disable_result_log= 0;
static my_bool disable_warnings= 0;
static my_bool disable_info= 1;
@@ -269,14 +271,14 @@ 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_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,
Q_IF,
Q_DISABLE_PARSING, Q_ENABLE_PARSING,
Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST,
- Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT,
+ Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP,
Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES,
Q_UNKNOWN, /* Unknown command. */
@@ -339,6 +341,7 @@ const char *command_names[]=
"horizontal_results",
"query_vertical",
"query_horizontal",
+ "sorted_result",
"start_timer",
"end_timer",
"character_set",
@@ -359,6 +362,7 @@ const char *command_names[]=
/* Don't execute any more commands, compare result */
"exit",
+ "skip",
"chmod",
"append_file",
"cat_file",
@@ -484,6 +488,7 @@ void replace_dynstr_append_mem(DYNAMIC_STRING *ds, const char *val,
int len);
void replace_dynstr_append(DYNAMIC_STRING *ds, const char *val);
void replace_dynstr_append_uint(DYNAMIC_STRING *ds, uint val);
+void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING* ds_input);
void handle_error(struct st_command*,
unsigned int err_errno, const char *err_error,
@@ -809,27 +814,66 @@ void free_used_memory()
}
+static void cleanup_and_exit(int exit_code)
+{
+ free_used_memory();
+ my_end(MY_CHECK_ERROR);
+
+ if (!silent)
+ {
+ switch (exit_code)
+ {
+ case 1:
+ printf("not ok\n");
+ break;
+ case 0:
+ printf("ok\n");
+ break;
+ case 62:
+ printf("skipped\n");
+ break;
+ default:
+ printf("unknown exit code: %d\n", exit_code);
+ DBUG_ASSERT(0);
+ }
+ }
+
+ exit(exit_code);
+}
+
void die(const char *fmt, ...)
{
+ static int dying= 0;
va_list args;
DBUG_ENTER("die");
DBUG_PRINT("enter", ("start_lineno: %d", start_lineno));
+ /*
+ Protect against dying twice
+ first time 'die' is called, try to write log files
+ second time, just exit
+ */
+ if (dying)
+ cleanup_and_exit(1);
+ dying= 1;
+
/* Print the error message */
- va_start(args, fmt);
+ fprintf(stderr, "mysqltest: ");
+ if (cur_file && cur_file != file_stack)
+ fprintf(stderr, "In included file \"%s\": ",
+ cur_file->file_name);
+ if (start_lineno > 0)
+ fprintf(stderr, "At line %u: ", start_lineno);
if (fmt)
{
- fprintf(stderr, "mysqltest: ");
- if (cur_file && cur_file != file_stack)
- fprintf(stderr, "In included file \"%s\": ",
- cur_file->file_name);
- if (start_lineno > 0)
- fprintf(stderr, "At line %u: ", start_lineno);
+ va_start(args, fmt);
vfprintf(stderr, fmt, args);
- fprintf(stderr, "\n");
- fflush(stderr);
+ va_end(args);
}
- va_end(args);
+ else
+ fprintf(stderr, "unknown error");
+ fprintf(stderr, "\n");
+ fflush(stderr);
/* Dump the result that has been accumulated so far to .log file */
if (result_file_name && ds_res.length)
@@ -839,14 +883,7 @@ void die(const char *fmt, ...)
if (result_file_name && ds_warning_messages.length)
dump_warning_messages();
- /* Clean up and exit */
- free_used_memory();
- my_end(MY_CHECK_ERROR);
-
- if (!silent)
- printf("not ok\n");
-
- exit(1);
+ cleanup_and_exit(1);
}
@@ -879,14 +916,7 @@ void abort_not_supported_test(const char *fmt, ...)
}
va_end(args);
- /* Clean up and exit */
- free_used_memory();
- my_end(MY_CHECK_ERROR);
-
- if (!silent)
- printf("skipped\n");
-
- exit(62);
+ cleanup_and_exit(62);
}
@@ -1299,23 +1329,31 @@ void var_set(const char *var_name, const char *var_name_end,
DBUG_VOID_RETURN;
}
+
+void var_set_string(const char* name, const char* value)
+{
+ var_set(name, name + strlen(name), value, value + strlen(value));
+}
+
+
+void var_set_int(const char* name, int value)
+{
+ char buf[21];
+ my_snprintf(buf, sizeof(buf), "%d", value);
+ var_set_string(name, buf);
+}
+
+
/*
Store an integer (typically the returncode of the last SQL)
- statement in the mysqltest builtin variable $mysql_errno, by
- simulating of a user statement "let $mysql_errno= <integer>"
+ statement in the mysqltest builtin variable $mysql_errno
*/
void var_set_errno(int sql_errno)
{
- /* TODO MASV make easier */
- const char *var_name= "$mysql_errno";
- char var_val[21];
- uint length= my_sprintf(var_val, (var_val, "%d", sql_errno));
- var_set(var_name, var_name + 12, var_val, var_val + length);
- return;
+ var_set_int("$mysql_errno", sql_errno);
}
-
/*
Set variable from the result of a query
@@ -1346,6 +1384,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
MYSQL_RES *res;
MYSQL_ROW row;
MYSQL* mysql = &cur_con->mysql;
+ DYNAMIC_STRING ds_query;
DBUG_ENTER("var_query_set");
LINT_INIT(res);
@@ -1355,13 +1394,17 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
die("Syntax error in query, missing '`'");
++query;
- if (mysql_real_query(mysql, query, (int)(end - query)) ||
+ /* Eval the query, thus replacing all environment variables */
+ 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)))
{
- *end = 0;
- die("Error running query '%s': %d %s", query,
+ die("Error running query '%s': %d %s", ds_query.str,
mysql_errno(mysql), mysql_error(mysql));
}
+ dynstr_free(&ds_query);
if ((row = mysql_fetch_row(res)) && row[0])
{
@@ -4230,6 +4273,8 @@ static struct my_option my_long_options[] =
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"include", 'i', "Include SQL before each test case.", (gptr*) &opt_include,
(gptr*) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"logdir", OPT_LOG_DIR, "Directory for log files", (gptr*) &opt_logdir,
+ (gptr*) &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"mark-progress", OPT_MARK_PROGRESS,
"Write linenumber and elapsed time to <testname>.progress ",
(gptr*) &opt_mark_progress, (gptr*) &opt_mark_progress, 0,
@@ -4532,15 +4577,18 @@ void dump_result_to_reject_file(char *buf, int size)
void dump_result_to_log_file(char *buf, int size)
{
char log_file[FN_REFLEN];
- str_to_file(fn_format(log_file, result_file_name, "", ".log",
+ str_to_file(fn_format(log_file, result_file_name, opt_logdir, ".log",
+ *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT :
MY_REPLACE_EXT),
buf, size);
}
void dump_progress(void)
{
- char log_file[FN_REFLEN];
- str_to_file(fn_format(log_file, result_file_name, "", ".progress",
+ char progress_file[FN_REFLEN];
+ str_to_file(fn_format(progress_file, result_file_name,
+ opt_logdir, ".progress",
+ *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT :
MY_REPLACE_EXT),
ds_progress.str, ds_progress.length);
}
@@ -4549,7 +4597,8 @@ void dump_warning_messages(void)
{
char warn_file[FN_REFLEN];
- str_to_file(fn_format(warn_file, result_file_name, "", ".warnings",
+ str_to_file(fn_format(warn_file, result_file_name, opt_logdir, ".warnings",
+ *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT :
MY_REPLACE_EXT),
ds_warning_messages.str, ds_warning_messages.length);
}
@@ -5502,7 +5551,9 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
{
MYSQL *mysql= &cn->mysql;
DYNAMIC_STRING *ds;
+ DYNAMIC_STRING *save_ds= NULL;
DYNAMIC_STRING ds_result;
+ DYNAMIC_STRING ds_sorted;
DYNAMIC_STRING ds_warnings;
DYNAMIC_STRING eval_query;
char *query;
@@ -5644,6 +5695,18 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
dynstr_free(&query_str);
}
+ if (display_result_sorted)
+ {
+ /*
+ Collect the query output in a separate string
+ that can be sorted before it's added to the
+ global result string
+ */
+ init_dynamic_string(&ds_sorted, "", 1024, 1024);
+ save_ds= ds; /* Remember original ds */
+ ds= &ds_sorted;
+ }
+
/*
Find out how to run this query
@@ -5661,6 +5724,14 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
run_query_normal(cn, command, flags, query, query_len,
ds, &ds_warnings);
+ if (display_result_sorted)
+ {
+ /* Sort the result set and append it to result */
+ dynstr_append_sorted(save_ds, &ds_sorted);
+ ds= save_ds;
+ dynstr_free(&ds_sorted);
+ }
+
if (sp_created)
{
if (util_query(mysql, "DROP PROCEDURE mysqltest_tmp_sp "))
@@ -5948,6 +6019,8 @@ int main(int argc, char **argv)
1024, 0, 0, get_var_key, var_free, MYF(0)))
die("Variable hash initialization failed");
+ var_set_string("$MYSQL_SERVER_VERSION", MYSQL_SERVER_VERSION);
+
memset(&master_pos, 0, sizeof(master_pos));
parser.current_line= parser.read_lines= 0;
@@ -5967,6 +6040,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,
@@ -6103,41 +6181,33 @@ 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:
if (command->query == command->query_buf)
{
+ /* Skip the first part of command, i.e query_xxx */
command->query= command->first_argument;
command->first_word_len= 0;
}
/* fall through */
- case Q_QUERY_VERTICAL:
- case Q_QUERY_HORIZONTAL:
- {
- my_bool old_display_result_vertically= display_result_vertically;
-
- /* Remove "query_*" if this is first iteration */
- if (command->query == command->query_buf)
- command->query= command->first_argument;
-
- display_result_vertically= (command->type == Q_QUERY_VERTICAL);
- if (save_file[0])
- {
- strmake(command->require_file, save_file, sizeof(save_file));
- save_file[0]= 0;
- }
- run_query(cur_con, command, QUERY_REAP_FLAG|QUERY_SEND_FLAG);
- display_result_vertically= old_display_result_vertically;
- command->last_argument= command->end;
- command_executed++;
- break;
- }
case Q_QUERY:
case Q_REAP:
{
- int flags;
+ my_bool old_display_result_vertically= display_result_vertically;
+ /* Default is full query, both reap and send */
+ int flags= QUERY_REAP_FLAG | QUERY_SEND_FLAG;
+
if (q_send_flag)
{
/* Last command was an empty 'send' */
@@ -6148,11 +6218,9 @@ int main(int argc, char **argv)
{
flags= QUERY_REAP_FLAG;
}
- else
- {
- /* full query, both reap and send */
- flags= QUERY_REAP_FLAG | QUERY_SEND_FLAG;
- }
+
+ /* Check for special property for this query */
+ display_result_vertically|= (command->type == Q_QUERY_VERTICAL);
if (save_file[0])
{
@@ -6162,6 +6230,10 @@ int main(int argc, char **argv)
run_query(cur_con, command, flags);
command_executed++;
command->last_argument= command->end;
+
+ /* Restore settings */
+ display_result_vertically= old_display_result_vertically;
+
break;
}
case Q_SEND:
@@ -6277,6 +6349,9 @@ int main(int argc, char **argv)
/* Stop processing any more commands */
abort_flag= 1;
break;
+ case Q_SKIP:
+ abort_not_supported_test("%s", command->first_argument);
+ break;
case Q_RESULT:
die("result, deprecated command");
@@ -6318,6 +6393,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;
@@ -6388,14 +6466,9 @@ int main(int argc, char **argv)
dump_warning_messages();
timer_output();
- free_used_memory();
- my_end(MY_CHECK_ERROR);
-
/* Yes, if we got this far the test has suceeded! Sakila smiles */
- if (!silent)
- printf("ok\n");
- exit(0);
- return 0; /* Keep compiler happy */
+ cleanup_and_exit(0);
+ return 0; /* Keep compiler happy too */
}
@@ -7774,3 +7847,73 @@ void replace_dynstr_append_uint(DYNAMIC_STRING *ds, uint val)
char *end= longlong10_to_str(val, buff, 10);
replace_dynstr_append_mem(ds, buff, end - buff);
}
+
+
+
+/*
+ Build a list of pointer to each line in ds_input, sort
+ the list and use the sorted list to append the strings
+ sorted to the output ds
+
+ SYNOPSIS
+ dynstr_append_sorted
+ ds - string where the sorted output will be appended
+ ds_input - string to be sorted
+
+*/
+
+static int comp_lines(const char **a, const char **b)
+{
+ return (strcmp(*a,*b));
+}
+
+void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input)
+{
+ unsigned i;
+ char *start= ds_input->str;
+ DYNAMIC_ARRAY lines;
+ DBUG_ENTER("dynstr_append_sorted");
+
+ if (!*start)
+ DBUG_VOID_RETURN; /* No input */
+
+ my_init_dynamic_array(&lines, sizeof(const char*), 32, 32);
+
+ /* First line is result header, skip past it */
+ while (*start && *start != '\n')
+ start++;
+ start++; /* Skip past \n */
+ dynstr_append_mem(ds, ds_input->str, start - ds_input->str);
+
+ /* Insert line(s) in array */
+ while (*start)
+ {
+ char* line_end= (char*)start;
+
+ /* Find end of line */
+ while (*line_end && *line_end != '\n')
+ line_end++;
+ *line_end= 0;
+
+ /* Insert pointer to the line in array */
+ if (insert_dynamic(&lines, (gptr) &start))
+ die("Out of memory inserting lines to sort");
+
+ start= line_end+1;
+ }
+
+ /* Sort array */
+ qsort(lines.buffer, lines.elements,
+ sizeof(char**), (qsort_cmp)comp_lines);
+
+ /* Create new result */
+ for (i= 0; i < lines.elements ; i++)
+ {
+ const char **line= dynamic_element(&lines, i, const char**);
+ dynstr_append(ds, *line);
+ dynstr_append(ds, "\n");
+ }
+
+ delete_dynamic(&lines);
+ DBUG_VOID_RETURN;
+}
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 26fc2d58b55..989aa978690 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 ?
@@ -32,6 +32,9 @@ MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"`
MYSQL_BASE_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|\.[[^.]]*$||"`
MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION | sed -e 's|[[^0-9.]].*$||;s|$|.|' | sed -e 's/[[^0-9.]]//g; s/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'`
+# Add previous major version for debian package upgrade path
+MYSQL_PREVIOUS_BASE_VERSION=4.1
+
# The port should be constant for a LONG time
MYSQL_TCP_PORT_DEFAULT=3306
MYSQL_UNIX_ADDR_DEFAULT="/tmp/mysql.sock"
@@ -68,6 +71,7 @@ romanian russian serbian slovak spanish swedish ukrainian"
AC_SUBST(MYSQL_NO_DASH_VERSION)
AC_SUBST(MYSQL_BASE_VERSION)
AC_SUBST(MYSQL_VERSION_ID)
+AC_SUBST(MYSQL_PREVIOUS_BASE_VERSION)
AC_SUBST(PROTOCOL_VERSION)
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
[mysql client protocol version])
@@ -459,6 +463,22 @@ AC_SUBST(MAKEINDEX)
# icheck, used for ABI check
AC_PATH_PROG(ICHECK, icheck, no)
+# "icheck" is also the name of a file system check program on Tru64.
+# Verify the program found is really the interface checker.
+if test "x$ICHECK" != "xno"
+then
+ AC_MSG_CHECKING(if $ICHECK works as expected)
+ echo "int foo;" > conftest.h
+ $ICHECK --canonify -o conftest.ic conftest.h 2>/dev/null
+ if test -f "conftest.ic"
+ then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ ICHECK=no
+ fi
+ rm -f conftest.ic conftest.h
+fi
AC_SUBST(ICHECK)
# Lock for PS
@@ -1986,12 +2006,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"
@@ -2376,28 +2404,6 @@ AC_ARG_WITH(man,
[with_man=yes]
)
-if test X"$with_man" = Xyes
-then
- man_dirs="man"
- if test X"$have_ndbcluster" = Xyes
- then
- man1_files=`ls $srcdir/man/*.1 | sed -e 's;^.*man/;;'`
- man8_files=`ls $srcdir/man/*.8 | sed -e 's;^.*man/;;'`
- else
- man1_files=`ls $srcdir/man/*.1 | grep -v '/ndb' | sed -e 's;^.*man/;;'`
- man8_files=`ls $srcdir/man/*.8 | grep -v '/ndb' | sed -e 's;^.*man/;;'`
- fi
- man1_files=`echo $man1_files`
- man8_files=`echo $man8_files`
-else
- man_dirs=""
- man1_files=""
- man8_files=""
-fi
-AC_SUBST(man_dirs)
-AC_SUBST(man1_files)
-AC_SUBST(man8_files)
-
# Shall we build the bench code?
AC_ARG_WITH(bench,
[ --without-bench Skip building of the benchmark suite.],
@@ -2532,6 +2538,60 @@ MYSQL_CHECK_BLACKHOLEDB
MYSQL_CHECK_NDBCLUSTER
MYSQL_CHECK_FEDERATED
+# Include man pages, if desired, adapted to the configured parts.
+if test X"$with_man" = Xyes
+then
+ # First, create the list of all man pages present.
+ MANLISTFIL=manlist.$$
+ TMPLISTFIL=`echo $MANLISTFIL | sed -e 's/manlist/tmplist/'`
+ if test -f $MANLISTFIL -o -f $TMPLISTFIL
+ then
+ echo "Temp file '$MANLISTFIL' or '$TMPLISTFIL' already exists in '`pwd`' - aborting"
+ exit 1
+ fi
+ touch $MANLISTFIL $TMPLISTFIL
+
+ ls $srcdir/man/*.[[18]] > $MANLISTFIL
+
+ # Then, remove all those pages from the list which are specific to parts
+ # (table handlers, features, ...) which are not configured in this run.
+ AC_MSG_CHECKING("for man pages to remove")
+ MAN_DROP="dropping"
+ if test X"$have_ndbcluster" != Xyes
+ then
+ MAN_DROP="$MAN_DROP ndbcluster"
+ grep -v '/ndb' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
+ fi
+ if test X"$with_embedded_server" != Xyes
+ then
+ MAN_DROP="$MAN_DROP embedded"
+ grep -v 'embedded' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
+ fi
+ if test X"$have_innodb" != Xyes
+ then
+ MAN_DROP="$MAN_DROP innodb"
+ grep -v 'inno' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
+ fi
+ AC_MSG_RESULT([$MAN_DROP])
+
+ # Finally, split the man pages into sections 1 and 8.
+ # Get rid of line breaks.
+ man1_files=`sed -n -e '/\.1$/s/^.*man\///p' <$MANLISTFIL`
+ man8_files=`sed -n -e '/\.8$/s/^.*man\///p' <$MANLISTFIL`
+
+ man_dirs="man"
+ man1_files=`echo $man1_files`
+ man8_files=`echo $man8_files`
+ rm -f $MANLISTFIL $TMPLISTFIL
+else
+ man_dirs=""
+ man1_files=""
+ man8_files=""
+fi
+AC_SUBST(man_dirs)
+AC_SUBST(man1_files)
+AC_SUBST(man8_files)
+
# If we have threads generate some library functions and test programs
sql_server_dirs=
server_scripts=
@@ -2896,6 +2956,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
cmd-line-utils/libedit/Makefile dnl
win/Makefile dnl
zlib/Makefile dnl
+ debian/Makefile debian/defs.mk debian/control dnl
cmd-line-utils/readline/Makefile)
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
AC_OUTPUT
diff --git a/dbug/dbug_analyze.c b/dbug/dbug_analyze.c
index 8cd0af4f7e0..3263b2ccc59 100644
--- a/dbug/dbug_analyze.c
+++ b/dbug/dbug_analyze.c
@@ -574,10 +574,12 @@ int main (int argc, char **argv)
FILE *infile;
FILE *outfile = {stdout};
-#if defined(HAVE_PTHREAD_INIT) && defined(THREAD)
+#ifdef THREAD
+#if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */
#endif
my_thread_global_init();
+#endif /* THREAD */
{
DBUG_ENTER ("main");
DBUG_PROCESS (argv[0]);
diff --git a/debian/Makefile.am b/debian/Makefile.am
new file mode 100644
index 00000000000..14035865371
--- /dev/null
+++ b/debian/Makefile.am
@@ -0,0 +1,118 @@
+# Copyright (C) 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to create Makefile.in
+EXTRA_DIST = \
+ mysql-test-BASE.files.in \
+ libndbclientNLIB-dev.files.in \
+ mysql-server-BASE.config.in \
+ libndbclientNLIB.README.Debian.in \
+ mysql-server-BASE.postrm.in \
+ mysql-server-BASE.NEWS.in \
+ libndbclientNLIB.postinst.in \
+ mysql-server-BASE.links.in \
+ libndbclientNLIB.files.in \
+ source.lintian-overrides.in \
+ mysql-server-BASE.docs.in \
+ libmysqlclientSLIBoff.files.in \
+ mysql-server-BASE.files.in \
+ libndbclientNLIB-dev.links.in \
+ libmysqlclientSLIBoff.postinst.in \
+ mysql-extra-BASE.dirs.in \
+ libmysqlclientSLIB-dev.links.in \
+ mysql-server-BASE.dirs.in \
+ libmysqlclientSLIB-dev.examples.in \
+ mysql-client-BASE.lintian-overrides.in \
+ copyright.more \
+ libndbclientNLIB-dev.dirs.in \
+ mysql-server-BASE.README.Debian.in \
+ libmysqlclientSLIBoff.docs.in \
+ compat \
+ mysql-test-BASE.dirs.in \
+ libmysqlclientSLIB-dev.files.in \
+ libmysqlclientSLIBoff.dirs.in \
+ mysql-server-BASE.logcheck.ignore.server.in \
+ mysql-storage-BASE.mysql-storage.init.in \
+ libmysqlclientSLIBoff.README.Debian.in \
+ mysql-client-BASE.README.Debian.in \
+ Makefile.am \
+ mysql-server-BASE.prerm.in \
+ mysql-common.dirs.in \
+ defs.mk \
+ defs.mk.in \
+ mysql-server-BASE.mysql-server.logrotate.in \
+ mysql-common.README.Debian.in \
+ copyright \
+ mysql-storage-BASE.dirs.in \
+ mysql-common.preinst.in \
+ mysql-client-BASE.files.in \
+ mysql-server-BASE.templates.in \
+ mysql-tools-BASE.dirs.in \
+ mysql-management-BASE.mysql-management.init.in \
+ watch \
+ mysql-common.postrm.in \
+ mysql-server-BASE.preinst.in \
+ README.Maintainer \
+ mysql-tools-BASE.files.in \
+ mysql-client-BASE.NEWS.in \
+ mysql-server-BASE.lintian-overrides.in \
+ changelog \
+ mysql-server-BASE.logcheck.ignore.paranoid.in \
+ mysql-common.files.in \
+ mysql-server-BASE.logcheck.ignore.workstation.in \
+ mysql-extra-BASE.files.in \
+ mysql-management-BASE.files.in \
+ mysql-client-BASE.docs.in \
+ libmysqlclientSLIB-dev.README.Maintainer.in \
+ mysql-storage-BASE.files.in \
+ additions \
+ additions/ndb_mgmd.cnf \
+ additions/mysql-server.lintian-overrides \
+ additions/my.cnf \
+ mysql-server-BASE.postinst.in \
+ libndbclientNLIB.dirs.in \
+ po \
+ po/fr.po \
+ po/sv.po \
+ po/da.po \
+ po/es.po \
+ po/ja.po \
+ po/tr.po \
+ po/nb.po \
+ po/POTFILES.in.in \
+ po/cs.po \
+ po/pt.po \
+ po/gl.po \
+ po/pt_BR.po \
+ po/nl.po \
+ po/templates.pot \
+ po/de.po \
+ po/eu.po \
+ po/ro.po \
+ po/ru.po \
+ po/it.po \
+ po/ca.po \
+ mysql-client-BASE.dirs.in \
+ control.in \
+ libmysqlclientSLIB-dev.dirs.in \
+ mysql-server-PREV.preinst.in \
+ mysql-server.preinst.in \
+ mysql-management-BASE.dirs.in \
+ rules \
+ libmysqlclientSLIB-dev.docs.in
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
+
diff --git a/debian/README.Maintainer b/debian/README.Maintainer
new file mode 100644
index 00000000000..80b484d7a6c
--- /dev/null
+++ b/debian/README.Maintainer
@@ -0,0 +1,99 @@
+###########################################################################
+# Here are some information that are only of interest to the Debiani #
+# maintainers of MySQL. #
+###########################################################################
+
+#
+# Remarks to dependencies
+#
+libwrap0-dev (>= 7.6-8.3)
+ According to bug report 114582 where where build problems on
+ IA-64/sid with at least two prior versions.
+psmisc
+ /usr/bin/killall in the initscript
+
+zlib1g in libmysqlclient-dev:
+ "mysql_config --libs" adds "-lz"
+
+Build-Dep:
+
+debhelper (>=4.1.16):
+ See po-debconf(7).
+
+autoconf (>= 2.13-20), automake1.7
+ Try to get rid of them.
+
+doxygen, tetex-bin, tetex-extra, gs
+ for ndb/docs/*tex
+
+mysql-server-5.0: Pre-Depends: mysql-common
+ This was necessary as mysql-server-5.0.preinst checks for unmodified
+ conffiles from mysql-server-4.1 and copies 5.0 ones over them to avoid
+ unnecessary dpkg questions. As mysql-server-5.0 is not unpacked at its
+ pre-inst stage, it had to copy those files from a package that is
+ definetly already unpacked which does not have to be the case with Depends.
+
+#
+# Remarks to the start scripts
+#
+
+## initscripts rely on mysqladmin from a different package
+We have the problem that "/etc/init.d/mysql stop" relies on mysqladmin which
+is in another package (mysql-client) and a passwordless access that's maybe
+only available if the user configured his /root/.my.cnf. Can this be a problem?
+* normal mode: not because the user is required to have it. Else:
+* purge/remove: not, same as normal mode
+* upgrade: not, same as normal mode
+* first install: not, it depends on mysql-client which at least is unpacked
+ so mysqladmin is there (to ping). It is not yet configured
+ passwordles but if there's a server running then there's a
+ /root/.my.cnf. Anyways, we simply kill anything that's mysqld.
+
+## Passwordless access for the maintainer scripts
+Another issue is that the scripts needs passwordless access. To ensure this
+a debian-sys-maint user is configured which has process and shutdown privs.
+The file with the randomly (that's important!) generated password must be
+present as long as the databases remain installed because else a new install
+would have no access. This file should be used like:
+ mysqladmin --defaults-file=/etc/mysql/debian.cnf restart
+to avoid providing the password in plaintext on a commandline where it would
+be visible to any user via the "ps" command.
+
+## When to start the daemon?
+We aim to give the admin full control on when MySQL is running.
+Issues to be faced here:
+OLD:
+ 1. Debconf asks whether MySQL should be started on boot so update-rc.d is
+ only run if the answer has been yes. The admin is likely to forget
+ this decision but update-rc.d checks for an existing line in
+ /etc/runlevel.conf and leaves it intact.
+ 2. On initial install, if the answer is yes, the daemon has to be started.
+ 3. On upgrades it should only be started if it was already running, everything
+ else is confusing. Especiall relying on an debconf decision made month ago
+ is considered suboptimal. See bug #274264
+ Implementation so far:
+ prerm (called on upgrade before stopping the server):
+ check for a running server and set flag if necessary
+ preinst (called on initial install and before unpacking when upgrading):
+ check for the debconf variable and set flag if necessary
+ postinst (called on initial install and after each upgrade after unpacking):
+ call update-rc.d if debconf says yes
+ call invoce-rc.d if the flag has been set
+ Problems remaining:
+ dpkg-reconfigure and setting mysql start on boot to yes did not start mysql
+ (ok "start on boot" literally does not mean "start now" so that might have been ok)
+NEW:
+ 1. --- no debconf anymore for the sake of simplicity. We have runlevel.conf,
+ the admin should use it
+ 2. On initial install the server is started.
+ 3. On upgrades the server is started exactly if it was running before so the
+ runlevel configuration is irrelevant. It will be preserved by the mean of
+ update-rc.d's builtin check.
+ Implementation:
+ prerm (called on upgrade before stopping the server):
+ check for a running server and set flag if necessary
+ preinst (called on initial install and before unpacking when upgrading):
+ check for $1 beeing (initial) "install" and set flag
+ postinst (called on initial install and after each upgrade after unpacking):
+ call update-rc.d
+ call invoce-rc.d if the flag has been set
diff --git a/debian/additions/my.cnf b/debian/additions/my.cnf
new file mode 100644
index 00000000000..a569c041401
--- /dev/null
+++ b/debian/additions/my.cnf
@@ -0,0 +1,134 @@
+#
+# The MySQL database server configuration file.
+#
+# You can copy this to one of:
+# - "/etc/mysql/my.cnf" to set global options,
+# - "~/.my.cnf" to set user-specific options.
+#
+# One can use all long options that the program supports.
+# Run program with --help to get a list of available options and with
+# --print-defaults to see which it would actually understand and use.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+# This will be passed to all mysql clients
+# It has been reported that passwords should be enclosed with ticks/quotes
+# escpecially if they contain "#" chars...
+# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
+[client]
+port = 3306
+socket = /var/run/mysqld/mysqld.sock
+
+# Here is entries for some specific programs
+# The following values assume you have at least 32M ram
+
+# This was formally known as [safe_mysqld]. Both versions are currently parsed.
+[mysqld_safe]
+socket = /var/run/mysqld/mysqld.sock
+nice = 0
+
+[mysqld]
+#
+# * Basic Settings
+#
+user = mysql
+pid-file = /var/run/mysqld/mysqld.pid
+socket = /var/run/mysqld/mysqld.sock
+port = 3306
+basedir = /usr
+datadir = /var/lib/mysql
+tmpdir = /tmp
+language = /usr/share/mysql/english
+skip-external-locking
+#
+# Instead of skip-networking the default is now to listen only on
+# localhost which is more compatible and is not less secure.
+bind-address = 127.0.0.1
+#
+# * Fine Tuning
+#
+key_buffer = 16M
+max_allowed_packet = 16M
+thread_stack = 128K
+thread_cache_size = 8
+#
+# * Query Cache Configuration
+#
+query_cache_limit = 1048576
+query_cache_size = 16777216
+query_cache_type = 1
+#
+# * Logging and Replication
+#
+# Both location gets rotated by the cronjob.
+# Be aware that this log type is a performance killer.
+#log = /var/log/mysql/mysql.log
+#
+# Error logging goes to syslog. This is a Debian improvement :)
+#
+# Here you can see queries with especially long duration
+#log_slow_queries = /var/log/mysql/mysql-slow.log
+#
+# The following can be used as easy to replay backup logs or for replication.
+#server-id = 1
+log_bin = /var/log/mysql/mysql-bin.log
+# WARNING: Using expire_logs_days without bin_log crashes the server! See README.Debian!
+expire_logs_days = 10
+max_binlog_size = 100M
+#binlog_do_db = include_database_name
+#binlog_ignore_db = include_database_name
+#
+# * BerkeleyDB
+#
+# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
+skip-bdb
+#
+# * InnoDB
+#
+# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
+# Read the manual for more InnoDB related options. There are many!
+# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
+#skip-innodb
+#
+# * Security Features
+#
+# Read the manual, too, if you want chroot!
+# chroot = /var/lib/mysql/
+#
+# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
+#
+# ssl-ca=/etc/mysql/cacert.pem
+# ssl-cert=/etc/mysql/server-cert.pem
+# ssl-key=/etc/mysql/server-key.pem
+
+
+
+[mysqldump]
+quick
+quote-names
+max_allowed_packet = 16M
+
+[mysql]
+#no-auto-rehash # faster start of mysql but no tab completition
+
+[isamchk]
+key_buffer = 16M
+
+#
+# * NDB Cluster
+#
+# See /usr/share/doc/mysql-server-*/README.Debian for more information.
+#
+# The following configuration is read by the NDB Data Nodes (ndbd processes)
+# not from the NDB Management Nodes (ndb_mgmd processes).
+#
+# [MYSQL_CLUSTER]
+# ndb-connectstring=127.0.0.1
+
+
+#
+# * IMPORTANT: Additional settings that can override those from this file!
+#
+!includedir /etc/mysql/conf.d/
+
diff --git a/debian/additions/mysql-server.lintian-overrides b/debian/additions/mysql-server.lintian-overrides
new file mode 100644
index 00000000000..9d741cf16e9
--- /dev/null
+++ b/debian/additions/mysql-server.lintian-overrides
@@ -0,0 +1,2 @@
+W: mysql-dfsg source: maintainer-script-lacks-debhelper-token debian/mysql-server.postinst
+W: mysql-server: possible-bashism-in-maintainer-script postinst:68 'p{("a".."z","A".."Z",0..9)[int(rand(62))]}'
diff --git a/debian/additions/ndb_mgmd.cnf b/debian/additions/ndb_mgmd.cnf
new file mode 100644
index 00000000000..d94a28ff705
--- /dev/null
+++ b/debian/additions/ndb_mgmd.cnf
@@ -0,0 +1,35 @@
+[NDBD DEFAULT]
+NoOfReplicas=2
+DataMemory=10MB
+IndexMemory=25MB
+MaxNoOfTables=256
+MaxNoOfOrderedIndexes=256
+MaxNoOfUniqueHashIndexes=128
+
+[MYSQLD DEFAULT]
+
+[NDB_MGMD DEFAULT]
+
+[TCP DEFAULT]
+
+[NDB_MGMD]
+Id=1 # the NDB Management Node (this one)
+HostName=127.0.0.1
+
+[NDBD]
+Id=2 # the first NDB Data Node
+HostName=127.0.0.1
+DataDir= /var/lib/mysql-cluster
+
+[NDBD]
+Id=3 # the second NDB Data Node
+HostName=127.0.0.1
+DataDir=/var/lib/mysql-cluster
+
+[MYSQLD]
+Id=4 # the first SQL node
+HostName=127.0.0.1
+
+# [MYSQLD]
+# Id=5 # the second SQL node
+# HostName=127.0.0.10
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 00000000000..605619b605c
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,3275 @@
+mysql-5.0 (5.0.42) UNRELEASED; urgency=low
+
+ * Upgraded to 5.0.42 branch.
+
+ -- Monty Taylor <mtaylor@mysql.com> Thu, 19 Apr 2007 22:18:02 +0200
+
+mysql-5.0 (5.0.38) UNRELEASED; urgency=low
+
+ * Imported packaging work from Debian.
+ * Removed debian-start, mysqlreport and echo_stderr to align with official
+ packages.
+
+ -- Monty Taylor <mtaylor@mysql.com> Wed, 7 Mar 2007 07:52:55 +0800
+
+mysql-dfsg-5.0 (5.0.32-3etch1) testing-proposed-updates; urgency=high
+
+ * Backported upstream patch for a bug that crashed the server when using
+ certain join/group/limit combinations.
+ Users of the Joomla CMS seemed to be affected by this. Closes: #403721
+ * The debian-start script that runs on every server start now first upgrades
+ the system tables (if neccessary) and then check them as it sometimes did
+ not work the other way around (e.g. for MediaWiki). The script now uses
+ mysql_update instead of mysql_update_script as recommended. Closes: 409780
+ * The old_passwords setting that is set according to a Debconf question is
+ now written to /etc/mysql/conf.d/old_passwords.cnf instead directly to the
+ conffile /etc/mysql/my.cnf which would be fobidden by policy (thanks to
+ Robert Bihlmeyer). Closes: #409750
+ * Added bison to build dependencies.
+ * Synced Debconf translations with 5.0.32-7.
+
+ -- Christian Hammers <ch@debian.org> Sun, 18 Feb 2007 22:33:05 +0100
+
+mysql-dfsg-5.0 (5.0.32-3) unstable; urgency=high
+
+ * mysql-server-5.0 pre-depends on adduser now and has --disabled-login
+ explicitly added to be on the safe side (thanks to the puiparts team).
+ Closes: #408362
+ * Corrections the terminology regarding NDB in the comments of all config
+ files and init scripts (thanks to Geert Vanderkelen of MySQL).
+ * Updated Swedish Debconf translation (thanks to Andreas Henriksson).
+ Closes: #407859
+ * Updated Czech Debconf translation (thanks to Miroslav Kure).
+ Closes: #407809
+
+ -- Christian Hammers <ch@debian.org> Thu, 11 Jan 2007 11:18:47 +0100
+
+mysql-dfsg-5.0 (5.0.32-2) unstable; urgency=high
+
+ * The last upload suffered from a regression that made NDB totally
+ unusable and caused a dependency to libmysqlclient15-dev in the
+ mysql-server-5.0 package. The relevant 85_* patch was re-added again.
+ Closes: #406435
+ * Added lintian-overrides for an error that does not affect our packages.
+ There are now only warnings and not errors left.
+
+ -- Christian Hammers <ch@debian.org> Tue, 9 Jan 2007 23:55:10 +0100
+
+mysql-dfsg-5.0 (5.0.32-1) unstable; urgency=high
+
+ * New upstream version.
+ * SECURITY: mysql_fix_privilege_tables.sql altered the
+ table_privs.table_priv column to contain too few privileges, causing
+ loss of the CREATE VIEW and SHOW VIEW privileges. (MySQL Bug#20589)
+ * SECURITY (DoS): ALTER TABLE statements that performed both RENAME TO
+ and {ENABLE|DISABLE} KEYS operations caused a server crash. (MySQL
+ Bug#24089)
+ * SECURITY (DoS): LAST_DAY('0000-00-00') could cause a server crash.
+ (MySQL Bug#23653)
+ * SECURITY (DoS): Using EXPLAIN caused a server crash for queries that
+ selected from INFORMATION_SCHEMA in a subquery in the FROM clause.
+ (MySQL Bug#22413)
+ * SECURITY (DoS): Invalidating the query cache (e.g. when using stored procedures)
+ caused a server crash for INSERT INTO ... SELECT statements that
+ selected from a view. (MySQL Bug#20045)
+ * Using mysql_upgrade with a password crashed the server. Closes: #406229
+ * yaSSL crashed on pre-Pentium Intel and Cyrix CPUs. (MySQL Bug#21765)
+ Closes: #383759
+ * Lots of small fixes to the NDB cluster storage engine.
+ * Updated Japanese Debconf template (thanks to Hideki Yamane).
+ Closes: #405793
+ * Fixed comment regarding "mycheck" in debian-start (thanks to
+ Enrico Zini). Closes: #405787
+
+ -- Christian Hammers <ch@debian.org> Sat, 6 Jan 2007 14:26:20 +0100
+
+mysql-dfsg-5.0 (5.0.30-3) unstable; urgency=low
+
+ * Updated Brazilian Debconf translation (thanks to Andre Luis Lopes).
+ Closes: #403821
+ * Added Romanian Debconf translation (thanks to Stan Ioan-Eugen).
+ Closes: #403943
+ * Updated Spanish Debconf translation (thanks to Javier Fernandez-Sanguino
+ Pena). Closes: #404084
+ * Updated Galician Debconf translation (thanks to Jacobo Tarrio).
+ Closes: #404318
+ * Updated Dutch Debconf translation (thanks to Vincent Zweije).
+ Closes: #404566
+ * Updated Danish Debconf translation (thanks to Claus Hindsgaul).
+ Closes: #405018
+
+ -- Christian Hammers <ch@debian.org> Thu, 21 Dec 2006 21:35:09 +0100
+
+mysql-dfsg-5.0 (5.0.30-2) unstable; urgency=high
+
+ * Fixed upstream regression in header files that lead to FTBFS for
+ mysql-admin, mysql-query-browser and probably other pacakges.
+ (thanks to Andreas Henriksson). Closes: #403081, #403082
+ * Fixed some upstream scripts by replacing /etc by /etc/mysql (thanks to
+ Julien Antony). Closes: #401083
+ * Updated French Debconf translation (thanks to Christian Perrier).
+ Closes: #401434
+ * Added Spanish Debconf translation (thanks to Javier Fernandez-Sanguino
+ Pena). Closes: #401953
+ * Marked a Debconf question that is just a dummy and only internally
+ used as not-needing-translation. Closes: #403163
+ * Fixed mysqlslowdump patch to not remove the usage() function (thanks
+ to Monty Tailor).
+
+ -- Christian Hammers <ch@debian.org> Sun, 3 Dec 2006 19:20:10 +0100
+
+mysql-dfsg-5.0 (5.0.30-1) unstable; urgency=low
+
+ * New upstream version (switch to the MySQL Enterprise branch).
+ * Upstream bugfix for the Innodb performance bug:
+ "Very poor performance with multiple queries running
+ concurrently (Bug#15815)".
+ * Upstream bugfix for a possible server crash:
+ "Selecting from a MERGE table could result in a server crash if the
+ underlying tables had fewer indexes than the MERGE table itself
+ (Bug#22937)"
+ * Upstream bugfies for *lot* of NDB problems.
+ * Upstream bugfix for Innodb optimizer bug. Closes: #397597
+ * Updated Italian Debconf translation (thanks to Luca Monducci).
+ Closes: #401305
+ * Updated debian/watch file to MySQL Enterprise branch.
+
+ -- Christian Hammers <ch@debian.org> Sat, 2 Dec 2006 16:36:38 +0100
+
+mysql-dfsg-5.0 (5.0.27-2) unstable; urgency=medium
+
+ * Disabled YaSSL x86 assembler as it was reported to crash applications
+ like pam-mysql or proftpd-mysql which are linked against libmysqlclient
+ on i486 and Cyrix (i586) CPUs. Closes: #385147
+ * Adjusted mysql-server-4.1 priority to extra and section to oldlibs
+ according to the ftp masters overrides.
+ * Updated German Debconf translation (thanks to Alwin Meschede).
+ Closes: #400809
+
+ -- Christian Hammers <ch@debian.org> Wed, 22 Nov 2006 13:36:31 +0100
+
+mysql-dfsg-5.0 (5.0.27-1) unstable; urgency=medium
+
+ * New upstream version (but no codechange, the only difference to 5.0.26
+ was a patch to the ABI change which Debian already included.
+ * When dist-upgrading from mysql-server-4.1/sarge dpkg does not longer
+ ask unnecessary "config file has changed" questions regarding
+ /etc/init.d/mysql, /etc/logrotate.d/mysql-server and
+ /etc/mysql/debian-start just because these files previously belonged
+ to mysql-server-4.1 and not to mysql-server-5.0.
+ To archive this mysql-server-5.0 now pre-depends on mysql-common which
+ provides current versions of those files.
+ * The automatic run mysql_upgrade now works with non-standard datadir
+ settings, too (thanks to Benjami Villoslada). Closes: #394607
+ * Debconf now asks if the old_passwords option is really needed.
+ * Improved explanations of the old_passwords variable in my.cnf.
+ * Removed possibly leftover cron script from MySQL-4.1 (thanks to
+ Mario Oyorzabal Salgado). Closes: #390889
+ * Postrm ignores failed "userdel mysql".
+ * Updated Danish Debconf translation (thanks to Claus Hindsgaul).
+ Closes: #398784
+ * Added Euskarian Debconf translation (thanks to Piarres Beobide).
+ Closes: #399045
+ * Updated Japanese Debconf translation (thanks to Hideki Yamane).
+ Closes: #399074
+ * Updated German Debconf translation (thanks to Alwin Meschede).
+ Closes: #399087
+ * New Portuguese debconf translations from Miguel Figueiredo.
+ Closes: #398186
+
+ -- Christian Hammers <ch@debian.org> Tue, 7 Nov 2006 21:26:25 +0100
+
+mysql-dfsg-5.0 (5.0.26-3) unstable; urgency=high
+
+ [sean finney]
+ * Fix for the deadly ISAM trap. Now during upgrades we will do our
+ very best to convert pre-existing ISAM format tables using the
+ binaries from the previous package. Success is not guaranteed, but
+ this is probably as good as it gets. Note that this also necessitates
+ re-introducing an (empty transitional) mysql-server-4.1 package.
+ Closes: #354544, #354850
+ * Remove a couple spurious and wrongly placed WARNING statements from
+ 45_warn-CLI-passwords.dpatch. thanks to Dan Jacobsen for pointing these
+ out. Closes: #394262
+
+ -- sean finney <seanius@debian.org> Fri, 03 Nov 2006 18:34:46 +0100
+
+mysql-dfsg-5.0 (5.0.26-2) unstable; urgency=high
+
+ * Fixed FTBFS for Alpha by applying an upstream patch (thanks to Falk
+ Hueffner). Closes: #395921
+
+ -- Christian Hammers <ch@debian.org> Sat, 28 Oct 2006 20:13:46 +0200
+
+mysql-dfsg-5.0 (5.0.26-1) unstable; urgency=high
+
+ * SECURITY:
+ This combined release of 5.0.25 and 5.0.26 fixes lot of possible server
+ crashs so it should get into Etch. Quoting the changelog (bug numbers are
+ bugs.mysql.com ones):
+ - character_set_results can be NULL to signify no conversion, but some
+ code did not check for NULL, resulting in a server crash. (Bug#21913)
+ - Using cursors with READ COMMITTED isolation level could cause InnoDB to
+ crash. (Bug#19834)
+ - Some prepared statements caused a server crash when executed a second
+ time. (Bug#21166)
+ - When DROP DATABASE or SHOW OPEN TABLES was issued while concurrently
+ issuing DROP TABLE (or RENAME TABLE, CREATE TABLE LIKE or any other
+ statement that required a name lock) in another connection, the server
+ crashed. (Bug#21216)
+ - Use of zero-length variable names caused a server crash. (Bug#20908)
+ - For InnoDB tables, the server could crash when executing NOT IN ()
+ subqueries. (Bug#21077)
+ - Repeated DROP TABLE statements in a stored procedure could sometimes
+ cause the server to crash. (Bug#19399)
+ - Performing an INSERT on a view that was defined using a SELECT that
+ specified a collation and a column alias caused the server to crash
+ (Bug#21086).
+ - A query of the form shown here caused the server to crash. (Bug#21007)
+ - NDB Cluster: Some queries involving joins on very large NDB tables could
+ crash the MySQL server. (Bug#21059)
+ - The character set was not being properly initialized for CAST() with a
+ type like CHAR(2) BINARY, which resulted in incorrect results or even a
+ server crash. (Bug#17903)
+ - For certain queries, the server incorrectly resolved a reference to an
+ aggregate function and crashed. (Bug#20868)
+ - The server crashed when using the range access method to execut a
+ subquery with a ORDER BY DESC clause. (Bug#20869)
+ - Triggers on tables in the mysql database caused a server crash. Triggers
+ for tables in this database now are disallowed. (Bug#18361)
+ - Using SELECT on a corrupt MyISAM table using the dynamic record format
+ could cause a server crash. (Bug#19835)
+ - Use of MIN() or MAX() with GROUP BY on a ucs2 column could cause a
+ server crash. (Bug#20076)
+ - Selecting from a MERGE table could result in a server crash if the
+ underlying tables had fewer indexes than the MERGE table itself.
+ (Bug#21617, Bug#22937)
+
+ * New upstream release.
+ - This bug would cause trouble for Sarge->Etch upgrades, it was supposed to
+ have been fixed in 5.0.16 but that apparently did not fix the whole
+ problem:
+ Using tables from MySQL 4.x in MySQL 5.x, in particular those with VARCHAR
+ fields and using INSERT DELAYED to update data in the table would result in
+ either data corruption or a server crash. (Bug#16611, Bug#16218, Bug#17294)
+ Closes: #386337
+ - Fixes data corruption as an automatic client reconnect used to set
+ the wrong character set. Closes: #365050
+ - Fixes an undefined ulong type in an include file. Closes: #389102
+ - Fixes wrong output format when using Unicode characters. Closes: #355302
+ - Fixes mysql_upgrade when using a password. Closes: #371841
+
+ [Christian Hammers]
+ * Removed --sysconfdir from debian/rules as it puts /etc/mysql/ at the
+ end of the my.cnf search patch thus overriding $HOME/my.cnf
+ (thanks to Christoph Biedl). Closes: #394992
+ * The provided patch from bug #385947 was wrong, the variable is called
+ BLOCKSIZE not BLOCK_SIZE according to "strings `which df`" (thanks to
+ Bruno Muller). Closes: #385947
+
+ [sean finney]
+ * new dutch debconf translations from Vincent Zweije (closes: #392809).
+ * new japanese debconf translations from Hideki Yamane (closes: #391625).
+ * new italian debconf translations from Luca Monducci (closes: #391741).
+ * new french debconf translations from Christian Perrier (closes: #393334).
+ * ran debconf-updatepo to merge the fuzzies into svn.
+ * massage the following patches so they continue to apply cleanly:
+ - 44_scripts__mysql_config__libs.dpatch to cleanly apply.
+ - 45_warn-CLI-passwords.dpatch
+ - 96_TEMP__libmysqlclient_ssl_symbols.dpatch (note, this patch might
+ no longer be needed, but is retained "just in case" after massaging it)
+ * the following patches have been incorporated upstream:
+ - 70_kfreebsd.dpatch
+ - 80_hurd_mach.dpatch
+ - 87_ps_Hurd.dpatch
+ - 90_TEMP__client__mysql_upgrade__O_EXEC.dpatch
+ - 91_TEMP__client__mysql_upgrade__password.dpatch
+ - 92_TEMP__client__mysql_upgrade__defaultgroups.dpatch
+ - 94_TEMP__CVE-2006-4227.dpatch
+ - 95_TEMP__CVE-2006-4226.dpatch
+ * the udf_example.cc has disappeared from the source code, but there's
+ a udf_example.c which seems to be a good example to use instead :)
+ * update documentation in the configuration to no longer reference
+ using my.cnf in the DATADIR, as it's never been the recommended
+ method for debian systems and hasn't worked since 5.0 was released
+ anyway (closes: #393868).
+
+ -- Christian Hammers <ch@debian.org> Wed, 25 Oct 2006 19:54:04 +0200
+
+mysql-dfsg-5.0 (5.0.24a-9) unstable; urgency=medium
+
+ * Having expire_logs_days enabled but log-bin not crashes the server. Using
+ both or none of those options is safe. To prevent this happening during the
+ nightly log rotation via /etc/logrotate.d/mysql the initscript checks for
+ malicious combination of options. See: #368547
+ * The Sarge package "mysql-server" which used to include the mysqld daemon
+ may still be in unselected-configured state (i.e. after a remove but not
+ purge) in which case its now obsolete cronscript has to be moved away
+ (thanks to Charles Lepple). Closes: #385669
+ * Updated Danish Debconf translation (thanks to Claus Hindsgaul).
+ Closes: #390315
+ * Updated Frensh Debconf translation (thanks to Christian Perrier).
+ Closes: #390980
+
+ -- Christian Hammers <ch@debian.org> Tue, 3 Oct 2006 14:55:31 +0200
+
+mysql-dfsg-5.0 (5.0.24a-8) unstable; urgency=low
+
+ * (broken upload)
+
+ -- Christian Hammers <ch@debian.org> Tue, 3 Oct 2006 14:55:31 +0200
+
+mysql-dfsg-5.0 (5.0.24a-7) unstable; urgency=low
+
+ * Stopped mysql_config from announcing unnecessary library dependencies
+ which until now cause "NEEDED" dependencies in the "readelf -d" output
+ of libraries who only depend on libmysqlclient.so (thanks to Michal
+ Cihar). Closes: #390692
+
+ -- Christian Hammers <ch@debian.org> Sun, 1 Oct 2006 23:59:43 +0200
+
+mysql-dfsg-5.0 (5.0.24a-6) unstable; urgency=low
+
+ [sean finney]
+ * finally add support for setting a root password at install.
+ while this is not a random password as requested in one bug
+ report, we believe it is the best solution and provides a
+ means to set a random password via preseeding if it's really
+ desired (Closes: #316127, #298295).
+
+ -- sean finney <seanius@debian.org> Sun, 01 Oct 2006 23:34:30 +0200
+
+mysql-dfsg-5.0 (5.0.24a-5) unstable; urgency=low
+
+ * Added ${shlibs:Depends} to debian/control section libmysqlclient-dev as it
+ contains the experimental /usr/lib/mysql/libndbclient.so.0.0.0.
+ * Bumped standards version to 3.7.2.
+ * Added LSB info section to init scripts.
+ * Rephrased Debconf templates as suggested by lintian.
+ * Added benchmark suite in /usr/share/mysql/sql-bench/.
+ * The mysql.timezone* tables are now filled by the postinst script (thanks
+ to Mark Sheppard). Closes: #388491
+ * Moved Debconf install notes to README.Debian. Displaying them with
+ medium priority was a bug anyway. Closes: #388941
+ * Replaced /usr/bin/mysql_upgrade by /usr/bin/mysql_upgrade_shell in
+ /etc/mysql/debian-start.sh as it works without errors (thanks to Javier
+ Kohen). Closes: #389443
+
+ -- Christian Hammers <ch@debian.org> Wed, 20 Sep 2006 15:01:42 +0200
+
+mysql-dfsg-5.0 (5.0.24a-4) unstable; urgency=high
+
+ * libmysqlclient.so.15 from 5.0.24 accidentaly exports some symbols that are
+ historically exported by OpenSSL's libcrypto.so. This bug was supposed to
+ be fixed in 5.0.24a bug according to the mysql bug tracking system will
+ only be fixed in 5.0.25 so I backported the patch. People already reported
+ crashing apps due to this (thanks to Duncan Simpson). See also: #385348
+ Closes: #388262
+ * Fixed BLOCKSIZE to BLOCK_SIZE in initscript (thanks to Bruno Muller).
+ Closes: #385947
+ * Added hint to "--extended-insert=0" to mysqldump manpage (thanks to Martin
+ Schulze).
+ * Documented the meaning of "NDB" in README.Debian (thanks to Dan Jacobson).
+ Closes: #386274
+ * Added patch to build on hurd-i386 (thanks to Cyril Brulebois). Closes: #387369
+ * Fixed debian-start script to work together with the recend LSB modifications in
+ the initscript (thanks to wens). Closes: #387481
+ * Reverted tmpdir change in my.cnf back to /tmp to comply with FHS (thanks
+ to Alessandro Valente). Closes: #382778
+ * Added logcheck filter rule (thanks to Paul Wise). Closes: #381043
+ * I will definetly not disable InnoDB but added a note to the default my.cnf
+ that disabling it saves about 100MB virtual memory (thanks to Olivier
+ Berger). Closes: #384399
+ * Added thread_cache_size=8 to default my.cnf as this variable seems to have
+ a negligible memory footprint but can improve performance when lots of
+ threads connect simultaneously as often seen on web servers.
+
+ -- Christian Hammers <ch@debian.org> Mon, 4 Sep 2006 00:21:50 +0200
+
+mysql-dfsg-5.0 (5.0.24a-3) unstable; urgency=low
+
+ * Fixed potential tempfile problem in the newly added mysqlreport script.
+
+ -- Christian Hammers <ch@debian.org> Sun, 3 Sep 2006 23:17:24 +0200
+
+mysql-dfsg-5.0 (5.0.24a-2) unstable; urgency=low
+
+ * Added "mysqlreport" (GPL'ed) from hackmysql.com.
+ * Temporarily disabled expire_days option as it causes the server
+ to crash. See #368547
+ * Made output of init scripts LSB compliant (thanks to David Haerdeman).
+ Closes: #385874
+
+ -- Christian Hammers <ch@debian.org> Sun, 3 Sep 2006 19:06:53 +0200
+
+mysql-dfsg-5.0 (5.0.24a-1) unstable; urgency=high
+
+ * New upstream version.
+ * The shared library in the 5.0.24 upstream release accidently exported
+ some symbols that are also exported by the OpenSSL libraries (notably
+ BN_bin2bn) causing unexpected behaviour in applications using these
+ functions (thanks to Peter Cernak). Closes: #385348
+ * Added note about possible crash on certain i486 clone CPUs.
+ * Made recipient address of startup mysqlcheck output configurable
+ (thanks to Mattias Guns). Closes: #385119
+
+ -- Christian Hammers <ch@debian.org> Mon, 28 Aug 2006 01:22:12 +0200
+
+mysql-dfsg-5.0 (5.0.24-3) unstable; urgency=high
+
+ * SECURITY:
+ CVE-2006-4226:
+ When run on case-sensitive filesystems, MySQL allows remote
+ authenticated users to create or access a database when the database
+ name differs only in case from a database for which they have
+ permissions.
+ CVE-2006-4227:
+ MySQL evaluates arguments of suid routines in the security context of
+ the routine's definer instead of the routine's caller, which allows
+ remote authenticated users to gain privileges through a routine that
+ has been made available using GRANT EXECUTE.
+ Thanks to Stefan Fritsch for reporting. Closes: #384798
+
+ -- Christian Hammers <ch@debian.org> Sat, 26 Aug 2006 04:55:17 +0200
+
+mysql-dfsg-5.0 (5.0.24-2) unstable; urgency=high
+
+ * 5.0.24-1 introduced an ABI incompatibility, which this patch reverts.
+ Programs compiled against 5.0.24-1 are not compatible with any other
+ version and needs a rebuild.
+ This bug already caused a lot of segfaults and crashes in various
+ programs. Thanks to Chad MILLER from MySQL for quickly providing a patch.
+ The shlibdeps version has been increased to 5.0.24-2.
+ Closes: #384047, #384221, #383700
+
+ -- Christian Hammers <ch@debian.org> Fri, 25 Aug 2006 21:47:35 +0200
+
+mysql-dfsg-5.0 (5.0.24-1) unstable; urgency=high
+
+ * SECURITY: Upstream fixes a security bug which allows a user to continue
+ accessing a table using a MERGE TABLE after the right to direct access to
+ the database has been revoked (CVE-2006-4031, MySQL bug #15195).
+ (Well they did not exactly fixed it, they documented the behaviour and
+ allow the admin to disable merge table alltogether...). Closes: #380271
+ * SECURITY: Applied patch that fixes a possibly insecure filehandling
+ in the recently added mysql_upgrade binary file (MySQL bug #10320).
+ * New upstream version.
+ - Fixes nasty MySQL bug #19618 that leads to crashes when using
+ "SELECT ... WHERE ... not in (1, -1)" (e.g. vbulletin was affected).
+ - Fixes upstream bug #16803 so that linking ~/.mysql_history to /dev/null
+ now has the desired effect of having no history.
+ * Really fixed the runlevels. Closes: #377651
+ * Added patch for broken upstream handling of "host=" to mysql_upgrade.c.
+ * Adjusted /etc/mysql/debian-start to new mysql_upgrade.c
+
+ -- Christian Hammers <ch@debian.org> Tue, 8 Aug 2006 00:44:13 +0200
+
+mysql-dfsg-5.0 (5.0.22-5) unstable; urgency=low
+
+ * Added further line to the logcheck ignore files (thanks to Paul Wise).
+ Closes: #381038
+
+ -- Christian Hammers <ch@debian.org> Wed, 2 Aug 2006 00:28:50 +0200
+
+mysql-dfsg-5.0 (5.0.22-4) unstable; urgency=low
+
+ * Upstream fixes a bug in the (never released) version 5.0.23 which could
+ maybe used to crash the server if the mysqlmanager daemon is in use
+ which is not yet the default in Debian. (CVE-2006-3486 *DISPUTED*)
+ * Changed runlevel priority of mysqld from 20 to 19 so that it gets started
+ before apache and proftpd etc. which might depend on an already running
+ database server (thanks to Martin Gruner). Closes: #377651
+ * Added patch which sets PATH_MAX in ndb (thanks to Cyril Brulebois).
+ Closes: #378949
+ * Activated YaSSL as licence issues are settled according to:
+ http://bugs.mysql.com/?id=16755. This also closes the FTBFS bug
+ regarding OpenSSL as it is discouraged to use now. Closes: #368639
+ * Removed SSL-MINI-HOWTO as the official documentation is good enough now.
+ * mysql_upgrade no longer gives --password on the commandline which would
+ be insecure (thanks to Dean Gaudet). Closes: #379199
+ * Adjusted debian/patches/45* to make consecutive builds in the same source
+ tree possible (thanks to Bob Tanner). Closes: #368661
+ * mysql-server-5.0 is now suggesting tinyca as yaSSL is enabled and tinyca
+ was found to be really cool :)
+ * Moved tempdir from /tmp to /var/tmp as it will more likely have enough
+ free space as /tmp is often on the root partition and /var or at least
+ /var/tmp is on a bigger one.
+
+ -- Christian Hammers <ch@debian.org> Mon, 10 Jul 2006 23:30:26 +0200
+
+mysql-dfsg-5.0 (5.0.22-3) unstable; urgency=low
+
+ * Added patch for MySQL bug #19618: "select x from x
+ where x not in(1,-1)" may crash the server" (thanks to
+ Ruben Puettmann).
+
+ -- Christian Hammers <ch@debian.org> Fri, 9 Jun 2006 01:41:44 +0200
+
+mysql-dfsg-5.0 (5.0.22-2) unstable; urgency=high
+
+ * Fixed debian-sys-maint related bug in postinst (thanks to
+ Jean-Christophe Dubacq). Closes: #369970
+ * The last upload was a security patch (which I did not know as I
+ uploaded before the announcement came). I now added the CVE id for
+ reference and set urgency to high as the last entry did not.
+
+ -- Christian Hammers <ch@debian.org> Wed, 31 May 2006 01:04:11 +0200
+
+mysql-dfsg-5.0 (5.0.22-1) unstable; urgency=low
+
+ * SECURITY: This upstream release fixes an SQL-injection with multibyte
+ encoding problem. (CVE-2006-2753)
+ * New upstream release.
+ * Upstream fixes REPAIR TABLE problem. Closes: #354300
+ * Upstream fixes problem that empty strings in varchar and text columns
+ are displayed as NULL. Closes: #368663
+
+ -- Christian Hammers <ch@debian.org> Tue, 30 May 2006 23:43:24 +0200
+
+mysql-dfsg-5.0 (5.0.21-4) unstable; urgency=low
+
+ * Added "BLOCKSIZE=" to the diskfree check (thanks to Farzad FARID).
+ Closes: #367027, #367083
+ * Further fixed mysql_upgrade upstream script (thanks to Andreas Pakulat)
+ Closes: #366155
+ * Adjusted the /proc test in debian/rules from /proc/1 to /proc/self
+ to make building on grsec systems possible (thanks to K. Rosenegger).
+ Closes: #366824
+ * Updated Russion Debconf translation (thanks to Yuriy Talakan).
+ Closes: #367141
+ * Updated Czech Debconf translation (thanks to Kiroslav Kure).
+ Closes: #367160
+ * Updated Galician Debconf translation (thanks to Jacobo Tarrio).
+ Closes: #367384
+ * Updated Swedish Debconf translation (thanks to Daniel Nylander).
+ Closes: #368186
+
+ -- Christian Hammers <ch@debian.org> Wed, 10 May 2006 08:45:42 +0200
+
+mysql-dfsg-5.0 (5.0.21-3) unstable; urgency=low
+
+ * Fixed FTBFS problem which was caused by a patch that modifies Makefile.am
+ as well as Makefile.in and was not deteced because my desktop was fast
+ enough to patch both files within the same second and so fooled automake.
+ (thanks to Blars Blarson for notifying me). Closes: #366534
+
+ -- Christian Hammers <ch@debian.org> Sat, 6 May 2006 19:03:58 +0200
+
+mysql-dfsg-5.0 (5.0.21-2) unstable; urgency=low
+
+ * Fixed bug in postinst that did not correctly rewrite
+ /etc/mysql/debian.cnf (thanks to Daniel Leidert).
+ Closes: #365433, #366155
+
+ -- Christian Hammers <ch@debian.org> Thu, 4 May 2006 02:37:03 +0200
+
+mysql-dfsg-5.0 (5.0.21-1) unstable; urgency=high
+
+ * SECURITY: New upstream release with some security relevant bugfixes:
+ * "Buffer over-read in check_connection with usernames lacking a
+ trailing null byte" (CVE-2006-1516)
+ * "Anonymous Login Handshake - Information Leakage" (CVE-2006-1517)
+ * "COM_TABLE_DUMP Information Leakage and Arbitrary command execution"
+ (CVE-2006-1518)
+ Closes: #365938, #365939
+ * Added diskfree check to the init script (thanks to Tim Baverstock).
+ Closes: #365460
+ * First amd64 upload!
+
+ -- Christian Hammers <ch@debian.org> Sat, 29 Apr 2006 04:31:27 +0200
+
+mysql-dfsg-5.0 (5.0.20a-2) unstable; urgency=low
+
+ * The new mysql-upgrade which is started from /etc/mysql/debian-start
+ does now use the debian-sys-maint user for authentication (thanks to
+ Philipp). Closes: #364991
+ * Wrote patch debian/patches/43* which adds a password option to
+ mysql_update. See MySQL bug #19400.
+ * Added "Provides: libmysqlclient-dev" to libmysqlclient15-dev as I saw no
+ obvious reasons against it (problems should be documented in
+ debian/README.Maintainer!) (thanks to Olaf van der Spek). Closes: #364899
+ * Updated Netherlands debconf translation (thanks to Vincent Zweije)
+ Closes: #364464
+ * Updated French debconf translation (thanks to Christian Perrier)
+ Closes: #364401
+ * Updated Danish debconf translation (thanks to Claus Hindsgaul)
+ Closes: #365135
+
+ -- Christian Hammers <ch@debian.org> Wed, 26 Apr 2006 01:14:53 +0200
+
+mysql-dfsg-5.0 (5.0.20a-1) unstable; urgency=low
+
+ * New upstream release.
+ * Added the new mysql_upgrade script and added it to
+ /etc/mysql/debian-start (thanks to Alessandro Polverini).
+ The script is currently very noise that is a known bug and will be
+ fixed in the next release!
+ Closes: #363458
+ * No longer creates the "test" database. This actuallay had been tried
+ to archive before (at least patches) exists but apparently was not the
+ case in the last versions (thanks to Olaf van der Spek). Closes: #362126
+ * Reformatted libmysqlclient15off.NEWS.Debian to changelog format
+ (thanks to Peter Palfrader). Closes: #363062
+
+ -- Christian Hammers <ch@debian.org> Sat, 15 Apr 2006 13:05:22 +0200
+
+mysql-dfsg-5.0 (5.0.20-1) unstable; urgency=high
+
+ * Upstream contains a fix for a nasty bug (MySQL#18153) that users
+ already experienced and that caused corrupted triggers after
+ REPAIR/OPTIMIZE/ALTER TABLE statements.
+ (thanks to Jerome Despatis for pointing out)
+ * Added patch for the "updates on multiple tables is buggy after
+ upgrading from 4.1 to 5.0" problem which MySQL has been committed
+ for the upcoming 5.0.21 release. Closes #352704
+ * Added Netherlands debconf translation (thanks to Vincent Zweije).
+ Closes: #360443
+ * Added Galician debconf translation (thanks to Jacobo Tarrio).
+ Closes: #361257
+
+ -- Christian Hammers <ch@debian.org> Fri, 7 Apr 2006 00:00:43 +0200
+
+mysql-dfsg-5.0 (5.0.19-3) unstable; urgency=high
+
+ [ Christian Hammers ]
+ * Fixed libmysqlclient15.README.Debian regarding package name changes
+ (thanks to Leppo).
+ * Moved libheap.a etc. back to /usr/lib/mysql/ as their names are just
+ too generic. Closes: #353924
+ [ Sean Finney ]
+ * updated danish debconf translation, thanks to Claus Hindsgaul
+ (closes: #357424).
+ [ Adam Conrad ]
+ * Send stderr from 'find' in preinst to /dev/null to tidy up chatter.
+ * Backport patch for CVE-2006-0903 from the upcoming release to resolve
+ a log bypass vulnerability when using non-binary logs (closes: #359701)
+
+ -- Adam Conrad <adconrad@0c3.net> Tue, 4 Apr 2006 15:23:18 +1000
+
+mysql-dfsg-5.0 (5.0.19-2) unstable; urgency=medium
+
+ * New upstream release.
+ * Renamed package libmysqlclient15 to libmysqlclient15off due to
+ binary incompatible changes.
+ See /usr/share/doc/libmysqlclient15off/README.Debian
+ * Updated Czech debconf translation (thanks to Miroslav Kure).
+ Closes: #356503
+ * Updated French debconf translation (thanks to Christian Perrier).
+ Closes: #356332
+ * Improved README.Debian (thanks to Olaf van der Spek). Closes: #355702
+ * Fixed 5.0.18-8 changelog by saying in which package the NEWS.Debian
+ file is (thanks to Ross Boylan). Closes: #355978
+
+ -- Christian Hammers <ch@debian.org> Fri, 17 Mar 2006 02:32:19 +0100
+
+mysql-dfsg-5.0 (5.0.19-1) experimental; urgency=medium
+
+ * New upstream release.
+ * SECURITY: CVE-2006-3081: A bug where str_to_date(1,NULL) lead to a
+ server crash has been fixed.
+ (this note has been added subsequently for reference)
+ * Renamed package libmysqlclient15 to libmysqlclient15off.
+ See /usr/share/doc/libmysqlclient15off/NEWS.Debian
+ * Updated Czech debconf translation (thanks to Miroslav Kure).
+ Closes: #356503
+ * Updated French debconf translation (thanks to Christian Perrier).
+ Closes: #356332
+ * Improved README.Debian (thanks to Olaf van der Spek). Closes: #355702
+ * Fixed 5.0.18-8 changelog by saying in which package the NEWS.Debian
+ file is (thanks to Ross Boylan). Closes: #355978
+
+ -- Christian Hammers <ch@debian.org> Tue, 14 Mar 2006 22:56:13 +0100
+
+mysql-dfsg-5.0 (5.0.18-9) unstable; urgency=medium
+
+ [ Christian Hammers ]
+ * When using apt-get the check for left-over ISAM tables can abort the
+ installation of mysql-server-5.0 but not prevent the mysql-server-4.1
+ package from getting removed. The only thing I can do is reflect this
+ in the Debconf notice that is shown and suggest to reinstall
+ mysql-server-4.1 for converting. See: #354850
+ * Suggests removing of /etc/cron.daily/mysql-server in last NEWS message
+ (thanks to Mourad De Clerck). Closes: #354111
+ * Added versioned symbols for kfreebsd and Hurd, too (thanks to Aurelien
+ Jarno and Michael Bank). Closes: #353971
+ * Added versioned symbols for kfreebsd, too (thanks to Aurelien Jarno).
+ Closes: #353971
+ [ Adam Conrad ]
+ * Add 39_scripts__mysqld_safe.sh__port_dir.dpatch to ensure that the
+ permissions on /var/run/mysqld are always correct, even on a tmpfs.
+
+ -- Christian Hammers <ch@debian.org> Mon, 6 Mar 2006 21:42:13 +0100
+
+mysql-dfsg-5.0 (5.0.18-8) unstable; urgency=low
+
+ * The rotation of the binary logs is now configured via
+ expire-logs-days in /etc/mysql/my.cnf and handled completely
+ by the server and no longer in configured in debian-log-rotate.conf
+ and handled by a cron job. Thanks to David Johnson.
+ See /usr/share/doc/mysql-server-5.0/NEWS.Debian
+ * Ran aspell over some files in debian/ and learned a lot :)
+ * debian/rules: Added check if versioned symbols are really there.
+ * Updated SSL-MINI-HOWTO.
+ * Updated copyright (removed the parts regarding the now removed
+ BerkeleyDB table handler and mysql-doc package).
+ * Relocated a variable in preinst (thanks to Michael Heldebrant).
+ Closes: #349258, #352587, #351216
+ * Updated Danish debconf translation (thanks to Claus Hindsgaul).
+ Closes: #349013
+ * Updated Swedish debconf translation (thanks to Daniel Nylander).
+ Closes: #349522
+ * Updated French debconf translation (thanks to Christian Perrier).
+ Closes: #349592
+ * Fixed typo in README.Debian (thanks to Vincent Ricard).
+ * Prolonged waiting time for mysqld in the init script. Closes: #352070
+
+ -- Christian Hammers <ch@debian.org> Mon, 23 Jan 2006 23:13:46 +0100
+
+mysql-dfsg-5.0 (5.0.18-7) unstable; urgency=low
+
+ * Made mailx in debian-start.inc.sh optional and changed the dependency on it
+ on it to a mere recommendation. Closes: #316297
+ * the previous FTBFS patches for GNU/Hurd inadvertently led to configure
+ being regenerating, losing a couple trivial things like our versioned
+ symbols patch, causing many nasty problems (closes: #348854).
+
+ -- sean finney <seanius@debian.org> Fri, 20 Jan 2006 20:59:27 +0100
+
+mysql-dfsg-5.0 (5.0.18-6) unstable; urgency=low
+
+ * Added version comment (thanks to Daniel van Eeden).
+ * Added two patches to build on GNU/Hurd (thanks to Michael Bank).
+ Closes: #348182
+ * Abort upgrade if old and now unsupported ISAM tables are present
+ (thanks to David Coe). Closes: #345895
+
+ -- Christian Hammers <ch@debian.org> Tue, 17 Jan 2006 19:25:59 +0100
+
+mysql-dfsg-5.0 (5.0.18-5) unstable; urgency=low
+
+ * Bump shlibdeps for libmysqlclient15 to (>= 5.0.15-1), which was
+ the first non-beta release from upstream, as well as being shortly
+ after we broke the ABI in Debian by introducing versioned symbols.
+
+ -- Adam Conrad <adconrad@0c3.net> Fri, 13 Jan 2006 13:18:03 +1100
+
+mysql-dfsg-5.0 (5.0.18-4) unstable; urgency=low
+
+ * Munge our dependencies further to smooth upgrades even more, noting
+ that we really need 5.0 to conflict with 4.1, and stealing a page from
+ the book of mysql-common, it doesn't hurt to hint package managers in
+ the direction of "hey, this stuff is a complete replacement for 4.1"
+ * Change the description of mysql-server and mysql-client to remove the
+ references to it being "transition", and instead point out that it's
+ the way to get the "current best version" of each package installed.
+
+ -- Adam Conrad <adconrad@0c3.net> Wed, 11 Jan 2006 11:39:45 +1100
+
+mysql-dfsg-5.0 (5.0.18-3) unstable; urgency=low
+
+ * Make the mysql-{client,server}-5.0 conflict against mysql-{client,server}
+ versioned, so they can be installed side-by-side and upgrade properly.
+ * Add myself to Uploaders; since I have access to the alioth repository.
+
+ -- Adam Conrad <adconrad@0c3.net> Tue, 10 Jan 2006 19:15:48 +1100
+
+mysql-dfsg-5.0 (5.0.18-2) unstable; urgency=low
+
+ * Removed the transitional package that forced an upgrade from
+ mysql-server-4.1 to mysql-server-5.0 as I was convinced that
+ having a general "mysql-server" package with adjusted dependencies
+ is enough (thanks to Adam Conrad).
+ * Updated logcheck.ignore files (thanks to Jamie McCarthy). Closes: #340193
+
+ -- Christian Hammers <ch@debian.org> Mon, 9 Jan 2006 21:54:53 +0100
+
+mysql-dfsg-5.0 (5.0.18-1) unstable; urgency=low
+
+ * New upstream version.
+ * Added empty transitional packages that force an upgrade from the
+ server and client packages that have been present in Sarge.
+ * Fixed SSL-MINI-HOWTO (thanks to Jonas Smedegaard). Closes: #340589
+
+ -- Christian Hammers <ch@debian.org> Mon, 2 Jan 2006 21:17:51 +0100
+
+mysql-dfsg-5.0 (5.0.17-1) unstable; urgency=low
+
+ * Never released as Debian package.
+
+ -- Christian Hammers <ch@debian.org> Thu, 22 Dec 2005 07:49:52 +0100
+
+mysql-dfsg-5.0 (5.0.16-1) unstable; urgency=low
+
+ * New upstream version.
+ * Removed the error logs from the logrotate script as Debian does
+ not use them anymore. Closes: #339628
+
+ -- Christian Hammers <ch@debian.org> Tue, 22 Nov 2005 01:19:11 +0100
+
+mysql-dfsg-5.0 (5.0.15-2) unstable; urgency=medium
+
+ * Added 14_configure__gcc-atomic.h.diff to fix FTBFS on m68k
+ (thanks to Stephen R Marenka). Closes: #337082
+ * Removed dynamic linking against libstdc++ as it was not really
+ needed (thanks to Adam Conrad). Closes: #328613
+ * Fixed the "/var/lib/mysql is a symlink" workaround that accidently
+ left a stalled symlink (thanks to Thomas Lamy). Closes: #336759
+ * As the init script cannot distinguish between a broken startup and
+ one that just takes very long the "failed" message now says
+ "or took more than 6s" (thanks to Olaf van der Spek). Closes: #335547
+
+ -- Christian Hammers <ch@debian.org> Thu, 3 Nov 2005 22:00:15 +0100
+
+mysql-dfsg-5.0 (5.0.15-1) unstable; urgency=low
+
+ * New upstream version. 5.0 has finally been declared STABLE!
+ * Added small patch to debian/rules that fixed sporadic build errors
+ where stdout and stderr were piped together, got mixed up and broke
+ * Added --with-big-tables to ./configure (thanks to tj.trevelyan).
+ Closes: #333090
+ * Added capability to parse "-rc" to debian/watch.
+ * Fixed cronscript (thanks to Andrew Deason). Closes: #335244
+ * Added Swedish debconf translation (thanks to Daniel Nylander).
+ Closes: #333670
+ * Added comment to README.Debian regarding applications that manually
+ set new-style passwords... Closes: #334444
+ * Sean Finney:
+ - Fix duplicate reference to [-e|--extended-insert]. Closes: #334957
+ - Fix default behavior for mysqldumpslow. Closes: #334517
+ - Reference documentation issue in mysql manpage. Closes: #335219
+
+ -- Christian Hammers <ch@debian.org> Fri, 30 Sep 2005 00:10:39 +0200
+
+mysql-dfsg-5.0 (5.0.13rc-1) unstable; urgency=low
+
+ * New upstream release. Now "release-candidate"!
+ * Removed any dynamic link dependencies to libndbclient.so.0 which
+ is due to its version only distributed as a static library.
+ * Sean Finney:
+ - FTBFS fix related to stripping rpath in debian/rules
+
+ -- Christian Hammers <ch@debian.org> Mon, 26 Sep 2005 22:09:26 +0200
+
+mysql-dfsg-5.0 (5.0.12beta-5) unstable; urgency=low
+
+ * The recent FTBFS were probably result of a timing bug in the
+ debian/patches/75_*.dpatch file where Makefile.in got patched just
+ before the Makefile.shared which it depended on. For that reason
+ only some of the autobuilders failed. Closes: #330149
+ * Fixed chrpath removal (option -k had to be added).
+ * Corrected debconf dependency as requested by Joey Hess.
+
+ -- Christian Hammers <ch@debian.org> Mon, 26 Sep 2005 18:37:07 +0200
+
+mysql-dfsg-5.0 (5.0.12beta-4) unstable; urgency=low
+
+ * Removed experimental shared library libndbclient.so.0.0.0 as it
+ is doomed to cause trouble as long as it is present in both MySQL 4.1
+ and 5.0 without real soname and its own package. We still have
+ libndbclient.a for developers. (thanks to Adam Conrad and
+ mediaforest.net). Closes: #329772
+
+ -- Christian Hammers <ch@debian.org> Fri, 23 Sep 2005 12:36:48 +0200
+
+mysql-dfsg-5.0 (5.0.12beta-3) unstable; urgency=medium
+
+ * Symbol versioning support! wooooohoooooo!
+ (thanks to Steve Langasek) Closes: #236288
+ * Moved libndbcclient.so.0 to the -dev package as it is provided by
+ libmysqlclient14 and -15 which must be installable simultaneously.
+ * Removed mysql-*-doc suggestions.
+
+ -- Christian Hammers <ch@debian.org> Tue, 20 Sep 2005 00:07:03 +0200
+
+mysql-dfsg-5.0 (5.0.12beta-2) unstable; urgency=low
+
+ * Added patch to build on GNU/kFreeBSD (thanks to Aurelien Jarno).
+ Closes: #327702
+ * Added patch that was already been present on the 4.1 branch which
+ makes the "status" command of the init script more sensible
+ (thanks to Stephen Gildea). Closes: #311836
+ * Added Vietnamese Debconf translation (thanks to Clytie Siddal).
+ Closes: #313006
+ * Updated German Debconf translation (thanks to Jens Seidel).
+ Closes: #313957
+ * Corrected commends in example debian-log-rotate.conf. The default is
+ unlike the mysql-sever-4.1 package which needed to stay backwards
+ compatible now 2 to avoid filling up the disk endlessly.
+ * Fixed watch file to be "-beta" aware.
+
+ -- Christian Hammers <ch@debian.org> Thu, 15 Sep 2005 20:50:19 +0200
+
+mysql-dfsg-5.0 (5.0.12beta-1) unstable; urgency=medium
+
+ * Christian Hammers:
+ - New upstream release.
+ - Changed build-dep to libreadline5-dev as requested by Matthias Klose.
+ Closes: #326316
+ - Applied fix for changed output format of SHOW MASTER LOGS for
+ binary log rotation (thanks to Martin Krueger). Closes: #326427, #326427
+ - Removed explicit setting of $PATH as I saw no sense in it and
+ it introduced a bug (thanks to Quim Calpe). Closes: #326769
+ - Removed PID file creation from /etc/init.d/mysql-ndb as it does
+ not work with this daemon (thanks to Quim Calpe).
+ - Updated French Debconf translation (thanks to Christian Perrier).
+ Closes: #324805
+ - Moved conflicts line in debian/control from libmysqlclient15 to
+ libmysqlclient15-dev and removed some pre-sarge conflicts as
+ suggested by Adam Majer. Closes: #324623
+ * Sean Finney:
+ - For posterity, CAN-2005-2558 has been fixed since 5.0.7beta.
+
+ -- Christian Hammers <ch@debian.org> Thu, 15 Sep 2005 19:58:22 +0200
+
+mysql-dfsg-5.0 (5.0.11beta-3) unstable; urgency=low
+
+ * Temporarily build only with -O2 to circumvent gcc internal errors
+ (thanks to Matthias Klose). Related to: #321165
+
+ -- Christian Hammers <ch@debian.org> Thu, 18 Aug 2005 15:44:04 +0200
+
+mysql-dfsg-5.0 (5.0.11beta-2) unstable; urgency=low
+
+ * Fixed README.Debian regarding the status of mysql-doc.
+ * Added "set +e" around chgrp in mysql-server-5.0.preinst to
+ not fail on .journal files (thanks to Christophe Nowicki).
+ Closes: #318435
+
+ -- Christian Hammers <ch@debian.org> Sun, 14 Aug 2005 18:02:08 +0200
+
+mysql-dfsg-5.0 (5.0.11beta-1) unstable; urgency=low
+
+ * New upstream version.
+ * Added Danish Debconf translations (thanks to Claus Hindsgaul).
+ Closes: #322384
+ * Updated Czech Debconf translations (thanks to Miroslav Kure).
+ Closes: #321765
+
+ -- Christian Hammers <ch@debian.org> Sat, 13 Aug 2005 11:56:15 +0000
+
+mysql-dfsg-5.0 (5.0.10beta-1) unstable; urgency=low
+
+ * New upstream release.
+ * Christian Hammers:
+ - Added check for mounted /proc to debian/rules.
+ * Sean Finney:
+ - fix for fix_mysql_privilege_tables/mysql_fix_privilege_tables typo
+ in mysql-server-5.0's README.Debian (see #319838).
+
+ -- Christian Hammers <ch@debian.org> Sun, 31 Jul 2005 00:30:45 +0200
+
+mysql-dfsg-5.0 (5.0.7beta-1) unstable; urgency=low
+
+ * Second try for new upstream release.
+ * Renamed mysql-common-5.0 to mysql-common as future libmysqlclient16
+ from e.g. MySQL-5.1 would else introduce mysql-common-5.1 which makes
+ a simultanous installation of libmysqlclient14 impossible as that
+ depends on either mysql-common or mysql-common-5.0 but not on future
+ versions. Thus we decided to always let the newest MySQL version
+ provide mysql-common.
+ * Added ${misc:Depends} as suggested by debhelper manpage.
+ * Raised standard in control file to 3.6.2.
+ * Removed DH_COMPAT from rules in faviour of debian/compat.
+ * Checkes for presence of init script before executing it in preinst.
+ Referres: 315959
+ * Added 60_includes_mysys.h__gcc40.dpatch for GCC-4.0 compatibility.
+
+ -- Christian Hammers <ch@debian.org> Wed, 29 Jun 2005 00:39:05 +0200
+
+mysql-dfsg-5.0 (5.0.5beta-1) unstable; urgency=low
+
+ * New major release! Still beta so be carefull...
+ * Added federated storage engine.
+
+ -- Christian Hammers <ch@debian.org> Wed, 8 Jun 2005 19:29:45 +0200
+
+mysql-dfsg-4.1 (4.1.12-1) unstable; urgency=low
+
+ * Christian Hammers:
+ - New upstream release.
+ - Disabled BerkeleyDB finally. It has been obsoleted by InnoDB.
+ * Sean Finney:
+ - Updated French translation from Christian Perrier (Closes: #310526).
+ - Updated Japanese translation from Hideki Yamane (Closes: #310263).
+ - Updated Russian translation from Yuriy Talakan (Closes: #310197).
+
+ -- Christian Hammers <ch@debian.org> Sat, 4 Jun 2005 05:49:11 +0200
+
+mysql-dfsg-4.1 (4.1.11a-4) unstable; urgency=high
+
+ * Fixed FTBFS problem which was caused due to the fact that last uploads
+ BerkeleyDB patch was tried to applied on all architectures and not only
+ on those where BerkeleyDB is actually beeing built. Closes: #310296
+
+ -- Christian Hammers <ch@debian.org> Mon, 23 May 2005 00:54:51 +0200
+
+mysql-dfsg-4.1 (4.1.11a-3) unstable; urgency=high
+
+ * Added patch from Piotr Roszatycki to compile the bundled db3 library
+ that is needed for the BerkeleyDB support with versioned symbols so
+ that mysqld no longer crashes when it gets linked together with the
+ Debian db3 version which happens when e.g. using libnss-db.
+ Closes: #308966
+
+ -- Christian Hammers <ch@debian.org> Thu, 19 May 2005 01:41:14 +0200
+
+mysql-dfsg-4.1 (4.1.11a-2) unstable; urgency=high
+
+ * Okay, the hackery with /var/lib/dpkg/info/mysql-server.list will not
+ stand and is removed from the preinst of mysql-server.
+ * New workaround for the symlink problem that does not involve mucking
+ with dpkg's file lists is storing the symlinks in a temporary location
+ across upgrades.
+ As this sometimes fails since apt-get does not always call new.preinst
+ before old.postrm, some remarks were added to README.Debian and the
+ Debconf installation notes to minimize the inconvinience this causes.
+
+ -- sean finney <seanius@debian.org> Sun, 15 May 2005 10:25:31 -0400
+
+mysql-dfsg-4.1 (4.1.11a-1) unstable; urgency=high
+
+ * Added the "a" to the version number to be able to upload a new
+ .orig.tar.gz file which now has the non-free Docs/ directory removed
+ as this has been forgotten in the 4.1.11 release (thanks to Goeran
+ Weinholt). Closes: #308691
+ * The Woody package listed /var/lib/mysql and /var/log/mysql in its
+ /var/lib/dpkg/info/mysql-server.list. These directories are often
+ replaced by symlinks to data partitions which triggers a dpkg bug
+ that causes these symlinks to be removed on upgrades. The new preinst
+ prevents this by removing the two lines from the .list file
+ (thanks to Andreas Barth and Jamin W. Collins). See dpkg bug #287978.
+ * Updated French Debconf translation (thanks to Christian Perrier).
+ Closes: #308353
+
+ -- Christian Hammers <ch@debian.org> Thu, 12 May 2005 21:52:46 +0200
+
+mysql-dfsg-4.1 (4.1.11-3) unstable; urgency=high
+
+ * The "do you want to remove /var/lib/mysql when purging the package" flag
+ from old versions is removed once this package is beeing installed so
+ that purging an old Woody mysql-server package while having a
+ mysql-server-4.1 package installed can no longer lead to the removal of
+ all databases. Additionaly clarified the wording of this versions Debconf
+ template and added a check that skips this purge in the postrm script
+ if another mysql-server* package has /usr/sbin/mysqld installed.
+ (thanks to Adrian Bunk for spotting that problem) Closes: #307473
+ * Cronfile was not beeing installed as the filename was not in the
+ correct format for "dh_installcron --name" (thanks to Tomislav
+ Gountchev). Closes: #302712
+
+ -- Christian Hammers <ch@debian.org> Sat, 23 Apr 2005 22:55:15 +0200
+
+mysql-dfsg-4.1 (4.1.11-2) unstable; urgency=low
+
+ * Sean Finney:
+ - don't freak out if we can't remove /etc/mysql during purge.
+ - debian/rules clean works again.
+ * Christian Hammers:
+ - Fixed typo in README.Debian (thanks to Joerg Rieger). Closes: #304897
+ - Completely removed the passwordless test user as it was not only
+ insecure but also lead to irritations as MySQL checks first the
+ permissions of this user and then those of a password having one.
+ See bug report from Hilko Bengen for details. Closes: #301741
+
+ -- Christian Hammers <ch@debian.org> Sat, 16 Apr 2005 15:55:00 +0200
+
+mysql-dfsg-4.1 (4.1.11-1) unstable; urgency=low
+
+ * New upstream version.
+ * Upstream fix for charset/collation problem. Closes: #282256
+ * Upstream fix for subselect crash. Closes: #297687
+ * Corrected minor issue in Debconf template regarding skip-networking
+ (thanks to Isaac Clerencia). Closes: #303417
+ * Made dependency to gawk unnecessary (thanks to Zoran Dzelajlija).
+ Closes: #302284
+ * Removed obsolete 50_innodb_mixlen.dpatch.
+ * Removed obsolete 51_CAN-2004-0957_db_grant_underscore.dpatch.
+
+ -- Christian Hammers <ch@debian.org> Fri, 8 Apr 2005 00:23:53 +0200
+
+mysql-dfsg-4.1 (4.1.10a-7) unstable; urgency=low
+
+ * Sean Finney:
+ - fix for the mysteriously disappeared cronjob. thanks to
+ Peter Palfrader <weasel@debian.org> for pointing out this omission.
+ (closes: #302712).
+
+ -- sean finney <seanius@debian.org> Sat, 02 Apr 2005 16:54:13 -0500
+
+mysql-dfsg-4.1 (4.1.10a-6) unstable; urgency=high
+
+ * Sean Finney:
+ - the previous upload did not completely address the issue. this one
+ should do so. d'oh.
+
+ -- sean finney <seanius@debian.org> Thu, 31 Mar 2005 03:35:50 +0000
+
+mysql-dfsg-4.1 (4.1.10a-5) unstable; urgency=high
+
+ * Sean Finney:
+ - the following security issue is addressed in this upload:
+ CAN-2004-0957 (grant privilege escalation on tables with underscores)
+ thanks to sergei at mysql for all his help with this.
+
+ -- sean finney <seanius@debian.org> Wed, 30 Mar 2005 21:19:26 -0500
+
+mysql-dfsg-4.1 (4.1.10a-4) unstable; urgency=low
+
+ * Sean Finney:
+ - FTBFS fix for amd64/gcc-4.0. Thanks to Andreas Jochens <aj@andaco.de>
+ for reporting this (closes: #301807).
+ - ANSI-compatible quoting fix in daily cron job. thanks to
+ Karl Hammar <karl@aspodata.se> for pointing out the problem in
+ the 4.0 branch.
+ - Added myself as a co-maintainer in the control file (closes: #295312).
+
+ -- sean finney <seanius@debian.org> Tue, 29 Mar 2005 18:54:42 -0500
+
+mysql-dfsg-4.1 (4.1.10a-3) unstable; urgency=low
+
+ * BerkeleyDB is now disabled by default as its use is discouraged by MySQL.
+ * Added embedded server libraries as they finally do compile.
+ They are currently in libmysqlclient-dev as they are still
+ experimental and only available as .a library (thanks to Keith Packard).
+ Closes: #297062
+ * Fixed obsolete "tail" syntax (thanks to Sven Mueller). Closes: #301413
+ * Added CAN numbers for the latest security bugfix upload.
+ * Updated manpage of mysqlmanager (thanks to Justin Pryzby). Closes: #299844
+ * Added comments to default configuration.
+
+ -- Christian Hammers <ch@debian.org> Sun, 20 Mar 2005 17:40:18 +0100
+
+mysql-dfsg-4.1 (4.1.10a-2) unstable; urgency=low
+
+ * Disabled "--with-mysqld-ldflags=-all-static" as it causes sig11 crashes
+ if LDAP is used for groups in /etc/nsswitch.conf. Confirmed by Sean Finney
+ and Daniel Dehennin. Closes: #299382
+
+ -- Christian Hammers <ch@debian.org> Mon, 14 Mar 2005 03:01:03 +0100
+
+mysql-dfsg-4.1 (4.1.10a-1) unstable; urgency=high
+
+ * SECURITY:
+ - The following security related updates are addressed:
+ CAN-2005-0711 (temporary file creation with "CREATE TEMPORARY TABLE")
+ CAN-2005-0709 (arbitrary library injection in udf_init())
+ CAN-2005-0710 (arbitrary code execution via "CREATE FUNCTION")
+ Closes: #299029, #299031, #299065
+ * New Upstream Release.
+ - Fixes some server crash conditions.
+ - Upstream includes fix for TMPDIR overriding my.cnf tmpdir setting
+ Closes: #294347
+ - Fixes InnoDB error message. Closes: #298875
+ - Fixes resouce limiting. Closes: #285044
+ * Improved checking whether or not the server is alive in the init script
+ which should make it possible to run several mysqld instances in
+ different chroot environments. Closes: #297772
+ * Fixed cron script name as dots are not allowed (thanks to Michel
+ v/d Ven). Closes: #298447
+ * Added -O3 and --with-mysqld-ldflags=-all-static as MySQL recommends to
+ build the server binary statically in order to gain about 13% more
+ performance (thanks to Marcin Kowalski).
+ * Added patch to let mysqld_safe react to signals (thanks to Erich
+ Schubert). Closes: #208364
+ * (Thanks to Sean Finney for doing a great share of work for this release!)
+
+ -- Christian Hammers <ch@debian.org> Thu, 3 Mar 2005 02:36:39 +0100
+
+mysql-dfsg-4.1 (4.1.10-4) unstable; urgency=medium
+
+ * Fixed bug that prevented MySQL from starting after upgrades.
+ Closes: #297198, #296403
+ * Added comment about logging to syslog to the default my.cnf
+ and the logrotate script (thanks to Ryszard Lach). Closes: #295507
+
+ -- Christian Hammers <ch@debian.org> Thu, 3 Mar 2005 00:28:02 +0100
+
+mysql-dfsg-4.1 (4.1.10-3) unstable; urgency=low
+
+ * Sean Finney: Cronjobs now exit silently when the server package
+ has been removed but not purged (thanks to Vineet Kumar).
+ Closes: #297404
+ * Fixed comments of /etc/mysql/debian-log-rotate.conf (thanks to
+ Philip Ross). Closes: #297467
+ * Made mysqld_safe reacting sane on signals (thanks to Erich Schubert).
+ Closes: #208364
+
+ -- Christian Hammers <ch@debian.org> Tue, 1 Mar 2005 19:44:34 +0100
+
+mysql-dfsg-4.1 (4.1.10-2) unstable; urgency=low
+
+ * Converted to dpatch.
+ * debian/ is now maintained via Subversion on svn.debian.org.
+
+ -- Christian Hammers <ch@debian.org> Tue, 1 Mar 2005 02:16:36 +0100
+
+mysql-dfsg-4.1 (4.1.10-1) unstable; urgency=low
+
+ * New upstream version.
+ * Upstream fixed memleak bug. Closes: #205587
+ * Added debian/copyright.more for personal reference.
+ * Lowered default query cache size as suggested by Arjen from MySQL.
+ * Switched from log to log-bin as suggested by Arjen from MySQL.
+ * Fixed typo in my.cnf (thanks to Sebastian Feltel). Closes: #295247
+ * Replaced --defaults-extra-file by --defaults-file in Debian scripts
+ as former lets password/host etc be overwriteable by /root/.my.cnf.
+ Added socket to /etc/mysql/debian.cnf to let it work. (thanks to
+ SATOH Fumiyasu). Closes: #295170
+
+ -- Christian Hammers <ch@debian.org> Tue, 15 Feb 2005 23:47:02 +0100
+
+mysql-dfsg-4.1 (4.1.9-4) unstable; urgency=low
+
+ * Improved the way mysqld is started and registered with update-rc.d
+ in cases where the admin modifies the runlevel configuration.
+ Most notably removed the debconf question whether or not mysql should
+ start on when booting. Closes: #274264
+ * Renamed configuration option old-passwords to the more preferred
+ naming convention old_passwords. Same for some others (thanks to
+ Patrice Pawlak). Closes: #293983
+
+ -- Christian Hammers <ch@debian.org> Tue, 8 Feb 2005 02:21:18 +0100
+
+mysql-dfsg-4.1 (4.1.9-3) unstable; urgency=low
+
+ * Renamed ca_ES.po to ca.po to reach a broader audience (thanks to
+ Christian Perrier). Closes: #293786
+ * Expicitly disabled mysqlfs support as it has never been enabled by
+ configure during the autodetection but fails due to broken upstream
+ code when users try to build the package theirselves while having
+ liborbit-dev installed which triggers the mysqlfs autodetection
+ (thanks to Max Kellermann). Closes: #293431
+ * Added dependencies to gawk as one script does not work with original-awk
+ (thanks to Petr Ferschmann). Closes: #291634
+
+ -- Christian Hammers <ch@debian.org> Sun, 6 Feb 2005 23:33:11 +0100
+
+mysql-dfsg-4.1 (4.1.9-2) unstable; urgency=high
+
+ * SECURITY:
+ For historical reasons /usr/share/mysql/ was owned and writable by
+ the user "mysql". This is a security problem as some scripts that
+ are run by root are in this directory and could be modified and used
+ by a malicious user who already has mysql privileges to gain full root
+ rights (thanks to Matt Brubeck). Closes: #293345
+ * Changed "skip-networking" to "bind-address 127.0.0.1" which is more
+ compatible and not less secure but maybe even more, as less people enable
+ networking for all interfaces (thanks to Arjen Lentz).
+ * Enabled InnoDB by default as recommended by Arjen Lentz from MySQL.
+ * Added remarks about hosts.allow to README.Debian (thanks to David
+ Chappell). Closes: #291300
+ * mysql-server-4.1 now provides mysql-server (thanks to Paul van den Berg).
+ Closes: #287735
+
+ -- Christian Hammers <ch@debian.org> Wed, 2 Feb 2005 23:31:55 +0100
+
+mysql-dfsg-4.1 (4.1.9-1) unstable; urgency=low
+
+ * New upstream version.
+ * mysql-client-4.1 now provides "mysql-client" so that packages depending
+ on mysql-client (ca. 40) can now be used with MySQL-4.1, too.
+
+ -- Christian Hammers <ch@debian.org> Sun, 23 Jan 2005 22:52:48 +0100
+
+mysql-dfsg-4.1 (4.1.8a-6) unstable; urgency=high
+
+ * SECURITY:
+ Javier Fernandez-Sanguino Pena from the Debian Security Audit Project
+ discovered a temporary file vulnerability in the mysqlaccess script of
+ MySQL that could allow an unprivileged user to let root overwrite
+ arbitrary files via a symlink attack and could also could unveil the
+ contents of a temporary file which might contain sensitive information.
+ (CAN-2005-0004, http://lists.mysql.com/internals/20600) Closes: #291122
+
+ -- Christian Hammers <ch@debian.org> Tue, 18 Jan 2005 23:11:48 +0100
+
+mysql-dfsg-4.1 (4.1.8a-5) unstable; urgency=medium
+
+ * Fixed important upstream bug that causes from_unixtime(0) to return
+ NULL instead of "1970-01-01 00:00:00" which fails on NOT NULL columns.
+ Closes: #287792
+ * Fixes upstream bug in mysql_list_fields() . Closes: #282486
+ * Fixes bug that lead to double rotated logfiles when mysql-server 4.0
+ was previously installed (thanks to Olaf van der Spek). Closes: #289851
+ * Fixed typo in README.Debian (thanks to Mark Nipper). Closes: #289131
+ * Changed max_allowed_packet in my.cnf to 16M as in 4.0.x (thanks to
+ Olaf van der Spek). Closes: #289840
+ * Updated French debconf translation (thanks to Christian Perrier).
+ Closes: #287955
+
+ -- Christian Hammers <ch@debian.org> Thu, 13 Jan 2005 01:29:05 +0100
+
+mysql-dfsg-4.1 (4.1.8a-4) unstable; urgency=low
+
+ * Broken patch again :-(
+
+ -- Christian Hammers <ch@debian.org> Sun, 9 Jan 2005 23:47:55 +0100
+
+mysql-dfsg-4.1 (4.1.8a-3) unstable; urgency=low
+
+ * The mutex patch was a bit too x86 centric. This broke the alpha build.
+
+ -- Christian Hammers <ch@debian.org> Sun, 9 Jan 2005 14:18:49 +0100
+
+mysql-dfsg-4.1 (4.1.8a-2) unstable; urgency=medium
+
+ * Some Makefiles that were patched by me got overwritten by the GNU
+ autotools, probably because I also patched ./configure. Fixed now,
+ the critical mutex patch is now back in again. Closes: #286961
+ * Added patch to make MySQL compile on ARM (thanks to Adam Majer).
+ Closes: #285071
+
+ -- Christian Hammers <ch@debian.org> Thu, 6 Jan 2005 09:30:13 +0100
+
+mysql-dfsg-4.1 (4.1.8a-1) unstable; urgency=medium
+
+ * Upstream 4.1.8 had some problems in their GNU Autotools files so they
+ released 4.1.8a. Debian's 4.1.8 was fixed by running autoreconf but this
+ again overwrote MySQL changes to ltmain.sh which are supposed to fix some
+ problems on uncommon architectures (maybe the FTBFS on alpha, arm, m68k
+ and sparc?).
+ * libmysqlclient_r.so.14 from 4.1.8-3 also missed a link dependency to
+ libz which lead to unresolved symbols visible with "ldd -r" (thanks
+ to Laurent Bonnaud). Closes: #287573
+
+ -- Christian Hammers <ch@debian.org> Wed, 29 Dec 2004 14:26:33 +0100
+
+mysql-dfsg-4.1 (4.1.8-3) unstable; urgency=low
+
+ * Fixed checking for error messages by forcing english language
+ output by adding LC_ALL=C to debian-start (thanks to Rene
+ Konasz) Closes: #285709
+ * Fixed bashisms in Debian scripts. Closes: #286863
+ * Updated Japanese Debconf translation (thanks to Hideki Yamane).
+ Closes: #287003
+ * Improved 4.0 to 4.1 upgrade if /var/lib/mysql is a symlink
+ (thanks to Thomas Lamy). Closes: #286560
+ * Added patch for FTBFS problem where no LinuxThreads can be found.
+ I don't know if this still applies but it should not hurt.
+ The patch is debian/patches/configure__AMD64-LinuxThreads-vs-NPTL.diff
+
+ -- Christian Hammers <ch@debian.org> Sun, 26 Dec 2004 14:04:20 +0100
+
+mysql-dfsg-4.1 (4.1.8-2) unstable; urgency=low
+
+ * If /var/lib/mysql is a symlink then it is kept as such.
+ * Added the old-passwords option to the default my.cnf to stay
+ compatible to clients that are still compiled to libmysqlclient10
+ and libmysqlclient12 for licence reasons.
+ * Adjusted tetex build-deps to ease backporting (thanks to Norbert
+ Tretkowski from backports.org).
+
+ -- Christian Hammers <ch@debian.org> Tue, 21 Dec 2004 01:00:27 +0100
+
+mysql-dfsg-4.1 (4.1.8-1) unstable; urgency=medium
+
+ * New upstream version. Closes: #286175
+ * Added conflict to libmysqlclient-dev (thanks to Adam Majer).
+ Closes: #286538
+ * Added debconf-updatepo to debian/rules:clean.
+ * Updated Japanese Debconf translation (thanks to Hideki Yamane).
+ Closes: #285107
+ * Updated French Debconf translation (thanks to Christian Perrier).
+ Closes: #285977
+ * Renamed cz.po to cs.po (thanks to Miroslav Kure). Closes: #285438
+ * Aplied patch for changed server notice to debian-start (thanks to
+ Adam Majer). Closes: #286035
+ * Changed nice value in default my.cnf as nohup changed its behaviour
+ (thanks to Dariush Pietrzak). Closes: #285446
+ * Increased verbosity of preinst script in cases where it cannot stop
+ a running server (thanks to Jan Minar). Closes: #285982
+ * Splitted the code parts of /etc/mysql/debian-start to
+ /usr/share/mysql/debian-start.inc.sh (thanks to Jan Minar).
+ Closes: #285988
+
+ -- Christian Hammers <ch@debian.org> Mon, 20 Dec 2004 00:33:21 +0100
+
+mysql-dfsg-4.1 (4.1.7-4) unstable; urgency=medium
+
+ * Removed OpenSSL support.
+ After a short discussion with MySQL, I decided to drop OpenSSL support as
+ 1. MySQL started shipping their binaries without it, too and do not
+ seem to support it in favour of using a different library somewhen.
+ 2. MySQL did not adjust their licence to grant permission to link
+ against OpenSSL.
+ 3. Even if they did, third parties who use libmysqlclient.so often
+ do not realise licencing problems or even do not want OpenSSL.
+ (thanks to Jordi Mallach and the responders to MySQL bug #6924)
+ Closes: #283786
+ * debian/control: Improved depends and conflicts to mysql-4.0.
+
+ -- Christian Hammers <ch@debian.org> Thu, 2 Dec 2004 22:02:28 +0100
+
+mysql-dfsg-4.1 (4.1.7-3) unstable; urgency=low
+
+ * Raised version to make it higher as the one in experimental.
+
+ -- Christian Hammers <ch@debian.org> Wed, 1 Dec 2004 21:09:20 +0100
+
+mysql-dfsg-4.1 (4.1.7-2) unstable; urgency=low
+
+ * Patched scripts/mysql_install_db so that it no longer creates a
+ passwordless test database during installation (thanks to Patrick
+ Schnorbus). Closes: #281158
+ * Added Czech debconf translation (thanks to Miroslav Kure).
+ Closes: #283222
+
+ -- Christian Hammers <ch@debian.org> Wed, 1 Dec 2004 01:29:31 +0100
+
+mysql-dfsg-4.1 (4.1.7-1) unstable; urgency=low
+
+ * New upstream branch!
+ * Adjusted debian/control to make this package suitable to get parallel
+ to version 4.0.x into unstable and sarge. The package names are
+ different so that "mysql-server" still defaults to the rock-stable
+ 4.0 instead to this announced-to-be-stable 4.1.
+ * Added --with-mutex=i86/gcc-assemler to the Berkeley-DB configure
+ to prevent the use of NPLT threads when compiling under kernel 2.6
+ because the binaries are else not runable on kernel 2.4 hosts.
+ Closes: #278638, #274598
+
+ -- Christian Hammers <ch@debian.org> Sun, 31 Oct 2004 20:15:03 +0100
+
+mysql-dfsg (4.1.6-1) experimental; urgency=low
+
+ * New upstream version.
+ * Fixed symlinks in libmysqlclient-dev package. Closes: #277028
+ * This time I did not update the libtool files as they were pretty
+ up to date and I want to have a shorter diff file.
+
+ -- Christian Hammers <ch@debian.org> Wed, 20 Oct 2004 00:07:58 +0200
+
+mysql-dfsg (4.1.5-3) experimental; urgency=low
+
+ * debian/postinst: mysql_install_db changed parameter from --IN-RPM
+ to --rpm which caused problems during installs. Closes: #276320
+
+ -- Christian Hammers <ch@debian.org> Sat, 16 Oct 2004 20:36:46 +0200
+
+mysql-dfsg (4.1.5-2) experimental; urgency=low
+
+ * Activated support for ndb clustering (thanks to Kevin M. Rosenberg).
+ Closes: #275109
+
+ -- Christian Hammers <ch@debian.org> Wed, 6 Oct 2004 01:58:00 +0200
+
+mysql-dfsg (4.1.5-1) experimental; urgency=low
+
+ * WARNING:
+ The upstream branch 4.1 is still considered BETA.
+ The Debian packages for 4.1 were done without big testing. If you miss
+ a new functionality or binary, contact me and I check add the relevant
+ configure option or include the program.
+ * New MAJOR upstream version.
+ Thanks to the great demand here's now the first MySQL 4.1 experimental
+ release. FEEDBACK IS WELCOME.
+ * 4.0->4.1 notes:
+ - debian/patches/alpha.diff could not be applied, I fix that later
+ - debian/patches/scripts__mysql_install_db.sh.diff was obsolete
+ - debian/patches/scripts__Makefile.in was neccessary due to a dependency
+ to the removed non-free Docs/ directory. Upstream has been contacted.
+ - Build-Deps: += automake1.7
+ - debian/rules: embedded servers examples did not compile, removed
+
+ -- Christian Hammers <ch@debian.org> Sun, 26 Sep 2004 19:46:47 +0200
+
+mysql-dfsg (4.0.21-3) unstable; urgency=low
+
+ * Upstream tried to fix a security bug in mysqlhotcopy and broke it :-)
+ Applied a patch (see debian/patches) from Martin Pitt. Closes: #271632
+ * Between 4.0.20 and 4.0.21 the Debian specific changes in
+ /usr/bin/mysqld_safe that piped the error log to syslog got lost
+ and are now back again.
+ * Fixed capitalization in debconf headings.
+ * Changed wording of the initscript status message to make heartbeat
+ happier. Closes: #271591
+
+ -- Christian Hammers <ch@debian.org> Fri, 17 Sep 2004 18:42:25 +0200
+
+mysql-dfsg (4.0.21-2) unstable; urgency=medium
+
+ * The dependencies between mysql-client and libmysqlclient12 were
+ too loose, when upgrading only the client this can lead to non working
+ binaries due to relocation errors (thanks to Dominic Cleal).
+ Closes: #271803
+ * Fixed typo in mysqldump.1 manpage (thanks to Nicolas Francois).
+ Closes: #271334
+
+ -- Christian Hammers <ch@debian.org> Wed, 15 Sep 2004 15:38:11 +0200
+
+mysql-dfsg (4.0.21-1) unstable; urgency=high
+
+ * SECURITY:
+ This upstream version fixes some security problems that might at least
+ allow a DoS attack on the server.
+ * Fixed an old bug in concurrent accesses to `MERGE' tables (even
+ one `MERGE' table and `MyISAM' tables), that could've resulted in
+ a crash or hang of the server. (Bug #2408)
+ * Fixed bug in privilege checking where, under some conditions, one
+ was able to grant privileges on the database, he has no privileges
+ on. (Bug #3933)
+ * Fixed crash in `MATCH ... AGAINST()' on a phrase search operator
+ with a missing closing double quote. (Bug #3870)
+ * Fixed potential memory overrun in `mysql_real_connect()' (which
+ required a compromised DNS server and certain operating systems).
+ (Bug #4017)
+ * New upstream version.
+ * Fixes bug that made x="foo" in WHERE sometimes the same as x="foo ".
+ Closes: #211618
+ * Updated Japanese Debconf translation (thanks to Hideki Yamane).
+ Closes: #271097
+
+ -- Christian Hammers <ch@debian.org> Sat, 11 Sep 2004 23:15:44 +0200
+
+mysql-dfsg (4.0.20-14) unstable; urgency=low
+
+ * Dave Rolsky spottet that -DBIG_JOINS was not properly enabled.
+ It allowes joining 64 instead of an 32 tables to join.
+
+ -- Christian Hammers <ch@debian.org> Thu, 9 Sep 2004 20:24:02 +0200
+
+mysql-dfsg (4.0.20-13) unstable; urgency=medium
+
+ * Fixed a bug in the initscript which caused the check for not properly
+ closed i.e. corrupt tables that is executed when the server starts
+ not to run in background as supposed.
+ Although the check does not repair anything on servers with several
+ thousand tables the script was reported to take some minutes which
+ is quite annoying. (Thanks to Jakob Goldbach). Closes: #270800
+
+ -- Christian Hammers <ch@debian.org> Thu, 9 Sep 2004 17:11:05 +0200
+
+mysql-dfsg (4.0.20-12) unstable; urgency=medium
+
+ * Filter messages regarding table handles that do not support CHECK TABLE
+ in the script that checks for corrupted tables on every start which lead
+ to unnecessary mails (thanks to David Everly). Closes: #269811
+ * Added a note to the corrupt-table-check mail which notes that a
+ false-positive is reported in the case that immediately after starting
+ the server a client starts using a table (thanks to Uwe Kappe).
+ Closes: #269985
+ * Added "quote-names" as default to the [mysqldump] section in
+ /etc/mysql/my.cnf as too many users stumble over dump files that
+ could not be read in again due to the valid use of reserved words
+ as table names. This has also be done by upstream in 4.1.1 and has
+ no known drawbacks. Closes: #269865
+ * Binary logs can now be rotated as well. Defaults to off, though, for
+ compatibilty reasons (thanks to Mark Ferlatte). Closes: #94230, #269110
+ * The mysql user "debian-sys-maint" now gets all possible rights which
+ makes binary logging possible and helps other package maintainer who
+ wants to use it to create package specific databases and users.
+ * Added example how to change daemon nice level via /etc/mysql/my.cnf
+ * Updated French debconf translations (thanks to Christian Perrier).
+ Closes: #265811
+ * Renamed options in the default config file that still had old names
+ (thanks to Yves Kreis). Closes: #266445
+ * Fixed spelling in debconf note.
+ * Added -l and -L to dh_shlibdeps.
+
+ -- Christian Hammers <ch@debian.org> Fri, 3 Sep 2004 20:10:46 +0200
+
+mysql-dfsg (4.0.20-11) unstable; urgency=high
+
+ * SECURITY
+ This version fixes a security flaw in mysqlhotcopy which created
+ temporary files in /tmp which had predictable filenames and such
+ could be used for a tempfile run attack.
+ The issue has been recorded as CAN-2004-0457.
+
+ -- Christian Hammers <ch@debian.org> Sat, 14 Aug 2004 18:27:19 +0200
+
+mysql-dfsg (4.0.20-10) unstable; urgency=low
+
+ * MySQL finally updated their copyright page and installed v1.5 of
+ the "Free/Libre and Open Source Software License (FLOSS) - Exception"
+ which will hopefully end the license hell they created by putting the
+ client libraries under GPL instead of LGPL which conflicts with PHP and
+ other software that used to link against MySQL.
+ The license text is not yet in any release MySQL version but visible
+ on their web site and copied into the debian/copyright file.
+ Special thanks to Zak Greant <zak@mysql.com> and the debian-legal list
+ for helping to solve this release critical problem.
+ Closes: #242449
+ * Updated Brazil debconf translation (thanks to Andre Luis Lopes).
+ Closes: #264233
+ * Updated Japanese debconf translation (thanks to Hideki Yamane).
+ Closes: #264620
+ * Fixed minor typo in debconf description (thanks to TROJETTE Mohammed
+ Adnene). Closes: #264840
+ * Improved init and preinst script which now detects stalled servers which
+ do no longer communicate but are present in the process list (thanks to
+ Henrik Johansson). Closes: #263215
+
+ -- Christian Hammers <ch@debian.org> Mon, 9 Aug 2004 19:44:28 +0200
+
+mysql-dfsg (4.0.20-9) unstable; urgency=medium
+
+ * Partly reverted the last patch which gave the mysql-user
+ "debian-sys-maint" more rights as there are old versions of MySQL which
+ have fewer privlige columns. Now only those are set (thanks to Alan Tam).
+ Closes: #263111
+
+ -- Christian Hammers <ch@debian.org> Tue, 3 Aug 2004 13:03:02 +0200
+
+mysql-dfsg (4.0.20-8) unstable; urgency=low
+
+ * The mysqlcheck that is started from the initscript will now be
+ backgrounded because it might else prevent the boot process to continue.
+ It also now notifies root by mail and syslog if a table is corrupt.
+ * The "debian-sys-maint" MySQL user now has almost full rights so that other
+ packages might use this account to create databases and user (thanks to
+ Andreas Barth). Closes: #262541
+ * Added paranoid rules for logcheck.
+
+ -- Christian Hammers <ch@debian.org> Sun, 1 Aug 2004 21:00:55 +0200
+
+mysql-dfsg (4.0.20-8) unstable; urgency=low
+
+ * Upload stalled. Not released.
+
+ -- Christian Hammers <ch@debian.org> Sun, 1 Aug 2004 20:27:55 +0200
+
+mysql-dfsg (4.0.20-7) unstable; urgency=medium
+
+ * Solved the upstream bug that error messages of the server are written
+ in a file that is then rotated away leaving mysqld logging effectively
+ to /dev/null. It now logs to a /usr/bin/logger process which puts the
+ messages into the syslog.
+ Modified files: /etc/init.d/mysql, /usr/bin/mysqld_safe and the
+ logchecker files. Closes: #254070
+ * The initscript does no longer call mysqlcheck directly but via
+ /etc/mysql/debian-start which is a user customizable config script.
+ * Splitted the debconf "install and update notes" and only show them
+ when it is appropriate (thanks to Steve Langasek). Closes: #240515
+ * Added NEWS.Debian.
+ * Added hint to -DBIG_ROWS, which is currently not used, to README.Debian.
+ * Corrected typo in myisampack manpage (thanks to Marc Lehmann).
+ Closes: #207090
+ * Added Catalan debconf translation (thanks to Aleix Badia i Bosch).
+ Closes: #236651
+
+ -- Christian Hammers <ch@debian.org> Wed, 28 Jul 2004 01:41:51 +0200
+
+mysql-dfsg (4.0.20-6) unstable; urgency=low
+
+ * The build arch detected by configure was "pc-linux-gnu (i686)"
+ instead of "pc-linux-gnu (i386)". Was no problem AFAIK but
+ Adam Majer asked me to explicitly change it to i386. Closes: #261382
+ * Removed some unused shell scripts from /usr/share/mysql.
+ * Added lintian overrides.
+ * Removed rpath by using chrpath.
+
+ -- Christian Hammers <ch@debian.org> Mon, 26 Jul 2004 00:17:12 +0200
+
+mysql-dfsg (4.0.20-5) unstable; urgency=medium
+
+ * The mysqlcheck in the init script is only called when the server
+ is really alive. Also, the mysql-user 'debian-sys-maint' now has
+ global select rights (thanks to Nathan Poznick). Closes: #261130
+ * Moved the debconf question whether to remove the databases or not
+ from mysql-server.config to mysql-server.postrm so that it shows
+ up on purge time and not months earlier (thanks to Wouter Verhelst).
+ Closes: #251838
+
+ -- Christian Hammers <ch@debian.org> Fri, 23 Jul 2004 22:41:13 +0200
+
+mysql-dfsg (4.0.20-4) unstable; urgency=low
+
+ * Added a "mysqlcheck -A --fast" to the 'start' section of the
+ init script to help admins detect corrupt tables after a server crash.
+ Currently it exists with an error message but leaves the server
+ running. Feedback appreciated!
+ * Made postinst script more robust by calling db_stop earlier and
+ so prevent pipe-deadlocks.
+ * Fixed minor typos in initscript (thanks to "C.Y.M."). Closes: 259518
+ * Added the undocumented "-DBIG_JOINS" that MySQL apparently uses in
+ their MAX binaries. It enables 62 instead of 30 tables in a "join".
+ (thanks to Dave Rolsky). Closes: #260843
+ * Added a "df --portability /var/lib/mysql/." check to the preinst
+ script as users experienced hard to kill hanging mysqlds in such
+ a situation (thanks to Vaidas Pilkauskas). Closes: #260306
+
+ -- Christian Hammers <ch@debian.org> Fri, 23 Jul 2004 00:51:32 +0200
+
+mysql-dfsg (4.0.20-3) unstable; urgency=low
+
+ * Improved tolerance if the init script has been deleted (thanks to
+ Leonid Shulov for spotting the problem).
+ * Minor wording changes to README.Debian generalizing /root/ by $HOME
+ (thanks to Santiago Vila). Closes: #257725
+ * Added Japanese debconf translation (thanks to Hideki Yamane).
+ Closes: #256485
+ * Fixed commend in my.cnf regarding logfile directory (thanks to Jayen
+ Ashar). Closes: #253434
+ * Correted "ease to" by "ease of" in package description (thanks to
+ Johannes Berg). Closes: #253510
+
+ -- Christian Hammers <ch@debian.org> Fri, 9 Jul 2004 00:57:42 +0200
+
+mysql-dfsg (4.0.20-2) unstable; urgency=low
+
+ * Removed RPM .spec file from the included documentation as it is pretty
+ useless (thanks to Loic Minier).
+ * Added turkish debconf translation (thanks to Recai Oktas). Closes: #252802
+
+ -- Christian Hammers <ch@debian.org> Sun, 6 Jun 2004 14:48:26 +0200
+
+mysql-dfsg (4.0.20-1) unstable; urgency=low
+
+ * New upstream version.
+
+ -- Christian Hammers <ch@debian.org> Mon, 31 May 2004 23:36:39 +0200
+
+mysql-dfsg (4.0.18-8) unstable; urgency=low
+
+ * Updated french translation (thanks to Christian Perrier). Closes: #246789
+
+ -- Christian Hammers <ch@debian.org> Tue, 4 May 2004 23:26:54 +0200
+
+mysql-dfsg (4.0.18-7) unstable; urgency=low
+
+ * Added CVE ids for the recent security fixes.
+ 4.0.18-4 is CAN-2004-0381 (mysqlbug) and
+ 4.0.18-6 is CAN-2004-0388 (mysql_multi)
+
+ -- Christian Hammers <ch@debian.org> Mon, 19 Apr 2004 18:32:03 +0200
+
+mysql-dfsg (4.0.18-6) unstable; urgency=medium
+
+ * SECURITY:
+ Fixed minor tempfile-run security problem in mysqld_multi.
+ Unprivileged users could create symlinks to files which were then
+ unknowingly overwritten by run when this script gets executed.
+ Upstream informed. Thanks to Martin Schulze for finding this.
+
+ -- Christian Hammers <ch@debian.org> Wed, 7 Apr 2004 01:28:22 +0200
+
+mysql-dfsg (4.0.18-5) unstable; urgency=low
+
+ * Little improvements in debian scripts for last upload.
+ * Added check to logrotate script for the case that a mysql
+ server is running but not be accessible with the username and
+ password from /etc/mysql/debian.conf (thanks to Jeffrey W. Baker).
+ Closes: 239421
+
+ -- Christian Hammers <ch@debian.org> Sun, 4 Apr 2004 15:27:40 +0200
+
+mysql-dfsg (4.0.18-4) unstable; urgency=medium
+
+ * SECURITY:
+ Aplied fix for unprobable tempfile-symlink security problem in
+ mysqlbug reported by Shaun Colley on bugtraq on 2004-03-24.
+ * Updated french debconf translation (thanks to Christian Perrier).
+ Closes: #236878
+ * Updated portugesian debconf translation (thanks to Nuno Senica).
+ Closes: #239168
+ * Updated german debconf translation (thanks to Alwin Meschede).
+ Closes: #241749
+ * Improved debconf template regarding fix_privileges_tables (thanks
+ to Matt Zimmermann for suggestions). Closes: #219400
+ * Improved README.Debian regarding to password settings (thanks to
+ Yann Dirson). Closes: #241328
+
+ -- Christian Hammers <ch@debian.org> Sat, 3 Apr 2004 19:52:15 +0200
+
+mysql-dfsg (4.0.18-3) unstable; urgency=medium
+
+ * Added Build-Depend to po-debconf to let it build everywhere.
+
+ -- Christian Hammers <ch@debian.org> Wed, 31 Mar 2004 23:43:33 +0200
+
+mysql-dfsg (4.0.18-2) unstable; urgency=low
+
+ * Added a "2>/dev/null" to a "which" command as there are two
+ "which" versions in Debian of which one needs it. Closes: #235363
+
+ -- Christian Hammers <ch@debian.org> Tue, 2 Mar 2004 23:31:28 +0100
+
+mysql-dfsg (4.0.18-1) unstable; urgency=low
+
+ * New upstream version.
+ * Should now compile and run on ia64 (thanks to Thorsten Werner and
+ David Mosberger-Tang). Closes: #226863 #228834
+ * Converted init scripts to invoce-rc.d (thanks to Erich Schubert).
+ Closes: 232118
+ * Secondlast upload changed logfile location. Closes: #182655
+ * Updated Brasilian translation (thanks to Andre Luis Lopes). Closes:
+ #219847
+
+ -- Christian Hammers <ch@debian.org> Tue, 17 Feb 2004 23:44:58 +0100
+
+mysql-dfsg (4.0.17-2) unstable; urgency=low
+
+ * Improved manpage for mysqldumpslow.1 (thanks to Anthony DeRobertis).
+ Closes: #231039
+ * Improved stopping of crashed daemons in init script (thanks to
+ Matthias Urlichs). Closes: #230327
+
+ -- Christian Hammers <ch@debian.org> Mon, 9 Feb 2004 21:54:29 +0100
+
+mysql-dfsg (4.0.17-1) unstable; urgency=low
+
+ * Made logging into /var/log/mysql/ the default. Closes: #225206
+
+ * New upstream version. Closes: #225028
+ * Turned on a 25MB query cache by default (thanks to Cyril Bouthors).
+ Closes: #226789
+ * Updated russian translation (thanks to Ilgiz Kalmetev). Closes: #219263
+ * Upstream fixes the problem that AND was not commutative (thanks for
+ Iain D Broadfoot for mentioning). Closes: #227927
+ * Fixed minor typo in my.cnf comments (thanks to James Renken).
+ Closes: #221496
+ * Better documents regex. Closes: #214952
+ * Fixed minor germanism in debconf template (thanks to Marc Haber).
+ Closes: #224148
+ * Added explaining comment to my.cnf regarding quoted passwords
+ (Thanks to Patrick von der Hagen). Closes: #224906
+ * Changed "find -exec" to "find -print0 | xargs -0" in preinst to
+ speed it up. Thanks to Cyril Bouthors. Closes: #220229
+
+ -- Christian Hammers <ch@debian.org> Sun, 18 Jan 2004 16:16:25 +0100
+
+mysql-dfsg (4.0.16-2) unstable; urgency=low
+
+ * Tried to repair undefined weak symbols by adding a little Makefile
+ patch. Closes: #215973
+
+ -- Christian Hammers <ch@debian.org> Mon, 27 Oct 2003 22:52:10 +0100
+
+mysql-dfsg (4.0.16-1) unstable; urgency=low
+
+ * New upstream release.
+ (Mostly little memory problems and other bugfixes it seems)
+ * Replaced "." by ":" in chown calls to comply with the env setting
+ "_POSIX2_VERSION=2000112" (thanks to Robert Luberda). Closes: #217399
+ * Adjusted syntax in my.cnf to 4.x standard (thanks to Guillaume Plessis).
+ Closes: #217273
+ * Improved README.Debian password instructions (thanks to Levi Waldron).
+ Closes: #215046
+ * Improved NIS warning debconf-template (thanks to Jeff Breidenbach).
+ Closes: #215791
+ * Explicitly added libssl-dev to the libmysqlclient-dev package as it
+ is needed for mysql_config and the libmysqlclient package only depends
+ on libssl which has no unnumbered .so version (thanks to Simon Peter
+ and Davor Ocelic). Closes: #214436, #216162
+ * Added "-lwrap" to "mysql_config --libmysqld-libs" and filed it as
+ upstream bug #1650 (thanks to Noah Levitt). Closes: #214636
+
+ -- Christian Hammers <ch@debian.org> Sat, 25 Oct 2003 01:09:27 +0200
+
+mysql-dfsg (4.0.15a-1) unstable; urgency=low
+
+ * Same package as 4.0.15-2 but I could not convince the Debian
+ installer to move the packages out of incoming.
+
+ -- Christian Hammers <ch@debian.org> Tue, 7 Oct 2003 15:10:26 +0200
+
+mysql-dfsg (4.0.15-2) unstable; urgency=low
+
+ * Updated package description (thanks to Adrian Bunk). Closes: #210988
+ * Fixed small typos in manpages (thanks to Nicolas Francois).
+ Closes: #211983
+ * More updates to package description (thanks to Matthias Lutz/ddtp).
+ Closes: #213456
+ * Updated standards to 3.6.1.
+ * Closes "new 4.0.15 available" bug. Closes: #213349
+ * Updated README.Debian with notes regarding the MySQL manual section
+ "2.4 Post-installation Setup and Testing" (thanks to Daniel B.).
+ Closes: #210841
+
+ -- Christian Hammers <ch@debian.org> Fri, 3 Oct 2003 15:59:39 +0200
+
+mysql-dfsg (4.0.15-1) unstable; urgency=high
+
+ * SECURITY:
+ Users who are able to use the "ALTER TABLE" command on the "mysql"
+ database may be able to exploit this vulnerability to gain a shell with
+ the privileges of the mysql server (usually running as the 'mysql' user).
+ Closes: #210403
+ * Fixes small description typos (thanks to Oscar Jarkvik).
+ * Updated Brazilian Portuguese debconf translation. (thanks to Andre Luis
+ Lopes). Closes: 208030
+ * Replaced depricated '.' by ':' in chown (thanks to Matt Zimmerman).
+ * Fixed manpage typo (thanks to Marc Lehmann). Closes: #207090
+
+ -- Christian Hammers <ch@debian.org> Fri, 3 Oct 2003 15:59:35 +0200
+
+mysql-dfsg (4.0.14-1) unstable; urgency=low
+
+ * New upstream version.
+
+ -- Christian Hammers <ch@debian.org> Sun, 24 Aug 2003 16:40:36 +0200
+
+mysql-dfsg (4.0.13-3) unstable; urgency=low
+
+ * Now start mysqld as default unless you choose not when configurig
+ with debconf priority low. So packages depending on the server when
+ installing can access it. Thanks Matt Zimmermann (Closes: #200277)
+ * Made mysql-server de-installable if the config and database files were
+ removed by hand before. Thanks to Ard van Breemen (Closes: #200304)
+
+ -- Christian Hammers <ch@debian.org> Tue, 8 Jul 2003 22:30:40 +0200
+
+mysql-dfsg (4.0.13-2) unstable; urgency=low
+
+ * Added "nice" option for mysqld_safe to give mysqld a different priority.
+ Submitted to upstream as MySQL Bug #627. Closes: #192087
+ * Fixed possible unbound variable in init script. Closes: #194621
+ * Fixed french debconf translation (thx Christian Perrier) Closes: #194739
+ * Get rid of automake1.5 (for Eric Dorland).
+
+ -- Christian Hammers <ch@debian.org> Wed, 11 Jun 2003 18:58:32 +0200
+
+mysql-dfsg (4.0.13-1) unstable; urgency=medium
+
+ * New upstream version.
+ !!! Fixes a very bad natural join bug which justifies the urgency=medium.
+ !!! http://bugs.mysql.com/bug.php?id=291
+ * Fixed mysql_fix_privileges manpage (Frederic Briere) Closes: #191776
+ * preinst: "which" is more chatty normal executable than as builtin.
+ (Thanks to David B Harris). Closes: #188659
+
+ -- Christian Hammers <ch@debian.org> Tue, 6 May 2003 22:03:45 +0200
+
+mysql-dfsg (4.0.12-3) unstable; urgency=medium
+
+ * Reincluded new way of creating my debian-sys-maint user from
+ an old release from experimental. Now works again with old
+ and new privilege table format. (Thanks to Vincent Danjean
+ for spotting the problem) Closes: #188201
+ * Reincluded hurd build dependency fix from 3.23 branch.
+ (Thanks to Robert Millan). Closes: #185929
+ * Fixed soname in libmysqlclient-dev. Closes: #188160
+ * Remove /var/log/mysql/ when purging the package. Closes: #188064
+ * Removed /usr/share/doc/mysql/ from mysql-server. Closes: #188066
+ * Let group "adm" be able to read logfiles. Closes: #188067
+ * Do not call usermod on every upgrade. Closes: #188248
+ (Thanks to Philippe Troin for the last three)
+ * Fixed mysql-server.preinst so that it works on shells where
+ which is a builtin, too. (Thanks to Erich Schubert) Closes: #181525
+
+ -- Christian Hammers <ch@debian.org> Fri, 11 Apr 2003 11:32:45 +0200
+
+mysql-dfsg (4.0.12-2) unstable; urgency=low
+
+ *
+ * NEW MAJOR UPSTREAM RELEASE:
+ *
+ MySQL 4 has finally been declared as 'stable'. Hurray! Read changelogs.
+ Thanks to all testers, esp. Jose Luis Tallon, of the versions
+ that were in the "experimental" section before.
+ * Modified postinst script to run mysql_fix_privileges on every update.
+ IMPORTANT: Please report if this breaks anything, it is not supposed to.
+ * Wrote a SSL-MINI-HOWTO.txt!
+ * Added zlib1g-dev to libmysqlclient12-dev. Closes: 186656
+ * Changed section of libmysqlclient12-dev to libdevel.
+ * Added even more selfwritten manpages.
+ * Fixed typos.
+
+ -- Christian Hammers <ch@debian.org> Sun, 6 Apr 2003 13:47:32 +0200
+
+mysql-dfsg (4.0.10.gamma-1) experimental; urgency=low
+
+ * New upstream version.
+ * They merged some of my patches from debian/patches. Whoa!
+ * This release should fix the error-logfile problem where mysqld
+ keeps the error.log open while logrotate removes it.
+
+ -- Christian Hammers <ch@debian.org> Wed, 12 Feb 2003 22:39:48 +0100
+
+mysql-dfsg (4.0.9.gamma-1) experimental; urgency=low
+
+ * New upstream version.
+ * Updated the GNU autoconf files to make building on MIPS work.
+ See bug #176829.
+
+ -- Christian Hammers <ch@debian.org> Wed, 29 Jan 2003 22:07:44 +0100
+
+mysql-dfsg (4.0.8.gamma-1) experimental; urgency=low
+
+ * New upstream release.
+ * Improved logging of init script. Closes: #174790
+ * We have now libmysqlclient.so.12 instead of .11.
+
+ -- Christian Hammers <ch@debian.org> Thu, 9 Jan 2003 20:14:11 +0100
+
+mysql-dfsg (4.0.7.gamma-1) experimental; urgency=high
+
+ * SECURITY: This version fixes an upstream security release that is only
+ present in the 4.x branch which is currently only in the
+ experimental distribution and therefore will not get a DSA.
+ * New upstream release.
+
+ -- Christian Hammers <ch@debian.org> Sat, 28 Dec 2002 15:51:39 +0100
+
+mysql-dfsg (4.0.6.gamma-2) experimental; urgency=low
+
+ * Added --system to addgroup. Closes: #173866
+
+ -- Christian Hammers <ch@debian.org> Sat, 21 Dec 2002 15:28:26 +0100
+
+mysql-dfsg (4.0.6.gamma-1) experimental; urgency=low
+
+ * New upstream version. Now Gamma!
+ * There are no longer changes to the .orig.tar.gz neccessary to make diff
+ happy. docs/ has still to be deleted, although, as it is non-free.
+ * Incorporated patches from unstable.
+ * Added mysqlmanager and a couple of other new scripts.
+ * Enabled libmysqld embedded server library.
+ * Enabled SSL and Virtual-IO support.
+ (CORBA based MySQL-FS seems to be not existing..)
+
+ -- Christian Hammers <ch@debian.org> Fri, 20 Dec 2002 22:30:51 +0100
+
+mysql-dfsg (4.0.5a.beta-3) experimental; urgency=low
+
+ * Modified postinst to work with old and new mysql.user table format
+ and fixed spelling typo in postinst. Thanks to Roger Aich.
+ * Updated config.{guess,sub} to make the mipsel porters happy.
+ Thanks to Ryan Murray. Closes: #173553
+
+ -- Christian Hammers <ch@debian.org> Wed, 18 Dec 2002 15:56:34 +0100
+
+mysql-dfsg (4.0.5a.beta-2) experimental; urgency=low
+
+ * Upstream removed option "--skip-gemini". So did I. Closes: 173142
+
+ -- Christian Hammers <ch@debian.org> Tue, 17 Dec 2002 10:35:49 +0100
+
+mysql-dfsg (4.0.5a.beta-1) experimental; urgency=low
+
+ * First 4.x experimental package due to continuous user requests :-)
+ Please test and report!
+ * upstream: safe_mysqld has been renamed to mysqld_safe
+ * upstream: new library soname version libmysqlclient.so.11
+ * Renamed libmysqlclientXX-dev to libmysqlclient-dev as I don't plan to
+ support more than one development environment and this makes the
+ dependencies easier.
+ * FIXME: Skipped parts of the debian/patches/alpha patch as the global.h
+ is not existing.
+ * FIXME: How to get rid this? Old ltconfig patch already applied.
+ "lintian: binary-or-shlib-defines-rpath ./usr/bin/mysql /usr/lib/mysql"
+
+ -- Christian Hammers <ch@debian.org> Sun, 1 Dec 2002 18:32:32 +0100
+
+mysql-dfsg (3.23.53-4) unstable; urgency=medium
+
+ * Fixed errno.h problem. Closes: #168533, #168535
+
+ -- Christian Hammers <ch@debian.org> Sun, 10 Nov 2002 18:32:08 +0100
+
+mysql-dfsg (3.23.53-3) unstable; urgency=medium
+
+ * Changed automake build-dep to unversioned automake1.4. Closes: #166391
+ * Fixed description. Closes: #167270
+ (Thanks to Soren Boll Overgaard)
+
+ -- Christian Hammers <ch@debian.org> Tue, 5 Nov 2002 01:25:01 +0100
+
+mysql-dfsg (3.23.53-2) unstable; urgency=low
+
+ * Reverted user creation in init scripts. Closes: #166432
+ (Thanks to Birzan George Cristian)
+
+ -- Christian Hammers <ch@debian.org> Thu, 31 Oct 2002 15:36:25 +0100
+
+mysql-dfsg (3.23.53-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Christian Hammers <ch@debian.org> Thu, 24 Oct 2002 23:04:16 +0200
+
+mysql-dfsg (3.23.52-3) unstable; urgency=low
+
+ * Substituted the first-install 'debian-sys-maint' user creation by
+ something ANSI SQL compliant. Closes: #163497
+ (Thanks to Karl Hammar)
+ * Tightend dependency to debhelper (>= 4.0.12) to be sure that
+ debconf-utils gets installed, too, as I use dh_installdebconf.
+ * Fixed upstream manpage bug in mysqldump.1. Closes: #159779
+ (Thanks to Colin Watson)
+ * Added comment about MIN_WORD_LEN to mysql-server.README.Debian
+ (Thanks to Philipp Dreimann)
+ * Added a dependency for zlib1g-dev to libmysqlclient10-dev.
+ (Thanks to Jordi Mallach)
+
+ -- Christian Hammers <ch@debian.org> Sun, 15 Sep 2002 17:14:44 +0200
+
+mysql-dfsg (3.23.52-2) unstable; urgency=low
+
+ * Fixed typo in preinst scripts.
+ * Removed bashism in init script.
+ * Fixed ambiguous debconf example. Closes: #158884
+
+ -- Christian Hammers <ch@debian.org> Fri, 30 Aug 2002 00:51:29 +0200
+
+mysql-dfsg (3.23.52-1) unstable; urgency=low
+
+ * New upstream version. Closes: #157731
+ * Clearified the meaning of the debian-sys-maint special user in the
+ README.Debian file. Closes: #153702
+ * Wrote some words regarding the skip-networking in README.Debian.
+ Closes: #157038
+ * Added dependency to passwd.
+ * Fixes typo and unnecessarily complication in is_mysql_alive().
+ * Added check for /etc/mysql/my.cnf in init script.
+
+ -- Christian Hammers <ch@debian.org> Tue, 27 Aug 2002 01:53:32 +0200
+
+mysql-dfsg (3.23.51-4) unstable; urgency=low
+
+ * Added a compressed "nm mysqld" output to allow people to trace
+ core dumps with /usr/bin/resolve_stack_dump as suggested in the
+ INSTALL-SOURCE file. Thanks to atudor@labs.agilent.com for the hint.
+
+ -- Christian Hammers <ch@debian.org> Wed, 24 Jul 2002 20:44:55 +0200
+
+mysql-dfsg (3.23.51-3) unstable; urgency=low
+
+ * Corrected copyright file: the MySQL client library is licenced under
+ the LGPL-2 not the GPL. From version 4.x it actually will be GPL this
+ is why parts of http://www.mysql.com/ already say so. Closes: #153591
+ * Corrected german translation.
+ Thanks to Roland Rosenfeld <roland@spinnaker.de>. Closes: #151903
+
+ -- Christian Hammers <ch@debian.org> Thu, 11 Jul 2002 20:32:28 +0200
+
+mysql-dfsg (3.23.51-2) unstable; urgency=low
+
+ * Improved NIS tolerance in preinst script.
+
+ -- Christian Hammers <ch@debian.org> Sun, 7 Jul 2002 04:43:28 +0200
+
+mysql-dfsg (3.23.51-1) unstable; urgency=medium
+
+ * New upstream version.
+ * I applied a patch that fixes a binary imcompatibility in
+ the shared libary libmysqlclient.so.10 between 3.23.50 and
+ some versions earlier. Upstream has been contacted and asked
+ for clarification. Closes: #149952
+ * Added support for NIS i.e. it shows a warning and fails if the
+ needed 'mysql' user does not exists but works if it does.
+ Closes: #143282, #147869
+ * Substituted $0 in init scripts by something really weird so that
+ "./S20mysql restart" works now, too. (BTW: S20? install file-rc!!!)
+ Closes: #148658
+ * Now postinst works even if /etc/init.d/mysql is removed. Closes: #151021
+ * Decided to leave "set +x" in postinst but wrote comment. Closes: #151022
+
+ -- Christian Hammers <ch@debian.org> Sun, 7 Jul 2002 04:43:25 +0200
+
+mysql-dfsg (3.23.50-1) unstable; urgency=medium
+
+ * New upstream version.
+ Fixes a very annoying and important bug that lets all mysql programs
+ including perl scripts etc. segfault when using the read_default_group()
+ function. 3.23.50 is currently a pre-release and expected to be released
+ next week. I plan to propose it for woody as soon as its stability has
+ been proven. The following bug reports are all regarding this issue.
+ Closes: #144960, #145322, #136798, #138143,
+
+ -- Christian Hammers <ch@debian.org> Sat, 18 May 2002 21:14:01 +0200
+
+mysql-dfsg (3.23.49x-1) unstable; urgency=low
+
+ * I had to split the package to seperate the manual as it is not GPL
+ like the rest of the software and docs but under a license that
+ e.g. forbids selling printed versions.
+ .
+ The upstream authors were contacted a while ago but did not like to
+ change the situation.
+ .
+ The names of the resulting packages have not changed as the manual
+ already was in a seperate mysql-doc package due to it's size.
+ The source packages are now splitted from one "mysql" to
+ "mysql-dfsg" in main and "mysql-nonfree" in non-free.
+ * No code change!
+ The "x" at the end of the version number ist just to be able to
+ upload a new source package. ("a" was already taken by upstream
+ for their binary upload correction)
+
+ -- Christian Hammers <ch@debian.org> Wed, 8 May 2002 02:01:41 +0200
+
+mysql (3.23.49-8) unstable; urgency=low
+
+ * Substituted $0 in init script to let e.g. "/etc# ./init.d/mysql restart"
+ works, too. Closes: #141555
+
+ -- Christian Hammers <ch@debian.org> Sun, 7 Apr 2002 15:00:44 +0200
+
+mysql (3.23.49-7) unstable; urgency=low
+
+ * The Makefiles are totally broken for the --enable-local-infile
+ option. I now patched libmysql/libmysql.c#mysql_init() manually.
+ Closes: #138347
+
+ -- Christian Hammers <ch@debian.org> Fri, 29 Mar 2002 23:55:15 +0100
+
+mysql (3.23.49-6) unstable; urgency=low
+
+ * Moved mysqlcheck from server to client package. Closes: #139799
+ * Added manpage for mysqlhotcopy. Regarding: #87097
+ * Added 'sharedscripts' directive to the logrotate script.
+ * Replaced grep by /usr/bin/getent to let the group/user checking work
+ on NIS/LDAP systems, too. Closes: #115677, #101529
+
+ -- Christian Hammers <ch@debian.org> Fri, 22 Mar 2002 22:40:51 +0100
+
+mysql (3.23.49-5) unstable; urgency=low
+
+ * Added skip-innodb to default my.cnf.
+ * Enabled --enable-local-infile, it seems to be a new option that
+ defaults to disable a formerly enabled feaure. Closes: #137115
+
+ -- Christian Hammers <ch@debian.org> Sat, 16 Mar 2002 00:29:10 +0100
+
+mysql (3.23.49-4) unstable; urgency=medium
+
+ * Recompiled against fixed libz.
+
+ * Enabled --enable-local-infile, it seems to be a new option that
+ defaults to disable a formerly enabled feaure. Closes: #137115
+ * Fixed README.compile_on_potato. Closes: #136529
+ * Now a ext3 .jounal file in /var/lib/mysql does not prevent the
+ installation (happens when creating a jounal on an already mounted
+ partition). Closes: #137146
+
+ -- Christian Hammers <ch@debian.org> Wed, 13 Mar 2002 13:34:24 +0100
+
+mysql (3.23.49-3) unstable; urgency=low
+
+ * Added Russian translation. Closes: #135846
+ * Fixed installation of .info documents. Closes: #135030
+
+ -- Christian Hammers <ch@debian.org> Wed, 27 Feb 2002 23:36:35 +0100
+
+mysql (3.23.49-2) unstable; urgency=low
+
+ * Updated french translation and split template files. Closes: #134754
+ * Fixed a small debian.cnf related bug in mysql-server.postinst.
+
+ -- Christian Hammers <ch@debian.org> Tue, 19 Feb 2002 23:13:58 +0100
+
+mysql (3.23.49-1) unstable; urgency=low
+
+ * New upstream release.
+ (Mainly InnoDB related fixes)
+ * Exported a $HOME variable in the scripts so that /root/.my.cnf
+ is not read anymore. This will avoid problems when admins put
+ only passwords but no usernames in this file. Closes: #132048
+ * New debian-sys-maint password algorithm (now ~96bit :-)) Closes: #133863
+ * Recreating debian-sys-main pwd on every install to help people who
+ accidently delete user or password files...
+ * Added /var/log/mysql so that user can put the binary logs in there as
+ mysql cannot write the .001 etc files itself in /var/log which is
+ owned by root.
+
+ -- Christian Hammers <ch@debian.org> Thu, 14 Feb 2002 22:17:45 +0100
+
+mysql (3.23.47-6) unstable; urgency=low
+
+ * Dropped a sentence about the new debian-sys-maint user in the
+ debconf note and updated the README.Debian. Related: #132048
+ * Added more french translation. Closes: #132390
+
+ -- Christian Hammers <ch@debian.org> Wed, 6 Feb 2002 09:41:29 +0100
+
+mysql (3.23.47-5) unstable; urgency=low
+
+ * Fixed grammar error in template. Closes: #132238
+ * Really fixed typo in logrotate script. Closes: #131711
+
+ -- Christian Hammers <ch@debian.org> Tue, 5 Feb 2002 14:20:08 +0100
+
+mysql (3.23.47-4) unstable; urgency=medium
+
+ * Fixes typo in postinst that let init script fail. Closes: #131743
+ * Fixed bashism bug that failed on ash. Closes: #131697
+ * Fixed typo in logrotate script. Closes: #131711
+
+ -- Christian Hammers <ch@debian.org> Thu, 31 Jan 2002 23:58:46 +0100
+
+mysql (3.23.47-3) unstable; urgency=low
+
+ * Added new Debian specific mysql user called 'debian-sys-maint' which
+ is used for pinging the server status, flushing the logs or shutting
+ down the server in maintenance scripts. The credentials of this user
+ are stored in the UID0-only readable file /etc/mysql/debian.cnf.
+ Closes: #129887, #130326, #99274
+ * Fixed unintended server startup at boottime. Closes: #122676, #130105
+ * New upstream fixes command line parsing bug: Closes: #128473
+ * Fixed manpage headers to let apropos work: Closes: #119122
+ * Added "status" options for /etc/init.d/mysql. Closes: #129020
+
+ -- Christian Hammers <ch@debian.org> Sun, 27 Jan 2002 19:46:11 +0100
+
+mysql (3.23.47-2) unstable; urgency=low
+
+ * Enhanced init scripts by using mysqladmin instead of kill $pid.
+ Thanks to Aaron Brick.
+
+ -- Christian Hammers <ch@debian.org> Fri, 18 Jan 2002 01:42:23 +0100
+
+mysql (3.23.47-1) unstable; urgency=low
+
+ * New upstream release.
+ * Updated brazilian translation of debconf descriptions. Closes: #123332
+
+ -- Christian Hammers <ch@debian.org> Sun, 6 Jan 2002 21:11:17 +0100
+
+mysql (3.23.46-3) unstable; urgency=low
+
+ * Fixed bug in postinst where a script was accidently called with
+ "bash -c <script> -IN_RPM" prevting the first argument to take effect
+ and then leading to failures on hosts with unresolvable hostnames.
+ Closes: #126147
+ * Small changes and comments in postinst.
+
+ -- Christian Hammers <ch@debian.org> Sat, 22 Dec 2001 14:03:02 +0100
+
+mysql (3.23.46-2) unstable; urgency=low
+
+ * Start/stop behaviour now configurable via debconf. Closes: #112174
+
+ -- Christian Hammers <ch@debian.org> Sun, 9 Dec 2001 21:38:54 +0100
+
+mysql (3.23.46-1) unstable; urgency=low
+
+ * New upstream release.
+ Only few fixes, mainly innodb related.
+
+ -- Christian Hammers <ch@debian.org> Sun, 2 Dec 2001 03:08:48 +0100
+
+mysql (3.23.45-1) unstable; urgency=low
+
+ * New upstream version.
+ Only few fixes, mainly innodb related.
+ * Added debconf note regarding the skip-networking option.
+
+ -- Christian Hammers <ch@debian.org> Sun, 25 Nov 2001 16:50:37 +0100
+
+mysql (3.23.44-2) unstable; urgency=low
+
+ * Finally removed debconf toggled "skip-networking" line add/remove
+ code for /etc/mysql/my.cnf. I don't like editing a file that's tagged
+ as configuration file.
+ I disabled networking by default for security reasons. Better ideas?
+
+ -- Christian Hammers <ch@debian.org> Fri, 16 Nov 2001 02:11:02 +0100
+
+mysql (3.23.44-1) unstable; urgency=low
+
+ * New upstream release.
+ - fixes replication bug (core dump)
+ * Made description better english :) Thanks to D. Welton.
+
+ -- Christian Hammers <ch@debian.org> Sun, 11 Nov 2001 15:44:07 +0100
+
+mysql (3.23.43-4) unstable; urgency=low
+
+ * Disabled statically linking.
+
+ -- Christian Hammers <ch@debian.org> Sat, 10 Nov 2001 03:15:56 +0100
+
+mysql (3.23.43-3) unstable; urgency=low
+
+ * Changed compiler settings after one user reported instabilities.
+ See #116631 for more information.
+
+ -- Christian Hammers <ch@debian.org> Tue, 30 Oct 2001 21:39:17 +0100
+
+mysql (3.23.43-2) unstable; urgency=low
+
+ * Patched sparc mutexes again. Closes: #113430
+
+ -- Christian Hammers <ch@debian.org> Sun, 7 Oct 2001 15:09:00 +0200
+
+mysql (3.23.43-1) unstable; urgency=low
+
+ * New upstream version.
+ - Fixed some unlikely(sic!) bugs and core dumps.
+ - Fixed a bug with BDB tables and UNIQUE columns that are NULL.
+ - [more minor bugs were fixed; see changelog]
+ * Adjusted build depends on libwrap0 for IA-64. Closes: #114582
+ * Added the mysqlcheck binary. Closes: #114490
+ * Fixed rules for arm architecture. Closes: #88186
+ * Renamed mysql_print_defaults to the original name my_print_defaults.
+ Isn't as descriptive but else I'd have to patch too much. Closes: #114492
+
+ -- Christian Hammers <ch@debian.org> Fri, 5 Oct 2001 22:24:40 +0200
+
+mysql (3.23.42-2) unstable; urgency=low
+
+ * Applied patch for m68k compile. Closes: #112904
+
+ -- Christian Hammers <ch@debian.org> Sun, 23 Sep 2001 21:32:57 +0200
+
+mysql (3.23.42-1) unstable; urgency=low
+
+ * New upstream releae.
+ Fixes critical bug with InnoDB and large BLOBs.
+
+ -- Christian Hammers <ch@debian.org> Tue, 18 Sep 2001 22:25:47 +0200
+
+mysql (3.23.41-2) unstable; urgency=low
+
+ * Fixed shlibs.local problem. Closes: #111573
+ * Replaced emacs by sensible-editor in mysqlbug.sh. Thanks Hans Ginzel.
+
+ -- Christian Hammers <ch@debian.org> Sun, 9 Sep 2001 17:16:42 +0200
+
+mysql (3.23.41-1) unstable; urgency=low
+
+ * New upstream release
+ * Fixed build problem on ia64. Closes: #110624
+
+ -- Christian Hammers <ch@debian.org> Tue, 14 Aug 2001 23:20:35 +0200
+
+mysql (3.23.40-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Christian Hammers <ch@debian.org> Sun, 5 Aug 2001 19:46:18 +0200
+
+mysql (3.23.39-5) unstable; urgency=low
+
+ * Added debconf template for brazil. Closes: #106934, #106752
+ * Tightened dependencies on debconf.
+ * Adjusted mysql.err permissions in logrotate script to 0600. Closes: #105672
+
+ -- Christian Hammers <ch@debian.org> Mon, 30 Jul 2001 00:10:12 +0200
+
+mysql (3.23.39-4.1) unstable; urgency=low
+
+ * Maintainer-requested NMU.
+ * Fixing thread mutexes on Sparc and Alpha
+ (closes: Bug#101783)
+ * Added --enable-assembler for sparc. This should
+ allow mysql on sparc to use assembler versions of
+ some string functions (read: should speed up a bit).
+
+ -- Christopher C. Chimelis <chris@debian.org> Fri, 13 Jul 2001 15:09:30 -0400
+
+mysql (3.23.39-4) unstable; urgency=low
+
+ * Porting fixes.
+
+ -- Christian Hammers <ch@debian.org> Mon, 9 Jul 2001 17:56:54 +0200
+
+mysql (3.23.39-3.1) unstable; urgency=low
+
+ * NMU (for porting)
+ * Update config.sub and config.guess for hppa, sh & s390.
+ * Add --with-client-ldflags=-lstdc++ to configure line. Closes: #100884
+
+ -- Matthew Wilcox <willy@debian.org> Sun, 8 Jul 2001 19:26:59 -0600
+
+mysql (3.23.39-3) unstable; urgency=low
+
+ * Disabled berkeley-db on sparc again. Mutexes aren't working again :-(
+
+ -- Christian Hammers <ch@debian.org> Sat, 7 Jul 2001 18:30:08 +0200
+
+mysql (3.23.39-2) unstable; urgency=low
+
+ * Bugfixed the m68k mutex patch. Thanks to Michael Fedrowitz. Closes: #103145
+ * Removed config.cache files in bdb/ and innobase/. Closes: #103143
+
+ -- Christian Hammers <ch@debian.org> Wed, 4 Jul 2001 22:06:58 +0200
+
+mysql (3.23.39-1) unstable; urgency=low
+
+ * New upstream release. Minor bugfixes only.
+
+ -- Christian Hammers <ch@debian.org> Thu, 14 Jun 2001 13:53:03 +0200
+
+mysql (3.23.38-4) unstable; urgency=low
+
+ * Added logcheck files. Closes: #99131
+ (I can't let the usermod away since I don't know of an easy way to
+ retrive "passwd" information in a shell script considering that
+ people use different storage methods like LDAP/NIS instead of passwd.)
+
+ -- Christian Hammers <ch@debian.org> Fri, 8 Jun 2001 21:04:25 +0200
+
+mysql (3.23.38-3) unstable; urgency=low
+
+ * Explicit pointet to /root/.my.cnf to let /etc/init.d/mysql stop
+ work in sudo environments with $HOME!=/root work, too. Closes: #98324
+ * Removes empty /etc/mysql on purge. Closes: #98164
+
+ -- Christian Hammers <ch@debian.org> Tue, 22 May 2001 10:13:06 +0200
+
+mysql (3.23.38-2) unstable; urgency=low
+
+ * Added depends to libdbd-mysql-perl for mysql-server. Closes: #94306
+
+ -- Christian Hammers <ch@debian.org> Sat, 19 May 2001 19:43:26 +0200
+
+mysql (3.23.38-1) unstable; urgency=low
+
+ * New upstream release.
+ * Added Build-Depends to procps. Closes: #96768
+
+ -- Christian Hammers <ch@debian.org> Sun, 13 May 2001 17:30:15 +0200
+
+mysql (3.23.37-5) unstable; urgency=low
+
+ * Applied mutex patch for bdb support on m68k.
+ Thanks to Michael Fedrowitz for the patch.
+
+ -- Christian Hammers <ch@debian.org> Mon, 7 May 2001 12:30:40 +0200
+
+mysql (3.23.37-4) unstable; urgency=low
+
+ * Enable bdb support for m68k architecture.
+
+ -- Christian Hammers <ch@debian.org> Sat, 5 May 2001 16:47:36 +0200
+
+mysql (3.23.37-3) unstable; urgency=low
+
+ * Added thread-safe client library. Thanks to Shane Wegner. Closes: #95441
+
+ -- Christian Hammers <ch@debian.org> Sat, 28 Apr 2001 09:45:00 -0400
+
+mysql (3.23.37-2) unstable; urgency=low
+
+ * Added sparc to the list of BDB supporting architectures after some
+ tests on vore.debian.org and mails with Ben Collons.
+
+ -- Christian Hammers <ch@debian.org> Fri, 27 Apr 2001 09:30:09 -0400
+
+mysql (3.23.37-1) unstable; urgency=low
+
+ * New upstream version.
+ * Added gemini table support.
+ * Does anybody know how to enable SSL?
+ * Fixed ARM compilation problem. Closes: #88186
+
+ -- Christian Hammers <ch@debian.org> Sat, 21 Apr 2001 11:48:46 -0400
+
+mysql (3.23.36-2) unstable; urgency=low
+
+ * Added patch by Christopher C. Chimelis <chris@debian.org> to make
+ Berkeley db3 work again on Alpha architecture. Closes: #92787
+
+ -- Christian Hammers <ch@debian.org> Tue, 3 Apr 2001 23:41:46 +0200
+
+mysql (3.23.36-1) unstable; urgency=high
+
+ * New upstream version.
+ * SECURITY FIX: One could place database tables outside the database
+ directory by using '..' in one of the mysql helper programs where the
+ table name was not checked correctly. This could lead to root compromise
+ if the server would be running as root else you could at least do bad
+ things as user mysql.
+ * upstream: Fixed bug when thread creation failed.
+ * upstream: Fixed problem in Innobase with non-latin1 charsets
+ * upstream: Fixed a core-dump bug when using very complex query with DISTINGT
+ * upstream: many others so called minor bugs...
+ * fixes bug in init script. Closes: #90257
+ (this report was agains some older problem that has been fixed too in .33)
+
+ -- Christian Hammers <ch@debian.org> Fri, 30 Mar 2001 02:55:12 +0200
+
+mysql (3.23.35-1) unstable; urgency=medium
+
+ * New upstream relase.
+ * Fixes problem in ORDER BY clause. People using 3.33.34 should upgrade!
+ * Includes innobase support.
+ (Hope this is not such a catastrophe like berkeley db...)
+
+ -- Christian Hammers <ch@debian.org> Fri, 16 Mar 2001 23:30:30 +0100
+
+mysql (3.23.33-3) unstable; urgency=low
+
+ * Forgot #!/bin/sh at top of mysql-doc.postinst. Closes: #89801
+
+ -- Christian Hammers <ch@vore.debian.org> Thu, 15 Mar 2001 20:38:35 -0500
+
+mysql (3.23.33-2) unstable; urgency=low
+
+ * Added some missing scripts and manpages. Closes: #84068
+ * Added dependency to perl-5.6. Closes: #81942
+ * Added french templates somewhen ago. Closes: #83790
+ * Added patch to get db3 working on Alpha. Closes: #86033
+ Thanks to Christopher C. Chimelis <chris@debian.org>. The patch
+ itself is included as debian/patch.alpha, too.
+
+ -- Christian Hammers <ch@debian.org> Sun, 18 Feb 2001 06:40:40 +0100
+
+mysql (3.23.33-1) unstable; urgency=high
+
+ * Fixes two security bugs that allowes crashing the server and maybe
+ gaining the UID of the process that is linked against libmysqlclient!
+
+ -- Christian Hammers <ch@debian.org> Tue, 13 Feb 2001 23:01:18 +0100
+
+mysql (3.23.32-1) unstable; urgency=low
+
+ * New upstream releaes.
+ (just minor fixes)
+ * Added french and german debconf templates.
+
+ -- Christian Hammers <ch@debian.org> Sun, 4 Feb 2001 17:27:07 +0100
+
+mysql (3.23.31-1) unstable; urgency=high
+
+ * New upstream release.
+ * Fixes security bug that was announced at BUGTRAQ mailing list.
+ (Disappointingly not by mysql.com!). And allows a buffer overflow
+ and therefore access to the mysql UID and all databases when already
+ having a valid account. Closes: #82881
+
+ -- Christian Hammers <ch@debian.org> Sat, 20 Jan 2001 11:14:36 +0100
+
+mysql (3.23.30-2) unstable; urgency=low
+
+ * Recompiled with new dpkg-dev.
+
+ -- Christian Hammers <ch@debian.org> Sun, 14 Jan 2001 22:20:55 +0100
+
+mysql (3.23.30-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Christian Hammers <ch@debian.org> Sun, 7 Jan 2001 22:10:18 +0100
+
+mysql (3.23.28-10) testing unstable; urgency=low
+
+ * I must upload to "testing" to get it into woody, right?!
+
+ -- Christian Hammers <ch@debian.org> Fri, 29 Dec 2000 14:43:57 +0100
+
+mysql (3.23.28-9) unstable; urgency=low
+
+ * Made it a replacement for libmysqlclient9.
+
+ -- Christian Hammers <ch@westend.com> Mon, 25 Dec 2000 19:15:04 +0100
+
+mysql (3.23.28-8) unstable; urgency=low
+
+ * Applied patch from a user to get the skip-networking option working!
+ Approved from a mysql employee but please test anyways.
+ This finally: Closes: #79672, #78634, #79660, #79658
+
+ -- Christian Hammers <ch@debian.org> Sat, 16 Dec 2000 14:01:36 +0100
+
+mysql (3.23.28-6) unstable; urgency=medium
+
+ * Fixed error in postinst. Closes: #79392, #79400, #79451, #79550
+ * Added .info files again on user request. Closes: #78988, #75737
+
+ -- Christian Hammers <ch@debian.org> Wed, 13 Dec 2000 21:18:24 +0100
+
+mysql (3.23.28-5) unstable; urgency=low
+
+ * Fixed a stupid bug in mysql-server.postinst regarding the
+ configuration of skip-networking. Closes: #78639, 78634
+ * Used patched bdb which hopefully enables mutexes on Alpha. Closes: #78197
+ * Added dependency to adduser. Closes: #76798
+
+ -- Christian Hammers <ch@debian.org> Sun, 10 Dec 2000 16:55:48 +0100
+
+mysql (3.23.28-4) unstable; urgency=low
+
+ [never uploaded]
+ * Fixed a stupid bug in mysql-server.postinst regarding the
+ configuration of skip-networking. Closes: #78639, 78634
+ * Used patched bdb which hopefully enables mutexes on Alpha. Closes: #78197
+
+ -- Christian Hammers <ch@debian.org> Sun, 3 Dec 2000 17:49:44 +0100
+
+mysql (3.23.28-3) unstable; urgency=low
+
+ * This time really fixed m68k build error. Closes: #78235
+
+ -- Christian Hammers <ch@debian.org> Sun, 3 Dec 2000 15:02:55 +0100
+
+mysql (3.23.28-2) unstable; urgency=low
+
+ * Adjusted rules file to make it buildable on m86k. Closes: #78235
+
+ -- Christian Hammers <ch@debian.org> Fri, 1 Dec 2000 20:07:26 +0100
+
+mysql (3.23.28-1) unstable; urgency=low
+
+ * New upstream vesrion. Now gamma!
+ * Changed umask of mysql.log making it o-rw
+ * Disabled listening on network reachable TCP ports by default due to
+ security considerations.
+
+ -- Christian Hammers <ch@debian.org> Thu, 23 Nov 2000 20:12:50 +0100
+
+mysql (3.23.27-1) unstable; urgency=low
+
+ * New upstream version.
+ * Closes: #75711
+
+ -- Christian Hammers <ch@debian.org> Sun, 29 Oct 2000 14:29:51 +0100
+
+mysql (3.23.25-4) unstable; urgency=low
+
+ * Recompiled to get rid of the dependency for zlib1 (libc5).
+ Closes: #74952, #74939
+
+ -- Christian Hammers <ch@debian.org> Tue, 17 Oct 2000 14:34:52 +0200
+
+mysql (3.23.25-3.1) unstable; urgency=low
+
+ * Maintainer-approved NMU.
+ * Includes patch to fix and enable db3 support on Alpha.
+ * Enable support for thread mutexes in db3 on sparc
+ (it works after all, according to Ben Collins)
+ * Removed atomic_ functions for Alpha since they are no
+ longer supported in the current glibc in woody.
+ * Cleaned up rules file a bit.
+
+ -- Christopher C. Chimelis <chris@debian.org> Sat, 14 Oct 2000 04:22:02 -0400
+
+mysql (3.23.25-3) unstable; urgency=low
+
+ * Upstream decided not to include my_config.h,my_dir.h into the installed
+ header files. As this file contains at least informative material
+ and more important is checked by several autoconf scripts I
+ included it by hand again.
+ * Made building of berkeley db conditional to architecture until
+ I get response whether it works on sparc/alpha now.
+
+ -- Christian Hammers <ch@debian.org> Wed, 11 Oct 2000 23:58:38 +0200
+
+mysql (3.23.25-2) unstable; urgency=medium
+
+ * Last build went terrible wrong.. Here's the changelog again:
+ * New upstream release.
+ * Shared library version was raised from 9 to 10.
+ Maintainers of packets using libmysqlclient9 must recompile!
+
+ -- Christian Hammers <ch@debian.org> Wed, 11 Oct 2000 01:16:34 +0200
+
+mysql (3.23.25-1) unstable; urgency=low
+
+ * New upstream release.
+ * Shared library version was raised from 9 to 10.
+ Maintainers of packets using libmysqlclient9 must recompile!
+
+ -- Christian Hammers <ch@debian.org> Sat, 7 Oct 2000 18:21:51 +0200
+
+mysql (3.23.24-2) unstable; urgency=low
+
+ * Applied upstream patch regarding quoting of mysqldump.
+ * Updated to db-3.1.17-patched (from www.mysql.com)
+
+ -- Christian Hammers <ch@debian.org> Fri, 15 Sep 2000 18:58:14 +0200
+
+mysql (3.23.24-1) unstable; urgency=medium
+
+ * New upstream version with some important fixes.
+ * upstream: Last version corrupted CHAR/VARCHAR/BLOB columns with
+ chararacters above ASCII 128! Check and repair all these tables.
+ * upstream: fixed small memory leak
+ * upstream: fixed problem with BDB tables and reading on unique
+ (not primary) key.
+ * Disabled BDB tables on all architectures except i386 due to many
+ bug reports (see #71206). -> HELP APPRECIATED <-
+
+ -- Christian Hammers <ch@debian.org> Tue, 12 Sep 2000 06:18:54 +0200
+
+mysql (3.23.23-2) unstable; urgency=low
+
+ * Strange... "nohup nice" gives differnet results and let therefore
+ crash safe_mysqld when starting up. Apparently it seems to be
+ kernel dependand. Now fixed by another conditional. This
+ more or less Closes: #71057
+ * This bug was reported (accidently) in the following identical reports:
+ Closes: #71253, #71254, #71257, #71258, #71259, #71262, #71266, #71267
+ Closes: #71268, #71271, #71275, #71277, #71278, #71283, #71291
+
+ -- Christian Hammers <ch@debian.org> Sat, 9 Sep 2000 20:13:50 +0200
+
+mysql (3.23.23-1) unstable; urgency=low
+
+ * New upstream version. Feature freeze!
+ * Fixed source build problem. Closes: #70707
+
+ -- Christian Hammers <ch@debian.org> Thu, 31 Aug 2000 10:03:35 +0200
+
+mysql (3.23.22b-1) unstable; urgency=low
+
+ * Reorganised docs. Now we have several small html files instead of
+ one with almost 2M. Closes: 70431
+ * Removed pdf,ps and html from source package shrinked it about 3M
+ (therefore the .orig.tar.gz is called 3.23.22b!)
+ * -> Last upload failed due to problems at the FTP site so here the
+ -> changelog again:
+ * Fixes memory leak, commit/rollback, reserved word "MASTER" ...
+ * Added Berkeley DB3 source code to the Debian diff to be able to
+ compile with bdb transaction support! (Great feature!!!)
+ * Upstream correction of error message. Closes: #68939
+ * Upstream correction of reserved word "source".
+
+ -- Christian Hammers <ch@debian.org> Fri, 25 Aug 2000 19:21:24 +0200
+
+mysql (3.23.22-1) unstable; urgency=low
+
+ * New upstream version.
+ * Fixes memory leak, commit/rollback, reserved word "MASTER" ...
+ * Added Berkeley DB3 source code to the Debian diff to be able to
+ compile with bdb transaction support! (Great feature!!!)
+ * Upstream correction of error message. Closes: #68939
+ * Upstream correction of reserved word "source".
+
+ -- Christian Hammers <ch@debian.org> Sun, 20 Aug 2000 09:05:48 +0200
+
+mysql (3.23.21-4) unstable; urgency=low
+
+ * Added libmysqlclient9.shlibs and shlibs.local file. Closes: #68669
+
+ -- Christian Hammers <ch@debian.org> Wed, 9 Aug 2000 14:22:49 +0200
+
+mysql (3.23.21-3) unstable; urgency=low
+
+ * Let "/etc/init.d/mysql restart" wait until the pid has been
+ removed before (but max 6 seconds) before restarting. Closes: 65070
+ * Added build dependencies.
+
+ -- Christian Hammers <ch@debian.org> Sun, 30 Jul 2000 16:16:48 +0200
+
+mysql (3.23.21-2) unstable; urgency=low
+
+ * Typo in safe_mysqld prevents start.
+
+ -- Christian Hammers <ch@debian.org> Sat, 29 Jul 2000 13:40:50 +0200
+
+mysql (3.23.21-1) unstable; urgency=low
+
+ * New upstream version.
+
+ -- Christian Hammers <ch@debian.org> Mon, 10 Jul 2000 22:54:17 +0200
+
+mysql (3.23.20-1) unstable; urgency=low
+
+ * MySQL finally got fully GPL'ed! This means that there is only one
+ souce package and only main/* binary packages from now on.
+ * Fixed symlink in libmysqlclient9-dev. Closes: 66452
+ * Apart from that the usual bug fixes for BETA software.
+
+ -- Christian Hammers <ch@debian.org> Mon, 3 Jul 2000 20:05:38 +0200
+
+mysql-pd (3.23.16-1) unstable; urgency=low
+
+ * New upstream release. (Actually a brand new upstream branch!)
+ * Added mysql-common package as the configuration file can be used
+ by all versions of the mysql client library.
+ Did some more package reorganisations, too. See README.Debian file!
+ * libmysqlclient.so raised major version from 6 to 9.
+ * Minor beautifications in the debian/ directory.
+
+ -- Christian Hammers <ch@debian.org> Sat, 27 May 2000 20:30:01 +0200
+
+mysql-gpl (3.22.30-2) frozen unstable; urgency=low
+
+ * Fixed path in libmysqlclient.la. Closes: #58875
+
+ -- Christian Hammers <ch@debian.org> Sat, 25 Jan 2020 20:27:29 -0700
+
+mysql-gpl (3.22.30-1) frozen unstable; urgency=low
+
+ * A small change in the libmysqlclient6 causes mysqladmin to print an
+ shared library error when displaying the defaults. Everything else
+ works fine so this error wasn't detected untill now. Closes: #58033
+ * TcX released a new MySQL version that includes another security patch,
+ this time against mysqlaccess. The author told me that it would be
+ fine if I just included the new .c in this source since I don't want
+ go to 3.22.32 in frozen.
+ * ->Release Manager: Although the version number increased there is
+ no new coded except for the shared library. The rest is the same
+ as in mysql-server and mysql-client.
+
+ -- Christian Hammers <ch@debian.org> Tue, 15 Feb 2000 23:26:54 +0100
+
+mysql-gpl (3.22.29-1) unstable; urgency=low
+
+ * New upstream version.
+
+ -- Christian Hammers <ch@debian.org> Thu, 6 Jan 2000 20:37:23 +0100
+
+mysql-gpl (3.22.27a-3) unstable; urgency=low
+
+ * Use system readline instead of bundled version. Closes: #50069
+ Any objections ?
+
+ -- Christian Hammers <ch@debian.org> Sun, 14 Nov 1999 18:09:48 +0100
+
+mysql-gpl (3.22.27a-2) unstable; urgency=low
+
+ * Now building mysql-gpl-doc in binary-indep.
+
+ -- Christian Hammers <ch@debian.org> Sat, 23 Oct 1999 04:22:36 +0200
+
+mysql-gpl (3.22.27a-1) unstable; urgency=low
+
+ * Adjusted version number to allow new orig.tar.gz.
+ The old seems broken :-( People reported compilation problems.
+ * Changed mysql-gpl-doc to "Architecture: all".
+
+ -- Christian Hammers <ch@debian.org> Sun, 17 Oct 1999 13:01:35 +0200
+
+mysql-gpl (3.22.27-1) unstable; urgency=low
+
+ * New upstream release. Fixes charset problem.
+
+ -- Christian Hammers <ch@debian.org> Mon, 11 Oct 1999 18:01:40 +0200
+
+mysql-gpl (3.22.26a-1) unstable; urgency=low
+
+ * New upstream version. Just some small bug fixes.
+ * FHS compliance.
+
+ -- Christian Hammers <ch@debian.org> Sun, 3 Oct 1999 10:16:14 +0200
+
+mysql-gpl (3.22.25-2) unstable; urgency=low
+
+ * Added conflict to all old mysql-dev packages. (fixes: #42966)
+
+ -- Christian Hammers <ch@debian.org> Sun, 15 Aug 1999 11:35:46 +0200
+
+mysql-gpl (3.22.25-1) unstable; urgency=low
+
+ * New upstream version. (We are waiting for 3.23.x !)
+ * Fixes some upstream small bugs.
+
+ -- Christian Hammers <ch@debian.org> Sun, 18 Jul 1999 22:02:06 +0200
+
+mysql-gpl (3.22.23b-4) unstable; urgency=low
+
+ * Rebuild for new perl.
+
+ -- Christian Hammers <ch@debian.org> Thu, 8 Jul 1999 01:09:57 +0200
+
+mysql-gpl (3.22.23b-3) unstable; urgency=low
+
+ * libmysqlclient had the wrong socket path.
+
+ -- Christian Hammers <ch@debian.org> Sun, 03 Jul 1999 23:13:30 +0200
+
+mysql-gpl (3.22.23b-2) unstable; urgency=low
+
+ * Missed one replace tag to an very old version of mysql-devel.
+
+ -- Christian Hammers <ch@debian.org> Sun, 27 Jun 1999 19:13:30 +0200
+
+mysql-gpl (3.22.23b-1) unstable; urgency=low
+
+ * New upstream minor version.
+ * Cleaned up the dependencies a bit.
+
+ -- Christian Hammers <ch@debian.org> Sun, 27 Jun 1999 19:13:30 +0200
+
+mysql-gpl (3.22.22-1) unstable; urgency=low
+
+ * New upstream version. (closes Bug#36493,37340)
+ * New maintainer upload.
+ * Package reorganisation: We prepare for the GPL'ed server which will
+ * be released soon and make the structure more clear to the user.
+
+ -- Christian Hammers <ch@debian.org> Mon, 3 May 1999 20:43:41 +0200
+
+mysql (3.22.21-1) unstable; urgency=low
+
+ * Never released. TcX was too fast :-)
+
+ -- Christian Hammers <ch@debian.org> Tue, 20 Apr 1999 17:22:04 +0200
+
+mysql-freebits (3.21.33b-3) unstable; urgency=low
+
+ * Recompile with libncurses
+
+ -- Scott Hanson <shanson@debian.org> Sat, 31 Oct 1998 15:04:39 +0100
+
+mysql-freebits (3.21.33b-2) unstable; urgency=low
+
+ * Recompile with libstdc++2.9 (fixes #27792)
+
+ -- Scott Hanson <shanson@debian.org> Mon, 12 Oct 1998 18:47:25 +0200
+
+mysql-freebits (3.21.33b-1) unstable; urgency=low
+
+ * New upstream version (probably the last for 3.21)
+
+ -- Scott Hanson <shanson@debian.org> Tue, 8 Sep 1998 18:59:37 +0200
+
+mysql-freebits (3.21.33-4) unstable; urgency=low
+
+ * Separate out non-free source files, move mysql-base, mysql-dev, and
+ * mysql-doc to main distribution
+ * Locale files /usr/share/mysql/ now in server, not base; therefore...
+ * Add conflict to mysql-server <=3.21.33-3
+
+ -- Scott Hanson <shanson@debian.org> Fri, 31 Jul 1998 19:16:08 +0200
+
+mysql (3.21.33-3) unstable; urgency=low
+
+ * Release to unstable with moved socket (fixes #24574)
+ * Add conflict to old libdbd-mysql-perl package
+
+ -- Scott Hanson <shanson@debian.org> Wed, 22 Jul 1998 22:17:43 +0200
+
+mysql (3.21.33-2) experimental; urgency=low
+
+ * Move socket from /tmp to /var/run (see #24574)
+ * Release to experimental, since this breaks everything statically
+ * linked to libmysqlclient!
+
+ -- Scott Hanson <shanson@debian.org> Wed, 15 Jul 1998 19:37:01 +0200
+
+mysql (3.21.33-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Scott Hanson <shanson@debian.org> Sun, 12 Jul 1998 08:18:18 +0200
+
+mysql (3.21.32a-1) unstable; urgency=low
+
+ * New upstream release
+ * Lintian bugs: ldconfig, missing manpage, call to perl5
+ * Lintian bug shlib-with-non-pic-code _not_ yet fixed
+
+ -- Scott Hanson <shanson@debian.org> Sat, 4 Jul 1998 07:57:13 +0200
+
+mysql (3.21.31-1) unstable frozen; urgency=low
+
+ * New upstream release for hamm and slink (bug fixes only)
+ * Fix unsecure use of temp file in mysqlbug (fixes #23606)
+ * Added brief licensing information to control file
+
+ -- Scott Hanson <shanson@debian.org> Tue, 16 Jun 1998 10:52:44 +0200
+
+mysql (3.21.30-3) unstable; urgency=low
+
+ * Restore missing shared library dependencies for mysql-server
+
+ -- Scott Hanson <shanson@debian.org> Mon, 15 Jun 1998 07:51:58 +0200
+
+mysql (3.21.30-2) unstable; urgency=low
+
+ * Simplify debian/rules (fixes #17662)
+ * Edit manual.texi to add "Debian notes" to documentation
+ * Add note about passwords on command line (fixes #16471)
+ * Add note about getting privleges for users (fixes #22891)
+ * Correct "Possible license changes" heading (fixes #22711)
+ * Add uninstalled header files to /usr/doc/mysql-dev/examples (fixes #22627)
+ * Add udf_example.cc to /usr/doc/mysql-dev/examples (fixes #22710)
+
+ -- Scott Hanson <shanson@debian.org> Sun, 7 Jun 1998 13:05:37 +0200
+
+mysql (3.21.30-1) unstable; urgency=low
+
+ * Stable upstream release
+
+ -- Scott Hanson <shanson@debian.org> Tue, 12 May 1998 22:13:25 +0200
+
+mysql (3.21.29gamma-1) unstable; urgency=low
+
+ * New upstream release
+ * Do not create 'mysql' subdirectory for libs and headers (fixes #19020)
+ * Remove 'CXX=gcc' flag from configure (g++ now standard)
+
+ -- Scott Hanson <shanson@debian.org> Sun, 12 Apr 1998 18:38:03 +0200
+
+mysql (3.21.28gamma-1) unstable; urgency=low
+
+ * New upstream release
+ * Unstable-only release; hamm stays at 3.21.25 for now
+
+ -- Scott Hanson <shanson@debian.org> Thu, 2 Apr 1998 21:33:51 +0200
+
+mysql (3.21.25gamma-3) unstable frozen; urgency=low
+
+ * Have mysql-base suggest perl >= 5.004 for mysqlaccess (fixes #19593)
+ * Fix shlibs to refer to mysql-base rather than the no-longer-existant mysql
+
+ -- Scott Hanson <shanson@debian.org> Thu, 26 Mar 1998 18:22:59 +0100
+
+mysql (3.21.25gamma-2) unstable; urgency=low
+
+ * Restore libmysqlclient.so symlink to mysql-dev (fixes #19036)
+
+ -- Scott Hanson <shanson@debian.org> Sun, 8 Mar 1998 10:46:43 +0100
+
+mysql (3.21.25gamma-1) unstable; urgency=low
+
+ * Check if running as root in init.d script (fixes #18577)
+ * New upstream release
+
+ -- Scott Hanson <shanson@debian.org> Fri, 27 Feb 1998 20:01:30 +0100
+
+mysql (3.21.24gamma-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Scott Hanson <shanson@debian.org> Mon, 23 Feb 1998 08:14:17 +0100
+
+mysql (3.21.23beta-3) unstable; urgency=low
+
+ * Squashed errors found by lintian
+
+ -- Scott Hanson <shanson@debian.org> Tue, 17 Feb 1998 20:19:01 +0100
+
+mysql (3.21.23beta-2) unstable; urgency=low
+
+ * Fixed overlaps with old mysql package (fixes #17843)
+
+ -- Scott Hanson <shanson@debian.org> Thu, 5 Feb 1998 22:55:00 +0100
+
+mysql (3.21.23beta-1) unstable; urgency=low
+
+ * New upstream release
+ * Fix include lines in mysql.h (fixes #17827)
+ * Move /usr/include/mysql to mysql-dev
+
+ -- Scott Hanson <shanson@debian.org> Wed, 4 Feb 1998 19:59:14 +0100
+
+mysql (3.21.22beta-3) unstable; urgency=low
+
+ * Correct descriptions in control file (fixes #17698)
+ * Clean up output of shutdown script
+
+ -- Scott Hanson <shanson@debian.org> Sat, 31 Jan 1998 19:04:29 +0100
+
+mysql (3.21.22beta-2) unstable; urgency=low
+
+ * Split out mysql-dev and mysql-bench subpackages
+
+ -- Scott Hanson <shanson@debian.org> Wed, 28 Jan 1998 19:52:27 +0100
+
+mysql (3.21.22beta-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Scott Hanson <shanson@debian.org> Wed, 28 Jan 1998 18:59:09 +0100
+
+mysql (3.21.21a.beta-2) unstable; urgency=low
+
+ * Compile with libpthreads from libc6-dev_2.0.6-3 rather than statically
+ linking to patched libpthreads (see changes to 3.20.29-2)
+
+ -- Scott Hanson <shanson@debian.org> Sun, 25 Jan 1998 13:17:15 +0100
+
+mysql (3.21.21a.beta-1) unstable; urgency=low
+
+ * Put initial database, mysql_install_db, safe_mysqld, isamlog and
+ isamchk in mysql-server
+ * Correct upstream release number so source packages are correctly built
+
+ -- Scott Hanson <shanson@debian.org> Mon, 19 Jan 1998 07:52:48 +0100
+
+mysql (3.21.21.beta-1) unstable; urgency=low
+
+ * Use debhelper where possible in rules
+ * Split binary packages into mysql-base, mysql-client, mysql-doc
+ * New upstream release
+
+ -- Scott Hanson <shanson@debian.org> Thu, 15 Jan 1998 08:12:17 +0100
+
+mysql (3.21.19.beta-1) unstable; urgency=low
+
+ * Offer to set root password in mysql_install_db
+ * Kill `pidof mysqld` on shutdown rather than use mysqladmin
+ * New upstream version
+
+ -- Scott Hanson <shanson@debian.org> Fri, 9 Jan 1998 20:06:35 +0100
+
+mysql (3.21.17a.beta-2) unstable; urgency=low
+
+ * Remove perl stuff (it's going back into libdbd-mysql-perl)
+ * Remove conflict with libdbd-mysql-perl
+ * Do not compress *html files (fixes #16314)
+
+ -- Scott Hanson <shanson@debian.org> Tue, 30 Dec 1997 07:34:20 +0100
+
+mysql (3.21.17a.beta-1) unstable; urgency=low
+
+ * Add conflict to libdbd-mysql-perl
+ * Use --pid-file option to place pid file in /var/run rather than patching
+ * Add install-info to postinst and postrm
+ * Add filename to message shown by mysql_install_db (fixes #16621)
+ * New upstream version
+
+ -- Scott Hanson <shanson@debian.org> Sun, 21 Dec 1997 19:41:45 +0100
+
+mysql (3.20.32a-5) unstable; urgency=low
+
+ * Move mysqld to /usr/lib/mysql, per policy discussion
+ * Adjust makefiles so perl libs get installed
+
+ -- Scott Hanson <shanson@debian.org> Wed, 3 Dec 1997 22:37:45 +0100
+
+mysql (3.20.32a-4) unstable; urgency=low
+
+ * Move mysqld to /usr/sbin to comply with FSSTND
+
+ -- Scott Hanson <shanson@debian.org> Mon, 3 Nov 1997 20:12:29 +0100
+
+mysql (3.20.32a-3) unstable; urgency=low
+
+ * Comment out tests in mysql_install_db... for real this time!
+
+ -- Scott Hanson <shanson@debian.org> Mon, 3 Nov 1997 07:32:53 +0100
+
+mysql (3.20.32a-2) unstable; urgency=low
+
+ * Comment out tests in mysql_install_db (fixes #14304)
+
+ -- Scott Hanson <shanson@debian.org> Sat, 1 Nov 1997 18:45:25 +0100
+
+mysql (3.20.32a-1) unstable; urgency=low
+
+ * New upstream version
+
+ -- Scott Hanson <shanson@debian.org> Wed, 29 Oct 1997 07:11:42 +0100
+
+mysql (3.20.29-2) unstable; urgency=low
+
+ * New maintainer
+ * Statically link mysqld to patched glibc-2.0.5 libpthread
+ (works around #13586; see README.debian.glibc-2.0.5)
+ * Conflict with libpthread0 (fixes #13448)
+ * Don't link libg++, avoiding problems with glibc libpthread
+
+ -- Scott Hanson <shanson@debian.org> Thu, 16 Oct 1997 19:25:23 +0200
+
+mysql (3.20.29-1) unstable; urgency=low
+
+ * New upstream version
+ * Recompiled with libc6
+ * Include mysql-faq_toc.html (fixes #10885)
+ * Reworked /etc/init.d/mysql script (thanks to Heiko)
+ * Remove file /usr/lib/libmysqlclient.so.4 when package is removed.
+ * Use absolute path specification for conffile
+ * Use /usr/bin/perl instead of /bin/perl (fixes #10654)
+ * Do not depend on mysql (fixes #12427)
+ * Installed missing manpage for Mysql perl module
+ * Don't use debstd anymore
+ * Pristine source
+ * Set section to `non-free/devel'
+ * Upgraded to standards version 2.3.0.0
+
+ -- Christian Schwarz <schwarz@debian.org> Fri, 12 Sep 1997 02:12:58 +0200
+
+mysql (3.20.16beta-2) unstable; urgency=low
+
+ * Uses /usr/bin/perl instead of /bin/perl (fixes bug #9731)
+ * Don't run mysqld with --log option
+ * Don't install regex manual pages
+ * Suggest package mysql-manual
+ * Fixed typo in changelog
+ * Upgrade to policy 2.1.3.2
+
+ -- Christian Schwarz <schwarz@debian.org> Sun, 11 May 1997 14:19:26 +0200
+
+mysql (3.20.16beta-1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Christian Schwarz <schwarz@debian.org> Sat, 12 Apr 1997 13:51:28 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 00000000000..b8626c4cff2
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+4
diff --git a/debian/control.in b/debian/control.in
new file mode 100644
index 00000000000..8206728e6d7
--- /dev/null
+++ b/debian/control.in
@@ -0,0 +1,353 @@
+Source: mysql-@MYSQL_BRANDED_BASE_VERSION@
+Section: misc
+Priority: optional
+Maintainer: Monty Taylor <mtaylor@mysql.com>
+Uploaders: Mads Martin Joergensen <mads@mysql.com>, MySQL Build Team <build-private@mysql.com>
+Build-Depends: libtool (>= 1.4.2-7), g++ (>= 4:3.3.5-3), procps | hurd, debhelper (>= 4.1.16), file (>= 3.28-1), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), libreadline5-dev | libreadline-dev, psmisc, po-debconf, chrpath, automake1.8, doxygen, gs, dpatch, gawk, bison
+Standards-Version: 3.7.2
+
+Package: libmysqlclient@SHARED_LIB_MAJOR_VERSION@off
+Section: libs
+Architecture: any
+Depends: mysql-common (>= ${Source-Version}), ${shlibs:Depends}
+Description: mysql database client library
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ MySQL AB.
+ .
+ The MySQL software has Dual Licensing, which means you can use the MySQL
+ software free of charge under the GNU General Public License
+ (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+ licenses from MySQL AB if you do not wish to be bound by the terms of
+ the GPL. See the chapter "Licensing and Support" in the manual for
+ further info.
+ .
+ The MySQL web site (http://www.mysql.com/) provides the latest
+ news and information about the MySQL software. Also please see the
+ documentation and the manual for more information.
+ .
+ This package contains the shared libraries (*.so*) which certain
+ languages and applications need to dynamically load and use MySQL.
+
+Package: libmysqlclient@SHARED_LIB_MAJOR_VERSION@-dev
+Architecture: any
+Section: libdevel
+Depends: libmysqlclient@SHARED_LIB_MAJOR_VERSION@ (>= ${Source-Version}), zlib1g-dev, ${shlibs:Depends}
+Conflicts: libmysqlclient14-dev, libmysqlclient12-dev, libmysqlclient10-dev
+Provides: libmysqlclient-dev
+Description: mysql database development files
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ MySQL AB.
+ .
+ The MySQL software has Dual Licensing, which means you can use the MySQL
+ software free of charge under the GNU General Public License
+ (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+ licenses from MySQL AB if you do not wish to be bound by the terms of
+ the GPL. See the chapter "Licensing and Support" in the manual for
+ further info.
+ .
+ The MySQL web site (http://www.mysql.com/) provides the latest
+ news and information about the MySQL software. Also please see the
+ documentation and the manual for more information.
+ .
+ This package contains the development header files and libraries
+ necessary to develop MySQL client applications.
+
+Package: libndbclient@NDB_SHARED_LIB_MAJOR_VERSION@
+Section: libs
+Architecture: any
+Depends: mysql-common (>= ${Source-Version}), libmysqlclient@SHARED_LIB_MAJOR_VERSION@, ${shlibs:Depends}
+Description: mysql cluster NdbApi library
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ MySQL AB.
+ .
+ The MySQL software has Dual Licensing, which means you can use the MySQL
+ software free of charge under the GNU General Public License
+ (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+ licenses from MySQL AB if you do not wish to be bound by the terms of
+ the GPL. See the chapter "Licensing and Support" in the manual for
+ further info.
+ .
+ The MySQL web site (http://www.mysql.com/) provides the latest
+ news and information about the MySQL software. Also please see the
+ documentation and the manual for more information.
+ .
+ This package contains the shared libraries (*.so*) which certain
+ languages and applications need to dynamically load and use MySQL NdbApi.
+
+Package: libndbclient@NDB_SHARED_LIB_MAJOR_VERSION@-dev
+Architecture: any
+Section: libdevel
+Depends: libndbclient@NDB_SHARED_LIB_MAJOR_VERSION@ (>= ${Source-Version}), zlib1g-dev, ${shlibs:Depends}
+Provides: libndbclient-dev
+Description: mysql cluster NdbApi development files
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ MySQL AB.
+ .
+ The MySQL software has Dual Licensing, which means you can use the MySQL
+ software free of charge under the GNU General Public License
+ (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+ licenses from MySQL AB if you do not wish to be bound by the terms of
+ the GPL. See the chapter "Licensing and Support" in the manual for
+ further info.
+ .
+ The MySQL web site (http://www.mysql.com/) provides the latest
+ news and information about the MySQL software. Also please see the
+ documentation and the manual for more information.
+ .
+ This package contains the development header files and libraries
+ necessary to develop NdbApi client applications.
+
+Package: mysql-common
+Section: misc
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql-common-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
+Provides: mysql-common-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
+Replaces: mysql-common-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
+Description: mysql database common files (e.g. /etc/mysql/my.cnf)
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ MySQL AB.
+ .
+ The MySQL software has Dual Licensing, which means you can use the MySQL
+ software free of charge under the GNU General Public License
+ (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+ licenses from MySQL AB if you do not wish to be bound by the terms of
+ the GPL. See the chapter "Licensing and Support" in the manual for
+ further info.
+ .
+ The MySQL web site (http://www.mysql.com/) provides the latest
+ news and information about the MySQL software. Also please see the
+ documentation and the manual for more information.
+ .
+ This package includes files needed by all versions of the client library.
+
+Package: mysql-client-@MYSQL_BRANDED_BASE_VERSION@
+Architecture: any
+Depends: debianutils (>=1.6), libdbi-perl, libdbd-mysql-perl (>= 1.2202), mysql-common (>= ${Source-Version}), libmysqlclient@SHARED_LIB_MAJOR_VERSION@ (>= ${Source-Version}), ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends}
+Provides: virtual-mysql-client, mysql-client, mysql-client-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
+Conflicts: mysql-client (<< ${Source-Version}), mysql-client-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
+Replaces: mysql-client (<< ${Source-Version}), mysql-server, mysql-client-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
+Description: mysql database client binaries
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ MySQL AB.
+ .
+ The MySQL software has Dual Licensing, which means you can use the MySQL
+ software free of charge under the GNU General Public License
+ (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+ licenses from MySQL AB if you do not wish to be bound by the terms of
+ the GPL. See the chapter "Licensing and Support" in the manual for
+ further info.
+ .
+ The MySQL web site (http://www.mysql.com/) provides the latest
+ news and information about the MySQL software. Also please see the
+ documentation and the manual for more information.
+ .
+ This package contains the standard MySQL clients and administration tools.
+
+Package: mysql-server-@MYSQL_BRANDED_BASE_VERSION@
+Architecture: any
+Suggests: tinyca
+Recommends: mailx
+Pre-Depends: mysql-common (>= ${Source-Version}), adduser (>= 3.40)
+Depends: mysql-client-@MYSQL_BRANDED_BASE_VERSION@ (>= ${Source-Version}), libdbi-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd, lsb-base (>= 3.0-10)
+Conflicts: mysql-server (<< ${Source-Version}), mysql-server-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@ (<< 5.0.26-3)
+Provides: mysql-server, virtual-mysql-server, mysql-server-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
+Replaces: mysql-server (<< ${Source-Version}), mysql-server-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
+Description: mysql database server binaries
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ MySQL AB.
+ .
+ The MySQL software has Dual Licensing, which means you can use the MySQL
+ software free of charge under the GNU General Public License
+ (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+ licenses from MySQL AB if you do not wish to be bound by the terms of
+ the GPL. See the chapter "Licensing and Support" in the manual for
+ further info.
+ .
+ The MySQL web site (http://www.mysql.com/) provides the latest
+ news and information about the MySQL software. Also please see the
+ documentation and the manual for more information.
+ .
+ This package includes the MySQL server binary (incl. InnoDB) as well
+ as related utilities to run and administrate a MySQL server.
+ .
+ If you want to access and work with the database, you have to install
+ package mysql-client-@MYSQL_BRANDED_BASE_VERSION@ as well!
+
+Package: mysql-test-@MYSQL_BRANDED_BASE_VERSION@
+Architecture: any
+Pre-Depends: mysql-common (>= ${Source-Version})
+Depends: mysql-client-@MYSQL_BRANDED_BASE_VERSION@ (>= ${Source-Version}), libdbd-mysql-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL - test suite
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ MySQL AB.
+ .
+ The MySQL software has Dual Licensing, which means you can use the MySQL
+ software free of charge under the GNU General Public License
+ (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+ licenses from MySQL AB if you do not wish to be bound by the terms of
+ the GPL. See the chapter "Licensing and Support" in the manual for
+ further info.
+ .
+ The MySQL web site (http://www.mysql.com/) provides the latest
+ news and information about the MySQL software. Also please see the
+ documentation and the manual for more information.
+ .
+ This package contains the MySQL regression test suite.
+
+Package: mysql-storage-@MYSQL_BRANDED_BASE_VERSION@
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL - ndbcluster storage engine
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ MySQL AB.
+ .
+ The MySQL software has Dual Licensing, which means you can use the MySQL
+ software free of charge under the GNU General Public License
+ (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+ licenses from MySQL AB if you do not wish to be bound by the terms of
+ the GPL. See the chapter "Licensing and Support" in the manual for
+ further info.
+ .
+ The MySQL web site (http://www.mysql.com/) provides the latest
+ news and information about the MySQL software. Also please see the
+ documentation and the manual for more information.
+ .
+ This package contains the ndbcluster storage engine.
+ It is necessary to have this package installed on all
+ computers that should store ndbcluster table data.
+ Note that this storage engine can only be used in conjunction
+ with the MySQL Max server.
+
+Package: mysql-management-@MYSQL_BRANDED_BASE_VERSION@
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL - ndbcluster storage engine management
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ MySQL AB.
+ .
+ The MySQL software has Dual Licensing, which means you can use the MySQL
+ software free of charge under the GNU General Public License
+ (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+ licenses from MySQL AB if you do not wish to be bound by the terms of
+ the GPL. See the chapter "Licensing and Support" in the manual for
+ further info.
+ .
+ The MySQL web site (http://www.mysql.com/) provides the latest
+ news and information about the MySQL software. Also please see the
+ documentation and the manual for more information.
+ .
+ This package contains ndbcluster storage engine management.
+ It is necessary to have this package installed on at least
+ one computer in the cluster.
+
+Package: mysql-tools-@MYSQL_BRANDED_BASE_VERSION@
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL - ndbcluster storage engine basic tools
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ MySQL AB.
+ .
+ The MySQL software has Dual Licensing, which means you can use the MySQL
+ software free of charge under the GNU General Public License
+ (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+ licenses from MySQL AB if you do not wish to be bound by the terms of
+ the GPL. See the chapter "Licensing and Support" in the manual for
+ further info.
+ .
+ The MySQL web site (http://www.mysql.com/) provides the latest
+ news and information about the MySQL software. Also please see the
+ documentation and the manual for more information.
+ .
+ This package contains ndbcluster storage engine basic tools.
+
+Package: mysql-extra-@MYSQL_BRANDED_BASE_VERSION@
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL - ndbcluster storage engine extra tools
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ MySQL AB.
+ .
+ The MySQL software has Dual Licensing, which means you can use the MySQL
+ software free of charge under the GNU General Public License
+ (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+ licenses from MySQL AB if you do not wish to be bound by the terms of
+ the GPL. See the chapter "Licensing and Support" in the manual for
+ further info.
+ .
+ The MySQL web site (http://www.mysql.com/) provides the latest
+ news and information about the MySQL software. Also please see the
+ documentation and the manual for more information.
+ .
+ This package contains some extra ndbcluster storage engine tools for
+ the advanced user.
+ .
+ They should be used with caution
+
+
+Package: mysql-server-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
+Architecture: any
+Section: oldlibs
+Priority: extra
+Depends: mysql-server-@MYSQL_BRANDED_BASE_VERSION@
+Description: mysql database server (transitional package)
+ MySQL is a fast, stable and true multi-user, multi-threaded SQL database
+ server. SQL (Structured Query Language) is the most popular database query
+ language in the world. The main goals of MySQL are speed, robustness and
+ ease of use.
+ .
+ This is an empty transitional package and can safely be removed.
+
+Package: mysql-server
+Architecture: all
+Depends: mysql-server-@MYSQL_BRANDED_BASE_VERSION@
+Description: mysql database server (meta package depending on the latest version)
+ This is an empty package that depends on the current "best" version of
+ mysql-server (currently mysql-server-@MYSQL_BRANDED_BASE_VERSION@), as determined by the MySQL
+ maintainers. Install this package if in doubt about which MySQL version
+ you want, as this is the one we consider to be in the best shape.
+
+Package: mysql-client
+Architecture: all
+Depends: mysql-client-@MYSQL_BRANDED_BASE_VERSION@
+Description: mysql database client (meta package depending on the latest version)
+ This is an empty package that depends on the current "best" version of
+ mysql-client (currently mysql-client-@MYSQL_BRANDED_BASE_VERSION@), as determined by the MySQL
+ maintainers. Install this package if in doubt about which MySQL version
+ you want, as this is the one we consider to be in the best shape.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 00000000000..f3c7b8624ca
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,139 @@
+The Debian package of MySQL was first debianzed on 1997-04-12 by Christian
+Schwarz <schwarz@debian.org> and ist maintained since 1999-04-20 by
+Christian Hammers <ch@debian.org>.
+
+It can be downloaded from http://www.mysql.com/
+
+Copyright:
+
+According to the file "COPYING" all parts of this package are licenced
+under the terms of the GNU GPL Version 2 of which a copy is available
+in /usr/share/common-licenses.
+
+To allow free software with other licences than the GPL to link against the
+shared library, special terms for "derived works" are defined in the file
+"EXCEPTIONS-CLIENT" which is quoted below.
+
+More information can be found on http://www.mysql.com/company/legal/licensing/
+
+The manual had to be removed as it is not free in the sense of the
+Debian Free Software Guidelines (DFSG).
+
+-------------------------------------------------------------------------
+
+
+Appendix I MySQL FLOSS License Exception
+****************************************
+
+ Version 0.3, 10 February 2005
+
+The MySQL AB Exception for Free/Libre and Open Source Software-only
+Applications Using MySQL Client Libraries (the "FLOSS Exception").
+
+Exception Intent
+================
+
+We want specified Free/Libre and Open Source Software ("FLOSS")
+applications to be able to use specified GPL-licensed MySQL client
+libraries (the "Program") despite the fact that not all FLOSS licenses
+are compatible with version 2 of the GNU General Public License (the
+"GPL").
+
+Legal Terms and Conditions
+==========================
+
+As a special exception to the terms and conditions of version 2.0 of the
+GPL:
+
+ 1. You are free to distribute a Derivative Work that is formed
+ entirely from the Program and one or more works (each, a "FLOSS
+ Work") licensed under one or more of the licenses listed below in
+ section 1, as long as:
+
+ a. You obey the GPL in all respects for the Program and the
+ Derivative Work, except for identifiable sections of the
+ Derivative Work which are not derived from the Program, and
+ which can reasonably be considered independent and separate
+ works in themselves,
+
+ b. all identifiable sections of the Derivative Work which are not
+ derived from the Program, and which can reasonably be
+ considered independent and separate works in themselves,
+
+ i
+ are distributed subject to one of the FLOSS licenses
+ listed below, and
+
+ ii
+ the object code or executable form of those sections are
+ accompanied by the complete corresponding
+ machine-readable source code for those sections on the
+ same medium and under the same FLOSS license as the
+ corresponding object code or executable forms of those
+ sections, and
+
+ c. any works which are aggregated with the Program or with a
+ Derivative Work on a volume of a storage or distribution
+ medium in accordance with the GPL, can reasonably be
+ considered independent and separate works in themselves which
+ are not derivatives of either the Program, a Derivative Work
+ or a FLOSS Work.
+
+ If the above conditions are not met, then the Program may only be
+ copied, modified, distributed or used under the terms and
+ conditions of the GPL or another valid licensing option from MySQL
+ AB.
+
+ 2. FLOSS License List
+
+ *License name* *Version(s)/Copyright Date*
+ Academic Free License 2.0
+ Apache Software License 1.0/1.1/2.0
+ Apple Public Source License 2.0
+ Artistic license From Perl 5.8.0
+ BSD license "July 22 1999"
+ Common Public License 1.0
+ GNU Library or "Lesser" General Public 2.0/2.1
+ License (LGPL)
+ Jabber Open Source License 1.0
+ MIT license -
+ Mozilla Public License (MPL) 1.0/1.1
+ Open Software License 2.0
+ OpenSSL license (with original SSLeay "2003" ("1998")
+ license)
+ PHP License 3.0
+ Python license (CNRI Python License) -
+ Python Software Foundation License 2.1.1
+ Sleepycat License "1999"
+ W3C License "2001"
+ X11 License "2001"
+ Zlib/libpng License -
+ Zope Public License 2.0
+
+ Due to the many variants of some of the above licenses, we require
+ that any version follow the 2003 version of the Free Software
+ Foundation's Free Software Definition
+ (`http://www.gnu.org/philosophy/free-sw.html') or version 1.9 of
+ the Open Source Definition by the Open Source Initiative
+ (`http://www.opensource.org/docs/definition.php').
+
+ 3. Definitions
+
+ a. Terms used, but not defined, herein shall have the meaning
+ provided in the GPL.
+
+ b. Derivative Work means a derivative work under copyright law.
+
+ 4. Applicability This FLOSS Exception applies to all Programs that
+ contain a notice placed by MySQL AB saying that the Program may be
+ distributed under the terms of this FLOSS Exception. If you
+ create or distribute a work which is a Derivative Work of both the
+ Program and any other work licensed under the GPL, then this FLOSS
+ Exception is not available for that work; thus, you must remove
+ the FLOSS Exception notice from that work and comply with the GPL
+ in all respects, including by retaining all GPL notices. You may
+ choose to redistribute a copy of the Program exclusively under the
+ terms of the GPL by removing the FLOSS Exception notice from that
+ copy of the Program, provided that the copy has never been
+ modified by you or any third party.
+
diff --git a/debian/copyright.more b/debian/copyright.more
new file mode 100644
index 00000000000..b7ac36bc9fa
--- /dev/null
+++ b/debian/copyright.more
@@ -0,0 +1,60 @@
+#
+# Some random bits of interest.
+#
+
+#
+# Arjen about OpenSSL
+#
+http://bugs.mysql.com/?id=6924
+Updated by: Arjen Lentz
+Date: 2005-11-05
+
+Linking with the client library is covered by the FLOSS exception which
+includes OpenSSL now. So that's clean. Indeed, the OpenSSL is not
+compliant with the FSF free software guidelines, however it *is*
+compliant with the OSI guidelines. And that's good enough for us.
+Christian is correct in saying that the author of a GPL app that links
+with MySQL may find themselves in a licensing headache (or may not
+realize that OpenSSL is involved) but that is their responsibility.
+The MySQL client can be linked with a number of other licenses, it
+would not be feasible for MySQL to take over the responsibility for
+"the next level" of how combinations of licenses work out. There are
+too many possibilities, and combinations of more just 2 licenses.
+
+
+#
+# Steve Langasek about OpenSSL vs libmysqlclient
+#
+Subject: Bug#291945: eleventh-hour transition for mysql-using packages related to apache
+Date: Sat, 12 Feb 2005 00:39:58 -0800
+From: Steve Langasek <vorlon@debian.org>
+
+> > > > that's great to hear! i'm cc'ing the relevant wishlist bug i have open
+> > > > against mysql-server. christian: any chance of getting an openssl enabled
+> > > > version of the mysql-client and mysql-server packages?
+
+> > > Yes, I will re-enable openssl in the next upload.
+
+> > Please make sure this does not introduce an openssl dependency to
+> > libmysqlclient itself; just because MySQL AB have granted a license
+> > exception for OpenSSL does not mean everyone who links to libmysqlclient
+> > has done so.
+
+> > I know of at least one GPL-without-exception package that is now using
+> > libmysqlclient12 in Debian.
+
+> Nice, so we should check that any linked GPL library directly (obviuolsy) or
+> indirectly (with N=1,2,3... levels of indirection) linked against
+> openssl adds the exception.
+
+No, we should simply not be linking libmysqlclient against OpenSSL. The
+exemption was needed because there exists software that uses both
+libmysqlclient and libssl, but making libmysqlclient itself use libssl just
+because we now have the exemption will cause licensing problems for
+applications which currently do *not* depend on libssl.
+
+> This is a great reason to move asap all possible programs to gnutls,
+> indeed.
+
+There are plenty of reasons to move software to gnutls, but doing so is
+non-trivial.
diff --git a/debian/defs.mk.in b/debian/defs.mk.in
new file mode 100644
index 00000000000..dd2c44313be
--- /dev/null
+++ b/debian/defs.mk.in
@@ -0,0 +1,14 @@
+MYSQL_BUILD_OPTS=--with-comment='MySQL Server (custom)' --with-server-suffix='-custom'
+MYSQL_BUILD_CXXFLAGS=-DBIG_JOINS=1 -felide-constructors -fno-rtti -O2
+MYSQL_BUILD_CFLAGS=-DBIG_JOINS=1 -O2
+MYSQL_BUILD_CC=gcc
+MYSQL_BUILD_CXX=gcc
+# we re-write state into this file. MYSQL_BASE_VERSION might get a suffix added
+# by debian/rules which could result in a nasty loop. VER is there to hold the
+# original unadorned version from autoconf
+MYSQL_BASE_VERSION=@MYSQL_BASE_VERSION@
+MYSQL_PREVIOUS_BASE_VERSION=@MYSQL_PREVIOUS_BASE_VERSION@
+MYSQL_BRANDED_BASE_VERSION=@MYSQL_BRANDED_BASE_VERSION@
+MYSQL_BRANDED_PREVIOUS_BASE_VERSION=@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
+SHARED_LIB_MAJOR_VERSION=@SHARED_LIB_MAJOR_VERSION@
+NDB_SHARED_LIB_MAJOR_VERSION=@NDB_SHARED_LIB_MAJOR_VERSION@
diff --git a/debian/libmysqlclientSLIB-dev.README.Maintainer.in b/debian/libmysqlclientSLIB-dev.README.Maintainer.in
new file mode 100644
index 00000000000..56b4088cbfb
--- /dev/null
+++ b/debian/libmysqlclientSLIB-dev.README.Maintainer.in
@@ -0,0 +1,4 @@
+The examples directory includes files that might be needed by some
+developers:
+- header files not installed by default
+- the example file udf_example.cc
diff --git a/debian/libmysqlclientSLIB-dev.dirs.in b/debian/libmysqlclientSLIB-dev.dirs.in
new file mode 100644
index 00000000000..f6ad2870431
--- /dev/null
+++ b/debian/libmysqlclientSLIB-dev.dirs.in
@@ -0,0 +1,2 @@
+usr/include/
+usr/lib/
diff --git a/debian/libmysqlclientSLIB-dev.docs.in b/debian/libmysqlclientSLIB-dev.docs.in
new file mode 100644
index 00000000000..eccf2c9c565
--- /dev/null
+++ b/debian/libmysqlclientSLIB-dev.docs.in
@@ -0,0 +1 @@
+EXCEPTIONS-CLIENT
diff --git a/debian/libmysqlclientSLIB-dev.examples.in b/debian/libmysqlclientSLIB-dev.examples.in
new file mode 100644
index 00000000000..f1649c311c4
--- /dev/null
+++ b/debian/libmysqlclientSLIB-dev.examples.in
@@ -0,0 +1 @@
+sql/udf_example.c
diff --git a/debian/libmysqlclientSLIB-dev.files.in b/debian/libmysqlclientSLIB-dev.files.in
new file mode 100644
index 00000000000..b4a87c1bb2b
--- /dev/null
+++ b/debian/libmysqlclientSLIB-dev.files.in
@@ -0,0 +1,7 @@
+usr/bin/mysql_config
+usr/bin/comp_err
+usr/include/*
+usr/lib/libmysqlclient.a
+usr/lib/libmysqlclient.la
+usr/lib/mysql
+usr/share/man/man1/mysql_config.1
diff --git a/debian/libmysqlclientSLIB-dev.links.in b/debian/libmysqlclientSLIB-dev.links.in
new file mode 100644
index 00000000000..4a24953a06b
--- /dev/null
+++ b/debian/libmysqlclientSLIB-dev.links.in
@@ -0,0 +1,2 @@
+usr/lib/libmysqlclient.so.15 usr/lib/libmysqlclient.so
+usr/lib/libmysqlclient_r.so.15 usr/lib/libmysqlclient_r.so
diff --git a/debian/libmysqlclientSLIBoff.README.Debian.in b/debian/libmysqlclientSLIBoff.README.Debian.in
new file mode 100644
index 00000000000..26549106092
--- /dev/null
+++ b/debian/libmysqlclientSLIBoff.README.Debian.in
@@ -0,0 +1,30 @@
+* Crashs on systems with Cyrix or other old i486 CPUs
+=====================================================
+
+As reported http://bugs.mysql.com/bug.php?id=21765 MySQL will segfault on very
+old CPUs that do not have support for the "cpuid" instruction.
+
+
+
+* Self-build binaries that are linked against libmysqlclient15 MUST be rebuild!
+===============================================================================
+
+This only affects binaries that are build on a Debian unstable/testing system
+before 2006-03-31 or version 5.0.19. "objdump -T myprogram | grep MYSQL_5.0"
+will give a couple of lines output in such a case.
+
+Until now libmysqlclient.so.15 had versioned symbols provided by a Debian
+patch. Now MySQL finally decided to adopt this patch but sadly chosed a
+different symbol name.
+
+Binaries linked against the old version of the library with my symbol name will
+not run with the new version with MySQL's symbol name ("version `MYSQL_5.0' not
+found"). The actual name /usr/lib/libmysqlclient.so.15 must stay because else
+binaries coming from systems other than Debian would never run on a Debian
+server.
+
+So the Debian package had to be renamed from "libmysqlclient15" to
+"libmysqlclient15off" and do now conflict with their former version.
+
+-- 2006-03-14, Christian Hammers <ch@debian.org>
+
diff --git a/debian/libmysqlclientSLIBoff.dirs.in b/debian/libmysqlclientSLIBoff.dirs.in
new file mode 100644
index 00000000000..2964de6141b
--- /dev/null
+++ b/debian/libmysqlclientSLIBoff.dirs.in
@@ -0,0 +1 @@
+usr/lib/
diff --git a/debian/libmysqlclientSLIBoff.docs.in b/debian/libmysqlclientSLIBoff.docs.in
new file mode 100644
index 00000000000..eccf2c9c565
--- /dev/null
+++ b/debian/libmysqlclientSLIBoff.docs.in
@@ -0,0 +1 @@
+EXCEPTIONS-CLIENT
diff --git a/debian/libmysqlclientSLIBoff.files.in b/debian/libmysqlclientSLIBoff.files.in
new file mode 100644
index 00000000000..5162b7b9639
--- /dev/null
+++ b/debian/libmysqlclientSLIBoff.files.in
@@ -0,0 +1 @@
+usr/lib/libmysqlclient*.so.*
diff --git a/debian/libmysqlclientSLIBoff.postinst.in b/debian/libmysqlclientSLIBoff.postinst.in
new file mode 100644
index 00000000000..29d3b86f978
--- /dev/null
+++ b/debian/libmysqlclientSLIBoff.postinst.in
@@ -0,0 +1,12 @@
+#!/bin/bash -e
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+# vim: ts=4
+
+
diff --git a/debian/libndbclientNLIB-dev.dirs.in b/debian/libndbclientNLIB-dev.dirs.in
new file mode 100644
index 00000000000..4a854656b34
--- /dev/null
+++ b/debian/libndbclientNLIB-dev.dirs.in
@@ -0,0 +1,3 @@
+usr/include/mysql/storage/ndb/
+usr/include/
+usr/lib/
diff --git a/debian/libndbclientNLIB-dev.files.in b/debian/libndbclientNLIB-dev.files.in
new file mode 100644
index 00000000000..995eb2c71fb
--- /dev/null
+++ b/debian/libndbclientNLIB-dev.files.in
@@ -0,0 +1,3 @@
+usr/include/mysql/storage/ndb/*
+usr/lib/libndbclient.a
+usr/lib/libndbclient.la
diff --git a/debian/libndbclientNLIB-dev.links.in b/debian/libndbclientNLIB-dev.links.in
new file mode 100644
index 00000000000..4e0bf17ebd5
--- /dev/null
+++ b/debian/libndbclientNLIB-dev.links.in
@@ -0,0 +1 @@
+usr/lib/libndbclient.so.4 usr/lib/libndbclient.so
diff --git a/debian/libndbclientNLIB.README.Debian.in b/debian/libndbclientNLIB.README.Debian.in
new file mode 100644
index 00000000000..26549106092
--- /dev/null
+++ b/debian/libndbclientNLIB.README.Debian.in
@@ -0,0 +1,30 @@
+* Crashs on systems with Cyrix or other old i486 CPUs
+=====================================================
+
+As reported http://bugs.mysql.com/bug.php?id=21765 MySQL will segfault on very
+old CPUs that do not have support for the "cpuid" instruction.
+
+
+
+* Self-build binaries that are linked against libmysqlclient15 MUST be rebuild!
+===============================================================================
+
+This only affects binaries that are build on a Debian unstable/testing system
+before 2006-03-31 or version 5.0.19. "objdump -T myprogram | grep MYSQL_5.0"
+will give a couple of lines output in such a case.
+
+Until now libmysqlclient.so.15 had versioned symbols provided by a Debian
+patch. Now MySQL finally decided to adopt this patch but sadly chosed a
+different symbol name.
+
+Binaries linked against the old version of the library with my symbol name will
+not run with the new version with MySQL's symbol name ("version `MYSQL_5.0' not
+found"). The actual name /usr/lib/libmysqlclient.so.15 must stay because else
+binaries coming from systems other than Debian would never run on a Debian
+server.
+
+So the Debian package had to be renamed from "libmysqlclient15" to
+"libmysqlclient15off" and do now conflict with their former version.
+
+-- 2006-03-14, Christian Hammers <ch@debian.org>
+
diff --git a/debian/libndbclientNLIB.dirs.in b/debian/libndbclientNLIB.dirs.in
new file mode 100644
index 00000000000..2964de6141b
--- /dev/null
+++ b/debian/libndbclientNLIB.dirs.in
@@ -0,0 +1 @@
+usr/lib/
diff --git a/debian/libndbclientNLIB.files.in b/debian/libndbclientNLIB.files.in
new file mode 100644
index 00000000000..f212e302299
--- /dev/null
+++ b/debian/libndbclientNLIB.files.in
@@ -0,0 +1 @@
+usr/lib/libndbclient*.so.*
diff --git a/debian/libndbclientNLIB.postinst.in b/debian/libndbclientNLIB.postinst.in
new file mode 100644
index 00000000000..29d3b86f978
--- /dev/null
+++ b/debian/libndbclientNLIB.postinst.in
@@ -0,0 +1,12 @@
+#!/bin/bash -e
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+# vim: ts=4
+
+
diff --git a/debian/mysql-client-BASE.NEWS.in b/debian/mysql-client-BASE.NEWS.in
new file mode 100644
index 00000000000..272621ff48d
--- /dev/null
+++ b/debian/mysql-client-BASE.NEWS.in
@@ -0,0 +1,6 @@
+mysql-dfsg-5.0 (5.0.24a-2) unstable; urgency=low
+
+ This package now includes "mysqlreport" from hackmysql.com which generates
+ a friendly report on the performance relevant variables from SHOW STATUS.
+
+ -- Christian Hammers <ch@debian.org> Sun, 3 Sep 2006 16:26:41 +0200
diff --git a/debian/mysql-client-BASE.README.Debian.in b/debian/mysql-client-BASE.README.Debian.in
new file mode 100644
index 00000000000..b245638f9c9
--- /dev/null
+++ b/debian/mysql-client-BASE.README.Debian.in
@@ -0,0 +1,4 @@
+FAQ:
+
+Q: My <tab> completition is gone, why?
+A: You have "no-auto-rehash" in the "[mysql]" section of /etc/mysql/my.cnf!
diff --git a/debian/mysql-client-BASE.dirs.in b/debian/mysql-client-BASE.dirs.in
new file mode 100644
index 00000000000..63c303b03fc
--- /dev/null
+++ b/debian/mysql-client-BASE.dirs.in
@@ -0,0 +1,2 @@
+usr/bin/
+usr/share/man/man1/
diff --git a/debian/mysql-client-BASE.docs.in b/debian/mysql-client-BASE.docs.in
new file mode 100644
index 00000000000..5bb6d569f28
--- /dev/null
+++ b/debian/mysql-client-BASE.docs.in
@@ -0,0 +1,2 @@
+README
+EXCEPTIONS-CLIENT
diff --git a/debian/mysql-client-BASE.files.in b/debian/mysql-client-BASE.files.in
new file mode 100644
index 00000000000..df635f5e911
--- /dev/null
+++ b/debian/mysql-client-BASE.files.in
@@ -0,0 +1,18 @@
+usr/bin/msql2mysql
+usr/bin/mysql
+usr/bin/mysql_find_rows
+usr/bin/mysql_tableinfo
+usr/bin/mysql_waitpid
+usr/bin/mysqlaccess
+usr/bin/mysqladmin
+usr/bin/mysqlbinlog
+usr/bin/mysqlcheck
+usr/bin/mysqldump
+usr/bin/mysqlimport
+usr/bin/mysqlshow
+usr/share/lintian/overrides/mysql-client-@MYSQL_BRANDED_BASE_VERSION@
+usr/share/man/man1/mysql.1
+usr/share/man/man1/mysqlaccess.1
+usr/share/man/man1/mysqladmin.1
+usr/share/man/man1/mysqldump.1
+usr/share/man/man1/mysqlshow.1
diff --git a/debian/mysql-client-BASE.lintian-overrides.in b/debian/mysql-client-BASE.lintian-overrides.in
new file mode 100644
index 00000000000..9de261e2154
--- /dev/null
+++ b/debian/mysql-client-BASE.lintian-overrides.in
@@ -0,0 +1 @@
+mysql-client-@MYSQL_BRANDED_BASE_VERSION@: package-has-a-duplicate-relation
diff --git a/debian/mysql-common.README.Debian.in b/debian/mysql-common.README.Debian.in
new file mode 100644
index 00000000000..ab7d01defe1
--- /dev/null
+++ b/debian/mysql-common.README.Debian.in
@@ -0,0 +1,20 @@
+[passwords]
+If you change the password of the root user (which is strongly recommended)
+you have to create a personal mysql config file in order to let cron run
+the /etc/cron.daily script without asking you for the password.
+The /root/.my.cnf file should be chmod 0600 (-rw------- root root .my.cnf)
+and have the following content:
+[mysqladmin]
+user = root
+password = <secret>
+
+[more than one process]
+Note that the shutdown script cannot use the pid number stored in
+/var/run, since it is for the first mysqld thread, but we need to kill
+the most recent thread to shutdown the server. The upstream developers
+are aware of this bug. When maintaining your database, you should use
+mysqladmin with your password to shutdown and reload the server rather
+than /etc/init.d/mysql.
+
+Scott Hanson and Christian Hammers
+<shanson@debian.org> <ch@debian.org>
diff --git a/debian/mysql-common.dirs.in b/debian/mysql-common.dirs.in
new file mode 100644
index 00000000000..a5a88ede9c1
--- /dev/null
+++ b/debian/mysql-common.dirs.in
@@ -0,0 +1 @@
+etc/mysql/conf.d/
diff --git a/debian/mysql-common.files.in b/debian/mysql-common.files.in
new file mode 100644
index 00000000000..c052beb0027
--- /dev/null
+++ b/debian/mysql-common.files.in
@@ -0,0 +1,2 @@
+etc/mysql/my.cnf
+usr/share/mysql-common/internal-use-only
diff --git a/debian/mysql-common.postrm.in b/debian/mysql-common.postrm.in
new file mode 100644
index 00000000000..3ca45870165
--- /dev/null
+++ b/debian/mysql-common.postrm.in
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+if [ "$1" = "purge" ]; then
+ rmdir /etc/mysql 2>/dev/null || true
+fi
+
+#DEBHELPER#
diff --git a/debian/mysql-common.preinst.in b/debian/mysql-common.preinst.in
new file mode 100644
index 00000000000..362990bd130
--- /dev/null
+++ b/debian/mysql-common.preinst.in
@@ -0,0 +1,215 @@
+#!/bin/bash -e
+#
+# summary of how this script can be called:
+# * <new-preinst> install
+# * <new-preinst> install <old-version>
+# * <new-preinst> upgrade <old-version>
+# * <old-preinst> abort-upgrade <new-version>
+#
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
+
+# Try to stop the server in a sane way. If it does not success let the admin
+# do it himself. No database directories should be removed while the server
+# is running! Another mysqld in e.g. a different chroot is fine for us.
+stop_server() {
+ if [ ! -x /etc/init.d/mysql ]; then return; fi
+
+ set +e
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ cmd="invoke-rc.d mysql stop"
+ else
+ cmd="/etc/init.d/mysql stop"
+ fi
+ $cmd
+ errno=$?
+ set -e
+
+ # 0=ok, 100=no init script (fresh install)
+ if [ "$errno" != 0 -a "$errno" != 100 ]; then
+ echo "${cmd/ */} returned $errno" 1>&2
+ echo "There is a MySQL server running, but we failed in our attempts to stop it." 1>&2
+ echo "Stop it yourself and try again!" 1>&2
+ exit 1
+ fi
+}
+
+start_server() {
+ if [ ! -x /etc/init.d/mysql ]; then return; fi
+
+ set +e
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ cmd="invoke-rc.d mysql start"
+ else
+ cmd="/etc/init.d/mysql start"
+ fi
+ $cmd
+ set -e
+}
+
+##### here's a bunch of helper functions for converting database formats ######
+
+cvt_get_param(){
+ /usr/sbin/mysqld --print-defaults \
+ | tr " " "\n" \
+ | grep -- "--$1" \
+ | tail -n 1 \
+ | cut -d= -f2
+}
+
+cvt_setup_stuff(){
+ mytmp=`mktemp -d -t mysql-ISAM-convert.XXXXXX`
+ cvt_log="$mytmp/conversion.log"
+ if [ ! -d "$mytmp" ]; then
+ echo "can't create temporary directory, oh well." >&2
+ exit 1
+ fi
+
+ chgrp mysql $mytmp
+ chmod g+rwx $mytmp
+ cvt_socket=${mytmp}/mysql.sock
+
+ cvt_mysqld="mysqld --skip-grant-tables --skip-networking --socket $cvt_socket"
+ cvt_mysql="mysql --socket $cvt_socket"
+ cvt_mysqladmin="mysqladmin --socket $cvt_socket"
+}
+
+cvt_get_databases(){
+ echo fetching database list ... >&2
+ $cvt_mysql -e 'show databases' | sed -n -e '2,$p'
+}
+
+cvt_get_tables(){
+ echo querying tables in $1 ... >&2
+ $cvt_mysql $1 -e 'show table status' | sed -n -e '2,$p' | \
+ cut -f 1,2 | grep -w 'ISAM$' | cut -f 1
+}
+
+cvt_convert_table(){
+ echo converting $1.$2 ... >&2
+ $cvt_mysql $1 -e "alter table $2 type=MyISAM"
+}
+
+cvt_wait_for_server(){
+ local count
+ echo -n waiting for server startup.. >&2
+ while ! $cvt_mysql </dev/null >/dev/null 2>&1; do
+ echo -n . >&2
+ sleep 1
+ count=".$count"
+ if [ -f $mytmp/mysql.done ]; then
+ echo "sorry... looks like the server crashed :(" >&2
+ return 1
+ elif [ "$count" = "...................." ]; then
+ echo "sorry... looks like the server didn't start :(" >&2
+ return 1
+ fi
+ done
+ echo ok. >&2
+}
+
+cvt_wait_for_exit(){
+ local count
+ echo -n waiting for server shutdown.. >&2
+ while [ ! -f $mytmp/mysql.done ]; do
+ echo -n . >&2
+ sleep 1
+ count=".$count"
+ if [ "$count" = "...................." ]; then
+ echo "hrm... guess it never started?" >&2
+ return 0
+ fi
+ done
+ echo ok. >&2
+}
+
+cvt_cleanup(){
+ local mysql_kids
+ rm -rf $mytmp
+ # kill any mysqld child processes left over. there *shouldn't* be any,
+ # but let's not take chances with that
+ mysql_kids=`ps o 'pid command' --ppid $$ | grep -E '^[[:digit:]]+ mysqld ' | cut -d' ' -f1`
+ if [ "$mysql_kids" ]; then
+ echo "strange, some mysql processes left around. killing them now." >&2
+ kill $mysql_kids
+ sleep 10
+ mysql_kids=`ps o 'pid command' --ppid $$ | grep -E '^[[:digit:]]+ mysqld ' | cut -d' ' -f1`
+ if [ "$mysql_kids" ]; then
+ echo "okay, they're really not getting the hint..." >&2
+ kill -9 $mysql_kids
+ fi
+ fi
+}
+
+################################ main() ##########################
+
+# test if upgrading from non conffile state
+if [ "$1" = "upgrade" ] && [ -x /usr/sbin/mysqld ]; then
+ cvt_datadir=`cvt_get_param datadir`
+ # test for ISAM tables, which we must convert NOW
+ if [ -n "`find $cvt_datadir -name '*.ISM' 2>/dev/null`" ]; then
+ pidfile=`cvt_get_param pid-file`
+ if [ "$pidfile" ] && [ -f "$pidfile" ]; then
+ server_pid=`cat $pidfile`
+ if [ "$server_pid" ] && ps $server_pid >/dev/null 2>&1; then
+ server_running="yes"
+ fi
+ fi
+ # to be sure
+ stop_server
+
+ set +e
+ cat << EOF >&2
+----------------------------------------
+WARNING WARNING WARNING
+----------------------------------------
+
+It has been detected that are are using ISAM format on some of your
+mysql database tables. This format has been deprecated and no longer
+supported. to prevent these databases from essentially disappearing,
+an attempt at format conversion will now be made. please check after
+your upgrade that all tables are present and accounted for.
+
+apologies for the noise, but we thought you'd appreciate it :)
+
+----------------------------------------
+WARNING WARNING WARNING
+----------------------------------------
+EOF
+ cvt_setup_stuff
+ ($cvt_mysqld >$cvt_log 2>&1; touch $mytmp/mysql.done ) &
+
+ if cvt_wait_for_server; then
+ dbs=`cvt_get_databases`
+ for db in $dbs; do
+ tables=`cvt_get_tables $db`
+ for tbl in $tables; do
+ cvt_convert_table $db $tbl
+ done
+ done
+ else
+ cvt_error="yes"
+ fi
+
+ echo shutting down server... >&2
+ $cvt_mysqladmin shutdown
+ cvt_wait_for_exit
+ echo "all done!" >&2
+ if [ ! "$cvt_error" = "yes" ]; then
+ cvt_cleanup
+ else
+ echo "you might want to look in $mytmp..." >&2
+ fi
+
+ if [ "$server_running" ]; then
+ start_server
+ fi
+
+ set -e
+ fi
+fi
+
+exit 0
diff --git a/debian/mysql-extra-BASE.dirs.in b/debian/mysql-extra-BASE.dirs.in
new file mode 100644
index 00000000000..e7724817552
--- /dev/null
+++ b/debian/mysql-extra-BASE.dirs.in
@@ -0,0 +1 @@
+usr/bin
diff --git a/debian/mysql-extra-BASE.files.in b/debian/mysql-extra-BASE.files.in
new file mode 100644
index 00000000000..2ecc73d3f2e
--- /dev/null
+++ b/debian/mysql-extra-BASE.files.in
@@ -0,0 +1,3 @@
+usr/bin/ndb_drop_index
+usr/bin/ndb_drop_table
+usr/bin/ndb_delete_all
diff --git a/debian/mysql-management-BASE.dirs.in b/debian/mysql-management-BASE.dirs.in
new file mode 100644
index 00000000000..236670a2d0f
--- /dev/null
+++ b/debian/mysql-management-BASE.dirs.in
@@ -0,0 +1 @@
+usr/sbin
diff --git a/debian/mysql-management-BASE.files.in b/debian/mysql-management-BASE.files.in
new file mode 100644
index 00000000000..f828b13bd5f
--- /dev/null
+++ b/debian/mysql-management-BASE.files.in
@@ -0,0 +1 @@
+usr/sbin/ndb_mgmd
diff --git a/debian/mysql-management-BASE.mysql-management.init.in b/debian/mysql-management-BASE.mysql-management.init.in
new file mode 100644
index 00000000000..8b3f6e25f4b
--- /dev/null
+++ b/debian/mysql-management-BASE.mysql-management.init.in
@@ -0,0 +1,86 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides: mysql-ndb-mgm
+# Required-Start: $syslog
+# Required-Stop: $syslog mysql
+# Should-Start: $local_fs $remote_fs $network $named $time
+# Should-Stop: $local_fs $remote_fs $network $named $time
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start and stop the mysql database cluster management daemon
+# Description: Controls the MySQL NDB Management Node daemon "ndb_mgmd".
+### END INIT INFO
+#
+set -e
+set -u
+${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
+
+# Variables
+SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
+DAEMON=/usr/sbin/ndb_mgmd
+CONF=/etc/mysql/ndb_mgmd.cnf
+export HOME=/etc/mysql/
+
+# Safeguard (relative paths, core dumps..)
+cd /
+umask 077
+
+# Exit *silently* if we're not supposed to be started.
+#
+# The Debian scripts should execute these scripts to stop and start
+# the daemon when upgrading if it is started. On the other hand it should
+# remain silently if the server has not even been configured.
+# See /usr/share/doc/mysql-server-*/README.Debian for more information.
+test -x $DAEMON || exit 0
+test -r $CONF || exit 0
+. /lib/lsb/init-functions
+
+#
+# main()
+#
+case "${1:-''}" in
+ 'start')
+ # Start daemon
+ log_daemon_msg "Starting MySQL NDB Management Node" "ndb_mgmd"
+ # --pid-file does not work as the daemon forks itself with $PID=$PID+1
+ if start-stop-daemon \
+ --start \
+ --exec $DAEMON \
+ --user mysql \
+ -- \
+ -f $CONF
+ then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ log_warning_msg "Please take a look at the syslog."
+ exit 1
+ fi
+ ;;
+
+ 'stop')
+ log_daemon_msg "Stopping MySQL NDB Management Node" "ndb_mgmd"
+ if start-stop-daemon \
+ --stop \
+ --oknodo \
+ --exec $DAEMON
+ then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ exit 1
+ fi
+ ;;
+
+ 'restart'|'force-reload')
+ set +e; $SELF stop; set -e
+ $SELF start
+ ;;
+
+ *)
+ echo "Usage: $SELF start|stop|restart|force-reload"
+ exit 1
+ ;;
+esac
+
diff --git a/debian/mysql-server-BASE.NEWS.in b/debian/mysql-server-BASE.NEWS.in
new file mode 100644
index 00000000000..9884e2694e7
--- /dev/null
+++ b/debian/mysql-server-BASE.NEWS.in
@@ -0,0 +1,10 @@
+mysql-dfsg-5.0 (5.0.18-9) unstable; urgency=low
+
+ Rotation of the binary logs is now configured in /etc/mysql/my.cnf with
+ "expire-logs-days" which defaults to 20 days. The old file
+ /etc/mysql/debian-log-rotate.conf should be removed together with
+ /etc/cron.daily/mysql-server after this value has been adjusted. Note that
+ the old variable defined the number of files whereas the new one defines
+ a time span in days.
+
+ -- Christian Hammers <ch@debian.org> Tue, 24 Jan 2006 22:18:21 +0100
diff --git a/debian/mysql-server-BASE.README.Debian.in b/debian/mysql-server-BASE.README.Debian.in
new file mode 100644
index 00000000000..ca9eca271c0
--- /dev/null
+++ b/debian/mysql-server-BASE.README.Debian.in
@@ -0,0 +1,125 @@
+
+* REMEMBER TO SET THE ROOT PASSWORD !!!
+============================================================================
+
+* MYSQL WON'T INSTALL?
+======================
+MySQL will only install if you have a non-numeric hostname that is resolvable
+via the /etc/hosts file. E.g. if the "hostname" command returns "myhostname"
+then there must be a line like "10.0.0.1 myhostname".
+
+On upgrades from MySQL 3.23, as shipped with Debian Woody, symlinks in place of
+/var/lib/mysql or /var/log/mysql gets accidently removed and have manually be
+restored.
+
+* MYSQL WON'T START OR STOP?
+============================
+You may never ever delete the special mysql user "debian-sys-maint". This
+user together with the credentials in /etc/mysql/debian.cnf are used by the
+init scripts to stop the server as they would require knowledge of the mysql
+root users password else.
+So in most of the times you can fix the situation by making sure that the
+debian.cnf file contains the right password, e.g. by setting a new one
+(remember to do a "flush privileges" then).
+
+* WHAT TO DO AFTER UPGRADES:
+============================
+ - running mysql_upgrade to be able to make use of possibly added new
+ privilege columns. This script does not give any use more rights.
+
+* WHAT TO DO AFTER INSTALLATION:
+================================
+The MySQL manual describes certain steps to do at this stage in a separate
+chapter. They are not necessary as the Debian packages does them
+automatically.
+
+The only thing that is left over for the admin is
+ - setting the *passwords* !!!
+ - creating new users and databases
+ - read the rest of this text
+
+* DOWNGRADING TO 4.0 or 4.1:
+============================
+Unsupported. Period.
+But if you do and get problems or make interesting experiences, mail me, it
+might help others.
+Ok, if you really want, I would recommend to "mysqldump --opt" all tables,
+then purge 4.1, delete /var/lib/mysql, install 4.0 and insert the dumps. Be
+carefully, though, with the "mysql" table, you might not simply overwrite that
+one as the password for the mysql "debian-sys-maint" user is stored in
+/etc/mysql/debian.cnf and needed by /etc/init.d/ to start mysql and check if
+it's alive.
+
+* SOME APPLICATION CAN NO LONGER CONNECT:
+=========================================
+This application is probably linked against libmysqlclient12 or below and
+somebody has created a mysql user with new-style passwords.
+The old_passwords option which forces backwards compatibility, can be set
+in /etc/mysql/conf.d/old_passwords.conf.
+If that does not help, the password can be set manually, the application that
+inserted the user should be changed or the application that tries to connect
+should be updated to libmysqlclient14 or -15.
+Read http://dev.mysql.com/doc/refman/5.0/en/old-client.html
+
+* NETWORKING:
+=============
+For security reasons, the Debian package has enabled networking only on the
+loop-back device using "bind-address" in /etc/mysql/my.cnf. Check with
+"netstat -tlnp" where it is listening. If your connection is aborted
+immediately see if "mysqld: all" or similar is in /etc/hosts.allow and read
+hosts_access(5).
+
+* WHERE IS THE DOCUMENTATION?:
+==============================
+Unfortunately due to licensing restrictions, debian currently not able
+to provide the mysql-doc package in any format. For the most up to date
+documentation, please go to http://dev.mysql.com/doc.
+
+* PASSWORDS:
+============
+It is strongly recommended to set a password for the mysql root user (which
+is NOT the same as the "normal" root user) with the command:
+ /usr/bin/mysqladmin -u root password 'enter-your-good-new-password-here'
+If you already had a password set add " -p " before "-u" to the line above.
+
+If you are tired to type the password in every time or want to automate your
+scripts you can store it in the file $HOME/.my.cnf. It should be chmod 0600
+(-rw------- username username .my.cnf) to ensure that nobody else can read
+it. Every other configuration parameter can be stored there, too. You will
+find an example below and more information in the MySQL manual in
+/usr/share/doc/mysql-doc or www.mysql.com.
+
+ATTENTION: It is necessary, that a .my.cnf from root always contains a "user"
+line wherever there is a "password" line, else, the Debian maintenance
+scripts, that use /etc/mysql/debian.cnf, will use the username
+"debian-sys-maint" but the password that is in root's .my.cnf. Also note,
+that every change you make in the /root/.my.cnf will affect the mysql cron
+script, too.
+
+ # an example of $HOME/.my.cnf
+ [client]
+ user = your-mysql-username
+ password = enter-your-good-new-password-here
+
+* BIG_ROWS FOR EVEN MORE ROWS IN A TABLE:
+=========================================
+If you ever run out of rows in a table there is the possibility of building
+the package with "-DBIG_ROWS" which, according to a MySQL employee on
+packagers@lists.mysql.com should lead to a 64bit row index (I guess > 2^32
+rows) but also to an approx. 5% performance loss.
+
+* NDB CLUSTER ENGINE:
+=====================
+NDB is the shared-nothing cluster engine since MySQL-4.1.
+This package contains the all three components, the mysql backend, the NDB
+Data Node and the NDB Management Node. The init scripts of the cluster
+daemons will silently exit unless their configuration is provided:
+ mysql-ndb: needs "ndb-connectstring" in /etc/mysql/my.cnf
+ mysql-ndb-mgm: needs /etc/mysql/ndb_mgmd.cnf
+
+* EXPIRE_LOGS_DAYS AND LOG_BIN:
+===============================
+Having expire_logs_days enabled but log-bin not crashes the server. Using both
+or none of those options is safe. To prevent this happening during the nightly
+log rotation via /etc/logrotate.d/mysql the initscript checks for malicious
+combination of options. This is Debian bug #368547 and MySQL bug #17733.
diff --git a/debian/mysql-server-BASE.config.in b/debian/mysql-server-BASE.config.in
new file mode 100644
index 00000000000..c89c6127dc2
--- /dev/null
+++ b/debian/mysql-server-BASE.config.in
@@ -0,0 +1,39 @@
+#!/bin/bash -e
+
+. /usr/share/debconf/confmodule
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+CNF=/etc/mysql/my.cnf
+
+# Beware that there are two ypwhich one of them needs the 2>/dev/null!
+if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then
+ db_input high mysql-server-@MYSQL_BRANDED_BASE_VERSION@/nis_warning || true
+ db_go
+fi
+
+# only ask this question on fresh installs and during "reconfiguration".
+# there is also an additional check for empty root passwords in the
+# postinst script when the tools are available for us to use.
+if [ "$1" = "configure" ] && [ -z "$2" ] || [ "$1" = "reconfigure" ]; then
+ db_input medium mysql-server/root_password || true
+ db_go
+fi
+
+# If this is an upgrade of an already existing installation ask the user if
+# we may use the backwards incompatible but more secure password format.
+# This should not be shown at dpkg-reconfigure and except for the dist-upgrade,
+# config files are for the admin only!
+# Read: If mysql was already installed but not from Etch and it was either 4.0
+# or had old_passwords enabled before then the system is affected.
+if [ "$1" = "configure" ] &&
+ [ -f $CNF ] &&
+ (
+ [ ! -f /var/lib/mysql/debian-4.1.flag ] ||
+ egrep -q -i '^[[:space:]]*old.passwords[[:space:]]*=[[:space:]]*(1|true)' $CNF
+ )
+then
+ db_input medium mysql-server-@MYSQL_BRANDED_BASE_VERSION@/need_sarge_compat || true
+ db_go
+fi
diff --git a/debian/mysql-server-BASE.dirs.in b/debian/mysql-server-BASE.dirs.in
new file mode 100644
index 00000000000..62ce062ac84
--- /dev/null
+++ b/debian/mysql-server-BASE.dirs.in
@@ -0,0 +1,13 @@
+etc/init.d
+etc/logrotate.d
+usr/bin
+usr/lib
+usr/lib/mysql
+usr/sbin
+usr/share/man/man8
+usr/share/info
+usr/share/mysql
+usr/lib/pkgconfig
+var/run/mysqld
+var/lib/mysql-upgrade
+var/lib/mysql-cluster
diff --git a/debian/mysql-server-BASE.docs.in b/debian/mysql-server-BASE.docs.in
new file mode 100644
index 00000000000..d624701bb8f
--- /dev/null
+++ b/debian/mysql-server-BASE.docs.in
@@ -0,0 +1,2 @@
+EXCEPTIONS-CLIENT
+debian/copyright.more
diff --git a/debian/mysql-server-BASE.files.in b/debian/mysql-server-BASE.files.in
new file mode 100644
index 00000000000..3481faa968a
--- /dev/null
+++ b/debian/mysql-server-BASE.files.in
@@ -0,0 +1,50 @@
+usr/bin/my_print_defaults
+usr/bin/myisam_ftdump
+usr/bin/myisamchk
+usr/bin/myisamlog
+usr/bin/myisampack
+usr/bin/mysql_convert_table_format
+usr/bin/mysql_explain_log
+usr/bin/mysql_fix_extensions
+usr/bin/mysql_fix_privilege_tables
+usr/bin/mysql_install_db
+usr/bin/mysql_secure_installation
+usr/bin/mysql_setpermission
+usr/bin/mysql_tzinfo_to_sql
+usr/bin/mysql_upgrade
+usr/bin/mysql_zap
+usr/bin/mysqlbug
+usr/bin/mysqld_multi
+usr/bin/mysqld_safe
+usr/bin/mysqldumpslow
+usr/bin/mysqlhotcopy
+usr/bin/mysqltest
+usr/bin/perror
+usr/bin/replace
+usr/bin/resolve_stack_dump
+usr/bin/resolveip
+usr/sbin/mysqld
+usr/sbin/mysqlmanager
+usr/lib/mysql/mysqld.sym
+usr/share/lintian/overrides/mysql-server-@MYSQL_BRANDED_BASE_VERSION@
+usr/share/info/mysql.info
+usr/share/man/man1/mysqlman.1
+usr/share/man/man1/my_print_defaults.1
+usr/share/man/man1/myisam_ftdump.1
+usr/share/man/man1/myisamchk.1
+usr/share/man/man1/myisamlog.1
+usr/share/man/man1/myisampack.1
+usr/share/man/man1/mysql_explain_log.1
+usr/share/man/man8/mysqld.8
+usr/share/man/man1/mysqld_multi.1
+usr/share/man/man1/mysqld_safe.1
+usr/share/man/man1/mysql_fix_privilege_tables.1
+usr/share/man/man1/mysql_install_db.1
+usr/share/man/man1/mysqlhotcopy.1
+usr/share/man/man8/mysqlmanager.8
+usr/share/man/man1/mysql_upgrade.1
+usr/share/man/man1/mysql_tzinfo_to_sql.1
+usr/share/man/man1/mysql_zap.1
+usr/share/man/man1/perror.1
+usr/share/man/man1/replace.1
+usr/share/man/man1/safe_mysqld.1
diff --git a/debian/mysql-server-BASE.links.in b/debian/mysql-server-BASE.links.in
new file mode 100644
index 00000000000..b023931144d
--- /dev/null
+++ b/debian/mysql-server-BASE.links.in
@@ -0,0 +1 @@
+usr/bin/mysqld_safe usr/bin/safe_mysqld
diff --git a/debian/mysql-server-BASE.lintian-overrides.in b/debian/mysql-server-BASE.lintian-overrides.in
new file mode 100644
index 00000000000..7eceabc1aec
--- /dev/null
+++ b/debian/mysql-server-BASE.lintian-overrides.in
@@ -0,0 +1,4 @@
+mysql-server-@MYSQL_BRANDED_BASE_VERSION@: possible-bashism-in-maintainer-script postinst:81 'p{("a".."z","A".."Z",0..9)[int(rand(62))]}'
+mysql-server-@MYSQL_BRANDED_BASE_VERSION@: possible-bashism-in-maintainer-script preinst:33 '${cmd/ */}'
+mysql-server-@MYSQL_BRANDED_BASE_VERSION@: statically-linked-binary ./usr/bin/mysql_tzinfo_to_sql
+mysql-server-@MYSQL_BRANDED_BASE_VERSION@: statically-linked-binary ./usr/sbin/mysqld
diff --git a/debian/mysql-server-BASE.logcheck.ignore.paranoid.in b/debian/mysql-server-BASE.logcheck.ignore.paranoid.in
new file mode 100644
index 00000000000..61231af32fc
--- /dev/null
+++ b/debian/mysql-server-BASE.logcheck.ignore.paranoid.in
@@ -0,0 +1,10 @@
+/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$
+/etc/init.d/mysql\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
+mysqld\[[0-9]+\]: $
+mysqld\[[0-9]+\]: Support MySQL by buying support/licenses at http://shop.mysql.com$
+mysqld\[[0-9]+\]: Version: .* socket: '/var/run/mysqld/mysqld.sock' port: 3306$
+mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$
+mysqld_safe\[[0-9]+\]: started$
+mysqld_safe\[[0-9]+\]: Support MySQL by buying support/licenses at http://shop.mysql.com *$
+usermod\[[0-9]+\]: change user `mysql' GID from `([0-9]+)' to `\1'$
+usermod\[[0-9]+\]: change user `mysql' shell from `/bin/false' to `/bin/false'$
diff --git a/debian/mysql-server-BASE.logcheck.ignore.server.in b/debian/mysql-server-BASE.logcheck.ignore.server.in
new file mode 100644
index 00000000000..3a7de17f3f8
--- /dev/null
+++ b/debian/mysql-server-BASE.logcheck.ignore.server.in
@@ -0,0 +1,31 @@
+/etc/init.d/mysql\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
+/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$
+/etc/init.d/mysql\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
+mysqld\[[0-9]+\]: ?$
+mysqld\[[0-9]+\]: .*InnoDB: Shutdown completed
+mysqld\[[0-9]+\]: .*InnoDB: Started;
+mysqld\[[0-9]+\]: .*InnoDB: Starting shutdown\.\.\.$
+mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Normal shutdown$
+mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: ready for connections\.$
+mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Shutdown complete$
+mysqld\[[0-9]+\]: Support MySQL by buying support/licenses at http://shop.mysql.com$
+mysqld\[[0-9]+\]: /usr/sbin/mysqld: ready for connections\.$
+mysqld\[[0-9]+\]: .*/usr/sbin/mysqld: Shutdown Complete$
+mysqld\[[0-9]+\]: Version: .* socket
+mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$
+mysqld_safe\[[0-9]+\]: ?$
+mysqld_safe\[[0-9]+\]: able to use the new GRANT command!$
+mysqld_safe\[[0-9]+\]: ended$
+mysqld_safe\[[0-9]+\]: http://www.mysql.com$
+mysqld_safe\[[0-9]+\]: NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run$
+mysqld_safe\[[0-9]+\]: PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !$
+mysqld_safe\[[0-9]+\]: Please report any problems with the /usr/bin/mysqlbug script!$
+mysqld_safe\[[0-9]+\]: See the manual for more instructions.$
+mysqld_safe\[[0-9]+\]: started$
+mysqld_safe\[[0-9]+\]: Support MySQL by buying support/licenses at
+mysqld_safe\[[0-9]+\]: The latest information about MySQL is available on the web at$
+mysqld_safe\[[0-9]+\]: the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be$
+mysqld_safe\[[0-9]+\]: To do so, start the server, then issue the following commands:$
+mysqld_safe\[[0-9]+\]: /usr/bin/mysqladmin -u root password 'new-password'$
+usermod\[[0-9]+\]: change user `mysql' GID from `([0-9]+)' to `\1'$
+usermod\[[0-9]+\]: change user `mysql' shell from `/bin/false' to `/bin/false'$
diff --git a/debian/mysql-server-BASE.logcheck.ignore.workstation.in b/debian/mysql-server-BASE.logcheck.ignore.workstation.in
new file mode 100644
index 00000000000..3a7de17f3f8
--- /dev/null
+++ b/debian/mysql-server-BASE.logcheck.ignore.workstation.in
@@ -0,0 +1,31 @@
+/etc/init.d/mysql\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
+/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$
+/etc/init.d/mysql\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
+mysqld\[[0-9]+\]: ?$
+mysqld\[[0-9]+\]: .*InnoDB: Shutdown completed
+mysqld\[[0-9]+\]: .*InnoDB: Started;
+mysqld\[[0-9]+\]: .*InnoDB: Starting shutdown\.\.\.$
+mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Normal shutdown$
+mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: ready for connections\.$
+mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Shutdown complete$
+mysqld\[[0-9]+\]: Support MySQL by buying support/licenses at http://shop.mysql.com$
+mysqld\[[0-9]+\]: /usr/sbin/mysqld: ready for connections\.$
+mysqld\[[0-9]+\]: .*/usr/sbin/mysqld: Shutdown Complete$
+mysqld\[[0-9]+\]: Version: .* socket
+mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$
+mysqld_safe\[[0-9]+\]: ?$
+mysqld_safe\[[0-9]+\]: able to use the new GRANT command!$
+mysqld_safe\[[0-9]+\]: ended$
+mysqld_safe\[[0-9]+\]: http://www.mysql.com$
+mysqld_safe\[[0-9]+\]: NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run$
+mysqld_safe\[[0-9]+\]: PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !$
+mysqld_safe\[[0-9]+\]: Please report any problems with the /usr/bin/mysqlbug script!$
+mysqld_safe\[[0-9]+\]: See the manual for more instructions.$
+mysqld_safe\[[0-9]+\]: started$
+mysqld_safe\[[0-9]+\]: Support MySQL by buying support/licenses at
+mysqld_safe\[[0-9]+\]: The latest information about MySQL is available on the web at$
+mysqld_safe\[[0-9]+\]: the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be$
+mysqld_safe\[[0-9]+\]: To do so, start the server, then issue the following commands:$
+mysqld_safe\[[0-9]+\]: /usr/bin/mysqladmin -u root password 'new-password'$
+usermod\[[0-9]+\]: change user `mysql' GID from `([0-9]+)' to `\1'$
+usermod\[[0-9]+\]: change user `mysql' shell from `/bin/false' to `/bin/false'$
diff --git a/debian/mysql-server-BASE.mysql-server.logrotate.in b/debian/mysql-server-BASE.mysql-server.logrotate.in
new file mode 100644
index 00000000000..d32bef50588
--- /dev/null
+++ b/debian/mysql-server-BASE.mysql-server.logrotate.in
@@ -0,0 +1,28 @@
+# - I put everything in one block and added sharedscripts, so that mysql gets
+# flush-logs'd only once.
+# Else the binary logs would automatically increase by n times every day.
+# - The error log is obsolete, messages go to syslog now.
+/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log {
+ daily
+ rotate 7
+ missingok
+ create 640 mysql adm
+ compress
+ sharedscripts
+ postrotate
+ test -x /usr/bin/mysqladmin || exit 0
+
+ # If this fails, check debian.conf!
+ export HOME=/etc/mysql/my.cnf
+ MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
+ if [ -z "`$MYADMIN ping 2>/dev/null`" ]; then
+ # Really no mysqld or rather a missing debian-sys-maint user?
+ # If this occurs and is not a error please report a bug.
+ if ps cax | grep -q mysqld; then
+ exit 1
+ fi
+ else
+ $MYADMIN flush-logs
+ fi
+ endscript
+}
diff --git a/debian/mysql-server-BASE.postinst.in b/debian/mysql-server-BASE.postinst.in
new file mode 100644
index 00000000000..19ae1892de8
--- /dev/null
+++ b/debian/mysql-server-BASE.postinst.in
@@ -0,0 +1,276 @@
+#!/bin/bash -e
+
+. /usr/share/debconf/confmodule
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
+
+# This command can be used as pipe to syslog. With "-s" it also logs to stderr.
+ERR_LOGGER="logger -p daemon.err -t mysqld_safe -i"
+
+invoke() {
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ invoke-rc.d mysql $1
+ else
+ /etc/init.d/mysql $1
+ fi
+}
+
+MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --skip-bdb --skip-innodb "
+
+test_mysql_access() {
+ mysql --no-defaults -u root -h localhost </dev/null >/dev/null 2>&1
+}
+
+# call with $1 = "online" to connect to the server, otherwise it bootstraps
+set_mysql_rootpw() {
+ # forget we ever saw the password. don't use reset to keep the seen status
+ db_set mysql-server/root_password ""
+
+ tfile=`mktemp`
+ if [ ! -f "$tfile" ]; then
+ return 1
+ fi
+
+ # this avoids us having to call "test" or "[" on $rootpw
+ cat << EOF > $tfile
+USE mysql;
+UPDATE user SET password=PASSWORD("$rootpw") WHERE user='root';
+FLUSH PRIVILEGES;
+EOF
+ if grep -q 'PASSWORD("")' $tfile; then
+ retval=0
+ elif [ "$1" = "online" ]; then
+ mysql --no-defaults -u root -h localhost <$tfile >/dev/null
+ retval=$?
+ else
+ $MYSQL_BOOTSTRAP <$tfile
+ retval=$?
+ fi
+ rm -f $tfile
+ return $retval
+}
+
+# This is necessary because mysql_install_db removes the pid file in /var/run
+# and because changed configuration options should take effect immediately.
+# In case the server wasn't running at all it should be ok if the stop
+# script fails. I can't tell at this point because of the cleaned /var/run.
+set +e; invoke stop; set -e
+
+case "$1" in
+ configure)
+ mysql_cnf=/etc/mysql/my.cnf
+ mysql_datadir=/usr/share/mysql
+ mysql_statedir=/var/lib/mysql
+ mysql_rundir=/var/run/mysqld
+ mysql_logdir=/var/log
+ mysql_cfgdir=/etc/mysql
+ mysql_newlogdir=/var/log/mysql
+ mysql_upgradedir=/var/lib/mysql-upgrade
+
+ # first things first, if the following symlink exists, it is a preserved
+ # copy the old data dir from a mysql upgrade that would have otherwise
+ # been replaced by an empty mysql dir. this should restore it.
+ for dir in DATADIR LOGDIR; do
+ if [ "$dir" = "DATADIR" ]; then targetdir=$mysql_statedir; else targetdir=$mysql_newlogdir; fi
+ savelink="$mysql_upgradedir/$dir.link"
+ if [ -L "$savelink" ]; then
+ # If the targetdir was a symlink before we upgraded it is supposed
+ # to be either still be present or not existing anymore now.
+ if [ -L "$targetdir" ]; then
+ rm "$savelink"
+ elif [ ! -d "$targetdir" ]; then
+ mv "$savelink" "$targetdir"
+ else
+ # this should never even happen, but just in case...
+ mysql_tmp=`mktemp -d -t mysql-symlink-restore-XXXXXX`
+ echo "this is very strange! see $mysql_tmp/README..." >&2
+ mv "$targetdir" "$mysql_tmp"
+ cat << EOF > "$mysql_tmp/README"
+
+if you're reading this, it's most likely because you had replaced /var/lib/mysql
+with a symlink, then upgraded to a new version of mysql, and then dpkg
+removed your symlink (see #182747 and others). the mysql packages noticed
+that this happened, and as a workaround have restored it. however, because
+/var/lib/mysql seems to have been re-created in the meantime, and because
+we don't want to rm -rf something we don't know as much about, we're going
+to leave this unexpected directory here. if your database looks normal,
+and this is not a symlink to your database, you should be able to blow
+this all away.
+
+EOF
+ fi
+ fi
+ rmdir $mysql_upgradedir 2>/dev/null || true
+ done
+
+ # Ensure the existence and right permissions for the database and
+ # log files.
+ if [ ! -d "$mysql_statedir" -a ! -L "$mysql_statedir" ]; then mkdir "$mysql_statedir"; fi
+ if [ ! -d "$mysql_statedir/mysql" -a ! -L "$mysql_statedir/mysql" ]; then mkdir "$mysql_statedir/mysql"; fi
+ if [ ! -d "$mysql_newlogdir" -a ! -L "$mysql_newlogdir" ]; then mkdir "$mysql_newlogdir"; fi
+ # When creating an ext3 jounal on an already mounted filesystem like e.g.
+ # /var/lib/mysql, you get a .journal file that is not modifyable by chown.
+ # The mysql_datadir must not be writable by the mysql user under any
+ # circumstances as it contains scripts that are executed by root.
+ set +e
+ chown -R 0.0 $mysql_datadir
+ chown -R mysql $mysql_statedir
+ chown -R mysql $mysql_rundir
+ chown -R mysql:adm $mysql_newlogdir; chmod 2750 $mysql_newlogdir;
+ for i in log err; do
+ touch $mysql_logdir/mysql.$i
+ chown mysql:adm $mysql_logdir/mysql.$i
+ chmod 0640 $mysql_logdir/mysql.$i
+ done
+ set -e
+
+ # This is important to avoid dataloss when there is a removed
+ # mysql-server version from Woody lying around which used the same
+ # data directory and then somewhen gets purged by the admin.
+ db_set mysql-server/postrm_remove_database false || true
+
+ # So that mysql-server (4.0) can check if it's safe to install.
+ touch $mysql_statedir/debian-@VER@.flag
+
+ # On dist-upgrades, we ensure that the old_password setting is updated
+ # before passwords are changed. Except for that config files are taboo!
+ db_get mysql-server-@MYSQL_BRANDED_BASE_VERSION@/need_sarge_compat_done || true
+ if [ "$RET" = "false" ]; then
+ db_get mysql-server-@MYSQL_BRANDED_BASE_VERSION@/need_sarge_compat
+ echo -e "# created by debconf but save to be edited\n[mysqld]\nold_passwords = $RET" > /etc/mysql/conf.d/old_passwords.cnf
+ fi
+ db_set mysql-server-@MYSQL_BRANDED_BASE_VERSION@/need_sarge_compat_done true
+
+ # initiate databases. Output is not allowed by debconf :-(
+ # Debian: beware of the bashisms...
+ # Debian: can safely run on upgrades with existing databases
+ set +e
+ /bin/bash /usr/bin/mysql_install_db --rpm 2>&1 | $ERR_LOGGER
+ if [ "$?" != "0" ]; then
+ echo "ATTENTION: An error has occured. More info is in the syslog!"
+ fi
+ set -e
+
+ ## On every reconfiguration the maintenance user is recreated.
+ #
+ # - It is easier to regenerate the password every time but as people
+ # use fancy rsync scripts and file alteration monitors, the existing
+ # password is used and existing files not touched.
+ # - The mysqld statement is like that in mysql_install_db because the
+ # server is not already running. This has some implications:
+ # - The amount of newlines and semicolons in the query is important!
+ # - GRANT is not possible with --skipt-grant-tables and "INSERT
+ # (user,host..) VALUES" is not --ansi compliant
+ # - The echo is just for readability. ash's buildin has no "-e" so use /bin/echo.
+ # - The Super_priv, Show_db_priv, Create_tmp_table_priv and Lock_tables_priv
+ # may not be present as old Woody 3.23 databases did not have it and the
+ # admin might not already have run mysql_upgrade which adds them.
+ # As the binlog cron scripts to need at least the Super_priv, I do first
+ # the old query which always succeeds and then the new which may or may not.
+
+ # recreate the credentials file if not present or without mysql_upgrade stanza
+ dc=$mysql_cfgdir/debian.cnf;
+ if [ -e "$dc" -a -n "`fgrep mysql_upgrade $dc 2>/dev/null`" ]; then
+ pass="`sed -n 's/password *= *// p' $dc | head -n 1`"
+ else
+ pass=`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)'`;
+ if [ ! -d "$mysql_cfgdir" ]; then install -o 0 -g 0 -m 0755 -d $mysql_cfgdir; fi
+ cat /dev/null > $dc
+ echo "# Automatically generated for Debian scripts. DO NOT TOUCH!" >>$dc
+ echo "[client]" >>$dc
+ echo "host = localhost" >>$dc
+ echo "user = debian-sys-maint" >>$dc
+ echo "password = $pass" >>$dc
+ echo "socket = $mysql_rundir/mysqld.sock" >>$dc
+ echo "[mysql_upgrade]" >>$dc
+ echo "user = debian-sys-maint" >>$dc
+ echo "password = $pass" >>$dc
+ echo "socket = $mysql_rundir/mysqld.sock" >>$dc
+ echo "basedir = /usr" >>$dc
+ fi
+ # If this dir chmod go+w then the admin did it. But this file should not.
+ chown 0:0 $dc
+ chmod 0600 $dc
+
+ # update privilege and timezone tables
+ password_column_fix_query=`/bin/echo -e \
+ "USE mysql\n" \
+ "ALTER TABLE user CHANGE password Password varchar(41) collate utf8_bin NOT NULL default ''"`;
+ replace_query=`/bin/echo -e \
+ "USE mysql\n" \
+ "REPLACE INTO user SET " \
+ " host='localhost', user='debian-sys-maint', password=password('$pass'), " \
+ " Select_priv='Y', Insert_priv='Y', Update_priv='Y', Delete_priv='Y', " \
+ " Create_priv='Y', Drop_priv='Y', Reload_priv='Y', Shutdown_priv='Y', " \
+ " Process_priv='Y', File_priv='Y', Grant_priv='Y', References_priv='Y', " \
+ " Index_priv='Y', Alter_priv='Y' __EXTRA_PRIVS__"`;
+ extra_privs=`/bin/echo -e \
+ ", Show_db_priv='Y' " \
+ ", Super_priv='Y' " \
+ ", Create_tmp_table_priv='Y' " \
+ ", Lock_tables_priv='Y' " \
+ ", Execute_priv='Y' " \
+ ", Repl_slave_priv='Y' " \
+ ", Repl_client_priv='Y' "`;
+
+ # Upgrade password column format before the root password gets set.
+ echo "$password_column_fix_query" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
+
+ db_get mysql-server/root_password && rootpw="$RET"
+ if ! set_mysql_rootpw; then
+ password_error="yes"
+ fi
+
+ echo "$replace_query" | sed "s/__EXTRA_PRIVS__//" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
+ set +e
+ echo "$replace_query" | sed "s/__EXTRA_PRIVS__/$extra_privs/" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
+ set -e
+ mysql_tzinfo_to_sql /usr/share/zoneinfo/ 2>&1 | egrep -v 'Skipping it.$' | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
+
+ # The Sarge package "mysql-server" which used to include the mysqld daemon
+ # may still be in unselected-configured state (i.e. after a remove but not
+ # purge) in which case its now obsolete cronscript has to be moved away.
+ for i in /etc/cron.daily/mysql-server /etc/cron.daily/mysql-server-41 /etc/mysql/debian-log-rotate.conf; do
+ if [ -f $i ]; then mv $i $i.dpkg-old; fi
+ done
+ ;;
+
+ abort-upgrade|abort-remove|abort-configure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument '$1'" 1>&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+# here we check to see if we can connect as root without a password
+# this should catch upgrades from previous verisons where the root
+# password wasn't set. if there is a password, or if the connection
+# fails for any other reason, nothing happens.
+if [ "$1" = "configure" ]; then
+ if test_mysql_access; then
+ db_input medium mysql-server/root_password || true
+ db_go
+ db_get mysql-server/root_password && rootpw="$RET"
+
+ if ! set_mysql_rootpw "online"; then
+ password_error="yes"
+ fi
+ fi
+
+ if [ "$password_error" = "yes" ]; then
+ db_input high mysql-server/error_setting_password || true
+ db_go
+ fi
+
+fi
+
+db_stop # in case invoke failes
+
+exit 0
diff --git a/debian/mysql-server-BASE.postrm.in b/debian/mysql-server-BASE.postrm.in
new file mode 100644
index 00000000000..8021068d87a
--- /dev/null
+++ b/debian/mysql-server-BASE.postrm.in
@@ -0,0 +1,92 @@
+#!/bin/bash -e
+
+. /usr/share/debconf/confmodule
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
+
+# Try to stop the server in a sane way. If it does not success let the admin
+# do it himself. No database directories should be removed while the server
+# is running!
+stop_server() {
+ set +e
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ invoke-rc.d mysql stop
+ else
+ /etc/init.d/mysql stop
+ fi
+ errno=$?
+ set -e
+
+ if [ "$?" != 0 ]; then
+ echo "Trying to stop the MySQL server resulted in exitcode $?." 1>&2
+ echo "Stop it yourself and try again!" 1>&2
+ exit 1
+ fi
+}
+
+case "$1" in
+ purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ if [ -n "`$MYADMIN ping 2>/dev/null`" ]; then
+ stop_server
+ sleep 2
+ fi
+ ;;
+ *)
+ echo "postrm called with unknown argument '$1'" 1>&2
+ exit 1
+ ;;
+esac
+
+#
+# - Do NOT purge logs or data if another mysql-sever* package is installed (#307473)
+# - Remove the mysql user only after all his owned files are purged.
+#
+if [ "$1" = "purge" -a ! \( -x /usr/sbin/mysqld -o -L /usr/sbin/mysqld \) ]; then
+ # we remove the mysql user only after all his owned files are purged
+ rm -f /var/log/mysql.{log,err}{,.0,.[1234567].gz}
+ rm -rf /var/log/mysql
+
+ db_input high mysql-server-@MYSQL_BRANDED_BASE_VERSION@/postrm_remove_databases || true
+ db_go
+ db_get mysql-server-@MYSQL_BRANDED_BASE_VERSION@/postrm_remove_databases || true
+ if [ "$RET" = "true" ]; then
+ # never remove the debian.cnf when the databases are still existing
+ # else we ran into big trouble on the next install!
+ rm -f /etc/mysql/conf.d/old_passwords.cnf
+ rm -f /etc/mysql/debian.cnf
+ rm -rf /var/lib/mysql
+ rm -rf /var/run/mysqld
+ userdel mysql || true
+ fi
+
+ # (normally) Automatically added by dh_installinit
+ if [ "$1" = "purge" ] ; then
+ update-rc.d mysql remove >/dev/null || exit 0
+ fi
+ # (normally) End automatically added section
+fi
+
+# (normally) Automatically added by dh_installdebconf
+if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
+ . /usr/share/debconf/confmodule
+ db_purge
+fi
+# (normally) End automatically added section
+
+# (normally) Automatically added by dh_installinit
+if [ "$1" = "purge" ] ; then
+ update-rc.d mysql-ndb-mgm remove >/dev/null || exit 0
+fi
+# (normally) End automatically added section
+# (normally) Automatically added by dh_installinit
+if [ "$1" = "purge" ] ; then
+ update-rc.d mysql-ndb remove >/dev/null || exit 0
+fi
+# (normally) End automatically added section
+
+# no DEBHELPER here, "update-rc.d remove" fails if mysql-server-@MYSQL_BRANDED_BASE_VERSION@ is installed
+
+exit 0
diff --git a/debian/mysql-server-BASE.preinst.in b/debian/mysql-server-BASE.preinst.in
new file mode 100644
index 00000000000..529867f98e0
--- /dev/null
+++ b/debian/mysql-server-BASE.preinst.in
@@ -0,0 +1,167 @@
+#!/bin/bash -e
+#
+# summary of how this script can be called:
+# * <new-preinst> install
+# * <new-preinst> install <old-version>
+# * <new-preinst> upgrade <old-version>
+# * <old-preinst> abort-upgrade <new-version>
+#
+
+. /usr/share/debconf/confmodule
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
+MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
+DATADIR=/var/lib/mysql
+LOGDIR=/var/log/mysql
+UPGRADEDIR=/var/lib/mysql-upgrade
+
+# Try to stop the server in a sane way. If it does not success let the admin
+# do it himself. No database directories should be removed while the server
+# is running! Another mysqld in e.g. a different chroot is fine for us.
+stop_server() {
+ if [ ! -x /etc/init.d/mysql ]; then return; fi
+
+ set +e
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ cmd="invoke-rc.d mysql stop"
+ else
+ cmd="/etc/init.d/mysql stop"
+ fi
+ $cmd
+ errno=$?
+ set -e
+
+ # 0=ok, 100=no init script (fresh install)
+ if [ "$errno" != 0 -a "$errno" != 100 ]; then
+ echo "${cmd/ */} returned $errno" 1>&2
+ echo "There is a MySQL server running, but we failed in our attempts to stop it." 1>&2
+ echo "Stop it yourself and try again!" 1>&2
+ db_stop
+ exit 1
+ fi
+}
+
+################################ main() ##########################
+
+this_version=@VER@
+
+# Safe the user from stupidities.
+show_downgrade_warning=0
+for i in `ls $DATADIR/debian-*.flag 2>/dev/null`; do
+ found_version=`echo $i | sed 's/.*debian-\([0-9\.]\+\).flag/\1/'`
+ if dpkg --compare-versions "$this_version" '<<' "$found_version"; then
+ show_downgrade_warning=1
+ break;
+ fi
+done
+if [ "$show_downgrade_warning" = 1 ]; then
+ db_fset mysql-server-$this_version/really_downgrade seen false || true
+ db_input medium mysql-server-$this_version/really_downgrade || true
+ db_go
+ db_get mysql-server-$this_version/really_downgrade || true
+ if [ "$RET" = "true" ]; then
+ rm -f $DATADIR/debian-*.flag
+ touch $DATADIR/debian-$this_version.flag
+ else
+ echo "Aborting downgrade from (at least) $found_version to $this_version." 1>&2
+ db_stop
+ exit 1
+ fi
+fi
+
+# to be sure
+stop_server
+
+# If we use NIS then errors should be tolerated. It's up to the
+# user to ensure that the mysql user is correctly setup.
+# Beware that there are two ypwhich one of them needs the 2>/dev/null!
+if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then
+ set +e
+fi
+
+#
+# Now we have to ensure the following state:
+# /etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false
+# /etc/group: mysql:x:101:
+#
+# Sadly there could any state be present on the system so we have to
+# modify everything carefully i.e. not doing a chown before creating
+# the user etc...
+#
+
+# creating mysql group if he isn't already there
+if ! getent group mysql >/dev/null; then
+ # Adding system group: mysql.
+ addgroup --system mysql >/dev/null
+fi
+
+# creating mysql user if he isn't already there
+if ! getent passwd mysql >/dev/null; then
+ # Adding system user: mysql.
+ adduser \
+ --system \
+ --disabled-login \
+ --ingroup mysql \
+ --home $DATADIR \
+ --gecos "MySQL Server" \
+ --shell /bin/false \
+ mysql >/dev/null
+fi
+
+# end of NIS tolerance zone
+set -e
+
+# if there's a symlink, let's store where it's pointing, because otherwise
+# it's going to be lost in some situations
+for dir in DATADIR LOGDIR; do
+ checkdir=`eval echo "$"$dir`
+ if [ -L "$checkdir" ]; then
+ mkdir -p "$UPGRADEDIR"
+ cp -d "$checkdir" "$UPGRADEDIR/$dir.link"
+ fi
+done
+
+# creating mysql home directory
+if [ ! -d $DATADIR -a ! -L $DATADIR ]; then
+ mkdir $DATADIR
+fi
+
+# checking disc space
+if LC_ALL=C BLOCKSIZE= df --portability $DATADIR/. | tail -n 1 | awk '{ exit ($4>1000) }'; then
+ echo "ERROR: There's not enough space in $DATADIR/" 1>&2
+ db_stop
+ exit 1
+fi
+
+# Since the home directory was created before putting the user into
+# the mysql group and moreover we cannot guarantee that the
+# permissions were correctly *before* calling this script, we fix them now.
+# In case we use NIS and no mysql user is present then this script should
+# better fail now than later..
+# The "set +e" is necessary as e.g. a ".journal" of a ext3 partition is
+# not chgrp'able (#318435).
+set +e
+chown mysql:mysql $DATADIR
+find $DATADIR -follow -not -group mysql -print0 2>/dev/null \
+ | xargs -0 --no-run-if-empty chgrp mysql
+set -e
+
+# Some files below /etc/ were possibly in the mysql-server-4.1/sarge package
+# before. They get overwritten by current ones to avoid unnecessary dpkg questions.
+while read md5 file; do
+ if [ "`md5sum $file 2>/dev/null`" = "$md5 $file" ]; then
+ cp /usr/share/mysql-common/internal-use-only/`echo $file | sed 's°/°_°g'` $file
+ fi
+done <<EOT
+6691f2fdc5c6d27ff0260eb79813e1bc /etc/init.d/mysql
+b53b9552d44661361d39157c3c7c51d3 /etc/logrotate.d/mysql-server
+EOT
+
+db_stop
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/mysql-server-BASE.prerm.in b/debian/mysql-server-BASE.prerm.in
new file mode 100644
index 00000000000..03e9ea37420
--- /dev/null
+++ b/debian/mysql-server-BASE.prerm.in
@@ -0,0 +1,8 @@
+#!/bin/bash -e
+
+. /usr/share/debconf/confmodule
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+#DEBHELPER#
diff --git a/debian/mysql-server-BASE.templates.in b/debian/mysql-server-BASE.templates.in
new file mode 100644
index 00000000000..888f61345bf
--- /dev/null
+++ b/debian/mysql-server-BASE.templates.in
@@ -0,0 +1,71 @@
+Template: mysql-server-@MYSQL_BRANDED_BASE_VERSION@/really_downgrade
+Type: boolean
+Default: false
+_Description: Do you really want to downgrade?
+ WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a
+ mysql-server package with a higher version has been installed before.
+ It can not be guaranteed that this version can use its data.
+
+Template: mysql-server-@MYSQL_BRANDED_BASE_VERSION@/nis_warning
+Type: note
+_Description: Important note for NIS/YP users!
+ To use mysql you must install an equivalent user and group to the
+ following and ensure yourself that /var/lib/mysql has the right
+ permissions (the uid/gid may be different).
+ .
+ /etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false
+ .
+ /etc/group: mysql:x:101:
+ .
+ /var/lib/mysql: drwxr-xr-x mysql mysql
+
+Template: mysql-server-@MYSQL_BRANDED_BASE_VERSION@/postrm_remove_databases
+Type: boolean
+Default: false
+_Description: Remove the databases used by all MySQL versions?
+ The script is about to remove the data directory /var/lib/mysql.
+ If it is planned to just install a higher MySQL version or if a different
+ mysql-server package is already using it, the data should be kept.
+
+Template: mysql-server-@MYSQL_BRANDED_BASE_VERSION@/start_on_boot
+Type: boolean
+Default: true
+_Description: Should MySQL start on boot?
+ The MySQL can start automatically on boot time or only if you manually
+ type '/etc/init.d/mysql start'.
+
+Template: mysql-server/root_password
+Type: password
+_Description: New password for MySQL "root" user:
+ It is highly recommended that you set a password for the MySQL administrative
+ "root" user.
+ .
+ If you do not provide a password no changes will be made to the account.
+
+Template: mysql-server/error_setting_password
+Type: error
+_Description: Unable to set password for MySQL "root" user
+ It seems an error occurred while setting the password for the MySQL
+ administrative user. This may have happened because the user already
+ has a password, or because there was a problem communicating with the
+ MySQL server.
+ .
+ When installation finishes, you should verify that the account
+ is properly protected with a password (see README.Debian for more
+ information).
+
+Template: mysql-server-@MYSQL_BRANDED_BASE_VERSION@/need_sarge_compat
+Type: boolean
+Default: false
+_Description: Support MySQL connections from hosts running Debian "sarge" or older?
+ The way passwords were stored was not very secure. This has been improved
+ with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 Sarge
+ will not be able to connect to account which are new or whose password have
+ been changed. See /usr/share/doc/mysql-server-@MYSQL_BRANDED_BASE_VERSION@/README.Debian.
+
+Template: mysql-server-@MYSQL_BRANDED_BASE_VERSION@/need_sarge_compat_done
+Type: boolean
+Default: false
+Description: for internal use
+ Only internally used.
+
diff --git a/debian/mysql-server-PREV.preinst.in b/debian/mysql-server-PREV.preinst.in
new file mode 100644
index 00000000000..7440c476f55
--- /dev/null
+++ b/debian/mysql-server-PREV.preinst.in
@@ -0,0 +1,191 @@
+#!/bin/bash -e
+#
+# summary of how this script can be called:
+# * <new-preinst> install
+# * <new-preinst> install <old-version>
+# * <new-preinst> upgrade <old-version>
+# * <old-preinst> abort-upgrade <new-version>
+#
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
+
+# Try to stop the server in a sane way. If it does not success let the admin
+# do it himself. No database directories should be removed while the server
+# is running! Another mysqld in e.g. a different chroot is fine for us.
+stop_server() {
+ if [ ! -x /etc/init.d/mysql ]; then return; fi
+
+ set +e
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ cmd="invoke-rc.d mysql stop"
+ else
+ cmd="/etc/init.d/mysql stop"
+ fi
+ $cmd
+ errno=$?
+ set -e
+
+ # 0=ok, 100=no init script (fresh install)
+ if [ "$errno" != 0 -a "$errno" != 100 ]; then
+ echo "${cmd/ */} returned $errno" 1>&2
+ echo "There is a MySQL server running, but we failed in our attempts to stop it." 1>&2
+ echo "Stop it yourself and try again!" 1>&2
+ exit 1
+ fi
+}
+
+##### here's a bunch of helper functions for converting database formats ######
+
+cvt_get_param(){
+ /usr/sbin/mysqld --print-defaults \
+ | tr " " "\n" \
+ | grep -- "--$1" \
+ | tail -n 1 \
+ | cut -d= -f2
+}
+
+cvt_setup_stuff(){
+ mytmp=`mktemp -d -t mysql-ISAM-convert.XXXXXX`
+ cvt_log="$mytmp/conversion.log"
+ if [ ! -d "$mytmp" ]; then
+ echo "can't create temporary directory, oh well." >&2
+ exit 1
+ fi
+
+ chgrp mysql $mytmp
+ chmod g+rwx $mytmp
+ cvt_socket=${mytmp}/mysql.sock
+
+ cvt_mysqld="mysqld --skip-grant-tables --skip-networking --socket $cvt_socket"
+ cvt_mysql="mysql --socket $cvt_socket"
+ cvt_mysqladmin="mysqladmin --socket $cvt_socket"
+}
+
+cvt_get_databases(){
+ echo fetching database list ... >&2
+ $cvt_mysql -e 'show databases' | sed -n -e '2,$p'
+}
+
+cvt_get_tables(){
+ echo querying tables in $1 ... >&2
+ $cvt_mysql $1 -e 'show table status' | sed -n -e '2,$p' | \
+ cut -f 1,2 | grep -w 'ISAM$' | cut -f 1
+}
+
+cvt_convert_table(){
+ echo converting $1.$2 ... >&2
+ $cvt_mysql $1 -e "alter table $2 type=MyISAM"
+}
+
+cvt_wait_for_server(){
+ local count
+ echo -n waiting for server startup.. >&2
+ while ! $cvt_mysql </dev/null >/dev/null 2>&1; do
+ echo -n . >&2
+ sleep 1
+ count=".$count"
+ if [ -f $mytmp/mysql.done ]; then
+ echo "sorry... looks like the server crashed :(" >&2
+ return 1
+ elif [ "$count" = "...................." ]; then
+ echo "sorry... looks like the server didn't start :(" >&2
+ return 1
+ fi
+ done
+ echo ok. >&2
+}
+
+cvt_wait_for_exit(){
+ local count
+ echo -n waiting for server shutdown.. >&2
+ while [ ! -f $mytmp/mysql.done ]; do
+ echo -n . >&2
+ sleep 1
+ count=".$count"
+ if [ "$count" = "...................." ]; then
+ echo "hrm... guess it never started?" >&2
+ return 0
+ fi
+ done
+ echo ok. >&2
+}
+
+cvt_cleanup(){
+ local mysql_kids
+ rm -rf $mytmp
+ # kill any mysqld child processes left over. there *shouldn't* be any,
+ # but let's not take chances with that
+ mysql_kids=`ps o 'pid command' --ppid $$ | grep -E '^[[:digit:]]+ mysqld ' | cut -d' ' -f1`
+ if [ "$mysql_kids" ]; then
+ echo "strange, some mysql processes left around. killing them now." >&2
+ kill $mysql_kids
+ sleep 10
+ mysql_kids=`ps o 'pid command' --ppid $$ | grep -E '^[[:digit:]]+ mysqld ' | cut -d' ' -f1`
+ if [ "$mysql_kids" ]; then
+ echo "okay, they're really not getting the hint..." >&2
+ kill -9 $mysql_kids
+ fi
+ fi
+}
+
+################################ main() ##########################
+
+# to be sure
+stop_server
+
+# test if upgrading from non conffile state
+if [ "$1" = "upgrade" ] && [ -x /usr/sbin/mysqld ]; then
+ cvt_datadir=`cvt_get_param datadir`
+ # test for ISAM tables, which we must convert NOW
+ if [ -n "`find $cvt_datadir -name '*.ISM' 2>/dev/null`" ]; then
+ set +e
+ cat << EOF >&2
+----------------------------------------
+WARNING WARNING WARNING
+----------------------------------------
+
+It has been detected that are are using ISAM format on some of your
+mysql database tables. This format has been deprecated and no longer
+supported. to prevent these databases from essentially disappearing,
+an attempt at format conversion will now be made. please check after
+your upgrade that all tables are present and accounted for.
+
+apologies for the noise, but we thought you'd appreciate it :)
+
+----------------------------------------
+WARNING WARNING WARNING
+----------------------------------------
+EOF
+ cvt_setup_stuff
+ ($cvt_mysqld >$cvt_log 2>&1; touch $mytmp/mysql.done ) &
+
+ if cvt_wait_for_server; then
+ dbs=`cvt_get_databases`
+ for db in $dbs; do
+ tables=`cvt_get_tables $db`
+ for tbl in $tables; do
+ cvt_convert_table $db $tbl
+ done
+ done
+ else
+ cvt_error="yes"
+ fi
+
+ echo shutting down server... >&2
+ $cvt_mysqladmin shutdown
+ cvt_wait_for_exit
+ echo "all done!" >&2
+ if [ ! "$cvt_error" = "yes" ]; then
+ cvt_cleanup
+ else
+ echo "you might want to look in $mytmp..." >&2
+ fi
+
+ set -e
+ fi
+fi
+
+exit 0
diff --git a/debian/mysql-server.preinst.in b/debian/mysql-server.preinst.in
new file mode 100644
index 00000000000..7440c476f55
--- /dev/null
+++ b/debian/mysql-server.preinst.in
@@ -0,0 +1,191 @@
+#!/bin/bash -e
+#
+# summary of how this script can be called:
+# * <new-preinst> install
+# * <new-preinst> install <old-version>
+# * <new-preinst> upgrade <old-version>
+# * <old-preinst> abort-upgrade <new-version>
+#
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
+
+# Try to stop the server in a sane way. If it does not success let the admin
+# do it himself. No database directories should be removed while the server
+# is running! Another mysqld in e.g. a different chroot is fine for us.
+stop_server() {
+ if [ ! -x /etc/init.d/mysql ]; then return; fi
+
+ set +e
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ cmd="invoke-rc.d mysql stop"
+ else
+ cmd="/etc/init.d/mysql stop"
+ fi
+ $cmd
+ errno=$?
+ set -e
+
+ # 0=ok, 100=no init script (fresh install)
+ if [ "$errno" != 0 -a "$errno" != 100 ]; then
+ echo "${cmd/ */} returned $errno" 1>&2
+ echo "There is a MySQL server running, but we failed in our attempts to stop it." 1>&2
+ echo "Stop it yourself and try again!" 1>&2
+ exit 1
+ fi
+}
+
+##### here's a bunch of helper functions for converting database formats ######
+
+cvt_get_param(){
+ /usr/sbin/mysqld --print-defaults \
+ | tr " " "\n" \
+ | grep -- "--$1" \
+ | tail -n 1 \
+ | cut -d= -f2
+}
+
+cvt_setup_stuff(){
+ mytmp=`mktemp -d -t mysql-ISAM-convert.XXXXXX`
+ cvt_log="$mytmp/conversion.log"
+ if [ ! -d "$mytmp" ]; then
+ echo "can't create temporary directory, oh well." >&2
+ exit 1
+ fi
+
+ chgrp mysql $mytmp
+ chmod g+rwx $mytmp
+ cvt_socket=${mytmp}/mysql.sock
+
+ cvt_mysqld="mysqld --skip-grant-tables --skip-networking --socket $cvt_socket"
+ cvt_mysql="mysql --socket $cvt_socket"
+ cvt_mysqladmin="mysqladmin --socket $cvt_socket"
+}
+
+cvt_get_databases(){
+ echo fetching database list ... >&2
+ $cvt_mysql -e 'show databases' | sed -n -e '2,$p'
+}
+
+cvt_get_tables(){
+ echo querying tables in $1 ... >&2
+ $cvt_mysql $1 -e 'show table status' | sed -n -e '2,$p' | \
+ cut -f 1,2 | grep -w 'ISAM$' | cut -f 1
+}
+
+cvt_convert_table(){
+ echo converting $1.$2 ... >&2
+ $cvt_mysql $1 -e "alter table $2 type=MyISAM"
+}
+
+cvt_wait_for_server(){
+ local count
+ echo -n waiting for server startup.. >&2
+ while ! $cvt_mysql </dev/null >/dev/null 2>&1; do
+ echo -n . >&2
+ sleep 1
+ count=".$count"
+ if [ -f $mytmp/mysql.done ]; then
+ echo "sorry... looks like the server crashed :(" >&2
+ return 1
+ elif [ "$count" = "...................." ]; then
+ echo "sorry... looks like the server didn't start :(" >&2
+ return 1
+ fi
+ done
+ echo ok. >&2
+}
+
+cvt_wait_for_exit(){
+ local count
+ echo -n waiting for server shutdown.. >&2
+ while [ ! -f $mytmp/mysql.done ]; do
+ echo -n . >&2
+ sleep 1
+ count=".$count"
+ if [ "$count" = "...................." ]; then
+ echo "hrm... guess it never started?" >&2
+ return 0
+ fi
+ done
+ echo ok. >&2
+}
+
+cvt_cleanup(){
+ local mysql_kids
+ rm -rf $mytmp
+ # kill any mysqld child processes left over. there *shouldn't* be any,
+ # but let's not take chances with that
+ mysql_kids=`ps o 'pid command' --ppid $$ | grep -E '^[[:digit:]]+ mysqld ' | cut -d' ' -f1`
+ if [ "$mysql_kids" ]; then
+ echo "strange, some mysql processes left around. killing them now." >&2
+ kill $mysql_kids
+ sleep 10
+ mysql_kids=`ps o 'pid command' --ppid $$ | grep -E '^[[:digit:]]+ mysqld ' | cut -d' ' -f1`
+ if [ "$mysql_kids" ]; then
+ echo "okay, they're really not getting the hint..." >&2
+ kill -9 $mysql_kids
+ fi
+ fi
+}
+
+################################ main() ##########################
+
+# to be sure
+stop_server
+
+# test if upgrading from non conffile state
+if [ "$1" = "upgrade" ] && [ -x /usr/sbin/mysqld ]; then
+ cvt_datadir=`cvt_get_param datadir`
+ # test for ISAM tables, which we must convert NOW
+ if [ -n "`find $cvt_datadir -name '*.ISM' 2>/dev/null`" ]; then
+ set +e
+ cat << EOF >&2
+----------------------------------------
+WARNING WARNING WARNING
+----------------------------------------
+
+It has been detected that are are using ISAM format on some of your
+mysql database tables. This format has been deprecated and no longer
+supported. to prevent these databases from essentially disappearing,
+an attempt at format conversion will now be made. please check after
+your upgrade that all tables are present and accounted for.
+
+apologies for the noise, but we thought you'd appreciate it :)
+
+----------------------------------------
+WARNING WARNING WARNING
+----------------------------------------
+EOF
+ cvt_setup_stuff
+ ($cvt_mysqld >$cvt_log 2>&1; touch $mytmp/mysql.done ) &
+
+ if cvt_wait_for_server; then
+ dbs=`cvt_get_databases`
+ for db in $dbs; do
+ tables=`cvt_get_tables $db`
+ for tbl in $tables; do
+ cvt_convert_table $db $tbl
+ done
+ done
+ else
+ cvt_error="yes"
+ fi
+
+ echo shutting down server... >&2
+ $cvt_mysqladmin shutdown
+ cvt_wait_for_exit
+ echo "all done!" >&2
+ if [ ! "$cvt_error" = "yes" ]; then
+ cvt_cleanup
+ else
+ echo "you might want to look in $mytmp..." >&2
+ fi
+
+ set -e
+ fi
+fi
+
+exit 0
diff --git a/debian/mysql-storage-BASE.dirs.in b/debian/mysql-storage-BASE.dirs.in
new file mode 100644
index 00000000000..236670a2d0f
--- /dev/null
+++ b/debian/mysql-storage-BASE.dirs.in
@@ -0,0 +1 @@
+usr/sbin
diff --git a/debian/mysql-storage-BASE.files.in b/debian/mysql-storage-BASE.files.in
new file mode 100644
index 00000000000..126c17cb802
--- /dev/null
+++ b/debian/mysql-storage-BASE.files.in
@@ -0,0 +1 @@
+usr/sbin/ndbd
diff --git a/debian/mysql-storage-BASE.mysql-storage.init.in b/debian/mysql-storage-BASE.mysql-storage.init.in
new file mode 100644
index 00000000000..32ec82c6244
--- /dev/null
+++ b/debian/mysql-storage-BASE.mysql-storage.init.in
@@ -0,0 +1,85 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides: mysql-ndb
+# Required-Start: $syslog mysql mysql-ndb-mgm
+# Required-Stop: $syslog mysql mysql-ndb-mgm
+# Should-Start: $local_fs $remote_fs $network $named $time
+# Should-Stop: $local_fs $remote_fs $network $named $time
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start and stop the mysql database cluster server daemon
+# Description: Controls the MySQL NDB Data Node daemon "ndbd".
+### END INIT INFO
+#
+set -e
+set -u
+${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
+
+# Variables
+SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
+DAEMON=/usr/sbin/ndbd
+CONF=/etc/mysql/my.cnf
+export HOME=/etc/mysql/
+
+# Safeguard (relative paths, core dumps..)
+cd /
+umask 077
+
+# Exit *silently* if we're not supposed to be started.
+#
+# The Debian scripts should execute these scripts to stop and start
+# the daemon when upgrading if it is started. On the other hand it should
+# remain silently if the server has not even been configured.
+# See /usr/share/doc/mysql-server-*/README.Debian for more information.
+test -x $DAEMON || exit 0
+if $DAEMON --help | grep -q '^ndb-connectstring.*No default value'; then exit 0; fi
+. /lib/lsb/init-functions
+
+#
+# main()
+#
+case "${1:-''}" in
+ 'start')
+ # Start daemon
+ # Creatign a PID file does not work as the master process forks
+ # a child with different PID and then terminates itself.
+ log_daemon_msg "Starting MySQL NDB Data Node" "ndbd"
+ if start-stop-daemon \
+ --start \
+ --exec $DAEMON \
+ --user mysql
+ then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ log_warning_msg "Please take a look at the syslog."
+ exit 1
+ fi
+ ;;
+
+ 'stop')
+ log_daemon_msg "Stopping MySQL NDB Data Node" "ndbd"
+ if start-stop-daemon \
+ --stop \
+ --oknodo \
+ --exec $DAEMON
+ then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ exit 1
+ fi
+ ;;
+
+ 'restart'|'force-reload')
+ set +e; $SELF stop; set -e
+ $SELF start
+ ;;
+
+ *)
+ echo "Usage: $SELF start|stop|restart|force-reload"
+ exit 1
+ ;;
+esac
+
diff --git a/debian/mysql-test-BASE.dirs.in b/debian/mysql-test-BASE.dirs.in
new file mode 100644
index 00000000000..b1eee9d9a12
--- /dev/null
+++ b/debian/mysql-test-BASE.dirs.in
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/mysql/mysql-test
diff --git a/debian/mysql-test-BASE.files.in b/debian/mysql-test-BASE.files.in
new file mode 100644
index 00000000000..7f99c28ca5e
--- /dev/null
+++ b/debian/mysql-test-BASE.files.in
@@ -0,0 +1,6 @@
+usr/share/mysql-test/*
+usr/bin/mysql_client_test
+usr/bin/mysqltestmanager
+usr/bin/mysqltestmanager-pwgen
+usr/bin/mysqltestmanagerc
+
diff --git a/debian/mysql-tools-BASE.dirs.in b/debian/mysql-tools-BASE.dirs.in
new file mode 100644
index 00000000000..00b2ed2562d
--- /dev/null
+++ b/debian/mysql-tools-BASE.dirs.in
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/mysql
diff --git a/debian/mysql-tools-BASE.files.in b/debian/mysql-tools-BASE.files.in
new file mode 100644
index 00000000000..d2f37a570be
--- /dev/null
+++ b/debian/mysql-tools-BASE.files.in
@@ -0,0 +1,13 @@
+usr/bin/ndb_mgm
+usr/bin/ndb_restore
+usr/bin/ndb_waiter
+usr/bin/ndb_select_all
+usr/bin/ndb_select_count
+usr/bin/ndb_desc
+usr/bin/ndb_show_tables
+usr/bin/ndb_test_platform
+usr/bin/ndb_config
+usr/bin/ndb_error_reporter
+usr/bin/ndb_size
+
+
diff --git a/debian/po/POTFILES.in.in b/debian/po/POTFILES.in.in
new file mode 100644
index 00000000000..01e1e87fc55
--- /dev/null
+++ b/debian/po/POTFILES.in.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] mysql-server-@MYSQL_BRANDED_BASE_VERSION@.templates
diff --git a/debian/po/ca.po b/debian/po/ca.po
new file mode 100644
index 00000000000..9dc1fc0de77
--- /dev/null
+++ b/debian/po/ca.po
@@ -0,0 +1,290 @@
+# mysql-dfsg (debconf) translation to Catalan.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Aleix Badia i Bosch <abadia@ica.es> 2004
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-4.1\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2004-01-31 19:20GMT\n"
+"Last-Translator: Aleix Badia i Bosch <abadia@ica.es>\n"
+"Language-Team: Debian L10n Catalan <debian-l10n-catalan@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "Nota important pels usuaris de NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+#, fuzzy
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"Per utilitzar la base de dades de MySQL heu d'afegir un usuari i grup "
+"equivalent al següent i assegurar-vos que el directori /var/lib/mysql tingui "
+"els permisos correctes."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "Voleu que el MySQL s'iniciï a l'arrencada ?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+#, fuzzy
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"El MySQL es pot executar a l'arrencada o només si executeu manualment '/etc/"
+"init.d/mysql start'. Seleccioneu 'sí' si voleu que s'inicialitzi "
+"automàticament."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"If you do not provide a password no changes will be made to the account."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
+
+#, fuzzy
+#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
+#~ msgstr ""
+#~ "Feu una ullada al document: http://www.mysql.com/doc/en/Upgrade.html"
+
+#, fuzzy
+#~ msgid ""
+#~ "MySQL will only install if you have a non-numeric hostname that is "
+#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
+#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
+#~ "myhostname\"."
+#~ msgstr ""
+#~ "El MySQL només s'instal·la en cas de tenir un nom d'ordinador central que "
+#~ "no sigui numèric i que es pugui resoldre a través del fitxer /etc/hosts. "
+#~ "Ex. si l'ordre \"hostname\" retorna \"myhostname\", llavors hi ha d'haver "
+#~ "una línia com la següent \"10.0.0.1 myhostname\"."
+
+#, fuzzy
+#~ msgid ""
+#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
+#~ "is used in the start/stop and cron scripts. Don't delete."
+#~ msgstr ""
+#~ "Es crea un nou usuari de mysql \"debian-sys-maint\". S'utilitza per les "
+#~ "seqüències d'inicialització i aturada del cron, no el suprimiu."
+
+#, fuzzy
+#~ msgid ""
+#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
+#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
+#~ "there, never only the password!"
+#~ msgstr ""
+#~ "Recordeu posar una contrasenya al superusuari del MySQL. Si utilitzeu un "
+#~ "fitxer /root/.my.cnf, escriviu sempre allà les línies \"user\" i "
+#~ "\"password\".; mai només la contrasenya. Per a més informació feu una "
+#~ "ullada a /usr/share/doc/mysql-server/README.Debian."
+
+#, fuzzy
+#~ msgid ""
+#~ "Should I remove all databases below /var/lib/mysql as you are purging the "
+#~ "mysql-server package?"
+#~ msgstr ""
+#~ "Voleu suprimir totes les bases de dades en purgar el paquet mysql-server ?"
+
+#~ msgid ""
+#~ "Networking is disabled by default for security reasons. You can enable it "
+#~ "by commenting out the skip-networking option in /etc/mysql/my.cnf."
+#~ msgstr ""
+#~ "La xarxa està inhabilitada per defecte per a raons de seguretat. La podeu "
+#~ "habilitar descomentant l'opció de skip-networking del fitxer /etc/mysql/"
+#~ "my.cnf."
+
+#~ msgid "security and update notice"
+#~ msgstr "Avís de seguretat i actualització"
+
+#~ msgid "Please run mysql_fix_privilege_tables !"
+#~ msgstr "Executeu mysql_fix_privilege_tables"
+
+#~ msgid ""
+#~ "I will ensure secure permissions of /var/lib/mysql by replacing GIDs "
+#~ "other than root and mysql with mysql."
+#~ msgstr ""
+#~ "S'asseguren els permisos de seguretat de /var/lib/mysql canviant a mysql "
+#~ "tots els GIDs diferents a root i mysql."
+
+#~ msgid ""
+#~ "Instructions how to enable SSL support are in /usr/share/doc/mysql-server/"
+#~ msgstr ""
+#~ "Per habilitar el suport de SSL podeu seguir les instruccions de /usr/"
+#~ "share/doc/mysql-server/"
+
+#~ msgid "mysql_fix_privileges_tables will be executed"
+#~ msgstr "s'executa mysql_fix_privileges_tables"
+
+#~ msgid ""
+#~ "The latest MySQL versions have an enhanced, more fine grained, privilege "
+#~ "system. To make use of it, some new fields must be added to the tables "
+#~ "in the \"mysql\" database. This is done by the "
+#~ "mysql_fix_privilege_tables script during this upgrade regardless of if "
+#~ "the server is currently running or not!"
+#~ msgstr ""
+#~ "Les últimes versions de MySQL tenen un sistema de privilegis més "
+#~ "elaborat. Per utilitzar-lo cal afegir nous camps a les taules de la base "
+#~ "de dades \"mysql\". Aquesta tasca la realitza la seqüència "
+#~ "mysql_fix_privilege_tables durant l'actualització independentment de si "
+#~ "el servidor s'està executant o no!"
+
+#~ msgid ""
+#~ "This script is not supposed to give any user more rights that he had "
+#~ "before, if you encounter such a case, please contact me."
+#~ msgstr ""
+#~ "Aquesta seqüència no assigna privilegis d'usuari diferents als que ja "
+#~ "tenia, en cas que us trobéssiu en aquesta situació, poseu-vos en contacte "
+#~ "amb mi."
+
+#~ msgid ""
+#~ "Should I remove everything below /var/lib/mysql when you purge the mysql-"
+#~ "server package with the \"dpkg --purge mysql-server\" command (i.e. "
+#~ "remove everything including the configuration) somewhen? (default is not)"
+#~ msgstr ""
+#~ "Voleu suprimir tots els continguts de /var/lib/mysql quan es purgui el "
+#~ "paquet mysql-server amb l'ordre \"dpkg --purge mysql-server\". (ex. "
+#~ "suprimir-ho tot inclòs la configuració) ? (per defecte no)"
+
+#~ msgid "Make MySQL reachable via network?"
+#~ msgstr "Voleu fer accessible el MySQL via xarxa ?"
+
+#~ msgid ""
+#~ "Should MySQL listen on a network reachable TCP port? This is not "
+#~ "necessary for use on a single computer and could be a security problem."
+#~ msgstr ""
+#~ "Voleu que el MySQL escolti a un port TCP accessible des de la xarxa ? "
+#~ "Aquesta opció no és imprescindible en ordinadors aïllats i podria "
+#~ "provocar un problema de seguretat."
+
+#~ msgid "Enable chroot mode?"
+#~ msgstr "Permetre el mode chroot ?"
+
+#~ msgid ""
+#~ "MySQL is able to jail itself into the /var/lib/mysql_jail directory so "
+#~ "that users cannot modify any files outside this directory. This improves "
+#~ "resistence against crackers, too, as they are not able to modify system "
+#~ "files."
+#~ msgstr ""
+#~ "El MySQL es pot executar en una entorn tancat al directori /var/lib/"
+#~ "mysql_jail perquè els usuaris no puguin modificar cap fitxer fora del "
+#~ "directori.Aquesta opció també augmenta la seguretat envers els crackers, "
+#~ "jaque no poden modificar els fitxers del sistema."
diff --git a/debian/po/cs.po b/debian/po/cs.po
new file mode 100644
index 00000000000..33e4f213bb2
--- /dev/null
+++ b/debian/po/cs.po
@@ -0,0 +1,259 @@
+#
+# Translators, if you are not familiar with the PO format, gettext
+# documentation is worth reading, especially sections dedicated to
+# this format, e.g. by running:
+# info -n '(gettext)PO Files'
+# info -n '(gettext)Header Entry'
+#
+# Some information specific to po-debconf are available at
+# /usr/share/doc/po-debconf/README-trans
+# or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+# Developers do not need to manually edit POT or PO files.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.0\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2007-02-18 12:49+0100\n"
+"Last-Translator: Miroslav Kure <kurem@debian.cz>\n"
+"Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "Opravdu chcete degradovat?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+"VAROVÃNÃ: Existuje soubor /var/lib/mysql/debian-*.flag, což znamená, že již "
+"byl instalován balíÄek mysql-server s vyšší verzí. Nemůžeme zaruÄit, zda "
+"tato verze umí použít data z novÄ›jšího balíÄku."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "Důležitá poznámka pro uživatele NIS/YP!"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"Abyste mohli mysql používat, musíte do následujících souborů přidat "
+"ekvivalentního uživatele a skupinu a zajistit, že /var/lib/mysql má správná "
+"práva (uid/gid se mohou lišit)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "Odstranit databáze používané všemi verzemi MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+"Skript se chystá odstranit datový adresář /var/lib/mysql. Jestliže pouze "
+"plánujete nainstalovat novější verzi MySQL, nebo pokud tato data souběžně "
+"využívá jiný balík mysql-server, měli byste data ponechat."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "Má se MySQL spustit při startu systému?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"MySQL se může spouÅ¡tÄ›t automaticky pÅ™i startu systému, nebo ruÄnÄ› příkazem '/"
+"etc/init.d/mysql start'."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "Nové heslo MySQL uživatele \"root\":"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr "Nastavit heslo u správcovského úÄtu \"root\" je silnÄ› doporuÄeno."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"If you do not provide a password no changes will be made to the account."
+msgstr "Nezadáte-li heslo, žádné zmÄ›ny se s úÄtem neprovedou."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr "Nelze nastavit heslo MySQL uživatele \"root\""
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+"Během nastavování hesla pro správcovského uživatele MySQL se vyskytla chyba. "
+"To se mohlo stát třeba proto, protože uživatel již měl neslo nastaveno, nebo "
+"protože nastal problém v komunikaci s MySQL serverem."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+"Po skonÄení instalace byste mÄ›li ověřit, že je úÄet chránÄ›n heslem (více "
+"informací naleznete v souboru README.Debian)."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr ""
+"Podporovat MySQL pÅ™ipojení z poÄítaÄů používajících Debian Sarge nebo starší?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
+"Způsob, jakým se dříve ukládala hesla, nebyl příliÅ¡ bezpeÄný. To se nyní "
+"změnilo, ale nevýhodou je, že se klienti z Debianu 3.1 Sarge nebudou moci "
+"pÅ™ipojit na nové úÄty, nebo na úÄty, u nichž se zmÄ›nilo heslo. Podrobnosti "
+"viz /usr/share/doc/mysql-server-5.0/README.Debian."
+
+#~ msgid "Cannot upgrade if ISAM tables are present!"
+#~ msgstr "Aktualizace nelze provést pokud jsou přítomny tabulky ISAM!"
+
+#~ msgid ""
+#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
+#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
+#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
+#~ "The installation of mysql-server-5.0 will now abort. In case your old "
+#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
+#~ "those tables."
+#~ msgstr ""
+#~ "Poslední verze MySQL již nemohou používat starý formát tabulek ISAM a "
+#~ "před aktualizací je nutné převést tyto tabulky např. do formátu MyISAM "
+#~ "pomocí \"mysql_convert_table_format\" nebo \"ALTER TABLE x ENGINE=MyISAM"
+#~ "\". Instalace mysql-server-5.0 se nyní přeruší. V případě, že se mezitím "
+#~ "odinstaloval původní mysql-server-4.1, jednoduše jej znovu nainstalujte a "
+#~ "tabulky pÅ™eveÄte."
+
+#~ msgid "Update Hints"
+#~ msgstr "Poznámky k aktualizaci"
+
+#~ msgid ""
+#~ "You have to run \"mysql_upgrade\" after the upgrade, else tables can be "
+#~ "corrupted! This script also enhances the privilege tables but is not "
+#~ "supposed to give any user more rights that he had before,"
+#~ msgstr ""
+#~ "Po aktualizaci ještě musíte spustit \"mysql_upgrade\", protože jinak by "
+#~ "se tabulky mohly narušit! Tento skript také rozšiřuje tabulky privilegií, "
+#~ "ovšem neměl by uživatelům přidat více práv, než měli dosud."
+
+#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
+#~ msgstr "Také si pÅ™eÄtÄ›te http://www.mysql.com/doc/en/Upgrade.html"
+
+#~ msgid ""
+#~ "MySQL will only install if you have a non-numeric hostname that is "
+#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
+#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
+#~ "myhostname\"."
+#~ msgstr ""
+#~ "MySQL se nainstaluje pouze v případě, že používáte nenumerické jméno "
+#~ "poÄítaÄe, které se dá pÅ™eložit pÅ™es soubor /etc/hosts. NapÅ™. když příkaz "
+#~ "\"hostname\" vrátí \"diamond\", tak v /etc/hosts musí existovat obdobný "
+#~ "řádek jako \"10.0.0.1 diamond\"."
+
+#~ msgid ""
+#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
+#~ "is used in the start/stop and cron scripts. Don't delete."
+#~ msgstr ""
+#~ "Bude vytvoÅ™en nový mysql uživatel \"debian-sys-maint\". Tento mysql úÄet "
+#~ "se používá ve startovacích, ukonÄovacích a cronových skriptech. Nemažte "
+#~ "jej."
+
+#~ msgid ""
+#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
+#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
+#~ "there, never only the password!"
+#~ msgstr ""
+#~ "Nezapomeňte nastavit heslo pro úÄet administrátora MySQL! Používáte-li /"
+#~ "root/.my.cnf, vždy zde zadejte jak řádek \"user\", tak řádek \"password"
+#~ "\". Nikdy zde nezadávejte jenom heslo!"
+
+#~ msgid ""
+#~ "See /usr/share/doc/mysql-server-5.0/README.Debian for more information."
+#~ msgstr ""
+#~ "Více informací naleznete v /usr/share/doc/mysql-server-5.0/README.Debian."
+
+#~ msgid ""
+#~ "Should I remove the complete /var/lib/mysql directory tree which is used "
+#~ "by all MySQL versions, not necessarily only the one you are about to "
+#~ "purge?"
+#~ msgstr ""
+#~ "Mám odstranit kompletní adresářový strom /var/lib/mysql, který se používá "
+#~ "pro všechny verze MySQL, tedy ne nutně pouze pro verzi, kterou se "
+#~ "chystáte vyÄistit?"
diff --git a/debian/po/da.po b/debian/po/da.po
new file mode 100644
index 00000000000..5e93e3f7b33
--- /dev/null
+++ b/debian/po/da.po
@@ -0,0 +1,283 @@
+#
+# Translators, if you are not familiar with the PO format, gettext
+# documentation is worth reading, especially sections dedicated to
+# this format, e.g. by running:
+# info -n '(gettext)PO Files'
+# info -n '(gettext)Header Entry'
+# Some information specific to po-debconf are available at
+# /usr/share/doc/po-debconf/README-trans
+# or http://www.debian.org/intl/l10n/po-debconf/README-trans#
+# Developers do not need to manually edit POT or PO files.
+#
+# Claus Hindsgaul <claus_h@image.dk>, 2005, 2006.
+# Claus Hindsgaul <claus.hindsgaul@gmail.com>, 2006, 2007.
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-4.1\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2007-02-18 10:42+0100\n"
+"Last-Translator: Claus Hindsgaul <claus.hindsgaul@gmail.com>\n"
+"Language-Team: Danish\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "Ønsker du virkelig at nedgradere?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+"Advarsel: Filen /var/lib/mysql/debian-*.flag eksisterer. Det tyder på at der "
+"tidligere har været installeret en højere version af mysql-server-pakken. "
+"Det kan ikke garanteres at denne version kan benytte data fra den højere "
+"version."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "Vigtig bemærkning for NIS/YP-brugere!"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"For at kunne bruge mysql skal du installere en bruger og en gruppe, der "
+"svarer til nedenstående, og sikre dig at /var/lib/mysql har de rigtige "
+"adgangsrettigheder (uid/gid kan afvige)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr "etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "Fjern de databaser, der benyttes af samtlige MySQL-versioner?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+"Scriptet skal til at fjerne datamappen /var/lib/mysql. Hvis du regner "
+"medblot at installere en højere MySQL-version, eller hvis der allerede kører "
+"en anden MySQL-serverpakke, bør dataene bevares."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "Skal MySQL startes under systemopstart?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"MySQL kan enten startes op under systemopstarten eller kun hvis du manuelt "
+"skriver '/etc/init.d/mysql start'."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "Ny adgangskode for MySQL's \"root\"-bruger:"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+"Det anbefales kraftigt, at du sætter en adgangskode for MySQL's "
+"administrationsbruger \"root\"."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "If you do not provide a password no changes will be made to the account."
+msgstr "Hvis du ikke angiver en adgangskode, vil kontoen ikke blive ændret."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr "Kunne ikke sætte adgangskoden for MySQL's \"root\"-bruger"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+"Det lader til, at der opstod en fejl, da adgangskoden for MySQL's "
+"administrationsbruger skulle ændres. Dette kan være sket, fordi brugeren "
+"allerede har en adgangskode, eller fordi der var problemer med at "
+"kommunikere med MySQL-serveren."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+"Når installationen afsluttes, bør du tjekke at kontoen er ordentligt "
+"beskyttet med en adgangskode (se README.Debian for yderligere oplysninger)."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr "Understøt MySQL-forbindelser fra maskiner, der kører Debian \"Sarge\" eller ældre?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
+"Den måde, adgangskoder blev gemt på tidligere, var ikke ret sikker. Dette er "
+"blevet forbedret med den bivirkning, at klienter (f.eks. PHP) fra maskiner, "
+"der kører Debian 3.1 Sarge ikke vil kunne forbindes til en konto, der er ny, "
+"eller hvis adgangskode er blevet ændret. Se /usr/share/doc/mysql-server-5.0/"
+"README.Debian."
+
+#~ msgid "Cannot upgrade if ISAM tables are present!"
+#~ msgstr "Kan ikke opgradere hvis der er ISAM-tabeller!"
+
+#~ msgid ""
+#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
+#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
+#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
+#~ "The installation of mysql-server-5.0 will now abort. In case your old "
+#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
+#~ "those tables."
+#~ msgstr ""
+#~ "Nyere versioner af MySQL kan ikke længere benytte det gamle ISAM-"
+#~ "tabelformat, og det er derfor nødvendigt at konvertere dine tabeller til "
+#~ "f.eks. MyISAM forud for opgraderingen med \"mysql_convert_table_format\" "
+#~ "eller \"ALTER TABLE x ENGINE=MyISAM\". Installationen af mysql-server-5.0 "
+#~ "afbrydes nu. Skulle din gamle mysql-server-4.1 alligevel bliver "
+#~ "afinstalleret, så geninstallér den blot og konverter tabellerne."
+
+#~ msgid "Update Hints"
+#~ msgstr "Opdateringstips"
+
+#~ msgid ""
+#~ "You have to run \"mysql_upgrade\" after the upgrade, else tables can be "
+#~ "corrupted! This script also enhances the privilege tables but is not "
+#~ "supposed to give any user more rights that he had before,"
+#~ msgstr ""
+#~ "Du skal køre \"mysql_upgrade\" efter opgraderingen, da tabellerne eller "
+#~ "kan blive ødelagt! Dette script forbedrer også rettighedstabellerne, men "
+#~ "burde ikke give nogen bruger flere rettigheder, end han havde tidligere,"
+
+#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
+#~ msgstr "Læs også http://www.mysql.com/doc/en/Upgrade.html"
+
+#~ msgid "Install Hints"
+#~ msgstr "Installationstips"
+
+#~ msgid ""
+#~ "On upgrades from MySQL 3.23, as shipped with Debian Woody, symlinks in "
+#~ "place of /var/lib/mysql or /var/log/mysql gets accidently removed and "
+#~ "have manually be restored."
+#~ msgstr ""
+#~ "Ved opgraderinger fra MySQL 3.23, der fulgte med Debian Woody, kan de "
+#~ "symbolske /var/lib/mysql or /var/log/mysql blive fjernet ved et uheld, og "
+#~ "må genskabes manuelt."
+
+#~ msgid ""
+#~ "MySQL will only install if you have a non-numeric hostname that is "
+#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
+#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
+#~ "myhostname\"."
+#~ msgstr ""
+#~ "MySQL vil kun blive installeret, hvis du har et ikke-numerisk værtsnavn, "
+#~ "som kan slås op i filen /ets/hosts. Hvis f.eks. kommandoen \"hostname\" "
+#~ "svarer med \"mitvaertsnavn\", skal du have en linje a'la \"10.0.0.1 "
+#~ "mitvaertsnavn\" i /etc/hosts."
+
+#~ msgid ""
+#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
+#~ "is used in the start/stop and cron scripts. Don't delete."
+#~ msgstr ""
+#~ "Det vil blive oprettet en ny mysql-bruger, \"debian-sys-maint\". Denne "
+#~ "mysql-konto bruges i start/stop-cron-scripterne. Slet den ikke."
+
+#~ msgid ""
+#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
+#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
+#~ "there, never only the password!"
+#~ msgstr ""
+#~ "Husk at sætte en ADGANGSKODE for MySQLs root-bruger! Hvis du bruger en /"
+#~ "etc/.my.cnf, så skriv altid \"user\"- og \"password\"-linjer ind her, "
+#~ "ikke kun adgangskoden!"
+
+#~ msgid ""
+#~ "See /usr/share/doc/mysql-server-5.0/README.Debian for more information."
+#~ msgstr ""
+#~ "Se /usr/share/doc/mysql-server-5.0/README.Debian for yderligere "
+#~ "oplysninger."
+
+#~ msgid ""
+#~ "Should I remove the complete /var/lib/mysql directory tree which is used "
+#~ "by all MySQL versions, not necessarily only the one you are about to "
+#~ "purge?"
+#~ msgstr ""
+#~ "Skal jeg fjerne hele mappetræet /var/lib/mysql, som benyttes af alle "
+#~ "MySQL-versioner, ikke kun den version, du er ved at slette?"
+
+#~ msgid ""
+#~ "Rarely, e.g. on new major versions, the privilege system is improved. To "
+#~ "make use of it mysql_fix_privilege_tables must be executed manually. The "
+#~ "script is not supposed to give any user more rights that he had before,"
+#~ msgstr ""
+#~ "En sjælden gang imellem, f.eks. ved nye hovedversioner, sker det at "
+#~ "rettighedssystemet forbedres. For at gøre brug af dette, skal "
+#~ "mysql_fix_privilege_tables køres manuelt. Scriptet vil ikke give nogen "
+#~ "bruger flere rettigheder, end vedkommende havde tidligere,"
+
diff --git a/debian/po/de.po b/debian/po/de.po
new file mode 100644
index 00000000000..60c9a984622
--- /dev/null
+++ b/debian/po/de.po
@@ -0,0 +1,195 @@
+# translation of mysql-dfsg-5.0_5.0.32-6_de.po to german
+#
+# Translators, if you are not familiar with the PO format, gettext
+# documentation is worth reading, especially sections dedicated to
+# this format, e.g. by running:
+# info -n '(gettext)PO Files'
+# info -n '(gettext)Header Entry'
+# Some information specific to po-debconf are available at
+# /usr/share/doc/po-debconf/README-trans
+# or http://www.debian.org/intl/l10n/po-debconf/README-trans#
+# Developers do not need to manually edit POT or PO files.
+#
+# Alwin Meschede <ameschede@gmx.de>, 2006, 2007.
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.0_5.0.32-6_de\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2007-02-19 12:23+0100\n"
+"Last-Translator: Alwin Meschede <ameschede@gmx.de>\n"
+"Language-Team: german <debian-l10n-german@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "Möchten Sie wirklich eine ältere Version einspielen?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+"WARNUNG: Die Datei /var/lib/mysql/debian-*.flag existiert. Dies zeigt an, "
+"dass früher ein MySQL-Server-Paket mit einer höheren Version installiert "
+"worden war. Es kann nicht garantiert werden, dass diese Version dessen Daten "
+"benutzen kann."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "Wichtige Anmerkung für NIS/YP-Benutzer!"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"Um MySQL benutzen zu können, müssen Sie einen zum folgenden Eintrag "
+"äquivalenten Benutzer und Gruppe einrichten, und sich vergewissern, dass /"
+"var/lib/mysql die richtigen Rechte hat (die UID/GID dürfen sich "
+"unterscheiden)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "Die von allen MySQL-Versionen benutzten Datenbanken entfernen?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+"Dieses Skript wird das Daten-Verzeichnis /var/lib/mysql entfernen. Falls "
+"geplant ist, nur eine höhere Version von MySQL zu installieren oder ein "
+"anderes mysql-server-Paket dieses bereits benutzt, sollten die Daten "
+"behalten werden."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "Soll MySQL automatisch beim Booten starten?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"Der MySQL-Dienst kann entweder beim Systemstart oder nur nach der Eingabe "
+"von /etc/init.d/mysql start gestartet werden."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "Neues Passwort für den MySQL »root«-Benutzer:"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+"Es wird nachdrücklich empfohlen für den administrativen MySQL »root«-Benutzer "
+"ein Passwort zu setzen."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "If you do not provide a password no changes will be made to the account."
+msgstr ""
+"Falls Sie kein Passwort angeben, werden keine Änderungen am Konto "
+"vorgenommen."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr "Konnte für den MySQL-»root«-Benutzer kein Passwort setzen"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+"Es scheint, dass beim Passwort setzen für den administrativen MySQL-Benutzer "
+"ein Fehler aufgetreten ist. Dies könnte daran liegen, dass der Benutzer "
+"bereits ein Passwort hat oder dass es ein Problem mit der Kommunikation mit "
+"dem MySQL-Server gibt."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+"Nach Ende der Installation sollten Sie überprüfen, ob das Konto angemessen "
+"mit einem Passwort geschützt ist (lesen Sie README.Debian für weitere "
+"Informationen)."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr ""
+"Sollen MySQL-Verbindungen von Rechnern mit Debian »Sarge« oder älter "
+"unterstützt werden?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
+"Die Art, wie Passwörter bislang gespeichert wurden, war nicht sehr sicher. "
+"Dies wurde verbessert, allerdings werden Clients (z. B. PHP) von Hosts mit "
+"Debian 3.1 Sarge sich nicht mehr mit MySQL-Konten verbinden können, die neu "
+"angelegt werden oder deren Passwort geändert wird. Siehe auch /usr/share/doc/"
+"mysql-server-5.0/README.Debian."
+
diff --git a/debian/po/es.po b/debian/po/es.po
new file mode 100644
index 00000000000..ddbb77d9607
--- /dev/null
+++ b/debian/po/es.po
@@ -0,0 +1,288 @@
+# mysql-dfsg-5 translation to spanish
+# Copyright (C) 2005 Software in the Public Interest, SPI Inc.
+# This file is distributed under the same license as the XXXX package.
+#
+# Changes:
+# - Initial translation
+# Jesus Aneiros , 2006
+# - Updated
+# Javier Fernandez-Sanguino, 2006
+# - Revision
+# Nacho Barrientos Arias
+# Fernando Cerezal
+# David Martínez Moreno
+# Ricardo Mones
+# Carlos Galisteo
+# Javier Fernandez-Sanguino
+#
+#
+# Traductores, si no conoce el formato PO, merece la pena leer la
+# documentación de gettext, especialmente las secciones dedicadas a este
+# formato, por ejemplo ejecutando:
+# info -n '(gettext)PO Files'
+# info -n '(gettext)Header Entry'
+#
+# Equipo de traducción al español, por favor lean antes de traducir
+# los siguientes documentos:
+#
+# - El proyecto de traducción de Debian al español
+# http://www.debian.org/intl/spanish/
+# especialmente las notas y normas de traducción en
+# http://www.debian.org/intl/spanish/notas
+#
+# - La guía de traducción de po's de debconf:
+# /usr/share/doc/po-debconf/README-trans
+# o http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+# Si tiene dudas o consultas sobre esta traducción consulte con el último
+# traductor (campo Last-Translator) y ponga en copia a la lista de
+# traducción de Debian al español (<debian-l10n-spanish@lists.debian.org>)
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.0_5.0.24-3\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2007-02-18 12:20+0100\n"
+"Last-Translator: Javier Fernández-Sanguino <jfs@debian.org>\n"
+"Language-Team: Debian l10 Spanish <debian-l10n-spanish@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "¿Desea realmente instalar una versión anterior?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+"ATENCIÓN: El archivo /var/lib/mysql/debian-*.flag existe. Esto indica que ya "
+"se instaló una versión superior del paquete mysql-server. No se puede "
+"garantizar que esta versión pueda usar sus datos."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "¡Nota importante para los usuarios de NIS/YP!"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"Para utilizar mysql debe instalar un usuario y grupo equivalente al "
+"siguiente y asegurarse de que /var/lib/mysql tiene los permisos correctos "
+"(los valores del «uid» y del «gid» pueden ser diferentes)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr ""
+"¿Eliminar las bases de datos utilizadas por todas las versiones de MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+"Este guión va a eliminar el directorio de datos «/var/lib/mysql». Debería "
+"mantener los datos si tiene planificado instalar una versión de MySQL "
+"superior o ya hay un paquete «mysql-server» que los está utilizando."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "¿Debería ejecutarse MySQL al iniciarse el sistema?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"MySQL puede iniciarse en el momento de arranque del sistema o solamente si "
+"se escribe «/etc/init.d/mysql start»."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "Nueva cContraseña para el usuario «root» de MySQL:"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+"Se recomienda que configure una contraseña para el usuario "
+"«root» (administrador) de MySQL."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"If you do not provide a password no changes will be made to the account."
+msgstr "No se hará ningún cambio en la cuenta si no introduce una contraseña."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr "No se pudo fijar la contraseña para el usuario «root» de MySQL"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+"Parece que se produjo un error mientras intentaba fijar la contraseña para "
+"el usuario administrador de MySQL. Esto puede haber sucedido porque el "
+"usuario ya tenía una contraseña o porque se produjo un error de comunicación "
+"con el servidor MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+"Debería confirmar que la contraseña está correctamente protegida con una "
+"contraseña cuando termine la instalación (consulte el fichero README.Debian "
+"si desea más información)."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr "¿Soportar las conexiones MySQL establecidadas desde sistemas que ejecutan Debian Sarge o versiones anteriores?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
+"No era muy segura la forma en la que se almacenaban las contraseñas antes. "
+"Este problema se ha mejorado con el inconveniente, sin embargo, de que "
+"clientes (por ejemplo, PHP) que ejecutan Debian 3.1 «Sarge» no podrán "
+"conectarse a cuentas que son nuevas o a las que se le haya cambiado la "
+"contraseña. Para más información consulte «/usr/share/doc/mysql-server-5.0/"
+"README.Debian»."
+
+#~ msgid "Install Hints"
+#~ msgstr "Sugerencias para la instalación"
+
+#~ msgid ""
+#~ "On upgrades from MySQL 3.23, as shipped with Debian Woody, symlinks in "
+#~ "place of /var/lib/mysql or /var/log/mysql gets accidently removed and "
+#~ "have manually be restored."
+#~ msgstr ""
+#~ "Al actualizar a la versión de MySQL 3.23, la vrsión proporcionada en "
+#~ "Debian Woody, se eliminan de manera accidental, los enlaces simbólicos a "
+#~ "«/var/lib/mysql» o «/var/log/mysql» y tienen que restaurarse manualmente."
+
+#~ msgid ""
+#~ "MySQL will only install if you have a non-numeric hostname that is "
+#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
+#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
+#~ "myhostname\"."
+#~ msgstr ""
+#~ "Sólo se instalará MySQL si tiene un nombre de equipo que no sea una "
+#~ "dirección IP y pueda resolverse a través del archivo /etc/hosts. Por "
+#~ "ejemplo, si la orden «hostname» devuelve «MiNombreEquipo» entonces deberá "
+#~ "existir una línea «10.0.0.1 MiNombreEquipo» en dicho archivo."
+
+#~ msgid ""
+#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
+#~ "is used in the start/stop and cron scripts. Don't delete."
+#~ msgstr ""
+#~ "Se creará un nuevo usuario «debian-sys-maint». Esta cuenta de mysql se "
+#~ "utilizará en los scripts de inicio y parada y en los scripts «cron». No "
+#~ "la elimine."
+
+#~ msgid ""
+#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
+#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
+#~ "there, never only the password!"
+#~ msgstr ""
+#~ "¡Por favor, recuerde crear una CONTRASEÑA para el usuario «root» de "
+#~ "MySQL! ¡Si utiliza /root/.my.cnf debe escribir las líneas «user» y "
+#~ "«password» en dicho archivo, no incluya sólo la contraseña!"
+
+#~ msgid ""
+#~ "See /usr/share/doc/mysql-server-5.0/README.Debian for more information."
+#~ msgstr ""
+#~ "Revise /usr/share/doc/mysql-server-5.0/README.Debian para más información."
+
+#~ msgid ""
+#~ "Should I remove the complete /var/lib/mysql directory tree which is used "
+#~ "by all MySQL versions, not necessarily only the one you are about to "
+#~ "purge?"
+#~ msgstr ""
+#~ "¿Debería eliminar el árbol de directorio /var/lib/mysql completo? Tenga "
+#~ "en cuenta que lo utilizan todas las versiones de MySQL y no sólo la que "
+#~ "está a punto de purgar."
+
+#~ msgid "Cannot upgrade if ISAM tables are present!"
+#~ msgstr "¡No se puede actualizar si ya hay tablas ISAM!"
+
+#~ msgid ""
+#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
+#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
+#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
+#~ "The installation of mysql-server-5.0 will now abort. In case your old "
+#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
+#~ "those tables."
+#~ msgstr ""
+#~ "Las versiones recientes de MySQL ya no soportan el antiguo formato de "
+#~ "tabla ISAM. Antes de realizar la actualización es necesario convertir sus "
+#~ "tablas a por ejemplo, MyISAM, usando «mysql_convert_table_format» o "
+#~ "«ALTER TABLE x ENGINE=MyISAM». Se va a interrumpir ahora la instalación "
+#~ "de mysql-server-5.0. Si aún así su mysql-server-4.1 se elimina aún así, "
+#~ "puede reinstalarlo para convertir ese tipo de tablas."
diff --git a/debian/po/eu.po b/debian/po/eu.po
new file mode 100644
index 00000000000..ce50519e8be
--- /dev/null
+++ b/debian/po/eu.po
@@ -0,0 +1,163 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Piarres BEobide <pi@beobide.net>, 2006.
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.0_5.0.26-3-debconf_eu\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2007-02-19 09:33+0100\n"
+"Last-Translator: Piarres Beobide <pi@beobide.net>\n"
+"Language-Team: Euskara <Librezale@librezale.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Pootle 0.10.1\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "Benetan bertsio zaharragora itzuli nahi duzu?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr "Oharra: /var/lib/mysql/debian-*.flag dago.. Honek aurretik bertsio berriagoko mysql-zerbitzari bat instalatu dela adierazten du. Ezin da ziurtatu bertsio honek datu horiek erabili ahal izango dituenik."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "NIS/YP erabiltzaileentzat ohar garrantzitsua!"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"Mysql erabili ahal izateko beharrezko erabiltzaile eta taldea sortu eta /var/"
+"lib/mysql-ek beharrezko baimenak dituela ziurtatu behar duzu (uid/gid-a "
+"ezberdina izan daiteke)"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "MySQL bertsio guztiek erabilitako databaseak ezabatu?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr "Script-a /var/lib/mysql data direktorioa ezabatzera doa. MySQL bertsio berriago bat instalatu behar bada edo beste mysql-server pakete bat berau erabiltzen ari bada, datuak mantendu egingo dira."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "Sistema abiaraztean MySQL abiarazi behar al da?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr "MySQL abiaraztean automatikoki abiarazi daiteke edo eskuz /etc/init.d/mysql start' eginaz."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "MySQL \"root\" erabiltzailearen pasahitz berria:"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+"Oso gomendagarria da MySQL administratzaile \"root\" erabiltzaileari "
+"pasahitz bat ezartzea."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"If you do not provide a password no changes will be made to the account."
+msgstr "Ez baduzu pasahitzik ezartzen ez da aldaketarik egingo kontuan."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr "Ezinda MySQL \"root\" erabiltzailearen pasahitza ezarri"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr "Dirudienez errore bat gertatu da MySQL administratzaile kontuaren pasahitza ezartzean. Hau erabiltzaileak dagoeneko pasahitz bat duelako edo MySQL zerbitzariarekiko konexioan erroreak daudelako gertatu daiteke."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+"Instalazio amaitzean, kontua pasahitzez babesturik dagoela ziurtatu beharko "
+"zenuke (README.Debian irakurri xehetasun gehiagotarako)"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr "Debian \"sarge\" edo zaharragoak erabiltzen duten ostalarietatik MySQL konexioak onartu?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr "Pasahitzak biltegiratzeko modua ez da oso ziurra. Hau hobetua izan da baina Debian 3.1 Sarge erabiltzaileak ezingo dira kontu berri edo pasahitza aldatu duten kontuetara konektatu. Begiratu /usr/share/doc/mysql-server-5.0/README.Debian argibide gehiagorako."
diff --git a/debian/po/fr.po b/debian/po/fr.po
new file mode 100644
index 00000000000..51196a0cba8
--- /dev/null
+++ b/debian/po/fr.po
@@ -0,0 +1,204 @@
+# translation of fr.po to French
+# Translators, if you are not familiar with the PO format, gettext
+# documentation is worth reading, especially sections dedicated to
+# this format, e.g. by running:
+# info -n '(gettext)PO Files'
+# info -n '(gettext)Header Entry'
+#
+# Some information specific to po-debconf are available at
+# /usr/share/doc/po-debconf/README-trans
+# or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+# Developers do not need to manually edit POT or PO files.
+#
+# Christian Perrier <bubulle@debian.org>, 2004, 2006.
+msgid ""
+msgstr ""
+"Project-Id-Version: fr\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2006-11-23 20:47+0100\n"
+"Last-Translator: Christian Perrier <bubulle@debian.org>\n"
+"Language-Team: French <debian-l10n-french@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+"debian.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms: Plural-Forms: nplurals=2; plural=n>1;\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "Faut-il vraiment revenir à la version précédente ?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+"Un fichier /var/lib/mysql/debian-*.flag est présent. Cela indique qu'une "
+"version plus récente du paquet mysql-server a été précédemment installée. Il "
+"n'est pas garanti que cette version puisse en utiliser les données."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "Note importante pour les utilisateurs NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"Pour utiliser MySQL, vous devez créer un utilisateur et un groupe similaires "
+"à ce qui suit et vérifier que /var/lib/mysql possède les permissions "
+"appropriées (les identifiants numériques de groupe et d'utilisateur, uid et "
+"gid, peuvent être différents)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr ""
+"/etc/passwd : mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group : mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql : drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "Supprimer les bases de données de toutes les versions de MySQL ?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+"Les données du répertoire /var/lib/mysql seront supprimées. Si vous prévoyez "
+"d'installer une version plus récente de MySQL ou si un autre paquet mysql-"
+"server les utilise déjà, vous devriez les conserver."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "Faut-il lancer MySQL au démarrage ?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"MySQL peut être lancé soit au démarrage, soit en entrant la commande « /etc/"
+"init.d/mysql start ». Choisissez cette option si vous voulez que MySQL soit "
+"lancé automatiquement."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "Mot de passe du superutilisateur de MySQL :"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+"Il est très fortement recommandé d'établir un mot de passe pour le compte "
+"d'administration de MySQL (« root »)."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"If you do not provide a password no changes will be made to the account."
+msgstr "Si ce champ est laissé vide, le mot de passe ne sera pas changé."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr ""
+"Impossible de changer le mot de passe de l'utilisateur « root » de MySQL"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+"Une erreur semble s'être produite lors du changement de mot de passe du "
+"compte d'administration. Un mot de passe existait peut-être déjà ou il n'a "
+"pas été possible de communiquer avec le serveur MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+"À la fin de l'installation, veuillez vérifier que le compte possède bien un "
+"mot de passe (veuillez consulter le fichier README.Debian pour plus "
+"d'informations)."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr ""
+"Gérer les connexions d'hôtes qui utilisent les versions Debian « sarge » ou antérieures  ?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
+"La méthode de stockage des mots de passe n'était pas très sûre dans les "
+"version précédentes de ce paquet. Cette méthode a été améliorée mais les "
+"modifications empêchent la connexion avec de nouveaux comptes ou des comptes "
+"dont le mot de passe a été modifié, pour les clients (p. ex. PHP) depuis des "
+"hôtes qui utilisent Debian 3.1 « sarge ». Veuillez consulter le fichier /usr/"
+"share/doc/mysql-server-5.0/README.Debian pour plus d'informations."
+
+#~ msgid "internal"
+#~ msgstr "interne"
+
+#~ msgid "Only internally used."
+#~ msgstr ""
+#~ "message utilisé en interne uniquement et que cet andouille de mainteneur "
+#~ "a marqué comme traduisible"
diff --git a/debian/po/gl.po b/debian/po/gl.po
new file mode 100644
index 00000000000..44fd58872cc
--- /dev/null
+++ b/debian/po/gl.po
@@ -0,0 +1,279 @@
+# Galician translation of mysql-dfsg-5.0's debconf templates
+# This file is distributed under the same license as the mysql-dfsg-5.0 package.
+# Jacobo Tarrio <jtarrio@debian.org>, 2006.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.0\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2007-02-18 15:42+0100\n"
+"Last-Translator: Jacobo Tarrio <jtarrio@debian.org>\n"
+"Language-Team: Galician <trasno@ceu.fi.udc.es>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "¿Quere pasar a unha versión anterior?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+"AVISO: O ficheiro /var/lib/mysql/debian-*.flag existe. Isto indica que se "
+"instalou antes un paquete mysql-server dunha versión maior. Non se pode "
+"garantir que esta versión poida empregar os seus datos."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "Nota importante para usuarios de NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"Para empregar mysql debe instalar un usuario e grupo equivalentes aos "
+"seguintes e asegurarse de que /var/lib/mysql teña os permisos correctos (o "
+"uid/gid poden ser diferentes)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr ""
+"/etc/passwd: mysql:x:100:101:Servidor MySQL:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "¿Eliminar as bases de datos empregadas por tódalas versións de MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+"O script vai eliminar o directorio de datos /var/lib/mysql. Se se planea "
+"instalar unha versión superior de MySQL ou se hai outro paquete mysql-server "
+"que o estean a empregar, debería conservar os datos."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "¿MySQL debería iniciarse co ordenador?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"MySQL pode arrincar automaticamente ao iniciar o ordenador ou só se escribe "
+"\"/etc/init.d/mysql start\" a man."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "Novo contrasinal para o usuario \"root\" de MySQL"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+"Recoméndase encarecidamente que estabreza un contrasinal para o usuario "
+"administrativo \"root\" de MySQL."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"If you do not provide a password no changes will be made to the account."
+msgstr "Se non fornece un contrasinal non se ha facer ningún cambio na conta."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr "Non se puido establecer o contrasinal para o usuario \"root\" de MySQL"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+"Semella que houbo un erro ao establecer o contrasinal para o usuario "
+"administrativo de MySQL. Puido ocorrer porque o usuario xa teña un "
+"contrasinal ou porque teña habido un problema ao se comunicar co servidor "
+"MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+"Ao rematar a instalación debería comprobar que a conta estea correctamente "
+"protexida cun contrsinal (consulte o ficheiro README.Debian para ter máis "
+"información)."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr ""
+"¿Soportar as conexións a MySQL de máquinas que empreguen Debian \"sarge\" ou "
+"anterior?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
+"O xeito no que se armacenaban os contrasinais non era moi seguro. Isto "
+"mellorouse co inconveniente de que os clientes (por exemplo, PHP) das "
+"máquinas que executen Debian 3.1 Sarge non se han poder conectar a contas "
+"novas ou nas que se cambiara o contrasinal. Consulte /usr/share/doc/mysql-"
+"server-5.0/README.Debian."
+
+#~ msgid "Cannot upgrade if ISAM tables are present!"
+#~ msgstr "Non se pode actualizar se hai táboas ISAM presentes"
+
+#~ msgid ""
+#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
+#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
+#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
+#~ "The installation of mysql-server-5.0 will now abort. In case your old "
+#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
+#~ "those tables."
+#~ msgstr ""
+#~ "As versións recentes de MySQL xa non poden empregar o antigo formato de "
+#~ "táboas ISAM e é necesario converter as táboas a, por exemplo, MyISAM "
+#~ "antes de actualizar, empregando \"mysql_convert_table_format\" ou \"ALTER "
+#~ "TABLE x ENGINE=MyISAM\". A instalación de mysql-server-5.0 hase abortar "
+#~ "agora. Se o seu antigo mysql-server-4.1 se elimina volva instalalo para "
+#~ "converter esas táboas."
+
+#~ msgid "Update Hints"
+#~ msgstr "Consellos de actualización"
+
+#~ msgid ""
+#~ "You have to run \"mysql_upgrade\" after the upgrade, else tables can be "
+#~ "corrupted! This script also enhances the privilege tables but is not "
+#~ "supposed to give any user more rights that he had before,"
+#~ msgstr ""
+#~ "Ten que executar \"mysql_upgrade\" trala actualización; se non o fai, as "
+#~ "táboas poden quedar corrompidas. Este script tamén mellora as táboas de "
+#~ "privilexios, pero non se supón que vaia dar a ningún usuario máis "
+#~ "dereitos dos que tiña antes."
+
+#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
+#~ msgstr "Lea tamén http://www.mysql.com/doc/en/Upgrade.html"
+
+#~ msgid "Install Hints"
+#~ msgstr "Consellos de instalación"
+
+#~ msgid ""
+#~ "On upgrades from MySQL 3.23, as shipped with Debian Woody, symlinks in "
+#~ "place of /var/lib/mysql or /var/log/mysql gets accidently removed and "
+#~ "have manually be restored."
+#~ msgstr ""
+#~ "Nas actualizacións desde MySQL 3.23, tal como se fornecía con Debian "
+#~ "Woody, as ligazóns simbólicas no lugar de /var/lib/mysql ou /var/log/"
+#~ "mysql quedan eliminadas por accidente e hai que as restaurar a man."
+
+#~ msgid ""
+#~ "MySQL will only install if you have a non-numeric hostname that is "
+#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
+#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
+#~ "myhostname\"."
+#~ msgstr ""
+#~ "MySQL só se ha instalar se ten un nome de máquina non numérico que se "
+#~ "poida resolver polo ficheiro /etc/hosts. Por exemplo, se a orde \"hostname"
+#~ "\" devolve \"omeuordenador\" ten que haber unha liña coma \"10.0.0.1 "
+#~ "omeuordenador\"."
+
+#~ msgid ""
+#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
+#~ "is used in the start/stop and cron scripts. Don't delete."
+#~ msgstr ""
+#~ "Hase crear un novo usuario de mysql, \"debian-sys-maint\". Esta conta de "
+#~ "mysql emprégase nos scripts de inicio/parada e de cron. Non o borre."
+
+#~ msgid ""
+#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
+#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
+#~ "there, never only the password!"
+#~ msgstr ""
+#~ "Lembre estabrecer sempre un contrasinal para o usuario administrador de "
+#~ "MySQL. Se emprega un ficheiro /root/.my.cnf escriba sempre nel as liñas "
+#~ "\"user\" e \"password\", nunca o contrasinal só."
+
+#~ msgid ""
+#~ "See /usr/share/doc/mysql-server-5.0/README.Debian for more information."
+#~ msgstr ""
+#~ "Consulte /usr/share/doc/mysql-server-5.0/README.Debian para máis "
+#~ "información."
+
+#~ msgid ""
+#~ "Should I remove the complete /var/lib/mysql directory tree which is used "
+#~ "by all MySQL versions, not necessarily only the one you are about to "
+#~ "purge?"
+#~ msgstr ""
+#~ "¿Débese eliminar a árbore completa de directorios de /var/lib/mysql que "
+#~ "se emprega en tódalas versións de MySQL, non só necesariamente na que vai "
+#~ "eliminar?"
+
+#~ msgid ""
+#~ "Rarely, e.g. on new major versions, the privilege system is improved. To "
+#~ "make use of it mysql_fix_privilege_tables must be executed manually. The "
+#~ "script is not supposed to give any user more rights that he had before,"
+#~ msgstr ""
+#~ "Moi de cando en vez, por exemplo nos cambios grandes de versión, "
+#~ "mellórase o sistema de privilexios. Para poder empregalo hai que executar "
+#~ "manualmente mysql_fix_privilege_tables. Suponse que o script non vai dar "
+#~ "a ningún usuario máis dereitos dos que xa tiña antes."
diff --git a/debian/po/it.po b/debian/po/it.po
new file mode 100644
index 00000000000..9a8741c5e90
--- /dev/null
+++ b/debian/po/it.po
@@ -0,0 +1,184 @@
+# Italian (it) translation of debconf templates for mysql-dfsg-5.0
+# Copyright (C) 2006 Software in the Public Interest
+# This file is distributed under the same license as the mysql-dfsg-5.0 package.
+# Luca Monducci <luca.mo@tiscali.it>, 2006, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.0 5.0.32-6 italian debconf templates\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2007-02-18 15:09+0100\n"
+"Last-Translator: Luca Monducci <luca.mo@tiscali.it>\n"
+"Language-Team: Italian <tp@lists.linux.it>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "Si vuole realmente degradare?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+"ATTENZIONE: Esiste un file /var/lib/mysql/debian-*.flag. Questo indica che "
+"precedenza è stata installata una versione più recente del pacchetto mysql-"
+"server. Non si garantisce che la versione che si sta installando possa usare "
+"i dati."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "Nota per gli utenti NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"Per usare mysql si deve installare un utente e un gruppo equivalenti ai "
+"seguenti e assicurarsi di avere su /var/lib/mysql i permessi corretti (uid e "
+"gid possono anche essere diversi)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "Eliminare i database usati da tutte le versioni di MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+"Lo script sta per eliminare la directory con i dati /var/lib/mysql. Se ciò "
+"che si intende fare è un semplice aggiornamento a una nuova versione di "
+"MySQL oppure se è in uso un'altra di versione del pacchetto mysql-server, i "
+"dati non devono essere eliminati."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "Far partire MySQL all'avvio del sistema?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"MySQL può partire automaticamente all'avvio del sistema oppure solo "
+"manualmente con il comando «/etc/init.d/mysql start»."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "Nuova password per l'utente «root» di MySQL:"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+"Si raccomanda d'impostare una password per l'utente d'amministrazione "
+"(«root») di MySQL."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"If you do not provide a password no changes will be made to the account."
+msgstr ""
+"Se non si fornisce la password non saranno fatte modifiche all'account."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr "Impossible impostare la password per l'utente «root» di MySQL"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+"Pare che si sia verificato un errore durante l'impostazione della password "
+"per l'utente d'amministrazione di MySQL. Questo può essere dovuto al fatto "
+"che la password è già impostata oppure a un problema di comunicazione con il "
+"server MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+"Al termine dell'installazione si deve verificare che l'account root sia "
+"correttamente protetto da una password (si veda README.Debian per maggiori "
+"informazioni)."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr ""
+"Supportare connessioni MySQL da macchine con Debian \"sarge\" o precedente?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
+"La modalità con la quale erano memorizzate le password in passato non era "
+"molto sicura; è stata migliorata con lo svantaggio che i client (per esempio "
+"PHP) presenti su una macchina con Debian 3.1 Sarge non saranno in grado di "
+"connettersi a un nuovo account oppure a un account la cui password sia stata "
+"cambiata. Si veda /usr/share/doc/mysql-server-5.0/README.Debian."
diff --git a/debian/po/ja.po b/debian/po/ja.po
new file mode 100644
index 00000000000..14d97ed977b
--- /dev/null
+++ b/debian/po/ja.po
@@ -0,0 +1,278 @@
+#
+# Translators, if you are not familiar with the PO format, gettext
+# documentation is worth reading, especially sections dedicated to
+# this format, e.g. by running:
+# info -n '(gettext)PO Files'
+# info -n '(gettext)Header Entry'
+#
+# Some information specific to po-debconf are available at
+# /usr/share/doc/po-debconf/README-trans
+# or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+# Developers do not need to manually edit POT or PO files.
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.0 5.0.32-6\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2007-02-18 22:25+0900\n"
+"Last-Translator: Hideki Yamane (Debian-JP) <henrich@debian.or.jp>\n"
+"Language-Team: Japanese <debian-japanese@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "本当ã«ãƒ€ã‚¦ãƒ³ã‚°ãƒ¬ãƒ¼ãƒ‰ã—ã¾ã™ã‹?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+"警告: /var/lib/mysql/debian-*.flag ファイルãŒå­˜åœ¨ã—ã¦ã„ã¾ã™ã€‚ã“ã‚Œã¯ã€ä»¥å‰ã«ã‚ˆ"
+"ã‚Šæ–°ã—ã„ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® mysql-server パッケージãŒã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¦ã„ãŸã“ã¨ã‚’示"
+"ã—ã¾ã™ã€‚データをã“ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã§ä½¿ãˆã‚‹ã‹ã©ã†ã‹ã€ä¿è¨¼ã§ãã¾ã›ã‚“。"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "NIS/YP ユーザã¸é‡è¦ãªæ³¨æ„!"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"mysql を利用ã™ã‚‹ã«ã¯ 以下ã®ãƒ¦ãƒ¼ã‚¶ã¨ã‚°ãƒ«ãƒ¼ãƒ—を作æˆã—ã€/var/lib/mysql ãŒæ­£ã—ã„"
+"権é™ã«ãªã£ã¦ã„ã‚‹ã‹ã©ã†ã‹ã‚’確èªã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ (ãŠãらã uid/gid ãŒé•ã„ã¾"
+"ã™)。"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "å…¨ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® MySQL ã§åˆ©ç”¨ã•ã‚Œã¦ã„るデータベースを削除ã—ã¾ã™ã‹?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+"ã“ã®ã‚¹ã‚¯ãƒªãƒ—トã¯ãƒ‡ãƒ¼ã‚¿ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª /var/lib/mysql を削除ã™ã‚‹ãŸã‚ã®ã‚‚ã®ã§"
+"ã™ã€‚å˜ã«æ–°ã—ã„ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® MySQL をインストールã—よã†ã¨ã—ã¦ã„ã‚‹ã€ã‚ã‚‹ã„ã¯åˆ¥"
+"ã® mysql-server パッケージを既ã«ä½¿ã£ã¦ã„ã‚‹å ´åˆã€ãƒ‡ãƒ¼ã‚¿ã¯ä¿æŒã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾"
+"ã™ã€‚"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "MySQL をシステム起動時ã«é–‹å§‹ã—ã¾ã™ã‹?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"MySQL ã®èµ·å‹•æ–¹æ³•ã«ã¤ã„ã¦ã€ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•æ™‚ã«è‡ªå‹•çš„ã«é–‹å§‹ã™ã‚‹ã‹ã€ã‚ã‚‹ã„㯠'/etc/"
+"init.d/mysql start' ã¨æ‰‹ã§å…¥åŠ›ã—ãŸæ™‚ã®ã¿èµ·å‹•ã™ã‚‹ã‹ã‚’é¸ã¹ã¾ã™ã€‚"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "MySQL ã® \"root\" ユーザã«å¯¾ã™ã‚‹æ–°ã—ã„パスワード:"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+"MySQL を管ç†ã™ã‚‹ \"root\" ユーザã®ãƒ‘スワードを設定ã™ã‚‹ã“ã¨ã‚’å¼·ããŠå‹§ã‚ã—ã¾"
+"ã™ã€‚"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"If you do not provide a password no changes will be made to the account."
+msgstr "パスワードを入力ã—ãªã„å ´åˆã€ã‚¢ã‚«ã‚¦ãƒ³ãƒˆã«å¯¾ã—ã¦å¤‰æ›´ã¯åŠ ãˆã‚‰ã‚Œã¾ã›ã‚“。"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr "MySQL ã® \"root\" ユーザã®ãƒ‘スワードを設定ã§ãã¾ã›ã‚“"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+"MySQL ã®ç®¡ç†è€…ユーザã«å¯¾ã—ã¦ãƒ‘スワードを設定ã—よã†ã¨ã—ãŸéš›ã€ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ãŸ"
+"よã†ã§ã™ã€‚ã“ã‚Œã¯æ—¢ã«ç®¡ç†è€…ユーザã«ãƒ‘スワードãŒè¨­å®šã•ã‚Œã¦ã„ãŸã‹ã€MySQL サーãƒ"
+"ã¨ã®æŽ¥ç¶šã«å•é¡ŒãŒã‚ã£ãŸãŸã‚ã ã¨æ€ã‚ã‚Œã¾ã™ã€‚"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+"インストールãŒçµ‚了ã—ãŸéš›ã€ã‚¢ã‚«ã‚¦ãƒ³ãƒˆãŒãƒ‘スワードã§ãã¡ã‚“ã¨ä¿è­·ã•ã‚Œã¦ã„ã‚‹ã‹ã©"
+"ã†ã‹ã‚’確èªã—ã¦ãã ã•ã„ (詳細ã«ã¤ã„ã¦ã¯ README.Debian ã‚’å‚ç…§ã—ã¦ãã ã•ã„)。"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr ""
+"Debian \"Sarge\" ã‚ã‚‹ã„ã¯ãれよりもå¤ã„ãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒç¨¼åƒã—ã¦ã„るホストã‹ã‚‰ã® "
+"MySQL 接続をサãƒãƒ¼ãƒˆã—ã¾ã™ã‹?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
+"パスワードã®ä¿å­˜æ–¹æ³•ã¯ã€ã‚ã¾ã‚Šå®‰å…¨ãªæ–¹æ³•ã§è¡Œã‚ã‚Œã¦ã„ã¾ã›ã‚“ã§ã—ãŸã€‚ã“ã‚Œã¯æ”¹å–„"
+"ã•ã‚Œã¾ã—ãŸãŒã€Debian 3.1 Sarge ãŒç¨¼åƒã—ã¦ã„るホストã‹ã‚‰ã‚¯ãƒ©ã‚¤ã‚¢ãƒ³ãƒˆ (PHP ãª"
+"ã©) ãŒæ–°ã—ã„アカウントやパスワードãŒå¤‰æ›´ã•ã‚ŒãŸã‚¢ã‚«ã‚¦ãƒ³ãƒˆã«ã¯æŽ¥ç¶šã§ããªããªã‚‹"
+"ã¨ã„ã†æ¬ ç‚¹ã‚‚ã§ã¦ã„ã¾ã™ã€‚詳細ã«ã¤ã„ã¦ã¯ /usr/share/doc/mysql-server-5.0/"
+"README.Debian ã‚’å‚ç…§ã—ã¦ãã ã•ã„。"
+
+#~ msgid "Cannot upgrade if ISAM tables are present!"
+#~ msgstr "ISAM テーブルãŒã‚ã‚‹å ´åˆã¯ã‚¢ãƒƒãƒ—グレードã§ãã¾ã›ã‚“!"
+
+#~ msgid ""
+#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
+#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
+#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
+#~ "The installation of mysql-server-5.0 will now abort. In case your old "
+#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
+#~ "those tables."
+#~ msgstr ""
+#~ "MySQL ã®æœ€è¿‘ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã§ã¯ä»¥å‰ã® ISAM テーブル形å¼ã¯åˆ©ç”¨ã§ããªããªã£ã¦ã„"
+#~ "ã¾ã™ã€‚ãã®ãŸã‚ã€ä¾‹ãˆã° \"mysql_convert_table_format\" ã‚ã‚‹ã„㯠\"ALTER "
+#~ "TABLE x ENGINE=MyISAM\" ã¨ã—ã¦ã‚¢ãƒƒãƒ—グレードå‰ã« MyISAM ã«ã‚³ãƒ³ãƒãƒ¼ãƒˆã™ã‚‹ã“"
+#~ "ã¨ãªã©ãŒå¿…è¦ã§ã™ã€‚mysql-server-5.0 ã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã‚’中断ã—ã¾ã™ã€‚以å‰ã® "
+#~ "mysql-server-4.1 ãŒå‰Šé™¤ã•ã‚Œã¦ã—ã¾ã£ãŸå ´åˆã§ã‚ã£ã¦ã‚‚ã€ãƒ†ãƒ¼ãƒ–ルをコンãƒãƒ¼ãƒˆ"
+#~ "ã™ã‚‹ãŸã‚ã«å†ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã‚’ã—ã¦ãã ã•ã„。"
+
+#~ msgid "Install Hints"
+#~ msgstr "インストールã®ãƒ’ント"
+
+#~ msgid ""
+#~ "On upgrades from MySQL 3.23, as shipped with Debian Woody, symlinks in "
+#~ "place of /var/lib/mysql or /var/log/mysql gets accidently removed and "
+#~ "have manually be restored."
+#~ msgstr ""
+#~ "Debian Woody ã§ãƒªãƒªãƒ¼ã‚¹ã•ã‚ŒãŸ MySQL 3.23 ã‹ã‚‰ã®ã‚¢ãƒƒãƒ—グレードã§ã¯ã€/var/"
+#~ "lib/mysql ã‚ã‚‹ã„㯠/var/log/mysql ã®ä»£ã‚ã‚Šã«ã‚·ãƒ³ãƒœãƒªãƒƒã‚¯ãƒªãƒ³ã‚¯ã¯å¶ç„¶ã«ã‚‚削"
+#~ "除ã•ã‚Œã¦ã—ã¾ã£ã¦ã„ã‚‹ã®ã§ã€æ‰‹å‹•ã§ã®ãƒªã‚¹ãƒˆã‚¢ãŒå¿…è¦ã«ãªã‚Šã¾ã™ã€‚"
+
+#~ msgid ""
+#~ "MySQL will only install if you have a non-numeric hostname that is "
+#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
+#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
+#~ "myhostname\"."
+#~ msgstr ""
+#~ "MySQL 㯠/etc/hosts ファイル経由ã§è§£æ±ºã§ãる「数字ã®ã¿ã§æ§‹æˆã•ã‚Œã¦ãªã„ã€ãƒ›"
+#~ "ストåã®å ´åˆã®ã¿ã€ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¾ã™ã€‚ã¤ã¾ã‚Šã€\"hostname\" コマンド㌠"
+#~ "\"myhostname\" ã‚’è¿”ã™ãªã‚‰ã€\"10.0.0.1 myhostname\" ã¨ã„ã†è¡ŒãŒ /etc/hosts "
+#~ "ファイルã«ã‚ã‚‹ã¯ãšã§ã™ã€‚"
+
+#~ msgid ""
+#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
+#~ "is used in the start/stop and cron scripts. Don't delete."
+#~ msgstr ""
+#~ "æ–°è¦ã« mysql ユーザã¨ã—㦠\"debian-sys-maint\" ãŒä½œæˆã•ã‚Œã¾ã™ã€‚ã“ã® mysql "
+#~ "アカウント㯠start/stop 時㨠cron スクリプトã§åˆ©ç”¨ã•ã‚Œã¾ã™ã€‚消ã•ãªã„ã§ãã "
+#~ "ã•ã„。"
+
+#~ msgid ""
+#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
+#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
+#~ "there, never only the password!"
+#~ msgstr ""
+#~ "MySQL ã® root ユーザã«å¯¾ã—ã¦ã€Œãƒ‘スワードã®è¨­å®šã€ã‚’忘れãªã„ã§ãã ã•ã„! /"
+#~ "root/.my.cnf を使ã£ã¦ã„ã‚‹å ´åˆã€ã“ã®ãƒ•ã‚¡ã‚¤ãƒ«ä¸­ã® \"user\" 行㨠\"password"
+#~ "\" 行を記述ã—ã¦ãã ã•ã„。決ã—ã¦ãƒ‘スワードã ã‘ã§ã¯ã„ã‘ã¾ã›ã‚“!"
+
+#~ msgid ""
+#~ "See /usr/share/doc/mysql-server-5.0/README.Debian for more information."
+#~ msgstr ""
+#~ "詳細㯠/usr/share/doc/mysql-server-5.0/README.Debian ã‚’å‚ç…§ã—ã¦ãã ã•ã„。"
+
+#~ msgid ""
+#~ "Should I remove the complete /var/lib/mysql directory tree which is used "
+#~ "by all MySQL versions, not necessarily only the one you are about to "
+#~ "purge?"
+#~ msgstr ""
+#~ "ã“ã‚Œã‹ã‚‰ purge ã—よã†ã¨ã—ã¦ã„ã‚‹ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã ã‘ã§ã¯ç„¡ãã€å…¨ã¦ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® "
+#~ "MySQL ㌠/var/lib/mysql ディレクトリを使用ã—ã¦ã„ã¾ã™ã€‚ã“ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’完"
+#~ "å…¨ã«å‰Šé™¤ã—ã¾ã™ã‹?"
+
+#~ msgid "Update Hints"
+#~ msgstr "æ›´æ–°ã®ãƒ’ント"
+
+#~ msgid ""
+#~ "Rarely, e.g. on new major versions, the privilege system is improved. To "
+#~ "make use of it mysql_fix_privilege_tables must be executed manually. The "
+#~ "script is not supposed to give any user more rights that he had before,"
+#~ msgstr ""
+#~ "ã¾ã‚Œã«ã€ã¤ã¾ã‚Šã¯æ–°ã—ã„メジャーãƒãƒ¼ã‚¸ãƒ§ãƒ³ã«ãŠã„ã¦ã€ç‰¹æ¨©ã‚·ã‚¹ãƒ†ãƒ ãŒæ”¹å–„ã•ã‚Œã¾"
+#~ "ã™ã€‚ã“れを行ã†ã«ã¯ã€mysql_fix_privilege_table を手動ã§å®Ÿè¡Œã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾"
+#~ "ã™ã€‚スクリプトã¯ã€ã©ã®ã‚ˆã†ãªãƒ¦ãƒ¼ã‚¶ã«å¯¾ã—ã¦ã‚‚ã€ä»¥å‰ã«ä¿æŒã—ã¦ã„ãŸä»¥ä¸Šã®æ¨©é™"
+#~ "を与ãˆã‚‹ã‚ˆã†ã«ã¯ãªã£ã¦ã„ã¾ã›ã‚“。"
+
+#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
+#~ msgstr "http://www.mysql.com/doc/ja/Upgrade.html ã‚‚å‚ç…§ã—ã¦ãã ã•ã„"
diff --git a/debian/po/nb.po b/debian/po/nb.po
new file mode 100644
index 00000000000..e7a58534863
--- /dev/null
+++ b/debian/po/nb.po
@@ -0,0 +1,179 @@
+# translation of mysql_nb.po to Norwegian Bokmål
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Bjørn Steensrud <bjornst@powertech.no>, 2007.
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql_nb\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2007-02-18 12:13+0100\n"
+"Last-Translator: Bjørn Steensrud <bjornst@powertech.no>\n"
+"Language-Team: Norwegian Bokmål <i18n-nb@lister.ping.uio.no>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.2\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "Er du sikker på at du vil nedgradere?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+"ADVARSEL: Fila /var/lib/mysql/debian-*.flag finnes. Dette viser at en "
+"mysql-server-pakke med et høyere versjonsnummer har vært installert før. "
+"Det kan ikke garanteres at denne versjonen kan bruke data fra den høyere versjonen."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "Viktig merknad for NIS/YP-brukere!"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"For å bruke MySQL må du installere en bruker og gruppe tilsvarende den "
+"nedenfor og se til at /var/lib/mysql har riktige rettigheter (uid/gid kan "
+"være forskjellig)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "Skal databasene brukt av alle MySQL-versjoner fjernes?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+"Dette skriptet skal til å fjerne data-mappa /var/lib/mysql. Denne mappa "
+"bør beholdes hvis det bare skal installeres en høyere MySQL-versjon, "
+"eller hvis en annen mysql-server-pakke allerede bruker den."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "Skal MySQL startes ved maskinoppstart?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"MySQL kan startes automatisk når maskinen starter, eller bare hvis du "
+"skriver «/etc/init.d/mysql start»."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "Nytt passord for MySQLs «root»-bruker:"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+"Det anbefales sterkt at du oppgir et passord for den administrative "
+"«root»-brukeren i MySQl."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "If you do not provide a password no changes will be made to the account."
+msgstr "Hvis du ikke oppgir et passord blir det ikke gjort noen endringer med kontoen."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr "Klarer ikke angi passord for MySQLs «root»-bruker"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+"Det ser ut til at det oppsto en feil mens det ble satt et passord for "
+"MySQLs administrative bruker. Dette kan være fordi brukeren allerede "
+"har et passord, eller fordi det var et kommunikasjonsproblem med "
+"MySQL-tjeneren."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+"Når installasjonen er ferdig bør det sjekkes at kontoen er ordentlig "
+"beskyttet med et passord (mer informasjon finnes i README.Debian)."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr ""
+"Skal MySQL-tilkoblinger støttes fra vertsmaskiner som kjører Debian «sarge» "
+"eller eldre?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
+"Passord ble tidligere lagret på en lite sikker måte. Dette er nå forbedret, "
+"med den ulempen at klienter (f.eks. PHP) fra verter som kjører Debian 3.1 Sarge "
+"ikke vil kunne koble til en konto som er ny eller har fått endret passordet. "
+"Se /usr/share/doc/mysql-server-5.0/README.Debian."
+
diff --git a/debian/po/nl.po b/debian/po/nl.po
new file mode 100644
index 00000000000..13b3e8c02b8
--- /dev/null
+++ b/debian/po/nl.po
@@ -0,0 +1,187 @@
+# Dutch mysql-dfsg-5.0 po-debconf translation,
+# Copyright (C) 2006 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the mysql-dfsg-5.0 package.
+# Vincent Zweije <zweije@xs4all.nl>, 2006.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.0 5.0.30-1\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2006-02-19 10:20+0100\n"
+"Last-Translator: Thijs Kinkhorst <thijs@debian.org>\n"
+"Language-Team: Debian-Dutch <debian-l10n-dutch@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "Wilt u echt een oude versie herstellen?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+"Waarschuwing: waarschijnlijk is een hogere versie van het mysql-server "
+"pakket geïnstalleerd geweest (het bestand /var/lib/mysql/debian-*.flag "
+"bestaat). Er is geen garantie dat de gegevensbestanden, bewerkt met die "
+"hogere versie, kunnen worden gebruikt met de versie van mysql die u nu "
+"installeert."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "Belangrijke opmerking voor gebruikers van NIS/YP!"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"Om mysql te gebruiken dient u een gebruiker en groep aan te maken, "
+"gelijkwaardig aan onderstaand voorbeeld, en u dient ervoor te zorgen dat /"
+"var/lib/mysql de bijbehorende toegangsrechten heeft (uid en gid mogen anders "
+"zijn)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "Databases verwijderen die door alle MySQL versies worden gebruikt?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+"Het script staat op het punt de datamap /var/lib/mysql te verwijderen. Als "
+"het plan alleen maar is om een hogere MySQL versie te installeren, of als "
+"een ander mysql-serverpakket de datamap al gebruikt, dan zou de data moeten "
+"worden behouden."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "Moet MySQL starten als de computer start?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"MySQL kan automatisch starten bij het starten van de computer, of slechts "
+"wanneer u '/etc/init.d/mysql start' handmatig uitvoert."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "Nieuw wachtwoord voor de MySQL \"root\"-gebruiker:"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+"Het wordt sterk aangeraden een wachtwoord in te stellen voor de "
+"administratieve MySQL \"root\"-gebruiker."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"If you do not provide a password no changes will be made to the account."
+msgstr ""
+"Indien u geen wachtwoord opgeeft zal het account niet worden gewijzigd."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr "Kan het wachtwoord voor de MySQL \"root\"-gebruiker niet instellen"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+"Er lijkt een fout te zijn opgetreden bij het instellen van het wachtwoord "
+"van de MySQL administratieve gebruiker. Dat kan komen doordat de gebruiker "
+"al een wachtwoord heeft, of omdat er een probleem was bij het communiceren "
+"met de MySQL server."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+"Wanneer de installatie klaar is, dient u te verifiëren dat het account "
+"netjes beschermd is met een wachtwoord (zie README.Debian voor meer "
+"informatie)."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr ""
+"Moet u MySQL-verbindingen accepteren van computers die Debian \"sarge\" "
+"of ouder draaien?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
+"De wijze waarop wachtwoorden werden bewaard was niet erg veilig. Dit is "
+"verbeterd, maar helaas zullen programma's van computers die Debian 3.1 Sarge "
+"draaien, geen verbinding meer kunnen maken met accounts die nieuw zijn, of "
+"waarvan het wachtwoord is gewijzigd. Zie /usr/share/doc/mysql-server-5.0/"
+"README.Debian."
diff --git a/debian/po/pt.po b/debian/po/pt.po
new file mode 100644
index 00000000000..cb330e1932b
--- /dev/null
+++ b/debian/po/pt.po
@@ -0,0 +1,198 @@
+# Portuguese translation for mysql-dfsg-5.0's debconf messages
+# Copyright (C) 2006 Miguel Figueiredo <elmig@debianpt.org>
+# This file is distributed under the same license as the mysql-dfsg-5.0 package.
+# Miguel Figueiredo <elmig@debianpt.org>
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.0\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2007-02-18 10:38+0000\n"
+"Last-Translator: Miguel Figueiredo <elmig@debianpt.org>\n"
+"Language-Team: Portuguese <traduz@debianpt.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "Deseja mesmo fazer downgrade?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+"AVISO: o ficheiro /var/lib/mysql/debian-*.flag existe. Isto significa que "
+"antes foi instalado um pacote mysql-server com número de versão superior. "
+"Não pode ser garantido que esta versão utilize esses dados."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "Nota importante para utilizadores de NIS/YP!"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"Para utilizar mysql e instalar um utilizador e grupo equivalentes para o "
+"seguinte e assegurar-se que /var/lib/mysql têm as permissões correctas (o "
+"uid/gid podem ser diferentes)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "Remover as bases de dados utilizadas por todas as versões de MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+"O script está prestes a remover o directório de dados /var/lib/mysql. Se o "
+"planeado é apenas instalar uma versão superior do MySQL ou se um pacote "
+"mysql-server diferente já os estão a utilizar, os dados devem ser mantidos."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "O MySQL deve iniciar no arranque?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"O MySQL pode iniciar automaticamente no arranque ou apenas se digitar '/etc/"
+"init.d/mysql start'."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "Nova password para o utilizador \"root\" do MySQL:"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+"É fortemente recomendado que defina uma password para o utilizador "
+"administrativo \"root\" do MySQL."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"If you do not provide a password no changes will be made to the account."
+msgstr ""
+"Se não disponibilizar uma password não serão feitas alterações nesta conta."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr ""
+"Não foi possível definir a password para o utilizador \"root\" do MySQL"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+"Parece que ocorreu um erro enquanto era definida a password para o "
+"utilizador administrativo do MySQL. Isto pode ter acontecido porque o "
+"utilizador já tem uma password, ou porque ocorreu um problema ao comunicar "
+"com o servidor MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+"Quando terminar a instalação, deve verificar se a conta está devidamente "
+"protegida com uma password (para mais informações veja README.Debian)."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr "Suportar ligações MySQL de máquinas que corram Debian \"sarge\" ou mais antigos?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
+"O modo como as passwords eram guardadas não era muito seguro. Isto foi "
+"melhorado com o senão que clientes (e.g. PHP) e máquinas que corram Debian "
+"3.1 Sarge não irão conseguir ligar às contas que sejam novas ou cuja "
+"password foi alterada. Veja /usr/share/doc/mysql-server-5.0/README.Debian."
+
+#~ msgid "Cannot upgrade if ISAM tables are present!"
+#~ msgstr "Não é possível actualizar se estiverem presentes tabelas ISAM!"
+
+#~ msgid ""
+#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
+#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
+#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
+#~ "The installation of mysql-server-5.0 will now abort. In case your old "
+#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
+#~ "those tables."
+#~ msgstr ""
+#~ "As versões recentes de MySQL já não podem utilizar o antigo formato de "
+#~ "tabelas ISAM e é por isso necessário converter as suas tabelas pra e.g. "
+#~ "MyISAM antes da actualização, utilizando \"mysql_convert_table_format\" "
+#~ "ou \"ALTER TABLE x ENGINE=MyISAM\". A instalação de mysql-server-5.0 irá "
+#~ "agora ser cancelada. Se o seu antigo mysql-server-4.1 for removido apenas "
+#~ "reinstale para converter essas tabelas."
diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po
new file mode 100644
index 00000000000..51557b006e6
--- /dev/null
+++ b/debian/po/pt_BR.po
@@ -0,0 +1,339 @@
+# Brazilian Portuguese (pt_BR) debconf template translation for
+# Debian's mysql-dfsg source package.
+# Debian-BR Project <debian-l10n-portuguese@lists.debian.org>
+# André Luís Lopes, <andrelop@debian.org> , 2004
+# André Luís Lopes, <andrelop@debian.org> , 2006
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.0\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2006-12-19 20:32-0200\n"
+"Last-Translator: André Luís Lopes <andrelop@debian.org>\n"
+"Language-Team: Debian-BR Project <debian-l10n-portuguese@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "Você realmente quer atualizar?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+"AVISO: O arquivo /var/lib/mysql/debian-*.flag existe. Isso indica que um "
+"pacote mysql-server com uma versão maior foi instalado antes. Não há como "
+"garantir que esta versão poderá usar seus dados."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "Aviso importante para usuários NIS/YP!"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"Para utilizar o MySQL, você deve instalar um usuário e um grupo equivalentes "
+"ao usuário e grupo a seguir para se certificar de que o diretório /var/lib/"
+"mysql possua as permissões correctas (o uid/gid podem ser diferentes)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "Remover as bases de dados utilizadas por todas as versões do MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+"O script está prestes a remover o diretório de dados /var/lib/mysql. Caso "
+"seja planejado somente instalar uma versão mais nova do MySQL ou caso um "
+"pacote mysql-server diferente já os esteja usando, os dados devem ser "
+"mantidos."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "O MySQL deve ser iniciado na inicialização da máquina?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"O MySQL pode ser iniciado automaticamente na inicialização da máquina ou "
+"apenas caso você use o comando '/etc/init.d/mysql start' manualmente."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "Nova senha para o usuário \"root\" do MySQL:"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+"É altamente recomendado que você defina uma senha para o usuário "
+"administrativo \"root\" do MySQL."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"If you do not provide a password no changes will be made to the account."
+msgstr "Caso você não forneça uma senha, nenhuma mudança será feita na conta."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr "Impossível definir senha para o usuário \"root\" do MySQL"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+"Parece que um erro cocrreu durante a definição da senha para o usuário "
+"administrativo do MySQL. Isso pode ter acontecido devido ao usuário já "
+"possuir uma senha definida ou devido a ocorrência de um problema de "
+"comunicação com o servidor MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+"Quando a instalação finalizar, você deverá verificar se a conta está "
+"apropriadamente protegida com uma senha (consulte o arquivo README.Debian "
+"para maiores informações)."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr ""
+"Suportar conexões MySQL originadas de hosts executando o Debian \"sarge\" "
+"ou mais antigos ?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
+"A maneira com que as senhas eram armazenadas não era muito segura. Isso foi "
+"melhorado, mas com o incômodo de que clientes (por exemplo, o PHP) em hosts "
+"executando o Debian 3.1 (Sarge) não serão capazes de conectar em contas "
+"novas ou para as quais as senhas tenham sido modificadas. Consulte /usr/"
+"share/doc/mysql-server-5.0/README.Debian."
+
+#~ msgid "internal"
+#~ msgstr "interno"
+
+#~ msgid "Only internally used."
+#~ msgstr "Somente utilizado internamente."
+
+#, fuzzy
+#~ msgid "Update Hints"
+#~ msgstr "Dicas de atualização"
+
+#, fuzzy
+#~ msgid ""
+#~ "Rarely, e.g. on new major versions, the privilege system is improved. To "
+#~ "make use of it mysql_fix_privilege_tables must be executed manually. The "
+#~ "script is not supposed to give any user more rights that he had before,"
+#~ msgstr ""
+#~ "Raramente, por exemplo, em novas versões maiores, o sistema de "
+#~ "privilégios é melhorado. Para fazer uso disso, o script "
+#~ "mysql_fix_privilege_tables deve ser executado manualmente. O script não "
+#~ "atribuirá a nenhum usuário mais direitos do que os mesmos já possuíam "
+#~ "anteriormente."
+
+#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
+#~ msgstr "Por favor, leia http://www.mysql.com/doc/en/Upgrade.html"
+
+#, fuzzy
+#~ msgid "Install Hints"
+#~ msgstr "Dicas de instalação"
+
+#, fuzzy
+#~ msgid ""
+#~ "MySQL will only install if you have a non-numeric hostname that is "
+#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
+#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
+#~ "myhostname\"."
+#~ msgstr ""
+#~ "O MySQL será instalado somente caso você possua um nome de host NÃO "
+#~ "NUMÉRICO que possa ser resolvido através do arquivo /etc/hosts, ou seja, "
+#~ "caso o comando \"hostname\" retorne \"myhostname\", uma linha como "
+#~ "\"10.0.0.1 myhostname\" deverá existir no arquivo /etc/hosts."
+
+#~ msgid ""
+#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
+#~ "is used in the start/stop and cron scripts. Don't delete."
+#~ msgstr ""
+#~ "Um novo usuário MySQL de nome \"debian-sys-maint\" será criado. Essa "
+#~ "conta MySQL é utilizada pelos scripts de inicialização/parada e pelos "
+#~ "scripts cron. Não remova esse usuário."
+
+#, fuzzy
+#~ msgid ""
+#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
+#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
+#~ "there, never only the password!"
+#~ msgstr ""
+#~ "Por favor, lembre-se de definir uma SENHA para o usuário root do MySQL ! "
+#~ "Caso você utilize um arquivo /root/.my.cnf, sempre inclua as linhas \"user"
+#~ "\" e \"password\" nesse arquivo, nunca somente a senha ! Consulte o "
+#~ "arquivo /usr/share/doc/mysql-server/README.Debian para mais informações."
+
+#~ msgid "Remove all databases?"
+#~ msgstr "Remover todas as bases de dados ?"
+
+#~ msgid ""
+#~ "Should I remove all databases below /var/lib/mysql as you are purging the "
+#~ "mysql-server package?"
+#~ msgstr ""
+#~ "Todas as base de dados sob o diretório /var/lib/mysql devem ser removidas "
+#~ "quando você remover o pacote pacote mysql-server ?"
+
+#~ msgid ""
+#~ "Networking is disabled by default for security reasons. You can enable it "
+#~ "by commenting out the skip-networking option in /etc/mysql/my.cnf."
+#~ msgstr ""
+#~ "O suporte ao funcionamento em rede está desativado por padrão por "
+#~ "questões de segurança. Você poderá ativá-lo comentando a opção 'skip-"
+#~ "networking' no arquivo /etc/mysql/my.cnf."
+
+#~ msgid "security and update notice"
+#~ msgstr "aviso de segurança e actualização"
+
+#~ msgid ""
+#~ "Should I remove everything below /var/lib/mysql when you purge the mysql-"
+#~ "server package with the \"dpkg --purge mysql-server\" command (i.e. "
+#~ "remove everything including the configuration) somewhen? (default is not)"
+#~ msgstr ""
+#~ "Devo remover tudo abaixo de /var/lib/mysql quando fizer o purge do pacote "
+#~ "mysql-server com o comando \"dpkg --purge mysql-server\" (ou seja, "
+#~ "remover tudo incluíndo a configuração)? (o padrão é não remover)"
+
+#~ msgid "Make MySQL reachable via network?"
+#~ msgstr "Fazer com que o MySQL seja acessível via rede?"
+
+#~ msgid ""
+#~ "Should MySQL listen on a network reachable TCP port? This is not "
+#~ "necessary for use on a single computer and could be a security problem."
+#~ msgstr ""
+#~ "O MySQL deve aguardar ligações numa porta TCP acessível via rede? Isto "
+#~ "não é necessário para uso num único computador e pode ser um problema de "
+#~ "segurança."
+
+#~ msgid "Enable chroot mode?"
+#~ msgstr "Activar o modo chroot?"
+
+#~ msgid ""
+#~ "MySQL is able to jail itself into the /var/lib/mysql_jail directory so "
+#~ "that users cannot modify any files outside this directory. This improves "
+#~ "resistence against crackers, too, as they are not able to modify system "
+#~ "files."
+#~ msgstr ""
+#~ "O MySQL é capaz de se prender no diretório /var/lib/mysql_jail, assim os "
+#~ "utilizadores não poderão modificar ficheiros fora deste directório. Isto "
+#~ "aumenta também a resistência contra crackers, pois eles não poderão "
+#~ "modificar arquivos de sistema."
+
+#~ msgid "Please run mysql_fix_privilege_tables !"
+#~ msgstr "Por favor execute mysql_fix_privilege_tables !"
+
+#~ msgid ""
+#~ "I will ensure secure permissions of /var/lib/mysql by replacing GIDs "
+#~ "other than root and mysql with mysql."
+#~ msgstr ""
+#~ "Permissões seguras para o diretório /var/lib/mysql serão asseguradas "
+#~ "substituíndo GIDs diferentes de root e mysql por mysql."
+
+#~ msgid ""
+#~ "Instructions how to enable SSL support are in /usr/share/doc/mysql-server/"
+#~ msgstr ""
+#~ "Instruções sobre como activar o suporte de SSL estão disponíveis no "
+#~ "directório /usr/share/doc/mysql-server/."
+
+#, fuzzy
+#~ msgid "mysql_fix_privileges_tables should be executed"
+#~ msgstr "mysql_fix_privileges_tables será executado"
+
+#, fuzzy
+#~ msgid ""
+#~ "The latest MySQL versions have an enhanced, more fine grained, privilege "
+#~ "system. To make use of it, some new fields must be added to the tables "
+#~ "in the \"mysql\" database. This will not happen automatically."
+#~ msgstr ""
+#~ "As últimas versões do MySQL possuem um sistema de privilégios melhorado e "
+#~ "mais refinado. Para utilizá-lo, alguns novos campos devem ser adicionados "
+#~ "as tabelas na base de dados \"mysql\". Isto é feito pelo script "
+#~ "mysql_fix_privileges_tables durante esta actualização independente do "
+#~ "servidor estar a correr ou não !"
+
+#~ msgid ""
+#~ "This script is not supposed to give any user more rights that he had "
+#~ "before, if you encounter such a case, please contact me."
+#~ msgstr ""
+#~ "Este script não deverá fornecer mais direitos a um utilizador além dos "
+#~ "quais ele já possua anteriormente. SE encontrar um caso desses, por favor "
+#~ "entre em contacto com o mantainer deste pacote Debian."
diff --git a/debian/po/ro.po b/debian/po/ro.po
new file mode 100644
index 00000000000..f344ab5eca0
--- /dev/null
+++ b/debian/po/ro.po
@@ -0,0 +1,193 @@
+# Romanian translation of mysql-dfsg.
+# Copyright (C) 2006 THE mysql-dfsg'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the mysql-dfsg package.
+#
+# Stan Ioan-Eugen <stan.ieugen@gmail.com>, 2006.
+msgid ""
+msgstr ""
+"Project-Id-Version: po-debconf://mysql-dfsg\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2006-12-20 21:27+0200\n"
+"Last-Translator: stan ioan-eugen <stan.ieugen@gmail.com>\n"
+"Language-Team: romanian <debian-l10n-romanian@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "Sunteţi sigur că doriţi să instalaţi o versiune mai veche?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+"AVERTISMENT: Fişierul /var/lib/mysql/debian-*.flag există. Acest lucru "
+"indică faptul că anterior a fost instalată o versiune nouă a pachetului "
+"mysql-server. Nu se poate garanta că versiunea instalată acum poate folosi "
+"datele versiunii instalate anterior."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "Notă importantă pentru utilizatorii NIS/YP!"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"Pentru a folosi mysql trebuie să adăugaţi un utilizator şi grup echivalent "
+"şi să vă asiguraţi că /var/lib/mysql are permisiunile stabilite corect (uid/"
+"gid pot aveavalori diferite)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr "/etc/passwd:\tmysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group:\tmysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql:\tdrwxr-xr-x\tmysql\tmysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "Doriţi să ştergeţi bazele de date folosite de toate versiune MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+"Scriptul urmează să şteargă directorul de date /var/lib/mysql. Dacă plănuiţi "
+"doar să instalaţi o versiune nouă MySQL sau datele sunt folosite de către un "
+"alt pachet mysql-server, atunci ar trebui păstraţi datele."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "Doriţi ca MySQL să pornească la initializarea sistemului?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"MySQL poate porni automat la iniţializarea sistemului sau doar dacă rulaţi "
+"comanda „/etc/init.d/mysql startâ€."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "Noua parolă pentru utilizatorul „root†al MySQL:"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr "Este recomandat să stabiliţi o parolă pentru utilizatorul administrativ „root†al MySQL."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"If you do not provide a password no changes will be made to the account."
+msgstr "Dacă nu introduceţi nici o parolă, nici o schimbare nu va fi luată în considerare."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr "Nu s-a putut stabili parola pentru utilizatorul „root†al MySQL"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr "Se pare că a intervenit o eroare în stabilirea parolei pentru utilizatorul administrativ "
+"al MySQL. Acest lucru se poate întâmpla dacă utilizatorul are deja o parolă, sau a existat o "
+"problemă în comunicarea cu serverul MySQL."
+
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr "După finalizarea instalării, ar trebui să verificaţi dacă contul este protejat"
+" cu o parolă (citiţi fişierul README.Debian pentru informaţii suplimentare)."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr "Suportaţi conexiuni MySQL de la staţii ce rulează sistemul Debian „sarge†sau mai vechi?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr "Modul în care erau păstrate parolele nu era foarte sigur. Acest lucru a fost îmbunătăţit"
+"cu dezajantajul că clienţii (de ex. PHP) de pe staţii ce rulează sistemul Debian 3.1 Sarge"
+"nu se vor putea conecta la conturi noi sau ale căror parole au fost schimbate. Citiţi "
+"/usr/share/doc/mysql-server-5.0/README.Debian."
+
+#~ msgid "Cannot upgrade if ISAM tables are present!"
+#~ msgstr "Nu se poate face actualizarea dacă sunt prezente tabele ISAM!"
+
+#~ msgid ""
+#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
+#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
+#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
+#~ "The installation of mysql-server-5.0 will now abort. In case your old "
+#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
+#~ "those tables."
+#~ msgstr ""
+#~ "Versiunile recente MySQL nu mai pot folosi vechiul format de tabele ISAM "
+#~ "şieste necesar să convertiţi tabelele dumneavoastră de ex. la formatul "
+#~ "MyISAM înainte de a face actualizarea folosind comanda "
+#~ "„mysql_convert_table_format†sau „ALTER TABLE x ENGINE=MyISAMâ€. "
+#~ "Instalarea mysql-server-5.0 va eşua. În caz că ştergeţiversiunea "
+#~ "anterioară mysql-server-4.1 va trebui reinstalată pentru a converti "
+#~ "tabelele."
diff --git a/debian/po/ru.po b/debian/po/ru.po
new file mode 100644
index 00000000000..1ab02e4437c
--- /dev/null
+++ b/debian/po/ru.po
@@ -0,0 +1,172 @@
+# translation of mysql-dfsg-5.0_5.0.32-6_ru.po to Russian
+# Russian messages:
+# Translators, if you are not familiar with the PO format, gettext
+# documentation is worth reading, especially sections dedicated to
+# this format, e.g. by running:
+# info -n '(gettext)PO Files'
+# info -n '(gettext)Header Entry'#
+# Some information specific to po-debconf are available at
+# /usr/share/doc/po-debconf/README-trans
+# or http://www.debian.org/intl/l10n/po-debconf/README-trans#
+# Developers do not need to manually edit POT or PO files.
+# Ilgiz Kalmetev <translator@ilgiz.pp.ru>, 2003.
+# Yuriy Talakan' <yt@amur.elektra.ru>, 2005, 2006.
+# Yuriy Talakan' <yt@drsk.ru>, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.0_5.0.32-6_ru\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2007-02-19 11:28+0900\n"
+"Last-Translator: Yuriy Talakan' <yt@drsk.ru>\n"
+"Language-Team: Russian <debian-l10n-russian@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.9.1\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "Ð’Ñ‹ дейÑтвительно желаете понизить верÑию?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+"Ð’ÐИМÐÐИЕ: Ðайден файл /var/lib/mysql/debian-*.flag. Это означает, что ранее "
+"был уÑтановлен пакет mysql-server более выÑокой верÑии. Ðевозможно "
+"гарантировать, что Ñ‚ÐµÐºÑƒÑ‰Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ Ñможет иÑпользовать его данные."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "Важное замечание Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»ÐµÐ¹ NIS/YP!"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"Чтобы иÑпользовать mysql, Ð’Ñ‹ должны уÑтановить Ñквивалентные Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Ð¸ "
+"группу, как указано ниже и убедитьÑÑ, что /var/lib/mysql имеет правильные "
+"права (uid/gid могут отличатьÑÑ)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "Удалить базы данных, иÑпользуемые вÑеми верÑиÑми MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr "Сценарий ÑобираетÑÑ ÑƒÐ´Ð°Ð»Ð¸Ñ‚ÑŒ директорию данных /var/lib/mysql. ЕÑли планируетÑÑ ÑƒÑтановить новую верÑию MySQL или еÑÑ‚ÑŒ другие пакеты mysql-server, иÑпользующие Ñту директорию, то данные надо Ñохранить."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "ЗапуÑкать MySQL при загрузке ÑиÑтемы?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"MySQL может запуÑкатьÑÑ Ð¿Ñ€Ð¸ загрузке ÑиÑтемы, либо только еÑли вы вручную "
+"введете команду '/etc/init.d/mysql start'. "
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "Ðовый пароль Ð´Ð»Ñ MySQL Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ \"root\":"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr "Крайне рекомендуетÑÑ ÑƒÑтановить пароль Ð´Ð»Ñ Ð°Ð´Ð¼Ð¸Ð½Ð¸Ñтративного MySQL Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ \"root\"."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "If you do not provide a password no changes will be made to the account."
+msgstr "ЕÑли вы не зададите пароль, то ÑƒÑ‡ÐµÑ‚Ð½Ð°Ñ Ð·Ð°Ð¿Ð¸ÑÑŒ не будет изменена."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr "Ðевозможно задать пароль MySQL пользователю \"root\""
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr "Ð’ процеÑÑе Ð·Ð°Ð´Ð°Ð½Ð¸Ñ Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð°Ð´Ð¼Ð¸Ð½Ð¸Ñтративного MySQL Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Ð¿Ñ€Ð¾Ð¸Ð·Ð¾ÑˆÐ»Ð° ошибка. Это могло произойти еÑли у Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ ÑƒÐ¶Ðµ был задан пароль, или из-за проблем ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ Ñервером MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr "Когда уÑтановка завершитÑÑ, вы должны убедитьÑÑ, что ÑƒÑ‡ÐµÑ‚Ð½Ð°Ñ Ð·Ð°Ð¿Ð¸ÑÑŒ защищена паролем (подробную информацию Ñм. в README.Debian)."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr "Ðужна поддержка подключений к MySQL Ñ Ð¼Ð°ÑˆÐ¸Ð½, работающих под Debian \"sarge\" или Ñтарше?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr "Метод Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð±Ñ‹Ð» не очень безопаÑен. Это было Ñделано из-за того, клиенты (например, PHP) Ñ Ð¼Ð°ÑˆÐ¸Ð½, работающих под Debian 3.1 Sarge не Ñмогут подключитьÑÑ Ðº учетной запиÑи еÑли она новаÑ, или пароль был изменен. См. /usr/share/doc/mysql-server-5.0/README.Debian."
+
diff --git a/debian/po/sv.po b/debian/po/sv.po
new file mode 100644
index 00000000000..54ef9246236
--- /dev/null
+++ b/debian/po/sv.po
@@ -0,0 +1,225 @@
+# Translators, if you are not familiar with the PO format, gettext
+# documentation is worth reading, especially sections dedicated to
+# this format, e.g. by running:
+# info -n '(gettext)PO Files'
+# info -n '(gettext)Header Entry'
+# Some information specific to po-debconf are available at
+# /usr/share/doc/po-debconf/README-trans
+# or http://www.debian.org/intl/l10n/po-debconf/README-trans
+# Developers do not need to manually edit POT or PO files.
+# , fuzzy
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.0 5.0.21-3\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2007-02-18 14:48+0100\n"
+"Last-Translator: Andreas Henriksson <andreas@fatal.se>\n"
+"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Swedish\n"
+"X-Poedit-Country: SWEDEN\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr "Vill du verkligen nedgradera?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a mysql-server package with a higher version has been installed before. It can not be guaranteed that this version can use its data."
+msgstr "VARNING: Filen /var/lib/mysql/debian-*.flag existerar. Detta betyder att paketet mysql-server med högre versionsnummer har installerats tidigare. Det kan inte garanteras att denna version kan använda dess data."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "Viktig notering för NIS/YP-användare!"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "To use mysql you must install an equivalent user and group to the following and ensure yourself that /var/lib/mysql has the right permissions (the uid/gid may be different)."
+msgstr "För att använda MySQL måste du installera en motsvarande användare och grupp till följande och se till att /var/lib/mysql har korrekta rättigheter satta (uid/gid kan vara olika)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr "Ta bort databaserna som används av alla MySQL-versioner?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "The script is about to remove the data directory /var/lib/mysql. If it is planned to just install a higher MySQL version or if a different mysql-server package is already using it, the data should be kept."
+msgstr "Scriptet kommer strax ta bort data-katalogen /var/lib/mysql. Om det planerade var att bara installera en högre MySQL-version eller om ett annan mysql-server paket redan använde det, skall datan sparas."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "Ska MySQL startas när systemet startar upp?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "The MySQL can start automatically on boot time or only if you manually type '/etc/init.d/mysql start'."
+msgstr "MySQL kan startas när systemet startas upp eller endast om du manuellt skriver '/etc/init.d/mysql start'."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr "Nytt lösenord för MySQLs \"root\"-användare:"
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "It is highly recommended that you set a password for the MySQL administrative \"root\" user."
+msgstr "Det är starkt rekommenderat att du sätter ett lösenord för MySQLs administrativa \"root\"-användare."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "If you do not provide a password no changes will be made to the account."
+msgstr "Om du inte anger ett lösenord kommer inga ändringar att göras för kontot."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr "Lyckades inte sätta lösenord för MySQLs \"root\"-användare"
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "It seems an error occurred while setting the password for the MySQL administrative user. This may have happened because the user already has a password, or because there was a problem communicating with the MySQL server."
+msgstr "Det verkar som ett fel uppstod när det skulle sättas ett lösenord för MySQLs administrativa användare. Detta kan ha skett för att användaren redan har ett lösenord satt, eller på grund av problem med att kommunicera med MySQL-servern."
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "When installation finishes, you should verify that the account is properly protected with a password (see README.Debian for more information)."
+msgstr "När installationen är klar, bör du kontrollera så att kontot är riktigt skyddat av ett lösenord (läs README.Debian för mer information)."
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr "Behöver du MySQL-anslutningar från system som kör Debian \"Sarge\" eller äldre?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "The way passwords were stored was not very secure. This has been improved with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 Sarge will not be able to connect to account which are new or whose password have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr "Sättet som lösenorden lagrades på var inte särskilt säkert. Detta har förbättrats på bekostnad av att klienter (t.ex. PHP) från system som kör Debian 3.1 Sarge inte kan ansluta till konton som är nya eller vars lösenord har ändrats. Se /usr/share/doc/mysql-server-5.0/README.Debian."
+
+#~ msgid "Cannot upgrade if ISAM tables are present!"
+#~ msgstr "Kan inte uppgradera om ISAM-tabeller finns!"
+#~ msgid ""
+#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
+#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
+#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
+#~ "The installation of mysql-server-5.0 will now abort. In case your old "
+#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
+#~ "those tables."
+#~ msgstr ""
+#~ "Senaste versionerna av MySQL kan inte längre använda gamla ISAM-"
+#~ "tabellformatet och det är nödvändigt att konvertera dina tabeller till "
+#~ "exempelvis MyISAM före uppgradering med \"mysql_convert_table_format\" "
+#~ "eller \"ALTER TABLE x ENGINE=MyISAM\". Installationen av mysql-server-5.0 "
+#~ "kommer nu att avbrytas. Om ditt gamla mysql-server-4.1-paket tas bort är "
+#~ "det bara att installera om det för att konvertera de tabellerna."
+#~ msgid "Update Hints"
+#~ msgstr "Uppdateringstips"
+#~ msgid ""
+#~ "You have to run \"mysql_upgrade\" after the upgrade, else tables can be "
+#~ "corrupted! This script also enhances the privilege tables but is not "
+#~ "supposed to give any user more rights that he had before,"
+#~ msgstr ""
+#~ "Du måste köra \"mysql_upgrade\" efter uppgraderingen, annars kan "
+#~ "tabellerna vara skadade! Detta skript utökar även privilegietabellerna "
+#~ "men är inte tänkte att ge någon användare mer befogenhet än vad han hade "
+#~ "tidigare,"
+#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
+#~ msgstr "Läs även http://www.mysql.com/doc/en/Upgrade.html"
+#~ msgid "Install Hints"
+#~ msgstr "Installationstips"
+#~ msgid ""
+#~ "On upgrades from MySQL 3.23, as shipped with Debian Woody, symlinks in "
+#~ "place of /var/lib/mysql or /var/log/mysql gets accidently removed and "
+#~ "have manually be restored."
+#~ msgstr ""
+#~ "Vid uppgraderingar från MySQL 3.23 som skickades med Debian Woody har "
+#~ "symboliska länkar i /var/lib/mysql eller /var/log/mysql av misstag tagits "
+#~ "bort och måste manuellt återskapas."
+#~ msgid ""
+#~ "MySQL will only install if you have a non-numeric hostname that is "
+#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
+#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
+#~ "myhostname\"."
+#~ msgstr ""
+#~ "MySQL kan endast installeras om du har ett icke-numeriskt värdnamn som "
+#~ "kan slås upp via filen /etc/hosts. Exempelvis om kommandot \"hostname\" "
+#~ "returnerar \"mittnamn\" så bör det finnas en rad som liknar \"10.0.0.1 "
+#~ "mittnamn\"."
+#~ msgid ""
+#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
+#~ "is used in the start/stop and cron scripts. Don't delete."
+#~ msgstr ""
+#~ "En ny MySQL-användare kallad \"debian-sys-maint\" kommer att skapas. "
+#~ "Detta MySQL-konto används för start/stopp och cron-skript. Ta inte bort "
+#~ "det."
+#~ msgid ""
+#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
+#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
+#~ "there, never only the password!"
+#~ msgstr ""
+#~ "Tänk på att sätta ett LÖSENORD för MySQL:s root-användare! Om du "
+#~ "använder /root/.my.cnf, skriv då alltid en \"user\"-rad och en \"password"
+#~ "\"-rad i den, aldrig med endast lösenordet!"
+#~ msgid ""
+#~ "See /usr/share/doc/mysql-server-5.0/README.Debian for more information."
+#~ msgstr ""
+#~ "Se /usr/share/doc/mysql-server-5.0/README.Debian för mer information."
+#~ msgid ""
+#~ "Should I remove the complete /var/lib/mysql directory tree which is used "
+#~ "by all MySQL versions, not necessarily only the one you are about to "
+#~ "purge?"
+#~ msgstr ""
+#~ "Ska jag ta bort hela katalogträdet i /var/lib/mysql som används av alla "
+#~ "MySQL-versioner och inte bara för den som du nu kommer att rensa ut?"
+#~ msgid ""
+#~ "Rarely, e.g. on new major versions, the privilege system is improved. To "
+#~ "make use of it mysql_fix_privilege_tables must be executed manually. The "
+#~ "script is not supposed to give any user more rights that he had before,"
+#~ msgstr ""
+#~ "Sällan, exempelvis i nya större versioner, har behörighetssystemet "
+#~ "förbättrats. För att använda det måste skriptet "
+#~ "mysql_fix_privilege_tables köras manuellt. Skriptet är inte tänkt att ge "
+#~ "någon användare högre behörighet än han hade tidigare."
+
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
new file mode 100644
index 00000000000..e4ec4e95ca5
--- /dev/null
+++ b/debian/po/templates.pot
@@ -0,0 +1,155 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"If you do not provide a password no changes will be made to the account."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
diff --git a/debian/po/tr.po b/debian/po/tr.po
new file mode 100644
index 00000000000..20b4df45b6e
--- /dev/null
+++ b/debian/po/tr.po
@@ -0,0 +1,290 @@
+# Turkish translation of mysql-server.
+# This file is distributed under the same license as the mysql-server package.
+# Gürkan Aslan <gurkan@iaslan.com>, 2004
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-4.1\n"
+"Report-Msgid-Bugs-To: ch@debian.org\n"
+"POT-Creation-Date: 2007-02-16 22:27+0100\n"
+"PO-Revision-Date: 2004-06-05 08:53+0300\n"
+"Last-Translator: Gürkan Aslan <gurkan@iaslan.com>\n"
+"Language-Team: Turkish <debian-l10n-turkish@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid "Do you really want to downgrade?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:1001
+msgid ""
+"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
+"mysql-server package with a higher version has been installed before. It can "
+"not be guaranteed that this version can use its data."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "Important note for NIS/YP users!"
+msgstr "NIS/YP kullanıcıları için önemli not!"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"To use mysql you must install an equivalent user and group to the following "
+"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
+"gid may be different)."
+msgstr ""
+"Mysql'i kullanmak için aşağıdakiyle eşdeğer bir kullanıcı ve grup "
+"tanımlamalı, ve /var/lib/mysql izinlerinin uygun şekilde ayarlandığından "
+"emin olmalısınız (uid/gid farklı olabilir)."
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+msgstr ""
+"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/etc/group: mysql:x:101:"
+msgstr "/etc/group: mysql:x:101:"
+
+#. Type: note
+#. Description
+#: ../mysql-server-5.0.templates:2001
+msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
+msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid "Remove the databases used by all MySQL versions?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:3001
+msgid ""
+"The script is about to remove the data directory /var/lib/mysql. If it is "
+"planned to just install a higher MySQL version or if a different mysql-"
+"server package is already using it, the data should be kept."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+msgid "Should MySQL start on boot?"
+msgstr "MySQL açılış sırasında başlatılsın mı?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:4001
+#, fuzzy
+msgid ""
+"The MySQL can start automatically on boot time or only if you manually type "
+"'/etc/init.d/mysql start'."
+msgstr ""
+"MySQL açılış sırasında veya '/etc/init.d/mysql start' komutunu vermeniz "
+"halinde elle başlatılabilir. Eğer açılışta otomatik olarak başlatılmasını "
+"istiyorsanız burada 'evet'i seçin."
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid "New password for MySQL \"root\" user:"
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"It is highly recommended that you set a password for the MySQL "
+"administrative \"root\" user."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-server-5.0.templates:5001
+msgid ""
+"If you do not provide a password no changes will be made to the account."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid "Unable to set password for MySQL \"root\" user"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"It seems an error occurred while setting the password for the MySQL "
+"administrative user. This may have happened because the user already has a "
+"password, or because there was a problem communicating with the MySQL server."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-server-5.0.templates:6001
+msgid ""
+"When installation finishes, you should verify that the account is properly "
+"protected with a password (see README.Debian for more information)."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-server-5.0.templates:7001
+msgid ""
+"The way passwords were stored was not very secure. This has been improved "
+"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
+"Sarge will not be able to connect to account which are new or whose password "
+"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
+msgstr ""
+
+#, fuzzy
+#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
+#~ msgstr "Lütfen http://www.mysql.com/doc/en/Upgrade.html belgesini okuyun"
+
+#, fuzzy
+#~ msgid ""
+#~ "MySQL will only install if you have a non-numeric hostname that is "
+#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
+#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
+#~ "myhostname\"."
+#~ msgstr ""
+#~ "MySQL sadece /etc/hosts dosyası yoluyla çözülebilir NUMERİK OLMAYAN bir "
+#~ "makine adına sahipseniz kurulacaktır. Örneğin, eğer \"hostname\" komutu "
+#~ "\"makinem\" ismini döndürüyorsa, bu dosya içinde \"10.0.0.1 makinem\" "
+#~ "gibi bir satır olmalıdır."
+
+#, fuzzy
+#~ msgid ""
+#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
+#~ "is used in the start/stop and cron scripts. Don't delete."
+#~ msgstr ""
+#~ "Yeni mysql kullanıcısı \"debian-sys-maint\" yaratılacak. Bu hesap, "
+#~ "başlangıç betiklerinde ve cron içinde kullanılıyor. Bu hesabı silmeyin."
+
+#, fuzzy
+#~ msgid ""
+#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
+#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
+#~ "there, never only the password!"
+#~ msgstr ""
+#~ "Lütfen MySQL root kullanıcısı için bir PAROLA girmeyi unutmayın! Eğer /"
+#~ "root/.my.cnf kullanıyorsanız, \"user\" ve \"password\" satırlarını her "
+#~ "zaman buraya ekleyin, sadece parolayı değil! Daha fazla bilgi için /usr/"
+#~ "share/doc/mysql-server/README.Debian dosyasını okuyun."
+
+#, fuzzy
+#~ msgid ""
+#~ "Should I remove all databases below /var/lib/mysql as you are purging the "
+#~ "mysql-server package?"
+#~ msgstr ""
+#~ "mysql-server paketi kaldırıldıktan sonra bütün veritabanları silinsin mi?"
+
+#~ msgid ""
+#~ "Networking is disabled by default for security reasons. You can enable it "
+#~ "by commenting out the skip-networking option in /etc/mysql/my.cnf."
+#~ msgstr ""
+#~ "Ağ, öntanımlı olarak güvenlik gerekçeleriyle devre dışı bırakıldı. Bu "
+#~ "özelliği /etc/mysql/my.cnf dosyası içindeki \"skip-networking\" "
+#~ "seçeneğini kaldırarak etkinleştirebilirsiniz."
+
+#~ msgid "security and update notice"
+#~ msgstr "güvenlik ve güncelleme duyurusu"
+
+#~ msgid ""
+#~ "Should I remove everything below /var/lib/mysql when you purge the mysql-"
+#~ "server package with the \"dpkg --purge mysql-server\" command (i.e. "
+#~ "remove everything including the configuration) somewhen? (default is not)"
+#~ msgstr ""
+#~ "mysql-server paketini temizlemek için \"dpkg --purge mysql-server\" "
+#~ "komutunu kullandığınızda (yani yapılandırma dahil herşeyi silmek) /var/"
+#~ "lib/mysql altındaki herşeyi sileyim mi? (öntanımlı cevap hayır'dır)."
+
+#~ msgid "Please run mysql_fix_privilege_tables !"
+#~ msgstr "Lütfen mysql_fix_privilege_tables komutunu çalıştırın!"
+
+#~ msgid ""
+#~ "I will ensure secure permissions of /var/lib/mysql by replacing GIDs "
+#~ "other than root and mysql with mysql."
+#~ msgstr ""
+#~ "/var/lib/mysql'in izinlerinin güvenli olmasını sağlamak amacıyla, buna "
+#~ "ait GID'leri root ve mysql'den farklı olacak şekilde değiştireceğim."
+
+#~ msgid ""
+#~ "Instructions how to enable SSL support are in /usr/share/doc/mysql-server/"
+#~ msgstr ""
+#~ "SSL desteğini nasıl etkinleştirebileceğinize ilişkin talimatlar /usr/"
+#~ "share/doc/mysql-server/ içinde."
+
+#~ msgid "mysql_fix_privileges_tables will be executed"
+#~ msgstr "mysql_fix_privileges_tables çalıştırılacak"
+
+#~ msgid ""
+#~ "The latest MySQL versions have an enhanced, more fine grained, privilege "
+#~ "system. To make use of it, some new fields must be added to the tables "
+#~ "in the \"mysql\" database. This is done by the "
+#~ "mysql_fix_privilege_tables script during this upgrade regardless of if "
+#~ "the server is currently running or not!"
+#~ msgstr ""
+#~ "En son MySQL sürümleri zenginleştirilmiş, daha ayrıntılandırılmış bir "
+#~ "ayrıcalık (privilege) sistemine sahiptir. Yeni sistemi kullanmak için, "
+#~ "\"mysql\" veritabanındaki tablolara bazı yeni alanlar eklenmelidir. Bu "
+#~ "işlem, sunucunun çalışıp çalışmamasına bağlı olmaksızın "
+#~ "mysql_fix_privilege_tables betiği tarafından bu yükseltme sırasında "
+#~ "yapılır."
+
+#~ msgid ""
+#~ "This script is not supposed to give any user more rights that he had "
+#~ "before, if you encounter such a case, please contact me."
+#~ msgstr ""
+#~ "Bu betiğin hiç bir kullanıcıya öncekinden daha fazla hak kazandırmadığı "
+#~ "varsayılıyor. Eğer bunun aksinde bir durumla karşılaşırsanız, lütfen "
+#~ "benimle bağlantıya geçin."
+
+#~ msgid "Make MySQL reachable via network?"
+#~ msgstr "MySQL network üzerinden ulaşılabilir olsun mu?"
+
+#~ msgid ""
+#~ "Should MySQL listen on a network reachable TCP port? This is not "
+#~ "necessary for use on a single computer and could be a security problem."
+#~ msgstr ""
+#~ "MySQL ağ üzerinde ulaşılabilen bir TCP portunu dinlesin mi? Tek olan bir "
+#~ "bilgisayar için bu ayar gerekli değildir ve bir güvenlik sorunu "
+#~ "oluÅŸturabilir."
+
+#~ msgid "Enable chroot mode?"
+#~ msgstr "chroot kipi etkinleÅŸtirilsin mi?"
+
+#~ msgid ""
+#~ "MySQL is able to jail itself into the /var/lib/mysql_jail directory so "
+#~ "that users cannot modify any files outside this directory. This improves "
+#~ "resistence against crackers, too, as they are not able to modify system "
+#~ "files."
+#~ msgstr ""
+#~ "MySQL kendini /var/lib/mysql_jail dizinine hapsederek kullanıcıların bu "
+#~ "dizin dışındaki hiç bir dosyayı değiştirmemesini sağlayabilir. Bu "
+#~ "düzenleme, sistem dosyalarını değiştirmelerini engelleyeceğinden, "
+#~ "cracker'lara karşı dayanıklılığı arttırır."
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 00000000000..5bc73f5ebad
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,405 @@
+#!/usr/bin/make -f
+
+export SHELL = /bin/bash
+
+export DH_VERBOSE=1
+
+include debian/defs.mk
+
+changelog_values := $(shell dpkg-parsechangelog \
+ | awk '/^(Version|Source|Distribution):/ {print $$2}')
+PKGSOURCE := $(word 1, $(changelog_values))
+PKGVERSION := $(word 2, $(changelog_values))
+PKGDISTRO := $(word 3, $(changelog_values))
+PKGFLAVOR := $(shell echo $(PKGSOURCE) | perl -nle 's/mysql-(.*?)-\d+.*/$$1/ && print ')
+
+ifeq ("x$(MYSQL_FLAVOR)","x")
+ export MYSQL_FLAVOR=$(PKGFLAVOR)
+endif
+
+ifneq ("x$(MYSQL_FLAVOR)","x")
+ MYSQL_BRANDED_BASE_VERSION:=$(MYSQL_FLAVOR)-$(MYSQL_BASE_VERSION)
+ MYSQL_BRANDED_PREVIOUS_BASE_VERSION:=$(MYSQL_FLAVOR)-$(MYSQL_PREVIOUS_BASE_VERSION)
+else
+ ifeq ( "$(MYSQL_BRANDED_BASE_VERSION)","@MYSQL_BRANDED_BASE_VERSION@" )
+ MYSQL_BRANDED_BASE_VERSION:=$(MYSQL_BASE_VERSION)
+ MYSQL_BRANDED_PREVIOUS_BASE_VERSION:=$(MYSQL_PREVIOUS_BASE_VERSION)
+ else
+ MYSQL_BRANDED_BASE_VERSION:=$(MYSQL_BRANDED_BASE_VERSION)
+ MYSQL_BRANDED_PREVIOUS_BASE_VERSION:=$(MYSQL_BRANDED_PREVIOUS_BASE_VERSION)
+ endif
+endif
+
+PACKAGE=mysql-$(MYSQL_BRANDED_BASE_VERSION)
+
+PWD=$(shell pwd)
+TMP=$(PWD)/debian/tmp/
+
+
+ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+
+MAKE_J = $(shell if grep -q processor.*3 /proc/cpuinfo; then echo "-j 4"; else echo ""; fi )
+
+ifeq ($(findstring $(ARCH),i386 sparc),$(ARCH))
+ USE_ASSEMBLER=--enable-assembler
+endif
+
+ifeq ($(findstring $(ARCH), arm),$(ARCH))
+ FOMIT_FRAME_POINTER=
+else
+ FOMIT_FRAME_POINTER=-fomit-frame-pointer
+endif
+
+# trying to raise stability on i386. See #116631
+# don't use it on ia64
+ifeq ($(findstring $(ARCH),i386),$(ARCH))
+ FNO_EXCEPTIONS=-fno-exceptions
+endif
+
+# This causes seg11 crashes if LDAP is used for groups in /etc/nsswitch.conf
+# so it is disabled by default although, according to MySQL, it brings >10%
+# performance gain if enabled. See #299382.
+ifeq ($(STATIC_MYSQLD), 1)
+ USE_STATIC_MYSQLD=--with-mysqld-ldflags=-all-static
+endif
+
+ifneq ("$(MYSQL_BUILD_TEST)","yes")
+ MYSQL_BUILD_TEST=no
+endif
+
+control-file:
+ @echo "## This file is autogenerated you want to edit control.in instead" > debian/control.tmp
+ sed -e "s/@MYSQL_BASE_VERSION@/$(MYSQL_BASE_VERSION)/g" \
+ -e "s/@MYSQL_BRANDED_BASE_VERSION@/$(MYSQL_BRANDED_BASE_VERSION)/g" \
+ -e "s/@VERSIONSTRING@/$(VERSIONSTRING)/g" \
+ -e "s/@MYSQL_PREVIOUS_BASE_VERSION@/$(MYSQL_PREVIOUS_BASE_VERSION)/g" \
+ -e "s/@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@/$(MYSQL_BRANDED_PREVIOUS_BASE_VERSION)/g" \
+ -e "s/@MYSQL_SOURCE_BASE_VERSION@/$(MYSQL_SOURCE_BASE_VERSION)/g" \
+ -e "s/@SHARED_LIB_MAJOR_VERSION@/$(SHARED_LIB_MAJOR_VERSION)/g" \
+ -e "s/@NDB_SHARED_LIB_MAJOR_VERSION@/$(NDB_SHARED_LIB_MAJOR_VERSION)/g" \
+ debian/control.in >> debian/control.tmp
+ [ -e debian/control ] \
+ && cmp -s debian/control debian/control.tmp \
+ && rm -f debian/control.tmp && exit 0; \
+ mv debian/control.tmp debian/control
+
+
+missing:
+ ./BUILD/autorun.sh
+
+configure: configure-stamp
+configure-stamp:
+ @echo "RULES.configure-stamp"
+ dh_testdir
+
+ifneq ($(ARCH_OS),hurd)
+ @if [ ! -d /proc/self ]; then echo "/proc IS NEEDED" 1>&2; exit 1; fi
+endif
+
+ @cp debian/control debian/control.sav
+ ( \
+ CC="$(MYSQL_BUILD_CC)" \
+ CXX="$(MYSQL_BUILD_CXX)" \
+ BUILD_OPTS="${MYSQL_BUILD_OPTS:-''}" \
+ CFLAGS="${MYSQL_BUILD_CFLAGS:-'-DBIG_JOINS=1 -O2'}" \
+ CXXFLAGS="${MYSQL_BUILD_CXXFLAGS:-'-DBIG_JOINS=1 -felide-constructors -fno-rtti -O2'}" \
+ ./configure \
+ --build=${DEB_BUILD_GNU_TYPE} \
+ --host=${DEB_HOST_GNU_TYPE} \
+ \
+ --prefix=/usr \
+ --exec-prefix=/usr \
+ --libexecdir=/usr/sbin \
+ --datadir=/usr/share \
+ --localstatedir=/var/lib/mysql \
+ --includedir=/usr/include \
+ --infodir=/usr/share/info \
+ --mandir=/usr/share/man \
+ \
+ --with-comment="MySQL Server (custom build)" \
+ --with-server-suffix="-custom" \
+ \
+ --enable-shared \
+ --enable-thread-safe-client \
+ $(USE_ASSEMBLER) \
+ --enable-local-infile \
+ \
+ --with-big-tables \
+ --with-unix-socket-path=/var/run/mysqld/mysqld.sock \
+ --with-mysqld-user=mysql \
+ $(USE_STATIC_MYSQLD) \
+ --without-bench \
+ --with-zlib-dir=bundled \
+ --with-yassl \
+ --with-readline \
+ --with-extra-charsets=all \
+ --with-innodb \
+ --with-blackhole-storage-engine \
+ --with-example-storage-engine \
+ \
+ --with-isam \
+ --with-archive-storage-engine \
+ --with-csv-storage-engine \
+ --with-federated-storage-engine \
+ --without-embedded-server \
+ --with-ndbcluster \
+ --with-ndb-shm \
+ --without-ndb-sci \
+ --without-ndb-test \
+ --with-ndb-docs \
+ $(MYSQL_BUILD_OPTS) \
+ )
+
+ @mv debian/control.sav debian/control
+
+ touch configure-stamp
+
+
+build: build-stamp
+build-stamp: configure
+ dh_testdir
+
+ $(MAKE) $(MAKE_J)
+
+ if [ -f sql/.libs/mysqld ] ; then \
+ nm --numeric-sort sql/.libs/mysqld > sql/mysqld.sym ; \
+ else \
+ nm --numeric-sort sql/mysqld > sql/mysqld.sym ; \
+ fi
+
+
+ if [ "${MYSQL_BUILD_TEST}" != "no" ] ; then \
+ ( cd mysql-test ;\
+ MTR_BUILD_THREAD=auto ; \
+ export MTR_BUILD_THREAD ; \
+ perl ./mysql-test-run.pl --force --report-features ; \
+ perl ./mysql-test-run.pl --force --ps-protocol ; \
+ true ) \
+ fi
+
+
+ touch build-stamp
+
+stamp-control:
+ # We have to prepare the various control files
+
+ echo "in stamp-control - BASE_VER==$(MYSQL_BASE_VERSION)"
+ # We have some naming inconsistencies here...
+ for f in debian/*.in debian/po/POTFILES.in.in ; do \
+ f2=`echo $$f | sed "s,BASE,$(MYSQL_BRANDED_BASE_VERSION),g;\
+ s,PREV,$(MYSQL_BRANDED_PREVIOUS_BASE_VERSION),g;\
+ s,NLIB,$(NDB_SHARED_LIB_MAJOR_VERSION),g;\
+ s,SLIB,$(SHARED_LIB_MAJOR_VERSION),g;s,\.in$$,,"`; \
+ if [ $$f2 != debian/control -a $$f2 != debian/Makefile ]; then \
+ sed -e "s/@MYSQL_BASE_VERSION@/$(MYSQL_BASE_VERSION)/g" \
+ -e "s/@MYSQL_BRANDED_BASE_VERSION@/$(MYSQL_BRANDED_BASE_VERSION)/g" \
+ -e "s/@VERSIONSTRING@/$(VERSIONSTRING)/g" \
+ -e "s/@PRIORITY@/$(PRIORITY)/g" \
+ -e "s/@MYSQL_PREVIOUS_BASE_VERSION@/$(MYSQL_PREVIOUS_BASE_VERSION)/g" \
+ -e "s/@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@/$(MYSQL_BRANDED_PREVIOUS_BASE_VERSION)/g" \
+ -e "s/@MYSQL_SOURCE_BASE_VERSION@/$(MYSQL_SOURCE_BASE_VERSION)/g" \
+ -e "s/@SHARED_LIB_MAJOR_VERSION@/$(SHARED_LIB_MAJOR_VERSION)/g" \
+ -e "s/@NDB_SHARED_LIB_MAJOR_VERSION@/$(NDB_SHARED_LIB_MAJOR_VERSION)/g" \
+ -e "s,@SCRIPTDIR@,/$(scriptdir),g" \
+ -e "s,@INFO@,$(findstring info, $(doc_dependencies)),g" \
+ <$$f >$$f2; \
+ fi; \
+ done
+ echo "MYSQL_BUILD_OPTS=$(MYSQL_BUILD_OPTS)" >> debian/defs.mk
+ echo "MYSQL_BUILD_CXXFLAGS=$(MYSQL_BUILD_CXXFLAGS)" >> debian/defs.mk
+ echo "MYSQL_BUILD_CFLAGS=$(MYSQL_BUILD_CFLAGS)" >> debian/defs.mk
+ echo "MYSQL_BUILD_CC=$(MYSQL_BUILD_CC)" >> debian/defs.mk
+ echo "MYSQL_BUILD_CXX=$(MYSQL_BUILD_CXX)" >> debian/defs.mk
+
+
+# depending on two files we expect to be in the root
+# to protect from accidentally deleting a whole bunch of
+# files somewhere else.
+clean: configure.in Makefile.am control-file
+
+ rm -f debian/mysql-server-$(MYSQL_BRANDED_BASE_VERSION).mysql.init
+
+ # We depend on this later, and delete the results in the mean time
+ $(MAKE) -f debian/rules stamp-control
+ dh_testdir
+ dh_testroot
+ rm -f configure-stamp
+ rm -f build-stamp
+
+ cp debian/defs.mk debian/defs.mk.sav
+ cp debian/control debian/control.sav
+ -make distclean
+ mv debian/defs.mk.sav debian/defs.mk
+ mv debian/control.sav debian/control
+
+ debconf-updatepo
+
+ for f in debian/*.in; do \
+ f2=`echo $$f | sed "s,BASE,$(MYSQL_BRANDED_BASE_VERSION),g;\
+ s,PREV,$(MYSQL_BRANDED_PREVIOUS_BASE_VERSION),g;\
+ s,NLIB,$(NDB_SHARED_LIB_MAJOR_VERSION),g;\
+ s,SLIB,$(SHARED_LIB_MAJOR_VERSION),g;s,\.in$$,,"`; \
+ if [ $$f2 != debian/control -a $$f2 != debian/Makefile -a $$f2 != debian/defs.mk ]; then \
+ rm -f $$f2; \
+ fi; \
+ done
+ rm -f po/POTFILES.in
+
+ dh_clean -v
+
+
+
+install:
+install: build stamp-control
+ @echo "RULES.install"
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Sort of hackish way to make sure we have a init script
+ # for dh_installinit
+ cp support-files/mysql.server debian/mysql-server-$(MYSQL_BRANDED_BASE_VERSION).mysql.init
+
+ mkdir -p $(TMP)/usr/lib/mysql/mysqld.sym
+ cp sql/mysqld.sym $(TMP)/usr/lib/mysql/mysqld.sym
+
+ # TODO: need real man pages!
+ #for f in mysql mysqldump mysqlaccess mysqladmin mysqlshow myisam_ftdump myisamlog myisampack mysql_explain_log mysqld_multi mysqld_safe mysql_fix_privilege_tables mysql_upgrade mysql_tzinfo_to_sql mysql_zap perror replace safe_mysqld ; do touch $(TMP)/usr/share/man/man1/$$f.1 ; done
+ #for f in mysqld mysqlmanager ; do touch $(TMP)/usr/share/man/man8/$$f.8 ; done
+ # make install (trailing slash needed for innobase)
+ $(MAKE) install DESTDIR=$(TMP)/
+
+ # After installing, remove rpath to make lintian happy.
+ set +e; \
+ find ./debian/tmp/ -type f -print0 \
+ | xargs -0 --no-run-if-empty chrpath -k 2>/dev/null \
+ | fgrep RPATH= \
+ | cut -d: -f 1 \
+ | xargs --no-run-if-empty chrpath -d; \
+ set -e
+
+ # libmysqlclient: move shared libraries (but not the rest like libheap.a & co)
+ mv $(TMP)/usr/lib/mysql/libmysqlclient* $(TMP)/usr/lib
+ mv $(TMP)/usr/lib/mysql/libndbclient* $(TMP)/usr/lib
+ perl -pi -e 's#/usr/lib/mysql#/usr/lib#' $(TMP)/usr/lib/libmysqlclient.la
+ perl -pi -e 's#/usr/lib/mysql#/usr/lib#' $(TMP)/usr/lib/libmysqlclient_r.la
+ perl -pi -e 's#/usr/lib/mysql#/usr/lib#' $(TMP)/usr/lib/libndbclient.la
+
+ # Check if our beloved versioned symbols are really there
+ if [ "`objdump -T $(TMP)/usr/lib/libmysqlclient.so.$(SHARED_LIB_MAJOR_VERSION).0.0 | grep -c libmysqlclient_$(SHARED_LIB_MAJOR_VERSION)`" -lt 500 ]; then \
+ echo "ERROR: versioned symbols are absent"; \
+ exit 1; \
+ fi
+ if [ "`objdump -T $(TMP)/usr/lib/libndbclient.so.$(NDB_SHARED_LIB_MAJOR_VERSION).0.0 | grep -c libndbclient_$(NDB_SHARED_LIB_MAJOR_VERSION)`" -lt 500 ]; then \
+ echo "ERROR: versioned symbols are absent from libndbclient"; \
+ exit 1; \
+ fi
+
+ # libmysqlclient-dev: forgotten header file since 3.23.25?
+ cp include/my_config.h $(TMP)/usr/include/mysql/
+ cp include/my_dir.h $(TMP)/usr/include/mysql/
+
+ # mysql-common: We now provide our own config file.
+ install -d $(TMP)/etc/mysql
+ install -m 0644 debian/additions/my.cnf $(TMP)/etc/mysql/my.cnf
+
+ pod2man scripts/mysqlhotcopy $(TMP)/usr/share/man/man1/mysqlhotcopy.1
+
+ # mysql-server
+ install -m 0755 scripts/mysqld_safe $(TMP)/usr/bin/mysqld_safe
+ mkdir -p $(TMP)/usr/share/doc/mysql-server-$(MYSQL_BRANDED_BASE_VERSION)/examples
+ mv $(TMP)/usr/share/mysql/*cnf $(TMP)/usr/share/doc/mysql-server-$(MYSQL_BRANDED_BASE_VERSION)/examples/
+ rm -vf $(TMP)/usr/share/mysql/mi_test_all* \
+ $(TMP)/usr/share/mysql/mysql-log-rotate \
+ $(TMP)/usr/share/mysql/mysql.server \
+ $(TMP)/usr/share/mysql/binary-configure
+
+ # we can't install *.pl into /usr/bin - so we have to rename it.
+ sed "s#filename => 'ndb_size.tmpl#filename => '/usr/share/mysql/ndb_size.tmpl#" < $(TMP)/usr/bin/ndb_size.pl > $(TMP)/usr/bin/ndb_size
+ cp -a mysql-test $(TMP)/usr/share/mysql/
+ cp -a sql-bench $(TMP)/usr/share/mysql/
+ # lintian overrides
+ mkdir -p $(TMP)/usr/share/lintian/overrides/
+ cp debian/mysql-server-$(MYSQL_BRANDED_BASE_VERSION).lintian-overrides $(TMP)/usr/share/lintian/overrides/mysql-server-$(MYSQL_BRANDED_BASE_VERSION)
+ cp debian/mysql-client-$(MYSQL_BRANDED_BASE_VERSION).lintian-overrides $(TMP)/usr/share/lintian/overrides/mysql-client-$(MYSQL_BRANDED_BASE_VERSION)
+
+ # For 4.1 -> 5.0 transition
+ d=$(TMP)/usr/share/mysql-common/internal-use-only/; \
+ mkdir -p $$d; \
+ cp debian/mysql-server-$(MYSQL_BRANDED_BASE_VERSION).mysql.init $$d/_etc_init.d_mysql; \
+ cp debian/mysql-server-$(MYSQL_BRANDED_BASE_VERSION).mysql-server.logrotate $$d/_etc_logrotate.d_mysql-server; \
+
+ dh_movefiles
+
+# Build architecture-independent files here.
+binary-indep: build install
+ @echo "RULES.binary-indep"
+ dh_testdir -i
+ dh_testroot -i
+ dh_installdebconf -i
+ dh_installdocs -i
+ dh_installexamples -i
+ dh_installmenu -i
+ dh_installlogrotate -i
+ dh_installinit -i
+ dh_installcron -i
+ dh_installman -i
+ dh_installinfo -i
+ dh_installlogcheck -i
+ dh_installchangelogs -i
+ dh_link -i
+ dh_compress -i
+ dh_fixperms -i
+ dh_installdeb -i
+ dh_perl -i
+ dh_gencontrol -i
+ dh_md5sums -i
+ dh_builddeb -i
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ @echo "RULES.binary-arch"
+ dh_testdir
+ dh_testroot
+
+ dh_installdebconf -a
+ dh_installdocs -a
+ dh_installexamples -a
+ dh_installmenu -a
+ dh_installlogrotate -a --name mysql-server
+ # Start mysql in runlevel 19 before 20 where apache, proftpd etc gets
+ # started which might depend on a running database server.
+ dh_installinit -a --name=mysql-storage -- defaults 19 21
+ dh_installinit -a --name=mysql -- defaults 19 21
+ dh_installinit -a --name=mysql-management -- defaults 20
+ dh_installcron -a --name mysql-server
+ dh_installman -a
+ dh_installinfo -a
+ dh_installlogcheck -a
+ dh_installchangelogs -a
+ dh_strip -a
+ dh_link -a # .so muss nach .so.1.2.3 installier werden!
+ dh_compress -a
+ dh_fixperms -a
+ dh_makeshlibs -a
+ dh_makeshlibs -plibmysqlclient$(SHARED_LIB_MAJOR_VERSION) -V"libmysqlclient$(SHARED_LIB_MAJOR_VERSION) (>= $(PKGVERSION))"
+ dh_makeshlibs -plibndbclient$(NDB_SHARED_LIB_MAJOR_VERSION) -V"libndbclient2 (>= $(PKGVERSION))"
+ dh_installdeb -a
+ dh_perl -a
+ dh_shlibdeps -a -l debian/libmysqlclient$(SHARED_LIB_MAJOR_VERSION)/usr/lib -L libmysqlclient$(SHARED_LIB_MAJOR_VERSION)
+ dh_shlibdeps -a -l debian/libndbclient$(NDB_SHARED_LIB_MAJOR_VERSION)/usr/lib -L libndbclient$(NDB_SHARED_LIB_MAJOR_VERSION)
+ dh_gencontrol -a
+ dh_md5sums -a
+ dh_builddeb -a
+
+source diff:
+ @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+binary: binary-indep binary-arch
+.PHONY: clean stamp-control control-file configure build binary binary-indep binary-arch install
+
+# vim: ts=8
diff --git a/debian/source.lintian-overrides.in b/debian/source.lintian-overrides.in
new file mode 100644
index 00000000000..22a9164cf66
--- /dev/null
+++ b/debian/source.lintian-overrides.in
@@ -0,0 +1,6 @@
+maintainer-script-lacks-debhelper-token debian/mysql-server-@MYSQL_BRANDED_BASE_VERSION@.postinst
+maintainer-script-lacks-debhelper-token debian/mysql-server-@MYSQL_BRANDED_BASE_VERSION@.postrm
+outdated-autotools-helper-file bdb/dist/config.sub 2002-07-03
+outdated-autotools-helper-file bdb/dist/config.guess 2002-07-23
+bad-distribution-in-changes-file sarge
+bad-distribution-in-changes-file etch
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 00000000000..35a12186d19
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=3
+opts="uversionmangle=s/-(rc|beta)/$1/" \
+ ftp://ftp.mysql.com/pub/mysql/src/mysql-([\d\.]*(?:-beta|-rc)?).tar.gz debian
diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt
index a7a5e3e7b66..8608e72127b 100755
--- a/extra/CMakeLists.txt
+++ b/extra/CMakeLists.txt
@@ -12,6 +12,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
@@ -45,3 +46,9 @@ TARGET_LINK_LIBRARIES(perror strings mysys dbug wsock32)
ADD_EXECUTABLE(replace replace.c)
TARGET_LINK_LIBRARIES(replace strings mysys dbug wsock32)
+
+IF(EMBED_MANIFESTS)
+ MYSQL_EMBED_MANIFEST("my_print_defaults" "asInvoker")
+ MYSQL_EMBED_MANIFEST("perror" "asInvoker")
+ MYSQL_EMBED_MANIFEST("replace" "asInvoker")
+ENDIF(EMBED_MANIFESTS)
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index eb077f91ece..f5f7e68c9e6 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -33,7 +33,20 @@ const char *default_dbug_option="d:t:o,/tmp/my_print_defaults.trace";
static struct my_option my_long_options[] =
{
- {"config-file", 'c', "The config file to be used.",
+ /*
+ NB: --config-file is troublesome, because get_defaults_options() doesn't
+ know about it, but we pretend --config-file is like --defaults-file. In
+ fact they behave differently: see the comments at the top of
+ mysys/default.c for how --defaults-file should behave.
+
+ This --config-file option behaves as:
+ - If it has a directory name part (absolute or relative), then only this
+ file is read; no error is given if the file doesn't exist
+ - If the file has no directory name part, the standard locations are
+ searched for a file of this name (and standard filename extensions are
+ added if the file has no extension)
+ */
+ {"config-file", 'c', "Deprecated, please use --defaults-file instead. Name of config file to read; if no extension is given, default extension (e.g., .ini or .cnf) will be added",
(gptr*) &config_file, (gptr*) &config_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF
@@ -43,11 +56,11 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log", (gptr*) &default_dbug_option,
(gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"defaults-file", 'c', "Synonym for --config-file.",
+ {"defaults-file", 'c', "Like --config-file, except: if first option, then read this file only, do not read global or per-user config files; should be the first option",
(gptr*) &config_file, (gptr*) &config_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"defaults-extra-file", 'e',
- "Read this file after the global /etc config file and before the config file in the users home directory.",
+ "Read this file after the global config file and before the config file in the users home directory; should be the first option",
(gptr*) &my_defaults_extra_file, (gptr*) &my_defaults_extra_file, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"defaults-group-suffix", 'g',
@@ -55,7 +68,7 @@ static struct my_option my_long_options[] =
(gptr*) &my_defaults_group_suffix, (gptr*) &my_defaults_group_suffix,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"extra-file", 'e',
- "Synonym for --defaults-extra-file.",
+ "Deprecated. Synonym for --defaults-extra-file.",
(gptr*) &my_defaults_extra_file,
(gptr*) &my_defaults_extra_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -86,7 +99,7 @@ static void usage(my_bool version)
my_print_help(my_long_options);
my_print_default_files(config_file);
my_print_variables(my_long_options);
- printf("\nExample usage:\n%s --config-file=my client mysql\n", my_progname);
+ printf("\nExample usage:\n%s --defaults-file=example.cnf client mysql\n", my_progname);
}
#include <help_end.h>
diff --git a/extra/yassl/taocrypt/src/misc.cpp b/extra/yassl/taocrypt/src/misc.cpp
index 726d9e630e6..402645c93fd 100644
--- a/extra/yassl/taocrypt/src/misc.cpp
+++ b/extra/yassl/taocrypt/src/misc.cpp
@@ -192,27 +192,32 @@ bool HaveCpuId()
}
return true;
#else
- typedef void (*SigHandler)(int);
-
- SigHandler oldHandler = signal(SIGILL, SigIllHandler);
- if (oldHandler == SIG_ERR)
- return false;
-
- bool result = true;
- if (setjmp(s_env))
- result = false;
- else
+ word32 eax, ebx;
__asm__ __volatile
(
- // save ebx in case -fPIC is being used
- "push %%ebx; mov $0, %%eax; cpuid; pop %%ebx"
- :
+ /* Put EFLAGS in eax and ebx */
+ "pushf;"
+ "pushf;"
+ "pop %0;"
+ "movl %0,%1;"
+
+ /* Flip the cpuid bit and store back in EFLAGS */
+ "xorl $0x200000,%0;"
+ "push %0;"
+ "popf;"
+
+ /* Read EFLAGS again */
+ "pushf;"
+ "pop %0;"
+ "popf"
+ : "=r" (eax), "=r" (ebx)
:
- : "%eax", "%ecx", "%edx"
+ : "cc"
);
- signal(SIGILL, oldHandler);
- return result;
+ if (eax == ebx)
+ return false;
+ return true;
#endif
}
diff --git a/include/Makefile.am b/include/Makefile.am
index 9cd2f6215f1..ccd5ac627bf 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -22,10 +22,10 @@ HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \
pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
my_xml.h mysql_embed.h \
my_pthread.h my_no_pthread.h raid.h \
- errmsg.h my_global.h my_net.h \
+ decimal.h errmsg.h my_global.h my_net.h \
my_getopt.h sslopt-longopts.h my_dir.h \
sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
- m_ctype.h $(HEADERS_GEN)
+ m_ctype.h my_attribute.h $(HEADERS_GEN)
noinst_HEADERS = config-win.h config-os2.h config-netware.h \
heap.h my_bitmap.h\
myisam.h myisampack.h myisammrg.h ft_global.h\
@@ -33,7 +33,7 @@ noinst_HEADERS = config-win.h config-os2.h config-netware.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
my_aes.h my_tree.h hash.h thr_alarm.h \
thr_lock.h t_ctype.h violite.h md5.h base64.h \
- mysql_version.h.in my_handler.h my_time.h decimal.h \
+ mysql_version.h.in my_handler.h my_time.h \
my_user.h my_libwrap.h
# Remove built files and the symlinked directories
diff --git a/include/abi_check b/include/abi_check
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/include/abi_check
+++ /dev/null
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_ctype.h b/include/m_ctype.h
index 50a50b7ed12..f33fd015733 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -21,6 +21,8 @@
#ifndef _m_ctype_h
#define _m_ctype_h
+#include <my_attribute.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/include/my_attribute.h b/include/my_attribute.h
new file mode 100644
index 00000000000..8309d85f20a
--- /dev/null
+++ b/include/my_attribute.h
@@ -0,0 +1,63 @@
+/* Copyright (C) 2000-2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
+ Helper macros used for setting different __attributes__
+ on functions in a portable fashion
+*/
+
+#ifndef _my_attribute_h
+#define _my_attribute_h
+
+/*
+ Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers.
+ Some forms of __attribute__ are actually supported in earlier versions of
+ g++, but we just disable them all because we only use them to generate
+ compilation warnings.
+*/
+#ifndef __attribute__
+# if !defined(__GNUC__)
+# define __attribute__(A)
+# elif GCC_VERSION < 2008
+# define __attribute__(A)
+# elif defined(__cplusplus) && GCC_VERSION < 3004
+# define __attribute__(A)
+# endif
+#endif
+
+/*
+ __attribute__((format(...))) is only supported in gcc >= 2.8 and g++ >= 3.4
+ But that's already covered by the __attribute__ tests above, so this is
+ just a convenience macro.
+*/
+#ifndef ATTRIBUTE_FORMAT
+# define ATTRIBUTE_FORMAT(style, m, n) __attribute__((format(style, m, n)))
+#endif
+
+/*
+
+ __attribute__((format(...))) on a function pointer is not supported
+ until gcc 3.1
+*/
+#ifndef ATTRIBUTE_FORMAT_FPTR
+# if (GCC_VERSION >= 3001)
+# define ATTRIBUTE_FORMAT_FPTR(style, m, n) ATTRIBUTE_FORMAT(style, m, n)
+# else
+# define ATTRIBUTE_FORMAT_FPTR(style, m, n)
+# endif /* GNUC >= 3.1 */
+#endif
+
+
+#endif
diff --git a/include/my_global.h b/include/my_global.h
index 61c2afc541b..f32a987ffb1 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -86,6 +86,14 @@
#endif
#endif /* _WIN32... */
+/* Make it easier to add conditionl code for windows */
+#ifdef __WIN__
+#define IF_WIN(A,B) (A)
+#else
+#define IF_WIN(A,B) (B)
+#endif
+
+
/* Some defines to avoid ifdefs in the code */
#ifndef NETWARE_YIELD
#define NETWARE_YIELD
@@ -497,43 +505,7 @@ typedef unsigned short ushort;
#define my_const_cast(A) (A)
#endif
-/*
- Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers.
- Some forms of __attribute__ are actually supported in earlier versions of
- g++, but we just disable them all because we only use them to generate
- compilation warnings.
-*/
-#ifndef __attribute__
-# if !defined(__GNUC__)
-# define __attribute__(A)
-# elif GCC_VERSION < 2008
-# define __attribute__(A)
-# elif defined(__cplusplus) && GCC_VERSION < 3004
-# define __attribute__(A)
-# endif
-#endif
-
-/*
- __attribute__((format(...))) is only supported in gcc >= 2.8 and g++ >= 3.4
- But that's already covered by the __attribute__ tests above, so this is
- just a convenience macro.
-*/
-#ifndef ATTRIBUTE_FORMAT
-# define ATTRIBUTE_FORMAT(style, m, n) __attribute__((format(style, m, n)))
-#endif
-
-/*
-
- __attribute__((format(...))) on a function pointer is not supported
- until gcc 3.1
-*/
-#ifndef ATTRIBUTE_FORMAT_FPTR
-# if (GCC_VERSION >= 3001)
-# define ATTRIBUTE_FORMAT_FPTR(style, m, n) ATTRIBUTE_FORMAT(style, m, n)
-# else
-# define ATTRIBUTE_FORMAT_FPTR(style, m, n)
-# endif /* GNUC >= 3.1 */
-#endif
+#include <my_attribute.h>
/*
Wen using the embedded library, users might run into link problems,
@@ -812,8 +784,19 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define SSIZE_MAX ((~((size_t) 0)) / 2)
#endif
-#if !defined(HAVE_ISINF) && !defined(isinf)
-#define isinf(X) 0
+#ifndef HAVE_FINITE
+#define finite(x) (1.0 / fabs(x) > 0.0)
+#endif
+
+#ifndef HAVE_ISNAN
+#define isnan(x) ((x) != (x))
+#endif
+
+#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 63a1faf3995..7df2718c7b1 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -31,10 +31,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#include <my_pthread.h>
#endif
-#ifndef _m_ctype_h
#include <m_ctype.h> /* for CHARSET_INFO */
-#endif
-
#include <stdarg.h>
#include <typelib.h>
@@ -69,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/innobase/configure.in b/innobase/configure.in
index c56bd8274c4..99c8c91dbf3 100644
--- a/innobase/configure.in
+++ b/innobase/configure.in
@@ -102,6 +102,8 @@ case "$target_os" in
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
osf*)
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
+ *solaris*|*SunOS*)
+ CFLAGS="$CFLAGS -DUNIV_SOLARIS";;
sysv5uw7*)
# Problem when linking on SCO
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index 72f1f837fee..7133b28ecb2 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -301,7 +301,7 @@ os_file_get_last_error(
fflush(stderr);
- if (err == ENOSPC ) {
+ if (err == ENOSPC) {
return(OS_FILE_DISK_FULL);
#ifdef POSIX_ASYNC_IO
} else if (err == EAGAIN) {
@@ -320,15 +320,20 @@ os_file_get_last_error(
}
/********************************************************************
-Does error handling when a file operation fails. */
+Does error handling when a file operation fails.
+Conditionally exits (calling exit(3)) based on should_exit value and the
+error type */
+
static
ibool
-os_file_handle_error(
-/*=================*/
- /* out: TRUE if we should retry the
- operation */
- const char* name, /* in: name of a file or NULL */
- const char* operation)/* in: operation */
+os_file_handle_error_cond_exit(
+/*===========================*/
+ /* out: TRUE if we should retry the
+ operation */
+ const char* name, /* in: name of a file or NULL */
+ const char* operation, /* in: operation */
+ ibool should_exit) /* in: call exit(3) if unknown error
+ and this parameter is TRUE */
{
ulint err;
@@ -357,11 +362,9 @@ os_file_handle_error(
fflush(stderr);
return(FALSE);
-
} else if (err == OS_FILE_AIO_RESOURCES_RESERVED) {
return(TRUE);
-
} else if (err == OS_FILE_ALREADY_EXISTS
|| err == OS_FILE_PATH_ERROR) {
@@ -373,16 +376,49 @@ os_file_handle_error(
fprintf(stderr, "InnoDB: File operation call: '%s'.\n",
operation);
- fprintf(stderr, "InnoDB: Cannot continue operation.\n");
- fflush(stderr);
+ if (should_exit) {
+ fprintf(stderr, "InnoDB: Cannot continue operation.\n");
- exit(1);
+ fflush(stderr);
+
+ exit(1);
+ }
}
return(FALSE);
}
+/********************************************************************
+Does error handling when a file operation fails. */
+static
+ibool
+os_file_handle_error(
+/*=================*/
+ /* out: TRUE if we should retry the
+ operation */
+ const char* name, /* in: name of a file or NULL */
+ const char* operation)/* in: operation */
+{
+ /* exit in case of unknown error */
+ return(os_file_handle_error_cond_exit(name, operation, TRUE));
+}
+
+/********************************************************************
+Does error handling when a file operation fails. */
+static
+ibool
+os_file_handle_error_no_exit(
+/*=========================*/
+ /* out: TRUE if we should retry the
+ operation */
+ const char* name, /* in: name of a file or NULL */
+ const char* operation)/* in: operation */
+{
+ /* don't exit in case of unknown error */
+ return(os_file_handle_error_cond_exit(name, operation, FALSE));
+}
+
#undef USE_FILE_LOCK
#define USE_FILE_LOCK
#if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__FreeBSD__) || defined(__NETWARE__)
@@ -425,66 +461,6 @@ os_file_lock(
#endif /* USE_FILE_LOCK */
/********************************************************************
-Does error handling when a file operation fails. */
-static
-ibool
-os_file_handle_error_no_exit(
-/*=========================*/
- /* out: TRUE if we should retry the
- operation */
- const char* name, /* in: name of a file or NULL */
- const char* operation)/* in: operation */
-{
- ulint err;
-
- err = os_file_get_last_error(FALSE);
-
- if (err == OS_FILE_DISK_FULL) {
- /* We only print a warning about disk full once */
-
- if (os_has_said_disk_full) {
-
- return(FALSE);
- }
-
- if (name) {
- ut_print_timestamp(stderr);
- fprintf(stderr,
- " InnoDB: Encountered a problem with file %s\n", name);
- }
-
- ut_print_timestamp(stderr);
- fprintf(stderr,
- " InnoDB: Disk is full. Try to clean the disk to free space.\n");
-
- os_has_said_disk_full = TRUE;
-
- fflush(stderr);
-
- return(FALSE);
-
- } else if (err == OS_FILE_AIO_RESOURCES_RESERVED) {
-
- return(TRUE);
-
- } else if (err == OS_FILE_ALREADY_EXISTS
- || err == OS_FILE_PATH_ERROR) {
-
- return(FALSE);
- } else {
- if (name) {
- fprintf(stderr, "InnoDB: File name %s\n", name);
- }
-
- fprintf(stderr, "InnoDB: File operation call: '%s'.\n",
- operation);
- return (FALSE);
- }
-
- return(FALSE); /* not reached */
-}
-
-/********************************************************************
Creates the seek mutexes used in positioned reads and writes. */
void
@@ -1117,6 +1093,51 @@ os_file_create_simple_no_error_handling(
}
/********************************************************************
+Tries to disable OS caching on an opened file descriptor. */
+
+void
+os_file_set_nocache(
+/*================*/
+ int fd, /* in: file descriptor to alter */
+ const char* file_name, /* in: used in the diagnostic message */
+ const char* operation_name) /* in: used in the diagnostic message,
+ we call os_file_set_nocache()
+ immediately after opening or creating
+ a file, so this is either "open" or
+ "create" */
+{
+ /* some versions of Solaris may not have DIRECTIO_ON */
+#if defined(UNIV_SOLARIS) && defined(DIRECTIO_ON)
+ if (directio(fd, DIRECTIO_ON) == -1) {
+ int errno_save;
+ errno_save = (int)errno;
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Failed to set DIRECTIO_ON "
+ "on file %s: %s: %s, continuing anyway\n",
+ file_name, operation_name, strerror(errno_save));
+ }
+#elif defined(O_DIRECT)
+ if (fcntl(fd, F_SETFL, O_DIRECT) == -1) {
+ int errno_save;
+ errno_save = (int)errno;
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Failed to set O_DIRECT "
+ "on file %s: %s: %s, continuing anyway\n",
+ file_name, operation_name, strerror(errno_save));
+ if (errno_save == EINVAL) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: O_DIRECT is known to result in "
+ "'Invalid argument' on Linux on tmpfs, "
+ "see MySQL Bug#26662\n");
+ }
+ }
+#endif
+}
+
+/********************************************************************
Opens an existing file or creates a new. */
os_file_t
@@ -1294,21 +1315,8 @@ try_again:
create_flag = create_flag | O_SYNC;
}
#endif
-#ifdef O_DIRECT
- /* We let O_DIRECT only affect data files */
- if (type != OS_LOG_FILE
- && srv_unix_file_flush_method == SRV_UNIX_O_DIRECT) {
-
-/* fprintf(stderr, "Using O_DIRECT for file %s\n", name); */
- create_flag = create_flag | O_DIRECT;
- }
-#endif
- if (create_mode == OS_FILE_CREATE) {
- file = open(name, create_flag, os_innodb_umask);
- } else {
- file = open(name, create_flag);
- }
+ file = open(name, create_flag, os_innodb_umask);
if (file == -1) {
*success = FALSE;
@@ -1318,11 +1326,24 @@ try_again:
"create" : "open");
if (retry) {
goto try_again;
+ } else {
+ return(file /* -1 */);
}
+ }
+ /* else */
+
+ *success = TRUE;
+
+ /* We disable OS caching (O_DIRECT) only on data files */
+ if (type != OS_LOG_FILE
+ && srv_unix_file_flush_method == SRV_UNIX_O_DIRECT) {
+
+ os_file_set_nocache(file, name, mode_str);
+ }
+
#ifdef USE_FILE_LOCK
- } else if (create_mode != OS_FILE_OPEN_RAW
- && os_file_lock(file, name)) {
- *success = FALSE;
+ if (create_mode != OS_FILE_OPEN_RAW && os_file_lock(file, name)) {
+
if (create_mode == OS_FILE_OPEN_RETRY) {
int i;
ut_print_timestamp(stderr);
@@ -1339,12 +1360,12 @@ try_again:
fputs(" InnoDB: Unable to open the first data file\n",
stderr);
}
+
+ *success = FALSE;
close(file);
file = -1;
-#endif
- } else {
- *success = TRUE;
}
+#endif /* USE_FILE_LOCK */
return(file);
#endif /* __WIN__ */
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index db4368a3534..3b18531f6c0 100755
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -12,11 +12,16 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
# Need to set USE_TLS, since __declspec(thread) approach to thread local
# 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
@@ -67,3 +72,7 @@ TARGET_LINK_LIBRARIES(libmysql mysys strings wsock32)
ADD_EXECUTABLE(myTest mytest.c)
TARGET_LINK_LIBRARIES(myTest libmysql)
+
+IF(EMBED_MANIFESTS)
+ MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
+ENDIF(EMBED_MANIFESTS)
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/CMakeLists.txt b/myisam/CMakeLists.txt
index 28d06254e8a..94a7ffc9952 100755
--- a/myisam/CMakeLists.txt
+++ b/myisam/CMakeLists.txt
@@ -12,6 +12,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
@@ -39,3 +40,10 @@ TARGET_LINK_LIBRARIES(myisamlog myisam mysys dbug strings zlib wsock32)
ADD_EXECUTABLE(myisampack myisampack.c)
TARGET_LINK_LIBRARIES(myisampack myisam mysys dbug strings zlib wsock32)
+
+IF(EMBED_MANIFESTS)
+ MYSQL_EMBED_MANIFEST("myisam_ftdump" "asInvoker")
+ MYSQL_EMBED_MANIFEST("myisamchk" "asInvoker")
+ MYSQL_EMBED_MANIFEST("myisamlog" "asInvoker")
+ MYSQL_EMBED_MANIFEST("myisampack" "asInvoker")
+ENDIF(EMBED_MANIFESTS)
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/mi_info.c b/myisam/mi_info.c
index 0435269ed6d..b7de8e7b37d 100644
--- a/myisam/mi_info.c
+++ b/myisam/mi_info.c
@@ -57,9 +57,9 @@ int mi_status(MI_INFO *info, register MI_ISAMINFO *x, uint flag)
x->keys = share->state.header.keys;
x->check_time = share->state.check_time;
- x->mean_reclength = info->state->records ?
- (ulong) ((info->state->data_file_length-info->state->empty)/
- info->state->records) : (ulong) share->min_pack_length;
+ x->mean_reclength= x->records ?
+ (ulong) ((x->data_file_length - x->delete_length) / x->records) :
+ (ulong) share->min_pack_length;
}
if (flag & HA_STATUS_ERRKEY)
{
diff --git a/myisam/mi_rkey.c b/myisam/mi_rkey.c
index 6323c95ffd7..83259a275b1 100644
--- a/myisam/mi_rkey.c
+++ b/myisam/mi_rkey.c
@@ -49,7 +49,7 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len,
key_buff=info->lastkey+info->s->base.max_key_length;
pack_key_length= key_len;
bmove(key_buff,key,key_len);
- last_used_keyseg= 0;
+ last_used_keyseg= info->s->keyinfo[inx].seg + info->last_used_keyseg;
}
else
{
@@ -61,6 +61,8 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len,
key_len, &last_used_keyseg);
/* Save packed_key_length for use by the MERGE engine. */
info->pack_key_length= pack_key_length;
+ info->last_used_keyseg= (uint16) (last_used_keyseg -
+ info->s->keyinfo[inx].seg);
DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE, keyinfo->seg,
key_buff, pack_key_length););
}
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h
index 0733073a7ea..1a04cbe74fc 100644
--- a/myisam/myisamdef.h
+++ b/myisam/myisamdef.h
@@ -263,6 +263,7 @@ struct st_myisam_info {
enum ha_rkey_function last_key_func; /* CONTAIN, OVERLAP, etc */
uint save_lastkey_length;
uint pack_key_length; /* For MYISAMMRG */
+ uint16 last_used_keyseg; /* For MyISAMMRG */
int errkey; /* Got last error on this key */
int lock_type; /* How database was locked */
int tmp_lock_type; /* When locked by readinfo */
diff --git a/myisam/sort.c b/myisam/sort.c
index e4c01ac939d..f918283503e 100644
--- a/myisam/sort.c
+++ b/myisam/sort.c
@@ -151,7 +151,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
keys < (uint) maxbuffer)
{
mi_check_print_error(info->sort_info->param,
- "sort_buffer_size is to small");
+ "myisam_sort_buffer_size is too small");
goto err;
}
}
@@ -175,7 +175,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
}
if (memavl < MIN_SORT_MEMORY)
{
- mi_check_print_error(info->sort_info->param,"Sort buffer to small"); /* purecov: tested */
+ mi_check_print_error(info->sort_info->param,"MyISAM sort buffer too small"); /* purecov: tested */
goto err; /* purecov: tested */
}
(*info->lock_in_memory)(info->sort_info->param);/* Everything is allocated */
@@ -369,7 +369,7 @@ pthread_handler_t thr_find_all_keys(void *arg)
keys < (uint) maxbuffer)
{
mi_check_print_error(sort_param->sort_info->param,
- "sort_buffer_size is to small");
+ "myisam_sort_buffer_size is too small");
goto err;
}
}
@@ -397,7 +397,7 @@ pthread_handler_t thr_find_all_keys(void *arg)
if (memavl < MIN_SORT_MEMORY)
{
mi_check_print_error(sort_param->sort_info->param,
- "Sort buffer too small");
+ "MyISAM sort buffer too small");
goto err; /* purecov: tested */
}
@@ -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/myisammrg/myrg_rkey.c b/myisammrg/myrg_rkey.c
index f7b7f082019..0f9e9a9b822 100644
--- a/myisammrg/myrg_rkey.c
+++ b/myisammrg/myrg_rkey.c
@@ -40,12 +40,14 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key,
{
byte *key_buff;
uint pack_key_length;
+ uint16 last_used_keyseg;
MYRG_TABLE *table;
MI_INFO *mi;
int err;
DBUG_ENTER("myrg_rkey");
LINT_INIT(key_buff);
LINT_INIT(pack_key_length);
+ LINT_INIT(last_used_keyseg);
if (_myrg_init_queue(info,inx,search_flag))
DBUG_RETURN(my_errno);
@@ -60,10 +62,12 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key,
/* Get the saved packed key and packed key length. */
key_buff=(byte*) mi->lastkey+mi->s->base.max_key_length;
pack_key_length=mi->pack_key_length;
+ last_used_keyseg= mi->last_used_keyseg;
}
else
{
mi->once_flags|= USE_PACKED_KEYS;
+ mi->last_used_keyseg= last_used_keyseg;
err=mi_rkey(mi,0,inx,key_buff,pack_key_length,search_flag);
}
info->last_used_table=table+1;
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index d48b8c7dfe4..6c7207b0b2d 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -33,7 +33,7 @@ endif
benchdir_root= $(prefix)
testdir = $(benchdir_root)/mysql-test
EXTRA_SCRIPTS = mysql-test-run-shell.sh install_test_db.sh valgrind.supp $(PRESCRIPTS)
-EXTRA_DIST = $(EXTRA_SCRIPTS)
+EXTRA_DIST = $(EXTRA_SCRIPTS) suite
GENSCRIPTS = mysql-test-run-shell mysql-test-run install_test_db mtr
PRESCRIPTS = mysql-test-run.pl
test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS)
@@ -67,6 +67,7 @@ dist-hook:
$(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib
+ -rm -rf `find $(distdir)/suite -type d -name SCCS`
install-data-local:
$(mkinstalldirs) \
@@ -98,6 +99,12 @@ install-data-local:
$(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib
+ for f in `(cd $(srcdir); find suite -type f | grep -v SCCS)`; \
+ do \
+ d=$(DESTDIR)$(testdir)/`dirname $$f`; \
+ mkdir -p $$d ; \
+ $(INSTALL_DATA) $(srcdir)/$$f $$d ; \
+ done
uninstall-local:
@RM@ -f -r $(DESTDIR)$(testdir)
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/have_lowercase1.inc b/mysql-test/include/have_lowercase1.inc
new file mode 100644
index 00000000000..1b33432dbe3
--- /dev/null
+++ b/mysql-test/include/have_lowercase1.inc
@@ -0,0 +1,4 @@
+--require r/lowercase1.require
+--disable_query_log
+show variables like 'lower_case_table_names';
+--enable_query_log
diff --git a/mysql-test/include/ps_conv.inc b/mysql-test/include/ps_conv.inc
index 09290d760ce..195d1061664 100644
--- a/mysql-test/include/ps_conv.inc
+++ b/mysql-test/include/ps_conv.inc
@@ -1171,7 +1171,7 @@ execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
######## SELECT .. WHERE column(date/time/..)=value(DATETIME/LONGBLOB) ########
set @arg00= CAST('1991-01-01 01:01:01' as datetime) ;
select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
@@ -1180,7 +1180,7 @@ select 'true' as found from t9
where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
and c17= @arg00 ;
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index 28c78fbffeb..1d157ea3401 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -354,6 +354,13 @@ sub collect_one_test_case($$$$$$$) {
next;
}
+ $value= mtr_match_prefix($opt, "--slave-num=");
+ if ( defined $value )
+ {
+ $tinfo->{'slave_num'}= $value;
+ next;
+ }
+
$value= mtr_match_prefix($opt, "--result-file=");
if ( defined $value )
{
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index 53bf37bcc83..ac2e049a67c 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -1099,6 +1099,13 @@ sub mtr_kill_processes ($) {
foreach my $pid (@$pids)
{
+
+ if ($pid <= 0)
+ {
+ mtr_warning("Trying to kill illegal pid: $pid");
+ next;
+ }
+
foreach my $sig (15, 9)
{
last if mtr_im_kill_process([ $pid ], $sig, 10, 1);
diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl
index 2a90344c110..d08208d37a6 100644
--- a/mysql-test/lib/mtr_report.pl
+++ b/mysql-test/lib/mtr_report.pl
@@ -238,7 +238,7 @@ sub mtr_report_stats ($) {
}
if (!$::opt_extern)
{
- print "The servers where restarted $tot_restarts times\n";
+ print "The servers were restarted $tot_restarts times\n";
}
if ( $::opt_timer )
@@ -295,6 +295,18 @@ sub mtr_report_stats ($) {
}
}
}
+
+ if ( $::opt_check_testcases )
+ {
+ # Look for warnings produced by mysqltest in testname.warnings
+ foreach my $test_warning_file
+ ( glob("$::glob_mysql_test_dir/r/*.warnings") )
+ {
+ $found_problems= 1;
+ print WARN "Check myqltest warnings in $test_warning_file\n";
+ }
+ }
+
if ( $found_problems )
{
mtr_warning("Got errors/warnings while running tests, please examine",
@@ -345,7 +357,7 @@ sub mtr_report_stats ($) {
if ( $tot_failed != 0 || $found_problems)
{
- mtr_error("there where failing test cases");
+ mtr_error("there were failing test cases");
}
}
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index cbd7ccd5bbd..82405b62f18 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -570,6 +570,7 @@ sub command_line_setup () {
'manual-debug' => \$opt_manual_debug,
'ddd' => \$opt_ddd,
'client-ddd' => \$opt_client_ddd,
+ 'manual-ddd' => \$opt_manual_ddd,
'debugger=s' => \$opt_debugger,
'client-debugger=s' => \$opt_client_debugger,
'strace-client' => \$opt_strace_client,
@@ -724,8 +725,6 @@ sub command_line_setup () {
{
$mysqld_variables{'port'}= 3306;
$mysqld_variables{'master-port'}= 3306;
- $opt_skip_ndbcluster= 1;
- $opt_skip_im= 1;
}
if ( $opt_comment )
@@ -1072,7 +1071,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]=
{
@@ -1235,6 +1234,7 @@ sub command_line_setup () {
{
# Turn off features not supported when running with extern server
$opt_skip_rpl= 1;
+ $opt_skip_ndbcluster= 1;
# Setup master->[0] with the settings for the extern server
$master->[0]->{'path_sock'}= $opt_socket ? $opt_socket : "/tmp/mysql.sock";
@@ -2023,10 +2023,7 @@ sub environment_setup () {
$ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
}
- if (!$opt_extern)
- {
- $ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables;
- }
+ $ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables;
# ----------------------------------------------------
# Setup env so childs can execute my_print_defaults
@@ -4842,8 +4839,7 @@ sub gdb_arguments {
if ( $opt_manual_gdb )
{
print "\nTo start gdb for $type, type in another window:\n";
- print "cd $glob_mysql_test_dir;\n";
- print "gdb -x $gdb_init_file $$exe\n";
+ print "gdb -cd $glob_mysql_test_dir -x $gdb_init_file $$exe\n";
# Indicate the exe should not be started
$$exe= undef;
@@ -4907,8 +4903,7 @@ sub ddd_arguments {
if ( $opt_manual_ddd )
{
print "\nTo start ddd for $type, type in another window:\n";
- print "cd $glob_mysql_test_dir;\n";
- print "ddd -x $gdb_init_file $$exe\n";
+ print "ddd -cd $glob_mysql_test_dir -x $gdb_init_file $$exe\n";
# Indicate the exe should not be started
$$exe= undef;
@@ -5127,6 +5122,8 @@ Options for debugging the product
running test(s)
manual-gdb Let user manually start mysqld in gdb, before running
test(s)
+ manual-ddd Let user manually start mysqld in ddd, before running
+ test(s)
master-binary=PATH Specify the master "mysqld" to use
slave-binary=PATH Specify the slave "mysqld" to use
strace-client Create strace output for mysqltest client
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 82c35ff963a..280cedb8b89 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -860,3 +860,27 @@ ALTER TABLE t1 ADD d INT;
ALTER TABLE t1 ADD KEY (d(20));
ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
DROP TABLE t1;
+create table t1(id int(8) primary key auto_increment) engine=heap;
+insert into t1 values (null);
+insert into t1 values (null);
+select * from t1;
+id
+1
+2
+alter table t1 auto_increment = 50;
+alter table t1 engine = myisam;
+insert into t1 values (null);
+select * from t1;
+id
+1
+2
+50
+alter table t1 engine = heap;
+insert into t1 values (null);
+select * from t1;
+id
+1
+2
+50
+51
+drop table t1;
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/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..e1262c7d2c2 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -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/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/distinct.result b/mysql-test/r/distinct.result
index 190e8595126..8525e0f19e4 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -633,7 +633,7 @@ EXPLAIN SELECT (SELECT DISTINCT ADDDATE(a,1) FROM t1
WHERE ADDDATE(a,1) = '2002-08-03');
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
-2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where; Using temporary
+2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where
CREATE TABLE t2 (a CHAR(5) CHARACTER SET latin1 COLLATE latin1_general_ci);
INSERT INTO t2 VALUES (0xf6);
INSERT INTO t2 VALUES ('oe');
diff --git a/mysql-test/r/fix_priv_tabs.result b/mysql-test/r/fix_priv_tabs.result
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/mysql-test/r/fix_priv_tabs.result
+++ /dev/null
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 7c9069791fa..f6efe2411c0 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -456,3 +456,10 @@ a FORMAT(MATCH(a) AGAINST('test1 test'),6)
test1 0.685267
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(255), FULLTEXT(a));
+SELECT * FROM t1 IGNORE INDEX(a) WHERE MATCH(a) AGAINST('test');
+a
+ALTER TABLE t1 DISABLE KEYS;
+SELECT * FROM t1 WHERE MATCH(a) AGAINST('test');
+ERROR HY000: Can't find FULLTEXT index matching the column list
+DROP TABLE t1;
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 71419b5b2c3..20df776ec1b 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -737,4 +737,30 @@ 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;
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..a3e0773649f 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -467,6 +467,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_math.result b/mysql-test/r/func_math.result
index fc9bfb3b612..ace94217fdc 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -143,9 +143,6 @@ select format(col2,6) from t1 where col1=7;
format(col2,6)
1,234,567,890,123,456.123450
drop table t1;
-select round(150, 2);
-round(150, 2)
-150.00
select ceil(0.09);
ceil(0.09)
1
@@ -156,11 +153,11 @@ create table t1 select round(1, 6);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `round(1, 6)` decimal(7,6) NOT NULL default '0.000000'
+ `round(1, 6)` int(1) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
round(1, 6)
-1.000000
+1
drop table t1;
select abs(-2) * -2;
abs(-2) * -2
@@ -238,3 +235,91 @@ format(t2.f2-t2.f1+1,0)
10,000
drop table t1, t2;
set names default;
+select cast(-2 as unsigned), 18446744073709551614, -2;
+cast(-2 as unsigned) 18446744073709551614 -2
+18446744073709551614 18446744073709551614 -2
+select abs(cast(-2 as unsigned)), abs(18446744073709551614), abs(-2);
+abs(cast(-2 as unsigned)) abs(18446744073709551614) abs(-2)
+18446744073709551614 18446744073709551614 2
+select ceiling(cast(-2 as unsigned)), ceiling(18446744073709551614), ceiling(-2);
+ceiling(cast(-2 as unsigned)) ceiling(18446744073709551614) ceiling(-2)
+18446744073709551614 18446744073709551614 -2
+select floor(cast(-2 as unsigned)), floor(18446744073709551614), floor(-2);
+floor(cast(-2 as unsigned)) floor(18446744073709551614) floor(-2)
+18446744073709551614 18446744073709551614 -2
+select format(cast(-2 as unsigned), 2), format(18446744073709551614, 2), format(-2, 2);
+format(cast(-2 as unsigned), 2) format(18446744073709551614, 2) format(-2, 2)
+18,446,744,073,709,551,614.00 18,446,744,073,709,551,614.00 -2.00
+select sqrt(cast(-2 as unsigned)), sqrt(18446744073709551614), sqrt(-2);
+sqrt(cast(-2 as unsigned)) sqrt(18446744073709551614) sqrt(-2)
+4294967296 4294967296 NULL
+select round(cast(-2 as unsigned), 1), round(18446744073709551614, 1), round(-2, 1);
+round(cast(-2 as unsigned), 1) round(18446744073709551614, 1) round(-2, 1)
+18446744073709551614 18446744073709551614 -2
+select round(4, cast(-2 as unsigned)), round(4, 18446744073709551614), round(4, -2);
+round(4, cast(-2 as unsigned)) round(4, 18446744073709551614) round(4, -2)
+4 4 0
+select truncate(cast(-2 as unsigned), 1), truncate(18446744073709551614, 1), truncate(-2, 1);
+truncate(cast(-2 as unsigned), 1) truncate(18446744073709551614, 1) truncate(-2, 1)
+18446744073709551614 18446744073709551614 -2
+select truncate(4, cast(-2 as unsigned)), truncate(4, 18446744073709551614), truncate(4, -2);
+truncate(4, cast(-2 as unsigned)) truncate(4, 18446744073709551614) truncate(4, -2)
+4 4 0
+select round(10000000000000000000, -19), truncate(10000000000000000000, -19);
+round(10000000000000000000, -19) truncate(10000000000000000000, -19)
+10000000000000000000 10000000000000000000
+select round(1e0, -309), truncate(1e0, -309);
+round(1e0, -309) truncate(1e0, -309)
+0 0
+select round(1e1,308), truncate(1e1, 308);
+round(1e1,308) truncate(1e1, 308)
+10 10
+select round(1e1, 2147483648), truncate(1e1, 2147483648);
+round(1e1, 2147483648) truncate(1e1, 2147483648)
+10 10
+select round(1.1e1, 4294967295), truncate(1.1e1, 4294967295);
+round(1.1e1, 4294967295) truncate(1.1e1, 4294967295)
+11 11
+select round(1.12e1, 4294967296), truncate(1.12e1, 4294967296);
+round(1.12e1, 4294967296) truncate(1.12e1, 4294967296)
+11.2 11.2
+select round(1.5, 2147483640), truncate(1.5, 2147483640);
+round(1.5, 2147483640) truncate(1.5, 2147483640)
+1.500000000000000000000000000000 1.500000000000000000000000000000
+select round(1.5, -2147483649), round(1.5, 2147483648);
+round(1.5, -2147483649) round(1.5, 2147483648)
+0 1.500000000000000000000000000000
+select truncate(1.5, -2147483649), truncate(1.5, 2147483648);
+truncate(1.5, -2147483649) truncate(1.5, 2147483648)
+0 1.500000000000000000000000000000
+select round(1.5, -4294967296), round(1.5, 4294967296);
+round(1.5, -4294967296) round(1.5, 4294967296)
+0 1.500000000000000000000000000000
+select truncate(1.5, -4294967296), truncate(1.5, 4294967296);
+truncate(1.5, -4294967296) truncate(1.5, 4294967296)
+0 1.500000000000000000000000000000
+select round(1.5, -9223372036854775808), round(1.5, 9223372036854775808);
+round(1.5, -9223372036854775808) round(1.5, 9223372036854775808)
+0 1.500000000000000000000000000000
+select truncate(1.5, -9223372036854775808), truncate(1.5, 9223372036854775808);
+truncate(1.5, -9223372036854775808) truncate(1.5, 9223372036854775808)
+0 1.500000000000000000000000000000
+select round(1.5, 18446744073709551615), truncate(1.5, 18446744073709551615);
+round(1.5, 18446744073709551615) truncate(1.5, 18446744073709551615)
+1.500000000000000000000000000000 1.500000000000000000000000000000
+select round(18446744073709551614, -1), truncate(18446744073709551614, -1);
+round(18446744073709551614, -1) truncate(18446744073709551614, -1)
+18446744073709551610 18446744073709551610
+select round(4, -4294967200), truncate(4, -4294967200);
+round(4, -4294967200) truncate(4, -4294967200)
+0 0
+select mod(cast(-2 as unsigned), 3), mod(18446744073709551614, 3), mod(-2, 3);
+mod(cast(-2 as unsigned), 3) mod(18446744073709551614, 3) mod(-2, 3)
+2 2 -2
+select mod(5, cast(-2 as unsigned)), mod(5, 18446744073709551614), mod(5, -2);
+mod(5, cast(-2 as unsigned)) mod(5, 18446744073709551614) mod(5, -2)
+5 5 1
+select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5);
+pow(cast(-2 as unsigned), 5) pow(18446744073709551614, 5) pow(-2, 5)
+2.1359870359209e+96 2.1359870359209e+96 -32
+End of 5.0 tests
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/func_str.result b/mysql-test/r/func_str.result
index 92265c77984..d8afbe13c76 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -1992,4 +1992,73 @@ abc
SELECT INSERT('abc', 6, 3, '1234');
INSERT('abc', 6, 3, '1234')
abc
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT CRC32(a) AS C FROM t1;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+SELECT CRC32(a), COUNT(*) FROM t1 GROUP BY 1;
+CRC32(a) COUNT(*)
+450215437 1
+498629140 1
+1790921346 1
+1842515611 1
+2212294583 1
+2226203566 1
+2366072709 1
+2707236321 1
+4088798008 1
+4194326291 1
+SELECT CRC32(a), COUNT(*) FROM t1 GROUP BY 1 ORDER BY 1;
+CRC32(a) COUNT(*)
+450215437 1
+498629140 1
+1790921346 1
+1842515611 1
+2212294583 1
+2226203566 1
+2366072709 1
+2707236321 1
+4088798008 1
+4194326291 1
+SELECT * FROM (SELECT CRC32(a) FROM t1) t2;
+CRC32(a)
+2212294583
+450215437
+1842515611
+4088798008
+2226203566
+498629140
+1790921346
+4194326291
+2366072709
+2707236321
+CREATE TABLE t2 SELECT CRC32(a) FROM t1;
+desc t2;
+Field Type Null Key Default Extra
+CRC32(a) int(10) unsigned YES NULL
+SELECT * FROM v1;
+C
+2212294583
+450215437
+1842515611
+4088798008
+2226203566
+498629140
+1790921346
+4194326291
+2366072709
+2707236321
+SELECT * FROM (SELECT * FROM v1) x;
+C
+2212294583
+450215437
+1842515611
+4088798008
+2226203566
+498629140
+1790921346
+4194326291
+2366072709
+2707236321
+DROP TABLE t1, t2;
+DROP VIEW v1;
End of 5.0 tests
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index ae550649951..a4c51cca277 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -657,6 +657,17 @@ delete from mysql.db where user='mysqltest1';
delete from mysql.tables_priv where user='mysqltest1';
flush privileges;
drop database mysqltest;
+create database db27515;
+use db27515;
+create table t1 (a int);
+grant alter on db27515.t1 to user27515@localhost;
+grant insert, create on db27515.t2 to user27515@localhost;
+rename table t1 to t2;
+ERROR 42000: DROP command denied to user 'user27515'@'localhost' for table 't1'
+revoke all privileges, grant option from user27515@localhost;
+drop user user27515@localhost;
+drop database db27515;
+End of 4.1 tests
use test;
create table t1 (a int);
create table t2 as select * from mysql.user where user='';
@@ -1094,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/group_by.result b/mysql-test/r/group_by.result
index 97375898f41..88f635595d6 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1035,3 +1035,15 @@ HAVING SUM(t1_inner.b)+t1_outer.b > 5);
ERROR 42000: 'test.t1_outer.b' isn't in GROUP BY
DROP TABLE t1;
SET SQL_MODE = '';
+SET SQL_MODE = 'ONLY_FULL_GROUP_BY';
+create table t1(f1 int, f2 int);
+select * from t1 group by f1;
+ERROR 42000: 'test.t1.f2' isn't in GROUP BY
+select * from t1 group by f2;
+ERROR 42000: 'test.t1.f1' isn't in GROUP BY
+select * from t1 group by f1, f2;
+f1 f2
+select t1.f1,t.* from t1, t1 t group by 1;
+ERROR 42000: 'test.t.f1' isn't in GROUP BY
+drop table t1;
+SET SQL_MODE = '';
diff --git a/mysql-test/r/have_log_bin.require b/mysql-test/r/have_log_bin.require
new file mode 100644
index 00000000000..cacdf8df0ce
--- /dev/null
+++ b/mysql-test/r/have_log_bin.require
@@ -0,0 +1,2 @@
+Variable_name Value
+have_log_bin ON
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 0638152ba42..9f327ca1901 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -2986,3 +2986,28 @@ SELECT * FROM t1;
a
DDD
DROP TABLE t1;
+CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB
+AUTO_INCREMENT=42;
+INSERT INTO t1 VALUES (0),(347),(0);
+SELECT * FROM t1;
+id
+42
+347
+348
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL auto_increment,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
+CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t2 VALUES(42),(347),(348);
+ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL auto_increment,
+ PRIMARY KEY (`id`),
+ CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 298fc58ffcb..45cb116f08b 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -111,6 +111,60 @@ c1
Before and after comparison
0
drop table t1;
+CREATE TABLE t1(c1 TEXT, UNIQUE (c1(1)), cnt INT DEFAULT 1)
+ENGINE=INNODB CHARACTER SET UTF8;
+INSERT INTO t1 (c1) VALUES ('1a');
+SELECT * FROM t1;
+c1 cnt
+1a 1
+INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
+SELECT * FROM t1;
+c1 cnt
+1a 2
+DROP TABLE t1;
+CREATE TABLE t1(c1 VARCHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1)
+ENGINE=INNODB CHARACTER SET UTF8;
+INSERT INTO t1 (c1) VALUES ('1a');
+SELECT * FROM t1;
+c1 cnt
+1a 1
+INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
+SELECT * FROM t1;
+c1 cnt
+1a 2
+DROP TABLE t1;
+CREATE TABLE t1(c1 CHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1)
+ENGINE=INNODB CHARACTER SET UTF8;
+INSERT INTO t1 (c1) VALUES ('1a');
+SELECT * FROM t1;
+c1 cnt
+1a 1
+INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
+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;
@@ -446,4 +500,121 @@ a
2
5
drop table t1;
+set @save_qcache_size=@@global.query_cache_size;
+set @save_qcache_type=@@global.query_cache_type;
+set global query_cache_size=10*1024*1024;
+set global query_cache_type=1;
+drop table if exists `test`;
+Warnings:
+Note 1051 Unknown table 'test'
+CREATE TABLE `test` (`test1` varchar(3) NOT NULL,
+`test2` varchar(4) NOT NULL,PRIMARY KEY (`test1`))
+ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '5678');
+select * from test;
+test1 test2
+tes 5678
+INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '1234')
+ON DUPLICATE KEY UPDATE `test2` = '1234';
+select * from test;
+test1 test2
+tes 1234
+flush tables;
+select * from test;
+test1 test2
+tes 1234
+drop table test;
+set global query_cache_type=@save_qcache_type;
+set global query_cache_size=@save_qcache_size;
+create table t1(
+id int auto_increment,
+c char(1) not null,
+counter int not null default 1,
+primary key (id),
+unique key (c)
+) engine=innodb;
+insert into t1 (id, c) values
+(NULL, 'a'),
+(NULL, 'a')
+on duplicate key update id = values(id), counter = counter + 1;
+select * from t1;
+id c counter
+2 a 2
+insert into t1 (id, c) values
+(NULL, 'b')
+on duplicate key update id = values(id), counter = counter + 1;
+select * from t1;
+id c counter
+2 a 2
+3 b 1
+truncate table t1;
+insert into t1 (id, c) values (NULL, 'a');
+select * from t1;
+id c counter
+1 a 1
+insert into t1 (id, c) values (NULL, 'b'), (NULL, 'b')
+on duplicate key update id = values(id), c = values(c), counter = counter + 1;
+select * from t1;
+id c counter
+1 a 1
+3 b 2
+insert into t1 (id, c) values (NULL, 'a')
+on duplicate key update id = values(id), c = values(c), counter = counter + 1;
+select * from t1;
+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;
End of 5.0 tests
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index 7900e0b7695..fa6e23d09f9 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -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_update.result b/mysql-test/r/insert_update.result
index fd70fcb9084..375961292a3 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 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'c1' at row 1
+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 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'c1' at row 1
+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 af2d4bed592..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);
@@ -779,4 +829,32 @@ Field Type Null Key Default Extra
Name varchar(50) YES NULL
DROP VIEW v1;
DROP TABLE t1,t2,tv1,tv2;
+create table t1 (a int, b int);
+insert into t1 values
+(NULL, 1),
+(NULL, 2),
+(NULL, 3),
+(NULL, 4);
+create table t2 (a int not null, primary key(a));
+insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t3 (a int not null, primary key(a));
+insert into t3 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+flush status;
+select * from t1, t2, t3 where t3.a=t1.a and t2.a=t1.b;
+a b a a
+explain select * from t1, t2, t3 where t3.a=t1.a and t2.a=t1.b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 Using index
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using index
+We expect rnd_next=5, and read_key must be 0 because of short-cutting:
+show status like 'Handler_read%';
+Variable_name Value
+Handler_read_first 0
+Handler_read_key 0
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 0
+Handler_read_rnd_next 5
+drop table t1, t2, t3;
End of 5.0 tests.
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index df66336bd81..c62601946c2 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -1214,3 +1214,28 @@ 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;
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index eea884e4294..ec15eaa97f5 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -414,3 +414,44 @@ a int(11) NO PRI
b varchar(20) NO MUL
c varchar(20) NO
drop table t1;
+CREATE TABLE t1 (
+a INTEGER auto_increment PRIMARY KEY,
+b INTEGER NOT NULL,
+c INTEGER NOT NULL,
+d CHAR(64)
+);
+CREATE TABLE t2 (
+a INTEGER auto_increment PRIMARY KEY,
+b INTEGER NOT NULL,
+c SMALLINT NOT NULL,
+d DATETIME NOT NULL,
+e SMALLINT NOT NULL,
+f INTEGER NOT NULL,
+g INTEGER NOT NULL,
+h SMALLINT NOT NULL,
+i INTEGER NOT NULL,
+j INTEGER NOT NULL,
+UNIQUE INDEX (b),
+INDEX (b, d, e, f, g, h, i, j, c),
+INDEX (c)
+);
+INSERT INTO t2 VALUES
+(NULL, 1, 254, '1000-01-01 00:00:00', 257, 0, 0, 0, 0, 0),
+(NULL, 2, 1, '2004-11-30 12:00:00', 1, 0, 0, 0, 0, 0),
+(NULL, 3, 1, '2004-11-30 12:00:00', 1, 0, 0, 2, -21600, 0),
+(NULL, 4, 1, '2004-11-30 12:00:00', 1, 0, 0, 2, -10800, 0),
+(NULL, 5, 1, '2004-11-30 12:00:00', 1, 0, 0, 5, -10800, 0),
+(NULL, 6, 1, '2004-11-30 12:00:00', 102, 0, 0, 0, 0, 0),
+(NULL, 7, 1, '2004-11-30 12:00:00', 105, 2, 0, 0, 0, 0),
+(NULL, 8, 1, '2004-11-30 12:00:00', 105, 10, 0, 0, 0, 0);
+INSERT INTO t1 (b, c, d) VALUES
+(3388000, -553000, NULL),
+(3388000, -553000, NULL);
+SELECT *
+FROM t2 c JOIN t1 pa ON c.b = pa.a
+WHERE c.c = 1
+ORDER BY c.b, c.d
+;
+a b c d e f g h i j a b c d
+2 2 1 2004-11-30 12:00:00 1 0 0 0 0 0 2 3388000 -553000 NULL
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 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/lowercase1.require b/mysql-test/r/lowercase1.require
new file mode 100644
index 00000000000..0341f838f7b
--- /dev/null
+++ b/mysql-test/r/lowercase1.require
@@ -0,0 +1,2 @@
+Variable_name Value
+lower_case_table_names 1
diff --git a/mysql-test/r/lowercase_mixed_tmpdir.result b/mysql-test/r/lowercase_mixed_tmpdir.result
new file mode 100644
index 00000000000..e11b5e4c286
--- /dev/null
+++ b/mysql-test/r/lowercase_mixed_tmpdir.result
@@ -0,0 +1,6 @@
+drop table if exists t1;
+create table t1 (id int) engine=myisam;
+insert into t1 values (1);
+create temporary table t2 select * from t1;
+drop temporary table t2;
+drop table t1;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index c4419d64a65..27465dd96f6 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -816,6 +816,17 @@ ALTER TABLE m1 ENGINE=MERGE UNION=(t1);
SELECT * FROM m1;
c1 c2 c3 c4 c5 c6 c7 c8 c9
DROP TABLE t1, m1;
+CREATE TABLE t1 (a VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_german2_ci,
+b INT, INDEX(a,b));
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 LIKE t1;
+ALTER TABLE t3 ENGINE=MERGE UNION=(t1,t2);
+INSERT INTO t1 VALUES ('ss',1);
+INSERT INTO t2 VALUES ('ss',2),(0xDF,2);
+SELECT COUNT(*) FROM t3 WHERE a=0xDF AND b=2;
+COUNT(*)
+2
+DROP TABLE t1,t2,t3;
create table t1 (b bit(1));
create table t2 (b bit(1));
create table tm (b bit(1)) engine = merge union = (t1,t2);
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index e83bbe97eaa..843f2c7285a 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -174,4 +174,6 @@ ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'cyrils_superlonghostnam
1
ERROR at line 1: DELIMITER cannot contain a backslash character
ERROR at line 1: DELIMITER cannot contain a backslash character
+1
+1
End of 5.0 tests
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index f92540a0d55..b3b606bd1fc 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -16,48 +16,9 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-@hadGrantPriv:=1
-1
-1
-1
-@hadShowDbPriv:=1
-1
-1
-1
-@hadCreateViewPriv:=1
-1
-1
-1
-@hadCreateRoutinePriv:=1
-1
-1
-1
-@hadCreateUserPriv:=1
-1
-1
-1
Run it again - should say already completed
-@hadGrantPriv:=1
-1
-1
-1
-@hadShowDbPriv:=1
-1
-1
-1
-@hadCreateViewPriv:=1
-1
-1
-1
-@hadCreateRoutinePriv:=1
-1
-1
-1
-@hadCreateUserPriv:=1
-1
-1
-1
-Force should run it regardless of wheter it's been run before
+This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade
+Force should run it regardless of wether it's been run before
mysql.columns_priv OK
mysql.db OK
mysql.func OK
@@ -75,23 +36,46 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-@hadGrantPriv:=1
-1
-1
-1
-@hadShowDbPriv:=1
-1
-1
-1
-@hadCreateViewPriv:=1
-1
-1
-1
-@hadCreateRoutinePriv:=1
-1
-1
-1
-@hadCreateUserPriv:=1
-1
-1
-1
+CREATE USER mysqltest1@'%' IDENTIFIED by 'sakila';
+GRANT ALL ON *.* TO mysqltest1@'%';
+Run mysql_upgrade with password protected account
+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
+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 5caaa9264d0..6ccca713948 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
@@ -3282,6 +3278,37 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
drop database bug23491_original;
drop database bug23491_restore;
use test;
+#
+# Bug 27293: mysqldump crashes when dumping routines
+# defined by a different user
+#
+# Bug #22761: mysqldump reports no errors when using
+# --routines without mysql.proc privileges
+#
+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`()
+select 'hello' */;;
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
+DELIMITER ;
+drop procedure sp1;
+drop user user1;
+drop user user2;
+drop database mysqldump_test_db;
#
# End of 5.0 tests
#
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 0188fe87bbd..35dcf9b62d2 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -277,6 +277,9 @@ let $A = changed value of A;
# Content of $B is: initial value of B
let $B = changed value of B;
# Content of $A is: changed value of A
+var2: content of variable 1
+var3: content of variable 1 content of variable 1
+length of var3 is longer than 0
mysqltest: At line 1: Missing required argument 'filename' to command 'source'
mysqltest: At line 1: Could not open file ./non_existingFile
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep
@@ -538,4 +541,129 @@ hello
hello
mysqltest: At line 1: test of die
Some output
+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;
+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;
+a b c
+1 Line 1 2007-04-05 00:00:00
+1 Line 1 2007-04-05 00:00:00
+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 '';
+
+
+select "h";
+h
+h
+select "he";
+he
+he
+select "hep";
+hep
+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;
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/ndb_single_user.result b/mysql-test/r/ndb_single_user.result
index 7959d8478e1..4606a47dde2 100644
--- a/mysql-test/r/ndb_single_user.result
+++ b/mysql-test/r/ndb_single_user.result
@@ -25,11 +25,12 @@ update t1 set b=b+100;
update t1 set b=b+100 where a > 7;
delete from t1;
insert into t1 select * from t2;
+create unique index new_index on t1 (b,c);
drop table t1;
ERROR 42S02: Unknown table 't1'
-create index new_index on t1 (c);
+create index new_index_fail on t1 (c);
ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster
-insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0);
+insert into t1 values (21,21,0),(22,22,0),(23,23,0),(24,24,0),(25,25,0),(26,26,0),(27,27,0),(28,28,0),(29,29,0),(210,210,0);
ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster
select * from t1 where a = 1;
ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index 91cd15295c3..b1c29a5aadb 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -607,6 +607,67 @@ x a sum(b)
2006-07-01 NULL 11
NULL NULL 11
drop table t1;
+CREATE TABLE t1 (a int, b int);
+INSERT INTO t1
+VALUES (2,10),(3,30),(2,40),(1,10),(2,30),(1,20),(2,10);
+SELECT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP;
+a SUM(b)
+1 30
+2 90
+3 30
+NULL 150
+SELECT DISTINCT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP;
+a SUM(b)
+1 30
+2 90
+3 30
+NULL 150
+SELECT a, b, COUNT(*) FROM t1 GROUP BY a,b WITH ROLLUP;
+a b COUNT(*)
+1 10 1
+1 20 1
+1 NULL 2
+2 10 2
+2 30 1
+2 40 1
+2 NULL 4
+3 30 1
+3 NULL 1
+NULL NULL 7
+SELECT DISTINCT a, b, COUNT(*) FROM t1 GROUP BY a,b WITH ROLLUP;
+a b COUNT(*)
+1 10 1
+1 20 1
+1 NULL 2
+2 10 2
+2 30 1
+2 40 1
+2 NULL 4
+3 30 1
+3 NULL 1
+NULL NULL 7
+SELECT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP;
+x a SUM(b)
+x 1 30
+x 2 90
+x 3 30
+x NULL 150
+NULL NULL 150
+SELECT DISTINCT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP;
+x a SUM(b)
+x 1 30
+x 2 90
+x 3 30
+x NULL 150
+NULL NULL 150
+SELECT DISTINCT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP;
+x a SUM(b)
+x 1 30
+x 2 90
+x 3 30
+x NULL 150
+NULL NULL 150
+DROP TABLE t1;
CREATE TABLE t1(id int, type char(1));
INSERT INTO t1 VALUES
(1,"A"),(2,"C"),(3,"A"),(4,"A"),(5,"B"),
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index 92900ac1a83..3f10eed7ad7 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -51,5 +51,113 @@ SSL error: Unable to get private key from ''
mysqltest: Could not open connection 'default': 2026 SSL connection error
SSL error: Unable to get certificate from ''
mysqltest: Could not open connection 'default': 2026 SSL connection error
+SHOW STATUS LIKE 'Ssl_cipher';
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
+SHOW STATUS LIKE 'Ssl_cipher';
+Variable_name Value
+Ssl_cipher AES128-SHA
+SHOW STATUS LIKE 'Ssl_cipher';
+Variable_name Value
+Ssl_cipher AES128-SHA
+mysqltest: Could not open connection 'default': 2026 SSL connection error
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (1), (2);
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `a` int(11) default NULL
+);
+
+LOCK TABLES `t1` WRITE;
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+INSERT INTO `t1` VALUES (1),(2);
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+UNLOCK TABLES;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `a` int(11) default NULL
+);
+
+LOCK TABLES `t1` WRITE;
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+INSERT INTO `t1` VALUES (1),(2);
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+UNLOCK TABLES;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `a` int(11) default NULL
+);
+
+LOCK TABLES `t1` WRITE;
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+INSERT INTO `t1` VALUES (1),(2);
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+UNLOCK TABLES;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+SSL error: Unable to get private key from 'MYSQL_TEST_DIR/std_data/client-cert.pem'
+mysqldump: Got error: 2026: SSL connection error when trying to connect
+DROP TABLE t1;
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..8a10a52ee65 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');
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 de6e2d62763..abd98067dae 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -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
@@ -3070,7 +3077,7 @@ found
true
set @arg00= CAST('1991-01-01 01:01:01' as datetime) ;
select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
@@ -3083,7 +3090,7 @@ and c17= @arg00 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index 1ebaafdd488..b90cf996db4 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -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
@@ -3053,7 +3060,7 @@ found
true
set @arg00= CAST('1991-01-01 01:01:01' as datetime) ;
select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
@@ -3066,7 +3073,7 @@ and c17= @arg00 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index 74b9326dbc1..aed2fcea1ce 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -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
@@ -3054,7 +3061,7 @@ found
true
set @arg00= CAST('1991-01-01 01:01:01' as datetime) ;
select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
@@ -3067,7 +3074,7 @@ and c17= @arg00 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index bf80514906b..ed85e4411aa 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -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
@@ -2990,7 +2997,7 @@ found
true
set @arg00= CAST('1991-01-01 01:01:01' as datetime) ;
select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
@@ -3003,7 +3010,7 @@ and c17= @arg00 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
@@ -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
@@ -6004,7 +6018,7 @@ found
true
set @arg00= CAST('1991-01-01 01:01:01' as datetime) ;
select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
@@ -6017,7 +6031,7 @@ and c17= @arg00 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result
index e83a3944d4e..3dc5859d304 100644
--- a/mysql-test/r/ps_6bdb.result
+++ b/mysql-test/r/ps_6bdb.result
@@ -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
@@ -3053,7 +3060,7 @@ found
true
set @arg00= CAST('1991-01-01 01:01:01' as datetime) ;
select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
@@ -3066,7 +3073,7 @@ and c17= @arg00 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result
index e8358098ee7..0df2733aa7a 100644
--- a/mysql-test/r/ps_7ndb.result
+++ b/mysql-test/r/ps_7ndb.result
@@ -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
@@ -3053,7 +3060,7 @@ found
true
set @arg00= CAST('1991-01-01 01:01:01' as datetime) ;
select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
@@ -3066,7 +3073,7 @@ and c17= @arg00 ;
found
true
prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
c14= CAST('1991-01-01 01:01:01' as datetime) and
c15= CAST('1991-01-01 01:01:01' as datetime) and
c16= CAST('1991-01-01 01:01:01' as datetime) and
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index d77745176f7..79471ee5c02 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -945,25 +945,19 @@ COUNT(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
-Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
-Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid'
-Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid'
+Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 0
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 invalid';
COUNT(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1
-Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1
-Warning 1292 Truncated incorrect INTEGER value: '20050328 invalid'
-Warning 1292 Truncated incorrect INTEGER value: '20050328 invalid'
+Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 0
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid';
COUNT(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
-Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
-Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid'
-Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid'
+Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 0
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
@@ -1321,3 +1315,97 @@ 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;
+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;
diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result
index 54d53299743..417a5e0c990 100644
--- a/mysql-test/r/repair.result
+++ b/mysql-test/r/repair.result
@@ -79,12 +79,12 @@ INSERT INTO t1 VALUES
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
('0'),('0'),('0'),('0'),('0'),('0'),('0');
Warnings:
-Error 1034 sort_buffer_size is to small
+Error 1034 myisam_sort_buffer_size is too small
Error 1034 Number of rows changed from 0 to 157
SET myisam_repair_threads=2;
REPAIR TABLE t1;
Table Op Msg_type Msg_text
-test.t1 repair error sort_buffer_size is to small
+test.t1 repair error myisam_sort_buffer_size is too small
test.t1 repair warning Number of rows changed from 0 to 157
test.t1 repair status OK
SET myisam_repair_threads=@@global.myisam_repair_threads;
diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result
index bb9e2109f0f..702e66fea62 100644
--- a/mysql-test/r/row.result
+++ b/mysql-test/r/row.result
@@ -193,6 +193,103 @@ SELECT ROW(2,1) IN (ROW(21,2),ROW(ROW(1,1,3),0));
ERROR 21000: Operand should contain 1 column(s)
SELECT ROW(2,1) IN (ROW(ROW(1,1,3),0),ROW(21,2));
ERROR 21000: Operand should contain 1 column(s)
+CREATE TABLE t1(a int, b int, c int);
+INSERT INTO t1 VALUES (1, 2, 3),
+(NULL, 2, 3 ), (1, NULL, 3 ), (1, 2, NULL),
+(NULL, 2, 3+1), (1, NULL, 3+1), (1, 2+1, NULL),
+(NULL, 2, 3-1), (1, NULL, 3-1), (1, 2-1, NULL);
+SELECT (1,2,3) = (1, NULL, 3);
+(1,2,3) = (1, NULL, 3)
+NULL
+SELECT (1,2,3) = (1+1, NULL, 3);
+(1,2,3) = (1+1, NULL, 3)
+0
+SELECT (1,2,3) = (1, NULL, 3+1);
+(1,2,3) = (1, NULL, 3+1)
+0
+SELECT * FROM t1 WHERE (a,b,c) = (1,2,3);
+a b c
+1 2 3
+SELECT (1,2,3) <> (1, NULL, 3);
+(1,2,3) <> (1, NULL, 3)
+NULL
+SELECT (1,2,3) <> (1+1, NULL, 3);
+(1,2,3) <> (1+1, NULL, 3)
+1
+SELECT (1,2,3) <> (1, NULL, 3+1);
+(1,2,3) <> (1, NULL, 3+1)
+1
+SELECT * FROM t1 WHERE (a,b,c) <> (1,2,3);
+a b c
+NULL 2 4
+1 NULL 4
+1 3 NULL
+NULL 2 2
+1 NULL 2
+1 1 NULL
+SELECT (1,2,3) < (NULL, 2, 3);
+(1,2,3) < (NULL, 2, 3)
+NULL
+SELECT (1,2,3) < (1, NULL, 3);
+(1,2,3) < (1, NULL, 3)
+NULL
+SELECT (1,2,3) < (1-1, NULL, 3);
+(1,2,3) < (1-1, NULL, 3)
+0
+SELECT (1,2,3) < (1+1, NULL, 3);
+(1,2,3) < (1+1, NULL, 3)
+1
+SELECT * FROM t1 WHERE (a,b,c) < (1,2,3);
+a b c
+1 1 NULL
+SELECT (1,2,3) <= (NULL, 2, 3);
+(1,2,3) <= (NULL, 2, 3)
+NULL
+SELECT (1,2,3) <= (1, NULL, 3);
+(1,2,3) <= (1, NULL, 3)
+NULL
+SELECT (1,2,3) <= (1-1, NULL, 3);
+(1,2,3) <= (1-1, NULL, 3)
+0
+SELECT (1,2,3) <= (1+1, NULL, 3);
+(1,2,3) <= (1+1, NULL, 3)
+1
+SELECT * FROM t1 WHERE (a,b,c) <= (1,2,3);
+a b c
+1 2 3
+1 1 NULL
+SELECT (1,2,3) > (NULL, 2, 3);
+(1,2,3) > (NULL, 2, 3)
+NULL
+SELECT (1,2,3) > (1, NULL, 3);
+(1,2,3) > (1, NULL, 3)
+NULL
+SELECT (1,2,3) > (1-1, NULL, 3);
+(1,2,3) > (1-1, NULL, 3)
+1
+SELECT (1,2,3) > (1+1, NULL, 3);
+(1,2,3) > (1+1, NULL, 3)
+0
+SELECT * FROM t1 WHERE (a,b,c) > (1,2,3);
+a b c
+1 3 NULL
+SELECT (1,2,3) >= (NULL, 2, 3);
+(1,2,3) >= (NULL, 2, 3)
+NULL
+SELECT (1,2,3) >= (1, NULL, 3);
+(1,2,3) >= (1, NULL, 3)
+NULL
+SELECT (1,2,3) >= (1-1, NULL, 3);
+(1,2,3) >= (1-1, NULL, 3)
+1
+SELECT (1,2,3) >= (1+1, NULL, 3);
+(1,2,3) >= (1+1, NULL, 3)
+0
+SELECT * FROM t1 WHERE (a,b,c) >= (1,2,3);
+a b c
+1 2 3
+1 3 NULL
+DROP TABLE t1;
SELECT ROW(1,1,1) = ROW(1,1,1) as `1`, ROW(1,1,1) = ROW(1,2,1) as `0`, ROW(1,NULL,1) = ROW(2,2,1) as `0`, ROW(1,NULL,1) = ROW(1,2,2) as `0`, ROW(1,NULL,1) = ROW(1,2,1) as `null` ;
1 0 0 0 null
1 0 0 0 NULL
diff --git a/mysql-test/r/rpl_ssl.result b/mysql-test/r/rpl_ssl.result
index 17a16d5020d..6bc1e996965 100644
--- a/mysql-test/r/rpl_ssl.result
+++ b/mysql-test/r/rpl_ssl.result
@@ -57,6 +57,7 @@ STOP SLAVE;
select * from t1;
t
1
+insert into t1 values (NULL);
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
@@ -64,7 +65,7 @@ Master_User replssl
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
-Read_Master_Log_Pos 12320
+Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
@@ -79,7 +80,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 12320
+Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
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-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 5386aa642a6..b5b79af031e 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -6068,6 +6068,63 @@ select bug20777(18446744073709551613)+1;
bug20777(18446744073709551613)+1
18446744073709551614
drop function bug20777;
+DROP FUNCTION IF EXISTS bug5274_f1|
+DROP FUNCTION IF EXISTS bug5274_f2|
+CREATE FUNCTION bug5274_f1(p1 CHAR) RETURNS CHAR
+RETURN CONCAT(p1, p1)|
+CREATE FUNCTION bug5274_f2() RETURNS CHAR
+BEGIN
+DECLARE v1 INT DEFAULT 0;
+DECLARE v2 CHAR DEFAULT 'x';
+WHILE v1 < 30 DO
+SET v1 = v1 + 1;
+SET v2 = bug5274_f1(v2);
+END WHILE;
+RETURN v2;
+END|
+SELECT bug5274_f2()|
+bug5274_f2()
+x
+Warnings:
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+Warning 1265 Data truncated for column 'bug5274_f1' at row 1
+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;
diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result
index f09645703ba..c74909e7e8f 100644
--- a/mysql-test/r/sp_trans.result
+++ b/mysql-test/r/sp_trans.result
@@ -530,8 +530,6 @@ 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)|
@@ -551,3 +549,4 @@ 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 f9d84df5d9f..a3ebd5c86fd 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'));
@@ -1391,4 +1393,10 @@ create table t1 (f1 set('a','a'));
ERROR HY000: Column 'f1' has duplicated value 'a' in SET
create table t1 (f1 enum('a','a'));
ERROR HY000: Column 'f1' has duplicated value 'a' in ENUM
+set @@sql_mode='NO_ZERO_DATE';
+create table t1(a datetime not null);
+select count(*) from t1 where a is null;
+count(*)
+0
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 94075df57b4..92a4a6f3f5a 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -394,13 +394,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 Using where; Using index
Warnings:
-Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = 20020803)
+Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = _latin1'2002-08-03')
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 Using where; Using index
Warnings:
-Note 1003 select (select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = 20020803)) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
+Note 1003 select (select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = _latin1'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
date
2002-08-03
@@ -4012,3 +4012,63 @@ WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a;
ERROR HY000: Invalid use of group function
SET @@sql_mode=default;
DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 values (1),(1),(1),(1);
+CREATE TABLE t2 (x INT);
+INSERT INTO t1 values (1000),(1001),(1002);
+SELECT SUM( (SELECT COUNT(a) FROM t2) ) FROM t1;
+ERROR HY000: Invalid use of group function
+SELECT SUM( (SELECT SUM(COUNT(a)) FROM t2) ) FROM t1;
+ERROR HY000: Invalid use of group function
+SELECT COUNT(1) FROM DUAL;
+COUNT(1)
+1
+SELECT SUM( (SELECT AVG( (SELECT t1.a FROM t2) ) FROM DUAL) ) FROM t1;
+ERROR HY000: Invalid use of group function
+SELECT
+SUM( (SELECT AVG( (SELECT COUNT(*) FROM t1 t HAVING t1.a < 12) ) FROM t2) )
+FROM t1;
+ERROR HY000: Invalid use of group function
+SELECT t1.a as XXA,
+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;
+End of 5.0 tests.
diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
index 33e7fc54ed2..9bbfdc6c5f9 100644
--- a/mysql-test/r/subselect3.result
+++ b/mysql-test/r/subselect3.result
@@ -692,3 +692,53 @@ a MAX(b) test
2 3 h
3 4 i
DROP TABLE t1, t2;
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (b int, PRIMARY KEY(b));
+INSERT INTO t1 VALUES (1), (NULL), (4);
+INSERT INTO t2 VALUES (3), (1),(2), (5), (4), (7), (6);
+EXPLAIN EXTENDED
+SELECT a FROM t1, t2 WHERE a=b AND (b NOT IN (SELECT a FROM t1));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using index
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`b` = `test`.`t1`.`a`) and (not(<in_optimizer>(`test`.`t1`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` where ((<cache>(`test`.`t2`.`b`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`)) having <is_not_null_test>(`test`.`t1`.`a`))))))
+SELECT a FROM t1, t2 WHERE a=b AND (b NOT IN (SELECT a FROM t1));
+a
+SELECT a FROM t1, t2 WHERE a=b AND (b NOT IN (SELECT a FROM t1 WHERE a > 4));
+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;
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index 0a0be41927a..3e6a901dc00 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -1414,4 +1414,39 @@ 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;
End of 5.0 tests
diff --git a/mysql-test/r/truncate.result b/mysql-test/r/truncate.result
index 6c21db0e2b8..b194f9b7dc6 100644
--- a/mysql-test/r/truncate.result
+++ b/mysql-test/r/truncate.result
@@ -57,26 +57,6 @@ create table t1 (s1 int);
insert into t1 (s1) values (1), (2), (3), (4), (5);
create view v1 as select * from t1;
truncate table v1;
-select count(*) from t1;
-count(*)
-0
-insert into t1 (s1) values (1), (2), (3), (4), (5);
-create view v2 as select * from t1 where s1 > 3;
-truncate table v2;
-select * from t1;
-s1
-1
-2
-3
-select * from v2;
-s1
-delete from t1;
-create table t2 (s1 int, s2 int);
-create view v3 as select a.s1, b.s2 from t1 a join t2 b on a.s1 = b.s1 where a.s1 > 3;
-truncate table v3;
-ERROR HY000: Can not delete from join view 'test.v3'
-create view v4 as select * from t1 limit 1,1;
-truncate table v4;
-ERROR HY000: The target table v4 of the TRUNCATE is not updatable
-drop view v1, v2, v3, v4;
-drop table t1, t2;
+ERROR 42S02: Table 'test.v1' doesn't exist
+drop view v1;
+drop table t1;
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 7caa23d330d..ba02f19712a 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -192,3 +192,222 @@ 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;
+curdate() < now() f1 < now() cast(f1 as date) < now()
+1 1 1
+delete from t1;
+insert into t1 values('2001-01-01','2001-01-01 01:01:01','2001-01-01 01:01:01');
+insert into t1 values('2001-02-05','2001-02-05 00:00:00','2001-02-05 01:01:01');
+insert into t1 values('2001-03-10','2001-03-09 01:01:01','2001-03-10 01:01:01');
+insert into t1 values('2001-04-15','2001-04-15 00:00:00','2001-04-15 00:00:00');
+insert into t1 values('2001-05-20','2001-05-20 01:01:01','2001-05-20 01:01:01');
+select f1, f3 from t1 where f1 >= '2001-02-05 00:00:00' and f3 <= '2001-04-15';
+f1 f3
+2001-02-05 2001-02-05 01:01:01
+2001-03-10 2001-03-10 01:01:01
+2001-04-15 2001-04-15 00:00:00
+select f1, f3 from t1 where f1 >= '2001-2-5 0:0:0' and f2 <= '2001-4-15';
+f1 f3
+2001-02-05 2001-02-05 01:01:01
+2001-03-10 2001-03-10 01:01:01
+2001-04-15 2001-04-15 00:00:00
+select f1, f2 from t1 where if(1, f1, 0) >= f2;
+f1 f2
+2001-02-05 2001-02-05 00:00:00
+2001-03-10 2001-03-09 01:01:01
+2001-04-15 2001-04-15 00:00:00
+select 1 from dual where cast('2001-1-1 2:3:4' as date) = cast('2001-01-01' as datetime);
+1
+1
+select f1, f2, f1 > f2, f1 = f2, f1 < f2 from t1;
+f1 f2 f1 > f2 f1 = f2 f1 < f2
+2001-01-01 2001-01-01 01:01:01 0 0 1
+2001-02-05 2001-02-05 00:00:00 0 1 0
+2001-03-10 2001-03-09 01:01:01 1 0 0
+2001-04-15 2001-04-15 00:00:00 0 1 0
+2001-05-20 2001-05-20 01:01:01 0 0 1
+drop table t1;
+create table t1 (f1 date, f2 datetime, f3 timestamp);
+insert into t1 values('2001-01-01','2001-01-01 01:01:01','2001-01-01 01:01:01');
+insert into t1 values('2001-02-05','2001-02-05 00:00:00','2001-02-05 01:01:01');
+insert into t1 values('2001-03-10','2001-03-09 01:01:01','2001-03-10 01:01:01');
+insert into t1 values('2001-04-15','2001-04-15 00:00:00','2001-04-15 00:00:00');
+insert into t1 values('2001-05-20','2001-05-20 01:01:01','2001-05-20 01:01:01');
+select f2 from t1 where f2 between '2001-2-5' and '01-04-14';
+f2
+2001-02-05 00:00:00
+2001-03-09 01:01:01
+select f1, f2, f3 from t1 where f1 between f2 and f3;
+f1 f2 f3
+2001-02-05 2001-02-05 00:00:00 2001-02-05 01:01:01
+2001-03-10 2001-03-09 01:01:01 2001-03-10 01:01:01
+2001-04-15 2001-04-15 00:00:00 2001-04-15 00:00:00
+select f1, f2, f3 from t1 where cast(f1 as datetime) between f2 and
+cast(f3 as date);
+f1 f2 f3
+2001-02-05 2001-02-05 00:00:00 2001-02-05 01:01:01
+2001-03-10 2001-03-09 01:01:01 2001-03-10 01:01:01
+2001-04-15 2001-04-15 00:00:00 2001-04-15 00:00:00
+select f2 from t1 where '2001-04-10 12:34:56' between f2 and '01-05-01';
+f2
+2001-01-01 01:01:01
+2001-02-05 00:00:00
+2001-03-09 01:01:01
+select f2, f3 from t1 where '01-03-10' between f2 and f3;
+f2 f3
+2001-03-09 01:01:01 2001-03-10 01:01:01
+select f2 from t1 where DATE(f2) between "2001-4-15" AND "01-4-15";
+f2
+2001-04-15 00:00:00
+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_newdecimal.result b/mysql-test/r/type_newdecimal.result
index 359a929d9a3..cbcab126439 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -763,7 +763,7 @@ truncate(99999999999999999999999999999999999999,31)
99999999999999999999999999999999999999.000000000000000000000000000000
select truncate(99.999999999999999999999999999999999999,31);
truncate(99.999999999999999999999999999999999999,31)
-100.000000000000000000000000000000
+99.999999999999999999999999999999
select truncate(99999999999999999999999999999999999999,-31);
truncate(99999999999999999999999999999999999999,-31)
99999990000000000000000000000000000000
@@ -1430,4 +1430,39 @@ 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
End of 5.0 tests
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result
index 748c2644eb9..dc7c7642a9b 100644
--- a/mysql-test/r/update.result
+++ b/mysql-test/r/update.result
@@ -457,3 +457,38 @@ a quux
2 0.100000000000000000000000000000
3 NULL
DROP TABLE t1;
+set tmp_table_size=1024;
+create table t1 (id int, a int, key idx(a));
+create table t2 (id int unsigned not null auto_increment primary key, a int);
+insert into t2(a) values(1),(2),(3),(4),(5),(6),(7),(8);
+insert into t2(a) select a from t2;
+insert into t2(a) select a from t2;
+insert into t2(a) select a from t2;
+update t2 set a=id;
+insert into t1 select * from t2;
+select count(*) from t1 join t2 on (t1.a=t2.a);
+count(*)
+64
+update t1 join t2 on (t1.a=t2.a) set t1.id=t2.id;
+affected rows: 0
+info: Rows matched: 64 Changed: 0 Warnings: 0
+insert into t2(a) select a from t2;
+update t2 set a=id;
+truncate t1;
+insert into t1 select * from t2;
+select count(*) from t1 join t2 on (t1.a=t2.a);
+count(*)
+128
+update t1 join t2 on (t1.a=t2.a) set t1.id=t2.id;
+affected rows: 0
+info: Rows matched: 128 Changed: 0 Warnings: 0
+update t1 set a=1;
+update t2 set a=1;
+select count(*) from t1 join t2 on (t1.a=t2.a);
+count(*)
+16384
+update t1 join t2 on (t1.a=t2.a) set t1.id=t2.id;
+affected rows: 127
+info: Rows matched: 128 Changed: 127 Warnings: 0
+drop table t1,t2;
+End of 5.0 tests
diff --git a/mysql-test/r/variables-big.result b/mysql-test/r/variables-big.result
new file mode 100644
index 00000000000..d7906869276
--- /dev/null
+++ b/mysql-test/r/variables-big.result
@@ -0,0 +1,20 @@
+set session transaction_prealloc_size=1024*1024*1024*1;
+show processlist;
+Id User Host db Command Time State Info
+1 root localhost test Query 0 NULL show processlist
+set session transaction_prealloc_size=1024*1024*1024*2;
+show processlist;
+Id User Host db Command Time State Info
+1 root localhost test Query 2 NULL show processlist
+set session transaction_prealloc_size=1024*1024*1024*3;
+show processlist;
+Id User Host db Command Time State Info
+1 root localhost test Query 0 NULL show processlist
+set session transaction_prealloc_size=1024*1024*1024*4;
+show processlist;
+Id User Host db Command Time State Info
+1 root localhost test Query 0 NULL show processlist
+set session transaction_prealloc_size=1024*1024*1024*5;
+show processlist;
+Id User Host db Command Time State Info
+1 root localhost test Query 0 NULL show processlist
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 71d743f37b9..8d9d802949d 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -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);
@@ -3319,4 +3319,52 @@ lgid clid
2 YES
DROP VIEW v1;
DROP table t1,t2;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE VIEW v1 AS SELECT a FROM t1 ORDER BY a;
+SELECT * FROM t1 UNION SELECT * FROM v1;
+a
+1
+2
+3
+EXPLAIN SELECT * FROM t1 UNION SELECT * FROM v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3
+2 UNION t1 ALL NULL NULL NULL NULL 3
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
+SELECT * FROM v1 UNION SELECT * FROM t1;
+a
+1
+2
+3
+EXPLAIN SELECT * FROM v1 UNION SELECT * FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3
+2 UNION t1 ALL NULL NULL NULL NULL 3
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
+SELECT * FROM t1 UNION SELECT * FROM v1 ORDER BY a;
+a
+1
+2
+3
+EXPLAIN SELECT * FROM t1 UNION SELECT * FROM v1 ORDER BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3
+2 UNION t1 ALL NULL NULL NULL NULL 3
+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;
End of 5.0 tests.
diff --git a/mysql-test/r/windows.result b/mysql-test/r/windows.result
index 1702fd28c18..b5f9a48d805 100644
--- a/mysql-test/r/windows.result
+++ b/mysql-test/r/windows.result
@@ -12,3 +12,10 @@ Warnings:
Warning 0 DATA DIRECTORY option ignored
Warning 0 INDEX DIRECTORY option ignored
drop table t1;
+CREATE TABLE t1 (a int, b int);
+INSERT INTO t1 VALUES (1,1);
+EXPLAIN SELECT * FROM t1 WHERE b = (SELECT max(2));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
+End of 5.0 tests.
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 307138added..83686f31e9e 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -636,3 +636,29 @@ ALTER TABLE t1 ADD d INT;
ALTER TABLE t1 ADD KEY (d(20));
DROP TABLE t1;
+# Bug#25262 Auto Increment lost when changing Engine type
+#
+
+create table t1(id int(8) primary key auto_increment) engine=heap;
+
+insert into t1 values (null);
+insert into t1 values (null);
+
+select * from t1;
+
+# Set auto increment to 50
+alter table t1 auto_increment = 50;
+
+# Alter to myisam
+alter table t1 engine = myisam;
+
+# This insert should get id 50
+insert into t1 values (null);
+select * from t1;
+
+# Alter to heap again
+alter table t1 engine = heap;
+insert into t1 values (null);
+select * from t1;
+
+drop table t1;
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/blackhole.test b/mysql-test/t/blackhole.test
index 4bafad2d777..51cc663d6bc 100644
--- a/mysql-test/t/blackhole.test
+++ b/mysql-test/t/blackhole.test
@@ -128,6 +128,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 +153,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..004ef69182d 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -182,6 +182,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/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 f57ead41926..882ff669d8c 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -11,3 +11,5 @@
##############################################################################
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
diff --git a/mysql-test/t/fix_priv_tables.test b/mysql-test/t/fix_priv_tables.test
index 3a91f41dfcc..3051fd88076 100644
--- a/mysql-test/t/fix_priv_tables.test
+++ b/mysql-test/t/fix_priv_tables.test
@@ -1,6 +1,13 @@
# Embedded server doesn't support external clients
--source include/not_embedded.inc
+# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set
+# to the location of mysql_fix_privilege_tables.sql
+if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`)
+{
+ skip Test need MYSQL_FIX_PRIVILEGE_TABLES;
+}
+
#
# This is the test for mysql_fix_privilege_tables
# It checks that a system tables from mysql 4.1.23
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 0f7835e9e7e..44375562307 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -377,4 +377,14 @@ EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+#
+# BUG#25951 - ignore/use index does not work with fulltext
+#
+CREATE TABLE t1 (a VARCHAR(255), FULLTEXT(a));
+SELECT * FROM t1 IGNORE INDEX(a) WHERE MATCH(a) AGAINST('test');
+ALTER TABLE t1 DISABLE KEYS;
+--error 1191
+SELECT * FROM t1 WHERE MATCH(a) AGAINST('test');
+DROP TABLE t1;
+
# End of 4.1 tests
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 0dd82864520..7771f216f69 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -507,4 +507,18 @@ 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;
+
--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_math.test b/mysql-test/t/func_math.test
index 4041c267134..2ba07dfc581 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -83,11 +83,6 @@ drop table t1;
#
-# Bug #10083 (round doesn't increase decimals)
-#
-select round(150, 2);
-
-#
# Bug @10632 (Ceiling function returns wrong answer)
#
select ceil(0.09);
@@ -177,3 +172,37 @@ select format(t2.f2-t2.f1+1,0) from t1,t2
where t1.f2 = t2.f3 order by t1.f1;
drop table t1, t2;
set names default;
+
+# Bug 24912 -- misc functions have trouble with unsigned
+
+select cast(-2 as unsigned), 18446744073709551614, -2;
+select abs(cast(-2 as unsigned)), abs(18446744073709551614), abs(-2);
+select ceiling(cast(-2 as unsigned)), ceiling(18446744073709551614), ceiling(-2);
+select floor(cast(-2 as unsigned)), floor(18446744073709551614), floor(-2);
+select format(cast(-2 as unsigned), 2), format(18446744073709551614, 2), format(-2, 2);
+select sqrt(cast(-2 as unsigned)), sqrt(18446744073709551614), sqrt(-2);
+select round(cast(-2 as unsigned), 1), round(18446744073709551614, 1), round(-2, 1);
+select round(4, cast(-2 as unsigned)), round(4, 18446744073709551614), round(4, -2);
+select truncate(cast(-2 as unsigned), 1), truncate(18446744073709551614, 1), truncate(-2, 1);
+select truncate(4, cast(-2 as unsigned)), truncate(4, 18446744073709551614), truncate(4, -2);
+select round(10000000000000000000, -19), truncate(10000000000000000000, -19);
+select round(1e0, -309), truncate(1e0, -309);
+select round(1e1,308), truncate(1e1, 308);
+select round(1e1, 2147483648), truncate(1e1, 2147483648);
+select round(1.1e1, 4294967295), truncate(1.1e1, 4294967295);
+select round(1.12e1, 4294967296), truncate(1.12e1, 4294967296);
+select round(1.5, 2147483640), truncate(1.5, 2147483640);
+select round(1.5, -2147483649), round(1.5, 2147483648);
+select truncate(1.5, -2147483649), truncate(1.5, 2147483648);
+select round(1.5, -4294967296), round(1.5, 4294967296);
+select truncate(1.5, -4294967296), truncate(1.5, 4294967296);
+select round(1.5, -9223372036854775808), round(1.5, 9223372036854775808);
+select truncate(1.5, -9223372036854775808), truncate(1.5, 9223372036854775808);
+select round(1.5, 18446744073709551615), truncate(1.5, 18446744073709551615);
+select round(18446744073709551614, -1), truncate(18446744073709551614, -1);
+select round(4, -4294967200), truncate(4, -4294967200);
+select mod(cast(-2 as unsigned), 3), mod(18446744073709551614, 3), mod(-2, 3);
+select mod(5, cast(-2 as unsigned)), mod(5, 18446744073709551614), mod(5, -2);
+select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5);
+
+--echo End of 5.0 tests
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/func_str.test b/mysql-test/t/func_str.test
index 0e4b404fe3a..bca977e6df3 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1058,4 +1058,22 @@ SELECT INSERT('abc', 4, 3, '1234');
SELECT INSERT('abc', 5, 3, '1234');
SELECT INSERT('abc', 6, 3, '1234');
+#
+# Bug #27530: Grouping on crc32, or create table select crc32
+#
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT CRC32(a) AS C FROM t1;
+
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+SELECT CRC32(a), COUNT(*) FROM t1 GROUP BY 1;
+SELECT CRC32(a), COUNT(*) FROM t1 GROUP BY 1 ORDER BY 1;
+SELECT * FROM (SELECT CRC32(a) FROM t1) t2;
+CREATE TABLE t2 SELECT CRC32(a) FROM t1;
+desc t2;
+SELECT * FROM v1;
+SELECT * FROM (SELECT * FROM v1) x;
+
+DROP TABLE t1, t2;
+DROP VIEW v1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 623bd4363cb..aa43e4225c5 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';
@@ -540,7 +541,28 @@ delete from mysql.tables_priv where user='mysqltest1';
flush privileges;
drop database mysqltest;
-# End of 4.1 tests
+#
+# Bug #27515: DROP previlege is not required for RENAME TABLE
+#
+connection master;
+create database db27515;
+use db27515;
+create table t1 (a int);
+grant alter on db27515.t1 to user27515@localhost;
+grant insert, create on db27515.t2 to user27515@localhost;
+
+connect (conn27515, localhost, user27515, , db27515);
+connection conn27515;
+--error 1142
+rename table t1 to t2;
+disconnect conn27515;
+
+connection master;
+revoke all privileges, grant option from user27515@localhost;
+drop user user27515@localhost;
+drop database db27515;
+
+--echo End of 4.1 tests
#
# Bug #16297 In memory grant tables not flushed when users's hostname is ""
@@ -1101,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/group_by.test b/mysql-test/t/group_by.test
index 92c92bf3957..538c5cd897d 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -752,3 +752,17 @@ SELECT b FROM t1 AS t1_outer GROUP BY a HAVING t1_outer.a IN
HAVING SUM(t1_inner.b)+t1_outer.b > 5);
DROP TABLE t1;
SET SQL_MODE = '';
+#
+# Bug#27874: Non-grouped columns are allowed by * in ONLY_FULL_GROUP_BY mode.
+#
+SET SQL_MODE = 'ONLY_FULL_GROUP_BY';
+create table t1(f1 int, f2 int);
+--error 1055
+select * from t1 group by f1;
+--error 1055
+select * from t1 group by f2;
+select * from t1 group by f1, f2;
+--error 1055
+select t1.f1,t.* from t1, t1 t group by 1;
+drop table t1;
+SET SQL_MODE = '';
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index e762d740d66..f7fa7366101 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -2004,6 +2004,26 @@ INSERT INTO t1 VALUES ('DDD');
SELECT * FROM t1;
DROP TABLE t1;
+#
+# Bug #23313 (AUTO_INCREMENT=# not reported back for InnoDB tables)
+# Bug #21404 (AUTO_INCREMENT value reset when Adding FKEY (or ALTER?))
+#
+
+CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB
+AUTO_INCREMENT=42;
+
+INSERT INTO t1 VALUES (0),(347),(0);
+SELECT * FROM t1;
+
+SHOW CREATE TABLE t1;
+
+CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t2 VALUES(42),(347),(348);
+ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id);
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1,t2;
+
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index c351891d205..d9e50add8bf 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -139,6 +139,61 @@ eval select STRCMP("$before", "$after") as "Before and after comparison";
connection default;
drop table t1;
disconnect con1;
+
+#
+# Bug #13191: INSERT...ON DUPLICATE KEY UPDATE of UTF-8 string fields
+# used in partial unique indices.
+#
+
+CREATE TABLE t1(c1 TEXT, UNIQUE (c1(1)), cnt INT DEFAULT 1)
+ ENGINE=INNODB CHARACTER SET UTF8;
+INSERT INTO t1 (c1) VALUES ('1a');
+SELECT * FROM t1;
+INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(c1 VARCHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1)
+ ENGINE=INNODB CHARACTER SET UTF8;
+INSERT INTO t1 (c1) VALUES ('1a');
+SELECT * FROM t1;
+INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(c1 CHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1)
+ ENGINE=INNODB CHARACTER SET UTF8;
+INSERT INTO t1 (c1) VALUES ('1a');
+SELECT * FROM t1;
+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
@@ -412,4 +467,134 @@ DROP TABLE t1;
--source include/innodb_rollback_on_timeout.inc
+#
+# Bug #27210: INNODB ON DUPLICATE KEY UPDATE
+#
+
+set @save_qcache_size=@@global.query_cache_size;
+set @save_qcache_type=@@global.query_cache_type;
+set global query_cache_size=10*1024*1024;
+set global query_cache_type=1;
+connect (con1,localhost,root,,);
+connection con1;
+drop table if exists `test`;
+CREATE TABLE `test` (`test1` varchar(3) NOT NULL,
+ `test2` varchar(4) NOT NULL,PRIMARY KEY (`test1`))
+ ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '5678');
+disconnect con1;
+connect (con2,localhost,root,,);
+connection con2;
+select * from test;
+INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '1234')
+ ON DUPLICATE KEY UPDATE `test2` = '1234';
+select * from test;
+flush tables;
+select * from test;
+disconnect con2;
+connection default;
+drop table test;
+set global query_cache_type=@save_qcache_type;
+set global query_cache_size=@save_qcache_size;
+
+-- source include/have_innodb.inc
+
+#
+# Bug #27650: INSERT fails after multi-row INSERT of the form:
+# INSERT INTO t (id...) VALUES (NULL...) ON DUPLICATE KEY UPDATE id=VALUES(id)
+#
+
+create table t1(
+id int auto_increment,
+c char(1) not null,
+counter int not null default 1,
+primary key (id),
+unique key (c)
+) engine=innodb;
+
+insert into t1 (id, c) values
+(NULL, 'a'),
+(NULL, 'a')
+on duplicate key update id = values(id), counter = counter + 1;
+
+select * from t1;
+
+insert into t1 (id, c) values
+(NULL, 'b')
+on duplicate key update id = values(id), counter = counter + 1;
+
+select * from t1;
+
+truncate table t1;
+
+insert into t1 (id, c) values (NULL, 'a');
+
+select * from t1;
+
+insert into t1 (id, c) values (NULL, 'b'), (NULL, 'b')
+on duplicate key update id = values(id), c = values(c), counter = counter + 1;
+
+select * from t1;
+
+insert into t1 (id, c) values (NULL, 'a')
+on duplicate key update id = values(id), c = values(c), counter = counter + 1;
+
+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;
+
--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_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 99dd21e8ee2..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
#
@@ -610,4 +634,27 @@ DESCRIBE tv2;
DROP VIEW v1;
DROP TABLE t1,t2,tv1,tv2;
+
+# BUG#27939: Early NULLs filtering doesn't work for eq_ref access
+create table t1 (a int, b int);
+insert into t1 values
+ (NULL, 1),
+ (NULL, 2),
+ (NULL, 3),
+ (NULL, 4);
+
+create table t2 (a int not null, primary key(a));
+insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t3 (a int not null, primary key(a));
+insert into t3 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+flush status;
+select * from t1, t2, t3 where t3.a=t1.a and t2.a=t1.b;
+explain select * from t1, t2, t3 where t3.a=t1.a and t2.a=t1.b;
+--echo We expect rnd_next=5, and read_key must be 0 because of short-cutting:
+show status like 'Handler_read%';
+drop table t1, t2, t3;
+
+
--echo End of 5.0 tests.
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index a0620e144c2..51e79a20d65 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -825,3 +825,23 @@ 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;
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test
index 3767f5f885e..e84b2071ab1 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -384,3 +384,51 @@ desc t1;
drop table t1;
# End of 4.1 tests
+
+#
+# Bug #24778: Innodb: No result when using ORDER BY
+#
+CREATE TABLE t1 (
+ a INTEGER auto_increment PRIMARY KEY,
+ b INTEGER NOT NULL,
+ c INTEGER NOT NULL,
+ d CHAR(64)
+);
+
+CREATE TABLE t2 (
+ a INTEGER auto_increment PRIMARY KEY,
+ b INTEGER NOT NULL,
+ c SMALLINT NOT NULL,
+ d DATETIME NOT NULL,
+ e SMALLINT NOT NULL,
+ f INTEGER NOT NULL,
+ g INTEGER NOT NULL,
+ h SMALLINT NOT NULL,
+ i INTEGER NOT NULL,
+ j INTEGER NOT NULL,
+ UNIQUE INDEX (b),
+ INDEX (b, d, e, f, g, h, i, j, c),
+ INDEX (c)
+);
+
+INSERT INTO t2 VALUES
+ (NULL, 1, 254, '1000-01-01 00:00:00', 257, 0, 0, 0, 0, 0),
+ (NULL, 2, 1, '2004-11-30 12:00:00', 1, 0, 0, 0, 0, 0),
+ (NULL, 3, 1, '2004-11-30 12:00:00', 1, 0, 0, 2, -21600, 0),
+ (NULL, 4, 1, '2004-11-30 12:00:00', 1, 0, 0, 2, -10800, 0),
+ (NULL, 5, 1, '2004-11-30 12:00:00', 1, 0, 0, 5, -10800, 0),
+ (NULL, 6, 1, '2004-11-30 12:00:00', 102, 0, 0, 0, 0, 0),
+ (NULL, 7, 1, '2004-11-30 12:00:00', 105, 2, 0, 0, 0, 0),
+ (NULL, 8, 1, '2004-11-30 12:00:00', 105, 10, 0, 0, 0, 0);
+
+INSERT INTO t1 (b, c, d) VALUES
+ (3388000, -553000, NULL),
+ (3388000, -553000, NULL);
+
+SELECT *
+FROM t2 c JOIN t1 pa ON c.b = pa.a
+WHERE c.c = 1
+ORDER BY c.b, c.d
+;
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index 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/lowercase_mixed_tmpdir-master.opt b/mysql-test/t/lowercase_mixed_tmpdir-master.opt
new file mode 100644
index 00000000000..3d21ea72f6b
--- /dev/null
+++ b/mysql-test/t/lowercase_mixed_tmpdir-master.opt
@@ -0,0 +1,2 @@
+--lower-case-table-names=1
+--tmpdir=$MYSQLTEST_VARDIR/tmp/MixedCase
diff --git a/mysql-test/t/lowercase_mixed_tmpdir-master.sh b/mysql-test/t/lowercase_mixed_tmpdir-master.sh
new file mode 100644
index 00000000000..95c26e3aa02
--- /dev/null
+++ b/mysql-test/t/lowercase_mixed_tmpdir-master.sh
@@ -0,0 +1,6 @@
+# This test requires a non-lowercase tmpdir directory on a case-sensitive
+# filesystem.
+
+d="$MYSQLTEST_VARDIR/tmp/MixedCase"
+test -d "$d" || mkdir "$d"
+rm -f "$d"/*
diff --git a/mysql-test/t/lowercase_mixed_tmpdir.test b/mysql-test/t/lowercase_mixed_tmpdir.test
new file mode 100644
index 00000000000..6bd3a6f2acc
--- /dev/null
+++ b/mysql-test/t/lowercase_mixed_tmpdir.test
@@ -0,0 +1,12 @@
+--source include/have_case_sensitive_file_system.inc
+--source include/have_lowercase1.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1 (id int) engine=myisam;
+insert into t1 values (1);
+create temporary table t2 select * from t1;
+drop temporary table t2;
+drop table t1;
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 490010c0a42..b3944416adc 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -447,6 +447,19 @@ ALTER TABLE m1 ENGINE=MERGE UNION=(t1);
SELECT * FROM m1;
DROP TABLE t1, m1;
+#
+# BUG#24342 - Incorrect results with query over MERGE table
+#
+CREATE TABLE t1 (a VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_german2_ci,
+ b INT, INDEX(a,b));
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 LIKE t1;
+ALTER TABLE t3 ENGINE=MERGE UNION=(t1,t2);
+INSERT INTO t1 VALUES ('ss',1);
+INSERT INTO t2 VALUES ('ss',2),(0xDF,2);
+SELECT COUNT(*) FROM t3 WHERE a=0xDF AND b=2;
+DROP TABLE t1,t2,t3;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 1af7c6381fe..0732559e7e1 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -264,4 +264,13 @@ EOF
--exec $MYSQL --version 2>&1 > /dev/null
--enable_quary_log
+#
+# bug #26851: Mysql Client --pager Buffer Overflow
+#
+
+# allow error 7(invalid argument) since --pager does not always exist in mysql
+--error 0,7
+--exec $MYSQL --pager="540bytelengthstringxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -e "select 1" > /dev/null 2>&1
+--exec $MYSQL --character-sets-dir="540bytelengthstringxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -e "select 1" 2>&1
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test
index c6133f8e85f..233e8c7c256 100644
--- a/mysql-test/t/mysql_upgrade.test
+++ b/mysql-test/t/mysql_upgrade.test
@@ -8,16 +8,63 @@ select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
--enable_query_log
#
-# Basic test thta we can run mysql_upgrde and that it finds the
+# Basic test that we can run mysql_upgrde and that it finds the
# expected binaries it uses.
#
--echo Run mysql_upgrade once
---exec $MYSQL_UPGRADE 2> $MYSQLTEST_VARDIR/log/mysql_upgrade.err
+--exec $MYSQL_UPGRADE --skip-verbose 2>&1
+
+# It should have created a file in the MySQL Servers datadir
+file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info;
--echo Run it again - should say already completed
---exec $MYSQL_UPGRADE 2> $MYSQLTEST_VARDIR/log/mysql_upgrade.err
+--replace_result $MYSQL_SERVER_VERSION VERSION
+--error 1
+--exec $MYSQL_UPGRADE --skip-verbose 2>&1
+
+# It should have created a file in the MySQL Servers datadir
+file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info;
+
+--echo Force should run it regardless of wether it's been run before
+--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
+
+# It should have created a file in the MySQL Servers datadir
+file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info;
+
+
+#
+# Bug #25452 mysql_upgrade access denied.
+#
+
+# Password protect a root account and run mysql_upgrade
---echo Force should run it regardless of wheter it's been run before
---exec $MYSQL_UPGRADE --force 2> $MYSQLTEST_VARDIR/log/mysql_upgrade.err
+CREATE USER mysqltest1@'%' IDENTIFIED by 'sakila';
+GRANT ALL ON *.* TO mysqltest1@'%';
+--echo Run mysql_upgrade with password protected account
+--exec $MYSQL_UPGRADE --skip-verbose --force --user=mysqltest1 --password=sakila 2>&1
+
+DROP USER mysqltest1@'%';
+
+
+#
+# Bug #26639 mysql_upgrade exits successfully even if external command failed
+#
+
+--echo Run mysql_upgrade with a non existing server socket
+--replace_result $MYSQLTEST_VARDIR var
+--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/mysqldump.test b/mysql-test/t/mysqldump.test
index 126412057ab..4c4690520c6 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -1495,6 +1495,41 @@ drop database bug23491_original;
drop database bug23491_restore;
use test;
+
+
+--echo #
+--echo # Bug 27293: mysqldump crashes when dumping routines
+--echo # defined by a different user
+--echo #
+--echo # Bug #22761: mysqldump reports no errors when using
+--echo # --routines without mysql.proc privileges
+--echo #
+
+create database mysqldump_test_db;
+
+grant all privileges on mysqldump_test_db.* to user1;
+grant all privileges on mysqldump_test_db.* to user2;
+
+connect (user27293,localhost,user1,,mysqldump_test_db,$MASTER_MYPORT,$MASTER_MYSOCK);
+connection user27293;
+
+create procedure mysqldump_test_db.sp1() select 'hello';
+
+--error 2
+--exec $MYSQL_DUMP -f --compact --user=user2 --password= -h 127.0.0.1 -P $MASTER_MYPORT --routines mysqldump_test_db
+
+--exec $MYSQL_DUMP -f --compact --user=user1 --password= -h 127.0.0.1 -P $MASTER_MYPORT --routines mysqldump_test_db
+
+drop procedure sp1;
+
+connection default;
+drop user user1;
+drop user user2;
+
+drop database mysqldump_test_db;
+
+
+
--echo #
--echo # End of 5.0 tests
--echo #
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 1914f2794e2..057432d37fd 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -719,6 +719,21 @@ let $B = changed value of B;
--echo # Content of \$A is: $A
# ----------------------------------------------------------------------------
+# Test let from query with $variable
+# let $<var_name>=`<query with $variable>`;
+# ----------------------------------------------------------------------------
+
+let $var1=content of variable 1;
+let $var2= `select "$var1"`;
+let $var3= `select concat("$var1", " ", "$var2")`;
+echo var2: $var2;
+echo var3: $var3;
+if (`select length("$var3") > 0`)
+{
+ echo length of var3 is longer than 0;
+}
+
+# ----------------------------------------------------------------------------
# Test to assign let from query
# let $<var_name>=`<query>`;
# ----------------------------------------------------------------------------
@@ -1725,6 +1740,131 @@ EOF
--exec echo "echo Some output; exit; echo Not this;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
+# 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;
+--sorted_result
+select * from t1;
+# Should not be sorted
+select * from t1;
+disable_result_log;
+sorted_result;
+select * from t1;
+enable_result_log;
+--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
# ----------------------------------------------------------------------------
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/ndb_single_user.test b/mysql-test/t/ndb_single_user.test
index f2f47becb0c..631d3800499 100644
--- a/mysql-test/t/ndb_single_user.test
+++ b/mysql-test/t/ndb_single_user.test
@@ -46,15 +46,18 @@ update t1 set b=b+100 where a > 7;
# delete with full table scan
delete from t1;
insert into t1 select * from t2;
+# Bug #27710 Creating unique index fails during single user mode
+# - prior to bugfix this would fail
+create unique index new_index on t1 (b,c);
# test some sql on other mysqld
--connection server2
--error 1051
drop table t1;
--error 1296
-create index new_index on t1 (c);
+create index new_index_fail on t1 (c);
--error 1296
-insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0);
+insert into t1 values (21,21,0),(22,22,0),(23,23,0),(24,24,0),(25,25,0),(26,26,0),(27,27,0),(28,28,0),(29,29,0),(210,210,0);
--error 1296
select * from t1 where a = 1;
--error 1296
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test
index e6cbfe3166c..05934bff492 100644
--- a/mysql-test/t/olap.test
+++ b/mysql-test/t/olap.test
@@ -292,6 +292,25 @@ select left(a,10), a, sum(b) from t1 group by 1,2 with rollup;
select left(a,10) x, a, sum(b) from t1 group by x,a with rollup;
drop table t1;
+#
+# Bug #24856: ROLLUP by const item in a query with DISTINCT
+#
+
+CREATE TABLE t1 (a int, b int);
+INSERT INTO t1
+ VALUES (2,10),(3,30),(2,40),(1,10),(2,30),(1,20),(2,10);
+
+SELECT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP;
+SELECT DISTINCT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP;
+SELECT a, b, COUNT(*) FROM t1 GROUP BY a,b WITH ROLLUP;
+SELECT DISTINCT a, b, COUNT(*) FROM t1 GROUP BY a,b WITH ROLLUP;
+
+SELECT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP;
+SELECT DISTINCT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP;
+SELECT DISTINCT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP;
+
+DROP TABLE t1;
+
# End of 4.1 tests
#
@@ -339,6 +358,3 @@ SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) as t;
DROP TABLE t1;
-
-
-
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index 362443023e1..a752e990846 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -97,6 +97,14 @@ drop table t1;
--exec $MYSQL_TEST --ssl-cert= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
#
+# BUG#21611 Slave can't connect when master-ssl-cipher specified
+# - Apparently selecting a cipher doesn't work at all
+# - Usa a cipher that both yaSSL and OpenSSL supports
+#
+--exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql
+--exec $MYSQL_TEST --ssl-cipher=DHE-RSA-AES256-SHA < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
+
+#
# Bug#25309 SSL connections without CA certificate broken since MySQL 5.0.23
#
# Test that we can open encrypted connection to server without
@@ -104,3 +112,43 @@ drop table t1;
# and ca path to NULL
#
--exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
+
+
+#
+# Test to connect using a list of ciphers
+#
+--exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql
+--exec $MYSQL_TEST --ssl-cipher=UNKNOWN-CIPHER:AES128-SHA < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
+
+
+# Test to connect using a specifi cipher
+#
+--exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql
+--exec $MYSQL_TEST --ssl-cipher=AES128-SHA < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
+
+# Test to connect using an unknown cipher
+#
+--exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql
+--error 1
+--exec $MYSQL_TEST --ssl-cipher=UNKNOWN-CIPHER < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
+
+#
+# Bug #27669 mysqldump: SSL connection error when trying to connect
+#
+
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (1), (2);
+
+# Run mysqldump
+--exec $MYSQL_DUMP --skip-create --skip-comments --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test t1
+
+--exec $MYSQL_DUMP --skip-create --skip-comments --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test
+
+--exec $MYSQL_DUMP --skip-create --skip-comments --ssl --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test
+
+# With wrong parameters
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--error 2
+--exec $MYSQL_DUMP --skip-create --skip-comments --ssl --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test 2>&1
+
+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..5b7adc40755 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.
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..1ef104f820b 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -899,3 +899,75 @@ 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;
+
+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;
+
+# End of 5.0 tests
diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test
index bf25359b7be..d2750fecbac 100644
--- a/mysql-test/t/row.test
+++ b/mysql-test/t/row.test
@@ -110,6 +110,51 @@ SELECT ROW(2,1) IN (ROW(21,2),ROW(ROW(1,1,3),0));
--error 1241
SELECT ROW(2,1) IN (ROW(ROW(1,1,3),0),ROW(21,2));
+#
+# Bug#27704: erroneous comparison of rows with NULL components
+#
+CREATE TABLE t1(a int, b int, c int);
+INSERT INTO t1 VALUES (1, 2, 3),
+ (NULL, 2, 3 ), (1, NULL, 3 ), (1, 2, NULL),
+ (NULL, 2, 3+1), (1, NULL, 3+1), (1, 2+1, NULL),
+ (NULL, 2, 3-1), (1, NULL, 3-1), (1, 2-1, NULL);
+
+SELECT (1,2,3) = (1, NULL, 3);
+SELECT (1,2,3) = (1+1, NULL, 3);
+SELECT (1,2,3) = (1, NULL, 3+1);
+SELECT * FROM t1 WHERE (a,b,c) = (1,2,3);
+
+SELECT (1,2,3) <> (1, NULL, 3);
+SELECT (1,2,3) <> (1+1, NULL, 3);
+SELECT (1,2,3) <> (1, NULL, 3+1);
+SELECT * FROM t1 WHERE (a,b,c) <> (1,2,3);
+
+SELECT (1,2,3) < (NULL, 2, 3);
+SELECT (1,2,3) < (1, NULL, 3);
+SELECT (1,2,3) < (1-1, NULL, 3);
+SELECT (1,2,3) < (1+1, NULL, 3);
+SELECT * FROM t1 WHERE (a,b,c) < (1,2,3);
+
+SELECT (1,2,3) <= (NULL, 2, 3);
+SELECT (1,2,3) <= (1, NULL, 3);
+SELECT (1,2,3) <= (1-1, NULL, 3);
+SELECT (1,2,3) <= (1+1, NULL, 3);
+SELECT * FROM t1 WHERE (a,b,c) <= (1,2,3);
+
+SELECT (1,2,3) > (NULL, 2, 3);
+SELECT (1,2,3) > (1, NULL, 3);
+SELECT (1,2,3) > (1-1, NULL, 3);
+SELECT (1,2,3) > (1+1, NULL, 3);
+SELECT * FROM t1 WHERE (a,b,c) > (1,2,3);
+
+SELECT (1,2,3) >= (NULL, 2, 3);
+SELECT (1,2,3) >= (1, NULL, 3);
+SELECT (1,2,3) >= (1-1, NULL, 3);
+SELECT (1,2,3) >= (1+1, NULL, 3);
+SELECT * FROM t1 WHERE (a,b,c) >= (1,2,3);
+
+DROP TABLE t1;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/rpl_ssl.test b/mysql-test/t/rpl_ssl.test
index 249ed16f931..f83f8b983b2 100644
--- a/mysql-test/t/rpl_ssl.test
+++ b/mysql-test/t/rpl_ssl.test
@@ -54,7 +54,8 @@ while ($i)
start slave;
enable_query_log;
connection master;
+insert into t1 values (NULL);
sync_slave_with_master;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
query_vertical show slave status;
diff --git a/mysql-test/t/sp-code.test b/mysql-test/t/sp-code.test
index 97bc29fcad2..0f249c95172 100644
--- a/mysql-test/t/sp-code.test
+++ b/mysql-test/t/sp-code.test
@@ -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-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 2bc9e7c1946..ff203a85ef7 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -7017,6 +7017,55 @@ select bug20777(18446744073709551613)+1;
drop function bug20777;
delimiter |;
+
+#
+# BUG#5274: Stored procedure crash if length of CHAR variable too great.
+#
+
+# Prepare.
+
+--disable_warnings
+DROP FUNCTION IF EXISTS bug5274_f1|
+DROP FUNCTION IF EXISTS bug5274_f2|
+--enable_warnings
+
+# Test.
+
+CREATE FUNCTION bug5274_f1(p1 CHAR) RETURNS CHAR
+ RETURN CONCAT(p1, p1)|
+
+CREATE FUNCTION bug5274_f2() RETURNS CHAR
+BEGIN
+ DECLARE v1 INT DEFAULT 0;
+ DECLARE v2 CHAR DEFAULT 'x';
+
+ WHILE v1 < 30 DO
+ SET v1 = v1 + 1;
+ SET v2 = bug5274_f1(v2);
+ END WHILE;
+
+ RETURN v2;
+END|
+
+SELECT bug5274_f2()|
+
+# Cleanup.
+
+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.
@@ -7037,8 +7086,11 @@ delimiter |;
delimiter ;|
drop table t1,t2;
+# Disable warnings to allow test run without InnoDB
+--disable_warnings
CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM;
CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb;
+--enable_warnings
set @a=0;
delimiter |;
diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test
index d9b34c303ae..8eccaafcf0e 100644
--- a/mysql-test/t/sp_trans.test
+++ b/mysql-test/t/sp_trans.test
@@ -559,12 +559,8 @@ set @@session.max_heap_table_size=default|
# 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|
+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)|
@@ -583,6 +579,7 @@ 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|
#
# BUG#NNNN: New bug synopsis
diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test
index 1792c0fccbc..fc663853174 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
@@ -1258,4 +1258,12 @@ create table t1 (f1 set('a','a'));
--error 1291
create table t1 (f1 enum('a','a'));
+#
+# Bug #22824: strict, datetime, NULL, wrong warning
+#
+set @@sql_mode='NO_ZERO_DATE';
+create table t1(a datetime not null);
+select count(*) from t1 where a is null;
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 482b3e883e6..5840e434b64 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -2845,3 +2845,65 @@ SELECT a FROM t1 t0
SET @@sql_mode=default;
DROP TABLE t1;
+
+#
+# Bug #27363: nested aggregates in outer, subquery / sum(select
+# count(outer))
+#
+CREATE TABLE t1 (a INT); INSERT INTO t1 values (1),(1),(1),(1);
+CREATE TABLE t2 (x INT); INSERT INTO t1 values (1000),(1001),(1002);
+
+--error ER_INVALID_GROUP_FUNC_USE
+SELECT SUM( (SELECT COUNT(a) FROM t2) ) FROM t1;
+--error ER_INVALID_GROUP_FUNC_USE
+SELECT SUM( (SELECT SUM(COUNT(a)) FROM t2) ) FROM t1;
+SELECT COUNT(1) FROM DUAL;
+
+--error ER_INVALID_GROUP_FUNC_USE
+SELECT SUM( (SELECT AVG( (SELECT t1.a FROM t2) ) FROM DUAL) ) FROM t1;
+
+--error ER_INVALID_GROUP_FUNC_USE
+SELECT
+ SUM( (SELECT AVG( (SELECT COUNT(*) FROM t1 t HAVING t1.a < 12) ) FROM t2) )
+FROM t1;
+
+--error ER_INVALID_GROUP_FUNC_USE
+SELECT t1.a as XXA,
+ SUM( (SELECT AVG( (SELECT COUNT(*) FROM t1 t HAVING XXA < 12) ) FROM t2) )
+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;
+
+--echo End of 5.0 tests.
diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test
index 11468cd6759..65556012588 100644
--- a/mysql-test/t/subselect3.test
+++ b/mysql-test/t/subselect3.test
@@ -528,3 +528,46 @@ SELECT a, MAX(b),
DROP TABLE t1, t2;
+
+
+#
+# Bug #27870: crash of an equijoin query with WHERE condition containing
+# a subquery predicate of the form <join attr> NOT IN (SELECT ...)
+#
+
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (b int, PRIMARY KEY(b));
+INSERT INTO t1 VALUES (1), (NULL), (4);
+INSERT INTO t2 VALUES (3), (1),(2), (5), (4), (7), (6);
+
+EXPLAIN EXTENDED
+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));
+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;
diff --git a/mysql-test/t/system_mysql_db_fix30020.test b/mysql-test/t/system_mysql_db_fix30020.test
index b71ae6c2204..23562807c14 100644
--- a/mysql-test/t/system_mysql_db_fix30020.test
+++ b/mysql-test/t/system_mysql_db_fix30020.test
@@ -1,8 +1,12 @@
# Embedded server doesn't support external clients
--source include/not_embedded.inc
-# Windows doesn't support execution of shell scripts (to fix!!)
---source include/not_windows.inc
+# Don't run this test if $MYSQL_FIX_SYSTEM_TABLES isn't set
+# to the location of mysql_fix_privilege_tables.sql
+if (`SELECT LENGTH("$MYSQL_FIX_SYSTEM_TABLES") <= 0`)
+{
+ skip Test need MYSQL_FIX_SYSTEM_TABLES;
+}
#
# This is the test for mysql_fix_privilege_tables
diff --git a/mysql-test/t/system_mysql_db_fix40123.test b/mysql-test/t/system_mysql_db_fix40123.test
index 471598625d4..012d05af3b8 100644
--- a/mysql-test/t/system_mysql_db_fix40123.test
+++ b/mysql-test/t/system_mysql_db_fix40123.test
@@ -1,6 +1,13 @@
# Embedded server doesn't support external clients
--source include/not_embedded.inc
+# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set
+# to the location of mysql_fix_privilege_tables.sql
+if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`)
+{
+ skip Test need MYSQL_FIX_PRIVILEGE_TABLES;
+}
+
#
# This is the test for mysql_fix_privilege_tables
# It checks that a system tables from mysql 4.1.23
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index a01efba11db..82de4dac111 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -1737,4 +1737,30 @@ 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;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/truncate.test b/mysql-test/t/truncate.test
index c52260124cb..ba5364bd324 100644
--- a/mysql-test/t/truncate.test
+++ b/mysql-test/t/truncate.test
@@ -54,33 +54,18 @@ drop table t1;
# End of 4.1 tests
# Test for Bug#5507 "TRUNCATE should work with views"
+#
+# when it'll be fixed, the error should become 1347
+# (test.v1' is not BASE TABLE)
+#
create table t1 (s1 int);
-
insert into t1 (s1) values (1), (2), (3), (4), (5);
create view v1 as select * from t1;
+--error 1146
truncate table v1;
-select count(*) from t1;
-
-insert into t1 (s1) values (1), (2), (3), (4), (5);
-create view v2 as select * from t1 where s1 > 3;
-truncate table v2;
-select * from t1;
-select * from v2;
-delete from t1;
-
-# The following should fail
-create table t2 (s1 int, s2 int);
-create view v3 as select a.s1, b.s2 from t1 a join t2 b on a.s1 = b.s1 where a.s1 > 3;
---error 1395
-truncate table v3;
-
-# The following should fail
-create view v4 as select * from t1 limit 1,1;
---error 1288
-truncate table v4;
-
-drop view v1, v2, v3, v4;
-drop table t1, t2;
+drop view v1;
+drop table t1;
# 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 3d04eb85cf3..d420afbde37 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -141,3 +141,133 @@ 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.
+#
+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;
+delete from t1;
+insert into t1 values('2001-01-01','2001-01-01 01:01:01','2001-01-01 01:01:01');
+insert into t1 values('2001-02-05','2001-02-05 00:00:00','2001-02-05 01:01:01');
+insert into t1 values('2001-03-10','2001-03-09 01:01:01','2001-03-10 01:01:01');
+insert into t1 values('2001-04-15','2001-04-15 00:00:00','2001-04-15 00:00:00');
+insert into t1 values('2001-05-20','2001-05-20 01:01:01','2001-05-20 01:01:01');
+select f1, f3 from t1 where f1 >= '2001-02-05 00:00:00' and f3 <= '2001-04-15';
+select f1, f3 from t1 where f1 >= '2001-2-5 0:0:0' and f2 <= '2001-4-15';
+select f1, f2 from t1 where if(1, f1, 0) >= f2;
+select 1 from dual where cast('2001-1-1 2:3:4' as date) = cast('2001-01-01' as datetime);
+select f1, f2, f1 > f2, f1 = f2, f1 < f2 from t1;
+drop table t1;
+
+#
+# Bug#16377: Wrong DATE/DATETIME comparison in BETWEEN function.
+#
+create table t1 (f1 date, f2 datetime, f3 timestamp);
+insert into t1 values('2001-01-01','2001-01-01 01:01:01','2001-01-01 01:01:01');
+insert into t1 values('2001-02-05','2001-02-05 00:00:00','2001-02-05 01:01:01');
+insert into t1 values('2001-03-10','2001-03-09 01:01:01','2001-03-10 01:01:01');
+insert into t1 values('2001-04-15','2001-04-15 00:00:00','2001-04-15 00:00:00');
+insert into t1 values('2001-05-20','2001-05-20 01:01:01','2001-05-20 01:01:01');
+select f2 from t1 where f2 between '2001-2-5' and '01-04-14';
+select f1, f2, f3 from t1 where f1 between f2 and f3;
+select f1, f2, f3 from t1 where cast(f1 as datetime) between f2 and
+ cast(f3 as date);
+select f2 from t1 where '2001-04-10 12:34:56' between f2 and '01-05-01';
+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_newdecimal.test b/mysql-test/t/type_newdecimal.test
index 4c6098d2121..a7906be79d4 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -1130,4 +1130,23 @@ 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;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test
index 6cec940d286..f79c9e773aa 100644
--- a/mysql-test/t/update.test
+++ b/mysql-test/t/update.test
@@ -376,3 +376,58 @@ INSERT INTO t1( a )
SELECT * FROM t1;
DROP TABLE t1;
+
+#
+# Bug #22364: Inconsistent "matched rows" when executing UPDATE
+#
+
+connect (con1,localhost,root,,test);
+connection con1;
+
+set tmp_table_size=1024;
+
+# Create the test tables
+create table t1 (id int, a int, key idx(a));
+create table t2 (id int unsigned not null auto_increment primary key, a int);
+insert into t2(a) values(1),(2),(3),(4),(5),(6),(7),(8);
+insert into t2(a) select a from t2;
+insert into t2(a) select a from t2;
+insert into t2(a) select a from t2;
+update t2 set a=id;
+insert into t1 select * from t2;
+
+# Check that the number of matched rows is correct when the temporary
+# table is small enough to not be converted to MyISAM
+select count(*) from t1 join t2 on (t1.a=t2.a);
+--enable_info
+update t1 join t2 on (t1.a=t2.a) set t1.id=t2.id;
+--disable_info
+
+# Increase table sizes
+insert into t2(a) select a from t2;
+update t2 set a=id;
+truncate t1;
+insert into t1 select * from t2;
+
+# Check that the number of matched rows is correct when the temporary
+# table has to be converted to MyISAM
+select count(*) from t1 join t2 on (t1.a=t2.a);
+--enable_info
+update t1 join t2 on (t1.a=t2.a) set t1.id=t2.id;
+--disable_info
+
+# Check that the number of matched rows is correct when there are duplicate
+# key errors
+update t1 set a=1;
+update t2 set a=1;
+select count(*) from t1 join t2 on (t1.a=t2.a);
+--enable_info
+update t1 join t2 on (t1.a=t2.a) set t1.id=t2.id;
+--disable_info
+
+drop table t1,t2;
+
+connection default;
+disconnect con1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/variables-big.test b/mysql-test/t/variables-big.test
new file mode 100644
index 00000000000..43326f3d016
--- /dev/null
+++ b/mysql-test/t/variables-big.test
@@ -0,0 +1,20 @@
+#
+# test variables big
+#
+
+--source include/big_test.inc
+
+#
+# Bug #27322 failure to allocate transaction_prealloc_size causes crash
+#
+
+set session transaction_prealloc_size=1024*1024*1024*1;
+show processlist;
+set session transaction_prealloc_size=1024*1024*1024*2;
+show processlist;
+set session transaction_prealloc_size=1024*1024*1024*3;
+show processlist;
+set session transaction_prealloc_size=1024*1024*1024*4;
+show processlist;
+set session transaction_prealloc_size=1024*1024*1024*5;
+show processlist;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 920fcee3b24..3275ba0a687 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3205,4 +3205,32 @@ SELECT * FROM v1;
DROP VIEW v1;
DROP table t1,t2;
+#
+# Bug#27786: Inconsistent Operation Performing UNION On View With ORDER BY
+#
+CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2),(3);
+CREATE VIEW v1 AS SELECT a FROM t1 ORDER BY a;
+
+SELECT * FROM t1 UNION SELECT * FROM v1;
+EXPLAIN SELECT * FROM t1 UNION SELECT * FROM v1;
+SELECT * FROM v1 UNION SELECT * FROM t1;
+EXPLAIN SELECT * FROM v1 UNION SELECT * FROM t1;
+SELECT * FROM t1 UNION SELECT * FROM v1 ORDER BY a;
+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;
+
--echo End of 5.0 tests.
diff --git a/mysql-test/t/windows.test b/mysql-test/t/windows.test
index b5377a9b9b0..6976ee98750 100644
--- a/mysql-test/t/windows.test
+++ b/mysql-test/t/windows.test
@@ -27,3 +27,11 @@ CREATE TABLE t1 ( `ID` int(6) ) data directory 'c:/tmp/' index directory 'c:/tmp
drop table t1;
# End of 4.1 tests
+
+#
+# Bug #27811: The variable 'join_tab' is being used without being defined
+#
+CREATE TABLE t1 (a int, b int); INSERT INTO t1 VALUES (1,1);
+EXPLAIN SELECT * FROM t1 WHERE b = (SELECT max(2));
+
+--echo End of 5.0 tests.
diff --git a/mysys/charset.c b/mysys/charset.c
index 9fb02f1a39f..cce97677b14 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -388,7 +388,7 @@ my_bool STDCALL init_available_charsets(myf myflags)
static my_bool init_available_charsets(myf myflags)
#endif
{
- char fname[FN_REFLEN];
+ char fname[FN_REFLEN + sizeof(MY_CHARSET_INDEX)];
my_bool error=FALSE;
/*
We have to use charset_initialized to not lock on THR_LOCK_charset
@@ -519,7 +519,7 @@ CHARSET_INFO *get_charset(uint cs_number, myf flags)
if (!cs && (flags & MY_WME))
{
- char index_file[FN_REFLEN], cs_string[23];
+ char index_file[FN_REFLEN + sizeof(MY_CHARSET_INDEX)], cs_string[23];
strmov(get_charsets_dir(index_file),MY_CHARSET_INDEX);
cs_string[0]='#';
int10_to_str(cs_number, cs_string+1, 10);
@@ -539,7 +539,7 @@ CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags)
if (!cs && (flags & MY_WME))
{
- char index_file[FN_REFLEN];
+ char index_file[FN_REFLEN + sizeof(MY_CHARSET_INDEX)];
strmov(get_charsets_dir(index_file),MY_CHARSET_INDEX);
my_error(EE_UNKNOWN_COLLATION, MYF(ME_BELL), cs_name, index_file);
}
@@ -564,7 +564,7 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name,
if (!cs && (flags & MY_WME))
{
- char index_file[FN_REFLEN];
+ char index_file[FN_REFLEN + sizeof(MY_CHARSET_INDEX)];
strmov(get_charsets_dir(index_file),MY_CHARSET_INDEX);
my_error(EE_UNKNOWN_CHARSET, MYF(ME_BELL), cs_name, index_file);
}
diff --git a/mysys/default.c b/mysys/default.c
index dc1c5a698b8..aff38b6af0b 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -877,8 +877,8 @@ void my_print_default_files(const char *conf_file)
fputs(name,stdout);
}
}
- puts("");
}
+ puts("");
}
void print_defaults(const char *conf_file, const char **groups)
diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c
index cfa2dd6216d..5983a29a3e1 100644
--- a/mysys/my_alloc.c
+++ b/mysys/my_alloc.c
@@ -133,6 +133,10 @@ void reset_root_defaults(MEM_ROOT *mem_root, uint block_size,
mem->next= *prev;
*prev= mem_root->pre_alloc= mem;
}
+ else
+ {
+ mem_root->pre_alloc= 0;
+ }
}
}
else
diff --git a/mysys/my_copy.c b/mysys/my_copy.c
index 6143700befc..ec642b4083c 100644
--- a/mysys/my_copy.c
+++ b/mysys/my_copy.c
@@ -111,6 +111,11 @@ int my_copy(const char *from, const char *to, myf MyFlags)
err:
if (from_file >= 0) VOID(my_close(from_file,MyFlags));
- if (to_file >= 0) VOID(my_close(to_file,MyFlags));
+ if (to_file >= 0)
+ {
+ VOID(my_close(to_file, MyFlags));
+ /* attempt to delete the to-file we've partially written */
+ VOID(my_delete(to, MyFlags));
+ }
DBUG_RETURN(-1);
} /* my_copy */
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 7a5fdbf8ad6..07a92e34dd3 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -79,11 +79,12 @@ static uint get_thread_lib(void);
my_bool my_thread_global_init(void)
{
+ int pth_ret;
thd_lib_detected= get_thread_lib();
- if (pthread_key_create(&THR_KEY_mysys,0))
+ if ((pth_ret= pthread_key_create(&THR_KEY_mysys, NULL)) != 0)
{
- fprintf(stderr,"Can't initialize threads: error %d\n",errno);
+ fprintf(stderr,"Can't initialize threads: error %d\n", pth_ret);
return 1;
}
diff --git a/ndb/include/kernel/signaldata/ScanTab.hpp b/ndb/include/kernel/signaldata/ScanTab.hpp
index 70d12c96756..15a022e2cba 100644
--- a/ndb/include/kernel/signaldata/ScanTab.hpp
+++ b/ndb/include/kernel/signaldata/ScanTab.hpp
@@ -113,15 +113,15 @@ private:
z = Descending (TUX) - 1 Bit 14
x = Range Scan (TUX) - 1 Bit 15
b = Scan batch - 10 Bit 16-25 (max 1023)
- d = Distribution key flag
+ d = Distribution key flag - 1 Bit 26
1111111111222222222233
01234567890123456789012345678901
- ppppppppl hcktzxbbbbbbbbbb
+ ppppppppl hcktzxbbbbbbbbbbd
*/
-#define PARALLELL_SHIFT (0)
-#define PARALLELL_MASK (255)
+#define PARALLEL_SHIFT (0)
+#define PARALLEL_MASK (255)
#define LOCK_MODE_SHIFT (8)
#define LOCK_MODE_MASK (1)
@@ -148,11 +148,12 @@ private:
#define SCAN_BATCH_MASK (1023)
#define SCAN_DISTR_KEY_SHIFT (26)
+#define SCAN_DISTR_KEY_MASK (1)
inline
Uint8
ScanTabReq::getParallelism(const UintR & requestInfo){
- return (Uint8)((requestInfo >> PARALLELL_SHIFT) & PARALLELL_MASK);
+ return (Uint8)((requestInfo >> PARALLEL_SHIFT) & PARALLEL_MASK);
}
inline
@@ -206,58 +207,65 @@ ScanTabReq::clearRequestInfo(UintR & requestInfo){
inline
void
ScanTabReq::setParallelism(UintR & requestInfo, Uint32 type){
- ASSERT_MAX(type, PARALLELL_MASK, "ScanTabReq::setParallellism");
- requestInfo |= (type << PARALLELL_SHIFT);
+ ASSERT_MAX(type, PARALLEL_MASK, "ScanTabReq::setParallelism");
+ requestInfo= (requestInfo & ~(PARALLEL_MASK << PARALLEL_SHIFT)) |
+ ((type & PARALLEL_MASK) << PARALLEL_SHIFT);
}
inline
void
ScanTabReq::setLockMode(UintR & requestInfo, Uint32 mode){
ASSERT_MAX(mode, LOCK_MODE_MASK, "ScanTabReq::setLockMode");
- requestInfo |= (mode << LOCK_MODE_SHIFT);
+ requestInfo= (requestInfo & ~(LOCK_MODE_MASK << LOCK_MODE_SHIFT)) |
+ ((mode & LOCK_MODE_MASK) << LOCK_MODE_SHIFT);
}
inline
void
ScanTabReq::setHoldLockFlag(UintR & requestInfo, Uint32 flag){
ASSERT_BOOL(flag, "ScanTabReq::setHoldLockFlag");
- requestInfo |= (flag << HOLD_LOCK_SHIFT);
+ requestInfo= (requestInfo & ~(HOLD_LOCK_MASK << HOLD_LOCK_SHIFT)) |
+ ((flag & HOLD_LOCK_MASK) << HOLD_LOCK_SHIFT);
}
inline
void
ScanTabReq::setReadCommittedFlag(UintR & requestInfo, Uint32 flag){
ASSERT_BOOL(flag, "ScanTabReq::setReadCommittedFlag");
- requestInfo |= (flag << READ_COMMITTED_SHIFT);
+ requestInfo= (requestInfo & ~(READ_COMMITTED_MASK << READ_COMMITTED_SHIFT)) |
+ ((flag & READ_COMMITTED_MASK) << READ_COMMITTED_SHIFT);
}
inline
void
ScanTabReq::setRangeScanFlag(UintR & requestInfo, Uint32 flag){
ASSERT_BOOL(flag, "ScanTabReq::setRangeScanFlag");
- requestInfo |= (flag << RANGE_SCAN_SHIFT);
+ requestInfo= (requestInfo & ~(RANGE_SCAN_MASK << RANGE_SCAN_SHIFT)) |
+ ((flag & RANGE_SCAN_MASK) << RANGE_SCAN_SHIFT);
}
inline
void
ScanTabReq::setDescendingFlag(UintR & requestInfo, Uint32 flag){
ASSERT_BOOL(flag, "ScanTabReq::setDescendingFlag");
- requestInfo |= (flag << DESCENDING_SHIFT);
+ requestInfo= (requestInfo & ~(DESCENDING_MASK << DESCENDING_SHIFT)) |
+ ((flag & DESCENDING_MASK) << DESCENDING_SHIFT);
}
inline
void
ScanTabReq::setTupScanFlag(UintR & requestInfo, Uint32 flag){
ASSERT_BOOL(flag, "ScanTabReq::setTupScanFlag");
- requestInfo |= (flag << TUP_SCAN_SHIFT);
+ requestInfo= (requestInfo & ~(TUP_SCAN_MASK << TUP_SCAN_SHIFT)) |
+ ((flag & TUP_SCAN_MASK) << TUP_SCAN_SHIFT);
}
inline
void
ScanTabReq::setScanBatch(Uint32 & requestInfo, Uint32 flag){
ASSERT_MAX(flag, SCAN_BATCH_MASK, "ScanTabReq::setScanBatch");
- requestInfo &= ~(SCAN_BATCH_MASK << SCAN_BATCH_SHIFT);
- requestInfo |= (flag << SCAN_BATCH_SHIFT);
+ requestInfo= (requestInfo & ~(SCAN_BATCH_MASK << SCAN_BATCH_SHIFT)) |
+ ((flag & SCAN_BATCH_MASK) << SCAN_BATCH_SHIFT);
}
inline
@@ -270,7 +278,8 @@ inline
void
ScanTabReq::setKeyinfoFlag(UintR & requestInfo, Uint32 flag){
ASSERT_BOOL(flag, "ScanTabReq::setKeyinfoFlag");
- requestInfo |= (flag << KEYINFO_SHIFT);
+ requestInfo= (requestInfo & ~(KEYINFO_MASK << KEYINFO_SHIFT)) |
+ ((flag & KEYINFO_MASK) << KEYINFO_SHIFT);
}
inline
@@ -283,7 +292,8 @@ inline
void
ScanTabReq::setDistributionKeyFlag(UintR & requestInfo, Uint32 flag){
ASSERT_BOOL(flag, "ScanTabReq::setKeyinfoFlag");
- requestInfo |= (flag << SCAN_DISTR_KEY_SHIFT);
+ requestInfo= (requestInfo & ~(SCAN_DISTR_KEY_MASK << SCAN_DISTR_KEY_SHIFT)) |
+ ((flag & SCAN_DISTR_KEY_MASK) << SCAN_DISTR_KEY_SHIFT);
}
/**
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/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp
index 5af86cd09a8..b3c9acd4e20 100644
--- a/ndb/include/ndbapi/Ndb.hpp
+++ b/ndb/include/ndbapi/Ndb.hpp
@@ -1051,18 +1051,7 @@ class Ndb
friend class NdbDictionaryImpl;
friend class NdbDictInterface;
friend class NdbBlob;
- friend class Ndb_free_list_t<NdbRecAttr>;
- friend class Ndb_free_list_t<NdbApiSignal>;
- friend class Ndb_free_list_t<NdbLabel>;
- friend class Ndb_free_list_t<NdbBranch>;
- friend class Ndb_free_list_t<NdbSubroutine>;
- friend class Ndb_free_list_t<NdbCall>;
- friend class Ndb_free_list_t<NdbBlob>;
- friend class Ndb_free_list_t<NdbReceiver>;
- friend class Ndb_free_list_t<NdbIndexScanOperation>;
- friend class Ndb_free_list_t<NdbOperation>;
- friend class Ndb_free_list_t<NdbIndexOperation>;
- friend class Ndb_free_list_t<NdbTransaction>;
+ friend class NdbImpl;
#endif
public:
diff --git a/ndb/include/ndbapi/NdbOperation.hpp b/ndb/include/ndbapi/NdbOperation.hpp
index 5e9e6b9bde9..d4e300be15e 100644
--- a/ndb/include/ndbapi/NdbOperation.hpp
+++ b/ndb/include/ndbapi/NdbOperation.hpp
@@ -908,6 +908,8 @@ protected:
// get table or index key from prepared signals
int getKeyFromTCREQ(Uint32* data, unsigned size);
+ virtual void setReadLockMode(LockMode lockMode);
+
/******************************************************************************
* These are the private variables that are defined in the operation objects.
*****************************************************************************/
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/include/ndbapi/NdbScanOperation.hpp b/ndb/include/ndbapi/NdbScanOperation.hpp
index c84e12bfe7b..9117207b72c 100644
--- a/ndb/include/ndbapi/NdbScanOperation.hpp
+++ b/ndb/include/ndbapi/NdbScanOperation.hpp
@@ -212,6 +212,7 @@ protected:
int prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId);
int doSend(int ProcessorId);
void checkForceSend(bool forceSend);
+ virtual void setReadLockMode(LockMode lockMode);
virtual void setErrorCode(int aErrorCode);
virtual void setErrorCodeAbort(int aErrorCode);
diff --git a/ndb/include/ndbapi/NdbTransaction.hpp b/ndb/include/ndbapi/NdbTransaction.hpp
index d3405633f80..966872755ca 100644
--- a/ndb/include/ndbapi/NdbTransaction.hpp
+++ b/ndb/include/ndbapi/NdbTransaction.hpp
@@ -379,14 +379,16 @@ public:
void executeAsynch(ExecType aTypeOfExec,
NdbAsynchCallback aCallback,
void* anyObject,
- AbortOption abortOption = AbortOnError);
+ AbortOption abortOption = AbortOnError,
+ int forceSend= 0);
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
void executeAsynch(::ExecType aTypeOfExec,
NdbAsynchCallback aCallback,
void* anyObject,
- ::AbortOption abortOption= ::AbortOnError)
+ ::AbortOption abortOption= ::AbortOnError,
+ int forceSend= 0)
{ executeAsynch((ExecType)aTypeOfExec, aCallback, anyObject,
- (AbortOption)abortOption); }
+ (AbortOption)abortOption, forceSend); }
#endif
#endif
/**
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 b8e2cfca41e..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;
}
@@ -6883,6 +6905,7 @@ Dbdict::createIndex_toCreateTable(Signal* signal, OpCreateIndexPtr opPtr)
w.add(DictTabInfo::NoOfKeyAttr, indexPtr.p->noOfPrimkey);
w.add(DictTabInfo::NoOfNullable, indexPtr.p->noOfNullAttr);
w.add(DictTabInfo::KeyLength, indexPtr.p->tupKeyLength);
+ w.add(DictTabInfo::SingleUserMode, (Uint32)NDB_SUM_READ_WRITE);
// write index key attributes
AttributeRecordPtr aRecPtr;
c_attributeRecordPool.getPtr(aRecPtr, tablePtr.p->firstAttribute);
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/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp
index 2d8a4cf6bf8..7ab9c2132d8 100644
--- a/ndb/src/ndbapi/NdbBlob.cpp
+++ b/ndb/src/ndbapi/NdbBlob.cpp
@@ -1163,7 +1163,7 @@ NdbBlob::atPrepare(NdbTransaction* aCon, NdbOperation* anOp, const NdbColumnImpl
if (isReadOp()) {
// upgrade lock mode
if (theNdbOp->theLockMode == NdbOperation::LM_CommittedRead)
- theNdbOp->theLockMode = NdbOperation::LM_Read;
+ theNdbOp->setReadLockMode(NdbOperation::LM_Read);
// add read of head+inline in this op
if (getHeadInlineValue(theNdbOp) == -1)
DBUG_RETURN(-1);
@@ -1184,7 +1184,7 @@ NdbBlob::atPrepare(NdbTransaction* aCon, NdbOperation* anOp, const NdbColumnImpl
if (isScanOp()) {
// upgrade lock mode
if (theNdbOp->theLockMode == NdbOperation::LM_CommittedRead)
- theNdbOp->theLockMode = NdbOperation::LM_Read;
+ theNdbOp->setReadLockMode(NdbOperation::LM_Read);
// add read of head+inline in this op
if (getHeadInlineValue(theNdbOp) == -1)
DBUG_RETURN(-1);
diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp
index ec386074692..dc0a057619f 100644
--- a/ndb/src/ndbapi/NdbImpl.hpp
+++ b/ndb/src/ndbapi/NdbImpl.hpp
@@ -89,6 +89,15 @@ public:
return 0;
}
+/*
+ We need this friend accessor function to work around a HP compiler problem,
+ where template class friends are not working.
+*/
+ static inline void setNdbError(Ndb &ndb,int code){
+ ndb.theError.code = code;
+ return;
+ }
+
/**
* NOTE free lists must be _after_ theNdbObjectIdMap take
* assure that destructors are run in correct order
@@ -208,7 +217,7 @@ Ndb_free_list_t<T>::fill(Ndb* ndb, Uint32 cnt)
m_free_list = new T(ndb);
if (m_free_list == 0)
{
- ndb->theError.code = 4000;
+ NdbImpl::setNdbError(*ndb, 4000);
assert(false);
return -1;
}
@@ -218,7 +227,7 @@ Ndb_free_list_t<T>::fill(Ndb* ndb, Uint32 cnt)
T* obj= new T(ndb);
if(obj == 0)
{
- ndb->theError.code = 4000;
+ NdbImpl::setNdbError(*ndb, 4000);
assert(false);
return -1;
}
@@ -250,7 +259,7 @@ Ndb_free_list_t<T>::seize(Ndb* ndb)
}
else
{
- ndb->theError.code = 4000;
+ NdbImpl::setNdbError(*ndb, 4000);
assert(false);
}
return tmp;
diff --git a/ndb/src/ndbapi/NdbOperationDefine.cpp b/ndb/src/ndbapi/NdbOperationDefine.cpp
index d4112f0a34b..95e90609f9b 100644
--- a/ndb/src/ndbapi/NdbOperationDefine.cpp
+++ b/ndb/src/ndbapi/NdbOperationDefine.cpp
@@ -322,6 +322,36 @@ NdbOperation::interpretedDeleteTuple()
}//if
}//NdbOperation::interpretedDeleteTuple()
+void
+NdbOperation::setReadLockMode(LockMode lockMode)
+{
+ /* We only support changing lock mode for read operations at this time. */
+ assert(theOperationType == ReadRequest || theOperationType == ReadExclusive);
+ switch (lockMode)
+ {
+ case LM_CommittedRead:
+ theOperationType= ReadRequest;
+ theSimpleIndicator= 1;
+ theDirtyIndicator= 1;
+ break;
+ case LM_Read:
+ theNdbCon->theSimpleState= 0;
+ theOperationType= ReadRequest;
+ theSimpleIndicator= 0;
+ theDirtyIndicator= 0;
+ break;
+ case LM_Exclusive:
+ theNdbCon->theSimpleState= 0;
+ theOperationType= ReadExclusive;
+ theSimpleIndicator= 0;
+ theDirtyIndicator= 0;
+ break;
+ default:
+ /* Not supported / invalid. */
+ assert(false);
+ }
+ theLockMode= lockMode;
+}
/******************************************************************************
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/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp
index 91c788b0088..aec98a7f5d5 100644
--- a/ndb/src/ndbapi/NdbScanOperation.cpp
+++ b/ndb/src/ndbapi/NdbScanOperation.cpp
@@ -136,31 +136,6 @@ NdbScanOperation::readTuples(NdbScanOperation::LockMode lm,
}
theNdbCon->theScanningOp = this;
- theLockMode = lm;
-
- bool lockExcl, lockHoldMode, readCommitted;
- switch(lm){
- case NdbScanOperation::LM_Read:
- lockExcl = false;
- lockHoldMode = true;
- readCommitted = false;
- break;
- case NdbScanOperation::LM_Exclusive:
- lockExcl = true;
- lockHoldMode = true;
- readCommitted = false;
- break;
- case NdbScanOperation::LM_CommittedRead:
- lockExcl = false;
- lockHoldMode = false;
- readCommitted = true;
- break;
- default:
- setErrorCode(4003);
- return -1;
- }
-
- m_keyInfo = ((scan_flags & SF_KeyInfo) || lockExcl) ? 1 : 0;
bool rangeScan = false;
if (m_accessTable->m_indexType == NdbDictionary::Index::OrderedIndex)
@@ -210,13 +185,13 @@ NdbScanOperation::readTuples(NdbScanOperation::LockMode lm,
Uint32 reqInfo = 0;
ScanTabReq::setParallelism(reqInfo, parallel);
ScanTabReq::setScanBatch(reqInfo, 0);
- ScanTabReq::setLockMode(reqInfo, lockExcl);
- ScanTabReq::setHoldLockFlag(reqInfo, lockHoldMode);
- ScanTabReq::setReadCommittedFlag(reqInfo, readCommitted);
ScanTabReq::setRangeScanFlag(reqInfo, rangeScan);
ScanTabReq::setTupScanFlag(reqInfo, tupScan);
req->requestInfo = reqInfo;
+ m_keyInfo = (scan_flags & SF_KeyInfo) ? 1 : 0;
+ setReadLockMode(lm);
+
Uint64 transId = theNdbCon->getTransactionId();
req->transId1 = (Uint32) transId;
req->transId2 = (Uint32) (transId >> 32);
@@ -236,6 +211,41 @@ NdbScanOperation::readTuples(NdbScanOperation::LockMode lm,
return 0;
}
+void
+NdbScanOperation::setReadLockMode(LockMode lockMode)
+{
+ bool lockExcl, lockHoldMode, readCommitted;
+ switch (lockMode)
+ {
+ case LM_CommittedRead:
+ lockExcl= false;
+ lockHoldMode= false;
+ readCommitted= true;
+ break;
+ case LM_Read:
+ lockExcl= false;
+ lockHoldMode= true;
+ readCommitted= false;
+ break;
+ case LM_Exclusive:
+ lockExcl= true;
+ lockHoldMode= true;
+ readCommitted= false;
+ m_keyInfo= 1;
+ break;
+ default:
+ /* Not supported / invalid. */
+ assert(false);
+ }
+ theLockMode= lockMode;
+ ScanTabReq *req= CAST_PTR(ScanTabReq, theSCAN_TABREQ->getDataPtrSend());
+ Uint32 reqInfo= req->requestInfo;
+ ScanTabReq::setLockMode(reqInfo, lockExcl);
+ ScanTabReq::setHoldLockFlag(reqInfo, lockHoldMode);
+ ScanTabReq::setReadCommittedFlag(reqInfo, readCommitted);
+ req->requestInfo= reqInfo;
+}
+
int
NdbScanOperation::fix_receivers(Uint32 parallel){
assert(parallel > 0);
diff --git a/ndb/src/ndbapi/NdbTransaction.cpp b/ndb/src/ndbapi/NdbTransaction.cpp
index 258330b3967..f5076ff2020 100644
--- a/ndb/src/ndbapi/NdbTransaction.cpp
+++ b/ndb/src/ndbapi/NdbTransaction.cpp
@@ -706,6 +706,17 @@ NdbTransaction::executeAsynchPrepare( ExecType aTypeOfExec,
DBUG_VOID_RETURN;
}//NdbTransaction::executeAsynchPrepare()
+void
+NdbTransaction::executeAsynch(ExecType aTypeOfExec,
+ NdbAsynchCallback aCallback,
+ void* anyObject,
+ AbortOption abortOption,
+ int forceSend)
+{
+ executeAsynchPrepare(aTypeOfExec, aCallback, anyObject, abortOption);
+ theNdb->sendPreparedTransactions(forceSend);
+}
+
void NdbTransaction::close()
{
theNdb->closeTransaction(this);
diff --git a/ndb/test/ndbapi/testBlobs.cpp b/ndb/test/ndbapi/testBlobs.cpp
index 88b679eeeec..6b08b7d686e 100644
--- a/ndb/test/ndbapi/testBlobs.cpp
+++ b/ndb/test/ndbapi/testBlobs.cpp
@@ -141,6 +141,7 @@ printusage()
<< "bug tests" << endl
<< " -bug 4088 ndb api hang with mixed ops on index table" << endl
<< " -bug 27018 middle partial part write clobbers rest of part" << endl
+ << " -bug 27370 Potential inconsistent blob reads for ReadCommitted reads" << endl
;
}
@@ -1885,12 +1886,210 @@ bugtest_27018()
return 0;
}
+
+struct bug27370_data {
+ Ndb *m_ndb;
+ char m_current_write_value;
+ char *m_writebuf;
+ Uint32 m_blob1_size;
+ Uint32 m_pk1;
+ char m_pk2[g_max_pk2len + 1];
+ bool m_thread_stop;
+};
+
+void *bugtest_27370_thread(void *arg)
+{
+ bug27370_data *data= (bug27370_data *)arg;
+
+ while (!data->m_thread_stop)
+ {
+ memset(data->m_writebuf, data->m_current_write_value, data->m_blob1_size);
+ data->m_current_write_value++;
+
+ NdbConnection *con;
+ if ((con= data->m_ndb->startTransaction()) == 0)
+ return (void *)"Failed to create transaction";
+ NdbOperation *opr;
+ if ((opr= con->getNdbOperation(g_opt.m_tname)) == 0)
+ return (void *)"Failed to create operation";
+ if (opr->writeTuple() != 0)
+ return (void *)"writeTuple() failed";
+ if (opr->equal("PK1", data->m_pk1) != 0)
+ return (void *)"equal(PK1) failed";
+ if (g_opt.m_pk2len != 0)
+ if (opr->equal("PK2", data->m_pk2) != 0)
+ return (void *)"equal(PK2) failed";
+ NdbBlob *bh;
+ if ((bh= opr->getBlobHandle("BL1")) == 0)
+ return (void *)"getBlobHandle() failed";
+ if (bh->setValue(data->m_writebuf, data->m_blob1_size) != 0)
+ return (void *)"setValue() failed";
+ if (con->execute(Commit, AbortOnError, 1) != 0)
+ return (void *)"execute() failed";
+ data->m_ndb->closeTransaction(con);
+ }
+
+ return NULL; // Success
+}
+
+static int
+bugtest_27370()
+{
+ DBG("bug test 27370 - Potential inconsistent blob reads for ReadCommitted reads");
+
+ bug27370_data data;
+
+ data.m_ndb= new Ndb(g_ncc, "TEST_DB");
+ CHK(data.m_ndb->init(20) == 0);
+ CHK(data.m_ndb->waitUntilReady() == 0);
+
+ data.m_current_write_value= 0;
+ data.m_blob1_size= g_opt.m_blob1.m_inline + 10 * g_opt.m_blob1.m_partsize;
+ CHK((data.m_writebuf= new char [data.m_blob1_size]) != 0);
+ data.m_pk1= 27370;
+ memset(data.m_pk2, 'x', g_max_pk2len);
+ data.m_pk2[g_max_pk2len]= '\0';
+ data.m_thread_stop= false;
+
+ memset(data.m_writebuf, data.m_current_write_value, data.m_blob1_size);
+ data.m_current_write_value++;
+
+ CHK((g_con= g_ndb->startTransaction()) != 0);
+ CHK((g_opr= g_con->getNdbOperation(g_opt.m_tname)) != 0);
+ CHK(g_opr->writeTuple() == 0);
+ CHK(g_opr->equal("PK1", data.m_pk1) == 0);
+ if (g_opt.m_pk2len != 0)
+ CHK(g_opr->equal("PK2", data.m_pk2) == 0);
+ CHK((g_bh1= g_opr->getBlobHandle("BL1")) != 0);
+ CHK(g_bh1->setValue(data.m_writebuf, data.m_blob1_size) == 0);
+ CHK(g_con->execute(Commit) == 0);
+ g_ndb->closeTransaction(g_con);
+ g_con= NULL;
+
+ pthread_t thread_handle;
+ CHK(pthread_create(&thread_handle, NULL, bugtest_27370_thread, &data) == 0);
+
+ DBG("bug test 27370 - PK blob reads");
+ Uint32 seen_updates= 0;
+ while (seen_updates < 50)
+ {
+ CHK((g_con= g_ndb->startTransaction()) != 0);
+ CHK((g_opr= g_con->getNdbOperation(g_opt.m_tname)) != 0);
+ CHK(g_opr->readTuple(NdbOperation::LM_CommittedRead) == 0);
+ CHK(g_opr->equal("PK1", data.m_pk1) == 0);
+ if (g_opt.m_pk2len != 0)
+ CHK(g_opr->equal("PK2", data.m_pk2) == 0);
+ CHK((g_bh1= g_opr->getBlobHandle("BL1")) != 0);
+ CHK(g_con->execute(NoCommit, AbortOnError, 1) == 0);
+
+ const Uint32 loop_max= 10;
+ char read_char;
+ char original_read_char= 0;
+ Uint32 readloop;
+ for (readloop= 0;; readloop++)
+ {
+ if (readloop > 0)
+ {
+ if (readloop > 1)
+ {
+ /* Compare against first read. */
+ CHK(read_char == original_read_char);
+ }
+ else
+ {
+ /*
+ We count the number of times we see the other thread had the
+ chance to update, so that we can be sure it had the opportunity
+ to run a reasonable number of times before we stop.
+ */
+ if (original_read_char != read_char)
+ seen_updates++;
+ original_read_char= read_char;
+ }
+ }
+ if (readloop > loop_max)
+ break;
+ Uint32 readSize= 1;
+ CHK(g_bh1->setPos(urandom(data.m_blob1_size)) == 0);
+ CHK(g_bh1->readData(&read_char, readSize) == 0);
+ CHK(readSize == 1);
+ ExecType commitType= readloop == loop_max ? Commit : NoCommit;
+ CHK(g_con->execute(commitType, AbortOnError, 1) == 0);
+ }
+ g_ndb->closeTransaction(g_con);
+ g_con= NULL;
+ }
+
+ DBG("bug test 27370 - table scan blob reads");
+ seen_updates= 0;
+ while (seen_updates < 50)
+ {
+ CHK((g_con= g_ndb->startTransaction()) != 0);
+ CHK((g_ops= g_con->getNdbScanOperation(g_opt.m_tname)) != 0);
+ CHK(g_ops->readTuples(NdbOperation::LM_CommittedRead) == 0);
+ CHK((g_bh1= g_ops->getBlobHandle("BL1")) != 0);
+ CHK(g_con->execute(NoCommit, AbortOnError, 1) == 0);
+ CHK(g_ops->nextResult(true) == 0);
+
+ const Uint32 loop_max= 10;
+ char read_char;
+ char original_read_char= 0;
+ Uint32 readloop;
+ for (readloop= 0;; readloop++)
+ {
+ if (readloop > 0)
+ {
+ if (readloop > 1)
+ {
+ /* Compare against first read. */
+ CHK(read_char == original_read_char);
+ }
+ else
+ {
+ /*
+ We count the number of times we see the other thread had the
+ chance to update, so that we can be sure it had the opportunity
+ to run a reasonable number of times before we stop.
+ */
+ if (original_read_char != read_char)
+ seen_updates++;
+ original_read_char= read_char;
+ }
+ }
+ if (readloop > loop_max)
+ break;
+ Uint32 readSize= 1;
+ CHK(g_bh1->setPos(urandom(data.m_blob1_size)) == 0);
+ CHK(g_bh1->readData(&read_char, readSize) == 0);
+ CHK(readSize == 1);
+ CHK(g_con->execute(NoCommit, AbortOnError, 1) == 0);
+ }
+
+ CHK(g_ops->nextResult(true) == 1);
+ g_ndb->closeTransaction(g_con);
+ g_con= NULL;
+ }
+
+ data.m_thread_stop= true;
+ void *thread_return;
+ CHK(pthread_join(thread_handle, &thread_return) == 0);
+ DBG("bug 27370 - thread return status: " <<
+ (thread_return ? (char *)thread_return : "<null>"));
+ CHK(thread_return == 0);
+
+ g_con= NULL;
+ g_opr= NULL;
+ g_bh1= NULL;
+ return 0;
+}
+
static struct {
int m_bug;
int (*m_test)();
} g_bugtest[] = {
{ 4088, bugtest_4088 },
- { 27018, bugtest_27018 }
+ { 27018, bugtest_27018 },
+ { 27370, bugtest_27370 }
};
NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535)
diff --git a/ndb/test/ndbapi/testNdbApi.cpp b/ndb/test/ndbapi/testNdbApi.cpp
index a8ea420804e..ec510c8b270 100644
--- a/ndb/test/ndbapi/testNdbApi.cpp
+++ b/ndb/test/ndbapi/testNdbApi.cpp
@@ -1234,8 +1234,108 @@ int runScan_4006(NDBT_Context* ctx, NDBT_Step* step){
return result;
}
+static void
+testExecuteAsynchCallback(int res, NdbTransaction *con, void *data_ptr)
+{
+ int *res_ptr= (int *)data_ptr;
+
+ *res_ptr= res;
+}
+
+int runTestExecuteAsynch(NDBT_Context* ctx, NDBT_Step* step){
+ /* Test that NdbTransaction::executeAsynch() works (BUG#27495). */
+ int result = NDBT_OK;
+ const NdbDictionary::Table* pTab = ctx->getTab();
+
+ Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB");
+ if (pNdb == NULL){
+ ndbout << "pNdb == NULL" << endl;
+ return NDBT_FAILED;
+ }
+ if (pNdb->init(2048)){
+ ERR(pNdb->getNdbError());
+ delete pNdb;
+ return NDBT_FAILED;
+ }
+
+ NdbConnection* pCon = pNdb->startTransaction();
+ if (pCon == NULL){
+ ERR(pNdb->getNdbError());
+ delete pNdb;
+ return NDBT_FAILED;
+ }
+
+ NdbScanOperation* pOp = pCon->getNdbScanOperation(pTab->getName());
+ if (pOp == NULL){
+ ERR(pOp->getNdbError());
+ pNdb->closeTransaction(pCon);
+ delete pNdb;
+ return NDBT_FAILED;
+ }
+
+ if (pOp->readTuples() != 0){
+ ERR(pOp->getNdbError());
+ pNdb->closeTransaction(pCon);
+ delete pNdb;
+ return NDBT_FAILED;
+ }
+
+ if (pOp->getValue(NdbDictionary::Column::FRAGMENT) == 0){
+ ERR(pOp->getNdbError());
+ pNdb->closeTransaction(pCon);
+ delete pNdb;
+ return NDBT_FAILED;
+ }
+ int res= 42;
+ pCon->executeAsynch(NoCommit, testExecuteAsynchCallback, &res);
+ while(pNdb->pollNdb(100000) == 0)
+ ;
+ if (res != 0){
+ ERR(pCon->getNdbError());
+ ndbout << "Error returned from execute: " << res << endl;
+ result= NDBT_FAILED;
+ }
+
+ pNdb->closeTransaction(pCon);
+
+ delete pNdb;
+
+ return result;
+}
+
+
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",
@@ -1322,6 +1422,14 @@ TESTCASE("Scan_4006",
INITIALIZER(runScan_4006);
FINALIZER(runClearTable);
}
+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/ndbapi/testScanFilter.cpp b/ndb/test/ndbapi/testScanFilter.cpp
index e195c04bd93..5098d83745b 100644
--- a/ndb/test/ndbapi/testScanFilter.cpp
+++ b/ndb/test/ndbapi/testScanFilter.cpp
@@ -1,9 +1,8 @@
-/* Copyright (C) 2007, Justin He, MySQL AB
+/* Copyright (C) 2007 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+ the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt
index a35b2b3f7c7..c40c96209f4 100644
--- a/ndb/test/run-test/daily-basic-tests.txt
+++ b/ndb/test/run-test/daily-basic-tests.txt
@@ -625,6 +625,14 @@ max-time: 500
cmd: testNdbApi
args: -n Scan_4006 T1
+max-time: 500
+cmd: testNdbApi
+args: -n ExecuteAsynch T1
+
+max-time: 1000
+cmd: testNdbApi
+args: -n BugBug28443
+
#max-time: 500
#cmd: testInterpreter
#args: T1
@@ -645,6 +653,14 @@ max-time: 600
cmd: testBlobs
args:
+max-time: 600
+cmd: testBlobs
+args: -bug 27018
+
+max-time: 600
+cmd: testBlobs
+args: -bug 27370
+
max-time: 5000
cmd: testOIBasic
args: -case abcdefz
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/CMakeLists.txt b/scripts/CMakeLists.txt
new file mode 100755
index 00000000000..e9113b098da
--- /dev/null
+++ b/scripts/CMakeLists.txt
@@ -0,0 +1,42 @@
+# Copyright (C) 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Build mysql_fix_privilege_tables.sql
+ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql
+ COMMAND copy /b
+ mysql_system_tables.sql + mysql_system_tables_fix.sql
+ mysql_fix_privilege_tables.sql
+ DEPENDS
+ ${PROJECT_SOURCE_DIR}/scripts/mysql_system_tables.sql
+ ${PROJECT_SOURCE_DIR}/scripts/mysql_system_tables_fix.sql)
+
+# Build comp_sql - used for embedding SQL in C or C++ programs
+ADD_EXECUTABLE(comp_sql comp_sql.c)
+TARGET_LINK_LIBRARIES(comp_sql dbug mysys strings)
+
+# Use comp_sql to build mysql_fix_privilege_tables_sql.c
+GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION)
+
+ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c
+ COMMAND ${COMP_SQL_EXE}
+ mysql_fix_privilege_tables
+ mysql_fix_privilege_tables.sql
+ mysql_fix_privilege_tables_sql.c
+ DEPENDS comp_sql ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql)
+
+# Add dummy target for the above to be built
+ADD_CUSTOM_TARGET(GenFixPrivs
+ ALL
+ DEPENDS ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c)
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index d7053a86b3a..d4944962884 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -15,6 +15,11 @@
## Process this file with automake to create Makefile.in
+BUILT_SOURCES = mysql_fix_privilege_tables.sql \
+ mysql_fix_privilege_tables_sql.c
+
+EXTRA_PROGRAMS = comp_sql
+
bin_SCRIPTS = @server_scripts@ \
msql2mysql \
mysql_config \
@@ -65,7 +70,9 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \
mysqlaccess.conf \
mysqlbug \
make_win_bin_dist \
- mysql_system_tables_fix.sql
+ mysql_fix_privilege_tables_sql.c \
+ mysql_system_tables_fix.sql \
+ CMakeLists.txt
dist_pkgdata_DATA = fill_help_tables.sql \
mysql_fix_privilege_tables.sql \
@@ -92,12 +99,11 @@ CLEANFILES = @server_scripts@ \
mysql_tableinfo \
mysql_upgrade_shell \
mysqld_multi \
- make_win_src_distribution \
- mysql_fix_privilege_tables.sql
+ 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
@@ -110,6 +116,20 @@ mysql_fix_privilege_tables.sql: mysql_system_tables.sql \
@echo "Building $@";
@cat mysql_system_tables.sql mysql_system_tables_fix.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 \
+ $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@
+
+
SUFFIXES = .sh
.sh:
@@ -165,5 +185,6 @@ SUFFIXES = .sh
@CHMOD@ +x $@-t
@MV@ $@-t $@
+
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c
new file mode 100644
index 00000000000..88e88e632b6
--- /dev/null
+++ b/scripts/comp_sql.c
@@ -0,0 +1,125 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
+ Written by Magnus Svensson
+*/
+
+/*
+ Converts a SQL file into a C file that can be compiled and linked
+ into other programs
+*/
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+FILE *in, *out;
+
+static void die(const char *fmt, ...)
+{
+ va_list args;
+
+ /* Print the error message */
+ fprintf(stderr, "FATAL ERROR: ");
+ if (fmt)
+ {
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+ }
+ else
+ fprintf(stderr, "unknown error");
+ fprintf(stderr, "\n");
+ fflush(stderr);
+
+ /* Close any open files */
+ if (in)
+ fclose(in);
+ if (out)
+ fclose(out);
+
+ exit(1);
+}
+
+
+int main(int argc, char *argv[])
+{
+ char buff[512];
+ char* struct_name= argv[1];
+ char* infile_name= argv[2];
+ char* outfile_name= argv[3];
+
+ if (argc != 4)
+ die("Usage: comp_sql <struct_name> <sql_filename> <c_filename>");
+
+ /* Open input and output file */
+ if (!(in= fopen(infile_name, "r")))
+ die("Failed to open SQL file '%s'", infile_name);
+ if (!(out= fopen(outfile_name, "w")))
+ die("Failed to open output file '%s'", outfile_name);
+
+ fprintf(out, "const char* %s={\n\"", struct_name);
+
+ while (fgets(buff, sizeof(buff), in))
+ {
+ char *curr= buff;
+ while (*curr)
+ {
+ if (*curr == '\n')
+ {
+ /*
+ Reached end of line, add escaped newline, escaped
+ backslash and a newline to outfile
+ */
+ fprintf(out, "\\n \"\n\"");
+ curr++;
+ }
+ else if (*curr == '\r')
+ {
+ curr++; /* Skip */
+ }
+ else
+ {
+ if (*curr == '"')
+ {
+ /* Needs escape */
+ fputc('\\', out);
+ }
+
+ fputc(*curr, out);
+ curr++;
+ }
+ }
+ if (*(curr-1) != '\n')
+ {
+ /*
+ Some compilers have a max string length,
+ insert a newline at every 512th char in long
+ strings
+ */
+ fprintf(out, "\"\n\"");
+ }
+ }
+
+ fprintf(out, "\\\n\"};\n");
+
+ fclose(in);
+ fclose(out);
+
+ exit(0);
+
+}
+
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 5d4c7ab917d..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
@@ -345,7 +345,7 @@ mkdir -p $DESTDIR/scripts
for i in `cd scripts && ls`; do \
if echo $i | grep -q '\.sh'; then \
cp scripts/$i $DESTDIR/scripts/`echo $i | sed -e 's/\.sh$//'`; \
- elif [ $i = Makefile.am -o $i = Makefile.in -o -e scripts/$i.sh ] ; then \
+ elif [ -d scripts/$i -o $i = Makefile.am -o $i = Makefile.in -o -e scripts/$i.sh ] ; then \
: ; \
else \
cp scripts/$i $DESTDIR/scripts/$i; \
@@ -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_install_db.sh b/scripts/mysql_install_db.sh
index c1a27eb0bc8..934d245db15 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -79,7 +79,10 @@ parse_arguments() {
then
# This sed command makes sure that any special chars are quoted,
# so the arg gets passed exactly to the server.
- args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'`
+ # XXX: This is broken; true fix requires using eval and proper
+ # quoting of every single arg ($basedir, $ldata, etc.)
+ #args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'`
+ args="$args $arg"
fi
;;
esac
@@ -135,17 +138,6 @@ else
fi
fi
-# Check that no previous MySQL installation exist
-if test -f "$ldata/mysql/db.frm"
-then
- echo "FATAL ERROR: Found already existing MySQL system tables"
- echo "in $ldata."
- echo "If you are upgrading from a previous MySQL version you"
- echo "should run '$bindir/mysql_upgrade', "
- echo "to upgrade all tables for this version of MySQL"
- exit 1;
-fi
-
# Find SQL scripts needed for bootstrap
fill_help_tables="fill_help_tables.sql"
create_system_tables="mysql_system_tables.sql"
@@ -162,6 +154,7 @@ else
if test -f $i/$fill_help_tables
then
pkgdatadir=$i
+ break
fi
done
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index 5f5aea20729..d9c870f1d73 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -6,12 +6,17 @@ set storage_engine=myisam;
CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges';
+-- Remember for later if db table already existed
+set @had_db_table= @@warning_count != 0;
CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges';
CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
+-- Remember for later if user table already existed
+set @had_user_table= @@warning_count != 0;
+
CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions';
diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql
index a9c816f2896..5f0289ab197 100644
--- a/scripts/mysql_system_tables_data.sql
+++ b/scripts/mysql_system_tables_data.sql
@@ -2,12 +2,20 @@
-- The inital data for system tables of MySQL Server
--
--- default grants for anyone to access database 'test' and 'test_%'
-INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');
-INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');
+-- Fill "db" table with default grants for anyone to
+-- access database 'test' and 'test_%' if "db" table didn't exist
+CREATE TEMPORARY TABLE tmp_db LIKE db;
+INSERT INTO tmp_db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');
+INSERT INTO tmp_db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');
+INSERT INTO db SELECT * FROM tmp_db WHERE @had_db_table=0;
+DROP TABLE tmp_db;
--- default users allowing root access from local machine
-INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
-REPLACE INTO user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
-REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
+-- Fill "users" table with default users allowing root access
+-- from local machine if "users" table didn't exist before
+CREATE TEMPORARY TABLE tmp_user LIKE user;
+INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
+REPLACE INTO tmp_user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
+REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
+INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
+DROP TABLE tmp_user;
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/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index a664bcfd3ad..92cfbe3ef22 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -4,9 +4,10 @@ use Getopt::Long;
use POSIX qw(strftime);
$|=1;
-$VER="2.15";
+$VER="2.16";
+
+my @defaults_options; # Leading --no-defaults, --defaults-file, etc.
-$opt_config_file = undef();
$opt_example = 0;
$opt_help = 0;
$opt_log = undef();
@@ -49,54 +50,52 @@ sub main
print "MySQL distribution.\n";
$my_print_defaults_exists= 0;
}
- if ($my_print_defaults_exists)
+
+ # Remove leading defaults options from @ARGV
+ while (@ARGV > 0)
+ {
+ last unless $ARGV[0] =~
+ /^--(?:no-defaults$|(?:defaults-file|defaults-extra-file)=)/;
+ push @defaults_options, (shift @ARGV);
+ }
+
+ # Handle deprecated --config-file option: convert to --defaults-extra-file
+ foreach my $arg (@ARGV)
{
- foreach my $arg (@ARGV)
+ if ($arg =~ m/^--config-file=(.*)/)
{
- if ($arg =~ m/^--config-file=(.*)/)
- {
- if (!length($1))
- {
- die "Option config-file requires an argument\n";
- }
- elsif (!( -e $1 && -r $1))
- {
- die "Option file '$1' doesn't exists, or is not readable\n";
- }
- else
- {
- $opt_config_file= $1;
- if (!($opt_config_file =~ m/\//))
- {
- # No path. Use current working directory
- $opt_config_file= "./" . $opt_config_file;
- }
- }
- }
+ # Put it at the beginning of the list, so it has lower precedence
+ # than a correct --defaults-extra-file option
+
+ unshift @defaults_options, "--defaults-extra-file=$1";
}
- my $com= "my_print_defaults ";
- $com.= "--config-file=$opt_config_file " if (defined($opt_config_file));
- $com.= "mysqld_multi";
- my @defops = `$com`;
- chop @defops;
- splice @ARGV, 0, 0, @defops;
}
- if (!GetOptions("help","example","version","mysqld=s","mysqladmin=s",
- "config-file=s","user=s","password=s","log=s","no-log",
- "tcp-ip", "silent","verbose"))
+
+ foreach (@defaults_options)
{
- $flag_exit= 1;
+ $_ = quote_shell_word($_);
}
- if (defined($opt_config_file) && !($opt_config_file =~ m/\//))
+
+ # Add [mysqld_multi] options to front of @ARGV, ready for GetOptions()
+ unshift @ARGV, defaults_for_group('mysqld_multi');
+
+ # The --config-file option can be ignored; if passed on the command
+ # line, it's already handled; if specified in the configuration file,
+ # it's redundant and not useful
+ @ARGV= grep { not /^--config-file=/ } @ARGV;
+
+ # We've already handled --no-defaults, --defaults-file, etc.
+ if (!GetOptions("help", "example", "version", "mysqld=s", "mysqladmin=s",
+ "user=s", "password=s", "log=s", "no-log",
+ "tcp-ip", "silent", "verbose"))
{
- # No path. Use current working directory
- $opt_config_file= "./" . $opt_config_file;
+ $flag_exit= 1;
}
usage() if ($opt_help);
if ($opt_verbose && $opt_silent)
{
- print "Both --verbose and --silent has been given. Some of the warnings ";
+ print "Both --verbose and --silent have been given. Some of the warnings ";
print "will be disabled\nand some will be enabled.\n\n";
}
@@ -168,51 +167,42 @@ sub main
}
}
-####
-#### Quote option argument. Add double quotes around the argument
-#### and escape the following: $, \, "
-#### This function is needed, because my_print_defaults drops possible
-#### quotes, single or double, from in front of an argument and from
-#### the end.
-####
+#
+# Quote word for shell
+#
-sub quote_opt_arg
+sub quote_shell_word
{
my ($option)= @_;
- if ($option =~ m/(\-\-[a-zA-Z0-9\_\-]+)=(.*)/)
- {
- $option= $1;
- $arg= $2;
- $arg=~ s/\\/\\\\/g; # Escape escape character first to avoid doubling.
- $arg=~ s/\$/\\\$/g;
- $arg=~ s/\"/\\\"/g;
- $arg= "\"" . $arg . "\"";
- $option= $option . "=" . $arg;
- }
+ $option =~ s!([^\w=./-])!\\$1!g;
return $option;
}
+sub defaults_for_group
+{
+ my ($group) = @_;
+
+ return () unless $my_print_defaults_exists;
+
+ my $com= join ' ', 'my_print_defaults', @defaults_options, $group;
+ my @defaults = `$com`;
+ chomp @defaults;
+ return @defaults;
+}
+
####
#### Init log file. Check for appropriate place for log file, in the following
-#### order my_print_defaults mysqld datadir, @datadir@, /var/log, /tmp
+#### order: my_print_defaults mysqld datadir, @datadir@
####
sub init_log
{
- if ($my_print_defaults_exists)
+ foreach my $opt (defaults_for_group('mysqld'))
{
- @mysqld_opts= `my_print_defaults mysqld`;
- chomp @mysqld_opts;
- foreach my $opt (@mysqld_opts)
+ if ($opt =~ m/^--datadir=(.*)/ && -d "$1" && -w "$1")
{
- if ($opt =~ m/^\-\-datadir[=](.*)/)
- {
- if (-d "$1" && -w "$1")
- {
- $logdir= $1;
- }
- }
+ $logdir= $1;
}
}
if (!defined($logdir))
@@ -303,11 +293,7 @@ sub start_mysqlds()
@groups = &find_groups($groupids);
for ($i = 0; defined($groups[$i]); $i++)
{
- $com = "my_print_defaults";
- $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : "";
- $com.= " $groups[$i]";
- @options = `$com`;
- chop @options;
+ @options = defaults_for_group($groups[$i]);
$mysqld_found= 1; # The default
$mysqld_found= 0 if (!length($mysqld));
@@ -326,7 +312,7 @@ sub start_mysqlds()
}
else
{
- $options[$j]= quote_opt_arg($options[$j]);
+ $options[$j]= quote_shell_word($options[$j]);
$tmp.= " $options[$j]";
}
}
@@ -401,11 +387,7 @@ sub get_mysqladmin_options
my ($i, @groups)= @_;
my ($mysqladmin_found, $com, $tmp, $j);
- $com = "my_print_defaults";
- $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : "";
- $com.= " $groups[$i]";
- @options = `$com`;
- chop @options;
+ @options = defaults_for_group($groups[$i]);
$mysqladmin_found= 1; # The default
$mysqladmin_found= 0 if (!length($mysqladmin));
@@ -445,129 +427,81 @@ sub get_mysqladmin_options
return $com;
}
-####
-#### Find groups. Takes the valid group numbers as an argument, parses
-#### them, puts them in the ascending order, removes duplicates and
-#### returns the wanted groups accordingly.
-####
+# Return a list of option files which can be opened. Similar, but not
+# identical, to behavior of my_search_option_files()
+sub list_defaults_files
+{
+ my %opt;
+ foreach (@defaults_options)
+ {
+ return () if /^--no-defaults$/;
+ $opt{$1} = $2 if /^--defaults-(extra-file|file)=(.*)$/;
+ }
+
+ return ($opt{file}) if exists $opt{file};
+
+ my %seen; # Don't list the same file more than once
+ return grep { defined $_ and not $seen{$_}++ and -f $_ and -r $_ }
+ ('/etc/my.cnf',
+ '/etc/mysql/my.cnf',
+ '@sysconfdir@/my.cnf',
+ ($ENV{MYSQL_HOME} ? "$ENV{MYSQL_HOME}/my.cnf" : undef),
+ $opt{'extra-file'},
+ ($ENV{HOME} ? "$ENV{HOME}/.my.cnf" : undef));
+}
+
+# Takes a specification of GNRs (see --help), and returns a list of matching
+# groups which actually are mentioned in a relevant config file
sub find_groups
{
my ($raw_gids) = @_;
- my (@groups, @data, @tmp, $line, $i, $k, @pre_gids, @gids, @tmp2,
- $prev_value);
- # Read the lines from the config file to variable 'data'
- if (defined($opt_config_file))
- {
- open(MY_CNF, "<$opt_config_file") && (@data=<MY_CNF>) && close(MY_CNF);
- }
- else
- {
- if (-f "@sysconfdir@/my.cnf" && -r "@sysconfdir@/my.cnf")
- {
- open(MY_CNF, "<@sysconfdir@/my.cnf") && (@tmp=<MY_CNF>) && close(MY_CNF);
- } elsif (-f "/etc/my.cnf" && -r "/etc/my.cnf")
- {
- open(MY_CNF, "</etc/my.cnf") && (@tmp=<MY_CNF>) && close(MY_CNF);
- }
- for ($i = 0; ($line = shift @tmp); $i++)
- {
- $data[$i] = $line;
- }
- if (-f "/etc/mysql/my.cnf" && -r "/etc/mysql/my.cnf")
- {
- open(MY_CNF, "</etc/mysql/my.cnf") && (@tmp=<MY_CNF>) && close(MY_CNF);
- }
- for (; ($line = shift @tmp); $i++)
- {
- $data[$i] = $line;
- }
- if (defined($ENV{MYSQL_HOME}) && -f "$ENV{MYSQL_HOME}/my.cnf" &&
- -r "$ENV{MYSQL_HOME}/my.cnf")
- {
- open(MY_CNF, "<$ENV{MYSQL_HOME}/my.cnf") && (@tmp=<MY_CNF>) &&
- close(MY_CNF);
- }
- for (; ($line = shift @tmp); $i++)
- {
- $data[$i] = $line;
- }
- if (-f "$homedir/.my.cnf" && -r "$homedir/.my.cnf")
- {
- open(MY_CNF, "<$homedir/.my.cnf") && (@tmp=<MY_CNF>) && close(MY_CNF);
- }
- for (; ($line = shift @tmp); $i++)
- {
- $data[$i] = $line;
- }
- }
- chomp @data;
- # Make a list of the wanted group ids
- if (defined($raw_gids))
- {
- @pre_gids = split(',', $raw_gids);
- }
+ my %gids;
+ my @groups;
+
if (defined($raw_gids))
{
- for ($i = 0, $j = 0; defined($pre_gids[$i]); $i++)
+ # Make a hash of the wanted group ids
+ foreach my $raw_gid (split ',', $raw_gids)
{
- if ($pre_gids[$i] =~ m/^(\d+)$/)
+ # Match 123 or 123-456
+ my ($start, $end) = ($raw_gid =~ /^\s*(\d+)(?:\s*-\s*(\d+))?\s*$/);
+ $end = $start if not defined $end;
+ if (not defined $start or $end < $start or $start < 0)
{
- $gids[$j] = $1;
- $j++;
+ print "ABORT: Bad GNR: $raw_gid; see $my_progname --help\n";
+ exit(1);
}
- elsif ($pre_gids[$i] =~ m/^(\d+)(\-)(\d+)$/)
- {
- for ($k = $1; $k <= $3; $k++)
- {
- $gids[$j] = $k;
- $j++;
- }
- }
- else
+
+ foreach my $i ($start .. $end)
{
- print "ABORT: Bad GNR: $pre_gids[$i] See $my_progname --help\n";
- exit(1);
+ # Use $i + 0 to normalize numbers (002 + 0 -> 2)
+ $gids{$i + 0}= 1;
}
}
}
- # Sort the list of gids numerically in ascending order
- @gids = sort {$a <=> $b} @gids;
- # Remove non-positive integers and duplicates
- for ($i = 0, $j = 0; defined($gids[$i]); $i++)
- {
- next if ($gids[$i] <= 0);
- if (!$i || $prev_value != $gids[$i])
- {
- $tmp2[$j] = $gids[$i];
- $j++;
- }
- $prev_value = $gids[$i];
- }
- @gids = @tmp2;
- # Find and return the wanted groups
- for ($i = 0, $j = 0; defined($data[$i]); $i++)
+
+ my @defaults_files = list_defaults_files();
+ #warn "@{[sort keys %gids]} -> @defaults_files\n";
+ foreach my $file (@defaults_files)
{
- if ($data[$i] =~ m/^(\s*\[\s*)(mysqld)(\d+)(\s*\]\s*)$/)
+ next unless open CONF, "< $file";
+
+ while (<CONF>)
{
- if (defined($raw_gids))
- {
- for ($k = 0; defined($gids[$k]); $k++)
- {
- if ($gids[$k] == $3)
- {
- $groups[$j] = $2 . $3;
- $j++;
- }
- }
- }
- else
+ if (/^\s*\[\s*(mysqld)(\d+)\s*\]\s*$/)
{
- $groups[$j] = $2 . $3;
- $j++;
+ #warn "Found a group: $1$2\n";
+ # Use $2 + 0 to normalize numbers (002 + 0 -> 2)
+ if (not defined($raw_gids) or $gids{$2 + 0})
+ {
+ push @groups, "$1$2";
+ }
}
}
+
+ close CONF;
}
return @groups;
}
@@ -806,8 +740,16 @@ groups found will either be started, stopped, or reported. Note that
syntax for specifying GNRs must appear without spaces.
Options:
---config-file=... Alternative config file.
- Using: $opt_config_file
+
+These options must be given before any others:
+--no-defaults Do not read any defaults file
+--defaults-file=... Read only this configuration file, do not read the
+ standard system-wide and user-specific files
+--defaults-extra-file=... Read this configuration file in addition to the
+ standard system-wide and user-specific files
+Using: @{[join ' ', @defaults_options]}
+
+--config-file=... Deprecated, please use --defaults-extra-file instead
--example Give an example of a config file with extra information.
--help Print this help and exit.
--log=... Log file. Full path to and the name for the log file. NOTE:
diff --git a/server-tools/instance-manager/CMakeLists.txt b/server-tools/instance-manager/CMakeLists.txt
index 861c44e9f71..b7e2f08ff6e 100755
--- a/server-tools/instance-manager/CMakeLists.txt
+++ b/server-tools/instance-manager/CMakeLists.txt
@@ -12,6 +12,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
@@ -30,3 +31,7 @@ ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instanc
ADD_DEPENDENCIES(mysqlmanager GenError)
TARGET_LINK_LIBRARIES(mysqlmanager dbug mysys strings taocrypt vio yassl zlib wsock32)
+
+IF(EMBED_MANIFESTS)
+ MYSQL_EMBED_MANIFEST("mysqlmanager" "asInvoker")
+ENDIF(EMBED_MANIFESTS)
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 7e26f62b5f7..1f02e3afc67 100755
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -12,6 +12,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
SET(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi")
@@ -84,6 +85,10 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc
TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg mysys yassl zlib dbug yassl
taocrypt strings vio regex wsock32)
+IF(EMBED_MANIFESTS)
+ MYSQL_EMBED_MANIFEST("mysqld" "asInvoker")
+ENDIF(EMBED_MANIFESTS)
+
IF(WITH_EXAMPLE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld example)
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
diff --git a/sql/Makefile.am b/sql/Makefile.am
index 4f84023724f..9be3bf93746 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -54,7 +54,8 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
sql_error.h field.h handler.h mysqld_suffix.h \
ha_myisammrg.h\
ha_heap.h ha_myisam.h ha_berkeley.h ha_innodb.h \
- ha_ndbcluster.h opt_range.h protocol.h \
+ ha_ndbcluster.h ha_ndbcluster_cond.h \
+ opt_range.h protocol.h \
sql_select.h structs.h table.h sql_udf.h hash_filo.h\
lex.h lex_symbol.h sql_acl.h sql_crypt.h \
log_event.h sql_repl.h slave.h \
@@ -88,7 +89,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \
records.cc filesort.cc handler.cc \
ha_heap.cc ha_myisam.cc ha_myisammrg.cc \
ha_berkeley.cc ha_innodb.cc \
- ha_ndbcluster.cc \
+ ha_ndbcluster.cc ha_ndbcluster_cond.cc \
sql_db.cc sql_table.cc sql_rename.cc sql_crypt.cc \
sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
diff --git a/sql/field.cc b/sql/field.cc
index 635b10e0e5e..8186659ae89 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));
@@ -4359,7 +4359,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 +4430,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 +4487,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 +4512,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 +4581,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 +4605,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 +4613,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 +4689,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 +4704,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 +4720,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 +4729,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 +4833,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 +4857,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 +4885,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 +4907,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 +5060,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 +5116,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 +5157,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 +5194,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 +5263,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 +5293,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 +5329,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 +5356,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 +5390,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 +5438,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 +5451,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 +5489,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 +5541,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 +5576,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 +5621,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 +5693,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 +5712,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);
}
@@ -6221,6 +6243,15 @@ uint Field_string::max_packed_col_length(uint max_length)
return (max_length > 255 ? 2 : 1)+max_length;
}
+uint Field_string::get_key_image(char *buff, uint length, imagetype type_arg)
+{
+ uint bytes = my_charpos(field_charset, ptr, ptr + field_length,
+ length / field_charset->mbmaxlen);
+ memcpy(buff, ptr, bytes);
+ if (bytes < length)
+ bzero(buff + bytes, length - bytes);
+ return bytes;
+}
Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table,
bool keep_type)
@@ -6672,9 +6703,7 @@ uint Field_varstring::max_packed_col_length(uint max_length)
return (max_length > 255 ? 2 : 1)+max_length;
}
-
-void Field_varstring::get_key_image(char *buff, uint length,
- imagetype type_arg)
+uint Field_varstring::get_key_image(char *buff, uint length, imagetype type)
{
uint f_length= length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
uint local_char_length= length / field_charset->mbmaxlen;
@@ -6693,6 +6722,7 @@ void Field_varstring::get_key_image(char *buff, uint length,
*/
bzero(buff+HA_KEY_BLOB_LENGTH+f_length, (length-f_length));
}
+ return HA_KEY_BLOB_LENGTH+f_length;
}
@@ -7064,7 +7094,7 @@ int Field_blob::cmp_binary(const char *a_ptr, const char *b_ptr,
/* The following is used only when comparing a key */
-void Field_blob::get_key_image(char *buff, uint length, imagetype type_arg)
+uint Field_blob::get_key_image(char *buff,uint length, imagetype type_arg)
{
uint32 blob_length= get_length(ptr);
char *blob;
@@ -7076,16 +7106,17 @@ void Field_blob::get_key_image(char *buff, uint length, imagetype type_arg)
MBR mbr;
Geometry_buffer buffer;
Geometry *gobj;
+ const uint image_length= SIZEOF_STORED_DOUBLE*4;
if (blob_length < SRID_SIZE)
{
- bzero(buff, SIZEOF_STORED_DOUBLE*4);
- return;
+ bzero(buff, image_length);
+ return image_length;
}
get_ptr(&blob);
gobj= Geometry::construct(&buffer, blob, blob_length);
if (!gobj || gobj->get_mbr(&mbr, &dummy))
- bzero(buff, SIZEOF_STORED_DOUBLE*4);
+ bzero(buff, image_length);
else
{
float8store(buff, mbr.xmin);
@@ -7093,7 +7124,7 @@ void Field_blob::get_key_image(char *buff, uint length, imagetype type_arg)
float8store(buff+16, mbr.ymin);
float8store(buff+24, mbr.ymax);
}
- return;
+ return image_length;
}
#endif /*HAVE_SPATIAL*/
@@ -7114,6 +7145,7 @@ void Field_blob::get_key_image(char *buff, uint length, imagetype type_arg)
}
int2store(buff,length);
memcpy(buff+HA_KEY_BLOB_LENGTH, blob, length);
+ return HA_KEY_BLOB_LENGTH+length;
}
@@ -7399,7 +7431,7 @@ uint Field_blob::max_packed_col_length(uint max_length)
#ifdef HAVE_SPATIAL
-void Field_geom::get_key_image(char *buff, uint length, imagetype type_arg)
+uint Field_geom::get_key_image(char *buff, uint length, imagetype type)
{
char *blob;
const char *dummy;
@@ -7407,16 +7439,17 @@ void Field_geom::get_key_image(char *buff, uint length, imagetype type_arg)
ulong blob_length= get_length(ptr);
Geometry_buffer buffer;
Geometry *gobj;
+ const uint image_length= SIZEOF_STORED_DOUBLE*4;
if (blob_length < SRID_SIZE)
{
- bzero(buff, SIZEOF_STORED_DOUBLE*4);
- return;
+ bzero(buff, image_length);
+ return image_length;
}
get_ptr(&blob);
gobj= Geometry::construct(&buffer, blob, blob_length);
if (!gobj || gobj->get_mbr(&mbr, &dummy))
- bzero(buff, SIZEOF_STORED_DOUBLE*4);
+ bzero(buff, image_length);
else
{
float8store(buff, mbr.xmin);
@@ -7424,6 +7457,7 @@ void Field_geom::get_key_image(char *buff, uint length, imagetype type_arg)
float8store(buff + 16, mbr.ymin);
float8store(buff + 24, mbr.ymax);
}
+ return image_length;
}
@@ -8132,7 +8166,7 @@ int Field_bit::cmp_offset(uint row_offset)
}
-void Field_bit::get_key_image(char *buff, uint length, imagetype type_arg)
+uint Field_bit::get_key_image(char *buff, uint length, imagetype type_arg)
{
if (bit_len)
{
@@ -8140,7 +8174,9 @@ void Field_bit::get_key_image(char *buff, uint length, imagetype type_arg)
*buff++= bits;
length--;
}
- memcpy(buff, ptr, min(length, bytes_in_rec));
+ uint data_length = min(length, bytes_in_rec);
+ memcpy(buff, ptr, data_length);
+ return data_length + 1;
}
@@ -8412,8 +8448,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,
@@ -9046,10 +9081,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
*/
@@ -9069,7 +9107,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;
}
@@ -9097,9 +9135,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);
}
@@ -9132,7 +9171,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);
}
}
@@ -9165,7 +9204,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 fc68a4549a9..78aa12ad200 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 *);
@@ -235,8 +235,39 @@ public:
{ memcpy(buff,ptr,length); }
inline void set_image(char *buff,uint length, CHARSET_INFO *cs)
{ memcpy(ptr,buff,length); }
- virtual void get_key_image(char *buff, uint length, imagetype type_arg)
- { get_image(buff,length, &my_charset_bin); }
+
+
+ /*
+ Copy a field part into an output buffer.
+
+ SYNOPSIS
+ Field::get_key_image()
+ buff [out] output buffer
+ length output buffer size
+ type itMBR for geometry blobs, otherwise itRAW
+
+ DESCRIPTION
+ This function makes a copy of field part of size equal to or
+ less than "length" parameter value.
+ For fields of string types (CHAR, VARCHAR, TEXT) the rest of buffer
+ is padded by zero byte.
+
+ NOTES
+ For variable length character fields (i.e. UTF-8) the "length"
+ parameter means a number of output buffer bytes as if all field
+ characters have maximal possible size (mbmaxlen). In the other words,
+ "length" parameter is a number of characters multiplied by
+ field_charset->mbmaxlen.
+
+ RETURN
+ Number of copied bytes (excluding padded zero bytes -- see above).
+ */
+
+ virtual uint get_key_image(char *buff, uint length, imagetype type)
+ {
+ get_image(buff, length, &my_charset_bin);
+ return length;
+ }
virtual void set_key_image(char *buff,uint length)
{ set_image(buff,length, &my_charset_bin); }
inline longlong val_int_offset(uint row_offset)
@@ -295,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; }
@@ -498,7 +529,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);
@@ -848,8 +879,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;
};
@@ -922,7 +953,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);
@@ -934,8 +965,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);
};
@@ -954,7 +985,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);
@@ -962,9 +993,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; }
@@ -995,7 +1026,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;
@@ -1011,8 +1042,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);
};
@@ -1071,6 +1102,7 @@ public:
bool has_charset(void) const
{ return charset() == &my_charset_bin ? FALSE : TRUE; }
Field *new_field(MEM_ROOT *root, struct st_table *new_table, bool keep_type);
+ virtual uint get_key_image(char *buff,uint length, imagetype type);
};
@@ -1122,7 +1154,7 @@ public:
my_decimal *val_decimal(my_decimal *);
int cmp(const char *,const char*);
void sort_string(char *buff,uint length);
- void get_key_image(char *buff,uint length, imagetype type);
+ uint get_key_image(char *buff,uint length, imagetype type);
void set_key_image(char *buff,uint length);
void sql_type(String &str) const;
char *pack(char *to, const char *from, uint max_length=~(uint) 0);
@@ -1227,7 +1259,7 @@ public:
store_length(length);
memcpy_fixed(ptr+packlength,&data,sizeof(char*));
}
- void get_key_image(char *buff,uint length, imagetype type);
+ uint get_key_image(char *buff,uint length, imagetype type);
void set_key_image(char *buff,uint length);
void sql_type(String &str) const;
inline bool copy()
@@ -1285,7 +1317,7 @@ public:
int store(double nr);
int store(longlong nr, bool unsigned_val);
int store_decimal(const my_decimal *);
- void get_key_image(char *buff,uint length,imagetype type);
+ uint get_key_image(char *buff,uint length,imagetype type);
uint size_of() const { return sizeof(*this); }
int reset(void) { return !maybe_null() || Field_blob::reset(); }
};
@@ -1395,7 +1427,7 @@ public:
int cmp_offset(uint row_offset);
int cmp_binary_offset(uint row_offset)
{ return cmp_offset(row_offset); }
- void get_key_image(char *buff, uint length, imagetype type);
+ uint get_key_image(char *buff, uint length, imagetype type);
void set_key_image(char *buff, uint length)
{ Field_bit::store(buff, length, &my_charset_bin); }
void sort_string(char *buff, uint length)
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_innodb.cc b/sql/ha_innodb.cc
index 217f59d4b7e..455c0968050 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -3299,6 +3299,8 @@ no_commit:
if (error == DB_DUPLICATE_KEY && auto_inc_used
&& (user_thd->lex->sql_command == SQLCOM_REPLACE
|| user_thd->lex->sql_command == SQLCOM_REPLACE_SELECT
+ || (user_thd->lex->sql_command == SQLCOM_INSERT
+ && user_thd->lex->duplicates == DUP_UPDATE)
|| (user_thd->lex->sql_command == SQLCOM_LOAD
&& user_thd->lex->duplicates == DUP_REPLACE))) {
@@ -4552,6 +4554,20 @@ create_clustered_index_when_no_primary(
}
/*********************************************************************
+Update create_info. Used in SHOW CREATE TABLE et al. */
+
+void
+ha_innobase::update_create_info(
+/*============================*/
+ HA_CREATE_INFO* create_info) /* in/out: create info */
+{
+ if (!(create_info->used_fields & HA_CREATE_USED_AUTO)) {
+ ha_innobase::info(HA_STATUS_AUTO);
+ create_info->auto_increment_value = auto_increment_value;
+ }
+}
+
+/*********************************************************************
Creates a new table to an InnoDB database. */
int
diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h
index 9d18e22cc77..585bc75fa36 100644
--- a/sql/ha_innodb.h
+++ b/sql/ha_innodb.h
@@ -153,6 +153,7 @@ class ha_innobase: public handler
*max_key);
ha_rows estimate_rows_upper_bound();
+ void update_create_info(HA_CREATE_INFO* create_info);
int create(const char *name, register TABLE *form,
HA_CREATE_INFO *create_info);
int delete_all_rows();
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 6d8a770175d..9a397ffbbac 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -956,8 +956,8 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt)
param.sort_buffer_length= check_opt->sort_buffer_size;
if ((error= repair(thd,param,1)) && param.retry_repair)
{
- sql_print_warning("Warning: Optimize table got errno %d, retrying",
- my_errno);
+ sql_print_warning("Warning: Optimize table got errno %d on %s.%s, retrying",
+ my_errno, param.db_name, param.table_name);
param.testflag&= ~T_REP_BY_SORT;
error= repair(thd,param,1);
}
@@ -1347,8 +1347,8 @@ int ha_myisam::enable_indexes(uint mode)
param.tmpdir=&mysql_tmpdir_list;
if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair)
{
- sql_print_warning("Warning: Enabling keys got errno %d, retrying",
- my_errno);
+ sql_print_warning("Warning: Enabling keys got errno %d on %s.%s, retrying",
+ my_errno, param.db_name, param.table_name);
/* Repairing by sort failed. Now try standard repair method. */
param.testflag&= ~(T_REP_BY_SORT | T_QUICK);
error= (repair(thd,param,0) != HA_ADMIN_OK);
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 8bca5ea7c5c..0f3a42bbce7 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -29,7 +29,7 @@
#include <my_dir.h>
#include "ha_ndbcluster.h"
#include <ndbapi/NdbApi.hpp>
-#include <ndbapi/NdbScanFilter.hpp>
+#include "ha_ndbcluster_cond.h"
// options from from mysqld.cc
extern my_bool opt_ndb_optimized_node_selection;
@@ -733,8 +733,8 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field,
DBUG_DUMP("value", (char*)&bits, pack_len);
#ifdef WORDS_BIGENDIAN
/* store lsw first */
- bits = ((bits >> 32) & 0x00000000FFFFFFFF)
- | ((bits << 32) & 0xFFFFFFFF00000000);
+ bits = ((bits >> 32) & 0x00000000FFFFFFFFLL)
+ | ((bits << 32) & 0xFFFFFFFF00000000LL);
#endif
DBUG_RETURN(ndb_op->setValue(fieldnr, (char*)&bits, pack_len) != 0);
}
@@ -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;
@@ -2114,7 +2152,7 @@ int ha_ndbcluster::ordered_index_scan(const key_range *start_key,
DBUG_RETURN(res);
}
- if (!restart && generate_scan_filter(m_cond_stack, op))
+ if (!restart && m_cond && m_cond->generate_scan_filter(op))
DBUG_RETURN(ndb_err(trans));
if (!restart && (res= define_read_attrs(buf, op)))
@@ -2153,7 +2191,14 @@ int ha_ndbcluster::unique_index_scan(const KEY* key_info,
parallelism))
ERR_RETURN(trans->getNdbError());
m_active_cursor= op;
- if (generate_scan_filter_from_key(op, key_info, key, key_len, buf))
+ if (!m_cond)
+ m_cond= new ha_ndbcluster_cond;
+ if (!m_cond)
+ {
+ my_errno= HA_ERR_OUT_OF_MEM;
+ DBUG_RETURN(my_errno);
+ }
+ if (m_cond->generate_scan_filter_from_key(op, key_info, key, key_len, buf))
DBUG_RETURN(ndb_err(trans));
if ((res= define_read_attrs(buf, op)))
DBUG_RETURN(res);
@@ -2186,7 +2231,7 @@ int ha_ndbcluster::full_table_scan(byte *buf)
parallelism))
ERR_RETURN(trans->getNdbError());
m_active_cursor= op;
- if (generate_scan_filter(m_cond_stack, op))
+ if (m_cond && m_cond->generate_scan_filter(op))
DBUG_RETURN(ndb_err(trans));
if ((res= define_read_attrs(buf, op)))
DBUG_RETURN(res);
@@ -2264,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());
}
@@ -2678,10 +2731,10 @@ void ha_ndbcluster::unpack_record(byte* buf)
/* lsw is stored first */
Uint32 *buf= (Uint32 *)(*value).rec->aRef();
((Field_bit *) *field)->store((((longlong)*buf)
- & 0x000000000FFFFFFFF)
+ & 0x000000000FFFFFFFFLL)
|
((((longlong)*(buf+1)) << 32)
- & 0xFFFFFFFF00000000),
+ & 0xFFFFFFFF00000000LL),
TRUE);
#else
((Field_bit *) *field)->store((longlong)
@@ -2720,7 +2773,7 @@ void ha_ndbcluster::unpack_record(byte* buf)
hidden_col->getName(),
llstr(rec->u_64_value(), buff)));
}
- print_results();
+ //print_results();
#endif
DBUG_VOID_RETURN;
}
@@ -2809,7 +2862,7 @@ int ha_ndbcluster::index_end()
}
/**
- * Check if key contains null
+ * Check if key contains nullable columns
*/
static
int
@@ -3449,7 +3502,10 @@ int ha_ndbcluster::extra(enum ha_extra_function operation)
int ha_ndbcluster::reset()
{
DBUG_ENTER("ha_ndbcluster::reset");
- cond_clear();
+ if (m_cond)
+ {
+ m_cond->cond_clear();
+ }
/* reset flags set by extra calls */
m_retrieve_all_fields= FALSE;
@@ -4807,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);
}
@@ -4872,7 +4933,7 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg):
m_force_send(TRUE),
m_autoincrement_prefetch((ha_rows) 32),
m_transaction_on(TRUE),
- m_cond_stack(NULL),
+ m_cond(NULL),
m_multi_cursor(NULL)
{
int i;
@@ -4919,9 +4980,13 @@ ha_ndbcluster::~ha_ndbcluster()
}
DBUG_ASSERT(m_active_trans == NULL);
- // Discard the condition stack
- DBUG_PRINT("info", ("Clearing condition stack"));
- cond_clear();
+ // Discard any generated condition
+ DBUG_PRINT("info", ("Deleting generated condition"));
+ if (m_cond)
+ {
+ delete m_cond;
+ m_cond= NULL;
+ }
DBUG_VOID_RETURN;
}
@@ -4959,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);
}
@@ -6187,7 +6261,7 @@ ndb_get_table_statistics(ha_ndbcluster* file, bool report_error, Ndb* ndb,
NdbError error;
int retries= 10;
int reterr= 0;
- int retry_sleep= 30 * 1000; /* 30 milliseconds */
+ int retry_sleep= 30; /* 30 milliseconds, transaction */
#ifndef DBUG_OFF
char buff[22], buff2[22], buff3[22], buff4[22];
#endif
@@ -6511,7 +6585,7 @@ ha_ndbcluster::read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
else if ((scanOp= m_active_trans->getNdbIndexScanOperation(idx, tab))
&&!scanOp->readTuples(lm, 0, parallelism, sorted,
FALSE, TRUE, need_pk, TRUE)
- &&!generate_scan_filter(m_cond_stack, scanOp)
+ &&!(m_cond && m_cond->generate_scan_filter(scanOp))
&&!define_read_attrs(end_of_buffer-reclength, scanOp))
{
m_multi_cursor= scanOp;
@@ -6970,1412 +7044,6 @@ next:
DBUG_RETURN(NULL);
}
-/*
- Condition pushdown
-*/
-/*
- Push a condition to ndbcluster storage engine for evaluation
- during table and index scans. The conditions will be stored on a stack
- for possibly storing several conditions. The stack can be popped
- by calling cond_pop, handler::extra(HA_EXTRA_RESET) (handler::reset())
- will clear the stack.
- The current implementation supports arbitrary AND/OR nested conditions
- with comparisons between columns and constants (including constant
- expressions and function calls) and the following comparison operators:
- =, !=, >, >=, <, <=, "is null", and "is not null".
-
- RETURN
- NULL The condition was supported and will be evaluated for each
- row found during the scan
- cond The condition was not supported and all rows will be returned from
- the scan for evaluation (and thus not saved on stack)
-*/
-const
-COND*
-ha_ndbcluster::cond_push(const COND *cond)
-{
- DBUG_ENTER("cond_push");
- Ndb_cond_stack *ndb_cond = new Ndb_cond_stack();
- if (ndb_cond == NULL)
- {
- my_errno= HA_ERR_OUT_OF_MEM;
- DBUG_RETURN(NULL);
- }
- DBUG_EXECUTE("where",print_where((COND *)cond, m_tabname););
- if (m_cond_stack)
- ndb_cond->next= m_cond_stack;
- else
- ndb_cond->next= NULL;
- m_cond_stack= ndb_cond;
-
- if (serialize_cond(cond, ndb_cond))
- {
- DBUG_RETURN(NULL);
- }
- else
- {
- cond_pop();
- }
- DBUG_RETURN(cond);
-}
-
-/*
- Pop the top condition from the condition stack of the handler instance.
-*/
-void
-ha_ndbcluster::cond_pop()
-{
- Ndb_cond_stack *ndb_cond_stack= m_cond_stack;
- if (ndb_cond_stack)
- {
- m_cond_stack= ndb_cond_stack->next;
- delete ndb_cond_stack;
- }
-}
-
-/*
- Clear the condition stack
-*/
-void
-ha_ndbcluster::cond_clear()
-{
- DBUG_ENTER("cond_clear");
- while (m_cond_stack)
- cond_pop();
-
- DBUG_VOID_RETURN;
-}
-
-/*
- Serialize the item tree into a linked list represented by Ndb_cond
- for fast generation of NbdScanFilter. Adds information such as
- position of fields that is not directly available in the Item tree.
- Also checks if condition is supported.
-*/
-void ndb_serialize_cond(const Item *item, void *arg)
-{
- Ndb_cond_traverse_context *context= (Ndb_cond_traverse_context *) arg;
- DBUG_ENTER("ndb_serialize_cond");
-
- // Check if we are skipping arguments to a function to be evaluated
- if (context->skip)
- {
- DBUG_PRINT("info", ("Skiping argument %d", context->skip));
- context->skip--;
- switch (item->type()) {
- case Item::FUNC_ITEM:
- {
- Item_func *func_item= (Item_func *) item;
- context->skip+= func_item->argument_count();
- break;
- }
- case Item::INT_ITEM:
- case Item::REAL_ITEM:
- case Item::STRING_ITEM:
- case Item::VARBIN_ITEM:
- case Item::DECIMAL_ITEM:
- break;
- default:
- context->supported= FALSE;
- break;
- }
-
- DBUG_VOID_RETURN;
- }
-
- if (context->supported)
- {
- Ndb_rewrite_context *rewrite_context2= context->rewrite_stack;
- const Item_func *rewrite_func_item;
- // Check if we are rewriting some unsupported function call
- if (rewrite_context2 &&
- (rewrite_func_item= rewrite_context2->func_item) &&
- rewrite_context2->count++ == 0)
- {
- switch (rewrite_func_item->functype()) {
- case Item_func::BETWEEN:
- /*
- Rewrite
- <field>|<const> BETWEEN <const1>|<field1> AND <const2>|<field2>
- to <field>|<const> > <const1>|<field1> AND
- <field>|<const> < <const2>|<field2>
- or actually in prefix format
- BEGIN(AND) GT(<field>|<const>, <const1>|<field1>),
- LT(<field>|<const>, <const2>|<field2>), END()
- */
- case Item_func::IN_FUNC:
- {
- /*
- Rewrite <field>|<const> IN(<const1>|<field1>, <const2>|<field2>,..)
- to <field>|<const> = <const1>|<field1> OR
- <field> = <const2>|<field2> ...
- or actually in prefix format
- BEGIN(OR) EQ(<field>|<const>, <const1><field1>),
- EQ(<field>|<const>, <const2>|<field2>), ... END()
- Each part of the disjunction is added for each call
- to ndb_serialize_cond and end of rewrite statement
- is wrapped in end of ndb_serialize_cond
- */
- if (context->expecting(item->type()))
- {
- // This is the <field>|<const> item, save it in the rewrite context
- rewrite_context2->left_hand_item= item;
- if (item->type() == Item::FUNC_ITEM)
- {
- Item_func *func_item= (Item_func *) item;
- if (func_item->functype() == Item_func::UNKNOWN_FUNC &&
- func_item->const_item())
- {
- // Skip any arguments since we will evaluate function instead
- DBUG_PRINT("info", ("Skip until end of arguments marker"));
- context->skip= func_item->argument_count();
- }
- else
- {
- DBUG_PRINT("info", ("Found unsupported functional expression in BETWEEN|IN"));
- context->supported= FALSE;
- DBUG_VOID_RETURN;
-
- }
- }
- }
- else
- {
- // Non-supported BETWEEN|IN expression
- DBUG_PRINT("info", ("Found unexpected item of type %u in BETWEEN|IN",
- item->type()));
- context->supported= FALSE;
- DBUG_VOID_RETURN;
- }
- break;
- }
- default:
- context->supported= FALSE;
- break;
- }
- DBUG_VOID_RETURN;
- }
- else
- {
- Ndb_cond_stack *ndb_stack= context->stack_ptr;
- Ndb_cond *prev_cond= context->cond_ptr;
- Ndb_cond *curr_cond= context->cond_ptr= new Ndb_cond();
- if (!ndb_stack->ndb_cond)
- ndb_stack->ndb_cond= curr_cond;
- curr_cond->prev= prev_cond;
- if (prev_cond) prev_cond->next= curr_cond;
- // Check if we are rewriting some unsupported function call
- if (context->rewrite_stack)
- {
- Ndb_rewrite_context *rewrite_context= context->rewrite_stack;
- const Item_func *func_item= rewrite_context->func_item;
- switch (func_item->functype()) {
- case Item_func::BETWEEN:
- {
- /*
- Rewrite
- <field>|<const> BETWEEN <const1>|<field1> AND <const2>|<field2>
- to <field>|<const> > <const1>|<field1> AND
- <field>|<const> < <const2>|<field2>
- or actually in prefix format
- BEGIN(AND) GT(<field>|<const>, <const1>|<field1>),
- LT(<field>|<const>, <const2>|<field2>), END()
- */
- if (rewrite_context->count == 2)
- {
- // Lower limit of BETWEEN
- DBUG_PRINT("info", ("GE_FUNC"));
- curr_cond->ndb_item= new Ndb_item(Item_func::GE_FUNC, 2);
- }
- else if (rewrite_context->count == 3)
- {
- // Upper limit of BETWEEN
- DBUG_PRINT("info", ("LE_FUNC"));
- curr_cond->ndb_item= new Ndb_item(Item_func::LE_FUNC, 2);
- }
- else
- {
- // Illegal BETWEEN expression
- DBUG_PRINT("info", ("Illegal BETWEEN expression"));
- context->supported= FALSE;
- DBUG_VOID_RETURN;
- }
- break;
- }
- case Item_func::IN_FUNC:
- {
- /*
- Rewrite <field>|<const> IN(<const1>|<field1>, <const2>|<field2>,..)
- to <field>|<const> = <const1>|<field1> OR
- <field> = <const2>|<field2> ...
- or actually in prefix format
- BEGIN(OR) EQ(<field>|<const>, <const1><field1>),
- EQ(<field>|<const>, <const2>|<field2>), ... END()
- Each part of the disjunction is added for each call
- to ndb_serialize_cond and end of rewrite statement
- is wrapped in end of ndb_serialize_cond
- */
- DBUG_PRINT("info", ("EQ_FUNC"));
- curr_cond->ndb_item= new Ndb_item(Item_func::EQ_FUNC, 2);
- break;
- }
- default:
- context->supported= FALSE;
- }
- // Handle left hand <field>|<const>
- context->rewrite_stack= NULL; // Disable rewrite mode
- context->expect_only(Item::FIELD_ITEM);
- context->expect_field_result(STRING_RESULT);
- context->expect_field_result(REAL_RESULT);
- context->expect_field_result(INT_RESULT);
- context->expect_field_result(DECIMAL_RESULT);
- context->expect(Item::INT_ITEM);
- context->expect(Item::STRING_ITEM);
- context->expect(Item::VARBIN_ITEM);
- context->expect(Item::FUNC_ITEM);
- ndb_serialize_cond(rewrite_context->left_hand_item, arg);
- context->skip= 0; // Any FUNC_ITEM expression has already been parsed
- context->rewrite_stack= rewrite_context; // Enable rewrite mode
- if (!context->supported)
- DBUG_VOID_RETURN;
-
- prev_cond= context->cond_ptr;
- curr_cond= context->cond_ptr= new Ndb_cond();
- prev_cond->next= curr_cond;
- }
-
- // Check for end of AND/OR expression
- if (!item)
- {
- // End marker for condition group
- DBUG_PRINT("info", ("End of condition group"));
- curr_cond->ndb_item= new Ndb_item(NDB_END_COND);
- }
- else
- {
- switch (item->type()) {
- case Item::FIELD_ITEM:
- {
- Item_field *field_item= (Item_field *) item;
- Field *field= field_item->field;
- enum_field_types type= field->type();
- /*
- Check that the field is part of the table of the handler
- instance and that we expect a field with of this result type.
- */
- if (context->table->s == field->table->s)
- {
- const NDBTAB *tab= (const NDBTAB *) context->ndb_table;
- DBUG_PRINT("info", ("FIELD_ITEM"));
- DBUG_PRINT("info", ("table %s", tab->getName()));
- DBUG_PRINT("info", ("column %s", field->field_name));
- DBUG_PRINT("info", ("type %d", field->type()));
- DBUG_PRINT("info", ("result type %d", field->result_type()));
-
- // Check that we are expecting a field and with the correct
- // result type
- if (context->expecting(Item::FIELD_ITEM) &&
- context->expecting_field_type(field->type()) &&
- (context->expecting_field_result(field->result_type()) ||
- // Date and year can be written as string or int
- ((type == MYSQL_TYPE_TIME ||
- type == MYSQL_TYPE_DATE ||
- type == MYSQL_TYPE_YEAR ||
- type == MYSQL_TYPE_DATETIME)
- ? (context->expecting_field_result(STRING_RESULT) ||
- context->expecting_field_result(INT_RESULT))
- : true)) &&
- // Bit fields no yet supported in scan filter
- type != MYSQL_TYPE_BIT &&
- // No BLOB support in scan filter
- type != MYSQL_TYPE_TINY_BLOB &&
- type != MYSQL_TYPE_MEDIUM_BLOB &&
- type != MYSQL_TYPE_LONG_BLOB &&
- type != MYSQL_TYPE_BLOB)
- {
- const NDBCOL *col= tab->getColumn(field->field_name);
- DBUG_ASSERT(col);
- curr_cond->ndb_item= new Ndb_item(field, col->getColumnNo());
- context->dont_expect(Item::FIELD_ITEM);
- context->expect_no_field_result();
- if (! context->expecting_nothing())
- {
- // We have not seen second argument yet
- if (type == MYSQL_TYPE_TIME ||
- type == MYSQL_TYPE_DATE ||
- type == MYSQL_TYPE_YEAR ||
- type == MYSQL_TYPE_DATETIME)
- {
- context->expect_only(Item::STRING_ITEM);
- context->expect(Item::INT_ITEM);
- }
- else
- switch (field->result_type()) {
- case STRING_RESULT:
- // Expect char string or binary string
- context->expect_only(Item::STRING_ITEM);
- context->expect(Item::VARBIN_ITEM);
- context->expect_collation(field_item->collation.collation);
- break;
- case REAL_RESULT:
- context->expect_only(Item::REAL_ITEM);
- context->expect(Item::DECIMAL_ITEM);
- context->expect(Item::INT_ITEM);
- break;
- case INT_RESULT:
- context->expect_only(Item::INT_ITEM);
- context->expect(Item::VARBIN_ITEM);
- break;
- case DECIMAL_RESULT:
- context->expect_only(Item::DECIMAL_ITEM);
- context->expect(Item::REAL_ITEM);
- context->expect(Item::INT_ITEM);
- break;
- default:
- break;
- }
- }
- else
- {
- // Expect another logical expression
- context->expect_only(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- // Check that field and string constant collations are the same
- if ((field->result_type() == STRING_RESULT) &&
- !context->expecting_collation(item->collation.collation)
- && type != MYSQL_TYPE_TIME
- && type != MYSQL_TYPE_DATE
- && type != MYSQL_TYPE_YEAR
- && type != MYSQL_TYPE_DATETIME)
- {
- DBUG_PRINT("info", ("Found non-matching collation %s",
- item->collation.collation->name));
- context->supported= FALSE;
- }
- }
- break;
- }
- else
- {
- DBUG_PRINT("info", ("Was not expecting field of type %u(%u)",
- field->result_type(), type));
- context->supported= FALSE;
- }
- }
- else
- {
- DBUG_PRINT("info", ("Was not expecting field from table %s(%s)",
- context->table->s->table_name,
- field->table->s->table_name));
- context->supported= FALSE;
- }
- break;
- }
- case Item::FUNC_ITEM:
- {
- Item_func *func_item= (Item_func *) item;
- // Check that we expect a function or functional expression here
- if (context->expecting(Item::FUNC_ITEM) ||
- func_item->functype() == Item_func::UNKNOWN_FUNC)
- context->expect_nothing();
- else
- {
- // Did not expect function here
- context->supported= FALSE;
- break;
- }
-
- switch (func_item->functype()) {
- case Item_func::EQ_FUNC:
- {
- DBUG_PRINT("info", ("EQ_FUNC"));
- curr_cond->ndb_item= new Ndb_item(func_item->functype(),
- func_item);
- context->expect(Item::STRING_ITEM);
- context->expect(Item::INT_ITEM);
- context->expect(Item::REAL_ITEM);
- context->expect(Item::DECIMAL_ITEM);
- context->expect(Item::VARBIN_ITEM);
- context->expect(Item::FIELD_ITEM);
- context->expect_field_result(STRING_RESULT);
- context->expect_field_result(REAL_RESULT);
- context->expect_field_result(INT_RESULT);
- context->expect_field_result(DECIMAL_RESULT);
- break;
- }
- case Item_func::NE_FUNC:
- {
- DBUG_PRINT("info", ("NE_FUNC"));
- curr_cond->ndb_item= new Ndb_item(func_item->functype(),
- func_item);
- context->expect(Item::STRING_ITEM);
- context->expect(Item::INT_ITEM);
- context->expect(Item::REAL_ITEM);
- context->expect(Item::DECIMAL_ITEM);
- context->expect(Item::VARBIN_ITEM);
- context->expect(Item::FIELD_ITEM);
- context->expect_field_result(STRING_RESULT);
- context->expect_field_result(REAL_RESULT);
- context->expect_field_result(INT_RESULT);
- context->expect_field_result(DECIMAL_RESULT);
- break;
- }
- case Item_func::LT_FUNC:
- {
- DBUG_PRINT("info", ("LT_FUNC"));
- curr_cond->ndb_item= new Ndb_item(func_item->functype(),
- func_item);
- context->expect(Item::STRING_ITEM);
- context->expect(Item::INT_ITEM);
- context->expect(Item::REAL_ITEM);
- context->expect(Item::DECIMAL_ITEM);
- context->expect(Item::VARBIN_ITEM);
- context->expect(Item::FIELD_ITEM);
- context->expect_field_result(STRING_RESULT);
- context->expect_field_result(REAL_RESULT);
- context->expect_field_result(INT_RESULT);
- context->expect_field_result(DECIMAL_RESULT);
- break;
- }
- case Item_func::LE_FUNC:
- {
- DBUG_PRINT("info", ("LE_FUNC"));
- curr_cond->ndb_item= new Ndb_item(func_item->functype(),
- func_item);
- context->expect(Item::STRING_ITEM);
- context->expect(Item::INT_ITEM);
- context->expect(Item::REAL_ITEM);
- context->expect(Item::DECIMAL_ITEM);
- context->expect(Item::VARBIN_ITEM);
- context->expect(Item::FIELD_ITEM);
- context->expect_field_result(STRING_RESULT);
- context->expect_field_result(REAL_RESULT);
- context->expect_field_result(INT_RESULT);
- context->expect_field_result(DECIMAL_RESULT);
- break;
- }
- case Item_func::GE_FUNC:
- {
- DBUG_PRINT("info", ("GE_FUNC"));
- curr_cond->ndb_item= new Ndb_item(func_item->functype(),
- func_item);
- context->expect(Item::STRING_ITEM);
- context->expect(Item::INT_ITEM);
- context->expect(Item::REAL_ITEM);
- context->expect(Item::DECIMAL_ITEM);
- context->expect(Item::VARBIN_ITEM);
- context->expect(Item::FIELD_ITEM);
- context->expect_field_result(STRING_RESULT);
- context->expect_field_result(REAL_RESULT);
- context->expect_field_result(INT_RESULT);
- context->expect_field_result(DECIMAL_RESULT);
- break;
- }
- case Item_func::GT_FUNC:
- {
- DBUG_PRINT("info", ("GT_FUNC"));
- curr_cond->ndb_item= new Ndb_item(func_item->functype(),
- func_item);
- context->expect(Item::STRING_ITEM);
- context->expect(Item::REAL_ITEM);
- context->expect(Item::DECIMAL_ITEM);
- context->expect(Item::INT_ITEM);
- context->expect(Item::VARBIN_ITEM);
- context->expect(Item::FIELD_ITEM);
- context->expect_field_result(STRING_RESULT);
- context->expect_field_result(REAL_RESULT);
- context->expect_field_result(INT_RESULT);
- context->expect_field_result(DECIMAL_RESULT);
- break;
- }
- case Item_func::LIKE_FUNC:
- {
- DBUG_PRINT("info", ("LIKE_FUNC"));
- curr_cond->ndb_item= new Ndb_item(func_item->functype(),
- func_item);
- context->expect(Item::STRING_ITEM);
- context->expect(Item::FIELD_ITEM);
- context->expect_only_field_type(MYSQL_TYPE_STRING);
- context->expect_field_type(MYSQL_TYPE_VAR_STRING);
- context->expect_field_type(MYSQL_TYPE_VARCHAR);
- context->expect_field_result(STRING_RESULT);
- context->expect(Item::FUNC_ITEM);
- break;
- }
- case Item_func::ISNULL_FUNC:
- {
- DBUG_PRINT("info", ("ISNULL_FUNC"));
- curr_cond->ndb_item= new Ndb_item(func_item->functype(),
- func_item);
- context->expect(Item::FIELD_ITEM);
- context->expect_field_result(STRING_RESULT);
- context->expect_field_result(REAL_RESULT);
- context->expect_field_result(INT_RESULT);
- context->expect_field_result(DECIMAL_RESULT);
- break;
- }
- case Item_func::ISNOTNULL_FUNC:
- {
- DBUG_PRINT("info", ("ISNOTNULL_FUNC"));
- curr_cond->ndb_item= new Ndb_item(func_item->functype(),
- func_item);
- context->expect(Item::FIELD_ITEM);
- context->expect_field_result(STRING_RESULT);
- context->expect_field_result(REAL_RESULT);
- context->expect_field_result(INT_RESULT);
- context->expect_field_result(DECIMAL_RESULT);
- break;
- }
- case Item_func::NOT_FUNC:
- {
- DBUG_PRINT("info", ("NOT_FUNC"));
- curr_cond->ndb_item= new Ndb_item(func_item->functype(),
- func_item);
- context->expect(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- break;
- }
- case Item_func::BETWEEN:
- {
- DBUG_PRINT("info", ("BETWEEN, rewriting using AND"));
- Item_func_between *between_func= (Item_func_between *) func_item;
- Ndb_rewrite_context *rewrite_context=
- new Ndb_rewrite_context(func_item);
- rewrite_context->next= context->rewrite_stack;
- context->rewrite_stack= rewrite_context;
- if (between_func->negated)
- {
- DBUG_PRINT("info", ("NOT_FUNC"));
- curr_cond->ndb_item= new Ndb_item(Item_func::NOT_FUNC, 1);
- prev_cond= curr_cond;
- curr_cond= context->cond_ptr= new Ndb_cond();
- curr_cond->prev= prev_cond;
- prev_cond->next= curr_cond;
- }
- DBUG_PRINT("info", ("COND_AND_FUNC"));
- curr_cond->ndb_item=
- new Ndb_item(Item_func::COND_AND_FUNC,
- func_item->argument_count() - 1);
- context->expect_only(Item::FIELD_ITEM);
- context->expect(Item::INT_ITEM);
- context->expect(Item::STRING_ITEM);
- context->expect(Item::VARBIN_ITEM);
- context->expect(Item::FUNC_ITEM);
- break;
- }
- case Item_func::IN_FUNC:
- {
- DBUG_PRINT("info", ("IN_FUNC, rewriting using OR"));
- Item_func_in *in_func= (Item_func_in *) func_item;
- Ndb_rewrite_context *rewrite_context=
- new Ndb_rewrite_context(func_item);
- rewrite_context->next= context->rewrite_stack;
- context->rewrite_stack= rewrite_context;
- if (in_func->negated)
- {
- DBUG_PRINT("info", ("NOT_FUNC"));
- curr_cond->ndb_item= new Ndb_item(Item_func::NOT_FUNC, 1);
- prev_cond= curr_cond;
- curr_cond= context->cond_ptr= new Ndb_cond();
- curr_cond->prev= prev_cond;
- prev_cond->next= curr_cond;
- }
- DBUG_PRINT("info", ("COND_OR_FUNC"));
- curr_cond->ndb_item= new Ndb_item(Item_func::COND_OR_FUNC,
- func_item->argument_count() - 1);
- context->expect_only(Item::FIELD_ITEM);
- context->expect(Item::INT_ITEM);
- context->expect(Item::STRING_ITEM);
- context->expect(Item::VARBIN_ITEM);
- context->expect(Item::FUNC_ITEM);
- break;
- }
- case Item_func::UNKNOWN_FUNC:
- {
- DBUG_PRINT("info", ("UNKNOWN_FUNC %s",
- func_item->const_item()?"const":""));
- DBUG_PRINT("info", ("result type %d", func_item->result_type()));
- if (func_item->const_item())
- {
- switch (func_item->result_type()) {
- case STRING_RESULT:
- {
- NDB_ITEM_QUALIFICATION q;
- q.value_type= Item::STRING_ITEM;
- curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
- if (! context->expecting_no_field_result())
- {
- // We have not seen the field argument yet
- context->expect_only(Item::FIELD_ITEM);
- context->expect_only_field_result(STRING_RESULT);
- context->expect_collation(func_item->collation.collation);
- }
- else
- {
- // Expect another logical expression
- context->expect_only(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- // Check that string result have correct collation
- if (!context->expecting_collation(item->collation.collation))
- {
- DBUG_PRINT("info", ("Found non-matching collation %s",
- item->collation.collation->name));
- context->supported= FALSE;
- }
- }
- // Skip any arguments since we will evaluate function instead
- DBUG_PRINT("info", ("Skip until end of arguments marker"));
- context->skip= func_item->argument_count();
- break;
- }
- case REAL_RESULT:
- {
- NDB_ITEM_QUALIFICATION q;
- q.value_type= Item::REAL_ITEM;
- curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
- if (! context->expecting_no_field_result())
- {
- // We have not seen the field argument yet
- context->expect_only(Item::FIELD_ITEM);
- context->expect_only_field_result(REAL_RESULT);
- }
- else
- {
- // Expect another logical expression
- context->expect_only(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- }
-
- // Skip any arguments since we will evaluate function instead
- DBUG_PRINT("info", ("Skip until end of arguments marker"));
- context->skip= func_item->argument_count();
- break;
- }
- case INT_RESULT:
- {
- NDB_ITEM_QUALIFICATION q;
- q.value_type= Item::INT_ITEM;
- curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
- if (! context->expecting_no_field_result())
- {
- // We have not seen the field argument yet
- context->expect_only(Item::FIELD_ITEM);
- context->expect_only_field_result(INT_RESULT);
- }
- else
- {
- // Expect another logical expression
- context->expect_only(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- }
-
- // Skip any arguments since we will evaluate function instead
- DBUG_PRINT("info", ("Skip until end of arguments marker"));
- context->skip= func_item->argument_count();
- break;
- }
- case DECIMAL_RESULT:
- {
- NDB_ITEM_QUALIFICATION q;
- q.value_type= Item::DECIMAL_ITEM;
- curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
- if (! context->expecting_no_field_result())
- {
- // We have not seen the field argument yet
- context->expect_only(Item::FIELD_ITEM);
- context->expect_only_field_result(DECIMAL_RESULT);
- }
- else
- {
- // Expect another logical expression
- context->expect_only(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- }
- // Skip any arguments since we will evaluate function instead
- DBUG_PRINT("info", ("Skip until end of arguments marker"));
- context->skip= func_item->argument_count();
- break;
- }
- default:
- break;
- }
- }
- else
- // Function does not return constant expression
- context->supported= FALSE;
- break;
- }
- default:
- {
- DBUG_PRINT("info", ("Found func_item of type %d",
- func_item->functype()));
- context->supported= FALSE;
- }
- }
- break;
- }
- case Item::STRING_ITEM:
- DBUG_PRINT("info", ("STRING_ITEM"));
- if (context->expecting(Item::STRING_ITEM))
- {
-#ifndef DBUG_OFF
- char buff[256];
- String str(buff,(uint32) sizeof(buff), system_charset_info);
- str.length(0);
- Item_string *string_item= (Item_string *) item;
- DBUG_PRINT("info", ("value \"%s\"",
- string_item->val_str(&str)->ptr()));
-#endif
- NDB_ITEM_QUALIFICATION q;
- q.value_type= Item::STRING_ITEM;
- curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
- if (! context->expecting_no_field_result())
- {
- // We have not seen the field argument yet
- context->expect_only(Item::FIELD_ITEM);
- context->expect_only_field_result(STRING_RESULT);
- context->expect_collation(item->collation.collation);
- }
- else
- {
- // Expect another logical expression
- context->expect_only(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- // Check that we are comparing with a field with same collation
- if (!context->expecting_collation(item->collation.collation))
- {
- DBUG_PRINT("info", ("Found non-matching collation %s",
- item->collation.collation->name));
- context->supported= FALSE;
- }
- }
- }
- else
- context->supported= FALSE;
- break;
- case Item::INT_ITEM:
- DBUG_PRINT("info", ("INT_ITEM"));
- if (context->expecting(Item::INT_ITEM))
- {
- DBUG_PRINT("info", ("value %ld",
- (long) ((Item_int*) item)->value));
- NDB_ITEM_QUALIFICATION q;
- q.value_type= Item::INT_ITEM;
- curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
- if (! context->expecting_no_field_result())
- {
- // We have not seen the field argument yet
- context->expect_only(Item::FIELD_ITEM);
- context->expect_only_field_result(INT_RESULT);
- context->expect_field_result(REAL_RESULT);
- context->expect_field_result(DECIMAL_RESULT);
- }
- else
- {
- // Expect another logical expression
- context->expect_only(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- }
- }
- else
- context->supported= FALSE;
- break;
- case Item::REAL_ITEM:
- DBUG_PRINT("info", ("REAL_ITEM"));
- if (context->expecting(Item::REAL_ITEM))
- {
- DBUG_PRINT("info", ("value %f", ((Item_float *) item)->value));
- NDB_ITEM_QUALIFICATION q;
- q.value_type= Item::REAL_ITEM;
- curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
- if (! context->expecting_no_field_result())
- {
- // We have not seen the field argument yet
- context->expect_only(Item::FIELD_ITEM);
- context->expect_only_field_result(REAL_RESULT);
- }
- else
- {
- // Expect another logical expression
- context->expect_only(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- }
- }
- else
- context->supported= FALSE;
- break;
- case Item::VARBIN_ITEM:
- DBUG_PRINT("info", ("VARBIN_ITEM"));
- if (context->expecting(Item::VARBIN_ITEM))
- {
- NDB_ITEM_QUALIFICATION q;
- q.value_type= Item::VARBIN_ITEM;
- curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
- if (! context->expecting_no_field_result())
- {
- // We have not seen the field argument yet
- context->expect_only(Item::FIELD_ITEM);
- context->expect_only_field_result(STRING_RESULT);
- }
- else
- {
- // Expect another logical expression
- context->expect_only(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- }
- }
- else
- context->supported= FALSE;
- break;
- case Item::DECIMAL_ITEM:
- DBUG_PRINT("info", ("DECIMAL_ITEM"));
- if (context->expecting(Item::DECIMAL_ITEM))
- {
- DBUG_PRINT("info", ("value %f",
- ((Item_decimal*) item)->val_real()));
- NDB_ITEM_QUALIFICATION q;
- q.value_type= Item::DECIMAL_ITEM;
- curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
- if (! context->expecting_no_field_result())
- {
- // We have not seen the field argument yet
- context->expect_only(Item::FIELD_ITEM);
- context->expect_only_field_result(REAL_RESULT);
- context->expect_field_result(DECIMAL_RESULT);
- }
- else
- {
- // Expect another logical expression
- context->expect_only(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- }
- }
- else
- context->supported= FALSE;
- break;
- case Item::COND_ITEM:
- {
- Item_cond *cond_item= (Item_cond *) item;
-
- if (context->expecting(Item::COND_ITEM))
- {
- switch (cond_item->functype()) {
- case Item_func::COND_AND_FUNC:
- DBUG_PRINT("info", ("COND_AND_FUNC"));
- curr_cond->ndb_item= new Ndb_item(cond_item->functype(),
- cond_item);
- break;
- case Item_func::COND_OR_FUNC:
- DBUG_PRINT("info", ("COND_OR_FUNC"));
- curr_cond->ndb_item= new Ndb_item(cond_item->functype(),
- cond_item);
- break;
- default:
- DBUG_PRINT("info", ("COND_ITEM %d", cond_item->functype()));
- context->supported= FALSE;
- break;
- }
- }
- else
- {
- /* Did not expect condition */
- context->supported= FALSE;
- }
- break;
- }
- default:
- {
- DBUG_PRINT("info", ("Found item of type %d", item->type()));
- context->supported= FALSE;
- }
- }
- }
- if (context->supported && context->rewrite_stack)
- {
- Ndb_rewrite_context *rewrite_context= context->rewrite_stack;
- if (rewrite_context->count ==
- rewrite_context->func_item->argument_count())
- {
- // Rewrite is done, wrap an END() at the en
- DBUG_PRINT("info", ("End of condition group"));
- prev_cond= curr_cond;
- curr_cond= context->cond_ptr= new Ndb_cond();
- curr_cond->prev= prev_cond;
- prev_cond->next= curr_cond;
- curr_cond->ndb_item= new Ndb_item(NDB_END_COND);
- // Pop rewrite stack
- context->rewrite_stack= rewrite_context->next;
- rewrite_context->next= NULL;
- delete(rewrite_context);
- }
- }
- }
- }
-
- DBUG_VOID_RETURN;
-}
-
-bool
-ha_ndbcluster::serialize_cond(const COND *cond, Ndb_cond_stack *ndb_cond)
-{
- DBUG_ENTER("serialize_cond");
- Item *item= (Item *) cond;
- Ndb_cond_traverse_context context(table, (void *)m_table, ndb_cond);
- // Expect a logical expression
- context.expect(Item::FUNC_ITEM);
- context.expect(Item::COND_ITEM);
- item->traverse_cond(&ndb_serialize_cond, (void *) &context, Item::PREFIX);
- DBUG_PRINT("info", ("The pushed condition is %ssupported", (context.supported)?"":"not "));
-
- DBUG_RETURN(context.supported);
-}
-
-int
-ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond,
- NdbScanFilter *filter,
- bool negated)
-{
- DBUG_ENTER("build_scan_filter_predicate");
- switch (cond->ndb_item->type) {
- case NDB_FUNCTION:
- {
- if (!cond->next)
- break;
- Ndb_item *a= cond->next->ndb_item;
- Ndb_item *b, *field, *value= NULL;
- LINT_INIT(field);
-
- switch (cond->ndb_item->argument_count()) {
- case 1:
- field=
- (a->type == NDB_FIELD)? a : NULL;
- break;
- case 2:
- if (!cond->next->next)
- break;
- b= cond->next->next->ndb_item;
- value=
- (a->type == NDB_VALUE)? a
- : (b->type == NDB_VALUE)? b
- : NULL;
- field=
- (a->type == NDB_FIELD)? a
- : (b->type == NDB_FIELD)? b
- : NULL;
- break;
- default:
- break;
- }
- switch ((negated) ?
- Ndb_item::negate(cond->ndb_item->qualification.function_type)
- : cond->ndb_item->qualification.function_type) {
- case NDB_EQ_FUNC:
- {
- if (!value || !field) break;
- // Save value in right format for the field type
- value->save_in_field(field);
- DBUG_PRINT("info", ("Generating EQ filter"));
- if (filter->cmp(NdbScanFilter::COND_EQ,
- field->get_field_no(),
- field->get_val(),
- field->pack_length()) == -1)
- DBUG_RETURN(1);
- cond= cond->next->next->next;
- DBUG_RETURN(0);
- }
- case NDB_NE_FUNC:
- {
- if (!value || !field) break;
- // Save value in right format for the field type
- value->save_in_field(field);
- DBUG_PRINT("info", ("Generating NE filter"));
- if (filter->cmp(NdbScanFilter::COND_NE,
- field->get_field_no(),
- field->get_val(),
- field->pack_length()) == -1)
- DBUG_RETURN(1);
- cond= cond->next->next->next;
- DBUG_RETURN(0);
- }
- case NDB_LT_FUNC:
- {
- if (!value || !field) break;
- // Save value in right format for the field type
- value->save_in_field(field);
- if (a == field)
- {
- DBUG_PRINT("info", ("Generating LT filter"));
- if (filter->cmp(NdbScanFilter::COND_LT,
- field->get_field_no(),
- field->get_val(),
- field->pack_length()) == -1)
- DBUG_RETURN(1);
- }
- else
- {
- DBUG_PRINT("info", ("Generating GT filter"));
- if (filter->cmp(NdbScanFilter::COND_GT,
- field->get_field_no(),
- field->get_val(),
- field->pack_length()) == -1)
- DBUG_RETURN(1);
- }
- cond= cond->next->next->next;
- DBUG_RETURN(0);
- }
- case NDB_LE_FUNC:
- {
- if (!value || !field) break;
- // Save value in right format for the field type
- value->save_in_field(field);
- if (a == field)
- {
- DBUG_PRINT("info", ("Generating LE filter"));
- if (filter->cmp(NdbScanFilter::COND_LE,
- field->get_field_no(),
- field->get_val(),
- field->pack_length()) == -1)
- DBUG_RETURN(1);
- }
- else
- {
- DBUG_PRINT("info", ("Generating GE filter"));
- if (filter->cmp(NdbScanFilter::COND_GE,
- field->get_field_no(),
- field->get_val(),
- field->pack_length()) == -1)
- DBUG_RETURN(1);
- }
- cond= cond->next->next->next;
- DBUG_RETURN(0);
- }
- case NDB_GE_FUNC:
- {
- if (!value || !field) break;
- // Save value in right format for the field type
- value->save_in_field(field);
- if (a == field)
- {
- DBUG_PRINT("info", ("Generating GE filter"));
- if (filter->cmp(NdbScanFilter::COND_GE,
- field->get_field_no(),
- field->get_val(),
- field->pack_length()) == -1)
- DBUG_RETURN(1);
- }
- else
- {
- DBUG_PRINT("info", ("Generating LE filter"));
- if (filter->cmp(NdbScanFilter::COND_LE,
- field->get_field_no(),
- field->get_val(),
- field->pack_length()) == -1)
- DBUG_RETURN(1);
- }
- cond= cond->next->next->next;
- DBUG_RETURN(0);
- }
- case NDB_GT_FUNC:
- {
- if (!value || !field) break;
- // Save value in right format for the field type
- value->save_in_field(field);
- if (a == field)
- {
- DBUG_PRINT("info", ("Generating GT filter"));
- if (filter->cmp(NdbScanFilter::COND_GT,
- field->get_field_no(),
- field->get_val(),
- field->pack_length()) == -1)
- DBUG_RETURN(1);
- }
- else
- {
- DBUG_PRINT("info", ("Generating LT filter"));
- if (filter->cmp(NdbScanFilter::COND_LT,
- field->get_field_no(),
- field->get_val(),
- field->pack_length()) == -1)
- DBUG_RETURN(1);
- }
- cond= cond->next->next->next;
- DBUG_RETURN(0);
- }
- case NDB_LIKE_FUNC:
- {
- if (!value || !field) break;
- if ((value->qualification.value_type != Item::STRING_ITEM) &&
- (value->qualification.value_type != Item::VARBIN_ITEM))
- break;
- // Save value in right format for the field type
- value->save_in_field(field);
- DBUG_PRINT("info", ("Generating LIKE filter: like(%d,%s,%d)",
- field->get_field_no(), value->get_val(),
- value->pack_length()));
- if (filter->cmp(NdbScanFilter::COND_LIKE,
- field->get_field_no(),
- value->get_val(),
- value->pack_length()) == -1)
- DBUG_RETURN(1);
- cond= cond->next->next->next;
- DBUG_RETURN(0);
- }
- case NDB_NOTLIKE_FUNC:
- {
- if (!value || !field) break;
- if ((value->qualification.value_type != Item::STRING_ITEM) &&
- (value->qualification.value_type != Item::VARBIN_ITEM))
- break;
- // Save value in right format for the field type
- value->save_in_field(field);
- DBUG_PRINT("info", ("Generating NOTLIKE filter: notlike(%d,%s,%d)",
- field->get_field_no(), value->get_val(),
- value->pack_length()));
- if (filter->cmp(NdbScanFilter::COND_NOT_LIKE,
- field->get_field_no(),
- value->get_val(),
- value->pack_length()) == -1)
- DBUG_RETURN(1);
- cond= cond->next->next->next;
- DBUG_RETURN(0);
- }
- case NDB_ISNULL_FUNC:
- if (!field)
- break;
- DBUG_PRINT("info", ("Generating ISNULL filter"));
- if (filter->isnull(field->get_field_no()) == -1)
- DBUG_RETURN(1);
- cond= cond->next->next;
- DBUG_RETURN(0);
- case NDB_ISNOTNULL_FUNC:
- {
- if (!field)
- break;
- DBUG_PRINT("info", ("Generating ISNOTNULL filter"));
- if (filter->isnotnull(field->get_field_no()) == -1)
- DBUG_RETURN(1);
- cond= cond->next->next;
- DBUG_RETURN(0);
- }
- default:
- break;
- }
- break;
- }
- default:
- break;
- }
- DBUG_PRINT("info", ("Found illegal condition"));
- DBUG_RETURN(1);
-}
-
-
-int
-ha_ndbcluster::build_scan_filter_group(Ndb_cond* &cond, NdbScanFilter *filter)
-{
- uint level=0;
- bool negated= FALSE;
- DBUG_ENTER("build_scan_filter_group");
-
- do
- {
- if (!cond)
- DBUG_RETURN(1);
- switch (cond->ndb_item->type) {
- case NDB_FUNCTION:
- {
- switch (cond->ndb_item->qualification.function_type) {
- case NDB_COND_AND_FUNC:
- {
- level++;
- DBUG_PRINT("info", ("Generating %s group %u", (negated)?"NAND":"AND",
- level));
- if ((negated) ? filter->begin(NdbScanFilter::NAND)
- : filter->begin(NdbScanFilter::AND) == -1)
- DBUG_RETURN(1);
- negated= FALSE;
- cond= cond->next;
- break;
- }
- case NDB_COND_OR_FUNC:
- {
- level++;
- DBUG_PRINT("info", ("Generating %s group %u", (negated)?"NOR":"OR",
- level));
- if ((negated) ? filter->begin(NdbScanFilter::NOR)
- : filter->begin(NdbScanFilter::OR) == -1)
- DBUG_RETURN(1);
- negated= FALSE;
- cond= cond->next;
- break;
- }
- case NDB_NOT_FUNC:
- {
- DBUG_PRINT("info", ("Generating negated query"));
- cond= cond->next;
- negated= TRUE;
- break;
- }
- default:
- if (build_scan_filter_predicate(cond, filter, negated))
- DBUG_RETURN(1);
- negated= FALSE;
- break;
- }
- break;
- }
- case NDB_END_COND:
- DBUG_PRINT("info", ("End of group %u", level));
- level--;
- if (cond) cond= cond->next;
- if (filter->end() == -1)
- DBUG_RETURN(1);
- if (!negated)
- break;
- // else fall through (NOT END is an illegal condition)
- default:
- {
- DBUG_PRINT("info", ("Illegal scan filter"));
- }
- }
- } while (level > 0 || negated);
-
- DBUG_RETURN(0);
-}
-
-
-int
-ha_ndbcluster::build_scan_filter(Ndb_cond * &cond, NdbScanFilter *filter)
-{
- bool simple_cond= TRUE;
- DBUG_ENTER("build_scan_filter");
-
- switch (cond->ndb_item->type) {
- case NDB_FUNCTION:
- switch (cond->ndb_item->qualification.function_type) {
- case NDB_COND_AND_FUNC:
- case NDB_COND_OR_FUNC:
- simple_cond= FALSE;
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- if (simple_cond && filter->begin() == -1)
- DBUG_RETURN(1);
- if (build_scan_filter_group(cond, filter))
- DBUG_RETURN(1);
- if (simple_cond && filter->end() == -1)
- DBUG_RETURN(1);
-
- DBUG_RETURN(0);
-}
-
-int
-ha_ndbcluster::generate_scan_filter(Ndb_cond_stack *ndb_cond_stack,
- NdbScanOperation *op)
-{
- DBUG_ENTER("generate_scan_filter");
-
- if (ndb_cond_stack)
- {
- NdbScanFilter filter(op);
-
- DBUG_RETURN(generate_scan_filter_from_cond(ndb_cond_stack, filter));
- }
- else
- {
- DBUG_PRINT("info", ("Empty stack"));
- }
-
- DBUG_RETURN(0);
-}
-
-
-int
-ha_ndbcluster::generate_scan_filter_from_cond(Ndb_cond_stack *ndb_cond_stack,
- NdbScanFilter& filter)
-{
- bool multiple_cond= FALSE;
- DBUG_ENTER("generate_scan_filter_from_cond");
-
- // Wrap an AND group around multiple conditions
- if (ndb_cond_stack->next)
- {
- multiple_cond= TRUE;
- if (filter.begin() == -1)
- DBUG_RETURN(1);
- }
- for (Ndb_cond_stack *stack= ndb_cond_stack;
- (stack);
- stack= stack->next)
- {
- Ndb_cond *cond= stack->ndb_cond;
-
- if (build_scan_filter(cond, &filter))
- {
- DBUG_PRINT("info", ("build_scan_filter failed"));
- DBUG_RETURN(1);
- }
- }
- if (multiple_cond && filter.end() == -1)
- DBUG_RETURN(1);
-
- DBUG_RETURN(0);
-}
-
-
-int ha_ndbcluster::generate_scan_filter_from_key(NdbScanOperation *op,
- const KEY* key_info,
- const byte *key,
- uint key_len,
- byte *buf)
-{
- KEY_PART_INFO* key_part= key_info->key_part;
- KEY_PART_INFO* end= key_part+key_info->key_parts;
- NdbScanFilter filter(op);
- int res;
- DBUG_ENTER("generate_scan_filter_from_key");
-
- filter.begin(NdbScanFilter::AND);
- for (; key_part != end; key_part++)
- {
- Field* field= key_part->field;
- uint32 pack_len= field->pack_length();
- const byte* ptr= key;
- DBUG_PRINT("info", ("Filtering value for %s", field->field_name));
- DBUG_DUMP("key", (char*)ptr, pack_len);
- if (key_part->null_bit)
- {
- DBUG_PRINT("info", ("Generating ISNULL filter"));
- if (filter.isnull(key_part->fieldnr-1) == -1)
- DBUG_RETURN(1);
- }
- else
- {
- DBUG_PRINT("info", ("Generating EQ filter"));
- if (filter.cmp(NdbScanFilter::COND_EQ,
- key_part->fieldnr-1,
- ptr,
- pack_len) == -1)
- DBUG_RETURN(1);
- }
- key += key_part->store_length;
- }
- // Add any pushed condition
- if (m_cond_stack &&
- (res= generate_scan_filter_from_cond(m_cond_stack, filter)))
- DBUG_RETURN(res);
-
- if (filter.end() == -1)
- DBUG_RETURN(1);
-
- DBUG_RETURN(0);
-}
-
int
ndbcluster_show_status(THD* thd)
{
@@ -8423,4 +7091,50 @@ ndbcluster_show_status(THD* thd)
DBUG_RETURN(FALSE);
}
+/*
+ Condition pushdown
+*/
+/*
+ Push a condition to ndbcluster storage engine for evaluation
+ during table and index scans. The conditions will be stored on a stack
+ for possibly storing several conditions. The stack can be popped
+ by calling cond_pop, handler::extra(HA_EXTRA_RESET) (handler::reset())
+ will clear the stack.
+ The current implementation supports arbitrary AND/OR nested conditions
+ with comparisons between columns and constants (including constant
+ expressions and function calls) and the following comparison operators:
+ =, !=, >, >=, <, <=, "is null", and "is not null".
+
+ RETURN
+ NULL The condition was supported and will be evaluated for each
+ row found during the scan
+ cond The condition was not supported and all rows will be returned from
+ the scan for evaluation (and thus not saved on stack)
+*/
+const
+COND*
+ha_ndbcluster::cond_push(const COND *cond)
+{
+ DBUG_ENTER("cond_push");
+ if (!m_cond)
+ m_cond= new ha_ndbcluster_cond;
+ if (!m_cond)
+ {
+ my_errno= HA_ERR_OUT_OF_MEM;
+ DBUG_RETURN(NULL);
+ }
+ DBUG_EXECUTE("where",print_where((COND *)cond, m_tabname););
+ DBUG_RETURN(m_cond->cond_push(cond, table, (NDBTAB *)m_table));
+}
+
+/*
+ Pop the top condition from the condition stack of the handler instance.
+*/
+void
+ha_ndbcluster::cond_pop()
+{
+ if (m_cond)
+ m_cond->cond_pop();
+}
+
#endif /* HAVE_NDBCLUSTER_DB */
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index 3495f35e10f..81cbdcd8fea 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -27,19 +27,20 @@
#include <ndbapi_limits.h>
#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8
-
-class Ndb; // Forward declaration
-class NdbOperation; // Forward declaration
-class NdbTransaction; // Forward declaration
-class NdbRecAttr; // Forward declaration
+/* Forward declarations */
+class Ndb;
+class NdbOperation;
+class NdbTransaction;
+class NdbRecAttr;
class NdbScanOperation;
-class NdbScanFilter;
class NdbIndexScanOperation;
class NdbBlob;
+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,
@@ -67,417 +68,6 @@ typedef struct st_ndbcluster_share {
ulonglong commit_count;
} NDB_SHARE;
-typedef enum ndb_item_type {
- NDB_VALUE = 0, // Qualified more with Item::Type
- NDB_FIELD = 1, // Qualified from table definition
- NDB_FUNCTION = 2,// Qualified from Item_func::Functype
- NDB_END_COND = 3 // End marker for condition group
-} NDB_ITEM_TYPE;
-
-typedef enum ndb_func_type {
- NDB_EQ_FUNC = 0,
- NDB_NE_FUNC = 1,
- NDB_LT_FUNC = 2,
- NDB_LE_FUNC = 3,
- NDB_GT_FUNC = 4,
- NDB_GE_FUNC = 5,
- NDB_ISNULL_FUNC = 6,
- NDB_ISNOTNULL_FUNC = 7,
- NDB_LIKE_FUNC = 8,
- NDB_NOTLIKE_FUNC = 9,
- NDB_NOT_FUNC = 10,
- NDB_UNKNOWN_FUNC = 11,
- NDB_COND_AND_FUNC = 12,
- NDB_COND_OR_FUNC = 13,
- NDB_UNSUPPORTED_FUNC = 14
-} NDB_FUNC_TYPE;
-
-typedef union ndb_item_qualification {
- Item::Type value_type;
- enum_field_types field_type; // Instead of Item::FIELD_ITEM
- NDB_FUNC_TYPE function_type; // Instead of Item::FUNC_ITEM
-} NDB_ITEM_QUALIFICATION;
-
-typedef struct ndb_item_field_value {
- Field* field;
- int column_no;
-} NDB_ITEM_FIELD_VALUE;
-
-typedef union ndb_item_value {
- const Item *item;
- NDB_ITEM_FIELD_VALUE *field_value;
- uint arg_count;
-} NDB_ITEM_VALUE;
-
-struct negated_function_mapping
-{
- NDB_FUNC_TYPE pos_fun;
- NDB_FUNC_TYPE neg_fun;
-};
-
-/*
- Define what functions can be negated in condition pushdown.
- Note, these HAVE to be in the same order as in definition enum
-*/
-static const negated_function_mapping neg_map[]=
-{
- {NDB_EQ_FUNC, NDB_NE_FUNC},
- {NDB_NE_FUNC, NDB_EQ_FUNC},
- {NDB_LT_FUNC, NDB_GE_FUNC},
- {NDB_LE_FUNC, NDB_GT_FUNC},
- {NDB_GT_FUNC, NDB_LE_FUNC},
- {NDB_GE_FUNC, NDB_LT_FUNC},
- {NDB_ISNULL_FUNC, NDB_ISNOTNULL_FUNC},
- {NDB_ISNOTNULL_FUNC, NDB_ISNULL_FUNC},
- {NDB_LIKE_FUNC, NDB_NOTLIKE_FUNC},
- {NDB_NOTLIKE_FUNC, NDB_LIKE_FUNC},
- {NDB_NOT_FUNC, NDB_UNSUPPORTED_FUNC},
- {NDB_UNKNOWN_FUNC, NDB_UNSUPPORTED_FUNC},
- {NDB_COND_AND_FUNC, NDB_UNSUPPORTED_FUNC},
- {NDB_COND_OR_FUNC, NDB_UNSUPPORTED_FUNC},
- {NDB_UNSUPPORTED_FUNC, NDB_UNSUPPORTED_FUNC}
-};
-
-/*
- This class is the construction element for serialization of Item tree
- in condition pushdown.
- An instance of Ndb_Item represents a constant, table field reference,
- unary or binary comparison predicate, and start/end of AND/OR.
- Instances of Ndb_Item are stored in a linked list implemented by Ndb_cond
- class.
- The order of elements produced by Ndb_cond::next corresponds to
- breadth-first traversal of the Item (i.e. expression) tree in prefix order.
- AND and OR have arbitrary arity, so the end of AND/OR group is marked with
- Ndb_item with type == NDB_END_COND.
- NOT items represent negated conditions and generate NAND/NOR groups.
-*/
-class Ndb_item {
- public:
- Ndb_item(NDB_ITEM_TYPE item_type) : type(item_type) {};
- Ndb_item(NDB_ITEM_TYPE item_type,
- NDB_ITEM_QUALIFICATION item_qualification,
- const Item *item_value)
- : type(item_type), qualification(item_qualification)
- {
- switch(item_type) {
- case(NDB_VALUE):
- value.item= item_value;
- break;
- case(NDB_FIELD): {
- NDB_ITEM_FIELD_VALUE *field_value= new NDB_ITEM_FIELD_VALUE();
- Item_field *field_item= (Item_field *) item_value;
- field_value->field= field_item->field;
- field_value->column_no= -1; // Will be fetched at scan filter generation
- value.field_value= field_value;
- break;
- }
- case(NDB_FUNCTION):
- value.item= item_value;
- value.arg_count= ((Item_func *) item_value)->argument_count();
- break;
- case(NDB_END_COND):
- break;
- }
- };
- Ndb_item(Field *field, int column_no) : type(NDB_FIELD)
- {
- NDB_ITEM_FIELD_VALUE *field_value= new NDB_ITEM_FIELD_VALUE();
- qualification.field_type= field->type();
- field_value->field= field;
- field_value->column_no= column_no;
- value.field_value= field_value;
- };
- Ndb_item(Item_func::Functype func_type, const Item *item_value)
- : type(NDB_FUNCTION)
- {
- qualification.function_type= item_func_to_ndb_func(func_type);
- value.item= item_value;
- value.arg_count= ((Item_func *) item_value)->argument_count();
- };
- Ndb_item(Item_func::Functype func_type, uint no_args)
- : type(NDB_FUNCTION)
- {
- qualification.function_type= item_func_to_ndb_func(func_type);
- value.arg_count= no_args;
- };
- ~Ndb_item()
- {
- if (type == NDB_FIELD)
- {
- delete value.field_value;
- value.field_value= NULL;
- }
- };
-
- uint32 pack_length()
- {
- switch(type) {
- case(NDB_VALUE):
- if(qualification.value_type == Item::STRING_ITEM)
- return value.item->str_value.length();
- break;
- case(NDB_FIELD):
- return value.field_value->field->pack_length();
- default:
- break;
- }
-
- return 0;
- };
-
- Field * get_field() { return value.field_value->field; };
-
- int get_field_no() { return value.field_value->column_no; };
-
- int argument_count()
- {
- return value.arg_count;
- };
-
- const char* get_val()
- {
- switch(type) {
- case(NDB_VALUE):
- if(qualification.value_type == Item::STRING_ITEM)
- return value.item->str_value.ptr();
- break;
- case(NDB_FIELD):
- return value.field_value->field->ptr;
- default:
- break;
- }
-
- return NULL;
- };
-
- void save_in_field(Ndb_item *field_item)
- {
- Field *field = field_item->value.field_value->field;
- const Item *item= value.item;
-
- if (item && field)
- ((Item *)item)->save_in_field(field, false);
- };
-
- static NDB_FUNC_TYPE item_func_to_ndb_func(Item_func::Functype fun)
- {
- switch (fun) {
- case (Item_func::EQ_FUNC): { return NDB_EQ_FUNC; }
- case (Item_func::NE_FUNC): { return NDB_NE_FUNC; }
- case (Item_func::LT_FUNC): { return NDB_LT_FUNC; }
- case (Item_func::LE_FUNC): { return NDB_LE_FUNC; }
- case (Item_func::GT_FUNC): { return NDB_GT_FUNC; }
- case (Item_func::GE_FUNC): { return NDB_GE_FUNC; }
- case (Item_func::ISNULL_FUNC): { return NDB_ISNULL_FUNC; }
- case (Item_func::ISNOTNULL_FUNC): { return NDB_ISNOTNULL_FUNC; }
- case (Item_func::LIKE_FUNC): { return NDB_LIKE_FUNC; }
- case (Item_func::NOT_FUNC): { return NDB_NOT_FUNC; }
- case (Item_func::UNKNOWN_FUNC): { return NDB_UNKNOWN_FUNC; }
- case (Item_func::COND_AND_FUNC): { return NDB_COND_AND_FUNC; }
- case (Item_func::COND_OR_FUNC): { return NDB_COND_OR_FUNC; }
- default: { return NDB_UNSUPPORTED_FUNC; }
- }
- };
-
- static NDB_FUNC_TYPE negate(NDB_FUNC_TYPE fun)
- {
- uint i= (uint) fun;
- DBUG_ASSERT(fun == neg_map[i].pos_fun);
- return neg_map[i].neg_fun;
- };
-
- NDB_ITEM_TYPE type;
- NDB_ITEM_QUALIFICATION qualification;
- private:
- NDB_ITEM_VALUE value;
-};
-
-/*
- This class implements a linked list used for storing a
- serialization of the Item tree for condition pushdown.
- */
-class Ndb_cond
-{
- public:
- Ndb_cond() : ndb_item(NULL), next(NULL), prev(NULL) {};
- ~Ndb_cond()
- {
- if (ndb_item) delete ndb_item;
- ndb_item= NULL;
- if (next) delete next;
- next= prev= NULL;
- };
- Ndb_item *ndb_item;
- Ndb_cond *next;
- Ndb_cond *prev;
-};
-
-/*
- This class implements a stack for storing several conditions
- for pushdown (represented as serialized Item trees using Ndb_cond).
- The current implementation only pushes one condition, but is
- prepared for handling several (C1 AND C2 ...) if the logic for
- pushing conditions is extended in sql_select.
-*/
-class Ndb_cond_stack
-{
- public:
- Ndb_cond_stack() : ndb_cond(NULL), next(NULL) {};
- ~Ndb_cond_stack()
- {
- if (ndb_cond) delete ndb_cond;
- ndb_cond= NULL;
- if (next) delete next;
- next= NULL;
- };
- Ndb_cond *ndb_cond;
- Ndb_cond_stack *next;
-};
-
-class Ndb_rewrite_context
-{
-public:
- Ndb_rewrite_context(Item_func *func)
- : func_item(func), left_hand_item(NULL), count(0) {};
- ~Ndb_rewrite_context()
- {
- if (next) delete next;
- }
- const Item_func *func_item;
- const Item *left_hand_item;
- uint count;
- Ndb_rewrite_context *next;
-};
-
-/*
- This class is used for storing the context when traversing
- the Item tree. It stores a reference to the table the condition
- is defined on, the serialized representation being generated,
- if the condition found is supported, and information what is
- expected next in the tree inorder for the condition to be supported.
-*/
-class Ndb_cond_traverse_context
-{
- public:
- Ndb_cond_traverse_context(TABLE *tab, void* ndb_tab, Ndb_cond_stack* stack)
- : table(tab), ndb_table(ndb_tab),
- supported(TRUE), stack_ptr(stack), cond_ptr(NULL),
- skip(0), collation(NULL), rewrite_stack(NULL)
- {
- // Allocate type checking bitmaps
- bitmap_init(&expect_mask, 0, 512, FALSE);
- bitmap_init(&expect_field_type_mask, 0, 512, FALSE);
- bitmap_init(&expect_field_result_mask, 0, 512, FALSE);
-
- if (stack)
- cond_ptr= stack->ndb_cond;
- };
- ~Ndb_cond_traverse_context()
- {
- bitmap_free(&expect_mask);
- bitmap_free(&expect_field_type_mask);
- bitmap_free(&expect_field_result_mask);
- if (rewrite_stack) delete rewrite_stack;
- }
- void expect(Item::Type type)
- {
- bitmap_set_bit(&expect_mask, (uint) type);
- if (type == Item::FIELD_ITEM) expect_all_field_types();
- };
- void dont_expect(Item::Type type)
- {
- bitmap_clear_bit(&expect_mask, (uint) type);
- };
- bool expecting(Item::Type type)
- {
- return bitmap_is_set(&expect_mask, (uint) type);
- };
- void expect_nothing()
- {
- bitmap_clear_all(&expect_mask);
- };
- bool expecting_nothing()
- {
- return bitmap_is_clear_all(&expect_mask);
- }
- void expect_only(Item::Type type)
- {
- expect_nothing();
- expect(type);
- };
-
- void expect_field_type(enum_field_types type)
- {
- bitmap_set_bit(&expect_field_type_mask, (uint) type);
- };
- void expect_all_field_types()
- {
- bitmap_set_all(&expect_field_type_mask);
- };
- bool expecting_field_type(enum_field_types type)
- {
- return bitmap_is_set(&expect_field_type_mask, (uint) type);
- };
- void expect_no_field_type()
- {
- bitmap_clear_all(&expect_field_type_mask);
- };
- bool expecting_no_field_type()
- {
- return bitmap_is_clear_all(&expect_field_type_mask);
- }
- void expect_only_field_type(enum_field_types result)
- {
- expect_no_field_type();
- expect_field_type(result);
- };
-
- void expect_field_result(Item_result result)
- {
- bitmap_set_bit(&expect_field_result_mask, (uint) result);
- };
- bool expecting_field_result(Item_result result)
- {
- return bitmap_is_set(&expect_field_result_mask, (uint) result);
- };
- void expect_no_field_result()
- {
- bitmap_clear_all(&expect_field_result_mask);
- };
- bool expecting_no_field_result()
- {
- return bitmap_is_clear_all(&expect_field_result_mask);
- }
- void expect_only_field_result(Item_result result)
- {
- expect_no_field_result();
- expect_field_result(result);
- };
- void expect_collation(CHARSET_INFO* col)
- {
- collation= col;
- };
- bool expecting_collation(CHARSET_INFO* col)
- {
- bool matching= (!collation) ? true : (collation == col);
- collation= NULL;
-
- return matching;
- };
-
- TABLE* table;
- void* ndb_table;
- bool supported;
- Ndb_cond_stack* stack_ptr;
- Ndb_cond* cond_ptr;
- MY_BITMAP expect_mask;
- MY_BITMAP expect_field_type_mask;
- MY_BITMAP expect_field_result_mask;
- uint skip;
- CHARSET_INFO* collation;
- Ndb_rewrite_context *rewrite_stack;
-};
-
typedef enum ndb_query_state_bits {
NDB_QUERY_NORMAL = 0,
NDB_QUERY_MULTI_READ_RANGE = 1
@@ -721,26 +311,7 @@ bool uses_blob_value(bool all_fields);
void no_uncommitted_rows_init(THD *);
void no_uncommitted_rows_reset(THD *);
- /*
- Condition pushdown
- */
- void cond_clear();
- bool serialize_cond(const COND *cond, Ndb_cond_stack *ndb_cond);
- int build_scan_filter_predicate(Ndb_cond* &cond,
- NdbScanFilter* filter,
- bool negated= false);
- int build_scan_filter_group(Ndb_cond* &cond,
- NdbScanFilter* filter);
- int build_scan_filter(Ndb_cond* &cond, NdbScanFilter* filter);
- int generate_scan_filter(Ndb_cond_stack* cond_stack,
- NdbScanOperation* op);
- int generate_scan_filter_from_cond(Ndb_cond_stack* cond_stack,
- NdbScanFilter& filter);
- int generate_scan_filter_from_key(NdbScanOperation* op,
- const KEY* key_info,
- const byte *key,
- uint key_len,
- byte *buf);
+ void release_completed_operations(NdbTransaction*, bool);
friend int execute_commit(ha_ndbcluster*, NdbTransaction*);
friend int execute_no_commit(ha_ndbcluster*, NdbTransaction*, bool);
@@ -789,9 +360,8 @@ bool uses_blob_value(bool all_fields);
bool m_force_send;
ha_rows m_autoincrement_prefetch;
bool m_transaction_on;
- void release_completed_operations(NdbTransaction*, bool);
- Ndb_cond_stack *m_cond_stack;
+ ha_ndbcluster_cond *m_cond;
bool m_disable_multi_read;
byte *m_multi_range_result_ptr;
KEY_MULTI_RANGE *m_multi_ranges;
diff --git a/sql/ha_ndbcluster_cond.cc b/sql/ha_ndbcluster_cond.cc
new file mode 100644
index 00000000000..a0eaccb68d8
--- /dev/null
+++ b/sql/ha_ndbcluster_cond.cc
@@ -0,0 +1,1426 @@
+/* Copyright (C) 2000-2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/*
+ This file defines the NDB Cluster handler engine_condition_pushdown
+*/
+
+#ifdef USE_PRAGMA_IMPLEMENTATION
+#pragma implementation // gcc: Class implementation
+#endif
+
+#include "mysql_priv.h"
+
+#ifdef HAVE_NDBCLUSTER_DB
+#include <ndbapi/NdbApi.hpp>
+#include "ha_ndbcluster_cond.h"
+
+// Typedefs for long names
+typedef NdbDictionary::Column NDBCOL;
+typedef NdbDictionary::Table NDBTAB;
+
+/*
+ Serialize the item tree into a linked list represented by Ndb_cond
+ for fast generation of NbdScanFilter. Adds information such as
+ position of fields that is not directly available in the Item tree.
+ Also checks if condition is supported.
+*/
+void ndb_serialize_cond(const Item *item, void *arg)
+{
+ Ndb_cond_traverse_context *context= (Ndb_cond_traverse_context *) arg;
+ DBUG_ENTER("ndb_serialize_cond");
+
+ // Check if we are skipping arguments to a function to be evaluated
+ if (context->skip)
+ {
+ DBUG_PRINT("info", ("Skiping argument %d", context->skip));
+ context->skip--;
+ switch (item->type()) {
+ case Item::FUNC_ITEM:
+ {
+ Item_func *func_item= (Item_func *) item;
+ context->skip+= func_item->argument_count();
+ break;
+ }
+ case Item::INT_ITEM:
+ case Item::REAL_ITEM:
+ case Item::STRING_ITEM:
+ case Item::VARBIN_ITEM:
+ case Item::DECIMAL_ITEM:
+ break;
+ default:
+ context->supported= FALSE;
+ break;
+ }
+
+ DBUG_VOID_RETURN;
+ }
+
+ if (context->supported)
+ {
+ Ndb_rewrite_context *rewrite_context2= context->rewrite_stack;
+ const Item_func *rewrite_func_item;
+ // Check if we are rewriting some unsupported function call
+ if (rewrite_context2 &&
+ (rewrite_func_item= rewrite_context2->func_item) &&
+ rewrite_context2->count++ == 0)
+ {
+ switch (rewrite_func_item->functype()) {
+ case Item_func::BETWEEN:
+ /*
+ Rewrite
+ <field>|<const> BETWEEN <const1>|<field1> AND <const2>|<field2>
+ to <field>|<const> > <const1>|<field1> AND
+ <field>|<const> < <const2>|<field2>
+ or actually in prefix format
+ BEGIN(AND) GT(<field>|<const>, <const1>|<field1>),
+ LT(<field>|<const>, <const2>|<field2>), END()
+ */
+ case Item_func::IN_FUNC:
+ {
+ /*
+ Rewrite <field>|<const> IN(<const1>|<field1>, <const2>|<field2>,..)
+ to <field>|<const> = <const1>|<field1> OR
+ <field> = <const2>|<field2> ...
+ or actually in prefix format
+ BEGIN(OR) EQ(<field>|<const>, <const1><field1>),
+ EQ(<field>|<const>, <const2>|<field2>), ... END()
+ Each part of the disjunction is added for each call
+ to ndb_serialize_cond and end of rewrite statement
+ is wrapped in end of ndb_serialize_cond
+ */
+ if (context->expecting(item->type()))
+ {
+ // This is the <field>|<const> item, save it in the rewrite context
+ rewrite_context2->left_hand_item= item;
+ if (item->type() == Item::FUNC_ITEM)
+ {
+ Item_func *func_item= (Item_func *) item;
+ if (func_item->functype() == Item_func::UNKNOWN_FUNC &&
+ func_item->const_item())
+ {
+ // Skip any arguments since we will evaluate function instead
+ DBUG_PRINT("info", ("Skip until end of arguments marker"));
+ context->skip= func_item->argument_count();
+ }
+ else
+ {
+ DBUG_PRINT("info", ("Found unsupported functional expression in BETWEEN|IN"));
+ context->supported= FALSE;
+ DBUG_VOID_RETURN;
+
+ }
+ }
+ }
+ else
+ {
+ // Non-supported BETWEEN|IN expression
+ DBUG_PRINT("info", ("Found unexpected item of type %u in BETWEEN|IN",
+ item->type()));
+ context->supported= FALSE;
+ DBUG_VOID_RETURN;
+ }
+ break;
+ }
+ default:
+ context->supported= FALSE;
+ break;
+ }
+ DBUG_VOID_RETURN;
+ }
+ else
+ {
+ Ndb_cond_stack *ndb_stack= context->stack_ptr;
+ Ndb_cond *prev_cond= context->cond_ptr;
+ Ndb_cond *curr_cond= context->cond_ptr= new Ndb_cond();
+ if (!ndb_stack->ndb_cond)
+ ndb_stack->ndb_cond= curr_cond;
+ curr_cond->prev= prev_cond;
+ if (prev_cond) prev_cond->next= curr_cond;
+ // Check if we are rewriting some unsupported function call
+ if (context->rewrite_stack)
+ {
+ Ndb_rewrite_context *rewrite_context= context->rewrite_stack;
+ const Item_func *func_item= rewrite_context->func_item;
+ switch (func_item->functype()) {
+ case Item_func::BETWEEN:
+ {
+ /*
+ Rewrite
+ <field>|<const> BETWEEN <const1>|<field1> AND <const2>|<field2>
+ to <field>|<const> > <const1>|<field1> AND
+ <field>|<const> < <const2>|<field2>
+ or actually in prefix format
+ BEGIN(AND) GT(<field>|<const>, <const1>|<field1>),
+ LT(<field>|<const>, <const2>|<field2>), END()
+ */
+ if (rewrite_context->count == 2)
+ {
+ // Lower limit of BETWEEN
+ DBUG_PRINT("info", ("GE_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(Item_func::GE_FUNC, 2);
+ }
+ else if (rewrite_context->count == 3)
+ {
+ // Upper limit of BETWEEN
+ DBUG_PRINT("info", ("LE_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(Item_func::LE_FUNC, 2);
+ }
+ else
+ {
+ // Illegal BETWEEN expression
+ DBUG_PRINT("info", ("Illegal BETWEEN expression"));
+ context->supported= FALSE;
+ DBUG_VOID_RETURN;
+ }
+ break;
+ }
+ case Item_func::IN_FUNC:
+ {
+ /*
+ Rewrite <field>|<const> IN(<const1>|<field1>, <const2>|<field2>,..)
+ to <field>|<const> = <const1>|<field1> OR
+ <field> = <const2>|<field2> ...
+ or actually in prefix format
+ BEGIN(OR) EQ(<field>|<const>, <const1><field1>),
+ EQ(<field>|<const>, <const2>|<field2>), ... END()
+ Each part of the disjunction is added for each call
+ to ndb_serialize_cond and end of rewrite statement
+ is wrapped in end of ndb_serialize_cond
+ */
+ DBUG_PRINT("info", ("EQ_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(Item_func::EQ_FUNC, 2);
+ break;
+ }
+ default:
+ context->supported= FALSE;
+ }
+ // Handle left hand <field>|<const>
+ context->rewrite_stack= NULL; // Disable rewrite mode
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect_field_result(STRING_RESULT);
+ context->expect_field_result(REAL_RESULT);
+ context->expect_field_result(INT_RESULT);
+ context->expect_field_result(DECIMAL_RESULT);
+ context->expect(Item::INT_ITEM);
+ context->expect(Item::STRING_ITEM);
+ context->expect(Item::VARBIN_ITEM);
+ context->expect(Item::FUNC_ITEM);
+ ndb_serialize_cond(rewrite_context->left_hand_item, arg);
+ context->skip= 0; // Any FUNC_ITEM expression has already been parsed
+ context->rewrite_stack= rewrite_context; // Enable rewrite mode
+ if (!context->supported)
+ DBUG_VOID_RETURN;
+
+ prev_cond= context->cond_ptr;
+ curr_cond= context->cond_ptr= new Ndb_cond();
+ prev_cond->next= curr_cond;
+ }
+
+ // Check for end of AND/OR expression
+ if (!item)
+ {
+ // End marker for condition group
+ DBUG_PRINT("info", ("End of condition group"));
+ curr_cond->ndb_item= new Ndb_item(NDB_END_COND);
+ }
+ else
+ {
+ switch (item->type()) {
+ case Item::FIELD_ITEM:
+ {
+ Item_field *field_item= (Item_field *) item;
+ Field *field= field_item->field;
+ enum_field_types type= field->type();
+ /*
+ Check that the field is part of the table of the handler
+ instance and that we expect a field with of this result type.
+ */
+ if (context->table->s == field->table->s)
+ {
+ const NDBTAB *tab= context->ndb_table;
+ DBUG_PRINT("info", ("FIELD_ITEM"));
+ DBUG_PRINT("info", ("table %s", tab->getName()));
+ DBUG_PRINT("info", ("column %s", field->field_name));
+ DBUG_PRINT("info", ("type %d", field->type()));
+ DBUG_PRINT("info", ("result type %d", field->result_type()));
+
+ // Check that we are expecting a field and with the correct
+ // result type
+ if (context->expecting(Item::FIELD_ITEM) &&
+ context->expecting_field_type(field->type()) &&
+ (context->expecting_field_result(field->result_type()) ||
+ // Date and year can be written as string or int
+ ((type == MYSQL_TYPE_TIME ||
+ type == MYSQL_TYPE_DATE ||
+ type == MYSQL_TYPE_YEAR ||
+ type == MYSQL_TYPE_DATETIME)
+ ? (context->expecting_field_result(STRING_RESULT) ||
+ context->expecting_field_result(INT_RESULT))
+ : TRUE)) &&
+ // Bit fields no yet supported in scan filter
+ type != MYSQL_TYPE_BIT &&
+ // No BLOB support in scan filter
+ type != MYSQL_TYPE_TINY_BLOB &&
+ type != MYSQL_TYPE_MEDIUM_BLOB &&
+ type != MYSQL_TYPE_LONG_BLOB &&
+ type != MYSQL_TYPE_BLOB)
+ {
+ const NDBCOL *col= tab->getColumn(field->field_name);
+ DBUG_ASSERT(col);
+ curr_cond->ndb_item= new Ndb_item(field, col->getColumnNo());
+ context->dont_expect(Item::FIELD_ITEM);
+ context->expect_no_field_result();
+ if (! context->expecting_nothing())
+ {
+ // We have not seen second argument yet
+ if (type == MYSQL_TYPE_TIME ||
+ type == MYSQL_TYPE_DATE ||
+ type == MYSQL_TYPE_YEAR ||
+ type == MYSQL_TYPE_DATETIME)
+ {
+ context->expect_only(Item::STRING_ITEM);
+ context->expect(Item::INT_ITEM);
+ }
+ else
+ switch (field->result_type()) {
+ case STRING_RESULT:
+ // Expect char string or binary string
+ context->expect_only(Item::STRING_ITEM);
+ context->expect(Item::VARBIN_ITEM);
+ context->expect_collation(field_item->collation.collation);
+ break;
+ case REAL_RESULT:
+ context->expect_only(Item::REAL_ITEM);
+ context->expect(Item::DECIMAL_ITEM);
+ context->expect(Item::INT_ITEM);
+ break;
+ case INT_RESULT:
+ context->expect_only(Item::INT_ITEM);
+ context->expect(Item::VARBIN_ITEM);
+ break;
+ case DECIMAL_RESULT:
+ context->expect_only(Item::DECIMAL_ITEM);
+ context->expect(Item::REAL_ITEM);
+ context->expect(Item::INT_ITEM);
+ break;
+ default:
+ break;
+ }
+ }
+ else
+ {
+ // Expect another logical expression
+ context->expect_only(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ // Check that field and string constant collations are the same
+ if ((field->result_type() == STRING_RESULT) &&
+ !context->expecting_collation(item->collation.collation)
+ && type != MYSQL_TYPE_TIME
+ && type != MYSQL_TYPE_DATE
+ && type != MYSQL_TYPE_YEAR
+ && type != MYSQL_TYPE_DATETIME)
+ {
+ DBUG_PRINT("info", ("Found non-matching collation %s",
+ item->collation.collation->name));
+ context->supported= FALSE;
+ }
+ }
+ break;
+ }
+ else
+ {
+ DBUG_PRINT("info", ("Was not expecting field of type %u(%u)",
+ field->result_type(), type));
+ context->supported= FALSE;
+ }
+ }
+ else
+ {
+ DBUG_PRINT("info", ("Was not expecting field from table %s (%s)",
+ context->table->s->table_name,
+ field->table->s->table_name));
+ context->supported= FALSE;
+ }
+ break;
+ }
+ case Item::FUNC_ITEM:
+ {
+ Item_func *func_item= (Item_func *) item;
+ // Check that we expect a function or functional expression here
+ if (context->expecting(Item::FUNC_ITEM) ||
+ func_item->functype() == Item_func::UNKNOWN_FUNC)
+ context->expect_nothing();
+ else
+ {
+ // Did not expect function here
+ context->supported= FALSE;
+ break;
+ }
+
+ switch (func_item->functype()) {
+ case Item_func::EQ_FUNC:
+ {
+ DBUG_PRINT("info", ("EQ_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(func_item->functype(),
+ func_item);
+ context->expect(Item::STRING_ITEM);
+ context->expect(Item::INT_ITEM);
+ context->expect(Item::REAL_ITEM);
+ context->expect(Item::DECIMAL_ITEM);
+ context->expect(Item::VARBIN_ITEM);
+ context->expect(Item::FIELD_ITEM);
+ context->expect_field_result(STRING_RESULT);
+ context->expect_field_result(REAL_RESULT);
+ context->expect_field_result(INT_RESULT);
+ context->expect_field_result(DECIMAL_RESULT);
+ break;
+ }
+ case Item_func::NE_FUNC:
+ {
+ DBUG_PRINT("info", ("NE_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(func_item->functype(),
+ func_item);
+ context->expect(Item::STRING_ITEM);
+ context->expect(Item::INT_ITEM);
+ context->expect(Item::REAL_ITEM);
+ context->expect(Item::DECIMAL_ITEM);
+ context->expect(Item::VARBIN_ITEM);
+ context->expect(Item::FIELD_ITEM);
+ context->expect_field_result(STRING_RESULT);
+ context->expect_field_result(REAL_RESULT);
+ context->expect_field_result(INT_RESULT);
+ context->expect_field_result(DECIMAL_RESULT);
+ break;
+ }
+ case Item_func::LT_FUNC:
+ {
+ DBUG_PRINT("info", ("LT_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(func_item->functype(),
+ func_item);
+ context->expect(Item::STRING_ITEM);
+ context->expect(Item::INT_ITEM);
+ context->expect(Item::REAL_ITEM);
+ context->expect(Item::DECIMAL_ITEM);
+ context->expect(Item::VARBIN_ITEM);
+ context->expect(Item::FIELD_ITEM);
+ context->expect_field_result(STRING_RESULT);
+ context->expect_field_result(REAL_RESULT);
+ context->expect_field_result(INT_RESULT);
+ context->expect_field_result(DECIMAL_RESULT);
+ break;
+ }
+ case Item_func::LE_FUNC:
+ {
+ DBUG_PRINT("info", ("LE_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(func_item->functype(),
+ func_item);
+ context->expect(Item::STRING_ITEM);
+ context->expect(Item::INT_ITEM);
+ context->expect(Item::REAL_ITEM);
+ context->expect(Item::DECIMAL_ITEM);
+ context->expect(Item::VARBIN_ITEM);
+ context->expect(Item::FIELD_ITEM);
+ context->expect_field_result(STRING_RESULT);
+ context->expect_field_result(REAL_RESULT);
+ context->expect_field_result(INT_RESULT);
+ context->expect_field_result(DECIMAL_RESULT);
+ break;
+ }
+ case Item_func::GE_FUNC:
+ {
+ DBUG_PRINT("info", ("GE_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(func_item->functype(),
+ func_item);
+ context->expect(Item::STRING_ITEM);
+ context->expect(Item::INT_ITEM);
+ context->expect(Item::REAL_ITEM);
+ context->expect(Item::DECIMAL_ITEM);
+ context->expect(Item::VARBIN_ITEM);
+ context->expect(Item::FIELD_ITEM);
+ context->expect_field_result(STRING_RESULT);
+ context->expect_field_result(REAL_RESULT);
+ context->expect_field_result(INT_RESULT);
+ context->expect_field_result(DECIMAL_RESULT);
+ break;
+ }
+ case Item_func::GT_FUNC:
+ {
+ DBUG_PRINT("info", ("GT_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(func_item->functype(),
+ func_item);
+ context->expect(Item::STRING_ITEM);
+ context->expect(Item::REAL_ITEM);
+ context->expect(Item::DECIMAL_ITEM);
+ context->expect(Item::INT_ITEM);
+ context->expect(Item::VARBIN_ITEM);
+ context->expect(Item::FIELD_ITEM);
+ context->expect_field_result(STRING_RESULT);
+ context->expect_field_result(REAL_RESULT);
+ context->expect_field_result(INT_RESULT);
+ context->expect_field_result(DECIMAL_RESULT);
+ break;
+ }
+ case Item_func::LIKE_FUNC:
+ {
+ DBUG_PRINT("info", ("LIKE_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(func_item->functype(),
+ func_item);
+ context->expect(Item::STRING_ITEM);
+ context->expect(Item::FIELD_ITEM);
+ context->expect_only_field_type(MYSQL_TYPE_STRING);
+ context->expect_field_type(MYSQL_TYPE_VAR_STRING);
+ context->expect_field_type(MYSQL_TYPE_VARCHAR);
+ context->expect_field_result(STRING_RESULT);
+ context->expect(Item::FUNC_ITEM);
+ break;
+ }
+ case Item_func::ISNULL_FUNC:
+ {
+ DBUG_PRINT("info", ("ISNULL_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(func_item->functype(),
+ func_item);
+ context->expect(Item::FIELD_ITEM);
+ context->expect_field_result(STRING_RESULT);
+ context->expect_field_result(REAL_RESULT);
+ context->expect_field_result(INT_RESULT);
+ context->expect_field_result(DECIMAL_RESULT);
+ break;
+ }
+ case Item_func::ISNOTNULL_FUNC:
+ {
+ DBUG_PRINT("info", ("ISNOTNULL_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(func_item->functype(),
+ func_item);
+ context->expect(Item::FIELD_ITEM);
+ context->expect_field_result(STRING_RESULT);
+ context->expect_field_result(REAL_RESULT);
+ context->expect_field_result(INT_RESULT);
+ context->expect_field_result(DECIMAL_RESULT);
+ break;
+ }
+ case Item_func::NOT_FUNC:
+ {
+ DBUG_PRINT("info", ("NOT_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(func_item->functype(),
+ func_item);
+ context->expect(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ break;
+ }
+ case Item_func::BETWEEN:
+ {
+ DBUG_PRINT("info", ("BETWEEN, rewriting using AND"));
+ Item_func_between *between_func= (Item_func_between *) func_item;
+ Ndb_rewrite_context *rewrite_context=
+ new Ndb_rewrite_context(func_item);
+ rewrite_context->next= context->rewrite_stack;
+ context->rewrite_stack= rewrite_context;
+ if (between_func->negated)
+ {
+ DBUG_PRINT("info", ("NOT_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(Item_func::NOT_FUNC, 1);
+ prev_cond= curr_cond;
+ curr_cond= context->cond_ptr= new Ndb_cond();
+ curr_cond->prev= prev_cond;
+ prev_cond->next= curr_cond;
+ }
+ DBUG_PRINT("info", ("COND_AND_FUNC"));
+ curr_cond->ndb_item=
+ new Ndb_item(Item_func::COND_AND_FUNC,
+ func_item->argument_count() - 1);
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect(Item::INT_ITEM);
+ context->expect(Item::STRING_ITEM);
+ context->expect(Item::VARBIN_ITEM);
+ context->expect(Item::FUNC_ITEM);
+ break;
+ }
+ case Item_func::IN_FUNC:
+ {
+ DBUG_PRINT("info", ("IN_FUNC, rewriting using OR"));
+ Item_func_in *in_func= (Item_func_in *) func_item;
+ Ndb_rewrite_context *rewrite_context=
+ new Ndb_rewrite_context(func_item);
+ rewrite_context->next= context->rewrite_stack;
+ context->rewrite_stack= rewrite_context;
+ if (in_func->negated)
+ {
+ DBUG_PRINT("info", ("NOT_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(Item_func::NOT_FUNC, 1);
+ prev_cond= curr_cond;
+ curr_cond= context->cond_ptr= new Ndb_cond();
+ curr_cond->prev= prev_cond;
+ prev_cond->next= curr_cond;
+ }
+ DBUG_PRINT("info", ("COND_OR_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(Item_func::COND_OR_FUNC,
+ func_item->argument_count() - 1);
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect(Item::INT_ITEM);
+ context->expect(Item::STRING_ITEM);
+ context->expect(Item::VARBIN_ITEM);
+ context->expect(Item::FUNC_ITEM);
+ break;
+ }
+ case Item_func::UNKNOWN_FUNC:
+ {
+ DBUG_PRINT("info", ("UNKNOWN_FUNC %s",
+ func_item->const_item()?"const":""));
+ DBUG_PRINT("info", ("result type %d", func_item->result_type()));
+ if (func_item->const_item())
+ {
+ switch (func_item->result_type()) {
+ case STRING_RESULT:
+ {
+ NDB_ITEM_QUALIFICATION q;
+ q.value_type= Item::STRING_ITEM;
+ curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
+ if (! context->expecting_no_field_result())
+ {
+ // We have not seen the field argument yet
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect_only_field_result(STRING_RESULT);
+ context->expect_collation(func_item->collation.collation);
+ }
+ else
+ {
+ // Expect another logical expression
+ context->expect_only(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ // Check that string result have correct collation
+ if (!context->expecting_collation(item->collation.collation))
+ {
+ DBUG_PRINT("info", ("Found non-matching collation %s",
+ item->collation.collation->name));
+ context->supported= FALSE;
+ }
+ }
+ // Skip any arguments since we will evaluate function instead
+ DBUG_PRINT("info", ("Skip until end of arguments marker"));
+ context->skip= func_item->argument_count();
+ break;
+ }
+ case REAL_RESULT:
+ {
+ NDB_ITEM_QUALIFICATION q;
+ q.value_type= Item::REAL_ITEM;
+ curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
+ if (! context->expecting_no_field_result())
+ {
+ // We have not seen the field argument yet
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect_only_field_result(REAL_RESULT);
+ }
+ else
+ {
+ // Expect another logical expression
+ context->expect_only(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ }
+
+ // Skip any arguments since we will evaluate function instead
+ DBUG_PRINT("info", ("Skip until end of arguments marker"));
+ context->skip= func_item->argument_count();
+ break;
+ }
+ case INT_RESULT:
+ {
+ NDB_ITEM_QUALIFICATION q;
+ q.value_type= Item::INT_ITEM;
+ curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
+ if (! context->expecting_no_field_result())
+ {
+ // We have not seen the field argument yet
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect_only_field_result(INT_RESULT);
+ }
+ else
+ {
+ // Expect another logical expression
+ context->expect_only(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ }
+
+ // Skip any arguments since we will evaluate function instead
+ DBUG_PRINT("info", ("Skip until end of arguments marker"));
+ context->skip= func_item->argument_count();
+ break;
+ }
+ case DECIMAL_RESULT:
+ {
+ NDB_ITEM_QUALIFICATION q;
+ q.value_type= Item::DECIMAL_ITEM;
+ curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
+ if (! context->expecting_no_field_result())
+ {
+ // We have not seen the field argument yet
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect_only_field_result(DECIMAL_RESULT);
+ }
+ else
+ {
+ // Expect another logical expression
+ context->expect_only(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ }
+ // Skip any arguments since we will evaluate function instead
+ DBUG_PRINT("info", ("Skip until end of arguments marker"));
+ context->skip= func_item->argument_count();
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ else
+ // Function does not return constant expression
+ context->supported= FALSE;
+ break;
+ }
+ default:
+ {
+ DBUG_PRINT("info", ("Found func_item of type %d",
+ func_item->functype()));
+ context->supported= FALSE;
+ }
+ }
+ break;
+ }
+ case Item::STRING_ITEM:
+ DBUG_PRINT("info", ("STRING_ITEM"));
+ if (context->expecting(Item::STRING_ITEM))
+ {
+#ifndef DBUG_OFF
+ char buff[256];
+ String str(buff,(uint32) sizeof(buff), system_charset_info);
+ str.length(0);
+ Item_string *string_item= (Item_string *) item;
+ DBUG_PRINT("info", ("value \"%s\"",
+ string_item->val_str(&str)->ptr()));
+#endif
+ NDB_ITEM_QUALIFICATION q;
+ q.value_type= Item::STRING_ITEM;
+ curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
+ if (! context->expecting_no_field_result())
+ {
+ // We have not seen the field argument yet
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect_only_field_result(STRING_RESULT);
+ context->expect_collation(item->collation.collation);
+ }
+ else
+ {
+ // Expect another logical expression
+ context->expect_only(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ // Check that we are comparing with a field with same collation
+ if (!context->expecting_collation(item->collation.collation))
+ {
+ DBUG_PRINT("info", ("Found non-matching collation %s",
+ item->collation.collation->name));
+ context->supported= FALSE;
+ }
+ }
+ }
+ else
+ context->supported= FALSE;
+ break;
+ case Item::INT_ITEM:
+ DBUG_PRINT("info", ("INT_ITEM"));
+ if (context->expecting(Item::INT_ITEM))
+ {
+ DBUG_PRINT("info", ("value %ld",
+ (long) ((Item_int*) item)->value));
+ NDB_ITEM_QUALIFICATION q;
+ q.value_type= Item::INT_ITEM;
+ curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
+ if (! context->expecting_no_field_result())
+ {
+ // We have not seen the field argument yet
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect_only_field_result(INT_RESULT);
+ context->expect_field_result(REAL_RESULT);
+ context->expect_field_result(DECIMAL_RESULT);
+ }
+ else
+ {
+ // Expect another logical expression
+ context->expect_only(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ }
+ }
+ else
+ context->supported= FALSE;
+ break;
+ case Item::REAL_ITEM:
+ DBUG_PRINT("info", ("REAL_ITEM"));
+ if (context->expecting(Item::REAL_ITEM))
+ {
+ DBUG_PRINT("info", ("value %f", ((Item_float*) item)->value));
+ NDB_ITEM_QUALIFICATION q;
+ q.value_type= Item::REAL_ITEM;
+ curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
+ if (! context->expecting_no_field_result())
+ {
+ // We have not seen the field argument yet
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect_only_field_result(REAL_RESULT);
+ }
+ else
+ {
+ // Expect another logical expression
+ context->expect_only(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ }
+ }
+ else
+ context->supported= FALSE;
+ break;
+ case Item::VARBIN_ITEM:
+ DBUG_PRINT("info", ("VARBIN_ITEM"));
+ if (context->expecting(Item::VARBIN_ITEM))
+ {
+ NDB_ITEM_QUALIFICATION q;
+ q.value_type= Item::VARBIN_ITEM;
+ curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
+ if (! context->expecting_no_field_result())
+ {
+ // We have not seen the field argument yet
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect_only_field_result(STRING_RESULT);
+ }
+ else
+ {
+ // Expect another logical expression
+ context->expect_only(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ }
+ }
+ else
+ context->supported= FALSE;
+ break;
+ case Item::DECIMAL_ITEM:
+ DBUG_PRINT("info", ("DECIMAL_ITEM"));
+ if (context->expecting(Item::DECIMAL_ITEM))
+ {
+ DBUG_PRINT("info", ("value %f",
+ ((Item_decimal*) item)->val_real()));
+ NDB_ITEM_QUALIFICATION q;
+ q.value_type= Item::DECIMAL_ITEM;
+ curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
+ if (! context->expecting_no_field_result())
+ {
+ // We have not seen the field argument yet
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect_only_field_result(REAL_RESULT);
+ context->expect_field_result(DECIMAL_RESULT);
+ }
+ else
+ {
+ // Expect another logical expression
+ context->expect_only(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ }
+ }
+ else
+ context->supported= FALSE;
+ break;
+ case Item::COND_ITEM:
+ {
+ Item_cond *cond_item= (Item_cond *) item;
+
+ if (context->expecting(Item::COND_ITEM))
+ {
+ switch (cond_item->functype()) {
+ case Item_func::COND_AND_FUNC:
+ DBUG_PRINT("info", ("COND_AND_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(cond_item->functype(),
+ cond_item);
+ break;
+ case Item_func::COND_OR_FUNC:
+ DBUG_PRINT("info", ("COND_OR_FUNC"));
+ curr_cond->ndb_item= new Ndb_item(cond_item->functype(),
+ cond_item);
+ break;
+ default:
+ DBUG_PRINT("info", ("COND_ITEM %d", cond_item->functype()));
+ context->supported= FALSE;
+ break;
+ }
+ }
+ else
+ {
+ /* Did not expect condition */
+ context->supported= FALSE;
+ }
+ break;
+ }
+ default:
+ {
+ DBUG_PRINT("info", ("Found item of type %d", item->type()));
+ context->supported= FALSE;
+ }
+ }
+ }
+ if (context->supported && context->rewrite_stack)
+ {
+ Ndb_rewrite_context *rewrite_context= context->rewrite_stack;
+ if (rewrite_context->count ==
+ rewrite_context->func_item->argument_count())
+ {
+ // Rewrite is done, wrap an END() at the en
+ DBUG_PRINT("info", ("End of condition group"));
+ prev_cond= curr_cond;
+ curr_cond= context->cond_ptr= new Ndb_cond();
+ curr_cond->prev= prev_cond;
+ prev_cond->next= curr_cond;
+ curr_cond->ndb_item= new Ndb_item(NDB_END_COND);
+ // Pop rewrite stack
+ context->rewrite_stack= rewrite_context->next;
+ rewrite_context->next= NULL;
+ delete(rewrite_context);
+ }
+ }
+ }
+ }
+
+ DBUG_VOID_RETURN;
+}
+
+/*
+ Push a condition
+ */
+const
+COND*
+ha_ndbcluster_cond::cond_push(const COND *cond,
+ TABLE *table, const NDBTAB *ndb_table)
+{
+ DBUG_ENTER("cond_push");
+ Ndb_cond_stack *ndb_cond = new Ndb_cond_stack();
+ if (ndb_cond == NULL)
+ {
+ my_errno= HA_ERR_OUT_OF_MEM;
+ DBUG_RETURN(NULL);
+ }
+ if (m_cond_stack)
+ ndb_cond->next= m_cond_stack;
+ else
+ ndb_cond->next= NULL;
+ m_cond_stack= ndb_cond;
+
+ if (serialize_cond(cond, ndb_cond, table, ndb_table))
+ {
+ DBUG_RETURN(NULL);
+ }
+ else
+ {
+ cond_pop();
+ }
+ DBUG_RETURN(cond);
+}
+
+/*
+ Pop the top condition from the condition stack
+*/
+void
+ha_ndbcluster_cond::cond_pop()
+{
+ Ndb_cond_stack *ndb_cond_stack= m_cond_stack;
+ if (ndb_cond_stack)
+ {
+ m_cond_stack= ndb_cond_stack->next;
+ ndb_cond_stack->next= NULL;
+ delete ndb_cond_stack;
+ }
+}
+
+/*
+ Clear the condition stack
+*/
+void
+ha_ndbcluster_cond::cond_clear()
+{
+ DBUG_ENTER("cond_clear");
+ while (m_cond_stack)
+ cond_pop();
+
+ DBUG_VOID_RETURN;
+}
+
+bool
+ha_ndbcluster_cond::serialize_cond(const COND *cond, Ndb_cond_stack *ndb_cond,
+ TABLE *table, const NDBTAB *ndb_table)
+{
+ DBUG_ENTER("serialize_cond");
+ Item *item= (Item *) cond;
+ Ndb_cond_traverse_context context(table, ndb_table, ndb_cond);
+ // Expect a logical expression
+ context.expect(Item::FUNC_ITEM);
+ context.expect(Item::COND_ITEM);
+ item->traverse_cond(&ndb_serialize_cond, (void *) &context, Item::PREFIX);
+ DBUG_PRINT("info", ("The pushed condition is %ssupported", (context.supported)?"":"not "));
+
+ DBUG_RETURN(context.supported);
+}
+
+int
+ha_ndbcluster_cond::build_scan_filter_predicate(Ndb_cond * &cond,
+ NdbScanFilter *filter,
+ bool negated)
+{
+ DBUG_ENTER("build_scan_filter_predicate");
+ switch (cond->ndb_item->type) {
+ case NDB_FUNCTION:
+ {
+ if (!cond->next)
+ break;
+ Ndb_item *a= cond->next->ndb_item;
+ Ndb_item *b, *field, *value= NULL;
+
+ switch (cond->ndb_item->argument_count()) {
+ case 1:
+ field= (a->type == NDB_FIELD)? a : NULL;
+ break;
+ case 2:
+ if (!cond->next->next)
+ {
+ field= NULL;
+ break;
+ }
+ b= cond->next->next->ndb_item;
+ value= ((a->type == NDB_VALUE) ? a :
+ (b->type == NDB_VALUE) ? b :
+ NULL);
+ field= ((a->type == NDB_FIELD) ? a :
+ (b->type == NDB_FIELD) ? b :
+ NULL);
+ break;
+ default:
+ field= NULL; //Keep compiler happy
+ DBUG_ASSERT(0);
+ break;
+ }
+ switch ((negated) ?
+ Ndb_item::negate(cond->ndb_item->qualification.function_type)
+ : cond->ndb_item->qualification.function_type) {
+ case NDB_EQ_FUNC:
+ {
+ if (!value || !field) break;
+ // Save value in right format for the field type
+ value->save_in_field(field);
+ DBUG_PRINT("info", ("Generating EQ filter"));
+ if (filter->cmp(NdbScanFilter::COND_EQ,
+ field->get_field_no(),
+ field->get_val(),
+ field->pack_length()) == -1)
+ DBUG_RETURN(1);
+ cond= cond->next->next->next;
+ DBUG_RETURN(0);
+ }
+ case NDB_NE_FUNC:
+ {
+ if (!value || !field) break;
+ // Save value in right format for the field type
+ value->save_in_field(field);
+ DBUG_PRINT("info", ("Generating NE filter"));
+ if (filter->cmp(NdbScanFilter::COND_NE,
+ field->get_field_no(),
+ field->get_val(),
+ field->pack_length()) == -1)
+ DBUG_RETURN(1);
+ cond= cond->next->next->next;
+ DBUG_RETURN(0);
+ }
+ case NDB_LT_FUNC:
+ {
+ if (!value || !field) break;
+ // Save value in right format for the field type
+ value->save_in_field(field);
+ if (a == field)
+ {
+ DBUG_PRINT("info", ("Generating LT filter"));
+ if (filter->cmp(NdbScanFilter::COND_LT,
+ field->get_field_no(),
+ field->get_val(),
+ field->pack_length()) == -1)
+ DBUG_RETURN(1);
+ }
+ else
+ {
+ DBUG_PRINT("info", ("Generating GT filter"));
+ if (filter->cmp(NdbScanFilter::COND_GT,
+ field->get_field_no(),
+ field->get_val(),
+ field->pack_length()) == -1)
+ DBUG_RETURN(1);
+ }
+ cond= cond->next->next->next;
+ DBUG_RETURN(0);
+ }
+ case NDB_LE_FUNC:
+ {
+ if (!value || !field) break;
+ // Save value in right format for the field type
+ value->save_in_field(field);
+ if (a == field)
+ {
+ DBUG_PRINT("info", ("Generating LE filter"));
+ if (filter->cmp(NdbScanFilter::COND_LE,
+ field->get_field_no(),
+ field->get_val(),
+ field->pack_length()) == -1)
+ DBUG_RETURN(1);
+ }
+ else
+ {
+ DBUG_PRINT("info", ("Generating GE filter"));
+ if (filter->cmp(NdbScanFilter::COND_GE,
+ field->get_field_no(),
+ field->get_val(),
+ field->pack_length()) == -1)
+ DBUG_RETURN(1);
+ }
+ cond= cond->next->next->next;
+ DBUG_RETURN(0);
+ }
+ case NDB_GE_FUNC:
+ {
+ if (!value || !field) break;
+ // Save value in right format for the field type
+ value->save_in_field(field);
+ if (a == field)
+ {
+ DBUG_PRINT("info", ("Generating GE filter"));
+ if (filter->cmp(NdbScanFilter::COND_GE,
+ field->get_field_no(),
+ field->get_val(),
+ field->pack_length()) == -1)
+ DBUG_RETURN(1);
+ }
+ else
+ {
+ DBUG_PRINT("info", ("Generating LE filter"));
+ if (filter->cmp(NdbScanFilter::COND_LE,
+ field->get_field_no(),
+ field->get_val(),
+ field->pack_length()) == -1)
+ DBUG_RETURN(1);
+ }
+ cond= cond->next->next->next;
+ DBUG_RETURN(0);
+ }
+ case NDB_GT_FUNC:
+ {
+ if (!value || !field) break;
+ // Save value in right format for the field type
+ value->save_in_field(field);
+ if (a == field)
+ {
+ DBUG_PRINT("info", ("Generating GT filter"));
+ if (filter->cmp(NdbScanFilter::COND_GT,
+ field->get_field_no(),
+ field->get_val(),
+ field->pack_length()) == -1)
+ DBUG_RETURN(1);
+ }
+ else
+ {
+ DBUG_PRINT("info", ("Generating LT filter"));
+ if (filter->cmp(NdbScanFilter::COND_LT,
+ field->get_field_no(),
+ field->get_val(),
+ field->pack_length()) == -1)
+ DBUG_RETURN(1);
+ }
+ cond= cond->next->next->next;
+ DBUG_RETURN(0);
+ }
+ case NDB_LIKE_FUNC:
+ {
+ if (!value || !field) break;
+ if ((value->qualification.value_type != Item::STRING_ITEM) &&
+ (value->qualification.value_type != Item::VARBIN_ITEM))
+ break;
+ // Save value in right format for the field type
+ value->save_in_field(field);
+ DBUG_PRINT("info", ("Generating LIKE filter: like(%d,%s,%d)",
+ field->get_field_no(), value->get_val(),
+ value->pack_length()));
+ if (filter->cmp(NdbScanFilter::COND_LIKE,
+ field->get_field_no(),
+ value->get_val(),
+ value->pack_length()) == -1)
+ DBUG_RETURN(1);
+ cond= cond->next->next->next;
+ DBUG_RETURN(0);
+ }
+ case NDB_NOTLIKE_FUNC:
+ {
+ if (!value || !field) break;
+ if ((value->qualification.value_type != Item::STRING_ITEM) &&
+ (value->qualification.value_type != Item::VARBIN_ITEM))
+ break;
+ // Save value in right format for the field type
+ value->save_in_field(field);
+ DBUG_PRINT("info", ("Generating NOTLIKE filter: notlike(%d,%s,%d)",
+ field->get_field_no(), value->get_val(),
+ value->pack_length()));
+ if (filter->cmp(NdbScanFilter::COND_NOT_LIKE,
+ field->get_field_no(),
+ value->get_val(),
+ value->pack_length()) == -1)
+ DBUG_RETURN(1);
+ cond= cond->next->next->next;
+ DBUG_RETURN(0);
+ }
+ case NDB_ISNULL_FUNC:
+ if (!field)
+ break;
+ DBUG_PRINT("info", ("Generating ISNULL filter"));
+ if (filter->isnull(field->get_field_no()) == -1)
+ DBUG_RETURN(1);
+ cond= cond->next->next;
+ DBUG_RETURN(0);
+ case NDB_ISNOTNULL_FUNC:
+ {
+ if (!field)
+ break;
+ DBUG_PRINT("info", ("Generating ISNOTNULL filter"));
+ if (filter->isnotnull(field->get_field_no()) == -1)
+ DBUG_RETURN(1);
+ cond= cond->next->next;
+ DBUG_RETURN(0);
+ }
+ default:
+ break;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ DBUG_PRINT("info", ("Found illegal condition"));
+ DBUG_RETURN(1);
+}
+
+
+int
+ha_ndbcluster_cond::build_scan_filter_group(Ndb_cond* &cond,
+ NdbScanFilter *filter)
+{
+ uint level=0;
+ bool negated= FALSE;
+ DBUG_ENTER("build_scan_filter_group");
+
+ do
+ {
+ if (!cond)
+ DBUG_RETURN(1);
+ switch (cond->ndb_item->type) {
+ case NDB_FUNCTION:
+ {
+ switch (cond->ndb_item->qualification.function_type) {
+ case NDB_COND_AND_FUNC:
+ {
+ level++;
+ DBUG_PRINT("info", ("Generating %s group %u", (negated)?"NAND":"AND",
+ level));
+ if ((negated) ? filter->begin(NdbScanFilter::NAND)
+ : filter->begin(NdbScanFilter::AND) == -1)
+ DBUG_RETURN(1);
+ negated= FALSE;
+ cond= cond->next;
+ break;
+ }
+ case NDB_COND_OR_FUNC:
+ {
+ level++;
+ DBUG_PRINT("info", ("Generating %s group %u", (negated)?"NOR":"OR",
+ level));
+ if ((negated) ? filter->begin(NdbScanFilter::NOR)
+ : filter->begin(NdbScanFilter::OR) == -1)
+ DBUG_RETURN(1);
+ negated= FALSE;
+ cond= cond->next;
+ break;
+ }
+ case NDB_NOT_FUNC:
+ {
+ DBUG_PRINT("info", ("Generating negated query"));
+ cond= cond->next;
+ negated= TRUE;
+ break;
+ }
+ default:
+ if (build_scan_filter_predicate(cond, filter, negated))
+ DBUG_RETURN(1);
+ negated= FALSE;
+ break;
+ }
+ break;
+ }
+ case NDB_END_COND:
+ DBUG_PRINT("info", ("End of group %u", level));
+ level--;
+ if (cond) cond= cond->next;
+ if (filter->end() == -1)
+ DBUG_RETURN(1);
+ if (!negated)
+ break;
+ // else fall through (NOT END is an illegal condition)
+ default:
+ {
+ DBUG_PRINT("info", ("Illegal scan filter"));
+ }
+ }
+ } while (level > 0 || negated);
+
+ DBUG_RETURN(0);
+}
+
+
+int
+ha_ndbcluster_cond::build_scan_filter(Ndb_cond * &cond, NdbScanFilter *filter)
+{
+ bool simple_cond= TRUE;
+ DBUG_ENTER("build_scan_filter");
+
+ switch (cond->ndb_item->type) {
+ case NDB_FUNCTION:
+ switch (cond->ndb_item->qualification.function_type) {
+ case NDB_COND_AND_FUNC:
+ case NDB_COND_OR_FUNC:
+ simple_cond= FALSE;
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+ if (simple_cond && filter->begin() == -1)
+ DBUG_RETURN(1);
+ if (build_scan_filter_group(cond, filter))
+ DBUG_RETURN(1);
+ if (simple_cond && filter->end() == -1)
+ DBUG_RETURN(1);
+
+ DBUG_RETURN(0);
+}
+
+int
+ha_ndbcluster_cond::generate_scan_filter(NdbScanOperation *op)
+{
+ DBUG_ENTER("generate_scan_filter");
+
+ if (m_cond_stack)
+ {
+ NdbScanFilter filter(op);
+
+ DBUG_RETURN(generate_scan_filter_from_cond(filter));
+ }
+ else
+ {
+ DBUG_PRINT("info", ("Empty stack"));
+ }
+
+ DBUG_RETURN(0);
+}
+
+
+int
+ha_ndbcluster_cond::generate_scan_filter_from_cond(NdbScanFilter& filter)
+{
+ bool multiple_cond= FALSE;
+ DBUG_ENTER("generate_scan_filter_from_cond");
+
+ // Wrap an AND group around multiple conditions
+ if (m_cond_stack->next)
+ {
+ multiple_cond= TRUE;
+ if (filter.begin() == -1)
+ DBUG_RETURN(1);
+ }
+ for (Ndb_cond_stack *stack= m_cond_stack;
+ (stack);
+ stack= stack->next)
+ {
+ Ndb_cond *cond= stack->ndb_cond;
+
+ if (build_scan_filter(cond, &filter))
+ {
+ DBUG_PRINT("info", ("build_scan_filter failed"));
+ DBUG_RETURN(1);
+ }
+ }
+ if (multiple_cond && filter.end() == -1)
+ DBUG_RETURN(1);
+
+ DBUG_RETURN(0);
+}
+
+
+int ha_ndbcluster_cond::generate_scan_filter_from_key(NdbScanOperation *op,
+ const KEY* key_info,
+ const byte *key,
+ uint key_len,
+ byte *buf)
+{
+ KEY_PART_INFO* key_part= key_info->key_part;
+ KEY_PART_INFO* end= key_part+key_info->key_parts;
+ NdbScanFilter filter(op);
+ int res;
+ DBUG_ENTER("generate_scan_filter_from_key");
+
+ filter.begin(NdbScanFilter::AND);
+ for (; key_part != end; key_part++)
+ {
+ Field* field= key_part->field;
+ uint32 pack_len= field->pack_length();
+ const byte* ptr= key;
+ DBUG_PRINT("info", ("Filtering value for %s", field->field_name));
+ DBUG_DUMP("key", (char*)ptr, pack_len);
+ if (key_part->null_bit)
+ {
+ DBUG_PRINT("info", ("Generating ISNULL filter"));
+ if (filter.isnull(key_part->fieldnr-1) == -1)
+ DBUG_RETURN(1);
+ }
+ else
+ {
+ DBUG_PRINT("info", ("Generating EQ filter"));
+ if (filter.cmp(NdbScanFilter::COND_EQ,
+ key_part->fieldnr-1,
+ ptr,
+ pack_len) == -1)
+ DBUG_RETURN(1);
+ }
+ key += key_part->store_length;
+ }
+ // Add any pushed condition
+ if (m_cond_stack &&
+ (res= generate_scan_filter_from_cond(filter)))
+ DBUG_RETURN(res);
+
+ if (filter.end() == -1)
+ DBUG_RETURN(1);
+
+ DBUG_RETURN(0);
+}
+
+#endif /* HAVE_NDBCLUSTER_DB */
diff --git a/sql/ha_ndbcluster_cond.h b/sql/ha_ndbcluster_cond.h
new file mode 100644
index 00000000000..d4e68de6635
--- /dev/null
+++ b/sql/ha_ndbcluster_cond.h
@@ -0,0 +1,470 @@
+/* Copyright (C) 2000-2007 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
+ This file defines the data structures used by engine condition pushdown in
+ the NDB Cluster handler
+*/
+
+#ifdef USE_PRAGMA_INTERFACE
+#pragma interface /* gcc class implementation */
+#endif
+
+typedef enum ndb_item_type {
+ NDB_VALUE = 0, // Qualified more with Item::Type
+ NDB_FIELD = 1, // Qualified from table definition
+ NDB_FUNCTION = 2,// Qualified from Item_func::Functype
+ NDB_END_COND = 3 // End marker for condition group
+} NDB_ITEM_TYPE;
+
+typedef enum ndb_func_type {
+ NDB_EQ_FUNC = 0,
+ NDB_NE_FUNC = 1,
+ NDB_LT_FUNC = 2,
+ NDB_LE_FUNC = 3,
+ NDB_GT_FUNC = 4,
+ NDB_GE_FUNC = 5,
+ NDB_ISNULL_FUNC = 6,
+ NDB_ISNOTNULL_FUNC = 7,
+ NDB_LIKE_FUNC = 8,
+ NDB_NOTLIKE_FUNC = 9,
+ NDB_NOT_FUNC = 10,
+ NDB_UNKNOWN_FUNC = 11,
+ NDB_COND_AND_FUNC = 12,
+ NDB_COND_OR_FUNC = 13,
+ NDB_UNSUPPORTED_FUNC = 14
+} NDB_FUNC_TYPE;
+
+typedef union ndb_item_qualification {
+ Item::Type value_type;
+ enum_field_types field_type; // Instead of Item::FIELD_ITEM
+ NDB_FUNC_TYPE function_type; // Instead of Item::FUNC_ITEM
+} NDB_ITEM_QUALIFICATION;
+
+typedef struct ndb_item_field_value {
+ Field* field;
+ int column_no;
+} NDB_ITEM_FIELD_VALUE;
+
+typedef union ndb_item_value {
+ const Item *item;
+ NDB_ITEM_FIELD_VALUE *field_value;
+ uint arg_count;
+} NDB_ITEM_VALUE;
+
+struct negated_function_mapping
+{
+ NDB_FUNC_TYPE pos_fun;
+ NDB_FUNC_TYPE neg_fun;
+};
+
+/*
+ Define what functions can be negated in condition pushdown.
+ Note, these HAVE to be in the same order as in definition enum
+*/
+static const negated_function_mapping neg_map[]=
+{
+ {NDB_EQ_FUNC, NDB_NE_FUNC},
+ {NDB_NE_FUNC, NDB_EQ_FUNC},
+ {NDB_LT_FUNC, NDB_GE_FUNC},
+ {NDB_LE_FUNC, NDB_GT_FUNC},
+ {NDB_GT_FUNC, NDB_LE_FUNC},
+ {NDB_GE_FUNC, NDB_LT_FUNC},
+ {NDB_ISNULL_FUNC, NDB_ISNOTNULL_FUNC},
+ {NDB_ISNOTNULL_FUNC, NDB_ISNULL_FUNC},
+ {NDB_LIKE_FUNC, NDB_NOTLIKE_FUNC},
+ {NDB_NOTLIKE_FUNC, NDB_LIKE_FUNC},
+ {NDB_NOT_FUNC, NDB_UNSUPPORTED_FUNC},
+ {NDB_UNKNOWN_FUNC, NDB_UNSUPPORTED_FUNC},
+ {NDB_COND_AND_FUNC, NDB_UNSUPPORTED_FUNC},
+ {NDB_COND_OR_FUNC, NDB_UNSUPPORTED_FUNC},
+ {NDB_UNSUPPORTED_FUNC, NDB_UNSUPPORTED_FUNC}
+};
+
+/*
+ This class is the construction element for serialization of Item tree
+ in condition pushdown.
+ An instance of Ndb_Item represents a constant, table field reference,
+ unary or binary comparison predicate, and start/end of AND/OR.
+ Instances of Ndb_Item are stored in a linked list implemented by Ndb_cond
+ class.
+ The order of elements produced by Ndb_cond::next corresponds to
+ breadth-first traversal of the Item (i.e. expression) tree in prefix order.
+ AND and OR have arbitrary arity, so the end of AND/OR group is marked with
+ Ndb_item with type == NDB_END_COND.
+ NOT items represent negated conditions and generate NAND/NOR groups.
+*/
+class Ndb_item : public Sql_alloc
+{
+public:
+ Ndb_item(NDB_ITEM_TYPE item_type) : type(item_type) {};
+ Ndb_item(NDB_ITEM_TYPE item_type,
+ NDB_ITEM_QUALIFICATION item_qualification,
+ const Item *item_value)
+ : type(item_type), qualification(item_qualification)
+ {
+ switch(item_type) {
+ case(NDB_VALUE):
+ value.item= item_value;
+ break;
+ case(NDB_FIELD): {
+ NDB_ITEM_FIELD_VALUE *field_value= new NDB_ITEM_FIELD_VALUE();
+ Item_field *field_item= (Item_field *) item_value;
+ field_value->field= field_item->field;
+ field_value->column_no= -1; // Will be fetched at scan filter generation
+ value.field_value= field_value;
+ break;
+ }
+ case(NDB_FUNCTION):
+ value.item= item_value;
+ value.arg_count= ((Item_func *) item_value)->argument_count();
+ break;
+ case(NDB_END_COND):
+ break;
+ }
+ };
+ Ndb_item(Field *field, int column_no) : type(NDB_FIELD)
+ {
+ NDB_ITEM_FIELD_VALUE *field_value= new NDB_ITEM_FIELD_VALUE();
+ qualification.field_type= field->type();
+ field_value->field= field;
+ field_value->column_no= column_no;
+ value.field_value= field_value;
+ };
+ Ndb_item(Item_func::Functype func_type, const Item *item_value)
+ : type(NDB_FUNCTION)
+ {
+ qualification.function_type= item_func_to_ndb_func(func_type);
+ value.item= item_value;
+ value.arg_count= ((Item_func *) item_value)->argument_count();
+ };
+ Ndb_item(Item_func::Functype func_type, uint no_args)
+ : type(NDB_FUNCTION)
+ {
+ qualification.function_type= item_func_to_ndb_func(func_type);
+ value.arg_count= no_args;
+ };
+ ~Ndb_item()
+ {
+ if (type == NDB_FIELD)
+ {
+ delete value.field_value;
+ value.field_value= NULL;
+ }
+ };
+
+ uint32 pack_length()
+ {
+ switch(type) {
+ case(NDB_VALUE):
+ if(qualification.value_type == Item::STRING_ITEM)
+ return value.item->str_value.length();
+ break;
+ case(NDB_FIELD):
+ return value.field_value->field->pack_length();
+ default:
+ break;
+ }
+
+ return 0;
+ };
+
+ Field * get_field() { return value.field_value->field; };
+
+ int get_field_no() { return value.field_value->column_no; };
+
+ int argument_count()
+ {
+ return value.arg_count;
+ };
+
+ const char* get_val()
+ {
+ switch(type) {
+ case(NDB_VALUE):
+ if(qualification.value_type == Item::STRING_ITEM)
+ return value.item->str_value.ptr();
+ break;
+ case(NDB_FIELD):
+ return value.field_value->field->ptr;
+ default:
+ break;
+ }
+
+ return NULL;
+ };
+
+ void save_in_field(Ndb_item *field_item)
+ {
+ Field *field = field_item->value.field_value->field;
+ const Item *item= value.item;
+
+ if (item && field)
+ ((Item *)item)->save_in_field(field, false);
+ };
+
+ static NDB_FUNC_TYPE item_func_to_ndb_func(Item_func::Functype fun)
+ {
+ switch (fun) {
+ case (Item_func::EQ_FUNC): { return NDB_EQ_FUNC; }
+ case (Item_func::NE_FUNC): { return NDB_NE_FUNC; }
+ case (Item_func::LT_FUNC): { return NDB_LT_FUNC; }
+ case (Item_func::LE_FUNC): { return NDB_LE_FUNC; }
+ case (Item_func::GT_FUNC): { return NDB_GT_FUNC; }
+ case (Item_func::GE_FUNC): { return NDB_GE_FUNC; }
+ case (Item_func::ISNULL_FUNC): { return NDB_ISNULL_FUNC; }
+ case (Item_func::ISNOTNULL_FUNC): { return NDB_ISNOTNULL_FUNC; }
+ case (Item_func::LIKE_FUNC): { return NDB_LIKE_FUNC; }
+ case (Item_func::NOT_FUNC): { return NDB_NOT_FUNC; }
+ case (Item_func::UNKNOWN_FUNC): { return NDB_UNKNOWN_FUNC; }
+ case (Item_func::COND_AND_FUNC): { return NDB_COND_AND_FUNC; }
+ case (Item_func::COND_OR_FUNC): { return NDB_COND_OR_FUNC; }
+ default: { return NDB_UNSUPPORTED_FUNC; }
+ }
+ };
+
+ static NDB_FUNC_TYPE negate(NDB_FUNC_TYPE fun)
+ {
+ uint i= (uint) fun;
+ DBUG_ASSERT(fun == neg_map[i].pos_fun);
+ return neg_map[i].neg_fun;
+ };
+
+ NDB_ITEM_TYPE type;
+ NDB_ITEM_QUALIFICATION qualification;
+ private:
+ NDB_ITEM_VALUE value;
+};
+
+/*
+ This class implements a linked list used for storing a
+ serialization of the Item tree for condition pushdown.
+ */
+class Ndb_cond : public Sql_alloc
+{
+ public:
+ Ndb_cond() : ndb_item(NULL), next(NULL), prev(NULL) {};
+ ~Ndb_cond()
+ {
+ if (ndb_item) delete ndb_item;
+ ndb_item= NULL;
+ if (next) delete next;
+ next= prev= NULL;
+ };
+ Ndb_item *ndb_item;
+ Ndb_cond *next;
+ Ndb_cond *prev;
+};
+
+/*
+ This class implements a stack for storing several conditions
+ for pushdown (represented as serialized Item trees using Ndb_cond).
+ The current implementation only pushes one condition, but is
+ prepared for handling several (C1 AND C2 ...) if the logic for
+ pushing conditions is extended in sql_select.
+*/
+class Ndb_cond_stack : public Sql_alloc
+{
+ public:
+ Ndb_cond_stack() : ndb_cond(NULL), next(NULL) {};
+ ~Ndb_cond_stack()
+ {
+ if (ndb_cond) delete ndb_cond;
+ ndb_cond= NULL;
+ if (next) delete next;
+ next= NULL;
+ };
+ Ndb_cond *ndb_cond;
+ Ndb_cond_stack *next;
+};
+
+class Ndb_rewrite_context : public Sql_alloc
+{
+public:
+ Ndb_rewrite_context(Item_func *func)
+ : func_item(func), left_hand_item(NULL), count(0) {};
+ ~Ndb_rewrite_context()
+ {
+ if (next) delete next;
+ }
+ const Item_func *func_item;
+ const Item *left_hand_item;
+ uint count;
+ Ndb_rewrite_context *next;
+};
+
+/*
+ This class is used for storing the context when traversing
+ the Item tree. It stores a reference to the table the condition
+ is defined on, the serialized representation being generated,
+ if the condition found is supported, and information what is
+ expected next in the tree inorder for the condition to be supported.
+*/
+class Ndb_cond_traverse_context : public Sql_alloc
+{
+ public:
+ Ndb_cond_traverse_context(TABLE *tab, const NdbDictionary::Table *ndb_tab,
+ Ndb_cond_stack* stack)
+ : table(tab), ndb_table(ndb_tab),
+ supported(TRUE), stack_ptr(stack), cond_ptr(NULL),
+ skip(0), collation(NULL), rewrite_stack(NULL)
+ {
+ // Allocate type checking bitmaps
+ bitmap_init(&expect_mask, 0, 512, FALSE);
+ bitmap_init(&expect_field_type_mask, 0, 512, FALSE);
+ bitmap_init(&expect_field_result_mask, 0, 512, FALSE);
+
+ if (stack)
+ cond_ptr= stack->ndb_cond;
+ };
+ ~Ndb_cond_traverse_context()
+ {
+ bitmap_free(&expect_mask);
+ bitmap_free(&expect_field_type_mask);
+ bitmap_free(&expect_field_result_mask);
+ if (rewrite_stack) delete rewrite_stack;
+ }
+ void expect(Item::Type type)
+ {
+ bitmap_set_bit(&expect_mask, (uint) type);
+ if (type == Item::FIELD_ITEM) expect_all_field_types();
+ };
+ void dont_expect(Item::Type type)
+ {
+ bitmap_clear_bit(&expect_mask, (uint) type);
+ };
+ bool expecting(Item::Type type)
+ {
+ return bitmap_is_set(&expect_mask, (uint) type);
+ };
+ void expect_nothing()
+ {
+ bitmap_clear_all(&expect_mask);
+ };
+ bool expecting_nothing()
+ {
+ return bitmap_is_clear_all(&expect_mask);
+ }
+ void expect_only(Item::Type type)
+ {
+ expect_nothing();
+ expect(type);
+ };
+
+ void expect_field_type(enum_field_types type)
+ {
+ bitmap_set_bit(&expect_field_type_mask, (uint) type);
+ };
+ void expect_all_field_types()
+ {
+ bitmap_set_all(&expect_field_type_mask);
+ };
+ bool expecting_field_type(enum_field_types type)
+ {
+ return bitmap_is_set(&expect_field_type_mask, (uint) type);
+ };
+ void expect_no_field_type()
+ {
+ bitmap_clear_all(&expect_field_type_mask);
+ };
+ bool expecting_no_field_type()
+ {
+ return bitmap_is_clear_all(&expect_field_type_mask);
+ }
+ void expect_only_field_type(enum_field_types result)
+ {
+ expect_no_field_type();
+ expect_field_type(result);
+ };
+
+ void expect_field_result(Item_result result)
+ {
+ bitmap_set_bit(&expect_field_result_mask, (uint) result);
+ };
+ bool expecting_field_result(Item_result result)
+ {
+ return bitmap_is_set(&expect_field_result_mask, (uint) result);
+ };
+ void expect_no_field_result()
+ {
+ bitmap_clear_all(&expect_field_result_mask);
+ };
+ bool expecting_no_field_result()
+ {
+ return bitmap_is_clear_all(&expect_field_result_mask);
+ }
+ void expect_only_field_result(Item_result result)
+ {
+ expect_no_field_result();
+ expect_field_result(result);
+ };
+ void expect_collation(CHARSET_INFO* col)
+ {
+ collation= col;
+ };
+ bool expecting_collation(CHARSET_INFO* col)
+ {
+ bool matching= (!collation) ? true : (collation == col);
+ collation= NULL;
+
+ return matching;
+ };
+
+ TABLE* table;
+ const NdbDictionary::Table *ndb_table;
+ bool supported;
+ Ndb_cond_stack* stack_ptr;
+ Ndb_cond* cond_ptr;
+ MY_BITMAP expect_mask;
+ MY_BITMAP expect_field_type_mask;
+ MY_BITMAP expect_field_result_mask;
+ uint skip;
+ CHARSET_INFO* collation;
+ Ndb_rewrite_context *rewrite_stack;
+};
+
+class ha_ndbcluster;
+
+class ha_ndbcluster_cond
+{
+public:
+ ha_ndbcluster_cond()
+ : m_cond_stack(NULL)
+ {}
+ ~ha_ndbcluster_cond()
+ { if (m_cond_stack) delete m_cond_stack; }
+ const COND *cond_push(const COND *cond,
+ TABLE *table, const NdbDictionary::Table *ndb_table);
+ void cond_pop();
+ void cond_clear();
+ int generate_scan_filter(NdbScanOperation* op);
+ int generate_scan_filter_from_cond(NdbScanFilter& filter);
+ int generate_scan_filter_from_key(NdbScanOperation* op,
+ const KEY* key_info,
+ const byte *key,
+ uint key_len,
+ byte *buf);
+private:
+ bool serialize_cond(const COND *cond, Ndb_cond_stack *ndb_cond,
+ TABLE *table, const NdbDictionary::Table *ndb_table);
+ int build_scan_filter_predicate(Ndb_cond* &cond,
+ NdbScanFilter* filter,
+ bool negated= false);
+ int build_scan_filter_group(Ndb_cond* &cond,
+ NdbScanFilter* filter);
+ int build_scan_filter(Ndb_cond* &cond, NdbScanFilter* filter);
+
+ Ndb_cond_stack *m_cond_stack;
+};
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/item.cc b/sql/item.cc
index ed5bd67d096..92ea35072f9 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))
{
@@ -2385,7 +2404,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 +2418,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 +2433,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);
}
@@ -2615,7 +2635,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 +2650,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 +3076,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 +3522,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;
/*
@@ -3521,9 +3542,13 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
select->inner_refs_list.push_back(rf);
rf->in_sum_func= thd->lex->in_sum_func;
}
+ /*
+ A reference is resolved to a nest level that's outer or the same as
+ the nest level of the enclosing set function : adjust the value of
+ max_arg_level for the function if it's needed.
+ */
if (thd->lex->in_sum_func &&
- thd->lex->in_sum_func->nest_level ==
- thd->lex->current_select->nest_level)
+ thd->lex->in_sum_func->nest_level >= select->nest_level)
{
Item::Type ref_type= (*reference)->type();
set_if_bigger(thd->lex->in_sum_func->max_arg_level,
@@ -4158,6 +4183,21 @@ enum_field_types Item::field_type() const
}
+bool Item::is_datetime()
+{
+ switch (field_type())
+ {
+ case MYSQL_TYPE_DATE:
+ case MYSQL_TYPE_DATETIME:
+ case MYSQL_TYPE_TIMESTAMP:
+ return TRUE;
+ default:
+ break;
+ }
+ return FALSE;
+}
+
+
/*
Create a field to hold a string value from an item
@@ -4602,7 +4642,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)
@@ -4713,7 +4752,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)
@@ -4833,7 +4871,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)
{
@@ -4846,7 +4884,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);
@@ -5174,6 +5212,16 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
thd->change_item_tree(reference, fld);
mark_as_dependent(thd, last_checked_context->select_lex,
thd->lex->current_select, this, fld);
+ /*
+ A reference is resolved to a nest level that's outer or the same as
+ the nest level of the enclosing set function : adjust the value of
+ max_arg_level for the function if it's needed.
+ */
+ if (thd->lex->in_sum_func &&
+ thd->lex->in_sum_func->nest_level >=
+ last_checked_context->select_lex->nest_level)
+ set_if_bigger(thd->lex->in_sum_func->max_arg_level,
+ last_checked_context->select_lex->nest_level);
return FALSE;
}
if (ref == 0)
@@ -5187,6 +5235,16 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
DBUG_ASSERT(*ref && (*ref)->fixed);
mark_as_dependent(thd, last_checked_context->select_lex,
context->select_lex, this, this);
+ /*
+ A reference is resolved to a nest level that's outer or the same as
+ the nest level of the enclosing set function : adjust the value of
+ max_arg_level for the function if it's needed.
+ */
+ if (thd->lex->in_sum_func &&
+ thd->lex->in_sum_func->nest_level >=
+ last_checked_context->select_lex->nest_level)
+ set_if_bigger(thd->lex->in_sum_func->max_arg_level,
+ last_checked_context->select_lex->nest_level);
}
}
@@ -5398,7 +5456,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));
}
@@ -5497,7 +5555,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));
}
@@ -6118,6 +6176,14 @@ void Item_cache_int::store(Item *item)
}
+void Item_cache_int::store(Item *item, longlong val_arg)
+{
+ value= val_arg;
+ null_value= item->null_value;
+ unsigned_flag= item->unsigned_flag;
+}
+
+
String *Item_cache_int::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
diff --git a/sql/item.h b/sql/item.h
index 094c45642da..11dce3a7758 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
@@ -847,6 +847,7 @@ public:
representation is more precise than the string one).
*/
virtual bool result_as_longlong() { return FALSE; }
+ bool is_datetime();
};
@@ -945,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
@@ -977,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);
@@ -1271,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);
@@ -1400,7 +1402,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. */
@@ -1432,8 +1434,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();
@@ -1442,7 +1444,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();
/*
@@ -1875,7 +1877,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);
@@ -1952,7 +1954,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; }
};
@@ -2057,7 +2059,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
@@ -2424,11 +2426,13 @@ public:
Item_cache_int(): Item_cache(), value(0) {}
void store(Item *item);
+ void store(Item *item, longlong val_arg);
double val_real() { DBUG_ASSERT(fixed == 1); return (double) value; }
longlong val_int() { DBUG_ASSERT(fixed == 1); return value; }
String* val_str(String *str);
my_decimal *val_decimal(my_decimal *);
enum Item_result result_type() const { return INT_RESULT; }
+ bool result_as_longlong() { return TRUE; }
};
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 1c0ece8877b..0de9ef3e9ad 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -316,7 +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;
- thd->variables.sql_mode|= MODE_INVALID_DATES;
+ 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,
@@ -327,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;
}
@@ -380,7 +384,9 @@ void Item_bool_func2::fix_length_and_dec()
if (arg_real_item->type() == FIELD_ITEM)
{
Field *field=((Item_field*) arg_real_item)->field;
- if (field->can_be_compared_as_longlong())
+ if (field->can_be_compared_as_longlong() &&
+ !(arg_real_item->is_datetime() &&
+ args[1]->result_type() == STRING_RESULT))
{
if (convert_constant_item(thd, field,&args[1]))
{
@@ -395,7 +401,9 @@ void Item_bool_func2::fix_length_and_dec()
if (arg_real_item->type() == FIELD_ITEM)
{
Field *field=((Item_field*) arg_real_item)->field;
- if (field->can_be_compared_as_longlong())
+ if (field->can_be_compared_as_longlong() &&
+ !(arg_real_item->is_datetime() &&
+ args[0]->result_type() == STRING_RESULT))
{
if (convert_constant_item(thd, field,&args[0]))
{
@@ -514,6 +522,345 @@ int Arg_comparator::set_compare_func(Item_bool_func2 *item, Item_result type)
}
+/*
+ Convert date provided in a string to the int representation.
+
+ SYNOPSIS
+ get_date_from_str()
+ thd Thread handle
+ str a string to convert
+ warn_type type of the timestamp for issuing the warning
+ warn_name field name for issuing the warning
+ error_arg [out] TRUE if string isn't a DATETIME or clipping occur
+
+ DESCRIPTION
+ Convert date provided in the string str to the int representation.
+ if the string contains wrong date or doesn't contain it at all
+ then the warning is issued and TRUE returned in the error_arg argument.
+ The warn_type and the warn_name arguments are used as the name and the
+ type of the field when issuing the warning.
+
+ RETURN
+ converted value.
+*/
+
+static ulonglong
+get_date_from_str(THD *thd, String *str, timestamp_type warn_type,
+ char *warn_name, bool *error_arg)
+{
+ ulonglong value= 0;
+ int error;
+ MYSQL_TIME l_time;
+ enum_mysql_timestamp_type ret;
+ *error_arg= TRUE;
+
+ ret= str_to_datetime(str->ptr(), str->length(), &l_time,
+ (TIME_FUZZY_DATE | MODE_INVALID_DATES |
+ (thd->variables.sql_mode &
+ (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE))),
+ &error);
+ if ((ret == MYSQL_TIMESTAMP_DATETIME || ret == MYSQL_TIMESTAMP_DATE))
+ {
+ value= TIME_to_ulonglong_datetime(&l_time);
+ *error_arg= FALSE;
+ }
+
+ if (error || *error_arg)
+ {
+ make_truncated_value_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ str->ptr(), str->length(),
+ warn_type, warn_name);
+ *error_arg= TRUE;
+ }
+ return value;
+}
+
+
+/*
+ Check whether compare_datetime() can be used to compare items.
+
+ SYNOPSIS
+ Arg_comparator::can_compare_as_dates()
+ a, b [in] items to be compared
+ const_value [out] converted value of the string constant, if any
+
+ DESCRIPTION
+ Check several cases when the DATE/DATETIME comparator should be used.
+ The following cases are checked:
+ 1. Both a and b is a DATE/DATETIME field/function returning string or
+ int result.
+ 2. Only a or b is a DATE/DATETIME field/function returning string or
+ int result and the other item (b or a) is an item with string result.
+ If the second item is a constant one then it's checked to be
+ convertible to the DATE/DATETIME type. If the constant can't be
+ converted to a DATE/DATETIME then the compare_datetime() comparator
+ isn't used and the warning about wrong DATE/DATETIME value is issued.
+ In all other cases (date-[int|real|decimal]/[int|real|decimal]-date)
+ the comparison is handled by other comparators.
+ If the datetime comparator can be used and one the operands of the
+ comparison is a string constant that was successfully converted to a
+ DATE/DATETIME type then the result of the conversion is returned in the
+ const_value if it is provided. If there is no constant or
+ compare_datetime() isn't applicable then the *const_value remains
+ unchanged.
+
+ RETURN
+ the found type of date comparison
+*/
+
+enum Arg_comparator::enum_date_cmp_type
+Arg_comparator::can_compare_as_dates(Item *a, Item *b, ulonglong *const_value)
+{
+ enum enum_date_cmp_type cmp_type= CMP_DATE_DFLT;
+ Item *str_arg= 0, *date_arg= 0;
+
+ if (a->type() == Item::ROW_ITEM || b->type() == Item::ROW_ITEM)
+ return CMP_DATE_DFLT;
+
+ if (a->is_datetime())
+ {
+ if (b->is_datetime())
+ cmp_type= CMP_DATE_WITH_DATE;
+ else if (b->result_type() == STRING_RESULT)
+ {
+ cmp_type= CMP_DATE_WITH_STR;
+ date_arg= a;
+ str_arg= b;
+ }
+ }
+ else if (b->is_datetime() && a->result_type() == STRING_RESULT)
+ {
+ cmp_type= CMP_STR_WITH_DATE;
+ date_arg= b;
+ str_arg= a;
+ }
+
+ if (cmp_type != CMP_DATE_DFLT)
+ {
+ /*
+ 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;
+ bool error;
+ String tmp, *str_val= 0;
+ timestamp_type t_type= (date_arg->field_type() == MYSQL_TYPE_DATE ?
+ MYSQL_TIMESTAMP_DATE : MYSQL_TIMESTAMP_DATETIME);
+
+ str_val= str_arg->val_str(&tmp);
+ if (str_arg->null_value)
+ return CMP_DATE_DFLT;
+ value= get_date_from_str(thd, str_val, t_type, date_arg->name, &error);
+ if (error)
+ return CMP_DATE_DFLT;
+ if (const_value)
+ *const_value= value;
+ }
+ }
+ return cmp_type;
+}
+
+
+int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg,
+ Item **a1, Item **a2,
+ Item_result type)
+{
+ enum enum_date_cmp_type cmp_type;
+ ulonglong const_value= (ulonglong)-1;
+ a= a1;
+ b= a2;
+
+ if ((cmp_type= can_compare_as_dates(*a, *b, &const_value)))
+ {
+ thd= current_thd;
+ owner= owner_arg;
+ a_type= (*a)->field_type();
+ b_type= (*b)->field_type();
+ a_cache= 0;
+ b_cache= 0;
+
+ if (const_value != (ulonglong)-1)
+ {
+ Item_cache_int *cache= new Item_cache_int();
+ /* Mark the cache as non-const to prevent re-caching. */
+ cache->set_used_tables(1);
+ if (!(*a)->is_datetime())
+ {
+ cache->store((*a), const_value);
+ a_cache= cache;
+ a= (Item **)&a_cache;
+ }
+ else
+ {
+ cache->store((*b), const_value);
+ b_cache= cache;
+ b= (Item **)&b_cache;
+ }
+ }
+ is_nulls_eq= test(owner && owner->functype() == Item_func::EQUAL_FUNC);
+ func= &Arg_comparator::compare_datetime;
+ return 0;
+ }
+ return set_compare_func(owner_arg, type);
+}
+
+
+void Arg_comparator::set_datetime_cmp_func(Item **a1, Item **b1)
+{
+ thd= current_thd;
+ /* A caller will handle null values by itself. */
+ owner= NULL;
+ a= a1;
+ b= b1;
+ a_type= (*a)->field_type();
+ b_type= (*b)->field_type();
+ a_cache= 0;
+ b_cache= 0;
+ is_nulls_eq= FALSE;
+ func= &Arg_comparator::compare_datetime;
+}
+
+/*
+ Retrieves correct DATETIME value from given item.
+
+ SYNOPSIS
+ get_datetime_value()
+ thd thread handle
+ item_arg [in/out] item to retrieve DATETIME value from
+ cache_arg [in/out] pointer to place to store the caching item to
+ warn_item [in] item for issuing the conversion warning
+ is_null [out] TRUE <=> the item_arg is null
+
+ DESCRIPTION
+ Retrieves the correct DATETIME value from given item for comparison by the
+ compare_datetime() function.
+ If item's result can be compared as longlong then its int value is used
+ and its string value is used otherwise. Strings are always parsed and
+ converted to int values by the get_date_from_str() function.
+ This allows us to compare correctly string dates with missed insignificant
+ zeros. If an item is a constant one then its value is cached and it isn't
+ get parsed again. An Item_cache_int object is used for caching values. It
+ seamlessly substitutes the original item. The cache item is marked as
+ non-constant to prevent re-caching it again. In order to compare
+ correctly DATE and DATETIME items the result of the former are treated as
+ a DATETIME with zero time (00:00:00).
+
+ RETURN
+ obtained value
+*/
+
+ulonglong
+get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
+ Item *warn_item, bool *is_null)
+{
+ ulonglong value= 0;
+ String buf, *str= 0;
+ Item *item= **item_arg;
+
+ if (item->result_as_longlong())
+ {
+ value= item->val_int();
+ *is_null= item->null_value;
+ if (item->field_type() == MYSQL_TYPE_DATE)
+ value*= 1000000L;
+ }
+ else
+ {
+ str= item->val_str(&buf);
+ *is_null= item->null_value;
+ }
+ if (*is_null)
+ return -1;
+ /*
+ Convert strings to the integer DATE/DATETIME representation.
+ Even if both dates provided in strings we can't compare them directly as
+ strings as there is no warranty that they are correct and do not miss
+ some insignificant zeros.
+ */
+ if (str)
+ {
+ bool error;
+ enum_field_types f_type= warn_item->field_type();
+ timestamp_type t_type= f_type ==
+ MYSQL_TYPE_DATE ? MYSQL_TIMESTAMP_DATE : MYSQL_TIMESTAMP_DATETIME;
+ value= get_date_from_str(thd, str, t_type, warn_item->name, &error);
+ }
+ /*
+ 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. */
+ cache->set_used_tables(1);
+ cache->store(item, value);
+ *cache_arg= cache;
+ *item_arg= cache_arg;
+ }
+ return value;
+}
+
+/*
+ Compare items values as dates.
+
+ SYNOPSIS
+ Arg_comparator::compare_datetime()
+
+ DESCRIPTION
+ Compare items values as DATE/DATETIME for both EQUAL_FUNC and from other
+ comparison functions. The correct DATETIME values are obtained
+ with help of the get_datetime_value() function.
+
+ RETURN
+ If is_nulls_eq is TRUE:
+ 1 if items are equal or both are null
+ 0 otherwise
+ If is_nulls_eq is FALSE:
+ -1 a < b or one of items is null
+ 0 a == b
+ 1 a > b
+*/
+
+int Arg_comparator::compare_datetime()
+{
+ bool is_null= FALSE;
+ ulonglong a_value, b_value;
+
+ /* Get DATE/DATETIME value of the 'a' item. */
+ a_value= get_datetime_value(thd, &a, &a_cache, *b, &is_null);
+ if (!is_nulls_eq && is_null)
+ {
+ if (owner)
+ owner->null_value= 1;
+ return -1;
+ }
+
+ /* Get DATE/DATETIME value of the 'b' item. */
+ b_value= get_datetime_value(thd, &b, &b_cache, *a, &is_null);
+ if (is_null)
+ {
+ if (owner)
+ owner->null_value= is_nulls_eq ? 0 : 1;
+ return is_nulls_eq ? 1 : -1;
+ }
+
+ if (owner)
+ owner->null_value= 0;
+
+ /* Compare values. */
+ if (is_nulls_eq)
+ return (a_value == b_value);
+ return a_value < b_value ? -1 : (a_value > b_value ? 1 : 0);
+}
+
+
int Arg_comparator::compare_string()
{
String *res1,*res2;
@@ -811,8 +1158,18 @@ int Arg_comparator::compare_row()
if (owner->null_value)
{
// NULL was compared
- if (owner->abort_on_null)
- return -1; // We do not need correct NULL returning
+ switch (owner->functype()) {
+ case Item_func::NE_FUNC:
+ break; // NE never aborts on NULL even if abort_on_null is set
+ case Item_func::LT_FUNC:
+ case Item_func::LE_FUNC:
+ case Item_func::GT_FUNC:
+ case Item_func::GE_FUNC:
+ return -1; // <, <=, > and >= always fail on NULL
+ default: // EQ_FUNC
+ if (owner->abort_on_null)
+ return -1; // We do not need correct NULL returning
+ }
was_null= 1;
owner->null_value= 0;
res= 0; // continue comparison (maybe we will meet explicit difference)
@@ -823,8 +1180,8 @@ int Arg_comparator::compare_row()
if (was_null)
{
/*
- There was NULL(s) in comparison in some parts, but there was not
- explicit difference in other parts, so we have to return NULL
+ There was NULL(s) in comparison in some parts, but there was no
+ explicit difference in other parts, so we have to return NULL.
*/
owner->null_value= 1;
return -1;
@@ -1350,8 +1707,11 @@ bool Item_func_between::fix_fields(THD *thd, Item **ref)
void Item_func_between::fix_length_and_dec()
{
- max_length= 1;
- THD *thd= current_thd;
+ max_length= 1;
+ THD *thd= current_thd;
+ int i;
+ bool datetime_found= FALSE;
+ compare_as_dates= TRUE;
/*
As some compare functions are generated after sql_yacc,
@@ -1366,26 +1726,29 @@ void Item_func_between::fix_length_and_dec()
return;
/*
- Make a special case of compare with date/time and longlong fields.
- They are compared as integers, so for const item this time-consuming
- conversion can be done only once, not for every single comparison
+ Detect the comparison of DATE/DATETIME items.
+ At least one of items should be a DATE/DATETIME item and other items
+ should return the STRING result.
*/
- if (args[0]->real_item()->type() == FIELD_ITEM &&
- thd->lex->sql_command != SQLCOM_CREATE_VIEW &&
- thd->lex->sql_command != SQLCOM_SHOW_CREATE)
+ for (i= 0; i < 3; i++)
{
- Field *field=((Item_field*) (args[0]->real_item()))->field;
- if (field->can_be_compared_as_longlong())
+ if (args[i]->is_datetime())
{
- /*
- The following can't be recoded with || as convert_constant_item
- changes the argument
- */
- if (convert_constant_item(thd, field,&args[1]))
- cmp_type=INT_RESULT; // Works for all types.
- if (convert_constant_item(thd, field,&args[2]))
- cmp_type=INT_RESULT; // Works for all types.
+ datetime_found= TRUE;
+ continue;
}
+ if (args[i]->result_type() == STRING_RESULT)
+ continue;
+ compare_as_dates= FALSE;
+ break;
+ }
+ if (!datetime_found)
+ compare_as_dates= FALSE;
+
+ if (compare_as_dates)
+ {
+ ge_cmp.set_datetime_cmp_func(args, args + 1);
+ le_cmp.set_datetime_cmp_func(args, args + 2);
}
}
@@ -1393,7 +1756,27 @@ void Item_func_between::fix_length_and_dec()
longlong Item_func_between::val_int()
{ // ANSI BETWEEN
DBUG_ASSERT(fixed == 1);
- if (cmp_type == STRING_RESULT)
+ if (compare_as_dates)
+ {
+ int ge_res, le_res;
+
+ ge_res= ge_cmp.compare();
+ if ((null_value= args[0]->null_value))
+ return 0;
+ le_res= le_cmp.compare();
+
+ if (!args[1]->null_value && !args[2]->null_value)
+ return (longlong) ((ge_res >= 0 && le_res <=0) != negated);
+ else if (args[1]->null_value)
+ {
+ null_value= le_res > 0; // not null if false range.
+ }
+ else
+ {
+ null_value= ge_res < 0;
+ }
+ }
+ else if (cmp_type == STRING_RESULT)
{
String *value,*a,*b;
value=args[0]->val_str(&value0);
@@ -2417,7 +2800,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
@@ -2469,6 +2851,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)
{}
@@ -2573,12 +2976,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();
@@ -2690,6 +3099,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;
@@ -2765,7 +3204,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;
@@ -2781,58 +3224,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
{
@@ -2851,7 +3384,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 0c4a62aaa24..79091b9c87d 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -35,12 +35,19 @@ class Arg_comparator: public Sql_alloc
Item_bool_func2 *owner;
Arg_comparator *comparators; // used only for compare_row()
double precision;
-
+ /* Fields used in DATE/DATETIME comparison. */
+ THD *thd;
+ enum_field_types a_type, b_type; // Types of a and b items
+ Item *a_cache, *b_cache; // Cached values of a and b items
+ bool is_nulls_eq; // TRUE <=> compare for the EQUAL_FUNC
+ enum enum_date_cmp_type { CMP_DATE_DFLT= 0, CMP_DATE_WITH_DATE,
+ CMP_DATE_WITH_STR, CMP_STR_WITH_DATE };
public:
DTCollation cmp_collation;
- Arg_comparator() {};
- Arg_comparator(Item **a1, Item **a2): a(a1), b(a2) {};
+ Arg_comparator(): thd(0), a_cache(0), b_cache(0) {};
+ Arg_comparator(Item **a1, Item **a2): a(a1), b(a2), thd(0),
+ a_cache(0), b_cache(0) {};
int set_compare_func(Item_bool_func2 *owner, Item_result type);
inline int set_compare_func(Item_bool_func2 *owner_arg)
@@ -48,14 +55,10 @@ public:
return set_compare_func(owner_arg, item_cmp_type((*a)->result_type(),
(*b)->result_type()));
}
- inline int set_cmp_func(Item_bool_func2 *owner_arg,
+ int set_cmp_func(Item_bool_func2 *owner_arg,
Item **a1, Item **a2,
- Item_result type)
- {
- a= a1;
- b= a2;
- return set_compare_func(owner_arg, type);
- }
+ Item_result type);
+
inline int set_cmp_func(Item_bool_func2 *owner_arg,
Item **a1, Item **a2)
{
@@ -83,7 +86,12 @@ public:
int compare_e_row(); // compare args[0] & args[1]
int compare_real_fixed();
int compare_e_real_fixed();
+ int compare_datetime(); // compare args[0] & args[1] as DATETIMEs
+ static enum enum_date_cmp_type can_compare_as_dates(Item *a, Item *b,
+ ulonglong *const_val_arg);
+
+ void set_datetime_cmp_func(Item **a1, Item **b1);
static arg_cmp_func comparator_matrix [5][2];
friend class Item_func;
@@ -333,7 +341,7 @@ public:
bool is_bool_func() { return 1; }
CHARSET_INFO *compare_collation() { return cmp.cmp_collation.collation; }
uint decimal_precision() const { return 1; }
- void top_level_item() { abort_on_null=1; }
+ void top_level_item() { abort_on_null= TRUE; }
friend class Arg_comparator;
};
@@ -572,8 +580,12 @@ class Item_func_between :public Item_func_opt_neg
public:
Item_result cmp_type;
String value0,value1,value2;
+ /* TRUE <=> arguments will be compared as dates. */
+ bool compare_as_dates;
+ /* Comparators used for DATE/DATETIME comparison. */
+ Arg_comparator ge_cmp, le_cmp;
Item_func_between(Item *a, Item *b, Item *c)
- :Item_func_opt_neg(a, b, c) {}
+ :Item_func_opt_neg(a, b, c), compare_as_dates(FALSE) {}
longlong val_int();
optimize_type select_optimize() const { return OPTIMIZE_KEY; }
enum Functype functype() const { return BETWEEN; }
@@ -821,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
@@ -854,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;
@@ -974,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;
@@ -1008,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)
@@ -1108,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..c4008d36aae 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -445,11 +445,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 +462,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 +481,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 c4279d1bd4e..af4e96af37b 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -616,6 +616,14 @@ Item *Item_func::get_tmp_table_item(THD *thd)
return copy_or_same(thd);
}
+double Item_int_func::val_real()
+{
+ DBUG_ASSERT(fixed == 1);
+
+ return unsigned_flag ? (double) ((ulonglong) val_int()) : (double) val_int();
+}
+
+
String *Item_int_func::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
@@ -804,7 +812,10 @@ double Item_func_numhybrid::val_real()
return result;
}
case INT_RESULT:
- return (double)int_op();
+ {
+ longlong result= int_op();
+ return unsigned_flag ? (double) ((ulonglong) result) : (double) result;
+ }
case REAL_RESULT:
return real_op();
case STRING_RESULT:
@@ -947,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;
@@ -986,7 +998,8 @@ longlong Item_func_unsigned::val_int()
my_decimal2int(E_DEC_FATAL_ERROR, dec, 1, &value);
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;
@@ -1037,18 +1050,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(')');
}
@@ -1341,6 +1397,8 @@ longlong Item_func_mod::int_op()
DBUG_ASSERT(fixed == 1);
longlong value= args[0]->val_int();
longlong val2= args[1]->val_int();
+ longlong result;
+
if ((null_value= args[0]->null_value || args[1]->null_value))
return 0; /* purecov: inspected */
if (val2 == 0)
@@ -1350,9 +1408,13 @@ longlong Item_func_mod::int_op()
}
if (args[0]->unsigned_flag)
- return ((ulonglong) value) % val2;
+ result= args[1]->unsigned_flag ?
+ ((ulonglong) value) % ((ulonglong) val2) : ((ulonglong) value) % val2;
+ else
+ result= args[1]->unsigned_flag ?
+ value % ((ulonglong) val2) : value % val2;
- return value % val2;
+ return result;
}
double Item_func_mod::real_op()
@@ -1407,6 +1469,7 @@ void Item_func_mod::fix_length_and_dec()
{
Item_num_op::fix_length_and_dec();
maybe_null= 1;
+ unsigned_flag= args[0]->unsigned_flag;
}
@@ -1485,8 +1548,9 @@ double Item_func_abs::real_op()
longlong Item_func_abs::int_op()
{
longlong value= args[0]->val_int();
- null_value= args[0]->null_value;
- return value >= 0 ? value : -value;
+ if ((null_value= args[0]->null_value))
+ return 0;
+ return (value >= 0) || unsigned_flag ? value : -value;
}
@@ -1507,6 +1571,7 @@ my_decimal *Item_func_abs::decimal_op(my_decimal *decimal_value)
void Item_func_abs::fix_length_and_dec()
{
Item_func_num1::fix_length_and_dec();
+ unsigned_flag= args[0]->unsigned_flag;
}
@@ -1881,6 +1946,10 @@ my_decimal *Item_func_floor::decimal_op(my_decimal *decimal_value)
void Item_func_round::fix_length_and_dec()
{
+ int decimals_to_set;
+ longlong val1;
+ bool val1_unsigned;
+
unsigned_flag= args[0]->unsigned_flag;
if (!args[1]->const_item())
{
@@ -1889,8 +1958,14 @@ void Item_func_round::fix_length_and_dec()
hybrid_type= REAL_RESULT;
return;
}
-
- int decimals_to_set= max((int)args[1]->val_int(), 0);
+
+ val1= args[1]->val_int();
+ val1_unsigned= args[1]->unsigned_flag;
+ if (val1 < 0)
+ decimals_to_set= val1_unsigned ? INT_MAX : 0;
+ else
+ decimals_to_set= (val1 > INT_MAX) ? INT_MAX : (int) val1;
+
if (args[0]->decimals == NOT_FIXED_DEC)
{
max_length= args[0]->max_length;
@@ -1907,10 +1982,9 @@ void Item_func_round::fix_length_and_dec()
max_length= float_length(decimals);
break;
case INT_RESULT:
- if (!decimals_to_set &&
- (truncate || (args[0]->decimal_precision() < DECIMAL_LONGLONG_DIGITS)))
+ if ((!decimals_to_set && truncate) || (args[0]->decimal_precision() < DECIMAL_LONGLONG_DIGITS))
{
- int length_can_increase= test(!truncate && (args[1]->val_int() < 0));
+ int length_can_increase= test(!truncate && (val1 < 0) && !val1_unsigned);
max_length= args[0]->max_length + length_can_increase;
/* Here we can keep INT_RESULT */
hybrid_type= INT_RESULT;
@@ -1936,10 +2010,12 @@ void Item_func_round::fix_length_and_dec()
}
}
-double my_double_round(double value, int dec, bool truncate)
+double my_double_round(double value, longlong dec, bool dec_unsigned,
+ bool truncate)
{
double tmp;
- uint abs_dec= abs(dec);
+ bool dec_negative= (dec < 0) && !dec_unsigned;
+ ulonglong abs_dec= dec_negative ? -dec : dec;
/*
tmp2 is here to avoid return the value with 80 bit precision
This will fix that the test round(0.1,1) = round(0.1,1) is true
@@ -1949,7 +2025,11 @@ double my_double_round(double value, int dec, bool truncate)
tmp=(abs_dec < array_elements(log_10) ?
log_10[abs_dec] : pow(10.0,(double) abs_dec));
- if (truncate)
+ if (dec_negative && my_isinf(tmp))
+ tmp2= 0;
+ else if (!dec_negative && my_isinf(value * tmp))
+ tmp2= value;
+ else if (truncate)
{
if (value >= 0)
tmp2= dec < 0 ? floor(value/tmp)*tmp : floor(value*tmp)/tmp;
@@ -1965,24 +2045,35 @@ double my_double_round(double value, int dec, bool truncate)
double Item_func_round::real_op()
{
double value= args[0]->val_real();
- int dec= (int) args[1]->val_int();
if (!(null_value= args[0]->null_value || args[1]->null_value))
- return my_double_round(value, dec, truncate);
+ return my_double_round(value, args[1]->val_int(), args[1]->unsigned_flag,
+ truncate);
return 0.0;
}
+/*
+ Rounds a given value to a power of 10 specified as the 'to' argument,
+ avoiding overflows when the value is close to the ulonglong range boundary.
+*/
+
+static inline ulonglong my_unsigned_round(ulonglong value, ulonglong to)
+{
+ ulonglong tmp= value / to * to;
+ return (value - tmp < (to >> 1)) ? tmp : tmp + to;
+}
+
longlong Item_func_round::int_op()
{
longlong value= args[0]->val_int();
- int dec=(int) args[1]->val_int();
+ longlong dec= args[1]->val_int();
decimals= 0;
- uint abs_dec;
+ ulonglong abs_dec;
if ((null_value= args[0]->null_value || args[1]->null_value))
return 0;
- if (dec >= 0)
+ if ((dec >= 0) || args[1]->unsigned_flag)
return value; // integer have not digits after point
abs_dec= -dec;
@@ -1994,21 +2085,12 @@ longlong Item_func_round::int_op()
tmp= log_10_int[abs_dec];
if (truncate)
- {
- if (unsigned_flag)
- value= (ulonglong(value)/tmp)*tmp;
- else
- value= (value/tmp)*tmp;
- }
+ value= (unsigned_flag) ?
+ ((ulonglong) value / tmp) * tmp : (value / tmp) * tmp;
else
- {
- if (unsigned_flag)
- value= ((ulonglong(value)+(tmp>>1))/tmp)*tmp;
- else if ( value >= 0)
- value= ((value+(tmp>>1))/tmp)*tmp;
- else
- value= ((value-(tmp>>1))/tmp)*tmp;
- }
+ value= (unsigned_flag || value >= 0) ?
+ my_unsigned_round((ulonglong) value, tmp) :
+ -(longlong) my_unsigned_round((ulonglong) -value, tmp);
return value;
}
@@ -2016,14 +2098,18 @@ longlong Item_func_round::int_op()
my_decimal *Item_func_round::decimal_op(my_decimal *decimal_value)
{
my_decimal val, *value= args[0]->val_decimal(&val);
- int dec=(int) args[1]->val_int();
- if (dec > 0)
+ longlong dec= args[1]->val_int();
+ if (dec > 0 || (dec < 0 && args[1]->unsigned_flag))
{
- decimals= min(dec, DECIMAL_MAX_SCALE); // to get correct output
+ dec= min((ulonglong) dec, DECIMAL_MAX_SCALE);
+ decimals= (uint8) dec; // to get correct output
}
+ else if (dec < INT_MIN)
+ dec= INT_MIN;
+
if (!(null_value= (args[0]->null_value || args[1]->null_value ||
- my_decimal_round(E_DEC_FATAL_ERROR, value, dec, truncate,
- decimal_value) > 1)))
+ my_decimal_round(E_DEC_FATAL_ERROR, value, (int) dec,
+ truncate, decimal_value) > 1)))
return decimal_value;
return 0;
}
@@ -2120,6 +2206,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;
@@ -2133,18 +2220,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:
{
@@ -2212,6 +2369,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)
@@ -2233,6 +2396,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)
@@ -2256,6 +2425,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)
@@ -4274,7 +4450,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 */
@@ -4734,7 +4910,7 @@ bool Item_func_match::fix_index()
for (keynr=0 ; keynr < table->s->keys ; keynr++)
{
if ((table->key_info[keynr].flags & HA_FULLTEXT) &&
- (table->keys_in_use_for_query.is_set(keynr)))
+ (table->s->keys_in_use.is_set(keynr)))
{
ft_to_key[fts]=keynr;
ft_cnt[fts]=0;
diff --git a/sql/item_func.h b/sql/item_func.h
index 635a409e0a2..1cffe9a934e 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));
}
@@ -278,7 +278,7 @@ public:
{ max_length= 21; }
Item_int_func(List<Item> &list) :Item_func(list) { max_length= 21; }
Item_int_func(THD *thd, Item_int_func *item) :Item_func(thd, item) {}
- double val_real() { DBUG_ASSERT(fixed == 1); return (double) val_int(); }
+ double val_real();
String *val_str(String*str);
enum Item_result result_type () const { return INT_RESULT; }
void fix_length_and_dec() {}
@@ -303,12 +303,6 @@ class Item_func_signed :public Item_int_func
public:
Item_func_signed(Item *a) :Item_int_func(a) {}
const char *func_name() const { return "cast_as_signed"; }
- double val_real()
- {
- double tmp= args[0]->val_real();
- null_value= args[0]->null_value;
- return tmp;
- }
longlong val_int();
longlong val_int_from_str(int *error);
void fix_length_and_dec()
@@ -337,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();
@@ -693,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
@@ -719,6 +722,35 @@ public:
};
+/*
+ Objects of this class are used for ROLLUP queries to wrap up
+ each constant item referred to in GROUP BY list.
+*/
+
+class Item_func_rollup_const :public Item_func
+{
+public:
+ Item_func_rollup_const(Item *a) :Item_func(a)
+ {
+ name= a->name;
+ name_length= a->name_length;
+ }
+ double val_real() { return args[0]->val_real(); }
+ longlong val_int() { return args[0]->val_int(); }
+ String *val_str(String *str) { return args[0]->val_str(str); }
+ my_decimal *val_decimal(my_decimal *dec) { return args[0]->val_decimal(dec); }
+ const char *func_name() const { return "rollup_const"; }
+ bool const_item() const { return 0; }
+ Item_result result_type() const { return args[0]->result_type(); }
+ void fix_length_and_dec()
+ {
+ collation= args[0]->collation;
+ max_length= args[0]->max_length;
+ decimals=args[0]->decimals;
+ }
+};
+
+
class Item_func_length :public Item_int_func
{
String value;
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 1991526345c..f9a0f715985 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1995,7 +1995,7 @@ String *Item_func_format::val_str(String *str)
double nr= args[0]->val_real();
if ((null_value=args[0]->null_value))
return 0; /* purecov: inspected */
- nr= my_double_round(nr, decimals, FALSE);
+ nr= my_double_round(nr, (longlong) decimals, FALSE, FALSE);
/* Here default_charset() is right as this is not an automatic conversion */
str->set(nr,decimals, default_charset());
if (isnan(nr))
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 778ea6e9496..d7c4a3eddef 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -790,7 +790,7 @@ class Item_func_crc32 :public Item_int_func
{
String value;
public:
- Item_func_crc32(Item *a) :Item_int_func(a) {}
+ Item_func_crc32(Item *a) :Item_int_func(a) { unsigned_flag= 1; }
const char *func_name() const { return "crc32"; }
void fix_length_and_dec() { max_length=10; }
longlong val_int();
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index b3744d6eb96..48b82e3cde6 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1774,6 +1774,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 +1829,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 +1851,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;
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 6b605e96432..118609671b8 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -276,7 +276,11 @@ public:
{
return pushed_cond_guards ? pushed_cond_guards + i : NULL;
}
- void set_cond_guard_var(int i, bool v) { pushed_cond_guards[i]= v; }
+ void set_cond_guard_var(int i, bool v)
+ {
+ if ( pushed_cond_guards)
+ pushed_cond_guards[i]= v;
+ }
bool have_guarded_conds() { return test(pushed_cond_guards); }
Item_func_not_all *upper_item; // point on NOT/NOP before ALL/SOME subquery
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 752cefa07d6..d6b31d43389 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -175,13 +175,25 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref)
MYF(0));
return TRUE;
}
- if (in_sum_func && in_sum_func->nest_level == nest_level)
+ if (in_sum_func)
{
/*
If the set function is nested adjust the value of
max_sum_func_level for the nesting set function.
+ We take into account only enclosed set functions that are to be
+ aggregated on the same level or above of the nest level of
+ the enclosing set function.
+ But we must always pass up the max_sum_func_level because it is
+ the maximum nested level of all directly and indirectly enclosed
+ set functions. We must do that even for set functions that are
+ aggregated inside of their enclosing set function's nest level
+ because the enclosing function may contain another enclosing
+ function that is to be aggregated outside or on the same level
+ as its parent's nest level.
*/
- set_if_bigger(in_sum_func->max_sum_func_level, aggr_level);
+ if (in_sum_func->nest_level >= aggr_level)
+ set_if_bigger(in_sum_func->max_sum_func_level, aggr_level);
+ set_if_bigger(in_sum_func->max_sum_func_level, max_sum_func_level);
}
update_used_tables();
thd->lex->in_sum_func= in_sum_func;
@@ -3327,6 +3339,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)
{
/*
@@ -3338,11 +3354,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 683cd8803d6..f5895369a55 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,6 +2180,27 @@ 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:
@@ -2188,7 +2216,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))
@@ -2212,7 +2240,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;
@@ -2301,7 +2329,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;
@@ -2553,7 +2581,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))
@@ -2567,7 +2595,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;
@@ -2578,7 +2606,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);
/*
@@ -2594,7 +2622,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;
@@ -2606,7 +2634,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,
@@ -2618,7 +2646,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;
@@ -2630,7 +2658,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))
{
@@ -2645,7 +2673,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;
@@ -2657,21 +2685,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)
{
@@ -2689,19 +2725,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)
{
@@ -2756,7 +2805,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;
@@ -2858,7 +2907,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) ||
@@ -2903,7 +2952,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();
@@ -2947,7 +2996,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);
}
@@ -2971,7 +3021,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;
@@ -2980,7 +3030,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;
@@ -3298,7 +3348,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];
@@ -3339,7 +3389,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;
@@ -3352,7 +3402,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/key.cc b/sql/key.cc
index 921f3daa201..2bdde46b6b3 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -119,29 +119,22 @@ void key_copy(byte *to_key, byte *from_record, KEY *key_info, uint key_length)
key_length--;
}
}
- if (key_part->key_part_flag & HA_BLOB_PART)
- {
- char *pos;
- ulong blob_length= ((Field_blob*) key_part->field)->get_length();
- key_length-= HA_KEY_BLOB_LENGTH;
- ((Field_blob*) key_part->field)->get_ptr(&pos);
- length=min(key_length, key_part->length);
- set_if_smaller(blob_length, length);
- int2store(to_key, (uint) blob_length);
- to_key+= HA_KEY_BLOB_LENGTH; // Skip length info
- memcpy(to_key, pos, blob_length);
- }
- else if (key_part->key_part_flag & HA_VAR_LENGTH_PART)
+ if (key_part->key_part_flag & HA_BLOB_PART ||
+ key_part->key_part_flag & HA_VAR_LENGTH_PART)
{
key_length-= HA_KEY_BLOB_LENGTH;
length= min(key_length, key_part->length);
- key_part->field->get_key_image((char *) to_key, length, Field::itRAW);
+ key_part->field->get_key_image((char*) to_key, length, Field::itRAW);
to_key+= HA_KEY_BLOB_LENGTH;
}
else
{
length= min(key_length, key_part->length);
- memcpy(to_key, from_record + key_part->offset, (size_t) length);
+ Field *field= key_part->field;
+ CHARSET_INFO *cs= field->charset();
+ uint bytes= field->get_key_image((char*) to_key, length, Field::itRAW);
+ if (bytes < length)
+ cs->cset->fill(cs, (char*) to_key + bytes, length - bytes, ' ');
}
to_key+= length;
key_length-= length;
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.cc b/sql/log.cc
index 7563d754556..818828f9557 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1784,7 +1784,7 @@ void MYSQL_LOG::rotate_and_purge(uint flags)
#ifdef HAVE_REPLICATION
if (expire_logs_days)
{
- long purge_time= (long) (time(0) - expire_logs_days*24*60*60);
+ time_t purge_time= time(0) - expire_logs_days*24*60*60;
if (purge_time >= 0)
purge_logs_before_date(purge_time);
}
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 8bb63e72bde..173ca6232ee 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1879,7 +1879,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 +2988,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/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..2de8b9add11 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -296,7 +296,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 +387,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 374fe6f029c..ea472691760 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -269,7 +269,6 @@ MY_LOCALE *my_locale_by_number(uint number);
#endif
#if defined(__WIN__) || defined(OS2)
-#define IF_WIN(A,B) (A)
#undef FLUSH_TIME
#define FLUSH_TIME 1800 /* Flush every half hour */
@@ -278,7 +277,6 @@ MY_LOCALE *my_locale_by_number(uint number);
#define WAIT_PRIOR 0
#define QUERY_PRIOR 2
#else
-#define IF_WIN(A,B) (B)
#define INTERRUPT_PRIOR 10
#define CONNECT_PRIOR 9
#define WAIT_PRIOR 8
@@ -642,6 +640,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)
@@ -676,6 +676,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);
@@ -696,13 +698,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);
@@ -856,12 +860,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);
@@ -1017,6 +1023,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);
@@ -1269,7 +1277,7 @@ 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;
@@ -1443,7 +1451,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);
@@ -1502,16 +1510,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);
@@ -1519,14 +1533,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);
@@ -1541,10 +1557,11 @@ ha_rows filesort(THD *thd, TABLE *form,struct st_sort_field *sortorder,
ha_rows max_rows, ha_rows *examined_rows);
void filesort_free_buffers(TABLE *table, bool full);
void change_double_for_sort(double nr,byte *to);
-double my_double_round(double value, int dec, bool truncate);
+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 fe99aa08ada..051bad5b310 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -3057,6 +3057,7 @@ static void init_ssl()
DBUG_PRINT("info",("ssl_acceptor_fd: 0x%lx", (long) ssl_acceptor_fd));
if (!ssl_acceptor_fd)
{
+ sql_print_warning("Failed to setup SSL");
opt_use_ssl = 0;
have_ssl= SHOW_OPTION_DISABLED;
}
@@ -3270,7 +3271,7 @@ server.");
#ifdef HAVE_REPLICATION
if (opt_bin_log && expire_logs_days)
{
- long purge_time= (long) (time(0) - expire_logs_days*24*60*60);
+ time_t purge_time= time(0) - expire_logs_days*24*60*60;
if (purge_time >= 0)
mysql_bin_log.purge_logs_before_date(purge_time);
}
@@ -3411,8 +3412,9 @@ void decrement_handler_count()
{
pthread_mutex_lock(&LOCK_thread_count);
handler_count--;
- pthread_mutex_unlock(&LOCK_thread_count);
pthread_cond_signal(&COND_handler_count);
+ pthread_mutex_unlock(&LOCK_thread_count);
+ my_thread_end();
}
#else
#define decrement_handler_count()
@@ -6183,6 +6185,7 @@ struct show_var_st status_vars[]= {
{"Com_analyze", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ANALYZE]), SHOW_LONG_STATUS},
{"Com_backup_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_BACKUP_TABLE]), SHOW_LONG_STATUS},
{"Com_begin", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_BEGIN]), SHOW_LONG_STATUS},
+ {"Com_call_procedure", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CALL]), SHOW_LONG_STATUS},
{"Com_change_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CHANGE_DB]), SHOW_LONG_STATUS},
{"Com_change_master", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CHANGE_MASTER]), SHOW_LONG_STATUS},
{"Com_check", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CHECK]), SHOW_LONG_STATUS},
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..8808327ce0a 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;
}
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..835d8bf038f 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((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;
}
@@ -1756,24 +1759,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 +1798,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 +2984,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 +3490,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_base.cc b/sql/sql_base.cc
index 7ebdc90f8b3..16a88346bb6 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.
@@ -1305,6 +1556,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 +1569,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;
@@ -1495,7 +1751,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 +1763,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 +1787,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 +1836,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 +2100,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 +2162,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 +2188,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 +2280,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 +2633,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;
@@ -2465,7 +2821,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)
@@ -4588,6 +4944,7 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
*/
arena= thd->activate_stmt_arena_if_needed(&backup);
+ thd->lex->current_select->cur_pos_in_select_list= 0;
while (wild_num && (item= it++))
{
if (item->type() == Item::FIELD_ITEM &&
@@ -4629,7 +4986,10 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
}
wild_num--;
}
+ else
+ thd->lex->current_select->cur_pos_in_select_list++;
}
+ thd->lex->current_select->cur_pos_in_select_list= UNDEF_POS;
if (arena)
{
/* make * substituting permanent */
@@ -5134,6 +5494,7 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
item->walk(&Item::reset_query_id_processor,
(byte *)(&thd->query_id));
}
+ thd->lex->current_select->cur_pos_in_select_list++;
}
/*
In case of stored tables, all fields are considered as used,
@@ -5445,7 +5806,7 @@ fill_record(THD *thd, Field **ptr, List<Item> &values, bool ignore_errors)
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);
@@ -5656,7 +6017,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..bef679806d0 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;
@@ -1431,6 +1432,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 +1501,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();
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 071acb57945..bccd4d4cafe 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -369,8 +369,6 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
{
Item *fake_conds= 0;
SELECT_LEX *select_lex= &thd->lex->select_lex;
- const char *operation = thd->lex->sql_command == SQLCOM_TRUNCATE ?
- "TRUNCATE" : "DELETE";
DBUG_ENTER("mysql_prepare_delete");
List<Item> all_fields;
@@ -385,14 +383,14 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
DBUG_RETURN(TRUE);
if (!table_list->updatable || check_key_in_view(thd, table_list))
{
- my_error(ER_NON_UPDATABLE_TABLE, MYF(0), table_list->alias, operation);
+ my_error(ER_NON_UPDATABLE_TABLE, MYF(0), table_list->alias, "DELETE");
DBUG_RETURN(TRUE);
}
{
TABLE_LIST *duplicate;
if ((duplicate= unique_table(thd, table_list, table_list->next_global, 0)))
{
- update_non_unique_table_error(table_list, operation, duplicate);
+ update_non_unique_table_error(table_list, "DELETE", duplicate);
DBUG_RETURN(TRUE);
}
}
@@ -897,8 +895,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
if (!dont_send_ok)
{
db_type table_type;
- if (mysql_frm_type(thd, path, &table_type) == FRMTYPE_VIEW)
- goto trunc_by_del;
+ mysql_frm_type(thd, path, &table_type);
if (table_type == DB_TYPE_UNKNOWN)
{
my_error(ER_NO_SUCH_TABLE, MYF(0),
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..5720758128e 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;
/*
@@ -1258,7 +1359,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 +1562,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 +1583,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 +1608,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 +1656,21 @@ public:
};
-I_List<delayed_insert> delayed_threads;
+I_List<Delayed_insert> delayed_threads;
+
+/**
+ Return an instance of delayed insert thread that can handle
+ inserts into a given table, if it exists. Otherwise return NULL.
+*/
-delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list)
+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 +1685,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 +1737,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 +1750,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 +1769,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 +1783,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 +1863,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 +1908,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 +1948,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 +2017,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 +2044,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 +2077,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 +2133,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 +2322,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 +2346,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 +2958,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 +2974,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 +3014,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 +3061,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 +3079,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 +3193,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 +3228,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 +3249,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 +3263,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 4be0aca3ea7..7bcdc499011 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);
}
}
@@ -1093,7 +1108,7 @@ 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(char *begin, char *end)
{
while (begin < end && (end[-1] <= ' ' || end[-1] == '*' ||
end[-1] == '/' || end[-1] == ';'))
@@ -1834,7 +1849,6 @@ bool st_lex::can_use_merged()
case SQLCOM_UPDATE_MULTI:
case SQLCOM_DELETE:
case SQLCOM_DELETE_MULTI:
- case SQLCOM_TRUNCATE:
case SQLCOM_INSERT:
case SQLCOM_INSERT_SELECT:
case SQLCOM_REPLACE:
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index de7de0d46e9..6c9283126c4 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -468,8 +468,9 @@ public:
bool change_result(select_subselect *result, select_subselect *old_result);
void set_limit(st_select_lex *values);
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();
@@ -675,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()
{
@@ -700,6 +701,13 @@ public:
};
typedef class st_select_lex SELECT_LEX;
+
+inline bool st_select_lex_unit::is_union ()
+{
+ return first_select()->next_select() &&
+ first_select()->next_select()->linkage == UNION_TYPE;
+}
+
#define ALTER_ADD_COLUMN 1
#define ALTER_DROP_COLUMN 2
#define ALTER_CHANGE_COLUMN 4
@@ -878,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; }
};
@@ -898,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;
@@ -990,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;
@@ -1022,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.
@@ -1032,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;
@@ -1101,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();
@@ -1211,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(char *begin, char *end);
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 104d599fa1c..c2267ba5dfc 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -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 ac75e6ea2fa..7e58b36a939 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1238,6 +1238,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 +1315,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)
@@ -1793,17 +1794,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 +1831,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 +1852,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 +1889,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 +3014,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 +3029,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,6 +3073,9 @@ 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
{
@@ -3263,7 +3279,7 @@ end_with_restore_list:
*/
old_list= table[0];
new_list= table->next_local[0];
- if (check_grant(thd, ALTER_ACL, &old_list, 0, 1, 0) ||
+ if (check_grant(thd, ALTER_ACL | DROP_ACL, &old_list, 0, 1, 0) ||
(!test_all_bits(table->next_local->grant.privilege,
INSERT_ACL | CREATE_ACL) &&
check_grant(thd, INSERT_ACL | CREATE_ACL, &new_list, 0, 1, 0)))
@@ -5261,7 +5277,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 +5791,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 +5977,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 +6048,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 +6076,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 +6102,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 +7167,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;
}
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 1ec65743b0f..42655608196 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1164,8 +1164,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 +1492,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 +1776,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 +2816,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_select.cc b/sql/sql_select.cc
index dc018dd43bb..ea59cbbe9f2 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -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()
@@ -4169,7 +4195,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;
@@ -5444,8 +5470,9 @@ static void add_not_null_conds(JOIN *join)
for (uint i=join->const_tables ; i < join->tables ; i++)
{
JOIN_TAB *tab=join->join_tab+i;
- if ((tab->type == JT_REF || tab->type == JT_REF_OR_NULL) &&
- !tab->table->maybe_null)
+ if ((tab->type == JT_REF || tab->type == JT_EQ_REF ||
+ tab->type == JT_REF_OR_NULL) &&
+ !tab->table->maybe_null)
{
for (uint keypart= 0; keypart < tab->ref.key_parts; keypart++)
{
@@ -5979,14 +6006,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 &&
- (!join->order || join->skip_sort_order ||
- test_if_skip_sort_order(tab, join->order, join->select_limit,
- 1))
- ) ||
- (join->sort_by_table == (TABLE *) 1 && i != join->const_tables))
+ 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)))
ordered_set= 1;
switch (tab->type) {
@@ -8669,17 +8696,13 @@ static bool
test_if_equality_guarantees_uniqueness(Item *l, Item *r)
{
return r->const_item() &&
- /* elements must be of the same result type */
- (r->result_type() == l->result_type() ||
- /* or dates compared to longs */
- (((l->type() == Item::FIELD_ITEM &&
- ((Item_field *)l)->field->can_be_compared_as_longlong()) ||
- (l->type() == Item::FUNC_ITEM &&
- ((Item_func *)l)->result_as_longlong())) &&
- r->result_type() == INT_RESULT))
- /* and must have the same collation if compared as strings */
- && (l->result_type() != STRING_RESULT ||
- l->collation.collation == r->collation.collation);
+ /* elements must be compared as dates */
+ (Arg_comparator::can_compare_as_dates(l, r, 0) ||
+ /* or of the same result type */
+ (r->result_type() == l->result_type() &&
+ /* and must have the same collation if compared as strings */
+ (l->result_type() != STRING_RESULT ||
+ l->collation.collation == r->collation.collation)));
}
/*
@@ -10532,7 +10555,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;
@@ -10569,6 +10591,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
@@ -10614,8 +10638,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)
@@ -14546,7 +14568,7 @@ bool JOIN::rollup_init()
for (j=0 ; j < fields_list.elements ; j++)
rollup.fields[i].push_back(rollup.null_items[i]);
}
- List_iterator_fast<Item> it(all_fields);
+ List_iterator<Item> it(all_fields);
Item *item;
while ((item= it++))
{
@@ -14559,6 +14581,32 @@ bool JOIN::rollup_init()
{
item->maybe_null= 1;
found_in_group= 1;
+ if (item->const_item())
+ {
+ /*
+ For ROLLUP queries each constant item referenced in GROUP BY list
+ is wrapped up into an Item_func object yielding the same value
+ as the constant item. The objects of the wrapper class are never
+ considered as constant items and besides they inherit all
+ properties of the Item_result_field class.
+ This wrapping allows us to ensure writing constant items
+ into temporary tables whenever the result of the ROLLUP
+ operation has to be written into a temporary table, e.g. when
+ ROLLUP is used together with DISTINCT in the SELECT list.
+ Usually when creating temporary tables for a intermidiate
+ result we do not include fields for constant expressions.
+ */
+ Item* new_item= new Item_func_rollup_const(item);
+ if (!new_item)
+ return 1;
+ new_item->fix_fields(thd, (Item **) 0);
+ thd->change_item_tree(it.ref(), new_item);
+ for (ORDER *tmp= group_tmp; tmp; tmp= tmp->next)
+ {
+ if (*tmp->item == item)
+ thd->change_item_tree(tmp->item, new_item);
+ }
+ }
}
}
if (item->type() == Item::FUNC_ITEM && !found_in_group)
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 8cf3dc022d9..16ed20cd479 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2315,18 +2315,32 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
res= open_normal_and_derived_tables(thd, show_table_list,
MYSQL_LOCK_IGNORE_FLUSH);
lex->sql_command= save_sql_command;
- /*
- We should use show_table_list->alias instead of
- show_table_list->table_name because table_name
- could be changed during opening of I_S tables. It's safe
- to use alias because alias contains original table name
- in this case.
+ /*
+ They can drop table after table names list creation and
+ before table opening. We open non existing table and
+ get ER_NO_SUCH_TABLE error. In this case we do not store
+ the record into I_S table and clear error.
*/
- res= schema_table->process_table(thd, show_table_list, table,
- res, orig_base_name,
- show_table_list->alias);
- close_tables_for_reopen(thd, &show_table_list);
- DBUG_ASSERT(!lex->query_tables_own_last);
+ if (thd->net.last_errno == ER_NO_SUCH_TABLE)
+ {
+ res= 0;
+ thd->clear_error();
+ }
+ else
+ {
+ /*
+ We should use show_table_list->alias instead of
+ show_table_list->table_name because table_name
+ could be changed during opening of I_S tables. It's safe
+ to use alias because alias contains original table name
+ in this case.
+ */
+ res= schema_table->process_table(thd, show_table_list, table,
+ res, orig_base_name,
+ show_table_list->alias);
+ close_tables_for_reopen(thd, &show_table_list);
+ DBUG_ASSERT(!lex->query_tables_own_last);
+ }
if (res)
goto err;
}
@@ -2419,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");
@@ -2925,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 6f953349c03..079cc0d6456 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -42,6 +42,7 @@ static int copy_data_between_tables(TABLE *from,TABLE *to,
static bool prepare_blob_field(THD *thd, create_field *sql_field);
static bool check_engine(THD *thd, const char *table_name,
enum db_type *new_engine);
+static void set_tmp_file_path(char *buf, size_t bufsize, THD *thd);
/*
@@ -61,8 +62,8 @@ static bool check_engine(THD *thd, const char *table_name,
# 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);
@@ -1681,11 +1682,7 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
/* Check if table exists */
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
{
- my_snprintf(path, sizeof(path), "%s%s%lx_%lx_%x%s",
- mysql_tmpdir, tmp_file_prefix, current_pid, thd->thread_id,
- thd->tmp_table++, reg_ext);
- if (lower_case_table_names)
- my_casedn_str(files_charset_info, path);
+ set_tmp_file_path(path, sizeof(path), thd);
create_info->table_options|=HA_CREATE_DELAY_KEY_WRITE;
}
else
@@ -1725,7 +1722,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;
@@ -2054,7 +2058,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);
@@ -2161,7 +2165,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);
@@ -2801,19 +2805,29 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
{
if (find_temporary_table(thd, db, table_name))
goto table_exists;
- my_snprintf(dst_path, sizeof(dst_path), "%s%s%lx_%lx_%x%s",
- mysql_tmpdir, tmp_file_prefix, current_pid,
- thd->thread_id, thd->tmp_table++, reg_ext);
- if (lower_case_table_names)
- my_casedn_str(files_charset_info, dst_path);
+ set_tmp_file_path(dst_path, sizeof(dst_path), thd);
create_info->table_options|= HA_CREATE_DELAY_KEY_WRITE;
}
else
{
+ bool exists;
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 this critical section should actually cover most
+ of mysql_create_like_table() function. See bugs #18950 and
+ #23667 for more information.
+ Also 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()).
+ */
+ pthread_mutex_lock(&LOCK_open);
+ exists= (table_cache_has_open_placeholder(thd, db, table_name) ||
+ !access(dst_path, F_OK));
+ pthread_mutex_unlock(&LOCK_open);
+ if (exists)
goto table_exists;
}
@@ -3167,9 +3181,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);
@@ -3254,8 +3273,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;
@@ -3263,7 +3296,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,
@@ -3316,6 +3348,12 @@ view_err:
create_info->avg_row_length= table->s->avg_row_length;
if (!(used_fields & HA_CREATE_USED_DEFAULT_CHARSET))
create_info->default_table_charset= table->s->table_charset;
+ if (!(used_fields & HA_CREATE_USED_AUTO) && table->found_next_number_field)
+ {
+ /* Table has an autoincrement, copy value to new table */
+ table->file->info(HA_STATUS_AUTO);
+ create_info->auto_increment_value= table->file->auto_increment_value;
+ }
restore_record(table, s->default_values); // Empty record for DEFAULT
List_iterator<Alter_drop> drop_it(alter_info->drop_list);
@@ -3807,17 +3845,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())
@@ -3836,6 +3863,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)
@@ -4313,3 +4356,16 @@ static bool check_engine(THD *thd, const char *table_name,
}
return FALSE;
}
+
+static void set_tmp_file_path(char *buf, size_t bufsize, THD *thd)
+{
+ char *p= strnmov(buf, mysql_tmpdir, bufsize);
+ my_snprintf(p, bufsize - (p - buf), "%s%lx_%lx_%x%s",
+ tmp_file_prefix, current_pid,
+ thd->thread_id, thd->tmp_table++, reg_ext);
+ if (lower_case_table_names)
+ {
+ /* Convert all except tmpdir to lower case */
+ my_casedn_str(files_charset_info, p);
+ }
+}
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 6f6c4538040..222e33345cc 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);
@@ -1354,19 +1355,18 @@ bool multi_update::send_data(List<Item> &not_used_values)
memcpy((char*) tmp_table->field[0]->ptr,
(char*) table->file->ref, table->file->ref_length);
/* Write row, ignoring duplicated updates to a row */
- if ((error= tmp_table->file->write_row(tmp_table->record[0])))
+ error= tmp_table->file->write_row(tmp_table->record[0]);
+ if (error != HA_ERR_FOUND_DUPP_KEY && error != HA_ERR_FOUND_DUPP_UNIQUE)
{
- if (error != HA_ERR_FOUND_DUPP_KEY &&
- error != HA_ERR_FOUND_DUPP_UNIQUE &&
+ if (error &&
create_myisam_from_heap(thd, tmp_table,
- tmp_table_param + offset, error, 1))
- {
- do_update=0;
- DBUG_RETURN(1); // Not a table_is_full error
- }
- }
- else
+ tmp_table_param + offset, error, 1))
+ {
+ do_update= 0;
+ DBUG_RETURN(1); // Not a table_is_full error
+ }
found++;
+ }
}
}
DBUG_RETURN(0);
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 14d9aeb4df5..ba367040b36 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -772,8 +772,8 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
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 +
+ view->source.length= (char *)skip_rear_comments((char *)view->source.str,
+ (char *)thd->query +
thd->query_length) -
view->source.str;
view->file_version= 1;
@@ -984,10 +984,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
@@ -1279,13 +1283,18 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
unit->slave= save_slave; // fix include_down initialisation
}
+ /*
+ We can safely ignore the VIEW's ORDER BY if we merge into union
+ branch, as order is not important there.
+ */
+ if (!table->select_lex->master_unit()->is_union())
+ table->select_lex->order_list.push_back(&lex->select_lex.order_list);
/*
This SELECT_LEX will be linked in global SELECT_LEX list
to make it processed by mysql_handle_derived(),
but it will not be included to SELECT_LEX tree, because it
will not be executed
- */
- table->select_lex->order_list.push_back(&lex->select_lex.order_list);
+ */
goto ok;
}
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 4a50a602121..c1da870960b 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();
@@ -1619,7 +1603,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 +1625,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 +1636,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 +1670,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 +2223,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 +2261,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); }
@@ -4428,26 +4422,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 +4703,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 +4716,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;
}
@@ -6292,12 +6290,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());
}
;
@@ -7337,13 +7337,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 +7381,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
{
@@ -7559,15 +7564,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 +7596,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 +7690,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 +7706,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 +8302,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 +8318,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 +8327,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 +8356,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);
}
};
@@ -9615,7 +9631,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 +9644,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 +9660,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 +9744,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 6d13514e782..fb2012a79d1 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -2670,7 +2670,16 @@ const char *Field_iterator_table::name()
Item *Field_iterator_table::create_item(THD *thd)
{
- return new Item_field(thd, &thd->lex->current_select->context, *ptr);
+ SELECT_LEX *select= thd->lex->current_select;
+
+ Item_field *item= new Item_field(thd, &select->context, *ptr);
+ if (item && thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY &&
+ !thd->lex->in_sum_func && select->cur_pos_in_select_list != UNDEF_POS)
+ {
+ select->non_agg_fields.push_back(item);
+ item->marker= select->cur_pos_in_select_list;
+ }
+ return item;
}
diff --git a/sql/table.h b/sql/table.h
index 61232a39f0e..da2c90ab212 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -188,6 +188,8 @@ typedef struct st_table_share
} TABLE_SHARE;
+extern ulong refresh_version;
+
/* Information for one open table */
struct st_table {
@@ -268,7 +270,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 +310,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
@@ -648,6 +674,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 +687,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/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/decimal.c b/strings/decimal.c
index ea92174bfc8..1ae75167794 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;
}
}
@@ -1911,6 +1915,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..7196cafb2c9 100644
--- a/strings/strtod.c
+++ b/strings/strtod.c
@@ -194,7 +194,7 @@ double my_strtod(const char *str, char **end_ptr, int *error)
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.server.sh b/support-files/mysql.server.sh
index 65b56443eea..c68d30daafb 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -261,13 +261,13 @@ else
esac
fi
-# Safeguard (relative paths, core dumps..)
-cd $basedir
-
case "$mode" in
'start')
# Start daemon
+ # Safeguard (relative paths, core dumps..)
+ cd $basedir
+
manager=$bindir/mysqlmanager
if test -x $libexecdir/mysqlmanager
then
@@ -359,20 +359,52 @@ case "$mode" in
fi
;;
- 'reload')
+ 'reload'|'force-reload')
if test -s "$server_pid_file" ; then
- mysqld_pid=`cat $server_pid_file`
+ read mysqld_pid < $server_pid_file
kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL"
touch $server_pid_file
else
log_failure_msg "MySQL PID file could not be found!"
+ exit 1
fi
;;
-
- *)
- # usage
- echo "Usage: $0 {start|stop|restart|reload} [ MySQL server options ]"
- exit 1
+ 'status')
+ # First, check to see if pid file exists
+ if test -s "$server_pid_file" ; then
+ read mysqld_pid < $server_pid_file
+ if kill -0 $mysqld_pid 2>/dev/null ; then
+ log_success_msg "MySQL running ($mysqld_pid)"
+ exit 0
+ else
+ log_failure_msg "MySQL is not running, but PID file exists"
+ exit 1
+ fi
+ else
+ # Try to find appropriate mysqld process
+ mysqld_pid=`pidof $sbindir/mysqld`
+ if test -z $mysqld_pid ; then
+ if test "$use_mysqld_safe" = "0" ; then
+ lockfile=/var/lock/subsys/mysqlmanager
+ else
+ lockfile=/var/lock/subsys/mysql
+ fi
+ if test -f $lockfile ; then
+ log_failure_msg "MySQL is not running, but lock exists"
+ exit 2
+ fi
+ log_failure_msg "MySQL is not running"
+ exit 3
+ else
+ log_failure_msg "MySQL is running but PID file could not be found"
+ exit 4
+ fi
+ fi
+ ;;
+ *)
+ # usage
+ echo "Usage: $0 {start|stop|restart|reload|force-reload|status} [ MySQL server options ]"
+ exit 1
;;
esac
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 d64ec08a71d..38346ad0dbc 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -85,7 +85,7 @@ struct my_tests_st
if (opt_silent < 2) \
{ \
fprintf(stdout, "\n\n#####################################\n"); \
- fprintf(stdout, "%d of (%d/%d): %s", test_count++, iter_count, \
+ fprintf(stdout, "%u of (%u/%u): %s", test_count++, iter_count, \
opt_count, str); \
fprintf(stdout, " \n#####################################\n"); \
}
@@ -99,7 +99,7 @@ if (!opt_silent) \
static void print_error(const char *msg);
static void print_st_error(MYSQL_STMT *stmt, const char *msg);
-static void client_disconnect();
+static void client_disconnect(void);
/*
@@ -118,7 +118,7 @@ static void client_disconnect();
#define DIE(expr) \
die(__FILE__, __LINE__, #expr)
-void die(const char *file, int line, const char *expr)
+static void die(const char *file, int line, const char *expr)
{
fflush(stdout);
fprintf(stderr, "%s:%d: check failed: '%s'\n", file, line, expr);
@@ -252,7 +252,7 @@ static my_bool check_have_innodb(MYSQL *conn)
mysql_simple_prepare(): a variant without the 'length' parameter.
*/
-MYSQL_STMT *STDCALL
+static MYSQL_STMT *STDCALL
mysql_simple_prepare(MYSQL *mysql_arg, const char *query)
{
MYSQL_STMT *stmt= mysql_stmt_init(mysql_arg);
@@ -467,7 +467,7 @@ static void my_print_result_metadata(MYSQL_RES *result)
/* Process the result set */
-int my_process_result_set(MYSQL_RES *result)
+static int my_process_result_set(MYSQL_RES *result)
{
MYSQL_ROW row;
MYSQL_FIELD *field;
@@ -523,7 +523,7 @@ int my_process_result_set(MYSQL_RES *result)
}
-int my_process_result(MYSQL *mysql_arg)
+static int my_process_result(MYSQL *mysql_arg)
{
MYSQL_RES *result;
int row_count;
@@ -543,7 +543,7 @@ int my_process_result(MYSQL *mysql_arg)
#define MAX_RES_FIELDS 50
#define MAX_FIELD_DATA_SIZE 255
-int my_process_stmt_result(MYSQL_STMT *stmt)
+static int my_process_stmt_result(MYSQL_STMT *stmt)
{
int field_count;
int row_count= 0;
@@ -8785,7 +8785,9 @@ static void test_ts()
int rc, field_count;
char name;
char query[MAX_TEST_QUERY_LENGTH];
-
+ const char *queries [3]= {"SELECT a, b, c FROM test_ts WHERE %c=?",
+ "SELECT a, b, c FROM test_ts WHERE %c=?",
+ "SELECT a, b, c FROM test_ts WHERE %c=CAST(? AS DATE)"};
myheader("test_ts");
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_ts");
@@ -8857,7 +8859,7 @@ static void test_ts()
{
int row_count= 0;
- sprintf(query, "SELECT a, b, c FROM test_ts WHERE %c=?", name);
+ sprintf(query, queries[field_count], name);
if (!opt_silent)
fprintf(stdout, "\n %s", query);
diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c
index a12a45df648..4e3092b3b39 100644
--- a/vio/viosslfactories.c
+++ b/vio/viosslfactories.c
@@ -249,8 +249,13 @@ new_VioSSLFd(const char *key_file, const char *cert_file,
DBUG_RETURN(0);
}
- /* Set the ciphers that can be used */
- if (cipher && SSL_CTX_set_cipher_list(ssl_fd->ssl_context, cipher))
+ /*
+ Set the ciphers that can be used
+ NOTE: SSL_CTX_set_cipher_list will return 0 if
+ none of the provided ciphers could be selected
+ */
+ if (cipher &&
+ SSL_CTX_set_cipher_list(ssl_fd->ssl_context, cipher) == 0)
{
DBUG_PRINT("error", ("failed to set ciphers to use"));
report_errors();
diff --git a/win/Makefile.am b/win/Makefile.am
index b087675793b..89f0d65b528 100755
--- a/win/Makefile.am
+++ b/win/Makefile.am
@@ -14,7 +14,8 @@
# 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
%::SCCS/s.%
diff --git a/win/README b/win/README
index 871ae4efee7..118d619226a 100644
--- a/win/README
+++ b/win/README
@@ -50,6 +50,8 @@ The options right now are
MYSQL_TCP_PORT=<port> Server port, default 3306
DISABLE_GRANT_OPTIONS Disables the use of --init-file and --skip-grant-tables
options of mysqld.exe
+ EMBED_MANIFESTS Embed custom manifests into final exes, otherwise VS
+ default will be used.
So the command line could look like:
diff --git a/win/configure.js b/win/configure.js
index 3488efacba3..a2502d96b80 100755
--- a/win/configure.js
+++ b/win/configure.js
@@ -47,6 +47,7 @@ try
case "WITH_PARTITION_STORAGE_ENGINE":
case "__NT__":
case "DISABLE_GRANT_OPTIONS":
+ case "EMBED_MANIFESTS":
configfile.WriteLine("SET (" + args.Item(i) + " TRUE)");
break;
case "MYSQL_SERVER_SUFFIX":
diff --git a/win/create_manifest.js b/win/create_manifest.js
new file mode 100755
index 00000000000..ac62cb2a8c2
--- /dev/null
+++ b/win/create_manifest.js
@@ -0,0 +1,86 @@
+/*
+ manifest.js - Writes a custom XML manifest for each executable/library
+ 6 command line options must be supplied:
+ name - Name of the executable/library into which the mainfest will be
+ embedded.
+ version - Version of the executable
+ arch - Architecture intended.
+ type - Application type.
+ exe_level - Application execution level.
+ [asInvoker|highestAvailable|requireAdministrator]
+ outfile - Final destination where mainfest will be written.
+
+ Example:
+ cscript manifest.js name=mysql version=5.0.32 arch=X86 type=win32
+ exe_level=asInvoker outfile=out.xml
+*/
+
+try
+{
+ var args = WScript.Arguments
+ for (i=0; i < args.Count(); i++)
+ {
+ var parts = args.Item(i).split('=');
+ switch (parts[0])
+ {
+ case "name":
+ var app_name= parts[1];
+ break;
+ case "version":
+ var app_version= parts[1];
+ app_version+= ".0";
+ break;
+ case "arch":
+ var app_arch= parts[1];
+ break;
+ case "type":
+ var app_type= parts[1];
+ break;
+ case "exe_level":
+ var app_exe_level= parts[1];
+ break;
+ case "outfile":
+ var manifest_file= parts[1];
+ break;
+ default:
+ WScript.echo("Invalid argument supplied.");
+ }
+ }
+ if (i != 6)
+ throw new Error(1, "Incorrect number of arguments.");
+
+ var manifest_xml= "<?xml version=\'1.0\' encoding=\'UTF-8\' standalone=\'yes\'?>\r\n";
+ manifest_xml+= "<assembly xmlns=\'urn:schemas-microsoft-com:asm.v1\'";
+ manifest_xml+= " manifestVersion=\'1.0\'>\r\n";
+ // Application Information
+ manifest_xml+= "\t<assemblyIdentity name=\'" + app_name + "\'";
+ manifest_xml+= " version=\'" + app_version + "\'";
+ manifest_xml+= " processorArchitecture=\'" + app_arch + "\'";
+ // TOADD - Add publicKeyToken attribute once we have Authenticode key.
+ manifest_xml+= " type=\'" + app_type + "\' />\r\n";
+ // Identify the application security requirements.
+ manifest_xml+= "\t<trustInfo xmlns=\'urn:schemas-microsoft-com:asm.v2\'>\r\n";
+ manifest_xml+= "\t\t<security>\r\n\t\t\t<requestedPrivileges>\r\n\t\t\t\t";
+ manifest_xml+= "<requestedExecutionLevel level=\'" + app_exe_level + "\'";
+ manifest_xml+= " uiAccess=\'false\'/>\r\n";
+ manifest_xml+= "\t\t\t</requestedPrivileges>\r\n\t\t</security>\r\n";
+ manifest_xml+= "\t</trustInfo>\r\n</assembly>\r\n";
+
+ // Write the valid XML to it's final destination.
+ var outfileXML = WScript.CreateObject("Msxml2.DOMDocument.3.0");
+ outfileXML.async = false;
+ if (!outfileXML.loadXML(manifest_xml))
+ {
+ WScript.Echo(manifest_xml);
+ throw new Error(2, "Invalid XML");
+ }
+ outfileXML.save(manifest_file);
+
+ WScript.Echo("Success, created custom manifest!");
+ WScript.Quit(0);
+}
+catch (e)
+{
+ WScript.Echo("Error: " + e.description);
+ WScript.Quit(1);
+}
diff --git a/win/mysql_manifest.cmake b/win/mysql_manifest.cmake
new file mode 100755
index 00000000000..b5bb6fda8fb
--- /dev/null
+++ b/win/mysql_manifest.cmake
@@ -0,0 +1,20 @@
+
+# - MYSQL_EMBED_MANIFEST(target_name required_privs)
+# Create a manifest for target_name. Set the execution level to require_privs
+#
+# NOTE. PROCESSOR_ARCH must be defined before this MACRO is called.
+
+MACRO(MYSQL_EMBED_MANIFEST _target_name _required_privs)
+ ADD_CUSTOM_COMMAND(
+ TARGET ${_target_name}
+ PRE_LINK
+ COMMAND cscript.exe
+ ARGS "${PROJECT_SOURCE_DIR}/win/create_manifest.js" name=$(ProjectName) version=${VERSION} arch=${PROCESSOR_ARCH} type=$(PlatformName) exe_level=${_required_privs} outfile=$(IntDir)\\$(TargetFileName).intermediate.manifest
+ COMMENT "Generates the contents of the manifest contents.")
+ ADD_CUSTOM_COMMAND(
+ TARGET ${_target_name}
+ POST_BUILD
+ COMMAND mt.exe
+ ARGS -nologo -manifest $(IntDir)\\$(TargetFileName).intermediate.manifest -outputresource:$(TargetPath)
+ COMMENT "Embeds the manifest contents.")
+ENDMACRO(MYSQL_EMBED_MANIFEST)