summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2004-12-31 06:36:32 +0100
committerunknown <joreland@mysql.com>2004-12-31 06:36:32 +0100
commitbd877f17dbb17266e528856e7bccd1aa97ac7394 (patch)
treea1d6407a6626529b28b62eaf78d244fe41fa644f
parent3c879de468722c214041f9ec92a825b260ace9a4 (diff)
parentc8dc26b4d7afb81b581934076fcbddd79b12c43f (diff)
downloadmariadb-git-bd877f17dbb17266e528856e7bccd1aa97ac7394.tar.gz
merge
BitKeeper/etc/logging_ok: auto-union ndb/docs/wl2077.txt: Auto merged ndb/include/Makefile.am: Auto merged ndb/include/ndbapi/NdbTransaction.hpp: Auto merged ndb/src/common/debugger/EventLogger.cpp: Auto merged ndb/src/common/debugger/signaldata/DictTabInfo.cpp: Auto merged ndb/src/common/logger/Logger.cpp: Auto merged ndb/src/common/mgmcommon/ConfigRetriever.cpp: Auto merged ndb/src/common/util/Makefile.am: Auto merged ndb/src/kernel/blocks/dbacc/DbaccInit.cpp: Auto merged ndb/src/kernel/blocks/dbacc/Makefile.am: Auto merged ndb/src/kernel/main.cpp: Auto merged ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Auto merged ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Auto merged ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged ndb/src/kernel/blocks/dbtux/Dbtux.hpp: Auto merged ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp: Auto merged ndb/src/kernel/vm/Configuration.cpp: Auto merged ndb/src/kernel/vm/Configuration.hpp: Auto merged ndb/src/mgmapi/mgmapi.cpp: Auto merged ndb/src/mgmsrv/CommandInterpreter.cpp: Auto merged ndb/src/mgmsrv/InitConfigFileParser.cpp: Auto merged ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged ndb/src/mgmsrv/MgmtSrvr.hpp: Auto merged ndb/src/mgmsrv/Services.cpp: Auto merged ndb/src/mgmsrv/Services.hpp: Auto merged ndb/src/mgmsrv/main.cpp: Auto merged ndb/src/ndbapi/NdbBlob.cpp: Auto merged ndb/src/ndbapi/NdbDictionary.cpp: Auto merged ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged ndb/src/ndbapi/NdbDictionaryImpl.hpp: Auto merged ndb/src/ndbapi/NdbOperationExec.cpp: Auto merged ndb/src/ndbapi/NdbReceiver.cpp: Auto merged ndb/src/ndbapi/NdbScanOperation.cpp: Auto merged ndb/src/ndbapi/NdbTransaction.cpp: Auto merged ndb/src/ndbapi/Ndbif.cpp: Auto merged ndb/src/ndbapi/Ndbinit.cpp: Auto merged ndb/src/ndbapi/Ndblist.cpp: Auto merged ndb/src/ndbapi/TransporterFacade.cpp: Auto merged ndb/src/ndbapi/TransporterFacade.hpp: Auto merged ndb/src/ndbapi/ndberror.c: Auto merged ndb/test/ndbapi/Makefile.am: Auto merged ndb/test/ndbapi/testDict.cpp: Auto merged ndb/test/ndbapi/testNdbApi.cpp: Auto merged ndb/test/src/NdbRestarter.cpp: Auto merged ndb/test/tools/Makefile.am: Auto merged ndb/tools/Makefile.am: Auto merged ndb/tools/delete_all.cpp: Auto merged ndb/tools/desc.cpp: Auto merged ndb/tools/select_all.cpp: Auto merged ndb/tools/select_count.cpp: Auto merged scripts/make_win_src_distribution.sh: Auto merged sql/ha_ndbcluster.h: Auto merged
-rw-r--r--.bzrignore9
-rw-r--r--BitKeeper/etc/logging_ok3
-rwxr-xr-xBuild-tools/Do-compile43
-rw-r--r--Makefile.am2
-rw-r--r--VC++Files/client/mysqltest.dsp16
-rw-r--r--VC++Files/mysql-test/mysql_test_run_new.dsp54
-rw-r--r--VC++Files/mysql.dsw17
-rw-r--r--VC++Files/mysqlmanager/README.TXT102
-rw-r--r--VC++Files/mysqlmanager/RES/bitmap1.bmpbin630 -> 0 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/bitmap3.bmpbin630 -> 0 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/bmp00001.bmpbin246 -> 0 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/bmp00002.bmpbin238 -> 0 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/database.bmpbin238 -> 0 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/fontd.bmpbin246 -> 0 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/fontu.bmpbin246 -> 0 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/mysqlmanager.icobin1078 -> 0 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/mysqlmanager.rc213
-rw-r--r--VC++Files/mysqlmanager/RES/mysqlmanagerdoc.icobin1078 -> 0 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/query_ex.bmpbin246 -> 0 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/toolbar.bmpbin1078 -> 0 bytes
-rw-r--r--VC++Files/mysqlmanager/childfrm.cpp65
-rw-r--r--VC++Files/mysqlmanager/childfrm.h52
-rw-r--r--VC++Files/mysqlmanager/cresource.h134
-rw-r--r--VC++Files/mysqlmanager/mainfrm.cpp137
-rw-r--r--VC++Files/mysqlmanager/mainfrm.h69
-rw-r--r--VC++Files/mysqlmanager/mysqlmanager.cpp168
-rw-r--r--VC++Files/mysqlmanager/mysqlmanager.dsp277
-rw-r--r--VC++Files/mysqlmanager/mysqlmanager.dsw28
-rw-r--r--VC++Files/mysqlmanager/mysqlmanager.h50
-rw-r--r--VC++Files/mysqlmanager/mysqlmanager.mak327
-rw-r--r--VC++Files/mysqlmanager/mysqlmanager.rc572
-rw-r--r--VC++Files/mysqlmanager/mysqlmanagerdoc.cpp84
-rw-r--r--VC++Files/mysqlmanager/mysqlmanagerdoc.h57
-rw-r--r--VC++Files/mysqlmanager/mysqlmanagerview.cpp854
-rw-r--r--VC++Files/mysqlmanager/mysqlmanagerview.h89
-rw-r--r--VC++Files/mysqlmanager/registerserver.cpp51
-rw-r--r--VC++Files/mysqlmanager/registerserver.h50
-rw-r--r--VC++Files/mysqlmanager/resource.h55
-rw-r--r--VC++Files/mysqlmanager/stdafx.cpp5
-rw-r--r--VC++Files/mysqlmanager/stdafx.h28
-rw-r--r--VC++Files/mysqlmanager/toolsql.cpp687
-rw-r--r--VC++Files/mysqlmanager/toolsql.h102
-rw-r--r--VC++Files/mysqlmanager/toolsqlquery.cpp110
-rw-r--r--VC++Files/mysqlmanager/toolsqlquery.h60
-rw-r--r--VC++Files/mysqlmanager/toolsqlresults.cpp73
-rw-r--r--VC++Files/mysqlmanager/toolsqlresults.h53
-rw-r--r--VC++Files/mysqlmanager/toolsqlstatus.cpp50
-rw-r--r--VC++Files/mysqlmanager/toolsqlstatus.h47
-rw-r--r--VC++Files/sql/mysqld.dsp111
-rw-r--r--client/Makefile.am5
-rw-r--r--client/mysql.cc4
-rw-r--r--client/mysqldump.c10
-rw-r--r--client/mysqltest.c5
-rw-r--r--config/ac-macros/character_sets.m42
-rw-r--r--configure.in39
-rw-r--r--dbug/dbug_analyze.c22
-rw-r--r--include/errmsg.h3
-rw-r--r--include/my_base.h3
-rw-r--r--include/my_handler.h14
-rw-r--r--include/myisam.h3
-rw-r--r--include/raid.h7
-rw-r--r--innobase/dict/dict0dict.c51
-rw-r--r--innobase/dict/dict0load.c17
-rw-r--r--innobase/fil/fil0fil.c6
-rw-r--r--innobase/ibuf/ibuf0ibuf.c7
-rw-r--r--innobase/include/dict0dict.h15
-rw-r--r--innobase/include/dict0dict.ic74
-rw-r--r--innobase/include/rem0rec.ic11
-rw-r--r--innobase/os/os0file.c13
-rw-r--r--innobase/page/page0page.c8
-rw-r--r--innobase/rem/rem0rec.c26
-rw-r--r--innobase/row/row0upd.c2
-rw-r--r--innobase/srv/srv0srv.c1
-rw-r--r--innobase/trx/trx0rec.c13
-rw-r--r--libmysql/errmsg.c12
-rw-r--r--libmysql/libmysql.c28
-rw-r--r--libmysqld/lib_sql.cc79
-rw-r--r--merge/.cvsignore3
-rw-r--r--merge/Makefile.am25
-rwxr-xr-xmerge/make-ccc3
-rw-r--r--merge/mrg_close.c40
-rw-r--r--merge/mrg_create.c61
-rw-r--r--merge/mrg_def.h29
-rw-r--r--merge/mrg_delete.c29
-rw-r--r--merge/mrg_extra.c46
-rw-r--r--merge/mrg_info.c60
-rw-r--r--merge/mrg_locking.c33
-rw-r--r--merge/mrg_open.c150
-rw-r--r--merge/mrg_panic.c47
-rw-r--r--merge/mrg_rrnd.c110
-rw-r--r--merge/mrg_rsame.c36
-rw-r--r--merge/mrg_static.c26
-rw-r--r--merge/mrg_update.c31
-rw-r--r--myisam/ft_boolean_search.c3
-rw-r--r--myisam/ft_static.c36
-rw-r--r--myisam/mi_check.c10
-rw-r--r--myisam/mi_delete.c61
-rw-r--r--myisam/mi_extra.c6
-rw-r--r--myisam/mi_key.c2
-rw-r--r--myisam/mi_keycache.c2
-rw-r--r--myisam/mi_locking.c8
-rw-r--r--myisam/mi_open.c17
-rw-r--r--myisam/mi_page.c4
-rw-r--r--myisam/mi_range.c9
-rw-r--r--myisam/mi_rkey.c2
-rw-r--r--myisam/mi_rnext_same.c4
-rw-r--r--myisam/mi_search.c28
-rw-r--r--myisam/mi_update.c6
-rw-r--r--myisam/mi_write.c31
-rw-r--r--myisam/myisamdef.h4
-rw-r--r--myisam/rt_index.c3
-rw-r--r--myisam/sort.c7
-rw-r--r--myisam/sp_key.c5
-rw-r--r--myisammrg/myrg_rnext_same.c33
-rw-r--r--myisammrg/myrg_static.c2
-rw-r--r--mysql-test/Makefile.am2
-rw-r--r--mysql-test/include/ctype_common.inc2
-rw-r--r--mysql-test/include/ps_modify1.inc3
-rw-r--r--mysql-test/my_create_tables.c646
-rw-r--r--mysql-test/my_manage.c3
-rw-r--r--mysql-test/my_manage.h4
-rw-r--r--mysql-test/mysql-test-run.sh8
-rw-r--r--mysql-test/mysql_test_run_new.c16
-rw-r--r--mysql-test/ndb/basic.result69
-rw-r--r--mysql-test/ndb/basic.test17
-rw-r--r--mysql-test/ndb/basic_log.result0
-rw-r--r--mysql-test/ndb/ndbcluster.sh60
-rw-r--r--mysql-test/ndb/restart.result16
-rw-r--r--mysql-test/ndb/restart.test12
-rw-r--r--mysql-test/ndb/restart_log.result20
-rw-r--r--mysql-test/r/count_distinct2.result4
-rw-r--r--mysql-test/r/ctype_big5.result4
-rw-r--r--mysql-test/r/ctype_big5.result.es58
-rw-r--r--mysql-test/r/ctype_create.result9
-rw-r--r--mysql-test/r/ctype_recoding.result.es242
-rw-r--r--mysql-test/r/ctype_uca.result15
-rw-r--r--mysql-test/r/ctype_uca.result.es2377
-rw-r--r--mysql-test/r/ctype_ucs.result56
-rw-r--r--mysql-test/r/ctype_ujis.result2041
-rw-r--r--mysql-test/r/flush_block_commit.result8
-rw-r--r--mysql-test/r/func_concat.result36
-rw-r--r--mysql-test/r/func_str.result6
-rw-r--r--mysql-test/r/func_test.result.es185
-rw-r--r--mysql-test/r/gis-rtree.result47
-rw-r--r--mysql-test/r/grant.result66
-rw-r--r--mysql-test/r/grant_cache.result16
-rw-r--r--mysql-test/r/group_by.result12
-rw-r--r--mysql-test/r/have_exampledb.require2
-rw-r--r--mysql-test/r/index_merge.result2
-rw-r--r--mysql-test/r/information_schema.result24
-rw-r--r--mysql-test/r/information_schema_inno.result1
-rw-r--r--mysql-test/r/insert_select.result.es7
-rw-r--r--mysql-test/r/insert_update.result62
-rw-r--r--mysql-test/r/lowercase_table.result1
-rw-r--r--mysql-test/r/merge.result25
-rw-r--r--mysql-test/r/metadata.result2
-rw-r--r--mysql-test/r/multi_update.result12
-rw-r--r--mysql-test/r/ndb_alter_table.result16
-rw-r--r--mysql-test/r/ndb_update.result13
-rw-r--r--mysql-test/r/ps.result11
-rw-r--r--mysql-test/r/ps_1general.result3
-rw-r--r--mysql-test/r/ps_2myisam.result11
-rw-r--r--mysql-test/r/ps_2myisam.result.es3130
-rw-r--r--mysql-test/r/ps_3innodb.result11
-rw-r--r--mysql-test/r/ps_3innodb.result.es3113
-rw-r--r--mysql-test/r/ps_4heap.result11
-rw-r--r--mysql-test/r/ps_4heap.result.es3114
-rw-r--r--mysql-test/r/ps_5merge.result16
-rw-r--r--mysql-test/r/ps_5merge.result.es6064
-rw-r--r--mysql-test/r/ps_6bdb.result11
-rw-r--r--mysql-test/r/ps_6bdb.result.es3113
-rw-r--r--mysql-test/r/ps_7ndb.result3
-rw-r--r--mysql-test/r/query_cache.result10
-rw-r--r--mysql-test/r/query_cache.result.es8
-rw-r--r--mysql-test/r/rpl_insert_ignore.result70
-rw-r--r--mysql-test/r/show_check.result12
-rw-r--r--mysql-test/r/sp.result262
-rw-r--r--mysql-test/r/subselect.result96
-rw-r--r--mysql-test/r/temp_table.result4
-rw-r--r--mysql-test/r/timezone2.result42
-rw-r--r--mysql-test/r/type_enum.result14
-rw-r--r--mysql-test/r/union.result8
-rw-r--r--mysql-test/r/update.result6
-rw-r--r--mysql-test/r/variables.result4
-rw-r--r--mysql-test/r/view.result5
-rw-r--r--mysql-test/t/ctype_create.test12
-rw-r--r--mysql-test/t/ctype_uca.test8
-rw-r--r--mysql-test/t/ctype_ucs.test31
-rw-r--r--mysql-test/t/ctype_ujis.test1022
-rw-r--r--mysql-test/t/delayed.test2
-rw-r--r--mysql-test/t/derived.test1
-rw-r--r--mysql-test/t/flush_block_commit.test8
-rw-r--r--mysql-test/t/func_concat.test16
-rw-r--r--mysql-test/t/func_str.test8
-rw-r--r--mysql-test/t/gis-rtree.test54
-rw-r--r--mysql-test/t/grant.test74
-rw-r--r--mysql-test/t/group_by.test9
-rw-r--r--mysql-test/t/information_schema.test8
-rw-r--r--mysql-test/t/information_schema_inno.test3
-rw-r--r--mysql-test/t/insert_update.test31
-rw-r--r--mysql-test/t/key_cache.test6
-rw-r--r--mysql-test/t/lowercase_table.test1
-rw-r--r--mysql-test/t/merge.test18
-rw-r--r--mysql-test/t/multi_update.test15
-rw-r--r--mysql-test/t/ndb_alter_table.test17
-rw-r--r--mysql-test/t/ndb_update.test22
-rw-r--r--mysql-test/t/ps.test13
-rw-r--r--mysql-test/t/ps_1general.test4
-rw-r--r--mysql-test/t/query_cache.test11
-rw-r--r--mysql-test/t/rpl_insert_ignore-slave.opt1
-rw-r--r--mysql-test/t/rpl_insert_ignore.test71
-rw-r--r--mysql-test/t/show_check.test4
-rw-r--r--mysql-test/t/sp.test531
-rw-r--r--mysql-test/t/subselect.test52
-rw-r--r--mysql-test/t/timezone2.test47
-rw-r--r--mysql-test/t/type_enum.test15
-rw-r--r--mysql-test/t/update.test9
-rw-r--r--mysql-test/t/variables.test7
-rw-r--r--mysql-test/t/view.test3
-rw-r--r--mysys/hash.c2
-rw-r--r--ndb/include/debugger/EventLogger.hpp4
-rw-r--r--ndb/include/kernel/LogLevel.hpp12
-rw-r--r--ndb/include/kernel/signaldata/CreateEvnt.hpp8
-rw-r--r--ndb/include/kernel/signaldata/PackedSignal.hpp2
-rw-r--r--ndb/include/kernel/signaldata/SumaImpl.hpp18
-rw-r--r--ndb/include/logger/Logger.hpp2
-rw-r--r--ndb/include/mgmapi/mgmapi.h15
-rw-r--r--ndb/include/mgmapi/mgmapi_config_parameters.h1
-rw-r--r--ndb/include/ndbapi/Ndb.hpp92
-rw-r--r--ndb/include/ndbapi/NdbDictionary.hpp8
-rw-r--r--ndb/include/ndbapi/ndb_cluster_connection.hpp31
-rw-r--r--ndb/include/util/BaseString.hpp10
-rw-r--r--ndb/include/util/ndb_opts.h59
-rw-r--r--ndb/src/common/debugger/EventLogger.cpp43
-rw-r--r--ndb/src/common/debugger/signaldata/DictTabInfo.cpp2
-rw-r--r--ndb/src/common/debugger/signaldata/NFCompleteRep.cpp2
-rw-r--r--ndb/src/common/logger/FileLogHandler.cpp6
-rw-r--r--ndb/src/common/logger/Logger.cpp17
-rw-r--r--ndb/src/common/portlib/NdbTCP.cpp12
-rw-r--r--ndb/src/common/util/version.c41
-rw-r--r--ndb/src/kernel/blocks/backup/BackupInit.cpp5
-rw-r--r--ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp25
-rw-r--r--ndb/src/kernel/blocks/dbacc/DbaccInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbdict/Dbdict.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbdih/DbdihInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/dblqh/DblqhInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbtc/DbtcInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupGen.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbtux/Dbtux.hpp4
-rw-r--r--ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbutil/DbUtil.cpp2
-rw-r--r--ndb/src/kernel/blocks/grep/GrepInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp2
-rw-r--r--ndb/src/kernel/blocks/ndbfs/VoidFs.cpp2
-rw-r--r--ndb/src/kernel/blocks/qmgr/QmgrInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/suma/Suma.cpp2
-rw-r--r--ndb/src/kernel/blocks/suma/SumaInit.cpp4
-rw-r--r--ndb/src/kernel/blocks/trix/Trix.cpp2
-rw-r--r--ndb/src/kernel/vm/Configuration.cpp21
-rw-r--r--ndb/src/mgmapi/mgmapi.cpp104
-rw-r--r--ndb/src/mgmclient/CommandInterpreter.cpp614
-rw-r--r--ndb/src/mgmclient/main.cpp6
-rw-r--r--ndb/src/mgmsrv/CommandInterpreter.cpp960
-rw-r--r--ndb/src/mgmsrv/CommandInterpreter.hpp85
-rw-r--r--ndb/src/mgmsrv/ConfigInfo.cpp184
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.cpp100
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.hpp27
-rw-r--r--ndb/src/mgmsrv/Services.cpp217
-rw-r--r--ndb/src/mgmsrv/main.cpp43
-rw-r--r--ndb/src/ndbapi/DictCache.cpp6
-rw-r--r--ndb/src/ndbapi/DictCache.hpp3
-rw-r--r--ndb/src/ndbapi/Ndb.cpp282
-rw-r--r--ndb/src/ndbapi/NdbDictionary.cpp8
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.cpp46
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.hpp2
-rw-r--r--ndb/src/ndbapi/NdbEventOperation.cpp2
-rw-r--r--ndb/src/ndbapi/NdbImpl.hpp107
-rw-r--r--ndb/src/ndbapi/NdbReceiver.cpp4
-rw-r--r--ndb/src/ndbapi/NdbScanFilter.cpp2
-rw-r--r--ndb/src/ndbapi/NdbScanOperation.cpp16
-rw-r--r--ndb/src/ndbapi/NdbTransaction.cpp4
-rw-r--r--ndb/src/ndbapi/NdbWaiter.hpp102
-rw-r--r--ndb/src/ndbapi/Ndbif.cpp73
-rw-r--r--ndb/src/ndbapi/Ndbinit.cpp60
-rw-r--r--ndb/src/ndbapi/Ndblist.cpp39
-rw-r--r--ndb/src/ndbapi/TransporterFacade.cpp4
-rw-r--r--ndb/src/ndbapi/TransporterFacade.hpp2
-rw-r--r--ndb/src/ndbapi/ndb_cluster_connection.cpp609
-rw-r--r--ndb/src/ndbapi/ndb_cluster_connection_impl.hpp100
-rw-r--r--ndb/test/ndbapi/testDict.cpp6
-rw-r--r--ndb/test/ndbapi/testNdbApi.cpp8
-rw-r--r--ndb/test/src/NdbBackup.cpp3
-rw-r--r--ndb/tools/delete_all.cpp6
-rw-r--r--ndb/tools/desc.cpp6
-rw-r--r--ndb/tools/drop_index.cpp6
-rw-r--r--ndb/tools/drop_tab.cpp6
-rw-r--r--ndb/tools/listTables.cpp8
-rw-r--r--ndb/tools/ndb_test_platform.cpp6
-rw-r--r--ndb/tools/restore/Restore.cpp8
-rw-r--r--ndb/tools/restore/restore_main.cpp5
-rw-r--r--ndb/tools/select_all.cpp6
-rw-r--r--ndb/tools/select_count.cpp6
-rw-r--r--ndb/tools/waiter.cpp6
-rw-r--r--netware/init_db.sql30
-rw-r--r--netware/mysql_fix_privilege_tables.pl2
-rw-r--r--regex/main.c2
-rw-r--r--regex/regcomp.c21
-rw-r--r--scripts/fill_help_tables.sh16
-rw-r--r--scripts/make_win_src_distribution.sh7
-rw-r--r--scripts/mysql_fix_privilege_tables.sh7
-rw-r--r--scripts/mysql_install_db.sh2
-rw-r--r--server-tools/instance-manager/commands.cc7
-rw-r--r--server-tools/instance-manager/instance_options.cc6
-rw-r--r--sql/examples/ha_archive.cc3
-rw-r--r--sql/field.cc29
-rw-r--r--sql/gen_lex_hash.cc24
-rw-r--r--sql/ha_myisam.cc5
-rw-r--r--sql/ha_ndbcluster.cc62
-rw-r--r--sql/ha_ndbcluster.h2
-rw-r--r--sql/handler.cc6
-rw-r--r--sql/item.cc64
-rw-r--r--sql/item.h80
-rw-r--r--sql/item_cmpfunc.cc55
-rw-r--r--sql/item_cmpfunc.h24
-rw-r--r--sql/item_create.h2
-rw-r--r--sql/item_func.cc22
-rw-r--r--sql/item_geofunc.cc1
-rw-r--r--sql/item_row.cc1
-rw-r--r--sql/item_strfunc.cc18
-rw-r--r--sql/item_strfunc.h4
-rw-r--r--sql/item_subselect.cc58
-rw-r--r--sql/item_subselect.h20
-rw-r--r--sql/item_sum.cc19
-rw-r--r--sql/item_sum.h8
-rw-r--r--sql/log.cc1
-rw-r--r--sql/log_event.cc10
-rw-r--r--sql/mysql_priv.h28
-rw-r--r--sql/mysqld.cc52
-rw-r--r--sql/net_serv.cc4
-rw-r--r--sql/password.c5
-rw-r--r--sql/protocol.cc12
-rw-r--r--sql/repl_failsafe.cc1
-rw-r--r--sql/set_var.cc21
-rw-r--r--sql/slave.cc62
-rw-r--r--sql/slave.h27
-rw-r--r--sql/sp.cc1
-rw-r--r--sql/sp_head.cc1
-rw-r--r--sql/sql_acl.cc19
-rw-r--r--sql/sql_base.cc15
-rw-r--r--sql/sql_cache.cc3
-rw-r--r--sql/sql_class.cc6
-rw-r--r--sql/sql_class.h10
-rw-r--r--sql/sql_db.cc26
-rw-r--r--sql/sql_derived.cc1
-rw-r--r--sql/sql_do.cc1
-rw-r--r--sql/sql_handler.cc6
-rw-r--r--sql/sql_help.cc3
-rw-r--r--sql/sql_insert.cc82
-rw-r--r--sql/sql_lex.cc12
-rw-r--r--sql/sql_lex.h2
-rw-r--r--sql/sql_parse.cc155
-rw-r--r--sql/sql_prepare.cc40
-rw-r--r--sql/sql_repl.cc9
-rw-r--r--sql/sql_select.cc17
-rw-r--r--sql/sql_show.cc335
-rw-r--r--sql/sql_table.cc51
-rw-r--r--sql/sql_trigger.cc2
-rw-r--r--sql/sql_union.cc2
-rw-r--r--sql/sql_update.cc66
-rw-r--r--sql/sql_view.cc1
-rw-r--r--sql/sql_yacc.yy109
-rw-r--r--sql/strfunc.cc20
-rw-r--r--sql/table.cc27
-rw-r--r--sql/table.h12
-rw-r--r--sql/tztime.cc5
-rw-r--r--sql/tztime.h6
-rw-r--r--sql/udf_example.cc13
-rw-r--r--sql/unireg.cc22
-rw-r--r--strings/ctype-czech.c3
-rw-r--r--strings/ctype-ucs2.c3
-rw-r--r--strings/ctype-ujis.c44
-rw-r--r--strings/ctype-win1250ch.c3
-rw-r--r--strings/xml.c2
-rw-r--r--support-files/my-innodb-heavy-4G.cnf.sh2
-rw-r--r--tests/client_test.c168
-rw-r--r--vio/test-sslserver.c7
387 files changed, 9889 insertions, 30335 deletions
diff --git a/.bzrignore b/.bzrignore
index 0d5a8647198..4af6fdbbe88 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -104,6 +104,7 @@ PENDING/*
TAGS
ac_available_languages_fragment
aclocal.m4
+analyse.test
autom4te-2.53.cache/*
autom4te-2.53.cache/output.0
autom4te-2.53.cache/requests
@@ -260,6 +261,7 @@ client/mf_iocache.c
client/mf_iocache.cc
client/mysql
client/mysqladmin
+client/mysqladmin.c
client/mysqlbinlog
client/mysqlcheck
client/mysqldump
@@ -300,14 +302,17 @@ depcomp
emacs.h
extra/charset2html
extra/comp_err
+extra/created_include_files
extra/my_print_defaults
extra/mysql_install
extra/mysql_tzinfo_to_sql
extra/mysql_waitpid
+extra/mysqld_error.h
extra/perror
extra/replace
extra/resolve_stack_dump
extra/resolveip
+extra/sql_state.h
extra/tztime.cc
fcns.c
fcns.h
@@ -538,6 +543,7 @@ myisam/test2.MYD
myisam/test2.MYI
mysql-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
mysql-4.0.2-alpha.tar.gz
+mysql-4.1.8-win-src.zip
mysql-5.0.2-alpha.tar.gz
mysql-max-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
mysql-test/gmon.out
@@ -983,6 +989,3 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslserver
vio/viotest-ssl
-extra/mysqld_error.h
-extra/sql_state.h
-extra/created_include_files
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index b9e4478dd1a..bbf039b8139 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -44,6 +44,7 @@ dlenev@jabberwock.localdomain
dlenev@mysql.com
ejonore@mc03.ndb.mysql.com
georg@beethoven.local
+georg@beethoven.site
gerberb@ou800.zenez.com
gluh@gluh.(none)
gluh@gluh.mysql.r18.ru
@@ -112,6 +113,7 @@ magnus@shellback.(none)
marko@hundin.mysql.fi
marty@shark.
mats@mysql.com
+matt@booty.(none)
matt@mysql.com
matthias@three.local.lan
miguel@hegel.(none)
@@ -168,6 +170,7 @@ papa@gbichot.local
patg@krsna.patg.net
patg@patrick-galbraiths-computer.local
paul@central.snake.net
+paul@frost.snake.net
paul@ice.local
paul@ice.snake.net
paul@kite-hub.kitebird.com
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile
index f8e91efd70d..78dcd634f7c 100755
--- a/Build-tools/Do-compile
+++ b/Build-tools/Do-compile
@@ -10,8 +10,8 @@ use Sys::Hostname;
$opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env="";
$opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix="";
$opt_tmp=$opt_version_suffix="";
-$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
-$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0;
+$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_csv=$opt_with_example=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
+$opt_embedded_test=$opt_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0;
GetOptions(
"bdb",
@@ -25,6 +25,7 @@ GetOptions(
"delete",
"distribution=s",
"enable-shared",
+ "embedded-test",
"fast-benchmark",
"help|Information",
"innodb",
@@ -40,6 +41,7 @@ GetOptions(
"one-error",
"perl-files=s",
"perl-options=s",
+ "ps-test",
"raid",
"readline",
"stage=i",
@@ -55,6 +57,8 @@ GetOptions(
"version-suffix=s",
"with-archive",
"with-cluster",
+ "with-csv",
+ "with-example",
"with-debug",
"with-low-memory",
"with-other-libc=s",
@@ -274,8 +278,11 @@ if ($opt_stage <= 1)
$opt_config_options.= " --with-libedit";
}
$opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded);
+ $opt_embedded_test= 0 if ($opt_without_embedded);
$opt_config_options.= " --with-archive-storage-engine" if ($opt_with_archive);
$opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster);
+ $opt_config_options.= " --with-csv-storage-engine" if ($opt_with_csv);
+ $opt_config_options.= " --with-example-storage-engine" if ($opt_with_example);
# Only enable InnoDB when requested (required to be able to
# build the "Classic" packages that do not include InnoDB)
@@ -376,13 +383,29 @@ $ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" .
if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
{
my $flags= "";
- my $force= "";
$flags.= " --with-ndbcluster" if ($opt_with_cluster);
$flags.= " --force" if (!$opt_one_error);
log_timestamp();
+ info("Running test suite");
system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
safe_cd("${test_dir}/mysql-test");
check_system("./mysql-test-run $flags --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
+
+ if ($opt_ps_test)
+ {
+ log_timestamp();
+ info("Running test suite using prepared statements");
+ check_system("./mysql-test-run $flags --ps-protocol --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
+ }
+
+ if ($opt_embedded_test)
+ {
+ log_timestamp();
+ info("Running embedded server test suite");
+ # Embedded server and NDB don't jive
+ $flags=~ s/ --with-ndbcluster//;
+ check_system("./mysql-test-run $flags --embedded-server --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
+ }
# 'mysql-test-run' writes its own final message for log evaluation.
}
@@ -528,6 +551,9 @@ Delete the distribution file.
--distribution=<distribution_file>
Name of the MySQL source distribution file.
+--embedded-test
+Run the test suite against the embedded server
+
--enable-shared
Compile with shared libraries
@@ -576,6 +602,9 @@ Compile and install the given perl modules.
--perl-options=<options>
Build Perl modules with the additional options
+--ps-test
+Run an additional test run, using prepared statements
+
--raid
Compile with RAID support
@@ -612,11 +641,17 @@ If user is empty then no mail is sent.
Set name suffix (e.g. 'com' or '-max') for a distribution
--with archive
-Enable the Archive storage Engine
+Enable the Archive storage engine
--with cluster
Compile and test with NDB Cluster enabled
+--with-csv
+Enable the CSV storage engine
+
+--with-example
+Enable the Example storage engine
+
--with-debug
Build binaries with debug information (implies "--no-strip")
diff --git a/Makefile.am b/Makefile.am
index 8c643c8a484..56c52824071 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -100,7 +100,7 @@ tags:
# Test installation
test:
- cd mysql-test ; ./mysql-test-run
+ cd mysql-test; ./mysql-test-run && ./mysql-test-run --ps-protocol
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/VC++Files/client/mysqltest.dsp b/VC++Files/client/mysqltest.dsp
index badd61a70b9..1f1613026a9 100644
--- a/VC++Files/client/mysqltest.dsp
+++ b/VC++Files/client/mysqltest.dsp
@@ -42,8 +42,8 @@ RSC=rc.exe
# PROP Output_Dir ".\debug"
# PROP Intermediate_Dir ".\debug"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "USE_TLS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
-# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "USE_TLS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
+# ADD BASE CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
+# ADD CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD BASE MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
# ADD MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
# ADD BASE RSC /l 1033 /d "_DEBUG"
@@ -52,8 +52,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib mysys.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib mysys.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
!ELSEIF "$(CFG)" == "mysqltest - Win32 classic"
@@ -77,8 +77,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
!ELSEIF "$(CFG)" == "mysqltest - Win32 Release"
@@ -102,8 +102,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
!ENDIF
diff --git a/VC++Files/mysql-test/mysql_test_run_new.dsp b/VC++Files/mysql-test/mysql_test_run_new.dsp
index bbdabb98a37..7e43da20b26 100644
--- a/VC++Files/mysql-test/mysql_test_run_new.dsp
+++ b/VC++Files/mysql-test/mysql_test_run_new.dsp
@@ -2,7 +2,7 @@
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
-# TARGTYPE "Win32 (x86) Application" 0x0101
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=mysql_test_run_new - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
@@ -17,8 +17,8 @@ CFG=mysql_test_run_new - Win32 Debug
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
-!MESSAGE "mysql_test_run_new - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE "mysql_test_run_new - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "mysql_test_run_new - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysql_test_run_new - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -33,51 +33,51 @@ RSC=rc.exe
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Output_Dir ".\Debug"
+# PROP BASE Intermediate_Dir ".\Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
+# PROP Output_Dir ".\Debug"
+# PROP Intermediate_Dir ".\Debug"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\debug/mysql_test_run.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
-# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\debug/mysql_test_run.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
-# ADD BASE MTL /nologo /win32
-# ADD MTL /nologo /win32
+# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
+# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
+# ADD BASE MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32
+# ADD MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32
# ADD BASE RSC /l 1033
# ADD RSC /l 1033
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /debug /pdb:".\debug\mysql_test_run_new.pdb" /pdbtype:sept /map /mapinfo:exports /subsystem:windows
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /debug /pdb:".\debug\mysql_test_run_new.pdb" /pdbtype:sept /map /mapinfo:exports /subsystem:windows
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console
!ELSEIF "$(CFG)" == "mysql_test_run_new - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Output_Dir ".\Release"
+# PROP BASE Intermediate_Dir ".\Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
+# PROP Output_Dir ".\Release"
+# PROP Intermediate_Dir ".\Release"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fo".\release/" /Fd".\release/" /c /GX
-# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fo".\release/" /Fd".\release/" /c /GX
-# ADD BASE MTL /nologo /win32
-# ADD MTL /nologo /win32
+# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
+# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
+# ADD BASE MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32
+# ADD MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32
# ADD BASE RSC /l 1033
# ADD RSC /l 1033
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /pdbtype:sept /subsystem:windows
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /pdbtype:sept /subsystem:windows
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows
!ENDIF
@@ -87,19 +87,19 @@ LINK32=link.exe
# Name "mysql_test_run_new - Win32 Release"
# Begin Source File
-SOURCE=my_create_tables.c
+SOURCE=.\my_create_tables.c
# End Source File
# Begin Source File
-SOURCE=my_manage.c
+SOURCE=.\my_manage.c
# End Source File
# Begin Source File
-SOURCE=my_manage.h
+SOURCE=.\my_manage.h
# End Source File
# Begin Source File
-SOURCE=mysql_test_run_new.c
+SOURCE=.\mysql_test_run_new.c
# End Source File
# End Target
# End Project
diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw
index 222b09c3d80..0ce2acfed23 100644
--- a/VC++Files/mysql.dsw
+++ b/VC++Files/mysql.dsw
@@ -824,11 +824,20 @@ Package=<5>
Package=<4>
{{{
+ Begin Project Dependency
+ Project_Dep_Name libmysql
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name mysys
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name regex
+ End Project Dependency
}}}
###############################################################################
-Project: "mysql_test_run_new"=.\mysql-test\mysql_test_run_new.dsp - Package Owner=<4>
+Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -836,6 +845,12 @@ Package=<5>
Package=<4>
{{{
+ Begin Project Dependency
+ Project_Dep_Name mysqltest
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name mysqladmin
+ End Project Dependency
}}}
###############################################################################
diff --git a/VC++Files/mysqlmanager/README.TXT b/VC++Files/mysqlmanager/README.TXT
deleted file mode 100644
index cdd54c2cba8..00000000000
--- a/VC++Files/mysqlmanager/README.TXT
+++ /dev/null
@@ -1,102 +0,0 @@
-========================================================================
- MICROSOFT FOUNDATION CLASS LIBRARY : MySqlManager
-========================================================================
-
-
-AppWizard has created this MySqlManager application for you. This application
-not only demonstrates the basics of using the Microsoft Foundation classes
-but is also a starting point for writing your application.
-
-This file contains a summary of what you will find in each of the files that
-make up your MySqlManager application.
-
-MySqlManager.h
- This is the main header file for the application. It includes other
- project specific headers (including Resource.h) and declares the
- CMySqlManagerApp application class.
-
-MySqlManager.cpp
- This is the main application source file that contains the application
- class CMySqlManagerApp.
-
-MySqlManager.rc
- This is a listing of all of the Microsoft Windows resources that the
- program uses. It includes the icons, bitmaps, and cursors that are stored
- in the RES subdirectory. This file can be directly edited in Microsoft
- Developer Studio.
-
-res\MySqlManager.ico
- This is an icon file, which is used as the application's icon. This
- icon is included by the main resource file MySqlManager.rc.
-
-res\MySqlManager.rc2
- This file contains resources that are not edited by Microsoft
- Developer Studio. You should place all resources not
- editable by the resource editor in this file.
-
-MySqlManager.clw
- This file contains information used by ClassWizard to edit existing
- classes or add new classes. ClassWizard also uses this file to store
- information needed to create and edit message maps and dialog data
- maps and to create prototype member functions.
-
-/////////////////////////////////////////////////////////////////////////////
-
-For the main frame window:
-
-MainFrm.h, MainFrm.cpp
- These files contain the frame class CMainFrame, which is derived from
- CMDIFrameWnd and controls all MDI frame features.
-
-res\Toolbar.bmp
- This bitmap file is used to create tiled images for the toolbar.
- The initial toolbar and status bar are constructed in the
- CMainFrame class. Edit this toolbar bitmap along with the
- array in MainFrm.cpp to add more toolbar buttons.
-
-/////////////////////////////////////////////////////////////////////////////
-
-AppWizard creates one document type and one view:
-
-MySqlManagerDoc.h, MySqlManagerDoc.cpp - the document
- These files contain your CMySqlManagerDoc class. Edit these files to
- add your special document data and to implement file saving and loading
- (via CMySqlManagerDoc::Serialize).
-
-MySqlManagerView.h, MySqlManagerView.cpp - the view of the document
- These files contain your CMySqlManagerView class.
- CMySqlManagerView objects are used to view CMySqlManagerDoc objects.
-
-res\MySqlManagerDoc.ico
- This is an icon file, which is used as the icon for MDI child windows
- for the CMySqlManagerDoc class. This icon is included by the main
- resource file MySqlManager.rc.
-
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
- These files are used to build a precompiled header (PCH) file
- named MySqlManager.pch and a precompiled types file named StdAfx.obj.
-
-Resource.h
- This is the standard header file, which defines new resource IDs.
- Microsoft Developer Studio reads and updates this file.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" to indicate parts of the source code you
-should add to or customize.
-
-If your application uses MFC in a shared DLL, and your application is
-in a language other than the operating system's current language, you
-will need to copy the corresponding localized resources MFC40XXX.DLL
-from the Microsoft Visual C++ CD-ROM onto the system or system32 directory,
-and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation.
-For example, MFC40DEU.DLL contains resources translated to German.) If you
-don't do this, some of the UI elements of your application will remain in the
-language of the operating system.
-
-/////////////////////////////////////////////////////////////////////////////
diff --git a/VC++Files/mysqlmanager/RES/bitmap1.bmp b/VC++Files/mysqlmanager/RES/bitmap1.bmp
deleted file mode 100644
index 3751f1a6923..00000000000
--- a/VC++Files/mysqlmanager/RES/bitmap1.bmp
+++ /dev/null
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/bitmap3.bmp b/VC++Files/mysqlmanager/RES/bitmap3.bmp
deleted file mode 100644
index 3751f1a6923..00000000000
--- a/VC++Files/mysqlmanager/RES/bitmap3.bmp
+++ /dev/null
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/bmp00001.bmp b/VC++Files/mysqlmanager/RES/bmp00001.bmp
deleted file mode 100644
index e98e93d7850..00000000000
--- a/VC++Files/mysqlmanager/RES/bmp00001.bmp
+++ /dev/null
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/bmp00002.bmp b/VC++Files/mysqlmanager/RES/bmp00002.bmp
deleted file mode 100644
index 2f2c195a683..00000000000
--- a/VC++Files/mysqlmanager/RES/bmp00002.bmp
+++ /dev/null
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/database.bmp b/VC++Files/mysqlmanager/RES/database.bmp
deleted file mode 100644
index 2fc41313541..00000000000
--- a/VC++Files/mysqlmanager/RES/database.bmp
+++ /dev/null
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/fontd.bmp b/VC++Files/mysqlmanager/RES/fontd.bmp
deleted file mode 100644
index c77b4f4fdd0..00000000000
--- a/VC++Files/mysqlmanager/RES/fontd.bmp
+++ /dev/null
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/fontu.bmp b/VC++Files/mysqlmanager/RES/fontu.bmp
deleted file mode 100644
index c77b4f4fdd0..00000000000
--- a/VC++Files/mysqlmanager/RES/fontu.bmp
+++ /dev/null
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/mysqlmanager.ico b/VC++Files/mysqlmanager/RES/mysqlmanager.ico
deleted file mode 100644
index 7eef0bcbe65..00000000000
--- a/VC++Files/mysqlmanager/RES/mysqlmanager.ico
+++ /dev/null
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/mysqlmanager.rc2 b/VC++Files/mysqlmanager/RES/mysqlmanager.rc2
deleted file mode 100644
index 67d4f3f4a85..00000000000
--- a/VC++Files/mysqlmanager/RES/mysqlmanager.rc2
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// MYSQLMANAGER.RC2 - resources Microsoft Visual C++ does not edit directly
-//
-
-#ifdef APSTUDIO_INVOKED
- #error this file is not editable by Microsoft Visual C++
-#endif //APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Add manually edited resources here...
-
-/////////////////////////////////////////////////////////////////////////////
diff --git a/VC++Files/mysqlmanager/RES/mysqlmanagerdoc.ico b/VC++Files/mysqlmanager/RES/mysqlmanagerdoc.ico
deleted file mode 100644
index 2a1f1ae6ef1..00000000000
--- a/VC++Files/mysqlmanager/RES/mysqlmanagerdoc.ico
+++ /dev/null
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/query_ex.bmp b/VC++Files/mysqlmanager/RES/query_ex.bmp
deleted file mode 100644
index cc77222decc..00000000000
--- a/VC++Files/mysqlmanager/RES/query_ex.bmp
+++ /dev/null
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/toolbar.bmp b/VC++Files/mysqlmanager/RES/toolbar.bmp
deleted file mode 100644
index d501723c1ce..00000000000
--- a/VC++Files/mysqlmanager/RES/toolbar.bmp
+++ /dev/null
Binary files differ
diff --git a/VC++Files/mysqlmanager/childfrm.cpp b/VC++Files/mysqlmanager/childfrm.cpp
deleted file mode 100644
index 08027e068ac..00000000000
--- a/VC++Files/mysqlmanager/childfrm.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-// ChildFrm.cpp : implementation of the CChildFrame class
-//
-
-#include "stdafx.h"
-#include "MySqlManager.h"
-
-#include "ChildFrm.h"
-
-#ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CChildFrame
-
-IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
-
-BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
-//{{AFX_MSG_MAP(CChildFrame)
-// NOTE - the ClassWizard will add and remove mapping macros here.
-// DO NOT EDIT what you see in these blocks of generated code !
-//}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CChildFrame construction/destruction
-
-CChildFrame::CChildFrame()
-{
- // TODO: add member initialization code here
-
-}
-
-CChildFrame::~CChildFrame()
-{
-}
-
-BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
-{
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
-
- return CMDIChildWnd::PreCreateWindow(cs);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CChildFrame diagnostics
-
-#ifdef _DEBUG
-void CChildFrame::AssertValid() const
-{
- CMDIChildWnd::AssertValid();
-}
-
-void CChildFrame::Dump(CDumpContext& dc) const
-{
- CMDIChildWnd::Dump(dc);
-}
-
-#endif //_DEBUG
-
-/////////////////////////////////////////////////////////////////////////////
-// CChildFrame message handlers
diff --git a/VC++Files/mysqlmanager/childfrm.h b/VC++Files/mysqlmanager/childfrm.h
deleted file mode 100644
index 3075be58a67..00000000000
--- a/VC++Files/mysqlmanager/childfrm.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// ChildFrm.h : interface of the CChildFrame class
-//
-/////////////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_CHILDFRM_H__826CB2F0_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
-#define AFX_CHILDFRM_H__826CB2F0_8B6D_11D1_AEC1_00600806E071__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-class CChildFrame : public CMDIChildWnd
-{
- DECLARE_DYNCREATE(CChildFrame)
-public:
- CChildFrame();
-
-// Attributes
-public:
-
-// Operations
-public:
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CChildFrame)
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- //}}AFX_VIRTUAL
-
-// Implementation
-public:
- virtual ~CChildFrame();
-#ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
-#endif
-
-// Generated message map functions
-protected:
- //{{AFX_MSG(CChildFrame)
- // NOTE - the ClassWizard will add and remove member functions here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_CHILDFRM_H__826CB2F0_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
diff --git a/VC++Files/mysqlmanager/cresource.h b/VC++Files/mysqlmanager/cresource.h
deleted file mode 100644
index 37c1839d758..00000000000
--- a/VC++Files/mysqlmanager/cresource.h
+++ /dev/null
@@ -1,134 +0,0 @@
-#ifndef _CRESOURCE_H
-#define _CRESOURCE_H
-
-/////////////////////////////////////////////////////////////////////////////
-
-#define MYSQL_PORT_AS_STRING "3306" /* Can't use # in preprocessor because of bugs in VC++ 5.0 */
-
-class CResource
-{
-public:
- enum eRESOURCETYPE
- {
- eNone
- , eServer
- , eDatabase
- , eTable
- , eField
- , eProcesslist
- , eProcesslistItem
- };
- virtual LPCTSTR GetDisplayName() { return ""; }
- virtual LPCTSTR GetHostName() { return LOCAL_HOST; }
- virtual LPCTSTR GetUserName() { return "root"; }
- virtual LPCTSTR GetPassword() { return ""; }
- virtual LPCTSTR GetPortName() { return MYSQL_PORT_AS_STRING; }
- virtual int GetPortNumber() { return MYSQL_PORT; }
- virtual eRESOURCETYPE GetType() { return eNone; }
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CResourceServer : public CResource
-{
-public:
- CResourceServer(LPCTSTR pszName = "",LPCTSTR pszHost = LOCAL_HOST ,LPCTSTR pszUser = "root", LPCTSTR pszPassword = "", LPCTSTR pszPort = MYSQL_PORT_AS_STRING)
- : m_strName(pszName)
- , m_strHost(pszHost)
- , m_strUser(pszUser)
- , m_strPassword(pszPassword)
- , m_strPort(pszPort)
- {
- }
- virtual LPCTSTR GetDisplayName() { return m_strName; }
- virtual LPCTSTR GetHostName() { return m_strHost; }
- virtual LPCTSTR GetUserName() { return m_strUser; }
- virtual LPCTSTR GetPassword() { return m_strPassword; }
- virtual eRESOURCETYPE GetType() { return eServer; }
- virtual LPCTSTR GetPortName() { return m_strPort; }
- virtual int GetPortNumber() { return atoi(m_strPort); }
- CString m_strName;
- CString m_strHost;
- CString m_strUser;
- CString m_strPassword;
- CString m_strPort;
- CStringArray m_rgFields;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CResourceDatabase : public CResource
-{
-public:
- CResourceDatabase(LPCTSTR pszName = "")
- : m_strName(pszName)
- {
- }
- virtual LPCTSTR GetDisplayName() { return m_strName; }
- virtual eRESOURCETYPE GetType() { return eDatabase; }
- CString m_strName;
- CStringArray m_rgFields;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CResourceTable : public CResource
-{
-public:
- CResourceTable(LPCTSTR pszName = "")
- : m_strName(pszName)
- {
- }
- virtual LPCTSTR GetDisplayName() { return m_strName; }
- virtual eRESOURCETYPE GetType() { return eTable; }
- CString m_strName;
- CStringArray m_rgFields;
-};
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CResourceField : public CResource
-{
-public:
- CResourceField(LPCTSTR pszName = "")
- : m_strName(pszName)
- {
- }
- virtual LPCTSTR GetDisplayName() { return m_strName; }
- virtual eRESOURCETYPE GetType() { return eField; }
- CString m_strName;
- CStringArray m_rgFields;
-};
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CResourceProcesslist : public CResource
-{
-public:
- CResourceProcesslist(LPCTSTR pszName = "Processlist")
- : m_strName(pszName)
- {
- }
- virtual LPCTSTR GetDisplayName() { return m_strName; }
- virtual eRESOURCETYPE GetType() { return eProcesslist; }
- CString m_strName;
- CStringArray m_rgFields;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CResourceProcesslistItem : public CResourceProcesslist
-{
-public:
- CResourceProcesslistItem(LPCTSTR pszName = "ProcesslistItem")
- : CResourceProcesslist(pszName)
- {
- }
- virtual eRESOURCETYPE GetType() { return eProcesslistItem; }
-};
-
-
-#endif
diff --git a/VC++Files/mysqlmanager/mainfrm.cpp b/VC++Files/mysqlmanager/mainfrm.cpp
deleted file mode 100644
index 499704ed2a0..00000000000
--- a/VC++Files/mysqlmanager/mainfrm.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-// MainFrm.cpp : implementation of the CMainFrame class
-//
-
-#include "stdafx.h"
-#include "MySqlManager.h"
-#include "MainFrm.h"
-
-CMainFrame* CMainFrame::g_pMainFrame = NULL;
-
-#ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame
-
-IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
-
-BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
-//{{AFX_MSG_MAP(CMainFrame)
-// NOTE - the ClassWizard will add and remove mapping macros here.
-// DO NOT EDIT what you see in these blocks of generated code !
- ON_WM_CREATE()
-//}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-static UINT indicators[] =
-{
- ID_SEPARATOR, // status line indicator
- ID_INDICATOR_CAPS,
- ID_INDICATOR_NUM,
- ID_INDICATOR_SCRL,
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame construction/destruction
-
-CMainFrame::CMainFrame()
-{
- // TODO: add member initialization code here
-
-}
-
-CMainFrame::~CMainFrame()
-{
-}
-
-int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
- if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
-
- if (!m_wndToolBar.Create(this) ||
- !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
- {
- TRACE0("Failed to create toolbar\n");
- return -1; // fail to create
- }
-
- if (!m_wndStatusBar.Create(this) ||
- !m_wndStatusBar.SetIndicators(indicators,
- sizeof(indicators)/sizeof(UINT)))
- {
- TRACE0("Failed to create status bar\n");
- return -1; // fail to create
- }
-
- // TODO: Remove this if you don't want tool tips or a resizeable toolbar
- m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
- CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
-
- // TODO: Delete these three lines if you don't want the toolbar to
- // be dockable
- m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
- EnableDocking(CBRS_ALIGN_ANY);
- DockControlBar(&m_wndToolBar);
-
- return 0;
-}
-
-BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
-{
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
-
- return CMDIFrameWnd::PreCreateWindow(cs);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame diagnostics
-
-#ifdef _DEBUG
-void CMainFrame::AssertValid() const
-{
- CMDIFrameWnd::AssertValid();
-}
-
-void CMainFrame::Dump(CDumpContext& dc) const
-{
- CMDIFrameWnd::Dump(dc);
-}
-
-#endif //_DEBUG
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame message handlers
-
-int CMainFrame::StatusMsg ( LPCSTR fmt, ... )
-
-{
-
- char buf [2048];
- va_list args;
- va_start(args, fmt);
- int ret = vsprintf(buf, fmt, args);
-
- if ( this != NULL )
- {
- static char g_StatusMsg_Buffer_TT [ 2048 ];
- memcpy ( g_StatusMsg_Buffer_TT, buf, sizeof(g_StatusMsg_Buffer_TT) );
- m_wndStatusBar.SetPaneText ( 0, buf );
- m_wndStatusBar.UpdateWindow ();
- }
-
- va_end(args);
- return ( ret );
-
-}
-
-
-BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
-{
- g_pMainFrame = this;
- return CMDIFrameWnd::OnCreateClient(lpcs, pContext);
-}
diff --git a/VC++Files/mysqlmanager/mainfrm.h b/VC++Files/mysqlmanager/mainfrm.h
deleted file mode 100644
index 06c51965bb1..00000000000
--- a/VC++Files/mysqlmanager/mainfrm.h
+++ /dev/null
@@ -1,69 +0,0 @@
-// MainFrm.h : interface of the CMainFrame class
-//
-/////////////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_MAINFRM_H__826CB2EE_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
-#define AFX_MAINFRM_H__826CB2EE_8B6D_11D1_AEC1_00600806E071__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-class CMainFrame : public CMDIFrameWnd
-{
- DECLARE_DYNAMIC(CMainFrame)
-public:
- CMainFrame();
-
-// Attributes
-public:
-
-// Operations
-public:
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMainFrame)
- public:
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- protected:
- virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
- //}}AFX_VIRTUAL
-
-// Implementation
-public:
- virtual ~CMainFrame();
-#ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
-#endif
-
- int StatusMsg ( LPCSTR fmt, ... );
-
-protected: // control bar embedded members
- CStatusBar m_wndStatusBar;
- CToolBar m_wndToolBar;
-
-// Generated message map functions
-protected:
- //{{AFX_MSG(CMainFrame)
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- // NOTE - the ClassWizard will add and remove member functions here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
-public:
-
-static CMainFrame* g_pMainFrame;
-
-};
-
-#define MainFrame ( CMainFrame::g_pMainFrame ? CMainFrame::g_pMainFrame : (CMainFrame*) AfxGetMainWnd() -> GetTopLevelFrame() )
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_MAINFRM_H__826CB2EE_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
diff --git a/VC++Files/mysqlmanager/mysqlmanager.cpp b/VC++Files/mysqlmanager/mysqlmanager.cpp
deleted file mode 100644
index 09a19181e22..00000000000
--- a/VC++Files/mysqlmanager/mysqlmanager.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-// MySqlManager.cpp : Defines the class behaviors for the application.
-//
-
-#include "stdafx.h"
-#include "MySqlManager.h"
-
-#include "MainFrm.h"
-#include "ChildFrm.h"
-#include "MySqlManagerDoc.h"
-#include "MySqlManagerView.h"
-
-#ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CMySqlManagerApp
-
-BEGIN_MESSAGE_MAP(CMySqlManagerApp, CWinApp)
-//{{AFX_MSG_MAP(CMySqlManagerApp)
- ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
-// NOTE - the ClassWizard will add and remove mapping macros here.
-// DO NOT EDIT what you see in these blocks of generated code!
-//}}AFX_MSG_MAP
-// Standard file based document commands
- ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
- ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
-// Standard print setup command
- ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CMySqlManagerApp construction
-
-CMySqlManagerApp::CMySqlManagerApp()
-{
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// The one and only CMySqlManagerApp object
-
-CMySqlManagerApp theApp;
-
-/////////////////////////////////////////////////////////////////////////////
-// CMySqlManagerApp initialization
-
-BOOL CMySqlManagerApp::InitInstance()
-{
-
- WSADATA WsaData;
-
- if (SOCKET_ERROR == WSAStartup (0x0101, &WsaData))
- {
- AfxMessageBox("WSAStartup Failed\n");
- return FALSE;
- }
-
- AfxEnableControlContainer();
-
- // Standard initialization
- // If you are not using these features and wish to reduce the size
- // of your final executable, you should remove from the following
- // the specific initialization routines you do not need.
-
-#ifdef _AFXDLL
- Enable3dControls(); // Call this when using MFC in a shared DLL
-#else
- Enable3dControlsStatic(); // Call this when linking to MFC statically
-#endif
-
- // Change the registry key under which our settings are stored.
- // You should modify this string to be something appropriate
- // such as the name of your company or organization.
- SetRegistryKey(_T("Local AppWizard-Generated Applications"));
-
- LoadStdProfileSettings(); // Load standard INI file options (including MRU)
-
- // Register the application's document templates. Document templates
- // serve as the connection between documents, frame windows and views.
-
- CMultiDocTemplate* pDocTemplate;
- pDocTemplate = new CMultiDocTemplate(
- IDR_MYSQLMTYPE,
- RUNTIME_CLASS(CMySqlManagerDoc),
- RUNTIME_CLASS(CChildFrame), // custom MDI child frame
- RUNTIME_CLASS(CMySqlManagerView));
- AddDocTemplate(pDocTemplate);
-
- // create main MDI Frame window
- CMainFrame* pMainFrame = new CMainFrame;
- if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
- return FALSE;
- m_pMainWnd = pMainFrame;
-
- // Parse command line for standard shell commands, DDE, file open
- CCommandLineInfo cmdInfo;
- ParseCommandLine(cmdInfo);
-
- // Dispatch commands specified on the command line
- if (!ProcessShellCommand(cmdInfo))
- return FALSE;
-
- // The main window has been initialized, so show and update it.
- pMainFrame->ShowWindow(m_nCmdShow);
- pMainFrame->UpdateWindow();
-
- return TRUE;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CAboutDlg dialog used for App About
-
-class CAboutDlg : public CDialog
-{
-public:
- CAboutDlg();
-
-// Dialog Data
- //{{AFX_DATA(CAboutDlg)
- enum {IDD = IDD_ABOUTBOX};
- //}}AFX_DATA
-
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CAboutDlg)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
- //{{AFX_MSG(CAboutDlg)
- // No message handlers
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
-{
- //{{AFX_DATA_INIT(CAboutDlg)
- //}}AFX_DATA_INIT
-}
-
-void CAboutDlg::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CAboutDlg)
- //}}AFX_DATA_MAP
-}
-
-BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
-//{{AFX_MSG_MAP(CAboutDlg)
-// No message handlers
-//}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-// App command to run the dialog
-void CMySqlManagerApp::OnAppAbout()
-{
- CAboutDlg aboutDlg;
- aboutDlg.DoModal();
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CMySqlManagerApp commands
diff --git a/VC++Files/mysqlmanager/mysqlmanager.dsp b/VC++Files/mysqlmanager/mysqlmanager.dsp
deleted file mode 100644
index 7f92e091904..00000000000
--- a/VC++Files/mysqlmanager/mysqlmanager.dsp
+++ /dev/null
@@ -1,277 +0,0 @@
-# Microsoft Developer Studio Project File - Name="MySqlManager" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Application" 0x0101
-
-CFG=MySqlManager - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "MySqlManager.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "MySqlManager.mak" CFG="MySqlManager - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "MySqlManager - Win32 Release" (based on "Win32 (x86) Application")
-!MESSAGE "MySqlManager - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=xicl6.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "MySqlManager - Win32 Release"
-
-# PROP BASE Use_MFC 6
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 6
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "release"
-# PROP Intermediate_Dir "release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /WX /Fr /YX /Yc /Yu
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
-# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
-# ADD LINK32 /nologo /subsystem:windows /machine:I386 /out:"../client_release/MySqlManager.exe"
-# SUBTRACT LINK32 /nodefaultlib
-
-!ELSEIF "$(CFG)" == "MySqlManager - Win32 Debug"
-
-# PROP BASE Use_MFC 6
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 6
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "debug"
-# PROP Intermediate_Dir "debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /GR /GX /Z7 /Od /I "../include" /D "_DEBUG" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /Fr /YX /Yc /Yu
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
-# ADD MTL /nologo /D "_DEBUG" /o "NUL" /win32
-# SUBTRACT MTL /mktyplib203
-# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /incremental:no /debug /machine:I386 /out:"../client_debug/MySqlManager.exe" /pdbtype:sept /libpath:"..\lib_debug\\"
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF
-
-# Begin Target
-
-# Name "MySqlManager - Win32 Release"
-# Name "MySqlManager - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\ChildFrm.cpp
-# End Source File
-# Begin Source File
-
-SOURCE="..\strings\ctype-extra.c"
-# End Source File
-# Begin Source File
-
-SOURCE="..\strings\ctype-latin1.c"
-# End Source File
-# Begin Source File
-
-SOURCE="..\strings\ctype-mb.c"
-# End Source File
-# Begin Source File
-
-SOURCE=..\strings\is_prefix.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\MainFrm.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\mysys\my_sleep.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\strings\my_vsnprintf.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\MySqlManager.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\MySqlManager.rc
-# End Source File
-# Begin Source File
-
-SOURCE=.\MySqlManagerDoc.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\MySqlManagerView.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\RegisterServer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\StdAfx.cpp
-# ADD CPP /Yc"stdafx.h"
-# End Source File
-# Begin Source File
-
-SOURCE=.\ToolSql.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ToolSqlQuery.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ToolSqlResults.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ToolSqlStatus.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\ChildFrm.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\MainFrm.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\MySqlManager.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\MySqlManagerDoc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\MySqlManagerView.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\RegisterServer.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Resource.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\StdAfx.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\ToolSqlQuery.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\ToolSqlResults.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\ToolSqlStatus.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=.\res\bitmap1.bmp
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\bitmap3.bmp
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\bmp00001.bmp
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\bmp00002.bmp
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\database.bmp
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\fontd.bmp
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\fontu.bmp
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\MySqlManager.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\MySqlManager.rc2
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\MySqlManagerDoc.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\query_ex.bmp
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\Toolbar.bmp
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\ReadMe.txt
-# End Source File
-# End Target
-# End Project
diff --git a/VC++Files/mysqlmanager/mysqlmanager.dsw b/VC++Files/mysqlmanager/mysqlmanager.dsw
deleted file mode 100644
index 013873b113b..00000000000
--- a/VC++Files/mysqlmanager/mysqlmanager.dsw
+++ /dev/null
@@ -1,28 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 5.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "MySqlManager"=.\MySqlManager.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
diff --git a/VC++Files/mysqlmanager/mysqlmanager.h b/VC++Files/mysqlmanager/mysqlmanager.h
deleted file mode 100644
index accb63a908f..00000000000
--- a/VC++Files/mysqlmanager/mysqlmanager.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// MySqlManager.h : main header file for the MYSQLMANAGER application
-//
-
-#if !defined(AFX_MYSQLMANAGER_H__826CB2EA_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
-#define AFX_MYSQLMANAGER_H__826CB2EA_8B6D_11D1_AEC1_00600806E071__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-#ifndef __AFXWIN_H__
- #error include 'stdafx.h' before including this file for PCH
-#endif
-
-#include "resource.h" // main symbols
-
-/////////////////////////////////////////////////////////////////////////////
-// CMySqlManagerApp:
-// See MySqlManager.cpp for the implementation of this class
-//
-
-class CMySqlManagerApp : public CWinApp
-{
-public:
- CMySqlManagerApp();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMySqlManagerApp)
- public:
- virtual BOOL InitInstance();
- //}}AFX_VIRTUAL
-
-// Implementation
-
- //{{AFX_MSG(CMySqlManagerApp)
- afx_msg void OnAppAbout();
- // NOTE - the ClassWizard will add and remove member functions here.
- // DO NOT EDIT what you see in these blocks of generated code !
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_MYSQLMANAGER_H__826CB2EA_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
diff --git a/VC++Files/mysqlmanager/mysqlmanager.mak b/VC++Files/mysqlmanager/mysqlmanager.mak
deleted file mode 100644
index b372daa52f2..00000000000
--- a/VC++Files/mysqlmanager/mysqlmanager.mak
+++ /dev/null
@@ -1,327 +0,0 @@
-# Microsoft Developer Studio Generated NMAKE File, Based on MySqlManager.dsp
-!IF "$(CFG)" == ""
-CFG=MySqlManager - Win32 Debug
-!MESSAGE No configuration specified. Defaulting to MySqlManager - Win32 Debug.
-!ENDIF
-
-!IF "$(CFG)" != "MySqlManager - Win32 Release" && "$(CFG)" != "MySqlManager - Win32 Debug"
-!MESSAGE Invalid configuration "$(CFG)" specified.
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "MySqlManager.mak" CFG="MySqlManager - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "MySqlManager - Win32 Release" (based on "Win32 (x86) Application")
-!MESSAGE "MySqlManager - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE
-!ERROR An invalid configuration is specified.
-!ENDIF
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE
-NULL=nul
-!ENDIF
-
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "MySqlManager - Win32 Release"
-
-OUTDIR=.\release
-INTDIR=.\release
-# Begin Custom Macros
-OutDir=.\release
-# End Custom Macros
-
-!IF "$(RECURSE)" == "0"
-
-ALL : "..\client_release\MySqlManager.exe" "$(OUTDIR)\MySqlManager.pch"
-
-!ELSE
-
-ALL : "mysqlclient - Win32 Release" "..\client_release\MySqlManager.exe" "$(OUTDIR)\MySqlManager.pch"
-
-!ENDIF
-
-!IF "$(RECURSE)" == "1"
-CLEAN :"mysqlclient - Win32 ReleaseCLEAN"
-!ELSE
-CLEAN :
-!ENDIF
- -@erase "$(INTDIR)\ChildFrm.obj"
- -@erase "$(INTDIR)\MainFrm.obj"
- -@erase "$(INTDIR)\MySqlManager.obj"
- -@erase "$(INTDIR)\MySqlManager.pch"
- -@erase "$(INTDIR)\MySqlManager.res"
- -@erase "$(INTDIR)\MySqlManagerDoc.obj"
- -@erase "$(INTDIR)\MySqlManagerView.obj"
- -@erase "$(INTDIR)\RegisterServer.obj"
- -@erase "$(INTDIR)\StdAfx.obj"
- -@erase "$(INTDIR)\ToolSql.obj"
- -@erase "$(INTDIR)\ToolSqlQuery.obj"
- -@erase "$(INTDIR)\ToolSqlResults.obj"
- -@erase "$(INTDIR)\ToolSqlStatus.obj"
- -@erase "$(INTDIR)\vc60.idb"
- -@erase "..\client_release\MySqlManager.exe"
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP_PROJ=/nologo /G6 /MT /W3 /GX /O1 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
-RSC_PROJ=/l 0x409 /fo"$(INTDIR)\MySqlManager.res" /d "NDEBUG" /d "_AFXDLL"
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\MySqlManager.bsc"
-BSC32_SBRS= \
-
-LINK32=link.exe
-LINK32_FLAGS=/nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\MySqlManager.pdb" /machine:I386 /out:"../client_release/MySqlManager.exe"
-LINK32_OBJS= \
- "$(INTDIR)\ChildFrm.obj" \
- "$(INTDIR)\MainFrm.obj" \
- "$(INTDIR)\MySqlManager.obj" \
- "$(INTDIR)\MySqlManagerDoc.obj" \
- "$(INTDIR)\MySqlManagerView.obj" \
- "$(INTDIR)\RegisterServer.obj" \
- "$(INTDIR)\StdAfx.obj" \
- "$(INTDIR)\ToolSql.obj" \
- "$(INTDIR)\ToolSqlQuery.obj" \
- "$(INTDIR)\ToolSqlResults.obj" \
- "$(INTDIR)\ToolSqlStatus.obj" \
- "$(INTDIR)\MySqlManager.res" \
- "..\lib_release\mysqlclient.lib"
-
-"..\client_release\MySqlManager.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-
-!ELSEIF "$(CFG)" == "MySqlManager - Win32 Debug"
-
-OUTDIR=.\debug
-INTDIR=.\debug
-# Begin Custom Macros
-OutDir=.\debug
-# End Custom Macros
-
-!IF "$(RECURSE)" == "0"
-
-ALL : "..\client_debug\MySqlManager.exe" "$(OUTDIR)\MySqlManager.pch"
-
-!ELSE
-
-ALL : "mysqlclient - Win32 Debug" "..\client_debug\MySqlManager.exe" "$(OUTDIR)\MySqlManager.pch"
-
-!ENDIF
-
-!IF "$(RECURSE)" == "1"
-CLEAN :"mysqlclient - Win32 DebugCLEAN"
-!ELSE
-CLEAN :
-!ENDIF
- -@erase "$(INTDIR)\ChildFrm.obj"
- -@erase "$(INTDIR)\MainFrm.obj"
- -@erase "$(INTDIR)\MySqlManager.obj"
- -@erase "$(INTDIR)\MySqlManager.pch"
- -@erase "$(INTDIR)\MySqlManager.res"
- -@erase "$(INTDIR)\MySqlManagerDoc.obj"
- -@erase "$(INTDIR)\MySqlManagerView.obj"
- -@erase "$(INTDIR)\RegisterServer.obj"
- -@erase "$(INTDIR)\StdAfx.obj"
- -@erase "$(INTDIR)\ToolSql.obj"
- -@erase "$(INTDIR)\ToolSqlQuery.obj"
- -@erase "$(INTDIR)\ToolSqlResults.obj"
- -@erase "$(INTDIR)\ToolSqlStatus.obj"
- -@erase "$(INTDIR)\vc60.idb"
- -@erase "$(INTDIR)\vc60.pdb"
- -@erase "$(OUTDIR)\MySqlManager.pdb"
- -@erase "..\client_debug\MySqlManager.exe"
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP_PROJ=/nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../include" /D "_DEBUG" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-MTL_PROJ=/nologo /D "_DEBUG" /o "NUL" /win32
-RSC_PROJ=/l 0x409 /fo"$(INTDIR)\MySqlManager.res" /d "_DEBUG"
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\MySqlManager.bsc"
-BSC32_SBRS= \
-
-LINK32=link.exe
-LINK32_FLAGS=wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\MySqlManager.pdb" /debug /machine:I386 /out:"../client_debug/MySqlManager.exe" /pdbtype:sept /libpath:"..\lib_debug\\"
-LINK32_OBJS= \
- "$(INTDIR)\ChildFrm.obj" \
- "$(INTDIR)\MainFrm.obj" \
- "$(INTDIR)\MySqlManager.obj" \
- "$(INTDIR)\MySqlManagerDoc.obj" \
- "$(INTDIR)\MySqlManagerView.obj" \
- "$(INTDIR)\RegisterServer.obj" \
- "$(INTDIR)\StdAfx.obj" \
- "$(INTDIR)\ToolSql.obj" \
- "$(INTDIR)\ToolSqlQuery.obj" \
- "$(INTDIR)\ToolSqlResults.obj" \
- "$(INTDIR)\ToolSqlStatus.obj" \
- "$(INTDIR)\MySqlManager.res" \
- "..\lib_debug\mysqlclient.lib"
-
-"..\client_debug\MySqlManager.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-
-!ENDIF
-
-.c{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cpp{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cxx{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.c{$(INTDIR)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cpp{$(INTDIR)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cxx{$(INTDIR)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-
-!IF "$(NO_EXTERNAL_DEPS)" != "1"
-!IF EXISTS("MySqlManager.dep")
-!INCLUDE "MySqlManager.dep"
-!ELSE
-!MESSAGE Warning: cannot find "MySqlManager.dep"
-!ENDIF
-!ENDIF
-
-
-!IF "$(CFG)" == "MySqlManager - Win32 Release" || "$(CFG)" == "MySqlManager - Win32 Debug"
-SOURCE=.\ChildFrm.cpp
-
-"$(INTDIR)\ChildFrm.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\MainFrm.cpp
-
-"$(INTDIR)\MainFrm.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\MySqlManager.cpp
-
-"$(INTDIR)\MySqlManager.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\MySqlManager.rc
-
-"$(INTDIR)\MySqlManager.res" : $(SOURCE) "$(INTDIR)"
- $(RSC) $(RSC_PROJ) $(SOURCE)
-
-
-SOURCE=.\MySqlManagerDoc.cpp
-
-"$(INTDIR)\MySqlManagerDoc.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\MySqlManagerView.cpp
-
-"$(INTDIR)\MySqlManagerView.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\RegisterServer.cpp
-
-"$(INTDIR)\RegisterServer.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\StdAfx.cpp
-
-!IF "$(CFG)" == "MySqlManager - Win32 Release"
-
-CPP_SWITCHES=/nologo /G6 /MT /W3 /GX /O1 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /Fp"$(INTDIR)\MySqlManager.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-
-"$(INTDIR)\StdAfx.obj" "$(INTDIR)\MySqlManager.pch" : $(SOURCE) "$(INTDIR)"
- $(CPP) @<<
- $(CPP_SWITCHES) $(SOURCE)
-<<
-
-
-!ELSEIF "$(CFG)" == "MySqlManager - Win32 Debug"
-
-CPP_SWITCHES=/nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../include" /D "_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\MySqlManager.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-
-"$(INTDIR)\StdAfx.obj" "$(INTDIR)\MySqlManager.pch" : $(SOURCE) "$(INTDIR)"
- $(CPP) @<<
- $(CPP_SWITCHES) $(SOURCE)
-<<
-
-
-!ENDIF
-
-SOURCE=.\ToolSql.cpp
-
-"$(INTDIR)\ToolSql.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\ToolSqlQuery.cpp
-
-"$(INTDIR)\ToolSqlQuery.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\ToolSqlResults.cpp
-
-"$(INTDIR)\ToolSqlResults.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\ToolSqlStatus.cpp
-
-"$(INTDIR)\ToolSqlStatus.obj" : $(SOURCE) "$(INTDIR)"
-
-
-!IF "$(CFG)" == "MySqlManager - Win32 Release"
-
-"mysqlclient - Win32 Release" :
- cd "\MYSQL-3.23\client"
- $(MAKE) /$(MAKEFLAGS) /F ".\mysqlclient.mak" CFG="mysqlclient - Win32 Release"
- cd "..\mysqlmanager"
-
-"mysqlclient - Win32 ReleaseCLEAN" :
- cd "\MYSQL-3.23\client"
- $(MAKE) /$(MAKEFLAGS) /F ".\mysqlclient.mak" CFG="mysqlclient - Win32 Release" RECURSE=1 CLEAN
- cd "..\mysqlmanager"
-
-!ELSEIF "$(CFG)" == "MySqlManager - Win32 Debug"
-
-"mysqlclient - Win32 Debug" :
- cd "\MYSQL-3.23\client"
- $(MAKE) /$(MAKEFLAGS) /F ".\mysqlclient.mak" CFG="mysqlclient - Win32 Debug"
- cd "..\mysqlmanager"
-
-"mysqlclient - Win32 DebugCLEAN" :
- cd "\MYSQL-3.23\client"
- $(MAKE) /$(MAKEFLAGS) /F ".\mysqlclient.mak" CFG="mysqlclient - Win32 Debug" RECURSE=1 CLEAN
- cd "..\mysqlmanager"
-
-!ENDIF
-
-
-!ENDIF
-
diff --git a/VC++Files/mysqlmanager/mysqlmanager.rc b/VC++Files/mysqlmanager/mysqlmanager.rc
deleted file mode 100644
index 1dd9caeb686..00000000000
--- a/VC++Files/mysqlmanager/mysqlmanager.rc
+++ /dev/null
@@ -1,572 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
- "#define _AFX_NO_OLE_RESOURCES\r\n"
- "#define _AFX_NO_TRACKER_RESOURCES\r\n"
- "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
- "\r\n"
- "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
- "#ifdef _WIN32\r\n"
- "LANGUAGE 9, 1\r\n"
- "#pragma code_page(1252)\r\n"
- "#endif\r\n"
- "#include ""res\\MySqlManager.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
- "#include ""afxres.rc"" // Standard components\r\n"
- "#include ""afxprint.rc"" // printing/print preview resources\r\n"
- "#endif\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDR_MAINFRAME ICON DISCARDABLE "res\\MySqlManager.ico"
-IDR_MYSQLMTYPE ICON DISCARDABLE "res\\MySqlManagerDoc.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp"
-IDB_BITMAP1 BITMAP DISCARDABLE "res\\bitmap3.bmp"
-IDB_QUERY_EXECU BITMAP FIXED IMPURE "res\\query_ex.bmp"
-IDB_QUERY_EXECD BITMAP FIXED IMPURE "res\\bmp00001.bmp"
-IDB_FONTU BITMAP FIXED IMPURE "res\\fontu.bmp"
-IDB_FONTD BITMAP FIXED IMPURE "res\\fontd.bmp"
-IDB_DATABASESU BITMAP FIXED IMPURE "res\\database.bmp"
-IDB_DATABASESD BITMAP FIXED IMPURE "res\\bmp00002.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Toolbar
-//
-
-IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 15
-BEGIN
- BUTTON ID_FILE_NEW
- BUTTON ID_FILE_OPEN
- BUTTON ID_FILE_SAVE
- SEPARATOR
- BUTTON ID_EDIT_CUT
- BUTTON ID_EDIT_COPY
- BUTTON ID_EDIT_PASTE
- SEPARATOR
- BUTTON ID_FILE_PRINT
- BUTTON ID_APP_ABOUT
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDR_MAINFRAME MENU PRELOAD DISCARDABLE
-BEGIN
- POPUP "&File"
- BEGIN
- MENUITEM "&New\tCtrl+N", ID_FILE_NEW
- MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
- MENUITEM SEPARATOR
- MENUITEM "P&rint Setup...", ID_FILE_PRINT_SETUP
- MENUITEM SEPARATOR
- MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED
- MENUITEM SEPARATOR
- MENUITEM "E&xit", ID_APP_EXIT
- END
- POPUP "&View"
- BEGIN
- MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
- MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
- END
- POPUP "&Help"
- BEGIN
- MENUITEM "&About MySqlManager...", ID_APP_ABOUT
- END
-END
-
-IDR_MYSQLMTYPE MENU PRELOAD DISCARDABLE
-BEGIN
- POPUP "&File"
- BEGIN
- MENUITEM "&New\tCtrl+N", ID_FILE_NEW
- MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
- MENUITEM "&Close", ID_FILE_CLOSE
- MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE
- MENUITEM "Save &As...", ID_FILE_SAVE_AS
- MENUITEM SEPARATOR
- MENUITEM "&Print...\tCtrl+P", ID_FILE_PRINT
- MENUITEM "Print Pre&view", ID_FILE_PRINT_PREVIEW
- MENUITEM "P&rint Setup...", ID_FILE_PRINT_SETUP
- MENUITEM SEPARATOR
- MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED
- MENUITEM SEPARATOR
- MENUITEM "E&xit", ID_APP_EXIT
- END
- POPUP "&Edit"
- BEGIN
- MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO
- MENUITEM SEPARATOR
- MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT
- MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
- MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
- END
- POPUP "&Tools"
- BEGIN
- MENUITEM "SQL &Query", IDM_SQL_TOOL_QUERY
- MENUITEM "Register Server", IDM_TOOLS_REGISTER_SERVER
- MENUITEM "Server Properties", IDM_TOOLS_SERVER_PROPERTIES
- END
- POPUP "&View"
- BEGIN
- MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
- MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
- END
- POPUP "&Window"
- BEGIN
- MENUITEM "&New Window", ID_WINDOW_NEW
- MENUITEM "&Cascade", ID_WINDOW_CASCADE
- MENUITEM "&Tile", ID_WINDOW_TILE_HORZ
- MENUITEM "&Arrange Icons", ID_WINDOW_ARRANGE
- END
- POPUP "&Help"
- BEGIN
- MENUITEM "&About MySqlManager...", ID_APP_ABOUT
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Accelerator
-//
-
-IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
-BEGIN
- "C", ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
- "D", IDM_QUERY_DATABASES, VIRTKEY, ALT, NOINVERT
- "E", IDM_QUERY_EXEC, VIRTKEY, CONTROL, NOINVERT
- "N", ID_FILE_NEW, VIRTKEY, CONTROL, NOINVERT
- "O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT
- "P", ID_FILE_PRINT, VIRTKEY, CONTROL, NOINVERT
- "S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT
- "V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT
- VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT, NOINVERT
- VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT, NOINVERT
- VK_F6, ID_NEXT_PANE, VIRTKEY, NOINVERT
- VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT, NOINVERT
- VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
- VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT, NOINVERT
- "X", ID_EDIT_CUT, VIRTKEY, CONTROL, NOINVERT
- "X", IDM_QUERY_EXEC, VIRTKEY, ALT, NOINVERT
- "Z", ID_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 234, 72
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "About MySqlManager"
-FONT 8, "MS Sans Serif"
-BEGIN
- ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
- LTEXT "MySqlManager Version 1.0.2",IDC_STATIC,37,10,119,8,
- SS_NOPREFIX
- LTEXT "By James Pereira (jpereira@iafrica.com)",IDC_STATIC,37,
- 49,146,9
- DEFPUSHBUTTON "OK",IDOK,195,7,32,14,WS_GROUP
- LTEXT "This file is public domain and comes with NO WARRANTY of any kind",
- IDC_STATIC,38,25,136,18,SS_SUNKEN
-END
-
-IDD_TOOL_SQL DIALOGEX 0, 0, 452, 246
-STYLE DS_3DLOOK | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION |
- WS_SYSMENU | WS_THICKFRAME
-EXSTYLE WS_EX_CLIENTEDGE
-CAPTION "mySQL Query Tool"
-FONT 8, "MS Sans Serif", 0, 0, 0x1
-BEGIN
- PUSHBUTTON "OK",IDOK,369,10,12,14,NOT WS_VISIBLE
- DEFPUSHBUTTON "Close",IDCANCEL,391,10,50,14
- CONTROL "Tab1",IDC_TAB1,"SysTabControl32",0x0,11,26,434,213
- CONTROL "IDB_QUERY_EXEC",IDC_QUERY_PB,"Button",BS_OWNERDRAW |
- WS_TABSTOP,106,10,12,14
- CONTROL "IDB_FONT",IDC_FONT_PB,"Button",BS_OWNERDRAW |
- WS_TABSTOP,123,10,12,14
- COMBOBOX IDC_SERVER_CB,12,9,85,128,CBS_DROPDOWN | CBS_SORT |
- WS_VSCROLL | WS_TABSTOP
- CONTROL "IDB_DATABASES",IDC_DATABASES_PB,"Button",BS_OWNERDRAW |
- WS_TABSTOP,142,10,12,14
- DEFPUSHBUTTON "&Start",IDC_START_PB,315,10,23,14
- DEFPUSHBUTTON "S&top",IDC_STOP_PB,343,10,23,14
- EDITTEXT IDC_TIMER_SECS,287,10,22,14,ES_AUTOHSCROLL
- LTEXT "Interval (s)",IDC_STATIC,249,11,34,8
- CONTROL "Clear",IDC_CLEAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
- 215,11,29,10
-END
-
-IDD_TOOL_SQL_QUERY DIALOG DISCARDABLE 0, 0, 452, 247
-STYLE WS_CHILD | WS_BORDER
-FONT 8, "MS Sans Serif"
-BEGIN
- EDITTEXT IDC_EDIT,11,11,434,229,ES_MULTILINE | ES_AUTOVSCROLL |
- ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL
-END
-
-IDD_TOOL_SQL_RESULTS DIALOG DISCARDABLE 0, 0, 452, 247
-STYLE WS_CHILD | WS_BORDER
-FONT 8, "MS Sans Serif"
-BEGIN
- EDITTEXT IDC_EDIT,11,11,434,229,ES_MULTILINE | ES_AUTOVSCROLL |
- ES_AUTOHSCROLL | WS_VSCROLL
-END
-
-IDD_REGISTER_SERVER DIALOG FIXED IMPURE 0, 0, 281, 199
-STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION "Register Server"
-FONT 8, "MS Sans Serif"
-BEGIN
- GROUPBOX "",-1,5,0,270,195
- LTEXT "&Server:",-1,12,14,25,8
- COMBOBOX ID_SERVER_CB,46,12,159,60,CBS_DROPDOWN | CBS_AUTOHSCROLL |
- CBS_SORT | WS_VSCROLL | WS_TABSTOP
- LTEXT "&Host",-1,12,33,25,8
- COMBOBOX ID_HOST_CB,46,31,159,60,CBS_DROPDOWN | CBS_AUTOHSCROLL |
- CBS_SORT | WS_VSCROLL | WS_TABSTOP
- LTEXT "&Port",-1,12,53,25,8
- COMBOBOX ID_PORT_CB,46,50,159,60,CBS_DROPDOWN | CBS_AUTOHSCROLL |
- CBS_SORT | WS_VSCROLL | WS_TABSTOP
- GROUPBOX "Login Information",-1,12,82,194,76
- CONTROL "Use S&tandard Security",ID_USE_STANDARD_CK,"Button",
- BS_AUTORADIOBUTTON | WS_GROUP,19,107,94,11
- CONTROL "Use Tr&usted Connection",ID_USE_TRUSTED_CK,"Button",
- BS_AUTORADIOBUTTON,19,94,99,11
- LTEXT "&Login ID:",1060,37,124,35,8
- EDITTEXT ID_USER,77,122,120,12,ES_AUTOHSCROLL | WS_GROUP
- LTEXT "&Password:",1061,37,140,35,8
- EDITTEXT ID_PASSWORD,77,138,120,12,ES_PASSWORD | ES_AUTOHSCROLL
- LTEXT "S&erver Group:",-1,12,164,24,25
- CONTROL "&Display Server Status in Server Manager",
- ID_DISPLAY_SERVER_STATUS_CK,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,44,168,152,10
- DEFPUSHBUTTON "&Register",IDOK,214,11,53,14
- PUSHBUTTON "Re&move",ID_REMOVE_PB,214,27,53,14
- PUSHBUTTON "&Close",IDCANCEL,214,43,53,14
- PUSHBUTTON "&Help",ID_HELP,214,59,53,14
- PUSHBUTTON "Ser&vers...",ID_SERVERS_PB,214,92,53,14
- PUSHBUTTON "&Groups...",ID_GROUPS_PB,214,108,53,14
-END
-
-IDD_TOOL_SQL_STATUS DIALOG DISCARDABLE 0, 0, 452, 247
-STYLE WS_CHILD | WS_BORDER
-FONT 8, "MS Sans Serif"
-BEGIN
- EDITTEXT IDC_EDIT,11,11,434,229,ES_MULTILINE | ES_AUTOVSCROLL |
- ES_AUTOHSCROLL | WS_VSCROLL
-END
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,2
- PRODUCTVERSION 1,0,0,2
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "CompanyName", "\0"
- VALUE "FileDescription", "MySqlManager MFC Application\0"
- VALUE "FileVersion", "1, 0, 0, 2\0"
- VALUE "InternalName", "MySqlManager\0"
- VALUE "LegalCopyright", "Copyright (C) 1998\0"
- VALUE "OriginalFilename", "MySqlManager.EXE\0"
- VALUE "ProductName", "MySqlManager Application\0"
- VALUE "ProductVersion", "1, 0, 0, 2\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-#endif // !_MAC
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE
-BEGIN
- IDD_ABOUTBOX, DIALOG
- BEGIN
- LEFTMARGIN, 6
- RIGHTMARGIN, 227
- TOPMARGIN, 7
- BOTTOMMARGIN, 65
- END
-
- IDD_TOOL_SQL, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 445
- TOPMARGIN, 7
- BOTTOMMARGIN, 239
- END
-
- IDD_TOOL_SQL_QUERY, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 445
- TOPMARGIN, 7
- BOTTOMMARGIN, 240
- END
-
- IDD_TOOL_SQL_RESULTS, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 445
- TOPMARGIN, 7
- BOTTOMMARGIN, 240
- END
-
- IDD_TOOL_SQL_STATUS, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 445
- TOPMARGIN, 7
- BOTTOMMARGIN, 240
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE PRELOAD DISCARDABLE
-BEGIN
- IDR_MAINFRAME "MySqlManager"
- IDR_MYSQLMTYPE "\nMySqlM\nMySqlM\n\n\nMySqlManager.Document\nMySqlM Document"
-END
-
-STRINGTABLE PRELOAD DISCARDABLE
-BEGIN
- AFX_IDS_APP_TITLE "MySqlManager"
- AFX_IDS_IDLEMESSAGE "Ready"
- IDS_QUERY_DATABASES "Query Database(s)"
- IDS_REFRESH "Refresh"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- ID_INDICATOR_EXT "EXT"
- ID_INDICATOR_CAPS "CAP"
- ID_INDICATOR_NUM "NUM"
- ID_INDICATOR_SCRL "SCRL"
- ID_INDICATOR_OVR "OVR"
- ID_INDICATOR_REC "REC"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- ID_FILE_NEW "Create a new document\nNew"
- ID_FILE_OPEN "Open an existing document\nOpen"
- ID_FILE_CLOSE "Close the active document\nClose"
- ID_FILE_SAVE "Save the active document\nSave"
- ID_FILE_SAVE_AS "Save the active document with a new name\nSave As"
- ID_FILE_PAGE_SETUP "Change the printing options\nPage Setup"
- ID_FILE_PRINT_SETUP "Change the printer and printing options\nPrint Setup"
- ID_FILE_PRINT "Print the active document\nPrint"
- ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
- ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- ID_FILE_MRU_FILE1 "Open this document"
- ID_FILE_MRU_FILE2 "Open this document"
- ID_FILE_MRU_FILE3 "Open this document"
- ID_FILE_MRU_FILE4 "Open this document"
- ID_FILE_MRU_FILE5 "Open this document"
- ID_FILE_MRU_FILE6 "Open this document"
- ID_FILE_MRU_FILE7 "Open this document"
- ID_FILE_MRU_FILE8 "Open this document"
- ID_FILE_MRU_FILE9 "Open this document"
- ID_FILE_MRU_FILE10 "Open this document"
- ID_FILE_MRU_FILE11 "Open this document"
- ID_FILE_MRU_FILE12 "Open this document"
- ID_FILE_MRU_FILE13 "Open this document"
- ID_FILE_MRU_FILE14 "Open this document"
- ID_FILE_MRU_FILE15 "Open this document"
- ID_FILE_MRU_FILE16 "Open this document"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
- ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- ID_WINDOW_NEW "Open another window for the active document\nNew Window"
- ID_WINDOW_ARRANGE "Arrange icons at the bottom of the window\nArrange Icons"
- ID_WINDOW_CASCADE "Arrange windows so they overlap\nCascade Windows"
- ID_WINDOW_TILE_HORZ "Arrange windows as non-overlapping tiles\nTile Windows"
- ID_WINDOW_TILE_VERT "Arrange windows as non-overlapping tiles\nTile Windows"
- ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- ID_EDIT_CLEAR "Erase the selection\nErase"
- ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
- ID_EDIT_COPY "Copy the selection and put it on the Clipboard\nCopy"
- ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut"
- ID_EDIT_FIND "Find the specified text\nFind"
- ID_EDIT_PASTE "Insert Clipboard contents\nPaste"
- ID_EDIT_REPEAT "Repeat the last action\nRepeat"
- ID_EDIT_REPLACE "Replace specific text with different text\nReplace"
- ID_EDIT_SELECT_ALL "Select the entire document\nSelect All"
- ID_EDIT_UNDO "Undo the last action\nUndo"
- ID_EDIT_REDO "Redo the previously undone action\nRedo"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar"
- ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- AFX_IDS_SCSIZE "Change the window size"
- AFX_IDS_SCMOVE "Change the window position"
- AFX_IDS_SCMINIMIZE "Reduce the window to an icon"
- AFX_IDS_SCMAXIMIZE "Enlarge the window to full size"
- AFX_IDS_SCNEXTWINDOW "Switch to the next document window"
- AFX_IDS_SCPREVWINDOW "Switch to the previous document window"
- AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- AFX_IDS_SCRESTORE "Restore the window to normal size"
- AFX_IDS_SCTASKLIST "Activate Task List"
- AFX_IDS_MDICHILD "Activate this window"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- AFX_IDS_PREVIEW_CLOSE "Close print preview mode\nCancel Preview"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDC_QUERY_PB "Execute Query"
- IDS_QUERY_EXEC "Execute Query"
-END
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-#define _AFX_NO_SPLITTER_RESOURCES
-#define _AFX_NO_OLE_RESOURCES
-#define _AFX_NO_TRACKER_RESOURCES
-#define _AFX_NO_PROPERTY_RESOURCES
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE 9, 1
-#pragma code_page(1252)
-#endif
-#include "res\MySqlManager.rc2" // non-Microsoft Visual C++ edited resources
-#include "afxres.rc" // Standard components
-#include "afxprint.rc" // printing/print preview resources
-#endif
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
diff --git a/VC++Files/mysqlmanager/mysqlmanagerdoc.cpp b/VC++Files/mysqlmanager/mysqlmanagerdoc.cpp
deleted file mode 100644
index c89ce693a60..00000000000
--- a/VC++Files/mysqlmanager/mysqlmanagerdoc.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-// MySqlManagerDoc.cpp : implementation of the CMySqlManagerDoc class
-//
-
-#include "stdafx.h"
-#include "MySqlManager.h"
-
-#include "MySqlManagerDoc.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CMySqlManagerDoc
-
-IMPLEMENT_DYNCREATE(CMySqlManagerDoc, CDocument)
-
-BEGIN_MESSAGE_MAP(CMySqlManagerDoc, CDocument)
- //{{AFX_MSG_MAP(CMySqlManagerDoc)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CMySqlManagerDoc construction/destruction
-
-CMySqlManagerDoc::CMySqlManagerDoc()
-{
- // TODO: add one-time construction code here
-
-}
-
-CMySqlManagerDoc::~CMySqlManagerDoc()
-{
-}
-
-BOOL CMySqlManagerDoc::OnNewDocument()
-{
- if (!CDocument::OnNewDocument())
- return FALSE;
-
- // TODO: add reinitialization code here
- // (SDI documents will reuse this document)
-
- return TRUE;
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CMySqlManagerDoc serialization
-
-void CMySqlManagerDoc::Serialize(CArchive& ar)
-{
- if (ar.IsStoring())
- {
- // TODO: add storing code here
- }
- else
- {
- // TODO: add loading code here
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CMySqlManagerDoc diagnostics
-
-#ifdef _DEBUG
-void CMySqlManagerDoc::AssertValid() const
-{
- CDocument::AssertValid();
-}
-
-void CMySqlManagerDoc::Dump(CDumpContext& dc) const
-{
- CDocument::Dump(dc);
-}
-#endif //_DEBUG
-
-/////////////////////////////////////////////////////////////////////////////
-// CMySqlManagerDoc commands
diff --git a/VC++Files/mysqlmanager/mysqlmanagerdoc.h b/VC++Files/mysqlmanager/mysqlmanagerdoc.h
deleted file mode 100644
index f4a4d35cfd5..00000000000
--- a/VC++Files/mysqlmanager/mysqlmanagerdoc.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// MySqlManagerDoc.h : interface of the CMySqlManagerDoc class
-//
-/////////////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_MYSQLMANAGERDOC_H__826CB2F2_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
-#define AFX_MYSQLMANAGERDOC_H__826CB2F2_8B6D_11D1_AEC1_00600806E071__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-
-class CMySqlManagerDoc : public CDocument
-{
-protected: // create from serialization only
- CMySqlManagerDoc();
- DECLARE_DYNCREATE(CMySqlManagerDoc)
-
-// Attributes
-public:
-
-// Operations
-public:
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMySqlManagerDoc)
- public:
- virtual BOOL OnNewDocument();
- virtual void Serialize(CArchive& ar);
- //}}AFX_VIRTUAL
-
-// Implementation
-public:
- virtual ~CMySqlManagerDoc();
-#ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
-#endif
-
-protected:
-
-// Generated message map functions
-protected:
- //{{AFX_MSG(CMySqlManagerDoc)
- // NOTE - the ClassWizard will add and remove member functions here.
- // DO NOT EDIT what you see in these blocks of generated code !
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_MYSQLMANAGERDOC_H__826CB2F2_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
diff --git a/VC++Files/mysqlmanager/mysqlmanagerview.cpp b/VC++Files/mysqlmanager/mysqlmanagerview.cpp
deleted file mode 100644
index f39e0a9963e..00000000000
--- a/VC++Files/mysqlmanager/mysqlmanagerview.cpp
+++ /dev/null
@@ -1,854 +0,0 @@
-// MySqlManagerView.cpp : implementation of the CMySqlManagerView class
-//
-
-#include "stdafx.h"
-#include "MySqlManager.h"
-#include "MySqlManagerDoc.h"
-#include "MySqlManagerView.h"
-#include "mainfrm.h"
-#include "ToolSql.h"
-#include "RegisterServer.h"
-
-class XStatus
-{
-public:
- XStatus ( LPCSTR fmt, ... )
- {
- char buf [2048];
- va_list args;
- va_start(args, fmt);
- int ret = vsprintf(buf, fmt, args);
- MainFrame->StatusMsg ( "%s", buf );
- va_end(args);
- }
- ~XStatus()
- {
- MainFrame->StatusMsg ( " ");
- }
-private:
- XStatus();
-};
-
-#ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-
-IMPLEMENT_DYNCREATE(CMySqlManagerView, CTreeView)
-
-BEGIN_MESSAGE_MAP(CMySqlManagerView, CTreeView)
-//{{AFX_MSG_MAP(CMySqlManagerView)
-ON_NOTIFY_REFLECT(NM_DBLCLK, OnDblclk)
-ON_COMMAND(IDM_SQL_TOOL_QUERY, OnSqlToolQuery)
-ON_COMMAND(IDM_REFRESH, OnRefresh)
-ON_COMMAND(IDM_TOOLS_SERVER_PROPERTIES,OnServerProperties)
-ON_COMMAND(IDM_TOOLS_REGISTER_SERVER, OnRegisterServer)
-ON_NOTIFY_REFLECT(NM_RCLICK, OnRclick)
-//}}AFX_MSG_MAP
-// Standard printing commands
-ON_COMMAND(ID_FILE_PRINT, CTreeView::OnFilePrint)
-ON_COMMAND(ID_FILE_PRINT_DIRECT, CTreeView::OnFilePrint)
-ON_COMMAND(ID_FILE_PRINT_PREVIEW, CTreeView::OnFilePrintPreview)
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-
-CMySqlManagerView::CMySqlManagerView()
-: m_pTree(0)
-, m_pImages(0)
-, m_pbmBmp(0)
-, m_pTool(0)
-{
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-CMySqlManagerView::~CMySqlManagerView()
-{
- if ( m_pbmBmp ) delete m_pbmBmp;
- if ( m_pImages ) delete m_pImages;
- if ( m_pTool )
- {
- m_pTool->DestroyWindow();
- delete m_pTool;
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-BOOL CMySqlManagerView::PreCreateWindow(CREATESTRUCT& cs)
-{
- return CTreeView::PreCreateWindow(cs);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CMySqlManagerView::OnDraw(CDC* pDC)
-{
- CMySqlManagerDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-BOOL CMySqlManagerView::OnPreparePrinting(CPrintInfo* pInfo)
-{
- return DoPreparePrinting(pInfo);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CMySqlManagerView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
-{
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CMySqlManagerView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
-{
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-#ifdef _DEBUG
-void CMySqlManagerView::AssertValid() const
-{
- CTreeView::AssertValid();
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CMySqlManagerView::Dump(CDumpContext& dc) const
-{
- CTreeView::Dump(dc);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-CMySqlManagerDoc* CMySqlManagerView::GetDocument() // non-debug version is inline
-{
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMySqlManagerDoc)));
- return (CMySqlManagerDoc*)m_pDocument;
-}
-#endif //_DEBUG
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CMySqlManagerView::OnInitialUpdate()
-{
-
- CTreeView::OnInitialUpdate();
-
- m_pTree = & GetTreeCtrl();
- m_pImages = new CImageList;
- m_pImages->Create( 16, 16, FALSE, 0, 10 );
- m_pbmBmp = new CBitmap;
- m_pbmBmp->LoadBitmap( IDB_BITMAP1 );
- m_pImages->Add( m_pbmBmp, (COLORREF)0 );
- m_pTree->SetImageList( m_pImages, TVSIL_NORMAL );
-
- HTREEITEM h = AddResource ( TVI_ROOT, new CResourceServer ( "MySQL", "localhost", "root", "" ) );
-// AddResource ( h, new CResourceProcesslist () );
- h = AddResource ( TVI_ROOT, new CResourceServer ( "Test", "localhost", "test", "" ) );
-// AddResource ( h, new CResourceProcesslist () );
-
- m_pTree->ModifyStyle(0, TVS_HASLINES|TVS_HASBUTTONS);
-
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-HTREEITEM CMySqlManagerView::AddResource ( HTREEITEM hParent, CResource* pRes, HTREEITEM hLastItem )
-{
-
- TV_INSERTSTRUCT ItemStruct;
- memset( &ItemStruct, 0, sizeof(ItemStruct) );
- ItemStruct.hParent = hParent;
- ItemStruct.hInsertAfter = hLastItem;
- ItemStruct.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_SELECTEDIMAGE | TVIF_IMAGE;
- ItemStruct.item.hItem = 0;
- ItemStruct.item.state = 0;
- ItemStruct.item.stateMask = 0;
- ItemStruct.item.pszText = (LPSTR) pRes->GetDisplayName();
- ItemStruct.item.cchTextMax = (int) strlen( ItemStruct.item.pszText );
- ItemStruct.item.iImage = 2;
- ItemStruct.item.iSelectedImage = 3;
- ItemStruct.item.cChildren = 0;
- ItemStruct.item.lParam = (long) pRes;
- hLastItem = m_pTree->InsertItem( &ItemStruct );
- return hLastItem;
-}
-
-//int InsertNetResources( LPNETRESOURCE lpNetResource, CTreeCtrl *pTreeCtrl, HTREEITEM hParent, int *pnCount )
-//{
-//
-// DWORD Erc;
-// NETRESOURCE *pNetRes;
-// HANDLE hEnum;
-//
-// if( !pTreeCtrl ) return -1;
-// if( pnCount ) *pnCount = 0;
-// Erc = WNetOpenEnum(
-// RESOURCE_GLOBALNET,//DWORD dwScope, // scope of enumeration
-// RESOURCETYPE_ANY,//DWORD dwType, // resource types to list
-// 0,//DWORD dwUsage, // resource usage to list
-// lpNetResource,//LPNETRESOURCE lpNetResource, // pointer to resource structure
-// &hEnum//LPHANDLE lphEnum // pointer to enumeration handle buffer
-// );
-// if( Erc )
-// {
-// ShowError( Erc );
-// return Erc;
-// }
-//
-//
-// DWORD dwBufferSize = 1024;
-// pNetRes = (NETRESOURCE *)malloc( dwBufferSize );
-//
-// while( TRUE )
-// {
-// DWORD dwCount = 0xFFFFFFFF;
-// Erc = WNetEnumResource(
-// hEnum,//HANDLE hEnum, // handle to enumeration
-// &dwCount,//LPDWORD lpcCount, // pointer to entries to list
-// pNetRes,//LPVOID lpBuffer, // pointer to buffer for results
-// &dwBufferSize//LPDWORD lpBufferSize // pointer to buffer size variable
-// );
-// if( Erc == ERROR_NO_MORE_ITEMS ) return 0;
-// if( Erc )
-// {
-// free( pNetRes );
-// pNetRes = (NETRESOURCE *)malloc( dwBufferSize );
-// Erc = WNetEnumResource(
-// hEnum,//HANDLE hEnum, // handle to enumeration
-// &dwCount,//LPDWORD lpcCount, // pointer to entries to list
-// pNetRes,//LPVOID lpBuffer, // pointer to buffer for results
-// &dwBufferSize//LPDWORD lpBufferSize // pointer to buffer size variable
-// );
-// }
-// if( Erc ){ ShowError( Erc ); return Erc; }
-//
-// TV_INSERTSTRUCT ItemStruct;
-// HTREEITEM hLastItem = TVI_FIRST;
-// DWORD i;
-//
-// if( pnCount ) *pnCount += dwCount;
-// for( i=0; i<dwCount; i++ )
-// {
-// memset( &ItemStruct, 0, sizeof(ItemStruct) );
-// ItemStruct.hParent = hParent;
-// ItemStruct.hInsertAfter = hLastItem;
-// ItemStruct.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_SELECTEDIMAGE | TVIF_IMAGE;
-// ItemStruct.item.hItem = 0;
-// ItemStruct.item.state = 0;
-// ItemStruct.item.stateMask = 0;
-// ItemStruct.item.pszText = pNetRes[i].lpRemoteName;
-// ItemStruct.item.cchTextMax = strlen( ItemStruct.item.pszText );
-// ItemStruct.item.iImage = 2;
-// ItemStruct.item.iSelectedImage = 3;
-// ItemStruct.item.cChildren = 0;
-// ItemStruct.item.lParam = (long) (new CNetResource( &pNetRes[i] ));
-//
-// hLastItem = pTreeCtrl->InsertItem( &ItemStruct );
-// }
-// }//end while()
-//
-// WNetCloseEnum( hEnum );
-// free( pNetRes );
-// return Erc;
-//}
-
-/////////////////////////////////////////////////////////////////////////////
-
-static void print_top(MYSQL_RES *result)
-{
- uint length;
- MYSQL_FIELD *field;
- mysql_field_seek(result,0);
- while ((field = mysql_fetch_field(result)))
- {
- if ((length= (uint) strlen(field->name)) > field->max_length)
- field->max_length=length;
- else
- length=field->max_length;
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-static void print_header(MYSQL_RES *result,CStringArray& rg)
-{
- MYSQL_FIELD *field;
- print_top(result);
- mysql_field_seek(result,0);
- while ((field = mysql_fetch_field(result)))
- {
-// printf(" %-*s|",field->max_length+1,field->name);
- rg.Add(field->name);
- }
- print_top(result);
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-static void print_row(MYSQL_RES *result,MYSQL_ROW row,CStringArray& rg)
-{
- uint i,length;
- MYSQL_FIELD *field;
- mysql_field_seek(result,0);
- for (i=0 ; i < mysql_num_fields(result); i++)
- {
- field = mysql_fetch_field(result);
- length=field->max_length;
- rg.Add(row[i] ? (char*) row[i] : "");
-// printf(" %-*s|",length+1,row[i] ? (char*) row[i] : "");
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CMySqlManagerView::ProcessResultSet ( HTREEITEM hItem, LPVOID r, CResource* pResource )
-{
-
- MYSQL_RES* result = (MYSQL_RES *) r;
- MYSQL_ROW row;
-
- switch (pResource->GetType())
- {
- case CResource::eProcesslist:
- {
- CResourceProcesslist* p = (CResourceProcesslist*) pResource;
- CResourceProcesslistItem* pi = new CResourceProcesslistItem ();
- CString strText;
- print_header(result,p->m_rgFields);
- for (int i = 0; i<p->m_rgFields.GetSize(); i++ )
- {
- strText += p->m_rgFields[i];
- strText += " ";
- }
- pi->m_strName = strText;
- AddResource ( hItem, pi );
- for (int index=0;(row=mysql_fetch_row(result));index++)
- {
- pi = new CResourceProcesslistItem ();
- print_row(result,row,pi->m_rgFields);
- strText.Empty();
- for (int i = 0; i<pi->m_rgFields.GetSize(); i++ )
- {
- strText += pi->m_rgFields[i];
- strText += " ";
- }
- pi->m_strName = strText;
- AddResource ( hItem, pi );
- }
- print_top(result);
- break;
- }
- case CResource::eServer:
- {
- CResourceServer* p = (CResourceServer*) pResource;
- CResourceDatabase* pi = new CResourceDatabase ();
- CString strText;
- /* print_header(result,p->m_rgFields); */
- for (int i = 0; i<p->m_rgFields.GetSize(); i++ )
- {
- strText += p->m_rgFields[i];
- strText += " ";
- }
- pi->m_strName = strText;
- /* AddResource ( hItem, pi ); */
- for (int index=0;(row=mysql_fetch_row(result));index++)
- {
- pi = new CResourceDatabase ();
- print_row(result,row,pi->m_rgFields);
- strText.Empty();
- for (int i = 0; i<pi->m_rgFields.GetSize(); i++ )
- {
- strText += pi->m_rgFields[i];
- strText += " ";
- }
- pi->m_strName = strText;
- AddResource ( hItem, pi );
- }
- print_top(result);
- break;
- }
- case CResource::eDatabase:
- {
- CResourceDatabase* p = (CResourceDatabase*) pResource;
- CResourceTable* pi = new CResourceTable ();
- CString strText;
- /* print_header(result,p->m_rgFields); */
- for (int i = 0; i<p->m_rgFields.GetSize(); i++ )
- {
- strText += p->m_rgFields[i];
- strText += " ";
- }
- pi->m_strName = strText;
- /* AddResource ( hItem, pi ); */
- for (int index=0;(row=mysql_fetch_row(result));index++)
- {
- pi = new CResourceTable ();
- print_row(result,row,pi->m_rgFields);
- strText.Empty();
- for (int i = 0; i<pi->m_rgFields.GetSize(); i++ )
- {
- strText += pi->m_rgFields[i];
- strText += " ";
- }
- pi->m_strName = strText;
- AddResource ( hItem, pi );
- }
- print_top(result);
- break;
- }
- case CResource::eTable:
- {
- CResourceTable* p = (CResourceTable*) pResource;
- CResourceField* pi = new CResourceField ();
- CString strText;
- /* print_header(result,p->m_rgFields); */
- for (int i = 0; i<p->m_rgFields.GetSize(); i++ )
- {
- strText += p->m_rgFields[i];
- strText += " ";
- }
- pi->m_strName = strText;
- /* AddResource ( hItem, pi ); */
- for (int index=0;(row=mysql_fetch_row(result));index++)
- {
- pi = new CResourceField ();
- print_row(result,row,pi->m_rgFields);
- strText.Empty();
- for (int i = 0; i<pi->m_rgFields.GetSize(); i++ )
- {
- strText += pi->m_rgFields[i];
- strText += " ";
- }
- pi->m_strName = strText;
- AddResource ( hItem, pi );
- }
- print_top(result);
- break;
- }
- }
-
-
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-CResource* CMySqlManagerView::GetSelectedResource(HTREEITEM* phItemRet)
-{
- CResource* pResource = NULL;
- HTREEITEM hItem = m_pTree->GetSelectedItem();
- if ( hItem )
- {
- TV_ITEM item;
- memset( &item, 0, sizeof(TV_ITEM) );
- item.hItem = hItem;
- item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
- m_pTree->GetItem( &item );
- if ( item.lParam )
- {
- pResource = (CResource*) item.lParam;
- }
- }
- if (phItemRet)
- {
- *phItemRet = hItem;
- }
- return pResource;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-CResourceServer* CMySqlManagerView::GetServerResource(HTREEITEM hItem)
-{
-
- TV_ITEM item;
-
- memset( &item, 0, sizeof(TV_ITEM) );
- item.hItem = hItem;
- item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
- m_pTree->GetItem( &item );
- if ( !item.lParam ) return NULL;
-
- CResource* pResource = (CResource*) item.lParam;
-
- switch (pResource->GetType())
- {
- case CResource::eServer:
- {
- return (CResourceServer*) pResource;
- }
- case CResource::eDatabase:
- {
- HTREEITEM hParent = m_pTree->GetParentItem(hItem);
- memset( &item, 0, sizeof(TV_ITEM) );
- item.hItem = hParent;
- item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
- m_pTree->GetItem( &item );
- if ( !item.lParam ) return NULL;
- return (CResourceServer*) item.lParam;
- }
- case CResource::eTable:
- {
- HTREEITEM hParent = m_pTree->GetParentItem(m_pTree->GetParentItem(hItem));
- memset( &item, 0, sizeof(TV_ITEM) );
- item.hItem = hParent;
- item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
- m_pTree->GetItem( &item );
- if ( !item.lParam ) return NULL;
- return (CResourceServer*) item.lParam;
- }
- }
-
- return NULL;
-
-}
-/////////////////////////////////////////////////////////////////////////////
-
-void CMySqlManagerView::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult)
-{
- HTREEITEM hItem;
- hItem = m_pTree->GetSelectedItem();
- *pResult = 0;
- if ( !hItem ) return;
-
- TV_ITEM item;
- memset( &item, 0, sizeof(TV_ITEM) );
- item.hItem = hItem;
- item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
- m_pTree->GetItem( &item );
-
- if ( ! item.lParam ) return;
-
- if ( item.cChildren ) return; //if has got children expand only
-
- CWaitCursor x;
-
- CResource* pResource = (CResource*) item.lParam;
-
- MYSQL mysql;
- MYSQL_RES *result;
-
- switch (pResource->GetType())
- {
- case CResource::eProcesslist:
- {
- XStatus x ( "Connecting to server %s on host %s..."
- , (LPCTSTR) pResource->GetDisplayName()
- , (LPCTSTR) pResource->GetHostName()
- );
- mysql_init(&mysql);
- if (!mysql_real_connect(&mysql,pResource->GetHostName(), pResource->GetUserName(),pResource->GetPassword(),0,pResource->GetPortNumber(), NullS,0))
- {
- PostMessage(WM_COMMAND,IDM_TOOLS_SERVER_PROPERTIES);
- return;
- }
- mysql.reconnect= 1;
- if (!(result=mysql_list_processes(&mysql)))
- {
- return;
- }
- ProcessResultSet ( hItem, result, pResource );
- mysql_free_result(result);
- mysql_close(&mysql);
- break;
- }
- case CResource::eServer:
- {
- MainFrame->StatusMsg ( "Connecting to server %s on host %s..."
- , (LPCTSTR) pResource->GetDisplayName()
- , (LPCTSTR) pResource->GetHostName()
- );
- mysql_init(&mysql);
- if (!mysql_real_connect(&mysql,pResource->GetHostName(), pResource->GetUserName(),pResource->GetPassword(),0,pResource->GetPortNumber(), NullS,0))
- {
- PostMessage(WM_COMMAND,IDM_TOOLS_SERVER_PROPERTIES);
- MainFrame->StatusMsg ( "Error: Connecting to server %s... (%s)"
- , (LPCTSTR) pResource->GetDisplayName()
- , mysql_error(&mysql)
- );
- return;
- }
- mysql.reconnect= 1;
- if (!(result=mysql_list_dbs(&mysql,0)))
- {
- }
- ProcessResultSet ( hItem, result, pResource );
- mysql_free_result(result);
- mysql_close(&mysql);
- MainFrame->StatusMsg ( " " );
- break;
- }
- case CResource::eDatabase:
- {
- CResourceServer* pServer = GetServerResource(hItem);
- if (!pServer) return;
- MainFrame->StatusMsg ( "Connecting to server %s on host %s..."
- , (LPCTSTR) pServer->GetDisplayName()
- , (LPCTSTR) pServer->GetHostName()
- );
- mysql_init(&mysql);
- if (!mysql_real_connect(&mysql,pServer->GetHostName(), pServer->GetUserName(),pServer->GetPassword(),0,pServer->GetPortNumber(), NullS,0))
- {
- PostMessage(WM_COMMAND,IDM_TOOLS_SERVER_PROPERTIES);
- MainFrame->StatusMsg ( "Error: Connecting to server %s... (%s)"
- , (LPCTSTR) pServer->GetDisplayName()
- , mysql_error(&mysql)
- );
- return;
- }
- mysql.reconnect= 1;
- CResourceDatabase* pRes = (CResourceDatabase*) pResource;
- CString strDB = pResource->GetDisplayName();
- strDB.TrimRight();
- if (mysql_select_db(&mysql,strDB))
- {
- MainFrame->StatusMsg ( "Error: Selecting database %s... (%s)"
- , (LPCTSTR) strDB
- , mysql_error(&mysql)
- );
- return;
- }
- if (!(result=mysql_list_tables(&mysql,0)))
- {
- }
- ProcessResultSet ( hItem, result, pRes );
- mysql_free_result(result);
- mysql_close(&mysql);
- MainFrame->StatusMsg ( " " );
- break;
- }
- case CResource::eTable:
- {
- CResourceServer* pServer = GetServerResource(hItem);
- if (!pServer) return;
- MainFrame->StatusMsg ( "Connecting to server %s on host %s..."
- , (LPCTSTR) pServer->GetDisplayName()
- , (LPCTSTR) pServer->GetHostName()
- );
- mysql_init(&mysql);
- if (!mysql_real_connect(&mysql,pServer->GetHostName(), pServer->GetUserName(),pServer->GetPassword(),0,pServer->GetPortNumber(), NullS,0))
- {
- PostMessage(WM_COMMAND,IDM_TOOLS_SERVER_PROPERTIES);
- MainFrame->StatusMsg ( "Error: Connecting to server %s... (%s)"
- , (LPCTSTR) pServer->GetDisplayName()
- , mysql_error(&mysql)
- );
- return;
- }
- mysql.reconnect= 1;
- HTREEITEM hParent = m_pTree->GetParentItem(hItem);
- memset( &item, 0, sizeof(TV_ITEM) );
- item.hItem = hParent;
- item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
- m_pTree->GetItem( &item );
- if ( item.lParam )
- {
- CResourceDatabase* pResDatabase = (CResourceDatabase*) item.lParam;
- CResourceTable* pRes = (CResourceTable*) pResource;
- CString strDB = pResDatabase->GetDisplayName();
- CString strTable = pResource->GetDisplayName();
- strDB.TrimRight();
- strTable.TrimRight();
- if (mysql_select_db(&mysql,strDB))
- {
- return;
- }
- CString str; str.Format("show fields from %s",(LPCTSTR)strTable);
- if ( mysql_query(&mysql,str)==0 )
- {
- MYSQL_RES *result;
- if ((result=mysql_store_result(&mysql)))
- {
- ProcessResultSet ( hItem, result, pRes );
- mysql_free_result(result);
- }
- }
- }
- mysql_close(&mysql);
- break;
- }
- }
-
-// InsertNetResources( (LPNETRESOURCE)pTvItem->lParam,
-// &m_TreeCtrl,
-// hItem,
-// &pTvItem->cChildren );
-// pTvItem->mask = TVIF_CHILDREN;
-// m_TreeCtrl.SetItem( pTvItem );
-
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CMySqlManagerView::OnRefresh()
-{
- HTREEITEM hItem = NULL;
- CResource* pResource = GetSelectedResource(&hItem);
- if (pResource&&hItem)
- {
- switch (pResource->GetType())
- {
- case CResource::eTable:
- {
-
- TV_ITEM item;
- MYSQL mysql;
-// MYSQL_RES *result;
-
- HTREEITEM hParent = m_pTree->GetParentItem(hItem);
-
- HTREEITEM hChild = m_pTree->GetChildItem(hItem);
- while (hChild)
- {
- HTREEITEM h = m_pTree->GetNextSiblingItem(hChild);
- BOOL b = m_pTree->DeleteItem(hChild);
- hChild = h;
- }
- mysql_init(&mysql);
- if (!mysql_real_connect(&mysql,pResource->GetHostName(), pResource->GetUserName(),pResource->GetPassword(),0,pResource->GetPortNumber(), NullS,0))
- {
- return;
- }
- mysql.reconnect= 1;
- memset( &item, 0, sizeof(TV_ITEM) );
- item.hItem = hParent;
- item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
- m_pTree->GetItem( &item );
- if ( item.lParam )
- {
- CResourceDatabase* pResDatabase = (CResourceDatabase*) item.lParam;
- CResourceTable* pRes = (CResourceTable*) pResource;
- CString strDB = pResDatabase->GetDisplayName();
- CString strTable = pResource->GetDisplayName();
- strDB.TrimRight();
- strTable.TrimRight();
- if (mysql_select_db(&mysql,strDB))
- {
- return;
- }
- CString str; str.Format("show fields from %s",(LPCTSTR)strTable);
- if ( mysql_query(&mysql,str)==0 )
- {
- MYSQL_RES *result;
- if ((result=mysql_store_result(&mysql)))
- {
- ProcessResultSet ( hItem, result, pRes );
- mysql_free_result(result);
- }
- }
- }
- mysql_close(&mysql);
- break;
- }
- }
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CMySqlManagerView::OnRegisterServer()
-{
- CRegisterServer dlg;
- if (dlg.DoModal()!=IDOK) return;
- AddResource (
- TVI_ROOT,
- new CResourceServer ( dlg.m_strServer, dlg.m_strHost, dlg.m_strUser, dlg.m_strPassword, dlg.m_strPort )
- );
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CMySqlManagerView::OnServerProperties()
-{
- HTREEITEM hItem;
- CResource* pRes = GetSelectedResource(&hItem);
- if (!pRes) return;
- if (pRes->GetType()!=CResource::eServer) return;
- CResourceServer* pResource = (CResourceServer*)pRes;
- CRegisterServer dlg;
- dlg.m_strHost = pResource->GetHostName();
- dlg.m_strUser = pResource->GetUserName();
- dlg.m_strPassword = pResource->GetPassword();
- dlg.m_strPort = pResource->GetPortName();
- if (dlg.DoModal()!=IDOK) return;
- pResource->m_strHost = dlg.m_strHost ;
- pResource->m_strUser = dlg.m_strUser ;
- pResource->m_strPassword = dlg.m_strPassword;
- pResource->m_strPort = dlg.m_strPort ;
- TV_ITEM item;
- memset( &item, 0, sizeof(TV_ITEM) );
- item.hItem = hItem;
- item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
- m_pTree->GetItem( &item );
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CMySqlManagerView::OnSqlToolQuery()
-{
-
- HTREEITEM hItem;
-
- CResource* pResource = GetSelectedResource(&hItem);
-
- if (!pResource) return;
-
- CResourceServer* pServer = GetServerResource(hItem);
- if (!pServer) return; /* Avoid bug when selecting field */
-
- m_pTool = new CToolSql ( AfxGetMainWnd(), pServer, pResource );
-
- if ( ! m_pTool->Create(IDD_TOOL_SQL,this) )
- {
- delete m_pTool;
- m_pTool = 0;
- PostMessage(WM_COMMAND,IDM_TOOLS_SERVER_PROPERTIES);
- }
- else
- {
- m_pTool->ShowWindow(SW_SHOW);
- }
-
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-BOOL CMySqlManagerView::PreTranslateMessage(MSG* pMsg)
-{
- if (m_pTool && m_pTool->PreTranslateMessage(pMsg))
- return TRUE;
- return CTreeView::PreTranslateMessage(pMsg);
-}
-
-void CMySqlManagerView::OnRclick(NMHDR* pNMHDR, LRESULT* pResult)
-{
-
- POINT pt;
-
- GetCursorPos ( & pt );
-
- CMenu menu;
-
- menu.CreatePopupMenu ();
-
- menu.AppendMenu ( MF_ENABLED , IDM_SQL_TOOL_QUERY, "SQL Query" );
- menu.AppendMenu ( MF_ENABLED , IDM_REFRESH, "Refresh active item(s)" );
- menu.AppendMenu ( MF_ENABLED , IDM_TOOLS_REGISTER_SERVER, "Register server" );
- menu.AppendMenu ( MF_ENABLED , IDM_TOOLS_SERVER_PROPERTIES, "Properties" );
-
- menu.TrackPopupMenu ( TPM_LEFTALIGN | TPM_RIGHTBUTTON , pt.x, pt.y, CWnd::GetParent(), NULL );
-
- *pResult = 0;
-
-}
diff --git a/VC++Files/mysqlmanager/mysqlmanagerview.h b/VC++Files/mysqlmanager/mysqlmanagerview.h
deleted file mode 100644
index 97f5a2596d1..00000000000
--- a/VC++Files/mysqlmanager/mysqlmanagerview.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// MySqlManagerView.h : interface of the CMySqlManagerView class
-//
-/////////////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_MYSQLMANAGERVIEW_H__826CB2F4_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
-#define AFX_MYSQLMANAGERVIEW_H__826CB2F4_8B6D_11D1_AEC1_00600806E071__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-#include <afxcview.h>
-#include "cresource.h"
-
-class CToolSql;
-
-class CMySqlManagerView : public CTreeView
-{
-protected: // create from serialization only
- CMySqlManagerView();
- DECLARE_DYNCREATE(CMySqlManagerView)
-
-// Attributes
-public:
- CMySqlManagerDoc* GetDocument();
-
-// Operations
-public:
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMySqlManagerView)
- public:
- virtual void OnDraw(CDC* pDC); // overridden to draw this view
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- virtual void OnInitialUpdate();
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- protected:
- virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
- virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
- virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
- //}}AFX_VIRTUAL
-
-// Implementation
-
- CResource* GetSelectedResource(HTREEITEM* phItemRet=NULL);
- CResourceServer* GetServerResource(HTREEITEM hItem);
-
- HTREEITEM AddResource ( HTREEITEM hParent, CResource* pRes, HTREEITEM hLastItem = TVI_FIRST ) ;
- void ProcessResultSet ( HTREEITEM hItem, LPVOID result, CResource* pResource );
-
-public:
- virtual ~CMySqlManagerView();
-#ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
-#endif
-
-protected:
-
- CTreeCtrl* m_pTree;
- CImageList* m_pImages;
- CBitmap* m_pbmBmp;
- CToolSql* m_pTool;
-
-// Generated message map functions
-protected:
- //{{AFX_MSG(CMySqlManagerView)
- afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnSqlToolQuery();
- afx_msg void OnRefresh();
- afx_msg void OnRegisterServer();
- afx_msg void OnServerProperties();
- afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-#ifndef _DEBUG // debug version in MySqlManagerView.cpp
-inline CMySqlManagerDoc* CMySqlManagerView::GetDocument()
- { return (CMySqlManagerDoc*)m_pDocument; }
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_MYSQLMANAGERVIEW_H__826CB2F4_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
diff --git a/VC++Files/mysqlmanager/registerserver.cpp b/VC++Files/mysqlmanager/registerserver.cpp
deleted file mode 100644
index a0e9dcca3df..00000000000
--- a/VC++Files/mysqlmanager/registerserver.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-// RegisterServer.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "mysqlmanager.h"
-#include "RegisterServer.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CRegisterServer dialog
-
-
-CRegisterServer::CRegisterServer(CWnd* pParent /*=NULL*/)
- : CDialog(CRegisterServer::IDD, pParent)
- , m_strServer("servername")
- , m_strHost("localhost")
- , m_strUser("root")
- , m_strPassword("")
-{
- //{{AFX_DATA_INIT(CRegisterServer)
- m_strPort = _T("3306");
- //}}AFX_DATA_INIT
-}
-
-
-void CRegisterServer::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CRegisterServer)
- DDX_CBString(pDX, ID_SERVER_CB, m_strServer);
- DDX_CBString(pDX, ID_HOST_CB, m_strHost);
- DDX_Text(pDX, ID_USER, m_strUser);
- DDX_Text(pDX, ID_PASSWORD, m_strPassword);
- DDX_CBString(pDX, ID_PORT_CB, m_strPort);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CRegisterServer, CDialog)
- //{{AFX_MSG_MAP(CRegisterServer)
- // NOTE: the ClassWizard will add message map macros here
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CRegisterServer message handlers
diff --git a/VC++Files/mysqlmanager/registerserver.h b/VC++Files/mysqlmanager/registerserver.h
deleted file mode 100644
index f4ac2356b2c..00000000000
--- a/VC++Files/mysqlmanager/registerserver.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#if !defined(AFX_REGISTERSERVER_H__826CB2FF_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
-#define AFX_REGISTERSERVER_H__826CB2FF_8B6D_11D1_AEC1_00600806E071__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-// RegisterServer.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CRegisterServer dialog
-
-class CRegisterServer : public CDialog
-{
-// Construction
-public:
- CRegisterServer(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(CRegisterServer)
- enum { IDD = IDD_REGISTER_SERVER };
- CString m_strServer;
- CString m_strHost;
- CString m_strUser;
- CString m_strPassword;
- CString m_strPort;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CRegisterServer)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CRegisterServer)
- // NOTE: the ClassWizard will add member functions here
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_REGISTERSERVER_H__826CB2FF_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
diff --git a/VC++Files/mysqlmanager/resource.h b/VC++Files/mysqlmanager/resource.h
deleted file mode 100644
index def26ce6808..00000000000
--- a/VC++Files/mysqlmanager/resource.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by MySqlManager.rc
-//
-#define IDC_START_PB 3
-#define IDC_STOP_PB 4
-#define ID_SERVERS_PB 7
-#define IDD_ABOUTBOX 100
-#define IDM_QUERY_EXEC 101
-#define IDM_QUERY_DATABASES 102
-#define IDM_REFRESH 103
-#define IDD_REGISTER_SERVER 114
-#define IDR_MAINFRAME 128
-#define IDR_MYSQLMTYPE 129
-#define IDD_TOOL_SQL 132
-#define IDB_BITMAP1 133
-#define IDD_TOOL_SQL_QUERY 134
-#define IDD_TOOL_SQL_RESULTS 135
-#define IDD_TOOL_SQL_STATUS 136
-#define IDC_TAB1 1000
-#define IDC_EDIT 1001
-#define IDC_QUERY_PB 1002
-#define IDC_FONT_PB 1003
-#define IDS_QUERY_EXEC 1003
-#define ID_SERVER_CB 1003
-#define ID_USER 1004
-#define IDC_SERVER_CB 1004
-#define IDC_DATABASES_PB 1005
-#define ID_PASSWORD 1005
-#define ID_HOST_CB 1006
-#define IDC_TIMER_SECS 1006
-#define ID_PORT_CB 1007
-#define IDC_CLEAR 1007
-#define ID_GROUPS_PB 1012
-#define ID_REMOVE_PB 1017
-#define ID_DISPLAY_SERVER_STATUS_CK 1057
-#define ID_USE_STANDARD_CK 1058
-#define ID_USE_TRUSTED_CK 1059
-#define IDM_SQL_TOOL_QUERY 32771
-#define IDM_TOOLS_REGISTER_SERVER 32772
-#define IDM_TOOLS_SERVER_PROPERTIES 32773
-#define IDS_QUERY_DATABASES 57346
-#define IDS_REFRESH 57347
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_3D_CONTROLS 1
-#define _APS_NEXT_RESOURCE_VALUE 136
-#define _APS_NEXT_COMMAND_VALUE 32775
-#define _APS_NEXT_CONTROL_VALUE 1008
-#define _APS_NEXT_SYMED_VALUE 104
-#endif
-#endif
diff --git a/VC++Files/mysqlmanager/stdafx.cpp b/VC++Files/mysqlmanager/stdafx.cpp
deleted file mode 100644
index 3e0251dff43..00000000000
--- a/VC++Files/mysqlmanager/stdafx.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// MySqlManager.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
diff --git a/VC++Files/mysqlmanager/stdafx.h b/VC++Files/mysqlmanager/stdafx.h
deleted file mode 100644
index 8cd7dfd04f3..00000000000
--- a/VC++Files/mysqlmanager/stdafx.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#if !defined(AFX_STDAFX_H__826CB2EC_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
-#define AFX_STDAFX_H__826CB2EC_8B6D_11D1_AEC1_00600806E071__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
-
-#include <afxwin.h> // MFC core and standard components
-#include <afxext.h> // MFC extensions
-#include <afxdisp.h> // MFC OLE automation classes
-#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h> // MFC support for Windows Common Controls
-#endif // _AFX_NO_AFXCMN_SUPPORT
-
-#include <afxsock.h>
-#include "mysql.h"
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_STDAFX_H__826CB2EC_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
diff --git a/VC++Files/mysqlmanager/toolsql.cpp b/VC++Files/mysqlmanager/toolsql.cpp
deleted file mode 100644
index 1773a3a6dc7..00000000000
--- a/VC++Files/mysqlmanager/toolsql.cpp
+++ /dev/null
@@ -1,687 +0,0 @@
-// ToolSql.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "MySqlManager.h"
-#include "ToolSql.h"
-
-#define WINDOW_COORDS 0
-#define CLIENT_COORDS 1
-
-#define MY_TIMER_ID 0x1234
-
-#ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-
-CToolSql::CToolSql(CWnd* pParent,CResource* pServer,CResource* pResource)
-: CDialog(CToolSql::IDD, pParent)
-, m_pQuery(0)
-, m_pResults(0)
-, m_pStatus(0)
-, m_pServer(pServer)
-, m_pResource(pResource)
-, m_ui_timer(0)
-{
- //{{AFX_DATA_INIT(CToolSql)
- m_nIntervalTimerSeconds = 10;
- m_bClear = FALSE;
- //}}AFX_DATA_INIT
- memset ( & m_lf, 0,sizeof(m_lf) );
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-CToolSql::~CToolSql()
-{
-
- if (m_ui_timer)
- {
- KillTimer(MY_TIMER_ID);
- }
-
- if (m_pdb)
- {
- mysql_close(m_pdb);
- }
- if (m_pQuery)
- {
- m_pQuery->DestroyWindow();
- delete m_pQuery;
- }
- if (m_pResults)
- {
- m_pResults->DestroyWindow();
- delete m_pResults;
- }
- if (m_pStatus)
- {
- m_pStatus->DestroyWindow();
- delete m_pStatus;
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSql::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CToolSql)
- DDX_Control(pDX, IDC_STOP_PB, m_ctl_Stop);
- DDX_Control(pDX, IDC_START_PB, m_ctl_Start);
- DDX_Control(pDX, IDC_SERVER_CB, m_ctl_Server);
- DDX_Control(pDX, IDC_TAB1, m_tabs);
- DDX_Text(pDX, IDC_TIMER_SECS, m_nIntervalTimerSeconds);
- DDV_MinMaxInt(pDX, m_nIntervalTimerSeconds, 1, 120);
- DDX_Check(pDX, IDC_CLEAR, m_bClear);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CToolSql, CDialog)
-//{{AFX_MSG_MAP(CToolSql)
- ON_BN_CLICKED(IDC_QUERY_PB, OnQueryPb)
- ON_BN_CLICKED(IDC_DATABASES_PB, OnQueryDatabases)
- ON_NOTIFY(TCN_SELCHANGE, IDC_TAB1, OnSelchangeTab1)
- ON_BN_CLICKED(IDC_FONT_PB, OnFontPb)
- ON_WM_SIZE()
- ON_BN_CLICKED(IDC_START_PB, OnStartPb)
- ON_BN_CLICKED(IDC_STOP_PB, OnStopPb)
- ON_WM_TIMER()
- ON_WM_DESTROY()
- ON_BN_CLICKED(IDC_CLEAR, OnClear)
- ON_COMMAND(IDM_QUERY_EXEC, OnQueryPb)
- ON_COMMAND(IDM_QUERY_DATABASES, OnQueryDatabases)
- ON_EN_CHANGE(IDC_TIMER_SECS, OnChangeTimerSecs)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-
-BOOL CToolSql::OnInitDialog()
-{
-
- CDialog::OnInitDialog();
-
- m_ctl_Start . EnableWindow(TRUE);
- m_ctl_Stop . EnableWindow(FALSE);
-
- CString strTitle;
-
- strTitle.Format ("mySql Query to %s on %s",m_pServer->GetDisplayName(),m_pServer->GetHostName());
-
- m_ctl_Server.AddString ( m_pServer->GetDisplayName() );
- m_ctl_Server.SetCurSel (0);
-
- SetWindowText(strTitle);
-
- CWaitCursor x;
-
- m_btn_QueryExec.AutoLoad ( IDC_QUERY_PB, this );
- m_btn_QueryDatabases.AutoLoad ( IDC_DATABASES_PB, this );
- m_btn_Font.AutoLoad ( IDC_FONT_PB, this );
-
- m_tabs.GetWindowRect ( m_rectTab[WINDOW_COORDS] );
- GetWindowRect ( m_rectDlg[WINDOW_COORDS] );
-
- m_tabs.GetClientRect ( m_rectTab[CLIENT_COORDS] );
- GetClientRect ( m_rectDlg[CLIENT_COORDS] );
-
- CMenu* pSysMenu = GetSystemMenu(FALSE);
- if (pSysMenu != NULL)
- {
- CString strText;
- strText.LoadString(IDS_QUERY_EXEC);
- if (!strText.IsEmpty())
- {
- pSysMenu->AppendMenu(MF_SEPARATOR);
- pSysMenu->AppendMenu(MF_STRING, IDM_QUERY_EXEC, strText);
- }
- strText.LoadString(IDS_QUERY_DATABASES);
- if (!strText.IsEmpty())
- {
- pSysMenu->AppendMenu(MF_STRING, IDM_QUERY_DATABASES, strText);
- }
- }
-
-
- m_pdb = new MYSQL;
-
- CString strQuery ( "Query" );
- CString strResults ( "Results" );
- CString strStatus ( "Status" );
-
- TC_ITEM tc1 = { TCIF_TEXT, 0,0, (LPSTR)(LPCTSTR)strQuery, strQuery.GetLength(), 0,0};
- TC_ITEM tc2 = { TCIF_TEXT, 0,0, (LPSTR)(LPCTSTR)strResults, strResults.GetLength(), 0,0};
- TC_ITEM tc3 = { TCIF_TEXT, 0,0, (LPSTR)(LPCTSTR)strStatus, strStatus.GetLength(), 0,0};
-
- m_tabs.InsertItem ( 0,&tc1 );
- m_tabs.InsertItem ( 1,&tc2 );
- m_tabs.InsertItem ( 2,&tc3 );
-
- m_pQuery = new CToolSqlQuery ( NULL );
- m_pResults = new CToolSqlResults ( NULL );
- m_pStatus = new CToolSqlStatus ( NULL );
-
- try
- {
-
-// OpenDatabase();
-//
-// m_pSelection->SetDatabase ( & m_db );
-// m_pScript->SetDatabase ( & m_db );
-// m_pLog->SetDatabase ( & m_db );
-
- m_pQuery -> Create ( (LPCTSTR)IDD_TOOL_SQL_QUERY, &m_tabs );
- m_pResults -> Create ( (LPCTSTR)IDD_TOOL_SQL_RESULTS, &m_tabs );
- m_pStatus -> Create ( (LPCTSTR)IDD_TOOL_SQL_STATUS, &m_tabs );
-
- ActivateTab ( 0 );
-
- m_pQuery -> SetWindowPos(NULL,20,24,0,0,SWP_NOZORDER|SWP_NOSIZE);
- m_pResults -> SetWindowPos(NULL,20,24,0,0,SWP_NOZORDER|SWP_NOSIZE);
- m_pStatus -> SetWindowPos(NULL,20,24,0,0,SWP_NOZORDER|SWP_NOSIZE);
-
- DoOnSize( SIZE_RESTORED, m_rectDlg[CLIENT_COORDS].Width(), m_rectDlg[CLIENT_COORDS].Height() );
-
- }
- catch (...)
- {
- }
-
- mysql_init(m_pdb);
- if (!mysql_real_connect(m_pdb,m_pServer->GetHostName(), m_pServer->GetUserName(),m_pServer->GetPassword(),0,m_pServer->GetPortNumber(), NullS,0))
- {
-// my_printf_error(0,"connect to server at '%s' failed; error: '%s'",
-// MYF(ME_BELL), pResource->GetHostName(), mysql_error(&mysql));
- CString strText;
- strText.Format ( "connect to server at '%s' failed; error: '%s'", m_pServer->GetHostName(), mysql_error(m_pdb));
- AfxMessageBox(strText);
- EndDialog(IDCANCEL);
- return FALSE;
- }
-
- if ( m_pResource && m_pResource->GetType() == CResource::eDatabase )
- {
- CString strDB = m_pResource->GetDisplayName();
- strDB.TrimRight();
- if (mysql_select_db(m_pdb,strDB))
- {
- }
- }
-
- return FALSE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSql::ActivateTab ( int tab )
-
-{
- switch (tab)
- {
- case 0: ;
- m_pResults-> ShowWindow(SW_HIDE);
- m_pStatus-> ShowWindow(SW_HIDE);
- m_pQuery-> ShowWindow(SW_SHOW);
- m_pQuery->m_ctl_edit.SetFocus();
- break;
- case 1: ;
- m_pQuery-> ShowWindow(SW_HIDE);
- m_pStatus-> ShowWindow(SW_HIDE);
- m_pResults-> ShowWindow(SW_SHOW);
- m_pResults->m_ctl_edit.SetFocus();
- break;
- case 2: ;
- m_pResults-> ShowWindow(SW_HIDE);
- m_pQuery-> ShowWindow(SW_HIDE);
- m_pStatus-> ShowWindow(SW_SHOW);
- m_pStatus->m_ctl_edit.SetFocus();
- break;
- default:
- break;
- }
-
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CalculateFontSize ( CEdit& ed, CSize& sizeRet )
-
-{
-
- CDC* pdc = ed.GetDC();
-
- int nAveWidth , nAveHeight;
- int i ;
-
- CSize size ;
-
- static BOOL bFirstTime = TRUE;
- static char rgchAlphabet [54] ;
-
- if ( bFirstTime )
- {
- bFirstTime = false;
- for ( i = 0 ; i <= 25 ; i++)
- {
- rgchAlphabet[i] = (char)(i+(int)'a') ;
- rgchAlphabet[i+26] = (char)(i+(int)'A') ;
- }
- rgchAlphabet[52] = 0x20;
- rgchAlphabet[53] = 0x20;
- }
-
- CFont* pf = ed.GetFont();
- LOGFONT lf;
- pf->GetLogFont(&lf);
- pdc->SelectObject (pf);
- GetTextExtentPoint32 ( pdc->m_hDC, (LPSTR) rgchAlphabet, 54, & size ) ;
-
- nAveWidth = size.cx / 54 ;
-
- if ( size.cx % 54 )
- {
- nAveWidth++;
- }
-
- nAveHeight = size.cy; //6 * size.cy / 4;
-
- sizeRet.cx = nAveWidth;
- sizeRet.cy = nAveHeight; // tm.tmHeight;
-
- ed.ReleaseDC(pdc);
-
-}
-
-///////////////////////////////////////////////////////////////////////////////
-int ProcessYieldMessage ()
-{
-
- CWinApp* pApp = AfxGetApp();
-
- if ( pApp )
- {
- MSG msgx;
- while (::PeekMessage(&msgx, NULL, NULL, NULL, PM_NOREMOVE))
- try
- {
- if (!pApp->PumpMessage())
- {
-// ExitProcess(1);
- }
- }
- catch (...)
- {
- }
- }
-
- return 0;
-
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-void print_table_data(MYSQL_RES *result,CString& str,CEdit& ed,LOGFONT& lf)
-{
- MYSQL_ROW cur;
- uint length;
- MYSQL_FIELD* field;
- bool* num_flag;
- my_ulonglong nRows = mysql_num_rows(result);
- uint nFields = mysql_num_fields(result);
- int* rgi = new int [nFields];
- memset ( rgi, 0, nFields*sizeof(int) );
- num_flag=(bool*) my_alloca(sizeof(bool)*nFields);
-
- ed.SetLimitText(65535*16);
-
- CSize sizeFont;
- CalculateFontSize ( ed, sizeFont );
- uint index = 0;
- rgi[index++]=0;
- CString separator("");
-
- mysql_field_seek(result,0);
-
- for (uint off=0; (field = mysql_fetch_field(result)) ; off++)
- {
- uint length= (uint) strlen(field->name);
- length=max(length,field->max_length);
- if (length < 4 && !IS_NOT_NULL(field->flags))
- length=4; // Room for "NULL"
- field->max_length=length+1;
- int n=length+2;
- for (uint i=lstrlen(field->name); i-- > 0 ; ) separator+="-";
- if ( index!= nFields )
- {
- int o = rgi[index-1];
- rgi[index++]=o+((n+1)*sizeFont.cx)/2;
- }
- separator+='\t';
- str += field->name;
- str += "\t";
- num_flag[off]= IS_NUM(field->type);
- }
- separator += "\r\n";
- str += "\r\n";
- str += separator;
- ed.SetSel(-1,-1);
- ed.ReplaceSel(str);
-
- if ( 1 || nRows > 100 )
- {
- while ((cur = mysql_fetch_row(result)))
- {
- ProcessYieldMessage ();
- mysql_field_seek(result,0);
- str.Empty();
- ed.SetSel(-1,-1);
- for (uint off=0 ; off < mysql_num_fields(result); off++)
- {
- field = mysql_fetch_field(result);
- length=field->max_length;
- CString strText;
- strText.Format ("%s", cur[off] ? (char*) cur[off] : "NULL");
- str += strText;
- str += "\t";
- }
- str += "\r\n";
- ed.SetSel(-1,-1);
- ed.ReplaceSel(str);
- }
- }
- else
- {
- while ((cur = mysql_fetch_row(result)))
- {
- mysql_field_seek(result,0);
- for (uint off=0 ; off < mysql_num_fields(result); off++)
- {
- field = mysql_fetch_field(result);
- length=field->max_length;
- CString strText;
- strText.Format ("%s", cur[off] ? (char*) cur[off] : "NULL");
- str += strText;
- str += "\t";
- }
- str += "\r\n";
- }
- }
- my_afree((gptr) num_flag);
- str += "\r\n";
- ed.SetTabStops(nFields,rgi);
- delete [] rgi;
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSql::OnQueryPb()
-{
-
- CWaitCursor x;
-// mysql_select_db(m_pdb,"mysql");
-
- if ( m_pResource && m_pResource->GetType() == CResource::eDatabase )
- {
- CString strDB = m_pResource->GetDisplayName();
- strDB.TrimRight();
- if (mysql_select_db(m_pdb,strDB))
- {
- }
- }
-
- m_pQuery->UpdateData();
- m_pResults->m_edit.Empty();
- CString str = m_pQuery->m_edit;
- if ( mysql_real_query(m_pdb,str,str.GetLength())==0 )
- {
- MYSQL_RES *result;
- if ((result=mysql_store_result(m_pdb)))
- {
- my_ulonglong nRows = mysql_num_rows(result);
- m_pResults->UpdateData(FALSE);
- m_tabs.SetCurSel(1);
- ActivateTab ( 1 );
- print_table_data(result,m_pResults->m_edit,m_pResults->m_ctl_edit,m_lf);
-// m_pResults->UpdateData(FALSE);
- m_pResults->m_ctl_edit.SetSel(-1,-1);
- CString strText;
- strText.Format ( "\r\n(%d row(s) affected)\r\n", nRows );
- m_pResults->m_ctl_edit.ReplaceSel(strText);
- mysql_free_result(result);
- }
- else
- {
- m_pResults->m_edit = mysql_error(m_pdb);
- m_pResults->UpdateData(FALSE);
- }
- }
- else
- {
- m_pResults->m_edit = mysql_error(m_pdb);
- m_pResults->UpdateData(FALSE);
- }
-
- m_tabs.SetCurSel(1);
- ActivateTab ( 1 );
-
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSql::OnQueryDatabases()
-{
- CWaitCursor x;
- MYSQL_RES *result;
- m_pResults->m_edit.Empty();
- if ((result=mysql_list_dbs(m_pdb,0)))
- {
- my_ulonglong nRows = mysql_num_rows(result);
- print_table_data(result,m_pResults->m_edit,m_pResults->m_ctl_edit,m_lf);
- //m_pResults->UpdateData(FALSE);
- mysql_free_result(result);
- }
- else
- {
- m_pResults->m_edit = mysql_error(m_pdb);
- m_pResults->UpdateData(FALSE);
- }
-
- m_tabs.SetCurSel(1);
- ActivateTab ( 1 );
-
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSql::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult)
-{
- ActivateTab ( m_tabs.GetCurSel() );
- *pResult = 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSql::OnFontPb()
-{
-
- CFontDialog FontDlg ( & m_lf );
-
- if ( FontDlg.DoModal ( ) == IDOK )
- {
- if (m_font.GetSafeHandle())
- m_font.DeleteObject();
- m_lf = *FontDlg.m_cf.lpLogFont;
- m_font.CreateFontIndirect(FontDlg.m_cf.lpLogFont);
- m_pQuery->SetFont(&m_font);
- m_pResults->SetFont(&m_font);
- m_pStatus->SetFont(&m_font);
- }
-
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSql::DoOnSize(UINT nType, int cx, int cy)
-{
-
- int nx = cx - ( m_rectDlg[CLIENT_COORDS].Width ( ) - m_rectTab[CLIENT_COORDS].Width ( ) );
- int ny = cy - ( m_rectDlg[CLIENT_COORDS].Height ( ) - m_rectTab[CLIENT_COORDS].Height ( ) );
-
- if (IsWindow(m_tabs.GetSafeHwnd()))
- {
- m_tabs.SetWindowPos ( NULL
- , 0
- , 0
- , nx
- , ny
- , SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW );
-
- if (m_pResults&&IsWindow(m_pResults->GetSafeHwnd()))
- m_pResults -> SetWindowPos(NULL,20,24,nx-40,ny-48,SWP_NOZORDER | SWP_NOMOVE );
- if (m_pQuery&&IsWindow(m_pQuery->GetSafeHwnd()))
- m_pQuery -> SetWindowPos(NULL,20,24,nx-40,ny-48,SWP_NOZORDER | SWP_NOMOVE );
- if (m_pStatus&&IsWindow(m_pStatus->GetSafeHwnd()))
- m_pStatus -> SetWindowPos(NULL,20,24,nx-40,ny-48,SWP_NOZORDER | SWP_NOMOVE );
-// switch ( m_tabs.GetCurSel() )
-// {
-// case 0:
-// {
-// if (m_pResults&&IsWindow(m_pResults->GetSafeHwnd()))
-// m_pResults -> SetWindowPos(NULL,20,24,nx-40,ny-48,SWP_NOZORDER | SWP_NOMOVE | SWP_HIDEWINDOW );
-// if (m_pQuery&&IsWindow(m_pQuery->GetSafeHwnd()))
-// m_pQuery -> SetWindowPos(NULL,20,24,nx-40,ny-48,SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW );
-// break;
-// }
-// case 1:
-// {
-// if (m_pQuery&&IsWindow(m_pQuery->GetSafeHwnd()))
-// m_pQuery -> SetWindowPos(NULL,20,24,nx-40,ny-48,SWP_NOZORDER | SWP_NOMOVE | SWP_HIDEWINDOW );
-// if (m_pResults&&IsWindow(m_pResults->GetSafeHwnd()))
-// m_pResults -> SetWindowPos(NULL,20,24,nx-40,ny-48,SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW );
-// break;
-// }
-// }
- }
-
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSql::OnSize(UINT nType, int cx, int cy)
-{
-
- CDialog::OnSize(nType, cx, cy);
-
- DoOnSize ( nType, cx, cy );
-
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSql::OnOK()
-{
- CDialog::OnOK();
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSql::OnCancel()
-{
- CDialog::OnCancel();
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-BOOL CToolSql::PreTranslateMessage(MSG* pMsg)
-{
- return CDialog::PreTranslateMessage(pMsg);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSql::DoProcessListQuery()
-{
-
- MYSQL_RES *result;
- if (result=mysql_list_processes(m_pdb))
- {
- if (m_bClear)
- {
- m_pStatus->m_edit.Empty();
- m_pStatus->UpdateData(FALSE);
- }
- print_table_data(result,m_pStatus->m_edit,m_pStatus->m_ctl_edit,m_lf);
- mysql_free_result(result);
- }
- else
- {
-// my_printf_error(0,"process list failed; error: '%s'",MYF(ME_BELL),mysql_error(mysql));
- }
-
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSql::OnStartPb()
-{
- UpdateData();
- if (m_ui_timer) return;
- if (m_nIntervalTimerSeconds<1) return;
- ActivateTab ( 2 );
- m_ui_timer = SetTimer( MY_TIMER_ID, m_nIntervalTimerSeconds*1000, NULL );
- m_ctl_Start . EnableWindow(FALSE);
- m_ctl_Stop . EnableWindow(TRUE);
- DoProcessListQuery();
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSql::OnStopPb()
-{
- UpdateData();
- if (m_ui_timer)
- {
- KillTimer(MY_TIMER_ID);
- m_ui_timer = 0;
- }
- m_ctl_Start . EnableWindow(TRUE);
- m_ctl_Stop . EnableWindow(FALSE);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSql::OnTimer(UINT nIDEvent)
-{
- DoProcessListQuery();
- CDialog::OnTimer(nIDEvent);
-}
-
-void CToolSql::OnDestroy()
-{
- if (m_ui_timer)
- {
- KillTimer(MY_TIMER_ID);
- m_ui_timer = 0;
- }
- CDialog::OnDestroy();
-}
-
-void CToolSql::OnClear()
-{
- UpdateData();
-}
-
-void CToolSql::OnChangeTimerSecs()
-{
- UpdateData();
-}
diff --git a/VC++Files/mysqlmanager/toolsql.h b/VC++Files/mysqlmanager/toolsql.h
deleted file mode 100644
index 7d608f46cd2..00000000000
--- a/VC++Files/mysqlmanager/toolsql.h
+++ /dev/null
@@ -1,102 +0,0 @@
-#if !defined(AFX_ToolSql_H__826CB2FC_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
-#define AFX_ToolSql_H__826CB2FC_8B6D_11D1_AEC1_00600806E071__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-#include "ToolSqlQuery.h"
-#include "ToolSqlResults.h"
-#include "ToolSqlStatus.h"
-#include "cresource.h"
-#include <my_global.h>
-#include "my_sys.h"
-#include "mysql.h"
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CToolSql dialog
-
-class CToolSql : public CDialog
-{
-// Construction
-public:
- CToolSql(CWnd* pParent = NULL,CResource* pServer=NULL,CResource* pResource=NULL);
- ~CToolSql();
-
-// Dialog Data
- //{{AFX_DATA(CToolSql)
- enum { IDD = IDD_TOOL_SQL };
- CButton m_ctl_Stop;
- CButton m_ctl_Start;
- CComboBox m_ctl_Server;
- CTabCtrl m_tabs;
- int m_nIntervalTimerSeconds;
- BOOL m_bClear;
- //}}AFX_DATA
-
- CBitmapButton m_btn_QueryExec;
- CBitmapButton m_btn_Font;
- CBitmapButton m_btn_QueryDatabases;
-
-#ifdef _WIN64
- __int64 m_ui_timer;
-#else
- UINT m_ui_timer;
-#endif
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CToolSql)
- public:
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-
- void ActivateTab ( int tab );
- void DoProcessListQuery();
-
- CToolSqlQuery* m_pQuery;
- CToolSqlResults* m_pResults;
- CToolSqlStatus* m_pStatus;
-
- CResource* m_pServer;
- CResource* m_pResource;
- MYSQL* m_pdb;
- CFont m_font;
- LOGFONT m_lf;
- CRect m_rectTab[2];
- CRect m_rectDlg[2];
-
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CToolSql)
- virtual BOOL OnInitDialog();
- afx_msg void OnQueryPb();
- afx_msg void OnQueryDatabases();
- afx_msg void OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnFontPb();
- afx_msg void OnSize(UINT nType, int cx, int cy);
- virtual void OnOK();
- virtual void OnCancel();
- afx_msg void OnStartPb();
- afx_msg void OnStopPb();
- afx_msg void OnTimer(UINT nIDEvent);
- afx_msg void OnDestroy();
- afx_msg void OnClear();
- afx_msg void OnChangeTimerSecs();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- void DoOnSize(UINT nType, int cx, int cy) ;
-
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_ToolSql_H__826CB2FC_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
diff --git a/VC++Files/mysqlmanager/toolsqlquery.cpp b/VC++Files/mysqlmanager/toolsqlquery.cpp
deleted file mode 100644
index 1f246f47786..00000000000
--- a/VC++Files/mysqlmanager/toolsqlquery.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-// ToolSqlQuery.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "MySqlManager.h"
-#include "ToolSqlQuery.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-
-CToolSqlQuery::CToolSqlQuery(CWnd* pParent /*=NULL*/)
- : CDialog(CToolSqlQuery::IDD, pParent)
-{
- //{{AFX_DATA_INIT(CToolSqlQuery)
- m_edit = _T("");
- //}}AFX_DATA_INIT
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSqlQuery::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CToolSqlQuery)
- DDX_Control(pDX, IDC_EDIT, m_ctl_edit);
- DDX_Text(pDX, IDC_EDIT, m_edit);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CToolSqlQuery, CDialog)
- //{{AFX_MSG_MAP(CToolSqlQuery)
- ON_WM_SIZE()
- ON_WM_CLOSE()
- ON_COMMAND(IDM_QUERY_EXEC, OnQueryPb)
- ON_COMMAND(IDM_QUERY_DATABASES, OnQueryDatabases)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSqlQuery::SetFont(CFont* pFont, BOOL bRedraw)
-{
- m_ctl_edit.SetFont(pFont,bRedraw);
- m_ctl_edit.Invalidate();
- m_ctl_edit.UpdateWindow();
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSqlQuery::OnSize(UINT nType, int cx, int cy)
-{
- CDialog::OnSize(nType, cx, cy);
- if (IsWindow(m_ctl_edit.GetSafeHwnd()))
- m_ctl_edit.SetWindowPos(NULL,20,24,cx-40,cy-48,SWP_NOZORDER | SWP_NOMOVE);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSqlQuery::OnCancel()
-{
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSqlQuery::OnClose()
-{
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSqlQuery::OnQueryPb()
-{
- GetParent()->GetParent()->PostMessage(WM_COMMAND,IDM_QUERY_EXEC);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSqlQuery::OnQueryDatabases()
-{
- GetParent()->GetParent()->PostMessage(WM_COMMAND,IDM_QUERY_DATABASES);
-}
-/////////////////////////////////////////////////////////////////////////////
-
-BOOL CToolSqlQuery::PreTranslateMessage(MSG* pMsg)
-{
- if (pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST)
- {
- if (::TranslateAccelerator(m_hWnd, m_hAccel, pMsg))
- return TRUE;
- }
- return CDialog::PreTranslateMessage(pMsg);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-BOOL CToolSqlQuery::OnInitDialog()
-{
-
- CDialog::OnInitDialog();
- m_hAccel = ::LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE ( IDR_MAINFRAME ));
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
-}
diff --git a/VC++Files/mysqlmanager/toolsqlquery.h b/VC++Files/mysqlmanager/toolsqlquery.h
deleted file mode 100644
index c5d318c161b..00000000000
--- a/VC++Files/mysqlmanager/toolsqlquery.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#if !defined(AFX_TOOLSQLQUERY_H__826CB2FD_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
-#define AFX_TOOLSQLQUERY_H__826CB2FD_8B6D_11D1_AEC1_00600806E071__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-// ToolSqlQuery.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CToolSqlQuery dialog
-
-class CToolSqlQuery : public CDialog
-{
-// Construction
-public:
- CToolSqlQuery(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(CToolSqlQuery)
- enum { IDD = IDD_TOOL_SQL_QUERY };
- CEdit m_ctl_edit;
- CString m_edit;
- //}}AFX_DATA
-
- HACCEL m_hAccel;
-
- void SetFont(CFont* pFont, BOOL bRedraw = TRUE);
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CToolSqlQuery)
- public:
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CToolSqlQuery)
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnCancel();
- afx_msg void OnClose();
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- afx_msg void OnQueryPb();
- afx_msg void OnQueryDatabases();
-
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_TOOLSQLQUERY_H__826CB2FD_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
diff --git a/VC++Files/mysqlmanager/toolsqlresults.cpp b/VC++Files/mysqlmanager/toolsqlresults.cpp
deleted file mode 100644
index b6cfcded18b..00000000000
--- a/VC++Files/mysqlmanager/toolsqlresults.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-// ToolSqlResults.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "MySqlManager.h"
-#include "ToolSqlResults.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-
-CToolSqlResults::CToolSqlResults(CWnd* pParent /*=NULL*/)
- : CDialog(CToolSqlResults::IDD, pParent)
-{
- //{{AFX_DATA_INIT(CToolSqlResults)
- m_edit = _T("");
- //}}AFX_DATA_INIT
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSqlResults::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CToolSqlResults)
- DDX_Control(pDX, IDC_EDIT, m_ctl_edit);
- DDX_Text(pDX, IDC_EDIT, m_edit);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CToolSqlResults, CDialog)
- //{{AFX_MSG_MAP(CToolSqlResults)
- ON_WM_SIZE()
- ON_WM_CLOSE()
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSqlResults::SetFont(CFont* pFont, BOOL bRedraw)
-{
- m_ctl_edit.SetFont(pFont,bRedraw);
- m_ctl_edit.Invalidate();
- m_ctl_edit.UpdateWindow();
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSqlResults::OnSize(UINT nType, int cx, int cy)
-{
- CDialog::OnSize(nType, cx, cy);
- if (IsWindow(m_ctl_edit.GetSafeHwnd()))
- m_ctl_edit.SetWindowPos(NULL,20,24,cx-40,cy-48,SWP_NOZORDER | SWP_NOMOVE);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSqlResults::OnCancel()
-{
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-void CToolSqlResults::OnClose()
-{
-}
diff --git a/VC++Files/mysqlmanager/toolsqlresults.h b/VC++Files/mysqlmanager/toolsqlresults.h
deleted file mode 100644
index c4de651cb81..00000000000
--- a/VC++Files/mysqlmanager/toolsqlresults.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#if !defined(AFX_TOOLSQLRESULTS_H__826CB2FE_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
-#define AFX_TOOLSQLRESULTS_H__826CB2FE_8B6D_11D1_AEC1_00600806E071__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-// ToolSqlResults.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CToolSqlResults dialog
-
-class CToolSqlResults : public CDialog
-{
-// Construction
-public:
- CToolSqlResults(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(CToolSqlResults)
- enum { IDD = IDD_TOOL_SQL_RESULTS };
- CEdit m_ctl_edit;
- CString m_edit;
- //}}AFX_DATA
-
- void SetFont(CFont* pFont, BOOL bRedraw = TRUE);
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CToolSqlResults)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CToolSqlResults)
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnCancel();
- afx_msg void OnClose();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
-
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_TOOLSQLRESULTS_H__826CB2FE_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
diff --git a/VC++Files/mysqlmanager/toolsqlstatus.cpp b/VC++Files/mysqlmanager/toolsqlstatus.cpp
deleted file mode 100644
index 81605480783..00000000000
--- a/VC++Files/mysqlmanager/toolsqlstatus.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-// ToolSqlStatus.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "mysqlmanager.h"
-#include "ToolSqlStatus.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CToolSqlStatus dialog
-
-
-CToolSqlStatus::CToolSqlStatus(CWnd* pParent /*=NULL*/)
- : CDialog(CToolSqlStatus::IDD, pParent)
-{
- //{{AFX_DATA_INIT(CToolSqlStatus)
- m_edit = _T("");
- //}}AFX_DATA_INIT
-}
-
-
-void CToolSqlStatus::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CToolSqlStatus)
- DDX_Control(pDX, IDC_EDIT, m_ctl_edit);
- DDX_Text(pDX, IDC_EDIT, m_edit);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CToolSqlStatus, CDialog)
- //{{AFX_MSG_MAP(CToolSqlStatus)
- ON_WM_DESTROY()
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CToolSqlStatus message handlers
-
-void CToolSqlStatus::OnDestroy()
-{
- CDialog::OnDestroy();
-
-}
diff --git a/VC++Files/mysqlmanager/toolsqlstatus.h b/VC++Files/mysqlmanager/toolsqlstatus.h
deleted file mode 100644
index 5e4883b0b30..00000000000
--- a/VC++Files/mysqlmanager/toolsqlstatus.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#if !defined(AFX_TOOLSQLSTATUS_H__40C861B4_9E5A_11D1_AED0_00600806E071__INCLUDED_)
-#define AFX_TOOLSQLSTATUS_H__40C861B4_9E5A_11D1_AED0_00600806E071__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-// ToolSqlStatus.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CToolSqlStatus dialog
-
-class CToolSqlStatus : public CDialog
-{
-// Construction
-public:
- CToolSqlStatus(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(CToolSqlStatus)
- enum { IDD = IDD_TOOL_SQL_STATUS };
- CEdit m_ctl_edit;
- CString m_edit;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CToolSqlStatus)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CToolSqlStatus)
- afx_msg void OnDestroy();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_TOOLSQLSTATUS_H__40C861B4_9E5A_11D1_AED0_00600806E071__INCLUDED_)
diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp
index ac0a241d661..7e13436bb97 100644
--- a/VC++Files/sql/mysqld.dsp
+++ b/VC++Files/sql/mysqld.dsp
@@ -924,76 +924,139 @@ SOURCE=.\message.mc
!IF "$(CFG)" == "mysqld - Win32 Release"
+# Begin Custom Build
+InputPath=.\message.mc
+
+BuildCmds= \
+ mc message.mc
+
+"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
!ELSEIF "$(CFG)" == "mysqld - Win32 Debug"
+# Begin Custom Build
+InputPath=.\message.mc
+
+BuildCmds= \
+ mc message.mc
+
+"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
!ELSEIF "$(CFG)" == "mysqld - Win32 nt"
-# Begin Custom Build - Compiling messages
-InputDir=.
+# Begin Custom Build
InputPath=.\message.mc
-InputName=message
BuildCmds= \
- mc.exe "$(InputDir)\$(InputName).mc"
+ mc message.mc
-"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "mysqld - Win32 Max nt"
-# Begin Custom Build - Compiling messages
-InputDir=.
+
+# Begin Custom Build
InputPath=.\message.mc
-InputName=message
BuildCmds= \
- mc.exe "$(InputDir)\$(InputName).mc"
+ mc message.mc
-"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
+
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
+# Begin Custom Build
+InputPath=.\message.mc
+
+BuildCmds= \
+ mc message.mc
+
+"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+# Begin Custom Build
+InputPath=.\message.mc
+
+BuildCmds= \
+ mc message.mc
+
+"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+# Begin Custom Build
+InputPath=.\message.mc
+
+BuildCmds= \
+ mc message.mc
+
+"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
-# Begin Custom Build - Compiling messages
-InputDir=.
+
+# Begin Custom Build
InputPath=.\message.mc
-InputName=message
BuildCmds= \
- mc.exe "$(InputDir)\$(InputName).mc"
+ mc message.mc
-"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
+
!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
-# Begin Custom Build - Compiling messages
-InputDir=.
+
+# Begin Custom Build
InputPath=.\message.mc
-InputName=message
BuildCmds= \
- mc.exe "$(InputDir)\$(InputName).mc"
+ mc message.mc
-"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
-"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
+
!ENDIF
# End Source File
diff --git a/client/Makefile.am b/client/Makefile.am
index 95000fff5c5..bd39ad6c664 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -21,6 +21,7 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \
$(openssl_includes) -I$(top_srcdir)/extra
LIBS = @CLIENT_LIBS@
DEPLIB= ../libmysql/libmysqlclient.la
+REGEXLIB= ../regex/libregex.a
LDADD = @CLIENT_EXTRA_LDFLAGS@ $(DEPLIB)
bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \
mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen
@@ -37,8 +38,8 @@ mysqlshow_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
mysqldump_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
mysqlimport_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
mysqltest_SOURCES= mysqltest.c ../mysys/my_getsystime.c
-mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
-mysqltest_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a
+mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(REGEXLIB) $(DEPLIB)
+mysqltest_LDADD = $(REGEXLIB) $(LDADD)
mysqlbinlog_SOURCES = mysqlbinlog.cc ../mysys/mf_tempdir.c
mysqlbinlog_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
mysqlmanagerc_SOURCES = mysqlmanagerc.c
diff --git a/client/mysql.cc b/client/mysql.cc
index cb3a56972fa..ace595f9cad 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1677,7 +1677,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
if (num_fields == 2)
{
put_info("Many help items for your request exist.", INFO_INFO);
- put_info("To make a more specific request, please type 'help <item>',\nwhere item is one of the following", INFO_INFO);
+ put_info("To make a more specific request, please type 'help <item>',\nwhere <item> is one of the following", INFO_INFO);
num_name= 0;
num_cat= 1;
last_char= '_';
@@ -1685,7 +1685,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
else if ((cur= mysql_fetch_row(result)))
{
tee_fprintf(PAGER, "You asked for help about help category: \"%s\"\n", cur[0]);
- put_info("For more information, type 'help <item>', where item is one of the following", INFO_INFO);
+ put_info("For more information, type 'help <item>', where <item> is one of the following", INFO_INFO);
num_name= 1;
num_cat= 2;
print_help_item(&cur,1,2,&last_char);
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 8fb48753a8c..042ce7e28a5 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -160,7 +160,7 @@ static struct my_option my_long_options[] =
(gptr*) &opt_compatible_mode_str, (gptr*) &opt_compatible_mode_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compact", OPT_COMPACT,
- "Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-lock-tables",
+ "Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-add-locks",
(gptr*) &opt_compact, (gptr*) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"complete-insert", 'c', "Use complete insert statements.", (gptr*) &cFlag,
@@ -1848,8 +1848,6 @@ static void dumpTable(uint numFields, char *table)
err:
if (query != query_buf)
my_free(query, MYF(MY_ALLOW_ZERO_PTR));
- if (order_by)
- my_free(order_by, MYF(0));
safe_exit(error);
return;
} /* dumpTable */
@@ -1967,7 +1965,7 @@ static int init_dumping(char *database)
sprintf(qbuf,"SHOW CREATE DATABASE IF NOT EXISTS %s",
qdatabase);
- if (mysql_query_with_error_report(sock, &dbinfo, qbuf))
+ if (mysql_query(sock, qbuf) || !(dbinfo = mysql_store_result(sock)))
{
/* Old server version, dump generic CREATE DATABASE */
fprintf(md_result_file,
@@ -2029,6 +2027,8 @@ static int dump_all_tables_in_db(char *database)
numrows = getTableStructure(table, database);
if (!dFlag && numrows > 0)
dumpTable(numrows,table);
+ my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
+ order_by= 0;
}
if (opt_xml)
{
@@ -2130,6 +2130,8 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
numrows = getTableStructure(table_names[i], db);
if (!dFlag && numrows > 0)
dumpTable(numrows, table_names[i]);
+ my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
+ order_by= 0;
}
if (was_views)
{
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 8ddcfb90cad..bf8f0935067 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -227,7 +227,7 @@ typedef struct
int alloced;
} VAR;
-#ifdef __NETWARE__
+#if defined(__NETWARE__) || defined(__WIN__)
/*
Netware doesn't proved environment variable substitution that is done
by the shell in unix environments. We do this in the following function:
@@ -4609,6 +4609,9 @@ static char *subst_env_var(const char *str)
*/
#undef popen /* Remove wrapper */
+#ifdef __WIN__
+#define popen _popen /* redefine for windows */
+#endif
FILE *my_popen(const char *cmd, const char *mode __attribute__((unused)))
{
diff --git a/config/ac-macros/character_sets.m4 b/config/ac-macros/character_sets.m4
index 77081639897..8f1d2f23715 100644
--- a/config/ac-macros/character_sets.m4
+++ b/config/ac-macros/character_sets.m4
@@ -287,7 +287,7 @@ case $default_charset in
;;
latin1)
default_charset_default_collation="latin1_swedish_ci"
- default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_swedish_ci"
+ default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_spanish_ci latin1_swedish_ci"
;;
latin2)
default_charset_default_collation="latin2_general_ci"
diff --git a/configure.in b/configure.in
index 9e1e57630d4..12dab3d2513 100644
--- a/configure.in
+++ b/configure.in
@@ -749,7 +749,8 @@ AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \
strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
- sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h linux/config.h sys/resource.h sys/param.h)
+ sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h linux/config.h \
+ sys/resource.h sys/param.h)
#--------------------------------------------------------------------
# Check for system libraries. Adds the library to $LIBS
@@ -1919,7 +1920,9 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
- realpath rename rint rwlock_init setupterm sighold sigset sigthreadmask \
+ realpath rename rint rwlock_init setupterm \
+ shmget shmat shmdt shmctl \
+ sighold sigset sigthreadmask \
snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \
strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr)
@@ -2648,15 +2651,26 @@ then
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster"
CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS)"
- if test "$with_debug" = "yes"
+ if test "$have_ndb_debug" = "default"
+ then
+ have_ndb_debug=$with_debug
+ fi
+
+ if test "$have_ndb_debug" = "yes"
then
# Medium debug.
NDB_DEFS="-DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
- elif test "$with_debug" = "full"
+ elif test "$have_ndb_debug" = "full"
then
NDB_DEFS="-DNDB_DEBUG_FULL -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
else
- NDB_DEFS="-DNDEBUG"
+ # no extra ndb debug but still do asserts if debug version
+ if test "$with_debug" = "yes" -o "$with_debug" = "full"
+ then
+ NDB_DEFS=""
+ else
+ NDB_DEFS="-DNDEBUG"
+ fi
fi
AC_SUBST([NDB_DEFS])
@@ -2676,10 +2690,19 @@ fi
AC_SUBST([ndb_port_base])
ndb_transporter_opt_objs=""
-if test X"$have_ndb_shm" = Xyes
-then
- ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo"
+if test "$ac_cv_func_shmget" = "yes" &&
+ test "$ac_cv_func_shmat" = "yes" &&
+ test "$ac_cv_func_shmdt" = "yes" &&
+ test "$ac_cv_func_shmctl" = "yes"
+then
+ AC_DEFINE([NDB_SHM_TRANSPORTER], [1],
+ [Including Ndb Cluster DB shared memory transporter])
+ AC_MSG_RESULT([Including ndb shared memory transporter])
+ ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo"
+else
+ AC_MSG_RESULT([Not including ndb shared memory transporter])
fi
+
if test X"$have_ndb_sci" = Xyes
then
ndb_transporter_opt_objs="$ndb_transporter_opt_objs SCI_Transporter.lo"
diff --git a/dbug/dbug_analyze.c b/dbug/dbug_analyze.c
index 0841e8e0b70..1db056d549c 100644
--- a/dbug/dbug_analyze.c
+++ b/dbug/dbug_analyze.c
@@ -51,6 +51,7 @@
#include <my_global.h>
#include <m_string.h>
+#include <my_pthread.h>
static char *my_name;
static int verbose;
@@ -246,7 +247,7 @@ char *m_name;
modules[n_items].m_stkuse = 0;
DBUG_RETURN (n_items++);
}
- while (cmp = strcmp (m_name,modules[ind].name)) {
+ while ((cmp = strcmp (m_name,modules[ind].name))) {
if (cmp < 0) { /* In left subtree */
if (s_table[ind].lchild == MAXPROCS) {
/* Add as left child */
@@ -392,7 +393,7 @@ FILE *inf;
}
break;
default:
- fprintf (stderr, "unknown record type '%s'\n", buf[0]);
+ fprintf (stderr, "unknown record type '%c'\n", buf[0]);
break;
}
next_line:;
@@ -450,10 +451,11 @@ FILE *outf;
unsigned long int sum_calls, sum_time;
{
DBUG_ENTER ("out_trailer");
- if (verbose) {
- fprintf (outf, "======\t==========\t===========\t==========\t========\n");
- fprintf (outf, "%6d\t%10.2f\t%11d\t%10.2f\t\t%-15s\n",
- sum_calls, 100.0, sum_time, 100.0, "Totals");
+ if (verbose)
+ {
+ fprintf(outf, "======\t==========\t===========\t==========\t========\n");
+ fprintf(outf, "%6ld\t%10.2f\t%11ld\t%10.2f\t\t%-15s\n",
+ sum_calls, 100.0, sum_time, 100.0, "Totals");
}
DBUG_VOID_RETURN;
}
@@ -488,16 +490,16 @@ unsigned long int *called, *timed;
import = (unsigned int) (per_time * per_calls);
if (verbose) {
- fprintf (outf, "%6d\t%10.2f\t%11d\t%10.2f %10d\t%-15s\n",
+ fprintf (outf, "%6d\t%10.2f\t%11ld\t%10.2f %10d\t%-15s\n",
calls, per_calls, time, per_time, import, name);
} else {
ms_per_call = time;
ms_per_call /= calls;
ftime = time;
ftime /= 1000;
- fprintf (outf, "%8.2f%8.3f%8u%8.3f%8.2f%8u%8u %-s\n",
- per_time, ftime, calls, ms_per_call, per_calls, import,
- stkuse, name);
+ fprintf(outf, "%8.2f%8.3f%8u%8.3f%8.2f%8u%8lu %-s\n",
+ per_time, ftime, calls, ms_per_call, per_calls, import,
+ stkuse, name);
}
*called = calls;
*timed = time;
diff --git a/include/errmsg.h b/include/errmsg.h
index 55bbdf6d767..ae3b04b4f3a 100644
--- a/include/errmsg.h
+++ b/include/errmsg.h
@@ -94,6 +94,7 @@ extern const char *client_errors[]; /* Error messages */
#define CR_SECURE_AUTH 2049
#define CR_FETCH_CANCELED 2050
#define CR_NO_DATA 2051
-#define CR_ERROR_LAST /*Copy last error nr:*/ 2051
+#define CR_NO_STMT_METADATA 2052
+#define CR_ERROR_LAST /*Copy last error nr:*/ 2052
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
diff --git a/include/my_base.h b/include/my_base.h
index dd1c56eb8bb..1713a07f6ec 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -311,7 +311,8 @@ enum ha_base_keytype {
#define HA_ERR_NO_SUCH_TABLE 155 /* The table does not exist in engine */
#define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */
#define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */
-#define HA_ERR_LAST 157 /*Copy last error nr.*/
+#define HA_ERR_NULL_IN_SPATIAL 158 /* NULLs are not supported in spatial index */
+#define HA_ERR_LAST 158 /*Copy last error nr.*/
/* Add error numbers before HA_ERR_LAST and change it accordingly. */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
diff --git a/include/my_handler.h b/include/my_handler.h
index 9ddc0c61eee..cad15d5471f 100644
--- a/include/my_handler.h
+++ b/include/my_handler.h
@@ -25,17 +25,17 @@
typedef struct st_HA_KEYSEG /* Key-portion */
{
+ CHARSET_INFO *charset;
+ uint32 start; /* Start of key in record */
+ uint32 null_pos; /* position to NULL indicator */
+ uint16 bit_pos; /* Position to bit part */
+ uint16 flag;
+ uint16 length; /* Keylength */
uint8 type; /* Type of key (for sort) */
uint8 language;
uint8 null_bit; /* bitmask to test for NULL */
uint8 bit_start,bit_end; /* if bit field */
- uint16 flag;
- uint16 length; /* Keylength */
- uint32 start; /* Start of key in record */
- uint32 null_pos; /* position to NULL indicator */
- CHARSET_INFO *charset;
- uint8 bit_length; /* Length of bit part */
- uint16 bit_pos; /* Position to bit part */
+ uint8 bit_length; /* Length of bit part */
} HA_KEYSEG;
#define get_key_length(length,key) \
diff --git a/include/myisam.h b/include/myisam.h
index 6d097770646..fd75af2d997 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -107,12 +107,13 @@ typedef struct st_mi_create_info
} MI_CREATE_INFO;
struct st_myisam_info; /* For referense */
+struct st_mi_isam_share;
typedef struct st_myisam_info MI_INFO;
-
struct st_mi_s_param;
typedef struct st_mi_keydef /* Key definition with open & info */
{
+ struct st_mi_isam_share *share; /* Pointer to base (set in mi_open) */
uint16 keysegs; /* Number of key-segment */
uint16 flag; /* NOSAME, PACK_USED */
diff --git a/include/raid.h b/include/raid.h
index b5a5e665824..04c54393e54 100644
--- a/include/raid.h
+++ b/include/raid.h
@@ -32,9 +32,6 @@ C_MODE_END
#endif
#if defined(USE_RAID)
-#ifdef __GNUC__
-#pragma interface /* gcc class implementation */
-#endif
#include "my_dir.h"
/* Trap all occurences of my_...() in source and use our wrapper around this function */
@@ -92,6 +89,10 @@ extern "C" {
#ifdef __cplusplus
}
+#ifdef __GNUC__
+#pragma interface /* gcc class implementation */
+#endif
+
class RaidName {
public:
RaidName(const char *FileName);
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index 0aaa3a9a721..d5e0a46fd39 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -2391,6 +2391,8 @@ dict_scan_id(
ulint len = 0;
const char* s;
char* d;
+ ulint id_len;
+ byte* b;
*id = NULL;
@@ -2452,6 +2454,28 @@ dict_scan_id(
*id = s;
}
+ if (heap && !quote) {
+ /* EMS MySQL Manager sometimes adds characters 0xA0 (in
+ latin1, a 'non-breakable space') to the end of a table name.
+ But isspace(0xA0) is not true, which confuses our foreign key
+ parser. After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2
+ and 0xA0 are at the end of the string.
+
+ TODO: we should lex the string using thd->charset_info, and
+ my_isspace(). Only after that, convert id names to UTF-8. */
+
+ b = (byte*)(*id);
+ id_len = strlen(b);
+
+ if (id_len >= 3 && b[id_len - 1] == 0xA0
+ && b[id_len - 2] == 0xC2) {
+
+ /* Strip the 2 last bytes */
+
+ b[id_len - 2] = '\0';
+ }
+ }
+
return(ptr);
}
@@ -2506,7 +2530,7 @@ dict_scan_col(
}
/*************************************************************************
-Scans the referenced table name from an SQL string. */
+Scans a table name from an SQL string. */
static
const char*
dict_scan_table_name(
@@ -2517,7 +2541,7 @@ dict_scan_table_name(
const char* name, /* in: foreign key table name */
ibool* success,/* out: TRUE if ok name found */
mem_heap_t* heap, /* in: heap where to allocate the id */
- const char** ref_name)/* out,own: the referenced table name;
+ const char** ref_name)/* out,own: the table name;
NULL if no name was scannable */
{
const char* database_name = NULL;
@@ -3689,6 +3713,29 @@ dict_tree_find_index_for_tuple(
return(index);
}
+/***********************************************************************
+Checks if a table which is a mixed cluster member owns a record. */
+
+ibool
+dict_is_mixed_table_rec(
+/*====================*/
+ /* out: TRUE if the record belongs to this
+ table */
+ dict_table_t* table, /* in: table in a mixed cluster */
+ rec_t* rec) /* in: user record in the clustered index */
+{
+ byte* mix_id_field;
+ ulint len;
+
+ ut_ad(!table->comp);
+
+ mix_id_field = rec_get_nth_field_old(rec,
+ table->mix_len, &len);
+
+ return(len == table->mix_id_len
+ && !ut_memcmp(table->mix_id_buf, mix_id_field, len));
+}
+
/**************************************************************************
Checks that a tuple has n_fields_cmp value in a sensible range, so that
no comparison can occur with the page number field in a node pointer. */
diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c
index c80f8346abf..12ceba38815 100644
--- a/innobase/dict/dict0load.c
+++ b/innobase/dict/dict0load.c
@@ -8,6 +8,7 @@ Created 4/24/1996 Heikki Tuuri
*******************************************************/
#include "dict0load.h"
+#include "mysql_version.h"
#ifdef UNIV_NONINL
#include "dict0load.ic"
@@ -766,6 +767,22 @@ dict_load_table(
return(NULL);
}
+#if MYSQL_VERSION_ID < 50003
+ /* Starting from MySQL 5.0.3, the high-order bit of MIX_LEN is the
+ "compact format" flag. */
+ field = rec_get_nth_field(rec, 7, &len);
+ if (mach_read_from_1(field) & 0x80) {
+ btr_pcur_close(&pcur);
+ mtr_commit(&mtr);
+ mem_heap_free(heap);
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: table %s is in the new compact format\n"
+ "InnoDB: of MySQL 5.0.3 or later\n", name);
+ return(NULL);
+ }
+#endif /* MYSQL_VERSION_ID < 50300 */
+
ut_a(0 == ut_strcmp("SPACE",
dict_field_get_col(
dict_index_get_nth_field(sys_index, 9))->name));
diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c
index dea48117e00..f62f63da538 100644
--- a/innobase/fil/fil0fil.c
+++ b/innobase/fil/fil0fil.c
@@ -614,9 +614,9 @@ fil_try_to_close_file_in_LRU(
fputs("InnoDB: cannot close file ", stderr);
ut_print_filename(stderr, node->name);
fprintf(stderr,
- ", because mod_count %lld != fl_count %lld\n",
- node->modification_counter,
- node->flush_counter);
+ ", because mod_count %ld != fl_count %ld\n",
+ (long) node->modification_counter,
+ (long) node->flush_counter);
}
node = UT_LIST_GET_PREV(LRU, node);
diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c
index 959c66159c5..cd5ac0da231 100644
--- a/innobase/ibuf/ibuf0ibuf.c
+++ b/innobase/ibuf/ibuf0ibuf.c
@@ -1140,7 +1140,8 @@ void
ibuf_dummy_index_add_col(
/*====================*/
dict_index_t* index, /* in: dummy index */
- dtype_t* type) /* in: the data type of the column */
+ dtype_t* type, /* in: the data type of the column */
+ ulint len) /* in: length of the column */
{
ulint i = index->table->n_def;
dict_mem_table_add_col(index->table, "DUMMY",
@@ -1149,7 +1150,7 @@ ibuf_dummy_index_add_col(
dtype_get_len(type),
dtype_get_prec(type));
dict_index_add_col(index,
- dict_table_get_nth_col(index->table, i), 0, 0);
+ dict_table_get_nth_col(index->table, i), 0, len);
}
/************************************************************************
Deallocates a dummy index for inserting a record to a non-clustered index.
@@ -1259,7 +1260,7 @@ ibuf_build_entry_from_ibuf_rec(
dfield_get_type(field),
types + i * DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE);
- ibuf_dummy_index_add_col(index, dfield_get_type(field));
+ ibuf_dummy_index_add_col(index, dfield_get_type(field), len);
}
*pindex = index;
diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h
index a2399a81ca9..eaf5b06b2a9 100644
--- a/innobase/include/dict0dict.h
+++ b/innobase/include/dict0dict.h
@@ -657,19 +657,6 @@ dict_index_copy_types(
dtuple_t* tuple, /* in: data tuple */
dict_index_t* index, /* in: index */
ulint n_fields); /* in: number of field types to copy */
-/************************************************************************
-Gets the value of a system column in a clustered index record. The clustered
-index must contain the system column: if the index is unique, row id is
-not contained there! */
-UNIV_INLINE
-dulint
-dict_index_rec_get_sys_col(
-/*=======================*/
- /* out: system column value */
- dict_index_t* index, /* in: clustered index describing the record */
- const ulint* offsets,/* in: offsets returned by rec_get_offsets() */
- ulint type, /* in: column type: DATA_ROLL_PTR, ... */
- rec_t* rec); /* in: record */
/*************************************************************************
Gets the index tree where the index is stored. */
UNIV_INLINE
@@ -731,7 +718,7 @@ dict_tree_find_index_for_tuple(
dtuple_t* tuple); /* in: tuple for which to find index */
/***********************************************************************
Checks if a table which is a mixed cluster member owns a record. */
-UNIV_INLINE
+
ibool
dict_is_mixed_table_rec(
/*====================*/
diff --git a/innobase/include/dict0dict.ic b/innobase/include/dict0dict.ic
index 7f754e316b3..928a693f860 100644
--- a/innobase/include/dict0dict.ic
+++ b/innobase/include/dict0dict.ic
@@ -9,7 +9,6 @@ Created 1/8/1996 Heikki Tuuri
#include "dict0load.h"
#include "trx0undo.h"
#include "trx0sys.h"
-#include "rem0rec.h"
/*************************************************************************
Gets the column data type. */
@@ -312,51 +311,6 @@ dict_index_get_sys_col_pos(
dict_table_get_sys_col_no(index->table, type)));
}
-/************************************************************************
-Gets the value of a system column in a clustered index record. The clustered
-index must contain the system column: if the index is unique, row id is
-not contained there! */
-UNIV_INLINE
-dulint
-dict_index_rec_get_sys_col(
-/*=======================*/
- /* out: system column value */
- dict_index_t* index, /* in: clustered index describing the record */
- const ulint* offsets,/* in: offsets returned by rec_get_offsets() */
- ulint type, /* in: column type: DATA_ROLL_PTR, ... */
- rec_t* rec) /* in: record */
-{
- ulint pos;
- byte* field;
- ulint len;
-
- ut_ad(index);
- ut_ad(index->type & DICT_CLUSTERED);
- ut_ad(rec_offs_validate(rec, index, offsets));
-
- pos = dict_index_get_sys_col_pos(index, type);
-
- ut_ad(pos != ULINT_UNDEFINED);
-
- field = rec_get_nth_field(rec, offsets, pos, &len);
-
- if (type == DATA_ROLL_PTR) {
- ut_ad(len == 7);
-
- return(trx_read_roll_ptr(field));
- } else if (type == DATA_TRX_ID) {
-
- return(trx_read_trx_id(field));
- } else if (type == DATA_MIX_ID) {
-
- return(mach_dulint_read_compressed(field));
- } else {
- ut_a(type == DATA_ROW_ID);
-
- return(mach_read_from_6(field));
- }
-}
-
/*************************************************************************
Gets the index tree where the index is stored. */
UNIV_INLINE
@@ -664,31 +618,3 @@ dict_table_get_index(
return(index);
}
-
-/***********************************************************************
-Checks if a table which is a mixed cluster member owns a record. */
-UNIV_INLINE
-ibool
-dict_is_mixed_table_rec(
-/*====================*/
- /* out: TRUE if the record belongs to this
- table */
- dict_table_t* table, /* in: table in a mixed cluster */
- rec_t* rec) /* in: user record in the clustered index */
-{
- byte* mix_id_field;
- ulint len;
-
- ut_ad(!table->comp);
-
- mix_id_field = rec_get_nth_field_old(rec,
- table->mix_len, &len);
-
- if ((len != table->mix_id_len)
- || (0 != ut_memcmp(table->mix_id_buf, mix_id_field, len))) {
-
- return(FALSE);
- }
-
- return(TRUE);
-}
diff --git a/innobase/include/rem0rec.ic b/innobase/include/rem0rec.ic
index b9a79c259a4..7d35e8e4110 100644
--- a/innobase/include/rem0rec.ic
+++ b/innobase/include/rem0rec.ic
@@ -880,7 +880,6 @@ rec_get_nth_field(
length = rec_offs_base(offsets)[1 + n];
if (length & REC_OFFS_SQL_NULL) {
- field = NULL;
length = UNIV_SQL_NULL;
} else {
length &= REC_OFFS_MASK;
@@ -1185,6 +1184,7 @@ rec_set_nth_field(
byte* data2;
ulint len2;
+ ut_ad(rec);
ut_ad(rec_offs_validate(rec, NULL, offsets));
if (len == UNIV_SQL_NULL) {
@@ -1195,14 +1195,15 @@ rec_set_nth_field(
}
data2 = rec_get_nth_field(rec, offsets, n, &len2);
- ut_ad(len2 == len);
-
- ut_memcpy(data2, data, len);
-
if (len2 == UNIV_SQL_NULL) {
ut_ad(!rec_offs_comp(offsets));
rec_set_nth_field_null_bit(rec, n, FALSE);
+ ut_ad(len == rec_get_nth_field_size(rec, n));
+ } else {
+ ut_ad(len2 == len);
}
+
+ ut_memcpy(data2, data, len);
}
/**************************************************************
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index 1e3eeb0de02..434f9460bb6 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -398,10 +398,19 @@ os_file_lock(
lk.l_start = lk.l_len = 0;
if (fcntl(fd, F_SETLK, &lk) == -1) {
fprintf(stderr,
- "InnoDB: Unable to lock %s, error: %d", name, errno);
+ "InnoDB: Unable to lock %s, error: %d\n", name, errno);
+
+ if (errno == EAGAIN || errno == EACCES) {
+ fprintf(stderr,
+"InnoDB: Check that you do not already have another mysqld process\n"
+"InnoDB: using the same InnoDB data or log files.\n");
+ }
+
close(fd);
+
return(-1);
}
+
return(0);
}
#endif /* USE_FILE_LOCK */
@@ -1672,7 +1681,7 @@ os_file_set_size(
}
/* Print about progress for each 100 MB written */
- if ((offset + n_bytes) / (ib_longlong)(100 * 1024 * 1024)
+ if ((ib_longlong) (offset + n_bytes) / (ib_longlong)(100 * 1024 * 1024)
!= offset / (ib_longlong)(100 * 1024 * 1024)) {
fprintf(stderr, " %lu00",
diff --git a/innobase/page/page0page.c b/innobase/page/page0page.c
index 20bbfba7a50..d71c243e7c5 100644
--- a/innobase/page/page0page.c
+++ b/innobase/page/page0page.c
@@ -103,7 +103,7 @@ page_dir_find_owner_slot(
(ulong) buf_frame_get_page_no(page));
if (comp) {
- fputs("(compact record)\n", stderr);
+ fputs("(compact record)", stderr);
} else {
rec_print_old(stderr, original_rec);
}
@@ -113,7 +113,11 @@ page_dir_find_owner_slot(
fputs(
"InnoDB: Cannot find the dir slot for record ",
stderr);
- rec_print(stderr, rec, NULL);
+ if (comp) {
+ fputs("(compact record)", stderr);
+ } else {
+ rec_print_old(stderr, rec);
+ }
fputs("\n"
"InnoDB: on that page!\n", stderr);
diff --git a/innobase/rem/rem0rec.c b/innobase/rem/rem0rec.c
index 90cbffe7a9e..30f98f457ea 100644
--- a/innobase/rem/rem0rec.c
+++ b/innobase/rem/rem0rec.c
@@ -137,16 +137,18 @@ rec_validate_old(
rec_t* rec); /* in: physical record */
/**********************************************************
-The following function determines the offsets to each field
-in the record. The offsets are written to an array of
-ulint[n+2], with [0] being the number of fields (n), [1] being the
-extra size (if REC_OFFS_COMPACT is set, the record is in the new
-format), and [2]..[n+1] being the offsets past the end of
-fields 0..n, or to the beginning of fields 1..n+1. When the
-high-order bit of the offset at [n+1] is set (REC_OFFS_SQL_NULL),
-the field n is NULL. When the second high-order bit of the offset
-at [n+1] is set (REC_OFFS_EXTERNAL), the field n is being stored
-externally. */
+The following function determines the offsets to each field in the
+record. The offsets are written to a previously allocated array of
+ulint, where rec_offs_n_fields(offsets) has been initialized to the
+number of fields in the record. The rest of the array will be
+initialized by this function. rec_offs_base(offsets)[0] will be set
+to the extra size (if REC_OFFS_COMPACT is set, the record is in the
+new format), and rec_offs_base(offsets)[1..n_fields] will be set to
+offsets past the end of fields 0..n_fields, or to the beginning of
+fields 1..n_fields+1. When the high-order bit of the offset at [i+1]
+is set (REC_OFFS_SQL_NULL), the field i is NULL. When the second
+high-order bit of the offset at [i+1] is set (REC_OFFS_EXTERNAL), the
+field i is being stored externally. */
static
void
rec_init_offsets(
@@ -154,8 +156,8 @@ rec_init_offsets(
/* out: the offsets */
rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */
- ulint* offsets)/* in:/out: ulint[n+2];
- n=rec_offs_n_fields(offsets) */
+ ulint* offsets)/* in/out: array of offsets;
+ in: n=rec_offs_n_fields(offsets) */
{
ulint n_fields = rec_offs_n_fields(offsets);
ulint i = 0;
diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c
index e4013633bed..c3b4117ee8b 100644
--- a/innobase/row/row0upd.c
+++ b/innobase/row/row0upd.c
@@ -1531,8 +1531,8 @@ row_upd_clust_rec(
rec_t* rec;
mtr_start(mtr);
- rec = btr_cur_get_rec(btr_cur);
ut_a(btr_pcur_restore_position(BTR_MODIFY_TREE, pcur, mtr));
+ rec = btr_cur_get_rec(btr_cur);
err = btr_store_big_rec_extern_fields(index, rec,
rec_get_offsets(rec, index, offsets_,
ULINT_UNDEFINED, &heap),
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index 83d4fb4d39d..e09ab7ea7fc 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -1573,7 +1573,6 @@ srv_printf_innodb_monitor(
srv_last_monitor_time = time(NULL);
- rewind(file);
fputs("\n=====================================\n", file);
ut_print_timestamp(file);
diff --git a/innobase/trx/trx0rec.c b/innobase/trx/trx0rec.c
index 12a0512da53..90ecb217c1d 100644
--- a/innobase/trx/trx0rec.c
+++ b/innobase/trx/trx0rec.c
@@ -485,10 +485,15 @@ trx_undo_page_report_modify(
ptr += 1;
/* Store the values of the system columns */
- trx_id = dict_index_rec_get_sys_col(index, offsets,
- DATA_TRX_ID, rec);
- roll_ptr = dict_index_rec_get_sys_col(index, offsets,
- DATA_ROLL_PTR, rec);
+ field = rec_get_nth_field(rec, offsets,
+ dict_index_get_sys_col_pos(index, DATA_TRX_ID), &len);
+ ut_ad(len == DATA_TRX_ID_LEN);
+ trx_id = trx_read_trx_id(field);
+ field = rec_get_nth_field(rec, offsets,
+ dict_index_get_sys_col_pos(index, DATA_ROLL_PTR), &len);
+ ut_ad(len == DATA_ROLL_PTR_LEN);
+ roll_ptr = trx_read_roll_ptr(field);
+
len = mach_dulint_write_compressed(ptr, trx_id);
ptr += len;
diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c
index 73726e772e5..90ad3aefaca 100644
--- a/libmysql/errmsg.c
+++ b/libmysql/errmsg.c
@@ -78,7 +78,9 @@ const char *client_errors[]=
"Invalid connection handle",
"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
"Row retrieval was canceled by mysql_stmt_close() call",
- "Attempt to read column without prior row fetch"
+ "Attempt to read column without prior row fetch",
+ "Prepared statement contains no metadata",
+ ""
};
/* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */
@@ -137,7 +139,9 @@ const char *client_errors[]=
"Invalid connection handle",
"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
"Row retrieval was canceled by mysql_stmt_close() call",
- "Attempt to read column without prior row fetch"
+ "Attempt to read column without prior row fetch",
+ "Prepared statement contains no metadata",
+ ""
};
#else /* ENGLISH */
@@ -194,7 +198,9 @@ const char *client_errors[]=
"Invalid connection handle",
"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
"Row retrieval was canceled by mysql_stmt_close() call",
- "Attempt to read column without prior row fetch"
+ "Attempt to read column without prior row fetch",
+ "Prepared statement contains no metadata",
+ ""
};
#endif
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 8c20b566957..b791090346b 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -158,7 +158,8 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
(void) signal(SIGPIPE, SIG_IGN);
#endif
#ifdef EMBEDDED_LIBRARY
- result= init_embedded_server(argc, argv, groups);
+ if (argc > -1)
+ result= init_embedded_server(argc, argv, groups);
#endif
}
#ifdef THREAD
@@ -2166,12 +2167,12 @@ static void update_stmt_fields(MYSQL_STMT *stmt)
DESCRIPTION
This function should be used after mysql_stmt_execute().
You can safely check that prepared statement has a result set by calling
- mysql_stmt_num_fields(): if number of fields is not zero, you can call
+ mysql_stmt_field_count(): if number of fields is not zero, you can call
this function to get fields metadata.
Next steps you may want to make:
- find out number of columns in result set by calling
mysql_num_fields(res) (the same value is returned by
- mysql_stmt_num_fields)
+ mysql_stmt_field_count())
- fetch metadata for any column with mysql_fetch_field,
mysql_fetch_field_direct, mysql_fetch_fields, mysql_field_seek.
- free returned MYSQL_RES structure with mysql_free_result.
@@ -3876,8 +3877,8 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
case MYSQL_TYPE_INT24: /* mediumint is sent as 4 bytes int */
case MYSQL_TYPE_LONG:
{
- long value= sint4korr(*row);
- longlong data= field_is_unsigned ? (longlong) (unsigned long) value :
+ int32 value= sint4korr(*row);
+ longlong data= field_is_unsigned ? (longlong) (uint32) value :
(longlong) value;
fetch_long_with_conversion(param, field, data, 0);
*row+= 4;
@@ -4335,11 +4336,10 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
if (!bind_count)
{
- if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE)
- {
- set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate);
- }
- DBUG_RETURN(0);
+ int errorcode= (int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE ?
+ CR_NO_PREPARE_STMT : CR_NO_STMT_METADATA;
+ set_stmt_error(stmt, errorcode, unknown_sqlstate);
+ DBUG_RETURN(1);
}
/*
@@ -4624,7 +4624,7 @@ static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data)
row+= (stmt->field_count+9)/8; /* skip null bits */
bit= 4; /* first 2 bits are reserved */
- /* Go throw all fields and calculate metadata */
+ /* Go through all fields and calculate metadata */
for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields ;
bind < end ;
bind++, field++)
@@ -4759,6 +4759,12 @@ mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
for (; tmp && row; --row, tmp= tmp->next)
;
stmt->data_cursor= tmp;
+ if (!row && tmp)
+ {
+ /* Rewind the counter */
+ stmt->read_row_func= stmt_read_row_buffered;
+ stmt->state= MYSQL_STMT_EXECUTE_DONE;
+ }
DBUG_VOID_RETURN;
}
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 15f07667625..2554fadc216 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -591,6 +591,32 @@ err:
C_MODE_END
+static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length,
+ CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
+{
+ uint32 dummy32;
+ uint dummy_err;
+ char *result;
+
+ /* 'tocs' is set 0 when client issues SET character_set_results=NULL */
+ if (tocs && String::needs_conversion(0, fromcs, tocs, &dummy32))
+ {
+ uint new_len= (tocs->mbmaxlen * length) / fromcs->mbminlen + 1;
+ result= (char *)alloc_root(root, new_len);
+ length= copy_and_convert(result, new_len,
+ tocs, from, length, fromcs, &dummy_err);
+ }
+ else
+ {
+ result= (char *)alloc_root(root, length + 1);
+ memcpy(result, from, length);
+ }
+
+ result[length]= 0;
+ return result;
+}
+
+
bool Protocol::send_fields(List<Item> *list, uint flags)
{
List_iterator_fast<Item> it(*list);
@@ -598,6 +624,8 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
MYSQL_FIELD *client_field;
MYSQL *mysql= thd->mysql;
MEM_ROOT *field_alloc;
+ CHARSET_INFO *thd_cs= thd->variables.character_set_results;
+ CHARSET_INFO *cs= system_charset_info;
DBUG_ENTER("send_fields");
@@ -616,12 +644,29 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
Send_field server_field;
item->make_field(&server_field);
- client_field->db= strdup_root(field_alloc, server_field.db_name);
- client_field->table= strdup_root(field_alloc, server_field.table_name);
- client_field->name= strdup_root(field_alloc, server_field.col_name);
- client_field->org_table= strdup_root(field_alloc, server_field.org_table_name);
- client_field->org_name= strdup_root(field_alloc, server_field.org_col_name);
- client_field->length= server_field.length;
+ client_field->db= dup_str_aux(field_alloc, server_field.db_name,
+ strlen(server_field.db_name), cs, thd_cs);
+ client_field->table= dup_str_aux(field_alloc, server_field.table_name,
+ strlen(server_field.table_name), cs, thd_cs);
+ client_field->name= dup_str_aux(field_alloc, server_field.col_name,
+ strlen(server_field.col_name), cs, thd_cs);
+ client_field->org_table= dup_str_aux(field_alloc, server_field.org_table_name,
+ strlen(server_field.org_table_name), cs, thd_cs);
+ client_field->org_name= dup_str_aux(field_alloc, server_field.org_col_name,
+ strlen(server_field.org_col_name), cs, thd_cs);
+ if (item->collation.collation == &my_charset_bin || thd_cs == NULL)
+ {
+ /* No conversion */
+ client_field->charsetnr= server_field.charsetnr;
+ client_field->length= server_field.length;
+ }
+ else
+ {
+ /* With conversion */
+ client_field->charsetnr= thd_cs->number;
+ uint char_len= server_field.length / item->collation.collation->mbmaxlen;
+ client_field->length= char_len * thd_cs->mbmaxlen;
+ }
client_field->type= server_field.type;
client_field->flags= server_field.flags;
client_field->decimals= server_field.decimals;
@@ -630,9 +675,8 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
client_field->name_length= strlen(client_field->name);
client_field->org_name_length= strlen(client_field->org_name);
client_field->org_table_length= strlen(client_field->org_table);
- client_field->charsetnr= server_field.charsetnr;
- client_field->catalog= strdup_root(field_alloc, "def");
+ client_field->catalog= dup_str_aux(field_alloc, "def", 3, cs, thd_cs);
client_field->catalog_length= 3;
if (INTERNAL_NUM_FIELD(client_field))
@@ -710,6 +754,7 @@ bool Protocol_prep::write()
}
cur->data= (MYSQL_ROW)(((char *)cur) + sizeof(MYSQL_ROWS));
memcpy(cur->data, packet->ptr()+1, packet->length()-1);
+ cur->length= packet->length(); /* To allow us to do sanity checks */
*data->prev_ptr= cur;
data->prev_ptr= &cur->next;
@@ -804,21 +849,3 @@ bool Protocol::net_store_data(const char *from, uint length)
return false;
}
-#if 0
-/* The same as Protocol::net_store_data but does the converstion
-*/
-bool Protocol::convert_str(const char *from, uint length)
-{
- if (!(*next_field=alloc_root(alloc, length + 1)))
- return true;
- convert->store_dest(*next_field, from, length);
- (*next_field)[length]= 0;
- if (next_mysql_field->max_length < length)
- next_mysql_field->max_length=length;
- ++next_field;
- ++next_mysql_field;
-
- return false;
-}
-#endif
-
diff --git a/merge/.cvsignore b/merge/.cvsignore
deleted file mode 100644
index e9955884756..00000000000
--- a/merge/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.deps
-Makefile
-Makefile.in
diff --git a/merge/Makefile.am b/merge/Makefile.am
deleted file mode 100644
index 25e15e9c6ec..00000000000
--- a/merge/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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.
-#
-# 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
-
-INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include
-pkglib_LIBRARIES = libmerge.a
-noinst_HEADERS = mrg_def.h
-libmerge_a_SOURCES = mrg_open.c mrg_extra.c mrg_info.c mrg_locking.c \
- mrg_rrnd.c mrg_update.c mrg_delete.c mrg_rsame.c \
- mrg_panic.c mrg_close.c mrg_create.c mrg_static.c
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/merge/make-ccc b/merge/make-ccc
deleted file mode 100755
index 3f37c33638f..00000000000
--- a/merge/make-ccc
+++ /dev/null
@@ -1,3 +0,0 @@
-ccc -I./../include -I../include -DDBUG_OFF -fast -O3 -c _locking.c close.c create.c delete.c extra.c info.c open.c panic.c rrnd.c rsame.c static.c update.c
-rm libmerge.a
-ar -cr libmerge.a _locking.o
diff --git a/merge/mrg_close.c b/merge/mrg_close.c
deleted file mode 100644
index e835fd06e47..00000000000
--- a/merge/mrg_close.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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.
-
- 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 */
-
-/* close a isam-database */
-
-#include "mrg_def.h"
-
-int mrg_close(register MRG_INFO *info)
-{
- int error=0,new_error;
- MRG_TABLE *file;
- DBUG_ENTER("mrg_close");
-
- for (file=info->open_tables ; file != info->end_table ; file++)
- if ((new_error=nisam_close(file->table)))
- error=new_error;
- pthread_mutex_lock(&THR_LOCK_open);
- mrg_open_list=list_delete(mrg_open_list,&info->open_list);
- pthread_mutex_unlock(&THR_LOCK_open);
- my_free((gptr) info,MYF(0));
- if (error)
- {
- my_errno=error;
- DBUG_RETURN(-1);
- }
- DBUG_RETURN(0);
-}
diff --git a/merge/mrg_create.c b/merge/mrg_create.c
deleted file mode 100644
index d55a1421647..00000000000
--- a/merge/mrg_create.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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.
-
- 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 */
-
-/* Create a MERGE-file */
-
-#include "mrg_def.h"
-
- /* create file named 'name' and save filenames in it
- table_names should be NULL or a vector of string-pointers with
- a NULL-pointer last
- */
-
-int mrg_create(const char *name, const char**table_names)
-{
- int save_errno;
- uint errpos;
- File file;
- char buff[FN_REFLEN],*end;
- DBUG_ENTER("mrg_create");
-
- errpos=0;
- if ((file = my_create(fn_format(buff,name,"",MRG_NAME_EXT,4),0,
- O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
- goto err;
- errpos=1;
- if (table_names)
- for ( ; *table_names ; table_names++)
- {
- strmov(buff,*table_names);
- fn_same(buff,name,4);
- *(end=strend(buff))='\n';
- if (my_write(file,*table_names,(uint) (end-buff+1),
- MYF(MY_WME | MY_NABP)))
- goto err;
- }
- if (my_close(file,MYF(0)))
- goto err;
- DBUG_RETURN(0);
-
-err:
- save_errno=my_errno;
- switch (errpos) {
- case 1:
- VOID(my_close(file,MYF(0)));
- }
- my_errno=save_errno; /* Return right errocode */
- DBUG_RETURN(-1);
-} /* mrg_create */
diff --git a/merge/mrg_def.h b/merge/mrg_def.h
deleted file mode 100644
index 8b6be08c32d..00000000000
--- a/merge/mrg_def.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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.
-
- 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 */
-
-/* Denna fil includeras i alla merge-filer */
-
-#ifndef N_MAXKEY
-#include "../isam/isamdef.h"
-#endif
-
-#include "merge.h"
-
-extern LIST *mrg_open_list;
-
-#ifdef THREAD
-extern pthread_mutex_t THR_LOCK_open;
-#endif
diff --git a/merge/mrg_delete.c b/merge/mrg_delete.c
deleted file mode 100644
index 920156be01e..00000000000
--- a/merge/mrg_delete.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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.
-
- 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 */
-
-/* Delete last read record */
-
-#include "mrg_def.h"
-
-int mrg_delete(MRG_INFO *info,const byte *record)
-{
- if (!info->current_table)
- {
- my_errno=HA_ERR_NO_ACTIVE_RECORD;
- return(-1);
- }
- return nisam_delete(info->current_table->table,record);
-}
diff --git a/merge/mrg_extra.c b/merge/mrg_extra.c
deleted file mode 100644
index d37b1aaa03c..00000000000
--- a/merge/mrg_extra.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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.
-
- 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 */
-
-/*
- Extra functions we want to do with a database
- - All flags, exept record-cache-flags, are set in all used databases
- record-cache-flags are set in mrg_rrnd when we are changing database.
-*/
-
-#include "mrg_def.h"
-
-int mrg_extra(
-MRG_INFO *info,
-enum ha_extra_function function)
-{
- MRG_TABLE *file;
-
- if (function == HA_EXTRA_CACHE)
- info->cache_in_use=1;
- else
- {
- if (function == HA_EXTRA_NO_CACHE || function == HA_EXTRA_RESET)
- info->cache_in_use=0;
- if (function == HA_EXTRA_RESET || function == HA_EXTRA_RESET_STATE)
- {
- info->current_table=0;
- info->last_used_table=info->open_tables;
- }
- for (file=info->open_tables ; file != info->end_table ; file++)
- nisam_extra(file->table,function);
- }
- return 0;
-}
diff --git a/merge/mrg_info.c b/merge/mrg_info.c
deleted file mode 100644
index 57f22276487..00000000000
--- a/merge/mrg_info.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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.
-
- 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 */
-
-#include "mrg_def.h"
-
-ulong mrg_position(MRG_INFO *info)
-{
- MRG_TABLE *current_table;
-
- if (!(current_table = info->current_table) &&
- info->open_tables != info->end_table)
- current_table = info->open_tables;
- return (current_table ?
- (ulong) (current_table->table->lastpos +
- current_table->file_offset) :
- ~(ulong) 0);
-}
-
- /* If flag != 0 one only gets pos of last record */
-
-int mrg_info(MRG_INFO *info,register MERGE_INFO *x,int flag)
-{
- MRG_TABLE *current_table;
- DBUG_ENTER("mrg_info");
-
- if (!(current_table = info->current_table) &&
- info->open_tables != info->end_table)
- current_table = info->open_tables;
- x->recpos = info->current_table ?
- info->current_table->table->lastpos + info->current_table->file_offset :
- (ulong) -1L;
- if (flag != HA_STATUS_POS)
- {
- x->records = info->records;
- x->deleted = info->del;
- x->data_file_length = info->data_file_length;
- x->reclength = info->reclength;
- if (current_table)
- x->errkey = current_table->table->errkey;
- else
- { /* No tables in MRG */
- x->errkey=0;
- }
- x->options = info->options;
- }
- DBUG_RETURN(0);
-}
diff --git a/merge/mrg_locking.c b/merge/mrg_locking.c
deleted file mode 100644
index bd33e047091..00000000000
--- a/merge/mrg_locking.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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.
-
- 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 */
-
-/*
- Lock databases against read or write.
-*/
-
-#include "mrg_def.h"
-
-int mrg_lock_database(MRG_INFO *info,int lock_type)
-{
- int error,new_error;
- MRG_TABLE *file;
-
- error=0;
- for (file=info->open_tables ; file != info->end_table ; file++)
- if ((new_error=nisam_lock_database(file->table,lock_type)))
- error=new_error;
- return(error);
-}
diff --git a/merge/mrg_open.c b/merge/mrg_open.c
deleted file mode 100644
index 6bf75392131..00000000000
--- a/merge/mrg_open.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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.
-
- 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 */
-
-/* open a MERGE-database */
-
-#include "mrg_def.h"
-#include <stddef.h>
-#include <errno.h>
-#ifdef VMS
-#include "static.c"
-#endif
-
-/* open a MERGE-database.
-
- if handle_locking is 0 then exit with error if some database is locked
- if handle_locking is 1 then wait if database is locked
-*/
-
-
-MRG_INFO *mrg_open(
-const char *name,
-int mode,
-int handle_locking)
-{
- int save_errno,i,errpos;
- uint files,dir_length,length, options;
- ulonglong file_offset;
- char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end;
- MRG_INFO info,*m_info;
- File fd;
- IO_CACHE file;
- N_INFO *isam,*last_isam;
- DBUG_ENTER("mrg_open");
-
- LINT_INIT(last_isam);
- isam=0;
- errpos=files=0;
- bzero((gptr) &info,sizeof(info));
- bzero((char*) &file,sizeof(file));
- if ((fd=my_open(fn_format(name_buff,name,"",MRG_NAME_EXT,4),
- O_RDONLY | O_SHARE,MYF(0))) < 0 ||
- init_io_cache(&file, fd, IO_SIZE, READ_CACHE, 0, 0,
- MYF(MY_WME | MY_NABP)))
- goto err;
- errpos=1;
- dir_length=dirname_part(name_buff,name);
- info.reclength=0;
- while ((length=my_b_gets(&file,buff,FN_REFLEN-1)))
- {
- if ((end=buff+length)[-1] == '\n')
- end[-1]='\0';
- if (buff[0] && buff[0] != '#') /* Skip empty lines and comments */
- {
- last_isam=isam;
- if (!test_if_hard_path(buff))
- {
- VOID(strmake(name_buff+dir_length,buff,
- sizeof(name_buff)-1-dir_length));
- VOID(cleanup_dirname(buff,name_buff));
- }
- if (!(isam=nisam_open(buff,mode,test(handle_locking))))
- goto err;
- files++;
- }
- last_isam=isam;
- if (info.reclength && info.reclength != isam->s->base.reclength)
- {
- my_errno=HA_ERR_WRONG_IN_RECORD;
- goto err;
- }
- info.reclength=isam->s->base.reclength;
- }
- if (!(m_info= (MRG_INFO*) my_malloc(sizeof(MRG_INFO)+files*sizeof(MRG_TABLE),
- MYF(MY_WME))))
- goto err;
- *m_info=info;
- m_info->open_tables=(MRG_TABLE *) (m_info+1);
- m_info->tables=files;
-
- options= (uint) ~0;
- for (i=files ; i-- > 0 ; )
- {
- m_info->open_tables[i].table=isam;
- m_info->options|=isam->s->base.options;
- options&=isam->s->base.options;
- m_info->records+=isam->s->state.records;
- m_info->del+=isam->s->state.del;
- m_info->data_file_length=isam->s->state.data_file_length;
- if (i)
- isam=(N_INFO*) (isam->open_list.next->data);
- }
- /* Don't force readonly if not all tables are readonly */
- if (! (options & (HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA)))
- m_info->options&= ~(HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA);
-
- /* Fix fileinfo for easyer debugging (actually set by rrnd) */
- file_offset=0;
- for (i=0 ; (uint) i < files ; i++)
- {
- m_info->open_tables[i].file_offset=(my_off_t) file_offset;
- file_offset+=m_info->open_tables[i].table->s->state.data_file_length;
- }
- if (sizeof(my_off_t) == 4 && file_offset > (ulonglong) (ulong) ~0L)
- {
- my_errno=HA_ERR_RECORD_FILE_FULL;
- my_free((char*) m_info,MYF(0));
- goto err;
- }
-
- m_info->end_table=m_info->open_tables+files;
- m_info->last_used_table=m_info->open_tables;
-
- VOID(my_close(fd,MYF(0)));
- end_io_cache(&file);
- m_info->open_list.data=(void*) m_info;
- pthread_mutex_lock(&THR_LOCK_open);
- mrg_open_list=list_add(mrg_open_list,&m_info->open_list);
- pthread_mutex_unlock(&THR_LOCK_open);
- DBUG_RETURN(m_info);
-
-err:
- save_errno=my_errno;
- switch (errpos) {
- case 1:
- VOID(my_close(fd,MYF(0)));
- end_io_cache(&file);
- for (i=files ; i-- > 0 ; )
- {
- isam=last_isam;
- if (i)
- last_isam=(N_INFO*) (isam->open_list.next->data);
- nisam_close(isam);
- }
- }
- my_errno=save_errno;
- DBUG_RETURN (NULL);
-}
diff --git a/merge/mrg_panic.c b/merge/mrg_panic.c
deleted file mode 100644
index e9ad1974d8f..00000000000
--- a/merge/mrg_panic.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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.
-
- 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 */
-
-#include "mrg_def.h"
-
- /* if flag == HA_PANIC_CLOSE then all misam files are closed */
- /* if flag == HA_PANIC_WRITE then all misam files are unlocked and
- all changed data in single user misam is written to file */
- /* if flag == HA_PANIC_READ then all misam files that was locked when
- nisam_panic(HA_PANIC_WRITE) was done is locked. A ni_readinfo() is
- done for all single user files to get changes in database */
-
-
-int mrg_panic(
-enum ha_panic_function flag)
-{
- int error=0;
- LIST *list_element,*next_open;
- MRG_INFO *info;
- DBUG_ENTER("mrg_panic");
-
- for (list_element=mrg_open_list ; list_element ; list_element=next_open)
- {
- next_open=list_element->next; /* Save if close */
- info=(MRG_INFO*) list_element->data;
- if (flag == HA_PANIC_CLOSE && mrg_close(info))
- error=my_errno;
- }
- if (mrg_open_list && flag != HA_PANIC_CLOSE)
- DBUG_RETURN(nisam_panic(flag));
- if (!error) DBUG_RETURN(0);
- my_errno=error;
- DBUG_RETURN(-1);
-}
diff --git a/merge/mrg_rrnd.c b/merge/mrg_rrnd.c
deleted file mode 100644
index 206427d74d4..00000000000
--- a/merge/mrg_rrnd.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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.
-
- 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 */
-
-/*
- Read a record with random-access. The position to the record must
- get by mrg_info(). The next record can be read with pos= -1 */
-
-
-#include "mrg_def.h"
-
-static MRG_TABLE *find_table(MRG_TABLE *start,MRG_TABLE *end,mrg_off_t pos);
-
-/*
- If filepos == -1, read next
- Returns same as nisam_rrnd:
- 0 = Ok.
- 1 = Record deleted.
- -1 = EOF (or something, errno should be HA_ERR_END_OF_FILE)
-*/
-
-int mrg_rrnd(MRG_INFO *info,byte *buf,mrg_off_t filepos)
-{
- int error;
- N_INFO *isam_info;
-
- if (filepos == ~(mrg_off_t) 0) /* Can't use HA_POS_ERROR */
- {
- if (!info->current_table)
- {
- if (info->open_tables == info->end_table)
- { /* No tables */
- my_errno=HA_ERR_END_OF_FILE;
- return -1;
- }
- isam_info=(info->current_table=info->open_tables)->table;
- if (info->cache_in_use)
- nisam_extra(isam_info,HA_EXTRA_CACHE);
- filepos=isam_info->s->pack.header_length;
- isam_info->lastinx= (uint) -1; /* Can't forward or backward */
- }
- else
- {
- isam_info=info->current_table->table;
- filepos= isam_info->nextpos;
- }
-
- for (;;)
- {
- isam_info->update&= HA_STATE_CHANGED;
- if ((error=(*isam_info->s->read_rnd)(isam_info,(byte*) buf,
- filepos,1)) >= 0 ||
- my_errno != HA_ERR_END_OF_FILE)
- return (error);
- if (info->cache_in_use)
- nisam_extra(info->current_table->table,HA_EXTRA_NO_CACHE);
- if (info->current_table+1 == info->end_table)
- return(-1);
- info->current_table++;
- info->last_used_table=info->current_table;
- if (info->cache_in_use)
- nisam_extra(info->current_table->table,HA_EXTRA_CACHE);
- info->current_table->file_offset=
- info->current_table[-1].file_offset+
- info->current_table[-1].table->s->state.data_file_length;
-
- isam_info=info->current_table->table;
- filepos=isam_info->s->pack.header_length;
- isam_info->lastinx= (uint) -1;
- }
- }
- info->current_table=find_table(info->open_tables,
- info->end_table-1,filepos);
- isam_info=info->current_table->table;
- isam_info->update&= HA_STATE_CHANGED;
- return ((*isam_info->s->read_rnd)(isam_info,(byte*) buf,
- (ulong) (filepos -
- info->current_table->file_offset),
- 0));
-}
-
-
- /* Find which table to use according to file-pos */
-
-static MRG_TABLE *find_table(MRG_TABLE *start,MRG_TABLE *end,mrg_off_t pos)
-{
- MRG_TABLE *mid;
-
- while (start != end)
- {
- mid=start+((uint) (end-start)+1)/2;
- if (mid->file_offset > pos)
- end=mid-1;
- else
- start=mid;
- }
- return start;
-}
diff --git a/merge/mrg_rsame.c b/merge/mrg_rsame.c
deleted file mode 100644
index ee840bc3060..00000000000
--- a/merge/mrg_rsame.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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.
-
- 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 */
-
-#include "mrg_def.h"
-
-
-int mrg_rsame(
-MRG_INFO *info,
-byte *record,
-int inx) /* not used, should be 0 */
-{
- if (inx)
- {
- my_errno=HA_ERR_WRONG_INDEX;
- return(-1);
- }
- if (!info->current_table)
- {
- my_errno=HA_ERR_NO_ACTIVE_RECORD;
- return(-1);
- }
- return nisam_rsame(info->current_table->table,record,inx);
-}
diff --git a/merge/mrg_static.c b/merge/mrg_static.c
deleted file mode 100644
index 1b7327c870f..00000000000
--- a/merge/mrg_static.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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.
-
- 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 */
-
-/*
- Static variables for pisam library. All definied here for easy making of
- a shared library
-*/
-
-#ifndef stdin
-#include "mrg_def.h"
-#endif
-
-LIST *mrg_open_list=0;
diff --git a/merge/mrg_update.c b/merge/mrg_update.c
deleted file mode 100644
index a6650267f36..00000000000
--- a/merge/mrg_update.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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.
-
- 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 */
-
-/* Update last read record */
-
-#include "mrg_def.h"
-
-int mrg_update(
-register MRG_INFO *info,
-const byte *oldrec, const byte *newrec)
-{
- if (!info->current_table)
- {
- my_errno=HA_ERR_NO_ACTIVE_RECORD;
- return(-1);
- }
- return nisam_update(info->current_table->table,oldrec,newrec);
-}
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index c432ac5a16c..c38bffed665 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -155,7 +155,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
ftbw=(FTB_WORD *)alloc_root(&ftb->mem_root,
sizeof(FTB_WORD) +
(param.trunc ? MI_MAX_KEY_BUFF :
- w.len+extra));
+ w.len*ftb->charset->mbmaxlen+extra));
ftbw->len=w.len+1;
ftbw->flags=0;
ftbw->off=0;
@@ -211,6 +211,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
uint off, extra=HA_FT_WLEN+info->s->base.rec_reflength;
byte *lastkey_buf=ftbw->word+ftbw->off;
+ LINT_INIT(off);
if (ftbw->flags & FTB_FLAG_TRUNC)
lastkey_buf+=ftbw->len;
diff --git a/myisam/ft_static.c b/myisam/ft_static.c
index cdb1580e706..cf4a8dd2a73 100644
--- a/myisam/ft_static.c
+++ b/myisam/ft_static.c
@@ -25,23 +25,25 @@ char ft_boolean_syntax[]="+ -><()~*:\"\"&|";
const HA_KEYSEG ft_keysegs[FT_SEGS]={
{
- HA_KEYTYPE_VARTEXT2, /* type */
- 63, /* language (will be overwritten) */
- 0, 2, 0, /* null_bit, bit_start, bit_end */
- HA_VAR_LENGTH_PART | HA_PACK_KEY, /* flag */
- HA_FT_MAXBYTELEN, /* length */
- HA_FT_WLEN, /* start */
- 0, /* null_pos */
- NULL /* charset */
- },
- {
-/*
- Note, this (and the last HA_KEYTYPE_END) segment should NOT
- be packed in any way, otherwise w_search() won't be able to
- update key entry 'in vivo'
-*/
- HA_FT_WTYPE, 63, 0, 0, 0, HA_NO_SORT, HA_FT_WLEN, 0, 0, NULL
- }
+ 0, /* charset */
+ HA_FT_WLEN, /* start */
+ 0, /* null_pos */
+ 0, /* Bit pos */
+ HA_VAR_LENGTH_PART | HA_PACK_KEY, /* flag */
+ HA_FT_MAXBYTELEN, /* length */
+ HA_KEYTYPE_VARTEXT2, /* type */
+ 63, /* language (will be overwritten) */
+ 0, /* null_bit */
+ 2, 0, 0 /* bit_start, bit_end, bit_length */
+},
+{
+ /*
+ Note, this (and the last HA_KEYTYPE_END) segment should NOT
+ be packed in any way, otherwise w_search() won't be able to
+ update key entry 'in vivo'
+ */
+ 0, 0, 0, 0, HA_NO_SORT, HA_FT_WLEN, HA_FT_WTYPE, 63, 0, 0, 0, 0
+}
};
const struct _ft_vft _ft_vft_nlq = {
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index b8f992dc21a..dcf57e78fa4 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -26,6 +26,7 @@
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
+#include "rt_index.h"
#ifndef USE_RAID
#define my_raid_create(A,B,C,D,E,F,G) my_create(A,B,C,G)
@@ -1466,6 +1467,12 @@ static int writekeys(MI_CHECK *param, register MI_INFO *info, byte *buff,
if (_mi_ft_add(info,i,(char*) key,buff,filepos))
goto err;
}
+ else if (info->s->keyinfo[i].flag & HA_SPATIAL)
+ {
+ uint key_length=_mi_make_key(info,i,key,buff,filepos);
+ if (rtree_insert(info, i, key, key_length))
+ goto err;
+ }
else
{
uint key_length=_mi_make_key(info,i,key,buff,filepos);
@@ -3988,7 +3995,8 @@ static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows)
key->seg->charset->mbmaxlen;
key_maxlength+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN;
}
- return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) &&
+ return (key->flag & HA_SPATIAL) ||
+ (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) &&
((ulonglong) rows * key_maxlength >
(ulonglong) myisam_max_temp_length));
}
diff --git a/myisam/mi_delete.c b/myisam/mi_delete.c
index d79d9040ee7..cc4a17182f7 100644
--- a/myisam/mi_delete.c
+++ b/myisam/mi_delete.c
@@ -46,10 +46,10 @@ int mi_delete(MI_INFO *info,const byte *record)
/* Test if record is in datafile */
DBUG_EXECUTE_IF("myisam_pretend_crashed_table_on_usage",
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
DBUG_RETURN(my_errno= HA_ERR_CRASHED););
DBUG_EXECUTE_IF("my_error_test_undefined_error",
- mi_print_error(info, INT_MAX);
+ mi_print_error(info->s, INT_MAX);
DBUG_RETURN(my_errno= INT_MAX););
if (!(info->update & HA_STATE_AKTIV))
{
@@ -116,7 +116,7 @@ err:
myisam_log_command(MI_LOG_DELETE,info,(byte*) lastpos, sizeof(lastpos),0);
if (save_errno != HA_ERR_RECORD_CHANGED)
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info); /* mark table crashed */
}
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
@@ -125,7 +125,7 @@ err:
my_errno=save_errno;
if (save_errno == HA_ERR_KEY_NOT_FOUND)
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
}
@@ -154,7 +154,7 @@ static int _mi_ck_real_delete(register MI_INFO *info, MI_KEYDEF *keyinfo,
if ((old_root=*root) == HA_OFFSET_ERROR)
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
DBUG_RETURN(my_errno=HA_ERR_CRASHED);
}
if (!(root_buff= (uchar*) my_alloca((uint) keyinfo->block_length+
@@ -266,9 +266,12 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
my_off_t root;
uchar *kpos=keypos;
- if (!(tmp_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&kpos,lastkey))
- && (my_errno == HA_ERR_CRASHED))
- mi_print_error(info, HA_ERR_CRASHED);
+ if (!(tmp_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&kpos,lastkey)))
+ {
+ mi_print_error(info->s, HA_ERR_CRASHED);
+ my_errno= HA_ERR_CRASHED;
+ DBUG_RETURN(-1);
+ }
root=_mi_dpos(info,nod_flag,kpos);
if (subkeys == -1)
{
@@ -317,7 +320,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (!nod_flag)
{
DBUG_PRINT("error",("Didn't find key"));
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED; /* This should newer happend */
goto err;
}
@@ -329,15 +332,10 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
{ /* Found key */
uint tmp;
length=mi_getint(anc_buff);
- tmp=remove_key(keyinfo,nod_flag,keypos,lastkey,anc_buff+length,
- &next_block);
- if (tmp == 0)
- {
- if (my_errno == HA_ERR_CRASHED)
- mi_print_error(info, HA_ERR_CRASHED);
- DBUG_PRINT("exit",("Return: %d",0));
- DBUG_RETURN(0);
- }
+ if (!(tmp= remove_key(keyinfo,nod_flag,keypos,lastkey,anc_buff+length,
+ &next_block)))
+ goto err;
+
length-= tmp;
mi_putint(anc_buff,length,nod_flag);
@@ -386,6 +384,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
my_afree((byte*) leaf_buff);
DBUG_PRINT("exit",("Return: %d",ret_value));
DBUG_RETURN(ret_value);
+
err:
my_afree((byte*) leaf_buff);
DBUG_PRINT("exit",("Error: %d",my_errno));
@@ -491,8 +490,6 @@ static int del(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *key,
(info->quick_mode ? MI_MIN_KEYBLOCK_LENGTH :
(uint) keyinfo->underflow_block_length));
err:
- if (my_errno == HA_ERR_CRASHED)
- mi_print_error(info, HA_ERR_CRASHED);
DBUG_RETURN(-1);
} /* del */
@@ -579,14 +576,10 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
/* remove key from anc_buff */
- s_length=remove_key(keyinfo,key_reflength,keypos,anc_key,
- anc_buff+anc_length,(my_off_t *) 0);
- if (!s_length)
- {
- if (my_errno == HA_ERR_CRASHED)
- mi_print_error(info, HA_ERR_CRASHED);
+ if (!(s_length=remove_key(keyinfo,key_reflength,keypos,anc_key,
+ anc_buff+anc_length,(my_off_t *) 0)))
goto err;
- }
+
anc_length-=s_length;
mi_putint(anc_buff,anc_length,key_reflength);
@@ -692,14 +685,10 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
mi_putint(buff,buff_length,nod_flag);
/* remove key from anc_buff */
- s_length=remove_key(keyinfo,key_reflength,keypos,anc_key,
- anc_buff+anc_length,(my_off_t *) 0);
- if (!s_length)
- {
- if (my_errno == HA_ERR_CRASHED)
- mi_print_error(info, HA_ERR_CRASHED);
+ if (!(s_length= remove_key(keyinfo,key_reflength,keypos,anc_key,
+ anc_buff+anc_length,(my_off_t *) 0)))
goto err;
- }
+
anc_length-=s_length;
mi_putint(anc_buff,anc_length,key_reflength);
@@ -759,9 +748,8 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (_mi_write_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,buff))
goto err;
DBUG_RETURN(anc_length <= (uint) keyinfo->block_length/2);
+
err:
- if (my_errno == HA_ERR_CRASHED)
- mi_print_error(info, HA_ERR_CRASHED);
DBUG_RETURN(-1);
} /* underflow */
@@ -798,6 +786,7 @@ static uint remove_key(MI_KEYDEF *keyinfo, uint nod_flag,
/* Calculate length of key */
if (!(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,lastkey))
DBUG_RETURN(0); /* Error */
+
if (next_block && nod_flag)
*next_block= _mi_kpos(nod_flag,keypos);
s_length=(int) (keypos-start);
diff --git a/myisam/mi_extra.c b/myisam/mi_extra.c
index 999c4ba8f3d..9023fe26f9e 100644
--- a/myisam/mi_extra.c
+++ b/myisam/mi_extra.c
@@ -187,7 +187,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
{
if ((error=flush_io_cache(&info->rec_cache)))
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info); /* Fatal error found */
}
}
@@ -288,7 +288,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
{
error=my_errno;
share->changed=1;
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info); /* Fatal error found */
}
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
@@ -343,7 +343,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
if (error)
{
share->changed=1;
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info); /* Fatal error found */
}
}
diff --git a/myisam/mi_key.c b/myisam/mi_key.c
index eaaee617f32..6ac04d562e0 100644
--- a/myisam/mi_key.c
+++ b/myisam/mi_key.c
@@ -477,7 +477,7 @@ int _mi_read_key_record(MI_INFO *info, my_off_t filepos, byte *buf)
{ /* Read only key */
if (_mi_put_key_in_record(info,(uint) info->lastinx,buf))
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
return -1;
}
diff --git a/myisam/mi_keycache.c b/myisam/mi_keycache.c
index 33d0ac4f6bc..fb13f3703a2 100644
--- a/myisam/mi_keycache.c
+++ b/myisam/mi_keycache.c
@@ -79,7 +79,7 @@ int mi_assign_to_key_cache(MI_INFO *info,
if (flush_key_blocks(share->key_cache, share->kfile, FLUSH_RELEASE))
{
error= my_errno;
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info); /* Mark that table must be checked */
}
diff --git a/myisam/mi_locking.c b/myisam/mi_locking.c
index 91e9f09b9fb..789d74680ef 100644
--- a/myisam/mi_locking.c
+++ b/myisam/mi_locking.c
@@ -66,7 +66,7 @@ int mi_lock_database(MI_INFO *info, int lock_type)
share->kfile,FLUSH_KEEP))
{
error=my_errno;
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info); /* Mark that table must be checked */
}
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
@@ -74,7 +74,7 @@ int mi_lock_database(MI_INFO *info, int lock_type)
if (end_io_cache(&info->rec_cache))
{
error=my_errno;
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info);
}
}
@@ -101,7 +101,7 @@ int mi_lock_database(MI_INFO *info, int lock_type)
share->not_flushed=1;
if (error)
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info);
}
}
@@ -290,7 +290,7 @@ void mi_update_status(void* param)
{
if (end_io_cache(&info->rec_cache))
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info);
}
info->opt_flag&= ~WRITE_CACHE_USED;
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index 040bc1503aa..ab76235e6ef 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -309,6 +309,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
HA_KEYSEG *pos=share->keyparts;
for (i=0 ; i < keys ; i++)
{
+ share->keyinfo[i].share= share;
disk_pos=mi_keydef_read(disk_pos, &share->keyinfo[i]);
disk_pos_assert(disk_pos + share->keyinfo[i].keysegs * HA_KEYSEG_SIZE,
end_pos);
@@ -1057,17 +1058,19 @@ int mi_keyseg_write(File file, const HA_KEYSEG *keyseg)
{
uchar buff[HA_KEYSEG_SIZE];
uchar *ptr=buff;
+ ulong pos;
- *ptr++ =keyseg->type;
- *ptr++ =keyseg->language;
- *ptr++ =keyseg->null_bit;
- *ptr++ =keyseg->bit_start;
- *ptr++ =keyseg->bit_end;
+ *ptr++= keyseg->type;
+ *ptr++= keyseg->language;
+ *ptr++= keyseg->null_bit;
+ *ptr++= keyseg->bit_start;
+ *ptr++= keyseg->bit_end;
*ptr++= keyseg->bit_length;
mi_int2store(ptr,keyseg->flag); ptr+=2;
mi_int2store(ptr,keyseg->length); ptr+=2;
mi_int4store(ptr,keyseg->start); ptr+=4;
- mi_int4store(ptr, keyseg->null_bit ? keyseg->null_pos : keyseg->bit_pos);
+ pos= keyseg->null_bit ? keyseg->null_pos : keyseg->bit_pos;
+ mi_int4store(ptr, pos);
ptr+=4;
return my_write(file,(char*) buff, (uint) (ptr-buff), MYF(MY_NABP));
@@ -1234,7 +1237,7 @@ int mi_enable_indexes(MI_INFO *info)
if (share->state.state.data_file_length ||
(share->state.state.key_file_length != share->base.keystart))
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
error= HA_ERR_CRASHED;
}
else
diff --git a/myisam/mi_page.c b/myisam/mi_page.c
index dc2bc75f1a0..5240c063fba 100644
--- a/myisam/mi_page.c
+++ b/myisam/mi_page.c
@@ -40,7 +40,7 @@ uchar *_mi_fetch_keypage(register MI_INFO *info, MI_KEYDEF *keyinfo,
{
DBUG_PRINT("error",("Got errno: %d from key_cache_read",my_errno));
info->last_keypage=HA_OFFSET_ERROR;
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
DBUG_RETURN(0);
}
@@ -52,7 +52,7 @@ uchar *_mi_fetch_keypage(register MI_INFO *info, MI_KEYDEF *keyinfo,
(ulong) page, page_size));
DBUG_DUMP("page", (char*) tmp, keyinfo->block_length);
info->last_keypage = HA_OFFSET_ERROR;
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
my_errno = HA_ERR_CRASHED;
tmp = 0;
}
diff --git a/myisam/mi_range.c b/myisam/mi_range.c
index 0d8f8763b92..e78f3b11625 100644
--- a/myisam/mi_range.c
+++ b/myisam/mi_range.c
@@ -213,7 +213,8 @@ err:
/* Get keynummer of current key and max number of keys in nod */
-static uint _mi_keynr(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, uchar *keypos, uint *ret_max_key)
+static uint _mi_keynr(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
+ uchar *keypos, uint *ret_max_key)
{
uint nod_flag,keynr,max_key;
uchar t_buff[MI_MAX_KEY_BUFF],*end;
@@ -222,7 +223,7 @@ static uint _mi_keynr(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, u
nod_flag=mi_test_if_nod(page);
page+=2+nod_flag;
- if (!(keyinfo->flag & (HA_VAR_LENGTH_KEY| HA_BINARY_PACK_KEY)))
+ if (!(keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY)))
{
*ret_max_key= (uint) (end-page)/(keyinfo->keylength+nod_flag);
return (uint) (keypos-page)/(keyinfo->keylength+nod_flag);
@@ -233,11 +234,7 @@ static uint _mi_keynr(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, u
while (page < end)
{
if (!(*keyinfo->get_key)(keyinfo,nod_flag,&page,t_buff))
- {
- if (my_errno == HA_ERR_CRASHED)
- mi_print_error(info, HA_ERR_CRASHED);
return 0; /* Error */
- }
max_key++;
if (page == keypos)
keynr=max_key;
diff --git a/myisam/mi_rkey.c b/myisam/mi_rkey.c
index d564c672f19..635a7eb2c48 100644
--- a/myisam/mi_rkey.c
+++ b/myisam/mi_rkey.c
@@ -78,7 +78,7 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len,
case HA_KEY_ALG_RTREE:
if (rtree_find_first(info,inx,key_buff,use_key_length,nextflag) < 0)
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
goto err;
}
diff --git a/myisam/mi_rnext_same.c b/myisam/mi_rnext_same.c
index 3060a55038a..06408f57a3f 100644
--- a/myisam/mi_rnext_same.c
+++ b/myisam/mi_rnext_same.c
@@ -92,6 +92,10 @@ int mi_rnext_same(MI_INFO *info, byte *buf)
if (my_errno == HA_ERR_KEY_NOT_FOUND)
my_errno=HA_ERR_END_OF_FILE;
}
+ else if (!buf)
+ {
+ DBUG_RETURN(info->lastpos==HA_OFFSET_ERROR ? my_errno : 0);
+ }
else if (!(*info->read_record)(info,info->lastpos,buf))
{
info->update|= HA_STATE_AKTIV; /* Record is read */
diff --git a/myisam/mi_search.c b/myisam/mi_search.c
index f252719d29c..0c82a4c4502 100644
--- a/myisam/mi_search.c
+++ b/myisam/mi_search.c
@@ -159,10 +159,9 @@ int _mi_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
DBUG_PRINT("exit",("found key at %lu",(ulong) info->lastpos));
DBUG_RETURN(0);
+
err:
DBUG_PRINT("exit",("Error: %d",my_errno));
- if (my_errno == HA_ERR_CRASHED)
- mi_print_error(info, HA_ERR_CRASHED);
info->lastpos= HA_OFFSET_ERROR;
info->page_changed=1;
DBUG_RETURN (-1);
@@ -236,7 +235,7 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,t_buff);
if (length == 0 || page > end)
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
DBUG_PRINT("error",("Found wrong key: length: %u page: %p end: %p",
length, page, end));
@@ -383,7 +382,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
if (page > end)
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
DBUG_PRINT("error",("Found wrong key: length: %u page: %p end: %p",
length, page, end));
@@ -752,6 +751,7 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
{
if (length > (uint) keyseg->length)
{
+ mi_print_error(keyinfo->share, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
return 0; /* Error */
}
@@ -767,6 +767,7 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
("Found too long null packed key: %u of %u at %p",
length, keyseg->length, *page_pos));
DBUG_DUMP("key",(char*) *page_pos,16);
+ mi_print_error(keyinfo->share, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
return 0;
}
@@ -823,6 +824,7 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
DBUG_PRINT("error",("Found too long packed key: %u of %u at %p",
length, keyseg->length, *page_pos));
DBUG_DUMP("key",(char*) *page_pos,16);
+ mi_print_error(keyinfo->share, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
return 0; /* Error */
}
@@ -878,6 +880,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
DBUG_PRINT("error",("Found too long binary packed key: %u of %u at %p",
length, keyinfo->maxlength, *page_pos));
DBUG_DUMP("key",(char*) *page_pos,16);
+ mi_print_error(keyinfo->share, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
return 0; /* Wrong key */
}
@@ -939,6 +942,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
if (from_end != page_end)
{
DBUG_PRINT("error",("Error when unpacking key"));
+ mi_print_error(keyinfo->share, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
return 0; /* Error */
}
@@ -973,7 +977,7 @@ uchar *_mi_get_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page,
*return_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,key);
if (*return_key_length == 0)
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
DBUG_RETURN(0);
}
@@ -1011,7 +1015,7 @@ static my_bool _mi_get_prev_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page,
*return_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,key);
if (*return_key_length == 0)
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
DBUG_RETURN(1);
}
@@ -1052,7 +1056,7 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page,
if (*return_key_length == 0)
{
DBUG_PRINT("error",("Couldn't find last key: page: %p", page));
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
DBUG_RETURN(0);
}
@@ -1185,11 +1189,7 @@ int _mi_search_next(register MI_INFO *info, register MI_KEYDEF *keyinfo,
memcpy(lastkey,key,key_length);
if (!(info->lastkey_length=(*keyinfo->get_key)(keyinfo,nod_flag,
&info->int_keypos,lastkey)))
- {
- if (my_errno == HA_ERR_CRASHED)
- mi_print_error(info, HA_ERR_CRASHED);
DBUG_RETURN(-1);
- }
}
else /* Previous key */
{
@@ -1248,9 +1248,9 @@ int _mi_search_first(register MI_INFO *info, register MI_KEYDEF *keyinfo,
} while ((pos=_mi_kpos(nod_flag,page)) != HA_OFFSET_ERROR);
if (!(info->lastkey_length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,
- info->lastkey)) &&
- (my_errno == HA_ERR_CRASHED))
- mi_print_error(info, HA_ERR_CRASHED);
+ info->lastkey)))
+ DBUG_RETURN(-1); /* Crashed */
+
info->int_keypos=page; info->int_maxpos=info->buff+mi_getint(info->buff)-1;
info->int_nod_flag=nod_flag;
info->int_keytree_version=keyinfo->version;
diff --git a/myisam/mi_update.c b/myisam/mi_update.c
index 2936e29a01c..cda60694008 100644
--- a/myisam/mi_update.c
+++ b/myisam/mi_update.c
@@ -35,7 +35,7 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
LINT_INIT(old_checksum);
DBUG_EXECUTE_IF("myisam_pretend_crashed_table_on_usage",
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
DBUG_RETURN(my_errno= HA_ERR_CRASHED););
if (!(info->update & HA_STATE_AKTIV))
{
@@ -209,7 +209,7 @@ err:
}
else
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info);
}
info->update= (HA_STATE_CHANGED | HA_STATE_AKTIV | HA_STATE_ROW_CHANGED |
@@ -221,7 +221,7 @@ err:
allow_break(); /* Allow SIGHUP & SIGINT */
if (save_errno == HA_ERR_KEY_NOT_FOUND)
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
save_errno=HA_ERR_CRASHED;
}
DBUG_RETURN(my_errno=save_errno);
diff --git a/myisam/mi_write.c b/myisam/mi_write.c
index 8ff653bdd2d..768258a0c82 100644
--- a/myisam/mi_write.c
+++ b/myisam/mi_write.c
@@ -53,7 +53,7 @@ int mi_write(MI_INFO *info, byte *record)
DBUG_PRINT("enter",("isam: %d data: %d",info->s->kfile,info->dfile));
DBUG_EXECUTE_IF("myisam_pretend_crashed_table_on_usage",
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
DBUG_RETURN(my_errno= HA_ERR_CRASHED););
if (share->options & HA_OPTION_READ_ONLY_DATA)
{
@@ -127,8 +127,8 @@ int mi_write(MI_INFO *info, byte *record)
{
if (local_lock_tree)
rw_unlock(&share->key_root_lock[i]);
- DBUG_PRINT("error",("Got error: %d on write",my_errno));
- goto err;
+ DBUG_PRINT("error",("Got error: %d on write",my_errno));
+ goto err;
}
}
if (local_lock_tree)
@@ -162,7 +162,8 @@ int mi_write(MI_INFO *info, byte *record)
err:
save_errno=my_errno;
- if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL)
+ if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL ||
+ my_errno == HA_ERR_NULL_IN_SPATIAL)
{
if (info->bulk_insert)
{
@@ -206,7 +207,7 @@ err:
}
else
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info);
}
info->update= (HA_STATE_CHANGED | HA_STATE_WRITTEN | HA_STATE_ROW_CHANGED);
@@ -352,11 +353,8 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (tmp_key_length)
dupp_key_pos=_mi_dpos(info,0,keybuff+tmp_key_length);
else
- {
- if (my_errno == HA_ERR_CRASHED)
- mi_print_error(info, HA_ERR_CRASHED);
dupp_key_pos= HA_OFFSET_ERROR;
- }
+
if (keyinfo->flag & HA_FULLTEXT)
{
uint off;
@@ -465,7 +463,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
{
if (t_length >= keyinfo->maxlength*2+MAX_POINTER_LENGTH)
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
DBUG_RETURN(-1);
}
@@ -475,7 +473,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
{
if (-t_length >= keyinfo->maxlength*2+MAX_POINTER_LENGTH)
{
- mi_print_error(info, HA_ERR_CRASHED);
+ mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
DBUG_RETURN(-1);
}
@@ -570,11 +568,8 @@ int _mi_split_page(register MI_INFO *info, register MI_KEYDEF *keyinfo,
key_pos=_mi_find_half_pos(nod_flag,keyinfo,buff,key_buff, &key_length,
&after_key);
if (!key_pos)
- {
- if (my_errno == HA_ERR_CRASHED)
- mi_print_error(info, HA_ERR_CRASHED);
DBUG_RETURN(-1);
- }
+
length=(uint) (key_pos-buff);
a_length=mi_getint(buff);
mi_putint(buff,length,nod_flag);
@@ -594,11 +589,8 @@ int _mi_split_page(register MI_INFO *info, register MI_KEYDEF *keyinfo,
/* Store new page */
if (!(*keyinfo->get_key)(keyinfo,nod_flag,&key_pos,key_buff))
- {
- if (my_errno == HA_ERR_CRASHED)
- mi_print_error(info, HA_ERR_CRASHED);
DBUG_RETURN(-1);
- }
+
t_length=(*keyinfo->pack_key)(keyinfo,nod_flag,(uchar *) 0,
(uchar*) 0, (uchar*) 0,
key_buff, &s_temp);
@@ -705,6 +697,7 @@ static uchar *_mi_find_last_pos(MI_KEYDEF *keyinfo, uchar *page,
memcpy(key, key_buff, length); /* previous key */
if (!(length=(*keyinfo->get_key)(keyinfo,0,&page,key_buff)))
{
+ mi_print_error(keyinfo->share, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
DBUG_RETURN(0);
}
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h
index c0f56a7b720..9a92a916558 100644
--- a/myisam/myisamdef.h
+++ b/myisam/myisamdef.h
@@ -356,8 +356,8 @@ typedef struct st_mi_sort_param
#define mi_mark_crashed_on_repair(x) { (x)->s->state.changed|=STATE_CRASHED|STATE_CRASHED_ON_REPAIR ; (x)->update|= HA_STATE_CHANGED; }
#define mi_is_crashed(x) ((x)->s->state.changed & STATE_CRASHED)
#define mi_is_crashed_on_repair(x) ((x)->s->state.changed & STATE_CRASHED_ON_REPAIR)
-#define mi_print_error(INFO, ERRNO) \
- mi_report_error((ERRNO), (INFO)->s->index_file_name)
+#define mi_print_error(SHARE, ERRNO) \
+ mi_report_error((ERRNO), (SHARE)->index_file_name)
/* Functions to store length of space packed keys, VARCHAR or BLOB keys */
diff --git a/myisam/rt_index.c b/myisam/rt_index.c
index cfb2ca877f4..bdf5ee9c60f 100644
--- a/myisam/rt_index.c
+++ b/myisam/rt_index.c
@@ -710,7 +710,8 @@ err1:
int rtree_insert(MI_INFO *info, uint keynr, uchar *key, uint key_length)
{
- return (rtree_insert_level(info, keynr, key, key_length, -1) == -1) ? -1 : 0;
+ return (!key_length ||
+ (rtree_insert_level(info, keynr, key, key_length, -1) == -1)) ? -1 : 0;
}
diff --git a/myisam/sort.c b/myisam/sort.c
index 5537ba55c7d..09dd45f388c 100644
--- a/myisam/sort.c
+++ b/myisam/sort.c
@@ -84,7 +84,9 @@ static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info,
IO_CACHE *to_file,
char* key, uint sort_length,
uint count);
-inline int my_var_write(MI_SORT_PARAM *info,IO_CACHE *to_file, byte *bufs);
+static inline int
+my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs);
+
/*
Creates a index of sorted keys
@@ -625,7 +627,8 @@ static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys,
} /* write_keys */
-inline int my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs)
+static inline int
+my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs)
{
int err;
uint16 len = _mi_keylength(info->keyinfo, (uchar*) bufs);
diff --git a/myisam/sp_key.c b/myisam/sp_key.c
index 0e424a9e193..b61e8094cde 100644
--- a/myisam/sp_key.c
+++ b/myisam/sp_key.c
@@ -50,6 +50,11 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
dlen = _mi_calc_blob_length(keyseg->bit_start, pos);
memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*));
+ if (!dptr)
+ {
+ my_errno= HA_ERR_NULL_IN_SPATIAL;
+ return 0;
+ }
sp_mbr_from_wkb(dptr + 4, dlen - 4, SPDIMS, mbr); /* SRID */
for (i = 0, keyseg = keyinfo->seg; keyseg->type; keyseg++, i++)
diff --git a/myisammrg/myrg_rnext_same.c b/myisammrg/myrg_rnext_same.c
index b569459b77d..997e4100acd 100644
--- a/myisammrg/myrg_rnext_same.c
+++ b/myisammrg/myrg_rnext_same.c
@@ -16,25 +16,36 @@
#include "myrg_def.h"
+
int myrg_rnext_same(MYRG_INFO *info, byte *buf)
{
- uint err;
+ int err;
MI_INFO *mi;
if (!info->current_table)
return (HA_ERR_KEY_NOT_FOUND);
- err=mi_rnext_same(info->current_table->table,buf);
- if (err == HA_ERR_END_OF_FILE)
+ /* at first, do rnext for the table found before */
+ if ((err=mi_rnext_same(info->current_table->table,NULL)))
{
- queue_remove(&(info->by_key),0);
- if (!info->by_key.elements)
- return HA_ERR_END_OF_FILE;
-
- mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table;
- mi->once_flags|= RRND_PRESERVE_LASTINX;
- return mi_rrnd(mi,buf,mi->lastpos);
+ if (err == HA_ERR_END_OF_FILE)
+ {
+ queue_remove(&(info->by_key),0);
+ if (!info->by_key.elements)
+ return HA_ERR_END_OF_FILE;
+ }
+ else
+ return err;
}
- return err;
+ else
+ {
+ /* Found here, adding to queue */
+ queue_top(&(info->by_key))=(byte *)(info->current_table);
+ queue_replaced(&(info->by_key));
+ }
+
+ /* now, mymerge's read_next is as simple as one queue_top */
+ mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table;
+ return _myrg_mi_read_record(mi,buf);
}
diff --git a/myisammrg/myrg_static.c b/myisammrg/myrg_static.c
index b21b834ac24..9e76cbae07b 100644
--- a/myisammrg/myrg_static.c
+++ b/myisammrg/myrg_static.c
@@ -27,4 +27,4 @@ LIST *myrg_open_list=0;
static const char *merge_insert_methods[] =
{ "FIRST", "LAST", NullS };
TYPELIB merge_insert_method= { array_elements(merge_insert_methods)-1,"",
- merge_insert_methods};
+ merge_insert_methods, 0};
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index c4b3fae40f9..d718935cca8 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -39,7 +39,7 @@ CLEANFILES = $(test_SCRIPTS) $(test_DATA)
INCLUDES = -I$(srcdir)/../include -I../include -I..
EXTRA_PROGRAMS = mysql_test_run_new
noinst_HEADERS = my_manage.h
-mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c
+mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c
dist-hook:
diff --git a/mysql-test/include/ctype_common.inc b/mysql-test/include/ctype_common.inc
index 77937bdb854..202c508a9c9 100644
--- a/mysql-test/include/ctype_common.inc
+++ b/mysql-test/include/ctype_common.inc
@@ -25,6 +25,7 @@ USE d1;
CREATE TABLE t1 (c CHAR(10), KEY(c));
--enable_warnings
# check the column was created with the expected charset/collation
+--replace_result select,insert,update,references ""
SHOW FULL COLUMNS FROM t1;
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
@@ -37,6 +38,7 @@ DROP TABLE t1;
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
--enable_warnings
# check the column was created with the expected charset/collation
+--replace_result select,insert,update,references ""
SHOW FULL COLUMNS FROM t1;
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
SELECT c1 as want3results from t1 where c1 like 'l%';
diff --git a/mysql-test/include/ps_modify1.inc b/mysql-test/include/ps_modify1.inc
index 5fba7faa59a..345654b2d66 100644
--- a/mysql-test/include/ps_modify1.inc
+++ b/mysql-test/include/ps_modify1.inc
@@ -65,6 +65,9 @@ execute stmt1 using @1000, @duplicate, @5;
select a,b from t1 where a >= 1000 order by a ;
delete from t1 where a >= 1000 ;
+set @1=1 ;
+set @2=2 ;
+set @100=100 ;
set @float=1.00;
set @five='five' ;
--disable_warnings
diff --git a/mysql-test/my_create_tables.c b/mysql-test/my_create_tables.c
new file mode 100644
index 00000000000..405f66dc8df
--- /dev/null
+++ b/mysql-test/my_create_tables.c
@@ -0,0 +1,646 @@
+#include <stdio.h>
+#include <errno.h>
+#ifndef __WIN__
+#include <dirent.h>
+#endif
+#include <string.h>
+#ifdef __NETWARE__
+#include <screen.h>
+#include <proc.h>
+#else
+#include <sys/types.h>
+#ifndef __WIN__
+#include <sys/wait.h>
+#include <unistd.h>
+#else
+#include <direct.h>
+#include <stdlib.h>
+#include <stdio.h>
+#endif
+#endif
+#include <ctype.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <assert.h>
+#include "my_manage.h"
+
+/*
+ Synopsis:
+ This function testes a exist file
+
+Arguments:
+ mdata: path to data
+ file_name: name of file
+Output:
+ A zero value indicates that file is exist.
+*/
+bool test_sys_file(const char *mdata,const char *file_name)
+{
+ struct stat file;
+ char path_file_name[PATH_MAX];
+ snprintf(path_file_name, PATH_MAX, "%s/%s", mdata, file_name);
+ return(stat(path_file_name,&file));
+}
+
+/*
+ Synopsis:
+ This function creates a file with sql requstes for creating
+ system data files.
+
+Arguments:
+ mdata: path to data
+ output_file: file name for output file
+ test: to create system files with test data
+Output:
+ A zero value indicates a success.
+*/
+bool create_system_files(const char *mdata,const char *output_file, bool test)
+{
+ FILE *out;
+
+ out = fopen(output_file, "w+");
+
+ if (!out)
+ return 1;
+
+ if (test_sys_file(mdata,"mysql"))
+ {
+ fprintf(out,"CREATE DATABASE mysql;\n");
+ }
+
+ if (test && test_sys_file(mdata,"test"))
+ {
+ fprintf(out,"CREATE DATABASE test;\n");
+ }
+
+ fprintf(out,"USE mysql;\n");
+
+ if (test_sys_file(mdata,"mysql/db.frm"))
+ {
+ fprintf(out,
+ "CREATE TABLE db ("
+ "Host char(60) binary DEFAULT '' NOT NULL,"
+ "Db char(64) binary DEFAULT '' NOT NULL,"
+ "User char(16) binary DEFAULT '' NOT NULL,"
+ "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "PRIMARY KEY Host (Host,Db,User),"
+ "KEY User (User))"
+ "comment='Database privileges';\n");
+
+ if (test)
+ {
+ fprintf(out,"INSERT INTO db VALUES ('%%','test','','Y','Y','Y','Y'"
+ ",'Y','Y','N','Y','Y','Y','Y','Y');\n");
+ fprintf(out,"INSERT INTO db VALUES ('%%','test\\_%%','','Y','Y','Y'"
+ ",'Y','Y','Y','N','Y','Y','Y','Y','Y');\n");
+ }
+ }
+
+ if (test_sys_file(mdata,"mysql/host.frm"))
+ {
+ fprintf(out,
+ "CREATE TABLE host ("
+ "Host char(60) binary DEFAULT '' NOT NULL,"
+ "Db char(64) binary DEFAULT '' NOT NULL,"
+ "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "PRIMARY KEY Host (Host,Db))"
+ "comment='Host privileges;"
+ " Merged with database privileges';\n");
+ }
+
+ if (test_sys_file(mdata,"mysql/user.frm"))
+ {
+#ifdef __WIN__
+ WSADATA wsa_data;
+#endif
+ char hostname[FN_REFLEN];
+
+#ifdef __WIN__
+ if (WSAStartup(MAKEWORD( 2, 2 ),&wsa_data))
+ return 1;
+#endif
+ if (gethostname(hostname, FN_REFLEN))
+ return 1;
+#ifdef __WIN__
+ WSACleanup( );
+#endif
+
+ if (strchr(hostname, '.') == NULL)
+ strcat(hostname, "%");
+
+ fprintf(out,
+ "CREATE TABLE user ("
+ "Host char(60) binary DEFAULT '' NOT NULL,"
+ "User char(16) binary DEFAULT '' NOT NULL,"
+ "Password char(41) binary DEFAULT '' NOT NULL,"
+ "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "File_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ "ssl_type enum('','ANY','X509', 'SPECIFIED') 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,"
+ "PRIMARY KEY Host (Host,User)"
+ ") comment='Users and global privileges';\n");
+
+ if (test)
+ {
+ fprintf(out,
+ "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','','','','',0,0,0);\n");
+ fprintf(out,
+ "INSERT INTO user VALUES ('%s','root','','Y','Y',"
+ "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',"
+ "'Y','Y','Y','Y','','','','',0,0,0);\n",hostname);
+ fprintf(out,
+ "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','','','','',0,0,0);\n");
+ fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n");
+ fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname);
+ }
+ else
+ {
+ fprintf(out,
+ "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','','','','',0,0,0);\n");
+#ifndef __WIN__
+ fprintf(out,
+ "INSERT INTO user VALUES ('%s','root','','Y','Y',"
+ "'Y','Y','Y','Y','Y','Y'"
+ "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','',''"
+ ",'','',0,0,0);\n",hostname);
+ fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname);
+ fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n");
+#else
+ fprintf(out,
+ "INSERT INTO user VALUES ('localhost','','','Y','Y','Y'"
+ ",'Y','Y','Y','Y','Y','Y'"
+ ",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','',"
+ "'','',0,0,0);\n");
+#endif
+ }
+ }
+
+
+ if (test_sys_file(mdata,"mysql/func.frm"))
+ {
+ fprintf(out,
+ "CREATE TABLE func ("
+ "name char(64) binary DEFAULT '' NOT NULL,"
+ "ret tinyint(1) DEFAULT '0' NOT NULL,"
+ "dl char(128) DEFAULT '' NOT NULL,"
+ "type enum ('function','aggregate') NOT NULL,"
+ "PRIMARY KEY (name)"
+ ") comment='User defined functions';\n");
+ }
+
+ if (test_sys_file(mdata,"mysql/tables_priv.frm"))
+ {
+ fprintf(out,
+ "CREATE TABLE tables_priv ("
+ "Host char(60) binary DEFAULT '' NOT NULL,"
+ "Db char(64) binary DEFAULT '' NOT NULL,"
+ "User char(16) binary DEFAULT '' NOT NULL,"
+ "Table_name char(64) binary DEFAULT '' NOT NULL,"
+ "Grantor char(77) DEFAULT '' NOT NULL,"
+ "Timestamp timestamp(14),"
+ "Table_priv set('Select','Insert','Update','Delete',"
+ "'Create','Drop','Grant','References','Index','Alter')"
+ " DEFAULT '' NOT NULL,"
+ "Column_priv set('Select','Insert','Update','References')"
+ " DEFAULT '' NOT NULL,"
+ "PRIMARY KEY (Host,Db,User,Table_name),"
+ "KEY Grantor (Grantor)"
+ ") comment='Table privileges';\n");
+ }
+
+ if (test_sys_file(mdata,"mysql/columns_priv.frm"))
+ {
+ fprintf(out,
+ "CREATE TABLE columns_priv ("
+ "Host char(60) binary DEFAULT '' NOT NULL,"
+ "Db char(64) binary DEFAULT '' NOT NULL,"
+ "User char(16) binary DEFAULT '' NOT NULL,"
+ "Table_name char(64) binary DEFAULT '' NOT NULL,"
+ "Column_name char(64) binary DEFAULT '' NOT NULL,"
+ "Timestamp timestamp(14),"
+ "Column_priv set('Select','Insert','Update','References')"
+ " DEFAULT '' NOT NULL,"
+ "PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
+ ") comment='Column privileges';\n");
+ }
+
+ if (test_sys_file(mdata,"mysql/help_topic.frm"))
+ {
+ fprintf(out,
+ "CREATE TABLE help_topic ("
+ "help_topic_id int unsigned not null,"
+ "name varchar(64) not null,"
+ "help_category_id smallint unsigned not null,"
+ "description text not null,"
+ "example text not null,"
+ "url varchar(128) not null,"
+ "primary key (help_topic_id),"
+ "unique index (name)"
+ ") comment='help topics';\n");
+ }
+
+ if (test_sys_file(mdata,"mysql/help_category.frm"))
+ {
+ fprintf(out,
+ "CREATE TABLE help_category ("
+ "help_category_id smallint unsigned not null,"
+ "name varchar(64) not null,"
+ "parent_category_id smallint unsigned null,"
+ "url varchar(128) not null,"
+ "primary key (help_category_id),"
+ "unique index (name)"
+ ") comment='help categories';\n");
+ }
+
+ if (test_sys_file(mdata,"mysql/help_keyword.frm"))
+ {
+ fprintf(out,
+ "CREATE TABLE help_keyword ("
+ "help_keyword_id int unsigned not null,"
+ "name varchar(64) not null,"
+ "primary key (help_keyword_id),"
+ "unique index (name)"
+ ") comment='help keywords';\n");
+ }
+
+ if (test_sys_file(mdata,"mysql/help_relation.frm"))
+ {
+ fprintf(out,
+ "CREATE TABLE help_relation ("
+ "help_topic_id int unsigned not null references help_topic,"
+ "help_keyword_id int unsigned not null references help_keyword,"
+ "primary key (help_keyword_id, help_topic_id)"
+ ") comment='keyword-topic relation';\n");
+ }
+
+ if (test_sys_file(mdata,"mysql/time_zone_name.frm"))
+ {
+ fprintf(out,
+ "CREATE TABLE time_zone_name ("
+ "Name char(64) NOT NULL,"
+ "Time_zone_id int unsigned NOT NULL,"
+ "PRIMARY KEY Name (Name)"
+ ") DEFAULT CHARACTER SET latin1 "
+ "comment='Time zone names';\n");
+
+ if (test)
+ {
+ fprintf(out,
+ "INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES"
+ "('MET', 1), ('UTC', 2), ('Universal', 2), "
+ "('Europe/Moscow',3), ('leap/Europe/Moscow',4);\n");
+ }
+ }
+
+
+ if (test_sys_file(mdata,"mysql/time_zone.frm"))
+ {
+ fprintf(out,
+ "CREATE TABLE time_zone ("
+ "Time_zone_id int unsigned NOT NULL auto_increment,"
+ "Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,"
+ "PRIMARY KEY TzId (Time_zone_id)"
+ ") DEFAULT CHARACTER SET latin1 "
+ "comment='Time zones';\n");
+
+ if (test)
+ {
+ fprintf(out,"INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)"
+ "VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y');\n");
+ }
+ }
+
+ if (test_sys_file(mdata,"mysql/time_zone_transition.frm"))
+ {
+ fprintf(out,
+ "CREATE TABLE time_zone_transition ("
+ "Time_zone_id int unsigned NOT NULL,"
+ "Transition_time bigint signed NOT NULL,"
+ "Transition_type_id int unsigned NOT NULL,"
+ "PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)"
+ ") DEFAULT CHARACTER SET latin1 "
+ "comment='Time zone transitions';\n");
+
+ if (test)
+ {
+ fprintf(out,
+ "INSERT INTO time_zone_transition"
+ "(Time_zone_id, Transition_time, Transition_type_id)"
+ "VALUES"
+ " (1, -1693706400, 0) ,(1, -1680483600, 1)"
+ ",(1, -1663455600, 2) ,(1, -1650150000, 3)"
+ ",(1, -1632006000, 2) ,(1, -1618700400, 3)"
+ ",(1, -938905200, 2) ,(1, -857257200, 3)"
+ ",(1, -844556400, 2) ,(1, -828226800, 3)"
+ ",(1, -812502000, 2) ,(1, -796777200, 3)"
+ ",(1, 228877200, 2) ,(1, 243997200, 3)"
+ ",(1, 260326800, 2) ,(1, 276051600, 3)"
+ ",(1, 291776400, 2) ,(1, 307501200, 3)"
+ ",(1, 323830800, 2) ,(1, 338950800, 3)"
+ ",(1, 354675600, 2) ,(1, 370400400, 3)"
+ ",(1, 386125200, 2) ,(1, 401850000, 3)"
+ ",(1, 417574800, 2) ,(1, 433299600, 3)"
+ ",(1, 449024400, 2) ,(1, 465354000, 3)"
+ ",(1, 481078800, 2) ,(1, 496803600, 3)"
+ ",(1, 512528400, 2) ,(1, 528253200, 3)"
+ ",(1, 543978000, 2) ,(1, 559702800, 3)"
+ ",(1, 575427600, 2) ,(1, 591152400, 3)"
+ ",(1, 606877200, 2) ,(1, 622602000, 3)"
+ ",(1, 638326800, 2) ,(1, 654656400, 3)"
+ ",(1, 670381200, 2) ,(1, 686106000, 3)"
+ ",(1, 701830800, 2) ,(1, 717555600, 3)"
+ ",(1, 733280400, 2) ,(1, 749005200, 3)"
+ ",(1, 764730000, 2) ,(1, 780454800, 3)"
+ ",(1, 796179600, 2) ,(1, 811904400, 3)"
+ ",(1, 828234000, 2) ,(1, 846378000, 3)"
+ ",(1, 859683600, 2) ,(1, 877827600, 3)"
+ ",(1, 891133200, 2) ,(1, 909277200, 3)"
+ ",(1, 922582800, 2) ,(1, 941331600, 3)"
+ ",(1, 954032400, 2) ,(1, 972781200, 3)"
+ ",(1, 985482000, 2) ,(1, 1004230800, 3)"
+ ",(1, 1017536400, 2) ,(1, 1035680400, 3)"
+ ",(1, 1048986000, 2) ,(1, 1067130000, 3)"
+ ",(1, 1080435600, 2) ,(1, 1099184400, 3)"
+ ",(1, 1111885200, 2) ,(1, 1130634000, 3)"
+ ",(1, 1143334800, 2) ,(1, 1162083600, 3)"
+ ",(1, 1174784400, 2) ,(1, 1193533200, 3)"
+ ",(1, 1206838800, 2) ,(1, 1224982800, 3)"
+ ",(1, 1238288400, 2) ,(1, 1256432400, 3)"
+ ",(1, 1269738000, 2) ,(1, 1288486800, 3)"
+ ",(1, 1301187600, 2) ,(1, 1319936400, 3)"
+ ",(1, 1332637200, 2) ,(1, 1351386000, 3)"
+ ",(1, 1364691600, 2) ,(1, 1382835600, 3)"
+ ",(1, 1396141200, 2) ,(1, 1414285200, 3)"
+ ",(1, 1427590800, 2) ,(1, 1445734800, 3)"
+ ",(1, 1459040400, 2) ,(1, 1477789200, 3)"
+ ",(1, 1490490000, 2) ,(1, 1509238800, 3)"
+ ",(1, 1521939600, 2) ,(1, 1540688400, 3)"
+ ",(1, 1553994000, 2) ,(1, 1572138000, 3)"
+ ",(1, 1585443600, 2) ,(1, 1603587600, 3)"
+ ",(1, 1616893200, 2) ,(1, 1635642000, 3)"
+ ",(1, 1648342800, 2) ,(1, 1667091600, 3)"
+ ",(1, 1679792400, 2) ,(1, 1698541200, 3)"
+ ",(1, 1711846800, 2) ,(1, 1729990800, 3)"
+ ",(1, 1743296400, 2) ,(1, 1761440400, 3)"
+ ",(1, 1774746000, 2) ,(1, 1792890000, 3)"
+ ",(1, 1806195600, 2) ,(1, 1824944400, 3)"
+ ",(1, 1837645200, 2) ,(1, 1856394000, 3)"
+ ",(1, 1869094800, 2) ,(1, 1887843600, 3)"
+ ",(1, 1901149200, 2) ,(1, 1919293200, 3)"
+ ",(1, 1932598800, 2) ,(1, 1950742800, 3)"
+ ",(1, 1964048400, 2) ,(1, 1982797200, 3)"
+ ",(1, 1995498000, 2) ,(1, 2014246800, 3)"
+ ",(1, 2026947600, 2) ,(1, 2045696400, 3)"
+ ",(1, 2058397200, 2) ,(1, 2077146000, 3)"
+ ",(1, 2090451600, 2) ,(1, 2108595600, 3)"
+ ",(1, 2121901200, 2) ,(1, 2140045200, 3)"
+ ",(3, -1688265000, 2) ,(3, -1656819048, 1)"
+ ",(3, -1641353448, 2) ,(3, -1627965048, 3)"
+ ",(3, -1618716648, 1) ,(3, -1596429048, 3)"
+ ",(3, -1593829848, 5) ,(3, -1589860800, 4)"
+ ",(3, -1542427200, 5) ,(3, -1539493200, 6)"
+ ",(3, -1525323600, 5) ,(3, -1522728000, 4)"
+ ",(3, -1491188400, 7) ,(3, -1247536800, 4)"
+ ",(3, 354920400, 5) ,(3, 370728000, 4)"
+ ",(3, 386456400, 5) ,(3, 402264000, 4)"
+ ",(3, 417992400, 5) ,(3, 433800000, 4)"
+ ",(3, 449614800, 5) ,(3, 465346800, 8)"
+ ",(3, 481071600, 9) ,(3, 496796400, 8)"
+ ",(3, 512521200, 9) ,(3, 528246000, 8)"
+ ",(3, 543970800, 9) ,(3, 559695600, 8)"
+ ",(3, 575420400, 9) ,(3, 591145200, 8)"
+ ",(3, 606870000, 9) ,(3, 622594800, 8)"
+ ",(3, 638319600, 9) ,(3, 654649200, 8)"
+ ",(3, 670374000, 10) ,(3, 686102400, 11)"
+ ",(3, 695779200, 8) ,(3, 701812800, 5)"
+ ",(3, 717534000, 4) ,(3, 733273200, 9)"
+ ",(3, 748998000, 8) ,(3, 764722800, 9)"
+ ",(3, 780447600, 8) ,(3, 796172400, 9)"
+ ",(3, 811897200, 8) ,(3, 828226800, 9)"
+ ",(3, 846370800, 8) ,(3, 859676400, 9)"
+ ",(3, 877820400, 8) ,(3, 891126000, 9)"
+ ",(3, 909270000, 8) ,(3, 922575600, 9)"
+ ",(3, 941324400, 8) ,(3, 954025200, 9)"
+ ",(3, 972774000, 8) ,(3, 985474800, 9)"
+ ",(3, 1004223600, 8) ,(3, 1017529200, 9)"
+ ",(3, 1035673200, 8) ,(3, 1048978800, 9)"
+ ",(3, 1067122800, 8) ,(3, 1080428400, 9)"
+ ",(3, 1099177200, 8) ,(3, 1111878000, 9)"
+ ",(3, 1130626800, 8) ,(3, 1143327600, 9)"
+ ",(3, 1162076400, 8) ,(3, 1174777200, 9)"
+ ",(3, 1193526000, 8) ,(3, 1206831600, 9)"
+ ",(3, 1224975600, 8) ,(3, 1238281200, 9)"
+ ",(3, 1256425200, 8) ,(3, 1269730800, 9)"
+ ",(3, 1288479600, 8) ,(3, 1301180400, 9)"
+ ",(3, 1319929200, 8) ,(3, 1332630000, 9)"
+ ",(3, 1351378800, 8) ,(3, 1364684400, 9)"
+ ",(3, 1382828400, 8) ,(3, 1396134000, 9)"
+ ",(3, 1414278000, 8) ,(3, 1427583600, 9)"
+ ",(3, 1445727600, 8) ,(3, 1459033200, 9)"
+ ",(3, 1477782000, 8) ,(3, 1490482800, 9)"
+ ",(3, 1509231600, 8) ,(3, 1521932400, 9)"
+ ",(3, 1540681200, 8) ,(3, 1553986800, 9)"
+ ",(3, 1572130800, 8) ,(3, 1585436400, 9)"
+ ",(3, 1603580400, 8) ,(3, 1616886000, 9)"
+ ",(3, 1635634800, 8) ,(3, 1648335600, 9)"
+ ",(3, 1667084400, 8) ,(3, 1679785200, 9)"
+ ",(3, 1698534000, 8) ,(3, 1711839600, 9)"
+ ",(3, 1729983600, 8) ,(3, 1743289200, 9)"
+ ",(3, 1761433200, 8) ,(3, 1774738800, 9)"
+ ",(3, 1792882800, 8) ,(3, 1806188400, 9)"
+ ",(3, 1824937200, 8) ,(3, 1837638000, 9)"
+ ",(3, 1856386800, 8) ,(3, 1869087600, 9)"
+ ",(3, 1887836400, 8) ,(3, 1901142000, 9)"
+ ",(3, 1919286000, 8) ,(3, 1932591600, 9)"
+ ",(3, 1950735600, 8) ,(3, 1964041200, 9)"
+ ",(3, 1982790000, 8) ,(3, 1995490800, 9)"
+ ",(3, 2014239600, 8) ,(3, 2026940400, 9)"
+ ",(3, 2045689200, 8) ,(3, 2058390000, 9)"
+ ",(3, 2077138800, 8) ,(3, 2090444400, 9)"
+ ",(3, 2108588400, 8) ,(3, 2121894000, 9)"
+ ",(3, 2140038000, 8)"
+ ",(4, -1688265000, 2) ,(4, -1656819048, 1)"
+ ",(4, -1641353448, 2) ,(4, -1627965048, 3)"
+ ",(4, -1618716648, 1) ,(4, -1596429048, 3)"
+ ",(4, -1593829848, 5) ,(4, -1589860800, 4)"
+ ",(4, -1542427200, 5) ,(4, -1539493200, 6)"
+ ",(4, -1525323600, 5) ,(4, -1522728000, 4)"
+ ",(4, -1491188400, 7) ,(4, -1247536800, 4)"
+ ",(4, 354920409, 5) ,(4, 370728010, 4)"
+ ",(4, 386456410, 5) ,(4, 402264011, 4)"
+ ",(4, 417992411, 5) ,(4, 433800012, 4)"
+ ",(4, 449614812, 5) ,(4, 465346812, 8)"
+ ",(4, 481071612, 9) ,(4, 496796413, 8)"
+ ",(4, 512521213, 9) ,(4, 528246013, 8)"
+ ",(4, 543970813, 9) ,(4, 559695613, 8)"
+ ",(4, 575420414, 9) ,(4, 591145214, 8)"
+ ",(4, 606870014, 9) ,(4, 622594814, 8)"
+ ",(4, 638319615, 9) ,(4, 654649215, 8)"
+ ",(4, 670374016, 10) ,(4, 686102416, 11)"
+ ",(4, 695779216, 8) ,(4, 701812816, 5)"
+ ",(4, 717534017, 4) ,(4, 733273217, 9)"
+ ",(4, 748998018, 8) ,(4, 764722818, 9)"
+ ",(4, 780447619, 8) ,(4, 796172419, 9)"
+ ",(4, 811897219, 8) ,(4, 828226820, 9)"
+ ",(4, 846370820, 8) ,(4, 859676420, 9)"
+ ",(4, 877820421, 8) ,(4, 891126021, 9)"
+ ",(4, 909270021, 8) ,(4, 922575622, 9)"
+ ",(4, 941324422, 8) ,(4, 954025222, 9)"
+ ",(4, 972774022, 8) ,(4, 985474822, 9)"
+ ",(4, 1004223622, 8) ,(4, 1017529222, 9)"
+ ",(4, 1035673222, 8) ,(4, 1048978822, 9)"
+ ",(4, 1067122822, 8) ,(4, 1080428422, 9)"
+ ",(4, 1099177222, 8) ,(4, 1111878022, 9)"
+ ",(4, 1130626822, 8) ,(4, 1143327622, 9)"
+ ",(4, 1162076422, 8) ,(4, 1174777222, 9)"
+ ",(4, 1193526022, 8) ,(4, 1206831622, 9)"
+ ",(4, 1224975622, 8) ,(4, 1238281222, 9)"
+ ",(4, 1256425222, 8) ,(4, 1269730822, 9)"
+ ",(4, 1288479622, 8) ,(4, 1301180422, 9)"
+ ",(4, 1319929222, 8) ,(4, 1332630022, 9)"
+ ",(4, 1351378822, 8) ,(4, 1364684422, 9)"
+ ",(4, 1382828422, 8) ,(4, 1396134022, 9)"
+ ",(4, 1414278022, 8) ,(4, 1427583622, 9)"
+ ",(4, 1445727622, 8) ,(4, 1459033222, 9)"
+ ",(4, 1477782022, 8) ,(4, 1490482822, 9)"
+ ",(4, 1509231622, 8) ,(4, 1521932422, 9)"
+ ",(4, 1540681222, 8) ,(4, 1553986822, 9)"
+ ",(4, 1572130822, 8) ,(4, 1585436422, 9)"
+ ",(4, 1603580422, 8) ,(4, 1616886022, 9)"
+ ",(4, 1635634822, 8) ,(4, 1648335622, 9)"
+ ",(4, 1667084422, 8) ,(4, 1679785222, 9)"
+ ",(4, 1698534022, 8) ,(4, 1711839622, 9)"
+ ",(4, 1729983622, 8) ,(4, 1743289222, 9)"
+ ",(4, 1761433222, 8) ,(4, 1774738822, 9)"
+ ",(4, 1792882822, 8) ,(4, 1806188422, 9)"
+ ",(4, 1824937222, 8) ,(4, 1837638022, 9)"
+ ",(4, 1856386822, 8) ,(4, 1869087622, 9)"
+ ",(4, 1887836422, 8) ,(4, 1901142022, 9)"
+ ",(4, 1919286022, 8) ,(4, 1932591622, 9)"
+ ",(4, 1950735622, 8) ,(4, 1964041222, 9)"
+ ",(4, 1982790022, 8) ,(4, 1995490822, 9)"
+ ",(4, 2014239622, 8) ,(4, 2026940422, 9)"
+ ",(4, 2045689222, 8) ,(4, 2058390022, 9)"
+ ",(4, 2077138822, 8) ,(4, 2090444422, 9)"
+ ",(4, 2108588422, 8) ,(4, 2121894022, 9)"
+ ",(4, 2140038022, 8);\n");
+ }
+ }
+
+ if (test_sys_file(mdata,"mysql/time_zone_transition_type.frm"))
+ {
+ fprintf(out,
+ "CREATE TABLE time_zone_transition_type ("
+ "Time_zone_id int unsigned NOT NULL,"
+ "Transition_type_id int unsigned NOT NULL,"
+ "Offset int signed DEFAULT 0 NOT NULL,"
+ "Is_DST tinyint unsigned DEFAULT 0 NOT NULL,"
+ "Abbreviation char(8) DEFAULT '' NOT NULL,"
+ "PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)"
+ ") DEFAULT CHARACTER SET latin1 "
+ "comment='Time zone transition types';\n");
+
+ if (test)
+ {
+ fprintf(out,
+ "INSERT INTO time_zone_transition_type (Time_zone_id,"
+ "Transition_type_id, Offset, Is_DST, Abbreviation) VALUES"
+ "(1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')"
+ ",(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')"
+ ",(2, 0, 0, 0, 'UTC')"
+ ",(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')"
+ ",(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')"
+ ",(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')"
+ ",(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')"
+ ",(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')"
+ ",(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')"
+ ",(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')"
+ ",(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')"
+ ",(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')"
+ ",(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')"
+ ",(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')"
+ ",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET');\n");
+ }
+ }
+
+ if (test_sys_file(mdata,"mysql/time_zone_leap_second.frm"))
+ {
+ fprintf(out,
+ "CREATE TABLE time_zone_leap_second ("
+ "Transition_time bigint signed NOT NULL,"
+ "Correction int signed NOT NULL,"
+ "PRIMARY KEY TranTime (Transition_time)"
+ ") DEFAULT CHARACTER SET latin1 "
+ "comment='Leap seconds information for time zones';\n");
+
+ if (test)
+ {
+ fprintf(out,
+ "INSERT INTO time_zone_leap_second "
+ "(Transition_time, Correction) VALUES "
+ "(78796800, 1) ,(94694401, 2) ,(126230402, 3)"
+ ",(157766403, 4) ,(189302404, 5) ,(220924805, 6)"
+ ",(252460806, 7) ,(283996807, 8) ,(315532808, 9)"
+ ",(362793609, 10) ,(394329610, 11) ,(425865611, 12)"
+ ",(489024012, 13) ,(567993613, 14) ,(631152014, 15)"
+ ",(662688015, 16) ,(709948816, 17) ,(741484817, 18)"
+ ",(773020818, 19) ,(820454419, 20) ,(867715220, 21)"
+ ",(915148821, 22);\n");
+ }
+ }
+
+ return fclose(out);
+}
diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c
index cc27558f131..472b0d32683 100644
--- a/mysql-test/my_manage.c
+++ b/mysql-test/my_manage.c
@@ -333,7 +333,6 @@ int spawn(char *path, arg_list_t *al, int join, char *input,
PROCESS_INFORMATION process_information;
DWORD exit_code;
char win_args[1024]= "";
- char command_line[1024]= "";
/* Skip the first parameter */
for (i= 1; i < al->argc; i++)
@@ -724,7 +723,7 @@ int removef(const char *format, ...)
va_end(ap);
return remove(path);
-#eldef __WIN__
+#elif __WIN__
{
va_list ap;
char path[FN_REFLEN];
diff --git a/mysql-test/my_manage.h b/mysql-test/my_manage.h
index 7e371d36ab1..5df77b01af8 100644
--- a/mysql-test/my_manage.h
+++ b/mysql-test/my_manage.h
@@ -52,6 +52,8 @@ int my_vsnprintf_(char *to, size_t n, const char* value, ...);
#define TRY_MAX 5
#ifdef __WIN__
+#define PATH_MAX _MAX_PATH
+#define NAME_MAX _MAX_FNAME
#define kill(A,B) TerminateProcess((HANDLE)A,0)
#define NOT_NEED_PID 0
#define MASTER_PID 1
@@ -130,4 +132,6 @@ int removef(const char *, ...);
void get_basedir(char *, char *);
void remove_empty_file(const char *file_name);
+bool create_system_files(const char *mdata,const char *output_file, bool test);
+
#endif /* _MY_MANAGE */
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index 9c5beee02d6..c21deaf39b6 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -4,6 +4,7 @@
# Slightly updated by Monty
# Cleaned up again by Matt
# Fixed by Sergei
+# List of failed cases (--force) backported from 4.1 by Joerg
# :-)
#++
@@ -490,6 +491,7 @@ if [ x$SOURCE_DIST = x1 ] ; then
echo "Fatal error: Cannot find embedded server 'mysqltest'" 1>&2
exit 1
fi
+ TESTS_BINDIR="$BASEDIR/libmysqld/examples"
else
MYSQLD="$VALGRIND $BASEDIR/sql/mysqld"
if [ -f "$BASEDIR/client/.libs/lt-mysqltest" ] ; then
@@ -499,6 +501,7 @@ if [ x$SOURCE_DIST = x1 ] ; then
else
MYSQL_TEST="$BASEDIR/client/mysqltest"
fi
+ TESTS_BINDIR="$BASEDIR/tests"
fi
if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then
MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump"
@@ -515,7 +518,6 @@ if [ x$SOURCE_DIST = x1 ] ; then
fi
CLIENT_BINDIR="$BASEDIR/client"
- TESTS_BINDIR="$BASEDIR/tests"
MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
WAIT_PID="$BASEDIR/extra/mysql_waitpid"
MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqlmanagerc"
@@ -948,7 +950,7 @@ start_ndbcluster()
else
NDBCLUSTER_EXTRA_OPTS="--small"
fi
- ./ndb/ndbcluster $NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --diskless --initial || exit 1
+ ./ndb/ndbcluster $NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --initial || exit 1
NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT"
else
NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
@@ -1352,7 +1354,7 @@ run_testcase ()
result_file="$result_file$RESULT_EXT"
fi
if [ "$USE_MANAGER" = 1 ] ; then
- many_slaves=`$EXPR \( \( $tname : rpl_failsafe \) != 0 \) \| \( \( $tname : rpl_chain_temp_table \) != 0 \)`
+ many_slaves=`$EXPR \( \( $tname : rpl_failsafe \) != 0 \) \| \( \( $tname : rpl_chain_temp_table \) != 0 \)`
fi
if $EXPR "$tname" '<' "$START_FROM" > /dev/null ; then
#skip_test $tname
diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c
index d8bf731b398..fe13d71c1c2 100644
--- a/mysql-test/mysql_test_run_new.c
+++ b/mysql-test/mysql_test_run_new.c
@@ -267,6 +267,8 @@ void install_db(char *datadir)
snprintf(output, FN_REFLEN, "%s/install.out", datadir);
snprintf(error, FN_REFLEN, "%s/install.err", datadir);
+ if (create_system_files(datadir,input, TRUE))
+ die("Unable to create init_db.sql.");
/* args */
init_args(&al);
add_arg(&al, mysqld_file);
@@ -307,9 +309,6 @@ void mysql_install_db()
/* var directory */
snprintf(temp, FN_REFLEN, "%s/var", mysql_test_dir);
- /* clean up old direcotry */
- del_tree(temp);
-
/* create var directory */
#ifndef __WIN__
mkdir(temp, S_IRWXU);
@@ -1435,6 +1434,17 @@ void setup(char *file __attribute__((unused)))
}
+/*
+ Compare names of testes for right order
+*/
+#ifdef __WIN__
+int compare( const void *arg1, const void *arg2 )
+{
+ return _stricmp( * ( char** ) arg1, * ( char** ) arg2 );
+}
+#endif
+
+
/******************************************************************************
main()
diff --git a/mysql-test/ndb/basic.result b/mysql-test/ndb/basic.result
new file mode 100644
index 00000000000..7049c02f304
--- /dev/null
+++ b/mysql-test/ndb/basic.result
@@ -0,0 +1,69 @@
+-- NDB Cluster -- Management Client --
+---------------------------------------------------------------------------
+ NDB Cluster -- Management Client -- Help
+---------------------------------------------------------------------------
+HELP Print help text
+HELP SHOW Help for SHOW command
+HELP DEBUG Help for debug compiled version
+SHOW Print information about cluster
+START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED]
+ Start backup (default WAIT COMPLETED)
+ABORT BACKUP <backup id> Abort backup
+SHUTDOWN Shutdown all processes in cluster
+CLUSTERLOG ON [<severity>] ... Enable Cluster logging
+CLUSTERLOG OFF [<severity>] ... Disable Cluster logging
+CLUSTERLOG TOGGLE [<severity>] ... Toggle severity filter on/off
+CLUSTERLOG INFO Print cluster log information
+<id> START Start DB node (started with -n)
+<id> RESTART [-n] [-i] Restart DB node
+<id> STOP Stop DB node
+ENTER SINGLE USER MODE <api-node> Enter single user mode
+EXIT SINGLE USER MODE Exit single user mode
+<id> STATUS Print status
+<id> CLUSTERLOG {<category>=<level>}+ Set log level for cluster log
+PURGE STALE SESSIONS Reset reserved nodeid's in the mgmt server
+CONNECT [<connectstring>] Connect to management server (reconnect if already connected)
+QUIT Quit management client
+
+<severity> = ALERT | CRITICAL | ERROR | WARNING | INFO | DEBUG
+<category> = STARTUP | SHUTDOWN | STATISTICS | CHECKPOINT | NODERESTART | CONNECTION | INFO | ERROR | GREP | DEBUG | BACKUP
+<level> = 0 - 15
+<id> = ALL | Any database node id
+
+Connected to Management Server at: localhost:1186
+Node 1: started (Version 4.1.8)
+Node 2: started (Version 4.1.8)
+
+Node 1: started (Version 4.1.8)
+
+Node 2: started (Version 4.1.8)
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Cluster logging is disabled
+Cluster logging is enabled.
+Cluster logging is disabled
+ALL disabled
+ALL enabled
diff --git a/mysql-test/ndb/basic.test b/mysql-test/ndb/basic.test
new file mode 100644
index 00000000000..945bda94ff6
--- /dev/null
+++ b/mysql-test/ndb/basic.test
@@ -0,0 +1,17 @@
+help
+all status
+1 status
+2 status
+all clusterlog connection=8
+all clusterlog startup=7
+all clusterlog checkpoint=7
+all clusterlog noderestart=15
+all clusterlog statistics=7
+all clusterlog error=7
+all clusterlog info=7
+all clusterlog backup=15
+clusterlog off
+clusterlog toggle
+clusterlog off
+clusterlog off all
+clusterlog on all
diff --git a/mysql-test/ndb/basic_log.result b/mysql-test/ndb/basic_log.result
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/mysql-test/ndb/basic_log.result
diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh
index 60188705857..848223a091c 100644
--- a/mysql-test/ndb/ndbcluster.sh
+++ b/mysql-test/ndb/ndbcluster.sh
@@ -47,6 +47,7 @@ fi
pidfile=ndbcluster.pid
cfgfile=Ndb.cfg
+test_ndb=
stop_ndb=
initial_ndb=
status_ndb=
@@ -59,6 +60,9 @@ ndb_imem=24M
while test $# -gt 0; do
case "$1" in
+ --test)
+ test_ndb=1
+ ;;
--stop)
stop_ndb=1
;;
@@ -67,8 +71,7 @@ while test $# -gt 0; do
initial_ndb=1
;;
--debug*)
- f=`echo "$1" | sed -e "s;--debug=;;"`
- flags_ndb="$flags_ndb $f"
+ flags_ndb="$flags_ndb $1"
;;
--status)
status_ndb=1
@@ -232,7 +235,7 @@ status_ndbcluster
status_ndbcluster() {
# Start management client
- echo "show" | $exec_mgmtclient
+ $exec_mgmtclient -e show
}
stop_default_ndbcluster() {
@@ -241,7 +244,7 @@ stop_default_ndbcluster() {
exec_mgmtclient="$exec_mgmtclient --try-reconnect=1"
-echo "shutdown" | $exec_mgmtclient 2>&1 | cat > /dev/null
+$exec_mgmtclient -e shutdown 2>&1 | cat > /dev/null
if [ -f "$fs_ndb/$pidfile" ] ; then
kill_pids=`cat "$fs_ndb/$pidfile"`
@@ -276,6 +279,44 @@ if [ -f "$fs_ndb/$pidfile" ] ; then
fi
}
+initialize_ndb_test ()
+{
+ fs_result=$fs_ndb/r
+ rm -rf $fs_result
+ mkdir $fs_result
+ echo ------------------
+ echo starting ndb tests
+ echo ------------------
+}
+
+do_ndb_test ()
+{
+ test_name=$1
+
+ clusterlog=$fs_ndb/ndb_3_cluster.log
+
+ test_log_result=$fs_result/${test_name}_log.result
+ test_log_reject=$fs_result/${test_name}_log.reject
+ test_result=$fs_result/${test_name}.result
+ test_reject=$fs_result/${test_name}.reject
+
+ clean_log='s/.*\[MgmSrvr\]//'
+
+ cat $clusterlog ndb/${test_name}_log.result | sed -e $clean_log > $test_log_result
+
+ cp ndb/${test_name}.result $test_result
+
+ cat ndb/${test_name}.test | $exec_mgmtclient > $test_reject
+ cat $clusterlog | sed -e $clean_log > $test_log_reject
+
+ t="pass"
+ diff -C 5 $test_result $test_reject || t="fail"
+ printf "ndb_mgm output %20s [%s]\n" $test_name $t
+ t="pass"
+ diff -C 5 $test_log_result $test_log_reject || t="fail"
+ printf "clusterlog output %20s [%s]\n" $test_name $t
+}
+
if [ $status_ndb ] ; then
status_ndbcluster
exit 0
@@ -287,4 +328,15 @@ else
start_default_ndbcluster
fi
+if [ $test_ndb ] ; then
+ initialize_ndb_test
+ all_tests=`ls ndb/*.test | sed "s#ndb/##" | sed "s#.test##"`
+ for a in $all_tests ; do
+ do_ndb_test $a
+ done
+ echo ------------------
+ echo shutting down cluster
+ stop_default_ndbcluster
+fi
+
exit 0
diff --git a/mysql-test/ndb/restart.result b/mysql-test/ndb/restart.result
new file mode 100644
index 00000000000..efa1399b5d9
--- /dev/null
+++ b/mysql-test/ndb/restart.result
@@ -0,0 +1,16 @@
+-- NDB Cluster -- Management Client --
+Connected to Management Server at: localhost:1186
+ALL disabled
+Cluster logging is enabled.
+ALERT enabled
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Node 1 is being restarted.
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Node 1 is being restarted.
+
+ALL enabled
diff --git a/mysql-test/ndb/restart.test b/mysql-test/ndb/restart.test
new file mode 100644
index 00000000000..6ea9e919368
--- /dev/null
+++ b/mysql-test/ndb/restart.test
@@ -0,0 +1,12 @@
+clusterlog off all
+clusterlog on
+clusterlog on alert
+all clusterlog connection=0
+sleep 1
+1 restart
+sleep 5
+all clusterlog connection=8
+sleep 1
+1 restart
+sleep 5
+clusterlog on all
diff --git a/mysql-test/ndb/restart_log.result b/mysql-test/ndb/restart_log.result
new file mode 100644
index 00000000000..2b25fc7b5b6
--- /dev/null
+++ b/mysql-test/ndb/restart_log.result
@@ -0,0 +1,20 @@
+ ALERT -- Node 2: Network partitioning - arbitration required
+ ALERT -- Node 2: Arbitration won - positive reply from node 3
+ ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0
+ ALERT -- Node 2: Node failure of 1 DBLQH completed
+ ALERT -- Node 2: Node failure of 1 DBDICT completed
+ ALERT -- Node 2: Node failure of 1 DBDIH completed
+ ALERT -- Node 2: Node failure of 1 DBTC completed
+ ALERT -- Node 2: Node 2 completed failure of Node 1
+ ALERT -- Node 2: All nodes completed failure of Node 1
+ ALERT -- Node 3: Node 1 Disconnected
+ ALERT -- Node 2: Node 1 Disconnected
+ ALERT -- Node 2: Network partitioning - arbitration required
+ ALERT -- Node 2: Arbitration won - positive reply from node 3
+ ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0
+ ALERT -- Node 2: Node failure of 1 DBLQH completed
+ ALERT -- Node 2: Node failure of 1 DBDICT completed
+ ALERT -- Node 2: Node failure of 1 DBDIH completed
+ ALERT -- Node 2: Node failure of 1 DBTC completed
+ ALERT -- Node 2: Node 2 completed failure of Node 1
+ ALERT -- Node 2: All nodes completed failure of Node 1
diff --git a/mysql-test/r/count_distinct2.result b/mysql-test/r/count_distinct2.result
index 131e3b325ec..f6b888dec3b 100644
--- a/mysql-test/r/count_distinct2.result
+++ b/mysql-test/r/count_distinct2.result
@@ -116,7 +116,7 @@ count(distinct n)
5000
show status like 'Created_tmp_disk_tables';
Variable_name Value
-Created_tmp_disk_tables 1
+Created_tmp_disk_tables 2
drop table t1;
create table t1 (s text);
flush status;
@@ -125,5 +125,5 @@ count(distinct s)
5000
show status like 'Created_tmp_disk_tables';
Variable_name Value
-Created_tmp_disk_tables 1
+Created_tmp_disk_tables 2
drop table t1;
diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result
index 789b6e586ad..9b9fcbccbe0 100644
--- a/mysql-test/r/ctype_big5.result
+++ b/mysql-test/r/ctype_big5.result
@@ -10,7 +10,7 @@ USE d1;
CREATE TABLE t1 (c CHAR(10), KEY(c));
SHOW FULL COLUMNS FROM t1;
Field Type Collation Null Key Default Extra Privileges Comment
-c char(10) big5_chinese_ci YES MUL NULL select,insert,update,references
+c char(10) big5_chinese_ci YES MUL NULL
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
want3results
@@ -21,7 +21,7 @@ DROP TABLE t1;
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
SHOW FULL COLUMNS FROM t1;
Field Type Collation Null Key Default Extra Privileges Comment
-c1 varchar(15) big5_chinese_ci YES MUL NULL select,insert,update,references
+c1 varchar(15) big5_chinese_ci YES MUL NULL
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
SELECT c1 as want3results from t1 where c1 like 'l%';
want3results
diff --git a/mysql-test/r/ctype_big5.result.es b/mysql-test/r/ctype_big5.result.es
deleted file mode 100644
index 9b9fcbccbe0..00000000000
--- a/mysql-test/r/ctype_big5.result.es
+++ /dev/null
@@ -1,58 +0,0 @@
-drop table if exists t1;
-SET @test_character_set= 'big5';
-SET @test_collation= 'big5_chinese_ci';
-SET @safe_character_set_server= @@character_set_server;
-SET @safe_collation_server= @@collation_server;
-SET character_set_server= @test_character_set;
-SET collation_server= @test_collation;
-CREATE DATABASE d1;
-USE d1;
-CREATE TABLE t1 (c CHAR(10), KEY(c));
-SHOW FULL COLUMNS FROM t1;
-Field Type Collation Null Key Default Extra Privileges Comment
-c char(10) big5_chinese_ci YES MUL NULL
-INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
-SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
-want3results
-aaa
-aaaa
-aaaaa
-DROP TABLE t1;
-CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
-SHOW FULL COLUMNS FROM t1;
-Field Type Collation Null Key Default Extra Privileges Comment
-c1 varchar(15) big5_chinese_ci YES MUL NULL
-INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
-SELECT c1 as want3results from t1 where c1 like 'l%';
-want3results
-location
-loberge
-lotre
-SELECT c1 as want3results from t1 where c1 like 'lo%';
-want3results
-location
-loberge
-lotre
-SELECT c1 as want1result from t1 where c1 like 'loc%';
-want1result
-location
-SELECT c1 as want1result from t1 where c1 like 'loca%';
-want1result
-location
-SELECT c1 as want1result from t1 where c1 like 'locat%';
-want1result
-location
-SELECT c1 as want1result from t1 where c1 like 'locati%';
-want1result
-location
-SELECT c1 as want1result from t1 where c1 like 'locatio%';
-want1result
-location
-SELECT c1 as want1result from t1 where c1 like 'location%';
-want1result
-location
-DROP TABLE t1;
-DROP DATABASE d1;
-USE test;
-SET character_set_server= @safe_character_set_server;
-SET collation_server= @safe_collation_server;
diff --git a/mysql-test/r/ctype_create.result b/mysql-test/r/ctype_create.result
index b35131f62a4..63bae33c6e1 100644
--- a/mysql-test/r/ctype_create.result
+++ b/mysql-test/r/ctype_create.result
@@ -63,3 +63,12 @@ ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET
create database d1 default character set latin1 collate latin2_bin;
ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1'
DROP DATABASE mysqltest1;
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET latin7;
+use mysqltest2;
+ALTER DATABASE DEFAULT CHARACTER SET latin2;
+show create database mysqltest2;
+Database Create Database
+mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
+drop database mysqltest2;
+ALTER DATABASE DEFAULT CHARACTER SET latin2;
+ERROR 3D000: No database selected
diff --git a/mysql-test/r/ctype_recoding.result.es b/mysql-test/r/ctype_recoding.result.es
deleted file mode 100644
index 27425a69872..00000000000
--- a/mysql-test/r/ctype_recoding.result.es
+++ /dev/null
@@ -1,242 +0,0 @@
-SET CHARACTER SET koi8r;
-DROP TABLE IF EXISTS ÔÁÂÌÉÃÁ, t1, t2;
-SET CHARACTER SET koi8r;
-CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp1251) SELECT _koi8r'ÐÒÏÂÁ' AS a;
-CREATE TABLE t2 (a CHAR(10) CHARACTER SET utf8);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` char(10) character set cp1251 default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT a FROM t1;
-a
-ÐÒÏÂÁ
-SELECT HEX(a) FROM t1;
-HEX(a)
-EFF0EEE1E0
-INSERT t2 SELECT * FROM t1;
-SELECT HEX(a) FROM t2;
-HEX(a)
-D0BFD180D0BED0B1D0B0
-DROP TABLE t1, t2;
-CREATE TABLE t1 (description text character set cp1250 NOT NULL);
-INSERT INTO t1 (description) VALUES (_latin2'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde');
-SELECT description FROM t1;
-description
-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde
-DROP TABLE t1;
-CREATE TABLE t1 (a TEXT CHARACTER SET cp1251) SELECT _koi8r'ÐÒÏÂÁ' AS a;
-CREATE TABLE t2 (a TEXT CHARACTER SET utf8);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` text character set cp1251
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT HEX(a) FROM t1;
-HEX(a)
-EFF0EEE1E0
-INSERT t2 SELECT * FROM t1;
-SELECT HEX(a) FROM t2;
-HEX(a)
-D0BFD180D0BED0B1D0B0
-DROP TABLE t1, t2;
-CREATE TABLE `ÔÁÂÌÉÃÁ`
-(
-ÐÏÌÅ CHAR(32) CHARACTER SET koi8r NOT NULL COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ"
-) COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ";
-SHOW TABLES;
-Tables_in_test
-ÔÁÂÌÉÃÁ
-SHOW CREATE TABLE ÔÁÂÌÉÃÁ;
-Table Create Table
-ÔÁÂÌÉÃÁ CREATE TABLE `ÔÁÂÌÉÃÁ` (
- `ÐÏÌÅ` char(32) character set koi8r NOT NULL default '' COMMENT 'ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ'
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ'
-SHOW FIELDS FROM ÔÁÂÌÉÃÁ;
-Field Type Null Key Default Extra
-ÐÏÌÅ char(32)
-SET CHARACTER SET cp1251;
-SHOW TABLES;
-Tables_in_test
-òàáëèöà
-SHOW CREATE TABLE òàáëèöà;
-Table Create Table
-òàáëèöà CREATE TABLE `òàáëèöà` (
- `ïîëå` char(32) character set koi8r NOT NULL default '' COMMENT 'êîììåíòàðèé ïîëÿ'
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='êîììåíòàðèé òàáëèöû'
-SHOW FIELDS FROM òàáëèöà;
-Field Type Null Key Default Extra
-ïîëå char(32)
-SET CHARACTER SET utf8;
-SHOW TABLES;
-Tables_in_test
-таблица
-SHOW CREATE TABLE таблица;
-Table Create Table
-таблица CREATE TABLE `таблица` (
- `поле` char(32) character set koi8r NOT NULL default '' COMMENT 'комментарий полÑ'
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='комментарий таблицы'
-SHOW FIELDS FROM таблица;
-Field Type Null Key Default Extra
-поле char(32)
-SET CHARACTER SET koi8r;
-DROP TABLE ÔÁÂÌÉÃÁ;
-SET CHARACTER SET default;
-SET NAMES UTF8;
-CREATE TABLE t1 (t text) DEFAULT CHARSET UTF8;
-INSERT INTO t1 (t) VALUES ('x');
-SELECT 1 FROM t1 WHERE CONCAT(_latin1'x') = t;
-1
-1
-DROP TABLE t1;
-SET CHARACTER SET koi8r;
-CREATE DATABASE ÔÅÓÔ;
-USE ÔÅÓÔ;
-SHOW TABLES;
-Tables_in_теÑÑ‚
-SHOW TABLES IN ÔÅÓÔ;
-Tables_in_теÑÑ‚
-SET CHARACTER SET cp1251;
-SHOW TABLES;
-Tables_in_теÑÑ‚
-SHOW TABLES IN òåñò;
-Tables_in_теÑÑ‚
-SET CHARACTER SET koi8r;
-DROP DATABASE ÔÅÓÔ;
-SET NAMES koi8r;
-SELECT hex('ÔÅÓÔ');
-hex('теÑÑ‚')
-D4C5D3D4
-SET character_set_connection=cp1251;
-SELECT hex('ÔÅÓÔ');
-hex('теÑÑ‚')
-F2E5F1F2
-USE test;
-SET NAMES binary;
-CREATE TABLE `теÑÑ‚` (`теÑÑ‚` int);
-SHOW CREATE TABLE `теÑÑ‚`;
-Table Create Table
-теÑÑ‚ CREATE TABLE `теÑÑ‚` (
- `теÑÑ‚` int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SET NAMES utf8;
-SHOW CREATE TABLE `теÑÑ‚`;
-Table Create Table
-теÑÑ‚ CREATE TABLE `теÑÑ‚` (
- `теÑÑ‚` int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-DROP TABLE `теÑÑ‚`;
-SET NAMES binary;
-SET character_set_connection=utf8;
-SELECT 'теÑÑ‚' as s;
-s
-теÑÑ‚
-SET NAMES utf8;
-SET character_set_connection=binary;
-SELECT 'теÑÑ‚' as s;
-s
-теÑÑ‚
-SET NAMES latin1;
-CREATE TABLE t1 (`ä` CHAR(128) DEFAULT 'ä', `ä1` ENUM('ä1','ä2') DEFAULT 'ä2');
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `ä` char(128) default 'ä',
- `ä1` enum('ä1','ä2') default 'ä2'
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW COLUMNS FROM t1;
-Field Type Null Key Default Extra
-ä char(128) YES ä
-ä1 enum('ä1','ä2') YES ä2
-SET NAMES binary;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `ä` char(128) default 'ä',
- `ä1` enum('ä1','ä2') default 'ä2'
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW COLUMNS FROM t1;
-Field Type Null Key Default Extra
-ä char(128) YES ä
-ä1 enum('ä1','ä2') YES ä2
-DROP TABLE t1;
-SET NAMES binary;
-CREATE TABLE `goodÐÌÏÈÏ` (a int);
-ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ'
-SET NAMES utf8;
-CREATE TABLE `goodÐÌÏÈÏ` (a int);
-ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ` (a int)'
-set names latin1;
-create table t1 (a char(10) character set koi8r, b text character set koi8r);
-insert into t1 values ('test','test');
-insert into t1 values ('ÊÃÕË','ÊÃÕË');
-Warnings:
-Warning 1265 Data truncated for column 'a' at row 1
-Warning 1265 Data truncated for column 'b' at row 1
-drop table t1;
-set names koi8r;
-create table t1 (a char(10) character set cp1251);
-insert into t1 values (_koi8r'×ÁÓÑ');
-select * from t1 where a=_koi8r'×ÁÓÑ';
-a
-×ÁÓÑ
-select * from t1 where a=concat(_koi8r'×ÁÓÑ');
-ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation '='
-select * from t1 where a=_latin1'×ÁÓÑ';
-ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='
-drop table t1;
-set names latin1;
-set names koi8r;
-create table t1 (c1 char(10) character set cp1251);
-insert into t1 values ('ß');
-select c1 from t1 where c1 between 'ß' and 'ß';
-c1
-select ifnull(c1,'ß'), ifnull(null,c1) from t1;
-ifnull(c1,'ÑŠ') ifnull(null,c1)
-ß ß
-select if(1,c1,'ö'), if(0,c1,'ö') from t1;
-if(1,c1,'Ж') if(0,c1,'Ж')
-ß ö
-select coalesce('ö',c1), coalesce(null,c1) from t1;
-coalesce('Ж',c1) coalesce(null,c1)
-ö ß
-select least(c1,'ö'), greatest(c1,'ö') from t1;
-least(c1,'Ж') greatest(c1,'Ж')
-ö ß
-select locate(c1,'ß'), locate('ß',c1) from t1;
-locate(c1,'ÑŠ') locate('ÑŠ',c1)
-1 1
-select field(c1,'ß'),field('ß',c1) from t1;
-field(c1,'ÑŠ') field('ÑŠ',c1)
-1 1
-select concat(c1,'ö'), concat('ö',c1) from t1;
-concat(c1,'Ж') concat('Ж',c1)
-ßö öß
-select concat_ws(c1,'ö','ß'), concat_ws('ö',c1,'ß') from t1;
-concat_ws(c1,'Ж','ъ') concat_ws('Ж',c1,'ъ')
-ößß ßöß
-select replace(c1,'ß','ö'), replace('ß',c1,'ö') from t1;
-replace(c1,'ъ','Ж') replace('ъ',c1,'Ж')
-ö ö
-select substring_index(c1,'öößß',2) from t1;
-substring_index(c1,'ЖЖъъ',2)
-select elt(1,c1,'ö'),elt(1,'ö',c1) from t1;
-elt(1,c1,'Ж') elt(1,'Ж',c1)
-ß ö
-select make_set(3,c1,'ö'), make_set(3,'ö',c1) from t1;
-make_set(3,c1,'Ж') make_set(3,'Ж',c1)
-ß,ö ö,ß
-select insert(c1,1,2,'ö'),insert('ö',1,2,c1) from t1;
-insert(c1,1,2,'Ж') insert('Ж',1,2,c1)
-ö ß
-select trim(c1 from 'ß'),trim('ß' from c1) from t1;
-trim(c1 from 'ÑŠ') trim('ÑŠ' from c1)
-
-select lpad(c1,3,'ö'), lpad('ö',3,c1) from t1;
-lpad(c1,3,'Ж') lpad('Ж',3,c1)
-ööß ßßö
-select rpad(c1,3,'ö'), rpad('ö',3,c1) from t1;
-rpad(c1,3,'Ж') rpad('Ж',3,c1)
-ßöö ößß
diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result
index cb060ad7ee4..0573092e39b 100644
--- a/mysql-test/r/ctype_uca.result
+++ b/mysql-test/r/ctype_uca.result
@@ -2329,7 +2329,7 @@ USE d1;
CREATE TABLE t1 (c CHAR(10), KEY(c));
SHOW FULL COLUMNS FROM t1;
Field Type Collation Null Key Default Extra Privileges Comment
-c char(10) utf8_swedish_ci YES MUL NULL select,insert,update,references
+c char(10) utf8_swedish_ci YES MUL NULL
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
want3results
@@ -2340,7 +2340,7 @@ DROP TABLE t1;
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
SHOW FULL COLUMNS FROM t1;
Field Type Collation Null Key Default Extra Privileges Comment
-c1 varchar(15) utf8_swedish_ci YES MUL NULL select,insert,update,references
+c1 varchar(15) utf8_swedish_ci YES MUL NULL
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
SELECT c1 as want3results from t1 where c1 like 'l%';
want3results
@@ -2375,3 +2375,14 @@ DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
SET collation_server= @safe_collation_server;
+create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci;
+insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c');
+select a, a regexp '[a]' from t1 order by binary a;
+a a regexp '[a]'
+A 1
+B 0
+C 0
+a 1
+b 0
+c 0
+drop table t1;
diff --git a/mysql-test/r/ctype_uca.result.es b/mysql-test/r/ctype_uca.result.es
deleted file mode 100644
index 1f86376def6..00000000000
--- a/mysql-test/r/ctype_uca.result.es
+++ /dev/null
@@ -1,2377 +0,0 @@
-DROP TABLE IF EXISTS t1;
-set names utf8;
-set collation_connection=utf8_unicode_ci;
-select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
-'a' = 'a' 'a' = 'a ' 'a ' = 'a'
-1 1 1
-select 'a\t' = 'a' , 'a\t' < 'a' , 'a\t' > 'a';
-'a\t' = 'a' 'a\t' < 'a' 'a\t' > 'a'
-0 1 0
-select 'a\t' = 'a ', 'a\t' < 'a ', 'a\t' > 'a ';
-'a\t' = 'a ' 'a\t' < 'a ' 'a\t' > 'a '
-0 1 0
-select 'a' = 'a\t', 'a' < 'a\t', 'a' > 'a\t';
-'a' = 'a\t' 'a' < 'a\t' 'a' > 'a\t'
-0 0 1
-select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t';
-'a ' = 'a\t' 'a ' < 'a\t' 'a ' > 'a\t'
-0 0 1
-select 'a a' > 'a', 'a \t' < 'a';
-'a a' > 'a' 'a \t' < 'a'
-1 1
-select 'c' like '\_' as want0;
-want0
-0
-CREATE TABLE t (
-c char(20) NOT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-INSERT INTO t VALUES ('a'),('ab'),('aba');
-ALTER TABLE t ADD INDEX (c);
-SELECT c FROM t WHERE c LIKE 'a%';
-c
-a
-ab
-aba
-DROP TABLE t;
-create table t1 (c1 char(10) character set utf8 collate utf8_bin);
-insert into t1 values ('A'),('a');
-insert into t1 values ('B'),('b');
-insert into t1 values ('C'),('c');
-insert into t1 values ('D'),('d');
-insert into t1 values ('E'),('e');
-insert into t1 values ('F'),('f');
-insert into t1 values ('G'),('g');
-insert into t1 values ('H'),('h');
-insert into t1 values ('I'),('i');
-insert into t1 values ('J'),('j');
-insert into t1 values ('K'),('k');
-insert into t1 values ('L'),('l');
-insert into t1 values ('M'),('m');
-insert into t1 values ('N'),('n');
-insert into t1 values ('O'),('o');
-insert into t1 values ('P'),('p');
-insert into t1 values ('Q'),('q');
-insert into t1 values ('R'),('r');
-insert into t1 values ('S'),('s');
-insert into t1 values ('T'),('t');
-insert into t1 values ('U'),('u');
-insert into t1 values ('V'),('v');
-insert into t1 values ('W'),('w');
-insert into t1 values ('X'),('x');
-insert into t1 values ('Y'),('y');
-insert into t1 values ('Z'),('z');
-insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0);
-insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1);
-insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2);
-insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3);
-insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4);
-insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5);
-insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6);
-insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7);
-insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8);
-insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9);
-insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca);
-insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb);
-insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc);
-insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd);
-insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce);
-insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf);
-insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0);
-insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1);
-insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2);
-insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3);
-insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4);
-insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5);
-insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6);
-insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7);
-insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8);
-insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9);
-insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da);
-insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db);
-insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc);
-insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd);
-insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de);
-insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df);
-insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103);
-insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107);
-insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b);
-insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f);
-insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113);
-insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117);
-insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b);
-insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f);
-insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123);
-insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127);
-insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b);
-insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f);
-insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133);
-insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137);
-insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b);
-insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f);
-insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143);
-insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147);
-insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b);
-insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f);
-insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153);
-insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157);
-insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b);
-insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f);
-insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163);
-insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167);
-insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b);
-insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f);
-insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173);
-insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177);
-insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b);
-insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f);
-insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183);
-insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187);
-insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b);
-insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f);
-insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193);
-insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197);
-insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b);
-insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f);
-insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3);
-insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7);
-insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab);
-insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af);
-insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3);
-insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7);
-insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb);
-insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf);
-insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3);
-insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7);
-insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb);
-insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf);
-insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3);
-insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7);
-insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db);
-insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df);
-insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3);
-insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7);
-insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb);
-insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef);
-insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3);
-insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7);
-insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb);
-insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff);
-insert into t1 values ('AA'),('Aa'),('aa'),('aA');
-insert into t1 values ('CH'),('Ch'),('ch'),('cH');
-insert into t1 values ('DZ'),('Dz'),('dz'),('dZ');
-insert into t1 values ('IJ'),('Ij'),('ij'),('iJ');
-insert into t1 values ('LJ'),('Lj'),('lj'),('lJ');
-insert into t1 values ('LL'),('Ll'),('ll'),('lL');
-insert into t1 values ('NJ'),('Nj'),('nj'),('nJ');
-insert into t1 values ('OE'),('Oe'),('oe'),('oE');
-insert into t1 values ('SS'),('Ss'),('ss'),('sS');
-insert into t1 values ('RR'),('Rr'),('rr'),('rR');
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Æ,æ,Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
-CH,Ch,cH,ch
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-ƕ,Ƕ
-Ħ,ħ
-I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij,IJ,ij
-ı
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-LL,Ll,lL,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ø,ø,Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
-RR,Rr,rR,rr
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
-SS,Ss,sS,ss,ß
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Z,z,Ź,ź,Ż,ż,Ž,ž
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_icelandic_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Â,Ã,à,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Ã,á
-Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
-CH,Ch,cH,ch
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ã,ð
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-E,e,È,Ê,Ë,è,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-É,é
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-ƕ,Ƕ
-Ħ,ħ
-I,i,ÃŒ,ÃŽ,Ã,ì,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij,IJ,ij
-Ã,í
-ı
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-LL,Ll,lL,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ô,Õ,ò,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ó,ó
-Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
-RR,Rr,rR,rr
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
-SS,Ss,sS,ss,ß
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Û,Ü,ù,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ú,ú
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Y,y,ÿ,Ŷ,ŷ,Ÿ
-Ã,ý
-Ƴ,ƴ
-Z,z,Ź,ź,Ż,ż,Ž,ž
-Þ,þ
-Ä,Æ,ä,æ
-Ö,Ø,ö,ø
-Ã…,Ã¥
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_latvian_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Æ,æ,Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ
-CH,Ch,cH,ch
-ÄŒ,Ä
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ǧ,ǧ,Ç´,ǵ
-Ä¢,Ä£
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-ƕ,Ƕ
-Ħ,ħ
-I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij,IJ,ij
-Y,y
-ı
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ǩ,ǩ
-Ķ,ķ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-LL,Ll,lL,ll
-Ļ,ļ
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ñ,ñ,Ń,ń,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Ņ,ņ
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ø,ø,Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Ŕ,ŕ,Ř,ř
-RR,Rr,rR,rr
-Å–,Å—
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿
-SS,Ss,sS,ss,ß
-Å ,Å¡
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Ã,ý,ÿ,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Z,z,Ź,ź,Ż,ż
-Ž,ž
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_romanian_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Ã,Ä,Ã…,à,á,ã,ä,Ã¥,Ä€,Ä,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Ă,ă
-Â,â
-Æ,æ,Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
-CH,Ch,cH,ch
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-ƕ,Ƕ
-Ħ,ħ
-I,i,ÃŒ,Ã,Ã,ì,í,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij,IJ,ij
-Î,î
-ı
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-LL,Ll,lL,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ø,ø,Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
-RR,Rr,rR,rr
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Å ,Å¡,Å¿
-SS,Ss,sS,ss,ß
-Åž,ÅŸ
-Æ©
-ƪ
-T,t,Ť,ť
-ƾ
-Å¢,Å£
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Z,z,Ź,ź,Ż,ż,Ž,ž
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovenian_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Æ,æ,Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ
-CH,Ch,cH,ch
-ÄŒ,Ä
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-ƕ,Ƕ
-Ħ,ħ
-I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij,IJ,ij
-ı
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-LL,Ll,lL,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ø,ø,Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
-RR,Rr,rR,rr
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿
-SS,Ss,sS,ss,ß
-Å ,Å¡
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Z,z,Ź,ź,Ż,ż
-Ž,ž
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_polish_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Ä„,Ä…
-Æ,æ,Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ç,ç,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
-CH,Ch,cH,ch
-Ć,ć
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ě,ě
-Ę,ę
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-ƕ,Ƕ
-Ħ,ħ
-I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij,IJ,ij
-ı
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-LL,Ll,lL,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ñ,ñ,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Ń,ń
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ô,Õ,Ö,ò,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ó,ó
-Ø,ø,Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
-RR,Rr,rR,rr
-Ʀ
-S,s,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
-SS,Ss,sS,ss,ß
-Åš,Å›
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Z,z,Ž,ž
-Ź,ź
-Ż,ż
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_estonian_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Â,Ã,Ã…,à,á,â,ã,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Æ,æ,Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
-CH,Ch,cH,ch
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz
-DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-ƕ,Ƕ
-Ħ,ħ
-I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij,IJ,ij
-ı
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-LL,Ll,lL,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ó,Ô,ò,ó,ô,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ø,ø,Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
-RR,Rr,rR,rr
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿
-SS,Ss,sS,ss,ß
-Å ,Å¡
-Z,z
-Ž,ž
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-Õ,õ
-Ä,ä
-Ö,ö
-Ü,ü
-X,x
-Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Ź,ź,Ż,ż
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Æ,æ,Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
-CH,Ch,cH,ch
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-ƕ,Ƕ
-Ħ,ħ
-I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij,IJ,ij
-ı
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-LL,Ll,lL,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Ñ,ñ
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ø,ø,Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
-RR,Rr,rR,rr
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
-SS,Ss,sS,ss,ß
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Z,z,Ź,ź,Ż,ż,Ž,ž
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_swedish_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Â,Ã,à,á,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
-CH,Ch,cH,ch
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-ƕ,Ƕ
-Ħ,ħ
-I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij,IJ,ij
-ı
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-LL,Ll,lL,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
-RR,Rr,rR,rr
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
-SS,Ss,sS,ss,ß
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Y,y,Ü,Ã,ü,ý,ÿ,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Z,z,Ź,ź,Ż,ż,Ž,ž
-Ã…,Ã¥
-Ä,Æ,ä,æ
-Ö,Ø,ö,ø
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Æ,æ,Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
-CH,Ch,cH,ch
-Ç,ç
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Äž,ÄŸ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-I,ı
-IJ,Ij
-ƕ,Ƕ
-Ħ,ħ
-i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-iJ,ij,IJ,ij
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-LL,Ll,lL,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ö,ö
-Ø,ø,Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
-RR,Rr,rR,rr
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Å ,Å¡,Å¿
-SS,Ss,sS,ss,ß
-Åž,ÅŸ
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ü,ü
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Z,z,Ź,ź,Ż,ż,Ž,ž
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Æ,æ,Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ
-cH
-ÄŒ,Ä
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-CH,Ch,ch
-ƕ,Ƕ
-Ħ,ħ
-I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij,IJ,ij
-ı
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-LL,Ll,lL,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ø,ø,Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Å”,Å•,Å–,Å—
-RR,Rr,rR,rr
-Ř,ř
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿
-SS,Ss,sS,ss,ß
-Å ,Å¡
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Z,z,Ź,ź,Ż,ż
-Ž,ž
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Â,Ã,à,á,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-aA
-Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
-CH,Ch,cH,ch
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-ƕ,Ƕ
-Ħ,ħ
-I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij,IJ,ij
-ı
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-LL,Ll,lL,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
-RR,Rr,rR,rr
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
-SS,Ss,sS,ss,ß
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Y,y,Ü,Ã,ü,ý,ÿ,Ű,ű,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Z,z,Ź,ź,Ż,ż,Ž,ž
-Ä,Æ,ä,æ
-Ö,Ø,ö,ø,Å,Å‘
-AA,Aa,aa,Ã…,Ã¥
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Æ,æ,Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,CH,Ch,c,ch,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ
-cH
-ÄŒ,Ä
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-ƕ,Ƕ
-Ħ,ħ
-I,Y,i,y,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij,IJ,ij
-ı
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-LL,Ll,lL,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ø,ø,Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
-RR,Rr,rR,rr
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿
-SS,Ss,sS,ss,ß
-Å ,Å¡
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Ã,ý,ÿ,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Z,z,Ź,ź,Ż,ż
-Ž,ž
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Â,Ã,Ã…,à,á,â,ã,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Ä,ä
-Æ,æ,Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ
-cH
-ÄŒ,Ä
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-CH,Ch,ch
-ƕ,Ƕ
-Ħ,ħ
-I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij,IJ,ij
-ı
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-LL,Ll,lL,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ó,Õ,Ö,ò,ó,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ô,ô
-Ø,ø,Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
-RR,Rr,rR,rr
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿
-SS,Ss,sS,ss,ß
-Å ,Å¡
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Z,z,Ź,ź,Ż,ż
-Ž,ž
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Æ,æ,Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
-cH
-CH,Ch,ch
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-ƕ,Ƕ
-Ħ,ħ
-I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij,IJ,ij
-ı
-Æ—
-Æ–
-J,j,Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj,LJ,Lj,lj
-lL
-LL,Ll,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj,NJ,Nj,nj
-Ñ,ñ
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ø,ø,Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,RR,Rr,r,rr,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
-rR
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
-SS,Ss,sS,ss,ß
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ɯ
-Ʊ
-V,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Z,z,Ź,ź,Ż,ż,Ž,ž
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci;
-group_concat(c1 order by c1)
-÷
-×
-A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
-AA,Aa,aA,aa
-Æ,æ,Ǣ,ǣ,Ǽ,ǽ
-B,b
-Æ€
-Ƃ,ƃ
-C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
-CH,Ch,cH,ch
-Ƈ,ƈ
-D,d,ÄŽ,Ä
-DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
-Ä,Ä‘
-Ɖ
-ÆŠ
-Ƌ,ƌ
-Ã,ð
-E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
-ÆŽ,Ç
-F,f
-Æ‘,Æ’
-G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
-Ǥ,ǥ
-Æ“
-Æ”
-Æ¢,Æ£
-H,h,Ĥ,ĥ
-ƕ,Ƕ
-Ħ,ħ
-I,J,i,j,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç
-IJ,Ij,iJ,ij
-IJ,ij
-ı
-Æ—
-Æ–
-Ĵ,ĵ,ǰ
-K,k,Ķ,ķ,Ǩ,ǩ
-Ƙ,ƙ
-L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
-Ä¿,Å€
-LJ,Lj,lJ,lj
-LJ,Lj,lj
-LL,Ll,lL,ll
-Å,Å‚
-Æš
-Æ›
-M,m
-N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
-NJ,Nj,nJ,nj
-NJ,Nj,nj
-Æž
-ÅŠ,Å‹
-O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
-OE,Oe,oE,oe,Å’,Å“
-Ø,ø,Ǿ,ǿ
-Ɔ
-ÆŸ
-P,p
-Ƥ,ƥ
-Q,q
-ĸ
-R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
-RR,Rr,rR,rr
-Ʀ
-S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
-SS,Ss,sS,ss,ß
-Æ©
-ƪ
-T,t,Ţ,ţ,Ť,ť
-ƾ
-Ŧ,ŧ
-Æ«
-Ƭ,ƭ
-Æ®
-Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
-Ɯ
-Ʊ
-U,V,u,v
-Ʋ
-W,w,Ŵ,ŵ
-X,x
-Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
-Ƴ,ƴ
-Z,z,Ź,ź,Ż,ż,Ž,ž
-Ƶ,ƶ
-Ʒ,Ǯ,ǯ
-Ƹ,ƹ
-ƺ
-Þ,þ
-Æ¿,Ç·
-Æ»
-Ƨ,ƨ
-Ƽ,ƽ
-Æ„,Æ…
-ʼn
-Ç€
-Ç‚
-ǃ
-drop table t1;
-SET NAMES utf8;
-CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_general_ci, INDEX (c));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8));
-SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8)
-COLLATE utf8_general_ci;
-c
-Μωδαί̈
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8));
-SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8)
-COLLATE utf8_general_ci ORDER BY c;
-c
-Μωδ
-Μωδαί̈
-DROP TABLE t1;
-CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE ucs2_unicode_ci, INDEX (c));
-INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308);
-SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025 COLLATE ucs2_unicode_ci;
-c
-Μωδαί̈
-INSERT INTO t1 VALUES (_ucs2 0x039C03C903B4);
-SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025
-COLLATE ucs2_unicode_ci ORDER BY c;
-c
-Μωδ
-Μωδαί̈
-DROP TABLE t1;
-CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_unicode_ci, INDEX (c));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8));
-SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) COLLATE utf8_unicode_ci;
-c
-Μωδαί̈
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8));
-SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8)
-COLLATE utf8_unicode_ci ORDER BY c;
-c
-Μωδ
-Μωδαί̈
-DROP TABLE t1;
-CREATE TABLE t1 (
-col1 CHAR(32) CHARACTER SET utf8 NOT NULL
-);
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410627 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410628 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410648 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A0651062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06330646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06320627062F0647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062806310627064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706450647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634062C0648064A06270646064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06270631064A062E USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706460642064406270628 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0631062706460650 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F064806270631062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280631062706480646200C06310627 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E064806270646062F0647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A062D062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0623062B064A0631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0642063106270631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310641062A0647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270646062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062E0635064A0651062A064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062706310632 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270633062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906A90633 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648060C USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0648062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0633062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648067E0646062C USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330627064406AF064A060C USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306270644 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606450627064A0646062F0647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06280631064A0632 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062C06440633 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F060C USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06350641062D0627062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9062A06270628 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x068606340645 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E06480631062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0686064706310647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06420648064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450635064506510645 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310627 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646063406270646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A200C062F0647062F060C USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647063106860646062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06390645064400BB USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064806340634 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706500646064A064606AF USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062D063306270646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A062706310634062706370631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06340631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F0647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0633062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064806270646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506270646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064806510644 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0634062E064A0635 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0627062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106270648062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06270644062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106A906510631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063A064406280647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270631062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270632 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106470628063106270646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606470636062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506340631064806370647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646064A0632 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062D064206510642 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0637063106270632 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064106310647064606AF USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0645062F06510646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627063106470627064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639063106350647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064506480631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A06270633064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646060C USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D064806320647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450642062706440627062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064A06AF0631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A06980647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646062706450647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506480631062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062D062B USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628063106310633064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606480634062A0647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064606470627 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622064606860647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806310647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064206270645062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F062706320645 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0698062706460648064A0647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06390648062A0650 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306500631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0646064A0633064F0646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106270633 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064A0626062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639064406480645200C063406310642064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280639062F0627064B USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062F063106330647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206410631064A06420627064A064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270646063406AF06270647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06440646062F0646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E064A06480633062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064606AF06270645064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0633 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622063A06270632 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064606AF USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064706270646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806510645 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063406470631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064506280631064A062C USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06420644 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90631062F0646062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310641062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646062C0627 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506270646062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0627 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706A9062A06280631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606380631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480644062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480628062706310647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606330628062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645063306270639062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480632064A0631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062E062A06270631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330641064A0631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064606AF0644064A0633 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A200C06320627062F0647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627063206AF0634062A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506330631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220644064506270646064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270634 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220645062F0647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A906270631064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F0627062E062A0647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F0628064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0651 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606280648062F060C USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480644064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906480636060C USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06340627064A062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506470645 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646060C USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645063306310634 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064606480646 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E0627064606480627062F06AF064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310645064A USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062C0648062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206480631062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0648 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064506440627064B USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9062F064A06AF0631 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064406280633062A0647 USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F0646062F USING utf8));
-INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450647064506270646 USING utf8));
-SELECT HEX(CONVERT(col1 USING ucs2)) FROM t1 ORDER BY col1 COLLATE utf8_persian_ci, col1 COLLATE utf8_bin;
-HEX(CONVERT(col1 USING ucs2))
-0041004100410627
-0041004100410628
-0041004100410648
-0041004100410647
-0622063A06270632
-062206410631064A06420627064A064A
-06220644064506270646064A
-06220645062F0647
-06220646
-06220646060C
-06220646062C0627
-0622064606860647
-062206480631062F
-0627062D063306270646
-0627062F0628064A
-0627062F064806270631062F
-06270632
-06270633062A
-06270634
-0627064206270645062A
-062706A9062A06280631
-0627064506480631
-06270646062F
-062706460642064406270628
-0627064606AF0644064A0633
-06270648
-06270648060C
-0627064806510644
-0627064A
-0627064A063106270646
-0627064A063106270646060C
-0627064A0631062706460650
-0627064A063106270646064A
-0627064A0646
-0628
-06280627
-0628062706310632
-06280627063206AF0634062A
-0628062D062B
-06280631062706480646200C06310627
-062806310627064A
-0628063106310633064A
-06280639062F0627064B
-06280648062C0648062F
-06280648062F
-06280648062F060C
-06280648062F0646062F
-06280647
-0628064A0633062A
-0628064A0646
-067E0631062F0627062E062A0647
-067E0631062F062706320645
-067E0633
-067E064A06480633062A
-062A0627
-062A06270631064A062E
-062A0623062B064A0631
-062A06280631064A0632
-062A062D062A
-062A0631
-062A0634062E064A0635
-062A064106270648062A
-062A064106A906510631
-062A0642064A
-062A0642064A200C06320627062F0647
-062A0645062F06510646
-062A064606470627
-062A064806270646
-062C064606AF
-062C064706270646
-068606340645
-0686064706310647
-062D06270644062A
-062D062F0651
-062D062F0648062F
-062D06330646
-062D064806320647
-062E0627064606480627062F06AF064A
-062E064806270646062F0647
-062E06480631062F
-062F0627062F
-062F06270631062F
-062F062706460634
-062F062706460634062C0648064A06270646064A
-062F06270646063406AF06270647
-062F0631
-062F0633062A
-062F06390648062A0650
-062F064406280633062A0647
-062F0646064A0633064F0646
-062F0648
-062F06480628062706310647
-062F064806310647
-062F06480644062A
-062F064806510645
-062F064A06AF0631
-06310627
-063106270633
-06310641062A
-063106470628063106270646
-06320627062F0647
-0698062706460648064A0647
-063306500631
-063306270644
-06330627064406AF064A060C
-06330641064A0631
-0633064A06270633064A
-0633064A0651062F
-06340627064A062F
-0634062E0635064A0651062A064A
-0634062F
-0634062F0647
-063406470631
-06350641062D0627062A
-0637063106270632
-0639063106350647
-063906A90633
-063906440645
-063906440645064A
-0639064406480645200C063406310642064A
-06390645064400BB
-063906480636060C
-063A064406280647
-064106310647064606AF
-0642063106270631
-06420648064A
-06A90627063106470627064A
-06A906270631064A
-06A90627064506440627064B
-06A90627064606480646
-06A9062A06270628
-06A90631062F0646062F
-06A9064506280631064A062C
-06A9064806340634
-06A90647
-06AF
-06AF06310641062A0647
-06AF06310645064A
-06440646062F0646
-064506270646062F
-0645062C06440633
-0645062D064206510642
-0645062E062A06270631
-0645062F063106330647
-0645063306270639062F
-064506340631064806370647
-06450635064506510645
-06450642062706440627062A
-06450646
-06450646062A06340631
-06450646062A06420644
-064506480631062F
-064506470645
-06450647064506270646
-0645064A
-0645064A200C062F0647062F060C
-0646062706450647
-064606280648062F060C
-064606330628062A
-0646063406270646
-064606380631
-064606450627064A0646062F0647
-064606480634062A0647
-064606470636062A
-0646064A0632
-0648
-0648067E0646062C
-06480632064A0631
-06480644064A
-0648064A
-0648064A06980647
-064706500646064A064606AF
-0647063106860646062F
-06470645
-0647064506270646
-0647064506330631
-06470645063306310634
-064706450647
-0647064606AF06270645064A
-0647064A0626062A
-064A062706310634062706370631
-064A06A9
-064A06A9062F064A06AF0631
-064A06A9064A
-DROP TABLE t1;
-SET @test_character_set= 'utf8';
-SET @test_collation= 'utf8_swedish_ci';
-SET @safe_character_set_server= @@character_set_server;
-SET @safe_collation_server= @@collation_server;
-SET character_set_server= @test_character_set;
-SET collation_server= @test_collation;
-CREATE DATABASE d1;
-USE d1;
-CREATE TABLE t1 (c CHAR(10), KEY(c));
-SHOW FULL COLUMNS FROM t1;
-Field Type Collation Null Key Default Extra Privileges Comment
-c char(10) utf8_swedish_ci YES MUL NULL
-INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
-SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
-want3results
-aaa
-aaaa
-aaaaa
-DROP TABLE t1;
-CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
-SHOW FULL COLUMNS FROM t1;
-Field Type Collation Null Key Default Extra Privileges Comment
-c1 varchar(15) utf8_swedish_ci YES MUL NULL
-INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
-SELECT c1 as want3results from t1 where c1 like 'l%';
-want3results
-location
-loberge
-lotre
-SELECT c1 as want3results from t1 where c1 like 'lo%';
-want3results
-location
-loberge
-lotre
-SELECT c1 as want1result from t1 where c1 like 'loc%';
-want1result
-location
-SELECT c1 as want1result from t1 where c1 like 'loca%';
-want1result
-location
-SELECT c1 as want1result from t1 where c1 like 'locat%';
-want1result
-location
-SELECT c1 as want1result from t1 where c1 like 'locati%';
-want1result
-location
-SELECT c1 as want1result from t1 where c1 like 'locatio%';
-want1result
-location
-SELECT c1 as want1result from t1 where c1 like 'location%';
-want1result
-location
-DROP TABLE t1;
-DROP DATABASE d1;
-USE test;
-SET character_set_server= @safe_character_set_server;
-SET collation_server= @safe_collation_server;
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index c2c1097e1bb..238191b8e03 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -535,3 +535,59 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0;
insert into t2 values (@v);
drop table t2;
+set names latin1;
+create table t1 (a enum('x','y','z') character set ucs2);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` enum('x','y','z') character set ucs2 default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ('x');
+insert into t1 values ('y');
+insert into t1 values ('z');
+select a, hex(a) from t1 order by a;
+a hex(a)
+x 0078
+y 0079
+z 007A
+alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set ucs2;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` enum('x','y','z','d','e','ä','ö','ü') character set ucs2 default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ('D');
+insert into t1 values ('E ');
+insert into t1 values ('Ä');
+insert into t1 values ('Ö');
+insert into t1 values ('Ü');
+select a, hex(a) from t1 order by a;
+a hex(a)
+x 0078
+y 0079
+z 007A
+d 0064
+e 0065
+ä 00E4
+ö 00F6
+ü 00FC
+drop table t1;
+create table t1 (a set ('x','y','z','ä','ö','ü') character set ucs2);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` set('x','y','z','ä','ö','ü') character set ucs2 default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ('x');
+insert into t1 values ('y');
+insert into t1 values ('z');
+insert into t1 values ('x,y');
+insert into t1 values ('x,y,z,Ä,Ö,Ü');
+select a, hex(a) from t1 order by a;
+a hex(a)
+x 0078
+y 0079
+x,y 0078002C0079
+z 007A
+x,y,z,ä,ö,ü 0078002C0079002C007A002C00E4002C00F6002C00FC
+drop table t1;
diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result
index c9d37fb845a..263da67e16b 100644
--- a/mysql-test/r/ctype_ujis.result
+++ b/mysql-test/r/ctype_ujis.result
@@ -166,3 +166,2044 @@ SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a;
a b
2 iiijjjkkkl
DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1(c char(1)) character set ujis;
+INSERT INTO t1 VALUES(0xA2AF);
+INSERT INTO t1 VALUES(0xA2B0);
+INSERT INTO t1 VALUES(0xA2B1);
+INSERT INTO t1 VALUES(0xA2B2);
+INSERT INTO t1 VALUES(0xA2B3);
+INSERT INTO t1 VALUES(0xA2B4);
+INSERT INTO t1 VALUES(0xA2B5);
+INSERT INTO t1 VALUES(0xA2B6);
+INSERT INTO t1 VALUES(0xA2B7);
+INSERT INTO t1 VALUES(0xA2B8);
+INSERT INTO t1 VALUES(0xA2B9);
+INSERT INTO t1 VALUES(0xA2C2);
+INSERT INTO t1 VALUES(0xA2C3);
+INSERT INTO t1 VALUES(0xA2C4);
+INSERT INTO t1 VALUES(0xA2C5);
+INSERT INTO t1 VALUES(0xA2C6);
+INSERT INTO t1 VALUES(0xA2C7);
+INSERT INTO t1 VALUES(0xA2C8);
+INSERT INTO t1 VALUES(0xA2C9);
+INSERT INTO t1 VALUES(0xA2D1);
+INSERT INTO t1 VALUES(0xA2D2);
+INSERT INTO t1 VALUES(0xA2D3);
+INSERT INTO t1 VALUES(0xA2D4);
+INSERT INTO t1 VALUES(0xA2D5);
+INSERT INTO t1 VALUES(0xA2D6);
+INSERT INTO t1 VALUES(0xA2D7);
+INSERT INTO t1 VALUES(0xA2D8);
+INSERT INTO t1 VALUES(0xA2D9);
+INSERT INTO t1 VALUES(0xA2DA);
+INSERT INTO t1 VALUES(0xA2DB);
+INSERT INTO t1 VALUES(0xA2EB);
+INSERT INTO t1 VALUES(0xA2EC);
+INSERT INTO t1 VALUES(0xA2ED);
+INSERT INTO t1 VALUES(0xA2EE);
+INSERT INTO t1 VALUES(0xA2EF);
+INSERT INTO t1 VALUES(0xA2F0);
+INSERT INTO t1 VALUES(0xA2F1);
+INSERT INTO t1 VALUES(0xA2FA);
+INSERT INTO t1 VALUES(0xA2FB);
+INSERT INTO t1 VALUES(0xA2FC);
+INSERT INTO t1 VALUES(0xA2FD);
+INSERT INTO t1 VALUES(0xA3A1);
+INSERT INTO t1 VALUES(0xA3A2);
+INSERT INTO t1 VALUES(0xA3A3);
+INSERT INTO t1 VALUES(0xA3A4);
+INSERT INTO t1 VALUES(0xA3A5);
+INSERT INTO t1 VALUES(0xA3A6);
+INSERT INTO t1 VALUES(0xA3A7);
+INSERT INTO t1 VALUES(0xA3A8);
+INSERT INTO t1 VALUES(0xA3A9);
+INSERT INTO t1 VALUES(0xA3AA);
+INSERT INTO t1 VALUES(0xA3AB);
+INSERT INTO t1 VALUES(0xA3AC);
+INSERT INTO t1 VALUES(0xA3AD);
+INSERT INTO t1 VALUES(0xA3AE);
+INSERT INTO t1 VALUES(0xA3AF);
+INSERT INTO t1 VALUES(0xA3BA);
+INSERT INTO t1 VALUES(0xA3BB);
+INSERT INTO t1 VALUES(0xA3BC);
+INSERT INTO t1 VALUES(0xA3BD);
+INSERT INTO t1 VALUES(0xA3BE);
+INSERT INTO t1 VALUES(0xA3BF);
+INSERT INTO t1 VALUES(0xA3C0);
+INSERT INTO t1 VALUES(0xA3DB);
+INSERT INTO t1 VALUES(0xA3DC);
+INSERT INTO t1 VALUES(0xA3DD);
+INSERT INTO t1 VALUES(0xA3DE);
+INSERT INTO t1 VALUES(0xA3DF);
+INSERT INTO t1 VALUES(0xA3E0);
+INSERT INTO t1 VALUES(0xA3FB);
+INSERT INTO t1 VALUES(0xA3FC);
+INSERT INTO t1 VALUES(0xA3FD);
+INSERT INTO t1 VALUES(0xA3FE);
+INSERT INTO t1 VALUES(0xA4F4);
+INSERT INTO t1 VALUES(0xA4F5);
+INSERT INTO t1 VALUES(0xA4F6);
+INSERT INTO t1 VALUES(0xA4F7);
+INSERT INTO t1 VALUES(0xA4F8);
+INSERT INTO t1 VALUES(0xA4F9);
+INSERT INTO t1 VALUES(0xA4FA);
+INSERT INTO t1 VALUES(0xA4FB);
+INSERT INTO t1 VALUES(0xA4FC);
+INSERT INTO t1 VALUES(0xA4FD);
+INSERT INTO t1 VALUES(0xA4FE);
+INSERT INTO t1 VALUES(0xA5F7);
+INSERT INTO t1 VALUES(0xA5F8);
+INSERT INTO t1 VALUES(0xA5F9);
+INSERT INTO t1 VALUES(0xA5FA);
+INSERT INTO t1 VALUES(0xA5FB);
+INSERT INTO t1 VALUES(0xA5FC);
+INSERT INTO t1 VALUES(0xA5FD);
+INSERT INTO t1 VALUES(0xA5FE);
+INSERT INTO t1 VALUES(0xA6B9);
+INSERT INTO t1 VALUES(0xA6BA);
+INSERT INTO t1 VALUES(0xA6BB);
+INSERT INTO t1 VALUES(0xA6BC);
+INSERT INTO t1 VALUES(0xA6BD);
+INSERT INTO t1 VALUES(0xA6BE);
+INSERT INTO t1 VALUES(0xA6BF);
+INSERT INTO t1 VALUES(0xA6C0);
+INSERT INTO t1 VALUES(0xA6D9);
+INSERT INTO t1 VALUES(0xA6DA);
+INSERT INTO t1 VALUES(0xA6DB);
+INSERT INTO t1 VALUES(0xA6DC);
+INSERT INTO t1 VALUES(0xA6DD);
+INSERT INTO t1 VALUES(0xA6DE);
+INSERT INTO t1 VALUES(0xA6DF);
+INSERT INTO t1 VALUES(0xA6E0);
+INSERT INTO t1 VALUES(0xA6E1);
+INSERT INTO t1 VALUES(0xA6E2);
+INSERT INTO t1 VALUES(0xA6E3);
+INSERT INTO t1 VALUES(0xA6E4);
+INSERT INTO t1 VALUES(0xA6E5);
+INSERT INTO t1 VALUES(0xA6E6);
+INSERT INTO t1 VALUES(0xA6E7);
+INSERT INTO t1 VALUES(0xA6E8);
+INSERT INTO t1 VALUES(0xA6E9);
+INSERT INTO t1 VALUES(0xA6EA);
+INSERT INTO t1 VALUES(0xA6EB);
+INSERT INTO t1 VALUES(0xA6EC);
+INSERT INTO t1 VALUES(0xA6ED);
+INSERT INTO t1 VALUES(0xA6EE);
+INSERT INTO t1 VALUES(0xA6EF);
+INSERT INTO t1 VALUES(0xA6F0);
+INSERT INTO t1 VALUES(0xA6F1);
+INSERT INTO t1 VALUES(0xA6F2);
+INSERT INTO t1 VALUES(0xA6F3);
+INSERT INTO t1 VALUES(0xA6F4);
+INSERT INTO t1 VALUES(0xA6F5);
+INSERT INTO t1 VALUES(0xA6F6);
+INSERT INTO t1 VALUES(0xA6F7);
+INSERT INTO t1 VALUES(0xA6F8);
+INSERT INTO t1 VALUES(0xA6F9);
+INSERT INTO t1 VALUES(0xA6FA);
+INSERT INTO t1 VALUES(0xA6FB);
+INSERT INTO t1 VALUES(0xA6FC);
+INSERT INTO t1 VALUES(0xA6FD);
+INSERT INTO t1 VALUES(0xA6FE);
+INSERT INTO t1 VALUES(0xA7C2);
+INSERT INTO t1 VALUES(0xA7C3);
+INSERT INTO t1 VALUES(0xA7C4);
+INSERT INTO t1 VALUES(0xA7C5);
+INSERT INTO t1 VALUES(0xA7C6);
+INSERT INTO t1 VALUES(0xA7C7);
+INSERT INTO t1 VALUES(0xA7C8);
+INSERT INTO t1 VALUES(0xA7C9);
+INSERT INTO t1 VALUES(0xA7CA);
+INSERT INTO t1 VALUES(0xA7CB);
+INSERT INTO t1 VALUES(0xA7CC);
+INSERT INTO t1 VALUES(0xA7CD);
+INSERT INTO t1 VALUES(0xA7CE);
+INSERT INTO t1 VALUES(0xA7CF);
+INSERT INTO t1 VALUES(0xA7D0);
+INSERT INTO t1 VALUES(0xA7F2);
+INSERT INTO t1 VALUES(0xA7F3);
+INSERT INTO t1 VALUES(0xA7F4);
+INSERT INTO t1 VALUES(0xA7F5);
+INSERT INTO t1 VALUES(0xA7F6);
+INSERT INTO t1 VALUES(0xA7F7);
+INSERT INTO t1 VALUES(0xA7F8);
+INSERT INTO t1 VALUES(0xA7F9);
+INSERT INTO t1 VALUES(0xA7FA);
+INSERT INTO t1 VALUES(0xA7FB);
+INSERT INTO t1 VALUES(0xA7FC);
+INSERT INTO t1 VALUES(0xA7FD);
+INSERT INTO t1 VALUES(0xA7FE);
+INSERT INTO t1 VALUES(0xA8C1);
+INSERT INTO t1 VALUES(0xA8C2);
+INSERT INTO t1 VALUES(0xA8C3);
+INSERT INTO t1 VALUES(0xA8C4);
+INSERT INTO t1 VALUES(0xA8C5);
+INSERT INTO t1 VALUES(0xA8C6);
+INSERT INTO t1 VALUES(0xA8C7);
+INSERT INTO t1 VALUES(0xA8C8);
+INSERT INTO t1 VALUES(0xA8C9);
+INSERT INTO t1 VALUES(0xA8CA);
+INSERT INTO t1 VALUES(0xA8CB);
+INSERT INTO t1 VALUES(0xA8CC);
+INSERT INTO t1 VALUES(0xA8CD);
+INSERT INTO t1 VALUES(0xA8CE);
+INSERT INTO t1 VALUES(0xA8CF);
+INSERT INTO t1 VALUES(0xA8D0);
+INSERT INTO t1 VALUES(0xA8D1);
+INSERT INTO t1 VALUES(0xA8D2);
+INSERT INTO t1 VALUES(0xA8D3);
+INSERT INTO t1 VALUES(0xA8D4);
+INSERT INTO t1 VALUES(0xA8D5);
+INSERT INTO t1 VALUES(0xA8D6);
+INSERT INTO t1 VALUES(0xA8D7);
+INSERT INTO t1 VALUES(0xA8D8);
+INSERT INTO t1 VALUES(0xA8D9);
+INSERT INTO t1 VALUES(0xA8DA);
+INSERT INTO t1 VALUES(0xA8DB);
+INSERT INTO t1 VALUES(0xA8DC);
+INSERT INTO t1 VALUES(0xA8DD);
+INSERT INTO t1 VALUES(0xA8DE);
+INSERT INTO t1 VALUES(0xA8DF);
+INSERT INTO t1 VALUES(0xA8E0);
+INSERT INTO t1 VALUES(0xA8E1);
+INSERT INTO t1 VALUES(0xA8E2);
+INSERT INTO t1 VALUES(0xA8E3);
+INSERT INTO t1 VALUES(0xA8E4);
+INSERT INTO t1 VALUES(0xA8E5);
+INSERT INTO t1 VALUES(0xA8E6);
+INSERT INTO t1 VALUES(0xA8E7);
+INSERT INTO t1 VALUES(0xA8E8);
+INSERT INTO t1 VALUES(0xA8E9);
+INSERT INTO t1 VALUES(0xA8EA);
+INSERT INTO t1 VALUES(0xA8EB);
+INSERT INTO t1 VALUES(0xA8EC);
+INSERT INTO t1 VALUES(0xA8ED);
+INSERT INTO t1 VALUES(0xA8EE);
+INSERT INTO t1 VALUES(0xA8EF);
+INSERT INTO t1 VALUES(0xA8F0);
+INSERT INTO t1 VALUES(0xA8F1);
+INSERT INTO t1 VALUES(0xA8F2);
+INSERT INTO t1 VALUES(0xA8F3);
+INSERT INTO t1 VALUES(0xA8F4);
+INSERT INTO t1 VALUES(0xA8F5);
+INSERT INTO t1 VALUES(0xA8F6);
+INSERT INTO t1 VALUES(0xA8F7);
+INSERT INTO t1 VALUES(0xA8F8);
+INSERT INTO t1 VALUES(0xA8F9);
+INSERT INTO t1 VALUES(0xA8FA);
+INSERT INTO t1 VALUES(0xA8FB);
+INSERT INTO t1 VALUES(0xA8FC);
+INSERT INTO t1 VALUES(0xA8FD);
+INSERT INTO t1 VALUES(0xA8FE);
+INSERT INTO t1 VALUES(0xA9A1);
+INSERT INTO t1 VALUES(0xA9A2);
+INSERT INTO t1 VALUES(0xA9A3);
+INSERT INTO t1 VALUES(0xA9A4);
+INSERT INTO t1 VALUES(0xA9A5);
+INSERT INTO t1 VALUES(0xA9A6);
+INSERT INTO t1 VALUES(0xA9A7);
+INSERT INTO t1 VALUES(0xA9A8);
+INSERT INTO t1 VALUES(0xA9A9);
+INSERT INTO t1 VALUES(0xA9AA);
+INSERT INTO t1 VALUES(0xA9AB);
+INSERT INTO t1 VALUES(0xA9AC);
+INSERT INTO t1 VALUES(0xA9AD);
+INSERT INTO t1 VALUES(0xA9AE);
+INSERT INTO t1 VALUES(0xA9AF);
+INSERT INTO t1 VALUES(0xA9B0);
+INSERT INTO t1 VALUES(0xA9B1);
+INSERT INTO t1 VALUES(0xA9B2);
+INSERT INTO t1 VALUES(0xA9B3);
+INSERT INTO t1 VALUES(0xA9B4);
+INSERT INTO t1 VALUES(0xA9B5);
+INSERT INTO t1 VALUES(0xA9B6);
+INSERT INTO t1 VALUES(0xA9B7);
+INSERT INTO t1 VALUES(0xA9B8);
+INSERT INTO t1 VALUES(0xA9B9);
+INSERT INTO t1 VALUES(0xA9BA);
+INSERT INTO t1 VALUES(0xA9BB);
+INSERT INTO t1 VALUES(0xA9BC);
+INSERT INTO t1 VALUES(0xA9BD);
+INSERT INTO t1 VALUES(0xA9BE);
+INSERT INTO t1 VALUES(0xA9BF);
+INSERT INTO t1 VALUES(0xA9C0);
+INSERT INTO t1 VALUES(0xA9C1);
+INSERT INTO t1 VALUES(0xA9C2);
+INSERT INTO t1 VALUES(0xA9C3);
+INSERT INTO t1 VALUES(0xA9C4);
+INSERT INTO t1 VALUES(0xA9C5);
+INSERT INTO t1 VALUES(0xA9C6);
+INSERT INTO t1 VALUES(0xA9C7);
+INSERT INTO t1 VALUES(0xA9C8);
+INSERT INTO t1 VALUES(0xA9C9);
+INSERT INTO t1 VALUES(0xA9CA);
+INSERT INTO t1 VALUES(0xA9CB);
+INSERT INTO t1 VALUES(0xA9CC);
+INSERT INTO t1 VALUES(0xA9CD);
+INSERT INTO t1 VALUES(0xA9CE);
+INSERT INTO t1 VALUES(0xA9CF);
+INSERT INTO t1 VALUES(0xA9D0);
+INSERT INTO t1 VALUES(0xA9D1);
+INSERT INTO t1 VALUES(0xA9D2);
+INSERT INTO t1 VALUES(0xA9D3);
+INSERT INTO t1 VALUES(0xA9D4);
+INSERT INTO t1 VALUES(0xA9D5);
+INSERT INTO t1 VALUES(0xA9D6);
+INSERT INTO t1 VALUES(0xA9D7);
+INSERT INTO t1 VALUES(0xA9D8);
+INSERT INTO t1 VALUES(0xA9D9);
+INSERT INTO t1 VALUES(0xA9DA);
+INSERT INTO t1 VALUES(0xA9DB);
+INSERT INTO t1 VALUES(0xA9DC);
+INSERT INTO t1 VALUES(0xA9DD);
+INSERT INTO t1 VALUES(0xA9DE);
+INSERT INTO t1 VALUES(0xA9DF);
+INSERT INTO t1 VALUES(0xA9E0);
+INSERT INTO t1 VALUES(0xA9E1);
+INSERT INTO t1 VALUES(0xA9E2);
+INSERT INTO t1 VALUES(0xA9E3);
+INSERT INTO t1 VALUES(0xA9E4);
+INSERT INTO t1 VALUES(0xA9E5);
+INSERT INTO t1 VALUES(0xA9E6);
+INSERT INTO t1 VALUES(0xA9E7);
+INSERT INTO t1 VALUES(0xA9E8);
+INSERT INTO t1 VALUES(0xA9E9);
+INSERT INTO t1 VALUES(0xA9EA);
+INSERT INTO t1 VALUES(0xA9EB);
+INSERT INTO t1 VALUES(0xA9EC);
+INSERT INTO t1 VALUES(0xA9ED);
+INSERT INTO t1 VALUES(0xA9EE);
+INSERT INTO t1 VALUES(0xA9EF);
+INSERT INTO t1 VALUES(0xA9F0);
+INSERT INTO t1 VALUES(0xA9F1);
+INSERT INTO t1 VALUES(0xA9F2);
+INSERT INTO t1 VALUES(0xA9F3);
+INSERT INTO t1 VALUES(0xA9F4);
+INSERT INTO t1 VALUES(0xA9F5);
+INSERT INTO t1 VALUES(0xA9F6);
+INSERT INTO t1 VALUES(0xA9F7);
+INSERT INTO t1 VALUES(0xA9F8);
+INSERT INTO t1 VALUES(0xA9F9);
+INSERT INTO t1 VALUES(0xA9FA);
+INSERT INTO t1 VALUES(0xA9FB);
+INSERT INTO t1 VALUES(0xA9FC);
+INSERT INTO t1 VALUES(0xA9FD);
+INSERT INTO t1 VALUES(0xA9FE);
+INSERT INTO t1 VALUES(0xAAA1);
+INSERT INTO t1 VALUES(0xAAA2);
+INSERT INTO t1 VALUES(0xAAA3);
+INSERT INTO t1 VALUES(0xAAA4);
+INSERT INTO t1 VALUES(0xAAA5);
+INSERT INTO t1 VALUES(0xAAA6);
+INSERT INTO t1 VALUES(0xAAA7);
+INSERT INTO t1 VALUES(0xAAA8);
+INSERT INTO t1 VALUES(0xAAA9);
+INSERT INTO t1 VALUES(0xAAAA);
+INSERT INTO t1 VALUES(0xAAAB);
+INSERT INTO t1 VALUES(0xAAAC);
+INSERT INTO t1 VALUES(0xAAAD);
+INSERT INTO t1 VALUES(0xAAAE);
+INSERT INTO t1 VALUES(0xAAAF);
+INSERT INTO t1 VALUES(0xAAB0);
+INSERT INTO t1 VALUES(0xAAB1);
+INSERT INTO t1 VALUES(0xAAB2);
+INSERT INTO t1 VALUES(0xAAB3);
+INSERT INTO t1 VALUES(0xAAB4);
+INSERT INTO t1 VALUES(0xAAB5);
+INSERT INTO t1 VALUES(0xAAB6);
+INSERT INTO t1 VALUES(0xAAB7);
+INSERT INTO t1 VALUES(0xAAB8);
+INSERT INTO t1 VALUES(0xAAB9);
+INSERT INTO t1 VALUES(0xAABA);
+INSERT INTO t1 VALUES(0xAABB);
+INSERT INTO t1 VALUES(0xAABC);
+INSERT INTO t1 VALUES(0xAABD);
+INSERT INTO t1 VALUES(0xAABE);
+INSERT INTO t1 VALUES(0xAABF);
+INSERT INTO t1 VALUES(0xAAC0);
+INSERT INTO t1 VALUES(0xAAC1);
+INSERT INTO t1 VALUES(0xAAC2);
+INSERT INTO t1 VALUES(0xAAC3);
+INSERT INTO t1 VALUES(0xAAC4);
+INSERT INTO t1 VALUES(0xAAC5);
+INSERT INTO t1 VALUES(0xAAC6);
+INSERT INTO t1 VALUES(0xAAC7);
+INSERT INTO t1 VALUES(0xAAC8);
+INSERT INTO t1 VALUES(0xAAC9);
+INSERT INTO t1 VALUES(0xAACA);
+INSERT INTO t1 VALUES(0xAACB);
+INSERT INTO t1 VALUES(0xAACC);
+INSERT INTO t1 VALUES(0xAACD);
+INSERT INTO t1 VALUES(0xAACE);
+INSERT INTO t1 VALUES(0xAACF);
+INSERT INTO t1 VALUES(0xAAD0);
+INSERT INTO t1 VALUES(0xAAD1);
+INSERT INTO t1 VALUES(0xAAD2);
+INSERT INTO t1 VALUES(0xAAD3);
+INSERT INTO t1 VALUES(0xAAD4);
+INSERT INTO t1 VALUES(0xAAD5);
+INSERT INTO t1 VALUES(0xAAD6);
+INSERT INTO t1 VALUES(0xAAD7);
+INSERT INTO t1 VALUES(0xAAD8);
+INSERT INTO t1 VALUES(0xAAD9);
+INSERT INTO t1 VALUES(0xAADA);
+INSERT INTO t1 VALUES(0xAADB);
+INSERT INTO t1 VALUES(0xAADC);
+INSERT INTO t1 VALUES(0xAADD);
+INSERT INTO t1 VALUES(0xAADE);
+INSERT INTO t1 VALUES(0xAADF);
+INSERT INTO t1 VALUES(0xAAE0);
+INSERT INTO t1 VALUES(0xAAE1);
+INSERT INTO t1 VALUES(0xAAE2);
+INSERT INTO t1 VALUES(0xAAE3);
+INSERT INTO t1 VALUES(0xAAE4);
+INSERT INTO t1 VALUES(0xAAE5);
+INSERT INTO t1 VALUES(0xAAE6);
+INSERT INTO t1 VALUES(0xAAE7);
+INSERT INTO t1 VALUES(0xAAE8);
+INSERT INTO t1 VALUES(0xAAE9);
+INSERT INTO t1 VALUES(0xAAEA);
+INSERT INTO t1 VALUES(0xAAEB);
+INSERT INTO t1 VALUES(0xAAEC);
+INSERT INTO t1 VALUES(0xAAED);
+INSERT INTO t1 VALUES(0xAAEE);
+INSERT INTO t1 VALUES(0xAAEF);
+INSERT INTO t1 VALUES(0xAAF0);
+INSERT INTO t1 VALUES(0xAAF1);
+INSERT INTO t1 VALUES(0xAAF2);
+INSERT INTO t1 VALUES(0xAAF3);
+INSERT INTO t1 VALUES(0xAAF4);
+INSERT INTO t1 VALUES(0xAAF5);
+INSERT INTO t1 VALUES(0xAAF6);
+INSERT INTO t1 VALUES(0xAAF7);
+INSERT INTO t1 VALUES(0xAAF8);
+INSERT INTO t1 VALUES(0xAAF9);
+INSERT INTO t1 VALUES(0xAAFA);
+INSERT INTO t1 VALUES(0xAAFB);
+INSERT INTO t1 VALUES(0xAAFC);
+INSERT INTO t1 VALUES(0xAAFD);
+INSERT INTO t1 VALUES(0xAAFE);
+INSERT INTO t1 VALUES(0xABA1);
+INSERT INTO t1 VALUES(0xABA2);
+INSERT INTO t1 VALUES(0xABA3);
+INSERT INTO t1 VALUES(0xABA4);
+INSERT INTO t1 VALUES(0xABA5);
+INSERT INTO t1 VALUES(0xABA6);
+INSERT INTO t1 VALUES(0xABA7);
+INSERT INTO t1 VALUES(0xABA8);
+INSERT INTO t1 VALUES(0xABA9);
+INSERT INTO t1 VALUES(0xABAA);
+INSERT INTO t1 VALUES(0xABAB);
+INSERT INTO t1 VALUES(0xABAC);
+INSERT INTO t1 VALUES(0xABAD);
+INSERT INTO t1 VALUES(0xABAE);
+INSERT INTO t1 VALUES(0xABAF);
+INSERT INTO t1 VALUES(0xABB0);
+INSERT INTO t1 VALUES(0xABB1);
+INSERT INTO t1 VALUES(0xABB2);
+INSERT INTO t1 VALUES(0xABB3);
+INSERT INTO t1 VALUES(0xABB4);
+INSERT INTO t1 VALUES(0xABB5);
+INSERT INTO t1 VALUES(0xABB6);
+INSERT INTO t1 VALUES(0xABB7);
+INSERT INTO t1 VALUES(0xABB8);
+INSERT INTO t1 VALUES(0xABB9);
+INSERT INTO t1 VALUES(0xABBA);
+INSERT INTO t1 VALUES(0xABBB);
+INSERT INTO t1 VALUES(0xABBC);
+INSERT INTO t1 VALUES(0xABBD);
+INSERT INTO t1 VALUES(0xABBE);
+INSERT INTO t1 VALUES(0xABBF);
+INSERT INTO t1 VALUES(0xABC0);
+INSERT INTO t1 VALUES(0xABC1);
+INSERT INTO t1 VALUES(0xABC2);
+INSERT INTO t1 VALUES(0xABC3);
+INSERT INTO t1 VALUES(0xABC4);
+INSERT INTO t1 VALUES(0xABC5);
+INSERT INTO t1 VALUES(0xABC6);
+INSERT INTO t1 VALUES(0xABC7);
+INSERT INTO t1 VALUES(0xABC8);
+INSERT INTO t1 VALUES(0xABC9);
+INSERT INTO t1 VALUES(0xABCA);
+INSERT INTO t1 VALUES(0xABCB);
+INSERT INTO t1 VALUES(0xABCC);
+INSERT INTO t1 VALUES(0xABCD);
+INSERT INTO t1 VALUES(0xABCE);
+INSERT INTO t1 VALUES(0xABCF);
+INSERT INTO t1 VALUES(0xABD0);
+INSERT INTO t1 VALUES(0xABD1);
+INSERT INTO t1 VALUES(0xABD2);
+INSERT INTO t1 VALUES(0xABD3);
+INSERT INTO t1 VALUES(0xABD4);
+INSERT INTO t1 VALUES(0xABD5);
+INSERT INTO t1 VALUES(0xABD6);
+INSERT INTO t1 VALUES(0xABD7);
+INSERT INTO t1 VALUES(0xABD8);
+INSERT INTO t1 VALUES(0xABD9);
+INSERT INTO t1 VALUES(0xABDA);
+INSERT INTO t1 VALUES(0xABDB);
+INSERT INTO t1 VALUES(0xABDC);
+INSERT INTO t1 VALUES(0xABDD);
+INSERT INTO t1 VALUES(0xABDE);
+INSERT INTO t1 VALUES(0xABDF);
+INSERT INTO t1 VALUES(0xABE0);
+INSERT INTO t1 VALUES(0xABE1);
+INSERT INTO t1 VALUES(0xABE2);
+INSERT INTO t1 VALUES(0xABE3);
+INSERT INTO t1 VALUES(0xABE4);
+INSERT INTO t1 VALUES(0xABE5);
+INSERT INTO t1 VALUES(0xABE6);
+INSERT INTO t1 VALUES(0xABE7);
+INSERT INTO t1 VALUES(0xABE8);
+INSERT INTO t1 VALUES(0xABE9);
+INSERT INTO t1 VALUES(0xABEA);
+INSERT INTO t1 VALUES(0xABEB);
+INSERT INTO t1 VALUES(0xABEC);
+INSERT INTO t1 VALUES(0xABED);
+INSERT INTO t1 VALUES(0xABEE);
+INSERT INTO t1 VALUES(0xABEF);
+INSERT INTO t1 VALUES(0xABF0);
+INSERT INTO t1 VALUES(0xABF1);
+INSERT INTO t1 VALUES(0xABF2);
+INSERT INTO t1 VALUES(0xABF3);
+INSERT INTO t1 VALUES(0xABF4);
+INSERT INTO t1 VALUES(0xABF5);
+INSERT INTO t1 VALUES(0xABF6);
+INSERT INTO t1 VALUES(0xABF7);
+INSERT INTO t1 VALUES(0xABF8);
+INSERT INTO t1 VALUES(0xABF9);
+INSERT INTO t1 VALUES(0xABFA);
+INSERT INTO t1 VALUES(0xABFB);
+INSERT INTO t1 VALUES(0xABFC);
+INSERT INTO t1 VALUES(0xABFD);
+INSERT INTO t1 VALUES(0xABFE);
+INSERT INTO t1 VALUES(0xACA1);
+INSERT INTO t1 VALUES(0xACA2);
+INSERT INTO t1 VALUES(0xACA3);
+INSERT INTO t1 VALUES(0xACA4);
+INSERT INTO t1 VALUES(0xACA5);
+INSERT INTO t1 VALUES(0xACA6);
+INSERT INTO t1 VALUES(0xACA7);
+INSERT INTO t1 VALUES(0xACA8);
+INSERT INTO t1 VALUES(0xACA9);
+INSERT INTO t1 VALUES(0xACAA);
+INSERT INTO t1 VALUES(0xACAB);
+INSERT INTO t1 VALUES(0xACAC);
+INSERT INTO t1 VALUES(0xACAD);
+INSERT INTO t1 VALUES(0xACAE);
+INSERT INTO t1 VALUES(0xACAF);
+INSERT INTO t1 VALUES(0xACB0);
+INSERT INTO t1 VALUES(0xACB1);
+INSERT INTO t1 VALUES(0xACB2);
+INSERT INTO t1 VALUES(0xACB3);
+INSERT INTO t1 VALUES(0xACB4);
+INSERT INTO t1 VALUES(0xACB5);
+INSERT INTO t1 VALUES(0xACB6);
+INSERT INTO t1 VALUES(0xACB7);
+INSERT INTO t1 VALUES(0xACB8);
+INSERT INTO t1 VALUES(0xACB9);
+INSERT INTO t1 VALUES(0xACBA);
+INSERT INTO t1 VALUES(0xACBB);
+INSERT INTO t1 VALUES(0xACBC);
+INSERT INTO t1 VALUES(0xACBD);
+INSERT INTO t1 VALUES(0xACBE);
+INSERT INTO t1 VALUES(0xACBF);
+INSERT INTO t1 VALUES(0xACC0);
+INSERT INTO t1 VALUES(0xACC1);
+INSERT INTO t1 VALUES(0xACC2);
+INSERT INTO t1 VALUES(0xACC3);
+INSERT INTO t1 VALUES(0xACC4);
+INSERT INTO t1 VALUES(0xACC5);
+INSERT INTO t1 VALUES(0xACC6);
+INSERT INTO t1 VALUES(0xACC7);
+INSERT INTO t1 VALUES(0xACC8);
+INSERT INTO t1 VALUES(0xACC9);
+INSERT INTO t1 VALUES(0xACCA);
+INSERT INTO t1 VALUES(0xACCB);
+INSERT INTO t1 VALUES(0xACCC);
+INSERT INTO t1 VALUES(0xACCD);
+INSERT INTO t1 VALUES(0xACCE);
+INSERT INTO t1 VALUES(0xACCF);
+INSERT INTO t1 VALUES(0xACD0);
+INSERT INTO t1 VALUES(0xACD1);
+INSERT INTO t1 VALUES(0xACD2);
+INSERT INTO t1 VALUES(0xACD3);
+INSERT INTO t1 VALUES(0xACD4);
+INSERT INTO t1 VALUES(0xACD5);
+INSERT INTO t1 VALUES(0xACD6);
+INSERT INTO t1 VALUES(0xACD7);
+INSERT INTO t1 VALUES(0xACD8);
+INSERT INTO t1 VALUES(0xACD9);
+INSERT INTO t1 VALUES(0xACDA);
+INSERT INTO t1 VALUES(0xACDB);
+INSERT INTO t1 VALUES(0xACDC);
+INSERT INTO t1 VALUES(0xACDD);
+INSERT INTO t1 VALUES(0xACDE);
+INSERT INTO t1 VALUES(0xACDF);
+INSERT INTO t1 VALUES(0xACE0);
+INSERT INTO t1 VALUES(0xACE1);
+INSERT INTO t1 VALUES(0xACE2);
+INSERT INTO t1 VALUES(0xACE3);
+INSERT INTO t1 VALUES(0xACE4);
+INSERT INTO t1 VALUES(0xACE5);
+INSERT INTO t1 VALUES(0xACE6);
+INSERT INTO t1 VALUES(0xACE7);
+INSERT INTO t1 VALUES(0xACE8);
+INSERT INTO t1 VALUES(0xACE9);
+INSERT INTO t1 VALUES(0xACEA);
+INSERT INTO t1 VALUES(0xACEB);
+INSERT INTO t1 VALUES(0xACEC);
+INSERT INTO t1 VALUES(0xACED);
+INSERT INTO t1 VALUES(0xACEE);
+INSERT INTO t1 VALUES(0xACEF);
+INSERT INTO t1 VALUES(0xACF0);
+INSERT INTO t1 VALUES(0xACF1);
+INSERT INTO t1 VALUES(0xACF2);
+INSERT INTO t1 VALUES(0xACF3);
+INSERT INTO t1 VALUES(0xACF4);
+INSERT INTO t1 VALUES(0xACF5);
+INSERT INTO t1 VALUES(0xACF6);
+INSERT INTO t1 VALUES(0xACF7);
+INSERT INTO t1 VALUES(0xACF8);
+INSERT INTO t1 VALUES(0xACF9);
+INSERT INTO t1 VALUES(0xACFA);
+INSERT INTO t1 VALUES(0xACFB);
+INSERT INTO t1 VALUES(0xACFC);
+INSERT INTO t1 VALUES(0xACFD);
+INSERT INTO t1 VALUES(0xACFE);
+INSERT INTO t1 VALUES(0xADA1);
+INSERT INTO t1 VALUES(0xADA2);
+INSERT INTO t1 VALUES(0xADA3);
+INSERT INTO t1 VALUES(0xADA4);
+INSERT INTO t1 VALUES(0xADA5);
+INSERT INTO t1 VALUES(0xADA6);
+INSERT INTO t1 VALUES(0xADA7);
+INSERT INTO t1 VALUES(0xADA8);
+INSERT INTO t1 VALUES(0xADA9);
+INSERT INTO t1 VALUES(0xADAA);
+INSERT INTO t1 VALUES(0xADAB);
+INSERT INTO t1 VALUES(0xADAC);
+INSERT INTO t1 VALUES(0xADAD);
+INSERT INTO t1 VALUES(0xADAE);
+INSERT INTO t1 VALUES(0xADAF);
+INSERT INTO t1 VALUES(0xADB0);
+INSERT INTO t1 VALUES(0xADB1);
+INSERT INTO t1 VALUES(0xADB2);
+INSERT INTO t1 VALUES(0xADB3);
+INSERT INTO t1 VALUES(0xADB4);
+INSERT INTO t1 VALUES(0xADB5);
+INSERT INTO t1 VALUES(0xADB6);
+INSERT INTO t1 VALUES(0xADB7);
+INSERT INTO t1 VALUES(0xADB8);
+INSERT INTO t1 VALUES(0xADB9);
+INSERT INTO t1 VALUES(0xADBA);
+INSERT INTO t1 VALUES(0xADBB);
+INSERT INTO t1 VALUES(0xADBC);
+INSERT INTO t1 VALUES(0xADBD);
+INSERT INTO t1 VALUES(0xADBE);
+INSERT INTO t1 VALUES(0xADBF);
+INSERT INTO t1 VALUES(0xADC0);
+INSERT INTO t1 VALUES(0xADC1);
+INSERT INTO t1 VALUES(0xADC2);
+INSERT INTO t1 VALUES(0xADC3);
+INSERT INTO t1 VALUES(0xADC4);
+INSERT INTO t1 VALUES(0xADC5);
+INSERT INTO t1 VALUES(0xADC6);
+INSERT INTO t1 VALUES(0xADC7);
+INSERT INTO t1 VALUES(0xADC8);
+INSERT INTO t1 VALUES(0xADC9);
+INSERT INTO t1 VALUES(0xADCA);
+INSERT INTO t1 VALUES(0xADCB);
+INSERT INTO t1 VALUES(0xADCC);
+INSERT INTO t1 VALUES(0xADCD);
+INSERT INTO t1 VALUES(0xADCE);
+INSERT INTO t1 VALUES(0xADCF);
+INSERT INTO t1 VALUES(0xADD0);
+INSERT INTO t1 VALUES(0xADD1);
+INSERT INTO t1 VALUES(0xADD2);
+INSERT INTO t1 VALUES(0xADD3);
+INSERT INTO t1 VALUES(0xADD4);
+INSERT INTO t1 VALUES(0xADD5);
+INSERT INTO t1 VALUES(0xADD6);
+INSERT INTO t1 VALUES(0xADD7);
+INSERT INTO t1 VALUES(0xADD8);
+INSERT INTO t1 VALUES(0xADD9);
+INSERT INTO t1 VALUES(0xADDA);
+INSERT INTO t1 VALUES(0xADDB);
+INSERT INTO t1 VALUES(0xADDC);
+INSERT INTO t1 VALUES(0xADDD);
+INSERT INTO t1 VALUES(0xADDE);
+INSERT INTO t1 VALUES(0xADDF);
+INSERT INTO t1 VALUES(0xADE0);
+INSERT INTO t1 VALUES(0xADE1);
+INSERT INTO t1 VALUES(0xADE2);
+INSERT INTO t1 VALUES(0xADE3);
+INSERT INTO t1 VALUES(0xADE4);
+INSERT INTO t1 VALUES(0xADE5);
+INSERT INTO t1 VALUES(0xADE6);
+INSERT INTO t1 VALUES(0xADE7);
+INSERT INTO t1 VALUES(0xADE8);
+INSERT INTO t1 VALUES(0xADE9);
+INSERT INTO t1 VALUES(0xADEA);
+INSERT INTO t1 VALUES(0xADEB);
+INSERT INTO t1 VALUES(0xADEC);
+INSERT INTO t1 VALUES(0xADED);
+INSERT INTO t1 VALUES(0xADEE);
+INSERT INTO t1 VALUES(0xADEF);
+INSERT INTO t1 VALUES(0xADF0);
+INSERT INTO t1 VALUES(0xADF1);
+INSERT INTO t1 VALUES(0xADF2);
+INSERT INTO t1 VALUES(0xADF3);
+INSERT INTO t1 VALUES(0xADF4);
+INSERT INTO t1 VALUES(0xADF5);
+INSERT INTO t1 VALUES(0xADF6);
+INSERT INTO t1 VALUES(0xADF7);
+INSERT INTO t1 VALUES(0xADF8);
+INSERT INTO t1 VALUES(0xADF9);
+INSERT INTO t1 VALUES(0xADFA);
+INSERT INTO t1 VALUES(0xADFB);
+INSERT INTO t1 VALUES(0xADFC);
+INSERT INTO t1 VALUES(0xADFD);
+INSERT INTO t1 VALUES(0xADFE);
+INSERT INTO t1 VALUES(0xAEA1);
+INSERT INTO t1 VALUES(0xAEA2);
+INSERT INTO t1 VALUES(0xAEA3);
+INSERT INTO t1 VALUES(0xAEA4);
+INSERT INTO t1 VALUES(0xAEA5);
+INSERT INTO t1 VALUES(0xAEA6);
+INSERT INTO t1 VALUES(0xAEA7);
+INSERT INTO t1 VALUES(0xAEA8);
+INSERT INTO t1 VALUES(0xAEA9);
+INSERT INTO t1 VALUES(0xAEAA);
+INSERT INTO t1 VALUES(0xAEAB);
+INSERT INTO t1 VALUES(0xAEAC);
+INSERT INTO t1 VALUES(0xAEAD);
+INSERT INTO t1 VALUES(0xAEAE);
+INSERT INTO t1 VALUES(0xAEAF);
+INSERT INTO t1 VALUES(0xAEB0);
+INSERT INTO t1 VALUES(0xAEB1);
+INSERT INTO t1 VALUES(0xAEB2);
+INSERT INTO t1 VALUES(0xAEB3);
+INSERT INTO t1 VALUES(0xAEB4);
+INSERT INTO t1 VALUES(0xAEB5);
+INSERT INTO t1 VALUES(0xAEB6);
+INSERT INTO t1 VALUES(0xAEB7);
+INSERT INTO t1 VALUES(0xAEB8);
+INSERT INTO t1 VALUES(0xAEB9);
+INSERT INTO t1 VALUES(0xAEBA);
+INSERT INTO t1 VALUES(0xAEBB);
+INSERT INTO t1 VALUES(0xAEBC);
+INSERT INTO t1 VALUES(0xAEBD);
+INSERT INTO t1 VALUES(0xAEBE);
+INSERT INTO t1 VALUES(0xAEBF);
+INSERT INTO t1 VALUES(0xAEC0);
+INSERT INTO t1 VALUES(0xAEC1);
+INSERT INTO t1 VALUES(0xAEC2);
+INSERT INTO t1 VALUES(0xAEC3);
+INSERT INTO t1 VALUES(0xAEC4);
+INSERT INTO t1 VALUES(0xAEC5);
+INSERT INTO t1 VALUES(0xAEC6);
+INSERT INTO t1 VALUES(0xAEC7);
+INSERT INTO t1 VALUES(0xAEC8);
+INSERT INTO t1 VALUES(0xAEC9);
+INSERT INTO t1 VALUES(0xAECA);
+INSERT INTO t1 VALUES(0xAECB);
+INSERT INTO t1 VALUES(0xAECC);
+INSERT INTO t1 VALUES(0xAECD);
+INSERT INTO t1 VALUES(0xAECE);
+INSERT INTO t1 VALUES(0xAECF);
+INSERT INTO t1 VALUES(0xAED0);
+INSERT INTO t1 VALUES(0xAED1);
+INSERT INTO t1 VALUES(0xAED2);
+INSERT INTO t1 VALUES(0xAED3);
+INSERT INTO t1 VALUES(0xAED4);
+INSERT INTO t1 VALUES(0xAED5);
+INSERT INTO t1 VALUES(0xAED6);
+INSERT INTO t1 VALUES(0xAED7);
+INSERT INTO t1 VALUES(0xAED8);
+INSERT INTO t1 VALUES(0xAED9);
+INSERT INTO t1 VALUES(0xAEDA);
+INSERT INTO t1 VALUES(0xAEDB);
+INSERT INTO t1 VALUES(0xAEDC);
+INSERT INTO t1 VALUES(0xAEDD);
+INSERT INTO t1 VALUES(0xAEDE);
+INSERT INTO t1 VALUES(0xAEDF);
+INSERT INTO t1 VALUES(0xAEE0);
+INSERT INTO t1 VALUES(0xAEE1);
+INSERT INTO t1 VALUES(0xAEE2);
+INSERT INTO t1 VALUES(0xAEE3);
+INSERT INTO t1 VALUES(0xAEE4);
+INSERT INTO t1 VALUES(0xAEE5);
+INSERT INTO t1 VALUES(0xAEE6);
+INSERT INTO t1 VALUES(0xAEE7);
+INSERT INTO t1 VALUES(0xAEE8);
+INSERT INTO t1 VALUES(0xAEE9);
+INSERT INTO t1 VALUES(0xAEEA);
+INSERT INTO t1 VALUES(0xAEEB);
+INSERT INTO t1 VALUES(0xAEEC);
+INSERT INTO t1 VALUES(0xAEED);
+INSERT INTO t1 VALUES(0xAEEE);
+INSERT INTO t1 VALUES(0xAEEF);
+INSERT INTO t1 VALUES(0xAEF0);
+INSERT INTO t1 VALUES(0xAEF1);
+INSERT INTO t1 VALUES(0xAEF2);
+INSERT INTO t1 VALUES(0xAEF3);
+INSERT INTO t1 VALUES(0xAEF4);
+INSERT INTO t1 VALUES(0xAEF5);
+INSERT INTO t1 VALUES(0xAEF6);
+INSERT INTO t1 VALUES(0xAEF7);
+INSERT INTO t1 VALUES(0xAEF8);
+INSERT INTO t1 VALUES(0xAEF9);
+INSERT INTO t1 VALUES(0xAEFA);
+INSERT INTO t1 VALUES(0xAEFB);
+INSERT INTO t1 VALUES(0xAEFC);
+INSERT INTO t1 VALUES(0xAEFD);
+INSERT INTO t1 VALUES(0xAEFE);
+INSERT INTO t1 VALUES(0xAFA1);
+INSERT INTO t1 VALUES(0xAFA2);
+INSERT INTO t1 VALUES(0xAFA3);
+INSERT INTO t1 VALUES(0xAFA4);
+INSERT INTO t1 VALUES(0xAFA5);
+INSERT INTO t1 VALUES(0xAFA6);
+INSERT INTO t1 VALUES(0xAFA7);
+INSERT INTO t1 VALUES(0xAFA8);
+INSERT INTO t1 VALUES(0xAFA9);
+INSERT INTO t1 VALUES(0xAFAA);
+INSERT INTO t1 VALUES(0xAFAB);
+INSERT INTO t1 VALUES(0xAFAC);
+INSERT INTO t1 VALUES(0xAFAD);
+INSERT INTO t1 VALUES(0xAFAE);
+INSERT INTO t1 VALUES(0xAFAF);
+INSERT INTO t1 VALUES(0xAFB0);
+INSERT INTO t1 VALUES(0xAFB1);
+INSERT INTO t1 VALUES(0xAFB2);
+INSERT INTO t1 VALUES(0xAFB3);
+INSERT INTO t1 VALUES(0xAFB4);
+INSERT INTO t1 VALUES(0xAFB5);
+INSERT INTO t1 VALUES(0xAFB6);
+INSERT INTO t1 VALUES(0xAFB7);
+INSERT INTO t1 VALUES(0xAFB8);
+INSERT INTO t1 VALUES(0xAFB9);
+INSERT INTO t1 VALUES(0xAFBA);
+INSERT INTO t1 VALUES(0xAFBB);
+INSERT INTO t1 VALUES(0xAFBC);
+INSERT INTO t1 VALUES(0xAFBD);
+INSERT INTO t1 VALUES(0xAFBE);
+INSERT INTO t1 VALUES(0xAFBF);
+INSERT INTO t1 VALUES(0xAFC0);
+INSERT INTO t1 VALUES(0xAFC1);
+INSERT INTO t1 VALUES(0xAFC2);
+INSERT INTO t1 VALUES(0xAFC3);
+INSERT INTO t1 VALUES(0xAFC4);
+INSERT INTO t1 VALUES(0xAFC5);
+INSERT INTO t1 VALUES(0xAFC6);
+INSERT INTO t1 VALUES(0xAFC7);
+INSERT INTO t1 VALUES(0xAFC8);
+INSERT INTO t1 VALUES(0xAFC9);
+INSERT INTO t1 VALUES(0xAFCA);
+INSERT INTO t1 VALUES(0xAFCB);
+INSERT INTO t1 VALUES(0xAFCC);
+INSERT INTO t1 VALUES(0xAFCD);
+INSERT INTO t1 VALUES(0xAFCE);
+INSERT INTO t1 VALUES(0xAFCF);
+INSERT INTO t1 VALUES(0xAFD0);
+INSERT INTO t1 VALUES(0xAFD1);
+INSERT INTO t1 VALUES(0xAFD2);
+INSERT INTO t1 VALUES(0xAFD3);
+INSERT INTO t1 VALUES(0xAFD4);
+INSERT INTO t1 VALUES(0xAFD5);
+INSERT INTO t1 VALUES(0xAFD6);
+INSERT INTO t1 VALUES(0xAFD7);
+INSERT INTO t1 VALUES(0xAFD8);
+INSERT INTO t1 VALUES(0xAFD9);
+INSERT INTO t1 VALUES(0xAFDA);
+INSERT INTO t1 VALUES(0xAFDB);
+INSERT INTO t1 VALUES(0xAFDC);
+INSERT INTO t1 VALUES(0xAFDD);
+INSERT INTO t1 VALUES(0xAFDE);
+INSERT INTO t1 VALUES(0xAFDF);
+INSERT INTO t1 VALUES(0xAFE0);
+INSERT INTO t1 VALUES(0xAFE1);
+INSERT INTO t1 VALUES(0xAFE2);
+INSERT INTO t1 VALUES(0xAFE3);
+INSERT INTO t1 VALUES(0xAFE4);
+INSERT INTO t1 VALUES(0xAFE5);
+INSERT INTO t1 VALUES(0xAFE6);
+INSERT INTO t1 VALUES(0xAFE7);
+INSERT INTO t1 VALUES(0xAFE8);
+INSERT INTO t1 VALUES(0xAFE9);
+INSERT INTO t1 VALUES(0xAFEA);
+INSERT INTO t1 VALUES(0xAFEB);
+INSERT INTO t1 VALUES(0xAFEC);
+INSERT INTO t1 VALUES(0xAFED);
+INSERT INTO t1 VALUES(0xAFEE);
+INSERT INTO t1 VALUES(0xAFEF);
+INSERT INTO t1 VALUES(0xAFF0);
+INSERT INTO t1 VALUES(0xAFF1);
+INSERT INTO t1 VALUES(0xAFF2);
+INSERT INTO t1 VALUES(0xAFF3);
+INSERT INTO t1 VALUES(0xAFF4);
+INSERT INTO t1 VALUES(0xAFF5);
+INSERT INTO t1 VALUES(0xAFF6);
+INSERT INTO t1 VALUES(0xAFF7);
+INSERT INTO t1 VALUES(0xAFF8);
+INSERT INTO t1 VALUES(0xAFF9);
+INSERT INTO t1 VALUES(0xAFFA);
+INSERT INTO t1 VALUES(0xAFFB);
+INSERT INTO t1 VALUES(0xAFFC);
+INSERT INTO t1 VALUES(0xAFFD);
+INSERT INTO t1 VALUES(0xAFFE);
+INSERT INTO t1 VALUES(0xCFD4);
+INSERT INTO t1 VALUES(0xCFD5);
+INSERT INTO t1 VALUES(0xCFD6);
+INSERT INTO t1 VALUES(0xCFD7);
+INSERT INTO t1 VALUES(0xCFD8);
+INSERT INTO t1 VALUES(0xCFD9);
+INSERT INTO t1 VALUES(0xCFDA);
+INSERT INTO t1 VALUES(0xCFDB);
+INSERT INTO t1 VALUES(0xCFDC);
+INSERT INTO t1 VALUES(0xCFDD);
+INSERT INTO t1 VALUES(0xCFDE);
+INSERT INTO t1 VALUES(0xCFDF);
+INSERT INTO t1 VALUES(0xCFE0);
+INSERT INTO t1 VALUES(0xCFE1);
+INSERT INTO t1 VALUES(0xCFE2);
+INSERT INTO t1 VALUES(0xCFE3);
+INSERT INTO t1 VALUES(0xCFE4);
+INSERT INTO t1 VALUES(0xCFE5);
+INSERT INTO t1 VALUES(0xCFE6);
+INSERT INTO t1 VALUES(0xCFE7);
+INSERT INTO t1 VALUES(0xCFE8);
+INSERT INTO t1 VALUES(0xCFE9);
+INSERT INTO t1 VALUES(0xCFEA);
+INSERT INTO t1 VALUES(0xCFEB);
+INSERT INTO t1 VALUES(0xCFEC);
+INSERT INTO t1 VALUES(0xCFED);
+INSERT INTO t1 VALUES(0xCFEE);
+INSERT INTO t1 VALUES(0xCFEF);
+INSERT INTO t1 VALUES(0xCFF0);
+INSERT INTO t1 VALUES(0xCFF1);
+INSERT INTO t1 VALUES(0xCFF2);
+INSERT INTO t1 VALUES(0xCFF3);
+INSERT INTO t1 VALUES(0xCFF4);
+INSERT INTO t1 VALUES(0xCFF5);
+INSERT INTO t1 VALUES(0xCFF6);
+INSERT INTO t1 VALUES(0xCFF7);
+INSERT INTO t1 VALUES(0xCFF8);
+INSERT INTO t1 VALUES(0xCFF9);
+INSERT INTO t1 VALUES(0xCFFA);
+INSERT INTO t1 VALUES(0xCFFB);
+INSERT INTO t1 VALUES(0xCFFC);
+INSERT INTO t1 VALUES(0xCFFD);
+INSERT INTO t1 VALUES(0xCFFE);
+INSERT INTO t1 VALUES(0xF4A7);
+INSERT INTO t1 VALUES(0xF4A8);
+INSERT INTO t1 VALUES(0xF4A9);
+INSERT INTO t1 VALUES(0xF4AA);
+INSERT INTO t1 VALUES(0xF4AB);
+INSERT INTO t1 VALUES(0xF4AC);
+INSERT INTO t1 VALUES(0xF4AD);
+INSERT INTO t1 VALUES(0xF4AE);
+INSERT INTO t1 VALUES(0xF4AF);
+INSERT INTO t1 VALUES(0xF4B0);
+INSERT INTO t1 VALUES(0xF4B1);
+INSERT INTO t1 VALUES(0xF4B2);
+INSERT INTO t1 VALUES(0xF4B3);
+INSERT INTO t1 VALUES(0xF4B4);
+INSERT INTO t1 VALUES(0xF4B5);
+INSERT INTO t1 VALUES(0xF4B6);
+INSERT INTO t1 VALUES(0xF4B7);
+INSERT INTO t1 VALUES(0xF4B8);
+INSERT INTO t1 VALUES(0xF4B9);
+INSERT INTO t1 VALUES(0xF4BA);
+INSERT INTO t1 VALUES(0xF4BB);
+INSERT INTO t1 VALUES(0xF4BC);
+INSERT INTO t1 VALUES(0xF4BD);
+INSERT INTO t1 VALUES(0xF4BE);
+INSERT INTO t1 VALUES(0xF4BF);
+INSERT INTO t1 VALUES(0xF4C0);
+INSERT INTO t1 VALUES(0xF4C1);
+INSERT INTO t1 VALUES(0xF4C2);
+INSERT INTO t1 VALUES(0xF4C3);
+INSERT INTO t1 VALUES(0xF4C4);
+INSERT INTO t1 VALUES(0xF4C5);
+INSERT INTO t1 VALUES(0xF4C6);
+INSERT INTO t1 VALUES(0xF4C7);
+INSERT INTO t1 VALUES(0xF4C8);
+INSERT INTO t1 VALUES(0xF4C9);
+INSERT INTO t1 VALUES(0xF4CA);
+INSERT INTO t1 VALUES(0xF4CB);
+INSERT INTO t1 VALUES(0xF4CC);
+INSERT INTO t1 VALUES(0xF4CD);
+INSERT INTO t1 VALUES(0xF4CE);
+INSERT INTO t1 VALUES(0xF4CF);
+INSERT INTO t1 VALUES(0xF4D0);
+INSERT INTO t1 VALUES(0xF4D1);
+INSERT INTO t1 VALUES(0xF4D2);
+INSERT INTO t1 VALUES(0xF4D3);
+INSERT INTO t1 VALUES(0xF4D4);
+INSERT INTO t1 VALUES(0xF4D5);
+INSERT INTO t1 VALUES(0xF4D6);
+INSERT INTO t1 VALUES(0xF4D7);
+INSERT INTO t1 VALUES(0xF4D8);
+INSERT INTO t1 VALUES(0xF4D9);
+INSERT INTO t1 VALUES(0xF4DA);
+INSERT INTO t1 VALUES(0xF4DB);
+INSERT INTO t1 VALUES(0xF4DC);
+INSERT INTO t1 VALUES(0xF4DD);
+INSERT INTO t1 VALUES(0xF4DE);
+INSERT INTO t1 VALUES(0xF4DF);
+INSERT INTO t1 VALUES(0xF4E0);
+INSERT INTO t1 VALUES(0xF4E1);
+INSERT INTO t1 VALUES(0xF4E2);
+INSERT INTO t1 VALUES(0xF4E3);
+INSERT INTO t1 VALUES(0xF4E4);
+INSERT INTO t1 VALUES(0xF4E5);
+INSERT INTO t1 VALUES(0xF4E6);
+INSERT INTO t1 VALUES(0xF4E7);
+INSERT INTO t1 VALUES(0xF4E8);
+INSERT INTO t1 VALUES(0xF4E9);
+INSERT INTO t1 VALUES(0xF4EA);
+INSERT INTO t1 VALUES(0xF4EB);
+INSERT INTO t1 VALUES(0xF4EC);
+INSERT INTO t1 VALUES(0xF4ED);
+INSERT INTO t1 VALUES(0xF4EE);
+INSERT INTO t1 VALUES(0xF4EF);
+INSERT INTO t1 VALUES(0xF4F0);
+INSERT INTO t1 VALUES(0xF4F1);
+INSERT INTO t1 VALUES(0xF4F2);
+INSERT INTO t1 VALUES(0xF4F3);
+INSERT INTO t1 VALUES(0xF4F4);
+INSERT INTO t1 VALUES(0xF4F5);
+INSERT INTO t1 VALUES(0xF4F6);
+INSERT INTO t1 VALUES(0xF4F7);
+INSERT INTO t1 VALUES(0xF4F8);
+INSERT INTO t1 VALUES(0xF4F9);
+INSERT INTO t1 VALUES(0xF4FA);
+INSERT INTO t1 VALUES(0xF4FB);
+INSERT INTO t1 VALUES(0xF4FC);
+INSERT INTO t1 VALUES(0xF4FD);
+INSERT INTO t1 VALUES(0xF4FE);
+SELECT HEX(c) FROM t1 ORDER BY BINARY c;
+HEX(c)
+A2AF
+A2B0
+A2B1
+A2B2
+A2B3
+A2B4
+A2B5
+A2B6
+A2B7
+A2B8
+A2B9
+A2C2
+A2C3
+A2C4
+A2C5
+A2C6
+A2C7
+A2C8
+A2C9
+A2D1
+A2D2
+A2D3
+A2D4
+A2D5
+A2D6
+A2D7
+A2D8
+A2D9
+A2DA
+A2DB
+A2EB
+A2EC
+A2ED
+A2EE
+A2EF
+A2F0
+A2F1
+A2FA
+A2FB
+A2FC
+A2FD
+A3A1
+A3A2
+A3A3
+A3A4
+A3A5
+A3A6
+A3A7
+A3A8
+A3A9
+A3AA
+A3AB
+A3AC
+A3AD
+A3AE
+A3AF
+A3BA
+A3BB
+A3BC
+A3BD
+A3BE
+A3BF
+A3C0
+A3DB
+A3DC
+A3DD
+A3DE
+A3DF
+A3E0
+A3FB
+A3FC
+A3FD
+A3FE
+A4F4
+A4F5
+A4F6
+A4F7
+A4F8
+A4F9
+A4FA
+A4FB
+A4FC
+A4FD
+A4FE
+A5F7
+A5F8
+A5F9
+A5FA
+A5FB
+A5FC
+A5FD
+A5FE
+A6B9
+A6BA
+A6BB
+A6BC
+A6BD
+A6BE
+A6BF
+A6C0
+A6D9
+A6DA
+A6DB
+A6DC
+A6DD
+A6DE
+A6DF
+A6E0
+A6E1
+A6E2
+A6E3
+A6E4
+A6E5
+A6E6
+A6E7
+A6E8
+A6E9
+A6EA
+A6EB
+A6EC
+A6ED
+A6EE
+A6EF
+A6F0
+A6F1
+A6F2
+A6F3
+A6F4
+A6F5
+A6F6
+A6F7
+A6F8
+A6F9
+A6FA
+A6FB
+A6FC
+A6FD
+A6FE
+A7C2
+A7C3
+A7C4
+A7C5
+A7C6
+A7C7
+A7C8
+A7C9
+A7CA
+A7CB
+A7CC
+A7CD
+A7CE
+A7CF
+A7D0
+A7F2
+A7F3
+A7F4
+A7F5
+A7F6
+A7F7
+A7F8
+A7F9
+A7FA
+A7FB
+A7FC
+A7FD
+A7FE
+A8C1
+A8C2
+A8C3
+A8C4
+A8C5
+A8C6
+A8C7
+A8C8
+A8C9
+A8CA
+A8CB
+A8CC
+A8CD
+A8CE
+A8CF
+A8D0
+A8D1
+A8D2
+A8D3
+A8D4
+A8D5
+A8D6
+A8D7
+A8D8
+A8D9
+A8DA
+A8DB
+A8DC
+A8DD
+A8DE
+A8DF
+A8E0
+A8E1
+A8E2
+A8E3
+A8E4
+A8E5
+A8E6
+A8E7
+A8E8
+A8E9
+A8EA
+A8EB
+A8EC
+A8ED
+A8EE
+A8EF
+A8F0
+A8F1
+A8F2
+A8F3
+A8F4
+A8F5
+A8F6
+A8F7
+A8F8
+A8F9
+A8FA
+A8FB
+A8FC
+A8FD
+A8FE
+A9A1
+A9A2
+A9A3
+A9A4
+A9A5
+A9A6
+A9A7
+A9A8
+A9A9
+A9AA
+A9AB
+A9AC
+A9AD
+A9AE
+A9AF
+A9B0
+A9B1
+A9B2
+A9B3
+A9B4
+A9B5
+A9B6
+A9B7
+A9B8
+A9B9
+A9BA
+A9BB
+A9BC
+A9BD
+A9BE
+A9BF
+A9C0
+A9C1
+A9C2
+A9C3
+A9C4
+A9C5
+A9C6
+A9C7
+A9C8
+A9C9
+A9CA
+A9CB
+A9CC
+A9CD
+A9CE
+A9CF
+A9D0
+A9D1
+A9D2
+A9D3
+A9D4
+A9D5
+A9D6
+A9D7
+A9D8
+A9D9
+A9DA
+A9DB
+A9DC
+A9DD
+A9DE
+A9DF
+A9E0
+A9E1
+A9E2
+A9E3
+A9E4
+A9E5
+A9E6
+A9E7
+A9E8
+A9E9
+A9EA
+A9EB
+A9EC
+A9ED
+A9EE
+A9EF
+A9F0
+A9F1
+A9F2
+A9F3
+A9F4
+A9F5
+A9F6
+A9F7
+A9F8
+A9F9
+A9FA
+A9FB
+A9FC
+A9FD
+A9FE
+AAA1
+AAA2
+AAA3
+AAA4
+AAA5
+AAA6
+AAA7
+AAA8
+AAA9
+AAAA
+AAAB
+AAAC
+AAAD
+AAAE
+AAAF
+AAB0
+AAB1
+AAB2
+AAB3
+AAB4
+AAB5
+AAB6
+AAB7
+AAB8
+AAB9
+AABA
+AABB
+AABC
+AABD
+AABE
+AABF
+AAC0
+AAC1
+AAC2
+AAC3
+AAC4
+AAC5
+AAC6
+AAC7
+AAC8
+AAC9
+AACA
+AACB
+AACC
+AACD
+AACE
+AACF
+AAD0
+AAD1
+AAD2
+AAD3
+AAD4
+AAD5
+AAD6
+AAD7
+AAD8
+AAD9
+AADA
+AADB
+AADC
+AADD
+AADE
+AADF
+AAE0
+AAE1
+AAE2
+AAE3
+AAE4
+AAE5
+AAE6
+AAE7
+AAE8
+AAE9
+AAEA
+AAEB
+AAEC
+AAED
+AAEE
+AAEF
+AAF0
+AAF1
+AAF2
+AAF3
+AAF4
+AAF5
+AAF6
+AAF7
+AAF8
+AAF9
+AAFA
+AAFB
+AAFC
+AAFD
+AAFE
+ABA1
+ABA2
+ABA3
+ABA4
+ABA5
+ABA6
+ABA7
+ABA8
+ABA9
+ABAA
+ABAB
+ABAC
+ABAD
+ABAE
+ABAF
+ABB0
+ABB1
+ABB2
+ABB3
+ABB4
+ABB5
+ABB6
+ABB7
+ABB8
+ABB9
+ABBA
+ABBB
+ABBC
+ABBD
+ABBE
+ABBF
+ABC0
+ABC1
+ABC2
+ABC3
+ABC4
+ABC5
+ABC6
+ABC7
+ABC8
+ABC9
+ABCA
+ABCB
+ABCC
+ABCD
+ABCE
+ABCF
+ABD0
+ABD1
+ABD2
+ABD3
+ABD4
+ABD5
+ABD6
+ABD7
+ABD8
+ABD9
+ABDA
+ABDB
+ABDC
+ABDD
+ABDE
+ABDF
+ABE0
+ABE1
+ABE2
+ABE3
+ABE4
+ABE5
+ABE6
+ABE7
+ABE8
+ABE9
+ABEA
+ABEB
+ABEC
+ABED
+ABEE
+ABEF
+ABF0
+ABF1
+ABF2
+ABF3
+ABF4
+ABF5
+ABF6
+ABF7
+ABF8
+ABF9
+ABFA
+ABFB
+ABFC
+ABFD
+ABFE
+ACA1
+ACA2
+ACA3
+ACA4
+ACA5
+ACA6
+ACA7
+ACA8
+ACA9
+ACAA
+ACAB
+ACAC
+ACAD
+ACAE
+ACAF
+ACB0
+ACB1
+ACB2
+ACB3
+ACB4
+ACB5
+ACB6
+ACB7
+ACB8
+ACB9
+ACBA
+ACBB
+ACBC
+ACBD
+ACBE
+ACBF
+ACC0
+ACC1
+ACC2
+ACC3
+ACC4
+ACC5
+ACC6
+ACC7
+ACC8
+ACC9
+ACCA
+ACCB
+ACCC
+ACCD
+ACCE
+ACCF
+ACD0
+ACD1
+ACD2
+ACD3
+ACD4
+ACD5
+ACD6
+ACD7
+ACD8
+ACD9
+ACDA
+ACDB
+ACDC
+ACDD
+ACDE
+ACDF
+ACE0
+ACE1
+ACE2
+ACE3
+ACE4
+ACE5
+ACE6
+ACE7
+ACE8
+ACE9
+ACEA
+ACEB
+ACEC
+ACED
+ACEE
+ACEF
+ACF0
+ACF1
+ACF2
+ACF3
+ACF4
+ACF5
+ACF6
+ACF7
+ACF8
+ACF9
+ACFA
+ACFB
+ACFC
+ACFD
+ACFE
+ADA1
+ADA2
+ADA3
+ADA4
+ADA5
+ADA6
+ADA7
+ADA8
+ADA9
+ADAA
+ADAB
+ADAC
+ADAD
+ADAE
+ADAF
+ADB0
+ADB1
+ADB2
+ADB3
+ADB4
+ADB5
+ADB6
+ADB7
+ADB8
+ADB9
+ADBA
+ADBB
+ADBC
+ADBD
+ADBE
+ADBF
+ADC0
+ADC1
+ADC2
+ADC3
+ADC4
+ADC5
+ADC6
+ADC7
+ADC8
+ADC9
+ADCA
+ADCB
+ADCC
+ADCD
+ADCE
+ADCF
+ADD0
+ADD1
+ADD2
+ADD3
+ADD4
+ADD5
+ADD6
+ADD7
+ADD8
+ADD9
+ADDA
+ADDB
+ADDC
+ADDD
+ADDE
+ADDF
+ADE0
+ADE1
+ADE2
+ADE3
+ADE4
+ADE5
+ADE6
+ADE7
+ADE8
+ADE9
+ADEA
+ADEB
+ADEC
+ADED
+ADEE
+ADEF
+ADF0
+ADF1
+ADF2
+ADF3
+ADF4
+ADF5
+ADF6
+ADF7
+ADF8
+ADF9
+ADFA
+ADFB
+ADFC
+ADFD
+ADFE
+AEA1
+AEA2
+AEA3
+AEA4
+AEA5
+AEA6
+AEA7
+AEA8
+AEA9
+AEAA
+AEAB
+AEAC
+AEAD
+AEAE
+AEAF
+AEB0
+AEB1
+AEB2
+AEB3
+AEB4
+AEB5
+AEB6
+AEB7
+AEB8
+AEB9
+AEBA
+AEBB
+AEBC
+AEBD
+AEBE
+AEBF
+AEC0
+AEC1
+AEC2
+AEC3
+AEC4
+AEC5
+AEC6
+AEC7
+AEC8
+AEC9
+AECA
+AECB
+AECC
+AECD
+AECE
+AECF
+AED0
+AED1
+AED2
+AED3
+AED4
+AED5
+AED6
+AED7
+AED8
+AED9
+AEDA
+AEDB
+AEDC
+AEDD
+AEDE
+AEDF
+AEE0
+AEE1
+AEE2
+AEE3
+AEE4
+AEE5
+AEE6
+AEE7
+AEE8
+AEE9
+AEEA
+AEEB
+AEEC
+AEED
+AEEE
+AEEF
+AEF0
+AEF1
+AEF2
+AEF3
+AEF4
+AEF5
+AEF6
+AEF7
+AEF8
+AEF9
+AEFA
+AEFB
+AEFC
+AEFD
+AEFE
+AFA1
+AFA2
+AFA3
+AFA4
+AFA5
+AFA6
+AFA7
+AFA8
+AFA9
+AFAA
+AFAB
+AFAC
+AFAD
+AFAE
+AFAF
+AFB0
+AFB1
+AFB2
+AFB3
+AFB4
+AFB5
+AFB6
+AFB7
+AFB8
+AFB9
+AFBA
+AFBB
+AFBC
+AFBD
+AFBE
+AFBF
+AFC0
+AFC1
+AFC2
+AFC3
+AFC4
+AFC5
+AFC6
+AFC7
+AFC8
+AFC9
+AFCA
+AFCB
+AFCC
+AFCD
+AFCE
+AFCF
+AFD0
+AFD1
+AFD2
+AFD3
+AFD4
+AFD5
+AFD6
+AFD7
+AFD8
+AFD9
+AFDA
+AFDB
+AFDC
+AFDD
+AFDE
+AFDF
+AFE0
+AFE1
+AFE2
+AFE3
+AFE4
+AFE5
+AFE6
+AFE7
+AFE8
+AFE9
+AFEA
+AFEB
+AFEC
+AFED
+AFEE
+AFEF
+AFF0
+AFF1
+AFF2
+AFF3
+AFF4
+AFF5
+AFF6
+AFF7
+AFF8
+AFF9
+AFFA
+AFFB
+AFFC
+AFFD
+AFFE
+CFD4
+CFD5
+CFD6
+CFD7
+CFD8
+CFD9
+CFDA
+CFDB
+CFDC
+CFDD
+CFDE
+CFDF
+CFE0
+CFE1
+CFE2
+CFE3
+CFE4
+CFE5
+CFE6
+CFE7
+CFE8
+CFE9
+CFEA
+CFEB
+CFEC
+CFED
+CFEE
+CFEF
+CFF0
+CFF1
+CFF2
+CFF3
+CFF4
+CFF5
+CFF6
+CFF7
+CFF8
+CFF9
+CFFA
+CFFB
+CFFC
+CFFD
+CFFE
+F4A7
+F4A8
+F4A9
+F4AA
+F4AB
+F4AC
+F4AD
+F4AE
+F4AF
+F4B0
+F4B1
+F4B2
+F4B3
+F4B4
+F4B5
+F4B6
+F4B7
+F4B8
+F4B9
+F4BA
+F4BB
+F4BC
+F4BD
+F4BE
+F4BF
+F4C0
+F4C1
+F4C2
+F4C3
+F4C4
+F4C5
+F4C6
+F4C7
+F4C8
+F4C9
+F4CA
+F4CB
+F4CC
+F4CD
+F4CE
+F4CF
+F4D0
+F4D1
+F4D2
+F4D3
+F4D4
+F4D5
+F4D6
+F4D7
+F4D8
+F4D9
+F4DA
+F4DB
+F4DC
+F4DD
+F4DE
+F4DF
+F4E0
+F4E1
+F4E2
+F4E3
+F4E4
+F4E5
+F4E6
+F4E7
+F4E8
+F4E9
+F4EA
+F4EB
+F4EC
+F4ED
+F4EE
+F4EF
+F4F0
+F4F1
+F4F2
+F4F3
+F4F4
+F4F5
+F4F6
+F4F7
+F4F8
+F4F9
+F4FA
+F4FB
+F4FC
+F4FD
+F4FE
+DROP TABLE t1;
diff --git a/mysql-test/r/flush_block_commit.result b/mysql-test/r/flush_block_commit.result
index 4a7575d8f7a..2e9f1920937 100644
--- a/mysql-test/r/flush_block_commit.result
+++ b/mysql-test/r/flush_block_commit.result
@@ -28,4 +28,12 @@ commit;
unlock tables;
flush tables with read lock;
unlock tables;
+begin;
+select * from t1;
+a
+1
+10
+show create database test;
+Database Create Database
+test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */
drop table t1;
diff --git a/mysql-test/r/func_concat.result b/mysql-test/r/func_concat.result
index ec53d6d87b0..419413e4156 100644
--- a/mysql-test/r/func_concat.result
+++ b/mysql-test/r/func_concat.result
@@ -32,3 +32,39 @@ select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051';
a b c d
AAAA 105 2003-03-01 1
drop table t1;
+select 'a' union select concat('a', -4);
+a
+a
+a-4
+select 'a' union select concat('a', -4.5);
+a
+a
+a-4.5
+select 'a' union select concat('a', -(4 + 1));
+a
+a
+a-5
+select 'a' union select concat('a', 4 - 5);
+a
+a
+a-1
+select 'a' union select concat('a', -'3');
+a
+a
+a-3
+select 'a' union select concat('a', -concat('3',4));
+a
+a
+a-34
+select 'a' union select concat('a', -0);
+a
+a
+a0
+select 'a' union select concat('a', -0.0);
+a
+a
+a-0.0
+select 'a' union select concat('a', -0.0000);
+a
+a
+a-0.0000
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 6a206d1c7d9..ff0529472da 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -685,3 +685,9 @@ drop table t1;
select left(1234, 3) + 0;
left(1234, 3) + 0
123
+create table t1 (a int not null primary key, b varchar(40), c datetime);
+insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14');
+select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12;
+total reg
+10 2004-12-10
+drop table t1;
diff --git a/mysql-test/r/func_test.result.es b/mysql-test/r/func_test.result.es
deleted file mode 100644
index 380f96835d0..00000000000
--- a/mysql-test/r/func_test.result.es
+++ /dev/null
@@ -1,185 +0,0 @@
-drop table if exists t1,t2;
-select 0=0,1>0,1>=1,1<0,1<=0,1!=0,strcmp("abc","abcd"),strcmp("b","a"),strcmp("a","a") ;
-0=0 1>0 1>=1 1<0 1<=0 1!=0 strcmp("abc","abcd") strcmp("b","a") strcmp("a","a")
-1 1 1 0 0 1 -1 1 0
-select "a"<"b","a"<="b","b">="a","b">"a","a"="A","a"<>"b";
-"a"<"b" "a"<="b" "b">="a" "b">"a" "a"="A" "a"<>"b"
-1 1 1 1 1 1
-select "a "="A", "A "="a", "a " <= "A b";
-"a "="A" "A "="a" "a " <= "A b"
-1 1 1
-select "abc" like "a%", "abc" not like "%d%", "a%" like "a\%","abc%" like "a%\%","abcd" like "a%b_%d", "a" like "%%a","abcde" like "a%_e","abc" like "abc%";
-"abc" like "a%" "abc" not like "%d%" "a%" like "a\%" "abc%" like "a%\%" "abcd" like "a%b_%d" "a" like "%%a" "abcde" like "a%_e" "abc" like "abc%"
-1 1 1 1 1 1 1 1
-select "a" like "%%b","a" like "%%ab","ab" like "a\%", "ab" like "_", "ab" like "ab_", "abc" like "%_d", "abc" like "abc%d";
-"a" like "%%b" "a" like "%%ab" "ab" like "a\%" "ab" like "_" "ab" like "ab_" "abc" like "%_d" "abc" like "abc%d"
-0 0 0 0 0 0 0
-select '?' like '|%', '?' like '|%' ESCAPE '|', '%' like '|%', '%' like '|%' ESCAPE '|', '%' like '%';
-'?' like '|%' '?' like '|%' ESCAPE '|' '%' like '|%' '%' like '|%' ESCAPE '|' '%' like '%'
-0 0 0 1 1
-select 'abc' like '%c','abcabc' like '%c', "ab" like "", "ab" like "a", "ab" like "ab";
-'abc' like '%c' 'abcabc' like '%c' "ab" like "" "ab" like "a" "ab" like "ab"
-1 1 0 0 1
-select "Det här är svenska" regexp "h[[:alpha:]]+r", "aba" regexp "^(a|b)*$";
-"Det här är svenska" regexp "h[[:alpha:]]+r" "aba" regexp "^(a|b)*$"
-1 1
-select "aba" regexp concat("^","a");
-"aba" regexp concat("^","a")
-1
-select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0;
-!0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 or 1=1 and 1=0
-1 1 0 1 0 1 1 1
-select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between "max" and "my" and 3=3;
-2 between 1 and 3 "monty" between "max" and "my" 2=2 and "monty" between "max" and "my" and 3=3
-1 1 1
-select 'b' between 'a' and 'c', 'B' between 'a' and 'c';
-'b' between 'a' and 'c' 'B' between 'a' and 'c'
-1 1
-select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0);
-2 in (3,2,5,9,5,1) "monty" in ("david","monty","allan") 1.2 in (1.4,1.2,1.0)
-1 1 1
-select -1.49 or -1.49,0.6 or 0.6;
--1.49 or -1.49 0.6 or 0.6
-1 1
-select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
-3 ^ 11 1 ^ 1 1 ^ 0 1 ^ NULL NULL ^ 1
-8 0 1 NULL NULL
-explain extended select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
-Warnings:
-Note 1003 select (3 ^ 11) AS `3 ^ 11`,(1 ^ 1) AS `1 ^ 1`,(1 ^ 0) AS `1 ^ 0`,(1 ^ NULL) AS `1 ^ NULL`,(NULL ^ 1) AS `NULL ^ 1`
-select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
-1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL
-0 1 1 0 NULL NULL NULL
-select 1 like 2 xor 2 like 1;
-1 like 2 xor 2 like 1
-0
-select 10 % 7, 10 mod 7, 10 div 3;
-10 % 7 10 mod 7 10 div 3
-3 3 3
-explain extended select 10 % 7, 10 mod 7, 10 div 3;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
-Warnings:
-Note 1003 select (10 % 7) AS `10 % 7`,(10 % 7) AS `10 mod 7`,(10 DIV 3) AS `10 div 3`
-select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2;
-(1 << 64)-1 ((1 << 64)-1) DIV 1 ((1 << 64)-1) DIV 2
-18446744073709551615 18446744073709551615 9223372036854775807
-explain extended select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
-Warnings:
-Note 1003 select ((1 << 64) - 1) AS `(1 << 64)-1`,(((1 << 64) - 1) DIV 1) AS `((1 << 64)-1) DIV 1`,(((1 << 64) - 1) DIV 2) AS `((1 << 64)-1) DIV 2`
-create table t1 (a int);
-insert t1 values (1);
-select * from t1 where 1 xor 1;
-a
-explain extended select * from t1 where 1 xor 1;
-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
-Warnings:
-Note 1003 select test.t1.a AS `a` from test.t1 where (1 xor 1)
-select - a from t1;
-- a
--1
-explain extended select - a from t1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 system NULL NULL NULL NULL 1
-Warnings:
-Note 1003 select -(test.t1.a) AS `- a` from test.t1
-drop table t1;
-select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
-5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
-0 1
-select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1;
-1 and 2 between 2 and 10 2 between 2 and 10 and 1
-1 1
-select 1 and 0 or 2, 2 or 1 and 0;
-1 and 0 or 2 2 or 1 and 0
-1 1
-select _koi8r'a' = _koi8r'A';
-_koi8r'a' = _koi8r'A'
-1
-select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci;
-_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci
-1
-explain extended select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
-Warnings:
-Note 1003 select (_koi8r'a' = (_koi8r'A' collate _latin1'koi8r_general_ci')) AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci`
-select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin;
-_koi8r'a' = _koi8r'A' COLLATE koi8r_bin
-0
-select _koi8r'a' COLLATE koi8r_general_ci = _koi8r'A';
-_koi8r'a' COLLATE koi8r_general_ci = _koi8r'A'
-1
-select _koi8r'a' COLLATE koi8r_bin = _koi8r'A';
-_koi8r'a' COLLATE koi8r_bin = _koi8r'A'
-0
-select _koi8r'a' COLLATE koi8r_bin = _koi8r'A' COLLATE koi8r_general_ci;
-ERROR HY000: Illegal mix of collations (koi8r_bin,EXPLICIT) and (koi8r_general_ci,EXPLICIT) for operation '='
-select _koi8r'a' = _latin1'A';
-ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '='
-select strcmp(_koi8r'a', _koi8r'A');
-strcmp(_koi8r'a', _koi8r'A')
-0
-select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci);
-strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci)
-0
-select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin);
-strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin)
-1
-select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A');
-strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A')
-0
-select strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A');
-strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A')
-1
-select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A' COLLATE koi8r_bin);
-ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'strcmp'
-select strcmp(_koi8r'a', _latin1'A');
-ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'strcmp'
-select _koi8r'a' LIKE _koi8r'A';
-_koi8r'a' LIKE _koi8r'A'
-1
-select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci;
-_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci
-1
-select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin;
-_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin
-0
-select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A';
-_koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A'
-1
-select _koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A';
-_koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A'
-0
-select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin;
-ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'like'
-select _koi8r'a' LIKE _latin1'A';
-ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'like'
-CREATE TABLE t1 ( faq_group_id int(11) NOT NULL default '0', faq_id int(11) NOT NULL default '0', title varchar(240) default NULL, keywords text, description longblob, solution longblob, status tinyint(4) NOT NULL default '0', access_id smallint(6) default NULL, lang_id smallint(6) NOT NULL default '0', created datetime NOT NULL default '0000-00-00 00:00:00', updated datetime default NULL, last_access datetime default NULL, last_notify datetime default NULL, solved_count int(11) NOT NULL default '0', static_solved int(11) default NULL, solved_1 int(11) default NULL, solved_2 int(11) default NULL, solved_3 int(11) default NULL, solved_4 int(11) default NULL, solved_5 int(11) default NULL, expires datetime default NULL, notes text, assigned_to smallint(6) default NULL, assigned_group smallint(6) default NULL, last_edited_by smallint(6) default NULL, orig_ref_no varchar(15) binary default NULL, c$fundstate smallint(6) default NULL, c$contributor smallint(6) default NULL, UNIQUE KEY t1$faq_id (faq_id), KEY t1$group_id$faq_id (faq_group_id,faq_id), KEY t1$c$fundstate (c$fundstate) ) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (82,82,'How to use the DynaVox Usage Counts Feature','usages count, number, corner, white, box, button','<as-html>\r\n<table width=\"100%\" border=\"0\">\r\n <tr>\r\n <td width=\"3%\"> </td>\r\n <td width=\"97%\">\r\n <h3><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#000000\">How \r\n To</font><!-- #BeginEditable \"CS_troubleshoot_question\" --><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#000099\"><font color=\"#000000\">: \r\n Display or Hide the Usage Counts to find out how many times each button is being selected. </font></font><!-- #EndEditable --></h3>\r\n </td>\r\n </tr>\r\n</table>','<as-html>\r\n <table width=\"100%\" border=\"0\">\r\n <tr>\r\n <td width=\"3%\"> </td>\r\n \r\n<td width=\"97%\"><!-- #BeginEditable \"CS_troubleshoot_answer\" --> \r\n \r\n<p><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\">1. Select \r\n the <i>On/Setup</i> button to access the DynaVox Setup Menu.<br>\r\n 2. Select <b>Button Features.</b><br>\r\n 3. Below the <b>OK</b> button is the <b>Usage Counts</b> button.<br>\r\n a. If it says \"Hidden\" then the Usage Counts will not be displayed.<br>\r\n b. If it says \"Displayed\" then the Usage Counts will be shown.<br>\r\n c. Select the <b>Usage Counts</b> Option Ring once and it will toggle \r\n to the alternative option.<br>\r\n 4. Once the correct setting has been chosen, select <b>OK</b> to leave the <i>Button \r\n Features</i> menu.<br>\r\n 5. Select <b>OK</b> out of the <i>Setup</i> menu and return to the communication \r\n page.</font></p>\r\n <p><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\">For \r\n further information on <i>Usage Counts,</i> see the <i>Button Features \r\n Menu Entry</i> in the DynaVox/DynaMyte Reference Manual.</font></p>\r\n<!-- #EndEditable --></td>\r\n </tr>\r\n</table>',4,1,1,'2001-11-16 16:43:34','2002-11-25 12:09:43','2003-07-24 01:04:48',NULL,11,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,11,NULL,NULL,NULL);
-CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20) binary default NULL, rank smallint(6) NOT NULL default '0', KEY t2$access_id (access_id) ) ENGINE=MyISAM;
-INSERT INTO t2 VALUES (1,'Everyone',2),(2,'Help',3),(3,'Customer Support',1);
-SELECT f_acc.rank, a1.rank, a2.rank FROM t1 LEFT JOIN t1 f1 ON (f1.access_id=1 AND f1.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a1 ON (a1.access_id = f1.access_id) LEFT JOIN t1 f2 ON (f2.access_id=3 AND f2.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a2 ON (a2.access_id = f2.access_id), t2 f_acc WHERE LEAST(a1.rank,a2.rank) = f_acc.rank;
-rank rank rank
-2 2 NULL
-DROP TABLE t1,t2;
-CREATE TABLE t1 (d varchar(6), k int);
-INSERT INTO t1 VALUES (NULL, 2);
-SELECT GREATEST(d,d) FROM t1 WHERE k=2;
-GREATEST(d,d)
-NULL
-DROP TABLE t1;
-select 1197.90 mod 50;
-1197.90 mod 50
-47.90
-select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3;
-5.1 mod 3 5.1 mod -3 -5.1 mod 3 -5.1 mod -3
-2.1 2.1 -2.1 -2.1
-select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3;
-5 mod 3 5 mod -3 -5 mod 3 -5 mod -3
-2 2 -2 -2
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result
index 175fb50786e..efd3b0f8e15 100644
--- a/mysql-test/r/gis-rtree.result
+++ b/mysql-test/r/gis-rtree.result
@@ -757,3 +757,50 @@ SPATIAL KEY(g)
) ENGINE=MyISAM;
INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)'));
drop table t1;
+CREATE TABLE t1 (
+geoobjid INT NOT NULL,
+line LINESTRING NOT NULL,
+kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
+name VARCHAR(32),
+SPATIAL KEY (line)
+) engine=myisam;
+ALTER TABLE t1 DISABLE KEYS;
+INSERT INTO t1 (name, kind, line) VALUES
+("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
+("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")),
+("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")),
+("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")),
+("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")),
+("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")),
+("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")),
+("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")),
+("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")),
+("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")),
+("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")),
+("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")),
+("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")),
+("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")),
+("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")),
+("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")),
+("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")),
+("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")),
+("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")),
+("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")),
+("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")),
+("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")),
+("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")),
+("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
+("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")),
+("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")),
+("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")),
+("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")),
+("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)"));
+ALTER TABLE t1 ENABLE KEYS;
+INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)'));
+drop table t1;
+CREATE TABLE t1 (st varchar(100));
+INSERT INTO t1 VALUES ("Fake string");
+CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
+INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
+ERROR HY000: Unknown error
+drop table t1, t2;
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 629a3221330..9ff48974ed4 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -344,6 +344,72 @@ select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
Host Db User Table_name Column_name Column_priv
drop user grant_user@localhost;
drop table t1;
+create database mysqltest_1;
+create database mysqltest_2;
+create table mysqltest_1.t1 select 1 a, 2 q;
+create table mysqltest_1.t2 select 1 b, 2 r;
+create table mysqltest_2.t1 select 1 c, 2 s;
+create table mysqltest_2.t2 select 1 d, 2 t;
+grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost;
+grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost;
+grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost;
+grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost;
+show grants for mysqltest_3@localhost;
+Grants for mysqltest_3@localhost
+GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost'
+GRANT SELECT (b) ON `mysqltest_1`.`t2` TO 'mysqltest_3'@'localhost'
+GRANT UPDATE (a) ON `mysqltest_1`.`t1` TO 'mysqltest_3'@'localhost'
+GRANT UPDATE (d) ON `mysqltest_2`.`t2` TO 'mysqltest_3'@'localhost'
+GRANT SELECT (c) ON `mysqltest_2`.`t1` TO 'mysqltest_3'@'localhost'
+update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1;
+ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'q' in table 't1'
+update mysqltest_1.t2, mysqltest_2.t2 set d=20 where d=1;
+ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'd' in table 't2'
+update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1;
+ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for table 't1'
+update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1;
+ERROR 42000: update command denied to user 'mysqltest_3'@'localhost' for table 't1'
+update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2;
+ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 's' in table 't1'
+update mysqltest_1.t1, mysqltest_2.t2 set a=10,d=10;
+update mysqltest_1.t1, mysqltest_2.t1 set a=20 where c=20;
+select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2;
+a q b r
+10 2 1 2
+select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2;
+c s d t
+1 2 10 2
+revoke all on mysqltest_1.t1 from mysqltest_3@localhost;
+revoke all on mysqltest_1.t2 from mysqltest_3@localhost;
+revoke all on mysqltest_2.t1 from mysqltest_3@localhost;
+revoke all on mysqltest_2.t2 from mysqltest_3@localhost;
+grant all on mysqltest_2.* to mysqltest_3@localhost;
+grant select on *.* to mysqltest_3@localhost;
+flush privileges;
+use mysqltest_1;
+update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600;
+update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200;
+ERROR 42000: update command denied to user 'mysqltest_3'@'localhost' for table 't1'
+use mysqltest_2;
+update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200;
+ERROR 42000: update command denied to user 'mysqltest_3'@'localhost' for table 't1'
+update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200;
+ERROR 42000: update command denied to user 'mysqltest_3'@'localhost' for table 't2'
+update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200;
+ERROR 42000: update command denied to user 'mysqltest_3'@'localhost' for table 't1'
+select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2;
+a q b r
+10 2 1 2
+select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2;
+c s d t
+500 2 600 2
+delete from mysql.user where user='mysqltest_3';
+delete from mysql.db where user="mysqltest_3";
+delete from mysql.tables_priv where user="mysqltest_3";
+delete from mysql.columns_priv where user="mysqltest_3";
+flush privileges;
+drop database mysqltest_1;
+drop database mysqltest_2;
SHOW PRIVILEGES;
Privilege Context Comment
Alter Tables To alter the table
diff --git a/mysql-test/r/grant_cache.result b/mysql-test/r/grant_cache.result
index 892f1d940a6..0c59ed1584c 100644
--- a/mysql-test/r/grant_cache.result
+++ b/mysql-test/r/grant_cache.result
@@ -59,7 +59,7 @@ Variable_name Value
Qcache_hits 0
show status like "Qcache_not_cached";
Variable_name Value
-Qcache_not_cached 0
+Qcache_not_cached 5
select "user1";
user1
user1
@@ -71,7 +71,7 @@ Variable_name Value
Qcache_hits 0
show status like "Qcache_not_cached";
Variable_name Value
-Qcache_not_cached 1
+Qcache_not_cached 9
select * from t1;
a b c
1 1 1
@@ -84,7 +84,7 @@ Variable_name Value
Qcache_hits 1
show status like "Qcache_not_cached";
Variable_name Value
-Qcache_not_cached 1
+Qcache_not_cached 12
select a from t1 ;
a
1
@@ -97,7 +97,7 @@ Variable_name Value
Qcache_hits 2
show status like "Qcache_not_cached";
Variable_name Value
-Qcache_not_cached 1
+Qcache_not_cached 15
select c from t1;
c
1
@@ -110,7 +110,7 @@ Variable_name Value
Qcache_hits 3
show status like "Qcache_not_cached";
Variable_name Value
-Qcache_not_cached 1
+Qcache_not_cached 18
show grants for current_user();
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
@@ -143,7 +143,7 @@ Variable_name Value
Qcache_hits 7
show status like "Qcache_not_cached";
Variable_name Value
-Qcache_not_cached 2
+Qcache_not_cached 22
select "user3";
user3
user3
@@ -167,7 +167,7 @@ Variable_name Value
Qcache_hits 7
show status like "Qcache_not_cached";
Variable_name Value
-Qcache_not_cached 7
+Qcache_not_cached 30
select "user4";
user4
user4
@@ -197,7 +197,7 @@ Variable_name Value
Qcache_hits 8
show status like "Qcache_not_cached";
Variable_name Value
-Qcache_not_cached 8
+Qcache_not_cached 34
set names binary;
delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 70fd1a9ad31..18e4cb7a434 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -638,3 +638,15 @@ alias
1,2
1
drop table t1;
+create table t1 (a int);
+insert into t1 values(null);
+select min(a) is null from t1;
+min(a) is null
+1
+select min(a) is null or null from t1;
+min(a) is null or null
+1
+select 1 and min(a) is null from t1;
+1 and min(a) is null
+1
+drop table t1;
diff --git a/mysql-test/r/have_exampledb.require b/mysql-test/r/have_exampledb.require
index 4b0938660fe..29d0cf8b1a6 100644
--- a/mysql-test/r/have_exampledb.require
+++ b/mysql-test/r/have_exampledb.require
@@ -1,2 +1,2 @@
Variable_name Value
-have_exampledb YES
+have_example_engine YES
diff --git a/mysql-test/r/index_merge.result b/mysql-test/r/index_merge.result
index 4ccec5ef0d8..07e87832c0b 100644
--- a/mysql-test/r/index_merge.result
+++ b/mysql-test/r/index_merge.result
@@ -342,7 +342,7 @@ set @save_join_buffer_size=@@join_buffer_size;
set join_buffer_size= 4000;
show variables like 'join_buffer_size';
Variable_name Value
-join_buffer_size 8228
+join_buffer_size 8200
explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
where (A.key1 < 500000 or A.key2 < 3)
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 037588afda8..cfa26052fb5 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -1,3 +1,6 @@
+show variables variable_name where variable_name like "skip_show_database";
+variable_name
+skip_show_database
grant all privileges on test.* to mysqltest_1@localhost;
select * from information_schema.SCHEMATA where schema_name > 'm';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME SQL_PATH
@@ -321,11 +324,11 @@ show keys from v4;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
select * from information_schema.views where TABLE_NAME like "v%";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE
-NULL test v0 select `schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO
-NULL test v1 select `tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`tables`.`TABLE_NAME` = _utf8'v1') NONE NO
-NULL test v2 select `columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`columns`.`TABLE_NAME` = _utf8'v2') NONE NO
-NULL test v3 select `character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`character_sets`.`CHARACTER_SET_NAME` like _utf8'latin1%') NONE NO
-NULL test v4 select `collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`collations`.`COLLATION_NAME` like _utf8'latin1%') NONE NO
+NULL test v0 select sql_no_cache `schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO
+NULL test v1 select sql_no_cache `tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`tables`.`TABLE_NAME` = _utf8'v1') NONE NO
+NULL test v2 select sql_no_cache `columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`columns`.`TABLE_NAME` = _utf8'v2') NONE NO
+NULL test v3 select sql_no_cache `character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`character_sets`.`CHARACTER_SET_NAME` like _utf8'latin1%') NONE NO
+NULL test v4 select sql_no_cache `collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`collations`.`COLLATION_NAME` like _utf8'latin1%') NONE NO
drop view v0, v1, v2, v3, v4;
create table t1 (a int);
grant select,update,insert on t1 to mysqltest_1@localhost;
@@ -661,3 +664,14 @@ select table_type from information_schema.tables
where table_schema="mysql" and table_name="user";
table_type
BASE TABLE
+show open tables where `table` like "user";
+Database Table In_use Name_locked
+mysql user 0 0
+show status variable_name where variable_name like "%database%";
+variable_name
+Com_show_databases
+show variables variable_name where variable_name like "%database%";
+variable_name
+character_set_database
+collation_database
+skip_show_database
diff --git a/mysql-test/r/information_schema_inno.result b/mysql-test/r/information_schema_inno.result
index 4784c5e6106..a38139ba753 100644
--- a/mysql-test/r/information_schema_inno.result
+++ b/mysql-test/r/information_schema_inno.result
@@ -1,3 +1,4 @@
+DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id),
FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE,
diff --git a/mysql-test/r/insert_select.result.es b/mysql-test/r/insert_select.result.es
index 3955c0534f2..9e11402733d 100644
--- a/mysql-test/r/insert_select.result.es
+++ b/mysql-test/r/insert_select.result.es
@@ -78,6 +78,13 @@ a
1
2
drop table t1, t2;
+create table t1(a int);
+insert into t1 values(1),(1);
+reset master;
+create table t2(unique(a)) select a from t1;
+ERROR 23000: Duplicate entry '1' for key 1
+show binlog events;
+drop table t1;
create table t1 (a int not null);
create table t2 (a int not null);
insert into t1 values (1);
diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result
index 5db36cf6a66..7027d7eff79 100644
--- a/mysql-test/r/insert_update.result
+++ b/mysql-test/r/insert_update.result
@@ -105,3 +105,65 @@ a b
8 28
9 29
drop table t1;
+CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B));
+INSERT t1 VALUES (1,2,10), (3,4,20);
+INSERT t1 SELECT 5,6,30 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100;
+SELECT * FROM t1;
+a b c
+1 2 10
+3 4 20
+5 6 30
+INSERT t1 SELECT 5,7,40 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100;
+SELECT * FROM t1;
+a b c
+1 2 10
+3 4 20
+5 6 130
+INSERT t1 SELECT 8,4,50 FROM DUAL ON DUPLICATE KEY UPDATE c=c+1000;
+SELECT * FROM t1;
+a b c
+1 2 10
+3 4 1020
+5 6 130
+INSERT t1 SELECT 1,4,60 FROM DUAL ON DUPLICATE KEY UPDATE c=c+10000;
+SELECT * FROM t1;
+a b c
+1 2 10010
+3 4 1020
+5 6 130
+INSERT t1 SELECT 1,9,70 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100000, b=4;
+ERROR 23000: Duplicate entry '4' for key 2
+SELECT * FROM t1;
+a b c
+1 2 10010
+3 4 1020
+5 6 130
+TRUNCATE TABLE t1;
+INSERT t1 VALUES (1,2,10), (3,4,20);
+CREATE TABLE t2 (x INT, y INT, z INT, d INT);
+INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1);
+INSERT t2 VALUES (2,1,11,2), (7,4,40,2);
+INSERT t1 SELECT x,y,z FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100;
+SELECT * FROM t1;
+a b c
+1 2 10
+3 4 120
+5 6 30
+8 9 60
+INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0;
+SELECT * FROM t1;
+a b c
+1 2 10
+3 4 120
+5 0 30
+8 9 60
+INSERT t1 SELECT x,y,z FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
+SELECT *, VALUES(a) FROM t1;
+a b c VALUES(a)
+1 2 10 NULL
+3 4 127 NULL
+5 0 30 NULL
+8 9 60 NULL
+2 1 11 NULL
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/r/lowercase_table.result b/mysql-test/r/lowercase_table.result
index a30ec0f160c..c0df8d968cb 100644
--- a/mysql-test/r/lowercase_table.result
+++ b/mysql-test/r/lowercase_table.result
@@ -1,6 +1,7 @@
drop table if exists t1,t2,t3,t4;
drop table if exists t0,t5,t6,t7,t8,t9;
drop database if exists mysqltest;
+drop view if exists v0, v1, v2, v3, v4;
create table T1 (id int primary key, Word varchar(40) not null, Index(Word));
create table t4 (id int primary key, Word varchar(40) not null);
INSERT INTO T1 VALUES (1, 'a'), (2, 'b'), (3, 'c');
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 618816cd623..e014d2b80b7 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -653,3 +653,28 @@ ERROR HY000: You can't specify target table 't2' for update in FROM clause
create table t3 engine=merge union=(t1, t2) select (select max(a) from t2);
ERROR HY000: You can't specify target table 't2' for update in FROM clause
drop table t1, t2;
+create table t1 (a int,b int,c int, index (a,b,c));
+create table t2 (a int,b int,c int, index (a,b,c));
+create table t3 (a int,b int,c int, index (a,b,c))
+engine=merge union=(t1 ,t2);
+insert into t1 (a,b,c) values (1,1,0),(1,2,0);
+insert into t2 (a,b,c) values (1,1,1),(1,2,1);
+explain select a,b,c from t3 force index (a) where a=1 order by a,b,c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 ref a a 5 const 2 Using where; Using index
+select a,b,c from t3 force index (a) where a=1 order by a,b,c;
+a b c
+1 1 0
+1 1 1
+1 2 0
+1 2 1
+explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 ref a a 5 const 2 Using where; Using index
+select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc;
+a b c
+1 2 1
+1 2 0
+1 1 1
+1 1 0
+drop table t1, t2, t3;
diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result
index bd3b7ad5c25..307e918a37b 100644
--- a/mysql-test/r/metadata.result
+++ b/mysql-test/r/metadata.result
@@ -3,7 +3,7 @@ select 1, 1.0, -1, "hello", NULL;
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
def 1 8 1 1 N 32769 0 8
def 1.0 5 3 3 N 32769 1 8
-def -1 8 1 2 N 32769 0 8
+def -1 8 2 2 N 32769 0 8
def hello 253 5 5 N 1 31 8
def NULL 6 0 0 Y 32896 0 63
1 1.0 -1 hello NULL
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index b853b05f153..d10a4bf65f5 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -1,5 +1,6 @@
drop table if exists t1,t2,t3;
drop database if exists mysqltest;
+drop view if exists v1;
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
@@ -464,6 +465,17 @@ ERROR HY000: You can't specify target table 't1' for update in FROM clause
delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1;
ERROR HY000: You can't specify target table 't1' for update in FROM clause
drop table t1,t2;
+create table t1 (
+aclid bigint not null primary key,
+status tinyint(1) not null
+) engine = innodb;
+create table t2 (
+refid bigint not null primary key,
+aclid bigint, index idx_acl(aclid)
+) engine = innodb;
+insert into t2 values(1,null);
+delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1';
+drop table t1, t2;
set @ttype_save=@@storage_engine;
set @@storage_engine=innodb;
create table t1 ( c char(8) not null );
diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result
index d3f60ba4650..1661fa35d13 100644
--- a/mysql-test/r/ndb_alter_table.result
+++ b/mysql-test/r/ndb_alter_table.result
@@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
+drop database if exists mysqltest;
CREATE TABLE t1 (
a INT NOT NULL,
b INT NOT NULL
@@ -9,6 +10,21 @@ SELECT * FROM t1;
a b c
9410 9412 0
DROP TABLE t1;
+CREATE DATABASE mysqltest;
+USE mysqltest;
+CREATE TABLE t1 (
+a INT NOT NULL,
+b INT NOT NULL
+) ENGINE=ndbcluster;
+RENAME TABLE t1 TO test.t1;
+SHOW TABLES;
+Tables_in_mysqltest
+DROP DATABASE mysqltest;
+USE test;
+SHOW TABLES;
+Tables_in_test
+t1
+DROP TABLE t1;
create table t1 (
col1 int not null auto_increment primary key,
col2 varchar(30) not null,
diff --git a/mysql-test/r/ndb_update.result b/mysql-test/r/ndb_update.result
new file mode 100644
index 00000000000..5df5c861cfb
--- /dev/null
+++ b/mysql-test/r/ndb_update.result
@@ -0,0 +1,13 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+pk1 INT NOT NULL PRIMARY KEY,
+b INT NOT NULL,
+c INT NOT NULL
+) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES (0, 0, 1),(1,1,2),(2,2,3);
+UPDATE t1 set b = c;
+select * from t1 order by pk1;
+pk1 b c
+0 1 1
+1 2 2
+2 3 3
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 1e31b6e9ae7..7fe67eb22fe 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -471,6 +471,17 @@ select @var is null, @var is not null, @var;
execute stmt using @var, @var, @var;
? is null ? is not null ?
1 0 NULL
+create table t1 (pnum char(3));
+create table t2 (pnum char(3));
+prepare stmt from "select pnum from t2 having pnum in (select 'p1' from t1)";
+execute stmt;
+pnum
+execute stmt;
+pnum
+execute stmt;
+pnum
+deallocate prepare stmt;
+drop table t1, t2;
create table t1 (a varchar(20));
insert into t1 values ('foo');
prepare stmt FROM 'SELECT char_length (a) FROM t1';
diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
index d963fd04109..2507d545feb 100644
--- a/mysql-test/r/ps_1general.result
+++ b/mysql-test/r/ps_1general.result
@@ -1,5 +1,8 @@
drop table if exists t5, t6, t7, t8;
drop database if exists mysqltest ;
+drop database if exists testtets;
+drop table if exists t1Aa,t2Aa,v1Aa,v2Aa;
+drop view if exists t1Aa,t2Aa,v1Aa,v2Aa;
test_sequence
------ basic tests ------
drop table if exists t1, t9 ;
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index d3882b51219..1fbdd737eba 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -1687,6 +1687,9 @@ a b
1003 duplicate three
1004 duplicate four
delete from t1 where a >= 1000 ;
+set @1=1 ;
+set @2=2 ;
+set @100=100 ;
set @float=1.00;
set @five='five' ;
drop table if exists t2;
@@ -1940,7 +1943,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -2037,7 +2040,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2125,7 +2128,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2215,7 +2218,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
diff --git a/mysql-test/r/ps_2myisam.result.es b/mysql-test/r/ps_2myisam.result.es
deleted file mode 100644
index 3f17b4cdcd0..00000000000
--- a/mysql-test/r/ps_2myisam.result.es
+++ /dev/null
@@ -1,3130 +0,0 @@
-use test;
-drop table if exists t1, t9 ;
-create table t1
-(
-a int, b varchar(30),
-primary key(a)
-) engine = 'MYISAM' ;
-create table t9
-(
-c1 tinyint, c2 smallint, c3 mediumint, c4 int,
-c5 integer, c6 bigint, c7 float, c8 double,
-c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp(14), c16 time,
-c17 year, c18 bit, c19 bool, c20 char,
-c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
-c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
-c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
-c32 set('monday', 'tuesday', 'wednesday'),
-primary key(c1)
-) engine = 'MYISAM' ;
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-test_sequence
------- simple select tests ------
-prepare stmt1 from ' select * from t9 order by c1 ' ;
-execute stmt1;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def test t9 t9 c1 c1 1 4 1 N 49155 0 63
-def test t9 t9 c2 c2 2 6 1 Y 32768 0 63
-def test t9 t9 c3 c3 9 9 1 Y 32768 0 63
-def test t9 t9 c4 c4 3 11 1 Y 32768 0 63
-def test t9 t9 c5 c5 3 11 1 Y 32768 0 63
-def test t9 t9 c6 c6 8 20 1 Y 32768 0 63
-def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
-def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
-def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
-def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 0 9 6 Y 32768 4 63
-def test t9 t9 c12 c12 0 10 6 Y 32768 4 63
-def test t9 t9 c13 c13 10 10 10 Y 128 0 63
-def test t9 t9 c14 c14 12 19 19 Y 128 0 63
-def test t9 t9 c15 c15 7 19 19 N 1249 0 63
-def test t9 t9 c16 c16 11 8 8 Y 128 0 63
-def test t9 t9 c17 c17 13 4 4 Y 32864 0 63
-def test t9 t9 c18 c18 1 1 1 Y 32768 0 63
-def test t9 t9 c19 c19 1 1 1 Y 32768 0 63
-def test t9 t9 c20 c20 254 1 1 Y 0 0 8
-def test t9 t9 c21 c21 253 10 10 Y 0 0 8
-def test t9 t9 c22 c22 253 30 30 Y 0 0 8
-def test t9 t9 c23 c23 252 255 8 Y 144 0 63
-def test t9 t9 c24 c24 252 255 8 Y 16 0 8
-def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
-def test t9 t9 c26 c26 252 65535 4 Y 16 0 8
-def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63
-def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8
-def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63
-def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8
-def test t9 t9 c31 c31 254 5 3 Y 256 0 8
-def test t9 t9 c32 c32 254 24 7 Y 2048 0 8
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
-set @arg00='SELECT' ;
-prepare stmt1 from ' ? a from t1 where a=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 '? a from t1 where a=1' at line 1
-set @arg00=1 ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-1 one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-1 one
-set @arg00='lion' ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-lion one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-lion one
-set @arg00=NULL ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-NULL one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-NULL one
-set @arg00=1 ;
-select b, a - @arg00 from t1 where a=1 ;
-b a - @arg00
-one 0
-prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-b a - ?
-one 0
-set @arg00=null ;
-select @arg00 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select ? as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-select @arg00 + 1 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select ? + 1 as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-select 1 + @arg00 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select 1 + ? as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-set @arg00='MySQL' ;
-select substr(@arg00,1,2) from t1 where a=1 ;
-substr(@arg00,1,2)
-My
-prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr(?,1,2)
-My
-set @arg00=3 ;
-select substr('MySQL',@arg00,5) from t1 where a=1 ;
-substr('MySQL',@arg00,5)
-SQL
-prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr('MySQL',?,5)
-SQL
-select substr('MySQL',1,@arg00) from t1 where a=1 ;
-substr('MySQL',1,@arg00)
-MyS
-prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr('MySQL',1,?)
-MyS
-set @arg00='MySQL' ;
-select a , concat(@arg00,b) from t1 order by a;
-a concat(@arg00,b)
-1 MySQLone
-2 MySQLtwo
-3 MySQLthree
-4 MySQLfour
-prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ;
-execute stmt1 using @arg00;
-a concat(?,b)
-1 MySQLone
-2 MySQLtwo
-3 MySQLthree
-4 MySQLfour
-select a , concat(b,@arg00) from t1 order by a ;
-a concat(b,@arg00)
-1 oneMySQL
-2 twoMySQL
-3 threeMySQL
-4 fourMySQL
-prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ;
-execute stmt1 using @arg00;
-a concat(b,?)
-1 oneMySQL
-2 twoMySQL
-3 threeMySQL
-4 fourMySQL
-set @arg00='MySQL' ;
-select group_concat(@arg00,b order by a) from t1
-group by 'a' ;
-group_concat(@arg00,b order by a)
-MySQLone,MySQLtwo,MySQLthree,MySQLfour
-prepare stmt1 from ' select group_concat(?,b order by a) from t1
-group by ''a'' ' ;
-execute stmt1 using @arg00;
-group_concat(?,b order by a)
-MySQLone,MySQLtwo,MySQLthree,MySQLfour
-select group_concat(b,@arg00 order by a) from t1
-group by 'a' ;
-group_concat(b,@arg00 order by a)
-oneMySQL,twoMySQL,threeMySQL,fourMySQL
-prepare stmt1 from ' select group_concat(b,? order by a) from t1
-group by ''a'' ' ;
-execute stmt1 using @arg00;
-group_concat(b,? order by a)
-oneMySQL,twoMySQL,threeMySQL,fourMySQL
-set @arg00='first' ;
-set @arg01='second' ;
-set @arg02=NULL;
-select @arg00, @arg01 from t1 where a=1 ;
-@arg00 @arg01
-first second
-prepare stmt1 from ' select ?, ? from t1 where a=1 ' ;
-execute stmt1 using @arg00, @arg01 ;
-? ?
-first second
-execute stmt1 using @arg02, @arg01 ;
-? ?
-NULL second
-execute stmt1 using @arg00, @arg02 ;
-? ?
-first NULL
-execute stmt1 using @arg02, @arg02 ;
-? ?
-NULL NULL
-drop table if exists t5 ;
-create table t5 (id1 int(11) not null default '0',
-value2 varchar(100), value1 varchar(100)) ;
-insert into t5 values (1,'hh','hh'),(2,'hh','hh'),
-(1,'ii','ii'),(2,'ii','ii') ;
-prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ;
-set @arg00=1 ;
-set @arg01='hh' ;
-execute stmt1 using @arg00, @arg01 ;
-id1 value1
-1 hh
-1 ii
-2 hh
-drop table t5 ;
-drop table if exists t5 ;
-create table t5(session_id char(9) not null) ;
-insert into t5 values ('abc') ;
-prepare stmt1 from ' select * from t5
-where ?=''1111'' and session_id = ''abc'' ' ;
-set @arg00='abc' ;
-execute stmt1 using @arg00 ;
-session_id
-set @arg00='1111' ;
-execute stmt1 using @arg00 ;
-session_id
-abc
-set @arg00='abc' ;
-execute stmt1 using @arg00 ;
-session_id
-drop table t5 ;
-set @arg00='FROM' ;
-select a @arg00 t1 where a=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 '@arg00 t1 where a=1' at line 1
-prepare stmt1 from ' select a ? t1 where a=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 '? t1 where a=1' at line 1
-set @arg00='t1' ;
-select a from @arg00 where a=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 '@arg00 where a=1' at line 1
-prepare stmt1 from ' select a from ? where a=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 '? where a=1' at line 1
-set @arg00='WHERE' ;
-select a from t1 @arg00 a=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 '@arg00 a=1' at line 1
-prepare stmt1 from ' select a from t1 ? a=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 '? a=1' at line 1
-set @arg00=1 ;
-select a FROM t1 where a=@arg00 ;
-a
-1
-prepare stmt1 from ' select a FROM t1 where a=? ' ;
-execute stmt1 using @arg00 ;
-a
-1
-set @arg00=1000 ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=NULL ;
-select a FROM t1 where a=@arg00 ;
-a
-prepare stmt1 from ' select a FROM t1 where a=? ' ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=4 ;
-select a FROM t1 where a=sqrt(@arg00) ;
-a
-2
-prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
-execute stmt1 using @arg00 ;
-a
-2
-set @arg00=NULL ;
-select a FROM t1 where a=sqrt(@arg00) ;
-a
-prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=2 ;
-set @arg01=3 ;
-select a FROM t1 where a in (@arg00,@arg01) order by a;
-a
-2
-3
-prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a ';
-execute stmt1 using @arg00, @arg01;
-a
-2
-3
-set @arg00= 'one' ;
-set @arg01= 'two' ;
-set @arg02= 'five' ;
-prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ;
-execute stmt1 using @arg00, @arg01, @arg02 ;
-b
-one
-two
-prepare stmt1 from ' select b FROM t1 where b like ? ';
-set @arg00='two' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00='tw%' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00='%wo' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00=null ;
-insert into t9 set c1= 0, c5 = NULL ;
-select c5 from t9 where c5 > NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 > ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 < NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 < ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 = NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 = ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 <=> NULL ;
-c5
-NULL
-prepare stmt1 from ' select c5 from t9 where c5 <=> ? ';
-execute stmt1 using @arg00 ;
-c5
-NULL
-delete from t9 where c1= 0 ;
-set @arg00='>' ;
-select a FROM t1 where a @arg00 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 '@arg00 1' at line 1
-prepare stmt1 from ' select a FROM t1 where a ? 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 '? 1' at line 1
-set @arg00=1 ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL group by a - @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL group by a - ? ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00='two' ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL having b <> @arg00 order by a ;
-a b
-1 one
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL having b <> ? order by a ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-3 three
-4 four
-set @arg00=1 ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL order by a - @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL order by a - ? ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=2 ;
-select a,b from t1 order by 2 ;
-a b
-4 four
-1 one
-3 three
-2 two
-prepare stmt1 from ' select a,b from t1
-order by ? ';
-execute stmt1 using @arg00;
-a b
-4 four
-1 one
-3 three
-2 two
-set @arg00=1 ;
-execute stmt1 using @arg00;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=0 ;
-execute stmt1 using @arg00;
-ERROR 42S22: Unknown column '?' in 'order clause'
-set @arg00=1;
-prepare stmt1 from ' select a,b from t1 order by a
-limit 1 ';
-execute stmt1 ;
-a b
-1 one
-prepare stmt1 from ' select a,b from t1
-limit ? ';
-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 2
-set @arg00='b' ;
-set @arg01=0 ;
-set @arg02=2 ;
-set @arg03=2 ;
-select sum(a), @arg00 from t1 where a > @arg01
-and b is not null group by substr(b,@arg02)
-having sum(a) <> @arg03 ;
-sum(a) @arg00
-3 b
-1 b
-4 b
-prepare stmt1 from ' select sum(a), ? from t1 where a > ?
-and b is not null group by substr(b,?)
-having sum(a) <> ? ';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03;
-sum(a) ?
-3 b
-1 b
-4 b
-test_sequence
------- join tests ------
-select first.a as a1, second.a as a2
-from t1 first, t1 second
-where first.a = second.a order by a1 ;
-a1 a2
-1 1
-2 2
-3 3
-4 4
-prepare stmt1 from ' select first.a as a1, second.a as a2
- from t1 first, t1 second
- where first.a = second.a order by a1 ';
-execute stmt1 ;
-a1 a2
-1 1
-2 2
-3 3
-4 4
-set @arg00='ABC';
-set @arg01='two';
-set @arg02='one';
-select first.a, @arg00, second.a FROM t1 first, t1 second
-where @arg01 = first.b or first.a = second.a or second.b = @arg02
-order by second.a, first.a;
-a @arg00 a
-1 ABC 1
-2 ABC 1
-3 ABC 1
-4 ABC 1
-2 ABC 2
-2 ABC 3
-3 ABC 3
-2 ABC 4
-4 ABC 4
-prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
- where ? = first.b or first.a = second.a or second.b = ?
- order by second.a, first.a';
-execute stmt1 using @arg00, @arg01, @arg02;
-a ? a
-1 ABC 1
-2 ABC 1
-3 ABC 1
-4 ABC 1
-2 ABC 2
-2 ABC 3
-3 ABC 3
-2 ABC 4
-4 ABC 4
-drop table if exists t2 ;
-create table t2 as select * from t1 ;
-set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ;
-set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ;
-set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ;
-set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ;
-set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ;
-set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ;
-set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ;
-set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ;
-set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ;
-the join statement is:
-SELECT * FROM t2 right join t1 using(a) order by t2.a
-prepare stmt1 from @query9 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural right join t1 order by t2.a
-prepare stmt1 from @query8 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a
-prepare stmt1 from @query7 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 left join t1 using(a) order by t2.a
-prepare stmt1 from @query6 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural left join t1 order by t2.a
-prepare stmt1 from @query5 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a
-prepare stmt1 from @query4 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 join t1 using(a) order by t2.a
-prepare stmt1 from @query3 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural join t1 order by t2.a
-prepare stmt1 from @query2 ;
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-the join statement is:
-SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a
-prepare stmt1 from @query1 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-drop table t2 ;
-test_sequence
------- subquery tests ------
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ''two'') ';
-execute stmt1 ;
-a b
-2 two
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = 'two' ) and b=@arg00 ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ''two'') and b=? ';
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = @arg00 ) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ? ) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=3 ;
-set @arg01='three' ;
-select a,b FROM t1 where (a,b) in (select 3, 'three');
-a b
-3 three
-select a FROM t1 where (a,b) in (select @arg00,@arg01);
-a
-3
-prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) ';
-execute stmt1 using @arg00, @arg01;
-a
-3
-set @arg00=1 ;
-set @arg01='two' ;
-set @arg02=2 ;
-set @arg03='two' ;
-select a, @arg00, b FROM t1 outer_table where
-b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ;
-a @arg00 b
-2 1 two
-prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
- b=? and a = (select ? from t1 where b = ? ) ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-a ? b
-2 1 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = outer_table.b ) order by a ';
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = outer_table.b ) and b=@arg00 ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = outer_table.b) and b=? ';
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=2 ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=2 ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=1 ;
-set @arg01='two' ;
-set @arg02=2 ;
-set @arg03='two' ;
-select a, @arg00, b FROM t1 outer_table where
-b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03
-and outer_table.a=a ) ;
-a @arg00 b
-2 1 two
-prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
- b=? and a = (select ? from t1 where outer_table.b = ?
- and outer_table.a=a ) ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-a ? b
-2 1 two
-set @arg00=1 ;
-set @arg01=0 ;
-select a, @arg00
-from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2
-where a=@arg01;
-a @arg00
-0 1
-prepare stmt1 from ' select a, ?
- from ( select a - ? as a from t1 where a=? ) as t2
- where a=? ';
-execute stmt1 using @arg00, @arg00, @arg00, @arg01 ;
-a ?
-0 1
-drop table if exists t2 ;
-create table t2 as select * from t1;
-prepare stmt1 from ' select a in (select a from t2) from t1 ' ;
-execute stmt1 ;
-a in (select a from t2)
-1
-1
-1
-1
-drop table if exists t5, t6, t7 ;
-create table t5 (a int , b int) ;
-create table t6 like t5 ;
-create table t7 like t5 ;
-insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7),
-(2, -1), (3, 10) ;
-insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ;
-insert into t7 values (3, 3), (2, 2), (1, 1) ;
-prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1) from t7 ' ;
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-drop table t5, t6, t7 ;
-drop table if exists t2 ;
-create table t2 as select * from t9;
-set @stmt= ' SELECT
- (SELECT SUM(c1 + c12 + 0.0) FROM t2
- where (t9.c2 - 0e-3) = t2.c2
- GROUP BY t9.c15 LIMIT 1) as scalar_s,
- exists (select 1.0e+0 from t2
- where t2.c3 * 9.0000000000 = t9.c4) as exists_s,
- c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s,
- (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s
-FROM t9,
-(select c25 x, c32 y from t2) tt WHERE x = c25 ' ;
-prepare stmt1 from @stmt ;
-execute stmt1 ;
-execute stmt1 ;
-set @stmt= concat('explain ',@stmt);
-prepare stmt1 from @stmt ;
-execute stmt1 ;
-execute stmt1 ;
-set @stmt= ' SELECT
- (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2
- GROUP BY t9.c15 LIMIT 1) as scalar_s,
- exists (select ? from t2
- where t2.c3*?=t9.c4) as exists_s,
- c5*? in (select c6+? from t2) as in_s,
- (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s
-FROM t9,
-(select c25 x, c32 y from t2) tt WHERE x =c25 ' ;
-set @arg00= 0.0 ;
-set @arg01= 0e-3 ;
-set @arg02= 1.0e+0 ;
-set @arg03= 9.0000000000 ;
-set @arg04= 4 ;
-set @arg05= 0.3e+1 ;
-set @arg06= 4 ;
-set @arg07= 4 ;
-set @arg08= 4.0 ;
-set @arg09= 40e-1 ;
-prepare stmt1 from @stmt ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-set @stmt= concat('explain ',@stmt);
-prepare stmt1 from @stmt ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-drop table t2 ;
-select 1 < (select a from t1) ;
-ERROR 21000: Subquery returns more than 1 row
-prepare stmt1 from ' select 1 < (select a from t1) ' ;
-execute stmt1 ;
-ERROR 21000: Subquery returns more than 1 row
-select 1 as my_col ;
-my_col
-1
-test_sequence
------- union tests ------
-prepare stmt1 from ' select a FROM t1 where a=1
- union distinct
- select a FROM t1 where a=1 ';
-execute stmt1 ;
-a
-1
-execute stmt1 ;
-a
-1
-prepare stmt1 from ' select a FROM t1 where a=1
- union all
- select a FROM t1 where a=1 ';
-execute stmt1 ;
-a
-1
-1
-prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-set @arg00=1 ;
-select @arg00 FROM t1 where a=1
-union distinct
-select 1 FROM t1 where a=1;
-@arg00
-1
-prepare stmt1 from ' select ? FROM t1 where a=1
- union distinct
- select 1 FROM t1 where a=1 ' ;
-execute stmt1 using @arg00;
-?
-1
-set @arg00=1 ;
-select 1 FROM t1 where a=1
-union distinct
-select @arg00 FROM t1 where a=1;
-1
-1
-prepare stmt1 from ' select 1 FROM t1 where a=1
- union distinct
- select ? FROM t1 where a=1 ' ;
-execute stmt1 using @arg00;
-1
-1
-set @arg00='a' ;
-select @arg00 FROM t1 where a=1
-union distinct
-select @arg00 FROM t1 where a=1;
-@arg00
-a
-prepare stmt1 from ' select ? FROM t1 where a=1
- union distinct
- select ? FROM t1 where a=1 ';
-execute stmt1 using @arg00, @arg00;
-?
-a
-prepare stmt1 from ' select ?
- union distinct
- select ? ';
-execute stmt1 using @arg00, @arg00;
-?
-a
-set @arg00='a' ;
-set @arg01=1 ;
-set @arg02='a' ;
-set @arg03=2 ;
-select @arg00 FROM t1 where a=@arg01
-union distinct
-select @arg02 FROM t1 where a=@arg03;
-@arg00
-a
-prepare stmt1 from ' select ? FROM t1 where a=?
- union distinct
- select ? FROM t1 where a=? ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03;
-?
-a
-set @arg00=1 ;
-prepare stmt1 from ' select sum(a) + 200, ? from t1
-union distinct
-select sum(a) + 200, 1 from t1
-group by b ' ;
-execute stmt1 using @arg00;
-sum(a) + 200 ?
-210 1
-204 1
-201 1
-203 1
-202 1
-set @Oporto='Oporto' ;
-set @Lisboa='Lisboa' ;
-set @0=0 ;
-set @1=1 ;
-set @2=2 ;
-set @3=3 ;
-set @4=4 ;
-select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ;
-@Oporto @Lisboa @0 @1 @2 @3 @4
-Oporto Lisboa 0 1 2 3 4
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-group by b
-union distinct
-select sum(a) + 200, @Lisboa from t1
-group by b ;
-the_sum the_town
-204 Oporto
-201 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-201 Lisboa
-203 Lisboa
-202 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- group by b
- union distinct
- select sum(a) + 200, ? from t1
- group by b ' ;
-execute stmt1 using @Oporto, @Lisboa;
-the_sum the_town
-204 Oporto
-201 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-201 Lisboa
-203 Lisboa
-202 Lisboa
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-where a > @1
-group by b
-union distinct
-select sum(a) + 200, @Lisboa from t1
-where a > @2
-group by b ;
-the_sum the_town
-204 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-203 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- where a > ?
- group by b
- union distinct
- select sum(a) + 200, ? from t1
- where a > ?
- group by b ' ;
-execute stmt1 using @Oporto, @1, @Lisboa, @2;
-the_sum the_town
-204 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-203 Lisboa
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-where a > @1
-group by b
-having avg(a) > @2
-union distinct
-select sum(a) + 200, @Lisboa from t1
-where a > @2
-group by b
-having avg(a) > @3;
-the_sum the_town
-204 Oporto
-203 Oporto
-204 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- where a > ?
- group by b
- having avg(a) > ?
- union distinct
- select sum(a) + 200, ? from t1
- where a > ?
- group by b
- having avg(a) > ? ';
-execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3;
-the_sum the_town
-204 Oporto
-203 Oporto
-204 Lisboa
-test_sequence
------- explain select tests ------
-prepare stmt1 from ' explain select * from t9 ' ;
-execute stmt1;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def id 8 3 1 N 32801 0 8
-def select_type 253 19 6 N 1 31 33
-def table 253 64 2 N 1 31 33
-def type 253 10 3 N 1 31 33
-def possible_keys 253 4096 0 Y 0 31 33
-def key 253 64 0 Y 0 31 33
-def key_len 8 3 0 Y 32800 0 8
-def ref 253 1024 0 Y 0 31 33
-def rows 8 10 1 N 32801 0 8
-def Extra 253 255 0 N 1 31 33
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t9 ALL NULL NULL NULL NULL 2
-drop table if exists t2 ;
-create table t2 (s varchar(25), fulltext(s))
-ENGINE = 'MYISAM' ;
-insert into t2 values ('Gravedigger'), ('Greed'),('Hollow Dogs') ;
-commit ;
-prepare stmt1 from ' select s from t2 where match (s) against (?) ' ;
-set @arg00='Dogs' ;
-execute stmt1 using @arg00 ;
-s
-Hollow Dogs
-prepare stmt1 from ' SELECT s FROM t2
-where match (s) against (concat(?,''digger'')) ';
-set @arg00='Grave' ;
-execute stmt1 using @arg00 ;
-s
-Gravedigger
-drop table t2 ;
-test_sequence
------- delete tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'delete from t1 where a=2' ;
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-execute stmt1;
-insert into t1 values(0,NULL);
-set @arg00=NULL;
-prepare stmt1 from 'delete from t1 where b=?' ;
-execute stmt1 using @arg00;
-select a,b from t1 where b is NULL ;
-a b
-0 NULL
-set @arg00='one';
-execute stmt1 using @arg00;
-select a,b from t1 where b=@arg00;
-a b
-prepare stmt1 from 'truncate table t1' ;
-ERROR HY000: This command is not supported in the prepared statement protocol yet
-test_sequence
------- update tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ;
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-2 a=two
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-2 a=two
-set @arg00=NULL;
-prepare stmt1 from 'update t1 set b=? where a=2' ;
-execute stmt1 using @arg00;
-select a,b from t1 where a=2;
-a b
-2 NULL
-set @arg00='two';
-execute stmt1 using @arg00;
-select a,b from t1 where a=2;
-a b
-2 two
-set @arg00=2;
-prepare stmt1 from 'update t1 set b=NULL where a=?' ;
-execute stmt1 using @arg00;
-select a,b from t1 where a=@arg00;
-a b
-2 NULL
-update t1 set b='two' where a=@arg00;
-set @arg00=2000;
-execute stmt1 using @arg00;
-select a,b from t1 where a=@arg00;
-a b
-set @arg00=2;
-set @arg01=22;
-prepare stmt1 from 'update t1 set a=? where a=?' ;
-execute stmt1 using @arg00, @arg00;
-select a,b from t1 where a=@arg00;
-a b
-2 two
-execute stmt1 using @arg01, @arg00;
-select a,b from t1 where a=@arg01;
-a b
-22 two
-execute stmt1 using @arg00, @arg01;
-select a,b from t1 where a=@arg00;
-a b
-2 two
-set @arg00=NULL;
-set @arg01=2;
-execute stmt1 using @arg00, @arg01;
-Warnings:
-Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
-select a,b from t1 order by a;
-a b
-0 two
-1 one
-3 three
-4 four
-set @arg00=0;
-execute stmt1 using @arg01, @arg00;
-select a,b from t1 order by a;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=23;
-set @arg01='two';
-set @arg02=2;
-set @arg03='two';
-set @arg04=2;
-drop table if exists t2;
-create table t2 as select a,b from t1 ;
-prepare stmt1 from 'update t1 set a=? where b=?
- and a in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 where a = @arg00 ;
-a b
-23 two
-prepare stmt1 from 'update t1 set a=? where b=?
- and a not in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 order by a ;
-a b
-1 one
-2 two
-3 three
-4 four
-drop table t2 ;
-create table t2
-(
-a int, b varchar(30),
-primary key(a)
-) engine = 'MYISAM' ;
-insert into t2(a,b) select a, b from t1 ;
-prepare stmt1 from 'update t1 set a=? where b=?
- and a in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 where a = @arg00 ;
-a b
-23 two
-prepare stmt1 from 'update t1 set a=? where b=?
- and a not in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 order by a ;
-a b
-1 one
-2 two
-3 three
-4 four
-drop table t2 ;
-set @arg00=1;
-prepare stmt1 from 'update t1 set b=''bla''
-where a=2
-limit 1';
-execute stmt1 ;
-select a,b from t1 where b = 'bla' ;
-a b
-2 bla
-prepare stmt1 from 'update t1 set b=''bla''
-where a=2
-limit ?';
-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 3
-test_sequence
------- insert tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'insert into t1 values(5, ''five'' )';
-execute stmt1;
-select a,b from t1 where a = 5;
-a b
-5 five
-set @arg00='six' ;
-prepare stmt1 from 'insert into t1 values(6, ? )';
-execute stmt1 using @arg00;
-select a,b from t1 where b = @arg00;
-a b
-6 six
-execute stmt1 using @arg00;
-ERROR 23000: Duplicate entry '6' for key 1
-set @arg00=NULL ;
-prepare stmt1 from 'insert into t1 values(0, ? )';
-execute stmt1 using @arg00;
-select a,b from t1 where b is NULL;
-a b
-0 NULL
-set @arg00=8 ;
-set @arg01='eight' ;
-prepare stmt1 from 'insert into t1 values(?, ? )';
-execute stmt1 using @arg00, @arg01 ;
-select a,b from t1 where b = @arg01;
-a b
-8 eight
-set @NULL= null ;
-set @arg00= 'abc' ;
-execute stmt1 using @NULL, @NULL ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @NULL ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @arg00 ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @arg00 ;
-ERROR 23000: Column 'a' cannot be null
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @arg00 ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @arg00 ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 abc
-10002 abc
-delete from t1 where a > 10000 ;
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @NULL ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @NULL ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 NULL
-10002 NULL
-delete from t1 where a > 10000 ;
-set @arg01= 10000 + 10 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 9 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 8 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 7 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 6 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 5 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 4 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 3 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @arg01 ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 10001
-10002 10002
-10003 10003
-10004 10004
-10005 10005
-10006 10006
-10007 10007
-10008 10008
-10009 10009
-10010 10010
-delete from t1 where a > 10000 ;
-set @arg00=81 ;
-set @arg01='8-1' ;
-set @arg02=82 ;
-set @arg03='8-2' ;
-prepare stmt1 from 'insert into t1 values(?,?),(?,?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-select a,b from t1 where a in (@arg00,@arg02) ;
-a b
-81 8-1
-82 8-2
-set @arg00=9 ;
-set @arg01='nine' ;
-prepare stmt1 from 'insert into t1 set a=?, b=? ';
-execute stmt1 using @arg00, @arg01 ;
-select a,b from t1 where a = @arg00 ;
-a b
-9 nine
-set @arg00=6 ;
-set @arg01=1 ;
-prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
- on duplicate key update a=a + ?, b=concat(b,''modified'') ';
-execute stmt1 using @arg00, @arg01;
-select * from t1 order by a;
-a b
-0 NULL
-1 one
-2 two
-3 three
-4 four
-5 five
-7 sixmodified
-8 eight
-9 nine
-81 8-1
-82 8-2
-set @arg00=81 ;
-set @arg01=1 ;
-execute stmt1 using @arg00, @arg01;
-ERROR 23000: Duplicate entry '82' for key 1
-drop table if exists t2 ;
-create table t2 (id int auto_increment primary key)
-ENGINE= 'MYISAM' ;
-prepare stmt1 from ' select last_insert_id() ' ;
-insert into t2 values (NULL) ;
-execute stmt1 ;
-last_insert_id()
-1
-insert into t2 values (NULL) ;
-execute stmt1 ;
-last_insert_id()
-2
-drop table t2 ;
-set @1000=1000 ;
-set @x1000_2="x1000_2" ;
-set @x1000_3="x1000_3" ;
-set @x1000="x1000" ;
-set @1100=1100 ;
-set @x1100="x1100" ;
-set @100=100 ;
-set @updated="updated" ;
-insert into t1 values(1000,'x1000_1') ;
-insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
-on duplicate key update a = a + @100, b = concat(b,@updated) ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 x1000_3
-1100 x1000_1updated
-delete from t1 where a >= 1000 ;
-insert into t1 values(1000,'x1000_1') ;
-prepare stmt1 from ' insert into t1 values(?,?),(?,?)
- on duplicate key update a = a + ?, b = concat(b,?) ';
-execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 x1000_3
-1100 x1000_1updated
-delete from t1 where a >= 1000 ;
-insert into t1 values(1000,'x1000_1') ;
-execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1200 x1000_1updatedupdated
-delete from t1 where a >= 1000 ;
-prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
-execute stmt1;
-execute stmt1;
-execute stmt1;
-test_sequence
------- multi table tests ------
-delete from t1 ;
-delete from t9 ;
-insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ;
-insert into t9 (c1,c21)
-values (1, 'one'), (2, 'two'), (3, 'three') ;
-prepare stmt_delete from " delete t1, t9
- from t1, t9 where t1.a=t9.c1 and t1.b='updated' ";
-prepare stmt_update from " update t1, t9
- set t1.b='updated', t9.c21='updated'
- where t1.a=t9.c1 and t1.a=? ";
-prepare stmt_select1 from " select a, b from t1 order by a" ;
-prepare stmt_select2 from " select c1, c21 from t9 order by c1" ;
-set @arg00= 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-2 two
-3 three
-execute stmt_select2 ;
-c1 c21
-2 two
-3 three
-set @arg00= @arg00 + 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-3 three
-execute stmt_select2 ;
-c1 c21
-3 three
-set @arg00= @arg00 + 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-execute stmt_select2 ;
-c1 c21
-set @arg00= @arg00 + 1 ;
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-insert into t1 values(0,NULL) ;
-set @duplicate='duplicate ' ;
-set @1000=1000 ;
-set @5=5 ;
-select a,b from t1 where a < 5 order by a ;
-a b
-0 NULL
-1 one
-2 two
-3 three
-4 four
-insert into t1 select a + @1000, concat(@duplicate,b) from t1
-where a < @5 ;
-affected rows: 5
-info: Records: 5 Duplicates: 0 Warnings: 0
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 NULL
-1001 duplicate one
-1002 duplicate two
-1003 duplicate three
-1004 duplicate four
-delete from t1 where a >= 1000 ;
-prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
-where a < ? ' ;
-execute stmt1 using @1000, @duplicate, @5;
-affected rows: 5
-info: Records: 5 Duplicates: 0 Warnings: 0
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 NULL
-1001 duplicate one
-1002 duplicate two
-1003 duplicate three
-1004 duplicate four
-delete from t1 where a >= 1000 ;
-set @float=1.00;
-set @five='five' ;
-drop table if exists t2;
-create table t2 like t1 ;
-insert into t2 (b,a)
-select @duplicate, sum(first.a) from t1 first, t1 second
-where first.a <> @5 and second.b = first.b
-and second.b <> @five
-group by second.b
-having sum(second.a) > @2
-union
-select b, a + @100 from t1
-where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
-from t1);
-affected rows: 3
-info: Records: 3 Duplicates: 0 Warnings: 0
-select a,b from t2 order by a ;
-a b
-3 duplicate
-4 duplicate
-103 three
-delete from t2 ;
-prepare stmt1 from ' insert into t2 (b,a)
-select ?, sum(first.a)
- from t1 first, t1 second
- where first.a <> ? and second.b = first.b and second.b <> ?
- group by second.b
- having sum(second.a) > ?
-union
-select b, a + ? from t1
- where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b
- from t1 ) ' ;
-execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
-affected rows: 3
-info: Records: 3 Duplicates: 0 Warnings: 0
-select a,b from t2 order by a ;
-a b
-3 duplicate
-4 duplicate
-103 three
-drop table t2;
-drop table if exists t5 ;
-set @arg01= 8;
-set @arg02= 8.0;
-set @arg03= 80.00000000000e-1;
-set @arg04= 'abc' ;
-set @arg05= CAST('abc' as binary) ;
-set @arg06= '1991-08-05' ;
-set @arg07= CAST('1991-08-05' as date);
-set @arg08= '1991-08-05 01:01:01' ;
-set @arg09= CAST('1991-08-05 01:01:01' as datetime) ;
-set @arg10= unix_timestamp('1991-01-01 01:01:01');
-set @arg11= YEAR('1991-01-01 01:01:01');
-set @arg12= 8 ;
-set @arg12= NULL ;
-set @arg13= 8.0 ;
-set @arg13= NULL ;
-set @arg14= 'abc';
-set @arg14= NULL ;
-set @arg15= CAST('abc' as binary) ;
-set @arg15= NULL ;
-create table t5 as select
-8 as const01, @arg01 as param01,
-8.0 as const02, @arg02 as param02,
-80.00000000000e-1 as const03, @arg03 as param03,
-'abc' as const04, @arg04 as param04,
-CAST('abc' as binary) as const05, @arg05 as param05,
-'1991-08-05' as const06, @arg06 as param06,
-CAST('1991-08-05' as date) as const07, @arg07 as param07,
-'1991-08-05 01:01:01' as const08, @arg08 as param08,
-CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09,
-unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10,
-YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11,
-NULL as const12, @arg12 as param12,
-@arg13 as param13,
-@arg14 as param14,
-@arg15 as param15;
-show create table t5 ;
-Table Create Table
-t5 CREATE TABLE `t5` (
- `const01` bigint(1) NOT NULL default '0',
- `param01` bigint(20) default NULL,
- `const02` double(3,1) NOT NULL default '0.0',
- `param02` double default NULL,
- `const03` double NOT NULL default '0',
- `param03` double default NULL,
- `const04` char(3) NOT NULL default '',
- `param04` longtext,
- `const05` binary(3) NOT NULL default '',
- `param05` longblob,
- `const06` varchar(10) NOT NULL default '',
- `param06` longtext,
- `const07` date default NULL,
- `param07` longblob,
- `const08` varchar(19) NOT NULL default '',
- `param08` longtext,
- `const09` datetime default NULL,
- `param09` longblob,
- `const10` int(10) NOT NULL default '0',
- `param10` bigint(20) default NULL,
- `const11` int(4) default NULL,
- `param11` bigint(20) default NULL,
- `const12` binary(0) default NULL,
- `param12` bigint(20) default NULL,
- `param13` double default NULL,
- `param14` longtext,
- `param15` longblob
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-select * from t5 ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def test t5 t5 const01 const01 8 1 1 N 32769 0 63
-def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 5 3 3 N 32769 1 63
-def test t5 t5 param02 param02 5 20 1 Y 32768 31 63
-def test t5 t5 const03 const03 5 23 1 N 32769 31 63
-def test t5 t5 param03 param03 5 20 1 Y 32768 31 63
-def test t5 t5 const04 const04 254 3 3 N 1 0 8
-def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8
-def test t5 t5 const05 const05 254 3 3 N 129 0 63
-def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63
-def test t5 t5 const06 const06 253 10 10 N 1 0 8
-def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8
-def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63
-def test t5 t5 const08 const08 253 19 19 N 1 0 8
-def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8
-def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63
-def test t5 t5 const10 const10 3 10 9 N 32769 0 63
-def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
-def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
-def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
-def test t5 t5 const12 const12 254 0 0 Y 128 0 63
-def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
-def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
-def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
-const01 8
-param01 8
-const02 8.0
-param02 8
-const03 8
-param03 8
-const04 abc
-param04 abc
-const05 abc
-param05 abc
-const06 1991-08-05
-param06 1991-08-05
-const07 1991-08-05
-param07 1991-08-05
-const08 1991-08-05 01:01:01
-param08 1991-08-05 01:01:01
-const09 1991-08-05 01:01:01
-param09 1991-08-05 01:01:01
-const10 662680861
-param10 662680861
-const11 1991
-param11 1991
-const12 NULL
-param12 NULL
-param13 NULL
-param14 NULL
-param15 NULL
-drop table t5 ;
-test_sequence
------- data type conversion tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ;
-select * from t9 order by c1 ;
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
-test_sequence
------- select @parameter:= column ------
-prepare full_info from "select @arg01, @arg02, @arg03, @arg04,
- @arg05, @arg06, @arg07, @arg08,
- @arg09, @arg10, @arg11, @arg12,
- @arg13, @arg14, @arg15, @arg16,
- @arg17, @arg18, @arg19, @arg20,
- @arg21, @arg22, @arg23, @arg24,
- @arg25, @arg26, @arg27, @arg28,
- @arg29, @arg30, @arg31, @arg32" ;
-select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
-@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
-@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
-@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
-@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
-@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
-@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
-@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= 1 ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
-@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
-@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
-@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
-@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
-@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
-@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
-@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= 0 ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select
- @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
- @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
- @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
- @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
- @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
- @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
- @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
- @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= ?" ;
-set @my_key= 1 ;
-execute stmt1 using @my_key ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-set @my_key= 0 ;
-execute stmt1 using @my_key ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select ? := c1 from t9 where c1= 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 ':= c1 from t9 where c1= 1' at line 1
-test_sequence
------- select column, .. into @parm,.. ------
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
-c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
-c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
-@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
-@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
-@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= 1 ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
-c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
-c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
-@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
-@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
-@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= 0 ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
- c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
- c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
- @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
- @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
- @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= ?" ;
-set @my_key= 1 ;
-execute stmt1 using @my_key ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-set @my_key= 0 ;
-execute stmt1 using @my_key ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select c1 into ? from t9 where c1= 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 '? from t9 where c1= 1' at line 1
-test_sequence
--- insert into numeric columns --
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ;
-set @arg00= 21 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ;
-execute stmt1 ;
-set @arg00= 23;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0,
-30.0, 30.0, 30.0 ) ;
-set @arg00= 31.0 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0,
- 32.0, 32.0, 32.0 )" ;
-execute stmt1 ;
-set @arg00= 33.0;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( '40', '40', '40', '40', '40', '40', '40', '40',
-'40', '40', '40' ) ;
-set @arg00= '41' ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( '42', '42', '42', '42', '42', '42', '42', '42',
- '42', '42', '42' )" ;
-execute stmt1 ;
-set @arg00= '43';
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ;
-set @arg00= CAST('51' as binary) ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ;
-execute stmt1 ;
-set @arg00= CAST('53' as binary) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 2 ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-NULL, NULL, NULL ) ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 61, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL )" ;
-execute stmt1 ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 8.0 ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 71, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 'abc' ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 81, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
-from t9 where c1 >= 20
-order by c1 ;
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12
-20 20 20 20 20 20 20 20 20 20 20.0000
-21 21 21 21 21 21 21 21 21 21 21.0000
-22 22 22 22 22 22 22 22 22 22 22.0000
-23 23 23 23 23 23 23 23 23 23 23.0000
-30 30 30 30 30 30 30 30 30 30 30.0000
-31 31 31 31 31 31 31 31 31 31 31.0000
-32 32 32 32 32 32 32 32 32 32 32.0000
-33 33 33 33 33 33 33 33 33 33 33.0000
-40 40 40 40 40 40 40 40 40 40 40.0000
-41 41 41 41 41 41 41 41 41 41 41.0000
-42 42 42 42 42 42 42 42 42 42 42.0000
-43 43 43 43 43 43 43 43 43 43 43.0000
-50 50 50 50 50 50 50 50 50 50 50.0000
-51 51 51 51 51 51 51 51 51 51 51.0000
-52 52 52 52 52 52 52 52 52 52 52.0000
-53 53 53 53 53 53 53 53 53 53 53.0000
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-test_sequence
--- select .. where numeric column = .. --
-set @arg00= 20;
-select 'true' as found from t9
-where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
-and c8= 20 and c9= 20 and c10= 20 and c12= 20;
-found
-true
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
- and c8= 20 and c9= 20 and c10= 20 and c12= 20 ";
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20.0;
-select 'true' as found from t9
-where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
-and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0;
-found
-true
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
- and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 ";
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-select 'true' as found from t9
-where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
- and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20';
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
- and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' ";
-execute stmt1 ;
-found
-true
-set @arg00= '20';
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-select 'true' as found from t9
-where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
-c3= CAST('20' as binary) and c4= CAST('20' as binary) and
-c5= CAST('20' as binary) and c6= CAST('20' as binary) and
-c7= CAST('20' as binary) and c8= CAST('20' as binary) and
-c9= CAST('20' as binary) and c10= CAST('20' as binary) and
-c12= CAST('20' as binary);
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
- c3= CAST('20' as binary) and c4= CAST('20' as binary) and
- c5= CAST('20' as binary) and c6= CAST('20' as binary) and
- c7= CAST('20' as binary) and c8= CAST('20' as binary) and
- c9= CAST('20' as binary) and c10= CAST('20' as binary) and
- c12= CAST('20' as binary) ";
-execute stmt1 ;
-found
-true
-set @arg00= CAST('20' as binary) ;
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-delete from t9 ;
-test_sequence
--- some numeric overflow experiments --
-prepare my_insert from "insert into t9
- ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
-from t9 where c21 = 'O' ";
-prepare my_delete from "delete from t9 where c21 = 'O' ";
-set @arg00= 9223372036854775807 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
-c12 99999.9999
-execute my_delete ;
-set @arg00= '9223372036854775807' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
-c12 99999.9999
-execute my_delete ;
-set @arg00= -9223372036854775808 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
-c12 -9999.9999
-execute my_delete ;
-set @arg00= '-9223372036854775808' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
-c12 -9999.9999
-execute my_delete ;
-set @arg00= 1.11111111111111111111e+50 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
-c12 99999.9999
-execute my_delete ;
-set @arg00= '1.11111111111111111111e+50' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1265 Data truncated for column 'c1' at row 1
-Warning 1265 Data truncated for column 'c2' at row 1
-Warning 1265 Data truncated for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1265 Data truncated for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 1
-c2 1
-c3 1
-c4 1
-c5 1
-c6 1
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
-c12 99999.9999
-execute my_delete ;
-set @arg00= -1.11111111111111111111e+50 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
-c12 -9999.9999
-execute my_delete ;
-set @arg00= '-1.11111111111111111111e+50' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1265 Data truncated for column 'c1' at row 1
-Warning 1265 Data truncated for column 'c2' at row 1
-Warning 1265 Data truncated for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1265 Data truncated for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -1
-c2 -1
-c3 -1
-c4 -1
-c5 -1
-c6 -1
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
-c12 -9999.9999
-execute my_delete ;
-test_sequence
--- insert into string columns --
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30
-from t9 where c1 >= 20
-order by c1 ;
-c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30
-20 2 20 20 20 20 20 20 20 20 20 20
-21 2 21 21 21 21 21 21 21 21 21 21
-22 2 22 22 22 22 22 22 22 22 22 22
-23 2 23 23 23 23 23 23 23 23 23 23
-30 3 30 30 30 30 30 30 30 30 30 30
-31 3 31 31 31 31 31 31 31 31 31 31
-32 3 32 32 32 32 32 32 32 32 32 32
-33 3 33 33 33 33 33 33 33 33 33 33
-40 4 40 40 40 40 40 40 40 40 40 40
-41 4 41 41 41 41 41 41 41 41 41 41
-42 4 42 42 42 42 42 42 42 42 42 42
-43 4 43 43 43 43 43 43 43 43 43 43
-50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00
-51 5 51 51 51 51 51 51 51 51 51 51
-52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00
-53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00
-54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00
-55 5 55 55 55 55 55 55 55 55 55 55
-56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00
-57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-test_sequence
--- select .. where string column = .. --
-set @arg00= '20';
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
-c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
-c27= '20' and c28= '20' and c29= '20' and c30= '20' ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
- c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
- c27= '20' and c28= '20' and c29= '20' and c30= '20'" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= CAST('20' as binary);
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
-= CAST('20' as binary) and c21= CAST('20' as binary)
-and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
-c24= CAST('20' as binary) and c25= CAST('20' as binary) and
-c26= CAST('20' as binary) and c27= CAST('20' as binary) and
-c28= CAST('20' as binary) and c29= CAST('20' as binary) and
-c30= CAST('20' as binary) ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and
-c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
- = CAST('20' as binary) and c21= CAST('20' as binary)
- and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
- c24= CAST('20' as binary) and c25= CAST('20' as binary) and
- c26= CAST('20' as binary) and c27= CAST('20' as binary) and
- c28= CAST('20' as binary) and c29= CAST('20' as binary) and
- c30= CAST('20' as binary)" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and
- c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and
- c29= ? and c30= ?";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20;
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
-c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
-c27= 20 and c28= 20 and c29= 20 and c30= 20 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
- c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
- c27= 20 and c28= 20 and c29= 20 and c30= 20" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20.0;
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
-c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
-c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
- c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
- c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-delete from t9 ;
-test_sequence
--- insert into date/time columns --
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-select c1, c13, c14, c15, c16, c17 from t9 order by c1 ;
-c1 c13 c14 c15 c16 c17
-20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-60 NULL NULL 1991-01-01 01:01:01 NULL NULL
-61 NULL NULL 1991-01-01 01:01:01 NULL NULL
-62 NULL NULL 1991-01-01 01:01:01 NULL NULL
-63 NULL NULL 1991-01-01 01:01:01 NULL NULL
-71 NULL NULL 1991-01-01 01:01:01 NULL NULL
-73 NULL NULL 1991-01-01 01:01:01 NULL NULL
-81 NULL NULL 1991-01-01 01:01:01 NULL NULL
-83 NULL NULL 1991-01-01 01:01:01 NULL NULL
-test_sequence
--- select .. where date/time column = .. --
-set @arg00= '1991-01-01 01:01:01' ;
-select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
-c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
-c17= '1991-01-01 01:01:01' ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
-and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
- c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
- c17= '1991-01-01 01:01:01'" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
-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
-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
-c17= CAST('1991-01-01 01:01:01' as datetime) ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
-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
- 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
- c17= CAST('1991-01-01 01:01:01' as datetime)" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 1991 ;
-select 'true' as found from t9
-where c1= 20 and c17= 1991 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c17= 1991" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c17= ?" ;
-execute stmt1 using @arg00 ;
-found
-true
-set @arg00= 1.991e+3 ;
-select 'true' as found from t9
-where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and abs(c17 - @arg00) < 0.01 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and abs(c17 - ?) < 0.01" ;
-execute stmt1 using @arg00 ;
-found
-true
-drop table t1, t9;
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index 6b7cf4f5c18..e18f7745091 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -1670,6 +1670,9 @@ a b
1003 duplicate three
1004 duplicate four
delete from t1 where a >= 1000 ;
+set @1=1 ;
+set @2=2 ;
+set @100=100 ;
set @float=1.00;
set @five='five' ;
drop table if exists t2;
@@ -1923,7 +1926,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -2020,7 +2023,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2108,7 +2111,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2198,7 +2201,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
diff --git a/mysql-test/r/ps_3innodb.result.es b/mysql-test/r/ps_3innodb.result.es
deleted file mode 100644
index 9386f18a4df..00000000000
--- a/mysql-test/r/ps_3innodb.result.es
+++ /dev/null
@@ -1,3113 +0,0 @@
-use test;
-drop table if exists t1, t9 ;
-create table t1
-(
-a int, b varchar(30),
-primary key(a)
-) engine = 'InnoDB' ;
-create table t9
-(
-c1 tinyint, c2 smallint, c3 mediumint, c4 int,
-c5 integer, c6 bigint, c7 float, c8 double,
-c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp(14), c16 time,
-c17 year, c18 bit, c19 bool, c20 char,
-c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
-c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
-c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
-c32 set('monday', 'tuesday', 'wednesday'),
-primary key(c1)
-) engine = 'InnoDB' ;
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-test_sequence
------- simple select tests ------
-prepare stmt1 from ' select * from t9 order by c1 ' ;
-execute stmt1;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def test t9 t9 c1 c1 1 4 1 N 49155 0 63
-def test t9 t9 c2 c2 2 6 1 Y 32768 0 63
-def test t9 t9 c3 c3 9 9 1 Y 32768 0 63
-def test t9 t9 c4 c4 3 11 1 Y 32768 0 63
-def test t9 t9 c5 c5 3 11 1 Y 32768 0 63
-def test t9 t9 c6 c6 8 20 1 Y 32768 0 63
-def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
-def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
-def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
-def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 0 9 6 Y 32768 4 63
-def test t9 t9 c12 c12 0 10 6 Y 32768 4 63
-def test t9 t9 c13 c13 10 10 10 Y 128 0 63
-def test t9 t9 c14 c14 12 19 19 Y 128 0 63
-def test t9 t9 c15 c15 7 19 19 N 1249 0 63
-def test t9 t9 c16 c16 11 8 8 Y 128 0 63
-def test t9 t9 c17 c17 13 4 4 Y 32864 0 63
-def test t9 t9 c18 c18 1 1 1 Y 32768 0 63
-def test t9 t9 c19 c19 1 1 1 Y 32768 0 63
-def test t9 t9 c20 c20 254 1 1 Y 0 0 8
-def test t9 t9 c21 c21 253 10 10 Y 0 0 8
-def test t9 t9 c22 c22 253 30 30 Y 0 0 8
-def test t9 t9 c23 c23 252 255 8 Y 144 0 63
-def test t9 t9 c24 c24 252 255 8 Y 16 0 8
-def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
-def test t9 t9 c26 c26 252 65535 4 Y 16 0 8
-def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63
-def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8
-def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63
-def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8
-def test t9 t9 c31 c31 254 5 3 Y 256 0 8
-def test t9 t9 c32 c32 254 24 7 Y 2048 0 8
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
-set @arg00='SELECT' ;
-prepare stmt1 from ' ? a from t1 where a=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 '? a from t1 where a=1' at line 1
-set @arg00=1 ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-1 one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-1 one
-set @arg00='lion' ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-lion one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-lion one
-set @arg00=NULL ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-NULL one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-NULL one
-set @arg00=1 ;
-select b, a - @arg00 from t1 where a=1 ;
-b a - @arg00
-one 0
-prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-b a - ?
-one 0
-set @arg00=null ;
-select @arg00 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select ? as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-select @arg00 + 1 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select ? + 1 as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-select 1 + @arg00 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select 1 + ? as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-set @arg00='MySQL' ;
-select substr(@arg00,1,2) from t1 where a=1 ;
-substr(@arg00,1,2)
-My
-prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr(?,1,2)
-My
-set @arg00=3 ;
-select substr('MySQL',@arg00,5) from t1 where a=1 ;
-substr('MySQL',@arg00,5)
-SQL
-prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr('MySQL',?,5)
-SQL
-select substr('MySQL',1,@arg00) from t1 where a=1 ;
-substr('MySQL',1,@arg00)
-MyS
-prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr('MySQL',1,?)
-MyS
-set @arg00='MySQL' ;
-select a , concat(@arg00,b) from t1 order by a;
-a concat(@arg00,b)
-1 MySQLone
-2 MySQLtwo
-3 MySQLthree
-4 MySQLfour
-prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ;
-execute stmt1 using @arg00;
-a concat(?,b)
-1 MySQLone
-2 MySQLtwo
-3 MySQLthree
-4 MySQLfour
-select a , concat(b,@arg00) from t1 order by a ;
-a concat(b,@arg00)
-1 oneMySQL
-2 twoMySQL
-3 threeMySQL
-4 fourMySQL
-prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ;
-execute stmt1 using @arg00;
-a concat(b,?)
-1 oneMySQL
-2 twoMySQL
-3 threeMySQL
-4 fourMySQL
-set @arg00='MySQL' ;
-select group_concat(@arg00,b order by a) from t1
-group by 'a' ;
-group_concat(@arg00,b order by a)
-MySQLone,MySQLtwo,MySQLthree,MySQLfour
-prepare stmt1 from ' select group_concat(?,b order by a) from t1
-group by ''a'' ' ;
-execute stmt1 using @arg00;
-group_concat(?,b order by a)
-MySQLone,MySQLtwo,MySQLthree,MySQLfour
-select group_concat(b,@arg00 order by a) from t1
-group by 'a' ;
-group_concat(b,@arg00 order by a)
-oneMySQL,twoMySQL,threeMySQL,fourMySQL
-prepare stmt1 from ' select group_concat(b,? order by a) from t1
-group by ''a'' ' ;
-execute stmt1 using @arg00;
-group_concat(b,? order by a)
-oneMySQL,twoMySQL,threeMySQL,fourMySQL
-set @arg00='first' ;
-set @arg01='second' ;
-set @arg02=NULL;
-select @arg00, @arg01 from t1 where a=1 ;
-@arg00 @arg01
-first second
-prepare stmt1 from ' select ?, ? from t1 where a=1 ' ;
-execute stmt1 using @arg00, @arg01 ;
-? ?
-first second
-execute stmt1 using @arg02, @arg01 ;
-? ?
-NULL second
-execute stmt1 using @arg00, @arg02 ;
-? ?
-first NULL
-execute stmt1 using @arg02, @arg02 ;
-? ?
-NULL NULL
-drop table if exists t5 ;
-create table t5 (id1 int(11) not null default '0',
-value2 varchar(100), value1 varchar(100)) ;
-insert into t5 values (1,'hh','hh'),(2,'hh','hh'),
-(1,'ii','ii'),(2,'ii','ii') ;
-prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ;
-set @arg00=1 ;
-set @arg01='hh' ;
-execute stmt1 using @arg00, @arg01 ;
-id1 value1
-1 hh
-1 ii
-2 hh
-drop table t5 ;
-drop table if exists t5 ;
-create table t5(session_id char(9) not null) ;
-insert into t5 values ('abc') ;
-prepare stmt1 from ' select * from t5
-where ?=''1111'' and session_id = ''abc'' ' ;
-set @arg00='abc' ;
-execute stmt1 using @arg00 ;
-session_id
-set @arg00='1111' ;
-execute stmt1 using @arg00 ;
-session_id
-abc
-set @arg00='abc' ;
-execute stmt1 using @arg00 ;
-session_id
-drop table t5 ;
-set @arg00='FROM' ;
-select a @arg00 t1 where a=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 '@arg00 t1 where a=1' at line 1
-prepare stmt1 from ' select a ? t1 where a=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 '? t1 where a=1' at line 1
-set @arg00='t1' ;
-select a from @arg00 where a=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 '@arg00 where a=1' at line 1
-prepare stmt1 from ' select a from ? where a=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 '? where a=1' at line 1
-set @arg00='WHERE' ;
-select a from t1 @arg00 a=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 '@arg00 a=1' at line 1
-prepare stmt1 from ' select a from t1 ? a=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 '? a=1' at line 1
-set @arg00=1 ;
-select a FROM t1 where a=@arg00 ;
-a
-1
-prepare stmt1 from ' select a FROM t1 where a=? ' ;
-execute stmt1 using @arg00 ;
-a
-1
-set @arg00=1000 ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=NULL ;
-select a FROM t1 where a=@arg00 ;
-a
-prepare stmt1 from ' select a FROM t1 where a=? ' ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=4 ;
-select a FROM t1 where a=sqrt(@arg00) ;
-a
-2
-prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
-execute stmt1 using @arg00 ;
-a
-2
-set @arg00=NULL ;
-select a FROM t1 where a=sqrt(@arg00) ;
-a
-prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=2 ;
-set @arg01=3 ;
-select a FROM t1 where a in (@arg00,@arg01) order by a;
-a
-2
-3
-prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a ';
-execute stmt1 using @arg00, @arg01;
-a
-2
-3
-set @arg00= 'one' ;
-set @arg01= 'two' ;
-set @arg02= 'five' ;
-prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ;
-execute stmt1 using @arg00, @arg01, @arg02 ;
-b
-one
-two
-prepare stmt1 from ' select b FROM t1 where b like ? ';
-set @arg00='two' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00='tw%' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00='%wo' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00=null ;
-insert into t9 set c1= 0, c5 = NULL ;
-select c5 from t9 where c5 > NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 > ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 < NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 < ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 = NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 = ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 <=> NULL ;
-c5
-NULL
-prepare stmt1 from ' select c5 from t9 where c5 <=> ? ';
-execute stmt1 using @arg00 ;
-c5
-NULL
-delete from t9 where c1= 0 ;
-set @arg00='>' ;
-select a FROM t1 where a @arg00 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 '@arg00 1' at line 1
-prepare stmt1 from ' select a FROM t1 where a ? 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 '? 1' at line 1
-set @arg00=1 ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL group by a - @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL group by a - ? ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00='two' ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL having b <> @arg00 order by a ;
-a b
-1 one
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL having b <> ? order by a ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-3 three
-4 four
-set @arg00=1 ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL order by a - @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL order by a - ? ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=2 ;
-select a,b from t1 order by 2 ;
-a b
-4 four
-1 one
-3 three
-2 two
-prepare stmt1 from ' select a,b from t1
-order by ? ';
-execute stmt1 using @arg00;
-a b
-4 four
-1 one
-3 three
-2 two
-set @arg00=1 ;
-execute stmt1 using @arg00;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=0 ;
-execute stmt1 using @arg00;
-ERROR 42S22: Unknown column '?' in 'order clause'
-set @arg00=1;
-prepare stmt1 from ' select a,b from t1 order by a
-limit 1 ';
-execute stmt1 ;
-a b
-1 one
-prepare stmt1 from ' select a,b from t1
-limit ? ';
-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 2
-set @arg00='b' ;
-set @arg01=0 ;
-set @arg02=2 ;
-set @arg03=2 ;
-select sum(a), @arg00 from t1 where a > @arg01
-and b is not null group by substr(b,@arg02)
-having sum(a) <> @arg03 ;
-sum(a) @arg00
-3 b
-1 b
-4 b
-prepare stmt1 from ' select sum(a), ? from t1 where a > ?
-and b is not null group by substr(b,?)
-having sum(a) <> ? ';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03;
-sum(a) ?
-3 b
-1 b
-4 b
-test_sequence
------- join tests ------
-select first.a as a1, second.a as a2
-from t1 first, t1 second
-where first.a = second.a order by a1 ;
-a1 a2
-1 1
-2 2
-3 3
-4 4
-prepare stmt1 from ' select first.a as a1, second.a as a2
- from t1 first, t1 second
- where first.a = second.a order by a1 ';
-execute stmt1 ;
-a1 a2
-1 1
-2 2
-3 3
-4 4
-set @arg00='ABC';
-set @arg01='two';
-set @arg02='one';
-select first.a, @arg00, second.a FROM t1 first, t1 second
-where @arg01 = first.b or first.a = second.a or second.b = @arg02
-order by second.a, first.a;
-a @arg00 a
-1 ABC 1
-2 ABC 1
-3 ABC 1
-4 ABC 1
-2 ABC 2
-2 ABC 3
-3 ABC 3
-2 ABC 4
-4 ABC 4
-prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
- where ? = first.b or first.a = second.a or second.b = ?
- order by second.a, first.a';
-execute stmt1 using @arg00, @arg01, @arg02;
-a ? a
-1 ABC 1
-2 ABC 1
-3 ABC 1
-4 ABC 1
-2 ABC 2
-2 ABC 3
-3 ABC 3
-2 ABC 4
-4 ABC 4
-drop table if exists t2 ;
-create table t2 as select * from t1 ;
-set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ;
-set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ;
-set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ;
-set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ;
-set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ;
-set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ;
-set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ;
-set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ;
-set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ;
-the join statement is:
-SELECT * FROM t2 right join t1 using(a) order by t2.a
-prepare stmt1 from @query9 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural right join t1 order by t2.a
-prepare stmt1 from @query8 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a
-prepare stmt1 from @query7 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 left join t1 using(a) order by t2.a
-prepare stmt1 from @query6 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural left join t1 order by t2.a
-prepare stmt1 from @query5 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a
-prepare stmt1 from @query4 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 join t1 using(a) order by t2.a
-prepare stmt1 from @query3 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural join t1 order by t2.a
-prepare stmt1 from @query2 ;
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-the join statement is:
-SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a
-prepare stmt1 from @query1 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-drop table t2 ;
-test_sequence
------- subquery tests ------
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ''two'') ';
-execute stmt1 ;
-a b
-2 two
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = 'two' ) and b=@arg00 ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ''two'') and b=? ';
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = @arg00 ) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ? ) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=3 ;
-set @arg01='three' ;
-select a,b FROM t1 where (a,b) in (select 3, 'three');
-a b
-3 three
-select a FROM t1 where (a,b) in (select @arg00,@arg01);
-a
-3
-prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) ';
-execute stmt1 using @arg00, @arg01;
-a
-3
-set @arg00=1 ;
-set @arg01='two' ;
-set @arg02=2 ;
-set @arg03='two' ;
-select a, @arg00, b FROM t1 outer_table where
-b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ;
-a @arg00 b
-2 1 two
-prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
- b=? and a = (select ? from t1 where b = ? ) ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-a ? b
-2 1 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = outer_table.b ) order by a ';
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = outer_table.b ) and b=@arg00 ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = outer_table.b) and b=? ';
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=2 ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=2 ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=1 ;
-set @arg01='two' ;
-set @arg02=2 ;
-set @arg03='two' ;
-select a, @arg00, b FROM t1 outer_table where
-b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03
-and outer_table.a=a ) ;
-a @arg00 b
-2 1 two
-prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
- b=? and a = (select ? from t1 where outer_table.b = ?
- and outer_table.a=a ) ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-a ? b
-2 1 two
-set @arg00=1 ;
-set @arg01=0 ;
-select a, @arg00
-from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2
-where a=@arg01;
-a @arg00
-0 1
-prepare stmt1 from ' select a, ?
- from ( select a - ? as a from t1 where a=? ) as t2
- where a=? ';
-execute stmt1 using @arg00, @arg00, @arg00, @arg01 ;
-a ?
-0 1
-drop table if exists t2 ;
-create table t2 as select * from t1;
-prepare stmt1 from ' select a in (select a from t2) from t1 ' ;
-execute stmt1 ;
-a in (select a from t2)
-1
-1
-1
-1
-drop table if exists t5, t6, t7 ;
-create table t5 (a int , b int) ;
-create table t6 like t5 ;
-create table t7 like t5 ;
-insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7),
-(2, -1), (3, 10) ;
-insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ;
-insert into t7 values (3, 3), (2, 2), (1, 1) ;
-prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1) from t7 ' ;
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-drop table t5, t6, t7 ;
-drop table if exists t2 ;
-create table t2 as select * from t9;
-set @stmt= ' SELECT
- (SELECT SUM(c1 + c12 + 0.0) FROM t2
- where (t9.c2 - 0e-3) = t2.c2
- GROUP BY t9.c15 LIMIT 1) as scalar_s,
- exists (select 1.0e+0 from t2
- where t2.c3 * 9.0000000000 = t9.c4) as exists_s,
- c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s,
- (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s
-FROM t9,
-(select c25 x, c32 y from t2) tt WHERE x = c25 ' ;
-prepare stmt1 from @stmt ;
-execute stmt1 ;
-execute stmt1 ;
-set @stmt= concat('explain ',@stmt);
-prepare stmt1 from @stmt ;
-execute stmt1 ;
-execute stmt1 ;
-set @stmt= ' SELECT
- (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2
- GROUP BY t9.c15 LIMIT 1) as scalar_s,
- exists (select ? from t2
- where t2.c3*?=t9.c4) as exists_s,
- c5*? in (select c6+? from t2) as in_s,
- (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s
-FROM t9,
-(select c25 x, c32 y from t2) tt WHERE x =c25 ' ;
-set @arg00= 0.0 ;
-set @arg01= 0e-3 ;
-set @arg02= 1.0e+0 ;
-set @arg03= 9.0000000000 ;
-set @arg04= 4 ;
-set @arg05= 0.3e+1 ;
-set @arg06= 4 ;
-set @arg07= 4 ;
-set @arg08= 4.0 ;
-set @arg09= 40e-1 ;
-prepare stmt1 from @stmt ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-set @stmt= concat('explain ',@stmt);
-prepare stmt1 from @stmt ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-drop table t2 ;
-select 1 < (select a from t1) ;
-ERROR 21000: Subquery returns more than 1 row
-prepare stmt1 from ' select 1 < (select a from t1) ' ;
-execute stmt1 ;
-ERROR 21000: Subquery returns more than 1 row
-select 1 as my_col ;
-my_col
-1
-test_sequence
------- union tests ------
-prepare stmt1 from ' select a FROM t1 where a=1
- union distinct
- select a FROM t1 where a=1 ';
-execute stmt1 ;
-a
-1
-execute stmt1 ;
-a
-1
-prepare stmt1 from ' select a FROM t1 where a=1
- union all
- select a FROM t1 where a=1 ';
-execute stmt1 ;
-a
-1
-1
-prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-set @arg00=1 ;
-select @arg00 FROM t1 where a=1
-union distinct
-select 1 FROM t1 where a=1;
-@arg00
-1
-prepare stmt1 from ' select ? FROM t1 where a=1
- union distinct
- select 1 FROM t1 where a=1 ' ;
-execute stmt1 using @arg00;
-?
-1
-set @arg00=1 ;
-select 1 FROM t1 where a=1
-union distinct
-select @arg00 FROM t1 where a=1;
-1
-1
-prepare stmt1 from ' select 1 FROM t1 where a=1
- union distinct
- select ? FROM t1 where a=1 ' ;
-execute stmt1 using @arg00;
-1
-1
-set @arg00='a' ;
-select @arg00 FROM t1 where a=1
-union distinct
-select @arg00 FROM t1 where a=1;
-@arg00
-a
-prepare stmt1 from ' select ? FROM t1 where a=1
- union distinct
- select ? FROM t1 where a=1 ';
-execute stmt1 using @arg00, @arg00;
-?
-a
-prepare stmt1 from ' select ?
- union distinct
- select ? ';
-execute stmt1 using @arg00, @arg00;
-?
-a
-set @arg00='a' ;
-set @arg01=1 ;
-set @arg02='a' ;
-set @arg03=2 ;
-select @arg00 FROM t1 where a=@arg01
-union distinct
-select @arg02 FROM t1 where a=@arg03;
-@arg00
-a
-prepare stmt1 from ' select ? FROM t1 where a=?
- union distinct
- select ? FROM t1 where a=? ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03;
-?
-a
-set @arg00=1 ;
-prepare stmt1 from ' select sum(a) + 200, ? from t1
-union distinct
-select sum(a) + 200, 1 from t1
-group by b ' ;
-execute stmt1 using @arg00;
-sum(a) + 200 ?
-210 1
-204 1
-201 1
-203 1
-202 1
-set @Oporto='Oporto' ;
-set @Lisboa='Lisboa' ;
-set @0=0 ;
-set @1=1 ;
-set @2=2 ;
-set @3=3 ;
-set @4=4 ;
-select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ;
-@Oporto @Lisboa @0 @1 @2 @3 @4
-Oporto Lisboa 0 1 2 3 4
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-group by b
-union distinct
-select sum(a) + 200, @Lisboa from t1
-group by b ;
-the_sum the_town
-204 Oporto
-201 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-201 Lisboa
-203 Lisboa
-202 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- group by b
- union distinct
- select sum(a) + 200, ? from t1
- group by b ' ;
-execute stmt1 using @Oporto, @Lisboa;
-the_sum the_town
-204 Oporto
-201 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-201 Lisboa
-203 Lisboa
-202 Lisboa
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-where a > @1
-group by b
-union distinct
-select sum(a) + 200, @Lisboa from t1
-where a > @2
-group by b ;
-the_sum the_town
-204 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-203 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- where a > ?
- group by b
- union distinct
- select sum(a) + 200, ? from t1
- where a > ?
- group by b ' ;
-execute stmt1 using @Oporto, @1, @Lisboa, @2;
-the_sum the_town
-204 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-203 Lisboa
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-where a > @1
-group by b
-having avg(a) > @2
-union distinct
-select sum(a) + 200, @Lisboa from t1
-where a > @2
-group by b
-having avg(a) > @3;
-the_sum the_town
-204 Oporto
-203 Oporto
-204 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- where a > ?
- group by b
- having avg(a) > ?
- union distinct
- select sum(a) + 200, ? from t1
- where a > ?
- group by b
- having avg(a) > ? ';
-execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3;
-the_sum the_town
-204 Oporto
-203 Oporto
-204 Lisboa
-test_sequence
------- explain select tests ------
-prepare stmt1 from ' explain select * from t9 ' ;
-execute stmt1;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def id 8 3 1 N 32801 0 8
-def select_type 253 19 6 N 1 31 33
-def table 253 64 2 N 1 31 33
-def type 253 10 3 N 1 31 33
-def possible_keys 253 4096 0 Y 0 31 33
-def key 253 64 0 Y 0 31 33
-def key_len 8 3 0 Y 32800 0 8
-def ref 253 1024 0 Y 0 31 33
-def rows 8 10 1 N 32801 0 8
-def Extra 253 255 0 N 1 31 33
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t9 ALL NULL NULL NULL NULL 2
-test_sequence
------- delete tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'delete from t1 where a=2' ;
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-execute stmt1;
-insert into t1 values(0,NULL);
-set @arg00=NULL;
-prepare stmt1 from 'delete from t1 where b=?' ;
-execute stmt1 using @arg00;
-select a,b from t1 where b is NULL ;
-a b
-0 NULL
-set @arg00='one';
-execute stmt1 using @arg00;
-select a,b from t1 where b=@arg00;
-a b
-prepare stmt1 from 'truncate table t1' ;
-ERROR HY000: This command is not supported in the prepared statement protocol yet
-test_sequence
------- update tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ;
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-2 a=two
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-2 a=two
-set @arg00=NULL;
-prepare stmt1 from 'update t1 set b=? where a=2' ;
-execute stmt1 using @arg00;
-select a,b from t1 where a=2;
-a b
-2 NULL
-set @arg00='two';
-execute stmt1 using @arg00;
-select a,b from t1 where a=2;
-a b
-2 two
-set @arg00=2;
-prepare stmt1 from 'update t1 set b=NULL where a=?' ;
-execute stmt1 using @arg00;
-select a,b from t1 where a=@arg00;
-a b
-2 NULL
-update t1 set b='two' where a=@arg00;
-set @arg00=2000;
-execute stmt1 using @arg00;
-select a,b from t1 where a=@arg00;
-a b
-set @arg00=2;
-set @arg01=22;
-prepare stmt1 from 'update t1 set a=? where a=?' ;
-execute stmt1 using @arg00, @arg00;
-select a,b from t1 where a=@arg00;
-a b
-2 two
-execute stmt1 using @arg01, @arg00;
-select a,b from t1 where a=@arg01;
-a b
-22 two
-execute stmt1 using @arg00, @arg01;
-select a,b from t1 where a=@arg00;
-a b
-2 two
-set @arg00=NULL;
-set @arg01=2;
-execute stmt1 using @arg00, @arg01;
-Warnings:
-Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
-select a,b from t1 order by a;
-a b
-0 two
-1 one
-3 three
-4 four
-set @arg00=0;
-execute stmt1 using @arg01, @arg00;
-select a,b from t1 order by a;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=23;
-set @arg01='two';
-set @arg02=2;
-set @arg03='two';
-set @arg04=2;
-drop table if exists t2;
-create table t2 as select a,b from t1 ;
-prepare stmt1 from 'update t1 set a=? where b=?
- and a in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 where a = @arg00 ;
-a b
-23 two
-prepare stmt1 from 'update t1 set a=? where b=?
- and a not in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 order by a ;
-a b
-1 one
-2 two
-3 three
-4 four
-drop table t2 ;
-create table t2
-(
-a int, b varchar(30),
-primary key(a)
-) engine = 'InnoDB' ;
-insert into t2(a,b) select a, b from t1 ;
-prepare stmt1 from 'update t1 set a=? where b=?
- and a in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 where a = @arg00 ;
-a b
-23 two
-prepare stmt1 from 'update t1 set a=? where b=?
- and a not in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 order by a ;
-a b
-1 one
-2 two
-3 three
-4 four
-drop table t2 ;
-set @arg00=1;
-prepare stmt1 from 'update t1 set b=''bla''
-where a=2
-limit 1';
-execute stmt1 ;
-select a,b from t1 where b = 'bla' ;
-a b
-2 bla
-prepare stmt1 from 'update t1 set b=''bla''
-where a=2
-limit ?';
-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 3
-test_sequence
------- insert tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'insert into t1 values(5, ''five'' )';
-execute stmt1;
-select a,b from t1 where a = 5;
-a b
-5 five
-set @arg00='six' ;
-prepare stmt1 from 'insert into t1 values(6, ? )';
-execute stmt1 using @arg00;
-select a,b from t1 where b = @arg00;
-a b
-6 six
-execute stmt1 using @arg00;
-ERROR 23000: Duplicate entry '6' for key 1
-set @arg00=NULL ;
-prepare stmt1 from 'insert into t1 values(0, ? )';
-execute stmt1 using @arg00;
-select a,b from t1 where b is NULL;
-a b
-0 NULL
-set @arg00=8 ;
-set @arg01='eight' ;
-prepare stmt1 from 'insert into t1 values(?, ? )';
-execute stmt1 using @arg00, @arg01 ;
-select a,b from t1 where b = @arg01;
-a b
-8 eight
-set @NULL= null ;
-set @arg00= 'abc' ;
-execute stmt1 using @NULL, @NULL ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @NULL ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @arg00 ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @arg00 ;
-ERROR 23000: Column 'a' cannot be null
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @arg00 ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @arg00 ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 abc
-10002 abc
-delete from t1 where a > 10000 ;
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @NULL ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @NULL ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 NULL
-10002 NULL
-delete from t1 where a > 10000 ;
-set @arg01= 10000 + 10 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 9 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 8 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 7 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 6 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 5 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 4 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 3 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @arg01 ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 10001
-10002 10002
-10003 10003
-10004 10004
-10005 10005
-10006 10006
-10007 10007
-10008 10008
-10009 10009
-10010 10010
-delete from t1 where a > 10000 ;
-set @arg00=81 ;
-set @arg01='8-1' ;
-set @arg02=82 ;
-set @arg03='8-2' ;
-prepare stmt1 from 'insert into t1 values(?,?),(?,?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-select a,b from t1 where a in (@arg00,@arg02) ;
-a b
-81 8-1
-82 8-2
-set @arg00=9 ;
-set @arg01='nine' ;
-prepare stmt1 from 'insert into t1 set a=?, b=? ';
-execute stmt1 using @arg00, @arg01 ;
-select a,b from t1 where a = @arg00 ;
-a b
-9 nine
-set @arg00=6 ;
-set @arg01=1 ;
-prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
- on duplicate key update a=a + ?, b=concat(b,''modified'') ';
-execute stmt1 using @arg00, @arg01;
-select * from t1 order by a;
-a b
-0 NULL
-1 one
-2 two
-3 three
-4 four
-5 five
-7 sixmodified
-8 eight
-9 nine
-81 8-1
-82 8-2
-set @arg00=81 ;
-set @arg01=1 ;
-execute stmt1 using @arg00, @arg01;
-ERROR 23000: Duplicate entry '82' for key 1
-drop table if exists t2 ;
-create table t2 (id int auto_increment primary key)
-ENGINE= 'InnoDB' ;
-prepare stmt1 from ' select last_insert_id() ' ;
-insert into t2 values (NULL) ;
-execute stmt1 ;
-last_insert_id()
-1
-insert into t2 values (NULL) ;
-execute stmt1 ;
-last_insert_id()
-2
-drop table t2 ;
-set @1000=1000 ;
-set @x1000_2="x1000_2" ;
-set @x1000_3="x1000_3" ;
-set @x1000="x1000" ;
-set @1100=1100 ;
-set @x1100="x1100" ;
-set @100=100 ;
-set @updated="updated" ;
-insert into t1 values(1000,'x1000_1') ;
-insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
-on duplicate key update a = a + @100, b = concat(b,@updated) ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 x1000_3
-1100 x1000_1updated
-delete from t1 where a >= 1000 ;
-insert into t1 values(1000,'x1000_1') ;
-prepare stmt1 from ' insert into t1 values(?,?),(?,?)
- on duplicate key update a = a + ?, b = concat(b,?) ';
-execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 x1000_3
-1100 x1000_1updated
-delete from t1 where a >= 1000 ;
-insert into t1 values(1000,'x1000_1') ;
-execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1200 x1000_1updatedupdated
-delete from t1 where a >= 1000 ;
-prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
-execute stmt1;
-execute stmt1;
-execute stmt1;
-test_sequence
------- multi table tests ------
-delete from t1 ;
-delete from t9 ;
-insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ;
-insert into t9 (c1,c21)
-values (1, 'one'), (2, 'two'), (3, 'three') ;
-prepare stmt_delete from " delete t1, t9
- from t1, t9 where t1.a=t9.c1 and t1.b='updated' ";
-prepare stmt_update from " update t1, t9
- set t1.b='updated', t9.c21='updated'
- where t1.a=t9.c1 and t1.a=? ";
-prepare stmt_select1 from " select a, b from t1 order by a" ;
-prepare stmt_select2 from " select c1, c21 from t9 order by c1" ;
-set @arg00= 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-2 two
-3 three
-execute stmt_select2 ;
-c1 c21
-2 two
-3 three
-set @arg00= @arg00 + 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-3 three
-execute stmt_select2 ;
-c1 c21
-3 three
-set @arg00= @arg00 + 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-execute stmt_select2 ;
-c1 c21
-set @arg00= @arg00 + 1 ;
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-insert into t1 values(0,NULL) ;
-set @duplicate='duplicate ' ;
-set @1000=1000 ;
-set @5=5 ;
-select a,b from t1 where a < 5 order by a ;
-a b
-0 NULL
-1 one
-2 two
-3 three
-4 four
-insert into t1 select a + @1000, concat(@duplicate,b) from t1
-where a < @5 ;
-affected rows: 5
-info: Records: 5 Duplicates: 0 Warnings: 0
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 NULL
-1001 duplicate one
-1002 duplicate two
-1003 duplicate three
-1004 duplicate four
-delete from t1 where a >= 1000 ;
-prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
-where a < ? ' ;
-execute stmt1 using @1000, @duplicate, @5;
-affected rows: 5
-info: Records: 5 Duplicates: 0 Warnings: 0
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 NULL
-1001 duplicate one
-1002 duplicate two
-1003 duplicate three
-1004 duplicate four
-delete from t1 where a >= 1000 ;
-set @float=1.00;
-set @five='five' ;
-drop table if exists t2;
-create table t2 like t1 ;
-insert into t2 (b,a)
-select @duplicate, sum(first.a) from t1 first, t1 second
-where first.a <> @5 and second.b = first.b
-and second.b <> @five
-group by second.b
-having sum(second.a) > @2
-union
-select b, a + @100 from t1
-where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
-from t1);
-affected rows: 3
-info: Records: 3 Duplicates: 0 Warnings: 0
-select a,b from t2 order by a ;
-a b
-3 duplicate
-4 duplicate
-103 three
-delete from t2 ;
-prepare stmt1 from ' insert into t2 (b,a)
-select ?, sum(first.a)
- from t1 first, t1 second
- where first.a <> ? and second.b = first.b and second.b <> ?
- group by second.b
- having sum(second.a) > ?
-union
-select b, a + ? from t1
- where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b
- from t1 ) ' ;
-execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
-affected rows: 3
-info: Records: 3 Duplicates: 0 Warnings: 0
-select a,b from t2 order by a ;
-a b
-3 duplicate
-4 duplicate
-103 three
-drop table t2;
-drop table if exists t5 ;
-set @arg01= 8;
-set @arg02= 8.0;
-set @arg03= 80.00000000000e-1;
-set @arg04= 'abc' ;
-set @arg05= CAST('abc' as binary) ;
-set @arg06= '1991-08-05' ;
-set @arg07= CAST('1991-08-05' as date);
-set @arg08= '1991-08-05 01:01:01' ;
-set @arg09= CAST('1991-08-05 01:01:01' as datetime) ;
-set @arg10= unix_timestamp('1991-01-01 01:01:01');
-set @arg11= YEAR('1991-01-01 01:01:01');
-set @arg12= 8 ;
-set @arg12= NULL ;
-set @arg13= 8.0 ;
-set @arg13= NULL ;
-set @arg14= 'abc';
-set @arg14= NULL ;
-set @arg15= CAST('abc' as binary) ;
-set @arg15= NULL ;
-create table t5 as select
-8 as const01, @arg01 as param01,
-8.0 as const02, @arg02 as param02,
-80.00000000000e-1 as const03, @arg03 as param03,
-'abc' as const04, @arg04 as param04,
-CAST('abc' as binary) as const05, @arg05 as param05,
-'1991-08-05' as const06, @arg06 as param06,
-CAST('1991-08-05' as date) as const07, @arg07 as param07,
-'1991-08-05 01:01:01' as const08, @arg08 as param08,
-CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09,
-unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10,
-YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11,
-NULL as const12, @arg12 as param12,
-@arg13 as param13,
-@arg14 as param14,
-@arg15 as param15;
-show create table t5 ;
-Table Create Table
-t5 CREATE TABLE `t5` (
- `const01` bigint(1) NOT NULL default '0',
- `param01` bigint(20) default NULL,
- `const02` double(3,1) NOT NULL default '0.0',
- `param02` double default NULL,
- `const03` double NOT NULL default '0',
- `param03` double default NULL,
- `const04` char(3) NOT NULL default '',
- `param04` longtext,
- `const05` binary(3) NOT NULL default '',
- `param05` longblob,
- `const06` varchar(10) NOT NULL default '',
- `param06` longtext,
- `const07` date default NULL,
- `param07` longblob,
- `const08` varchar(19) NOT NULL default '',
- `param08` longtext,
- `const09` datetime default NULL,
- `param09` longblob,
- `const10` int(10) NOT NULL default '0',
- `param10` bigint(20) default NULL,
- `const11` int(4) default NULL,
- `param11` bigint(20) default NULL,
- `const12` binary(0) default NULL,
- `param12` bigint(20) default NULL,
- `param13` double default NULL,
- `param14` longtext,
- `param15` longblob
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-select * from t5 ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def test t5 t5 const01 const01 8 1 1 N 32769 0 63
-def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 5 3 3 N 32769 1 63
-def test t5 t5 param02 param02 5 20 1 Y 32768 31 63
-def test t5 t5 const03 const03 5 23 1 N 32769 31 63
-def test t5 t5 param03 param03 5 20 1 Y 32768 31 63
-def test t5 t5 const04 const04 254 3 3 N 1 0 8
-def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8
-def test t5 t5 const05 const05 254 3 3 N 129 0 63
-def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63
-def test t5 t5 const06 const06 253 10 10 N 1 0 8
-def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8
-def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63
-def test t5 t5 const08 const08 253 19 19 N 1 0 8
-def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8
-def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63
-def test t5 t5 const10 const10 3 10 9 N 32769 0 63
-def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
-def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
-def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
-def test t5 t5 const12 const12 254 0 0 Y 128 0 63
-def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
-def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
-def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
-const01 8
-param01 8
-const02 8.0
-param02 8
-const03 8
-param03 8
-const04 abc
-param04 abc
-const05 abc
-param05 abc
-const06 1991-08-05
-param06 1991-08-05
-const07 1991-08-05
-param07 1991-08-05
-const08 1991-08-05 01:01:01
-param08 1991-08-05 01:01:01
-const09 1991-08-05 01:01:01
-param09 1991-08-05 01:01:01
-const10 662680861
-param10 662680861
-const11 1991
-param11 1991
-const12 NULL
-param12 NULL
-param13 NULL
-param14 NULL
-param15 NULL
-drop table t5 ;
-test_sequence
------- data type conversion tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ;
-select * from t9 order by c1 ;
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
-test_sequence
------- select @parameter:= column ------
-prepare full_info from "select @arg01, @arg02, @arg03, @arg04,
- @arg05, @arg06, @arg07, @arg08,
- @arg09, @arg10, @arg11, @arg12,
- @arg13, @arg14, @arg15, @arg16,
- @arg17, @arg18, @arg19, @arg20,
- @arg21, @arg22, @arg23, @arg24,
- @arg25, @arg26, @arg27, @arg28,
- @arg29, @arg30, @arg31, @arg32" ;
-select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
-@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
-@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
-@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
-@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
-@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
-@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
-@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= 1 ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
-@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
-@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
-@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
-@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
-@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
-@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
-@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= 0 ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select
- @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
- @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
- @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
- @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
- @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
- @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
- @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
- @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= ?" ;
-set @my_key= 1 ;
-execute stmt1 using @my_key ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-set @my_key= 0 ;
-execute stmt1 using @my_key ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select ? := c1 from t9 where c1= 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 ':= c1 from t9 where c1= 1' at line 1
-test_sequence
------- select column, .. into @parm,.. ------
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
-c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
-c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
-@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
-@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
-@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= 1 ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
-c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
-c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
-@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
-@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
-@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= 0 ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
- c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
- c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
- @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
- @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
- @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= ?" ;
-set @my_key= 1 ;
-execute stmt1 using @my_key ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-set @my_key= 0 ;
-execute stmt1 using @my_key ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select c1 into ? from t9 where c1= 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 '? from t9 where c1= 1' at line 1
-test_sequence
--- insert into numeric columns --
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ;
-set @arg00= 21 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ;
-execute stmt1 ;
-set @arg00= 23;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0,
-30.0, 30.0, 30.0 ) ;
-set @arg00= 31.0 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0,
- 32.0, 32.0, 32.0 )" ;
-execute stmt1 ;
-set @arg00= 33.0;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( '40', '40', '40', '40', '40', '40', '40', '40',
-'40', '40', '40' ) ;
-set @arg00= '41' ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( '42', '42', '42', '42', '42', '42', '42', '42',
- '42', '42', '42' )" ;
-execute stmt1 ;
-set @arg00= '43';
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ;
-set @arg00= CAST('51' as binary) ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ;
-execute stmt1 ;
-set @arg00= CAST('53' as binary) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 2 ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-NULL, NULL, NULL ) ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 61, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL )" ;
-execute stmt1 ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 8.0 ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 71, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 'abc' ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 81, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
-from t9 where c1 >= 20
-order by c1 ;
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12
-20 20 20 20 20 20 20 20 20 20 20.0000
-21 21 21 21 21 21 21 21 21 21 21.0000
-22 22 22 22 22 22 22 22 22 22 22.0000
-23 23 23 23 23 23 23 23 23 23 23.0000
-30 30 30 30 30 30 30 30 30 30 30.0000
-31 31 31 31 31 31 31 31 31 31 31.0000
-32 32 32 32 32 32 32 32 32 32 32.0000
-33 33 33 33 33 33 33 33 33 33 33.0000
-40 40 40 40 40 40 40 40 40 40 40.0000
-41 41 41 41 41 41 41 41 41 41 41.0000
-42 42 42 42 42 42 42 42 42 42 42.0000
-43 43 43 43 43 43 43 43 43 43 43.0000
-50 50 50 50 50 50 50 50 50 50 50.0000
-51 51 51 51 51 51 51 51 51 51 51.0000
-52 52 52 52 52 52 52 52 52 52 52.0000
-53 53 53 53 53 53 53 53 53 53 53.0000
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-test_sequence
--- select .. where numeric column = .. --
-set @arg00= 20;
-select 'true' as found from t9
-where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
-and c8= 20 and c9= 20 and c10= 20 and c12= 20;
-found
-true
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
- and c8= 20 and c9= 20 and c10= 20 and c12= 20 ";
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20.0;
-select 'true' as found from t9
-where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
-and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0;
-found
-true
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
- and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 ";
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-select 'true' as found from t9
-where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
- and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20';
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
- and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' ";
-execute stmt1 ;
-found
-true
-set @arg00= '20';
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-select 'true' as found from t9
-where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
-c3= CAST('20' as binary) and c4= CAST('20' as binary) and
-c5= CAST('20' as binary) and c6= CAST('20' as binary) and
-c7= CAST('20' as binary) and c8= CAST('20' as binary) and
-c9= CAST('20' as binary) and c10= CAST('20' as binary) and
-c12= CAST('20' as binary);
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
- c3= CAST('20' as binary) and c4= CAST('20' as binary) and
- c5= CAST('20' as binary) and c6= CAST('20' as binary) and
- c7= CAST('20' as binary) and c8= CAST('20' as binary) and
- c9= CAST('20' as binary) and c10= CAST('20' as binary) and
- c12= CAST('20' as binary) ";
-execute stmt1 ;
-found
-true
-set @arg00= CAST('20' as binary) ;
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-delete from t9 ;
-test_sequence
--- some numeric overflow experiments --
-prepare my_insert from "insert into t9
- ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
-from t9 where c21 = 'O' ";
-prepare my_delete from "delete from t9 where c21 = 'O' ";
-set @arg00= 9223372036854775807 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
-c12 99999.9999
-execute my_delete ;
-set @arg00= '9223372036854775807' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
-c12 99999.9999
-execute my_delete ;
-set @arg00= -9223372036854775808 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
-c12 -9999.9999
-execute my_delete ;
-set @arg00= '-9223372036854775808' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
-c12 -9999.9999
-execute my_delete ;
-set @arg00= 1.11111111111111111111e+50 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
-c12 99999.9999
-execute my_delete ;
-set @arg00= '1.11111111111111111111e+50' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1265 Data truncated for column 'c1' at row 1
-Warning 1265 Data truncated for column 'c2' at row 1
-Warning 1265 Data truncated for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1265 Data truncated for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 1
-c2 1
-c3 1
-c4 1
-c5 1
-c6 1
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
-c12 99999.9999
-execute my_delete ;
-set @arg00= -1.11111111111111111111e+50 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
-c12 -9999.9999
-execute my_delete ;
-set @arg00= '-1.11111111111111111111e+50' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1265 Data truncated for column 'c1' at row 1
-Warning 1265 Data truncated for column 'c2' at row 1
-Warning 1265 Data truncated for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1265 Data truncated for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -1
-c2 -1
-c3 -1
-c4 -1
-c5 -1
-c6 -1
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
-c12 -9999.9999
-execute my_delete ;
-test_sequence
--- insert into string columns --
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30
-from t9 where c1 >= 20
-order by c1 ;
-c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30
-20 2 20 20 20 20 20 20 20 20 20 20
-21 2 21 21 21 21 21 21 21 21 21 21
-22 2 22 22 22 22 22 22 22 22 22 22
-23 2 23 23 23 23 23 23 23 23 23 23
-30 3 30 30 30 30 30 30 30 30 30 30
-31 3 31 31 31 31 31 31 31 31 31 31
-32 3 32 32 32 32 32 32 32 32 32 32
-33 3 33 33 33 33 33 33 33 33 33 33
-40 4 40 40 40 40 40 40 40 40 40 40
-41 4 41 41 41 41 41 41 41 41 41 41
-42 4 42 42 42 42 42 42 42 42 42 42
-43 4 43 43 43 43 43 43 43 43 43 43
-50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00
-51 5 51 51 51 51 51 51 51 51 51 51
-52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00
-53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00
-54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00
-55 5 55 55 55 55 55 55 55 55 55 55
-56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00
-57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-test_sequence
--- select .. where string column = .. --
-set @arg00= '20';
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
-c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
-c27= '20' and c28= '20' and c29= '20' and c30= '20' ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
- c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
- c27= '20' and c28= '20' and c29= '20' and c30= '20'" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= CAST('20' as binary);
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
-= CAST('20' as binary) and c21= CAST('20' as binary)
-and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
-c24= CAST('20' as binary) and c25= CAST('20' as binary) and
-c26= CAST('20' as binary) and c27= CAST('20' as binary) and
-c28= CAST('20' as binary) and c29= CAST('20' as binary) and
-c30= CAST('20' as binary) ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and
-c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
- = CAST('20' as binary) and c21= CAST('20' as binary)
- and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
- c24= CAST('20' as binary) and c25= CAST('20' as binary) and
- c26= CAST('20' as binary) and c27= CAST('20' as binary) and
- c28= CAST('20' as binary) and c29= CAST('20' as binary) and
- c30= CAST('20' as binary)" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and
- c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and
- c29= ? and c30= ?";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20;
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
-c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
-c27= 20 and c28= 20 and c29= 20 and c30= 20 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
- c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
- c27= 20 and c28= 20 and c29= 20 and c30= 20" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20.0;
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
-c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
-c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
- c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
- c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-delete from t9 ;
-test_sequence
--- insert into date/time columns --
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-select c1, c13, c14, c15, c16, c17 from t9 order by c1 ;
-c1 c13 c14 c15 c16 c17
-20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-60 NULL NULL 1991-01-01 01:01:01 NULL NULL
-61 NULL NULL 1991-01-01 01:01:01 NULL NULL
-62 NULL NULL 1991-01-01 01:01:01 NULL NULL
-63 NULL NULL 1991-01-01 01:01:01 NULL NULL
-71 NULL NULL 1991-01-01 01:01:01 NULL NULL
-73 NULL NULL 1991-01-01 01:01:01 NULL NULL
-81 NULL NULL 1991-01-01 01:01:01 NULL NULL
-83 NULL NULL 1991-01-01 01:01:01 NULL NULL
-test_sequence
--- select .. where date/time column = .. --
-set @arg00= '1991-01-01 01:01:01' ;
-select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
-c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
-c17= '1991-01-01 01:01:01' ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
-and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
- c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
- c17= '1991-01-01 01:01:01'" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
-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
-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
-c17= CAST('1991-01-01 01:01:01' as datetime) ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
-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
- 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
- c17= CAST('1991-01-01 01:01:01' as datetime)" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 1991 ;
-select 'true' as found from t9
-where c1= 20 and c17= 1991 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c17= 1991" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c17= ?" ;
-execute stmt1 using @arg00 ;
-found
-true
-set @arg00= 1.991e+3 ;
-select 'true' as found from t9
-where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and abs(c17 - @arg00) < 0.01 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and abs(c17 - ?) < 0.01" ;
-execute stmt1 using @arg00 ;
-found
-true
-drop table t1, t9;
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index 58ea213c7b6..690bee55848 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -1671,6 +1671,9 @@ a b
1003 duplicate three
1004 duplicate four
delete from t1 where a >= 1000 ;
+set @1=1 ;
+set @2=2 ;
+set @100=100 ;
set @float=1.00;
set @five='five' ;
drop table if exists t2;
@@ -1924,7 +1927,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 0 31 8
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -2021,7 +2024,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 0 31 8
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2109,7 +2112,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 0 31 8
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2199,7 +2202,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 0 31 8
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
diff --git a/mysql-test/r/ps_4heap.result.es b/mysql-test/r/ps_4heap.result.es
deleted file mode 100644
index fcd9c52b4f9..00000000000
--- a/mysql-test/r/ps_4heap.result.es
+++ /dev/null
@@ -1,3114 +0,0 @@
-use test;
-drop table if exists t1, t9 ;
-create table t1
-(
-a int, b varchar(30),
-primary key(a)
-) engine = 'HEAP' ;
-drop table if exists t9;
-create table t9
-(
-c1 tinyint, c2 smallint, c3 mediumint, c4 int,
-c5 integer, c6 bigint, c7 float, c8 double,
-c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp(14), c16 time,
-c17 year, c18 bit, c19 bool, c20 char,
-c21 char(10), c22 varchar(30), c23 char(100), c24 char(100),
-c25 char(100), c26 char(100), c27 char(100), c28 char(100),
-c29 char(100), c30 char(100), c31 enum('one', 'two', 'three'),
-c32 set('monday', 'tuesday', 'wednesday'),
-primary key(c1)
-) engine = 'HEAP' ;
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-test_sequence
------- simple select tests ------
-prepare stmt1 from ' select * from t9 order by c1 ' ;
-execute stmt1;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def test t9 t9 c1 c1 1 4 1 N 49155 0 63
-def test t9 t9 c2 c2 2 6 1 Y 32768 0 63
-def test t9 t9 c3 c3 9 9 1 Y 32768 0 63
-def test t9 t9 c4 c4 3 11 1 Y 32768 0 63
-def test t9 t9 c5 c5 3 11 1 Y 32768 0 63
-def test t9 t9 c6 c6 8 20 1 Y 32768 0 63
-def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
-def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
-def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
-def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 0 9 6 Y 32768 4 63
-def test t9 t9 c12 c12 0 10 6 Y 32768 4 63
-def test t9 t9 c13 c13 10 10 10 Y 128 0 63
-def test t9 t9 c14 c14 12 19 19 Y 128 0 63
-def test t9 t9 c15 c15 7 19 19 N 1249 0 63
-def test t9 t9 c16 c16 11 8 8 Y 128 0 63
-def test t9 t9 c17 c17 13 4 4 Y 32864 0 63
-def test t9 t9 c18 c18 1 1 1 Y 32768 0 63
-def test t9 t9 c19 c19 1 1 1 Y 32768 0 63
-def test t9 t9 c20 c20 254 1 1 Y 0 0 8
-def test t9 t9 c21 c21 253 10 10 Y 0 0 8
-def test t9 t9 c22 c22 253 30 30 Y 0 0 8
-def test t9 t9 c23 c23 253 100 8 Y 0 0 8
-def test t9 t9 c24 c24 253 100 8 Y 0 0 8
-def test t9 t9 c25 c25 253 100 4 Y 0 0 8
-def test t9 t9 c26 c26 253 100 4 Y 0 0 8
-def test t9 t9 c27 c27 253 100 10 Y 0 0 8
-def test t9 t9 c28 c28 253 100 10 Y 0 0 8
-def test t9 t9 c29 c29 253 100 8 Y 0 0 8
-def test t9 t9 c30 c30 253 100 8 Y 0 0 8
-def test t9 t9 c31 c31 254 5 3 Y 256 0 8
-def test t9 t9 c32 c32 254 24 7 Y 2048 0 8
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
-set @arg00='SELECT' ;
-prepare stmt1 from ' ? a from t1 where a=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 '? a from t1 where a=1' at line 1
-set @arg00=1 ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-1 one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-1 one
-set @arg00='lion' ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-lion one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-lion one
-set @arg00=NULL ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-NULL one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-NULL one
-set @arg00=1 ;
-select b, a - @arg00 from t1 where a=1 ;
-b a - @arg00
-one 0
-prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-b a - ?
-one 0
-set @arg00=null ;
-select @arg00 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select ? as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-select @arg00 + 1 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select ? + 1 as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-select 1 + @arg00 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select 1 + ? as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-set @arg00='MySQL' ;
-select substr(@arg00,1,2) from t1 where a=1 ;
-substr(@arg00,1,2)
-My
-prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr(?,1,2)
-My
-set @arg00=3 ;
-select substr('MySQL',@arg00,5) from t1 where a=1 ;
-substr('MySQL',@arg00,5)
-SQL
-prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr('MySQL',?,5)
-SQL
-select substr('MySQL',1,@arg00) from t1 where a=1 ;
-substr('MySQL',1,@arg00)
-MyS
-prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr('MySQL',1,?)
-MyS
-set @arg00='MySQL' ;
-select a , concat(@arg00,b) from t1 order by a;
-a concat(@arg00,b)
-1 MySQLone
-2 MySQLtwo
-3 MySQLthree
-4 MySQLfour
-prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ;
-execute stmt1 using @arg00;
-a concat(?,b)
-1 MySQLone
-2 MySQLtwo
-3 MySQLthree
-4 MySQLfour
-select a , concat(b,@arg00) from t1 order by a ;
-a concat(b,@arg00)
-1 oneMySQL
-2 twoMySQL
-3 threeMySQL
-4 fourMySQL
-prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ;
-execute stmt1 using @arg00;
-a concat(b,?)
-1 oneMySQL
-2 twoMySQL
-3 threeMySQL
-4 fourMySQL
-set @arg00='MySQL' ;
-select group_concat(@arg00,b order by a) from t1
-group by 'a' ;
-group_concat(@arg00,b order by a)
-MySQLone,MySQLtwo,MySQLthree,MySQLfour
-prepare stmt1 from ' select group_concat(?,b order by a) from t1
-group by ''a'' ' ;
-execute stmt1 using @arg00;
-group_concat(?,b order by a)
-MySQLone,MySQLtwo,MySQLthree,MySQLfour
-select group_concat(b,@arg00 order by a) from t1
-group by 'a' ;
-group_concat(b,@arg00 order by a)
-oneMySQL,twoMySQL,threeMySQL,fourMySQL
-prepare stmt1 from ' select group_concat(b,? order by a) from t1
-group by ''a'' ' ;
-execute stmt1 using @arg00;
-group_concat(b,? order by a)
-oneMySQL,twoMySQL,threeMySQL,fourMySQL
-set @arg00='first' ;
-set @arg01='second' ;
-set @arg02=NULL;
-select @arg00, @arg01 from t1 where a=1 ;
-@arg00 @arg01
-first second
-prepare stmt1 from ' select ?, ? from t1 where a=1 ' ;
-execute stmt1 using @arg00, @arg01 ;
-? ?
-first second
-execute stmt1 using @arg02, @arg01 ;
-? ?
-NULL second
-execute stmt1 using @arg00, @arg02 ;
-? ?
-first NULL
-execute stmt1 using @arg02, @arg02 ;
-? ?
-NULL NULL
-drop table if exists t5 ;
-create table t5 (id1 int(11) not null default '0',
-value2 varchar(100), value1 varchar(100)) ;
-insert into t5 values (1,'hh','hh'),(2,'hh','hh'),
-(1,'ii','ii'),(2,'ii','ii') ;
-prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ;
-set @arg00=1 ;
-set @arg01='hh' ;
-execute stmt1 using @arg00, @arg01 ;
-id1 value1
-1 hh
-1 ii
-2 hh
-drop table t5 ;
-drop table if exists t5 ;
-create table t5(session_id char(9) not null) ;
-insert into t5 values ('abc') ;
-prepare stmt1 from ' select * from t5
-where ?=''1111'' and session_id = ''abc'' ' ;
-set @arg00='abc' ;
-execute stmt1 using @arg00 ;
-session_id
-set @arg00='1111' ;
-execute stmt1 using @arg00 ;
-session_id
-abc
-set @arg00='abc' ;
-execute stmt1 using @arg00 ;
-session_id
-drop table t5 ;
-set @arg00='FROM' ;
-select a @arg00 t1 where a=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 '@arg00 t1 where a=1' at line 1
-prepare stmt1 from ' select a ? t1 where a=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 '? t1 where a=1' at line 1
-set @arg00='t1' ;
-select a from @arg00 where a=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 '@arg00 where a=1' at line 1
-prepare stmt1 from ' select a from ? where a=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 '? where a=1' at line 1
-set @arg00='WHERE' ;
-select a from t1 @arg00 a=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 '@arg00 a=1' at line 1
-prepare stmt1 from ' select a from t1 ? a=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 '? a=1' at line 1
-set @arg00=1 ;
-select a FROM t1 where a=@arg00 ;
-a
-1
-prepare stmt1 from ' select a FROM t1 where a=? ' ;
-execute stmt1 using @arg00 ;
-a
-1
-set @arg00=1000 ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=NULL ;
-select a FROM t1 where a=@arg00 ;
-a
-prepare stmt1 from ' select a FROM t1 where a=? ' ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=4 ;
-select a FROM t1 where a=sqrt(@arg00) ;
-a
-2
-prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
-execute stmt1 using @arg00 ;
-a
-2
-set @arg00=NULL ;
-select a FROM t1 where a=sqrt(@arg00) ;
-a
-prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=2 ;
-set @arg01=3 ;
-select a FROM t1 where a in (@arg00,@arg01) order by a;
-a
-2
-3
-prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a ';
-execute stmt1 using @arg00, @arg01;
-a
-2
-3
-set @arg00= 'one' ;
-set @arg01= 'two' ;
-set @arg02= 'five' ;
-prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ;
-execute stmt1 using @arg00, @arg01, @arg02 ;
-b
-one
-two
-prepare stmt1 from ' select b FROM t1 where b like ? ';
-set @arg00='two' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00='tw%' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00='%wo' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00=null ;
-insert into t9 set c1= 0, c5 = NULL ;
-select c5 from t9 where c5 > NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 > ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 < NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 < ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 = NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 = ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 <=> NULL ;
-c5
-NULL
-prepare stmt1 from ' select c5 from t9 where c5 <=> ? ';
-execute stmt1 using @arg00 ;
-c5
-NULL
-delete from t9 where c1= 0 ;
-set @arg00='>' ;
-select a FROM t1 where a @arg00 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 '@arg00 1' at line 1
-prepare stmt1 from ' select a FROM t1 where a ? 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 '? 1' at line 1
-set @arg00=1 ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL group by a - @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL group by a - ? ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00='two' ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL having b <> @arg00 order by a ;
-a b
-1 one
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL having b <> ? order by a ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-3 three
-4 four
-set @arg00=1 ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL order by a - @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL order by a - ? ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=2 ;
-select a,b from t1 order by 2 ;
-a b
-4 four
-1 one
-3 three
-2 two
-prepare stmt1 from ' select a,b from t1
-order by ? ';
-execute stmt1 using @arg00;
-a b
-4 four
-1 one
-3 three
-2 two
-set @arg00=1 ;
-execute stmt1 using @arg00;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=0 ;
-execute stmt1 using @arg00;
-ERROR 42S22: Unknown column '?' in 'order clause'
-set @arg00=1;
-prepare stmt1 from ' select a,b from t1 order by a
-limit 1 ';
-execute stmt1 ;
-a b
-1 one
-prepare stmt1 from ' select a,b from t1
-limit ? ';
-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 2
-set @arg00='b' ;
-set @arg01=0 ;
-set @arg02=2 ;
-set @arg03=2 ;
-select sum(a), @arg00 from t1 where a > @arg01
-and b is not null group by substr(b,@arg02)
-having sum(a) <> @arg03 ;
-sum(a) @arg00
-3 b
-1 b
-4 b
-prepare stmt1 from ' select sum(a), ? from t1 where a > ?
-and b is not null group by substr(b,?)
-having sum(a) <> ? ';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03;
-sum(a) ?
-3 b
-1 b
-4 b
-test_sequence
------- join tests ------
-select first.a as a1, second.a as a2
-from t1 first, t1 second
-where first.a = second.a order by a1 ;
-a1 a2
-1 1
-2 2
-3 3
-4 4
-prepare stmt1 from ' select first.a as a1, second.a as a2
- from t1 first, t1 second
- where first.a = second.a order by a1 ';
-execute stmt1 ;
-a1 a2
-1 1
-2 2
-3 3
-4 4
-set @arg00='ABC';
-set @arg01='two';
-set @arg02='one';
-select first.a, @arg00, second.a FROM t1 first, t1 second
-where @arg01 = first.b or first.a = second.a or second.b = @arg02
-order by second.a, first.a;
-a @arg00 a
-1 ABC 1
-2 ABC 1
-3 ABC 1
-4 ABC 1
-2 ABC 2
-2 ABC 3
-3 ABC 3
-2 ABC 4
-4 ABC 4
-prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
- where ? = first.b or first.a = second.a or second.b = ?
- order by second.a, first.a';
-execute stmt1 using @arg00, @arg01, @arg02;
-a ? a
-1 ABC 1
-2 ABC 1
-3 ABC 1
-4 ABC 1
-2 ABC 2
-2 ABC 3
-3 ABC 3
-2 ABC 4
-4 ABC 4
-drop table if exists t2 ;
-create table t2 as select * from t1 ;
-set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ;
-set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ;
-set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ;
-set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ;
-set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ;
-set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ;
-set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ;
-set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ;
-set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ;
-the join statement is:
-SELECT * FROM t2 right join t1 using(a) order by t2.a
-prepare stmt1 from @query9 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural right join t1 order by t2.a
-prepare stmt1 from @query8 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a
-prepare stmt1 from @query7 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 left join t1 using(a) order by t2.a
-prepare stmt1 from @query6 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural left join t1 order by t2.a
-prepare stmt1 from @query5 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a
-prepare stmt1 from @query4 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 join t1 using(a) order by t2.a
-prepare stmt1 from @query3 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural join t1 order by t2.a
-prepare stmt1 from @query2 ;
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-the join statement is:
-SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a
-prepare stmt1 from @query1 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-drop table t2 ;
-test_sequence
------- subquery tests ------
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ''two'') ';
-execute stmt1 ;
-a b
-2 two
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = 'two' ) and b=@arg00 ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ''two'') and b=? ';
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = @arg00 ) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ? ) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=3 ;
-set @arg01='three' ;
-select a,b FROM t1 where (a,b) in (select 3, 'three');
-a b
-3 three
-select a FROM t1 where (a,b) in (select @arg00,@arg01);
-a
-3
-prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) ';
-execute stmt1 using @arg00, @arg01;
-a
-3
-set @arg00=1 ;
-set @arg01='two' ;
-set @arg02=2 ;
-set @arg03='two' ;
-select a, @arg00, b FROM t1 outer_table where
-b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ;
-a @arg00 b
-2 1 two
-prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
- b=? and a = (select ? from t1 where b = ? ) ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-a ? b
-2 1 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = outer_table.b ) order by a ';
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = outer_table.b ) and b=@arg00 ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = outer_table.b) and b=? ';
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=2 ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=2 ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=1 ;
-set @arg01='two' ;
-set @arg02=2 ;
-set @arg03='two' ;
-select a, @arg00, b FROM t1 outer_table where
-b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03
-and outer_table.a=a ) ;
-a @arg00 b
-2 1 two
-prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
- b=? and a = (select ? from t1 where outer_table.b = ?
- and outer_table.a=a ) ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-a ? b
-2 1 two
-set @arg00=1 ;
-set @arg01=0 ;
-select a, @arg00
-from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2
-where a=@arg01;
-a @arg00
-0 1
-prepare stmt1 from ' select a, ?
- from ( select a - ? as a from t1 where a=? ) as t2
- where a=? ';
-execute stmt1 using @arg00, @arg00, @arg00, @arg01 ;
-a ?
-0 1
-drop table if exists t2 ;
-create table t2 as select * from t1;
-prepare stmt1 from ' select a in (select a from t2) from t1 ' ;
-execute stmt1 ;
-a in (select a from t2)
-1
-1
-1
-1
-drop table if exists t5, t6, t7 ;
-create table t5 (a int , b int) ;
-create table t6 like t5 ;
-create table t7 like t5 ;
-insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7),
-(2, -1), (3, 10) ;
-insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ;
-insert into t7 values (3, 3), (2, 2), (1, 1) ;
-prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1) from t7 ' ;
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-drop table t5, t6, t7 ;
-drop table if exists t2 ;
-create table t2 as select * from t9;
-set @stmt= ' SELECT
- (SELECT SUM(c1 + c12 + 0.0) FROM t2
- where (t9.c2 - 0e-3) = t2.c2
- GROUP BY t9.c15 LIMIT 1) as scalar_s,
- exists (select 1.0e+0 from t2
- where t2.c3 * 9.0000000000 = t9.c4) as exists_s,
- c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s,
- (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s
-FROM t9,
-(select c25 x, c32 y from t2) tt WHERE x = c25 ' ;
-prepare stmt1 from @stmt ;
-execute stmt1 ;
-execute stmt1 ;
-set @stmt= concat('explain ',@stmt);
-prepare stmt1 from @stmt ;
-execute stmt1 ;
-execute stmt1 ;
-set @stmt= ' SELECT
- (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2
- GROUP BY t9.c15 LIMIT 1) as scalar_s,
- exists (select ? from t2
- where t2.c3*?=t9.c4) as exists_s,
- c5*? in (select c6+? from t2) as in_s,
- (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s
-FROM t9,
-(select c25 x, c32 y from t2) tt WHERE x =c25 ' ;
-set @arg00= 0.0 ;
-set @arg01= 0e-3 ;
-set @arg02= 1.0e+0 ;
-set @arg03= 9.0000000000 ;
-set @arg04= 4 ;
-set @arg05= 0.3e+1 ;
-set @arg06= 4 ;
-set @arg07= 4 ;
-set @arg08= 4.0 ;
-set @arg09= 40e-1 ;
-prepare stmt1 from @stmt ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-set @stmt= concat('explain ',@stmt);
-prepare stmt1 from @stmt ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-drop table t2 ;
-select 1 < (select a from t1) ;
-ERROR 21000: Subquery returns more than 1 row
-prepare stmt1 from ' select 1 < (select a from t1) ' ;
-execute stmt1 ;
-ERROR 21000: Subquery returns more than 1 row
-select 1 as my_col ;
-my_col
-1
-test_sequence
------- union tests ------
-prepare stmt1 from ' select a FROM t1 where a=1
- union distinct
- select a FROM t1 where a=1 ';
-execute stmt1 ;
-a
-1
-execute stmt1 ;
-a
-1
-prepare stmt1 from ' select a FROM t1 where a=1
- union all
- select a FROM t1 where a=1 ';
-execute stmt1 ;
-a
-1
-1
-prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-set @arg00=1 ;
-select @arg00 FROM t1 where a=1
-union distinct
-select 1 FROM t1 where a=1;
-@arg00
-1
-prepare stmt1 from ' select ? FROM t1 where a=1
- union distinct
- select 1 FROM t1 where a=1 ' ;
-execute stmt1 using @arg00;
-?
-1
-set @arg00=1 ;
-select 1 FROM t1 where a=1
-union distinct
-select @arg00 FROM t1 where a=1;
-1
-1
-prepare stmt1 from ' select 1 FROM t1 where a=1
- union distinct
- select ? FROM t1 where a=1 ' ;
-execute stmt1 using @arg00;
-1
-1
-set @arg00='a' ;
-select @arg00 FROM t1 where a=1
-union distinct
-select @arg00 FROM t1 where a=1;
-@arg00
-a
-prepare stmt1 from ' select ? FROM t1 where a=1
- union distinct
- select ? FROM t1 where a=1 ';
-execute stmt1 using @arg00, @arg00;
-?
-a
-prepare stmt1 from ' select ?
- union distinct
- select ? ';
-execute stmt1 using @arg00, @arg00;
-?
-a
-set @arg00='a' ;
-set @arg01=1 ;
-set @arg02='a' ;
-set @arg03=2 ;
-select @arg00 FROM t1 where a=@arg01
-union distinct
-select @arg02 FROM t1 where a=@arg03;
-@arg00
-a
-prepare stmt1 from ' select ? FROM t1 where a=?
- union distinct
- select ? FROM t1 where a=? ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03;
-?
-a
-set @arg00=1 ;
-prepare stmt1 from ' select sum(a) + 200, ? from t1
-union distinct
-select sum(a) + 200, 1 from t1
-group by b ' ;
-execute stmt1 using @arg00;
-sum(a) + 200 ?
-210 1
-204 1
-201 1
-203 1
-202 1
-set @Oporto='Oporto' ;
-set @Lisboa='Lisboa' ;
-set @0=0 ;
-set @1=1 ;
-set @2=2 ;
-set @3=3 ;
-set @4=4 ;
-select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ;
-@Oporto @Lisboa @0 @1 @2 @3 @4
-Oporto Lisboa 0 1 2 3 4
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-group by b
-union distinct
-select sum(a) + 200, @Lisboa from t1
-group by b ;
-the_sum the_town
-204 Oporto
-201 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-201 Lisboa
-203 Lisboa
-202 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- group by b
- union distinct
- select sum(a) + 200, ? from t1
- group by b ' ;
-execute stmt1 using @Oporto, @Lisboa;
-the_sum the_town
-204 Oporto
-201 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-201 Lisboa
-203 Lisboa
-202 Lisboa
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-where a > @1
-group by b
-union distinct
-select sum(a) + 200, @Lisboa from t1
-where a > @2
-group by b ;
-the_sum the_town
-204 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-203 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- where a > ?
- group by b
- union distinct
- select sum(a) + 200, ? from t1
- where a > ?
- group by b ' ;
-execute stmt1 using @Oporto, @1, @Lisboa, @2;
-the_sum the_town
-204 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-203 Lisboa
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-where a > @1
-group by b
-having avg(a) > @2
-union distinct
-select sum(a) + 200, @Lisboa from t1
-where a > @2
-group by b
-having avg(a) > @3;
-the_sum the_town
-204 Oporto
-203 Oporto
-204 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- where a > ?
- group by b
- having avg(a) > ?
- union distinct
- select sum(a) + 200, ? from t1
- where a > ?
- group by b
- having avg(a) > ? ';
-execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3;
-the_sum the_town
-204 Oporto
-203 Oporto
-204 Lisboa
-test_sequence
------- explain select tests ------
-prepare stmt1 from ' explain select * from t9 ' ;
-execute stmt1;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def id 8 3 1 N 32801 0 8
-def select_type 253 19 6 N 1 31 33
-def table 253 64 2 N 1 31 33
-def type 253 10 3 N 1 31 33
-def possible_keys 253 4096 0 Y 0 31 33
-def key 253 64 0 Y 0 31 33
-def key_len 8 3 0 Y 32800 0 8
-def ref 253 1024 0 Y 0 31 33
-def rows 8 10 1 N 32801 0 8
-def Extra 253 255 0 N 1 31 33
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t9 ALL NULL NULL NULL NULL 2
-test_sequence
------- delete tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'delete from t1 where a=2' ;
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-execute stmt1;
-insert into t1 values(0,NULL);
-set @arg00=NULL;
-prepare stmt1 from 'delete from t1 where b=?' ;
-execute stmt1 using @arg00;
-select a,b from t1 where b is NULL ;
-a b
-0 NULL
-set @arg00='one';
-execute stmt1 using @arg00;
-select a,b from t1 where b=@arg00;
-a b
-prepare stmt1 from 'truncate table t1' ;
-ERROR HY000: This command is not supported in the prepared statement protocol yet
-test_sequence
------- update tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ;
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-2 a=two
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-2 a=two
-set @arg00=NULL;
-prepare stmt1 from 'update t1 set b=? where a=2' ;
-execute stmt1 using @arg00;
-select a,b from t1 where a=2;
-a b
-2 NULL
-set @arg00='two';
-execute stmt1 using @arg00;
-select a,b from t1 where a=2;
-a b
-2 two
-set @arg00=2;
-prepare stmt1 from 'update t1 set b=NULL where a=?' ;
-execute stmt1 using @arg00;
-select a,b from t1 where a=@arg00;
-a b
-2 NULL
-update t1 set b='two' where a=@arg00;
-set @arg00=2000;
-execute stmt1 using @arg00;
-select a,b from t1 where a=@arg00;
-a b
-set @arg00=2;
-set @arg01=22;
-prepare stmt1 from 'update t1 set a=? where a=?' ;
-execute stmt1 using @arg00, @arg00;
-select a,b from t1 where a=@arg00;
-a b
-2 two
-execute stmt1 using @arg01, @arg00;
-select a,b from t1 where a=@arg01;
-a b
-22 two
-execute stmt1 using @arg00, @arg01;
-select a,b from t1 where a=@arg00;
-a b
-2 two
-set @arg00=NULL;
-set @arg01=2;
-execute stmt1 using @arg00, @arg01;
-Warnings:
-Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
-select a,b from t1 order by a;
-a b
-0 two
-1 one
-3 three
-4 four
-set @arg00=0;
-execute stmt1 using @arg01, @arg00;
-select a,b from t1 order by a;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=23;
-set @arg01='two';
-set @arg02=2;
-set @arg03='two';
-set @arg04=2;
-drop table if exists t2;
-create table t2 as select a,b from t1 ;
-prepare stmt1 from 'update t1 set a=? where b=?
- and a in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 where a = @arg00 ;
-a b
-23 two
-prepare stmt1 from 'update t1 set a=? where b=?
- and a not in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 order by a ;
-a b
-1 one
-2 two
-3 three
-4 four
-drop table t2 ;
-create table t2
-(
-a int, b varchar(30),
-primary key(a)
-) engine = 'HEAP' ;
-insert into t2(a,b) select a, b from t1 ;
-prepare stmt1 from 'update t1 set a=? where b=?
- and a in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 where a = @arg00 ;
-a b
-23 two
-prepare stmt1 from 'update t1 set a=? where b=?
- and a not in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 order by a ;
-a b
-1 one
-2 two
-3 three
-4 four
-drop table t2 ;
-set @arg00=1;
-prepare stmt1 from 'update t1 set b=''bla''
-where a=2
-limit 1';
-execute stmt1 ;
-select a,b from t1 where b = 'bla' ;
-a b
-2 bla
-prepare stmt1 from 'update t1 set b=''bla''
-where a=2
-limit ?';
-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 3
-test_sequence
------- insert tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'insert into t1 values(5, ''five'' )';
-execute stmt1;
-select a,b from t1 where a = 5;
-a b
-5 five
-set @arg00='six' ;
-prepare stmt1 from 'insert into t1 values(6, ? )';
-execute stmt1 using @arg00;
-select a,b from t1 where b = @arg00;
-a b
-6 six
-execute stmt1 using @arg00;
-ERROR 23000: Duplicate entry '6' for key 1
-set @arg00=NULL ;
-prepare stmt1 from 'insert into t1 values(0, ? )';
-execute stmt1 using @arg00;
-select a,b from t1 where b is NULL;
-a b
-0 NULL
-set @arg00=8 ;
-set @arg01='eight' ;
-prepare stmt1 from 'insert into t1 values(?, ? )';
-execute stmt1 using @arg00, @arg01 ;
-select a,b from t1 where b = @arg01;
-a b
-8 eight
-set @NULL= null ;
-set @arg00= 'abc' ;
-execute stmt1 using @NULL, @NULL ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @NULL ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @arg00 ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @arg00 ;
-ERROR 23000: Column 'a' cannot be null
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @arg00 ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @arg00 ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 abc
-10002 abc
-delete from t1 where a > 10000 ;
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @NULL ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @NULL ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 NULL
-10002 NULL
-delete from t1 where a > 10000 ;
-set @arg01= 10000 + 10 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 9 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 8 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 7 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 6 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 5 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 4 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 3 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @arg01 ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 10001
-10002 10002
-10003 10003
-10004 10004
-10005 10005
-10006 10006
-10007 10007
-10008 10008
-10009 10009
-10010 10010
-delete from t1 where a > 10000 ;
-set @arg00=81 ;
-set @arg01='8-1' ;
-set @arg02=82 ;
-set @arg03='8-2' ;
-prepare stmt1 from 'insert into t1 values(?,?),(?,?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-select a,b from t1 where a in (@arg00,@arg02) ;
-a b
-81 8-1
-82 8-2
-set @arg00=9 ;
-set @arg01='nine' ;
-prepare stmt1 from 'insert into t1 set a=?, b=? ';
-execute stmt1 using @arg00, @arg01 ;
-select a,b from t1 where a = @arg00 ;
-a b
-9 nine
-set @arg00=6 ;
-set @arg01=1 ;
-prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
- on duplicate key update a=a + ?, b=concat(b,''modified'') ';
-execute stmt1 using @arg00, @arg01;
-select * from t1 order by a;
-a b
-0 NULL
-1 one
-2 two
-3 three
-4 four
-5 five
-7 sixmodified
-8 eight
-9 nine
-81 8-1
-82 8-2
-set @arg00=81 ;
-set @arg01=1 ;
-execute stmt1 using @arg00, @arg01;
-ERROR 23000: Duplicate entry '82' for key 1
-drop table if exists t2 ;
-create table t2 (id int auto_increment primary key)
-ENGINE= 'HEAP' ;
-prepare stmt1 from ' select last_insert_id() ' ;
-insert into t2 values (NULL) ;
-execute stmt1 ;
-last_insert_id()
-1
-insert into t2 values (NULL) ;
-execute stmt1 ;
-last_insert_id()
-2
-drop table t2 ;
-set @1000=1000 ;
-set @x1000_2="x1000_2" ;
-set @x1000_3="x1000_3" ;
-set @x1000="x1000" ;
-set @1100=1100 ;
-set @x1100="x1100" ;
-set @100=100 ;
-set @updated="updated" ;
-insert into t1 values(1000,'x1000_1') ;
-insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
-on duplicate key update a = a + @100, b = concat(b,@updated) ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 x1000_3
-1100 x1000_1updated
-delete from t1 where a >= 1000 ;
-insert into t1 values(1000,'x1000_1') ;
-prepare stmt1 from ' insert into t1 values(?,?),(?,?)
- on duplicate key update a = a + ?, b = concat(b,?) ';
-execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 x1000_3
-1100 x1000_1updated
-delete from t1 where a >= 1000 ;
-insert into t1 values(1000,'x1000_1') ;
-execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1200 x1000_1updatedupdated
-delete from t1 where a >= 1000 ;
-prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
-execute stmt1;
-execute stmt1;
-execute stmt1;
-test_sequence
------- multi table tests ------
-delete from t1 ;
-delete from t9 ;
-insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ;
-insert into t9 (c1,c21)
-values (1, 'one'), (2, 'two'), (3, 'three') ;
-prepare stmt_delete from " delete t1, t9
- from t1, t9 where t1.a=t9.c1 and t1.b='updated' ";
-prepare stmt_update from " update t1, t9
- set t1.b='updated', t9.c21='updated'
- where t1.a=t9.c1 and t1.a=? ";
-prepare stmt_select1 from " select a, b from t1 order by a" ;
-prepare stmt_select2 from " select c1, c21 from t9 order by c1" ;
-set @arg00= 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-2 two
-3 three
-execute stmt_select2 ;
-c1 c21
-2 two
-3 three
-set @arg00= @arg00 + 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-3 three
-execute stmt_select2 ;
-c1 c21
-3 three
-set @arg00= @arg00 + 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-execute stmt_select2 ;
-c1 c21
-set @arg00= @arg00 + 1 ;
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-insert into t1 values(0,NULL) ;
-set @duplicate='duplicate ' ;
-set @1000=1000 ;
-set @5=5 ;
-select a,b from t1 where a < 5 order by a ;
-a b
-0 NULL
-1 one
-2 two
-3 three
-4 four
-insert into t1 select a + @1000, concat(@duplicate,b) from t1
-where a < @5 ;
-affected rows: 5
-info: Records: 5 Duplicates: 0 Warnings: 0
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 NULL
-1001 duplicate one
-1002 duplicate two
-1003 duplicate three
-1004 duplicate four
-delete from t1 where a >= 1000 ;
-prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
-where a < ? ' ;
-execute stmt1 using @1000, @duplicate, @5;
-affected rows: 5
-info: Records: 5 Duplicates: 0 Warnings: 0
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 NULL
-1001 duplicate one
-1002 duplicate two
-1003 duplicate three
-1004 duplicate four
-delete from t1 where a >= 1000 ;
-set @float=1.00;
-set @five='five' ;
-drop table if exists t2;
-create table t2 like t1 ;
-insert into t2 (b,a)
-select @duplicate, sum(first.a) from t1 first, t1 second
-where first.a <> @5 and second.b = first.b
-and second.b <> @five
-group by second.b
-having sum(second.a) > @2
-union
-select b, a + @100 from t1
-where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
-from t1);
-affected rows: 3
-info: Records: 3 Duplicates: 0 Warnings: 0
-select a,b from t2 order by a ;
-a b
-3 duplicate
-4 duplicate
-103 three
-delete from t2 ;
-prepare stmt1 from ' insert into t2 (b,a)
-select ?, sum(first.a)
- from t1 first, t1 second
- where first.a <> ? and second.b = first.b and second.b <> ?
- group by second.b
- having sum(second.a) > ?
-union
-select b, a + ? from t1
- where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b
- from t1 ) ' ;
-execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
-affected rows: 3
-info: Records: 3 Duplicates: 0 Warnings: 0
-select a,b from t2 order by a ;
-a b
-3 duplicate
-4 duplicate
-103 three
-drop table t2;
-drop table if exists t5 ;
-set @arg01= 8;
-set @arg02= 8.0;
-set @arg03= 80.00000000000e-1;
-set @arg04= 'abc' ;
-set @arg05= CAST('abc' as binary) ;
-set @arg06= '1991-08-05' ;
-set @arg07= CAST('1991-08-05' as date);
-set @arg08= '1991-08-05 01:01:01' ;
-set @arg09= CAST('1991-08-05 01:01:01' as datetime) ;
-set @arg10= unix_timestamp('1991-01-01 01:01:01');
-set @arg11= YEAR('1991-01-01 01:01:01');
-set @arg12= 8 ;
-set @arg12= NULL ;
-set @arg13= 8.0 ;
-set @arg13= NULL ;
-set @arg14= 'abc';
-set @arg14= NULL ;
-set @arg15= CAST('abc' as binary) ;
-set @arg15= NULL ;
-create table t5 as select
-8 as const01, @arg01 as param01,
-8.0 as const02, @arg02 as param02,
-80.00000000000e-1 as const03, @arg03 as param03,
-'abc' as const04, @arg04 as param04,
-CAST('abc' as binary) as const05, @arg05 as param05,
-'1991-08-05' as const06, @arg06 as param06,
-CAST('1991-08-05' as date) as const07, @arg07 as param07,
-'1991-08-05 01:01:01' as const08, @arg08 as param08,
-CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09,
-unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10,
-YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11,
-NULL as const12, @arg12 as param12,
-@arg13 as param13,
-@arg14 as param14,
-@arg15 as param15;
-show create table t5 ;
-Table Create Table
-t5 CREATE TABLE `t5` (
- `const01` bigint(1) NOT NULL default '0',
- `param01` bigint(20) default NULL,
- `const02` double(3,1) NOT NULL default '0.0',
- `param02` double default NULL,
- `const03` double NOT NULL default '0',
- `param03` double default NULL,
- `const04` char(3) NOT NULL default '',
- `param04` longtext,
- `const05` binary(3) NOT NULL default '',
- `param05` longblob,
- `const06` varchar(10) NOT NULL default '',
- `param06` longtext,
- `const07` date default NULL,
- `param07` longblob,
- `const08` varchar(19) NOT NULL default '',
- `param08` longtext,
- `const09` datetime default NULL,
- `param09` longblob,
- `const10` int(10) NOT NULL default '0',
- `param10` bigint(20) default NULL,
- `const11` int(4) default NULL,
- `param11` bigint(20) default NULL,
- `const12` binary(0) default NULL,
- `param12` bigint(20) default NULL,
- `param13` double default NULL,
- `param14` longtext,
- `param15` longblob
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-select * from t5 ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def test t5 t5 const01 const01 8 1 1 N 32769 0 63
-def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 5 3 3 N 32769 1 63
-def test t5 t5 param02 param02 5 20 1 Y 32768 31 63
-def test t5 t5 const03 const03 5 23 1 N 32769 31 63
-def test t5 t5 param03 param03 5 20 1 Y 32768 31 63
-def test t5 t5 const04 const04 254 3 3 N 1 0 8
-def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8
-def test t5 t5 const05 const05 254 3 3 N 129 0 63
-def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63
-def test t5 t5 const06 const06 253 10 10 N 1 0 8
-def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8
-def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63
-def test t5 t5 const08 const08 253 19 19 N 1 0 8
-def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8
-def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63
-def test t5 t5 const10 const10 3 10 9 N 32769 0 63
-def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
-def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
-def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
-def test t5 t5 const12 const12 254 0 0 Y 128 0 63
-def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
-def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
-def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
-const01 8
-param01 8
-const02 8.0
-param02 8
-const03 8
-param03 8
-const04 abc
-param04 abc
-const05 abc
-param05 abc
-const06 1991-08-05
-param06 1991-08-05
-const07 1991-08-05
-param07 1991-08-05
-const08 1991-08-05 01:01:01
-param08 1991-08-05 01:01:01
-const09 1991-08-05 01:01:01
-param09 1991-08-05 01:01:01
-const10 662680861
-param10 662680861
-const11 1991
-param11 1991
-const12 NULL
-param12 NULL
-param13 NULL
-param14 NULL
-param15 NULL
-drop table t5 ;
-test_sequence
------- data type conversion tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ;
-select * from t9 order by c1 ;
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
-test_sequence
------- select @parameter:= column ------
-prepare full_info from "select @arg01, @arg02, @arg03, @arg04,
- @arg05, @arg06, @arg07, @arg08,
- @arg09, @arg10, @arg11, @arg12,
- @arg13, @arg14, @arg15, @arg16,
- @arg17, @arg18, @arg19, @arg20,
- @arg21, @arg22, @arg23, @arg24,
- @arg25, @arg26, @arg27, @arg28,
- @arg29, @arg30, @arg31, @arg32" ;
-select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
-@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
-@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
-@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
-@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
-@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
-@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
-@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= 1 ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 0 31 8
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 0 31 8
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 0 31 8
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 0 31 8
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
-@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
-@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
-@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
-@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
-@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
-@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
-@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= 0 ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 0 31 8
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 0 31 8
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 0 31 8
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 0 31 8
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select
- @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
- @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
- @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
- @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
- @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
- @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
- @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
- @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= ?" ;
-set @my_key= 1 ;
-execute stmt1 using @my_key ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 0 31 8
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 0 31 8
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 0 31 8
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 0 31 8
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-set @my_key= 0 ;
-execute stmt1 using @my_key ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 0 31 8
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 0 31 8
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 0 31 8
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 0 31 8
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select ? := c1 from t9 where c1= 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 ':= c1 from t9 where c1= 1' at line 1
-test_sequence
------- select column, .. into @parm,.. ------
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
-c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
-c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
-@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
-@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
-@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= 1 ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 0 31 8
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 0 31 8
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 0 31 8
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 0 31 8
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
-c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
-c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
-@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
-@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
-@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= 0 ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 0 31 8
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 0 31 8
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 0 31 8
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 0 31 8
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
- c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
- c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
- @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
- @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
- @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= ?" ;
-set @my_key= 1 ;
-execute stmt1 using @my_key ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 0 31 8
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 0 31 8
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 0 31 8
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 0 31 8
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-set @my_key= 0 ;
-execute stmt1 using @my_key ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 0 31 8
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 0 31 8
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 0 31 8
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 0 31 8
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select c1 into ? from t9 where c1= 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 '? from t9 where c1= 1' at line 1
-test_sequence
--- insert into numeric columns --
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ;
-set @arg00= 21 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ;
-execute stmt1 ;
-set @arg00= 23;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0,
-30.0, 30.0, 30.0 ) ;
-set @arg00= 31.0 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0,
- 32.0, 32.0, 32.0 )" ;
-execute stmt1 ;
-set @arg00= 33.0;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( '40', '40', '40', '40', '40', '40', '40', '40',
-'40', '40', '40' ) ;
-set @arg00= '41' ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( '42', '42', '42', '42', '42', '42', '42', '42',
- '42', '42', '42' )" ;
-execute stmt1 ;
-set @arg00= '43';
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ;
-set @arg00= CAST('51' as binary) ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ;
-execute stmt1 ;
-set @arg00= CAST('53' as binary) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 2 ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-NULL, NULL, NULL ) ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 61, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL )" ;
-execute stmt1 ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 8.0 ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 71, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 'abc' ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 81, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
-from t9 where c1 >= 20
-order by c1 ;
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12
-20 20 20 20 20 20 20 20 20 20 20.0000
-21 21 21 21 21 21 21 21 21 21 21.0000
-22 22 22 22 22 22 22 22 22 22 22.0000
-23 23 23 23 23 23 23 23 23 23 23.0000
-30 30 30 30 30 30 30 30 30 30 30.0000
-31 31 31 31 31 31 31 31 31 31 31.0000
-32 32 32 32 32 32 32 32 32 32 32.0000
-33 33 33 33 33 33 33 33 33 33 33.0000
-40 40 40 40 40 40 40 40 40 40 40.0000
-41 41 41 41 41 41 41 41 41 41 41.0000
-42 42 42 42 42 42 42 42 42 42 42.0000
-43 43 43 43 43 43 43 43 43 43 43.0000
-50 50 50 50 50 50 50 50 50 50 50.0000
-51 51 51 51 51 51 51 51 51 51 51.0000
-52 52 52 52 52 52 52 52 52 52 52.0000
-53 53 53 53 53 53 53 53 53 53 53.0000
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-test_sequence
--- select .. where numeric column = .. --
-set @arg00= 20;
-select 'true' as found from t9
-where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
-and c8= 20 and c9= 20 and c10= 20 and c12= 20;
-found
-true
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
- and c8= 20 and c9= 20 and c10= 20 and c12= 20 ";
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20.0;
-select 'true' as found from t9
-where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
-and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0;
-found
-true
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
- and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 ";
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-select 'true' as found from t9
-where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
- and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20';
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
- and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' ";
-execute stmt1 ;
-found
-true
-set @arg00= '20';
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-select 'true' as found from t9
-where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
-c3= CAST('20' as binary) and c4= CAST('20' as binary) and
-c5= CAST('20' as binary) and c6= CAST('20' as binary) and
-c7= CAST('20' as binary) and c8= CAST('20' as binary) and
-c9= CAST('20' as binary) and c10= CAST('20' as binary) and
-c12= CAST('20' as binary);
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
- c3= CAST('20' as binary) and c4= CAST('20' as binary) and
- c5= CAST('20' as binary) and c6= CAST('20' as binary) and
- c7= CAST('20' as binary) and c8= CAST('20' as binary) and
- c9= CAST('20' as binary) and c10= CAST('20' as binary) and
- c12= CAST('20' as binary) ";
-execute stmt1 ;
-found
-true
-set @arg00= CAST('20' as binary) ;
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-delete from t9 ;
-test_sequence
--- some numeric overflow experiments --
-prepare my_insert from "insert into t9
- ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
-from t9 where c21 = 'O' ";
-prepare my_delete from "delete from t9 where c21 = 'O' ";
-set @arg00= 9223372036854775807 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
-c12 99999.9999
-execute my_delete ;
-set @arg00= '9223372036854775807' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
-c12 99999.9999
-execute my_delete ;
-set @arg00= -9223372036854775808 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
-c12 -9999.9999
-execute my_delete ;
-set @arg00= '-9223372036854775808' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
-c12 -9999.9999
-execute my_delete ;
-set @arg00= 1.11111111111111111111e+50 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
-c12 99999.9999
-execute my_delete ;
-set @arg00= '1.11111111111111111111e+50' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1265 Data truncated for column 'c1' at row 1
-Warning 1265 Data truncated for column 'c2' at row 1
-Warning 1265 Data truncated for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1265 Data truncated for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 1
-c2 1
-c3 1
-c4 1
-c5 1
-c6 1
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
-c12 99999.9999
-execute my_delete ;
-set @arg00= -1.11111111111111111111e+50 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
-c12 -9999.9999
-execute my_delete ;
-set @arg00= '-1.11111111111111111111e+50' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1265 Data truncated for column 'c1' at row 1
-Warning 1265 Data truncated for column 'c2' at row 1
-Warning 1265 Data truncated for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1265 Data truncated for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -1
-c2 -1
-c3 -1
-c4 -1
-c5 -1
-c6 -1
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
-c12 -9999.9999
-execute my_delete ;
-test_sequence
--- insert into string columns --
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30
-from t9 where c1 >= 20
-order by c1 ;
-c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30
-20 2 20 20 20 20 20 20 20 20 20 20
-21 2 21 21 21 21 21 21 21 21 21 21
-22 2 22 22 22 22 22 22 22 22 22 22
-23 2 23 23 23 23 23 23 23 23 23 23
-30 3 30 30 30 30 30 30 30 30 30 30
-31 3 31 31 31 31 31 31 31 31 31 31
-32 3 32 32 32 32 32 32 32 32 32 32
-33 3 33 33 33 33 33 33 33 33 33 33
-40 4 40 40 40 40 40 40 40 40 40 40
-41 4 41 41 41 41 41 41 41 41 41 41
-42 4 42 42 42 42 42 42 42 42 42 42
-43 4 43 43 43 43 43 43 43 43 43 43
-50 5 50 50 50 50 50 50 50 50 50 50
-51 5 51 51 51 51 51 51 51 51 51 51
-52 5 52 52 52 52 52 52 52 52 52 52
-53 5 53 53 53 53 53 53 53 53 53 53
-54 5 54 54 54 54 54 54 54 54 54 54
-55 5 55 55 55 55 55 55 55 55 55 55
-56 6 56 56 56 56 56 56 56 56 56 56
-57 6 57 57 57 57 57 57 57 57 57 57
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-test_sequence
--- select .. where string column = .. --
-set @arg00= '20';
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
-c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
-c27= '20' and c28= '20' and c29= '20' and c30= '20' ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
- c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
- c27= '20' and c28= '20' and c29= '20' and c30= '20'" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= CAST('20' as binary);
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
-= CAST('20' as binary) and c21= CAST('20' as binary)
-and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
-c24= CAST('20' as binary) and c25= CAST('20' as binary) and
-c26= CAST('20' as binary) and c27= CAST('20' as binary) and
-c28= CAST('20' as binary) and c29= CAST('20' as binary) and
-c30= CAST('20' as binary) ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and
-c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
- = CAST('20' as binary) and c21= CAST('20' as binary)
- and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
- c24= CAST('20' as binary) and c25= CAST('20' as binary) and
- c26= CAST('20' as binary) and c27= CAST('20' as binary) and
- c28= CAST('20' as binary) and c29= CAST('20' as binary) and
- c30= CAST('20' as binary)" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and
- c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and
- c29= ? and c30= ?";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20;
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
-c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
-c27= 20 and c28= 20 and c29= 20 and c30= 20 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
- c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
- c27= 20 and c28= 20 and c29= 20 and c30= 20" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20.0;
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
-c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
-c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
- c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
- c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-delete from t9 ;
-test_sequence
--- insert into date/time columns --
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-select c1, c13, c14, c15, c16, c17 from t9 order by c1 ;
-c1 c13 c14 c15 c16 c17
-20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-60 NULL NULL 1991-01-01 01:01:01 NULL NULL
-61 NULL NULL 1991-01-01 01:01:01 NULL NULL
-62 NULL NULL 1991-01-01 01:01:01 NULL NULL
-63 NULL NULL 1991-01-01 01:01:01 NULL NULL
-71 NULL NULL 1991-01-01 01:01:01 NULL NULL
-73 NULL NULL 1991-01-01 01:01:01 NULL NULL
-81 NULL NULL 1991-01-01 01:01:01 NULL NULL
-83 NULL NULL 1991-01-01 01:01:01 NULL NULL
-test_sequence
--- select .. where date/time column = .. --
-set @arg00= '1991-01-01 01:01:01' ;
-select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
-c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
-c17= '1991-01-01 01:01:01' ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
-and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
- c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
- c17= '1991-01-01 01:01:01'" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
-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
-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
-c17= CAST('1991-01-01 01:01:01' as datetime) ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
-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
- 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
- c17= CAST('1991-01-01 01:01:01' as datetime)" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 1991 ;
-select 'true' as found from t9
-where c1= 20 and c17= 1991 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c17= 1991" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c17= ?" ;
-execute stmt1 using @arg00 ;
-found
-true
-set @arg00= 1.991e+3 ;
-select 'true' as found from t9
-where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and abs(c17 - @arg00) < 0.01 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and abs(c17 - ?) < 0.01" ;
-execute stmt1 using @arg00 ;
-found
-true
-drop table t1, t9;
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index 8c90cdc588a..5c71d1fc53c 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -1863,7 +1863,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -1960,7 +1960,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2048,7 +2048,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2138,7 +2138,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -4872,7 +4872,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -4969,7 +4969,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -5057,7 +5057,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -5147,7 +5147,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
diff --git a/mysql-test/r/ps_5merge.result.es b/mysql-test/r/ps_5merge.result.es
deleted file mode 100644
index 4f05be1b4d9..00000000000
--- a/mysql-test/r/ps_5merge.result.es
+++ /dev/null
@@ -1,6064 +0,0 @@
-use test;
-drop table if exists t1, t1_1, t1_2,
-t9, t9_1, t9_2;
-drop table if exists t1, t9 ;
-create table t1
-(
-a int, b varchar(30),
-primary key(a)
-) engine = 'MYISAM' ;
-create table t9
-(
-c1 tinyint, c2 smallint, c3 mediumint, c4 int,
-c5 integer, c6 bigint, c7 float, c8 double,
-c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp(14), c16 time,
-c17 year, c18 bit, c19 bool, c20 char,
-c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
-c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
-c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
-c32 set('monday', 'tuesday', 'wednesday'),
-primary key(c1)
-) engine = 'MYISAM' ;
-rename table t1 to t1_1, t9 to t9_1 ;
-drop table if exists t1, t9 ;
-create table t1
-(
-a int, b varchar(30),
-primary key(a)
-) engine = 'MYISAM' ;
-create table t9
-(
-c1 tinyint, c2 smallint, c3 mediumint, c4 int,
-c5 integer, c6 bigint, c7 float, c8 double,
-c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp(14), c16 time,
-c17 year, c18 bit, c19 bool, c20 char,
-c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
-c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
-c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
-c32 set('monday', 'tuesday', 'wednesday'),
-primary key(c1)
-) engine = 'MYISAM' ;
-rename table t1 to t1_2, t9 to t9_2 ;
-create table t1
-(
-a int, b varchar(30),
-primary key(a)
-) ENGINE = MERGE UNION=(t1_1,t1_2)
-INSERT_METHOD=FIRST;
-create table t9
-(
-c1 tinyint, c2 smallint, c3 mediumint, c4 int,
-c5 integer, c6 bigint, c7 float, c8 double,
-c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp(14), c16 time,
-c17 year, c18 bit, c19 bool, c20 char,
-c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
-c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
-c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
-c32 set('monday', 'tuesday', 'wednesday'),
-primary key(c1)
-) ENGINE = MERGE UNION=(t9_1,t9_2)
-INSERT_METHOD=FIRST;
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-test_sequence
------- simple select tests ------
-prepare stmt1 from ' select * from t9 order by c1 ' ;
-execute stmt1;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def test t9 t9 c1 c1 1 4 1 N 49155 0 63
-def test t9 t9 c2 c2 2 6 1 Y 32768 0 63
-def test t9 t9 c3 c3 9 9 1 Y 32768 0 63
-def test t9 t9 c4 c4 3 11 1 Y 32768 0 63
-def test t9 t9 c5 c5 3 11 1 Y 32768 0 63
-def test t9 t9 c6 c6 8 20 1 Y 32768 0 63
-def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
-def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
-def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
-def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 0 9 6 Y 32768 4 63
-def test t9 t9 c12 c12 0 10 6 Y 32768 4 63
-def test t9 t9 c13 c13 10 10 10 Y 128 0 63
-def test t9 t9 c14 c14 12 19 19 Y 128 0 63
-def test t9 t9 c15 c15 7 19 19 N 1249 0 63
-def test t9 t9 c16 c16 11 8 8 Y 128 0 63
-def test t9 t9 c17 c17 13 4 4 Y 32864 0 63
-def test t9 t9 c18 c18 1 1 1 Y 32768 0 63
-def test t9 t9 c19 c19 1 1 1 Y 32768 0 63
-def test t9 t9 c20 c20 254 1 1 Y 0 0 8
-def test t9 t9 c21 c21 253 10 10 Y 0 0 8
-def test t9 t9 c22 c22 253 30 30 Y 0 0 8
-def test t9 t9 c23 c23 252 255 8 Y 144 0 63
-def test t9 t9 c24 c24 252 255 8 Y 16 0 8
-def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
-def test t9 t9 c26 c26 252 65535 4 Y 16 0 8
-def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63
-def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8
-def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63
-def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8
-def test t9 t9 c31 c31 254 5 3 Y 256 0 8
-def test t9 t9 c32 c32 254 24 7 Y 2048 0 8
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
-set @arg00='SELECT' ;
-prepare stmt1 from ' ? a from t1 where a=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 '? a from t1 where a=1' at line 1
-set @arg00=1 ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-1 one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-1 one
-set @arg00='lion' ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-lion one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-lion one
-set @arg00=NULL ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-NULL one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-NULL one
-set @arg00=1 ;
-select b, a - @arg00 from t1 where a=1 ;
-b a - @arg00
-one 0
-prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-b a - ?
-one 0
-set @arg00=null ;
-select @arg00 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select ? as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-select @arg00 + 1 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select ? + 1 as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-select 1 + @arg00 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select 1 + ? as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-set @arg00='MySQL' ;
-select substr(@arg00,1,2) from t1 where a=1 ;
-substr(@arg00,1,2)
-My
-prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr(?,1,2)
-My
-set @arg00=3 ;
-select substr('MySQL',@arg00,5) from t1 where a=1 ;
-substr('MySQL',@arg00,5)
-SQL
-prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr('MySQL',?,5)
-SQL
-select substr('MySQL',1,@arg00) from t1 where a=1 ;
-substr('MySQL',1,@arg00)
-MyS
-prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr('MySQL',1,?)
-MyS
-set @arg00='MySQL' ;
-select a , concat(@arg00,b) from t1 order by a;
-a concat(@arg00,b)
-1 MySQLone
-2 MySQLtwo
-3 MySQLthree
-4 MySQLfour
-prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ;
-execute stmt1 using @arg00;
-a concat(?,b)
-1 MySQLone
-2 MySQLtwo
-3 MySQLthree
-4 MySQLfour
-select a , concat(b,@arg00) from t1 order by a ;
-a concat(b,@arg00)
-1 oneMySQL
-2 twoMySQL
-3 threeMySQL
-4 fourMySQL
-prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ;
-execute stmt1 using @arg00;
-a concat(b,?)
-1 oneMySQL
-2 twoMySQL
-3 threeMySQL
-4 fourMySQL
-set @arg00='MySQL' ;
-select group_concat(@arg00,b order by a) from t1
-group by 'a' ;
-group_concat(@arg00,b order by a)
-MySQLone,MySQLtwo,MySQLthree,MySQLfour
-prepare stmt1 from ' select group_concat(?,b order by a) from t1
-group by ''a'' ' ;
-execute stmt1 using @arg00;
-group_concat(?,b order by a)
-MySQLone,MySQLtwo,MySQLthree,MySQLfour
-select group_concat(b,@arg00 order by a) from t1
-group by 'a' ;
-group_concat(b,@arg00 order by a)
-oneMySQL,twoMySQL,threeMySQL,fourMySQL
-prepare stmt1 from ' select group_concat(b,? order by a) from t1
-group by ''a'' ' ;
-execute stmt1 using @arg00;
-group_concat(b,? order by a)
-oneMySQL,twoMySQL,threeMySQL,fourMySQL
-set @arg00='first' ;
-set @arg01='second' ;
-set @arg02=NULL;
-select @arg00, @arg01 from t1 where a=1 ;
-@arg00 @arg01
-first second
-prepare stmt1 from ' select ?, ? from t1 where a=1 ' ;
-execute stmt1 using @arg00, @arg01 ;
-? ?
-first second
-execute stmt1 using @arg02, @arg01 ;
-? ?
-NULL second
-execute stmt1 using @arg00, @arg02 ;
-? ?
-first NULL
-execute stmt1 using @arg02, @arg02 ;
-? ?
-NULL NULL
-drop table if exists t5 ;
-create table t5 (id1 int(11) not null default '0',
-value2 varchar(100), value1 varchar(100)) ;
-insert into t5 values (1,'hh','hh'),(2,'hh','hh'),
-(1,'ii','ii'),(2,'ii','ii') ;
-prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ;
-set @arg00=1 ;
-set @arg01='hh' ;
-execute stmt1 using @arg00, @arg01 ;
-id1 value1
-1 hh
-1 ii
-2 hh
-drop table t5 ;
-drop table if exists t5 ;
-create table t5(session_id char(9) not null) ;
-insert into t5 values ('abc') ;
-prepare stmt1 from ' select * from t5
-where ?=''1111'' and session_id = ''abc'' ' ;
-set @arg00='abc' ;
-execute stmt1 using @arg00 ;
-session_id
-set @arg00='1111' ;
-execute stmt1 using @arg00 ;
-session_id
-abc
-set @arg00='abc' ;
-execute stmt1 using @arg00 ;
-session_id
-drop table t5 ;
-set @arg00='FROM' ;
-select a @arg00 t1 where a=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 '@arg00 t1 where a=1' at line 1
-prepare stmt1 from ' select a ? t1 where a=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 '? t1 where a=1' at line 1
-set @arg00='t1' ;
-select a from @arg00 where a=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 '@arg00 where a=1' at line 1
-prepare stmt1 from ' select a from ? where a=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 '? where a=1' at line 1
-set @arg00='WHERE' ;
-select a from t1 @arg00 a=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 '@arg00 a=1' at line 1
-prepare stmt1 from ' select a from t1 ? a=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 '? a=1' at line 1
-set @arg00=1 ;
-select a FROM t1 where a=@arg00 ;
-a
-1
-prepare stmt1 from ' select a FROM t1 where a=? ' ;
-execute stmt1 using @arg00 ;
-a
-1
-set @arg00=1000 ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=NULL ;
-select a FROM t1 where a=@arg00 ;
-a
-prepare stmt1 from ' select a FROM t1 where a=? ' ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=4 ;
-select a FROM t1 where a=sqrt(@arg00) ;
-a
-2
-prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
-execute stmt1 using @arg00 ;
-a
-2
-set @arg00=NULL ;
-select a FROM t1 where a=sqrt(@arg00) ;
-a
-prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=2 ;
-set @arg01=3 ;
-select a FROM t1 where a in (@arg00,@arg01) order by a;
-a
-2
-3
-prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a ';
-execute stmt1 using @arg00, @arg01;
-a
-2
-3
-set @arg00= 'one' ;
-set @arg01= 'two' ;
-set @arg02= 'five' ;
-prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ;
-execute stmt1 using @arg00, @arg01, @arg02 ;
-b
-one
-two
-prepare stmt1 from ' select b FROM t1 where b like ? ';
-set @arg00='two' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00='tw%' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00='%wo' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00=null ;
-insert into t9 set c1= 0, c5 = NULL ;
-select c5 from t9 where c5 > NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 > ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 < NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 < ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 = NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 = ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 <=> NULL ;
-c5
-NULL
-prepare stmt1 from ' select c5 from t9 where c5 <=> ? ';
-execute stmt1 using @arg00 ;
-c5
-NULL
-delete from t9 where c1= 0 ;
-set @arg00='>' ;
-select a FROM t1 where a @arg00 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 '@arg00 1' at line 1
-prepare stmt1 from ' select a FROM t1 where a ? 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 '? 1' at line 1
-set @arg00=1 ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL group by a - @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL group by a - ? ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00='two' ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL having b <> @arg00 order by a ;
-a b
-1 one
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL having b <> ? order by a ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-3 three
-4 four
-set @arg00=1 ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL order by a - @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL order by a - ? ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=2 ;
-select a,b from t1 order by 2 ;
-a b
-4 four
-1 one
-3 three
-2 two
-prepare stmt1 from ' select a,b from t1
-order by ? ';
-execute stmt1 using @arg00;
-a b
-4 four
-1 one
-3 three
-2 two
-set @arg00=1 ;
-execute stmt1 using @arg00;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=0 ;
-execute stmt1 using @arg00;
-ERROR 42S22: Unknown column '?' in 'order clause'
-set @arg00=1;
-prepare stmt1 from ' select a,b from t1 order by a
-limit 1 ';
-execute stmt1 ;
-a b
-1 one
-prepare stmt1 from ' select a,b from t1
-limit ? ';
-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 2
-set @arg00='b' ;
-set @arg01=0 ;
-set @arg02=2 ;
-set @arg03=2 ;
-select sum(a), @arg00 from t1 where a > @arg01
-and b is not null group by substr(b,@arg02)
-having sum(a) <> @arg03 ;
-sum(a) @arg00
-3 b
-1 b
-4 b
-prepare stmt1 from ' select sum(a), ? from t1 where a > ?
-and b is not null group by substr(b,?)
-having sum(a) <> ? ';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03;
-sum(a) ?
-3 b
-1 b
-4 b
-test_sequence
------- join tests ------
-select first.a as a1, second.a as a2
-from t1 first, t1 second
-where first.a = second.a order by a1 ;
-a1 a2
-1 1
-2 2
-3 3
-4 4
-prepare stmt1 from ' select first.a as a1, second.a as a2
- from t1 first, t1 second
- where first.a = second.a order by a1 ';
-execute stmt1 ;
-a1 a2
-1 1
-2 2
-3 3
-4 4
-set @arg00='ABC';
-set @arg01='two';
-set @arg02='one';
-select first.a, @arg00, second.a FROM t1 first, t1 second
-where @arg01 = first.b or first.a = second.a or second.b = @arg02
-order by second.a, first.a;
-a @arg00 a
-1 ABC 1
-2 ABC 1
-3 ABC 1
-4 ABC 1
-2 ABC 2
-2 ABC 3
-3 ABC 3
-2 ABC 4
-4 ABC 4
-prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
- where ? = first.b or first.a = second.a or second.b = ?
- order by second.a, first.a';
-execute stmt1 using @arg00, @arg01, @arg02;
-a ? a
-1 ABC 1
-2 ABC 1
-3 ABC 1
-4 ABC 1
-2 ABC 2
-2 ABC 3
-3 ABC 3
-2 ABC 4
-4 ABC 4
-drop table if exists t2 ;
-create table t2 as select * from t1 ;
-set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ;
-set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ;
-set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ;
-set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ;
-set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ;
-set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ;
-set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ;
-set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ;
-set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ;
-the join statement is:
-SELECT * FROM t2 right join t1 using(a) order by t2.a
-prepare stmt1 from @query9 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural right join t1 order by t2.a
-prepare stmt1 from @query8 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a
-prepare stmt1 from @query7 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 left join t1 using(a) order by t2.a
-prepare stmt1 from @query6 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural left join t1 order by t2.a
-prepare stmt1 from @query5 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a
-prepare stmt1 from @query4 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 join t1 using(a) order by t2.a
-prepare stmt1 from @query3 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural join t1 order by t2.a
-prepare stmt1 from @query2 ;
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-the join statement is:
-SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a
-prepare stmt1 from @query1 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-drop table t2 ;
-test_sequence
------- subquery tests ------
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ''two'') ';
-execute stmt1 ;
-a b
-2 two
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = 'two' ) and b=@arg00 ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ''two'') and b=? ';
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = @arg00 ) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ? ) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=3 ;
-set @arg01='three' ;
-select a,b FROM t1 where (a,b) in (select 3, 'three');
-a b
-3 three
-select a FROM t1 where (a,b) in (select @arg00,@arg01);
-a
-3
-prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) ';
-execute stmt1 using @arg00, @arg01;
-a
-3
-set @arg00=1 ;
-set @arg01='two' ;
-set @arg02=2 ;
-set @arg03='two' ;
-select a, @arg00, b FROM t1 outer_table where
-b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ;
-a @arg00 b
-2 1 two
-prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
- b=? and a = (select ? from t1 where b = ? ) ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-a ? b
-2 1 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = outer_table.b ) order by a ';
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = outer_table.b ) and b=@arg00 ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = outer_table.b) and b=? ';
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=2 ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=2 ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=1 ;
-set @arg01='two' ;
-set @arg02=2 ;
-set @arg03='two' ;
-select a, @arg00, b FROM t1 outer_table where
-b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03
-and outer_table.a=a ) ;
-a @arg00 b
-2 1 two
-prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
- b=? and a = (select ? from t1 where outer_table.b = ?
- and outer_table.a=a ) ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-a ? b
-2 1 two
-set @arg00=1 ;
-set @arg01=0 ;
-select a, @arg00
-from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2
-where a=@arg01;
-a @arg00
-0 1
-prepare stmt1 from ' select a, ?
- from ( select a - ? as a from t1 where a=? ) as t2
- where a=? ';
-execute stmt1 using @arg00, @arg00, @arg00, @arg01 ;
-a ?
-0 1
-drop table if exists t2 ;
-create table t2 as select * from t1;
-prepare stmt1 from ' select a in (select a from t2) from t1 ' ;
-execute stmt1 ;
-a in (select a from t2)
-1
-1
-1
-1
-drop table if exists t5, t6, t7 ;
-create table t5 (a int , b int) ;
-create table t6 like t5 ;
-create table t7 like t5 ;
-insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7),
-(2, -1), (3, 10) ;
-insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ;
-insert into t7 values (3, 3), (2, 2), (1, 1) ;
-prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1) from t7 ' ;
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-drop table t5, t6, t7 ;
-drop table if exists t2 ;
-create table t2 as select * from t9;
-set @stmt= ' SELECT
- (SELECT SUM(c1 + c12 + 0.0) FROM t2
- where (t9.c2 - 0e-3) = t2.c2
- GROUP BY t9.c15 LIMIT 1) as scalar_s,
- exists (select 1.0e+0 from t2
- where t2.c3 * 9.0000000000 = t9.c4) as exists_s,
- c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s,
- (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s
-FROM t9,
-(select c25 x, c32 y from t2) tt WHERE x = c25 ' ;
-prepare stmt1 from @stmt ;
-execute stmt1 ;
-execute stmt1 ;
-set @stmt= concat('explain ',@stmt);
-prepare stmt1 from @stmt ;
-execute stmt1 ;
-execute stmt1 ;
-set @stmt= ' SELECT
- (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2
- GROUP BY t9.c15 LIMIT 1) as scalar_s,
- exists (select ? from t2
- where t2.c3*?=t9.c4) as exists_s,
- c5*? in (select c6+? from t2) as in_s,
- (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s
-FROM t9,
-(select c25 x, c32 y from t2) tt WHERE x =c25 ' ;
-set @arg00= 0.0 ;
-set @arg01= 0e-3 ;
-set @arg02= 1.0e+0 ;
-set @arg03= 9.0000000000 ;
-set @arg04= 4 ;
-set @arg05= 0.3e+1 ;
-set @arg06= 4 ;
-set @arg07= 4 ;
-set @arg08= 4.0 ;
-set @arg09= 40e-1 ;
-prepare stmt1 from @stmt ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-set @stmt= concat('explain ',@stmt);
-prepare stmt1 from @stmt ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-drop table t2 ;
-select 1 < (select a from t1) ;
-ERROR 21000: Subquery returns more than 1 row
-prepare stmt1 from ' select 1 < (select a from t1) ' ;
-execute stmt1 ;
-ERROR 21000: Subquery returns more than 1 row
-select 1 as my_col ;
-my_col
-1
-test_sequence
------- union tests ------
-prepare stmt1 from ' select a FROM t1 where a=1
- union distinct
- select a FROM t1 where a=1 ';
-execute stmt1 ;
-a
-1
-execute stmt1 ;
-a
-1
-prepare stmt1 from ' select a FROM t1 where a=1
- union all
- select a FROM t1 where a=1 ';
-execute stmt1 ;
-a
-1
-1
-prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-set @arg00=1 ;
-select @arg00 FROM t1 where a=1
-union distinct
-select 1 FROM t1 where a=1;
-@arg00
-1
-prepare stmt1 from ' select ? FROM t1 where a=1
- union distinct
- select 1 FROM t1 where a=1 ' ;
-execute stmt1 using @arg00;
-?
-1
-set @arg00=1 ;
-select 1 FROM t1 where a=1
-union distinct
-select @arg00 FROM t1 where a=1;
-1
-1
-prepare stmt1 from ' select 1 FROM t1 where a=1
- union distinct
- select ? FROM t1 where a=1 ' ;
-execute stmt1 using @arg00;
-1
-1
-set @arg00='a' ;
-select @arg00 FROM t1 where a=1
-union distinct
-select @arg00 FROM t1 where a=1;
-@arg00
-a
-prepare stmt1 from ' select ? FROM t1 where a=1
- union distinct
- select ? FROM t1 where a=1 ';
-execute stmt1 using @arg00, @arg00;
-?
-a
-prepare stmt1 from ' select ?
- union distinct
- select ? ';
-execute stmt1 using @arg00, @arg00;
-?
-a
-set @arg00='a' ;
-set @arg01=1 ;
-set @arg02='a' ;
-set @arg03=2 ;
-select @arg00 FROM t1 where a=@arg01
-union distinct
-select @arg02 FROM t1 where a=@arg03;
-@arg00
-a
-prepare stmt1 from ' select ? FROM t1 where a=?
- union distinct
- select ? FROM t1 where a=? ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03;
-?
-a
-set @arg00=1 ;
-prepare stmt1 from ' select sum(a) + 200, ? from t1
-union distinct
-select sum(a) + 200, 1 from t1
-group by b ' ;
-execute stmt1 using @arg00;
-sum(a) + 200 ?
-210 1
-204 1
-201 1
-203 1
-202 1
-set @Oporto='Oporto' ;
-set @Lisboa='Lisboa' ;
-set @0=0 ;
-set @1=1 ;
-set @2=2 ;
-set @3=3 ;
-set @4=4 ;
-select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ;
-@Oporto @Lisboa @0 @1 @2 @3 @4
-Oporto Lisboa 0 1 2 3 4
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-group by b
-union distinct
-select sum(a) + 200, @Lisboa from t1
-group by b ;
-the_sum the_town
-204 Oporto
-201 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-201 Lisboa
-203 Lisboa
-202 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- group by b
- union distinct
- select sum(a) + 200, ? from t1
- group by b ' ;
-execute stmt1 using @Oporto, @Lisboa;
-the_sum the_town
-204 Oporto
-201 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-201 Lisboa
-203 Lisboa
-202 Lisboa
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-where a > @1
-group by b
-union distinct
-select sum(a) + 200, @Lisboa from t1
-where a > @2
-group by b ;
-the_sum the_town
-204 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-203 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- where a > ?
- group by b
- union distinct
- select sum(a) + 200, ? from t1
- where a > ?
- group by b ' ;
-execute stmt1 using @Oporto, @1, @Lisboa, @2;
-the_sum the_town
-204 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-203 Lisboa
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-where a > @1
-group by b
-having avg(a) > @2
-union distinct
-select sum(a) + 200, @Lisboa from t1
-where a > @2
-group by b
-having avg(a) > @3;
-the_sum the_town
-204 Oporto
-203 Oporto
-204 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- where a > ?
- group by b
- having avg(a) > ?
- union distinct
- select sum(a) + 200, ? from t1
- where a > ?
- group by b
- having avg(a) > ? ';
-execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3;
-the_sum the_town
-204 Oporto
-203 Oporto
-204 Lisboa
-test_sequence
------- explain select tests ------
-prepare stmt1 from ' explain select * from t9 ' ;
-execute stmt1;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def id 8 3 1 N 32801 0 8
-def select_type 253 19 6 N 1 31 33
-def table 253 64 2 N 1 31 33
-def type 253 10 3 N 1 31 33
-def possible_keys 253 4096 0 Y 0 31 33
-def key 253 64 0 Y 0 31 33
-def key_len 8 3 0 Y 32800 0 8
-def ref 253 1024 0 Y 0 31 33
-def rows 8 10 1 N 32801 0 8
-def Extra 253 255 0 N 1 31 33
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t9 ALL NULL NULL NULL NULL 2
-test_sequence
------- delete tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'delete from t1 where a=2' ;
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-execute stmt1;
-insert into t1 values(0,NULL);
-set @arg00=NULL;
-prepare stmt1 from 'delete from t1 where b=?' ;
-execute stmt1 using @arg00;
-select a,b from t1 where b is NULL ;
-a b
-0 NULL
-set @arg00='one';
-execute stmt1 using @arg00;
-select a,b from t1 where b=@arg00;
-a b
-prepare stmt1 from 'truncate table t1' ;
-ERROR HY000: This command is not supported in the prepared statement protocol yet
-test_sequence
------- update tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ;
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-2 a=two
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-2 a=two
-set @arg00=NULL;
-prepare stmt1 from 'update t1 set b=? where a=2' ;
-execute stmt1 using @arg00;
-select a,b from t1 where a=2;
-a b
-2 NULL
-set @arg00='two';
-execute stmt1 using @arg00;
-select a,b from t1 where a=2;
-a b
-2 two
-set @arg00=2;
-prepare stmt1 from 'update t1 set b=NULL where a=?' ;
-execute stmt1 using @arg00;
-select a,b from t1 where a=@arg00;
-a b
-2 NULL
-update t1 set b='two' where a=@arg00;
-set @arg00=2000;
-execute stmt1 using @arg00;
-select a,b from t1 where a=@arg00;
-a b
-set @arg00=2;
-set @arg01=22;
-prepare stmt1 from 'update t1 set a=? where a=?' ;
-execute stmt1 using @arg00, @arg00;
-select a,b from t1 where a=@arg00;
-a b
-2 two
-execute stmt1 using @arg01, @arg00;
-select a,b from t1 where a=@arg01;
-a b
-22 two
-execute stmt1 using @arg00, @arg01;
-select a,b from t1 where a=@arg00;
-a b
-2 two
-set @arg00=NULL;
-set @arg01=2;
-execute stmt1 using @arg00, @arg01;
-Warnings:
-Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
-select a,b from t1 order by a;
-a b
-0 two
-1 one
-3 three
-4 four
-set @arg00=0;
-execute stmt1 using @arg01, @arg00;
-select a,b from t1 order by a;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=23;
-set @arg01='two';
-set @arg02=2;
-set @arg03='two';
-set @arg04=2;
-drop table if exists t2;
-create table t2 as select a,b from t1 ;
-prepare stmt1 from 'update t1 set a=? where b=?
- and a in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 where a = @arg00 ;
-a b
-23 two
-prepare stmt1 from 'update t1 set a=? where b=?
- and a not in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 order by a ;
-a b
-1 one
-2 two
-3 three
-4 four
-drop table t2 ;
-create table t2
-(
-a int, b varchar(30),
-primary key(a)
-) engine = 'MYISAM' ;
-insert into t2(a,b) select a, b from t1 ;
-prepare stmt1 from 'update t1 set a=? where b=?
- and a in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 where a = @arg00 ;
-a b
-23 two
-prepare stmt1 from 'update t1 set a=? where b=?
- and a not in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 order by a ;
-a b
-1 one
-2 two
-3 three
-4 four
-drop table t2 ;
-set @arg00=1;
-prepare stmt1 from 'update t1 set b=''bla''
-where a=2
-limit 1';
-execute stmt1 ;
-select a,b from t1 where b = 'bla' ;
-a b
-2 bla
-prepare stmt1 from 'update t1 set b=''bla''
-where a=2
-limit ?';
-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 3
-test_sequence
------- insert tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'insert into t1 values(5, ''five'' )';
-execute stmt1;
-select a,b from t1 where a = 5;
-a b
-5 five
-set @arg00='six' ;
-prepare stmt1 from 'insert into t1 values(6, ? )';
-execute stmt1 using @arg00;
-select a,b from t1 where b = @arg00;
-a b
-6 six
-execute stmt1 using @arg00;
-ERROR 23000: Duplicate entry '6' for key 1
-set @arg00=NULL ;
-prepare stmt1 from 'insert into t1 values(0, ? )';
-execute stmt1 using @arg00;
-select a,b from t1 where b is NULL;
-a b
-0 NULL
-set @arg00=8 ;
-set @arg01='eight' ;
-prepare stmt1 from 'insert into t1 values(?, ? )';
-execute stmt1 using @arg00, @arg01 ;
-select a,b from t1 where b = @arg01;
-a b
-8 eight
-set @NULL= null ;
-set @arg00= 'abc' ;
-execute stmt1 using @NULL, @NULL ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @NULL ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @arg00 ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @arg00 ;
-ERROR 23000: Column 'a' cannot be null
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @arg00 ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @arg00 ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 abc
-10002 abc
-delete from t1 where a > 10000 ;
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @NULL ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @NULL ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 NULL
-10002 NULL
-delete from t1 where a > 10000 ;
-set @arg01= 10000 + 10 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 9 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 8 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 7 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 6 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 5 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 4 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 3 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @arg01 ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 10001
-10002 10002
-10003 10003
-10004 10004
-10005 10005
-10006 10006
-10007 10007
-10008 10008
-10009 10009
-10010 10010
-delete from t1 where a > 10000 ;
-set @arg00=81 ;
-set @arg01='8-1' ;
-set @arg02=82 ;
-set @arg03='8-2' ;
-prepare stmt1 from 'insert into t1 values(?,?),(?,?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-select a,b from t1 where a in (@arg00,@arg02) ;
-a b
-81 8-1
-82 8-2
-set @arg00=9 ;
-set @arg01='nine' ;
-prepare stmt1 from 'insert into t1 set a=?, b=? ';
-execute stmt1 using @arg00, @arg01 ;
-select a,b from t1 where a = @arg00 ;
-a b
-9 nine
-set @arg00=6 ;
-set @arg01=1 ;
-prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
- on duplicate key update a=a + ?, b=concat(b,''modified'') ';
-execute stmt1 using @arg00, @arg01;
-select * from t1 order by a;
-a b
-0 NULL
-1 one
-2 two
-3 three
-4 four
-5 five
-7 sixmodified
-8 eight
-9 nine
-81 8-1
-82 8-2
-set @arg00=81 ;
-set @arg01=1 ;
-execute stmt1 using @arg00, @arg01;
-ERROR 23000: Duplicate entry '82' for key 1
-drop table if exists t2 ;
-create table t2 (id int auto_increment primary key)
-ENGINE= 'MYISAM' ;
-prepare stmt1 from ' select last_insert_id() ' ;
-insert into t2 values (NULL) ;
-execute stmt1 ;
-last_insert_id()
-1
-insert into t2 values (NULL) ;
-execute stmt1 ;
-last_insert_id()
-2
-drop table t2 ;
-set @1000=1000 ;
-set @x1000_2="x1000_2" ;
-set @x1000_3="x1000_3" ;
-set @x1000="x1000" ;
-set @1100=1100 ;
-set @x1100="x1100" ;
-set @100=100 ;
-set @updated="updated" ;
-insert into t1 values(1000,'x1000_1') ;
-insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
-on duplicate key update a = a + @100, b = concat(b,@updated) ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 x1000_3
-1100 x1000_1updated
-delete from t1 where a >= 1000 ;
-insert into t1 values(1000,'x1000_1') ;
-prepare stmt1 from ' insert into t1 values(?,?),(?,?)
- on duplicate key update a = a + ?, b = concat(b,?) ';
-execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 x1000_3
-1100 x1000_1updated
-delete from t1 where a >= 1000 ;
-insert into t1 values(1000,'x1000_1') ;
-execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1200 x1000_1updatedupdated
-delete from t1 where a >= 1000 ;
-prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
-execute stmt1;
-execute stmt1;
-execute stmt1;
-test_sequence
------- multi table tests ------
-delete from t1 ;
-delete from t9 ;
-insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ;
-insert into t9 (c1,c21)
-values (1, 'one'), (2, 'two'), (3, 'three') ;
-prepare stmt_delete from " delete t1, t9
- from t1, t9 where t1.a=t9.c1 and t1.b='updated' ";
-prepare stmt_update from " update t1, t9
- set t1.b='updated', t9.c21='updated'
- where t1.a=t9.c1 and t1.a=? ";
-prepare stmt_select1 from " select a, b from t1 order by a" ;
-prepare stmt_select2 from " select c1, c21 from t9 order by c1" ;
-set @arg00= 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-2 two
-3 three
-execute stmt_select2 ;
-c1 c21
-2 two
-3 three
-set @arg00= @arg00 + 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-3 three
-execute stmt_select2 ;
-c1 c21
-3 three
-set @arg00= @arg00 + 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-execute stmt_select2 ;
-c1 c21
-set @arg00= @arg00 + 1 ;
-drop table if exists t5 ;
-set @arg01= 8;
-set @arg02= 8.0;
-set @arg03= 80.00000000000e-1;
-set @arg04= 'abc' ;
-set @arg05= CAST('abc' as binary) ;
-set @arg06= '1991-08-05' ;
-set @arg07= CAST('1991-08-05' as date);
-set @arg08= '1991-08-05 01:01:01' ;
-set @arg09= CAST('1991-08-05 01:01:01' as datetime) ;
-set @arg10= unix_timestamp('1991-01-01 01:01:01');
-set @arg11= YEAR('1991-01-01 01:01:01');
-set @arg12= 8 ;
-set @arg12= NULL ;
-set @arg13= 8.0 ;
-set @arg13= NULL ;
-set @arg14= 'abc';
-set @arg14= NULL ;
-set @arg15= CAST('abc' as binary) ;
-set @arg15= NULL ;
-create table t5 as select
-8 as const01, @arg01 as param01,
-8.0 as const02, @arg02 as param02,
-80.00000000000e-1 as const03, @arg03 as param03,
-'abc' as const04, @arg04 as param04,
-CAST('abc' as binary) as const05, @arg05 as param05,
-'1991-08-05' as const06, @arg06 as param06,
-CAST('1991-08-05' as date) as const07, @arg07 as param07,
-'1991-08-05 01:01:01' as const08, @arg08 as param08,
-CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09,
-unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10,
-YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11,
-NULL as const12, @arg12 as param12,
-@arg13 as param13,
-@arg14 as param14,
-@arg15 as param15;
-show create table t5 ;
-Table Create Table
-t5 CREATE TABLE `t5` (
- `const01` bigint(1) NOT NULL default '0',
- `param01` bigint(20) default NULL,
- `const02` double(3,1) NOT NULL default '0.0',
- `param02` double default NULL,
- `const03` double NOT NULL default '0',
- `param03` double default NULL,
- `const04` char(3) NOT NULL default '',
- `param04` longtext,
- `const05` binary(3) NOT NULL default '',
- `param05` longblob,
- `const06` varchar(10) NOT NULL default '',
- `param06` longtext,
- `const07` date default NULL,
- `param07` longblob,
- `const08` varchar(19) NOT NULL default '',
- `param08` longtext,
- `const09` datetime default NULL,
- `param09` longblob,
- `const10` int(10) NOT NULL default '0',
- `param10` bigint(20) default NULL,
- `const11` int(4) default NULL,
- `param11` bigint(20) default NULL,
- `const12` binary(0) default NULL,
- `param12` bigint(20) default NULL,
- `param13` double default NULL,
- `param14` longtext,
- `param15` longblob
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-select * from t5 ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def test t5 t5 const01 const01 8 1 1 N 32769 0 63
-def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 5 3 3 N 32769 1 63
-def test t5 t5 param02 param02 5 20 1 Y 32768 31 63
-def test t5 t5 const03 const03 5 23 1 N 32769 31 63
-def test t5 t5 param03 param03 5 20 1 Y 32768 31 63
-def test t5 t5 const04 const04 254 3 3 N 1 0 8
-def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8
-def test t5 t5 const05 const05 254 3 3 N 129 0 63
-def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63
-def test t5 t5 const06 const06 253 10 10 N 1 0 8
-def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8
-def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63
-def test t5 t5 const08 const08 253 19 19 N 1 0 8
-def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8
-def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63
-def test t5 t5 const10 const10 3 10 9 N 32769 0 63
-def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
-def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
-def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
-def test t5 t5 const12 const12 254 0 0 Y 128 0 63
-def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
-def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
-def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
-const01 8
-param01 8
-const02 8.0
-param02 8
-const03 8
-param03 8
-const04 abc
-param04 abc
-const05 abc
-param05 abc
-const06 1991-08-05
-param06 1991-08-05
-const07 1991-08-05
-param07 1991-08-05
-const08 1991-08-05 01:01:01
-param08 1991-08-05 01:01:01
-const09 1991-08-05 01:01:01
-param09 1991-08-05 01:01:01
-const10 662680861
-param10 662680861
-const11 1991
-param11 1991
-const12 NULL
-param12 NULL
-param13 NULL
-param14 NULL
-param15 NULL
-drop table t5 ;
-test_sequence
------- data type conversion tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ;
-select * from t9 order by c1 ;
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
-test_sequence
------- select @parameter:= column ------
-prepare full_info from "select @arg01, @arg02, @arg03, @arg04,
- @arg05, @arg06, @arg07, @arg08,
- @arg09, @arg10, @arg11, @arg12,
- @arg13, @arg14, @arg15, @arg16,
- @arg17, @arg18, @arg19, @arg20,
- @arg21, @arg22, @arg23, @arg24,
- @arg25, @arg26, @arg27, @arg28,
- @arg29, @arg30, @arg31, @arg32" ;
-select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
-@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
-@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
-@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
-@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
-@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
-@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
-@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= 1 ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
-@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
-@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
-@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
-@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
-@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
-@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
-@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= 0 ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select
- @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
- @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
- @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
- @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
- @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
- @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
- @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
- @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= ?" ;
-set @my_key= 1 ;
-execute stmt1 using @my_key ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-set @my_key= 0 ;
-execute stmt1 using @my_key ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select ? := c1 from t9 where c1= 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 ':= c1 from t9 where c1= 1' at line 1
-test_sequence
------- select column, .. into @parm,.. ------
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
-c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
-c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
-@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
-@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
-@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= 1 ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
-c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
-c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
-@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
-@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
-@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= 0 ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
- c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
- c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
- @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
- @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
- @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= ?" ;
-set @my_key= 1 ;
-execute stmt1 using @my_key ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-set @my_key= 0 ;
-execute stmt1 using @my_key ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select c1 into ? from t9 where c1= 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 '? from t9 where c1= 1' at line 1
-test_sequence
--- insert into numeric columns --
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ;
-set @arg00= 21 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ;
-execute stmt1 ;
-set @arg00= 23;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0,
-30.0, 30.0, 30.0 ) ;
-set @arg00= 31.0 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0,
- 32.0, 32.0, 32.0 )" ;
-execute stmt1 ;
-set @arg00= 33.0;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( '40', '40', '40', '40', '40', '40', '40', '40',
-'40', '40', '40' ) ;
-set @arg00= '41' ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( '42', '42', '42', '42', '42', '42', '42', '42',
- '42', '42', '42' )" ;
-execute stmt1 ;
-set @arg00= '43';
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ;
-set @arg00= CAST('51' as binary) ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ;
-execute stmt1 ;
-set @arg00= CAST('53' as binary) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 2 ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-NULL, NULL, NULL ) ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 61, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL )" ;
-execute stmt1 ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 8.0 ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 71, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 'abc' ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 81, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
-from t9 where c1 >= 20
-order by c1 ;
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12
-20 20 20 20 20 20 20 20 20 20 20.0000
-21 21 21 21 21 21 21 21 21 21 21.0000
-22 22 22 22 22 22 22 22 22 22 22.0000
-23 23 23 23 23 23 23 23 23 23 23.0000
-30 30 30 30 30 30 30 30 30 30 30.0000
-31 31 31 31 31 31 31 31 31 31 31.0000
-32 32 32 32 32 32 32 32 32 32 32.0000
-33 33 33 33 33 33 33 33 33 33 33.0000
-40 40 40 40 40 40 40 40 40 40 40.0000
-41 41 41 41 41 41 41 41 41 41 41.0000
-42 42 42 42 42 42 42 42 42 42 42.0000
-43 43 43 43 43 43 43 43 43 43 43.0000
-50 50 50 50 50 50 50 50 50 50 50.0000
-51 51 51 51 51 51 51 51 51 51 51.0000
-52 52 52 52 52 52 52 52 52 52 52.0000
-53 53 53 53 53 53 53 53 53 53 53.0000
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-test_sequence
--- select .. where numeric column = .. --
-set @arg00= 20;
-select 'true' as found from t9
-where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
-and c8= 20 and c9= 20 and c10= 20 and c12= 20;
-found
-true
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
- and c8= 20 and c9= 20 and c10= 20 and c12= 20 ";
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20.0;
-select 'true' as found from t9
-where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
-and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0;
-found
-true
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
- and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 ";
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-select 'true' as found from t9
-where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
- and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20';
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
- and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' ";
-execute stmt1 ;
-found
-true
-set @arg00= '20';
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-select 'true' as found from t9
-where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
-c3= CAST('20' as binary) and c4= CAST('20' as binary) and
-c5= CAST('20' as binary) and c6= CAST('20' as binary) and
-c7= CAST('20' as binary) and c8= CAST('20' as binary) and
-c9= CAST('20' as binary) and c10= CAST('20' as binary) and
-c12= CAST('20' as binary);
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
- c3= CAST('20' as binary) and c4= CAST('20' as binary) and
- c5= CAST('20' as binary) and c6= CAST('20' as binary) and
- c7= CAST('20' as binary) and c8= CAST('20' as binary) and
- c9= CAST('20' as binary) and c10= CAST('20' as binary) and
- c12= CAST('20' as binary) ";
-execute stmt1 ;
-found
-true
-set @arg00= CAST('20' as binary) ;
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-delete from t9 ;
-test_sequence
--- some numeric overflow experiments --
-prepare my_insert from "insert into t9
- ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
-from t9 where c21 = 'O' ";
-prepare my_delete from "delete from t9 where c21 = 'O' ";
-set @arg00= 9223372036854775807 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
-c12 99999.9999
-execute my_delete ;
-set @arg00= '9223372036854775807' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
-c12 99999.9999
-execute my_delete ;
-set @arg00= -9223372036854775808 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
-c12 -9999.9999
-execute my_delete ;
-set @arg00= '-9223372036854775808' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
-c12 -9999.9999
-execute my_delete ;
-set @arg00= 1.11111111111111111111e+50 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
-c12 99999.9999
-execute my_delete ;
-set @arg00= '1.11111111111111111111e+50' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1265 Data truncated for column 'c1' at row 1
-Warning 1265 Data truncated for column 'c2' at row 1
-Warning 1265 Data truncated for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1265 Data truncated for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 1
-c2 1
-c3 1
-c4 1
-c5 1
-c6 1
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
-c12 99999.9999
-execute my_delete ;
-set @arg00= -1.11111111111111111111e+50 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
-c12 -9999.9999
-execute my_delete ;
-set @arg00= '-1.11111111111111111111e+50' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1265 Data truncated for column 'c1' at row 1
-Warning 1265 Data truncated for column 'c2' at row 1
-Warning 1265 Data truncated for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1265 Data truncated for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -1
-c2 -1
-c3 -1
-c4 -1
-c5 -1
-c6 -1
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
-c12 -9999.9999
-execute my_delete ;
-test_sequence
--- insert into string columns --
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30
-from t9 where c1 >= 20
-order by c1 ;
-c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30
-20 2 20 20 20 20 20 20 20 20 20 20
-21 2 21 21 21 21 21 21 21 21 21 21
-22 2 22 22 22 22 22 22 22 22 22 22
-23 2 23 23 23 23 23 23 23 23 23 23
-30 3 30 30 30 30 30 30 30 30 30 30
-31 3 31 31 31 31 31 31 31 31 31 31
-32 3 32 32 32 32 32 32 32 32 32 32
-33 3 33 33 33 33 33 33 33 33 33 33
-40 4 40 40 40 40 40 40 40 40 40 40
-41 4 41 41 41 41 41 41 41 41 41 41
-42 4 42 42 42 42 42 42 42 42 42 42
-43 4 43 43 43 43 43 43 43 43 43 43
-50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00
-51 5 51 51 51 51 51 51 51 51 51 51
-52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00
-53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00
-54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00
-55 5 55 55 55 55 55 55 55 55 55 55
-56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00
-57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-test_sequence
--- select .. where string column = .. --
-set @arg00= '20';
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
-c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
-c27= '20' and c28= '20' and c29= '20' and c30= '20' ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
- c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
- c27= '20' and c28= '20' and c29= '20' and c30= '20'" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= CAST('20' as binary);
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
-= CAST('20' as binary) and c21= CAST('20' as binary)
-and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
-c24= CAST('20' as binary) and c25= CAST('20' as binary) and
-c26= CAST('20' as binary) and c27= CAST('20' as binary) and
-c28= CAST('20' as binary) and c29= CAST('20' as binary) and
-c30= CAST('20' as binary) ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and
-c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
- = CAST('20' as binary) and c21= CAST('20' as binary)
- and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
- c24= CAST('20' as binary) and c25= CAST('20' as binary) and
- c26= CAST('20' as binary) and c27= CAST('20' as binary) and
- c28= CAST('20' as binary) and c29= CAST('20' as binary) and
- c30= CAST('20' as binary)" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and
- c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and
- c29= ? and c30= ?";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20;
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
-c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
-c27= 20 and c28= 20 and c29= 20 and c30= 20 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
- c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
- c27= 20 and c28= 20 and c29= 20 and c30= 20" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20.0;
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
-c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
-c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
- c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
- c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-delete from t9 ;
-test_sequence
--- insert into date/time columns --
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-select c1, c13, c14, c15, c16, c17 from t9 order by c1 ;
-c1 c13 c14 c15 c16 c17
-20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-60 NULL NULL 1991-01-01 01:01:01 NULL NULL
-61 NULL NULL 1991-01-01 01:01:01 NULL NULL
-62 NULL NULL 1991-01-01 01:01:01 NULL NULL
-63 NULL NULL 1991-01-01 01:01:01 NULL NULL
-71 NULL NULL 1991-01-01 01:01:01 NULL NULL
-73 NULL NULL 1991-01-01 01:01:01 NULL NULL
-81 NULL NULL 1991-01-01 01:01:01 NULL NULL
-83 NULL NULL 1991-01-01 01:01:01 NULL NULL
-test_sequence
--- select .. where date/time column = .. --
-set @arg00= '1991-01-01 01:01:01' ;
-select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
-c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
-c17= '1991-01-01 01:01:01' ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
-and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
- c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
- c17= '1991-01-01 01:01:01'" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
-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
-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
-c17= CAST('1991-01-01 01:01:01' as datetime) ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
-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
- 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
- c17= CAST('1991-01-01 01:01:01' as datetime)" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 1991 ;
-select 'true' as found from t9
-where c1= 20 and c17= 1991 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c17= 1991" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c17= ?" ;
-execute stmt1 using @arg00 ;
-found
-true
-set @arg00= 1.991e+3 ;
-select 'true' as found from t9
-where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and abs(c17 - @arg00) < 0.01 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and abs(c17 - ?) < 0.01" ;
-execute stmt1 using @arg00 ;
-found
-true
-drop table t1, t9 ;
-create table t1
-(
-a int, b varchar(30),
-primary key(a)
-) ENGINE = MERGE UNION=(t1_1,t1_2)
-INSERT_METHOD=LAST;
-create table t9
-(
-c1 tinyint, c2 smallint, c3 mediumint, c4 int,
-c5 integer, c6 bigint, c7 float, c8 double,
-c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp(14), c16 time,
-c17 year, c18 bit, c19 bool, c20 char,
-c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
-c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
-c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
-c32 set('monday', 'tuesday', 'wednesday'),
-primary key(c1)
-) ENGINE = MERGE UNION=(t9_1,t9_2)
-INSERT_METHOD=LAST;
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-test_sequence
------- simple select tests ------
-prepare stmt1 from ' select * from t9 order by c1 ' ;
-execute stmt1;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def test t9 t9 c1 c1 1 4 1 N 49155 0 63
-def test t9 t9 c2 c2 2 6 1 Y 32768 0 63
-def test t9 t9 c3 c3 9 9 1 Y 32768 0 63
-def test t9 t9 c4 c4 3 11 1 Y 32768 0 63
-def test t9 t9 c5 c5 3 11 1 Y 32768 0 63
-def test t9 t9 c6 c6 8 20 1 Y 32768 0 63
-def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
-def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
-def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
-def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 0 9 6 Y 32768 4 63
-def test t9 t9 c12 c12 0 10 6 Y 32768 4 63
-def test t9 t9 c13 c13 10 10 10 Y 128 0 63
-def test t9 t9 c14 c14 12 19 19 Y 128 0 63
-def test t9 t9 c15 c15 7 19 19 N 1249 0 63
-def test t9 t9 c16 c16 11 8 8 Y 128 0 63
-def test t9 t9 c17 c17 13 4 4 Y 32864 0 63
-def test t9 t9 c18 c18 1 1 1 Y 32768 0 63
-def test t9 t9 c19 c19 1 1 1 Y 32768 0 63
-def test t9 t9 c20 c20 254 1 1 Y 0 0 8
-def test t9 t9 c21 c21 253 10 10 Y 0 0 8
-def test t9 t9 c22 c22 253 30 30 Y 0 0 8
-def test t9 t9 c23 c23 252 255 8 Y 144 0 63
-def test t9 t9 c24 c24 252 255 8 Y 16 0 8
-def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
-def test t9 t9 c26 c26 252 65535 4 Y 16 0 8
-def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63
-def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8
-def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63
-def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8
-def test t9 t9 c31 c31 254 5 3 Y 256 0 8
-def test t9 t9 c32 c32 254 24 7 Y 2048 0 8
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
-set @arg00='SELECT' ;
-prepare stmt1 from ' ? a from t1 where a=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 '? a from t1 where a=1' at line 1
-set @arg00=1 ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-1 one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-1 one
-set @arg00='lion' ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-lion one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-lion one
-set @arg00=NULL ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-NULL one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-NULL one
-set @arg00=1 ;
-select b, a - @arg00 from t1 where a=1 ;
-b a - @arg00
-one 0
-prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-b a - ?
-one 0
-set @arg00=null ;
-select @arg00 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select ? as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-select @arg00 + 1 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select ? + 1 as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-select 1 + @arg00 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select 1 + ? as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-set @arg00='MySQL' ;
-select substr(@arg00,1,2) from t1 where a=1 ;
-substr(@arg00,1,2)
-My
-prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr(?,1,2)
-My
-set @arg00=3 ;
-select substr('MySQL',@arg00,5) from t1 where a=1 ;
-substr('MySQL',@arg00,5)
-SQL
-prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr('MySQL',?,5)
-SQL
-select substr('MySQL',1,@arg00) from t1 where a=1 ;
-substr('MySQL',1,@arg00)
-MyS
-prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr('MySQL',1,?)
-MyS
-set @arg00='MySQL' ;
-select a , concat(@arg00,b) from t1 order by a;
-a concat(@arg00,b)
-1 MySQLone
-2 MySQLtwo
-3 MySQLthree
-4 MySQLfour
-prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ;
-execute stmt1 using @arg00;
-a concat(?,b)
-1 MySQLone
-2 MySQLtwo
-3 MySQLthree
-4 MySQLfour
-select a , concat(b,@arg00) from t1 order by a ;
-a concat(b,@arg00)
-1 oneMySQL
-2 twoMySQL
-3 threeMySQL
-4 fourMySQL
-prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ;
-execute stmt1 using @arg00;
-a concat(b,?)
-1 oneMySQL
-2 twoMySQL
-3 threeMySQL
-4 fourMySQL
-set @arg00='MySQL' ;
-select group_concat(@arg00,b order by a) from t1
-group by 'a' ;
-group_concat(@arg00,b order by a)
-MySQLone,MySQLtwo,MySQLthree,MySQLfour
-prepare stmt1 from ' select group_concat(?,b order by a) from t1
-group by ''a'' ' ;
-execute stmt1 using @arg00;
-group_concat(?,b order by a)
-MySQLone,MySQLtwo,MySQLthree,MySQLfour
-select group_concat(b,@arg00 order by a) from t1
-group by 'a' ;
-group_concat(b,@arg00 order by a)
-oneMySQL,twoMySQL,threeMySQL,fourMySQL
-prepare stmt1 from ' select group_concat(b,? order by a) from t1
-group by ''a'' ' ;
-execute stmt1 using @arg00;
-group_concat(b,? order by a)
-oneMySQL,twoMySQL,threeMySQL,fourMySQL
-set @arg00='first' ;
-set @arg01='second' ;
-set @arg02=NULL;
-select @arg00, @arg01 from t1 where a=1 ;
-@arg00 @arg01
-first second
-prepare stmt1 from ' select ?, ? from t1 where a=1 ' ;
-execute stmt1 using @arg00, @arg01 ;
-? ?
-first second
-execute stmt1 using @arg02, @arg01 ;
-? ?
-NULL second
-execute stmt1 using @arg00, @arg02 ;
-? ?
-first NULL
-execute stmt1 using @arg02, @arg02 ;
-? ?
-NULL NULL
-drop table if exists t5 ;
-create table t5 (id1 int(11) not null default '0',
-value2 varchar(100), value1 varchar(100)) ;
-insert into t5 values (1,'hh','hh'),(2,'hh','hh'),
-(1,'ii','ii'),(2,'ii','ii') ;
-prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ;
-set @arg00=1 ;
-set @arg01='hh' ;
-execute stmt1 using @arg00, @arg01 ;
-id1 value1
-1 hh
-1 ii
-2 hh
-drop table t5 ;
-drop table if exists t5 ;
-create table t5(session_id char(9) not null) ;
-insert into t5 values ('abc') ;
-prepare stmt1 from ' select * from t5
-where ?=''1111'' and session_id = ''abc'' ' ;
-set @arg00='abc' ;
-execute stmt1 using @arg00 ;
-session_id
-set @arg00='1111' ;
-execute stmt1 using @arg00 ;
-session_id
-abc
-set @arg00='abc' ;
-execute stmt1 using @arg00 ;
-session_id
-drop table t5 ;
-set @arg00='FROM' ;
-select a @arg00 t1 where a=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 '@arg00 t1 where a=1' at line 1
-prepare stmt1 from ' select a ? t1 where a=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 '? t1 where a=1' at line 1
-set @arg00='t1' ;
-select a from @arg00 where a=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 '@arg00 where a=1' at line 1
-prepare stmt1 from ' select a from ? where a=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 '? where a=1' at line 1
-set @arg00='WHERE' ;
-select a from t1 @arg00 a=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 '@arg00 a=1' at line 1
-prepare stmt1 from ' select a from t1 ? a=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 '? a=1' at line 1
-set @arg00=1 ;
-select a FROM t1 where a=@arg00 ;
-a
-1
-prepare stmt1 from ' select a FROM t1 where a=? ' ;
-execute stmt1 using @arg00 ;
-a
-1
-set @arg00=1000 ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=NULL ;
-select a FROM t1 where a=@arg00 ;
-a
-prepare stmt1 from ' select a FROM t1 where a=? ' ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=4 ;
-select a FROM t1 where a=sqrt(@arg00) ;
-a
-2
-prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
-execute stmt1 using @arg00 ;
-a
-2
-set @arg00=NULL ;
-select a FROM t1 where a=sqrt(@arg00) ;
-a
-prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=2 ;
-set @arg01=3 ;
-select a FROM t1 where a in (@arg00,@arg01) order by a;
-a
-2
-3
-prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a ';
-execute stmt1 using @arg00, @arg01;
-a
-2
-3
-set @arg00= 'one' ;
-set @arg01= 'two' ;
-set @arg02= 'five' ;
-prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ;
-execute stmt1 using @arg00, @arg01, @arg02 ;
-b
-one
-two
-prepare stmt1 from ' select b FROM t1 where b like ? ';
-set @arg00='two' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00='tw%' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00='%wo' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00=null ;
-insert into t9 set c1= 0, c5 = NULL ;
-select c5 from t9 where c5 > NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 > ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 < NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 < ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 = NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 = ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 <=> NULL ;
-c5
-NULL
-prepare stmt1 from ' select c5 from t9 where c5 <=> ? ';
-execute stmt1 using @arg00 ;
-c5
-NULL
-delete from t9 where c1= 0 ;
-set @arg00='>' ;
-select a FROM t1 where a @arg00 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 '@arg00 1' at line 1
-prepare stmt1 from ' select a FROM t1 where a ? 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 '? 1' at line 1
-set @arg00=1 ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL group by a - @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL group by a - ? ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00='two' ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL having b <> @arg00 order by a ;
-a b
-1 one
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL having b <> ? order by a ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-3 three
-4 four
-set @arg00=1 ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL order by a - @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL order by a - ? ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=2 ;
-select a,b from t1 order by 2 ;
-a b
-4 four
-1 one
-3 three
-2 two
-prepare stmt1 from ' select a,b from t1
-order by ? ';
-execute stmt1 using @arg00;
-a b
-4 four
-1 one
-3 three
-2 two
-set @arg00=1 ;
-execute stmt1 using @arg00;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=0 ;
-execute stmt1 using @arg00;
-ERROR 42S22: Unknown column '?' in 'order clause'
-set @arg00=1;
-prepare stmt1 from ' select a,b from t1 order by a
-limit 1 ';
-execute stmt1 ;
-a b
-1 one
-prepare stmt1 from ' select a,b from t1
-limit ? ';
-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 2
-set @arg00='b' ;
-set @arg01=0 ;
-set @arg02=2 ;
-set @arg03=2 ;
-select sum(a), @arg00 from t1 where a > @arg01
-and b is not null group by substr(b,@arg02)
-having sum(a) <> @arg03 ;
-sum(a) @arg00
-3 b
-1 b
-4 b
-prepare stmt1 from ' select sum(a), ? from t1 where a > ?
-and b is not null group by substr(b,?)
-having sum(a) <> ? ';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03;
-sum(a) ?
-3 b
-1 b
-4 b
-test_sequence
------- join tests ------
-select first.a as a1, second.a as a2
-from t1 first, t1 second
-where first.a = second.a order by a1 ;
-a1 a2
-1 1
-2 2
-3 3
-4 4
-prepare stmt1 from ' select first.a as a1, second.a as a2
- from t1 first, t1 second
- where first.a = second.a order by a1 ';
-execute stmt1 ;
-a1 a2
-1 1
-2 2
-3 3
-4 4
-set @arg00='ABC';
-set @arg01='two';
-set @arg02='one';
-select first.a, @arg00, second.a FROM t1 first, t1 second
-where @arg01 = first.b or first.a = second.a or second.b = @arg02
-order by second.a, first.a;
-a @arg00 a
-1 ABC 1
-2 ABC 1
-3 ABC 1
-4 ABC 1
-2 ABC 2
-2 ABC 3
-3 ABC 3
-2 ABC 4
-4 ABC 4
-prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
- where ? = first.b or first.a = second.a or second.b = ?
- order by second.a, first.a';
-execute stmt1 using @arg00, @arg01, @arg02;
-a ? a
-1 ABC 1
-2 ABC 1
-3 ABC 1
-4 ABC 1
-2 ABC 2
-2 ABC 3
-3 ABC 3
-2 ABC 4
-4 ABC 4
-drop table if exists t2 ;
-create table t2 as select * from t1 ;
-set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ;
-set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ;
-set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ;
-set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ;
-set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ;
-set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ;
-set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ;
-set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ;
-set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ;
-the join statement is:
-SELECT * FROM t2 right join t1 using(a) order by t2.a
-prepare stmt1 from @query9 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural right join t1 order by t2.a
-prepare stmt1 from @query8 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a
-prepare stmt1 from @query7 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 left join t1 using(a) order by t2.a
-prepare stmt1 from @query6 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural left join t1 order by t2.a
-prepare stmt1 from @query5 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a
-prepare stmt1 from @query4 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 join t1 using(a) order by t2.a
-prepare stmt1 from @query3 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural join t1 order by t2.a
-prepare stmt1 from @query2 ;
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-the join statement is:
-SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a
-prepare stmt1 from @query1 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-drop table t2 ;
-test_sequence
------- subquery tests ------
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ''two'') ';
-execute stmt1 ;
-a b
-2 two
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = 'two' ) and b=@arg00 ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ''two'') and b=? ';
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = @arg00 ) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ? ) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=3 ;
-set @arg01='three' ;
-select a,b FROM t1 where (a,b) in (select 3, 'three');
-a b
-3 three
-select a FROM t1 where (a,b) in (select @arg00,@arg01);
-a
-3
-prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) ';
-execute stmt1 using @arg00, @arg01;
-a
-3
-set @arg00=1 ;
-set @arg01='two' ;
-set @arg02=2 ;
-set @arg03='two' ;
-select a, @arg00, b FROM t1 outer_table where
-b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ;
-a @arg00 b
-2 1 two
-prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
- b=? and a = (select ? from t1 where b = ? ) ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-a ? b
-2 1 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = outer_table.b ) order by a ';
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = outer_table.b ) and b=@arg00 ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = outer_table.b) and b=? ';
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=2 ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=2 ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=1 ;
-set @arg01='two' ;
-set @arg02=2 ;
-set @arg03='two' ;
-select a, @arg00, b FROM t1 outer_table where
-b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03
-and outer_table.a=a ) ;
-a @arg00 b
-2 1 two
-prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
- b=? and a = (select ? from t1 where outer_table.b = ?
- and outer_table.a=a ) ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-a ? b
-2 1 two
-set @arg00=1 ;
-set @arg01=0 ;
-select a, @arg00
-from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2
-where a=@arg01;
-a @arg00
-0 1
-prepare stmt1 from ' select a, ?
- from ( select a - ? as a from t1 where a=? ) as t2
- where a=? ';
-execute stmt1 using @arg00, @arg00, @arg00, @arg01 ;
-a ?
-0 1
-drop table if exists t2 ;
-create table t2 as select * from t1;
-prepare stmt1 from ' select a in (select a from t2) from t1 ' ;
-execute stmt1 ;
-a in (select a from t2)
-1
-1
-1
-1
-drop table if exists t5, t6, t7 ;
-create table t5 (a int , b int) ;
-create table t6 like t5 ;
-create table t7 like t5 ;
-insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7),
-(2, -1), (3, 10) ;
-insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ;
-insert into t7 values (3, 3), (2, 2), (1, 1) ;
-prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1) from t7 ' ;
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-drop table t5, t6, t7 ;
-drop table if exists t2 ;
-create table t2 as select * from t9;
-set @stmt= ' SELECT
- (SELECT SUM(c1 + c12 + 0.0) FROM t2
- where (t9.c2 - 0e-3) = t2.c2
- GROUP BY t9.c15 LIMIT 1) as scalar_s,
- exists (select 1.0e+0 from t2
- where t2.c3 * 9.0000000000 = t9.c4) as exists_s,
- c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s,
- (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s
-FROM t9,
-(select c25 x, c32 y from t2) tt WHERE x = c25 ' ;
-prepare stmt1 from @stmt ;
-execute stmt1 ;
-execute stmt1 ;
-set @stmt= concat('explain ',@stmt);
-prepare stmt1 from @stmt ;
-execute stmt1 ;
-execute stmt1 ;
-set @stmt= ' SELECT
- (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2
- GROUP BY t9.c15 LIMIT 1) as scalar_s,
- exists (select ? from t2
- where t2.c3*?=t9.c4) as exists_s,
- c5*? in (select c6+? from t2) as in_s,
- (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s
-FROM t9,
-(select c25 x, c32 y from t2) tt WHERE x =c25 ' ;
-set @arg00= 0.0 ;
-set @arg01= 0e-3 ;
-set @arg02= 1.0e+0 ;
-set @arg03= 9.0000000000 ;
-set @arg04= 4 ;
-set @arg05= 0.3e+1 ;
-set @arg06= 4 ;
-set @arg07= 4 ;
-set @arg08= 4.0 ;
-set @arg09= 40e-1 ;
-prepare stmt1 from @stmt ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-set @stmt= concat('explain ',@stmt);
-prepare stmt1 from @stmt ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-drop table t2 ;
-select 1 < (select a from t1) ;
-ERROR 21000: Subquery returns more than 1 row
-prepare stmt1 from ' select 1 < (select a from t1) ' ;
-execute stmt1 ;
-ERROR 21000: Subquery returns more than 1 row
-select 1 as my_col ;
-my_col
-1
-test_sequence
------- union tests ------
-prepare stmt1 from ' select a FROM t1 where a=1
- union distinct
- select a FROM t1 where a=1 ';
-execute stmt1 ;
-a
-1
-execute stmt1 ;
-a
-1
-prepare stmt1 from ' select a FROM t1 where a=1
- union all
- select a FROM t1 where a=1 ';
-execute stmt1 ;
-a
-1
-1
-prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-set @arg00=1 ;
-select @arg00 FROM t1 where a=1
-union distinct
-select 1 FROM t1 where a=1;
-@arg00
-1
-prepare stmt1 from ' select ? FROM t1 where a=1
- union distinct
- select 1 FROM t1 where a=1 ' ;
-execute stmt1 using @arg00;
-?
-1
-set @arg00=1 ;
-select 1 FROM t1 where a=1
-union distinct
-select @arg00 FROM t1 where a=1;
-1
-1
-prepare stmt1 from ' select 1 FROM t1 where a=1
- union distinct
- select ? FROM t1 where a=1 ' ;
-execute stmt1 using @arg00;
-1
-1
-set @arg00='a' ;
-select @arg00 FROM t1 where a=1
-union distinct
-select @arg00 FROM t1 where a=1;
-@arg00
-a
-prepare stmt1 from ' select ? FROM t1 where a=1
- union distinct
- select ? FROM t1 where a=1 ';
-execute stmt1 using @arg00, @arg00;
-?
-a
-prepare stmt1 from ' select ?
- union distinct
- select ? ';
-execute stmt1 using @arg00, @arg00;
-?
-a
-set @arg00='a' ;
-set @arg01=1 ;
-set @arg02='a' ;
-set @arg03=2 ;
-select @arg00 FROM t1 where a=@arg01
-union distinct
-select @arg02 FROM t1 where a=@arg03;
-@arg00
-a
-prepare stmt1 from ' select ? FROM t1 where a=?
- union distinct
- select ? FROM t1 where a=? ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03;
-?
-a
-set @arg00=1 ;
-prepare stmt1 from ' select sum(a) + 200, ? from t1
-union distinct
-select sum(a) + 200, 1 from t1
-group by b ' ;
-execute stmt1 using @arg00;
-sum(a) + 200 ?
-210 1
-204 1
-201 1
-203 1
-202 1
-set @Oporto='Oporto' ;
-set @Lisboa='Lisboa' ;
-set @0=0 ;
-set @1=1 ;
-set @2=2 ;
-set @3=3 ;
-set @4=4 ;
-select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ;
-@Oporto @Lisboa @0 @1 @2 @3 @4
-Oporto Lisboa 0 1 2 3 4
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-group by b
-union distinct
-select sum(a) + 200, @Lisboa from t1
-group by b ;
-the_sum the_town
-204 Oporto
-201 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-201 Lisboa
-203 Lisboa
-202 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- group by b
- union distinct
- select sum(a) + 200, ? from t1
- group by b ' ;
-execute stmt1 using @Oporto, @Lisboa;
-the_sum the_town
-204 Oporto
-201 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-201 Lisboa
-203 Lisboa
-202 Lisboa
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-where a > @1
-group by b
-union distinct
-select sum(a) + 200, @Lisboa from t1
-where a > @2
-group by b ;
-the_sum the_town
-204 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-203 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- where a > ?
- group by b
- union distinct
- select sum(a) + 200, ? from t1
- where a > ?
- group by b ' ;
-execute stmt1 using @Oporto, @1, @Lisboa, @2;
-the_sum the_town
-204 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-203 Lisboa
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-where a > @1
-group by b
-having avg(a) > @2
-union distinct
-select sum(a) + 200, @Lisboa from t1
-where a > @2
-group by b
-having avg(a) > @3;
-the_sum the_town
-204 Oporto
-203 Oporto
-204 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- where a > ?
- group by b
- having avg(a) > ?
- union distinct
- select sum(a) + 200, ? from t1
- where a > ?
- group by b
- having avg(a) > ? ';
-execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3;
-the_sum the_town
-204 Oporto
-203 Oporto
-204 Lisboa
-test_sequence
------- explain select tests ------
-prepare stmt1 from ' explain select * from t9 ' ;
-execute stmt1;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def id 8 3 1 N 32801 0 8
-def select_type 253 19 6 N 1 31 33
-def table 253 64 2 N 1 31 33
-def type 253 10 3 N 1 31 33
-def possible_keys 253 4096 0 Y 0 31 33
-def key 253 64 0 Y 0 31 33
-def key_len 8 3 0 Y 32800 0 8
-def ref 253 1024 0 Y 0 31 33
-def rows 8 10 1 N 32801 0 8
-def Extra 253 255 0 N 1 31 33
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t9 ALL NULL NULL NULL NULL 2
-test_sequence
------- delete tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'delete from t1 where a=2' ;
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-execute stmt1;
-insert into t1 values(0,NULL);
-set @arg00=NULL;
-prepare stmt1 from 'delete from t1 where b=?' ;
-execute stmt1 using @arg00;
-select a,b from t1 where b is NULL ;
-a b
-0 NULL
-set @arg00='one';
-execute stmt1 using @arg00;
-select a,b from t1 where b=@arg00;
-a b
-prepare stmt1 from 'truncate table t1' ;
-ERROR HY000: This command is not supported in the prepared statement protocol yet
-test_sequence
------- update tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ;
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-2 a=two
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-2 a=two
-set @arg00=NULL;
-prepare stmt1 from 'update t1 set b=? where a=2' ;
-execute stmt1 using @arg00;
-select a,b from t1 where a=2;
-a b
-2 NULL
-set @arg00='two';
-execute stmt1 using @arg00;
-select a,b from t1 where a=2;
-a b
-2 two
-set @arg00=2;
-prepare stmt1 from 'update t1 set b=NULL where a=?' ;
-execute stmt1 using @arg00;
-select a,b from t1 where a=@arg00;
-a b
-2 NULL
-update t1 set b='two' where a=@arg00;
-set @arg00=2000;
-execute stmt1 using @arg00;
-select a,b from t1 where a=@arg00;
-a b
-set @arg00=2;
-set @arg01=22;
-prepare stmt1 from 'update t1 set a=? where a=?' ;
-execute stmt1 using @arg00, @arg00;
-select a,b from t1 where a=@arg00;
-a b
-2 two
-execute stmt1 using @arg01, @arg00;
-select a,b from t1 where a=@arg01;
-a b
-22 two
-execute stmt1 using @arg00, @arg01;
-select a,b from t1 where a=@arg00;
-a b
-2 two
-set @arg00=NULL;
-set @arg01=2;
-execute stmt1 using @arg00, @arg01;
-Warnings:
-Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
-select a,b from t1 order by a;
-a b
-0 two
-1 one
-3 three
-4 four
-set @arg00=0;
-execute stmt1 using @arg01, @arg00;
-select a,b from t1 order by a;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=23;
-set @arg01='two';
-set @arg02=2;
-set @arg03='two';
-set @arg04=2;
-drop table if exists t2;
-create table t2 as select a,b from t1 ;
-prepare stmt1 from 'update t1 set a=? where b=?
- and a in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 where a = @arg00 ;
-a b
-23 two
-prepare stmt1 from 'update t1 set a=? where b=?
- and a not in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 order by a ;
-a b
-1 one
-2 two
-3 three
-4 four
-drop table t2 ;
-create table t2
-(
-a int, b varchar(30),
-primary key(a)
-) engine = 'MYISAM' ;
-insert into t2(a,b) select a, b from t1 ;
-prepare stmt1 from 'update t1 set a=? where b=?
- and a in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 where a = @arg00 ;
-a b
-23 two
-prepare stmt1 from 'update t1 set a=? where b=?
- and a not in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 order by a ;
-a b
-1 one
-2 two
-3 three
-4 four
-drop table t2 ;
-set @arg00=1;
-prepare stmt1 from 'update t1 set b=''bla''
-where a=2
-limit 1';
-execute stmt1 ;
-select a,b from t1 where b = 'bla' ;
-a b
-2 bla
-prepare stmt1 from 'update t1 set b=''bla''
-where a=2
-limit ?';
-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 3
-test_sequence
------- insert tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'insert into t1 values(5, ''five'' )';
-execute stmt1;
-select a,b from t1 where a = 5;
-a b
-5 five
-set @arg00='six' ;
-prepare stmt1 from 'insert into t1 values(6, ? )';
-execute stmt1 using @arg00;
-select a,b from t1 where b = @arg00;
-a b
-6 six
-execute stmt1 using @arg00;
-ERROR 23000: Duplicate entry '6' for key 1
-set @arg00=NULL ;
-prepare stmt1 from 'insert into t1 values(0, ? )';
-execute stmt1 using @arg00;
-select a,b from t1 where b is NULL;
-a b
-0 NULL
-set @arg00=8 ;
-set @arg01='eight' ;
-prepare stmt1 from 'insert into t1 values(?, ? )';
-execute stmt1 using @arg00, @arg01 ;
-select a,b from t1 where b = @arg01;
-a b
-8 eight
-set @NULL= null ;
-set @arg00= 'abc' ;
-execute stmt1 using @NULL, @NULL ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @NULL ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @arg00 ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @arg00 ;
-ERROR 23000: Column 'a' cannot be null
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @arg00 ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @arg00 ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 abc
-10002 abc
-delete from t1 where a > 10000 ;
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @NULL ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @NULL ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 NULL
-10002 NULL
-delete from t1 where a > 10000 ;
-set @arg01= 10000 + 10 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 9 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 8 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 7 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 6 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 5 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 4 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 3 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @arg01 ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 10001
-10002 10002
-10003 10003
-10004 10004
-10005 10005
-10006 10006
-10007 10007
-10008 10008
-10009 10009
-10010 10010
-delete from t1 where a > 10000 ;
-set @arg00=81 ;
-set @arg01='8-1' ;
-set @arg02=82 ;
-set @arg03='8-2' ;
-prepare stmt1 from 'insert into t1 values(?,?),(?,?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-select a,b from t1 where a in (@arg00,@arg02) ;
-a b
-81 8-1
-82 8-2
-set @arg00=9 ;
-set @arg01='nine' ;
-prepare stmt1 from 'insert into t1 set a=?, b=? ';
-execute stmt1 using @arg00, @arg01 ;
-select a,b from t1 where a = @arg00 ;
-a b
-9 nine
-set @arg00=6 ;
-set @arg01=1 ;
-prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
- on duplicate key update a=a + ?, b=concat(b,''modified'') ';
-execute stmt1 using @arg00, @arg01;
-select * from t1 order by a;
-a b
-0 NULL
-1 one
-2 two
-3 three
-4 four
-5 five
-7 sixmodified
-8 eight
-9 nine
-81 8-1
-82 8-2
-set @arg00=81 ;
-set @arg01=1 ;
-execute stmt1 using @arg00, @arg01;
-ERROR 23000: Duplicate entry '82' for key 1
-drop table if exists t2 ;
-create table t2 (id int auto_increment primary key)
-ENGINE= 'MYISAM' ;
-prepare stmt1 from ' select last_insert_id() ' ;
-insert into t2 values (NULL) ;
-execute stmt1 ;
-last_insert_id()
-1
-insert into t2 values (NULL) ;
-execute stmt1 ;
-last_insert_id()
-2
-drop table t2 ;
-set @1000=1000 ;
-set @x1000_2="x1000_2" ;
-set @x1000_3="x1000_3" ;
-set @x1000="x1000" ;
-set @1100=1100 ;
-set @x1100="x1100" ;
-set @100=100 ;
-set @updated="updated" ;
-insert into t1 values(1000,'x1000_1') ;
-insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
-on duplicate key update a = a + @100, b = concat(b,@updated) ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 x1000_3
-1100 x1000_1updated
-delete from t1 where a >= 1000 ;
-insert into t1 values(1000,'x1000_1') ;
-prepare stmt1 from ' insert into t1 values(?,?),(?,?)
- on duplicate key update a = a + ?, b = concat(b,?) ';
-execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 x1000_3
-1100 x1000_1updated
-delete from t1 where a >= 1000 ;
-insert into t1 values(1000,'x1000_1') ;
-execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1200 x1000_1updatedupdated
-delete from t1 where a >= 1000 ;
-prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
-execute stmt1;
-execute stmt1;
-execute stmt1;
-test_sequence
------- multi table tests ------
-delete from t1 ;
-delete from t9 ;
-insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ;
-insert into t9 (c1,c21)
-values (1, 'one'), (2, 'two'), (3, 'three') ;
-prepare stmt_delete from " delete t1, t9
- from t1, t9 where t1.a=t9.c1 and t1.b='updated' ";
-prepare stmt_update from " update t1, t9
- set t1.b='updated', t9.c21='updated'
- where t1.a=t9.c1 and t1.a=? ";
-prepare stmt_select1 from " select a, b from t1 order by a" ;
-prepare stmt_select2 from " select c1, c21 from t9 order by c1" ;
-set @arg00= 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-2 two
-3 three
-execute stmt_select2 ;
-c1 c21
-2 two
-3 three
-set @arg00= @arg00 + 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-3 three
-execute stmt_select2 ;
-c1 c21
-3 three
-set @arg00= @arg00 + 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-execute stmt_select2 ;
-c1 c21
-set @arg00= @arg00 + 1 ;
-drop table if exists t5 ;
-set @arg01= 8;
-set @arg02= 8.0;
-set @arg03= 80.00000000000e-1;
-set @arg04= 'abc' ;
-set @arg05= CAST('abc' as binary) ;
-set @arg06= '1991-08-05' ;
-set @arg07= CAST('1991-08-05' as date);
-set @arg08= '1991-08-05 01:01:01' ;
-set @arg09= CAST('1991-08-05 01:01:01' as datetime) ;
-set @arg10= unix_timestamp('1991-01-01 01:01:01');
-set @arg11= YEAR('1991-01-01 01:01:01');
-set @arg12= 8 ;
-set @arg12= NULL ;
-set @arg13= 8.0 ;
-set @arg13= NULL ;
-set @arg14= 'abc';
-set @arg14= NULL ;
-set @arg15= CAST('abc' as binary) ;
-set @arg15= NULL ;
-create table t5 as select
-8 as const01, @arg01 as param01,
-8.0 as const02, @arg02 as param02,
-80.00000000000e-1 as const03, @arg03 as param03,
-'abc' as const04, @arg04 as param04,
-CAST('abc' as binary) as const05, @arg05 as param05,
-'1991-08-05' as const06, @arg06 as param06,
-CAST('1991-08-05' as date) as const07, @arg07 as param07,
-'1991-08-05 01:01:01' as const08, @arg08 as param08,
-CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09,
-unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10,
-YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11,
-NULL as const12, @arg12 as param12,
-@arg13 as param13,
-@arg14 as param14,
-@arg15 as param15;
-show create table t5 ;
-Table Create Table
-t5 CREATE TABLE `t5` (
- `const01` bigint(1) NOT NULL default '0',
- `param01` bigint(20) default NULL,
- `const02` double(3,1) NOT NULL default '0.0',
- `param02` double default NULL,
- `const03` double NOT NULL default '0',
- `param03` double default NULL,
- `const04` char(3) NOT NULL default '',
- `param04` longtext,
- `const05` binary(3) NOT NULL default '',
- `param05` longblob,
- `const06` varchar(10) NOT NULL default '',
- `param06` longtext,
- `const07` date default NULL,
- `param07` longblob,
- `const08` varchar(19) NOT NULL default '',
- `param08` longtext,
- `const09` datetime default NULL,
- `param09` longblob,
- `const10` int(10) NOT NULL default '0',
- `param10` bigint(20) default NULL,
- `const11` int(4) default NULL,
- `param11` bigint(20) default NULL,
- `const12` binary(0) default NULL,
- `param12` bigint(20) default NULL,
- `param13` double default NULL,
- `param14` longtext,
- `param15` longblob
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-select * from t5 ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def test t5 t5 const01 const01 8 1 1 N 32769 0 63
-def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 5 3 3 N 32769 1 63
-def test t5 t5 param02 param02 5 20 1 Y 32768 31 63
-def test t5 t5 const03 const03 5 23 1 N 32769 31 63
-def test t5 t5 param03 param03 5 20 1 Y 32768 31 63
-def test t5 t5 const04 const04 254 3 3 N 1 0 8
-def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8
-def test t5 t5 const05 const05 254 3 3 N 129 0 63
-def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63
-def test t5 t5 const06 const06 253 10 10 N 1 0 8
-def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8
-def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63
-def test t5 t5 const08 const08 253 19 19 N 1 0 8
-def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8
-def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63
-def test t5 t5 const10 const10 3 10 9 N 32769 0 63
-def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
-def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
-def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
-def test t5 t5 const12 const12 254 0 0 Y 128 0 63
-def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
-def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
-def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
-const01 8
-param01 8
-const02 8.0
-param02 8
-const03 8
-param03 8
-const04 abc
-param04 abc
-const05 abc
-param05 abc
-const06 1991-08-05
-param06 1991-08-05
-const07 1991-08-05
-param07 1991-08-05
-const08 1991-08-05 01:01:01
-param08 1991-08-05 01:01:01
-const09 1991-08-05 01:01:01
-param09 1991-08-05 01:01:01
-const10 662680861
-param10 662680861
-const11 1991
-param11 1991
-const12 NULL
-param12 NULL
-param13 NULL
-param14 NULL
-param15 NULL
-drop table t5 ;
-test_sequence
------- data type conversion tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ;
-select * from t9 order by c1 ;
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
-test_sequence
------- select @parameter:= column ------
-prepare full_info from "select @arg01, @arg02, @arg03, @arg04,
- @arg05, @arg06, @arg07, @arg08,
- @arg09, @arg10, @arg11, @arg12,
- @arg13, @arg14, @arg15, @arg16,
- @arg17, @arg18, @arg19, @arg20,
- @arg21, @arg22, @arg23, @arg24,
- @arg25, @arg26, @arg27, @arg28,
- @arg29, @arg30, @arg31, @arg32" ;
-select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
-@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
-@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
-@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
-@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
-@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
-@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
-@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= 1 ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
-@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
-@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
-@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
-@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
-@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
-@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
-@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= 0 ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select
- @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
- @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
- @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
- @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
- @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
- @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
- @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
- @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= ?" ;
-set @my_key= 1 ;
-execute stmt1 using @my_key ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-set @my_key= 0 ;
-execute stmt1 using @my_key ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select ? := c1 from t9 where c1= 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 ':= c1 from t9 where c1= 1' at line 1
-test_sequence
------- select column, .. into @parm,.. ------
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
-c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
-c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
-@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
-@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
-@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= 1 ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
-c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
-c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
-@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
-@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
-@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= 0 ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
- c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
- c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
- @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
- @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
- @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= ?" ;
-set @my_key= 1 ;
-execute stmt1 using @my_key ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-set @my_key= 0 ;
-execute stmt1 using @my_key ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select c1 into ? from t9 where c1= 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 '? from t9 where c1= 1' at line 1
-test_sequence
--- insert into numeric columns --
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ;
-set @arg00= 21 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ;
-execute stmt1 ;
-set @arg00= 23;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0,
-30.0, 30.0, 30.0 ) ;
-set @arg00= 31.0 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0,
- 32.0, 32.0, 32.0 )" ;
-execute stmt1 ;
-set @arg00= 33.0;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( '40', '40', '40', '40', '40', '40', '40', '40',
-'40', '40', '40' ) ;
-set @arg00= '41' ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( '42', '42', '42', '42', '42', '42', '42', '42',
- '42', '42', '42' )" ;
-execute stmt1 ;
-set @arg00= '43';
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ;
-set @arg00= CAST('51' as binary) ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ;
-execute stmt1 ;
-set @arg00= CAST('53' as binary) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 2 ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-NULL, NULL, NULL ) ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 61, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL )" ;
-execute stmt1 ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 8.0 ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 71, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 'abc' ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 81, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
-from t9 where c1 >= 20
-order by c1 ;
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12
-20 20 20 20 20 20 20 20 20 20 20.0000
-21 21 21 21 21 21 21 21 21 21 21.0000
-22 22 22 22 22 22 22 22 22 22 22.0000
-23 23 23 23 23 23 23 23 23 23 23.0000
-30 30 30 30 30 30 30 30 30 30 30.0000
-31 31 31 31 31 31 31 31 31 31 31.0000
-32 32 32 32 32 32 32 32 32 32 32.0000
-33 33 33 33 33 33 33 33 33 33 33.0000
-40 40 40 40 40 40 40 40 40 40 40.0000
-41 41 41 41 41 41 41 41 41 41 41.0000
-42 42 42 42 42 42 42 42 42 42 42.0000
-43 43 43 43 43 43 43 43 43 43 43.0000
-50 50 50 50 50 50 50 50 50 50 50.0000
-51 51 51 51 51 51 51 51 51 51 51.0000
-52 52 52 52 52 52 52 52 52 52 52.0000
-53 53 53 53 53 53 53 53 53 53 53.0000
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-test_sequence
--- select .. where numeric column = .. --
-set @arg00= 20;
-select 'true' as found from t9
-where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
-and c8= 20 and c9= 20 and c10= 20 and c12= 20;
-found
-true
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
- and c8= 20 and c9= 20 and c10= 20 and c12= 20 ";
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20.0;
-select 'true' as found from t9
-where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
-and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0;
-found
-true
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
- and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 ";
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-select 'true' as found from t9
-where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
- and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20';
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
- and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' ";
-execute stmt1 ;
-found
-true
-set @arg00= '20';
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-select 'true' as found from t9
-where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
-c3= CAST('20' as binary) and c4= CAST('20' as binary) and
-c5= CAST('20' as binary) and c6= CAST('20' as binary) and
-c7= CAST('20' as binary) and c8= CAST('20' as binary) and
-c9= CAST('20' as binary) and c10= CAST('20' as binary) and
-c12= CAST('20' as binary);
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
- c3= CAST('20' as binary) and c4= CAST('20' as binary) and
- c5= CAST('20' as binary) and c6= CAST('20' as binary) and
- c7= CAST('20' as binary) and c8= CAST('20' as binary) and
- c9= CAST('20' as binary) and c10= CAST('20' as binary) and
- c12= CAST('20' as binary) ";
-execute stmt1 ;
-found
-true
-set @arg00= CAST('20' as binary) ;
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-delete from t9 ;
-test_sequence
--- some numeric overflow experiments --
-prepare my_insert from "insert into t9
- ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
-from t9 where c21 = 'O' ";
-prepare my_delete from "delete from t9 where c21 = 'O' ";
-set @arg00= 9223372036854775807 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
-c12 99999.9999
-execute my_delete ;
-set @arg00= '9223372036854775807' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
-c12 99999.9999
-execute my_delete ;
-set @arg00= -9223372036854775808 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
-c12 -9999.9999
-execute my_delete ;
-set @arg00= '-9223372036854775808' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
-c12 -9999.9999
-execute my_delete ;
-set @arg00= 1.11111111111111111111e+50 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
-c12 99999.9999
-execute my_delete ;
-set @arg00= '1.11111111111111111111e+50' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1265 Data truncated for column 'c1' at row 1
-Warning 1265 Data truncated for column 'c2' at row 1
-Warning 1265 Data truncated for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1265 Data truncated for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 1
-c2 1
-c3 1
-c4 1
-c5 1
-c6 1
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
-c12 99999.9999
-execute my_delete ;
-set @arg00= -1.11111111111111111111e+50 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
-c12 -9999.9999
-execute my_delete ;
-set @arg00= '-1.11111111111111111111e+50' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1265 Data truncated for column 'c1' at row 1
-Warning 1265 Data truncated for column 'c2' at row 1
-Warning 1265 Data truncated for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1265 Data truncated for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -1
-c2 -1
-c3 -1
-c4 -1
-c5 -1
-c6 -1
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
-c12 -9999.9999
-execute my_delete ;
-test_sequence
--- insert into string columns --
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30
-from t9 where c1 >= 20
-order by c1 ;
-c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30
-20 2 20 20 20 20 20 20 20 20 20 20
-21 2 21 21 21 21 21 21 21 21 21 21
-22 2 22 22 22 22 22 22 22 22 22 22
-23 2 23 23 23 23 23 23 23 23 23 23
-30 3 30 30 30 30 30 30 30 30 30 30
-31 3 31 31 31 31 31 31 31 31 31 31
-32 3 32 32 32 32 32 32 32 32 32 32
-33 3 33 33 33 33 33 33 33 33 33 33
-40 4 40 40 40 40 40 40 40 40 40 40
-41 4 41 41 41 41 41 41 41 41 41 41
-42 4 42 42 42 42 42 42 42 42 42 42
-43 4 43 43 43 43 43 43 43 43 43 43
-50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00
-51 5 51 51 51 51 51 51 51 51 51 51
-52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00
-53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00
-54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00
-55 5 55 55 55 55 55 55 55 55 55 55
-56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00
-57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-test_sequence
--- select .. where string column = .. --
-set @arg00= '20';
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
-c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
-c27= '20' and c28= '20' and c29= '20' and c30= '20' ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
- c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
- c27= '20' and c28= '20' and c29= '20' and c30= '20'" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= CAST('20' as binary);
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
-= CAST('20' as binary) and c21= CAST('20' as binary)
-and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
-c24= CAST('20' as binary) and c25= CAST('20' as binary) and
-c26= CAST('20' as binary) and c27= CAST('20' as binary) and
-c28= CAST('20' as binary) and c29= CAST('20' as binary) and
-c30= CAST('20' as binary) ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and
-c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
- = CAST('20' as binary) and c21= CAST('20' as binary)
- and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
- c24= CAST('20' as binary) and c25= CAST('20' as binary) and
- c26= CAST('20' as binary) and c27= CAST('20' as binary) and
- c28= CAST('20' as binary) and c29= CAST('20' as binary) and
- c30= CAST('20' as binary)" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and
- c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and
- c29= ? and c30= ?";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20;
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
-c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
-c27= 20 and c28= 20 and c29= 20 and c30= 20 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
- c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
- c27= 20 and c28= 20 and c29= 20 and c30= 20" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20.0;
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
-c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
-c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
- c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
- c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-delete from t9 ;
-test_sequence
--- insert into date/time columns --
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-select c1, c13, c14, c15, c16, c17 from t9 order by c1 ;
-c1 c13 c14 c15 c16 c17
-20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-60 NULL NULL 1991-01-01 01:01:01 NULL NULL
-61 NULL NULL 1991-01-01 01:01:01 NULL NULL
-62 NULL NULL 1991-01-01 01:01:01 NULL NULL
-63 NULL NULL 1991-01-01 01:01:01 NULL NULL
-71 NULL NULL 1991-01-01 01:01:01 NULL NULL
-73 NULL NULL 1991-01-01 01:01:01 NULL NULL
-81 NULL NULL 1991-01-01 01:01:01 NULL NULL
-83 NULL NULL 1991-01-01 01:01:01 NULL NULL
-test_sequence
--- select .. where date/time column = .. --
-set @arg00= '1991-01-01 01:01:01' ;
-select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
-c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
-c17= '1991-01-01 01:01:01' ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
-and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
- c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
- c17= '1991-01-01 01:01:01'" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
-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
-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
-c17= CAST('1991-01-01 01:01:01' as datetime) ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
-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
- 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
- c17= CAST('1991-01-01 01:01:01' as datetime)" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 1991 ;
-select 'true' as found from t9
-where c1= 20 and c17= 1991 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c17= 1991" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c17= ?" ;
-execute stmt1 using @arg00 ;
-found
-true
-set @arg00= 1.991e+3 ;
-select 'true' as found from t9
-where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and abs(c17 - @arg00) < 0.01 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and abs(c17 - ?) < 0.01" ;
-execute stmt1 using @arg00 ;
-found
-true
-drop table t1, t1_1, t1_2,
-t9_1, t9_2, t9;
diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result
index 79bb5879d24..b6fb52c1120 100644
--- a/mysql-test/r/ps_6bdb.result
+++ b/mysql-test/r/ps_6bdb.result
@@ -1670,6 +1670,9 @@ a b
1003 duplicate three
1004 duplicate four
delete from t1 where a >= 1000 ;
+set @1=1 ;
+set @2=2 ;
+set @100=100 ;
set @float=1.00;
set @five='five' ;
drop table if exists t2;
@@ -1923,7 +1926,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -2020,7 +2023,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2108,7 +2111,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2198,7 +2201,7 @@ def @arg28 253 8192 10 Y 0 31 8
def @arg29 253 8192 8 Y 128 31 63
def @arg30 253 8192 8 Y 0 31 8
def @arg31 253 8192 3 Y 0 31 8
-def @arg32 253 8192 6 Y 128 31 63
+def @arg32 253 8192 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
diff --git a/mysql-test/r/ps_6bdb.result.es b/mysql-test/r/ps_6bdb.result.es
deleted file mode 100644
index 7b7f7e23bbf..00000000000
--- a/mysql-test/r/ps_6bdb.result.es
+++ /dev/null
@@ -1,3113 +0,0 @@
-use test;
-drop table if exists t1, t9 ;
-create table t1
-(
-a int, b varchar(30),
-primary key(a)
-) engine = 'BDB' ;
-create table t9
-(
-c1 tinyint, c2 smallint, c3 mediumint, c4 int,
-c5 integer, c6 bigint, c7 float, c8 double,
-c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp(14), c16 time,
-c17 year, c18 bit, c19 bool, c20 char,
-c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
-c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
-c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
-c32 set('monday', 'tuesday', 'wednesday'),
-primary key(c1)
-) engine = 'BDB' ;
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-test_sequence
------- simple select tests ------
-prepare stmt1 from ' select * from t9 order by c1 ' ;
-execute stmt1;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def test t9 t9 c1 c1 1 4 1 N 49155 0 63
-def test t9 t9 c2 c2 2 6 1 Y 32768 0 63
-def test t9 t9 c3 c3 9 9 1 Y 32768 0 63
-def test t9 t9 c4 c4 3 11 1 Y 32768 0 63
-def test t9 t9 c5 c5 3 11 1 Y 32768 0 63
-def test t9 t9 c6 c6 8 20 1 Y 32768 0 63
-def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
-def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
-def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
-def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 0 9 6 Y 32768 4 63
-def test t9 t9 c12 c12 0 10 6 Y 32768 4 63
-def test t9 t9 c13 c13 10 10 10 Y 128 0 63
-def test t9 t9 c14 c14 12 19 19 Y 128 0 63
-def test t9 t9 c15 c15 7 19 19 N 1249 0 63
-def test t9 t9 c16 c16 11 8 8 Y 128 0 63
-def test t9 t9 c17 c17 13 4 4 Y 32864 0 63
-def test t9 t9 c18 c18 1 1 1 Y 32768 0 63
-def test t9 t9 c19 c19 1 1 1 Y 32768 0 63
-def test t9 t9 c20 c20 254 1 1 Y 0 0 8
-def test t9 t9 c21 c21 253 10 10 Y 0 0 8
-def test t9 t9 c22 c22 253 30 30 Y 0 0 8
-def test t9 t9 c23 c23 252 255 8 Y 144 0 63
-def test t9 t9 c24 c24 252 255 8 Y 16 0 8
-def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
-def test t9 t9 c26 c26 252 65535 4 Y 16 0 8
-def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63
-def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8
-def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63
-def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8
-def test t9 t9 c31 c31 254 5 3 Y 256 0 8
-def test t9 t9 c32 c32 254 24 7 Y 2048 0 8
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
-set @arg00='SELECT' ;
-prepare stmt1 from ' ? a from t1 where a=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 '? a from t1 where a=1' at line 1
-set @arg00=1 ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-1 one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-1 one
-set @arg00='lion' ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-lion one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-lion one
-set @arg00=NULL ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-NULL one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-NULL one
-set @arg00=1 ;
-select b, a - @arg00 from t1 where a=1 ;
-b a - @arg00
-one 0
-prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-b a - ?
-one 0
-set @arg00=null ;
-select @arg00 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select ? as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-select @arg00 + 1 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select ? + 1 as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-select 1 + @arg00 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select 1 + ? as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-set @arg00='MySQL' ;
-select substr(@arg00,1,2) from t1 where a=1 ;
-substr(@arg00,1,2)
-My
-prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr(?,1,2)
-My
-set @arg00=3 ;
-select substr('MySQL',@arg00,5) from t1 where a=1 ;
-substr('MySQL',@arg00,5)
-SQL
-prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr('MySQL',?,5)
-SQL
-select substr('MySQL',1,@arg00) from t1 where a=1 ;
-substr('MySQL',1,@arg00)
-MyS
-prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr('MySQL',1,?)
-MyS
-set @arg00='MySQL' ;
-select a , concat(@arg00,b) from t1 order by a;
-a concat(@arg00,b)
-1 MySQLone
-2 MySQLtwo
-3 MySQLthree
-4 MySQLfour
-prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ;
-execute stmt1 using @arg00;
-a concat(?,b)
-1 MySQLone
-2 MySQLtwo
-3 MySQLthree
-4 MySQLfour
-select a , concat(b,@arg00) from t1 order by a ;
-a concat(b,@arg00)
-1 oneMySQL
-2 twoMySQL
-3 threeMySQL
-4 fourMySQL
-prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ;
-execute stmt1 using @arg00;
-a concat(b,?)
-1 oneMySQL
-2 twoMySQL
-3 threeMySQL
-4 fourMySQL
-set @arg00='MySQL' ;
-select group_concat(@arg00,b order by a) from t1
-group by 'a' ;
-group_concat(@arg00,b order by a)
-MySQLone,MySQLtwo,MySQLthree,MySQLfour
-prepare stmt1 from ' select group_concat(?,b order by a) from t1
-group by ''a'' ' ;
-execute stmt1 using @arg00;
-group_concat(?,b order by a)
-MySQLone,MySQLtwo,MySQLthree,MySQLfour
-select group_concat(b,@arg00 order by a) from t1
-group by 'a' ;
-group_concat(b,@arg00 order by a)
-oneMySQL,twoMySQL,threeMySQL,fourMySQL
-prepare stmt1 from ' select group_concat(b,? order by a) from t1
-group by ''a'' ' ;
-execute stmt1 using @arg00;
-group_concat(b,? order by a)
-oneMySQL,twoMySQL,threeMySQL,fourMySQL
-set @arg00='first' ;
-set @arg01='second' ;
-set @arg02=NULL;
-select @arg00, @arg01 from t1 where a=1 ;
-@arg00 @arg01
-first second
-prepare stmt1 from ' select ?, ? from t1 where a=1 ' ;
-execute stmt1 using @arg00, @arg01 ;
-? ?
-first second
-execute stmt1 using @arg02, @arg01 ;
-? ?
-NULL second
-execute stmt1 using @arg00, @arg02 ;
-? ?
-first NULL
-execute stmt1 using @arg02, @arg02 ;
-? ?
-NULL NULL
-drop table if exists t5 ;
-create table t5 (id1 int(11) not null default '0',
-value2 varchar(100), value1 varchar(100)) ;
-insert into t5 values (1,'hh','hh'),(2,'hh','hh'),
-(1,'ii','ii'),(2,'ii','ii') ;
-prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ;
-set @arg00=1 ;
-set @arg01='hh' ;
-execute stmt1 using @arg00, @arg01 ;
-id1 value1
-1 hh
-1 ii
-2 hh
-drop table t5 ;
-drop table if exists t5 ;
-create table t5(session_id char(9) not null) ;
-insert into t5 values ('abc') ;
-prepare stmt1 from ' select * from t5
-where ?=''1111'' and session_id = ''abc'' ' ;
-set @arg00='abc' ;
-execute stmt1 using @arg00 ;
-session_id
-set @arg00='1111' ;
-execute stmt1 using @arg00 ;
-session_id
-abc
-set @arg00='abc' ;
-execute stmt1 using @arg00 ;
-session_id
-drop table t5 ;
-set @arg00='FROM' ;
-select a @arg00 t1 where a=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 '@arg00 t1 where a=1' at line 1
-prepare stmt1 from ' select a ? t1 where a=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 '? t1 where a=1' at line 1
-set @arg00='t1' ;
-select a from @arg00 where a=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 '@arg00 where a=1' at line 1
-prepare stmt1 from ' select a from ? where a=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 '? where a=1' at line 1
-set @arg00='WHERE' ;
-select a from t1 @arg00 a=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 '@arg00 a=1' at line 1
-prepare stmt1 from ' select a from t1 ? a=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 '? a=1' at line 1
-set @arg00=1 ;
-select a FROM t1 where a=@arg00 ;
-a
-1
-prepare stmt1 from ' select a FROM t1 where a=? ' ;
-execute stmt1 using @arg00 ;
-a
-1
-set @arg00=1000 ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=NULL ;
-select a FROM t1 where a=@arg00 ;
-a
-prepare stmt1 from ' select a FROM t1 where a=? ' ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=4 ;
-select a FROM t1 where a=sqrt(@arg00) ;
-a
-2
-prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
-execute stmt1 using @arg00 ;
-a
-2
-set @arg00=NULL ;
-select a FROM t1 where a=sqrt(@arg00) ;
-a
-prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=2 ;
-set @arg01=3 ;
-select a FROM t1 where a in (@arg00,@arg01) order by a;
-a
-2
-3
-prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a ';
-execute stmt1 using @arg00, @arg01;
-a
-2
-3
-set @arg00= 'one' ;
-set @arg01= 'two' ;
-set @arg02= 'five' ;
-prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ;
-execute stmt1 using @arg00, @arg01, @arg02 ;
-b
-one
-two
-prepare stmt1 from ' select b FROM t1 where b like ? ';
-set @arg00='two' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00='tw%' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00='%wo' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00=null ;
-insert into t9 set c1= 0, c5 = NULL ;
-select c5 from t9 where c5 > NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 > ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 < NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 < ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 = NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 = ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 <=> NULL ;
-c5
-NULL
-prepare stmt1 from ' select c5 from t9 where c5 <=> ? ';
-execute stmt1 using @arg00 ;
-c5
-NULL
-delete from t9 where c1= 0 ;
-set @arg00='>' ;
-select a FROM t1 where a @arg00 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 '@arg00 1' at line 1
-prepare stmt1 from ' select a FROM t1 where a ? 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 '? 1' at line 1
-set @arg00=1 ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL group by a - @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL group by a - ? ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00='two' ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL having b <> @arg00 order by a ;
-a b
-1 one
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL having b <> ? order by a ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-3 three
-4 four
-set @arg00=1 ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL order by a - @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL order by a - ? ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=2 ;
-select a,b from t1 order by 2 ;
-a b
-4 four
-1 one
-3 three
-2 two
-prepare stmt1 from ' select a,b from t1
-order by ? ';
-execute stmt1 using @arg00;
-a b
-4 four
-1 one
-3 three
-2 two
-set @arg00=1 ;
-execute stmt1 using @arg00;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=0 ;
-execute stmt1 using @arg00;
-ERROR 42S22: Unknown column '?' in 'order clause'
-set @arg00=1;
-prepare stmt1 from ' select a,b from t1 order by a
-limit 1 ';
-execute stmt1 ;
-a b
-1 one
-prepare stmt1 from ' select a,b from t1
-limit ? ';
-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 2
-set @arg00='b' ;
-set @arg01=0 ;
-set @arg02=2 ;
-set @arg03=2 ;
-select sum(a), @arg00 from t1 where a > @arg01
-and b is not null group by substr(b,@arg02)
-having sum(a) <> @arg03 ;
-sum(a) @arg00
-3 b
-1 b
-4 b
-prepare stmt1 from ' select sum(a), ? from t1 where a > ?
-and b is not null group by substr(b,?)
-having sum(a) <> ? ';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03;
-sum(a) ?
-3 b
-1 b
-4 b
-test_sequence
------- join tests ------
-select first.a as a1, second.a as a2
-from t1 first, t1 second
-where first.a = second.a order by a1 ;
-a1 a2
-1 1
-2 2
-3 3
-4 4
-prepare stmt1 from ' select first.a as a1, second.a as a2
- from t1 first, t1 second
- where first.a = second.a order by a1 ';
-execute stmt1 ;
-a1 a2
-1 1
-2 2
-3 3
-4 4
-set @arg00='ABC';
-set @arg01='two';
-set @arg02='one';
-select first.a, @arg00, second.a FROM t1 first, t1 second
-where @arg01 = first.b or first.a = second.a or second.b = @arg02
-order by second.a, first.a;
-a @arg00 a
-1 ABC 1
-2 ABC 1
-3 ABC 1
-4 ABC 1
-2 ABC 2
-2 ABC 3
-3 ABC 3
-2 ABC 4
-4 ABC 4
-prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
- where ? = first.b or first.a = second.a or second.b = ?
- order by second.a, first.a';
-execute stmt1 using @arg00, @arg01, @arg02;
-a ? a
-1 ABC 1
-2 ABC 1
-3 ABC 1
-4 ABC 1
-2 ABC 2
-2 ABC 3
-3 ABC 3
-2 ABC 4
-4 ABC 4
-drop table if exists t2 ;
-create table t2 as select * from t1 ;
-set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ;
-set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ;
-set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ;
-set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ;
-set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ;
-set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ;
-set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ;
-set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ;
-set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ;
-the join statement is:
-SELECT * FROM t2 right join t1 using(a) order by t2.a
-prepare stmt1 from @query9 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural right join t1 order by t2.a
-prepare stmt1 from @query8 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a
-prepare stmt1 from @query7 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 left join t1 using(a) order by t2.a
-prepare stmt1 from @query6 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural left join t1 order by t2.a
-prepare stmt1 from @query5 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a
-prepare stmt1 from @query4 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 join t1 using(a) order by t2.a
-prepare stmt1 from @query3 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 natural join t1 order by t2.a
-prepare stmt1 from @query2 ;
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-the join statement is:
-SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a
-prepare stmt1 from @query1 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-drop table t2 ;
-test_sequence
------- subquery tests ------
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ''two'') ';
-execute stmt1 ;
-a b
-2 two
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = 'two' ) and b=@arg00 ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ''two'') and b=? ';
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = @arg00 ) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ? ) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=3 ;
-set @arg01='three' ;
-select a,b FROM t1 where (a,b) in (select 3, 'three');
-a b
-3 three
-select a FROM t1 where (a,b) in (select @arg00,@arg01);
-a
-3
-prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) ';
-execute stmt1 using @arg00, @arg01;
-a
-3
-set @arg00=1 ;
-set @arg01='two' ;
-set @arg02=2 ;
-set @arg03='two' ;
-select a, @arg00, b FROM t1 outer_table where
-b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ;
-a @arg00 b
-2 1 two
-prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
- b=? and a = (select ? from t1 where b = ? ) ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-a ? b
-2 1 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = outer_table.b ) order by a ';
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = outer_table.b ) and b=@arg00 ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = outer_table.b) and b=? ';
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=2 ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=2 ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=1 ;
-set @arg01='two' ;
-set @arg02=2 ;
-set @arg03='two' ;
-select a, @arg00, b FROM t1 outer_table where
-b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03
-and outer_table.a=a ) ;
-a @arg00 b
-2 1 two
-prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
- b=? and a = (select ? from t1 where outer_table.b = ?
- and outer_table.a=a ) ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-a ? b
-2 1 two
-set @arg00=1 ;
-set @arg01=0 ;
-select a, @arg00
-from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2
-where a=@arg01;
-a @arg00
-0 1
-prepare stmt1 from ' select a, ?
- from ( select a - ? as a from t1 where a=? ) as t2
- where a=? ';
-execute stmt1 using @arg00, @arg00, @arg00, @arg01 ;
-a ?
-0 1
-drop table if exists t2 ;
-create table t2 as select * from t1;
-prepare stmt1 from ' select a in (select a from t2) from t1 ' ;
-execute stmt1 ;
-a in (select a from t2)
-1
-1
-1
-1
-drop table if exists t5, t6, t7 ;
-create table t5 (a int , b int) ;
-create table t6 like t5 ;
-create table t7 like t5 ;
-insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7),
-(2, -1), (3, 10) ;
-insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ;
-insert into t7 values (3, 3), (2, 2), (1, 1) ;
-prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1) from t7 ' ;
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-drop table t5, t6, t7 ;
-drop table if exists t2 ;
-create table t2 as select * from t9;
-set @stmt= ' SELECT
- (SELECT SUM(c1 + c12 + 0.0) FROM t2
- where (t9.c2 - 0e-3) = t2.c2
- GROUP BY t9.c15 LIMIT 1) as scalar_s,
- exists (select 1.0e+0 from t2
- where t2.c3 * 9.0000000000 = t9.c4) as exists_s,
- c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s,
- (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s
-FROM t9,
-(select c25 x, c32 y from t2) tt WHERE x = c25 ' ;
-prepare stmt1 from @stmt ;
-execute stmt1 ;
-execute stmt1 ;
-set @stmt= concat('explain ',@stmt);
-prepare stmt1 from @stmt ;
-execute stmt1 ;
-execute stmt1 ;
-set @stmt= ' SELECT
- (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2
- GROUP BY t9.c15 LIMIT 1) as scalar_s,
- exists (select ? from t2
- where t2.c3*?=t9.c4) as exists_s,
- c5*? in (select c6+? from t2) as in_s,
- (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s
-FROM t9,
-(select c25 x, c32 y from t2) tt WHERE x =c25 ' ;
-set @arg00= 0.0 ;
-set @arg01= 0e-3 ;
-set @arg02= 1.0e+0 ;
-set @arg03= 9.0000000000 ;
-set @arg04= 4 ;
-set @arg05= 0.3e+1 ;
-set @arg06= 4 ;
-set @arg07= 4 ;
-set @arg08= 4.0 ;
-set @arg09= 40e-1 ;
-prepare stmt1 from @stmt ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-set @stmt= concat('explain ',@stmt);
-prepare stmt1 from @stmt ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-drop table t2 ;
-select 1 < (select a from t1) ;
-ERROR 21000: Subquery returns more than 1 row
-prepare stmt1 from ' select 1 < (select a from t1) ' ;
-execute stmt1 ;
-ERROR 21000: Subquery returns more than 1 row
-select 1 as my_col ;
-my_col
-1
-test_sequence
------- union tests ------
-prepare stmt1 from ' select a FROM t1 where a=1
- union distinct
- select a FROM t1 where a=1 ';
-execute stmt1 ;
-a
-1
-execute stmt1 ;
-a
-1
-prepare stmt1 from ' select a FROM t1 where a=1
- union all
- select a FROM t1 where a=1 ';
-execute stmt1 ;
-a
-1
-1
-prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-set @arg00=1 ;
-select @arg00 FROM t1 where a=1
-union distinct
-select 1 FROM t1 where a=1;
-@arg00
-1
-prepare stmt1 from ' select ? FROM t1 where a=1
- union distinct
- select 1 FROM t1 where a=1 ' ;
-execute stmt1 using @arg00;
-?
-1
-set @arg00=1 ;
-select 1 FROM t1 where a=1
-union distinct
-select @arg00 FROM t1 where a=1;
-1
-1
-prepare stmt1 from ' select 1 FROM t1 where a=1
- union distinct
- select ? FROM t1 where a=1 ' ;
-execute stmt1 using @arg00;
-1
-1
-set @arg00='a' ;
-select @arg00 FROM t1 where a=1
-union distinct
-select @arg00 FROM t1 where a=1;
-@arg00
-a
-prepare stmt1 from ' select ? FROM t1 where a=1
- union distinct
- select ? FROM t1 where a=1 ';
-execute stmt1 using @arg00, @arg00;
-?
-a
-prepare stmt1 from ' select ?
- union distinct
- select ? ';
-execute stmt1 using @arg00, @arg00;
-?
-a
-set @arg00='a' ;
-set @arg01=1 ;
-set @arg02='a' ;
-set @arg03=2 ;
-select @arg00 FROM t1 where a=@arg01
-union distinct
-select @arg02 FROM t1 where a=@arg03;
-@arg00
-a
-prepare stmt1 from ' select ? FROM t1 where a=?
- union distinct
- select ? FROM t1 where a=? ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03;
-?
-a
-set @arg00=1 ;
-prepare stmt1 from ' select sum(a) + 200, ? from t1
-union distinct
-select sum(a) + 200, 1 from t1
-group by b ' ;
-execute stmt1 using @arg00;
-sum(a) + 200 ?
-210 1
-204 1
-201 1
-203 1
-202 1
-set @Oporto='Oporto' ;
-set @Lisboa='Lisboa' ;
-set @0=0 ;
-set @1=1 ;
-set @2=2 ;
-set @3=3 ;
-set @4=4 ;
-select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ;
-@Oporto @Lisboa @0 @1 @2 @3 @4
-Oporto Lisboa 0 1 2 3 4
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-group by b
-union distinct
-select sum(a) + 200, @Lisboa from t1
-group by b ;
-the_sum the_town
-204 Oporto
-201 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-201 Lisboa
-203 Lisboa
-202 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- group by b
- union distinct
- select sum(a) + 200, ? from t1
- group by b ' ;
-execute stmt1 using @Oporto, @Lisboa;
-the_sum the_town
-204 Oporto
-201 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-201 Lisboa
-203 Lisboa
-202 Lisboa
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-where a > @1
-group by b
-union distinct
-select sum(a) + 200, @Lisboa from t1
-where a > @2
-group by b ;
-the_sum the_town
-204 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-203 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- where a > ?
- group by b
- union distinct
- select sum(a) + 200, ? from t1
- where a > ?
- group by b ' ;
-execute stmt1 using @Oporto, @1, @Lisboa, @2;
-the_sum the_town
-204 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-203 Lisboa
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-where a > @1
-group by b
-having avg(a) > @2
-union distinct
-select sum(a) + 200, @Lisboa from t1
-where a > @2
-group by b
-having avg(a) > @3;
-the_sum the_town
-204 Oporto
-203 Oporto
-204 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- where a > ?
- group by b
- having avg(a) > ?
- union distinct
- select sum(a) + 200, ? from t1
- where a > ?
- group by b
- having avg(a) > ? ';
-execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3;
-the_sum the_town
-204 Oporto
-203 Oporto
-204 Lisboa
-test_sequence
------- explain select tests ------
-prepare stmt1 from ' explain select * from t9 ' ;
-execute stmt1;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def id 8 3 1 N 32801 0 8
-def select_type 253 19 6 N 1 31 33
-def table 253 64 2 N 1 31 33
-def type 253 10 3 N 1 31 33
-def possible_keys 253 4096 0 Y 0 31 33
-def key 253 64 0 Y 0 31 33
-def key_len 8 3 0 Y 32800 0 8
-def ref 253 1024 0 Y 0 31 33
-def rows 8 10 1 N 32801 0 8
-def Extra 253 255 0 N 1 31 33
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t9 ALL NULL NULL NULL NULL 3
-test_sequence
------- delete tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'delete from t1 where a=2' ;
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-execute stmt1;
-insert into t1 values(0,NULL);
-set @arg00=NULL;
-prepare stmt1 from 'delete from t1 where b=?' ;
-execute stmt1 using @arg00;
-select a,b from t1 where b is NULL ;
-a b
-0 NULL
-set @arg00='one';
-execute stmt1 using @arg00;
-select a,b from t1 where b=@arg00;
-a b
-prepare stmt1 from 'truncate table t1' ;
-ERROR HY000: This command is not supported in the prepared statement protocol yet
-test_sequence
------- update tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ;
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-2 a=two
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-2 a=two
-set @arg00=NULL;
-prepare stmt1 from 'update t1 set b=? where a=2' ;
-execute stmt1 using @arg00;
-select a,b from t1 where a=2;
-a b
-2 NULL
-set @arg00='two';
-execute stmt1 using @arg00;
-select a,b from t1 where a=2;
-a b
-2 two
-set @arg00=2;
-prepare stmt1 from 'update t1 set b=NULL where a=?' ;
-execute stmt1 using @arg00;
-select a,b from t1 where a=@arg00;
-a b
-2 NULL
-update t1 set b='two' where a=@arg00;
-set @arg00=2000;
-execute stmt1 using @arg00;
-select a,b from t1 where a=@arg00;
-a b
-set @arg00=2;
-set @arg01=22;
-prepare stmt1 from 'update t1 set a=? where a=?' ;
-execute stmt1 using @arg00, @arg00;
-select a,b from t1 where a=@arg00;
-a b
-2 two
-execute stmt1 using @arg01, @arg00;
-select a,b from t1 where a=@arg01;
-a b
-22 two
-execute stmt1 using @arg00, @arg01;
-select a,b from t1 where a=@arg00;
-a b
-2 two
-set @arg00=NULL;
-set @arg01=2;
-execute stmt1 using @arg00, @arg01;
-Warnings:
-Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
-select a,b from t1 order by a;
-a b
-0 two
-1 one
-3 three
-4 four
-set @arg00=0;
-execute stmt1 using @arg01, @arg00;
-select a,b from t1 order by a;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=23;
-set @arg01='two';
-set @arg02=2;
-set @arg03='two';
-set @arg04=2;
-drop table if exists t2;
-create table t2 as select a,b from t1 ;
-prepare stmt1 from 'update t1 set a=? where b=?
- and a in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 where a = @arg00 ;
-a b
-23 two
-prepare stmt1 from 'update t1 set a=? where b=?
- and a not in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 order by a ;
-a b
-1 one
-2 two
-3 three
-4 four
-drop table t2 ;
-create table t2
-(
-a int, b varchar(30),
-primary key(a)
-) engine = 'BDB' ;
-insert into t2(a,b) select a, b from t1 ;
-prepare stmt1 from 'update t1 set a=? where b=?
- and a in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 where a = @arg00 ;
-a b
-23 two
-prepare stmt1 from 'update t1 set a=? where b=?
- and a not in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 order by a ;
-a b
-1 one
-2 two
-3 three
-4 four
-drop table t2 ;
-set @arg00=1;
-prepare stmt1 from 'update t1 set b=''bla''
-where a=2
-limit 1';
-execute stmt1 ;
-select a,b from t1 where b = 'bla' ;
-a b
-2 bla
-prepare stmt1 from 'update t1 set b=''bla''
-where a=2
-limit ?';
-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 3
-test_sequence
------- insert tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'insert into t1 values(5, ''five'' )';
-execute stmt1;
-select a,b from t1 where a = 5;
-a b
-5 five
-set @arg00='six' ;
-prepare stmt1 from 'insert into t1 values(6, ? )';
-execute stmt1 using @arg00;
-select a,b from t1 where b = @arg00;
-a b
-6 six
-execute stmt1 using @arg00;
-ERROR 23000: Duplicate entry '6' for key 1
-set @arg00=NULL ;
-prepare stmt1 from 'insert into t1 values(0, ? )';
-execute stmt1 using @arg00;
-select a,b from t1 where b is NULL;
-a b
-0 NULL
-set @arg00=8 ;
-set @arg01='eight' ;
-prepare stmt1 from 'insert into t1 values(?, ? )';
-execute stmt1 using @arg00, @arg01 ;
-select a,b from t1 where b = @arg01;
-a b
-8 eight
-set @NULL= null ;
-set @arg00= 'abc' ;
-execute stmt1 using @NULL, @NULL ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @NULL ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @arg00 ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @arg00 ;
-ERROR 23000: Column 'a' cannot be null
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @arg00 ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @arg00 ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 abc
-10002 abc
-delete from t1 where a > 10000 ;
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @NULL ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @NULL ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 NULL
-10002 NULL
-delete from t1 where a > 10000 ;
-set @arg01= 10000 + 10 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 9 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 8 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 7 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 6 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 5 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 4 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 3 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @arg01 ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 10001
-10002 10002
-10003 10003
-10004 10004
-10005 10005
-10006 10006
-10007 10007
-10008 10008
-10009 10009
-10010 10010
-delete from t1 where a > 10000 ;
-set @arg00=81 ;
-set @arg01='8-1' ;
-set @arg02=82 ;
-set @arg03='8-2' ;
-prepare stmt1 from 'insert into t1 values(?,?),(?,?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-select a,b from t1 where a in (@arg00,@arg02) ;
-a b
-81 8-1
-82 8-2
-set @arg00=9 ;
-set @arg01='nine' ;
-prepare stmt1 from 'insert into t1 set a=?, b=? ';
-execute stmt1 using @arg00, @arg01 ;
-select a,b from t1 where a = @arg00 ;
-a b
-9 nine
-set @arg00=6 ;
-set @arg01=1 ;
-prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
- on duplicate key update a=a + ?, b=concat(b,''modified'') ';
-execute stmt1 using @arg00, @arg01;
-select * from t1 order by a;
-a b
-0 NULL
-1 one
-2 two
-3 three
-4 four
-5 five
-7 sixmodified
-8 eight
-9 nine
-81 8-1
-82 8-2
-set @arg00=81 ;
-set @arg01=1 ;
-execute stmt1 using @arg00, @arg01;
-ERROR 23000: Duplicate entry '82' for key 1
-drop table if exists t2 ;
-create table t2 (id int auto_increment primary key)
-ENGINE= 'BDB' ;
-prepare stmt1 from ' select last_insert_id() ' ;
-insert into t2 values (NULL) ;
-execute stmt1 ;
-last_insert_id()
-1
-insert into t2 values (NULL) ;
-execute stmt1 ;
-last_insert_id()
-2
-drop table t2 ;
-set @1000=1000 ;
-set @x1000_2="x1000_2" ;
-set @x1000_3="x1000_3" ;
-set @x1000="x1000" ;
-set @1100=1100 ;
-set @x1100="x1100" ;
-set @100=100 ;
-set @updated="updated" ;
-insert into t1 values(1000,'x1000_1') ;
-insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
-on duplicate key update a = a + @100, b = concat(b,@updated) ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 x1000_3
-1100 x1000_1updated
-delete from t1 where a >= 1000 ;
-insert into t1 values(1000,'x1000_1') ;
-prepare stmt1 from ' insert into t1 values(?,?),(?,?)
- on duplicate key update a = a + ?, b = concat(b,?) ';
-execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 x1000_3
-1100 x1000_1updated
-delete from t1 where a >= 1000 ;
-insert into t1 values(1000,'x1000_1') ;
-execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1200 x1000_1updatedupdated
-delete from t1 where a >= 1000 ;
-prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
-execute stmt1;
-execute stmt1;
-execute stmt1;
-test_sequence
------- multi table tests ------
-delete from t1 ;
-delete from t9 ;
-insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ;
-insert into t9 (c1,c21)
-values (1, 'one'), (2, 'two'), (3, 'three') ;
-prepare stmt_delete from " delete t1, t9
- from t1, t9 where t1.a=t9.c1 and t1.b='updated' ";
-prepare stmt_update from " update t1, t9
- set t1.b='updated', t9.c21='updated'
- where t1.a=t9.c1 and t1.a=? ";
-prepare stmt_select1 from " select a, b from t1 order by a" ;
-prepare stmt_select2 from " select c1, c21 from t9 order by c1" ;
-set @arg00= 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-2 two
-3 three
-execute stmt_select2 ;
-c1 c21
-2 two
-3 three
-set @arg00= @arg00 + 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-3 three
-execute stmt_select2 ;
-c1 c21
-3 three
-set @arg00= @arg00 + 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-execute stmt_select2 ;
-c1 c21
-set @arg00= @arg00 + 1 ;
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-insert into t1 values(0,NULL) ;
-set @duplicate='duplicate ' ;
-set @1000=1000 ;
-set @5=5 ;
-select a,b from t1 where a < 5 order by a ;
-a b
-0 NULL
-1 one
-2 two
-3 three
-4 four
-insert into t1 select a + @1000, concat(@duplicate,b) from t1
-where a < @5 ;
-affected rows: 5
-info: Records: 5 Duplicates: 0 Warnings: 0
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 NULL
-1001 duplicate one
-1002 duplicate two
-1003 duplicate three
-1004 duplicate four
-delete from t1 where a >= 1000 ;
-prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
-where a < ? ' ;
-execute stmt1 using @1000, @duplicate, @5;
-affected rows: 5
-info: Records: 5 Duplicates: 0 Warnings: 0
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 NULL
-1001 duplicate one
-1002 duplicate two
-1003 duplicate three
-1004 duplicate four
-delete from t1 where a >= 1000 ;
-set @float=1.00;
-set @five='five' ;
-drop table if exists t2;
-create table t2 like t1 ;
-insert into t2 (b,a)
-select @duplicate, sum(first.a) from t1 first, t1 second
-where first.a <> @5 and second.b = first.b
-and second.b <> @five
-group by second.b
-having sum(second.a) > @2
-union
-select b, a + @100 from t1
-where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
-from t1);
-affected rows: 3
-info: Records: 3 Duplicates: 0 Warnings: 0
-select a,b from t2 order by a ;
-a b
-3 duplicate
-4 duplicate
-103 three
-delete from t2 ;
-prepare stmt1 from ' insert into t2 (b,a)
-select ?, sum(first.a)
- from t1 first, t1 second
- where first.a <> ? and second.b = first.b and second.b <> ?
- group by second.b
- having sum(second.a) > ?
-union
-select b, a + ? from t1
- where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b
- from t1 ) ' ;
-execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
-affected rows: 3
-info: Records: 3 Duplicates: 0 Warnings: 0
-select a,b from t2 order by a ;
-a b
-3 duplicate
-4 duplicate
-103 three
-drop table t2;
-drop table if exists t5 ;
-set @arg01= 8;
-set @arg02= 8.0;
-set @arg03= 80.00000000000e-1;
-set @arg04= 'abc' ;
-set @arg05= CAST('abc' as binary) ;
-set @arg06= '1991-08-05' ;
-set @arg07= CAST('1991-08-05' as date);
-set @arg08= '1991-08-05 01:01:01' ;
-set @arg09= CAST('1991-08-05 01:01:01' as datetime) ;
-set @arg10= unix_timestamp('1991-01-01 01:01:01');
-set @arg11= YEAR('1991-01-01 01:01:01');
-set @arg12= 8 ;
-set @arg12= NULL ;
-set @arg13= 8.0 ;
-set @arg13= NULL ;
-set @arg14= 'abc';
-set @arg14= NULL ;
-set @arg15= CAST('abc' as binary) ;
-set @arg15= NULL ;
-create table t5 as select
-8 as const01, @arg01 as param01,
-8.0 as const02, @arg02 as param02,
-80.00000000000e-1 as const03, @arg03 as param03,
-'abc' as const04, @arg04 as param04,
-CAST('abc' as binary) as const05, @arg05 as param05,
-'1991-08-05' as const06, @arg06 as param06,
-CAST('1991-08-05' as date) as const07, @arg07 as param07,
-'1991-08-05 01:01:01' as const08, @arg08 as param08,
-CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09,
-unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10,
-YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11,
-NULL as const12, @arg12 as param12,
-@arg13 as param13,
-@arg14 as param14,
-@arg15 as param15;
-show create table t5 ;
-Table Create Table
-t5 CREATE TABLE `t5` (
- `const01` bigint(1) NOT NULL default '0',
- `param01` bigint(20) default NULL,
- `const02` double(3,1) NOT NULL default '0.0',
- `param02` double default NULL,
- `const03` double NOT NULL default '0',
- `param03` double default NULL,
- `const04` char(3) NOT NULL default '',
- `param04` longtext,
- `const05` binary(3) NOT NULL default '',
- `param05` longblob,
- `const06` varchar(10) NOT NULL default '',
- `param06` longtext,
- `const07` date default NULL,
- `param07` longblob,
- `const08` varchar(19) NOT NULL default '',
- `param08` longtext,
- `const09` datetime default NULL,
- `param09` longblob,
- `const10` int(10) NOT NULL default '0',
- `param10` bigint(20) default NULL,
- `const11` int(4) default NULL,
- `param11` bigint(20) default NULL,
- `const12` binary(0) default NULL,
- `param12` bigint(20) default NULL,
- `param13` double default NULL,
- `param14` longtext,
- `param15` longblob
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-select * from t5 ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def test t5 t5 const01 const01 8 1 1 N 32769 0 63
-def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 5 3 3 N 32769 1 63
-def test t5 t5 param02 param02 5 20 1 Y 32768 31 63
-def test t5 t5 const03 const03 5 23 1 N 32769 31 63
-def test t5 t5 param03 param03 5 20 1 Y 32768 31 63
-def test t5 t5 const04 const04 254 3 3 N 1 0 8
-def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8
-def test t5 t5 const05 const05 254 3 3 N 129 0 63
-def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63
-def test t5 t5 const06 const06 253 10 10 N 1 0 8
-def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8
-def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63
-def test t5 t5 const08 const08 253 19 19 N 1 0 8
-def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8
-def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63
-def test t5 t5 const10 const10 3 10 9 N 32769 0 63
-def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
-def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
-def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
-def test t5 t5 const12 const12 254 0 0 Y 128 0 63
-def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
-def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
-def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
-const01 8
-param01 8
-const02 8.0
-param02 8
-const03 8
-param03 8
-const04 abc
-param04 abc
-const05 abc
-param05 abc
-const06 1991-08-05
-param06 1991-08-05
-const07 1991-08-05
-param07 1991-08-05
-const08 1991-08-05 01:01:01
-param08 1991-08-05 01:01:01
-const09 1991-08-05 01:01:01
-param09 1991-08-05 01:01:01
-const10 662680861
-param10 662680861
-const11 1991
-param11 1991
-const12 NULL
-param12 NULL
-param13 NULL
-param14 NULL
-param15 NULL
-drop table t5 ;
-test_sequence
------- data type conversion tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ;
-select * from t9 order by c1 ;
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
-test_sequence
------- select @parameter:= column ------
-prepare full_info from "select @arg01, @arg02, @arg03, @arg04,
- @arg05, @arg06, @arg07, @arg08,
- @arg09, @arg10, @arg11, @arg12,
- @arg13, @arg14, @arg15, @arg16,
- @arg17, @arg18, @arg19, @arg20,
- @arg21, @arg22, @arg23, @arg24,
- @arg25, @arg26, @arg27, @arg28,
- @arg29, @arg30, @arg31, @arg32" ;
-select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
-@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
-@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
-@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
-@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
-@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
-@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
-@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= 1 ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
-@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
-@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
-@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
-@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
-@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
-@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
-@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= 0 ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select
- @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
- @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
- @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
- @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
- @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
- @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
- @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
- @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= ?" ;
-set @my_key= 1 ;
-execute stmt1 using @my_key ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-set @my_key= 0 ;
-execute stmt1 using @my_key ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select ? := c1 from t9 where c1= 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 ':= c1 from t9 where c1= 1' at line 1
-test_sequence
------- select column, .. into @parm,.. ------
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
-c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
-c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
-@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
-@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
-@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= 1 ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
-c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
-c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
-@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
-@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
-@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= 0 ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
- c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
- c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
- @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
- @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
- @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= ?" ;
-set @my_key= 1 ;
-execute stmt1 using @my_key ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 1 Y 128 31 63
-def @arg03 254 20 1 Y 128 31 63
-def @arg04 254 20 1 Y 128 31 63
-def @arg05 254 20 1 Y 128 31 63
-def @arg06 254 20 1 Y 128 31 63
-def @arg07 254 20 1 Y 128 31 63
-def @arg08 254 20 1 Y 128 31 63
-def @arg09 254 20 1 Y 128 31 63
-def @arg10 254 20 1 Y 128 31 63
-def @arg11 254 20 1 Y 128 31 63
-def @arg12 254 20 1 Y 128 31 63
-def @arg13 254 8192 10 Y 128 31 63
-def @arg14 254 8192 19 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 8 Y 128 31 63
-def @arg17 254 20 4 Y 128 31 63
-def @arg18 254 20 1 Y 128 31 63
-def @arg19 254 20 1 Y 128 31 63
-def @arg20 254 8192 1 Y 0 31 8
-def @arg21 254 8192 10 Y 0 31 8
-def @arg22 254 8192 30 Y 0 31 8
-def @arg23 254 8192 8 Y 128 31 63
-def @arg24 254 8192 8 Y 0 31 8
-def @arg25 254 8192 4 Y 128 31 63
-def @arg26 254 8192 4 Y 0 31 8
-def @arg27 254 8192 10 Y 128 31 63
-def @arg28 254 8192 10 Y 0 31 8
-def @arg29 254 8192 8 Y 128 31 63
-def @arg30 254 8192 8 Y 0 31 8
-def @arg31 254 8192 3 Y 0 31 8
-def @arg32 254 8192 6 Y 128 31 63
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-set @my_key= 0 ;
-execute stmt1 using @my_key ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 254 20 1 Y 128 31 63
-def @arg02 254 20 0 Y 128 31 63
-def @arg03 254 20 0 Y 128 31 63
-def @arg04 254 20 0 Y 128 31 63
-def @arg05 254 20 0 Y 128 31 63
-def @arg06 254 20 0 Y 128 31 63
-def @arg07 254 20 0 Y 128 31 63
-def @arg08 254 20 0 Y 128 31 63
-def @arg09 254 20 0 Y 128 31 63
-def @arg10 254 20 0 Y 128 31 63
-def @arg11 254 20 0 Y 128 31 63
-def @arg12 254 20 0 Y 128 31 63
-def @arg13 254 8192 0 Y 128 31 63
-def @arg14 254 8192 0 Y 128 31 63
-def @arg15 254 8192 19 Y 128 31 63
-def @arg16 254 8192 0 Y 128 31 63
-def @arg17 254 20 0 Y 128 31 63
-def @arg18 254 20 0 Y 128 31 63
-def @arg19 254 20 0 Y 128 31 63
-def @arg20 254 8192 0 Y 0 31 8
-def @arg21 254 8192 0 Y 0 31 8
-def @arg22 254 8192 0 Y 0 31 8
-def @arg23 254 8192 0 Y 128 31 63
-def @arg24 254 8192 0 Y 0 31 8
-def @arg25 254 8192 0 Y 128 31 63
-def @arg26 254 8192 0 Y 0 31 8
-def @arg27 254 8192 0 Y 128 31 63
-def @arg28 254 8192 0 Y 0 31 8
-def @arg29 254 8192 0 Y 128 31 63
-def @arg30 254 8192 0 Y 0 31 8
-def @arg31 254 8192 0 Y 0 31 8
-def @arg32 254 8192 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select c1 into ? from t9 where c1= 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 '? from t9 where c1= 1' at line 1
-test_sequence
--- insert into numeric columns --
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ;
-set @arg00= 21 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ;
-execute stmt1 ;
-set @arg00= 23;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0,
-30.0, 30.0, 30.0 ) ;
-set @arg00= 31.0 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0,
- 32.0, 32.0, 32.0 )" ;
-execute stmt1 ;
-set @arg00= 33.0;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( '40', '40', '40', '40', '40', '40', '40', '40',
-'40', '40', '40' ) ;
-set @arg00= '41' ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( '42', '42', '42', '42', '42', '42', '42', '42',
- '42', '42', '42' )" ;
-execute stmt1 ;
-set @arg00= '43';
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ;
-set @arg00= CAST('51' as binary) ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ;
-execute stmt1 ;
-set @arg00= CAST('53' as binary) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 2 ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-NULL, NULL, NULL ) ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 61, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL )" ;
-execute stmt1 ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 8.0 ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 71, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 'abc' ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 81, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
-from t9 where c1 >= 20
-order by c1 ;
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12
-20 20 20 20 20 20 20 20 20 20 20.0000
-21 21 21 21 21 21 21 21 21 21 21.0000
-22 22 22 22 22 22 22 22 22 22 22.0000
-23 23 23 23 23 23 23 23 23 23 23.0000
-30 30 30 30 30 30 30 30 30 30 30.0000
-31 31 31 31 31 31 31 31 31 31 31.0000
-32 32 32 32 32 32 32 32 32 32 32.0000
-33 33 33 33 33 33 33 33 33 33 33.0000
-40 40 40 40 40 40 40 40 40 40 40.0000
-41 41 41 41 41 41 41 41 41 41 41.0000
-42 42 42 42 42 42 42 42 42 42 42.0000
-43 43 43 43 43 43 43 43 43 43 43.0000
-50 50 50 50 50 50 50 50 50 50 50.0000
-51 51 51 51 51 51 51 51 51 51 51.0000
-52 52 52 52 52 52 52 52 52 52 52.0000
-53 53 53 53 53 53 53 53 53 53 53.0000
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-test_sequence
--- select .. where numeric column = .. --
-set @arg00= 20;
-select 'true' as found from t9
-where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
-and c8= 20 and c9= 20 and c10= 20 and c12= 20;
-found
-true
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
- and c8= 20 and c9= 20 and c10= 20 and c12= 20 ";
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20.0;
-select 'true' as found from t9
-where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
-and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0;
-found
-true
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
- and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 ";
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-select 'true' as found from t9
-where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
- and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20';
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
- and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' ";
-execute stmt1 ;
-found
-true
-set @arg00= '20';
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-select 'true' as found from t9
-where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
-c3= CAST('20' as binary) and c4= CAST('20' as binary) and
-c5= CAST('20' as binary) and c6= CAST('20' as binary) and
-c7= CAST('20' as binary) and c8= CAST('20' as binary) and
-c9= CAST('20' as binary) and c10= CAST('20' as binary) and
-c12= CAST('20' as binary);
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
- c3= CAST('20' as binary) and c4= CAST('20' as binary) and
- c5= CAST('20' as binary) and c6= CAST('20' as binary) and
- c7= CAST('20' as binary) and c8= CAST('20' as binary) and
- c9= CAST('20' as binary) and c10= CAST('20' as binary) and
- c12= CAST('20' as binary) ";
-execute stmt1 ;
-found
-true
-set @arg00= CAST('20' as binary) ;
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-delete from t9 ;
-test_sequence
--- some numeric overflow experiments --
-prepare my_insert from "insert into t9
- ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
-from t9 where c21 = 'O' ";
-prepare my_delete from "delete from t9 where c21 = 'O' ";
-set @arg00= 9223372036854775807 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
-c12 99999.9999
-execute my_delete ;
-set @arg00= '9223372036854775807' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
-c12 99999.9999
-execute my_delete ;
-set @arg00= -9223372036854775808 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
-c12 -9999.9999
-execute my_delete ;
-set @arg00= '-9223372036854775808' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
-c12 -9999.9999
-execute my_delete ;
-set @arg00= 1.11111111111111111111e+50 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
-c12 99999.9999
-execute my_delete ;
-set @arg00= '1.11111111111111111111e+50' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1265 Data truncated for column 'c1' at row 1
-Warning 1265 Data truncated for column 'c2' at row 1
-Warning 1265 Data truncated for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1265 Data truncated for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 1
-c2 1
-c3 1
-c4 1
-c5 1
-c6 1
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
-c12 99999.9999
-execute my_delete ;
-set @arg00= -1.11111111111111111111e+50 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c1' at row 1
-Warning 1264 Data truncated; out of range for column 'c2' at row 1
-Warning 1264 Data truncated; out of range for column 'c3' at row 1
-Warning 1264 Data truncated; out of range for column 'c4' at row 1
-Warning 1264 Data truncated; out of range for column 'c5' at row 1
-Warning 1264 Data truncated; out of range for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
-c12 -9999.9999
-execute my_delete ;
-set @arg00= '-1.11111111111111111111e+50' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1265 Data truncated for column 'c1' at row 1
-Warning 1265 Data truncated for column 'c2' at row 1
-Warning 1265 Data truncated for column 'c3' at row 1
-Warning 1265 Data truncated for column 'c4' at row 1
-Warning 1265 Data truncated for column 'c5' at row 1
-Warning 1265 Data truncated for column 'c6' at row 1
-Warning 1264 Data truncated; out of range for column 'c7' at row 1
-Warning 1264 Data truncated; out of range for column 'c12' at row 1
-execute my_select ;
-c1 -1
-c2 -1
-c3 -1
-c4 -1
-c5 -1
-c6 -1
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
-c12 -9999.9999
-execute my_delete ;
-test_sequence
--- insert into string columns --
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30
-from t9 where c1 >= 20
-order by c1 ;
-c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30
-20 2 20 20 20 20 20 20 20 20 20 20
-21 2 21 21 21 21 21 21 21 21 21 21
-22 2 22 22 22 22 22 22 22 22 22 22
-23 2 23 23 23 23 23 23 23 23 23 23
-30 3 30 30 30 30 30 30 30 30 30 30
-31 3 31 31 31 31 31 31 31 31 31 31
-32 3 32 32 32 32 32 32 32 32 32 32
-33 3 33 33 33 33 33 33 33 33 33 33
-40 4 40 40 40 40 40 40 40 40 40 40
-41 4 41 41 41 41 41 41 41 41 41 41
-42 4 42 42 42 42 42 42 42 42 42 42
-43 4 43 43 43 43 43 43 43 43 43 43
-50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00
-51 5 51 51 51 51 51 51 51 51 51 51
-52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00
-53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00
-54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00
-55 5 55 55 55 55 55 55 55 55 55 55
-56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00
-57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-test_sequence
--- select .. where string column = .. --
-set @arg00= '20';
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
-c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
-c27= '20' and c28= '20' and c29= '20' and c30= '20' ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
- c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
- c27= '20' and c28= '20' and c29= '20' and c30= '20'" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= CAST('20' as binary);
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
-= CAST('20' as binary) and c21= CAST('20' as binary)
-and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
-c24= CAST('20' as binary) and c25= CAST('20' as binary) and
-c26= CAST('20' as binary) and c27= CAST('20' as binary) and
-c28= CAST('20' as binary) and c29= CAST('20' as binary) and
-c30= CAST('20' as binary) ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and
-c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
- = CAST('20' as binary) and c21= CAST('20' as binary)
- and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
- c24= CAST('20' as binary) and c25= CAST('20' as binary) and
- c26= CAST('20' as binary) and c27= CAST('20' as binary) and
- c28= CAST('20' as binary) and c29= CAST('20' as binary) and
- c30= CAST('20' as binary)" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and
- c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and
- c29= ? and c30= ?";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20;
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
-c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
-c27= 20 and c28= 20 and c29= 20 and c30= 20 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
- c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
- c27= 20 and c28= 20 and c29= 20 and c30= 20" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20.0;
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
-c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
-c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
- c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
- c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-delete from t9 ;
-test_sequence
--- insert into date/time columns --
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1264 Data truncated; out of range for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Data truncated; out of range for column 'c16' at row 1
-Warning 1264 Data truncated; out of range for column 'c17' at row 1
-select c1, c13, c14, c15, c16, c17 from t9 order by c1 ;
-c1 c13 c14 c15 c16 c17
-20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-60 NULL NULL 1991-01-01 01:01:01 NULL NULL
-61 NULL NULL 1991-01-01 01:01:01 NULL NULL
-62 NULL NULL 1991-01-01 01:01:01 NULL NULL
-63 NULL NULL 1991-01-01 01:01:01 NULL NULL
-71 NULL NULL 1991-01-01 01:01:01 NULL NULL
-73 NULL NULL 1991-01-01 01:01:01 NULL NULL
-81 NULL NULL 1991-01-01 01:01:01 NULL NULL
-83 NULL NULL 1991-01-01 01:01:01 NULL NULL
-test_sequence
--- select .. where date/time column = .. --
-set @arg00= '1991-01-01 01:01:01' ;
-select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
-c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
-c17= '1991-01-01 01:01:01' ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
-and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and
- c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
- c17= '1991-01-01 01:01:01'" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
-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
-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
-c17= CAST('1991-01-01 01:01:01' as datetime) ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00
-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
- 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
- c17= CAST('1991-01-01 01:01:01' as datetime)" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 1991 ;
-select 'true' as found from t9
-where c1= 20 and c17= 1991 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c17= 1991" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c17= ?" ;
-execute stmt1 using @arg00 ;
-found
-true
-set @arg00= 1.991e+3 ;
-select 'true' as found from t9
-where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and abs(c17 - @arg00) < 0.01 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and abs(c17 - ?) < 0.01" ;
-execute stmt1 using @arg00 ;
-found
-true
-drop table t1, t9;
diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result
index bda79a7da97..8ba900334fc 100644
--- a/mysql-test/r/ps_7ndb.result
+++ b/mysql-test/r/ps_7ndb.result
@@ -1670,6 +1670,9 @@ a b
1003 duplicate three
1004 duplicate four
delete from t1 where a >= 1000 ;
+set @1=1 ;
+set @2=2 ;
+set @100=100 ;
set @float=1.00;
set @five='five' ;
drop table if exists t2;
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 57c5da870ad..3568be8cc12 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -947,3 +947,13 @@ Variable_name Value
Qcache_hits 7
DROP TABLE t1;
SET GLOBAL query_cache_size=0;
+SET SESSION query_cache_type = 2;
+create table t1(a int);
+select table_name from information_schema.tables
+where table_schema="test";
+table_name
+t1
+drop table t1;
+select table_name from information_schema.tables
+where table_schema="test";
+table_name
diff --git a/mysql-test/r/query_cache.result.es b/mysql-test/r/query_cache.result.es
index 1e16354d87d..7e75a3cee4c 100644
--- a/mysql-test/r/query_cache.result.es
+++ b/mysql-test/r/query_cache.result.es
@@ -808,7 +808,7 @@ SET NAMES koi8r;
CREATE TABLE t1 (a char(1) character set koi8r);
INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Á');
SELECT a,'Â','â'='Â' FROM t1;
-a б 'Б'='б'
+a  'â'='Â'
á Â 1
Á Â 1
show status like "Qcache_hits";
@@ -819,7 +819,7 @@ Variable_name Value
Qcache_queries_in_cache 1
set collation_connection=koi8r_bin;
SELECT a,'Â','â'='Â' FROM t1;
-a б 'Б'='б'
+a  'â'='Â'
á Â 0
Á Â 0
show status like "Qcache_hits";
@@ -830,7 +830,7 @@ Variable_name Value
Qcache_queries_in_cache 2
set character_set_client=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
-a В 'в'='В'
+a ÷ '×'='÷'
á ÷ 0
Á ÷ 0
show status like "Qcache_hits";
@@ -841,7 +841,7 @@ Variable_name Value
Qcache_queries_in_cache 3
set character_set_results=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
-a В 'в'='В'
+a  'â'='Â'
À Â 0
à Â 0
show status like "Qcache_hits";
diff --git a/mysql-test/r/rpl_insert_ignore.result b/mysql-test/r/rpl_insert_ignore.result
new file mode 100644
index 00000000000..da24c86627c
--- /dev/null
+++ b/mysql-test/r/rpl_insert_ignore.result
@@ -0,0 +1,70 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+CREATE TABLE t1 (
+a int unsigned not null auto_increment primary key,
+b int unsigned,
+unique (b)
+) ENGINE=innodb;
+CREATE TABLE t2 (
+a int unsigned, # to force INSERT SELECT to have a certain order
+b int unsigned
+) ENGINE=innodb;
+INSERT INTO t1 VALUES (NULL, 1);
+INSERT INTO t1 VALUES (NULL, 2);
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t1 VALUES (NULL, 4);
+INSERT INTO t2 VALUES (1, 1);
+INSERT INTO t2 VALUES (2, 2);
+INSERT INTO t2 VALUES (3, 5);
+INSERT INTO t2 VALUES (4, 3);
+INSERT INTO t2 VALUES (5, 4);
+INSERT INTO t2 VALUES (6, 6);
+INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+SELECT * FROM t1 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+drop table t1;
+CREATE TABLE t1 (
+a int unsigned not null auto_increment primary key,
+b int unsigned,
+unique (b)
+) ENGINE=myisam;
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (3, 3);
+INSERT INTO t1 VALUES (4, 4);
+INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+SELECT * FROM t1 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+drop table t1, t2;
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index c1cabce7e92..d6b86f18617 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -338,9 +338,9 @@ delete from t2 where b=3;
delete from t3 where a=3;
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 HEAP 9 Fixed 4 # # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 HEAP 9 Fixed 4 # # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 HEAP 9 Fixed 4 # # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL
+t1 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
delete from t1;
delete from t2;
delete from t3;
@@ -362,9 +362,9 @@ delete from t2 where b=5;
delete from t3 where a=5;
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 HEAP 9 Fixed 0 # # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 HEAP 9 Fixed 0 # # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 HEAP 9 Fixed 0 # # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL
+t1 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
drop table t1, t2, t3;
create database mysqltest;
show create database mysqltest;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 269c4104a05..d480d5a3f2e 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -1,37 +1,16 @@
use test;
-drop table if exists t1,t2,t3,t4;
-drop procedure if exists goto1;
-drop procedure if exists goto2;
-drop procedure if exists goto3;
-drop procedure if exists goto4;
-drop procedure if exists goto5;
-drop procedure if exists goto6;
-drop procedure if exists into_outfile;
-drop procedure if exists into_dumpfile;
-drop procedure if exists create_select;
-drop procedure if exists bar;
-drop procedure if exists hndlr1;
-drop procedure if exists hndlr2;
-drop procedure if exists hndlr3;
-drop procedure if exists hndlr4;
-drop procedure if exists cur1;
-drop procedure if exists cur2;
-drop procedure if exists chistics;
-drop procedure if exists chistics2;
-drop procedure if exists modes;
-drop procedure if exists dummy;
-drop procedure if exists bug;
-drop procedure if exists bug2;
-drop function if exists fac;
+drop table if exists t1;
create table t1 (
id char(16) not null,
data int not null
);
+drop table if exists t2;
create table t2 (
s char(16),
i int,
d double
);
+drop procedure if exists foo42;
create procedure foo42()
insert into test.t1 values ("foo", 42);
call foo42();
@@ -40,6 +19,7 @@ id data
foo 42
delete from t1;
drop procedure foo42;
+drop procedure if exists bar;
create procedure bar(x char(16), y int)
insert into test.t1 values (x, y);
call bar("bar", 666);
@@ -47,11 +27,13 @@ select * from t1;
id data
bar 666
delete from t1;
+drop procedure if exists empty|
create procedure empty()
begin
end|
call empty()|
drop procedure empty|
+drop procedure if exists scope|
create procedure scope(a int, b float)
begin
declare b int;
@@ -61,6 +43,7 @@ declare c int;
end;
end|
drop procedure scope|
+drop procedure if exists two|
create procedure two(x1 char(16), x2 char(16), y int)
begin
insert into test.t1 values (x1, y);
@@ -73,6 +56,7 @@ one 3
two 3
delete from t1|
drop procedure two|
+drop procedure if exists locset|
create procedure locset(x char(16), y int)
begin
declare z1, z2 int;
@@ -86,6 +70,7 @@ id data
locset 21
delete from t1|
drop procedure locset|
+drop procedure if exists setcontext|
create procedure setcontext()
begin
declare data int default 2;
@@ -100,7 +85,9 @@ foo 1
kaka 3
delete from t1|
drop procedure setcontext|
+drop table if exists t3|
create table t3 ( d date, i int, f double, s varchar(32) )|
+drop procedure if exists nullset|
create procedure nullset()
begin
declare ld date;
@@ -128,6 +115,7 @@ NULL NULL NULL lf = 0
NULL 1 1 ls is null
drop table t3|
drop procedure nullset|
+drop procedure if exists mixset|
create procedure mixset(x char(16), y int)
begin
declare z int;
@@ -143,12 +131,14 @@ id data @z
mixset 666 19
delete from t1|
drop procedure mixset|
+drop procedure if exists zip|
create procedure zip(x char(16), y int)
begin
declare z int;
call zap(y, z);
call bar(x, z);
end|
+drop procedure if exists zap|
create procedure zap(x int, out y int)
begin
declare z int;
@@ -166,12 +156,16 @@ select @zap|
@zap
8
drop procedure zap|
+drop procedure if exists c1|
create procedure c1(x int)
call c2("c", x)|
+drop procedure if exists c2|
create procedure c2(s char(16), x int)
call c3(x, s)|
+drop procedure if exists c3|
create procedure c3(x int, s char(16))
call c4("level", x, s)|
+drop procedure if exists c4|
create procedure c4(l char(8), x int, s char(16))
insert into t1 values (concat(l,s), x)|
call c1(42)|
@@ -183,16 +177,19 @@ drop procedure c1|
drop procedure c2|
drop procedure c3|
drop procedure c4|
+drop procedure if exists iotest|
create procedure iotest(x1 char(16), x2 char(16), y int)
begin
call inc2(x2, y);
insert into test.t1 values (x1, y);
end|
+drop procedure if exists inc2|
create procedure inc2(x char(16), y int)
begin
call inc(y);
insert into test.t1 values (x, y);
end|
+drop procedure if exists inc|
create procedure inc(inout io int)
set io = io + 1|
call iotest("io1", "io2", 1)|
@@ -203,6 +200,7 @@ io1 1
delete from t1|
drop procedure iotest|
drop procedure inc2|
+drop procedure if exists incr|
create procedure incr(inout x int)
call inc(x)|
select @zap|
@@ -214,12 +212,14 @@ select @zap|
9
drop procedure inc|
drop procedure incr|
+drop procedure if exists cbv1|
create procedure cbv1()
begin
declare y int default 3;
call cbv2(y+1, y);
insert into test.t1 values ("cbv1", y);
end|
+drop procedure if exists cbv2|
create procedure cbv2(y1 int, inout y2 int)
begin
set y2 = 4711;
@@ -234,8 +234,10 @@ delete from t1|
drop procedure cbv1|
drop procedure cbv2|
insert into t2 values ("a", 1, 1.1), ("b", 2, 1.2), ("c", 3, 1.3)|
+drop procedure if exists sub1|
create procedure sub1(id char(16), x int)
insert into test.t1 values (id, x)|
+drop procedure if exists sub3|
create function sub3(i int) returns int
return i+1|
call sub1("sub1a", (select 7))|
@@ -254,6 +256,7 @@ sub3((select max(i) from t2))
drop procedure sub1|
drop function sub3|
delete from t2|
+drop procedure if exists a0|
create procedure a0(x int)
while x do
set x = x-1;
@@ -271,6 +274,7 @@ a0 1
a0 0
delete from t1|
drop procedure a0|
+drop procedure if exists a|
create procedure a(x int)
while x > 0 do
set x = x-1;
@@ -284,6 +288,7 @@ a 1
a 0
delete from t1|
drop procedure a|
+drop procedure if exists b|
create procedure b(x int)
repeat
insert into test.t1 values (repeat("b",3), x);
@@ -297,12 +302,14 @@ bbb 2
bbb 1
delete from t1|
drop procedure b|
+drop procedure if exists b2|
create procedure b2(x int)
repeat(select 1 into outfile 'b2');
insert into test.t1 values (repeat("b2",3), x);
set x = x-1;
until x = 0 end repeat|
drop procedure b2|
+drop procedure if exists c|
create procedure c(x int)
hmm: while x > 0 do
insert into test.t1 values ("c", x);
@@ -318,6 +325,7 @@ c 2
c 1
delete from t1|
drop procedure c|
+drop procedure if exists d|
create procedure d(x int)
hmm: while x > 0 do
insert into test.t1 values ("d", x);
@@ -331,6 +339,7 @@ id data
d 3
delete from t1|
drop procedure d|
+drop procedure if exists e|
create procedure e(x int)
foo: loop
if x = 0 then
@@ -347,6 +356,7 @@ e 2
e 1
delete from t1|
drop procedure e|
+drop procedure if exists f|
create procedure f(x int)
if x < 0 then
insert into test.t1 values ("f", 0);
@@ -365,6 +375,7 @@ f 1
f 2
delete from t1|
drop procedure f|
+drop procedure if exists g|
create procedure g(x int)
case
when x < 0 then
@@ -384,6 +395,7 @@ g 1
g 2
delete from t1|
drop procedure g|
+drop procedure if exists h|
create procedure h(x int)
case x
when 0 then
@@ -403,6 +415,7 @@ h1 1
h? 17
delete from t1|
drop procedure h|
+drop procedure if exists i|
create procedure i(x int)
foo:
begin
@@ -418,6 +431,7 @@ id data
i 3
delete from t1|
drop procedure i|
+drop procedure if exists goto1|
create procedure goto1()
begin
declare y int;
@@ -443,6 +457,7 @@ j 0
j 1
j 2
drop procedure goto1|
+drop procedure if exists goto2|
create procedure goto2(a int)
begin
declare x int default 0;
@@ -499,6 +514,7 @@ j 1
j 2
drop procedure goto2|
delete from t1|
+drop procedure if exists goto3|
create procedure goto3()
begin
label L1;
@@ -507,6 +523,7 @@ end;
goto L1;
end|
drop procedure goto3|
+drop procedure if exists goto4|
create procedure goto4()
begin
begin
@@ -517,6 +534,7 @@ end;
end;
end|
drop procedure goto4|
+drop procedure if exists goto5|
create procedure goto5()
begin
begin
@@ -527,6 +545,7 @@ label lab1;
end;
end|
drop procedure goto5|
+drop procedure if exists goto6|
create procedure goto6()
begin
label L1;
@@ -553,6 +572,7 @@ end|
drop procedure goto6|
insert into t1 values ("foo", 3), ("bar", 19)|
insert into t2 values ("x", 9, 4.1), ("y", -1, 19.2), ("z", 3, 2.2)|
+drop procedure if exists sel1|
create procedure sel1()
begin
select * from t1;
@@ -562,6 +582,7 @@ id data
foo 3
bar 19
drop procedure sel1|
+drop procedure if exists sel2|
create procedure sel2()
begin
select * from t1;
@@ -578,6 +599,7 @@ z 3 2.2
drop procedure sel2|
delete from t1|
delete from t2|
+drop procedure if exists into_test|
create procedure into_test(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -591,6 +613,7 @@ into 100
into2 102
delete from t1|
drop procedure into_test|
+drop procedure if exists into_tes2|
create procedure into_test2(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -604,6 +627,7 @@ into 100 100
into2 102 100
delete from t1|
drop procedure into_test2|
+drop procedure if exists into_test3|
create procedure into_test3()
begin
declare x char(16);
@@ -621,6 +645,7 @@ into3 19 0
delete from t1|
delete from t2|
drop procedure into_test3|
+drop procedure if exists into_test4|
create procedure into_test4()
begin
declare x int;
@@ -644,6 +669,7 @@ into4 77
delete from t1|
drop table t3|
drop procedure into_test4|
+drop procedure if exists into_outfile|
create procedure into_outfile(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -653,6 +679,7 @@ end|
call into_outfile("ofile", 1)|
delete from t1|
drop procedure into_outfile|
+drop procedure if exists into_dumpfile|
create procedure into_dumpfile(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -662,6 +689,7 @@ end|
call into_dumpfile("dfile", 1)|
delete from t1|
drop procedure into_dumpfile|
+drop procedure if exists create_select|
create procedure create_select(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -677,27 +705,32 @@ cs 90 cs2 92
drop table if exists t3|
delete from t1|
drop procedure create_select|
+drop function if exists e|
create function e() returns double
return 2.7182818284590452354|
set @e = e()|
select e(), @e|
e() @e
2.718281828459 2.718281828459
+drop function if exists inc|
create function inc(i int) returns int
return i+1|
select inc(1), inc(99), inc(-71)|
inc(1) inc(99) inc(-71)
2 100 -70
+drop function if exists mul|
create function mul(x int, y int) returns int
return x*y|
select mul(1,1), mul(3,5), mul(4711, 666)|
mul(1,1) mul(3,5) mul(4711, 666)
1 15 3137526
+drop function if exists append|
create function append(s1 char(8), s2 char(8)) returns char(16)
return concat(s1, s2)|
select append("foo", "bar")|
append("foo", "bar")
foobar
+drop function if exists fac|
create function fac(n int unsigned) returns bigint unsigned
begin
declare f bigint unsigned default 1;
@@ -710,6 +743,7 @@ end|
select fac(1), fac(2), fac(5), fac(10)|
fac(1) fac(2) fac(5) fac(10)
1 2 120 3628800
+drop function if exists fun|
create function fun(d double, i int, u int unsigned) returns double
return mul(inc(i), fac(u)) / e()|
select fun(2.3, 3, 5)|
@@ -737,6 +771,7 @@ drop function inc|
drop function mul|
drop function append|
drop function fun|
+drop procedure if exists hndlr1|
create procedure hndlr1(val int)
begin
declare x int default 0;
@@ -755,6 +790,7 @@ id data
hndlr1 42
delete from t1|
drop procedure hndlr1|
+drop procedure if exists hndlr2|
create procedure hndlr2(val int)
begin
declare x int default 0;
@@ -770,6 +806,7 @@ id data
hndlr2 1
delete from t1|
drop procedure hndlr2|
+drop procedure if exists hndlr3|
create procedure hndlr3(val int)
begin
declare x int default 0;
@@ -798,6 +835,7 @@ delete from t1|
drop procedure hndlr3|
drop table if exists t3|
create table t3 ( id char(16), data int )|
+drop procedure if exists hndlr4|
create procedure hndlr4()
begin
declare x int default 0;
@@ -812,6 +850,7 @@ id data
z NULL
drop table t3|
drop procedure hndlr4|
+drop procedure if exists cur1|
create procedure cur1()
begin
declare a char(16);
@@ -839,6 +878,7 @@ zap 663
drop procedure cur1|
drop table if exists t3|
create table t3 ( s char(16), i int )|
+drop procedure if exists cur2|
create procedure cur2()
begin
declare done int default 0;
@@ -875,6 +915,7 @@ delete from t1|
delete from t2|
drop table t3|
drop procedure cur2|
+drop procedure if exists chistics|
create procedure chistics()
language sql
modifies sql data
@@ -902,6 +943,7 @@ chistics CREATE PROCEDURE `test`.`chistics`()
COMMENT 'Characteristics procedure test'
insert into t1 values ("chistics", 1)
drop procedure chistics|
+drop function if exists chistics|
create function chistics() returns int
language sql
deterministic
@@ -932,6 +974,7 @@ return 42
drop function chistics|
insert into t1 values ("foo", 1), ("bar", 2), ("zip", 3)|
set @@sql_mode = 'ANSI'|
+drop procedure if exists modes$
create procedure modes(out c1 int, out c2 int)
begin
declare done int default 0;
@@ -968,12 +1011,14 @@ use test|
drop database sp_db2|
create database sp_db3|
use sp_db3|
+drop procedure if exists dummy|
create procedure dummy(out x int)
set x = 42|
use test|
drop database sp_db3|
select type,db,name from mysql.proc where db = 'sp_db3'|
type db name
+drop procedure if exists rc|
create procedure rc()
begin
delete from t1;
@@ -1001,7 +1046,8 @@ select row_count()|
row_count()
-1
drop procedure rc|
-create procedure bug(a_id char(16), a_data int)
+drop procedure if exists bug822|
+create procedure bug822(a_id char(16), a_data int)
begin
declare n int;
select count(*) into n from t1 where id = a_id and data = a_data;
@@ -1009,16 +1055,17 @@ if n = 0 then
insert into t1 (id, data) values (a_id, a_data);
end if;
end|
-call bug('foo', 42)|
-call bug('foo', 42)|
-call bug('bar', 666)|
+call bug822('foo', 42)|
+call bug822('foo', 42)|
+call bug822('bar', 666)|
select * from t1|
id data
foo 42
bar 666
delete from t1|
-drop procedure bug|
-create procedure bug()
+drop procedure bug822|
+drop procedure if exists bug1495|
+create procedure bug1495()
begin
declare x int;
select data into x from t1 order by id limit 1;
@@ -1029,18 +1076,19 @@ insert into t1 values ("more", x+10);
end if;
end|
insert into t1 values ('foo', 12)|
-call bug()|
+call bug1495()|
delete from t1 where id='foo'|
insert into t1 values ('bar', 7)|
-call bug()|
+call bug1495()|
delete from t1 where id='bar'|
select * from t1|
id data
less 2
more 17
delete from t1|
-drop procedure bug|
-create procedure bug(s char(16))
+drop procedure bug1495|
+drop procedure if exists bug1547|
+create procedure bug1547(s char(16))
begin
declare x int;
select data into x from t1 where s = id limit 1;
@@ -1051,8 +1099,8 @@ insert into t1 values ("more", x+10);
end if;
end|
insert into t1 values ("foo", 12), ("bar", 7)|
-call bug("foo")|
-call bug("bar")|
+call bug1547("foo")|
+call bug1547("bar")|
select * from t1|
id data
foo 12
@@ -1060,34 +1108,37 @@ bar 7
less 2
more 17
delete from t1|
-drop procedure bug|
+drop procedure bug1547|
drop table if exists t70|
create table t70 (s1 int,s2 int)|
insert into t70 values (1,2)|
-create procedure bug(out p1 int, out p2 int)
+drop procedure if exists bug1656|
+create procedure bug1656(out p1 int, out p2 int)
select * into p1, p1 from t70|
-call bug(@1, @2)|
+call bug1656(@1, @2)|
select @1, @2|
@1 @2
2 NULL
drop table t70|
-drop procedure bug|
+drop procedure bug1656|
drop table if exists t3|
create table t3(a int)|
-create procedure bug()
+drop procedure if exists bug1862|
+create procedure bug1862()
begin
insert into t3 values(2);
flush tables;
end|
-call bug()|
-call bug()|
+call bug1862()|
+call bug1862()|
select * from t3|
a
2
2
drop table t3|
-drop procedure bug|
-create procedure bug()
+drop procedure bug1862|
+drop procedure if exists bug1874|
+create procedure bug1874()
begin
declare x int;
declare y double;
@@ -1101,7 +1152,7 @@ select avg(data) into y from t1;
insert into t2 values ("avg", 0, y);
end|
insert into t1 (data) values (3), (1), (5), (9), (4)|
-call bug()|
+call bug1874()|
select * from t2|
s i d
max 9 0
@@ -1110,8 +1161,9 @@ sum 22 0
avg 0 4.4
delete from t1|
delete from t2|
-drop procedure bug|
-create procedure bug()
+drop procedure bug1874|
+drop procedure if exists bug2260|
+create procedure bug2260()
begin
declare v1 int;
declare c1 cursor for select data from t1;
@@ -1121,23 +1173,27 @@ fetch c1 into v1;
set @x2 = 2;
close c1;
end|
-call bug()|
+call bug2260()|
select @x2|
@x2
2
-drop procedure bug|
+drop procedure bug2260|
+drop procedure if exists bug2267_1|
create procedure bug2267_1()
begin
show procedure status;
end|
+drop procedure if exists bug2267_2|
create procedure bug2267_2()
begin
show function status;
end|
+drop procedure if exists bug2267_3|
create procedure bug2267_3()
begin
show create procedure bug2267_1;
end|
+drop procedure if exists bug2267_4|
create procedure bug2267_4()
begin
show create function fac;
@@ -1172,38 +1228,44 @@ drop procedure bug2267_1|
drop procedure bug2267_2|
drop procedure bug2267_3|
drop procedure bug2267_4|
-create procedure bug(x int)
+drop procedure if exists bug2227|
+create procedure bug2227(x int)
begin
declare y float default 2.6;
declare z char(16) default "zzz";
select 1.3, x, y, 42, z;
end|
-call bug(9)|
+call bug2227(9)|
1.3 x y 42 z
1.3 9 2.6 42 zzz
-drop procedure bug|
-create procedure bug()
+drop procedure bug2227|
+drop procedure if exists bug2614|
+create procedure bug2614()
begin
drop table if exists t3;
create table t3 (id int default '0' not null);
insert into t3 select 12;
insert into t3 select * from t3;
end|
-call bug()|
-call bug()|
+call bug2614()|
+call bug2614()|
drop table t3|
-drop procedure bug|
-create function bug () returns int
+drop procedure bug2614|
+drop function if exists bug2674|
+create function bug2674() returns int
return @@sort_buffer_size|
set @osbs = @@sort_buffer_size|
set @@sort_buffer_size = 262000|
-select bug()|
-bug()
+select bug2674()|
+bug2674()
262000
-drop function bug|
+drop function bug2674|
set @@sort_buffer_size = @osbs|
+drop procedure if exists bug3259_1 |
create procedure bug3259_1 () begin end|
+drop procedure if exists BUG3259_2 |
create procedure BUG3259_2 () begin end|
+drop procedure if exists Bug3259_3 |
create procedure Bug3259_3 () begin end|
call BUG3259_1()|
call BUG3259_1()|
@@ -1214,48 +1276,52 @@ call bUG3259_3()|
drop procedure bUg3259_1|
drop procedure BuG3259_2|
drop procedure BUG3259_3|
-create function bug() returns char(10) character set latin2
+drop function if exists bug2772|
+create function bug2772() returns char(10) character set latin2
return 'a'|
-select bug()|
-bug()
+select bug2772()|
+bug2772()
a
-drop function bug|
-create procedure bug(out x int)
+drop function bug2772|
+drop procedure if exists bug2776_1|
+create procedure bug2776_1(out x int)
begin
declare v int;
set v = default;
set x = v;
end|
-create procedure bug2(out x int)
+drop procedure if exists bug2776_2|
+create procedure bug2776_2(out x int)
begin
declare v int default 42;
set v = default;
set x = v;
end|
set @x = 1|
-call bug(@x)|
+call bug2776_1(@x)|
select @x|
@x
NULL
-call bug2(@x)|
+call bug2776_2(@x)|
select @x|
@x
42
-drop procedure bug|
-drop procedure bug2|
+drop procedure bug2776_1|
+drop procedure bug2776_2|
drop table if exists t3|
create table t3 (s1 smallint)|
insert into t3 values (123456789012)|
Warnings:
Warning 1264 Out of range value adjusted for column 's1' at row 1
-create procedure bug()
+drop procedure if exists bug2780|
+create procedure bug2780()
begin
declare exit handler for sqlwarning set @x = 1;
set @x = 0;
insert into t3 values (123456789012);
insert into t3 values (0);
end|
-call bug()|
+call bug2780()|
select @x|
@x
1
@@ -1263,12 +1329,13 @@ select * from t3|
s1
32767
32767
-drop procedure bug|
+drop procedure bug2780|
drop table t3|
create table t3 (content varchar(10) )|
insert into t3 values ("test1")|
insert into t3 values ("test2")|
create table t4 (f1 int, rc int, t3 int)|
+drop procedure if exists bug1863|
create procedure bug1863(in1 int)
begin
declare ind int default 0;
@@ -1314,6 +1381,7 @@ insert t3 (OrderID,MarketID) values (1,1)|
insert t3 (OrderID,MarketID) values (2,2)|
insert t4 (MarketID,Market,Status) values (1,"MarketID One","A")|
insert t4 (MarketID,Market,Status) values (2,"MarketID Two","A")|
+drop procedure if exists bug2656_1|
create procedure bug2656_1()
begin
select
@@ -1321,6 +1389,7 @@ m.Market
from t4 m JOIN t3 o
ON o.MarketID != 1 and o.MarketID = m.MarketID;
end |
+drop procedure if exists bug2656_2|
create procedure bug2656_2()
begin
select
@@ -1345,6 +1414,7 @@ MarketID Two
drop procedure bug2656_1|
drop procedure bug2656_2|
drop table t3, t4|
+drop procedure if exists bug3426|
create procedure bug3426(in_time int unsigned, out x int)
begin
if in_time is null then
@@ -1389,6 +1459,7 @@ Warning 1265 Data truncated for column 'ach' at row 2
insert into t4 values (1 , 'bCh1' )|
Warnings:
Warning 1265 Data truncated for column 'bch' at row 1
+drop procedure if exists bug3448|
create procedure bug3448()
select * from t3 inner join t4 on t3.a = t4.b|
select * from t3 inner join t4 on t3.a = t4.b|
@@ -1416,6 +1487,7 @@ insert into t3 (title,body) values
('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...')|
+drop procedure if exists bug3734 |
create procedure bug3734 (param1 varchar(100))
select * from t3 where match (title,body) against (param1)|
call bug3734('database')|
@@ -1427,6 +1499,7 @@ id title body
6 MySQL Security When configured properly, MySQL ...
drop procedure bug3734|
drop table t3|
+drop procedure if exists bug3863|
create procedure bug3863()
begin
set @a = 0;
@@ -1450,6 +1523,7 @@ msg text not null,
primary key (id),
unique key rid (rid, id)
)|
+drop procedure if exists bug2460_1|
create procedure bug2460_1(in v int)
begin
( select n0.id from t3 as n0 where n0.id = v )
@@ -1473,6 +1547,7 @@ call bug2460_1(2)|
id
2
1
+drop procedure if exists bug2460_2|
create procedure bug2460_2()
begin
drop table if exists t3;
@@ -1488,16 +1563,20 @@ drop procedure bug2460_1|
drop procedure bug2460_2|
drop table t3|
set @@sql_mode = ''|
+drop procedure if exists bug2564_1|
create procedure bug2564_1()
comment 'Joe''s procedure'
insert into `t1` values ("foo", 1)|
set @@sql_mode = 'ANSI_QUOTES'|
+drop procedure if exists bug2564_2|
create procedure bug2564_2()
insert into "t1" values ('foo', 1)|
set @@sql_mode = ''$
+drop function if exists bug2564_3$
create function bug2564_3(x int, y int) returns int
return x || y$
set @@sql_mode = 'ANSI'$
+drop function if exists bug2564_4$
create function bug2564_4(x int, y int) returns int
return x || y$
set @@sql_mode = ''|
@@ -1522,6 +1601,7 @@ drop procedure bug2564_1|
drop procedure bug2564_2|
drop function bug2564_3|
drop function bug2564_4|
+drop function if exists bug3132|
create function bug3132(s char(20)) returns char(50)
return concat('Hello, ', s, '!')|
select bug3132('Bob') union all select bug3132('Judy')|
@@ -1529,6 +1609,7 @@ bug3132('Bob')
Hello, Bob!
Hello, Judy!
drop function bug3132|
+drop procedure if exists bug3843|
create procedure bug3843()
analyze table t1|
call bug3843()|
@@ -1544,6 +1625,7 @@ drop procedure bug3843|
drop table if exists t3|
create table t3 ( s1 char(10) )|
insert into t3 values ('a'), ('b')|
+drop procedure if exists bug3368|
create procedure bug3368(v char(10))
begin
select group_concat(v) from t3;
@@ -1559,6 +1641,10 @@ drop table t3|
drop table if exists t3|
create table t3 (f1 int, f2 int);
insert into t3 values (1,1);
+--disable_warnings|
+drop procedure if exists bug4579_1|
+Warnings:
+Note 1305 PROCEDURE bug4579_1 does not exist
create procedure bug4579_1 ()
begin
declare sf1 int;
@@ -1566,6 +1652,7 @@ select f1 into sf1 from t3 where f1=1 and f2=1;
update t3 set f2 = f2 + 1 where f1=1 and f2=1;
call bug4579_2();
end|
+drop procedure if exists bug4579_2|
create procedure bug4579_2 ()
begin
end|
@@ -1580,6 +1667,7 @@ drop table t3|
drop table if exists t3|
create table t3 (f1 int, f2 int, f3 int)|
insert into t3 values (1,1,1)|
+drop procedure if exists bug4726|
create procedure bug4726()
begin
declare tmp_o_id INT;
@@ -1599,6 +1687,7 @@ drop table t3|
drop table if exists t3|
create table t3 (s1 int)|
insert into t3 values (3), (4)|
+drop procedure if exists bug4318|
create procedure bug4318()
handler t3 read next|
handler t3 open|
@@ -1611,6 +1700,7 @@ s1
handler t3 close|
drop procedure bug4318|
drop table t3|
+drop procedure if exists bug4902|
create procedure bug4902()
begin
show charset like 'foo';
@@ -1737,6 +1827,7 @@ Tables_in_test (foo)
Variable_name Value
Level Code Message
drop procedure bug4902|
+drop procedure if exists bug4902_2|
create procedure bug4902_2()
begin
show processlist;
@@ -1749,6 +1840,7 @@ Id User Host db Command Time State Info
# root localhost test Query # NULL show processlist
drop procedure bug4902_2|
drop table if exists t3|
+drop procedure if exists bug4904|
create procedure bug4904()
begin
declare continue handler for sqlstate 'HY000' begin end;
@@ -1758,6 +1850,7 @@ call bug4904()|
ERROR 42S02: Table 'test.t3' doesn't exist
drop procedure bug4904|
create table t3 (s1 char character set latin1, s2 char character set latin2)|
+drop procedure if exists bug4904|
create procedure bug4904 ()
begin
declare continue handler for sqlstate 'HY000' begin end;
@@ -1766,6 +1859,7 @@ end|
call bug4904()|
drop procedure bug4904|
drop table t3|
+drop procedure if exists bug336|
create procedure bug336(out y int)
begin
declare x int;
@@ -1779,6 +1873,7 @@ select @y|
5
delete from t1|
drop procedure bug336|
+drop procedure if exists bug3157|
create procedure bug3157()
begin
if exists(select * from t1) then
@@ -1796,6 +1891,7 @@ select @n|
2
delete from t1|
drop procedure bug3157|
+drop procedure if exists bug5251|
create procedure bug5251()
begin
end|
@@ -1807,6 +1903,7 @@ where db='test' and name='bug5251' and created = @c1|
count(*)
1
drop procedure bug5251|
+drop procedure if exists bug5251|
create procedure bug5251()
checksum table t1|
call bug5251()|
@@ -1816,6 +1913,7 @@ call bug5251()|
Table Checksum
test.t1 0
drop procedure bug5251|
+drop procedure if exists bug5287|
create procedure bug5287(param1 int)
label1:
begin
@@ -1828,6 +1926,7 @@ end loop;
end|
call bug5287(1)|
drop procedure bug5287|
+drop procedure if exists bug5307|
create procedure bug5307()
begin
end; set @x = 3|
@@ -1836,9 +1935,11 @@ select @x|
@x
3
drop procedure bug5307|
+drop procedure if exists bug5258|
create procedure bug5258()
begin
end|
+drop procedure if exists bug5258_aux|
create procedure bug5258_aux()
begin
declare c, m char(19);
@@ -1854,6 +1955,7 @@ Ok
Ok
drop procedure bug5258|
drop procedure bug5258_aux|
+drop function if exists bug4487|
create function bug4487() returns char
begin
declare v char;
@@ -1864,6 +1966,7 @@ bug4487()
NULL
drop function bug4487|
drop procedure if exists bug4941|
+drop procedure if exists bug4941|
create procedure bug4941(out x int)
begin
declare c cursor for select i from t2 limit 1;
@@ -1880,6 +1983,7 @@ NULL
delete from t1|
drop procedure bug4941|
drop procedure if exists bug3583|
+drop procedure if exists bug3583|
create procedure bug3583()
begin
declare c int;
@@ -1927,6 +2031,7 @@ drop procedure bug3583|
drop table if exists t3|
drop procedure if exists bug4905|
create table t3 (s1 int,primary key (s1))|
+drop procedure if exists bug4905|
create procedure bug4905()
begin
declare v int;
@@ -1951,6 +2056,7 @@ s1
drop procedure bug4905|
drop table t3|
drop function if exists bug6022|
+drop function if exists bug6022|
create function bug6022(x int) returns int
begin
if x < 0 then
@@ -1964,6 +2070,7 @@ bug6022(5)
0
drop function bug6022|
drop procedure if exists bug6029|
+drop procedure if exists bug6029|
create procedure bug6029()
begin
declare exit handler for 1136 select '1136';
@@ -1985,6 +2092,7 @@ drop procedure bug6029|
drop table t3|
drop table if exists fac|
create table fac (n int unsigned not null primary key, f bigint unsigned)|
+drop procedure if exists ifac|
create procedure ifac(n int unsigned)
begin
declare i int unsigned default 1;
@@ -2044,6 +2152,7 @@ insert into primes values
(30, 131), (31, 137), (32, 139), (33, 149), (34, 151),
(35, 157), (36, 163), (37, 167), (38, 173), (39, 179),
(40, 181), (41, 191), (42, 193), (43, 197), (44, 199)|
+drop procedure if exists opp|
create procedure opp(n bigint unsigned, out pp bool)
begin
declare r double;
@@ -2070,6 +2179,7 @@ end;
end if;
end loop;
end|
+drop procedure if exists ip|
create procedure ip(m int unsigned)
begin
declare p bigint unsigned;
@@ -2133,6 +2243,7 @@ Db Name Type Definer Modified Created Security_type Comment
drop table if exists fib|
create table fib ( f bigint unsigned not null )|
insert into fib values (1), (1)|
+drop procedure if exists fib|
create procedure fib(n int unsigned)
begin
if n > 0 then
@@ -2175,6 +2286,7 @@ f
17711
drop table fib|
drop procedure fib|
+drop procedure if exists bar|
create procedure bar(x char(16), y int)
comment "111111111111" sql security invoker
insert into test.t1 values (x, y)|
@@ -2195,6 +2307,7 @@ test bar PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINE
drop procedure bar|
drop table t1;
drop table t2;
+drop procedure if exists p1;
create procedure p1 () select (select s1 from t1) from t1;
create table t1 (s1 int);
call p1();
@@ -2205,6 +2318,7 @@ call p1();
1
drop procedure p1;
drop table t1;
+drop function if exists foo;
create function `foo` () returns int return 5;
select `foo` ();
`foo` ()
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 931f3c3d71b..e8929b2afdd 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -269,7 +269,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
2 SUBQUERY t2 ALL NULL NULL NULL NULL 3
Warnings:
-Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where (`test`.`t3`.`a` >= (select min(`test`.`t2`.`b`) from `test`.`t2`))
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= (select min(`test`.`t2`.`b`) from `test`.`t2`)))
select * from t3 where a >= all (select b from t2);
a
7
@@ -1496,6 +1496,65 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
Warnings:
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < (select max(`test`.`t2`.`b`) from `test`.`t2`)))
+select * from t3 where a >= some (select b from t2);
+a
+explain extended select * from t3 where a >= some (select b from t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
+2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+Warnings:
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= (select min(`test`.`t2`.`b`) from `test`.`t2`)))
+select * from t3 where a >= all (select b from t2 group by 1);
+a
+6
+7
+3
+explain extended select * from t3 where a >= all (select b from t2 group by 1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
+2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+Warnings:
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < <max>(select `test`.`t2`.`b` AS `b` from `test`.`t2` group by 1)))
+select * from t3 where a >= some (select b from t2 group by 1);
+a
+explain extended select * from t3 where a >= some (select b from t2 group by 1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
+2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+Warnings:
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= <min>(select `test`.`t2`.`b` AS `b` from `test`.`t2` group by 1)))
+select * from t3 where NULL >= any (select b from t2);
+a
+explain extended select * from t3 where NULL >= any (select b from t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+Warnings:
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3`
+select * from t3 where NULL >= any (select b from t2 group by 1);
+a
+explain extended select * from t3 where NULL >= any (select b from t2 group by 1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+Warnings:
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3`
+select * from t3 where NULL >= some (select b from t2);
+a
+explain extended select * from t3 where NULL >= some (select b from t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+Warnings:
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3`
+select * from t3 where NULL >= some (select b from t2 group by 1);
+a
+explain extended select * from t3 where NULL >= some (select b from t2 group by 1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+Warnings:
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3`
insert into t2 values (2,2), (2,1), (3,3), (3,1);
select * from t3 where a > all (select max(b) from t2 group by a);
a
@@ -2039,3 +2098,38 @@ insert into t1 values (20,15);
select * from t1 where (('a',null) <=> (select 'a',s2 from t1 where s1 = 0));
s1 s2
drop table t1;
+create table t1 (s1 int);
+insert into t1 values (1),(null);
+select * from t1 where s1 < all (select s1 from t1);
+s1
+select s1, s1 < all (select s1 from t1) from t1;
+s1 s1 < all (select s1 from t1)
+1 0
+NULL NULL
+drop table t1;
+CREATE TABLE t1 (
+Code char(3) NOT NULL default '',
+Name char(52) NOT NULL default '',
+Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia',
+Region char(26) NOT NULL default '',
+SurfaceArea float(10,2) NOT NULL default '0.00',
+IndepYear smallint(6) default NULL,
+Population int(11) NOT NULL default '0',
+LifeExpectancy float(3,1) default NULL,
+GNP float(10,2) default NULL,
+GNPOld float(10,2) default NULL,
+LocalName char(45) NOT NULL default '',
+GovernmentForm char(45) NOT NULL default '',
+HeadOfState char(60) default NULL,
+Capital int(11) default NULL,
+Code2 char(2) NOT NULL default ''
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX');
+INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS');
+INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF');
+INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM');
+/*!40000 ALTER TABLE t1 ENABLE KEYS */;
+SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200);
+c
+Oceania
+drop table t1;
diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result
index 10c0a2e3652..6e36f24d8b0 100644
--- a/mysql-test/r/temp_table.result
+++ b/mysql-test/r/temp_table.result
@@ -94,6 +94,6 @@ d
2002-10-24 14:50:40
show status like "created_tmp%tables";
Variable_name Value
-Created_tmp_disk_tables 0
-Created_tmp_tables 1
+Created_tmp_disk_tables 1
+Created_tmp_tables 2
drop table t1;
diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result
index e1aff266bac..040ec866080 100644
--- a/mysql-test/r/timezone2.result
+++ b/mysql-test/r/timezone2.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1, t2;
create table t1 (ts timestamp);
set time_zone='+00:00';
select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp());
@@ -256,18 +256,52 @@ delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%';
delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges;
-grant usage on mysqltest.* to mysqltest_1@localhost;
+create table t1 (a int, b datetime);
+create table t2 (c int, d datetime);
+grant all privileges on test.* to mysqltest_1@localhost;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
+GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'localhost'
set time_zone= '+00:00';
set time_zone= 'Europe/Moscow';
select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC');
convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC')
2004-10-21 15:00:00
+select convert_tz(b, 'Europe/Moscow', 'UTC') from t1;
+convert_tz(b, 'Europe/Moscow', 'UTC')
+update t1, t2 set t1.b = convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC')
+where t1.a = t2.c and t2.d = (select max(d) from t2);
select * from mysql.time_zone_name;
-ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql'
+ERROR 42000: select command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name'
select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name;
-ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql'
+ERROR 42000: select command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name'
+delete from mysql.db where user like 'mysqltest\_%';
+flush privileges;
+grant all privileges on test.t1 to mysqltest_1@localhost;
+grant all privileges on test.t2 to mysqltest_1@localhost;
+show grants for current_user();
+Grants for mysqltest_1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
+GRANT ALL PRIVILEGES ON `test`.`t2` TO 'mysqltest_1'@'localhost'
+GRANT ALL PRIVILEGES ON `test`.`t1` TO 'mysqltest_1'@'localhost'
+set time_zone= '+00:00';
+set time_zone= 'Europe/Moscow';
+select convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC');
+convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC')
+NULL
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2004-11-31 12:00:00'
+select convert_tz(b, 'Europe/Moscow', 'UTC') from t1;
+convert_tz(b, 'Europe/Moscow', 'UTC')
+update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC')
+where t1.a = t2.c and t2.d = (select max(d) from t2);
+select * from mysql.time_zone_name;
+ERROR 42000: select command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name'
+select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name;
+ERROR 42000: select command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name'
delete from mysql.user where user like 'mysqltest\_%';
+delete from mysql.db where user like 'mysqltest\_%';
+delete from mysql.tables_priv where user like 'mysqltest\_%';
flush privileges;
+drop table t1, t2;
diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result
index 6e92cb7b54c..d4496f454a0 100644
--- a/mysql-test/r/type_enum.result
+++ b/mysql-test/r/type_enum.result
@@ -1731,9 +1731,17 @@ alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
select * from t1;
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
-def test t1 t1 a a 254 3 1 Y 384 0 8
-def test t1 t1 b b 254 9 0 Y 2176 0 8
-def test t1 t1 c c 254 3 0 Y 384 0 8
+def test t1 t1 a a 254 1 1 Y 384 0 8
+def test t1 t1 b b 254 3 0 Y 2176 0 8
+def test t1 t1 c c 254 1 0 Y 384 0 8
a b c
Y NULL NULL
drop table t1;
+create table t1 (a enum('x','y') default 'x');
+alter table t1 alter a set default 'z';
+ERROR 42000: Invalid default value for 'a'
+drop table t1;
+create table t1 (a set('x','y') default 'x');
+alter table t1 alter a set default 'z';
+ERROR 42000: Invalid default value for 'a'
+drop table t1;
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 1fbba8ebbb7..334a2531c7f 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -851,27 +851,27 @@ count(*)
26
show status like 'Slow_queries';
Variable_name Value
-Slow_queries 0
+Slow_queries 1
select count(*) from t1 where b=13;
count(*)
10
show status like 'Slow_queries';
Variable_name Value
-Slow_queries 1
+Slow_queries 3
select count(*) from t1 where b=13 union select count(*) from t1 where a=7;
count(*)
10
26
show status like 'Slow_queries';
Variable_name Value
-Slow_queries 2
+Slow_queries 5
select count(*) from t1 where a=7 union select count(*) from t1 where b=13;
count(*)
26
10
show status like 'Slow_queries';
Variable_name Value
-Slow_queries 3
+Slow_queries 7
drop table t1;
create table t1 ( RID int(11) not null default '0', IID int(11) not null default '0', nada varchar(50) not null,NAME varchar(50) not null,PHONE varchar(50) not null) engine=MyISAM;
insert into t1 ( RID,IID,nada,NAME,PHONE) values (1, 1, 'main', 'a', '111'), (2, 1, 'main', 'b', '222'), (3, 1, 'main', 'c', '333'), (4, 1, 'main', 'd', '444'), (5, 1, 'main', 'e', '555'), (6, 2, 'main', 'c', '333'), (7, 2, 'main', 'd', '454'), (8, 2, 'main', 'e', '555'), (9, 2, 'main', 'f', '666'), (10, 2, 'main', 'g', '777');
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result
index 6d2e623a6fb..beab6105f79 100644
--- a/mysql-test/r/update.result
+++ b/mysql-test/r/update.result
@@ -206,3 +206,9 @@ colC colA colD colE colF
3 4433 10005 492 500
DROP TABLE t1;
DROP TABLE t2;
+create table t1 (c1 int, c2 char(6), c3 int);
+create table t2 (c1 int, c2 char(6));
+insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20);
+update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1";
+update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10;
+drop table t1, t2;
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index b2d58df5798..5d34d6f6f52 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -502,3 +502,7 @@ t1 CREATE TABLE `t1` (
`c3` longtext
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8;
+SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';
+Variable_name Value
+myisam_data_pointer_size 8
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 366d799fde3..ba5b9e945e8 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -659,7 +659,7 @@ ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for column
update v2 set c=a+c;
ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for column 'c' in table 'v2'
update t2,v3 set v3.a=v3.a+v3.c where t2.x=v3.c;
-ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for column 'a' in table 'v3'
+ERROR 42000: update command denied to user 'mysqltest_1'@'localhost' for table 'v3'
update v3 set a=a+c;
ERROR 42000: update command denied to user 'mysqltest_1'@'localhost' for table 'v3'
use test;
@@ -1433,8 +1433,7 @@ insert into v1 values (1) on duplicate key update a=2;
insert into v1 values (1) on duplicate key update a=2;
ERROR HY000: CHECK OPTION failed 'test.v1'
insert ignore into v1 values (1) on duplicate key update a=2;
-Warnings:
-Error 1369 CHECK OPTION failed 'test.v1'
+ERROR HY000: CHECK OPTION failed 'test.v1'
select * from t1;
a
1
diff --git a/mysql-test/t/ctype_create.test b/mysql-test/t/ctype_create.test
index 9a5cb025474..e97017ab416 100644
--- a/mysql-test/t/ctype_create.test
+++ b/mysql-test/t/ctype_create.test
@@ -86,3 +86,15 @@ create database d1 default character set latin1 collate latin2_bin;
#
#
DROP DATABASE mysqltest1;
+
+
+#
+# Synatx: 'ALTER DATABASE' without db_name
+#
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET latin7;
+use mysqltest2;
+ALTER DATABASE DEFAULT CHARACTER SET latin2;
+show create database mysqltest2;
+drop database mysqltest2;
+--error 1046
+ALTER DATABASE DEFAULT CHARACTER SET latin2;
diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test
index 11833ba9bc7..8bca2a4b3c2 100644
--- a/mysql-test/t/ctype_uca.test
+++ b/mysql-test/t/ctype_uca.test
@@ -444,3 +444,11 @@ DROP TABLE t1;
SET @test_character_set= 'utf8';
SET @test_collation= 'utf8_swedish_ci';
-- source include/ctype_common.inc
+
+#
+# Bug 7111 server crashes when regexp is used
+#
+create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci;
+insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c');
+select a, a regexp '[a]' from t1 order by binary a;
+drop table t1;
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index 597b364dbb1..9d6cb6649ab 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -345,3 +345,34 @@ show binlog events from 95;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001
drop table t2;
+
+
+#
+# Check that ucs2 works with ENUM and SET type
+#
+set names latin1;
+create table t1 (a enum('x','y','z') character set ucs2);
+show create table t1;
+insert into t1 values ('x');
+insert into t1 values ('y');
+insert into t1 values ('z');
+select a, hex(a) from t1 order by a;
+alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set ucs2;
+show create table t1;
+insert into t1 values ('D');
+insert into t1 values ('E ');
+insert into t1 values ('Ä');
+insert into t1 values ('Ö');
+insert into t1 values ('Ü');
+select a, hex(a) from t1 order by a;
+drop table t1;
+
+create table t1 (a set ('x','y','z','ä','ö','ü') character set ucs2);
+show create table t1;
+insert into t1 values ('x');
+insert into t1 values ('y');
+insert into t1 values ('z');
+insert into t1 values ('x,y');
+insert into t1 values ('x,y,z,Ä,Ö,Ü');
+select a, hex(a) from t1 order by a;
+drop table t1;
diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test
index 9cfb6b14d7e..3f0e9882179 100644
--- a/mysql-test/t/ctype_ujis.test
+++ b/mysql-test/t/ctype_ujis.test
@@ -119,3 +119,1025 @@ SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a;
DROP TABLE t1;
+
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(c char(1)) character set ujis;
+INSERT INTO t1 VALUES(0xA2AF);
+INSERT INTO t1 VALUES(0xA2B0);
+INSERT INTO t1 VALUES(0xA2B1);
+INSERT INTO t1 VALUES(0xA2B2);
+INSERT INTO t1 VALUES(0xA2B3);
+INSERT INTO t1 VALUES(0xA2B4);
+INSERT INTO t1 VALUES(0xA2B5);
+INSERT INTO t1 VALUES(0xA2B6);
+INSERT INTO t1 VALUES(0xA2B7);
+INSERT INTO t1 VALUES(0xA2B8);
+INSERT INTO t1 VALUES(0xA2B9);
+INSERT INTO t1 VALUES(0xA2C2);
+INSERT INTO t1 VALUES(0xA2C3);
+INSERT INTO t1 VALUES(0xA2C4);
+INSERT INTO t1 VALUES(0xA2C5);
+INSERT INTO t1 VALUES(0xA2C6);
+INSERT INTO t1 VALUES(0xA2C7);
+INSERT INTO t1 VALUES(0xA2C8);
+INSERT INTO t1 VALUES(0xA2C9);
+INSERT INTO t1 VALUES(0xA2D1);
+INSERT INTO t1 VALUES(0xA2D2);
+INSERT INTO t1 VALUES(0xA2D3);
+INSERT INTO t1 VALUES(0xA2D4);
+INSERT INTO t1 VALUES(0xA2D5);
+INSERT INTO t1 VALUES(0xA2D6);
+INSERT INTO t1 VALUES(0xA2D7);
+INSERT INTO t1 VALUES(0xA2D8);
+INSERT INTO t1 VALUES(0xA2D9);
+INSERT INTO t1 VALUES(0xA2DA);
+INSERT INTO t1 VALUES(0xA2DB);
+INSERT INTO t1 VALUES(0xA2EB);
+INSERT INTO t1 VALUES(0xA2EC);
+INSERT INTO t1 VALUES(0xA2ED);
+INSERT INTO t1 VALUES(0xA2EE);
+INSERT INTO t1 VALUES(0xA2EF);
+INSERT INTO t1 VALUES(0xA2F0);
+INSERT INTO t1 VALUES(0xA2F1);
+INSERT INTO t1 VALUES(0xA2FA);
+INSERT INTO t1 VALUES(0xA2FB);
+INSERT INTO t1 VALUES(0xA2FC);
+INSERT INTO t1 VALUES(0xA2FD);
+INSERT INTO t1 VALUES(0xA3A1);
+INSERT INTO t1 VALUES(0xA3A2);
+INSERT INTO t1 VALUES(0xA3A3);
+INSERT INTO t1 VALUES(0xA3A4);
+INSERT INTO t1 VALUES(0xA3A5);
+INSERT INTO t1 VALUES(0xA3A6);
+INSERT INTO t1 VALUES(0xA3A7);
+INSERT INTO t1 VALUES(0xA3A8);
+INSERT INTO t1 VALUES(0xA3A9);
+INSERT INTO t1 VALUES(0xA3AA);
+INSERT INTO t1 VALUES(0xA3AB);
+INSERT INTO t1 VALUES(0xA3AC);
+INSERT INTO t1 VALUES(0xA3AD);
+INSERT INTO t1 VALUES(0xA3AE);
+INSERT INTO t1 VALUES(0xA3AF);
+INSERT INTO t1 VALUES(0xA3BA);
+INSERT INTO t1 VALUES(0xA3BB);
+INSERT INTO t1 VALUES(0xA3BC);
+INSERT INTO t1 VALUES(0xA3BD);
+INSERT INTO t1 VALUES(0xA3BE);
+INSERT INTO t1 VALUES(0xA3BF);
+INSERT INTO t1 VALUES(0xA3C0);
+INSERT INTO t1 VALUES(0xA3DB);
+INSERT INTO t1 VALUES(0xA3DC);
+INSERT INTO t1 VALUES(0xA3DD);
+INSERT INTO t1 VALUES(0xA3DE);
+INSERT INTO t1 VALUES(0xA3DF);
+INSERT INTO t1 VALUES(0xA3E0);
+INSERT INTO t1 VALUES(0xA3FB);
+INSERT INTO t1 VALUES(0xA3FC);
+INSERT INTO t1 VALUES(0xA3FD);
+INSERT INTO t1 VALUES(0xA3FE);
+INSERT INTO t1 VALUES(0xA4F4);
+INSERT INTO t1 VALUES(0xA4F5);
+INSERT INTO t1 VALUES(0xA4F6);
+INSERT INTO t1 VALUES(0xA4F7);
+INSERT INTO t1 VALUES(0xA4F8);
+INSERT INTO t1 VALUES(0xA4F9);
+INSERT INTO t1 VALUES(0xA4FA);
+INSERT INTO t1 VALUES(0xA4FB);
+INSERT INTO t1 VALUES(0xA4FC);
+INSERT INTO t1 VALUES(0xA4FD);
+INSERT INTO t1 VALUES(0xA4FE);
+INSERT INTO t1 VALUES(0xA5F7);
+INSERT INTO t1 VALUES(0xA5F8);
+INSERT INTO t1 VALUES(0xA5F9);
+INSERT INTO t1 VALUES(0xA5FA);
+INSERT INTO t1 VALUES(0xA5FB);
+INSERT INTO t1 VALUES(0xA5FC);
+INSERT INTO t1 VALUES(0xA5FD);
+INSERT INTO t1 VALUES(0xA5FE);
+INSERT INTO t1 VALUES(0xA6B9);
+INSERT INTO t1 VALUES(0xA6BA);
+INSERT INTO t1 VALUES(0xA6BB);
+INSERT INTO t1 VALUES(0xA6BC);
+INSERT INTO t1 VALUES(0xA6BD);
+INSERT INTO t1 VALUES(0xA6BE);
+INSERT INTO t1 VALUES(0xA6BF);
+INSERT INTO t1 VALUES(0xA6C0);
+INSERT INTO t1 VALUES(0xA6D9);
+INSERT INTO t1 VALUES(0xA6DA);
+INSERT INTO t1 VALUES(0xA6DB);
+INSERT INTO t1 VALUES(0xA6DC);
+INSERT INTO t1 VALUES(0xA6DD);
+INSERT INTO t1 VALUES(0xA6DE);
+INSERT INTO t1 VALUES(0xA6DF);
+INSERT INTO t1 VALUES(0xA6E0);
+INSERT INTO t1 VALUES(0xA6E1);
+INSERT INTO t1 VALUES(0xA6E2);
+INSERT INTO t1 VALUES(0xA6E3);
+INSERT INTO t1 VALUES(0xA6E4);
+INSERT INTO t1 VALUES(0xA6E5);
+INSERT INTO t1 VALUES(0xA6E6);
+INSERT INTO t1 VALUES(0xA6E7);
+INSERT INTO t1 VALUES(0xA6E8);
+INSERT INTO t1 VALUES(0xA6E9);
+INSERT INTO t1 VALUES(0xA6EA);
+INSERT INTO t1 VALUES(0xA6EB);
+INSERT INTO t1 VALUES(0xA6EC);
+INSERT INTO t1 VALUES(0xA6ED);
+INSERT INTO t1 VALUES(0xA6EE);
+INSERT INTO t1 VALUES(0xA6EF);
+INSERT INTO t1 VALUES(0xA6F0);
+INSERT INTO t1 VALUES(0xA6F1);
+INSERT INTO t1 VALUES(0xA6F2);
+INSERT INTO t1 VALUES(0xA6F3);
+INSERT INTO t1 VALUES(0xA6F4);
+INSERT INTO t1 VALUES(0xA6F5);
+INSERT INTO t1 VALUES(0xA6F6);
+INSERT INTO t1 VALUES(0xA6F7);
+INSERT INTO t1 VALUES(0xA6F8);
+INSERT INTO t1 VALUES(0xA6F9);
+INSERT INTO t1 VALUES(0xA6FA);
+INSERT INTO t1 VALUES(0xA6FB);
+INSERT INTO t1 VALUES(0xA6FC);
+INSERT INTO t1 VALUES(0xA6FD);
+INSERT INTO t1 VALUES(0xA6FE);
+INSERT INTO t1 VALUES(0xA7C2);
+INSERT INTO t1 VALUES(0xA7C3);
+INSERT INTO t1 VALUES(0xA7C4);
+INSERT INTO t1 VALUES(0xA7C5);
+INSERT INTO t1 VALUES(0xA7C6);
+INSERT INTO t1 VALUES(0xA7C7);
+INSERT INTO t1 VALUES(0xA7C8);
+INSERT INTO t1 VALUES(0xA7C9);
+INSERT INTO t1 VALUES(0xA7CA);
+INSERT INTO t1 VALUES(0xA7CB);
+INSERT INTO t1 VALUES(0xA7CC);
+INSERT INTO t1 VALUES(0xA7CD);
+INSERT INTO t1 VALUES(0xA7CE);
+INSERT INTO t1 VALUES(0xA7CF);
+INSERT INTO t1 VALUES(0xA7D0);
+INSERT INTO t1 VALUES(0xA7F2);
+INSERT INTO t1 VALUES(0xA7F3);
+INSERT INTO t1 VALUES(0xA7F4);
+INSERT INTO t1 VALUES(0xA7F5);
+INSERT INTO t1 VALUES(0xA7F6);
+INSERT INTO t1 VALUES(0xA7F7);
+INSERT INTO t1 VALUES(0xA7F8);
+INSERT INTO t1 VALUES(0xA7F9);
+INSERT INTO t1 VALUES(0xA7FA);
+INSERT INTO t1 VALUES(0xA7FB);
+INSERT INTO t1 VALUES(0xA7FC);
+INSERT INTO t1 VALUES(0xA7FD);
+INSERT INTO t1 VALUES(0xA7FE);
+INSERT INTO t1 VALUES(0xA8C1);
+INSERT INTO t1 VALUES(0xA8C2);
+INSERT INTO t1 VALUES(0xA8C3);
+INSERT INTO t1 VALUES(0xA8C4);
+INSERT INTO t1 VALUES(0xA8C5);
+INSERT INTO t1 VALUES(0xA8C6);
+INSERT INTO t1 VALUES(0xA8C7);
+INSERT INTO t1 VALUES(0xA8C8);
+INSERT INTO t1 VALUES(0xA8C9);
+INSERT INTO t1 VALUES(0xA8CA);
+INSERT INTO t1 VALUES(0xA8CB);
+INSERT INTO t1 VALUES(0xA8CC);
+INSERT INTO t1 VALUES(0xA8CD);
+INSERT INTO t1 VALUES(0xA8CE);
+INSERT INTO t1 VALUES(0xA8CF);
+INSERT INTO t1 VALUES(0xA8D0);
+INSERT INTO t1 VALUES(0xA8D1);
+INSERT INTO t1 VALUES(0xA8D2);
+INSERT INTO t1 VALUES(0xA8D3);
+INSERT INTO t1 VALUES(0xA8D4);
+INSERT INTO t1 VALUES(0xA8D5);
+INSERT INTO t1 VALUES(0xA8D6);
+INSERT INTO t1 VALUES(0xA8D7);
+INSERT INTO t1 VALUES(0xA8D8);
+INSERT INTO t1 VALUES(0xA8D9);
+INSERT INTO t1 VALUES(0xA8DA);
+INSERT INTO t1 VALUES(0xA8DB);
+INSERT INTO t1 VALUES(0xA8DC);
+INSERT INTO t1 VALUES(0xA8DD);
+INSERT INTO t1 VALUES(0xA8DE);
+INSERT INTO t1 VALUES(0xA8DF);
+INSERT INTO t1 VALUES(0xA8E0);
+INSERT INTO t1 VALUES(0xA8E1);
+INSERT INTO t1 VALUES(0xA8E2);
+INSERT INTO t1 VALUES(0xA8E3);
+INSERT INTO t1 VALUES(0xA8E4);
+INSERT INTO t1 VALUES(0xA8E5);
+INSERT INTO t1 VALUES(0xA8E6);
+INSERT INTO t1 VALUES(0xA8E7);
+INSERT INTO t1 VALUES(0xA8E8);
+INSERT INTO t1 VALUES(0xA8E9);
+INSERT INTO t1 VALUES(0xA8EA);
+INSERT INTO t1 VALUES(0xA8EB);
+INSERT INTO t1 VALUES(0xA8EC);
+INSERT INTO t1 VALUES(0xA8ED);
+INSERT INTO t1 VALUES(0xA8EE);
+INSERT INTO t1 VALUES(0xA8EF);
+INSERT INTO t1 VALUES(0xA8F0);
+INSERT INTO t1 VALUES(0xA8F1);
+INSERT INTO t1 VALUES(0xA8F2);
+INSERT INTO t1 VALUES(0xA8F3);
+INSERT INTO t1 VALUES(0xA8F4);
+INSERT INTO t1 VALUES(0xA8F5);
+INSERT INTO t1 VALUES(0xA8F6);
+INSERT INTO t1 VALUES(0xA8F7);
+INSERT INTO t1 VALUES(0xA8F8);
+INSERT INTO t1 VALUES(0xA8F9);
+INSERT INTO t1 VALUES(0xA8FA);
+INSERT INTO t1 VALUES(0xA8FB);
+INSERT INTO t1 VALUES(0xA8FC);
+INSERT INTO t1 VALUES(0xA8FD);
+INSERT INTO t1 VALUES(0xA8FE);
+INSERT INTO t1 VALUES(0xA9A1);
+INSERT INTO t1 VALUES(0xA9A2);
+INSERT INTO t1 VALUES(0xA9A3);
+INSERT INTO t1 VALUES(0xA9A4);
+INSERT INTO t1 VALUES(0xA9A5);
+INSERT INTO t1 VALUES(0xA9A6);
+INSERT INTO t1 VALUES(0xA9A7);
+INSERT INTO t1 VALUES(0xA9A8);
+INSERT INTO t1 VALUES(0xA9A9);
+INSERT INTO t1 VALUES(0xA9AA);
+INSERT INTO t1 VALUES(0xA9AB);
+INSERT INTO t1 VALUES(0xA9AC);
+INSERT INTO t1 VALUES(0xA9AD);
+INSERT INTO t1 VALUES(0xA9AE);
+INSERT INTO t1 VALUES(0xA9AF);
+INSERT INTO t1 VALUES(0xA9B0);
+INSERT INTO t1 VALUES(0xA9B1);
+INSERT INTO t1 VALUES(0xA9B2);
+INSERT INTO t1 VALUES(0xA9B3);
+INSERT INTO t1 VALUES(0xA9B4);
+INSERT INTO t1 VALUES(0xA9B5);
+INSERT INTO t1 VALUES(0xA9B6);
+INSERT INTO t1 VALUES(0xA9B7);
+INSERT INTO t1 VALUES(0xA9B8);
+INSERT INTO t1 VALUES(0xA9B9);
+INSERT INTO t1 VALUES(0xA9BA);
+INSERT INTO t1 VALUES(0xA9BB);
+INSERT INTO t1 VALUES(0xA9BC);
+INSERT INTO t1 VALUES(0xA9BD);
+INSERT INTO t1 VALUES(0xA9BE);
+INSERT INTO t1 VALUES(0xA9BF);
+INSERT INTO t1 VALUES(0xA9C0);
+INSERT INTO t1 VALUES(0xA9C1);
+INSERT INTO t1 VALUES(0xA9C2);
+INSERT INTO t1 VALUES(0xA9C3);
+INSERT INTO t1 VALUES(0xA9C4);
+INSERT INTO t1 VALUES(0xA9C5);
+INSERT INTO t1 VALUES(0xA9C6);
+INSERT INTO t1 VALUES(0xA9C7);
+INSERT INTO t1 VALUES(0xA9C8);
+INSERT INTO t1 VALUES(0xA9C9);
+INSERT INTO t1 VALUES(0xA9CA);
+INSERT INTO t1 VALUES(0xA9CB);
+INSERT INTO t1 VALUES(0xA9CC);
+INSERT INTO t1 VALUES(0xA9CD);
+INSERT INTO t1 VALUES(0xA9CE);
+INSERT INTO t1 VALUES(0xA9CF);
+INSERT INTO t1 VALUES(0xA9D0);
+INSERT INTO t1 VALUES(0xA9D1);
+INSERT INTO t1 VALUES(0xA9D2);
+INSERT INTO t1 VALUES(0xA9D3);
+INSERT INTO t1 VALUES(0xA9D4);
+INSERT INTO t1 VALUES(0xA9D5);
+INSERT INTO t1 VALUES(0xA9D6);
+INSERT INTO t1 VALUES(0xA9D7);
+INSERT INTO t1 VALUES(0xA9D8);
+INSERT INTO t1 VALUES(0xA9D9);
+INSERT INTO t1 VALUES(0xA9DA);
+INSERT INTO t1 VALUES(0xA9DB);
+INSERT INTO t1 VALUES(0xA9DC);
+INSERT INTO t1 VALUES(0xA9DD);
+INSERT INTO t1 VALUES(0xA9DE);
+INSERT INTO t1 VALUES(0xA9DF);
+INSERT INTO t1 VALUES(0xA9E0);
+INSERT INTO t1 VALUES(0xA9E1);
+INSERT INTO t1 VALUES(0xA9E2);
+INSERT INTO t1 VALUES(0xA9E3);
+INSERT INTO t1 VALUES(0xA9E4);
+INSERT INTO t1 VALUES(0xA9E5);
+INSERT INTO t1 VALUES(0xA9E6);
+INSERT INTO t1 VALUES(0xA9E7);
+INSERT INTO t1 VALUES(0xA9E8);
+INSERT INTO t1 VALUES(0xA9E9);
+INSERT INTO t1 VALUES(0xA9EA);
+INSERT INTO t1 VALUES(0xA9EB);
+INSERT INTO t1 VALUES(0xA9EC);
+INSERT INTO t1 VALUES(0xA9ED);
+INSERT INTO t1 VALUES(0xA9EE);
+INSERT INTO t1 VALUES(0xA9EF);
+INSERT INTO t1 VALUES(0xA9F0);
+INSERT INTO t1 VALUES(0xA9F1);
+INSERT INTO t1 VALUES(0xA9F2);
+INSERT INTO t1 VALUES(0xA9F3);
+INSERT INTO t1 VALUES(0xA9F4);
+INSERT INTO t1 VALUES(0xA9F5);
+INSERT INTO t1 VALUES(0xA9F6);
+INSERT INTO t1 VALUES(0xA9F7);
+INSERT INTO t1 VALUES(0xA9F8);
+INSERT INTO t1 VALUES(0xA9F9);
+INSERT INTO t1 VALUES(0xA9FA);
+INSERT INTO t1 VALUES(0xA9FB);
+INSERT INTO t1 VALUES(0xA9FC);
+INSERT INTO t1 VALUES(0xA9FD);
+INSERT INTO t1 VALUES(0xA9FE);
+INSERT INTO t1 VALUES(0xAAA1);
+INSERT INTO t1 VALUES(0xAAA2);
+INSERT INTO t1 VALUES(0xAAA3);
+INSERT INTO t1 VALUES(0xAAA4);
+INSERT INTO t1 VALUES(0xAAA5);
+INSERT INTO t1 VALUES(0xAAA6);
+INSERT INTO t1 VALUES(0xAAA7);
+INSERT INTO t1 VALUES(0xAAA8);
+INSERT INTO t1 VALUES(0xAAA9);
+INSERT INTO t1 VALUES(0xAAAA);
+INSERT INTO t1 VALUES(0xAAAB);
+INSERT INTO t1 VALUES(0xAAAC);
+INSERT INTO t1 VALUES(0xAAAD);
+INSERT INTO t1 VALUES(0xAAAE);
+INSERT INTO t1 VALUES(0xAAAF);
+INSERT INTO t1 VALUES(0xAAB0);
+INSERT INTO t1 VALUES(0xAAB1);
+INSERT INTO t1 VALUES(0xAAB2);
+INSERT INTO t1 VALUES(0xAAB3);
+INSERT INTO t1 VALUES(0xAAB4);
+INSERT INTO t1 VALUES(0xAAB5);
+INSERT INTO t1 VALUES(0xAAB6);
+INSERT INTO t1 VALUES(0xAAB7);
+INSERT INTO t1 VALUES(0xAAB8);
+INSERT INTO t1 VALUES(0xAAB9);
+INSERT INTO t1 VALUES(0xAABA);
+INSERT INTO t1 VALUES(0xAABB);
+INSERT INTO t1 VALUES(0xAABC);
+INSERT INTO t1 VALUES(0xAABD);
+INSERT INTO t1 VALUES(0xAABE);
+INSERT INTO t1 VALUES(0xAABF);
+INSERT INTO t1 VALUES(0xAAC0);
+INSERT INTO t1 VALUES(0xAAC1);
+INSERT INTO t1 VALUES(0xAAC2);
+INSERT INTO t1 VALUES(0xAAC3);
+INSERT INTO t1 VALUES(0xAAC4);
+INSERT INTO t1 VALUES(0xAAC5);
+INSERT INTO t1 VALUES(0xAAC6);
+INSERT INTO t1 VALUES(0xAAC7);
+INSERT INTO t1 VALUES(0xAAC8);
+INSERT INTO t1 VALUES(0xAAC9);
+INSERT INTO t1 VALUES(0xAACA);
+INSERT INTO t1 VALUES(0xAACB);
+INSERT INTO t1 VALUES(0xAACC);
+INSERT INTO t1 VALUES(0xAACD);
+INSERT INTO t1 VALUES(0xAACE);
+INSERT INTO t1 VALUES(0xAACF);
+INSERT INTO t1 VALUES(0xAAD0);
+INSERT INTO t1 VALUES(0xAAD1);
+INSERT INTO t1 VALUES(0xAAD2);
+INSERT INTO t1 VALUES(0xAAD3);
+INSERT INTO t1 VALUES(0xAAD4);
+INSERT INTO t1 VALUES(0xAAD5);
+INSERT INTO t1 VALUES(0xAAD6);
+INSERT INTO t1 VALUES(0xAAD7);
+INSERT INTO t1 VALUES(0xAAD8);
+INSERT INTO t1 VALUES(0xAAD9);
+INSERT INTO t1 VALUES(0xAADA);
+INSERT INTO t1 VALUES(0xAADB);
+INSERT INTO t1 VALUES(0xAADC);
+INSERT INTO t1 VALUES(0xAADD);
+INSERT INTO t1 VALUES(0xAADE);
+INSERT INTO t1 VALUES(0xAADF);
+INSERT INTO t1 VALUES(0xAAE0);
+INSERT INTO t1 VALUES(0xAAE1);
+INSERT INTO t1 VALUES(0xAAE2);
+INSERT INTO t1 VALUES(0xAAE3);
+INSERT INTO t1 VALUES(0xAAE4);
+INSERT INTO t1 VALUES(0xAAE5);
+INSERT INTO t1 VALUES(0xAAE6);
+INSERT INTO t1 VALUES(0xAAE7);
+INSERT INTO t1 VALUES(0xAAE8);
+INSERT INTO t1 VALUES(0xAAE9);
+INSERT INTO t1 VALUES(0xAAEA);
+INSERT INTO t1 VALUES(0xAAEB);
+INSERT INTO t1 VALUES(0xAAEC);
+INSERT INTO t1 VALUES(0xAAED);
+INSERT INTO t1 VALUES(0xAAEE);
+INSERT INTO t1 VALUES(0xAAEF);
+INSERT INTO t1 VALUES(0xAAF0);
+INSERT INTO t1 VALUES(0xAAF1);
+INSERT INTO t1 VALUES(0xAAF2);
+INSERT INTO t1 VALUES(0xAAF3);
+INSERT INTO t1 VALUES(0xAAF4);
+INSERT INTO t1 VALUES(0xAAF5);
+INSERT INTO t1 VALUES(0xAAF6);
+INSERT INTO t1 VALUES(0xAAF7);
+INSERT INTO t1 VALUES(0xAAF8);
+INSERT INTO t1 VALUES(0xAAF9);
+INSERT INTO t1 VALUES(0xAAFA);
+INSERT INTO t1 VALUES(0xAAFB);
+INSERT INTO t1 VALUES(0xAAFC);
+INSERT INTO t1 VALUES(0xAAFD);
+INSERT INTO t1 VALUES(0xAAFE);
+INSERT INTO t1 VALUES(0xABA1);
+INSERT INTO t1 VALUES(0xABA2);
+INSERT INTO t1 VALUES(0xABA3);
+INSERT INTO t1 VALUES(0xABA4);
+INSERT INTO t1 VALUES(0xABA5);
+INSERT INTO t1 VALUES(0xABA6);
+INSERT INTO t1 VALUES(0xABA7);
+INSERT INTO t1 VALUES(0xABA8);
+INSERT INTO t1 VALUES(0xABA9);
+INSERT INTO t1 VALUES(0xABAA);
+INSERT INTO t1 VALUES(0xABAB);
+INSERT INTO t1 VALUES(0xABAC);
+INSERT INTO t1 VALUES(0xABAD);
+INSERT INTO t1 VALUES(0xABAE);
+INSERT INTO t1 VALUES(0xABAF);
+INSERT INTO t1 VALUES(0xABB0);
+INSERT INTO t1 VALUES(0xABB1);
+INSERT INTO t1 VALUES(0xABB2);
+INSERT INTO t1 VALUES(0xABB3);
+INSERT INTO t1 VALUES(0xABB4);
+INSERT INTO t1 VALUES(0xABB5);
+INSERT INTO t1 VALUES(0xABB6);
+INSERT INTO t1 VALUES(0xABB7);
+INSERT INTO t1 VALUES(0xABB8);
+INSERT INTO t1 VALUES(0xABB9);
+INSERT INTO t1 VALUES(0xABBA);
+INSERT INTO t1 VALUES(0xABBB);
+INSERT INTO t1 VALUES(0xABBC);
+INSERT INTO t1 VALUES(0xABBD);
+INSERT INTO t1 VALUES(0xABBE);
+INSERT INTO t1 VALUES(0xABBF);
+INSERT INTO t1 VALUES(0xABC0);
+INSERT INTO t1 VALUES(0xABC1);
+INSERT INTO t1 VALUES(0xABC2);
+INSERT INTO t1 VALUES(0xABC3);
+INSERT INTO t1 VALUES(0xABC4);
+INSERT INTO t1 VALUES(0xABC5);
+INSERT INTO t1 VALUES(0xABC6);
+INSERT INTO t1 VALUES(0xABC7);
+INSERT INTO t1 VALUES(0xABC8);
+INSERT INTO t1 VALUES(0xABC9);
+INSERT INTO t1 VALUES(0xABCA);
+INSERT INTO t1 VALUES(0xABCB);
+INSERT INTO t1 VALUES(0xABCC);
+INSERT INTO t1 VALUES(0xABCD);
+INSERT INTO t1 VALUES(0xABCE);
+INSERT INTO t1 VALUES(0xABCF);
+INSERT INTO t1 VALUES(0xABD0);
+INSERT INTO t1 VALUES(0xABD1);
+INSERT INTO t1 VALUES(0xABD2);
+INSERT INTO t1 VALUES(0xABD3);
+INSERT INTO t1 VALUES(0xABD4);
+INSERT INTO t1 VALUES(0xABD5);
+INSERT INTO t1 VALUES(0xABD6);
+INSERT INTO t1 VALUES(0xABD7);
+INSERT INTO t1 VALUES(0xABD8);
+INSERT INTO t1 VALUES(0xABD9);
+INSERT INTO t1 VALUES(0xABDA);
+INSERT INTO t1 VALUES(0xABDB);
+INSERT INTO t1 VALUES(0xABDC);
+INSERT INTO t1 VALUES(0xABDD);
+INSERT INTO t1 VALUES(0xABDE);
+INSERT INTO t1 VALUES(0xABDF);
+INSERT INTO t1 VALUES(0xABE0);
+INSERT INTO t1 VALUES(0xABE1);
+INSERT INTO t1 VALUES(0xABE2);
+INSERT INTO t1 VALUES(0xABE3);
+INSERT INTO t1 VALUES(0xABE4);
+INSERT INTO t1 VALUES(0xABE5);
+INSERT INTO t1 VALUES(0xABE6);
+INSERT INTO t1 VALUES(0xABE7);
+INSERT INTO t1 VALUES(0xABE8);
+INSERT INTO t1 VALUES(0xABE9);
+INSERT INTO t1 VALUES(0xABEA);
+INSERT INTO t1 VALUES(0xABEB);
+INSERT INTO t1 VALUES(0xABEC);
+INSERT INTO t1 VALUES(0xABED);
+INSERT INTO t1 VALUES(0xABEE);
+INSERT INTO t1 VALUES(0xABEF);
+INSERT INTO t1 VALUES(0xABF0);
+INSERT INTO t1 VALUES(0xABF1);
+INSERT INTO t1 VALUES(0xABF2);
+INSERT INTO t1 VALUES(0xABF3);
+INSERT INTO t1 VALUES(0xABF4);
+INSERT INTO t1 VALUES(0xABF5);
+INSERT INTO t1 VALUES(0xABF6);
+INSERT INTO t1 VALUES(0xABF7);
+INSERT INTO t1 VALUES(0xABF8);
+INSERT INTO t1 VALUES(0xABF9);
+INSERT INTO t1 VALUES(0xABFA);
+INSERT INTO t1 VALUES(0xABFB);
+INSERT INTO t1 VALUES(0xABFC);
+INSERT INTO t1 VALUES(0xABFD);
+INSERT INTO t1 VALUES(0xABFE);
+INSERT INTO t1 VALUES(0xACA1);
+INSERT INTO t1 VALUES(0xACA2);
+INSERT INTO t1 VALUES(0xACA3);
+INSERT INTO t1 VALUES(0xACA4);
+INSERT INTO t1 VALUES(0xACA5);
+INSERT INTO t1 VALUES(0xACA6);
+INSERT INTO t1 VALUES(0xACA7);
+INSERT INTO t1 VALUES(0xACA8);
+INSERT INTO t1 VALUES(0xACA9);
+INSERT INTO t1 VALUES(0xACAA);
+INSERT INTO t1 VALUES(0xACAB);
+INSERT INTO t1 VALUES(0xACAC);
+INSERT INTO t1 VALUES(0xACAD);
+INSERT INTO t1 VALUES(0xACAE);
+INSERT INTO t1 VALUES(0xACAF);
+INSERT INTO t1 VALUES(0xACB0);
+INSERT INTO t1 VALUES(0xACB1);
+INSERT INTO t1 VALUES(0xACB2);
+INSERT INTO t1 VALUES(0xACB3);
+INSERT INTO t1 VALUES(0xACB4);
+INSERT INTO t1 VALUES(0xACB5);
+INSERT INTO t1 VALUES(0xACB6);
+INSERT INTO t1 VALUES(0xACB7);
+INSERT INTO t1 VALUES(0xACB8);
+INSERT INTO t1 VALUES(0xACB9);
+INSERT INTO t1 VALUES(0xACBA);
+INSERT INTO t1 VALUES(0xACBB);
+INSERT INTO t1 VALUES(0xACBC);
+INSERT INTO t1 VALUES(0xACBD);
+INSERT INTO t1 VALUES(0xACBE);
+INSERT INTO t1 VALUES(0xACBF);
+INSERT INTO t1 VALUES(0xACC0);
+INSERT INTO t1 VALUES(0xACC1);
+INSERT INTO t1 VALUES(0xACC2);
+INSERT INTO t1 VALUES(0xACC3);
+INSERT INTO t1 VALUES(0xACC4);
+INSERT INTO t1 VALUES(0xACC5);
+INSERT INTO t1 VALUES(0xACC6);
+INSERT INTO t1 VALUES(0xACC7);
+INSERT INTO t1 VALUES(0xACC8);
+INSERT INTO t1 VALUES(0xACC9);
+INSERT INTO t1 VALUES(0xACCA);
+INSERT INTO t1 VALUES(0xACCB);
+INSERT INTO t1 VALUES(0xACCC);
+INSERT INTO t1 VALUES(0xACCD);
+INSERT INTO t1 VALUES(0xACCE);
+INSERT INTO t1 VALUES(0xACCF);
+INSERT INTO t1 VALUES(0xACD0);
+INSERT INTO t1 VALUES(0xACD1);
+INSERT INTO t1 VALUES(0xACD2);
+INSERT INTO t1 VALUES(0xACD3);
+INSERT INTO t1 VALUES(0xACD4);
+INSERT INTO t1 VALUES(0xACD5);
+INSERT INTO t1 VALUES(0xACD6);
+INSERT INTO t1 VALUES(0xACD7);
+INSERT INTO t1 VALUES(0xACD8);
+INSERT INTO t1 VALUES(0xACD9);
+INSERT INTO t1 VALUES(0xACDA);
+INSERT INTO t1 VALUES(0xACDB);
+INSERT INTO t1 VALUES(0xACDC);
+INSERT INTO t1 VALUES(0xACDD);
+INSERT INTO t1 VALUES(0xACDE);
+INSERT INTO t1 VALUES(0xACDF);
+INSERT INTO t1 VALUES(0xACE0);
+INSERT INTO t1 VALUES(0xACE1);
+INSERT INTO t1 VALUES(0xACE2);
+INSERT INTO t1 VALUES(0xACE3);
+INSERT INTO t1 VALUES(0xACE4);
+INSERT INTO t1 VALUES(0xACE5);
+INSERT INTO t1 VALUES(0xACE6);
+INSERT INTO t1 VALUES(0xACE7);
+INSERT INTO t1 VALUES(0xACE8);
+INSERT INTO t1 VALUES(0xACE9);
+INSERT INTO t1 VALUES(0xACEA);
+INSERT INTO t1 VALUES(0xACEB);
+INSERT INTO t1 VALUES(0xACEC);
+INSERT INTO t1 VALUES(0xACED);
+INSERT INTO t1 VALUES(0xACEE);
+INSERT INTO t1 VALUES(0xACEF);
+INSERT INTO t1 VALUES(0xACF0);
+INSERT INTO t1 VALUES(0xACF1);
+INSERT INTO t1 VALUES(0xACF2);
+INSERT INTO t1 VALUES(0xACF3);
+INSERT INTO t1 VALUES(0xACF4);
+INSERT INTO t1 VALUES(0xACF5);
+INSERT INTO t1 VALUES(0xACF6);
+INSERT INTO t1 VALUES(0xACF7);
+INSERT INTO t1 VALUES(0xACF8);
+INSERT INTO t1 VALUES(0xACF9);
+INSERT INTO t1 VALUES(0xACFA);
+INSERT INTO t1 VALUES(0xACFB);
+INSERT INTO t1 VALUES(0xACFC);
+INSERT INTO t1 VALUES(0xACFD);
+INSERT INTO t1 VALUES(0xACFE);
+INSERT INTO t1 VALUES(0xADA1);
+INSERT INTO t1 VALUES(0xADA2);
+INSERT INTO t1 VALUES(0xADA3);
+INSERT INTO t1 VALUES(0xADA4);
+INSERT INTO t1 VALUES(0xADA5);
+INSERT INTO t1 VALUES(0xADA6);
+INSERT INTO t1 VALUES(0xADA7);
+INSERT INTO t1 VALUES(0xADA8);
+INSERT INTO t1 VALUES(0xADA9);
+INSERT INTO t1 VALUES(0xADAA);
+INSERT INTO t1 VALUES(0xADAB);
+INSERT INTO t1 VALUES(0xADAC);
+INSERT INTO t1 VALUES(0xADAD);
+INSERT INTO t1 VALUES(0xADAE);
+INSERT INTO t1 VALUES(0xADAF);
+INSERT INTO t1 VALUES(0xADB0);
+INSERT INTO t1 VALUES(0xADB1);
+INSERT INTO t1 VALUES(0xADB2);
+INSERT INTO t1 VALUES(0xADB3);
+INSERT INTO t1 VALUES(0xADB4);
+INSERT INTO t1 VALUES(0xADB5);
+INSERT INTO t1 VALUES(0xADB6);
+INSERT INTO t1 VALUES(0xADB7);
+INSERT INTO t1 VALUES(0xADB8);
+INSERT INTO t1 VALUES(0xADB9);
+INSERT INTO t1 VALUES(0xADBA);
+INSERT INTO t1 VALUES(0xADBB);
+INSERT INTO t1 VALUES(0xADBC);
+INSERT INTO t1 VALUES(0xADBD);
+INSERT INTO t1 VALUES(0xADBE);
+INSERT INTO t1 VALUES(0xADBF);
+INSERT INTO t1 VALUES(0xADC0);
+INSERT INTO t1 VALUES(0xADC1);
+INSERT INTO t1 VALUES(0xADC2);
+INSERT INTO t1 VALUES(0xADC3);
+INSERT INTO t1 VALUES(0xADC4);
+INSERT INTO t1 VALUES(0xADC5);
+INSERT INTO t1 VALUES(0xADC6);
+INSERT INTO t1 VALUES(0xADC7);
+INSERT INTO t1 VALUES(0xADC8);
+INSERT INTO t1 VALUES(0xADC9);
+INSERT INTO t1 VALUES(0xADCA);
+INSERT INTO t1 VALUES(0xADCB);
+INSERT INTO t1 VALUES(0xADCC);
+INSERT INTO t1 VALUES(0xADCD);
+INSERT INTO t1 VALUES(0xADCE);
+INSERT INTO t1 VALUES(0xADCF);
+INSERT INTO t1 VALUES(0xADD0);
+INSERT INTO t1 VALUES(0xADD1);
+INSERT INTO t1 VALUES(0xADD2);
+INSERT INTO t1 VALUES(0xADD3);
+INSERT INTO t1 VALUES(0xADD4);
+INSERT INTO t1 VALUES(0xADD5);
+INSERT INTO t1 VALUES(0xADD6);
+INSERT INTO t1 VALUES(0xADD7);
+INSERT INTO t1 VALUES(0xADD8);
+INSERT INTO t1 VALUES(0xADD9);
+INSERT INTO t1 VALUES(0xADDA);
+INSERT INTO t1 VALUES(0xADDB);
+INSERT INTO t1 VALUES(0xADDC);
+INSERT INTO t1 VALUES(0xADDD);
+INSERT INTO t1 VALUES(0xADDE);
+INSERT INTO t1 VALUES(0xADDF);
+INSERT INTO t1 VALUES(0xADE0);
+INSERT INTO t1 VALUES(0xADE1);
+INSERT INTO t1 VALUES(0xADE2);
+INSERT INTO t1 VALUES(0xADE3);
+INSERT INTO t1 VALUES(0xADE4);
+INSERT INTO t1 VALUES(0xADE5);
+INSERT INTO t1 VALUES(0xADE6);
+INSERT INTO t1 VALUES(0xADE7);
+INSERT INTO t1 VALUES(0xADE8);
+INSERT INTO t1 VALUES(0xADE9);
+INSERT INTO t1 VALUES(0xADEA);
+INSERT INTO t1 VALUES(0xADEB);
+INSERT INTO t1 VALUES(0xADEC);
+INSERT INTO t1 VALUES(0xADED);
+INSERT INTO t1 VALUES(0xADEE);
+INSERT INTO t1 VALUES(0xADEF);
+INSERT INTO t1 VALUES(0xADF0);
+INSERT INTO t1 VALUES(0xADF1);
+INSERT INTO t1 VALUES(0xADF2);
+INSERT INTO t1 VALUES(0xADF3);
+INSERT INTO t1 VALUES(0xADF4);
+INSERT INTO t1 VALUES(0xADF5);
+INSERT INTO t1 VALUES(0xADF6);
+INSERT INTO t1 VALUES(0xADF7);
+INSERT INTO t1 VALUES(0xADF8);
+INSERT INTO t1 VALUES(0xADF9);
+INSERT INTO t1 VALUES(0xADFA);
+INSERT INTO t1 VALUES(0xADFB);
+INSERT INTO t1 VALUES(0xADFC);
+INSERT INTO t1 VALUES(0xADFD);
+INSERT INTO t1 VALUES(0xADFE);
+INSERT INTO t1 VALUES(0xAEA1);
+INSERT INTO t1 VALUES(0xAEA2);
+INSERT INTO t1 VALUES(0xAEA3);
+INSERT INTO t1 VALUES(0xAEA4);
+INSERT INTO t1 VALUES(0xAEA5);
+INSERT INTO t1 VALUES(0xAEA6);
+INSERT INTO t1 VALUES(0xAEA7);
+INSERT INTO t1 VALUES(0xAEA8);
+INSERT INTO t1 VALUES(0xAEA9);
+INSERT INTO t1 VALUES(0xAEAA);
+INSERT INTO t1 VALUES(0xAEAB);
+INSERT INTO t1 VALUES(0xAEAC);
+INSERT INTO t1 VALUES(0xAEAD);
+INSERT INTO t1 VALUES(0xAEAE);
+INSERT INTO t1 VALUES(0xAEAF);
+INSERT INTO t1 VALUES(0xAEB0);
+INSERT INTO t1 VALUES(0xAEB1);
+INSERT INTO t1 VALUES(0xAEB2);
+INSERT INTO t1 VALUES(0xAEB3);
+INSERT INTO t1 VALUES(0xAEB4);
+INSERT INTO t1 VALUES(0xAEB5);
+INSERT INTO t1 VALUES(0xAEB6);
+INSERT INTO t1 VALUES(0xAEB7);
+INSERT INTO t1 VALUES(0xAEB8);
+INSERT INTO t1 VALUES(0xAEB9);
+INSERT INTO t1 VALUES(0xAEBA);
+INSERT INTO t1 VALUES(0xAEBB);
+INSERT INTO t1 VALUES(0xAEBC);
+INSERT INTO t1 VALUES(0xAEBD);
+INSERT INTO t1 VALUES(0xAEBE);
+INSERT INTO t1 VALUES(0xAEBF);
+INSERT INTO t1 VALUES(0xAEC0);
+INSERT INTO t1 VALUES(0xAEC1);
+INSERT INTO t1 VALUES(0xAEC2);
+INSERT INTO t1 VALUES(0xAEC3);
+INSERT INTO t1 VALUES(0xAEC4);
+INSERT INTO t1 VALUES(0xAEC5);
+INSERT INTO t1 VALUES(0xAEC6);
+INSERT INTO t1 VALUES(0xAEC7);
+INSERT INTO t1 VALUES(0xAEC8);
+INSERT INTO t1 VALUES(0xAEC9);
+INSERT INTO t1 VALUES(0xAECA);
+INSERT INTO t1 VALUES(0xAECB);
+INSERT INTO t1 VALUES(0xAECC);
+INSERT INTO t1 VALUES(0xAECD);
+INSERT INTO t1 VALUES(0xAECE);
+INSERT INTO t1 VALUES(0xAECF);
+INSERT INTO t1 VALUES(0xAED0);
+INSERT INTO t1 VALUES(0xAED1);
+INSERT INTO t1 VALUES(0xAED2);
+INSERT INTO t1 VALUES(0xAED3);
+INSERT INTO t1 VALUES(0xAED4);
+INSERT INTO t1 VALUES(0xAED5);
+INSERT INTO t1 VALUES(0xAED6);
+INSERT INTO t1 VALUES(0xAED7);
+INSERT INTO t1 VALUES(0xAED8);
+INSERT INTO t1 VALUES(0xAED9);
+INSERT INTO t1 VALUES(0xAEDA);
+INSERT INTO t1 VALUES(0xAEDB);
+INSERT INTO t1 VALUES(0xAEDC);
+INSERT INTO t1 VALUES(0xAEDD);
+INSERT INTO t1 VALUES(0xAEDE);
+INSERT INTO t1 VALUES(0xAEDF);
+INSERT INTO t1 VALUES(0xAEE0);
+INSERT INTO t1 VALUES(0xAEE1);
+INSERT INTO t1 VALUES(0xAEE2);
+INSERT INTO t1 VALUES(0xAEE3);
+INSERT INTO t1 VALUES(0xAEE4);
+INSERT INTO t1 VALUES(0xAEE5);
+INSERT INTO t1 VALUES(0xAEE6);
+INSERT INTO t1 VALUES(0xAEE7);
+INSERT INTO t1 VALUES(0xAEE8);
+INSERT INTO t1 VALUES(0xAEE9);
+INSERT INTO t1 VALUES(0xAEEA);
+INSERT INTO t1 VALUES(0xAEEB);
+INSERT INTO t1 VALUES(0xAEEC);
+INSERT INTO t1 VALUES(0xAEED);
+INSERT INTO t1 VALUES(0xAEEE);
+INSERT INTO t1 VALUES(0xAEEF);
+INSERT INTO t1 VALUES(0xAEF0);
+INSERT INTO t1 VALUES(0xAEF1);
+INSERT INTO t1 VALUES(0xAEF2);
+INSERT INTO t1 VALUES(0xAEF3);
+INSERT INTO t1 VALUES(0xAEF4);
+INSERT INTO t1 VALUES(0xAEF5);
+INSERT INTO t1 VALUES(0xAEF6);
+INSERT INTO t1 VALUES(0xAEF7);
+INSERT INTO t1 VALUES(0xAEF8);
+INSERT INTO t1 VALUES(0xAEF9);
+INSERT INTO t1 VALUES(0xAEFA);
+INSERT INTO t1 VALUES(0xAEFB);
+INSERT INTO t1 VALUES(0xAEFC);
+INSERT INTO t1 VALUES(0xAEFD);
+INSERT INTO t1 VALUES(0xAEFE);
+INSERT INTO t1 VALUES(0xAFA1);
+INSERT INTO t1 VALUES(0xAFA2);
+INSERT INTO t1 VALUES(0xAFA3);
+INSERT INTO t1 VALUES(0xAFA4);
+INSERT INTO t1 VALUES(0xAFA5);
+INSERT INTO t1 VALUES(0xAFA6);
+INSERT INTO t1 VALUES(0xAFA7);
+INSERT INTO t1 VALUES(0xAFA8);
+INSERT INTO t1 VALUES(0xAFA9);
+INSERT INTO t1 VALUES(0xAFAA);
+INSERT INTO t1 VALUES(0xAFAB);
+INSERT INTO t1 VALUES(0xAFAC);
+INSERT INTO t1 VALUES(0xAFAD);
+INSERT INTO t1 VALUES(0xAFAE);
+INSERT INTO t1 VALUES(0xAFAF);
+INSERT INTO t1 VALUES(0xAFB0);
+INSERT INTO t1 VALUES(0xAFB1);
+INSERT INTO t1 VALUES(0xAFB2);
+INSERT INTO t1 VALUES(0xAFB3);
+INSERT INTO t1 VALUES(0xAFB4);
+INSERT INTO t1 VALUES(0xAFB5);
+INSERT INTO t1 VALUES(0xAFB6);
+INSERT INTO t1 VALUES(0xAFB7);
+INSERT INTO t1 VALUES(0xAFB8);
+INSERT INTO t1 VALUES(0xAFB9);
+INSERT INTO t1 VALUES(0xAFBA);
+INSERT INTO t1 VALUES(0xAFBB);
+INSERT INTO t1 VALUES(0xAFBC);
+INSERT INTO t1 VALUES(0xAFBD);
+INSERT INTO t1 VALUES(0xAFBE);
+INSERT INTO t1 VALUES(0xAFBF);
+INSERT INTO t1 VALUES(0xAFC0);
+INSERT INTO t1 VALUES(0xAFC1);
+INSERT INTO t1 VALUES(0xAFC2);
+INSERT INTO t1 VALUES(0xAFC3);
+INSERT INTO t1 VALUES(0xAFC4);
+INSERT INTO t1 VALUES(0xAFC5);
+INSERT INTO t1 VALUES(0xAFC6);
+INSERT INTO t1 VALUES(0xAFC7);
+INSERT INTO t1 VALUES(0xAFC8);
+INSERT INTO t1 VALUES(0xAFC9);
+INSERT INTO t1 VALUES(0xAFCA);
+INSERT INTO t1 VALUES(0xAFCB);
+INSERT INTO t1 VALUES(0xAFCC);
+INSERT INTO t1 VALUES(0xAFCD);
+INSERT INTO t1 VALUES(0xAFCE);
+INSERT INTO t1 VALUES(0xAFCF);
+INSERT INTO t1 VALUES(0xAFD0);
+INSERT INTO t1 VALUES(0xAFD1);
+INSERT INTO t1 VALUES(0xAFD2);
+INSERT INTO t1 VALUES(0xAFD3);
+INSERT INTO t1 VALUES(0xAFD4);
+INSERT INTO t1 VALUES(0xAFD5);
+INSERT INTO t1 VALUES(0xAFD6);
+INSERT INTO t1 VALUES(0xAFD7);
+INSERT INTO t1 VALUES(0xAFD8);
+INSERT INTO t1 VALUES(0xAFD9);
+INSERT INTO t1 VALUES(0xAFDA);
+INSERT INTO t1 VALUES(0xAFDB);
+INSERT INTO t1 VALUES(0xAFDC);
+INSERT INTO t1 VALUES(0xAFDD);
+INSERT INTO t1 VALUES(0xAFDE);
+INSERT INTO t1 VALUES(0xAFDF);
+INSERT INTO t1 VALUES(0xAFE0);
+INSERT INTO t1 VALUES(0xAFE1);
+INSERT INTO t1 VALUES(0xAFE2);
+INSERT INTO t1 VALUES(0xAFE3);
+INSERT INTO t1 VALUES(0xAFE4);
+INSERT INTO t1 VALUES(0xAFE5);
+INSERT INTO t1 VALUES(0xAFE6);
+INSERT INTO t1 VALUES(0xAFE7);
+INSERT INTO t1 VALUES(0xAFE8);
+INSERT INTO t1 VALUES(0xAFE9);
+INSERT INTO t1 VALUES(0xAFEA);
+INSERT INTO t1 VALUES(0xAFEB);
+INSERT INTO t1 VALUES(0xAFEC);
+INSERT INTO t1 VALUES(0xAFED);
+INSERT INTO t1 VALUES(0xAFEE);
+INSERT INTO t1 VALUES(0xAFEF);
+INSERT INTO t1 VALUES(0xAFF0);
+INSERT INTO t1 VALUES(0xAFF1);
+INSERT INTO t1 VALUES(0xAFF2);
+INSERT INTO t1 VALUES(0xAFF3);
+INSERT INTO t1 VALUES(0xAFF4);
+INSERT INTO t1 VALUES(0xAFF5);
+INSERT INTO t1 VALUES(0xAFF6);
+INSERT INTO t1 VALUES(0xAFF7);
+INSERT INTO t1 VALUES(0xAFF8);
+INSERT INTO t1 VALUES(0xAFF9);
+INSERT INTO t1 VALUES(0xAFFA);
+INSERT INTO t1 VALUES(0xAFFB);
+INSERT INTO t1 VALUES(0xAFFC);
+INSERT INTO t1 VALUES(0xAFFD);
+INSERT INTO t1 VALUES(0xAFFE);
+INSERT INTO t1 VALUES(0xCFD4);
+INSERT INTO t1 VALUES(0xCFD5);
+INSERT INTO t1 VALUES(0xCFD6);
+INSERT INTO t1 VALUES(0xCFD7);
+INSERT INTO t1 VALUES(0xCFD8);
+INSERT INTO t1 VALUES(0xCFD9);
+INSERT INTO t1 VALUES(0xCFDA);
+INSERT INTO t1 VALUES(0xCFDB);
+INSERT INTO t1 VALUES(0xCFDC);
+INSERT INTO t1 VALUES(0xCFDD);
+INSERT INTO t1 VALUES(0xCFDE);
+INSERT INTO t1 VALUES(0xCFDF);
+INSERT INTO t1 VALUES(0xCFE0);
+INSERT INTO t1 VALUES(0xCFE1);
+INSERT INTO t1 VALUES(0xCFE2);
+INSERT INTO t1 VALUES(0xCFE3);
+INSERT INTO t1 VALUES(0xCFE4);
+INSERT INTO t1 VALUES(0xCFE5);
+INSERT INTO t1 VALUES(0xCFE6);
+INSERT INTO t1 VALUES(0xCFE7);
+INSERT INTO t1 VALUES(0xCFE8);
+INSERT INTO t1 VALUES(0xCFE9);
+INSERT INTO t1 VALUES(0xCFEA);
+INSERT INTO t1 VALUES(0xCFEB);
+INSERT INTO t1 VALUES(0xCFEC);
+INSERT INTO t1 VALUES(0xCFED);
+INSERT INTO t1 VALUES(0xCFEE);
+INSERT INTO t1 VALUES(0xCFEF);
+INSERT INTO t1 VALUES(0xCFF0);
+INSERT INTO t1 VALUES(0xCFF1);
+INSERT INTO t1 VALUES(0xCFF2);
+INSERT INTO t1 VALUES(0xCFF3);
+INSERT INTO t1 VALUES(0xCFF4);
+INSERT INTO t1 VALUES(0xCFF5);
+INSERT INTO t1 VALUES(0xCFF6);
+INSERT INTO t1 VALUES(0xCFF7);
+INSERT INTO t1 VALUES(0xCFF8);
+INSERT INTO t1 VALUES(0xCFF9);
+INSERT INTO t1 VALUES(0xCFFA);
+INSERT INTO t1 VALUES(0xCFFB);
+INSERT INTO t1 VALUES(0xCFFC);
+INSERT INTO t1 VALUES(0xCFFD);
+INSERT INTO t1 VALUES(0xCFFE);
+INSERT INTO t1 VALUES(0xF4A7);
+INSERT INTO t1 VALUES(0xF4A8);
+INSERT INTO t1 VALUES(0xF4A9);
+INSERT INTO t1 VALUES(0xF4AA);
+INSERT INTO t1 VALUES(0xF4AB);
+INSERT INTO t1 VALUES(0xF4AC);
+INSERT INTO t1 VALUES(0xF4AD);
+INSERT INTO t1 VALUES(0xF4AE);
+INSERT INTO t1 VALUES(0xF4AF);
+INSERT INTO t1 VALUES(0xF4B0);
+INSERT INTO t1 VALUES(0xF4B1);
+INSERT INTO t1 VALUES(0xF4B2);
+INSERT INTO t1 VALUES(0xF4B3);
+INSERT INTO t1 VALUES(0xF4B4);
+INSERT INTO t1 VALUES(0xF4B5);
+INSERT INTO t1 VALUES(0xF4B6);
+INSERT INTO t1 VALUES(0xF4B7);
+INSERT INTO t1 VALUES(0xF4B8);
+INSERT INTO t1 VALUES(0xF4B9);
+INSERT INTO t1 VALUES(0xF4BA);
+INSERT INTO t1 VALUES(0xF4BB);
+INSERT INTO t1 VALUES(0xF4BC);
+INSERT INTO t1 VALUES(0xF4BD);
+INSERT INTO t1 VALUES(0xF4BE);
+INSERT INTO t1 VALUES(0xF4BF);
+INSERT INTO t1 VALUES(0xF4C0);
+INSERT INTO t1 VALUES(0xF4C1);
+INSERT INTO t1 VALUES(0xF4C2);
+INSERT INTO t1 VALUES(0xF4C3);
+INSERT INTO t1 VALUES(0xF4C4);
+INSERT INTO t1 VALUES(0xF4C5);
+INSERT INTO t1 VALUES(0xF4C6);
+INSERT INTO t1 VALUES(0xF4C7);
+INSERT INTO t1 VALUES(0xF4C8);
+INSERT INTO t1 VALUES(0xF4C9);
+INSERT INTO t1 VALUES(0xF4CA);
+INSERT INTO t1 VALUES(0xF4CB);
+INSERT INTO t1 VALUES(0xF4CC);
+INSERT INTO t1 VALUES(0xF4CD);
+INSERT INTO t1 VALUES(0xF4CE);
+INSERT INTO t1 VALUES(0xF4CF);
+INSERT INTO t1 VALUES(0xF4D0);
+INSERT INTO t1 VALUES(0xF4D1);
+INSERT INTO t1 VALUES(0xF4D2);
+INSERT INTO t1 VALUES(0xF4D3);
+INSERT INTO t1 VALUES(0xF4D4);
+INSERT INTO t1 VALUES(0xF4D5);
+INSERT INTO t1 VALUES(0xF4D6);
+INSERT INTO t1 VALUES(0xF4D7);
+INSERT INTO t1 VALUES(0xF4D8);
+INSERT INTO t1 VALUES(0xF4D9);
+INSERT INTO t1 VALUES(0xF4DA);
+INSERT INTO t1 VALUES(0xF4DB);
+INSERT INTO t1 VALUES(0xF4DC);
+INSERT INTO t1 VALUES(0xF4DD);
+INSERT INTO t1 VALUES(0xF4DE);
+INSERT INTO t1 VALUES(0xF4DF);
+INSERT INTO t1 VALUES(0xF4E0);
+INSERT INTO t1 VALUES(0xF4E1);
+INSERT INTO t1 VALUES(0xF4E2);
+INSERT INTO t1 VALUES(0xF4E3);
+INSERT INTO t1 VALUES(0xF4E4);
+INSERT INTO t1 VALUES(0xF4E5);
+INSERT INTO t1 VALUES(0xF4E6);
+INSERT INTO t1 VALUES(0xF4E7);
+INSERT INTO t1 VALUES(0xF4E8);
+INSERT INTO t1 VALUES(0xF4E9);
+INSERT INTO t1 VALUES(0xF4EA);
+INSERT INTO t1 VALUES(0xF4EB);
+INSERT INTO t1 VALUES(0xF4EC);
+INSERT INTO t1 VALUES(0xF4ED);
+INSERT INTO t1 VALUES(0xF4EE);
+INSERT INTO t1 VALUES(0xF4EF);
+INSERT INTO t1 VALUES(0xF4F0);
+INSERT INTO t1 VALUES(0xF4F1);
+INSERT INTO t1 VALUES(0xF4F2);
+INSERT INTO t1 VALUES(0xF4F3);
+INSERT INTO t1 VALUES(0xF4F4);
+INSERT INTO t1 VALUES(0xF4F5);
+INSERT INTO t1 VALUES(0xF4F6);
+INSERT INTO t1 VALUES(0xF4F7);
+INSERT INTO t1 VALUES(0xF4F8);
+INSERT INTO t1 VALUES(0xF4F9);
+INSERT INTO t1 VALUES(0xF4FA);
+INSERT INTO t1 VALUES(0xF4FB);
+INSERT INTO t1 VALUES(0xF4FC);
+INSERT INTO t1 VALUES(0xF4FD);
+INSERT INTO t1 VALUES(0xF4FE);
+SELECT HEX(c) FROM t1 ORDER BY BINARY c;
+DROP TABLE t1;
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index 4cf26b330c6..40bd7a912f3 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -14,7 +14,7 @@ insert delayed into t1 set a = 4;
insert delayed into t1 set a = 5, tmsp = 19711006010203;
insert delayed into t1 (a, tmsp) values (6, 19711006010203);
insert delayed into t1 (a, tmsp) values (7, NULL);
---sleep 1
+--sleep 2
insert into t1 set a = 8,tmsp=19711006010203;
select * from t1 where tmsp=0;
select * from t1 where tmsp=19711006010203;
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index d204947b1fa..928d79ab15b 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -140,7 +140,6 @@ select * from ( select * from t1 union select * from t1) a,(select * from t1 uni
explain select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
drop table t1;
-
#
# multi-update & multi-delete with derived tables
#
diff --git a/mysql-test/t/flush_block_commit.test b/mysql-test/t/flush_block_commit.test
index ac14b7b98bc..87715452089 100644
--- a/mysql-test/t/flush_block_commit.test
+++ b/mysql-test/t/flush_block_commit.test
@@ -1,6 +1,7 @@
# Let's see if FLUSH TABLES WITH READ LOCK blocks COMMIT of existing
# transactions.
# We verify that we did not introduce a deadlock.
+# This is intended to mimick how mysqldump and innobackup work.
-- source include/have_innodb.inc
@@ -63,4 +64,11 @@ unlock tables;
connection con2;
flush tables with read lock; # bug caused hang here
unlock tables;
+
+# BUG#7358 SHOW CREATE DATABASE fails if open transaction
+
+begin;
+select * from t1;
+show create database test;
+
drop table t1;
diff --git a/mysql-test/t/func_concat.test b/mysql-test/t/func_concat.test
index 0cf1502b10e..78818cdda4e 100644
--- a/mysql-test/t/func_concat.test
+++ b/mysql-test/t/func_concat.test
@@ -34,3 +34,19 @@ create table t1 (a char(4), b double, c date, d tinyint(4));
insert into t1 values ('AAAA', 105, '2003-03-01', 1);
select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051';
drop table t1;
+
+# BUG#6825
+select 'a' union select concat('a', -4);
+select 'a' union select concat('a', -4.5);
+
+select 'a' union select concat('a', -(4 + 1));
+select 'a' union select concat('a', 4 - 5);
+
+select 'a' union select concat('a', -'3');
+select 'a' union select concat('a', -concat('3',4));
+
+select 'a' union select concat('a', -0);
+select 'a' union select concat('a', -0.0);
+
+select 'a' union select concat('a', -0.0000);
+
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index d5a3e80c417..4404429cf7e 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -421,3 +421,11 @@ drop table t1;
#
select left(1234, 3) + 0;
+
+#
+# Bug #7101: bug with LEFT() when used as a field in GROUP BY aggregation
+#
+create table t1 (a int not null primary key, b varchar(40), c datetime);
+insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14');
+select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12;
+drop table t1;
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index 817249b7e4c..716dd38a119 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -118,3 +118,57 @@ CREATE TABLE t1 (
INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)'));
#select * from t1 where g<GeomFromText('LineString(1 2, 2 3)');
drop table t1;
+
+CREATE TABLE t1 (
+ geoobjid INT NOT NULL,
+ line LINESTRING NOT NULL,
+ kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
+ name VARCHAR(32),
+
+ SPATIAL KEY (line)
+
+
+) engine=myisam;
+
+ALTER TABLE t1 DISABLE KEYS;
+INSERT INTO t1 (name, kind, line) VALUES
+ ("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
+ ("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")),
+ ("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")),
+ ("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")),
+ ("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")),
+ ("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")),
+ ("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")),
+ ("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")),
+ ("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")),
+ ("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")),
+ ("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")),
+ ("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")),
+ ("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")),
+ ("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")),
+ ("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")),
+ ("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")),
+ ("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")),
+ ("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")),
+ ("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")),
+ ("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")),
+ ("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")),
+ ("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")),
+ ("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")),
+ ("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
+ ("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")),
+ ("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")),
+ ("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")),
+ ("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")),
+ ("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)"));
+
+ALTER TABLE t1 ENABLE KEYS;
+INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)'));
+drop table t1;
+
+CREATE TABLE t1 (st varchar(100));
+INSERT INTO t1 VALUES ("Fake string");
+CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
+--error 1105
+INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
+drop table t1, t2;
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index cc3d0b35ab3..c05bed4b701 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -5,6 +5,8 @@
drop table if exists t1;
--enable_warnings
+connect (master,localhost,root,,);
+connection master;
SET NAMES binary;
#
@@ -287,6 +289,78 @@ drop user grant_user@localhost;
drop table t1;
#
+# Bug#7391: Cross-database multi-table UPDATE security problem
+#
+create database mysqltest_1;
+create database mysqltest_2;
+create table mysqltest_1.t1 select 1 a, 2 q;
+create table mysqltest_1.t2 select 1 b, 2 r;
+create table mysqltest_2.t1 select 1 c, 2 s;
+create table mysqltest_2.t2 select 1 d, 2 t;
+
+#test the column privileges
+grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost;
+grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost;
+grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost;
+grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost;
+connect (conn1,localhost,mysqltest_3,,);
+connection conn1;
+show grants for mysqltest_3@localhost;
+--error 1143
+update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1;
+--error 1143
+update mysqltest_1.t2, mysqltest_2.t2 set d=20 where d=1;
+--error 1142
+update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1;
+--error 1142
+update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1;
+--error 1143
+update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2;
+#the following two should work
+update mysqltest_1.t1, mysqltest_2.t2 set a=10,d=10;
+update mysqltest_1.t1, mysqltest_2.t1 set a=20 where c=20;
+connection master;
+select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2;
+select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2;
+revoke all on mysqltest_1.t1 from mysqltest_3@localhost;
+revoke all on mysqltest_1.t2 from mysqltest_3@localhost;
+revoke all on mysqltest_2.t1 from mysqltest_3@localhost;
+revoke all on mysqltest_2.t2 from mysqltest_3@localhost;
+
+#test the db/table level privileges
+grant all on mysqltest_2.* to mysqltest_3@localhost;
+grant select on *.* to mysqltest_3@localhost;
+flush privileges;
+disconnect conn1;
+connect (conn2,localhost,mysqltest_3,,);
+connection conn2;
+use mysqltest_1;
+update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600;
+# the following failed before, should fail now.
+--error 1142
+update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200;
+use mysqltest_2;
+#the following used to succeed, it must fail now.
+--error 1142
+update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200;
+--error 1142
+update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200;
+--error 1142
+update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200;
+#lets see the result
+connection master;
+select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2;
+select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2;
+
+delete from mysql.user where user='mysqltest_3';
+delete from mysql.db where user="mysqltest_3";
+delete from mysql.tables_priv where user="mysqltest_3";
+delete from mysql.columns_priv where user="mysqltest_3";
+flush privileges;
+drop database mysqltest_1;
+drop database mysqltest_2;
+
+#
# just SHOW PRIVILEGES test
#
SHOW PRIVILEGES;
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 59983594c32..c0447b06303 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -465,3 +465,12 @@ select group_concat( distinct col1 ) as alias from t1
drop table t1;
+
+#Test for BUG#6976: Aggregate functions have incorrect NULL-ness
+create table t1 (a int);
+insert into t1 values(null);
+select min(a) is null from t1;
+select min(a) is null or null from t1;
+select 1 and min(a) is null from t1;
+drop table t1;
+
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 66315fe7a29..ac36bbd6014 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -2,6 +2,7 @@
# Test for information_schema.schemata &
# show databases
+show variables variable_name where variable_name like "skip_show_database";
grant all privileges on test.* to mysqltest_1@localhost;
select * from information_schema.SCHEMATA where schema_name > 'm';
@@ -346,3 +347,10 @@ select TABLE_ROWS from information_schema.tables where
table_schema="information_schema" and table_name="COLUMNS";
select table_type from information_schema.tables
where table_schema="mysql" and table_name="user";
+
+# test for 'show open tables ... where'
+show open tables where `table` like "user";
+# test for 'show status ... where'
+show status variable_name where variable_name like "%database%";
+# test for 'show variables ... where'
+show variables variable_name where variable_name like "%database%";
diff --git a/mysql-test/t/information_schema_inno.test b/mysql-test/t/information_schema_inno.test
index 15643ebe90c..af8bd9f98b8 100644
--- a/mysql-test/t/information_schema_inno.test
+++ b/mysql-test/t/information_schema_inno.test
@@ -1,4 +1,7 @@
-- source include/have_innodb.inc
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
#
# Test for KEY_COLUMN_USAGE & TABLE_CONSTRAINTS tables
diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test
index fc54ce88f8a..182baa641da 100644
--- a/mysql-test/t/insert_update.test
+++ b/mysql-test/t/insert_update.test
@@ -48,3 +48,34 @@ disable_info;
select * from t1;
drop table t1;
+
+# WorkLog #2274 - enable INSERT .. SELECT .. UPDATE syntax
+# Same tests as beginning of this test except that insert source
+# is a result from a select statement
+#
+CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B));
+INSERT t1 VALUES (1,2,10), (3,4,20);
+INSERT t1 SELECT 5,6,30 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100;
+SELECT * FROM t1;
+INSERT t1 SELECT 5,7,40 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100;
+SELECT * FROM t1;
+INSERT t1 SELECT 8,4,50 FROM DUAL ON DUPLICATE KEY UPDATE c=c+1000;
+SELECT * FROM t1;
+INSERT t1 SELECT 1,4,60 FROM DUAL ON DUPLICATE KEY UPDATE c=c+10000;
+SELECT * FROM t1;
+-- error 1062
+INSERT t1 SELECT 1,9,70 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100000, b=4;
+SELECT * FROM t1;
+TRUNCATE TABLE t1;
+INSERT t1 VALUES (1,2,10), (3,4,20);
+CREATE TABLE t2 (x INT, y INT, z INT, d INT);
+INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1);
+INSERT t2 VALUES (2,1,11,2), (7,4,40,2);
+INSERT t1 SELECT x,y,z FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100;
+SELECT * FROM t1;
+INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0;
+SELECT * FROM t1;
+INSERT t1 SELECT x,y,z FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
+SELECT *, VALUES(a) FROM t1;
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test
index 6dee87ec5a6..5ff26b315e2 100644
--- a/mysql-test/t/key_cache.test
+++ b/mysql-test/t/key_cache.test
@@ -71,7 +71,7 @@ show status like 'key_blocks_used';
# Following results differs on 64 and 32 bit systems because of different
# pointer sizes, which takes up different amount of space in key cache
---replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED
+--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED 1824 KEY_BLOCKS_UNUSED
show status like 'key_blocks_unused';
insert into t1 values (1, 'qqqq'), (11, 'yyyy');
@@ -84,7 +84,7 @@ update t1 set p=2 where p=1;
update t2 set i=2 where i=1;
show status like 'key_blocks_used';
---replace_result 1808 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1814 KEY_BLOCKS_UNUSED
+--replace_result 1808 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1814 KEY_BLOCKS_UNUSED 1820 KEY_BLOCKS_UNUSED
show status like 'key_blocks_unused';
cache index t1 key (`primary`) in keycache1;
@@ -146,7 +146,7 @@ cache index t1,t2 in default;
drop table t1,t2,t3;
show status like 'key_blocks_used';
---replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED
+--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED 1824 KEY_BLOCKS_UNUSED
show status like 'key_blocks_unused';
# Cleanup
diff --git a/mysql-test/t/lowercase_table.test b/mysql-test/t/lowercase_table.test
index a9c0c976afc..f6142b3ddfd 100644
--- a/mysql-test/t/lowercase_table.test
+++ b/mysql-test/t/lowercase_table.test
@@ -7,6 +7,7 @@ drop table if exists t1,t2,t3,t4;
# Clear up from other tests (to ensure that SHOW TABLES below is right)
drop table if exists t0,t5,t6,t7,t8,t9;
drop database if exists mysqltest;
+drop view if exists v0, v1, v2, v3, v4;
--enable_warnings
create table T1 (id int primary key, Word varchar(40) not null, Index(Word));
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 41d44376525..02c3aae71ef 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -287,3 +287,21 @@ create table t3 engine=merge union=(t1, t2) select * from t2;
--error 1093
create table t3 engine=merge union=(t1, t2) select (select max(a) from t2);
drop table t1, t2;
+
+# BUG#6699 : no sorting on 'ref' retrieval
+create table t1 (a int,b int,c int, index (a,b,c));
+create table t2 (a int,b int,c int, index (a,b,c));
+create table t3 (a int,b int,c int, index (a,b,c))
+ engine=merge union=(t1 ,t2);
+insert into t1 (a,b,c) values (1,1,0),(1,2,0);
+insert into t2 (a,b,c) values (1,1,1),(1,2,1);
+
+explain select a,b,c from t3 force index (a) where a=1 order by a,b,c;
+select a,b,c from t3 force index (a) where a=1 order by a,b,c;
+
+# this actually wasn't affected:
+explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc;
+select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc;
+
+drop table t1, t2, t3;
+
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index ac60eef6d05..b74b06fe191 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -5,6 +5,7 @@
--disable_warnings
drop table if exists t1,t2,t3;
drop database if exists mysqltest;
+drop view if exists v1;
--error 0,1141
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
--error 0,1141
@@ -432,6 +433,20 @@ update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1;
delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1;
drop table t1,t2;
+# Test for BUG#5837 - delete with outer join and const tables
+create table t1 (
+ aclid bigint not null primary key,
+ status tinyint(1) not null
+) engine = innodb;
+
+create table t2 (
+ refid bigint not null primary key,
+ aclid bigint, index idx_acl(aclid)
+) engine = innodb;
+insert into t2 values(1,null);
+delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1';
+drop table t1, t2;
+
#
# Test for bug #1980.
#
diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test
index 22b1a0e476d..892443a1407 100644
--- a/mysql-test/t/ndb_alter_table.test
+++ b/mysql-test/t/ndb_alter_table.test
@@ -2,6 +2,7 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
+drop database if exists mysqltest;
--enable_warnings
#
@@ -21,6 +22,22 @@ SELECT * FROM t1;
DROP TABLE t1;
#
+# Verfify changing table names between databases
+#
+CREATE DATABASE mysqltest;
+USE mysqltest;
+CREATE TABLE t1 (
+ a INT NOT NULL,
+ b INT NOT NULL
+) ENGINE=ndbcluster;
+RENAME TABLE t1 TO test.t1;
+SHOW TABLES;
+DROP DATABASE mysqltest;
+USE test;
+SHOW TABLES;
+DROP TABLE t1;
+
+#
# More advanced test
#
create table t1 (
diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test
new file mode 100644
index 00000000000..3b0e84e2344
--- /dev/null
+++ b/mysql-test/t/ndb_update.test
@@ -0,0 +1,22 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+#
+# Basic test of INSERT in NDB
+#
+
+#
+# Create a normal table with primary key
+#
+CREATE TABLE t1 (
+ pk1 INT NOT NULL PRIMARY KEY,
+ b INT NOT NULL,
+ c INT NOT NULL
+) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES (0, 0, 1),(1,1,2),(2,2,3);
+UPDATE t1 set b = c;
+select * from t1 order by pk1;
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 157b125a13d..7f65a7b04da 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -472,6 +472,19 @@ set @var=null;
select @var is null, @var is not null, @var;
execute stmt using @var, @var, @var;
+#
+# Bug#6873 "PS, having with subquery, crash during execute"
+# check that if we modify having subtree, we update JOIN->having pointer
+#
+create table t1 (pnum char(3));
+create table t2 (pnum char(3));
+prepare stmt from "select pnum from t2 having pnum in (select 'p1' from t1)";
+execute stmt;
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+drop table t1, t2;
+
#
# Bug#6102 "Server crash with prepared statement and blank after
# function name"
diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test
index f1d8d3f7386..d46a88b9166 100644
--- a/mysql-test/t/ps_1general.test
+++ b/mysql-test/t/ps_1general.test
@@ -11,6 +11,10 @@
--disable_warnings
drop table if exists t5, t6, t7, t8;
drop database if exists mysqltest ;
+# Cleanup from other tests
+drop database if exists testtets;
+drop table if exists t1Aa,t2Aa,v1Aa,v2Aa;
+drop view if exists t1Aa,t2Aa,v1Aa,v2Aa;
--enable_warnings
--disable_query_log
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index ed89184a0bc..26f939582e5 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -686,3 +686,14 @@ show status like "Qcache_hits";
#
DROP TABLE t1;
SET GLOBAL query_cache_size=0;
+
+#
+# Information schema & query cache test
+#
+SET SESSION query_cache_type = 2;
+create table t1(a int);
+select table_name from information_schema.tables
+where table_schema="test";
+drop table t1;
+select table_name from information_schema.tables
+where table_schema="test";
diff --git a/mysql-test/t/rpl_insert_ignore-slave.opt b/mysql-test/t/rpl_insert_ignore-slave.opt
new file mode 100644
index 00000000000..627becdbfb5
--- /dev/null
+++ b/mysql-test/t/rpl_insert_ignore-slave.opt
@@ -0,0 +1 @@
+--innodb
diff --git a/mysql-test/t/rpl_insert_ignore.test b/mysql-test/t/rpl_insert_ignore.test
new file mode 100644
index 00000000000..58eaa287817
--- /dev/null
+++ b/mysql-test/t/rpl_insert_ignore.test
@@ -0,0 +1,71 @@
+# Testcase for BUG#6287 "Slave skips auto_increment values in Replication with InnoDB"
+# The bug was that if on master, INSERT IGNORE ignored some
+# rows, and the table was InnoDB with auto_inc column, then on slave
+# some rows received an auto_inc bigger than on master.
+# Slave needs to be started with --innodb to store table in InnoDB.
+# Same test for MyISAM (which had no bug).
+
+-- source include/have_innodb.inc
+
+-- source include/master-slave.inc
+
+CREATE TABLE t1 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned,
+ unique (b)
+) ENGINE=innodb;
+
+CREATE TABLE t2 (
+ a int unsigned, # to force INSERT SELECT to have a certain order
+ b int unsigned
+) ENGINE=innodb;
+
+
+INSERT INTO t1 VALUES (NULL, 1);
+INSERT INTO t1 VALUES (NULL, 2);
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t1 VALUES (NULL, 4);
+
+# An alternation of values which will conflict in t1 and will not.
+
+INSERT INTO t2 VALUES (1, 1);
+INSERT INTO t2 VALUES (2, 2);
+INSERT INTO t2 VALUES (3, 5);
+INSERT INTO t2 VALUES (4, 3);
+INSERT INTO t2 VALUES (5, 4);
+INSERT INTO t2 VALUES (6, 6);
+
+INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
+
+# Compare results
+
+SELECT * FROM t1 ORDER BY a;
+
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY a;
+
+# Now do the same for MyISAM
+
+connection master;
+drop table t1;
+CREATE TABLE t1 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned,
+ unique (b)
+) ENGINE=myisam;
+
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (3, 3);
+INSERT INTO t1 VALUES (4, 4);
+
+INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
+
+SELECT * FROM t1 ORDER BY a;
+
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY a;
+
+connection master;
+drop table t1, t2;
+sync_slave_with_master;
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 566f9f625df..9646de56832 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -251,7 +251,7 @@ show table status;
delete from t1 where a=3;
delete from t2 where b=3;
delete from t3 where a=3;
---replace_column 6 # 7 # 8 # 9 #
+--replace_column 6 # 7 # 8 # 9 # 10 #
show table status;
delete from t1;
delete from t2;
@@ -266,7 +266,7 @@ show table status;
delete from t1 where a=5;
delete from t2 where b=5;
delete from t3 where a=5;
---replace_column 6 # 7 # 8 # 9 #
+--replace_column 6 # 7 # 8 # 9 # 10 #
show table status;
drop table t1, t2, t3;
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index ec1fb3e7452..5261267b58e 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -8,36 +8,15 @@
use test;
--disable_warnings
-drop table if exists t1,t2,t3,t4;
-drop procedure if exists goto1;
-drop procedure if exists goto2;
-drop procedure if exists goto3;
-drop procedure if exists goto4;
-drop procedure if exists goto5;
-drop procedure if exists goto6;
-drop procedure if exists into_outfile;
-drop procedure if exists into_dumpfile;
-drop procedure if exists create_select;
-drop procedure if exists bar;
-drop procedure if exists hndlr1;
-drop procedure if exists hndlr2;
-drop procedure if exists hndlr3;
-drop procedure if exists hndlr4;
-drop procedure if exists cur1;
-drop procedure if exists cur2;
-drop procedure if exists chistics;
-drop procedure if exists chistics2;
-drop procedure if exists modes;
-drop procedure if exists dummy;
-drop procedure if exists bug;
-drop procedure if exists bug2;
-drop function if exists fac;
+drop table if exists t1;
--enable_warnings
-
create table t1 (
id char(16) not null,
data int not null
);
+--disable_warnings
+drop table if exists t2;
+--enable_warnings
create table t2 (
s char(16),
i int,
@@ -46,6 +25,9 @@ create table t2 (
# Single statement, no params.
+--disable_warnings
+drop procedure if exists foo42;
+--enable_warnings
create procedure foo42()
insert into test.t1 values ("foo", 42);
@@ -56,6 +38,9 @@ drop procedure foo42;
# Single statement, two IN params.
+--disable_warnings
+drop procedure if exists bar;
+--enable_warnings
create procedure bar(x char(16), y int)
insert into test.t1 values (x, y);
@@ -69,6 +54,9 @@ delete from t1;
delimiter |;
# Empty statement
+--disable_warnings
+drop procedure if exists empty|
+--enable_warnings
create procedure empty()
begin
end|
@@ -78,6 +66,9 @@ drop procedure empty|
# Scope test. This is legal (warnings might be possible in the future,
# but for the time being, we just accept it).
+--disable_warnings
+drop procedure if exists scope|
+--enable_warnings
create procedure scope(a int, b float)
begin
declare b int;
@@ -91,6 +82,9 @@ end|
drop procedure scope|
# Two statements.
+--disable_warnings
+drop procedure if exists two|
+--enable_warnings
create procedure two(x1 char(16), x2 char(16), y int)
begin
insert into test.t1 values (x1, y);
@@ -104,6 +98,9 @@ drop procedure two|
# Simple test of local variables and SET.
+--disable_warnings
+drop procedure if exists locset|
+--enable_warnings
create procedure locset(x char(16), y int)
begin
declare z1, z2 int;
@@ -120,6 +117,9 @@ drop procedure locset|
# In some contexts local variables are not recognized
# (and in some, you have to qualify the identifier).
+--disable_warnings
+drop procedure if exists setcontext|
+--enable_warnings
create procedure setcontext()
begin
declare data int default 2;
@@ -136,8 +136,14 @@ drop procedure setcontext|
# Set things to null
+--disable_warnings
+drop table if exists t3|
+--enable_warnings
create table t3 ( d date, i int, f double, s varchar(32) )|
+--disable_warnings
+drop procedure if exists nullset|
+--enable_warnings
create procedure nullset()
begin
declare ld date;
@@ -163,6 +169,9 @@ drop procedure nullset|
# The peculiar (non-standard) mixture of variables types in SET.
+--disable_warnings
+drop procedure if exists mixset|
+--enable_warnings
create procedure mixset(x char(16), y int)
begin
declare z int;
@@ -179,6 +188,9 @@ drop procedure mixset|
# Multiple CALL statements, one with OUT parameter.
+--disable_warnings
+drop procedure if exists zip|
+--enable_warnings
create procedure zip(x char(16), y int)
begin
declare z int;
@@ -187,6 +199,9 @@ begin
end|
# SET local variables and OUT parameter.
+--disable_warnings
+drop procedure if exists zap|
+--enable_warnings
create procedure zap(x int, out y int)
begin
declare z int;
@@ -207,12 +222,24 @@ drop procedure zap|
# "Deep" calls...
+--disable_warnings
+drop procedure if exists c1|
+--enable_warnings
create procedure c1(x int)
call c2("c", x)|
+--disable_warnings
+drop procedure if exists c2|
+--enable_warnings
create procedure c2(s char(16), x int)
call c3(x, s)|
+--disable_warnings
+drop procedure if exists c3|
+--enable_warnings
create procedure c3(x int, s char(16))
call c4("level", x, s)|
+--disable_warnings
+drop procedure if exists c4|
+--enable_warnings
create procedure c4(l char(8), x int, s char(16))
insert into t1 values (concat(l,s), x)|
@@ -225,18 +252,27 @@ drop procedure c3|
drop procedure c4|
# INOUT test
+--disable_warnings
+drop procedure if exists iotest|
+--enable_warnings
create procedure iotest(x1 char(16), x2 char(16), y int)
begin
call inc2(x2, y);
insert into test.t1 values (x1, y);
end|
+--disable_warnings
+drop procedure if exists inc2|
+--enable_warnings
create procedure inc2(x char(16), y int)
begin
call inc(y);
insert into test.t1 values (x, y);
end|
+--disable_warnings
+drop procedure if exists inc|
+--enable_warnings
create procedure inc(inout io int)
set io = io + 1|
@@ -247,6 +283,9 @@ drop procedure iotest|
drop procedure inc2|
# Propagating top-level @-vars
+--disable_warnings
+drop procedure if exists incr|
+--enable_warnings
create procedure incr(inout x int)
call inc(x)|
@@ -263,6 +302,9 @@ drop procedure incr|
# The expected result is:
# ("cbv2", 4)
# ("cbv1", 4711)
+--disable_warnings
+drop procedure if exists cbv1|
+--enable_warnings
create procedure cbv1()
begin
declare y int default 3;
@@ -271,6 +313,9 @@ begin
insert into test.t1 values ("cbv1", y);
end|
+--disable_warnings
+drop procedure if exists cbv2|
+--enable_warnings
create procedure cbv2(y1 int, inout y2 int)
begin
set y2 = 4711;
@@ -288,10 +333,16 @@ drop procedure cbv2|
insert into t2 values ("a", 1, 1.1), ("b", 2, 1.2), ("c", 3, 1.3)|
+--disable_warnings
+drop procedure if exists sub1|
+--enable_warnings
create procedure sub1(id char(16), x int)
insert into test.t1 values (id, x)|
# QQ This doesn't work yet
+#--disable_warnings
+#drop procedure if exists sub2|
+#--enable_warnings
#create procedure sub2(id char(16))
#begin
# declare x int;
@@ -299,6 +350,9 @@ create procedure sub1(id char(16), x int)
# insert into test.t1 values (id, x);
#end|
+--disable_warnings
+drop procedure if exists sub3|
+--enable_warnings
create function sub3(i int) returns int
return i+1|
@@ -317,6 +371,9 @@ delete from t2|
# Basic tests of the flow control constructs
# Just test on 'x'...
+--disable_warnings
+drop procedure if exists a0|
+--enable_warnings
create procedure a0(x int)
while x do
set x = x-1;
@@ -330,6 +387,9 @@ drop procedure a0|
# The same, but with a more traditional test.
+--disable_warnings
+drop procedure if exists a|
+--enable_warnings
create procedure a(x int)
while x > 0 do
set x = x-1;
@@ -343,6 +403,9 @@ drop procedure a|
# REPEAT
+--disable_warnings
+drop procedure if exists b|
+--enable_warnings
create procedure b(x int)
repeat
insert into test.t1 values (repeat("b",3), x);
@@ -356,6 +419,9 @@ drop procedure b|
# Check that repeat isn't parsed the wrong way
+--disable_warnings
+drop procedure if exists b2|
+--enable_warnings
create procedure b2(x int)
repeat(select 1 into outfile 'b2');
insert into test.t1 values (repeat("b2",3), x);
@@ -367,6 +433,9 @@ drop procedure b2|
# Labelled WHILE with ITERATE (pointless really)
+--disable_warnings
+drop procedure if exists c|
+--enable_warnings
create procedure c(x int)
hmm: while x > 0 do
insert into test.t1 values ("c", x);
@@ -382,6 +451,9 @@ drop procedure c|
# Labelled WHILE with LEAVE
+--disable_warnings
+drop procedure if exists d|
+--enable_warnings
create procedure d(x int)
hmm: while x > 0 do
insert into test.t1 values ("d", x);
@@ -397,6 +469,9 @@ drop procedure d|
# LOOP, with simple IF statement
+--disable_warnings
+drop procedure if exists e|
+--enable_warnings
create procedure e(x int)
foo: loop
if x = 0 then
@@ -413,6 +488,9 @@ drop procedure e|
# A full IF statement
+--disable_warnings
+drop procedure if exists f|
+--enable_warnings
create procedure f(x int)
if x < 0 then
insert into test.t1 values ("f", 0);
@@ -431,6 +509,9 @@ drop procedure f|
# This form of CASE is really just syntactic sugar for IF-ELSEIF-...
+--disable_warnings
+drop procedure if exists g|
+--enable_warnings
create procedure g(x int)
case
when x < 0 then
@@ -450,6 +531,9 @@ drop procedure g|
# The "simple CASE"
+--disable_warnings
+drop procedure if exists h|
+--enable_warnings
create procedure h(x int)
case x
when 0 then
@@ -469,6 +553,9 @@ drop procedure h|
# It's actually possible to LEAVE a BEGIN-END block
+--disable_warnings
+drop procedure if exists i|
+--enable_warnings
create procedure i(x int)
foo:
begin
@@ -490,6 +577,9 @@ drop procedure i|
# QQQ The "label" syntax is temporary, it will (hopefully)
# change to the more common "L:" syntax soon.
#
+--disable_warnings
+drop procedure if exists goto1|
+--enable_warnings
create procedure goto1()
begin
declare y int;
@@ -509,6 +599,9 @@ call goto1()|
drop procedure goto1|
# With dummy handlers, just to test restore of contexts with jumps
+--disable_warnings
+drop procedure if exists goto2|
+--enable_warnings
create procedure goto2(a int)
begin
declare x int default 0;
@@ -544,6 +637,9 @@ drop procedure goto2|
delete from t1|
# Check label visibility for some more cases. We don't call these.
+--disable_warnings
+drop procedure if exists goto3|
+--enable_warnings
create procedure goto3()
begin
label L1;
@@ -553,6 +649,9 @@ begin
end|
drop procedure goto3|
+--disable_warnings
+drop procedure if exists goto4|
+--enable_warnings
create procedure goto4()
begin
begin
@@ -564,6 +663,9 @@ begin
end|
drop procedure goto4|
+--disable_warnings
+drop procedure if exists goto5|
+--enable_warnings
create procedure goto5()
begin
begin
@@ -575,6 +677,9 @@ begin
end|
drop procedure goto5|
+--disable_warnings
+drop procedure if exists goto6|
+--enable_warnings
create procedure goto6()
begin
label L1;
@@ -604,6 +709,9 @@ drop procedure goto6|
insert into t1 values ("foo", 3), ("bar", 19)|
insert into t2 values ("x", 9, 4.1), ("y", -1, 19.2), ("z", 3, 2.2)|
+--disable_warnings
+drop procedure if exists sel1|
+--enable_warnings
create procedure sel1()
begin
select * from t1;
@@ -612,6 +720,9 @@ end|
call sel1()|
drop procedure sel1|
+--disable_warnings
+drop procedure if exists sel2|
+--enable_warnings
create procedure sel2()
begin
select * from t1;
@@ -624,6 +735,9 @@ delete from t1|
delete from t2|
# SELECT INTO local variables
+--disable_warnings
+drop procedure if exists into_test|
+--enable_warnings
create procedure into_test(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -638,6 +752,9 @@ drop procedure into_test|
# SELECT INTO with a mix of local and global variables
+--disable_warnings
+drop procedure if exists into_tes2|
+--enable_warnings
create procedure into_test2(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -652,6 +769,9 @@ drop procedure into_test2|
# SELECT * INTO ... (bug test)
+--disable_warnings
+drop procedure if exists into_test3|
+--enable_warnings
create procedure into_test3()
begin
declare x char(16);
@@ -673,6 +793,9 @@ drop procedure into_test3|
# SELECT INTO with no data is a warning ("no data", which we will
# not see normally). When not caught, execution proceeds.
+--disable_warnings
+drop procedure if exists into_test4|
+--enable_warnings
create procedure into_test4()
begin
declare x int;
@@ -698,7 +821,9 @@ drop procedure into_test4|
# These two (and the two procedures above) caused an assert() to fail in
# sql_base.cc:lock_tables() at some point.
-
+--disable_warnings
+drop procedure if exists into_outfile|
+--enable_warnings
create procedure into_outfile(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -712,6 +837,9 @@ system rm -f /tmp/spout|
delete from t1|
drop procedure into_outfile|
+--disable_warnings
+drop procedure if exists into_dumpfile|
+--enable_warnings
create procedure into_dumpfile(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -725,7 +853,9 @@ system rm -f /tmp/spdump|
delete from t1|
drop procedure into_dumpfile|
-
+--disable_warnings
+drop procedure if exists create_select|
+--enable_warnings
create procedure create_select(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -746,6 +876,9 @@ drop procedure create_select|
# A minimal, constant FUNCTION.
+--disable_warnings
+drop function if exists e|
+--enable_warnings
create function e() returns double
return 2.7182818284590452354|
@@ -753,24 +886,36 @@ set @e = e()|
select e(), @e|
# A minimal function with one argument
+--disable_warnings
+drop function if exists inc|
+--enable_warnings
create function inc(i int) returns int
return i+1|
select inc(1), inc(99), inc(-71)|
# A minimal function with two arguments
+--disable_warnings
+drop function if exists mul|
+--enable_warnings
create function mul(x int, y int) returns int
return x*y|
select mul(1,1), mul(3,5), mul(4711, 666)|
# A minimal string function
+--disable_warnings
+drop function if exists append|
+--enable_warnings
create function append(s1 char(8), s2 char(8)) returns char(16)
return concat(s1, s2)|
select append("foo", "bar")|
# A function with flow control
+--disable_warnings
+drop function if exists fac|
+--enable_warnings
create function fac(n int unsigned) returns bigint unsigned
begin
declare f bigint unsigned default 1;
@@ -785,6 +930,9 @@ end|
select fac(1), fac(2), fac(5), fac(10)|
# Nested calls
+--disable_warnings
+drop function if exists fun|
+--enable_warnings
create function fun(d double, i int, u int unsigned) returns double
return mul(inc(i), fac(u)) / e()|
@@ -814,6 +962,9 @@ drop function fun|
# CONDITIONs and HANDLERs
#
+--disable_warnings
+drop procedure if exists hndlr1|
+--enable_warnings
create procedure hndlr1(val int)
begin
declare x int default 0;
@@ -833,6 +984,9 @@ select * from t1|
delete from t1|
drop procedure hndlr1|
+--disable_warnings
+drop procedure if exists hndlr2|
+--enable_warnings
create procedure hndlr2(val int)
begin
declare x int default 0;
@@ -852,6 +1006,9 @@ delete from t1|
drop procedure hndlr2|
+--disable_warnings
+drop procedure if exists hndlr3|
+--enable_warnings
create procedure hndlr3(val int)
begin
declare x int default 0;
@@ -890,6 +1047,9 @@ drop table if exists t3|
--enable_warnings
create table t3 ( id char(16), data int )|
+--disable_warnings
+drop procedure if exists hndlr4|
+--enable_warnings
create procedure hndlr4()
begin
declare x int default 0;
@@ -910,6 +1070,9 @@ drop procedure hndlr4|
#
# Cursors
#
+--disable_warnings
+drop procedure if exists cur1|
+--enable_warnings
create procedure cur1()
begin
declare a char(16);
@@ -939,6 +1102,9 @@ drop table if exists t3|
--enable_warnings
create table t3 ( s char(16), i int )|
+--disable_warnings
+drop procedure if exists cur2|
+--enable_warnings
create procedure cur2()
begin
declare done int default 0;
@@ -977,6 +1143,9 @@ drop procedure cur2|
# The few characteristics we parse
+--disable_warnings
+drop procedure if exists chistics|
+--enable_warnings
create procedure chistics()
language sql
modifies sql data
@@ -994,6 +1163,9 @@ alter procedure chistics sql security invoker|
show create procedure chistics|
drop procedure chistics|
+--disable_warnings
+drop function if exists chistics|
+--enable_warnings
create function chistics() returns int
language sql
deterministic
@@ -1016,6 +1188,9 @@ insert into t1 values ("foo", 1), ("bar", 2), ("zip", 3)|
set @@sql_mode = 'ANSI'|
delimiter $|
+--disable_warnings
+drop procedure if exists modes$
+--enable_warnings
create procedure modes(out c1 int, out c2 int)
begin
declare done int default 0;
@@ -1064,6 +1239,9 @@ drop database sp_db2|
# And yet again, with just a procedure.
create database sp_db3|
use sp_db3|
+--disable_warnings
+drop procedure if exists dummy|
+--enable_warnings
create procedure dummy(out x int)
set x = 42|
use test|
@@ -1074,6 +1252,9 @@ select type,db,name from mysql.proc where db = 'sp_db3'|
# ROW_COUNT() function after a CALL
# We test the other cases here too, although it's not strictly SP specific
+--disable_warnings
+drop procedure if exists rc|
+--enable_warnings
create procedure rc()
begin
delete from t1;
@@ -1100,7 +1281,10 @@ drop procedure rc|
#
# BUG#822
#
-create procedure bug(a_id char(16), a_data int)
+--disable_warnings
+drop procedure if exists bug822|
+--enable_warnings
+create procedure bug822(a_id char(16), a_data int)
begin
declare n int;
select count(*) into n from t1 where id = a_id and data = a_data;
@@ -1109,17 +1293,20 @@ begin
end if;
end|
-call bug('foo', 42)|
-call bug('foo', 42)|
-call bug('bar', 666)|
+call bug822('foo', 42)|
+call bug822('foo', 42)|
+call bug822('bar', 666)|
select * from t1|
delete from t1|
-drop procedure bug|
+drop procedure bug822|
#
# BUG#1495
#
-create procedure bug()
+--disable_warnings
+drop procedure if exists bug1495|
+--enable_warnings
+create procedure bug1495()
begin
declare x int;
@@ -1132,19 +1319,22 @@ begin
end|
insert into t1 values ('foo', 12)|
-call bug()|
+call bug1495()|
delete from t1 where id='foo'|
insert into t1 values ('bar', 7)|
-call bug()|
+call bug1495()|
delete from t1 where id='bar'|
select * from t1|
delete from t1|
-drop procedure bug|
+drop procedure bug1495|
#
# BUG#1547
#
-create procedure bug(s char(16))
+--disable_warnings
+drop procedure if exists bug1547|
+--enable_warnings
+create procedure bug1547(s char(16))
begin
declare x int;
@@ -1157,11 +1347,11 @@ begin
end|
insert into t1 values ("foo", 12), ("bar", 7)|
-call bug("foo")|
-call bug("bar")|
+call bug1547("foo")|
+call bug1547("bar")|
select * from t1|
delete from t1|
-drop procedure bug|
+drop procedure bug1547|
#
# BUG#1656
@@ -1172,13 +1362,16 @@ drop table if exists t70|
create table t70 (s1 int,s2 int)|
insert into t70 values (1,2)|
-create procedure bug(out p1 int, out p2 int)
+--disable_warnings
+drop procedure if exists bug1656|
+--enable_warnings
+create procedure bug1656(out p1 int, out p2 int)
select * into p1, p1 from t70|
-call bug(@1, @2)|
+call bug1656(@1, @2)|
select @1, @2|
drop table t70|
-drop procedure bug|
+drop procedure bug1656|
#
# BUG#1862
@@ -1188,23 +1381,29 @@ drop table if exists t3|
--enable_warnings
create table t3(a int)|
-create procedure bug()
+--disable_warnings
+drop procedure if exists bug1862|
+--enable_warnings
+create procedure bug1862()
begin
insert into t3 values(2);
flush tables;
end|
-call bug()|
+call bug1862()|
# the second call caused a segmentation
-call bug()|
+call bug1862()|
select * from t3|
drop table t3|
-drop procedure bug|
+drop procedure bug1862|
#
# BUG#1874
#
-create procedure bug()
+--disable_warnings
+drop procedure if exists bug1874|
+--enable_warnings
+create procedure bug1874()
begin
declare x int;
declare y double;
@@ -1219,16 +1418,19 @@ begin
end|
insert into t1 (data) values (3), (1), (5), (9), (4)|
-call bug()|
+call bug1874()|
select * from t2|
delete from t1|
delete from t2|
-drop procedure bug|
+drop procedure bug1874|
#
# BUG#2260
#
-create procedure bug()
+--disable_warnings
+drop procedure if exists bug2260|
+--enable_warnings
+create procedure bug2260()
begin
declare v1 int;
declare c1 cursor for select data from t1;
@@ -1240,28 +1442,40 @@ begin
close c1;
end|
-call bug()|
+call bug2260()|
select @x2|
-drop procedure bug|
+drop procedure bug2260|
#
# BUG#2267
#
+--disable_warnings
+drop procedure if exists bug2267_1|
+--enable_warnings
create procedure bug2267_1()
begin
show procedure status;
end|
+--disable_warnings
+drop procedure if exists bug2267_2|
+--enable_warnings
create procedure bug2267_2()
begin
show function status;
end|
+--disable_warnings
+drop procedure if exists bug2267_3|
+--enable_warnings
create procedure bug2267_3()
begin
show create procedure bug2267_1;
end|
+--disable_warnings
+drop procedure if exists bug2267_4|
+--enable_warnings
create procedure bug2267_4()
begin
show create function fac;
@@ -1282,7 +1496,10 @@ drop procedure bug2267_4|
#
# BUG#2227
#
-create procedure bug(x int)
+--disable_warnings
+drop procedure if exists bug2227|
+--enable_warnings
+create procedure bug2227(x int)
begin
declare y float default 2.6;
declare z char(16) default "zzz";
@@ -1290,13 +1507,16 @@ begin
select 1.3, x, y, 42, z;
end|
-call bug(9)|
-drop procedure bug|
+call bug2227(9)|
+drop procedure bug2227|
#
# BUG#2614
#
-create procedure bug()
+--disable_warnings
+drop procedure if exists bug2614|
+--enable_warnings
+create procedure bug2614()
begin
drop table if exists t3;
create table t3 (id int default '0' not null);
@@ -1305,29 +1525,41 @@ begin
end|
--disable_warnings
-call bug()|
+call bug2614()|
--enable_warnings
-call bug()|
+call bug2614()|
drop table t3|
-drop procedure bug|
+drop procedure bug2614|
#
# BUG#2674
#
-create function bug () returns int
+--disable_warnings
+drop function if exists bug2674|
+--enable_warnings
+create function bug2674() returns int
return @@sort_buffer_size|
set @osbs = @@sort_buffer_size|
set @@sort_buffer_size = 262000|
-select bug()|
-drop function bug|
+select bug2674()|
+drop function bug2674|
set @@sort_buffer_size = @osbs|
#
# BUG#3259
#
+--disable_warnings
+drop procedure if exists bug3259_1 |
+--enable_warnings
create procedure bug3259_1 () begin end|
+--disable_warnings
+drop procedure if exists BUG3259_2 |
+--enable_warnings
create procedure BUG3259_2 () begin end|
+--disable_warnings
+drop procedure if exists Bug3259_3 |
+--enable_warnings
create procedure Bug3259_3 () begin end|
call BUG3259_1()|
@@ -1342,18 +1574,24 @@ drop procedure BuG3259_2|
drop procedure BUG3259_3|
#
-# BUG##2772
+# BUG#2772
#
-create function bug() returns char(10) character set latin2
+--disable_warnings
+drop function if exists bug2772|
+--enable_warnings
+create function bug2772() returns char(10) character set latin2
return 'a'|
-select bug()|
-drop function bug|
+select bug2772()|
+drop function bug2772|
#
# BUG#2776
#
-create procedure bug(out x int)
+--disable_warnings
+drop procedure if exists bug2776_1|
+--enable_warnings
+create procedure bug2776_1(out x int)
begin
declare v int;
@@ -1361,7 +1599,10 @@ begin
set x = v;
end|
-create procedure bug2(out x int)
+--disable_warnings
+drop procedure if exists bug2776_2|
+--enable_warnings
+create procedure bug2776_2(out x int)
begin
declare v int default 42;
@@ -1370,12 +1611,12 @@ begin
end|
set @x = 1|
-call bug(@x)|
+call bug2776_1(@x)|
select @x|
-call bug2(@x)|
+call bug2776_2(@x)|
select @x|
-drop procedure bug|
-drop procedure bug2|
+drop procedure bug2776_1|
+drop procedure bug2776_2|
#
# BUG#2780
@@ -1387,7 +1628,10 @@ create table t3 (s1 smallint)|
insert into t3 values (123456789012)|
-create procedure bug()
+--disable_warnings
+drop procedure if exists bug2780|
+--enable_warnings
+create procedure bug2780()
begin
declare exit handler for sqlwarning set @x = 1;
@@ -1396,11 +1640,11 @@ begin
insert into t3 values (0);
end|
-call bug()|
+call bug2780()|
select @x|
select * from t3|
-drop procedure bug|
+drop procedure bug2780|
drop table t3|
#
@@ -1411,6 +1655,9 @@ insert into t3 values ("test1")|
insert into t3 values ("test2")|
create table t4 (f1 int, rc int, t3 int)|
+--disable_warnings
+drop procedure if exists bug1863|
+--enable_warnings
create procedure bug1863(in1 int)
begin
@@ -1471,6 +1718,9 @@ insert t3 (OrderID,MarketID) values (2,2)|
insert t4 (MarketID,Market,Status) values (1,"MarketID One","A")|
insert t4 (MarketID,Market,Status) values (2,"MarketID Two","A")|
+--disable_warnings
+drop procedure if exists bug2656_1|
+--enable_warnings
create procedure bug2656_1()
begin
select
@@ -1479,6 +1729,9 @@ begin
ON o.MarketID != 1 and o.MarketID = m.MarketID;
end |
+--disable_warnings
+drop procedure if exists bug2656_2|
+--enable_warnings
create procedure bug2656_2()
begin
select
@@ -1502,6 +1755,9 @@ drop table t3, t4|
#
# BUG#3426
#
+--disable_warnings
+drop procedure if exists bug3426|
+--enable_warnings
create procedure bug3426(in_time int unsigned, out x int)
begin
if in_time is null then
@@ -1546,6 +1802,9 @@ create table t4 (
insert into t3 values (1 , 'aCh1' ) , ('2' , 'aCh2')|
insert into t4 values (1 , 'bCh1' )|
+--disable_warnings
+drop procedure if exists bug3448|
+--enable_warnings
create procedure bug3448()
select * from t3 inner join t4 on t3.a = t4.b|
@@ -1578,6 +1837,9 @@ insert into t3 (title,body) values
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...')|
+--disable_warnings
+drop procedure if exists bug3734 |
+--enable_warnings
create procedure bug3734 (param1 varchar(100))
select * from t3 where match (title,body) against (param1)|
@@ -1590,6 +1852,9 @@ drop table t3|
#
# BUG#3863
#
+--disable_warnings
+drop procedure if exists bug3863|
+--enable_warnings
create procedure bug3863()
begin
set @a = 0;
@@ -1617,6 +1882,9 @@ create table t3 (
unique key rid (rid, id)
)|
+--disable_warnings
+drop procedure if exists bug2460_1|
+--enable_warnings
create procedure bug2460_1(in v int)
begin
( select n0.id from t3 as n0 where n0.id = v )
@@ -1634,6 +1902,9 @@ insert into t3 values (1, 1, 'foo'), (2, 1, 'bar'), (3, 1, 'zip zap')|
call bug2460_1(2)|
call bug2460_1(2)|
+--disable_warnings
+drop procedure if exists bug2460_2|
+--enable_warnings
create procedure bug2460_2()
begin
drop table if exists t3;
@@ -1654,20 +1925,32 @@ drop table t3|
# BUG#2564
#
set @@sql_mode = ''|
+--disable_warnings
+drop procedure if exists bug2564_1|
+--enable_warnings
create procedure bug2564_1()
comment 'Joe''s procedure'
insert into `t1` values ("foo", 1)|
set @@sql_mode = 'ANSI_QUOTES'|
+--disable_warnings
+drop procedure if exists bug2564_2|
+--enable_warnings
create procedure bug2564_2()
insert into "t1" values ('foo', 1)|
delimiter $|
set @@sql_mode = ''$
+--disable_warnings
+drop function if exists bug2564_3$
+--enable_warnings
create function bug2564_3(x int, y int) returns int
return x || y$
set @@sql_mode = 'ANSI'$
+--disable_warnings
+drop function if exists bug2564_4$
+--enable_warnings
create function bug2564_4(x int, y int) returns int
return x || y$
delimiter |$
@@ -1686,6 +1969,9 @@ drop function bug2564_4|
#
# BUG#3132
#
+--disable_warnings
+drop function if exists bug3132|
+--enable_warnings
create function bug3132(s char(20)) returns char(50)
return concat('Hello, ', s, '!')|
@@ -1695,6 +1981,9 @@ drop function bug3132|
#
# BUG#3843
#
+--disable_warnings
+drop procedure if exists bug3843|
+--enable_warnings
create procedure bug3843()
analyze table t1|
@@ -1714,6 +2003,9 @@ drop table if exists t3|
create table t3 ( s1 char(10) )|
insert into t3 values ('a'), ('b')|
+--disable_warnings
+drop procedure if exists bug3368|
+--enable_warnings
create procedure bug3368(v char(10))
begin
select group_concat(v) from t3;
@@ -1733,6 +2025,9 @@ drop table if exists t3|
create table t3 (f1 int, f2 int);
insert into t3 values (1,1);
+--disable_warnings
+drop procedure if exists bug4579_1|
+--enable_warnings
create procedure bug4579_1 ()
begin
declare sf1 int;
@@ -1742,6 +2037,9 @@ begin
call bug4579_2();
end|
+--disable_warnings
+drop procedure if exists bug4579_2|
+--enable_warnings
create procedure bug4579_2 ()
begin
end|
@@ -1765,6 +2063,9 @@ drop table if exists t3|
create table t3 (f1 int, f2 int, f3 int)|
insert into t3 values (1,1,1)|
+--disable_warnings
+drop procedure if exists bug4726|
+--enable_warnings
create procedure bug4726()
begin
declare tmp_o_id INT;
@@ -1795,6 +2096,9 @@ drop table if exists t3|
create table t3 (s1 int)|
insert into t3 values (3), (4)|
+--disable_warnings
+drop procedure if exists bug4318|
+--enable_warnings
create procedure bug4318()
handler t3 read next|
@@ -1818,6 +2122,9 @@ drop table t3|
# It's possible that some of these are not deterministic across
# platforms. If so, just remove the offending command.
#
+--disable_warnings
+drop procedure if exists bug4902|
+--enable_warnings
create procedure bug4902()
begin
show charset like 'foo';
@@ -1849,6 +2156,9 @@ call bug4902()|
drop procedure bug4902|
# We need separate SP for SHOW PROCESSLIST since we want use replace_column
+--disable_warnings
+drop procedure if exists bug4902_2|
+--enable_warnings
create procedure bug4902_2()
begin
show processlist;
@@ -1866,6 +2176,9 @@ drop procedure bug4902_2|
drop table if exists t3|
--enable_warnings
+--disable_warnings
+drop procedure if exists bug4904|
+--enable_warnings
create procedure bug4904()
begin
declare continue handler for sqlstate 'HY000' begin end;
@@ -1880,6 +2193,9 @@ drop procedure bug4904|
create table t3 (s1 char character set latin1, s2 char character set latin2)|
+--disable_warnings
+drop procedure if exists bug4904|
+--enable_warnings
create procedure bug4904 ()
begin
declare continue handler for sqlstate 'HY000' begin end;
@@ -1895,6 +2211,9 @@ drop table t3|
#
# BUG#336
#
+--disable_warnings
+drop procedure if exists bug336|
+--enable_warnings
create procedure bug336(out y int)
begin
declare x int;
@@ -1911,6 +2230,9 @@ drop procedure bug336|
#
# BUG#3157
#
+--disable_warnings
+drop procedure if exists bug3157|
+--enable_warnings
create procedure bug3157()
begin
if exists(select * from t1) then
@@ -1931,6 +2253,9 @@ drop procedure bug3157|
#
# BUG#5251: mysql changes creation time of a procedure/function when altering
#
+--disable_warnings
+drop procedure if exists bug5251|
+--enable_warnings
create procedure bug5251()
begin
end|
@@ -1947,6 +2272,9 @@ drop procedure bug5251|
#
# BUG#5279: Stored procedure packets out of order if CHECKSUM TABLE
#
+--disable_warnings
+drop procedure if exists bug5251|
+--enable_warnings
create procedure bug5251()
checksum table t1|
@@ -1957,6 +2285,9 @@ drop procedure bug5251|
#
# BUG#5287: Stored procedure crash if leave outside loop
#
+--disable_warnings
+drop procedure if exists bug5287|
+--enable_warnings
create procedure bug5287(param1 int)
label1:
begin
@@ -1975,6 +2306,9 @@ drop procedure bug5287|
#
# BUG#5307: Stored procedure allows statement after BEGIN ... END
#
+--disable_warnings
+drop procedure if exists bug5307|
+--enable_warnings
create procedure bug5307()
begin
end; set @x = 3|
@@ -1986,10 +2320,16 @@ drop procedure bug5307|
#
# BUG#5258: Stored procedure modified date is 0000-00-00
# (This was a design flaw)
+--disable_warnings
+drop procedure if exists bug5258|
+--enable_warnings
create procedure bug5258()
begin
end|
+--disable_warnings
+drop procedure if exists bug5258_aux|
+--enable_warnings
create procedure bug5258_aux()
begin
declare c, m char(19);
@@ -2010,6 +2350,9 @@ drop procedure bug5258_aux|
#
# BUG#4487: Stored procedure connection aborted if uninitialized char
#
+--disable_warnings
+drop function if exists bug4487|
+--enable_warnings
create function bug4487() returns char
begin
declare v char;
@@ -2026,6 +2369,9 @@ drop function bug4487|
--disable_warnings
drop procedure if exists bug4941|
--enable_warnings
+--disable_warnings
+drop procedure if exists bug4941|
+--enable_warnings
create procedure bug4941(out x int)
begin
declare c cursor for select i from t2 limit 1;
@@ -2048,6 +2394,9 @@ drop procedure bug4941|
--disable_warnings
drop procedure if exists bug3583|
--enable_warnings
+--disable_warnings
+drop procedure if exists bug3583|
+--enable_warnings
create procedure bug3583()
begin
declare c int;
@@ -2086,6 +2435,9 @@ drop procedure if exists bug4905|
create table t3 (s1 int,primary key (s1))|
+--disable_warnings
+drop procedure if exists bug4905|
+--enable_warnings
create procedure bug4905()
begin
declare v int;
@@ -2112,6 +2464,9 @@ drop table t3|
drop function if exists bug6022|
--enable_warnings
+--disable_warnings
+drop function if exists bug6022|
+--enable_warnings
create function bug6022(x int) returns int
begin
if x < 0 then
@@ -2131,6 +2486,9 @@ drop function bug6022|
drop procedure if exists bug6029|
--enable_warnings
+--disable_warnings
+drop procedure if exists bug6029|
+--enable_warnings
create procedure bug6029()
begin
declare exit handler for 1136 select '1136';
@@ -2162,6 +2520,9 @@ drop table if exists fac|
--enable_warnings
create table fac (n int unsigned not null primary key, f bigint unsigned)|
+--disable_warnings
+drop procedure if exists ifac|
+--enable_warnings
create procedure ifac(n int unsigned)
begin
declare i int unsigned default 1;
@@ -2210,6 +2571,9 @@ insert into primes values
(35, 157), (36, 163), (37, 167), (38, 173), (39, 179),
(40, 181), (41, 191), (42, 193), (43, 197), (44, 199)|
+--disable_warnings
+drop procedure if exists opp|
+--enable_warnings
create procedure opp(n bigint unsigned, out pp bool)
begin
declare r double;
@@ -2240,6 +2604,9 @@ begin
end loop;
end|
+--disable_warnings
+drop procedure if exists ip|
+--enable_warnings
create procedure ip(m int unsigned)
begin
declare p bigint unsigned;
@@ -2295,6 +2662,9 @@ insert into fib values (1), (1)|
# We deliberately do it the awkward way, fetching the last two
# values from the table, in order to exercise various statements
# and table accesses at each turn.
+--disable_warnings
+drop procedure if exists fib|
+--enable_warnings
create procedure fib(n int unsigned)
begin
if n > 0 then
@@ -2323,6 +2693,9 @@ drop procedure fib|
# Comment & suid
#
+--disable_warnings
+drop procedure if exists bar|
+--enable_warnings
create procedure bar(x char(16), y int)
comment "111111111111" sql security invoker
insert into test.t1 values (x, y)|
@@ -2342,6 +2715,9 @@ drop table t2;
#
# rexecution
#
+--disable_warnings
+drop procedure if exists p1;
+--enable_warnings
create procedure p1 () select (select s1 from t1) from t1;
create table t1 (s1 int);
call p1();
@@ -2353,6 +2729,9 @@ drop table t1;
#
# backticks
#
+--disable_warnings
+drop function if exists foo;
+--enable_warnings
create function `foo` () returns int return 5;
select `foo` ();
drop function `foo`;
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index daef4c3e281..d0202bff48d 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -916,7 +916,20 @@ create table t3 (a int);
insert into t3 values (6),(7),(3);
select * from t3 where a >= all (select b from t2);
explain extended select * from t3 where a >= all (select b from t2);
-
+select * from t3 where a >= some (select b from t2);
+explain extended select * from t3 where a >= some (select b from t2);
+select * from t3 where a >= all (select b from t2 group by 1);
+explain extended select * from t3 where a >= all (select b from t2 group by 1);
+select * from t3 where a >= some (select b from t2 group by 1);
+explain extended select * from t3 where a >= some (select b from t2 group by 1);
+select * from t3 where NULL >= any (select b from t2);
+explain extended select * from t3 where NULL >= any (select b from t2);
+select * from t3 where NULL >= any (select b from t2 group by 1);
+explain extended select * from t3 where NULL >= any (select b from t2 group by 1);
+select * from t3 where NULL >= some (select b from t2);
+explain extended select * from t3 where NULL >= some (select b from t2);
+select * from t3 where NULL >= some (select b from t2 group by 1);
+explain extended select * from t3 where NULL >= some (select b from t2 group by 1);
#
# optimized static ALL/ANY with grouping
#
@@ -1341,3 +1354,40 @@ create table t1 (s1 int,s2 int);
insert into t1 values (20,15);
select * from t1 where (('a',null) <=> (select 'a',s2 from t1 where s1 = 0));
drop table t1;
+
+#
+# ALL/ANY with NULL
+#
+create table t1 (s1 int);
+insert into t1 values (1),(null);
+select * from t1 where s1 < all (select s1 from t1);
+select s1, s1 < all (select s1 from t1) from t1;
+drop table t1;
+
+#
+# reference on changable fields from subquery
+#
+CREATE TABLE t1 (
+ Code char(3) NOT NULL default '',
+ Name char(52) NOT NULL default '',
+ Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia',
+ Region char(26) NOT NULL default '',
+ SurfaceArea float(10,2) NOT NULL default '0.00',
+ IndepYear smallint(6) default NULL,
+ Population int(11) NOT NULL default '0',
+ LifeExpectancy float(3,1) default NULL,
+ GNP float(10,2) default NULL,
+ GNPOld float(10,2) default NULL,
+ LocalName char(45) NOT NULL default '',
+ GovernmentForm char(45) NOT NULL default '',
+ HeadOfState char(60) default NULL,
+ Capital int(11) default NULL,
+ Code2 char(2) NOT NULL default ''
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX');
+INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS');
+INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF');
+INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM');
+/*!40000 ALTER TABLE t1 ENABLE KEYS */;
+SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200);
+drop table t1;
diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test
index ad8089e1a37..5b5d2aa774e 100644
--- a/mysql-test/t/timezone2.test
+++ b/mysql-test/t/timezone2.test
@@ -2,7 +2,7 @@
# Preparing playground
--disable_warnings
-drop table if exists t1;
+drop table if exists t1, t2;
--enable_warnings
@@ -205,25 +205,64 @@ drop table t1;
# even for unprivileged users.
#
+# Let us prepare playground
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%';
delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges;
+create table t1 (a int, b datetime);
+create table t2 (c int, d datetime);
-grant usage on mysqltest.* to mysqltest_1@localhost;
+grant all privileges on test.* to mysqltest_1@localhost;
connect (tzuser, localhost, mysqltest_1,,);
connection tzuser;
show grants for current_user();
set time_zone= '+00:00';
set time_zone= 'Europe/Moscow';
select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC');
+select convert_tz(b, 'Europe/Moscow', 'UTC') from t1;
+# Let us also check whenever multi-update works ok
+update t1, t2 set t1.b = convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC')
+ where t1.a = t2.c and t2.d = (select max(d) from t2);
# But still these two statements should not work:
---error 1044
+--error 1142
select * from mysql.time_zone_name;
---error 1044
+--error 1142
select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name;
+#
+# Test for bug #6765 "Implicit access to time zone description tables
+# requires privileges for them if some table or column level grants
+# present"
+#
+connection default;
+# Let use some table-level grants instead of db-level
+# to make life more interesting
+delete from mysql.db where user like 'mysqltest\_%';
+flush privileges;
+grant all privileges on test.t1 to mysqltest_1@localhost;
+grant all privileges on test.t2 to mysqltest_1@localhost;
+# The test itself is almost the same as previous one
+connect (tzuser2, localhost, mysqltest_1,,);
+connection tzuser2;
+show grants for current_user();
+set time_zone= '+00:00';
+set time_zone= 'Europe/Moscow';
+select convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC');
+select convert_tz(b, 'Europe/Moscow', 'UTC') from t1;
+update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC')
+ where t1.a = t2.c and t2.d = (select max(d) from t2);
+# Again these two statements should not work (but with different errors):
+--error 1142
+select * from mysql.time_zone_name;
+--error 1142
+select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name;
+
+# Clean-up
connection default;
delete from mysql.user where user like 'mysqltest\_%';
+delete from mysql.db where user like 'mysqltest\_%';
+delete from mysql.tables_priv where user like 'mysqltest\_%';
flush privileges;
+drop table t1, t2;
diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test
index 3a5b12b91e4..6b2183df069 100644
--- a/mysql-test/t/type_enum.test
+++ b/mysql-test/t/type_enum.test
@@ -111,5 +111,18 @@ alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
--enable_metadata
select * from t1;
---disable metadata
+--disable_metadata
+drop table t1;
+
+#
+# Bug #6840 Default value is not checked in ALTER column SET DEFAULT 'x'
+#
+create table t1 (a enum('x','y') default 'x');
+--error 1067
+alter table t1 alter a set default 'z';
+drop table t1;
+
+create table t1 (a set('x','y') default 'x');
+--error 1067
+alter table t1 alter a set default 'z';
drop table t1;
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test
index aeefa3c33f5..704263b1216 100644
--- a/mysql-test/t/update.test
+++ b/mysql-test/t/update.test
@@ -161,3 +161,12 @@ SELECT * FROM t2;
DROP TABLE t1;
DROP TABLE t2;
+#
+# Bug #6054
+#
+create table t1 (c1 int, c2 char(6), c3 int);
+create table t2 (c1 int, c2 char(6));
+insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20);
+update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1";
+update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10;
+drop table t1, t2;
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 6563f7117cd..9c3c011dd24 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -367,3 +367,10 @@ create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3;
show create table t1;
drop table t1;
+
+#
+# Bug #6993: myisam_data_pointer_size
+#
+
+SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8;
+SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index cb398fed856..6dc49b28426 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -528,7 +528,7 @@ update t2,v2 set v2.c=v2.a+v2.c where t2.x=v2.c;
-- error 1143
update v2 set c=a+c;
# no rights for view
--- error 1143
+-- error 1142
update t2,v3 set v3.a=v3.a+v3.c where t2.x=v3.c;
-- error 1142
update v3 set a=a+c;
@@ -1394,6 +1394,7 @@ create view v1 as select * from t1 where a < 2 with check option;
insert into v1 values (1) on duplicate key update a=2;
-- error 1369
insert into v1 values (1) on duplicate key update a=2;
+-- error 1369
insert ignore into v1 values (1) on duplicate key update a=2;
select * from t1;
drop view v1;
diff --git a/mysys/hash.c b/mysys/hash.c
index d068299d44e..451bc1eb7f5 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -146,7 +146,7 @@ void hash_reset(HASH *hash)
handle inline functions that are not defined as native types
*/
-inline char*
+static inline char*
hash_key(HASH *hash,const byte *record,uint *length,my_bool first)
{
if (hash->get_key)
diff --git a/ndb/include/debugger/EventLogger.hpp b/ndb/include/debugger/EventLogger.hpp
index 686989089ae..ddf21b79f5f 100644
--- a/ndb/include/debugger/EventLogger.hpp
+++ b/ndb/include/debugger/EventLogger.hpp
@@ -48,6 +48,10 @@ public:
static const EventRepLogLevelMatrix matrix[];
static const Uint32 matrixSize;
+ static int event_lookup(int eventType,
+ LogLevel::EventCategory &cat,
+ Uint32 &threshold,
+ Logger::LoggerLevel &severity);
};
/**
diff --git a/ndb/include/kernel/LogLevel.hpp b/ndb/include/kernel/LogLevel.hpp
index 5981ca4701a..3c2f349e0e1 100644
--- a/ndb/include/kernel/LogLevel.hpp
+++ b/ndb/include/kernel/LogLevel.hpp
@@ -73,7 +73,7 @@ public:
/**
* Note level is valid as 0-15
*/
- void setLogLevel(EventCategory ec, Uint32 level = 7);
+ int setLogLevel(EventCategory ec, Uint32 level = 7);
/**
* Get the loglevel (0-15) for a category
@@ -119,10 +119,14 @@ LogLevel::clear(){
}
inline
-void
+int
LogLevel::setLogLevel(EventCategory ec, Uint32 level){
- assert(ec >= 0 && (Uint32) ec < LOGLEVEL_CATEGORIES);
- logLevelData[ec] = (Uint8)level;
+ if (ec >= 0 && (Uint32) ec < LOGLEVEL_CATEGORIES)
+ {
+ logLevelData[ec] = (Uint8)level;
+ return 0;
+ }
+ return 1;
}
inline
diff --git a/ndb/include/kernel/signaldata/CreateEvnt.hpp b/ndb/include/kernel/signaldata/CreateEvnt.hpp
index 65a07c122a2..e911fa36ce6 100644
--- a/ndb/include/kernel/signaldata/CreateEvnt.hpp
+++ b/ndb/include/kernel/signaldata/CreateEvnt.hpp
@@ -475,14 +475,14 @@ struct CreateEvntRef {
}
};
inline bool CreateEvntRef::isTemporary() const
-{ return (errorCode & CreateEvntRef::Temporary) > 0; };
+{ return (errorCode & CreateEvntRef::Temporary) > 0; }
inline void CreateEvntRef::setTemporary()
-{ errorCode |= CreateEvntRef::Temporary; };
+{ errorCode |= CreateEvntRef::Temporary; }
inline CreateEvntRef::ErrorCode CreateEvntRef::setTemporary(ErrorCode ec)
{ return (CreateEvntRef::ErrorCode)
- (errorCode = ((Uint32) ec | (Uint32)CreateEvntRef::Temporary)); };
+ (errorCode = ((Uint32) ec | (Uint32)CreateEvntRef::Temporary)); }
inline CreateEvntRef::ErrorCode CreateEvntRef::makeTemporary(ErrorCode ec)
{ return (CreateEvntRef::ErrorCode)
- ( (Uint32) ec | (Uint32)CreateEvntRef::Temporary ); };
+ ( (Uint32) ec | (Uint32)CreateEvntRef::Temporary ); }
#endif
diff --git a/ndb/include/kernel/signaldata/PackedSignal.hpp b/ndb/include/kernel/signaldata/PackedSignal.hpp
index 057bb39b25a..ea0ff6db526 100644
--- a/ndb/include/kernel/signaldata/PackedSignal.hpp
+++ b/ndb/include/kernel/signaldata/PackedSignal.hpp
@@ -38,6 +38,6 @@ class PackedSignal {
};
inline
-Uint32 PackedSignal::getSignalType(Uint32 data) { return data >> 28; };
+Uint32 PackedSignal::getSignalType(Uint32 data) { return data >> 28; }
#endif
diff --git a/ndb/include/kernel/signaldata/SumaImpl.hpp b/ndb/include/kernel/signaldata/SumaImpl.hpp
index 089132cd9aa..89ade067dcd 100644
--- a/ndb/include/kernel/signaldata/SumaImpl.hpp
+++ b/ndb/include/kernel/signaldata/SumaImpl.hpp
@@ -159,12 +159,12 @@ public:
Uint32 subscriberRef;
};
inline bool SubStartRef::isTemporary() const
-{ return (errorCode & SubStartRef::Temporary) > 0; };
+{ return (errorCode & SubStartRef::Temporary) > 0; }
inline void SubStartRef::setTemporary()
-{ errorCode |= SubStartRef::Temporary; };
+{ errorCode |= SubStartRef::Temporary; }
inline SubStartRef::ErrorCode SubStartRef::setTemporary(ErrorCode ec)
{ return (SubStartRef::ErrorCode)
- (errorCode = ((Uint32) ec | (Uint32)SubStartRef::Temporary)); };
+ (errorCode = ((Uint32) ec | (Uint32)SubStartRef::Temporary)); }
class SubStartConf {
/**
@@ -239,12 +239,12 @@ public:
};
};
inline bool SubStopRef::isTemporary() const
-{ return (errorCode & SubStopRef::Temporary) > 0; };
+{ return (errorCode & SubStopRef::Temporary) > 0; }
inline void SubStopRef::setTemporary()
-{ errorCode |= SubStopRef::Temporary; };
+{ errorCode |= SubStopRef::Temporary; }
inline SubStopRef::ErrorCode SubStopRef::setTemporary(ErrorCode ec)
{ return (SubStopRef::ErrorCode)
- (errorCode = ((Uint32) ec | (Uint32)SubStopRef::Temporary)); };
+ (errorCode = ((Uint32) ec | (Uint32)SubStopRef::Temporary)); }
class SubStopConf {
/**
@@ -515,12 +515,12 @@ public:
};
};
inline bool SubRemoveRef::isTemporary() const
-{ return (err & SubRemoveRef::Temporary) > 0; };
+{ return (err & SubRemoveRef::Temporary) > 0; }
inline void SubRemoveRef::setTemporary()
-{ err |= SubRemoveRef::Temporary; };
+{ err |= SubRemoveRef::Temporary; }
inline SubRemoveRef::ErrorCode SubRemoveRef::setTemporary(ErrorCode ec)
{ return (SubRemoveRef::ErrorCode)
- (errorCode = ((Uint32) ec | (Uint32)SubRemoveRef::Temporary)); };
+ (errorCode = ((Uint32) ec | (Uint32)SubRemoveRef::Temporary)); }
class SubRemoveConf {
/**
diff --git a/ndb/include/logger/Logger.hpp b/ndb/include/logger/Logger.hpp
index c6145f2091a..f12297023b7 100644
--- a/ndb/include/logger/Logger.hpp
+++ b/ndb/include/logger/Logger.hpp
@@ -101,7 +101,7 @@ public:
/** The log levels. NOTE: Could not use the name LogLevel since
* it caused conflicts with another class.
*/
- enum LoggerLevel {LL_OFF, LL_DEBUG, LL_INFO, LL_WARNING, LL_ERROR,
+ enum LoggerLevel {LL_ON, LL_DEBUG, LL_INFO, LL_WARNING, LL_ERROR,
LL_CRITICAL, LL_ALERT, LL_ALL};
/**
diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h
index 7f2baecd757..e067d33e010 100644
--- a/ndb/include/mgmapi/mgmapi.h
+++ b/ndb/include/mgmapi/mgmapi.h
@@ -244,7 +244,9 @@ extern "C" {
* Log severities (used to filter the cluster log)
*/
enum ndb_mgm_clusterlog_level {
- NDB_MGM_CLUSTERLOG_OFF = 0, /*< Cluster log off*/
+ NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL = -1,
+ /* must range from 0 and up, indexes into an array */
+ NDB_MGM_CLUSTERLOG_ON = 0, /*< Cluster log on*/
NDB_MGM_CLUSTERLOG_DEBUG = 1, /*< Used in NDB Cluster
*< developement
*/
@@ -264,7 +266,8 @@ extern "C" {
*< corrected immediately,
*< such as a corrupted system
*/
- NDB_MGM_CLUSTERLOG_ALL = 7 /*< All severities on*/
+ /* must be next number, works as bound in loop */
+ NDB_MGM_CLUSTERLOG_ALL = 7 /*< All severities */
};
/**
@@ -623,12 +626,14 @@ extern "C" {
*
* @param handle NDB management handle.
* @param level A cluster log level to filter.
+ * @param enable set 1=enable 0=disable
* @param reply Reply message.
*
* @return -1 on error.
*/
int ndb_mgm_filter_clusterlog(NdbMgmHandle handle,
enum ndb_mgm_clusterlog_level level,
+ int enable,
struct ndb_mgm_reply* reply);
/**
@@ -702,11 +707,15 @@ extern "C" {
* Start backup
*
* @param handle NDB management handle.
+ * @param wait_completed 0=don't wait for confirmation
+ 1=wait for backup started
+ 2=wait for backup completed
* @param backup_id Backup id is returned from function.
* @param reply Reply message.
* @return -1 on error.
*/
- int ndb_mgm_start_backup(NdbMgmHandle handle, unsigned int* backup_id,
+ int ndb_mgm_start_backup(NdbMgmHandle handle, int wait_completed,
+ unsigned int* backup_id,
struct ndb_mgm_reply* reply);
/**
diff --git a/ndb/include/mgmapi/mgmapi_config_parameters.h b/ndb/include/mgmapi/mgmapi_config_parameters.h
index 6a0cd376355..406bdb1a110 100644
--- a/ndb/include/mgmapi/mgmapi_config_parameters.h
+++ b/ndb/include/mgmapi/mgmapi_config_parameters.h
@@ -110,6 +110,7 @@
#define CFG_CONNECTION_SERVER_PORT 406
#define CFG_CONNECTION_HOSTNAME_1 407
#define CFG_CONNECTION_HOSTNAME_2 408
+#define CFG_CONNECTION_GROUP 409
#define CFG_TCP_SERVER 452
#define CFG_TCP_SEND_BUFFER_SIZE 454
diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp
index 44a4b96fecf..30be935b0a2 100644
--- a/ndb/include/ndbapi/Ndb.hpp
+++ b/ndb/include/ndbapi/Ndb.hpp
@@ -954,23 +954,6 @@ typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*);
NDB_MAX_SCHEMA_NAME_SIZE + \
NDB_MAX_TAB_NAME_SIZE*2
-#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
-class NdbWaiter {
-public:
- NdbWaiter();
- ~NdbWaiter();
-
- void wait(int waitTime);
- void nodeFail(Uint32 node);
- void signal(Uint32 state);
-
- Uint32 m_node;
- Uint32 m_state;
- void * m_mutex;
- struct NdbCondition * m_condition;
-};
-#endif
-
/**
* @class Ndb
* @brief Represents the NDB kernel and is the main class of the NDB API.
@@ -1233,39 +1216,6 @@ public:
const char * keyData = 0,
Uint32 keyLen = 0);
-#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
- /**
- * This method is a modification of Ndb::startTransaction,
- * in which we use only the first two chars of keyData to
- * select transaction coordinator.
- * This is referred to as a distribution group.
- * There are two ways to use the method:
- * - In the first, the two characters are used directly as
- * the distribution key, and
- * - in the second the distribution is calculated as:
- * (10 * (char[0] - 0x30) + (char[1] - 0x30)).
- * Thus, in the second way, the two ASCII digits '78'
- * will provide the distribution key = 78.
- *
- * @note Transaction priorities are not yet supported.
- *
- * @param aPrio Priority of the transaction.<br>
- * Priority 0 is the highest priority and is used for short transactions
- * with requirements on low delay.<br>
- * Priority 1 is a medium priority for short transactions.<br>
- * Priority 2 is a medium priority for long transactions.<br>
- * Priority 3 is a low priority for long transactions.
- * @param keyData is a string of which the two first characters
- * is used to compute which fragement the data is stored in.
- * @param type is the type of distribution group.<br>
- * 0 means direct usage of the two characters, and<br>
- * 1 means the ASCII digit variant.
- * @return NdbTransaction, or NULL if it failed.
- */
- NdbTransaction* startTransactionDGroup(Uint32 aPrio,
- const char * keyData, int type);
-#endif
-
/**
* Close a transaction.
*
@@ -1622,9 +1572,6 @@ private:
/******************************************************************************
* These are the private variables in this class.
*****************************************************************************/
- NdbObjectIdMap* theNdbObjectIdMap;
- Ndb_cluster_connection *m_ndb_cluster_connection;
-
NdbTransaction** thePreparedTransactionsArray;
NdbTransaction** theSentTransactionsArray;
NdbTransaction** theCompletedTransactionsArray;
@@ -1638,8 +1585,6 @@ private:
Uint32 theNextConnectNode;
- NdbWaiter theWaiter;
-
bool fullyQualifiedNames;
// Ndb database name.
@@ -1673,10 +1618,6 @@ private:
Uint32 theMyRef; // My block reference
Uint32 theNode; // The node number of our node
- Uint32 theNoOfDBnodes; // The number of DB nodes
- Uint32 * theDBnodes; // The node number of the DB nodes
- Uint8 *the_release_ind;// 1 indicates to release all connections to node
-
Uint64 the_last_check_time;
Uint64 theFirstTransId;
@@ -1699,39 +1640,6 @@ private:
InitConfigError
} theInitState;
- // Ensure good distribution of connects
- Uint32 theCurrentConnectIndex;
- Uint32 theCurrentConnectCounter;
-
- /**
- * Computes fragement id for primary key
- *
- * Note that keydata has to be "shaped" as it is being sent in KEYINFO
- */
- Uint32 computeFragmentId(const char * keyData, Uint32 keyLen);
- Uint32 getFragmentId(Uint32 hashValue);
-
- /**
- * Make a guess to which node is the primary for the fragment
- */
- Uint32 guessPrimaryNode(Uint32 fragmentId);
-
- /**
- * Structure containing values for guessing primary node
- */
- struct StartTransactionNodeSelectionData {
- StartTransactionNodeSelectionData():
- fragment2PrimaryNodeMap(0) {};
- Uint32 kValue;
- Uint32 hashValueMask;
- Uint32 hashpointerValue;
- Uint32 noOfFragments;
- Uint32 * fragment2PrimaryNodeMap;
-
- void init(Uint32 noOfNodes, Uint32 nodeIds[]);
- void release();
- } startTransactionNodeSelectionData;
-
NdbApiSignal* theCommitAckSignal;
diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp
index 2e5d70a1a76..6e2e27e95de 100644
--- a/ndb/include/ndbapi/NdbDictionary.hpp
+++ b/ndb/include/ndbapi/NdbDictionary.hpp
@@ -1108,11 +1108,11 @@ public:
int alterTable(const Table &);
/**
- * Get table with given name for alteration.
- * @param name Name of table to alter
- * @return table if successful. NULL if undefined
+ * Get table with given name, NULL if undefined
+ * @param name Name of table to get
+ * @return table if successful otherwise NULL.
*/
- Table getTableForAlteration(const char * name);
+ const Table * getTable(const char * name);
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/**
diff --git a/ndb/include/ndbapi/ndb_cluster_connection.hpp b/ndb/include/ndbapi/ndb_cluster_connection.hpp
index db1cd0b119e..b59d0758a9b 100644
--- a/ndb/include/ndbapi/ndb_cluster_connection.hpp
+++ b/ndb/include/ndbapi/ndb_cluster_connection.hpp
@@ -18,30 +18,33 @@
#ifndef CLUSTER_CONNECTION_HPP
#define CLUSTER_CONNECTION_HPP
-class TransporterFacade;
-class ConfigRetriever;
-struct NdbThread;
-
-extern "C" {
- void* run_ndb_cluster_connection_connect_thread(void*);
-}
-
class Ndb_cluster_connection {
public:
Ndb_cluster_connection(const char * connect_string = 0);
~Ndb_cluster_connection();
int connect(int no_retries, int retry_delay_in_seconds, int verbose);
int start_connect_thread(int (*connect_callback)(void)= 0);
+
+ // add check coupled to init state of cluster connection
+ // timeout_after_first_alive negative - ok only if all alive
+ // timeout_after_first_alive positive - ok if some alive
+ int wait_until_ready(int timeout_for_first_alive,
+ int timeout_after_first_alive);
+
const char *get_connectstring(char *buf, int buf_sz) const;
int get_connected_port() const;
const char *get_connected_host() const;
+
+ void set_optimized_node_selection(int val);
+
+ Uint32 no_db_nodes();
+
private:
- friend void* run_ndb_cluster_connection_connect_thread(void*);
- void connect_thread();
- TransporterFacade *m_facade;
- ConfigRetriever *m_config_retriever;
- NdbThread *m_connect_thread;
- int (*m_connect_callback)(void);
+ friend class Ndb;
+ friend class NdbImpl;
+ friend class Ndb_cluster_connection_impl;
+ class Ndb_cluster_connection_impl & m_impl;
+ Ndb_cluster_connection(Ndb_cluster_connection_impl&);
};
#endif
diff --git a/ndb/include/util/BaseString.hpp b/ndb/include/util/BaseString.hpp
index 066a24f294e..02a6a3b3e66 100644
--- a/ndb/include/util/BaseString.hpp
+++ b/ndb/include/util/BaseString.hpp
@@ -48,10 +48,10 @@ public:
bool empty() const;
/** @brief Convert to uppercase */
- void ndb_toupper();
+ BaseString& ndb_toupper();
/** @brief Convert to lowercase */
- void ndb_tolower();
+ BaseString& ndb_tolower();
/** @brief Assigns from a char * */
BaseString& assign(const char* s);
@@ -206,16 +206,18 @@ BaseString::empty() const
return m_len == 0;
}
-inline void
+inline BaseString&
BaseString::ndb_toupper() {
for(unsigned i = 0; i < length(); i++)
m_chr[i] = toupper(m_chr[i]);
+ return *this;
}
-inline void
+inline BaseString&
BaseString::ndb_tolower() {
for(unsigned i = 0; i < length(); i++)
m_chr[i] = tolower(m_chr[i]);
+ return *this;
}
inline bool
diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h
index f7ae3b5489e..4bac36f5e5e 100644
--- a/ndb/include/util/ndb_opts.h
+++ b/ndb/include/util/ndb_opts.h
@@ -17,47 +17,62 @@
#ifndef _NDB_OPTS_H
#define _NDB_OPTS_H
+#include <ndb_global.h>
#include <my_sys.h>
#include <my_getopt.h>
#include <mysql_version.h>
#include <ndb_version.h>
-#ifndef DBUG_OFF
-#define NDB_STD_OPTS(prog_name) \
- { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \
- 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "usage", '?', "Display this help and exit.", \
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "help", '?', "Display this help and exit.", \
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "version", 'V', "Output version information and exit.", 0, 0, 0, \
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "ndb-connectstring", 'c', \
- "Set connect string for connecting to ndb_mgmd. " \
- "Syntax: \"[nodeid=<id>;][host=]<hostname>[:<port>]\". " \
- "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \
- (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \
- GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
- { "connect-string", 'c', "same as --ndb-connectstring",\
- (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \
- GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }
+#define NDB_STD_OPTS_VARS \
+const char *opt_connect_str= 0;\
+my_bool opt_ndb_shm;\
+my_bool opt_ndb_optimized_node_selection
+
+#define NDB_STD_OPTS_OPTIONS \
+OPT_NDB_SHM= 256,\
+OPT_NDB_OPTIMIZED_NODE_SELECTION
+
+#define OPT_NDB_CONNECTSTRING 'c'
+
+#ifdef NDB_SHM_TRANSPORTER
+#define OPT_NDB_SHM_DEFAULT 1
#else
-#define NDB_STD_OPTS(prog_name) \
+#define OPT_NDB_SHM_DEFAULT 0
+#endif
+
+#define NDB_STD_OPTS_COMMON \
{ "usage", '?', "Display this help and exit.", \
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
{ "help", '?', "Display this help and exit.", \
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
{ "version", 'V', "Output version information and exit.", 0, 0, 0, \
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "ndb-connectstring", 'c', \
+ { "ndb-connectstring", OPT_NDB_CONNECTSTRING, \
"Set connect string for connecting to ndb_mgmd. " \
"Syntax: \"[nodeid=<id>;][host=]<hostname>[:<port>]\". " \
"Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \
(gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
- { "connect-string", 'c', "same as --ndb-connectstring",\
+ { "ndb-shm", OPT_NDB_SHM,\
+ "Allow optimizing using shared memory connections when available",\
+ (gptr*) &opt_ndb_shm, (gptr*) &opt_ndb_shm, 0,\
+ GET_BOOL, NO_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0 },\
+ {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION,\
+ "Select nodes for transactions in a more optimal way",\
+ (gptr*) &opt_ndb_optimized_node_selection,\
+ (gptr*) &opt_ndb_optimized_node_selection, 0,\
+ GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},\
+ { "connect-string", OPT_NDB_CONNECTSTRING, "same as --ndb-connectstring",\
(gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0,\
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }
+
+#ifndef DBUG_OFF
+#define NDB_STD_OPTS(prog_name) \
+ { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \
+ 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \
+ NDB_STD_OPTS_COMMON
+#else
+#define NDB_STD_OPTS(prog_name) NDB_STD_OPTS_COMMON
#endif
#endif /*_NDB_OPTS_H */
diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp
index a9ca2433a33..97945394690 100644
--- a/ndb/src/common/debugger/EventLogger.cpp
+++ b/ndb/src/common/debugger/EventLogger.cpp
@@ -1280,10 +1280,10 @@ EventLogger::getText(char * m_text, size_t m_text_len,
case EventReport::BackupCompleted:
BaseString::snprintf(m_text,
m_text_len,
- "%sBackup %d started from node %d completed\n"
- " StartGCP: %d StopGCP: %d\n"
- " #Records: %d #LogRecords: %d\n"
- " Data: %d bytes Log: %d bytes",
+ "%sBackup %u started from node %u completed\n"
+ " StartGCP: %u StopGCP: %u\n"
+ " #Records: %u #LogRecords: %u\n"
+ " Data: %u bytes Log: %u bytes",
theNodeId, theData[2], refToNode(theData[1]),
theData[3], theData[4], theData[6], theData[8],
theData[5], theData[7]);
@@ -1342,27 +1342,41 @@ operator<<(NdbOut& out, const LogLevel & ll)
return out;
}
-void
-EventLogger::log(int eventType, const Uint32* theData, NodeId nodeId,
- const LogLevel* ll)
+int
+EventLoggerBase::event_lookup(int eventType,
+ LogLevel::EventCategory &cat,
+ Uint32 &threshold,
+ Logger::LoggerLevel &severity)
{
- Uint32 threshold = 0;
- Logger::LoggerLevel severity = Logger::LL_WARNING;
- LogLevel::EventCategory cat= LogLevel::llInvalid;
-
for(unsigned i = 0; i<EventLoggerBase::matrixSize; i++){
if(EventLoggerBase::matrix[i].eventType == eventType){
cat = EventLoggerBase::matrix[i].eventCategory;
threshold = EventLoggerBase::matrix[i].threshold;
severity = EventLoggerBase::matrix[i].severity;
- break;
+ return 0;
}
}
+ return 1;
+}
+
+void
+EventLogger::log(int eventType, const Uint32* theData, NodeId nodeId,
+ const LogLevel* ll)
+{
+ Uint32 threshold = 0;
+ Logger::LoggerLevel severity = Logger::LL_WARNING;
+ LogLevel::EventCategory cat= LogLevel::llInvalid;
+
+ DBUG_ENTER("EventLogger::log");
+ DBUG_PRINT("enter",("eventType=%d, nodeid=%d", eventType, nodeId));
- if (cat == LogLevel::llInvalid)
- return;
+ if (EventLoggerBase::event_lookup(eventType,cat,threshold,severity))
+ DBUG_VOID_RETURN;
Uint32 set = ll?ll->getLogLevel(cat) : m_logLevel.getLogLevel(cat);
+ DBUG_PRINT("info",("threshold=%d, set=%d", threshold, set));
+ if (ll)
+ DBUG_PRINT("info",("m_logLevel.getLogLevel=%d", m_logLevel.getLogLevel(cat)));
if (threshold <= set){
switch (severity){
case Logger::LL_ALERT:
@@ -1401,6 +1415,7 @@ EventLogger::log(int eventType, const Uint32* theData, NodeId nodeId,
break;
}
} // if (..
+ DBUG_VOID_RETURN;
}
int
diff --git a/ndb/src/common/debugger/signaldata/DictTabInfo.cpp b/ndb/src/common/debugger/signaldata/DictTabInfo.cpp
index 816c4fb9452..4d95e9b03b5 100644
--- a/ndb/src/common/debugger/signaldata/DictTabInfo.cpp
+++ b/ndb/src/common/debugger/signaldata/DictTabInfo.cpp
@@ -138,4 +138,4 @@ DictTabInfo::Attribute::init(){
AttributeExtLength = 0,
AttributeAutoIncrement = false;
memset(AttributeDefaultValue, 0, sizeof(AttributeDefaultValue));//AttributeDefaultValue[0] = 0;
-};
+}
diff --git a/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp b/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp
index 20f7ea99871..f2d6f2f104a 100644
--- a/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp
+++ b/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp
@@ -41,4 +41,4 @@ printNF_COMPLETE_REP(FILE * output,
sig->from);
return true;
-};
+}
diff --git a/ndb/src/common/logger/FileLogHandler.cpp b/ndb/src/common/logger/FileLogHandler.cpp
index 98b2848feba..8678b999b6f 100644
--- a/ndb/src/common/logger/FileLogHandler.cpp
+++ b/ndb/src/common/logger/FileLogHandler.cpp
@@ -198,7 +198,7 @@ FileLogHandler::setFilename(const BaseString &filename) {
m_pLogFile = new File_class(filename.c_str(), "a+");
open();
return true;
-};
+}
bool
FileLogHandler::setMaxSize(const BaseString &size) {
@@ -214,7 +214,7 @@ FileLogHandler::setMaxSize(const BaseString &size) {
m_maxFileSize = val;
return true;
-};
+}
bool
FileLogHandler::setMaxFiles(const BaseString &files) {
@@ -225,7 +225,7 @@ FileLogHandler::setMaxFiles(const BaseString &files) {
m_maxNoFiles = val;
return true;
-};
+}
bool
FileLogHandler::checkParams() {
diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp
index 3b686b24151..4fa7b462563 100644
--- a/ndb/src/common/logger/Logger.cpp
+++ b/ndb/src/common/logger/Logger.cpp
@@ -30,7 +30,7 @@
//
// PUBLIC
//
-const char* Logger::LoggerLevelNames[] = { "OFF ",
+const char* Logger::LoggerLevelNames[] = { "ON ",
"DEBUG ",
"INFO ",
"WARNING ",
@@ -46,7 +46,9 @@ Logger::Logger() :
m_pSyslogHandler(NULL)
{
m_pHandlerList = new LogHandlerList();
- m_logLevels[LL_INFO] = true;
+ disable(LL_ALL);
+ enable(LL_ON);
+ enable(LL_INFO);
}
Logger::~Logger()
@@ -231,6 +233,13 @@ Logger::removeAllHandlers()
bool
Logger::isEnable(LoggerLevel logLevel) const
{
+ if (logLevel == LL_ALL)
+ {
+ for (unsigned i = 1; i < MAX_LOG_LEVELS; i++)
+ if (!m_logLevels[i])
+ return false;
+ return true;
+ }
return m_logLevels[logLevel];
}
@@ -239,7 +248,7 @@ Logger::enable(LoggerLevel logLevel)
{
if (logLevel == LL_ALL)
{
- for (unsigned i = 1; i < MAX_LOG_LEVELS; i++)
+ for (unsigned i = 0; i < MAX_LOG_LEVELS; i++)
{
m_logLevels[i] = true;
}
@@ -341,7 +350,7 @@ Logger::debug(const char* pMsg, ...) const
void
Logger::log(LoggerLevel logLevel, const char* pMsg, va_list ap) const
{
- if (m_logLevels[LL_OFF] == false && m_logLevels[logLevel])
+ if (m_logLevels[LL_ON] && m_logLevels[logLevel])
{
LogHandler* pHandler = NULL;
while ( (pHandler = m_pHandlerList->next()) != NULL)
diff --git a/ndb/src/common/portlib/NdbTCP.cpp b/ndb/src/common/portlib/NdbTCP.cpp
index 35b0c8c21e4..a63f5a7ba27 100644
--- a/ndb/src/common/portlib/NdbTCP.cpp
+++ b/ndb/src/common/portlib/NdbTCP.cpp
@@ -22,7 +22,7 @@
extern "C"
int
Ndb_getInAddr(struct in_addr * dst, const char *address) {
- DBUG_ENTER("Ndb_getInAddr");
+ // DBUG_ENTER("Ndb_getInAddr");
{
int tmp_errno;
struct hostent tmp_hostent, *hp;
@@ -33,7 +33,7 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) {
{
memcpy(dst, hp->h_addr, min(sizeof(*dst), (size_t) hp->h_length));
my_gethostbyname_r_free();
- DBUG_RETURN(0);
+ return 0; //DBUG_RETURN(0);
}
my_gethostbyname_r_free();
}
@@ -47,11 +47,11 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) {
#endif
)
{
- DBUG_RETURN(0);
+ return 0; //DBUG_RETURN(0);
}
- DBUG_PRINT("error",("inet_addr(%s) - %d - %s",
- address, errno, strerror(errno)));
- DBUG_RETURN(-1);
+ // DBUG_PRINT("error",("inet_addr(%s) - %d - %s",
+ // address, errno, strerror(errno)));
+ return -1; //DBUG_RETURN(-1);
}
#if 0
diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c
index 33020ad305e..dfbb1e4a2e6 100644
--- a/ndb/src/common/util/version.c
+++ b/ndb/src/common/util/version.c
@@ -18,6 +18,8 @@
#include <ndb_version.h>
#include <version.h>
#include <basestring_vsnprintf.h>
+#include <NdbEnv.h>
+#include <NdbOut.hpp>
Uint32 getMajor(Uint32 version) {
return (version >> 16) & 0xFF;
@@ -68,6 +70,24 @@ struct NdbUpGradeCompatible {
/*#define TEST_VERSION*/
+#define HAVE_NDB_SETVERSION
+#ifdef HAVE_NDB_SETVERSION
+Uint32 ndbOwnVersionTesting = 0;
+void
+ndbSetOwnVersion() {
+ char buf[256];
+ if (NdbEnv_GetEnv("NDB_SETVERSION", buf, sizeof(buf))) {
+ Uint32 _v1,_v2,_v3;
+ if (sscanf(buf, "%u.%u.%u", &_v1, &_v2, &_v3) == 3) {
+ ndbOwnVersionTesting = MAKE_VERSION(_v1,_v2,_v3);
+ ndbout_c("Testing: Version set to 0x%x", ndbOwnVersionTesting);
+ }
+ }
+}
+#else
+void ndbSetOwnVersion() {}
+#endif
+
#ifndef TEST_VERSION
struct NdbUpGradeCompatible ndbCompatibleTable_full[] = {
{ MAKE_VERSION(5,0,3), MAKE_VERSION(5,0,2), UG_Exact },
@@ -82,8 +102,6 @@ struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = {
{ 0, 0, UG_Null }
};
-void ndbSetOwnVersion() {}
-
#else /* testing purposes */
struct NdbUpGradeCompatible ndbCompatibleTable_full[] = {
@@ -104,19 +122,6 @@ struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = {
};
-Uint32 ndbOwnVersionTesting = 0;
-void
-ndbSetOwnVersion() {
- char buf[256];
- if (NdbEnv_GetEnv("NDB_SETVERSION", buf, sizeof(buf))) {
- Uint32 _v1,_v2,_v3;
- if (sscanf(buf, "%u.%u.%u", &_v1, &_v2, &_v3) == 3) {
- ndbOwnVersionTesting = MAKE_VERSION(_v1,_v2,_v3);
- ndbout_c("Testing: Version set to 0x%x", ndbOwnVersionTesting);
- }
- }
-}
-
#endif
void ndbPrintVersion()
@@ -130,13 +135,13 @@ void ndbPrintVersion()
Uint32
ndbGetOwnVersion()
{
-#ifndef TEST_VERSION
- return NDB_VERSION_D;
-#else /* testing purposes */
+#ifdef HAVE_NDB_SETVERSION
if (ndbOwnVersionTesting == 0)
return NDB_VERSION_D;
else
return ndbOwnVersionTesting;
+#else
+ return NDB_VERSION_D;
#endif
}
diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp
index f1130c3e8a7..e0171c61eca 100644
--- a/ndb/src/kernel/blocks/backup/BackupInit.cpp
+++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp
@@ -44,7 +44,8 @@ Backup::Backup(const Configuration & conf) :
Uint32 noBackups = 0, noTables = 0, noAttribs = 0;
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &m_diskless));
ndb_mgm_get_int_parameter(p, CFG_DB_PARALLEL_BACKUPS, &noBackups);
- ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables));
+ // ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DICT_TABLE, &noTables));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_ATTRIBUTES, &noAttribs));
noAttribs++; //RT 527 bug fix
@@ -204,7 +205,7 @@ Backup::~Backup()
{
}
-BLOCK_FUNCTIONS(Backup);
+BLOCK_FUNCTIONS(Backup)
template class ArrayPool<Backup::Page32>;
template class ArrayPool<Backup::Attribute>;
diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
index c4127ba9283..c1dca184466 100644
--- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
+++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
@@ -195,21 +195,11 @@ void Cmvmi::execEVENT_REP(Signal* signal)
/**
* If entry is not found
*/
- Uint32 threshold = 16;
- LogLevel::EventCategory eventCategory = (LogLevel::EventCategory)0;
-
- for(unsigned int i = 0; i< EventLoggerBase::matrixSize; i++){
- if(EventLoggerBase::matrix[i].eventType == eventType){
- eventCategory = EventLoggerBase::matrix[i].eventCategory;
- threshold = EventLoggerBase::matrix[i].threshold;
- break;
- }
- }
-
- if(threshold > 15){
- // No entry found in matrix (or event that should never be printed)
+ Uint32 threshold;
+ LogLevel::EventCategory eventCategory;
+ Logger::LoggerLevel severity;
+ if (EventLoggerBase::event_lookup(eventType,eventCategory,threshold,severity))
return;
- }
SubscriberPtr ptr;
for(subscribers.first(ptr); ptr.i != RNIL; subscribers.next(ptr)){
@@ -227,14 +217,15 @@ void Cmvmi::execEVENT_REP(Signal* signal)
// Print the event info
g_eventLogger.log(eventReport->getEventType(), signal->theData);
+ return;
}//execEVENT_REP()
void
Cmvmi::execEVENT_SUBSCRIBE_REQ(Signal * signal){
EventSubscribeReq * subReq = (EventSubscribeReq *)&signal->theData[0];
SubscriberPtr ptr;
-
jamEntry();
+ DBUG_ENTER("Cmvmi::execEVENT_SUBSCRIBE_REQ");
/**
* Search for subcription
@@ -271,11 +262,13 @@ Cmvmi::execEVENT_SUBSCRIBE_REQ(Signal * signal){
category = (LogLevel::EventCategory)(subReq->theData[i] >> 16);
level = subReq->theData[i] & 0xFFFF;
ptr.p->logLevel.setLogLevel(category, level);
+ DBUG_PRINT("info",("entry %d: level=%d, category= %d", i, level, category));
}
}
signal->theData[0] = ptr.i;
sendSignal(ptr.p->blockRef, GSN_EVENT_SUBSCRIBE_CONF, signal, 1, JBB);
+ DBUG_VOID_RETURN;
}
void
@@ -1119,7 +1112,7 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
}//Cmvmi::execDUMP_STATE_ORD()
-BLOCK_FUNCTIONS(Cmvmi);
+BLOCK_FUNCTIONS(Cmvmi)
static Uint32 g_print;
static LinearSectionPtr g_test[3];
diff --git a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp
index 0b2e8aeeb9a..94782e13e00 100644
--- a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp
+++ b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp
@@ -266,4 +266,4 @@ Dbacc::~Dbacc()
}//Dbacc::~Dbacc()
-BLOCK_FUNCTIONS(Dbacc);
+BLOCK_FUNCTIONS(Dbacc)
diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
index c895b8ca6f0..96995df44d5 100644
--- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
@@ -1187,7 +1187,7 @@ Dbdict::~Dbdict()
{
}//Dbdict::~Dbdict()
-BLOCK_FUNCTIONS(Dbdict);
+BLOCK_FUNCTIONS(Dbdict)
void Dbdict::initCommonData()
{
diff --git a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
index 7ca45ef4b43..b823dbcd952 100644
--- a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
+++ b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
@@ -314,7 +314,7 @@ Dbdih::~Dbdih()
}//Dbdih::~Dbdih()
-BLOCK_FUNCTIONS(Dbdih);
+BLOCK_FUNCTIONS(Dbdih)
diff --git a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
index f8ce8845a51..2b62e907e7b 100644
--- a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
+++ b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
@@ -452,5 +452,5 @@ Dblqh::~Dblqh()
ctcNodeFailrecFileSize);
}//Dblqh::~Dblqh()
-BLOCK_FUNCTIONS(Dblqh);
+BLOCK_FUNCTIONS(Dblqh)
diff --git a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
index e38089242c3..5c66ba776b0 100644
--- a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
+++ b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
@@ -365,5 +365,5 @@ Dbtc::~Dbtc()
capiConnectFilesize);
}//Dbtc::~Dbtc()
-BLOCK_FUNCTIONS(Dbtc);
+BLOCK_FUNCTIONS(Dbtc)
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
index d33adcd08e1..8e1cba24359 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
@@ -215,7 +215,7 @@ Dbtup::~Dbtup()
}//Dbtup::~Dbtup()
-BLOCK_FUNCTIONS(Dbtup);
+BLOCK_FUNCTIONS(Dbtup)
/* **************************************************************** */
/* ---------------------------------------------------------------- */
diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
index f6c405feb1c..79da3af5de4 100644
--- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
+++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
@@ -1068,7 +1068,7 @@ Dbtux::Index::Index() :
m_fragId[i] = ZNIL;
m_fragPtrI[i] = RNIL;
};
-};
+}
// Dbtux::Frag
@@ -1104,7 +1104,7 @@ Dbtux::FragOp::FragOp() :
m_fragNo(ZNIL),
m_numAttrsRecvd(ZNIL)
{
-};
+}
// Dbtux::NodeHandle
diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
index b6d48b44aef..e9c3027dfc0 100644
--- a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
+++ b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
@@ -314,4 +314,4 @@ Dbtux::copyAttrs(const Frag& frag, ConstData data1, Data data2, unsigned maxlen2
#endif
}
-BLOCK_FUNCTIONS(Dbtux);
+BLOCK_FUNCTIONS(Dbtux)
diff --git a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
index f7e8981e122..b94bb8e6d7e 100644
--- a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
+++ b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
@@ -158,7 +158,7 @@ DbUtil::~DbUtil()
{
}
-BLOCK_FUNCTIONS(DbUtil);
+BLOCK_FUNCTIONS(DbUtil)
void
DbUtil::releasePrepare(PreparePtr prepPtr) {
diff --git a/ndb/src/kernel/blocks/grep/GrepInit.cpp b/ndb/src/kernel/blocks/grep/GrepInit.cpp
index cfb454a1f9b..36855f86568 100644
--- a/ndb/src/kernel/blocks/grep/GrepInit.cpp
+++ b/ndb/src/kernel/blocks/grep/GrepInit.cpp
@@ -132,7 +132,7 @@ Grep::~Grep()
{
}
-BLOCK_FUNCTIONS(Grep);
+BLOCK_FUNCTIONS(Grep)
Grep::PSPart::PSPart(Grep * sb) :
BlockComponent(sb),
diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp
index 43044eeebcd..c7b472fc91a 100644
--- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp
+++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp
@@ -114,4 +114,4 @@ Ndbcntr::~Ndbcntr()
}//Ndbcntr::~Ndbcntr()
-BLOCK_FUNCTIONS(Ndbcntr);
+BLOCK_FUNCTIONS(Ndbcntr)
diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
index 21b0a2cb54f..9c943760e31 100644
--- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
@@ -1010,7 +1010,7 @@ Ndbfs::execDUMP_STATE_ORD(Signal* signal)
-BLOCK_FUNCTIONS(Ndbfs);
+BLOCK_FUNCTIONS(Ndbfs)
template class Vector<AsyncFile*>;
template class Vector<OpenFiles::OpenFileItem>;
diff --git a/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp b/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp
index d3407e8d4e7..d093089acfc 100644
--- a/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp
@@ -196,5 +196,5 @@ VoidFs::execDUMP_STATE_ORD(Signal* signal)
-BLOCK_FUNCTIONS(VoidFs);
+BLOCK_FUNCTIONS(VoidFs)
diff --git a/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp b/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp
index b0f1088779c..d6960ce154e 100644
--- a/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp
+++ b/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp
@@ -100,4 +100,4 @@ Qmgr::~Qmgr()
}//Qmgr::~Qmgr()
-BLOCK_FUNCTIONS(Qmgr);
+BLOCK_FUNCTIONS(Qmgr)
diff --git a/ndb/src/kernel/blocks/suma/Suma.cpp b/ndb/src/kernel/blocks/suma/Suma.cpp
index f6d9a0ac35a..836fa28d9ad 100644
--- a/ndb/src/kernel/blocks/suma/Suma.cpp
+++ b/ndb/src/kernel/blocks/suma/Suma.cpp
@@ -3553,7 +3553,7 @@ Suma::Restart::Restart(Suma& s) : suma(s) {
c_okToStart[i] = false;
c_waitingToStart[i] = false;
}
-};
+}
void
Suma::Restart::resetNode(Uint32 sumaRef)
diff --git a/ndb/src/kernel/blocks/suma/SumaInit.cpp b/ndb/src/kernel/blocks/suma/SumaInit.cpp
index 255abd47c94..36217c313af 100644
--- a/ndb/src/kernel/blocks/suma/SumaInit.cpp
+++ b/ndb/src/kernel/blocks/suma/SumaInit.cpp
@@ -188,6 +188,6 @@ Suma::~Suma()
{
}
-BLOCK_FUNCTIONS(Suma);
-BLOCK_FUNCTIONS(SumaParticipant);
+BLOCK_FUNCTIONS(Suma)
+BLOCK_FUNCTIONS(SumaParticipant)
diff --git a/ndb/src/kernel/blocks/trix/Trix.cpp b/ndb/src/kernel/blocks/trix/Trix.cpp
index 80cf9f88c0d..75bc19b6a20 100644
--- a/ndb/src/kernel/blocks/trix/Trix.cpp
+++ b/ndb/src/kernel/blocks/trix/Trix.cpp
@@ -962,6 +962,6 @@ void Trix::checkParallelism(Signal* signal, SubscriptionRecord* subRec)
}
}
-BLOCK_FUNCTIONS(Trix);
+BLOCK_FUNCTIONS(Trix)
template void append(DataBuffer<15>&,SegmentedSectionPtr,SectionSegmentPool&);
diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp
index 7c31490959b..29255fc9837 100644
--- a/ndb/src/kernel/vm/Configuration.cpp
+++ b/ndb/src/kernel/vm/Configuration.cpp
@@ -46,7 +46,13 @@ extern "C" {
#include <EventLogger.hpp>
extern EventLogger g_eventLogger;
-static const char* opt_connect_str= 0;
+enum ndbd_options {
+ NDB_STD_OPTS_OPTIONS,
+ OPT_INITIAL,
+ OPT_NODAEMON
+};
+
+NDB_STD_OPTS_VARS;
static int _daemon, _no_daemon, _initial, _no_start;
/**
* Arguments to NDB process
@@ -54,7 +60,7 @@ static int _daemon, _no_daemon, _initial, _no_start;
static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndbd"),
- { "initial", 256,
+ { "initial", OPT_INITIAL,
"Perform initial start of ndbd, including cleaning the file system. "
"Consult documentation before using this",
(gptr*) &_initial, (gptr*) &_initial, 0,
@@ -66,7 +72,7 @@ static struct my_option my_long_options[] =
{ "daemon", 'd', "Start ndbd as daemon (default)",
(gptr*) &_daemon, (gptr*) &_daemon, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 },
- { "nodaemon", 257,
+ { "nodaemon", OPT_NODAEMON,
"Do not start ndbd as daemon, provided for testing purposes",
(gptr*) &_no_daemon, (gptr*) &_no_daemon, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
@@ -609,8 +615,9 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){
Uint32 noOfMetaTables= noOfTables + noOfOrderedIndexes +
noOfUniqueHashIndexes;
- if (noOfMetaTables > MAX_TABLES)
- noOfMetaTables= MAX_TABLES;
+ Uint32 noOfMetaTablesDict= noOfMetaTables;
+ if (noOfMetaTablesDict > MAX_TABLES)
+ noOfMetaTablesDict= MAX_TABLES;
{
/**
@@ -619,8 +626,8 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){
cfg.put(CFG_DICT_ATTRIBUTE,
noOfAttributes);
- cfg.put(CFG_DICT_TABLE,
- noOfMetaTables);
+ cfg.put(CFG_DICT_TABLE,
+ noOfMetaTablesDict);
}
diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp
index 01eaf4badc8..166bd45d48b 100644
--- a/ndb/src/mgmapi/mgmapi.cpp
+++ b/ndb/src/mgmapi/mgmapi.cpp
@@ -917,21 +917,67 @@ ndb_mgm_restart(NdbMgmHandle handle, int no_of_nodes, const int *node_list)
return ndb_mgm_restart2(handle, no_of_nodes, node_list, 0, 0, 0);
}
+static const char *clusterlog_level_names[]=
+ { "enabled", "debug", "info", "warning", "error", "critical", "alert" };
+
+struct ndb_mgm_clusterlog_levels
+{
+ const char* name;
+ enum ndb_mgm_clusterlog_level level;
+} clusterlog_levels[] = {
+ { clusterlog_level_names[0], NDB_MGM_CLUSTERLOG_ON },
+ { clusterlog_level_names[1], NDB_MGM_CLUSTERLOG_DEBUG },
+ { clusterlog_level_names[2], NDB_MGM_CLUSTERLOG_INFO },
+ { clusterlog_level_names[3], NDB_MGM_CLUSTERLOG_WARNING },
+ { clusterlog_level_names[4], NDB_MGM_CLUSTERLOG_ERROR },
+ { clusterlog_level_names[5], NDB_MGM_CLUSTERLOG_CRITICAL },
+ { clusterlog_level_names[6], NDB_MGM_CLUSTERLOG_ALERT },
+ { "all", NDB_MGM_CLUSTERLOG_ALL },
+ { 0, NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL },
+};
+
+extern "C"
+ndb_mgm_clusterlog_level
+ndb_mgm_match_clusterlog_level(const char * name)
+{
+ if(name == 0)
+ return NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL;
+
+ for(int i = 0; clusterlog_levels[i].name !=0 ; i++)
+ if(strcasecmp(name, clusterlog_levels[i].name) == 0)
+ return clusterlog_levels[i].level;
+
+ return NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL;
+}
+
+extern "C"
+const char *
+ndb_mgm_get_clusterlog_level_string(enum ndb_mgm_clusterlog_level level)
+{
+ int i= (int)level;
+ if (i >= 0 && i < (int)NDB_MGM_CLUSTERLOG_ALL)
+ return clusterlog_level_names[i];
+ for(i = (int)NDB_MGM_CLUSTERLOG_ALL; clusterlog_levels[i].name != 0; i++)
+ if(clusterlog_levels[i].level == level)
+ return clusterlog_levels[i].name;
+ return 0;
+}
+
extern "C"
unsigned int *
ndb_mgm_get_logfilter(NdbMgmHandle handle)
{
SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_get_logfilter");
- static Uint32 enabled[7] = {0,0,0,0,0,0,0};
+ static Uint32 enabled[(int)NDB_MGM_CLUSTERLOG_ALL] = {0,0,0,0,0,0,0};
const ParserRow<ParserDummy> getinfo_reply[] = {
MGM_CMD("clusterlog", NULL, ""),
- MGM_ARG("enabled", Int, Mandatory, ""),
- MGM_ARG("debug", Int, Mandatory, ""),
- MGM_ARG("info", Int, Mandatory, ""),
- MGM_ARG("warning", Int, Mandatory, ""),
- MGM_ARG("error", Int, Mandatory, ""),
- MGM_ARG("critical", Int, Mandatory, ""),
- MGM_ARG("alert", Int, Mandatory, ""),
+ MGM_ARG(clusterlog_level_names[0], Int, Mandatory, ""),
+ MGM_ARG(clusterlog_level_names[1], Int, Mandatory, ""),
+ MGM_ARG(clusterlog_level_names[2], Int, Mandatory, ""),
+ MGM_ARG(clusterlog_level_names[3], Int, Mandatory, ""),
+ MGM_ARG(clusterlog_level_names[4], Int, Mandatory, ""),
+ MGM_ARG(clusterlog_level_names[5], Int, Mandatory, ""),
+ MGM_ARG(clusterlog_level_names[6], Int, Mandatory, ""),
};
CHECK_HANDLE(handle, NULL);
CHECK_CONNECTED(handle, NULL);
@@ -941,10 +987,8 @@ ndb_mgm_get_logfilter(NdbMgmHandle handle)
reply = ndb_mgm_call(handle, getinfo_reply, "get info clusterlog", &args);
CHECK_REPLY(reply, NULL);
- const char *names[] = { "enabled", "debug", "info", "warning", "error",
- "critical", "alert" };
- for(int i=0; i < 7; i++) {
- reply->get(names[i], &enabled[i]);
+ for(int i=0; i < (int)NDB_MGM_CLUSTERLOG_ALL; i++) {
+ reply->get(clusterlog_level_names[i], &enabled[i]);
}
return enabled;
}
@@ -953,6 +997,7 @@ extern "C"
int
ndb_mgm_filter_clusterlog(NdbMgmHandle handle,
enum ndb_mgm_clusterlog_level level,
+ int enable,
struct ndb_mgm_reply* /*reply*/)
{
SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_filter_clusterlog");
@@ -967,6 +1012,7 @@ ndb_mgm_filter_clusterlog(NdbMgmHandle handle,
Properties args;
args.put("level", level);
+ args.put("enable", enable);
const Properties *reply;
reply = ndb_mgm_call(handle, filter_reply, "set logfilter", &args);
@@ -974,11 +1020,14 @@ ndb_mgm_filter_clusterlog(NdbMgmHandle handle,
BaseString result;
reply->get("result", result);
- if(strcmp(result.c_str(), "1") == 0) {
+
+ if (strcmp(result.c_str(), "1") == 0)
+ retval = 1;
+ else if (strcmp(result.c_str(), "0") == 0)
retval = 0;
- } else {
+ else
+ {
SET_ERROR(handle, EINVAL, result.c_str());
- retval = -1;
}
delete reply;
return retval;
@@ -1056,15 +1105,18 @@ ndb_mgm_set_loglevel_clusterlog(NdbMgmHandle handle, int nodeId,
"set cluster loglevel", &args);
CHECK_REPLY(reply, -1);
+ DBUG_ENTER("ndb_mgm_set_loglevel_clusterlog");
+ DBUG_PRINT("enter",("node=%d, category=%d, level=%d", nodeId, cat, level));
+
BaseString result;
reply->get("result", result);
if(strcmp(result.c_str(), "Ok") != 0) {
SET_ERROR(handle, EINVAL, result.c_str());
delete reply;
- return -1;
+ DBUG_RETURN(-1);
}
delete reply;
- return 0;
+ DBUG_RETURN(0);
}
extern "C"
@@ -1496,7 +1548,8 @@ ndb_mgm_start(NdbMgmHandle handle, int no_of_nodes, const int * node_list)
*****************************************************************************/
extern "C"
int
-ndb_mgm_start_backup(NdbMgmHandle handle, unsigned int* _backup_id,
+ndb_mgm_start_backup(NdbMgmHandle handle, int wait_completed,
+ unsigned int* _backup_id,
struct ndb_mgm_reply* /*reply*/)
{
SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_start_backup");
@@ -1510,8 +1563,17 @@ ndb_mgm_start_backup(NdbMgmHandle handle, unsigned int* _backup_id,
CHECK_CONNECTED(handle, -1);
Properties args;
+ args.put("completed", wait_completed);
const Properties *reply;
- reply = ndb_mgm_call(handle, start_backup_reply, "start backup", &args);
+ { // start backup can take some time, set timeout high
+ Uint64 old_timeout= handle->read_timeout;
+ if (wait_completed == 2)
+ handle->read_timeout= 30*60*1000; // 30 minutes
+ else if (wait_completed == 1)
+ handle->read_timeout= 5*60*1000; // 5 minutes
+ reply = ndb_mgm_call(handle, start_backup_reply, "start backup", &args);
+ handle->read_timeout= old_timeout;
+ }
CHECK_REPLY(reply, -1);
BaseString result;
@@ -1693,6 +1755,9 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype)
{
CHECK_HANDLE(handle, 0);
CHECK_CONNECTED(handle, 0);
+ union { long l; char c[sizeof(long)]; } endian_check;
+
+ endian_check.l = 1;
int nodeid= handle->cfg._ownNodeId;
@@ -1703,6 +1768,7 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype)
args.put("user", "mysqld");
args.put("password", "mysqld");
args.put("public key", "a public key");
+ args.put("endian", (endian_check.c[sizeof(long)-1])?"big":"little");
const ParserRow<ParserDummy> reply[]= {
MGM_CMD("get nodeid reply", NULL, ""),
diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp
index 7ef62da9bb3..cbf7776fe06 100644
--- a/ndb/src/mgmclient/CommandInterpreter.cpp
+++ b/ndb/src/mgmclient/CommandInterpreter.cpp
@@ -110,7 +110,6 @@ public:
void executeRestart(int processId, const char* parameters, bool all);
void executeLogLevel(int processId, const char* parameters, bool all);
void executeError(int processId, const char* parameters, bool all);
- void executeTrace(int processId, const char* parameters, bool all);
void executeLog(int processId, const char* parameters, bool all);
void executeLogIn(int processId, const char* parameters, bool all);
void executeLogOut(int processId, const char* parameters, bool all);
@@ -154,7 +153,8 @@ private:
const char * param);
NdbMgmHandle m_mgmsrv;
- bool connected;
+ NdbMgmHandle m_mgmsrv2;
+ bool m_connected;
int m_verbose;
int try_reconnect;
int m_error;
@@ -163,6 +163,7 @@ private:
const char *rep_host;
bool rep_connected;
#endif
+ struct NdbThread* m_event_thread;
};
@@ -261,12 +262,13 @@ static const char* helpText =
"SHOW CONFIG Print configuration\n"
"SHOW PARAMETERS Print configuration parameters\n"
#endif
-"START BACKUP Start backup\n"
+"START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED]\n"
+" Start backup (default WAIT COMPLETED)\n"
"ABORT BACKUP <backup id> Abort backup\n"
-"SHUTDOWN Shutdown all processes in cluster and quit\n"
-"CLUSTERLOG ON Enable Cluster logging\n"
-"CLUSTERLOG OFF Disable Cluster logging\n"
-"CLUSTERLOG FILTER <severity> Toggle severity filter on/off\n"
+"SHUTDOWN Shutdown all processes in cluster\n"
+"CLUSTERLOG ON [<severity>] ... Enable Cluster logging\n"
+"CLUSTERLOG OFF [<severity>] ... Disable Cluster logging\n"
+"CLUSTERLOG TOGGLE [<severity>] ... Toggle severity filter on/off\n"
"CLUSTERLOG INFO Print cluster log information\n"
"<id> START Start DB node (started with -n)\n"
"<id> RESTART [-n] [-i] Restart DB node\n"
@@ -338,7 +340,6 @@ static const char* helpTextDebug =
#ifdef ERROR_INSERT
"<id> ERROR <errorNo> Inject error into NDB node\n"
#endif
-"<id> TRACE <traceNo> Set trace number\n"
"<id> LOG [BLOCK = {ALL|<block>+}] Set logging on in & out signals\n"
"<id> LOGIN [BLOCK = {ALL|<block>+}] Set logging on in signals\n"
"<id> LOGOUT [BLOCK = {ALL|<block>+}] Set logging on out signals\n"
@@ -386,13 +387,19 @@ CommandInterpreter::CommandInterpreter(const char *_host,int verbose)
ndbout_c("Cannot create handle to management server.");
exit(-1);
}
+ m_mgmsrv2 = ndb_mgm_create_handle();
+ if(m_mgmsrv2 == NULL) {
+ ndbout_c("Cannot create handle to management server.");
+ exit(-1);
+ }
if (ndb_mgm_set_connectstring(m_mgmsrv, _host))
{
printError();
exit(-1);
}
- connected = false;
+ m_connected= false;
+ m_event_thread= 0;
try_reconnect = 0;
#ifdef HAVE_GLOBAL_REPLICATION
rep_host = NULL;
@@ -406,8 +413,9 @@ CommandInterpreter::CommandInterpreter(const char *_host,int verbose)
*/
CommandInterpreter::~CommandInterpreter()
{
- connected = false;
+ disconnect();
ndb_mgm_destroy_handle(&m_mgmsrv);
+ ndb_mgm_destroy_handle(&m_mgmsrv2);
}
static bool
@@ -430,7 +438,10 @@ void
CommandInterpreter::printError()
{
if (ndb_mgm_check_connection(m_mgmsrv))
- connected= false;
+ {
+ m_connected= false;
+ disconnect();
+ }
ndbout_c("* %5d: %s",
ndb_mgm_get_latest_error(m_mgmsrv),
ndb_mgm_get_latest_error_msg(m_mgmsrv));
@@ -440,32 +451,109 @@ CommandInterpreter::printError()
//*****************************************************************************
//*****************************************************************************
-bool
+static int do_event_thread;
+static void*
+event_thread_run(void* m)
+{
+ NdbMgmHandle handle= *(NdbMgmHandle*)m;
+
+ my_thread_init();
+
+ int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 };
+ int fd = ndb_mgm_listen_event(handle, filter);
+ if (fd > 0)
+ {
+ do_event_thread= 1;
+ char *tmp= 0;
+ char buf[1024];
+ SocketInputStream in(fd,10);
+ do {
+ if (tmp == 0) NdbSleep_MilliSleep(10);
+ if((tmp = in.gets(buf, 1024)))
+ ndbout << tmp;
+ } while(do_event_thread);
+ }
+ else
+ {
+ do_event_thread= -1;
+ }
+
+ my_thread_end();
+ NdbThread_Exit(0);
+ return 0;
+}
+
+bool
CommandInterpreter::connect()
{
- if(!connected) {
+ if(!m_connected)
+ {
if(!ndb_mgm_connect(m_mgmsrv, try_reconnect-1, 5, 1))
{
- connected = true;
+ const char *host= ndb_mgm_get_connected_host(m_mgmsrv);
+ unsigned port= ndb_mgm_get_connected_port(m_mgmsrv);
+ if(!ndb_mgm_set_connectstring(m_mgmsrv2,
+ BaseString(host).appfmt(":%d",port).c_str())
+ &&
+ !ndb_mgm_connect(m_mgmsrv2, try_reconnect-1, 5, 1))
+ {
+ assert(m_event_thread == 0);
+ assert(do_event_thread == 0);
+ do_event_thread= 0;
+ m_event_thread = NdbThread_Create(event_thread_run,
+ (void**)&m_mgmsrv2,
+ 32768,
+ "CommandInterpreted_event_thread",
+ NDB_THREAD_PRIO_LOW);
+ if (m_event_thread != 0)
+ {
+ int iter= 1000; // try for 30 seconds
+ while(do_event_thread == 0 &&
+ iter-- > 0)
+ NdbSleep_MilliSleep(30);
+ }
+ if (m_event_thread == 0 ||
+ do_event_thread == 0 ||
+ do_event_thread == -1)
+ {
+ printf("Warning, event thread startup failed, degraded printouts as result\n");
+ do_event_thread= 0;
+ }
+ }
+ else
+ {
+ printf("Warning, event connect failed, degraded printouts as result\n");
+ }
+ m_connected= true;
if (m_verbose)
{
printf("Connected to Management Server at: %s:%d\n",
- ndb_mgm_get_connected_host(m_mgmsrv),
- ndb_mgm_get_connected_port(m_mgmsrv));
+ host, port);
}
}
}
- return connected;
+ return m_connected;
}
bool
CommandInterpreter::disconnect()
{
- if (connected && (ndb_mgm_disconnect(m_mgmsrv) == -1)) {
- ndbout_c("Could not disconnect from management server");
- printError();
+ if (m_event_thread) {
+ void *res;
+ do_event_thread= 0;
+ NdbThread_WaitFor(m_event_thread, &res);
+ NdbThread_Destroy(&m_event_thread);
+ m_event_thread= 0;
+ ndb_mgm_disconnect(m_mgmsrv2);
+ }
+ if (m_connected)
+ {
+ if (ndb_mgm_disconnect(m_mgmsrv) == -1) {
+ ndbout_c("Could not disconnect from management server");
+ printError();
+ }
+ m_connected= false;
}
- connected = false;
return true;
}
@@ -484,6 +572,13 @@ CommandInterpreter::execute(const char *_line, int _try_reconnect,
return result;
}
+static void
+invalid_command(const char *cmd)
+{
+ ndbout << "Invalid command: " << cmd << endl;
+ ndbout << "Type HELP for help." << endl << endl;
+}
+
int
CommandInterpreter::execute_impl(const char *_line)
{
@@ -493,16 +588,30 @@ CommandInterpreter::execute_impl(const char *_line)
char * line;
if(_line == NULL) {
- // ndbout << endl;
DBUG_RETURN(false);
}
line = my_strdup(_line,MYF(MY_WME));
My_auto_ptr<char> ptr(line);
-
- if (emptyString(line)) {
- DBUG_RETURN(true);
- }
-
+
+ int do_continue;
+ do {
+ do_continue= 0;
+ BaseString::trim(line," \t");
+ if (line[0] == 0 ||
+ line[0] == '#')
+ {
+ DBUG_RETURN(true);
+ }
+ // for mysql client compatability remove trailing ';'
+ {
+ unsigned last= strlen(line)-1;
+ if (line[last] == ';')
+ {
+ line[last]= 0;
+ do_continue= 1;
+ }
+ }
+ } while (do_continue);
// if there is anything in the line proceed
char* firstToken = strtok(line, " ");
char* allAfterFirstToken = strtok(NULL, "");
@@ -516,6 +625,11 @@ CommandInterpreter::execute_impl(const char *_line)
executeConnect(allAfterFirstToken);
DBUG_RETURN(true);
}
+ else if (strcasecmp(firstToken, "SLEEP") == 0) {
+ if (allAfterFirstToken)
+ sleep(atoi(allAfterFirstToken));
+ DBUG_RETURN(true);
+ }
else if((strcasecmp(firstToken, "QUIT") == 0 ||
strcasecmp(firstToken, "EXIT") == 0 ||
strcasecmp(firstToken, "BYE") == 0) &&
@@ -584,8 +698,7 @@ CommandInterpreter::execute_impl(const char *_line)
int nodeId;
if (! convert(firstToken, nodeId)) {
- ndbout << "Invalid command: " << _line << endl;
- ndbout << "Type HELP for help." << endl << endl;
+ invalid_command(_line);
DBUG_RETURN(true);
}
@@ -614,7 +727,6 @@ static const CommandInterpreter::CommandFunctionPair commands[] = {
#ifdef ERROR_INSERT
,{ "ERROR", &CommandInterpreter::executeError }
#endif
- ,{ "TRACE", &CommandInterpreter::executeTrace }
,{ "LOG", &CommandInterpreter::executeLog }
,{ "LOGIN", &CommandInterpreter::executeLogIn }
,{ "LOGOUT", &CommandInterpreter::executeLogOut }
@@ -634,12 +746,8 @@ CommandInterpreter::analyseAfterFirstToken(int processId,
char* allAfterFirstToken) {
if (emptyString(allAfterFirstToken)) {
- if (processId == -1) {
- ndbout << "Expected a command after ALL." << endl;
- }
- else {
- ndbout << "Expected a command after node ID." << endl;
- }
+ ndbout << "Expected a command after "
+ << ((processId == -1) ? "ALL." : "node ID.") << endl;
return;
}
@@ -658,19 +766,16 @@ CommandInterpreter::analyseAfterFirstToken(int processId,
}
if(fun == 0){
- ndbout << "Invalid command: " << secondToken << endl;
- ndbout << "Type HELP for help." << endl << endl;
+ invalid_command(secondToken);
return;
}
if(processId == -1){
executeForAll(command, fun, allAfterSecondToken);
} else {
- if(strcasecmp(command, "STATUS") != 0)
- ndbout_c("Executing %s on node %d.", command, processId);
(this->*fun)(processId, allAfterSecondToken, false);
- ndbout << endl;
}
+ ndbout << endl;
}
/**
@@ -733,12 +838,8 @@ CommandInterpreter::executeForAll(const char * cmd, ExecuteFunction fun,
return;
}
NdbAutoPtr<char> ap1((char*)cl);
- while(get_next_nodeid(cl, &nodeId, NDB_MGM_NODE_TYPE_NDB)) {
- if(strcasecmp(cmd, "STATUS") != 0)
- ndbout_c("Executing %s on node %d.", cmd, nodeId);
+ while(get_next_nodeid(cl, &nodeId, NDB_MGM_NODE_TYPE_NDB))
(this->*fun)(nodeId, allAfterSecondToken, true);
- ndbout << endl;
- } // while
}
}
@@ -846,8 +947,7 @@ CommandInterpreter::executeHelp(char* parameters)
ndbout << helpTextDebug;
#endif
} else {
- ndbout << "Invalid argument: " << parameters << endl;
- ndbout << "Type HELP for help." << endl << endl;
+ invalid_command(parameters);
}
}
@@ -901,7 +1001,8 @@ CommandInterpreter::executeShutdown(char* parameters)
return result;
}
- connected = false;
+ m_connected= false;
+ disconnect();
ndbout << "NDB Cluster management server shutdown." << endl;
return 0;
}
@@ -1137,144 +1238,130 @@ CommandInterpreter::executeConnect(char* parameters)
void
CommandInterpreter::executeClusterLog(char* parameters)
{
+ DBUG_ENTER("CommandInterpreter::executeClusterLog");
int i;
- if (parameters != 0 && strlen(parameters) != 0) {
- enum ndb_mgm_clusterlog_level severity = NDB_MGM_CLUSTERLOG_ALL;
- int isOk = true;
- char name[12];
- bool noArgs = false;
-
- char * tmpString = my_strdup(parameters,MYF(MY_WME));
- My_auto_ptr<char> ap1(tmpString);
- char * tmpPtr = 0;
- char * item = strtok_r(tmpString, " ", &tmpPtr);
+ if (emptyString(parameters))
+ {
+ ndbout << "Missing argument." << endl;
+ DBUG_VOID_RETURN;
+ }
+
+ enum ndb_mgm_clusterlog_level severity = NDB_MGM_CLUSTERLOG_ALL;
- /********************
- * CLUSTERLOG FILTER
- ********************/
- if (strcasecmp(item, "FILTER") == 0) {
-
- item = strtok_r(NULL, " ", &tmpPtr);
- if (item == NULL) {
- noArgs = true;
- }
- while (item != NULL) {
- snprintf(name, sizeof(name), item);
-
- if (strcasecmp(item, "ALL") == 0) {
- severity = NDB_MGM_CLUSTERLOG_ALL;
- } else if (strcasecmp(item, "ALERT") == 0) {
- severity = NDB_MGM_CLUSTERLOG_ALERT;
- } else if (strcasecmp(item, "CRITICAL") == 0) {
- severity = NDB_MGM_CLUSTERLOG_CRITICAL;
- } else if (strcasecmp(item, "ERROR") == 0) {
- severity = NDB_MGM_CLUSTERLOG_ERROR;
- } else if (strcasecmp(item, "WARNING") == 0) {
- severity = NDB_MGM_CLUSTERLOG_WARNING;
- } else if (strcasecmp(item, "INFO") == 0) {
- severity = NDB_MGM_CLUSTERLOG_INFO;
- } else if (strcasecmp(item, "DEBUG") == 0) {
- severity = NDB_MGM_CLUSTERLOG_DEBUG;
- } else if (strcasecmp(item, "OFF") == 0) {
- severity = NDB_MGM_CLUSTERLOG_OFF;
- } else {
- isOk = false;
- }
-
- item = strtok_r(NULL, " ", &tmpPtr);
- } // while(item != NULL){
-
- if (noArgs) {
- ndbout << "Missing argument(s)." << endl;
- } else if (isOk) {
- if(ndb_mgm_filter_clusterlog(m_mgmsrv, severity, NULL)) {
- if(strcasecmp(name, "ALL") == 0) {
- ndbout << "All severities levels enabled." << endl;
- } else if(strcasecmp(name, "OFF") == 0) {
- ndbout << "Cluster logging enabled." << endl;
- } else {
- ndbout << name << " events disabled." << endl;
- }
- } else {
- if(strcasecmp(name, "ALL") == 0) {
- ndbout << "All severities levels disabled." << endl;
- } else if(strcasecmp(name, "OFF") == 0) {
- ndbout << "Cluster logging disabled." << endl;
- } else {
- ndbout << name << " events enabled." << endl;
- }
- }
- } else {
- ndbout << "Invalid severity level." << endl;
- }
+ char * tmpString = my_strdup(parameters,MYF(MY_WME));
+ My_auto_ptr<char> ap1(tmpString);
+ char * tmpPtr = 0;
+ char * item = strtok_r(tmpString, " ", &tmpPtr);
+ int enable;
- /********************
- * CLUSTERLOG INFO
- ********************/
- } else if (strcasecmp(item, "INFO") == 0) {
- Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv);
- if(enabled == NULL) {
- ndbout << "Couldn't get status" << endl;
- printError();
- return;
- }
- const char* names[] = {"ENABLED", "DEBUG", "INFO", "WARNING", "ERROR",
- "CRITICAL", "ALERT"};
- if(enabled[0])
- ndbout << "Cluster logging is disabled." << endl;
+ Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv);
+ if(enabled == NULL) {
+ ndbout << "Couldn't get status" << endl;
+ printError();
+ DBUG_VOID_RETURN;
+ }
-
- for(i = 0; i<7;i++)
- printf("enabled[%d] = %d\n", i, enabled[i]);
- ndbout << "Severities enabled: ";
- for(i = 1; i < 7; i++) {
- if(enabled[i])
- ndbout << names[i] << " ";
- }
- ndbout << endl;
-
- /********************
- * CLUSTERLOG OFF
- ********************/
- } else if (strcasecmp(item, "OFF") == 0) {
- Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv);
- if(enabled == NULL) {
- ndbout << "Couldn't get status" << endl;
- printError();
- return;
- }
- if(!enabled[0]) {
- ndb_mgm_filter_clusterlog(m_mgmsrv, NDB_MGM_CLUSTERLOG_OFF, NULL);
- ndbout << "Cluster logging is disabled." << endl;
- } else {
- ndbout << "Cluster logging is already disabled." << endl;
-
- }
-
- /********************
- * CLUSTERLOG ON
- ********************/
- } else if (strcasecmp(item, "ON") == 0) {
- Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv);
- if(enabled == NULL) {
- ndbout << "Could not get status" << endl;
- printError();
- return;
- }
- if(enabled[0]) {
- ndb_mgm_filter_clusterlog(m_mgmsrv, NDB_MGM_CLUSTERLOG_OFF, NULL);
- ndbout << "Cluster logging is enabled." << endl;
- } else {
- ndbout << "Cluster logging is already enabled." << endl;
-
+ /********************
+ * CLUSTERLOG INFO
+ ********************/
+ if (strcasecmp(item, "INFO") == 0) {
+ DBUG_PRINT("info",("INFO"));
+ if(enabled[0] == 0)
+ {
+ ndbout << "Cluster logging is disabled." << endl;
+ DBUG_VOID_RETURN;
+ }
+#if 0
+ for(i = 0; i<7;i++)
+ printf("enabled[%d] = %d\n", i, enabled[i]);
+#endif
+ ndbout << "Severities enabled: ";
+ for(i = 1; i < (int)NDB_MGM_CLUSTERLOG_ALL; i++) {
+ const char *str= ndb_mgm_get_clusterlog_level_string((ndb_mgm_clusterlog_level)i);
+ if (str == 0)
+ {
+ DBUG_ASSERT(false);
+ continue;
}
- } else {
- ndbout << "Invalid argument." << endl;
+ if(enabled[i])
+ ndbout << BaseString(str).ndb_toupper() << " ";
}
-
+ ndbout << endl;
+ DBUG_VOID_RETURN;
+
+ }
+ else if (strcasecmp(item, "FILTER") == 0 ||
+ strcasecmp(item, "TOGGLE") == 0)
+ {
+ DBUG_PRINT("info",("TOGGLE"));
+ enable= -1;
+ }
+ else if (strcasecmp(item, "OFF") == 0)
+ {
+ DBUG_PRINT("info",("OFF"));
+ enable= 0;
+ } else if (strcasecmp(item, "ON") == 0) {
+ DBUG_PRINT("info",("ON"));
+ enable= 1;
} else {
- ndbout << "Missing argument." << endl;
+ ndbout << "Invalid argument." << endl;
+ DBUG_VOID_RETURN;
}
+
+ int res_enable;
+ item = strtok_r(NULL, " ", &tmpPtr);
+ if (item == NULL) {
+ res_enable= ndb_mgm_filter_clusterlog(m_mgmsrv,
+ NDB_MGM_CLUSTERLOG_ON, enable, NULL);
+ if (res_enable < 0)
+ {
+ ndbout << "Couldn't set filter" << endl;
+ printError();
+ DBUG_VOID_RETURN;
+ }
+ ndbout << "Cluster logging is " << (res_enable ? "enabled.":"disabled") << endl;
+ DBUG_VOID_RETURN;
+ }
+
+ do {
+ severity= NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL;
+ if (strcasecmp(item, "ALL") == 0) {
+ severity = NDB_MGM_CLUSTERLOG_ALL;
+ } else if (strcasecmp(item, "ALERT") == 0) {
+ severity = NDB_MGM_CLUSTERLOG_ALERT;
+ } else if (strcasecmp(item, "CRITICAL") == 0) {
+ severity = NDB_MGM_CLUSTERLOG_CRITICAL;
+ } else if (strcasecmp(item, "ERROR") == 0) {
+ severity = NDB_MGM_CLUSTERLOG_ERROR;
+ } else if (strcasecmp(item, "WARNING") == 0) {
+ severity = NDB_MGM_CLUSTERLOG_WARNING;
+ } else if (strcasecmp(item, "INFO") == 0) {
+ severity = NDB_MGM_CLUSTERLOG_INFO;
+ } else if (strcasecmp(item, "DEBUG") == 0) {
+ severity = NDB_MGM_CLUSTERLOG_DEBUG;
+ } else if (strcasecmp(item, "OFF") == 0 ||
+ strcasecmp(item, "ON") == 0) {
+ if (enable < 0) // only makes sense with toggle
+ severity = NDB_MGM_CLUSTERLOG_ON;
+ }
+ if (severity == NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL) {
+ ndbout << "Invalid severity level: " << item << endl;
+ DBUG_VOID_RETURN;
+ }
+
+ res_enable = ndb_mgm_filter_clusterlog(m_mgmsrv, severity, enable, NULL);
+ if (res_enable < 0)
+ {
+ ndbout << "Couldn't set filter" << endl;
+ printError();
+ DBUG_VOID_RETURN;
+ }
+ ndbout << BaseString(item).ndb_toupper().c_str() << " " << (res_enable ? "enabled":"disabled") << endl;
+
+ item = strtok_r(NULL, " ", &tmpPtr);
+ } while(item != NULL);
+
+ DBUG_VOID_RETURN;
}
//*****************************************************************************
@@ -1404,7 +1491,7 @@ CommandInterpreter::executeRestart(int processId, const char* parameters,
if(all)
ndbout << "NDB Cluster is being restarted." << endl;
else
- ndbout_c("Database node %d is being restarted.", processId);
+ ndbout_c("Node %d is being restarted.", processId);
}
}
@@ -1451,7 +1538,7 @@ CommandInterpreter::executeStatus(int processId,
const char* parameters, bool all)
{
if (! emptyString(parameters)) {
- ndbout << "No parameters expected to this command." << endl;
+ ndbout_c("No parameters expected to this command.");
return;
}
@@ -1482,7 +1569,7 @@ CommandInterpreter::executeStatus(int processId,
ndbout << "Node " << processId << ": " << status_string(status);
switch(status){
case NDB_MGM_NODE_STATUS_STARTING:
- ndbout << " (Phase " << startPhase << ")" ;
+ ndbout << " (Phase " << startPhase << ")";
break;
case NDB_MGM_NODE_STATUS_SHUTTING_DOWN:
ndbout << " (Phase " << startPhase << ")";
@@ -1495,6 +1582,8 @@ CommandInterpreter::executeStatus(int processId,
getMajor(version) ,
getMinor(version),
getBuild(version));
+ else
+ ndbout << endl;
}
@@ -1506,7 +1595,10 @@ CommandInterpreter::executeLogLevel(int processId, const char* parameters,
bool all)
{
(void) all;
-
+ if (emptyString(parameters)) {
+ ndbout << "Expected argument" << endl;
+ return;
+ }
BaseString tmp(parameters);
Vector<BaseString> spec;
tmp.split(spec, "=");
@@ -1532,6 +1624,8 @@ CommandInterpreter::executeLogLevel(int processId, const char* parameters,
return;
}
+ ndbout << "Executing LOGLEVEL on node " << processId << flush;
+
struct ndb_mgm_reply reply;
int result;
result = ndb_mgm_set_loglevel_node(m_mgmsrv,
@@ -1541,11 +1635,10 @@ CommandInterpreter::executeLogLevel(int processId, const char* parameters,
&reply);
if (result < 0) {
- ndbout_c("Executing LOGLEVEL on node %d failed.", processId);
+ ndbout_c(" failed.");
printError();
} else {
- ndbout << "Executing LOGLEVEL on node " << processId << " OK!"
- << endl;
+ ndbout_c(" OK!");
}
}
@@ -1582,42 +1675,6 @@ void CommandInterpreter::executeError(int processId,
//*****************************************************************************
//*****************************************************************************
-void
-CommandInterpreter::executeTrace(int /*processId*/,
- const char* /*parameters*/, bool /*all*/)
-{
-#if 0
- if (emptyString(parameters)) {
- ndbout << "Missing trace number." << endl;
- return;
- }
-
- char* newpar = my_strdup(parameters,MYF(MY_WME));
- My_auto_ptr<char> ap1(newpar);
- char* firstParameter = strtok(newpar, " ");
-
-
- int traceNo;
- if (! convert(firstParameter, traceNo)) {
- ndbout << "Expected an integer." << endl;
- return;
- }
- char* allAfterFirstParameter = strtok(NULL, "\0");
-
- if (! emptyString(allAfterFirstParameter)) {
- ndbout << "Nothing expected after trace number." << endl;
- return;
- }
-
- int result = _mgmtSrvr.setTraceNo(processId, traceNo);
- if (result != 0) {
- ndbout << get_error_text(result) << endl;
- }
-#endif
-}
-
-//*****************************************************************************
-//*****************************************************************************
void
CommandInterpreter::executeLog(int processId,
@@ -1840,36 +1897,36 @@ CommandInterpreter::executeEventReporting(int processId,
spec[0].trim().ndb_toupper();
int category = ndb_mgm_match_event_category(spec[0].c_str());
if(category == NDB_MGM_ILLEGAL_EVENT_CATEGORY){
- category = atoi(spec[0].c_str());
- if(category < NDB_MGM_MIN_EVENT_CATEGORY ||
+ if(!convert(spec[0].c_str(), category) ||
+ category < NDB_MGM_MIN_EVENT_CATEGORY ||
category > NDB_MGM_MAX_EVENT_CATEGORY){
ndbout << "Unknown category: \"" << spec[0].c_str() << "\"" << endl;
return;
}
}
-
- int level = atoi(spec[1].c_str());
- if(level < 0 || level > 15){
+
+ int level;
+ if (!convert(spec[1].c_str(),level))
+ {
ndbout << "Invalid level: " << spec[1].c_str() << endl;
return;
}
-
+
+ ndbout << "Executing CLUSTERLOG on node " << processId << flush;
struct ndb_mgm_reply reply;
int result;
-
result = ndb_mgm_set_loglevel_clusterlog(m_mgmsrv,
- processId, // fast fix - pekka
+ processId,
(ndb_mgm_event_category)category,
level,
&reply);
if (result != 0) {
- ndbout_c("Executing CLUSTERLOG on node %d failed", processId);
+ ndbout_c(" failed.");
printError();
} else {
- ndbout << "Executing CLUSTERLOG on node " << processId << " OK!"
- << endl;
+ ndbout_c(" OK!");
}
}
@@ -1877,21 +1934,68 @@ CommandInterpreter::executeEventReporting(int processId,
* Backup
*****************************************************************************/
int
-CommandInterpreter::executeStartBackup(char* /*parameters*/)
+CommandInterpreter::executeStartBackup(char* parameters)
{
struct ndb_mgm_reply reply;
unsigned int backupId;
-
+#if 0
int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 };
int fd = ndb_mgm_listen_event(m_mgmsrv, filter);
- int result = ndb_mgm_start_backup(m_mgmsrv, &backupId, &reply);
+ if (fd < 0)
+ {
+ ndbout << "Initializing start of backup failed" << endl;
+ printError();
+ return fd;
+ }
+#endif
+ Vector<BaseString> args;
+ {
+ BaseString(parameters).split(args);
+ for (unsigned i= 0; i < args.size(); i++)
+ if (args[i].length() == 0)
+ args.erase(i--);
+ else
+ args[i].ndb_toupper();
+ }
+ int sz= args.size();
+
+ int result;
+ if (sz == 2 &&
+ args[1] == "NOWAIT")
+ {
+ result = ndb_mgm_start_backup(m_mgmsrv, 0, &backupId, &reply);
+ }
+ else if (sz == 1 ||
+ (sz == 3 &&
+ args[1] == "WAIT" &&
+ args[2] == "COMPLETED"))
+ {
+ ndbout_c("Waiting for completed, this may take several minutes");
+ result = ndb_mgm_start_backup(m_mgmsrv, 2, &backupId, &reply);
+ }
+ else if (sz == 3 &&
+ args[1] == "WAIT" &&
+ args[2] == "STARTED")
+ {
+ ndbout_c("Waiting for started, this may take several minutes");
+ result = ndb_mgm_start_backup(m_mgmsrv, 1, &backupId, &reply);
+ }
+ else
+ {
+ invalid_command(parameters);
+ return -1;
+ }
+
if (result != 0) {
ndbout << "Start of backup failed" << endl;
printError();
+#if 0
close(fd);
+#endif
return result;
}
-
+#if 0
+ ndbout_c("Waiting for completed, this may take several minutes");
char *tmp;
char buf[1024];
{
@@ -1918,29 +2022,39 @@ CommandInterpreter::executeStartBackup(char* /*parameters*/)
ndbout << tmp;
}
} while(tmp && tmp[0] != 0);
-
+
close(fd);
+#endif
return 0;
}
void
CommandInterpreter::executeAbortBackup(char* parameters)
{
- strtok(parameters, " ");
- struct ndb_mgm_reply reply;
- char* id = strtok(NULL, "\0");
int bid = -1;
- if(id == 0 || sscanf(id, "%d", &bid) != 1){
- ndbout << "Invalid arguments: expected <BackupId>" << endl;
- return;
+ struct ndb_mgm_reply reply;
+ if (emptyString(parameters))
+ goto executeAbortBackupError1;
+
+ {
+ strtok(parameters, " ");
+ char* id = strtok(NULL, "\0");
+ if(id == 0 || sscanf(id, "%d", &bid) != 1)
+ goto executeAbortBackupError1;
}
- int result = ndb_mgm_abort_backup(m_mgmsrv, bid, &reply);
- if (result != 0) {
- ndbout << "Abort of backup " << bid << " failed" << endl;
- printError();
- } else {
- ndbout << "Abort of backup " << bid << " ordered" << endl;
+ {
+ int result= ndb_mgm_abort_backup(m_mgmsrv, bid, &reply);
+ if (result != 0) {
+ ndbout << "Abort of backup " << bid << " failed" << endl;
+ printError();
+ } else {
+ ndbout << "Abort of backup " << bid << " ordered" << endl;
+ }
}
+ return;
+ executeAbortBackupError1:
+ ndbout << "Invalid arguments: expected <BackupId>" << endl;
+ return;
}
#ifdef HAVE_GLOBAL_REPLICATION
diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp
index 84e27790705..9417c03805f 100644
--- a/ndb/src/mgmclient/main.cpp
+++ b/ndb/src/mgmclient/main.cpp
@@ -56,9 +56,13 @@ handler(int sig){
}
}
+enum ndb_mgm_options {
+ NDB_STD_OPTS_OPTIONS
+};
+NDB_STD_OPTS_VARS;
+
static const char default_prompt[]= "ndb_mgm> ";
static unsigned _try_reconnect;
-static char *opt_connect_str= 0;
static const char *prompt= default_prompt;
static char *opt_execute_str= 0;
diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp
index 0ce24cc81d2..686155415d5 100644
--- a/ndb/src/mgmsrv/CommandInterpreter.cpp
+++ b/ndb/src/mgmsrv/CommandInterpreter.cpp
@@ -30,64 +30,10 @@
#include <version.h>
#include <m_string.h>
-static const char* helpTexts[] = {
- "HELP Print help text",
- "HELP SHOW Help for the SHOW command",
-#ifdef VM_TRACE // DEBUG ONLY
- "HELP DEBUG Help for debug compiled version",
-#endif
- "SHOW Print information about cluster",
- "SHOW CONFIG Print configuration",
- "SHOW PARAMETERS Print configuration parameters",
- "START BACKUP Start backup\n"
- "ABORT BACKUP <backup id> Aborts backup\n"
- "CLUSTERLOG ON Enable Cluster logging",
- "CLUSTERLOG OFF Disable Cluster logging",
- "CLUSTERLOG FILTER <severity> Toggle severity filter on/off",
- "CLUSTERLOG INFO Print cluster log information",
- "{<id>|ALL} START Start DB node (started with -n)",
- "{<id>|ALL} RESTART [-n] [-i] Restart DB node",
- "{<id>|ALL} STOP Stop DB node",
- "{<id>|ALL} STATUS Print status",
- "{<id>|ALL} CLUSTERLOG {<category>=<level>}+ Set log level for cluster log",
- "QUIT Quit management server",
-};
-static const unsigned noOfHelpTexts = sizeof(helpTexts)/sizeof(const char*);
-
-static const char* helpTextShow =
-"SHOW prints NDB Cluster information\n\n"
-"SHOW Print information about cluster\n"
-"SHOW CONFIG Print configuration (in initial config file format)\n"
-"SHOW PARAMETERS Print information about configuration parameters\n\n"
-;
-
-#ifdef VM_TRACE // DEBUG ONLY
-static const char* helpTextDebug =
-"SHOW PROPERTIES Print config properties object\n"
-"{<id>|ALL} LOGLEVEL {<category>=<level>}+ Set log level\n"
-"{<id>|ALL} ERROR <errorNo> Inject error into NDB node\n"
-"{<id>|ALL} TRACE <traceNo> Set trace number\n"
-"{<id>|ALL} LOG [BLOCK = {ALL|<block>+}] Set logging on in & out signals\n"
-"{<id>|ALL} LOGIN [BLOCK = {ALL|<block>+}] Set logging on in signals\n"
-"{<id>|ALL} LOGOUT [BLOCK = {ALL|<block>+}] Set logging on out signals\n"
-"{<id>|ALL} LOGOFF [BLOCK = {ALL|<block>+}] Unset signal logging\n"
-"{<id>|ALL} TESTON Start signal logging\n"
-"{<id>|ALL} TESTOFF Stop signal logging\n"
-"{<id>|ALL} SET <configParamName> <value> Update configuration variable\n"
-"{<id>|ALL} DUMP <arg> Dump system state to cluster.log\n"
-"{<id>|ALL} GETSTAT Print statistics\n"
-"\n"
-;
-#endif
-
-
-
//******************************************************************************
//******************************************************************************
CommandInterpreter::CommandInterpreter(MgmtSrvr& mgmtSrvr) :
_mgmtSrvr(mgmtSrvr) {
-
- // _mgmtSrvr.setCallback(CmdBackupCallback);
}
@@ -145,52 +91,7 @@ int CommandInterpreter::readAndExecute() {
char* firstToken = strtok(line, " ");
char* allAfterFirstToken = strtok(NULL, "\0");
- if (strcmp(firstToken, "HELP") == 0) {
- executeHelp(allAfterFirstToken);
- return true;
- }
- else if (strcmp(firstToken, "?") == 0) {
- executeHelp(allAfterFirstToken);
- return true;
- }
- else if (strcmp(firstToken, "SHOW") == 0) {
- executeShow(allAfterFirstToken);
- return true;
- }
- else if (strcmp(firstToken, "CLUSTERLOG") == 0) {
- executeClusterLog(allAfterFirstToken);
- return true;
- }
- else if(strcmp(firstToken, "START") == 0 &&
- allAfterFirstToken != 0 &&
- strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){
- executeStartBackup(allAfterFirstToken);
- return true;
- }
- else if(strcmp(firstToken, "ABORT") == 0 &&
- allAfterFirstToken != 0 &&
- strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){
- executeAbortBackup(allAfterFirstToken);
- return true;
- }
-
- else if(strcmp(firstToken, "ENTER") == 0 &&
- allAfterFirstToken != 0 &&
- strncmp(allAfterFirstToken, "SINGLE USER MODE ",
- sizeof("SINGLE USER MODE") - 1) == 0){
- executeEnterSingleUser(allAfterFirstToken);
- return true;
- }
-
- else if(strcmp(firstToken, "EXIT") == 0 &&
- allAfterFirstToken != 0 &&
- strncmp(allAfterFirstToken, "SINGLE USER MODE ",
- sizeof("SINGLE USER MODE") - 1) == 0){
- executeExitSingleUser(allAfterFirstToken);
- return true;
- }
-
- else if (strcmp(firstToken, "ALL") == 0) {
+ if (strcmp(firstToken, "ALL") == 0) {
analyseAfterFirstToken(-1, allAfterFirstToken);
}
else if(strcmp(firstToken, "QUIT") == 0 ||
@@ -203,7 +104,6 @@ int CommandInterpreter::readAndExecute() {
int processId;
if (! convert(firstToken, processId)) {
ndbout << "Invalid command: " << _line << "." << endl;
- ndbout << "Type HELP for help." << endl << endl;
return true;
}
if (processId < 0) {
@@ -219,24 +119,10 @@ int CommandInterpreter::readAndExecute() {
static const CommandInterpreter::CommandFunctionPair commands[] = {
- { "START", &CommandInterpreter::executeStart }
- ,{ "RESTART", &CommandInterpreter::executeRestart }
- ,{ "STOP", &CommandInterpreter::executeStop }
- ,{ "STATUS", &CommandInterpreter::executeStatus }
- ,{ "LOGLEVEL", &CommandInterpreter::executeLogLevel }
-#ifdef ERROR_INSERT
- ,{ "ERROR", &CommandInterpreter::executeError }
-#endif
- ,{ "TRACE", &CommandInterpreter::executeTrace }
- ,{ "LOG", &CommandInterpreter::executeLog }
+ { "TRACE", &CommandInterpreter::executeTrace }
,{ "LOGIN", &CommandInterpreter::executeLogIn }
,{ "LOGOUT", &CommandInterpreter::executeLogOut }
,{ "LOGOFF", &CommandInterpreter::executeLogOff }
- ,{ "TESTON", &CommandInterpreter::executeTestOn }
- ,{ "TESTOFF", &CommandInterpreter::executeTestOff }
- ,{ "CLUSTERLOG", &CommandInterpreter::executeEventReporting }
- ,{ "DUMP", &CommandInterpreter::executeDumpState }
- ,{ "JONAS", &CommandInterpreter::jonas }
};
@@ -273,16 +159,14 @@ CommandInterpreter::analyseAfterFirstToken(int processId,
if(fun == 0){
ndbout << "Invalid command: " << secondToken << "." << endl;
- ndbout << "Type HELP for help." << endl << endl;
return;
}
if(processId == -1){
executeForAll(command, fun, allAfterSecondToken);
} else {
- if(strcmp(command, "STATUS") != 0)
- ndbout << "Executing " << command << " on node: "
- << processId << endl << endl;
+ ndbout << "Executing " << command << " on node: "
+ << processId << endl << endl;
(this->*fun)(processId, allAfterSecondToken, false);
ndbout << endl;
}
@@ -293,18 +177,11 @@ CommandInterpreter::executeForAll(const char * cmd, ExecuteFunction fun,
const char * allAfterSecondToken){
NodeId nodeId = 0;
- if(strcmp(cmd, "STOP") == 0 ||
- strcmp(cmd, "RESTART") == 0){
- ndbout << "Executing " << cmd << " on all nodes" << endl << "\n";
+ while(_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){
+ ndbout << "Executing " << cmd << " on node: "
+ << nodeId << endl << endl;
(this->*fun)(nodeId, allAfterSecondToken, true);
- } else {
- while(_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){
- if(strcmp(cmd, "STATUS") != 0)
- ndbout << "Executing " << cmd << " on node: "
- << nodeId << endl << endl;
- (this->*fun)(nodeId, allAfterSecondToken, true);
- ndbout << endl;
- } // for
+ ndbout << endl;
}
}
@@ -374,623 +251,6 @@ bool CommandInterpreter::parseBlockSpecification(const char* allAfterLog,
return true;
}
-
-
-//******************************************************************************
-//******************************************************************************
-void CommandInterpreter::executeHelp(char* parameters) {
-
- (void)parameters; // Don't want compiler warning
-
- if (emptyString(parameters)) {
- unsigned i;
- for (i = 0; i<noOfHelpTexts; i++) {
- ndbout << helpTexts[i] << endl;
- }
-
- ndbout << endl
- << "<severity> = "
- << "ALERT | CRITICAL | ERROR | WARNING | INFO | DEBUG"
- << endl;
-
- ndbout << "<category> = ";
- for(i = 0; i<CFG_MIN_LOGLEVEL; i++){
- ndbout << ndb_mgm_get_event_category_string((ndb_mgm_event_category)i);
- if (i < CFG_MIN_LOGLEVEL - 1) {
- ndbout << " | ";
- }
- }
- ndbout << endl;
-
- ndbout << "<level> = " << "0 - 15"
- << endl;
-
- ndbout << endl;
- } else if (strcmp(parameters, "SHOW") == 0) {
- ndbout << helpTextShow;
-#ifdef VM_TRACE // DEBUG ONLY
- } else if (strcmp(parameters, "DEBUG") == 0) {
- ndbout << helpTextDebug;
-#endif
- } else {
- ndbout << "Invalid argument." << endl;
- }
-}
-
-//*****************************************************************************
-//*****************************************************************************
-
-void CommandInterpreter::executeShow(char* parameters) {
-
- if (emptyString(parameters)) {
- ndbout << "Cluster Configuration" << endl
- << "---------------------" << endl;
-
- NodeId nodeId = 0;
- ndbout << _mgmtSrvr.getNodeCount(NDB_MGM_NODE_TYPE_NDB)
- << " NDB Node(s) with"
- << endl;
- while (_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){
- ndbout << " Node Id = " << nodeId << endl;
- }
- ndbout << endl;
-
- nodeId = 0;
- ndbout << _mgmtSrvr.getNodeCount(NDB_MGM_NODE_TYPE_API)
- << " API Node(s) with"
- << endl;
- while (_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_API)){
- ndbout << " Node Id = " << nodeId << endl;
- }
- ndbout << endl;
-
- nodeId = 0;
- ndbout << _mgmtSrvr.getNodeCount(NDB_MGM_NODE_TYPE_MGM)
- << " MGM Node(s) with"
- << endl;
- while (_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_MGM)){
- ndbout << " Node Id = " << nodeId << endl;
- }
- ndbout << endl;
-
- ndbout << helpTextShow;
-
- return;
- } else if (strcmp(parameters, "PROPERTIES") == 0 ||
- strcmp(parameters, "PROP") == 0) {
- ndbout << "_mgmtSrvr.getConfig()->print();" << endl; /* XXX */
- } else if (strcmp(parameters, "CONFIGURATION") == 0 ||
- strcmp(parameters, "CONFIG") == 0){
- ndbout << "_mgmtSrvr.getConfigFile()->print();" << endl; /* XXX */
- _mgmtSrvr.getConfig()->printConfigFile();
- } else if (strcmp(parameters, "PARAMETERS") == 0 ||
- strcmp(parameters, "PARAMS") == 0 ||
- strcmp(parameters, "PARAM") == 0) {
- ndbout << "_mgmtSrvr.getConfigInfo()->print();" << endl; /* XXX */
- } else {
- ndbout << "Invalid argument." << endl;
- }
-}
-
-
-//*****************************************************************************
-//*****************************************************************************
-void CommandInterpreter::executeClusterLog(char* parameters) {
-
- if (parameters != 0 && strlen(parameters) != 0) {
- int severity = 7;
- int isOk = true;
- char name[12];
- bool noArgs = false;
-
- char * tmpString = strdup(parameters);
- char * tmpPtr = 0;
- char * item = strtok_r(tmpString, " ", &tmpPtr);
-
- /********************
- * CLUSTERLOG FILTER
- ********************/
- if (strcmp(item, "FILTER") == 0) {
-
- item = strtok_r(NULL, " ", &tmpPtr);
- if (item == NULL) {
- noArgs = true;
- }
- while (item != NULL) {
- BaseString::snprintf(name, 12, item);
-
- if (strcmp(item, "ALL") == 0) {
- severity = 7;
- } else if (strcmp(item, "ALERT") == 0) {
- severity = 6;
- } else if (strcmp(item, "CRITICAL") == 0) {
- severity = 5;
- } else if (strcmp(item, "ERROR") == 0) {
- severity = 4;
- } else if (strcmp(item, "WARNING") == 0) {
- severity = 3;
- } else if (strcmp(item, "INFO") == 0) {
- severity = 2;
- } else if (strcmp(item, "DEBUG") == 0) {
- severity = 1;
- } else if (strcmp(item, "OFF") == 0) {
- severity = 0;
- } else {
- isOk = false;
- }
-
- item = strtok_r(NULL, " ", &tmpPtr);
- } // while(item != NULL){
- free(tmpString);
-
- if (noArgs) {
- ndbout << "Missing argument(s)." << endl;
- } else if (isOk) {
- if (_mgmtSrvr.setEventLogFilter(severity)) {
- if(strcmp(name, "ALL") == 0 || strcmp(name, "all") == 0) {
- ndbout << "All severities levels enabled." << endl;
- } else if(strcmp(name, "OFF") == 0 || strcmp(name, "off") == 0) {
- ndbout << "Cluster logging disabled." << endl;
- } else {
- ndbout << name << " events enabled." << endl;
- }
- } else {
- if(strcmp(name, "ALL") == 0) {
- ndbout << "All severities levels disabled." << endl;
- } else if(strcmp(name, "OFF") == 0) {
- ndbout << "Cluster logging enabled." << endl;
- } else {
- ndbout << name << " events disabled." << endl;
- }
- }
- } else {
- ndbout << "Invalid severity level." << endl;
- }
-
- /********************
- * CLUSTERLOG INFO
- ********************/
- } else if (strcmp(item, "INFO") == 0) {
- const char* names[] = {"DEBUG", "INFO", "WARNING", "ERROR",
- "CRITICAL", "ALERT"};
- if (_mgmtSrvr.isEventLogFilterEnabled(0)) { // OFF
- ndbout << "Cluster logging is disabled." << endl;
- }
-
- ndbout << "Severities enabled: ";
- for (int i = 0; i < 6; i++) {
- if (_mgmtSrvr.isEventLogFilterEnabled(i + 1)) {
- ndbout << names[i] << " ";
- }
- }
- ndbout << endl;
-
- /********************
- * CLUSTERLOG OFF
- ********************/
- } else if (strcmp(item, "OFF") == 0) {
- if (!_mgmtSrvr.isEventLogFilterEnabled(0)) { // ON
- if (_mgmtSrvr.setEventLogFilter(0));
- ndbout << "Cluster logging is disabled." << endl;
- } else {
- ndbout << "Cluster logging is already disabled." << endl;
- }
-
- /********************
- * CLUSTERLOG ON
- ********************/
- } else if (strcmp(item, "ON") == 0) {
- if (_mgmtSrvr.isEventLogFilterEnabled(0)) { // OFF
- if (_mgmtSrvr.setEventLogFilter(0));
- ndbout << "Cluster logging is enabled." << endl;
- } else {
- ndbout << "Cluster logging is already enabled." << endl;
- }
-
- } else {
- ndbout << "Invalid argument." << endl;
- }
-
- } else {
- ndbout << "Missing argument." << endl;
- }
-}
-
-void
-stopCallback(int nodeId, void * anyData, int errCode){
- if(errCode == 0){
- if(nodeId == 0)
- ndbout << "\nCluster has shutdown" << endl;
- else
- ndbout << "\nNode " << nodeId << " has shutdown" << endl;
- } else {
- MgmtSrvr * mgm = (MgmtSrvr *)anyData;
- char err_str[1024];
- ndbout << "Node " << nodeId << " has not shutdown: "
- << mgm->getErrorText(errCode,err_str,sizeof(err_str)) << endl;
- }
-}
-
-void
-versionCallback(int nodeId, int version, void * anyData, int errCode){
- if(errCode == 0){
- MgmtSrvr * mgm = (MgmtSrvr *)anyData;
- switch(mgm->getNodeType(nodeId)){
- case NDB_MGM_NODE_TYPE_MGM:
- {
- ndbout << "MGMT node:\t" << nodeId << " ";
- ndbout_c(" (Version %d.%d.%d)",
- getMajor(version) ,
- getMinor(version),
- getBuild(version));
- }
- break;
- case NDB_MGM_NODE_TYPE_NDB:
- {
- ndbout << "DB node:\t" << nodeId << " ";
- if(version == 0)
- ndbout << "(no version information available)" << endl;
- else {
- ndbout_c(" (Version %d.%d.%d)",
- getMajor(version) ,
- getMinor(version),
- getBuild(version));
- }
- }
- break;
- case NDB_MGM_NODE_TYPE_API:
- {
- ndbout << "API node:\t" << nodeId << " ";
- if(version == 0)
- ndbout << "(no version information available)" << endl;
- else {
- ndbout_c(" (Version %d.%d.%d)",
- getMajor(version) ,
- getMinor(version),
- getBuild(version));
- }
-
- }
- break;
- case NDB_MGM_NODE_TYPE_UNKNOWN:
- case NDB_MGM_NODE_TYPE_REP:
- abort();
- };
-
- } else {
- MgmtSrvr * mgm = (MgmtSrvr *)anyData;
- char err_str[1024];
- ndbout << mgm->getErrorText(errCode,err_str,sizeof(err_str)) << endl;
- }
-}
-
-//*****************************************************************************
-//*****************************************************************************
-void CommandInterpreter::executeStop(int processId,
- const char* parameters, bool all) {
-
- (void)parameters; // Don't want compiler warning
-
- int result = 0;
- if(all)
- result = _mgmtSrvr.stop((int *)0, false, stopCallback, this);
- else
- result = _mgmtSrvr.stopNode(processId, false, stopCallback, this);
-
- if(result != 0)
- ndbout << get_error_text(result) << endl;
-}
-
-
-void CommandInterpreter::executeStart(int processId, const char* parameters,
- bool all) {
- (void)all; // Don't want compiler warning
-
- if (! emptyString(parameters)) {
- ndbout << "No parameters expected to this command." << endl;
- return;
- }
-
- int result = _mgmtSrvr.start(processId);
- if (result != 0) {
- ndbout << get_error_text(result) << endl;
- }
-}
-
-void
-CommandInterpreter::executeRestart(int processId, const char* parameters,
- bool all) {
-
- bool nostart = false;
- bool initialstart = false;
-
- if(parameters != 0 && strlen(parameters) != 0){
- char * tmpString = strdup(parameters);
- char * tmpPtr = 0;
- char * item = strtok_r(tmpString, " ", &tmpPtr);
- while(item != NULL){
- if(strcmp(item, "-N") == 0)
- nostart = true;
- if(strcmp(item, "-I") == 0)
- initialstart = true;
- item = strtok_r(NULL, " ", &tmpPtr);
- }
- free(tmpString);
- }
- int result;
- if(all)
- result = _mgmtSrvr.restart(nostart, initialstart, false,
- 0, stopCallback, this);
- else
- result = _mgmtSrvr.restartNode(processId, nostart, initialstart, false,
- stopCallback,
- this);
- if (result != 0) {
- ndbout << get_error_text(result) << endl;
- }
-}
-
-void
-CommandInterpreter::executeDumpState(int processId, const char* parameters,
- bool all) {
-
- (void)all; // Don't want compiler warning
-
- if(parameters == 0 || strlen(parameters) == 0){
- ndbout << "Expected argument" << endl;
- return;
- }
-
- Uint32 no = 0;
- Uint32 pars[25];
-
- char * tmpString = strdup(parameters);
- char * tmpPtr = 0;
- char * item = strtok_r(tmpString, " ", &tmpPtr);
- int error;
- while(item != NULL){
- if (0x0 <= my_strtoll10(item, NULL, &error) && my_strtoll10(item, NULL, &error) <= 0xffffffff) {
- pars[no] = my_strtoll10(item, NULL, &error);
- } else {
- ndbout << "Illegal value in argument to signal." << endl
- << "(Value must be between 0 and 0xffffffff.)"
- << endl;
- return;
- }
- no++;
- item = strtok_r(NULL, " ", &tmpPtr);
- }
- ndbout << "Sending dump signal with data:" << endl;
- for (Uint32 i=0; i<no; i++) {
- ndbout.setHexFormat(1) << pars[i] << " ";
- if (!(i+1 & 0x3)) ndbout << endl;
- }
- free(tmpString);
- int result = _mgmtSrvr.dumpState(processId, pars, no);
- if (result != 0) {
- ndbout << get_error_text(result) << endl;
- }
-}
-
-void CommandInterpreter::executeStatus(int processId,
- const char* parameters, bool all) {
-
- (void)all; // Don't want compiler warning
-
- if (! emptyString(parameters)) {
- ndbout << "No parameters expected to this command." << endl;
- return;
- }
-
- ndb_mgm_node_status status;
- Uint32 startPhase, version, dynamicId, nodeGroup, connectCount;
- bool system;
- int result = _mgmtSrvr.status(processId,
- &status, &version, &startPhase, &system,
- &dynamicId, &nodeGroup, &connectCount);
- if(result != 0){
- ndbout << get_error_text(result) << endl;
- return;
- }
-
- ndbout << "Node " << processId << ": ";
- switch(status){
- case NDB_MGM_NODE_STATUS_NO_CONTACT:
- ndbout << "No contact" << endl;
- break;
- case NDB_MGM_NODE_STATUS_NOT_STARTED:
- ndbout << "Not started" ;
- break;
- case NDB_MGM_NODE_STATUS_STARTING:
- ndbout << "Starting (Start phase " << startPhase << ")" ;
- break;
- case NDB_MGM_NODE_STATUS_STARTED:
- ndbout << "Started" ;
- break;
- case NDB_MGM_NODE_STATUS_SHUTTING_DOWN:
- ndbout << "Shutting down " << (system == false ? "node" : "system")
- << " (Phase " << startPhase << ")"
- ;
- break;
- case NDB_MGM_NODE_STATUS_RESTARTING:
- ndbout << "Restarting" ;
- break;
- case NDB_MGM_NODE_STATUS_SINGLEUSER:
- ndbout << "Single user mode" ;
- break;
- default:
- ndbout << "Unknown state" ;
- break;
- }
- if(status != NDB_MGM_NODE_STATUS_NO_CONTACT){
-
- ndbout_c(" (Version %d.%d.%d)",
- getMajor(version) ,
- getMinor(version),
- getBuild(version));
-
- // NOTE It's possible to print dynamicId and nodeGroup here ...
- // ndbout << ", " <<dynamicId<<", "<<nodeGroup<<endl;
- }
-}
-
-
-
-//*****************************************************************************
-//*****************************************************************************
-void CommandInterpreter::executeLogLevel(int processId,
- const char* parameters, bool all) {
-#if 0
- (void)all; // Don't want compiler warning
- SetLogLevelOrd logLevel; logLevel.clear();
-
- if (emptyString(parameters) || (strcmp(parameters, "ALL") == 0)) {
- for(Uint32 i = 0; i<EventLoggerBase::noOfEventCategoryNames; i++)
- logLevel.setLogLevel(EventLoggerBase::eventCategoryNames[i].category, 7);
- } else {
-
- char * tmpString = strdup(parameters);
- char * tmpPtr = 0;
- char * item = strtok_r(tmpString, ", ", &tmpPtr);
- while(item != NULL){
- char categoryTxt[255];
- int level;
- const int m = sscanf(item, "%[^=]=%d", categoryTxt, &level);
- if(m != 2){
- free(tmpString);
- ndbout << "Invalid loglevel specification category=level" << endl;
- return;
- }
- LogLevel::EventCategory cat;
- if(!EventLoggerBase::matchEventCategory(categoryTxt,
- &cat)){
- ndbout << "Invalid loglevel specification, unknown category: "
- << categoryTxt << endl;
- free(tmpString);
- return ;
- }
- if(level < 0 || level > 15){
- ndbout << "Invalid loglevel specification row, level 0-15" << endl;
- free(tmpString);
- return ;
- }
- logLevel.setLogLevel(cat, level);
-
- item = strtok_r(NULL, ", ", &tmpPtr);
- }
- free(tmpString);
- }
-
- int result = _mgmtSrvr.setNodeLogLevel(processId, logLevel);
- if (result != 0) {
- ndbout << get_error_text(result) << endl;
- }
-#endif
-}
-
-
-
-//*****************************************************************************
-//*****************************************************************************
-void CommandInterpreter::executeError(int processId,
- const char* parameters, bool all) {
-
- (void)all; // Don't want compiler warning
-
- if (emptyString(parameters)) {
- ndbout << "Missing error number." << endl;
- return;
- }
- // Copy parameters since strtok will modify it
- char* newpar = strdup(parameters);
- char* firstParameter = strtok(newpar, " ");
-
- int errorNo;
- if (! convert(firstParameter, errorNo)) {
- ndbout << "Expected an integer." << endl;
- free(newpar);
- return;
- }
-
- char* allAfterFirstParameter = strtok(NULL, "\0");
- if (! emptyString(allAfterFirstParameter)) {
- ndbout << "Nothing expected after error number." << endl;
- free(newpar);
- return;
- }
-
- int result = _mgmtSrvr.insertError(processId, errorNo);
- if (result != 0) {
- ndbout << get_error_text(result) << endl;
- }
- free(newpar);
-}
-
-
-
-//******************************************************************************
-//******************************************************************************
-void CommandInterpreter::executeTrace(int processId,
- const char* parameters, bool all) {
-
- (void)all; // Don't want compiler warning
-
- if (emptyString(parameters)) {
- ndbout << "Missing trace number." << endl;
- return;
- }
-
- char* newpar = strdup(parameters);
- char* firstParameter = strtok(newpar, " ");
-
-
- int traceNo;
- if (! convert(firstParameter, traceNo)) {
- ndbout << "Expected an integer." << endl;
- free(newpar);
- return;
- }
-
- char* allAfterFirstParameter = strtok(NULL, "\0");
-
- if (! emptyString(allAfterFirstParameter)) {
- ndbout << "Nothing expected after trace number." << endl;
- free(newpar);
- return;
- }
-
- int result = _mgmtSrvr.setTraceNo(processId, traceNo);
- if (result != 0) {
- ndbout << get_error_text(result) << endl;
- }
- free(newpar);
-}
-
-
-
-//******************************************************************************
-//******************************************************************************
-void CommandInterpreter::executeLog(int processId,
- const char* parameters, bool all) {
-
- (void)all; // Don't want compiler warning
-
- Vector<BaseString> blocks;
- if (! parseBlockSpecification(parameters, blocks)) {
- return;
- }
-
- int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::InOut, blocks);
- if (result != 0) {
- ndbout << get_error_text(result) << endl;
- }
-
-}
-
-
-
-//******************************************************************************
-//******************************************************************************
void CommandInterpreter::executeLogIn(int processId,
const char* parameters, bool all) {
@@ -1048,210 +308,38 @@ void CommandInterpreter::executeLogOff(int processId,
}
-//******************************************************************************
-//******************************************************************************
-void CommandInterpreter::executeTestOn(int processId,
- const char* parameters, bool all) {
+void CommandInterpreter::executeTrace(int processId,
+ const char* parameters, bool all) {
(void)all; // Don't want compiler warning
- if (! emptyString(parameters)) {
- ndbout << "No parameters expected to this command." << endl;
+ if (emptyString(parameters)) {
+ ndbout << "Missing trace number." << endl;
return;
}
- int result = _mgmtSrvr.startSignalTracing(processId);
- if (result != 0) {
- ndbout << get_error_text(result) << endl;
- }
-
-}
-
-//******************************************************************************
-//******************************************************************************
-void CommandInterpreter::executeTestOff(int processId,
- const char* parameters, bool all) {
+ char* newpar = strdup(parameters);
+ char* firstParameter = strtok(newpar, " ");
- (void)all; // Don't want compiler warning
- if (! emptyString(parameters)) {
- ndbout << "No parameters expected to this command." << endl;
+ int traceNo;
+ if (! convert(firstParameter, traceNo)) {
+ ndbout << "Expected an integer." << endl;
+ free(newpar);
return;
}
- int result = _mgmtSrvr.stopSignalTracing(processId);
- if (result != 0) {
- ndbout << get_error_text(result) << endl;
- }
-
-}
-
-//*****************************************************************************
-//*****************************************************************************
-void CommandInterpreter::executeEventReporting(int processId,
- const char* parameters,
- bool all) {
-#if 0
- (void)all; // Don't want compiler warning
- SetLogLevelOrd logLevel; logLevel.clear();
-
- if (emptyString(parameters) || (strcmp(parameters, "ALL") == 0)) {
- for(Uint32 i = 0; i<EventLoggerBase::noOfEventCategoryNames; i++)
- logLevel.setLogLevel(EventLoggerBase::eventCategoryNames[i].category, 7);
- } else {
-
- char * tmpString = strdup(parameters);
- char * tmpPtr = 0;
- char * item = strtok_r(tmpString, ", ", &tmpPtr);
- while(item != NULL){
- char categoryTxt[255];
- int level;
- const int m = sscanf(item, "%[^=]=%d", categoryTxt, &level);
- if(m != 2){
- free(tmpString);
- ndbout << "Invalid loglevel specification category=level" << endl;
- return;
- }
- LogLevel::EventCategory cat;
- if(!EventLoggerBase::matchEventCategory(categoryTxt,
- &cat)){
- ndbout << "Invalid loglevel specification, unknown category: "
- << categoryTxt << endl;
- free(tmpString);
- return ;
- }
- if(level < 0 || level > 15){
- ndbout << "Invalid loglevel specification row, level 0-15" << endl;
- free(tmpString);
- return ;
- }
- logLevel.setLogLevel(cat, level);
-
- item = strtok_r(NULL, ", ", &tmpPtr);
- }
- free(tmpString);
- }
- ndbout_c("processId %d", processId);
- int result = _mgmtSrvr.setEventReportingLevel(processId, logLevel);
- if (result != 0) {
- ndbout << get_error_text(result) << endl;
- }
-#endif
-}
-
-void
-CommandInterpreter::executeStartBackup(char* parameters) {
- Uint32 backupId;
- int result = _mgmtSrvr.startBackup(backupId);
- if (result != 0) {
- ndbout << get_error_text(result) << endl;
- } else {
- // ndbout << "Start of backup ordered" << endl;
- }
-}
+ char* allAfterFirstParameter = strtok(NULL, "\0");
-void
-CommandInterpreter::executeAbortBackup(char* parameters) {
- strtok(parameters, " ");
- char* id = strtok(NULL, "\0");
- int bid = -1;
- if(id == 0 || sscanf(id, "%d", &bid) != 1){
- ndbout << "Invalid arguments: expected <BackupId>" << endl;
+ if (! emptyString(allAfterFirstParameter)) {
+ ndbout << "Nothing expected after trace number." << endl;
+ free(newpar);
return;
}
- int result = _mgmtSrvr.abortBackup(bid);
- if (result != 0) {
- ndbout << get_error_text(result) << endl;
- } else {
- ndbout << "Abort of backup " << bid << " ordered" << endl;
- }
-}
-
-
-void
-CommandInterpreter::executeEnterSingleUser(char* parameters) {
- strtok(parameters, " ");
- char* id = strtok(NULL, " ");
- id = strtok(NULL, " ");
- id = strtok(NULL, "\0");
- int nodeId = -1;
- if(id == 0 || sscanf(id, "%d", &nodeId) != 1){
- ndbout << "Invalid arguments: expected <NodeId>" << endl;
- return;
- }
- int result = _mgmtSrvr.enterSingleUser(0, nodeId,0,0);
+ int result = _mgmtSrvr.setTraceNo(processId, traceNo);
if (result != 0) {
ndbout << get_error_text(result) << endl;
- } else {
- ndbout << "Entering single user mode, granting access for node "
- << nodeId << " OK." << endl;
}
-}
-
-void CommandInterpreter::executeExitSingleUser(char* parameters) {
- _mgmtSrvr.exitSingleUser(0,0,0,0);
-}
-
-
-#include <NdbApiSignal.hpp>
-
-void
-CommandInterpreter::jonas(int processId, const char* parameters, bool all) {
-
- MgmtSrvr::Area51 tmp = _mgmtSrvr.getStuff();
-
- NdbApiSignal signal(0);
- Uint32 * theData = signal.getDataPtrSend();
- Uint32 data[25];
- Uint32 sec0[70];
- Uint32 sec1[123];
-
- data[0] = 12;
- data[1] = 13;
-
- unsigned i;
- for(i = 0; i<70; i++)
- sec0[i] = i;
-
- for(i = 0; i<123; i++)
- sec1[i] = 70+i;
-
- signal.set(0, CMVMI, GSN_TESTSIG, 3);
- signal.m_noOfSections = 2;
- signal.m_fragmentInfo = 1;
-
- LinearSectionPtr ptr[3];
-
- theData[0] = 3;
- theData[1] = 0;
- theData[2] = 7; // FragmentId
-
- ptr[0].sz = 2;
- ptr[0].p = &data[0];
-
- ptr[1].sz = 60;
- ptr[1].p = &sec0[0];
-
- tmp.theFacade->lock_mutex();
- tmp.theRegistry->prepareSend(&signal, 1, theData, processId, ptr);
- tmp.theFacade->unlock_mutex();
-
- signal.set(0, CMVMI, GSN_TESTSIG, 3);
- signal.m_noOfSections = 2;
- signal.m_fragmentInfo = 3;
-
- theData[0] = 0;
- theData[1] = 1;
- theData[2] = 7; // FragmentId
-
- ptr[0].sz = 10;
- ptr[0].p = &sec0[60];
-
- ptr[1].sz = 123;
- ptr[1].p = &sec1[0];
-
- tmp.theFacade->lock_mutex();
- tmp.theRegistry->prepareSend(&signal, 1, theData, processId, ptr);
- tmp.theFacade->unlock_mutex();
+ free(newpar);
}
diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp
index 1a5184361d6..6b67d1a5a5f 100644
--- a/ndb/src/mgmsrv/CommandInterpreter.hpp
+++ b/ndb/src/mgmsrv/CommandInterpreter.hpp
@@ -17,52 +17,21 @@
#ifndef CommandInterpreter_H
#define CommandInterpreter_H
-//*****************************************************************************
-// Author: Peter Lind
-//*****************************************************************************
-
#include <ndb_global.h>
#include <Vector.hpp>
#include <BaseString.hpp>
class MgmtSrvr;
-/**
- * @class CommandInterpreter
- * @brief Reads command line in management client
- *
- * This class has one public method which reads a command line
- * from a stream. It then interpret that commmand line and calls a suitable
- * method in the MgmtSrvr class which executes the command.
- *
- * For command syntax, see the HELP command.
- */
class CommandInterpreter {
public:
- /**
- * Constructor
- * @param mgmtSrvr: Management server to use when executing commands
- */
CommandInterpreter(MgmtSrvr& mgmtSrvr);
-
- /**
- * Reads one line from the stream, parse the line to find
- * a command and then calls a suitable method which executes
- * the command.
- *
- * @return true until quit/bye/exit has been typed
- */
int readAndExecute();
private:
char m_err_str[1024];
const char *get_error_text(int err_no);
- /**
- * Read a string, and return a pointer to it.
- *
- * @return NULL on EOF.
- */
char *readline_gets ()
{
static char linebuffer[254];
@@ -89,70 +58,16 @@ private:
return (line_read);
}
- /**
- * Analyse the command line, after the first token.
- *
- * @param processId: DB process id to send command to or -1 if
- * command will be sent to all DB processes.
- * @param allAfterFirstToken: What the client gave after the
- * first token on the command line
- */
void analyseAfterFirstToken(int processId, char* allAfterFirstTokenCstr);
-
- /**
- * Parse the block specification part of the LOG* commands,
- * things after LOG*: [BLOCK = {ALL|<blockName>+}]
- *
- * @param allAfterLog: What the client gave after the second token
- * (LOG*) on the command line
- * @param blocks, OUT: ALL or name of all the blocks
- * @return: true if correct syntax, otherwise false
- */
bool parseBlockSpecification(const char* allAfterLog,
Vector<BaseString>& blocks);
-
- /**
- * A bunch of execute functions: Executes one of the commands
- *
- * @param processId: DB process id to send command to
- * @param parameters: What the client gave after the command name
- * on the command line.
- * For example if complete input from user is: "1 LOGLEVEL 22" then the
- * parameters argument is the string with everything after LOGLEVEL, in this
- * case "22". Each function is responsible to check the parameters argument.
- */
- void executeHelp(char* parameters);
- void executeShow(char* parameters);
- void executeRun(char* parameters);
- void executeInfo(char* parameters);
- void executeClusterLog(char* parameters);
public:
- void executeStop(int processId, const char* parameters, bool all);
- void executeStart(int processId, const char* parameters, bool all);
- void executeRestart(int processId, const char* parameters, bool all);
- void executeLogLevel(int processId, const char* parameters, bool all);
- void executeError(int processId, const char* parameters, bool all);
void executeTrace(int processId, const char* parameters, bool all);
- void executeLog(int processId, const char* parameters, bool all);
void executeLogIn(int processId, const char* parameters, bool all);
void executeLogOut(int processId, const char* parameters, bool all);
void executeLogOff(int processId, const char* parameters, bool all);
- void executeTestOn(int processId, const char* parameters, bool all);
- void executeTestOff(int processId, const char* parameters, bool all);
- void executeStatus(int processId, const char* parameters, bool all);
- void executeEnterSingleUser(char* parameters);
- void executeExitSingleUser(char* parameters);
- void executeEventReporting(int processId, const char* parameters, bool all);
- void executeDumpState(int processId, const char* parameters, bool all);
- void executeStartBackup(char * pars);
- void executeAbortBackup(char * pars);
-
- void jonas(int processId, const char* parameters, bool all);
- /**
- * A execute function definition
- */
public:
typedef void (CommandInterpreter::* ExecuteFunction)(int processId,
const char * param,
diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp
index ab2e34f6d3a..800ffe2e361 100644
--- a/ndb/src/mgmsrv/ConfigInfo.cpp
+++ b/ndb/src/mgmsrv/ConfigInfo.cpp
@@ -23,6 +23,8 @@
#include "InitConfigFileParser.hpp"
#include <m_string.h>
+extern my_bool opt_ndb_shm;
+
#define MAX_LINE_LENGTH 255
#define KEY_INTERNAL 0
#define MAX_INT_RNIL 0xfffffeff
@@ -79,6 +81,7 @@ static bool transformSystem(InitConfigFileParser::Context & ctx, const char *);
static bool transformExternalSystem(InitConfigFileParser::Context & ctx, const char *);
static bool transformNode(InitConfigFileParser::Context & ctx, const char *);
static bool transformExtNode(InitConfigFileParser::Context & ctx, const char *);
+static bool checkConnectionSupport(InitConfigFileParser::Context & ctx, const char *);
static bool transformConnection(InitConfigFileParser::Context & ctx, const char *);
static bool applyDefaultValues(InitConfigFileParser::Context & ctx, const char *);
static bool checkMandatory(InitConfigFileParser::Context & ctx, const char *);
@@ -108,6 +111,11 @@ ConfigInfo::m_SectionRules[] = {
{ "REP", transformNode, 0 },
{ "EXTERNAL REP", transformExtNode, 0 },
+ { "TCP", checkConnectionSupport, 0 },
+ { "SHM", checkConnectionSupport, 0 },
+ { "SCI", checkConnectionSupport, 0 },
+ { "OSE", checkConnectionSupport, 0 },
+
{ "TCP", transformConnection, 0 },
{ "SHM", transformConnection, 0 },
{ "SCI", transformConnection, 0 },
@@ -130,6 +138,8 @@ ConfigInfo::m_SectionRules[] = {
{ "TCP", fixHostname, "HostName1" },
{ "TCP", fixHostname, "HostName2" },
+ { "SHM", fixHostname, "HostName1" },
+ { "SHM", fixHostname, "HostName2" },
{ "SCI", fixHostname, "HostName1" },
{ "SCI", fixHostname, "HostName2" },
{ "SHM", fixHostname, "HostName1" },
@@ -197,6 +207,9 @@ static bool sanity_checks(Vector<ConfigInfo::ConfigRuleSection>&sections,
static bool add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
struct InitConfigFileParser::Context &ctx,
const char * rule_data);
+static bool set_connection_priorities(Vector<ConfigInfo::ConfigRuleSection>&sections,
+ struct InitConfigFileParser::Context &ctx,
+ const char * rule_data);
static bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>&sections,
struct InitConfigFileParser::Context &ctx,
const char * rule_data);
@@ -208,6 +221,7 @@ const ConfigInfo::ConfigRule
ConfigInfo::m_ConfigRules[] = {
{ sanity_checks, 0 },
{ add_node_connections, 0 },
+ { set_connection_priorities, 0 },
{ add_server_ports, 0 },
{ check_node_vs_replicas, 0 },
{ 0, 0 }
@@ -1583,6 +1597,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
0, 0 },
{
+ CFG_CONNECTION_GROUP,
+ "Group",
+ "TCP",
+ "",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "55",
+ "0", "200" },
+
+ {
CFG_CONNECTION_SEND_SIGNAL_ID,
"SendSignalId",
"TCP",
@@ -1748,6 +1773,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
0, 0 },
{
+ CFG_CONNECTION_GROUP,
+ "Group",
+ "SHM",
+ "",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "35",
+ "0", "200" },
+
+ {
CFG_CONNECTION_SEND_SIGNAL_ID,
"SendSignalId",
"SHM",
@@ -1780,7 +1816,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::CI_USED,
false,
ConfigInfo::CI_INT,
- MANDATORY,
+ "0",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1858,6 +1894,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
STR_VALUE(MAX_INT_RNIL) },
{
+ CFG_CONNECTION_GROUP,
+ "Group",
+ "SCI",
+ "",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "15",
+ "0", "200" },
+
+ {
CFG_CONNECTION_HOSTNAME_1,
"HostName1",
"SCI",
@@ -2681,11 +2728,50 @@ transformExtNode(InitConfigFileParser::Context & ctx, const char * data){
}
/**
- * Connection rule: Update "NoOfConnections"
+ * Connection rule: Check support of connection
*/
bool
-transformConnection(InitConfigFileParser::Context & ctx, const char * data){
+checkConnectionSupport(InitConfigFileParser::Context & ctx, const char * data)
+{
+ int error= 0;
+ if (strcasecmp("TCP",ctx.fname) == 0)
+ {
+ // always enabled
+ }
+ else if (strcasecmp("SHM",ctx.fname) == 0)
+ {
+#ifndef NDB_SHM_TRANSPORTER
+ error= 1;
+#endif
+ }
+ else if (strcasecmp("SCI",ctx.fname) == 0)
+ {
+#ifndef NDB_SCI_TRANSPORTER
+ error= 1;
+#endif
+ }
+ else if (strcasecmp("OSE",ctx.fname) == 0)
+ {
+#ifndef NDB_OSE_TRANSPORTER
+ error= 1;
+#endif
+ }
+ if (error)
+ {
+ ctx.reportError("Binary not compiled with this connection support, "
+ "[%s] starting at line: %d",
+ ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
+ return true;
+}
+/**
+ * Connection rule: Update "NoOfConnections"
+ */
+bool
+transformConnection(InitConfigFileParser::Context & ctx, const char * data)
+{
Uint32 connections = 0;
ctx.m_userProperties.get("NoOfConnections", &connections);
BaseString::snprintf(ctx.pname, sizeof(ctx.pname), "Connection_%d", connections);
@@ -3398,11 +3484,51 @@ sanity_checks(Vector<ConfigInfo::ConfigRuleSection>&sections,
return true;
}
+static void
+add_a_connection(Vector<ConfigInfo::ConfigRuleSection>&sections,
+ struct InitConfigFileParser::Context &ctx,
+ Uint32 nodeId1, Uint32 nodeId2, bool use_shm)
+{
+ ConfigInfo::ConfigRuleSection s;
+ const char *hostname1= 0, *hostname2= 0;
+ const Properties *tmp;
+
+ require(ctx.m_config->get("Node", nodeId1, &tmp));
+ tmp->get("HostName", &hostname1);
+
+ require(ctx.m_config->get("Node", nodeId2, &tmp));
+ tmp->get("HostName", &hostname2);
+
+ char buf[16];
+ s.m_sectionData= new Properties(true);
+ BaseString::snprintf(buf, sizeof(buf), "%u", nodeId1);
+ s.m_sectionData->put("NodeId1", buf);
+ BaseString::snprintf(buf, sizeof(buf), "%u", nodeId2);
+ s.m_sectionData->put("NodeId2", buf);
+
+ if (use_shm &&
+ hostname1 && hostname1[0] &&
+ hostname2 && hostname2[0] &&
+ strcmp(hostname1,hostname2) == 0)
+ {
+ s.m_sectionType= BaseString("SHM");
+ DBUG_PRINT("info",("adding SHM connection %d %d",nodeId1,nodeId2));
+ }
+ else
+ {
+ s.m_sectionType= BaseString("TCP");
+ DBUG_PRINT("info",("adding TCP connection %d %d",nodeId1,nodeId2));
+ }
+
+ sections.push_back(s);
+}
+
static bool
add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
struct InitConfigFileParser::Context &ctx,
const char * rule_data)
{
+ DBUG_ENTER("add_node_connections");
Uint32 i;
Properties * props= ctx.m_config;
Properties p_connections(true);
@@ -3427,9 +3553,10 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
ctx.m_userProperties.get("NoOfNodes", &nNodes);
Properties p_db_nodes(true);
- Properties p_api_mgm_nodes(true);
+ Properties p_api_nodes(true);
+ Properties p_mgm_nodes(true);
- Uint32 i_db= 0, i_api_mgm= 0, n;
+ Uint32 i_db= 0, i_api= 0, i_mgm= 0, n;
for (i= 0, n= 0; n < nNodes; i++){
const Properties * tmp;
if(!props->get("Node", i, &tmp)) continue;
@@ -3440,9 +3567,10 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
if (strcmp(type,DB_TOKEN) == 0)
p_db_nodes.put("", i_db++, i);
- else if (strcmp(type,API_TOKEN) == 0 ||
- strcmp(type,MGM_TOKEN) == 0)
- p_api_mgm_nodes.put("", i_api_mgm++, i);
+ else if (strcmp(type,API_TOKEN) == 0)
+ p_api_nodes.put("", i_api++, i);
+ else if (strcmp(type,MGM_TOKEN) == 0)
+ p_mgm_nodes.put("", i_mgm++, i);
}
Uint32 nodeId1, nodeId2, dummy;
@@ -3451,39 +3579,39 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
for (Uint32 j= i+1;; j++){
if(!p_db_nodes.get("", j, &nodeId2)) break;
if(!p_connections2.get("", nodeId1+nodeId2<<16, &dummy)) {
- ConfigInfo::ConfigRuleSection s;
- s.m_sectionType= BaseString("TCP");
- s.m_sectionData= new Properties(true);
- char buf[16];
- BaseString::snprintf(buf, sizeof(buf), "%u", nodeId1);
- s.m_sectionData->put("NodeId1", buf);
- BaseString::snprintf(buf, sizeof(buf), "%u", nodeId2);
- s.m_sectionData->put("NodeId2", buf);
- sections.push_back(s);
+ add_a_connection(sections,ctx,nodeId1,nodeId2,opt_ndb_shm);
}
}
}
- for (i= 0; p_api_mgm_nodes.get("", i, &nodeId1); i++){
+ for (i= 0; p_api_nodes.get("", i, &nodeId1); i++){
if(!p_connections.get("", nodeId1, &dummy)) {
for (Uint32 j= 0;; j++){
if(!p_db_nodes.get("", j, &nodeId2)) break;
- ConfigInfo::ConfigRuleSection s;
- s.m_sectionType= BaseString("TCP");
- s.m_sectionData= new Properties(true);
- char buf[16];
- BaseString::snprintf(buf, sizeof(buf), "%u", nodeId1);
- s.m_sectionData->put("NodeId1", buf);
- BaseString::snprintf(buf, sizeof(buf), "%u", nodeId2);
- s.m_sectionData->put("NodeId2", buf);
- sections.push_back(s);
+ add_a_connection(sections,ctx,nodeId1,nodeId2,opt_ndb_shm);
}
}
}
- return true;
+ for (i= 0; p_mgm_nodes.get("", i, &nodeId1); i++){
+ if(!p_connections.get("", nodeId1, &dummy)) {
+ for (Uint32 j= 0;; j++){
+ if(!p_db_nodes.get("", j, &nodeId2)) break;
+ add_a_connection(sections,ctx,nodeId1,nodeId2,0);
+ }
+ }
+ }
+
+ DBUG_RETURN(true);
}
+static bool set_connection_priorities(Vector<ConfigInfo::ConfigRuleSection>&sections,
+ struct InitConfigFileParser::Context &ctx,
+ const char * rule_data)
+{
+ DBUG_ENTER("set_connection_priorities");
+ DBUG_RETURN(true);
+}
static bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>&sections,
struct InitConfigFileParser::Context &ctx,
diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp
index 10691293700..2b0e1871fd9 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -131,7 +131,7 @@ MgmtSrvr::signalRecvThreadRun()
(this->*handler->function)(signal);
}
}
-};
+}
EventLogger g_EventLogger;
@@ -154,7 +154,7 @@ MgmtSrvr::logLevelThreadRun()
* Handle started nodes
*/
EventSubscribeReq req;
- req = m_statisticsListner.m_clients[0].m_logLevel;
+ req = m_event_listner[0].m_logLevel;
req.blockRef = _ownReference;
SetLogLevelOrd ord;
@@ -227,7 +227,8 @@ MgmtSrvr::startEventLog()
clusterLog);
}
if(!g_EventLogger.addHandler(logdest)) {
- ndbout << "Warning: could not add log destination \"" << logdest.c_str() << "\"" << endl;
+ ndbout << "Warning: could not add log destination \""
+ << logdest.c_str() << "\"" << endl;
}
}
@@ -245,18 +246,19 @@ public:
};
bool
-MgmtSrvr::setEventLogFilter(int severity)
+MgmtSrvr::setEventLogFilter(int severity, int enable)
{
- bool enabled = true;
Logger::LoggerLevel level = (Logger::LoggerLevel)severity;
- if (g_EventLogger.isEnable(level)) {
+ if (enable > 0) {
+ g_EventLogger.enable(level);
+ } else if (enable == 0) {
+ g_EventLogger.disable(level);
+ } else if (g_EventLogger.isEnable(level)) {
g_EventLogger.disable(level);
- enabled = false;
} else {
g_EventLogger.enable(level);
}
-
- return enabled;
+ return g_EventLogger.isEnable(level);
}
bool
@@ -408,7 +410,7 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
_ownReference(0),
theSignalIdleList(NULL),
theWaitState(WAIT_SUBSCRIBE_CONF),
- m_statisticsListner(this)
+ m_event_listner(this)
{
DBUG_ENTER("MgmtSrvr::MgmtSrvr");
@@ -546,16 +548,18 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
}
}
+ // Setup clusterlog as client[0] in m_event_listner
{
- MgmStatService::StatListener se;
+ Ndb_mgmd_event_service::Event_listener se;
se.m_socket = NDB_INVALID_SOCKET;
for(size_t t = 0; t<LogLevel::LOGLEVEL_CATEGORIES; t++){
se.m_logLevel.setLogLevel((LogLevel::EventCategory)t, 7);
}
se.m_logLevel.setLogLevel(LogLevel::llError, 15);
+ se.m_logLevel.setLogLevel(LogLevel::llConnection, 8);
se.m_logLevel.setLogLevel(LogLevel::llBackup, 15);
- m_statisticsListner.m_clients.push_back(se);
- m_statisticsListner.m_logLevel = se.m_logLevel;
+ m_event_listner.m_clients.push_back(se);
+ m_event_listner.m_logLevel = se.m_logLevel;
}
DBUG_VOID_RETURN;
@@ -2071,21 +2075,18 @@ MgmtSrvr::handleStopReply(NodeId nodeId, Uint32 errCode)
void
MgmtSrvr::handleStatus(NodeId nodeId, bool alive)
{
+ DBUG_ENTER("MgmtSrvr::handleStatus");
+ Uint32 theData[25];
+ theData[1] = nodeId;
if (alive) {
m_started_nodes.push_back(nodeId);
- Uint32 theData[25];
theData[0] = EventReport::Connected;
- theData[1] = nodeId;
- eventReport(_ownNodeId, theData);
} else {
handleStopReply(nodeId, 0);
-
- Uint32 theData[25];
theData[0] = EventReport::Disconnected;
- theData[1] = nodeId;
-
- eventReport(_ownNodeId, theData);
}
+ eventReport(_ownNodeId, theData);
+ DBUG_VOID_RETURN;
}
//****************************************************************************
@@ -2106,8 +2107,11 @@ void
MgmtSrvr::nodeStatusNotification(void* mgmSrv, Uint32 nodeId,
bool alive, bool nfComplete)
{
+ DBUG_ENTER("MgmtSrvr::nodeStatusNotification");
+ DBUG_PRINT("enter",("nodeid= %d, alive= %d, nfComplete= %d", nodeId, alive, nfComplete));
if(!(!alive && nfComplete))
((MgmtSrvr*)mgmSrv)->handleStatus(nodeId, alive);
+ DBUG_VOID_RETURN;
}
enum ndb_mgm_node_type
@@ -2222,9 +2226,24 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
if (*nodeId != 0 ||
type != NDB_MGM_NODE_TYPE_MGM ||
no_mgm == 1) { // any match is ok
+
+ if (config_hostname == 0 &&
+ *nodeId == 0 &&
+ type != NDB_MGM_NODE_TYPE_MGM)
+ {
+ if (!id_found) // only set if not set earlier
+ id_found= tmp;
+ continue; /* continue looking for a nodeid with specified
+ * hostname
+ */
+ }
+ assert(id_found == 0);
id_found= tmp;
break;
}
+ assert(no_mgm > 1);
+ assert(*nodeId != 0);
+ assert(type != NDB_MGM_NODE_TYPE_MGM);
if (id_found) { // mgmt server may only have one match
error_string.appfmt("Ambiguous node id's %d and %d.\n"
"Suggest specifying node id in connectstring,\n"
@@ -2294,8 +2313,9 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
if (found_matching_type)
if (found_free_node)
error_string.appfmt("Connection done from wrong host ip %s.",
- inet_ntoa(((struct sockaddr_in *)
- (client_addr))->sin_addr));
+ (client_addr)?
+ inet_ntoa(((struct sockaddr_in *)
+ (client_addr))->sin_addr):"");
else
error_string.appfmt("No free node id found for %s.",
type_string.c_str());
@@ -2386,15 +2406,15 @@ MgmtSrvr::eventReport(NodeId nodeId, const Uint32 * theData)
EventReport::EventType type = eventReport->getEventType();
// Log event
g_EventLogger.log(type, theData, nodeId,
- &m_statisticsListner.m_clients[0].m_logLevel);
- m_statisticsListner.log(type, theData, nodeId);
+ &m_event_listner[0].m_logLevel);
+ m_event_listner.log(type, theData, nodeId);
}
/***************************************************************************
* Backup
***************************************************************************/
int
-MgmtSrvr::startBackup(Uint32& backupId, bool waitCompleted)
+MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted)
{
bool next;
NodeId nodeId = 0;
@@ -2416,11 +2436,16 @@ MgmtSrvr::startBackup(Uint32& backupId, bool waitCompleted)
req->backupDataLen = 0;
int result;
- if (waitCompleted) {
- result = sendRecSignal(nodeId, WAIT_BACKUP_COMPLETED, signal, true);
+ if (waitCompleted == 2) {
+ result = sendRecSignal(nodeId, WAIT_BACKUP_COMPLETED,
+ signal, true, 30*60*1000 /*30 secs*/);
+ }
+ else if (waitCompleted == 1) {
+ result = sendRecSignal(nodeId, WAIT_BACKUP_STARTED,
+ signal, true, 5*60*1000 /*5 mins*/);
}
else {
- result = sendRecSignal(nodeId, WAIT_BACKUP_STARTED, signal, true);
+ result = sendRecSignal(nodeId, NO_WAIT, signal, true);
}
if (result == -1) {
return SEND_OR_RECEIVE_FAILED;
@@ -2499,18 +2524,31 @@ MgmtSrvr::abortBackup(Uint32 backupId)
void
MgmtSrvr::backupCallback(BackupEvent & event)
{
+ DBUG_ENTER("MgmtSrvr::backupCallback");
m_lastBackupEvent = event;
switch(event.Event){
case BackupEvent::BackupFailedToStart:
+ DBUG_PRINT("info",("BackupEvent::BackupFailedToStart"));
+ theWaitState = NO_WAIT;
+ break;
case BackupEvent::BackupAborted:
+ DBUG_PRINT("info",("BackupEvent::BackupAborted"));
+ theWaitState = NO_WAIT;
+ break;
case BackupEvent::BackupCompleted:
+ DBUG_PRINT("info",("BackupEvent::BackupCompleted"));
theWaitState = NO_WAIT;
break;
case BackupEvent::BackupStarted:
if(theWaitState == WAIT_BACKUP_STARTED)
+ {
+ DBUG_PRINT("info",("BackupEvent::BackupStarted NO_WAIT"));
theWaitState = NO_WAIT;
+ } else {
+ DBUG_PRINT("info",("BackupEvent::BackupStarted"));
+ }
}
- return;
+ DBUG_VOID_RETURN;
}
@@ -2831,5 +2869,5 @@ template bool SignalQueue::waitFor<SigMatch>(Vector<SigMatch>&, SigMatch**, NdbA
#endif
template class MutexVector<unsigned short>;
-template class MutexVector<MgmStatService::StatListener>;
+template class MutexVector<Ndb_mgmd_event_service::Event_listener>;
template class MutexVector<EventSubscribeReq>;
diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp
index b3b8f884f48..4742d5f6426 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.hpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.hpp
@@ -43,27 +43,34 @@ class Config;
class SetLogLevelOrd;
class SocketServer;
-class MgmStatService : public EventLoggerBase
+class Ndb_mgmd_event_service : public EventLoggerBase
{
friend class MgmtSrvr;
public:
- struct StatListener : public EventLoggerBase {
+ struct Event_listener : public EventLoggerBase {
NDB_SOCKET_TYPE m_socket;
};
private:
class MgmtSrvr * m_mgmsrv;
- MutexVector<StatListener> m_clients;
+ MutexVector<Event_listener> m_clients;
public:
- MgmStatService(class MgmtSrvr * m) : m_clients(5) {
+ Ndb_mgmd_event_service(class MgmtSrvr * m) : m_clients(5) {
m_mgmsrv = m;
}
- void add_listener(const StatListener&);
+ void add_listener(const Event_listener&);
+ void update_max_log_level(const LogLevel&);
+ void update_log_level(const LogLevel&);
void log(int eventType, const Uint32* theData, NodeId nodeId);
- void stopSessions();
+ void stop_sessions();
+
+ Event_listener& operator[](unsigned i) { return m_clients[i]; }
+ const Event_listener& operator[](unsigned i) const { return m_clients[i]; }
+ void lock() { m_clients.lock(); }
+ void unlock(){ m_clients.unlock(); }
};
/**
@@ -122,7 +129,7 @@ public:
* @param serverity the log level/serverity.
* @return true if the severity was enabled.
*/
- bool setEventLogFilter(int severity);
+ bool setEventLogFilter(int severity, int enable);
/**
* Returns true if the log level/severity is enabled.
@@ -357,7 +364,7 @@ public:
/**
* Backup functionallity
*/
- int startBackup(Uint32& backupId, bool waitCompleted = false);
+ int startBackup(Uint32& backupId, int waitCompleted= 2);
int abortBackup(Uint32 backupId);
int performBackup(Uint32* backupId);
@@ -738,8 +745,8 @@ private:
LogLevel m_nodeLogLevel[MAX_NODES];
enum ndb_mgm_node_type nodeTypes[MAX_NODES];
friend class MgmApiSession;
- friend class MgmStatService;
- MgmStatService m_statisticsListner;
+ friend class Ndb_mgmd_event_service;
+ Ndb_mgmd_event_service m_event_listner;
/**
* Handles the thread wich upon a 'Node is started' event will
diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp
index 0f0d1582d1a..6295d82b3be 100644
--- a/ndb/src/mgmsrv/Services.cpp
+++ b/ndb/src/mgmsrv/Services.cpp
@@ -132,6 +132,7 @@ ParserRow<MgmApiSession> commands[] = {
MGM_ARG("user", String, Mandatory, "Password"),
MGM_ARG("password", String, Mandatory, "Password"),
MGM_ARG("public key", String, Mandatory, "Public key"),
+ MGM_ARG("endian", String, Optional, "Endianness"),
MGM_CMD("get version", &MgmApiSession::getVersion, ""),
@@ -175,6 +176,7 @@ ParserRow<MgmApiSession> commands[] = {
MGM_ARG("args", String, Mandatory, "Args(space separated int's)"),
MGM_CMD("start backup", &MgmApiSession::startBackup, ""),
+ MGM_ARG("completed", Int, Optional ,"Wait until completed"),
MGM_CMD("abort backup", &MgmApiSession::abortBackup, ""),
MGM_ARG("id", Int, Mandatory, "Backup id"),
@@ -207,16 +209,17 @@ ParserRow<MgmApiSession> commands[] = {
MGM_CMD("set loglevel", &MgmApiSession::setLogLevel, ""),
MGM_ARG("node", Int, Mandatory, "Node"),
- MGM_ARG("category", String, Mandatory, "Event category"),
+ MGM_ARG("category", Int, Mandatory, "Event category"),
MGM_ARG("level", Int, Mandatory, "Log level (0-15)"),
MGM_CMD("set cluster loglevel", &MgmApiSession::setClusterLogLevel, ""),
MGM_ARG("node", Int, Mandatory, "Node"),
- MGM_ARG("category", String, Mandatory, "Event category"),
+ MGM_ARG("category", Int, Mandatory, "Event category"),
MGM_ARG("level", Int, Mandatory, "Log level (0-15)"),
MGM_CMD("set logfilter", &MgmApiSession::setLogFilter, ""),
MGM_ARG("level", Int, Mandatory, "Severety level"),
+ MGM_ARG("enable", Int, Mandatory, "1=disable, 0=enable, -1=toggle"),
MGM_CMD("config lock", &MgmApiSession::configLock, ""),
@@ -399,6 +402,8 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
const char * user;
const char * password;
const char * public_key;
+ const char * endian= NULL;
+ union { long l; char c[sizeof(long)]; } endian_check;
args.get("version", &version);
args.get("nodetype", &nodetype);
@@ -407,7 +412,17 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
args.get("user", &user);
args.get("password", &password);
args.get("public key", &public_key);
-
+ args.get("endian", &endian);
+
+ endian_check.l = 1;
+ if(endian
+ && strcmp(endian,(endian_check.c[sizeof(long)-1])?"big":"little")!=0) {
+ m_output->println(cmd);
+ m_output->println("result: Node does not have the same endianness as the management server.");
+ m_output->println("");
+ return;
+ }
+
bool compatible;
switch (nodetype) {
case NODE_TYPE_MGM:
@@ -628,85 +643,30 @@ MgmApiSession::getVersion(Parser<MgmApiSession>::Context &,
m_output->println("string: %s", NDB_VERSION_STRING);
m_output->println("");
}
-#if 0
-
-/*****************************************************************************
- * BACKUP
- *****************************************************************************/
-
-int completed;
-MgmtSrvr::BackupEvent globalEvent;
-
-static void
-completedCallback(const MgmtSrvr::BackupEvent & event){
-
- ndbout << "WaitCallback" << endl;
- // Save event in the latestEvent var
-
- switch(event.Event){
- case MgmtSrvr::BackupEvent::BackupCompleted:
- case MgmtSrvr::BackupEvent::BackupFailedToStart:
- globalEvent = event;
- completed = 1;
- break;
- }
-}
void
MgmApiSession::startBackup(Parser<MgmApiSession>::Context &,
- Properties const &) {
+ Properties const &args) {
+ DBUG_ENTER("MgmApiSession::startBackup");
unsigned backupId;
+ Uint32 completed= 2;
int result;
- MgmtSrvr::BackupCallback prevCallback;
- prevCallback = m_mgmsrv.setCallback(completedCallback);
- completed = 0;
- result = m_mgmsrv.startBackup(backupId);
- if (result == 0){
-
- // Wait for the callback to call our condition
- // waitFor();
- while (completed == 0)
- NdbSleep_SecSleep(0);
-
- if (globalEvent.Event == MgmtSrvr::BackupEvent::BackupFailedToStart)
- result = globalEvent.FailedToStart.ErrorCode;
- else
- backupId = globalEvent.Completed.BackupId;
- }
-
- // restore old callback
- m_mgmsrv.setCallback(prevCallback);
-
- m_output->println("start backup reply");
- if(result != 0)
- m_output->println("result: %s(%d)", get_error_text(result), result);
- else{
- m_output->println("result: Ok");
- m_output->println("id: %d", backupId);
- }
- m_output->println("");
-
-}
-#endif
-
-void
-MgmApiSession::startBackup(Parser<MgmApiSession>::Context &,
- Properties const &) {
- unsigned backupId;
- int result;
+ args.get("completed", &completed);
- result = m_mgmsrv.startBackup(backupId, true);
+ result = m_mgmsrv.startBackup(backupId, completed);
m_output->println("start backup reply");
if(result != 0)
+ {
m_output->println("result: %s", get_error_text(result));
+ }
else{
m_output->println("result: Ok");
m_output->println("id: %d", backupId);
}
m_output->println("");
-
+ DBUG_VOID_RETURN;
}
void
@@ -780,43 +740,62 @@ MgmApiSession::bye(Parser<MgmApiSession>::Context &,
void
MgmApiSession::setClusterLogLevel(Parser<MgmApiSession>::Context &,
Properties const &args) {
- Uint32 node, level, category;
+ const char *reply= "set cluster loglevel reply";
+ Uint32 node, level, cat;
BaseString errorString;
SetLogLevelOrd logLevel;
int result;
+ DBUG_ENTER("MgmApiSession::setClusterLogLevel");
args.get("node", &node);
- args.get("category", &category);
+ args.get("category", &cat);
args.get("level", &level);
+ DBUG_PRINT("enter",("node=%d, category=%d, level=%d", node, cat, level));
+
/* XXX should use constants for this value */
if(level > 15) {
- m_output->println("set cluster loglevel reply");
- m_output->println("result: Invalid loglevel");
+ m_output->println(reply);
+ m_output->println("result: Invalid loglevel %d", level);
m_output->println("");
- return;
+ DBUG_VOID_RETURN;
}
- EventSubscribeReq req;
- req.blockRef = 0;
- req.noOfEntries = 1;
- req.theData[0] = (category << 16) | level;
- m_mgmsrv.m_log_level_requests.push_back(req);
-
- m_output->println("set cluster loglevel reply");
+ LogLevel::EventCategory category=
+ (LogLevel::EventCategory)(cat-(int)CFG_MIN_LOGLEVEL);
+
+ m_mgmsrv.m_event_listner.lock();
+ if (m_mgmsrv.m_event_listner[0].m_logLevel.setLogLevel(category,level))
+ {
+ m_output->println(reply);
+ m_output->println("result: Invalid category %d", category);
+ m_output->println("");
+ m_mgmsrv.m_event_listner.unlock();
+ DBUG_VOID_RETURN;
+ }
+ m_mgmsrv.m_event_listner.unlock();
+
+ {
+ LogLevel ll;
+ ll.setLogLevel(category,level);
+ m_mgmsrv.m_event_listner.update_max_log_level(ll);
+ }
+
+ m_output->println(reply);
m_output->println("result: Ok");
m_output->println("");
+ DBUG_VOID_RETURN;
}
void
MgmApiSession::setLogLevel(Parser<MgmApiSession>::Context &,
Properties const &args) {
- Uint32 node = 0, level = 0, category;
+ Uint32 node = 0, level = 0, cat;
BaseString errorString;
SetLogLevelOrd logLevel;
int result;
logLevel.clear();
args.get("node", &node);
- args.get("category", &category);
+ args.get("category", &cat);
args.get("level", &level);
/* XXX should use constants for this value */
@@ -827,12 +806,15 @@ MgmApiSession::setLogLevel(Parser<MgmApiSession>::Context &,
return;
}
- EventSubscribeReq req;
- req.blockRef = node;
- req.noOfEntries = 1;
- req.theData[0] = (category << 16) | level;
- m_mgmsrv.m_log_level_requests.push_back(req);
-
+ LogLevel::EventCategory category=
+ (LogLevel::EventCategory)(cat-(int)CFG_MIN_LOGLEVEL);
+
+ {
+ LogLevel ll;
+ ll.setLogLevel(category,level);
+ m_mgmsrv.m_event_listner.update_max_log_level(ll);
+ }
+
m_output->println("set loglevel reply");
m_output->println("result: Ok");
m_output->println("");
@@ -1203,10 +1185,12 @@ void
MgmApiSession::setLogFilter(Parser_t::Context &ctx,
const class Properties &args) {
Uint32 level;
+ Uint32 enable;
args.get("level", &level);
+ args.get("enable", &enable);
- int result = m_mgmsrv.setEventLogFilter(level);
+ int result = m_mgmsrv.setEventLogFilter(level, enable);
m_output->println("set logfilter reply");
m_output->println("result: %d", result);
@@ -1260,21 +1244,17 @@ operator<<(NdbOut& out, const LogLevel & ll)
}
void
-MgmStatService::log(int eventType, const Uint32* theData, NodeId nodeId){
+Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId){
- Uint32 threshold = 0;
- LogLevel::EventCategory cat= LogLevel::llInvalid;
+ Uint32 threshold;
+ LogLevel::EventCategory cat;
+ Logger::LoggerLevel severity;
int i;
+ DBUG_ENTER("Ndb_mgmd_event_service::log");
+ DBUG_PRINT("enter",("eventType=%d, nodeid=%d", eventType, nodeId));
- for(i = 0; (unsigned)i<EventLogger::matrixSize; i++){
- if(EventLogger::matrix[i].eventType == eventType){
- cat = EventLogger::matrix[i].eventCategory;
- threshold = EventLogger::matrix[i].threshold;
- break;
- }
- }
- if (cat == LogLevel::llInvalid)
- return;
+ if (EventLoggerBase::event_lookup(eventType,cat,threshold,severity))
+ DBUG_VOID_RETURN;
char m_text[256];
EventLogger::getText(m_text, sizeof(m_text), eventType, theData, nodeId);
@@ -1304,23 +1284,22 @@ MgmStatService::log(int eventType, const Uint32* theData, NodeId nodeId){
tmp.set_max(m_clients[i].m_logLevel);
}
m_clients.unlock();
-
- if(!(tmp == m_logLevel)){
- m_logLevel = tmp;
- EventSubscribeReq req;
- req = tmp;
- req.blockRef = 0;
- m_mgmsrv->m_log_level_requests.push_back(req);
- }
+ update_log_level(tmp);
}
+ DBUG_VOID_RETURN;
}
void
-MgmStatService::add_listener(const StatListener& client){
- m_clients.push_back(client);
- LogLevel tmp = m_logLevel;
- tmp.set_max(client.m_logLevel);
-
+Ndb_mgmd_event_service::update_max_log_level(const LogLevel &log_level)
+{
+ LogLevel tmp= m_logLevel;
+ tmp.set_max(log_level);
+ update_log_level(tmp);
+}
+
+void
+Ndb_mgmd_event_service::update_log_level(const LogLevel &tmp)
+{
if(!(tmp == m_logLevel)){
m_logLevel = tmp;
EventSubscribeReq req;
@@ -1331,13 +1310,21 @@ MgmStatService::add_listener(const StatListener& client){
}
void
-MgmStatService::stopSessions(){
+Ndb_mgmd_event_service::add_listener(const Event_listener& client){
+ m_clients.push_back(client);
+ update_max_log_level(client.m_logLevel);
+}
+
+void
+Ndb_mgmd_event_service::stop_sessions(){
+ m_clients.lock();
for(int i = m_clients.size() - 1; i >= 0; i--){
if(m_clients[i].m_socket != NDB_INVALID_SOCKET){
NDB_CLOSE_SOCKET(m_clients[i].m_socket);
m_clients.erase(i);
}
}
+ m_clients.unlock();
}
void
@@ -1416,7 +1403,7 @@ MgmApiSession::listen_event(Parser<MgmApiSession>::Context & ctx,
int result = 0;
BaseString msg;
- MgmStatService::StatListener le;
+ Ndb_mgmd_event_service::Event_listener le;
le.m_socket = m_socket;
Vector<BaseString> list;
@@ -1461,7 +1448,7 @@ MgmApiSession::listen_event(Parser<MgmApiSession>::Context & ctx,
goto done;
}
- m_mgmsrv.m_statisticsListner.add_listener(le);
+ m_mgmsrv.m_event_listner.add_listener(le);
m_stop = true;
m_socket = NDB_INVALID_SOCKET;
diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp
index 50f60d793cd..aa2cefae38c 100644
--- a/ndb/src/mgmsrv/main.cpp
+++ b/ndb/src/mgmsrv/main.cpp
@@ -89,43 +89,39 @@ bool g_StopServer;
extern EventLogger g_EventLogger;
extern int global_mgmt_server_check;
-static char *opt_connect_str= 0;
+
+enum ndb_mgmd_options {
+ NDB_STD_OPTS_OPTIONS,
+ OPT_INTERACTIVE,
+ OPT_NO_NODEID_CHECKS,
+ OPT_NO_DAEMON
+};
+NDB_STD_OPTS_VARS;
static struct my_option my_long_options[] =
{
-#ifndef DBUG_OFF
- { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
- 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 },
-#endif
- { "usage", '?', "Display this help and exit.",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
- { "help", '?', "Display this help and exit.",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
- { "version", 'V', "Output version information and exit.", 0, 0, 0,
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
- { "connect-string", 1023,
- "Set connect string for connecting to ndb_mgmd. "
- "<constr>=\"host=<hostname:port>[;nodeid=<id>]\". "
- "Overides specifying entries in NDB_CONNECTSTRING and config file",
- (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0,
- GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
+ NDB_STD_OPTS("ndb_mgmd"),
{ "config-file", 'f', "Specify cluster configuration file",
(gptr*) &glob.config_filename, (gptr*) &glob.config_filename, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "daemon", 'd', "Run ndb_mgmd in daemon mode (default)",
(gptr*) &glob.daemon, (gptr*) &glob.daemon, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 },
- { "interactive", 256, "Run interactive. Not supported but provided for testing purposes",
+ { "interactive", OPT_INTERACTIVE,
+ "Run interactive. Not supported but provided for testing purposes",
(gptr*) &glob.interactive, (gptr*) &glob.interactive, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
- { "no-nodeid-checks", 257, "Do not provide any node id checks",
+ { "no-nodeid-checks", OPT_NO_NODEID_CHECKS,
+ "Do not provide any node id checks",
(gptr*) &g_no_nodeid_checks, (gptr*) &g_no_nodeid_checks, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
- { "nodaemon", 258, "Don't run as daemon, but don't read from stdin",
+ { "nodaemon", OPT_NO_DAEMON,
+ "Don't run as daemon, but don't read from stdin",
(gptr*) &glob.non_interactive, (gptr*) &glob.non_interactive, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
+
static void short_usage_sub(void)
{
printf("Usage: %s [OPTIONS]\n", my_progname);
@@ -152,6 +148,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'V':
print_version();
exit(0);
+ case OPT_NDB_SHM:
+#ifndef NDB_SHM_TRANSPORTER
+ printf("Warning: binary not compiled with shared memory support,\n"
+ "use configure option --with-ndb-shm to enable support.\n"
+ "Tcp connections will now be used instead\n");
+ opt_ndb_shm= 0;
+#endif
case '?':
usage();
exit(0);
diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp
index 12300ce216f..afdb37aa53f 100644
--- a/ndb/src/ndbapi/DictCache.cpp
+++ b/ndb/src/ndbapi/DictCache.cpp
@@ -24,10 +24,12 @@
Ndb_local_table_info *
Ndb_local_table_info::create(NdbTableImpl *table_impl, Uint32 sz)
{
- void *data= malloc(sizeof(NdbTableImpl)+sz-1);
+ if (sz % 8 != 0) // round to Uint64
+ sz += 8 - sz % 8;
+ void *data= malloc(sizeof(NdbTableImpl)+sz-8);
if (data == 0)
return 0;
- memset(data,0,sizeof(NdbTableImpl)+sz-1);
+ memset(data,0,sizeof(NdbTableImpl)+sz-8);
new (data) Ndb_local_table_info(table_impl);
return (Ndb_local_table_info *) data;
}
diff --git a/ndb/src/ndbapi/DictCache.hpp b/ndb/src/ndbapi/DictCache.hpp
index 0dc853306fa..58c08a93e61 100644
--- a/ndb/src/ndbapi/DictCache.hpp
+++ b/ndb/src/ndbapi/DictCache.hpp
@@ -25,6 +25,7 @@
#include <UtilBuffer.hpp>
#include <NdbDictionary.hpp>
#include <Ndb.hpp>
+#include <NdbCondition.h>
#include "NdbLinHash.hpp"
class Ndb_local_table_info {
@@ -32,7 +33,7 @@ public:
static Ndb_local_table_info *create(NdbTableImpl *table_impl, Uint32 sz=0);
static void destroy(Ndb_local_table_info *);
NdbTableImpl *m_table_impl;
- char m_local_data[1];
+ Uint64 m_local_data[1];
private:
Ndb_local_table_info(NdbTableImpl *table_impl);
~Ndb_local_table_info();
diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp
index 99d6c319611..a128b1a4db5 100644
--- a/ndb/src/ndbapi/Ndb.cpp
+++ b/ndb/src/ndbapi/Ndb.cpp
@@ -46,7 +46,6 @@ Connect to any node which has no connection at the moment.
NdbTransaction* Ndb::doConnect(Uint32 tConNode)
{
Uint32 tNode;
- Uint32 i = 0;;
Uint32 tAnyAlive = 0;
int TretCode;
@@ -65,38 +64,51 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode)
// We will connect to any node. Make sure that we have connections to all
// nodes.
//****************************************************************************
- Uint32 tNoOfDbNodes = theNoOfDBnodes;
- i = theCurrentConnectIndex;
- UintR Tcount = 0;
- do {
- if (i >= tNoOfDbNodes) {
- i = 0;
- }//if
- Tcount++;
- tNode = theDBnodes[i];
- TretCode = NDB_connect(tNode);
- if ((TretCode == 1) || (TretCode == 2)) {
+ if (theImpl->m_optimized_node_selection)
+ {
+ Ndb_cluster_connection_node_iter &node_iter=
+ theImpl->m_node_iter;
+ theImpl->m_ndb_cluster_connection.init_get_next_node(node_iter);
+ while ((tNode= theImpl->m_ndb_cluster_connection.get_next_node(node_iter)))
+ {
+ TretCode= NDB_connect(tNode);
+ if ((TretCode == 1) ||
+ (TretCode == 2))
+ {
//****************************************************************************
// We have connections now to the desired node. Return
//****************************************************************************
- if (theCurrentConnectIndex == i) {
- theCurrentConnectCounter++;
- if (theCurrentConnectCounter == 8) {
- theCurrentConnectCounter = 1;
- theCurrentConnectIndex++;
- }//if
- } else {
- // Set to 2 because we have already connected to a node
- // when we get here.
- theCurrentConnectCounter = 2;
- theCurrentConnectIndex = i;
+ return getConnectedNdbConnection(tNode);
+ } else if (TretCode != 0) {
+ tAnyAlive= 1;
}//if
- return getConnectedNdbTransaction(tNode);
- } else if (TretCode != 0) {
- tAnyAlive = 1;
- }//if
- i++;
- } while (Tcount < tNoOfDbNodes);
+ }
+ }
+ else // just do a regular round robin
+ {
+ Uint32 tNoOfDbNodes= theImpl->theNoOfDBnodes;
+ Uint32 &theCurrentConnectIndex= theImpl->theCurrentConnectIndex;
+ UintR Tcount = 0;
+ do {
+ theCurrentConnectIndex++;
+ if (theCurrentConnectIndex >= tNoOfDbNodes)
+ theCurrentConnectIndex = 0;
+
+ Tcount++;
+ tNode= theImpl->theDBnodes[theCurrentConnectIndex];
+ TretCode= NDB_connect(tNode);
+ if ((TretCode == 1) ||
+ (TretCode == 2))
+ {
+//****************************************************************************
+// We have connections now to the desired node. Return
+//****************************************************************************
+ return getConnectedNdbConnection(tNode);
+ } else if (TretCode != 0) {
+ tAnyAlive= 1;
+ }//if
+ } while (Tcount < tNoOfDbNodes);
+ }
//****************************************************************************
// We were unable to find a free connection. If no node alive we will report
// error code for cluster failure otherwise connection failure.
@@ -161,8 +173,8 @@ Ndb::NDB_connect(Uint32 tNode)
tReturnCode = tp->sendSignal(tSignal, tNode);
releaseSignal(tSignal);
if (tReturnCode != -1) {
- theWaiter.m_node = tNode;
- theWaiter.m_state = WAIT_TC_SEIZE;
+ theImpl->theWaiter.m_node = tNode;
+ theImpl->theWaiter.m_state = WAIT_TC_SEIZE;
tReturnCode = receiveResponse();
}//if
} else {
@@ -211,8 +223,9 @@ Ndb::doDisconnect()
NdbTransaction* tNdbCon;
CHECK_STATUS_MACRO_VOID;
- DBUG_PRINT("info", ("theNoOfDBnodes=%d", theNoOfDBnodes));
- Uint32 tNoOfDbNodes = theNoOfDBnodes;
+ Uint32 tNoOfDbNodes = theImpl->theNoOfDBnodes;
+ Uint8 *theDBnodes= theImpl->theDBnodes;
+ DBUG_PRINT("info", ("theNoOfDBnodes=%d", tNoOfDbNodes));
UintR i;
for (i = 0; i < tNoOfDbNodes; i++) {
Uint32 tNode = theDBnodes[i];
@@ -254,50 +267,28 @@ Ndb::waitUntilReady(int timeout)
DBUG_RETURN(-1);
}
- do {
- if ((id = theNode) != 0) {
- unsigned int foundAliveNode = 0;
- TransporterFacade *tp = TransporterFacade::instance();
- tp->lock_mutex();
- for (unsigned int i = 0; i < theNoOfDBnodes; i++) {
- const NodeId nodeId = theDBnodes[i];
- //************************************************
- // If any node is answering, ndb is answering
- //************************************************
- if (tp->get_node_alive(nodeId) != 0) {
- foundAliveNode++;
- }//if
- }//for
-
- tp->unlock_mutex();
- if (foundAliveNode == theNoOfDBnodes) {
- DBUG_RETURN(0);
- }//if
- if (foundAliveNode > 0) {
- noChecksSinceFirstAliveFound++;
- }//if
- if (noChecksSinceFirstAliveFound > 30) {
- DBUG_RETURN(0);
- }//if
- }//if theNode != 0
+ while (theNode == 0) {
if (secondsCounter >= timeout)
- break;
+ {
+ theError.code = 4269;
+ DBUG_RETURN(-1);
+ }
NdbSleep_MilliSleep(100);
milliCounter += 100;
if (milliCounter >= 1000) {
secondsCounter++;
milliCounter = 0;
}//if
- } while (1);
- if (id == 0) {
- theError.code = 4269;
+ }
+
+ if (theImpl->m_ndb_cluster_connection.wait_until_ready
+ (timeout-secondsCounter,30))
+ {
+ theError.code = 4009;
DBUG_RETURN(-1);
}
- if (noChecksSinceFirstAliveFound > 0) {
- DBUG_RETURN(0);
- }//if
- theError.code = 4009;
- DBUG_RETURN(-1);
+
+ DBUG_RETURN(0);
}
/*****************************************************************************
@@ -322,8 +313,8 @@ Ndb::startTransaction(Uint32 aPriority, const char * keyData, Uint32 keyLen)
*/
Uint32 nodeId;
if(keyData != 0) {
- Uint32 fragmentId = computeFragmentId(keyData, keyLen);
- nodeId = guessPrimaryNode(fragmentId);
+ nodeId = 0; // guess not supported
+ // nodeId = m_ndb_cluster_connection->guess_primary_node(keyData, keyLen);
} else {
nodeId = 0;
}//if
@@ -385,45 +376,6 @@ Ndb::hupp(NdbTransaction* pBuddyTrans)
}//Ndb::hupp()
NdbTransaction*
-Ndb::startTransactionDGroup(Uint32 aPriority, const char * keyData, int type)
-{
-
- char DGroup[4];
- if ((keyData == NULL) ||
- (type > 1)) {
- theError.code = 4118;
- return NULL;
- }//if
- if (theInitState == Initialised) {
- theError.code = 0;
- checkFailedNode();
- /**
- * If the user supplied key data
- * We will make a qualified quess to which node is the primary for the
- * the fragment and contact that node
- */
- Uint32 fragmentId;
- if (type == 0) {
- DGroup[0] = keyData[0];
- DGroup[1] = keyData[1];
- DGroup[2] = 0x30;
- DGroup[3] = 0x30;
- fragmentId = computeFragmentId(&DGroup[0], 4);
- } else {
- Uint32 hashValue = ((keyData[0] - 0x30) * 10) + (keyData[1] - 0x30);
- fragmentId = getFragmentId(hashValue);
- }//if
- Uint32 nodeId = guessPrimaryNode(fragmentId);
- NdbTransaction* trans= startTransactionLocal(aPriority, nodeId);
- DBUG_PRINT("exit", ("start DGroup trans: 0x%x transid: 0x%llx",
- trans, trans ? trans->getTransactionId() : 0));
- return trans;
- } else {
- return NULL;
- }//if
-}//Ndb::startTransaction()
-
-NdbTransaction*
Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId)
{
#ifdef VM_TRACE
@@ -1026,118 +978,6 @@ Ndb::opTupleIdOnNdb(Uint32 aTableId, Uint64 opValue, Uint32 op)
DBUG_RETURN(~0);
}
-static const Uint32 MAX_KEY_LEN_64_WORDS = 4;
-static const Uint32 MAX_KEY_LEN_32_WORDS = 8;
-static const Uint32 MAX_KEY_LEN_BYTES = 32;
-
-Uint32
-Ndb::computeFragmentId(const char * keyData, Uint32 keyLen)
-{
- Uint64 tempData[MAX_KEY_LEN_64_WORDS];
-
- const Uint32 usedKeyLen = (keyLen + 3) >> 2; // In words
- const char * usedKeyData = 0;
-
- /**
- * If key data buffer is not aligned (on 64 bit boundary)
- * or key len is not a multiple of 4
- * Use temp data
- */
- if(((((UintPtr)keyData) & 7) == 0) && ((keyLen & 3) == 0)) {
- usedKeyData = keyData;
- } else {
- memcpy(&tempData[0], keyData, keyLen);
- const int slack = keyLen & 3;
- if(slack > 0) {
- memset(&((char *)&tempData[0])[keyLen], 0, (4 - slack));
- }//if
- usedKeyData = (char *)&tempData[0];
- }//if
-
- Uint32 hashValue = md5_hash((Uint64 *)usedKeyData, usedKeyLen);
-
- hashValue >>= startTransactionNodeSelectionData.kValue;
- return getFragmentId(hashValue);
-}//Ndb::computeFragmentId()
-
-Uint32
-Ndb::getFragmentId(Uint32 hashValue)
-{
- Uint32 fragmentId = hashValue &
- startTransactionNodeSelectionData.hashValueMask;
- if(fragmentId < startTransactionNodeSelectionData.hashpointerValue) {
- fragmentId = hashValue &
- ((startTransactionNodeSelectionData.hashValueMask << 1) + 1);
- }//if
- return fragmentId;
-}
-
-Uint32
-Ndb::guessPrimaryNode(Uint32 fragmentId){
- //ASSERT(((fragmentId > 0) && fragmentId <
- // startTransactionNodeSelectionData.noOfFragments), "Invalid fragementId");
-
- return startTransactionNodeSelectionData.fragment2PrimaryNodeMap[fragmentId];
-}
-
-void
-Ndb::StartTransactionNodeSelectionData::init(Uint32 noOfNodes,
- Uint32 nodeIds[]) {
- kValue = 6;
- noOfFragments = 2 * noOfNodes;
-
- /**
- * Compute hashValueMask and hashpointerValue
- */
- {
- Uint32 topBit = (1 << 31);
- for(int i = 31; i>=0; i--){
- if((noOfFragments & topBit) != 0)
- break;
- topBit >>= 1;
- }
- hashValueMask = topBit - 1;
- hashpointerValue = noOfFragments - (hashValueMask + 1);
- }
-
- /**
- * This initialization depends on
- * the fact that:
- * primary node for fragment i = i % noOfNodes
- *
- * This algorithm should be implemented in Dbdih
- */
- {
- if (fragment2PrimaryNodeMap != 0)
- abort();
-
- fragment2PrimaryNodeMap = new Uint32[noOfFragments];
- Uint32 i;
- for(i = 0; i<noOfNodes; i++){
- fragment2PrimaryNodeMap[i] = nodeIds[i];
- }
-
- // Sort them (bubble sort)
- for(i = 0; i<noOfNodes-1; i++)
- for(Uint32 j = i+1; j<noOfNodes; j++)
- if(fragment2PrimaryNodeMap[i] > fragment2PrimaryNodeMap[j]){
- Uint32 tmp = fragment2PrimaryNodeMap[i];
- fragment2PrimaryNodeMap[i] = fragment2PrimaryNodeMap[j];
- fragment2PrimaryNodeMap[j] = tmp;
- }
-
- for(i = 0; i<noOfNodes; i++){
- fragment2PrimaryNodeMap[i+noOfNodes] = fragment2PrimaryNodeMap[i];
- }
- }
-}
-
-void
-Ndb::StartTransactionNodeSelectionData::release(){
- delete [] fragment2PrimaryNodeMap;
- fragment2PrimaryNodeMap = 0;
-}
-
Uint32
convertEndian(Uint32 Data)
{
diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp
index 4b6162ff279..745a0635a81 100644
--- a/ndb/src/ndbapi/NdbDictionary.cpp
+++ b/ndb/src/ndbapi/NdbDictionary.cpp
@@ -737,14 +737,6 @@ NdbDictionary::Dictionary::removeCachedTable(const char * name){
m_impl.removeCachedObject(* t);
}
-NdbDictionary::Table
-NdbDictionary::Dictionary::getTableForAlteration(const char * name){
- const NdbDictionary::Table * oldTable = getTable(name);
- return (oldTable) ?
- NdbDictionary::Table(*oldTable)
- : NdbDictionary::Table();
-}
-
int
NdbDictionary::Dictionary::createIndex(const Index & ind)
{
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index 68fe6f9d235..018dfb825b6 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -1375,15 +1375,14 @@ int NdbDictionaryImpl::alterTable(NdbTableImpl &impl)
const char * originalInternalName = internalName.c_str();
BaseString externalName = impl.m_externalName;
const char * originalExternalName = externalName.c_str();
- NdbTableImpl * oldTab = getTable(originalExternalName);
-
- if(!oldTab){
+
+ DBUG_ENTER("NdbDictionaryImpl::alterTable");
+ if(!get_local_table_info(originalInternalName, false)){
m_error.code = 709;
- return -1;
+ DBUG_RETURN(-1);
}
// Alter the table
int ret = m_receiver.alterTable(m_ndb, impl);
-
if(ret == 0){
// Remove cached information and let it be refreshed at next access
if (m_localHash.get(originalInternalName) != NULL) {
@@ -1397,7 +1396,7 @@ int NdbDictionaryImpl::alterTable(NdbTableImpl &impl)
m_globalHash->unlock();
}
}
- return ret;
+ DBUG_RETURN(ret);
}
int
@@ -1412,15 +1411,16 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
NdbTableImpl & impl,
bool alter)
{
+ DBUG_ENTER("NdbDictInterface::createOrAlterTable");
unsigned i;
if((unsigned)impl.getNoOfPrimaryKeys() > NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY){
m_error.code = 4317;
- return -1;
+ DBUG_RETURN(-1);
}
unsigned sz = impl.m_columns.size();
if (sz > NDB_MAX_ATTRIBUTES_IN_TABLE){
m_error.code = 4318;
- return -1;
+ DBUG_RETURN(-1);
}
impl.copyNewProperties();
@@ -1455,7 +1455,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
// Check max length of frm data
if (impl.m_frm.length() > MAX_FRM_DATA_SIZE){
m_error.code = 1229;
- return -1;
+ DBUG_RETURN(-1);
}
tmpTab.FrmLen = impl.m_frm.length();
memcpy(tmpTab.FrmData, impl.m_frm.get_data(), impl.m_frm.length());
@@ -1506,12 +1506,12 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
// charset is defined exactly for char types
if (col->getCharType() != (col->m_cs != NULL)) {
m_error.code = 703;
- return -1;
+ DBUG_RETURN(-1);
}
// primary key type check
if (col->m_pk && ! NdbSqlUtil::usable_in_pk(col->m_type, col->m_cs)) {
m_error.code = 743;
- return -1;
+ DBUG_RETURN(-1);
}
// distribution key not supported for Char attribute
if (col->m_distributionKey && col->m_cs != NULL) {
@@ -1584,7 +1584,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
}
}
}
- return ret;
+ DBUG_RETURN(ret);
}
int
@@ -1643,17 +1643,17 @@ NdbDictInterface::alterTable(NdbApiSignal* signal, LinearSectionPtr ptr[3])
int errCodes[noErrCodes] =
{AlterTableRef::NotMaster,
AlterTableRef::Busy};
- int r = dictSignal(signal,ptr,1,
- 1/*use masternode id*/,
- 100,WAIT_ALTER_TAB_REQ,
- WAITFOR_RESPONSE_TIMEOUT,
- errCodes, noErrCodes);
- if(m_error.code == AlterTableRef::InvalidTableVersion) {
- // Clear caches and try again
- return INCOMPATIBLE_VERSION;
- }
-
- return r;
+ int r = dictSignal(signal,ptr,1,
+ 1/*use masternode id*/,
+ 100,WAIT_ALTER_TAB_REQ,
+ WAITFOR_RESPONSE_TIMEOUT,
+ errCodes, noErrCodes);
+ if(m_error.code == AlterTableRef::InvalidTableVersion) {
+ // Clear caches and try again
+ return INCOMPATIBLE_VERSION;
+ }
+
+ return r;
}
void
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp
index 8af06209307..df20915a0e0 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp
@@ -28,7 +28,7 @@
#include <Bitmask.hpp>
#include <AttributeList.hpp>
#include <Ndb.hpp>
-#include "NdbImpl.hpp"
+#include "NdbWaiter.hpp"
#include "DictCache.hpp"
class NdbDictObjectImpl {
diff --git a/ndb/src/ndbapi/NdbEventOperation.cpp b/ndb/src/ndbapi/NdbEventOperation.cpp
index 506a6c8d86d..d209293f8b0 100644
--- a/ndb/src/ndbapi/NdbEventOperation.cpp
+++ b/ndb/src/ndbapi/NdbEventOperation.cpp
@@ -121,5 +121,5 @@ NdbEventOperation::wait(void *p, int aMillisecondNumber)
}
NdbEventOperation::NdbEventOperation(NdbEventOperationImpl& impl)
- : m_impl(impl) {};
+ : m_impl(impl) {}
diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp
index b8f0cdd64a9..00a8ef19f3a 100644
--- a/ndb/src/ndbapi/NdbImpl.hpp
+++ b/ndb/src/ndbapi/NdbImpl.hpp
@@ -17,7 +17,19 @@
#ifndef NDB_IMPL_HPP
#define NDB_IMPL_HPP
-#include <Vector.hpp>
+#include <ndb_global.h>
+#include <Ndb.hpp>
+#include <NdbOut.hpp>
+#include <NdbError.hpp>
+#include <NdbCondition.h>
+#include <NdbReceiver.hpp>
+#include <NdbOperation.hpp>
+#include <kernel/ndb_limits.h>
+
+#include <NdbTick.h>
+
+#include "ndb_cluster_connection_impl.hpp"
+#include "NdbDictionaryImpl.hpp"
#include "ObjectMap.hpp"
/**
@@ -25,20 +37,29 @@
*/
class NdbImpl {
public:
- Vector<class NdbTableImpl *> m_invalidTables;
+ NdbImpl(Ndb_cluster_connection *, Ndb&);
+ ~NdbImpl();
- void checkErrorCode(Uint32 i);
- void checkInvalidTable(class NdbDictionaryImpl * dict);
-};
+ Ndb_cluster_connection_impl &m_ndb_cluster_connection;
-#include <Ndb.hpp>
-#include <NdbError.hpp>
-#include <NdbCondition.h>
-#include <NdbReceiver.hpp>
-#include <NdbTransaction.hpp>
-#include <NdbOperation.hpp>
+ NdbDictionaryImpl m_dictionary;
-#include <NdbTick.h>
+ // Ensure good distribution of connects
+ Uint32 theCurrentConnectIndex;
+ Ndb_cluster_connection_node_iter m_node_iter;
+
+ NdbObjectIdMap theNdbObjectIdMap;
+
+ Uint32 theNoOfDBnodes; // The number of DB nodes
+ Uint8 theDBnodes[MAX_NDB_NODES]; // The node number of the DB nodes
+
+ // 1 indicates to release all connections to node
+ Uint32 the_release_ind[MAX_NDB_NODES];
+
+ NdbWaiter theWaiter;
+
+ int m_optimized_node_selection;
+};
#ifdef VM_TRACE
#define TRACE_DEBUG(x) ndbout << x << endl;
@@ -58,7 +79,7 @@ public:
inline
void *
Ndb::int2void(Uint32 val){
- return theNdbObjectIdMap->getObject(val);
+ return theImpl->theNdbObjectIdMap.getObject(val);
}
inline
@@ -105,26 +126,6 @@ Ndb::checkInitState()
Uint32 convertEndian(Uint32 Data);
-enum WaitSignalType {
- NO_WAIT = 0,
- WAIT_NODE_FAILURE = 1, // Node failure during wait
- WST_WAIT_TIMEOUT = 2, // Timeout during wait
-
- WAIT_TC_SEIZE = 3,
- WAIT_TC_RELEASE = 4,
- WAIT_NDB_TAMPER = 5,
- WAIT_SCAN = 6,
-
- // DICT stuff
- WAIT_GET_TAB_INFO_REQ = 11,
- WAIT_CREATE_TAB_REQ = 12,
- WAIT_DROP_TAB_REQ = 13,
- WAIT_ALTER_TAB_REQ = 14,
- WAIT_CREATE_INDX_REQ = 15,
- WAIT_DROP_INDX_REQ = 16,
- WAIT_LIST_TABLES_CONF = 17
-};
-
enum LockMode {
Read,
Update,
@@ -132,44 +133,4 @@ enum LockMode {
Delete
};
-#include <NdbOut.hpp>
-
-inline
-void
-NdbWaiter::wait(int waitTime)
-{
- const bool forever = (waitTime == -1);
- const NDB_TICKS maxTime = NdbTick_CurrentMillisecond() + waitTime;
- while (1) {
- if (m_state == NO_WAIT || m_state == WAIT_NODE_FAILURE)
- break;
- if (forever) {
- NdbCondition_Wait(m_condition, (NdbMutex*)m_mutex);
- } else {
- if (waitTime <= 0) {
- m_state = WST_WAIT_TIMEOUT;
- break;
- }
- NdbCondition_WaitTimeout(m_condition, (NdbMutex*)m_mutex, waitTime);
- waitTime = maxTime - NdbTick_CurrentMillisecond();
- }
- }
-}
-
-inline
-void
-NdbWaiter::nodeFail(Uint32 aNodeId){
- if (m_state != NO_WAIT && m_node == aNodeId){
- m_state = WAIT_NODE_FAILURE;
- NdbCondition_Signal(m_condition);
- }
-}
-
-inline
-void
-NdbWaiter::signal(Uint32 state){
- m_state = state;
- NdbCondition_Signal(m_condition);
-}
-
#endif
diff --git a/ndb/src/ndbapi/NdbReceiver.cpp b/ndb/src/ndbapi/NdbReceiver.cpp
index 41619c6b14c..df16ae66915 100644
--- a/ndb/src/ndbapi/NdbReceiver.cpp
+++ b/ndb/src/ndbapi/NdbReceiver.cpp
@@ -40,7 +40,7 @@ NdbReceiver::~NdbReceiver()
{
DBUG_ENTER("NdbReceiver::~NdbReceiver");
if (m_id != NdbObjectIdMap::InvalidId) {
- m_ndb->theNdbObjectIdMap->unmap(m_id, this);
+ m_ndb->theImpl->theNdbObjectIdMap.unmap(m_id, this);
}
delete[] m_rows;
DBUG_VOID_RETURN;
@@ -54,7 +54,7 @@ NdbReceiver::init(ReceiverType type, void* owner)
m_owner = owner;
if (m_id == NdbObjectIdMap::InvalidId) {
if (m_ndb)
- m_id = m_ndb->theNdbObjectIdMap->map(this);
+ m_id = m_ndb->theImpl->theNdbObjectIdMap.map(this);
}
theFirstRecAttr = NULL;
diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp
index f462cc536e1..f3f73c75ac0 100644
--- a/ndb/src/ndbapi/NdbScanFilter.cpp
+++ b/ndb/src/ndbapi/NdbScanFilter.cpp
@@ -289,7 +289,7 @@ NdbScanFilterImpl::cond_col(Interpreter::UnaryCondition op, Uint32 AttrId){
Branch1 branch = table2[op].m_branches[m_current.m_group];
(m_operation->* branch)(AttrId, m_current.m_ownLabel);
return 0;
-};
+}
int
NdbScanFilter::isnull(int AttrId){
diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp
index f3368a89da0..68cdce17b0d 100644
--- a/ndb/src/ndbapi/NdbScanOperation.cpp
+++ b/ndb/src/ndbapi/NdbScanOperation.cpp
@@ -487,8 +487,8 @@ int NdbScanOperation::nextResultImpl(bool fetchAllowed, bool forceSend)
/**
* No completed...
*/
- theNdb->theWaiter.m_node = nodeId;
- theNdb->theWaiter.m_state = WAIT_SCAN;
+ theNdb->theImpl->theWaiter.m_node = nodeId;
+ theNdb->theImpl->theWaiter.m_state = WAIT_SCAN;
int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT);
if (return_code == 0 && seq == tp->getNodeSequence(nodeId)) {
continue;
@@ -1323,8 +1323,8 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed,
Uint32 tmp = m_sent_receivers_count;
s_idx = m_current_api_receiver;
while(m_sent_receivers_count > 0 && !theError.code){
- theNdb->theWaiter.m_node = nodeId;
- theNdb->theWaiter.m_state = WAIT_SCAN;
+ theNdb->theImpl->theWaiter.m_node = nodeId;
+ theNdb->theImpl->theWaiter.m_state = WAIT_SCAN;
int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT);
if (return_code == 0 && seq == tp->getNodeSequence(nodeId)) {
continue;
@@ -1471,8 +1471,8 @@ NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){
*/
while(theError.code == 0 && m_sent_receivers_count)
{
- theNdb->theWaiter.m_node = nodeId;
- theNdb->theWaiter.m_state = WAIT_SCAN;
+ theNdb->theImpl->theWaiter.m_node = nodeId;
+ theNdb->theImpl->theWaiter.m_state = WAIT_SCAN;
int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT);
switch(return_code){
case 0:
@@ -1541,8 +1541,8 @@ NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){
*/
while(m_sent_receivers_count+m_api_receivers_count+m_conf_receivers_count)
{
- theNdb->theWaiter.m_node = nodeId;
- theNdb->theWaiter.m_state = WAIT_SCAN;
+ theNdb->theImpl->theWaiter.m_node = nodeId;
+ theNdb->theImpl->theWaiter.m_state = WAIT_SCAN;
int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT);
switch(return_code){
case 0:
diff --git a/ndb/src/ndbapi/NdbTransaction.cpp b/ndb/src/ndbapi/NdbTransaction.cpp
index 0ecfd3924bd..717089b8916 100644
--- a/ndb/src/ndbapi/NdbTransaction.cpp
+++ b/ndb/src/ndbapi/NdbTransaction.cpp
@@ -83,7 +83,7 @@ NdbTransaction::NdbTransaction( Ndb* aNdb ) :
{
theListState = NotInList;
theError.code = 0;
- theId = theNdb->theNdbObjectIdMap->map(this);
+ theId = theNdb->theImpl->theNdbObjectIdMap.map(this);
#define CHECK_SZ(mask, sz) assert((sizeof(mask)/sizeof(mask[0])) == sz)
@@ -99,7 +99,7 @@ Remark: Deletes the connection object.
NdbTransaction::~NdbTransaction()
{
DBUG_ENTER("NdbTransaction::~NdbTransaction");
- theNdb->theNdbObjectIdMap->unmap(theId, this);
+ theNdb->theImpl->theNdbObjectIdMap.unmap(theId, this);
DBUG_VOID_RETURN;
}//NdbTransaction::~NdbTransaction()
diff --git a/ndb/src/ndbapi/NdbWaiter.hpp b/ndb/src/ndbapi/NdbWaiter.hpp
new file mode 100644
index 00000000000..8b7b2a75879
--- /dev/null
+++ b/ndb/src/ndbapi/NdbWaiter.hpp
@@ -0,0 +1,102 @@
+/* Copyright (C) 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; either version 2 of the License, or
+ (at your option) any later version.
+
+ 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 */
+
+#ifndef NDB_WAITER_HPP
+#define NDB_WAITER_HPP
+
+#include <ndb_global.h>
+#include <NdbOut.hpp>
+#include <NdbError.hpp>
+#include <NdbCondition.h>
+#include <NdbReceiver.hpp>
+#include <NdbOperation.hpp>
+#include <kernel/ndb_limits.h>
+
+#include <NdbTick.h>
+
+enum WaitSignalType {
+ NO_WAIT = 0,
+ WAIT_NODE_FAILURE = 1, // Node failure during wait
+ WST_WAIT_TIMEOUT = 2, // Timeout during wait
+
+ WAIT_TC_SEIZE = 3,
+ WAIT_TC_RELEASE = 4,
+ WAIT_NDB_TAMPER = 5,
+ WAIT_SCAN = 6,
+
+ // DICT stuff
+ WAIT_GET_TAB_INFO_REQ = 11,
+ WAIT_CREATE_TAB_REQ = 12,
+ WAIT_DROP_TAB_REQ = 13,
+ WAIT_ALTER_TAB_REQ = 14,
+ WAIT_CREATE_INDX_REQ = 15,
+ WAIT_DROP_INDX_REQ = 16,
+ WAIT_LIST_TABLES_CONF = 17
+};
+
+class NdbWaiter {
+public:
+ NdbWaiter();
+ ~NdbWaiter();
+
+ void wait(int waitTime);
+ void nodeFail(Uint32 node);
+ void signal(Uint32 state);
+
+ Uint32 m_node;
+ Uint32 m_state;
+ void * m_mutex;
+ struct NdbCondition * m_condition;
+};
+
+inline
+void
+NdbWaiter::wait(int waitTime)
+{
+ const bool forever = (waitTime == -1);
+ const NDB_TICKS maxTime = NdbTick_CurrentMillisecond() + waitTime;
+ while (1) {
+ if (m_state == NO_WAIT || m_state == WAIT_NODE_FAILURE)
+ break;
+ if (forever) {
+ NdbCondition_Wait(m_condition, (NdbMutex*)m_mutex);
+ } else {
+ if (waitTime <= 0) {
+ m_state = WST_WAIT_TIMEOUT;
+ break;
+ }
+ NdbCondition_WaitTimeout(m_condition, (NdbMutex*)m_mutex, waitTime);
+ waitTime = maxTime - NdbTick_CurrentMillisecond();
+ }
+ }
+}
+
+inline
+void
+NdbWaiter::nodeFail(Uint32 aNodeId){
+ if (m_state != NO_WAIT && m_node == aNodeId){
+ m_state = WAIT_NODE_FAILURE;
+ NdbCondition_Signal(m_condition);
+ }
+}
+
+inline
+void
+NdbWaiter::signal(Uint32 state){
+ m_state = state;
+ NdbCondition_Signal(m_condition);
+}
+
+#endif
diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp
index 86be84e0b6c..4cfc6c16715 100644
--- a/ndb/src/ndbapi/Ndbif.cpp
+++ b/ndb/src/ndbapi/Ndbif.cpp
@@ -91,8 +91,8 @@ Ndb::init(int aMaxNoOfTransactions)
theDictionary->setTransporter(this, theFacade);
- aNrOfCon = theNoOfDBnodes;
- aNrOfOp = 2*theNoOfDBnodes;
+ aNrOfCon = theImpl->theNoOfDBnodes;
+ aNrOfOp = 2*theImpl->theNoOfDBnodes;
// Create connection object in a linked list
if((createConIdleList(aNrOfCon)) == -1){
@@ -191,14 +191,14 @@ void Ndb::connected(Uint32 ref)
}
TransporterFacade * theFacade = TransporterFacade::instance();
- int i;
- theNoOfDBnodes= 0;
+ int i, n= 0;
for (i = 1; i < MAX_NDB_NODES; i++){
if (theFacade->getIsDbNode(i)){
- theDBnodes[theNoOfDBnodes] = i;
- theNoOfDBnodes++;
+ theImpl->theDBnodes[n] = i;
+ n++;
}
}
+ theImpl->theNoOfDBnodes= n;
theFirstTransId = ((Uint64)tBlockNo << 52)+
((Uint64)tmpTheNode << 40);
theFirstTransId += theFacade->m_max_trans_id;
@@ -206,9 +206,8 @@ void Ndb::connected(Uint32 ref)
DBUG_PRINT("info",("connected with ref=%x, id=%d, no_db_nodes=%d, first_trans_id=%lx",
theMyRef,
tmpTheNode,
- theNoOfDBnodes,
+ theImpl->theNoOfDBnodes,
theFirstTransId));
- startTransactionNodeSelectionData.init(theNoOfDBnodes, theDBnodes);
theCommitAckSignal = new NdbApiSignal(theMyRef);
theDictionary->m_receiver.m_reference= theMyRef;
@@ -246,8 +245,10 @@ Ndb::report_node_failure(Uint32 node_id)
*
* This method is only called by ClusterMgr (via lots of methods)
*/
- the_release_ind[node_id] = 1;
- theWaiter.nodeFail(node_id);
+ theImpl->the_release_ind[node_id] = 1;
+ // must come after
+ theImpl->the_release_ind[0] = 1;
+ theImpl->theWaiter.nodeFail(node_id);
return;
}//Ndb::report_node_failure()
@@ -327,7 +328,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
NdbTransaction* tCon;
int tReturnCode = -1;
const Uint32* tDataPtr = aSignal->getDataPtr();
- const Uint32 tWaitState = theWaiter.m_state;
+ const Uint32 tWaitState = theImpl->theWaiter.m_state;
const Uint32 tSignalNumber = aSignal->readSignalNumber();
const Uint32 tFirstData = *tDataPtr;
const Uint32 tLen = aSignal->getLength();
@@ -398,7 +399,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
break;
case NdbReceiver::NDB_SCANRECEIVER:
tCon->theScanningOp->receiver_delivered(tRec);
- theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ?
+ theImpl->theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ?
(Uint32) NO_WAIT : tWaitState);
break;
default:
@@ -595,7 +596,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
}//if
tReturnCode = tCon->receiveTCSEIZECONF(aSignal);
if (tReturnCode != -1) {
- theWaiter.m_state = NO_WAIT;
+ theImpl->theWaiter.m_state = NO_WAIT;
} else {
goto InvalidSignal;
}//if
@@ -615,7 +616,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
}//if
tReturnCode = tCon->receiveTCSEIZEREF(aSignal);
if (tReturnCode != -1) {
- theWaiter.m_state = NO_WAIT;
+ theImpl->theWaiter.m_state = NO_WAIT;
} else {
return;
}//if
@@ -635,7 +636,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
}//if
tReturnCode = tCon->receiveTCRELEASECONF(aSignal);
if (tReturnCode != -1) {
- theWaiter.m_state = NO_WAIT;
+ theImpl->theWaiter.m_state = NO_WAIT;
}//if
break;
}
@@ -653,7 +654,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
}//if
tReturnCode = tCon->receiveTCRELEASEREF(aSignal);
if (tReturnCode != -1) {
- theWaiter.m_state = NO_WAIT;
+ theImpl->theWaiter.m_state = NO_WAIT;
}//if
break;
}
@@ -705,7 +706,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
return;
tReturnCode = tCon->receiveDIHNDBTAMPER(aSignal);
if (tReturnCode != -1)
- theWaiter.m_state = NO_WAIT;
+ theImpl->theWaiter.m_state = NO_WAIT;
break;
}
case GSN_SCAN_TABCONF:
@@ -727,7 +728,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tLen - ScanTabConf::SignalLength);
}
if (tReturnCode != -1 && tWaitState == WAIT_SCAN)
- theWaiter.m_state = NO_WAIT;
+ theImpl->theWaiter.m_state = NO_WAIT;
break;
} else {
goto InvalidSignal;
@@ -746,7 +747,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tCon->checkMagicNumber() == 0){
tReturnCode = tCon->receiveSCAN_TABREF(aSignal);
if (tReturnCode != -1 && tWaitState == WAIT_SCAN){
- theWaiter.m_state = NO_WAIT;
+ theImpl->theWaiter.m_state = NO_WAIT;
}
break;
}
@@ -771,7 +772,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
switch(com){
case 1:
tCon->theScanningOp->receiver_delivered(tRec);
- theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ?
+ theImpl->theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ?
(Uint32) NO_WAIT : tWaitState);
break;
case 0:
@@ -835,16 +836,16 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
goto InvalidSignal;
}//switch
- if (theWaiter.m_state == NO_WAIT) {
+ if (theImpl->theWaiter.m_state == NO_WAIT) {
// Wake up the thread waiting for response
- NdbCondition_Signal(theWaiter.m_condition);
+ NdbCondition_Signal(theImpl->theWaiter.m_condition);
}//if
return;
InvalidSignal:
#ifdef VM_TRACE
ndbout_c("Ndbif: Error Ndb::handleReceivedSignal "
- "(GSN=%d, theWaiter.m_state=%d)"
+ "(GSN=%d, theImpl->theWaiter.m_state=%d)"
" sender = (Block: %d Node: %d)",
tSignalNumber,
tWaitState,
@@ -892,7 +893,7 @@ Ndb::completedTransaction(NdbTransaction* aCon)
if ((theMinNoOfEventsToWakeUp != 0) &&
(theNoOfCompletedTransactions >= theMinNoOfEventsToWakeUp)) {
theMinNoOfEventsToWakeUp = 0;
- NdbCondition_Signal(theWaiter.m_condition);
+ NdbCondition_Signal(theImpl->theWaiter.m_condition);
return;
}//if
} else {
@@ -1153,9 +1154,9 @@ void
Ndb::waitCompletedTransactions(int aMilliSecondsToWait,
int noOfEventsToWaitFor)
{
- theWaiter.m_state = NO_WAIT;
+ theImpl->theWaiter.m_state = NO_WAIT;
/**
- * theWaiter.m_state = NO_WAIT;
+ * theImpl->theWaiter.m_state = NO_WAIT;
* To ensure no messup with synchronous node fail handling
* (see ReportFailure)
*/
@@ -1164,8 +1165,8 @@ Ndb::waitCompletedTransactions(int aMilliSecondsToWait,
theMinNoOfEventsToWakeUp = noOfEventsToWaitFor;
do {
if (waitTime < 1000) waitTime = 1000;
- NdbCondition_WaitTimeout(theWaiter.m_condition,
- (NdbMutex*)theWaiter.m_mutex,
+ NdbCondition_WaitTimeout(theImpl->theWaiter.m_condition,
+ (NdbMutex*)theImpl->theWaiter.m_mutex,
waitTime);
if (theNoOfCompletedTransactions >= (Uint32)noOfEventsToWaitFor) {
break;
@@ -1271,23 +1272,23 @@ Ndb::receiveResponse(int waitTime){
int tResultCode;
TransporterFacade::instance()->checkForceSend(theNdbBlockNumber);
- theWaiter.wait(waitTime);
+ theImpl->theWaiter.wait(waitTime);
- if(theWaiter.m_state == NO_WAIT) {
+ if(theImpl->theWaiter.m_state == NO_WAIT) {
tResultCode = 0;
} else {
#ifdef VM_TRACE
- ndbout << "ERR: receiveResponse - theWaiter.m_state = ";
- ndbout << theWaiter.m_state << endl;
+ ndbout << "ERR: receiveResponse - theImpl->theWaiter.m_state = ";
+ ndbout << theImpl->theWaiter.m_state << endl;
#endif
- if (theWaiter.m_state == WAIT_NODE_FAILURE){
+ if (theImpl->theWaiter.m_state == WAIT_NODE_FAILURE){
tResultCode = -2;
} else {
tResultCode = -1;
}
- theWaiter.m_state = NO_WAIT;
+ theImpl->theWaiter.m_state = NO_WAIT;
}
return tResultCode;
}//Ndb::receiveResponse()
@@ -1319,8 +1320,8 @@ Ndb::sendRecSignal(Uint16 node_id,
if (tp->check_send_size(node_id, send_size)) {
return_code = tp->sendSignal(aSignal, node_id);
if (return_code != -1) {
- theWaiter.m_node = node_id;
- theWaiter.m_state = aWaitState;
+ theImpl->theWaiter.m_node = node_id;
+ theImpl->theWaiter.m_state = aWaitState;
return_code = receiveResponse();
} else {
return_code = -3;
diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp
index e6711155a94..55a30a9742d 100644
--- a/ndb/src/ndbapi/Ndbinit.cpp
+++ b/ndb/src/ndbapi/Ndbinit.cpp
@@ -50,7 +50,9 @@ Ndb(const char* aDataBase);
Parameters: aDataBase : Name of the database.
Remark: Connect to the database.
***************************************************************************/
-Ndb::Ndb( const char* aDataBase , const char* aSchema) {
+Ndb::Ndb( const char* aDataBase , const char* aSchema)
+ : theImpl(NULL)
+{
DBUG_ENTER("Ndb::Ndb()");
DBUG_PRINT("enter",("(old)Ndb::Ndb this=0x%x", this));
if (theNoOfNdbObjects < 0)
@@ -66,6 +68,7 @@ Ndb::Ndb( const char* aDataBase , const char* aSchema) {
Ndb::Ndb( Ndb_cluster_connection *ndb_cluster_connection,
const char* aDataBase , const char* aSchema)
+ : theImpl(NULL)
{
DBUG_ENTER("Ndb::Ndb()");
DBUG_PRINT("enter",("Ndb::Ndb this=0x%x", this));
@@ -82,8 +85,10 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection,
{
DBUG_ENTER("Ndb::setup");
- theNdbObjectIdMap= 0;
- m_ndb_cluster_connection= ndb_cluster_connection;
+ assert(theImpl == NULL);
+ theImpl= new NdbImpl(ndb_cluster_connection,*this);
+ theDictionary= &(theImpl->m_dictionary);
+
thePreparedTransactionsArray= NULL;
theSentTransactionsArray= NULL;
theCompletedTransactionsArray= NULL;
@@ -94,8 +99,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection,
theMaxNoOfTransactions= 0;
theMinNoOfEventsToWakeUp= 0;
prefixEnd= NULL;
- theImpl= NULL;
- theDictionary= NULL;
theConIdleList= NULL;
theOpIdleList= NULL;
theScanOpIdleList= NULL;
@@ -110,9 +113,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection,
theCallList= NULL;
theScanList= NULL;
theNdbBlobIdleList= NULL;
- theNoOfDBnodes= 0;
- theDBnodes= NULL;
- the_release_ind= NULL;
the_last_check_time= 0;
theFirstTransId= 0;
theRestartGCI= 0;
@@ -134,19 +134,12 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection,
theError.code = 0;
- theNdbObjectIdMap = new NdbObjectIdMap(1024,1024);
theConnectionArray = new NdbConnection * [MAX_NDB_NODES];
- theDBnodes = new Uint32[MAX_NDB_NODES];
- the_release_ind = new Uint8[MAX_NDB_NODES];
theCommitAckSignal = NULL;
- theCurrentConnectCounter = 1;
- theCurrentConnectIndex = 0;
int i;
for (i = 0; i < MAX_NDB_NODES ; i++) {
theConnectionArray[i] = NULL;
- the_release_ind[i] = 0;
- theDBnodes[i] = 0;
}//forg
for (i = 0; i < 2048 ; i++) {
theFirstTupleId[i] = 0;
@@ -164,14 +157,12 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection,
prefixEnd = prefixName + (len < (int) sizeof(prefixName) ? len :
sizeof(prefixName) - 1);
- theWaiter.m_mutex = TransporterFacade::instance()->theMutexPtr;
+ theImpl->theWaiter.m_mutex = TransporterFacade::instance()->theMutexPtr;
// Signal that the constructor has finished OK
if (theInitState == NotConstructed)
theInitState = NotInitialised;
- theImpl = new NdbImpl();
-
{
NdbGlobalEventBufferHandle *h=
NdbGlobalEventBuffer_init(NDB_MAX_ACTIVE_EVENTS);
@@ -182,11 +173,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection,
theGlobalEventBufferHandle = h;
}
- theDictionary = new NdbDictionaryImpl(*this);
- if (theDictionary == NULL) {
- ndbout_c("Ndb cailed to allocate dictionary");
- exit(-1);
- }
DBUG_VOID_RETURN;
}
@@ -212,9 +198,6 @@ Ndb::~Ndb()
DBUG_PRINT("enter",("Ndb::~Ndb this=0x%x",this));
doDisconnect();
- delete theDictionary;
- delete theImpl;
-
NdbGlobalEventBuffer_drop(theGlobalEventBufferHandle);
if (TransporterFacade::instance() != NULL && theNdbBlockNumber > 0){
@@ -257,18 +240,14 @@ Ndb::~Ndb()
freeSignal();
releaseTransactionArrays();
- startTransactionNodeSelectionData.release();
delete []theConnectionArray;
- delete []theDBnodes;
- delete []the_release_ind;
if(theCommitAckSignal != NULL){
delete theCommitAckSignal;
theCommitAckSignal = NULL;
}
- if(theNdbObjectIdMap != 0)
- delete theNdbObjectIdMap;
+ delete theImpl;
/**
* This sleep is to make sure that the transporter
@@ -307,4 +286,23 @@ NdbWaiter::~NdbWaiter(){
NdbCondition_Destroy(m_condition);
}
+NdbImpl::NdbImpl(Ndb_cluster_connection *ndb_cluster_connection,
+ Ndb& ndb)
+ : m_ndb_cluster_connection(ndb_cluster_connection->m_impl),
+ m_dictionary(ndb),
+ theCurrentConnectIndex(0),
+ theNdbObjectIdMap(1024,1024),
+ theNoOfDBnodes(0)
+{
+ int i;
+ for (i = 0; i < MAX_NDB_NODES; i++) {
+ the_release_ind[i] = 0;
+ }
+ m_optimized_node_selection=
+ m_ndb_cluster_connection.m_optimized_node_selection;
+}
+
+NdbImpl::~NdbImpl()
+{
+}
diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp
index 499e6ef7ad0..df90f3378ab 100644
--- a/ndb/src/ndbapi/Ndblist.cpp
+++ b/ndb/src/ndbapi/Ndblist.cpp
@@ -29,10 +29,18 @@ void
Ndb::checkFailedNode()
{
DBUG_ENTER("Ndb::checkFailedNode");
- DBUG_PRINT("enter", ("theNoOfDBnodes: %d", theNoOfDBnodes));
+ Uint32 *the_release_ind= theImpl->the_release_ind;
+ if (the_release_ind[0] == 0)
+ {
+ DBUG_VOID_RETURN;
+ }
+ Uint32 tNoOfDbNodes = theImpl->theNoOfDBnodes;
+ Uint8 *theDBnodes= theImpl->theDBnodes;
+
+ DBUG_PRINT("enter", ("theNoOfDBnodes: %d", tNoOfDbNodes));
- DBUG_ASSERT(theNoOfDBnodes < MAX_NDB_NODES);
- for (Uint32 i = 0; i < theNoOfDBnodes; i++){
+ DBUG_ASSERT(tNoOfDbNodes < MAX_NDB_NODES);
+ for (Uint32 i = 0; i < tNoOfDbNodes; i++){
const NodeId node_id = theDBnodes[i];
DBUG_PRINT("info", ("i: %d, node_id: %d", i, node_id));
@@ -55,31 +63,6 @@ Ndb::checkFailedNode()
DBUG_VOID_RETURN;
}
-#if 0
-void
-NdbImpl::checkInvalidTable(NdbDictionaryImpl * dict){
- Uint32 sz = m_invalidTables.size();
- for(Int32 i = sz - 1; i >= 0; i--){
- NdbTableImpl * tab = m_invalidTables[i];
- m_invalidTables.erase(i);
- dict->tableDropped(* tab);
- }
-}
-
-void
-NdbImpl::checkErrorCode(Uint32 i, NdbTableImpl * tab){
- switch(i){
- case 241:
- case 283:
- case 284:
- case 285:
- case 1225:
- case 1226:
-
- }
-}
-#endif
-
/***************************************************************************
* int createConIdleList(int aNrOfCon);
*
diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp
index 6287e0ff43e..b179c1fe6b9 100644
--- a/ndb/src/ndbapi/TransporterFacade.cpp
+++ b/ndb/src/ndbapi/TransporterFacade.cpp
@@ -616,6 +616,9 @@ TransporterFacade::ReportNodeFailureComplete(NodeId tNodeId)
* After the restart the node is up again and the Ndb object
* might not have noticed the failure.
*/
+
+ DBUG_ENTER("TransporterFacade::ReportNodeFailureComplete");
+ DBUG_PRINT("enter",("nodeid= %d", tNodeId));
Uint32 sz = m_threads.m_statusNext.size();
for (Uint32 i = 0; i < sz ; i ++) {
if (m_threads.getInUse(i)){
@@ -624,6 +627,7 @@ TransporterFacade::ReportNodeFailureComplete(NodeId tNodeId)
(*RegPC) (obj, tNodeId, false, true);
}
}
+ DBUG_VOID_RETURN;
}
void
diff --git a/ndb/src/ndbapi/TransporterFacade.hpp b/ndb/src/ndbapi/TransporterFacade.hpp
index bbc1c77a26a..bd3fc67a8d6 100644
--- a/ndb/src/ndbapi/TransporterFacade.hpp
+++ b/ndb/src/ndbapi/TransporterFacade.hpp
@@ -126,7 +126,7 @@ private:
friend class ExtSender; ///< @todo Hack to be able to sendSignalUnCond
friend class GrepSS;
friend class Ndb;
- friend class Ndb_cluster_connection;
+ friend class Ndb_cluster_connection_impl;
int sendSignalUnCond(NdbApiSignal *, NodeId nodeId);
diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp
index 130287b6fee..0a3f8bd3eaa 100644
--- a/ndb/src/ndbapi/ndb_cluster_connection.cpp
+++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp
@@ -18,7 +18,9 @@
#include <my_pthread.h>
#include <my_sys.h>
-#include <ndb_cluster_connection.hpp>
+#include "ndb_cluster_connection_impl.hpp"
+#include <mgmapi_configuration.hpp>
+#include <mgmapi_config_parameters.h>
#include <TransporterFacade.hpp>
#include <NdbOut.hpp>
#include <NdbSleep.h>
@@ -36,59 +38,46 @@ NdbMutex *ndb_global_event_buffer_mutex= NULL;
NdbMutex *ndb_print_state_mutex= NULL;
#endif
+/*
+ * Ndb_cluster_connection
+ */
+
Ndb_cluster_connection::Ndb_cluster_connection(const char *connect_string)
+ : m_impl(* new Ndb_cluster_connection_impl(connect_string))
{
- DBUG_ENTER("Ndb_cluster_connection");
- DBUG_PRINT("enter",("Ndb_cluster_connection this=0x%x", this));
-
- m_config_retriever= 0;
- m_connect_thread= 0;
- m_connect_callback= 0;
-
- if (ndb_global_event_buffer_mutex == NULL)
- {
- ndb_global_event_buffer_mutex= NdbMutex_Create();
- }
-#ifdef VM_TRACE
- if (ndb_print_state_mutex == NULL)
- {
- ndb_print_state_mutex= NdbMutex_Create();
- }
-#endif
- m_config_retriever=
- new ConfigRetriever(connect_string, NDB_VERSION, NODE_TYPE_API);
+}
- m_facade= TransporterFacade::theFacadeInstance
- = new TransporterFacade(m_config_retriever->get_mgmHandle());
+Ndb_cluster_connection::Ndb_cluster_connection
+(Ndb_cluster_connection_impl& impl) : m_impl(impl)
+{
+}
- if (m_config_retriever->hasError())
- {
- printf("Could not connect initialize handle to management server: %s",
- m_config_retriever->getErrorString());
- delete m_config_retriever;
- m_config_retriever= 0;
- }
- DBUG_VOID_RETURN;
+Ndb_cluster_connection::~Ndb_cluster_connection()
+{
+ Ndb_cluster_connection_impl *tmp = &m_impl;
+ if (this != tmp)
+ delete tmp;
}
int Ndb_cluster_connection::get_connected_port() const
{
- if (m_config_retriever)
- return m_config_retriever->get_mgmd_port();
+ if (m_impl.m_config_retriever)
+ return m_impl.m_config_retriever->get_mgmd_port();
return -1;
}
const char *Ndb_cluster_connection::get_connected_host() const
{
- if (m_config_retriever)
- return m_config_retriever->get_mgmd_host();
+ if (m_impl.m_config_retriever)
+ return m_impl.m_config_retriever->get_mgmd_host();
return 0;
}
-const char *Ndb_cluster_connection::get_connectstring(char *buf, int buf_sz) const
+const char *Ndb_cluster_connection::get_connectstring(char *buf,
+ int buf_sz) const
{
- if (m_config_retriever)
- return m_config_retriever->get_connectstring(buf,buf_sz);
+ if (m_impl.m_config_retriever)
+ return m_impl.m_config_retriever->get_connectstring(buf,buf_sz);
return 0;
}
@@ -96,98 +85,429 @@ extern "C" pthread_handler_decl(run_ndb_cluster_connection_connect_thread, me)
{
my_thread_init();
g_run_connect_thread= 1;
- ((Ndb_cluster_connection*) me)->connect_thread();
+ ((Ndb_cluster_connection_impl*) me)->connect_thread();
my_thread_end();
NdbThread_Exit(0);
return me;
}
-void Ndb_cluster_connection::connect_thread()
-{
- DBUG_ENTER("Ndb_cluster_connection::connect_thread");
- int r;
- do {
- NdbSleep_SecSleep(1);
- if ((r = connect(0,0,0)) == 0)
- break;
- if (r == -1) {
- printf("Ndb_cluster_connection::connect_thread error\n");
- DBUG_ASSERT(false);
- g_run_connect_thread= 0;
- } else {
- // Wait before making a new connect attempt
- NdbSleep_SecSleep(1);
- }
- } while (g_run_connect_thread);
- if (m_connect_callback)
- (*m_connect_callback)();
- DBUG_VOID_RETURN;
-}
-
int Ndb_cluster_connection::start_connect_thread(int (*connect_callback)(void))
{
int r;
DBUG_ENTER("Ndb_cluster_connection::start_connect_thread");
- m_connect_callback= connect_callback;
+ m_impl.m_connect_callback= connect_callback;
if ((r = connect(0,0,0)) == 1)
{
DBUG_PRINT("info",("starting thread"));
- m_connect_thread=
+ m_impl.m_connect_thread=
NdbThread_Create(run_ndb_cluster_connection_connect_thread,
- (void**)this, 32768, "ndb_cluster_connection",
+ (void**)&m_impl, 32768, "ndb_cluster_connection",
NDB_THREAD_PRIO_LOW);
}
else if (r < 0)
{
DBUG_RETURN(-1);
}
- else if (m_connect_callback)
+ else if (m_impl.m_connect_callback)
{
- (*m_connect_callback)();
+ (*m_impl.m_connect_callback)();
}
DBUG_RETURN(0);
}
-int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, int verbose)
+void Ndb_cluster_connection::set_optimized_node_selection(int val)
+{
+ m_impl.m_optimized_node_selection= val;
+}
+
+void
+Ndb_cluster_connection_impl::init_get_next_node
+(Ndb_cluster_connection_node_iter &iter)
+{
+ if (iter.scan_state != (Uint8)~0)
+ iter.cur_pos= iter.scan_state;
+ if (iter.cur_pos >= no_db_nodes())
+ iter.cur_pos= 0;
+ iter.init_pos= iter.cur_pos;
+ iter.scan_state= 0;
+ // fprintf(stderr,"[init %d]",iter.init_pos);
+ return;
+}
+
+Uint32
+Ndb_cluster_connection_impl::get_next_node(Ndb_cluster_connection_node_iter &iter)
+{
+ Uint32 cur_pos= iter.cur_pos;
+ if (cur_pos >= no_db_nodes())
+ return 0;
+
+ Ndb_cluster_connection_impl::Node *nodes= m_impl.m_all_nodes.getBase();
+ Ndb_cluster_connection_impl::Node &node= nodes[cur_pos];
+
+ if (iter.scan_state != (Uint8)~0)
+ {
+ assert(iter.scan_state < no_db_nodes());
+ if (nodes[iter.scan_state].group == node.group)
+ iter.scan_state= ~0;
+ else
+ return nodes[iter.scan_state++].id;
+ }
+
+ // fprintf(stderr,"[%d]",node.id);
+
+ cur_pos++;
+ Uint32 init_pos= iter.init_pos;
+ if (cur_pos == node.next_group)
+ {
+ cur_pos= nodes[init_pos].this_group;
+ }
+
+ // fprintf(stderr,"[cur_pos %d]",cur_pos);
+ if (cur_pos != init_pos)
+ iter.cur_pos= cur_pos;
+ else
+ {
+ iter.cur_pos= node.next_group;
+ iter.init_pos= node.next_group;
+ }
+ return node.id;
+}
+
+Uint32
+Ndb_cluster_connection::no_db_nodes()
+{
+ return m_impl.m_all_nodes.size();
+}
+
+
+int
+Ndb_cluster_connection::wait_until_ready(int timeout,
+ int timeout_after_first_alive)
+{
+ DBUG_ENTER("Ndb_cluster_connection::wait_until_ready");
+ TransporterFacade *tp = TransporterFacade::instance();
+ if (tp == 0)
+ {
+ DBUG_RETURN(-1);
+ }
+ if (tp->ownId() == 0)
+ {
+ DBUG_RETURN(-1);
+ }
+ int secondsCounter = 0;
+ int milliCounter = 0;
+ int noChecksSinceFirstAliveFound = 0;
+ do {
+ unsigned int foundAliveNode = 0;
+ tp->lock_mutex();
+ for(unsigned i= 0; i < no_db_nodes(); i++)
+ {
+ //************************************************
+ // If any node is answering, ndb is answering
+ //************************************************
+ if (tp->get_node_alive(m_impl.m_all_nodes[i].id) != 0) {
+ foundAliveNode++;
+ }
+ }
+ tp->unlock_mutex();
+
+ if (foundAliveNode == no_db_nodes())
+ {
+ DBUG_RETURN(0);
+ }
+ else if (foundAliveNode > 0)
+ {
+ noChecksSinceFirstAliveFound++;
+ if (timeout_after_first_alive >= 0)
+ {
+ if (noChecksSinceFirstAliveFound > timeout_after_first_alive)
+ DBUG_RETURN(0);
+ }
+ else // timeout_after_first_alive < 0
+ {
+ if (noChecksSinceFirstAliveFound > -timeout_after_first_alive)
+ DBUG_RETURN(-1);
+ }
+ }
+ else if (secondsCounter >= timeout)
+ { // no alive nodes and timed out
+ DBUG_RETURN(-1);
+ }
+ NdbSleep_MilliSleep(100);
+ milliCounter += 100;
+ if (milliCounter >= 1000) {
+ secondsCounter++;
+ milliCounter = 0;
+ }//if
+ } while (1);
+}
+
+
+
+/*
+ * Ndb_cluster_connection_impl
+ */
+
+Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char *
+ connect_string)
+ : Ndb_cluster_connection(*this),
+ m_optimized_node_selection(1)
+{
+ DBUG_ENTER("Ndb_cluster_connection");
+ DBUG_PRINT("enter",("Ndb_cluster_connection this=0x%x", this));
+ m_transporter_facade=
+ TransporterFacade::theFacadeInstance= new TransporterFacade();
+
+ m_connect_thread= 0;
+ m_connect_callback= 0;
+
+ if (ndb_global_event_buffer_mutex == NULL)
+ {
+ ndb_global_event_buffer_mutex= NdbMutex_Create();
+ }
+#ifdef VM_TRACE
+ if (ndb_print_state_mutex == NULL)
+ {
+ ndb_print_state_mutex= NdbMutex_Create();
+ }
+#endif
+ m_config_retriever=
+ new ConfigRetriever(connect_string, NDB_VERSION, NODE_TYPE_API);
+ if (m_config_retriever->hasError())
+ {
+ printf("Could not connect initialize handle to management server: %s",
+ m_config_retriever->getErrorString());
+ delete m_config_retriever;
+ m_config_retriever= 0;
+ }
+
+ DBUG_VOID_RETURN;
+}
+
+Ndb_cluster_connection_impl::~Ndb_cluster_connection_impl()
+{
+ DBUG_ENTER("~Ndb_cluster_connection");
+ DBUG_PRINT("enter",("~Ndb_cluster_connection this=0x%x", this));
+ TransporterFacade::stop_instance();
+ if (m_connect_thread)
+ {
+ void *status;
+ g_run_connect_thread= 0;
+ NdbThread_WaitFor(m_connect_thread, &status);
+ NdbThread_Destroy(&m_connect_thread);
+ m_connect_thread= 0;
+ }
+ if (m_transporter_facade != 0)
+ {
+ delete m_transporter_facade;
+ if (m_transporter_facade != TransporterFacade::theFacadeInstance)
+ abort();
+ TransporterFacade::theFacadeInstance= 0;
+ }
+ if (m_config_retriever)
+ delete m_config_retriever;
+
+ // fragmentToNodeMap.release();
+
+ DBUG_VOID_RETURN;
+}
+
+void
+Ndb_cluster_connection_impl::init_nodes_vector(Uint32 nodeid,
+ const ndb_mgm_configuration
+ &config)
+{
+ DBUG_ENTER("Ndb_cluster_connection_impl::init_nodes_vector");
+ ndb_mgm_configuration_iterator iter(config, CFG_SECTION_CONNECTION);
+
+ for(iter.first(); iter.valid(); iter.next())
+ {
+ Uint32 nodeid1, nodeid2, remoteNodeId, group= 5;
+ const char * remoteHostName= 0, * localHostName= 0;
+ if(iter.get(CFG_CONNECTION_NODE_1, &nodeid1)) continue;
+ if(iter.get(CFG_CONNECTION_NODE_2, &nodeid2)) continue;
+
+ if(nodeid1 != nodeid && nodeid2 != nodeid) continue;
+ remoteNodeId = (nodeid == nodeid1 ? nodeid2 : nodeid1);
+
+ iter.get(CFG_CONNECTION_GROUP, &group);
+
+ {
+ const char * host1= 0, * host2= 0;
+ iter.get(CFG_CONNECTION_HOSTNAME_1, &host1);
+ iter.get(CFG_CONNECTION_HOSTNAME_2, &host2);
+ localHostName = (nodeid == nodeid1 ? host1 : host2);
+ remoteHostName = (nodeid == nodeid1 ? host2 : host1);
+ }
+
+ Uint32 type = ~0;
+ if(iter.get(CFG_TYPE_OF_SECTION, &type)) continue;
+
+ switch(type){
+ case CONNECTION_TYPE_SHM:{
+ break;
+ }
+ case CONNECTION_TYPE_SCI:{
+ break;
+ }
+ case CONNECTION_TYPE_TCP:{
+ // connecting through localhost
+ // check if config_hostname is local
+ if (SocketServer::tryBind(0,remoteHostName))
+ group--; // upgrade group value
+ break;
+ }
+ case CONNECTION_TYPE_OSE:{
+ break;
+ }
+ }
+ m_impl.m_all_nodes.push_back(Node(group,remoteNodeId));
+ DBUG_PRINT("info",("saved %d %d", group,remoteNodeId));
+ for (int i= m_impl.m_all_nodes.size()-2;
+ i >= 0 && m_impl.m_all_nodes[i].group > m_impl.m_all_nodes[i+1].group;
+ i--)
+ {
+ Node tmp= m_impl.m_all_nodes[i];
+ m_impl.m_all_nodes[i]= m_impl.m_all_nodes[i+1];
+ m_impl.m_all_nodes[i+1]= tmp;
+ }
+ }
+
+ int i;
+ Uint32 cur_group, i_group= 0;
+ cur_group= ~0;
+ for (i= (int)m_impl.m_all_nodes.size()-1; i >= 0; i--)
+ {
+ if (m_impl.m_all_nodes[i].group != cur_group)
+ {
+ cur_group= m_impl.m_all_nodes[i].group;
+ i_group= i+1;
+ }
+ m_impl.m_all_nodes[i].next_group= i_group;
+ }
+ cur_group= ~0;
+ for (i= 0; i < (int)m_impl.m_all_nodes.size(); i++)
+ {
+ if (m_impl.m_all_nodes[i].group != cur_group)
+ {
+ cur_group= m_impl.m_all_nodes[i].group;
+ i_group= i;
+ }
+ m_impl.m_all_nodes[i].this_group= i_group;
+ }
+#if 0
+ for (i= 0; i < (int)m_impl.m_all_nodes.size(); i++)
+ {
+ fprintf(stderr, "[%d] %d %d %d %d\n",
+ i,
+ m_impl.m_all_nodes[i].id,
+ m_impl.m_all_nodes[i].group,
+ m_impl.m_all_nodes[i].this_group,
+ m_impl.m_all_nodes[i].next_group);
+ }
+
+ do_test();
+#endif
+ DBUG_VOID_RETURN;
+}
+
+void
+Ndb_cluster_connection_impl::do_test()
+{
+ Ndb_cluster_connection_node_iter iter;
+ int n= no_db_nodes()+5;
+ Uint32 *nodes= new Uint32[n+1];
+
+ for (int g= 0; g < n; g++)
+ {
+ for (int h= 0; h < n; h++)
+ {
+ Uint32 id;
+ Ndb_cluster_connection_node_iter iter2;
+ {
+ for (int j= 0; j < g; j++)
+ {
+ nodes[j]= get_next_node(iter2);
+ }
+ }
+
+ for (int i= 0; i < n; i++)
+ {
+ init_get_next_node(iter);
+ fprintf(stderr, "%d dead:(", g);
+ id= 0;
+ while (id == 0)
+ {
+ if ((id= get_next_node(iter)) == 0)
+ break;
+ for (int j= 0; j < g; j++)
+ {
+ if (nodes[j] == id)
+ {
+ fprintf(stderr, " %d", id);
+ id= 0;
+ break;
+ }
+ }
+ }
+ fprintf(stderr, ")");
+ if (id == 0)
+ {
+ break;
+ }
+ fprintf(stderr, " %d\n", id);
+ }
+ fprintf(stderr, "\n");
+ }
+ }
+ delete [] nodes;
+}
+
+int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds,
+ int verbose)
{
struct ndb_mgm_reply mgm_reply;
DBUG_ENTER("Ndb_cluster_connection::connect");
const char* error = 0;
do {
- if (m_config_retriever == 0)
+ if (m_impl.m_config_retriever == 0)
DBUG_RETURN(-1);
- if (m_config_retriever->do_connect(no_retries,retry_delay_in_seconds,verbose))
+ if (m_impl.m_config_retriever->do_connect(no_retries,
+ retry_delay_in_seconds,
+ verbose))
DBUG_RETURN(1); // mgmt server not up yet
- Uint32 nodeId = m_config_retriever->allocNodeId(4/*retries*/,3/*delay*/);
+ Uint32 nodeId = m_impl.m_config_retriever->allocNodeId(4/*retries*/,
+ 3/*delay*/);
if(nodeId == 0)
break;
- ndb_mgm_configuration * props = m_config_retriever->getConfig();
+ ndb_mgm_configuration * props = m_impl.m_config_retriever->getConfig();
if(props == 0)
break;
- m_facade->start_instance(nodeId, props);
+ m_impl.m_transporter_facade->start_instance(nodeId, props);
+ m_impl.init_nodes_vector(nodeId, *props);
- for(int i=0;i<m_facade->get_registry()->m_transporter_interface.size();i++)
+ for(int i=0;i<m_impl.m_transporter_facade->get_registry()->m_transporter_interface.size();i++)
ndb_mgm_set_connection_int_parameter(m_config_retriever->get_mgmHandle(),
nodeId,
- m_facade->get_registry()
+ m_impl.m_transporter_facade->get_registry()
->m_transporter_interface[i]
.m_remote_nodeId,
CFG_CONNECTION_SERVER_PORT,
- m_facade->get_registry()
+ m_impl.m_transporter_facade->get_registry()
->m_transporter_interface[i]
.m_service_port,
&mgm_reply);
ndb_mgm_destroy_configuration(props);
- m_facade->connected();
+ m_impl.m_transporter_facade->connected();
DBUG_RETURN(0);
} while(0);
ndbout << "Configuration error: ";
- const char* erString = m_config_retriever->getErrorString();
+ const char* erString = m_impl.m_config_retriever->getErrorString();
if (erString == 0) {
erString = "No error specified!";
}
@@ -195,29 +515,132 @@ int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds,
DBUG_RETURN(-1);
}
-Ndb_cluster_connection::~Ndb_cluster_connection()
+void Ndb_cluster_connection_impl::connect_thread()
{
- DBUG_ENTER("~Ndb_cluster_connection");
- DBUG_PRINT("enter",("~Ndb_cluster_connection this=0x%x", this));
- TransporterFacade::stop_instance();
- if (m_connect_thread)
+ DBUG_ENTER("Ndb_cluster_connection_impl::connect_thread");
+ int r;
+ do {
+ NdbSleep_SecSleep(1);
+ if ((r = connect(0,0,0)) == 0)
+ break;
+ if (r == -1) {
+ printf("Ndb_cluster_connection::connect_thread error\n");
+ DBUG_ASSERT(false);
+ g_run_connect_thread= 0;
+ } else {
+ // Wait before making a new connect attempt
+ NdbSleep_SecSleep(1);
+ }
+ } while (g_run_connect_thread);
+ if (m_connect_callback)
+ (*m_connect_callback)();
+ DBUG_VOID_RETURN;
+}
+
+/*
+ * Hint handling to select node
+ * ToDo: fix this
+ */
+
+void
+Ndb_cluster_connection_impl::FragmentToNodeMap::init(Uint32 noOfNodes,
+ Uint8 nodeIds[])
+{
+ kValue = 6;
+ noOfFragments = 2 * noOfNodes;
+
+ /**
+ * Compute hashValueMask and hashpointerValue
+ */
{
- void *status;
- g_run_connect_thread= 0;
- NdbThread_WaitFor(m_connect_thread, &status);
- NdbThread_Destroy(&m_connect_thread);
- m_connect_thread= 0;
+ Uint32 topBit = (1 << 31);
+ for(int i = 31; i>=0; i--){
+ if((noOfFragments & topBit) != 0)
+ break;
+ topBit >>= 1;
+ }
+ hashValueMask = topBit - 1;
+ hashpointerValue = noOfFragments - (hashValueMask + 1);
}
- if (m_facade != 0)
+
+ /**
+ * This initialization depends on
+ * the fact that:
+ * primary node for fragment i = i % noOfNodes
+ *
+ * This algorithm should be implemented in Dbdih
+ */
{
- delete m_facade;
- if (m_facade != TransporterFacade::theFacadeInstance)
+ if (fragment2PrimaryNodeMap != 0)
abort();
- TransporterFacade::theFacadeInstance= 0;
+
+ fragment2PrimaryNodeMap = new Uint32[noOfFragments];
+ Uint32 i;
+ for(i = 0; i<noOfNodes; i++){
+ fragment2PrimaryNodeMap[i] = nodeIds[i];
+ }
+
+ // Sort them (bubble sort)
+ for(i = 0; i<noOfNodes-1; i++)
+ for(Uint32 j = i+1; j<noOfNodes; j++)
+ if(fragment2PrimaryNodeMap[i] > fragment2PrimaryNodeMap[j]){
+ Uint32 tmp = fragment2PrimaryNodeMap[i];
+ fragment2PrimaryNodeMap[i] = fragment2PrimaryNodeMap[j];
+ fragment2PrimaryNodeMap[j] = tmp;
+ }
+
+ for(i = 0; i<noOfNodes; i++){
+ fragment2PrimaryNodeMap[i+noOfNodes] = fragment2PrimaryNodeMap[i];
+ }
}
- if (m_config_retriever)
- delete m_config_retriever;
- DBUG_VOID_RETURN;
}
+void
+Ndb_cluster_connection_impl::FragmentToNodeMap::release(){
+ delete [] fragment2PrimaryNodeMap;
+ fragment2PrimaryNodeMap = 0;
+}
+
+static const Uint32 MAX_KEY_LEN_64_WORDS = 4;
+Uint32
+Ndb_cluster_connection_impl::guess_primary_node(const char *keyData,
+ Uint32 keyLen)
+{
+ Uint64 tempData[MAX_KEY_LEN_64_WORDS];
+
+ const Uint32 usedKeyLen = (keyLen + 3) >> 2; // In words
+ const char * usedKeyData = 0;
+
+ /**
+ * If key data buffer is not aligned (on 64 bit boundary)
+ * or key len is not a multiple of 4
+ * Use temp data
+ */
+ if(((((UintPtr)keyData) & 7) == 0) && ((keyLen & 3) == 0)) {
+ usedKeyData = keyData;
+ } else {
+ memcpy(&tempData[0], keyData, keyLen);
+ const int slack = keyLen & 3;
+ if(slack > 0) {
+ memset(&((char *)&tempData[0])[keyLen], 0, (4 - slack));
+ }//if
+ usedKeyData = (char *)&tempData[0];
+ }//if
+
+ Uint32 hashValue = md5_hash((Uint64 *)usedKeyData, usedKeyLen);
+
+ hashValue >>= fragmentToNodeMap.kValue;
+
+ Uint32 fragmentId = hashValue &
+ fragmentToNodeMap.hashValueMask;
+
+ if(fragmentId < fragmentToNodeMap.hashpointerValue) {
+ fragmentId = hashValue &
+ ((fragmentToNodeMap.hashValueMask << 1) + 1);
+ }//if
+ return fragmentId;
+}
+
+
+template class Vector<Ndb_cluster_connection_impl::Node>;
diff --git a/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp b/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp
new file mode 100644
index 00000000000..620eac296a3
--- /dev/null
+++ b/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp
@@ -0,0 +1,100 @@
+/* Copyright (C) 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; either version 2 of the License, or
+ (at your option) any later version.
+
+ 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 */
+
+
+#ifndef CLUSTER_CONNECTION_IMPL_HPP
+#define CLUSTER_CONNECTION_IMPL_HPP
+
+#include <ndb_cluster_connection.hpp>
+#include <Vector.hpp>
+
+class TransporterFacade;
+class ConfigRetriever;
+class NdbThread;
+class ndb_mgm_configuration;
+
+struct Ndb_cluster_connection_node_iter {
+ Ndb_cluster_connection_node_iter() : scan_state(~0),
+ init_pos(0),
+ cur_pos(0) {};
+ Uint8 scan_state;
+ Uint8 init_pos;
+ Uint8 cur_pos;
+};
+
+extern "C" {
+ void* run_ndb_cluster_connection_connect_thread(void*);
+}
+
+class Ndb_cluster_connection_impl : public Ndb_cluster_connection
+{
+ Ndb_cluster_connection_impl(const char *connectstring);
+ ~Ndb_cluster_connection_impl();
+
+ void do_test();
+
+ void init_get_next_node(Ndb_cluster_connection_node_iter &iter);
+ Uint32 get_next_node(Ndb_cluster_connection_node_iter &iter);
+
+private:
+ friend class Ndb;
+ friend class NdbImpl;
+ friend void* run_ndb_cluster_connection_connect_thread(void*);
+ friend class Ndb_cluster_connection;
+
+ /**
+ * Structure containing values for guessing primary node
+ */
+ struct FragmentToNodeMap {
+ FragmentToNodeMap():
+ fragment2PrimaryNodeMap(0) {};
+ Uint32 kValue;
+ Uint32 hashValueMask;
+ Uint32 hashpointerValue;
+ Uint32 noOfFragments;
+ Uint32 *fragment2PrimaryNodeMap;
+
+ void init(Uint32 noOfNodes, Uint8 nodeIds[]);
+ void release();
+ } fragmentToNodeMap;
+
+ struct Node
+ {
+ Node(Uint32 _g= 0, Uint32 _id= 0) : this_group(0),
+ next_group(0),
+ group(_g),
+ id(_id) {};
+ Uint32 this_group;
+ Uint32 next_group;
+ Uint32 group;
+ Uint32 id;
+ };
+
+ Vector<Node> m_all_nodes;
+ void init_nodes_vector(Uint32 nodeid, const ndb_mgm_configuration &config);
+ Uint32 guess_primary_node(const char * keyData, Uint32 keyLen);
+
+ void connect_thread();
+
+ TransporterFacade *m_transporter_facade;
+ ConfigRetriever *m_config_retriever;
+ NdbThread *m_connect_thread;
+ int (*m_connect_callback)(void);
+
+ int m_optimized_node_selection;
+};
+
+#endif
diff --git a/ndb/test/ndbapi/testDict.cpp b/ndb/test/ndbapi/testDict.cpp
index 221c035e368..460c3e77745 100644
--- a/ndb/test/ndbapi/testDict.cpp
+++ b/ndb/test/ndbapi/testDict.cpp
@@ -1222,7 +1222,7 @@ runTableRename(NDBT_Context* ctx, NDBT_Step* step){
const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str());
if (oldTable) {
- NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str());
+ NdbDictionary::Table newTable = *oldTable;
newTable.setName(pTabNewName.c_str());
CHECK2(dict->alterTable(newTable) == 0,
"TableRename failed");
@@ -1291,7 +1291,7 @@ runTableRenameNF(NDBT_Context* ctx, NDBT_Step* step){
const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str());
if (oldTable) {
- NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str());
+ NdbDictionary::Table newTable = *oldTable;
newTable.setName(pTabNewName.c_str());
CHECK2(dict->alterTable(newTable) == 0,
"TableRename failed");
@@ -1388,7 +1388,7 @@ runTableRenameSR(NDBT_Context* ctx, NDBT_Step* step){
const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str());
if (oldTable) {
- NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str());
+ NdbDictionary::Table newTable = *oldTable;
newTable.setName(pTabNewName.c_str());
CHECK2(dict->alterTable(newTable) == 0,
"TableRename failed");
diff --git a/ndb/test/ndbapi/testNdbApi.cpp b/ndb/test/ndbapi/testNdbApi.cpp
index 7fdd0467bf2..4613a56d5aa 100644
--- a/ndb/test/ndbapi/testNdbApi.cpp
+++ b/ndb/test/ndbapi/testNdbApi.cpp
@@ -142,14 +142,22 @@ int runTestMaxTransaction(NDBT_Context* ctx, NDBT_Step* step){
4);
break;
case 2:
+ ndbout_c("startTransactionDGroup not supported");
+ abort();
+ /*
pCon = pNdb->startTransactionDGroup(1,
"TEST",
0);
+ */
break;
case 3:
+ ndbout_c("startTransactionDGroup not supported");
+ abort();
+ /*
pCon = pNdb->startTransactionDGroup(2,
"TEST",
1);
+ */
break;
default:
diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp
index 09f52bf0bed..5e22468692e 100644
--- a/ndb/test/src/NdbBackup.cpp
+++ b/ndb/test/src/NdbBackup.cpp
@@ -46,7 +46,8 @@ NdbBackup::start(unsigned int & _backup_id){
ndb_mgm_reply reply;
reply.return_code = 0;
- if (ndb_mgm_start_backup(handle,
+ if (ndb_mgm_start_backup(handle,
+ 2, // wait until completed
&_backup_id,
&reply) == -1) {
g_err << "Could not start backup " << endl;
diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp
index f3f830279ff..eee76981eda 100644
--- a/ndb/tools/delete_all.cpp
+++ b/ndb/tools/delete_all.cpp
@@ -24,7 +24,11 @@
static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism=240);
-static const char* opt_connect_str= 0;
+enum ndb_delete_all {
+ NDB_STD_OPTS_OPTIONS
+};
+NDB_STD_OPTS_VARS;
+
static const char* _dbname = "TEST_DB";
static struct my_option my_long_options[] =
{
diff --git a/ndb/tools/desc.cpp b/ndb/tools/desc.cpp
index 2f59d5fcd0b..fd7b243be2a 100644
--- a/ndb/tools/desc.cpp
+++ b/ndb/tools/desc.cpp
@@ -19,7 +19,11 @@
#include <NDBT.hpp>
#include <NdbApi.hpp>
-static const char* opt_connect_str= 0;
+enum ndb_desc_options {
+ NDB_STD_OPTS_OPTIONS
+};
+NDB_STD_OPTS_VARS;
+
static const char* _dbname = "TEST_DB";
static int _unqualified = 0;
static struct my_option my_long_options[] =
diff --git a/ndb/tools/drop_index.cpp b/ndb/tools/drop_index.cpp
index 6600811e0c4..2b7f8c1bce9 100644
--- a/ndb/tools/drop_index.cpp
+++ b/ndb/tools/drop_index.cpp
@@ -21,7 +21,11 @@
#include <NdbApi.hpp>
#include <NDBT.hpp>
-static const char* opt_connect_str= 0;
+enum ndb_drop_index_options {
+ NDB_STD_OPTS_OPTIONS
+};
+NDB_STD_OPTS_VARS;
+
static const char* _dbname = "TEST_DB";
static struct my_option my_long_options[] =
{
diff --git a/ndb/tools/drop_tab.cpp b/ndb/tools/drop_tab.cpp
index 0661a8c599b..2b0b6908449 100644
--- a/ndb/tools/drop_tab.cpp
+++ b/ndb/tools/drop_tab.cpp
@@ -21,7 +21,11 @@
#include <NdbApi.hpp>
#include <NDBT.hpp>
-static const char* opt_connect_str= 0;
+enum ndb_drop_table_options {
+ NDB_STD_OPTS_OPTIONS
+};
+NDB_STD_OPTS_VARS;
+
static const char* _dbname = "TEST_DB";
static struct my_option my_long_options[] =
{
diff --git a/ndb/tools/listTables.cpp b/ndb/tools/listTables.cpp
index ccb6967e2dc..710af66f4de 100644
--- a/ndb/tools/listTables.cpp
+++ b/ndb/tools/listTables.cpp
@@ -161,13 +161,17 @@ list(const char * tabname,
}
}
-static const char* opt_connect_str= 0;
+enum ndb_show_tables_options {
+ NDB_STD_OPTS_OPTIONS
+};
+NDB_STD_OPTS_VARS;
+
static const char* _dbname = "TEST_DB";
static int _loops;
static int _type;
static struct my_option my_long_options[] =
{
- NDB_STD_OPTS("ndb_desc"),
+ NDB_STD_OPTS("ndb_show_tables"),
{ "database", 'd', "Name of database table is in",
(gptr*) &_dbname, (gptr*) &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
diff --git a/ndb/tools/ndb_test_platform.cpp b/ndb/tools/ndb_test_platform.cpp
index 72dd146dacd..88f21b31d58 100644
--- a/ndb/tools/ndb_test_platform.cpp
+++ b/ndb/tools/ndb_test_platform.cpp
@@ -33,14 +33,14 @@ int test_snprintf(const char * fmt, int buf_sz, int result)
if(ret < 0)
{
printf("BaseString::snprint returns %d with size=%d and strlen(fmt)=%d\n",
- ret, buf_sz, strlen(fmt));
+ ret, buf_sz, (int) strlen(fmt));
return -1;
}
if(ret+1 == buf_sz)
{
printf("BaseString::snprint truncates returns %d with size=%d and strlen(fmt)=%d\n",
- ret, buf_sz, strlen(fmt));
+ ret, buf_sz, (int) strlen(fmt));
return -1;
}
@@ -87,7 +87,7 @@ main(void)
if (sizeof(UintPtr) != sizeof(Uint32*))
{
printf("sizeof(UintPtr)=%d != sizeof(Uint32*)=%d\n",
- sizeof(UintPtr), sizeof(Uint32*));
+ (int) sizeof(UintPtr), (int) sizeof(Uint32*));
return -1;
}
diff --git a/ndb/tools/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp
index 277cdc72532..fa616ee8fee 100644
--- a/ndb/tools/restore/Restore.cpp
+++ b/ndb/tools/restore/Restore.cpp
@@ -260,16 +260,16 @@ TupleS & TupleS::operator=(const TupleS& tuple)
memcpy(allAttrData, tuple.allAttrData, getNoOfAttributes()*sizeof(AttributeData));
return *this;
-};
+}
int TupleS::getNoOfAttributes() const {
if (m_currentTable == 0)
return 0;
return m_currentTable->getNoOfAttributes();
-};
+}
TableS * TupleS::getTable() const {
return m_currentTable;
-};
+}
const AttributeDesc * TupleS::getDesc(int i) const {
return m_currentTable->allAttributesDesc[i];
@@ -277,7 +277,7 @@ const AttributeDesc * TupleS::getDesc(int i) const {
AttributeData * TupleS::getData(int i) const{
return &(allAttrData[i]);
-};
+}
bool
TupleS::prepareRecord(TableS & tab){
diff --git a/ndb/tools/restore/restore_main.cpp b/ndb/tools/restore/restore_main.cpp
index ece2b2605b4..c24ed620b71 100644
--- a/ndb/tools/restore/restore_main.cpp
+++ b/ndb/tools/restore/restore_main.cpp
@@ -36,7 +36,10 @@ static Vector<class BackupConsumer *> g_consumers;
static const char* ga_backupPath = "." DIR_SEPARATOR;
-static const char* opt_connect_str= NULL;
+enum ndb_restore_options {
+ NDB_STD_OPTS_OPTIONS
+};
+NDB_STD_OPTS_VARS;
/**
* print and restore flags
diff --git a/ndb/tools/select_all.cpp b/ndb/tools/select_all.cpp
index 56bf91dec22..9c79d68fad3 100644
--- a/ndb/tools/select_all.cpp
+++ b/ndb/tools/select_all.cpp
@@ -37,7 +37,11 @@ int scanReadRecords(Ndb*,
bool orderby,
bool descending);
-static const char* opt_connect_str= 0;
+enum ndb_select_all_options {
+ NDB_STD_OPTS_OPTIONS
+};
+NDB_STD_OPTS_VARS;
+
static const char* _dbname = "TEST_DB";
static const char* _delimiter = "\t";
static int _unqualified, _header, _parallelism, _useHexFormat, _lock,
diff --git a/ndb/tools/select_count.cpp b/ndb/tools/select_count.cpp
index 2f5fbf9f189..6975070e14d 100644
--- a/ndb/tools/select_count.cpp
+++ b/ndb/tools/select_count.cpp
@@ -32,7 +32,11 @@ select_count(Ndb* pNdb, const NdbDictionary::Table* pTab,
int* count_rows,
NdbOperation::LockMode lock);
-static const char* opt_connect_str= 0;
+enum ndb_select_count_options {
+ NDB_STD_OPTS_OPTIONS
+};
+NDB_STD_OPTS_VARS;
+
static const char* _dbname = "TEST_DB";
static int _parallelism = 240;
static int _lock = 0;
diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp
index 5973b046f8f..4b86de36514 100644
--- a/ndb/tools/waiter.cpp
+++ b/ndb/tools/waiter.cpp
@@ -30,7 +30,11 @@ int
waitClusterStatus(const char* _addr, ndb_mgm_node_status _status,
unsigned int _timeout);
-static const char* opt_connect_str= 0;
+enum ndb_waiter_options {
+ NDB_STD_OPTS_OPTIONS
+};
+NDB_STD_OPTS_VARS;
+
static int _no_contact = 0;
static int _timeout = 120;
static struct my_option my_long_options[] =
diff --git a/netware/init_db.sql b/netware/init_db.sql
index 15111c9043b..c5810b50e8e 100644
--- a/netware/init_db.sql
+++ b/netware/init_db.sql
@@ -3,14 +3,14 @@ CREATE DATABASE test;
USE mysql;
-CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges';
+CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges';
INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');
-CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges';
+CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges';
-CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') 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, PRIMARY KEY Host (Host,User)) comment='Users and global privileges';
+CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') 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, PRIMARY KEY Host (Host,User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
@@ -18,21 +18,21 @@ INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y
INSERT INTO user (host,user) values ('localhost','');
INSERT INTO user (host,user) values ('','');
-CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions';
+CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions';
-CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges';
+CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges';
-CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges';
+CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges';
-CREATE TABLE help_topic (help_topic_id int unsigned NOT NULL, name varchar(64) NOT NULL, help_category_id smallint unsigned NOT NULL, description text NOT NULL, example text NOT NULL, url varchar(128) NOT NULL, primary key (help_topic_id), unique index (name))comment='help topics';
-CREATE TABLE help_category (help_category_id smallint unsigned NOT NULL, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) comment='help categories';
-CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) comment='help keywords';
-CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) comment='keyword-topic relation';
+CREATE TABLE help_topic (help_topic_id int unsigned NOT NULL, name varchar(64) NOT NULL, help_category_id smallint unsigned NOT NULL, description text NOT NULL, example text NOT NULL, url varchar(128) NOT NULL, primary key (help_topic_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help topics';
+CREATE TABLE help_category (help_category_id smallint unsigned NOT NULL, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help categories';
+CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help keywords';
+CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='keyword-topic relation';
-CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) DEFAULT CHARACTER SET latin1 comment='Time zone names';
+CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone names';
-CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) DEFAULT CHARACTER SET latin1 comment='Time zones';
-CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) DEFAULT CHARACTER SET latin1 comment='Time zone transitions';
+CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zones';
+CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone transitions';
-CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) DEFAULT CHARACTER SET latin1 comment='Time zone transition types';
-CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) DEFAULT CHARACTER SET latin1 comment='Leap seconds information for time zones';
+CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone transition types';
+CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Leap seconds information for time zones';
diff --git a/netware/mysql_fix_privilege_tables.pl b/netware/mysql_fix_privilege_tables.pl
index c0a428eff0f..20af37be2d7 100644
--- a/netware/mysql_fix_privilege_tables.pl
+++ b/netware/mysql_fix_privilege_tables.pl
@@ -206,7 +206,7 @@ unique index (name) \
print "Filling online help tables with contents...\n";
# Generate the path for "fill_help_tables.sql" file which is in different folder.
$fill_help_table=$0;
-$fill_help_table =~ s/scripts[\\\/]mysql_fix_privilege_tables.pl/support-files\\fill_help_tables.sql/;
+$fill_help_table =~ s/scripts[\\\/]mysql_fix_privilege_tables.pl/share\\fill_help_tables.sql/;
#read all content from the sql file which contains recordsfor help tables.
open(fileIN,$fill_help_table) or die("Cannot open $fill_help_table: $!");
diff --git a/regex/main.c b/regex/main.c
index 29abca6d9a2..8fe16d74eee 100644
--- a/regex/main.c
+++ b/regex/main.c
@@ -78,7 +78,7 @@ char *argv[];
if (err) {
len = regerror(err, &re, erbuf, sizeof(erbuf));
fprintf(stderr, "error %s, %d/%d `%s'\n",
- eprint(err), len, (int) sizeof(erbuf), erbuf);
+ eprint(err), (int) len, (int) sizeof(erbuf), erbuf);
exit(status);
}
regprint(&re, stdout);
diff --git a/regex/regcomp.c b/regex/regcomp.c
index 5f0351c32aa..998b39379aa 100644
--- a/regex/regcomp.c
+++ b/regex/regcomp.c
@@ -860,11 +860,28 @@ othercase(charset,ch)
CHARSET_INFO *charset;
int ch;
{
+ /*
+ In MySQL some multi-byte character sets
+ have 'ctype' array but don't have 'to_lower'
+ and 'to_upper' arrays. In this case we handle
+ only basic latin letters a..z and A..Z.
+
+ If 'to_lower' and 'to_upper' arrays are empty in a character set,
+ then my_isalpha(cs, ch) should never return TRUE for characters
+ other than basic latin letters. Otherwise it should be
+ considered as a mistake in character set definition.
+ */
assert(my_isalpha(charset,ch));
if (my_isupper(charset,ch))
- return(my_tolower(charset,ch));
+ {
+ return(charset->to_lower ? my_tolower(charset,ch) :
+ ch - 'A' + 'a');
+ }
else if (my_islower(charset,ch))
- return(my_toupper(charset,ch));
+ {
+ return(charset->to_upper ? my_toupper(charset,ch) :
+ ch - 'a' + 'A');
+ }
else /* peculiar, but could happen */
return(ch);
}
diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh
index 78dfe7b6088..fbe7c597b34 100644
--- a/scripts/fill_help_tables.sh
+++ b/scripts/fill_help_tables.sh
@@ -203,7 +203,7 @@ sub prepare_name
$a =~ s/\@command\{((.|\n)+?)\}/$1/go;
$a =~ s/\@code\{((.|\n)+?)\}/$1/go;
$a =~ s/\@strong\{(.+?)\}/$1/go;
- $a =~ s/\@samp\{(.+?)\}/$1/go;
+ $a =~ s/\@samp\{(.+?)\}/'$1'/go;
$a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go;
$a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go;
$a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go;
@@ -254,7 +254,7 @@ sub prepare_description
$a =~ s/\@command\{((.|\n)+?)\}/$1/go;
$a =~ s/\@code\{((.|\n)+?)\}/$1/go;
$a =~ s/\@strong\{(.+?)\}/$1/go;
- $a =~ s/\@samp\{(.+?)\}/$1/go;
+ $a =~ s/\@samp\{(.+?)\}/'$1'/go;
$a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go;
$a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go;
$a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go;
@@ -454,10 +454,12 @@ sub print_verbose_errors
print STDERR "number of help keywords - ",$count_keywords,"\n";
my $count_without_help= scalar(@without_help);
+ my $percent_without_help= $count_lex ?
+ int (($count_without_help/$count_lex)*100) :
+ "100";
print_bad_names(\@without_help,"lexems without help (".
$count_without_help." ~ ".
- (int (($count_without_help/$count_lex)*100)).
- "%)");
+ $percent_without_help."%)");
print_bad_names(\@description_with_at,
" topics below have symbol \'@\' in their descriptions.\n".
"it's probably the litter from 'texi' tags (script needs fixing)");
@@ -467,10 +469,12 @@ sub print_verbose_errors
print_bad_names(\@without_description,"topics without description");
my $count_without_example= scalar(@without_example);
+ my $percent_without_example= $count_topics ?
+ int (($count_without_example/$count_topics)*100) :
+ "100";
print_bad_names(\@without_example,"topics without example (".
$count_without_example." ~ ".
- (int (($count_without_example/$count_topics)*100)).
- "%)");
+ $percent_without_example."%)");
}
print_verbose_errors if ($verbose_option ne 0);
diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh
index 3dce83c0c59..eec4ddda27b 100644
--- a/scripts/make_win_src_distribution.sh
+++ b/scripts/make_win_src_distribution.sh
@@ -189,7 +189,10 @@ copy_dir_files()
mkdir $BASE/$arg
fi
for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp \
- README INSTALL* LICENSE
+ README INSTALL* LICENSE *.inc *.test *.result \
+ *.pem Moscow_leap des_key_file *.dat *.000001 \
+ *.require *.opt
+
do
if [ -f $i ]
then
@@ -252,7 +255,7 @@ make -C $SOURCE/ndb windoze
# Input directories to be copied recursively
#
-for i in bdb innobase ndb
+for i in bdb innobase mysql-test ndb
do
copy_dir_dirs $i
done
diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh
index 6790ebbffa6..d5c96532782 100644
--- a/scripts/mysql_fix_privilege_tables.sh
+++ b/scripts/mysql_fix_privilege_tables.sh
@@ -15,6 +15,7 @@ socket=""
database="mysql"
bindir="."
pkgdatadir="@pkgdatadir@"
+print_defaults_bindir="."
file=mysql_fix_privilege_tables.sql
@@ -58,7 +59,9 @@ parse_arguments() {
--port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;;
--socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;;
--database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;;
- --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"` ;;
+ --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"`
+ print_defaults_bindir=$bindir
+ ;;
*)
if test -n "$pick_args"
then
@@ -75,7 +78,7 @@ parse_arguments() {
# [mysql_install_db], and then merge with the command line arguments
print_defaults=my_print_defaults
-for dir in ./bin @bindir@ @bindir@ extra $bindir/../bin $bindir/../extra
+for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra
do
if test -x $dir/my_print_defaults
then
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 3be1320f0b0..7fd0fdef978 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -213,7 +213,7 @@ then
fi
mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \
--skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \
---skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M"
+--skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K"
if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \
| eval "$mysqld_install_cmd_line"
then
diff --git a/server-tools/instance-manager/commands.cc b/server-tools/instance-manager/commands.cc
index 207ec3183e6..dacace1af1e 100644
--- a/server-tools/instance-manager/commands.cc
+++ b/server-tools/instance-manager/commands.cc
@@ -266,7 +266,7 @@ int Show_instance_options::do_command(struct st_net *net,
if (instance->options.mysqld_path != NULL)
{
position= 0;
- store_to_string(&send_buff, (char *) "mysqld_path", &position);
+ store_to_string(&send_buff, (char *) "mysqld-path", &position);
store_to_string(&send_buff,
(char *) instance->options.mysqld_path,
&position);
@@ -286,7 +286,7 @@ int Show_instance_options::do_command(struct st_net *net,
if (instance->options.mysqld_user != NULL)
{
position= 0;
- store_to_string(&send_buff, (char *) "admin_user", &position);
+ store_to_string(&send_buff, (char *) "admin-user", &position);
store_to_string(&send_buff,
(char *) instance->options.mysqld_user,
&position);
@@ -297,7 +297,7 @@ int Show_instance_options::do_command(struct st_net *net,
if (instance->options.mysqld_password != NULL)
{
position= 0;
- store_to_string(&send_buff, (char *) "admin_password", &position);
+ store_to_string(&send_buff, (char *) "admin-password", &position);
store_to_string(&send_buff,
(char *) instance->options.mysqld_password,
&position);
@@ -408,7 +408,6 @@ int Stop_instance::execute(struct st_net *net, ulong connection_id)
stop_guard(instance);
if ((err_code= instance->stop()))
return err_code;
- printf("instance was stopped\n");
net_send_ok(net, connection_id);
return 0;
}
diff --git a/server-tools/instance-manager/instance_options.cc b/server-tools/instance-manager/instance_options.cc
index 4f299252bac..fab69865c85 100644
--- a/server-tools/instance-manager/instance_options.cc
+++ b/server-tools/instance-manager/instance_options.cc
@@ -101,9 +101,9 @@ int Instance_options::add_option(const char* option)
{"--datadir=", 10, &mysqld_datadir, SAVE_WHOLE_AND_ADD},
{"--bind-address=", 15, &mysqld_bind_address, SAVE_WHOLE_AND_ADD},
{"--pid-file=", 11, &mysqld_pid_file, SAVE_WHOLE_AND_ADD},
- {"--mysqld_path=", 14, &mysqld_path, SAVE_VALUE},
- {"--admin_user=", 13, &mysqld_user, SAVE_VALUE},
- {"--admin_password=", 17, &mysqld_password, SAVE_VALUE},
+ {"--mysqld-path=", 14, &mysqld_path, SAVE_VALUE},
+ {"--admin-user=", 13, &mysqld_user, SAVE_VALUE},
+ {"--admin-password=", 17, &mysqld_password, SAVE_VALUE},
{"--guarded", 9, &is_guarded, SAVE_WHOLE},
{NULL, 0, NULL, 0}
};
diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc
index f754793e319..f79ca903e7a 100644
--- a/sql/examples/ha_archive.cc
+++ b/sql/examples/ha_archive.cc
@@ -520,6 +520,7 @@ error:
int ha_archive::write_row(byte * buf)
{
z_off_t written;
+ Field_blob **field;
DBUG_ENTER("ha_archive::write_row");
if (share->crashed)
@@ -540,7 +541,7 @@ int ha_archive::write_row(byte * buf)
We should probably mark the table as damagaged if the record is written
but the blob fails.
*/
- for (Field_blob **field=table->blob_field ; *field ; field++)
+ for (field= table->blob_field ; *field ; field++)
{
char *ptr;
uint32 size= (*field)->get_length();
diff --git a/sql/field.cc b/sql/field.cc
index ebeee476985..a270f102cd5 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -342,9 +342,10 @@ String *Field::val_int_as_str(String *val_buffer, my_bool unsigned_flag)
longlong value= val_int();
if (val_buffer->alloc(length))
return 0;
- length= (uint) cs->cset->longlong10_to_str(cs, (char*) val_buffer->ptr(),
- length, unsigned_flag ? 10 : -10,
- value);
+ length= (uint) (*cs->cset->longlong10_to_str)(cs, (char*) val_buffer->ptr(),
+ length,
+ unsigned_flag ? 10 : -10,
+ value);
val_buffer->length(length);
return val_buffer;
}
@@ -2197,7 +2198,7 @@ int Field_longlong::store(double nr)
res= LONGLONG_MIN;
error= (nr < (double) LONGLONG_MIN);
}
- else if (nr >= (double) LONGLONG_MAX)
+ else if (nr >= (double) (ulonglong) LONGLONG_MAX)
{
res= LONGLONG_MAX;
error= (nr > (double) LONGLONG_MAX);
@@ -5919,8 +5920,7 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
}
/* Remove end space */
- while (length > 0 && my_isspace(system_charset_info,from[length-1]))
- length--;
+ length= field_charset->cset->lengthsp(field_charset, from, length);
uint tmp=find_type2(typelib, from, length, field_charset);
if (!tmp)
{
@@ -6022,7 +6022,7 @@ String *Field_enum::val_str(String *val_buffer __attribute__((unused)),
val_ptr->set("", 0, field_charset);
else
val_ptr->set((const char*) typelib->type_names[tmp-1],
- (uint) strlen(typelib->type_names[tmp-1]),
+ typelib->type_lengths[tmp-1],
field_charset);
return val_ptr;
}
@@ -6059,13 +6059,14 @@ void Field_enum::sql_type(String &res) const
res.append("enum(");
bool flag=0;
- for (const char **pos= typelib->type_names; *pos; pos++)
+ uint *len= typelib->type_lengths;
+ for (const char **pos= typelib->type_names; *pos; pos++, len++)
{
uint dummy_errors;
if (flag)
res.append(',');
/* convert to res.charset() == utf8, then quote */
- enum_item.copy(*pos, strlen(*pos), charset(), res.charset(), &dummy_errors);
+ enum_item.copy(*pos, *len, charset(), res.charset(), &dummy_errors);
append_unescaped(&res, enum_item.ptr(), enum_item.length());
flag= 1;
}
@@ -6144,14 +6145,15 @@ String *Field_set::val_str(String *val_buffer,
uint bitnr=0;
val_buffer->length(0);
+ val_buffer->set_charset(field_charset);
while (tmp && bitnr < (uint) typelib->count)
{
if (tmp & 1)
{
if (val_buffer->length())
- val_buffer->append(field_separator);
+ val_buffer->append(&field_separator, 1, &my_charset_latin1);
String str(typelib->type_names[bitnr],
- (uint) strlen(typelib->type_names[bitnr]),
+ typelib->type_lengths[bitnr],
field_charset);
val_buffer->append(str);
}
@@ -6171,13 +6173,14 @@ void Field_set::sql_type(String &res) const
res.append("set(");
bool flag=0;
- for (const char **pos= typelib->type_names; *pos; pos++)
+ uint *len= typelib->type_lengths;
+ for (const char **pos= typelib->type_names; *pos; pos++, len++)
{
uint dummy_errors;
if (flag)
res.append(',');
/* convert to res.charset() == utf8, then quote */
- set_item.copy(*pos, strlen(*pos), charset(), res.charset(), &dummy_errors);
+ set_item.copy(*pos, *len, charset(), res.charset(), &dummy_errors);
append_unescaped(&res, set_item.ptr(), set_item.length());
flag= 1;
}
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc
index 0bbdf84c8d6..57b5e006489 100644
--- a/sql/gen_lex_hash.cc
+++ b/sql/gen_lex_hash.cc
@@ -83,8 +83,17 @@ TODO:
#include "mysql_version.h"
#include "lex.h"
+const char *default_dbug_option="d:t:o,/tmp/gen_lex_hash.trace";
+
struct my_option my_long_options[] =
{
+#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},
+#else
+ {"debug", '#', "Output debug log", (gptr*) &default_dbug_option,
+ (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+#endif
{"help", '?', "Display help and exit",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit",
@@ -108,7 +117,7 @@ hash_lex_struct *get_hash_struct_by_len(hash_lex_struct **root_by_len,
{
if (*max_len<len){
*root_by_len= (hash_lex_struct *)realloc((char*)*root_by_len,
- sizeof(hash_lex_struct)*len);
+ sizeof(hash_lex_struct)*len);
hash_lex_struct *cur, *end= *root_by_len + len;
for (cur= *root_by_len + *max_len; cur<end; cur++)
cur->first_char= 0;
@@ -353,6 +362,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case '?':
usage(0);
exit(0);
+ case '#':
+ DBUG_PUSH(argument ? argument : default_dbug_option);
+ break;
}
return 0;
}
@@ -425,11 +437,12 @@ int check_duplicates()
int main(int argc,char **argv)
{
MY_INIT(argv[0]);
+ DBUG_PROCESS(argv[0]);
if (get_options(argc,(char **) argv))
exit(1);
- printf("/* Copyright (C) 2001 MySQL AB\n\
+ printf("/* Copyright (C) 2001-2004 MySQL AB\n\
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
and you are welcome to modify and redistribute it under the GPL license\n\
\n*/\n\n");
@@ -449,9 +462,8 @@ int main(int argc,char **argv)
printf("\nunsigned int sql_functions_max_len=%d;\n",max_len);
printf("\nunsigned int symbols_max_len=%d;\n\n",max_len2);
- printf
-(
-"inline SYMBOL *get_hash_symbol(const char *s,\n\
+ printf("\
+inline SYMBOL *get_hash_symbol(const char *s,\n \
unsigned int len,bool function)\n\
{\n\
register uchar *hash_map;\n\
@@ -516,5 +528,7 @@ int main(int argc,char **argv)
}\n\
}\n"
);
+ my_end(0);
+ exit(0);
}
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index c23a728b715..c89eb4426ff 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -1410,8 +1410,9 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
keydef[i].seg[j].start= pos->key_part[j].offset;
keydef[i].seg[j].length= pos->key_part[j].length;
keydef[i].seg[j].bit_start= keydef[i].seg[j].bit_end=
- keydef[i].seg[j].bit_pos= 0;
- keydef[i].seg[j].language = field->charset()->number;
+ keydef[i].seg[j].bit_length= 0;
+ keydef[i].seg[j].bit_pos= 0;
+ keydef[i].seg[j].language= field->charset()->number;
if (field->null_ptr)
{
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 12cf4874129..fe1ee55175a 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -32,6 +32,10 @@
#include <ndbapi/NdbApi.hpp>
#include <ndbapi/NdbScanFilter.hpp>
+// options from from mysqld.cc
+extern my_bool opt_ndb_optimized_node_selection;
+extern const char *opt_ndbcluster_connectstring;
+
// Default value for parallelism
static const int parallelism= 0;
@@ -39,9 +43,6 @@ static const int parallelism= 0;
// createable against NDB from this handler
static const int max_transactions= 256;
-// connectstring to cluster if given by mysqld
-const char *ndbcluster_connectstring= 0;
-
static const char *ha_ndb_ext=".ndb";
#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8
@@ -408,6 +409,7 @@ static inline bool ndb_supported_type(enum_field_types type)
case MYSQL_TYPE_NULL:
case MYSQL_TYPE_GEOMETRY:
case MYSQL_TYPE_VARCHAR:
+ case MYSQL_TYPE_BIT:
break;
}
return FALSE;
@@ -3704,9 +3706,13 @@ int ha_ndbcluster::create_index(const char *name,
int ha_ndbcluster::rename_table(const char *from, const char *to)
{
+ NDBDICT *dict;
char new_tabname[FN_HEADLEN];
+ const NDBTAB *orig_tab;
+ int result;
DBUG_ENTER("ha_ndbcluster::rename_table");
+ DBUG_PRINT("info", ("Renaming %s to %s", from, to));
set_dbname(from);
set_tabname(from);
set_tabname(to, new_tabname);
@@ -3714,14 +3720,20 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
if (check_ndb_connection())
DBUG_RETURN(my_errno= HA_ERR_NO_CONNECTION);
+ dict= m_ndb->getDictionary();
+ if (!(orig_tab= dict->getTable(m_tabname)))
+ ERR_RETURN(dict->getNdbError());
- int result= alter_table_name(m_tabname, new_tabname);
- if (result == 0)
+ m_table= (void *)orig_tab;
+ // Change current database to that of target table
+ set_dbname(to);
+ m_ndb->setDatabaseName(m_dbname);
+ if (!(result= alter_table_name(new_tabname)))
{
- set_tabname(to);
- handler::rename_table(from, to);
+ // Rename .ndb file
+ result= handler::rename_table(from, to);
}
-
+
DBUG_RETURN(result);
}
@@ -3730,19 +3742,16 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
Rename a table in NDB Cluster using alter table
*/
-int ha_ndbcluster::alter_table_name(const char *from, const char *to)
+int ha_ndbcluster::alter_table_name(const char *to)
{
- NDBDICT *dict= m_ndb->getDictionary();
- const NDBTAB *orig_tab;
+ NDBDICT * dict= m_ndb->getDictionary();
+ const NDBTAB *orig_tab= (const NDBTAB *) m_table;
+ int ret;
DBUG_ENTER("alter_table_name_table");
- DBUG_PRINT("enter", ("Renaming %s to %s", from, to));
- if (!(orig_tab= dict->getTable(from)))
- ERR_RETURN(dict->getNdbError());
-
- NdbDictionary::Table copy_tab= dict->getTableForAlteration(from);
- copy_tab.setName(to);
- if (dict->alterTable(copy_tab) != 0)
+ NdbDictionary::Table new_tab= *orig_tab;
+ new_tab.setName(to);
+ if (dict->alterTable(new_tab) != 0)
ERR_RETURN(dict->getNdbError());
m_table= NULL;
@@ -3765,7 +3774,7 @@ int ha_ndbcluster::delete_table(const char *name)
if (check_ndb_connection())
DBUG_RETURN(HA_ERR_NO_CONNECTION);
-
+ // Remove .ndb file
handler::delete_table(name);
DBUG_RETURN(drop_table());
}
@@ -4026,6 +4035,7 @@ Ndb* check_ndb_in_thd(THD* thd)
}
+
int ha_ndbcluster::check_ndb_connection()
{
THD* thd= current_thd;
@@ -4308,15 +4318,19 @@ bool ndbcluster_init()
int res;
DBUG_ENTER("ndbcluster_init");
// Set connectstring if specified
- if (ndbcluster_connectstring != 0)
- DBUG_PRINT("connectstring", ("%s", ndbcluster_connectstring));
+ if (opt_ndbcluster_connectstring != 0)
+ DBUG_PRINT("connectstring", ("%s", opt_ndbcluster_connectstring));
if ((g_ndb_cluster_connection=
- new Ndb_cluster_connection(ndbcluster_connectstring)) == 0)
+ new Ndb_cluster_connection(opt_ndbcluster_connectstring)) == 0)
{
- DBUG_PRINT("error",("Ndb_cluster_connection(%s)",ndbcluster_connectstring));
+ DBUG_PRINT("error",("Ndb_cluster_connection(%s)",
+ opt_ndbcluster_connectstring));
goto ndbcluster_init_error;
}
+ g_ndb_cluster_connection->set_optimized_node_selection
+ (opt_ndb_optimized_node_selection);
+
// Create a Ndb object to open the connection to NDB
g_ndb= new Ndb(g_ndb_cluster_connection, "sys");
g_ndb->getDictionary()->set_local_table_data_size(sizeof(Ndb_table_local_info));
@@ -4331,7 +4345,7 @@ bool ndbcluster_init()
DBUG_PRINT("info",("NDBCLUSTER storage engine at %s on port %d",
g_ndb_cluster_connection->get_connected_host(),
g_ndb_cluster_connection->get_connected_port()));
- g_ndb->waitUntilReady(10);
+ g_ndb_cluster_connection->wait_until_ready(10,0);
}
else if(res == 1)
{
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index 133b9bc04ee..44619068b07 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -156,7 +156,7 @@ class ha_ndbcluster: public handler
uint8 table_cache_type();
private:
- int alter_table_name(const char *from, const char *to);
+ int alter_table_name(const char *to);
int drop_table();
int create_index(const char *name, KEY *key_info, bool unique);
int create_ordered_index(const char *name, KEY *key_info);
diff --git a/sql/handler.cc b/sql/handler.cc
index 65b0f10d17c..cde2c7b02a8 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1324,6 +1324,9 @@ void handler::print_error(int error, myf errflag)
textno=ER_DUP_KEY;
break;
}
+ case HA_ERR_NULL_IN_SPATIAL:
+ textno= ER_UNKNOWN_ERROR;
+ DBUG_VOID_RETURN;
case HA_ERR_FOUND_DUPP_UNIQUE:
textno=ER_DUP_UNIQUE;
break;
@@ -1446,7 +1449,8 @@ uint handler::get_dup_key(int error)
{
DBUG_ENTER("handler::get_dup_key");
table->file->errkey = (uint) -1;
- 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 ||
+ error == HA_ERR_NULL_IN_SPATIAL)
info(HA_STATUS_ERRKEY | HA_STATUS_NO_LOCK);
DBUG_RETURN(table->file->errkey);
}
diff --git a/sql/item.cc b/sql/item.cc
index 9117105f26e..7dba1f3a66a 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -23,7 +23,6 @@
#include <m_ctype.h>
#include "my_dir.h"
#include "sp_rcontext.h"
-#include "sql_acl.h"
#include "sp_head.h"
#include "sql_trigger.h"
#include "sql_select.h"
@@ -73,7 +72,7 @@ Item::Item():
}
/*
- Constructor used by Item_field, Item_ref & agregate (sum) functions.
+ Constructor used by Item_field, Item_*_ref & agregate (sum) functions.
Used for duplicating lists in processing queries with temporary
tables
*/
@@ -171,7 +170,7 @@ Item_ident::Item_ident(const char *db_name_par,const char *table_name_par,
}
-/* Constructor used by Item_field & Item_ref (see Item comment) */
+/* Constructor used by Item_field & Item_*_ref (see Item comment) */
Item_ident::Item_ident(THD *thd, Item_ident *item)
:Item(thd, item),
@@ -1780,16 +1779,13 @@ resolve_ref_in_select_and_group(THD *thd, Item_ident *ref, SELECT_LEX *select)
}
return (select->ref_pointer_array + counter);
}
- else if (group_by_ref)
+ if (group_by_ref)
return group_by_ref;
- else
- {
- DBUG_ASSERT(FALSE);
- return NULL; /* So there is no compiler warning. */
- }
+ DBUG_ASSERT(FALSE);
+ return NULL; /* So there is no compiler warning. */
}
- else
- return (Item**) not_found_item;
+
+ return (Item**) not_found_item;
}
@@ -1847,6 +1843,7 @@ resolve_ref_in_select_and_group(THD *thd, Item_ident *ref, SELECT_LEX *select)
bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
{
+ enum_parsing_place place= NO_MATTER;
DBUG_ASSERT(fixed == 0);
if (!field) // If field is not checked
{
@@ -1885,13 +1882,14 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
/* Search in the tables of the FROM clause of the outer select. */
table_list= outer_sel->get_table_list();
if (outer_sel->resolve_mode == SELECT_LEX::INSERT_MODE && table_list)
+ {
/*
It is a primary INSERT st_select_lex => do not resolve against the
first table.
*/
table_list= table_list->next_local;
-
- enum_parsing_place place= prev_subselect_item->parsing_place;
+ }
+ place= prev_subselect_item->parsing_place;
/*
Check table fields only if the subquery is used somewhere out of
HAVING, or the outer SELECT does not use grouping (i.e. tables are
@@ -1926,7 +1924,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
/* Search in the SELECT and GROUP lists of the outer select. */
if (outer_sel->resolve_mode == SELECT_LEX::SELECT_MODE)
- {
+ {
if (!(ref= resolve_ref_in_select_and_group(thd, this, outer_sel)))
return TRUE; /* Some error occured (e.g. ambigous names). */
if (ref != not_found_item)
@@ -1968,10 +1966,23 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
}
else if (ref != not_found_item)
{
+ Item *save;
+ Item_ref *rf;
+
/* Should have been checked in resolve_ref_in_select_and_group(). */
DBUG_ASSERT(*ref && (*ref)->fixed);
-
- Item_ref *rf= new Item_ref(ref, (char *)table_name, (char *)field_name);
+ /*
+ Here, a subset of actions performed by Item_ref::set_properties
+ is not enough. So we pass ptr to NULL into Item_[direct]_ref
+ constructor, so no initialization is performed, and call
+ fix_fields() below.
+ */
+ save= *ref;
+ *ref= NULL; // Don't call set_properties()
+ rf= (place == IN_HAVING ?
+ new Item_ref(ref, (char*) table_name, (char*) field_name) :
+ new Item_direct_ref(ref, (char*) table_name, (char*) field_name));
+ *ref= save;
if (!rf)
return TRUE;
thd->change_item_tree(reference, rf);
@@ -2859,6 +2870,7 @@ bool Item_field::send(Protocol *protocol, String *buffer)
bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
{
DBUG_ASSERT(fixed == 0);
+ enum_parsing_place place= NO_MATTER;
SELECT_LEX *current_sel= thd->lex->current_select;
if (!ref)
@@ -2919,7 +2931,7 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
*/
table_list= table_list->next_local;
- enum_parsing_place place= prev_subselect_item->parsing_place;
+ place= prev_subselect_item->parsing_place;
/*
Check table fields only if the subquery is used somewhere out of
HAVING or the outer SELECT does not use grouping (i.e. tables are
@@ -3037,6 +3049,16 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
"forward reference in item list"));
return TRUE;
}
+
+ set_properties();
+
+ if (ref && (*ref)->check_cols(1))
+ return 1;
+ return 0;
+}
+
+void Item_ref::set_properties()
+{
max_length= (*ref)->max_length;
maybe_null= (*ref)->maybe_null;
decimals= (*ref)->decimals;
@@ -3047,10 +3069,6 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
else
alias_name_used= TRUE; // it is not field, so it is was resolved by alias
fixed= 1;
-
- if (ref && (*ref)->check_cols(1))
- return TRUE;
- return FALSE;
}
@@ -3156,7 +3174,7 @@ bool Item_default_value::fix_fields(THD *thd,
fixed= 1;
return FALSE;
}
- if (arg->fix_fields(thd, table_list, &arg))
+ if (!arg->fixed && arg->fix_fields(thd, table_list, &arg))
return TRUE;
if (arg->type() == REF_ITEM)
@@ -3207,7 +3225,7 @@ bool Item_insert_value::fix_fields(THD *thd,
Item **items)
{
DBUG_ASSERT(fixed == 0);
- if (arg->fix_fields(thd, table_list, &arg))
+ if (!arg->fixed && arg->fix_fields(thd, table_list, &arg))
return TRUE;
if (arg->type() == REF_ITEM)
diff --git a/sql/item.h b/sql/item.h
index d5361bdcc8a..2503f137355 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -941,7 +941,7 @@ class Item_empty_string :public Item_string
public:
Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) :
Item_string("",0, cs ? cs : &my_charset_bin)
- { name=(char*) header; max_length=length;}
+ { name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; }
void make_field(Send_field *field);
};
@@ -1010,14 +1010,36 @@ public:
class Item_ref :public Item_ident
{
+protected:
+ void set_properties();
public:
Field *result_field; /* Save result here */
Item **ref;
Item_ref(const char *db_par, const char *table_name_par,
const char *field_name_par)
:Item_ident(db_par, table_name_par, field_name_par), result_field(0), ref(0) {}
+ /*
+ This constructor is used in two scenarios:
+ A) *item = NULL
+ No initialization is performed, fix_fields() call will be necessary.
+
+ B) *item points to an Item this Item_ref will refer to. This is
+ used for GROUP BY. fix_fields() will not be called in this case,
+ so we call set_properties to make this item "fixed". set_properties
+ performs a subset of action Item_ref::fix_fields does, and this subset
+ is enough for Item_ref's used in GROUP BY.
+
+ TODO we probably fix a superset of problems like in BUG#6658. Check this
+ with Bar, and if we have a more broader set of problems like this.
+ */
Item_ref(Item **item, const char *table_name_par, const char *field_name_par)
- :Item_ident(NullS, table_name_par, field_name_par), result_field(0), ref(item) {}
+ :Item_ident(NullS, table_name_par, field_name_par), result_field(0), ref(item)
+ {
+ DBUG_ASSERT(item);
+ if (*item)
+ set_properties();
+ }
+
/* Constructor need to process subselect with temporary tables (see Item) */
Item_ref(THD *thd, Item_ref *item) :Item_ident(thd, item), result_field(item->result_field), ref(item->ref) {}
enum Type type() const { return REF_ITEM; }
@@ -1025,29 +1047,34 @@ public:
{ return ref && (*ref)->eq(item, binary_cmp); }
double val_real()
{
+ DBUG_ASSERT(fixed);
double tmp=(*ref)->val_result();
null_value=(*ref)->null_value;
return tmp;
}
longlong val_int()
{
+ DBUG_ASSERT(fixed);
longlong tmp=(*ref)->val_int_result();
null_value=(*ref)->null_value;
return tmp;
}
String *val_str(String* tmp)
{
+ DBUG_ASSERT(fixed);
tmp=(*ref)->str_result(tmp);
null_value=(*ref)->null_value;
return tmp;
}
bool is_null()
{
+ DBUG_ASSERT(fixed);
(void) (*ref)->val_int_result();
return (*ref)->null_value;
}
bool get_date(TIME *ltime,uint fuzzydate)
{
+ DBUG_ASSERT(fixed);
return (null_value=(*ref)->get_date_result(ltime,fuzzydate));
}
double val_result();
@@ -1079,7 +1106,52 @@ public:
void cleanup();
};
+
+/*
+ The same as Item_ref, but get value from val_* family of method to get
+ value of item on which it referred instead of result* family.
+*/
+class Item_direct_ref :public Item_ref
+{
+public:
+ Item_direct_ref(Item **item, const char *table_name_par,
+ const char *field_name_par)
+ :Item_ref(item, table_name_par, field_name_par) {}
+ /* Constructor need to process subselect with temporary tables (see Item) */
+ Item_direct_ref(THD *thd, Item_direct_ref *item) : Item_ref(thd, item) {}
+
+ double val_real()
+ {
+ double tmp=(*ref)->val_real();
+ null_value=(*ref)->null_value;
+ return tmp;
+ }
+ longlong val_int()
+ {
+ longlong tmp=(*ref)->val_int();
+ null_value=(*ref)->null_value;
+ return tmp;
+ }
+ String *val_str(String* tmp)
+ {
+ tmp=(*ref)->val_str(tmp);
+ null_value=(*ref)->null_value;
+ return tmp;
+ }
+ bool is_null()
+ {
+ (void) (*ref)->val_int();
+ return (*ref)->null_value;
+ }
+ bool get_date(TIME *ltime,uint fuzzydate)
+ {
+ return (null_value=(*ref)->get_date(ltime,fuzzydate));
+ }
+};
+
+
class Item_in_subselect;
+
class Item_ref_null_helper: public Item_ref
{
protected:
@@ -1101,9 +1173,9 @@ class Item_null_helper :public Item_ref_null_helper
public:
Item_null_helper(Item_in_subselect* master, Item *item,
const char *table_name_par, const char *field_name_par)
- :Item_ref_null_helper(master, &store, table_name_par, field_name_par),
+ :Item_ref_null_helper(master, &item, table_name_par, field_name_par),
store(item)
- {}
+ { ref= &store; }
void print(String *str);
};
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 90eee9e76d1..40513c2c25a 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -106,7 +106,7 @@ longlong Item_func_not::val_int()
DBUG_ASSERT(fixed == 1);
double value= args[0]->val_real();
null_value=args[0]->null_value;
- return !null_value && value == 0 ? 1 : 0;
+ return ((!null_value && value == 0) ? 1 : 0);
}
/*
@@ -117,13 +117,23 @@ longlong Item_func_not_all::val_int()
{
DBUG_ASSERT(fixed == 1);
double value= args[0]->val_real();
- if (abort_on_null)
- {
- null_value= 0;
- return (args[0]->null_value || value == 0) ? 1 : 0;
- }
+
+ /*
+ return TRUE if there was records in underlaying select in max/min
+ optimisation (ALL subquery)
+ */
+ if (empty_underlying_subquery())
+ return 1;
+
null_value= args[0]->null_value;
- return (!null_value && value == 0) ? 1 : 0;
+ return ((!null_value && value == 0) ? 1 : 0);
+}
+
+
+bool Item_func_not_all::empty_underlying_subquery()
+{
+ return ((test_sum_item && !test_sum_item->any_value()) ||
+ (test_sub_item && !test_sub_item->any_value()));
}
void Item_func_not_all::print(String *str)
@@ -134,6 +144,30 @@ void Item_func_not_all::print(String *str)
args[0]->print(str);
}
+
+/*
+ Special NOP (No OPeration) for ALL subquery it is like Item_func_not_all
+ (return TRUE if underlaying sudquery do not return rows) but if subquery
+ returns some rows it return same value as argument (TRUE/FALSE).
+*/
+
+longlong Item_func_nop_all::val_int()
+{
+ DBUG_ASSERT(fixed == 1);
+ longlong value= args[0]->val_int();
+
+ /*
+ return FALSE if there was records in underlaying select in max/min
+ optimisation (SAME/ANY subquery)
+ */
+ if (empty_underlying_subquery())
+ return 0;
+
+ null_value= args[0]->null_value;
+ return (null_value || value == 0) ? 0 : 1;
+}
+
+
/*
Convert a constant expression or string to an integer.
This is done when comparing DATE's of different formats and
@@ -2053,6 +2087,7 @@ void Item_cond::split_sum_func(THD *thd, Item **ref_pointer_array,
{
Item **ref= li.ref();
uint el= fields.elements;
+ ref_pointer_array[el]= item;
Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name);
fields.push_front(item);
ref_pointer_array[el]= item;
@@ -2404,8 +2439,10 @@ bool
Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
DBUG_ASSERT(fixed == 0);
- if (args[0]->fix_fields(thd, tables, args) || args[0]->check_cols(1) ||
- args[1]->fix_fields(thd,tables, args + 1) || args[1]->check_cols(1))
+ if ((!args[0]->fixed &&
+ args[0]->fix_fields(thd, tables, args)) || args[0]->check_cols(1) ||
+ (!args[1]->fixed &&
+ args[1]->fix_fields(thd,tables, args + 1)) || args[1]->check_cols(1))
return TRUE; /* purecov: inspected */
with_sum_func=args[0]->with_sum_func || args[1]->with_sum_func;
max_length= 1;
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 6a7e037bed1..a6fe9e44a3d 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -231,6 +231,7 @@ public:
Item *neg_transformer(THD *thd);
};
+class Item_maxmin_subselect;
/*
The class Item_func_trig_cond is used for guarded predicates
@@ -267,19 +268,40 @@ public:
class Item_func_not_all :public Item_func_not
{
+ /* allow to check presence od values in max/min optimisation */
+ Item_sum_hybrid *test_sum_item;
+ Item_maxmin_subselect *test_sub_item;
+
bool abort_on_null;
public:
bool show;
- Item_func_not_all(Item *a) :Item_func_not(a), abort_on_null(0), show(0) {}
+ Item_func_not_all(Item *a)
+ :Item_func_not(a), test_sum_item(0), test_sub_item(0), abort_on_null(0),
+ show(0)
+ {}
virtual void top_level_item() { abort_on_null= 1; }
bool top_level() { return abort_on_null; }
longlong val_int();
enum Functype functype() const { return NOT_ALL_FUNC; }
const char *func_name() const { return "<not>"; }
void print(String *str);
+ void set_sum_test(Item_sum_hybrid *item) { test_sum_item= item; };
+ void set_sub_test(Item_maxmin_subselect *item) { test_sub_item= item; };
+ bool empty_underlying_subquery();
};
+
+class Item_func_nop_all :public Item_func_not_all
+{
+public:
+
+ Item_func_nop_all(Item *a) :Item_func_not_all(a) {}
+ longlong val_int();
+ const char *func_name() const { return "<nop>"; }
+};
+
+
class Item_func_eq :public Item_bool_rowready_func2
{
public:
diff --git a/sql/item_create.h b/sql/item_create.h
index d48aed5284a..1be33fef257 100644
--- a/sql/item_create.h
+++ b/sql/item_create.h
@@ -86,7 +86,7 @@ Item *create_func_soundex(Item* a);
Item *create_func_space(Item *);
Item *create_func_sqrt(Item* a);
Item *create_func_strcmp(Item* a, Item *b);
-Item *create_func_tan(Item* a);;
+Item *create_func_tan(Item* a);
Item *create_func_time_format(Item *a, Item *b);
Item *create_func_time_to_sec(Item* a);
Item *create_func_to_days(Item* a);
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 35cced090e6..f2d78fdb9e8 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -22,7 +22,6 @@
#endif
#include "mysql_priv.h"
-#include "sql_acl.h"
#include "slave.h" // for wait_for_master_pos
#include <m_ctype.h>
#include <hash.h>
@@ -395,8 +394,8 @@ void Item_func::split_sum_func(THD *thd, Item **ref_pointer_array,
else if (item->used_tables() || item->type() == SUM_FUNC_ITEM)
{
uint el= fields.elements;
+ ref_pointer_array[el]= item;
Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name);
- new_item->collation.set(item->collation);
fields.push_front(item);
ref_pointer_array[el]= item;
thd->change_item_tree(arg, new_item);
@@ -856,9 +855,25 @@ longlong Item_func_neg::val_int()
void Item_func_neg::fix_length_and_dec()
{
+ enum Item_result arg_result= args[0]->result_type();
+ enum Item::Type arg_type= args[0]->type();
decimals=args[0]->decimals;
max_length=args[0]->max_length;
hybrid_type= REAL_RESULT;
+
+ /*
+ We need to account for added '-' in the following cases:
+ A) argument is a real or integer positive constant - in this case
+ argument's max_length is set to actual number of bytes occupied, and not
+ maximum number of bytes real or integer may require. Note that all
+ constants are non negative so we don't need to account for removed '-'.
+ B) argument returns a string.
+ */
+ if (arg_result == STRING_RESULT ||
+ (arg_type == REAL_ITEM && ((Item_real*)args[0])->value >= 0) ||
+ (arg_type == INT_ITEM && ((Item_int*)args[0])->value > 0))
+ max_length++;
+
if (args[0]->result_type() == INT_RESULT)
{
/*
@@ -1743,7 +1758,8 @@ udf_handler::fix_fields(THD *thd, TABLE_LIST *tables, Item_result_field *func,
arg != arg_end ;
arg++,i++)
{
- if ((*arg)->fix_fields(thd, tables, arg))
+ if (!(*arg)->fixed &&
+ (*arg)->fix_fields(thd, tables, arg))
DBUG_RETURN(1);
// we can't assign 'item' before, because fix_fields() can change arg
Item *item= *arg;
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index 163260f6428..1a8cb50081b 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -24,7 +24,6 @@
#include "mysql_priv.h"
#ifdef HAVE_SPATIAL
-#include "sql_acl.h"
#include <m_ctype.h>
void Item_geometry_func::fix_length_and_dec()
diff --git a/sql/item_row.cc b/sql/item_row.cc
index 0c7eae9d920..62f31186b09 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -95,6 +95,7 @@ void Item_row::split_sum_func(THD *thd, Item **ref_pointer_array,
else if ((*arg)->used_tables() || (*arg)->type() == SUM_FUNC_ITEM)
{
uint el= fields.elements;
+ ref_pointer_array[el]=*arg;
Item *new_item= new Item_ref(ref_pointer_array + el, 0, (*arg)->name);
fields.push_front(*arg);
ref_pointer_array[el]= *arg;
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index bf172e1744d..c271ff43fa3 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -25,7 +25,6 @@
#endif
#include "mysql_priv.h"
-#include "sql_acl.h"
#include <m_ctype.h>
#ifdef HAVE_OPENSSL
#include <openssl/des.h>
@@ -955,8 +954,9 @@ String *Item_func_left::val_str(String *str)
if (res->length() <= (uint) length ||
res->length() <= (char_pos= res->charpos(length)))
return res;
- str_value.set(*res, 0, char_pos);
- return &str_value;
+
+ tmp_value.set(*res, 0, char_pos);
+ return &tmp_value;
}
@@ -1748,6 +1748,7 @@ void Item_func_make_set::split_sum_func(THD *thd, Item **ref_pointer_array,
else if (item->used_tables() || item->type() == SUM_FUNC_ITEM)
{
uint el= fields.elements;
+ ref_pointer_array[el]=item;
Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name);
fields.push_front(item);
ref_pointer_array[el]= item;
@@ -2332,17 +2333,6 @@ String *Item_func_hex::val_str(String *str)
return &tmp_value;
}
-inline int hexchar_to_int(char c)
-{
- if (c <= '9' && c >= '0')
- return c-'0';
- c|=32;
- if (c <= 'f' && c >= 'a')
- return c-'a'+10;
- return -1;
-}
-
-
/* Convert given hex string to a binary string */
String *Item_func_unhex::val_str(String *str)
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 647cf022d79..e322e5616a1 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -162,6 +162,7 @@ public:
class Item_func_left :public Item_str_func
{
+ String tmp_value;
public:
Item_func_left(Item *a,Item *b) :Item_str_func(a,b) {}
String *val_str(String *);
@@ -396,7 +397,8 @@ public:
bool fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref)
{
DBUG_ASSERT(fixed == 0);
- return (item->fix_fields(thd, tlist, &item) ||
+ return (!item->fixed &&
+ item->fix_fields(thd, tlist, &item) ||
item->check_cols(1) ||
Item_func::fix_fields(thd, tlist, ref));
}
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 304c3ed4bbd..064744158d1 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -155,6 +155,8 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref)
// did we changed top item of WHERE condition
if (unit->outer_select()->where == (*ref))
unit->outer_select()->where= substitution; // correct WHERE for PS
+ else if (unit->outer_select()->having == (*ref))
+ unit->outer_select()->having= substitution; // correct HAVING for PS
(*ref)= substitution;
substitution->name= name;
@@ -272,7 +274,7 @@ Item_maxmin_subselect::Item_maxmin_subselect(THD *thd_param,
Item_subselect *parent,
st_select_lex *select_lex,
bool max_arg)
- :Item_singlerow_subselect()
+ :Item_singlerow_subselect(), was_values(TRUE)
{
DBUG_ENTER("Item_maxmin_subselect::Item_maxmin_subselect");
max= max_arg;
@@ -297,12 +299,31 @@ Item_maxmin_subselect::Item_maxmin_subselect(THD *thd_param,
DBUG_VOID_RETURN;
}
+void Item_maxmin_subselect::cleanup()
+{
+ DBUG_ENTER("Item_maxmin_subselect::cleanup");
+ Item_singlerow_subselect::cleanup();
+
+ /*
+ By default it is TRUE to avoid TRUE reporting by
+ Item_func_not_all/Item_func_nop_all if this item was never called.
+
+ Engine exec() set it to FALSE by reset_value_registration() call.
+ select_max_min_finder_subselect::send_data() set it back to TRUE if some
+ value will be found.
+ */
+ was_values= TRUE;
+ DBUG_VOID_RETURN;
+}
+
+
void Item_maxmin_subselect::print(String *str)
{
str->append(max?"<max>":"<min>", 5);
Item_singlerow_subselect::print(str);
}
+
void Item_singlerow_subselect::reset()
{
null_value= 1;
@@ -310,6 +331,7 @@ void Item_singlerow_subselect::reset()
value->null_value= 1;
}
+
Item_subselect::trans_res
Item_singlerow_subselect::select_transformer(JOIN *join)
{
@@ -525,7 +547,7 @@ bool Item_in_subselect::test_limit(SELECT_LEX_UNIT *unit)
Item_in_subselect::Item_in_subselect(Item * left_exp,
st_select_lex *select_lex):
- Item_exists_subselect(), transformed(0), upper_not(0)
+ Item_exists_subselect(), transformed(0), upper_item(0)
{
DBUG_ENTER("Item_in_subselect::Item_in_subselect");
left_expr= left_exp;
@@ -687,7 +709,7 @@ Item_in_subselect::single_value_transformer(JOIN *join,
NULL/IS NOT NULL functions). If so, we rewrite ALL/ANY with NOT EXISTS
later in this method.
*/
- if ((abort_on_null || (upper_not && upper_not->top_level())) &&
+ if ((abort_on_null || (upper_item && upper_item->top_level())) &&
!select_lex->master_unit()->uncacheable && !func->eqne_op())
{
if (substitution)
@@ -701,7 +723,7 @@ Item_in_subselect::single_value_transformer(JOIN *join,
!select_lex->with_sum_func &&
!(select_lex->next_select()))
{
- Item *item;
+ Item_sum_hybrid *item;
if (func->l_op())
{
/*
@@ -718,6 +740,8 @@ Item_in_subselect::single_value_transformer(JOIN *join,
*/
item= new Item_sum_min(*select_lex->ref_pointer_array);
}
+ if (upper_item)
+ upper_item->set_sum_test(item);
*select_lex->ref_pointer_array= item;
{
List_iterator<Item> it(select_lex->item_list);
@@ -738,15 +762,19 @@ Item_in_subselect::single_value_transformer(JOIN *join,
}
else
{
+ Item_maxmin_subselect *item;
// remove LIMIT placed by ALL/ANY subquery
select_lex->master_unit()->global_parameters->select_limit=
HA_POS_ERROR;
- subs= new Item_maxmin_subselect(thd, this, select_lex, func->l_op());
+ subs= item= new Item_maxmin_subselect(thd, this, select_lex, func->l_op());
+ if (upper_item)
+ upper_item->set_sub_test(item);
}
// left expression belong to outer select
SELECT_LEX *current= thd->lex->current_select, *up;
thd->lex->current_select= up= current->return_after_parsing();
- if (left_expr->fix_fields(thd, up->get_table_list(), &left_expr))
+ if (!left_expr->fixed &&
+ left_expr->fix_fields(thd, up->get_table_list(), &left_expr))
{
thd->lex->current_select= current;
goto err;
@@ -777,9 +805,9 @@ Item_in_subselect::single_value_transformer(JOIN *join,
As far as Item_ref_in_optimizer do not substitude itself on fix_fields
we can use same item for all selects.
*/
- expr= new Item_ref((Item**)optimizer->get_cache(),
- (char *)"<no matter>",
- (char *)in_left_expr_name);
+ expr= new Item_direct_ref((Item**)optimizer->get_cache(),
+ (char *)"<no matter>",
+ (char *)in_left_expr_name);
unit->uncacheable|= UNCACHEABLE_DEPENDENT;
}
@@ -966,9 +994,10 @@ Item_in_subselect::row_value_transformer(JOIN *join)
(char *) "<no matter>",
(char *) "<list ref>");
func=
- eq_creator.create(new Item_ref((*optimizer->get_cache())->addr(i),
- (char *)"<no matter>",
- (char *)in_left_expr_name),
+ eq_creator.create(new Item_direct_ref((*optimizer->get_cache())->
+ addr(i),
+ (char *)"<no matter>",
+ (char *)in_left_expr_name),
func);
item= and_items(item, func);
}
@@ -1041,8 +1070,8 @@ Item_subselect::trans_res
Item_allany_subselect::select_transformer(JOIN *join)
{
transformed= 1;
- if (upper_not)
- upper_not->show= 1;
+ if (upper_item)
+ upper_item->show= 1;
return single_value_transformer(join, func);
}
@@ -1241,6 +1270,7 @@ int subselect_single_select_engine::exec()
}
if (!executed)
{
+ item->reset_value_registration();
join->exec();
executed= 1;
thd->where= save_where;
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index d0ff3654e48..53fe21a9bb6 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -93,7 +93,7 @@ public:
return null_value;
}
bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref);
- bool exec();
+ virtual bool exec();
virtual void fix_length_and_dec();
table_map used_tables() const;
bool const_item() const;
@@ -109,6 +109,11 @@ public:
engine_changed= 1;
return eng == 0;
}
+ /*
+ Used by max/min subquery to initialize value presence registration
+ mechanism. Engine call this method before rexecution query.
+ */
+ virtual void reset_value_registration() {}
enum_parsing_place place() { return parsing_place; }
friend class select_subselect;
@@ -151,13 +156,20 @@ public:
};
/* used in static ALL/ANY optimisation */
+class select_max_min_finder_subselect;
class Item_maxmin_subselect :public Item_singlerow_subselect
{
+protected:
bool max;
+ bool was_values; // Set if we have found at least one row
public:
Item_maxmin_subselect(THD *thd, Item_subselect *parent,
st_select_lex *select_lex, bool max);
void print(String *str);
+ void cleanup();
+ bool any_value() { return was_values; }
+ void register_value() { was_values= TRUE; }
+ void reset_value_registration() { was_values= FALSE; }
};
/* exists subselect */
@@ -205,11 +217,11 @@ protected:
bool abort_on_null;
bool transformed;
public:
- Item_func_not_all *upper_not; // point on NOT before ALL subquery
+ Item_func_not_all *upper_item; // point on NOT/NOP before ALL/SOME subquery
Item_in_subselect(Item * left_expr, st_select_lex *select_lex);
Item_in_subselect()
- :Item_exists_subselect(), abort_on_null(0), transformed(0), upper_not(0)
+ :Item_exists_subselect(), abort_on_null(0), transformed(0), upper_item(0)
{}
subs_type substype() { return IN_SUBS; }
@@ -249,7 +261,7 @@ public:
st_select_lex *select_lex, bool all);
// only ALL subquery has upper not
- subs_type substype() { return upper_not?ALL_SUBS:ANY_SUBS; }
+ subs_type substype() { return all?ALL_SUBS:ANY_SUBS; }
trans_res select_transformer(JOIN *join);
void print(String *str);
};
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 949545bcdb0..92c91b2e866 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -656,9 +656,24 @@ void Item_sum_hybrid::cleanup()
DBUG_ENTER("Item_sum_hybrid::cleanup");
Item_sum::cleanup();
used_table_cache= ~(table_map) 0;
+
+ /*
+ by default it is TRUE to avoid TRUE reporting by
+ Item_func_not_all/Item_func_nop_all if this item was never called.
+
+ no_rows_in_result() set it to FALSE if was not results found.
+ If some results found it will be left unchanged.
+ */
+ was_values= TRUE;
DBUG_VOID_RETURN;
}
+void Item_sum_hybrid::no_rows_in_result()
+{
+ Item_sum::no_rows_in_result();
+ was_values= FALSE;
+}
+
Item *Item_sum_min::copy_or_same(THD* thd)
{
@@ -2017,7 +2032,9 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
for (i=0 ; i < arg_count ; i++)
{
- if (args[i]->fix_fields(thd, tables, args + i) || args[i]->check_cols(1))
+ if ((!args[i]->fixed &&
+ args[i]->fix_fields(thd, tables, args + i)) ||
+ args[i]->check_cols(1))
return TRUE;
if (i < arg_count_field)
maybe_null|= args[i]->maybe_null;
diff --git a/sql/item_sum.h b/sql/item_sum.h
index c1352f7ae7d..157791722f6 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -442,18 +442,20 @@ class Item_sum_hybrid :public Item_sum
enum_field_types hybrid_field_type;
int cmp_sign;
table_map used_table_cache;
+ bool was_values; // Set if we have found at least one row (for max/min only)
public:
Item_sum_hybrid(Item *item_par,int sign)
:Item_sum(item_par), sum(0.0), sum_int(0),
hybrid_type(INT_RESULT), hybrid_field_type(FIELD_TYPE_LONGLONG),
- cmp_sign(sign), used_table_cache(~(table_map) 0)
+ cmp_sign(sign), used_table_cache(~(table_map) 0), was_values(TRUE)
{ collation.set(&my_charset_bin); }
Item_sum_hybrid(THD *thd, Item_sum_hybrid *item):
Item_sum(thd, item), value(item->value),
sum(item->sum), sum_int(item->sum_int), hybrid_type(item->hybrid_type),
hybrid_field_type(item->hybrid_field_type),cmp_sign(item->cmp_sign),
- used_table_cache(item->used_table_cache)
+ used_table_cache(item->used_table_cache),
+ was_values(TRUE)
{ collation.set(item->collation); }
bool fix_fields(THD *, TABLE_LIST *, Item **);
table_map used_tables() const { return used_table_cache; }
@@ -473,6 +475,8 @@ class Item_sum_hybrid :public Item_sum
void min_max_update_real_field();
void min_max_update_int_field();
void cleanup();
+ bool any_value() { return was_values; }
+ void no_rows_in_result();
};
diff --git a/sql/log.cc b/sql/log.cc
index c659a3ede2e..5d56fefa26a 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -23,7 +23,6 @@
#endif
#include "mysql_priv.h"
-#include "sql_acl.h"
#include "sql_repl.h"
#include "ha_innodb.h" // necessary to cut the binlog when crash recovery
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 760436592b9..581d3ef0d21 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -438,6 +438,9 @@ int Log_event::exec_event(struct st_relay_log_info* rli)
Note that Rotate_log_event::exec_event() does not call this function,
so there is no chance that a fake rotate event resets
last_master_timestamp.
+ Note that we update without mutex (probably ok - except in some very
+ rare cases, only consequence is that value may take some time to
+ display in Seconds_Behind_Master - not critical).
*/
rli->last_master_timestamp= when;
}
@@ -2126,7 +2129,9 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex,
List<Item> &fields_arg,
enum enum_duplicates handle_dup,
bool using_trans)
- :Log_event(thd_arg, 0, using_trans), thread_id(thd_arg->thread_id),
+ :Log_event(thd_arg, !thd_arg->tmp_table_used ?
+ 0 : LOG_EVENT_THREAD_SPECIFIC_F, using_trans),
+ thread_id(thd_arg->thread_id),
slave_proxy_id(thd_arg->variables.pseudo_thread_id),
num_fields(0),fields(0),
field_lens(0),field_block_len(0),
@@ -2329,6 +2334,9 @@ void Load_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_ev
commented ? "# " : "",
db);
+ if (flags & LOG_EVENT_THREAD_SPECIFIC_F)
+ fprintf(file,"%sSET @@session.pseudo_thread_id=%lu;\n",
+ commented ? "# " : "", (ulong)thread_id);
fprintf(file, "%sLOAD DATA ",
commented ? "# " : "");
if (check_fname_outside_temp_buf())
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index d69669d097a..5b819f89afa 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -410,7 +410,6 @@ inline THD *_current_thd(void)
#include "sql_udf.h"
class user_var_entry;
#include "item.h"
-#include "tztime.h"
typedef Comp_creator* (*chooser_compare_func_creator)(bool invert);
/* sql_parse.cc */
void free_items(Item *item);
@@ -430,7 +429,6 @@ bool multi_delete_precheck(THD *thd, TABLE_LIST *tables, uint *table_count);
bool mysql_multi_update_prepare(THD *thd);
bool mysql_multi_delete_prepare(THD *thd);
bool mysql_insert_select_prepare(THD *thd);
-bool insert_select_precheck(THD *thd, TABLE_LIST *tables);
bool update_precheck(THD *thd, TABLE_LIST *tables);
bool delete_precheck(THD *thd, TABLE_LIST *tables);
bool insert_precheck(THD *thd, TABLE_LIST *tables);
@@ -438,6 +436,8 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
TABLE_LIST *create_table);
Item *negate_expression(THD *thd, Item *expr);
#include "sql_class.h"
+#include "sql_acl.h"
+#include "tztime.h"
#include "opt_range.h"
#ifdef HAVE_QUERY_CACHE
@@ -637,7 +637,8 @@ bool mysql_multi_update(THD *thd, TABLE_LIST *table_list,
bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
List<Item> &fields, List_item *values,
List<Item> &update_fields,
- List<Item> &update_values, enum_duplicates duplic);
+ List<Item> &update_values, enum_duplicates duplic,
+ COND **where, bool select_insert);
bool mysql_insert(THD *thd,TABLE_LIST *table,List<Item> &fields,
List<List_item> &values, List<Item> &update_fields,
List<Item> &update_values, enum_duplicates flag);
@@ -720,10 +721,6 @@ bool mysqld_show_create_db(THD *thd, char *dbname, HA_CREATE_INFO *create);
void mysqld_list_processes(THD *thd,const char *user,bool verbose);
int mysqld_show_status(THD *thd);
int mysqld_show_variables(THD *thd,const char *wild);
-bool mysqld_show(THD *thd, const char *wild, show_var_st *variables,
- enum enum_var_type value_type,
- pthread_mutex_t *mutex,
- struct system_status_var *status_var);
int mysql_find_files(THD *thd,List<char> *files, const char *db,
const char *path, const char *wild, bool dir);
bool mysqld_show_storage_engines(THD *thd);
@@ -1324,6 +1321,23 @@ inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr)
/*
+ SYNOPSYS
+ hexchar_to_int()
+ convert a hex digit into number
+*/
+
+inline int hexchar_to_int(char c)
+{
+ if (c <= '9' && c >= '0')
+ return c-'0';
+ c|=32;
+ if (c <= 'f' && c >= 'a')
+ return c-'a'+10;
+ return -1;
+}
+
+
+/*
Some functions that are different in the embedded library and the normal
server
*/
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index b99ca3721a7..314abcd9745 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -17,7 +17,6 @@
#include "mysql_priv.h"
#include <m_ctype.h>
#include <my_dir.h>
-#include "sql_acl.h"
#include "slave.h"
#include "sql_repl.h"
#include "repl_failsafe.h"
@@ -55,6 +54,11 @@
#endif
#ifdef HAVE_NDBCLUSTER_DB
#define OPT_NDBCLUSTER_DEFAULT 0
+#ifdef NDB_SHM_TRANSPORTER
+#define OPT_NDB_SHM_DEFAULT 1
+#else
+#define OPT_NDB_SHM_DEFAULT 0
+#endif
#else
#define OPT_NDBCLUSTER_DEFAULT 0
#endif
@@ -289,6 +293,10 @@ my_bool opt_safe_user_create = 0, opt_no_mix_types = 0;
my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0;
my_bool opt_log_slave_updates= 0;
my_bool opt_console= 0, opt_bdb, opt_innodb, opt_isam, opt_ndbcluster;
+#ifdef HAVE_NDBCLUSTER_DB
+const char *opt_ndbcluster_connectstring= 0;
+my_bool opt_ndb_shm, opt_ndb_optimized_node_selection;
+#endif
my_bool opt_readonly, use_temp_pool, relay_log_purge;
my_bool opt_sync_bdb_logs, opt_sync_frm;
my_bool opt_secure_auth= 0;
@@ -2119,7 +2127,7 @@ extern "C" void *signal_hand(void *arg __attribute__((unused)))
if (!(opt_specialflag & SPECIAL_NO_PRIOR))
my_pthread_attr_setprio(&connection_attrib,INTERRUPT_PRIOR);
if (pthread_create(&tmp,&connection_attrib, kill_server_thread,
- (void*) sig))
+ (void*) &sig))
sql_print_error("Can't create thread to kill server");
#else
kill_server((void*) sig); // MIT THREAD has a alarm thread
@@ -4111,6 +4119,7 @@ enum options_mysqld
OPT_INNODB, OPT_ISAM,
OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, OPT_NDB_USE_EXACT_COUNT,
OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ,
+ OPT_NDB_SHM, OPT_NDB_OPTIMIZED_NODE_SELECTION,
OPT_SKIP_SAFEMALLOC,
OPT_TEMP_POOL, OPT_TX_ISOLATION,
OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
@@ -4585,24 +4594,46 @@ Disable with --skip-ndbcluster (will save memory).",
#ifdef HAVE_NDBCLUSTER_DB
{"ndb-connectstring", OPT_NDB_CONNECTSTRING,
"Connect string for ndbcluster.",
- (gptr*) &ndbcluster_connectstring, (gptr*) &ndbcluster_connectstring,
+ (gptr*) &opt_ndbcluster_connectstring,
+ (gptr*) &opt_ndbcluster_connectstring,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"ndb_autoincrement_prefetch_sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ,
- "Specify number of autoincrement values that are prefetched",
+ {"ndb-autoincrement-prefetch-sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ,
+ "Specify number of autoincrement values that are prefetched.",
(gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz,
(gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz,
0, GET_INT, REQUIRED_ARG, 32, 1, 256, 0, 0, 0},
+ {"ndb-force-send", OPT_NDB_FORCE_SEND,
+ "Force send of buffers to ndb immediately without waiting for "
+ "other threads.",
+ (gptr*) &global_system_variables.ndb_force_send,
+ (gptr*) &global_system_variables.ndb_force_send,
+ 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
{"ndb_force_send", OPT_NDB_FORCE_SEND,
- "Force send of buffers to ndb immediately without waiting for other threads",
+ "same as --ndb-force-send.",
(gptr*) &global_system_variables.ndb_force_send,
(gptr*) &global_system_variables.ndb_force_send,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
+ {"ndb-use-exact-count", OPT_NDB_USE_EXACT_COUNT,
+ "Use exact records count during query planning and for fast "
+ "select count(*), disable for faster queries.",
+ (gptr*) &global_system_variables.ndb_use_exact_count,
+ (gptr*) &global_system_variables.ndb_use_exact_count,
+ 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
{"ndb_use_exact_count", OPT_NDB_USE_EXACT_COUNT,
- "Use exact records count during query planning and for "
- "fast select count(*)",
+ "same as --ndb-use-exact-count.",
(gptr*) &global_system_variables.ndb_use_exact_count,
(gptr*) &global_system_variables.ndb_use_exact_count,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
+ {"ndb-shm", OPT_NDB_SHM,
+ "Use shared memory connections when available.",
+ (gptr*) &opt_ndb_shm,
+ (gptr*) &opt_ndb_shm,
+ 0, GET_BOOL, OPT_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0},
+ {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION,
+ "Select nodes for transactions in a more optimal way.",
+ (gptr*) &opt_ndb_optimized_node_selection,
+ (gptr*) &opt_ndb_optimized_node_selection,
+ 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
#endif
{"new", 'n', "Use very new possible 'unsafe' functions.",
(gptr*) &global_system_variables.new_mode,
@@ -4903,7 +4934,8 @@ log and this option does nothing anymore.",
(gptr*) &delayed_queue_size, (gptr*) &delayed_queue_size, 0, GET_ULONG,
REQUIRED_ARG, DELAYED_QUEUE_SIZE, 1, ~0L, 0, 1, 0},
{"expire_logs_days", OPT_EXPIRE_LOGS_DAYS,
- "Binary logs will be rotated after expire-log-days days ",
+ "If non-zero, binary logs will be purged after expire_logs_days "
+ "days; possible purges happen at startup and at binary log rotation.",
(gptr*) &expire_logs_days,
(gptr*) &expire_logs_days, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, 99, 0, 1, 0},
@@ -5154,7 +5186,7 @@ The minimum value for this variable is 4096.",
"Default pointer size to be used for MyISAM tables.",
(gptr*) &myisam_data_pointer_size,
(gptr*) &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG,
- 4, 2, 7, 0, 1, 0},
+ 4, 2, 8, 0, 1, 0},
{"myisam_max_extra_sort_file_size", OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
"Used to help MySQL to decide when to use the slow but safe key cache index create method.",
(gptr*) &global_system_variables.myisam_max_extra_sort_file_size,
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 899733d8639..3bec00a5177 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -169,8 +169,8 @@ my_bool net_realloc(NET *net, ulong length)
if (length >= net->max_packet_size)
{
- DBUG_PRINT("error",("Packet too large. Max sixe: %lu",
- net->max_packet_size));
+ DBUG_PRINT("error", ("Packet too large. Max size: %lu",
+ net->max_packet_size));
net->error= 1;
net->report_error= 1;
net->last_errno= ER_NET_PACKET_TOO_LARGE;
diff --git a/sql/password.c b/sql/password.c
index e2f7e14d39f..79675ade30b 100644
--- a/sql/password.c
+++ b/sql/password.c
@@ -211,12 +211,13 @@ check_scramble_323(const char *scrambled, const char *message,
ulong hash_message[2];
char buff[16],*to,extra; /* Big enough for check */
const char *pos;
-
+
hash_password(hash_message, message, SCRAMBLE_LENGTH_323);
randominit(&rand_st,hash_pass[0] ^ hash_message[0],
hash_pass[1] ^ hash_message[1]);
to=buff;
- for (pos=scrambled ; *pos ; pos++)
+ DBUG_ASSERT(sizeof(buff) > SCRAMBLE_LENGTH_323);
+ for (pos=scrambled ; *pos && to < buff+sizeof(buff) ; pos++)
*to++=(char) (floor(my_rnd(&rand_st)*31)+64);
if (pos-scrambled != SCRAMBLE_LENGTH_323)
return 1;
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 4c916d78378..d537f9cf829 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -537,10 +537,18 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
pos= (char*) local_packet->ptr()+local_packet->length();
*pos++= 12; // Length of packed fields
if (item->collation.collation == &my_charset_bin || thd_charset == NULL)
+ {
+ /* No conversion */
int2store(pos, field.charsetnr);
+ int4store(pos+2, field.length);
+ }
else
- int2store(pos, thd_charset->number);
- int4store(pos+2, field.length);
+ {
+ /* With conversion */
+ int2store(pos, thd_charset->number);
+ uint char_len= field.length / item->collation.collation->mbmaxlen;
+ int4store(pos+2, char_len * thd_charset->mbmaxlen);
+ }
pos[6]= field.type;
int2store(pos+7,field.flags);
pos[9]= (char) field.decimals;
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index b7575f3a44e..7852993b95b 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -20,7 +20,6 @@
#include "repl_failsafe.h"
#include "sql_repl.h"
#include "slave.h"
-#include "sql_acl.h"
#include "log_event.h"
#include <mysql.h>
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 2d453925fa5..2d3f6fe7cdd 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -55,7 +55,6 @@
#include "mysql_priv.h"
#include <mysql.h>
#include "slave.h"
-#include "sql_acl.h"
#include <my_getopt.h>
#include <thr_alarm.h>
#include <myisam.h>
@@ -379,22 +378,18 @@ sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks",
sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment",
&srv_auto_extend_increment);
#endif
+
#ifdef HAVE_NDBCLUSTER_DB
-// ndb thread specific variable settings
+/* ndb thread specific variable settings */
sys_var_thd_ulong
sys_ndb_autoincrement_prefetch_sz("ndb_autoincrement_prefetch_sz",
&SV::ndb_autoincrement_prefetch_sz);
sys_var_thd_bool
-sys_ndb_force_send("ndb_force_send",
- &SV::ndb_force_send);
+sys_ndb_force_send("ndb_force_send", &SV::ndb_force_send);
sys_var_thd_bool
-sys_ndb_use_exact_count("ndb_use_exact_count",
- &SV::ndb_use_exact_count);
+sys_ndb_use_exact_count("ndb_use_exact_count", &SV::ndb_use_exact_count);
sys_var_thd_bool
-sys_ndb_use_transactions("ndb_use_transactions",
- &SV::ndb_use_transactions);
-// ndb server global variable settings
-// none
+sys_ndb_use_transactions("ndb_use_transactions", &SV::ndb_use_transactions);
#endif
/* Time/date/datetime formats */
@@ -2863,7 +2858,8 @@ int set_var::check(THD *thd)
return 0;
}
- if (value->fix_fields(thd, 0, &value) || value->check_cols(1))
+ if ((!value->fixed &&
+ value->fix_fields(thd, 0, &value)) || value->check_cols(1))
return -1;
if (var->check_update_type(value->result_type()))
{
@@ -2897,7 +2893,8 @@ int set_var::light_check(THD *thd)
if (type == OPT_GLOBAL && check_global_access(thd, SUPER_ACL))
return 1;
- if (value && (value->fix_fields(thd, 0, &value) || value->check_cols(1)))
+ if (value && ((!value->fixed && value->fix_fields(thd, 0, &value)) ||
+ value->check_cols(1)))
return -1;
return 0;
}
diff --git a/sql/slave.cc b/sql/slave.cc
index 9ddbe7d05de..6b8559859fc 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -658,7 +658,7 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock)
int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
pthread_mutex_t *cond_lock,
pthread_cond_t* term_cond,
- volatile bool* slave_running)
+ volatile uint *slave_running)
{
if (term_lock)
{
@@ -696,7 +696,7 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
int start_slave_thread(pthread_handler h_func, pthread_mutex_t *start_lock,
pthread_mutex_t *cond_lock,
pthread_cond_t *start_cond,
- volatile bool *slave_running,
+ volatile uint *slave_running,
volatile ulong *slave_run_id,
MASTER_INFO* mi,
bool high_priority)
@@ -1081,7 +1081,7 @@ void end_slave()
static bool io_slave_killed(THD* thd, MASTER_INFO* mi)
{
DBUG_ASSERT(mi->io_thd == thd);
- DBUG_ASSERT(mi->slave_running == 1); // tracking buffer overrun
+ DBUG_ASSERT(mi->slave_running); // tracking buffer overrun
return mi->abort_slave || abort_loop || thd->killed;
}
@@ -1949,19 +1949,13 @@ void init_master_info_with_options(MASTER_INFO* mi)
strmake(mi->ssl_key, master_ssl_key, sizeof(mi->ssl_key)-1);
}
-static void clear_slave_error(RELAY_LOG_INFO* rli)
+void clear_slave_error(RELAY_LOG_INFO* rli)
{
/* Clear the errors displayed by SHOW SLAVE STATUS */
rli->last_slave_error[0]= 0;
rli->last_slave_errno= 0;
}
-void clear_slave_error_timestamp(RELAY_LOG_INFO* rli)
-{
- rli->last_master_timestamp= 0;
- clear_slave_error(rli);
-}
-
/*
Reset UNTIL condition for RELAY_LOG_INFO
SYNOPSYS
@@ -2349,6 +2343,11 @@ bool show_master_info(THD* thd, MASTER_INFO* mi)
String *packet= &thd->packet;
protocol->prepare_for_resend();
+ /*
+ TODO: we read slave_running without run_lock, whereas these variables
+ are updated under run_lock and not data_lock. In 5.0 we should lock
+ run_lock on top of data_lock (with good order).
+ */
pthread_mutex_lock(&mi->data_lock);
pthread_mutex_lock(&mi->rli.data_lock);
@@ -2409,7 +2408,12 @@ bool show_master_info(THD* thd, MASTER_INFO* mi)
protocol->store(mi->ssl_cipher, &my_charset_bin);
protocol->store(mi->ssl_key, &my_charset_bin);
- if (mi->rli.last_master_timestamp)
+ /*
+ Seconds_Behind_Master: if SQL thread is running and I/O thread is
+ connected, we can compute it otherwise show NULL (i.e. unknown).
+ */
+ if ((mi->slave_running == MYSQL_SLAVE_RUN_CONNECT) &&
+ mi->rli.slave_running)
{
long tmp= (long)((time_t)time((time_t*) 0)
- mi->rli.last_master_timestamp)
@@ -2429,9 +2433,13 @@ bool show_master_info(THD* thd, MASTER_INFO* mi)
slave is 2. At SHOW SLAVE STATUS time, assume that the difference
between timestamp of slave and rli->last_master_timestamp is 0
(i.e. they are in the same second), then we get 0-(2-1)=-1 as a result.
- This confuses users, so we don't go below 0.
+ This confuses users, so we don't go below 0: hence the max().
+
+ last_master_timestamp == 0 (an "impossible" timestamp 1970) is a
+ special marker to say "consider we have caught up".
*/
- protocol->store((longlong)(max(0, tmp)));
+ protocol->store((longlong)(mi->rli.last_master_timestamp ? max(0, tmp)
+ : 0));
}
else
protocol->store_null();
@@ -3280,6 +3288,8 @@ slave_begin:
connected:
+ // TODO: the assignment below should be under mutex (5.0)
+ mi->slave_running= MYSQL_SLAVE_RUN_CONNECT;
thd->slave_net = &mysql->net;
thd->proc_info = "Checking master version";
if (get_master_version_and_clock(mysql, mi))
@@ -3312,6 +3322,7 @@ dump");
goto err;
}
+ mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT;
thd->proc_info= "Waiting to reconnect after a failed binlog dump request";
#ifdef SIGNAL_WITH_VIO_CLOSE
thd->clear_active_vio();
@@ -3388,6 +3399,7 @@ max_allowed_packet",
mysql_error(mysql));
goto err;
}
+ mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT;
thd->proc_info = "Waiting to reconnect after a failed master event read";
#ifdef SIGNAL_WITH_VIO_CLOSE
thd->clear_active_vio();
@@ -3566,6 +3578,14 @@ slave_begin:
pthread_mutex_lock(&LOCK_thread_count);
threads.append(thd);
pthread_mutex_unlock(&LOCK_thread_count);
+ /*
+ We are going to set slave_running to 1. Assuming slave I/O thread is
+ alive and connected, this is going to make Seconds_Behind_Master be 0
+ i.e. "caught up". Even if we're just at start of thread. Well it's ok, at
+ the moment we start we can think we are caught up, and the next second we
+ start receiving data so we realize we are not caught up and
+ Seconds_Behind_Master grows. No big deal.
+ */
rli->slave_running = 1;
rli->abort_slave = 0;
pthread_mutex_unlock(&rli->run_lock);
@@ -4604,6 +4624,21 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
*/
if (hot_log)
{
+ /*
+ We say in Seconds_Behind_Master that we have "caught up". Note that
+ for example if network link is broken but I/O slave thread hasn't
+ noticed it (slave_net_timeout not elapsed), then we'll say "caught
+ up" whereas we're not really caught up. Fixing that would require
+ internally cutting timeout in smaller pieces in network read, no
+ thanks. Another example: SQL has caught up on I/O, now I/O has read
+ a new event and is queuing it; the false "0" will exist until SQL
+ finishes executing the new event; it will be look abnormal only if
+ the events have old timestamps (then you get "many", 0, "many").
+ Transient phases like this can't really be fixed.
+ */
+ time_t save_timestamp= rli->last_master_timestamp;
+ rli->last_master_timestamp= 0;
+
DBUG_ASSERT(rli->relay_log.get_open_count() == rli->cur_log_old_open_count);
/*
We can, and should release data_lock while we are waiting for
@@ -4650,6 +4685,7 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
rli->relay_log.wait_for_update(rli->sql_thd, 1);
// re-acquire data lock since we released it earlier
pthread_mutex_lock(&rli->data_lock);
+ rli->last_master_timestamp= save_timestamp;
continue;
}
/*
diff --git a/sql/slave.h b/sql/slave.h
index 69d3dc38e78..e0816fd45a7 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -93,6 +93,21 @@ extern my_bool opt_log_slave_updates;
extern ulonglong relay_log_space_limit;
struct st_master_info;
+/*
+ 3 possible values for MASTER_INFO::slave_running and
+ RELAY_LOG_INFO::slave_running.
+ The values 0,1,2 are very important: to keep the diff small, I didn't
+ substitute places where we use 0/1 with the newly defined symbols. So don't change
+ these values.
+ The same way, code is assuming that in RELAY_LOG_INFO we use only values
+ 0/1.
+ I started with using an enum, but
+ enum_variable=1; is not legal so would have required many line changes.
+*/
+#define MYSQL_SLAVE_NOT_RUN 0
+#define MYSQL_SLAVE_RUN_NOT_CONNECT 1
+#define MYSQL_SLAVE_RUN_CONNECT 2
+
/****************************************************************************
Replication SQL Thread
@@ -248,7 +263,8 @@ typedef struct st_relay_log_info
/* if not set, the value of other members of the structure are undefined */
bool inited;
- volatile bool abort_slave, slave_running;
+ volatile bool abort_slave;
+ volatile uint slave_running;
/*
Condition and its parameters from START SLAVE UNTIL clause.
@@ -383,7 +399,8 @@ typedef struct st_master_info
int events_till_abort;
#endif
bool inited;
- volatile bool abort_slave, slave_running;
+ volatile bool abort_slave;
+ volatile uint slave_running;
volatile ulong slave_run_id;
/*
The difference in seconds between the clock of the master and the clock of
@@ -462,7 +479,7 @@ int terminate_slave_threads(MASTER_INFO* mi, int thread_mask,
int terminate_slave_thread(THD* thd, pthread_mutex_t* term_mutex,
pthread_mutex_t* cond_lock,
pthread_cond_t* term_cond,
- volatile bool* slave_running);
+ volatile uint* slave_running);
int start_slave_threads(bool need_slave_mutex, bool wait_for_start,
MASTER_INFO* mi, const char* master_info_fname,
const char* slave_info_fname, int thread_mask);
@@ -475,7 +492,7 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start,
int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock,
pthread_mutex_t *cond_lock,
pthread_cond_t* start_cond,
- volatile bool *slave_running,
+ volatile uint *slave_running,
volatile ulong *slave_run_id,
MASTER_INFO* mi,
bool high_priority);
@@ -517,7 +534,7 @@ void slave_print_error(RELAY_LOG_INFO* rli, int err_code, const char* msg, ...);
void end_slave(); /* clean up */
void init_master_info_with_options(MASTER_INFO* mi);
void clear_until_condition(RELAY_LOG_INFO* rli);
-void clear_slave_error_timestamp(RELAY_LOG_INFO* rli);
+void clear_slave_error(RELAY_LOG_INFO* rli);
int init_master_info(MASTER_INFO* mi, const char* master_info_fname,
const char* slave_info_fname,
bool abort_if_no_master_info_file,
diff --git a/sql/sp.cc b/sql/sp.cc
index 88693de0497..65dad60cda7 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -16,7 +16,6 @@
#include "mysql_priv.h"
-#include "sql_acl.h"
#include "sp.h"
#include "sp_head.h"
#include "sp_cache.h"
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 31c6075b590..9afc0c04631 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -19,7 +19,6 @@
#endif
#include "mysql_priv.h"
-#include "sql_acl.h"
#include "sp_head.h"
#include "sp.h"
#include "sp_pcontext.h"
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 2de3fc4a711..a913bce6704 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -26,7 +26,6 @@
*/
#include "mysql_priv.h"
-#include "sql_acl.h"
#include "hash_filo.h"
#ifdef HAVE_REPLICATION
#include "sql_repl.h" //for tables_ok()
@@ -3357,15 +3356,17 @@ err:
bool check_grant_column(THD *thd, GRANT_INFO *grant,
- char*db_name, char *table_name,
+ char *db_name, char *table_name,
const char *name, uint length, uint show_tables)
{
GRANT_TABLE *grant_table;
GRANT_COLUMN *grant_column;
-
ulong want_access= grant->want_privilege & ~grant->privilege;
+ DBUG_ENTER("check_grant_column");
+ DBUG_PRINT("enter", ("table: %s want_access: %u", table_name, want_access));
+
if (!want_access)
- return 0; // Already checked
+ DBUG_RETURN(0); // Already checked
rw_rdlock(&LOCK_grant);
@@ -3376,7 +3377,7 @@ bool check_grant_column(THD *thd, GRANT_INFO *grant,
grant->grant_table=
table_hash_search(thd->host, thd->ip, db_name,
thd->priv_user,
- table_name, 0); /* purecov: inspected */
+ table_name, 0); /* purecov: inspected */
grant->version= grant_version; /* purecov: inspected */
}
if (!(grant_table= grant->grant_table))
@@ -3386,13 +3387,13 @@ bool check_grant_column(THD *thd, GRANT_INFO *grant,
if (grant_column && !(~grant_column->rights & want_access))
{
rw_unlock(&LOCK_grant);
- return 0;
+ DBUG_RETURN(0);
}
#ifdef NOT_USED
if (show_tables && (grant_column || grant->privilege & COL_ACLS))
{
rw_unlock(&LOCK_grant); /* purecov: deadcode */
- return 0; /* purecov: deadcode */
+ DBUG_RETURN(0); /* purecov: deadcode */
}
#endif
@@ -3409,7 +3410,7 @@ err:
name,
table_name);
}
- return 1;
+ DBUG_RETURN(1);
}
@@ -4834,7 +4835,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
if (result)
- my_error(ER_CANNOT_USER, MYF(0), "DROP USER", wrong_users.c_ptr());
+ my_error(ER_CANNOT_USER, MYF(0), "DROP USER", wrong_users.c_ptr_safe());
DBUG_RETURN(result);
}
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index eef5bf73b95..950f6c7125d 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -18,7 +18,6 @@
/* Basic functions needed by many modules */
#include "mysql_priv.h"
-#include "sql_acl.h"
#include "sql_select.h"
#include "sp_head.h"
#include "sql_trigger.h"
@@ -2067,10 +2066,10 @@ find_field_in_table(THD *thd, TABLE_LIST *table_list,
uint *cached_field_index_ptr,
bool register_tree_change)
{
- DBUG_ENTER("find_field_in_table");
- DBUG_PRINT("enter", ("table:%s name: %s item name %s, ref 0x%lx",
- table_list->alias, name, item_name, (ulong)ref));
Field *fld;
+ DBUG_ENTER("find_field_in_table");
+ DBUG_PRINT("enter", ("table: '%s' name: '%s' item name: '%s' ref 0x%lx",
+ table_list->alias, name, item_name, (ulong) ref));
if (table_list->field_translation)
{
DBUG_ASSERT(ref != 0 && table_list->view != 0);
@@ -2097,10 +2096,7 @@ find_field_in_table(THD *thd, TABLE_LIST *table_list,
item_name);
/* as far as Item_ref have defined reference it do not need tables */
if (register_tree_change && item_ref)
- {
thd->change_item_tree(ref, item_ref);
- (*ref)->fix_fields(thd, 0, ref);
- }
}
DBUG_RETURN((Field*) view_ref_found);
}
@@ -2788,6 +2784,7 @@ TABLE_LIST **make_leaves_list(TABLE_LIST **list, TABLE_LIST *tables)
bool setup_tables(THD *thd, TABLE_LIST *tables, Item **conds,
TABLE_LIST **leaves, bool refresh, bool select_insert)
{
+ uint tablenr= 0;
DBUG_ENTER("setup_tables");
/*
this is used for INSERT ... SELECT.
@@ -2800,13 +2797,9 @@ bool setup_tables(THD *thd, TABLE_LIST *tables, Item **conds,
DBUG_RETURN(0);
tables->setup_is_done= 1;
-
if (!(*leaves))
- {
make_leaves_list(leaves, tables);
- }
- uint tablenr= 0;
for (TABLE_LIST *table_list= *leaves;
table_list;
table_list= table_list->next_leaf, tablenr++)
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 39ee8f61f1a..26b1eff49e7 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -300,7 +300,6 @@ TODO list:
#include <m_ctype.h>
#include <my_dir.h>
#include <hash.h>
-#include "sql_acl.h"
#include "ha_myisammrg.h"
#ifndef MASTER
#include "../srclib/myisammrg/myrg_def.h"
@@ -375,7 +374,7 @@ inline Query_cache_block * Query_cache_block_table::block()
return (Query_cache_block *)(((byte*)this) -
ALIGN_SIZE(sizeof(Query_cache_block_table)*n) -
ALIGN_SIZE(sizeof(Query_cache_block)));
-};
+}
/*****************************************************************************
Query_cache_block method(s)
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index cc178a3121b..d369e85d775 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -27,7 +27,6 @@
#endif
#include "mysql_priv.h"
-#include "sql_acl.h"
#include <m_ctype.h>
#include <sys/stat.h>
#include <thr_alarm.h>
@@ -1025,7 +1024,7 @@ static File create_file(THD *thd, char *path, sql_exchange *exchange,
return -1;
}
/* Create the file world readable */
- if ((file= my_create(path, 0666, O_WRONLY, MYF(MY_WME))) < 0)
+ if ((file= my_create(path, 0666, O_WRONLY|O_EXCL, MYF(MY_WME))) < 0)
return file;
#ifdef HAVE_FCHMOD
(void) fchmod(file, 0666); // Because of umask()
@@ -1307,9 +1306,10 @@ bool select_singlerow_subselect::send_data(List<Item> &items)
bool select_max_min_finder_subselect::send_data(List<Item> &items)
{
DBUG_ENTER("select_max_min_finder_subselect::send_data");
- Item_singlerow_subselect *it= (Item_singlerow_subselect *)item;
+ Item_maxmin_subselect *it= (Item_maxmin_subselect *)item;
List_iterator_fast<Item> li(items);
Item *val_item= li++;
+ it->register_value();
if (it->assigned())
{
cache->store(val_item);
diff --git a/sql/sql_class.h b/sql/sql_class.h
index af1ed0b2209..2a0e0aac8b4 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1372,9 +1372,11 @@ class select_insert :public select_result_interceptor {
COPY_INFO info;
bool insert_into_view;
- select_insert(TABLE_LIST *table_list_par, TABLE *table_par,
- List<Item> *fields_par, enum_duplicates duplic,
- bool ignore_check_option_errors);
+ select_insert(TABLE_LIST *table_list_par,
+ TABLE *table_par, List<Item> *fields_par,
+ List<Item> *update_fields, List<Item> *update_values,
+ enum_duplicates duplic,
+ bool ignore_check_option_errors);
~select_insert();
int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
bool send_data(List<Item> &items);
@@ -1400,7 +1402,7 @@ public:
List<create_field> &fields_par,
List<Key> &keys_par,
List<Item> &select_fields,enum_duplicates duplic)
- :select_insert (NULL, NULL, &select_fields, duplic, 0), create_table(table),
+ :select_insert (NULL, NULL, &select_fields, 0, 0, duplic, 0), create_table(table),
extra_fields(&fields_par),keys(&keys_par), create_info(create_info_par),
lock(0)
{}
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index ea81013a401..d3b30de0bcd 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -19,7 +19,6 @@
#include "mysql_priv.h"
#include <mysys_err.h>
-#include "sql_acl.h"
#include "sp.h"
#include <my_dir.h>
#include <m_ctype.h>
@@ -399,7 +398,7 @@ bool mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
VOID(pthread_mutex_lock(&LOCK_mysql_create_db));
- // do not create database if another thread is holding read lock
+ /* do not create database if another thread is holding read lock */
if (wait_if_global_read_lock(thd, 0, 1))
{
error= -1;
@@ -522,7 +521,7 @@ bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
VOID(pthread_mutex_lock(&LOCK_mysql_create_db));
- // do not alter database if another thread is holding read lock
+ /* do not alter database if another thread is holding read lock */
if ((error=wait_if_global_read_lock(thd,0,1)))
goto exit2;
@@ -549,9 +548,11 @@ bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
Query_log_event qinfo(thd, thd->query, thd->query_length, 0,
/* suppress_use */ TRUE);
- // Write should use the database being created as the "current
- // database" and not the threads current database, which is the
- // default.
+ /*
+ Write should use the database being created as the "current
+ database" and not the threads current database, which is the
+ default.
+ */
qinfo.db = db;
qinfo.db_len = strlen(db);
@@ -595,7 +596,7 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
VOID(pthread_mutex_lock(&LOCK_mysql_create_db));
- // do not drop database if another thread is holding read lock
+ /* do not drop database if another thread is holding read lock */
if (wait_if_global_read_lock(thd, 0, 1))
{
error= -1;
@@ -662,10 +663,11 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
{
Query_log_event qinfo(thd, query, query_length, 0,
/* suppress_use */ TRUE);
-
- // Write should use the database being created as the "current
- // database" and not the threads current database, which is the
- // default.
+ /*
+ Write should use the database being created as the "current
+ database" and not the threads current database, which is the
+ default.
+ */
qinfo.db = db;
qinfo.db_len = strlen(db);
@@ -799,7 +801,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
found_other_files++;
continue;
}
- // just for safety we use files_charset_info
+ /* just for safety we use files_charset_info */
if (db && !my_strcasecmp(files_charset_info,
extension, reg_ext))
{
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 1d4b911bb65..520393f8544 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -23,7 +23,6 @@
#include "mysql_priv.h"
#include "sql_select.h"
-#include "sql_acl.h"
diff --git a/sql/sql_do.cc b/sql/sql_do.cc
index 3f34835c2c9..e37f3e86dda 100644
--- a/sql/sql_do.cc
+++ b/sql/sql_do.cc
@@ -18,7 +18,6 @@
/* Execute DO statement */
#include "mysql_priv.h"
-#include "sql_acl.h"
bool mysql_do(THD *thd, List<Item> &values)
{
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 853b3dd37c6..2ee7734e4f3 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -409,7 +409,8 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
}
tables->table=table;
- if (cond && (cond->fix_fields(thd, tables, &cond) || cond->check_cols(1)))
+ if (cond && ((!cond->fixed &&
+ cond->fix_fields(thd, tables, &cond)) || cond->check_cols(1)))
goto err0;
table->file->init_table_handle_for_HANDLER(); // Only InnoDB requires it
@@ -494,7 +495,8 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
for (key_len=0 ; (item=it_ke++) ; key_part++)
{
// 'item' can be changed by fix_fields() call
- if (item->fix_fields(thd, tables, it_ke.ref()) ||
+ if ((!item->fixed &&
+ item->fix_fields(thd, tables, it_ke.ref())) ||
(item= *it_ke.ref())->check_cols(1))
goto err;
if (item->used_tables() & ~RAND_TABLE_BIT)
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index f71e9a7133a..99273b42f2a 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -556,7 +556,8 @@ int send_variant_2_list(MEM_ROOT *mem_root, Protocol *protocol,
SQL_SELECT *prepare_simple_select(THD *thd, Item *cond, TABLE_LIST *tables,
TABLE *table, int *error)
{
- cond->fix_fields(thd, tables, &cond); // can never fail
+ if (!cond->fixed)
+ cond->fix_fields(thd, tables, &cond); // can never fail
SQL_SELECT *res= make_select(table,0,0,cond,error);
if (*error || (res && res->check_quick(thd, 0, HA_POS_ERROR)))
{
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 0814c7a747e..c681fe25548 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -18,7 +18,6 @@
/* Insert of records */
#include "mysql_priv.h"
-#include "sql_acl.h"
#include "sp_head.h"
#include "sql_trigger.h"
#include "sql_select.h"
@@ -181,6 +180,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
char *query= thd->query;
#endif
thr_lock_type lock_type = table_list->lock_type;
+ Item *unused_conds= 0;
DBUG_ENTER("mysql_insert");
/*
@@ -244,15 +244,9 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
thd->used_tables=0;
values= its++;
- if (duplic == DUP_UPDATE)
- {
- /* it should be allocated before Item::fix_fields() */
- if (table_list->set_insert_values(thd->mem_root))
- goto abort;
- }
-
if (mysql_prepare_insert(thd, table_list, table, fields, values,
- update_fields, update_values, duplic))
+ update_fields, update_values, duplic, &unused_conds,
+ FALSE))
goto abort;
/* mysql_prepare_insert set table_list->table if it was not set */
@@ -659,6 +653,10 @@ static bool mysql_prepare_insert_check_table(THD *thd, TABLE_LIST *table_list,
mysql_prepare_insert()
thd Thread handler
table_list Global/local table list
+ table Table to insert into (can be NULL if table should be taken from
+ table_list->table)
+ where Where clause (for insert ... select)
+ select_insert TRUE if INSERT ... SELECT statement
RETURN VALUE
FALSE OK
@@ -666,26 +664,33 @@ static bool mysql_prepare_insert_check_table(THD *thd, TABLE_LIST *table_list,
*/
bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
- List<Item> &fields, List_item *values,
- List<Item> &update_fields, List<Item> &update_values,
- enum_duplicates duplic)
+ List<Item> &fields, List_item *values,
+ List<Item> &update_fields, List<Item> &update_values,
+ enum_duplicates duplic,
+ COND **where, bool select_insert)
{
bool insert_into_view= (table_list->view != 0);
/* TODO: use this condition for 'WITH CHECK OPTION' */
- Item *unused_conds= 0;
bool res;
DBUG_ENTER("mysql_prepare_insert");
-
DBUG_PRINT("enter", ("table_list 0x%lx, table 0x%lx, view %d",
(ulong)table_list, (ulong)table,
(int)insert_into_view));
- if (mysql_prepare_insert_check_table(thd, table_list, fields, &unused_conds,
- FALSE))
+
+ if (duplic == DUP_UPDATE)
+ {
+ /* it should be allocated before Item::fix_fields() */
+ if (table_list->set_insert_values(thd->mem_root))
+ DBUG_RETURN(TRUE);
+ }
+
+ if (mysql_prepare_insert_check_table(thd, table_list, fields, where,
+ select_insert))
DBUG_RETURN(TRUE);
- if (check_insert_fields(thd, table_list, fields, *values, 1,
- !insert_into_view) ||
- setup_fields(thd, 0, table_list, *values, 0, 0, 0) ||
+ if ((values && check_insert_fields(thd, table_list, fields, *values, 1,
+ !insert_into_view)) ||
+ (values && setup_fields(thd, 0, table_list, *values, 0, 0, 0)) ||
(duplic == DUP_UPDATE &&
((thd->lex->select_lex.no_wrap_view_item= 1,
(res= setup_fields(thd, 0, table_list, update_fields, 1, 0, 0)),
@@ -697,7 +702,9 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
if (!table)
table= table_list->table;
- if (unique_table(table_list, table_list->next_global))
+ if ((thd->lex->sql_command == SQLCOM_INSERT ||
+ thd->lex->sql_command == SQLCOM_REPLACE) &&
+ unique_table(table_list, table_list->next_global))
{
my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->real_name);
DBUG_RETURN(TRUE);
@@ -795,8 +802,11 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
that matches, is updated. If update causes a conflict again,
an error is returned
*/
+ DBUG_ASSERT(table->insert_values != NULL);
store_record(table,insert_values);
restore_record(table,record[1]);
+ DBUG_ASSERT(info->update_fields->elements ==
+ info->update_values->elements);
if (fill_record(thd, *info->update_fields, *info->update_values, 0))
goto err;
@@ -805,7 +815,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
(res= info->view->view_check_option(current_thd, info->ignore)) ==
VIEW_CHECK_SKIP)
break;
- else if (res == VIEW_CHECK_ERROR)
+ if (res == VIEW_CHECK_ERROR)
goto err;
if ((error=table->file->update_row(table->record[1],table->record[0])))
@@ -1712,23 +1722,25 @@ bool delayed_insert::handle_inserts(void)
bool mysql_insert_select_prepare(THD *thd)
{
LEX *lex= thd->lex;
- TABLE_LIST* first_select_table=
- (TABLE_LIST*)lex->select_lex.table_list.first;
- TABLE_LIST* first_select_leaf_table;
+ TABLE_LIST *first_select_table=
+ (TABLE_LIST*) lex->select_lex.table_list.first;
+ TABLE_LIST *first_select_leaf_table;
int res;
DBUG_ENTER("mysql_insert_select_prepare");
/*
SELECT_LEX do not belong to INSERT statement, so we can't add WHERE
- clasue if table is VIEW
+ clause if table is VIEW
*/
lex->query_tables->no_where_clause= 1;
- if (mysql_prepare_insert_check_table(thd, lex->query_tables,
- lex->field_list,
- &lex->select_lex.where,
- TRUE))
+ if (mysql_prepare_insert(thd, lex->query_tables,
+ lex->query_tables->table, lex->field_list, 0,
+ lex->update_list, lex->value_list,
+ lex->duplicates,
+ &lex->select_lex.where, TRUE))
DBUG_RETURN(TRUE);
+
/*
- setup was done in mysql_insert_select_prepare, but we have to mark
+ setup was done in mysql_prepare_insert_check_table, but we have to mark
first local table
*/
if (first_select_table)
@@ -1753,17 +1765,21 @@ bool mysql_insert_select_prepare(THD *thd)
select_insert::select_insert(TABLE_LIST *table_list_par, TABLE *table_par,
- List<Item> *fields_par, enum_duplicates duplic,
+ List<Item> *fields_par,
+ List<Item> *update_fields, List<Item> *update_values,
+ enum_duplicates duplic,
bool ignore_check_option_errors)
:table_list(table_list_par), table(table_par), fields(fields_par),
last_insert_id(0),
insert_into_view(table_list_par && table_list_par->view != 0)
{
bzero((char*) &info,sizeof(info));
- info.handle_duplicates=duplic;
+ info.handle_duplicates= duplic;
+ info.ignore= ignore_check_option_errors;
+ info.update_fields= update_fields;
+ info.update_values= update_values;
if (table_list_par)
info.view= (table_list_par->view ? table_list_par : 0);
- info.ignore= ignore_check_option_errors;
}
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 001188d6fc5..1081246c9e3 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -120,6 +120,7 @@ void lex_start(THD *thd, uchar *buf,uint length)
lex->thd= lex->unit.thd= thd;
lex->select_lex.init_query();
lex->value_list.empty();
+ lex->update_list.empty();
lex->param_list.empty();
lex->view_list.empty();
lex->unit.next= lex->unit.master=
@@ -942,13 +943,12 @@ int yylex(void *arg, void *yythd)
if ((thd->client_capabilities & CLIENT_MULTI_STATEMENTS) &&
(thd->command != COM_PREPARE))
{
- lex->found_colon=(char*)lex->ptr;
- thd->server_status |= SERVER_MORE_RESULTS_EXISTS;
- lex->next_state=MY_LEX_END;
- return(END_OF_INPUT);
+ lex->found_colon= (char*) lex->ptr;
+ thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
+ lex->next_state= MY_LEX_END;
+ return (END_OF_INPUT);
}
- else
- state=MY_LEX_CHAR; // Return ';'
+ state= MY_LEX_CHAR; // Return ';'
break;
}
/* fall true */
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index c5b3abb93d2..f6858583ecd 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -682,7 +682,7 @@ typedef struct st_lex
List<LEX_COLUMN> columns;
List<Key> key_list;
List<create_field> create_list;
- List<Item> *insert_list,field_list,value_list;
+ List<Item> *insert_list,field_list,value_list,update_list;
List<List_item> many_values;
List<set_var_base> var_list;
List<Item_param> param_list;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 4a357c6eefe..e43b124a8d9 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mysql_priv.h"
-#include "sql_acl.h"
#include "sql_repl.h"
#include "repl_failsafe.h"
#include <m_ctype.h>
@@ -1128,13 +1127,26 @@ extern "C" pthread_handler_decl(handle_bootstrap,arg)
thd->init_for_queries();
while (fgets(buff, thd->net.max_packet, file))
{
- uint length=(uint) strlen(buff);
- if (buff[length-1]!='\n' && !feof(file))
- {
- net_send_error(thd, ER_NET_PACKET_TOO_LARGE, NullS);
- thd->fatal_error();
- break;
- }
+ ulong length= (ulong) strlen(buff);
+ while (buff[length-1] != '\n' && !feof(file))
+ {
+ /*
+ We got only a part of the current string. Will try to increase
+ net buffer then read the rest of the current string.
+ */
+ if (net_realloc(&(thd->net), 2 * thd->net.max_packet))
+ {
+ net_send_error(thd, ER_NET_PACKET_TOO_LARGE, NullS);
+ thd->fatal_error();
+ break;
+ }
+ buff= (char*) thd->net.buff;
+ fgets(buff + length, thd->net.max_packet - length, file);
+ length+= (ulong) strlen(buff + length);
+ }
+ if (thd->is_fatal_error)
+ break;
+
while (length && (my_isspace(thd->charset(), buff[length-1]) ||
buff[length-1] == ';'))
length--;
@@ -1964,6 +1976,9 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
break;
}
#endif
+ case SCH_OPEN_TABLES:
+ case SCH_VARIABLES:
+ case SCH_STATUS:
case SCH_PROCEDURES:
case SCH_CHARSETS:
case SCH_COLLATIONS:
@@ -2803,7 +2818,9 @@ create_error:
check_access(thd, SELECT_ACL | EXTRA_ACL, first_table->db,
&first_table->grant.privilege, 0, 0))
goto error;
- res = mysqld_show_create(thd, first_table);
+ if (grant_option && check_grant(thd, SELECT_ACL, all_tables, 2, UINT_MAX, 0))
+ goto error;
+ res= mysqld_show_create(thd, first_table);
break;
}
#endif
@@ -2931,7 +2948,7 @@ create_error:
if ((res= insert_precheck(thd, all_tables)))
break;
res= mysql_insert(thd, all_tables, lex->field_list, lex->many_values,
- select_lex->item_list, lex->value_list,
+ lex->update_list, lex->value_list,
(lex->value_list.elements ?
DUP_UPDATE : lex->duplicates));
if (first_table->view && !first_table->contain_auto_increment)
@@ -2942,7 +2959,7 @@ create_error:
case SQLCOM_INSERT_SELECT:
{
DBUG_ASSERT(first_table == all_tables && first_table != 0);
- if ((res= insert_select_precheck(thd, all_tables)))
+ if ((res= insert_precheck(thd, all_tables)))
break;
/* Fix lock for first table */
@@ -2963,11 +2980,10 @@ create_error:
res= mysql_insert_select_prepare(thd);
if (!res && (result= new select_insert(first_table, first_table->table,
&lex->field_list,
+ &lex->update_list, &lex->value_list,
lex->duplicates,
lex->duplicates == DUP_IGNORE)))
{
- TABLE_LIST *first_select_table;
-
/*
insert/replace from SELECT give its SELECT_LEX for SELECT,
and item_list belong to SELECT
@@ -2977,6 +2993,9 @@ create_error:
lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE;
delete result;
}
+ /* in case of error first_table->table can be 0 */
+ if (first_table->table)
+ first_table->table->insert_values= 0;
/* revert changes for SP */
lex->select_lex.table_list.first= (byte*) first_table;
}
@@ -3121,25 +3140,6 @@ create_error:
case SQLCOM_SHOW_COLUMN_TYPES:
res= mysqld_show_column_types(thd);
break;
- case SQLCOM_SHOW_STATUS:
- STATUS_VAR tmp;
- if (lex->option_type == OPT_GLOBAL)
- {
- pthread_mutex_lock(&LOCK_status);
- calc_sum_of_all_status(&tmp);
- }
- res= mysqld_show(thd, (lex->wild ? lex->wild->ptr() : NullS),
- status_vars, OPT_GLOBAL, &LOCK_status,
- (lex->option_type == OPT_GLOBAL ?
- &tmp: &thd->status_var));
- if (lex->option_type == OPT_GLOBAL)
- pthread_mutex_unlock(&LOCK_status);
- break;
- case SQLCOM_SHOW_VARIABLES:
- res= mysqld_show(thd, (lex->wild ? lex->wild->ptr() : NullS),
- init_vars, lex->option_type,
- &LOCK_global_system_variables, 0);
- break;
case SQLCOM_SHOW_LOGS:
#ifdef DONT_ALLOW_SHOW_COMMANDS
my_message(ER_NOT_ALLOWED_COMMAND, ER(ER_NOT_ALLOWED_COMMAND),
@@ -3153,9 +3153,6 @@ create_error:
break;
}
#endif
- case SQLCOM_SHOW_OPEN_TABLES:
- res= mysqld_show_open_tables(thd,(lex->wild ? lex->wild->ptr() : NullS));
- break;
case SQLCOM_CHANGE_DB:
mysql_change_db(thd,select_lex->db);
break;
@@ -3320,7 +3317,13 @@ create_error:
}
case SQLCOM_ALTER_DB:
{
- if (!strip_sp(lex->name) || check_db_name(lex->name))
+ char *db= lex->name ? lex->name : thd->db;
+ if (!db)
+ {
+ my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
+ break;
+ }
+ if (!strip_sp(db) || check_db_name(db))
{
my_error(ER_WRONG_DB_NAME, MYF(0), lex->name);
break;
@@ -3334,14 +3337,14 @@ create_error:
*/
#ifdef HAVE_REPLICATION
if (thd->slave_thread &&
- (!db_ok(lex->name, replicate_do_db, replicate_ignore_db) ||
- !db_ok_with_wild_table(lex->name)))
+ (!db_ok(db, replicate_do_db, replicate_ignore_db) ||
+ !db_ok_with_wild_table(db)))
{
my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
break;
}
#endif
- if (check_access(thd,ALTER_ACL,lex->name,0,1,0))
+ if (check_access(thd, ALTER_ACL, db, 0, 1, 0))
break;
if (thd->locked_tables || thd->active_transaction())
{
@@ -3349,7 +3352,7 @@ create_error:
ER(ER_LOCK_OR_ACTIVE_TRANSACTION), MYF(0));
goto error;
}
- res=mysql_alter_db(thd,lex->name,&lex->create_info);
+ res= mysql_alter_db(thd, db, &lex->create_info);
break;
}
case SQLCOM_SHOW_CREATE_DB:
@@ -3361,12 +3364,6 @@ create_error:
}
if (check_access(thd,SELECT_ACL,lex->name,0,1,0))
break;
- if (thd->locked_tables || thd->active_transaction())
- {
- my_message(ER_LOCK_OR_ACTIVE_TRANSACTION,
- ER(ER_LOCK_OR_ACTIVE_TRANSACTION), MYF(0));
- goto error;
- }
res=mysqld_show_create_db(thd,lex->name,&lex->create_info);
break;
}
@@ -3801,8 +3798,8 @@ create_error:
st_sp_security_context save_ctx;
#endif
ha_rows select_limit;
- uint smrx;
- LINT_INIT(smrx);
+ /* bits that should be cleared in thd->server_status */
+ uint bits_to_be_cleared= 0;
/* In case the arguments are subselects... */
if (all_tables &&
@@ -3824,8 +3821,13 @@ create_error:
#endif
goto error;
}
- smrx= thd->server_status & SERVER_MORE_RESULTS_EXISTS;
- thd->server_status |= SERVER_MORE_RESULTS_EXISTS;
+ /*
+ If SERVER_MORE_RESULTS_EXISTS is not set,
+ then remember that it should be cleared
+ */
+ bits_to_be_cleared= (~thd->server_status &
+ SERVER_MORE_RESULTS_EXISTS);
+ thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -3864,14 +3866,11 @@ create_error:
#ifndef EMBEDDED_LIBRARY
thd->net.no_send_ok= nsok;
#endif
- if (sp->m_multi_results)
- {
- if (! smrx)
- thd->server_status &= ~SERVER_MORE_RESULTS_EXISTS;
- }
+ thd->server_status&= ~bits_to_be_cleared;
if (!res)
- send_ok(thd, (ulong) (thd->row_count_func < 0 ? 0 : thd->row_count_func));
+ send_ok(thd, (ulong) (thd->row_count_func < 0 ? 0 :
+ thd->row_count_func));
else
goto error; // Substatement should already have sent error
}
@@ -4126,7 +4125,7 @@ error:
/*
Check grants for commands which work only with one table and all other
- tables belong to subselects.
+ tables belonging to subselects or implicitly opened tables.
SYNOPSIS
check_one_table_access()
@@ -4149,7 +4148,7 @@ bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *all_tables)
if (grant_option && check_grant(thd, privilege, all_tables, 0, 1, 0))
return 1;
- /* Check rights on tables of subselect (if exists) */
+ /* Check rights on tables of subselects and implictly opened tables */
TABLE_LIST *subselects_tables;
if ((subselects_tables= all_tables->next_global))
{
@@ -6000,9 +5999,9 @@ Item * all_any_subquery_creator(Item *left_expr,
Item_allany_subselect *it=
new Item_allany_subselect(left_expr, (*cmp)(all), select_lex, all);
if (all)
- return it->upper_not= new Item_func_not_all(it); /* ALL */
+ return it->upper_item= new Item_func_not_all(it); /* ALL */
- return it; /* ANY/SOME */
+ return it->upper_item= new Item_func_nop_all(it); /* ANY/SOME */
}
@@ -6106,7 +6105,9 @@ bool multi_update_precheck(THD *thd, TABLE_LIST *tables)
DBUG_PRINT("info",("Checking sub query list"));
for (table= tables; table; table= table->next_global)
{
- if (!table->table_in_first_from_clause && table->derived)
+ if (!my_tz_check_n_skip_implicit_tables(&table,
+ lex->time_zone_tables_used) &&
+ !table->table_in_first_from_clause)
{
if (check_access(thd, SELECT_ACL, table->db,
&table->grant.privilege, 0, 0) ||
@@ -6191,32 +6192,6 @@ bool multi_delete_precheck(THD *thd, TABLE_LIST *tables, uint *table_count)
/*
- INSERT ... SELECT query pre-check
-
- SYNOPSIS
- insert_delete_precheck()
- thd Thread handler
- tables Global table list
-
- RETURN VALUE
- FALSE OK
- TRUE Error
-*/
-
-bool insert_select_precheck(THD *thd, TABLE_LIST *tables)
-{
- DBUG_ENTER("insert_select_precheck");
- /*
- Check that we have modify privileges for the first table and
- select privileges for the rest
- */
- ulong privilege= (thd->lex->duplicates == DUP_REPLACE ?
- INSERT_ACL | DELETE_ACL : INSERT_ACL);
- DBUG_RETURN(check_one_table_access(thd, privilege, tables));
-}
-
-
-/*
simple UPDATE query pre-check
SYNOPSIS
@@ -6284,6 +6259,10 @@ bool insert_precheck(THD *thd, TABLE_LIST *tables)
LEX *lex= thd->lex;
DBUG_ENTER("insert_precheck");
+ /*
+ Check that we have modify privileges for the first table and
+ select privileges for the rest
+ */
ulong privilege= (INSERT_ACL |
(lex->duplicates == DUP_REPLACE ? DELETE_ACL : 0) |
(lex->value_list.elements ? UPDATE_ACL : 0));
@@ -6291,7 +6270,7 @@ bool insert_precheck(THD *thd, TABLE_LIST *tables)
if (check_one_table_access(thd, privilege, tables))
DBUG_RETURN(TRUE);
- if (lex->select_lex.item_list.elements != lex->value_list.elements)
+ if (lex->update_list.elements != lex->value_list.elements)
{
my_message(ER_WRONG_VALUE_COUNT, ER(ER_WRONG_VALUE_COUNT), MYF(0));
DBUG_RETURN(TRUE);
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 8afefe3cae8..c860e3a79ac 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -68,7 +68,6 @@ Long data handling:
***********************************************************************/
#include "mysql_priv.h"
-#include "sql_acl.h"
#include "sql_select.h" // for JOIN
#include <m_ctype.h> // for isspace()
#include "sp_head.h"
@@ -906,10 +905,12 @@ static bool mysql_test_insert(Prepared_statement *stmt,
{
uint value_count;
ulong counter= 0;
+ Item *unused_conds= 0;
if ((res= mysql_prepare_insert(thd, table_list, table_list->table,
fields, values, update_fields,
- update_values, duplic)))
+ update_values, duplic,
+ &unused_conds, FALSE)))
goto error;
value_count= values->elements;
@@ -1382,18 +1383,21 @@ static int mysql_test_multidelete(Prepared_statement *stmt,
1 error, sent to client
-1 error, not sent to client
*/
+
static int mysql_test_insert_select(Prepared_statement *stmt,
TABLE_LIST *tables)
{
int res;
LEX *lex= stmt->lex;
- if ((res= insert_select_precheck(stmt->thd, tables)))
+ TABLE_LIST *first_local_table;
+
+ if ((res= insert_precheck(stmt->thd, tables)))
return res;
- TABLE_LIST *first_local_table=
- (TABLE_LIST *)lex->select_lex.table_list.first;
+ first_local_table= (TABLE_LIST *)lex->select_lex.table_list.first;
DBUG_ASSERT(first_local_table != 0);
/* Skip first table, which is the table we are inserting in */
lex->select_lex.table_list.first= (byte*) first_local_table->next_local;
+
/*
insert/replace from SELECT give its SELECT_LEX for SELECT,
and item_list belong to SELECT
@@ -1584,6 +1588,27 @@ static bool init_param_array(Prepared_statement *stmt)
}
+/* Init statement before execution */
+
+static void cleanup_stmt_for_execute(Prepared_statement *stmt)
+{
+ THD *thd= stmt->thd;
+ LEX *lex= stmt->lex;
+ SELECT_LEX *sl= lex->all_selects_list;
+
+ for (; sl; sl= sl->next_select_in_list())
+ {
+ for (TABLE_LIST *tables= (TABLE_LIST*) sl->table_list.first;
+ tables;
+ tables= tables->next_global)
+ {
+ if (tables->table)
+ tables->table->insert_values= 0;
+ }
+ }
+}
+
+
/*
Given a query string with parameter markers, create a Prepared Statement
from it and send PS info back to the client.
@@ -1692,6 +1717,7 @@ bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length,
lex_end(lex);
thd->restore_backup_statement(stmt, &thd->stmt_backup);
cleanup_items(stmt->free_list);
+ cleanup_stmt_for_execute(stmt);
close_thread_tables(thd);
thd->rollback_item_tree_changes();
thd->cleanup_after_query();
@@ -2036,6 +2062,7 @@ static void execute_stmt(THD *thd, Prepared_statement *stmt,
cleanup_items(stmt->free_list);
thd->rollback_item_tree_changes();
reset_stmt_params(stmt);
+ cleanup_stmt_for_execute(stmt);
close_thread_tables(thd); // to close derived tables
thd->set_statement(&thd->stmt_backup);
thd->cleanup_after_query();
@@ -2065,7 +2092,6 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
int error;
DBUG_ENTER("mysql_stmt_fetch");
- thd->current_arena= stmt;
if (!(stmt= thd->stmt_map.find(stmt_id)) ||
!stmt->cursor ||
!stmt->cursor->is_open())
@@ -2073,7 +2099,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), stmt_id, "fetch");
DBUG_VOID_RETURN;
}
-
+ thd->current_arena= stmt;
thd->set_n_backup_statement(stmt, &thd->stmt_backup);
stmt->cursor->init_thd(thd);
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 0d1a7f3890d..9f083e19146 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -18,7 +18,6 @@
#ifdef HAVE_REPLICATION
#include "sql_repl.h"
-#include "sql_acl.h"
#include "log_event.h"
#include <my_dir.h>
@@ -977,10 +976,10 @@ int reset_slave(THD *thd, MASTER_INFO* mi)
*/
init_master_info_with_options(mi);
/*
- Reset errors, and master timestamp (the idea is that we forget about the
+ Reset errors (the idea is that we forget about the
old master).
*/
- clear_slave_error_timestamp(&mi->rli);
+ clear_slave_error(&mi->rli);
clear_until_condition(&mi->rli);
// close master_info_file, relay_log_info_file, set mi->inited=rli->inited=0
@@ -1240,8 +1239,8 @@ bool change_master(THD* thd, MASTER_INFO* mi)
pthread_mutex_lock(&mi->rli.data_lock);
mi->rli.abort_pos_wait++; /* for MASTER_POS_WAIT() to abort */
- /* Clear the errors, for a clean start, and master timestamp */
- clear_slave_error_timestamp(&mi->rli);
+ /* Clear the errors, for a clean start */
+ clear_slave_error(&mi->rli);
clear_until_condition(&mi->rli);
/*
If we don't write new coordinates to disk now, then old will remain in
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 570774c8054..ced26d7567b 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1543,7 +1543,7 @@ JOIN::exec()
WHERE clause for any tables after the sorted one.
*/
JOIN_TAB *curr_table= &curr_join->join_tab[curr_join->const_tables+1];
- JOIN_TAB *end_table= &curr_join->join_tab[tables];
+ JOIN_TAB *end_table= &curr_join->join_tab[curr_join->tables];
for (; curr_table < end_table ; curr_table++)
{
/*
@@ -3716,8 +3716,12 @@ choose_plan(JOIN *join, table_map join_tables)
}
}
- /* Store the cost of this query into a user variable */
- last_query_cost= join->best_read;
+ /*
+ Store the cost of this query into a user variable
+ Don't update last_query_cost for 'show status' command
+ */
+ if (join->thd->lex->orig_sql_command != SQLCOM_SHOW_STATUS)
+ last_query_cost= join->best_read;
DBUG_VOID_RETURN;
}
@@ -9213,7 +9217,7 @@ join_read_system(JOIN_TAB *tab)
{
if (error != HA_ERR_END_OF_FILE)
return report_error(table, error);
- table->null_row=1; // This is ok.
+ mark_as_null_row(tab->table);
empty_record(table); // Make empty record
return -1;
}
@@ -9258,7 +9262,7 @@ join_read_const(JOIN_TAB *tab)
if (error)
{
table->status= STATUS_NOT_FOUND;
- table->null_row=1;
+ mark_as_null_row(tab->table);
empty_record(table);
if (error != HA_ERR_KEY_NOT_FOUND)
return report_error(table, error);
@@ -12266,7 +12270,8 @@ static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab)
if (thd->is_fatal_error)
DBUG_RETURN(TRUE);
- cond->fix_fields(thd,(TABLE_LIST *) 0, (Item**)&cond);
+ if (!cond->fixed)
+ cond->fix_fields(thd,(TABLE_LIST *) 0, (Item**)&cond);
if (join_tab->select)
{
error=(int) cond->add(join_tab->select->cond);
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index d075e428aa0..6ffad1e2bff 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -19,7 +19,6 @@
#include "mysql_priv.h"
#include "sql_select.h" // For select_describe
-#include "sql_acl.h"
#include "repl_failsafe.h"
#include "sp_head.h"
#include <my_dir.h>
@@ -45,46 +44,6 @@ view_store_create_info(THD *thd, TABLE_LIST *table, String *packet);
/***************************************************************************
- List all open tables in a database
-***************************************************************************/
-
-bool mysqld_show_open_tables(THD *thd,const char *wild)
-{
- List<Item> field_list;
- OPEN_TABLE_LIST *open_list;
- Protocol *protocol= thd->protocol;
- DBUG_ENTER("mysqld_show_open_tables");
-
- field_list.push_back(new Item_empty_string("Database",NAME_LEN));
- field_list.push_back(new Item_empty_string("Table",NAME_LEN));
- field_list.push_back(new Item_return_int("In_use", 1, MYSQL_TYPE_TINY));
- field_list.push_back(new Item_return_int("Name_locked", 4, MYSQL_TYPE_TINY));
-
- if (protocol->send_fields(&field_list,
- Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
- DBUG_RETURN(TRUE);
-
- if (!(open_list=list_open_tables(thd,wild)) && thd->is_fatal_error)
- DBUG_RETURN(TRUE);
-
- for (; open_list ; open_list=open_list->next)
- {
- protocol->prepare_for_resend();
- protocol->store(open_list->db, system_charset_info);
- protocol->store(open_list->table, system_charset_info);
- protocol->store_tiny((longlong) open_list->in_use);
- protocol->store_tiny((longlong) open_list->locked);
- if (protocol->write())
- {
- DBUG_RETURN(TRUE);
- }
- }
- send_eof(thd);
- DBUG_RETURN(FALSE);
-}
-
-
-/***************************************************************************
** List all table types supported
***************************************************************************/
@@ -373,172 +332,6 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path,
}
-/***************************************************************************
-** List all columns in a table_list->real_name
-***************************************************************************/
-
-bool
-mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild,
- bool verbose)
-{
- TABLE *table;
- handler *file;
- char tmp[MAX_FIELD_WIDTH];
- char tmp1[MAX_FIELD_WIDTH];
- Item *item;
- Protocol *protocol= thd->protocol;
- int res;
- DBUG_ENTER("mysqld_show_fields");
- DBUG_PRINT("enter",("db: %s table: %s",table_list->db,
- table_list->real_name));
-
- table_list->lock_type= TL_UNLOCK;
- if (open_and_lock_tables(thd, table_list))
- {
- DBUG_RETURN(TRUE);
- }
- table= table_list->table;
- file=table->file;
- file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
- (void) get_table_grant(thd, table_list);
-#endif
- List<Item> field_list;
- field_list.push_back(new Item_empty_string("Field",NAME_LEN));
- field_list.push_back(new Item_empty_string("Type",40));
- if (verbose)
- field_list.push_back(new Item_empty_string("Collation",40));
- field_list.push_back(new Item_empty_string("Null",1));
- field_list.push_back(new Item_empty_string("Key",3));
- field_list.push_back(item=new Item_empty_string("Default",NAME_LEN));
- item->maybe_null=1;
- field_list.push_back(new Item_empty_string("Extra",20));
- if (verbose)
- {
- field_list.push_back(new Item_empty_string("Privileges",80));
- field_list.push_back(new Item_empty_string("Comment",255));
- }
- // Send first number of fields and records
- if (protocol->send_records_num(&field_list, (ulonglong)file->records) ||
- protocol->send_fields(&field_list, Protocol::SEND_EOF))
- DBUG_RETURN(TRUE);
- restore_record(table,default_values); // Get empty record
-
- Field **ptr,*field;
- for (ptr=table->field; (field= *ptr) ; ptr++)
- {
- if (!wild || !wild[0] ||
- !wild_case_compare(system_charset_info, field->field_name,wild))
- {
- {
- byte *pos;
- uint flags=field->flags;
- String type(tmp,sizeof(tmp), system_charset_info);
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
- uint col_access;
-#endif
- protocol->prepare_for_resend();
- protocol->store(field->field_name, system_charset_info);
- field->sql_type(type);
- protocol->store(type.ptr(), type.length(), system_charset_info);
- if (verbose)
- protocol->store(field->has_charset() ? field->charset()->name : "NULL",
- system_charset_info);
- /*
- Even if TIMESTAMP field can't contain NULL as its value it
- will accept NULL if you will try to insert such value and will
- convert NULL value to current TIMESTAMP. So YES here means
- that NULL is allowed for assignment (but may be won't be
- returned).
- */
- pos=(byte*) ((flags & NOT_NULL_FLAG) &&
- field->type() != FIELD_TYPE_TIMESTAMP ?
- "" : "YES");
- protocol->store((const char*) pos, system_charset_info);
- pos=(byte*) ((field->flags & PRI_KEY_FLAG) ? "PRI" :
- (field->flags & UNIQUE_KEY_FLAG) ? "UNI" :
- (field->flags & MULTIPLE_KEY_FLAG) ? "MUL":"");
- protocol->store((char*) pos, system_charset_info);
-
- if (table->timestamp_field == field &&
- field->unireg_check != Field::TIMESTAMP_UN_FIELD)
- {
- /*
- We have NOW() as default value but we use CURRENT_TIMESTAMP form
- because it is more SQL standard compatible
- */
- protocol->store("CURRENT_TIMESTAMP", system_charset_info);
- }
- else if (field->unireg_check != Field::NEXT_NUMBER &&
- !field->is_null() &&
- !(field->flags & NO_DEFAULT_VALUE_FLAG))
- { // Not null by default
- /*
- Note: we have to convert the default value into
- system_charset_info before sending.
- This is necessary for "SET NAMES binary":
- If the client character set is binary, we want to
- send metadata in UTF8 rather than in the column's
- character set.
- This conversion also makes "SHOW COLUMNS" and
- "SHOW CREATE TABLE" output consistent. Without
- this conversion the default values were displayed
- differently.
- */
- String def(tmp1,sizeof(tmp1), system_charset_info);
- type.set(tmp, sizeof(tmp), field->charset());
- field->val_str(&type);
- uint dummy_errors;
- def.copy(type.ptr(), type.length(), type.charset(),
- system_charset_info, &dummy_errors);
- protocol->store(def.ptr(), def.length(), def.charset());
- }
- else if (field->unireg_check == Field::NEXT_NUMBER ||
- field->maybe_null())
- protocol->store_null(); // Null as default
- else
- protocol->store("",0, system_charset_info); // empty string
-
- char *end=tmp;
- if (field->unireg_check == Field::NEXT_NUMBER)
- end=strmov(tmp,"auto_increment");
- protocol->store(tmp,(uint) (end-tmp), system_charset_info);
-
- if (verbose)
- {
- /* Add grant options & comments */
- end=tmp;
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
- col_access= get_column_grant(thd, &table_list->grant,
- table_list->db,
- table_list->real_name,
- field->field_name) & COL_ACLS;
- for (uint bitnr=0; col_access ; col_access>>=1,bitnr++)
- {
- if (col_access & 1)
- {
- *end++=',';
- end=strmov(end,grant_types.type_names[bitnr]);
- }
- }
-#else
- end=strmov(end,"");
-#endif
- protocol->store(tmp+1,end == tmp ? 0 : (uint) (end-tmp-1),
- system_charset_info);
- protocol->store(field->comment.str, field->comment.length,
- system_charset_info);
- }
- if (protocol->write())
- DBUG_RETURN(TRUE);
- }
- }
- }
- send_eof(thd);
- DBUG_RETURN(FALSE);
-}
-
-
bool
mysqld_show_create(THD *thd, TABLE_LIST *table_list)
{
@@ -1419,16 +1212,15 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
static bool show_status_array(THD *thd, const char *wild,
- show_var_st *variables,
- enum enum_var_type value_type,
- struct system_status_var *status_var,
- const char *prefix)
+ show_var_st *variables,
+ enum enum_var_type value_type,
+ struct system_status_var *status_var,
+ const char *prefix, TABLE *table)
{
char buff[1024], *prefix_end;
/* the variable name should not be longer then 80 characters */
char name_buffer[80];
int len;
- Protocol *protocol= thd->protocol;
LEX_STRING null_lex_str;
DBUG_ENTER("show_status_array");
@@ -1446,7 +1238,7 @@ static bool show_status_array(THD *thd, const char *wild,
if (show_type == SHOW_VARS)
{
show_status_array(thd, wild, (show_var_st *) variables->value,
- value_type, status_var, variables->name);
+ value_type, status_var, variables->name, table);
}
else
{
@@ -1456,10 +1248,6 @@ static bool show_status_array(THD *thd, const char *wild,
char *value=variables->value;
const char *pos, *end;
long nr;
-
- protocol->prepare_for_resend();
- protocol->store(name_buffer, system_charset_info);
-
if (show_type == SHOW_SYS)
{
show_type= ((sys_var*) value)->type();
@@ -1728,9 +1516,11 @@ static bool show_status_array(THD *thd, const char *wild,
default:
break;
}
- if (protocol->store(pos, (uint32) (end - pos), system_charset_info) ||
- protocol->write())
- DBUG_RETURN(TRUE); /* purecov: inspected */
+ restore_record(table, default_values);
+ table->field[0]->store(name_buffer, strlen(name_buffer),
+ system_charset_info);
+ table->field[1]->store(pos, (uint32) (end - pos), system_charset_info);
+ table->file->write_row(table->record[0]);
}
}
}
@@ -1742,25 +1532,14 @@ static bool show_status_array(THD *thd, const char *wild,
bool mysqld_show(THD *thd, const char *wild, show_var_st *variables,
enum enum_var_type value_type,
pthread_mutex_t *mutex,
- struct system_status_var *status_var)
+ struct system_status_var *status_var, TABLE *table)
{
- List<Item> field_list;
- Protocol *protocol= thd->protocol;
DBUG_ENTER("mysqld_show");
-
ha_update_statistics(); /* Export engines statistics */
-
- field_list.push_back(new Item_empty_string("Variable_name",30));
- field_list.push_back(new Item_empty_string("Value",256));
- if (protocol->send_fields(&field_list,
- Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
- DBUG_RETURN(TRUE); /* purecov: inspected */
-
pthread_mutex_lock(mutex);
- if (show_status_array(thd, wild, variables, value_type, status_var, ""))
+ if (show_status_array(thd, wild, variables, value_type, status_var, "", table))
goto err;
pthread_mutex_unlock(mutex);
- send_eof(thd);
DBUG_RETURN(FALSE);
err:
@@ -1944,6 +1723,12 @@ static COND * make_cond_for_info_schema(COND *cond, TABLE_LIST *table)
}
+enum enum_schema_tables get_schema_table_idx(ST_SCHEMA_TABLE *schema_table)
+{
+ return (enum enum_schema_tables) (schema_table - &schema_tables[0]);
+}
+
+
/*
Add 'information_schema' name to db_names list
@@ -2034,8 +1819,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
bool with_i_schema;
List<char> bases;
lex->all_selects_list= &sel;
- enum enum_schema_tables schema_table_idx=
- (enum enum_schema_tables) (schema_table - &schema_tables[0]);
+ enum enum_schema_tables schema_table_idx= get_schema_table_idx(schema_table);
thr_lock_type lock_type= TL_UNLOCK;
if (schema_table_idx == SCH_TABLES)
lock_type= TL_READ;
@@ -3047,6 +2831,62 @@ static int get_schema_key_column_usage_record(THD *thd,
}
+int fill_open_tables(THD *thd, TABLE_LIST *tables, COND *cond)
+{
+ DBUG_ENTER("fill_open_tables");
+ const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS;
+ TABLE *table= tables->table;
+ CHARSET_INFO *cs= system_charset_info;
+ OPEN_TABLE_LIST *open_list;
+ if (!(open_list=list_open_tables(thd,wild)) && thd->is_fatal_error)
+ DBUG_RETURN(1);
+
+ for (; open_list ; open_list=open_list->next)
+ {
+ restore_record(table, default_values);
+ table->field[0]->store(open_list->db, strlen(open_list->db), cs);
+ table->field[1]->store(open_list->table, strlen(open_list->table), cs);
+ table->field[2]->store((longlong) open_list->in_use);
+ table->field[3]->store((longlong) open_list->locked);
+ table->file->write_row(table->record[0]);
+ }
+ DBUG_RETURN(0);
+}
+
+
+int fill_variables(THD *thd, TABLE_LIST *tables, COND *cond)
+{
+ DBUG_ENTER("fill_variables");
+ LEX *lex= thd->lex;
+ const char *wild= lex->wild ? lex->wild->ptr() : NullS;
+ int res= mysqld_show(thd, wild, init_vars, lex->option_type,
+ &LOCK_global_system_variables, 0, tables->table);
+ DBUG_RETURN(res);
+}
+
+
+int fill_status(THD *thd, TABLE_LIST *tables, COND *cond)
+{
+ DBUG_ENTER("fill_status");
+ LEX *lex= thd->lex;
+ const char *wild= lex->wild ? lex->wild->ptr() : NullS;
+ int res= 0;
+ STATUS_VAR tmp;
+
+ if (lex->option_type == OPT_GLOBAL)
+ {
+ pthread_mutex_lock(&LOCK_status);
+ calc_sum_of_all_status(&tmp);
+ }
+ res= mysqld_show(thd, wild, status_vars, OPT_GLOBAL, &LOCK_status,
+ (lex->option_type == OPT_GLOBAL ?
+ &tmp: &thd->status_var), tables->table);
+ if (lex->option_type == OPT_GLOBAL)
+ pthread_mutex_unlock(&LOCK_status);
+ DBUG_RETURN(res);
+}
+
+
/*
Find schema_tables elment by name
@@ -3353,6 +3193,7 @@ int mysql_schema_table(THD *thd, LEX *lex, TABLE_LIST *table_list)
table->next= thd->derived_tables;
thd->derived_tables= table;
table_list->select_lex->options |= OPTION_SCHEMA_TABLE;
+ lex->safe_to_cache_query= 0;
DBUG_RETURN(0);
}
@@ -3690,6 +3531,24 @@ ST_FIELD_INFO table_names_fields_info[]=
};
+ST_FIELD_INFO open_tables_fields_info[]=
+{
+ {"Database", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Database"},
+ {"Table",NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table"},
+ {"In_use", 1, MYSQL_TYPE_LONG, 0, 0, "In_use"},
+ {"Name_locked", 4, MYSQL_TYPE_LONG, 0, 0, "Name_locked"},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+};
+
+
+ST_FIELD_INFO variables_fields_info[]=
+{
+ {"Variable_name", 80, MYSQL_TYPE_STRING, 0, 0, "Variable_name"},
+ {"Value", 255, MYSQL_TYPE_STRING, 0, 0, "Value"},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+};
+
+
/*
Description of ST_FIELD_INFO in table.h
*/
@@ -3728,6 +3587,12 @@ ST_SCHEMA_TABLE schema_tables[]=
get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0},
{"TABLE_NAMES", table_names_fields_info, create_schema_table,
get_all_tables, make_table_names_old_format, 0, 1, 2, 1},
+ {"OPEN_TABLES", open_tables_fields_info, create_schema_table,
+ fill_open_tables, make_old_format, 0, -1, -1, 1},
+ {"STATUS", variables_fields_info, create_schema_table, fill_status,
+ make_old_format, 0, -1, -1, 1},
+ {"VARIABLES", variables_fields_info, create_schema_table, fill_variables,
+ make_old_format, 0, -1, -1, 1},
{0, 0, 0, 0, 0, 0, 0, 0, 0}
};
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 6629122a1fa..3cc421b1312 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -491,44 +491,45 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
DBUG_RETURN(-1);
}
- if ((sql_field->sql_type == FIELD_TYPE_SET ||
- sql_field->sql_type == FIELD_TYPE_ENUM) && !sql_field->interval)
+ if (sql_field->sql_type == FIELD_TYPE_SET ||
+ sql_field->sql_type == FIELD_TYPE_ENUM)
{
uint32 dummy;
CHARSET_INFO *cs= sql_field->charset;
- TYPELIB *interval;
+ TYPELIB *interval= sql_field->interval;
/*
Create typelib from interval_list, and if necessary
convert strings from client character set to the
column character set.
*/
-
- interval= sql_field->interval= typelib(sql_field->interval_list);
- List_iterator<String> it(sql_field->interval_list);
- String conv, *tmp;
- for (uint i= 0; (tmp= it++); i++)
+ if (!interval)
{
- if (String::needs_conversion(tmp->length(), tmp->charset(), cs,
- &dummy))
+ interval= sql_field->interval= typelib(sql_field->interval_list);
+ List_iterator<String> it(sql_field->interval_list);
+ String conv, *tmp;
+ for (uint i= 0; (tmp= it++); i++)
{
- uint cnv_errs;
- conv.copy(tmp->ptr(), tmp->length(), tmp->charset(), cs, &cnv_errs);
- char *buf= (char*) sql_alloc(conv.length()+1);
- memcpy(buf, conv.ptr(), conv.length());
- buf[conv.length()]= '\0';
- interval->type_names[i]= buf;
- interval->type_lengths[i]= conv.length();
- }
+ if (String::needs_conversion(tmp->length(), tmp->charset(),
+ cs, &dummy))
+ {
+ uint cnv_errs;
+ conv.copy(tmp->ptr(), tmp->length(), tmp->charset(), cs, &cnv_errs);
+ char *buf= (char*) sql_alloc(conv.length()+1);
+ memcpy(buf, conv.ptr(), conv.length());
+ buf[conv.length()]= '\0';
+ interval->type_names[i]= buf;
+ interval->type_lengths[i]= conv.length();
+ }
- // Strip trailing spaces.
- uint lengthsp= cs->cset->lengthsp(cs, interval->type_names[i],
- interval->type_lengths[i]);
- interval->type_lengths[i]= lengthsp;
- ((uchar *)interval->type_names[i])[lengthsp]= '\0';
+ // Strip trailing spaces.
+ uint lengthsp= cs->cset->lengthsp(cs, interval->type_names[i],
+ interval->type_lengths[i]);
+ interval->type_lengths[i]= lengthsp;
+ ((uchar *)interval->type_names[i])[lengthsp]= '\0';
+ }
+ sql_field->interval_list.empty(); // Don't need interval_list anymore
}
- sql_field->interval_list.empty(); // Don't need interval_list anymore
-
/*
Convert the default value from client character
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index a88dc0b20bf..96ede3fbe6b 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -2,8 +2,6 @@
#include "sp_head.h"
#include "sql_trigger.h"
#include "parse_file.h"
-#include "sql_acl.h"
-
static const LEX_STRING triggers_file_type= {(char *)"TRIGGERS", 8};
static const char * const triggers_file_ext= ".TRG";
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 815e04c0111..d0a33163a38 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -398,6 +398,8 @@ bool st_select_lex_unit::exec()
if (uncacheable || !item || !item->assigned() || describe)
{
+ if (item)
+ item->reset_value_registration();
if (optimized && item)
{
if (item->assigned())
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 9613e39d403..d10c54f6fab 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -21,7 +21,6 @@
*/
#include "mysql_priv.h"
-#include "sql_acl.h"
#include "sql_select.h"
#include "sp_head.h"
#include "sql_trigger.h"
@@ -225,7 +224,7 @@ int mysql_update(THD *thd,
table_list->grant.want_privilege= table->grant.want_privilege=
(SELECT_ACL & ~table->grant.privilege);
#endif
- if (setup_fields(thd, 0, table_list, values, 0, 0, 0))
+ if (setup_fields(thd, 0, table_list, values, 1, 0, 0))
{
free_underlaid_joins(thd, select_lex);
DBUG_RETURN(1); /* purecov: inspected */
@@ -621,9 +620,8 @@ bool mysql_multi_update_prepare(THD *thd)
LEX *lex= thd->lex;
ulong opened_tables;
TABLE_LIST *table_list= lex->query_tables;
+ TABLE_LIST *tl, *leaves;
List<Item> *fields= &lex->select_lex.item_list;
- TABLE_LIST *tl;
- TABLE_LIST *leaves;
table_map tables_for_update;
int res;
bool update_view= 0;
@@ -635,9 +633,10 @@ bool mysql_multi_update_prepare(THD *thd)
uint table_count= lex->table_count;
const bool using_lock_tables= thd->locked_tables != 0;
bool original_multiupdate= (thd->lex->sql_command == SQLCOM_UPDATE_MULTI);
+ DBUG_ENTER("mysql_multi_update_prepare");
+
/* following need for prepared statements, to run next time multi-update */
thd->lex->sql_command= SQLCOM_UPDATE_MULTI;
- DBUG_ENTER("mysql_multi_update_prepare");
/* open tables and create derived ones, but do not lock and fill them */
if ((original_multiupdate && open_tables(thd, table_list, & table_count)) ||
@@ -652,24 +651,7 @@ bool mysql_multi_update_prepare(THD *thd)
if (setup_tables(thd, table_list, &lex->select_lex.where,
&lex->select_lex.leaf_tables, FALSE, FALSE))
DBUG_RETURN(TRUE);
- /*
- Ensure that we have update privilege for all tables and columns in the
- SET part
- */
- for (tl= (leaves= lex->select_lex.leaf_tables); tl; tl= tl->next_leaf)
- {
- /*
- Update of derived tables is checked later
- We don't check privileges here, becasue then we would get error
- "UPDATE command denided .. for column N" instead of
- "Target table ... is not updatable"
- */
- TABLE *table= tl->table;
- TABLE_LIST *tlist;
- if (!(tlist= tl->belong_to_view?tl->belong_to_view:tl)->derived)
- tlist->grant.want_privilege= table->grant.want_privilege=
- (UPDATE_ACL & ~table->grant.privilege);
- }
+ leaves= lex->select_lex.leaf_tables;
if ((lex->select_lex.no_wrap_view_item= 1,
res= setup_fields(thd, 0, table_list, *fields, 1, 0, 0),
@@ -699,11 +681,6 @@ bool mysql_multi_update_prepare(THD *thd)
for (tl= leaves; tl; tl= tl->next_leaf)
{
TABLE *table= tl->table;
- TABLE_LIST *tlist= tl->belong_to_view?tl->belong_to_view:tl;
-
- /* We only need SELECT privilege for columns in the values list */
- tlist->grant.want_privilege= table->grant.want_privilege=
- (SELECT_ACL & ~table->grant.privilege);
/* Only set timestamp column if this is not modified */
if (table->timestamp_field &&
table->timestamp_field->query_id == thd->query_id)
@@ -731,15 +708,26 @@ bool mysql_multi_update_prepare(THD *thd)
DBUG_PRINT("info",("setting table `%s` for update", tl->alias));
tl->lock_type= lex->multi_lock_option;
tl->updating= 1;
- }
+ }
else
{
DBUG_PRINT("info",("setting table `%s` for read-only", tl->alias));
tl->lock_type= TL_READ;
tl->updating= 0;
}
- if (!using_lock_tables)
- tl->table->reginfo.lock_type= tl->lock_type;
+
+ /* Check access privileges for table */
+ if (!tl->derived)
+ {
+ uint want_privilege= tl->updating ? UPDATE_ACL : SELECT_ACL;
+ if (!using_lock_tables)
+ tl->table->reginfo.lock_type= tl->lock_type;
+
+ if (check_access(thd, want_privilege,
+ tl->db, &tl->grant.privilege, 0, 0) ||
+ (grant_option && check_grant(thd, want_privilege, tl, 0, 1, 0)))
+ DBUG_RETURN(TRUE);
+ }
}
/* check single table update for view compound from several tables */
@@ -794,6 +782,22 @@ bool mysql_multi_update_prepare(THD *thd)
res))
DBUG_RETURN(TRUE);
}
+
+ /* We only need SELECT privilege for columns in the values list */
+ for (tl= leaves; tl; tl= tl->next_leaf)
+ {
+ TABLE *table= tl->table;
+ TABLE_LIST *tlist;
+ if (!(tlist= tl->belong_to_view ? tl->belong_to_view : tl)->derived)
+ {
+ tlist->grant.want_privilege=
+ (SELECT_ACL & ~tlist->grant.privilege);
+ table->grant.want_privilege= (SELECT_ACL & ~table->grant.privilege);
+ }
+ DBUG_PRINT("info", ("table: %s want_privilege: %u", tl->alias,
+ (uint) table->grant.want_privilege));
+ }
+
if (thd->fill_derived_tables() &&
mysql_handle_derived(lex, &mysql_derived_filling))
DBUG_RETURN(TRUE);
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 993a4d1987b..bafb57c44b0 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -16,7 +16,6 @@
*/
#include "mysql_priv.h"
-#include "sql_acl.h"
#include "sql_select.h"
#include "parse_file.h"
#include "sp.h"
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 5c03a4c98ef..a8954426045 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -32,7 +32,6 @@
#define Select Lex->current_select
#include "mysql_priv.h"
#include "slave.h"
-#include "sql_acl.h"
#include "lex_symbol.h"
#include "item_create.h"
#include "sp_head.h"
@@ -676,7 +675,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%type <simple_string>
remember_name remember_end opt_ident opt_db text_or_password
- opt_constraint constraint
+ opt_constraint constraint ident_or_empty
%type <string>
text_string opt_gconcat_separator
@@ -3238,7 +3237,7 @@ alter:
}
alter_list
{}
- | ALTER DATABASE ident
+ | ALTER DATABASE ident_or_empty
{
Lex->create_info.default_table_charset= NULL;
Lex->create_info.used_fields= 0;
@@ -3247,7 +3246,7 @@ alter:
{
LEX *lex=Lex;
lex->sql_command=SQLCOM_ALTER_DB;
- lex->name=$3.str;
+ lex->name= $3;
}
| ALTER PROCEDURE sp_name
{
@@ -3291,6 +3290,10 @@ alter:
{}
;
+ident_or_empty:
+ /* empty */ { $$= 0; }
+ | ident { $$= $1.str; };
+
alter_list:
| DISCARD TABLESPACE { Lex->alter_info.tablespace_op= DISCARD_TABLESPACE; }
| IMPORT TABLESPACE { Lex->alter_info.tablespace_op= IMPORT_TABLESPACE; }
@@ -5716,20 +5719,8 @@ expr_or_default:
opt_insert_update:
/* empty */
- | ON DUPLICATE_SYM
- {
- LEX *lex= Lex;
- /*
- For simplicity, let's forget about INSERT ... SELECT ... UPDATE
- for a moment.
- */
- if (lex->sql_command != SQLCOM_INSERT)
- {
- yyerror(ER(ER_SYNTAX_ERROR));
- YYABORT;
- }
- }
- KEY_SYM UPDATE_SYM update_list
+ | ON DUPLICATE_SYM { Lex->duplicates= DUP_UPDATE; }
+ KEY_SYM UPDATE_SYM insert_update_list
;
/* Update rows in a table */
@@ -5765,16 +5756,28 @@ update:
;
update_list:
- update_list ',' simple_ident_nospvar equal expr_or_default
+ update_list ',' update_elem
+ | update_elem;
+
+update_elem:
+ simple_ident_nospvar equal expr_or_default
{
- if (add_item_to_list(YYTHD, $3) || add_value_to_list(YYTHD, $5))
+ if (add_item_to_list(YYTHD, $1) || add_value_to_list(YYTHD, $3))
YYABORT;
- }
- | simple_ident_nospvar equal expr_or_default
- {
- if (add_item_to_list(YYTHD, $1) || add_value_to_list(YYTHD, $3))
- YYABORT;
- };
+ };
+
+insert_update_list:
+ insert_update_list ',' insert_update_elem
+ | insert_update_elem;
+
+insert_update_elem:
+ simple_ident_nospvar equal expr_or_default
+ {
+ LEX *lex= Lex;
+ if (lex->update_list.push_back($1) ||
+ lex->value_list.push_back($3))
+ YYABORT;
+ };
opt_low_priority:
/* empty */ { $$= YYTHD->update_lock_default; }
@@ -5899,12 +5902,15 @@ show_param:
if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLES))
YYABORT;
}
- | OPEN_SYM TABLES opt_db wild
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_SHOW_OPEN_TABLES;
- lex->select_lex.db= $3;
- }
+ | OPEN_SYM TABLES ext_select_item_list opt_db wild_and_where
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_SELECT;
+ lex->orig_sql_command= SQLCOM_SHOW_OPEN_TABLES;
+ lex->select_lex.db= $4;
+ if (prepare_schema_table(YYTHD, lex, 0, SCH_OPEN_TABLES))
+ YYABORT;
+ }
| ENGINE_SYM storage_engines
{ Lex->create_info.db_type= $2; }
show_engine_param
@@ -5980,22 +5986,28 @@ show_param:
{ Lex->sql_command = SQLCOM_SHOW_WARNS;}
| ERRORS opt_limit_clause_init
{ Lex->sql_command = SQLCOM_SHOW_ERRORS;}
- | opt_var_type STATUS_SYM wild
+ | opt_var_type STATUS_SYM ext_select_item_list wild_and_where
{
- THD *thd= YYTHD;
- thd->lex->sql_command= SQLCOM_SHOW_STATUS;
- thd->lex->option_type= (enum_var_type) $1;
- }
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_SELECT;
+ lex->orig_sql_command= SQLCOM_SHOW_STATUS;
+ lex->option_type= (enum_var_type) $1;
+ if (prepare_schema_table(YYTHD, lex, 0, SCH_STATUS))
+ YYABORT;
+ }
| INNOBASE_SYM STATUS_SYM
{ Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS; WARN_DEPRECATED("SHOW INNODB STATUS", "SHOW ENGINE INNODB STATUS"); }
| opt_full PROCESSLIST_SYM
{ Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;}
- | opt_var_type VARIABLES wild
- {
- THD *thd= YYTHD;
- thd->lex->sql_command= SQLCOM_SHOW_VARIABLES;
- thd->lex->option_type= (enum_var_type) $1;
- }
+ | opt_var_type VARIABLES ext_select_item_list wild_and_where
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_SELECT;
+ lex->orig_sql_command= SQLCOM_SHOW_VARIABLES;
+ lex->option_type= (enum_var_type) $1;
+ if (prepare_schema_table(YYTHD, lex, 0, SCH_VARIABLES))
+ YYABORT;
+ }
| charset ext_select_item_list wild_and_where
{
LEX *lex= Lex;
@@ -6143,12 +6155,6 @@ opt_db:
/* empty */ { $$= 0; }
| from_or_in ident { $$= $2.str; };
-wild:
- /* empty */
- | LIKE TEXT_STRING_sys
- { Lex->wild= new (YYTHD->mem_root) String($2.str, $2.length,
- system_charset_info); };
-
opt_full:
/* empty */ { Lex->verbose=0; }
| FULL { Lex->verbose=1; };
@@ -6186,7 +6192,10 @@ ext_select_item_list:
mysql_init_select(lex);
lex->current_select->parsing_place= SELECT_LIST;
}
- /* empty */
+ ext_select_item_list2;
+
+ext_select_item_list2:
+ /* empty */ {}
| select_item_list {};
diff --git a/sql/strfunc.cc b/sql/strfunc.cc
index 2253f48e558..777b3851294 100644
--- a/sql/strfunc.cc
+++ b/sql/strfunc.cc
@@ -53,8 +53,22 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs,
{
const char *pos= start;
uint var_len;
+ int mblen= 1;
- for (; pos != end && *pos != field_separator; pos++) ;
+ if (cs && cs->mbminlen > 1)
+ {
+ for ( ; pos < end; pos+= mblen)
+ {
+ my_wc_t wc;
+ if ((mblen= cs->cset->mb_wc(cs, &wc, (const uchar *) pos,
+ (const uchar *) end)) < 1)
+ mblen= 1; // Not to hang on a wrong multibyte sequence
+ if (wc == (my_wc_t) field_separator)
+ break;
+ }
+ }
+ else
+ for (; pos != end && *pos != field_separator; pos++) ;
var_len= (uint) (pos - start);
uint find= cs ? find_type2(lib, start, var_len, cs) :
find_type(lib, start, var_len, (bool) 0);
@@ -66,9 +80,9 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs,
}
else
found|= ((longlong) 1 << (find - 1));
- if (pos == end)
+ if (pos >= end)
break;
- start= pos + 1;
+ start= pos + mblen;
}
}
return found;
diff --git a/sql/table.cc b/sql/table.cc
index 3cf6bbded58..8a85eb95fdc 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -21,7 +21,6 @@
#include <errno.h>
#include <m_ctype.h>
#include "md5.h"
-#include "sql_acl.h"
/* Functions defined in this file */
@@ -510,6 +509,32 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
charset= outparam->table_charset;
bzero((char*) &comment, sizeof(comment));
}
+
+ if (interval_nr && charset->mbminlen > 1)
+ {
+ /* Unescape UCS2 intervals from HEX notation */
+ TYPELIB *interval= outparam->intervals + interval_nr - 1;
+ for (uint pos= 0; pos < interval->count; pos++)
+ {
+ char *from, *to;
+ for (from= to= (char*) interval->type_names[pos]; *from; )
+ {
+ /*
+ Note, hexchar_to_int(*from++) doesn't work
+ one some compilers, e.g. IRIX. Looks like a compiler
+ bug in inline functions in combination with arguments
+ that have a side effect. So, let's use from[0] and from[1]
+ and increment 'from' by two later.
+ */
+
+ *to++= (char) (hexchar_to_int(from[0]) << 4) +
+ hexchar_to_int(from[1]);
+ from+= 2;
+ }
+ interval->type_lengths[pos] /= 2;
+ }
+ }
+
*field_ptr=reg_field=
make_field(record+recpos,
(uint32) field_length,
diff --git a/sql/table.h b/sql/table.h
index a804376ee3c..4f01751ea76 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -145,8 +145,14 @@ struct st_table {
int current_lock; /* Type of lock on table */
enum tmp_table_type tmp_table;
my_bool copy_blobs; /* copy_blobs when storing */
- my_bool null_row; /* All columns are null */
- my_bool maybe_null,outer_join; /* Used with OUTER JOIN */
+ /*
+ Used in outer joins: if true, all columns are considered to have NULL
+ values, including columns declared as "not null".
+ */
+ my_bool null_row;
+ /* 0 or JOIN_TYPE_{LEFT|RIGHT}, same as TABLE_LIST::outer_join */
+ my_bool outer_join;
+ my_bool maybe_null; /* true if (outer_join != 0) */
my_bool force_index;
my_bool distinct,const_table,no_rows;
my_bool key_read;
@@ -223,7 +229,7 @@ enum enum_schema_tables
SCH_COLLATION_CHARACTER_SET_APPLICABILITY, SCH_PROCEDURES, SCH_STATISTICS,
SCH_VIEWS, SCH_USER_PRIVILEGES, SCH_SCHEMA_PRIVILEGES, SCH_TABLE_PRIVILEGES,
SCH_COLUMN_PRIVILEGES, SCH_TABLE_CONSTRAINTS, SCH_KEY_COLUMN_USAGE,
- SCH_TABLE_NAMES
+ SCH_TABLE_NAMES, SCH_OPEN_TABLES, SCH_STATUS, SCH_VARIABLES
};
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 2c25c647a19..dc38580f3b6 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -1807,7 +1807,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
0, HA_READ_KEY_EXACT))
{
#ifdef EXTRA_DEBUG
- sql_print_error("Can't find description of time zone.");
+ sql_print_error("Can't find description of time zone '%.*s'", tz_name->length(),
+ tz_name->ptr());
#endif
goto end;
}
@@ -1829,7 +1830,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr,
0, HA_READ_KEY_EXACT))
{
- sql_print_error("Can't find description of time zone.");
+ sql_print_error("Can't find description of time zone '%u'", tzid);
goto end;
}
diff --git a/sql/tztime.h b/sql/tztime.h
index 07e9146c6e9..caf663fc8cb 100644
--- a/sql/tztime.h
+++ b/sql/tztime.h
@@ -67,8 +67,8 @@ extern void my_tz_free();
extern TABLE_LIST fake_time_zone_tables_list;
/*
- Check if we have pointer to the beggining of list of implictly used
- time zone tables and fast-forward to its end.
+ Check if we have pointer to the begining of list of implicitly used time
+ zone tables, set SELECT_ACL for them and fast-forward to its end.
SYNOPSIS
my_tz_check_n_skip_implicit_tables()
@@ -88,6 +88,8 @@ inline bool my_tz_check_n_skip_implicit_tables(TABLE_LIST **table,
{
if (*table == tz_tables)
{
+ for (int i= 0; i < 4; i++)
+ (*table)[i].grant.privilege= SELECT_ACL;
(*table)+= 3;
return TRUE;
}
diff --git a/sql/udf_example.cc b/sql/udf_example.cc
index f0f33ed6fd7..a186b4fbf6c 100644
--- a/sql/udf_example.cc
+++ b/sql/udf_example.cc
@@ -619,10 +619,12 @@ my_bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
return 1;
}
bzero(initid->ptr,sizeof(longlong));
- // Fool MySQL to think that this function is a constant
- // This will ensure that MySQL only evalutes the function
- // when the rows are sent to the client and not before any ORDER BY
- // clauses
+ /*
+ Fool MySQL to think that this function is a constant
+ This will ensure that MySQL only evalutes the function
+ when the rows are sent to the client and not before any ORDER BY
+ clauses
+ */
initid->const_item=1;
return 0;
}
@@ -639,9 +641,10 @@ longlong sequence(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
ulonglong val=0;
if (args->arg_count)
val= *((longlong*) args->args[0]);
- return ++ *((longlong*) initid->ptr) + val;
+ return ++*((longlong*) initid->ptr) + val;
}
+
/****************************************************************************
** Some functions that handles IP and hostname conversions
** The orignal function was from Zeev Suraski.
diff --git a/sql/unireg.cc b/sql/unireg.cc
index dbd3da58a33..a16439530fc 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -423,6 +423,28 @@ static bool pack_header(uchar *forminfo, enum db_type table_type,
if (field->interval)
{
uint old_int_count=int_count;
+
+ if (field->charset->mbminlen > 1)
+ {
+ /* Escape UCS2 intervals using HEX notation */
+ for (uint pos= 0; pos < field->interval->count; pos++)
+ {
+ char *dst;
+ uint length= field->interval->type_lengths[pos], hex_length;
+ const char *src= field->interval->type_names[pos];
+ const char *srcend= src + length;
+ hex_length= length * 2;
+ field->interval->type_lengths[pos]= hex_length;
+ field->interval->type_names[pos]= dst= sql_alloc(hex_length + 1);
+ for ( ; src < srcend; src++)
+ {
+ *dst++= _dig_vec_upper[((uchar) *src) >> 4];
+ *dst++= _dig_vec_upper[((uchar) *src) & 15];
+ }
+ *dst= '\0';
+ }
+ }
+
field->interval_id=get_interval_id(&int_count,create_fields,field);
if (old_int_count != int_count)
{
diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c
index 07c45788d30..76981200a4d 100644
--- a/strings/ctype-czech.c
+++ b/strings/ctype-czech.c
@@ -277,7 +277,8 @@ static
int my_strnncollsp_czech(CHARSET_INFO * cs,
const uchar *s, uint slen,
const uchar *t, uint tlen,
- my_bool diff_if_only_endspace_difference)
+ my_bool diff_if_only_endspace_difference
+ __attribute__((unused)))
{
for ( ; slen && s[slen-1] == ' ' ; slen--);
for ( ; tlen && t[tlen-1] == ' ' ; tlen--);
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index d3fb16aa52e..d21b340e768 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1360,7 +1360,8 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs,
static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs,
const uchar *s, uint slen,
const uchar *t, uint tlen,
- my_bool diff_if_only_endspace_difference)
+ my_bool diff_if_only_endspace_difference
+ __attribute__((unused)))
{
/* TODO: Needs to be fixed to handle end space! */
return my_strnncoll_ucs2_bin(cs,s,slen,t,tlen,0);
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index 94673a20795..fc1496df280 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -8243,7 +8243,6 @@ my_jisx0212_uni_onechar(int code){
}
-
/*
EUC-JP encoding subcomponents:
[x00-x7F] # ASCII/JIS-Roman (one-byte/character)
@@ -8253,6 +8252,47 @@ my_jisx0212_uni_onechar(int code){
*/
static
+uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
+ const char *beg, const char *end, uint pos)
+{
+ const uchar *b= (uchar *) beg;
+
+ for ( ; pos && b < (uchar*) end; pos--, b++)
+ {
+ char *chbeg;
+ uint ch= *b;
+
+ if (ch <= 0x7F) /* one byte */
+ continue;
+
+ chbeg= (char *) b++;
+ if (b >= (uchar *) end) /* need more bytes */
+ return chbeg - beg; /* unexpected EOL */
+
+ if (ch == 0x8E) /* [x8E][xA0-xDF] */
+ {
+ if (*b >= 0xA0 && *b <= 0xDF)
+ continue;
+ return chbeg - beg; /* invalid sequence */
+ }
+
+ if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */
+ {
+ ch= *b++;
+ if (b >= (uchar*) end)
+ return chbeg - beg; /* unexpected EOL */
+ }
+
+ if (ch >= 0xA1 && ch <= 0xFE &&
+ *b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
+ continue;
+ return chbeg - beg; /* invalid sequence */
+ }
+ return b - (uchar *) beg;
+}
+
+
+static
uint my_numcells_eucjp(CHARSET_INFO *cs __attribute__((unused)),
const char *str, const char *strend)
{
@@ -8475,7 +8515,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_ujis,
my_numchars_mb,
my_charpos_mb,
- my_well_formed_len_mb,
+ my_well_formed_len_ujis,
my_lengthsp_8bit,
my_numcells_eucjp,
my_mb_wc_euc_jp, /* mb_wc */
diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c
index 896aef775cf..397dcd6f2f2 100644
--- a/strings/ctype-win1250ch.c
+++ b/strings/ctype-win1250ch.c
@@ -480,7 +480,8 @@ static
int my_strnncollsp_win1250ch(CHARSET_INFO * cs,
const uchar *s, uint slen,
const uchar *t, uint tlen,
- my_bool diff_if_only_endspace_difference)
+ my_bool diff_if_only_endspace_difference
+ __attribute__((unused)))
{
for ( ; slen && s[slen-1] == ' ' ; slen--);
for ( ; tlen && t[tlen-1] == ' ' ; tlen--);
diff --git a/strings/xml.c b/strings/xml.c
index 6ba52ea41a8..d19c3dab241 100644
--- a/strings/xml.c
+++ b/strings/xml.c
@@ -135,7 +135,7 @@ static int my_xml_value(MY_XML_PARSER *st, const char *str, uint len)
static int my_xml_enter(MY_XML_PARSER *st, const char *str, uint len)
{
- if ( (st->attrend-st->attr+len+1)>sizeof(st->attr))
+ if ((uint) (st->attrend-st->attr+len+1) > sizeof(st->attr))
{
sprintf(st->errstr,"To deep XML");
return MY_XML_ERROR;
diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh
index 6def311f474..062d106ce6a 100644
--- a/support-files/my-innodb-heavy-4G.cnf.sh
+++ b/support-files/my-innodb-heavy-4G.cnf.sh
@@ -177,7 +177,7 @@ default_table_type = MYISAM
thread_stack = 192K
# Set the default transaction isolation level. Levels available are:
-# READ-UNCOMMITED, READ-COMMITED, REPEATABLE-READ, SERIALIZABLE
+# READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE
transaction_isolation = REPEATABLE-READ
# Maximum size for internal (in-memory) temporary tables. If a table
diff --git a/tests/client_test.c b/tests/client_test.c
index 25dcb951d3a..8dc0ec5ca84 100644
--- a/tests/client_test.c
+++ b/tests/client_test.c
@@ -705,10 +705,12 @@ static void verify_prepare_field(MYSQL_RES *result,
as utf8. Field length is calculated as number of characters * maximum
number of bytes a character can occupy.
*/
-#ifndef EMBEDDED_LIBRARY
- if (length)
+ if (length && field->length != length * cs->mbmaxlen)
+ {
+ fprintf(stderr, "Expected field length: %d, got length: %d\n",
+ (int) (length * cs->mbmaxlen), (int) field->length);
DIE_UNLESS(field->length == length * cs->mbmaxlen);
-#endif
+ }
if (def)
DIE_UNLESS(strcmp(field->def, def) == 0);
}
@@ -1261,6 +1263,56 @@ static void test_tran_innodb()
}
+/* Test for BUG#7242 */
+
+static void test_prepare_insert_update()
+{
+ MYSQL_STMT *stmt;
+ int rc;
+ int i;
+ const char *testcase[]= {
+ "CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B))",
+ "INSERT t1 VALUES (1,2,10), (3,4,20)",
+ "INSERT t1 VALUES (5,6,30), (7,4,40), (8,9,60) ON DUPLICATE KEY UPDATE c=c+100",
+ "SELECT * FROM t1",
+ "INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0",
+ "SELECT * FROM t1",
+ "INSERT t1 VALUES (2,1,11), (7,4,40) ON DUPLICATE KEY UPDATE c=c+VALUES(a)",
+ NULL};
+ const char **cur_query;
+
+ myheader("test_prepare_insert_update");
+
+ for (cur_query= testcase; *cur_query; cur_query++)
+ {
+ printf("\nRunning query: %s", *cur_query);
+ strmov(query, *cur_query);
+ stmt= mysql_simple_prepare(mysql, query);
+ check_stmt(stmt);
+
+ verify_param_count(stmt, 0);
+ rc= mysql_stmt_execute(stmt);
+
+ check_execute(stmt, rc);
+ /* try the last query several times */
+ if (!cur_query[1])
+ {
+ for (i=0; i < 3;i++)
+ {
+ printf("\nExecuting last statement again");
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ }
+ }
+ mysql_stmt_close(stmt);
+ }
+
+ rc= mysql_commit(mysql);
+ myquery(rc);
+}
+
/* Test simple prepares of all DML statements */
static void test_prepare_simple()
@@ -1286,7 +1338,8 @@ static void test_prepare_simple()
mysql_stmt_close(stmt);
/* update */
- strmov(query, "UPDATE test_prepare_simple SET id=? WHERE id=? AND name= ?");
+ strmov(query, "UPDATE test_prepare_simple SET id=? "
+ "WHERE id=? AND CONVERT(name USING utf8)= ?");
stmt= mysql_simple_prepare(mysql, query);
check_stmt(stmt);
@@ -1314,7 +1367,8 @@ static void test_prepare_simple()
mysql_stmt_close(stmt);
/* select */
- strmov(query, "SELECT * FROM test_prepare_simple WHERE id=? AND name= ?");
+ strmov(query, "SELECT * FROM test_prepare_simple WHERE id=? "
+ "AND CONVERT(name USING utf8)= ?");
stmt= mysql_simple_prepare(mysql, query);
check_stmt(stmt);
@@ -1343,7 +1397,7 @@ static void test_prepare_field_result()
rc= mysql_query(mysql, "CREATE TABLE test_prepare_field_result(int_c int, "
"var_c varchar(50), ts_c timestamp(14), "
- "char_c char(3), date_c date, extra tinyint)");
+ "char_c char(4), date_c date, extra tinyint)");
myquery(rc);
/* insert */
@@ -1369,8 +1423,10 @@ static void test_prepare_field_result()
"t1", "test_prepare_field_result", current_db, 10, 0);
verify_prepare_field(result, 3, "ts_c", "ts_c", MYSQL_TYPE_TIMESTAMP,
"t1", "test_prepare_field_result", current_db, 19, 0);
- verify_prepare_field(result, 4, "char_c", "char_c", MYSQL_TYPE_STRING,
- "t1", "test_prepare_field_result", current_db, 3, 0);
+ verify_prepare_field(result, 4, "char_c", "char_c",
+ (mysql_get_server_version(mysql) <= 50000 ?
+ MYSQL_TYPE_VAR_STRING : MYSQL_TYPE_STRING),
+ "t1", "test_prepare_field_result", current_db, 4, 0);
verify_field_count(result, 5);
mysql_free_result(result);
@@ -2106,7 +2162,8 @@ static void test_select()
rc= mysql_commit(mysql);
myquery(rc);
- strmov(query, "SELECT * FROM test_select WHERE id= ? AND name=?");
+ strmov(query, "SELECT * FROM test_select WHERE id= ? "
+ "AND CONVERT(name USING utf8) =?");
stmt= mysql_simple_prepare(mysql, query);
check_stmt(stmt);
@@ -2166,7 +2223,8 @@ static void test_ps_conj_select()
"(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')");
myquery(rc);
- strmov(query, "select id1, value1 from t1 where id1= ? or value1= ?");
+ strmov(query, "select id1, value1 from t1 where id1= ? or "
+ "CONVERT(value1 USING utf8)= ?");
stmt= mysql_simple_prepare(mysql, query);
check_stmt(stmt);
@@ -2245,7 +2303,8 @@ session_id char(9) NOT NULL, \
"(\"abx\", 1, 2, 3, 2003-08-30)");
myquery(rc);
- strmov(query, "SELECT * FROM test_select WHERE session_id= ?");
+ strmov(query, "SELECT * FROM test_select WHERE "
+ "CONVERT(session_id USING utf8)= ?");
stmt= mysql_simple_prepare(mysql, query);
check_stmt(stmt);
@@ -3085,7 +3144,8 @@ static void test_simple_delete()
myquery(rc);
/* insert by prepare */
- strmov(query, "DELETE FROM test_simple_delete WHERE col1= ? AND col2= ? AND col3= 100");
+ strmov(query, "DELETE FROM test_simple_delete WHERE col1= ? AND "
+ "CONVERT(col2 USING utf8)= ? AND col3= 100");
stmt= mysql_simple_prepare(mysql, query);
check_stmt(stmt);
@@ -5064,7 +5124,8 @@ static void test_multi_stmt()
/* alter the table schema now */
stmt1= mysql_simple_prepare(mysql, "DELETE FROM test_multi_table "
- "WHERE id= ? AND name=?");
+ "WHERE id= ? AND "
+ "CONVERT(name USING utf8)=?");
check_stmt(stmt1);
verify_param_count(stmt1, 2);
@@ -5831,9 +5892,6 @@ static void test_subselect()
rc= mysql_stmt_bind_param(stmt, bind);
check_execute(stmt, rc);
- rc= mysql_stmt_bind_result(stmt, bind);
- check_execute(stmt, rc);
-
id= 2;
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
@@ -6172,7 +6230,7 @@ static void test_pure_coverage()
check_execute(stmt, rc);
rc= mysql_stmt_bind_result(stmt, (MYSQL_BIND*)0);
- check_execute(stmt, rc);
+ DIE_UNLESS(rc == 1);
mysql_stmt_close(stmt);
@@ -6828,7 +6886,7 @@ static void test_field_misc()
mysql_get_server_version(mysql) <= 50000 ?
MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING,
"", "", /* table and its org name */
- "", type_length*3, 0); /* db name, length */
+ "", type_length, 0); /* db name, length */
mysql_free_result(result);
mysql_stmt_close(stmt);
@@ -7304,7 +7362,7 @@ static void test_explain_bug()
verify_prepare_field(result, 0, "Field", "COLUMN_NAME",
mysql_get_server_version(mysql) <= 50000 ?
MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING,
- 0, 0, "", 192, 0);
+ 0, 0, "", 64, 0);
verify_prepare_field(result, 1, "Type", "COLUMN_TYPE",
MYSQL_TYPE_BLOB, 0, 0, "", 0, 0);
@@ -7312,22 +7370,22 @@ static void test_explain_bug()
verify_prepare_field(result, 2, "Null", "IS_NULLABLE",
mysql_get_server_version(mysql) <= 50000 ?
MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING,
- 0, 0, "", 9, 0);
+ 0, 0, "", 3, 0);
verify_prepare_field(result, 3, "Key", "COLUMN_KEY",
mysql_get_server_version(mysql) <= 50000 ?
MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING,
- 0, 0, "", 9, 0);
+ 0, 0, "", 3, 0);
verify_prepare_field(result, 4, "Default", "COLUMN_DEFAULT",
mysql_get_server_version(mysql) <= 50000 ?
MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING,
- 0, 0, "", 192, 0);
+ 0, 0, "", 64, 0);
verify_prepare_field(result, 5, "Extra", "EXTRA",
mysql_get_server_version(mysql) <= 50000 ?
MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING,
- 0, 0, "", 60, 0);
+ 0, 0, "", 20, 0);
mysql_free_result(result);
mysql_stmt_close(stmt);
@@ -12059,6 +12117,68 @@ static void test_conversion()
myquery(rc);
}
+static void test_rewind(void)
+{
+ MYSQL_STMT *stmt;
+ MYSQL_BIND bind;
+ int rc = 0;
+ const char *stmt_text;
+ long unsigned int length=4, Data=0;
+ my_bool isnull=0;
+
+ myheader("test_rewind");
+
+ stmt_text= "CREATE TABLE t1 (a int)";
+ rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
+ myquery(rc);
+ stmt_text= "INSERT INTO t1 VALUES(2),(3),(4)";
+ rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
+ myquery(rc);
+
+ stmt= mysql_stmt_init(mysql);
+
+ stmt_text= "SELECT * FROM t1";
+ rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ check_execute(stmt, rc);
+
+ bzero(&bind,sizeof(MYSQL_BIND));
+ bind.buffer_type= MYSQL_TYPE_LONG;
+ bind.buffer= (void *)&Data; /* this buffer won't be altered */
+ bind.length= &length;
+ bind.is_null= &isnull;
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_store_result(stmt);
+ DIE_UNLESS(rc == 0);
+
+ rc= mysql_stmt_bind_result(stmt, &bind);
+ DIE_UNLESS(rc == 0);
+
+ /* retreive all result sets till we are at the end */
+ while(!mysql_stmt_fetch(stmt))
+ printf("fetched result:%ld\n", Data);
+
+ DIE_UNLESS(rc != MYSQL_NO_DATA);
+
+ /* seek to the first row */
+ mysql_stmt_data_seek(stmt, 0);
+
+ /* now we should be able to fetch the results again */
+ /* but mysql_stmt_fetch returns MYSQL_NO_DATA */
+ while(!(rc= mysql_stmt_fetch(stmt)))
+ printf("fetched result after seek:%ld\n", Data);
+
+ DIE_UNLESS(rc == MYSQL_NO_DATA);
+
+ stmt_text= "DROP TABLE t1";
+ rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
+ myquery(rc);
+ rc= mysql_stmt_free_result(stmt);
+ rc= mysql_stmt_close(stmt);
+}
+
static void test_truncation()
{
@@ -12415,6 +12535,7 @@ and you are welcome to modify and redistribute it under the GPL license\n");
static struct my_tests_st my_tests[]= {
{ "client_query", client_query },
+ { "test_prepare_insert_update", test_prepare_insert_update},
#if NOT_YET_WORKING
{ "test_drop_temp", test_drop_temp },
#endif
@@ -12557,6 +12678,7 @@ static struct my_tests_st my_tests[]= {
{ "test_datetime_ranges", test_datetime_ranges },
{ "test_bug4172", test_bug4172 },
{ "test_conversion", test_conversion },
+ { "test_rewind", test_rewind },
{ "test_view", test_view },
{ "test_view_where", test_view_where },
{ "test_view_2where", test_view_2where },
diff --git a/vio/test-sslserver.c b/vio/test-sslserver.c
index d05e50af16b..e4d32a75264 100644
--- a/vio/test-sslserver.c
+++ b/vio/test-sslserver.c
@@ -91,12 +91,7 @@ main(int argc __attribute__((unused)), char** argv)
struct sockaddr_in sa_cli;
int listen_sd;
int err;
-
-#if defined(__sgi) && _NO_XOPEN4 && _NO_XOPEN5
- socklen_t client_len;
-#else
- size_t client_len;
-#endif
+ size_socket client_len;
int reuseaddr = 1; /* better testing, uh? */
MY_INIT(argv[0]);