summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore9
-rw-r--r--BitKeeper/etc/logging_ok4
-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/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--configure.in40
-rw-r--r--include/errmsg.h1
-rw-r--r--include/my_base.h1
-rw-r--r--include/raid.h7
-rw-r--r--innobase/dict/dict0dict.c28
-rw-r--r--innobase/dict/dict0load.c16
-rw-r--r--innobase/os/os0file.c11
-rw-r--r--innobase/srv/srv0srv.c1
-rw-r--r--libmysql/errmsg.c12
-rw-r--r--libmysql/libmysql.c28
-rw-r--r--libmysqld/lib_sql.cc79
-rw-r--r--myisam/ft_boolean_search.c2
-rw-r--r--myisam/mi_check.c10
-rw-r--r--myisam/mi_rnext_same.c4
-rw-r--r--myisam/mi_write.c7
-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--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/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.result64
-rw-r--r--mysql-test/r/group_by.result12
-rw-r--r--mysql-test/r/have_exampledb.require2
-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/merge.result25
-rw-r--r--mysql-test/r/metadata.result2
-rw-r--r--mysql-test/r/multi_update.result11
-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_2myisam.result3
-rw-r--r--mysql-test/r/ps_2myisam.result.es3130
-rw-r--r--mysql-test/r/ps_3innodb.result3
-rw-r--r--mysql-test/r/ps_3innodb.result.es3113
-rw-r--r--mysql-test/r/ps_4heap.result3
-rw-r--r--mysql-test/r/ps_4heap.result.es3114
-rw-r--r--mysql-test/r/ps_5merge.result.es6064
-rw-r--r--mysql-test/r/ps_6bdb.result3
-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.result.es8
-rw-r--r--mysql-test/r/rpl_insert_ignore.result70
-rw-r--r--mysql-test/r/subselect.result97
-rw-r--r--mysql-test/r/timezone2.result36
-rw-r--r--mysql-test/r/type_enum.result14
-rw-r--r--mysql-test/r/update.result6
-rw-r--r--mysql-test/r/variables.result4
-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/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.test72
-rw-r--r--mysql-test/t/group_by.test9
-rw-r--r--mysql-test/t/insert_update.test31
-rw-r--r--mysql-test/t/key_cache.test6
-rw-r--r--mysql-test/t/merge.test18
-rw-r--r--mysql-test/t/multi_update.test14
-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/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/subselect.test52
-rw-r--r--mysql-test/t/timezone2.test43
-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--mysys/hash.c2
-rw-r--r--ndb/Makefile.am10
-rwxr-xr-xndb/config/make-win-dsw.sh42
-rwxr-xr-xndb/config/win-includes8
-rw-r--r--ndb/config/win-lib.am100
-rwxr-xr-xndb/config/win-libraries56
-rwxr-xr-xndb/config/win-name7
-rw-r--r--ndb/config/win-prg.am98
-rwxr-xr-xndb/config/win-sources8
-rw-r--r--ndb/docs/Makefile.am2
-rw-r--r--ndb/docs/wl2077.txt17
-rw-r--r--ndb/include/Makefile.am2
-rw-r--r--ndb/include/debugger/EventLogger.hpp4
-rw-r--r--ndb/include/debugger/GrepError.hpp8
-rw-r--r--ndb/include/kernel/LogLevel.hpp14
-rw-r--r--ndb/include/kernel/signaldata/CreateEvnt.hpp8
-rw-r--r--ndb/include/kernel/signaldata/FsCloseReq.hpp2
-rw-r--r--ndb/include/kernel/signaldata/PackedSignal.hpp2
-rw-r--r--ndb/include/kernel/signaldata/RepImpl.hpp12
-rw-r--r--ndb/include/kernel/signaldata/SumaImpl.hpp18
-rw-r--r--ndb/include/kernel/signaldata/UtilLock.hpp24
-rw-r--r--ndb/include/logger/Logger.hpp2
-rw-r--r--ndb/include/logger/SysLogHandler.hpp4
-rw-r--r--ndb/include/mgmapi/mgmapi.h23
-rw-r--r--ndb/include/mgmapi/mgmapi_config_parameters.h1
-rw-r--r--ndb/include/mgmcommon/IPCConfig.hpp2
-rw-r--r--ndb/include/ndb_global.h.in (renamed from ndb/include/ndb_global.h)62
-rw-r--r--ndb/include/ndb_types.h6
-rw-r--r--ndb/include/ndb_version.h.in (renamed from ndb/include/ndb_version.h)15
-rw-r--r--ndb/include/ndbapi/Ndb.hpp92
-rw-r--r--ndb/include/ndbapi/NdbConnection.hpp2
-rw-r--r--ndb/include/ndbapi/NdbDictionary.hpp9
-rw-r--r--ndb/include/ndbapi/ndb_cluster_connection.hpp31
-rw-r--r--ndb/include/portlib/NdbTCP.h2
-rw-r--r--ndb/include/portlib/PortDefs.h43
-rw-r--r--ndb/include/transporter/TransporterRegistry.hpp5
-rw-r--r--ndb/include/util/BaseString.hpp10
-rw-r--r--ndb/include/util/Parser.hpp6
-rw-r--r--ndb/include/util/SimpleProperties.hpp20
-rw-r--r--ndb/include/util/SocketServer.hpp2
-rw-r--r--ndb/include/util/ndb_opts.h59
-rw-r--r--ndb/src/Makefile.am15
-rw-r--r--ndb/src/common/Makefile.am2
-rw-r--r--ndb/src/common/debugger/EventLogger.cpp73
-rw-r--r--ndb/src/common/debugger/GrepError.cpp4
-rw-r--r--ndb/src/common/debugger/Makefile.am14
-rw-r--r--ndb/src/common/debugger/signaldata/DictTabInfo.cpp2
-rw-r--r--ndb/src/common/debugger/signaldata/FsCloseReq.cpp2
-rw-r--r--ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp2
-rw-r--r--ndb/src/common/debugger/signaldata/Makefile.am13
-rw-r--r--ndb/src/common/debugger/signaldata/NFCompleteRep.cpp2
-rw-r--r--ndb/src/common/logger/FileLogHandler.cpp10
-rw-r--r--ndb/src/common/logger/LogHandlerList.hpp1
-rw-r--r--ndb/src/common/logger/Logger.cpp27
-rw-r--r--ndb/src/common/logger/Makefile.am18
-rw-r--r--ndb/src/common/mgmcommon/ConfigRetriever.cpp7
-rw-r--r--ndb/src/common/mgmcommon/Makefile.am14
-rw-r--r--ndb/src/common/portlib/Makefile.am24
-rw-r--r--ndb/src/common/portlib/NdbConfig.c23
-rw-r--r--ndb/src/common/portlib/NdbTCP.cpp12
-rw-r--r--ndb/src/common/portlib/win32/NdbCondition.c178
-rw-r--r--ndb/src/common/portlib/win32/NdbDaemon.c44
-rw-r--r--ndb/src/common/portlib/win32/NdbEnv.c31
-rw-r--r--ndb/src/common/portlib/win32/NdbHost.c52
-rw-r--r--ndb/src/common/portlib/win32/NdbMem.c283
-rw-r--r--ndb/src/common/portlib/win32/NdbMutex.c73
-rw-r--r--ndb/src/common/portlib/win32/NdbSleep.c32
-rw-r--r--ndb/src/common/portlib/win32/NdbTCP.c39
-rw-r--r--ndb/src/common/portlib/win32/NdbThread.c114
-rw-r--r--ndb/src/common/portlib/win32/NdbTick.c64
-rw-r--r--ndb/src/common/transporter/Makefile.am14
-rw-r--r--ndb/src/common/transporter/SHM_Transporter.cpp85
-rw-r--r--ndb/src/common/transporter/SHM_Transporter.hpp33
-rw-r--r--ndb/src/common/transporter/Transporter.cpp2
-rw-r--r--ndb/src/common/transporter/TransporterRegistry.cpp411
-rw-r--r--ndb/src/common/util/File.cpp8
-rw-r--r--ndb/src/common/util/Makefile.am14
-rw-r--r--ndb/src/common/util/Properties.cpp2
-rw-r--r--ndb/src/common/util/SocketClient.cpp20
-rw-r--r--ndb/src/common/util/basestring_vsnprintf.c34
-rw-r--r--ndb/src/common/util/version.c47
-rw-r--r--ndb/src/cw/Makefile.am3
-rw-r--r--ndb/src/cw/cpcd/Makefile.am2
-rw-r--r--ndb/src/kernel/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/Makefile.am2
-rw-r--r--ndb/src/kernel/blocks/backup/Backup.cpp123
-rw-r--r--ndb/src/kernel/blocks/backup/Backup.hpp40
-rw-r--r--ndb/src/kernel/blocks/backup/BackupInit.cpp6
-rw-r--r--ndb/src/kernel/blocks/backup/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp27
-rw-r--r--ndb/src/kernel/blocks/cmvmi/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/dbacc/DbaccInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbacc/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/dbdict/Dbdict.cpp8
-rw-r--r--ndb/src/kernel/blocks/dbdict/Dbdict.hpp2
-rw-r--r--ndb/src/kernel/blocks/dbdict/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/dbdih/Dbdih.hpp2
-rw-r--r--ndb/src/kernel/blocks/dbdih/DbdihInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbdih/DbdihMain.cpp4
-rw-r--r--ndb/src/kernel/blocks/dbdih/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/dblqh/DblqhInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/dblqh/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/dbtc/DbtcInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbtc/DbtcMain.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbtc/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupGen.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbtup/Makefile.am14
-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/dbtux/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/dbutil/DbUtil.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbutil/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/grep/Grep.cpp36
-rw-r--r--ndb/src/kernel/blocks/grep/Grep.hpp8
-rw-r--r--ndb/src/kernel/blocks/grep/GrepInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/grep/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/ndbcntr/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp4
-rw-r--r--ndb/src/kernel/blocks/ndbfs/VoidFs.cpp2
-rw-r--r--ndb/src/kernel/blocks/qmgr/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/qmgr/QmgrInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/suma/Makefile.am14
-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/Makefile.am14
-rw-r--r--ndb/src/kernel/blocks/trix/Trix.cpp2
-rw-r--r--ndb/src/kernel/error/Makefile.am14
-rw-r--r--ndb/src/kernel/main.cpp20
-rw-r--r--ndb/src/kernel/vm/Callback.hpp7
-rw-r--r--ndb/src/kernel/vm/Configuration.cpp39
-rw-r--r--ndb/src/kernel/vm/Emulator.cpp4
-rw-r--r--ndb/src/kernel/vm/Makefile.am14
-rw-r--r--ndb/src/kernel/vm/Mutex.cpp53
-rw-r--r--ndb/src/kernel/vm/Mutex.hpp102
-rw-r--r--ndb/src/kernel/vm/SectionReader.cpp2
-rw-r--r--ndb/src/kernel/vm/SectionReader.hpp2
-rw-r--r--ndb/src/kernel/vm/SimplePropertiesSection.cpp4
-rw-r--r--ndb/src/kernel/vm/SimulatedBlock.cpp2
-rw-r--r--ndb/src/kernel/vm/SimulatedBlock.hpp71
-rw-r--r--ndb/src/mgmapi/Makefile.am14
-rw-r--r--ndb/src/mgmapi/mgmapi.cpp106
-rw-r--r--ndb/src/mgmapi/mgmapi_configuration.cpp3
-rw-r--r--ndb/src/mgmapi/mgmapi_configuration.hpp2
-rw-r--r--ndb/src/mgmclient/CommandInterpreter.cpp614
-rw-r--r--ndb/src/mgmclient/Makefile.am26
-rw-r--r--ndb/src/mgmclient/main.cpp6
-rw-r--r--ndb/src/mgmsrv/CommandInterpreter.cpp961
-rw-r--r--ndb/src/mgmsrv/CommandInterpreter.hpp85
-rw-r--r--ndb/src/mgmsrv/Config.cpp16
-rw-r--r--ndb/src/mgmsrv/ConfigInfo.cpp942
-rw-r--r--ndb/src/mgmsrv/ConfigInfo.hpp10
-rw-r--r--ndb/src/mgmsrv/InitConfigFileParser.cpp19
-rw-r--r--ndb/src/mgmsrv/Makefile.am18
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.cpp109
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.hpp29
-rw-r--r--ndb/src/mgmsrv/Services.cpp229
-rw-r--r--ndb/src/mgmsrv/Services.hpp2
-rw-r--r--ndb/src/mgmsrv/SignalQueue.hpp12
-rw-r--r--ndb/src/mgmsrv/main.cpp46
-rw-r--r--ndb/src/ndbapi/DictCache.cpp6
-rw-r--r--ndb/src/ndbapi/DictCache.hpp3
-rw-r--r--ndb/src/ndbapi/Makefile.am14
-rw-r--r--ndb/src/ndbapi/Ndb.cpp283
-rw-r--r--ndb/src/ndbapi/NdbBlob.cpp6
-rw-r--r--ndb/src/ndbapi/NdbConnection.cpp8
-rw-r--r--ndb/src/ndbapi/NdbDictionary.cpp8
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.cpp46
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.hpp4
-rw-r--r--ndb/src/ndbapi/NdbEventOperation.cpp2
-rw-r--r--ndb/src/ndbapi/NdbImpl.hpp106
-rw-r--r--ndb/src/ndbapi/NdbOperationExec.cpp6
-rw-r--r--ndb/src/ndbapi/NdbReceiver.cpp4
-rw-r--r--ndb/src/ndbapi/NdbScanFilter.cpp4
-rw-r--r--ndb/src/ndbapi/NdbScanOperation.cpp16
-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/ObjectMap.hpp2
-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.cpp604
-rw-r--r--ndb/src/ndbapi/ndb_cluster_connection_impl.hpp100
-rw-r--r--ndb/src/ndbapi/ndberror.c9
-rw-r--r--ndb/test/Makefile.am2
-rw-r--r--ndb/test/include/NdbSchemaOp.hpp2
-rw-r--r--ndb/test/ndbapi/Makefile.am61
-rw-r--r--ndb/test/ndbapi/bank/Makefile.am2
-rw-r--r--ndb/test/ndbapi/testDict.cpp6
-rw-r--r--ndb/test/ndbapi/testNdbApi.cpp8
-rw-r--r--ndb/test/ndbapi/testOperations.cpp2
-rw-r--r--ndb/test/run-test/Makefile.am2
-rw-r--r--ndb/test/src/CpcClient.cpp3
-rw-r--r--ndb/test/src/Makefile.am14
-rw-r--r--ndb/test/src/NdbBackup.cpp3
-rw-r--r--ndb/test/src/NdbRestarts.cpp2
-rw-r--r--ndb/test/src/getarg.c3
-rw-r--r--ndb/test/tools/Makefile.am2
-rw-r--r--ndb/tools/Makefile.am106
-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/restore/Restore.cpp20
-rw-r--r--ndb/tools/restore/Restore.hpp2
-rw-r--r--ndb/tools/restore/consumer_restore.cpp93
-rw-r--r--ndb/tools/restore/consumer_restore.hpp7
-rw-r--r--ndb/tools/restore/restore_main.cpp14
-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/regcomp.c21
-rw-r--r--scripts/fill_help_tables.sh16
-rw-r--r--scripts/make_win_src_distribution.sh14
-rw-r--r--scripts/mysql_fix_privilege_tables.sh7
-rw-r--r--scripts/mysql_install_db.sh2
-rw-r--r--sql/examples/ha_archive.cc3
-rw-r--r--sql/field.cc22
-rw-r--r--sql/ha_ndbcluster.cc63
-rw-r--r--sql/ha_ndbcluster.h2
-rw-r--r--sql/handler.cc6
-rw-r--r--sql/item.cc62
-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.cc21
-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.h21
-rw-r--r--sql/mysqld.cc50
-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/sql_acl.cc1
-rw-r--r--sql/sql_base.cc1
-rw-r--r--sql/sql_cache.cc3
-rw-r--r--sql/sql_class.cc6
-rw-r--r--sql/sql_class.h8
-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.cc45
-rw-r--r--sql/sql_lex.cc1
-rw-r--r--sql/sql_lex.h2
-rw-r--r--sql/sql_parse.cc112
-rw-r--r--sql/sql_prepare.cc26
-rw-r--r--sql/sql_repl.cc9
-rw-r--r--sql/sql_select.cc9
-rw-r--r--sql/sql_show.cc1
-rw-r--r--sql/sql_table.cc51
-rw-r--r--sql/sql_union.cc2
-rw-r--r--sql/sql_update.cc16
-rw-r--r--sql/sql_yacc.yy51
-rw-r--r--sql/strfunc.cc20
-rw-r--r--sql/table.cc26
-rw-r--r--sql/table.h10
-rw-r--r--sql/tztime.h6
-rw-r--r--sql/udf_example.cc13
-rw-r--r--sql/unireg.cc22
-rw-r--r--strings/ctype-ujis.c44
-rw-r--r--support-files/my-innodb-heavy-4G.cnf.sh2
-rw-r--r--tests/client_test.c148
395 files changed, 11778 insertions, 25504 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 107e4cadacf..a30791332a6 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -2,6 +2,7 @@ Administrador@light.
Administrator@co3064164-a.
Administrator@co3064164-a.rochd1.qld.optushome.com.au
Administrator@fred.
+Administrator@w2k.
Greg@greg-laptop.
Miguel@light.local
Sinisa@sinisa.nasamreza.org
@@ -108,6 +109,7 @@ magnus@neptunus.(none)
magnus@shellback.(none)
marko@hundin.mysql.fi
mats@mysql.com
+matt@booty.(none)
matt@mysql.com
matthias@three.local.lan
miguel@hegel.(none)
@@ -163,6 +165,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
@@ -202,6 +205,7 @@ serg@sergbook.mylan
serg@sergbook.mysql.com
sergefp@mysql.com
sinisa@rhols221.adsl.netsonic.fi
+stewart@mysql.com
tfr@beta.frontier86.ee
tfr@indrek.tfr.cafe.ee
tfr@sarvik.tfr.cafe.ee
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/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 bd4de026acb..97001d1a4f5 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/configure.in b/configure.in
index 5c16dd2063c..3a508ecba51 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/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"
@@ -2742,6 +2765,7 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl
ndb/test/ndbapi/bank/Makefile dnl
ndb/test/tools/Makefile dnl
ndb/test/run-test/Makefile mysql-test/ndb/Makefile dnl
+ ndb/include/ndb_version.h ndb/include/ndb_global.h dnl
)
fi
diff --git a/include/errmsg.h b/include/errmsg.h
index 6115b24a3d8..96977227666 100644
--- a/include/errmsg.h
+++ b/include/errmsg.h
@@ -90,3 +90,4 @@ extern const char *client_errors[]; /* Error messages */
#define CR_SECURE_AUTH 2049
#define CR_FETCH_CANCELED 2050
#define CR_NO_DATA 2051
+#define CR_NO_STMT_METADATA 2052
diff --git a/include/my_base.h b/include/my_base.h
index 4d043cf6b5b..15ddfdeb8b5 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -308,6 +308,7 @@ 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_NULL_IN_SPATIAL 158 /* NULLs are not supported in spatial index */
/* Other constants */
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..58bc0a3d938 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;
diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c
index c80f8346abf..143abe05cd7 100644
--- a/innobase/dict/dict0load.c
+++ b/innobase/dict/dict0load.c
@@ -766,6 +766,22 @@ dict_load_table(
return(NULL);
}
+#if MYSQL_VERSION_ID < 50300
+ /* 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/os/os0file.c b/innobase/os/os0file.c
index 1e3eeb0de02..006e6b431e8 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 */
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/libmysql/errmsg.c b/libmysql/errmsg.c
index 710bf4ccd8d..5fa94e5ff0d 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 4476a42f8ac..388e61fa8aa 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
@@ -2165,12 +2166,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.
@@ -3875,8 +3876,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;
@@ -4334,11 +4335,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);
}
/*
@@ -4623,7 +4623,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++)
@@ -4758,6 +4758,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/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index c432ac5a16c..ffc7e1bf104 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;
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_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_write.c b/myisam/mi_write.c
index c2f24ae1ae3..019c372a885 100644
--- a/myisam/mi_write.c
+++ b/myisam/mi_write.c
@@ -124,8 +124,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)
@@ -159,7 +159,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)
{
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/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/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 b69ba9702a6..dbc29a92123 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -344,6 +344,70 @@ 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 SELECT (c) ON `mysqltest_2`.`t1` 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'
+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.t1, 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_2.t1, mysqltest_1.t2 set c=20 where b=1;
+ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'c' in 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 column 'a' in table 't1'
+use mysqltest_2;
+update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200;
+ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1'
+update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200;
+ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1'
+update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200;
+ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1'
+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/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/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/merge.result b/mysql-test/r/merge.result
index a9d90813660..4b431101784 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..c5d1fc09082 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -464,6 +464,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_2myisam.result b/mysql-test/r/ps_2myisam.result
index d3882b51219..87cd0f3cd60 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;
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..c28a5ecd09a 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;
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..385ae38a506 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;
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.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..2b7170c4a85 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;
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.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/subselect.result b/mysql-test/r/subselect.result
index 931f3c3d71b..701bcf490eb 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
@@ -1495,7 +1495,65 @@ 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` < (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 test.t2.b)))
+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 test.t2.b)))
+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 +2097,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/timezone2.result b/mysql-test/r/timezone2.result
index e1aff266bac..203286d4908 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,50 @@ 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'
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'
+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')
+2004-12-01 09: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/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/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/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..77046e5111d 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,76 @@ 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.t1, mysqltest_2.t2 set d=20 where d=1;
+--error 1143
+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 1143
+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 1044
+update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200;
+--error 1044
+update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200;
+--error 1044
+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/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/merge.test b/mysql-test/t/merge.test
index 9d367260049..213a710215c 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..f8445425245 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -432,6 +432,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/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 8680da9b31a..9ba44f6eaa7 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/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..d185a647921 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
select * from mysql.time_zone_name;
--error 1044
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/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/Makefile.am b/ndb/Makefile.am
index 82f424fcfb4..32c821383e6 100644
--- a/ndb/Makefile.am
+++ b/ndb/Makefile.am
@@ -17,3 +17,13 @@ dist-hook:
done; \
fi; \
done
+
+windoze:
+ for i in `find . -name 'Makefile.am'`; do make -C `dirname $$i` windoze-dsp; done
+
+windoze-dsp:
+
+all-windoze-dsp: windoze
+ find . -name '*.dsp' | grep -v SCCS | xargs unix2dos
+ $(top_srcdir)/ndb/config/make-win-dsw.sh | unix2dos > ndb.dsw
+ tar cvfz ndb-win-dsp.tar.gz ndb.dsw `find . -name '*.dsp' | grep -v SCCS`
diff --git a/ndb/config/make-win-dsw.sh b/ndb/config/make-win-dsw.sh
new file mode 100755
index 00000000000..b0613620f8a
--- /dev/null
+++ b/ndb/config/make-win-dsw.sh
@@ -0,0 +1,42 @@
+
+cat <<EOF
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+EOF
+
+for i in `find . -name '*.dsp' | grep -v SCCS`
+do
+ name=`basename $i | sed 's/\.dsp//'`
+ cat<<EOF
+
+Project: "$name"="`echo $i | sed 's/\//\\\/g'`" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+EOF
+done
+
+cat<<EOF
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
+EOF
diff --git a/ndb/config/win-includes b/ndb/config/win-includes
new file mode 100755
index 00000000000..fa5984fd25e
--- /dev/null
+++ b/ndb/config/win-includes
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+dst=$1
+shift
+
+out=`echo $* | sed 's/-I\([^ ]*\)/\/I "\1"/g'`
+sed -e "s!@includes@!$out!g" $dst > /tmp/$dst.$$
+mv /tmp/$dst.$$ $dst
diff --git a/ndb/config/win-lib.am b/ndb/config/win-lib.am
new file mode 100644
index 00000000000..05ac1ec8a40
--- /dev/null
+++ b/ndb/config/win-lib.am
@@ -0,0 +1,100 @@
+# Microsoft Developer Studio Project File - Name="@name@" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=@name@ - 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 "@name@.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 "@name@.mak" CFG="@name@ - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "@name@ - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "@name@ - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=xicl6.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "@name@ - 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 Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "release"
+# PROP Intermediate_Dir "release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
+# ADD BASE CPP @includes@
+# ADD CPP @includes@
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:".\lib_release\@name@.lib"
+@release_libs@
+
+!ELSEIF "$(CFG)" == "@name@ - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# 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 Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
+# ADD BASE CPP @includes@
+# ADD CPP @includes@
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:".\lib_debug\@name@.lib"
+@debug_libs@
+
+!ENDIF
+
+# Begin Target
+
+# Name "@name@ - Win32 Release"
+# Name "@name@ - Win32 Debug"
+
+# Begin Group "Source Files"
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+
+@sources@
+
+# End Group
+
+# End Target
+# End Project
diff --git a/ndb/config/win-libraries b/ndb/config/win-libraries
new file mode 100755
index 00000000000..c7a6fb696ee
--- /dev/null
+++ b/ndb/config/win-libraries
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+dst=$1
+shift
+
+type=$1
+shift
+
+add_lib(){
+ echo `dirname $2`/$1/`basename $2 | sed "s/\.[l]*a/$3.lib/g"`
+}
+
+out_rel=
+out_deb=
+out_tls_rel=
+out_tls_deb=
+for i in $*
+do
+# mysql VC++ project files have for some unknown reason
+# choosen NOT to put libdbug.lib in $(topdir)./dbug but rather in $(topdir)
+# the same goes for mysys and strings
+ lib=$i
+ case $i in
+ *libdbug.a | *libmysys.a | *libmystrings.a)
+ lib=`echo $i | sed s'!dbug\/lib!!' | sed 's!mysys\/lib!!' | sed 's!strings\/libmy!!'`
+ echo "Changing from $i to $lib"
+ ;;
+ esac
+
+ if [ `echo $i | grep -c gcc` -eq 0 ]
+ then
+ out_rel="${out_rel} `add_lib lib_release $lib`"
+ out_deb="${out_deb} `add_lib lib_debug $lib`"
+ out_tls_rel="${out_tls_rel} `add_lib lib_release $lib _tls`"
+ out_tls_deb="${out_tls_deb} `add_lib lib_debug $lib _tls`"
+ fi
+done
+
+fix(){
+ echo "# ADD BASE ${type}32 $*\n# ADD ${type}32 $*\n"
+}
+
+if [ "$out_rel" ]
+then
+ out_rel=`fix $out_rel`
+ out_deb=`fix $out_deb`
+ out_tls_rel=`fix $out_tls_rel`
+ out_tls_deb=`fix $out_tls_deb`
+fi
+
+sed -e "s!@release_libs@!$out_rel!g" \
+ -e "s!@debug_libs@!$out_deb!g" \
+ -e "s!@tls_release_libs@!$out_tls_rel!g" \
+ -e "s!@tls_debug_libs@!$out_tls_deb!g" \
+ $dst > !tmp!$dst.$$
+mv !tmp!$dst.$$ $dst
diff --git a/ndb/config/win-name b/ndb/config/win-name
new file mode 100755
index 00000000000..036f2b9cc2e
--- /dev/null
+++ b/ndb/config/win-name
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+dst=$1
+shift
+
+sed -e "s/@name@/`echo $1 | sed 's/\.[l]*a//g'`/g" $dst > /tmp/$dst.$$
+mv /tmp/$dst.$$ $dst
diff --git a/ndb/config/win-prg.am b/ndb/config/win-prg.am
new file mode 100644
index 00000000000..10a8cfbca02
--- /dev/null
+++ b/ndb/config/win-prg.am
@@ -0,0 +1,98 @@
+# Microsoft Developer Studio Project File - Name="mysqld" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=@name@ - Win32 Release
+!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 "@name@.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 "@name@.mak" CFG="@name@ - Win32 Release"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "@name@ - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "@name@ - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=xicl6.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "@name@ - 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 Target_Dir ""
+# PROP Use_MFC 0
+# 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 /W3 /GX /O2 /D "NDB_WIN32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /D "NDB_WIN32" /I "../zlib" /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
+# ADD BASE CPP @includes@
+# ADD CPP @includes@
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x410 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+@release_libs@
+# 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 /nologo /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 Wsock32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"release/@name@-opt.exe"
+# SUBTRACT LINK32 /debug
+
+!ELSEIF "$(CFG)" == "@name@ - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# 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 Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "NDB_WIN32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /D "NDB_WIN32" /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
+# ADD BASE CPP @includes@
+# ADD CPP @includes@
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x410 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+@debug_libs@
+# 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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# 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 Wsock32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"debug/@name@.exe" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "@name@ - Win32 Release"
+# Name "@name@ - Win32 Debug"
+
+@sources@
+
+# End Target
+# End Project
diff --git a/ndb/config/win-sources b/ndb/config/win-sources
new file mode 100755
index 00000000000..a383bb0e613
--- /dev/null
+++ b/ndb/config/win-sources
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+dst=$1
+shift
+
+out=`echo $* | sed 's!\([^ ]*\)!# Begin Source File\\\nSOURCE=\1\\\n# End Source File\\\n!g'`
+sed -e "s!@sources@!$out!g" $dst > /tmp/$dst.$$
+mv /tmp/$dst.$$ $dst
diff --git a/ndb/docs/Makefile.am b/ndb/docs/Makefile.am
index 554b2fb256e..c7e344b3dee 100644
--- a/ndb/docs/Makefile.am
+++ b/ndb/docs/Makefile.am
@@ -100,3 +100,5 @@ odbcdoc: DUMMY
testdoc: DUMMY
mkdir -p $(OUTDIR)
cd $(top_srcdir)/ndb ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.test
+
+windoze-dsp:
diff --git a/ndb/docs/wl2077.txt b/ndb/docs/wl2077.txt
index f56d84c9ab9..f5b10bb702e 100644
--- a/ndb/docs/wl2077.txt
+++ b/ndb/docs/wl2077.txt
@@ -13,12 +13,14 @@ wl2077-read hold lock 4.6 (-1%) 6.7 (+ 0%)
5.0-ndb batch read committed f) 50' (+680%) g) 50' (+360%)
5.0-ndb batch read hold lock h) 12' (+160%) i) 13' (+79%)
-
--- Comparision e)
-serial pk: 10.9'
-batched (1000): 59'
-serial uniq index: 8.4'
-batched (1000): 33'
+shm-mem read committed (cmp. wl2077) a) 9.5' (+48%) b) 14' (+30%)
+ read hold lock c) 6.7' (+45%) d) 9.8' (+46%)
+
+-- Comparision e) shm
+serial pk: 10.9' 20' (+83%)
+batched (1000): 59' 62' (+5%)
+serial uniq index: 8.4' 14' (+66%)
+batched (1000): 33' 36' (+9%)
index range (1000): 186'
----
@@ -41,3 +43,6 @@ wl2077 12s 14s
wl2077 wo/ blobs 1.2s (-30%) 2.5s (-22%)
pekka-blob-fix 1.3s
+
+shm 1.2s 2.0s
+shm wo/ blobs 1.1s 2.0s
diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am
index 61f55cf9d61..b29433a59b7 100644
--- a/ndb/include/Makefile.am
+++ b/ndb/include/Makefile.am
@@ -42,3 +42,5 @@ portlib transporter util
dist-hook:
-rm -rf `find $(distdir) -type d -name SCCS`
+
+windoze-dsp:
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/debugger/GrepError.hpp b/ndb/include/debugger/GrepError.hpp
index ab6a7b272a5..beedbd95c80 100644
--- a/ndb/include/debugger/GrepError.hpp
+++ b/ndb/include/debugger/GrepError.hpp
@@ -24,8 +24,8 @@
*/
class GrepError {
public:
- enum Code {
- NO_ERROR = 0,
+ enum GE_Code {
+ GE_NO_ERROR = 0,
SUBSCRIPTION_ID_NOMEM = 1,
SUBSCRIPTION_ID_NOT_FOUND = 2,
SUBSCRIPTION_ID_NOT_UNIQUE = 3,
@@ -82,12 +82,12 @@ public:
};
struct ErrorDescription {
- Code errCode;
+ GE_Code errCode;
const char * name;
};
static const ErrorDescription errorDescriptions[];
static const Uint32 noOfErrorDescs;
- static const char * getErrorDesc(GrepError::Code err);
+ static const char * getErrorDesc(GrepError::GE_Code err);
};
diff --git a/ndb/include/kernel/LogLevel.hpp b/ndb/include/kernel/LogLevel.hpp
index 467f0604edd..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
@@ -89,7 +89,7 @@ public:
return memcmp(this, &l, sizeof(* this)) == 0;
}
- LogLevel& operator=(const class EventSubscribeReq & req);
+ LogLevel& operator=(const struct EventSubscribeReq & req);
private:
/**
@@ -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/FsCloseReq.hpp b/ndb/include/kernel/signaldata/FsCloseReq.hpp
index c42afa143e6..10d094fb30b 100644
--- a/ndb/include/kernel/signaldata/FsCloseReq.hpp
+++ b/ndb/include/kernel/signaldata/FsCloseReq.hpp
@@ -75,7 +75,7 @@ inline
void
FsCloseReq::setRemoveFileFlag(UintR & fileflag, bool removefile){
// ASSERT_BOOL(removefile, "FsCloseReq::setRemoveFileFlag");
- if (removefile == true)
+ if (removefile)
fileflag = 1;
else
fileflag = 0;
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/RepImpl.hpp b/ndb/include/kernel/signaldata/RepImpl.hpp
index affffe46f9c..0de1389a4a9 100644
--- a/ndb/include/kernel/signaldata/RepImpl.hpp
+++ b/ndb/include/kernel/signaldata/RepImpl.hpp
@@ -93,7 +93,7 @@ public:
Uint32 subscriptionId;
Uint32 subscriptionKey;
Uint32 senderNodeId;
- GrepError::Code err;
+ GrepError::GE_Code err;
};
class RepGetGciReq
@@ -151,7 +151,7 @@ public:
Uint32 lastPSGCI;
Uint32 firstSSGCI;
Uint32 lastSSGCI;
- GrepError::Code err;
+ GrepError::GE_Code err;
};
class RepGetGciBufferReq {
@@ -213,7 +213,7 @@ public:
Uint32 lastSSGCI;
Uint32 currentGCIBuffer;
Uint32 nodeGrp;
- GrepError::Code err;
+ GrepError::GE_Code err;
};
class RepInsertGciBufferReq
@@ -252,7 +252,7 @@ public:
Uint32 nodeGrp;
Uint32 tableId;
Uint32 force;
- GrepError::Code err;
+ GrepError::GE_Code err;
};
class RepInsertGciBufferConf
@@ -310,7 +310,7 @@ public:
Uint32 lastGCI;
Uint32 currentGCI;
Uint32 nodeGrp;
- GrepError::Code err;
+ GrepError::GE_Code err;
};
class RepClearPSGciBufferConf
@@ -367,7 +367,7 @@ public:
Uint32 lastGCI;
Uint32 currentGCI;
Uint32 nodeGrp;
- GrepError::Code err;
+ GrepError::GE_Code err;
};
class RepClearSSGciBufferConf
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/kernel/signaldata/UtilLock.hpp b/ndb/include/kernel/signaldata/UtilLock.hpp
index 1cac467daa0..318024fd706 100644
--- a/ndb/include/kernel/signaldata/UtilLock.hpp
+++ b/ndb/include/kernel/signaldata/UtilLock.hpp
@@ -39,7 +39,7 @@ public:
enum RequestInfo {
TryLock = 1
};
-private:
+public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@@ -63,7 +63,7 @@ class UtilLockConf {
public:
STATIC_CONST( SignalLength = 4 );
-private:
+public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@@ -95,7 +95,7 @@ public:
LockAlreadyHeld = 4
};
-private:
+public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@@ -119,7 +119,7 @@ class UtilUnlockReq {
public:
STATIC_CONST( SignalLength = 4 );
-private:
+public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@@ -143,7 +143,7 @@ class UtilUnlockConf {
public:
STATIC_CONST( SignalLength = 3 );
-private:
+public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@@ -171,7 +171,7 @@ public:
NoSuchLock = 1,
NotLockOwner = 2
};
-private:
+public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@@ -200,7 +200,7 @@ public:
STATIC_CONST( SignalLength = 4 );
-private:
+public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@@ -229,7 +229,7 @@ public:
STATIC_CONST( SignalLength = 4 );
-private:
+public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@@ -251,7 +251,7 @@ class UtilCreateLockConf {
public:
STATIC_CONST( SignalLength = 3 );
-private:
+public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@@ -275,7 +275,7 @@ class UtilDestroyLockReq {
public:
STATIC_CONST( SignalLength = 4 );
-private:
+public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@@ -303,7 +303,7 @@ public:
STATIC_CONST( SignalLength = 4 );
-private:
+public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@@ -325,7 +325,7 @@ class UtilDestroyLockConf {
public:
STATIC_CONST( SignalLength = 3 );
-private:
+public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
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/logger/SysLogHandler.hpp b/ndb/include/logger/SysLogHandler.hpp
index 4f13308d61b..0dfc1cb2d43 100644
--- a/ndb/include/logger/SysLogHandler.hpp
+++ b/ndb/include/logger/SysLogHandler.hpp
@@ -18,7 +18,9 @@
#define SYSLOGHANDLER_H
#include "LogHandler.hpp"
+#ifndef NDB_WIN32
#include <syslog.h>
+#endif
/**
* Logs messages to syslog. The default identity is 'NDB'.
@@ -62,7 +64,7 @@ public:
* @param pIdentity a syslog identity.
* @param facility syslog facility, defaults to LOG_USER
*/
- SysLogHandler(const char* pIdentity, int facility = LOG_USER);
+ SysLogHandler(const char* pIdentity, int facility);
/**
* Destructor.
diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h
index dc4f745adb2..3d4a34d6488 100644
--- a/ndb/include/mgmapi/mgmapi.h
+++ b/ndb/include/mgmapi/mgmapi.h
@@ -49,6 +49,7 @@
* @{
*/
+#include <ndb_types.h>
#include "mgmapi_config_parameters.h"
#ifdef __cplusplus
@@ -244,7 +245,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 +267,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 */
};
/**
@@ -580,11 +584,13 @@ 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);
/**
@@ -620,6 +626,11 @@ extern "C" {
int level,
struct ndb_mgm_reply* reply);
+ ndb_mgm_clusterlog_level
+ ndb_mgm_match_clusterlog_level(const char * name);
+ const char *
+ ndb_mgm_get_clusterlog_level_string(enum ndb_mgm_clusterlog_level level);
+
/**
* Set log category and levels for the Node
*
@@ -656,11 +667,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);
/**
@@ -743,7 +758,7 @@ extern "C" {
int ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator*,
int param, unsigned * value);
int ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator*,
- int param, unsigned long long * value);
+ int param, Uint64 * value);
int ndb_mgm_get_string_parameter(const ndb_mgm_configuration_iterator*,
int param, const char ** value);
int ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **);
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/mgmcommon/IPCConfig.hpp b/ndb/include/mgmcommon/IPCConfig.hpp
index ebe65b53b59..1e23cdf9807 100644
--- a/ndb/include/mgmcommon/IPCConfig.hpp
+++ b/ndb/include/mgmcommon/IPCConfig.hpp
@@ -59,7 +59,7 @@ public:
void print() const { props->print(); }
static Uint32 configureTransporters(Uint32 nodeId,
- const class ndb_mgm_configuration &,
+ const struct ndb_mgm_configuration &,
class TransporterRegistry &);
private:
diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h.in
index bdd4e503cc5..aefb319730c 100644
--- a/ndb/include/ndb_global.h
+++ b/ndb/include/ndb_global.h.in
@@ -2,34 +2,51 @@
#ifndef NDBGLOBAL_H
#define NDBGLOBAL_H
-#include <my_global.h>
+#include <ndb_types.h>
-/** signal & SIG_PIPE */
-#include <my_alarm.h>
+#define NDB_PORT "@ndb_port@"
+#define NDB_TCP_BASE_PORT "@ndb_port_base@"
#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32)
#define NDB_WIN32
+#include <winsock2.h>
+#define PATH_MAX 256
+#define DIR_SEPARATOR "\\"
+#define MYSQLCLUSTERDIR "c:\\mysql\\mysql-cluster"
+#define HAVE_STRCASECMP
+#define strcasecmp _strcmpi
+#pragma warning(disable: 4503 4786)
#else
#undef NDB_WIN32
+#define DIR_SEPARATOR "/"
#endif
+#include <my_global.h>
+#include <my_alarm.h>
+
#ifdef _AIX
#undef _H_STRINGS
#endif
#include <m_string.h>
#include <m_ctype.h>
-#include <ndb_types.h>
#include <ctype.h>
+
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
+
#ifdef TIME_WITH_SYS_TIME
#include <time.h>
#endif
+
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
+
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
+#endif
+
#ifdef HAVE_SYS_STAT_H
#if defined(__cplusplus) && defined(_APP32_64BIT_OFF_T) && defined(_INCLUDE_AES_SOURCE)
#undef _INCLUDE_AES_SOURCE
@@ -39,31 +56,31 @@
#include <sys/stat.h>
#endif
#endif
+
+#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
+#endif
+
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
+
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
-#ifdef NDB_WIN32
-#include <winsock2.h>
-#include <ws2tcpip.h>
-
-#define DIR_SEPARATOR "\\"
-#define PATH_MAX 256
-
-#pragma warning(disable: 4503 4786)
-#else
-
-#define DIR_SEPARATOR "/"
+#ifndef HAVE_STRDUP
+extern char * strdup(const char *s);
+#endif
+#ifndef HAVE_STRCASECMP
+extern int strcasecmp(const char *s1, const char *s2);
+extern int strncasecmp(const char *s1, const char *s2, size_t n);
#endif
static const char table_name_separator = '/';
-#if defined(_AIX) || defined(NDB_VC98)
+#if defined(_AIX) || defined(WIN32) || defined(NDB_VC98)
#define STATIC_CONST(x) enum { x }
#else
#define STATIC_CONST(x) static const Uint32 x
@@ -84,13 +101,8 @@ extern int ndb_init(void);
extern void ndb_end(int);
#define NDB_INIT(prog_name) {my_progname=(prog_name); ndb_init();}
-#ifndef HAVE_STRDUP
-extern char * strdup(const char *s);
-#endif
-
-#ifndef HAVE_STRCASECMP
-extern int strcasecmp(const char *s1, const char *s2);
-extern int strncasecmp(const char *s1, const char *s2, size_t n);
+#ifdef __cplusplus
+}
#endif
#ifdef SCO
@@ -101,8 +113,4 @@ extern int strncasecmp(const char *s1, const char *s2, size_t n);
#endif /* SCO */
-#ifdef __cplusplus
-}
-#endif
-
#endif
diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h
index 64b3f517934..0d603cc2ab3 100644
--- a/ndb/include/ndb_types.h
+++ b/ndb/include/ndb_types.h
@@ -40,15 +40,21 @@ typedef __SIZE_TYPE__ UintPtr;
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
+#if defined(WIN32) || defined(NDB_WIN32)
+typedef Uint32 UintPtr;
+#else
typedef uintptr_t UintPtr;
#endif
+#endif
#if defined(WIN32) || defined(NDB_WIN32)
typedef unsigned __int64 Uint64;
typedef signed __int64 Int64;
+typedef UintPtr ssize_t;
#else
typedef unsigned long long Uint64;
typedef signed long long Int64;
#endif
+
#endif
diff --git a/ndb/include/ndb_version.h b/ndb/include/ndb_version.h.in
index 56362020ebf..d7f43eae40a 100644
--- a/ndb/include/ndb_version.h
+++ b/ndb/include/ndb_version.h.in
@@ -20,14 +20,25 @@
#include <ndb_global.h>
#include <version.h>
+/* NDB build version */
+#define NDB_VERSION_BUILD @NDB_VERSION_BUILD@
+
+/* NDB major version */
+#define NDB_VERSION_MAJOR @NDB_VERSION_MAJOR@
+
+/* NDB minor version */
+#define NDB_VERSION_MINOR @NDB_VERSION_MINOR@
+
+/* NDB status version */
+#define NDB_VERSION_STATUS "@NDB_VERSION_STATUS@"
+
+
#define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0))
#define NDB_VERSION_D MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD)
#define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS))
-#define NDB_VERSION_TAG_STRING "$Name: $"
-
#define NDB_VERSION ndbGetOwnVersion()
/**
diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp
index 5ec09269695..766409d64e2 100644
--- a/ndb/include/ndbapi/Ndb.hpp
+++ b/ndb/include/ndbapi/Ndb.hpp
@@ -901,23 +901,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.
@@ -1199,39 +1182,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 NdbConnection, or NULL if it failed.
- */
- NdbConnection* startTransactionDGroup(Uint32 aPrio,
- const char * keyData, int type);
-#endif
-
/**
* When a transactions is completed, the transaction has to be closed.
*
@@ -1586,9 +1536,6 @@ private:
/******************************************************************************
* These are the private variables in this class.
*****************************************************************************/
- NdbObjectIdMap* theNdbObjectIdMap;
- Ndb_cluster_connection *m_ndb_cluster_connection;
-
NdbConnection** thePreparedTransactionsArray;
NdbConnection** theSentTransactionsArray;
NdbConnection** theCompletedTransactionsArray;
@@ -1602,8 +1549,6 @@ private:
Uint32 theNextConnectNode;
- NdbWaiter theWaiter;
-
bool fullyQualifiedNames;
// Ndb database name.
@@ -1637,10 +1582,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;
@@ -1663,39 +1604,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/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp
index f0f44170ed7..3ae5690e104 100644
--- a/ndb/include/ndbapi/NdbConnection.hpp
+++ b/ndb/include/ndbapi/NdbConnection.hpp
@@ -50,7 +50,7 @@ enum AbortOption {
TryCommit = 0, ///< <i>Missing explanation</i>
#endif
AbortOnError = 0, ///< Abort transaction on failed operation
- IgnoreError = 2 ///< Transaction continues on failed operation
+ AO_IgnoreError = 2 ///< Transaction continues on failed operation
};
typedef AbortOption CommitType;
diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp
index 4acca0f3d96..1ee200890ef 100644
--- a/ndb/include/ndbapi/NdbDictionary.hpp
+++ b/ndb/include/ndbapi/NdbDictionary.hpp
@@ -700,7 +700,7 @@ public:
/**
* Get a specific column in the index
*/
- const NdbDictionary::Column * getColumn(unsigned no) const ;
+ const Column * getColumn(unsigned no) const ;
/**
* Get a specific column name in the index
@@ -972,13 +972,6 @@ public:
*/
const Table * getTable(const char * name);
- /**
- * Get table with given name for alteration.
- * @param name Name of table to alter
- * @return table if successful. NULL if undefined
- */
- Table getTableForAlteration(const char * name);
-
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/**
* Invalidate cached table object
diff --git a/ndb/include/ndbapi/ndb_cluster_connection.hpp b/ndb/include/ndbapi/ndb_cluster_connection.hpp
index 6fa25caf5d0..1b1c8575656 100644
--- a/ndb/include/ndbapi/ndb_cluster_connection.hpp
+++ b/ndb/include/ndbapi/ndb_cluster_connection.hpp
@@ -18,13 +18,7 @@
#ifndef CLUSTER_CONNECTION_HPP
#define CLUSTER_CONNECTION_HPP
-class TransporterFacade;
-class ConfigRetriever;
-class NdbThread;
-
-extern "C" {
- void* run_ndb_cluster_connection_connect_thread(void*);
-}
+struct Ndb_cluster_connection_node_iter;
class Ndb_cluster_connection {
public:
@@ -32,16 +26,27 @@ public:
~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/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h
index 4dc8435eef1..8138a2ef354 100644
--- a/ndb/include/portlib/NdbTCP.h
+++ b/ndb/include/portlib/NdbTCP.h
@@ -40,7 +40,7 @@ typedef int socklen_t;
#define InetErrno (* inet_errno())
-#elif NDB_WIN32
+#elif defined NDB_WIN32
/**
* Include files needed
diff --git a/ndb/include/portlib/PortDefs.h b/ndb/include/portlib/PortDefs.h
index b61bb627e65..a115c60cfe1 100644
--- a/ndb/include/portlib/PortDefs.h
+++ b/ndb/include/portlib/PortDefs.h
@@ -22,55 +22,12 @@
$Id: PortDefs.h,v 1.5 2003/10/07 07:59:59 mikael Exp $
*/
-#ifdef NDB_WIN32
-#include <time.h>
-
-
-struct tms
-{
- time_t tms_utime; /* user time */
- time_t tms_stime; /* system time */
- time_t tms_cutime; /* user time of children */
- time_t tms_cstime; /* system time of children */
-};
-
-struct timespec
-{
- long tv_sec; /* Seconds */
- long tv_nsec; /* Nanoseconds */
-};
-
-#define strcasecmp(a,b) _strcmpi(a,b)
-
-/* Exports a WIN32 getopt function */
-extern int optind;
-extern char *optarg;
-int getopt(int, char **, char *opts);
-#endif /* NDB_WIN32 */
#ifdef NDB_ALPHA
#ifdef NDB_GCC /* only for NDB_ALPHA */
extern int gnuShouldNotUseRPCC();
#define RPCC() gnuShouldNotUseRPCC();
#else
-#ifdef NDB_WIN32
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
- u_int64 __asm(char *, ...);
- double __dasm(char *, ...);
- float __fasm(char *, ...);
- void _AcquireSpinLock(long *);
- void _ReleaseSpinLock(long *);
- int __ADD_ATOMIC_LONG2(void *, int);
-#ifdef __cplusplus
-};
-#endif /* __cplusplus */
-#pragma intrinsic (__asm, __dasm, __fasm)
-#pragma intrinsic(_ReleaseSpinLock, _AcquireSpinLock)
-#pragma intrinsic(__ADD_ATOMIC_LONG2)
-#endif /* NDB_WIN32 */
-
#define RPCC() ((int)__asm(" rpcc v0;"))
#define MB() __asm(" mb;");
#define WMB() __asm(" wmb;");
diff --git a/ndb/include/transporter/TransporterRegistry.hpp b/ndb/include/transporter/TransporterRegistry.hpp
index ac6291f9e57..96da7eef2cb 100644
--- a/ndb/include/transporter/TransporterRegistry.hpp
+++ b/ndb/include/transporter/TransporterRegistry.hpp
@@ -87,6 +87,7 @@ public:
*/
class TransporterRegistry {
friend class OSE_Receiver;
+ friend class SHM_Transporter;
friend class Transporter;
friend class TransporterService;
public:
@@ -224,7 +225,7 @@ public:
const char *m_interface;
};
Vector<Transporter_interface> m_transporter_interface;
- void add_transporter_interface(const char *interface, unsigned short port);
+ void add_transporter_interface(const char *interf, unsigned short port);
protected:
private:
@@ -312,6 +313,8 @@ private:
Uint32 poll_TCP(Uint32 timeOutMillis);
Uint32 poll_SCI(Uint32 timeOutMillis);
Uint32 poll_SHM(Uint32 timeOutMillis);
+
+ int m_shm_own_pid;
};
#endif // Define of TransporterRegistry_H
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/Parser.hpp b/ndb/include/util/Parser.hpp
index 65cf24db633..c117498e1ba 100644
--- a/ndb/include/util/Parser.hpp
+++ b/ndb/include/util/Parser.hpp
@@ -23,7 +23,7 @@
#include "NdbOut.hpp"
class ParserImpl;
-template<class T> class ParserRow;
+template<class T> struct ParserRow;
//#define PARSER_DEBUG
#ifdef PARSER_DEBUG
@@ -130,11 +130,11 @@ public:
* The void* equivalent implementation
*/
class ParserImpl {
+public:
class Dummy {};
typedef ParserRow<Dummy> DummyRow;
typedef Parser<Dummy>::Context Context;
- template<class T> friend class Parser;
-private:
+
ParserImpl(const DummyRow rows[], class InputStream & in,
bool b_cmd, bool b_empty, bool b_iarg);
diff --git a/ndb/include/util/SimpleProperties.hpp b/ndb/include/util/SimpleProperties.hpp
index d5ebb16bb09..356f3406f38 100644
--- a/ndb/include/util/SimpleProperties.hpp
+++ b/ndb/include/util/SimpleProperties.hpp
@@ -38,20 +38,20 @@ public:
/**
* Value types
*/
- enum ValueType {
+ enum ValueType {
Uint32Value = 0,
StringValue = 1,
BinaryValue = 2,
InvalidValue = 3
- };
-
+ };
+
/**
* Struct for defining mapping to be used with unpack
*/
struct SP2StructMapping {
Uint16 Key;
Uint32 Offset;
- SimpleProperties::ValueType Type;
+ ValueType Type;
Uint32 minValue;
Uint32 maxValue;
Uint32 Length_Offset; // Offset used for looking up length of
@@ -233,7 +233,7 @@ private:
*/
class SimplePropertiesSectionReader : public SimpleProperties::Reader {
public:
- SimplePropertiesSectionReader(class SegmentedSectionPtr &,
+ SimplePropertiesSectionReader(struct SegmentedSectionPtr &,
class SectionSegmentPool &);
virtual void reset();
@@ -248,8 +248,8 @@ private:
Uint32 m_pos;
Uint32 m_len;
class SectionSegmentPool & m_pool;
- class SectionSegment * m_head;
- class SectionSegment * m_currentSegment;
+ struct SectionSegment * m_head;
+ struct SectionSegment * m_currentSegment;
};
inline
@@ -275,15 +275,15 @@ public:
/**
* This "unlinks" the writer from the memory
*/
- void getPtr(class SegmentedSectionPtr & dst);
+ void getPtr(struct SegmentedSectionPtr & dst);
private:
Int32 m_pos;
Uint32 m_sz;
class SectionSegmentPool & m_pool;
- class SectionSegment * m_head;
+ struct SectionSegment * m_head;
Uint32 m_prevPtrI; // Prev to m_currentSegment
- class SectionSegment * m_currentSegment;
+ struct SectionSegment * m_currentSegment;
};
#endif
diff --git a/ndb/include/util/SocketServer.hpp b/ndb/include/util/SocketServer.hpp
index 2fad991e5f8..9d8af204391 100644
--- a/ndb/include/util/SocketServer.hpp
+++ b/ndb/include/util/SocketServer.hpp
@@ -98,7 +98,7 @@ public:
*/
void stopSessions(bool wait = false);
- void foreachSession(void (*f)(SocketServer::Session*, void*), void *data);
+ void foreachSession(void (*f)(Session*, void*), void *data);
private:
struct SessionInstance {
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/Makefile.am b/ndb/src/Makefile.am
index 36a4c3f247f..eb1cf1c6543 100644
--- a/ndb/src/Makefile.am
+++ b/ndb/src/Makefile.am
@@ -16,3 +16,18 @@ libndbclient_la_LIBADD = \
common/logger/liblogger.la \
common/portlib/libportlib.la \
common/util/libgeneral.la
+
+windoze-dsp: libndbclient.dsp
+
+libndbclient.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(ndblib_LTLIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ dummy.cpp
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(libndbclient_la_LIBADD)
+ @touch dummy.cpp
diff --git a/ndb/src/common/Makefile.am b/ndb/src/common/Makefile.am
index 8733205eca2..0059f3fb210 100644
--- a/ndb/src/common/Makefile.am
+++ b/ndb/src/common/Makefile.am
@@ -11,3 +11,5 @@ libcommon_la_LIBADD = \
portlib/libportlib.la \
logger/liblogger.la \
util/libgeneral.la
+
+windoze-dsp:
diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp
index 59be0affcb4..97945394690 100644
--- a/ndb/src/common/debugger/EventLogger.cpp
+++ b/ndb/src/common/debugger/EventLogger.cpp
@@ -1033,7 +1033,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
"Grep::SSCoord:Error code: %d Error message: %s"
" (subId=%d,SubKey=%d)",
err,
- GrepError::getErrorDesc((GrepError::Code)err),
+ GrepError::getErrorDesc((GrepError::GE_Code)err),
subId,
subKey);
break;
@@ -1050,7 +1050,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
- GrepError::getErrorDesc((GrepError::Code)err));
+ GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubStartMetaRef:
@@ -1066,7 +1066,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
- GrepError::getErrorDesc((GrepError::Code)err));
+ GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubStartDataRef:
@@ -1081,7 +1081,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
- GrepError::getErrorDesc((GrepError::Code)err));
+ GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubSyncMetaRef:
@@ -1096,7 +1096,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
- GrepError::getErrorDesc((GrepError::Code)err));
+ GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubSyncDataRef:
@@ -1113,7 +1113,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subKey,
gci,
err,
- GrepError::getErrorDesc((GrepError::Code)err));
+ GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubRemoveRef:
@@ -1128,7 +1128,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
- GrepError::getErrorDesc((GrepError::Code)err)
+ GrepError::getErrorDesc((GrepError::GE_Code)err)
);
break;
}
@@ -1142,7 +1142,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
"Grep::PSCoord: Error code: %d Error Message: %s"
" (subId=%d,SubKey=%d)",
err,
- GrepError::getErrorDesc((GrepError::Code)err),
+ GrepError::getErrorDesc((GrepError::GE_Code)err),
subId,
subKey);
break;
@@ -1159,7 +1159,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
- GrepError::getErrorDesc((GrepError::Code)err));
+ GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubStartMetaRef:
@@ -1175,7 +1175,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
- GrepError::getErrorDesc((GrepError::Code)err));
+ GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubStartDataRef:
@@ -1190,7 +1190,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
- GrepError::getErrorDesc((GrepError::Code)err));
+ GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubSyncMetaRef:
@@ -1205,7 +1205,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
- GrepError::getErrorDesc((GrepError::Code)err));
+ GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubSyncDataRef:
@@ -1222,7 +1222,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subKey,
gci,
err,
- GrepError::getErrorDesc((GrepError::Code)err));
+ GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubRemoveRef:
@@ -1237,7 +1237,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
- GrepError::getErrorDesc((GrepError::Code)err));
+ GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::Rep_Disconnect:
@@ -1249,7 +1249,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
" Error code: %d Error Message: %s",
nodeId,
err,
- GrepError::getErrorDesc((GrepError::Code)err));
+ GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
@@ -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/GrepError.cpp b/ndb/src/common/debugger/GrepError.cpp
index ec0c26a5855..20aeaa6dd77 100644
--- a/ndb/src/common/debugger/GrepError.cpp
+++ b/ndb/src/common/debugger/GrepError.cpp
@@ -21,7 +21,7 @@
*/
const GrepError::ErrorDescription GrepError::errorDescriptions[] = {
- { GrepError::NO_ERROR,
+ { GrepError::GE_NO_ERROR,
"No error" },
{ GrepError::SUBSCRIPTION_ID_NOMEM,
"Not enough resources to allocate the subscription" },
@@ -119,7 +119,7 @@ GrepError::noOfErrorDescs = sizeof(GrepError::errorDescriptions) /
* gets the corresponding error message to an err code
*/
const char *
-GrepError::getErrorDesc(GrepError::Code err) {
+GrepError::getErrorDesc(GrepError::GE_Code err) {
for(Uint32 i = 0; i<noOfErrorDescs; i++){
if(err == errorDescriptions[i].errCode){
diff --git a/ndb/src/common/debugger/Makefile.am b/ndb/src/common/debugger/Makefile.am
index d0fb30717cd..e25a11c9bee 100644
--- a/ndb/src/common/debugger/Makefile.am
+++ b/ndb/src/common/debugger/Makefile.am
@@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libtrace.dsp
+
+libtrace.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libtrace_la_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/common/debugger/signaldata/DictTabInfo.cpp b/ndb/src/common/debugger/signaldata/DictTabInfo.cpp
index 7e7bf87e2db..c6165532ddb 100644
--- a/ndb/src/common/debugger/signaldata/DictTabInfo.cpp
+++ b/ndb/src/common/debugger/signaldata/DictTabInfo.cpp
@@ -152,4 +152,4 @@ DictTabInfo::Attribute::init(){
AttributeExtLength = 0,
AttributeAutoIncrement = false;
memset(AttributeDefaultValue, 0, sizeof(AttributeDefaultValue));//AttributeDefaultValue[0] = 0;
-};
+}
diff --git a/ndb/src/common/debugger/signaldata/FsCloseReq.cpp b/ndb/src/common/debugger/signaldata/FsCloseReq.cpp
index 143250b7db1..df9f3cc9fbc 100644
--- a/ndb/src/common/debugger/signaldata/FsCloseReq.cpp
+++ b/ndb/src/common/debugger/signaldata/FsCloseReq.cpp
@@ -31,7 +31,7 @@ printFSCLOSEREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiv
sig->userReference);
fprintf(output, " Flags: H\'%.8x, ", sig->fileFlag);
- if (sig->getRemoveFileFlag(sig->fileFlag) == true)
+ if (sig->getRemoveFileFlag(sig->fileFlag))
fprintf(output, "Remove file");
else
fprintf(output, "Don't remove file");
diff --git a/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp b/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp
index 9b32fab87ba..a9f240d3cb4 100644
--- a/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp
+++ b/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp
@@ -31,7 +31,7 @@ printFSREADWRITEREQ(FILE * output, const Uint32 * theData,
fprintf(output, " UserReference: H\'%.8x", sig->userReference);
fprintf(output, " Operation flag: H\'%.8x (", sig->operationFlag);
- if (sig->getSyncFlag(sig->operationFlag) == true)
+ if (sig->getSyncFlag(sig->operationFlag))
fprintf(output, "Sync,");
else
fprintf(output, "No sync,");
diff --git a/ndb/src/common/debugger/signaldata/Makefile.am b/ndb/src/common/debugger/signaldata/Makefile.am
index c855c5f8a18..9146d552568 100644
--- a/ndb/src/common/debugger/signaldata/Makefile.am
+++ b/ndb/src/common/debugger/signaldata/Makefile.am
@@ -32,3 +32,16 @@ include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+windoze-dsp: libsignaldataprint.dsp
+
+libsignaldataprint.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libsignaldataprint_la_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
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 29172ff93ad..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) {
@@ -206,15 +206,15 @@ FileLogHandler::setMaxSize(const BaseString &size) {
long val = strtol(size.c_str(), &end, 0); /* XXX */
if(size.c_str() == end)
return false;
- if(strncasecmp("M", end, 1) == 0)
+ if(end[0] == 'M')
val *= 1024*1024;
- if(strncasecmp("k", end, 1) == 0)
+ if(end[0] == 'k')
val *= 1024;
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/LogHandlerList.hpp b/ndb/src/common/logger/LogHandlerList.hpp
index 7c001a28a76..21344023560 100644
--- a/ndb/src/common/logger/LogHandlerList.hpp
+++ b/ndb/src/common/logger/LogHandlerList.hpp
@@ -18,6 +18,7 @@
#define LOGHANDLERLIST_H
class LogHandler;
+#include <ndb_global.h>
/**
* Provides a simple linked list of log handlers.
diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp
index f6f70fbeff7..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()
@@ -186,13 +188,17 @@ Logger::addHandler(const BaseString &logstring) {
LogHandler *handler = NULL;
- if(type == "SYSLOG") {
+#ifndef NDB_WIN32
+ if(type == "SYSLOG")
+ {
handler = new SysLogHandler();
- } else if(type == "FILE")
+ } else
+#endif
+ if(type == "FILE")
handler = new FileLogHandler();
else if(type == "CONSOLE")
handler = new ConsoleLogHandler();
-
+
if(handler == NULL)
DBUG_RETURN(false);
if(!handler->parseParams(params))
@@ -227,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];
}
@@ -235,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;
}
@@ -337,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/logger/Makefile.am b/ndb/src/common/logger/Makefile.am
index 0a48214c37c..0af21f9fbde 100644
--- a/ndb/src/common/logger/Makefile.am
+++ b/ndb/src/common/logger/Makefile.am
@@ -1,11 +1,25 @@
noinst_LTLIBRARIES = liblogger.la
-liblogger_la_SOURCES = Logger.cpp LogHandlerList.cpp LogHandler.cpp \
- ConsoleLogHandler.cpp FileLogHandler.cpp SysLogHandler.cpp
+SOURCE_WIN = Logger.cpp LogHandlerList.cpp LogHandler.cpp \
+ ConsoleLogHandler.cpp FileLogHandler.cpp
+liblogger_la_SOURCES = $(SOURCE_WIN) SysLogHandler.cpp
include $(top_srcdir)/ndb/config/common.mk.am
include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+windoze-dsp: liblogger.dsp
+
+liblogger.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(SOURCE_WIN)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp
index 744412870f5..db00cc1510f 100644
--- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp
+++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp
@@ -141,9 +141,10 @@ ConfigRetriever::getConfig(NdbMgmHandle m_handle){
return conf;
}
-
+
ndb_mgm_configuration *
ConfigRetriever::getConfig(const char * filename){
+#ifndef NDB_WIN32
struct stat sbuf;
const int res = stat(filename, &sbuf);
@@ -180,8 +181,10 @@ ConfigRetriever::getConfig(const char * filename){
return 0;
}
delete [] buf2;
-
return (ndb_mgm_configuration*)cvf.m_cfg;
+#else
+ return 0;
+#endif
}
void
diff --git a/ndb/src/common/mgmcommon/Makefile.am b/ndb/src/common/mgmcommon/Makefile.am
index a0aca3e68f1..104bf0b29f2 100644
--- a/ndb/src/common/mgmcommon/Makefile.am
+++ b/ndb/src/common/mgmcommon/Makefile.am
@@ -12,3 +12,17 @@ include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libmgmsrvcommon.dsp
+
+libmgmsrvcommon.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libmgmsrvcommon_la_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/common/portlib/Makefile.am b/ndb/src/common/portlib/Makefile.am
index 73125ad918d..99138a7414e 100644
--- a/ndb/src/common/portlib/Makefile.am
+++ b/ndb/src/common/portlib/Makefile.am
@@ -17,3 +17,27 @@ PortLibTest_SOURCES = NdbPortLibTest.cpp
munmaptest_SOURCES = munmaptest.cpp
# Don't update the files from bitkeeper
+WIN_src = win32/NdbCondition.c \
+ win32/NdbDaemon.c \
+ win32/NdbEnv.c \
+ win32/NdbHost.c \
+ win32/NdbMem.c \
+ win32/NdbMutex.c \
+ win32/NdbSleep.c \
+ win32/NdbTCP.c \
+ win32/NdbThread.c \
+ win32/NdbTick.c
+
+windoze-dsp: libportlib.dsp
+
+libportlib.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(WIN_src)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/common/portlib/NdbConfig.c b/ndb/src/common/portlib/NdbConfig.c
index 8adc4c20dff..b275143646f 100644
--- a/ndb/src/common/portlib/NdbConfig.c
+++ b/ndb/src/common/portlib/NdbConfig.c
@@ -18,6 +18,7 @@
#include <NdbConfig.h>
#include <NdbEnv.h>
#include <NdbMem.h>
+#include <basestring_vsnprintf.h>
static const char *datadir_path= 0;
@@ -48,7 +49,7 @@ NdbConfig_AllocHomePath(int _len)
const char *path= NdbConfig_get_path(&path_len);
int len= _len+path_len;
char *buf= NdbMem_Allocate(len);
- snprintf(buf, len, "%s%s", path, DIR_SEPARATOR);
+ basestring_snprintf(buf, len, "%s%s", path, DIR_SEPARATOR);
return buf;
}
@@ -67,7 +68,7 @@ NdbConfig_NdbCfgName(int with_ndb_home){
len= strlen(buf);
} else
buf= NdbMem_Allocate(128);
- snprintf(buf+len, 128, "Ndb.cfg");
+ basestring_snprintf(buf+len, 128, "Ndb.cfg");
return buf;
}
@@ -77,9 +78,9 @@ char *get_prefix_buf(int len, int node_id)
char tmp_buf[sizeof("ndb_pid#############")+1];
char *buf;
if (node_id > 0)
- snprintf(tmp_buf, sizeof(tmp_buf), "ndb_%u", node_id);
+ basestring_snprintf(tmp_buf, sizeof(tmp_buf), "ndb_%u", node_id);
else
- snprintf(tmp_buf, sizeof(tmp_buf), "ndb_pid%u", getpid());
+ basestring_snprintf(tmp_buf, sizeof(tmp_buf), "ndb_pid%u", getpid());
tmp_buf[sizeof(tmp_buf)-1]= 0;
buf= NdbConfig_AllocHomePath(len+strlen(tmp_buf));
@@ -91,7 +92,7 @@ char*
NdbConfig_ErrorFileName(int node_id){
char *buf= get_prefix_buf(128, node_id);
int len= strlen(buf);
- snprintf(buf+len, 128, "_error.log");
+ basestring_snprintf(buf+len, 128, "_error.log");
return buf;
}
@@ -99,7 +100,7 @@ char*
NdbConfig_ClusterLogFileName(int node_id){
char *buf= get_prefix_buf(128, node_id);
int len= strlen(buf);
- snprintf(buf+len, 128, "_cluster.log");
+ basestring_snprintf(buf+len, 128, "_cluster.log");
return buf;
}
@@ -107,7 +108,7 @@ char*
NdbConfig_SignalLogFileName(int node_id){
char *buf= get_prefix_buf(128, node_id);
int len= strlen(buf);
- snprintf(buf+len, 128, "_signal.log");
+ basestring_snprintf(buf+len, 128, "_signal.log");
return buf;
}
@@ -115,7 +116,7 @@ char*
NdbConfig_TraceFileName(int node_id, int file_no){
char *buf= get_prefix_buf(128, node_id);
int len= strlen(buf);
- snprintf(buf+len, 128, "_trace.log.%u", file_no);
+ basestring_snprintf(buf+len, 128, "_trace.log.%u", file_no);
return buf;
}
@@ -123,7 +124,7 @@ char*
NdbConfig_NextTraceFileName(int node_id){
char *buf= get_prefix_buf(128, node_id);
int len= strlen(buf);
- snprintf(buf+len, 128, "_trace.log.next");
+ basestring_snprintf(buf+len, 128, "_trace.log.next");
return buf;
}
@@ -131,7 +132,7 @@ char*
NdbConfig_PidFileName(int node_id){
char *buf= get_prefix_buf(128, node_id);
int len= strlen(buf);
- snprintf(buf+len, 128, ".pid");
+ basestring_snprintf(buf+len, 128, ".pid");
return buf;
}
@@ -139,6 +140,6 @@ char*
NdbConfig_StdoutFileName(int node_id){
char *buf= get_prefix_buf(128, node_id);
int len= strlen(buf);
- snprintf(buf+len, 128, "_out.log");
+ basestring_snprintf(buf+len, 128, "_out.log");
return buf;
}
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/portlib/win32/NdbCondition.c b/ndb/src/common/portlib/win32/NdbCondition.c
new file mode 100644
index 00000000000..4046db1d60a
--- /dev/null
+++ b/ndb/src/common/portlib/win32/NdbCondition.c
@@ -0,0 +1,178 @@
+/* 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 */
+
+
+#include <ndb_global.h>
+#include "NdbCondition.h"
+#include <NdbMutex.h>
+
+struct NdbCondition
+{
+ long nWaiters;
+ NdbMutex* pNdbMutexWaitersLock;
+ HANDLE hSemaphore;
+ HANDLE hEventWaitersDone;
+ int bWasBroadcast;
+};
+
+
+struct NdbCondition*
+NdbCondition_Create(void)
+{
+ int result = 0;
+ struct NdbCondition* pNdbCondition = (struct NdbCondition*)malloc(sizeof(struct NdbCondition));
+ if(!pNdbCondition)
+ return 0;
+
+ pNdbCondition->nWaiters = 0;
+ pNdbCondition->bWasBroadcast = 0;
+ if(!(pNdbCondition->hSemaphore = CreateSemaphore(0, 0, MAXLONG, 0)))
+ result = -1;
+ else if(!(pNdbCondition->pNdbMutexWaitersLock = NdbMutex_Create()))
+ result = -1;
+ else if(!(pNdbCondition->hEventWaitersDone = CreateEvent(0, 0, 0, 0)))
+ result = -1;
+
+ assert(!result);
+ return pNdbCondition;
+}
+
+
+int
+NdbCondition_Wait(struct NdbCondition* p_cond,
+ NdbMutex* p_mutex)
+{
+ int result;
+ int bLastWaiter;
+ if(!p_cond || !p_mutex)
+ return 1;
+
+ NdbMutex_Lock(p_cond->pNdbMutexWaitersLock);
+ p_cond->nWaiters++;
+ NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock);
+
+ if(NdbMutex_Unlock(p_mutex))
+ return -1;
+ result = WaitForSingleObject (p_cond->hSemaphore, INFINITE);
+
+ NdbMutex_Lock(p_cond->pNdbMutexWaitersLock);
+ p_cond->nWaiters--;
+ bLastWaiter = (p_cond->bWasBroadcast && p_cond->nWaiters==0);
+ NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock);
+
+ if(result==WAIT_OBJECT_0 && bLastWaiter)
+ SetEvent(p_cond->hEventWaitersDone);
+
+ NdbMutex_Lock(p_mutex);
+ return result;
+}
+
+
+int
+NdbCondition_WaitTimeout(struct NdbCondition* p_cond,
+ NdbMutex* p_mutex,
+ int msecs)
+{
+ int result;
+ int bLastWaiter;
+ if (!p_cond || !p_mutex)
+ return 1;
+
+ NdbMutex_Lock(p_cond->pNdbMutexWaitersLock);
+ p_cond->nWaiters++;
+ NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock);
+ if(msecs<0)
+ msecs = 0;
+
+ if(NdbMutex_Unlock(p_mutex))
+ return -1;
+ result = WaitForSingleObject(p_cond->hSemaphore, msecs);
+
+ NdbMutex_Lock(p_cond->pNdbMutexWaitersLock);
+ p_cond->nWaiters--;
+ bLastWaiter = (p_cond->bWasBroadcast && p_cond->nWaiters==0);
+ NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock);
+
+ if(result!=WAIT_OBJECT_0)
+ result = -1;
+
+ if(bLastWaiter)
+ SetEvent(p_cond->hEventWaitersDone);
+
+ NdbMutex_Lock(p_mutex);
+ return result;
+}
+
+
+int
+NdbCondition_Signal(struct NdbCondition* p_cond)
+{
+ int bHaveWaiters;
+ if(!p_cond)
+ return 1;
+
+ NdbMutex_Lock(p_cond->pNdbMutexWaitersLock);
+ bHaveWaiters = (p_cond->nWaiters > 0);
+ NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock);
+
+ if(bHaveWaiters)
+ return (ReleaseSemaphore(p_cond->hSemaphore, 1, 0) ? 0 : -1);
+ else
+ return 0;
+}
+
+
+int NdbCondition_Broadcast(struct NdbCondition* p_cond)
+{
+ int bHaveWaiters;
+ int result = 0;
+ if(!p_cond)
+ return 1;
+
+ NdbMutex_Lock(p_cond->pNdbMutexWaitersLock);
+ bHaveWaiters = 0;
+ if(p_cond->nWaiters > 0)
+ {
+ p_cond->bWasBroadcast = !0;
+ bHaveWaiters = 1;
+ }
+ NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock);
+ if(bHaveWaiters)
+ {
+ if(!ReleaseSemaphore(p_cond->hSemaphore, p_cond->nWaiters, 0))
+ result = -1;
+ else if(WaitForSingleObject (p_cond->hEventWaitersDone, INFINITE) != WAIT_OBJECT_0)
+ result = -1;
+ p_cond->bWasBroadcast = 0;
+ }
+ return result;
+}
+
+
+int NdbCondition_Destroy(struct NdbCondition* p_cond)
+{
+ int result;
+ if(!p_cond)
+ return 1;
+
+ CloseHandle(p_cond->hEventWaitersDone);
+ NdbMutex_Destroy(p_cond->pNdbMutexWaitersLock);
+ result = (CloseHandle(p_cond->hSemaphore) ? 0 : -1);
+
+ free(p_cond);
+ return 0;
+}
+
diff --git a/ndb/src/common/portlib/win32/NdbDaemon.c b/ndb/src/common/portlib/win32/NdbDaemon.c
new file mode 100644
index 00000000000..b96d4c20260
--- /dev/null
+++ b/ndb/src/common/portlib/win32/NdbDaemon.c
@@ -0,0 +1,44 @@
+/* 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 */
+
+#include "NdbDaemon.h"
+
+#define NdbDaemon_ErrorSize 500
+long NdbDaemon_DaemonPid;
+int NdbDaemon_ErrorCode;
+char NdbDaemon_ErrorText[NdbDaemon_ErrorSize];
+
+int
+NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags)
+{
+ // XXX do something
+ return 0;
+}
+
+#ifdef NDB_DAEMON_TEST
+
+int
+main()
+{
+ if (NdbDaemon_Make("test.pid", "test.log", 0) == -1) {
+ fprintf(stderr, "NdbDaemon_Make: %s\n", NdbDaemon_ErrorText);
+ return 1;
+ }
+ sleep(10);
+ return 0;
+}
+
+#endif
diff --git a/ndb/src/common/portlib/win32/NdbEnv.c b/ndb/src/common/portlib/win32/NdbEnv.c
new file mode 100644
index 00000000000..f42e685fe15
--- /dev/null
+++ b/ndb/src/common/portlib/win32/NdbEnv.c
@@ -0,0 +1,31 @@
+/* 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 */
+
+#include <ndb_global.h>
+#include "NdbEnv.h"
+
+const char* NdbEnv_GetEnv(const char* name, char * buf, int buflen)
+{
+ char* p = NULL;
+ p = getenv(name);
+
+ if (p != NULL && buf != NULL){
+ strncpy(buf, p, buflen);
+ buf[buflen-1] = 0;
+ }
+ return p;
+}
+
diff --git a/ndb/src/common/portlib/win32/NdbHost.c b/ndb/src/common/portlib/win32/NdbHost.c
new file mode 100644
index 00000000000..7df96c45991
--- /dev/null
+++ b/ndb/src/common/portlib/win32/NdbHost.c
@@ -0,0 +1,52 @@
+/* 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 */
+
+
+#include <ndb_global.h>
+#include "NdbHost.h"
+
+
+int NdbHost_GetHostName(char* buf)
+{
+ /* We must initialize TCP/IP if we want to call gethostname */
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ int err;
+
+ wVersionRequested = MAKEWORD( 2, 0 );
+ err = WSAStartup( wVersionRequested, &wsaData );
+ if ( err != 0 ) {
+ /**
+ * Tell the user that we couldn't find a usable
+ * WinSock DLL.
+ */
+ return -1;
+ }
+
+ /* Get host name */
+ if(gethostname(buf, MAXHOSTNAMELEN))
+ {
+ return -1;
+ }
+ return 0;
+}
+
+
+int NdbHost_GetProcessId(void)
+{
+ return _getpid();
+}
+
diff --git a/ndb/src/common/portlib/win32/NdbMem.c b/ndb/src/common/portlib/win32/NdbMem.c
new file mode 100644
index 00000000000..313ca9dff66
--- /dev/null
+++ b/ndb/src/common/portlib/win32/NdbMem.c
@@ -0,0 +1,283 @@
+/* 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 */
+
+#include <ndb_global.h>
+#include "NdbMem.h"
+
+#if 0
+struct AWEINFO
+{
+ SIZE_T dwSizeInBytesRequested;
+ ULONG_PTR nNumberOfPagesRequested;
+ ULONG_PTR nNumberOfPagesActual;
+ ULONG_PTR nNumberOfPagesFreed;
+ ULONG_PTR* pnPhysicalMemoryPageArray;
+ void* pRegionReserved;
+};
+
+const size_t cNdbMem_nMaxAWEinfo = 256;
+size_t gNdbMem_nAWEinfo = 0;
+
+struct AWEINFO* gNdbMem_pAWEinfo = 0;
+
+
+void ShowLastError(const char* szContext, const char* szFunction)
+{
+ DWORD dwError = GetLastError();
+ LPVOID lpMsgBuf;
+ FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ dwError,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR)&lpMsgBuf,
+ 0,
+ NULL
+ );
+ printf("%s : %s failed : %lu : %s\n", szContext, szFunction, dwError, (char*)lpMsgBuf);
+ LocalFree(lpMsgBuf);
+}
+
+
+
+void NdbMem_Create()
+{
+ // Address Windowing Extensions
+ struct PRIVINFO
+ {
+ DWORD Count;
+ LUID_AND_ATTRIBUTES Privilege[1];
+ } Info;
+
+ HANDLE hProcess = GetCurrentProcess();
+ HANDLE hToken;
+ if(!OpenProcessToken(hProcess, TOKEN_ADJUST_PRIVILEGES, &hToken))
+ {
+ ShowLastError("NdbMem_Create", "OpenProcessToken");
+ }
+
+ Info.Count = 1;
+ Info.Privilege[0].Attributes = SE_PRIVILEGE_ENABLED;
+ if(!LookupPrivilegeValue(0, SE_LOCK_MEMORY_NAME, &(Info.Privilege[0].Luid)))
+ {
+ ShowLastError("NdbMem_Create", "LookupPrivilegeValue");
+ }
+
+ if(!AdjustTokenPrivileges(hToken, FALSE, (PTOKEN_PRIVILEGES)&Info, 0, 0, 0))
+ {
+ ShowLastError("NdbMem_Create", "AdjustTokenPrivileges");
+ }
+
+ if(!CloseHandle(hToken))
+ {
+ ShowLastError("NdbMem_Create", "CloseHandle");
+ }
+
+ return;
+}
+
+void NdbMem_Destroy()
+{
+ /* Do nothing */
+ return;
+}
+
+void* NdbMem_Allocate(size_t size)
+{
+ // Address Windowing Extensions
+ struct AWEINFO* pAWEinfo;
+ HANDLE hProcess;
+ SYSTEM_INFO sysinfo;
+
+ if(!gNdbMem_pAWEinfo)
+ {
+ gNdbMem_pAWEinfo = VirtualAlloc(0,
+ sizeof(struct AWEINFO)*cNdbMem_nMaxAWEinfo,
+ MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
+ }
+
+ assert(gNdbMem_nAWEinfo < cNdbMem_nMaxAWEinfo);
+ pAWEinfo = gNdbMem_pAWEinfo+gNdbMem_nAWEinfo++;
+
+ hProcess = GetCurrentProcess();
+ GetSystemInfo(&sysinfo);
+ pAWEinfo->nNumberOfPagesRequested = (size+sysinfo.dwPageSize-1)/sysinfo.dwPageSize;
+ pAWEinfo->pnPhysicalMemoryPageArray = VirtualAlloc(0,
+ sizeof(ULONG_PTR)*pAWEinfo->nNumberOfPagesRequested,
+ MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
+ pAWEinfo->nNumberOfPagesActual = pAWEinfo->nNumberOfPagesRequested;
+ if(!AllocateUserPhysicalPages(hProcess, &(pAWEinfo->nNumberOfPagesActual), pAWEinfo->pnPhysicalMemoryPageArray))
+ {
+ ShowLastError("NdbMem_Allocate", "AllocateUserPhysicalPages");
+ return 0;
+ }
+ if(pAWEinfo->nNumberOfPagesRequested != pAWEinfo->nNumberOfPagesActual)
+ {
+ ShowLastError("NdbMem_Allocate", "nNumberOfPagesRequested != nNumberOfPagesActual");
+ return 0;
+ }
+
+ pAWEinfo->dwSizeInBytesRequested = size;
+ pAWEinfo->pRegionReserved = VirtualAlloc(0, pAWEinfo->dwSizeInBytesRequested, MEM_RESERVE | MEM_PHYSICAL, PAGE_READWRITE);
+ if(!pAWEinfo->pRegionReserved)
+ {
+ ShowLastError("NdbMem_Allocate", "VirtualAlloc");
+ return 0;
+ }
+
+ if(!MapUserPhysicalPages(pAWEinfo->pRegionReserved, pAWEinfo->nNumberOfPagesActual, pAWEinfo->pnPhysicalMemoryPageArray))
+ {
+ ShowLastError("NdbMem_Allocate", "MapUserPhysicalPages");
+ return 0;
+ }
+
+ /*
+ printf("allocate AWE memory: %lu bytes, %lu pages, address %lx\n",
+ pAWEinfo->dwSizeInBytesRequested,
+ pAWEinfo->nNumberOfPagesActual,
+ pAWEinfo->pRegionReserved);
+ */
+ return pAWEinfo->pRegionReserved;
+}
+
+
+void* NdbMem_AllocateAlign(size_t size, size_t alignment)
+{
+ /*
+ return (void*)memalign(alignment, size);
+ TEMP fix
+ */
+ return NdbMem_Allocate(size);
+}
+
+
+void NdbMem_Free(void* ptr)
+{
+ // VirtualFree(ptr, 0, MEM_DECOMMIT|MEM_RELEASE);
+
+ // Address Windowing Extensions
+ struct AWEINFO* pAWEinfo = 0;
+ size_t i;
+ HANDLE hProcess;
+
+ for(i=0; i<gNdbMem_nAWEinfo; ++i)
+ {
+ if(ptr==gNdbMem_pAWEinfo[i].pRegionReserved)
+ {
+ pAWEinfo = gNdbMem_pAWEinfo+i;
+ }
+ }
+ if(!pAWEinfo)
+ {
+ ShowLastError("NdbMem_Free", "ptr is not AWE memory");
+ }
+
+ hProcess = GetCurrentProcess();
+ if(!MapUserPhysicalPages(ptr, pAWEinfo->nNumberOfPagesActual, 0))
+ {
+ ShowLastError("NdbMem_Free", "MapUserPhysicalPages");
+ }
+
+ if(!VirtualFree(ptr, 0, MEM_RELEASE))
+ {
+ ShowLastError("NdbMem_Free", "VirtualFree");
+ }
+
+ pAWEinfo->nNumberOfPagesFreed = pAWEinfo->nNumberOfPagesActual;
+ if(!FreeUserPhysicalPages(hProcess, &(pAWEinfo->nNumberOfPagesFreed), pAWEinfo->pnPhysicalMemoryPageArray))
+ {
+ ShowLastError("NdbMem_Free", "FreeUserPhysicalPages");
+ }
+
+ VirtualFree(pAWEinfo->pnPhysicalMemoryPageArray, 0, MEM_DECOMMIT|MEM_RELEASE);
+}
+
+
+int NdbMem_MemLockAll()
+{
+ /*
+ HANDLE hProcess = GetCurrentProcess();
+ SIZE_T nMinimumWorkingSetSize;
+ SIZE_T nMaximumWorkingSetSize;
+ GetProcessWorkingSetSize(hProcess, &nMinimumWorkingSetSize, &nMaximumWorkingSetSize);
+ ndbout << "nMinimumWorkingSetSize=" << nMinimumWorkingSetSize << ", nMaximumWorkingSetSize=" << nMaximumWorkingSetSize << endl;
+
+ SetProcessWorkingSetSize(hProcess, 50000000, 100000000);
+
+ GetProcessWorkingSetSize(hProcess, &nMinimumWorkingSetSize, &nMaximumWorkingSetSize);
+ ndbout << "nMinimumWorkingSetSize=" << nMinimumWorkingSetSize << ", nMaximumWorkingSetSize=" << nMaximumWorkingSetSize << endl;
+ */
+ return -1;
+}
+
+int NdbMem_MemUnlockAll()
+{
+ //VirtualUnlock();
+ return -1;
+}
+
+#endif
+
+void NdbMem_Create()
+{
+ /* Do nothing */
+ return;
+}
+
+void NdbMem_Destroy()
+{
+ /* Do nothing */
+ return;
+}
+
+
+void* NdbMem_Allocate(size_t size)
+{
+ void* mem_allocated;
+ assert(size > 0);
+ mem_allocated= (void*)malloc(size);
+ return mem_allocated;
+}
+
+void* NdbMem_AllocateAlign(size_t size, size_t alignment)
+{
+ (void)alignment; /* remove warning for unused parameter */
+ /*
+ return (void*)memalign(alignment, size);
+ TEMP fix
+ */
+ return (void*)malloc(size);
+}
+
+
+void NdbMem_Free(void* ptr)
+{
+ free(ptr);
+}
+
+
+int NdbMem_MemLockAll()
+{
+ return 0;
+}
+
+int NdbMem_MemUnlockAll()
+{
+ return 0;
+}
+
diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/win32/NdbMutex.c
new file mode 100644
index 00000000000..e6d1f081e9a
--- /dev/null
+++ b/ndb/src/common/portlib/win32/NdbMutex.c
@@ -0,0 +1,73 @@
+/* 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 */
+
+
+#include <ndb_global.h>
+#include "NdbMutex.h"
+
+NdbMutex* NdbMutex_Create(void)
+{
+ NdbMutex* pNdbMutex = (NdbMutex*)malloc(sizeof(NdbMutex));
+ if(!pNdbMutex)
+ return 0;
+
+ InitializeCriticalSection(pNdbMutex);
+ return pNdbMutex;
+}
+
+
+int NdbMutex_Destroy(NdbMutex* p_mutex)
+{
+ if(!p_mutex)
+ return -1;
+
+ DeleteCriticalSection(p_mutex);
+ free(p_mutex);
+ return 0;
+}
+
+
+int NdbMutex_Lock(NdbMutex* p_mutex)
+{
+ if(!p_mutex)
+ return -1;
+
+ EnterCriticalSection (p_mutex);
+ return 0;
+}
+
+
+int NdbMutex_Unlock(NdbMutex* p_mutex)
+{
+ if(!p_mutex)
+ return -1;
+
+ LeaveCriticalSection(p_mutex);
+ return 0;
+}
+
+
+int NdbMutex_Trylock(NdbMutex* p_mutex)
+{
+ int result = -1;
+ if(p_mutex)
+ {
+ result = NdbMutex_Lock(p_mutex);
+ //(TryEnterCriticalSection(p_mutex) ? 0 : -1);
+ }
+ return result;
+}
+
diff --git a/ndb/src/common/portlib/win32/NdbSleep.c b/ndb/src/common/portlib/win32/NdbSleep.c
new file mode 100644
index 00000000000..8f5bdc49acd
--- /dev/null
+++ b/ndb/src/common/portlib/win32/NdbSleep.c
@@ -0,0 +1,32 @@
+/* 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 */
+
+#include <ndb_global.h>
+#include "NdbSleep.h"
+
+int
+NdbSleep_MilliSleep(int milliseconds)
+{
+ Sleep(milliseconds);
+ return 0;
+}
+
+int
+NdbSleep_SecSleep(int seconds)
+{
+ return NdbSleep_MilliSleep(seconds*1000);
+}
+
diff --git a/ndb/src/common/portlib/win32/NdbTCP.c b/ndb/src/common/portlib/win32/NdbTCP.c
new file mode 100644
index 00000000000..b936cd2db6c
--- /dev/null
+++ b/ndb/src/common/portlib/win32/NdbTCP.c
@@ -0,0 +1,39 @@
+/* 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 */
+
+#include <ndb_global.h>
+#include "NdbTCP.h"
+
+int
+Ndb_getInAddr(struct in_addr * dst, const char *address)
+{
+ struct hostent * hostPtr;
+
+ /* Try it as aaa.bbb.ccc.ddd. */
+ dst->s_addr = inet_addr(address);
+ if (dst->s_addr != -1) {
+ return 0;
+ }
+
+ hostPtr = gethostbyname(address);
+ if (hostPtr != NULL) {
+ dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr;
+ return 0;
+ }
+
+ return -1;
+}
+
diff --git a/ndb/src/common/portlib/win32/NdbThread.c b/ndb/src/common/portlib/win32/NdbThread.c
new file mode 100644
index 00000000000..98db0d5c287
--- /dev/null
+++ b/ndb/src/common/portlib/win32/NdbThread.c
@@ -0,0 +1,114 @@
+/* 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 */
+
+#include <ndb_global.h>
+#include "NdbThread.h"
+#include <process.h>
+
+#define MAX_THREAD_NAME 16
+
+typedef unsigned (WINAPI* NDB_WIN32_THREAD_FUNC)(void*);
+
+
+struct NdbThread
+{
+ HANDLE hThread;
+ unsigned nThreadId;
+ char thread_name[MAX_THREAD_NAME];
+};
+
+
+struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
+ NDB_THREAD_ARG *p_thread_arg,
+ const NDB_THREAD_STACKSIZE thread_stack_size,
+ const char* p_thread_name,
+ NDB_THREAD_PRIO thread_prio)
+{
+ struct NdbThread* tmpThread;
+ unsigned initflag;
+ int nPriority = 0;
+
+ if(!p_thread_func)
+ return 0;
+
+ tmpThread = (struct NdbThread*)malloc(sizeof(struct NdbThread));
+ if(!tmpThread)
+ return 0;
+
+ strncpy((char*)&tmpThread->thread_name, p_thread_name, MAX_THREAD_NAME);
+
+ switch(thread_prio)
+ {
+ case NDB_THREAD_PRIO_HIGHEST: nPriority=THREAD_PRIORITY_HIGHEST; break;
+ case NDB_THREAD_PRIO_HIGH: nPriority=THREAD_PRIORITY_ABOVE_NORMAL; break;
+ case NDB_THREAD_PRIO_MEAN: nPriority=THREAD_PRIORITY_NORMAL; break;
+ case NDB_THREAD_PRIO_LOW: nPriority=THREAD_PRIORITY_BELOW_NORMAL; break;
+ case NDB_THREAD_PRIO_LOWEST: nPriority=THREAD_PRIORITY_LOWEST; break;
+ }
+ initflag = (nPriority ? CREATE_SUSPENDED : 0);
+
+ tmpThread->hThread = (HANDLE)_beginthreadex(0, thread_stack_size,
+ (NDB_WIN32_THREAD_FUNC)p_thread_func, p_thread_arg,
+ initflag, &tmpThread->nThreadId);
+
+ if(nPriority && tmpThread->hThread)
+ {
+ SetThreadPriority(tmpThread->hThread, nPriority);
+ ResumeThread (tmpThread->hThread);
+ }
+
+ assert(tmpThread->hThread);
+ return tmpThread;
+}
+
+
+void NdbThread_Destroy(struct NdbThread** p_thread)
+{
+ CloseHandle((*p_thread)->hThread);
+ (*p_thread)->hThread = 0;
+ free(*p_thread);
+ *p_thread = 0;
+}
+
+
+int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status)
+{
+ void *local_status = 0;
+ if (status == 0)
+ status = &local_status;
+
+ if(WaitForSingleObject(p_wait_thread->hThread, INFINITE) == WAIT_OBJECT_0
+ && GetExitCodeThread(p_wait_thread->hThread, (LPDWORD)status))
+ {
+ CloseHandle(p_wait_thread->hThread);
+ p_wait_thread->hThread = 0;
+ return 0;
+ }
+ return -1;
+}
+
+
+void NdbThread_Exit(int status)
+{
+ _endthreadex((DWORD) status);
+}
+
+
+int NdbThread_SetConcurrencyLevel(int level)
+{
+ return 0;
+}
+
diff --git a/ndb/src/common/portlib/win32/NdbTick.c b/ndb/src/common/portlib/win32/NdbTick.c
new file mode 100644
index 00000000000..4430cbf419b
--- /dev/null
+++ b/ndb/src/common/portlib/win32/NdbTick.c
@@ -0,0 +1,64 @@
+/* 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 */
+
+#include <ndb_global.h>
+#include "NdbTick.h"
+//#include <windows.h>
+
+/*
+#define FILETIME_PER_MICROSEC 10
+#define FILETIME_PER_MILLISEC 10000
+#define FILETIME_PER_SEC 10000000
+
+
+NDB_TICKS NdbTick_CurrentMillisecond(void)
+{
+ ULONGLONG ullTime;
+ GetSystemTimeAsFileTime((LPFILETIME)&ullTime);
+ return (ullTime / FILETIME_PER_MILLISEC);
+}
+
+int
+NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros)
+{
+ ULONGLONG ullTime;
+ GetSystemTimeAsFileTime((LPFILETIME)&ullTime);
+ *secs = (ullTime / FILETIME_PER_SEC);
+ *micros = (Uint32)((ullTime % FILETIME_PER_SEC) / FILETIME_PER_MICROSEC);
+ return 0;
+}
+*/
+
+
+NDB_TICKS NdbTick_CurrentMillisecond(void)
+{
+ LARGE_INTEGER liCount, liFreq;
+ QueryPerformanceCounter(&liCount);
+ QueryPerformanceFrequency(&liFreq);
+ return (liCount.QuadPart*1000) / liFreq.QuadPart;
+}
+
+int
+NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros)
+{
+ LARGE_INTEGER liCount, liFreq;
+ QueryPerformanceCounter(&liCount);
+ QueryPerformanceFrequency(&liFreq);
+ *secs = liCount.QuadPart / liFreq.QuadPart;
+ liCount.QuadPart -= *secs * liFreq.QuadPart;
+ *micros = (liCount.QuadPart*1000000) / liFreq.QuadPart;
+ return 0;
+}
diff --git a/ndb/src/common/transporter/Makefile.am b/ndb/src/common/transporter/Makefile.am
index 9d91a210d46..d76b1b6048b 100644
--- a/ndb/src/common/transporter/Makefile.am
+++ b/ndb/src/common/transporter/Makefile.am
@@ -20,3 +20,17 @@ include $(top_srcdir)/ndb/config/type_util.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libtransporter.dsp
+
+libtransporter.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libtransporter_la_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp
index ab161d8c18c..e4051519b86 100644
--- a/ndb/src/common/transporter/SHM_Transporter.cpp
+++ b/ndb/src/common/transporter/SHM_Transporter.cpp
@@ -26,6 +26,8 @@
#include <InputStream.hpp>
#include <OutputStream.hpp>
+extern int g_shm_pid;
+
SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg,
const char *lHostName,
const char *rHostName,
@@ -52,6 +54,7 @@ SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg,
#ifdef DEBUG_TRANSPORTER
printf("shm key (%d - %d) = %d\n", lNodeId, rNodeId, shmKey);
#endif
+ m_signal_threshold = 4096;
}
SHM_Transporter::~SHM_Transporter(){
@@ -182,42 +185,6 @@ SHM_Transporter::setupBuffers(){
#endif
}
-#if 0
-SendStatus
-SHM_Transporter::prepareSend(const SignalHeader * const signalHeader,
- Uint8 prio,
- const Uint32 * const signalData,
- const LinearSegmentPtr ptr[3],
- bool force){
-
- if(isConnected()){
-
- const Uint32 lenBytes = m_packer.getMessageLength(signalHeader, ptr);
-
- Uint32 * insertPtr = (Uint32 *)writer->getWritePtr(lenBytes);
-
- if(insertPtr != 0){
-
- m_packer.pack(insertPtr, prio, signalHeader, signalData, ptr);
-
- /**
- * Do funky membar stuff
- */
-
- writer->updateWritePtr(lenBytes);
- return SEND_OK;
-
- } else {
- // NdbSleep_MilliSleep(3);
- //goto tryagain;
- return SEND_BUFFER_FULL;
- }
- }
- return SEND_DISCONNECTED;
-}
-#endif
-
-
bool
SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd)
{
@@ -247,10 +214,18 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd)
}
// Send ok to client
- s_output.println("shm server 1 ok");
-
+ s_output.println("shm server 1 ok: %d",
+ m_transporter_registry.m_shm_own_pid);
+
// Wait for ok from client
- if (s_input.gets(buf, 256) == 0) {
+ if (s_input.gets(buf, 256) == 0)
+ {
+ NDB_CLOSE_SOCKET(sockfd);
+ DBUG_RETURN(false);
+ }
+
+ if(sscanf(buf, "shm client 1 ok: %d", &m_remote_pid) != 1)
+ {
NDB_CLOSE_SOCKET(sockfd);
DBUG_RETURN(false);
}
@@ -289,6 +264,12 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd)
DBUG_RETURN(false);
}
+ if(sscanf(buf, "shm server 1 ok: %d", &m_remote_pid) != 1)
+ {
+ NDB_CLOSE_SOCKET(sockfd);
+ DBUG_RETURN(false);
+ }
+
// Create
if(!_shmSegCreated){
if (!ndb_shm_get()) {
@@ -313,10 +294,11 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd)
}
// Send ok to server
- s_output.println("shm client 1 ok");
-
+ s_output.println("shm client 1 ok: %d",
+ m_transporter_registry.m_shm_own_pid);
+
int r= connect_common(sockfd);
-
+
if (r) {
// Wait for ok from server
if (s_input.gets(buf, 256) == 0) {
@@ -344,18 +326,33 @@ SHM_Transporter::connect_common(NDB_SOCKET_TYPE sockfd)
return false;
}
- if(!setupBuffersDone) {
+ if(!setupBuffersDone)
+ {
setupBuffers();
setupBuffersDone=true;
}
- if(setupBuffersDone) {
+ if(setupBuffersDone)
+ {
NdbSleep_MilliSleep(m_timeOutMillis);
if(*serverStatusFlag == 1 && *clientStatusFlag == 1)
+ {
+ m_last_signal = 0;
return true;
+ }
}
DBUG_PRINT("error", ("Failed to set up buffers to node %d",
remoteNodeId));
return false;
}
+
+void
+SHM_Transporter::doSend()
+{
+ if(m_last_signal)
+ {
+ m_last_signal = 0;
+ kill(m_remote_pid, SIGUSR1);
+ }
+}
diff --git a/ndb/src/common/transporter/SHM_Transporter.hpp b/ndb/src/common/transporter/SHM_Transporter.hpp
index 27692209ffe..b501f652168 100644
--- a/ndb/src/common/transporter/SHM_Transporter.hpp
+++ b/ndb/src/common/transporter/SHM_Transporter.hpp
@@ -47,18 +47,25 @@ public:
* SHM destructor
*/
virtual ~SHM_Transporter();
-
+
/**
* Do initialization
*/
bool initTransporter();
-
- Uint32 * getWritePtr(Uint32 lenBytes, Uint32 prio){
+
+ Uint32 * getWritePtr(Uint32 lenBytes, Uint32 prio)
+ {
return (Uint32 *)writer->getWritePtr(lenBytes);
}
- void updateWritePtr(Uint32 lenBytes, Uint32 prio){
+ void updateWritePtr(Uint32 lenBytes, Uint32 prio)
+ {
writer->updateWritePtr(lenBytes);
+ m_last_signal += lenBytes;
+ if(m_last_signal >= m_signal_threshold)
+ {
+ doSend();
+ }
}
void getReceivePtr(Uint32 ** ptr, Uint32 ** eod){
@@ -123,28 +130,36 @@ protected:
*/
void setupBuffers();
+ /**
+ * doSend (i.e signal receiver)
+ */
+ void doSend();
+ int m_remote_pid;
+ Uint32 m_last_signal;
+ Uint32 m_signal_threshold;
+
private:
bool _shmSegCreated;
bool _attached;
bool m_connected;
-
+
key_t shmKey;
volatile Uint32 * serverStatusFlag;
volatile Uint32 * clientStatusFlag;
bool setupBuffersDone;
-
+
#ifdef NDB_WIN32
HANDLE hFileMapping;
#else
int shmId;
#endif
-
+
int shmSize;
char * shmBuf;
-
+
SHM_Reader * reader;
SHM_Writer * writer;
-
+
/**
* @return - True if the reader has data to read on its segment.
*/
diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp
index e68bc86718e..ee25d97feef 100644
--- a/ndb/src/common/transporter/Transporter.cpp
+++ b/ndb/src/common/transporter/Transporter.cpp
@@ -95,7 +95,7 @@ Transporter::connect_client() {
return true;
NDB_SOCKET_TYPE sockfd = m_socket_client->connect();
- if (sockfd < 0)
+ if (sockfd == NDB_INVALID_SOCKET)
return false;
// send info about own id
diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp
index a2fab8f9806..be51e9223ba 100644
--- a/ndb/src/common/transporter/TransporterRegistry.cpp
+++ b/ndb/src/common/transporter/TransporterRegistry.cpp
@@ -47,6 +47,8 @@
#include <InputStream.hpp>
#include <OutputStream.hpp>
+int g_shm_pid = 0;
+
SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd)
{
DBUG_ENTER("SocketServer::Session * TransporterService::newSession");
@@ -622,11 +624,28 @@ TransporterRegistry::pollReceive(Uint32 timeOutMillis){
return retVal;
#endif
- if((nSHMTransporters+nSCITransporters) > 0)
+ if((nSCITransporters) > 0)
+ {
timeOutMillis=0;
+ }
+
+#ifdef NDB_SHM_TRANSPORTER
+ if(nSHMTransporters > 0)
+ {
+ Uint32 res = poll_SHM(0);
+ if(res)
+ {
+ retVal |= res;
+ timeOutMillis = 0;
+ }
+ }
+#endif
+
#ifdef NDB_TCP_TRANSPORTER
- if(nTCPTransporters > 0)
+ if(nTCPTransporters > 0 || retVal == 0)
+ {
retVal |= poll_TCP(timeOutMillis);
+ }
else
tcpReadSelectReply = 0;
#endif
@@ -635,8 +654,11 @@ TransporterRegistry::pollReceive(Uint32 timeOutMillis){
retVal |= poll_SCI(timeOutMillis);
#endif
#ifdef NDB_SHM_TRANSPORTER
- if(nSHMTransporters > 0)
- retVal |= poll_SHM(timeOutMillis);
+ if(nSHMTransporters > 0 && retVal == 0)
+ {
+ int res = poll_SHM(0);
+ retVal |= res;
+ }
#endif
return retVal;
}
@@ -644,8 +666,8 @@ TransporterRegistry::pollReceive(Uint32 timeOutMillis){
#ifdef NDB_SCI_TRANSPORTER
Uint32
-TransporterRegistry::poll_SCI(Uint32 timeOutMillis){
-
+TransporterRegistry::poll_SCI(Uint32 timeOutMillis)
+{
for (int i=0; i<nSCITransporters; i++) {
SCI_Transporter * t = theSCITransporters[i];
if (t->isConnected()) {
@@ -659,73 +681,29 @@ TransporterRegistry::poll_SCI(Uint32 timeOutMillis){
#ifdef NDB_SHM_TRANSPORTER
+static int g_shm_counter = 0;
Uint32
TransporterRegistry::poll_SHM(Uint32 timeOutMillis)
{
- for(int j=0; j < 20; j++)
- for (int i=0; i<nSHMTransporters; i++) {
- SHM_Transporter * t = theSHMTransporters[i];
- if (t->isConnected()) {
- if(t->hasDataToRead()) {
- return 1;
- }
- }
- }
- /**
- * @note: granularity of linux/i386 timer is not good enough.
- * Can't sleep if using SHM as it is now.
- */
- /*
- if(timeOutMillis > 0)
- NdbSleep_MilliSleep(timeOutMillis);
- else
- NdbSleep_MilliSleep(1);
- */
- return 0;
-#if 0
- NDB_TICKS startTime = NdbTick_CurrentMillisecond();
- for(int i=0; i<100; i++) {
+ for(int j=0; j < 100; j++)
+ {
for (int i=0; i<nSHMTransporters; i++) {
SHM_Transporter * t = theSHMTransporters[i];
if (t->isConnected()) {
- if(t->hasDataToRead()){
+ if(t->hasDataToRead()) {
return 1;
}
- else
- continue;
}
- else
- continue;
}
-
- if(NdbTick_CurrentMillisecond() > (startTime +timeOutMillis))
- return 0;
}
- NdbSleep_MilliSleep(5);
return 0;
-
-#endif
-#if 0
-
- for(int j=0; j < 100; j++) {
- for (int i=0; i<nSHMTransporters; i++) {
- SHM_Transporter * t = theSHMTransporters[i];
- if (t->isConnected()) {
- if(t->hasDataToRead())
- return 1;
- }
- }
- }
- return 0;
-#endif
}
-
-
#endif
#ifdef NDB_OSE_TRANSPORTER
Uint32
-TransporterRegistry::poll_OSE(Uint32 timeOutMillis){
+TransporterRegistry::poll_OSE(Uint32 timeOutMillis)
+{
if(theOSEReceiver != NULL){
return theOSEReceiver->doReceive(timeOutMillis);
}
@@ -736,18 +714,18 @@ TransporterRegistry::poll_OSE(Uint32 timeOutMillis){
#ifdef NDB_TCP_TRANSPORTER
Uint32
-TransporterRegistry::poll_TCP(Uint32 timeOutMillis){
-
- if (nTCPTransporters == 0){
+TransporterRegistry::poll_TCP(Uint32 timeOutMillis)
+{
+ if (false && nTCPTransporters == 0)
+ {
tcpReadSelectReply = 0;
return 0;
}
struct timeval timeout;
#ifdef NDB_OSE
-
// Return directly if there are no TCP transporters configured
-
+
if(timeOutMillis <= 1){
timeout.tv_sec = 0;
timeout.tv_usec = 1025;
@@ -760,7 +738,7 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis){
timeout.tv_usec = (timeOutMillis % 1000) * 1000;
#endif
- NDB_SOCKET_TYPE maxSocketValue = 0;
+ NDB_SOCKET_TYPE maxSocketValue = -1;
// Needed for TCP/IP connections
// The read- and writeset are used by select
@@ -788,23 +766,29 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis){
maxSocketValue++;
tcpReadSelectReply = select(maxSocketValue, &tcpReadset, 0, 0, &timeout);
+ if(false && tcpReadSelectReply == -1 && errno == EINTR)
+ ndbout_c("woke-up by signal");
+
#ifdef NDB_WIN32
if(tcpReadSelectReply == SOCKET_ERROR)
{
NdbSleep_MilliSleep(timeOutMillis);
}
#endif
-
+
return tcpReadSelectReply;
}
#endif
void
-TransporterRegistry::performReceive(){
+TransporterRegistry::performReceive()
+{
#ifdef NDB_OSE_TRANSPORTER
- if(theOSEReceiver != 0){
- while(theOSEReceiver->hasData()){
+ if(theOSEReceiver != 0)
+ {
+ while(theOSEReceiver->hasData())
+ {
NodeId remoteNodeId;
Uint32 * readPtr;
Uint32 sz = theOSEReceiver->getReceiveData(&remoteNodeId, &readPtr);
@@ -827,16 +811,20 @@ TransporterRegistry::performReceive(){
#endif
#ifdef NDB_TCP_TRANSPORTER
- if(tcpReadSelectReply > 0){
- for (int i=0; i<nTCPTransporters; i++) {
+ if(tcpReadSelectReply > 0)
+ {
+ for (int i=0; i<nTCPTransporters; i++)
+ {
checkJobBuffer();
TCP_Transporter *t = theTCPTransporters[i];
const NodeId nodeId = t->getRemoteNodeId();
const NDB_SOCKET_TYPE socket = t->getSocket();
if(is_connected(nodeId)){
- if(t->isConnected() && FD_ISSET(socket, &tcpReadset)) {
+ if(t->isConnected() && FD_ISSET(socket, &tcpReadset))
+ {
const int receiveSize = t->doReceive();
- if(receiveSize > 0){
+ if(receiveSize > 0)
+ {
Uint32 * ptr;
Uint32 sz = t->getReceiveData(&ptr);
Uint32 szUsed = unpack(ptr, sz, nodeId, ioStates[nodeId]);
@@ -847,142 +835,165 @@ TransporterRegistry::performReceive(){
}
}
#endif
-
-
+
#ifdef NDB_SCI_TRANSPORTER
//performReceive
//do prepareReceive on the SCI transporters (prepareReceive(t,,,,))
- for (int i=0; i<nSCITransporters; i++) {
- checkJobBuffer();
- SCI_Transporter *t = theSCITransporters[i];
- const NodeId nodeId = t->getRemoteNodeId();
- if(is_connected(nodeId)){
- if(t->isConnected() && t->checkConnected()){
- Uint32 * readPtr, * eodPtr;
- t->getReceivePtr(&readPtr, &eodPtr);
- Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]);
- t->updateReceivePtr(newPtr);
- }
- }
- }
+ for (int i=0; i<nSCITransporters; i++)
+ {
+ checkJobBuffer();
+ SCI_Transporter *t = theSCITransporters[i];
+ const NodeId nodeId = t->getRemoteNodeId();
+ if(is_connected(nodeId))
+ {
+ if(t->isConnected() && t->checkConnected())
+ {
+ Uint32 * readPtr, * eodPtr;
+ t->getReceivePtr(&readPtr, &eodPtr);
+ Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]);
+ t->updateReceivePtr(newPtr);
+ }
+ }
+ }
#endif
#ifdef NDB_SHM_TRANSPORTER
- for (int i=0; i<nSHMTransporters; i++) {
- checkJobBuffer();
- SHM_Transporter *t = theSHMTransporters[i];
- const NodeId nodeId = t->getRemoteNodeId();
- if(is_connected(nodeId)){
- if(t->isConnected() && t->checkConnected()){
- Uint32 * readPtr, * eodPtr;
- t->getReceivePtr(&readPtr, &eodPtr);
- Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]);
- t->updateReceivePtr(newPtr);
- }
- }
- }
+ for (int i=0; i<nSHMTransporters; i++)
+ {
+ checkJobBuffer();
+ SHM_Transporter *t = theSHMTransporters[i];
+ const NodeId nodeId = t->getRemoteNodeId();
+ if(is_connected(nodeId)){
+ if(t->isConnected() && t->checkConnected())
+ {
+ Uint32 * readPtr, * eodPtr;
+ t->getReceivePtr(&readPtr, &eodPtr);
+ Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]);
+ t->updateReceivePtr(newPtr);
+ }
+ }
+ }
#endif
}
static int x = 0;
void
-TransporterRegistry::performSend(){
- int i;
- sendCounter = 1;
-
+TransporterRegistry::performSend()
+{
+ int i;
+ sendCounter = 1;
+
#ifdef NDB_OSE_TRANSPORTER
- for (int i = 0; i < nOSETransporters; i++){
- OSE_Transporter *t = theOSETransporters[i];
- if((is_connected(t->getRemoteNodeId()) &&
- (t->isConnected())) {
- t->doSend();
- }//if
- }//for
+ for (int i = 0; i < nOSETransporters; i++)
+ {
+ OSE_Transporter *t = theOSETransporters[i];
+ if(is_connected(t->getRemoteNodeId()) &&& (t->isConnected()))
+ {
+ t->doSend();
+ }//if
+ }//for
#endif
-
+
#ifdef NDB_TCP_TRANSPORTER
#ifdef NDB_OSE
+ {
+ int maxSocketValue = 0;
+
+ // Needed for TCP/IP connections
+ // The writeset are used by select
+ fd_set writeset;
+ FD_ZERO(&writeset);
+
+ // Prepare for sending and receiving
+ for (i = 0; i < nTCPTransporters; i++) {
+ TCP_Transporter * t = theTCPTransporters[i];
+
+ // If the transporter is connected
+ if ((t->hasDataToSend()) && (t->isConnected())) {
+ const int socket = t->getSocket();
+ // Find the highest socket value. It will be used by select
+ if (socket > maxSocketValue) {
+ maxSocketValue = socket;
+ }//if
+ FD_SET(socket, &writeset);
+ }//if
+ }//for
+
+ // The highest socket value plus one
+ if(maxSocketValue == 0)
+ return;
+
+ maxSocketValue++;
+ struct timeval timeout = { 0, 1025 };
+ Uint32 tmp = select(maxSocketValue, 0, &writeset, 0, &timeout);
+
+ if (tmp == 0)
{
- int maxSocketValue = 0;
-
- // Needed for TCP/IP connections
- // The writeset are used by select
- fd_set writeset;
- FD_ZERO(&writeset);
-
- // Prepare for sending and receiving
- for (i = 0; i < nTCPTransporters; i++) {
- TCP_Transporter * t = theTCPTransporters[i];
-
- // If the transporter is connected
- if ((t->hasDataToSend()) && (t->isConnected())) {
- const int socket = t->getSocket();
- // Find the highest socket value. It will be used by select
- if (socket > maxSocketValue) {
- maxSocketValue = socket;
- }//if
- FD_SET(socket, &writeset);
- }//if
- }//for
-
- // The highest socket value plus one
- if(maxSocketValue == 0)
- return;
-
- maxSocketValue++;
- struct timeval timeout = { 0, 1025 };
- Uint32 tmp = select(maxSocketValue, 0, &writeset, 0, &timeout);
-
- if (tmp == 0) {
- return;
- }//if
- for (i = 0; i < nTCPTransporters; i++) {
- TCP_Transporter *t = theTCPTransporters[i];
- const NodeId nodeId = t->getRemoteNodeId();
- const int socket = t->getSocket();
- if(is_connected(nodeId)){
- if(t->isConnected() && FD_ISSET(socket, &writeset)) {
- t->doSend();
- }//if
- }//if
- }//for
+ return;
+ }//if
+ for (i = 0; i < nTCPTransporters; i++) {
+ TCP_Transporter *t = theTCPTransporters[i];
+ const NodeId nodeId = t->getRemoteNodeId();
+ const int socket = t->getSocket();
+ if(is_connected(nodeId)){
+ if(t->isConnected() && FD_ISSET(socket, &writeset)) {
+ t->doSend();
+ }//if
+ }//if
+ }//for
}
#endif
#ifdef NDB_TCP_TRANSPORTER
- for (i = x; i < nTCPTransporters; i++) {
- TCP_Transporter *t = theTCPTransporters[i];
- if (t &&
- (t->hasDataToSend()) &&
- (t->isConnected()) &&
- (is_connected(t->getRemoteNodeId()))) {
- t->doSend();
- }//if
- }//for
- for (i = 0; i < x && i < nTCPTransporters; i++) {
- TCP_Transporter *t = theTCPTransporters[i];
- if (t &&
- (t->hasDataToSend()) &&
- (t->isConnected()) &&
- (is_connected(t->getRemoteNodeId()))) {
- t->doSend();
- }//if
- }//for
- x++;
- if (x == nTCPTransporters) x = 0;
+ for (i = x; i < nTCPTransporters; i++)
+ {
+ TCP_Transporter *t = theTCPTransporters[i];
+ if (t && t->hasDataToSend() && t->isConnected() &&
+ is_connected(t->getRemoteNodeId()))
+ {
+ t->doSend();
+ }
+ }
+ for (i = 0; i < x && i < nTCPTransporters; i++)
+ {
+ TCP_Transporter *t = theTCPTransporters[i];
+ if (t && t->hasDataToSend() && t->isConnected() &&
+ is_connected(t->getRemoteNodeId()))
+ {
+ t->doSend();
+ }
+ }
+ x++;
+ if (x == nTCPTransporters) x = 0;
#endif
#endif
#ifdef NDB_SCI_TRANSPORTER
- //scroll through the SCI transporters,
- // get each transporter, check if connected, send data
- for (i=0; i<nSCITransporters; i++) {
- SCI_Transporter *t = theSCITransporters[i];
- const NodeId nodeId = t->getRemoteNodeId();
-
- if(is_connected(nodeId)){
- if(t->isConnected() && t->hasDataToSend()) {
- t->doSend();
- } //if
+ //scroll through the SCI transporters,
+ // get each transporter, check if connected, send data
+ for (i=0; i<nSCITransporters; i++) {
+ SCI_Transporter *t = theSCITransporters[i];
+ const NodeId nodeId = t->getRemoteNodeId();
+
+ if(is_connected(nodeId))
+ {
+ if(t->isConnected() && t->hasDataToSend()) {
+ t->doSend();
} //if
- } //if
+ } //if
+ }
+#endif
+
+#ifdef NDB_SHM_TRANSPORTER
+ for (i=0; i<nSHMTransporters; i++)
+ {
+ SHM_Transporter *t = theSHMTransporters[i];
+ const NodeId nodeId = t->getRemoteNodeId();
+ if(is_connected(nodeId))
+ {
+ if(t->isConnected())
+ {
+ t->doSend();
+ }
+ }
+ }
#endif
}
@@ -1169,31 +1180,31 @@ TransporterRegistry::stop_clients()
}
void
-TransporterRegistry::add_transporter_interface(const char *interface, unsigned short port)
+TransporterRegistry::add_transporter_interface(const char *interf, unsigned short port)
{
DBUG_ENTER("TransporterRegistry::add_transporter_interface");
- DBUG_PRINT("enter",("interface=%s, port= %d", interface, port));
- if (interface && strlen(interface) == 0)
- interface= 0;
+ DBUG_PRINT("enter",("interface=%s, port= %d", interf, port));
+ if (interf && strlen(interf) == 0)
+ interf= 0;
for (unsigned i= 0; i < m_transporter_interface.size(); i++)
{
Transporter_interface &tmp= m_transporter_interface[i];
if (port != tmp.m_service_port)
continue;
- if (interface != 0 && tmp.m_interface != 0 &&
- strcmp(interface, tmp.m_interface) == 0)
+ if (interf != 0 && tmp.m_interface != 0 &&
+ strcmp(interf, tmp.m_interface) == 0)
{
DBUG_VOID_RETURN; // found match, no need to insert
}
- if (interface == 0 && tmp.m_interface == 0)
+ if (interf == 0 && tmp.m_interface == 0)
{
DBUG_VOID_RETURN; // found match, no need to insert
}
}
Transporter_interface t;
t.m_service_port= port;
- t.m_interface= interface;
+ t.m_interface= interf;
m_transporter_interface.push_back(t);
DBUG_PRINT("exit",("interface and port added"));
DBUG_VOID_RETURN;
@@ -1202,7 +1213,7 @@ TransporterRegistry::add_transporter_interface(const char *interface, unsigned s
bool
TransporterRegistry::start_service(SocketServer& socket_server)
{
- if (m_transporter_interface.size() > 0 && nodeIdSpecified != true)
+ if (m_transporter_interface.size() > 0 && !nodeIdSpecified)
{
ndbout_c("TransporterRegistry::startReceiving: localNodeId not specified");
return false;
@@ -1232,6 +1243,15 @@ TransporterRegistry::start_service(SocketServer& socket_server)
return true;
}
+#ifdef NDB_SHM_TRANSPORTER
+static
+RETSIGTYPE
+shm_sig_handler(int signo)
+{
+ g_shm_counter++;
+}
+#endif
+
void
TransporterRegistry::startReceiving()
{
@@ -1250,6 +1270,11 @@ TransporterRegistry::startReceiving()
for(int i = 0; i<nTCPTransporters; i++)
theTCPTransporters[i]->theReceiverPid = theReceiverPid;
#endif
+
+#ifdef NDB_SHM_TRANSPORTER
+ m_shm_own_pid = getpid();
+ signal(SIGUSR1, shm_sig_handler);
+#endif
}
void
diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp
index f3faa8c4f7f..937b8c0fa59 100644
--- a/ndb/src/common/util/File.cpp
+++ b/ndb/src/common/util/File.cpp
@@ -19,6 +19,7 @@
#include <File.hpp>
#include <NdbOut.hpp>
+#include <my_dir.h>
//
// PUBLIC
@@ -28,9 +29,12 @@ bool
File_class::exists(const char* aFileName)
{
bool rc = true;
-
+#ifdef USE_MY_STAT_STRUCT
+ struct my_stat stmp;
+#else
struct stat stmp;
- if (::stat(aFileName, &stmp) != 0)
+#endif
+ if (my_stat(aFileName, &stmp, MYF(0)) != 0)
{
rc = false;
}
diff --git a/ndb/src/common/util/Makefile.am b/ndb/src/common/util/Makefile.am
index 61fd7992002..a62c8186174 100644
--- a/ndb/src/common/util/Makefile.am
+++ b/ndb/src/common/util/Makefile.am
@@ -16,3 +16,17 @@ include $(top_srcdir)/ndb/config/type_util.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libgeneral.dsp
+
+libgeneral.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libgeneral_la_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/common/util/Properties.cpp b/ndb/src/common/util/Properties.cpp
index 4443fd45bba..0edcda0e726 100644
--- a/ndb/src/common/util/Properties.cpp
+++ b/ndb/src/common/util/Properties.cpp
@@ -881,7 +881,7 @@ PropertiesImpl::unpack(const Uint32 * buf, Uint32 &bufLen, Properties * top,
case PropertiesType_Properties:
assert(0);
}
- if(res3 != true){
+ if(!res3){
return false;
}
_items--;
diff --git a/ndb/src/common/util/SocketClient.cpp b/ndb/src/common/util/SocketClient.cpp
index 50e60956b94..38df1417eb8 100644
--- a/ndb/src/common/util/SocketClient.cpp
+++ b/ndb/src/common/util/SocketClient.cpp
@@ -26,14 +26,14 @@ SocketClient::SocketClient(const char *server_name, unsigned short port, SocketA
m_auth= sa;
m_port= port;
m_server_name= strdup(server_name);
- m_sockfd= -1;
+ m_sockfd= NDB_INVALID_SOCKET;
}
SocketClient::~SocketClient()
{
if (m_server_name)
free(m_server_name);
- if (m_sockfd >= 0)
+ if (m_sockfd != NDB_INVALID_SOCKET)
NDB_CLOSE_SOCKET(m_sockfd);
if (m_auth)
delete m_auth;
@@ -42,7 +42,7 @@ SocketClient::~SocketClient()
bool
SocketClient::init()
{
- if (m_sockfd >= 0)
+ if (m_sockfd != NDB_INVALID_SOCKET)
NDB_CLOSE_SOCKET(m_sockfd);
memset(&m_servaddr, 0, sizeof(m_servaddr));
@@ -63,32 +63,32 @@ SocketClient::init()
NDB_SOCKET_TYPE
SocketClient::connect()
{
- if (m_sockfd < 0)
+ if (m_sockfd == NDB_INVALID_SOCKET)
{
if (!init()) {
#ifdef VM_TRACE
ndbout << "SocketClient::connect() failed " << m_server_name << " " << m_port << endl;
#endif
- return -1;
+ return NDB_INVALID_SOCKET;
}
}
const int r = ::connect(m_sockfd, (struct sockaddr*) &m_servaddr, sizeof(m_servaddr));
if (r == -1) {
NDB_CLOSE_SOCKET(m_sockfd);
- m_sockfd= -1;
- return -1;
+ m_sockfd= NDB_INVALID_SOCKET;
+ return NDB_INVALID_SOCKET;
}
if (m_auth) {
if (!m_auth->client_authenticate(m_sockfd))
{
NDB_CLOSE_SOCKET(m_sockfd);
- m_sockfd= -1;
- return -1;
+ m_sockfd= NDB_INVALID_SOCKET;
+ return NDB_INVALID_SOCKET;
}
}
NDB_SOCKET_TYPE sockfd= m_sockfd;
- m_sockfd= -1;
+ m_sockfd= NDB_INVALID_SOCKET;
return sockfd;
}
diff --git a/ndb/src/common/util/basestring_vsnprintf.c b/ndb/src/common/util/basestring_vsnprintf.c
index 8a58ca0fe5c..58203e33bd1 100644
--- a/ndb/src/common/util/basestring_vsnprintf.c
+++ b/ndb/src/common/util/basestring_vsnprintf.c
@@ -20,10 +20,12 @@
#include <basestring_vsnprintf.h>
#include <my_config.h>
+#ifdef _WINDOWS
+#define SNPRINTF_RETURN_TRUNC
+#define snprintf _snprintf
+#define vsnprintf _vsnprintf
+#endif
-/*
- #define SNPRINTF_RETURN_TRUNC
-*/
int
basestring_snprintf(char *str, size_t size, const char *format, ...)
{
@@ -35,16 +37,6 @@ basestring_snprintf(char *str, size_t size, const char *format, ...)
return(ret);
}
-#ifdef HAVE_SNPRINTF
- #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d)
-#else
- #define SNPRINTF_RETURN_TRUNC
- /* #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) my_vsnprintf(a,b,c,d)
- * we would like to use my_vsnprintf but it does not have enough features
- * Let's hope vsnprintf works anyways
- */
- #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d)
-#endif
#ifdef SNPRINTF_RETURN_TRUNC
static char basestring_vsnprintf_buf[16*1024];
#endif
@@ -54,22 +46,22 @@ basestring_vsnprintf(char *str, size_t size, const char *format, va_list ap)
if (size == 0)
{
#ifdef SNPRINTF_RETURN_TRUNC
- return BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf,
- sizeof(basestring_vsnprintf_buf),
- format, ap);
+ return vsnprintf(basestring_vsnprintf_buf,
+ sizeof(basestring_vsnprintf_buf),
+ format, ap);
#else
char buf[1];
- return BASESTRING_VSNPRINTF_FUNC(buf, 1, format, ap);
+ return vsnprintf(buf, 1, format, ap);
#endif
}
{
- int ret= BASESTRING_VSNPRINTF_FUNC(str, size, format, ap);
+ int ret= vsnprintf(str, size, format, ap);
#ifdef SNPRINTF_RETURN_TRUNC
if (ret == size-1 || ret == -1)
{
- ret= BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf,
- sizeof(basestring_vsnprintf_buf),
- format, ap);
+ ret= vsnprintf(basestring_vsnprintf_buf,
+ sizeof(basestring_vsnprintf_buf),
+ format, ap);
}
#endif
return ret;
diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c
index 7a537297861..0d254533708 100644
--- a/ndb/src/common/util/version.c
+++ b/ndb/src/common/util/version.c
@@ -17,6 +17,9 @@
#include <ndb_global.h>
#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;
@@ -38,14 +41,14 @@ Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build) {
const char * getVersionString(Uint32 version, const char * status) {
char buff[100];
if (status && status[0] != 0)
- snprintf(buff, sizeof(buff),
+ basestring_snprintf(buff, sizeof(buff),
"Version %d.%d.%d (%s)",
getMajor(version),
getMinor(version),
getBuild(version),
status);
else
- snprintf(buff, sizeof(buff),
+ basestring_snprintf(buff, sizeof(buff),
"Version %d.%d.%d",
getMajor(version),
getMinor(version),
@@ -67,8 +70,27 @@ 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(4,1,9), MAKE_VERSION(4,1,8), UG_Exact },
{ MAKE_VERSION(3,5,2), MAKE_VERSION(3,5,1), UG_Exact },
{ 0, 0, UG_Null }
};
@@ -79,8 +101,6 @@ struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = {
{ 0, 0, UG_Null }
};
-void ndbSetOwnVersion() {}
-
#else /* testing purposes */
struct NdbUpGradeCompatible ndbCompatibleTable_full[] = {
@@ -101,19 +121,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()
@@ -127,13 +134,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/cw/Makefile.am b/ndb/src/cw/Makefile.am
index b530922a3a7..7348fc9eab6 100644
--- a/ndb/src/cw/Makefile.am
+++ b/ndb/src/cw/Makefile.am
@@ -1 +1,4 @@
SUBDIRS = cpcd
+
+windoze-dsp:
+
diff --git a/ndb/src/cw/cpcd/Makefile.am b/ndb/src/cw/cpcd/Makefile.am
index 6af44a359fc..75f557b2af7 100644
--- a/ndb/src/cw/cpcd/Makefile.am
+++ b/ndb/src/cw/cpcd/Makefile.am
@@ -16,3 +16,5 @@ ndb_cpcd_LDFLAGS = @ndb_bin_am_ldflags@
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp:
diff --git a/ndb/src/kernel/Makefile.am b/ndb/src/kernel/Makefile.am
index 493ab4f9982..55d3c5a578f 100644
--- a/ndb/src/kernel/Makefile.am
+++ b/ndb/src/kernel/Makefile.am
@@ -59,3 +59,17 @@ LDADD += \
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: ndbd.dsp
+
+ndbd.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(ndbd_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
diff --git a/ndb/src/kernel/blocks/Makefile.am b/ndb/src/kernel/blocks/Makefile.am
index 0b2bc3b8c88..7ee90e6239f 100644
--- a/ndb/src/kernel/blocks/Makefile.am
+++ b/ndb/src/kernel/blocks/Makefile.am
@@ -15,3 +15,5 @@ SUBDIRS = \
suma \
grep \
dbtux
+
+windoze-dsp:
diff --git a/ndb/src/kernel/blocks/backup/Backup.cpp b/ndb/src/kernel/blocks/backup/Backup.cpp
index 9fc00883792..07aeb771c97 100644
--- a/ndb/src/kernel/blocks/backup/Backup.cpp
+++ b/ndb/src/kernel/blocks/backup/Backup.cpp
@@ -1272,10 +1272,6 @@ Backup::createAttributeMask(TablePtr tabPtr,
jam();
AttributePtr attr;
table.attributes.getPtr(attr, i);
- if(attr.p->data.key != 0){
- jam();
- continue;
- }
mask.set(i);
}
}
@@ -2961,12 +2957,9 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len)
tabPtr.p->schemaVersion = tmpTab.TableVersion;
tabPtr.p->noOfAttributes = tmpTab.NoOfAttributes;
- tabPtr.p->noOfKeys = tmpTab.NoOfKeyAttr;
tabPtr.p->noOfNull = 0;
tabPtr.p->noOfVariable = 0; // Computed while iterating over attribs
- tabPtr.p->sz_FixedKeys = 0; // Computed while iterating over attribs
tabPtr.p->sz_FixedAttributes = 0; // Computed while iterating over attribs
- tabPtr.p->variableKeyId = RNIL; // Computed while iterating over attribs
tabPtr.p->triggerIds[0] = ILLEGAL_TRIGGER_ID;
tabPtr.p->triggerIds[1] = ILLEGAL_TRIGGER_ID;
tabPtr.p->triggerIds[2] = ILLEGAL_TRIGGER_ID;
@@ -3001,7 +2994,6 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len)
attrPtr.p->data.nullable = tmp.AttributeNullableFlag;
attrPtr.p->data.fixed = (tmp.AttributeArraySize != 0);
- attrPtr.p->data.key = tmp.AttributeKeyFlag;
attrPtr.p->data.sz32 = sz32;
/**
@@ -3009,50 +3001,26 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len)
* 1) Fixed
* 2) Nullable
* 3) Variable
- * 4) Fixed key
- * 5) Variable key
*/
- if(attrPtr.p->data.key == false) {
+ if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == false) {
jam();
-
- if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == false) {
- jam();
- attrPtr.p->data.offset = tabPtr.p->sz_FixedAttributes;
- tabPtr.p->sz_FixedAttributes += sz32;
- }//if
-
- if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == true) {
- jam();
- attrPtr.p->data.offset = 0;
-
- attrPtr.p->data.offsetNull = tabPtr.p->noOfNull;
- tabPtr.p->noOfNull++;
- tabPtr.p->noOfVariable++;
- }//if
-
- if(attrPtr.p->data.fixed == false) {
- jam();
- tabPtr.p->noOfVariable++;
- ndbrequire(0);
- }//if
-
- } else if(attrPtr.p->data.key == true) {
+ attrPtr.p->data.offset = tabPtr.p->sz_FixedAttributes;
+ tabPtr.p->sz_FixedAttributes += sz32;
+ }//if
+
+ if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == true) {
jam();
- ndbrequire(attrPtr.p->data.nullable == false);
+ attrPtr.p->data.offset = 0;
- if(attrPtr.p->data.fixed == true) { // Fixed key
- jam();
- tabPtr.p->sz_FixedKeys += sz32;
- }//if
-
- if(attrPtr.p->data.fixed == false) { // Variable key
- jam();
- attrPtr.p->data.offset = 0;
- tabPtr.p->noOfVariable++;
- ndbrequire(tabPtr.p->variableKeyId == RNIL); // Only one variable key
- tabPtr.p->variableKeyId = attrPtr.i;
- ndbrequire(0);
- }//if
+ attrPtr.p->data.offsetNull = tabPtr.p->noOfNull;
+ tabPtr.p->noOfNull++;
+ tabPtr.p->noOfVariable++;
+ }//if
+
+ if(attrPtr.p->data.fixed == false) {
+ jam();
+ tabPtr.p->noOfVariable++;
+ ndbrequire(0);
}//if
it.next(); // Move Past EndOfAttribute
@@ -3362,7 +3330,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal)
Table & table = * tabPtr.p;
ScanFragReq * req = (ScanFragReq *)signal->getDataPtrSend();
const Uint32 parallelism = 16;
- const Uint32 attrLen = 5 + table.noOfAttributes - table.noOfKeys;
+ const Uint32 attrLen = 5 + table.noOfAttributes;
req->senderData = filePtr.i;
req->resultRef = reference();
@@ -3373,7 +3341,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal)
req->tableId = table.tableId;
ScanFragReq::setLockMode(req->requestInfo, 0);
ScanFragReq::setHoldLockFlag(req->requestInfo, 0);
- ScanFragReq::setKeyinfoFlag(req->requestInfo, 1);
+ ScanFragReq::setKeyinfoFlag(req->requestInfo, 0);
ScanFragReq::setAttrLen(req->requestInfo,attrLen);
req->transId1 = 0;
req->transId2 = (BACKUP << 20) + (getOwnNodeId() << 8);
@@ -3388,7 +3356,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal)
signal->theData[2] = (BACKUP << 20) + (getOwnNodeId() << 8);
// Return all
- signal->theData[3] = table.noOfAttributes - table.noOfKeys;
+ signal->theData[3] = table.noOfAttributes;
signal->theData[4] = 0;
signal->theData[5] = 0;
signal->theData[6] = 0;
@@ -3400,10 +3368,6 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal)
jam();
AttributePtr attr;
table.attributes.getPtr(attr, i);
- if(attr.p->data.key != 0) {
- jam();
- continue;
- }//if
AttributeHeader::init(&signal->theData[dataPos], i, 0);
dataPos++;
@@ -3513,64 +3477,19 @@ Backup::execTRANSID_AI(Signal* signal)
}
}
-void
-Backup::execKEYINFO20(Signal* signal)
-{
- jamEntry();
-
- const Uint32 filePtrI = signal->theData[0];
- const Uint32 keyLen = signal->theData[1];
- //const Uint32 scanInfo = signal->theData[2];
- //const Uint32 transId1 = signal->theData[3];
- //const Uint32 transId2 = signal->theData[4];
- const Uint32 dataLen = signal->length() - 5;
-
- BackupFilePtr filePtr;
- c_backupFilePool.getPtr(filePtr, filePtrI);
-
- OperationRecord & op = filePtr.p->operation;
-
- /**
- * Unpack data
- */
- ndbrequire(keyLen == dataLen);
- const Uint32 * src = &signal->theData[5];
- const Uint32 klFixed = op.getFixedKeySize();
- ndbrequire(keyLen >= klFixed);
-
- Uint32 * dst = op.newKey();
- memcpy(dst, src, klFixed << 2);
-
- const Uint32 szLeft = (keyLen - klFixed);
- if(szLeft > 0) {
- jam();
- src += klFixed;
- dst = op.newVariableKey(szLeft);
- memcpy(dst, src, (szLeft << 2));
- ndbrequire(0);
- }//if
-
- if(op.finished()){
- jam();
- op.newRecord(op.dst);
- }
-}
-
void
Backup::OperationRecord::init(const TablePtr & ptr)
{
tablePtr = ptr.i;
- noOfAttributes = (ptr.p->noOfAttributes - ptr.p->noOfKeys) + 1;
- variableKeyId = ptr.p->variableKeyId;
+ noOfAttributes = ptr.p->noOfAttributes;
sz_Bitmask = (ptr.p->noOfNull + 31) >> 5;
- sz_FixedKeys = ptr.p->sz_FixedKeys;
sz_FixedAttribs = ptr.p->sz_FixedAttributes;
if(ptr.p->noOfVariable == 0) {
jam();
- maxRecordSize = 1 + sz_Bitmask + sz_FixedKeys + sz_FixedAttribs;
+ maxRecordSize = 1 + sz_Bitmask + sz_FixedAttribs;
} else {
jam();
maxRecordSize =
diff --git a/ndb/src/kernel/blocks/backup/Backup.hpp b/ndb/src/kernel/blocks/backup/Backup.hpp
index fb29cb03b96..1a5d6c7a925 100644
--- a/ndb/src/kernel/blocks/backup/Backup.hpp
+++ b/ndb/src/kernel/blocks/backup/Backup.hpp
@@ -76,7 +76,6 @@ protected:
*/
void execSCAN_HBREP(Signal* signal);
void execTRANSID_AI(Signal* signal);
- void execKEYINFO20(Signal* signal);
void execSCAN_FRAGREF(Signal* signal);
void execSCAN_FRAGCONF(Signal* signal);
@@ -172,8 +171,8 @@ public:
struct Data {
Uint8 nullable;
Uint8 fixed;
- Uint8 key;
- Uint8 unused;
+ Uint8 unused;
+ Uint8 unused2;
Uint32 sz32; // No of 32 bit words
Uint32 offset; // Relative DataFixedAttributes/DataFixedKeys
Uint32 offsetNull; // In NullBitmask
@@ -199,12 +198,9 @@ public:
Uint32 frag_mask;
Uint32 tableType;
Uint32 noOfNull;
- Uint32 noOfKeys;
Uint32 noOfAttributes;
Uint32 noOfVariable;
- Uint32 sz_FixedKeys;
Uint32 sz_FixedAttributes;
- Uint32 variableKeyId;
Uint32 triggerIds[3];
bool triggerAllocated[3];
@@ -224,7 +220,6 @@ public:
* Once per table
*/
void init(const TablePtr & ptr);
- inline Uint32 getFixedKeySize() const { return sz_FixedKeys; }
/**
* Once per fragment
@@ -247,23 +242,19 @@ public:
/**
* Per attribute
*/
- Uint32 * newKey();
void nullAttribute(Uint32 nullOffset);
Uint32 * newNullable(Uint32 attrId, Uint32 sz);
Uint32 * newAttrib(Uint32 offset, Uint32 sz);
Uint32 * newVariable(Uint32 id, Uint32 sz);
- Uint32 * newVariableKey(Uint32 sz);
private:
Uint32* base;
Uint32* dst_Length;
Uint32* dst_Bitmask;
- Uint32* dst_FixedKeys;
Uint32* dst_FixedAttribs;
BackupFormat::DataFile::VariableData* dst_VariableData;
Uint32 noOfAttributes; // No of Attributes
- Uint32 variableKeyId; // Id of variable key
Uint32 attrLeft; // No of attributes left
Uint32 opNoDone;
@@ -289,7 +280,6 @@ public:
* sizes of part
*/
Uint32 sz_Bitmask;
- Uint32 sz_FixedKeys;
Uint32 sz_FixedAttribs;
public:
@@ -629,7 +619,6 @@ Backup::OperationRecord::newRecord(Uint32 * p){
base = p;
dst_Length = p; p += 1;
dst_Bitmask = p; p += sz_Bitmask;
- dst_FixedKeys = p; p += sz_FixedKeys;
dst_FixedAttribs = p; p += sz_FixedAttribs;
dst_VariableData = (BackupFormat::DataFile::VariableData*)p;
BitmaskImpl::clear(sz_Bitmask, dst_Bitmask);
@@ -647,14 +636,6 @@ Backup::OperationRecord::newAttrib(Uint32 offset, Uint32 sz){
}
inline
-Uint32 *
-Backup::OperationRecord::newKey(){
- attrLeft --;
- attrSzLeft = 0;
- return dst_FixedKeys;
-}
-
-inline
void
Backup::OperationRecord::nullAttribute(Uint32 offsetNull){
attrLeft --;
@@ -693,28 +674,13 @@ Backup::OperationRecord::newVariable(Uint32 id, Uint32 sz){
}
inline
-Uint32 *
-Backup::OperationRecord::newVariableKey(Uint32 sz){
- attrLeft--;
- attrSzLeft = 0;
- attrSzTotal += sz;
-
- dst = &dst_VariableData->Data[0];
- dst_VariableData->Sz = htonl(sz);
- dst_VariableData->Id = htonl(variableKeyId);
-
- dst_VariableData = (BackupFormat::DataFile::VariableData *)(dst + sz);
- return dst;
-}
-
-inline
bool
Backup::OperationRecord::finished(){
if(attrLeft != 0 || attrSzLeft != 0){
return false;
}
- opLen += attrSzTotal + sz_FixedKeys;
+ opLen += attrSzTotal;
opNoDone++;
scanStop = dst = (Uint32 *)dst_VariableData;
diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp
index d98541f2ea8..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
@@ -127,7 +128,6 @@ Backup::Backup(const Configuration & conf) :
addRecSignal(GSN_SCAN_HBREP, &Backup::execSCAN_HBREP);
addRecSignal(GSN_TRANSID_AI, &Backup::execTRANSID_AI);
- addRecSignal(GSN_KEYINFO20, &Backup::execKEYINFO20);
addRecSignal(GSN_SCAN_FRAGREF, &Backup::execSCAN_FRAGREF);
addRecSignal(GSN_SCAN_FRAGCONF, &Backup::execSCAN_FRAGCONF);
@@ -205,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/backup/Makefile.am b/ndb/src/kernel/blocks/backup/Makefile.am
index e669febdc0d..c8f44f31292 100644
--- a/ndb/src/kernel/blocks/backup/Makefile.am
+++ b/ndb/src/kernel/blocks/backup/Makefile.am
@@ -8,3 +8,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libbackup.dsp
+
+libbackup.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libbackup_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
index 234d832655c..c1dca184466 100644
--- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
+++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
@@ -150,6 +150,7 @@ void Cmvmi::execNDB_TAMPER(Signal* signal)
ndbrequire(false);
}
+#ifndef NDB_WIN32
if(ERROR_INSERTED(9996)){
simulate_error_during_shutdown= SIGSEGV;
ndbrequire(false);
@@ -159,6 +160,7 @@ void Cmvmi::execNDB_TAMPER(Signal* signal)
simulate_error_during_shutdown= SIGSEGV;
kill(getpid(), SIGABRT);
}
+#endif
}//execNDB_TAMPER()
void Cmvmi::execSET_LOGLEVELORD(Signal* signal)
@@ -193,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)){
@@ -225,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
@@ -269,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
@@ -1117,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/cmvmi/Makefile.am b/ndb/src/kernel/blocks/cmvmi/Makefile.am
index fdd43932682..dc2e12746fd 100644
--- a/ndb/src/kernel/blocks/cmvmi/Makefile.am
+++ b/ndb/src/kernel/blocks/cmvmi/Makefile.am
@@ -8,3 +8,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libcmvmi.dsp
+
+libcmvmi.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libcmvmi_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp
index c9b6c0ea17d..64647f2e41f 100644
--- a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp
+++ b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp
@@ -265,4 +265,4 @@ Dbacc::~Dbacc()
}//Dbacc::~Dbacc()
-BLOCK_FUNCTIONS(Dbacc);
+BLOCK_FUNCTIONS(Dbacc)
diff --git a/ndb/src/kernel/blocks/dbacc/Makefile.am b/ndb/src/kernel/blocks/dbacc/Makefile.am
index eeca061dead..ca1b1efac37 100644
--- a/ndb/src/kernel/blocks/dbacc/Makefile.am
+++ b/ndb/src/kernel/blocks/dbacc/Makefile.am
@@ -10,3 +10,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libdbacc.dsp
+
+libdbacc.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libdbacc_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
index 8327b7fe390..fa2fc856c92 100644
--- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
@@ -532,7 +532,7 @@ Dbdict::writeTableFile(Signal* signal, Uint32 tableId,
Uint32 sz = tabInfoPtr.sz + ZPAGE_HEADER_SIZE;
c_writeTableRecord.noOfPages = DIV(sz, ZSIZE_OF_PAGES_IN_WORDS);
- c_writeTableRecord.tableWriteState = WriteTableRecord::CALLBACK;
+ c_writeTableRecord.tableWriteState = WriteTableRecord::TWR_CALLBACK;
c_writeTableRecord.m_callback = * callback;
c_writeTableRecord.pageId = 0;
@@ -651,7 +651,7 @@ void Dbdict::closeWriteTableConf(Signal* signal,
case WriteTableRecord::WRITE_RESTART_FROM_OWN :
ndbrequire(false);
break;
- case WriteTableRecord::CALLBACK:
+ case WriteTableRecord::TWR_CALLBACK:
jam();
execute(signal, c_writeTableRecord.m_callback, 0);
return;
@@ -1192,7 +1192,7 @@ Dbdict::~Dbdict()
{
}//Dbdict::~Dbdict()
-BLOCK_FUNCTIONS(Dbdict);
+BLOCK_FUNCTIONS(Dbdict)
void Dbdict::initCommonData()
{
@@ -2387,7 +2387,7 @@ Dbdict::restartCreateTab_readTableConf(Signal* signal,
ndbrequire(c_writeTableRecord.tableWriteState == WriteTableRecord::IDLE);
c_writeTableRecord.noOfPages = c_readTableRecord.noOfPages;
c_writeTableRecord.pageId = c_readTableRecord.pageId;
- c_writeTableRecord.tableWriteState = WriteTableRecord::CALLBACK;
+ c_writeTableRecord.tableWriteState = WriteTableRecord::TWR_CALLBACK;
c_writeTableRecord.m_callback.m_callbackData = callbackData;
c_writeTableRecord.m_callback.m_callbackFunction =
safe_cast(&Dbdict::restartCreateTab_writeTableConf);
diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
index af80bcf5f94..5fc4742e829 100644
--- a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
+++ b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
@@ -639,7 +639,7 @@ private:
WRITE_ADD_TABLE_SLAVE = 2,
WRITE_RESTART_FROM_MASTER = 3,
WRITE_RESTART_FROM_OWN = 4,
- CALLBACK = 5
+ TWR_CALLBACK = 5
};
TableWriteState tableWriteState;
Callback m_callback;
diff --git a/ndb/src/kernel/blocks/dbdict/Makefile.am b/ndb/src/kernel/blocks/dbdict/Makefile.am
index dc4c4fe4734..9a0d68f8148 100644
--- a/ndb/src/kernel/blocks/dbdict/Makefile.am
+++ b/ndb/src/kernel/blocks/dbdict/Makefile.am
@@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libdbdict.dsp
+
+libdbdict.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libdbdict_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
index 0a2d50cb876..ee67bf47d7b 100644
--- a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
+++ b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
@@ -1468,7 +1468,7 @@ private:
Uint32 c_blockCommitNo;
bool getBlockCommit() const {
- return c_blockCommit == true || cgckptflag == true;
+ return c_blockCommit || cgckptflag;
}
/**
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/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
index c84908848f2..de08449730f 100644
--- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
+++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
@@ -12941,7 +12941,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
Uint32 nodeOrder[MAX_REPLICAS];
const Uint32 noOfReplicas = extractNodeInfo(fragPtr.p, nodeOrder);
char buf[100];
- snprintf(buf, sizeof(buf), " Table %d Fragment %d - ", tabPtr.i, j);
+ BaseString::snprintf(buf, sizeof(buf), " Table %d Fragment %d - ", tabPtr.i, j);
for(Uint32 k = 0; k < noOfReplicas; k++){
char tmp[100];
BaseString::snprintf(tmp, sizeof(tmp), "%d ", nodeOrder[k]);
@@ -13152,7 +13152,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
getFragstore(tabPtr.p, fid, fragPtr);
char buf[100], buf2[100];
- snprintf(buf, sizeof(buf), " Fragment %d: noLcpReplicas==%d ",
+ BaseString::snprintf(buf, sizeof(buf), " Fragment %d: noLcpReplicas==%d ",
fid, fragPtr.p->noLcpReplicas);
Uint32 num=0;
diff --git a/ndb/src/kernel/blocks/dbdih/Makefile.am b/ndb/src/kernel/blocks/dbdih/Makefile.am
index 2ee8017ec13..d6ad380b806 100644
--- a/ndb/src/kernel/blocks/dbdih/Makefile.am
+++ b/ndb/src/kernel/blocks/dbdih/Makefile.am
@@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libdbdih.dsp
+
+libdbdih.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libdbdih_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
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/dblqh/Makefile.am b/ndb/src/kernel/blocks/dblqh/Makefile.am
index 3a58dba742e..854860b269c 100644
--- a/ndb/src/kernel/blocks/dblqh/Makefile.am
+++ b/ndb/src/kernel/blocks/dblqh/Makefile.am
@@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libdblqh.dsp
+
+libdblqh.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libdblqh_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
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/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
index 42821e4fe7f..f964cc2fd9c 100644
--- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
@@ -6340,7 +6340,7 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck)
*------------------------------------------------------------------*/
char buf[96]; buf[0] = 0;
char buf2[96];
- snprintf(buf, sizeof(buf), "TC %d: %d ops:",
+ BaseString::snprintf(buf, sizeof(buf), "TC %d: %d ops:",
__LINE__, apiConnectptr.i);
for(Uint32 i = 0; i<TloopCount; i++){
BaseString::snprintf(buf2, sizeof(buf2), "%s %d", buf, tmp[i]);
diff --git a/ndb/src/kernel/blocks/dbtc/Makefile.am b/ndb/src/kernel/blocks/dbtc/Makefile.am
index 4aa514c0aba..98ee2639bac 100644
--- a/ndb/src/kernel/blocks/dbtc/Makefile.am
+++ b/ndb/src/kernel/blocks/dbtc/Makefile.am
@@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libdbtc.dsp
+
+libdbtc.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtc_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
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/dbtup/Makefile.am b/ndb/src/kernel/blocks/dbtup/Makefile.am
index 7e94a01d43b..e51410e6be3 100644
--- a/ndb/src/kernel/blocks/dbtup/Makefile.am
+++ b/ndb/src/kernel/blocks/dbtup/Makefile.am
@@ -25,3 +25,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libdbtup.dsp
+
+libdbtup.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtup_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
index cd7a97d4b17..b9cb179c6b2 100644
--- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
+++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
@@ -1064,7 +1064,7 @@ Dbtux::Index::Index() :
m_fragId[i] = ZNIL;
m_fragPtrI[i] = RNIL;
};
-};
+}
// Dbtux::Frag
@@ -1100,7 +1100,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 18aa914de05..8990d6c86b6 100644
--- a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
+++ b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
@@ -293,4 +293,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/dbtux/Makefile.am b/ndb/src/kernel/blocks/dbtux/Makefile.am
index 7d012924522..b5951e8ed37 100644
--- a/ndb/src/kernel/blocks/dbtux/Makefile.am
+++ b/ndb/src/kernel/blocks/dbtux/Makefile.am
@@ -18,3 +18,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libdbtux.dsp
+
+libdbtux.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtux_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
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/dbutil/Makefile.am b/ndb/src/kernel/blocks/dbutil/Makefile.am
index 763875d578f..925356c2f76 100644
--- a/ndb/src/kernel/blocks/dbutil/Makefile.am
+++ b/ndb/src/kernel/blocks/dbutil/Makefile.am
@@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libdbutil.dsp
+
+libdbutil.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libdbutil_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/kernel/blocks/grep/Grep.cpp b/ndb/src/kernel/blocks/grep/Grep.cpp
index 0e41182348f..e89361dab06 100644
--- a/ndb/src/kernel/blocks/grep/Grep.cpp
+++ b/ndb/src/kernel/blocks/grep/Grep.cpp
@@ -603,7 +603,7 @@ Grep::PSCoord::execCREATE_SUBID_CONF(Signal* signal)
GrepEvent::GrepPS_CreateSubIdConf,
subId,
subKey,
- (Uint32)GrepError::NO_ERROR);
+ (Uint32)GrepError::GE_NO_ERROR);
}
void
@@ -612,7 +612,7 @@ Grep::PSCoord::execCREATE_SUBID_REF(Signal* signal) {
CreateSubscriptionIdRef const * ref =
(CreateSubscriptionIdRef *)signal->getDataPtr();
Uint32 subData = ref->subscriberData;
- GrepError::Code err;
+ GrepError::GE_Code err;
Uint32 sendersBlockRef = signal->getSendersBlockRef();
if(sendersBlockRef == SUMA_REF)
@@ -624,7 +624,7 @@ Grep::PSCoord::execCREATE_SUBID_REF(Signal* signal) {
ndbrequire(false); /* Added since errorcode err unhandled
* TODO: fix correct errorcode
*/
- err= GrepError::NO_ERROR; // remove compiler warning
+ err= GrepError::GE_NO_ERROR; // remove compiler warning
}
SubCoordinatorPtr subPtr;
@@ -824,7 +824,7 @@ Grep::PSPart::execSUB_CREATE_REF(Signal* signal)
jamEntry();
SubCreateRef * const ref = (SubCreateRef *)signal->getDataPtr();
Uint32 subData = ref->subscriberData;
- GrepError::Code err = (GrepError::Code)ref->err;
+ GrepError::GE_Code err = (GrepError::GE_Code)ref->err;
SubscriptionPtr subPtr;
c_subscriptions.getPtr(subPtr, subData);
sendRefToPSCoord(signal, *subPtr.p, err /*error*/);
@@ -867,7 +867,7 @@ Grep::PSCoord::execGREP_CREATE_CONF(Signal* signal)
GrepEvent::GrepPS_SubCreateConf,
subId,
subKey,
- (Uint32)GrepError::NO_ERROR);
+ (Uint32)GrepError::GE_NO_ERROR);
c_subCoordinatorPool.release(subPtr);
@@ -889,7 +889,7 @@ Grep::PSCoord::execGREP_CREATE_REF(Signal* signal)
SubCoordinatorPtr subPtr;
c_runningSubscriptions.getPtr(subPtr, subData);
- sendRefToSS(signal, *subPtr.p, (GrepError::Code)err /*error*/);
+ sendRefToSS(signal, *subPtr.p, (GrepError::GE_Code)err /*error*/);
}
@@ -1046,7 +1046,7 @@ Grep::PSPart::execSUB_START_REF(Signal* signal)
{
SubStartRef * const ref = (SubStartRef *)signal->getDataPtr();
Uint32 subData = ref->subscriberData;
- GrepError::Code err = (GrepError::Code)ref->err;
+ GrepError::GE_Code err = (GrepError::GE_Code)ref->err;
SubscriptionData::Part part = (SubscriptionData::Part)ref->part;
SubscriptionPtr subPtr;
c_subscriptions.getPtr(subPtr, subData);
@@ -1102,7 +1102,7 @@ Grep::PSCoord::execGREP_START_CONF(Signal* signal)
EventReport::GrepSubscriptionInfo,
GrepEvent::GrepPS_SubStartMetaConf,
subId, subKey,
- (Uint32)GrepError::NO_ERROR);
+ (Uint32)GrepError::GE_NO_ERROR);
c_subCoordinatorPool.release(subPtr);
break;
@@ -1118,7 +1118,7 @@ Grep::PSCoord::execGREP_START_CONF(Signal* signal)
EventReport::GrepSubscriptionInfo,
GrepEvent::GrepPS_SubStartDataConf,
subId, subKey,
- (Uint32)GrepError::NO_ERROR);
+ (Uint32)GrepError::GE_NO_ERROR);
c_subCoordinatorPool.release(subPtr);
@@ -1145,7 +1145,7 @@ Grep::PSCoord::execGREP_START_REF(Signal* signal)
jamEntry();
GrepStartRef * const ref = (GrepStartRef *)signal->getDataPtr();
Uint32 subData = ref->senderData;
- GrepError::Code err = (GrepError::Code)ref->err;
+ GrepError::GE_Code err = (GrepError::GE_Code)ref->err;
SubscriptionData::Part part = (SubscriptionData::Part)ref->part;
SubCoordinatorPtr subPtr;
@@ -1301,7 +1301,7 @@ Grep::PSPart::execSUB_REMOVE_REF(Signal* signal)
jamEntry();
SubRemoveRef * const ref = (SubRemoveRef *)signal->getDataPtr();
Uint32 subData = ref->subscriberData;
- /* GrepError::Code err = (GrepError::Code)ref->err;*/
+ /* GrepError::GE_Code err = (GrepError::GE_Code)ref->err;*/
SubscriptionPtr subPtr;
c_subscriptions.getPtr(subPtr, subData);
@@ -1342,7 +1342,7 @@ Grep::PSCoord::execGREP_REMOVE_CONF(Signal* signal)
EventReport::GrepSubscriptionInfo,
GrepEvent::GrepPS_SubRemoveConf,
subId, subKey,
- GrepError::NO_ERROR);
+ GrepError::GE_NO_ERROR);
GrepSubRemoveConf * grepConf = (GrepSubRemoveConf *) conf;
grepConf->subscriptionId = subId;
@@ -1375,7 +1375,7 @@ Grep::PSCoord::execGREP_REMOVE_REF(Signal* signal)
subPtr.p = c_runningSubscriptions.getPtr(subPtr.i);
if(subData == subPtr.i)
{
- sendRefToSS(signal, *subPtr.p, (GrepError::Code)err /*error*/);
+ sendRefToSS(signal, *subPtr.p, (GrepError::GE_Code)err /*error*/);
c_runningSubscriptions.release(subPtr);
return;
}
@@ -1633,7 +1633,7 @@ Grep::PSPart::execSUB_SYNC_REF(Signal* signal) {
jamEntry();
SubSyncRef * const ref = (SubSyncRef *)signal->getDataPtr();
Uint32 subData = ref->subscriberData;
- GrepError::Code err = (GrepError::Code)ref->err;
+ GrepError::GE_Code err = (GrepError::GE_Code)ref->err;
SubscriptionData::Part part = (SubscriptionData::Part)ref->part;
SubscriptionPtr subPtr;
@@ -1677,7 +1677,7 @@ Grep::PSCoord::execGREP_SYNC_CONF(Signal* signal)
/* @todo Johan: Add firstGCI here. /Lars */
m_grep->sendEventRep(signal, EventReport::GrepSubscriptionInfo,
event, subId, subKey,
- (Uint32)GrepError::NO_ERROR,
+ (Uint32)GrepError::GE_NO_ERROR,
lastGCI);
/*************************
@@ -1707,7 +1707,7 @@ Grep::PSCoord::execGREP_SYNC_REF(Signal* signal) {
GrepSyncRef * const ref = (GrepSyncRef *)signal->getDataPtr();
Uint32 subData = ref->senderData;
SubscriptionData::Part part = (SubscriptionData::Part)ref->part;
- GrepError::Code err = (GrepError::Code)ref->err;
+ GrepError::GE_Code err = (GrepError::GE_Code)ref->err;
SubCoordinatorPtr subPtr;
c_runningSubscriptions.getPtr(subPtr, subData);
sendRefToSS(signal, *subPtr.p, err /*error*/, part);
@@ -1718,7 +1718,7 @@ Grep::PSCoord::execGREP_SYNC_REF(Signal* signal) {
void
Grep::PSCoord::sendRefToSS(Signal * signal,
SubCoordinator sub,
- GrepError::Code err,
+ GrepError::GE_Code err,
SubscriptionData::Part part) {
/**
@@ -1843,7 +1843,7 @@ Grep::PSCoord::sendRefToSS(Signal * signal,
void
Grep::PSPart::sendRefToPSCoord(Signal * signal,
Subscription sub,
- GrepError::Code err,
+ GrepError::GE_Code err,
SubscriptionData::Part part) {
jam();
diff --git a/ndb/src/kernel/blocks/grep/Grep.hpp b/ndb/src/kernel/blocks/grep/Grep.hpp
index eeabac36966..7d3dd916ecc 100644
--- a/ndb/src/kernel/blocks/grep/Grep.hpp
+++ b/ndb/src/kernel/blocks/grep/Grep.hpp
@@ -380,16 +380,16 @@ public:
Uint32 subId,
Uint32 subKey,
BlockReference to,
- GrepError::Code err);
+ GrepError::GE_Code err);
void sendSubRemoveRef_SS(Signal * signal,
SubCoordinator sub,
- GrepError::Code err);
+ GrepError::GE_Code err);
void sendRefToSS(Signal * signal,
SubCoordinator sub,
- GrepError::Code err,
+ GrepError::GE_Code err,
SubscriptionData::Part part = (SubscriptionData::Part)0);
void setRepRef(BlockReference rr) { m_repRef = rr; };
@@ -496,7 +496,7 @@ public:
void sendRefToPSCoord(Signal * signal,
Subscription sub,
- GrepError::Code err,
+ GrepError::GE_Code err,
SubscriptionData::Part part = (SubscriptionData::Part)0);
//protected:
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/grep/Makefile.am b/ndb/src/kernel/blocks/grep/Makefile.am
index 31081c7b6a0..6d2b422784b 100644
--- a/ndb/src/kernel/blocks/grep/Makefile.am
+++ b/ndb/src/kernel/blocks/grep/Makefile.am
@@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libgrep.dsp
+
+libgrep.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libgrep_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/kernel/blocks/ndbcntr/Makefile.am b/ndb/src/kernel/blocks/ndbcntr/Makefile.am
index 9230b55b374..3f24675b2b3 100644
--- a/ndb/src/kernel/blocks/ndbcntr/Makefile.am
+++ b/ndb/src/kernel/blocks/ndbcntr/Makefile.am
@@ -10,3 +10,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libndbcntr.dsp
+
+libndbcntr.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libndbcntr_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
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/Makefile.am b/ndb/src/kernel/blocks/ndbfs/Makefile.am
index c2b663c5042..a22386f8612 100644
--- a/ndb/src/kernel/blocks/ndbfs/Makefile.am
+++ b/ndb/src/kernel/blocks/ndbfs/Makefile.am
@@ -11,3 +11,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libndbfs.dsp
+
+libndbfs.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libndbfs_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
index 56e3d3abbed..9c943760e31 100644
--- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
@@ -730,7 +730,7 @@ Ndbfs::scanIPC(Signal* signal)
jam();
report(request, signal);
theRequestPool->put(request);
- return &request;
+ return true;
}
return false;
}
@@ -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/Makefile.am b/ndb/src/kernel/blocks/qmgr/Makefile.am
index 52cadb3bd3d..278af2a7865 100644
--- a/ndb/src/kernel/blocks/qmgr/Makefile.am
+++ b/ndb/src/kernel/blocks/qmgr/Makefile.am
@@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libqmgr.dsp
+
+libqmgr.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libqmgr_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
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/Makefile.am b/ndb/src/kernel/blocks/suma/Makefile.am
index 4dacb22af51..5a74dbb74eb 100644
--- a/ndb/src/kernel/blocks/suma/Makefile.am
+++ b/ndb/src/kernel/blocks/suma/Makefile.am
@@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libsuma.dsp
+
+libsuma.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libsuma_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
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/Makefile.am b/ndb/src/kernel/blocks/trix/Makefile.am
index 803da815cf0..343063a6283 100644
--- a/ndb/src/kernel/blocks/trix/Makefile.am
+++ b/ndb/src/kernel/blocks/trix/Makefile.am
@@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libtrix.dsp
+
+libtrix.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libtrix_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
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/error/Makefile.am b/ndb/src/kernel/error/Makefile.am
index 4514d2d105c..54f3de2d76d 100644
--- a/ndb/src/kernel/error/Makefile.am
+++ b/ndb/src/kernel/error/Makefile.am
@@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: liberror.dsp
+
+liberror.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(liberror_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp
index f34e16318cd..44fe1725c9e 100644
--- a/ndb/src/kernel/main.cpp
+++ b/ndb/src/kernel/main.cpp
@@ -69,11 +69,13 @@ int main(int argc, char** argv)
}
{ // Do configuration
- signal(SIGPIPE, SIG_IGN);
+#ifndef NDB_WIN32
+ signal(SIGPIPE, SIG_IGN);
+#endif
theConfig->fetch_configuration();
}
-
- chdir(NdbConfig_get_path(0));
+
+ my_setwd(NdbConfig_get_path(0), MYF(0));
if (theConfig->getDaemonMode()) {
// Become a daemon
@@ -87,6 +89,7 @@ int main(int argc, char** argv)
}
}
+#ifndef NDB_WIN32
for(pid_t child = fork(); child != 0; child = fork()){
/**
* Parent
@@ -137,6 +140,9 @@ int main(int argc, char** argv)
}
g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid());
+#else
+ g_eventLogger.info("Ndb started");
+#endif
theConfig->setupConfiguration();
systemInfo(* theConfig, * theConfig->m_logLevel);
@@ -268,7 +274,7 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){
void
catchsigs(bool ignore){
-#if ! defined NDB_SOFTOSE && !defined NDB_OSE
+#if !defined NDB_WIN32 && !defined NDB_SOFTOSE && !defined NDB_OSE
static const int signals_shutdown[] = {
#ifdef SIGBREAK
@@ -310,7 +316,6 @@ catchsigs(bool ignore){
SIGTRAP
#endif
};
-#endif
static const int signals_ignore[] = {
SIGPIPE
@@ -323,6 +328,7 @@ catchsigs(bool ignore){
handler_register(signals_error[i], handler_error, ignore);
for(i = 0; i < sizeof(signals_ignore)/sizeof(signals_ignore[0]); i++)
handler_register(signals_ignore[i], SIG_IGN, ignore);
+#endif
}
extern "C"
@@ -341,8 +347,10 @@ handler_error(int signum){
if (thread_id != 0 && thread_id == my_thread_id())
{
// Shutdown thread received signal
- signal(signum, SIG_DFL);
+#ifndef NDB_WIN32
+ signal(signum, SIG_DFL);
kill(getpid(), signum);
+#endif
while(true)
NdbSleep_MilliSleep(10);
}
diff --git a/ndb/src/kernel/vm/Callback.hpp b/ndb/src/kernel/vm/Callback.hpp
index bf1ae5968d3..6a619ba7859 100644
--- a/ndb/src/kernel/vm/Callback.hpp
+++ b/ndb/src/kernel/vm/Callback.hpp
@@ -20,12 +20,5 @@
/**
* Block callbacks
*/
-typedef void (SimulatedBlock::* CallbackFunction)(class Signal*,
- Uint32 callbackData,
- Uint32 returnCode);
-struct Callback {
- CallbackFunction m_callbackFunction;
- Uint32 m_callbackData;
-};
#endif
diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp
index 931b4da5a17..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 },
@@ -281,19 +287,19 @@ static char * get_and_validate_path(ndb_mgm_configuration_iterator &iter,
memset(buf2, 0,sizeof(buf2));
#ifdef NDB_WIN32
char* szFilePart;
- if(!GetFullPathName(path, sizeof(buf2), buf2, &szFilePart)
- || (::GetFileAttributes(alloc_path)&FILE_ATTRIBUTE_READONLY))
+ if(!GetFullPathName(path, sizeof(buf2), buf2, &szFilePart) ||
+ (GetFileAttributes(buf2) & FILE_ATTRIBUTE_READONLY))
#else
- if((::realpath(path, buf2) == NULL)||
+ if((::realpath(path, buf2) == NULL)||
(::access(buf2, W_OK) != 0))
#endif
- {
- ERROR_SET(fatal, AFS_ERROR_INVALIDPATH, path, " Filename::init()");
- }
-
+ {
+ ERROR_SET(fatal, AFS_ERROR_INVALIDPATH, path, " Filename::init()");
+ }
+
if (strcmp(&buf2[strlen(buf2) - 1], DIR_SEPARATOR))
strcat(buf2, DIR_SEPARATOR);
-
+
return strdup(buf2);
}
@@ -561,7 +567,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){
noOfDBNodes++; // No of NDB processes
if(nodeId > MAX_NDB_NODES){
- snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d",
+ BaseString::snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d",
MAX_NDB_NODES);
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf);
}
@@ -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/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp
index a5897cd4064..adf3c438945 100644
--- a/ndb/src/kernel/vm/Emulator.cpp
+++ b/ndb/src/kernel/vm/Emulator.cpp
@@ -179,12 +179,14 @@ NdbShutdown(NdbShutdownType type,
exit(-1);
#endif
}
-
+
+#ifndef NDB_WIN32
if (simulate_error_during_shutdown) {
kill(getpid(), simulate_error_during_shutdown);
while(true)
NdbSleep_MilliSleep(10);
}
+#endif
globalEmulatorData.theWatchDog->doStop();
diff --git a/ndb/src/kernel/vm/Makefile.am b/ndb/src/kernel/vm/Makefile.am
index 4e9dbe36c78..0dce9285ae3 100644
--- a/ndb/src/kernel/vm/Makefile.am
+++ b/ndb/src/kernel/vm/Makefile.am
@@ -27,3 +27,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libkernel.dsp
+
+libkernel.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libkernel_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/kernel/vm/Mutex.cpp b/ndb/src/kernel/vm/Mutex.cpp
index 1dbc6e7ec4a..aab9e74312b 100644
--- a/ndb/src/kernel/vm/Mutex.cpp
+++ b/ndb/src/kernel/vm/Mutex.cpp
@@ -19,48 +19,51 @@
#include "Mutex.hpp"
#include <signaldata/UtilLock.hpp>
-MutexManager::MutexManager(class SimulatedBlock & block)
+SimulatedBlock::MutexManager::MutexManager(class SimulatedBlock & block)
: m_block(block),
m_activeMutexes(m_mutexPool) {
}
bool
-MutexManager::setSize(Uint32 maxNoOfActiveMutexes){
+SimulatedBlock::MutexManager::setSize(Uint32 maxNoOfActiveMutexes){
return m_mutexPool.setSize(maxNoOfActiveMutexes);
}
Uint32
-MutexManager::getSize() const {
+SimulatedBlock::MutexManager::getSize() const {
return m_mutexPool.getSize();
}
bool
-MutexManager::seize(ActiveMutexPtr& ptr){
+SimulatedBlock::MutexManager::seize(ActiveMutexPtr& ptr){
return m_activeMutexes.seize(ptr);
}
void
-MutexManager::release(Uint32 activeMutexPtrI){
+SimulatedBlock::MutexManager::release(Uint32 activeMutexPtrI){
m_activeMutexes.release(activeMutexPtrI);
}
void
-MutexManager::getPtr(ActiveMutexPtr& ptr){
+SimulatedBlock::MutexManager::getPtr(ActiveMutexPtr& ptr){
m_activeMutexes.getPtr(ptr);
}
BlockReference
-MutexManager::reference() const {
+SimulatedBlock::MutexManager::reference() const {
return m_block.reference();
}
void
-MutexManager::progError(int line, int err_code, const char* extra) {
+SimulatedBlock::MutexManager::progError(int line,
+ int err_code,
+ const char* extra)
+{
m_block.progError(line, err_code, extra);
}
void
-MutexManager::create(Signal* signal, ActiveMutexPtr& ptr){
+SimulatedBlock::MutexManager::create(Signal* signal, ActiveMutexPtr& ptr){
UtilCreateLockReq * req = (UtilCreateLockReq*)signal->getDataPtrSend();
req->senderData = ptr.i;
@@ -78,7 +81,7 @@ MutexManager::create(Signal* signal, ActiveMutexPtr& ptr){
}
void
-MutexManager::execUTIL_CREATE_LOCK_REF(Signal* signal){
+SimulatedBlock::MutexManager::execUTIL_CREATE_LOCK_REF(Signal* signal){
UtilCreateLockRef * ref = (UtilCreateLockRef*)signal->getDataPtr();
ActiveMutexPtr ptr;
@@ -91,7 +94,7 @@ MutexManager::execUTIL_CREATE_LOCK_REF(Signal* signal){
}
void
-MutexManager::execUTIL_CREATE_LOCK_CONF(Signal* signal){
+SimulatedBlock::MutexManager::execUTIL_CREATE_LOCK_CONF(Signal* signal){
UtilCreateLockConf * conf = (UtilCreateLockConf*)signal->getDataPtr();
ActiveMutexPtr ptr;
@@ -105,7 +108,7 @@ MutexManager::execUTIL_CREATE_LOCK_CONF(Signal* signal){
void
-MutexManager::destroy(Signal* signal, ActiveMutexPtr& ptr){
+SimulatedBlock::MutexManager::destroy(Signal* signal, ActiveMutexPtr& ptr){
UtilDestroyLockReq * req = (UtilDestroyLockReq*)signal->getDataPtrSend();
req->senderData = ptr.i;
@@ -123,7 +126,7 @@ MutexManager::destroy(Signal* signal, ActiveMutexPtr& ptr){
}
void
-MutexManager::execUTIL_DESTORY_LOCK_REF(Signal* signal){
+SimulatedBlock::MutexManager::execUTIL_DESTORY_LOCK_REF(Signal* signal){
UtilDestroyLockRef * ref = (UtilDestroyLockRef*)signal->getDataPtr();
ActiveMutexPtr ptr;
m_activeMutexes.getPtr(ptr, ref->senderData);
@@ -135,7 +138,7 @@ MutexManager::execUTIL_DESTORY_LOCK_REF(Signal* signal){
}
void
-MutexManager::execUTIL_DESTORY_LOCK_CONF(Signal* signal){
+SimulatedBlock::MutexManager::execUTIL_DESTORY_LOCK_CONF(Signal* signal){
UtilDestroyLockConf * conf = (UtilDestroyLockConf*)signal->getDataPtr();
ActiveMutexPtr ptr;
m_activeMutexes.getPtr(ptr, conf->senderData);
@@ -148,7 +151,7 @@ MutexManager::execUTIL_DESTORY_LOCK_CONF(Signal* signal){
void
-MutexManager::lock(Signal* signal, ActiveMutexPtr& ptr){
+SimulatedBlock::MutexManager::lock(Signal* signal, ActiveMutexPtr& ptr){
UtilLockReq * req = (UtilLockReq*)signal->getDataPtrSend();
req->senderData = ptr.i;
@@ -166,7 +169,7 @@ MutexManager::lock(Signal* signal, ActiveMutexPtr& ptr){
}
void
-MutexManager::trylock(Signal* signal, ActiveMutexPtr& ptr){
+SimulatedBlock::MutexManager::trylock(Signal* signal, ActiveMutexPtr& ptr){
UtilLockReq * req = (UtilLockReq*)signal->getDataPtrSend();
req->senderData = ptr.i;
@@ -184,7 +187,7 @@ MutexManager::trylock(Signal* signal, ActiveMutexPtr& ptr){
}
void
-MutexManager::execUTIL_LOCK_REF(Signal* signal){
+SimulatedBlock::MutexManager::execUTIL_LOCK_REF(Signal* signal){
UtilLockRef * ref = (UtilLockRef*)signal->getDataPtr();
ActiveMutexPtr ptr;
m_activeMutexes.getPtr(ptr, ref->senderData);
@@ -196,7 +199,7 @@ MutexManager::execUTIL_LOCK_REF(Signal* signal){
}
void
-MutexManager::execUTIL_LOCK_CONF(Signal* signal){
+SimulatedBlock::MutexManager::execUTIL_LOCK_CONF(Signal* signal){
UtilLockConf * conf = (UtilLockConf*)signal->getDataPtr();
ActiveMutexPtr ptr;
m_activeMutexes.getPtr(ptr, conf->senderData);
@@ -210,7 +213,7 @@ MutexManager::execUTIL_LOCK_CONF(Signal* signal){
}
void
-MutexManager::unlock(Signal* signal, ActiveMutexPtr& ptr){
+SimulatedBlock::MutexManager::unlock(Signal* signal, ActiveMutexPtr& ptr){
UtilUnlockReq * req = (UtilUnlockReq*)signal->getDataPtrSend();
req->senderData = ptr.i;
req->senderRef = m_block.reference();
@@ -227,7 +230,7 @@ MutexManager::unlock(Signal* signal, ActiveMutexPtr& ptr){
}
void
-MutexManager::execUTIL_UNLOCK_REF(Signal* signal){
+SimulatedBlock::MutexManager::execUTIL_UNLOCK_REF(Signal* signal){
UtilUnlockRef * ref = (UtilUnlockRef*)signal->getDataPtr();
ActiveMutexPtr ptr;
m_activeMutexes.getPtr(ptr, ref->senderData);
@@ -239,7 +242,7 @@ MutexManager::execUTIL_UNLOCK_REF(Signal* signal){
}
void
-MutexManager::execUTIL_UNLOCK_CONF(Signal* signal){
+SimulatedBlock::MutexManager::execUTIL_UNLOCK_CONF(Signal* signal){
UtilUnlockConf * conf = (UtilUnlockConf*)signal->getDataPtr();
ActiveMutexPtr ptr;
m_activeMutexes.getPtr(ptr, conf->senderData);
@@ -251,8 +254,9 @@ MutexManager::execUTIL_UNLOCK_CONF(Signal* signal){
}
void
-Mutex::release(MutexManager& mgr, Uint32 activePtrI, Uint32 mutexId){
- MutexManager::ActiveMutexPtr ptr;
+Mutex::release(SimulatedBlock::MutexManager& mgr,
+ Uint32 activePtrI, Uint32 mutexId){
+ SimulatedBlock::MutexManager::ActiveMutexPtr ptr;
ptr.i = activePtrI;
mgr.getPtr(ptr);
if(ptr.p->m_gsn == 0 && ptr.p->m_mutexId == mutexId){
@@ -272,7 +276,8 @@ Mutex::unlock(){
if(!m_ptr.isNull()){
m_mgr.getPtr(m_ptr);
if(m_ptr.p->m_mutexId == m_mutexId){
- Callback c = { &SimulatedBlock::ignoreMutexUnlockCallback, m_ptr.i };
+ SimulatedBlock::Callback c =
+ { &SimulatedBlock::ignoreMutexUnlockCallback, m_ptr.i };
m_ptr.p->m_callback = c;
m_mgr.unlock(m_signal, m_ptr);
m_ptr.setNull(); // Remove reference
diff --git a/ndb/src/kernel/vm/Mutex.hpp b/ndb/src/kernel/vm/Mutex.hpp
index 40e3fb56b4f..7a16046188c 100644
--- a/ndb/src/kernel/vm/Mutex.hpp
+++ b/ndb/src/kernel/vm/Mutex.hpp
@@ -22,63 +22,6 @@
class Mutex;
-class MutexManager {
- friend class Mutex;
- friend class SimulatedBlock;
- friend class DbUtil;
-public:
- MutexManager(class SimulatedBlock &);
-
- bool setSize(Uint32 maxNoOfActiveMutexes);
- Uint32 getSize() const ; // Get maxNoOfActiveMutexes
-
-private:
- /**
- * core interface
- */
- struct ActiveMutex {
- Uint32 m_gsn; // state
- Uint32 m_mutexId;
- Uint32 m_mutexKey;
- Callback m_callback;
- union {
- Uint32 nextPool;
- Uint32 nextList;
- };
- Uint32 prevList;
- };
- typedef Ptr<ActiveMutex> ActiveMutexPtr;
-
- bool seize(ActiveMutexPtr& ptr);
- void release(Uint32 activeMutexPtrI);
-
- void getPtr(ActiveMutexPtr& ptr);
-
- void create(Signal*, ActiveMutexPtr&);
- void destroy(Signal*, ActiveMutexPtr&);
- void lock(Signal*, ActiveMutexPtr&);
- void trylock(Signal*, ActiveMutexPtr&);
- void unlock(Signal*, ActiveMutexPtr&);
-
-private:
- void execUTIL_CREATE_LOCK_REF(Signal* signal);
- void execUTIL_CREATE_LOCK_CONF(Signal* signal);
- void execUTIL_DESTORY_LOCK_REF(Signal* signal);
- void execUTIL_DESTORY_LOCK_CONF(Signal* signal);
- void execUTIL_LOCK_REF(Signal* signal);
- void execUTIL_LOCK_CONF(Signal* signal);
- void execUTIL_UNLOCK_REF(Signal* signal);
- void execUTIL_UNLOCK_CONF(Signal* signal);
-
- SimulatedBlock & m_block;
- ArrayPool<ActiveMutex> m_mutexPool;
- DLList<ActiveMutex> m_activeMutexes;
-
- BlockReference reference() const;
- void progError(int line, int err_code, const char* extra = 0);
-};
-
-
/**
* MutexHandle - A "reference" to a mutex
* - Should be used together with Mutex
@@ -89,7 +32,7 @@ public:
MutexHandle(Uint32 id);
bool isNull() const;
- void release(MutexManager & mgr);
+ void release(SimulatedBlock::MutexManager & mgr);
private:
const Uint32 m_mutexId;
@@ -106,7 +49,7 @@ public:
MutexHandle2();
bool isNull() const;
- void release(MutexManager & mgr);
+ void release(SimulatedBlock::MutexManager & mgr);
private:
Uint32 m_activeMutexPtrI;
@@ -117,33 +60,34 @@ private:
*/
class Mutex {
public:
- Mutex(Signal*, MutexManager & mgr, MutexHandle &);
+ Mutex(Signal*, SimulatedBlock::MutexManager & mgr, MutexHandle &);
template<Uint32 MutexId>
- Mutex(Signal*, MutexManager & mgr, MutexHandle2<MutexId> &);
+ Mutex(Signal*, SimulatedBlock::MutexManager & mgr, MutexHandle2<MutexId> &);
~Mutex();
void release();
bool isNull() const ;
- bool lock(Callback & callback);
- bool trylock(Callback & callback);
- void unlock(Callback & callback);
+ bool lock(SimulatedBlock::Callback & callback);
+ bool trylock(SimulatedBlock::Callback & callback);
+ void unlock(SimulatedBlock::Callback & callback);
void unlock(); // Ignore callback
- bool create(Callback & callback);
- bool destroy(Callback & callback);
+ bool create(SimulatedBlock::Callback & callback);
+ bool destroy(SimulatedBlock::Callback & callback);
private:
Signal* m_signal;
- MutexManager & m_mgr;
+ SimulatedBlock::MutexManager & m_mgr;
const Uint32 m_mutexId;
Uint32 & m_srcPtrI;
- MutexManager::ActiveMutexPtr m_ptr;
+ SimulatedBlock::MutexManager::ActiveMutexPtr m_ptr;
public:
- static void release(MutexManager&, Uint32 activePtrI, Uint32 mutexId);
+ static void release(SimulatedBlock::MutexManager&,
+ Uint32 activePtrI, Uint32 mutexId);
};
inline
@@ -159,7 +103,7 @@ MutexHandle::isNull() const {
inline
void
-MutexHandle::release(MutexManager & mgr){
+MutexHandle::release(SimulatedBlock::MutexManager & mgr){
if(!isNull()){
Mutex::release(mgr, m_activeMutexPtrI, m_mutexId);
m_activeMutexPtrI = RNIL;
@@ -183,7 +127,7 @@ MutexHandle2<MutexId>::isNull() const {
template<Uint32 MutexId>
inline
void
-MutexHandle2<MutexId>::release(MutexManager & mgr){
+MutexHandle2<MutexId>::release(SimulatedBlock::MutexManager & mgr){
if(!isNull()){
Mutex::release(mgr, m_activeMutexPtrI, MutexId);
m_activeMutexPtrI = RNIL;
@@ -192,7 +136,8 @@ MutexHandle2<MutexId>::release(MutexManager & mgr){
inline
-Mutex::Mutex(Signal* signal, MutexManager & mgr, MutexHandle & mh)
+Mutex::Mutex(Signal* signal, SimulatedBlock::MutexManager & mgr,
+ MutexHandle & mh)
: m_signal(signal),
m_mgr(mgr),
m_mutexId(mh.m_mutexId),
@@ -204,7 +149,8 @@ Mutex::Mutex(Signal* signal, MutexManager & mgr, MutexHandle & mh)
template<Uint32 MutexId>
inline
-Mutex::Mutex(Signal* signal, MutexManager & mgr, MutexHandle2<MutexId> & mh)
+Mutex::Mutex(Signal* signal, SimulatedBlock::MutexManager & mgr,
+ MutexHandle2<MutexId> & mh)
: m_signal(signal),
m_mgr(mgr),
m_mutexId(MutexId),
@@ -236,7 +182,7 @@ Mutex::isNull() const {
inline
bool
-Mutex::lock(Callback & callback){
+Mutex::lock(SimulatedBlock::Callback & callback){
if(m_ptr.isNull()){
if(m_mgr.seize(m_ptr)){
m_ptr.p->m_mutexId = m_mutexId;
@@ -253,7 +199,7 @@ Mutex::lock(Callback & callback){
inline
bool
-Mutex::trylock(Callback & callback){
+Mutex::trylock(SimulatedBlock::Callback & callback){
if(m_ptr.isNull()){
if(m_mgr.seize(m_ptr)){
m_ptr.p->m_mutexId = m_mutexId;
@@ -270,7 +216,7 @@ Mutex::trylock(Callback & callback){
inline
void
-Mutex::unlock(Callback & callback){
+Mutex::unlock(SimulatedBlock::Callback & callback){
if(!m_ptr.isNull()){
m_mgr.getPtr(m_ptr);
if(m_ptr.p->m_mutexId == m_mutexId){
@@ -285,7 +231,7 @@ Mutex::unlock(Callback & callback){
inline
bool
-Mutex::create(Callback & callback){
+Mutex::create(SimulatedBlock::Callback & callback){
if(m_ptr.isNull()){
if(m_mgr.seize(m_ptr)){
m_ptr.p->m_mutexId = m_mutexId;
@@ -302,7 +248,7 @@ Mutex::create(Callback & callback){
inline
bool
-Mutex::destroy(Callback & callback){
+Mutex::destroy(SimulatedBlock::Callback & callback){
if(m_ptr.isNull()){
if(m_mgr.seize(m_ptr)){
m_ptr.p->m_mutexId = m_mutexId;
diff --git a/ndb/src/kernel/vm/SectionReader.cpp b/ndb/src/kernel/vm/SectionReader.cpp
index 9e1cbc855e6..dd474a49e50 100644
--- a/ndb/src/kernel/vm/SectionReader.cpp
+++ b/ndb/src/kernel/vm/SectionReader.cpp
@@ -26,7 +26,7 @@
#endif
SectionReader::SectionReader
-(class SegmentedSectionPtr & ptr, class SectionSegmentPool & pool)
+(struct SegmentedSectionPtr & ptr, class SectionSegmentPool & pool)
: m_pool(pool)
{
if(ptr.p == 0){
diff --git a/ndb/src/kernel/vm/SectionReader.hpp b/ndb/src/kernel/vm/SectionReader.hpp
index 17eade24a66..b51006b6128 100644
--- a/ndb/src/kernel/vm/SectionReader.hpp
+++ b/ndb/src/kernel/vm/SectionReader.hpp
@@ -21,7 +21,7 @@
class SectionReader {
public:
- SectionReader(class SegmentedSectionPtr &,
+ SectionReader(struct SegmentedSectionPtr &,
class SectionSegmentPool &);
void reset();
diff --git a/ndb/src/kernel/vm/SimplePropertiesSection.cpp b/ndb/src/kernel/vm/SimplePropertiesSection.cpp
index d442ff2e698..070563be36b 100644
--- a/ndb/src/kernel/vm/SimplePropertiesSection.cpp
+++ b/ndb/src/kernel/vm/SimplePropertiesSection.cpp
@@ -19,7 +19,7 @@
#include "LongSignal.hpp"
SimplePropertiesSectionReader::SimplePropertiesSectionReader
-(class SegmentedSectionPtr & ptr, class SectionSegmentPool & pool)
+(struct SegmentedSectionPtr & ptr, class SectionSegmentPool & pool)
: m_pool(pool)
{
if(ptr.p == 0){
@@ -190,7 +190,7 @@ SimplePropertiesSectionWriter::putWords(const Uint32 * src, Uint32 len){
}
void
-SimplePropertiesSectionWriter::getPtr(class SegmentedSectionPtr & dst){
+SimplePropertiesSectionWriter::getPtr(struct SegmentedSectionPtr & dst){
// Set last ptr and size
if(m_pos >= 0){
dst.p = m_head;
diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp
index e6b97771d36..94fd5769406 100644
--- a/ndb/src/kernel/vm/SimulatedBlock.cpp
+++ b/ndb/src/kernel/vm/SimulatedBlock.cpp
@@ -1598,7 +1598,7 @@ SimulatedBlock::sendFragmentedSignal(NodeReceiverGroup rg,
}
}
-Callback SimulatedBlock::TheEmptyCallback = {0, 0};
+SimulatedBlock::Callback SimulatedBlock::TheEmptyCallback = {0, 0};
void
SimulatedBlock::sendFragmentedSignal(BlockReference ref,
diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp
index 7972cb39746..cff19734368 100644
--- a/ndb/src/kernel/vm/SimulatedBlock.hpp
+++ b/ndb/src/kernel/vm/SimulatedBlock.hpp
@@ -41,7 +41,6 @@
#include "ArrayPool.hpp"
#include "DLHashTable.hpp"
#include "Callback.hpp"
-#include "Mutex.hpp"
#include "SafeCounter.hpp"
#include "MetaData.hpp"
@@ -77,7 +76,6 @@ typedef struct NewVar
} NewVARIABLE; /* 128 bits */
class SimulatedBlock {
- friend class MutexManager;
friend class SafeCounter;
friend class SafeCounterManager;
friend struct UpgradeStartup;
@@ -104,6 +102,14 @@ public:
*
*/
inline void executeFunction(GlobalSignalNumber gsn, Signal* signal);
+public:
+ typedef void (SimulatedBlock::* CallbackFunction)(class Signal*,
+ Uint32 callbackData,
+ Uint32 returnCode);
+ struct Callback {
+ CallbackFunction m_callbackFunction;
+ Uint32 m_callbackData;
+ };
protected:
static Callback TheEmptyCallback;
void execute(Signal* signal, Callback & c, Uint32 returnCode);
@@ -405,7 +411,64 @@ private:
DLList<FragmentSendInfo> c_linearFragmentSendList;
DLList<FragmentSendInfo> c_segmentedFragmentSendList;
-public:
+public:
+ class MutexManager {
+ friend class Mutex;
+ friend class SimulatedBlock;
+ friend class DbUtil;
+ public:
+ MutexManager(class SimulatedBlock &);
+
+ bool setSize(Uint32 maxNoOfActiveMutexes);
+ Uint32 getSize() const ; // Get maxNoOfActiveMutexes
+
+ private:
+ /**
+ * core interface
+ */
+ struct ActiveMutex {
+ Uint32 m_gsn; // state
+ Uint32 m_mutexId;
+ Uint32 m_mutexKey;
+ Callback m_callback;
+ union {
+ Uint32 nextPool;
+ Uint32 nextList;
+ };
+ Uint32 prevList;
+ };
+ typedef Ptr<ActiveMutex> ActiveMutexPtr;
+
+ bool seize(ActiveMutexPtr& ptr);
+ void release(Uint32 activeMutexPtrI);
+
+ void getPtr(ActiveMutexPtr& ptr);
+
+ void create(Signal*, ActiveMutexPtr&);
+ void destroy(Signal*, ActiveMutexPtr&);
+ void lock(Signal*, ActiveMutexPtr&);
+ void trylock(Signal*, ActiveMutexPtr&);
+ void unlock(Signal*, ActiveMutexPtr&);
+
+ private:
+ void execUTIL_CREATE_LOCK_REF(Signal* signal);
+ void execUTIL_CREATE_LOCK_CONF(Signal* signal);
+ void execUTIL_DESTORY_LOCK_REF(Signal* signal);
+ void execUTIL_DESTORY_LOCK_CONF(Signal* signal);
+ void execUTIL_LOCK_REF(Signal* signal);
+ void execUTIL_LOCK_CONF(Signal* signal);
+ void execUTIL_UNLOCK_REF(Signal* signal);
+ void execUTIL_UNLOCK_CONF(Signal* signal);
+
+ SimulatedBlock & m_block;
+ ArrayPool<ActiveMutex> m_mutexPool;
+ DLList<ActiveMutex> m_activeMutexes;
+
+ BlockReference reference() const;
+ void progError(int line, int err_code, const char* extra = 0);
+ };
+
+ friend class MutexManager;
MutexManager c_mutexMgr;
void ignoreMutexUnlockCallback(Signal* signal, Uint32 ptrI, Uint32 retVal);
@@ -688,5 +751,7 @@ BLOCK::addRecSignal(GlobalSignalNumber gsn, ExecSignalLocal f, bool force){ \
addRecSignalImpl(gsn, (ExecFunction)f, force);\
}
+#include "Mutex.hpp"
+
#endif
diff --git a/ndb/src/mgmapi/Makefile.am b/ndb/src/mgmapi/Makefile.am
index d64216b56c0..2f2fb407e46 100644
--- a/ndb/src/mgmapi/Makefile.am
+++ b/ndb/src/mgmapi/Makefile.am
@@ -14,3 +14,17 @@ include $(top_srcdir)/ndb/config/type_util.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libmgmapi.dsp
+
+libmgmapi.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libmgmapi_la_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp
index e22ceffe773..5a95c6e9ac1 100644
--- a/ndb/src/mgmapi/mgmapi.cpp
+++ b/ndb/src/mgmapi/mgmapi.cpp
@@ -914,21 +914,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);
@@ -938,10 +984,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;
}
@@ -950,6 +994,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");
@@ -964,6 +1009,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);
@@ -971,11 +1017,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;
@@ -1053,15 +1102,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"
@@ -1117,7 +1169,7 @@ ndb_mgm_listen_event(NdbMgmHandle handle, int filter[])
int port= ndb_mgm_get_connected_port(handle);
SocketClient s(hostname, port);
const NDB_SOCKET_TYPE sockfd = s.connect();
- if (sockfd < 0) {
+ if (sockfd == NDB_INVALID_SOCKET) {
setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__,
"Unable to connect to");
return -1;
@@ -1493,7 +1545,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");
@@ -1507,8 +1560,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;
@@ -1690,6 +1752,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;
@@ -1700,6 +1765,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/mgmapi/mgmapi_configuration.cpp b/ndb/src/mgmapi/mgmapi_configuration.cpp
index ae7fe2c294c..7bac2d10b92 100644
--- a/ndb/src/mgmapi/mgmapi_configuration.cpp
+++ b/ndb/src/mgmapi/mgmapi_configuration.cpp
@@ -1,3 +1,4 @@
+#include <ndb_types.h>
#include <mgmapi.h>
#include "mgmapi_configuration.hpp"
#include <new>
@@ -138,7 +139,7 @@ ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator* iter,
extern "C"
int
ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator* iter,
- int param, unsigned long long * value){
+ int param, Uint64 * value){
return iter->get(param, value);
}
diff --git a/ndb/src/mgmapi/mgmapi_configuration.hpp b/ndb/src/mgmapi/mgmapi_configuration.hpp
index c7feffd3a4e..9e94b3311bf 100644
--- a/ndb/src/mgmapi/mgmapi_configuration.hpp
+++ b/ndb/src/mgmapi/mgmapi_configuration.hpp
@@ -21,7 +21,7 @@ struct ndb_mgm_configuration_iterator {
int find(int param, unsigned value);
int get(int param, unsigned * value) const ;
- int get(int param, unsigned long long * value) const ;
+ int get(int param, Uint64 * value) const ;
int get(int param, const char ** value) const ;
//
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/Makefile.am b/ndb/src/mgmclient/Makefile.am
index b8f9f82e501..c63e8d1bff8 100644
--- a/ndb/src/mgmclient/Makefile.am
+++ b/ndb/src/mgmclient/Makefile.am
@@ -30,3 +30,29 @@ ndb_mgm_LDFLAGS = @ndb_bin_am_ldflags@
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: ndb_mgm.dsp libndbmgmclient.dsp
+
+ndb_mgm.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(ndbtools_PROGRAMS)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_mgm_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
+
+libndbmgmclient.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libndbmgmclient_la_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB
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 02bf24f1d9c..686155415d5 100644
--- a/ndb/src/mgmsrv/CommandInterpreter.cpp
+++ b/ndb/src/mgmsrv/CommandInterpreter.cpp
@@ -28,66 +28,12 @@
#include "ConfigInfo.hpp"
#include <version.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
-
-
+#include <m_string.h>
//******************************************************************************
//******************************************************************************
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,622 +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) {
- 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);
- while(item != NULL){
- if (0x0 <= strtoll(item, NULL, 0) && strtoll(item, NULL, 0) <= 0xffffffff) {
- pars[no] = strtoll(item, NULL, 0);
- } 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) {
@@ -1047,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/Config.cpp b/ndb/src/mgmsrv/Config.cpp
index f9c6a23f909..5ff9cbe04ad 100644
--- a/ndb/src/mgmsrv/Config.cpp
+++ b/ndb/src/mgmsrv/Config.cpp
@@ -53,27 +53,27 @@ Config::printAllNameValuePairs(NdbOut &out,
if(!section->contains(n))
continue;
- if (m_info.getStatus(section, n) == ConfigInfo::INTERNAL)
+ if (m_info.getStatus(section, n) == ConfigInfo::CI_INTERNAL)
continue;
- if (m_info.getStatus(section, n) == ConfigInfo::DEPRICATED)
+ if (m_info.getStatus(section, n) == ConfigInfo::CI_DEPRICATED)
continue;
- if (m_info.getStatus(section, n) == ConfigInfo::NOTIMPLEMENTED)
+ if (m_info.getStatus(section, n) == ConfigInfo::CI_NOTIMPLEMENTED)
continue;
out << n << ": ";
switch (m_info.getType(section, n)) {
- case ConfigInfo::INT:
+ case ConfigInfo::CI_INT:
MGM_REQUIRE(prop->get(n, &int_value));
out << int_value;
break;
- case ConfigInfo::INT64:
+ case ConfigInfo::CI_INT64:
MGM_REQUIRE(prop->get(n, &int_64));
out << int_64;
break;
- case ConfigInfo::BOOL:
+ case ConfigInfo::CI_BOOL:
MGM_REQUIRE(prop->get(n, &int_value));
if (int_value) {
out << "Y";
@@ -81,11 +81,11 @@ Config::printAllNameValuePairs(NdbOut &out,
out << "N";
}
break;
- case ConfigInfo::STRING:
+ case ConfigInfo::CI_STRING:
MGM_REQUIRE(prop->get(n, &str_value));
out << str_value;
break;
- case ConfigInfo::SECTION:
+ case ConfigInfo::CI_SECTION:
out << "SECTION";
break;
}
diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp
index 4af1556a0c0..800ffe2e361 100644
--- a/ndb/src/mgmsrv/ConfigInfo.cpp
+++ b/ndb/src/mgmsrv/ConfigInfo.cpp
@@ -21,6 +21,9 @@
#include <mgmapi_config_parameters.h>
#include <ndb_limits.h>
#include "InitConfigFileParser.hpp"
+#include <m_string.h>
+
+extern my_bool opt_ndb_shm;
#define MAX_LINE_LENGTH 255
#define KEY_INTERNAL 0
@@ -78,11 +81,12 @@ 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 *);
static bool fixPortNumber(InitConfigFileParser::Context & ctx, const char *);
-static bool fixShmkey(InitConfigFileParser::Context & ctx, const char *);
+static bool fixShmKey(InitConfigFileParser::Context & ctx, const char *);
static bool checkDbConstraints(InitConfigFileParser::Context & ctx, const char *);
static bool checkConnectionConstraints(InitConfigFileParser::Context &, const char *);
static bool checkTCPConstraints(InitConfigFileParser::Context &, const char *);
@@ -107,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 },
@@ -129,15 +138,19 @@ ConfigInfo::m_SectionRules[] = {
{ "TCP", fixHostname, "HostName1" },
{ "TCP", fixHostname, "HostName2" },
+ { "SHM", fixHostname, "HostName1" },
+ { "SHM", fixHostname, "HostName2" },
{ "SCI", fixHostname, "HostName1" },
{ "SCI", fixHostname, "HostName2" },
+ { "SHM", fixHostname, "HostName1" },
+ { "SHM", fixHostname, "HostName2" },
{ "OSE", fixHostname, "HostName1" },
{ "OSE", fixHostname, "HostName2" },
{ "TCP", fixPortNumber, 0 }, // has to come after fixHostName
{ "SHM", fixPortNumber, 0 }, // has to come after fixHostName
{ "SCI", fixPortNumber, 0 }, // has to come after fixHostName
- //{ "SHM", fixShmKey, 0 },
+ { "SHM", fixShmKey, 0 },
/**
* fixExtConnection must be after fixNodeId
@@ -168,6 +181,8 @@ ConfigInfo::m_SectionRules[] = {
{ "TCP", checkTCPConstraints, "HostName2" },
{ "SCI", checkTCPConstraints, "HostName1" },
{ "SCI", checkTCPConstraints, "HostName2" },
+ { "SHM", checkTCPConstraints, "HostName1" },
+ { "SHM", checkTCPConstraints, "HostName2" },
{ "*", checkMandatory, 0 },
@@ -192,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);
@@ -203,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 }
@@ -256,9 +275,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"COMPUTER",
"COMPUTER",
"Computer section",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::SECTION,
+ ConfigInfo::CI_SECTION,
0,
0, 0 },
@@ -267,9 +286,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Id",
"COMPUTER",
"Name of computer",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
MANDATORY,
0, 0 },
@@ -278,9 +297,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"HostName",
"COMPUTER",
"Hostname of computer (e.g. mysql.com)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
MANDATORY,
0, 0 },
@@ -289,9 +308,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ByteOrder",
"COMPUTER",
0,
- ConfigInfo::DEPRICATED,
+ ConfigInfo::CI_DEPRICATED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0,
0 },
@@ -304,9 +323,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"SYSTEM",
"SYSTEM",
"System section",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::SECTION,
+ ConfigInfo::CI_SECTION,
(const char *)CFG_SECTION_SYSTEM,
0, 0 },
@@ -315,9 +334,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Name",
"SYSTEM",
"Name of system (NDB Cluster)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
MANDATORY,
0, 0 },
@@ -326,9 +345,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ReplicationRole",
"SYSTEM",
"Role in Global Replication (None, Primary, or Standby)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -337,9 +356,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"PrimaryMGMNode",
"SYSTEM",
"Node id of Primary "MGM_TOKEN_PRINT" node",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -349,9 +368,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ConfigGenerationNumber",
"SYSTEM",
"Configuration generation number",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -364,9 +383,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
DB_TOKEN,
DB_TOKEN,
"Node section",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::SECTION,
+ ConfigInfo::CI_SECTION,
(const char *)NODE_TYPE_DB,
0, 0
},
@@ -376,9 +395,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"HostName",
DB_TOKEN,
"Name of computer for this node",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -387,9 +406,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"System",
DB_TOKEN,
"Name of system for this node",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -398,9 +417,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Id",
DB_TOKEN,
"Number identifying the database node ("DB_TOKEN_PRINT")",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
MANDATORY,
"1",
STR_VALUE(MAX_NODES) },
@@ -410,9 +429,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ServerPort",
DB_TOKEN,
"Port used to setup transporter",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
UNDEFINED,
"1",
STR_VALUE(MAX_INT_RNIL) },
@@ -422,9 +441,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NoOfReplicas",
DB_TOKEN,
"Number of copies of all data in the database (1-4)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
MANDATORY,
"1",
"4" },
@@ -434,9 +453,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfAttributes",
DB_TOKEN,
"Total number of attributes stored in database. I.e. sum over all tables",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"1000",
"32",
STR_VALUE(MAX_INT_RNIL) },
@@ -446,9 +465,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfTables",
DB_TOKEN,
"Total number of tables stored in the database",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"128",
"8",
STR_VALUE(MAX_INT_RNIL) },
@@ -458,9 +477,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfOrderedIndexes",
DB_TOKEN,
"Total number of ordered indexes that can be defined in the system",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"128",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -470,9 +489,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfUniqueHashIndexes",
DB_TOKEN,
"Total number of unique hash indexes that can be defined in the system",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"64",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -482,9 +501,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfIndexes",
DB_TOKEN,
"Total number of indexes that can be defined in the system",
- ConfigInfo::DEPRICATED,
+ ConfigInfo::CI_DEPRICATED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"128",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -494,9 +513,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfConcurrentIndexOperations",
DB_TOKEN,
"Total number of index operations that can execute simultaneously on one "DB_TOKEN_PRINT" node",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"8K",
"0",
STR_VALUE(MAX_INT_RNIL)
@@ -507,9 +526,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfTriggers",
DB_TOKEN,
"Total number of triggers that can be defined in the system",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"768",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -519,9 +538,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfFiredTriggers",
DB_TOKEN,
"Total number of triggers that can fire simultaneously in one "DB_TOKEN_PRINT" node",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"4000",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -531,9 +550,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ExecuteOnComputer",
DB_TOKEN,
"String referencing an earlier defined COMPUTER",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -542,9 +561,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfSavedMessages",
DB_TOKEN,
"Max number of error messages in error log and max number of trace files",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"25",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -554,9 +573,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"LockPagesInMainMemory",
DB_TOKEN,
"If set to yes, then NDB Cluster data will not be swapped out to disk",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::BOOL,
+ ConfigInfo::CI_BOOL,
"false",
"false",
"true" },
@@ -566,9 +585,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"TimeBetweenWatchDogCheck",
DB_TOKEN,
"Time between execution checks inside a database node",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"6000",
"70",
STR_VALUE(MAX_INT_RNIL) },
@@ -578,9 +597,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"StopOnError",
DB_TOKEN,
"If set to N, "DB_TOKEN_PRINT" automatically restarts/recovers in case of node failure",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::BOOL,
+ ConfigInfo::CI_BOOL,
"true",
"false",
"true" },
@@ -590,9 +609,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"RestartOnErrorInsert",
DB_TOKEN,
"See src/kernel/vm/Emulator.hpp NdbRestartType for details",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"2",
"0",
"4" },
@@ -602,9 +621,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfConcurrentOperations",
DB_TOKEN,
"Max number of operation records in transaction coordinator",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"32k",
"32",
STR_VALUE(MAX_INT_RNIL) },
@@ -614,9 +633,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfLocalOperations",
DB_TOKEN,
"Max number of operation records defined in the local storage node",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
UNDEFINED,
"32",
STR_VALUE(MAX_INT_RNIL) },
@@ -626,9 +645,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfLocalScans",
DB_TOKEN,
"Max number of fragment scans in parallel in the local storage node",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
UNDEFINED,
"32",
STR_VALUE(MAX_INT_RNIL) },
@@ -638,9 +657,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"BatchSizePerLocalScan",
DB_TOKEN,
"Used to calculate the number of lock records for scan with hold lock",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
STR_VALUE(DEF_BATCH_SIZE),
"1",
STR_VALUE(MAX_PARALLEL_OP_PER_SCAN) },
@@ -650,9 +669,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfConcurrentTransactions",
DB_TOKEN,
"Max number of transaction executing concurrently on the "DB_TOKEN_PRINT" node",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"4096",
"32",
STR_VALUE(MAX_INT_RNIL) },
@@ -662,9 +681,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfConcurrentScans",
DB_TOKEN,
"Max number of scans executing concurrently on the "DB_TOKEN_PRINT" node",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"256",
"2",
"500" },
@@ -674,9 +693,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"TransactionBufferMemory",
DB_TOKEN,
"Dynamic buffer space (in bytes) for key and attribute data allocated for each "DB_TOKEN_PRINT" node",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"1M",
"1K",
STR_VALUE(MAX_INT_RNIL) },
@@ -686,9 +705,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"IndexMemory",
DB_TOKEN,
"Number bytes on each "DB_TOKEN_PRINT" node allocated for storing indexes",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT64,
+ ConfigInfo::CI_INT64,
"18M",
"1M",
"1024G" },
@@ -698,9 +717,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"DataMemory",
DB_TOKEN,
"Number bytes on each "DB_TOKEN_PRINT" node allocated for storing data",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT64,
+ ConfigInfo::CI_INT64,
"80M",
"1M",
"1024G" },
@@ -710,9 +729,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"UndoIndexBuffer",
DB_TOKEN,
"Number bytes on each "DB_TOKEN_PRINT" node allocated for writing UNDO logs for index part",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"2M",
"1M",
STR_VALUE(MAX_INT_RNIL)},
@@ -722,9 +741,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"UndoDataBuffer",
DB_TOKEN,
"Number bytes on each "DB_TOKEN_PRINT" node allocated for writing UNDO logs for data part",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"16M",
"1M",
STR_VALUE(MAX_INT_RNIL)},
@@ -734,9 +753,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"RedoBuffer",
DB_TOKEN,
"Number bytes on each "DB_TOKEN_PRINT" node allocated for writing REDO logs",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"8M",
"1M",
STR_VALUE(MAX_INT_RNIL)},
@@ -746,9 +765,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"LongMessageBuffer",
DB_TOKEN,
"Number bytes on each "DB_TOKEN_PRINT" node allocated for internal long messages",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"1M",
"512k",
STR_VALUE(MAX_INT_RNIL)},
@@ -758,9 +777,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"StartPartialTimeout",
DB_TOKEN,
"Time to wait before trying to start wo/ all nodes. 0=Wait forever",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"30000",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -770,9 +789,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"StartPartitionedTimeout",
DB_TOKEN,
"Time to wait before trying to start partitioned. 0=Wait forever",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"60000",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -782,9 +801,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"StartFailureTimeout",
DB_TOKEN,
"Time to wait before terminating. 0=Wait forever",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -794,9 +813,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"HeartbeatIntervalDbDb",
DB_TOKEN,
"Time between "DB_TOKEN_PRINT"-"DB_TOKEN_PRINT" heartbeats. "DB_TOKEN_PRINT" considered dead after 3 missed HBs",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"1500",
"10",
STR_VALUE(MAX_INT_RNIL) },
@@ -806,9 +825,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"HeartbeatIntervalDbApi",
DB_TOKEN,
"Time between "API_TOKEN_PRINT"-"DB_TOKEN_PRINT" heartbeats. "API_TOKEN_PRINT" connection closed after 3 missed HBs",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"1500",
"100",
STR_VALUE(MAX_INT_RNIL) },
@@ -818,9 +837,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"TimeBetweenLocalCheckpoints",
DB_TOKEN,
"Time between taking snapshots of the database (expressed in 2log of bytes)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"20",
"0",
"31" },
@@ -830,9 +849,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"TimeBetweenGlobalCheckpoints",
DB_TOKEN,
"Time between doing group commit of transactions to disk",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"2000",
"10",
"32000" },
@@ -842,9 +861,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NoOfFragmentLogFiles",
DB_TOKEN,
"No of 16 Mbyte Redo log files in each of 4 file sets belonging to "DB_TOKEN_PRINT" node",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"8",
"1",
STR_VALUE(MAX_INT_RNIL) },
@@ -854,9 +873,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfOpenFiles",
DB_TOKEN,
"Max number of files open per "DB_TOKEN_PRINT" node.(One thread is created per file)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"40",
"20",
"256" },
@@ -867,9 +886,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"TimeBetweenInactiveTransactionAbortCheck",
DB_TOKEN,
"Time between inactive transaction checks",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"1000",
"1000",
STR_VALUE(MAX_INT_RNIL) },
@@ -883,9 +902,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"to execute or send another part (query, statement) of the transaction.\n"
"If the application takes too long time, the transaction gets aborted.\n"
"Timeout set to 0 means that we don't timeout at all on application wait.",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
STR_VALUE(MAX_INT_RNIL),
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -898,9 +917,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"This is the time the transaction coordinator waits for each database node\n"
"of the transaction to execute a request. If the database node takes too\n"
"long time, the transaction gets aborted.",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"1200",
"50",
STR_VALUE(MAX_INT_RNIL) },
@@ -910,9 +929,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NoOfDiskPagesToDiskDuringRestartTUP",
DB_TOKEN,
"?",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"40",
"1",
STR_VALUE(MAX_INT_RNIL) },
@@ -922,9 +941,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NoOfDiskPagesToDiskAfterRestartTUP",
DB_TOKEN,
"?",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"40",
"1",
STR_VALUE(MAX_INT_RNIL) },
@@ -934,9 +953,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NoOfDiskPagesToDiskDuringRestartACC",
DB_TOKEN,
"?",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"20",
"1",
STR_VALUE(MAX_INT_RNIL) },
@@ -946,9 +965,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NoOfDiskPagesToDiskAfterRestartACC",
DB_TOKEN,
"?",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"20",
"1",
STR_VALUE(MAX_INT_RNIL) },
@@ -959,9 +978,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Diskless",
DB_TOKEN,
"Run wo/ disk",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::BOOL,
+ ConfigInfo::CI_BOOL,
"false",
"false",
"true"},
@@ -971,9 +990,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Discless",
DB_TOKEN,
"Diskless",
- ConfigInfo::DEPRICATED,
+ ConfigInfo::CI_DEPRICATED,
true,
- ConfigInfo::BOOL,
+ ConfigInfo::CI_BOOL,
"false",
"false",
"true"},
@@ -985,9 +1004,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ArbitrationTimeout",
DB_TOKEN,
"Max time (milliseconds) database partion waits for arbitration signal",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"3000",
"10",
STR_VALUE(MAX_INT_RNIL) },
@@ -997,9 +1016,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"DataDir",
DB_TOKEN,
"Data directory for this node",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
MYSQLCLUSTERDIR,
0, 0 },
@@ -1008,9 +1027,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"FileSystemPath",
DB_TOKEN,
"Path to directory where the "DB_TOKEN_PRINT" node stores its data (directory must exist)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1019,9 +1038,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"LogLevelStartup",
DB_TOKEN,
"Node startup info printed on stdout",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"1",
"0",
"15" },
@@ -1031,9 +1050,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"LogLevelShutdown",
DB_TOKEN,
"Node shutdown info printed on stdout",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
"15" },
@@ -1043,9 +1062,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"LogLevelStatistic",
DB_TOKEN,
"Transaction, operation, transporter info printed on stdout",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
"15" },
@@ -1055,9 +1074,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"LogLevelCheckpoint",
DB_TOKEN,
"Local and Global checkpoint info printed on stdout",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
"15" },
@@ -1067,9 +1086,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"LogLevelNodeRestart",
DB_TOKEN,
"Node restart, node failure info printed on stdout",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
"15" },
@@ -1079,9 +1098,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"LogLevelConnection",
DB_TOKEN,
"Node connect/disconnect info printed on stdout",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
"15" },
@@ -1091,9 +1110,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"LogLevelError",
DB_TOKEN,
"Transporter, heartbeat errors printed on stdout",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
"15" },
@@ -1103,9 +1122,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"LogLevelInfo",
DB_TOKEN,
"Heartbeat and log info printed on stdout",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
"15" },
@@ -1118,9 +1137,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ParallelBackups",
DB_TOKEN,
"Maximum number of parallel backups",
- ConfigInfo::NOTIMPLEMENTED,
+ ConfigInfo::CI_NOTIMPLEMENTED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"1",
"1",
"1" },
@@ -1130,9 +1149,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"BackupDataDir",
DB_TOKEN,
"Path to where to store backups",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1141,9 +1160,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"BackupMemory",
DB_TOKEN,
"Total memory allocated for backups per node (in bytes)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"4M", // sum of BackupDataBufferSize and BackupLogBufferSize
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1153,9 +1172,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"BackupDataBufferSize",
DB_TOKEN,
"Default size of databuffer for a backup (in bytes)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"2M", // remember to change BackupMemory
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1165,9 +1184,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"BackupLogBufferSize",
DB_TOKEN,
"Default size of logbuffer for a backup (in bytes)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"2M", // remember to change BackupMemory
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1177,9 +1196,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"BackupWriteSize",
DB_TOKEN,
"Default size of filesystem writes made by backup (in bytes)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"32K",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1192,9 +1211,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"REP",
"REP",
"Node section",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::SECTION,
+ ConfigInfo::CI_SECTION,
(const char *)NODE_TYPE_REP,
0, 0
},
@@ -1204,9 +1223,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"HostName",
"REP",
"Name of computer for this node",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1215,9 +1234,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"System",
"REP",
"Name of system for this node",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1226,9 +1245,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Id",
"REP",
"Number identifying replication node (REP)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
MANDATORY,
"1",
STR_VALUE(MAX_NODES) },
@@ -1238,9 +1257,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ExecuteOnComputer",
"REP",
"String referencing an earlier defined COMPUTER",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
MANDATORY,
0, 0 },
@@ -1249,9 +1268,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"HeartbeatIntervalRepRep",
"REP",
"Time between REP-REP heartbeats. Connection closed after 3 missed HBs",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
true,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"3000",
"100",
STR_VALUE(MAX_INT_RNIL) },
@@ -1264,9 +1283,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
API_TOKEN,
API_TOKEN,
"Node section",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::SECTION,
+ ConfigInfo::CI_SECTION,
(const char *)NODE_TYPE_API,
0, 0
},
@@ -1276,9 +1295,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"HostName",
API_TOKEN,
"Name of computer for this node",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1287,9 +1306,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"System",
API_TOKEN,
"Name of system for this node",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1298,9 +1317,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Id",
API_TOKEN,
"Number identifying application node ("API_TOKEN_PRINT")",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
MANDATORY,
"1",
STR_VALUE(MAX_NODES) },
@@ -1310,9 +1329,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ExecuteOnComputer",
API_TOKEN,
"String referencing an earlier defined COMPUTER",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1321,9 +1340,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ArbitrationRank",
API_TOKEN,
"If 0, then "API_TOKEN_PRINT" is not arbitrator. Kernel selects arbitrators in order 1, 2",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
"2" },
@@ -1333,9 +1352,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ArbitrationDelay",
API_TOKEN,
"When asked to arbitrate, arbitrator waits this long before voting (msec)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1345,9 +1364,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxScanBatchSize",
"API",
"The maximum collective batch size for one scan",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
STR_VALUE(MAX_SCAN_BATCH_SIZE),
"32k",
"16M" },
@@ -1357,9 +1376,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"BatchByteSize",
"API",
"The default batch size in bytes",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
STR_VALUE(SCAN_BATCH_SIZE),
"1k",
"1M" },
@@ -1369,9 +1388,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"BatchSize",
"API",
"The default batch size in number of records",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
STR_VALUE(DEF_BATCH_SIZE),
"1",
STR_VALUE(MAX_PARALLEL_OP_PER_SCAN) },
@@ -1384,9 +1403,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
MGM_TOKEN,
MGM_TOKEN,
"Node section",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::SECTION,
+ ConfigInfo::CI_SECTION,
(const char *)NODE_TYPE_MGM,
0, 0
},
@@ -1396,9 +1415,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"HostName",
MGM_TOKEN,
"Name of computer for this node",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1407,9 +1426,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"DataDir",
MGM_TOKEN,
"Data directory for this node",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
MYSQLCLUSTERDIR,
0, 0 },
@@ -1418,9 +1437,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"System",
MGM_TOKEN,
"Name of system for this node",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1429,9 +1448,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Id",
MGM_TOKEN,
"Number identifying the management server node ("MGM_TOKEN_PRINT")",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
MANDATORY,
"1",
STR_VALUE(MAX_NODES) },
@@ -1441,9 +1460,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"LogDestination",
MGM_TOKEN,
"String describing where logmessages are sent",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
0,
0, 0 },
@@ -1452,9 +1471,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ExecuteOnComputer",
MGM_TOKEN,
"String referencing an earlier defined COMPUTER",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
0,
0, 0 },
@@ -1463,9 +1482,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"MaxNoOfSavedEvents",
MGM_TOKEN,
"",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"100",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1475,9 +1494,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"PortNumber",
MGM_TOKEN,
"Port number to give commands to/fetch configurations from management server",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
NDB_PORT,
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1487,9 +1506,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"PortNumberStats",
MGM_TOKEN,
"Port number used to get statistical information from a management server",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
UNDEFINED,
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1499,9 +1518,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ArbitrationRank",
MGM_TOKEN,
"If 0, then "MGM_TOKEN_PRINT" is not arbitrator. Kernel selects arbitrators in order 1, 2",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"1",
"0",
"2" },
@@ -1511,9 +1530,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ArbitrationDelay",
MGM_TOKEN,
"",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1526,9 +1545,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"TCP",
"TCP",
"Connection section",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::SECTION,
+ ConfigInfo::CI_SECTION,
(const char *)CONNECTION_TYPE_TCP,
0, 0
},
@@ -1538,9 +1557,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"HostName1",
"TCP",
"Name/IP of computer on one side of the connection",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1549,9 +1568,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"HostName2",
"TCP",
"Name/IP of computer on one side of the connection",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1560,9 +1579,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NodeId1",
"TCP",
"Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
MANDATORY,
0, 0 },
@@ -1571,20 +1590,31 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NodeId2",
"TCP",
"Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
MANDATORY,
0, 0 },
{
+ CFG_CONNECTION_GROUP,
+ "Group",
+ "TCP",
+ "",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "55",
+ "0", "200" },
+
+ {
CFG_CONNECTION_SEND_SIGNAL_ID,
"SendSignalId",
"TCP",
"Sends id in each signal. Used in trace files.",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::BOOL,
+ ConfigInfo::CI_BOOL,
"true",
"false",
"true" },
@@ -1595,9 +1625,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Checksum",
"TCP",
"If checksum is enabled, all signals between nodes are checked for errors",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::BOOL,
+ ConfigInfo::CI_BOOL,
"false",
"false",
"true" },
@@ -1607,9 +1637,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"PortNumber",
"TCP",
"Port used for this transporter",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
MANDATORY,
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1619,9 +1649,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"SendBufferMemory",
"TCP",
"Bytes of buffer for signals sent from this node",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"256K",
"16K",
STR_VALUE(MAX_INT_RNIL) },
@@ -1631,9 +1661,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ReceiveBufferMemory",
"TCP",
"Bytes of buffer for signals received by this node",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"64K",
"16K",
STR_VALUE(MAX_INT_RNIL) },
@@ -1643,9 +1673,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Proxy",
"TCP",
"",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1654,9 +1684,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NodeId1_System",
"TCP",
"System for node 1 in connection",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1665,9 +1695,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NodeId2_System",
"TCP",
"System for node 2 in connection",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1680,54 +1710,87 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"SHM",
"SHM",
"Connection section",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::SECTION,
+ ConfigInfo::CI_SECTION,
(const char *)CONNECTION_TYPE_SHM,
0, 0 },
{
- CFG_CONNECTION_NODE_1,
- "NodeId1",
+ CFG_CONNECTION_HOSTNAME_1,
+ "HostName1",
"SHM",
- "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection",
- ConfigInfo::USED,
+ "Name/IP of computer on one side of the connection",
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
- MANDATORY,
+ ConfigInfo::CI_STRING,
+ UNDEFINED,
0, 0 },
-
+
+ {
+ CFG_CONNECTION_HOSTNAME_2,
+ "HostName2",
+ "SHM",
+ "Name/IP of computer on one side of the connection",
+ ConfigInfo::CI_INTERNAL,
+ false,
+ ConfigInfo::CI_STRING,
+ UNDEFINED,
+ 0, 0 },
+
{
CFG_CONNECTION_SERVER_PORT,
"PortNumber",
"SHM",
"Port used for this transporter",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
MANDATORY,
"0",
STR_VALUE(MAX_INT_RNIL) },
{
+ CFG_CONNECTION_NODE_1,
+ "NodeId1",
+ "SHM",
+ "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_STRING,
+ MANDATORY,
+ 0, 0 },
+
+ {
CFG_CONNECTION_NODE_2,
"NodeId2",
"SHM",
"Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
MANDATORY,
0, 0 },
{
+ CFG_CONNECTION_GROUP,
+ "Group",
+ "SHM",
+ "",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "35",
+ "0", "200" },
+
+ {
CFG_CONNECTION_SEND_SIGNAL_ID,
"SendSignalId",
"SHM",
"Sends id in each signal. Used in trace files.",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::BOOL,
+ ConfigInfo::CI_BOOL,
"false",
"false",
"true" },
@@ -1738,9 +1801,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Checksum",
"SHM",
"If checksum is enabled, all signals between nodes are checked for errors",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::BOOL,
+ ConfigInfo::CI_BOOL,
"true",
"false",
"true" },
@@ -1750,10 +1813,10 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ShmKey",
"SHM",
"A shared memory key",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
- MANDATORY,
+ ConfigInfo::CI_INT,
+ "0",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1762,9 +1825,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ShmSize",
"SHM",
"Size of shared memory segment",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"1M",
"4K",
STR_VALUE(MAX_INT_RNIL) },
@@ -1774,9 +1837,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NodeId1_System",
"SHM",
"System for node 1 in connection",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1785,9 +1848,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NodeId2_System",
"SHM",
"System for node 2 in connection",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1799,9 +1862,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"SCI",
"SCI",
"Connection section",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::SECTION,
+ ConfigInfo::CI_SECTION,
(const char *)CONNECTION_TYPE_SCI,
0, 0
},
@@ -1811,9 +1874,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NodeId1",
"SCI",
"Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
MANDATORY,
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1823,21 +1886,32 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NodeId2",
"SCI",
"Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
MANDATORY,
"0",
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",
"Name/IP of computer on one side of the connection",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1846,9 +1920,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"HostName2",
"SCI",
"Name/IP of computer on one side of the connection",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1857,9 +1931,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"PortNumber",
"SCI",
"Port used for this transporter",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
MANDATORY,
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1869,9 +1943,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Host1SciId0",
"SCI",
"SCI-node id for adapter 0 on Host1 (a computer can have two adapters)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
MANDATORY,
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1881,9 +1955,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Host1SciId1",
"SCI",
"SCI-node id for adapter 1 on Host1 (a computer can have two adapters)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1893,9 +1967,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Host2SciId0",
"SCI",
"SCI-node id for adapter 0 on Host2 (a computer can have two adapters)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
MANDATORY,
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1905,9 +1979,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Host2SciId1",
"SCI",
"SCI-node id for adapter 1 on Host2 (a computer can have two adapters)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"0",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1917,9 +1991,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"SendSignalId",
"SCI",
"Sends id in each signal. Used in trace files.",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::BOOL,
+ ConfigInfo::CI_BOOL,
"true",
"false",
"true" },
@@ -1929,9 +2003,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Checksum",
"SCI",
"If checksum is enabled, all signals between nodes are checked for errors",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::BOOL,
+ ConfigInfo::CI_BOOL,
"false",
"false",
"true" },
@@ -1941,9 +2015,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"SendLimit",
"SCI",
"Transporter send buffer contents are sent when this no of bytes is buffered",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"8K",
"128",
"32K" },
@@ -1953,9 +2027,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"SharedBufferSize",
"SCI",
"Size of shared memory segment",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"1M",
"64K",
STR_VALUE(MAX_INT_RNIL) },
@@ -1965,9 +2039,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NodeId1_System",
"SCI",
"System for node 1 in connection",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1976,9 +2050,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NodeId2_System",
"SCI",
"System for node 2 in connection",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1990,9 +2064,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"OSE",
"OSE",
"Connection section",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::SECTION,
+ ConfigInfo::CI_SECTION,
(const char *)CONNECTION_TYPE_OSE,
0, 0
},
@@ -2002,9 +2076,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"HostName1",
"OSE",
"Name of computer on one side of the connection",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -2013,9 +2087,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"HostName2",
"OSE",
"Name of computer on one side of the connection",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -2024,9 +2098,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NodeId1",
"OSE",
"Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
MANDATORY,
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -2036,9 +2110,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NodeId2",
"OSE",
"Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
UNDEFINED,
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -2048,9 +2122,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"SendSignalId",
"OSE",
"Sends id in each signal. Used in trace files.",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::BOOL,
+ ConfigInfo::CI_BOOL,
"true",
"false",
"true" },
@@ -2060,9 +2134,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Checksum",
"OSE",
"If checksum is enabled, all signals between nodes are checked for errors",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::BOOL,
+ ConfigInfo::CI_BOOL,
"false",
"false",
"true" },
@@ -2072,9 +2146,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"PrioASignalSize",
"OSE",
"Size of priority A signals (in bytes)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"1000",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -2084,9 +2158,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"PrioBSignalSize",
"OSE",
"Size of priority B signals (in bytes)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"1000",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -2096,9 +2170,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"ReceiveArraySize",
"OSE",
"Number of OSE signals checked for correct ordering (in no of OSE signals)",
- ConfigInfo::USED,
+ ConfigInfo::CI_USED,
false,
- ConfigInfo::INT,
+ ConfigInfo::CI_INT,
"10",
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -2108,9 +2182,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NodeId1_System",
"OSE",
"System for node 1 in connection",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -2119,9 +2193,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"NodeId2_System",
"OSE",
"System for node 2 in connection",
- ConfigInfo::INTERNAL,
+ ConfigInfo::CI_INTERNAL,
false,
- ConfigInfo::STRING,
+ ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
};
@@ -2169,7 +2243,7 @@ ConfigInfo::ConfigInfo()
}
switch (param._type) {
- case BOOL:
+ case CI_BOOL:
{
bool tmp_bool;
require(InitConfigFileParser::convertStringToBool(param._min, tmp_bool));
@@ -2178,8 +2252,8 @@ ConfigInfo::ConfigInfo()
pinfo.put64("Max", tmp_bool);
break;
}
- case INT:
- case INT64:
+ case CI_INT:
+ case CI_INT64:
{
Uint64 tmp_uint64;
require(InitConfigFileParser::convertStringToUint64(param._min, tmp_uint64));
@@ -2188,10 +2262,10 @@ ConfigInfo::ConfigInfo()
pinfo.put64("Max", tmp_uint64);
break;
}
- case SECTION:
+ case CI_SECTION:
pinfo.put("SectionType", (Uint32)UintPtr(param._default));
break;
- case STRING:
+ case CI_STRING:
break;
}
@@ -2209,7 +2283,7 @@ ConfigInfo::ConfigInfo()
// Replace section with modified section
m_info.put(param._section, section, true);
- if(param._type != ConfigInfo::SECTION){
+ if(param._type != ConfigInfo::CI_SECTION){
Properties * p;
if(!m_systemDefaults.getCopy(param._section, &p)){
p = new Properties(true);
@@ -2218,20 +2292,20 @@ ConfigInfo::ConfigInfo()
param._default != MANDATORY){
switch (param._type)
{
- case SECTION:
+ case CI_SECTION:
break;
- case STRING:
+ case CI_STRING:
require(p->put(param._fname, param._default));
break;
- case BOOL:
+ case CI_BOOL:
{
bool tmp_bool;
require(InitConfigFileParser::convertStringToBool(param._default, default_bool));
require(p->put(param._fname, default_bool));
break;
}
- case INT:
- case INT64:
+ case CI_INT:
+ case CI_INT64:
{
Uint64 tmp_uint64;
require(InitConfigFileParser::convertStringToUint64(param._default, default_uint64));
@@ -2253,7 +2327,7 @@ ConfigInfo::ConfigInfo()
exit(-1);
}
- if(m_ParamInfo[i]._type == ConfigInfo::SECTION)
+ if(m_ParamInfo[i]._type == ConfigInfo::CI_SECTION)
continue;
const Properties * p = getInfo(m_ParamInfo[i]._section);
@@ -2413,9 +2487,9 @@ void ConfigInfo::print(const char* section) const {
Properties::Iterator it(sec);
for (const char* n = it.first(); n != NULL; n = it.next()) {
// Skip entries with different F- and P-names
- if (getStatus(sec, n) == ConfigInfo::INTERNAL) continue;
- if (getStatus(sec, n) == ConfigInfo::DEPRICATED) continue;
- if (getStatus(sec, n) == ConfigInfo::NOTIMPLEMENTED) continue;
+ if (getStatus(sec, n) == ConfigInfo::CI_INTERNAL) continue;
+ if (getStatus(sec, n) == ConfigInfo::CI_DEPRICATED) continue;
+ if (getStatus(sec, n) == ConfigInfo::CI_NOTIMPLEMENTED) continue;
print(sec, n);
}
}
@@ -2425,7 +2499,7 @@ void ConfigInfo::print(const Properties * section,
ndbout << parameter;
// ndbout << getDescription(section, parameter) << endl;
switch (getType(section, parameter)) {
- case ConfigInfo::BOOL:
+ case ConfigInfo::CI_BOOL:
ndbout << " (Boolean value)" << endl;
ndbout << getDescription(section, parameter) << endl;
if (getDefault(section, parameter) == false) {
@@ -2440,8 +2514,8 @@ void ConfigInfo::print(const Properties * section,
ndbout << endl;
break;
- case ConfigInfo::INT:
- case ConfigInfo::INT64:
+ case ConfigInfo::CI_INT:
+ case ConfigInfo::CI_INT64:
ndbout << " (Non-negative Integer)" << endl;
ndbout << getDescription(section, parameter) << endl;
if (getDefault(section, parameter) == (UintPtr)MANDATORY) {
@@ -2456,7 +2530,7 @@ void ConfigInfo::print(const Properties * section,
ndbout << endl;
break;
- case ConfigInfo::STRING:
+ case ConfigInfo::CI_STRING:
ndbout << " (String)" << endl;
ndbout << getDescription(section, parameter) << endl;
if (getDefault(section, parameter) == (UintPtr)MANDATORY) {
@@ -2466,7 +2540,7 @@ void ConfigInfo::print(const Properties * section,
}
ndbout << endl;
break;
- case ConfigInfo::SECTION:
+ case ConfigInfo::CI_SECTION:
break;
}
}
@@ -2654,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);
@@ -2746,26 +2859,26 @@ applyDefaultValues(InitConfigFileParser::Context & ctx,
ConfigInfo::Status st = ctx.m_info->getStatus(ctx.m_currentInfo, name);
if(!ctx.m_currentSection->contains(name)){
switch (ctx.m_info->getType(ctx.m_currentInfo, name)){
- case ConfigInfo::INT:
- case ConfigInfo::BOOL:{
+ case ConfigInfo::CI_INT:
+ case ConfigInfo::CI_BOOL:{
Uint32 val = 0;
::require(defaults->get(name, &val));
ctx.m_currentSection->put(name, val);
break;
}
- case ConfigInfo::INT64:{
+ case ConfigInfo::CI_INT64:{
Uint64 val = 0;
::require(defaults->get(name, &val));
ctx.m_currentSection->put64(name, val);
break;
}
- case ConfigInfo::STRING:{
+ case ConfigInfo::CI_STRING:{
const char * val;
::require(defaults->get(name, &val));
ctx.m_currentSection->put(name, val);
break;
}
- case ConfigInfo::SECTION:
+ case ConfigInfo::CI_SECTION:
break;
}
}
@@ -2947,7 +3060,13 @@ fixHostname(InitConfigFileParser::Context & ctx, const char * data){
require(ctx.m_currentSection->get(buf, &id));
const Properties * node;
- require(ctx.m_config->get("Node", id, &node));
+ if(!ctx.m_config->get("Node", id, &node))
+ {
+ ctx.reportError("Unknown node: \"%d\" specified in connection "
+ "[%s] starting at line: %d",
+ id, ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
const char * hostname;
require(node->get("HostName", &hostname));
@@ -3010,7 +3129,7 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){
if(!(ctx.m_userDefaults &&
ctx.m_userDefaults->get("PortNumber", &base)) &&
!ctx.m_systemDefaults->get("PortNumber", &base)) {
- base= strtoll(NDB_BASE_PORT,0,0);
+ base= strtoll(NDB_TCP_BASE_PORT,0,0);
// ctx.reportError("Cannot retrieve base port number");
// return false;
}
@@ -3025,15 +3144,32 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){
<< "per connection, please remove from config. "
<< "Will be changed to " << port << endl;
ctx.m_currentSection->put("PortNumber", port, true);
- } else
+ }
+ else
+ {
ctx.m_currentSection->put("PortNumber", port);
-
+ }
DBUG_PRINT("info", ("connection %d-%d port %d host %s",
id1, id2, port, hostname.c_str()));
DBUG_RETURN(true);
}
+static
+bool
+fixShmKey(InitConfigFileParser::Context & ctx, const char *)
+{
+ Uint32 id1= 0, id2= 0, key= 0;
+ require(ctx.m_currentSection->get("NodeId1", &id1));
+ require(ctx.m_currentSection->get("NodeId2", &id2));
+ if(ctx.m_currentSection->get("ShmKey", &key))
+ return true;
+
+ key= (id1 > id2 ? id1 << 16 | id2 : id2 << 16 | id1);
+ ctx.m_currentSection->put("ShmKey", key);
+ return true;
+}
+
/**
* DB Node rule: Check various constraints
*/
@@ -3165,7 +3301,7 @@ transform(InitConfigFileParser::Context & ctx,
require(ctx.m_currentSection->getTypeOf(oldName, &oldType));
ConfigInfo::Type newType = ctx.m_info->getType(ctx.m_currentInfo, newName);
if(!((oldType == PropertiesType_Uint32 || oldType == PropertiesType_Uint64)
- && (newType == ConfigInfo::INT || newType == ConfigInfo::INT64 || newType == ConfigInfo::BOOL))){
+ && (newType == ConfigInfo::CI_INT || newType == ConfigInfo::CI_INT64 || newType == ConfigInfo::CI_BOOL))){
ndbout << "oldType: " << (int)oldType << ", newType: " << (int)newType << endl;
ctx.reportError("Unable to handle type conversion w.r.t deprication %s %s"
"- [%s] starting at line: %d",
@@ -3176,7 +3312,7 @@ transform(InitConfigFileParser::Context & ctx,
Uint64 oldVal;
require(ctx.m_currentSection->get(oldName, &oldVal));
- Uint64 newVal = (Uint64)(oldVal * mul + add);
+ Uint64 newVal = (Uint64)((Int64)oldVal * mul + add);
if(!ctx.m_info->verify(ctx.m_currentInfo, newName, newVal)){
ctx.reportError("Unable to handle deprication, new value not within bounds"
"%s %s - [%s] starting at line: %d",
@@ -3185,9 +3321,9 @@ transform(InitConfigFileParser::Context & ctx,
return false;
}
- if(newType == ConfigInfo::INT || newType == ConfigInfo::BOOL){
+ if(newType == ConfigInfo::CI_INT || newType == ConfigInfo::CI_BOOL){
require(dst.put(newName, (Uint32)newVal));
- } else if(newType == ConfigInfo::INT64) {
+ } else if(newType == ConfigInfo::CI_INT64) {
require(dst.put64(newName, newVal));
}
return true;
@@ -3269,7 +3405,7 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){
require(sec->get("Status", &status));
require(sec->get("SectionType", &typeVal));
- if(id == KEY_INTERNAL || status == ConfigInfo::INTERNAL){
+ if(id == KEY_INTERNAL || status == ConfigInfo::CI_INTERNAL){
ndbout_c("skipping section %s", ctx.fname);
break;
}
@@ -3348,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);
@@ -3377,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;
@@ -3390,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;
@@ -3401,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,
@@ -3442,7 +3620,7 @@ static bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>&sections,
#if 0
Properties * props= ctx.m_config;
Properties computers(true);
- Uint32 port_base = NDB_BASE_PORT;
+ Uint32 port_base = NDB_TCP_BASE_PORT;
Uint32 nNodes;
ctx.m_userProperties.get("NoOfNodes", &nNodes);
diff --git a/ndb/src/mgmsrv/ConfigInfo.hpp b/ndb/src/mgmsrv/ConfigInfo.hpp
index 512505cbd30..dff8b34bf4a 100644
--- a/ndb/src/mgmsrv/ConfigInfo.hpp
+++ b/ndb/src/mgmsrv/ConfigInfo.hpp
@@ -38,11 +38,11 @@ static const char* UNDEFINED = 0; // Default value for undefined
*/
class ConfigInfo {
public:
- enum Type { BOOL, INT, INT64, STRING, SECTION };
- enum Status { USED, ///< Active
- DEPRICATED, ///< Can be, but shouldn't
- NOTIMPLEMENTED, ///< Is ignored.
- INTERNAL ///< Not configurable by the user
+ enum Type { CI_BOOL, CI_INT, CI_INT64, CI_STRING, CI_SECTION };
+ enum Status { CI_USED, ///< Active
+ CI_DEPRICATED, ///< Can be, but shouldn't
+ CI_NOTIMPLEMENTED, ///< Is ignored.
+ CI_INTERNAL ///< Not configurable by the user
};
/**
diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp
index 05102255eaa..5cc5c3e9b32 100644
--- a/ndb/src/mgmsrv/InitConfigFileParser.cpp
+++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp
@@ -21,6 +21,7 @@
#include "MgmtErrorReporter.hpp"
#include <NdbOut.hpp>
#include "ConfigInfo.hpp"
+#include <m_string.h>
const int MAX_LINE_LENGTH = 1024; // Max length of line of text in config file
static void trim(char *);
@@ -253,10 +254,10 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line)
return false;
}
ConfigInfo::Status status = m_info->getStatus(ctx.m_currentInfo, fname);
- if (status == ConfigInfo::NOTIMPLEMENTED) {
+ if (status == ConfigInfo::CI_NOTIMPLEMENTED) {
ctx.reportWarning("[%s] %s not yet implemented", ctx.fname, fname);
}
- if (status == ConfigInfo::DEPRICATED) {
+ if (status == ConfigInfo::CI_DEPRICATED) {
const char * desc = m_info->getDescription(ctx.m_currentInfo, fname);
if(desc){
ctx.reportWarning("[%s] %s is depricated, use %s instead",
@@ -296,7 +297,7 @@ InitConfigFileParser::storeNameValuePair(Context& ctx,
const ConfigInfo::Type type = m_info->getType(ctx.m_currentInfo, fname);
switch(type){
- case ConfigInfo::BOOL: {
+ case ConfigInfo::CI_BOOL: {
bool value_bool;
if (!convertStringToBool(value, value_bool)) {
ctx.reportError("Illegal boolean value for parameter %s", fname);
@@ -305,8 +306,8 @@ InitConfigFileParser::storeNameValuePair(Context& ctx,
MGM_REQUIRE(ctx.m_currentSection->put(pname, value_bool));
break;
}
- case ConfigInfo::INT:
- case ConfigInfo::INT64:{
+ case ConfigInfo::CI_INT:
+ case ConfigInfo::CI_INT64:{
Uint64 value_int;
if (!convertStringToUint64(value, value_int)) {
ctx.reportError("Illegal integer value for parameter %s", fname);
@@ -319,17 +320,17 @@ InitConfigFileParser::storeNameValuePair(Context& ctx,
m_info->getMax(ctx.m_currentInfo, fname));
return false;
}
- if(type == ConfigInfo::INT){
+ if(type == ConfigInfo::CI_INT){
MGM_REQUIRE(ctx.m_currentSection->put(pname, (Uint32)value_int));
} else {
MGM_REQUIRE(ctx.m_currentSection->put64(pname, value_int));
}
break;
}
- case ConfigInfo::STRING:
+ case ConfigInfo::CI_STRING:
MGM_REQUIRE(ctx.m_currentSection->put(pname, value));
break;
- case ConfigInfo::SECTION:
+ case ConfigInfo::CI_SECTION:
abort();
}
return true;
@@ -365,7 +366,7 @@ bool InitConfigFileParser::convertStringToUint64(const char* s,
errno = 0;
char* p;
- long long v = strtoll(s, &p, log10base);
+ Int64 v = strtoll(s, &p, log10base);
if (errno != 0)
return false;
diff --git a/ndb/src/mgmsrv/Makefile.am b/ndb/src/mgmsrv/Makefile.am
index ee5220ef9f8..50e0b6023ad 100644
--- a/ndb/src/mgmsrv/Makefile.am
+++ b/ndb/src/mgmsrv/Makefile.am
@@ -32,9 +32,7 @@ LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \
DEFS_LOC = -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
-DDATADIR="\"$(MYSQLDATAdir)\"" \
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
- -DMYSQLCLUSTERDIR="\"$(MYSQLCLUSTERdir)\"" \
- -DNDB_PORT="\"@ndb_port@\"" \
- -DNDB_BASE_PORT="\"@ndb_port_base@\""
+ -DMYSQLCLUSTERDIR="\"$(MYSQLCLUSTERdir)\""
include $(top_srcdir)/ndb/config/common.mk.am
include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
@@ -43,3 +41,17 @@ ndb_mgmd_LDFLAGS = @ndb_bin_am_ldflags@
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: ndb_mgmd.dsp
+
+ndb_mgmd.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_mgmd_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp
index 061aa2e0cb8..3fcde997cb0 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -54,6 +54,7 @@
#include <mgmapi.h>
#include <mgmapi_configuration.hpp>
#include <mgmapi_config_parameters.h>
+#include <m_string.h>
//#define MGM_SRV_DEBUG
#ifdef MGM_SRV_DEBUG
@@ -125,12 +126,12 @@ MgmtSrvr::signalRecvThreadRun()
while(!_isStopThread) {
SigMatch *handler = NULL;
NdbApiSignal *signal = NULL;
- if(m_signalRecvQueue.waitFor(siglist, handler, signal, DEFAULT_TIMEOUT)) {
+ if(m_signalRecvQueue.waitFor(siglist, &handler, &signal, DEFAULT_TIMEOUT)) {
if(handler->function != 0)
(this->*handler->function)(signal);
}
}
-};
+}
EventLogger g_EventLogger;
@@ -153,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;
@@ -226,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;
}
}
@@ -244,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
@@ -407,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");
@@ -545,16 +548,18 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
}
}
+ // Setup clusterlog as client[0] in m_event_listner
{
- MgmStatService::StatListener se;
- se.m_socket = -1;
+ 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;
@@ -2069,21 +2074,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;
}
//****************************************************************************
@@ -2104,8 +2106,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
@@ -2220,9 +2225,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"
@@ -2292,8 +2312,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());
@@ -2384,15 +2405,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;
@@ -2414,11 +2435,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;
@@ -2497,18 +2523,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;
}
@@ -2672,7 +2711,7 @@ MgmtSrvr::setDbParameter(int node, int param, const char * value,
int p_type;
unsigned val_32;
- unsigned long long val_64;
+ Uint64 val_64;
const char * val_char;
do {
p_type = 0;
@@ -2734,9 +2773,9 @@ MgmtSrvr::setDbParameter(int node, int param, const char * value,
template class Vector<SigMatch>;
#if __SUNPRO_CC != 0x560
-template bool SignalQueue::waitFor<SigMatch>(Vector<SigMatch>&, SigMatch*&, NdbApiSignal*&, unsigned);
+template bool SignalQueue::waitFor<SigMatch>(Vector<SigMatch>&, SigMatch**, NdbApiSignal**, unsigned);
#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 1afb0848ecc..6378e763363 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);
@@ -661,7 +668,7 @@ private:
*/
static void signalReceivedNotification(void* mgmtSrvr,
NdbApiSignal* signal,
- class LinearSectionPtr ptr[3]);
+ struct LinearSectionPtr ptr[3]);
/**
* Called from "outside" of MgmtSrvr when a DB process has died.
@@ -732,8 +739,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 5834d40cc78..8ba8c2fe87e 100644
--- a/ndb/src/mgmsrv/Services.cpp
+++ b/ndb/src/mgmsrv/Services.cpp
@@ -29,7 +29,7 @@
#include <ConfigValues.hpp>
#include <mgmapi_configuration.hpp>
-
+#include <Vector.hpp>
#include "Services.hpp"
extern bool g_StopServer;
@@ -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, ""),
@@ -284,8 +287,8 @@ MgmApiSession::runSession() {
/* Backwards compatibility for old NDBs that still use
* the old "GET CONFIG" command.
*/
-
- for(size_t i=0; i<strlen(ctx.m_currentToken); i++)
+ size_t i;
+ for(i=0; i<strlen(ctx.m_currentToken); i++)
ctx.m_currentToken[i] = toupper(ctx.m_currentToken[i]);
if(strncmp("GET CONFIG ",
@@ -386,6 +389,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);
@@ -394,7 +399,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:
@@ -615,85 +630,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
@@ -767,43 +727,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 */
@@ -814,12 +793,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("");
@@ -1190,10 +1172,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);
@@ -1247,21 +1231,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);
@@ -1270,7 +1250,7 @@ MgmStatService::log(int eventType, const Uint32* theData, NodeId nodeId){
m_clients.lock();
for(i = m_clients.size() - 1; i >= 0; i--){
if(threshold <= m_clients[i].m_logLevel.getLogLevel(cat)){
- if(m_clients[i].m_socket >= 0 &&
+ if(m_clients[i].m_socket != NDB_INVALID_SOCKET &&
println_socket(m_clients[i].m_socket,
MAX_WRITE_TIMEOUT, m_text) == -1){
copy.push_back(m_clients[i].m_socket);
@@ -1291,23 +1271,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;
@@ -1318,13 +1297,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 >= 0){
+ 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
@@ -1358,7 +1345,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;
@@ -1403,10 +1390,10 @@ 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 = -1;
+ m_socket = NDB_INVALID_SOCKET;
done:
m_output->println("listen event");
diff --git a/ndb/src/mgmsrv/Services.hpp b/ndb/src/mgmsrv/Services.hpp
index 6a5f06a659e..8627343b1cf 100644
--- a/ndb/src/mgmsrv/Services.hpp
+++ b/ndb/src/mgmsrv/Services.hpp
@@ -107,7 +107,7 @@ public:
m_mgmsrv = mgmsrv;
}
- MgmApiSession * newSession(NDB_SOCKET_TYPE socket){
+ SocketServer::Session * newSession(NDB_SOCKET_TYPE socket){
return new MgmApiSession(* m_mgmsrv, socket);
}
};
diff --git a/ndb/src/mgmsrv/SignalQueue.hpp b/ndb/src/mgmsrv/SignalQueue.hpp
index 76acaf2289a..bacbad53415 100644
--- a/ndb/src/mgmsrv/SignalQueue.hpp
+++ b/ndb/src/mgmsrv/SignalQueue.hpp
@@ -47,8 +47,8 @@ public:
NodeId nodeid = 0,
Uint32 timeout = DEFAULT_TIMEOUT);
template<class T> bool waitFor(Vector<T> &t,
- T *&handler,
- NdbApiSignal *&signal,
+ T **handler,
+ NdbApiSignal **signal,
Uint32 timeout = DEFAULT_TIMEOUT);
private:
NdbMutex *m_mutex; /* Locks all data in SignalQueue */
@@ -75,8 +75,8 @@ private:
template<class T> bool
SignalQueue::waitFor(Vector<T> &t,
- T *&handler,
- NdbApiSignal *&signal,
+ T **handler,
+ NdbApiSignal **signal,
Uint32 timeout) {
Guard g(m_mutex);
@@ -88,8 +88,8 @@ SignalQueue::waitFor(Vector<T> &t,
for(size_t i = 0; i < t.size(); i++) {
if(t[i].check(m_signalQueueHead->signal)) {
- handler = &t[i];
- signal = pop();
+ * handler = &t[i];
+ * signal = pop();
return true;
}
}
diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp
index 64a2cb35c1f..64aca1d6709 100644
--- a/ndb/src/mgmsrv/main.cpp
+++ b/ndb/src/mgmsrv/main.cpp
@@ -91,41 +91,38 @@ 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 +149,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);
@@ -200,7 +204,7 @@ int main(int argc, char** argv)
if (glob.mgmObject->init())
goto error_end;
- chdir(NdbConfig_get_path(0));
+ my_setwd(NdbConfig_get_path(0), MYF(0));
glob.localNodeId= glob.mgmObject->getOwnNodeId();
if (glob.localNodeId == 0) {
@@ -261,7 +265,9 @@ int main(int argc, char** argv)
}
}
+#ifndef NDB_WIN32
signal(SIGPIPE, SIG_IGN);
+#endif
{
BaseString error_string;
if(!glob.mgmObject->start(error_string)){
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/Makefile.am b/ndb/src/ndbapi/Makefile.am
index 06128e047b6..9f8a851b995 100644
--- a/ndb/src/ndbapi/Makefile.am
+++ b/ndb/src/ndbapi/Makefile.am
@@ -47,3 +47,17 @@ include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libndbapi.dsp
+
+libndbapi.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libndbapi_la_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)
diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp
index 75ae539fc8b..e9a125922c6 100644
--- a/ndb/src/ndbapi/Ndb.cpp
+++ b/ndb/src/ndbapi/Ndb.cpp
@@ -22,7 +22,7 @@ Name: Ndb.cpp
******************************************************************************/
#include <ndb_global.h>
-#include <pthread.h>
+
#include "NdbApiSignal.hpp"
#include "NdbImpl.hpp"
@@ -46,7 +46,6 @@ Connect to any node which has no connection at the moment.
NdbConnection* Ndb::doConnect(Uint32 tConNode)
{
Uint32 tNode;
- Uint32 i = 0;;
Uint32 tAnyAlive = 0;
int TretCode;
@@ -65,38 +64,51 @@ NdbConnection* 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 getConnectedNdbConnection(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()
NdbConnection* 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
@@ -384,44 +375,6 @@ Ndb::hupp(NdbConnection* pBuddyTrans)
}//if
}//Ndb::hupp()
-NdbConnection*
-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);
- NdbConnection* 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()
NdbConnection*
Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId)
@@ -1021,118 +974,6 @@ Ndb::opTupleIdOnNdb(Uint32 aTableId, Uint64 opValue, Uint32 op)
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/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp
index b75af260105..0a1433c71f3 100644
--- a/ndb/src/ndbapi/NdbBlob.cpp
+++ b/ndb/src/ndbapi/NdbBlob.cpp
@@ -975,7 +975,7 @@ NdbBlob::deletePartsUnknown(Uint32 part)
setErrorCode(tOp);
return -1;
}
- tOp->m_abortOption = IgnoreError;
+ tOp->m_abortOption = AO_IgnoreError;
n++;
}
DBG("deletePartsUnknown: executeNoBlobs [in] bat=" << bat);
@@ -1223,7 +1223,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch)
return -1;
}
if (isWriteOp()) {
- tOp->m_abortOption = IgnoreError;
+ tOp->m_abortOption = AO_IgnoreError;
}
theHeadInlineReadOp = tOp;
// execute immediately
@@ -1269,7 +1269,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch)
return -1;
}
if (isWriteOp()) {
- tOp->m_abortOption = IgnoreError;
+ tOp->m_abortOption = AO_IgnoreError;
}
theHeadInlineReadOp = tOp;
// execute immediately
diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp
index 167f51a5df0..29959a4ed7e 100644
--- a/ndb/src/ndbapi/NdbConnection.cpp
+++ b/ndb/src/ndbapi/NdbConnection.cpp
@@ -83,7 +83,7 @@ NdbConnection::NdbConnection( 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.
NdbConnection::~NdbConnection()
{
DBUG_ENTER("NdbConnection::~NdbConnection");
- theNdb->theNdbObjectIdMap->unmap(theId, this);
+ theNdb->theImpl->theNdbObjectIdMap.unmap(theId, this);
DBUG_VOID_RETURN;
}//NdbConnection::~NdbConnection()
@@ -1616,7 +1616,7 @@ from other transactions.
(theLastExecOpInList->theCommitIndicator == 1)){
- if (m_abortOption == IgnoreError && theError.code != 0){
+ if (m_abortOption == AO_IgnoreError && theError.code != 0){
/**
* There's always a TCKEYCONF when using IgnoreError
*/
@@ -1867,7 +1867,7 @@ NdbConnection::OpCompleteFailure(Uint8 abortOption, bool setFailure)
//decide the success of the whole transaction since a simple
//operation is not really part of that transaction.
//------------------------------------------------------------------------
- if (abortOption == IgnoreError){
+ if (abortOption == AO_IgnoreError){
/**
* There's always a TCKEYCONF when using IgnoreError
*/
diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp
index 462f04acb88..e22d8595397 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 37dea73838f..c1bf3e90a50 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -1392,15 +1392,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) {
@@ -1414,7 +1413,7 @@ int NdbDictionaryImpl::alterTable(NdbTableImpl &impl)
m_globalHash->unlock();
}
}
- return ret;
+ DBUG_RETURN(ret);
}
int
@@ -1429,15 +1428,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();
@@ -1472,7 +1472,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());
@@ -1524,12 +1524,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);
}
// charset in upper half of precision
if (col->getCharType()) {
@@ -1597,7 +1597,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
}
}
}
- return ret;
+ DBUG_RETURN(ret);
}
int
@@ -1656,17 +1656,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 38477e95d99..7ee064c2583 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 {
@@ -317,7 +317,7 @@ private:
friend class Ndb;
static void execSignal(void* dictImpl,
class NdbApiSignal* signal,
- class LinearSectionPtr ptr[3]);
+ struct LinearSectionPtr ptr[3]);
static void execNodeStatus(void* dictImpl, Uint32,
bool alive, bool nfCompleted);
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 1fb1969b589..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,19 +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 <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;
@@ -57,7 +79,7 @@ public:
inline
void *
Ndb::int2void(Uint32 val){
- return theNdbObjectIdMap->getObject(val);
+ return theImpl->theNdbObjectIdMap.getObject(val);
}
inline
@@ -104,26 +126,6 @@ Ndb::checkInitState()
Uint32 convertEndian(Uint32 Data);
-enum WaitSignalType {
- NO_WAIT = 0,
- WAIT_NODE_FAILURE = 1, // Node failure during wait
- 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,
@@ -131,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 = 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/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp
index fc263609eb4..9a461e1deef 100644
--- a/ndb/src/ndbapi/NdbOperationExec.cpp
+++ b/ndb/src/ndbapi/NdbOperationExec.cpp
@@ -199,7 +199,7 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId)
tcKeyReq->setKeyLength(tReqInfo, tTupKeyLen);
// A simple read is always ignore error
- abortOption = tSimpleIndicator ? IgnoreError : abortOption;
+ abortOption = tSimpleIndicator ? AO_IgnoreError : abortOption;
tcKeyReq->setAbortOption(tReqInfo, abortOption);
Uint8 tDistrKeyIndicator = theDistrKeyIndicator_;
@@ -542,14 +542,14 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal)
theStatus = Finished;
// blobs want this
- if (m_abortOption != IgnoreError)
+ if (m_abortOption != AO_IgnoreError)
theNdbCon->theReturnStatus = NdbConnection::ReturnFailure;
theError.code = aSignal->readData(4);
theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4), m_abortOption);
if(theOperationType != ReadRequest || !theSimpleIndicator) // not simple read
- return theNdbCon->OpCompleteFailure(ao, m_abortOption != IgnoreError);
+ return theNdbCon->OpCompleteFailure(ao, m_abortOption != AO_IgnoreError);
/**
* If TCKEYCONF has arrived
diff --git a/ndb/src/ndbapi/NdbReceiver.cpp b/ndb/src/ndbapi/NdbReceiver.cpp
index 14f8d4b8440..cad247512b2 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 38b1c70c047..0c851427ba5 100644
--- a/ndb/src/ndbapi/NdbScanFilter.cpp
+++ b/ndb/src/ndbapi/NdbScanFilter.cpp
@@ -397,7 +397,7 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op,
(m_operation->* branch)(4, 5, m_current.m_ownLabel);
return 0;
-};
+}
int
NdbScanFilter::eq(int AttrId, Uint32 value){
@@ -478,7 +478,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 f4973b2e66f..1b8dbdde3d5 100644
--- a/ndb/src/ndbapi/NdbScanOperation.cpp
+++ b/ndb/src/ndbapi/NdbScanOperation.cpp
@@ -475,8 +475,8 @@ int NdbScanOperation::nextResult(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;
@@ -1324,8 +1324,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;
@@ -1472,8 +1472,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:
@@ -1542,8 +1542,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/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 c011c1a6a26..a4f233709c4 100644
--- a/ndb/src/ndbapi/Ndbif.cpp
+++ b/ndb/src/ndbapi/Ndbif.cpp
@@ -92,8 +92,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){
@@ -192,14 +192,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;
@@ -207,9 +207,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;
@@ -247,8 +246,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])
NdbConnection* 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(NdbConnection* aCon)
if ((theMinNoOfEventsToWakeUp != 0) &&
(theNoOfCompletedTransactions >= theMinNoOfEventsToWakeUp)) {
theMinNoOfEventsToWakeUp = 0;
- NdbCondition_Signal(theWaiter.m_condition);
+ NdbCondition_Signal(theImpl->theWaiter.m_condition);
return;
}//if
} else {
@@ -1152,9 +1153,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)
*/
@@ -1163,8 +1164,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;
@@ -1270,23 +1271,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()
@@ -1318,8 +1319,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 48e62c36a5f..e1af7bd4cc5 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 a5f2a4801d5..5902aa413dc 100644
--- a/ndb/src/ndbapi/Ndblist.cpp
+++ b/ndb/src/ndbapi/Ndblist.cpp
@@ -30,10 +30,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));
@@ -56,31 +64,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/ObjectMap.hpp b/ndb/src/ndbapi/ObjectMap.hpp
index 12bede3aa3f..21407279f0b 100644
--- a/ndb/src/ndbapi/ObjectMap.hpp
+++ b/ndb/src/ndbapi/ObjectMap.hpp
@@ -29,7 +29,7 @@
class NdbObjectIdMap //: NdbLockable
{
public:
- STATIC_CONST( InvalidId = ~0 );
+ STATIC_CONST( InvalidId = ~(Uint32)0 );
NdbObjectIdMap(Uint32 initalSize = 128, Uint32 expandSize = 10);
~NdbObjectIdMap();
diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp
index dfb090c8416..031ee6315e8 100644
--- a/ndb/src/ndbapi/TransporterFacade.cpp
+++ b/ndb/src/ndbapi/TransporterFacade.cpp
@@ -626,6 +626,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)){
@@ -634,6 +637,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 5680e3a6f03..99edea846c1 100644
--- a/ndb/src/ndbapi/TransporterFacade.hpp
+++ b/ndb/src/ndbapi/TransporterFacade.hpp
@@ -127,7 +127,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 f436ee56ede..98a52786aab 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>
@@ -26,6 +28,8 @@
#include <ndb_limits.h>
#include <ConfigRetriever.hpp>
#include <ndb_version.h>
+#include <Vector.hpp>
+#include <md5_hash.hpp>
static int g_run_connect_thread= 0;
@@ -35,56 +39,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_facade= TransporterFacade::theFacadeInstance= new TransporterFacade();
+}
- m_config_retriever= 0;
- m_connect_thread= 0;
- m_connect_callback= 0;
+Ndb_cluster_connection::Ndb_cluster_connection
+(Ndb_cluster_connection_impl& impl) : m_impl(impl)
+{
+}
- 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::~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;
}
@@ -92,82 +86,415 @@ 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)
{
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);
+
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!";
}
@@ -175,29 +502,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/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c
index c0a6b6ba122..d4ad9cd6f1c 100644
--- a/ndb/src/ndbapi/ndberror.c
+++ b/ndb/src/ndbapi/ndberror.c
@@ -17,6 +17,7 @@
#include <ndb_global.h>
#include <ndberror.h>
+#include <m_string.h>
typedef struct ErrorBundle {
int code;
@@ -646,10 +647,10 @@ int ndb_error_string(int err_no, char *str, unsigned int size)
ndberror_update(&error);
len =
- snprintf(str, size-1, "%s: %s: %s", error.message,
- ndberror_status_message(error.status),
- ndberror_classification_message(error.classification));
+ my_snprintf(str, size-1, "%s: %s: %s", error.message,
+ ndberror_status_message(error.status),
+ ndberror_classification_message(error.classification));
str[size-1]= '\0';
-
+
return len;
}
diff --git a/ndb/test/Makefile.am b/ndb/test/Makefile.am
index 2e0f30df9d4..b8753668c60 100644
--- a/ndb/test/Makefile.am
+++ b/ndb/test/Makefile.am
@@ -4,3 +4,5 @@ EXTRA_DIST = include
dist-hook:
-rm -rf `find $(distdir) -type d -name SCCS`
+
+windoze-dsp:
diff --git a/ndb/test/include/NdbSchemaOp.hpp b/ndb/test/include/NdbSchemaOp.hpp
index 43f76c8c253..ac859f8abe8 100644
--- a/ndb/test/include/NdbSchemaOp.hpp
+++ b/ndb/test/include/NdbSchemaOp.hpp
@@ -303,6 +303,7 @@ public:
*
* @deprecated do not use!
*/
+#ifndef NDB_WIN32
inline int createTable( const char* aTableName,
Uint32 aTableSize,
KeyType aTupleKey,
@@ -324,6 +325,7 @@ public:
aMemoryType,
(aStoredTable == 1 ? true : false));
}
+#endif
/**
* Add a new attribute to a database table.
diff --git a/ndb/test/ndbapi/Makefile.am b/ndb/test/ndbapi/Makefile.am
index 4c374ec0f13..2288a362dd2 100644
--- a/ndb/test/ndbapi/Makefile.am
+++ b/ndb/test/ndbapi/Makefile.am
@@ -86,4 +86,65 @@ testBackup_LDADD = $(LDADD) bank/libbank.a
# Don't update the files from bitkeeper
%::SCCS/s.%
+windoze-dsp: flexBench.dsp testBasic.dsp testBlobs.dsp \
+ testScan.dsp
+flexBench.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ flexBench
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(flexBench_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
+
+testBasic.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ testBasic
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(testBasic_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
+
+testOIBasic.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ testOIBasic
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(testOIBasic_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
+
+testBlobs.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ testBlobs
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(testBlobs_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
+
+testScan.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ testScan
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(testScan_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
diff --git a/ndb/test/ndbapi/bank/Makefile.am b/ndb/test/ndbapi/bank/Makefile.am
index 886d664aefb..d4f82a7f9c4 100644
--- a/ndb/test/ndbapi/bank/Makefile.am
+++ b/ndb/test/ndbapi/bank/Makefile.am
@@ -20,3 +20,5 @@ include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp:
diff --git a/ndb/test/ndbapi/testDict.cpp b/ndb/test/ndbapi/testDict.cpp
index 0a43bb02fff..5f88342705a 100644
--- a/ndb/test/ndbapi/testDict.cpp
+++ b/ndb/test/ndbapi/testDict.cpp
@@ -1211,7 +1211,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");
@@ -1280,7 +1280,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");
@@ -1377,7 +1377,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 a1ebac609b6..69e534e6860 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/ndbapi/testOperations.cpp b/ndb/test/ndbapi/testOperations.cpp
index f31906dd737..949f08281a5 100644
--- a/ndb/test/ndbapi/testOperations.cpp
+++ b/ndb/test/ndbapi/testOperations.cpp
@@ -171,7 +171,7 @@ runTwoOperations(NDBT_Context* ctx, NDBT_Step* step){
// Insert, read
CHECK(hugoOps.startTransaction(pNdb) == 0);
CHECK(runOp(hugoOps, pNdb, op1, val1) == 0);
- AbortOption oa = (res1 == 0) ? AbortOnError : IgnoreError;
+ AbortOption oa = (res1 == 0) ? AbortOnError : AO_IgnoreError;
CHECK(hugoOps.execute_NoCommit(pNdb, oa) == res1);
CHECK(checkVal(hugoOps, op1, val1, res1) == 0);
diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am
index c890536dcc6..83dcb3dbbcf 100644
--- a/ndb/test/run-test/Makefile.am
+++ b/ndb/test/run-test/Makefile.am
@@ -23,3 +23,5 @@ wrappers_SCRIPTS=atrt-testBackup atrt-mysql-test-run
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp:
diff --git a/ndb/test/src/CpcClient.cpp b/ndb/test/src/CpcClient.cpp
index d407ba65312..2ef23528360 100644
--- a/ndb/test/src/CpcClient.cpp
+++ b/ndb/test/src/CpcClient.cpp
@@ -15,9 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
-#include <editline/editline.h>
-
-#include <netdb.h>
#include <NdbOut.hpp>
#include <NdbTCP.h>
diff --git a/ndb/test/src/Makefile.am b/ndb/test/src/Makefile.am
index 56f3d6a1ec6..289633b060a 100644
--- a/ndb/test/src/Makefile.am
+++ b/ndb/test/src/Makefile.am
@@ -19,3 +19,17 @@ include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: libNDBT.dsp
+
+libNDBT.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-lib.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-lib.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(libNDBT_a_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LIB
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/test/src/NdbRestarts.cpp b/ndb/test/src/NdbRestarts.cpp
index b649a60d98b..607e48c4126 100644
--- a/ndb/test/src/NdbRestarts.cpp
+++ b/ndb/test/src/NdbRestarts.cpp
@@ -445,7 +445,7 @@ int twoNodeFailure(NdbRestarter& _restarter,
<< ") secs " << endl;
NdbSleep_SecSleep(seconds);
- randomId = (random() % _restarter.getNumDbNodes());
+ randomId = (rand() % _restarter.getNumDbNodes());
nodeId = _restarter.getDbNodeId(randomId);
g_info << _restart->m_name << ": node = "<< nodeId << endl;
diff --git a/ndb/test/src/getarg.c b/ndb/test/src/getarg.c
index 9f03af69824..5b67eb6343d 100644
--- a/ndb/test/src/getarg.c
+++ b/ndb/test/src/getarg.c
@@ -35,6 +35,7 @@
#include <ndb_global.h>
#include "getarg.h"
+#include <basestring_vsnprintf.h>
#ifndef HAVE_STRLCPY
static size_t
@@ -293,7 +294,7 @@ arg_printusage (struct getargs *args,
col += fprintf(stderr, " %s", buf);
}
if (args[i].short_name) {
- snprintf(buf, sizeof(buf), "[-%c", args[i].short_name);
+ basestring_snprintf(buf, sizeof(buf), "[-%c", args[i].short_name);
len += 2;
len += print_arg(buf + strlen(buf), sizeof(buf) - strlen(buf),
0, 0, &args[i]);
diff --git a/ndb/test/tools/Makefile.am b/ndb/test/tools/Makefile.am
index 3255267b636..a6a013bb263 100644
--- a/ndb/test/tools/Makefile.am
+++ b/ndb/test/tools/Makefile.am
@@ -27,3 +27,5 @@ ndb_cpcc_LDADD = $(LDADD)
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp:
diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am
index 7a61a9b1be5..c350fb0a141 100644
--- a/ndb/tools/Makefile.am
+++ b/ndb/tools/Makefile.am
@@ -48,3 +48,109 @@ ndb_restore_LDFLAGS = @ndb_bin_am_ldflags@
# Don't update the files from bitkeeper
%::SCCS/s.%
+
+windoze-dsp: \
+ ndb_waiter.dsp \
+ ndb_drop_table.dsp \
+ ndb_delete_all.dsp \
+ ndb_desc.dsp \
+ ndb_drop_index.dsp \
+ ndb_show_tables.dsp \
+ ndb_select_all.dsp \
+ ndb_select_count.dsp
+
+ndb_waiter.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ ndb_waiter
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_waiter_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
+
+ndb_drop_table.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ ndb_drop_table
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_drop_table_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
+
+ndb_delete_all.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ ndb_delete_all
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_delete_all_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
+
+ndb_desc.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ ndb_desc
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_desc_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
+
+ndb_drop_index.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ ndb_drop_index
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_drop_index_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
+
+ndb_show_tables.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ ndb_show_tables
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_show_tables_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
+
+ndb_select_all.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ ndb_select_all
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_select_all_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
+
+ndb_select_count.dsp: Makefile \
+ $(top_srcdir)/ndb/config/win-prg.am \
+ $(top_srcdir)/ndb/config/win-name \
+ $(top_srcdir)/ndb/config/win-includes \
+ $(top_srcdir)/ndb/config/win-sources \
+ $(top_srcdir)/ndb/config/win-libraries
+ cat $(top_srcdir)/ndb/config/win-prg.am > $@
+ @$(top_srcdir)/ndb/config/win-name $@ ndb_select_count
+ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
+ @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_select_count_SOURCES)
+ @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)
diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp
index 046ac8005d2..cdfaf2134ff 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 c5e9efdfa8a..4bca51ee903 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/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp
index 6e2fcaed3af..fa616ee8fee 100644
--- a/ndb/tools/restore/Restore.cpp
+++ b/ndb/tools/restore/Restore.cpp
@@ -192,14 +192,15 @@ RestoreMetaData::readGCPEntry() {
return true;
}
-TableS::TableS(NdbTableImpl* tableImpl)
+TableS::TableS(Uint32 version, NdbTableImpl* tableImpl)
: m_dictTable(tableImpl)
{
m_dictTable = tableImpl;
m_noOfNullable = m_nullBitmaskSize = 0;
m_auto_val_id= ~(Uint32)0;
m_max_auto_val= 0;
-
+ backupVersion = version;
+
for (int i = 0; i < tableImpl->getNoOfColumns(); i++)
createAttr(tableImpl->getColumn(i));
}
@@ -226,11 +227,10 @@ RestoreMetaData::parseTableDescriptor(const Uint32 * data, Uint32 len)
debug << "parseTableInfo " << tableImpl->getName() << " done" << endl;
- TableS * table = new TableS(tableImpl);
+ TableS * table = new TableS(m_fileHeader.NdbVersion, tableImpl);
if(table == NULL) {
return false;
}
- table->setBackupVersion(m_fileHeader.NdbVersion);
debug << "Parsed table id " << table->getTableId() << endl;
debug << "Parsed table #attr " << table->getNoOfAttributes() << endl;
@@ -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){
@@ -699,12 +699,12 @@ void TableS::createAttr(NdbDictionary::Column *column)
if (d->m_column->getAutoIncrement())
m_auto_val_id= d->attrId;
- if(d->m_column->getPrimaryKey() /* && not variable */)
+ if(d->m_column->getPrimaryKey() && backupVersion <= MAKE_VERSION(4,1,7))
{
m_fixedKeys.push_back(d);
return;
}
-
+
if(!d->m_column->getNullable())
{
m_fixedAttribs.push_back(d);
diff --git a/ndb/tools/restore/Restore.hpp b/ndb/tools/restore/Restore.hpp
index 82fcdcdb183..e0b06c1774c 100644
--- a/ndb/tools/restore/Restore.hpp
+++ b/ndb/tools/restore/Restore.hpp
@@ -140,7 +140,7 @@ class TableS {
public:
class NdbDictionary::Table* m_dictTable;
- TableS (class NdbTableImpl* dictTable);
+ TableS (Uint32 version, class NdbTableImpl* dictTable);
~TableS();
Uint32 getTableId() const {
diff --git a/ndb/tools/restore/consumer_restore.cpp b/ndb/tools/restore/consumer_restore.cpp
index e2c55e5a0b1..fbe96cb2a71 100644
--- a/ndb/tools/restore/consumer_restore.cpp
+++ b/ndb/tools/restore/consumer_restore.cpp
@@ -52,19 +52,10 @@ BackupRestore::init()
return false;
}
- m_tuples = new TupleS[m_parallelism];
-
- if (m_tuples == 0)
- {
- err << "Failed to allocate tuples" << endl;
- return false;
- }
-
m_free_callback= m_callback;
for (Uint32 i= 0; i < m_parallelism; i++) {
m_callback[i].restore= this;
m_callback[i].connection= 0;
- m_callback[i].tup= &m_tuples[i];
if (i > 0)
m_callback[i-1].next= &(m_callback[i]);
}
@@ -86,12 +77,6 @@ void BackupRestore::release()
delete [] m_callback;
m_callback= 0;
}
-
- if (m_tuples)
- {
- delete [] m_tuples;
- m_tuples= 0;
- }
}
BackupRestore::~BackupRestore()
@@ -118,14 +103,21 @@ BackupRestore::get_table(const NdbDictionary::Table* tab){
m_cache.m_old_table = tab;
int cnt, id1, id2;
- char buf[256];
- if((cnt = sscanf(tab->getName(), "%[^/]/%[^/]/NDB$BLOB_%d_%d", buf, buf, &id1, &id2)) == 4){
- BaseString::snprintf(buf, sizeof(buf), "NDB$BLOB_%d_%d", m_new_tables[id1]->getTableId(), id2);
- m_cache.m_new_table = m_ndb->getDictionary()->getTable(buf);
+ char db[256], schema[256];
+ if((cnt = sscanf(tab->getName(), "%[^/]/%[^/]/NDB$BLOB_%d_%d",
+ db, schema, &id1, &id2)) == 4){
+ m_ndb->setDatabaseName(db);
+ m_ndb->setSchemaName(schema);
+
+ BaseString::snprintf(db, sizeof(db), "NDB$BLOB_%d_%d",
+ m_new_tables[id1]->getTableId(), id2);
+
+ m_cache.m_new_table = m_ndb->getDictionary()->getTable(db);
+
} else {
m_cache.m_new_table = m_new_tables[tab->getTableId()];
}
-
+ assert(m_cache.m_new_table);
return m_cache.m_new_table;
}
@@ -266,22 +258,24 @@ void BackupRestore::tuple(const TupleS & tup)
if (!m_restore)
return;
+ while (m_free_callback == 0)
+ {
+ assert(m_transactions == m_parallelism);
+ // send-poll all transactions
+ // close transaction is done in callback
+ m_ndb->sendPollNdb(3000, 1);
+ }
+
restore_callback_t * cb = m_free_callback;
-
+
if (cb == 0)
assert(false);
-
+
m_free_callback = cb->next;
cb->retries = 0;
- *(cb->tup) = tup; // must do copy!
+ cb->tup = tup; // must do copy!
tuple_a(cb);
- if (m_free_callback == 0)
- {
- // send-poll all transactions
- // close transaction is done in callback
- m_ndb->sendPollNdb(3000, 1);
- }
}
void BackupRestore::tuple_a(restore_callback_t *cb)
@@ -303,7 +297,7 @@ void BackupRestore::tuple_a(restore_callback_t *cb)
exitHandler();
} // if
- const TupleS &tup = *(cb->tup);
+ const TupleS &tup = cb->tup;
const NdbDictionary::Table * table = get_table(tup.getTable()->m_dictTable);
NdbOperation * op = cb->connection->getNdbOperation(table);
@@ -372,7 +366,9 @@ void BackupRestore::tuple_a(restore_callback_t *cb)
m_transactions++;
return;
}
- err << "Unable to recover from errors. Exiting..." << endl;
+ err << "Retried transaction " << cb->retries << " times.\nLast error"
+ << m_ndb->getNdbError(cb->error_code) << endl
+ << "...Unable to recover from errors. Exiting..." << endl;
exitHandler();
}
@@ -416,16 +412,21 @@ bool BackupRestore::errorHandler(restore_callback_t *cb)
NdbError error= cb->connection->getNdbError();
m_ndb->closeTransaction(cb->connection);
cb->connection= 0;
+
+ Uint32 sleepTime = 100 + cb->retries * 300;
+
cb->retries++;
+ cb->error_code = error.code;
+
switch(error.status)
{
case NdbError::Success:
- return false;
- // ERROR!
- break;
-
+ return false;
+ // ERROR!
+ break;
+
case NdbError::TemporaryError:
- NdbSleep_MilliSleep(10);
+ NdbSleep_MilliSleep(sleepTime);
return true;
// RETRY
break;
@@ -438,15 +439,6 @@ bool BackupRestore::errorHandler(restore_callback_t *cb)
default:
case NdbError::PermanentError:
- switch (error.code)
- {
- case 499:
- case 250:
- NdbSleep_MilliSleep(10);
- return true; //temp errors?
- default:
- break;
- }
//ERROR
err << error << endl;
return false;
@@ -468,13 +460,10 @@ BackupRestore::tuple_free()
if (!m_restore)
return;
- if (m_transactions > 0) {
- // Send all transactions to NDB
- m_ndb->sendPreparedTransactions(0);
-
- // Poll all transactions
- while (m_transactions > 0)
- m_ndb->pollNdb(3000, m_transactions);
+ // Poll all transactions
+ while (m_transactions)
+ {
+ m_ndb->sendPollNdb(3000);
}
}
diff --git a/ndb/tools/restore/consumer_restore.hpp b/ndb/tools/restore/consumer_restore.hpp
index 59e2734ea1f..df219cd4412 100644
--- a/ndb/tools/restore/consumer_restore.hpp
+++ b/ndb/tools/restore/consumer_restore.hpp
@@ -21,9 +21,10 @@
struct restore_callback_t {
class BackupRestore *restore;
- class TupleS *tup;
+ class TupleS tup;
class NdbConnection *connection;
int retries;
+ int error_code;
restore_callback_t *next;
};
@@ -39,7 +40,6 @@ public:
m_restore_meta = false;
m_parallelism = parallelism;
m_callback = 0;
- m_tuples = 0;
m_free_callback = 0;
m_transactions = 0;
m_cache.m_old_table = 0;
@@ -68,9 +68,8 @@ public:
Uint32 m_dataCount;
Uint32 m_parallelism;
- Uint32 m_transactions;
+ volatile Uint32 m_transactions;
- TupleS *m_tuples;
restore_callback_t *m_callback;
restore_callback_t *m_free_callback;
diff --git a/ndb/tools/restore/restore_main.cpp b/ndb/tools/restore/restore_main.cpp
index 409ebd54764..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
@@ -258,11 +261,18 @@ main(int argc, char** argv)
ndbout << "Failed to read " << metaData.getFilename() << endl << endl;
return -1;
}
+
+ const BackupFormat::FileHeader & tmp = metaData.getFileHeader();
+ const Uint32 version = tmp.NdbVersion;
+
+ ndbout << "Ndb version in backup files: "
+ << getVersionString(version, 0) << endl;
+
/**
* check wheater we can restore the backup (right version).
*/
int res = metaData.loadContent();
-
+
if (res == 0)
{
ndbout_c("Restore: Failed to load content");
diff --git a/ndb/tools/select_all.cpp b/ndb/tools/select_all.cpp
index 5efeed485a4..9c65750094b 100644
--- a/ndb/tools/select_all.cpp
+++ b/ndb/tools/select_all.cpp
@@ -36,7 +36,11 @@ int scanReadRecords(Ndb*,
char delim,
bool orderby);
-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 c3491f842d8..516eebda91d 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,
UtilTransactions::ScanLock 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/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 e68b5bebbd4..eec4ddda27b 100644
--- a/scripts/make_win_src_distribution.sh
+++ b/scripts/make_win_src_distribution.sh
@@ -188,8 +188,11 @@ copy_dir_files()
print_debug "Creating directory '$arg'"
mkdir $BASE/$arg
fi
- for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \
- README INSTALL* LICENSE
+ for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp \
+ README INSTALL* LICENSE *.inc *.test *.result \
+ *.pem Moscow_leap des_key_file *.dat *.000001 \
+ *.require *.opt
+
do
if [ -f $i ]
then
@@ -244,10 +247,15 @@ do
done
#
+# Create project files for ndb
+#
+make -C $SOURCE/ndb windoze
+
+#
# Input directories to be copied recursively
#
-for i in bdb innobase
+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 b4f59790e73..8b2e42bd8cd 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/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..0f1faccfe42 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -2197,7 +2197,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 +5919,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 +6021,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 +6058,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 +6144,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 +6172,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/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index f838bfcd8c3..7320665dc49 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= 240;
@@ -39,9 +43,6 @@ static const int parallelism= 240;
// 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
@@ -192,7 +193,7 @@ int execute_no_commit_ie(ha_ndbcluster *h, NdbConnection *trans)
if (m_batch_execute)
return 0;
#endif
- return trans->execute(NoCommit,IgnoreError,h->m_force_send);
+ return trans->execute(NoCommit, AO_IgnoreError,h->m_force_send);
}
/*
@@ -3638,9 +3639,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);
@@ -3648,14 +3653,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);
}
@@ -3664,19 +3675,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;
@@ -3699,7 +3707,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());
}
@@ -3958,6 +3966,7 @@ Ndb* check_ndb_in_thd(THD* thd)
}
+
int ha_ndbcluster::check_ndb_connection()
{
THD* thd= current_thd;
@@ -4240,15 +4249,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));
@@ -4263,7 +4276,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 2f18a52b8e9..ca3fa929674 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -148,7 +148,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 e43f2c2e888..d6ce85f6a13 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1232,6 +1232,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;
@@ -1345,7 +1348,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..ee77f2d43c0 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -73,7 +73,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 +171,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 +1780,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 +1844,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 +1883,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 +1925,6 @@ 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..5a760db23f5 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()
+ {
+ double tmp=(*ref)->val();
+ 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..a118de6fdb9 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);
+ double value= args[0]->val();
+
+ /*
+ 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 aba53b9b397..e2a9071324b 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -394,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);
@@ -855,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)
{
/*
@@ -1742,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 2fc82e05f31..c346de98615 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);
@@ -428,7 +427,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);
@@ -436,6 +434,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
@@ -1322,6 +1322,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 c5698469341..203be4b96a4 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;
@@ -4108,6 +4116,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,
@@ -4577,24 +4586,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,
@@ -4895,7 +4926,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},
@@ -5141,7 +5173,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 da6341597f1..a5370fde671 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>
@@ -374,22 +373,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 */
@@ -2856,7 +2851,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()))
{
@@ -2890,7 +2886,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/sql_acl.cc b/sql/sql_acl.cc
index d33faffb2c2..81419d64e15 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()
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 2500769ee30..250da2981ff 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"
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 6cec2c2c787..149d12225a3 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1371,9 +1371,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);
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..e2b7ee93905 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"
@@ -244,13 +243,6 @@ 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))
goto abort;
@@ -666,26 +658,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)
{
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 (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_check_table(thd, table_list, fields, &unused_conds,
FALSE))
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 +696,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 +796,10 @@ 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;
@@ -1753,17 +1756,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 2205ec504e9..ece960c5d1c 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -129,6 +129,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=
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 7a4ef0b98e5..3ef475b89b0 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 01e80653372..b5b0d76dcf3 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>
@@ -1129,13 +1128,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--;
@@ -2817,7 +2829,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
@@ -2945,7 +2959,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)
@@ -2956,7 +2970,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 */
@@ -2969,19 +2983,23 @@ create_error:
select_result *result;
unit->set_limit(select_lex, select_lex);
- if (!(res= open_and_lock_tables(thd, all_tables)))
+ if (!(res= open_and_lock_tables(thd, all_tables)) &&
+ !(res= mysql_prepare_insert(thd, tables, first_local_table,
+ tables->table, lex->field_list, 0,
+ lex->update_list, lex->value_list,
+ lex->duplicates)))
{
+ TABLE *table= tables->table;
/* Skip first table, which is the table we are inserting in */
lex->select_lex.table_list.first= (byte*)first_table->next_local;
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
@@ -2990,6 +3008,7 @@ create_error:
res= handle_select(thd, lex, result);
lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE;
delete result;
+ table->insert_values= 0;
}
/* revert changes for SP */
lex->select_lex.table_list.first= (byte*) first_table;
@@ -3355,7 +3374,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;
@@ -3369,14 +3394,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())
{
@@ -3384,7 +3409,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:
@@ -3396,12 +3421,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;
}
@@ -4093,7 +4112,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()
@@ -4116,7 +4135,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))
{
@@ -5977,9 +5996,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 */
}
@@ -6083,6 +6102,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 (my_tz_check_n_skip_implicit_tables(&table,
+ lex->time_zone_tables_used))
+ continue;
if (!table->table_in_first_from_clause && table->derived)
{
if (check_access(thd, SELECT_ACL, table->db,
@@ -6168,32 +6190,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
@@ -6261,6 +6257,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));
@@ -6268,7 +6268,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..e4e61dc8d31 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"
@@ -1387,7 +1386,7 @@ static int mysql_test_insert_select(Prepared_statement *stmt,
{
int res;
LEX *lex= stmt->lex;
- if ((res= insert_select_precheck(stmt->thd, tables)))
+ if ((res= insert_precheck(stmt->thd, tables)))
return res;
TABLE_LIST *first_local_table=
(TABLE_LIST *)lex->select_lex.table_list.first;
@@ -1584,6 +1583,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)
+ {
+ 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.
@@ -1678,6 +1698,7 @@ bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length,
if (!error)
error= check_prepared_statement(stmt, test(name));
+ cleanup_stmt_for_execute(stmt);
/* restore to WAIT_PRIOR: QUERY_PRIOR is set inside alloc_query */
if (!(specialflag & SPECIAL_NO_PRIOR))
@@ -2038,6 +2059,7 @@ static void execute_stmt(THD *thd, Prepared_statement *stmt,
reset_stmt_params(stmt);
close_thread_tables(thd); // to close derived tables
thd->set_statement(&thd->stmt_backup);
+ cleanup_stmt_for_execute(stmt);
thd->cleanup_after_query();
if (stmt->state == Item_arena::PREPARED)
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..44eb411ed44 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++)
{
/*
@@ -9213,7 +9213,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 +9258,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 +12266,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 826bd2038f9..986f8027df2 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>
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_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..fa4acce31f7 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 */
@@ -740,6 +739,19 @@ bool mysql_multi_update_prepare(THD *thd)
}
if (!using_lock_tables)
tl->table->reginfo.lock_type= tl->lock_type;
+
+ /* Check access privileges for table */
+ {
+ TABLE_LIST *save= tl->next;
+ bool res;
+ tl->next= 0;
+ res= (check_access(thd, tl->updating ? UPDATE_ACL : SELECT_ACL,
+ tl->db, &tl->grant.privilege, 0, 0) ||
+ (grant_option && check_grant(thd, wants, tl, 0, 0, 0)));
+ tl->next= save;
+ if (res)
+ DBUG_RETURN(TRUE);
+ }
}
/* check single table update for view compound from several tables */
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 99b8caed784..1c2dde5d278 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"
@@ -675,7 +674,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
@@ -3236,7 +3235,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;
@@ -3245,7 +3244,7 @@ alter:
{
LEX *lex=Lex;
lex->sql_command=SQLCOM_ALTER_DB;
- lex->name=$3.str;
+ lex->name= $3;
}
| ALTER PROCEDURE sp_name
{
@@ -3289,6 +3288,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; }
@@ -5714,19 +5717,7 @@ 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
+ KEY_SYM UPDATE_SYM insert_update_list
;
/* Update rows in a table */
@@ -5762,16 +5753,26 @@ 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
+ {
+ };
+
+insert_update_list:
+ insert_update_list ',' insert_update_elem
+ | insert_update_elem;
+
+insert_update_elem:
+ simple_ident_nospvar equal expr_or_default
{
- if (add_item_to_list(YYTHD, $3) || add_value_to_list(YYTHD, $5))
+ LEX *lex= Lex;
+ if (lex->update_list.push_back($1) ||
+ lex->value_list.push_back($3))
YYABORT;
- }
- | simple_ident_nospvar equal expr_or_default
- {
- if (add_item_to_list(YYTHD, $1) || add_value_to_list(YYTHD, $3))
- YYABORT;
- };
+ };
opt_low_priority:
/* empty */ { $$= YYTHD->update_lock_default; }
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 c18a2557337..a37186287b4 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -509,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..871b96165b2 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;
diff --git a/sql/tztime.h b/sql/tztime.h
index 6d2388bb160..8b26c8fa378 100644
--- a/sql/tztime.h
+++ b/sql/tztime.h
@@ -66,8 +66,8 @@ extern void my_tz_free();
/*
- 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()
@@ -87,6 +87,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-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/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..1a6b9525f87 100644
--- a/tests/client_test.c
+++ b/tests/client_test.c
@@ -705,10 +705,8 @@ 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)
DIE_UNLESS(field->length == length * cs->mbmaxlen);
-#endif
if (def)
DIE_UNLESS(strcmp(field->def, def) == 0);
}
@@ -1261,6 +1259,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 +1334,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 +1363,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 +1393,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 +1419,8 @@ 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_TYPE_VAR_STRING,
+ "t1", "test_prepare_field_result", current_db, 4, 0);
verify_field_count(result, 5);
mysql_free_result(result);
@@ -2106,7 +2156,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 +2217,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 +2297,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 +3138,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 +5118,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 +5886,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 +6224,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 +6880,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);
@@ -12059,6 +12111,66 @@ 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 +12527,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 +12670,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 },