summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore6
-rwxr-xr-xBUILD/compile-pentium-valgrind-max2
-rw-r--r--BitKeeper/etc/logging_ok7
-rwxr-xr-xBuild-tools/Do-compile23
-rwxr-xr-xBuild-tools/Do-pkg15
-rwxr-xr-xBuild-tools/mysql-copyright-22
-rw-r--r--VC++Files/README.build-files19
-rw-r--r--VC++Files/bdb/bdb.dsp6
-rw-r--r--VC++Files/client/mysql.dsp36
-rw-r--r--VC++Files/client/mysqladmin.dsp31
-rw-r--r--VC++Files/client/mysqlclient.dsp24
-rw-r--r--VC++Files/client/mysqldump.dsp33
-rw-r--r--VC++Files/client/mysqlimport.dsp33
-rw-r--r--VC++Files/client/mysqlshow.dsp31
-rw-r--r--VC++Files/comp_err/comp_err.dsp18
-rw-r--r--VC++Files/copy_mysql_files.bat80
-rw-r--r--VC++Files/dbug/dbug.dsp35
-rw-r--r--VC++Files/heap/heap.dsp69
-rw-r--r--VC++Files/innobase/innobase.dsp14
-rw-r--r--VC++Files/isam/isam.dsp62
-rw-r--r--VC++Files/isamchk/isamchk.dsp33
-rw-r--r--VC++Files/libmysql/libmysql.dsp6
-rw-r--r--VC++Files/libmysqld/libmysqld.dsp117
-rw-r--r--VC++Files/libmysqltest/myTest.dsp2
-rw-r--r--VC++Files/merge/merge.dsp8
-rw-r--r--VC++Files/my_print_defaults/my_print_defaults.dsp49
-rw-r--r--VC++Files/myisam/myisam.dsp52
-rwxr-xr-xVC++Files/myisam_ftdump/myisam_ftdump.dsp22
-rw-r--r--VC++Files/myisamchk/myisamchk.dsp29
-rw-r--r--VC++Files/myisamlog/myisamlog.dsp29
-rw-r--r--VC++Files/myisammrg/myisammrg.dsp60
-rw-r--r--VC++Files/myisampack/myisampack.dsp41
-rw-r--r--VC++Files/mysql.dsw4
-rw-r--r--VC++Files/mysqlbinlog/mysqlbinlog.dsp31
-rw-r--r--VC++Files/mysqlcheck/mysqlcheck.dsp29
-rw-r--r--VC++Files/mysqldemb/mysqldemb.dsp59
-rw-r--r--VC++Files/mysqlmanager/RES/bitmap1.bmp (renamed from VC++Files/mysqlmanager/RES/BITMAP1.BMP)bin630 -> 630 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/bitmap3.bmp (renamed from VC++Files/mysqlmanager/RES/BITMAP3.BMP)bin630 -> 630 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/bmp00001.bmp (renamed from VC++Files/mysqlmanager/RES/BMP00001.BMP)bin246 -> 246 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/bmp00002.bmp (renamed from VC++Files/mysqlmanager/RES/BMP00002.BMP)bin238 -> 238 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/database.bmp (renamed from VC++Files/mysqlmanager/RES/DATABASE.BMP)bin238 -> 238 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/fontd.bmp (renamed from VC++Files/mysqlmanager/RES/FONTD.BMP)bin246 -> 246 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/fontu.bmp (renamed from VC++Files/mysqlmanager/RES/FONTU.BMP)bin246 -> 246 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/query_ex.bmp (renamed from VC++Files/mysqlmanager/RES/QUERY_EX.BMP)bin246 -> 246 bytes
-rw-r--r--VC++Files/mysqlmanager/RES/toolbar.bmp (renamed from VC++Files/mysqlmanager/RES/TOOLBAR.BMP)bin1078 -> 1078 bytes
-rw-r--r--VC++Files/mysqlmanager/childfrm.cpp (renamed from VC++Files/mysqlmanager/CHILDFRM.CPP)0
-rw-r--r--VC++Files/mysqlmanager/childfrm.h (renamed from VC++Files/mysqlmanager/CHILDFRM.H)0
-rw-r--r--VC++Files/mysqlmanager/mainfrm.cpp (renamed from VC++Files/mysqlmanager/MAINFRM.CPP)0
-rw-r--r--VC++Files/mysqlmanager/mainfrm.h (renamed from VC++Files/mysqlmanager/MAINFRM.H)0
-rw-r--r--VC++Files/mysqlmanager/mysqlmanager.dsp (renamed from VC++Files/mysqlmanager/MySqlManager.dsp)0
-rw-r--r--VC++Files/mysqlmanager/mysqlmanager.mak (renamed from VC++Files/mysqlmanager/MySqlManager.mak)0
-rw-r--r--VC++Files/mysqlmanager/resource.h (renamed from VC++Files/mysqlmanager/RESOURCE.H)0
-rw-r--r--VC++Files/mysqlmanager/stdafx.cpp (renamed from VC++Files/mysqlmanager/STDAFX.CPP)0
-rw-r--r--VC++Files/mysqlmanager/stdafx.h (renamed from VC++Files/mysqlmanager/STDAFX.H)0
-rw-r--r--VC++Files/mysqlmanager/toolsql.cpp (renamed from VC++Files/mysqlmanager/TOOLSQL.CPP)0
-rw-r--r--VC++Files/mysqlmanager/toolsql.h (renamed from VC++Files/mysqlmanager/TOOLSQL.H)0
-rw-r--r--VC++Files/mysqlserver/mysqlserver.dsp2
-rw-r--r--VC++Files/mysqlshutdown/mysqlshutdown.dsp2
-rw-r--r--VC++Files/mysqlwatch/mysqlwatch.dsp6
-rw-r--r--VC++Files/mysys/mysys.dsp101
-rw-r--r--VC++Files/pack_isam/pack_isam.dsp29
-rw-r--r--VC++Files/perror/perror.dsp35
-rw-r--r--VC++Files/regex/regex.dsp8
-rw-r--r--VC++Files/replace/replace.dsp31
-rw-r--r--VC++Files/sql/mysqld.dsp645
-rw-r--r--VC++Files/strings/strings.dsp9
-rw-r--r--VC++Files/test1/test1.dsp2
-rw-r--r--VC++Files/thr_test/thr_test.dsp2
-rw-r--r--VC++Files/vio/vio.dsp2
-rw-r--r--VC++Files/zlib/contrib/asm386/zlibvc.dsp76
-rw-r--r--VC++Files/zlib/zlib.dsp2
-rw-r--r--client/my_readline.h2
-rw-r--r--client/mysql.cc72
-rw-r--r--client/mysqladmin.c4
-rw-r--r--client/mysqlbinlog.cc17
-rw-r--r--client/mysqlcheck.c4
-rw-r--r--client/mysqldump.c73
-rw-r--r--client/mysqlimport.c5
-rw-r--r--client/mysqlshow.c6
-rw-r--r--client/mysqltest.c114
-rw-r--r--client/readline.cc40
-rw-r--r--configure.in11
-rw-r--r--extra/Makefile.am2
-rw-r--r--extra/perror.c45
-rw-r--r--heap/heapdef.h3
-rw-r--r--heap/hp_clear.c145
-rw-r--r--heap/hp_hash.c37
-rw-r--r--include/config-netware.h28
-rw-r--r--include/heap.h14
-rw-r--r--include/help_end.h6
-rw-r--r--include/help_start.h7
-rw-r--r--include/m_ctype.h3
-rw-r--r--include/m_string.h1
-rw-r--r--include/my_base.h12
-rw-r--r--include/my_bitmap.h6
-rw-r--r--include/my_global.h14
-rw-r--r--include/my_sys.h2
-rw-r--r--include/myisam.h5
-rw-r--r--include/myisammrg.h5
-rw-r--r--include/mysql.h9
-rw-r--r--include/mysql_com.h12
-rw-r--r--include/mysql_embed.h3
-rw-r--r--include/mysql_version.h.in6
-rw-r--r--include/thr_alarm.h2
-rw-r--r--include/violite.h10
-rw-r--r--innobase/btr/btr0btr.c2
-rw-r--r--innobase/btr/btr0cur.c6
-rw-r--r--innobase/btr/btr0sea.c4
-rw-r--r--innobase/buf/buf0buf.c8
-rw-r--r--innobase/dict/dict0dict.c66
-rw-r--r--innobase/dict/dict0load.c30
-rw-r--r--innobase/dict/dict0mem.c42
-rw-r--r--innobase/eval/eval0eval.c2
-rw-r--r--innobase/fil/fil0fil.c127
-rw-r--r--innobase/ibuf/ibuf0ibuf.c9
-rw-r--r--innobase/include/Makefile.am6
-rw-r--r--innobase/include/buf0buf.h14
-rw-r--r--innobase/include/buf0buf.ic2
-rw-r--r--innobase/include/data0data.h2
-rw-r--r--innobase/include/data0data.ic4
-rw-r--r--innobase/include/dict0dict.h53
-rw-r--r--innobase/include/dict0dict.ic10
-rw-r--r--innobase/include/dict0load.h23
-rw-r--r--innobase/include/dict0mem.h70
-rw-r--r--innobase/include/fil0fil.h104
-rw-r--r--innobase/include/mem0mem.h96
-rw-r--r--innobase/include/mem0mem.ic96
-rw-r--r--innobase/include/mem0pool.h2
-rw-r--r--innobase/include/mtr0mtr.h8
-rw-r--r--innobase/include/mtr0mtr.ic4
-rw-r--r--innobase/include/os0file.h156
-rw-r--r--innobase/include/os0shm.h66
-rw-r--r--innobase/include/os0shm.ic10
-rw-r--r--innobase/include/os0sync.h18
-rw-r--r--innobase/include/pars0pars.h6
-rw-r--r--innobase/include/pars0sym.h4
-rw-r--r--innobase/include/que0que.h22
-rw-r--r--innobase/include/row0mysql.h51
-rw-r--r--innobase/include/row0sel.h10
-rw-r--r--innobase/include/srv0que.h53
-rw-r--r--innobase/include/sync0arr.h2
-rw-r--r--innobase/include/sync0ipm.h113
-rw-r--r--innobase/include/sync0ipm.ic182
-rw-r--r--innobase/include/sync0rw.h44
-rw-r--r--innobase/include/sync0rw.ic22
-rw-r--r--innobase/include/sync0sync.h16
-rw-r--r--innobase/include/sync0sync.ic8
-rw-r--r--innobase/include/trx0roll.h25
-rw-r--r--innobase/include/trx0sys.h2
-rw-r--r--innobase/include/trx0trx.h43
-rw-r--r--innobase/include/univ.i5
-rw-r--r--innobase/include/usr0sess.h6
-rw-r--r--innobase/include/ut0dbg.h6
-rw-r--r--innobase/include/ut0mem.h31
-rw-r--r--innobase/include/ut0mem.ic12
-rw-r--r--innobase/include/ut0rnd.h10
-rw-r--r--innobase/include/ut0rnd.ic10
-rw-r--r--innobase/include/ut0ut.h47
-rw-r--r--innobase/lock/lock0lock.c42
-rw-r--r--innobase/log/log0recv.c6
-rw-r--r--innobase/mem/mem0mem.c34
-rw-r--r--innobase/mem/mem0pool.c18
-rw-r--r--innobase/os/Makefile.am2
-rw-r--r--innobase/os/makefilewin7
-rw-r--r--innobase/os/os0file.c208
-rw-r--r--innobase/os/os0shm.c152
-rw-r--r--innobase/os/os0sync.c18
-rw-r--r--innobase/pars/pars0lex.l4
-rw-r--r--innobase/pars/pars0pars.c7
-rw-r--r--innobase/pars/pars0sym.c5
-rw-r--r--innobase/que/que0que.c109
-rw-r--r--innobase/row/row0ins.c3
-rw-r--r--innobase/row/row0mysql.c58
-rw-r--r--innobase/row/row0sel.c13
-rw-r--r--innobase/row/row0umod.c3
-rw-r--r--innobase/row/row0upd.c3
-rw-r--r--innobase/srv/Makefile.am2
-rw-r--r--innobase/srv/srv0que.c111
-rw-r--r--innobase/srv/srv0srv.c9
-rw-r--r--innobase/sync/Makefile.am2
-rw-r--r--innobase/sync/makefilewin7
-rw-r--r--innobase/sync/sync0arr.c5
-rw-r--r--innobase/sync/sync0ipm.c170
-rw-r--r--innobase/sync/sync0rw.c12
-rw-r--r--innobase/sync/sync0sync.c13
-rw-r--r--innobase/trx/trx0purge.c3
-rw-r--r--innobase/trx/trx0rec.c24
-rw-r--r--innobase/trx/trx0roll.c81
-rw-r--r--innobase/trx/trx0sys.c4
-rw-r--r--innobase/trx/trx0trx.c169
-rw-r--r--innobase/usr/usr0sess.c2
-rw-r--r--innobase/ut/ut0dbg.c2
-rw-r--r--innobase/ut/ut0mem.c50
-rw-r--r--innobase/ut/ut0ut.c221
-rw-r--r--isam/_search.c8
-rw-r--r--isam/isamchk.c6
-rw-r--r--isam/test2.c2
-rw-r--r--libmysql/client_settings.h2
-rw-r--r--libmysql/libmysql.c178
-rw-r--r--libmysqld/Makefile.am43
-rw-r--r--libmysqld/emb_qcache.cc6
-rw-r--r--libmysqld/embedded_priv.h1
-rw-r--r--libmysqld/examples/Makefile.am11
-rw-r--r--libmysqld/lib_sql.cc38
-rw-r--r--libmysqld/libmysqld.c1
-rw-r--r--libmysqld/libmysqld.def2
-rw-r--r--myisam/ft_nlq_search.c5
-rw-r--r--myisam/mi_check.c7
-rw-r--r--myisam/mi_dynrec.c2
-rw-r--r--myisam/mi_open.c83
-rw-r--r--myisam/mi_range.c72
-rw-r--r--myisam/mi_test2.c24
-rw-r--r--myisam/myisam_ftdump.c3
-rw-r--r--myisam/myisamchk.c4
-rw-r--r--myisam/myisamdef.h5
-rw-r--r--myisam/myisampack.c4
-rw-r--r--myisam/rt_test.c81
-rw-r--r--myisam/sp_test.c84
-rw-r--r--myisammrg/myrg_range.c11
-rw-r--r--mysql-test/r/auto_increment.result2
-rw-r--r--mysql-test/r/bench_count_distinct.result2
-rw-r--r--mysql-test/r/case.result6
-rw-r--r--mysql-test/r/cast.result2
-rw-r--r--mysql-test/r/ctype_collate.result2
-rw-r--r--mysql-test/r/ctype_latin1.result298
-rw-r--r--mysql-test/r/ctype_recoding.result7
-rw-r--r--mysql-test/r/date_formats.result2
-rw-r--r--mysql-test/r/derived.result4
-rw-r--r--mysql-test/r/explain.result9
-rw-r--r--mysql-test/r/fulltext.result6
-rw-r--r--mysql-test/r/func_compress.result4
-rw-r--r--mysql-test/r/func_crypt.result2
-rw-r--r--mysql-test/r/func_default.result2
-rw-r--r--mysql-test/r/func_encrypt.result2
-rw-r--r--mysql-test/r/func_gconcat.result15
-rw-r--r--mysql-test/r/func_group.result2
-rw-r--r--mysql-test/r/func_if.result4
-rw-r--r--mysql-test/r/func_in.result2
-rw-r--r--mysql-test/r/func_math.result26
-rw-r--r--mysql-test/r/func_op.result4
-rw-r--r--mysql-test/r/func_regexp.result2
-rw-r--r--mysql-test/r/func_set.result2
-rw-r--r--mysql-test/r/func_str.result11
-rw-r--r--mysql-test/r/func_system.result2
-rw-r--r--mysql-test/r/func_test.result12
-rw-r--r--mysql-test/r/func_time.result4
-rw-r--r--mysql-test/r/gis.result22
-rw-r--r--mysql-test/r/grant.result24
-rw-r--r--mysql-test/r/greedy_optimizer.result62
-rw-r--r--mysql-test/r/group_by.result2
-rw-r--r--mysql-test/r/handler.result12
-rw-r--r--mysql-test/r/having.result2
-rw-r--r--mysql-test/r/index_merge.result1
-rw-r--r--mysql-test/r/innodb.result177
-rw-r--r--mysql-test/r/insert_update.result4
-rw-r--r--mysql-test/r/null.result6
-rw-r--r--mysql-test/r/olap.result2
-rw-r--r--mysql-test/r/order_by.result9
-rw-r--r--mysql-test/r/query_cache.result2
-rw-r--r--mysql-test/r/range.result8
-rw-r--r--mysql-test/r/row.result2
-rw-r--r--mysql-test/r/rpl000001.result4
-rw-r--r--mysql-test/r/rpl_get_lock.result2
-rw-r--r--mysql-test/r/rpl_master_pos_wait.result2
-rw-r--r--mysql-test/r/rpl_relayrotate.result15
-rw-r--r--mysql-test/r/select.result2
-rw-r--r--mysql-test/r/sp.result235
-rw-r--r--mysql-test/r/subselect.result192
-rw-r--r--mysql-test/r/type_blob.result2
-rw-r--r--mysql-test/r/type_datetime.result6
-rw-r--r--mysql-test/r/type_float.result27
-rw-r--r--mysql-test/r/union.result27
-rw-r--r--mysql-test/r/varbinary.result2
-rw-r--r--mysql-test/r/variables.result11
-rw-r--r--mysql-test/t/ctype_latin1.test55
-rw-r--r--mysql-test/t/ctype_recoding.test8
-rw-r--r--mysql-test/t/explain.test11
-rw-r--r--mysql-test/t/fulltext.test1
-rw-r--r--mysql-test/t/func_gconcat.test10
-rw-r--r--mysql-test/t/func_str.test9
-rw-r--r--mysql-test/t/grant.test23
-rw-r--r--mysql-test/t/greedy_optimizer.test54
-rw-r--r--mysql-test/t/handler.test12
-rw-r--r--mysql-test/t/innodb-master.opt (renamed from mysql-test/t/rpl_relayrotate-master.opt)0
-rw-r--r--mysql-test/t/innodb.test96
-rw-r--r--mysql-test/t/key_cache.test6
-rw-r--r--mysql-test/t/order_by.test10
-rw-r--r--mysql-test/t/range.test3
-rw-r--r--mysql-test/t/rpl000015.test2
-rw-r--r--mysql-test/t/rpl_error_ignored_table.test2
-rw-r--r--mysql-test/t/rpl_log.test6
-rw-r--r--mysql-test/t/rpl_log_pos.test8
-rw-r--r--mysql-test/t/rpl_max_relay_size.test12
-rw-r--r--mysql-test/t/rpl_relayrotate.test16
-rw-r--r--mysql-test/t/rpl_rotate_logs.test10
-rw-r--r--mysql-test/t/sp.test273
-rw-r--r--mysql-test/t/subselect.test36
-rw-r--r--mysql-test/t/type_float.test14
-rw-r--r--mysql-test/t/union.test12
-rw-r--r--mysql-test/t/variables.test8
-rw-r--r--mysys/charset.c61
-rw-r--r--mysys/default.c3
-rw-r--r--mysys/my_bitmap.c6
-rw-r--r--mysys/my_chsize.c2
-rw-r--r--mysys/my_compress.c2
-rw-r--r--mysys/my_getopt.c4
-rw-r--r--mysys/my_handler.c8
-rw-r--r--mysys/my_init.c10
-rw-r--r--mysys/my_lock.c10
-rw-r--r--mysys/my_netware.c2
-rw-r--r--mysys/my_pthread.c22
-rw-r--r--mysys/sha1.c2
-rw-r--r--ndb/Defs.mk30
-rw-r--r--ndb/Epilogue.mk2
-rw-r--r--ndb/Makefile9
-rw-r--r--ndb/bin/regression.sh2
-rw-r--r--ndb/config/Defs.LINUX.x86.GCC.mk10
-rwxr-xr-xndb/config/GuessConfig.sh5
-rw-r--r--ndb/examples/ndbapi_async_example/ndbapi_async.cpp12
-rw-r--r--ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp12
-rw-r--r--ndb/include/debugger/SignalLoggerManager.hpp3
-rw-r--r--ndb/include/kernel/LogLevel.hpp3
-rw-r--r--ndb/include/kernel/signaldata/BuildIndx.hpp1
-rw-r--r--ndb/include/kernel/signaldata/SignalData.hpp4
-rw-r--r--ndb/include/kernel/signaldata/SignalDataPrint.hpp2
-rw-r--r--ndb/include/logger/FileLogHandler.hpp4
-rw-r--r--ndb/include/logger/LogHandler.hpp1
-rw-r--r--ndb/include/logger/Logger.hpp2
-rw-r--r--ndb/include/mgmapi/mgmapi.h12
-rw-r--r--ndb/include/mgmcommon/MgmtErrorReporter.hpp2
-rw-r--r--ndb/include/ndb_global.h89
-rw-r--r--ndb/include/ndb_net.h7
-rw-r--r--ndb/include/ndb_types.h13
-rw-r--r--ndb/include/ndb_version.h5
-rw-r--r--ndb/include/ndbapi/Ndb.hpp6
-rw-r--r--ndb/include/ndbapi/NdbConnection.hpp3
-rw-r--r--ndb/include/ndbapi/NdbError.hpp58
-rw-r--r--ndb/include/ndbapi/NdbEventOperation.hpp6
-rw-r--r--ndb/include/ndbapi/NdbOperation.hpp17
-rw-r--r--ndb/include/ndbapi/NdbRecAttr.hpp17
-rw-r--r--ndb/include/ndbapi/NdbReceiver.hpp2
-rw-r--r--ndb/include/ndbapi/NdbScanOperation.hpp19
-rw-r--r--ndb/include/ndbapi/NdbSchemaOp.hpp4
-rw-r--r--ndb/include/ndbapi/ndberror.h98
-rw-r--r--ndb/include/newtonapi/dba.h4
-rw-r--r--ndb/include/newtonapi/defs/pcn_types.h11
-rw-r--r--ndb/include/portlib/NdbMem.h3
-rw-r--r--ndb/include/portlib/NdbMutex.h3
-rw-r--r--ndb/include/portlib/NdbTCP.h67
-rw-r--r--ndb/include/portlib/NdbThread.h3
-rw-r--r--ndb/include/portlib/NdbTick.h2
-rw-r--r--ndb/include/portlib/NdbUnistd.h39
-rw-r--r--ndb/include/transporter/TransporterDefinitions.hpp2
-rw-r--r--ndb/include/util/BaseString.hpp4
-rw-r--r--ndb/include/util/Bitmask.hpp5
-rw-r--r--ndb/include/util/File.hpp17
-rw-r--r--ndb/include/util/InputStream.hpp2
-rw-r--r--ndb/include/util/NdbAutoPtr.hpp2
-rw-r--r--ndb/include/util/NdbString.h48
-rw-r--r--ndb/include/util/OutputStream.hpp2
-rw-r--r--ndb/include/util/Properties.hpp5
-rw-r--r--ndb/include/util/SimpleProperties.hpp3
-rw-r--r--ndb/include/util/UtilBuffer.hpp4
-rw-r--r--ndb/include/util/Vector.hpp3
-rw-r--r--ndb/include/util/getarg.h2
-rw-r--r--ndb/include/util/socket_io.h3
-rw-r--r--ndb/include/util/uucode.h2
-rw-r--r--ndb/src/client/odbc/common/Ctx.cpp6
-rw-r--r--ndb/src/client/odbc/common/DataField.cpp8
-rw-r--r--ndb/src/client/odbc/common/DataType.cpp1
-rw-r--r--ndb/src/client/odbc/common/OdbcData.cpp4
-rw-r--r--ndb/src/common/debugger/DebuggerNames.cpp6
-rw-r--r--ndb/src/common/debugger/EventLogger.cpp6
-rw-r--r--ndb/src/common/debugger/SignalLoggerManager.cpp8
-rw-r--r--ndb/src/common/debugger/signaldata/CloseComReqConf.cpp1
-rw-r--r--ndb/src/common/debugger/signaldata/ContinueB.cpp1
-rw-r--r--ndb/src/common/debugger/signaldata/CreateFragmentation.cpp2
-rw-r--r--ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp1
-rw-r--r--ndb/src/common/debugger/signaldata/SystemError.cpp1
-rw-r--r--ndb/src/common/editline/editline.c4
-rw-r--r--ndb/src/common/editline/editline_internal.h5
-rw-r--r--ndb/src/common/editline/editline_win32.c3
-rw-r--r--ndb/src/common/editline/test/testit.c6
-rw-r--r--ndb/src/common/editline/unix.h3
-rw-r--r--ndb/src/common/logger/FileLogHandler.cpp18
-rw-r--r--ndb/src/common/logger/LogHandler.cpp3
-rw-r--r--ndb/src/common/logger/LogHandlerList.cpp2
-rw-r--r--ndb/src/common/logger/Logger.cpp8
-rw-r--r--ndb/src/common/logger/SysLogHandler.cpp1
-rw-r--r--ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp5
-rw-r--r--ndb/src/common/logger/loggertest/LoggerUnitTest.cpp4
-rw-r--r--ndb/src/common/mgmcommon/Config.hpp2
-rw-r--r--ndb/src/common/mgmcommon/ConfigRetriever.cpp9
-rw-r--r--ndb/src/common/mgmcommon/InitConfigFileParser.cpp7
-rw-r--r--ndb/src/common/mgmcommon/InitConfigFileParser.hpp3
-rw-r--r--ndb/src/common/mgmcommon/LocalConfig.hpp4
-rw-r--r--ndb/src/common/mgmcommon/NdbConfig.c3
-rw-r--r--ndb/src/common/mgmcommon/printConfig/printConfig.cpp3
-rw-r--r--ndb/src/common/portlib/Makefile32
-rw-r--r--ndb/src/common/portlib/memtest/memtest.c6
-rw-r--r--ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp9
-rw-r--r--ndb/src/common/portlib/mmstest/mmslist.cpp4
-rw-r--r--ndb/src/common/portlib/mmstest/mmstest.cpp4
-rw-r--r--ndb/src/common/portlib/ose/NdbCondition.c1
-rw-r--r--ndb/src/common/portlib/ose/NdbMem.c2
-rw-r--r--ndb/src/common/portlib/ose/NdbMutex.c1
-rw-r--r--ndb/src/common/portlib/ose/NdbOut.cpp7
-rw-r--r--ndb/src/common/portlib/ose/NdbThread.c1
-rw-r--r--ndb/src/common/portlib/test/NdbPortLibTest.cpp7
-rw-r--r--ndb/src/common/portlib/unix/NdbCondition.c62
-rw-r--r--ndb/src/common/portlib/unix/NdbDaemon.c39
-rw-r--r--ndb/src/common/portlib/unix/NdbEnv.c6
-rw-r--r--ndb/src/common/portlib/unix/NdbHost.c2
-rw-r--r--ndb/src/common/portlib/unix/NdbMem.c22
-rw-r--r--ndb/src/common/portlib/unix/NdbMutex.c7
-rw-r--r--ndb/src/common/portlib/unix/NdbSleep.c12
-rw-r--r--ndb/src/common/portlib/unix/NdbTCP.c26
-rw-r--r--ndb/src/common/portlib/unix/NdbThread.c13
-rw-r--r--ndb/src/common/portlib/unix/NdbTick.c14
-rw-r--r--ndb/src/common/portlib/win32/NdbCondition.c1
-rw-r--r--ndb/src/common/portlib/win32/NdbDaemon.c7
-rw-r--r--ndb/src/common/portlib/win32/NdbMem.c2
-rw-r--r--ndb/src/common/portlib/win32/NdbMutex.c1
-rw-r--r--ndb/src/common/portlib/win32/NdbThread.c1
-rw-r--r--ndb/src/common/transporter/Makefile27
-rw-r--r--ndb/src/common/transporter/OSE_Receiver.cpp1
-rw-r--r--ndb/src/common/transporter/OSE_Transporter.cpp2
-rw-r--r--ndb/src/common/transporter/Packer.cpp4
-rw-r--r--ndb/src/common/transporter/SCI_Transporter.cpp9
-rw-r--r--ndb/src/common/transporter/SHM_Buffer.hpp5
-rw-r--r--ndb/src/common/transporter/SHM_Transporter.cpp9
-rw-r--r--ndb/src/common/transporter/SHM_Transporter.unix.cpp5
-rw-r--r--ndb/src/common/transporter/SHM_Transporter.win32.cpp4
-rw-r--r--ndb/src/common/transporter/SendBuffer.hpp3
-rw-r--r--ndb/src/common/transporter/TCP_Transporter.cpp6
-rw-r--r--ndb/src/common/transporter/Transporter.cpp1
-rw-r--r--ndb/src/common/transporter/TransporterInternalDefinitions.hpp35
-rw-r--r--ndb/src/common/transporter/TransporterRegistry.cpp5
-rw-r--r--ndb/src/common/transporter/basictest/basicTransporterTest.cpp5
-rw-r--r--ndb/src/common/transporter/buddy.cpp3
-rw-r--r--ndb/src/common/transporter/buddy.hpp3
-rw-r--r--ndb/src/common/transporter/failoverSCI/failoverSCI.cpp9
-rw-r--r--ndb/src/common/transporter/perftest/perfTransporterTest.cpp5
-rw-r--r--ndb/src/common/transporter/priotest/prioTransporterTest.cpp4
-rw-r--r--ndb/src/common/util/Base64.cpp3
-rw-r--r--ndb/src/common/util/BaseString.cpp8
-rw-r--r--ndb/src/common/util/File.cpp54
-rw-r--r--ndb/src/common/util/InputStream.cpp4
-rw-r--r--ndb/src/common/util/Makefile10
-rw-r--r--ndb/src/common/util/NdbErrHnd.cpp1
-rw-r--r--ndb/src/common/util/NdbOut.cpp8
-rw-r--r--ndb/src/common/util/NdbSqlUtil.cpp1
-rw-r--r--ndb/src/common/util/OutputStream.cpp3
-rw-r--r--ndb/src/common/util/Parser.cpp6
-rw-r--r--ndb/src/common/util/Properties.cpp7
-rw-r--r--ndb/src/common/util/SimpleProperties.cpp4
-rw-r--r--ndb/src/common/util/SocketServer.cpp6
-rw-r--r--ndb/src/common/util/filetest/FileUnitTest.cpp1
-rw-r--r--ndb/src/common/util/getarg.c16
-rw-r--r--ndb/src/common/util/new.cpp3
-rw-r--r--ndb/src/common/util/random.c10
-rw-r--r--ndb/src/common/util/socket_io.cpp6
-rw-r--r--ndb/src/common/util/strdup.c2
-rw-r--r--ndb/src/common/util/strlcat.c8
-rw-r--r--ndb/src/common/util/strlcpy.c10
-rw-r--r--ndb/src/common/util/testProperties/testProperties.cpp3
-rw-r--r--ndb/src/common/util/testSimpleProperties/sp_test.cpp4
-rw-r--r--ndb/src/common/util/uucode.c3
-rw-r--r--ndb/src/common/util/version.c10
-rw-r--r--ndb/src/cw/cpcc-win32/C++/StdAfx.h5
-rw-r--r--ndb/src/cw/cpcd/APIService.cpp1
-rw-r--r--ndb/src/cw/cpcd/CPCD.cpp5
-rw-r--r--ndb/src/cw/cpcd/Monitor.cpp3
-rw-r--r--ndb/src/cw/cpcd/Process.cpp97
-rw-r--r--ndb/src/cw/cpcd/common.cpp9
-rw-r--r--ndb/src/cw/cpcd/common.hpp2
-rw-r--r--ndb/src/cw/cpcd/main.cpp4
-rw-r--r--ndb/src/cw/test/socketclient/socketClientTest.cpp3
-rw-r--r--ndb/src/cw/util/ClientInterface.hpp4
-rw-r--r--ndb/src/kernel/blocks/backup/FsBuffer.hpp5
-rw-r--r--ndb/src/kernel/blocks/backup/read.cpp4
-rw-r--r--ndb/src/kernel/blocks/backup/restore/Makefile6
-rw-r--r--ndb/src/kernel/blocks/backup/restore/Restore.cpp7
-rw-r--r--ndb/src/kernel/blocks/backup/restore/Restore.hpp5
-rw-r--r--ndb/src/kernel/blocks/backup/restore/main.cpp1
-rw-r--r--ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp6
-rw-r--r--ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp6
-rw-r--r--ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp7
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbtux/Dbtux.hpp3
-rw-r--r--ndb/src/kernel/blocks/dbutil/DbUtil.cpp65
-rw-r--r--ndb/src/kernel/blocks/grep/Grep.cpp2
-rw-r--r--ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp14
-rw-r--r--ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp4
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Filename.cpp6
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Filename.hpp2
-rw-r--r--ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp1
-rw-r--r--ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp1
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp13
-rw-r--r--ndb/src/kernel/blocks/suma/SumaInit.cpp4
-rw-r--r--ndb/src/kernel/error/ErrorReporter.cpp5
-rw-r--r--ndb/src/kernel/error/ErrorReporter.hpp3
-rw-r--r--ndb/src/kernel/error/TimeModule.cpp2
-rw-r--r--ndb/src/kernel/ndb-main/Main.cpp36
-rw-r--r--ndb/src/kernel/vm/ArrayPool.hpp4
-rw-r--r--ndb/src/kernel/vm/ClusterConfiguration.cpp5
-rw-r--r--ndb/src/kernel/vm/Configuration.cpp1
-rw-r--r--ndb/src/kernel/vm/DLHashTable.hpp3
-rw-r--r--ndb/src/kernel/vm/DLHashTable2.hpp5
-rw-r--r--ndb/src/kernel/vm/Emulator.cpp9
-rw-r--r--ndb/src/kernel/vm/GlobalData.hpp3
-rw-r--r--ndb/src/kernel/vm/SimulatedBlock.cpp4
-rw-r--r--ndb/src/kernel/vm/TransporterCallback.cpp3
-rw-r--r--ndb/src/kernel/vm/VMSignal.hpp7
-rw-r--r--ndb/src/kernel/vm/al_test/arrayListTest.cpp4
-rw-r--r--ndb/src/kernel/vm/al_test/arrayPoolTest.cpp5
-rw-r--r--ndb/src/kernel/vm/al_test/main.cpp4
-rw-r--r--ndb/src/kernel/vm/testCopy/rr.cpp5
-rw-r--r--ndb/src/kernel/vm/testCopy/testCopy.cpp4
-rw-r--r--ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp6
-rw-r--r--ndb/src/kernel/vm/testLongSig/testLongSig.cpp3
-rw-r--r--ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp5
-rw-r--r--ndb/src/mgmapi/Makefile2
-rw-r--r--ndb/src/mgmapi/mgmapi.cpp8
-rw-r--r--ndb/src/mgmapi/test/keso.c9
-rw-r--r--ndb/src/mgmapi/test/mgmSrvApi.cpp4
-rw-r--r--ndb/src/mgmclient/CommandInterpreter.cpp9
-rw-r--r--ndb/src/mgmclient/CommandInterpreter.hpp4
-rw-r--r--ndb/src/mgmclient/CpcClient.cpp6
-rw-r--r--ndb/src/mgmclient/main.cpp4
-rw-r--r--ndb/src/mgmclient/test_cpcd/test_cpcd.cpp21
-rw-r--r--ndb/src/mgmsrv/CommandInterpreter.cpp2
-rw-r--r--ndb/src/mgmsrv/CommandInterpreter.hpp4
-rw-r--r--ndb/src/mgmsrv/Makefile2
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.cpp8
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.hpp1
-rw-r--r--ndb/src/mgmsrv/NodeLogLevel.hpp3
-rw-r--r--ndb/src/mgmsrv/NodeLogLevelList.cpp4
-rw-r--r--ndb/src/mgmsrv/convertStrToInt.cpp4
-rw-r--r--ndb/src/mgmsrv/main.cpp6
-rw-r--r--ndb/src/mgmsrv/mkconfig/mkconfig.cpp9
-rw-r--r--ndb/src/ndbapi/ClusterMgr.cpp8
-rw-r--r--ndb/src/ndbapi/DictCache.cpp2
-rw-r--r--ndb/src/ndbapi/Makefile4
-rw-r--r--ndb/src/ndbapi/Ndb.cpp14
-rw-r--r--ndb/src/ndbapi/NdbConnectionScan.cpp11
-rw-r--r--ndb/src/ndbapi/NdbDictionary.cpp1
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.cpp1
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.hpp2
-rw-r--r--ndb/src/ndbapi/NdbErrorOut.cpp (renamed from ndb/include/portlib/NdbStdio.h)39
-rw-r--r--ndb/src/ndbapi/NdbEventOperationImpl.cpp13
-rw-r--r--ndb/src/ndbapi/NdbOperation.cpp1
-rw-r--r--ndb/src/ndbapi/NdbOperationDefine.cpp2
-rw-r--r--ndb/src/ndbapi/NdbOperationExec.cpp9
-rw-r--r--ndb/src/ndbapi/NdbOperationSearch.cpp2
-rw-r--r--ndb/src/ndbapi/NdbPoolImpl.cpp2
-rw-r--r--ndb/src/ndbapi/NdbRecAttr.cpp2
-rw-r--r--ndb/src/ndbapi/NdbScanOperation.cpp25
-rw-r--r--ndb/src/ndbapi/NdbScanReceiver.hpp1
-rw-r--r--ndb/src/ndbapi/NdbSchemaOp.cpp3
-rw-r--r--ndb/src/ndbapi/NdbUtil.hpp3
-rw-r--r--ndb/src/ndbapi/Ndberr.cpp75
-rw-r--r--ndb/src/ndbapi/Ndbif.cpp1
-rw-r--r--ndb/src/ndbapi/Ndbinit.cpp4
-rw-r--r--ndb/src/ndbapi/ObjectMap.hpp4
-rw-r--r--ndb/src/ndbapi/TransporterFacade.cpp5
-rw-r--r--ndb/src/ndbapi/ndberror.c (renamed from ndb/src/ndbapi/Ndberror.cpp)313
-rw-r--r--ndb/src/ndbapi/signal-sender/SignalSender.cpp1
-rw-r--r--ndb/src/ndbapi/signal-sender/SignalSender.hpp2
-rw-r--r--ndb/src/newtonapi/dba_binding.cpp6
-rw-r--r--ndb/src/newtonapi/dba_error.cpp4
-rw-r--r--ndb/src/newtonapi/dba_internal.hpp5
-rw-r--r--ndb/src/rep/Makefile2
-rw-r--r--ndb/src/rep/RepApiService.cpp2
-rw-r--r--ndb/src/rep/RepComponents.hpp1
-rw-r--r--ndb/src/rep/RepMain.cpp3
-rw-r--r--ndb/src/rep/Requestor.cpp1
-rw-r--r--ndb/src/rep/Requestor.hpp3
-rw-r--r--ndb/src/rep/adapters/AppNDB.hpp4
-rw-r--r--ndb/src/rep/adapters/ExtNDB.cpp1
-rw-r--r--ndb/src/rep/adapters/ExtNDB.hpp3
-rw-r--r--ndb/src/rep/dbug_hack.cpp6
-rw-r--r--ndb/src/rep/rep_version.hpp2
-rw-r--r--ndb/src/rep/repapi/repapi.cpp7
-rw-r--r--ndb/src/rep/state/Interval.cpp2
-rw-r--r--ndb/src/rep/state/RepState.cpp8
-rw-r--r--ndb/src/rep/storage/GCIBuffer.cpp3
-rw-r--r--ndb/src/rep/storage/GCIBuffer.hpp2
-rw-r--r--ndb/src/rep/storage/GCIContainer.hpp1
-rw-r--r--ndb/src/rep/storage/LogRecord.hpp3
-rw-r--r--ndb/src/rep/storage/NodeGroupInfo.hpp2
-rw-r--r--ndb/src/rep/transfer/TransPS.cpp1
-rw-r--r--ndb/src/rep/transfer/TransPS.hpp2
-rw-r--r--ndb/src/rep/transfer/TransSS.cpp1
-rw-r--r--ndb/src/rep/transfer/TransSS.hpp2
-rw-r--r--ndb/test/include/NDBT_Stats.hpp4
-rw-r--r--ndb/test/include/NDBT_Table.hpp4
-rw-r--r--ndb/test/include/NDBT_Test.hpp1
-rw-r--r--ndb/test/include/NdbTimer.hpp1
-rw-r--r--ndb/test/ndbapi/acid2/acid2.cpp1
-rw-r--r--ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp3
-rw-r--r--ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp3
-rw-r--r--ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp3
-rw-r--r--ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp4
-rw-r--r--ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp4
-rw-r--r--ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp4
-rw-r--r--ndb/test/ndbapi/bulk_copy/bulk_copy.cpp1
-rw-r--r--ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp2
-rw-r--r--ndb/test/ndbapi/create_tab/create_tab.cpp2
-rw-r--r--ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp2
-rw-r--r--ndb/test/ndbapi/flexAsynch/flexAsynch.cpp2
-rw-r--r--ndb/test/ndbapi/flexBench/flexBench.cpp34
-rw-r--r--ndb/test/ndbapi/flexHammer/flexHammer.cpp2
-rw-r--r--ndb/test/ndbapi/flexScan/flexScan.cpp3
-rw-r--r--ndb/test/ndbapi/flexTT/flexTT.cpp7
-rw-r--r--ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp4
-rw-r--r--ndb/test/ndbapi/indexTest/index.cpp5
-rw-r--r--ndb/test/ndbapi/indexTest2/index2.cpp5
-rw-r--r--ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp3
-rw-r--r--ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp3
-rw-r--r--ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp5
-rw-r--r--ndb/test/ndbapi/lmc-bench/async-src/user/macros.h3
-rw-r--r--ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp2
-rw-r--r--ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp5
-rw-r--r--ndb/test/ndbapi/lmc-bench/include/testDefinitions.h22
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c3
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c6
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c4
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c4
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c2
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/macros.h3
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp1
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp2
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c5
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c3
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp4
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c3
-rw-r--r--ndb/test/ndbapi/restarter/restarter.cpp2
-rw-r--r--ndb/test/ndbapi/restarter2/restarter2.cpp2
-rw-r--r--ndb/test/ndbapi/restarts/restarts.cpp2
-rw-r--r--ndb/test/ndbapi/ronja/benchronja/benchronja.cpp7
-rw-r--r--ndb/test/ndbapi/telco/msa.cpp5
-rw-r--r--ndb/test/ndbapi/testBlobs/testBlobs.cpp9
-rw-r--r--ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp6
-rw-r--r--ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp2
-rw-r--r--ndb/test/ndbapi/testOIBasic/testOIBasic.cpp9
-rw-r--r--ndb/test/ndbapi/vw_test/bcd.h3
-rw-r--r--ndb/test/ndbapi/vw_test/cdrserver.cpp12
-rw-r--r--ndb/test/ndbapi/vw_test/size.cpp2
-rw-r--r--ndb/test/newtonapi/basic_test/basic/basic.cpp1
-rw-r--r--ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp1
-rw-r--r--ndb/test/newtonapi/basic_test/common.cpp4
-rw-r--r--ndb/test/newtonapi/basic_test/common.hpp3
-rw-r--r--ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp1
-rw-r--r--ndb/test/newtonapi/basic_test/too_basic.cpp10
-rw-r--r--ndb/test/newtonapi/perf_test/perf.cpp9
-rw-r--r--ndb/test/odbc/driver/testOdbcDriver.cpp9
-rw-r--r--ndb/test/run-test/main.cpp2
-rw-r--r--ndb/test/run-test/run-test.hpp2
-rw-r--r--ndb/test/src/HugoAsynchTransactions.cpp4
-rw-r--r--ndb/test/src/HugoCalculator.cpp4
-rw-r--r--ndb/test/src/HugoOperations.cpp6
-rw-r--r--ndb/test/src/HugoTransactions.cpp6
-rw-r--r--ndb/test/src/NDBT_Error.cpp4
-rw-r--r--ndb/test/src/NDBT_ResultRow.cpp8
-rw-r--r--ndb/test/src/NDBT_ReturnCodes.cpp6
-rw-r--r--ndb/test/src/NDBT_Table.cpp2
-rw-r--r--ndb/test/src/NDBT_Tables.cpp1
-rw-r--r--ndb/test/src/NdbBackup.cpp2
-rw-r--r--ndb/test/src/NdbConfig.cpp3
-rw-r--r--ndb/test/src/NdbGrep.cpp1
-rw-r--r--ndb/test/src/NdbRestarter.cpp5
-rw-r--r--ndb/test/tools/hugoCalculator/hugoCalculator.cpp4
-rw-r--r--ndb/test/tools/hugoFill/hugoFill.cpp2
-rw-r--r--ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp4
-rw-r--r--ndb/test/tools/hugoPkDelete/hugoPkDel.cpp4
-rw-r--r--ndb/test/tools/hugoPkRead/hugoPkRead.cpp4
-rw-r--r--ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp3
-rw-r--r--ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp4
-rw-r--r--ndb/test/tools/hugoScanRead/hugoScanRead.cpp4
-rw-r--r--ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp4
-rw-r--r--ndb/test/tools/restart/restart.cpp5
-rw-r--r--ndb/test/tools/waiter/waiter.cpp1
-rw-r--r--ndb/tools/copy_tab/copy_tab.cpp2
-rw-r--r--ndb/tools/cpcc/cpcc.cpp4
-rw-r--r--ndb/tools/create_index/create_index.cpp2
-rw-r--r--ndb/tools/delete_all/delete_all.cpp2
-rw-r--r--ndb/tools/drop_index/drop_index.cpp2
-rw-r--r--ndb/tools/drop_tab/drop_tab.cpp2
-rw-r--r--ndb/tools/list_tables/listTables.cpp3
-rw-r--r--ndb/tools/select_all/select_all.cpp4
-rw-r--r--ndb/tools/select_count/select_count.cpp4
-rw-r--r--ndb/tools/transproxy/transproxy.cpp9
-rw-r--r--ndb/tools/verify_index/verify_index.cpp3
-rwxr-xr-xnetware/BUILD/compile-netware-all4
-rwxr-xr-xnetware/BUILD/compile-netware-standard1
-rwxr-xr-xnetware/BUILD/mwenv6
-rw-r--r--netware/Makefile.am3
-rw-r--r--netware/init_db.sql2
-rw-r--r--netware/my_manage.c8
-rw-r--r--netware/my_manage.h4
-rw-r--r--netware/myisam_ftdump.def12
-rw-r--r--netware/mysql_install_db.c3
-rw-r--r--netware/mysql_test_run.c59
-rw-r--r--netware/mysql_waitpid.def12
-rw-r--r--netware/resolve_stack_dump.def12
-rw-r--r--scripts/make_binary_distribution.sh68
-rwxr-xr-xscripts/make_win_src_distribution.sh4
-rw-r--r--scripts/mysql_install_db.sh10
-rw-r--r--scripts/mysqlhotcopy.sh20
-rw-r--r--sql-bench/crash-me.sh3
-rw-r--r--sql-bench/limits/mysql-4.0.cfg251
-rw-r--r--sql/Makefile.am4
-rw-r--r--sql/discover.cc1
-rw-r--r--sql/examples/ha_example.cc379
-rw-r--r--sql/examples/ha_example.h46
-rw-r--r--sql/field.cc49
-rw-r--r--sql/ha_berkeley.cc29
-rw-r--r--sql/ha_berkeley.h7
-rw-r--r--sql/ha_heap.cc178
-rw-r--r--sql/ha_heap.h11
-rw-r--r--sql/ha_innodb.cc103
-rw-r--r--sql/ha_innodb.h6
-rw-r--r--sql/ha_isam.cc23
-rw-r--r--sql/ha_isam.h6
-rw-r--r--sql/ha_myisam.cc186
-rw-r--r--sql/ha_myisam.h13
-rw-r--r--sql/ha_myisammrg.cc16
-rw-r--r--sql/ha_myisammrg.h6
-rw-r--r--sql/ha_ndbcluster.cc25
-rw-r--r--sql/ha_ndbcluster.h7
-rw-r--r--sql/handler.cc77
-rw-r--r--sql/handler.h39
-rw-r--r--sql/item.cc415
-rw-r--r--sql/item.h75
-rw-r--r--sql/item_cmpfunc.cc1
-rw-r--r--sql/item_func.cc6
-rw-r--r--sql/item_strfunc.cc1
-rw-r--r--sql/item_subselect.cc149
-rw-r--r--sql/item_subselect.h10
-rw-r--r--sql/item_sum.cc16
-rw-r--r--sql/item_sum.h12
-rw-r--r--sql/item_timefunc.cc77
-rw-r--r--sql/key.cc76
-rw-r--r--sql/lock.cc4
-rw-r--r--sql/log_event.cc5
-rw-r--r--sql/mysql_priv.h41
-rw-r--r--sql/mysqld.cc297
-rw-r--r--sql/mysqld_suffix.h (renamed from ndb/include/portlib/NdbConstant.hpp)19
-rw-r--r--sql/opt_range.cc94
-rw-r--r--sql/opt_range.h1
-rw-r--r--sql/opt_sum.cc2
-rw-r--r--sql/parse_file.cc40
-rw-r--r--sql/protocol.cc58
-rw-r--r--sql/protocol.h4
-rw-r--r--sql/repl_failsafe.cc4
-rw-r--r--sql/set_var.cc37
-rw-r--r--sql/slave.cc18
-rw-r--r--sql/sp_head.cc157
-rw-r--r--sql/sp_head.h21
-rw-r--r--sql/sql_acl.cc42
-rw-r--r--sql/sql_analyse.cc12
-rw-r--r--sql/sql_base.cc78
-rw-r--r--sql/sql_cache.cc19
-rw-r--r--sql/sql_class.cc157
-rw-r--r--sql/sql_class.h134
-rw-r--r--sql/sql_db.cc10
-rw-r--r--sql/sql_delete.cc8
-rw-r--r--sql/sql_derived.cc2
-rw-r--r--sql/sql_handler.cc16
-rw-r--r--sql/sql_insert.cc7
-rw-r--r--sql/sql_lex.cc22
-rw-r--r--sql/sql_lex.h34
-rw-r--r--sql/sql_parse.cc58
-rw-r--r--sql/sql_prepare.cc381
-rw-r--r--sql/sql_select.cc291
-rw-r--r--sql/sql_select.h1
-rw-r--r--sql/sql_show.cc17
-rw-r--r--sql/sql_string.cc106
-rw-r--r--sql/sql_string.h7
-rw-r--r--sql/sql_table.cc125
-rw-r--r--sql/sql_test.cc6
-rw-r--r--sql/sql_union.cc112
-rw-r--r--sql/sql_update.cc12
-rw-r--r--sql/sql_yacc.yy158
-rw-r--r--sql/time.cc138
-rw-r--r--strings/ctype-big5.c12
-rw-r--r--strings/ctype-bin.c4
-rw-r--r--strings/ctype-czech.c1
-rw-r--r--strings/ctype-euc_kr.c2
-rw-r--r--strings/ctype-extra.c1
-rw-r--r--strings/ctype-gb2312.c2
-rw-r--r--strings/ctype-gbk.c10
-rw-r--r--strings/ctype-latin1.c343
-rw-r--r--strings/ctype-mb.c2
-rw-r--r--strings/ctype-sjis.c10
-rw-r--r--strings/ctype-tis620.c4
-rw-r--r--strings/ctype-uca.c51
-rw-r--r--strings/ctype-ucs2.c28
-rw-r--r--strings/ctype-ujis.c8
-rw-r--r--strings/ctype-utf8.c2
-rw-r--r--strings/ctype-win1250ch.c1
-rw-r--r--strings/dump_map.c10
-rw-r--r--strings/my_strtoll10.c20
-rw-r--r--strings/strings-x86.s4
-rw-r--r--support-files/MacOSX/StartupItem.Description.plist2
-rw-r--r--support-files/my-huge.cnf.sh1
-rw-r--r--support-files/my-large.cnf.sh1
-rw-r--r--support-files/my-medium.cnf.sh2
-rw-r--r--support-files/my-small.cnf.sh2
-rw-r--r--tests/client_test.c317
-rw-r--r--tools/mysqlmanager.c15
-rw-r--r--vio/test-ssl.c2
-rw-r--r--vio/viossl.c25
-rw-r--r--vio/viosslfactories.c41
-rw-r--r--zlib/contrib/asm386/zlibvc.dsp76
816 files changed, 11348 insertions, 6924 deletions
diff --git a/.bzrignore b/.bzrignore
index bde19dfdd69..08ef076d278 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -2,6 +2,7 @@
*.bb
*.bbg
*.core
+*.d
*.da
*.gcov
*.la
@@ -331,6 +332,7 @@ libmysqld/convert.cc
libmysqld/derror.cc
libmysqld/discover.cc
libmysqld/errmsg.c
+libmysqld/examples/client_test.c
libmysqld/examples/completion_hash.cc
libmysqld/examples/completion_hash.h
libmysqld/examples/link_sources
@@ -632,6 +634,8 @@ ndb/bin/test_cpcd
ndb/bin/test_event
ndb/bin/verify_index
ndb/bin/waiter
+ndb/config/autom4te.cache/*
+ndb/config/config.mk
ndb/examples/ndbapi_example1/ndbapi_example1
ndb/examples/ndbapi_example2/ndbapi_example2
ndb/examples/ndbapi_example3/ndbapi_example3
@@ -645,6 +649,8 @@ ndb/lib/libNEWTON_BASICTEST_COMMON.so
ndb/lib/libREP_API.so
ndb/lib/libndbclient.so
ndb/lib/libndbclient_extra.so
+ndb/src/common/mgmcommon/printConfig/*.d
+ndb/src/mgmclient/test_cpcd/*.d
pull.log
regex/re
repl-tests/test-repl-ts/repl-timestamp.master.reject
diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max
index d1c84b93484..ef035b3f023 100755
--- a/BUILD/compile-pentium-valgrind-max
+++ b/BUILD/compile-pentium-valgrind-max
@@ -3,7 +3,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$pentium_cflags $debug_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify"
+extra_flags="$pentium_cflags $debug_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index d1165ff984d..b2409deb9f4 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -33,6 +33,7 @@ dlenev@build.mysql.com
dlenev@jabberwock.localdomain
dlenev@mysql.com
ejonore@mc03.ndb.mysql.com
+georg@beethoven.local
gerberb@ou800.zenez.com
gluh@gluh.(none)
gluh@gluh.mysql.r18.ru
@@ -106,15 +107,18 @@ monty@tik.
monty@tik.mysql.fi
monty@tramp.mysql.fi
monty@work.mysql.com
+msvensson@build.mysql.com
mwagner@cash.mwagner.org
mwagner@evoq.mwagner.org
mwagner@work.mysql.com
mydev@mysql.com
mysql@home.(none)
mysqldev@build.mysql2.com
+ndbdev@ndbmaster.mysql.com
nick@mysql.com
nick@nick.leippe.com
papa@gbichot.local
+patg@krsna.patg.net
paul@central.snake.net
paul@ice.local
paul@ice.snake.net
@@ -164,10 +168,13 @@ tim@work.mysql.com
timour@mysql.com
tom@basil-firewall.home.com
tomas@mc05.(none)
+tomas@poseidon.(none)
tonu@hundin.mysql.fi
tonu@volk.internalnet
tonu@x153.internalnet
tonu@x3.internalnet
+tsmith@build.mysql.com
+tulin@build.mysql.com
ulli@morbus.(none)
venu@hundin.mysql.fi
venu@myvenu.com
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile
index 0ca2f97a369..03571593f77 100755
--- a/Build-tools/Do-compile
+++ b/Build-tools/Do-compile
@@ -11,7 +11,7 @@ $opt_distribution=$opt_user=$opt_config_env="";
$opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix="";
$opt_tmp=$opt_version_suffix="";
$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$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_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
-$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=0;
+$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=$opt_without_ndbcluster=0;
GetOptions(
"bdb",
@@ -56,6 +56,8 @@ GetOptions(
"with-other-libc=s",
"with-small-disk",
"without-embedded",
+ "clearlogs",
+ "without-ndbcluster",
) || usage();
usage() if ($opt_help);
@@ -140,7 +142,7 @@ $slave_port=$mysql_tcp_port+16;
$manager_port=$mysql_tcp_port+1;
$mysqladmin_args="--no-defaults -u root --connect_timeout=5 --shutdown_timeout=20";
-if ($opt_stage == 0)
+if ($opt_stage == 0 || $opt_clearlogs)
{
system("mkdir Logs") if (! -d "Logs");
system("mv $log ${log}-old") if (-f $log);
@@ -237,18 +239,19 @@ if ($opt_stage <= 1)
$opt_config_options.= " --with-raid" if ($opt_raid);
$opt_config_options.= " --with-readline" if ($opt_readline);
$opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded);
+ $opt_config_options.= " --without-ndbcluster" if ($opt_without_ndbcluster);
$opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster);
# Only enable InnoDB when requested (required to be able to
# build the "Classic" packages that do not include InnoDB)
- if ($opt_innodb)
- {
- $opt_config_options.= " --with-innodb";
- }
- else
- {
- $opt_config_options.= " --without-innodb";
- }
+ if ($opt_innodb)
+ {
+ $opt_config_options.= " --with-innodb";
+ }
+ else
+ {
+ $opt_config_options.= " --without-innodb";
+ }
if ($opt_with_other_libc)
{
diff --git a/Build-tools/Do-pkg b/Build-tools/Do-pkg
index 2fd1946ed0e..286e33f6dd4 100755
--- a/Build-tools/Do-pkg
+++ b/Build-tools/Do-pkg
@@ -95,6 +95,7 @@ $SI_DESC= <$SUPFILEDIR/StartupItem.Description.plist>;
$SI_PARAMS= <$SUPFILEDIR/StartupParameters.plist>;
$SI_POST= <$SUPFILEDIR/StartupItem.postinstall>;
$SI_NAME= "MySQLStartupItem";
+$SI_DIR_NAME= "MySQLCOM";
$SI_SCRIPT= <$SUPFILEDIR/MySQL>;
@RESOURCES= qw/ ReadMe.txt postinstall preinstall /;
@LICENSES= ("$SRCBASEDIR/COPYING","$SRCBASEDIR/MySQLEULA.txt");
@@ -195,16 +196,18 @@ unless ($opt_skip_si)
&logger("Cleaning up $RESOURCE_DIR");
&run_command("rm -rf $RESOURCE_DIR/*", "Unable to clean up $RESOURCE_DIR!");
- &logger("Installing MySQL StartupItem files into $PKGROOT/MySQL");
+ my $SI_DIR= $PKGROOT . "/" . $SI_DIR_NAME;
+ &logger("Installing MySQL StartupItem files into $SI_DIR");
unless($opt_dry_run)
{
- mkdir("$PKGROOT/MySQL") or &abort("Error creating $PKGROOT/MySQL");
- copy("$SI_SCRIPT", "$PKGROOT/MySQL/")
+ mkdir("$SI_DIR")
+ or &abort("Error creating $SI_DIR");
+ copy("$SI_SCRIPT", "$SI_DIR/")
or &abort("Error copying $SI_SCRIPT!");
- chmod(0755, "$PKGROOT/MySQL/" . basename("$SI_SCRIPT"));
- copy("$SI_PARAMS", "$PKGROOT/MySQL/")
+ chmod(0755, "$SI_DIR/" . basename("$SI_SCRIPT"));
+ copy("$SI_PARAMS", "$SI_DIR/")
or &abort("Error copying $SI_PARAMS!");
- chmod(0644, "$PKGROOT/MySQL/" . basename("$SI_PARAMS"));
+ chmod(0644, "$SI_DIR/" . basename("$SI_PARAMS"));
&run_command("chown -R root:wheel $PKGROOT/*", "Cannot chown $PKGROOT!");
copy("$SI_POST", "$RESOURCE_DIR/postinstall")
or &abort("Error copying $SI_POST!");
diff --git a/Build-tools/mysql-copyright-2 b/Build-tools/mysql-copyright-2
index 447a2d7c164..e946ed217d1 100755
--- a/Build-tools/mysql-copyright-2
+++ b/Build-tools/mysql-copyright-2
@@ -93,7 +93,7 @@ sub add_copyright
{
$start_copyright="/* ";
$line_copyright= " ";
- $end_copyright= " */";
+ $end_copyright= "*/";
}
elsif ($ARGV =~ /-x86\.s$/)
{
diff --git a/VC++Files/README.build-files b/VC++Files/README.build-files
new file mode 100644
index 00000000000..27624c3dc6f
--- /dev/null
+++ b/VC++Files/README.build-files
@@ -0,0 +1,19 @@
+Some notes about building MySQL with VC++
+
+- After bulding all projects, you get the files in the following directories:
+
+Directory Content
+
+lib_debug Debug libraries
+lib_release Release libraries
+lib_classic Embedded server libraries for classic
+lib_pro Embedded server libraries for pro
+client_debug Debug executables
+client_release Client release
+client_classic Commerical binaries (classic)
+client_pro Commerical binaries (unique for pro version)
+include Include files
+
+The copy_mysql_files.bat script can be used to copy the generated
+files to c:\mysql
+
diff --git a/VC++Files/bdb/bdb.dsp b/VC++Files/bdb/bdb.dsp
index 6c4ee47daa2..bd0e644bc2e 100644
--- a/VC++Files/bdb/bdb.dsp
+++ b/VC++Files/bdb/bdb.dsp
@@ -55,8 +55,8 @@ LIB32=xilink6.exe -lib
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "bdb___Win32_Max"
-# PROP BASE Intermediate_Dir "bdb___Win32_Max"
+# PROP BASE Output_Dir "max"
+# PROP BASE Intermediate_Dir "max"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
@@ -65,7 +65,7 @@ LIB32=xilink6.exe -lib
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../bdb/build_win32" /I "../bdb/include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
# SUBTRACT BASE CPP /Fr
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../bdb" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /Fo"mysys___Win32_Max/" /Fd"mysys___Win32_Max/" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../bdb" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D MYSQL_SERVER_SUFFIX=-max /Fo"max/" /Fd"max/" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/client/mysql.dsp b/VC++Files/client/mysql.dsp
index 4f2cbbb5614..ec16e780d3e 100644
--- a/VC++Files/client/mysql.dsp
+++ b/VC++Files/client/mysql.dsp
@@ -19,6 +19,7 @@ CFG=mysql - Win32 Debug
!MESSAGE
!MESSAGE "mysql - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "mysql - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysql - Win32 classic" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -79,12 +80,42 @@ LINK32=xilink6.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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 mysqlclient.lib wsock32.lib 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 /incremental:no /debug /machine:I386 /out:"../client_debug/mysql.exe" /pdbtype:sept /libpath:"..\lib_debug\\"
+!ELSEIF "$(CFG)" == "mysql - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysql___Win32_classic"
+# PROP BASE Intermediate_Dir "mysql___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /WX /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /WX /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 mysqlclient.lib wsock32.lib 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 /out:"../client_release/mysql.exe" /libpath:"..\lib_release\\"
+# SUBTRACT BASE LINK32 /incremental:yes
+# ADD LINK32 mysqlclient.lib wsock32.lib 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 /out:"../client_classic/mysql.exe" /libpath:"..\lib_release\\"
+# SUBTRACT LINK32 /incremental:yes
+
!ENDIF
# Begin Target
# Name "mysql - Win32 Release"
# Name "mysql - Win32 Debug"
+# Name "mysql - Win32 classic"
# Begin Source File
SOURCE=.\completion_hash.cpp
@@ -99,6 +130,11 @@ SOURCE=.\mysql.cpp
!ELSEIF "$(CFG)" == "mysql - Win32 Debug"
+!ELSEIF "$(CFG)" == "mysql - Win32 classic"
+
+# ADD BASE CPP /Zi /O2
+# ADD CPP /Zi /O2
+
!ENDIF
# End Source File
diff --git a/VC++Files/client/mysqladmin.dsp b/VC++Files/client/mysqladmin.dsp
index 2c762cd8a24..a7e4404e253 100644
--- a/VC++Files/client/mysqladmin.dsp
+++ b/VC++Files/client/mysqladmin.dsp
@@ -19,6 +19,7 @@ CFG=mysqladmin - Win32 Debug
!MESSAGE
!MESSAGE "mysqladmin - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "mysqladmin - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysqladmin - Win32 classic" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -42,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@@ -78,12 +79,40 @@ LINK32=xilink6.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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 mysqlclient.lib wsock32.lib 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 /incremental:no /debug /machine:I386 /out:"../client_debug/mysqladmin.exe" /pdbtype:sept /libpath:"..\lib_debug\\"
+!ELSEIF "$(CFG)" == "mysqladmin - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysqladmin___Win32_classic"
+# PROP BASE Intermediate_Dir "mysqladmin___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 mysqlclient.lib wsock32.lib 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 /out:"../client_release/mysqladmin.exe" /libpath:"..\lib_release\\"
+# ADD LINK32 mysqlclient.lib wsock32.lib 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 /out:"../client_classic/mysqladmin.exe" /libpath:"..\lib_release\\"
+
!ENDIF
# Begin Target
# Name "mysqladmin - Win32 Release"
# Name "mysqladmin - Win32 Debug"
+# Name "mysqladmin - Win32 classic"
# Begin Source File
SOURCE=.\mysqladmin.c
diff --git a/VC++Files/client/mysqlclient.dsp b/VC++Files/client/mysqlclient.dsp
index 09a06982842..a46c3fd2369 100644
--- a/VC++Files/client/mysqlclient.dsp
+++ b/VC++Files/client/mysqlclient.dsp
@@ -7,25 +7,25 @@
CFG=mysqlclient - 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
!MESSAGE NMAKE /f "mysqlclient.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "mysqlclient.mak" CFG="mysqlclient - Win32 Debug"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "mysqlclient - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "mysqlclient - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "mysqlclient - Win32 Release"
@@ -41,14 +41,14 @@ RSC=rc.exe
# 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 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\mysqlclient.lib"
@@ -72,11 +72,11 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\mysqlclient.lib"
-!ENDIF
+!ENDIF
# Begin Target
@@ -256,7 +256,7 @@ SOURCE=..\mysys\mf_iocache2.c
# ADD CPP /Od
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
diff --git a/VC++Files/client/mysqldump.dsp b/VC++Files/client/mysqldump.dsp
index d36664e09ce..a1ebdfe11a6 100644
--- a/VC++Files/client/mysqldump.dsp
+++ b/VC++Files/client/mysqldump.dsp
@@ -19,6 +19,7 @@ CFG=mysqldump - Win32 Debug
!MESSAGE
!MESSAGE "mysqldump - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "mysqldump - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysqldump - Win32 classic" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -42,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@@ -78,12 +79,40 @@ LINK32=xilink6.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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 mysqlclient.lib wsock32.lib 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 /incremental:no /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\"
+!ELSEIF "$(CFG)" == "mysqldump - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysqldump___Win32_classic"
+# PROP BASE Intermediate_Dir "mysqldump___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 mysqlclient.lib wsock32.lib 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 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\"
+# ADD LINK32 mysqlclient.lib wsock32.lib 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 /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\"
+
!ENDIF
# Begin Target
# Name "mysqldump - Win32 Release"
# Name "mysqldump - Win32 Debug"
+# Name "mysqldump - Win32 classic"
# Begin Source File
SOURCE=.\mysqldump.c
@@ -95,6 +124,8 @@ SOURCE=.\mysqldump.c
# ADD CPP /W3
# SUBTRACT CPP /YX
+!ELSEIF "$(CFG)" == "mysqldump - Win32 classic"
+
!ENDIF
# End Source File
diff --git a/VC++Files/client/mysqlimport.dsp b/VC++Files/client/mysqlimport.dsp
index a8b239d226f..d5fd8557397 100644
--- a/VC++Files/client/mysqlimport.dsp
+++ b/VC++Files/client/mysqlimport.dsp
@@ -19,6 +19,7 @@ CFG=mysqlimport - Win32 Debug
!MESSAGE
!MESSAGE "mysqlimport - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "mysqlimport - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysqlimport - Win32 classic" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -42,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@@ -79,12 +80,42 @@ LINK32=xilink6.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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlimport.exe" /pdbtype:sept /libpath:"..\lib_debug\\"
+!ELSEIF "$(CFG)" == "mysqlimport - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysqlimport___Win32_classic"
+# PROP BASE Intermediate_Dir "mysqlimport___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 mysqlclient.lib wsock32.lib 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 /out:"../client_release/mysqlimport.exe" /libpath:"..\lib_release\\"
+# SUBTRACT BASE LINK32 /incremental:yes
+# ADD LINK32 mysqlclient.lib wsock32.lib 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 /out:"../client_classic/mysqlimport.exe" /libpath:"..\lib_release\\"
+# SUBTRACT LINK32 /incremental:yes
+
!ENDIF
# Begin Target
# Name "mysqlimport - Win32 Release"
# Name "mysqlimport - Win32 Debug"
+# Name "mysqlimport - Win32 classic"
# Begin Source File
SOURCE=.\mysqlimport.c
diff --git a/VC++Files/client/mysqlshow.dsp b/VC++Files/client/mysqlshow.dsp
index 26705465fec..b9fd0d27e46 100644
--- a/VC++Files/client/mysqlshow.dsp
+++ b/VC++Files/client/mysqlshow.dsp
@@ -19,6 +19,7 @@ CFG=mysqlshow - Win32 Debug
!MESSAGE
!MESSAGE "mysqlshow - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "mysqlshow - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysqlshow - Win32 classic" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -42,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@@ -78,12 +79,40 @@ LINK32=xilink6.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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 mysqlclient.lib wsock32.lib 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 /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlshow.exe" /pdbtype:sept /libpath:"..\lib_debug\\"
+!ELSEIF "$(CFG)" == "mysqlshow - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysqlshow___Win32_classic"
+# PROP BASE Intermediate_Dir "mysqlshow___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 mysqlclient.lib wsock32.lib 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 /out:"../client_release/mysqlshow.exe" /libpath:"..\lib_release\\"
+# ADD LINK32 mysqlclient.lib wsock32.lib 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 /out:"../client_classic/mysqlshow.exe" /libpath:"..\lib_release\\"
+
!ENDIF
# Begin Target
# Name "mysqlshow - Win32 Release"
# Name "mysqlshow - Win32 Debug"
+# Name "mysqlshow - Win32 classic"
# Begin Source File
SOURCE=.\mysqlshow.c
diff --git a/VC++Files/comp_err/comp_err.dsp b/VC++Files/comp_err/comp_err.dsp
index e28855aed41..5324e1aa7a0 100644
--- a/VC++Files/comp_err/comp_err.dsp
+++ b/VC++Files/comp_err/comp_err.dsp
@@ -7,24 +7,24 @@
CFG=comp_err - 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
!MESSAGE NMAKE /f "comp_err.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "comp_err.mak" CFG="comp_err - Win32 Release"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "comp_err - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=xicl6.exe
RSC=rc.exe
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
@@ -45,9 +45,9 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=link.exe
+LINK32=xilink6.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 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib_release\mysys.lib wsock32.lib ..\lib_release\strings.lib ..\lib_release\dbug.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBC.lib" /out:"../client_release/comp-err.exe"
+# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib_release\mysys.lib wsock32.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBC.lib" /out:"../client_release/comp-err.exe"
# Begin Target
# Name "comp_err - Win32 Release"
diff --git a/VC++Files/copy_mysql_files.bat b/VC++Files/copy_mysql_files.bat
new file mode 100644
index 00000000000..2857fabc312
--- /dev/null
+++ b/VC++Files/copy_mysql_files.bat
@@ -0,0 +1,80 @@
+REM stop any conflicting service
+
+net stop mysql
+
+REM Copy binaries to c:\mysql
+REM (We assume we are in build root when executing this script)
+
+copy lib_debug\libmysql.* c:\mysql\lib\debug
+copy lib_debug\zlib.* c:\mysql\lib\debug
+copy lib_debug\mysqlclient.lib c:\mysql\lib\debug
+
+copy lib_release\mysqlclient.lib c:\mysql\lib\opt
+copy lib_release\libmysql.* c:\mysql\lib\opt
+copy lib_release\zlib.* c:\mysql\lib\opt
+
+IF "%1"=="classic" goto CLASSIC
+IF "%1"=="pro" goto PRO
+
+REM GPL binaries
+
+copy client_release\*.exe c:\mysql\bin
+copy client_debug\mysqld.exe c:\mysql\bin
+
+goto REST
+
+:CLASSIC
+REM Classic binaries
+
+copy client_release\*.exe c:\mysql\bin
+copy client_classic\*.exe c:\mysql\bin
+copy client_debug\mysqld.exe c:\mysql\bin\mysqld-debug.exe
+copy lib_classic\*.* c:\mysql\lib\opt
+
+goto REST
+
+:PRO
+REM Pro binaries
+
+copy client_release\*.exe c:\mysql\bin
+copy client_classic\*.exe c:\mysql\bin
+copy client_pro\*.exe c:\mysql\bin
+copy client_debug\mysqld.exe c:\mysql\bin\mysqld-debug.exe
+copy lib_pro\*.* c:\mysql\lib\opt
+
+:REST
+
+REM
+REM Copy include files
+REM
+
+copy include\mysql*.h c:\mysql\include
+copy include\errmsg.h c:\mysql\include
+copy include\my_sys.h c:\mysql\include
+copy include\my_list.h c:\mysql\include
+copy include\my_pthread.h c:\mysql\include
+copy include\my_dbug.h c:\mysql\include
+copy include\m_string.h c:\mysql\include
+copy include\m_ctype.h c:\mysql\include
+copy include\raid.h c:\mysql\include
+copy include\conf*.h c:\mysql\include
+copy include\my_global.h c:\mysql\include\my_global.h
+copy libmysql\libmysql.def c:\mysql\include
+
+REM Copy test files
+
+copy libmysqltest\*.* c:\mysql\examples\libmysqltest
+copy libmysqltest\release\myTest.exe c:\mysql\examples\libmysqltest
+
+REM Copy share, docs etc
+
+xcopy share\*.* c:\mysql\share /E /Y
+xcopy scripts\*.* c:\mysql\scripts /E /Y
+xcopy docs\*.* c:\mysql\docs /E /Y
+xcopy sql-bench\*.* c:\mysql\bench /E /Y
+copy docs\readme c:\mysql\
+
+REM Copy privilege tables (Delete old ones as they may be from a newer version)
+
+del c:\mysql\data\mysql\*.* /Q
+xcopy data\mysql\*.* c:\mysql\data\mysql /E /Y
diff --git a/VC++Files/dbug/dbug.dsp b/VC++Files/dbug/dbug.dsp
index 5db7b05175b..f2962848939 100644
--- a/VC++Files/dbug/dbug.dsp
+++ b/VC++Files/dbug/dbug.dsp
@@ -19,13 +19,14 @@ CFG=dbug - Win32 Debug
!MESSAGE
!MESSAGE "dbug - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "dbug - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "dbug - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "dbug - Win32 Release"
@@ -41,14 +42,14 @@ RSC=rc.exe
# 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 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\dbug.lib"
@@ -72,16 +73,42 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\dbug.lib"
+!ELSEIF "$(CFG)" == "dbug - Win32 TLS_DEBUG"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "dbug___Win32_TLS_DEBUG"
+# PROP BASE Intermediate_Dir "dbug___Win32_TLS_DEBUG"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "dbug___Win32_TLS_DEBUG"
+# PROP Intermediate_Dir "dbug___Win32_TLS_DEBUG"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\lib_debug\dbug_tls.lib"
+# ADD LIB32 /nologo /out:"..\lib_debug\dbug_tls.lib"
+
!ENDIF
# Begin Target
# Name "dbug - Win32 Release"
# Name "dbug - Win32 Debug"
+# Name "dbug - Win32 TLS_DEBUG"
# Begin Source File
SOURCE=.\dbug.c
diff --git a/VC++Files/heap/heap.dsp b/VC++Files/heap/heap.dsp
index 1edeec80e9b..8b72560a8b6 100644
--- a/VC++Files/heap/heap.dsp
+++ b/VC++Files/heap/heap.dsp
@@ -19,13 +19,15 @@ CFG=heap - Win32 Debug
!MESSAGE
!MESSAGE "heap - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "heap - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "heap - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library")
+!MESSAGE "heap - Win32 TLS" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "heap - Win32 Release"
@@ -41,14 +43,14 @@ RSC=rc.exe
# 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 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\heap.lib"
@@ -72,16 +74,68 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\heap.lib"
+!ELSEIF "$(CFG)" == "heap - Win32 TLS_DEBUG"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "heap___Win32_TLS_DEBUG"
+# PROP BASE Intermediate_Dir "heap___Win32_TLS_DEBUG"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "heap___Win32_TLS_DEBUG"
+# PROP Intermediate_Dir "heap___Win32_TLS_DEBUG"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\lib_debug\heap_tls.lib"
+# ADD LIB32 /nologo /out:"..\lib_debug\heap_tls.lib"
+
+!ELSEIF "$(CFG)" == "heap - Win32 TLS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "heap___Win32_TLS"
+# PROP BASE Intermediate_Dir "heap___Win32_TLS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "heap___Win32_TLS"
+# PROP Intermediate_Dir "heap___Win32_TLS"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\lib_release\heap_tls.lib"
+# ADD LIB32 /nologo /out:"..\lib_release\heap_tls.lib"
+
!ENDIF
# Begin Target
# Name "heap - Win32 Release"
# Name "heap - Win32 Debug"
+# Name "heap - Win32 TLS_DEBUG"
+# Name "heap - Win32 TLS"
# Begin Source File
SOURCE=.\_check.c
@@ -128,6 +182,13 @@ SOURCE=.\hp_hash.c
# SUBTRACT CPP /YX
+!ELSEIF "$(CFG)" == "heap - Win32 TLS_DEBUG"
+
+# SUBTRACT BASE CPP /YX
+# SUBTRACT CPP /YX
+
+!ELSEIF "$(CFG)" == "heap - Win32 TLS"
+
!ENDIF
# End Source File
diff --git a/VC++Files/innobase/innobase.dsp b/VC++Files/innobase/innobase.dsp
index 713e3153d17..0768b3095ea 100644
--- a/VC++Files/innobase/innobase.dsp
+++ b/VC++Files/innobase/innobase.dsp
@@ -67,7 +67,7 @@ LIB32=xilink6.exe -lib
# PROP Intermediate_Dir "release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c
# SUBTRACT CPP /WX /Fr /YX
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
@@ -91,7 +91,7 @@ LIB32=xilink6.exe -lib
# PROP Intermediate_Dir "nt"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "_LIB" /D "_WIN32" /D "WIN32" /D "NDEBUG" /D "MYSQL_SERVER" /D "_MBCS" /D MYSQL_SERVER_SUFFIX=-nt /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
@@ -115,7 +115,7 @@ LIB32=xilink6.exe -lib
# PROP Intermediate_Dir "max_nt"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "_LIB" /D "_WIN32" /D "WIN32" /D "NDEBUG" /D "MYSQL_SERVER" /D "_MBCS" /D MYSQL_SERVER_SUFFIX=-nt-max /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
@@ -280,10 +280,6 @@ SOURCE=.\os\os0proc.c
# End Source File
# Begin Source File
-SOURCE=.\os\os0shm.c
-# End Source File
-# Begin Source File
-
SOURCE=.\os\os0sync.c
# End Source File
# Begin Source File
@@ -388,10 +384,6 @@ SOURCE=.\sync\sync0arr.c
# End Source File
# Begin Source File
-SOURCE=.\sync\sync0ipm.c
-# End Source File
-# Begin Source File
-
SOURCE=.\sync\sync0rw.c
# End Source File
# Begin Source File
diff --git a/VC++Files/isam/isam.dsp b/VC++Files/isam/isam.dsp
index 12047145f6d..759a1b6ee03 100644
--- a/VC++Files/isam/isam.dsp
+++ b/VC++Files/isam/isam.dsp
@@ -19,13 +19,15 @@ CFG=isam - Win32 Debug
!MESSAGE
!MESSAGE "isam - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "isam - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "isam - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library")
+!MESSAGE "isam - Win32 TLS" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "isam - Win32 Release"
@@ -41,14 +43,14 @@ RSC=rc.exe
# 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 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\isam.lib"
@@ -72,16 +74,68 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_Debug\isam.lib"
+!ELSEIF "$(CFG)" == "isam - Win32 TLS_DEBUG"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "isam___Win32_TLS_DEBUG"
+# PROP BASE Intermediate_Dir "isam___Win32_TLS_DEBUG"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "isam___Win32_TLS_DEBUG"
+# PROP Intermediate_Dir "isam___Win32_TLS_DEBUG"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\lib_Debug\isam_tls.lib"
+# ADD LIB32 /nologo /out:"..\lib_Debug\isam_tls.lib"
+
+!ELSEIF "$(CFG)" == "isam - Win32 TLS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "isam___Win32_TLS"
+# PROP BASE Intermediate_Dir "isam___Win32_TLS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "isam___Win32_TLS"
+# PROP Intermediate_Dir "isam___Win32_TLS"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\lib_release\isam_tls.lib"
+# ADD LIB32 /nologo /out:"..\lib_release\isam_tls.lib"
+
!ENDIF
# Begin Target
# Name "isam - Win32 Release"
# Name "isam - Win32 Debug"
+# Name "isam - Win32 TLS_DEBUG"
+# Name "isam - Win32 TLS"
# Begin Source File
SOURCE=.\_cache.c
diff --git a/VC++Files/isamchk/isamchk.dsp b/VC++Files/isamchk/isamchk.dsp
index 0e8e2b04bd7..2026be94ea0 100644
--- a/VC++Files/isamchk/isamchk.dsp
+++ b/VC++Files/isamchk/isamchk.dsp
@@ -19,6 +19,7 @@ CFG=isamchk - Win32 Debug
!MESSAGE
!MESSAGE "isamchk - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "isamchk - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "isamchk - Win32 classic" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -42,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x41d /d "NDEBUG"
# ADD RSC /l 0x41d /d "NDEBUG"
@@ -80,12 +81,42 @@ LINK32=xilink6.exe
# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/isamchk.exe" /pdbtype:sept
# SUBTRACT LINK32 /verbose /pdb:none
+!ELSEIF "$(CFG)" == "isamchk - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "isamchk___Win32_classic"
+# PROP BASE Intermediate_Dir "isamchk___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "_CONSOLE" /D "_WINDOWS" /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /D LICENSE=Commercial /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x41d /d "NDEBUG"
+# ADD RSC /l 0x41d /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/isamchk.exe"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/isamchk.exe" /libpath:"..\lib_release\\"
+# SUBTRACT LINK32 /pdb:none
+
!ENDIF
# Begin Target
# Name "isamchk - Win32 Release"
# Name "isamchk - Win32 Debug"
+# Name "isamchk - Win32 classic"
# Begin Source File
SOURCE=..\isam\isamchk.c
diff --git a/VC++Files/libmysql/libmysql.dsp b/VC++Files/libmysql/libmysql.dsp
index 6a91414a45c..c315775443b 100644
--- a/VC++Files/libmysql/libmysql.dsp
+++ b/VC++Files/libmysql/libmysql.dsp
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "." /I "..\include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "." /I "..\include" /I "../zlib" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /D "NDEBUG" /D "MYSQL_CLIENT" /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
@@ -76,7 +76,7 @@ PostBuild_Cmds=xcopy release\libmysql.lib ..\lib_release /y
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "." /I "..\include" /I "../zlib" /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /FD /c
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "." /I "..\include" /I "../zlib" /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
@@ -92,7 +92,7 @@ LINK32=xilink6.exe
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Move DLL export lib
-PostBuild_Cmds=xcopy ..\lib_debug\libmysql.dll C:\winnt\system32\ /y xcopy debug\libmysql.lib ..\lib_debug\ /y
+PostBuild_Cmds=xcopy ..\lib_debug\libmysql.dll %windir%\system32\ /y xcopy debug\libmysql.lib ..\lib_debug\ /y
# End Special Build Tool
!ENDIF
diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp
index 9df0eb0f92b..f087c8a7b06 100644
--- a/VC++Files/libmysqld/libmysqld.dsp
+++ b/VC++Files/libmysqld/libmysqld.dsp
@@ -19,6 +19,8 @@ CFG=libmysqld - Win32 Debug
!MESSAGE
!MESSAGE "libmysqld - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "libmysqld - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "libmysqld - Win32 classic" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "libmysqld - Win32 pro" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
@@ -43,7 +45,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /I "../libmysqld" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../libmysqld" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c
# SUBTRACT CPP /WX /Fr
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
@@ -54,7 +56,8 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=xilink6.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 /nologo /dll /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 ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /dll /pdb:none /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib"
+# 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 ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib"
+# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "libmysqld - Win32 Debug"
@@ -70,8 +73,8 @@ LINK32=xilink6.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /I "libmysqld" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
-# SUBTRACT CPP /Fr
+# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../libmysqld" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
+# SUBTRACT CPP /X /Fr
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x416 /d "_DEBUG"
@@ -81,17 +84,91 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=xilink6.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 /nologo /dll /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 ..\lib_debug\dbug.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\innodb.lib /nologo /dll /pdb:none /debug /machine:I386 /nodefaultlib:"LIBCMTD" /out:"../lib_debug/libmysqld.dll" /implib:"../lib_debug/libmysqld.lib"
-
+# 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 ..\lib_debug\dbug_tls.lib ..\lib_debug\mysys_tls.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap_tls.lib ..\lib_debug\innodb.lib /nologo /dll /incremental:no /debug /machine:I386 /nodefaultlib:"LIBCMTD" /out:"../lib_debug/libmysqld.dll" /implib:"../lib_debug/libmysqld.lib" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "libmysqld - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "libmysqld___Win32_classic"
+# PROP BASE Intermediate_Dir "libmysqld___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FR /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../zlib" /D "WIN32" /D "_WINDOWS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "USE_TLS" /D "__WIN__" /D LICENSE=Commerical /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.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 Wsock32.lib ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib"
+# SUBTRACT BASE LINK32 /pdb:none
+# 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 ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_classic/libmysqld.dll" /implib:"../lib_release/libmysqld.lib"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "libmysqld - Win32 pro"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "libmysqld___Win32_pro"
+# PROP BASE Intermediate_Dir "libmysqld___Win32_pro"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "pro"
+# PROP Intermediate_Dir "pro"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FR /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../zlib" /D "WIN32" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "EMBEDDED_LIBRARY" /D "USE_TLS" /D "__WIN__" /D "MYSQL_SERVER" /D LICENSE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /FD /D MYSQL_SERVER_SUFFIX=-pro /c
+# SUBTRACT CPP /X /Fr
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.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 Wsock32.lib ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_classic/libmysqld.dll" /implib:"../lib_release/libmysqld.lib"
+# SUBTRACT BASE LINK32 /pdb:none
+# 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 ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_pro/libmysqld.dll" /implib:"../lib_release/libmysqld.lib"
+# SUBTRACT LINK32 /pdb:none
+
!ENDIF
# Begin Target
# Name "libmysqld - Win32 Release"
# Name "libmysqld - Win32 Debug"
+# Name "libmysqld - Win32 classic"
+# Name "libmysqld - Win32 pro"
# Begin Source File
-SOURCE=..\libmysql\client.c
+SOURCE="..\sql-common\client.c"
+
+!IF "$(CFG)" == "libmysqld - Win32 Release"
+
+!ELSEIF "$(CFG)" == "libmysqld - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "libmysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "libmysqld - Win32 pro"
+
+!ENDIF
+
# End Source File
# Begin Source File
@@ -107,6 +184,14 @@ SOURCE=..\sql\derror.cpp
# End Source File
# Begin Source File
+SOURCE=..\sql\discover.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\emb_qcache.cpp
+# End Source File
+# Begin Source File
+
SOURCE=..\libmysql\errmsg.c
# End Source File
# Begin Source File
@@ -279,7 +364,7 @@ SOURCE=..\sql\opt_sum.cpp
# End Source File
# Begin Source File
-SOURCE=..\libmysql\pack.c
+SOURCE="..\sql-common\pack.c"
# End Source File
# Begin Source File
@@ -509,5 +594,21 @@ SOURCE=..\sql\uniques.cpp
SOURCE=..\sql\unireg.cpp
# End Source File
+# Begin Source File
+
+SOURCE=..\vio\vio.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\vio\viosocket.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\vio\viossl.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\vio\viosslfactories.c
+# End Source File
# End Target
# End Project
diff --git a/VC++Files/libmysqltest/myTest.dsp b/VC++Files/libmysqltest/myTest.dsp
index 1d3a790edd5..ca0f9e6e147 100644
--- a/VC++Files/libmysqltest/myTest.dsp
+++ b/VC++Files/libmysqltest/myTest.dsp
@@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /W3 /O2 /I "..\include" /D "NDEBUG" /D "DBUG_UFF" /D "_CONSOLE" /D "_MBCS" /FD /c
+# ADD CPP /nologo /G6 /W3 /O2 /I "..\include" /D "DBUG_UFF" /D "_CONSOLE" /D "_MBCS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
diff --git a/VC++Files/merge/merge.dsp b/VC++Files/merge/merge.dsp
index 8a8173fd606..e057bd37924 100644
--- a/VC++Files/merge/merge.dsp
+++ b/VC++Files/merge/merge.dsp
@@ -25,7 +25,7 @@ CFG=merge - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "merge - Win32 Release"
@@ -41,14 +41,14 @@ RSC=rc.exe
# 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 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\merge.lib"
@@ -72,7 +72,7 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\merge.lib"
diff --git a/VC++Files/my_print_defaults/my_print_defaults.dsp b/VC++Files/my_print_defaults/my_print_defaults.dsp
index 80178116930..48a75ef7267 100644
--- a/VC++Files/my_print_defaults/my_print_defaults.dsp
+++ b/VC++Files/my_print_defaults/my_print_defaults.dsp
@@ -7,25 +7,26 @@
CFG=my_print_defaults - 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
!MESSAGE NMAKE /f "my_print_defaults.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "my_print_defaults.mak" CFG="my_print_defaults - Win32 Debug"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "my_print_defaults - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "my_print_defaults - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
+!MESSAGE "my_print_defaults - Win32 classic" (based on "Win32 (x86) Console Application")
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "my_print_defaults - Win32 Release"
@@ -42,13 +43,13 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "NDEBUG" /YX /FD /c
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=link.exe
+LINK32=xilink6.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 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 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 /machine:I386 /out:"../client_release/my_print_defaults.exe"
@@ -72,16 +73,42 @@ LINK32=link.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=link.exe
+LINK32=xilink6.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 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 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 /debug /machine:I386 /nodefaultlib:"LIBCMTD.lib" /out:"../client_debug/my_print_defaults.exe" /pdbtype:sept
-!ENDIF
+!ELSEIF "$(CFG)" == "my_print_defaults - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "my_print_defaults___Win32_classic"
+# PROP BASE Intermediate_Dir "my_print_defaults___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "NDEBUG" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "_CONSOLE" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /YX /FD /c
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.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 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 /machine:I386 /out:"../client_release/my_print_defaults.exe"
+# 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 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 ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/my_print_defaults.exe" /libpath:"..\lib_release\\"
+
+!ENDIF
# Begin Target
# Name "my_print_defaults - Win32 Release"
# Name "my_print_defaults - Win32 Debug"
+# Name "my_print_defaults - Win32 classic"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
diff --git a/VC++Files/myisam/myisam.dsp b/VC++Files/myisam/myisam.dsp
index 0b386997e5e..77a5315c549 100644
--- a/VC++Files/myisam/myisam.dsp
+++ b/VC++Files/myisam/myisam.dsp
@@ -19,6 +19,8 @@ CFG=myisam - Win32 Debug
!MESSAGE
!MESSAGE "myisam - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "myisam - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "myisam - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library")
+!MESSAGE "myisam - Win32 TLS" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
@@ -41,7 +43,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -74,12 +76,60 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_Debug\myisam.lib"
+!ELSEIF "$(CFG)" == "myisam - Win32 TLS_DEBUG"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "myisam___Win32_TLS_DEBUG"
+# PROP BASE Intermediate_Dir "myisam___Win32_TLS_DEBUG"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "myisam___Win32_TLS_DEBUG"
+# PROP Intermediate_Dir "myisam___Win32_TLS_DEBUG"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /Fo".\Debug/" /Fd".\Debug/" /FD /c
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /Fo".\Debug/" /Fd".\Debug/" /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\lib_Debug\myisam_tls.lib"
+# ADD LIB32 /nologo /out:"..\lib_Debug\myisam_tls.lib"
+
+!ELSEIF "$(CFG)" == "myisam - Win32 TLS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "myisam___Win32_TLS"
+# PROP BASE Intermediate_Dir "myisam___Win32_TLS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "myisam___Win32_TLS"
+# PROP Intermediate_Dir "myisam___Win32_TLS"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\lib_release\myisam_tls.lib"
+# ADD LIB32 /nologo /out:"..\lib_release\myisam_tls.lib"
+
!ENDIF
# Begin Target
# Name "myisam - Win32 Release"
# Name "myisam - Win32 Debug"
+# Name "myisam - Win32 TLS_DEBUG"
+# Name "myisam - Win32 TLS"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
diff --git a/VC++Files/myisam_ftdump/myisam_ftdump.dsp b/VC++Files/myisam_ftdump/myisam_ftdump.dsp
index 12a629091e0..6ff78178600 100755
--- a/VC++Files/myisam_ftdump/myisam_ftdump.dsp
+++ b/VC++Files/myisam_ftdump/myisam_ftdump.dsp
@@ -7,25 +7,25 @@
CFG=myisam_ftdump - 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
!MESSAGE NMAKE /f "myisam_ftdump.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "myisam_ftdump.mak" CFG="myisam_ftdump - Win32 Debug"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "myisam_ftdump - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "myisam_ftdump - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "myisam_ftdump - Win32 Release"
@@ -42,13 +42,13 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FR /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=link.exe
+LINK32=xilink6.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 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 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj ..\lib_release\zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/myisam_ftdump.exe"
@@ -73,11 +73,11 @@ LINK32=link.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=link.exe
+LINK32=xilink6.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 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 wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_debug\zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisam_ftdump.exe" /pdbtype:sept
-!ENDIF
+!ENDIF
# Begin Target
diff --git a/VC++Files/myisamchk/myisamchk.dsp b/VC++Files/myisamchk/myisamchk.dsp
index 000e1c11215..4c337e50e71 100644
--- a/VC++Files/myisamchk/myisamchk.dsp
+++ b/VC++Files/myisamchk/myisamchk.dsp
@@ -19,6 +19,7 @@ CFG=myisamchk - Win32 Debug
!MESSAGE
!MESSAGE "myisamchk - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "myisamchk - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "myisamchk - Win32 classic" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -78,12 +79,40 @@ LINK32=xilink6.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 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 wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisamchk.exe" /pdbtype:sept
+!ELSEIF "$(CFG)" == "myisamchk - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "myisamchk___Win32_classic"
+# PROP BASE Intermediate_Dir "myisamchk___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FR /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisamchk.exe"
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj ..\lib_release\myisam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/myisamchk.exe" /libpath:"..\lib_release\\"
+
!ENDIF
# Begin Target
# Name "myisamchk - Win32 Release"
# Name "myisamchk - Win32 Debug"
+# Name "myisamchk - Win32 classic"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
diff --git a/VC++Files/myisamlog/myisamlog.dsp b/VC++Files/myisamlog/myisamlog.dsp
index f251712127b..7c50a8aec9b 100644
--- a/VC++Files/myisamlog/myisamlog.dsp
+++ b/VC++Files/myisamlog/myisamlog.dsp
@@ -19,6 +19,7 @@ CFG=myisamlog - Win32 Debug
!MESSAGE
!MESSAGE "myisamlog - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "myisamlog - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "myisamlog - Win32 classic" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -80,12 +81,40 @@ LINK32=xilink6.exe
# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /pdb:"debug/myisamchk.pdb" /debug /machine:I386 /out:"../client_debug/myisamlog.exe" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
+!ELSEIF "$(CFG)" == "myisamlog - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "myisamlog___Win32_classic"
+# PROP BASE Intermediate_Dir "myisamlog___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FR /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /pdb:"release/myisamchk.pdb" /machine:I386 /out:"../client_release/myisamlog.exe"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj ..\lib_release\myisam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:"release/myisamchk.pdb" /machine:I386 /out:"../client_classic/myisamlog.exe" /libpath:"..\lib_release\\"
+# SUBTRACT LINK32 /pdb:none
+
!ENDIF
# Begin Target
# Name "myisamlog - Win32 Release"
# Name "myisamlog - Win32 Debug"
+# Name "myisamlog - Win32 classic"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
diff --git a/VC++Files/myisammrg/myisammrg.dsp b/VC++Files/myisammrg/myisammrg.dsp
index b7b613b1542..419d36517c9 100644
--- a/VC++Files/myisammrg/myisammrg.dsp
+++ b/VC++Files/myisammrg/myisammrg.dsp
@@ -19,13 +19,15 @@ CFG=myisammrg - Win32 Debug
!MESSAGE
!MESSAGE "myisammrg - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "myisammrg - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "myisammrg - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library")
+!MESSAGE "myisammrg - Win32 TLS" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "myisammrg - Win32 Release"
@@ -41,13 +43,13 @@ RSC=rc.exe
# PROP Intermediate_Dir "release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\myisammrg.lib"
@@ -71,16 +73,66 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_Debug\myisammrg.lib"
+!ELSEIF "$(CFG)" == "myisammrg - Win32 TLS_DEBUG"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "myisammrg___Win32_TLS_DEBUG"
+# PROP BASE Intermediate_Dir "myisammrg___Win32_TLS_DEBUG"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "myisammrg___Win32_TLS_DEBUG"
+# PROP Intermediate_Dir "myisammrg___Win32_TLS_DEBUG"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /Fo".\Debug/" /Fd".\Debug/" /FD /c
+# SUBTRACT BASE CPP /Fr
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /Fo".\Debug/" /Fd".\Debug/" /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\lib_Debug\myisammrg_tls.lib"
+# ADD LIB32 /nologo /out:"..\lib_Debug\myisammrg_tls.lib"
+
+!ELSEIF "$(CFG)" == "myisammrg - Win32 TLS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "myisammrg___Win32_TLS"
+# PROP BASE Intermediate_Dir "myisammrg___Win32_TLS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "myisammrg___Win32_TLS"
+# PROP Intermediate_Dir "myisammrg___Win32_TLS"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\lib_release\myisammrg_tls.lib"
+# ADD LIB32 /nologo /out:"..\lib_release\myisammrg_tls.lib"
+
!ENDIF
# Begin Target
# Name "myisammrg - Win32 Release"
# Name "myisammrg - Win32 Debug"
+# Name "myisammrg - Win32 TLS_DEBUG"
+# Name "myisammrg - Win32 TLS"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
diff --git a/VC++Files/myisampack/myisampack.dsp b/VC++Files/myisampack/myisampack.dsp
index 3331b6e17f8..7a5870b6862 100644
--- a/VC++Files/myisampack/myisampack.dsp
+++ b/VC++Files/myisampack/myisampack.dsp
@@ -7,19 +7,20 @@
CFG=myisampack - 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
!MESSAGE NMAKE /f "myisampack.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "myisampack.mak" CFG="myisampack - Win32 Debug"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "myisampack - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "myisampack - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
+!MESSAGE "myisampack - Win32 classic" (based on "Win32 (x86) Console Application")
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
@@ -78,12 +79,38 @@ LINK32=xilink6.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 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 wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisampack.exe" /pdbtype:sept
-!ENDIF
+!ELSEIF "$(CFG)" == "myisampack - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "myisampack___Win32_classic"
+# PROP BASE Intermediate_Dir "myisampack___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FR /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisampack.exe"
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj ..\lib_release\myisam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/myisampack.exe" /libpath:"..\lib_release\\"
+
+!ENDIF
# Begin Target
# Name "myisampack - Win32 Release"
# Name "myisampack - Win32 Debug"
+# Name "myisampack - Win32 classic"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw
index e0df167f58d..61a466174b6 100644
--- a/VC++Files/mysql.dsw
+++ b/VC++Files/mysql.dsw
@@ -41,6 +41,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name mysys
End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name strings
+ End Project Dependency
}}}
###############################################################################
@@ -824,4 +827,3 @@ Package=<3>
}}}
###############################################################################
-
diff --git a/VC++Files/mysqlbinlog/mysqlbinlog.dsp b/VC++Files/mysqlbinlog/mysqlbinlog.dsp
index 914bbcf70a3..8b8895d6f17 100644
--- a/VC++Files/mysqlbinlog/mysqlbinlog.dsp
+++ b/VC++Files/mysqlbinlog/mysqlbinlog.dsp
@@ -19,6 +19,7 @@ CFG=mysqlbinlog - Win32 Debug
!MESSAGE
!MESSAGE "mysqlbinlog - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "mysqlbinlog - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysqlbinlog - Win32 classic" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -42,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /I "../sql" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /I "../sql" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -77,12 +78,40 @@ LINK32=xilink6.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 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 mysqlclient.lib wsock32.lib 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 /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlbinlog.exe" /pdbtype:sept /libpath:"..\lib_debug\\"
+!ELSEIF "$(CFG)" == "mysqlbinlog - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysqlbinlog___Win32_classic"
+# PROP BASE Intermediate_Dir "mysqlbinlog___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /I "../sql" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /I "../sql" /D "MYSQL_SERVER" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 mysqlclient.lib wsock32.lib 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 /out:"../client_release/mysqlbinlog.exe" /libpath:"..\lib_release\\"
+# SUBTRACT BASE LINK32 /pdb:none /debug
+# ADD LINK32 mysqlclient.lib wsock32.lib 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 /out:"../client_classic/mysqlbinlog.exe" /libpath:"..\lib_release\\"
+# SUBTRACT LINK32 /pdb:none /debug
+
!ENDIF
# Begin Target
# Name "mysqlbinlog - Win32 Release"
# Name "mysqlbinlog - Win32 Debug"
+# Name "mysqlbinlog - Win32 classic"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
diff --git a/VC++Files/mysqlcheck/mysqlcheck.dsp b/VC++Files/mysqlcheck/mysqlcheck.dsp
index f8487119da3..bd24a14128d 100644
--- a/VC++Files/mysqlcheck/mysqlcheck.dsp
+++ b/VC++Files/mysqlcheck/mysqlcheck.dsp
@@ -19,6 +19,7 @@ CFG=mysqlcheck - Win32 Debug
!MESSAGE
!MESSAGE "mysqlcheck - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "mysqlcheck - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysqlcheck - Win32 classic" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -42,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -76,12 +77,38 @@ LINK32=xilink6.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 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 mysqlclient.lib wsock32.lib 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 /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlcheck.exe" /pdbtype:sept /libpath:"..\lib_debug\\"
+!ELSEIF "$(CFG)" == "mysqlcheck - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysqlcheck___Win32_classic"
+# PROP BASE Intermediate_Dir "mysqlcheck___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "MYSQL_SERVER" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 mysqlclient.lib wsock32.lib 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 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\"
+# ADD LINK32 mysqlclient.lib wsock32.lib 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 /out:"../client_classic/mysqlcheck.exe" /libpath:"..\lib_release\\"
+
!ENDIF
# Begin Target
# Name "mysqlcheck - Win32 Release"
# Name "mysqlcheck - Win32 Debug"
+# Name "mysqlcheck - Win32 classic"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
diff --git a/VC++Files/mysqldemb/mysqldemb.dsp b/VC++Files/mysqldemb/mysqldemb.dsp
index 91cd90a65ed..a8207d436a0 100644
--- a/VC++Files/mysqldemb/mysqldemb.dsp
+++ b/VC++Files/mysqldemb/mysqldemb.dsp
@@ -19,6 +19,8 @@ CFG=mysqldemb - Win32 Debug
!MESSAGE
!MESSAGE "mysqldemb - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "mysqldemb - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "mysqldemb - Win32 classic" (based on "Win32 (x86) Static Library")
+!MESSAGE "mysqldemb - Win32 pro" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
@@ -41,7 +43,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "../zlib" /I "../libmysqld" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c
+# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
@@ -65,7 +67,7 @@ LIB32=xilink6.exe -lib
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "../zlib" /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "../libmysqld" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "../zlib" /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x416 /d "_DEBUG"
# ADD RSC /l 0x416 /d "_DEBUG"
@@ -74,7 +76,56 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
+# ADD LIB32 /nologo /out:"../lib_debug/mysqldemb.lib"
+
+!ELSEIF "$(CFG)" == "mysqldemb - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysqldemb___Win32_classic"
+# PROP BASE Intermediate_Dir "mysqldemb___Win32_classic"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../zlib" /D "WIN32" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../zlib" /D "WIN32" /D "_LIB" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "USE_TLS" /D "__WIN__" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\lib_classic\mysqldemb.lib"
+
+!ELSEIF "$(CFG)" == "mysqldemb - Win32 pro"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysqldemb___Win32_pro"
+# PROP BASE Intermediate_Dir "mysqldemb___Win32_pro"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "pro"
+# PROP Intermediate_Dir "pro"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../zlib" /D "WIN32" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../zlib" /D "WIN32" /D "_LIB" /D "SIGNAL_WITH_VIO_CLOSE" /D "EMBEDDED_LIBRARY" /D "USE_TLS" /D "__WIN__" /D "USE_SYMDIR" /D "MYSQL_SERVER" /D LICENSE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /FD /D MYSQL_SERVER_SUFFIX=-pro /c
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\lib_pro\mysqldemb.lib"
!ENDIF
@@ -82,6 +133,8 @@ LIB32=xilink6.exe -lib
# Name "mysqldemb - Win32 Release"
# Name "mysqldemb - Win32 Debug"
+# Name "mysqldemb - Win32 classic"
+# Name "mysqldemb - Win32 pro"
# Begin Source File
SOURCE=..\sql\derror.cpp
diff --git a/VC++Files/mysqlmanager/RES/BITMAP1.BMP b/VC++Files/mysqlmanager/RES/bitmap1.bmp
index 3751f1a6923..3751f1a6923 100644
--- a/VC++Files/mysqlmanager/RES/BITMAP1.BMP
+++ b/VC++Files/mysqlmanager/RES/bitmap1.bmp
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/BITMAP3.BMP b/VC++Files/mysqlmanager/RES/bitmap3.bmp
index 3751f1a6923..3751f1a6923 100644
--- a/VC++Files/mysqlmanager/RES/BITMAP3.BMP
+++ b/VC++Files/mysqlmanager/RES/bitmap3.bmp
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/BMP00001.BMP b/VC++Files/mysqlmanager/RES/bmp00001.bmp
index e98e93d7850..e98e93d7850 100644
--- a/VC++Files/mysqlmanager/RES/BMP00001.BMP
+++ b/VC++Files/mysqlmanager/RES/bmp00001.bmp
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/BMP00002.BMP b/VC++Files/mysqlmanager/RES/bmp00002.bmp
index 2f2c195a683..2f2c195a683 100644
--- a/VC++Files/mysqlmanager/RES/BMP00002.BMP
+++ b/VC++Files/mysqlmanager/RES/bmp00002.bmp
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/DATABASE.BMP b/VC++Files/mysqlmanager/RES/database.bmp
index 2fc41313541..2fc41313541 100644
--- a/VC++Files/mysqlmanager/RES/DATABASE.BMP
+++ b/VC++Files/mysqlmanager/RES/database.bmp
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/FONTD.BMP b/VC++Files/mysqlmanager/RES/fontd.bmp
index c77b4f4fdd0..c77b4f4fdd0 100644
--- a/VC++Files/mysqlmanager/RES/FONTD.BMP
+++ b/VC++Files/mysqlmanager/RES/fontd.bmp
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/FONTU.BMP b/VC++Files/mysqlmanager/RES/fontu.bmp
index c77b4f4fdd0..c77b4f4fdd0 100644
--- a/VC++Files/mysqlmanager/RES/FONTU.BMP
+++ b/VC++Files/mysqlmanager/RES/fontu.bmp
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/QUERY_EX.BMP b/VC++Files/mysqlmanager/RES/query_ex.bmp
index cc77222decc..cc77222decc 100644
--- a/VC++Files/mysqlmanager/RES/QUERY_EX.BMP
+++ b/VC++Files/mysqlmanager/RES/query_ex.bmp
Binary files differ
diff --git a/VC++Files/mysqlmanager/RES/TOOLBAR.BMP b/VC++Files/mysqlmanager/RES/toolbar.bmp
index d501723c1ce..d501723c1ce 100644
--- a/VC++Files/mysqlmanager/RES/TOOLBAR.BMP
+++ b/VC++Files/mysqlmanager/RES/toolbar.bmp
Binary files differ
diff --git a/VC++Files/mysqlmanager/CHILDFRM.CPP b/VC++Files/mysqlmanager/childfrm.cpp
index 08027e068ac..08027e068ac 100644
--- a/VC++Files/mysqlmanager/CHILDFRM.CPP
+++ b/VC++Files/mysqlmanager/childfrm.cpp
diff --git a/VC++Files/mysqlmanager/CHILDFRM.H b/VC++Files/mysqlmanager/childfrm.h
index 3075be58a67..3075be58a67 100644
--- a/VC++Files/mysqlmanager/CHILDFRM.H
+++ b/VC++Files/mysqlmanager/childfrm.h
diff --git a/VC++Files/mysqlmanager/MAINFRM.CPP b/VC++Files/mysqlmanager/mainfrm.cpp
index 499704ed2a0..499704ed2a0 100644
--- a/VC++Files/mysqlmanager/MAINFRM.CPP
+++ b/VC++Files/mysqlmanager/mainfrm.cpp
diff --git a/VC++Files/mysqlmanager/MAINFRM.H b/VC++Files/mysqlmanager/mainfrm.h
index 06c51965bb1..06c51965bb1 100644
--- a/VC++Files/mysqlmanager/MAINFRM.H
+++ b/VC++Files/mysqlmanager/mainfrm.h
diff --git a/VC++Files/mysqlmanager/MySqlManager.dsp b/VC++Files/mysqlmanager/mysqlmanager.dsp
index 7f92e091904..7f92e091904 100644
--- a/VC++Files/mysqlmanager/MySqlManager.dsp
+++ b/VC++Files/mysqlmanager/mysqlmanager.dsp
diff --git a/VC++Files/mysqlmanager/MySqlManager.mak b/VC++Files/mysqlmanager/mysqlmanager.mak
index b372daa52f2..b372daa52f2 100644
--- a/VC++Files/mysqlmanager/MySqlManager.mak
+++ b/VC++Files/mysqlmanager/mysqlmanager.mak
diff --git a/VC++Files/mysqlmanager/RESOURCE.H b/VC++Files/mysqlmanager/resource.h
index def26ce6808..def26ce6808 100644
--- a/VC++Files/mysqlmanager/RESOURCE.H
+++ b/VC++Files/mysqlmanager/resource.h
diff --git a/VC++Files/mysqlmanager/STDAFX.CPP b/VC++Files/mysqlmanager/stdafx.cpp
index 3e0251dff43..3e0251dff43 100644
--- a/VC++Files/mysqlmanager/STDAFX.CPP
+++ b/VC++Files/mysqlmanager/stdafx.cpp
diff --git a/VC++Files/mysqlmanager/STDAFX.H b/VC++Files/mysqlmanager/stdafx.h
index 8cd7dfd04f3..8cd7dfd04f3 100644
--- a/VC++Files/mysqlmanager/STDAFX.H
+++ b/VC++Files/mysqlmanager/stdafx.h
diff --git a/VC++Files/mysqlmanager/TOOLSQL.CPP b/VC++Files/mysqlmanager/toolsql.cpp
index 1773a3a6dc7..1773a3a6dc7 100644
--- a/VC++Files/mysqlmanager/TOOLSQL.CPP
+++ b/VC++Files/mysqlmanager/toolsql.cpp
diff --git a/VC++Files/mysqlmanager/TOOLSQL.H b/VC++Files/mysqlmanager/toolsql.h
index 7d608f46cd2..7d608f46cd2 100644
--- a/VC++Files/mysqlmanager/TOOLSQL.H
+++ b/VC++Files/mysqlmanager/toolsql.h
diff --git a/VC++Files/mysqlserver/mysqlserver.dsp b/VC++Files/mysqlserver/mysqlserver.dsp
index d4f4af454d0..b8d07a4bf34 100644
--- a/VC++Files/mysqlserver/mysqlserver.dsp
+++ b/VC++Files/mysqlserver/mysqlserver.dsp
@@ -41,7 +41,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "../libmysqld" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "../libmysqld" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /YX /FD /c
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/mysqlshutdown/mysqlshutdown.dsp b/VC++Files/mysqlshutdown/mysqlshutdown.dsp
index f1ea7c7d934..b7802240d42 100644
--- a/VC++Files/mysqlshutdown/mysqlshutdown.dsp
+++ b/VC++Files/mysqlshutdown/mysqlshutdown.dsp
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /W3 /O2 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
+# ADD CPP /nologo /G6 /W3 /O2 /D "_WINDOWS" /D "_MBCS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /WX /Fr /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
diff --git a/VC++Files/mysqlwatch/mysqlwatch.dsp b/VC++Files/mysqlwatch/mysqlwatch.dsp
index 5c209f55e51..ee683c60351 100644
--- a/VC++Files/mysqlwatch/mysqlwatch.dsp
+++ b/VC++Files/mysqlwatch/mysqlwatch.dsp
@@ -24,7 +24,7 @@ CFG=mysqlwatch - Win32 Release
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=xicl6.exe
RSC=rc.exe
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
@@ -38,13 +38,13 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /W3 /GX- /O2 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
+# ADD CPP /nologo /G6 /W3 /O2 /D "_WINDOWS" /D "_MBCS" /D "NDEBUG" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=link.exe
+LINK32=xilink6.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 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 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 /out:"../client_release/mysqlwatch.exe"
# Begin Target
diff --git a/VC++Files/mysys/mysys.dsp b/VC++Files/mysys/mysys.dsp
index a7be57d94c0..f42357c2249 100644
--- a/VC++Files/mysys/mysys.dsp
+++ b/VC++Files/mysys/mysys.dsp
@@ -7,26 +7,28 @@
CFG=mysys - 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
!MESSAGE NMAKE /f "mysys.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "mysys.mak" CFG="mysys - Win32 Debug"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "mysys - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "mysys - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "mysys - Win32 Max" (based on "Win32 (x86) Static Library")
-!MESSAGE
+!MESSAGE "mysys - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library")
+!MESSAGE "mysys - Win32 TLS" (based on "Win32 (x86) Static Library")
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "mysys - Win32 Release"
@@ -42,14 +44,14 @@ RSC=rc.exe
# 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 /I "../include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_SYMLINK" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /WX /Fr /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\mysys.lib"
@@ -66,14 +68,14 @@ LIB32=link.exe -lib
# 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 /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /D "USE_SYMLINK" /FD /c
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c
# SUBTRACT CPP /Fr
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\mysys.lib"
@@ -91,24 +93,76 @@ LIB32=link.exe -lib
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_SYMDIR" /D "USE_SYMLINK" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "USE_SYMDIR" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D MYSQL_SERVER_SUFFIX=-max /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\mysys.lib"
# ADD LIB32 /nologo /out:"..\lib_release\mysys-max.lib"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysys - Win32 TLS_DEBUG"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "mysys___Win32_TLS_DEBUG"
+# PROP BASE Intermediate_Dir "mysys___Win32_TLS_DEBUG"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "mysys___Win32_TLS_DEBUG"
+# PROP Intermediate_Dir "mysys___Win32_TLS_DEBUG"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c
+# SUBTRACT BASE CPP /Fr
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /D "USE_TLS" /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\lib_debug\mysys_tls.lib"
+# ADD LIB32 /nologo /out:"..\lib_debug\mysys_tls.lib"
+
+!ELSEIF "$(CFG)" == "mysys - Win32 TLS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysys___Win32_TLS"
+# PROP BASE Intermediate_Dir "mysys___Win32_TLS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "mysys___Win32_TLS"
+# PROP Intermediate_Dir "mysys___Win32_TLS"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\lib_release\mysys_tls.lib"
+# ADD LIB32 /nologo /out:"..\lib_release\mysys_tls.lib"
+
+!ENDIF
# Begin Target
# Name "mysys - Win32 Release"
# Name "mysys - Win32 Debug"
# Name "mysys - Win32 Max"
+# Name "mysys - Win32 TLS_DEBUG"
+# Name "mysys - Win32 TLS"
# Begin Source File
SOURCE=.\array.c
@@ -121,7 +175,15 @@ SOURCE=.\array.c
!ELSEIF "$(CFG)" == "mysys - Win32 Max"
-!ENDIF
+
+!ELSEIF "$(CFG)" == "mysys - Win32 TLS_DEBUG"
+
+# ADD BASE CPP /FR
+# ADD CPP /FR
+
+!ELSEIF "$(CFG)" == "mysys - Win32 TLS"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -528,7 +590,14 @@ SOURCE=.\thr_lock.c
!ELSEIF "$(CFG)" == "mysys - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysys - Win32 TLS_DEBUG"
+
+# ADD BASE CPP /D "EXTRA_DEBUG"
+# ADD CPP /D "EXTRA_DEBUG"
+
+!ELSEIF "$(CFG)" == "mysys - Win32 TLS"
+
+!ENDIF
# End Source File
# Begin Source File
diff --git a/VC++Files/pack_isam/pack_isam.dsp b/VC++Files/pack_isam/pack_isam.dsp
index cdcba702e15..f5f8f0bcd7a 100644
--- a/VC++Files/pack_isam/pack_isam.dsp
+++ b/VC++Files/pack_isam/pack_isam.dsp
@@ -19,6 +19,7 @@ CFG=pack_isam - Win32 Debug
!MESSAGE
!MESSAGE "pack_isam - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "pack_isam - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "pack_isam - Win32 classic" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -42,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -77,12 +78,38 @@ LINK32=xilink6.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 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 wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /debug /machine:I386 /out:"../client_debug/pack_isam.exe" /pdbtype:sept
+!ELSEIF "$(CFG)" == "pack_isam - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "pack_isam___Win32_classic"
+# PROP BASE Intermediate_Dir "pack_isam___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/pack_isam.exe"
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/pack_isam.exe" /libpath:"..\lib_release\\"
+
!ENDIF
# Begin Target
# Name "pack_isam - Win32 Release"
# Name "pack_isam - Win32 Debug"
+# Name "pack_isam - Win32 classic"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
diff --git a/VC++Files/perror/perror.dsp b/VC++Files/perror/perror.dsp
index 99bd8f67ae2..daa6a4dc4ce 100644
--- a/VC++Files/perror/perror.dsp
+++ b/VC++Files/perror/perror.dsp
@@ -19,6 +19,7 @@ CFG=perror - Win32 Debug
!MESSAGE
!MESSAGE "perror - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "perror - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE "perror - Win32 classic" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
@@ -43,7 +44,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
@@ -85,12 +86,44 @@ LINK32=xilink6.exe
# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /incremental:no /debug /machine:I386 /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
+!ELSEIF "$(CFG)" == "perror - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "perror___Win32_classic"
+# PROP BASE Intermediate_Dir "perror___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "WIN32" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 wsock32.lib 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 /out:"../client_release/perror.exe"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/perror.exe" /libpath:"..\lib_release\\"
+# SUBTRACT LINK32 /pdb:none
+
!ENDIF
# Begin Target
# Name "perror - Win32 Release"
# Name "perror - Win32 Debug"
+# Name "perror - Win32 classic"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
diff --git a/VC++Files/regex/regex.dsp b/VC++Files/regex/regex.dsp
index 59b55ffe46f..ecca45178f9 100644
--- a/VC++Files/regex/regex.dsp
+++ b/VC++Files/regex/regex.dsp
@@ -25,7 +25,7 @@ CFG=regex - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "regex - Win32 Release"
@@ -41,14 +41,14 @@ RSC=rc.exe
# 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 /I "../include" /I "./" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "./" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\regex.lib"
@@ -72,7 +72,7 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\regex.lib"
diff --git a/VC++Files/replace/replace.dsp b/VC++Files/replace/replace.dsp
index 2fe763ff388..6df0f793d92 100644
--- a/VC++Files/replace/replace.dsp
+++ b/VC++Files/replace/replace.dsp
@@ -19,6 +19,7 @@ CFG=replace - Win32 Debug
!MESSAGE
!MESSAGE "replace - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "replace - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "replace - Win32 classic" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -42,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x40b /d "NDEBUG"
# ADD RSC /l 0x40b /d "NDEBUG"
@@ -79,12 +80,40 @@ LINK32=xilink6.exe
# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /machine:I386 /out:"../client_debug/replace.exe" /pdbtype:sept
# SUBTRACT LINK32 /debug
+!ELSEIF "$(CFG)" == "replace - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "replace___Win32_classic"
+# PROP BASE Intermediate_Dir "replace___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x40b /d "NDEBUG"
+# ADD RSC /l 0x40b /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/replace.exe"
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/replace.exe" /libpath:"..\lib_release\\"
+
!ENDIF
# Begin Target
# Name "replace - Win32 Release"
# Name "replace - Win32 Debug"
+# Name "replace - Win32 classic"
# Begin Source File
SOURCE=..\extra\replace.c
diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp
index 3e168b0feb5..4e7bc644cc4 100644
--- a/VC++Files/sql/mysqld.dsp
+++ b/VC++Files/sql/mysqld.dsp
@@ -7,28 +7,32 @@
CFG=mysqld - 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
!MESSAGE NMAKE /f "mysqld.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "mysqld.mak" CFG="mysqld - Win32 Release"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "mysqld - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "mysqld - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE "mysqld - Win32 nt" (based on "Win32 (x86) Console Application")
!MESSAGE "mysqld - Win32 Max nt" (based on "Win32 (x86) Console Application")
!MESSAGE "mysqld - Win32 Max" (based on "Win32 (x86) Console Application")
-!MESSAGE
+!MESSAGE "mysqld - Win32 classic" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysqld - Win32 pro" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysqld - Win32 classic nt" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysqld - Win32 pro nt" (based on "Win32 (x86) Console Application")
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "mysqld - Win32 Release"
@@ -45,14 +49,14 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /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 "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /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
# 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=link.exe
+LINK32=xilink6.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 /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 ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-opt.exe"
# SUBTRACT LINK32 /debug
@@ -71,14 +75,14 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /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 "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /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
# 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=link.exe
+LINK32=xilink6.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 /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 ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\isam.lib ..\lib_debug\merge.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld.exe" /pdbtype:sept
@@ -98,14 +102,14 @@ LINK32=link.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G5 /MT /W3 /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /D "DBUG_OFF" /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-nt /FD /c
# 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=link.exe
+LINK32=xilink6.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 Wsock32.lib ..\lib_release\dbug.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /debug /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 ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe"
# SUBTRACT LINK32 /pdb:none /debug
@@ -126,15 +130,15 @@ LINK32=link.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-nt-max /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
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 Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe"
+LINK32=xilink6.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 Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386
# SUBTRACT BASE LINK32 /pdb:none /debug
# 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 ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-max-nt.exe"
# SUBTRACT LINK32 /pdb:none /debug
@@ -155,19 +159,132 @@ LINK32=link.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-max /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
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 Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"../client_release/mysqld-opt.exe"
+LINK32=xilink6.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 Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /debug /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 ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-max.exe"
# SUBTRACT LINK32 /debug
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysqld___Win32_classic"
+# PROP BASE Intermediate_Dir "mysqld___Win32_classic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic"
+# PROP Intermediate_Dir "classic"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D LICENSE=Commercial /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "HAVE_DLOPEN" /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.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 Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386
+# SUBTRACT BASE LINK32 /debug
+# 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 ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_classic/mysqld.exe" /libpath:"..\lib_release"
+# SUBTRACT LINK32 /debug
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysqld___Win32_pro"
+# PROP BASE Intermediate_Dir "mysqld___Win32_pro"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "pro"
+# PROP Intermediate_Dir "pro"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "MYSQL_SERVER" /D LICENSE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /D MYSQL_SERVER_SUFFIX=-pro /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.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 Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386
+# SUBTRACT BASE LINK32 /debug
+# 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 ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_pro/mysqld.exe" /libpath:"..\lib_release"
+# SUBTRACT LINK32 /debug
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysqld___Win32_classic_nt"
+# PROP BASE Intermediate_Dir "mysqld___Win32_classic_nt"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "classic_nt"
+# PROP Intermediate_Dir "classic_nt"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "__NT__" /D "DBUG_OFF" /D "NDEBUG" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D LICENSE=Commercial /D MYSQL_SERVER_SUFFIX=-nt /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.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 Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386
+# SUBTRACT BASE LINK32 /debug
+# 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 ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_classic/mysqld-nt.exe" /libpath:"..\lib_release"
+# SUBTRACT LINK32 /debug
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysqld___Win32_pro_nt"
+# PROP BASE Intermediate_Dir "mysqld___Win32_pro_nt"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "pro_nt"
+# PROP Intermediate_Dir "pro_nt"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "NDEBUG" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D LICENSE=Commercial /D "NDEBUG" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-pro-nt" /FD
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.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 Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386
+# SUBTRACT BASE LINK32 /debug
+# 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 ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_pro/mysqld-nt.exe" /libpath:"..\lib_release"
+# SUBTRACT LINK32 /debug
+
+!ENDIF
# Begin Target
@@ -176,6 +293,10 @@ LINK32=link.exe
# Name "mysqld - Win32 nt"
# Name "mysqld - Win32 Max nt"
# Name "mysqld - Win32 Max"
+# Name "mysqld - Win32 classic"
+# Name "mysqld - Win32 pro"
+# Name "mysqld - Win32 classic nt"
+# Name "mysqld - Win32 pro nt"
# Begin Source File
SOURCE=.\client.c
@@ -193,7 +314,15 @@ SOURCE=.\client.c
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -213,7 +342,15 @@ SOURCE=.\derror.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -241,7 +378,15 @@ SOURCE=.\field.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -261,7 +406,15 @@ SOURCE=.\field_conv.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -281,7 +434,15 @@ SOURCE=.\filesort.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -333,7 +494,15 @@ SOURCE=.\handler.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -352,7 +521,15 @@ SOURCE=.\hash_filo.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -375,7 +552,15 @@ SOURCE=.\hostname.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -395,7 +580,15 @@ SOURCE=.\init.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -415,7 +608,15 @@ SOURCE=.\item.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -435,7 +636,15 @@ SOURCE=.\item_buff.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -455,7 +664,15 @@ SOURCE=.\item_cmpfunc.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -479,6 +696,14 @@ SOURCE=.\item_func.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
!ENDIF
# End Source File
@@ -507,7 +732,15 @@ SOURCE=.\item_strfunc.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -531,7 +764,15 @@ SOURCE=.\item_sum.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -550,7 +791,15 @@ SOURCE=.\item_timefunc.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -570,7 +819,15 @@ SOURCE=.\item_uniq.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -590,7 +847,15 @@ SOURCE=.\key.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -610,7 +875,15 @@ SOURCE=.\lock.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -630,7 +903,15 @@ SOURCE=.\log.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -653,7 +934,15 @@ SOURCE=.\mf_iocache.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -677,7 +966,15 @@ SOURCE=.\mysqld.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -700,7 +997,15 @@ SOURCE=.\nt_servc.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -723,7 +1028,15 @@ SOURCE=.\opt_range.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -754,7 +1067,15 @@ SOURCE=.\password.c
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -774,7 +1095,15 @@ SOURCE=.\procedure.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -802,7 +1131,15 @@ SOURCE=.\records.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -858,7 +1195,15 @@ SOURCE=.\sql_acl.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -882,7 +1227,15 @@ SOURCE=.\sql_base.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -906,6 +1259,14 @@ SOURCE=.\sql_class.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
!ENDIF
# End Source File
@@ -938,7 +1299,15 @@ SOURCE=.\sql_db.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -958,7 +1327,15 @@ SOURCE=.\sql_delete.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -998,7 +1375,15 @@ SOURCE=.\sql_insert.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1018,7 +1403,15 @@ SOURCE=.\sql_lex.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1038,7 +1431,15 @@ SOURCE=.\sql_list.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1058,7 +1459,15 @@ SOURCE=.\sql_load.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1082,7 +1491,15 @@ SOURCE=.\sql_map.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1102,7 +1519,15 @@ SOURCE=.\sql_parse.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1134,7 +1559,15 @@ SOURCE=.\sql_select.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1154,7 +1587,15 @@ SOURCE=.\sql_show.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1178,7 +1619,15 @@ SOURCE=.\sql_string.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1198,7 +1647,15 @@ SOURCE=.\sql_table.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1218,7 +1675,15 @@ SOURCE=.\sql_test.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1246,7 +1711,15 @@ SOURCE=.\sql_update.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1266,7 +1739,15 @@ SOURCE=.\sql_yacc.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1286,6 +1767,14 @@ SOURCE=.\strfunc.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
!ENDIF
# End Source File
@@ -1310,7 +1799,15 @@ SOURCE=.\thr_malloc.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1330,7 +1827,15 @@ SOURCE=.\time.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# Begin Source File
@@ -1354,7 +1859,15 @@ SOURCE=.\unireg.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
+
+!ENDIF
# End Source File
# End Target
diff --git a/VC++Files/strings/strings.dsp b/VC++Files/strings/strings.dsp
index 31d548ed59f..c8f3208e822 100644
--- a/VC++Files/strings/strings.dsp
+++ b/VC++Files/strings/strings.dsp
@@ -26,6 +26,7 @@ CFG=strings - Win32 Debug
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=xicl6.exe
+CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "strings - Win32 Release"
@@ -41,7 +42,7 @@ RSC=rc.exe
# 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 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
@@ -151,7 +152,7 @@ SOURCE=".\ctype-sjis.c"
SOURCE=".\ctype-tis620.c"
# End Source File
# Begin Source File
-
+
SOURCE=".\ctype-uca.c"
# End Source File
# Begin Source File
@@ -192,10 +193,6 @@ SOURCE=.\longlong2str.c
# End Source File
# Begin Source File
-SOURCE=.\strnlen.c
-# End Source File
-# Begin Source File
-
SOURCE=.\my_strtoll10.c
# End Source File
# Begin Source File
diff --git a/VC++Files/test1/test1.dsp b/VC++Files/test1/test1.dsp
index df4b31d684e..e3be8f7a315 100644
--- a/VC++Files/test1/test1.dsp
+++ b/VC++Files/test1/test1.dsp
@@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /W3 /O2 /I "../include" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /W3 /O2 /I "../include" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
diff --git a/VC++Files/thr_test/thr_test.dsp b/VC++Files/thr_test/thr_test.dsp
index 0c80de42521..0d2b8e0d24b 100644
--- a/VC++Files/thr_test/thr_test.dsp
+++ b/VC++Files/thr_test/thr_test.dsp
@@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x40b /d "NDEBUG"
# ADD RSC /l 0x40b /d "NDEBUG"
diff --git a/VC++Files/vio/vio.dsp b/VC++Files/vio/vio.dsp
index c250e693995..5daa5800dbd 100644
--- a/VC++Files/vio/vio.dsp
+++ b/VC++Files/vio/vio.dsp
@@ -41,7 +41,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/zlib/contrib/asm386/zlibvc.dsp b/VC++Files/zlib/contrib/asm386/zlibvc.dsp
index a70d4d4a6b0..63d8fee6511 100644
--- a/VC++Files/zlib/contrib/asm386/zlibvc.dsp
+++ b/VC++Files/zlib/contrib/asm386/zlibvc.dsp
@@ -8,16 +8,16 @@
CFG=zlibvc - 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
!MESSAGE NMAKE /f "zlibvc.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "zlibvc.mak" CFG="zlibvc - Win32 Release"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "zlibvc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "zlibvc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "zlibvc - Win32 ReleaseAxp" (based on\
@@ -26,7 +26,7 @@ CFG=zlibvc - Win32 Release
"Win32 (x86) Dynamic-Link Library")
!MESSAGE "zlibvc - Win32 ReleaseWithoutCrtdll" (based on\
"Win32 (x86) Dynamic-Link Library")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP Scc_ProjName ""
@@ -191,7 +191,7 @@ LINK32=link.exe
# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_1\zlib.dll"
# SUBTRACT LINK32 /pdb:none
-!ENDIF
+!ENDIF
# Begin Target
@@ -216,13 +216,13 @@ SOURCE=.\adler32.c
DEP_CPP_ADLER=\
".\zconf.h"\
".\zlib.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -238,13 +238,13 @@ SOURCE=.\compress.c
DEP_CPP_COMPR=\
".\zconf.h"\
".\zlib.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -260,13 +260,13 @@ SOURCE=.\crc32.c
DEP_CPP_CRC32=\
".\zconf.h"\
".\zlib.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -284,13 +284,13 @@ DEP_CPP_DEFLA=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -307,7 +307,7 @@ SOURCE=.\gvmat32c.c
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -324,13 +324,13 @@ DEP_CPP_GZIO_=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -351,13 +351,13 @@ DEP_CPP_INFBL=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -379,13 +379,13 @@ DEP_CPP_INFCO=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -407,13 +407,13 @@ DEP_CPP_INFFA=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -431,13 +431,13 @@ DEP_CPP_INFLA=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -455,13 +455,13 @@ DEP_CPP_INFTR=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -482,13 +482,13 @@ DEP_CPP_INFUT=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -506,13 +506,13 @@ DEP_CPP_TREES=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -528,13 +528,13 @@ SOURCE=.\uncompr.c
DEP_CPP_UNCOM=\
".\zconf.h"\
".\zlib.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -551,7 +551,7 @@ SOURCE=.\unzip.c
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -568,7 +568,7 @@ SOURCE=.\zip.c
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -593,13 +593,13 @@ DEP_CPP_ZUTIL=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# End Group
diff --git a/VC++Files/zlib/zlib.dsp b/VC++Files/zlib/zlib.dsp
index 40aaadaa4e1..6edab34d93c 100644
--- a/VC++Files/zlib/zlib.dsp
+++ b/VC++Files/zlib/zlib.dsp
@@ -41,7 +41,7 @@ RSC=rc.exe
# 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 "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
diff --git a/client/my_readline.h b/client/my_readline.h
index 2e716eec4cf..6052d462ab9 100644
--- a/client/my_readline.h
+++ b/client/my_readline.h
@@ -29,6 +29,6 @@ typedef struct st_line_buffer
} LINE_BUFFER;
extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
-extern LINE_BUFFER *batch_readline_command(my_string str);
+extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, my_string str);
extern char *batch_readline(LINE_BUFFER *buffer);
extern void batch_readline_end(LINE_BUFFER *buffer);
diff --git a/client/mysql.cc b/client/mysql.cc
index 52582481234..01d867cca07 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -371,10 +371,16 @@ int main(int argc,char *argv[])
!(status.line_buff=batch_readline_init(max_allowed_packet+512,stdin)))
{
free_defaults(defaults_argv);
+ my_end(0);
+ exit(1);
+ }
+ if (mysql_server_init(0, NULL, (char**) server_default_groups))
+ {
+ free_defaults(defaults_argv);
+ my_end(0);
exit(1);
}
glob_buffer.realloc(512);
- mysql_server_init(0, NULL, (char**) server_default_groups);
completion_hash_init(&ht, 128);
init_alloc_root(&hash_mem_root, 16384, 0);
bzero((char*) &mysql, sizeof(mysql));
@@ -494,7 +500,7 @@ static struct my_option my_long_options[] =
"No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. WARNING: options deprecated; use --disable-auto-rehash instead.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"batch", 'B',
- "Print results with a tab as separator, each row on new line. Doesn't use history file.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ "Don't use history file. Disable interactive behavior. (Enables --silent)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory where character sets are.", (gptr*) &charsets_dir,
(gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -515,7 +521,7 @@ static struct my_option my_long_options[] =
(gptr*) &current_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delimiter", OPT_DELIMITER, "Delimiter to be used.", (gptr*) &delimiter_str,
(gptr*) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"execute", 'e', "Execute command and quit. (Output like with --batch).", 0,
+ {"execute", 'e', "Execute command and quit. (Disables --force and history file)", 0,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"vertical", 'E', "Print the output of a query (rows) vertically.",
(gptr*) &vertical, (gptr*) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
@@ -597,7 +603,7 @@ static struct my_option my_long_options[] =
0, 0, 0},
{"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default.",
(gptr*) &opt_reconnect, (gptr*) &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
- {"silent", 's', "Be more silent.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
+ {"silent", 's', "Be more silent. Print results with a tab as separator, each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
0, 0},
#ifdef HAVE_SMEM
{"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME,
@@ -663,6 +669,10 @@ static struct my_option my_long_options[] =
static void usage(int version)
{
+ /* Divert all help information on NetWare to logger screen. */
+#ifdef __NETWARE__
+#define printf consoleprintf
+#endif
printf("%s Ver %s Distrib %s, for %s (%s)\n",
my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
if (version)
@@ -675,8 +685,13 @@ and you are welcome to modify and redistribute it under the GPL license\n");
my_print_help(my_long_options);
print_defaults("my", load_default_groups);
my_print_variables(my_long_options);
+ NETWARE_SET_SCREEN_MODE(1);
+#ifdef __NETWARE__
+#undef printf
+#endif
}
+
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
@@ -755,10 +770,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'e':
status.batch= 1;
status.add_to_history= 0;
- batch_readline_end(status.line_buff); // If multiple -e
- if (!(status.line_buff= batch_readline_command(argument)))
+ if (!status.line_buff)
+ ignore_errors= 0; // do it for the first -e only
+ if (!(status.line_buff= batch_readline_command(status.line_buff, argument)))
return 1;
- ignore_errors= 0;
break;
case 'o':
if (argument == disabled_my_option)
@@ -798,12 +813,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
verbose++;
break;
case 'B':
- if (!status.batch)
- {
- status.batch= 1;
- status.add_to_history= 0;
- opt_silent++; // more silent
- }
+ status.batch= 1;
+ status.add_to_history= 0;
+ set_if_bigger(opt_silent,1); // more silent
break;
case 'W':
#ifdef __WIN__
@@ -913,6 +925,7 @@ static int read_lines(bool execute_commands)
#ifdef __NETWARE__
line=fgets(linebuffer, sizeof(linebuffer)-1, stdin);
/* Remove the '\n' */
+ if (line)
{
char *p = strrchr(line, '\n');
if (p != NULL)
@@ -928,7 +941,11 @@ static int read_lines(bool execute_commands)
line= readline(prompt);
#endif /* defined( __WIN__) || defined(OS2) || defined(__NETWARE__) */
- if (opt_outfile)
+ /*
+ When Ctrl+d or Ctrl+z is pressed, the line may be NULL on some OS
+ which may cause coredump.
+ */
+ if (opt_outfile && line)
fprintf(OUTFILE, "%s\n", line);
}
if (!line) // End of file
@@ -1108,11 +1125,8 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
else
{
- int error= com_go(&buffer, 0);
- if (error)
- {
- return error < 0 ? 0 : 1; // < 0 is not fatal
- }
+ if (com_go(&buffer, 0) > 0) // < 0 is not fatal
+ return 1;
}
buffer.length(0);
out= line;
@@ -1245,7 +1259,6 @@ static void fix_history(String *final_command)
static int not_in_history(const char *line)
{
HIST_ENTRY *oldhist = history_get(history_length);
- int num;
if (oldhist == 0)
return 1;
@@ -1595,7 +1608,6 @@ static int com_server_help(String *buffer __attribute__((unused)),
const char *server_cmd= buffer->ptr();
char cmd_buf[100];
MYSQL_RES *result;
- MYSQL_FIELD *fields;
int error;
if (help_arg[0] != '\'')
@@ -1621,7 +1633,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
{
unsigned int num_fields= mysql_num_fields(result);
my_ulonglong num_rows= mysql_num_rows(result);
- fields= mysql_fetch_fields(result);
+ mysql_fetch_fields(result);
if (num_fields==3 && num_rows==1)
{
if (!(cur= mysql_fetch_row(result)))
@@ -2386,10 +2398,8 @@ static int
com_quit(String *buffer __attribute__((unused)),
char *line __attribute__((unused)))
{
-#ifdef __NETWARE__
- // let the screen auto close on a normal shutdown
- setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
-#endif
+ /* let the screen auto close on a normal shutdown */
+ NETWARE_SET_SCREEN_MODE(SCR_AUTOCLOSE_ON_EXIT);
status.exit_status=0;
return 1;
}
@@ -2410,6 +2420,10 @@ static int
com_shell(String *buffer, char *line __attribute__((unused)))
{
char *shell_cmd;
+
+ /* Skip space from line begin */
+ while (my_isspace(charset_info, *line))
+ line++;
if (!(shell_cmd = strchr(line, ' ')))
{
put_info("Usage: \\! shell-command", INFO_ERROR);
@@ -2991,7 +3005,7 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
{
va_list args;
- NETWARE_YIELD
+ NETWARE_YIELD;
va_start(args, fmt);
(void) vfprintf(file, fmt, args);
#ifdef OS2
@@ -3005,7 +3019,7 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
void tee_fputs(const char *s, FILE *file)
{
- NETWARE_YIELD
+ NETWARE_YIELD;
fputs(s, file);
#ifdef OS2
fflush( file);
@@ -3017,7 +3031,7 @@ void tee_fputs(const char *s, FILE *file)
void tee_puts(const char *s, FILE *file)
{
- NETWARE_YIELD
+ NETWARE_YIELD;
fputs(s, file);
fputs("\n", file);
#ifdef OS2
diff --git a/client/mysqladmin.c b/client/mysqladmin.c
index a2cce3782d6..e6e90fc628c 100644
--- a/client/mysqladmin.c
+++ b/client/mysqladmin.c
@@ -874,11 +874,13 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
return 0;
}
+#include <help_start.h>
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s on %s\n",my_progname,ADMIN_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
+ NETWARE_SET_SCREEN_MODE(1);
}
@@ -921,6 +923,8 @@ static void usage(void)
version Get version info from server");
}
+#include <help_end.h>
+
static int drop_db(MYSQL *mysql, const char *db)
{
char name_buff[FN_REFLEN+20], buf[10];
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 818b402d014..1d042f1a9a1 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -61,7 +61,7 @@ static const char *load_default_groups[]= { "mysqlbinlog","client",0 };
void sql_print_error(const char *format, ...);
-static bool one_database = 0;
+static bool one_database=0, to_last_remote_log= 0;
static const char* database= 0;
static my_bool force_opt= 0, short_form= 0, remote_opt= 0;
static ulonglong offset = 0;
@@ -489,6 +489,12 @@ static struct my_option my_long_options[] =
{"socket", 'S', "Socket file to use for connection.",
(gptr*) &sock, (gptr*) &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
+ {"to-last-log", 't', "Requires -R. Will not stop at the end of the \
+requested binlog but rather continue printing until the end of the last \
+binlog of the MySQL server. If you send the output to the same MySQL server, \
+that may lead to an endless loop.",
+ (gptr*) &to_last_remote_log, (gptr*) &to_last_remote_log, 0, GET_BOOL,
+ NO_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "Connect to the remote server as username.",
(gptr*) &user, (gptr*) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
@@ -533,9 +539,12 @@ static void die(const char* fmt, ...)
exit(1);
}
+#include <help_start.h>
+
static void print_version()
{
printf("%s Ver 3.1 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
+ NETWARE_SET_SCREEN_MODE(1);
}
@@ -554,6 +563,8 @@ the mysql command line client\n\n");
my_print_variables(my_long_options);
}
+#include <help_end.h>
+
extern "C" my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
@@ -795,7 +806,7 @@ could be out of memory");
part of our log) and then we will stop when we receive the fake one
soon.
*/
- if (rev->when == 0)
+ if ((rev->when == 0) && !to_last_remote_log)
{
if ((rev->ident_len != logname_len) ||
memcmp(rev->new_log_ident, logname, logname_len))
@@ -831,7 +842,7 @@ could be out of memory");
DBUG_RETURN(1);
}
my_close(file,MYF(MY_WME));
- }
+ }
/*
Let's adjust offset for remote log as for local log to produce
similar text. As we don't print the fake Rotate event, all events are
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index aa4c1282cc1..78e82e670f8 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -172,10 +172,13 @@ static void print_result();
static char *fix_table_name(char *dest, char *src);
int what_to_do = 0;
+#include <help_start.h>
+
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n", my_progname, CHECK_VERSION,
MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
+ NETWARE_SET_SCREEN_MODE(1);
} /* print_version */
@@ -206,6 +209,7 @@ static void usage(void)
my_print_variables(my_long_options);
} /* usage */
+#include <help_end.h>
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 1a0ef713ec7..0366e0da87f 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -241,10 +241,10 @@ static struct my_option my_long_options[] =
{"no-data", 'd', "No row information.", (gptr*) &dFlag, (gptr*) &dFlag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-set-names", 'N',
- "'SET NAMES charset_name' will not be put in the output. Deprecated, use --set-charset or --skip-set-charset to enable/disable charset settings instead",
+ "Deprecated, use --set-charset or --skip-set-charset to enable/disable charset settings instead",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"set-charset", OPT_SET_CHARSET,
- "'SET NAMES charset_name' will be put in the output",
+ "'SET CHARACTER_SET_CLIENT=default_character_set' will be put in the output",
(gptr*) &opt_set_charset, (gptr*) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
{"set-variable", 'O',
@@ -332,11 +332,13 @@ static int dump_all_databases();
static char *quote_name(const char *name, char *buff, my_bool force);
static const char *check_if_ignore_table(const char *table_name);
+#include <help_start.h>
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION,
- MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
+ MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
+ NETWARE_SET_SCREEN_MODE(1);
} /* print_version */
@@ -346,8 +348,10 @@ static void short_usage_sub(void)
printf("OR %s [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]\n",
my_progname);
printf("OR %s [OPTIONS] --all-databases [OPTIONS]\n", my_progname);
+ NETWARE_SET_SCREEN_MODE(1);
}
+
static void usage(void)
{
print_version();
@@ -367,6 +371,8 @@ static void short_usage(void)
printf("For more options, use %s --help\n", my_progname);
}
+#include <help_end.h>
+
static void write_header(FILE *sql_file, char *db_name)
{
@@ -1264,18 +1270,32 @@ static char *field_escape(char *to,const char *from,uint length)
} /* field_escape */
+static char *alloc_query_str(ulong size)
+{
+ char *query;
+
+ if (!(query= (char*) my_malloc(size, MYF(MY_WME))))
+ {
+ ignore_errors= 0; /* Fatal error */
+ safe_exit(EX_MYSQLERR); /* Force exit */
+ }
+ return query;
+}
+
/*
** dumpTable saves database contents as a series of INSERT statements.
*/
static void dumpTable(uint numFields, char *table)
{
- char query[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3];
+ char query_buf[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3];
char *result_table, table_buff2[NAME_LEN*2+3], *opt_quoted_table;
+ char *query= query_buf;
MYSQL_RES *res;
MYSQL_FIELD *field;
MYSQL_ROW row;
ulong rownr, row_break, total_length, init_length;
const char *table_type;
+ int error= 0;
result_table= quote_name(table,table_buff, 1);
opt_quoted_table= quote_name(table, table_buff2, 0);
@@ -1321,8 +1341,11 @@ static void dumpTable(uint numFields, char *table)
sprintf(buff," FROM %s", result_table);
end= strmov(end,buff);
if (where)
- end= strxmov(end, " WHERE ",where,NullS);
- if (mysql_query(sock, query))
+ {
+ query= alloc_query_str((ulong) (strlen(where) + (end - query) + 10));
+ end= strxmov(query, query_buf, " WHERE ", where, NullS);
+ }
+ if (mysql_real_query(sock, query, (uint) (end - query)))
{
DBerror(sock, "when executing 'SELECT INTO OUTFILE'");
return;
@@ -1339,14 +1362,16 @@ static void dumpTable(uint numFields, char *table)
{
if (!opt_xml && opt_comments)
fprintf(md_result_file,"-- WHERE: %s\n",where);
- strxmov(strend(query), " WHERE ",where,NullS);
+ query= alloc_query_str((ulong) (strlen(where) + strlen(query) + 10));
+ strxmov(query, query_buf, " WHERE ", where, NullS);
}
if (!opt_xml && !opt_compact)
fputs("\n", md_result_file);
if (mysql_query(sock, query))
{
DBerror(sock, "when retrieving data from server");
- return;
+ error= EX_CONSCHECK;
+ goto err;
}
if (quick)
res=mysql_use_result(sock);
@@ -1355,7 +1380,8 @@ static void dumpTable(uint numFields, char *table)
if (!res)
{
DBerror(sock, "when retrieving data from server");
- return;
+ error= EX_CONSCHECK;
+ goto err;
}
if (verbose)
fprintf(stderr, "-- Retrieving rows...\n");
@@ -1363,8 +1389,8 @@ static void dumpTable(uint numFields, char *table)
{
fprintf(stderr,"%s: Error in field count for table: %s ! Aborting.\n",
my_progname, result_table);
- safe_exit(EX_CONSCHECK);
- return;
+ error= EX_CONSCHECK;
+ goto err;
}
if (opt_disable_keys)
@@ -1402,8 +1428,8 @@ static void dumpTable(uint numFields, char *table)
sprintf(query,"%s: Not enough fields from table %s! Aborting.\n",
my_progname, result_table);
fputs(query,stderr);
- safe_exit(EX_CONSCHECK);
- return;
+ error= EX_CONSCHECK;
+ goto err;
}
if (extended_insert)
{
@@ -1422,7 +1448,8 @@ static void dumpTable(uint numFields, char *table)
if (dynstr_realloc(&extended_row,length * 2+2))
{
fputs("Aborting dump (out of memory)",stderr);
- safe_exit(EX_EOM);
+ error= EX_EOM;
+ goto err;
}
dynstr_append(&extended_row,"'");
extended_row.length +=
@@ -1458,7 +1485,8 @@ static void dumpTable(uint numFields, char *table)
else if (dynstr_append(&extended_row,"NULL"))
{
fputs("Aborting dump (out of memory)",stderr);
- safe_exit(EX_EOM);
+ error= EX_EOM;
+ goto err;
}
}
else
@@ -1552,8 +1580,8 @@ static void dumpTable(uint numFields, char *table)
result_table,
rownr);
fputs(query,stderr);
- safe_exit(EX_CONSCHECK);
- return;
+ error= EX_CONSCHECK;
+ goto err;
}
if (opt_lock)
fputs("UNLOCK TABLES;\n", md_result_file);
@@ -1563,7 +1591,16 @@ static void dumpTable(uint numFields, char *table)
if (opt_autocommit)
fprintf(md_result_file, "commit;\n");
mysql_free_result(res);
- }
+ if (query != query_buf)
+ my_free(query, MYF(MY_ALLOW_ZERO_PTR));
+ }
+ return;
+
+err:
+ if (query != query_buf)
+ my_free(query, MYF(MY_ALLOW_ZERO_PTR));
+ safe_exit(error);
+ return;
} /* dumpTable */
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index d47ae48b1ac..ccf7fd9880d 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -147,14 +147,16 @@ static struct my_option my_long_options[] =
static const char *load_default_groups[]= { "mysqlimport","client",0 };
+#include <help_start.h>
+
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n" ,my_progname,
IMPORT_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
+ NETWARE_SET_SCREEN_MODE(1);
}
-
static void usage(void)
{
print_version();
@@ -173,6 +175,7 @@ file. The SQL command 'LOAD DATA INFILE' is used to import the rows.\n");
my_print_variables(my_long_options);
}
+#include <help_end.h>
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 9dc5c0a30f4..d9e2a1fa92a 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -209,12 +209,16 @@ static struct my_option my_long_options[] =
};
+#include <help_start.h>
+
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,SHOW_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
+ NETWARE_SET_SCREEN_MODE(1);
}
+
static void usage(void)
{
print_version();
@@ -234,6 +238,8 @@ are shown");
my_print_variables(my_long_options);
}
+#include <help_end.h>
+
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 2cd395a02b8..be2270850fa 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -109,7 +109,7 @@ MYSQL_MANAGER* manager=0;
static char **default_argv;
static const char *load_default_groups[]= { "mysqltest","client",0 };
-static char line_buffer[MAX_DELIMITER], *line_buffer_pos= line_buffer;;
+static char line_buffer[MAX_DELIMITER], *line_buffer_pos= line_buffer;
static FILE* file_stack[MAX_INCLUDE_DEPTH];
static FILE** cur_file;
@@ -180,6 +180,17 @@ typedef struct
int alloced;
} VAR;
+#ifdef __NETWARE__
+/*
+ Netware doesn't proved environment variable substitution that is done
+ by the shell in unix environments. We do this in the following function:
+*/
+
+static char *subst_env_var(const char *cmd);
+static int my_popen(const char *cmd, const char *mode);
+#define popen(A,B) my_popen((A),(B))
+#endif /* __NETWARE__ */
+
VAR var_reg[10];
/*Perl/shell-like variable registers */
HASH var_hash;
@@ -906,7 +917,7 @@ int do_exec(struct st_query* q)
while (fgets(buf, sizeof(buf), res_file))
replace_dynstr_append_mem(ds, buf, strlen(buf));
-
+
if (glob_replace)
free_replace();
@@ -929,6 +940,7 @@ int do_exec(struct st_query* q)
DBUG_RETURN(error);
}
+
int var_query_set(VAR* v, const char* p, const char** p_end)
{
char* end = (char*)((p_end && *p_end) ? *p_end : p + strlen(p));
@@ -3674,3 +3686,101 @@ static void get_replace_column(struct st_query *q)
}
my_free(start, MYF(0));
}
+
+#ifdef __NETWARE__
+
+/*
+ Substitute environment variables with text.
+
+ SYNOPSIS
+ subst_env_var()
+ arg String that should be substitute
+
+ DESCRIPTION
+ This function takes a string as an input and replaces the
+ environment variables, that starts with '$' character, with it value.
+
+ NOTES
+ Return string must be freed with my_free()
+
+ RETURN
+ String with environment variables replaced.
+*/
+
+static char *subst_env_var(const char *str)
+{
+ char *result;
+
+ result= pos= my_malloc(MAX_QUERY, MYF(MY_FAE));
+ while (*str)
+ {
+ /*
+ need this only when we want to provide the functionality of
+ escaping through \ 'backslash'
+ if ((result == pos && *str=='$') ||
+ (result != pos && *str=='$' && str[-1] !='\\'))
+ */
+ if (*str == '$')
+ {
+ char env_var[256], *env_pos= env_var, *subst;
+
+ /* Search for end of environment variable */
+ for (str++;
+ *str && !isspace(*str) && *str != '\\' && *str != '/' &&
+ *str != '$';
+ str++)
+ *env_pos++ *str;
+ *env_pos= 0;
+
+ if (!(subst= getenv(env_var)))
+ {
+ my_free(result, MYF(0));
+ die("MYSQLTEST.NLM: Environment variable %s is not defined\n",
+ env_var);
+ }
+
+ /* get the string to be substitued for env_var */
+ pos= strmov(pos, subst);
+ /* Process delimiter in *str again */
+ }
+ else
+ *pos++= *str++;
+ }
+ *pos= 0;
+ return result;
+}
+
+
+/*
+ popen replacement for Netware
+
+ SYNPOSIS
+ my_popen()
+ name Command to execute (with possible env variables)
+ mode Mode for popen.
+
+ NOTES
+ Environment variable expansion does not take place for popen function
+ on NetWare, so we use this function to wrap around popen to do this.
+
+ For the moment we ignore 'mode' and always use 'r0'
+
+ RETURN
+ # >= 0 File handle
+ -1 Error
+*/
+
+#undef popen /* Remove wrapper */
+
+int my_popen(const char *cmd, const char *mode __attribute__((unused)) t)
+{
+ char *subst_cmd;
+ int res_file;
+
+ subst_cmd= subst_env_var(cmd);
+ res_file= popen(subst_cmd, "r0");
+ my_free(subst_cmd, MYF(0));
+ return res_file;
+}
+
+#endif /* __NETWARE__ */
diff --git a/client/readline.cc b/client/readline.cc
index f5fbfd8cd0c..52ecb4e5c68 100644
--- a/client/readline.cc
+++ b/client/readline.cc
@@ -31,7 +31,8 @@ static char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length);
LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
{
LINE_BUFFER *line_buff;
- if (!(line_buff=(LINE_BUFFER*) my_malloc(sizeof(*line_buff),MYF(MY_WME))))
+ if (!(line_buff=(LINE_BUFFER*)
+ my_malloc(sizeof(*line_buff),MYF(MY_WME | MY_ZEROFILL))))
return 0;
if (init_line_buffer(line_buff,fileno(file),IO_SIZE,max_size))
{
@@ -67,11 +68,12 @@ void batch_readline_end(LINE_BUFFER *line_buff)
}
-LINE_BUFFER *batch_readline_command(my_string str)
+LINE_BUFFER *batch_readline_command(LINE_BUFFER *line_buff, my_string str)
{
- LINE_BUFFER *line_buff;
- if (!(line_buff=(LINE_BUFFER*) my_malloc(sizeof(*line_buff),MYF(MY_WME))))
- return 0;
+ if (!line_buff)
+ if (!(line_buff=(LINE_BUFFER*)
+ my_malloc(sizeof(*line_buff),MYF(MY_WME | MY_ZEROFILL))))
+ return 0;
if (init_line_buffer_from_string(line_buff,str))
{
my_free((char*) line_buff,MYF(0));
@@ -88,7 +90,6 @@ LINE_BUFFER *batch_readline_command(my_string str)
static bool
init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,ulong max_buffer)
{
- bzero((char*) buffer,sizeof(buffer[0]));
buffer->file=file;
buffer->bufread=size;
buffer->max_size=max_buffer;
@@ -100,19 +101,26 @@ init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,ulong max_buffer)
return 0;
}
-
+/*
+ init_line_buffer_from_string can be called on the same buffer
+ several times. the resulting buffer will contain a
+ concatenation of all strings separated by spaces
+*/
static bool init_line_buffer_from_string(LINE_BUFFER *buffer,my_string str)
{
- uint length;
- bzero((char*) buffer,sizeof(buffer[0]));
- length=(uint) strlen(str);
- if (!(buffer->buffer=buffer->start_of_line=buffer->end_of_line=
- (char*)my_malloc(length+2,MYF(MY_FAE))))
+ uint old_length=buffer->end - buffer->buffer;
+ uint length= (uint) strlen(str);
+ if (!(buffer->buffer= buffer->start_of_line= buffer->end_of_line=
+ (char*)my_realloc(buffer->buffer, old_length+length+2,
+ MYF(MY_FAE|MY_ALLOW_ZERO_PTR))))
return 1;
- memcpy(buffer->buffer,str,length);
- buffer->buffer[length]='\n';
- buffer->buffer[length+1]=0;
- buffer->end=buffer->buffer+length+1;
+ buffer->end= buffer->buffer + old_length;
+ if (old_length)
+ buffer->end[-1]=' ';
+ memcpy(buffer->end, str, length);
+ buffer->end[length]= '\n';
+ buffer->end[length+1]= 0;
+ buffer->end+= length+1;
buffer->eof=1;
buffer->max_size=1;
return 0;
diff --git a/configure.in b/configure.in
index 6cd085d48f3..baa20a42b33 100644
--- a/configure.in
+++ b/configure.in
@@ -126,8 +126,10 @@ fi
# The following hack should ensure that configure doesn't add optimizing
# or debugging flags to CFLAGS or CXXFLAGS
-CFLAGS="$CFLAGS "
-CXXFLAGS="$CXXFLAGS "
+# C_EXTRA_FLAGS are flags that are automaticly added to both
+# CFLAGS and CXXFLAGS
+CFLAGS="$CFLAGS $C_EXTRA_FLAGS "
+CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
dnl Checks for programs.
AC_PROG_AWK
@@ -1120,8 +1122,8 @@ dnl Is this the right match for DEC OSF on alpha?
# Add library dependencies to mysqld_DEPENDENCIES
lib_DEPENDENCIES="\$(bdb_libs_with_path) \$(innodb_libs) \$(pstack_libs) \$(innodb_system_libs) \$(openssl_libs)"
cat > $filesed << EOF
-s,\(^.*\$(MAKE) gen_lex_hash\),#\1,
-s,\(\./gen_lex_hash\),\1.linux,
+s,\(^.*\$(MAKE) gen_lex_hash\)\$(EXEEXT),#\1,
+s,\(\./gen_lex_hash\)\$(EXEEXT),\1.linux,
s%\(mysqld_DEPENDENCIES = \) %\1$lib_DEPENDENCIES %
EOF
;;
@@ -2847,6 +2849,7 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl
include/Makefile sql-bench/Makefile tools/Makefile dnl
tests/Makefile Docs/Makefile support-files/Makefile dnl
support-files/MacOSX/Makefile mysql-test/Makefile dnl
+ netware/Makefile dnl
include/mysql_version.h dnl
cmd-line-utils/Makefile dnl
cmd-line-utils/libedit/Makefile dnl
diff --git a/extra/Makefile.am b/extra/Makefile.am
index 0276355ef65..df29a3a6ab7 100644
--- a/extra/Makefile.am
+++ b/extra/Makefile.am
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include
+INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include @ndbcluster_includes@
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \
../dbug/libdbug.a ../strings/libmystrings.a
bin_PROGRAMS = replace comp_err perror resolveip my_print_defaults \
diff --git a/extra/perror.c b/extra/perror.c
index 10b2442de20..a31889cc26d 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -16,22 +16,34 @@
/* Return error-text for system error messages and nisam messages */
-#define PERROR_VERSION "2.9"
+#define PERROR_VERSION "2.10"
#include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
#include <errno.h>
#include <my_getopt.h>
+#ifdef HAVE_NDBCLUSTER_DB
+#include "../ndb/src/ndbapi/ndberror.c"
+#endif
static my_bool verbose, print_all_codes;
+#ifdef HAVE_NDBCLUSTER_DB
+static my_bool ndb_code;
+static char ndb_string[1024];
+#endif
+
static struct my_option my_long_options[] =
{
{"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"info", 'I', "Synonym for --help.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
+#ifdef HAVE_NDBCLUSTER_DB
+ {"ndb", 0, "Ndbcluster storage engine specific error codes.", (gptr*) &ndb_code,
+ (gptr*) &ndb_code, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+#endif
#ifdef HAVE_SYS_ERRLIST
{"all", 'a', "Print all the error messages and the number.",
(gptr*) &print_all_codes, (gptr*) &print_all_codes, 0, GET_BOOL, NO_ARG,
@@ -195,12 +207,37 @@ int main(int argc,char *argv[])
else
#endif
{
+ /*
+ On some system, like NETWARE, strerror(unknown_error) returns a
+ string 'Unknown Error'. To avoid printing it we try to find the
+ error string by asking for an impossible big error message.
+ */
+ const char *unknown_error= strerror(10000);
+
for ( ; argc-- > 0 ; argv++)
{
+
found=0;
code=atoi(*argv);
- msg = strerror(code);
- if (msg)
+#ifdef HAVE_NDBCLUSTER_DB
+ if (ndb_code)
+ {
+ if (ndb_error_string(code, ndb_string, 1024) < 0)
+ msg= 0;
+ else
+ msg= ndb_string;
+ }
+ else
+#endif
+ msg = strerror(code);
+
+ /*
+ Don't print message for not existing error messages or for
+ unknown errors. We test for 'Uknown Errors' just as an
+ extra safety for Netware
+ */
+ if (msg && strcmp(msg, "Unknown Error") &&
+ (!unknown_error || strcmp(msg, unknown_error)))
{
found=1;
if (verbose)
@@ -219,7 +256,7 @@ int main(int argc,char *argv[])
else
{
if (verbose)
- printf("%3d = %s\n",code,msg);
+ printf("MySql error: %3d = %s\n",code,msg);
else
puts(msg);
}
diff --git a/heap/heapdef.h b/heap/heapdef.h
index 63109badb05..083765334ab 100644
--- a/heap/heapdef.h
+++ b/heap/heapdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -97,6 +97,7 @@ extern uint hp_rb_null_key_length(HP_KEYDEF *keydef, const byte *key);
extern my_bool hp_if_null_in_key(HP_KEYDEF *keyinfo, const byte *record);
extern int hp_close(register HP_INFO *info);
extern void hp_clear(HP_SHARE *info);
+extern void hp_clear_keys(HP_SHARE *info);
extern uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
uint k_len);
#ifdef THREAD
diff --git a/heap/hp_clear.c b/heap/hp_clear.c
index e65d3a172c3..4440344f990 100644
--- a/heap/hp_clear.c
+++ b/heap/hp_clear.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -29,13 +29,60 @@ void heap_clear(HP_INFO *info)
void hp_clear(HP_SHARE *info)
{
- uint key;
DBUG_ENTER("hp_clear");
if (info->block.levels)
VOID(hp_free_level(&info->block,info->block.levels,info->block.root,
(byte*) 0));
info->block.levels=0;
+ hp_clear_keys(info);
+ info->records=info->deleted=info->data_length=0;
+ info->blength=1;
+ info->changed=0;
+ info->del_link=0;
+ DBUG_VOID_RETURN;
+}
+
+
+/*
+ Clear all keys.
+
+ SYNOPSIS
+ heap_clear_keys()
+ info A pointer to the heap storage engine HP_INFO struct.
+
+ DESCRIPTION
+ Delete all trees of all indexes and leave them empty.
+
+ RETURN
+ void
+*/
+
+void heap_clear_keys(HP_INFO *info)
+{
+ hp_clear(info->s);
+}
+
+
+/*
+ Clear all keys.
+
+ SYNOPSIS
+ hp_clear_keys()
+ info A pointer to the heap storage engine HP_SHARE struct.
+
+ DESCRIPTION
+ Delete all trees of all indexes and leave them empty.
+
+ RETURN
+ void
+*/
+
+void hp_clear_keys(HP_SHARE *info)
+{
+ uint key;
+ DBUG_ENTER("hp_clear_keys");
+
for (key=0 ; key < info->keys ; key++)
{
HP_KEYDEF *keyinfo = info->keydef + key;
@@ -52,9 +99,95 @@ void hp_clear(HP_SHARE *info)
block->last_allocated=0;
}
}
- info->records=info->deleted=info->data_length=info->index_length=0;
- info->blength=1;
- info->changed=0;
- info->del_link=0;
+ info->index_length=0;
DBUG_VOID_RETURN;
}
+
+
+/*
+ Disable all indexes.
+
+ SYNOPSIS
+ heap_disable_indexes()
+ info A pointer to the heap storage engine HP_INFO struct.
+
+ DESCRIPTION
+ Disable and clear (remove contents of) all indexes.
+
+ RETURN
+ 0 ok
+*/
+
+int heap_disable_indexes(HP_INFO *info)
+{
+ HP_SHARE *share= info->s;
+
+ if (share->keys)
+ {
+ hp_clear_keys(share);
+ share->currently_disabled_keys= share->keys;
+ share->keys= 0;
+ }
+ return 0;
+}
+
+
+/*
+ Enable all indexes
+
+ SYNOPSIS
+ heap_enable_indexes()
+ info A pointer to the heap storage engine HP_INFO struct.
+
+ DESCRIPTION
+ Enable all indexes. The indexes might have been disabled
+ by heap_disable_index() before.
+ The function works only if both data and indexes are empty,
+ since the heap storage engine cannot repair the indexes.
+ To be sure, call handler::delete_all_rows() before.
+
+ RETURN
+ 0 ok
+ HA_ERR_CRASHED data or index is non-empty.
+*/
+
+int heap_enable_indexes(HP_INFO *info)
+{
+ int error= 0;
+ HP_SHARE *share= info->s;
+
+ if (share->data_length || share->index_length)
+ error= HA_ERR_CRASHED;
+ else
+ if (share->currently_disabled_keys)
+ {
+ share->keys= share->currently_disabled_keys;
+ share->currently_disabled_keys= 0;
+ }
+ return error;
+}
+
+
+/*
+ Test if indexes are disabled.
+
+ SYNOPSIS
+ heap_indexes_are_disabled()
+ info A pointer to the heap storage engine HP_INFO struct.
+
+ DESCRIPTION
+ Test if indexes are disabled.
+
+ RETURN
+ 0 indexes are not disabled
+ 1 all indexes are disabled
+ [2 non-unique indexes are disabled - NOT YET IMPLEMENTED]
+*/
+
+int heap_indexes_are_disabled(HP_INFO *info)
+{
+ HP_SHARE *share= info->s;
+
+ return (! share->keys && share->currently_disabled_keys);
+}
+
diff --git a/heap/hp_hash.c b/heap/hp_hash.c
index d040f37aea0..38ed581fe58 100644
--- a/heap/hp_hash.c
+++ b/heap/hp_hash.c
@@ -29,19 +29,15 @@
hp_rb_records_in_range()
info HEAP handler
inx Index to use
- start_key Start of range. Null pointer if from first key
- start_key_len Length of start key
- start_search_flag Flag if start key should be included or not
- end_key End of range. Null pointer if to last key
- end_key_len Length of end key
- end_search_flag Flag if start key should be included or not
+ min_key Min key. Is = 0 if no min range
+ max_key Max key. Is = 0 if no max range
NOTES
- start_search_flag can have one of the following values:
+ min_key.flag can have one of the following values:
HA_READ_KEY_EXACT Include the key in the range
HA_READ_AFTER_KEY Don't include key in range
- end_search_flag can have one of the following values:
+ max_key.flag can have one of the following values:
HA_READ_BEFORE_KEY Don't include key in range
HA_READ_AFTER_KEY Include all 'end_key' values in the range
@@ -52,11 +48,8 @@
the range.
*/
-ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key,
- uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key, uint end_key_len,
- enum ha_rkey_function end_search_flag)
+ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key,
+ key_range *max_key)
{
ha_rows start_pos, end_pos;
HP_KEYDEF *keyinfo= info->s->keydef + inx;
@@ -67,12 +60,12 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key,
info->lastinx= inx;
custom_arg.keyseg= keyinfo->seg;
custom_arg.search_flag= SEARCH_FIND | SEARCH_SAME;
- if (start_key)
+ if (min_key)
{
custom_arg.key_length= hp_rb_pack_key(keyinfo, (uchar*) info->recbuf,
- (uchar*) start_key,
- start_key_len);
- start_pos= tree_record_pos(rb_tree, info->recbuf, start_search_flag,
+ (uchar*) min_key->key,
+ min_key->length);
+ start_pos= tree_record_pos(rb_tree, info->recbuf, min_key->flag,
&custom_arg);
}
else
@@ -80,11 +73,12 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key,
start_pos= 0;
}
- if (end_key)
+ if (max_key)
{
custom_arg.key_length= hp_rb_pack_key(keyinfo, (uchar*) info->recbuf,
- (uchar*) end_key, end_key_len);
- end_pos= tree_record_pos(rb_tree, info->recbuf, end_search_flag,
+ (uchar*) max_key->key,
+ max_key->length);
+ end_pos= tree_record_pos(rb_tree, info->recbuf, max_key->flag,
&custom_arg);
}
else
@@ -100,12 +94,13 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key,
(end_pos == start_pos ? (ha_rows) 1 : end_pos - start_pos));
}
+
/* Search after a record based on a key */
/* Sets info->current_ptr to found record */
/* next_flag: Search=0, next=1, prev =2, same =3 */
byte *hp_search(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *key,
- uint nextflag)
+ uint nextflag)
{
reg1 HASH_INFO *pos,*prev_ptr;
int flag;
diff --git a/include/config-netware.h b/include/config-netware.h
index 6a7f6291e26..c4e63056353 100644
--- a/include/config-netware.h
+++ b/include/config-netware.h
@@ -35,7 +35,7 @@
#include <pthread.h>
#include <termios.h>
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -45,12 +45,18 @@ extern "C" {
#undef HAVE_SCHED_H
#undef HAVE_SYS_MMAN_H
#undef HAVE_SYNCH_H
-#undef HAVE_CRYPT
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#define HAVE_PTHREAD_SIGMASK 1
#define HAVE_PTHREAD_YIELD_ZERO_ARG 1
#define HAVE_BROKEN_REALPATH 1
+/* no libc crypt() function */
+#ifdef HAVE_OPENSSL
+ #define HAVE_CRYPT 1
+#else
+ #undef HAVE_CRYPT
+#endif /* HAVE_OPENSSL */
+
/* include the old function apis */
#define USE_OLD_FUNCTIONS 1
@@ -66,6 +72,9 @@ extern "C" {
/* signal by closing the sockets */
#define SIGNAL_WITH_VIO_CLOSE 1
+/* On NetWare, stack grows towards lower address*/
+#define STACK_DIRECTION -1
+
/* default directory information */
#define DEFAULT_MYSQL_HOME "sys:/mysql"
#define PACKAGE "mysql"
@@ -87,15 +96,20 @@ extern "C" {
/* do not use the extended time in LibC sys\stat.h */
#define _POSIX_SOURCE
-/* kernal call on NetWare that will only yield if our time slice is up */
+/* Kernel call on NetWare that will only yield if our time slice is up */
void kYieldIfTimeSliceUp(void);
-/* some macros for portability */
-#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=(SEC); (ABSTIME).tv_nsec=0; }
+/* Some macros for portability */
+
+#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time(NULL)+(SEC); (ABSTIME).tv_nsec=0; }
-#ifdef __cplusplus
+/* extra protection against CPU Hogs on NetWare */
+#define NETWARE_YIELD kYieldIfTimeSliceUp()
+/* Screen mode for help texts */
+#define NETWARE_SET_SCREEN_MODE(A) setscreenmode(A)
+
+#ifdef __cplusplus
}
#endif
#endif /* _config_netware_h */
-
diff --git a/include/heap.h b/include/heap.h
index c5f2be81fb7..63f2abbabc7 100644
--- a/include/heap.h
+++ b/include/heap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000,2004 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -107,6 +107,7 @@ typedef struct st_heap_share
uint reclength; /* Length of one record */
uint changed;
uint keys,max_key_length;
+ uint currently_disabled_keys; /* saved value from "keys" when disabled */
uint open_count;
byte *del_link; /* Link to next block with del. rec */
my_string name; /* Name of "memory-file" */
@@ -176,12 +177,13 @@ extern int heap_rprev(HP_INFO *info,byte *record);
extern int heap_rfirst(HP_INFO *info,byte *record,int inx);
extern int heap_rlast(HP_INFO *info,byte *record,int inx);
extern void heap_clear(HP_INFO *info);
+extern void heap_clear_keys(HP_INFO *info);
+extern int heap_disable_indexes(HP_INFO *info);
+extern int heap_enable_indexes(HP_INFO *info);
+extern int heap_indexes_are_disabled(HP_INFO *info);
extern void heap_update_auto_increment(HP_INFO *info, const byte *record);
-ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key,
- uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key, uint end_key_len,
- enum ha_rkey_function end_search_flag);
+ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key,
+ key_range *max_key);
int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
uint key_len, enum ha_rkey_function find_flag);
extern gptr heap_find(HP_INFO *info,int inx,const byte *key);
diff --git a/include/help_end.h b/include/help_end.h
new file mode 100644
index 00000000000..a63d9e7ca9f
--- /dev/null
+++ b/include/help_end.h
@@ -0,0 +1,6 @@
+#ifdef __NETWARE__
+#undef printf
+#undef puts
+#undef fputs
+#undef putchar
+#endif
diff --git a/include/help_start.h b/include/help_start.h
new file mode 100644
index 00000000000..38bb91f7655
--- /dev/null
+++ b/include/help_start.h
@@ -0,0 +1,7 @@
+/* Divert all help information on NetWare to logger screen. */
+
+#ifdef __NETWARE__
+#define printf consoleprintf
+#define puts(s) consoleprintf("%s\n",s)
+#define fputs(s,f) puts(s)
+#endif
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 9e69a3c8f91..9502805b017 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -188,7 +188,7 @@ typedef struct my_charset_handler_st
} MY_CHARSET_HANDLER;
extern MY_CHARSET_HANDLER my_charset_8bit_handler;
-
+extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
typedef struct charset_info_st
@@ -204,6 +204,7 @@ typedef struct charset_info_st
uchar *to_lower;
uchar *to_upper;
uchar *sort_order;
+ uint16 **sort_order_big;
uint16 *tab_to_uni;
MY_UNI_IDX *tab_from_uni;
uchar state_map[256];
diff --git a/include/m_string.h b/include/m_string.h
index c86801ae2d2..371e20d130f 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -238,6 +238,7 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error);
#if SIZEOF_LONG == SIZEOF_LONG_LONG
#define longlong2str(A,B,C) int2str((A),(B),(C))
#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C))
+#undef strtoll
#define strtoll(A,B,C) strtol((A),(B),(C))
#define strtoull(A,B,C) strtoul((A),(B),(C))
#ifndef HAVE_STRTOULL
diff --git a/include/my_base.h b/include/my_base.h
index 54c739bde23..f912cb4278c 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -191,7 +191,7 @@ enum ha_base_keytype {
#define HA_UNIQUE_CHECK 256 /* Check the key for uniqueness */
#define HA_SPATIAL 1024 /* For spatial search */
#define HA_NULL_ARE_EQUAL 2048 /* NULL in key are cmp as equal */
-
+#define HA_GENERATED_KEY 8192 /* Automaticly generated key */
/* Automatic bits in key-flag */
@@ -349,6 +349,16 @@ enum data_file_type {
STATIC_RECORD,DYNAMIC_RECORD,COMPRESSED_RECORD
};
+/* For key ranges */
+
+typedef struct st_key_range
+{
+ const byte *key;
+ uint length;
+ enum ha_rkey_function flag;
+} key_range;
+
+
/* For number of records */
#ifdef BIG_TABLES
#define rows2double(A) ulonglong2double(A)
diff --git a/include/my_bitmap.h b/include/my_bitmap.h
index 5b3da011f54..a4511bf3414 100644
--- a/include/my_bitmap.h
+++ b/include/my_bitmap.h
@@ -55,6 +55,12 @@ extern void bitmap_set_bit(MY_BITMAP *map, uint bitmap_bit);
extern void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size);
extern void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2);
+
+/* Fast, not thread safe, bitmap functions */
+#define bitmap_fast_set_bit(MAP, BIT) (MAP)->bitmap[(BIT) / 8] |= (1 << ((BIT) & 7))
+#define bitmap_fast_clear_bit(MAP, BIT) (MAP)->bitmap[(BIT) / 8] &= ~ (1 << ((BIT) & 7))
+#define bitmap_fast_is_set(MAP, BIT) (MAP)->bitmap[(BIT) / 8] & (1 << ((BIT) & 7))
+
#ifdef __cplusplus
}
#endif
diff --git a/include/my_global.h b/include/my_global.h
index 760b196ca8d..af58139fb29 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -73,11 +73,10 @@
#endif
#endif /* _WIN32... */
-/* extra protection against CPU Hogs on NetWare */
-#ifdef __NETWARE__
- #define NETWARE_YIELD { kYieldIfTimeSliceUp(); }
-#else
- #define NETWARE_YIELD { }
+/* Some defines to avoid ifdefs in the code */
+#ifndef NETWARE_YIELD
+#define NETWARE_YIELD
+#define NETWARE_SET_SCREEN_MODE(A)
#endif
/*
@@ -345,6 +344,9 @@ C_MODE_END
#define USE_BMOVE512 1 /* Use this unless system bmove is faster */
#endif
+#define QUOTE_ARG(x) #x /* Quote argument (before cpp) */
+#define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */
+
/* Paranoid settings. Define I_AM_PARANOID if you are paranoid */
#ifdef I_AM_PARANOID
#define DONT_ALLOW_USER_CHANGE 1
@@ -389,7 +391,7 @@ typedef unsigned short ushort;
#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
#define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0)
-#define swap(t,a,b) { register t dummy; dummy = a; a = b; b = dummy; }
+#define swap_variables(t, a, b) { register t dummy; dummy= a; a= b; b= dummy; }
#define test(a) ((a) ? 1 : 0)
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
diff --git a/include/my_sys.h b/include/my_sys.h
index 89dee5b713d..e05df3b6a07 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -770,6 +770,8 @@ extern char *get_charsets_dir(char *buf);
extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
extern my_bool init_compiled_charsets(myf flags);
extern void add_compiled_collation(CHARSET_INFO *cs);
+extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to,
+ const char *from, ulong length);
#ifdef __WIN__
extern my_bool have_tcpip; /* Is set if tcpip is used */
diff --git a/include/myisam.h b/include/myisam.h
index 93e2dc15574..c99e9a30b08 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -231,10 +231,7 @@ extern int mi_extra(struct st_myisam_info *file,
enum ha_extra_function function,
void *extra_arg);
extern ha_rows mi_records_in_range(struct st_myisam_info *info,int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag);
+ key_range *min_key, key_range *max_key);
extern int mi_log(int activate_log);
extern int mi_is_changed(struct st_myisam_info *info);
extern int mi_delete_all_rows(struct st_myisam_info *info);
diff --git a/include/myisammrg.h b/include/myisammrg.h
index 8b09e1a9231..de8a36c2d0a 100644
--- a/include/myisammrg.h
+++ b/include/myisammrg.h
@@ -101,10 +101,7 @@ extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function,
void *extra_arg);
extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv);
extern ha_rows myrg_records_in_range(MYRG_INFO *info,int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag);
+ key_range *min_key, key_range *max_key);
extern ulonglong myrg_position(MYRG_INFO *info);
#ifdef __cplusplus
diff --git a/include/mysql.h b/include/mysql.h
index 537467336f8..51540a7d89f 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -188,10 +188,11 @@ struct st_mysql_options {
my_bool secure_auth;
/* function pointers for local infile support */
- int (*local_infile_init)(void **, const char *);
+ int (*local_infile_init)(void **, const char *, void *);
int (*local_infile_read)(void *, char *, unsigned int);
void (*local_infile_end)(void *);
int (*local_infile_error)(void *, char *, unsigned int);
+ void *local_infile_userdata;
};
enum mysql_status
@@ -397,12 +398,14 @@ my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
void
mysql_set_local_infile_handler(MYSQL *mysql,
- int (*local_infile_init)(void **, const char *),
+ int (*local_infile_init)(void **, const char *,
+ void *),
int (*local_infile_read)(void *, char *,
unsigned int),
void (*local_infile_end)(void *),
int (*local_infile_error)(void *, char*,
- unsigned int));
+ unsigned int),
+ void *);
void
mysql_set_local_infile_default(MYSQL *mysql);
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 9604f4c0b59..b4947a64236 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -36,6 +36,12 @@
#define MYSQL_SERVICENAME "MySQL"
#endif /* __WIN__ */
+#if defined(__WIN__) && !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT) && !defined(EMBEDDED_LIBRARY)
+#define dll_import_spec __declspec( dllimport )
+#else
+#define dll_import_spec
+#endif
+
enum enum_server_command
{
COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
@@ -311,8 +317,8 @@ typedef struct st_udf_init
extern "C" {
#endif
-extern unsigned long max_allowed_packet;
-extern unsigned long net_buffer_length;
+dll_import_spec extern unsigned long max_allowed_packet;
+dll_import_spec extern unsigned long net_buffer_length;
/*
These functions are used for authentication by client and server and
@@ -364,6 +370,6 @@ char *net_store_length(char *pkg, ulonglong length);
#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */
#define MYSQL_STMT_HEADER 4
-#define MYSQL_LONG_DATA_HEADER 6
+#define MYSQL_LONG_DATA_HEADER 6
#endif
diff --git a/include/mysql_embed.h b/include/mysql_embed.h
index 8e65087c566..603af8e83b8 100644
--- a/include/mysql_embed.h
+++ b/include/mysql_embed.h
@@ -30,7 +30,4 @@
#define DONT_USE_RAID
-#undef MYSQL_SERVER_SUFFIX
-#define MYSQL_SERVER_SUFFIX "-embedded"
-
#endif /* EMBEDDED_LIBRARY */
diff --git a/include/mysql_version.h.in b/include/mysql_version.h.in
index c440c1298d4..dac7ca661d1 100644
--- a/include/mysql_version.h.in
+++ b/include/mysql_version.h.in
@@ -11,9 +11,7 @@
#define PROTOCOL_VERSION @PROTOCOL_VERSION@
#define MYSQL_SERVER_VERSION "@VERSION@"
#define MYSQL_BASE_VERSION "mysqld-@MYSQL_BASE_VERSION@"
-#ifndef MYSQL_SERVER_SUFFIX
-#define MYSQL_SERVER_SUFFIX "@MYSQL_SERVER_SUFFIX@"
-#endif
+#define MYSQL_SERVER_SUFFIX_DEF "@MYSQL_SERVER_SUFFIX@"
#define FRM_VER @DOT_FRM_VERSION@
#define MYSQL_VERSION_ID @MYSQL_VERSION_ID@
#define MYSQL_PORT @MYSQL_TCP_PORT@
@@ -25,7 +23,7 @@
#endif /* _CUSTOMCONFIG_ */
#ifndef LICENSE
-#define LICENSE "GPL"
+#define LICENSE GPL
#endif /* LICENSE */
#endif /* _mysql_version_h */
diff --git a/include/thr_alarm.h b/include/thr_alarm.h
index 0dbb700b4fc..7a10d6886ce 100644
--- a/include/thr_alarm.h
+++ b/include/thr_alarm.h
@@ -64,7 +64,7 @@ typedef my_bool ALARM;
#define init_thr_alarm(A)
#define thr_alarm_kill(A)
#define resize_thr_alarm(N)
-#define end_thr_alarm()
+#define end_thr_alarm(A)
#else
#if defined(__WIN__)
diff --git a/include/violite.h b/include/violite.h
index e8f30288d34..b4b9f724d89 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -55,14 +55,8 @@ int vio_close_pipe(Vio * vio);
void vio_delete(Vio* vio);
int vio_close(Vio* vio);
-
-#ifdef EMBEDDED_LIBRARY
-void vio_reset(Vio *vio);
-#else
-void vio_reset(Vio* vio, enum enum_vio_type type,
- my_socket sd, HANDLE hPipe, my_bool localhost);
-#endif
-
+void vio_reset(Vio* vio, enum enum_vio_type type,
+ my_socket sd, HANDLE hPipe, my_bool localhost);
int vio_read(Vio *vio, gptr buf, int size);
int vio_write(Vio *vio, const gptr buf, int size);
int vio_blocking(Vio *vio, my_bool onoff, my_bool *old_mode);
diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c
index 8388009dc9c..09f5c66f687 100644
--- a/innobase/btr/btr0btr.c
+++ b/innobase/btr/btr0btr.c
@@ -883,7 +883,7 @@ btr_page_reorganize_low(
fprintf(stderr,
"InnoDB: Error: page old data size %lu new data size %lu\n"
"InnoDB: Error: page old max ins size %lu new max ins size %lu\n"
-"InnoDB: Make a detailed bug report and send it to mysql@lists.mysql.com\n",
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n",
(unsigned long) data_size1, (unsigned long) data_size2,
(unsigned long) max_ins_size1,
(unsigned long) max_ins_size2);
diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c
index e67d1d76113..5829cc2c406 100644
--- a/innobase/btr/btr0cur.c
+++ b/innobase/btr/btr0cur.c
@@ -399,7 +399,7 @@ btr_cur_search_to_nth_level(
retry_page_get:
page = buf_page_get_gen(space, page_no, rw_latch, guess,
buf_mode,
- IB__FILE__, __LINE__,
+ __FILE__, __LINE__,
mtr);
if (page == NULL) {
/* This must be a search to perform an insert;
@@ -580,7 +580,7 @@ btr_cur_open_at_index_side(
for (;;) {
page = buf_page_get_gen(space, page_no, RW_NO_LATCH, NULL,
BUF_GET,
- IB__FILE__, __LINE__,
+ __FILE__, __LINE__,
mtr);
ut_ad(0 == ut_dulint_cmp(tree->id,
btr_page_get_index_id(page)));
@@ -689,7 +689,7 @@ btr_cur_open_at_rnd_pos(
for (;;) {
page = buf_page_get_gen(space, page_no, RW_NO_LATCH, NULL,
BUF_GET,
- IB__FILE__, __LINE__,
+ __FILE__, __LINE__,
mtr);
ut_ad(0 == ut_dulint_cmp(tree->id,
btr_page_get_index_id(page)));
diff --git a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c
index f2b03f9f348..9384168df88 100644
--- a/innobase/btr/btr0sea.c
+++ b/innobase/btr/btr0sea.c
@@ -764,7 +764,7 @@ btr_search_guess_on_hash(
success = buf_page_get_known_nowait(latch_mode, page,
BUF_MAKE_YOUNG,
- IB__FILE__, __LINE__,
+ __FILE__, __LINE__,
mtr);
rw_lock_s_unlock(&btr_search_latch);
@@ -1048,7 +1048,7 @@ btr_search_drop_page_hash_when_freed(
having to fear a deadlock. */
page = buf_page_get_gen(space, page_no, RW_S_LATCH, NULL,
- BUF_GET_IF_IN_POOL, IB__FILE__, __LINE__,
+ BUF_GET_IF_IN_POOL, __FILE__, __LINE__,
&mtr);
#ifdef UNIV_SYNC_DEBUG
diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c
index 7a5ef3c5e14..4d83fb4c9f2 100644
--- a/innobase/buf/buf0buf.c
+++ b/innobase/buf/buf0buf.c
@@ -1048,7 +1048,7 @@ buf_page_get_gen(
buf_frame_t* guess, /* in: guessed frame or NULL */
ulint mode, /* in: BUF_GET, BUF_GET_IF_IN_POOL,
BUF_GET_NO_LATCH, BUF_GET_NOWAIT */
- char* file, /* in: file name */
+ const char* file, /* in: file name */
ulint line, /* in: line where called */
mtr_t* mtr) /* in: mini-transaction */
{
@@ -1257,7 +1257,7 @@ buf_page_optimistic_get_func(
frames */
dulint modify_clock,/* in: modify clock value if mode is
..._GUESS_ON_CLOCK */
- char* file, /* in: file name */
+ const char* file, /* in: file name */
ulint line, /* in: line where called */
mtr_t* mtr) /* in: mini-transaction */
{
@@ -1382,7 +1382,7 @@ buf_page_get_known_nowait(
ulint rw_latch,/* in: RW_S_LATCH, RW_X_LATCH */
buf_frame_t* guess, /* in: the known page frame */
ulint mode, /* in: BUF_MAKE_YOUNG or BUF_KEEP_OLD */
- char* file, /* in: file name */
+ const char* file, /* in: file name */
ulint line, /* in: line where called */
mtr_t* mtr) /* in: mini-transaction */
{
@@ -1742,7 +1742,7 @@ buf_page_create(
buf_LRU_add_block(block, FALSE);
#ifdef UNIV_SYNC_DEBUG
- buf_block_buf_fix_inc_debug(block, IB__FILE__, __LINE__);
+ buf_block_buf_fix_inc_debug(block, __FILE__, __LINE__);
#else
buf_block_buf_fix_inc(block);
#endif
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index b22d93d6bd8..6a6ac2492f8 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -70,7 +70,7 @@ dict_col_reposition_in_cache(
/*=========================*/
dict_table_t* table, /* in: table */
dict_col_t* col, /* in: column */
- char* new_name); /* in: new table name */
+ const char* new_name); /* in: new table name */
/**************************************************************************
Removes a column from the data dictionary hash table. */
static
@@ -309,7 +309,7 @@ dict_table_get_index_noninline(
/*===========================*/
/* out: index, NULL if does not exist */
dict_table_t* table, /* in: table */
- char* name) /* in: index name */
+ const char* name) /* in: index name */
{
return(dict_table_get_index(table, name));
}
@@ -693,9 +693,10 @@ directory dict_table_get_low is usually the appropriate function. */
dict_table_t*
dict_table_get(
/*===========*/
- /* out: table, NULL if does not exist */
- char* table_name, /* in: table name */
- trx_t* trx) /* in: transaction handle or NULL */
+ /* out: table, NULL if
+ does not exist */
+ const char* table_name, /* in: table name */
+ trx_t* trx) /* in: transaction handle or NULL */
{
dict_table_t* table;
@@ -722,9 +723,10 @@ Returns a table object and increments MySQL open handle count on the table. */
dict_table_t*
dict_table_get_and_increment_handle_count(
/*======================================*/
- /* out: table, NULL if does not exist */
- char* table_name, /* in: table name */
- trx_t* trx) /* in: transaction handle or NULL */
+ /* out: table, NULL if
+ does not exist */
+ const char* table_name, /* in: table name */
+ trx_t* trx) /* in: transaction handle or NULL */
{
dict_table_t* table;
@@ -886,7 +888,7 @@ dict_table_rename_in_cache(
/*=======================*/
/* out: TRUE if success */
dict_table_t* table, /* in: table */
- char* new_name, /* in: new name */
+ const char* new_name, /* in: new name */
ibool rename_also_foreigns)/* in: in ALTER TABLE we want
to preserve the original table name
in constraints which reference it */
@@ -1294,7 +1296,7 @@ dict_col_reposition_in_cache(
/*=========================*/
dict_table_t* table, /* in: table */
dict_col_t* col, /* in: column */
- char* new_name) /* in: new table name */
+ const char* new_name) /* in: new table name */
{
ulint fold;
@@ -2019,7 +2021,7 @@ dict_foreign_find_index(
column types must match */
{
dict_index_t* index;
- char* col_name;
+ const char* col_name;
ulint i;
index = dict_table_get_first_index(table);
@@ -2564,14 +2566,14 @@ static
char*
dict_strip_comments(
/*================*/
- /* out, own: SQL string stripped from
- comments; the caller must free this
- with mem_free()! */
- char* sql_string) /* in: SQL string */
+ /* out, own: SQL string stripped from
+ comments; the caller must free this
+ with mem_free()! */
+ const char* sql_string) /* in: SQL string */
{
- char* str;
- char* sptr;
- char* ptr;
+ char* str;
+ const char* sptr;
+ char* ptr;
str = mem_alloc(strlen(sql_string) + 1);
@@ -2970,7 +2972,8 @@ col_loop1:
}
foreign->foreign_table = table;
- foreign->foreign_table_name = table->name;
+ foreign->foreign_table_name = mem_heap_strdup(foreign->heap,
+ table->name);
foreign->foreign_index = index;
foreign->n_fields = i;
foreign->foreign_col_names = mem_heap_alloc(foreign->heap,
@@ -3244,16 +3247,19 @@ allowed to contain more fields than mentioned in the constraint. */
ulint
dict_create_foreign_constraints(
/*============================*/
- /* out: error code or DB_SUCCESS */
- trx_t* trx, /* in: transaction */
- char* sql_string, /* in: table create or ALTER TABLE
- statement where foreign keys are declared like:
- FOREIGN KEY (a, b) REFERENCES table2(c, d),
- table2 can be written also with the database
- name before it: test.table2; the default
- database is the database of parameter name */
- char* name) /* in: table full name in the normalized form
- database_name/table_name */
+ /* out: error code or DB_SUCCESS */
+ trx_t* trx, /* in: transaction */
+ const char* sql_string, /* in: table create statement where
+ foreign keys are declared like:
+ FOREIGN KEY (a, b) REFERENCES
+ table2(c, d), table2 can be written
+ also with the database
+ name before it: test.table2; the
+ default database id the database of
+ parameter name */
+ const char* name) /* in: table full name in the
+ normalized form
+ database_name/table_name */
{
char* str;
ulint err;
@@ -4287,5 +4293,5 @@ dict_index_name_print(
fputs("index ", file);
ut_print_name(file, index->name);
fputs(" of table ", file);
- ut_print_name(stderr, index->table_name);
+ ut_print_name(file, index->table_name);
}
diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c
index abb06b15ea7..071a3b4c684 100644
--- a/innobase/dict/dict0load.c
+++ b/innobase/dict/dict0load.c
@@ -27,9 +27,10 @@ Finds the first table name in the given database. */
char*
dict_get_first_table_name_in_db(
/*============================*/
- /* out, own: table name, NULL if does not exist;
- the caller must free the memory in the string! */
- char* name) /* in: database name which ends to '/' */
+ /* out, own: table name, NULL if
+ does not exist; the caller must
+ free the memory in the string! */
+ const char* name) /* in: database name which ends to '/' */
{
dict_table_t* sys_tables;
btr_pcur_t pcur;
@@ -389,8 +390,8 @@ Report that an index field or index for a table has been delete marked. */
static
void
dict_load_report_deleted_index(
- char* name, /* in: table name */
- ulint field) /* in: index field, or ULINT_UNDEFINED */
+ const char* name, /* in: table name */
+ ulint field) /* in: index field, or ULINT_UNDEFINED */
{
fputs("InnoDB: Error: data dictionary entry"
" for table ", stderr);
@@ -688,12 +689,13 @@ dictionary cache. */
dict_table_t*
dict_load_table(
/*============*/
- /* out: table, NULL if does not exist; if the table is
- stored in an .ibd file, but the file does not exist,
- then we set the ibd_file_missing flag TRUE in the table
- object we return */
- char* name) /* in: table name in the databasename/tablename
- format */
+ /* out: table, NULL if does not exist;
+ if the table is stored in an .ibd file,
+ but the file does not exist,
+ then we set the ibd_file_missing flag TRUE
+ in the table object we return */
+ const char* name) /* in: table name in the
+ databasename/tablename format */
{
ibool ibd_file_missing = FALSE;
dict_table_t* table;
@@ -849,7 +851,7 @@ dict_load_table(
"InnoDB: the foreign key table or the referenced table!\n"
"InnoDB: The data dictionary of InnoDB is corrupt. You may need to drop\n"
"InnoDB: and recreate the foreign key table or the referenced table.\n"
-"InnoDB: Send a detailed bug report to mysql@lists.mysql.com\n"
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n"
"InnoDB: Latest foreign key error printout:\n%s\n", dict_foreign_err_buf);
mutex_exit(&dict_foreign_err_mutex);
@@ -1185,8 +1187,8 @@ already in the dictionary cache. */
ulint
dict_load_foreigns(
/*===============*/
- /* out: DB_SUCCESS or error code */
- char* table_name) /* in: table name */
+ /* out: DB_SUCCESS or error code */
+ const char* table_name) /* in: table name */
{
btr_pcur_t pcur;
mem_heap_t* heap;
diff --git a/innobase/dict/dict0mem.c b/innobase/dict/dict0mem.c
index a4f83ddd657..936b06b1905 100644
--- a/innobase/dict/dict0mem.c
+++ b/innobase/dict/dict0mem.c
@@ -30,15 +30,14 @@ dict_table_t*
dict_mem_table_create(
/*==================*/
/* out, own: table object */
- char* name, /* in: table name */
- ulint space, /* in: space where the clustered index of
+ const char* name, /* in: table name */
+ ulint space, /* in: space where the clustered index of
the table is placed; this parameter is
ignored if the table is made a member of
a cluster */
- ulint n_cols) /* in: number of columns */
+ ulint n_cols) /* in: number of columns */
{
dict_table_t* table;
- char* str;
mem_heap_t* heap;
ut_ad(name);
@@ -48,11 +47,9 @@ dict_mem_table_create(
table = mem_heap_alloc(heap, sizeof(dict_table_t));
table->heap = heap;
-
- str = mem_heap_strdup(heap, name);
table->type = DICT_TABLE_ORDINARY;
- table->name = str;
+ table->name = mem_heap_strdup(heap, name);
table->space = space;
table->ibd_file_missing = FALSE;
table->tablespace_discarded = FALSE;
@@ -103,11 +100,11 @@ dict_table_t*
dict_mem_cluster_create(
/*====================*/
/* out, own: cluster object */
- char* name, /* in: cluster name */
- ulint space, /* in: space where the clustered indexes
+ const char* name, /* in: cluster name */
+ ulint space, /* in: space where the clustered indexes
of the member tables are placed */
- ulint n_cols, /* in: number of columns */
- ulint mix_len) /* in: length of the common key prefix in the
+ ulint n_cols, /* in: number of columns */
+ ulint mix_len)/* in: length of the common key prefix in the
cluster */
{
dict_table_t* cluster;
@@ -127,7 +124,7 @@ void
dict_mem_table_make_cluster_member(
/*===============================*/
dict_table_t* table, /* in: non-published table */
- char* cluster_name) /* in: cluster name */
+ const char* cluster_name) /* in: cluster name */
{
table->type = DICT_TABLE_CLUSTER_MEMBER;
table->cluster_name = cluster_name;
@@ -140,7 +137,7 @@ void
dict_mem_table_add_col(
/*===================*/
dict_table_t* table, /* in: table */
- char* name, /* in: column name */
+ const char* name, /* in: column name */
ulint mtype, /* in: main datatype */
ulint prtype, /* in: precise type */
ulint len, /* in: length */
@@ -174,14 +171,15 @@ Creates an index memory object. */
dict_index_t*
dict_mem_index_create(
/*==================*/
- /* out, own: index object */
- char* table_name, /* in: table name */
- char* index_name, /* in: index name */
- ulint space, /* in: space where the index tree is placed,
- ignored if the index is of the clustered
- type */
- ulint type, /* in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed */
- ulint n_fields) /* in: number of fields */
+ /* out, own: index object */
+ const char* table_name, /* in: table name */
+ const char* index_name, /* in: index name */
+ ulint space, /* in: space where the index tree is
+ placed, ignored if the index is of
+ the clustered type */
+ ulint type, /* in: DICT_UNIQUE,
+ DICT_CLUSTERED, ... ORed */
+ ulint n_fields) /* in: number of fields */
{
dict_index_t* index;
mem_heap_t* heap;
@@ -259,7 +257,7 @@ void
dict_mem_index_add_field(
/*=====================*/
dict_index_t* index, /* in: index */
- char* name, /* in: column name */
+ const char* name, /* in: column name */
ulint order, /* in: order criterion; 0 means an
ascending order */
ulint prefix_len) /* in: 0 or the column prefix length
diff --git a/innobase/eval/eval0eval.c b/innobase/eval/eval0eval.c
index a3cd60b86ae..ebb6cb1b7d9 100644
--- a/innobase/eval/eval0eval.c
+++ b/innobase/eval/eval0eval.c
@@ -725,7 +725,7 @@ eval_predefined(
uint_val = (ulint) int_val;
}
for (tmp = int_len; uint_val > 0; uint_val /= 10) {
- data[--tmp] = '0' + (byte)(uint_val % 10);
+ data[--tmp] = (byte) ('0' + (byte)(uint_val % 10));
}
}
diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c
index b9aff246802..28eea0ba188 100644
--- a/innobase/fil/fil0fil.c
+++ b/innobase/fil/fil0fil.c
@@ -390,11 +390,12 @@ Appends a new file to the chain of files of a space. File must be closed. */
void
fil_node_create(
/*============*/
- char* name, /* in: file name (file must be closed) */
- ulint size, /* in: file size in database blocks, rounded downwards
- to an integer */
- ulint id, /* in: space id where to append */
- ibool is_raw) /* in: TRUE if a raw device or a raw disk partition */
+ const char* name, /* in: file name (file must be closed) */
+ ulint size, /* in: file size in database blocks, rounded
+ downwards to an integer */
+ ulint id, /* in: space id where to append */
+ ibool is_raw) /* in: TRUE if a raw device or
+ a raw disk partition */
{
fil_system_t* system = fil_system;
fil_node_t* node;
@@ -804,10 +805,10 @@ there is an error, prints an error message to the .err log. */
ibool
fil_space_create(
/*=============*/
- /* out: TRUE if success */
- char* name, /* in: space name */
- ulint id, /* in: space id */
- ulint purpose)/* in: FIL_TABLESPACE, or FIL_LOG if log */
+ /* out: TRUE if success */
+ const char* name, /* in: space name */
+ ulint id, /* in: space id */
+ ulint purpose)/* in: FIL_TABLESPACE, or FIL_LOG if log */
{
fil_system_t* system = fil_system;
fil_space_t* space;
@@ -1542,16 +1543,18 @@ static
void
fil_op_write_log(
/*=============*/
- ulint type, /* in: MLOG_FILE_CREATE, MLOG_FILE_DELETE, or
- MLOG_FILE_RENAME */
- ulint space_id, /* in: space id */
- char* name, /* in: table name in the familiar
- 'databasename/tablename' format, or the file
- path in the case of MLOG_FILE_DELETE */
- char* new_name, /* in: if type is MLOG_FILE_RENAME, the new
- table name in the 'databasename/tablename'
- format */
- mtr_t* mtr) /* in: mini-transaction handle */
+ ulint type, /* in: MLOG_FILE_CREATE,
+ MLOG_FILE_DELETE, or
+ MLOG_FILE_RENAME */
+ ulint space_id, /* in: space id */
+ const char* name, /* in: table name in the familiar
+ 'databasename/tablename' format, or
+ the file path in the case of
+ MLOG_FILE_DELETE */
+ const char* new_name, /* in: if type is MLOG_FILE_RENAME,
+ the new table name in the
+ 'databasename/tablename' format */
+ mtr_t* mtr) /* in: mini-transaction handle */
{
byte* log_ptr;
@@ -1960,14 +1963,15 @@ tablespace memory cache. */
ibool
fil_rename_tablespace(
/*==================*/
- /* out: TRUE if success */
- char* old_name, /* in: old table name in the standard
- databasename/tablename format of InnoDB, or
- NULL if we do the rename based on the space
- id only */
- ulint id, /* in: space id */
- char* new_name) /* in: new table name in the standard
- databasename/tablename format of InnoDB */
+ /* out: TRUE if success */
+ const char* old_name, /* in: old table name in the standard
+ databasename/tablename format of
+ InnoDB, or NULL if we do the rename
+ based on the space id only */
+ ulint id, /* in: space id */
+ const char* new_name) /* in: new table name in the standard
+ databasename/tablename format
+ of InnoDB */
{
fil_system_t* system = fil_system;
ibool success;
@@ -2124,15 +2128,16 @@ path '.'. */
ulint
fil_create_new_single_table_tablespace(
/*===================================*/
- /* out: DB_SUCCESS or error code */
- ulint* space_id, /* in/out: space id; if this is != 0, then
- this is an input parameter, otherwise
- output */
- char* tablename, /* in: the table name in the usual
- databasename/tablename format of InnoDB */
- ulint size) /* in: the initial size of the tablespace file
- in pages, must be >= FIL_IBD_FILE_INITIAL_SIZE
- */
+ /* out: DB_SUCCESS or error code */
+ ulint* space_id, /* in/out: space id; if this is != 0,
+ then this is an input parameter,
+ otherwise output */
+ const char* tablename, /* in: the table name in the usual
+ databasename/tablename format
+ of InnoDB */
+ ulint size) /* in: the initial size of the
+ tablespace file in pages,
+ must be >= FIL_IBD_FILE_INITIAL_SIZE */
{
os_file_t file;
ibool ret;
@@ -2293,12 +2298,12 @@ lsn's just by looking at that flush lsn. */
ibool
fil_reset_too_high_lsns(
/*====================*/
- /* out: TRUE if success */
- char* name, /* in: table name in the databasename/tablename
- format */
- dulint current_lsn) /* in: reset lsn's if the lsn stamped to
- FIL_PAGE_FILE_FLUSH_LSN in the first page is
- too high */
+ /* out: TRUE if success */
+ const char* name, /* in: table name in the
+ databasename/tablename format */
+ dulint current_lsn) /* in: reset lsn's if the lsn stamped
+ to FIL_PAGE_FILE_FLUSH_LSN in the
+ first page is too high */
{
os_file_t file;
char* filepath;
@@ -2433,10 +2438,10 @@ closes it after we have looked at the space id in it. */
ibool
fil_open_single_table_tablespace(
/*=============================*/
- /* out: TRUE if success */
- ulint id, /* in: space id */
- char* name) /* in: table name in the databasename/tablename
- format */
+ /* out: TRUE if success */
+ ulint id, /* in: space id */
+ const char* name) /* in: table name in the
+ databasename/tablename format */
{
os_file_t file;
char* filepath;
@@ -2937,20 +2942,22 @@ there may be many tablespaces which are not yet in the memory cache. */
ibool
fil_space_for_table_exists_in_mem(
/*==============================*/
- /* out: TRUE if a matching tablespace exists
- in the memory cache */
- ulint id, /* in: space id */
- char* name, /* in: table name in the standard
- 'databasename/tablename' format */
- ibool mark_space, /* in: in crash recovery, at database startup
- we mark all spaces which have an associated
- table in the InnoDB data dictionary, so that
- we can print a warning about orphaned
- tablespaces */
- ibool print_error_if_does_not_exist)
- /* in: print detailed error information to
- the .err log if a matching tablespace is
- not found from memory */
+ /* out: TRUE if a matching tablespace
+ exists in the memory cache */
+ ulint id, /* in: space id */
+ const char* name, /* in: table name in the standard
+ 'databasename/tablename' format */
+ ibool mark_space, /* in: in crash recovery, at database
+ startup we mark all spaces which have
+ an associated table in the InnoDB
+ data dictionary, so that
+ we can print a warning about orphaned
+ tablespaces */
+ ibool print_error_if_does_not_exist)
+ /* in: print detailed error
+ information to the .err log if a
+ matching tablespace is not found from
+ memory */
{
fil_system_t* system = fil_system;
fil_space_t* namespace;
diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c
index ecdcf08e4c6..9246bb03138 100644
--- a/innobase/ibuf/ibuf0ibuf.c
+++ b/innobase/ibuf/ibuf0ibuf.c
@@ -2770,7 +2770,7 @@ ibuf_insert_to_index_page(
fprintf(stderr, "Bitmap bits %lu\n", (ulong) old_bits);
fputs(
-"InnoDB: Send a detailed bug report to mysql@lists.mysql.com!\n", stderr);
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
}
}
}
@@ -2833,7 +2833,7 @@ ibuf_delete_rec(
if (!success) {
fprintf(stderr,
- "InnoDB: ERROR: Send the output to mysql@lists.mysql.com\n"
+ "InnoDB: ERROR: Submit the output to http://bugs.mysql.com\n"
"InnoDB: ibuf cursor restoration fails!\n"
"InnoDB: ibuf record inserted to page %lu\n", (ulong) page_no);
fflush(stderr);
@@ -3025,8 +3025,7 @@ ibuf_merge_or_delete_for_page(
"InnoDB: We try to resolve the problem by skipping the insert buffer\n"
"InnoDB: merge for this page. Please run CHECK TABLE on your tables\n"
"InnoDB: to determine if they are corrupt after this.\n\n"
-"InnoDB: Please make a detailed bug report and send it to\n"
-"InnoDB: mysql@lists.mysql.com\n\n",
+"InnoDB: Please submit a detailed bug report to http://bugs.mysql.com\n\n",
(ulong) page_no,
(ulong) fil_page_get_type(page));
}
@@ -3042,7 +3041,7 @@ loop:
if (page) {
ibool success = buf_page_get_known_nowait(RW_X_LATCH, page,
BUF_KEEP_OLD,
- IB__FILE__, __LINE__,
+ __FILE__, __LINE__,
&mtr);
ut_a(success);
#ifdef UNIV_SYNC_DEBUG
diff --git a/innobase/include/Makefile.am b/innobase/include/Makefile.am
index 2584357e24a..5ec70da97a2 100644
--- a/innobase/include/Makefile.am
+++ b/innobase/include/Makefile.am
@@ -32,7 +32,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \
mem0dbg.h mem0dbg.ic mem0mem.h mem0mem.ic mem0pool.h \
mem0pool.ic mtr0log.h mtr0log.ic mtr0mtr.h mtr0mtr.ic \
mtr0types.h os0file.h os0proc.h os0proc.ic \
- os0shm.h os0shm.ic os0sync.h os0sync.ic os0thread.h \
+ os0sync.h os0sync.ic os0thread.h \
os0thread.ic page0cur.h page0cur.ic page0page.h \
page0page.ic page0types.h pars0grm.h pars0opt.h \
pars0opt.ic pars0pars.h pars0pars.ic pars0sym.h \
@@ -43,8 +43,8 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \
row0purge.ic row0row.h row0row.ic row0sel.h row0sel.ic \
row0types.h row0uins.h row0uins.ic row0umod.h row0umod.ic \
row0undo.h row0undo.ic row0upd.h row0upd.ic row0vers.h \
- row0vers.ic srv0que.h srv0srv.h srv0srv.ic srv0start.h \
- sync0arr.h sync0arr.ic sync0ipm.h sync0ipm.ic sync0rw.h \
+ row0vers.ic srv0srv.h srv0srv.ic srv0start.h \
+ sync0arr.h sync0arr.ic sync0rw.h \
sync0rw.ic sync0sync.h sync0sync.ic sync0types.h \
thr0loc.h thr0loc.ic trx0purge.h trx0purge.ic trx0rec.h \
trx0rec.ic trx0roll.h trx0roll.ic trx0rseg.h trx0rseg.ic \
diff --git a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h
index 6b8da886045..9590fea1276 100644
--- a/innobase/include/buf0buf.h
+++ b/innobase/include/buf0buf.h
@@ -132,7 +132,7 @@ to improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed
in LA! */
#define buf_page_get(SP, OF, LA, MTR) buf_page_get_gen(\
SP, OF, LA, NULL,\
- BUF_GET, IB__FILE__, __LINE__, MTR)
+ BUF_GET, __FILE__, __LINE__, MTR)
/******************************************************************
Use these macros to bufferfix a page with no latching. Remember not to
read the contents of the page unless you know it is safe. Do not modify
@@ -141,19 +141,19 @@ error-prone programming not to set a latch, and it should be used
with care. */
#define buf_page_get_with_no_latch(SP, OF, MTR) buf_page_get_gen(\
SP, OF, RW_NO_LATCH, NULL,\
- BUF_GET_NO_LATCH, IB__FILE__, __LINE__, MTR)
+ BUF_GET_NO_LATCH, __FILE__, __LINE__, MTR)
/******************************************************************
NOTE! The following macros should be used instead of buf_page_get_gen, to
improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed as LA! */
#define buf_page_get_nowait(SP, OF, LA, MTR) buf_page_get_gen(\
SP, OF, LA, NULL,\
- BUF_GET_NOWAIT, IB__FILE__, __LINE__, MTR)
+ BUF_GET_NOWAIT, __FILE__, __LINE__, MTR)
/******************************************************************
NOTE! The following macros should be used instead of
buf_page_optimistic_get_func, to improve debugging. Only values RW_S_LATCH and
RW_X_LATCH are allowed as LA! */
#define buf_page_optimistic_get(LA, BL, G, MC, MTR) buf_page_optimistic_get_func(\
- LA, BL, G, MC, IB__FILE__, __LINE__, MTR)
+ LA, BL, G, MC, __FILE__, __LINE__, MTR)
/************************************************************************
This is the general function used to get optimistic access to a database
page. */
@@ -168,7 +168,7 @@ buf_page_optimistic_get_func(
frames */
dulint modify_clock,/* in: modify clock value if mode is
..._GUESS_ON_CLOCK */
- char* file, /* in: file name */
+ const char* file, /* in: file name */
ulint line, /* in: line where called */
mtr_t* mtr); /* in: mini-transaction */
/************************************************************************
@@ -201,7 +201,7 @@ buf_page_get_known_nowait(
ulint rw_latch,/* in: RW_S_LATCH, RW_X_LATCH */
buf_frame_t* guess, /* in: the known page frame */
ulint mode, /* in: BUF_MAKE_YOUNG or BUF_KEEP_OLD */
- char* file, /* in: file name */
+ const char* file, /* in: file name */
ulint line, /* in: line where called */
mtr_t* mtr); /* in: mini-transaction */
/************************************************************************
@@ -217,7 +217,7 @@ buf_page_get_gen(
buf_frame_t* guess, /* in: guessed frame or NULL */
ulint mode, /* in: BUF_GET, BUF_GET_IF_IN_POOL,
BUF_GET_NO_LATCH */
- char* file, /* in: file name */
+ const char* file, /* in: file name */
ulint line, /* in: line where called */
mtr_t* mtr); /* in: mini-transaction */
/************************************************************************
diff --git a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic
index b644afcbdff..4d1173a0d7f 100644
--- a/innobase/include/buf0buf.ic
+++ b/innobase/include/buf0buf.ic
@@ -585,7 +585,7 @@ buf_page_get_release_on_io(
frame = buf_page_get_gen(space, offset, rw_latch, guess,
BUF_GET_IF_IN_POOL,
- IB__FILE__, __LINE__,
+ __FILE__, __LINE__,
mtr);
if (frame != NULL) {
diff --git a/innobase/include/data0data.h b/innobase/include/data0data.h
index 99d3c297039..e2de13d0520 100644
--- a/innobase/include/data0data.h
+++ b/innobase/include/data0data.h
@@ -86,7 +86,7 @@ void
dfield_set_data(
/*============*/
dfield_t* field, /* in: field */
- void* data, /* in: data */
+ const void* data, /* in: data */
ulint len); /* in: length or UNIV_SQL_NULL */
/**************************************************************************
Writes an SQL null field full of zeros. */
diff --git a/innobase/include/data0data.ic b/innobase/include/data0data.ic
index 697a272ccd6..0769372e16f 100644
--- a/innobase/include/data0data.ic
+++ b/innobase/include/data0data.ic
@@ -93,12 +93,12 @@ void
dfield_set_data(
/*============*/
dfield_t* field, /* in: field */
- void* data, /* in: data */
+ const void* data, /* in: data */
ulint len) /* in: length or UNIV_SQL_NULL */
{
ut_ad(field);
- field->data = data;
+ field->data = (void*) data;
field->len = len;
}
diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h
index 98636f6e1cb..fe04359d6f1 100644
--- a/innobase/include/dict0dict.h
+++ b/innobase/include/dict0dict.h
@@ -166,7 +166,7 @@ dict_table_rename_in_cache(
/*=======================*/
/* out: TRUE if success */
dict_table_t* table, /* in: table */
- char* new_name, /* in: new name */
+ const char* new_name, /* in: new name */
ibool rename_also_foreigns);/* in: in ALTER TABLE we want
to preserve the original table name
in constraints which reference it */
@@ -210,16 +210,19 @@ fields than mentioned in the constraint. */
ulint
dict_create_foreign_constraints(
/*============================*/
- /* out: error code or DB_SUCCESS */
- trx_t* trx, /* in: transaction */
- char* sql_string, /* in: table create statement where
- foreign keys are declared like:
- FOREIGN KEY (a, b) REFERENCES table2(c, d),
- table2 can be written also with the database
- name before it: test.table2; the default
- database id the database of parameter name */
- char* name); /* in: table full name in the normalized form
- database_name/table_name */
+ /* out: error code or DB_SUCCESS */
+ trx_t* trx, /* in: transaction */
+ const char* sql_string, /* in: table create statement where
+ foreign keys are declared like:
+ FOREIGN KEY (a, b) REFERENCES
+ table2(c, d), table2 can be written
+ also with the database
+ name before it: test.table2; the
+ default database id the database of
+ parameter name */
+ const char* name); /* in: table full name in the
+ normalized form
+ database_name/table_name */
/**************************************************************************
Parses the CONSTRAINT id's to be dropped in an ALTER TABLE statement. */
@@ -246,9 +249,10 @@ directory dict_table_get_low is usually the appropriate function. */
dict_table_t*
dict_table_get(
/*===========*/
- /* out: table, NULL if does not exist */
- char* table_name, /* in: table name */
- trx_t* trx); /* in: transaction handle */
+ /* out: table, NULL if
+ does not exist */
+ const char* table_name, /* in: table name */
+ trx_t* trx); /* in: transaction handle */
/**************************************************************************
Returns a table object and increments MySQL open handle count on the table.
*/
@@ -256,9 +260,10 @@ Returns a table object and increments MySQL open handle count on the table.
dict_table_t*
dict_table_get_and_increment_handle_count(
/*======================================*/
- /* out: table, NULL if does not exist */
- char* table_name, /* in: table name */
- trx_t* trx); /* in: transaction handle or NULL */
+ /* out: table, NULL if
+ does not exist */
+ const char* table_name, /* in: table name */
+ trx_t* trx); /* in: transaction handle or NULL */
/**************************************************************************
Returns a table object, based on table id, and memoryfixes it. */
@@ -290,8 +295,8 @@ UNIV_INLINE
dict_table_t*
dict_table_check_if_in_cache_low(
/*==============================*/
- /* out: table, NULL if not found */
- char* table_name); /* in: table name */
+ /* out: table, NULL if not found */
+ const char* table_name); /* in: table name */
/**************************************************************************
Gets a table; loads it to the dictionary cache if necessary. A low-level
function. */
@@ -299,8 +304,8 @@ UNIV_INLINE
dict_table_t*
dict_table_get_low(
/*===============*/
- /* out: table, NULL if not found */
- char* table_name); /* in: table name */
+ /* out: table, NULL if not found */
+ const char* table_name); /* in: table name */
/**************************************************************************
Returns an index object. */
UNIV_INLINE
@@ -309,7 +314,7 @@ dict_table_get_index(
/*=================*/
/* out: index, NULL if does not exist */
dict_table_t* table, /* in: table */
- char* name); /* in: index name */
+ const char* name); /* in: index name */
/**************************************************************************
Returns an index object. */
@@ -318,7 +323,7 @@ dict_table_get_index_noninline(
/*===========================*/
/* out: index, NULL if does not exist */
dict_table_t* table, /* in: table */
- char* name); /* in: index name */
+ const char* name); /* in: index name */
/**************************************************************************
Prints a table data. */
@@ -340,7 +345,7 @@ Prints a table data when we know the table name. */
void
dict_table_print_by_name(
/*=====================*/
- char* name);
+ const char* name);
#endif /* UNIV_DEBUG */
/**************************************************************************
Outputs info on foreign keys of a table. */
diff --git a/innobase/include/dict0dict.ic b/innobase/include/dict0dict.ic
index 57ef4b896f5..0f7cc8973db 100644
--- a/innobase/include/dict0dict.ic
+++ b/innobase/include/dict0dict.ic
@@ -536,8 +536,8 @@ UNIV_INLINE
dict_table_t*
dict_table_check_if_in_cache_low(
/*==============================*/
- /* out: table, NULL if not found */
- char* table_name) /* in: table name */
+ /* out: table, NULL if not found */
+ const char* table_name) /* in: table name */
{
dict_table_t* table;
ulint table_fold;
@@ -562,8 +562,8 @@ UNIV_INLINE
dict_table_t*
dict_table_get_low(
/*===============*/
- /* out: table, NULL if not found */
- char* table_name) /* in: table name */
+ /* out: table, NULL if not found */
+ const char* table_name) /* in: table name */
{
dict_table_t* table;
@@ -642,7 +642,7 @@ dict_table_get_index(
/*=================*/
/* out: index, NULL if does not exist */
dict_table_t* table, /* in: table */
- char* name) /* in: index name */
+ const char* name) /* in: index name */
{
dict_index_t* index = NULL;
diff --git a/innobase/include/dict0load.h b/innobase/include/dict0load.h
index f7168a0f45f..d4dccb33373 100644
--- a/innobase/include/dict0load.h
+++ b/innobase/include/dict0load.h
@@ -31,9 +31,10 @@ Finds the first table name in the given database. */
char*
dict_get_first_table_name_in_db(
/*============================*/
- /* out, own: table name, NULL if does not exist;
- the caller must free the memory in the string! */
- char* name); /* in: database name which ends to '/' */
+ /* out, own: table name, NULL if
+ does not exist; the caller must free
+ the memory in the string! */
+ const char* name); /* in: database name which ends to '/' */
/************************************************************************
Loads a table definition and also all its index definitions, and also
the cluster definition if the table is a member in a cluster. Also loads
@@ -43,11 +44,13 @@ a foreign key references columns in this table. */
dict_table_t*
dict_load_table(
/*============*/
- /* out: table, NULL if does not exist; if the table is
- stored in an .ibd file, but the file does not exist,
- then we set the ibd_file_missing flag TRUE in the table
- object we return */
- char* name); /* in: table name */
+ /* out: table, NULL if does not exist;
+ if the table is stored in an .ibd file,
+ but the file does not exist,
+ then we set the ibd_file_missing flag TRUE
+ in the table object we return */
+ const char* name); /* in: table name in the
+ databasename/tablename format */
/***************************************************************************
Loads a table object based on the table id. */
@@ -75,8 +78,8 @@ already in the dictionary cache. */
ulint
dict_load_foreigns(
/*===============*/
- /* out: DB_SUCCESS or error code */
- char* table_name); /* in: table name */
+ /* out: DB_SUCCESS or error code */
+ const char* table_name); /* in: table name */
/************************************************************************
Prints to the standard output information on all tables found in the data
dictionary system table. */
diff --git a/innobase/include/dict0mem.h b/innobase/include/dict0mem.h
index 674868c9fce..f141ea9da09 100644
--- a/innobase/include/dict0mem.h
+++ b/innobase/include/dict0mem.h
@@ -48,27 +48,28 @@ Creates a table memory object. */
dict_table_t*
dict_mem_table_create(
/*==================*/
- /* out, own: table object */
- char* name, /* in: table name */
- ulint space, /* in: space where the clustered index of
- the table is placed; this parameter is
- ignored if the table is made a member of
- a cluster */
- ulint n_cols); /* in: number of columns */
+ /* out, own: table object */
+ const char* name, /* in: table name */
+ ulint space, /* in: space where the clustered index
+ of the table is placed; this parameter
+ is ignored if the table is made
+ a member of a cluster */
+ ulint n_cols); /* in: number of columns */
/**************************************************************************
Creates a cluster memory object. */
dict_cluster_t*
dict_mem_cluster_create(
/*====================*/
- /* out, own: cluster object (where the type
- dict_cluster_t == dict_table_t) */
- char* name, /* in: cluster name */
- ulint space, /* in: space where the clustered indexes
- of the member tables are placed */
- ulint n_cols, /* in: number of columns */
- ulint mix_len); /* in: length of the common key prefix in the
- cluster */
+ /* out, own: cluster object (where the
+ type dict_cluster_t == dict_table_t) */
+ const char* name, /* in: cluster name */
+ ulint space, /* in: space where the clustered
+ indexes of the member tables are
+ placed */
+ ulint n_cols, /* in: number of columns */
+ ulint mix_len); /* in: length of the common key prefix
+ in the cluster */
/**************************************************************************
Declares a non-published table as a member in a cluster. */
@@ -76,7 +77,7 @@ void
dict_mem_table_make_cluster_member(
/*===============================*/
dict_table_t* table, /* in: non-published table */
- char* cluster_name); /* in: cluster name */
+ const char* cluster_name); /* in: cluster name */
/**************************************************************************
Adds a column definition to a table. */
@@ -84,7 +85,7 @@ void
dict_mem_table_add_col(
/*===================*/
dict_table_t* table, /* in: table */
- char* name, /* in: column name */
+ const char* name, /* in: column name */
ulint mtype, /* in: main datatype */
ulint prtype, /* in: precise type */
ulint len, /* in: length */
@@ -95,14 +96,15 @@ Creates an index memory object. */
dict_index_t*
dict_mem_index_create(
/*==================*/
- /* out, own: index object */
- char* table_name, /* in: table name */
- char* index_name, /* in: index name */
- ulint space, /* in: space where the index tree is placed,
- ignored if the index is of the clustered
- type */
- ulint type, /* in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed */
- ulint n_fields); /* in: number of fields */
+ /* out, own: index object */
+ const char* table_name, /* in: table name */
+ const char* index_name, /* in: index name */
+ ulint space, /* in: space where the index tree is
+ placed, ignored if the index is of
+ the clustered type */
+ ulint type, /* in: DICT_UNIQUE,
+ DICT_CLUSTERED, ... ORed */
+ ulint n_fields); /* in: number of fields */
/**************************************************************************
Adds a field definition to an index. NOTE: does not take a copy
of the column name if the field is a column. The memory occupied
@@ -112,7 +114,7 @@ void
dict_mem_index_add_field(
/*=====================*/
dict_index_t* index, /* in: index */
- char* name, /* in: column name */
+ const char* name, /* in: column name */
ulint order, /* in: order criterion; 0 means an
ascending order */
ulint prefix_len); /* in: 0 or the column prefix length
@@ -142,7 +144,7 @@ struct dict_col_struct{
clustered index */
ulint ord_part;/* count of how many times this column
appears in ordering fields of an index */
- char* name; /* name */
+ const char* name; /* name */
dtype_t type; /* data type */
dict_table_t* table; /* back pointer to table of this column */
ulint aux; /* this is used as an auxiliary variable
@@ -154,7 +156,7 @@ struct dict_col_struct{
/* Data structure for a field in an index */
struct dict_field_struct{
dict_col_t* col; /* pointer to the table column */
- char* name; /* name of the column */
+ const char* name; /* name of the column */
ulint order; /* flags for ordering this field:
DICT_DESCEND, ... */
ulint prefix_len; /* 0 or the length of the column
@@ -197,8 +199,8 @@ struct dict_index_struct{
dulint id; /* id of the index */
mem_heap_t* heap; /* memory heap */
ulint type; /* index type */
- char* name; /* index name */
- char* table_name; /* table name */
+ const char* name; /* index name */
+ const char* table_name; /* table name */
dict_table_t* table; /* back pointer to table */
ulint space; /* space where the index tree is placed */
ulint page_no;/* page number of the index tree root */
@@ -254,12 +256,12 @@ struct dict_foreign_struct{
or DICT_FOREIGN_ON_DELETE_SET_NULL */
char* foreign_table_name;/* foreign table name */
dict_table_t* foreign_table; /* table where the foreign key is */
- char** foreign_col_names;/* names of the columns in the
+ const char** foreign_col_names;/* names of the columns in the
foreign key */
char* referenced_table_name;/* referenced table name */
dict_table_t* referenced_table;/* table where the referenced key
is */
- char** referenced_col_names;/* names of the referenced
+ const char** referenced_col_names;/* names of the referenced
columns in the referenced table */
ulint n_fields; /* number of indexes' first fields
for which the the foreign key
@@ -295,7 +297,7 @@ struct dict_table_struct{
dulint id; /* id of the table or cluster */
ulint type; /* DICT_TABLE_ORDINARY, ... */
mem_heap_t* heap; /* memory heap */
- char* name; /* table name */
+ const char* name; /* table name */
ulint space; /* space where the clustered index of the
table is placed */
ibool ibd_file_missing;/* TRUE if this is in a single-table
@@ -363,7 +365,7 @@ struct dict_table_struct{
byte mix_id_buf[12];
/* mix id of a mixed table written in
a compressed form */
- char* cluster_name; /* if the table is a member in a
+ const char* cluster_name; /* if the table is a member in a
cluster, this is the name of the cluster */
/*----------------------*/
ibool does_not_fit_in_memory;
diff --git a/innobase/include/fil0fil.h b/innobase/include/fil0fil.h
index f7cdeb7f195..b750e9b38f2 100644
--- a/innobase/include/fil0fil.h
+++ b/innobase/include/fil0fil.h
@@ -132,11 +132,12 @@ Appends a new file to the chain of files of a space. File must be closed. */
void
fil_node_create(
/*============*/
- char* name, /* in: file name (file must be closed) */
- ulint size, /* in: file size in database blocks, rounded downwards
- to an integer */
- ulint id, /* in: space id where to append */
- ibool is_raw);/* in: TRUE if a raw device or a raw disk partition */
+ const char* name, /* in: file name (file must be closed) */
+ ulint size, /* in: file size in database blocks, rounded
+ downwards to an integer */
+ ulint id, /* in: space id where to append */
+ ibool is_raw);/* in: TRUE if a raw device or
+ a raw disk partition */
/********************************************************************
Drops files from the start of a file space, so that its size is cut by
the amount given. */
@@ -155,10 +156,10 @@ there is an error, prints an error message to the .err log. */
ibool
fil_space_create(
/*=============*/
- /* out: TRUE if success */
- char* name, /* in: space name */
- ulint id, /* in: space id */
- ulint purpose);/* in: FIL_TABLESPACE, or FIL_LOG if log */
+ /* out: TRUE if success */
+ const char* name, /* in: space name */
+ ulint id, /* in: space id */
+ ulint purpose);/* in: FIL_TABLESPACE, or FIL_LOG if log */
/***********************************************************************
Frees a space object from a the tablespace memory cache. Closes the files in
the chain but does not delete them. */
@@ -327,14 +328,15 @@ tablespace memory cache. */
ibool
fil_rename_tablespace(
/*==================*/
- /* out: TRUE if success */
- char* old_name, /* in: old table name in the standard
- databasename/tablename format of InnoDB, or
- NULL if we do the rename based on the space
- id only */
- ulint id, /* in: space id */
- char* new_name); /* in: new table name in the standard
- databasename/tablename format of InnoDB */
+ /* out: TRUE if success */
+ const char* old_name, /* in: old table name in the standard
+ databasename/tablename format of
+ InnoDB, or NULL if we do the rename
+ based on the space id only */
+ ulint id, /* in: space id */
+ const char* new_name); /* in: new table name in the standard
+ databasename/tablename format
+ of InnoDB */
/***********************************************************************
Creates a new single-table tablespace to a database directory of MySQL.
Database directories are under the 'datadir' of MySQL. The datadir is the
@@ -344,14 +346,16 @@ path '.'. */
ulint
fil_create_new_single_table_tablespace(
/*===================================*/
- /* out: DB_SUCCESS or error code */
- ulint* space_id, /* in/out: space id; if this is != 0, then
- this is an input parameter, otherwise
- output */
- char* tablename, /* in: the table name in the usual
- databasename/tablename format of InnoDB */
- ulint size); /* in: the initial size of the tablespace file
- in pages, must be > 0 */
+ /* out: DB_SUCCESS or error code */
+ ulint* space_id, /* in/out: space id; if this is != 0,
+ then this is an input parameter,
+ otherwise output */
+ const char* tablename, /* in: the table name in the usual
+ databasename/tablename format
+ of InnoDB */
+ ulint size); /* in: the initial size of the
+ tablespace file in pages,
+ must be >= FIL_IBD_FILE_INITIAL_SIZE */
/************************************************************************
Tries to open a single-table tablespace and checks the space id is right in
it. If does not succeed, prints an error message to the .err log. This
@@ -362,10 +366,10 @@ protection of the dictionary mutex, so that two users cannot race here. */
ibool
fil_open_single_table_tablespace(
/*=============================*/
- /* out: TRUE if success */
- ulint id, /* in: space id */
- char* name); /* in: table name in the databasename/tablename
- format */
+ /* out: TRUE if success */
+ ulint id, /* in: space id */
+ const char* name); /* in: table name in the
+ databasename/tablename format */
/************************************************************************
It is possible, though very improbable, that the lsn's in the tablespace to be
imported have risen above the current system lsn, if a lengthy purge, ibuf
@@ -379,12 +383,12 @@ lsn's just by looking at that flush lsn. */
ibool
fil_reset_too_high_lsns(
/*====================*/
- /* out: TRUE if success */
- char* name, /* in: table name in the databasename/tablename
- format */
- dulint current_lsn); /* in: reset lsn's if the lsn stamped to
- FIL_PAGE_FILE_FLUSH_LSN in the first page is
- too high */
+ /* out: TRUE if success */
+ const char* name, /* in: table name in the
+ databasename/tablename format */
+ dulint current_lsn); /* in: reset lsn's if the lsn stamped
+ to FIL_PAGE_FILE_FLUSH_LSN in the
+ first page is too high */
/************************************************************************
At the server startup, if we need crash recovery, scans the database
directories under the MySQL datadir, looking for .ibd files. Those files are
@@ -436,20 +440,22 @@ there may be many tablespaces which are not yet in the memory cache. */
ibool
fil_space_for_table_exists_in_mem(
/*==============================*/
- /* out: TRUE if a matching tablespace
- exists in the memory cache */
- ulint id, /* in: space id */
- char* name, /* in: table name in the standard
- 'databasename/tablename' format */
- ibool mark_space, /* in: in crash recovery, at database startup
- we mark all spaces which have an associated
- table in the InnoDB data dictionary, so that
- we can print a warning about orphaned
- tablespaces */
- ibool print_error_if_does_not_exist);
- /* in: print detailed error information to
- the .err log if a matching tablespace is
- not found from memory */
+ /* out: TRUE if a matching tablespace
+ exists in the memory cache */
+ ulint id, /* in: space id */
+ const char* name, /* in: table name in the standard
+ 'databasename/tablename' format */
+ ibool mark_space, /* in: in crash recovery, at database
+ startup we mark all spaces which have
+ an associated table in the InnoDB
+ data dictionary, so that
+ we can print a warning about orphaned
+ tablespaces */
+ ibool print_error_if_does_not_exist);
+ /* in: print detailed error
+ information to the .err log if a
+ matching tablespace is not found from
+ memory */
/**************************************************************************
Tries to extend a data file so that it would accommodate the number of pages
given. The tablespace must be cached in the memory cache. If the space is big
diff --git a/innobase/include/mem0mem.h b/innobase/include/mem0mem.h
index 89e2a337c99..18bffe5732e 100644
--- a/innobase/include/mem0mem.h
+++ b/innobase/include/mem0mem.h
@@ -64,14 +64,14 @@ heap creation. */
#define mem_heap_create(N) mem_heap_create_func(\
(N), NULL, MEM_HEAP_DYNAMIC,\
- IB__FILE__, __LINE__)
+ __FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function! Macro for memory
heap creation. */
#define mem_heap_create_in_buffer(N) mem_heap_create_func(\
(N), NULL, MEM_HEAP_BUFFER,\
- IB__FILE__, __LINE__)
+ __FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function! Macro for memory
heap creation. */
@@ -79,7 +79,7 @@ heap creation. */
#define mem_heap_create_in_btr_search(N) mem_heap_create_func(\
(N), NULL, MEM_HEAP_BTR_SEARCH |\
MEM_HEAP_BUFFER,\
- IB__FILE__, __LINE__)
+ __FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function! Macro for fast
memory heap creation. An initial block of memory B is given by the
@@ -88,14 +88,14 @@ mem_heap_free. See the parameter comment in mem_heap_create_func below. */
#define mem_heap_fast_create(N, B) mem_heap_create_func(\
(N), (B), MEM_HEAP_DYNAMIC,\
- IB__FILE__, __LINE__)
+ __FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function! Macro for memory
heap freeing. */
#define mem_heap_free(heap) mem_heap_free_func(\
- (heap), IB__FILE__, __LINE__)
+ (heap), __FILE__, __LINE__)
/*********************************************************************
NOTE: Use the corresponding macros instead of this function. Creates a
memory heap which allocates memory from dynamic space. For debugging
@@ -105,26 +105,27 @@ UNIV_INLINE
mem_heap_t*
mem_heap_create_func(
/*=================*/
- /* out, own: memory heap */
- ulint n, /* in: desired start block size,
- this means that a single user buffer
- of size n will fit in the block,
- 0 creates a default size block;
- if init_block is not NULL, n tells
- its size in bytes */
- void* init_block, /* in: if very fast creation is
- wanted, the caller can reserve some
- memory from its stack, for example,
- and pass it as the the initial block
- to the heap: then no OS call of malloc
- is needed at the creation. CAUTION:
- the caller must make sure the initial
- block is not unintentionally erased
- (if allocated in the stack), before
- the memory heap is explicitly freed. */
- ulint type, /* in: MEM_HEAP_DYNAMIC or MEM_HEAP_BUFFER */
- char* file_name, /* in: file name where created */
- ulint line /* in: line where created */
+ /* out, own: memory heap */
+ ulint n, /* in: desired start block size,
+ this means that a single user buffer
+ of size n will fit in the block,
+ 0 creates a default size block;
+ if init_block is not NULL, n tells
+ its size in bytes */
+ void* init_block, /* in: if very fast creation is
+ wanted, the caller can reserve some
+ memory from its stack, for example,
+ and pass it as the the initial block
+ to the heap: then no OS call of malloc
+ is needed at the creation. CAUTION:
+ the caller must make sure the initial
+ block is not unintentionally erased
+ (if allocated in the stack), before
+ the memory heap is explicitly freed. */
+ ulint type, /* in: MEM_HEAP_DYNAMIC
+ or MEM_HEAP_BUFFER */
+ const char* file_name, /* in: file name where created */
+ ulint line /* in: line where created */
);
/*********************************************************************
NOTE: Use the corresponding macro instead of this function. Frees the space
@@ -135,7 +136,7 @@ void
mem_heap_free_func(
/*===============*/
mem_heap_t* heap, /* in, own: heap to be freed */
- char* file_name __attribute__((unused)),
+ const char* file_name __attribute__((unused)),
/* in: file name where freed */
ulint line __attribute__((unused)));
/* in: line where freed */
@@ -206,13 +207,13 @@ mem_heap_get_size(
Use this macro instead of the corresponding function!
Macro for memory buffer allocation */
-#define mem_alloc(N) mem_alloc_func((N), IB__FILE__, __LINE__)
+#define mem_alloc(N) mem_alloc_func((N), __FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function!
Macro for memory buffer allocation */
#define mem_alloc_noninline(N) mem_alloc_func_noninline(\
- (N), IB__FILE__, __LINE__)
+ (N), __FILE__, __LINE__)
/*******************************************************************
NOTE: Use the corresponding macro instead of this function.
Allocates a single buffer of memory from the dynamic memory of
@@ -222,11 +223,11 @@ UNIV_INLINE
void*
mem_alloc_func(
/*===========*/
- /* out, own: free storage, NULL
- if did not succeed */
- ulint n, /* in: desired number of bytes */
- char* file_name, /* in: file name where created */
- ulint line /* in: line where created */
+ /* out, own: free storage, NULL
+ if did not succeed */
+ ulint n, /* in: desired number of bytes */
+ const char* file_name, /* in: file name where created */
+ ulint line /* in: line where created */
);
/*******************************************************************
NOTE: Use the corresponding macro instead of this function.
@@ -237,17 +238,17 @@ with mem_free. */
void*
mem_alloc_func_noninline(
/*=====================*/
- /* out, own: free storage, NULL if did not
- succeed */
- ulint n, /* in: desired number of bytes */
- char* file_name, /* in: file name where created */
- ulint line /* in: line where created */
+ /* out, own: free storage,
+ NULL if did not succeed */
+ ulint n, /* in: desired number of bytes */
+ const char* file_name, /* in: file name where created */
+ ulint line /* in: line where created */
);
/******************************************************************
Use this macro instead of the corresponding function!
Macro for memory buffer freeing */
-#define mem_free(PTR) mem_free_func((PTR), IB__FILE__, __LINE__)
+#define mem_free(PTR) mem_free_func((PTR), __FILE__, __LINE__)
/*******************************************************************
NOTE: Use the corresponding macro instead of this function.
Frees a single buffer of storage from
@@ -256,9 +257,9 @@ UNIV_INLINE
void
mem_free_func(
/*==========*/
- void* ptr, /* in, own: buffer to be freed */
- char* file_name, /* in: file name where created */
- ulint line /* in: line where created */
+ void* ptr, /* in, own: buffer to be freed */
+ const char* file_name, /* in: file name where created */
+ ulint line /* in: line where created */
);
/*******************************************************************
Implements realloc. */
@@ -266,11 +267,12 @@ UNIV_INLINE
void*
mem_realloc(
/*========*/
- /* out, own: free storage, NULL if did not succeed */
- void* buf, /* in: pointer to an old buffer */
- ulint n, /* in: desired number of bytes */
- char* file_name,/* in: file name where called */
- ulint line); /* in: line where called */
+ /* out, own: free storage,
+ NULL if did not succeed */
+ void* buf, /* in: pointer to an old buffer */
+ ulint n, /* in: desired number of bytes */
+ const char* file_name, /* in: file name where called */
+ ulint line); /* in: line where called */
/**************************************************************************
Duplicates a NUL-terminated string. */
diff --git a/innobase/include/mem0mem.ic b/innobase/include/mem0mem.ic
index c250e6948ec..df3dbf9b576 100644
--- a/innobase/include/mem0mem.ic
+++ b/innobase/include/mem0mem.ic
@@ -16,18 +16,18 @@ Creates a memory heap block where data can be allocated. */
mem_block_t*
mem_heap_create_block(
/*==================*/
- /* out, own: memory heap block, NULL if did not
- succeed */
- mem_heap_t* heap,/* in: memory heap or NULL if first block should
- be created */
- ulint n, /* in: number of bytes needed for user data, or
- if init_block is not NULL, its size in bytes */
- void* init_block, /* in: init block in fast create, type must be
- MEM_HEAP_DYNAMIC */
- ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC or
- MEM_HEAP_BUFFER */
- char* file_name,/* in: file name where created */
- ulint line); /* in: line where created */
+ /* out, own: memory heap block,
+ NULL if did not succeed */
+ mem_heap_t* heap, /* in: memory heap or NULL if first block
+ should be created */
+ ulint n, /* in: number of bytes needed for user data, or
+ if init_block is not NULL, its size in bytes */
+ void* init_block, /* in: init block in fast create,
+ type must be MEM_HEAP_DYNAMIC */
+ ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC or
+ MEM_HEAP_BUFFER */
+ const char* file_name,/* in: file name where created */
+ ulint line); /* in: line where created */
/**********************************************************************
Frees a block from a memory heap. */
@@ -377,27 +377,27 @@ UNIV_INLINE
mem_heap_t*
mem_heap_create_func(
/*=================*/
- /* out, own: memory heap */
- ulint n, /* in: desired start block size,
- this means that a single user buffer
- of size n will fit in the block,
- 0 creates a default size block;
- if init_block is not NULL, n tells
- its size in bytes */
- void* init_block, /* in: if very fast creation is
- wanted, the caller can reserve some
- memory from its stack, for example,
- and pass it as the the initial block
- to the heap: then no OS call of malloc
- is needed at the creation. CAUTION:
- the caller must make sure the initial
- block is not unintentionally erased
- (if allocated in the stack), before
- the memory heap is explicitly freed. */
- ulint type, /* in: MEM_HEAP_DYNAMIC, or MEM_HEAP_BUFFER
- possibly ORed to MEM_HEAP_BTR_SEARCH */
- char* file_name, /* in: file name where created */
- ulint line /* in: line where created */
+ /* out, own: memory heap */
+ ulint n, /* in: desired start block size,
+ this means that a single user buffer
+ of size n will fit in the block,
+ 0 creates a default size block;
+ if init_block is not NULL, n tells
+ its size in bytes */
+ void* init_block, /* in: if very fast creation is
+ wanted, the caller can reserve some
+ memory from its stack, for example,
+ and pass it as the the initial block
+ to the heap: then no OS call of malloc
+ is needed at the creation. CAUTION:
+ the caller must make sure the initial
+ block is not unintentionally erased
+ (if allocated in the stack), before
+ the memory heap is explicitly freed. */
+ ulint type, /* in: MEM_HEAP_DYNAMIC
+ or MEM_HEAP_BUFFER */
+ const char* file_name, /* in: file name where created */
+ ulint line /* in: line where created */
)
{
mem_block_t* block;
@@ -440,10 +440,9 @@ void
mem_heap_free_func(
/*===============*/
mem_heap_t* heap, /* in, own: heap to be freed */
- char* file_name __attribute__((unused)),
+ const char* file_name __attribute__((unused)),
/* in: file name where freed */
ulint line __attribute__((unused)))
- /* in: line where freed */
{
mem_block_t* block;
mem_block_t* prev_block;
@@ -486,11 +485,11 @@ UNIV_INLINE
void*
mem_alloc_func(
/*===========*/
- /* out, own: free storage, NULL if did not
- succeed */
- ulint n, /* in: desired number of bytes */
- char* file_name, /* in: file name where created */
- ulint line /* in: line where created */
+ /* out, own: free storage, NULL
+ if did not succeed */
+ ulint n, /* in: desired number of bytes */
+ const char* file_name, /* in: file name where created */
+ ulint line /* in: line where created */
)
{
mem_heap_t* heap;
@@ -523,9 +522,9 @@ UNIV_INLINE
void
mem_free_func(
/*==========*/
- void* ptr, /* in, own: buffer to be freed */
- char* file_name, /* in: file name where created */
- ulint line /* in: line where created */
+ void* ptr, /* in, own: buffer to be freed */
+ const char* file_name, /* in: file name where created */
+ ulint line /* in: line where created */
)
{
mem_heap_t* heap;
@@ -569,11 +568,12 @@ UNIV_INLINE
void*
mem_realloc(
/*========*/
- /* out, own: free storage, NULL if did not succeed */
- void* buf, /* in: pointer to an old buffer */
- ulint n, /* in: desired number of bytes */
- char* file_name,/* in: file name where called */
- ulint line) /* in: line where called */
+ /* out, own: free storage,
+ NULL if did not succeed */
+ void* buf, /* in: pointer to an old buffer */
+ ulint n, /* in: desired number of bytes */
+ const char* file_name, /* in: file name where called */
+ ulint line) /* in: line where called */
{
mem_free(buf);
diff --git a/innobase/include/mem0pool.h b/innobase/include/mem0pool.h
index 08327d95d37..95cf19676fb 100644
--- a/innobase/include/mem0pool.h
+++ b/innobase/include/mem0pool.h
@@ -19,8 +19,6 @@ typedef struct mem_pool_struct mem_pool_t;
/* The common memory pool */
extern mem_pool_t* mem_comm_pool;
-extern ulint mem_out_of_mem_err_msg_count;
-
/* Memory area header */
struct mem_area_struct{
diff --git a/innobase/include/mtr0mtr.h b/innobase/include/mtr0mtr.h
index 73338977b9c..f6dfe23bc41 100644
--- a/innobase/include/mtr0mtr.h
+++ b/innobase/include/mtr0mtr.h
@@ -198,11 +198,11 @@ mtr_read_dulint(
mtr_t* mtr); /* in: mini-transaction handle */
/*************************************************************************
This macro locks an rw-lock in s-mode. */
-#define mtr_s_lock(B, MTR) mtr_s_lock_func((B), IB__FILE__, __LINE__,\
+#define mtr_s_lock(B, MTR) mtr_s_lock_func((B), __FILE__, __LINE__,\
(MTR))
/*************************************************************************
This macro locks an rw-lock in x-mode. */
-#define mtr_x_lock(B, MTR) mtr_x_lock_func((B), IB__FILE__, __LINE__,\
+#define mtr_x_lock(B, MTR) mtr_x_lock_func((B), __FILE__, __LINE__,\
(MTR))
/*************************************************************************
NOTE! Use the macro above!
@@ -212,7 +212,7 @@ void
mtr_s_lock_func(
/*============*/
rw_lock_t* lock, /* in: rw-lock */
- char* file, /* in: file name */
+ const char* file, /* in: file name */
ulint line, /* in: line number */
mtr_t* mtr); /* in: mtr */
/*************************************************************************
@@ -223,7 +223,7 @@ void
mtr_x_lock_func(
/*============*/
rw_lock_t* lock, /* in: rw-lock */
- char* file, /* in: file name */
+ const char* file, /* in: file name */
ulint line, /* in: line number */
mtr_t* mtr); /* in: mtr */
diff --git a/innobase/include/mtr0mtr.ic b/innobase/include/mtr0mtr.ic
index 51112fc0d14..4fc6dd2f6a9 100644
--- a/innobase/include/mtr0mtr.ic
+++ b/innobase/include/mtr0mtr.ic
@@ -217,7 +217,7 @@ void
mtr_s_lock_func(
/*============*/
rw_lock_t* lock, /* in: rw-lock */
- char* file, /* in: file name */
+ const char* file, /* in: file name */
ulint line, /* in: line number */
mtr_t* mtr) /* in: mtr */
{
@@ -236,7 +236,7 @@ void
mtr_x_lock_func(
/*============*/
rw_lock_t* lock, /* in: rw-lock */
- char* file, /* in: file name */
+ const char* file, /* in: file name */
ulint line, /* in: line number */
mtr_t* mtr) /* in: mtr */
{
diff --git a/innobase/include/os0file.h b/innobase/include/os0file.h
index 3eccfcd3be5..930390241d3 100644
--- a/innobase/include/os0file.h
+++ b/innobase/include/os0file.h
@@ -177,13 +177,15 @@ and '..' items at the start of the directory listing. */
os_file_dir_t
os_file_opendir(
/*============*/
- /* out: directory stream, NULL if error */
- char* dirname, /* in: directory name; it must not contain
- a trailing '\' or '/' */
- ibool error_is_fatal);/* in: TRUE if we should treat an error as a
- fatal error; if we try to open symlinks then
- we do not wish a fatal error if it happens
- not to be a directory */
+ /* out: directory stream, NULL if
+ error */
+ const char* dirname, /* in: directory name; it must not
+ contain a trailing '\' or '/' */
+ ibool error_is_fatal);/* in: TRUE if we should treat an
+ error as a fatal error; if we try to
+ open symlinks then we do not wish a
+ fatal error if it happens not to be
+ a directory */
/***************************************************************************
Closes a directory stream. */
@@ -201,7 +203,7 @@ os_file_readdir_next_file(
/*======================*/
/* out: 0 if ok, -1 if error, 1 if at the end
of the directory */
- char* dirname,/* in: directory name or path */
+ const char* dirname,/* in: directory name or path */
os_file_dir_t dir, /* in: directory stream */
os_file_stat_t* info); /* in/out: buffer where the info is returned */
/*********************************************************************
@@ -213,81 +215,89 @@ fail_if_exists arguments is true. */
ibool
os_file_create_directory(
/*=====================*/
- /* out: TRUE if call succeeds, FALSE on
- error */
- char* pathname, /* in: directory name as null-terminated
- string */
- ibool fail_if_exists);/* in: if TRUE, pre-existing directory is
- treated as an error. */
+ /* out: TRUE if call succeeds,
+ FALSE on error */
+ const char* pathname, /* in: directory name as
+ null-terminated string */
+ ibool fail_if_exists);/* in: if TRUE, pre-existing directory
+ is treated as an error. */
/********************************************************************
A simple function to open or create a file. */
os_file_t
os_file_create_simple(
/*==================*/
- /* out, own: handle to the file, not defined if error,
- error number can be retrieved with
- os_file_get_last_error */
- char* name, /* in: name of the file or path as a null-terminated
- string */
- ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened
- (if does not exist, error), or OS_FILE_CREATE if a new
- file is created (if exists, error), or
- OS_FILE_CREATE_PATH if new file (if exists, error) and
- subdirectories along its path are created (if needed)*/
- ulint access_type,/* in: OS_FILE_READ_ONLY or OS_FILE_READ_WRITE */
- ibool* success);/* out: TRUE if succeed, FALSE if error */
+ /* out, own: handle to the file, not defined
+ if error, error number can be retrieved with
+ os_file_get_last_error */
+ const char* name, /* in: name of the file or path as a
+ null-terminated string */
+ ulint create_mode,/* in: OS_FILE_OPEN if an existing file is
+ opened (if does not exist, error), or
+ OS_FILE_CREATE if a new file is created
+ (if exists, error), or
+ OS_FILE_CREATE_PATH if new file
+ (if exists, error) and subdirectories along
+ its path are created (if needed)*/
+ ulint access_type,/* in: OS_FILE_READ_ONLY or
+ OS_FILE_READ_WRITE */
+ ibool* success);/* out: TRUE if succeed, FALSE if error */
/********************************************************************
A simple function to open or create a file. */
os_file_t
os_file_create_simple_no_error_handling(
/*====================================*/
- /* out, own: handle to the file, not defined if error,
- error number can be retrieved with
- os_file_get_last_error */
- char* name, /* in: name of the file or path as a null-terminated
- string */
- ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened
- (if does not exist, error), or OS_FILE_CREATE if a new
- file is created (if exists, error) */
- ulint access_type,/* in: OS_FILE_READ_ONLY, OS_FILE_READ_WRITE, or
- OS_FILE_READ_ALLOW_DELETE; the last option is used by
- a backup program reading the file */
- ibool* success);/* out: TRUE if succeed, FALSE if error */
+ /* out, own: handle to the file, not defined
+ if error, error number can be retrieved with
+ os_file_get_last_error */
+ const char* name, /* in: name of the file or path as a
+ null-terminated string */
+ ulint create_mode,/* in: OS_FILE_OPEN if an existing file
+ is opened (if does not exist, error), or
+ OS_FILE_CREATE if a new file is created
+ (if exists, error) */
+ ulint access_type,/* in: OS_FILE_READ_ONLY,
+ OS_FILE_READ_WRITE, or
+ OS_FILE_READ_ALLOW_DELETE; the last option is
+ used by a backup program reading the file */
+ ibool* success);/* out: TRUE if succeed, FALSE if error */
/********************************************************************
Opens an existing file or creates a new. */
os_file_t
os_file_create(
/*===========*/
- /* out, own: handle to the file, not defined if error,
- error number can be retrieved with
- os_file_get_last_error */
- char* name, /* in: name of the file or path as a null-terminated
- string */
- ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened
- (if does not exist, error), or OS_FILE_CREATE if a new
- file is created (if exists, error), OS_FILE_OVERWRITE
- if a new file is created or an old overwritten;
- OS_FILE_OPEN_RAW, if a raw device or disk partition
- should be opened */
- ulint purpose,/* in: OS_FILE_AIO, if asynchronous, non-buffered i/o
- is desired, OS_FILE_NORMAL, if any normal file;
- NOTE that it also depends on type, os_aio_.. and srv_..
- variables whether we really use async i/o or
- unbuffered i/o: look in the function source code for
- the exact rules */
- ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */
- ibool* success);/* out: TRUE if succeed, FALSE if error */
+ /* out, own: handle to the file, not defined
+ if error, error number can be retrieved with
+ os_file_get_last_error */
+ const char* name, /* in: name of the file or path as a
+ null-terminated string */
+ ulint create_mode,/* in: OS_FILE_OPEN if an existing file
+ is opened (if does not exist, error), or
+ OS_FILE_CREATE if a new file is created
+ (if exists, error),
+ OS_FILE_OVERWRITE if a new file is created
+ or an old overwritten;
+ OS_FILE_OPEN_RAW, if a raw device or disk
+ partition should be opened */
+ ulint purpose,/* in: OS_FILE_AIO, if asynchronous,
+ non-buffered i/o is desired,
+ OS_FILE_NORMAL, if any normal file;
+ NOTE that it also depends on type, os_aio_..
+ and srv_.. variables whether we really use
+ async i/o or unbuffered i/o: look in the
+ function source code for the exact rules */
+ ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */
+ ibool* success);/* out: TRUE if succeed, FALSE if error */
/***************************************************************************
Deletes a file. The file has to be closed before calling this. */
ibool
os_file_delete(
/*===========*/
- /* out: TRUE if success */
- char* name); /* in: file path as a null-terminated string */
+ /* out: TRUE if success */
+ const char* name); /* in: file path as a null-terminated string */
/***************************************************************************
Deletes a file if it exists. The file has to be closed before calling this. */
@@ -295,8 +305,8 @@ Deletes a file if it exists. The file has to be closed before calling this. */
ibool
os_file_delete_if_exists(
/*=====================*/
- /* out: TRUE if success */
- char* name); /* in: file path as a null-terminated string */
+ /* out: TRUE if success */
+ const char* name); /* in: file path as a null-terminated string */
/***************************************************************************
Renames a file (can also move it to another directory). It is safest that the
file is closed before calling this function. */
@@ -304,10 +314,10 @@ file is closed before calling this function. */
ibool
os_file_rename(
/*===========*/
- /* out: TRUE if success */
- char* oldpath, /* in: old file path as a null-terminated
- string */
- char* newpath); /* in: new file path */
+ /* out: TRUE if success */
+ const char* oldpath, /* in: old file path as a
+ null-terminated string */
+ const char* newpath); /* in: new file path */
/***************************************************************************
Closes a file handle. In case of error, error number can be retrieved with
os_file_get_last_error. */
@@ -351,7 +361,7 @@ ibool
os_file_set_size(
/*=============*/
/* out: TRUE if success */
- char* name, /* in: name of the file or path as a
+ const char* name, /* in: name of the file or path as a
null-terminated string */
os_file_t file, /* in: handle to a file */
ulint size, /* in: least significant 32 bits of file
@@ -426,10 +436,10 @@ os_file_write(
/*==========*/
/* out: TRUE if request was
successful, FALSE if fail */
- char* name, /* in: name of the file or path as a
+ const char* name, /* in: name of the file or path as a
null-terminated string */
os_file_t file, /* in: handle to a file */
- void* buf, /* in: buffer from which to write */
+ const void* buf, /* in: buffer from which to write */
ulint offset, /* in: least significant 32 bits of file
offset where to write */
ulint offset_high,/* in: most significant 32 bits of
@@ -442,8 +452,8 @@ ibool
os_file_status(
/*===========*/
/* out: TRUE if call succeeded */
- char * path, /* in: pathname of the file */
- ibool * exists, /* out: TRUE if file exists */
+ const char* path, /* in: pathname of the file */
+ ibool* exists, /* out: TRUE if file exists */
os_file_type_t* type); /* out: type of the file (if it exists) */
/********************************************************************
The function os_file_dirname returns a directory component of a
@@ -478,7 +488,7 @@ os_file_dirname(
/*============*/
/* out, own: directory component of the
pathname */
- char* path); /* in: pathname */
+ const char* path); /* in: pathname */
/********************************************************************
Creates all missing subdirectories along the given path. */
@@ -487,7 +497,7 @@ os_file_create_subdirs_if_needed(
/*=============================*/
/* out: TRUE if call succeeded
FALSE otherwise */
- char* path); /* in: path name */
+ const char* path); /* in: path name */
/****************************************************************************
Initializes the asynchronous io system. Creates separate aio array for
non-ibuf read and write, a third aio array for the ibuf i/o, with just one
@@ -527,7 +537,7 @@ os_aio(
because i/os are not actually handled until
all have been posted: use with great
caution! */
- char* name, /* in: name of the file or path as a
+ const char* name, /* in: name of the file or path as a
null-terminated string */
os_file_t file, /* in: handle to a file */
void* buf, /* in: buffer where to read or from which
diff --git a/innobase/include/os0shm.h b/innobase/include/os0shm.h
deleted file mode 100644
index 250794a976f..00000000000
--- a/innobase/include/os0shm.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/******************************************************
-The interface to the operating system
-shared memory primitives
-
-(c) 1995 Innobase Oy
-
-Created 9/23/1995 Heikki Tuuri
-*******************************************************/
-
-#ifndef os0shm_h
-#define os0shm_h
-
-#include "univ.i"
-
-typedef void* os_shm_t;
-
-
-/********************************************************************
-Creates an area of shared memory. It can be named so that
-different processes may access it in the same computer.
-If an area with the same name already exists, returns
-a handle to that area (where the size of the area is
-not changed even if this call requests a different size).
-To use the area, it first has to be mapped to the process
-address space by os_shm_map. */
-
-os_shm_t
-os_shm_create(
-/*==========*/
- /* out, own: handle to the shared
- memory area, NULL if error */
- ulint size, /* in: area size < 4 GB */
- char* name); /* in: name of the area as a null-terminated
- string */
-/***************************************************************************
-Frees a shared memory area. The area can be freed only after it
-has been unmapped in all the processes where it was mapped. */
-
-ibool
-os_shm_free(
-/*========*/
- /* out: TRUE if success */
- os_shm_t shm); /* in, own: handle to a shared memory area */
-/***************************************************************************
-Maps a shared memory area in the address space of a process. */
-
-void*
-os_shm_map(
-/*=======*/
- /* out: address of the area, NULL if error */
- os_shm_t shm); /* in: handle to a shared memory area */
-/***************************************************************************
-Unmaps a shared memory area from the address space of a process. */
-
-ibool
-os_shm_unmap(
-/*=========*/
- /* out: TRUE if succeed */
- void* addr); /* in: address of the area */
-
-
-#ifndef UNIV_NONINL
-#include "os0shm.ic"
-#endif
-
-#endif
diff --git a/innobase/include/os0shm.ic b/innobase/include/os0shm.ic
deleted file mode 100644
index cc267544bc9..00000000000
--- a/innobase/include/os0shm.ic
+++ /dev/null
@@ -1,10 +0,0 @@
-/******************************************************
-The interface to the operating system
-shared memory primitives
-
-(c) 1995 Innobase Oy
-
-Created 9/23/1995 Heikki Tuuri
-*******************************************************/
-
-
diff --git a/innobase/include/os0sync.h b/innobase/include/os0sync.h
index e1cf263216e..d27b1676f1b 100644
--- a/innobase/include/os0sync.h
+++ b/innobase/include/os0sync.h
@@ -87,9 +87,9 @@ explicitly by calling sync_os_reset_event. */
os_event_t
os_event_create(
/*============*/
- /* out: the event handle */
- char* name); /* in: the name of the event, if NULL
- the event is created without a name */
+ /* out: the event handle */
+ const char* name); /* in: the name of the event, if NULL
+ the event is created without a name */
#ifdef __WIN__
/*************************************************************
Creates an auto-reset event semaphore, i.e., an event which is automatically
@@ -98,9 +98,9 @@ reset when a single thread is released. Works only in Windows. */
os_event_t
os_event_create_auto(
/*=================*/
- /* out: the event handle */
- char* name); /* in: the name of the event, if NULL
- the event is created without a name */
+ /* out: the event handle */
+ const char* name); /* in: the name of the event, if NULL
+ the event is created without a name */
#endif
/**************************************************************
Sets an event semaphore to the signaled state: lets waiting threads
@@ -171,9 +171,9 @@ mutex semaphore of InnoDB itself (mutex_t) should be used where possible. */
os_mutex_t
os_mutex_create(
/*============*/
- /* out: the mutex handle */
- char* name); /* in: the name of the mutex, if NULL
- the mutex is created without a name */
+ /* out: the mutex handle */
+ const char* name); /* in: the name of the mutex, if NULL
+ the mutex is created without a name */
/**************************************************************
Acquires ownership of a mutex semaphore. */
diff --git a/innobase/include/pars0pars.h b/innobase/include/pars0pars.h
index 2e86a7e5534..28985e2f9d0 100644
--- a/innobase/include/pars0pars.h
+++ b/innobase/include/pars0pars.h
@@ -74,8 +74,8 @@ Parses an SQL string returning the query graph. */
que_t*
pars_sql(
/*=====*/
- /* out, own: the query graph */
- char* str); /* in: SQL string */
+ /* out, own: the query graph */
+ const char* str); /* in: SQL string */
/*****************************************************************
Retrieves characters to the lexical analyzer. */
@@ -92,7 +92,7 @@ Called by yyparse on error. */
void
yyerror(
/*====*/
- char* s); /* in: error message string */
+ const char* s); /* in: error message string */
/*************************************************************************
Parses a variable declaration. */
diff --git a/innobase/include/pars0sym.h b/innobase/include/pars0sym.h
index 3060fd06c8f..a40523861dd 100644
--- a/innobase/include/pars0sym.h
+++ b/innobase/include/pars0sym.h
@@ -122,7 +122,7 @@ struct sym_node_struct{
SYM_IMPLICIT_VAR,
SYM_LIT, SYM_TABLE,
SYM_CURSOR, ... */
- char* name; /* name of an id */
+ const char* name; /* name of an id */
ulint name_len; /* id name length */
dict_table_t* table; /* table definition
if a table id or a
@@ -150,7 +150,7 @@ struct sym_tab_struct{
que_t* query_graph;
/* query graph generated by the
parser */
- char* sql_string;
+ const char* sql_string;
/* SQL string to parse */
int string_len;
/* SQL string length */
diff --git a/innobase/include/que0que.h b/innobase/include/que0que.h
index bcd7aed7e88..a438116781f 100644
--- a/innobase/include/que0que.h
+++ b/innobase/include/que0que.h
@@ -152,17 +152,6 @@ que_run_threads(
/*============*/
que_thr_t* thr); /* in: query thread which is run initially */
/**************************************************************************
-After signal handling is finished, returns control to a query graph error
-handling routine. (Currently, just returns the control to the root of the
-graph so that the graph can communicate an error message to the client.) */
-
-void
-que_fork_error_handle(
-/*==================*/
- trx_t* trx, /* in: trx */
- que_t* fork); /* in: query graph which was run before signal
- handling started, NULL not allowed */
-/**************************************************************************
Handles an SQL error noticed during query thread execution. At the moment,
does nothing! */
@@ -181,18 +170,15 @@ a single worker thread to execute it. This function should be used to end
the wait state of a query thread waiting for a lock or a stored procedure
completion. */
-void
+que_thr_t*
que_thr_end_wait(
/*=============*/
- que_thr_t* thr, /* in: query thread in the
+ /* out: next query thread to run;
+ NULL if none */
+ que_thr_t* thr); /* in: query thread in the
QUE_THR_LOCK_WAIT,
or QUE_THR_PROCEDURE_WAIT, or
QUE_THR_SIG_REPLY_WAIT state */
- que_thr_t** next_thr); /* in/out: next query thread to run;
- if the value which is passed in is
- a pointer to a NULL pointer, then the
- calling function can start running
- a new query thread */
/**************************************************************************
Same as que_thr_end_wait, but no parameter next_thr available. */
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h
index 0b9f34dda1e..af6d8969cfc 100644
--- a/innobase/include/row0mysql.h
+++ b/innobase/include/row0mysql.h
@@ -316,15 +316,16 @@ fields than mentioned in the constraint. */
int
row_table_add_foreign_constraints(
/*==============================*/
- /* out: error code or DB_SUCCESS */
- trx_t* trx, /* in: transaction */
- char* sql_string, /* in: table create statement where
- foreign keys are declared like:
+ /* out: error code or DB_SUCCESS */
+ trx_t* trx, /* in: transaction */
+ const char* sql_string, /* in: table create statement where
+ foreign keys are declared like:
FOREIGN KEY (a, b) REFERENCES table2(c, d),
- table2 can be written also with the database
- name before it: test.table2 */
- char* name); /* in: table full name in the normalized form
- database_name/table_name */
+ table2 can be written also with the
+ database name before it: test.table2 */
+ const char* name); /* in: table full name in the
+ normalized form
+ database_name/table_name */
/*************************************************************************
The master thread in srv0srv.c calls this regularly to drop tables which
we must drop in background after queries to them have ended. Such lazy
@@ -351,10 +352,10 @@ output by the master thread. */
int
row_drop_table_for_mysql(
/*=====================*/
- /* out: error code or DB_SUCCESS */
- char* name, /* in: table name */
- trx_t* trx, /* in: transaction handle */
- ibool drop_db);/* in: TRUE=dropping whole database */
+ /* out: error code or DB_SUCCESS */
+ const char* name, /* in: table name */
+ trx_t* trx, /* in: transaction handle */
+ ibool drop_db);/* in: TRUE=dropping whole database */
/*************************************************************************
Discards the tablespace of a table which stored in an .ibd file. Discarding
@@ -382,9 +383,9 @@ discard ongoing operations. */
int
row_discard_tablespace_for_mysql(
/*=============================*/
- /* out: error code or DB_SUCCESS */
- char* name, /* in: table name */
- trx_t* trx); /* in: transaction handle */
+ /* out: error code or DB_SUCCESS */
+ const char* name, /* in: table name */
+ trx_t* trx); /* in: transaction handle */
/*********************************************************************
Imports a tablespace. The space id in the .ibd file must match the space id
of the table in the data dictionary. */
@@ -392,28 +393,28 @@ of the table in the data dictionary. */
int
row_import_tablespace_for_mysql(
/*============================*/
- /* out: error code or DB_SUCCESS */
- char* name, /* in: table name */
- trx_t* trx); /* in: transaction handle */
+ /* out: error code or DB_SUCCESS */
+ const char* name, /* in: table name */
+ trx_t* trx); /* in: transaction handle */
/*************************************************************************
Drops a database for MySQL. */
int
row_drop_database_for_mysql(
/*========================*/
- /* out: error code or DB_SUCCESS */
- char* name, /* in: database name which ends to '/' */
- trx_t* trx); /* in: transaction handle */
+ /* out: error code or DB_SUCCESS */
+ const char* name, /* in: database name which ends to '/' */
+ trx_t* trx); /* in: transaction handle */
/*************************************************************************
Renames a table for MySQL. */
int
row_rename_table_for_mysql(
/*=======================*/
- /* out: error code or DB_SUCCESS */
- char* old_name, /* in: old table name */
- char* new_name, /* in: new table name */
- trx_t* trx); /* in: transaction handle */
+ /* out: error code or DB_SUCCESS */
+ const char* old_name, /* in: old table name */
+ const char* new_name, /* in: new table name */
+ trx_t* trx); /* in: transaction handle */
/*************************************************************************
Checks a table for corruption. */
diff --git a/innobase/include/row0sel.h b/innobase/include/row0sel.h
index a35d588ad08..0be224eb255 100644
--- a/innobase/include/row0sel.h
+++ b/innobase/include/row0sel.h
@@ -144,11 +144,11 @@ consistent read result, or store it to the query cache. */
ibool
row_search_check_if_query_cache_permitted(
/*======================================*/
- /* out: TRUE if storing or retrieving from
- the query cache is permitted */
- trx_t* trx, /* in: transaction object */
- char* norm_name); /* in: concatenation of database name, '/'
- char, table name */
+ /* out: TRUE if storing or retrieving
+ from the query cache is permitted */
+ trx_t* trx, /* in: transaction object */
+ const char* norm_name); /* in: concatenation of database name,
+ '/' char, table name */
/* A structure for caching column values for prefetched rows */
diff --git a/innobase/include/srv0que.h b/innobase/include/srv0que.h
deleted file mode 100644
index 05c339cdd32..00000000000
--- a/innobase/include/srv0que.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/******************************************************
-Server query execution
-
-(c) 1996 Innobase Oy
-
-Created 6/5/1996 Heikki Tuuri
-*******************************************************/
-
-
-#ifndef srv0que_h
-#define srv0que_h
-
-#include "univ.i"
-#include "que0types.h"
-
-/**************************************************************************
-Checks if there is work to do in the server task queue. If there is, the
-thread starts processing a task. Before leaving, it again checks the task
-queue and picks a new task if any exists. This is called by a SRV_WORKER
-thread. */
-
-void
-srv_que_task_queue_check(void);
-/*==========================*/
-/**************************************************************************
-Performs round-robin on the server tasks. This is called by a SRV_WORKER
-thread every second or so. */
-
-que_thr_t*
-srv_que_round_robin(
-/*================*/
- /* out: the new (may be == thr) query thread
- to run */
- que_thr_t* thr); /* in: query thread */
-/**************************************************************************
-Enqueues a task to server task queue and releases a worker thread, if
-there exists one suspended. */
-
-void
-srv_que_task_enqueue(
-/*=================*/
- que_thr_t* thr); /* in: query thread */
-/**************************************************************************
-Enqueues a task to server task queue and releases a worker thread, if
-there exists one suspended. */
-
-void
-srv_que_task_enqueue_low(
-/*=====================*/
- que_thr_t* thr); /* in: query thread */
-
-#endif
-
diff --git a/innobase/include/sync0arr.h b/innobase/include/sync0arr.h
index 383d0c69fb2..e7d511f8137 100644
--- a/innobase/include/sync0arr.h
+++ b/innobase/include/sync0arr.h
@@ -51,7 +51,7 @@ sync_array_reserve_cell(
sync_array_t* arr, /* in: wait array */
void* object, /* in: pointer to the object to wait for */
ulint type, /* in: lock request type */
- char* file, /* in: file where requested */
+ const char* file, /* in: file where requested */
ulint line, /* in: line where requested */
ulint* index); /* out: index of the reserved cell */
/**********************************************************************
diff --git a/innobase/include/sync0ipm.h b/innobase/include/sync0ipm.h
deleted file mode 100644
index 3244a6d26de..00000000000
--- a/innobase/include/sync0ipm.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/******************************************************
-A fast mutex for interprocess synchronization.
-mutex_t can be used only within single process,
-but ip mutex also between processes.
-
-(c) 1995 Innobase Oy
-
-Created 9/30/1995 Heikki Tuuri
-*******************************************************/
-
-#ifndef sync0ipm_h
-#define sync0ipm_h
-
-#include "univ.i"
-#include "os0sync.h"
-#include "sync0sync.h"
-
-typedef struct ip_mutex_hdl_struct ip_mutex_hdl_t;
-typedef struct ip_mutex_struct ip_mutex_t;
-
-/* NOTE! The structure appears here only for the compiler to
-know its size. Do not use its fields directly!
-The structure used in a fast implementation of
-an interprocess mutex. */
-
-struct ip_mutex_struct {
- mutex_t mutex; /* Ordinary mutex struct */
- ulint waiters; /* This field is set to 1 if
- there may be waiters */
-};
-
-/* The performance of the ip mutex in NT depends on how often
-a thread has to suspend itself waiting for the ip mutex
-to become free. The following variable counts system calls
-involved. */
-
-extern ulint ip_mutex_system_call_count;
-
-/**********************************************************************
-Creates, or rather, initializes
-an ip mutex object in a specified shared memory location (which must be
-appropriately aligned). The ip mutex is initialized in the reset state.
-NOTE! Explicit destroying of the ip mutex with ip_mutex_free
-is not recommended
-as the mutex resides in shared memory and we cannot make sure that
-no process is currently accessing it. Therefore just use
-ip_mutex_close to free the operating system event and mutex. */
-
-ulint
-ip_mutex_create(
-/*============*/
- /* out: 0 if succeed */
- ip_mutex_t* ip_mutex, /* in: pointer to shared memory */
- char* name, /* in: name of the ip mutex */
- ip_mutex_hdl_t** handle); /* out, own: handle to the
- created mutex; handle exists
- in the private address space of
- the calling process */
-/**********************************************************************
-NOTE! Using this function is not recommended. See the note
-on ip_mutex_create. Destroys an ip mutex */
-
-void
-ip_mutex_free(
-/*==========*/
- ip_mutex_hdl_t* handle); /* in, own: ip mutex handle */
-/**********************************************************************
-Opens an ip mutex object in a specified shared memory location.
-Explicit closing of the ip mutex with ip_mutex_close is necessary to
-free the operating system event and mutex created, and the handle. */
-
-ulint
-ip_mutex_open(
-/*==========*/
- /* out: 0 if succeed */
- ip_mutex_t* ip_mutex, /* in: pointer to shared memory */
- char* name, /* in: name of the ip mutex */
- ip_mutex_hdl_t** handle); /* out, own: handle to the
- opened mutex */
-/**********************************************************************
-Closes an ip mutex. */
-
-void
-ip_mutex_close(
-/*===========*/
- ip_mutex_hdl_t* handle); /* in, own: ip mutex handle */
-/******************************************************************
-Reserves an ip mutex. */
-UNIV_INLINE
-ulint
-ip_mutex_enter(
-/*===========*/
- /* out: 0 if success,
- SYNC_TIME_EXCEEDED if timeout */
- ip_mutex_hdl_t* ip_mutex_hdl, /* in: pointer to ip mutex handle */
- ulint time); /* in: maximum time to wait, in
- microseconds, or
- SYNC_INFINITE_TIME */
-/******************************************************************
-Releases an ip mutex. */
-UNIV_INLINE
-void
-ip_mutex_exit(
-/*==========*/
- ip_mutex_hdl_t* ip_mutex_hdl); /* in: pointer to ip mutex handle */
-
-
-
-#ifndef UNIV_NONINL
-#include "sync0ipm.ic"
-#endif
-
-#endif
diff --git a/innobase/include/sync0ipm.ic b/innobase/include/sync0ipm.ic
deleted file mode 100644
index b8aa87ba6d6..00000000000
--- a/innobase/include/sync0ipm.ic
+++ /dev/null
@@ -1,182 +0,0 @@
-/******************************************************
-A fast mutex for interprocess synchronization.
-mutex_t can be used only within single process,
-but ip_mutex_t also between processes.
-
-(c) 1995 Innobase Oy
-
-Created 9/30/1995 Heikki Tuuri
-*******************************************************/
-
-/* An extra structure created in the private address space of each process
-which creates or opens the ip mutex. */
-
-struct ip_mutex_hdl_struct {
- ip_mutex_t* ip_mutex; /* pointer to ip mutex */
- os_event_t released; /* event which signals that the mutex
- is released; this is obtained from
- create or open of an ip mutex */
- os_mutex_t exclude; /* os mutex obtained when ip mutex is
- created or opened */
-};
-
-
-UNIV_INLINE
-ulint
-ip_mutex_get_waiters(
-volatile ip_mutex_t* ipm);
-UNIV_INLINE
-void
-ip_mutex_set_waiters(
-volatile ip_mutex_t* ipm,
- ulint flag);
-UNIV_INLINE
-mutex_t*
-ip_mutex_get_mutex(
- ip_mutex_t* ipm);
-
-
-/******************************************************************
-Accessor functions for ip mutex. */
-UNIV_INLINE
-ulint
-ip_mutex_get_waiters(
-volatile ip_mutex_t* ipm)
-{
- return(ipm->waiters);
-}
-UNIV_INLINE
-void
-ip_mutex_set_waiters(
-volatile ip_mutex_t* ipm,
- ulint flag)
-{
- ipm->waiters = flag;
-}
-UNIV_INLINE
-mutex_t*
-ip_mutex_get_mutex(
- ip_mutex_t* ipm)
-{
- return(&(ipm->mutex));
-}
-
-/******************************************************************
-Reserves an ip mutex. */
-UNIV_INLINE
-ulint
-ip_mutex_enter(
-/*===========*/
- /* out: 0 if success,
- SYNC_TIME_EXCEEDED if timeout */
- ip_mutex_hdl_t* ip_mutex_hdl, /* in: pointer to ip mutex handle */
- ulint time) /* in: maximum time to wait, in
- microseconds, or
- SYNC_INFINITE_TIME */
-{
- mutex_t* mutex;
- os_event_t released;
- os_mutex_t exclude;
- ip_mutex_t* ip_mutex;
- ulint loop_count;
- ulint ret;
-
- ip_mutex = ip_mutex_hdl->ip_mutex;
- released = ip_mutex_hdl->released;
- exclude = ip_mutex_hdl->exclude;
-
- mutex = ip_mutex_get_mutex(ip_mutex);
-
- loop_count = 0;
-loop:
- loop_count++;
- ut_ad(loop_count < 15);
-
- if (mutex_enter_nowait(mutex, IB__FILE__, __LINE__) == 0) {
- /* Succeeded! */
-
- return(0);
- }
-
- ip_mutex_system_call_count++;
-
- os_event_reset(released);
-
- /* Order is important here: FIRST reset event, then set waiters */
- ip_mutex_set_waiters(ip_mutex, 1);
-
- if (mutex_enter_nowait(mutex, IB__FILE__, __LINE__) == 0) {
- /* Succeeded! */
-
- return(0);
- }
-
- if (time == SYNC_INFINITE_TIME) {
- time = OS_SYNC_INFINITE_TIME;
- }
-
- /* Suspend to wait for release */
-
- ip_mutex_system_call_count++;
-
- ret = os_event_wait_time(released, time);
-
- ip_mutex_system_call_count++;
-
- os_mutex_enter(exclude);
- ip_mutex_system_call_count++;
- os_mutex_exit(exclude);
-
- if (ret != 0) {
- ut_a(ret == OS_SYNC_TIME_EXCEEDED);
-
- return(SYNC_TIME_EXCEEDED);
- }
-
- goto loop;
-}
-
-/******************************************************************
-Releases an ip mutex. */
-UNIV_INLINE
-void
-ip_mutex_exit(
-/*==========*/
- ip_mutex_hdl_t* ip_mutex_hdl) /* in: pointer to ip mutex handle */
-{
- mutex_t* mutex;
- os_event_t released;
- os_mutex_t exclude;
- ip_mutex_t* ip_mutex;
-
- ip_mutex = ip_mutex_hdl->ip_mutex;
- released = ip_mutex_hdl->released;
- exclude = ip_mutex_hdl->exclude;
-
- mutex = ip_mutex_get_mutex(ip_mutex);
-
- mutex_exit(mutex);
-
- if (ip_mutex_get_waiters(ip_mutex) != 0) {
-
- ip_mutex_set_waiters(ip_mutex, 0);
-
- /* Order is important here: FIRST reset waiters,
- then set event */
-
- ip_mutex_system_call_count++;
- os_mutex_enter(exclude);
-
- /* The use of the exclude mutex seems to prevent some
- kind of a convoy problem in the test tsproc.c. We do
- not know why. */
-
- ip_mutex_system_call_count++;
-
- os_event_set(released);
-
- ip_mutex_system_call_count++;
-
- os_mutex_exit(exclude);
- }
-}
diff --git a/innobase/include/sync0rw.h b/innobase/include/sync0rw.h
index 82123a529a3..63b01ffac80 100644
--- a/innobase/include/sync0rw.h
+++ b/innobase/include/sync0rw.h
@@ -62,7 +62,7 @@ location (which must be appropriately aligned). The rw-lock is initialized
to the non-locked state. Explicit freeing of the rw-lock with rw_lock_free
is necessary only if the memory block containing it is freed. */
-#define rw_lock_create(L) rw_lock_create_func((L), IB__FILE__, __LINE__)
+#define rw_lock_create(L) rw_lock_create_func((L), __FILE__, __LINE__)
/*=====================*/
/**********************************************************************
Creates, or rather, initializes an rw-lock object in a specified memory
@@ -74,7 +74,7 @@ void
rw_lock_create_func(
/*================*/
rw_lock_t* lock, /* in: pointer to memory */
- char* cfile_name, /* in: file name where created */
+ const char* cfile_name, /* in: file name where created */
ulint cline); /* in: file line where created */
/**********************************************************************
Calling this function is obligatory only if the memory buffer containing
@@ -100,19 +100,19 @@ NOTE! The following macros should be used in rw s-locking, not the
corresponding function. */
#define rw_lock_s_lock(M) rw_lock_s_lock_func(\
- (M), 0, IB__FILE__, __LINE__)
+ (M), 0, __FILE__, __LINE__)
/******************************************************************
NOTE! The following macros should be used in rw s-locking, not the
corresponding function. */
#define rw_lock_s_lock_gen(M, P) rw_lock_s_lock_func(\
- (M), (P), IB__FILE__, __LINE__)
+ (M), (P), __FILE__, __LINE__)
/******************************************************************
NOTE! The following macros should be used in rw s-locking, not the
corresponding function. */
#define rw_lock_s_lock_nowait(M) rw_lock_s_lock_func_nowait(\
- (M), IB__FILE__, __LINE__)
+ (M), __FILE__, __LINE__)
/**********************************************************************
NOTE! Use the corresponding macro, not directly this function, except if
you supply the file name and line number. Lock an rw-lock in shared mode
@@ -127,7 +127,7 @@ rw_lock_s_lock_func(
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass, /* in: pass value; != 0, if the lock will
be passed to another thread to unlock */
- char* file_name,/* in: file name where lock requested */
+ const char* file_name,/* in: file name where lock requested */
ulint line); /* in: line where requested */
/**********************************************************************
NOTE! Use the corresponding macro, not directly this function, except if
@@ -139,7 +139,7 @@ rw_lock_s_lock_func_nowait(
/*=======================*/
/* out: TRUE if success */
rw_lock_t* lock, /* in: pointer to rw-lock */
- char* file_name,/* in: file name where lock requested */
+ const char* file_name,/* in: file name where lock requested */
ulint line); /* in: line where requested */
/**********************************************************************
NOTE! Use the corresponding macro, not directly this function! Lock an
@@ -151,7 +151,7 @@ rw_lock_x_lock_func_nowait(
/*=======================*/
/* out: TRUE if success */
rw_lock_t* lock, /* in: pointer to rw-lock */
- char* file_name,/* in: file name where lock requested */
+ const char* file_name,/* in: file name where lock requested */
ulint line); /* in: line where requested */
/**********************************************************************
Releases a shared mode lock. */
@@ -186,19 +186,19 @@ NOTE! The following macro should be used in rw x-locking, not the
corresponding function. */
#define rw_lock_x_lock(M) rw_lock_x_lock_func(\
- (M), 0, IB__FILE__, __LINE__)
+ (M), 0, __FILE__, __LINE__)
/******************************************************************
NOTE! The following macro should be used in rw x-locking, not the
corresponding function. */
#define rw_lock_x_lock_gen(M, P) rw_lock_x_lock_func(\
- (M), (P), IB__FILE__, __LINE__)
+ (M), (P), __FILE__, __LINE__)
/******************************************************************
NOTE! The following macros should be used in rw x-locking, not the
corresponding function. */
#define rw_lock_x_lock_nowait(M) rw_lock_x_lock_func_nowait(\
- (M), IB__FILE__, __LINE__)
+ (M), __FILE__, __LINE__)
/**********************************************************************
NOTE! Use the corresponding macro, not directly this function! Lock an
rw-lock in exclusive mode for the current thread. If the rw-lock is locked
@@ -215,7 +215,7 @@ rw_lock_x_lock_func(
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass, /* in: pass value; != 0, if the lock will
be passed to another thread to unlock */
- char* file_name,/* in: file name where lock requested */
+ const char* file_name,/* in: file name where lock requested */
ulint line); /* in: line where requested */
/**********************************************************************
Releases an exclusive mode lock. */
@@ -253,9 +253,9 @@ UNIV_INLINE
void
rw_lock_s_lock_direct(
/*==================*/
- rw_lock_t* lock /* in: pointer to rw-lock */
- ,char* file_name, /* in: file name where lock requested */
- ulint line /* in: line where requested */
+ rw_lock_t* lock, /* in: pointer to rw-lock */
+ const char* file_name, /* in: file name where requested */
+ ulint line /* in: line where lock requested */
);
/**********************************************************************
Low-level function which locks an rw-lock in x-mode when we know that it
@@ -265,9 +265,9 @@ UNIV_INLINE
void
rw_lock_x_lock_direct(
/*==================*/
- rw_lock_t* lock /* in: pointer to rw-lock */
- ,char* file_name, /* in: file name where lock requested */
- ulint line /* in: line where requested */
+ rw_lock_t* lock, /* in: pointer to rw-lock */
+ const char* file_name, /* in: file name where requested */
+ ulint line /* in: line where lock requested */
);
/**********************************************************************
This function is used in the insert buffer to move the ownership of an
@@ -451,10 +451,10 @@ struct rw_lock_struct {
#endif /* UNIV_SYNC_DEBUG */
ulint level; /* Level in the global latching
order; default SYNC_LEVEL_NONE */
- char* cfile_name; /* File name where lock created */
+ const char* cfile_name;/* File name where lock created */
ulint cline; /* Line where created */
- char* last_s_file_name;/* File name where last time s-locked */
- char* last_x_file_name;/* File name where last time x-locked */
+ const char* last_s_file_name;/* File name where last s-locked */
+ const char* last_x_file_name;/* File name where last x-locked */
ulint last_s_line; /* Line number where last time s-locked */
ulint last_x_line; /* Line number where last time x-locked */
ulint magic_n;
@@ -471,7 +471,7 @@ struct rw_lock_debug_struct {
ulint pass; /* Pass value given in the lock operation */
ulint lock_type; /* Type of the lock: RW_LOCK_EX,
RW_LOCK_SHARED, RW_LOCK_WAIT_EX */
- char* file_name; /* File name where the lock was obtained */
+ const char* file_name;/* File name where the lock was obtained */
ulint line; /* Line where the rw-lock was locked */
UT_LIST_NODE_T(rw_lock_debug_t) list;
/* Debug structs are linked in a two-way
diff --git a/innobase/include/sync0rw.ic b/innobase/include/sync0rw.ic
index 8fc93f4a9da..655bd7f6517 100644
--- a/innobase/include/sync0rw.ic
+++ b/innobase/include/sync0rw.ic
@@ -18,7 +18,7 @@ rw_lock_s_lock_spin(
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass, /* in: pass value; != 0, if the lock will
be passed to another thread to unlock */
- char* file_name,/* in: file name where lock requested */
+ const char* file_name,/* in: file name where lock requested */
ulint line); /* in: line where requested */
#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
@@ -130,7 +130,7 @@ rw_lock_s_lock_low(
ulint pass __attribute__((unused)),
/* in: pass value; != 0, if the lock will be
passed to another thread to unlock */
- char* file_name, /* in: file name where lock requested */
+ const char* file_name, /* in: file name where lock requested */
ulint line) /* in: line where requested */
{
#ifdef UNIV_SYNC_DEBUG
@@ -163,9 +163,9 @@ UNIV_INLINE
void
rw_lock_s_lock_direct(
/*==================*/
- rw_lock_t* lock, /* in: pointer to rw-lock */
- char* file_name,/* in: file name where lock requested */
- ulint line) /* in: line where requested */
+ rw_lock_t* lock, /* in: pointer to rw-lock */
+ const char* file_name, /* in: file name where requested */
+ ulint line) /* in: line where lock requested */
{
ut_ad(lock->writer == RW_LOCK_NOT_LOCKED);
ut_ad(rw_lock_get_reader_count(lock) == 0);
@@ -189,9 +189,9 @@ UNIV_INLINE
void
rw_lock_x_lock_direct(
/*==================*/
- rw_lock_t* lock, /* in: pointer to rw-lock */
- char* file_name, /* in: file name where lock requested */
- ulint line) /* in: line where requested */
+ rw_lock_t* lock, /* in: pointer to rw-lock */
+ const char* file_name, /* in: file name where requested */
+ ulint line) /* in: line where lock requested */
{
ut_ad(rw_lock_validate(lock));
ut_ad(rw_lock_get_reader_count(lock) == 0);
@@ -223,7 +223,7 @@ rw_lock_s_lock_func(
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass, /* in: pass value; != 0, if the lock will
be passed to another thread to unlock */
- char* file_name, /* in: file name where lock requested */
+ const char* file_name,/* in: file name where lock requested */
ulint line) /* in: line where requested */
{
/* NOTE: As we do not know the thread ids for threads which have
@@ -267,7 +267,7 @@ rw_lock_s_lock_func_nowait(
/*=======================*/
/* out: TRUE if success */
rw_lock_t* lock, /* in: pointer to rw-lock */
- char* file_name,/* in: file name where lock requested */
+ const char* file_name,/* in: file name where lock requested */
ulint line) /* in: line where requested */
{
ibool success = FALSE;
@@ -304,7 +304,7 @@ rw_lock_x_lock_func_nowait(
/*=======================*/
/* out: TRUE if success */
rw_lock_t* lock, /* in: pointer to rw-lock */
- char* file_name, /* in: file name where lock requested */
+ const char* file_name,/* in: file name where lock requested */
ulint line) /* in: line where requested */
{
ibool success = FALSE;
diff --git a/innobase/include/sync0sync.h b/innobase/include/sync0sync.h
index 0cc48d5f299..4307ca5ba0c 100644
--- a/innobase/include/sync0sync.h
+++ b/innobase/include/sync0sync.h
@@ -36,7 +36,7 @@ in the reset state. Explicit freeing of the mutex with mutex_free is
necessary only if the memory block containing it is freed. */
-#define mutex_create(M) mutex_create_func((M), IB__FILE__, __LINE__)
+#define mutex_create(M) mutex_create_func((M), __FILE__, __LINE__)
/*===================*/
/**********************************************************************
Creates, or rather, initializes a mutex object in a specified memory
@@ -48,7 +48,7 @@ void
mutex_create_func(
/*==============*/
mutex_t* mutex, /* in: pointer to memory */
- char* cfile_name, /* in: file name where created */
+ const char* cfile_name, /* in: file name where created */
ulint cline); /* in: file line where created */
/**********************************************************************
Calling this function is obligatory only if the memory buffer containing
@@ -64,7 +64,7 @@ mutex_free(
NOTE! The following macro should be used in mutex locking, not the
corresponding function. */
-#define mutex_enter(M) mutex_enter_func((M), IB__FILE__, __LINE__)
+#define mutex_enter(M) mutex_enter_func((M), __FILE__, __LINE__)
/**********************************************************************
A noninlined function that reserves a mutex. In ha_innodb.cc we have disabled
inlining of InnoDB functions, and no inlined functions should be called from
@@ -80,7 +80,7 @@ corresponding function. */
/* NOTE! currently same as mutex_enter! */
-#define mutex_enter_fast(M) mutex_enter_func((M), IB__FILE__, __LINE__)
+#define mutex_enter_fast(M) mutex_enter_func((M), __FILE__, __LINE__)
#define mutex_enter_fast_func mutex_enter_func;
/**********************************************************************
NOTE! Use the corresponding macro in the header file, not this function
@@ -92,7 +92,7 @@ void
mutex_enter_func(
/*=============*/
mutex_t* mutex, /* in: pointer to mutex */
- char* file_name, /* in: file name where locked */
+ const char* file_name, /* in: file name where locked */
ulint line); /* in: line where locked */
/************************************************************************
Tries to lock the mutex for the current thread. If the lock is not acquired
@@ -103,9 +103,9 @@ mutex_enter_nowait(
/*===============*/
/* out: 0 if succeed, 1 if not */
mutex_t* mutex, /* in: pointer to mutex */
- char* file_name, /* in: file name where mutex
+ const char* file_name, /* in: file name where mutex
requested */
- ulint line); /* in: line where requested */
+ ulint line); /* in: line where requested */
/**********************************************************************
Unlocks a mutex owned by the current thread. */
UNIV_INLINE
@@ -470,7 +470,7 @@ struct mutex_struct {
#endif /* UNIV_SYNC_DEBUG */
ulint level; /* Level in the global latching
order; default SYNC_LEVEL_NONE */
- char* cfile_name; /* File name where mutex created */
+ const char* cfile_name;/* File name where mutex created */
ulint cline; /* Line where created */
ulint magic_n;
};
diff --git a/innobase/include/sync0sync.ic b/innobase/include/sync0sync.ic
index 758c8524f66..ecb498918e2 100644
--- a/innobase/include/sync0sync.ic
+++ b/innobase/include/sync0sync.ic
@@ -23,7 +23,7 @@ void
mutex_spin_wait(
/*============*/
mutex_t* mutex, /* in: pointer to mutex */
- char* file_name,/* in: file name where mutex requested */
+ const char* file_name,/* in: file name where mutex requested */
ulint line); /* in: line where requested */
#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
@@ -241,9 +241,9 @@ UNIV_INLINE
void
mutex_enter_func(
/*=============*/
- mutex_t* mutex, /* in: pointer to mutex */
- char* file_name,/* in: file name where locked */
- ulint line) /* in: line where locked */
+ mutex_t* mutex, /* in: pointer to mutex */
+ const char* file_name, /* in: file name where locked */
+ ulint line) /* in: line where locked */
{
ut_ad(mutex_validate(mutex));
diff --git a/innobase/include/trx0roll.h b/innobase/include/trx0roll.h
index 0d7126c9c57..aa88fc249fc 100644
--- a/innobase/include/trx0roll.h
+++ b/innobase/include/trx0roll.h
@@ -91,16 +91,12 @@ trx_undo_rec_release(
/*************************************************************************
Starts a rollback operation. */
-void
+que_thr_t*
trx_rollback(
/*=========*/
+ /* out: next query thread to run */
trx_t* trx, /* in: transaction */
- trx_sig_t* sig, /* in: signal starting the rollback */
- que_thr_t** next_thr);/* in/out: next query thread to run;
- if the value which is passed in is
- a pointer to a NULL pointer, then the
- calling function can start running
- a new query thread */
+ trx_sig_t* sig); /* in: signal starting the rollback */
/***********************************************************************
Rollback or clean up transactions which have no user session. If the
transaction already was committed, then we clean up a possible insert
@@ -112,17 +108,12 @@ trx_rollback_or_clean_all_without_sess(void);
/********************************************************************
Finishes a transaction rollback. */
-void
+que_thr_t*
trx_finish_rollback_off_kernel(
/*===========================*/
+ /* out: next query thread to run */
que_t* graph, /* in: undo graph which can now be freed */
- trx_t* trx, /* in: transaction */
- que_thr_t** next_thr);/* in/out: next query thread to run;
- if the value which is passed in is
- a pointer to a NULL pointer, then the
- calling function can start running
- a new query thread; if this parameter is
- NULL, it is ignored */
+ trx_t* trx); /* in: transaction */
/********************************************************************
Builds an undo 'query' graph for a transaction. The actual rollback is
performed by executing this query graph like a query subprocedure call.
@@ -193,7 +184,7 @@ trx_rollback_to_savepoint_for_mysql(
DB_NO_SAVEPOINT,
otherwise DB_SUCCESS */
trx_t* trx, /* in: transaction handle */
- char* savepoint_name, /* in: savepoint name */
+ const char* savepoint_name, /* in: savepoint name */
ib_longlong* mysql_binlog_cache_pos);/* out: the MySQL binlog cache
position corresponding to this
savepoint; MySQL needs this
@@ -211,7 +202,7 @@ trx_savepoint_for_mysql(
/*====================*/
/* out: always DB_SUCCESS */
trx_t* trx, /* in: transaction handle */
- char* savepoint_name, /* in: savepoint name */
+ const char* savepoint_name, /* in: savepoint name */
ib_longlong binlog_cache_pos); /* in: MySQL binlog cache
position corresponding to this
connection at the time of the
diff --git a/innobase/include/trx0sys.h b/innobase/include/trx0sys.h
index 9987955ec76..7d20455ffdf 100644
--- a/innobase/include/trx0sys.h
+++ b/innobase/include/trx0sys.h
@@ -258,7 +258,7 @@ replication has proceeded. */
void
trx_sys_update_mysql_binlog_offset(
/*===============================*/
- char* file_name,/* in: MySQL log file name */
+ const char* file_name,/* in: MySQL log file name */
ib_longlong offset, /* in: position in that log file */
ulint field, /* in: offset of the MySQL log info field in
the trx sys header */
diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h
index 71269cb1e4e..9b7ac22e617 100644
--- a/innobase/include/trx0trx.h
+++ b/innobase/include/trx0trx.h
@@ -194,9 +194,10 @@ trx_end_lock_wait(
/********************************************************************
Sends a signal to a trx object. */
-ibool
+que_thr_t*
trx_sig_send(
/*=========*/
+ /* out: next query thread to run */
/* out: TRUE if the signal was
successfully delivered */
trx_t* trx, /* in: trx handle */
@@ -206,27 +207,17 @@ trx_sig_send(
que_thr_t* receiver_thr, /* in: query thread which wants the
reply, or NULL; if type is
TRX_SIG_END_WAIT, this must be NULL */
- trx_savept_t* savept, /* in: possible rollback savepoint, or
+ trx_savept_t* savept); /* in: possible rollback savepoint, or
NULL */
- que_thr_t** next_thr); /* in/out: next query thread to run;
- if the value which is passed in is
- a pointer to a NULL pointer, then the
- calling function can start running
- a new query thread; if the parameter
- is NULL, it is ignored */
/********************************************************************
Send the reply message when a signal in the queue of the trx has
been handled. */
-void
+que_thr_t*
trx_sig_reply(
/*==========*/
- trx_sig_t* sig, /* in: signal */
- que_thr_t** next_thr); /* in/out: next query thread to run;
- if the value which is passed in is
- a pointer to a NULL pointer, then the
- calling function can start running
- a new query thread */
+ /* out: next query thread to run */
+ trx_sig_t* sig); /* in: signal */
/********************************************************************
Removes the signal object from a trx signal queue. */
@@ -238,15 +229,11 @@ trx_sig_remove(
/********************************************************************
Starts handling of a trx signal. */
-void
+que_thr_t*
trx_sig_start_handle(
/*=================*/
- trx_t* trx, /* in: trx handle */
- que_thr_t** next_thr); /* in/out: next query thread to run;
- if the value which is passed in is
- a pointer to a NULL pointer, then the
- calling function can start running
- a new query thread */
+ /* out: next query thread to run, or NULL */
+ trx_t* trx); /* in: trx handle */
/********************************************************************
Ends signal handling. If the session is in the error state, and
trx->graph_before_signal_handling != NULL, returns control to the error
@@ -275,13 +262,15 @@ trx_commit_step(
que_thr_t* thr); /* in: query thread */
/**************************************************************************
Prints info about a transaction to the standard output. The caller must
-own the kernel mutex. */
+own the kernel mutex and must have called
+innobase_mysql_prepare_print_arbitrary_thd(), unless he knows that MySQL or
+InnoDB cannot meanwhile change the info printed here. */
void
trx_print(
/*======*/
FILE* f, /* in: output stream */
- trx_t* trx); /* in: transaction */
+ trx_t* trx); /* in: transaction */
/* Signal to a transaction */
@@ -313,7 +302,7 @@ struct trx_struct{
ulint magic_n;
/* All the next fields are protected by the kernel mutex, except the
undo logs which are protected by undo_mutex */
- char* op_info; /* English text describing the
+ const char* op_info; /* English text describing the
current operation, or an empty
string */
ulint type; /* TRX_USER, TRX_PURGE */
@@ -356,7 +345,7 @@ struct trx_struct{
char** mysql_query_str;/* pointer to the field in mysqld_thd
which contains the pointer to the
current SQL query string */
- char* mysql_log_file_name;
+ const char* mysql_log_file_name;
/* if MySQL binlog is used, this field
contains a pointer to the latest file
name; this is NULL if binlog is not
@@ -364,7 +353,7 @@ struct trx_struct{
ib_longlong mysql_log_offset;/* if MySQL binlog is used, this field
contains the end offset of the binlog
entry */
- char* mysql_master_log_file_name;
+ const char* mysql_master_log_file_name;
/* if the database server is a MySQL
replication slave, we have here the
master binlog name up to which
diff --git a/innobase/include/univ.i b/innobase/include/univ.i
index cd471a89607..be71d4211b3 100644
--- a/innobase/include/univ.i
+++ b/innobase/include/univ.i
@@ -242,11 +242,6 @@ contains the sum of the following flag and the locally stored len. */
#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE)
-/* The following definition of __FILE__ removes compiler warnings
-associated with const char* / char* mismatches with __FILE__ */
-
-#define IB__FILE__ ((char*)__FILE__)
-
#include <stdio.h>
#include "ut0dbg.h"
#include "ut0ut.h"
diff --git a/innobase/include/usr0sess.h b/innobase/include/usr0sess.h
index c7bcfb20fed..aeff7191e68 100644
--- a/innobase/include/usr0sess.h
+++ b/innobase/include/usr0sess.h
@@ -38,7 +38,6 @@ sess_try_close(
/* The session handle. All fields are protected by the kernel mutex */
struct sess_struct{
- ulint state; /* state of the session */
trx_t* trx; /* transaction object permanently
assigned for the session: the
transaction instance designated by the
@@ -49,11 +48,6 @@ struct sess_struct{
session */
};
-/* Session states */
-#define SESS_ACTIVE 1
-#define SESS_ERROR 2 /* session contains an error message
- which has not yet been communicated
- to the client */
#ifndef UNIV_NONINL
#include "usr0sess.ic"
#endif
diff --git a/innobase/include/ut0dbg.h b/innobase/include/ut0dbg.h
index 085b4811a73..a155f68bd12 100644
--- a/innobase/include/ut0dbg.h
+++ b/innobase/include/ut0dbg.h
@@ -27,7 +27,7 @@ extern const char* ut_dbg_msg_stop;
if (!((ulint)(EXPR) + ut_dbg_zero)) {\
ut_print_timestamp(stderr);\
fprintf(stderr, ut_dbg_msg_assert_fail,\
- os_thread_pf(os_thread_get_curr_id()), IB__FILE__,\
+ os_thread_pf(os_thread_get_curr_id()), __FILE__,\
(ulint)__LINE__);\
fputs("InnoDB: Failing assertion: " #EXPR "\n", stderr);\
fputs(ut_dbg_msg_trap, stderr);\
@@ -36,7 +36,7 @@ extern const char* ut_dbg_msg_stop;
}\
if (ut_dbg_stop_threads) {\
fprintf(stderr, ut_dbg_msg_stop,\
- os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\
+ os_thread_pf(os_thread_get_curr_id()), __FILE__, (ulint)__LINE__);\
os_thread_sleep(1000000000);\
}\
} while (0)
@@ -44,7 +44,7 @@ extern const char* ut_dbg_msg_stop;
#define ut_error do {\
ut_print_timestamp(stderr);\
fprintf(stderr, ut_dbg_msg_assert_fail,\
- os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\
+ os_thread_pf(os_thread_get_curr_id()), __FILE__, (ulint)__LINE__);\
fprintf(stderr, ut_dbg_msg_trap);\
ut_dbg_stop_threads = TRUE;\
if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL;\
diff --git a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h
index b208fac8691..85b99efff68 100644
--- a/innobase/include/ut0mem.h
+++ b/innobase/include/ut0mem.h
@@ -18,15 +18,15 @@ extern ulint ut_total_allocated_memory;
UNIV_INLINE
void*
-ut_memcpy(void* dest, void* sour, ulint n);
+ut_memcpy(void* dest, const void* sour, ulint n);
UNIV_INLINE
void*
-ut_memmove(void* dest, void* sour, ulint n);
+ut_memmove(void* dest, const void* sour, ulint n);
UNIV_INLINE
int
-ut_memcmp(void* str1, void* str2, ulint n);
+ut_memcmp(const void* str1, const void* str2, ulint n);
/**************************************************************************
@@ -75,7 +75,7 @@ ut_free_all_mem(void);
UNIV_INLINE
char*
-ut_strcpy(char* dest, char* sour);
+ut_strcpy(char* dest, const char* sour);
UNIV_INLINE
ulint
@@ -83,7 +83,7 @@ ut_strlen(const char* str);
UNIV_INLINE
int
-ut_strcmp(void* str1, void* str2);
+ut_strcmp(const void* str1, const void* str2);
/**************************************************************************
Determine the length of a string when it is quoted with ut_strcpyq(). */
@@ -118,27 +118,6 @@ ut_memcpyq(
const char* src, /* in: string to be quoted */
ulint len); /* in: length of src */
-/**************************************************************************
-Catenates two strings into newly allocated memory. The memory must be freed
-using mem_free. */
-
-char*
-ut_str_catenate(
-/*============*/
- /* out, own: catenated null-terminated string */
- char* str1, /* in: null-terminated string */
- char* str2); /* in: null-terminated string */
-
-/**************************************************************************
-Return a copy of the given string. The returned string must be freed
-using mem_free. */
-
-char*
-ut_strdup(
-/*======*/
- /* out, own: cnull-terminated string */
- char* str); /* in: null-terminated string */
-
#ifndef UNIV_NONINL
#include "ut0mem.ic"
#endif
diff --git a/innobase/include/ut0mem.ic b/innobase/include/ut0mem.ic
index 951d9538424..3bb30a80f22 100644
--- a/innobase/include/ut0mem.ic
+++ b/innobase/include/ut0mem.ic
@@ -8,28 +8,28 @@ Created 5/30/1994 Heikki Tuuri
UNIV_INLINE
void*
-ut_memcpy(void* dest, void* sour, ulint n)
+ut_memcpy(void* dest, const void* sour, ulint n)
{
return(memcpy(dest, sour, n));
}
UNIV_INLINE
void*
-ut_memmove(void* dest, void* sour, ulint n)
+ut_memmove(void* dest, const void* sour, ulint n)
{
return(memmove(dest, sour, n));
}
UNIV_INLINE
int
-ut_memcmp(void* str1, void* str2, ulint n)
+ut_memcmp(const void* str1, const void* str2, ulint n)
{
return(memcmp(str1, str2, n));
}
UNIV_INLINE
char*
-ut_strcpy(char* dest, char* sour)
+ut_strcpy(char* dest, const char* sour)
{
return(strcpy(dest, sour));
}
@@ -43,9 +43,9 @@ ut_strlen(const char* str)
UNIV_INLINE
int
-ut_strcmp(void* str1, void* str2)
+ut_strcmp(const void* str1, const void* str2)
{
- return(strcmp((char*)str1, (char*)str2));
+ return(strcmp((const char*)str1, (const char*)str2));
}
/**************************************************************************
diff --git a/innobase/include/ut0rnd.h b/innobase/include/ut0rnd.h
index c8ef0dd4001..aeec5d2f6eb 100644
--- a/innobase/include/ut0rnd.h
+++ b/innobase/include/ut0rnd.h
@@ -92,17 +92,17 @@ UNIV_INLINE
ulint
ut_fold_string(
/*===========*/
- /* out: folded value */
- char* str); /* in: null-terminated string */
+ /* out: folded value */
+ const char* str); /* in: null-terminated string */
/*****************************************************************
Folds a binary string. */
UNIV_INLINE
ulint
ut_fold_binary(
/*===========*/
- /* out: folded value */
- byte* str, /* in: string of bytes */
- ulint len); /* in: length */
+ /* out: folded value */
+ const byte* str, /* in: string of bytes */
+ ulint len); /* in: length */
/***************************************************************
Looks for a prime number slightly greater than the given argument.
The prime is chosen so that it is not near any power of 2. */
diff --git a/innobase/include/ut0rnd.ic b/innobase/include/ut0rnd.ic
index 5493c37404a..06d7012f60b 100644
--- a/innobase/include/ut0rnd.ic
+++ b/innobase/include/ut0rnd.ic
@@ -173,8 +173,8 @@ UNIV_INLINE
ulint
ut_fold_string(
/*===========*/
- /* out: folded value */
- char* str) /* in: null-terminated string */
+ /* out: folded value */
+ const char* str) /* in: null-terminated string */
{
#ifdef UNIV_DEBUG
ulint i = 0;
@@ -203,9 +203,9 @@ UNIV_INLINE
ulint
ut_fold_binary(
/*===========*/
- /* out: folded value */
- byte* str, /* in: string of bytes */
- ulint len) /* in: length */
+ /* out: folded value */
+ const byte* str, /* in: string of bytes */
+ ulint len) /* in: length */
{
ulint i;
ulint fold = 0;
diff --git a/innobase/include/ut0ut.h b/innobase/include/ut0ut.h
index 6c173f5cba9..f4a682c57ec 100644
--- a/innobase/include/ut0ut.h
+++ b/innobase/include/ut0ut.h
@@ -17,53 +17,6 @@ Created 1/20/1994 Heikki Tuuri
typedef time_t ib_time_t;
-
-/************************************************************
-On the 64-bit Windows we substitute the format string
-%l -> %I64
-because we define ulint as unsigned __int64 and lint as __int64 on Windows,
-and both the Microsoft and Intel C compilers require the format string
-%I64 in that case instead of %l. */
-
-int
-ut_printf(
-/*======*/
- /* out: the number of characters written, or
- negative in case of an error */
- const char* format, /* in: format of prints */
- ...); /* in: arguments to be printed */
-/************************************************************
-On the 64-bit Windows we substitute the format string
-%l -> %I64
-because we define ulint as unsigned __int64 and lint as __int64 on Windows,
-and both the Microsoft and Intel C compilers require the format string
-%I64 in that case instead of %l. */
-
-int
-ut_sprintf(
-/*=======*/
- /* out: the number of characters written, or
- negative in case of an error */
- char* buf, /* in: buffer where to print */
- const char* format, /* in: format of prints */
- ...); /* in: arguments to be printed */
-/************************************************************
-On the 64-bit Windows we substitute the format string
-%l -> %I64
-because we define ulint as unsigned __int64 and lint as __int64 on Windows,
-and both the Microsoft and Intel C compilers require the format string
-%I64 in that case instead of %l. */
-
-int
-ut_fprintf(
-/*=======*/
- /* out: the number of characters written, or
- negative in case of an error */
- FILE* stream, /* in: stream where to print */
- const char* format, /* in: format of prints */
- ...) /* in: arguments to be printed */
- __attribute__((__format__ (__printf__, 2, 3)));
-
/************************************************************
Gets the high 32 bits in a ulint. That is makes a shift >> 32,
but since there seem to be compiler bugs in both gcc and Visual C++,
diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c
index 8805a22bb57..223d9af78d1 100644
--- a/innobase/lock/lock0lock.c
+++ b/innobase/lock/lock0lock.c
@@ -17,6 +17,32 @@ Created 5/7/1996 Heikki Tuuri
#include "dict0mem.h"
#include "trx0sys.h"
+
+/* 2 function prototypes copied from ha_innodb.cc: */
+
+/*****************************************************************
+If you want to print a thd that is not associated with the current thread,
+you must call this function before reserving the InnoDB kernel_mutex, to
+protect MySQL from setting thd->query NULL. If you print a thd of the current
+thread, we know that MySQL cannot modify thd->query, and it is not necessary
+to call this. Call innobase_mysql_end_print_arbitrary_thd() after you release
+the kernel_mutex.
+NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this
+function! */
+
+void
+innobase_mysql_prepare_print_arbitrary_thd(void);
+/*============================================*/
+
+/*****************************************************************
+Relases the mutex reserved by innobase_mysql_prepare_print_arbitrary_thd().
+NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this
+function! */
+
+void
+innobase_mysql_end_print_arbitrary_thd(void);
+/*========================================*/
+
/* Restricts the length of search we will do in the waits-for
graph of transactions */
#define LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK 1000000
@@ -1629,7 +1655,8 @@ lock_rec_enqueue_waiting(
" InnoDB: Error: a record lock wait happens in a dictionary operation!\n"
"InnoDB: Table name ", stderr);
ut_print_name(stderr, index->table_name);
- fputs(". Send a bug report to mysql@lists.mysql.com\n",
+ fputs(".\n"
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n",
stderr);
}
@@ -3269,7 +3296,8 @@ lock_table_enqueue_waiting(
" InnoDB: Error: a table lock wait happens in a dictionary operation!\n"
"InnoDB: Table name ", stderr);
ut_print_name(stderr, table->name);
- fputs(". Send a bug report to mysql@lists.mysql.com\n",
+ fputs(".\n"
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n",
stderr);
}
@@ -3889,7 +3917,7 @@ lock_rec_print(
page = buf_page_get_gen(space, page_no, RW_NO_LATCH,
NULL, BUF_GET_IF_IN_POOL,
- IB__FILE__, __LINE__, &mtr);
+ __FILE__, __LINE__, &mtr);
if (page) {
page = buf_page_get_nowait(space, page_no, RW_S_LATCH, &mtr);
@@ -3975,6 +4003,11 @@ lock_print_info(
ulint i;
mtr_t mtr;
+ /* We must protect the MySQL thd->query field with a MySQL mutex, and
+ because the MySQL mutex must be reserved before the kernel_mutex of
+ InnoDB, we call innobase_mysql_prepare_print_arbitrary_thd() here. */
+
+ innobase_mysql_prepare_print_arbitrary_thd();
lock_mutex_enter_kernel();
if (lock_deadlock_found) {
@@ -4038,6 +4071,7 @@ loop:
if (trx == NULL) {
lock_mutex_exit_kernel();
+ innobase_mysql_end_print_arbitrary_thd();
ut_ad(lock_validate());
@@ -4102,6 +4136,7 @@ loop:
if (load_page_first) {
lock_mutex_exit_kernel();
+ innobase_mysql_end_print_arbitrary_thd();
mtr_start(&mtr);
@@ -4111,6 +4146,7 @@ loop:
load_page_first = FALSE;
+ innobase_mysql_prepare_print_arbitrary_thd();
lock_mutex_enter_kernel();
goto loop;
diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c
index 4f4220962f0..65fb3466ad5 100644
--- a/innobase/log/log0recv.c
+++ b/innobase/log/log0recv.c
@@ -1080,7 +1080,7 @@ recv_recover_page(
success = buf_page_get_known_nowait(RW_X_LATCH, page,
BUF_KEEP_OLD,
- IB__FILE__, __LINE__,
+ __FILE__, __LINE__,
&mtr);
ut_a(success);
@@ -1664,7 +1664,7 @@ recv_compare_spaces(
frame = buf_page_get_gen(space1, page_no, RW_S_LATCH, NULL,
BUF_GET_IF_IN_POOL,
- IB__FILE__, __LINE__,
+ __FILE__, __LINE__,
&mtr);
if (frame) {
#ifdef UNIV_SYNC_DEBUG
@@ -1679,7 +1679,7 @@ recv_compare_spaces(
frame = buf_page_get_gen(space2, page_no, RW_S_LATCH, NULL,
BUF_GET_IF_IN_POOL,
- IB__FILE__, __LINE__,
+ __FILE__, __LINE__,
&mtr);
if (frame) {
#ifdef UNIV_SYNC_DEBUG
diff --git a/innobase/mem/mem0mem.c b/innobase/mem/mem0mem.c
index e1b9a762381..c090b25a632 100644
--- a/innobase/mem/mem0mem.c
+++ b/innobase/mem/mem0mem.c
@@ -92,11 +92,11 @@ with mem_free. */
void*
mem_alloc_func_noninline(
/*=====================*/
- /* out, own: free storage, NULL if did not
- succeed */
- ulint n, /* in: desired number of bytes */
- char* file_name, /* in: file name where created */
- ulint line /* in: line where created */
+ /* out, own: free storage,
+ NULL if did not succeed */
+ ulint n, /* in: desired number of bytes */
+ const char* file_name, /* in: file name where created */
+ ulint line /* in: line where created */
)
{
return(mem_alloc_func(n, file_name, line));
@@ -108,18 +108,18 @@ Creates a memory heap block where data can be allocated. */
mem_block_t*
mem_heap_create_block(
/*==================*/
- /* out, own: memory heap block, NULL if did not
- succeed */
- mem_heap_t* heap,/* in: memory heap or NULL if first block should
- be created */
- ulint n, /* in: number of bytes needed for user data, or
- if init_block is not NULL, its size in bytes */
- void* init_block, /* in: init block in fast create, type must be
- MEM_HEAP_DYNAMIC */
- ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC, or
- MEM_HEAP_BUFFER possibly ORed to MEM_HEAP_BTR_SEARCH */
- char* file_name,/* in: file name where created */
- ulint line) /* in: line where created */
+ /* out, own: memory heap block,
+ NULL if did not succeed */
+ mem_heap_t* heap, /* in: memory heap or NULL if first block
+ should be created */
+ ulint n, /* in: number of bytes needed for user data, or
+ if init_block is not NULL, its size in bytes */
+ void* init_block, /* in: init block in fast create,
+ type must be MEM_HEAP_DYNAMIC */
+ ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC or
+ MEM_HEAP_BUFFER */
+ const char* file_name,/* in: file name where created */
+ ulint line) /* in: line where created */
{
mem_block_t* block;
ulint len;
diff --git a/innobase/mem/mem0pool.c b/innobase/mem/mem0pool.c
index 7f36b37f734..0227c2d0969 100644
--- a/innobase/mem/mem0pool.c
+++ b/innobase/mem/mem0pool.c
@@ -97,8 +97,6 @@ struct mem_pool_struct{
/* The common memory pool */
mem_pool_t* mem_comm_pool = NULL;
-ulint mem_out_of_mem_err_msg_count = 0;
-
/* We use this counter to check that the mem pool mutex does not leak;
this is to track a strange assertion failure reported at
mysql@lists.mysql.com */
@@ -266,8 +264,6 @@ mem_pool_fill_free_list(
if (i >= 63) {
/* We come here when we have run out of space in the
memory pool: */
-
- mem_out_of_mem_err_msg_count++;
return(FALSE);
}
@@ -461,17 +457,13 @@ mem_area_free(
ulint size;
ulint n;
- if (mem_out_of_mem_err_msg_count > 0) {
- /* It may be that the area was really allocated from the
- OS with regular malloc: check if ptr points within
- our memory pool */
+ /* It may be that the area was really allocated from the OS with
+ regular malloc: check if ptr points within our memory pool */
- if ((byte*)ptr < pool->buf
- || (byte*)ptr >= pool->buf + pool->size) {
- ut_free(ptr);
+ if ((byte*)ptr < pool->buf || (byte*)ptr >= pool->buf + pool->size) {
+ ut_free(ptr);
- return;
- }
+ return;
}
area = (mem_area_t*) (((byte*)ptr) - MEM_AREA_EXTRA_SIZE);
diff --git a/innobase/os/Makefile.am b/innobase/os/Makefile.am
index 132ce07c83b..3b09a10efb5 100644
--- a/innobase/os/Makefile.am
+++ b/innobase/os/Makefile.am
@@ -19,7 +19,7 @@ include ../include/Makefile.i
noinst_LIBRARIES = libos.a
-libos_a_SOURCES = os0proc.c os0shm.c os0sync.c os0thread.c os0file.c
+libos_a_SOURCES = os0proc.c os0sync.c os0thread.c os0file.c
EXTRA_PROGRAMS =
diff --git a/innobase/os/makefilewin b/innobase/os/makefilewin
index 08dba0e5e47..8bc8d08611b 100644
--- a/innobase/os/makefilewin
+++ b/innobase/os/makefilewin
@@ -1,7 +1,7 @@
include ..\include\makefile.i
-os.lib: os0sync.obj os0thread.obj os0shm.obj os0proc.obj os0file.obj
- lib -out:..\libs\os.lib os0sync.obj os0thread.obj os0shm.obj os0proc.obj os0file.obj
+os.lib: os0sync.obj os0thread.obj os0proc.obj os0file.obj
+ lib -out:..\libs\os.lib os0sync.obj os0thread.obj os0proc.obj os0file.obj
os0sync.obj: os0sync.c
$(CCOM) $(CFLW) -c os0sync.c
@@ -9,9 +9,6 @@ os0sync.obj: os0sync.c
os0thread.obj: os0thread.c
$(CCOM) $(CFLW) -c os0thread.c
-os0shm.obj: os0shm.c
- $(CCOM) $(CFLW) -c os0shm.c
-
os0proc.obj: os0proc.c
$(CCOM) $(CFLW) -c os0proc.c
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index 3f14a2158ed..5f5060c7464 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -70,7 +70,7 @@ struct os_aio_slot_struct{
bytes */
ulint offset_high; /* 32 high bits of file offset */
os_file_t file; /* file where to read or write */
- char* name; /* file name or path */
+ const char* name; /* file name or path */
ibool io_already_done;/* used only in simulated aio:
TRUE if the physical i/o already
made and only the slot message
@@ -369,7 +369,16 @@ os_file_handle_error(
return(FALSE);
}
-#if !defined(__WIN__) && !defined(UNIV_HOTBACKUP)
+#undef USE_FILE_LOCK
+#define USE_FILE_LOCK
+#if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__FreeBSD__)
+/* InnoDB Hot Backup does not lock the data files.
+ * On Windows, mandatory locking is used.
+ * On FreeBSD with LinuxThreads, advisory locking does not work properly.
+ */
+# undef USE_FILE_LOCK
+#endif
+#ifdef USE_FILE_LOCK
/********************************************************************
Obtain an exclusive lock on a file. */
static
@@ -378,22 +387,24 @@ os_file_lock(
/*=========*/
/* out: 0 on success */
int fd, /* in: file descriptor */
- const char* name) /* in: file name */
+ const char* name, /* in: file name */
+ uint lock_type) /* in: lock_type */
{
struct flock lk;
- lk.l_type = F_WRLCK;
+ lk.l_type = lock_type;
lk.l_whence = SEEK_SET;
lk.l_start = lk.l_len = 0;
if (fcntl(fd, F_SETLK, &lk) == -1) {
fprintf(stderr,
- "InnoDB: Unable to lock %s", name);
+ "InnoDB: Unable to lock %s with lock %d, error: %d",
+ name, lock_type, errno);
perror (": fcntl");
close(fd);
return(-1);
}
return 0;
}
-#endif /* !defined(__WIN__) && !defined(UNIV_HOTBACKUP) */
+#endif /* USE_FILE_LOCK */
/********************************************************************
Does error handling when a file operation fails. */
@@ -404,7 +415,7 @@ os_file_handle_error_no_exit(
/* out: TRUE if we should retry the
operation */
os_file_t file, /* in: file pointer */
- char* name, /* in: name of a file or NULL */
+ const char* name, /* in: name of a file or NULL */
const char* operation)/* in: operation */
{
ulint err;
@@ -482,13 +493,15 @@ and '..' items at the start of the directory listing. */
os_file_dir_t
os_file_opendir(
/*============*/
- /* out: directory stream, NULL if error */
- char* dirname, /* in: directory name; it must not contain
- a trailing '\' or '/' */
- ibool error_is_fatal) /* in: TRUE if we should treat an error as a
- fatal error; if we try to open symlinks then
- we do not wish a fatal error if it happens
- not to be a directory */
+ /* out: directory stream, NULL if
+ error */
+ const char* dirname, /* in: directory name; it must not
+ contain a trailing '\' or '/' */
+ ibool error_is_fatal) /* in: TRUE if we should treat an
+ error as a fatal error; if we try to
+ open symlinks then we do not wish a
+ fatal error if it happens not to be
+ a directory */
{
os_file_dir_t dir;
#ifdef __WIN__
@@ -574,7 +587,7 @@ os_file_readdir_next_file(
/*======================*/
/* out: 0 if ok, -1 if error, 1 if at the end
of the directory */
- char* dirname,/* in: directory name or path */
+ const char* dirname,/* in: directory name or path */
os_file_dir_t dir, /* in: directory stream */
os_file_stat_t* info) /* in/out: buffer where the info is returned */
{
@@ -693,12 +706,12 @@ fail_if_exists arguments is true. */
ibool
os_file_create_directory(
/*=====================*/
- /* out: TRUE if call succeeds, FALSE on
- error */
- char* pathname, /* in: directory name as null-terminated
- string */
- ibool fail_if_exists) /* in: if TRUE, pre-existing directory is
- treated as an error. */
+ /* out: TRUE if call succeeds,
+ FALSE on error */
+ const char* pathname, /* in: directory name as
+ null-terminated string */
+ ibool fail_if_exists) /* in: if TRUE, pre-existing directory
+ is treated as an error. */
{
#ifdef __WIN__
BOOL rcode;
@@ -735,18 +748,21 @@ A simple function to open or create a file. */
os_file_t
os_file_create_simple(
/*==================*/
- /* out, own: handle to the file, not defined if error,
- error number can be retrieved with
- os_file_get_last_error */
- char* name, /* in: name of the file or path as a null-terminated
- string */
- ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened
- (if does not exist, error), or OS_FILE_CREATE if a new
- file is created (if exists, error), or
- OS_FILE_CREATE_PATH if new file (if exists, error) and
- subdirectories along its path are created (if needed)*/
- ulint access_type,/* in: OS_FILE_READ_ONLY or OS_FILE_READ_WRITE */
- ibool* success)/* out: TRUE if succeed, FALSE if error */
+ /* out, own: handle to the file, not defined
+ if error, error number can be retrieved with
+ os_file_get_last_error */
+ const char* name, /* in: name of the file or path as a
+ null-terminated string */
+ ulint create_mode,/* in: OS_FILE_OPEN if an existing file is
+ opened (if does not exist, error), or
+ OS_FILE_CREATE if a new file is created
+ (if exists, error), or
+ OS_FILE_CREATE_PATH if new file
+ (if exists, error) and subdirectories along
+ its path are created (if needed)*/
+ ulint access_type,/* in: OS_FILE_READ_ONLY or
+ OS_FILE_READ_WRITE */
+ ibool* success)/* out: TRUE if succeed, FALSE if error */
{
#ifdef __WIN__
os_file_t file;
@@ -852,8 +868,8 @@ try_again:
if (retry) {
goto try_again;
}
-#ifndef UNIV_HOTBACKUP
- } else if (os_file_lock(file, name)) {
+#ifdef USE_FILE_LOCK
+ } else if (os_file_lock(file, name, F_WRLCK)) {
*success = FALSE;
file = -1;
#endif
@@ -871,18 +887,20 @@ A simple function to open or create a file. */
os_file_t
os_file_create_simple_no_error_handling(
/*====================================*/
- /* out, own: handle to the file, not defined if error,
- error number can be retrieved with
- os_file_get_last_error */
- char* name, /* in: name of the file or path as a null-terminated
- string */
- ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened
- (if does not exist, error), or OS_FILE_CREATE if a new
- file is created (if exists, error) */
- ulint access_type,/* in: OS_FILE_READ_ONLY, OS_FILE_READ_WRITE, or
- OS_FILE_READ_ALLOW_DELETE; the last option is used by
- a backup program reading the file */
- ibool* success)/* out: TRUE if succeed, FALSE if error */
+ /* out, own: handle to the file, not defined
+ if error, error number can be retrieved with
+ os_file_get_last_error */
+ const char* name, /* in: name of the file or path as a
+ null-terminated string */
+ ulint create_mode,/* in: OS_FILE_OPEN if an existing file
+ is opened (if does not exist, error), or
+ OS_FILE_CREATE if a new file is created
+ (if exists, error) */
+ ulint access_type,/* in: OS_FILE_READ_ONLY,
+ OS_FILE_READ_WRITE, or
+ OS_FILE_READ_ALLOW_DELETE; the last option is
+ used by a backup program reading the file */
+ ibool* success)/* out: TRUE if succeed, FALSE if error */
{
#ifdef __WIN__
os_file_t file;
@@ -961,8 +979,8 @@ os_file_create_simple_no_error_handling(
if (file == -1) {
*success = FALSE;
-#ifndef UNIV_HOTBACKUP
- } else if (os_file_lock(file, name)) {
+#ifdef USE_FILE_LOCK
+ } else if (os_file_lock(file, name, F_WRLCK)) {
*success = FALSE;
file = -1;
#endif
@@ -980,25 +998,28 @@ Opens an existing file or creates a new. */
os_file_t
os_file_create(
/*===========*/
- /* out, own: handle to the file, not defined if error,
- error number can be retrieved with
- os_file_get_last_error */
- char* name, /* in: name of the file or path as a null-terminated
- string */
- ulint create_mode, /* in: OS_FILE_OPEN if an existing file is opened
- (if does not exist, error), or OS_FILE_CREATE if a new
- file is created (if exists, error), OS_FILE_OVERWRITE
- if a new is created or an old overwritten,
- OS_FILE_OPEN_RAW, if a raw device or disk partition
- should be opened */
- ulint purpose,/* in: OS_FILE_AIO, if asynchronous, non-buffered i/o
- is desired, OS_FILE_NORMAL, if any normal file;
- NOTE that it also depends on type, os_aio_.. and srv_..
- variables whether we really use async i/o or
- unbuffered i/o: look in the function source code for
- the exact rules */
- ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */
- ibool* success)/* out: TRUE if succeed, FALSE if error */
+ /* out, own: handle to the file, not defined
+ if error, error number can be retrieved with
+ os_file_get_last_error */
+ const char* name, /* in: name of the file or path as a
+ null-terminated string */
+ ulint create_mode,/* in: OS_FILE_OPEN if an existing file
+ is opened (if does not exist, error), or
+ OS_FILE_CREATE if a new file is created
+ (if exists, error),
+ OS_FILE_OVERWRITE if a new file is created
+ or an old overwritten;
+ OS_FILE_OPEN_RAW, if a raw device or disk
+ partition should be opened */
+ ulint purpose,/* in: OS_FILE_AIO, if asynchronous,
+ non-buffered i/o is desired,
+ OS_FILE_NORMAL, if any normal file;
+ NOTE that it also depends on type, os_aio_..
+ and srv_.. variables whether we really use
+ async i/o or unbuffered i/o: look in the
+ function source code for the exact rules */
+ ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */
+ ibool* success)/* out: TRUE if succeed, FALSE if error */
{
#ifdef __WIN__
os_file_t file;
@@ -1172,8 +1193,8 @@ try_again:
if (retry) {
goto try_again;
}
-#ifndef UNIV_HOTBACKUP
- } else if (os_file_lock(file, name)) {
+#ifdef USE_FILE_LOCK
+ } else if (os_file_lock(file, name, F_WRLCK)) {
*success = FALSE;
file = -1;
#endif
@@ -1191,8 +1212,8 @@ Deletes a file if it exists. The file has to be closed before calling this. */
ibool
os_file_delete_if_exists(
/*=====================*/
- /* out: TRUE if success */
- char* name) /* in: file path as a null-terminated string */
+ /* out: TRUE if success */
+ const char* name) /* in: file path as a null-terminated string */
{
#ifdef __WIN__
BOOL ret;
@@ -1252,8 +1273,8 @@ Deletes a file. The file has to be closed before calling this. */
ibool
os_file_delete(
/*===========*/
- /* out: TRUE if success */
- char* name) /* in: file path as a null-terminated string */
+ /* out: TRUE if success */
+ const char* name) /* in: file path as a null-terminated string */
{
#ifdef __WIN__
BOOL ret;
@@ -1316,9 +1337,9 @@ ibool
os_file_rename(
/*===========*/
/* out: TRUE if success */
- char* oldpath, /* in: old file path as a null-terminated
+ const char* oldpath,/* in: old file path as a null-terminated
string */
- char* newpath) /* in: new file path */
+ const char* newpath)/* in: new file path */
{
#ifdef __WIN__
BOOL ret;
@@ -1329,7 +1350,7 @@ os_file_rename(
return(TRUE);
}
- os_file_handle_error(NULL, oldpath, "delete");
+ os_file_handle_error(NULL, oldpath, "rename");
return(FALSE);
#else
@@ -1374,6 +1395,9 @@ os_file_close(
#else
int ret;
+#ifdef USE_FILE_LOCK
+ (void) os_file_lock(file, "unknown", F_UNLCK);
+#endif
ret = close(file);
if (ret == -1) {
@@ -1410,6 +1434,9 @@ os_file_close_no_error_handling(
#else
int ret;
+#ifdef USE_FILE_LOCK
+ (void) os_file_lock(file, "unknown", F_UNLCK);
+#endif
ret = close(file);
if (ret == -1) {
@@ -1499,7 +1526,7 @@ ibool
os_file_set_size(
/*=============*/
/* out: TRUE if success */
- char* name, /* in: name of the file or path as a
+ const char* name, /* in: name of the file or path as a
null-terminated string */
os_file_t file, /* in: handle to a file */
ulint size, /* in: least significant 32 bits of file
@@ -1760,7 +1787,7 @@ os_file_pwrite(
/*===========*/
/* out: number of bytes written, -1 if error */
os_file_t file, /* in: handle to a file */
- void* buf, /* in: buffer from where to write */
+ const void* buf, /* in: buffer from where to write */
ulint n, /* in: number of bytes to write */
ulint offset, /* in: least significant 32 bits of file
offset where to write */
@@ -2040,10 +2067,10 @@ os_file_write(
/*==========*/
/* out: TRUE if request was
successful, FALSE if fail */
- char* name, /* in: name of the file or path as a
+ const char* name, /* in: name of the file or path as a
null-terminated string */
os_file_t file, /* in: handle to a file */
- void* buf, /* in: buffer from which to write */
+ const void* buf, /* in: buffer from which to write */
ulint offset, /* in: least significant 32 bits of file
offset where to write */
ulint offset_high, /* in: most significant 32 bits of
@@ -2197,7 +2224,7 @@ ibool
os_file_status(
/*===========*/
/* out: TRUE if call succeeded */
- char* path, /* in: pathname of the file */
+ const char* path, /* in: pathname of the file */
ibool* exists, /* out: TRUE if file exists */
os_file_type_t* type) /* out: type of the file (if it exists) */
{
@@ -2302,7 +2329,7 @@ os_file_dirname(
/*============*/
/* out, own: directory component of the
pathname */
- char* path) /* in: pathname */
+ const char* path) /* in: pathname */
{
char* dir;
int i, length, last_slash;
@@ -2314,18 +2341,18 @@ os_file_dirname(
if (last_slash < 0) {
/* no slash in the path, return "." */
- return(ut_strdup((char*)"."));
+ return(mem_strdup("."));
}
/* ok, there is a slash */
if (last_slash == 0) {
/* last slash is the first char of the path */
- return(ut_strdup((char*)"/"));
+ return(mem_strdup("/"));
}
/* non-trivial directory component */
- dir = ut_strdup(path);
+ dir = mem_strdup(path);
dir[last_slash] = 0;
return(dir);
@@ -2339,7 +2366,7 @@ os_file_create_subdirs_if_needed(
/*=============================*/
/* out: TRUE if call succeeded
FALSE otherwise */
- char* path) /* in: path name */
+ const char* path) /* in: path name */
{
char* subdir;
static char rootdir[2] = { OS_FILE_PATH_SEPARATOR, 0 };
@@ -2736,7 +2763,7 @@ os_aio_array_reserve_slot(
void* message2,/* in: message to be passed along with
the aio operation */
os_file_t file, /* in: file handle */
- char* name, /* in: name of the file or path as a
+ const char* name, /* in: name of the file or path as a
null-terminated string */
void* buf, /* in: buffer where to read or from which
to write */
@@ -2983,7 +3010,7 @@ os_aio(
because i/os are not actually handled until
all have been posted: use with great
caution! */
- char* name, /* in: name of the file or path as a
+ const char* name, /* in: name of the file or path as a
null-terminated string */
os_file_t file, /* in: handle to a file */
void* buf, /* in: buffer where to read or from which
@@ -3526,6 +3553,7 @@ consecutive_loop:
if (n_consecutive == 1) {
/* We can use the buffer of the i/o request */
combined_buf = slot->buf;
+ combined_buf2 = NULL;
} else {
combined_buf2 = ut_malloc(total_len + UNIV_PAGE_SIZE);
@@ -3621,7 +3649,7 @@ consecutive_loop:
}
}
- if (n_consecutive > 1) {
+ if (combined_buf2) {
ut_free(combined_buf2);
}
diff --git a/innobase/os/os0shm.c b/innobase/os/os0shm.c
deleted file mode 100644
index f49aa2922b0..00000000000
--- a/innobase/os/os0shm.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/******************************************************
-The interface to the operating system
-shared memory primitives
-
-(c) 1995 Innobase Oy
-
-Created 9/23/1995 Heikki Tuuri
-*******************************************************/
-
-#include "os0shm.h"
-#ifdef UNIV_NONINL
-#include "os0shm.ic"
-#endif
-
-#ifdef __WIN__
-#include "windows.h"
-
-typedef HANDLE os_shm_t;
-#endif
-
-/********************************************************************
-Creates an area of shared memory. It can be named so that
-different processes may access it in the same computer.
-If an area with the same name already exists, returns
-a handle to that area (where the size of the area is
-not changed even if this call requests a different size).
-To use the area, it first has to be mapped to the process
-address space by os_shm_map. */
-
-os_shm_t
-os_shm_create(
-/*==========*/
- /* out, own: handle to the shared
- memory area, NULL if error */
- ulint size, /* in: area size < 4 GB */
- char* name) /* in: name of the area as a null-terminated
- string */
-{
-#ifdef __WIN__
- os_shm_t shm;
-
- ut_a(name);
- ut_a(size > 0);
- ut_a(size < 0xFFFFFFFF);
-
- /* In Windows NT shared memory is created as a memory mapped
- file */
- shm = CreateFileMapping((HANDLE)0xFFFFFFFF, /* use operating system
- swap file as the backing
- file */
- NULL, /* default security
- descriptor */
- PAGE_READWRITE, /* allow reading and
- writing */
- 0, /* size must be less
- than 4 GB */
- (DWORD)size,
- name);
- return(shm);
-#else
- UT_NOT_USED(size);
- UT_NOT_USED(name);
-
- return(NULL);
-#endif
-}
-
-/***************************************************************************
-Frees a shared memory area. The area can be freed only after it
-has been unmapped in all the processes where it was mapped. */
-
-ibool
-os_shm_free(
-/*========*/
- /* out: TRUE if success */
- os_shm_t shm) /* in, own: handle to a shared memory area */
-{
-#ifdef __WIN__
-
- BOOL ret;
-
- ut_a(shm);
-
- ret = CloseHandle(shm);
-
- if (ret) {
- return(TRUE);
- } else {
- return(FALSE);
- }
-#else
- UT_NOT_USED(shm);
-
- return(FALSE);
-#endif
-}
-
-/***************************************************************************
-Maps a shared memory area in the address space of a process. */
-
-void*
-os_shm_map(
-/*=======*/
- /* out: address of the area, NULL if error */
- os_shm_t shm) /* in: handle to a shared memory area */
-{
-#ifdef __WIN__
- void* mem;
-
- ut_a(shm);
-
- mem = MapViewOfFile(shm,
- FILE_MAP_ALL_ACCESS, /* read and write access
- allowed */
- 0, /* map from start of */
- 0, /* area */
- 0); /* map the whole area */
- return(mem);
-#else
- UT_NOT_USED(shm);
-
- return(NULL);
-#endif
-}
-
-/***************************************************************************
-Unmaps a shared memory area from the address space of a process. */
-
-ibool
-os_shm_unmap(
-/*=========*/
- /* out: TRUE if succeed */
- void* addr) /* in: address of the area */
-{
-#ifdef __WIN__
- BOOL ret;
-
- ut_a(addr);
-
- ret = UnmapViewOfFile(addr);
-
- if (ret) {
- return(TRUE);
- } else {
- return(FALSE);
- }
-#else
- UT_NOT_USED(addr);
-
- return(FALSE);
-#endif
-}
diff --git a/innobase/os/os0sync.c b/innobase/os/os0sync.c
index 7cbaf1f5123..c48c44a4c70 100644
--- a/innobase/os/os0sync.c
+++ b/innobase/os/os0sync.c
@@ -109,9 +109,9 @@ must be reset explicitly by calling sync_os_reset_event. */
os_event_t
os_event_create(
/*============*/
- /* out: the event handle */
- char* name) /* in: the name of the event, if NULL
- the event is created without a name */
+ /* out: the event handle */
+ const char* name) /* in: the name of the event, if NULL
+ the event is created without a name */
{
#ifdef __WIN__
os_event_t event;
@@ -166,9 +166,9 @@ reset when a single thread is released. Works only in Windows. */
os_event_t
os_event_create_auto(
/*=================*/
- /* out: the event handle */
- char* name) /* in: the name of the event, if NULL
- the event is created without a name */
+ /* out: the event handle */
+ const char* name) /* in: the name of the event, if NULL
+ the event is created without a name */
{
os_event_t event;
@@ -430,9 +430,9 @@ mutex semaphore of InnoDB itself (mutex_t) should be used where possible. */
os_mutex_t
os_mutex_create(
/*============*/
- /* out: the mutex handle */
- char* name) /* in: the name of the mutex, if NULL
- the mutex is created without a name */
+ /* out: the mutex handle */
+ const char* name) /* in: the name of the mutex, if NULL
+ the mutex is created without a name */
{
#ifdef __WIN__
HANDLE mutex;
diff --git a/innobase/pars/pars0lex.l b/innobase/pars/pars0lex.l
index 7b65770b3da..0b1af554bed 100644
--- a/innobase/pars/pars0lex.l
+++ b/innobase/pars/pars0lex.l
@@ -123,7 +123,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]*
BEGIN(INITIAL);
yylval = sym_tab_add_str_lit(
pars_sym_tab_global,
- stringbuf, stringbuf_len);
+ (byte*) stringbuf, stringbuf_len);
return(PARS_STR_LIT);
}
}
@@ -137,7 +137,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]*
"SQL" {
/* Implicit cursor name */
yylval = sym_tab_add_str_lit(pars_sym_tab_global,
- yytext, yyleng);
+ (byte*) yytext, yyleng);
return(PARS_SQL_TOKEN);
}
diff --git a/innobase/pars/pars0pars.c b/innobase/pars/pars0pars.c
index a4124672df0..12451b4d94d 100644
--- a/innobase/pars/pars0pars.c
+++ b/innobase/pars/pars0pars.c
@@ -1713,7 +1713,8 @@ Called by yyparse on error. */
void
yyerror(
/*====*/
- char* s __attribute__((unused))) /* in: error message string */
+ const char* s __attribute__((unused)))
+ /* in: error message string */
{
ut_ad(s);
@@ -1728,8 +1729,8 @@ Parses an SQL string returning the query graph. */
que_t*
pars_sql(
/*=====*/
- /* out, own: the query graph */
- char* str) /* in: SQL string */
+ /* out, own: the query graph */
+ const char* str) /* in: SQL string */
{
sym_node_t* sym_node;
mem_heap_t* heap;
diff --git a/innobase/pars/pars0sym.c b/innobase/pars/pars0sym.c
index 1a0608ed142..194e6677183 100644
--- a/innobase/pars/pars0sym.c
+++ b/innobase/pars/pars0sym.c
@@ -217,13 +217,10 @@ sym_tab_add_id(
node->common.type = QUE_NODE_SYMBOL;
- node->name = mem_heap_alloc(sym_tab->heap, len + 1);
node->resolved = FALSE;
node->indirection = NULL;
- ut_memcpy(node->name, name, len);
- node->name[len] = '\0';
-
+ node->name = mem_heap_strdupl(sym_tab->heap, name, len + 1);
node->name_len = len;
UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node);
diff --git a/innobase/que/que0que.c b/innobase/que/que0que.c
index b2608b6d175..08bf7ce3e59 100644
--- a/innobase/que/que0que.c
+++ b/innobase/que/que0que.c
@@ -12,7 +12,6 @@ Created 5/27/1996 Heikki Tuuri
#include "que0que.ic"
#endif
-#include "srv0que.h"
#include "usr0sess.h"
#include "trx0trx.h"
#include "trx0roll.h"
@@ -175,19 +174,15 @@ a single worker thread to execute it. This function should be used to end
the wait state of a query thread waiting for a lock or a stored procedure
completion. */
-void
+que_thr_t*
que_thr_end_wait(
/*=============*/
- que_thr_t* thr, /* in: query thread in the
+ /* out: next query thread to run;
+ NULL if none */
+ que_thr_t* thr) /* in: query thread in the
QUE_THR_LOCK_WAIT,
or QUE_THR_PROCEDURE_WAIT, or
QUE_THR_SIG_REPLY_WAIT state */
- que_thr_t** next_thr) /* in/out: next query thread to run;
- if the value which is passed in is
- a pointer to a NULL pointer, then the
- calling function can start running
- a new query thread; if NULL is passed
- as the parameter, it is ignored */
{
ibool was_active;
@@ -195,6 +190,8 @@ que_thr_end_wait(
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
ut_ad(thr);
+ ut_ad(next_thr);
+ ut_ad(*next_thr == NULL);
ut_ad((thr->state == QUE_THR_LOCK_WAIT)
|| (thr->state == QUE_THR_PROCEDURE_WAIT)
|| (thr->state == QUE_THR_SIG_REPLY_WAIT));
@@ -206,17 +203,8 @@ que_thr_end_wait(
que_thr_move_to_run_state(thr);
- if (was_active) {
-
- return;
- }
-
- if (next_thr && *next_thr == NULL) {
- *next_thr = thr;
- } else {
- srv_que_task_enqueue_low(thr);
- }
-}
+ return(was_active ? NULL : thr);
+}
/**************************************************************************
Same as que_thr_end_wait, but no parameter next_thr available. */
@@ -253,8 +241,6 @@ que_thr_end_wait_no_next_thr(
for the lock to be released: */
srv_release_mysql_thread_if_suspended(thr);
-
- /* srv_que_task_enqueue_low(thr); */
}
/**************************************************************************
@@ -355,48 +341,6 @@ que_fork_start_command(
return(NULL);
}
-/**************************************************************************
-After signal handling is finished, returns control to a query graph error
-handling routine. (Currently, just returns the control to the root of the
-graph so that the graph can communicate an error message to the client.) */
-
-void
-que_fork_error_handle(
-/*==================*/
- trx_t* trx __attribute__((unused)), /* in: trx */
- que_t* fork) /* in: query graph which was run before signal
- handling started, NULL not allowed */
-{
- que_thr_t* thr;
-
-#ifdef UNIV_SYNC_DEBUG
- ut_ad(mutex_own(&kernel_mutex));
-#endif /* UNIV_SYNC_DEBUG */
- ut_ad(trx->sess->state == SESS_ERROR);
- ut_ad(UT_LIST_GET_LEN(trx->reply_signals) == 0);
- ut_ad(UT_LIST_GET_LEN(trx->wait_thrs) == 0);
-
- thr = UT_LIST_GET_FIRST(fork->thrs);
-
- while (thr != NULL) {
- ut_ad(!thr->is_active);
- ut_ad(thr->state != QUE_THR_SIG_REPLY_WAIT);
- ut_ad(thr->state != QUE_THR_LOCK_WAIT);
-
- thr->run_node = thr;
- thr->prev_node = thr->child;
- thr->state = QUE_THR_COMPLETED;
-
- thr = UT_LIST_GET_NEXT(thrs, thr);
- }
-
- thr = UT_LIST_GET_FIRST(fork->thrs);
-
- que_thr_move_to_run_state(thr);
-
- srv_que_task_enqueue_low(thr);
-}
-
/********************************************************************
Tests if all the query threads in the same fork have a given state. */
UNIV_INLINE
@@ -765,22 +709,18 @@ this function may only be called from inside que_run_threads or
que_thr_check_if_switch! These restrictions exist to make the rollback code
easier to maintain. */
static
-void
+que_thr_t*
que_thr_dec_refer_count(
/*====================*/
- que_thr_t* thr, /* in: query thread */
- que_thr_t** next_thr) /* in/out: next query thread to run;
- if the value which is passed in is
- a pointer to a NULL pointer, then the
- calling function can start running
- a new query thread */
+ /* out: next query thread to run */
+ que_thr_t* thr) /* in: query thread */
{
que_fork_t* fork;
trx_t* trx;
sess_t* sess;
ulint fork_type;
- ibool stopped;
-
+ que_thr_t* next_thr = NULL;
+
fork = thr->common.parent;
trx = thr->graph->trx;
sess = trx->sess;
@@ -791,9 +731,7 @@ que_thr_dec_refer_count(
if (thr->state == QUE_THR_RUNNING) {
- stopped = que_thr_stop(thr);
-
- if (!stopped) {
+ if (!que_thr_stop(thr)) {
/* The reason for the thr suspension or wait was
already canceled before we came here: continue
running the thread */
@@ -801,15 +739,9 @@ que_thr_dec_refer_count(
/* fputs("!!!!!!!! Wait already ended: continue thr\n",
stderr); */
- if (next_thr && *next_thr == NULL) {
- *next_thr = thr;
- } else {
- srv_que_task_enqueue_low(thr);
- }
-
mutex_exit(&kernel_mutex);
- return;
+ return(thr);
}
}
@@ -825,7 +757,7 @@ que_thr_dec_refer_count(
mutex_exit(&kernel_mutex);
- return;
+ return(next_thr);
}
fork_type = fork->fork_type;
@@ -841,7 +773,7 @@ que_thr_dec_refer_count(
ut_ad(UT_LIST_GET_LEN(trx->signals) > 0);
ut_ad(trx->handling_signals == TRUE);
- trx_finish_rollback_off_kernel(fork, trx, next_thr);
+ next_thr = trx_finish_rollback_off_kernel(fork, trx);
} else if (fork_type == QUE_FORK_PURGE) {
@@ -863,7 +795,7 @@ que_thr_dec_refer_count(
zero, then we start processing a signal; from it we may get
a new query thread to run */
- trx_sig_start_handle(trx, next_thr);
+ next_thr = trx_sig_start_handle(trx);
}
if (trx->handling_signals && UT_LIST_GET_LEN(trx->signals) == 0) {
@@ -872,6 +804,8 @@ que_thr_dec_refer_count(
}
mutex_exit(&kernel_mutex);
+
+ return(next_thr);
}
/**************************************************************************
@@ -1245,6 +1179,7 @@ loop:
/*-------------------------*/
next_thr = que_thr_step(thr);
/*-------------------------*/
+ ut_a(next_thr == thr || next_thr == NULL);
/* Test the effect on performance of adding extra mutex
reservations */
@@ -1257,7 +1192,7 @@ loop:
loop_count++;
if (next_thr != thr) {
- que_thr_dec_refer_count(thr, &next_thr);
+ next_thr = que_thr_dec_refer_count(thr);
if (next_thr == NULL) {
diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c
index a3f883b49c6..062f21369a7 100644
--- a/innobase/row/row0ins.c
+++ b/innobase/row/row0ins.c
@@ -803,8 +803,7 @@ row_ins_foreign_check_on_constraint(
"InnoDB: clustered record ", stderr);
rec_print(stderr, clust_rec);
fputs("\n"
- "InnoDB: Make a detailed bug report and send it\n"
- "InnoDB: to mysql@lists.mysql.com\n", stderr);
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
err = DB_SUCCESS;
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index 5432add37f7..61be3a7248e 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -714,7 +714,7 @@ run_again:
trx_start_if_not_started(trx);
- err = lock_table(0, prebuilt->table, prebuilt->select_lock_type, thr);
+ err = lock_table(0, prebuilt->table, LOCK_AUTO_INC, thr);
trx->error_state = err;
@@ -1686,15 +1686,16 @@ constraints which reference this table are ok. */
int
row_table_add_foreign_constraints(
/*==============================*/
- /* out: error code or DB_SUCCESS */
- trx_t* trx, /* in: transaction */
- char* sql_string, /* in: table create statement where
- foreign keys are declared like:
+ /* out: error code or DB_SUCCESS */
+ trx_t* trx, /* in: transaction */
+ const char* sql_string, /* in: table create statement where
+ foreign keys are declared like:
FOREIGN KEY (a, b) REFERENCES table2(c, d),
- table2 can be written also with the database
- name before it: test.table2 */
- char* name) /* in: table full name in the normalized form
- database_name/table_name */
+ table2 can be written also with the
+ database name before it: test.table2 */
+ const char* name) /* in: table full name in the
+ normalized form
+ database_name/table_name */
{
ulint err;
@@ -1940,9 +1941,9 @@ discard ongoing operations. */
int
row_discard_tablespace_for_mysql(
/*=============================*/
- /* out: error code or DB_SUCCESS */
- char* name, /* in: table name */
- trx_t* trx) /* in: transaction handle */
+ /* out: error code or DB_SUCCESS */
+ const char* name, /* in: table name */
+ trx_t* trx) /* in: transaction handle */
{
dulint new_id;
dict_table_t* table;
@@ -2071,9 +2072,9 @@ of the table in the data dictionary. */
int
row_import_tablespace_for_mysql(
/*============================*/
- /* out: error code or DB_SUCCESS */
- char* name, /* in: table name */
- trx_t* trx) /* in: transaction handle */
+ /* out: error code or DB_SUCCESS */
+ const char* name, /* in: table name */
+ trx_t* trx) /* in: transaction handle */
{
dict_table_t* table;
ibool success;
@@ -2177,10 +2178,10 @@ the corresponding monitor output by the master thread. */
int
row_drop_table_for_mysql(
/*=====================*/
- /* out: error code or DB_SUCCESS */
- char* name, /* in: table name */
- trx_t* trx, /* in: transaction handle */
- ibool drop_db)/* in: TRUE=dropping whole database */
+ /* out: error code or DB_SUCCESS */
+ const char* name, /* in: table name */
+ trx_t* trx, /* in: transaction handle */
+ ibool drop_db)/* in: TRUE=dropping whole database */
{
dict_foreign_t* foreign;
dict_table_t* table;
@@ -2519,17 +2520,18 @@ Drops a database for MySQL. */
int
row_drop_database_for_mysql(
/*========================*/
- /* out: error code or DB_SUCCESS */
- char* name, /* in: database name which ends to '/' */
- trx_t* trx) /* in: transaction handle */
+ /* out: error code or DB_SUCCESS */
+ const char* name, /* in: database name which ends to '/' */
+ trx_t* trx) /* in: transaction handle */
{
dict_table_t* table;
char* table_name;
int err = DB_SUCCESS;
+ ulint namelen = strlen(name);
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
ut_a(name != NULL);
- ut_a(name[strlen(name) - 1] == '/');
+ ut_a(name[namelen - 1] == '/');
trx->op_info = (char *) "dropping database";
@@ -2538,7 +2540,7 @@ loop:
row_mysql_lock_data_dictionary(trx);
while ((table_name = dict_get_first_table_name_in_db(name))) {
- ut_a(strcmp(table_name, name) == 0);
+ ut_a(memcmp(table_name, name, namelen) == 0);
table = dict_table_get_low(table_name);
@@ -2610,10 +2612,10 @@ Renames a table for MySQL. */
int
row_rename_table_for_mysql(
/*=======================*/
- /* out: error code or DB_SUCCESS */
- char* old_name, /* in: old table name */
- char* new_name, /* in: new table name */
- trx_t* trx) /* in: transaction handle */
+ /* out: error code or DB_SUCCESS */
+ const char* old_name, /* in: old table name */
+ const char* new_name, /* in: new table name */
+ trx_t* trx) /* in: transaction handle */
{
dict_table_t* table;
que_thr_t* thr;
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c
index 4c43f75125c..ff9b697c02f 100644
--- a/innobase/row/row0sel.c
+++ b/innobase/row/row0sel.c
@@ -2410,8 +2410,7 @@ row_sel_get_clust_rec_for_mysql(
trx_print(stderr, thr_get_trx(thr));
fputs("\n"
- "InnoDB: Make a detailed bug report and send it\n"
- "InnoDB: to mysql@lists.mysql.com\n", stderr);
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
}
clust_rec = NULL;
@@ -3586,11 +3585,11 @@ consistent read result, or store it to the query cache. */
ibool
row_search_check_if_query_cache_permitted(
/*======================================*/
- /* out: TRUE if storing or retrieving from
- the query cache is permitted */
- trx_t* trx, /* in: transaction object */
- char* norm_name) /* in: concatenation of database name, '/'
- char, table name */
+ /* out: TRUE if storing or retrieving
+ from the query cache is permitted */
+ trx_t* trx, /* in: transaction object */
+ const char* norm_name) /* in: concatenation of database name,
+ '/' char, table name */
{
dict_table_t* table;
ibool ret = FALSE;
diff --git a/innobase/row/row0umod.c b/innobase/row/row0umod.c
index 3c181ed5493..d47227166f3 100644
--- a/innobase/row/row0umod.c
+++ b/innobase/row/row0umod.c
@@ -441,8 +441,7 @@ row_undo_mod_del_unmark_sec_and_undo_update(
putc('\n', stderr);
trx_print(stderr, thr_get_trx(thr));
fputs("\n"
- "InnoDB: Make a detailed bug report and send it\n"
- "InnoDB: to mysql@lists.mysql.com\n", stderr);
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
} else {
btr_cur_t* btr_cur = btr_pcur_get_btr_cur(&pcur);
diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c
index 82eb112fc77..724e7bf91e7 100644
--- a/innobase/row/row0upd.c
+++ b/innobase/row/row0upd.c
@@ -1236,8 +1236,7 @@ row_upd_sec_index_entry(
trx_print(stderr, thr_get_trx(thr));
fputs("\n"
- "InnoDB: Make a detailed bug report and send it\n"
- "InnoDB: to mysql@lists.mysql.com\n", stderr);
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
} else {
/* Delete mark the old index record; it can already be
delete marked if we return after a lock wait in
diff --git a/innobase/srv/Makefile.am b/innobase/srv/Makefile.am
index 752683b82b8..37fd73a4bf0 100644
--- a/innobase/srv/Makefile.am
+++ b/innobase/srv/Makefile.am
@@ -19,6 +19,6 @@ include ../include/Makefile.i
noinst_LIBRARIES = libsrv.a
-libsrv_a_SOURCES = srv0srv.c srv0que.c srv0start.c
+libsrv_a_SOURCES = srv0srv.c srv0start.c
EXTRA_PROGRAMS =
diff --git a/innobase/srv/srv0que.c b/innobase/srv/srv0que.c
deleted file mode 100644
index ac8bd7d0e65..00000000000
--- a/innobase/srv/srv0que.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/******************************************************
-Server query execution
-
-(c) 1996 Innobase Oy
-
-Created 6/5/1996 Heikki Tuuri
-*******************************************************/
-
-#include "srv0que.h"
-
-#include "srv0srv.h"
-#include "sync0sync.h"
-#include "os0thread.h"
-#include "usr0sess.h"
-#include "que0que.h"
-
-/**************************************************************************
-Checks if there is work to do in the server task queue. If there is, the
-thread starts processing a task. Before leaving, it again checks the task
-queue and picks a new task if any exists. This is called by a SRV_WORKER
-thread. */
-
-void
-srv_que_task_queue_check(void)
-/*==========================*/
-{
- que_thr_t* thr;
-
- for (;;) {
- mutex_enter(&kernel_mutex);
-
- thr = UT_LIST_GET_FIRST(srv_sys->tasks);
-
- if (thr == NULL) {
- mutex_exit(&kernel_mutex);
-
- return;
- }
-
- UT_LIST_REMOVE(queue, srv_sys->tasks, thr);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-}
-
-/**************************************************************************
-Performs round-robin on the server tasks. This is called by a SRV_WORKER
-thread every second or so. */
-
-que_thr_t*
-srv_que_round_robin(
-/*================*/
- /* out: the new (may be == thr) query thread
- to run */
- que_thr_t* thr) /* in: query thread */
-{
- que_thr_t* new_thr;
-
- ut_ad(thr);
- ut_ad(thr->state == QUE_THR_RUNNING);
-
- mutex_enter(&kernel_mutex);
-
- UT_LIST_ADD_LAST(queue, srv_sys->tasks, thr);
-
- new_thr = UT_LIST_GET_FIRST(srv_sys->tasks);
-
- mutex_exit(&kernel_mutex);
-
- return(new_thr);
-}
-
-/**************************************************************************
-Enqueues a task to server task queue and releases a worker thread, if there
-is a suspended one. */
-
-void
-srv_que_task_enqueue_low(
-/*=====================*/
- que_thr_t* thr) /* in: query thread */
-{
- ut_ad(thr);
-
-#ifdef UNIV_SYNC_DEBUG
- ut_ad(mutex_own(&kernel_mutex));
-#endif /* UNIV_SYNC_DEBUG */
-
- UT_LIST_ADD_LAST(queue, srv_sys->tasks, thr);
-
- srv_release_threads(SRV_WORKER, 1);
-}
-
-/**************************************************************************
-Enqueues a task to server task queue and releases a worker thread, if there
-is a suspended one. */
-
-void
-srv_que_task_enqueue(
-/*=================*/
- que_thr_t* thr) /* in: query thread */
-{
- ut_ad(thr);
-
- mutex_enter(&kernel_mutex);
-
- srv_que_task_enqueue_low(thr);
-
- mutex_exit(&kernel_mutex);
-}
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index 7194dfc1d2f..33adcaa14b8 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -32,10 +32,8 @@ Created 10/8/1995 Heikki Tuuri
#include "mem0mem.h"
#include "mem0pool.h"
#include "sync0sync.h"
-#include "sync0ipm.h"
#include "thr0loc.h"
#include "que0que.h"
-#include "srv0que.h"
#include "log0recv.h"
#include "pars0pars.h"
#include "usr0sess.h"
@@ -1525,13 +1523,6 @@ srv_printf_innodb_monitor(
ut_total_allocated_memory,
mem_pool_get_reserved(mem_comm_pool));
- if (mem_out_of_mem_err_msg_count > 0) {
- fprintf(file,
- "Mem allocation has spilled out of additional mem pool" ULINTPF
- "times\n",
- mem_out_of_mem_err_msg_count);
- }
-
if (srv_use_awe) {
fprintf(file,
"In addition to that %lu MB of AWE memory allocated\n",
diff --git a/innobase/sync/Makefile.am b/innobase/sync/Makefile.am
index 4acd4516e35..c95955a733b 100644
--- a/innobase/sync/Makefile.am
+++ b/innobase/sync/Makefile.am
@@ -19,6 +19,6 @@ include ../include/Makefile.i
noinst_LIBRARIES = libsync.a
-libsync_a_SOURCES = sync0arr.c sync0ipm.c sync0rw.c sync0sync.c
+libsync_a_SOURCES = sync0arr.c sync0rw.c sync0sync.c
EXTRA_PROGRAMS =
diff --git a/innobase/sync/makefilewin b/innobase/sync/makefilewin
index 5809d8e7375..73cff40405a 100644
--- a/innobase/sync/makefilewin
+++ b/innobase/sync/makefilewin
@@ -1,7 +1,7 @@
include ..\include\makefile.i
-sync.lib: sync0sync.obj sync0rw.obj sync0ipm.obj sync0arr.obj
- lib -out:..\libs\sync.lib sync0sync.obj sync0rw.obj sync0ipm.obj sync0arr.obj
+sync.lib: sync0sync.obj sync0rw.obj sync0arr.obj
+ lib -out:..\libs\sync.lib sync0sync.obj sync0rw.obj sync0arr.obj
sync0sync.obj: sync0sync.c
$(CCOM) $(CFLN) -c sync0sync.c
@@ -9,9 +9,6 @@ sync0sync.obj: sync0sync.c
sync0rw.obj: sync0rw.c
$(CCOM) $(CFL) -c sync0rw.c
-sync0ipm.obj: sync0ipm.c
- $(CCOM) $(CFL) -c sync0ipm.c
-
sync0arr.obj: sync0arr.c
$(CCOM) $(CFL) -c sync0arr.c
diff --git a/innobase/sync/sync0arr.c b/innobase/sync/sync0arr.c
index 426d7ff9f92..d1644412fbb 100644
--- a/innobase/sync/sync0arr.c
+++ b/innobase/sync/sync0arr.c
@@ -53,7 +53,7 @@ struct sync_cell_struct {
rw_lock_t* old_wait_rw_lock;/* the latest wait rw-lock in cell */
ulint request_type; /* lock type requested on the
object */
- char* file; /* in debug version file where
+ const char* file; /* in debug version file where
requested */
ulint line; /* in debug version line where
requested */
@@ -329,7 +329,7 @@ sync_array_reserve_cell(
sync_array_t* arr, /* in: wait array */
void* object, /* in: pointer to the object to wait for */
ulint type, /* in: lock request type */
- char* file, /* in: file where requested */
+ const char* file, /* in: file where requested */
ulint line, /* in: line where requested */
ulint* index) /* out: index of the reserved cell */
{
@@ -449,7 +449,6 @@ sync_array_cell_print(
{
mutex_t* mutex;
rw_lock_t* rwlock;
- char* str __attribute__((unused)) = NULL;
ulint type;
type = cell->request_type;
diff --git a/innobase/sync/sync0ipm.c b/innobase/sync/sync0ipm.c
deleted file mode 100644
index e10e1c85da5..00000000000
--- a/innobase/sync/sync0ipm.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/******************************************************
-A fast mutex for interprocess synchronization.
-mutex_t can be used only within single process,
-but ip_mutex_t also between processes.
-
-(c) 1995 Innobase Oy
-
-Created 9/30/1995 Heikki Tuuri
-*******************************************************/
-#include "sync0ipm.h"
-#ifdef UNIV_NONINL
-#include "sync0ipm.ic"
-#endif
-
-#include "mem0mem.h"
-
-/* The performance of the ip mutex in NT depends on how often
-a thread has to suspend itself waiting for the ip mutex
-to become free. The following variable counts system calls
-involved. */
-
-ulint ip_mutex_system_call_count = 0;
-
-/**********************************************************************
-Creates, or rather, initializes
-an ip mutex object in a specified shared memory location (which must be
-appropriately aligned). The ip mutex is initialized in the reset state.
-NOTE! Explicit destroying of the ip mutex with ip_mutex_free
-is not recommended
-as the mutex resides in shared memory and we cannot make sure that
-no process is currently accessing it. Therefore just use
-ip_mutex_close to free the operating system event and mutex. */
-
-ulint
-ip_mutex_create(
-/*============*/
- /* out: 0 if succeed */
- ip_mutex_t* ip_mutex, /* in: pointer to shared memory */
- char* name, /* in: name of the ip mutex */
- ip_mutex_hdl_t** handle) /* out, own: handle to the
- created mutex; handle exists
- in the private address space of
- the calling process */
-{
- mutex_t* mutex;
- char* buf;
- os_event_t released;
- os_mutex_t exclude;
-
- ip_mutex_set_waiters(ip_mutex, 0);
-
- buf = mem_alloc(strlen(name) + 20);
-
- strcpy(buf, name);
- strcpy(buf + strlen(name), "_IB_RELS");
-
- released = os_event_create(buf);
-
- if (released == NULL) {
- mem_free(buf);
- return(1);
- }
-
- strcpy(buf + strlen(name), "_IB_EXCL");
-
- exclude = os_mutex_create(buf);
-
- if (exclude == NULL) {
- os_event_free(released);
- mem_free(buf);
- return(1);
- }
-
- mutex = ip_mutex_get_mutex(ip_mutex);
-
- mutex_create(mutex);
- mutex_set_level(mutex, SYNC_NO_ORDER_CHECK);
-
- *handle = mem_alloc(sizeof(ip_mutex_hdl_t));
-
- (*handle)->ip_mutex = ip_mutex;
- (*handle)->released = released;
- (*handle)->exclude = exclude;
-
- mem_free(buf);
-
- return(0);
-}
-
-/**********************************************************************
-NOTE! Using this function is not recommended. See the note
-on ip_mutex_create. Destroys an ip mutex */
-
-void
-ip_mutex_free(
-/*==========*/
- ip_mutex_hdl_t* handle) /* in, own: ip mutex handle */
-{
- mutex_free(ip_mutex_get_mutex(handle->ip_mutex));
-
- os_event_free(handle->released);
- os_mutex_free(handle->exclude);
-
- mem_free(handle);
-}
-
-/**********************************************************************
-Opens an ip mutex object in a specified shared memory location.
-Explicit closing of the ip mutex with ip_mutex_close is necessary to
-free the operating system event and mutex created, and the handle. */
-
-ulint
-ip_mutex_open(
-/*==========*/
- /* out: 0 if succeed */
- ip_mutex_t* ip_mutex, /* in: pointer to shared memory */
- char* name, /* in: name of the ip mutex */
- ip_mutex_hdl_t** handle) /* out, own: handle to the
- opened mutex */
-{
- char* buf;
- os_event_t released;
- os_mutex_t exclude;
-
- buf = mem_alloc(strlen(name) + 20);
-
- strcpy(buf, name);
- strcpy(buf + strlen(name), "_IB_RELS");
-
- released = os_event_create(buf);
-
- if (released == NULL) {
- mem_free(buf);
- return(1);
- }
-
- strcpy(buf + strlen(name), "_IB_EXCL");
-
- exclude = os_mutex_create(buf);
-
- if (exclude == NULL) {
- os_event_free(released);
- mem_free(buf);
- return(1);
- }
-
- *handle = mem_alloc(sizeof(ip_mutex_hdl_t));
-
- (*handle)->ip_mutex = ip_mutex;
- (*handle)->released = released;
- (*handle)->exclude = exclude;
-
- mem_free(buf);
-
- return(0);
-}
-
-/**********************************************************************
-Closes an ip mutex. */
-
-void
-ip_mutex_close(
-/*===========*/
- ip_mutex_hdl_t* handle) /* in, own: ip mutex handle */
-{
- os_event_free(handle->released);
- os_mutex_free(handle->exclude);
-
- mem_free(handle);
-}
diff --git a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c
index 43f8d646eaa..769eb326ce2 100644
--- a/innobase/sync/sync0rw.c
+++ b/innobase/sync/sync0rw.c
@@ -89,7 +89,7 @@ void
rw_lock_create_func(
/*================*/
rw_lock_t* lock, /* in: pointer to memory */
- char* cfile_name, /* in: file name where created */
+ const char* cfile_name, /* in: file name where created */
ulint cline) /* in: file line where created */
{
/* If this is the very first time a synchronization
@@ -213,7 +213,7 @@ rw_lock_s_lock_spin(
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass, /* in: pass value; != 0, if the lock
will be passed to another thread to unlock */
- char* file_name, /* in: file name where lock requested */
+ const char* file_name, /* in: file name where lock requested */
ulint line) /* in: line where requested */
{
ulint index; /* index of the reserved wait cell */
@@ -324,7 +324,7 @@ rw_lock_x_lock_low(
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass, /* in: pass value; != 0, if the lock will
be passed to another thread to unlock */
- char* file_name,/* in: file name where lock requested */
+ const char* file_name,/* in: file name where lock requested */
ulint line) /* in: line where requested */
{
#ifdef UNIV_SYNC_DEBUG
@@ -429,7 +429,7 @@ rw_lock_x_lock_func(
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass, /* in: pass value; != 0, if the lock will
be passed to another thread to unlock */
- char* file_name,/* in: file name where lock requested */
+ const char* file_name,/* in: file name where lock requested */
ulint line) /* in: line where requested */
{
ulint index; /* index of the reserved wait cell */
@@ -551,7 +551,7 @@ rw_lock_debug_mutex_enter(void)
{
loop:
if (0 == mutex_enter_nowait(&rw_lock_debug_mutex,
- IB__FILE__, __LINE__)) {
+ __FILE__, __LINE__)) {
return;
}
@@ -560,7 +560,7 @@ loop:
rw_lock_debug_waiters = TRUE;
if (0 == mutex_enter_nowait(&rw_lock_debug_mutex,
- IB__FILE__, __LINE__)) {
+ __FILE__, __LINE__)) {
return;
}
diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c
index c1fb31bc966..31f287b6341 100644
--- a/innobase/sync/sync0sync.c
+++ b/innobase/sync/sync0sync.c
@@ -201,7 +201,7 @@ void
mutex_create_func(
/*==============*/
mutex_t* mutex, /* in: pointer to memory */
- char* cfile_name, /* in: file name where created */
+ const char* cfile_name, /* in: file name where created */
ulint cline) /* in: file line where created */
{
#if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER)
@@ -294,10 +294,10 @@ mutex_enter_nowait(
/*===============*/
/* out: 0 if succeed, 1 if not */
mutex_t* mutex, /* in: pointer to mutex */
- char* file_name __attribute__((unused)),
+ const char* file_name __attribute__((unused)),
/* in: file name where mutex
requested */
- ulint line __attribute__((unused)))
+ ulint line __attribute__((unused)))
/* in: line where requested */
{
ut_ad(mutex_validate(mutex));
@@ -357,9 +357,10 @@ for the mutex before suspending the thread. */
void
mutex_spin_wait(
/*============*/
- mutex_t* mutex, /* in: pointer to mutex */
- char* file_name, /* in: file name where mutex requested */
- ulint line) /* in: line where requested */
+ mutex_t* mutex, /* in: pointer to mutex */
+ const char* file_name, /* in: file name where
+ mutex requested */
+ ulint line) /* in: line where requested */
{
ulint index; /* index of the reserved wait cell */
ulint i; /* spin round count */
diff --git a/innobase/trx/trx0purge.c b/innobase/trx/trx0purge.c
index 3d5f0d3f03a..002775eaac1 100644
--- a/innobase/trx/trx0purge.c
+++ b/innobase/trx/trx0purge.c
@@ -23,7 +23,6 @@ Created 3/26/1996 Heikki Tuuri
#include "row0purge.h"
#include "row0upd.h"
#include "trx0rec.h"
-#include "srv0que.h"
#include "os0thread.h"
/* The global data structure coordinating a purge */
@@ -1060,8 +1059,6 @@ trx_purge(void)
mutex_exit(&kernel_mutex);
-/* srv_que_task_enqueue(thr2); */
-
if (srv_print_thread_releases) {
fputs("Starting purge\n", stderr);
diff --git a/innobase/trx/trx0rec.c b/innobase/trx/trx0rec.c
index 7963bec7f33..382f723a05c 100644
--- a/innobase/trx/trx0rec.c
+++ b/innobase/trx/trx0rec.c
@@ -823,17 +823,16 @@ trx_undo_update_rec_get_update(
if (field_no >= dict_index_get_n_fields(index)) {
fprintf(stderr,
- "InnoDB: Error: trying to access"
- " update undo rec field %lu in ", (ulong) field_no);
+"InnoDB: Error: trying to access update undo rec field %lu in ", (ulong) field_no);
dict_index_name_print(stderr, index);
fprintf(stderr, "\n"
- "InnoDB: but index has only %lu fields\n"
- "InnoDB: Send a detailed bug report to mysql@lists.mysql.com\n"
- "InnoDB: Run also CHECK TABLE ",
+"InnoDB: but index has only %lu fields\n"
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n"
+"InnoDB: Run also CHECK TABLE ",
(ulong) dict_index_get_n_fields(index));
ut_print_name(stderr, index->table_name);
fprintf(stderr, "\n"
- "InnoDB: n_fields = %lu, i = %lu, ptr %p\n",
+"InnoDB: n_fields = %lu, i = %lu, ptr %p\n",
(ulong) n_fields, (ulong) i, ptr);
return(NULL);
}
@@ -1067,7 +1066,7 @@ trx_undo_report_row_operation(
undo_page = buf_page_get_gen(undo->space, page_no,
RW_X_LATCH, undo->guess_page,
BUF_GET,
- IB__FILE__, __LINE__,
+ __FILE__, __LINE__,
&mtr);
#ifdef UNIV_SYNC_DEBUG
@@ -1271,8 +1270,7 @@ trx_undo_prev_version_build(
" update undo rec for non-clustered ", stderr);
dict_index_name_print(stderr, index);
fputs("\n"
- "InnoDB: Send a detailed bug report to"
- " mysql@lists.mysql.com\n"
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n"
"InnoDB: index record ", stderr);
rec_print(stderr, index_rec);
fputs("\n"
@@ -1320,11 +1318,9 @@ trx_undo_prev_version_build(
" update undo rec for table ", stderr);
ut_print_name(stderr, index->table_name);
fputs("\n"
- "InnoDB: but the table id in the"
- " undo record is wrong\n"
- "InnoDB: Send a detailed bug report to "
- "mysql@lists.mysql.com\n"
- "InnoDB: Run also CHECK TABLE ", stderr);
+"InnoDB: but the table id in the undo record is wrong\n"
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n"
+"InnoDB: Run also CHECK TABLE ", stderr);
ut_print_name(stderr, index->table_name);
putc('\n', stderr);
}
diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c
index 5c01a5371aa..4343249764e 100644
--- a/innobase/trx/trx0roll.c
+++ b/innobase/trx/trx0roll.c
@@ -20,7 +20,6 @@ Created 3/26/1996 Heikki Tuuri
#include "trx0rec.h"
#include "que0que.h"
#include "usr0sess.h"
-#include "srv0que.h"
#include "srv0start.h"
#include "row0undo.h"
#include "row0mysql.h"
@@ -200,7 +199,7 @@ trx_rollback_to_savepoint_for_mysql(
DB_NO_SAVEPOINT,
otherwise DB_SUCCESS */
trx_t* trx, /* in: transaction handle */
- char* savepoint_name, /* in: savepoint name */
+ const char* savepoint_name, /* in: savepoint name */
ib_longlong* mysql_binlog_cache_pos) /* out: the MySQL binlog cache
position corresponding to this
savepoint; MySQL needs this
@@ -265,7 +264,7 @@ trx_savepoint_for_mysql(
/*====================*/
/* out: always DB_SUCCESS */
trx_t* trx, /* in: transaction handle */
- char* savepoint_name, /* in: savepoint name */
+ const char* savepoint_name, /* in: savepoint name */
ib_longlong binlog_cache_pos) /* in: MySQL binlog cache
position corresponding to this
connection at the time of the
@@ -932,21 +931,15 @@ trx_undo_rec_release(
/*************************************************************************
Starts a rollback operation. */
-void
+que_thr_t*
trx_rollback(
/*=========*/
+ /* out: next query thread to run */
trx_t* trx, /* in: transaction */
- trx_sig_t* sig, /* in: signal starting the rollback */
- que_thr_t** next_thr)/* in/out: next query thread to run;
- if the value which is passed in is
- a pointer to a NULL pointer, then the
- calling function can start running
- a new query thread; if the passed value is
- NULL, the parameter is ignored */
+ trx_sig_t* sig) /* in: signal starting the rollback */
{
que_t* roll_graph;
que_thr_t* thr;
-/* que_thr_t* thr2; */
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
@@ -988,18 +981,7 @@ trx_rollback(
thr = que_fork_start_command(roll_graph);
ut_ad(thr);
-
-/* thr2 = que_fork_start_command(roll_graph);
-
- ut_ad(thr2); */
-
- if (next_thr && (*next_thr == NULL)) {
- *next_thr = thr;
-/* srv_que_task_enqueue_low(thr2); */
- } else {
- srv_que_task_enqueue_low(thr);
-/* srv_que_task_enqueue_low(thr2); */
- }
+ return(thr);
}
/********************************************************************
@@ -1071,17 +1053,14 @@ trx_finish_error_processing(
/*************************************************************************
Finishes a partial rollback operation. */
static
-void
+que_thr_t*
trx_finish_partial_rollback_off_kernel(
/*===================================*/
- trx_t* trx, /* in: transaction */
- que_thr_t** next_thr)/* in/out: next query thread to run;
- if the value which is passed in is a pointer
- to a NULL pointer, then the calling function
- can start running a new query thread; if this
- parameter is NULL, it is ignored */
+ /* out: next query thread to run */
+ trx_t* trx) /* in: transaction */
{
trx_sig_t* sig;
+ que_thr_t* next_thr;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
@@ -1092,29 +1071,26 @@ trx_finish_partial_rollback_off_kernel(
/* Remove the signal from the signal queue and send reply message
to it */
- trx_sig_reply(sig, next_thr);
+ next_thr = trx_sig_reply(sig);
trx_sig_remove(trx, sig);
trx->que_state = TRX_QUE_RUNNING;
+ return(next_thr);
}
/********************************************************************
Finishes a transaction rollback. */
-void
+que_thr_t*
trx_finish_rollback_off_kernel(
/*===========================*/
+ /* out: next query thread to run */
que_t* graph, /* in: undo graph which can now be freed */
- trx_t* trx, /* in: transaction */
- que_thr_t** next_thr)/* in/out: next query thread to run;
- if the value which is passed in is
- a pointer to a NULL pointer, then the
- calling function can start running
- a new query thread; if this parameter is
- NULL, it is ignored */
+ trx_t* trx) /* in: transaction */
{
trx_sig_t* sig;
trx_sig_t* next_sig;
+ que_thr_t* next_thr;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
@@ -1129,15 +1105,13 @@ trx_finish_rollback_off_kernel(
if (sig->type == TRX_SIG_ROLLBACK_TO_SAVEPT) {
- trx_finish_partial_rollback_off_kernel(trx, next_thr);
-
- return;
+ return(trx_finish_partial_rollback_off_kernel(trx));
} else if (sig->type == TRX_SIG_ERROR_OCCURRED) {
trx_finish_error_processing(trx);
- return;
+ return(NULL);
}
#ifdef UNIV_DEBUG
@@ -1153,19 +1127,23 @@ trx_finish_rollback_off_kernel(
send reply messages to them */
trx->que_state = TRX_QUE_RUNNING;
-
+
+ next_thr = NULL;
while (sig != NULL) {
next_sig = UT_LIST_GET_NEXT(signals, sig);
if (sig->type == TRX_SIG_TOTAL_ROLLBACK) {
- trx_sig_reply(sig, next_thr);
+ ut_a(next_thr == NULL);
+ next_thr = trx_sig_reply(sig);
trx_sig_remove(trx, sig);
}
sig = next_sig;
}
+
+ return(next_thr);
}
/*************************************************************************
@@ -1198,7 +1176,6 @@ trx_rollback_step(
que_thr_t* thr) /* in: query thread */
{
roll_node_t* node;
- ibool success;
ulint sig_no;
trx_savept_t* savept;
@@ -1225,19 +1202,13 @@ trx_rollback_step(
/* Send a rollback signal to the transaction */
- success = trx_sig_send(thr_get_trx(thr),
- sig_no, TRX_SIG_SELF,
- thr, savept, NULL);
+ trx_sig_send(thr_get_trx(thr), sig_no, TRX_SIG_SELF,
+ thr, savept);
thr->state = QUE_THR_SIG_REPLY_WAIT;
mutex_exit(&kernel_mutex);
- if (!success) {
- /* Error in delivering the rollback signal */
- que_thr_handle_error(thr, DB_ERROR, NULL, 0);
- }
-
return(NULL);
}
diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c
index ef068d8d523..7e35e34f014 100644
--- a/innobase/trx/trx0sys.c
+++ b/innobase/trx/trx0sys.c
@@ -569,7 +569,7 @@ replication has proceeded. */
void
trx_sys_update_mysql_binlog_offset(
/*===============================*/
- char* file_name,/* in: MySQL log file name */
+ const char* file_name,/* in: MySQL log file name */
ib_longlong offset, /* in: position in that log file */
ulint field, /* in: offset of the MySQL log info field in
the trx sys header */
@@ -596,7 +596,7 @@ trx_sys_update_mysql_binlog_offset(
MLOG_4BYTES, mtr);
}
- if (0 != strcmp(sys_header + field + TRX_SYS_MYSQL_LOG_NAME, file_name)) {
+ if (0 != strcmp((char*) (sys_header + field + TRX_SYS_MYSQL_LOG_NAME), file_name)) {
mlog_write_string(sys_header + field
+ TRX_SYS_MYSQL_LOG_NAME,
diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
index fc0a67278d2..862229ef032 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -897,18 +897,15 @@ trx_assign_read_view(
/********************************************************************
Commits a transaction. NOTE that the kernel mutex is temporarily released. */
static
-void
+que_thr_t*
trx_handle_commit_sig_off_kernel(
/*=============================*/
- trx_t* trx, /* in: transaction */
- que_thr_t** next_thr) /* in/out: next query thread to run;
- if the value which is passed in is
- a pointer to a NULL pointer, then the
- calling function can start running
- a new query thread */
+ /* out: next query thread to run */
+ trx_t* trx) /* in: transaction */
{
trx_sig_t* sig;
trx_sig_t* next_sig;
+ que_thr_t* next_thr = NULL;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
@@ -930,7 +927,8 @@ trx_handle_commit_sig_off_kernel(
if (sig->type == TRX_SIG_COMMIT) {
- trx_sig_reply(sig, next_thr);
+ ut_a(next_thr == NULL);
+ next_thr = trx_sig_reply(sig);
trx_sig_remove(trx, sig);
}
@@ -938,6 +936,8 @@ trx_handle_commit_sig_off_kernel(
}
trx->que_state = TRX_QUE_RUNNING;
+
+ return(next_thr);
}
/***************************************************************
@@ -999,39 +999,6 @@ trx_lock_wait_to_suspended(
trx->que_state = TRX_QUE_RUNNING;
}
-/***************************************************************
-Moves the query threads in the sig reply wait list of trx to the SUSPENDED
-state. */
-static
-void
-trx_sig_reply_wait_to_suspended(
-/*============================*/
- trx_t* trx) /* in: transaction */
-{
- trx_sig_t* sig;
- que_thr_t* thr;
-
-#ifdef UNIV_SYNC_DEBUG
- ut_ad(mutex_own(&kernel_mutex));
-#endif /* UNIV_SYNC_DEBUG */
-
- sig = UT_LIST_GET_FIRST(trx->reply_signals);
-
- while (sig != NULL) {
- thr = sig->receiver;
-
- ut_ad(thr->state == QUE_THR_SIG_REPLY_WAIT);
-
- thr->state = QUE_THR_SUSPENDED;
-
- sig->receiver = NULL;
-
- UT_LIST_REMOVE(reply_signals, trx->reply_signals, sig);
-
- sig = UT_LIST_GET_FIRST(trx->reply_signals);
- }
-}
-
/*********************************************************************
Checks the compatibility of a new signal with the other signals in the
queue. */
@@ -1111,11 +1078,10 @@ trx_sig_is_compatible(
/********************************************************************
Sends a signal to a trx object. */
-ibool
+que_thr_t*
trx_sig_send(
/*=========*/
- /* out: TRUE if the signal was
- successfully delivered */
+ /* out: next query thread to run */
trx_t* trx, /* in: trx handle */
ulint type, /* in: signal type */
ulint sender, /* in: TRX_SIG_SELF or
@@ -1123,14 +1089,8 @@ trx_sig_send(
que_thr_t* receiver_thr, /* in: query thread which wants the
reply, or NULL; if type is
TRX_SIG_END_WAIT, this must be NULL */
- trx_savept_t* savept, /* in: possible rollback savepoint, or
+ trx_savept_t* savept) /* in: possible rollback savepoint, or
NULL */
- que_thr_t** next_thr) /* in/out: next query thread to run;
- if the value which is passed in is
- a pointer to a NULL pointer, then the
- calling function can start running
- a new query thread; if the parameter
- is NULL, it is ignored */
{
trx_sig_t* sig;
trx_t* receiver_trx;
@@ -1140,14 +1100,7 @@ trx_sig_send(
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
- if (!trx_sig_is_compatible(trx, type, sender)) {
- /* The signal is not compatible with the other signals in
- the queue: do nothing */
-
- ut_error;
-
- return(FALSE);
- }
+ ut_a(trx_sig_is_compatible(trx, type, sender));
/* Queue the signal object */
@@ -1181,11 +1134,6 @@ trx_sig_send(
sig);
}
- if (trx->sess->state == SESS_ERROR) {
-
- trx_sig_reply_wait_to_suspended(trx);
- }
-
if ((sender != TRX_SIG_SELF) || (type == TRX_SIG_BREAK_EXECUTION)) {
/* The following call will add a TRX_SIG_ERROR_OCCURRED
@@ -1200,10 +1148,10 @@ trx_sig_send(
if (UT_LIST_GET_FIRST(trx->signals) == sig) {
- trx_sig_start_handle(trx, next_thr);
+ return(trx_sig_start_handle(trx));
}
- return(TRUE);
+ return(NULL);
}
/********************************************************************
@@ -1225,27 +1173,18 @@ trx_end_signal_handling(
trx->handling_signals = FALSE;
trx->graph = trx->graph_before_signal_handling;
-
- if (trx->graph && (trx->sess->state == SESS_ERROR)) {
-
- que_fork_error_handle(trx, trx->graph);
- }
}
/********************************************************************
Starts handling of a trx signal. */
-void
+que_thr_t*
trx_sig_start_handle(
/*=================*/
- trx_t* trx, /* in: trx handle */
- que_thr_t** next_thr) /* in/out: next query thread to run;
- if the value which is passed in is
- a pointer to a NULL pointer, then the
- calling function can start running
- a new query thread; if the parameter
- is NULL, it is ignored */
+ /* out: next query thread to run, or NULL */
+ trx_t* trx) /* in: trx handle */
{
+ que_thr_t* next_thr = NULL;
trx_sig_t* sig;
ulint type;
loop:
@@ -1261,7 +1200,7 @@ loop:
trx_end_signal_handling(trx);
- return;
+ return(next_thr);
}
if (trx->conc_state == TRX_NOT_STARTED) {
@@ -1277,23 +1216,13 @@ loop:
trx_lock_wait_to_suspended(trx);
}
- /* If the session is in the error state and this trx has threads
- waiting for reply from signals, moves these threads to the suspended
- state, canceling wait reservations; note that if the transaction has
- sent a commit or rollback signal to itself, and its session is not in
- the error state, then nothing is done here. */
-
- if (trx->sess->state == SESS_ERROR) {
- trx_sig_reply_wait_to_suspended(trx);
- }
-
/* If there are no running query threads, we can start processing of a
signal, otherwise we have to wait until all query threads of this
transaction are aware of the arrival of the signal. */
if (trx->n_active_thrs > 0) {
- return;
+ return(NULL);
}
if (trx->handling_signals == FALSE) {
@@ -1307,30 +1236,19 @@ loop:
if (type == TRX_SIG_COMMIT) {
- trx_handle_commit_sig_off_kernel(trx, next_thr);
+ next_thr = trx_handle_commit_sig_off_kernel(trx);
} else if ((type == TRX_SIG_TOTAL_ROLLBACK)
- || (type == TRX_SIG_ROLLBACK_TO_SAVEPT)) {
-
- trx_rollback(trx, sig, next_thr);
-
- /* No further signals can be handled until the rollback
- completes, therefore we return */
-
- return;
-
- } else if (type == TRX_SIG_ERROR_OCCURRED) {
-
- trx_rollback(trx, sig, next_thr);
-
+ || (type == TRX_SIG_ROLLBACK_TO_SAVEPT)
+ || (type == TRX_SIG_ERROR_OCCURRED)) {
/* No further signals can be handled until the rollback
completes, therefore we return */
- return;
+ return(trx_rollback(trx, sig));
} else if (type == TRX_SIG_BREAK_EXECUTION) {
- trx_sig_reply(sig, next_thr);
+ next_thr = trx_sig_reply(sig);
trx_sig_remove(trx, sig);
} else {
ut_error;
@@ -1343,17 +1261,14 @@ loop:
Send the reply message when a signal in the queue of the trx has been
handled. */
-void
+que_thr_t*
trx_sig_reply(
/*==========*/
- trx_sig_t* sig, /* in: signal */
- que_thr_t** next_thr) /* in/out: next query thread to run;
- if the value which is passed in is
- a pointer to a NULL pointer, then the
- calling function can start running
- a new query thread */
+ /* out: next query thread to run */
+ trx_sig_t* sig) /* in: signal */
{
- trx_t* receiver_trx;
+ trx_t* receiver_trx;
+ que_thr_t* next_thr = NULL;
ut_ad(sig);
#ifdef UNIV_SYNC_DEBUG
@@ -1367,13 +1282,13 @@ trx_sig_reply(
UT_LIST_REMOVE(reply_signals, receiver_trx->reply_signals,
sig);
- ut_ad(receiver_trx->sess->state != SESS_ERROR);
-
- que_thr_end_wait(sig->receiver, next_thr);
+ next_thr = que_thr_end_wait(sig->receiver);
sig->receiver = NULL;
}
+
+ return(next_thr);
}
/********************************************************************
@@ -1429,7 +1344,6 @@ trx_commit_step(
{
commit_node_t* node;
que_thr_t* next_thr;
- ibool success;
node = thr->run_node;
@@ -1444,21 +1358,14 @@ trx_commit_step(
node->state = COMMIT_NODE_WAIT;
- next_thr = NULL;
-
thr->state = QUE_THR_SIG_REPLY_WAIT;
/* Send the commit signal to the transaction */
- success = trx_sig_send(thr_get_trx(thr), TRX_SIG_COMMIT,
- TRX_SIG_SELF, thr, NULL, &next_thr);
-
- mutex_exit(&kernel_mutex);
+ next_thr = trx_sig_send(thr_get_trx(thr), TRX_SIG_COMMIT,
+ TRX_SIG_SELF, thr, NULL);
- if (!success) {
- /* Error in delivering the commit signal */
- que_thr_handle_error(thr, DB_ERROR, NULL, 0);
- }
+ mutex_exit(&kernel_mutex);
return(next_thr);
}
@@ -1564,7 +1471,9 @@ trx_mark_sql_stat_end(
/**************************************************************************
Prints info about a transaction to the standard output. The caller must
-own the kernel mutex. */
+own the kernel mutex and must have called
+innobase_mysql_prepare_print_arbitrary_thd(), unless he knows that MySQL or
+InnoDB cannot meanwhile change the info printed here. */
void
trx_print(
diff --git a/innobase/usr/usr0sess.c b/innobase/usr/usr0sess.c
index 359c1552421..cc016f2b823 100644
--- a/innobase/usr/usr0sess.c
+++ b/innobase/usr/usr0sess.c
@@ -37,8 +37,6 @@ sess_open(void)
#endif /* UNIV_SYNC_DEBUG */
sess = mem_alloc(sizeof(sess_t));
- sess->state = SESS_ACTIVE;
-
sess->trx = trx_create(sess);
UT_LIST_INIT(sess->graphs);
diff --git a/innobase/ut/ut0dbg.c b/innobase/ut/ut0dbg.c
index 3697e31050f..65703ec1c86 100644
--- a/innobase/ut/ut0dbg.c
+++ b/innobase/ut/ut0dbg.c
@@ -23,7 +23,7 @@ const char* ut_dbg_msg_assert_fail =
"InnoDB: Assertion failure in thread %lu in file %s line %lu\n";
const char* ut_dbg_msg_trap =
"InnoDB: We intentionally generate a memory trap.\n"
-"InnoDB: Send a detailed bug report to mysql@lists.mysql.com.\n"
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com.\n"
"InnoDB: If you get repeated assertion failures or crashes, even\n"
"InnoDB: immediately after the mysqld startup, there may be\n"
"InnoDB: corruption in the InnoDB tablespace. See section 6.1 of\n"
diff --git a/innobase/ut/ut0mem.c b/innobase/ut/ut0mem.c
index 9d0e63e6099..47b612d757e 100644
--- a/innobase/ut/ut0mem.c
+++ b/innobase/ut/ut0mem.c
@@ -273,53 +273,3 @@ ut_memcpyq(
return(dest);
}
-
-/**************************************************************************
-Catenates two strings into newly allocated memory. The memory must be freed
-using mem_free. */
-
-char*
-ut_str_catenate(
-/*============*/
- /* out, own: catenated null-terminated string */
- char* str1, /* in: null-terminated string */
- char* str2) /* in: null-terminated string */
-{
- ulint len1;
- ulint len2;
- char* str;
-
- len1 = ut_strlen(str1);
- len2 = ut_strlen(str2);
-
- str = mem_alloc(len1 + len2 + 1);
-
- ut_memcpy(str, str1, len1);
- ut_memcpy(str + len1, str2, len2 + 1);
-
- return(str);
-}
-
-/**************************************************************************
-Return a copy of the given string. The returned string must be freed
-using mem_free. */
-
-char*
-ut_strdup(
-/*======*/
- /* out, own: cnull-terminated string */
- char* str) /* in: null-terminated string */
-{
- ulint len;
- char* copy;
-
- len = ut_strlen(str);
-
- copy = mem_alloc(len + 1);
-
- ut_memcpy(copy, str, len);
-
- copy[len] = 0;
-
- return(copy);
-}
diff --git a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c
index 21677e98318..39850227162 100644
--- a/innobase/ut/ut0ut.c
+++ b/innobase/ut/ut0ut.c
@@ -30,227 +30,6 @@ mysql_get_identifier_quote_char(void);
used in SQL identifiers */
/************************************************************
-On the 64-bit Windows we substitute the format string
-%l -> %I64
-because we define ulint as unsigned __int64 and lint as __int64 on Windows,
-and both the Microsoft and Intel C compilers require the format string
-%I64 in that case instead of %l. */
-
-int
-ut_printf(
-/*======*/
- /* out: the number of characters written, or
- negative in case of an error */
- const char* format, /* in: format of prints */
- ...) /* in: arguments to be printed */
-{
- va_list args;
- ulint len;
- char* format_end;
- char* newformat;
- char* ptr;
- char* newptr;
- int ret;
- char format_buf_in_stack[500];
-
- len = strlen(format);
-
- if (len > 250) {
- newformat = malloc(2 * len);
- } else {
- newformat = format_buf_in_stack;
- }
-
- format_end = (char*)format + len;
-
- ptr = (char*)format;
- newptr = newformat;
-
-#if defined(__WIN__) && (defined(WIN64) || defined(_WIN64))
- /* Replace %l with %I64 if it is not preceded with '\' */
-
- while (ptr < format_end) {
- if (*ptr == '%' && *(ptr + 1) == 'l'
- && (ptr == format || *(ptr - 1) != '\\')) {
-
- memcpy(newptr, "%I64", 4);
- ptr += 2;
- newptr += 4;
- } else {
- *newptr = *ptr;
- ptr++;
- newptr++;
- }
- }
-
- *newptr = '\0';
-
- ut_a(newptr < newformat + 2 * len);
-#else
- strcpy(newformat, format);
-#endif
- va_start(args, format);
-
- ret = vprintf((const char*)newformat, args);
-
- va_end(args);
-
- if (newformat != format_buf_in_stack) {
- free(newformat);
- }
-
- return(ret);
-}
-
-/************************************************************
-On the 64-bit Windows we substitute the format string
-%l -> %I64
-because we define ulint as unsigned __int64 and lint as __int64 on Windows,
-and both the Microsoft and Intel C compilers require the format string
-%I64 in that case instead of %l. */
-
-int
-ut_sprintf(
-/*=======*/
- /* out: the number of characters written, or
- negative in case of an error */
- char* buf, /* in: buffer where to print */
- const char* format, /* in: format of prints */
- ...) /* in: arguments to be printed */
-{
- va_list args;
- ulint len;
- char* format_end;
- char* newformat;
- char* ptr;
- char* newptr;
- int ret;
- char format_buf_in_stack[500];
-
- len = strlen(format);
-
- if (len > 250) {
- newformat = malloc(2 * len);
- } else {
- newformat = format_buf_in_stack;
- }
-
- format_end = (char*)format + len;
-
- ptr = (char*)format;
- newptr = newformat;
-
-#if defined(__WIN__) && (defined(WIN64) || defined(_WIN64))
- /* Replace %l with %I64 if it is not preceded with '\' */
-
- while (ptr < format_end) {
- if (*ptr == '%' && *(ptr + 1) == 'l'
- && (ptr == format || *(ptr - 1) != '\\')) {
-
- memcpy(newptr, "%I64", 4);
- ptr += 2;
- newptr += 4;
- } else {
- *newptr = *ptr;
- ptr++;
- newptr++;
- }
- }
-
- *newptr = '\0';
-
- ut_a(newptr < newformat + 2 * len);
-#else
- strcpy(newformat, format);
-#endif
- va_start(args, format);
-
- ret = vsprintf(buf, (const char*)newformat, args);
-
- va_end(args);
-
- if (newformat != format_buf_in_stack) {
- free(newformat);
- }
-
- return(ret);
-}
-
-/************************************************************
-On the 64-bit Windows we substitute the format string
-%l -> %I64
-because we define ulint as unsigned __int64 and lint as __int64 on Windows,
-and both the Microsoft and Intel C compilers require the format string
-%I64 in that case instead of %l. */
-
-int
-ut_fprintf(
-/*=======*/
- /* out: the number of characters written, or
- negative in case of an error */
- FILE* stream, /* in: stream where to print */
- const char* format, /* in: format of prints */
- ...) /* in: arguments to be printed */
-{
- va_list args;
- ulint len;
- char* format_end;
- char* newformat;
- char* ptr;
- char* newptr;
- int ret;
- char format_buf_in_stack[500];
-
- len = strlen(format);
-
- if (len > 250) {
- newformat = malloc(2 * len);
- } else {
- newformat = format_buf_in_stack;
- }
-
- format_end = (char*)format + len;
-
- ptr = (char*)format;
- newptr = newformat;
-
-#if defined(__WIN__) && (defined(WIN64) || defined(_WIN64))
- /* Replace %l with %I64 if it is not preceded with '\' */
-
- while (ptr < format_end) {
- if (*ptr == '%' && *(ptr + 1) == 'l'
- && (ptr == format || *(ptr - 1) != '\\')) {
-
- memcpy(newptr, "%I64", 4);
- ptr += 2;
- newptr += 4;
- } else {
- *newptr = *ptr;
- ptr++;
- newptr++;
- }
- }
-
- *newptr = '\0';
-
- ut_a(newptr < newformat + 2 * len);
-#else
- strcpy(newformat, format);
-#endif
- va_start(args, format);
-
- ret = vfprintf(stream, (const char*)newformat, args);
-
- va_end(args);
-
- if (newformat != format_buf_in_stack) {
- free(newformat);
- }
-
- return(ret);
-}
-
-/************************************************************
Gets the high 32 bits in a ulint. That is makes a shift >> 32,
but since there seem to be compiler bugs in both gcc and Visual C++,
we do this by a special conversion. */
diff --git a/isam/_search.c b/isam/_search.c
index 7b61abfb46b..fbffd6786e1 100644
--- a/isam/_search.c
+++ b/isam/_search.c
@@ -489,7 +489,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar
int alength,blength;
if (swap_flag)
- swap(uchar*,a,b);
+ swap_variables(uchar*, a, b);
alength= *a++; blength= *b++;
if ((flag=(int) (keyseg->base.length-key_length)) < 0)
flag=0;
@@ -504,7 +504,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar
if (*a == '-' && *b == '-')
{
swap_flag=1;
- swap(uchar*,a,b);
+ swap_variables(uchar*, a, b);
}
end=a+alength;
while (a < end)
@@ -531,7 +531,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar
if (swap_flag)
{
end=b+(int) (end-a);
- swap(uchar*,a,b);
+ swap_variables(uchar*, a, b);
}
while (a < end)
if (*a++ != *b++)
@@ -550,7 +550,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar
}
}
if (swap_flag)
- swap(uchar*,a,b);
+ swap_variables(uchar*, a, b);
break;
}
#ifdef HAVE_LONG_LONG
diff --git a/isam/isamchk.c b/isam/isamchk.c
index 8fa6b7ad4c0..513c1ea3a5d 100644
--- a/isam/isamchk.c
+++ b/isam/isamchk.c
@@ -333,12 +333,16 @@ static struct my_option my_long_options[] =
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
+#include <help_start.h>
+
static void print_version(void)
{
printf("%s Ver 6.01 for %s at %s\n", my_progname, SYSTEM_TYPE,
MACHINE_TYPE);
+ NETWARE_SET_SCREEN_MODE(1);
}
+
static void usage(void)
{
print_version();
@@ -352,6 +356,8 @@ static void usage(void)
my_print_variables(my_long_options);
}
+#include <help_end.h>
+
/* Check table */
static int nisamchk(my_string filename)
diff --git a/isam/test2.c b/isam/test2.c
index 14a40f39865..4b22f2d679c 100644
--- a/isam/test2.c
+++ b/isam/test2.c
@@ -526,7 +526,7 @@ int main(int argc, char *argv[])
if (j != 0 && k != 0)
{
if (j > k)
- swap(int,j,k);
+ swap_variables(int, j, k);
sprintf(key,"%6d",j);
sprintf(key2,"%6d",k);
range_records=nisam_records_in_range(file,0,key,0,HA_READ_AFTER_KEY,
diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h
index 1c1ff9bac10..1d4f45b729f 100644
--- a/libmysql/client_settings.h
+++ b/libmysql/client_settings.h
@@ -42,7 +42,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename);
void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group);
-MYSQL *
+MYSQL * STDCALL
cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
const char *passwd, const char *db,
uint port, const char *unix_socket,ulong client_flag);
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 4ecc1bd0584..63f447ea1b9 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -88,8 +88,6 @@ my_bool net_flush(NET *net);
static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data);
static void append_wild(char *to,char *end,const char *wild);
sig_handler pipe_sig_handler(int sig);
-static ulong mysql_sub_escape_string(CHARSET_INFO *charset_info, char *to,
- const char *from, ulong length);
static my_bool mysql_client_init= 0;
static my_bool org_my_init_done= 0;
@@ -629,7 +627,7 @@ static int check_license(MYSQL *mysql)
MYSQL_RES *res;
NET *net= &mysql->net;
static const char query[]= "SELECT @@license";
- static const char required_license[]= LICENSE;
+ static const char required_license[]= STRINGIFY_ARG(LICENSE);
if (mysql_real_query(mysql, query, sizeof(query)-1))
{
@@ -831,7 +829,8 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
}
/* initialize local infile (open file, usually) */
- if ((*options->local_infile_init)(&li_ptr, net_filename))
+ if ((*options->local_infile_init)(&li_ptr, net_filename,
+ options->local_infile_userdata))
{
my_net_write(net,"",0); /* Server needs one packet */
net_flush(net);
@@ -915,7 +914,8 @@ typedef struct st_default_local_infile
1 error
*/
-static int default_local_infile_init(void **ptr, const char *filename)
+static int default_local_infile_init(void **ptr, const char *filename,
+ void *userdata __attribute__ ((unused)))
{
default_local_infile_data *data;
char tmp_name[FN_REFLEN];
@@ -1025,15 +1025,18 @@ default_local_infile_error(void *ptr, char *error_msg, uint error_msg_len)
void
mysql_set_local_infile_handler(MYSQL *mysql,
- int (*local_infile_init)(void **, const char *),
+ int (*local_infile_init)(void **, const char *,
+ void *),
int (*local_infile_read)(void *, char *, uint),
void (*local_infile_end)(void *),
- int (*local_infile_error)(void *, char *, uint))
+ int (*local_infile_error)(void *, char *, uint),
+ void *userdata)
{
mysql->options.local_infile_init= local_infile_init;
mysql->options.local_infile_read= local_infile_read;
mysql->options.local_infile_end= local_infile_end;
mysql->options.local_infile_error= local_infile_error;
+ mysql->options.local_infile_userdata = userdata;
}
@@ -1565,73 +1568,14 @@ void my_net_local_init(NET *net)
ulong STDCALL
mysql_escape_string(char *to,const char *from,ulong length)
{
- return mysql_sub_escape_string(default_charset_info,to,from,length);
+ return escape_string_for_mysql(default_charset_info, to, from, length);
}
ulong STDCALL
mysql_real_escape_string(MYSQL *mysql, char *to,const char *from,
ulong length)
{
- return mysql_sub_escape_string(mysql->charset,to,from,length);
-}
-
-
-static ulong
-mysql_sub_escape_string(CHARSET_INFO *charset_info, char *to,
- const char *from, ulong length)
-{
- const char *to_start=to;
- const char *end;
-#ifdef USE_MB
- my_bool use_mb_flag=use_mb(charset_info);
-#endif
- for (end=from+length; from != end ; from++)
- {
-#ifdef USE_MB
- int l;
- if (use_mb_flag && (l = my_ismbchar(charset_info, from, end)))
- {
- while (l--)
- *to++ = *from++;
- from--;
- continue;
- }
-#endif
- switch (*from) {
- case 0: /* Must be escaped for 'mysql' */
- *to++= '\\';
- *to++= '0';
- break;
- case '\n': /* Must be escaped for logs */
- *to++= '\\';
- *to++= 'n';
- break;
- case '\r':
- *to++= '\\';
- *to++= 'r';
- break;
- case '\\':
- *to++= '\\';
- *to++= '\\';
- break;
- case '\'':
- *to++= '\\';
- *to++= '\'';
- break;
- case '"': /* Better safe than sorry */
- *to++= '\\';
- *to++= '"';
- break;
- case '\032': /* This gives problems on Win32 */
- *to++= '\\';
- *to++= 'Z';
- break;
- default:
- *to++= *from;
- }
- }
- *to=0;
- return (ulong) (to-to_start);
+ return escape_string_for_mysql(mysql->charset, to, from, length);
}
@@ -1973,7 +1917,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
{
/* This is second prepare with another statement */
- char buff[4];
+ char buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */
mysql_stmt_free_result(stmt);
/*
@@ -2348,6 +2292,14 @@ static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length)
stmt->insert_id= mysql->insert_id;
DBUG_RETURN(0);
}
+
+
+static void store_param_type(char **pos, MYSQL_BIND *param)
+{
+ uint typecode= param->buffer_type | (param->is_unsigned ? 32768 : 0);
+ int2store(*pos, typecode);
+ *pos+= 2;
+}
int cli_stmt_execute(MYSQL_STMT *stmt)
@@ -2385,11 +2337,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt)
that is sent to the server.
*/
for (param= stmt->params; param < param_end ; param++)
- {
- uint typecode= param->buffer_type | (param->is_unsigned ? 32768 : 0);
- int2store(net->write_pos, typecode);
- net->write_pos+= 2;
- }
+ store_param_type((char**) &net->write_pos, param);
}
for (param= stmt->params; param < param_end; param++)
@@ -2799,25 +2747,27 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
param->param_number);
DBUG_RETURN(1);
}
- /* Mark for execute that the result is already sent */
+
+ /*
+ Send long data packet if there is data or we're sending long data
+ for the first time.
+ */
if (length || param->long_data_used == 0)
{
MYSQL *mysql= stmt->mysql;
- char *packet, extra_data[MYSQL_LONG_DATA_HEADER];
-
+ /* Packet header: stmt id (4 bytes), param no (2 bytes) */
+ char buff[MYSQL_LONG_DATA_HEADER];
+
+ int4store(buff, stmt->stmt_id);
+ int2store(buff + 4, param_number);
param->long_data_used= 1;
- packet= extra_data;
- int4store(packet, stmt->stmt_id); packet+=4;
- int2store(packet, param_number); packet+=2;
-
/*
Note that we don't get any ok packet from the server in this case
This is intentional to save bandwidth.
*/
- if ((*mysql->methods->advanced_command)(mysql, COM_LONG_DATA, extra_data,
- MYSQL_LONG_DATA_HEADER, data,
- length, 1))
+ if ((*mysql->methods->advanced_command)(mysql, COM_LONG_DATA, buff,
+ sizeof(buff), data, length, 1))
{
set_stmt_errmsg(stmt, mysql->net.last_error,
mysql->net.last_errno, mysql->net.sqlstate);
@@ -3724,28 +3674,6 @@ int cli_read_binary_rows(MYSQL_STMT *stmt)
mysql= mysql->last_used_con;
- if (stmt->update_max_length && !stmt->bind_result_done)
- {
- /*
- We must initalize the bind structure to be able to calculate
- max_length
- */
- MYSQL_BIND *bind, *end;
- MYSQL_FIELD *field;
- bzero((char*) stmt->bind, sizeof(*stmt->bind)* stmt->field_count);
-
- for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields;
- bind < end ;
- bind++, field++)
- {
- bind->buffer_type= field->type;
- bind->buffer_length=1;
- }
-
- mysql_stmt_bind_result(stmt, stmt->bind);
- stmt->bind_result_done= 0; /* No normal bind done */
- }
-
while ((pkt_len= net_safe_read(mysql)) != packet_error)
{
cp= net->read_pos;
@@ -3763,8 +3691,6 @@ int cli_read_binary_rows(MYSQL_STMT *stmt)
memcpy((char *) cur->data, (char *) cp+1, pkt_len-1);
cur->length= pkt_len; /* To allow us to do sanity checks */
result->rows++;
- if (stmt->update_max_length)
- stmt_update_metadata(stmt, cur);
}
else
{
@@ -3809,6 +3735,29 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
result->rows= 0;
stmt->data_cursor= NULL;
}
+
+ if (stmt->update_max_length && !stmt->bind_result_done)
+ {
+ /*
+ We must initalize the bind structure to be able to calculate
+ max_length
+ */
+ MYSQL_BIND *bind, *end;
+ MYSQL_FIELD *field;
+ bzero((char*) stmt->bind, sizeof(*stmt->bind)* stmt->field_count);
+
+ for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields;
+ bind < end ;
+ bind++, field++)
+ {
+ bind->buffer_type= field->type;
+ bind->buffer_length=1;
+ }
+
+ mysql_stmt_bind_result(stmt, stmt->bind);
+ stmt->bind_result_done= 0; /* No normal bind done */
+ }
+
if ((*mysql->methods->read_binary_rows)(stmt))
{
free_root(&result->alloc, MYF(MY_KEEP_PREALLOC));
@@ -3817,6 +3766,13 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
DBUG_RETURN(1);
}
+ if (stmt->update_max_length)
+ {
+ MYSQL_ROWS *cur= result->data;
+ for(; cur; cur=cur->next)
+ stmt_update_metadata(stmt, cur);
+ }
+
stmt->data_cursor= result->data;
mysql->affected_rows= stmt->affected_rows= result->rows;
stmt->read_row_func= stmt_read_row_buffered;
@@ -3951,7 +3907,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
mysql->stmts= list_delete(mysql->stmts, &stmt->list);
if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
{
- char buff[4];
+ char buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */
if (mysql->unbuffered_fetch_owner == &stmt->unbuffered_fetch_cancelled)
mysql->unbuffered_fetch_owner= 0;
@@ -3986,7 +3942,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt)
{
- char buff[MYSQL_STMT_HEADER];
+ char buff[MYSQL_STMT_HEADER]; /* packet header: 4 bytes for stmt id */
MYSQL *mysql;
MYSQL_BIND *param, *param_end;
DBUG_ENTER("mysql_stmt_reset");
@@ -3999,7 +3955,7 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt)
mysql= stmt->mysql->last_used_con;
int4store(buff, stmt->stmt_id); /* Send stmt id to server */
if ((*mysql->methods->advanced_command)(mysql, COM_RESET_STMT, buff,
- MYSQL_STMT_HEADER,0,0,0))
+ sizeof(buff), 0, 0, 0))
{
set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
mysql->net.sqlstate);
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index 036a61208ed..29e88eb41f2 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -48,7 +48,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
key.cc lock.cc log.cc log_event.cc sql_state.c \
protocol.cc net_serv.cc opt_range.cc \
opt_sum.cc procedure.cc records.cc sql_acl.cc \
- sql_load.cc sql_olap.cc discover.cc \
+ sql_load.cc discover.cc \
sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \
sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc sql_parse.cc \
@@ -79,25 +79,32 @@ INC_LIB= $(top_builddir)/regex/libregex.a \
$(top_builddir)/vio/libvio.a
#
-# To make it easy for the end user to use the embedded library we
-# generate a total libmysqld.a from all library files,
+# To make it easy for the end user to use the embedded library we
+# generate a total libmysqld.a from all library files,
libmysqld.a: libmysqld_int.a $(INC_LIB)
- if test ! -d tmp ; then mkdir tmp ; fi
- rm -f $@ libmysqld_int2.a tmp/*.o tmp/*.a
- cp $(INC_LIB) tmp
- cp libmysqld_int.a libmysqld_int2.a ; \
- cd tmp ; \
- for file in *.a ; do \
- bfile=`basename $$file .a` ; \
- $(AR) x $$file; \
- for obj in *.o ; do mv $$obj $${bfile}_$$obj ; done ; \
- $(AR) q ../libmysqld_int2.a *.o ; \
- rm -f *.o ; \
- done
- mv libmysqld_int2.a libmysqld.a
- rm -f tmp/*
- $(RANLIB) libmysqld.a
+ if test "$(host_os)" = "netware" ; \
+ then \
+ $(libmysqld_a_AR) libmysqld.a libmysqld_int.a $(INC_LIB) ; \
+ else \
+ if test ! -d tmp ; then mkdir tmp ; fi ; \
+ rm -f $@ libmysqld_int2.a tmp/*.o tmp/*.a ; \
+ cp $(INC_LIB) tmp ; \
+ cp libmysqld_int.a libmysqld_int2.a ; \
+ cd tmp ; \
+ for file in *.a ; do \
+ bfile=`basename $$file .a` ; \
+ $(AR) x $$file; \
+ for obj in *.o ; do mv $$obj $${bfile}_$$obj ; done ; \
+ $(AR) q ../libmysqld_int2.a *.o ; \
+ rm -f *.o ; \
+ done ; \
+ cd .. ; \
+ mv libmysqld_int2.a libmysqld.a ; \
+ rm -f tmp/* ; \
+ $(RANLIB) libmysqld.a ; \
+ fi
+
## XXX: any time the client interface changes, we'll need to bump
## the version info for libmysqld; however, it's possible for the
diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc
index 0b6416632b7..7d83023abd5 100644
--- a/libmysqld/emb_qcache.cc
+++ b/libmysqld/emb_qcache.cc
@@ -295,7 +295,7 @@ uint emb_count_querycache_size(THD *thd)
cur_row= thd->data->data;
n_rows= thd->data->rows;
}
- result= 4+8 + (42 + 4*n_rows)*mysql->field_count;
+ result= (uint) (4+8 + (42 + 4*n_rows)*mysql->field_count);
for(; field < field_end; field++)
{
@@ -414,8 +414,8 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
goto err;
thd->data= data;
init_alloc_root(&data->alloc, 8192,0);
- row= (MYSQL_ROWS *)alloc_root(&data->alloc, rows * sizeof(MYSQL_ROWS) +
- rows * (mysql->field_count+1)*sizeof(char*));
+ row= (MYSQL_ROWS *)alloc_root(&data->alloc, (uint) (rows * sizeof(MYSQL_ROWS) +
+ rows * (mysql->field_count+1)*sizeof(char*)));
end_row= row + rows;
columns= (MYSQL_ROW)end_row;
diff --git a/libmysqld/embedded_priv.h b/libmysqld/embedded_priv.h
index 1608f4ed4ad..d4316dff63f 100644
--- a/libmysqld/embedded_priv.h
+++ b/libmysqld/embedded_priv.h
@@ -28,5 +28,6 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db);
void *create_embedded_thd(int client_flag, char *db);
int check_embedded_connection(MYSQL *mysql);
void free_old_query(MYSQL *mysql);
+void embedded_get_error(MYSQL *mysql);
extern MYSQL_METHODS embedded_methods;
C_MODE_END
diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am
index fe56926039d..b3db54d305a 100644
--- a/libmysqld/examples/Makefile.am
+++ b/libmysqld/examples/Makefile.am
@@ -1,11 +1,16 @@
-noinst_PROGRAMS = mysqltest mysql
+noinst_PROGRAMS = mysqltest mysql client_test
client_sources = $(mysqltest_SOURCES) $(mysql_SOURCES)
+tests_sources= $(client_test_SOURCES)
link_sources:
for f in $(client_sources); do \
rm -f $(srcdir)/$$f; \
@LN_CP_F@ $(srcdir)/../../client/$$f $(srcdir)/$$f; \
done;
+ for f in $(tests_sources); do \
+ rm -f $(srcdir)/$$f; \
+ @LN_CP_F@ $(srcdir)/../../tests/$$f $(srcdir)/$$f; \
+ done;
DEFS = -DEMBEDDED_LIBRARY
INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir) \
@@ -21,8 +26,12 @@ mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \
my_readline.h sql_string.h completion_hash.h
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD)
+client_test_LINK = $(CXXLINK)
+client_test_SOURCES = client_test.c
+
clean:
rm -f $(client_sources)
+ rm -f $(tests_sources)
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index cfb50d3907a..2bbca220db9 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -42,6 +42,22 @@ C_MODE_START
#include "errmsg.h"
#include <sql_common.h>
+void embedded_get_error(MYSQL *mysql)
+{
+ THD *thd=(THD *) mysql->thd;
+ NET *net= &mysql->net;
+ if ((net->last_errno= thd->net.last_errno))
+ {
+ memcpy(net->last_error, thd->net.last_error, sizeof(net->last_error));
+ memcpy(net->sqlstate, thd->net.sqlstate, sizeof(net->sqlstate));
+ }
+ else
+ {
+ net->last_error[0]= 0;
+ strmov(net->sqlstate, not_error_sqlstate);
+ }
+}
+
static my_bool
emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
const char *header, ulong header_length,
@@ -86,16 +102,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
if (!skip_check)
result= thd->net.last_errno ? -1 : 0;
- if ((net->last_errno= thd->net.last_errno))
- {
- memcpy(net->last_error, thd->net.last_error, sizeof(net->last_error));
- memcpy(net->sqlstate, thd->net.sqlstate, sizeof(net->sqlstate));
- }
- else
- {
- net->last_error[0]= 0;
- strmov(net->sqlstate, not_error_sqlstate);
- }
+ embedded_get_error(mysql);
mysql->server_status= thd->server_status;
mysql->warning_count= ((THD*)mysql->thd)->total_warn_count;
return result;
@@ -197,6 +204,8 @@ static int emb_stmt_execute(MYSQL_STMT *stmt)
set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
DBUG_RETURN(1);
}
+ stmt->affected_rows= stmt->mysql->affected_rows;
+ stmt->insert_id= stmt->mysql->insert_id;
DBUG_RETURN(0);
}
@@ -237,6 +246,7 @@ static void emb_free_embedded_thd(MYSQL *mysql)
free_rows(thd->data);
thread_count--;
delete thd;
+ mysql->thd=0;
}
static const char * emb_read_statistics(MYSQL *mysql)
@@ -496,8 +506,7 @@ int check_embedded_connection(MYSQL *mysql)
thd->host= (char*)my_localhost;
thd->host_or_ip= thd->host;
thd->user= my_strdup(mysql->user, MYF(0));
- check_user(thd, COM_CONNECT, NULL, 0, thd->db, true);
- return 0;
+ return check_user(thd, COM_CONNECT, NULL, 0, thd->db, true);
}
#else
@@ -605,13 +614,14 @@ bool Protocol::send_fields(List<Item> *list, uint flag)
if (!(res=item->val_str(&tmp)))
{
- client_field->def= strdup_root(field_alloc, "");
client_field->def_length= 0;
+ client_field->def= strmake_root(field_alloc, "",0);
}
else
{
- client_field->def= strdup_root(field_alloc, res->ptr());
client_field->def_length= res->length();
+ client_field->def= strmake_root(field_alloc, res->ptr(),
+ client_field->def_length);
}
}
else
diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c
index 95f745aef5f..db9e828369d 100644
--- a/libmysqld/libmysqld.c
+++ b/libmysqld/libmysqld.c
@@ -232,6 +232,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
DBUG_RETURN(mysql);
error:
+ embedded_get_error(mysql);
DBUG_PRINT("error",("message: %u (%s)", mysql->net.last_errno,
mysql->net.last_error));
{
diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def
index c3f757b5f1a..8b2ad8379d6 100644
--- a/libmysqld/libmysqld.def
+++ b/libmysqld/libmysqld.def
@@ -128,3 +128,5 @@ EXPORTS
alloc_root
free_root
my_read
+ max_allowed_packet
+ llstr
diff --git a/myisam/ft_nlq_search.c b/myisam/ft_nlq_search.c
index 9b42d51ab55..c9caf4f39af 100644
--- a/myisam/ft_nlq_search.c
+++ b/myisam/ft_nlq_search.c
@@ -90,8 +90,9 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
/* Skip rows inserted by current inserted */
for (r=_mi_search(info, keyinfo, keybuff, keylen, SEARCH_FIND, key_root) ;
- (subkeys=ft_sintXkorr(info->lastkey+info->lastkey_length-extra)) > 0 &&
- !r && info->lastpos >= info->state->data_file_length ;
+ !r &&
+ (subkeys=ft_sintXkorr(info->lastkey+info->lastkey_length-extra)) > 0 &&
+ info->lastpos >= info->state->data_file_length ;
r= _mi_search_next(info, keyinfo, info->lastkey,
info->lastkey_length, SEARCH_BIGGER, key_root))
;
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index 2d89efa61f6..ab58a36915e 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -3311,8 +3311,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
}
get_key_full_length_rdonly(val_off, ft_buf->lastkey);
- if (val_off == a_len &&
- mi_compare_text(sort_param->seg->charset,
+ if (mi_compare_text(sort_param->seg->charset,
((uchar *)a)+1,a_len-1,
ft_buf->lastkey+1,val_off-1, 0, 0)==0)
{
@@ -3320,11 +3319,11 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
{
ft_buf->count++;
return sort_insert_key(sort_param,key_block,
- ((uchar *)a)+val_off, HA_OFFSET_ERROR);
+ ((uchar *)a)+a_len, HA_OFFSET_ERROR);
}
/* storing the key in the buffer. */
- memcpy (ft_buf->buf, (char *)a+val_off, val_len);
+ memcpy (ft_buf->buf, (char *)a+a_len, val_len);
ft_buf->buf+=val_len;
if (ft_buf->buf < ft_buf->end)
return 0;
diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c
index 30a4762abe0..f64e774810d 100644
--- a/myisam/mi_dynrec.c
+++ b/myisam/mi_dynrec.c
@@ -311,7 +311,7 @@ static int update_backward_delete_link(MI_INFO *info, my_off_t delete_block,
DBUG_RETURN(1); /* Wrong delete link */
}
}
- return 0;
+ DBUG_RETURN(0);
}
/* Delete datarecord from database */
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index 2c4661c4d3e..53cf87b24b4 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1151,3 +1151,84 @@ int mi_open_keyfile(MYISAM_SHARE *share)
return 1;
return 0;
}
+
+
+/*
+ Disable all indexes.
+
+ SYNOPSIS
+ mi_disable_indexes()
+ info A pointer to the MyISAM storage engine MI_INFO struct.
+
+ DESCRIPTION
+ Disable all indexes.
+
+ RETURN
+ 0 ok
+*/
+
+int mi_disable_indexes(MI_INFO *info)
+{
+ MYISAM_SHARE *share= info->s;
+
+ share->state.key_map= 0;
+ return 0;
+}
+
+
+/*
+ Enable all indexes
+
+ SYNOPSIS
+ mi_enable_indexes()
+ info A pointer to the MyISAM storage engine MI_INFO struct.
+
+ DESCRIPTION
+ Enable all indexes. The indexes might have been disabled
+ by mi_disable_index() before.
+ The function works only if both data and indexes are empty,
+ otherwise a repair is required.
+ To be sure, call handler::delete_all_rows() before.
+
+ RETURN
+ 0 ok
+ HA_ERR_CRASHED data or index is non-empty.
+*/
+
+int mi_enable_indexes(MI_INFO *info)
+{
+ int error= 0;
+ MYISAM_SHARE *share= info->s;
+
+ if (share->state.state.data_file_length ||
+ (share->state.state.key_file_length != share->base.keystart))
+ error= HA_ERR_CRASHED;
+ else
+ share->state.key_map= ((ulonglong) 1L << share->base.keys) - 1;
+ return error;
+}
+
+
+/*
+ Test if indexes are disabled.
+
+ SYNOPSIS
+ mi_indexes_are_disabled()
+ info A pointer to the MyISAM storage engine MI_INFO struct.
+
+ DESCRIPTION
+ Test if indexes are disabled.
+
+ RETURN
+ 0 indexes are not disabled
+ 1 all indexes are disabled
+ [2 non-unique indexes are disabled - NOT YET IMPLEMENTED]
+*/
+
+int mi_indexes_are_disabled(MI_INFO *info)
+{
+ MYISAM_SHARE *share= info->s;
+
+ return (! share->state.key_map && share->base.keys);
+}
+
diff --git a/myisam/mi_range.c b/myisam/mi_range.c
index caa57ce6187..db01ada16dd 100644
--- a/myisam/mi_range.c
+++ b/myisam/mi_range.c
@@ -30,15 +30,27 @@ static uint _mi_keynr(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *page,
uchar *keypos,uint *ret_max_key);
- /* If start_key = 0 assume read from start */
- /* If end_key = 0 assume read to end */
- /* Returns HA_POS_ERROR on error */
-
-ha_rows mi_records_in_range(MI_INFO *info, int inx, const byte *start_key,
- uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key, uint end_key_len,
- enum ha_rkey_function end_search_flag)
+/*
+ Estimate how many records there is in a given range
+
+ SYNOPSIS
+ mi_records_in_range()
+ info MyISAM handler
+ inx Index to use
+ min_key Min key. Is = 0 if no min range
+ max_key Max key. Is = 0 if no max range
+
+ NOTES
+ We should ONLY return 0 if there is no rows in range
+
+ RETURN
+ HA_POS_ERROR error (or we can't estimate number of rows)
+ number Estimated number of rows
+*/
+
+
+ha_rows mi_records_in_range(MI_INFO *info, int inx, key_range *min_key,
+ key_range *max_key)
{
ha_rows start_pos,end_pos,res;
DBUG_ENTER("mi_records_in_range");
@@ -54,27 +66,31 @@ ha_rows mi_records_in_range(MI_INFO *info, int inx, const byte *start_key,
switch(info->s->keyinfo[inx].key_alg){
case HA_KEY_ALG_RTREE:
- {
- uchar * key_buff;
- if (start_key_len == 0)
- start_key_len=USE_WHOLE_KEY;
- key_buff=info->lastkey+info->s->base.max_key_length;
- start_key_len= _mi_pack_key(info,inx,key_buff,(uchar*) start_key,
- start_key_len, (HA_KEYSEG**) 0);
- res=rtree_estimate(info, inx, key_buff, start_key_len, myisam_read_vec[start_search_flag]);
- res=res?res:1;
- break;
- }
+ {
+ uchar * key_buff;
+ uint start_key_len;
+
+ key_buff= info->lastkey+info->s->base.max_key_length;
+ start_key_len= _mi_pack_key(info,inx, key_buff,
+ (uchar*) min_key->key, min_key->length,
+ (HA_KEYSEG**) 0);
+ res= rtree_estimate(info, inx, key_buff, start_key_len,
+ myisam_read_vec[min_key->flag]);
+ res= res ? res : 1; /* Don't return 0 */
+ break;
+ }
case HA_KEY_ALG_BTREE:
default:
- start_pos= (start_key ?
- _mi_record_pos(info,start_key,start_key_len,start_search_flag) :
- (ha_rows) 0);
- end_pos= (end_key ?
- _mi_record_pos(info,end_key,end_key_len,end_search_flag) :
- info->state->records+ (ha_rows) 1);
- res=end_pos < start_pos ? (ha_rows) 0 :
- (end_pos == start_pos ? (ha_rows) 1 : end_pos-start_pos);
+ start_pos= (min_key ?
+ _mi_record_pos(info, min_key->key, min_key->length,
+ min_key->flag) :
+ (ha_rows) 0);
+ end_pos= (max_key ?
+ _mi_record_pos(info, max_key->key, max_key->length,
+ max_key->flag) :
+ info->state->records+ (ha_rows) 1);
+ res= (end_pos < start_pos ? (ha_rows) 0 :
+ (end_pos == start_pos ? (ha_rows) 1 : end_pos-start_pos));
if (start_pos == HA_POS_ERROR || end_pos == HA_POS_ERROR)
res=HA_POS_ERROR;
}
diff --git a/myisam/mi_test2.c b/myisam/mi_test2.c
index d3c3cc2c492..95c8ce56a13 100644
--- a/myisam/mi_test2.c
+++ b/myisam/mi_test2.c
@@ -606,13 +606,20 @@ int main(int argc, char *argv[])
mi_status(file,&info,HA_STATUS_VARIABLE);
for (i=0 ; i < info.keys ; i++)
{
+ key_range min_key, max_key;
if (mi_rfirst(file,read_record,(int) i) ||
mi_rlast(file,read_record2,(int) i))
goto err;
copy_key(file,(uint) i,(uchar*) read_record,(uchar*) key);
copy_key(file,(uint) i,(uchar*) read_record2,(uchar*) key2);
- range_records=mi_records_in_range(file,(int) i,key,0,HA_READ_KEY_EXACT,
- key2,0,HA_READ_AFTER_KEY);
+ min_key.key= key;
+ min_key.length= USE_WHOLE_KEY;
+ min_key.flag= HA_READ_KEY_EXACT;
+ max_key.key= key2;
+ max_key.length= USE_WHOLE_KEY;
+ max_key.flag= HA_READ_AFTER_KEY;
+
+ range_records= mi_records_in_range(file,(int) i, &min_key, &max_key);
if (range_records < info.records*8/10 ||
range_records > info.records*12/10)
{
@@ -634,12 +641,19 @@ int main(int argc, char *argv[])
for (k=rnd(1000)+1 ; k>0 && key1[k] == 0 ; k--) ;
if (j != 0 && k != 0)
{
+ key_range min_key, max_key;
if (j > k)
- swap(int,j,k);
+ swap_variables(int, j, k);
sprintf(key,"%6d",j);
sprintf(key2,"%6d",k);
- range_records=mi_records_in_range(file,0,key,0,HA_READ_AFTER_KEY,
- key2,0,HA_READ_BEFORE_KEY);
+
+ min_key.key= key;
+ min_key.length= USE_WHOLE_KEY;
+ min_key.flag= HA_READ_AFTER_KEY;
+ max_key.key= key2;
+ max_key.length= USE_WHOLE_KEY;
+ max_key.flag= HA_READ_BEFORE_KEY;
+ range_records= mi_records_in_range(file, 0, &min_key, &max_key);
records=0;
for (j++ ; j < k ; j++)
records+=key1[j];
diff --git a/myisam/myisam_ftdump.c b/myisam/myisam_ftdump.c
index 075a0fd19e8..eeee96d0ff2 100644
--- a/myisam/myisam_ftdump.c
+++ b/myisam/myisam_ftdump.c
@@ -264,15 +264,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
return 0;
}
+#include <help_start.h>
static void usage()
{
printf("Use: myisam_ftdump <table_name> <index_num>\n");
my_print_help(my_long_options);
my_print_variables(my_long_options);
+ NETWARE_SET_SCREEN_MODE(1);
exit(1);
}
+#include <help_end.h>
static void complain(int val) /* Kinda assert :-) */
{
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index cb7c8ae8288..545aadebae8 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -336,10 +336,13 @@ static struct my_option my_long_options[] =
};
+#include <help_start.h>
+
static void print_version(void)
{
printf("%s Ver 2.7 for %s at %s\n", my_progname, SYSTEM_TYPE,
MACHINE_TYPE);
+ NETWARE_SET_SCREEN_MODE(1);
}
@@ -452,6 +455,7 @@ static void usage(void)
my_print_variables(my_long_options);
}
+#include <help_end.h>
/* Read options */
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h
index 72260699d1e..d092151aacc 100644
--- a/myisam/myisamdef.h
+++ b/myisam/myisamdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -684,6 +684,9 @@ uint mi_uniquedef_write(File file, MI_UNIQUEDEF *keydef);
char *mi_uniquedef_read(char *ptr, MI_UNIQUEDEF *keydef);
uint mi_recinfo_write(File file, MI_COLUMNDEF *recinfo);
char *mi_recinfo_read(char *ptr, MI_COLUMNDEF *recinfo);
+extern int mi_disable_indexes(MI_INFO *info);
+extern int mi_enable_indexes(MI_INFO *info);
+extern int mi_indexes_are_disabled(MI_INFO *info);
ulong _my_calc_total_blob_length(MI_INFO *info, const byte *record);
ha_checksum mi_checksum(MI_INFO *info, const byte *buf);
ha_checksum mi_static_checksum(MI_INFO *info, const byte *buf);
diff --git a/myisam/myisampack.c b/myisam/myisampack.c
index b6d862e38b5..de4bd80805a 100644
--- a/myisam/myisampack.c
+++ b/myisam/myisampack.c
@@ -266,12 +266,15 @@ static struct my_option my_long_options[] =
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
+#include <help_start.h>
static void print_version(void)
{
printf("%s Ver 1.22 for %s on %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
+ NETWARE_SET_SCREEN_MODE(1);
}
+
static void usage(void)
{
print_version();
@@ -290,6 +293,7 @@ static void usage(void)
my_print_variables(my_long_options);
}
+#include <help_end.h>
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
diff --git a/myisam/rt_test.c b/myisam/rt_test.c
index bbeb8fce2d1..41cc56d4d78 100644
--- a/myisam/rt_test.c
+++ b/myisam/rt_test.c
@@ -39,8 +39,7 @@ int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused)))
}
-
-int run_test(const char *filename)
+static int run_test(const char *filename)
{
MI_INFO *file;
MI_UNIQUEDEF uniquedef;
@@ -48,6 +47,7 @@ int run_test(const char *filename)
MI_COLUMNDEF recinfo[20];
MI_KEYDEF keyinfo[20];
HA_KEYSEG keyseg[20];
+ key_range range;
int silent=0;
int opt_unique=0;
@@ -66,15 +66,12 @@ int run_test(const char *filename)
int upd= 10;
ha_rows hrows;
-
-
/* Define a column for NULLs and DEL markers*/
recinfo[0].type=FIELD_NORMAL;
recinfo[0].length=1; /* For NULL bits */
rec_length=1;
-
/* Define 2*ndims columns for coordinates*/
for (i=1; i<=2*ndims ;i++){
@@ -83,7 +80,6 @@ int run_test(const char *filename)
rec_length+=key_length;
}
-
/* Define a key with 2*ndims segments */
keyinfo[0].seg=keyseg;
@@ -101,8 +97,7 @@ int run_test(const char *filename)
keyinfo[0].seg[i].language=default_charset_info->number;
}
-
- if(!silent)
+ if (!silent)
printf("- Creating isam-file\n");
bzero((char*) &create_info,sizeof(create_info));
@@ -115,15 +110,11 @@ int run_test(const char *filename)
recinfo,uniques,&uniquedef,&create_info,create_flag))
goto err;
-
-
-
- if(!silent)
+ if (!silent)
printf("- Open isam-file\n");
if (!(file=mi_open(filename,2,HA_OPEN_ABORT_IF_LOCKED)))
goto err;
-
if (!silent)
printf("- Writing key:s\n");
@@ -144,11 +135,9 @@ int run_test(const char *filename)
}
}
-
- if((error=read_with_pos(file,silent)))
+ if ((error=read_with_pos(file,silent)))
goto err;
-
if (!silent)
printf("- Reading rows with key\n");
@@ -160,12 +149,12 @@ int run_test(const char *filename)
bzero((char*) read_record,MAX_REC_LENGTH);
error=mi_rkey(file,read_record,0,record+1,0,HA_READ_MBR_EQUAL);
- if(error && error!=HA_ERR_KEY_NOT_FOUND)
+ if (error && error!=HA_ERR_KEY_NOT_FOUND)
{
printf(" mi_rkey: %3d errno: %3d\n",error,my_errno);
goto err;
}
- if(error == HA_ERR_KEY_NOT_FOUND)
+ if (error == HA_ERR_KEY_NOT_FOUND)
{
print_record(record,mi_position(file)," NOT FOUND\n");
continue;
@@ -173,10 +162,6 @@ int run_test(const char *filename)
print_record(read_record,mi_position(file),"\n");
}
-
-
-
-
if (!silent)
printf("- Deleting rows\n");
for (i=0; i < nrecords/4; i++)
@@ -184,7 +169,7 @@ int run_test(const char *filename)
my_errno=0;
bzero((char*) read_record,MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
- if(error)
+ if (error)
{
printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno);
goto err;
@@ -192,14 +177,13 @@ int run_test(const char *filename)
print_record(read_record,mi_position(file),"\n");
error=mi_delete(file,read_record);
- if(error)
+ if (error)
{
printf("pos: %2d mi_delete: %3d errno: %3d\n",i,error,my_errno);
goto err;
}
}
-
if (!silent)
printf("- Updating rows with position\n");
for (i=0; i < (nrecords - nrecords/4) ; i++)
@@ -207,9 +191,9 @@ int run_test(const char *filename)
my_errno=0;
bzero((char*) read_record,MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
- if(error)
+ if (error)
{
- if(error==HA_ERR_RECORD_DELETED)
+ if (error==HA_ERR_RECORD_DELETED)
continue;
printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno);
goto err;
@@ -219,19 +203,16 @@ int run_test(const char *filename)
printf("\t-> ");
print_record(record,mi_position(file),"\n");
error=mi_update(file,read_record,record);
- if(error)
+ if (error)
{
printf("pos: %2d mi_update: %3d errno: %3d\n",i,error,my_errno);
goto err;
}
}
-
- if((error=read_with_pos(file,silent)))
+ if ((error=read_with_pos(file,silent)))
goto err;
-
-
if (!silent)
printf("- Test mi_rkey then a sequence of mi_rnext_same\n");
@@ -246,25 +227,20 @@ int run_test(const char *filename)
print_record(read_record,mi_position(file)," mi_rkey\n");
row_count=1;
-
- do {
- if((error=mi_rnext_same(file,read_record)))
+ for (;;)
+ {
+ if ((error=mi_rnext_same(file,read_record)))
{
- if(error==HA_ERR_END_OF_FILE)
+ if (error==HA_ERR_END_OF_FILE)
break;
printf("mi_next: %3d errno: %3d\n",error,my_errno);
goto err;
}
print_record(read_record,mi_position(file)," mi_rnext_same\n");
row_count++;
- }while(1);
+ }
printf(" %d rows\n",row_count);
-
-
-
-
-
if (!silent)
printf("- Test mi_rfirst then a sequence of mi_rnext\n");
@@ -277,10 +253,11 @@ int run_test(const char *filename)
row_count=1;
print_record(read_record,mi_position(file)," mi_frirst\n");
- for(i=0;i<nrecords;i++) {
- if((error=mi_rnext(file,read_record,0)))
+ for (i=0;i<nrecords;i++)
+ {
+ if ((error=mi_rnext(file,read_record,0)))
{
- if(error==HA_ERR_END_OF_FILE)
+ if (error==HA_ERR_END_OF_FILE)
break;
printf("mi_next: %3d errno: %3d\n",error,my_errno);
goto err;
@@ -290,16 +267,18 @@ int run_test(const char *filename)
}
printf(" %d rows\n",row_count);
-
if (!silent)
printf("- Test mi_records_in_range()\n");
create_record1(record, nrecords*4/5);
print_record(record,0,"\n");
- hrows=mi_records_in_range(file,0,record+1,0,HA_READ_MBR_INTERSECT,record+1,0,0);
+
+ range.key= record+1;
+ range.length= 1000; /* Big enough */
+ range.flag= HA_READ_MBR_INTERSECT;
+ hrows= mi_records_in_range(file,0, &range, (key_range*) 0);
printf(" %ld rows\n", (long) hrows);
-
if (mi_close(file)) goto err;
my_end(MY_CHECK_ERROR);
@@ -325,11 +304,11 @@ static int read_with_pos (MI_INFO * file,int silent)
my_errno=0;
bzero((char*) read_record,MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
- if(error)
+ if (error)
{
- if(error==HA_ERR_END_OF_FILE)
+ if (error==HA_ERR_END_OF_FILE)
break;
- if(error==HA_ERR_RECORD_DELETED)
+ if (error==HA_ERR_RECORD_DELETED)
continue;
printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno);
return error;
diff --git a/myisam/sp_test.c b/myisam/sp_test.c
index 5cbf5e87579..29c5f47471a 100644
--- a/myisam/sp_test.c
+++ b/myisam/sp_test.c
@@ -32,10 +32,10 @@ static void print_key(const char *key,const char * tail);
static int run_test(const char *filename);
static int read_with_pos(MI_INFO * file, int silent);
-static int rtree_CreateLineStringWKB(double *ords, uint n_dims, uint n_points, uchar *wkb);
+static int rtree_CreateLineStringWKB(double *ords, uint n_dims, uint n_points,
+ uchar *wkb);
static void rtree_PrintWKB(uchar *wkb, uint n_dims);
-
static char blob_key[MAX_REC_LENGTH];
@@ -46,7 +46,6 @@ int main(int argc __attribute__((unused)),char *argv[])
}
-
int run_test(const char *filename)
{
MI_INFO *file;
@@ -55,7 +54,7 @@ int run_test(const char *filename)
MI_COLUMNDEF recinfo[20];
MI_KEYDEF keyinfo[20];
HA_KEYSEG keyseg[20];
-
+ key_range min_range, max_range;
int silent=0;
int create_flag=0;
int null_fields=0;
@@ -100,7 +99,7 @@ int run_test(const char *filename)
keyinfo[0].seg[0].bit_start=4; /* Long BLOB */
- if(!silent)
+ if (!silent)
printf("- Creating isam-file\n");
bzero((char*) &create_info,sizeof(create_info));
@@ -113,17 +112,12 @@ int run_test(const char *filename)
recinfo,uniques,&uniquedef,&create_info,create_flag))
goto err;
-
-
-
- if(!silent)
+ if (!silent)
printf("- Open isam-file\n");
if (!(file=mi_open(filename,2,HA_OPEN_ABORT_IF_LOCKED)))
goto err;
-
-
if (!silent)
printf("- Writing key:s\n");
@@ -143,11 +137,9 @@ int run_test(const char *filename)
}
}
-
- if((error=read_with_pos(file,silent)))
+ if ((error=read_with_pos(file,silent)))
goto err;
-
if (!silent)
printf("- Deleting rows with position\n");
for (i=0; i < nrecords/4; i++)
@@ -155,23 +147,20 @@ int run_test(const char *filename)
my_errno=0;
bzero((char*) read_record,MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
- if(error)
+ if (error)
{
printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno);
goto err;
}
print_record(read_record,mi_position(file),"\n");
error=mi_delete(file,read_record);
- if(error)
+ if (error)
{
printf("pos: %2d mi_delete: %3d errno: %3d\n",i,error,my_errno);
goto err;
}
}
-
-
-
if (!silent)
printf("- Updating rows with position\n");
for (i=0; i < nrecords/2 ; i++)
@@ -179,9 +168,9 @@ int run_test(const char *filename)
my_errno=0;
bzero((char*) read_record,MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
- if(error)
+ if (error)
{
- if(error==HA_ERR_RECORD_DELETED)
+ if (error==HA_ERR_RECORD_DELETED)
continue;
printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno);
goto err;
@@ -191,20 +180,16 @@ int run_test(const char *filename)
printf("\t-> ");
print_record(record,mi_position(file),"\n");
error=mi_update(file,read_record,record);
- if(error)
+ if (error)
{
printf("pos: %2d mi_update: %3d errno: %3d\n",i,error,my_errno);
goto err;
}
}
-
-
- if((error=read_with_pos(file,silent)))
+ if ((error=read_with_pos(file,silent)))
goto err;
-
-
if (!silent)
printf("- Test mi_rkey then a sequence of mi_rnext_same\n");
@@ -219,25 +204,20 @@ int run_test(const char *filename)
print_record(read_record,mi_position(file)," mi_rkey\n");
row_count=1;
-
- do {
- if((error=mi_rnext_same(file,read_record)))
+ for (;;)
+ {
+ if ((error=mi_rnext_same(file,read_record)))
{
- if(error==HA_ERR_END_OF_FILE)
+ if (error==HA_ERR_END_OF_FILE)
break;
printf("mi_next: %3d errno: %3d\n",error,my_errno);
goto err;
}
print_record(read_record,mi_position(file)," mi_rnext_same\n");
row_count++;
- }while(1);
+ }
printf(" %d rows\n",row_count);
-
-
-
-
-
if (!silent)
printf("- Test mi_rfirst then a sequence of mi_rnext\n");
@@ -251,9 +231,9 @@ int run_test(const char *filename)
print_record(read_record,mi_position(file)," mi_frirst\n");
for(i=0;i<nrecords;i++) {
- if((error=mi_rnext(file,read_record,0)))
+ if ((error=mi_rnext(file,read_record,0)))
{
- if(error==HA_ERR_END_OF_FILE)
+ if (error==HA_ERR_END_OF_FILE)
break;
printf("mi_next: %3d errno: %3d\n",error,my_errno);
goto err;
@@ -263,22 +243,22 @@ int run_test(const char *filename)
}
printf(" %d rows\n",row_count);
-
-
-
if (!silent)
printf("- Test mi_records_in_range()\n");
create_key(key, nrecords*upd);
print_key(key," INTERSECT\n");
- hrows=mi_records_in_range(file,0,key,0,HA_READ_MBR_INTERSECT,record+1,0,
- HA_READ_KEY_EXACT);
+ min_range.key= key;
+ min_range.length= 1000; /* Big enough */
+ min_range.flag= HA_READ_MBR_INTERSECT;
+ max_range.key= record+1;
+ max_range.length= 1000; /* Big enough */
+ max_range.flag= HA_READ_KEY_EXACT;
+ hrows= mi_records_in_range(file,0, &min_range, &max_range);
printf(" %ld rows\n", (long) hrows);
-
if (mi_close(file)) goto err;
my_end(MY_CHECK_ERROR);
-
return 0;
err:
@@ -287,7 +267,6 @@ err:
}
-
static int read_with_pos (MI_INFO * file,int silent)
{
int error;
@@ -302,11 +281,11 @@ static int read_with_pos (MI_INFO * file,int silent)
my_errno=0;
bzero((char*) read_record,MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
- if(error)
+ if (error)
{
- if(error==HA_ERR_END_OF_FILE)
+ if (error==HA_ERR_END_OF_FILE)
break;
- if(error==HA_ERR_RECORD_DELETED)
+ if (error==HA_ERR_RECORD_DELETED)
continue;
printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno);
return error;
@@ -351,7 +330,7 @@ static void print_record(char * record, my_off_t offs,const char * tail)
pos+=4;
printf(" len=%d ",len);
memcpy_fixed(&ptr,pos,sizeof(char*));
- if(ptr)
+ if (ptr)
rtree_PrintWKB((uchar*) ptr,SPDIMS);
else
printf("<NULL> ");
@@ -360,7 +339,6 @@ static void print_record(char * record, my_off_t offs,const char * tail)
}
-
#ifdef NOT_USED
static void create_point(char *record,uint rownr)
{
@@ -447,7 +425,6 @@ static void print_key(const char *key,const char * tail)
}
-
#ifdef NOT_USED
static int rtree_CreatePointWKB(double *ords, uint n_dims, uchar *wkb)
@@ -489,6 +466,7 @@ static int rtree_CreateLineStringWKB(double *ords, uint n_dims, uint n_points,
return 9 + n_points * n_dims * 8;
}
+
static void rtree_PrintWKB(uchar *wkb, uint n_dims)
{
uint wkb_type;
diff --git a/myisammrg/myrg_range.c b/myisammrg/myrg_range.c
index 7644ae40c7b..aafdf70525c 100644
--- a/myisammrg/myrg_range.c
+++ b/myisammrg/myrg_range.c
@@ -16,20 +16,15 @@
#include "myrg_def.h"
-ha_rows myrg_records_in_range(MYRG_INFO *info, int inx, const byte *start_key,
- uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key, uint end_key_len,
- enum ha_rkey_function end_search_flag)
+ha_rows myrg_records_in_range(MYRG_INFO *info, int inx,
+ key_range *min_key, key_range *max_key)
{
ha_rows records=0, res;
MYRG_TABLE *table;
for (table=info->open_tables ; table != info->end_table ; table++)
{
- res=mi_records_in_range(table->table, inx,
- start_key, start_key_len, start_search_flag,
- end_key, end_key_len, end_search_flag);
+ res= mi_records_in_range(table->table, inx, min_key, max_key);
if (res == HA_POS_ERROR)
return HA_POS_ERROR;
if (records > HA_POS_ERROR - res)
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result
index 9541fa6d355..66b24248cf9 100644
--- a/mysql-test/r/auto_increment.result
+++ b/mysql-test/r/auto_increment.result
@@ -142,7 +142,7 @@ explain extended select last_insert_id();
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 high_priority no_cache last_insert_id() AS `last_insert_id()`
+Note 1003 select sql_no_cache last_insert_id() AS `last_insert_id()`
insert into t1 set i = 254;
ERROR 23000: Duplicate entry '254' for key 1
select last_insert_id();
diff --git a/mysql-test/r/bench_count_distinct.result b/mysql-test/r/bench_count_distinct.result
index 2b4701389db..fcc0c0948b3 100644
--- a/mysql-test/r/bench_count_distinct.result
+++ b/mysql-test/r/bench_count_distinct.result
@@ -7,5 +7,5 @@ explain extended select count(distinct n) from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL n 4 NULL 200 Using index
Warnings:
-Note 1003 select high_priority count(distinct test.t1.n) AS `count(distinct n)` from test.t1
+Note 1003 select count(distinct test.t1.n) AS `count(distinct n)` from test.t1
drop table t1;
diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result
index 14b1788ddd6..1aa838140fd 100644
--- a/mysql-test/r/case.result
+++ b/mysql-test/r/case.result
@@ -27,7 +27,7 @@ explain extended select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" E
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 high_priority (case 1 when 1 then _latin1'one' when 2 then _latin1'two' else _latin1'more' end) AS `CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END`
+Note 1003 select (case 1 when 1 then _latin1'one' when 2 then _latin1'two' else _latin1'more' end) AS `CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END`
select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END;
CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END
two
@@ -66,7 +66,7 @@ explain extended select case a when 1 then 2 when 2 then 3 else 0 end as fcase,
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
Warnings:
-Note 1003 select high_priority (case test.t1.a when 1 then 2 when 2 then 3 else 0 end) AS `fcase`,count(0) AS `count(*)` from test.t1 group by (case test.t1.a when 1 then 2 when 2 then 3 else 0 end)
+Note 1003 select (case test.t1.a when 1 then 2 when 2 then 3 else 0 end) AS `fcase`,count(0) AS `count(*)` from test.t1 group by (case test.t1.a when 1 then 2 when 2 then 3 else 0 end)
select case a when 1 then "one" when 2 then "two" else "nothing" end as fcase, count(*) from t1 group by fcase;
fcase count(*)
nothing 2
@@ -141,7 +141,7 @@ COALESCE('a' COLLATE latin1_bin,'b');
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 high_priority coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,coalesce(_latin1'a') AS `COALESCE('a')`,coalesce(1,1.0) AS `COALESCE(1,1.0)`,coalesce(1,_latin1'1') AS `COALESCE(1,'1')`,coalesce(1.1,_latin1'1') AS `COALESCE(1.1,'1')`,coalesce((_latin1'a' collate _latin1'latin1_bin'),_latin1'b') AS `COALESCE('a' COLLATE latin1_bin,'b')`
+Note 1003 select coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,coalesce(_latin1'a') AS `COALESCE('a')`,coalesce(1,1.0) AS `COALESCE(1,1.0)`,coalesce(1,_latin1'1') AS `COALESCE(1,'1')`,coalesce(1.1,_latin1'1') AS `COALESCE(1.1,'1')`,coalesce((_latin1'a' collate _latin1'latin1_bin'),_latin1'b') AS `COALESCE('a' COLLATE latin1_bin,'b')`
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index cdeb5b3dc21..6564a3e392b 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -20,7 +20,7 @@ explain extended select ~5, cast(~5 as signed);
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 high_priority ~(5) AS `~5`,cast(~(5) as signed) AS `cast(~5 as signed)`
+Note 1003 select ~(5) AS `~5`,cast(~(5) as signed) AS `cast(~5 as signed)`
select cast(5 as unsigned) -6.0;
cast(5 as unsigned) -6.0
-1.0
diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result
index 8f4ddedbfcf..d4a8beda185 100644
--- a/mysql-test/r/ctype_collate.result
+++ b/mysql-test/r/ctype_collate.result
@@ -519,7 +519,7 @@ explain extended SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
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 high_priority charset(_latin1'a') AS `charset('a')`,collation(_latin1'a') AS `collation('a')`,coercibility(_latin1'a') AS `coercibility('a')`,(_latin1'a' = _latin1'A') AS `'a'='A'`
+Note 1003 select charset(_latin1'a') AS `charset('a')`,collation(_latin1'a') AS `collation('a')`,coercibility(_latin1'a') AS `coercibility('a')`,(_latin1'a' = _latin1'A') AS `'a'='A'`
SET CHARACTER SET koi8r;
SHOW VARIABLES LIKE 'collation_client';
Variable_name Value
diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result
new file mode 100644
index 00000000000..a8182438ac4
--- /dev/null
+++ b/mysql-test/r/ctype_latin1.result
@@ -0,0 +1,298 @@
+drop table if exists t1;
+SET NAMES latin1;
+CREATE TABLE t1 (a char(1) character set latin1);
+INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07);
+INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17);
+INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27);
+INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37);
+INSERT INTO t1 VALUES (0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+INSERT INTO t1 VALUES (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47);
+INSERT INTO t1 VALUES (0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+INSERT INTO t1 VALUES (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57);
+INSERT INTO t1 VALUES (0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+INSERT INTO t1 VALUES (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67);
+INSERT INTO t1 VALUES (0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+INSERT INTO t1 VALUES (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77);
+INSERT INTO t1 VALUES (0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+INSERT INTO t1 VALUES (0x80),(0x81),(0x82),(0x83),(0x84),(0x85),(0x86),(0x87);
+INSERT INTO t1 VALUES (0x88),(0x89),(0x8A),(0x8B),(0x8C),(0x8D),(0x8E),(0x8F);
+INSERT INTO t1 VALUES (0x90),(0x91),(0x92),(0x93),(0x94),(0x95),(0x96),(0x97);
+INSERT INTO t1 VALUES (0x98),(0x99),(0x9A),(0x9B),(0x9C),(0x9D),(0x9E),(0x9F);
+INSERT INTO t1 VALUES (0xA0),(0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7);
+INSERT INTO t1 VALUES (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF);
+INSERT INTO t1 VALUES (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7);
+INSERT INTO t1 VALUES (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF);
+INSERT INTO t1 VALUES (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7);
+INSERT INTO t1 VALUES (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF);
+INSERT INTO t1 VALUES (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7);
+INSERT INTO t1 VALUES (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF);
+INSERT INTO t1 VALUES (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7);
+INSERT INTO t1 VALUES (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF);
+INSERT INTO t1 VALUES (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7);
+INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF);
+SELECT
+hex(a),
+hex(@u:=convert(a using utf8)),
+hex(@l:=convert(@u using latin1)),
+a=@l FROM t1;
+hex(a) hex(@u:=convert(a using utf8)) hex(@l:=convert(@u using latin1)) a=@l
+00 00 00 1
+01 01 01 1
+02 02 02 1
+03 03 03 1
+04 04 04 1
+05 05 05 1
+06 06 06 1
+07 07 07 1
+08 08 08 1
+09 09 09 1
+0A 0A 0A 1
+0B 0B 0B 1
+0C 0C 0C 1
+0D 0D 0D 1
+0E 0E 0E 1
+0F 0F 0F 1
+10 10 10 1
+11 11 11 1
+12 12 12 1
+13 13 13 1
+14 14 14 1
+15 15 15 1
+16 16 16 1
+17 17 17 1
+18 18 18 1
+19 19 19 1
+1A 1A 1A 1
+1B 1B 1B 1
+1C 1C 1C 1
+1D 1D 1D 1
+1E 1E 1E 1
+1F 1F 1F 1
+ 1
+21 21 21 1
+22 22 22 1
+23 23 23 1
+24 24 24 1
+25 25 25 1
+26 26 26 1
+27 27 27 1
+28 28 28 1
+29 29 29 1
+2A 2A 2A 1
+2B 2B 2B 1
+2C 2C 2C 1
+2D 2D 2D 1
+2E 2E 2E 1
+2F 2F 2F 1
+30 30 30 1
+31 31 31 1
+32 32 32 1
+33 33 33 1
+34 34 34 1
+35 35 35 1
+36 36 36 1
+37 37 37 1
+38 38 38 1
+39 39 39 1
+3A 3A 3A 1
+3B 3B 3B 1
+3C 3C 3C 1
+3D 3D 3D 1
+3E 3E 3E 1
+3F 3F 3F 1
+40 40 40 1
+41 41 41 1
+42 42 42 1
+43 43 43 1
+44 44 44 1
+45 45 45 1
+46 46 46 1
+47 47 47 1
+48 48 48 1
+49 49 49 1
+4A 4A 4A 1
+4B 4B 4B 1
+4C 4C 4C 1
+4D 4D 4D 1
+4E 4E 4E 1
+4F 4F 4F 1
+50 50 50 1
+51 51 51 1
+52 52 52 1
+53 53 53 1
+54 54 54 1
+55 55 55 1
+56 56 56 1
+57 57 57 1
+58 58 58 1
+59 59 59 1
+5A 5A 5A 1
+5B 5B 5B 1
+5C 5C 5C 1
+5D 5D 5D 1
+5E 5E 5E 1
+5F 5F 5F 1
+60 60 60 1
+61 61 61 1
+62 62 62 1
+63 63 63 1
+64 64 64 1
+65 65 65 1
+66 66 66 1
+67 67 67 1
+68 68 68 1
+69 69 69 1
+6A 6A 6A 1
+6B 6B 6B 1
+6C 6C 6C 1
+6D 6D 6D 1
+6E 6E 6E 1
+6F 6F 6F 1
+70 70 70 1
+71 71 71 1
+72 72 72 1
+73 73 73 1
+74 74 74 1
+75 75 75 1
+76 76 76 1
+77 77 77 1
+78 78 78 1
+79 79 79 1
+7A 7A 7A 1
+7B 7B 7B 1
+7C 7C 7C 1
+7D 7D 7D 1
+7E 7E 7E 1
+7F 7F 7F 1
+80 E282AC 80 1
+81 3F 3F 0
+82 E2809A 82 1
+83 C692 83 1
+84 E2809E 84 1
+85 E280A6 85 1
+86 E280A0 86 1
+87 E280A1 87 1
+88 CB86 88 1
+89 E280B0 89 1
+8A C5A0 8A 1
+8B E280B9 8B 1
+8C C592 8C 1
+8D 3F 3F 0
+8E C5BD 8E 1
+8F 3F 3F 0
+90 3F 3F 0
+91 E28098 91 1
+92 E28099 92 1
+93 E2809C 93 1
+94 E2809D 94 1
+95 E280A2 95 1
+96 E28093 96 1
+97 E28094 97 1
+98 CB9C 98 1
+99 E284A2 99 1
+9A C5A1 9A 1
+9B E280BA 9B 1
+9C C593 9C 1
+9D 3F 3F 0
+9E C5BE 9E 1
+9F C5B8 9F 1
+A0 C2A0 A0 1
+A1 C2A1 A1 1
+A2 C2A2 A2 1
+A3 C2A3 A3 1
+A4 C2A4 A4 1
+A5 C2A5 A5 1
+A6 C2A6 A6 1
+A7 C2A7 A7 1
+A8 C2A8 A8 1
+A9 C2A9 A9 1
+AA C2AA AA 1
+AB C2AB AB 1
+AC C2AC AC 1
+AD C2AD AD 1
+AE C2AE AE 1
+AF C2AF AF 1
+B0 C2B0 B0 1
+B1 C2B1 B1 1
+B2 C2B2 B2 1
+B3 C2B3 B3 1
+B4 C2B4 B4 1
+B5 C2B5 B5 1
+B6 C2B6 B6 1
+B7 C2B7 B7 1
+B8 C2B8 B8 1
+B9 C2B9 B9 1
+BA C2BA BA 1
+BB C2BB BB 1
+BC C2BC BC 1
+BD C2BD BD 1
+BE C2BE BE 1
+BF C2BF BF 1
+C0 C380 C0 1
+C1 C381 C1 1
+C2 C382 C2 1
+C3 C383 C3 1
+C4 C384 C4 1
+C5 C385 C5 1
+C6 C386 C6 1
+C7 C387 C7 1
+C8 C388 C8 1
+C9 C389 C9 1
+CA C38A CA 1
+CB C38B CB 1
+CC C38C CC 1
+CD C38D CD 1
+CE C38E CE 1
+CF C38F CF 1
+D0 C390 D0 1
+D1 C391 D1 1
+D2 C392 D2 1
+D3 C393 D3 1
+D4 C394 D4 1
+D5 C395 D5 1
+D6 C396 D6 1
+D7 C397 D7 1
+D8 C398 D8 1
+D9 C399 D9 1
+DA C39A DA 1
+DB C39B DB 1
+DC C39C DC 1
+DD C39D DD 1
+DE C39E DE 1
+DF C39F DF 1
+E0 C3A0 E0 1
+E1 C3A1 E1 1
+E2 C3A2 E2 1
+E3 C3A3 E3 1
+E4 C3A4 E4 1
+E5 C3A5 E5 1
+E6 C3A6 E6 1
+E7 C3A7 E7 1
+E8 C3A8 E8 1
+E9 C3A9 E9 1
+EA C3AA EA 1
+EB C3AB EB 1
+EC C3AC EC 1
+ED C3AD ED 1
+EE C3AE EE 1
+EF C3AF EF 1
+F0 C3B0 F0 1
+F1 C3B1 F1 1
+F2 C3B2 F2 1
+F3 C3B3 F3 1
+F4 C3B4 F4 1
+F5 C3B5 F5 1
+F6 C3B6 F6 1
+F7 C3B7 F7 1
+F8 C3B8 F8 1
+F9 C3B9 F9 1
+FA C3BA FA 1
+FB C3BB FB 1
+FC C3BC FC 1
+FD C3BD FD 1
+FE C3BE FE 1
+FF C3BF FF 1
+DROP TABLE t1;
diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result
index 7209c86bb31..ed59de87395 100644
--- a/mysql-test/r/ctype_recoding.result
+++ b/mysql-test/r/ctype_recoding.result
@@ -82,6 +82,13 @@ Field Type Null Key Default Extra
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 ÔÅÓÔ;
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index fba1d9f47e3..b73953823ca 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -331,7 +331,7 @@ explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM",
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 high_priority makedate(1997,1) AS `makedate(1997,1)`,addtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,subtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,timediff(_latin1'01.01.97 11:59:59.000001 PM',_latin1'31.12.95 11:59:59.000002 PM') AS `timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM")`,cast(str_to_date(_latin1'15-01-2001 12:59:59',_latin1'%d-%m-%Y %H:%i:%S') as time) AS `cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME)`,maketime(23,11,12) AS `maketime(23,11,12)`,microsecond(_latin1'1997-12-31 23:59:59.000001') AS `microsecond("1997-12-31 23:59:59.000001")`
+Note 1003 select makedate(1997,1) AS `makedate(1997,1)`,addtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,subtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,timediff(_latin1'01.01.97 11:59:59.000001 PM',_latin1'31.12.95 11:59:59.000002 PM') AS `timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM")`,cast(str_to_date(_latin1'15-01-2001 12:59:59',_latin1'%d-%m-%Y %H:%i:%S') as time) AS `cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME)`,maketime(23,11,12) AS `maketime(23,11,12)`,microsecond(_latin1'1997-12-31 23:59:59.000001') AS `microsecond("1997-12-31 23:59:59.000001")`
create table t1 (d date);
insert into t1 values ('2004-07-14'),('2005-07-14');
select date_format(d,"%d") from t1 order by 1;
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 81e2cd03d1a..dd4c32403b5 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -94,11 +94,13 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3
2 DERIVED t1 ALL NULL NULL NULL NULL 4
3 UNION t1 ALL NULL NULL NULL NULL 4
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
explain select * from (select * from t1 union all select * from t1) a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 8
2 DERIVED t1 ALL NULL NULL NULL NULL 4
3 UNION t1 ALL NULL NULL NULL NULL 4
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
CREATE TABLE t2 (a int not null);
insert into t2 values(1);
select * from (select * from t1 where t1.a=(select a from t2 where t2.a=t1.a)) a;
@@ -246,8 +248,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 2
4 DERIVED t1 ALL NULL NULL NULL NULL 2
5 UNION t1 ALL NULL NULL NULL NULL 2
+NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL
2 DERIVED t1 ALL NULL NULL NULL NULL 2
3 UNION t1 ALL NULL NULL NULL NULL 2
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
drop table t1;
CREATE TABLE `t1` (
`N` int(11) unsigned NOT NULL default '0',
diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result
index 02e1ace71e1..d66dec741bd 100644
--- a/mysql-test/r/explain.result
+++ b/mysql-test/r/explain.result
@@ -44,3 +44,12 @@ explain select count(*) from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
drop table t1;
+set names koi8r;
+create table ÔÁÂ (ËÏÌ0 int, ËÏÌ1 int, key ÉÎÄ0 (ËÏÌ0), key ÉÎÄ01 (ËÏÌ0,ËÏÌ1));
+insert into ÔÁÂ (ËÏÌ0) values (1);
+insert into ÔÁÂ (ËÏÌ0) values (2);
+explain select ËÏÌ0 from ÔÁÂ where ËÏÌ0=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE ÔÁÂ ref ÉÎÄ0,ÉÎÄ01 ÉÎÄ0 5 const 1 Using where; Using index
+drop table ÔÁÂ;
+set names latin1;
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 02850e4d902..3106602e718 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -17,7 +17,7 @@ explain extended select * from t1 where MATCH(a,b) AGAINST ("collections");
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 fulltext a a 0 1 Using where
Warnings:
-Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'collections'))
+Note 1003 select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'collections'))
select * from t1 where MATCH(a,b) AGAINST ("indexes");
a b
Full-text indexes are called collections
@@ -78,7 +78,7 @@ explain extended select * from t1 where MATCH(a,b) AGAINST("support -collections
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 fulltext a a 0 1 Using where
Warnings:
-Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'support -collections' in boolean mode))
+Note 1003 select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'support -collections' in boolean mode))
select * from t1 where MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE);
a b
MySQL has now support for full-text search
@@ -142,6 +142,8 @@ a b
MySQL has now support for full-text search
select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE);
a b
+select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE);
+a b
select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE);
a b
select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE);
diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result
index 61aa1c0a497..ef03ec71c69 100644
--- a/mysql-test/r/func_compress.result
+++ b/mysql-test/r/func_compress.result
@@ -11,7 +11,7 @@ explain extended select uncompress(compress(@test_compress_string));
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 high_priority no_cache uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))`
+Note 1003 select sql_no_cache uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))`
select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string);
uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)
1
@@ -19,7 +19,7 @@ explain extended select uncompressed_length(compress(@test_compress_string))=len
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 high_priority no_cache (uncompressed_length(compress((@test_compress_string))) = length((@test_compress_string))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)`
+Note 1003 select sql_no_cache (uncompressed_length(compress((@test_compress_string))) = length((@test_compress_string))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)`
select uncompressed_length(compress(@test_compress_string));
uncompressed_length(compress(@test_compress_string))
117
diff --git a/mysql-test/r/func_crypt.result b/mysql-test/r/func_crypt.result
index 70ebcf216fb..2ee3e770a2e 100644
--- a/mysql-test/r/func_crypt.result
+++ b/mysql-test/r/func_crypt.result
@@ -91,4 +91,4 @@ explain extended select password('idkfa '), old_password('idkfa');
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 high_priority password(_latin1'idkfa ') AS `password('idkfa ')`,old_password(_latin1'idkfa') AS `old_password('idkfa')`
+Note 1003 select password(_latin1'idkfa ') AS `password('idkfa ')`,old_password(_latin1'idkfa') AS `old_password('idkfa')`
diff --git a/mysql-test/r/func_default.result b/mysql-test/r/func_default.result
index fe3f5b9473a..2993d79a870 100644
--- a/mysql-test/r/func_default.result
+++ b/mysql-test/r/func_default.result
@@ -8,7 +8,7 @@ explain extended select default(str), default(strnull), default(intg), default(r
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 high_priority default(test.t1.str) AS `default(str)`,default(test.t1.strnull) AS `default(strnull)`,default(test.t1.intg) AS `default(intg)`,default(test.t1.rel) AS `default(rel)` from test.t1
+Note 1003 select default(test.t1.str) AS `default(str)`,default(test.t1.strnull) AS `default(strnull)`,default(test.t1.intg) AS `default(intg)`,default(test.t1.rel) AS `default(rel)` from test.t1
select * from t1 where str <> default(str);
str strnull intg rel
0 0
diff --git a/mysql-test/r/func_encrypt.result b/mysql-test/r/func_encrypt.result
index abdfda0423f..d32e67fe7d5 100644
--- a/mysql-test/r/func_encrypt.result
+++ b/mysql-test/r/func_encrypt.result
@@ -138,4 +138,4 @@ explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_dec
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 high_priority des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))`
+Note 1003 select des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))`
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index dccd87e3d75..60a28e5018f 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -18,7 +18,7 @@ explain extended select grp,group_concat(c) from t1 group by grp;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort
Warnings:
-Note 1003 select high_priority test.t1.grp AS `grp`,group_concat(test.t1.c seperator ',') AS `group_concat(c)` from test.t1 group by test.t1.grp
+Note 1003 select test.t1.grp AS `grp`,group_concat(test.t1.c seperator ',') AS `group_concat(c)` from test.t1 group by test.t1.grp
select grp,group_concat(a,c) from t1 group by grp;
grp group_concat(a,c)
1 1a
@@ -93,7 +93,7 @@ explain extended select grp,group_concat(distinct c order by c desc) from t1 gro
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort
Warnings:
-Note 1003 select high_priority test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c desc)` from test.t1 group by test.t1.grp
+Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c desc)` from test.t1 group by test.t1.grp
select grp,group_concat(c order by c separator ",") from t1 group by grp;
grp group_concat(c order by c separator ",")
1 a
@@ -113,7 +113,7 @@ explain extended select grp,group_concat(distinct c order by c separator ",") fr
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort
Warnings:
-Note 1003 select high_priority test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c separator ",")` from test.t1 group by test.t1.grp
+Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c separator ",")` from test.t1 group by test.t1.grp
select grp,group_concat(distinct c order by c desc separator ",") from t1 group by grp;
grp group_concat(distinct c order by c desc separator ",")
1 a
@@ -301,3 +301,12 @@ a c grp
2 4 4
1 2 5
drop table t1,t2;
+CREATE TABLE t1 ( a int );
+CREATE TABLE t2 ( a int );
+INSERT INTO t1 VALUES (1), (2);
+INSERT INTO t2 VALUES (1), (2);
+SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a;
+GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a)
+1,2
+2,4
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 9fc2eada827..8033e529c56 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -265,7 +265,7 @@ explain extended select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort
Warnings:
-Note 1003 select high_priority big_result test.t1.a AS `a`,count(test.t1.b) AS `count(b)`,sum(test.t1.b) AS `sum(b)`,avg(test.t1.b) AS `avg(b)`,std(test.t1.b) AS `std(b)`,min(test.t1.b) AS `min(b)`,max(test.t1.b) AS `max(b)`,bit_and(test.t1.b) AS `bit_and(b)`,bit_or(test.t1.b) AS `bit_or(b)`,bit_xor(test.t1.b) AS `bit_xor(b)` from test.t1 group by test.t1.a
+Note 1003 select sql_big_result test.t1.a AS `a`,count(test.t1.b) AS `count(b)`,sum(test.t1.b) AS `sum(b)`,avg(test.t1.b) AS `avg(b)`,std(test.t1.b) AS `std(b)`,min(test.t1.b) AS `min(b)`,max(test.t1.b) AS `max(b)`,bit_and(test.t1.b) AS `bit_and(b)`,bit_or(test.t1.b) AS `bit_or(b)`,bit_xor(test.t1.b) AS `bit_xor(b)` from test.t1 group by test.t1.a
drop table t1;
create table t1 (col int);
insert into t1 values (-1), (-2), (-3);
diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result
index 0a04585d77d..ce26a0bf30a 100644
--- a/mysql-test/r/func_if.result
+++ b/mysql-test/r/func_if.result
@@ -43,7 +43,7 @@ explain extended select if(u=1,st,binary st) s from t1 where st like "%a%" order
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where; Using filesort
Warnings:
-Note 1003 select high_priority if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) AS `s` from test.t1 where (test.t1.st like _latin1'%a%') order by if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY'))
+Note 1003 select if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) AS `s` from test.t1 where (test.t1.st like _latin1'%a%') order by if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY'))
select nullif(u=0, 'test') from t1;
nullif(u=0, 'test')
NULL
@@ -57,7 +57,7 @@ explain extended select nullif(u=0, 'test') from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 7
Warnings:
-Note 1003 select high_priority nullif((test.t1.u = 0),_latin1'test') AS `nullif(u=0, 'test')` from test.t1
+Note 1003 select nullif((test.t1.u = 0),_latin1'test') AS `nullif(u=0, 'test')` from test.t1
drop table t1;
select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test");
NULLIF(NULL,NULL) NULLIF(NULL,1) NULLIF(NULL,1.0) NULLIF(NULL,"test")
diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result
index 04b6fc038b0..f66b3dea94b 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -146,7 +146,7 @@ explain extended select * from t1 where 'a' in (a,b,c collate latin1_bin);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
Warnings:
-Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 where (_latin1'a' in (test.t1.a,test.t1.b,(test.t1.c collate _latin1'latin1_bin')))
+Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 where (_latin1'a' in (test.t1.a,test.t1.b,(test.t1.c collate _latin1'latin1_bin')))
drop table t1;
select '1.0' in (1,2);
'1.0' in (1,2)
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index 9085849e582..12eef4aa881 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -5,7 +5,7 @@ explain extended select floor(5.5),floor(-5.5);
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 high_priority floor(5.5) AS `floor(5.5)`,floor(-(5.5)) AS `floor(-5.5)`
+Note 1003 select floor(5.5) AS `floor(5.5)`,floor(-(5.5)) AS `floor(-5.5)`
select ceiling(5.5),ceiling(-5.5);
ceiling(5.5) ceiling(-5.5)
6 -5
@@ -13,7 +13,7 @@ explain extended select ceiling(5.5),ceiling(-5.5);
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 high_priority ceiling(5.5) AS `ceiling(5.5)`,ceiling(-(5.5)) AS `ceiling(-5.5)`
+Note 1003 select ceiling(5.5) AS `ceiling(5.5)`,ceiling(-(5.5)) AS `ceiling(-5.5)`
select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2), truncate(-52.64,1),truncate(-52.64,-1);
truncate(52.64,1) truncate(52.64,2) truncate(52.64,-1) truncate(52.64,-2) truncate(-52.64,1) truncate(-52.64,-1)
52.6 52.64 50 0 -52.6 -50
@@ -21,7 +21,7 @@ explain extended select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),t
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 high_priority truncate(52.64,1) AS `truncate(52.64,1)`,truncate(52.64,2) AS `truncate(52.64,2)`,truncate(52.64,-(1)) AS `truncate(52.64,-1)`,truncate(52.64,-(2)) AS `truncate(52.64,-2)`,truncate(-(52.64),1) AS `truncate(-52.64,1)`,truncate(-(52.64),-(1)) AS `truncate(-52.64,-1)`
+Note 1003 select truncate(52.64,1) AS `truncate(52.64,1)`,truncate(52.64,2) AS `truncate(52.64,2)`,truncate(52.64,-(1)) AS `truncate(52.64,-1)`,truncate(52.64,-(2)) AS `truncate(52.64,-2)`,truncate(-(52.64),1) AS `truncate(-52.64,1)`,truncate(-(52.64),-(1)) AS `truncate(-52.64,-1)`
select round(5.5),round(-5.5);
round(5.5) round(-5.5)
6 -6
@@ -29,7 +29,7 @@ explain extended select round(5.5),round(-5.5);
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 high_priority round(5.5,0) AS `round(5.5)`,round(-(5.5),0) AS `round(-5.5)`
+Note 1003 select round(5.5,0) AS `round(5.5)`,round(-(5.5),0) AS `round(-5.5)`
select round(5.64,1),round(5.64,2),round(5.64,-1),round(5.64,-2);
round(5.64,1) round(5.64,2) round(5.64,-1) round(5.64,-2)
5.6 5.64 10 0
@@ -40,7 +40,7 @@ explain extended select abs(-10), sign(-5), sign(5), sign(0);
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 high_priority abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)`
+Note 1003 select abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)`
select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2);
log(exp(10)) exp(log(sqrt(10))*2) log(-1) log(NULL) log(1,1) log(3,9) log(-1,2) log(NULL,2)
10.000000 10.000000 NULL NULL NULL 2.000000 NULL NULL
@@ -48,7 +48,7 @@ explain extended select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(
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 high_priority log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)`
+Note 1003 select log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)`
select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
ln(exp(10)) exp(ln(sqrt(10))*2) ln(-1) ln(0) ln(NULL)
10.000000 10.000000 NULL NULL NULL
@@ -56,7 +56,7 @@ explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
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 high_priority ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)`
+Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)`
select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
log2(8) log2(15) log2(-2) log2(0) log2(NULL)
3.000000 3.906891 NULL NULL NULL
@@ -64,7 +64,7 @@ explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
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 high_priority log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)`
+Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)`
select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
log10(100) log10(18) log10(-4) log10(0) log10(NULL)
2.000000 1.255273 NULL NULL NULL
@@ -72,7 +72,7 @@ explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
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 high_priority log10(100) AS `log10(100)`,log10(18) AS `log10(18)`,log10(-(4)) AS `log10(-4)`,log10(0) AS `log10(0)`,log10(NULL) AS `log10(NULL)`
+Note 1003 select log10(100) AS `log10(100)`,log10(18) AS `log10(18)`,log10(-(4)) AS `log10(-4)`,log10(0) AS `log10(0)`,log10(NULL) AS `log10(NULL)`
select pow(10,log10(10)),power(2,4);
pow(10,log10(10)) power(2,4)
10.000000 16.000000
@@ -80,7 +80,7 @@ explain extended select pow(10,log10(10)),power(2,4);
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 high_priority pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4)`
+Note 1003 select pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4)`
set @@rand_seed1=10000000,@@rand_seed2=1000000;
select rand(999999),rand();
rand(999999) rand()
@@ -89,7 +89,7 @@ explain extended select rand(999999),rand();
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 high_priority no_cache rand(999999) AS `rand(999999)`,rand() AS `rand()`
+Note 1003 select sql_no_cache rand(999999) AS `rand(999999)`,rand() AS `rand()`
select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(1),acos(0),atan(1);
pi() sin(pi()/2) cos(pi()/2) abs(tan(pi())) cot(1) asin(1) acos(0) atan(1)
3.141593 1.000000 0.000000 0.000000 0.64209262 1.570796 1.570796 0.785398
@@ -97,7 +97,7 @@ explain extended select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(
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 high_priority pi() AS `pi()`,sin((pi() / 2)) AS `sin(pi()/2)`,cos((pi() / 2)) AS `cos(pi()/2)`,abs(tan(pi())) AS `abs(tan(pi()))`,(1 / tan(1)) AS `cot(1)`,asin(1) AS `asin(1)`,acos(0) AS `acos(0)`,atan(1) AS `atan(1)`
+Note 1003 select pi() AS `pi()`,sin((pi() / 2)) AS `sin(pi()/2)`,cos((pi() / 2)) AS `cos(pi()/2)`,abs(tan(pi())) AS `abs(tan(pi()))`,(1 / tan(1)) AS `cot(1)`,asin(1) AS `asin(1)`,acos(0) AS `acos(0)`,atan(1) AS `atan(1)`
select degrees(pi()),radians(360);
degrees(pi()) radians(360)
180 6.2831853071796
@@ -123,4 +123,4 @@ explain extended select degrees(pi()),radians(360);
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 high_priority degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)`
+Note 1003 select degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)`
diff --git a/mysql-test/r/func_op.result b/mysql-test/r/func_op.result
index fb1e715ac3b..6cd975b0911 100644
--- a/mysql-test/r/func_op.result
+++ b/mysql-test/r/func_op.result
@@ -5,7 +5,7 @@ explain extended select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-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 high_priority (1 + 1) AS `1+1`,(1 - 1) AS `1-1`,(1 + (1 * 2)) AS `1+1*2`,(8 / 5) AS `8/5`,(8 % 5) AS `8%5`,(8 % 5) AS `mod(8,5)`,((8 % 5) | 0) AS `mod(8,5)|0`,(-((1 + 1)) * -(2)) AS `-(1+1)*-2`
+Note 1003 select (1 + 1) AS `1+1`,(1 - 1) AS `1-1`,(1 + (1 * 2)) AS `1+1*2`,(8 / 5) AS `8/5`,(8 % 5) AS `8%5`,(8 % 5) AS `mod(8,5)`,((8 % 5) | 0) AS `mod(8,5)|0`,(-((1 + 1)) * -(2)) AS `-(1+1)*-2`
select 1 | (1+1),5 & 3,bit_count(7) ;
1 | (1+1) 5 & 3 bit_count(7)
3 1 3
@@ -13,7 +13,7 @@ explain extended select 1 | (1+1),5 & 3,bit_count(7) ;
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 high_priority (1 | (1 + 1)) AS `1 | (1+1)`,(5 & 3) AS `5 & 3`,bit_count(7) AS `bit_count(7)`
+Note 1003 select (1 | (1 + 1)) AS `1 | (1+1)`,(5 & 3) AS `5 & 3`,bit_count(7) AS `bit_count(7)`
select 1 << 32,1 << 63, 1 << 64, 4 >> 2, 4 >> 63, 1<< 63 >> 60;
1 << 32 1 << 63 1 << 64 4 >> 2 4 >> 63 1<< 63 >> 60
4294967296 9223372036854775808 0 1 0 8
diff --git a/mysql-test/r/func_regexp.result b/mysql-test/r/func_regexp.result
index 323642cab8c..7f977e2782b 100644
--- a/mysql-test/r/func_regexp.result
+++ b/mysql-test/r/func_regexp.result
@@ -40,7 +40,7 @@ explain extended select * from t1 where xxx regexp('is a test of some long text
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 high_priority test.t1.xxx AS `xxx` from test.t1 where (test.t1.xxx regexp _latin1'is a test of some long text to')
+Note 1003 select test.t1.xxx AS `xxx` from test.t1 where (test.t1.xxx regexp _latin1'is a test of some long text to')
select * from t1 where xxx regexp('is a test of some long text to ');
xxx
this is a test of some long text to see what happens
diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result
index b101c18f505..4918617f85f 100644
--- a/mysql-test/r/func_set.result
+++ b/mysql-test/r/func_set.result
@@ -5,7 +5,7 @@ explain extended select INTERVAL(55,10,20,30,40,50,60,70,80,90,100),interval(3,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 high_priority interval((55,10,20,30,40,50,60,70,80,90,100)) AS `INTERVAL(55,10,20,30,40,50,60,70,80,90,100)`,interval((3,1,(1 + 1),(((1 + 1) + 1) + 1))) AS `interval(3,1,1+1,1+1+1+1)`,field(_latin1'IBM',_latin1'NCA',_latin1'ICL',_latin1'SUN',_latin1'IBM',_latin1'DIGITAL') AS `field("IBM","NCA","ICL","SUN","IBM","DIGITAL")`,field(_latin1'A',_latin1'B',_latin1'C') AS `field("A","B","C")`,elt(2,_latin1'ONE',_latin1'TWO',_latin1'THREE') AS `elt(2,"ONE","TWO","THREE")`,interval((0,1,2,3,4)) AS `interval(0,1,2,3,4)`,(elt(1,1,2,3) | 0) AS `elt(1,1,2,3)|0`,(elt(1,1.1,1.2,1.3) + 0) AS `elt(1,1.1,1.2,1.3)+0`
+Note 1003 select interval((55,10,20,30,40,50,60,70,80,90,100)) AS `INTERVAL(55,10,20,30,40,50,60,70,80,90,100)`,interval((3,1,(1 + 1),(((1 + 1) + 1) + 1))) AS `interval(3,1,1+1,1+1+1+1)`,field(_latin1'IBM',_latin1'NCA',_latin1'ICL',_latin1'SUN',_latin1'IBM',_latin1'DIGITAL') AS `field("IBM","NCA","ICL","SUN","IBM","DIGITAL")`,field(_latin1'A',_latin1'B',_latin1'C') AS `field("A","B","C")`,elt(2,_latin1'ONE',_latin1'TWO',_latin1'THREE') AS `elt(2,"ONE","TWO","THREE")`,interval((0,1,2,3,4)) AS `interval(0,1,2,3,4)`,(elt(1,1,2,3) | 0) AS `elt(1,1,2,3)|0`,(elt(1,1.1,1.2,1.3) + 0) AS `elt(1,1.1,1.2,1.3)+0`
SELECT INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56);
INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56)
1
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 216e2ed26f2..569b4da0f85 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -305,6 +305,15 @@ i ELT(j, '345', '34')
1 345
2 34
DROP TABLE t1;
+create table t1(a char(4));
+insert into t1 values ('one'),(NULL),('two'),('four');
+select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1;
+a quote(a) isnull(quote(a)) quote(a) is null ifnull(quote(a), 'n')
+one 'one' 0 0 'one'
+NULL NULL 1 1 n
+two 'two' 0 0 'two'
+four 'four' 0 0 'four'
+drop table t1;
select 1=_latin1'1';
1=_latin1'1'
1
@@ -622,7 +631,7 @@ explain extended select md5('hello'), sha('abc'), sha1('abc'), soundex(''), 'moo
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 high_priority md5(_latin1'hello') AS `md5('hello')`,sha(_latin1'abc') AS `sha('abc')`,sha(_latin1'abc') AS `sha1('abc')`,soundex(_latin1'') AS `soundex('')`,(soundex(_latin1'mood') = soundex(_latin1'mud')) AS `'mood' sounds like 'mud'`,aes_decrypt(aes_encrypt(_latin1'abc',_latin1'1'),_latin1'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')`,concat(_latin1'*',repeat(_latin1' ',5),_latin1'*') AS `concat('*',space(5),'*')`,reverse(_latin1'abc') AS `reverse('abc')`,rpad(_latin1'a',4,_latin1'1') AS `rpad('a',4,'1')`,lpad(_latin1'a',4,_latin1'1') AS `lpad('a',4,'1')`,concat_ws(_latin1',',_latin1'',NULL,_latin1'a') AS `concat_ws(',','',NULL,'a')`,make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a',_latin2'b',_latin2'c')`,elt(2,1) AS `elt(2,1)`,locate(_latin1'a',_latin1'b',2) AS `locate("a","b",2)`,format(130,10) AS `format(130,10)`,char(0) AS `char(0)`,conv(130,16,10) AS `conv(130,16,10)`,hex(130) AS `hex(130)`,(_latin1'HE' collate _latin1'BINARY') AS `binary 'HE'`,export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y',_latin2'n',_latin2' ')`,field((_latin1'b' collate _latin1'latin1_bin'),_latin1'A',_latin1'B') AS `FIELD('b' COLLATE latin1_bin,'A','B')`,find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B',_latin1'a,b,c,d')`,collation(conv(130,16,10)) AS `collation(conv(130,16,10))`,coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))`,length(_latin1'\n \r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,concat(_latin1'monty',_latin1' was here ',_latin1'again') AS `concat('monty',' was here ','again')`,length(_latin1'hello') AS `length('hello')`,char(ascii(_latin1'h')) AS `char(ascii('h'))`,ord(_latin1'h') AS `ord('h')`,quote((1 / 0)) AS `quote(1/0)`,crc32(_latin1'123') AS `crc32("123")`,replace(_latin1'aaaa',_latin1'a',_latin1'b') AS `replace('aaaa','a','b')`,insert(_latin1'txs',2,1,_latin1'hi') AS `insert('txs',2,1,'hi')`,left(_latin2'a',1) AS `left(_latin2'a',1)`,right(_latin2'a',1) AS `right(_latin2'a',1)`,lcase(_latin2'a') AS `lcase(_latin2'a')`,ucase(_latin2'a') AS `ucase(_latin2'a')`,substr(_latin1'abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`,substr_index(_latin1'1abcd;2abcd;3abcd;4abcd',_latin1';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)`,trim(_latin2' a ') AS `trim(_latin2' a ')`,ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`,rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`,decode(encode(repeat(_latin1'a',100000))) AS `decode(encode(repeat("a",100000),"monty"),"monty")`
+Note 1003 select md5(_latin1'hello') AS `md5('hello')`,sha(_latin1'abc') AS `sha('abc')`,sha(_latin1'abc') AS `sha1('abc')`,soundex(_latin1'') AS `soundex('')`,(soundex(_latin1'mood') = soundex(_latin1'mud')) AS `'mood' sounds like 'mud'`,aes_decrypt(aes_encrypt(_latin1'abc',_latin1'1'),_latin1'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')`,concat(_latin1'*',repeat(_latin1' ',5),_latin1'*') AS `concat('*',space(5),'*')`,reverse(_latin1'abc') AS `reverse('abc')`,rpad(_latin1'a',4,_latin1'1') AS `rpad('a',4,'1')`,lpad(_latin1'a',4,_latin1'1') AS `lpad('a',4,'1')`,concat_ws(_latin1',',_latin1'',NULL,_latin1'a') AS `concat_ws(',','',NULL,'a')`,make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a',_latin2'b',_latin2'c')`,elt(2,1) AS `elt(2,1)`,locate(_latin1'a',_latin1'b',2) AS `locate("a","b",2)`,format(130,10) AS `format(130,10)`,char(0) AS `char(0)`,conv(130,16,10) AS `conv(130,16,10)`,hex(130) AS `hex(130)`,(_latin1'HE' collate _latin1'BINARY') AS `binary 'HE'`,export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y',_latin2'n',_latin2' ')`,field((_latin1'b' collate _latin1'latin1_bin'),_latin1'A',_latin1'B') AS `FIELD('b' COLLATE latin1_bin,'A','B')`,find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B',_latin1'a,b,c,d')`,collation(conv(130,16,10)) AS `collation(conv(130,16,10))`,coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))`,length(_latin1'\n \r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,concat(_latin1'monty',_latin1' was here ',_latin1'again') AS `concat('monty',' was here ','again')`,length(_latin1'hello') AS `length('hello')`,char(ascii(_latin1'h')) AS `char(ascii('h'))`,ord(_latin1'h') AS `ord('h')`,quote((1 / 0)) AS `quote(1/0)`,crc32(_latin1'123') AS `crc32("123")`,replace(_latin1'aaaa',_latin1'a',_latin1'b') AS `replace('aaaa','a','b')`,insert(_latin1'txs',2,1,_latin1'hi') AS `insert('txs',2,1,'hi')`,left(_latin2'a',1) AS `left(_latin2'a',1)`,right(_latin2'a',1) AS `right(_latin2'a',1)`,lcase(_latin2'a') AS `lcase(_latin2'a')`,ucase(_latin2'a') AS `ucase(_latin2'a')`,substr(_latin1'abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`,substr_index(_latin1'1abcd;2abcd;3abcd;4abcd',_latin1';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)`,trim(_latin2' a ') AS `trim(_latin2' a ')`,ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`,rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`,decode(encode(repeat(_latin1'a',100000))) AS `decode(encode(repeat("a",100000),"monty"),"monty")`
SELECT lpad(12345, 5, "#");
lpad(12345, 5, "#")
12345
diff --git a/mysql-test/r/func_system.result b/mysql-test/r/func_system.result
index 338902e3f3a..671132428c5 100644
--- a/mysql-test/r/func_system.result
+++ b/mysql-test/r/func_system.result
@@ -41,7 +41,7 @@ explain extended select database(), user();
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 high_priority no_cache database() AS `database()`,user() AS `user()`
+Note 1003 select sql_no_cache database() AS `database()`,user() AS `user()`
create table t1 (version char(40)) select database(), user(), version() as 'version';
show create table t1;
Table Create Table
diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result
index 3a945c0826f..c3fe1de15db 100644
--- a/mysql-test/r/func_test.result
+++ b/mysql-test/r/func_test.result
@@ -48,7 +48,7 @@ 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 high_priority (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`
+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
@@ -62,7 +62,7 @@ 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 high_priority (10 % 7) AS `10 % 7`,(10 % 7) AS `10 mod 7`,(10 DIV 3) AS `10 div 3`
+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
@@ -70,7 +70,7 @@ 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 high_priority ((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`
+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;
@@ -79,7 +79,7 @@ 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 high_priority test.t1.a AS `a` from test.t1 where (1 xor 1)
+Note 1003 select test.t1.a AS `a` from test.t1 where (1 xor 1)
select - a from t1;
- a
-1
@@ -87,7 +87,7 @@ 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 high_priority -(test.t1.a) AS `- a` from test.t1
+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
@@ -108,7 +108,7 @@ 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 high_priority (_koi8r'a' = (_koi8r'A' collate _latin1'koi8r_general_ci')) AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci`
+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
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 6a705f8b5cf..c0c2a29772b 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -641,7 +641,7 @@ explain extended select period_add("9602",-12),period_diff(199505,"9404"),from_d
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 high_priority no_cache period_add(_latin1'9602',-(12)) AS `period_add("9602",-12)`,period_diff(199505,_latin1'9404') AS `period_diff(199505,"9404")`,from_days(to_days(_latin1'960101')) AS `from_days(to_days("960101"))`,dayofmonth(_latin1'1997-01-02') AS `dayofmonth("1997-01-02")`,month(_latin1'1997-01-02') AS `month("1997-01-02")`,monthname(_latin1'1972-03-04') AS `monthname("1972-03-04")`,dayofyear(_latin1'0000-00-00') AS `dayofyear("0000-00-00")`,hour(_latin1'1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute(_latin1'23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week(_latin1'1998-03-03',0) AS `WEEK("1998-03-03")`,yearweek(_latin1'2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year(_latin1'98-02-03') AS `year("98-02-03")`,(weekday(to_days(curdate())) - weekday(to_days(now()))) AS `weekday(curdate())-weekday(now())`,dayname(to_days(_latin1'1962-03-03')) AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec(_latin1'0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format(_latin1'1997-01-02 03:04:05',_latin1'%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp(_latin1'1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,(_latin1'1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,(_latin1'1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from _latin1'1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)`
+Note 1003 select sql_no_cache period_add(_latin1'9602',-(12)) AS `period_add("9602",-12)`,period_diff(199505,_latin1'9404') AS `period_diff(199505,"9404")`,from_days(to_days(_latin1'960101')) AS `from_days(to_days("960101"))`,dayofmonth(_latin1'1997-01-02') AS `dayofmonth("1997-01-02")`,month(_latin1'1997-01-02') AS `month("1997-01-02")`,monthname(_latin1'1972-03-04') AS `monthname("1972-03-04")`,dayofyear(_latin1'0000-00-00') AS `dayofyear("0000-00-00")`,hour(_latin1'1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute(_latin1'23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week(_latin1'1998-03-03',0) AS `WEEK("1998-03-03")`,yearweek(_latin1'2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year(_latin1'98-02-03') AS `year("98-02-03")`,(weekday(to_days(curdate())) - weekday(to_days(now()))) AS `weekday(curdate())-weekday(now())`,dayname(to_days(_latin1'1962-03-03')) AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec(_latin1'0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format(_latin1'1997-01-02 03:04:05',_latin1'%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp(_latin1'1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,(_latin1'1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,(_latin1'1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from _latin1'1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)`
SET @TMP=NOW();
CREATE TABLE t1 (d DATETIME);
INSERT INTO t1 VALUES (NOW());
@@ -656,4 +656,4 @@ timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:
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 high_priority timestamp_diff(WEEK,_latin1'2001-02-01',_latin1'2001-05-01') AS `a1`,timestamp_diff(SECOND_FRAC,_latin1'2001-02-01 12:59:59.120000',_latin1'2001-05-01 12:58:58.119999') AS `a2`
+Note 1003 select timestamp_diff(WEEK,_latin1'2001-02-01',_latin1'2001-05-01') AS `a1`,timestamp_diff(SECOND_FRAC,_latin1'2001-02-01 12:59:59.120000',_latin1'2001-05-01 12:58:58.119999') AS `a2`
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index be33c05c578..c2fd7855c85 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -228,7 +228,7 @@ explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelo
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21
Warnings:
-Note 1003 select high_priority dimension(test.gis_geometry.g) AS `Dimension(g)`,geometrytype(test.gis_geometry.g) AS `GeometryType(g)`,isempty(test.gis_geometry.g) AS `IsEmpty(g)`,astext(envelope(test.gis_geometry.g)) AS `AsText(Envelope(g))` from test.gis_geometry
+Note 1003 select dimension(test.gis_geometry.g) AS `Dimension(g)`,geometrytype(test.gis_geometry.g) AS `GeometryType(g)`,isempty(test.gis_geometry.g) AS `IsEmpty(g)`,astext(envelope(test.gis_geometry.g)) AS `AsText(Envelope(g))` from test.gis_geometry
SELECT fid, X(g) FROM gis_point;
fid X(g)
101 10
@@ -245,7 +245,7 @@ explain extended select X(g),Y(g) FROM gis_point;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE gis_point ALL NULL NULL NULL NULL 4
Warnings:
-Note 1003 select high_priority x(test.gis_point.g) AS `X(g)`,y(test.gis_point.g) AS `Y(g)` from test.gis_point
+Note 1003 select x(test.gis_point.g) AS `X(g)`,y(test.gis_point.g) AS `Y(g)` from test.gis_point
SELECT fid, AsText(StartPoint(g)) FROM gis_line;
fid AsText(StartPoint(g))
105 POINT(0 0)
@@ -280,7 +280,7 @@ explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),Num
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE gis_line ALL NULL NULL NULL NULL 3
Warnings:
-Note 1003 select high_priority astext(startpoint(test.gis_line.g)) AS `AsText(StartPoint(g))`,astext(endpoint(test.gis_line.g)) AS `AsText(EndPoint(g))`,glength(test.gis_line.g) AS `GLength(g)`,numpoints(test.gis_line.g) AS `NumPoints(g)`,astext(pointn(test.gis_line.g,2)) AS `AsText(PointN(g, 2))`,isclosed(test.gis_line.g) AS `IsClosed(g)` from test.gis_line
+Note 1003 select astext(startpoint(test.gis_line.g)) AS `AsText(StartPoint(g))`,astext(endpoint(test.gis_line.g)) AS `AsText(EndPoint(g))`,glength(test.gis_line.g) AS `GLength(g)`,numpoints(test.gis_line.g) AS `NumPoints(g)`,astext(pointn(test.gis_line.g,2)) AS `AsText(PointN(g, 2))`,isclosed(test.gis_line.g) AS `IsClosed(g)` from test.gis_line
SELECT fid, AsText(Centroid(g)) FROM gis_polygon;
fid AsText(Centroid(g))
108 POINT(15 15)
@@ -310,7 +310,7 @@ explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumI
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3
Warnings:
-Note 1003 select high_priority astext(centroid(test.gis_polygon.g)) AS `AsText(Centroid(g))`,area(test.gis_polygon.g) AS `Area(g)`,astext(exteriorring(test.gis_polygon.g)) AS `AsText(ExteriorRing(g))`,numinteriorrings(test.gis_polygon.g) AS `NumInteriorRings(g)`,astext(interiorringn(test.gis_polygon.g,1)) AS `AsText(InteriorRingN(g, 1))` from test.gis_polygon
+Note 1003 select astext(centroid(test.gis_polygon.g)) AS `AsText(Centroid(g))`,area(test.gis_polygon.g) AS `Area(g)`,astext(exteriorring(test.gis_polygon.g)) AS `AsText(ExteriorRing(g))`,numinteriorrings(test.gis_polygon.g) AS `NumInteriorRings(g)`,astext(interiorringn(test.gis_polygon.g,1)) AS `AsText(InteriorRingN(g, 1))` from test.gis_polygon
SELECT fid, IsClosed(g) FROM gis_multi_line;
fid IsClosed(g)
114 0
@@ -349,7 +349,7 @@ explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
Warnings:
-Note 1003 select high_priority test.gis_multi_point.fid AS `fid`,numgeometries(test.gis_multi_point.g) AS `NumGeometries(g)` from test.gis_multi_point
+Note 1003 select test.gis_multi_point.fid AS `fid`,numgeometries(test.gis_multi_point.g) AS `NumGeometries(g)` from test.gis_multi_point
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
fid AsText(GeometryN(g, 2))
111 POINT(10 10)
@@ -377,7 +377,7 @@ explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
Warnings:
-Note 1003 select high_priority test.gis_multi_point.fid AS `fid`,astext(geometryn(test.gis_multi_point.g,2)) AS `AsText(GeometryN(g, 2))` from test.gis_multi_point
+Note 1003 select test.gis_multi_point.fid AS `fid`,astext(geometryn(test.gis_multi_point.g,2)) AS `AsText(GeometryN(g, 2))` from test.gis_multi_point
SELECT g1.fid as first, g2.fid as second,
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
@@ -397,7 +397,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
1 SIMPLE g2 ALL NULL NULL NULL NULL 2
Warnings:
-Note 1003 select high_priority test.g1.fid AS `first`,test.g2.fid AS `second`,within(test.g1.g,test.g2.g) AS `w`,contains(test.g1.g,test.g2.g) AS `c`,overlaps(test.g1.g,test.g2.g) AS `o`,equals(test.g1.g,test.g2.g) AS `e`,disjoint(test.g1.g,test.g2.g) AS `d`,touches(test.g1.g,test.g2.g) AS `t`,intersects(test.g1.g,test.g2.g) AS `i`,crosses(test.g1.g,test.g2.g) AS `r` from test.gis_geometrycollection g1 join test.gis_geometrycollection g2 order by test.g1.fid,test.g2.fid
+Note 1003 select test.g1.fid AS `first`,test.g2.fid AS `second`,within(test.g1.g,test.g2.g) AS `w`,contains(test.g1.g,test.g2.g) AS `c`,overlaps(test.g1.g,test.g2.g) AS `o`,equals(test.g1.g,test.g2.g) AS `e`,disjoint(test.g1.g,test.g2.g) AS `d`,touches(test.g1.g,test.g2.g) AS `t`,intersects(test.g1.g,test.g2.g) AS `i`,crosses(test.g1.g,test.g2.g) AS `r` from test.gis_geometrycollection g1 join test.gis_geometrycollection g2 order by test.g1.fid,test.g2.fid
DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
CREATE TABLE t1 (
gp point,
@@ -439,12 +439,12 @@ explain extended SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4
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 high_priority astext(geometryfromwkb(aswkb(geometryfromtext(_latin1'POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))))`
+Note 1003 select astext(geometryfromwkb(aswkb(geometryfromtext(_latin1'POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))))`
explain extended SELECT AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)'))));
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 high_priority astext(geometryfromwkb(aswkb(geometryfromtext(_latin1'POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)'))))`
+Note 1003 select astext(geometryfromwkb(aswkb(geometryfromtext(_latin1'POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)'))))`
SELECT SRID(GeomFromText('LineString(1 1,2 2)',101));
SRID(GeomFromText('LineString(1 1,2 2)',101))
101
@@ -452,12 +452,12 @@ explain extended SELECT SRID(GeomFromText('LineString(1 1,2 2)',101));
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 high_priority srid(geometryfromtext(_latin1'LineString(1 1,2 2)',101)) AS `SRID(GeomFromText('LineString(1 1,2 2)',101))`
+Note 1003 select srid(geometryfromtext(_latin1'LineString(1 1,2 2)',101)) AS `SRID(GeomFromText('LineString(1 1,2 2)',101))`
explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimple(Point(3, 6));
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 high_priority issimple(multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,issimple(point(3,6)) AS `issimple(Point(3, 6))`
+Note 1003 select issimple(multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,issimple(point(3,6)) AS `issimple(Point(3, 6))`
create table t1 (a geometry not null);
insert into t1 values (GeomFromText('Point(1 2)'));
insert into t1 values ('Garbage');
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 8b3948e093f..c47530cdc46 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -204,3 +204,27 @@ show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19'
drop user mysqltest_1@localhost;
+SET NAMES koi8r;
+CREATE DATABASE ÂÄ;
+USE ÂÄ;
+CREATE TABLE ÔÁÂ (ËÏÌ int);
+GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost;
+SHOW GRANTS FOR ÀÚÅÒ@localhost;
+Grants for ÀÚÅÒ@localhost
+GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost'
+GRANT SELECT ON `ÂÄ`.* TO 'ÀÚÅÒ'@'localhost'
+REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost;
+GRANT SELECT ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost;
+SHOW GRANTS FOR ÀÚÅÒ@localhost;
+Grants for ÀÚÅÒ@localhost
+GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost'
+GRANT SELECT ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost'
+REVOKE SELECT ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost;
+GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost;
+SHOW GRANTS FOR ÀÚÅÒ@localhost;
+Grants for ÀÚÅÒ@localhost
+GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost'
+GRANT SELECT (ËÏÌ) ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost'
+REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost;
+DROP DATABASE ÂÄ;
+SET NAMES latin1;
diff --git a/mysql-test/r/greedy_optimizer.result b/mysql-test/r/greedy_optimizer.result
index 3adc0a93cec..69d9b9af666 100644
--- a/mysql-test/r/greedy_optimizer.result
+++ b/mysql-test/r/greedy_optimizer.result
@@ -108,15 +108,15 @@ insert into t7 values (18,2,3,4,5,6);
insert into t7 values (19,2,3,4,5,6);
insert into t7 values (20,2,3,4,5,6);
insert into t7 values (21,2,3,4,5,6);
-select @@plan_search_depth;
-@@plan_search_depth
+select @@optimizer_search_depth;
+@@optimizer_search_depth
62
-select @@heuristic;
-@@heuristic
+select @@optimizer_prune_level;
+@@optimizer_prune_level
1
-set plan_search_depth=63;
-select @@plan_search_depth;
-@@plan_search_depth
+set optimizer_search_depth=63;
+select @@optimizer_search_depth;
+@@optimizer_search_depth
63
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
@@ -190,13 +190,13 @@ id select_type table type possible_keys key key_len ref rows Extra
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.838037
-set heuristic=0;
-select @@heuristic;
-@@heuristic
+set optimizer_prune_level=0;
+select @@optimizer_prune_level;
+@@optimizer_prune_level
0
-set plan_search_depth=0;
-select @@plan_search_depth;
-@@plan_search_depth
+set optimizer_search_depth=0;
+select @@optimizer_search_depth;
+@@optimizer_search_depth
0
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
@@ -270,9 +270,9 @@ id select_type table type possible_keys key key_len ref rows Extra
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 274.419727
-set plan_search_depth=1;
-select @@plan_search_depth;
-@@plan_search_depth
+set optimizer_search_depth=1;
+select @@optimizer_search_depth;
+@@optimizer_search_depth
1
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
@@ -346,9 +346,9 @@ id select_type table type possible_keys key key_len ref rows Extra
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.838037
-set plan_search_depth=62;
-select @@plan_search_depth;
-@@plan_search_depth
+set optimizer_search_depth=62;
+select @@optimizer_search_depth;
+@@optimizer_search_depth
62
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
@@ -422,13 +422,13 @@ id select_type table type possible_keys key key_len ref rows Extra
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 274.419727
-set heuristic=1;
-select @@heuristic;
-@@heuristic
+set optimizer_prune_level=1;
+select @@optimizer_prune_level;
+@@optimizer_prune_level
1
-set plan_search_depth=0;
-select @@plan_search_depth;
-@@plan_search_depth
+set optimizer_search_depth=0;
+select @@optimizer_search_depth;
+@@optimizer_search_depth
0
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
@@ -502,9 +502,9 @@ id select_type table type possible_keys key key_len ref rows Extra
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.838037
-set plan_search_depth=1;
-select @@plan_search_depth;
-@@plan_search_depth
+set optimizer_search_depth=1;
+select @@optimizer_search_depth;
+@@optimizer_search_depth
1
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
@@ -578,9 +578,9 @@ id select_type table type possible_keys key key_len ref rows Extra
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.838037
-set plan_search_depth=62;
-select @@plan_search_depth;
-@@plan_search_depth
+set optimizer_search_depth=62;
+select @@optimizer_search_depth;
+@@optimizer_search_depth
62
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index bbe3326fd34..9af7304c167 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -288,7 +288,7 @@ explain extended select sql_big_result spid,sum(userid) from t1 group by spid de
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using filesort
Warnings:
-Note 1003 select high_priority big_result test.t1.spID AS `spid`,sum(test.t1.userID) AS `sum(userid)` from test.t1 group by test.t1.spID desc
+Note 1003 select sql_big_result test.t1.spID AS `spid`,sum(test.t1.userID) AS `sum(userid)` from test.t1 group by test.t1.spID desc
explain select sql_big_result spid,sum(userid) from t1 group by spid desc order by null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using filesort
diff --git a/mysql-test/r/handler.result b/mysql-test/r/handler.result
index b25150919d6..fddad8dba51 100644
--- a/mysql-test/r/handler.result
+++ b/mysql-test/r/handler.result
@@ -193,3 +193,15 @@ Ok
handler t close;
use test;
drop table t1;
+create table t1 ( a int, b int, INDEX a (a) );
+insert into t1 values (1,2), (2,1);
+handler t1 open;
+handler t1 read a=(1) where b=2;
+a b
+1 2
+handler t1 read a=(1) where b=3;
+a b
+handler t1 read a=(1) where b=1;
+a b
+handler t1 close;
+drop table t1;
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index 7c88776579b..010e86273a2 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -12,7 +12,7 @@ explain extended select count(a) as b from t1 where a=0 having b >=0;
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 high_priority count(test.t1.a) AS `b` from test.t1 where (test.t1.a = 0) having (count(test.t1.a) >= 0)
+Note 1003 select count(test.t1.a) AS `b` from test.t1 where (test.t1.a = 0) having (count(test.t1.a) >= 0)
drop table t1;
CREATE TABLE t1 (
raw_id int(10) NOT NULL default '0',
diff --git a/mysql-test/r/index_merge.result b/mysql-test/r/index_merge.result
index 15e909c5af9..da86cc2910e 100644
--- a/mysql-test/r/index_merge.result
+++ b/mysql-test/r/index_merge.result
@@ -280,6 +280,7 @@ union select * from t1 where key1<4 or key3=5;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index_merge i1,i2 i1,i2 4,4 NULL 2 Using where
2 UNION t1 index_merge i1,i3 i1,i3 4,4 NULL 5 Using where
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
explain select * from (select * from t1 where key1 = 3 or key2 =3) as Z where key8 >5;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 1
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 3c36571a8c2..83d042cd279 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -467,7 +467,7 @@ ERROR 23000: Duplicate entry 'test2' for key 2
select * from t1;
id ggid email passwd
1 this will work
-4 test2 this will work
+3 test2 this will work
select * from t1 where id=1;
id ggid email passwd
1 this will work
@@ -1443,3 +1443,178 @@ drop table t1;
create table t1 (a int) engine=innodb;
create table t2 like t1;
drop table t1,t2;
+create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb;
+create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL default '0',
+ `id2` int(11) NOT NULL default '0',
+ UNIQUE KEY `id` (`id`,`id2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL default '0',
+ KEY `t1_id_fk` (`id`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+create index id on t2 (id);
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL default '0',
+ KEY `id` (`id`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+create index id2 on t2 (id);
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL default '0',
+ KEY `id` (`id`),
+ KEY `id2` (`id`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop index id2 on t2;
+drop index id on t2;
+Got one of the listed errors
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL default '0',
+ KEY `id` (`id`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL default '0',
+ `id2` int(11) NOT NULL default '0',
+ KEY `t1_id_fk` (`id`,`id2`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+create unique index id on t2 (id,id2);
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL default '0',
+ `id2` int(11) NOT NULL default '0',
+ UNIQUE KEY `id` (`id`,`id2`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL default '0',
+ `id2` int(11) NOT NULL default '0',
+ UNIQUE KEY `id` (`id`,`id2`),
+ KEY `t1_id_fk` (`id2`,`id`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL default '0',
+ `id2` int(11) NOT NULL default '0',
+ UNIQUE KEY `id` (`id`,`id2`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL default '0',
+ `id2` int(11) NOT NULL default '0',
+ UNIQUE KEY `id` (`id`,`id2`),
+ KEY `t1_id_fk` (`id2`,`id`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL auto_increment,
+ `id2` int(11) NOT NULL default '0',
+ PRIMARY KEY (`id`),
+ KEY `id` (`id`,`id2`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL auto_increment,
+ `id2` int(11) NOT NULL default '0',
+ KEY `t1_id_fk` (`id`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+alter table t2 add index id_test (id), add index id_test2 (id,id2);
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL auto_increment,
+ `id2` int(11) NOT NULL default '0',
+ KEY `id_test` (`id`),
+ KEY `id_test2` (`id`,`id2`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
+ERROR HY000: Can't create table './test/t2.frm' (errno: 150)
+create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) NOT NULL auto_increment,
+ `b` int(11) default NULL,
+ PRIMARY KEY (`a`),
+ UNIQUE KEY `b_2` (`b`),
+ KEY `b` (`b`),
+ CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) NOT NULL auto_increment,
+ `b` int(11) default NULL,
+ PRIMARY KEY (`a`),
+ UNIQUE KEY `b` (`b`),
+ CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`),
+ CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2, t1;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 24
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 0
+create table t1 (a int) engine=innodb;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 25
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+begin;
+delete from t1;
+commit;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 26
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+drop table t1;
diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result
index 53867bf4546..303d7186015 100644
--- a/mysql-test/r/insert_update.result
+++ b/mysql-test/r/insert_update.result
@@ -60,12 +60,12 @@ explain extended SELECT *, VALUES(a) FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
Warnings:
-Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c`,values(test.t1.a) AS `VALUES(a)` from test.t1
+Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c`,values(test.t1.a) AS `VALUES(a)` from test.t1
explain extended select * from t1 where values(a);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
-Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1
+Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1
DROP TABLE t1;
create table t1(a int primary key, b int);
insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5);
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result
index cbd949d6e72..7391f4192bf 100644
--- a/mysql-test/r/null.result
+++ b/mysql-test/r/null.result
@@ -6,7 +6,7 @@ explain extended select null,\N,isnull(null),isnull(1/0),isnull(1/0 = null),ifnu
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 high_priority NULL AS `NULL`,NULL AS `NULL`,isnull(NULL) AS `isnull(null)`,isnull((1 / 0)) AS `isnull(1/0)`,isnull(((1 / 0) = NULL)) AS `isnull(1/0 = null)`,ifnull(NULL,1) AS `ifnull(null,1)`,ifnull(NULL,_latin1'TRUE') AS `ifnull(null,"TRUE")`,ifnull(_latin1'TRUE',_latin1'ERROR') AS `ifnull("TRUE","ERROR")`,isnull((1 / 0)) AS `1/0 is null`,(1 is not null) AS `1 is not null`
+Note 1003 select NULL AS `NULL`,NULL AS `NULL`,isnull(NULL) AS `isnull(null)`,isnull((1 / 0)) AS `isnull(1/0)`,isnull(((1 / 0) = NULL)) AS `isnull(1/0 = null)`,ifnull(NULL,1) AS `ifnull(null,1)`,ifnull(NULL,_latin1'TRUE') AS `ifnull(null,"TRUE")`,ifnull(_latin1'TRUE',_latin1'ERROR') AS `ifnull("TRUE","ERROR")`,isnull((1 / 0)) AS `1/0 is null`,(1 is not null) AS `1 is not null`
select 1 | NULL,1 & NULL,1+NULL,1-NULL;
1 | NULL 1 & NULL 1+NULL 1-NULL
NULL NULL NULL NULL
@@ -32,7 +32,7 @@ explain extended select 2 between null and 1,2 between 3 AND NULL,NULL between 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 high_priority (2 between NULL and 1) AS `2 between null and 1`,(2 between 3 and NULL) AS `2 between 3 AND NULL`,(NULL between 1 and 2) AS `NULL between 1 and 2`,(2 between NULL and 3) AS `2 between NULL and 3`,(2 between 1 and NULL) AS `2 between 1 AND null`
+Note 1003 select (2 between NULL and 1) AS `2 between null and 1`,(2 between 3 and NULL) AS `2 between 3 AND NULL`,(NULL between 1 and 2) AS `NULL between 1 and 2`,(2 between NULL and 3) AS `2 between NULL and 3`,(2 between 1 and NULL) AS `2 between 1 AND null`
SELECT NULL AND NULL, 1 AND NULL, NULL AND 1, NULL OR NULL, 0 OR NULL, NULL OR 0;
NULL AND NULL 1 AND NULL NULL AND 1 NULL OR NULL 0 OR NULL NULL OR 0
NULL NULL NULL NULL NULL NULL
@@ -49,7 +49,7 @@ explain extended select inet_ntoa(null),inet_aton(null),inet_aton("122.256"),ine
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 high_priority inet_ntoa(NULL) AS `inet_ntoa(null)`,inet_aton(NULL) AS `inet_aton(null)`,inet_aton(_latin1'122.256') AS `inet_aton("122.256")`,inet_aton(_latin1'122.226.') AS `inet_aton("122.226.")`,inet_aton(_latin1'') AS `inet_aton("")`
+Note 1003 select inet_ntoa(NULL) AS `inet_ntoa(null)`,inet_aton(NULL) AS `inet_aton(null)`,inet_aton(_latin1'122.256') AS `inet_aton("122.256")`,inet_aton(_latin1'122.226.') AS `inet_aton("122.226.")`,inet_aton(_latin1'') AS `inet_aton("")`
create table t1 (x int);
insert into t1 values (null);
select * from t1 where x != 0;
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index 37e68d8b13e..50048808c39 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -85,7 +85,7 @@ explain extended select product, country_id , year, sum(profit) from t1 group by
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using temporary; Using filesort
Warnings:
-Note 1003 select high_priority test.t1.product AS `product`,test.t1.country_id AS `country_id`,test.t1.year AS `year`,sum(test.t1.profit) AS `sum(profit)` from test.t1 group by test.t1.product,test.t1.country_id,test.t1.year with rollup
+Note 1003 select test.t1.product AS `product`,test.t1.country_id AS `country_id`,test.t1.year AS `year`,sum(test.t1.profit) AS `sum(profit)` from test.t1 group by test.t1.product,test.t1.country_id,test.t1.year with rollup
select product, country_id , sum(profit) from t1 group by product desc, country_id with rollup;
product country_id sum(profit)
TV 1 400
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index 1a10c9c6ce9..694dc26bcde 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -85,6 +85,15 @@ i
1
3
drop table t1;
+create table t1 ( pk int primary key, name varchar(255) not null, number varchar(255) not null);
+insert into t1 values (1, 'Gamma', '123'), (2, 'Gamma Ext', '123a'), (3, 'Alpha', '001'), (4, 'Beta', '200c');
+select distinct t1.name as 'Building Name',t1.number as 'Building Number' from t1 order by t1.name asc;
+Building Name Building Number
+Alpha 001
+Beta 200c
+Gamma 123
+Gamma Ext 123a
+drop table t1;
create table t1 (id int not null,col1 int not null,col2 int not null,index(col1));
insert into t1 values(1,2,2),(2,2,1),(3,1,2),(4,1,1),(5,1,4),(6,2,3),(7,3,1),(8,2,4);
select * from t1 order by col1,col2;
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 0fa215f1cf5..0baebc745cc 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -305,7 +305,7 @@ explain extended select benchmark(1,1) from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
Warnings:
-Note 1003 select high_priority no_cache benchmark(1,1) AS `benchmark(1,1)` from test.t1
+Note 1003 select sql_no_cache benchmark(1,1) AS `benchmark(1,1)` from test.t1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index d1a5dd00370..290e72d3b55 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -249,18 +249,14 @@ explain select count(*) from t1 where x in (1,2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range x x 5 NULL 2 Using where; Using index
drop table t1;
-CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1), KEY i2 (key1));
+CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1));
INSERT INTO t1 VALUES (0),(0),(1),(1);
CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya));
INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2);
explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref j1 j1 4 const 1 Using where; Using index
-1 SIMPLE t1 ALL i1,i2 NULL NULL NULL 4 Range checked for each record (index map: 0x3)
-explain select * from t1 force index(i2), t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref j1 j1 4 const 1 Using where; Using index
-1 SIMPLE t1 ALL i2 NULL NULL NULL 4 Range checked for each record (index map: 0x2)
+1 SIMPLE t1 ALL i1 NULL NULL NULL 4 Range checked for each record (index map: 0x1)
DROP TABLE t1,t2;
CREATE TABLE t1 (
a int(11) default NULL,
diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result
index 37d4f1d9b26..76d6fa13766 100644
--- a/mysql-test/r/row.result
+++ b/mysql-test/r/row.result
@@ -44,7 +44,7 @@ explain extended select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,N
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 high_priority ((1,2,(3,4)) in ((3,2,(3,4)),(1,2,(3,NULL)))) AS `row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)))`
+Note 1003 select ((1,2,(3,4)) in ((3,2,(3,4)),(1,2,(3,NULL)))) AS `row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)))`
SELECT (1,2,3)=(0,NULL,3);
(1,2,3)=(0,NULL,3)
0
diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result
index b8071b16c2e..b60cad18c54 100644
--- a/mysql-test/r/rpl000001.result
+++ b/mysql-test/r/rpl000001.result
@@ -44,7 +44,7 @@ explain extended select get_lock("hold_slave",10);
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 high_priority no_cache get_lock(_latin1'hold_slave',10) AS `get_lock("hold_slave",10)`
+Note 1003 select sql_no_cache get_lock(_latin1'hold_slave',10) AS `get_lock("hold_slave",10)`
start slave;
select release_lock("hold_slave");
release_lock("hold_slave")
@@ -53,7 +53,7 @@ explain extended select release_lock("hold_slave");
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 high_priority no_cache release_lock(_latin1'hold_slave') AS `release_lock("hold_slave")`
+Note 1003 select sql_no_cache release_lock(_latin1'hold_slave') AS `release_lock("hold_slave")`
unlock tables;
create table t2(id int);
insert into t2 values(connection_id());
diff --git a/mysql-test/r/rpl_get_lock.result b/mysql-test/r/rpl_get_lock.result
index 8e3e335b2d0..2c57069e91a 100644
--- a/mysql-test/r/rpl_get_lock.result
+++ b/mysql-test/r/rpl_get_lock.result
@@ -25,7 +25,7 @@ explain extended select is_free_lock("lock"), is_used_lock("lock");
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 high_priority no_cache is_free_lock(_latin1'lock') AS `is_free_lock("lock")`,is_used_lock(_latin1'lock') AS `is_used_lock("lock")`
+Note 1003 select sql_no_cache is_free_lock(_latin1'lock') AS `is_free_lock("lock")`,is_used_lock(_latin1'lock') AS `is_used_lock("lock")`
select is_free_lock("lock2");
is_free_lock("lock2")
1
diff --git a/mysql-test/r/rpl_master_pos_wait.result b/mysql-test/r/rpl_master_pos_wait.result
index ea917805560..e92d1ffa361 100644
--- a/mysql-test/r/rpl_master_pos_wait.result
+++ b/mysql-test/r/rpl_master_pos_wait.result
@@ -11,7 +11,7 @@ explain extended select master_pos_wait('master-bin.999999',0,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 high_priority no_cache master_pos_wait(_latin1'master-bin.999999',0,2) AS `master_pos_wait('master-bin.999999',0,2)`
+Note 1003 select sql_no_cache master_pos_wait(_latin1'master-bin.999999',0,2) AS `master_pos_wait('master-bin.999999',0,2)`
select master_pos_wait('master-bin.999999',0);
stop slave sql_thread;
master_pos_wait('master-bin.999999',0)
diff --git a/mysql-test/r/rpl_relayrotate.result b/mysql-test/r/rpl_relayrotate.result
index efdfefce67a..bd6e10409b9 100644
--- a/mysql-test/r/rpl_relayrotate.result
+++ b/mysql-test/r/rpl_relayrotate.result
@@ -19,19 +19,4 @@ max(a)
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 687207 # # master-bin.000001 Yes Yes 0 0 687207 # None 0 No #
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 1
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 1
-begin;
-delete from t1;
-commit;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 2
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 1
drop table t1;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 8771e97878d..73e747386ab 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -1470,7 +1470,7 @@ explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
Warnings:
-Note 1003 select high_priority count(0) AS `count(*)`,min(test.t2.fld4) AS `min(fld4)`,max(test.t2.fld4) AS `max(fld4)`,sum(test.t2.fld1) AS `sum(fld1)`,avg(test.t2.fld1) AS `avg(fld1)`,std(test.t2.fld1) AS `std(fld1)`,variance(test.t2.fld1) AS `variance(fld1)` from test.t2 where ((test.t2.companynr = 34) and (test.t2.fld4 <> _latin1''))
+Note 1003 select count(0) AS `count(*)`,min(test.t2.fld4) AS `min(fld4)`,max(test.t2.fld4) AS `max(fld4)`,sum(test.t2.fld1) AS `sum(fld1)`,avg(test.t2.fld1) AS `avg(fld1)`,std(test.t2.fld1) AS `std(fld1)`,variance(test.t2.fld1) AS `variance(fld1)` from test.t2 where ((test.t2.companynr = 34) and (test.t2.fld4 <> _latin1''))
select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3;
companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)
00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index cd5c2aa67c1..8595f1ecebd 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -1093,6 +1093,231 @@ s1
32767
drop procedure bug2780|
drop table t3|
+drop table if exists t3|
+create table t3 (content varchar(10) )|
+insert into t3 values ("test1")|
+insert into t3 values ("test2")|
+drop table if exists t4|
+create table t4 (f1 int, rc int, t3 int)|
+create procedure bug1863(in1 int)
+begin
+declare ind int default 0;
+declare t1 int;
+declare t2 int;
+declare t3 int;
+declare rc int default 0;
+declare continue handler for 1065 set rc = 1;
+drop table if exists temp_t1;
+create temporary table temp_t1 (
+f1 int auto_increment, f2 varchar(20), primary key (f1)
+);
+insert into temp_t1 (f2) select content from t3;
+select f2 into t3 from temp_t1 where f1 = 10;
+if (rc) then
+insert into t4 values (1, rc, t3);
+end if;
+insert into t4 values (2, rc, t3);
+end|
+call bug1863(10)|
+Warnings:
+call bug1863(10)|
+Warnings:
+select * from t4|
+f1 rc t3
+2 0 NULL
+2 0 NULL
+drop procedure bug1863|
+drop table t3, t4|
+drop table if exists t3, t4|
+create table t3 (
+OrderID int not null,
+MarketID int,
+primary key (OrderID)
+)|
+create table t4 (
+MarketID int not null,
+Market varchar(60),
+Status char(1),
+primary key (MarketID)
+)|
+insert t3 (OrderID,MarketID) values (1,1)|
+insert t3 (OrderID,MarketID) values (2,2)|
+insert t4 (MarketID,Market,Status) values (1,"MarketID One","A")|
+insert t4 (MarketID,Market,Status) values (2,"MarketID Two","A")|
+create procedure bug2656_1()
+begin
+select
+m.Market
+from t4 m JOIN t3 o
+ON o.MarketID != 1 and o.MarketID = m.MarketID;
+end |
+create procedure bug2656_2()
+begin
+select
+m.Market
+from
+t4 m, t3 o
+where
+m.MarketID != 1 and m.MarketID = o.MarketID;
+end |
+call bug2656_1()|
+Market
+MarketID Two
+call bug2656_1()|
+Market
+MarketID Two
+call bug2656_2()|
+Market
+MarketID Two
+call bug2656_2()|
+Market
+MarketID Two
+drop procedure bug2656_1|
+drop procedure bug2656_2|
+drop table t3, t4|
+create procedure bug3426(in_time int unsigned, out x int)
+begin
+if in_time is null then
+set @stamped_time=10;
+set x=1;
+else
+set @stamped_time=in_time;
+set x=2;
+end if;
+end|
+call bug3426(1000, @i)|
+select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|
+@i time
+2 01-01-1970 03:16:40
+call bug3426(NULL, @i)|
+select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|
+@i time
+1 01-01-1970 03:00:10
+alter procedure bug3426 sql security invoker|
+call bug3426(NULL, @i)|
+select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|
+@i time
+1 01-01-1970 03:00:10
+call bug3426(1000, @i)|
+select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|
+@i time
+2 01-01-1970 03:16:40
+drop procedure bug3426|
+drop table if exists t3, t4|
+create table t3 (
+a int primary key,
+ach char(1)
+) engine = innodb|
+create table t4 (
+b int primary key ,
+bch char(1)
+) engine = innodb|
+insert into t3 values (1 , 'aCh1' ) , ('2' , 'aCh2')|
+Warnings:
+Warning 1265 Data truncated for column 'ach' at row 1
+Warning 1265 Data truncated for column 'ach' at row 2
+insert into t4 values (1 , 'bCh1' )|
+Warnings:
+Warning 1265 Data truncated for column 'bch' at row 1
+create procedure bug3448()
+select * from t3 inner join t4 on t3.a = t4.b|
+select * from t3 inner join t4 on t3.a = t4.b|
+a ach b bch
+1 a 1 b
+call bug3448()|
+a ach b bch
+1 a 1 b
+call bug3448()|
+a ach b bch
+1 a 1 b
+drop procedure bug3448|
+drop table t3, t4|
+drop table if exists t3|
+create table t3 (
+id int unsigned auto_increment not null primary key,
+title VARCHAR(200),
+body text,
+fulltext (title,body)
+)|
+insert into t3 (title,body) values
+('MySQL Tutorial','DBMS stands for DataBase ...'),
+('How To Use MySQL Well','After you went through a ...'),
+('Optimizing MySQL','In this tutorial we will show ...'),
+('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
+('MySQL vs. YourSQL','In the following database comparison ...'),
+('MySQL Security','When configured properly, MySQL ...')|
+create procedure bug3734 (param1 varchar(100))
+select * from t3 where match (title,body) against (param1)|
+call bug3734('database')|
+id title body
+5 MySQL vs. YourSQL In the following database comparison ...
+1 MySQL Tutorial DBMS stands for DataBase ...
+call bug3734('Security')|
+id title body
+6 MySQL Security When configured properly, MySQL ...
+drop procedure bug3734|
+drop table t3|
+create procedure bug3863()
+begin
+set @a = 0;
+while @a < 5 do
+set @a = @a + 1;
+end while;
+end|
+call bug3863()|
+select @a|
+@a
+5
+call bug3863()|
+select @a|
+@a
+5
+drop procedure bug3863|
+drop table if exists t3|
+create table t3 (
+id int(10) unsigned not null default 0,
+rid int(10) unsigned not null default 0,
+msg text not null,
+primary key (id),
+unique key rid (rid, id)
+)|
+create procedure bug2460_1(in v int)
+begin
+( select n0.id from t3 as n0 where n0.id = v )
+union
+( select n0.id from t3 as n0, t3 as n1
+where n0.id = n1.rid and n1.id = v )
+union
+( select n0.id from t3 as n0, t3 as n1, t3 as n2
+where n0.id = n1.rid and n1.id = n2.rid and n2.id = v );
+end|
+call bug2460_1(2)|
+id
+call bug2460_1(2)|
+id
+insert into t3 values (1, 1, 'foo'), (2, 1, 'bar'), (3, 1, 'zip zap')|
+call bug2460_1(2)|
+id
+2
+1
+call bug2460_1(2)|
+id
+2
+1
+create procedure bug2460_2()
+begin
+drop table if exists t3;
+create table t3 (s1 int);
+insert into t3 select 1 union select 1;
+end|
+call bug2460_2()|
+call bug2460_2()|
+select * from t3|
+s1
+1
+drop procedure bug2460_1|
+drop procedure bug2460_2|
+drop table t3|
drop table if exists fac|
create table fac (n int unsigned not null primary key, f bigint unsigned)|
create procedure ifac(n int unsigned)
@@ -1305,3 +1530,13 @@ test bar PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINE
drop procedure bar|
drop table t1;
drop table t2;
+create procedure p1 () select (select s1 from t1) from t1;
+create table t1 (s1 int);
+call p1();
+(select s1 from t1)
+insert into t1 values (1);
+call p1();
+(select s1 from t1)
+1
+drop procedure p1;
+drop table t1;
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 3e386d88932..bc1e5af0a81 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -7,7 +7,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1249 Select 2 was reduced during optimisation
-Note 1003 select high_priority 2 AS `(select 2)`
+Note 1003 select 2 AS `(select 2)`
SELECT (SELECT 1) UNION SELECT (SELECT 2);
(SELECT 1)
1
@@ -16,10 +16,11 @@ explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL
Warnings:
Note 1249 Select 2 was reduced during optimisation
Note 1249 Select 4 was reduced during optimisation
-Note 1003 select high_priority 1 AS `(SELECT 1)` union select 2 AS `(SELECT 2)`
+Note 1003 select 1 AS `(SELECT 1)` union select 2 AS `(SELECT 2)`
SELECT (SELECT (SELECT 0 UNION SELECT 0));
(SELECT (SELECT 0 UNION SELECT 0))
0
@@ -28,9 +29,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
Warnings:
Note 1249 Select 2 was reduced during optimisation
-Note 1003 select high_priority (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))`
+Note 1003 select (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))`
SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a;
ERROR 42S22: Reference 'a' not supported (forward reference in item list)
SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b;
@@ -48,7 +50,7 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1276 Field or reference 'a' of SELECT #3 was resolved in SELECT #1
Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select high_priority 1 AS `1` from (select 1 AS `a`) b having ((select b.a AS `a`) = 1)
+Note 1003 select 1 AS `1` from (select 1 AS `a`) b having ((select b.a AS `a`) = 1)
SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
1
1
@@ -182,8 +184,9 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using filesort
3 UNION t4 ALL NULL NULL NULL NULL 3 Using where; Using filesort
4 SUBQUERY t2 ALL NULL NULL NULL NULL 2
+NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 (select high_priority test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.b = (select test.t3.a AS `a` from test.t3 order by test.t3.a desc limit 1))) union (select test.t4.a AS `a`,test.t4.b AS `b` from test.t4 where (test.t4.b = (select (max(test.t2.a) * 4) AS `max(t2.a)*4` from test.t2)) order by test.t4.a)
+Note 1003 (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.b = (select test.t3.a AS `a` from test.t3 order by test.t3.a desc limit 1))) union (select test.t4.a AS `a`,test.t4.b AS `b` from test.t4 where (test.t4.b = (select (max(test.t2.a) * 4) AS `max(t2.a)*4` from test.t2)) order by test.t4.a)
select (select a from t3 where a<t2.a*4 order by 1 desc limit 1), a from t2;
(select a from t3 where a<t2.a*4 order by 1 desc limit 1) a
3 1
@@ -199,7 +202,7 @@ id select_type table type possible_keys key key_len ref rows Extra
3 DERIVED t2 ALL NULL NULL NULL NULL 2 Using where
2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using where; Using filesort
Warnings:
-Note 1003 select high_priority (select test.t3.a AS `a` from test.t3 where (test.t3.a < 8) order by test.t3.a desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,tt.a AS `a` from (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.a > 1)) tt
+Note 1003 select (select test.t3.a AS `a` from test.t3 where (test.t3.a < 8) order by test.t3.a desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,tt.a AS `a` from (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.a > 1)) tt
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1);
a
2
@@ -220,7 +223,7 @@ id select_type table type possible_keys key key_len ref rows Extra
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using where
Warnings:
Note 1276 Field or reference 't4.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select high_priority test.t4.b AS `b`,(select avg((test.t2.a + (select min(test.t3.a) AS `min(t3.a)` from test.t3 where (test.t3.a >= test.t4.a)))) AS `avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a))` from test.t2) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from test.t4
+Note 1003 select test.t4.b AS `b`,(select avg((test.t2.a + (select min(test.t3.a) AS `min(t3.a)` from test.t3 where (test.t3.a >= test.t4.a)))) AS `avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a))` from test.t2) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from test.t4
select * from t3 where exists (select * from t2 where t2.b=t3.a);
a
7
@@ -266,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 high_priority 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 (test.t3.a >= (select min(test.t2.b) from test.t2))
select * from t3 where a >= all (select b from t2);
a
7
@@ -306,10 +309,11 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2
2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1
3 DEPENDENT UNION t5 ALL NULL NULL NULL NULL 2 Using where
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 't2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 't2.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select high_priority (select test.t1.a AS `a` from test.t1 where (test.t1.a = test.t2.a) union select test.t5.a AS `a` from test.t5 where (test.t5.a = test.t2.a)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,test.t2.a AS `a` from test.t2
+Note 1003 select (select test.t1.a AS `a` from test.t1 where (test.t1.a = test.t2.a) union select test.t5.a AS `a` from test.t5 where (test.t5.a = test.t2.a)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,test.t2.a AS `a` from test.t2
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
ERROR 21000: Subquery returns more than 1 row
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
@@ -327,7 +331,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 test.t6.clinic_uq 1
Warnings:
Note 1276 Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1
-Note 1003 select high_priority test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select test.t7.uq AS `uq`,test.t7.name AS `name` from test.t7 where (test.t7.uq = test.t6.clinic_uq))
+Note 1003 select test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select test.t7.uq AS `uq`,test.t7.name AS `name` from test.t7 where (test.t7.uq = test.t6.clinic_uq))
select * from t1 where a= (select a from t2,t4 where t2.b=t4.b);
ERROR 23000: Column: 'a' in field list is ambiguous
drop table if exists t1,t2,t3;
@@ -362,7 +366,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t8 const PRIMARY PRIMARY 35 const 1
3 SUBQUERY t8 const PRIMARY PRIMARY 35 1 Using index
Warnings:
-Note 1003 select high_priority test.t8.pseudo AS `pseudo`,(select test.t8.email AS `email` from test.t8 where (test.t8.pseudo = (select test.t8.pseudo AS `pseudo` from test.t8 where (test.t8.pseudo = _latin1'joce')))) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from test.t8 where (test.t8.pseudo = (select test.t8.pseudo AS `pseudo` from test.t8 where (test.t8.pseudo = _latin1'joce')))
+Note 1003 select test.t8.pseudo AS `pseudo`,(select test.t8.email AS `email` from test.t8 where (test.t8.pseudo = (select test.t8.pseudo AS `pseudo` from test.t8 where (test.t8.pseudo = _latin1'joce')))) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from test.t8 where (test.t8.pseudo = (select test.t8.pseudo AS `pseudo` from test.t8 where (test.t8.pseudo = _latin1'joce')))
SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM
t8 WHERE pseudo='joce');
ERROR 21000: Operand should contain 1 column(s)
@@ -388,13 +392,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 41 NULL 2 Using where; Using index
Warnings:
-Note 1003 select high_priority distinct test.t1.date AS `date` from test.t1 where (test.t1.date = 20020803)
+Note 1003 select distinct test.t1.date AS `date` from test.t1 where (test.t1.date = 20020803)
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t1 index NULL PRIMARY 41 NULL 2 Using where; Using index
Warnings:
-Note 1003 select high_priority (select distinct test.t1.date AS `date` from test.t1 where (test.t1.date = 20020803)) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
+Note 1003 select (select distinct test.t1.date AS `date` from test.t1 where (test.t1.date = 20020803)) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
date
2002-08-03
@@ -413,8 +417,9 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL topic 3 NULL 2 Using index
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 select high_priority 1 AS `1` from test.t1
+Note 1003 select 1 AS `1` from test.t1
drop table t1;
CREATE TABLE `t1` (
`numeropost` mediumint(8) unsigned NOT NULL auto_increment,
@@ -534,13 +539,13 @@ EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
Warnings:
-Note 1003 select high_priority max(test.t1.numreponse) AS `MAX(numreponse)` from test.t1 where (test.t1.numeropost = _latin1'1')
+Note 1003 select max(test.t1.numreponse) AS `MAX(numreponse)` from test.t1 where (test.t1.numeropost = _latin1'1')
EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1');
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 Using index
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
Warnings:
-Note 1003 select high_priority test.t1.numreponse AS `numreponse` from test.t1 where ((test.t1.numeropost = _latin1'1') and (test.t1.numreponse = 3))
+Note 1003 select test.t1.numreponse AS `numreponse` from test.t1 where ((test.t1.numeropost = _latin1'1') and (test.t1.numreponse = 3))
drop table t1;
CREATE TABLE t1 (a int(1));
INSERT INTO t1 VALUES (1);
@@ -716,7 +721,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ref id id 5 const 1 Using where; Using index
Warnings:
Note 1249 Select 2 was reduced during optimisation
-Note 1003 select high_priority test.t2.id AS `id` from test.t2 where (test.t2.id = 1)
+Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = 1)
SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
id
1
@@ -729,14 +734,15 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1249 Select 3 was reduced during optimisation
Note 1249 Select 2 was reduced during optimisation
-Note 1003 select high_priority test.t2.id AS `id` from test.t2 where (test.t2.id = (1 + 1))
+Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = (1 + 1))
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index NULL id 5 NULL 2 Using where; Using index
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 select high_priority test.t2.id AS `id` from test.t2 where <in_optimizer>(test.t2.id,<exists>(select 1 AS `Not_used` having (<cache>(test.t2.id) = <null_helper>(1)) union select 1 AS `Not_used` having (<cache>(test.t2.id) = <null_helper>(3))))
+Note 1003 select test.t2.id AS `id` from test.t2 where <in_optimizer>(test.t2.id,<exists>(select 1 AS `Not_used` having (<cache>(test.t2.id) = <null_helper>(1)) union select 1 AS `Not_used` having (<cache>(test.t2.id) = <null_helper>(3))))
SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3);
id
SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 2);
@@ -862,7 +868,7 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1276 Field or reference 'a' of SELECT #2 was resolved in SELECT #1
Note 1249 Select 2 was reduced during optimisation
-Note 1003 select high_priority (test.t1.a + 1) AS `(select a+1)` from test.t1
+Note 1003 select (test.t1.a + 1) AS `(select a+1)` from test.t1
select (select a+1) from t1;
(select a+1)
2.5
@@ -884,7 +890,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 Using index
2 DEPENDENT SUBQUERY t2 index_subquery a a 5 func 2 Using index
Warnings:
-Note 1003 select high_priority test.t1.a AS `a`,<in_optimizer>(test.t1.a,<exists>(<index_lookup>(<cache>(test.t1.a) in t2 on a chicking NULL))) AS `t1.a in (select t2.a from t2)` from test.t1
+Note 1003 select test.t1.a AS `a`,<in_optimizer>(test.t1.a,<exists>(<index_lookup>(<cache>(test.t1.a) in t2 on a chicking NULL))) AS `t1.a in (select t2.a from t2)` from test.t1
CREATE TABLE t3 (a int(11) default '0');
INSERT INTO t3 VALUES (1),(2),(3);
SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1;
@@ -899,7 +905,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 Using where; Using index
2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using where
Warnings:
-Note 1003 select high_priority test.t1.a AS `a`,<in_optimizer>(test.t1.a,<exists>(select 1 AS `Not_used` from test.t2 join test.t3 where ((test.t3.a = test.t2.a) and ((<cache>(test.t1.a) = test.t2.a) or isnull(test.t2.a))) having <is_not_null_test>(test.t2.a))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from test.t1
+Note 1003 select test.t1.a AS `a`,<in_optimizer>(test.t1.a,<exists>(select 1 AS `Not_used` from test.t2 join test.t3 where ((test.t3.a = test.t2.a) and ((<cache>(test.t1.a) = test.t2.a) or isnull(test.t2.a))) having <is_not_null_test>(test.t2.a))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from test.t1
drop table t1,t2,t3;
create table t1 (a float);
select 10.5 IN (SELECT * from t1 LIMIT 1);
@@ -1009,19 +1015,19 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found
2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found
Warnings:
-Note 1003 select high_priority no_cache (select no_cache rand() AS `RAND()` from test.t1) AS `(SELECT RAND() FROM t1)` from test.t1
+Note 1003 select sql_no_cache (select sql_no_cache rand() AS `RAND()` from test.t1) AS `(SELECT RAND() FROM t1)` from test.t1
EXPLAIN EXTENDED SELECT (SELECT ENCRYPT('test') FROM t1) FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found
2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found
Warnings:
-Note 1003 select high_priority no_cache (select no_cache ecrypt(_latin1'test') AS `ENCRYPT('test')` from test.t1) AS `(SELECT ENCRYPT('test') FROM t1)` from test.t1
+Note 1003 select sql_no_cache (select sql_no_cache ecrypt(_latin1'test') AS `ENCRYPT('test')` from test.t1) AS `(SELECT ENCRYPT('test') FROM t1)` from test.t1
EXPLAIN EXTENDED SELECT (SELECT BENCHMARK(1,1) FROM t1) FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found
2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found
Warnings:
-Note 1003 select high_priority no_cache (select no_cache benchmark(1,1) AS `BENCHMARK(1,1)` from test.t1) AS `(SELECT BENCHMARK(1,1) FROM t1)` from test.t1
+Note 1003 select sql_no_cache (select sql_no_cache benchmark(1,1) AS `BENCHMARK(1,1)` from test.t1) AS `(SELECT BENCHMARK(1,1) FROM t1)` from test.t1
drop table t1;
CREATE TABLE `t1` (
`mot` varchar(30) character set latin1 NOT NULL default '',
@@ -1116,7 +1122,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 UNCACHEABLE SUBQUERY t1 ALL NULL NULL NULL NULL 3
3 UNCACHEABLE SUBQUERY t1 ALL NULL NULL NULL NULL 3
Warnings:
-Note 1003 select high_priority no_cache test.t1.a AS `a`,(select no_cache (select no_cache rand() AS `rand()` from test.t1 limit 1) AS `(select rand() from t1 limit 1)` from test.t1 limit 1) AS `(select (select rand() from t1 limit 1) from t1 limit 1)` from test.t1
+Note 1003 select sql_no_cache test.t1.a AS `a`,(select sql_no_cache (select sql_no_cache rand() AS `rand()` from test.t1 limit 1) AS `(select rand() from t1 limit 1)` from test.t1 limit 1) AS `(select (select rand() from t1 limit 1) from t1 limit 1)` from test.t1
drop table t1;
select t1.Continent, t2.Name, t2.Population from t1 LEFT JOIN t2 ON t1.Code = t2.Country where t2.Population IN (select max(t2.Population) AS Population from t2, t1 where t2.Country = t1.Code group by Continent);
ERROR 42S02: Table 'test.t1' doesn't exist
@@ -1170,7 +1176,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
-Note 1003 select high_priority <in_optimizer>(0,<exists>(select 1 AS `Not_used` from test.t1 a)) AS `0 IN (SELECT 1 FROM t1 a)`
+Note 1003 select <in_optimizer>(0,<exists>(select 1 AS `Not_used` from test.t1 a)) AS `0 IN (SELECT 1 FROM t1 a)`
INSERT INTO t1 (pseudo) VALUES ('test1');
SELECT 0 IN (SELECT 1 FROM t1 a);
0 IN (SELECT 1 FROM t1 a)
@@ -1180,7 +1186,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
-Note 1003 select high_priority <in_optimizer>(0,<exists>(select 1 AS `Not_used` from test.t1 a)) AS `0 IN (SELECT 1 FROM t1 a)`
+Note 1003 select <in_optimizer>(0,<exists>(select 1 AS `Not_used` from test.t1 a)) AS `0 IN (SELECT 1 FROM t1 a)`
drop table t1;
CREATE TABLE `t1` (
`i` int(11) NOT NULL default '0',
@@ -1224,7 +1230,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ref salary salary 5 const 1 Using where
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
Warnings:
-Note 1003 select high_priority test.t1.id AS `id` from test.t1 where (test.t1.salary = (select max(test.t1.salary) AS `MAX(salary)` from test.t1))
+Note 1003 select test.t1.id AS `id` from test.t1 where (test.t1.salary = (select max(test.t1.salary) AS `MAX(salary)` from test.t1))
drop table t1;
CREATE TABLE t1 (
ID int(10) unsigned NOT NULL auto_increment,
@@ -1291,7 +1297,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 Using where; Using index
2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index
Warnings:
-Note 1003 select high_priority test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<primary_index_lookup>(<cache>(test.t2.a) in t1 on PRIMARY)))
+Note 1003 select test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<primary_index_lookup>(<cache>(test.t2.a) in t1 on PRIMARY)))
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
@@ -1301,7 +1307,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 Using where; Using index
2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where
Warnings:
-Note 1003 select high_priority test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<primary_index_lookup>(<cache>(test.t2.a) in t1 on PRIMARY where (test.t1.b <> 30))))
+Note 1003 select test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<primary_index_lookup>(<cache>(test.t2.a) in t1 on PRIMARY where (test.t1.b <> 30))))
select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
a
2
@@ -1312,7 +1318,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 func 1 Using where
2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 Using where; Using index
Warnings:
-Note 1003 select high_priority test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and (<cache>(test.t2.a) = test.t1.a))))
+Note 1003 select test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and (<cache>(test.t2.a) = test.t1.a))))
drop table t1, t2, t3;
create table t1 (a int, b int, index a (a,b));
create table t2 (a int, index a (a));
@@ -1330,7 +1336,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index
Warnings:
-Note 1003 select high_priority test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<index_lookup>(<cache>(test.t2.a) in t1 on a)))
+Note 1003 select test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<index_lookup>(<cache>(test.t2.a) in t1 on a)))
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
@@ -1340,7 +1346,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index; Using where
Warnings:
-Note 1003 select high_priority test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<index_lookup>(<cache>(test.t2.a) in t1 on a where (test.t1.b <> 30))))
+Note 1003 select test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<index_lookup>(<cache>(test.t2.a) in t1 on a where (test.t1.b <> 30))))
select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
a
2
@@ -1351,7 +1357,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 Using index
2 DEPENDENT SUBQUERY t1 ref a a 10 func,test.t3.a 1000 Using where; Using index
Warnings:
-Note 1003 select high_priority test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and (<cache>(test.t2.a) = test.t1.a))))
+Note 1003 select test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and (<cache>(test.t2.a) = test.t1.a))))
insert into t1 values (3,31);
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
@@ -1367,7 +1373,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index; Using where
Warnings:
-Note 1003 select high_priority test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<index_lookup>(<cache>(test.t2.a) in t1 on a where (test.t1.b <> 30))))
+Note 1003 select test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<index_lookup>(<cache>(test.t2.a) in t1 on a where (test.t1.b <> 30))))
drop table t1, t2, t3;
create table t1 (a int, b int);
create table t2 (a int, b int);
@@ -1424,7 +1430,7 @@ explain extended (select * 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 high_priority test.t1.s1 AS `s1` from test.t1)
+Note 1003 (select test.t1.s1 AS `s1` from test.t1)
(select * from t1);
s1
tttt
@@ -1458,25 +1464,25 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL s1 6 NULL 3 Using index
2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index
Warnings:
-Note 1003 select high_priority test.t1.s1 AS `s1`,not(<in_optimizer>(test.t1.s1,<exists>(<index_lookup>(<cache>(test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from test.t1
+Note 1003 select test.t1.s1 AS `s1`,not(<in_optimizer>(test.t1.s1,<exists>(<index_lookup>(<cache>(test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from test.t1
explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL s1 6 NULL 3 Using index
2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index
Warnings:
-Note 1003 select high_priority test.t1.s1 AS `s1`,<in_optimizer>(test.t1.s1,<exists>(<index_lookup>(<cache>(test.t1.s1) in t2 on s1 chicking NULL))) AS `s1 = ANY (SELECT s1 FROM t2)` from test.t1
+Note 1003 select test.t1.s1 AS `s1`,<in_optimizer>(test.t1.s1,<exists>(<index_lookup>(<cache>(test.t1.s1) in t2 on s1 chicking NULL))) AS `s1 = ANY (SELECT s1 FROM t2)` from test.t1
explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL s1 6 NULL 3 Using index
2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index
Warnings:
-Note 1003 select high_priority test.t1.s1 AS `s1`,not(<in_optimizer>(test.t1.s1,<exists>(<index_lookup>(<cache>(test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from test.t1
+Note 1003 select test.t1.s1 AS `s1`,not(<in_optimizer>(test.t1.s1,<exists>(<index_lookup>(<cache>(test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from test.t1
explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL s1 6 NULL 3 Using index
2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 1 Using index; Using where
Warnings:
-Note 1003 select high_priority test.t1.s1 AS `s1`,not(<in_optimizer>(test.t1.s1,<exists>(<index_lookup>(<cache>(test.t1.s1) in t2 on s1 chicking NULL where (test.t2.s1 < _latin1'a2'))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from test.t1
+Note 1003 select test.t1.s1 AS `s1`,not(<in_optimizer>(test.t1.s1,<exists>(<index_lookup>(<cache>(test.t1.s1) in t2 on s1 chicking NULL where (test.t2.s1 < _latin1'a2'))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from test.t1
drop table t1,t2;
create table t2 (a int, b int);
create table t3 (a int);
@@ -1491,7 +1497,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 system NULL NULL NULL NULL 0 const row not found
Warnings:
-Note 1003 select high_priority test.t3.a AS `a` from test.t3 where <not>((test.t3.a < (select max(test.t2.b) from test.t2)))
+Note 1003 select test.t3.a AS `a` from test.t3 where <not>((test.t3.a < (select max(test.t2.b) from test.t2)))
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
@@ -1502,7 +1508,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 4 Using temporary; Using filesort
Warnings:
-Note 1003 select high_priority test.t3.a AS `a` from test.t3 where <not>((test.t3.a <= <max>(select max(test.t2.b) AS `max(b)` from test.t2 group by test.t2.a)))
+Note 1003 select test.t3.a AS `a` from test.t3 where <not>((test.t3.a <= <max>(select max(test.t2.b) AS `max(b)` from test.t2 group by test.t2.a)))
drop table t2, t3;
CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ;
INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now());
@@ -1544,11 +1550,14 @@ e
select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1);
s1
e
-explain select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1);
+explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
2 SUBQUERY t1 system NULL NULL NULL NULL 1
3 UNION t1 system NULL NULL NULL NULL 1
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 select test.t1.s1 AS `s1` from test.t1
drop table t1;
CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874');
@@ -1667,14 +1676,14 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 12 Using where
2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where
Warnings:
-Note 1003 select high_priority test.t1.id AS `id`,test.t1.text AS `text` from test.t1 where not(<in_optimizer>(test.t1.id,<exists>(<primary_index_lookup>(<cache>(test.t1.id) in t1 on PRIMARY where (test.t1.id < 8)))))
+Note 1003 select test.t1.id AS `id`,test.t1.text AS `text` from test.t1 where not(<in_optimizer>(test.t1.id,<exists>(<primary_index_lookup>(<cache>(test.t1.id) in t1 on PRIMARY where (test.t1.id < 8)))))
explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY tt ALL NULL NULL NULL NULL 12 Using where
2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 7 Using where; Using index
Warnings:
Note 1276 Field or reference 'tt.id' of SELECT #2 was resolved in SELECT #1
-Note 1003 select high_priority test.tt.id AS `id`,test.tt.text AS `text` from test.t1 tt where not(exists(select test.t1.id AS `id` from test.t1 where ((test.t1.id < 8) and ((test.t1.id = test.tt.id) or isnull(test.t1.id))) having (test.t1.id is not null)))
+Note 1003 select test.tt.id AS `id`,test.tt.text AS `text` from test.t1 tt where not(exists(select test.t1.id AS `id` from test.t1 where ((test.t1.id < 8) and ((test.t1.id = test.tt.id) or isnull(test.t1.id))) having (test.t1.id is not null)))
insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001');
create table t2 (id int not null, text varchar(20) not null default '', primary key (id));
insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10');
@@ -1700,7 +1709,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2
1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 Using where
Warnings:
-Note 1003 select high_priority test.a.id AS `id`,test.a.text AS `text`,test.b.id AS `id`,test.b.text AS `text`,test.c.id AS `id`,test.c.text AS `text` from test.t1 a left join test.t2 b on(((test.a.id = test.b.id) or isnull(test.b.id))) join test.t1 c where (if(isnull(test.b.id),1000,test.b.id) = test.c.id)
+Note 1003 select test.a.id AS `id`,test.a.text AS `text`,test.b.id AS `id`,test.b.text AS `text`,test.c.id AS `id`,test.c.text AS `text` from test.t1 a left join test.t2 b on(((test.a.id = test.b.id) or isnull(test.b.id))) join test.t1 c where (if(isnull(test.b.id),1000,test.b.id) = test.c.id)
drop table t1,t2;
create table t1 (a int);
insert into t1 values (1);
@@ -1727,3 +1736,92 @@ SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t
id c
1 1
2 0
+DROP TABLE t1,t2;
+CREATE TABLE t1 ( a int, b int );
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 );
+a
+3
+SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 );
+a
+1
+SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 );
+a
+2
+SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 );
+a
+2
+3
+SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 );
+a
+1
+2
+SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 );
+a
+1
+3
+SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 );
+a
+3
+SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 );
+a
+1
+SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 );
+a
+2
+SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 );
+a
+2
+3
+SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 );
+a
+1
+2
+SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 );
+a
+1
+3
+ALTER TABLE t1 ADD INDEX (a);
+SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 );
+a
+3
+SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 );
+a
+1
+SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 );
+a
+2
+SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 );
+a
+2
+3
+SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 );
+a
+1
+2
+SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 );
+a
+1
+3
+SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 );
+a
+3
+SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 );
+a
+1
+SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 );
+a
+2
+SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 );
+a
+2
+3
+SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 );
+a
+1
+2
+SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 );
+a
+1
+3
+DROP TABLE t1;
diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
index e9861266b78..6792f2f4c2c 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -507,7 +507,7 @@ coercibility(load_file('../../std_data/words.dat'));
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 high_priority no_cache charset(load_file(_latin1'../../std_data/words.dat')) AS `charset(load_file('../../std_data/words.dat'))`,collation(load_file(_latin1'../../std_data/words.dat')) AS `collation(load_file('../../std_data/words.dat'))`,coercibility(load_file(_latin1'../../std_data/words.dat')) AS `coercibility(load_file('../../std_data/words.dat'))`
+Note 1003 select sql_no_cache charset(load_file(_latin1'../../std_data/words.dat')) AS `charset(load_file('../../std_data/words.dat'))`,collation(load_file(_latin1'../../std_data/words.dat')) AS `collation(load_file('../../std_data/words.dat'))`,coercibility(load_file(_latin1'../../std_data/words.dat')) AS `coercibility(load_file('../../std_data/words.dat'))`
update t1 set imagem=load_file('../../std_data/words.dat') where id=1;
select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1;
if(imagem is null, "ERROR", "OK") length(imagem)
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index cc29c676283..66eb744e7ce 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -35,6 +35,12 @@ Table Op Msg_type Msg_text
test.t1 check status OK
delete from t1;
insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460");
+Warnings:
+Warning 1264 Data truncated, out of range for column 't' at row 14
+Warning 1264 Data truncated, out of range for column 't' at row 15
+Warning 1264 Data truncated, out of range for column 't' at row 16
+Warning 1264 Data truncated, out of range for column 't' at row 17
+Warning 1264 Data truncated, out of range for column 't' at row 18
select * from t1;
t
2000-01-01 00:00:00
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index a0c0e0f5503..f044ced2342 100644
--- a/mysql-test/r/type_float.result
+++ b/mysql-test/r/type_float.result
@@ -70,6 +70,21 @@ select min(a) from t1;
min(a)
-0.010
drop table t1;
+create table t1 (c1 double, c2 varchar(20));
+insert t1 values (121,"16");
+select c1 + c1 * (c2 / 100) as col from t1;
+col
+140.36
+create table t2 select c1 + c1 * (c2 / 100) as col from t1;
+select * from t2;
+col
+140.36
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `col` double default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1,t2;
create table t1 (a float);
insert into t1 values (1);
select max(a),min(a),avg(a) from t1;
@@ -105,6 +120,18 @@ select min(a) from t1;
min(a)
-0.010
drop table t1;
+create table t1 (a float(200,100), b double(200,100));
+insert t1 values (1.0, 2.0);
+select * from t1;
+a b
+1.000000000000000000000000000000 2.000000000000000000000000000000
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` float(200,30) default NULL,
+ `b` double(200,30) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
create table t1 (f float(54));
ERROR 42000: Incorrect column specifier for column 'f'
drop table if exists t1;
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 0379405eaa8..0735ea4dc40 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -86,8 +86,9 @@ explain extended (select a,b from t1 limit 2) union all (select a,b from t2 ord
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
2 UNION t2 ALL NULL NULL NULL NULL 4 Using filesort
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL Using filesort
Warnings:
-Note 1003 (select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 limit 2) union all (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 order by test.t2.a limit 1) order by b desc
+Note 1003 (select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 limit 2) union all (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 order by test.t2.a limit 1) order by b desc
(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
a b
1 a
@@ -106,21 +107,15 @@ explain select a,b from t1 union all select a,b from t2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
2 UNION t2 ALL NULL NULL NULL NULL 4
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
explain select xx from t1 union select 1;
ERROR 42S22: Unknown column 'xx' in 'field list'
explain select a,b from t1 union select 1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-2 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+ERROR 21000: The used SELECT statements have a different number of columns
explain select 1 union select a,b from t1 union select 1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
-2 UNION t1 ALL NULL NULL NULL NULL 4
-3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+ERROR 21000: The used SELECT statements have a different number of columns
explain select a,b from t1 union select 1 limit 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-2 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+ERROR 21000: The used SELECT statements have a different number of columns
select a,b from t1 into outfile 'skr' union select a,b from t2;
ERROR HY000: Wrong usage of UNION and INTO
select a,b from t1 order by a union select a,b from t2;
@@ -475,8 +470,9 @@ explain extended (select * from t1 where a=1) union (select * from t2 where a=1)
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1
2 UNION t2 const PRIMARY PRIMARY 4 const 1
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 (select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (test.t1.a = 1)) union (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.a = 1))
+Note 1003 (select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (test.t1.a = 1)) union (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.a = 1))
(select * from t1 where a=5) union (select * from t2 where a=1);
a b
1 10
@@ -497,10 +493,12 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 UNION t1 index PRIMARY PRIMARY 4 NULL 4 Using index
2 UNION t2 index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
explain (select * from t1 where a=1) union (select * from t1 where b=1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1
2 UNION t1 ref b b 5 const 1 Using where
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
drop table t1,t2;
create table t1 ( id int not null auto_increment, primary key (id) ,user_name text );
create table t2 ( id int not null auto_increment, primary key (id) ,group_name text );
@@ -950,3 +948,8 @@ a
1
drop table t1, t2;
set sql_select_limit=default;
+CREATE TABLE t1 (i int(11) default NULL,c char(1) default NULL,KEY i (i));
+CREATE TABLE t2 (i int(11) default NULL,c char(1) default NULL,KEY i (i));
+explain (select * from t1) union (select * from t2) order by not_existing_column;
+ERROR 42S22: Unknown column 'not_existing_column' in 'order clause'
+drop table t1, t2;
diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result
index cf001158ae2..26ce91286da 100644
--- a/mysql-test/r/varbinary.result
+++ b/mysql-test/r/varbinary.result
@@ -15,7 +15,7 @@ explain extended select * from t1 where UNIQ=0x38afba1d73e6a18a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const UNIQ UNIQ 8 const 1
Warnings:
-Note 1003 select high_priority test.t1.ID AS `ID`,test.t1.UNIQ AS `UNIQ` from test.t1 where (test.t1.UNIQ = 4084688022709641610)
+Note 1003 select test.t1.ID AS `ID`,test.t1.UNIQ AS `UNIQ` from test.t1 where (test.t1.UNIQ = 4084688022709641610)
drop table t1;
select x'hello';
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 'x'hello'' at line 1
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 67c1d5b3e33..57fe2577b03 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -48,7 +48,7 @@ explain extended select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3;
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 high_priority no_cache (@t1:=((@t2:=1) + (@t3:=4))) AS `@t1:=(@t2:=1)+@t3:=4`,(@t1) AS `@t1`,(@t2) AS `@t2`,(@t3) AS `@t3`
+Note 1003 select sql_no_cache (@t1:=((@t2:=1) + (@t3:=4))) AS `@t1:=(@t2:=1)+@t3:=4`,(@t1) AS `@t1`,(@t2) AS `@t2`,(@t3) AS `@t3`
select @t5;
@t5
1.23456
@@ -107,7 +107,7 @@ explain extended select last_insert_id(345);
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 high_priority no_cache last_insert_id(345) AS `last_insert_id(345)`
+Note 1003 select sql_no_cache last_insert_id(345) AS `last_insert_id(345)`
select @@IDENTITY,last_insert_id(), @@identity;
@@IDENTITY last_insert_id() @@identity
345 345 345
@@ -115,7 +115,7 @@ explain extended select @@IDENTITY,last_insert_id(), @@identity;
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 high_priority no_cache 345 AS `@@IDENTITY`,last_insert_id() AS `last_insert_id()`,345 AS `@@identity`
+Note 1003 select sql_no_cache 345 AS `@@IDENTITY`,last_insert_id() AS `last_insert_id()`,345 AS `@@identity`
set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON";
set global concurrent_insert=ON;
show variables like 'concurrent_insert';
@@ -421,6 +421,11 @@ set ft_boolean_syntax = @@init_connect;
ERROR HY000: Variable 'ft_boolean_syntax' is a GLOBAL variable and should be set with SET GLOBAL
set global ft_boolean_syntax = @@init_connect;
ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of ''
+set global myisam_max_sort_file_size=4294967296;
+show global variables like 'myisam_max_sort_file_size';
+Variable_name Value
+myisam_max_sort_file_size 4294967296
+set global myisam_max_sort_file_size=default;
select @@global.max_user_connections,@@local.max_join_size;
@@global.max_user_connections @@session.max_join_size
100 200
diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test
new file mode 100644
index 00000000000..14062437428
--- /dev/null
+++ b/mysql-test/t/ctype_latin1.test
@@ -0,0 +1,55 @@
+#
+# Tests with the latin1 character set
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# WL 1494: Treat latin1 as cp1252 for unicode conversion
+#
+
+SET NAMES latin1;
+CREATE TABLE t1 (a char(1) character set latin1);
+INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07);
+INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17);
+INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27);
+INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37);
+INSERT INTO t1 VALUES (0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+INSERT INTO t1 VALUES (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47);
+INSERT INTO t1 VALUES (0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+INSERT INTO t1 VALUES (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57);
+INSERT INTO t1 VALUES (0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+INSERT INTO t1 VALUES (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67);
+INSERT INTO t1 VALUES (0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+INSERT INTO t1 VALUES (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77);
+INSERT INTO t1 VALUES (0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+INSERT INTO t1 VALUES (0x80),(0x81),(0x82),(0x83),(0x84),(0x85),(0x86),(0x87);
+INSERT INTO t1 VALUES (0x88),(0x89),(0x8A),(0x8B),(0x8C),(0x8D),(0x8E),(0x8F);
+INSERT INTO t1 VALUES (0x90),(0x91),(0x92),(0x93),(0x94),(0x95),(0x96),(0x97);
+INSERT INTO t1 VALUES (0x98),(0x99),(0x9A),(0x9B),(0x9C),(0x9D),(0x9E),(0x9F);
+INSERT INTO t1 VALUES (0xA0),(0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7);
+INSERT INTO t1 VALUES (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF);
+INSERT INTO t1 VALUES (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7);
+INSERT INTO t1 VALUES (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF);
+INSERT INTO t1 VALUES (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7);
+INSERT INTO t1 VALUES (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF);
+INSERT INTO t1 VALUES (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7);
+INSERT INTO t1 VALUES (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF);
+INSERT INTO t1 VALUES (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7);
+INSERT INTO t1 VALUES (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF);
+INSERT INTO t1 VALUES (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7);
+INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF);
+
+#
+# 0x81 0x8D 0x8F 0x90 0x9D are undefined in cp1252
+#
+SELECT
+ hex(a),
+ hex(@u:=convert(a using utf8)),
+ hex(@l:=convert(@u using latin1)),
+ a=@l FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test
index 40349da8aa9..8ac22e89c2d 100644
--- a/mysql-test/t/ctype_recoding.test
+++ b/mysql-test/t/ctype_recoding.test
@@ -56,6 +56,13 @@ SET CHARACTER SET koi8r;
DROP TABLE ÔÁÂÌÉÃÁ;
SET CHARACTER SET default;
+# Test for Item_func_conv_charset::fix_fields (bug #3704)
+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;
+DROP TABLE t1;
+
SET CHARACTER SET koi8r;
CREATE DATABASE ÔÅÓÔ;
USE ÔÅÓÔ;
@@ -71,4 +78,3 @@ SET NAMES koi8r;
SELECT hex('ÔÅÓÔ');
SET character_set_connection=cp1251;
SELECT hex('ÔÅÓÔ');
-
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test
index ff1803368b9..050939e5ad2 100644
--- a/mysql-test/t/explain.test
+++ b/mysql-test/t/explain.test
@@ -30,3 +30,14 @@ explain select count(*) from t1;
insert into t1 values(1);
explain select count(*) from t1;
drop table t1;
+
+#
+# Bug #3403 Wrong encoding in EXPLAIN SELECT output
+#
+set names koi8r;
+create table ÔÁÂ (ËÏÌ0 int, ËÏÌ1 int, key ÉÎÄ0 (ËÏÌ0), key ÉÎÄ01 (ËÏÌ0,ËÏÌ1));
+insert into ÔÁÂ (ËÏÌ0) values (1);
+insert into ÔÁÂ (ËÏÌ0) values (2);
+explain select ËÏÌ0 from ÔÁÂ where ËÏÌ0=1;
+drop table ÔÁÂ;
+set names latin1;
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 50a3d522e3d..ac88125965a 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -63,6 +63,7 @@ select * from t1 where MATCH a,b AGAINST ('"text search" "now support"' IN BOOL
select * from t1 where MATCH a,b AGAINST ('"text search" -"now support"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"text search" +"now support"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE);
+select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE);
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 9d99a57afe5..aede2220466 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -179,3 +179,13 @@ select group_concat(c order by (select mid(group_concat(c order by a),1,5) from
select a,c,(select group_concat(c order by a) from t2 where a=t1.a) as grp from t1 order by grp;
drop table t1,t2;
+
+#
+# group_concat of expression with GROUP BY and external GROUP BY
+#
+CREATE TABLE t1 ( a int );
+CREATE TABLE t2 ( a int );
+INSERT INTO t1 VALUES (1), (2);
+INSERT INTO t2 VALUES (1), (2);
+SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a;
+DROP TABLE t1, t2;
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index c4413c3ef3f..c138b848491 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -173,6 +173,15 @@ SELECT DISTINCT i, ELT(j, '345', '34') FROM t1;
DROP TABLE t1;
#
+# bug #3756: quote and NULL
+#
+
+create table t1(a char(4));
+insert into t1 values ('one'),(NULL),('two'),('four');
+select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1;
+drop table t1;
+
+#
# Test collation and coercibility
#
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 832541b0f86..6bd2fa0c703 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -148,3 +148,26 @@ grant usage on *.* to mysqltest_1@localhost identified by "password";
grant select, update, insert on test.* to mysqltest@localhost;
show grants for mysqltest_1@localhost;
drop user mysqltest_1@localhost;
+
+#
+# Bug #3403 Wrong encodin in SHOW GRANTS output
+#
+SET NAMES koi8r;
+CREATE DATABASE ÂÄ;
+USE ÂÄ;
+CREATE TABLE ÔÁÂ (ËÏÌ int);
+
+GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost;
+SHOW GRANTS FOR ÀÚÅÒ@localhost;
+REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost;
+
+GRANT SELECT ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost;
+SHOW GRANTS FOR ÀÚÅÒ@localhost;
+REVOKE SELECT ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost;
+
+GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost;
+SHOW GRANTS FOR ÀÚÅÒ@localhost;
+REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost;
+
+DROP DATABASE ÂÄ;
+SET NAMES latin1;
diff --git a/mysql-test/t/greedy_optimizer.test b/mysql-test/t/greedy_optimizer.test
index f488286461b..e547d85b7f3 100644
--- a/mysql-test/t/greedy_optimizer.test
+++ b/mysql-test/t/greedy_optimizer.test
@@ -137,21 +137,21 @@ insert into t7 values (21,2,3,4,5,6);
# Check the default values for the optimizer paramters
-select @@plan_search_depth;
-select @@heuristic;
+select @@optimizer_search_depth;
+select @@optimizer_prune_level;
-- This value swithes back to the old implementation of 'find_best()'
--- set plan_search_depth=63; - old (independent of the heuristic)
+-- set optimizer_search_depth=63; - old (independent of the optimizer_prune_level)
--
-- These are the values for the parameters that control the greedy optimizer
--- (total 6 combinations - 3 for plan_search_depth, 2 for heuristic):
+-- (total 6 combinations - 3 for optimizer_search_depth, 2 for optimizer_prune_level):
--
--- set plan_search_depth=0; - automatic
--- set plan_search_depth=1; - min
--- set plan_search_depth=62; - max (default)
+-- set optimizer_search_depth=0; - automatic
+-- set optimizer_search_depth=1; - min
+-- set optimizer_search_depth=62; - max (default)
--
--- set heuristic=0 - exhaustive;
--- set heuristic=1 - heuristic; -- default
+-- set optimizer_prune_level=0 - exhaustive;
+-- set optimizer_prune_level=1 - heuristic; -- default
#
@@ -167,8 +167,8 @@ select @@heuristic;
# procedure 'find_best'. Notice that 'find_best' does not depend on the
# choice of heuristic.
-set plan_search_depth=63;
-select @@plan_search_depth;
+set optimizer_search_depth=63;
+select @@optimizer_search_depth;
-- 6-table join, chain
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
@@ -189,11 +189,11 @@ show status like 'Last_query_cost';
# Test the new optimization procedures
-set heuristic=0;
-select @@heuristic;
+set optimizer_prune_level=0;
+select @@optimizer_prune_level;
-set plan_search_depth=0;
-select @@plan_search_depth;
+set optimizer_search_depth=0;
+select @@optimizer_search_depth;
-- 6-table join, chain
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
@@ -211,8 +211,8 @@ show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
show status like 'Last_query_cost';
-set plan_search_depth=1;
-select @@plan_search_depth;
+set optimizer_search_depth=1;
+select @@optimizer_search_depth;
-- 6-table join, chain
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
@@ -230,8 +230,8 @@ show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
show status like 'Last_query_cost';
-set plan_search_depth=62;
-select @@plan_search_depth;
+set optimizer_search_depth=62;
+select @@optimizer_search_depth;
-- 6-table join, chain
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
@@ -250,11 +250,11 @@ explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and
show status like 'Last_query_cost';
-set heuristic=1;
-select @@heuristic;
+set optimizer_prune_level=1;
+select @@optimizer_prune_level;
-set plan_search_depth=0;
-select @@plan_search_depth;
+set optimizer_search_depth=0;
+select @@optimizer_search_depth;
-- 6-table join, chain
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
@@ -272,8 +272,8 @@ show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
show status like 'Last_query_cost';
-set plan_search_depth=1;
-select @@plan_search_depth;
+set optimizer_search_depth=1;
+select @@optimizer_search_depth;
-- 6-table join, chain
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
@@ -291,8 +291,8 @@ show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
show status like 'Last_query_cost';
-set plan_search_depth=62;
-select @@plan_search_depth;
+set optimizer_search_depth=62;
+select @@optimizer_search_depth;
-- 6-table join, chain
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
diff --git a/mysql-test/t/handler.test b/mysql-test/t/handler.test
index 72b6624509e..685f438712c 100644
--- a/mysql-test/t/handler.test
+++ b/mysql-test/t/handler.test
@@ -126,3 +126,15 @@ handler t close;
use test;
drop table t1;
+#
+# BUG#3649
+#
+create table t1 ( a int, b int, INDEX a (a) );
+insert into t1 values (1,2), (2,1);
+handler t1 open;
+handler t1 read a=(1) where b=2;
+handler t1 read a=(1) where b=3;
+handler t1 read a=(1) where b=1;
+handler t1 close;
+drop table t1;
+
diff --git a/mysql-test/t/rpl_relayrotate-master.opt b/mysql-test/t/innodb-master.opt
index 4cb927540bf..4cb927540bf 100644
--- a/mysql-test/t/rpl_relayrotate-master.opt
+++ b/mysql-test/t/innodb-master.opt
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index e20be83b4b6..e0cc96ccb32 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1044,3 +1044,99 @@ drop table t1;
create table t1 (a int) engine=innodb;
create table t2 like t1;
drop table t1,t2;
+
+#
+# Test of automaticly created foreign keys
+#
+
+create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb;
+create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb;
+show create table t1;
+show create table t2;
+create index id on t2 (id);
+show create table t2;
+create index id2 on t2 (id);
+show create table t2;
+drop index id2 on t2;
+--error 1025,1025
+drop index id on t2;
+show create table t2;
+drop table t2;
+
+create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb;
+show create table t2;
+create unique index id on t2 (id,id2);
+show create table t2;
+drop table t2;
+
+# Check foreign key columns created in different order than key columns
+create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb;
+show create table t2;
+drop table t2;
+
+create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb;
+show create table t2;
+drop table t2;
+
+create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb;
+show create table t2;
+drop table t2;
+
+create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb;
+show create table t2;
+drop table t2;
+
+create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb;
+show create table t2;
+alter table t2 add index id_test (id), add index id_test2 (id,id2);
+show create table t2;
+drop table t2;
+
+# Test error handling
+--error 1005
+create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
+
+# bug#3749
+
+create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb;
+show create table t2;
+drop table t2;
+create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb;
+show create table t2;
+drop table t2, t1;
+
+
+#
+# Let us test binlog_cache_use and binlog_cache_disk_use status vars.
+# Actually this test has nothing to do with innodb per se, it just requires
+# transactional table.
+#
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+
+create table t1 (a int) engine=innodb;
+
+# Now we are going to create transaction which is long enough so its
+# transaction binlog will be flushed to disk...
+let $1=2000;
+disable_query_log;
+begin;
+while ($1)
+{
+ eval insert into t1 values( $1 );
+ dec $1;
+}
+commit;
+enable_query_log;
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+
+# Transaction which should not be flushed to disk and so should not
+# increase binlog_cache_disk_use.
+begin;
+delete from t1;
+commit;
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+
+drop table t1;
diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test
index b45df8eb58e..9d3125efa61 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
+--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 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
+--replace_result 1808 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1814 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
+--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED
show status like 'key_blocks_unused';
# Cleanup
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index 9ae9c1b5e12..465920deaed 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -80,6 +80,16 @@ select distinct i from t1 order by mod(i,2),i;
drop table t1;
#
+# bug#3681
+#
+
+create table t1 ( pk int primary key, name varchar(255) not null, number varchar(255) not null);
+insert into t1 values (1, 'Gamma', '123'), (2, 'Gamma Ext', '123a'), (3, 'Alpha', '001'), (4, 'Beta', '200c');
+select distinct t1.name as 'Building Name',t1.number as 'Building Number' from t1 order by t1.name asc;
+drop table t1;
+
+
+#
# Order by on first index part
#
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 51b1f34ee79..4665cd02ed8 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -197,12 +197,11 @@ drop table t1;
#
# bug #1172
#
-CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1), KEY i2 (key1));
+CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1));
INSERT INTO t1 VALUES (0),(0),(1),(1);
CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya));
INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2);
explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
-explain select * from t1 force index(i2), t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
DROP TABLE t1,t2;
#
diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test
index cd4c9834fe9..00c14c43ff3 100644
--- a/mysql-test/t/rpl000015.test
+++ b/mysql-test/t/rpl000015.test
@@ -12,7 +12,7 @@ show slave status;
change master to master_host='127.0.0.1';
# The following needs to be cleaned up when change master is fixed
---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
--replace_result $MASTER_MYPORT MASTER_PORT
diff --git a/mysql-test/t/rpl_error_ignored_table.test b/mysql-test/t/rpl_error_ignored_table.test
index 39fb78a2f36..487869e5fef 100644
--- a/mysql-test/t/rpl_error_ignored_table.test
+++ b/mysql-test/t/rpl_error_ignored_table.test
@@ -14,7 +14,7 @@ connection slave;
sync_with_master;
# The port number is different when doing the release build with
# Do-compile, hence we have to replace the port number here accordingly
---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
# check that the table has been ignored, because otherwise the test is nonsense
diff --git a/mysql-test/t/rpl_log.test b/mysql-test/t/rpl_log.test
index 52f0a0f0d95..178199d6160 100644
--- a/mysql-test/t/rpl_log.test
+++ b/mysql-test/t/rpl_log.test
@@ -90,11 +90,11 @@ connection slave;
start slave;
sync_with_master;
show binary logs;
---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION
+--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
show binlog events in 'slave-bin.000001' from 4;
---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION
+--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
show binlog events in 'slave-bin.000002' from 4;
---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
diff --git a/mysql-test/t/rpl_log_pos.test b/mysql-test/t/rpl_log_pos.test
index f1acbf50165..634bf9449fd 100644
--- a/mysql-test/t/rpl_log_pos.test
+++ b/mysql-test/t/rpl_log_pos.test
@@ -4,7 +4,7 @@
source include/master-slave.inc;
show master status;
sync_slave_with_master;
---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
stop slave;
@@ -14,19 +14,19 @@ sleep 5;
stop slave;
change master to master_log_pos=73;
---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
start slave;
sleep 5;
---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
stop slave;
change master to master_log_pos=173;
start slave;
sleep 2;
---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
connection master;
diff --git a/mysql-test/t/rpl_max_relay_size.test b/mysql-test/t/rpl_max_relay_size.test
index 410b3d35923..963a76fb959 100644
--- a/mysql-test/t/rpl_max_relay_size.test
+++ b/mysql-test/t/rpl_max_relay_size.test
@@ -28,7 +28,7 @@ set global max_relay_log_size=8192-1; # mapped to 4096
select @@global.max_relay_log_size;
start slave;
sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
stop slave;
@@ -37,7 +37,7 @@ set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size;
start slave;
sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
stop slave;
@@ -46,7 +46,7 @@ set global max_relay_log_size=0;
select @@global.max_relay_log_size;
start slave;
sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
@@ -57,7 +57,7 @@ reset slave;
# test of relay log rotation when the slave is stopped
# (to make sure it does not crash).
flush logs;
---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
@@ -73,7 +73,7 @@ create table t1 (a int);
save_master_pos;
connection slave;
sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
# one more rotation, to be sure Relay_Log_Space is correctly updated
@@ -83,7 +83,7 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
diff --git a/mysql-test/t/rpl_relayrotate.test b/mysql-test/t/rpl_relayrotate.test
index d692140ddd9..63986b38456 100644
--- a/mysql-test/t/rpl_relayrotate.test
+++ b/mysql-test/t/rpl_relayrotate.test
@@ -62,22 +62,6 @@ select max(a) from t1;
show slave status;
connection master;
-# binlog_cache_use and binlog_cache_disk_use status vars test
-# This test uses the previous test. Namely, it needs the long
-# transaction that adds 8000 lines to the t1 table.
-
-show status like "binlog_cache_use";
-show status like "binlog_cache_disk_use";
-
-# transaction which should not be flushed to disk and so should not
-# increase binlog_cache_disk_use
-begin;
-delete from t1;
-commit;
-
-show status like "binlog_cache_use";
-show status like "binlog_cache_disk_use";
-
# The following DROP is a very important cleaning task:
# imagine the next test is run with --skip-innodb: it will do
# DROP TABLE IF EXISTS t1; but this will delete the frm and leave
diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test
index 025eb4613ee..fe0d1de5809 100644
--- a/mysql-test/t/rpl_rotate_logs.test
+++ b/mysql-test/t/rpl_rotate_logs.test
@@ -31,14 +31,14 @@ system chmod 600 var/slave-data/master.info;
# init_strvar_from_file() in init_master_info()).
--error 1201
start slave;
---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
# CHANGE MASTER will fail because it first parses master.info before changing
# it (so when master.info is bad, people have to use RESET SLAVE first).
--error 1201
eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
reset slave;
---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
connection master;
reset master;
@@ -54,7 +54,7 @@ insert into temp_table values ("testing temporary tables");
create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard');
sync_slave_with_master;
---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
select * from t1;
@@ -107,7 +107,7 @@ purge master logs before now();
show binary logs;
insert into t2 values (65);
sync_slave_with_master;
---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
select * from t2;
@@ -139,7 +139,7 @@ connection slave;
sync_with_master;
select * from t4;
---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
# because of concurrent insert, the table may not be up to date
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index abd3901f234..05847ba220c 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -1262,6 +1262,261 @@ select * from t3|
drop procedure bug2780|
drop table t3|
+#
+# BUG#1863
+#
+--disable_warnings
+drop table if exists t3|
+--enable_warnings
+create table t3 (content varchar(10) )|
+insert into t3 values ("test1")|
+insert into t3 values ("test2")|
+
+--disable_warnings
+drop table if exists t4|
+--enable_warnings
+create table t4 (f1 int, rc int, t3 int)|
+
+create procedure bug1863(in1 int)
+begin
+
+ declare ind int default 0;
+ declare t1 int;
+ declare t2 int;
+ declare t3 int;
+
+ declare rc int default 0;
+ declare continue handler for 1065 set rc = 1;
+
+ drop table if exists temp_t1;
+ create temporary table temp_t1 (
+ f1 int auto_increment, f2 varchar(20), primary key (f1)
+ );
+
+ insert into temp_t1 (f2) select content from t3;
+
+ select f2 into t3 from temp_t1 where f1 = 10;
+
+ if (rc) then
+ insert into t4 values (1, rc, t3);
+ end if;
+
+ insert into t4 values (2, rc, t3);
+
+end|
+
+call bug1863(10)|
+call bug1863(10)|
+select * from t4|
+
+drop procedure bug1863|
+drop table t3, t4|
+
+#
+# BUG#2656
+#
+--disable_warnings
+drop table if exists t3, t4|
+--enable_warnings
+
+create table t3 (
+ OrderID int not null,
+ MarketID int,
+ primary key (OrderID)
+)|
+
+create table t4 (
+ MarketID int not null,
+ Market varchar(60),
+ Status char(1),
+ primary key (MarketID)
+)|
+
+insert t3 (OrderID,MarketID) values (1,1)|
+insert t3 (OrderID,MarketID) values (2,2)|
+insert t4 (MarketID,Market,Status) values (1,"MarketID One","A")|
+insert t4 (MarketID,Market,Status) values (2,"MarketID Two","A")|
+
+create procedure bug2656_1()
+begin
+ select
+ m.Market
+ from t4 m JOIN t3 o
+ ON o.MarketID != 1 and o.MarketID = m.MarketID;
+end |
+
+create procedure bug2656_2()
+begin
+ select
+ m.Market
+ from
+ t4 m, t3 o
+ where
+ m.MarketID != 1 and m.MarketID = o.MarketID;
+
+end |
+
+call bug2656_1()|
+call bug2656_1()|
+call bug2656_2()|
+call bug2656_2()|
+drop procedure bug2656_1|
+drop procedure bug2656_2|
+drop table t3, t4|
+
+
+#
+# BUG#3426
+#
+create procedure bug3426(in_time int unsigned, out x int)
+begin
+ if in_time is null then
+ set @stamped_time=10;
+ set x=1;
+ else
+ set @stamped_time=in_time;
+ set x=2;
+ end if;
+end|
+
+call bug3426(1000, @i)|
+select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|
+call bug3426(NULL, @i)|
+select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|
+# Clear SP cache
+alter procedure bug3426 sql security invoker|
+call bug3426(NULL, @i)|
+select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|
+call bug3426(1000, @i)|
+select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|
+
+drop procedure bug3426|
+
+#
+# BUG#3448
+#
+--disable_warnings
+drop table if exists t3, t4|
+--enable_warnings
+
+create table t3 (
+ a int primary key,
+ ach char(1)
+) engine = innodb|
+
+create table t4 (
+ b int primary key ,
+ bch char(1)
+) engine = innodb|
+
+insert into t3 values (1 , 'aCh1' ) , ('2' , 'aCh2')|
+insert into t4 values (1 , 'bCh1' )|
+
+create procedure bug3448()
+ select * from t3 inner join t4 on t3.a = t4.b|
+
+select * from t3 inner join t4 on t3.a = t4.b|
+call bug3448()|
+call bug3448()|
+
+drop procedure bug3448|
+drop table t3, t4|
+
+
+#
+# BUG#3734
+#
+--disable_warnings
+drop table if exists t3|
+--enable_warnings
+create table t3 (
+ id int unsigned auto_increment not null primary key,
+ title VARCHAR(200),
+ body text,
+ fulltext (title,body)
+)|
+
+insert into t3 (title,body) values
+ ('MySQL Tutorial','DBMS stands for DataBase ...'),
+ ('How To Use MySQL Well','After you went through a ...'),
+ ('Optimizing MySQL','In this tutorial we will show ...'),
+ ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
+ ('MySQL vs. YourSQL','In the following database comparison ...'),
+ ('MySQL Security','When configured properly, MySQL ...')|
+
+create procedure bug3734 (param1 varchar(100))
+ select * from t3 where match (title,body) against (param1)|
+
+call bug3734('database')|
+call bug3734('Security')|
+
+drop procedure bug3734|
+drop table t3|
+
+#
+# BUG#3863
+#
+create procedure bug3863()
+begin
+ set @a = 0;
+ while @a < 5 do
+ set @a = @a + 1;
+ end while;
+end|
+
+call bug3863()|
+select @a|
+call bug3863()|
+select @a|
+
+drop procedure bug3863|
+
+#
+# BUG#2460
+#
+--disable_warnings
+drop table if exists t3|
+--enable_warnings
+create table t3 (
+ id int(10) unsigned not null default 0,
+ rid int(10) unsigned not null default 0,
+ msg text not null,
+ primary key (id),
+ unique key rid (rid, id)
+)|
+
+create procedure bug2460_1(in v int)
+begin
+ ( select n0.id from t3 as n0 where n0.id = v )
+ union
+ ( select n0.id from t3 as n0, t3 as n1
+ where n0.id = n1.rid and n1.id = v )
+ union
+ ( select n0.id from t3 as n0, t3 as n1, t3 as n2
+ where n0.id = n1.rid and n1.id = n2.rid and n2.id = v );
+end|
+
+call bug2460_1(2)|
+call bug2460_1(2)|
+insert into t3 values (1, 1, 'foo'), (2, 1, 'bar'), (3, 1, 'zip zap')|
+call bug2460_1(2)|
+call bug2460_1(2)|
+
+create procedure bug2460_2()
+begin
+ drop table if exists t3;
+ create table t3 (s1 int);
+ insert into t3 select 1 union select 1;
+end|
+
+call bug2460_2()|
+call bug2460_2()|
+select * from t3|
+
+drop procedure bug2460_1|
+drop procedure bug2460_2|
+drop table t3|
+
#
# Some "real" examples
@@ -1381,6 +1636,12 @@ show procedure status like '%p%'|
call ip(200)|
# We don't want to select the entire table here, just pick a few
# examples.
+# The expected result is:
+# i p
+# --- ----
+# 45 211
+# 100 557
+# 199 1229
select * from primes where i=45 or i=100 or i=199|
drop table primes|
drop procedure opp|
@@ -1444,3 +1705,15 @@ drop procedure bar|
delimiter ;|
drop table t1;
drop table t2;
+
+#
+# rexecution
+#
+create procedure p1 () select (select s1 from t1) from t1;
+create table t1 (s1 int);
+call p1();
+insert into t1 values (1);
+call p1();
+drop procedure p1;
+drop table t1;
+
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index c3fb3dc8388..7807f139a93 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -979,7 +979,7 @@ create table t1 (s1 char);
insert into t1 values ('e');
select * from t1 where 'f' > any (select s1 from t1);
select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1);
-explain select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1);
+explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1);
drop table t1;
#
@@ -1130,4 +1130,36 @@ INSERT INTO t1 VALUES (1), (2);
INSERT INTO t2 VALUES (1);
SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id);
SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id) ORDER BY t1.id;
-DROP TABLE t1,t2
+DROP TABLE t1,t2;
+
+#
+# ALL/ANY test
+#
+CREATE TABLE t1 ( a int, b int );
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 );
+ALTER TABLE t1 ADD INDEX (a);
+SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 );
+SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 );
+DROP TABLE t1;
diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test
index caccf31b32a..d3ddecfc314 100644
--- a/mysql-test/t/type_float.test
+++ b/mysql-test/t/type_float.test
@@ -31,6 +31,14 @@ select a from t1 order by a;
select min(a) from t1;
drop table t1;
+create table t1 (c1 double, c2 varchar(20));
+insert t1 values (121,"16");
+select c1 + c1 * (c2 / 100) as col from t1;
+create table t2 select c1 + c1 * (c2 / 100) as col from t1;
+select * from t2;
+show create table t2;
+drop table t1,t2;
+
# Bug #1022: When a table contains a 'float' field,
# and one of the functions MAX, MIN, or AVG is used on that field,
# the system crashes.
@@ -54,6 +62,12 @@ select a from t1 order by a;
select min(a) from t1;
drop table t1;
+create table t1 (a float(200,100), b double(200,100));
+insert t1 values (1.0, 2.0);
+select * from t1;
+show create table t1;
+drop table t1;
+
# Errors
--error 1063
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index d9e19571f81..f6006a87d47 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -39,8 +39,11 @@ explain select a,b from t1 union all select a,b from t2;
--error 1054
explain select xx from t1 union select 1;
+--error 1222
explain select a,b from t1 union select 1;
+--error 1222
explain select 1 union select a,b from t1 union select 1;
+--error 1222
explain select a,b from t1 union select 1 limit 0;
--error 1221
@@ -515,3 +518,12 @@ SET SQL_SELECT_LIMIT=1;
select a from t1 union select a from t2 order by a;
drop table t1, t2;
set sql_select_limit=default;
+
+#
+# nonexisting column in global ORDER BY
+#
+CREATE TABLE t1 (i int(11) default NULL,c char(1) default NULL,KEY i (i));
+CREATE TABLE t2 (i int(11) default NULL,c char(1) default NULL,KEY i (i));
+--error 1054
+explain (select * from t1) union (select * from t2) order by not_existing_column;
+drop table t1, t2;
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index a82aa87558a..81bfacf4ee7 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -298,6 +298,14 @@ set ft_boolean_syntax = @@init_connect;
--error 1231
set global ft_boolean_syntax = @@init_connect;
+# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as
+# expected: check that there is no overflow when 64-bit unsigned
+# variables are set
+
+set global myisam_max_sort_file_size=4294967296;
+show global variables like 'myisam_max_sort_file_size';
+set global myisam_max_sort_file_size=default;
+
#
# swap
#
diff --git a/mysys/charset.c b/mysys/charset.c
index e58c851cf7c..d801fcdbd76 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -466,7 +466,8 @@ static my_bool init_available_charsets(myf myflags)
if (*cs)
{
set_max_sort_char(*cs);
- init_state_maps(*cs);
+ if (cs[0]->ctype)
+ init_state_maps(*cs);
}
}
@@ -622,3 +623,61 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name,
DBUG_RETURN(cs);
}
+
+
+ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to,
+ const char *from, ulong length)
+{
+ const char *to_start= to;
+ const char *end;
+#ifdef USE_MB
+ my_bool use_mb_flag= use_mb(charset_info);
+#endif
+ for (end= from + length; from != end; from++)
+ {
+#ifdef USE_MB
+ int l;
+ if (use_mb_flag && (l= my_ismbchar(charset_info, from, end)))
+ {
+ while (l--)
+ *to++= *from++;
+ from--;
+ continue;
+ }
+#endif
+ switch (*from) {
+ case 0: /* Must be escaped for 'mysql' */
+ *to++= '\\';
+ *to++= '0';
+ break;
+ case '\n': /* Must be escaped for logs */
+ *to++= '\\';
+ *to++= 'n';
+ break;
+ case '\r':
+ *to++= '\\';
+ *to++= 'r';
+ break;
+ case '\\':
+ *to++= '\\';
+ *to++= '\\';
+ break;
+ case '\'':
+ *to++= '\\';
+ *to++= '\'';
+ break;
+ case '"': /* Better safe than sorry */
+ *to++= '\\';
+ *to++= '"';
+ break;
+ case '\032': /* This gives problems on Win32 */
+ *to++= '\\';
+ *to++= 'Z';
+ break;
+ default:
+ *to++= *from;
+ }
+ }
+ *to= 0;
+ return (ulong) (to - to_start);
+}
diff --git a/mysys/default.c b/mysys/default.c
index af67520322f..056f686e16f 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -479,6 +479,7 @@ static char *remove_end_comment(char *ptr)
return ptr;
}
+#include <help_start.h>
void print_defaults(const char *conf_file, const char **groups)
{
@@ -531,3 +532,5 @@ void print_defaults(const char *conf_file, const char **groups)
--defaults-file=# Only read default options from the given file #\n\
--defaults-extra-file=# Read this file after the global files are read");
}
+
+#include <help_end.h>
diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c
index da16457c299..0f8984e6b3d 100644
--- a/mysys/my_bitmap.c
+++ b/mysys/my_bitmap.c
@@ -104,7 +104,7 @@ void bitmap_set_bit(MY_BITMAP *map, uint bitmap_bit)
{
DBUG_ASSERT(map->bitmap && bitmap_bit < map->bitmap_size*8);
bitmap_lock(map);
- map->bitmap[bitmap_bit / 8] |= (1 << (bitmap_bit & 7));
+ bitmap_fast_set_bit(map, bitmap_bit);
bitmap_unlock(map);
}
@@ -144,7 +144,7 @@ void bitmap_clear_bit(MY_BITMAP *map, uint bitmap_bit)
{
DBUG_ASSERT(map->bitmap && bitmap_bit < map->bitmap_size*8);
bitmap_lock(map);
- map->bitmap[bitmap_bit / 8] &= ~ (1 << (bitmap_bit & 7));
+ bitmap_fast_clear_bit(map, bitmap_bit);
bitmap_unlock(map);
}
@@ -220,7 +220,7 @@ my_bool bitmap_is_set_all(const MY_BITMAP *map)
my_bool bitmap_is_set(const MY_BITMAP *map, uint bitmap_bit)
{
DBUG_ASSERT(map->bitmap && bitmap_bit < map->bitmap_size*8);
- return map->bitmap[bitmap_bit / 8] & (1 << (bitmap_bit & 7));
+ return bitmap_fast_is_set(map, bitmap_bit);
}
diff --git a/mysys/my_chsize.c b/mysys/my_chsize.c
index 653ea569172..cf26428d65f 100644
--- a/mysys/my_chsize.c
+++ b/mysys/my_chsize.c
@@ -89,7 +89,7 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
We should never come here on any modern machine
*/
VOID(my_seek(fd, newlength, MY_SEEK_SET, MYF(MY_WME+MY_FAE)));
- swap(my_off_t, newlength, oldsize);
+ swap_variables(my_off_t, newlength, oldsize);
}
#endif
diff --git a/mysys/my_compress.c b/mysys/my_compress.c
index dd076311188..0e37d2fef9b 100644
--- a/mysys/my_compress.c
+++ b/mysys/my_compress.c
@@ -68,7 +68,7 @@ byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen)
DBUG_PRINT("note",("Packet got longer on compression; Not compressed"));
return 0;
}
- swap(ulong, *len, *complen); /* *len is now packet length */
+ swap_variables(ulong, *len, *complen); /* *len is now packet length */
return compbuf;
}
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index efd5789968c..8d0b05d55f7 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -790,6 +790,8 @@ static void init_variables(const struct my_option *options)
Print help for all options and variables.
*/
+#include <help_start.h>
+
void my_print_help(const struct my_option *options)
{
uint col, name_space= 22, comment_space= 57;
@@ -920,3 +922,5 @@ void my_print_variables(const struct my_option *options)
}
}
}
+
+#include <help_end.h>
diff --git a/mysys/my_handler.c b/mysys/my_handler.c
index 35f620ccbcb..de0fba56d21 100644
--- a/mysys/my_handler.c
+++ b/mysys/my_handler.c
@@ -331,7 +331,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
if (keyseg->flag & HA_REVERSE_SORT)
{
- swap(uchar*,a,b);
+ swap_variables(uchar*, a, b);
swap_flag=1; /* Remember swap of a & b */
end= a+ (int) (end-b);
}
@@ -356,8 +356,8 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
if (*b != '-')
return -1;
a++; b++;
- swap(uchar*,a,b);
- swap(int,alength,blength);
+ swap_variables(uchar*, a, b);
+ swap_variables(int, alength, blength);
swap_flag=1-swap_flag;
alength--; blength--;
end=a+alength;
@@ -385,7 +385,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
}
if (swap_flag) /* Restore pointers */
- swap(uchar*,a,b);
+ swap_variables(uchar*, a, b);
break;
}
#ifdef HAVE_LONG_LONG
diff --git a/mysys/my_init.c b/mysys/my_init.c
index fc178b0308b..da0e6caf96d 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -353,14 +353,16 @@ static my_bool win32_init_tcp_ip()
#ifdef __NETWARE__
-/****************************************************************************
- Do basic initialisation for netware needed by most programs
-****************************************************************************/
+/*
+ Basic initialisation for netware
+*/
static void netware_init()
{
char cwd[PATH_MAX], *name;
+ DBUG_ENTER("netware_init");
+
/* init only if we are not a client library */
if (my_progname)
{
@@ -398,5 +400,7 @@ static void netware_init()
}
}
}
+
+ DBUG_VOID_RETURN;
}
#endif /* __NETWARE__ */
diff --git a/mysys/my_lock.c b/mysys/my_lock.c
index 5058c301adb..8f915d6003a 100644
--- a/mysys/my_lock.c
+++ b/mysys/my_lock.c
@@ -117,10 +117,12 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
#if defined(HAVE_FCNTL)
{
struct flock lock;
- lock.l_type= (short) locktype;
- lock.l_whence=0L;
- lock.l_start=(long) start;
- lock.l_len=(long) length;
+
+ lock.l_type= (short) locktype;
+ lock.l_whence= SEEK_SET;
+ lock.l_start= (off_t) start;
+ lock.l_len= (off_t) length;
+
if (MyFlags & MY_DONT_WAIT)
{
if (fcntl(fd,F_SETLK,&lock) != -1) /* Check if we can lock */
diff --git a/mysys/my_netware.c b/mysys/my_netware.c
index e41dbd0a029..9c604778c2d 100644
--- a/mysys/my_netware.c
+++ b/mysys/my_netware.c
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
- Function specific to netware
+ Functions specific to netware
*/
#include <mysys_priv.h>
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index f10a2210064..2667c0670d8 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -102,16 +102,20 @@ void my_pthread_exit(void *status)
NXContext_t ctx;
char name[PATH_MAX] = "";
- NXThreadGetContext(tid, &ctx);
- NXContextGetName(ctx, name, PATH_MAX);
-
- /*
- "MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread"
- with a debug build of LibC the reaper can have different names
- */
- if (!strindex(name, "\'s"))
+ /* Do not call pthread_exit if it is not a LibC thread */
+ if (tid != 0)
{
- pthread_exit(status);
+ NXThreadGetContext(tid, &ctx);
+ NXContextGetName(ctx, name, PATH_MAX);
+
+ /*
+ "MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread"
+ with a debug build of LibC the reaper can have different names
+ */
+ if (!strindex(name, "\'s"))
+ {
+ pthread_exit(status);
+ }
}
}
#endif
diff --git a/mysys/sha1.c b/mysys/sha1.c
index 5271b369b6c..d93b4571baf 100644
--- a/mysys/sha1.c
+++ b/mysys/sha1.c
@@ -342,7 +342,7 @@ static void SHA1ProcessMessageBlock(SHA1_CONTEXT *context)
*/
-void SHA1PadMessage(SHA1_CONTEXT *context)
+static void SHA1PadMessage(SHA1_CONTEXT *context)
{
/*
Check to see if the current message block is too small to hold
diff --git a/ndb/Defs.mk b/ndb/Defs.mk
index d5a21c64ca9..ac4507562fd 100644
--- a/ndb/Defs.mk
+++ b/ndb/Defs.mk
@@ -21,62 +21,42 @@ LIBPREFIX := lib
fixpath = $1
ar_rcs = $(AR_RCS) $1 $2
#check-odbc = $(findstring sqlext.h, $(wildcard /usr/include/sqlext.h) $(wildcard /usr/local/include/sqlext.h))
-CCFLAGS_TOP += -DHAVE_STRCASECMP
-
endif
ifeq ($(NDB_OS), WIN32)
-CCFLAGS_TOP += -DHAVE_STRDUP
-NDB_STRLCPY := Y
-NDB_STRLCAT := Y
SHLIBEXT := dll
endif
ifeq ($(NDB_OS), LINUX)
-CCFLAGS_TOP += -DHAVE_STRDUP
-NDB_STRLCAT := Y
-NDB_STRLCPY := Y
SHLIBEXT := so
endif
ifeq ($(NDB_OS), SOLARIS)
-CCFLAGS_TOP += -DHAVE_STRDUP
-NDB_STRLCAT := Y
-NDB_STRLCPY := Y
SHLIBEXT := so
endif
ifeq ($(NDB_OS), HPUX)
-CCFLAGS_TOP += -DHAVE_STRDUP
-NDB_STRLCAT := Y
-NDB_STRLCPY := Y
SHLIBEXT := sl
endif
ifeq ($(NDB_OS), MACOSX)
-CCFLAGS_TOP += -DHAVE_STRLCAT
-CCFLAGS_TOP += -DHAVE_STRLCAT
-CCFLAGS_TOP += -DHAVE_STRLCPY
-CCFLAGS_TOP += -DNDBOUT_UINTPTR
SHLIBEXT := dylib
endif
ifeq ($(NDB_OS), OSE)
-NDB_STRDUP := Y
-NDB_STRLCAT := Y
-NDB_STRLCPY := Y
SHLIBEXT := so
endif
ifeq ($(NDB_OS), SOFTOSE)
-NDB_STRDUP := Y
-NDB_STRLCAT := Y
-NDB_STRLCPY := Y
SHLIBEXT := so
endif
ifeq ($(NDB_SCI), Y)
-CCFLAGS_TOP += -DHAVE_SCI
+CCFLAGS_TOP += -DHAVE_NDB_SCI
+endif
+
+ifeq ($(NDB_SHM), Y)
+CCFLAGS_TOP += -DHAVE_NDB_SHM
endif
ifneq ($(findstring OSE, $(NDB_OS)),)
diff --git a/ndb/Epilogue.mk b/ndb/Epilogue.mk
index dc78a66a1f8..bcdc54a87f1 100644
--- a/ndb/Epilogue.mk
+++ b/ndb/Epilogue.mk
@@ -227,7 +227,7 @@ CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/util) \
BIN_TARGET_LIBS += logger general portlib
endif
-CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include)
+CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include) -I$(call fixpath,$(NDB_TOP)/../include)
ifeq ($(NDB_SCI), Y)
BIN_TARGET_LIBS += sisci
diff --git a/ndb/Makefile b/ndb/Makefile
index 586a430bb17..475914f6120 100644
--- a/ndb/Makefile
+++ b/ndb/Makefile
@@ -6,6 +6,13 @@ DIRS := src test tools examples
replace-targets := all clean
NDB_RELEASE := $(shell ../scripts/mysql_config --version)
+all:
+ $(MAKE) -C src
+ $(MAKE) -C test/src
+ $(MAKE) -C tools
+ $(MAKE) -C test/ndbapi/flexBench
+ $(MAKE) -C test/tools/waiter
+
include $(NDB_TOP)/Epilogue.mk
_libs_test : _bins_src
@@ -15,7 +22,7 @@ _bins_src : _libs_src
_bins_tools : _bins_src
# always release compile except for ndbapi static lib
-all:
+old-all:
$(MAKE) -C src/ndbapi libs
$(MAKE) libs NDB_VERSION=RELEASE
$(MAKE) bins NDB_VERSION=RELEASE
diff --git a/ndb/bin/regression.sh b/ndb/bin/regression.sh
index 5e3491af208..5d0531c7460 100644
--- a/ndb/bin/regression.sh
+++ b/ndb/bin/regression.sh
@@ -294,7 +294,7 @@ executeTest 'testScan -n ScanUpdate2' T6
executeTest 'drop_tab' T6
executeTest 'testScan -n ScanDelete'
-executeTest 'drop_all_tab'
+executeTest 'drop_all_tabs'
executeTest 'testScan -n ScanDelete2' T10
executeTest 'drop_tab' T10
diff --git a/ndb/config/Defs.LINUX.x86.GCC.mk b/ndb/config/Defs.LINUX.x86.GCC.mk
index 698b0eb8350..6167a30ff23 100644
--- a/ndb/config/Defs.LINUX.x86.GCC.mk
+++ b/ndb/config/Defs.LINUX.x86.GCC.mk
@@ -6,9 +6,11 @@ SHELL := /bin/sh
C++ := gcc$(GCC_VERSION)
CC := gcc$(GCC_VERSION)
AR_RCS := $(PURE) ar rcs
-SO := gcc$(GCC_VERSION) -shared -lpthread -o
+SO := gcc$(GCC_VERSION) -shared -lpthread -o
+#SO := gcc$(GCC_VERSION) -shared -o
MAKEDEPEND := gcc$(GCC_VERSION) -M
+#MAKEDEPEND := gcc$(GCC_VERSION) -M -nostdinc -nostdinc++
PIC := -fPIC
RPCGENFLAGS := -M -C -N
@@ -27,7 +29,8 @@ else
CCFLAGS_WARNINGS = -Wno-long-long -Wall
endif
# Add these for more warnings -Weffc++ -W
-CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
+CCFLAGS_TOP =
+#CCFLAGS_TOP = -DSAFE_MUTEX
CCFLAGS_TOP += -fno-rtti -fno-exceptions
ifeq (RELEASE, $(NDB_VERSION))
@@ -53,4 +56,5 @@ LINK.cc = $(PURE) $(CC) $(CCFLAGS) $(LDFLAGS)
LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS)
-LDFLAGS_LAST = -lpthread -lrt $(NDB_TOP)/src/common/portlib/gcc.cpp
+LDFLAGS_LAST = -lrt -lpthread $(NDB_TOP)/src/common/portlib/gcc.cpp
+#LDFLAGS_LAST = -lrt $(NDB_TOP)/src/common/portlib/gcc.cpp $(NDB_TOP)/../mysys/libmysys.a $(NDB_TOP)/../dbug/libdbug.a $(NDB_TOP)/../regex/libregex.a $(NDB_TOP)/../strings/libmystrings.a -lpthread
diff --git a/ndb/config/GuessConfig.sh b/ndb/config/GuessConfig.sh
index d2d8446c704..3caeeaae6d0 100755
--- a/ndb/config/GuessConfig.sh
+++ b/ndb/config/GuessConfig.sh
@@ -11,6 +11,11 @@ then
NDB_SCI=N
fi
+if [ -z "$NDB_SHM" ]
+then
+ NDB_SHM=N
+fi
+
os=`uname -s`
case $os in
Linux)
diff --git a/ndb/examples/ndbapi_async_example/ndbapi_async.cpp b/ndb/examples/ndbapi_async_example/ndbapi_async.cpp
index 685c853c5d5..7abebcc832d 100644
--- a/ndb/examples/ndbapi_async_example/ndbapi_async.cpp
+++ b/ndb/examples/ndbapi_async_example/ndbapi_async.cpp
@@ -63,20 +63,12 @@
*/
+#include <ndb_global.h>
+
#include <NdbApi.hpp>
#include <NdbScanFilter.hpp>
#include <iostream> // Used for cout
-#ifdef SOLARIS
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-#if defined LINUX || defined MACOSX
-#include <time.h>
-#include <unistd.h>
-#endif
-
/**
* Helper sleep function
*/
diff --git a/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp b/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
index 186afdb9471..7c3a66326c6 100644
--- a/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
+++ b/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
@@ -85,21 +85,13 @@
*/
+#include <ndb_global.h>
+
#include <NdbApi.hpp>
#include <NdbScanFilter.hpp>
// Used for cout
#include <iostream>
-#ifdef SOLARIS
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-#if defined LINUX || defined MACOSX
-#include <time.h>
-#include <unistd.h>
-#endif
-
/**
* Helper sleep function
*/
diff --git a/ndb/include/debugger/SignalLoggerManager.hpp b/ndb/include/debugger/SignalLoggerManager.hpp
index 3d89b399f3b..742bf7d294e 100644
--- a/ndb/include/debugger/SignalLoggerManager.hpp
+++ b/ndb/include/debugger/SignalLoggerManager.hpp
@@ -24,7 +24,6 @@
#define SignalLoggerManager_H
-#include <NdbStdio.h>
#include <kernel_types.h>
#include <BlockNumbers.h>
#include <TransporterDefinitions.hpp>
@@ -153,7 +152,7 @@ public:
private:
bool m_logDistributed;
- int m_ownNodeId;
+ Uint32 m_ownNodeId;
FILE * outputStream;
int log(int cmd, BlockNumber bno, LogMode logMode);
diff --git a/ndb/include/kernel/LogLevel.hpp b/ndb/include/kernel/LogLevel.hpp
index 0902f3e488b..3363dc2befd 100644
--- a/ndb/include/kernel/LogLevel.hpp
+++ b/ndb/include/kernel/LogLevel.hpp
@@ -17,8 +17,7 @@
#ifndef _LOG_LEVEL_HPP
#define _LOG_LEVEL_HPP
-#include <ndb_types.h>
-#include <assert.h>
+#include <ndb_global.h>
/**
*
diff --git a/ndb/include/kernel/signaldata/BuildIndx.hpp b/ndb/include/kernel/signaldata/BuildIndx.hpp
index 9cf1123cc61..29dfaeb79a6 100644
--- a/ndb/include/kernel/signaldata/BuildIndx.hpp
+++ b/ndb/include/kernel/signaldata/BuildIndx.hpp
@@ -19,7 +19,6 @@
#include "SignalData.hpp"
#include <NodeBitmask.hpp>
-#include <NdbString.h>
#include <signaldata/DictTabInfo.hpp>
/**
diff --git a/ndb/include/kernel/signaldata/SignalData.hpp b/ndb/include/kernel/signaldata/SignalData.hpp
index 071bd9b9104..511e7d30c21 100644
--- a/ndb/include/kernel/signaldata/SignalData.hpp
+++ b/ndb/include/kernel/signaldata/SignalData.hpp
@@ -17,11 +17,9 @@
#ifndef SIGNAL_DATA_H
#define SIGNAL_DATA_H
+#include <ndb_global.h>
#include <ndb_limits.h>
#include <kernel_types.h>
-#include <NdbStdio.h>
-#include <NdbConstant.hpp>
-#include <stdlib.h>
#ifndef NDB_ASSERT
#ifdef VM_TRACE
diff --git a/ndb/include/kernel/signaldata/SignalDataPrint.hpp b/ndb/include/kernel/signaldata/SignalDataPrint.hpp
index 588e2893214..17ab07acd4e 100644
--- a/ndb/include/kernel/signaldata/SignalDataPrint.hpp
+++ b/ndb/include/kernel/signaldata/SignalDataPrint.hpp
@@ -17,8 +17,8 @@
#ifndef SIGNAL_DATA_PRINT_H
#define SIGNAL_DATA_PRINT_H
+#include <ndb_global.h>
#include <kernel_types.h>
-#include <NdbStdio.h>
/**
* Typedef for a Signal Data Print Function
diff --git a/ndb/include/logger/FileLogHandler.hpp b/ndb/include/logger/FileLogHandler.hpp
index ae69a2f5418..08e46c11844 100644
--- a/ndb/include/logger/FileLogHandler.hpp
+++ b/ndb/include/logger/FileLogHandler.hpp
@@ -19,7 +19,7 @@
#include "LogHandler.hpp"
-class File;
+class File_class;
/**
* Logs messages to a file. The log file will be archived depending on
@@ -104,7 +104,7 @@ private:
int m_maxNoFiles;
long m_maxFileSize;
unsigned int m_maxLogEntries;
- File* m_pLogFile;
+ File_class* m_pLogFile;
};
#endif
diff --git a/ndb/include/logger/LogHandler.hpp b/ndb/include/logger/LogHandler.hpp
index 8c5c9298f69..8f76783e6b0 100644
--- a/ndb/include/logger/LogHandler.hpp
+++ b/ndb/include/logger/LogHandler.hpp
@@ -19,7 +19,6 @@
#include "Logger.hpp"
-#include <NdbStdio.h> // Defines NULL
/**
* This class is the base class for all log handlers. A log handler is
diff --git a/ndb/include/logger/Logger.hpp b/ndb/include/logger/Logger.hpp
index 2d12a5b8a6e..d4937c11744 100644
--- a/ndb/include/logger/Logger.hpp
+++ b/ndb/include/logger/Logger.hpp
@@ -17,8 +17,8 @@
#ifndef Logger_H
#define Logger_H
+#include <ndb_global.h>
#include <BaseString.hpp>
-#include <stdarg.h>
class LogHandler;
class LogHandlerList;
diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h
index c74a046b7e7..0ecb19eaa76 100644
--- a/ndb/include/mgmapi/mgmapi.h
+++ b/ndb/include/mgmapi/mgmapi.h
@@ -80,13 +80,13 @@ extern "C" {
* NDB Cluster node types
*/
enum ndb_mgm_node_type {
- NDB_MGM_NODE_TYPE_UNKNOWN = -1, ///< Node type not known
- NDB_MGM_NODE_TYPE_API = 0, ///< An application node (API)
- NDB_MGM_NODE_TYPE_NDB = 1, ///< A database node (DB)
- NDB_MGM_NODE_TYPE_MGM = 2, ///< A management server node (MGM)
+ NDB_MGM_NODE_TYPE_UNKNOWN = -1, /*/< Node type not known*/
+ NDB_MGM_NODE_TYPE_API = 0, /*/< An application node (API)*/
+ NDB_MGM_NODE_TYPE_NDB = 1, /*/< A database node (DB)*/
+ NDB_MGM_NODE_TYPE_MGM = 2, /*/< A management server node (MGM)*/
- NDB_MGM_NODE_TYPE_MIN = 0, ///< Min valid value
- NDB_MGM_NODE_TYPE_MAX = 2 ///< Max valid value
+ NDB_MGM_NODE_TYPE_MIN = 0, /*/< Min valid value*/
+ NDB_MGM_NODE_TYPE_MAX = 2 /*/< Max valid value*/
};
/**
diff --git a/ndb/include/mgmcommon/MgmtErrorReporter.hpp b/ndb/include/mgmcommon/MgmtErrorReporter.hpp
index acc44b14d8e..925d9e6407a 100644
--- a/ndb/include/mgmcommon/MgmtErrorReporter.hpp
+++ b/ndb/include/mgmcommon/MgmtErrorReporter.hpp
@@ -22,8 +22,8 @@
//******************************************************************************
+#include <ndb_global.h> // exit
#include <NdbOut.hpp>
-#include <stdlib.h> // exit
#define REPORT_WARNING(message) \
ndbout << "WARNING: " << message << endl
diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h
new file mode 100644
index 00000000000..5e03b972268
--- /dev/null
+++ b/ndb/include/ndb_global.h
@@ -0,0 +1,89 @@
+
+#ifndef NDBGLOBAL_H
+#define NDBGLOBAL_H
+
+#include <my_global.h>
+
+#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32)
+#define NDB_WIN32
+#else
+#undef NDB_WIN32
+#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
+#include <sys/param.h>
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#include <sys/resource.h>
+#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 "/"
+
+#endif
+
+#ifdef NDB_VC98
+#define STATIC_CONST(x) enum { x }
+#else
+#define STATIC_CONST(x) static const Uint32 x
+#endif
+
+#ifdef __cplusplus
+#include <new>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <assert.h>
+
+#ifndef HAVE_STRDUP
+extern char * strdup(const char *s);
+#endif
+
+#ifndef HAVE_STRLCPY
+extern size_t strlcpy (char *dst, const char *src, size_t dst_sz);
+#endif
+
+#ifndef HAVE_STRLCAT
+extern size_t strlcat (char *dst, const char *src, size_t dst_sz);
+#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
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ndb/include/ndb_net.h b/ndb/include/ndb_net.h
new file mode 100644
index 00000000000..279beb471a7
--- /dev/null
+++ b/ndb/include/ndb_net.h
@@ -0,0 +1,7 @@
+
+#ifndef NDBNET_H
+#define NDBNET_H
+
+#include <my_net.h>
+
+#endif
diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h
index 40d73b0f230..5e7b952cfc5 100644
--- a/ndb/include/ndb_types.h
+++ b/ndb/include/ndb_types.h
@@ -18,11 +18,8 @@
* @file ndb_types.h
*/
-#ifndef SYS_TYPES_H
-#define SYS_TYPES_H
-
-#include <sys/types.h>
-#include <stddef.h>
+#ifndef NDB_TYPES_H
+#define NDB_TYPES_H
typedef char Int8;
typedef unsigned char Uint8;
@@ -36,7 +33,13 @@ typedef unsigned int UintR;
#ifdef __SIZE_TYPE__
typedef __SIZE_TYPE__ UintPtr;
#else
+#include <my_config.h>
+#ifdef HAVE_STDINT_H
#include <stdint.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
typedef uintptr_t UintPtr;
#endif
diff --git a/ndb/include/ndb_version.h b/ndb/include/ndb_version.h
index 958dd339f74..9bb6af59590 100644
--- a/ndb/include/ndb_version.h
+++ b/ndb/include/ndb_version.h
@@ -17,9 +17,6 @@
#ifndef NDB_VERSION_H
#define NDB_VERSION_H
-#include <stdio.h>
-#include <string.h>
-
#include <version.h>
#define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0))
@@ -47,7 +44,7 @@
* Used by transporter and when communicating with
* managment server
*/
-//#define NDB_VERSION_ID 0
+/*#define NDB_VERSION_ID 0*/
#endif
diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp
index 59bdd212919..fd6e827ceb4 100644
--- a/ndb/include/ndbapi/Ndb.hpp
+++ b/ndb/include/ndbapi/Ndb.hpp
@@ -860,9 +860,9 @@
#include <ndb_types.h>
#include <ndbapi_limits.h>
-#include "AttrType.hpp"
+#include <AttrType.hpp>
#include <NdbError.hpp>
-#include "NdbDictionary.hpp"
+#include <NdbDictionary.hpp>
class NdbObjectIdMap;
class NdbOperation;
@@ -1673,7 +1673,7 @@ private:
*/
struct StartTransactionNodeSelectionData {
StartTransactionNodeSelectionData():
- fragment2PrimaryNodeMap(NULL) {};
+ fragment2PrimaryNodeMap(0) {};
Uint32 kValue;
Uint32 hashValueMask;
Uint32 hashpointerValue;
diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp
index a1532bb2f0e..c775dd5e33d 100644
--- a/ndb/include/ndbapi/NdbConnection.hpp
+++ b/ndb/include/ndbapi/NdbConnection.hpp
@@ -18,9 +18,8 @@
#define NdbConnection_H
#include <ndb_types.h>
-#include "AttrType.hpp"
+#include <AttrType.hpp>
#include <NdbError.hpp>
-#include <stdlib.h>
class NdbConnection;
class NdbOperation;
diff --git a/ndb/include/ndbapi/NdbError.hpp b/ndb/include/ndbapi/NdbError.hpp
index b08dd1041b2..8cde2a8cf38 100644
--- a/ndb/include/ndbapi/NdbError.hpp
+++ b/ndb/include/ndbapi/NdbError.hpp
@@ -17,6 +17,8 @@
#ifndef NDB_ERROR_HPP
#define NDB_ERROR_HPP
+#include <ndberror.h>
+
/**
* @struct NdbError
* @brief Contains error information
@@ -51,7 +53,7 @@ struct NdbError {
* The error code indicate success<br>
* (Includes classification: NdbError::NoError)
*/
- Success = 0,
+ Success = ndberror_st_success,
/**
* The error code indicates a temporary error.
@@ -61,7 +63,7 @@ struct NdbError {
* NdbError::OverloadError, NdbError::NodeShutdown
* and NdbError::TimeoutExpired.)
*/
- TemporaryError = 1,
+ TemporaryError = ndberror_st_temporary,
/**
* The error code indicates a permanent error.<br>
@@ -71,14 +73,14 @@ struct NdbError {
* NdbError::UserDefinedError, NdbError::InternalError, and,
* NdbError::FunctionNotImplemented.)
*/
- PermanentError = 2,
+ PermanentError = ndberror_st_permanent,
/**
* The result/status is unknown.<br>
* (Includes classifications: NdbError::UnknownResultError, and
* NdbError::UnknownErrorCode.)
*/
- UnknownResult = 3
+ UnknownResult = ndberror_st_unknown
};
/**
@@ -88,85 +90,85 @@ struct NdbError {
/**
* Success. No error occurred.
*/
- NoError = 0,
+ NoError = ndberror_cl_none,
/**
* Error in application program.
*/
- ApplicationError = 1,
+ ApplicationError = ndberror_cl_application,
/**
* Read operation failed due to missing record.
*/
- NoDataFound = 2,
+ NoDataFound = ndberror_cl_no_data_found,
/**
* E.g. inserting a tuple with a primary key already existing
* in the table.
*/
- ConstraintViolation = 3,
+ ConstraintViolation = ndberror_cl_constraint_violation,
/**
* Error in creating table or usage of table.
*/
- SchemaError = 4,
+ SchemaError = ndberror_cl_schema_error,
/**
* Error occurred in interpreted program.
*/
- UserDefinedError = 5,
+ UserDefinedError = ndberror_cl_user_defined,
/**
* E.g. insufficient memory for data or indexes.
*/
- InsufficientSpace = 6,
+ InsufficientSpace = ndberror_cl_insufficient_space,
/**
* E.g. too many active transactions.
*/
- TemporaryResourceError = 7,
+ TemporaryResourceError = ndberror_cl_temporary_resource,
/**
* Temporary failures which are probably inflicted by a node
* recovery in progress. Examples: information sent between
* application and NDB lost, distribution change.
*/
- NodeRecoveryError = 8,
+ NodeRecoveryError = ndberror_cl_node_recovery,
/**
* E.g. out of log file space.
*/
- OverloadError = 9,
+ OverloadError = ndberror_cl_overload,
/**
* Timeouts, often inflicted by deadlocks in NDB.
*/
- TimeoutExpired = 10,
+ TimeoutExpired = ndberror_cl_timeout_expired,
/**
* Is is unknown whether the transaction was committed or not.
*/
- UnknownResultError = 11,
+ UnknownResultError = ndberror_cl_unknown_result,
/**
* A serious error in NDB has occurred.
*/
- InternalError = 12,
+ InternalError = ndberror_cl_internal_error,
/**
* A function used is not yet implemented.
*/
- FunctionNotImplemented = 13,
+ FunctionNotImplemented = ndberror_cl_function_not_implemented,
/**
* Error handler could not determine correct error code.
*/
- UnknownErrorCode = 14,
+ UnknownErrorCode = ndberror_cl_unknown_error_code,
/**
* Node shutdown
*/
- NodeShutdown = 15
+ NodeShutdown = ndberror_cl_node_shutdown
};
/**
@@ -204,6 +206,22 @@ struct NdbError {
message = 0;
details = 0;
}
+ NdbError(const ndberror_struct & ndberror){
+ status = (NdbError::Status) ndberror.status;
+ classification = (NdbError::Classification) ndberror.classification;
+ code = ndberror.code;
+ message = ndberror.message;
+ details = ndberror.details;
+ }
+ operator ndberror_struct() const {
+ ndberror_struct ndberror;
+ ndberror.status = (ndberror_status_enum) status;
+ ndberror.classification = (ndberror_classification_enum) classification;
+ ndberror.code = code;
+ ndberror.message = message;
+ ndberror.details = details;
+ return ndberror;
+ }
};
class NdbOut& operator <<(class NdbOut&, const NdbError &);
diff --git a/ndb/include/ndbapi/NdbEventOperation.hpp b/ndb/include/ndbapi/NdbEventOperation.hpp
index 911b00b02c4..056e9a58c74 100644
--- a/ndb/include/ndbapi/NdbEventOperation.hpp
+++ b/ndb/include/ndbapi/NdbEventOperation.hpp
@@ -157,8 +157,8 @@ public:
* the attribute, or a NULL pointer
* (indicating error).
*/
- NdbRecAttr *getValue(const char *anAttrName, char *aValue = NULL);
- NdbRecAttr *getPreValue(const char *anAttrName, char *aValue = NULL);
+ NdbRecAttr *getValue(const char *anAttrName, char *aValue = 0);
+ NdbRecAttr *getPreValue(const char *anAttrName, char *aValue = 0);
/**
* Retrieves event resultset if available, inserted into the NdbRecAttrs
@@ -172,7 +172,7 @@ public:
* overflow and *pOverRun will indicate the number of events that have
* overwritten.
*/
- int next(int *pOverRun=NULL);
+ int next(int *pOverRun=0);
/**
* In the current implementation a nodefailiure may cause loss of events,
diff --git a/ndb/include/ndbapi/NdbOperation.hpp b/ndb/include/ndbapi/NdbOperation.hpp
index 4f5f4597937..3c515fe84ef 100644
--- a/ndb/include/ndbapi/NdbOperation.hpp
+++ b/ndb/include/ndbapi/NdbOperation.hpp
@@ -17,14 +17,11 @@
#ifndef NdbOperation_H
#define NdbOperation_H
-#include <stdlib.h>
-#include <assert.h>
-
#include <ndb_types.h>
-#include "AttrType.hpp"
-#include "NdbError.hpp"
-#include "NdbReceiver.hpp"
-#include <stdlib.h>
+
+#include <AttrType.hpp>
+#include <NdbError.hpp>
+#include <NdbReceiver.hpp>
class Ndb;
class NdbApiSignal;
@@ -480,8 +477,8 @@ public:
* the attribute, or a NULL pointer
* (indicating error).
*/
- NdbRecAttr* getValue(const char* anAttrName, char* aValue = NULL);
- NdbRecAttr* getValue(Uint32 anAttrId, char* aValue = NULL);
+ NdbRecAttr* getValue(const char* anAttrName, char* aValue = 0);
+ NdbRecAttr* getValue(Uint32 anAttrId, char* aValue = 0);
/**
* Define an attribute to set or update in query.
@@ -925,7 +922,7 @@ protected:
virtual int equal_impl(const NdbColumnImpl* anAttrObject,
const char* aValue,
Uint32 len);
- NdbRecAttr* getValue(const NdbColumnImpl* anAttrObject, char* aValue = NULL);
+ NdbRecAttr* getValue(const NdbColumnImpl* anAttrObject, char* aValue = 0);
int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len);
int incValue(const NdbColumnImpl* anAttrObject, Uint32 aValue);
int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue);
diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp
index a5595096bf6..7eeff88671d 100644
--- a/ndb/include/ndbapi/NdbRecAttr.hpp
+++ b/ndb/include/ndbapi/NdbRecAttr.hpp
@@ -17,9 +17,6 @@
#ifndef NdbRecAttr_H
#define NdbRecAttr_H
-#include <stdlib.h>
-
-#include <ndb_types.h>
#include <NdbDictionary.hpp>
#include "AttrType.hpp"
@@ -427,9 +424,9 @@ inline
void
NdbRecAttr::release()
{
- if (theStorageX != NULL) {
+ if (theStorageX != 0) {
delete [] theStorageX;
- theStorageX = NULL;
+ theStorageX = 0;
}
}
@@ -437,10 +434,10 @@ inline
void
NdbRecAttr::init()
{
- theStorageX = NULL;
- theValue = NULL;
- theRef = NULL;
- theNext = NULL;
+ theStorageX = 0;
+ theValue = 0;
+ theRef = 0;
+ theNext = 0;
theAttrId = 0xFFFF;
theNULLind = -1;
}
@@ -470,7 +467,7 @@ inline
bool
NdbRecAttr::copyoutRequired() const
{
- return theRef != theValue && theValue != NULL;
+ return theRef != theValue && theValue != 0;
}
inline
diff --git a/ndb/include/ndbapi/NdbReceiver.hpp b/ndb/include/ndbapi/NdbReceiver.hpp
index 952803f8e70..bc11207a112 100644
--- a/ndb/include/ndbapi/NdbReceiver.hpp
+++ b/ndb/include/ndbapi/NdbReceiver.hpp
@@ -18,7 +18,7 @@
#define NdbReceiver_H
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL // Not part of public interface
-#include <stdlib.h>
+#include <ndb_types.h>
class Ndb;
class NdbReceiver
diff --git a/ndb/include/ndbapi/NdbScanOperation.hpp b/ndb/include/ndbapi/NdbScanOperation.hpp
index e041c79d96f..f83669fb616 100644
--- a/ndb/include/ndbapi/NdbScanOperation.hpp
+++ b/ndb/include/ndbapi/NdbScanOperation.hpp
@@ -172,25 +172,6 @@ SetValueRec::SetValueRec() :
{
}
-inline
-SetValueRec::~SetValueRec()
-{
- if ((stype == SET_STRING_ATTR1) ||
- (stype == SET_INT32_ATTR1) ||
- (stype == SET_UINT32_ATTR1) ||
- (stype == SET_INT64_ATTR1) ||
- (stype == SET_UINT64_ATTR1) ||
- (stype == SET_FLOAT_ATTR1) ||
- (stype == SET_DOUBLE_ATTR1))
- free(anAttrName);
-
- if ((stype == SET_STRING_ATTR1) ||
- (stype == SET_STRING_ATTR2))
- free(stringStruct.aStringValue);
- if (next) delete next;
- next = 0;
-}
-
class SetValueRecList {
public:
SetValueRecList();
diff --git a/ndb/include/ndbapi/NdbSchemaOp.hpp b/ndb/include/ndbapi/NdbSchemaOp.hpp
index 90837bbc66b..c3a3827a6b4 100644
--- a/ndb/include/ndbapi/NdbSchemaOp.hpp
+++ b/ndb/include/ndbapi/NdbSchemaOp.hpp
@@ -18,11 +18,9 @@
#define NdbSchemaOp_H
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
-#include <ndb_types.h>
+#include "NdbDictionary.hpp"
#include "AttrType.hpp"
#include "NdbSchemaCon.hpp"
-#include <stdlib.h>
-#include "NdbDictionary.hpp"
class NdbApiSignal;
class Ndb;
diff --git a/ndb/include/ndbapi/ndberror.h b/ndb/include/ndbapi/ndberror.h
new file mode 100644
index 00000000000..5c2d85b82a6
--- /dev/null
+++ b/ndb/include/ndbapi/ndberror.h
@@ -0,0 +1,98 @@
+/* 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 NDBERROR_H
+#define NDBERROR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum
+{
+ ndberror_st_success = 0,
+ ndberror_st_temporary = 1,
+ ndberror_st_permanent = 2,
+ ndberror_st_unknown = 3
+} ndberror_status_enum;
+
+typedef enum
+{
+ ndberror_cl_none = 0,
+ ndberror_cl_application = 1,
+ ndberror_cl_no_data_found = 2,
+ ndberror_cl_constraint_violation = 3,
+ ndberror_cl_schema_error = 4,
+ ndberror_cl_user_defined = 5,
+ ndberror_cl_insufficient_space = 6,
+ ndberror_cl_temporary_resource = 7,
+ ndberror_cl_node_recovery = 8,
+ ndberror_cl_overload = 9,
+ ndberror_cl_timeout_expired = 10,
+ ndberror_cl_unknown_result = 11,
+ ndberror_cl_internal_error = 12,
+ ndberror_cl_function_not_implemented = 13,
+ ndberror_cl_unknown_error_code = 14,
+ ndberror_cl_node_shutdown = 15
+} ndberror_classification_enum;
+
+
+typedef struct {
+
+ /**
+ * Error status.
+ */
+ ndberror_status_enum status;
+
+ /**
+ * Error type
+ */
+ ndberror_classification_enum classification;
+
+ /**
+ * Error code
+ */
+ int code;
+
+ /**
+ * Error message
+ */
+ const char * message;
+
+ /**
+ * The detailed description. This is extra information regarding the
+ * error which is not included in the error message.
+ *
+ * @note Is NULL when no details specified
+ */
+ char * details;
+
+} ndberror_struct;
+
+
+typedef ndberror_status_enum ndberror_status;
+typedef ndberror_classification_enum ndberror_classification;
+
+const char *ndberror_status_message(ndberror_status);
+const char *ndberror_classification_message(ndberror_classification);
+void ndberror_update(ndberror_struct *);
+int ndb_error_string(int err_no, char *str, unsigned int size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ndb/include/newtonapi/dba.h b/ndb/include/newtonapi/dba.h
index eb5b3f9b5c2..4cfc0ec8eb9 100644
--- a/ndb/include/newtonapi/dba.h
+++ b/ndb/include/newtonapi/dba.h
@@ -102,11 +102,9 @@
/* --- Include files ---- */
+#include <ndb_global.h>
#include <defs/pcn_types.h>
-#include <stdio.h>
-
-
/* --- Types and definitions --- */
/**
diff --git a/ndb/include/newtonapi/defs/pcn_types.h b/ndb/include/newtonapi/defs/pcn_types.h
index a823846d7be..eae6c67899d 100644
--- a/ndb/include/newtonapi/defs/pcn_types.h
+++ b/ndb/include/newtonapi/defs/pcn_types.h
@@ -17,16 +17,9 @@
#ifndef PCN_TYPES_H
#define PCN_TYPES_H
-#include <stddef.h>
-#include <NdbUnistd.h>
-
-#ifdef NDB_MACOSX
-typedef unsigned int Size_t;
-#elif defined(NDB_SPARC_64)
-typedef unsigned int Size_t;
-#else
+#include <ndb_global.h>
+
typedef size_t Size_t;
-#endif
typedef int Boolean_t;
diff --git a/ndb/include/portlib/NdbMem.h b/ndb/include/portlib/NdbMem.h
index 38ad3f60448..0f2de80200e 100644
--- a/ndb/include/portlib/NdbMem.h
+++ b/ndb/include/portlib/NdbMem.h
@@ -17,8 +17,7 @@
#ifndef NDB_MEM_H
#define NDB_MEM_H
-#include <stddef.h>
-
+#include <ndb_global.h>
#ifdef __cplusplus
extern "C" {
diff --git a/ndb/include/portlib/NdbMutex.h b/ndb/include/portlib/NdbMutex.h
index d2cb6328b03..28adaacb8c4 100644
--- a/ndb/include/portlib/NdbMutex.h
+++ b/ndb/include/portlib/NdbMutex.h
@@ -17,10 +17,11 @@
#ifndef NDB_MUTEX_H
#define NDB_MUTEX_H
+#include <ndb_global.h>
+
#ifdef NDB_WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
-#include <windows.h>
#endif
#ifdef __cplusplus
diff --git a/ndb/include/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h
index 6e2f18b61b2..42c34855c39 100644
--- a/ndb/include/portlib/NdbTCP.h
+++ b/ndb/include/portlib/NdbTCP.h
@@ -17,6 +17,9 @@
#ifndef NDB_TCP_H
#define NDB_TCP_H
+#include <ndb_global.h>
+#include <ndb_net.h>
+
#if defined NDB_OSE || defined NDB_SOFTOSE
/**
* Include files needed
@@ -24,7 +27,6 @@
#include "inet.h"
#include <netdb.h>
-#include <errno.h>
#define NDB_NONBLOCK FNDELAY
#define NDB_SOCKET_TYPE int
@@ -38,47 +40,26 @@ typedef int socklen_t;
#define InetErrno (* inet_errno())
-#endif
+#elif NDB_WIN32
-#if defined NDB_SOLARIS || defined NDB_HPUX || defined NDB_IBMAIX || defined NDB_TRU64X
/**
* Include files needed
*/
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-
-#include <netdb.h>
-#include <errno.h>
-#include <fcntl.h>
-
-#define NDB_NONBLOCK O_NONBLOCK
-#define NDB_SOCKET_TYPE int
-#define NDB_INVALID_SOCKET -1
-#define NDB_CLOSE_SOCKET(x) close(x)
+#include <winsock2.h>
+#include <ws2tcpip.h>
-#define InetErrno errno
+#define InetErrno WSAGetLastError()
+#define EWOULDBLOCK WSAEWOULDBLOCK
+#define NDB_SOCKET_TYPE SOCKET
+#define NDB_INVALID_SOCKET INVALID_SOCKET
+#define NDB_CLOSE_SOCKET(x) closesocket(x)
-#endif
+#else
-#if defined NDB_LINUX || defined NDB_MACOSX
/**
* Include files needed
*/
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-
#include <netdb.h>
-#include <errno.h>
-#include <fcntl.h>
#define NDB_NONBLOCK O_NONBLOCK
#define NDB_SOCKET_TYPE int
@@ -89,29 +70,7 @@ typedef int socklen_t;
#endif
-
-#ifdef NDB_WIN32
-/**
- * Include files needed
- */
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <errno.h>
-
-#define InetErrno WSAGetLastError()
-#define EWOULDBLOCK WSAEWOULDBLOCK
-#define NDB_SOCKET_TYPE SOCKET
-#define NDB_INVALID_SOCKET INVALID_SOCKET
-#define NDB_CLOSE_SOCKET(x) closesocket(x)
-
-#endif
-
-#ifndef NDB_MACOSX
-#define NDB_SOCKLEN_T socklen_t
-#else
-#define NDB_SOCKLEN_T int
-#endif
-
+#define NDB_SOCKLEN_T SOCKET_SIZE_TYPE
#ifdef __cplusplus
extern "C" {
diff --git a/ndb/include/portlib/NdbThread.h b/ndb/include/portlib/NdbThread.h
index 516022903e3..212f7de9384 100644
--- a/ndb/include/portlib/NdbThread.h
+++ b/ndb/include/portlib/NdbThread.h
@@ -17,8 +17,7 @@
#ifndef NDB_THREAD_H
#define NDB_THREAD_H
-#include <sys/types.h>
-
+#include <ndb_global.h>
#ifdef __cplusplus
extern "C" {
diff --git a/ndb/include/portlib/NdbTick.h b/ndb/include/portlib/NdbTick.h
index 762f65331cc..9bd8eca22bd 100644
--- a/ndb/include/portlib/NdbTick.h
+++ b/ndb/include/portlib/NdbTick.h
@@ -42,7 +42,7 @@ NDB_TICKS NdbTick_CurrentMillisecond(void);
*/
int NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros);
-//#define TIME_MEASUREMENT
+ /*#define TIME_MEASUREMENT*/
#ifdef TIME_MEASUREMENT
struct MicroSecondTimer {
diff --git a/ndb/include/portlib/NdbUnistd.h b/ndb/include/portlib/NdbUnistd.h
deleted file mode 100644
index 42f67e2aeb3..00000000000
--- a/ndb/include/portlib/NdbUnistd.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 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_UNISTD_H
-#define NDB_UNISTD_H
-
-#ifdef NDB_WIN32
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <windows.h>
-#include <limits.h>
-
-#define DIR_SEPARATOR "\\"
-#define PATH_MAX 256
-
-#pragma warning(disable: 4503 4786)
-
-#else
-#include <unistd.h>
-#include <limits.h>
-
-#define DIR_SEPARATOR "/"
-
-#endif
-
-#endif
diff --git a/ndb/include/transporter/TransporterDefinitions.hpp b/ndb/include/transporter/TransporterDefinitions.hpp
index 5bbf7c79491..cb859e310db 100644
--- a/ndb/include/transporter/TransporterDefinitions.hpp
+++ b/ndb/include/transporter/TransporterDefinitions.hpp
@@ -17,8 +17,8 @@
#ifndef TransporterDefinitions_H
#define TransporterDefinitions_H
+#include <ndb_global.h>
#include <kernel_types.h>
-#include <string.h>
#include <NdbOut.hpp>
/**
diff --git a/ndb/include/util/BaseString.hpp b/ndb/include/util/BaseString.hpp
index a88bd97ffc5..75a1c291594 100644
--- a/ndb/include/util/BaseString.hpp
+++ b/ndb/include/util/BaseString.hpp
@@ -17,9 +17,7 @@
#ifndef __UTIL_BASESTRING_HPP_INCLUDED__
#define __UTIL_BASESTRING_HPP_INCLUDED__
-#include <ctype.h>
-#include <stdlib.h>
-
+#include <ndb_global.h>
#include <Vector.hpp>
/**
diff --git a/ndb/include/util/Bitmask.hpp b/ndb/include/util/Bitmask.hpp
index 1f95d62bcb6..ed981743512 100644
--- a/ndb/include/util/Bitmask.hpp
+++ b/ndb/include/util/Bitmask.hpp
@@ -17,12 +17,9 @@
#ifndef NDB_BITMASK_H
#define NDB_BITMASK_H
-#include <ndb_types.h>
-#include <NdbConstant.hpp>
+#include <ndb_global.h>
#ifndef NDB_ASSERT
-#include <stdio.h>
-#include <stdlib.h>
#define NDB_ASSERT(x, s) \
do { if (!(x)) { printf("%s\n", s); abort(); } } while (0)
#endif
diff --git a/ndb/include/util/File.hpp b/ndb/include/util/File.hpp
index fe3d2642b18..3ed0ad7a6f9 100644
--- a/ndb/include/util/File.hpp
+++ b/ndb/include/util/File.hpp
@@ -17,8 +17,7 @@
#ifndef FILE_H
#define FILE_H
-#include <NdbStdio.h>
-#include <NdbConstant.hpp>
+#include <ndb_global.h>
/**
* This class provides a file abstraction . It has operations
@@ -26,7 +25,7 @@
*
* @version #@ $Id: File.hpp,v 1.5 2002/04/26 13:15:38 ejonore Exp $
*/
-class File
+class File_class
{
public:
/**
@@ -65,7 +64,7 @@ public:
/**
* Default constructor.
*/
- File();
+ File_class();
/**
* Creates a new File with the specified filename and file mode.
@@ -76,12 +75,12 @@ public:
* @param aFileName a filename.
* @param mode the mode which the file should be opened/created with, default "r".
*/
- File(const char* aFileName, const char* mode = "r");
+ File_class(const char* aFileName, const char* mode = "r");
/**
* Destructor.
*/
- ~File();
+ ~File_class();
/**
* Opens/creates the file. If open() fails then 'errno' and perror()
@@ -198,9 +197,9 @@ private:
char m_fileName[MAX_FILE_NAME_SIZE];
const char* m_fileMode;
/* Prohibit */
- File(const File& aCopy);
- File operator = (const File&);
- bool operator == (const File&);
+ File_class (const File_class& aCopy);
+ File_class operator = (const File_class&);
+ bool operator == (const File_class&);
};
#endif
diff --git a/ndb/include/util/InputStream.hpp b/ndb/include/util/InputStream.hpp
index 6b4cf262db4..b2a56b1e433 100644
--- a/ndb/include/util/InputStream.hpp
+++ b/ndb/include/util/InputStream.hpp
@@ -17,7 +17,7 @@
#ifndef INPUT_STREAM_HPP
#define INPUT_STREAM_HPP
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbTCP.h>
/**
diff --git a/ndb/include/util/NdbAutoPtr.hpp b/ndb/include/util/NdbAutoPtr.hpp
index 2078714d98d..c01650ffc7e 100644
--- a/ndb/include/util/NdbAutoPtr.hpp
+++ b/ndb/include/util/NdbAutoPtr.hpp
@@ -17,7 +17,7 @@
#ifndef __NDB_AUTO_PTR_HPP
#define __NDB_AUTO_PTR_HPP
-#include <stdlib.h>
+#include <ndb_global.h>
template<typename T>
class NdbAutoPtr {
diff --git a/ndb/include/util/NdbString.h b/ndb/include/util/NdbString.h
deleted file mode 100644
index 97646f813ac..00000000000
--- a/ndb/include/util/NdbString.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* 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 __NDBSTRING_H_INCLUDED__
-#define __NDBSTRING_H_INCLUDED__
-
-#include <sys/types.h>
-#include <string.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef HAVE_STRDUP
-extern char * strdup(const char *s);
-#endif
-
-#ifndef HAVE_STRLCPY
-extern size_t strlcpy (char *dst, const char *src, size_t dst_sz);
-#endif
-
-#ifndef HAVE_STRLCAT
-extern size_t strlcat (char *dst, const char *src, size_t dst_sz);
-#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
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !__NDBSTRING_H_INCLUDED__ */
diff --git a/ndb/include/util/OutputStream.hpp b/ndb/include/util/OutputStream.hpp
index 9d33ead7eb9..c7e009d4537 100644
--- a/ndb/include/util/OutputStream.hpp
+++ b/ndb/include/util/OutputStream.hpp
@@ -17,7 +17,7 @@
#ifndef OUTPUT_STREAM_HPP
#define OUTPUT_STREAM_HPP
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbTCP.h>
/**
diff --git a/ndb/include/util/Properties.hpp b/ndb/include/util/Properties.hpp
index dbdc5f2b480..ff5d1338c79 100644
--- a/ndb/include/util/Properties.hpp
+++ b/ndb/include/util/Properties.hpp
@@ -17,10 +17,7 @@
#ifndef PROPERTIES_HPP
#define PROPERTIES_HPP
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ndb_types.h>
+#include <ndb_global.h>
#include <BaseString.hpp>
#include <UtilBuffer.hpp>
diff --git a/ndb/include/util/SimpleProperties.hpp b/ndb/include/util/SimpleProperties.hpp
index 37e28ea91d8..d5ebb16bb09 100644
--- a/ndb/include/util/SimpleProperties.hpp
+++ b/ndb/include/util/SimpleProperties.hpp
@@ -17,8 +17,7 @@
#ifndef SIMPLE_PROPERTIES_HPP
#define SIMPLE_PROPERTIES_HPP
-#include <ndb_types.h>
-#include <stddef.h> // offsetof
+#include <ndb_global.h>
#include <NdbOut.hpp>
/**
diff --git a/ndb/include/util/UtilBuffer.hpp b/ndb/include/util/UtilBuffer.hpp
index 97821ee3f9b..b357fa0fdf2 100644
--- a/ndb/include/util/UtilBuffer.hpp
+++ b/ndb/include/util/UtilBuffer.hpp
@@ -17,9 +17,7 @@
#ifndef __BUFFER_HPP_INCLUDED__
#define __BUFFER_HPP_INCLUDED__
-#include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
+#include <ndb_global.h>
/* This class represents a buffer of binary data, where you can append
* data at the end, and later read the entire bunch.
diff --git a/ndb/include/util/Vector.hpp b/ndb/include/util/Vector.hpp
index a717dfecd7e..f60817dab67 100644
--- a/ndb/include/util/Vector.hpp
+++ b/ndb/include/util/Vector.hpp
@@ -17,9 +17,8 @@
#ifndef NDB_VECTOR_HPP
#define NDB_VECTOR_HPP
-#include <stdlib.h>
+#include <ndb_global.h>
#include <NdbMutex.h>
-#include <string.h>
template<class T>
struct Vector {
diff --git a/ndb/include/util/getarg.h b/ndb/include/util/getarg.h
index 713cf6e4b32..03ed25f6828 100644
--- a/ndb/include/util/getarg.h
+++ b/ndb/include/util/getarg.h
@@ -52,7 +52,7 @@
#ifndef __GETARG_H__
#define __GETARG_H__
-#include <stddef.h>
+#include <ndb_global.h>
#ifdef __cplusplus
extern "C" {
diff --git a/ndb/include/util/socket_io.h b/ndb/include/util/socket_io.h
index bbd1bf115ae..a0e6c4e369d 100644
--- a/ndb/include/util/socket_io.h
+++ b/ndb/include/util/socket_io.h
@@ -17,8 +17,9 @@
#ifndef _SOCKET_IO_H
#define _SOCKET_IO_H
+#include <ndb_global.h>
+
#include <NdbTCP.h>
-#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
diff --git a/ndb/include/util/uucode.h b/ndb/include/util/uucode.h
index 138a79fa3ae..f5569d033a5 100644
--- a/ndb/include/util/uucode.h
+++ b/ndb/include/util/uucode.h
@@ -17,7 +17,7 @@
#ifndef UUCODE_H
#define UUCODE_H
-#include <stdio.h>
+#include <ndb_global.h>
#ifdef __cplusplus
extern "C" {
diff --git a/ndb/src/client/odbc/common/Ctx.cpp b/ndb/src/client/odbc/common/Ctx.cpp
index 85edbd1a63f..44689657788 100644
--- a/ndb/src/client/odbc/common/Ctx.cpp
+++ b/ndb/src/client/odbc/common/Ctx.cpp
@@ -14,11 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbUnistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <NdbStdio.h>
-#include <stdarg.h>
+#include <ndb_global.h>
#include <NdbApi.hpp>
#include <common/common.hpp>
#include "DiagArea.hpp"
diff --git a/ndb/src/client/odbc/common/DataField.cpp b/ndb/src/client/odbc/common/DataField.cpp
index 5853f90c08f..dfd4137ffd9 100644
--- a/ndb/src/client/odbc/common/DataField.cpp
+++ b/ndb/src/client/odbc/common/DataField.cpp
@@ -14,14 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbUnistd.h>
-#include <NdbStdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <limits.h>
-#include <math.h>
+#include <ndb_global.h>
#include "DataField.hpp"
-#include <time.h>
#ifndef INT_MAX
#define INT_MAX (2147483647)
diff --git a/ndb/src/client/odbc/common/DataType.cpp b/ndb/src/client/odbc/common/DataType.cpp
index 62bd622b9b5..9c9629f1d24 100644
--- a/ndb/src/client/odbc/common/DataType.cpp
+++ b/ndb/src/client/odbc/common/DataType.cpp
@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "DataType.hpp"
-#include <NdbStdio.h>
// SqlType
diff --git a/ndb/src/client/odbc/common/OdbcData.cpp b/ndb/src/client/odbc/common/OdbcData.cpp
index d2402c7e0ab..2e1bd768aec 100644
--- a/ndb/src/client/odbc/common/OdbcData.cpp
+++ b/ndb/src/client/odbc/common/OdbcData.cpp
@@ -14,9 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <new>
-#include <string.h>
-#include <NdbStdio.h>
+#include <ndb_global.h>
#include "OdbcData.hpp"
OdbcData::OdbcData() :
diff --git a/ndb/src/common/debugger/DebuggerNames.cpp b/ndb/src/common/debugger/DebuggerNames.cpp
index fdee978ab54..ebe94a6059f 100644
--- a/ndb/src/common/debugger/DebuggerNames.cpp
+++ b/ndb/src/common/debugger/DebuggerNames.cpp
@@ -14,16 +14,14 @@
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 "DebuggerNames.hpp"
#include <BlockNumbers.h>
#include <GlobalSignalNumbers.h>
#include <signaldata/SignalDataPrint.hpp>
-#include <NdbStdio.h>
-#include <stdlib.h>
-#include <string.h>
-
static const char * localSignalNames[MAX_GSN+1];
static SignalDataPrintFunction localPrintFunctions[MAX_GSN+1];
static const char * localBlockNames[NO_OF_BLOCKS];
diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp
index 12f01890c54..dd957d67383 100644
--- a/ndb/src/common/debugger/EventLogger.cpp
+++ b/ndb/src/common/debugger/EventLogger.cpp
@@ -14,6 +14,8 @@
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 "EventLogger.hpp"
#include <NdbConfig.h>
@@ -22,10 +24,6 @@
#include <GrepEvent.hpp>
#include <NodeState.hpp>
#include <version.h>
-#include <NdbStdio.h>
-
-#include <string.h>
-#include <ctype.h>
//
// PUBLIC
diff --git a/ndb/src/common/debugger/SignalLoggerManager.cpp b/ndb/src/common/debugger/SignalLoggerManager.cpp
index ae6edd5ed71..3839a348222 100644
--- a/ndb/src/common/debugger/SignalLoggerManager.cpp
+++ b/ndb/src/common/debugger/SignalLoggerManager.cpp
@@ -14,15 +14,11 @@
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 "SignalLoggerManager.hpp"
#include <LongSignal.hpp>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <time.h>
-#include <NdbString.h>
-
#include <DebuggerNames.hpp>
SignalLoggerManager::SignalLoggerManager()
diff --git a/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp b/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp
index 11ee0948c17..84410a2b2db 100644
--- a/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp
+++ b/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp
@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
#include <kernel_types.h>
#include <BlockNumbers.h>
#include <signaldata/CloseComReqConf.hpp>
diff --git a/ndb/src/common/debugger/signaldata/ContinueB.cpp b/ndb/src/common/debugger/signaldata/ContinueB.cpp
index 054909d961e..1be6da86cb1 100644
--- a/ndb/src/common/debugger/signaldata/ContinueB.cpp
+++ b/ndb/src/common/debugger/signaldata/ContinueB.cpp
@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
#include <kernel_types.h>
#include <BlockNumbers.h>
#include <signaldata/DihContinueB.hpp>
diff --git a/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp b/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp
index 6685345f17a..027f743b5ea 100644
--- a/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp
+++ b/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp
@@ -26,7 +26,7 @@ printCREATE_FRAGMENTATION_REQ(FILE * output, const Uint32 * theData,
fprintf(output, " noOfFragments: %x\n", sig->noOfFragments);
fprintf(output, " fragmentNode: %x\n", sig->fragmentNode);
if (sig->primaryTableId == RNIL)
- fprintf(output, " primaryTableId: none\n", sig->primaryTableId);
+ fprintf(output, " primaryTableId: none\n");
else
fprintf(output, " primaryTableId: %x\n", sig->primaryTableId);
return true;
diff --git a/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp b/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp
index f3b4b97f0fd..2e900de8f70 100644
--- a/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp
+++ b/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp
@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
#include <kernel_types.h>
#include <BlockNumbers.h>
#include <signaldata/PrepFailReqRef.hpp>
diff --git a/ndb/src/common/debugger/signaldata/SystemError.cpp b/ndb/src/common/debugger/signaldata/SystemError.cpp
index 5ed7dc6b18d..549c34710a0 100644
--- a/ndb/src/common/debugger/signaldata/SystemError.cpp
+++ b/ndb/src/common/debugger/signaldata/SystemError.cpp
@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
#include <kernel_types.h>
#include <BlockNumbers.h>
#include <signaldata/SystemError.hpp>
diff --git a/ndb/src/common/editline/editline.c b/ndb/src/common/editline/editline.c
index 0529d18b952..1e4c1ecba76 100644
--- a/ndb/src/common/editline/editline.c
+++ b/ndb/src/common/editline/editline.c
@@ -19,10 +19,10 @@
**
** Main editing routines for editline library.
*/
+#include <ndb_global.h>
+
#include "editline_internal.h"
#include <signal.h>
-#include <ctype.h>
-#include <unistd.h>
/*
** Manifest constants.
diff --git a/ndb/src/common/editline/editline_internal.h b/ndb/src/common/editline/editline_internal.h
index 93c13e55edc..5ed2b32a873 100644
--- a/ndb/src/common/editline/editline_internal.h
+++ b/ndb/src/common/editline/editline_internal.h
@@ -19,9 +19,8 @@
** Internal header file for editline library.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <ndb_global.h>
+
#if defined(SYS_UNIX)
#include "unix.h"
#endif /* defined(SYS_UNIX) */
diff --git a/ndb/src/common/editline/editline_win32.c b/ndb/src/common/editline/editline_win32.c
index feef0108523..5083edb7fae 100644
--- a/ndb/src/common/editline/editline_win32.c
+++ b/ndb/src/common/editline/editline_win32.c
@@ -15,8 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <malloc.h>
+#include <ndb_global.h>
char* readline(const char* prompt)
diff --git a/ndb/src/common/editline/test/testit.c b/ndb/src/common/editline/test/testit.c
index 9a7dfb7bbdf..4058f8ae660 100644
--- a/ndb/src/common/editline/test/testit.c
+++ b/ndb/src/common/editline/test/testit.c
@@ -20,11 +20,7 @@
** A "micro-shell" to test editline library.
** If given any arguments, commands aren't executed.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <NdbString.h>
+#include <ndb_global.h>
#include <editline/editline.h>
int
diff --git a/ndb/src/common/editline/unix.h b/ndb/src/common/editline/unix.h
index 582c4888856..37f461b471d 100644
--- a/ndb/src/common/editline/unix.h
+++ b/ndb/src/common/editline/unix.h
@@ -21,6 +21,5 @@
#define CRLF "\r\n"
-#include <sys/types.h>
-#include <sys/stat.h>
+#include <ndb_global.h>
#include <dirent.h>
diff --git a/ndb/src/common/logger/FileLogHandler.cpp b/ndb/src/common/logger/FileLogHandler.cpp
index f3d547b4fe7..d13dd7b2a78 100644
--- a/ndb/src/common/logger/FileLogHandler.cpp
+++ b/ndb/src/common/logger/FileLogHandler.cpp
@@ -14,16 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "FileLogHandler.hpp"
+#include <FileLogHandler.hpp>
#include <File.hpp>
-#include <NdbStdio.h>
-#include <sys/param.h>
-
-#include <errno.h>
-#include <string.h>
-
//
// PUBLIC
//
@@ -35,7 +29,7 @@ FileLogHandler::FileLogHandler() :
m_maxLogEntries(MAX_LOG_ENTRIES)
{
- m_pLogFile = new File("logger.log", "a+");
+ m_pLogFile = new File_class("logger.log", "a+");
}
FileLogHandler::FileLogHandler(const char* aFileName,
@@ -47,7 +41,7 @@ FileLogHandler::FileLogHandler(const char* aFileName,
m_maxFileSize(maxFileSize),
m_maxLogEntries(maxLogEntries)
{
- m_pLogFile = new File(aFileName, "a+");
+ m_pLogFile = new File_class(aFileName, "a+");
}
FileLogHandler::~FileLogHandler()
@@ -166,10 +160,10 @@ FileLogHandler::createNewFile()
::snprintf(newName, sizeof(newName),
"%s.%d", m_pLogFile->getName(), fileNo++);
- } while (File::exists(newName));
+ } while (File_class::exists(newName));
m_pLogFile->close();
- if (!File::rename(m_pLogFile->getName(), newName))
+ if (!File_class::rename(m_pLogFile->getName(), newName))
{
setErrorCode(errno);
rc = false;
@@ -201,7 +195,7 @@ FileLogHandler::setFilename(const BaseString &filename) {
close();
if(m_pLogFile)
delete m_pLogFile;
- m_pLogFile = new File(filename.c_str(), "a+");
+ m_pLogFile = new File_class(filename.c_str(), "a+");
open();
return true;
};
diff --git a/ndb/src/common/logger/LogHandler.cpp b/ndb/src/common/logger/LogHandler.cpp
index d1445555e87..83d479c82fd 100644
--- a/ndb/src/common/logger/LogHandler.cpp
+++ b/ndb/src/common/logger/LogHandler.cpp
@@ -17,9 +17,6 @@
#include "LogHandler.hpp"
#include <NdbTick.h>
-#include <NdbString.h>
-
-#include <time.h>
//
// PUBLIC
diff --git a/ndb/src/common/logger/LogHandlerList.cpp b/ndb/src/common/logger/LogHandlerList.cpp
index f020ad23e56..62495d7566b 100644
--- a/ndb/src/common/logger/LogHandlerList.cpp
+++ b/ndb/src/common/logger/LogHandlerList.cpp
@@ -17,8 +17,6 @@
#include "LogHandlerList.hpp"
#include <LogHandler.hpp>
-#include <NdbStdio.h>
-#include <ndb_types.h>
//
// PUBLIC
diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp
index 6eaafd91854..9c9f1eece18 100644
--- a/ndb/src/common/logger/Logger.cpp
+++ b/ndb/src/common/logger/Logger.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdarg.h>
+#include <ndb_global.h>
#include "Logger.hpp"
@@ -27,12 +27,6 @@
#include <SysLogHandler.hpp>
#endif
-#include <NdbStdio.h>
-#include <ndb_types.h>
-#include <NdbString.h>
-
-#include <assert.h>
-
//
// PUBLIC
//
diff --git a/ndb/src/common/logger/SysLogHandler.cpp b/ndb/src/common/logger/SysLogHandler.cpp
index f3511bf5638..a300c487eb9 100644
--- a/ndb/src/common/logger/SysLogHandler.cpp
+++ b/ndb/src/common/logger/SysLogHandler.cpp
@@ -17,7 +17,6 @@
#include "SysLogHandler.hpp"
#include <syslog.h>
-#include <NdbString.h>
//
// PUBLIC
diff --git a/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp b/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp
index 22f67d15659..44ee11717b4 100644
--- a/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp
+++ b/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp
@@ -14,6 +14,8 @@
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 "LogHandlerListUnitTest.hpp"
#include <ConsoleLogHandler.hpp>
@@ -22,9 +24,6 @@
#include <NdbOut.hpp>
-#include <stdio.h>
-#include <assert.h>
-
typedef bool (*TESTFUNC)(const char*);
typedef struct
{
diff --git a/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp b/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp
index 4b0241a0b03..017dcb79c1f 100644
--- a/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp
+++ b/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp
@@ -25,12 +25,8 @@
#endif
#include <NdbOut.hpp>
-#include <NdbStdio.h>
#include <NdbMain.h>
-#include <string.h>
-#include <assert.h>
-
typedef bool (*TESTFUNC)(const char*);
typedef struct
{
diff --git a/ndb/src/common/mgmcommon/Config.hpp b/ndb/src/common/mgmcommon/Config.hpp
index 1314abe004a..284256d9ed6 100644
--- a/ndb/src/common/mgmcommon/Config.hpp
+++ b/ndb/src/common/mgmcommon/Config.hpp
@@ -23,9 +23,7 @@
#include <kernel_types.h>
#include <NdbOut.hpp>
-#include <NdbStdio.h>
#include <ndb_limits.h>
-#include <NdbConstant.hpp>
#include <Properties.hpp>
/**
diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp
index a3f26454df6..04dc5466bbc 100644
--- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp
+++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp
@@ -14,6 +14,9 @@
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 <ndb_version.h>
+
#include <ConfigRetriever.hpp>
#include "LocalConfig.hpp"
@@ -21,21 +24,15 @@
#include <NdbOut.hpp>
#include <NdbTCP.h>
-#include <string.h>
-#include <NdbStdio.h>
#include <NdbEnv.h>
#include "MgmtErrorReporter.hpp"
#include <uucode.h>
#include <Properties.hpp>
-#include <stdio.h>
-#include <NdbString.h>
-#include <sys/stat.h>
#include <socket_io.h>
#include <NdbConfig.h>
-#include <ndb_version.h>
//****************************************************************************
//****************************************************************************
diff --git a/ndb/src/common/mgmcommon/InitConfigFileParser.cpp b/ndb/src/common/mgmcommon/InitConfigFileParser.cpp
index 33652fa472c..62c4bd28857 100644
--- a/ndb/src/common/mgmcommon/InitConfigFileParser.cpp
+++ b/ndb/src/common/mgmcommon/InitConfigFileParser.cpp
@@ -14,16 +14,13 @@
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 "InitConfigFileParser.hpp"
-#include <string.h>
-#include <errno.h>
#include "Config.hpp"
#include "MgmtErrorReporter.hpp"
#include <NdbOut.hpp>
#include "ConfigInfo.hpp"
-#include <stdarg.h>
-#include <ctype.h>
-#include <NdbString.h>
const int MAX_LINE_LENGTH = 120; // Max length of line of text in config file
static void trim(char *);
diff --git a/ndb/src/common/mgmcommon/InitConfigFileParser.hpp b/ndb/src/common/mgmcommon/InitConfigFileParser.hpp
index 1e85067396c..f4f27abb055 100644
--- a/ndb/src/common/mgmcommon/InitConfigFileParser.hpp
+++ b/ndb/src/common/mgmcommon/InitConfigFileParser.hpp
@@ -17,7 +17,8 @@
#ifndef InitConfigFileParser_H
#define InitConfigFileParser_H
-#include <stdio.h>
+#include <ndb_global.h>
+
#include <Properties.hpp>
class Config;
diff --git a/ndb/src/common/mgmcommon/LocalConfig.hpp b/ndb/src/common/mgmcommon/LocalConfig.hpp
index ec7b572e92d..eb676bf9bed 100644
--- a/ndb/src/common/mgmcommon/LocalConfig.hpp
+++ b/ndb/src/common/mgmcommon/LocalConfig.hpp
@@ -17,10 +17,8 @@
#ifndef LocalConfig_H
#define LocalConfig_H
-#include <stdlib.h>
-#include <string.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
-#include <NdbStdio.h>
//****************************************************************************
// Description: The class LocalConfig corresponds to the information possible
diff --git a/ndb/src/common/mgmcommon/NdbConfig.c b/ndb/src/common/mgmcommon/NdbConfig.c
index b12d9fcfaf9..827ef34a840 100644
--- a/ndb/src/common/mgmcommon/NdbConfig.c
+++ b/ndb/src/common/mgmcommon/NdbConfig.c
@@ -14,10 +14,9 @@
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 <NdbConfig.h>
#include <NdbEnv.h>
-#include <stdlib.h>
-#include <string.h>
const char*
NdbConfig_HomePath(char* buf, int buflen){
diff --git a/ndb/src/common/mgmcommon/printConfig/printConfig.cpp b/ndb/src/common/mgmcommon/printConfig/printConfig.cpp
index 7260a84ce7a..daa287cc44d 100644
--- a/ndb/src/common/mgmcommon/printConfig/printConfig.cpp
+++ b/ndb/src/common/mgmcommon/printConfig/printConfig.cpp
@@ -15,10 +15,11 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <NdbMain.h>
#include <ConfigRetriever.hpp>
#include <Properties.hpp>
-#include <stdlib.h>
#include <NdbOut.hpp>
void usage(const char * prg){
diff --git a/ndb/src/common/portlib/Makefile b/ndb/src/common/portlib/Makefile
index a928fc1e6d7..48f4929a839 100644
--- a/ndb/src/common/portlib/Makefile
+++ b/ndb/src/common/portlib/Makefile
@@ -4,38 +4,16 @@ DIRS :=
ifeq ($(NDB_OS), SOFTOSE)
DIRS += ose
-endif
-
+else
ifeq ($(NDB_OS), OSE)
DIRS += ose
-endif
-
-ifeq ($(NDB_OS), SIMCELLO)
-DIRS += ose
-endif
-
-ifeq ($(NDB_OS), LINUX)
-DIRS += unix
-endif
-
-ifeq ($(NDB_OS), MACOSX)
-DIRS += unix
-endif
-
-ifeq ($(NDB_OS), SOLARIS)
+else
+ifeq ($(NDB_OS), WIN32)
+DIRS += win32
+else
DIRS += unix
endif
-
-ifeq ($(NDB_OS), SOLARIS6)
-DIRS += unix
endif
-
-ifeq ($(NDB_OS), HPUX)
-DIRS += unix
-endif
-
-ifeq ($(NDB_OS), WIN32)
-DIRS += win32
endif
diff --git a/ndb/src/common/portlib/memtest/memtest.c b/ndb/src/common/portlib/memtest/memtest.c
index d23235b7aa2..059a4ec025e 100644
--- a/ndb/src/common/portlib/memtest/memtest.c
+++ b/ndb/src/common/portlib/memtest/memtest.c
@@ -16,10 +16,8 @@
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <sys/mman.h>
+#include <ndb_global.h>
+
long long getMilli();
long long getMicro();
void malloctest(int loopcount, int memsize, int touch);
diff --git a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp b/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp
index 9e396cd98ee..b1d84131810 100644
--- a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp
+++ b/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp
@@ -17,6 +17,8 @@
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbThread.h>
#include <NdbMutex.h>
@@ -27,13 +29,6 @@
#include <NdbHost.h>
#include <NdbMain.h>
#include <getarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/mman.h>
-
struct ThreadData
{
diff --git a/ndb/src/common/portlib/mmstest/mmslist.cpp b/ndb/src/common/portlib/mmstest/mmslist.cpp
index bd00211445c..05538785293 100644
--- a/ndb/src/common/portlib/mmstest/mmslist.cpp
+++ b/ndb/src/common/portlib/mmstest/mmslist.cpp
@@ -14,14 +14,14 @@
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_common.h>
+
#include <NdbOut.hpp>
#include <NdbMain.h>
#include <ose.h>
#include <mms.sig>
#include <mms_err.h>
-#include <string.h>
-#include <stdio.h>
#include <NdbOut.hpp>
/**
diff --git a/ndb/src/common/portlib/mmstest/mmstest.cpp b/ndb/src/common/portlib/mmstest/mmstest.cpp
index 6ebb5064aaf..9cc7d810985 100644
--- a/ndb/src/common/portlib/mmstest/mmstest.cpp
+++ b/ndb/src/common/portlib/mmstest/mmstest.cpp
@@ -14,13 +14,13 @@
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 <NdbOut.hpp>
#include "NdbThread.h"
#include <NdbMem.h>
#include <NdbMain.h>
-#include <stdlib.h>
-
NDB_COMMAND(ndbmem, "ndbmem", "ndbmem", "Test the ndbmem functionality", 4096){
ndbout << "Starting test of NdbMem" << endl;
diff --git a/ndb/src/common/portlib/ose/NdbCondition.c b/ndb/src/common/portlib/ose/NdbCondition.c
index 2ab6e49006b..73a2dbc5d66 100644
--- a/ndb/src/common/portlib/ose/NdbCondition.c
+++ b/ndb/src/common/portlib/ose/NdbCondition.c
@@ -17,7 +17,6 @@
#include "NdbCondition.h"
#include <pthread.h>
-#include <assert.h>
#include <sys/types.h>
#include <malloc.h>
diff --git a/ndb/src/common/portlib/ose/NdbMem.c b/ndb/src/common/portlib/ose/NdbMem.c
index 6d922e4c073..0e38024bbb4 100644
--- a/ndb/src/common/portlib/ose/NdbMem.c
+++ b/ndb/src/common/portlib/ose/NdbMem.c
@@ -17,7 +17,6 @@
#include "NdbMem.h"
-#include <assert.h>
#if defined NDB_OSE
#include <ose.h>
@@ -134,7 +133,6 @@ int NdbMem_MemUnlockAll(){
}
#else
-#include <assert.h>
#include <stdlib.h>
diff --git a/ndb/src/common/portlib/ose/NdbMutex.c b/ndb/src/common/portlib/ose/NdbMutex.c
index 859ddefd536..253c0e412ff 100644
--- a/ndb/src/common/portlib/ose/NdbMutex.c
+++ b/ndb/src/common/portlib/ose/NdbMutex.c
@@ -19,7 +19,6 @@
#include <pthread.h>
#include <stdlib.h>
-#include <assert.h>
NdbMutex* NdbMutex_Create(void)
diff --git a/ndb/src/common/portlib/ose/NdbOut.cpp b/ndb/src/common/portlib/ose/NdbOut.cpp
index 0ee12249ff5..eb81bc9d971 100644
--- a/ndb/src/common/portlib/ose/NdbOut.cpp
+++ b/ndb/src/common/portlib/ose/NdbOut.cpp
@@ -14,12 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NdbOut.hpp"
-#include <NdbStdio.h>
-#include <stdarg.h>
-#include <NdbUnistd.h>
-#include <string.h>
+#include <ndb_global.h>
+#include "NdbOut.hpp"
#if defined NDB_SOFTOSE
#include <dbgprintf.h>
diff --git a/ndb/src/common/portlib/ose/NdbThread.c b/ndb/src/common/portlib/ose/NdbThread.c
index 41a5f181c40..e46903a5cce 100644
--- a/ndb/src/common/portlib/ose/NdbThread.c
+++ b/ndb/src/common/portlib/ose/NdbThread.c
@@ -18,7 +18,6 @@
#include "NdbThread.h"
#include <pthread.h>
#include <malloc.h>
-#include <assert.h>
#include <string.h>
#include <NdbOut.hpp>
diff --git a/ndb/src/common/portlib/test/NdbPortLibTest.cpp b/ndb/src/common/portlib/test/NdbPortLibTest.cpp
index 8a5c8f4a878..55b9ccec5f2 100644
--- a/ndb/src/common/portlib/test/NdbPortLibTest.cpp
+++ b/ndb/src/common/portlib/test/NdbPortLibTest.cpp
@@ -20,7 +20,7 @@
* TODO - Add tests for NdbMem
*/
-
+#include <ndb_global.h>
#include "NdbOut.hpp"
#include "NdbThread.h"
@@ -32,11 +32,6 @@
#include "NdbHost.h"
#include "NdbMain.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-
int TestHasFailed;
int verbose = 0;
diff --git a/ndb/src/common/portlib/unix/NdbCondition.c b/ndb/src/common/portlib/unix/NdbCondition.c
index 35b80821052..1d229bdcdef 100644
--- a/ndb/src/common/portlib/unix/NdbCondition.c
+++ b/ndb/src/common/portlib/unix/NdbCondition.c
@@ -15,16 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbCondition.h>
-#include <pthread.h>
-#include <assert.h>
-#include <sys/types.h>
-#if defined NDB_MACOSX
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif
+#include <ndb_global.h>
+#include <NdbCondition.h>
+#include <NdbThread.h>
#include <NdbMutex.h>
struct NdbCondition
@@ -67,8 +61,6 @@ NdbCondition_Wait(struct NdbCondition* p_cond,
return result;
}
-#if defined NDB_SOLARIS || defined NDB_HPUX
-#include <time.h>
int
NdbCondition_WaitTimeout(struct NdbCondition* p_cond,
NdbMutex* p_mutex,
@@ -80,7 +72,16 @@ NdbCondition_WaitTimeout(struct NdbCondition* p_cond,
if (p_cond == NULL || p_mutex == NULL)
return 1;
+#ifdef HAVE_CLOCK_GETTIME
clock_gettime(CLOCK_REALTIME, &abstime);
+#else
+ {
+ struct timeval tick_time;
+ gettimeofday(&tick_time, 0);
+ abstime.tv_sec = tick_time.tv_sec;
+ abstime.tv_nsec = tick_time.tv_usec * 1000;
+ }
+#endif
if(msecs >= 1000){
secs = msecs / 1000;
@@ -98,45 +99,6 @@ NdbCondition_WaitTimeout(struct NdbCondition* p_cond,
return result;
}
-#endif
-
-#if defined NDB_LINUX || defined NDB_MACOSX
-#include <unistd.h>
-#include <sys/time.h>
-
-int
-NdbCondition_WaitTimeout(struct NdbCondition* p_cond,
- NdbMutex* p_mutex,
- int msecs){
- int result;
- struct timespec abstime;
- struct timeval tick_time;
- int secs = 0;
-
- if (p_cond == NULL || p_mutex == NULL)
- return 1;
-
- gettimeofday(&tick_time, 0);
-
- if(msecs >= 1000){
- secs = msecs / 1000;
- msecs = msecs % 1000;
- }
-
-
- abstime.tv_sec = tick_time.tv_sec + secs;
- abstime.tv_nsec = tick_time.tv_usec * 1000 + msecs * 1000000;
- if (abstime.tv_nsec >= 1000000000) {
- abstime.tv_sec += 1;
- abstime.tv_nsec -= 1000000000;
- }
-
- result = pthread_cond_timedwait(&p_cond->cond, p_mutex, &abstime);
-
- return result;
-}
-#endif
-
int
NdbCondition_Signal(struct NdbCondition* p_cond){
diff --git a/ndb/src/common/portlib/unix/NdbDaemon.c b/ndb/src/common/portlib/unix/NdbDaemon.c
index fc114266c9d..186331a4dab 100644
--- a/ndb/src/common/portlib/unix/NdbDaemon.c
+++ b/ndb/src/common/portlib/unix/NdbDaemon.c
@@ -14,40 +14,17 @@
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 "NdbDaemon.h"
-#include <assert.h>
-
-#ifdef NDB_LINUX
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <errno.h>
-#endif
-
-#ifdef NDB_SOLARIS
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <errno.h>
-#endif
#define NdbDaemon_ErrorSize 500
-#if defined(NDB_LINUX) || defined(NDB_SOLARIS)
long NdbDaemon_DaemonPid;
int NdbDaemon_ErrorCode;
char NdbDaemon_ErrorText[NdbDaemon_ErrorSize];
-#endif
+
int
NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags)
{
- /* XXX fix other unixes */
-#if defined(NDB_LINUX) || defined(NDB_SOLARIS)
int lockfd = -1, logfd = -1, n;
char buf[64];
@@ -149,11 +126,21 @@ NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags)
dup2(logfd, 2);
close(logfd);
}
-#endif
/* Success */
return 0;
}
+#if 0
+int
+NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags)
+{
+ /* Fail */
+ snprintf(NdbDaemon_ErrorText, NdbDaemon_ErrorSize,
+ "Daemon mode not implemented");
+ return -1;
+}
+#endif
+
#ifdef NDB_DAEMON_TEST
int
diff --git a/ndb/src/common/portlib/unix/NdbEnv.c b/ndb/src/common/portlib/unix/NdbEnv.c
index b01e3b239ca..d294e0b52ca 100644
--- a/ndb/src/common/portlib/unix/NdbEnv.c
+++ b/ndb/src/common/portlib/unix/NdbEnv.c
@@ -15,9 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NdbEnv.h"
-#include <string.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
+#include <NdbEnv.h>
const char* NdbEnv_GetEnv(const char* name, char * buf, int buflen)
{
diff --git a/ndb/src/common/portlib/unix/NdbHost.c b/ndb/src/common/portlib/unix/NdbHost.c
index 8d2a23fccda..4749bb39ea7 100644
--- a/ndb/src/common/portlib/unix/NdbHost.c
+++ b/ndb/src/common/portlib/unix/NdbHost.c
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include "NdbHost.h"
-#include <unistd.h>
int NdbHost_GetHostName(char* buf)
{
diff --git a/ndb/src/common/portlib/unix/NdbMem.c b/ndb/src/common/portlib/unix/NdbMem.c
index 3b47494967f..0b06e5b23f1 100644
--- a/ndb/src/common/portlib/unix/NdbMem.c
+++ b/ndb/src/common/portlib/unix/NdbMem.c
@@ -15,14 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NdbMem.h"
+#include <ndb_global.h>
-#include <assert.h>
-#include <assert.h>
-#include <stdlib.h>
-#ifndef NDB_MACOSX
-#include <sys/mman.h>
-#endif
+#include <NdbMem.h>
void NdbMem_Create()
{
@@ -59,19 +54,18 @@ void NdbMem_Free(void* ptr)
int NdbMem_MemLockAll(){
-#if defined NDB_MACOSX
- return 0;
-#else
- //return mlockall(MCL_CURRENT | MCL_FUTURE);
+#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)
return mlockall(MCL_CURRENT);
+#else
+ return -1;
#endif
}
int NdbMem_MemUnlockAll(){
-#if defined NDB_MACOSX
- return 0;
-#else
+#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)
return munlockall();
+#else
+ return -1;
#endif
}
diff --git a/ndb/src/common/portlib/unix/NdbMutex.c b/ndb/src/common/portlib/unix/NdbMutex.c
index 3cadc0667e7..50f314d2683 100644
--- a/ndb/src/common/portlib/unix/NdbMutex.c
+++ b/ndb/src/common/portlib/unix/NdbMutex.c
@@ -15,11 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NdbMutex.h"
+#include <ndb_global.h>
-#include <pthread.h>
-#include <stdlib.h>
-#include <assert.h>
+#include <NdbThread.h>
+#include <NdbMutex.h>
NdbMutex* NdbMutex_Create(void)
{
diff --git a/ndb/src/common/portlib/unix/NdbSleep.c b/ndb/src/common/portlib/unix/NdbSleep.c
index 35132d7f9c7..8702a25d1b1 100644
--- a/ndb/src/common/portlib/unix/NdbSleep.c
+++ b/ndb/src/common/portlib/unix/NdbSleep.c
@@ -15,19 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include "NdbSleep.h"
-
-#ifdef NDB_SOLARIS
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-#if defined NDB_LINUX || defined NDB_HPUX || defined NDB_MACOSX
-#include <time.h>
-#include <unistd.h>
-#endif
-
int
NdbSleep_MilliSleep(int milliseconds){
int result = 0;
diff --git a/ndb/src/common/portlib/unix/NdbTCP.c b/ndb/src/common/portlib/unix/NdbTCP.c
index c2613c211c5..287dc6c2ecd 100644
--- a/ndb/src/common/portlib/unix/NdbTCP.c
+++ b/ndb/src/common/portlib/unix/NdbTCP.c
@@ -15,20 +15,26 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <NdbMutex.h>
#include "NdbTCP.h"
+#ifdef NDB_WIN32
+static NdbMutex & LOCK_gethostbyname = * NdbMutex_Create();
+#else
+static NdbMutex LOCK_gethostbyname = NDB_MUTEX_INITIALIZER;
+#endif
-#ifdef NDB_SOLARIS
int
Ndb_getInAddr(struct in_addr * dst, const char *address) {
- struct hostent host, * hostPtr;
- char buf[1024];
- int h_errno;
- hostPtr = gethostbyname_r(address, &host, &buf[0], 1024, &h_errno);
+ struct hostent * hostPtr;
+ NdbMutex_Lock(&LOCK_gethostbyname);
+ hostPtr = gethostbyname(address);
if (hostPtr != NULL) {
dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr;
+ NdbMutex_Unlock(&LOCK_gethostbyname);
return 0;
}
+ NdbMutex_Unlock(&LOCK_gethostbyname);
/* Try it as aaa.bbb.ccc.ddd. */
dst->s_addr = inet_addr(address);
@@ -37,13 +43,14 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) {
}
return -1;
}
-#endif
-#if defined NDB_LINUX || defined NDB_HPUX || defined NDB_MACOSX
+#if 0
int
Ndb_getInAddr(struct in_addr * dst, const char *address) {
- struct hostent * hostPtr;
- hostPtr = gethostbyname(address);
+ struct hostent host, * hostPtr;
+ char buf[1024];
+ int h_errno;
+ hostPtr = gethostbyname_r(address, &host, &buf[0], 1024, &h_errno);
if (hostPtr != NULL) {
dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr;
return 0;
@@ -57,4 +64,3 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) {
return -1;
}
#endif
-
diff --git a/ndb/src/common/portlib/unix/NdbThread.c b/ndb/src/common/portlib/unix/NdbThread.c
index 3665c4c9159..a5c42f79be8 100644
--- a/ndb/src/common/portlib/unix/NdbThread.c
+++ b/ndb/src/common/portlib/unix/NdbThread.c
@@ -15,16 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NdbThread.h"
+#include <ndb_global.h>
+#include <NdbThread.h>
#include <pthread.h>
-#ifdef NDB_MACOSX
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif
-#include <assert.h>
-#include <string.h>
-#include <NdbStdio.h>
#define MAX_THREAD_NAME 16
@@ -94,7 +87,7 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status)
if (p_wait_thread == NULL)
return 0;
- if (p_wait_thread->thread == NULL)
+ if (p_wait_thread->thread == 0)
return 0;
result = pthread_join(p_wait_thread->thread, status);
diff --git a/ndb/src/common/portlib/unix/NdbTick.c b/ndb/src/common/portlib/unix/NdbTick.c
index 5adb4ec80c2..d8f0b6ec27a 100644
--- a/ndb/src/common/portlib/unix/NdbTick.c
+++ b/ndb/src/common/portlib/unix/NdbTick.c
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include "NdbTick.h"
-#include <time.h>
#define NANOSEC_PER_SEC 1000000000
#define MICROSEC_PER_SEC 1000000
@@ -25,7 +25,7 @@
#define MILLISEC_PER_NANOSEC 1000000
-#if defined NDB_SOLARIS || NDB_HPUX
+#ifdef HAVE_CLOCK_GETTIME
NDB_TICKS NdbTick_CurrentMillisecond(void)
{
struct timespec tick_time;
@@ -44,11 +44,7 @@ NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros){
* micros = t.tv_nsec / 1000;
return res;
}
-#endif
-
-#if defined NDB_LINUX || NDB_MACOSX
-#include <unistd.h>
-#include <sys/time.h>
+#else
NDB_TICKS NdbTick_CurrentMillisecond(void)
{
struct timeval tick_time;
@@ -99,12 +95,12 @@ NdbTick_getMicrosPassed(struct MicroSecondTimer start,
ret_value = ((NDB_TICKS)MICROSEC_PER_SEC) * sec_passed;
} else if (start.seconds > stop.seconds) {
return ret_value;
- }//if
+ }
if (start.micro_seconds < stop.micro_seconds) {
ret_value += (stop.micro_seconds - start.micro_seconds);
} else if (ret_value != (NDB_TICKS)0) {
ret_value -= (start.micro_seconds - stop.micro_seconds);
- }//if
+ }
return ret_value;
}
#endif
diff --git a/ndb/src/common/portlib/win32/NdbCondition.c b/ndb/src/common/portlib/win32/NdbCondition.c
index 12b508cf33b..77869b673de 100644
--- a/ndb/src/common/portlib/win32/NdbCondition.c
+++ b/ndb/src/common/portlib/win32/NdbCondition.c
@@ -18,7 +18,6 @@
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
-#include <assert.h>
#include <sys/types.h>
#include "NdbCondition.h"
diff --git a/ndb/src/common/portlib/win32/NdbDaemon.c b/ndb/src/common/portlib/win32/NdbDaemon.c
index b96d4c20260..972fb1b88d8 100644
--- a/ndb/src/common/portlib/win32/NdbDaemon.c
+++ b/ndb/src/common/portlib/win32/NdbDaemon.c
@@ -14,6 +14,7 @@
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 "NdbDaemon.h"
#define NdbDaemon_ErrorSize 500
@@ -24,8 +25,10 @@ char NdbDaemon_ErrorText[NdbDaemon_ErrorSize];
int
NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags)
{
- // XXX do something
- return 0;
+ /* Fail */
+ snprintf(NdbDaemon_ErrorText, NdbDaemon_ErrorSize,
+ "Daemon mode not implemented");
+ return -1;
}
#ifdef NDB_DAEMON_TEST
diff --git a/ndb/src/common/portlib/win32/NdbMem.c b/ndb/src/common/portlib/win32/NdbMem.c
index 274dc31353f..ab7123b0a29 100644
--- a/ndb/src/common/portlib/win32/NdbMem.c
+++ b/ndb/src/common/portlib/win32/NdbMem.c
@@ -16,8 +16,6 @@
#include <windows.h>
-#include <assert.h>
-#include <NdbStdio.h>
#include "NdbMem.h"
diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/win32/NdbMutex.c
index c93384d91db..e797024d5bb 100644
--- a/ndb/src/common/portlib/win32/NdbMutex.c
+++ b/ndb/src/common/portlib/win32/NdbMutex.c
@@ -19,7 +19,6 @@
#include <ws2tcpip.h>
#include <windows.h>
#include <time.h>
-#include <assert.h>
#include "NdbMutex.h"
diff --git a/ndb/src/common/portlib/win32/NdbThread.c b/ndb/src/common/portlib/win32/NdbThread.c
index ae3c74be70d..1f052f034e8 100644
--- a/ndb/src/common/portlib/win32/NdbThread.c
+++ b/ndb/src/common/portlib/win32/NdbThread.c
@@ -17,7 +17,6 @@
#include <windows.h>
#include <process.h>
-#include <assert.h>
#include "NdbThread.h"
diff --git a/ndb/src/common/transporter/Makefile b/ndb/src/common/transporter/Makefile
index 3bd23b627d3..372bf640566 100644
--- a/ndb/src/common/transporter/Makefile
+++ b/ndb/src/common/transporter/Makefile
@@ -10,7 +10,6 @@ DIRS := basictest perftest
SOURCES = \
Transporter.cpp \
SendBuffer.cpp \
- SHM_Transporter.cpp \
TCP_Transporter.cpp \
TransporterRegistry.cpp \
Packer.cpp
@@ -20,37 +19,19 @@ DIRS := basictest perftest
CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/kernel) \
-I$(call fixpath,$(NDB_TOP)/include/transporter)
+
+ifeq ($(NDB_SHM), Y)
+SOURCES += SHM_Transporter.cpp
ifeq ($(NDB_OS), WIN32)
SOURCES += SHM_Transporter.win32.cpp
-endif
-
-ifeq ($(NDB_OS), SOLARIS)
+else
SOURCES += SHM_Transporter.unix.cpp
endif
-
-ifeq ($(NDB_OS), HPUX)
-SOURCES += SHM_Transporter.unix.cpp
endif
-ifeq ($(NDB_OS), MACOSX)
-SOURCES += SHM_Transporter.unix.cpp
-endif
-
-ifeq ($(NDB_OS), IBMAIX)
-SOURCES += SHM_Transporter.unix.cpp
-endif
-
-ifeq ($(NDB_OS), TRU64X)
-SOURCES += SHM_Transporter.unix.cpp
-endif
-
-ifeq ($(NDB_OS), LINUX)
-SOURCES += SHM_Transporter.unix.cpp
ifeq ($(NDB_SCI), Y)
SOURCES += SCI_Transporter.cpp
endif
-endif
-
ifneq ($(findstring OSE, $(NDB_OS)),)
SOURCES += OSE_Transporter.cpp
diff --git a/ndb/src/common/transporter/OSE_Receiver.cpp b/ndb/src/common/transporter/OSE_Receiver.cpp
index 558dee92d8d..b7d47b2f88c 100644
--- a/ndb/src/common/transporter/OSE_Receiver.cpp
+++ b/ndb/src/common/transporter/OSE_Receiver.cpp
@@ -20,7 +20,6 @@
#include "TransporterCallback.hpp"
#include <TransporterRegistry.hpp>
#include "TransporterInternalDefinitions.hpp"
-#include <NdbStdio.h>
OSE_Receiver::OSE_Receiver(TransporterRegistry * tr,
int _recBufSize,
diff --git a/ndb/src/common/transporter/OSE_Transporter.cpp b/ndb/src/common/transporter/OSE_Transporter.cpp
index a7a5ed81ce2..c9b0f777319 100644
--- a/ndb/src/common/transporter/OSE_Transporter.cpp
+++ b/ndb/src/common/transporter/OSE_Transporter.cpp
@@ -23,11 +23,9 @@
#include <NdbMutex.h>
-#include <NdbStdio.h>
#include <NdbHost.h>
#include <NdbOut.hpp>
#include <time.h>
-#include <assert.h>
OSE_Transporter::OSE_Transporter(int _prioASignalSize,
int _prioBSignalSize,
diff --git a/ndb/src/common/transporter/Packer.cpp b/ndb/src/common/transporter/Packer.cpp
index 77bd66d1ba9..fa72af12dac 100644
--- a/ndb/src/common/transporter/Packer.cpp
+++ b/ndb/src/common/transporter/Packer.cpp
@@ -14,13 +14,13 @@
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 "Packer.hpp"
#include <TransporterRegistry.hpp>
#include <TransporterCallback.hpp>
#include <RefConvert.hpp>
-#include <stdio.h>
-
Uint32
TransporterRegistry::unpack(Uint32 * readPtr,
Uint32 sizeOfData,
diff --git a/ndb/src/common/transporter/SCI_Transporter.cpp b/ndb/src/common/transporter/SCI_Transporter.cpp
index 2be857e8115..c52c8a9d8c0 100644
--- a/ndb/src/common/transporter/SCI_Transporter.cpp
+++ b/ndb/src/common/transporter/SCI_Transporter.cpp
@@ -14,17 +14,14 @@
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 "SCI_Transporter.hpp"
-#include <NdbStdio.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
#include <NdbTick.h>
-#include <stdlib.h>
#include <NdbTick.h>
-#if 0
-#include <malloc.h>
-#include <sys/time.h>
-#endif
+
#include "TransporterInternalDefinitions.hpp"
#include <TransporterCallback.hpp>
diff --git a/ndb/src/common/transporter/SHM_Buffer.hpp b/ndb/src/common/transporter/SHM_Buffer.hpp
index 43250853fee..32e59dd57a2 100644
--- a/ndb/src/common/transporter/SHM_Buffer.hpp
+++ b/ndb/src/common/transporter/SHM_Buffer.hpp
@@ -17,10 +17,9 @@
#ifndef SHM_BUFFER_HPP
#define SHM_BUFFER_HPP
-#include <stdio.h>
-#include <ndb_types.h>
+#include <ndb_global.h>
+
#include <NdbSleep.h>
-#include <assert.h>
/**
* These classes implement a circular buffer
diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp
index f18b775efa4..7c673f93c22 100644
--- a/ndb/src/common/transporter/SHM_Transporter.cpp
+++ b/ndb/src/common/transporter/SHM_Transporter.cpp
@@ -15,18 +15,15 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "SHM_Transporter.hpp"
#include "TransporterInternalDefinitions.hpp"
#include <TransporterCallback.hpp>
#include <NdbSleep.h>
#include <NdbOut.hpp>
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef NDB_WIN32
-#include <windows.h>
-#else
+#ifndef NDB_WIN32
#include <sys/ipc.h>
#include <sys/shm.h>
#endif
diff --git a/ndb/src/common/transporter/SHM_Transporter.unix.cpp b/ndb/src/common/transporter/SHM_Transporter.unix.cpp
index 975c1191aea..afbf124432e 100644
--- a/ndb/src/common/transporter/SHM_Transporter.unix.cpp
+++ b/ndb/src/common/transporter/SHM_Transporter.unix.cpp
@@ -15,15 +15,14 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "SHM_Transporter.hpp"
#include "TransporterInternalDefinitions.hpp"
#include <TransporterCallback.hpp>
#include <NdbSleep.h>
#include <NdbOut.hpp>
-#include <stdio.h>
-
-
#include <sys/ipc.h>
#include <sys/shm.h>
diff --git a/ndb/src/common/transporter/SHM_Transporter.win32.cpp b/ndb/src/common/transporter/SHM_Transporter.win32.cpp
index 4ba52c9179d..c289a85da0e 100644
--- a/ndb/src/common/transporter/SHM_Transporter.win32.cpp
+++ b/ndb/src/common/transporter/SHM_Transporter.win32.cpp
@@ -15,14 +15,14 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "SHM_Transporter.hpp"
#include "TransporterInternalDefinitions.hpp"
#include <TransporterCallback.hpp>
#include <NdbSleep.h>
#include <NdbOut.hpp>
-#include <stdio.h>
-
#include <windows.h>
diff --git a/ndb/src/common/transporter/SendBuffer.hpp b/ndb/src/common/transporter/SendBuffer.hpp
index 75ef0708e83..63a01f3de24 100644
--- a/ndb/src/common/transporter/SendBuffer.hpp
+++ b/ndb/src/common/transporter/SendBuffer.hpp
@@ -33,10 +33,9 @@
#include "TransporterDefinitions.hpp"
#include <TransporterCallback.hpp>
-#include <stdlib.h>
#ifdef DEBUG_TRANSPORTER
-#include <stdio.h>
+#include <ndb_global.h>
#endif
class SendBuffer {
diff --git a/ndb/src/common/transporter/TCP_Transporter.cpp b/ndb/src/common/transporter/TCP_Transporter.cpp
index 8a7d1741636..99b6a137797 100644
--- a/ndb/src/common/transporter/TCP_Transporter.cpp
+++ b/ndb/src/common/transporter/TCP_Transporter.cpp
@@ -14,6 +14,8 @@
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>
#include "TCP_Transporter.hpp"
#include <NdbOut.hpp>
@@ -23,13 +25,9 @@
#if defined NDB_OSE || defined NDB_SOFTOSE
#define inet_send inet_send
#else
-#include <NdbStdio.h>
#define inet_send send
#endif
-#include <stdlib.h>
-
-
#ifdef NDB_WIN32
class ndbstrerror
{
diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp
index 1e19a8375ba..5ca523d5185 100644
--- a/ndb/src/common/transporter/Transporter.cpp
+++ b/ndb/src/common/transporter/Transporter.cpp
@@ -17,7 +17,6 @@
#include "Transporter.hpp"
#include "TransporterInternalDefinitions.hpp"
-#include <NdbStdio.h>
#include <NdbSleep.h>
Transporter::Transporter(NodeId lNodeId, NodeId rNodeId,
diff --git a/ndb/src/common/transporter/TransporterInternalDefinitions.hpp b/ndb/src/common/transporter/TransporterInternalDefinitions.hpp
index 18d54ca1e89..624b495422f 100644
--- a/ndb/src/common/transporter/TransporterInternalDefinitions.hpp
+++ b/ndb/src/common/transporter/TransporterInternalDefinitions.hpp
@@ -21,39 +21,18 @@
#include <NdbOut.hpp>
#endif
-#ifdef NDB_SOLARIS
-#define NDB_TCP_TRANSPORTER
-//#define NDB_SCI_TRANSPORTER
-#define NDB_SHM_TRANSPORTER
-#elif defined NDB_OSE || defined NDB_SOFTOSE
-#define NDB_TCP_TRANSPORTER
-#define NDB_OSE_TRANSPORTER
-#elif defined NDB_LINUX
-#define NDB_TCP_TRANSPORTER
-#define NDB_SCI_TRANSPORTER
-#define NDB_SHM_TRANSPORTER
-#elif defined NDB_WIN32
-#define NDB_TCP_TRANSPORTER
-#elif defined NDB_HPUX
-#define NDB_TCP_TRANSPORTER
-#define NDB_SHM_TRANSPORTER
-#elif defined NDB_MACOSX
-#define NDB_TCP_TRANSPORTER
-#define NDB_SHM_TRANSPORTER
-#elif defined NDB_IBMAIX
-#define NDB_TCP_TRANSPORTER
-#define NDB_SHM_TRANSPORTER
-#elif defined NDB_TRU64X
#define NDB_TCP_TRANSPORTER
+
+#ifdef HAVE_NDB_SHM
#define NDB_SHM_TRANSPORTER
-#else
-#error unsupported platform
#endif
-#ifndef HAVE_SCI
-#ifdef NDB_SCI_TRANSPORTER
-#undef NDB_SCI_TRANSPORTER
+#ifdef HAVE_NDB_SCI
+#define NDB_SCI_TRANSPORTER
#endif
+
+#ifdef HAVE_NDB_OSE
+#define NDB_OSE_TRANSPORTER
#endif
#ifdef DEBUG_TRANSPORTER
diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp
index dcd957f40ce..3f98eeed89e 100644
--- a/ndb/src/common/transporter/TransporterRegistry.cpp
+++ b/ndb/src/common/transporter/TransporterRegistry.cpp
@@ -14,14 +14,13 @@
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 "TransporterRegistry.hpp"
#include "TransporterInternalDefinitions.hpp"
#include "Transporter.hpp"
-#include <assert.h>
-#include <stdlib.h>
-
#ifdef NDB_TCP_TRANSPORTER
#include "TCP_Transporter.hpp"
#endif
diff --git a/ndb/src/common/transporter/basictest/basicTransporterTest.cpp b/ndb/src/common/transporter/basictest/basicTransporterTest.cpp
index 5d8186badb8..c0a437c4907 100644
--- a/ndb/src/common/transporter/basictest/basicTransporterTest.cpp
+++ b/ndb/src/common/transporter/basictest/basicTransporterTest.cpp
@@ -14,18 +14,17 @@
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 "TransporterRegistry.hpp"
#include "TransporterDefinitions.hpp"
#include "TransporterCallback.hpp"
#include <RefConvert.hpp>
-#include <NdbStdio.h>
-#include <stdlib.h>
#include <NdbTick.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
-#include <NdbString.h>
int basePortTCP = 17000;
diff --git a/ndb/src/common/transporter/buddy.cpp b/ndb/src/common/transporter/buddy.cpp
index c65aad1df2c..dc25e2dc66c 100644
--- a/ndb/src/common/transporter/buddy.cpp
+++ b/ndb/src/common/transporter/buddy.cpp
@@ -15,9 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "buddy.hpp"
-#include <stdlib.h>
-#include <math.h>
-
void Chunk256::setFree(bool free){
// Bit 0 of allocationTimeStamp represents if the segment is free or not
diff --git a/ndb/src/common/transporter/buddy.hpp b/ndb/src/common/transporter/buddy.hpp
index 7272ac884ec..f720e9e61a1 100644
--- a/ndb/src/common/transporter/buddy.hpp
+++ b/ndb/src/common/transporter/buddy.hpp
@@ -17,8 +17,7 @@
#ifndef BUDDY_H
#define BUDDY_H
-#include <stdlib.h>
-#include <stdio.h>
+#include <ndb_global.h>
typedef unsigned int Uint32;
typedef unsigned short Uint16;
diff --git a/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp b/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp
index 03ce7ea6df3..803029ee565 100644
--- a/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp
+++ b/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp
@@ -14,17 +14,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include "sisci_types.h"
#include "sisci_api.h"
#include "sisci_error.h"
//#include "sisci_demolib.h"
-#include <strings.h>
-#include <ndb_types.h>
#include <NdbTick.h>
-#include "NdbSleep.h"
+#include <NdbSleep.h>
#define NO_CALLBACK NULL
#define NO_FLAGS 0
#define DATA_TRANSFER_READY 8
diff --git a/ndb/src/common/transporter/perftest/perfTransporterTest.cpp b/ndb/src/common/transporter/perftest/perfTransporterTest.cpp
index 6d7f7083a48..d33221c2835 100644
--- a/ndb/src/common/transporter/perftest/perfTransporterTest.cpp
+++ b/ndb/src/common/transporter/perftest/perfTransporterTest.cpp
@@ -14,18 +14,17 @@
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 "TransporterRegistry.hpp"
#include "TransporterDefinitions.hpp"
#include "TransporterCallback.hpp"
#include <RefConvert.hpp>
-#include <NdbStdio.h>
-#include <stdlib.h>
#include <NdbTick.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
-#include <NdbString.h>
int basePortTCP = 17000;
diff --git a/ndb/src/common/transporter/priotest/prioTransporterTest.cpp b/ndb/src/common/transporter/priotest/prioTransporterTest.cpp
index 919cc9d7511..0fce6aaad39 100644
--- a/ndb/src/common/transporter/priotest/prioTransporterTest.cpp
+++ b/ndb/src/common/transporter/priotest/prioTransporterTest.cpp
@@ -14,6 +14,8 @@
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 "TransporterRegistry.hpp"
#include "TransporterDefinitions.hpp"
#include "TransporterCallback.hpp"
@@ -21,8 +23,6 @@
#include "prioTransporterTest.hpp"
-#include <NdbStdio.h>
-#include <stdlib.h>
#include <NdbTick.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
diff --git a/ndb/src/common/util/Base64.cpp b/ndb/src/common/util/Base64.cpp
index 5f4bbc8645a..482d0b10ad2 100644
--- a/ndb/src/common/util/Base64.cpp
+++ b/ndb/src/common/util/Base64.cpp
@@ -14,8 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <string.h>
+#include <ndb_global.h>
#include <Base64.hpp>
static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
diff --git a/ndb/src/common/util/BaseString.cpp b/ndb/src/common/util/BaseString.cpp
index 1b0eaa1b83c..d15249adf72 100644
--- a/ndb/src/common/util/BaseString.cpp
+++ b/ndb/src/common/util/BaseString.cpp
@@ -15,11 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* -*- c-basic-offset: 4; -*- */
-#include <string.h>
-#include <NdbStdio.h>
-#include <stdarg.h>
-#include "BaseString.hpp"
-#include <stdlib.h>
+#include <ndb_global.h>
+#include <BaseString.hpp>
BaseString::BaseString()
{
@@ -340,7 +337,6 @@ BaseString::trim(char * str, const char * delim){
#ifdef TEST_BASE_STRING
-#include <assert.h>
/*
g++ -g -Wall -o tbs -DTEST_BASE_STRING -I$NDB_TOP/include/util \
diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp
index ad72b41835d..22d262a0d27 100644
--- a/ndb/src/common/util/File.cpp
+++ b/ndb/src/common/util/File.cpp
@@ -14,15 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <File.hpp>
-
-#include <errno.h>
-#include <string.h>
-#include <sys/stat.h>
+#include <ndb_global.h>
-#if defined NDB_OSE || defined NDB_SOFTOSE
-#include <unistd.h>
-#endif
+#include <File.hpp>
#include <NdbOut.hpp>
@@ -31,7 +25,7 @@
//
bool
-File::exists(const char* aFileName)
+File_class::exists(const char* aFileName)
{
bool rc = true;
@@ -56,7 +50,7 @@ File::exists(const char* aFileName)
}
long
-File::size(FILE* f)
+File_class::size(FILE* f)
{
long cur_pos = 0, length = 0;
@@ -69,23 +63,23 @@ File::size(FILE* f)
}
bool
-File::rename(const char* currFileName, const char* newFileName)
+File_class::rename(const char* currFileName, const char* newFileName)
{
return ::rename(currFileName, newFileName) == 0 ? true : false;
}
bool
-File::remove(const char* aFileName)
+File_class::remove(const char* aFileName)
{
return ::remove(aFileName) == 0 ? true : false;
}
-File::File() :
+File_class::File_class() :
m_file(NULL),
m_fileMode("r")
{
}
-File::File(const char* aFileName, const char* mode) :
+File_class::File_class(const char* aFileName, const char* mode) :
m_file(NULL),
m_fileMode(mode)
{
@@ -93,13 +87,13 @@ File::File(const char* aFileName, const char* mode) :
}
bool
-File::open()
+File_class::open()
{
return open(m_fileName, m_fileMode);
}
bool
-File::open(const char* aFileName, const char* mode)
+File_class::open(const char* aFileName, const char* mode)
{
if(m_fileName != aFileName){
/**
@@ -116,21 +110,21 @@ File::open(const char* aFileName, const char* mode)
return rc;
}
-File::~File()
+File_class::~File_class()
{
close();
}
bool
-File::remove()
+File_class::remove()
{
// Close the file first!
close();
- return File::remove(m_fileName);
+ return File_class::remove(m_fileName);
}
bool
-File::close()
+File_class::close()
{
bool rc = true;
if (m_file != NULL)
@@ -144,55 +138,55 @@ File::close()
}
int
-File::read(void* buf, size_t itemSize, size_t nitems) const
+File_class::read(void* buf, size_t itemSize, size_t nitems) const
{
return ::fread(buf, itemSize, nitems, m_file);
}
int
-File::readChar(char* buf, long start, long length) const
+File_class::readChar(char* buf, long start, long length) const
{
return ::fread((void*)&buf[start], 1, length, m_file);
}
int
-File::readChar(char* buf)
+File_class::readChar(char* buf)
{
return readChar(buf, 0, strlen(buf));
}
int
-File::write(const void* buf, size_t size, size_t nitems)
+File_class::write(const void* buf, size_t size, size_t nitems)
{
return ::fwrite(buf, size, nitems, m_file);
}
int
-File::writeChar(const char* buf, long start, long length)
+File_class::writeChar(const char* buf, long start, long length)
{
return ::fwrite((const void*)&buf[start], sizeof(char), length, m_file);
}
int
-File::writeChar(const char* buf)
+File_class::writeChar(const char* buf)
{
return writeChar(buf, 0, ::strlen(buf));
}
long
-File::size() const
+File_class::size() const
{
- return File::size(m_file);
+ return File_class::size(m_file);
}
const char*
-File::getName() const
+File_class::getName() const
{
return m_fileName;
}
int
-File::flush() const
+File_class::flush() const
{
#if defined NDB_OSE || defined NDB_SOFTOSE
::fflush(m_file);
diff --git a/ndb/src/common/util/InputStream.cpp b/ndb/src/common/util/InputStream.cpp
index c52b594225d..410e9a70e9c 100644
--- a/ndb/src/common/util/InputStream.cpp
+++ b/ndb/src/common/util/InputStream.cpp
@@ -15,10 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "InputStream.hpp"
#include <socket_io.h>
-#include <assert.h>
-#include <string.h>
FileInputStream Stdin(stdin);
diff --git a/ndb/src/common/util/Makefile b/ndb/src/common/util/Makefile
index b3e33704266..e8ca2b87c20 100644
--- a/ndb/src/common/util/Makefile
+++ b/ndb/src/common/util/Makefile
@@ -18,15 +18,7 @@ endif
ifeq ($(NDB_OS), OSE)
SOURCES += NdbErrHnd.cpp
endif
-ifdef NDB_STRDUP
- SOURCES.c += strdup.c
-endif
-ifdef NDB_STRLCAT
- SOURCES.c += strlcat.c
-endif
-ifdef NDB_STRLCPY
- SOURCES.c += strlcpy.c
-endif
+ SOURCES.c += strdup.c strlcat.c strlcpy.c
DIRS := testSimpleProperties
diff --git a/ndb/src/common/util/NdbErrHnd.cpp b/ndb/src/common/util/NdbErrHnd.cpp
index 53df5d702ca..f1c28a7bbdd 100644
--- a/ndb/src/common/util/NdbErrHnd.cpp
+++ b/ndb/src/common/util/NdbErrHnd.cpp
@@ -18,7 +18,6 @@
#if defined NDB_OSE || defined NDB_SOFTOSE
#include <NdbOut.hpp>
-#include <NdbStdio.h>
#include <ndb_types.h>
#include "ose.h"
diff --git a/ndb/src/common/util/NdbOut.cpp b/ndb/src/common/util/NdbOut.cpp
index 2624bfa04bd..6d76cf22402 100644
--- a/ndb/src/common/util/NdbOut.cpp
+++ b/ndb/src/common/util/NdbOut.cpp
@@ -14,11 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NdbOut.hpp"
-#include <NdbStdio.h>
-#include <stdarg.h>
-#include <NdbUnistd.h>
-#include <string.h>
+#include <ndb_global.h>
+
+#include <NdbOut.hpp>
#include <OutputStream.hpp>
static FileOutputStream ndbouts_fileoutputstream(stdout);
diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp
index dba7012cc0f..e91ade374cf 100644
--- a/ndb/src/common/util/NdbSqlUtil.cpp
+++ b/ndb/src/common/util/NdbSqlUtil.cpp
@@ -286,7 +286,6 @@ NdbSqlUtil::cmpTimespec(const Uint32* p1, const Uint32* p2, Uint32 full, Uint32
#ifdef NDB_SQL_UTIL_TEST
-#include <assert.h>
#include <NdbTick.h>
#include <NdbOut.hpp>
diff --git a/ndb/src/common/util/OutputStream.cpp b/ndb/src/common/util/OutputStream.cpp
index 1143fe00fd1..bf3599dbac9 100644
--- a/ndb/src/common/util/OutputStream.cpp
+++ b/ndb/src/common/util/OutputStream.cpp
@@ -15,8 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <OutputStream.hpp>
-#include <stdarg.h>
#include <socket_io.h>
FileOutputStream::FileOutputStream(FILE * file){
diff --git a/ndb/src/common/util/Parser.cpp b/ndb/src/common/util/Parser.cpp
index d5c23fe14c1..2e8120f88ce 100644
--- a/ndb/src/common/util/Parser.cpp
+++ b/ndb/src/common/util/Parser.cpp
@@ -15,14 +15,14 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "Parser.hpp"
-#include <stdio.h>
#include <NdbOut.hpp>
-#include <string.h>
#include <Properties.hpp>
-#include <assert.h>
#include <Base64.hpp>
+#undef DEBUG
#define DEBUG(x) ndbout << x << endl;
static void trim(char * str);
diff --git a/ndb/src/common/util/Properties.cpp b/ndb/src/common/util/Properties.cpp
index 4841d6e5e9e..2ab008142ba 100644
--- a/ndb/src/common/util/Properties.cpp
+++ b/ndb/src/common/util/Properties.cpp
@@ -14,14 +14,11 @@
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 <Properties.hpp>
#include <NdbTCP.h>
-#include <string.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <NdbString.h>
-
#include <NdbOut.hpp>
/**
diff --git a/ndb/src/common/util/SimpleProperties.cpp b/ndb/src/common/util/SimpleProperties.cpp
index a118478ba6c..c3980f03c4d 100644
--- a/ndb/src/common/util/SimpleProperties.cpp
+++ b/ndb/src/common/util/SimpleProperties.cpp
@@ -14,12 +14,10 @@
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 <SimpleProperties.hpp>
-#include <stdlib.h>
-#include <NdbString.h>
#include <NdbOut.hpp>
#include <NdbTCP.h>
-#include <assert.h>
#include <UtilBuffer.hpp>
bool
diff --git a/ndb/src/common/util/SocketServer.cpp b/ndb/src/common/util/SocketServer.cpp
index 39f46eceed9..a0ec0aaa676 100644
--- a/ndb/src/common/util/SocketServer.cpp
+++ b/ndb/src/common/util/SocketServer.cpp
@@ -15,17 +15,15 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "SocketServer.hpp"
#include <NdbTCP.h>
-#include <string.h>
#include <NdbOut.hpp>
#include <NdbThread.h>
#include <NdbSleep.h>
-#include <stdio.h>
-#include <assert.h>
-
#define DEBUG(x) ndbout << x << endl;
SocketServer::SocketServer(int maxSessions) :
diff --git a/ndb/src/common/util/filetest/FileUnitTest.cpp b/ndb/src/common/util/filetest/FileUnitTest.cpp
index ebcca26d3d2..b6e7b7e8ec0 100644
--- a/ndb/src/common/util/filetest/FileUnitTest.cpp
+++ b/ndb/src/common/util/filetest/FileUnitTest.cpp
@@ -18,7 +18,6 @@
#include <File.hpp>
#include <NdbOut.hpp>
-#include <assert.h>
typedef bool (*TESTFUNC)(const char*);
diff --git a/ndb/src/common/util/getarg.c b/ndb/src/common/util/getarg.c
index 5f792437a65..ae016746987 100644
--- a/ndb/src/common/util/getarg.c
+++ b/ndb/src/common/util/getarg.c
@@ -32,18 +32,8 @@
* SUCH DAMAGE.
*/
-#include <ndb_types.h>
+#include <ndb_global.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$KTH: getarg.c,v 1.23 2000/09/01 21:25:54 lha Exp $");
-#endif
-
-#include <NdbStdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <ctype.h>
#include "getarg.h"
#define ISFLAG(X) ((X).type == arg_flag || (X).type == arg_negative_flag)
@@ -407,12 +397,12 @@ arg_match_long(struct getargs *args, size_t num_args,
}
case arg_string:
{
- *(char**)current->value = optarg + 1;
+ *(char**)current->value = (char*)optarg + 1;
return 0;
}
case arg_strings:
{
- add_string((getarg_strings*)current->value, optarg + 1);
+ add_string((getarg_strings*)current->value, (char*)optarg + 1);
return 0;
}
case arg_flag:
diff --git a/ndb/src/common/util/new.cpp b/ndb/src/common/util/new.cpp
index a0709a3fa13..889e83edf6f 100644
--- a/ndb/src/common/util/new.cpp
+++ b/ndb/src/common/util/new.cpp
@@ -1,6 +1,5 @@
-#include <malloc.h>
-#include <stdlib.h>
+#include <ndb_global.h>
extern "C" {
void (* ndb_new_handler)() = 0;
diff --git a/ndb/src/common/util/random.c b/ndb/src/common/util/random.c
index 91da19572e2..286ab093a26 100644
--- a/ndb/src/common/util/random.c
+++ b/ndb/src/common/util/random.c
@@ -18,16 +18,8 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <sys/types.h>
+#include <ndb_global.h>
-#ifndef NDB_WIN32
-#include <sys/time.h>
-#endif
-
-#include <ndb_types.h>
#include <NdbOut.hpp>
#include <random.h>
diff --git a/ndb/src/common/util/socket_io.cpp b/ndb/src/common/util/socket_io.cpp
index 878a9059512..8def7ebe91b 100644
--- a/ndb/src/common/util/socket_io.cpp
+++ b/ndb/src/common/util/socket_io.cpp
@@ -14,13 +14,11 @@
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>
#include <socket_io.h>
-#include <stdarg.h>
-#include <string.h>
-#include <NdbStdio.h>
#include <NdbOut.hpp>
-#include <NdbString.h>
extern "C"
int
diff --git a/ndb/src/common/util/strdup.c b/ndb/src/common/util/strdup.c
index 5291be86b0f..afe2306427e 100644
--- a/ndb/src/common/util/strdup.c
+++ b/ndb/src/common/util/strdup.c
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdlib.h>
+#include <ndb_global.h>
#ifndef HAVE_STRDUP
char *
diff --git a/ndb/src/common/util/strlcat.c b/ndb/src/common/util/strlcat.c
index ccff15da27f..aa282abe48d 100644
--- a/ndb/src/common/util/strlcat.c
+++ b/ndb/src/common/util/strlcat.c
@@ -31,17 +31,13 @@
* SUCH DAMAGE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <ndb_types.h>
+#include <ndb_global.h>
/* RCSID("$KTH: strlcat.c,v 1.1 2000/08/16 01:23:47 lha Exp $"); */
-//#include <NdbString.h>
#ifndef HAVE_STRLCAT
+
size_t
strlcat (char *dst, const char *src, size_t dst_sz)
{
diff --git a/ndb/src/common/util/strlcpy.c b/ndb/src/common/util/strlcpy.c
index 9a3048081ca..97cff177d48 100644
--- a/ndb/src/common/util/strlcpy.c
+++ b/ndb/src/common/util/strlcpy.c
@@ -31,20 +31,12 @@
* SUCH DAMAGE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <ndb_types.h>
+#include <ndb_global.h>
/* RCSID("$KTH: strlcpy.c,v 1.1 2000/08/16 01:23:48 lha Exp $"); */
#ifndef HAVE_STRLCPY
-#ifdef NDB_WIN32
-#include <string.h>
-#endif
-
size_t
strlcpy (char *dst, const char *src, size_t dst_sz)
{
diff --git a/ndb/src/common/util/testProperties/testProperties.cpp b/ndb/src/common/util/testProperties/testProperties.cpp
index 4a2999b89c1..3aa2af92c5b 100644
--- a/ndb/src/common/util/testProperties/testProperties.cpp
+++ b/ndb/src/common/util/testProperties/testProperties.cpp
@@ -14,10 +14,9 @@
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 "Properties.hpp"
#include <NdbOut.hpp>
-#include <stdlib.h>
-#include <string.h>
#include "uucode.h"
diff --git a/ndb/src/common/util/testSimpleProperties/sp_test.cpp b/ndb/src/common/util/testSimpleProperties/sp_test.cpp
index d6dbe2a1502..d4052b64132 100644
--- a/ndb/src/common/util/testSimpleProperties/sp_test.cpp
+++ b/ndb/src/common/util/testSimpleProperties/sp_test.cpp
@@ -14,10 +14,10 @@
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 "SimpleProperties.hpp"
#include <NdbOut.hpp>
-#include <assert.h>
-#include <stdio.h>
Uint32 page[8192];
diff --git a/ndb/src/common/util/uucode.c b/ndb/src/common/util/uucode.c
index f862d982204..da34d565153 100644
--- a/ndb/src/common/util/uucode.c
+++ b/ndb/src/common/util/uucode.c
@@ -15,8 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <string.h>
+#include <ndb_global.h>
/* ENC is the basic 1 character encoding function to make a char printing */
/* DEC is single character decode */
diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c
index 2ff10f51932..10f621d5db8 100644
--- a/ndb/src/common/util/version.c
+++ b/ndb/src/common/util/version.c
@@ -14,9 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <string.h>
-#include <ndb_types.h>
+#include <ndb_global.h>
#include <ndb_version.h>
#include <version.h>
@@ -61,7 +59,7 @@ struct NdbUpGradeCompatible {
UG_MatchType matchType;
};
-//#define TEST_VERSION
+/*#define TEST_VERSION*/
#ifndef TEST_VERSION
struct NdbUpGradeCompatible ndbCompatibleTable_full[] = {
@@ -74,7 +72,7 @@ struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = {
void ndbSetOwnVersion() {}
-#else // testing purposes
+#else /* testing purposes */
struct NdbUpGradeCompatible ndbCompatibleTable_full[] = {
{ MAKE_VERSION(4,1,5), MAKE_VERSION(4,1,0), UG_Range },
@@ -122,7 +120,7 @@ ndbGetOwnVersion()
{
#ifndef TEST_VERSION
return NDB_VERSION_D;
-#else // testing purposes
+#else /* testing purposes */
if (ndbOwnVersionTesting == 0)
return NDB_VERSION_D;
else
diff --git a/ndb/src/cw/cpcc-win32/C++/StdAfx.h b/ndb/src/cw/cpcc-win32/C++/StdAfx.h
index d84b5811f8d..370d04fb466 100644
--- a/ndb/src/cw/cpcc-win32/C++/StdAfx.h
+++ b/ndb/src/cw/cpcc-win32/C++/StdAfx.h
@@ -48,15 +48,12 @@
#include <afxtempl.h>
// C RunTime Header Files
-#include <stdlib.h>
-#include <malloc.h>
+#include <ndb_global.h>
#include <memory.h>
#include <tchar.h>
#include <commctrl.h>
#include <shlwapi.h>
#include <crtdbg.h>
-#include <string.h>
-#include <stdio.h>
// Local Header Files
#include "resource.h"
diff --git a/ndb/src/cw/cpcd/APIService.cpp b/ndb/src/cw/cpcd/APIService.cpp
index 9cf17addcc2..caf19ddba0e 100644
--- a/ndb/src/cw/cpcd/APIService.cpp
+++ b/ndb/src/cw/cpcd/APIService.cpp
@@ -23,7 +23,6 @@
#include "APIService.hpp"
#include "CPCD.hpp"
#include <NdbMutex.h>
-#include <NdbStdio.h>
#include <OutputStream.hpp>
/**
diff --git a/ndb/src/cw/cpcd/CPCD.cpp b/ndb/src/cw/cpcd/CPCD.cpp
index 8864ccf6e4e..f2878b7dea1 100644
--- a/ndb/src/cw/cpcd/CPCD.cpp
+++ b/ndb/src/cw/cpcd/CPCD.cpp
@@ -15,11 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <string.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
-#include <NdbUnistd.h>
-#include <NdbStdio.h>
-#include <errno.h>
#include "APIService.hpp"
#include "CPCD.hpp"
diff --git a/ndb/src/cw/cpcd/Monitor.cpp b/ndb/src/cw/cpcd/Monitor.cpp
index a96f3509ee8..2935cd0a648 100644
--- a/ndb/src/cw/cpcd/Monitor.cpp
+++ b/ndb/src/cw/cpcd/Monitor.cpp
@@ -14,9 +14,10 @@
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 <NdbOut.hpp>
-#include <NdbUnistd.h>
#include <NdbSleep.h>
#include "CPCD.hpp"
diff --git a/ndb/src/cw/cpcd/Process.cpp b/ndb/src/cw/cpcd/Process.cpp
index a54c6b8e475..74426306a88 100644
--- a/ndb/src/cw/cpcd/Process.cpp
+++ b/ndb/src/cw/cpcd/Process.cpp
@@ -14,13 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <sys/types.h>
+#include <ndb_global.h>
#include <signal.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <NdbUnistd.h>
#include <BaseString.hpp>
#include <InputStream.hpp>
@@ -28,10 +25,9 @@
#include "CPCD.hpp"
#include <pwd.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <sys/stat.h>
+#ifdef HAVE_GETRLIMIT
#include <sys/resource.h>
+#endif
void
CPCD::Process::print(FILE * f){
@@ -108,12 +104,12 @@ bool
CPCD::Process::isRunning() {
if(m_pid <= 1){
- logger.critical("isRunning(%d) invalid pid: %d", m_id, m_pid);
+ //logger.critical("isRunning(%d) invalid pid: %d", m_id, m_pid);
return false;
}
/* Check if there actually exists a process with such a pid */
errno = 0;
- int s = kill((pid_t) m_pid, 0); /* Sending "signal" 0 to a process only
+ int s = kill((pid_t)-m_pid, 0); /* Sending "signal" 0 to a process only
* checkes if the process actually exists */
if(s != 0) {
switch(errno) {
@@ -130,7 +126,6 @@ CPCD::Process::isRunning() {
}
return false;
}
-
return true;
}
@@ -152,7 +147,6 @@ CPCD::Process::readPid() {
f = fopen(filename, "r");
if(f == NULL){
- logger.debug("readPid - %s not found", filename);
return -1; /* File didn't exist */
}
@@ -213,6 +207,7 @@ setup_environment(const char *env) {
static
int
set_ulimit(const BaseString & pair){
+#ifdef HAVE_GETRLIMIT
errno = 0;
do {
Vector<BaseString> list;
@@ -220,42 +215,43 @@ set_ulimit(const BaseString & pair){
if(list.size() != 2){
break;
}
-
- int resource = 0;
+
+ int res;
rlim_t value = RLIM_INFINITY;
if(!(list[1].trim() == "unlimited")){
value = atoi(list[1].c_str());
}
+
+ struct rlimit rlp;
+#define _RLIMIT_FIX(x) { res = getrlimit(x,&rlp); if(!res){ rlp.rlim_cur = value; res = setrlimit(x, &rlp); }}
+
if(list[0].trim() == "c"){
- resource = RLIMIT_CORE;
+ _RLIMIT_FIX(RLIMIT_CORE);
} else if(list[0] == "d"){
- resource = RLIMIT_DATA;
+ _RLIMIT_FIX(RLIMIT_DATA);
} else if(list[0] == "f"){
- resource = RLIMIT_FSIZE;
+ _RLIMIT_FIX(RLIMIT_FSIZE);
} else if(list[0] == "n"){
- resource = RLIMIT_NOFILE;
+ _RLIMIT_FIX(RLIMIT_NOFILE);
} else if(list[0] == "s"){
- resource = RLIMIT_STACK;
+ _RLIMIT_FIX(RLIMIT_STACK);
} else if(list[0] == "t"){
- resource = RLIMIT_CPU;
+ _RLIMIT_FIX(RLIMIT_CPU);
} else {
errno = EINVAL;
break;
}
- struct rlimit rlp;
- if(getrlimit(resource, &rlp) != 0){
+ if(!res)
break;
- }
-
- rlp.rlim_cur = value;
- if(setrlimit(resource, &rlp) != 0){
- break;
- }
+
return 0;
} while(false);
logger.error("Unable to process ulimit: %s(%s)",
pair.c_str(), strerror(errno));
return -1;
+#else
+ return 0; // Maybe it's ok anyway...
+#endif
}
void
@@ -360,8 +356,8 @@ CPCD::Process::start() {
*/
switch(pid = fork()) {
case 0: /* Child */
-
- writePid(getpid());
+ setsid();
+ writePid(getpgrp());
if(runas(m_runas.c_str()) == 0){
do_exec();
}
@@ -386,14 +382,13 @@ CPCD::Process::start() {
switch(fork()) {
case 0: /* Child */
signal(SIGCHLD, SIG_IGN);
- pid_t pid;
switch(pid = fork()) {
case 0: /* Child */
- writePid(getpid());
+ setsid();
+ writePid(getpgrp());
if(runas(m_runas.c_str()) != 0){
_exit(1);
}
- setsid();
do_exec();
_exit(1);
/* NOTREACHED */
@@ -424,15 +419,18 @@ CPCD::Process::start() {
logger.critical("Unknown process type");
return -1;
}
-
+
while(readPid() < 0){
sched_yield();
}
-
- if(pid != -1 && pid != m_pid){
- logger.error("pid and m_pid don't match: %d %d", pid, m_pid);
+
+ errno = 0;
+ pid_t pgid = getpgid(pid);
+
+ if(pgid != -1 && pgid != m_pid){
+ logger.error("pgid and m_pid don't match: %d %d (%d)", pgid, m_pid, pid);
}
-
+
if(isRunning()){
m_status = RUNNING;
return 0;
@@ -449,33 +447,36 @@ CPCD::Process::stop() {
unlink(filename);
if(m_pid <= 1){
- logger.critical("Stopping process with bogus pid: %d", m_pid);
+ logger.critical("Stopping process with bogus pid: %d id: %d",
+ m_pid, m_id);
return;
}
m_status = STOPPING;
-
- int ret = kill((pid_t)m_pid, SIGTERM);
+
+ errno = 0;
+ int ret = kill(-m_pid, SIGTERM);
switch(ret) {
case 0:
- logger.debug("Sent SIGTERM to pid %d", (int)m_pid);
+ logger.debug("Sent SIGTERM to pid %d", (int)-m_pid);
break;
default:
- logger.debug("kill pid: %d : %s", (int)m_pid, strerror(errno));
+ logger.debug("kill pid: %d : %s", (int)-m_pid, strerror(errno));
break;
}
-
+
if(isRunning()){
- ret = kill((pid_t)m_pid, SIGKILL);
+ errno = 0;
+ ret = kill(-m_pid, SIGKILL);
switch(ret) {
case 0:
- logger.debug("Sent SIGKILL to pid %d", (int)m_pid);
+ logger.debug("Sent SIGKILL to pid %d", (int)-m_pid);
break;
default:
- logger.debug("kill pid: %d : %s\n", (int)m_pid, strerror(errno));
+ logger.debug("kill pid: %d : %s\n", (int)-m_pid, strerror(errno));
break;
}
- }
-
+ }
+
m_pid = -1;
m_status = STOPPED;
}
diff --git a/ndb/src/cw/cpcd/common.cpp b/ndb/src/cw/cpcd/common.cpp
index 731866b22fd..cb1c0c37183 100644
--- a/ndb/src/cw/cpcd/common.cpp
+++ b/ndb/src/cw/cpcd/common.cpp
@@ -14,11 +14,11 @@
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 "common.hpp"
#include <logger/Logger.hpp>
#include <pwd.h>
-#include <sys/types.h>
-#include <unistd.h>
#include <Properties.hpp>
#include <BaseString.hpp>
@@ -152,7 +152,10 @@ parse_config_file(struct getargs args[], int num_arg, const Properties& p){
break;
}
}
- if(!found)
+ if(!found) {
printf("Unknown parameter: %s\n", name);
+ return 1;
+ }
}
+ return 0;
}
diff --git a/ndb/src/cw/cpcd/common.hpp b/ndb/src/cw/cpcd/common.hpp
index 65fcce05f66..c3d87b8b9f5 100644
--- a/ndb/src/cw/cpcd/common.hpp
+++ b/ndb/src/cw/cpcd/common.hpp
@@ -17,7 +17,7 @@
#ifndef __CPCD_COMMON_HPP_INCLUDED__
#define __CPCD_COMMON_HPP_INCLUDED__
-#include <stdio.h>
+#include <ndb_global.h>
#include <logger/Logger.hpp>
#include <getarg.h>
diff --git a/ndb/src/cw/cpcd/main.cpp b/ndb/src/cw/cpcd/main.cpp
index 8dd4f2b4608..11f6238d5f7 100644
--- a/ndb/src/cw/cpcd/main.cpp
+++ b/ndb/src/cw/cpcd/main.cpp
@@ -14,9 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <sys/types.h> /* Needed for mkdir(2) */
-#include <sys/stat.h> /* Needed for mkdir(2) */
-#include <errno.h>
+#include <ndb_global.h> /* Needed for mkdir(2) */
#include <signal.h>
#include "CPCD.hpp"
diff --git a/ndb/src/cw/test/socketclient/socketClientTest.cpp b/ndb/src/cw/test/socketclient/socketClientTest.cpp
index a4a0ed1e933..423c196aa43 100644
--- a/ndb/src/cw/test/socketclient/socketClientTest.cpp
+++ b/ndb/src/cw/test/socketclient/socketClientTest.cpp
@@ -15,11 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <Properties.hpp>
#include <socket_io.h>
-#include <NdbStdio.h>
-#include <stdlib.h>
#include <NdbTick.h>
#include <NdbMain.h>
#include <NdbSleep.h>
diff --git a/ndb/src/cw/util/ClientInterface.hpp b/ndb/src/cw/util/ClientInterface.hpp
index 764705afacd..66ecfe05197 100644
--- a/ndb/src/cw/util/ClientInterface.hpp
+++ b/ndb/src/cw/util/ClientInterface.hpp
@@ -16,6 +16,7 @@
#ifndef CLIENT_IF_HPP
#define CLIENT_IF_HPP
+#include <ndb_global.h>
#include <Parser.hpp>
#include <InputStream.hpp>
#include <Parser.hpp>
@@ -23,9 +24,6 @@
#include <Properties.hpp>
#include "SocketRegistry.hpp"
#include "SocketService.hpp"
-#include "string.h"
-#include <stdio.h>
-#include <stdlib.h>
class ClientInterface {
private:
diff --git a/ndb/src/kernel/blocks/backup/FsBuffer.hpp b/ndb/src/kernel/blocks/backup/FsBuffer.hpp
index 4b5d95a19a5..2f3c7daae43 100644
--- a/ndb/src/kernel/blocks/backup/FsBuffer.hpp
+++ b/ndb/src/kernel/blocks/backup/FsBuffer.hpp
@@ -17,10 +17,7 @@
#ifndef FS_BUFFER_HPP
#define FS_BUFFER_HPP
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ndb_types.h>
+#include <ndb_global.h>
#define DEBUG(x)
diff --git a/ndb/src/kernel/blocks/backup/read.cpp b/ndb/src/kernel/blocks/backup/read.cpp
index 8300c74ab43..921c352ea13 100644
--- a/ndb/src/kernel/blocks/backup/read.cpp
+++ b/ndb/src/kernel/blocks/backup/read.cpp
@@ -15,9 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <ndb_global.h>
#include <NdbTCP.h>
#include <NdbOut.hpp>
diff --git a/ndb/src/kernel/blocks/backup/restore/Makefile b/ndb/src/kernel/blocks/backup/restore/Makefile
index f99e3e3da0d..4c884525d73 100644
--- a/ndb/src/kernel/blocks/backup/restore/Makefile
+++ b/ndb/src/kernel/blocks/backup/restore/Makefile
@@ -1,12 +1,12 @@
include .defs.mk
-TYPE := ndbapi ndbapiclient
+TYPE := *
BIN_TARGET := restore
BIN_TARGET_LIBS :=
-BIN_TARGET_ARCHIVES := NDB_API general
+BIN_TARGET_ARCHIVES := NDB_API
-CCFLAGS_LOC = -I.. -I$(NDB_TOP)/src/ndbapi
+CCFLAGS_LOC = -I.. -I$(NDB_TOP)/src/ndbapi -I$(NDB_TOP)/include/ndbapi -I$(NDB_TOP)/include/util -I$(NDB_TOP)/include/portlib -I$(NDB_TOP)/include/kernel
#ifneq ($(MYSQLCLUSTER_TOP),)
#CCFLAGS_LOC +=-I$(MYSQLCLUSTER_TOP)/include -D USE_MYSQL
diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.cpp b/ndb/src/kernel/blocks/backup/restore/Restore.cpp
index 50eb0df7c56..2c3c1c8df7b 100644
--- a/ndb/src/kernel/blocks/backup/restore/Restore.cpp
+++ b/ndb/src/kernel/blocks/backup/restore/Restore.cpp
@@ -14,11 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
#include "Restore.hpp"
#include "BackupFormat.hpp"
#include <NdbTCP.h>
-#include <NdbStdio.h>
#include <OutputStream.hpp>
#include <Bitmask.hpp>
@@ -514,7 +512,8 @@ RestoreMetaData::parseTableDescriptor(const Uint32 * data,
NdbDictionary::Column::Type type;
if(getMajor(m_fileHeader.NdbVersion) < VERSION_3X) {
tableImpl->setName(tableName);
- for(Uint32 i = 0 ; i < tableImpl->getNoOfColumns(); i++) {
+ Uint32 noOfColumns = tableImpl->getNoOfColumns();
+ for(Uint32 i = 0 ; i < noOfColumns; i++) {
type = convertToV3x(tableImpl->getColumn(i)->m_extType,
columnTypeMapping,
-1);
@@ -562,7 +561,7 @@ bool
TupleS::prepareRecord(const TableS & tab){
m_currentTable = &tab;
for(int i = 0; i<allAttributes.size(); i++) {
- if(!allAttributes[i] == NULL)
+ if(allAttributes[i] != NULL)
delete allAttributes[i];
}
allAttributes.clear();
diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.hpp b/ndb/src/kernel/blocks/backup/restore/Restore.hpp
index f1a73bb18b9..0c075e18933 100644
--- a/ndb/src/kernel/blocks/backup/restore/Restore.hpp
+++ b/ndb/src/kernel/blocks/backup/restore/Restore.hpp
@@ -17,16 +17,13 @@
#ifndef RESTORE_H
#define RESTORE_H
-#include <stddef.h>
+#include <ndb_global.h>
#include <BackupFormat.hpp>
#include <NdbApi.hpp>
#include <AttrType.hpp>
#include <NdbOut.hpp>
#include "myVector.hpp"
-#include <NdbStdio.h>
-#include <NdbUnistd.h>
-#include <NdbString.h>
#include <ndb_version.h>
#include <version.h>
diff --git a/ndb/src/kernel/blocks/backup/restore/main.cpp b/ndb/src/kernel/blocks/backup/restore/main.cpp
index b38f6ab751b..4c15785d5c2 100644
--- a/ndb/src/kernel/blocks/backup/restore/main.cpp
+++ b/ndb/src/kernel/blocks/backup/restore/main.cpp
@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
#include "Restore.hpp"
#include <getarg.h>
#include <NdbSleep.h>
diff --git a/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp b/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp
index b16990bda6c..bf721a0b30a 100644
--- a/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp
+++ b/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp
@@ -15,13 +15,11 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
+#include <ndb_global.h>
+
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <SchemaFile.hpp>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
void
usage(const char * prg){
diff --git a/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp b/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp
index 4c55425bdd7..efa4b9c92c5 100644
--- a/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp
+++ b/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp
@@ -15,13 +15,11 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
+#include <ndb_global.h>
+
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <Sysfile.hpp>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
void
usage(const char * prg){
diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp
index d2d166fa03e..540df7b507e 100644
--- a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp
+++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp
@@ -25,11 +25,10 @@
//----------------------------------------------------------------
+#include <ndb_global.h>
+
#include "records.hpp"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
+
#define RETURN_ERROR 1
#define RETURN_OK 0
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
index 887f82308d6..54cb93e9736 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
@@ -49,7 +49,7 @@ void Dbtup::execTUPFRAGREQ(Signal* signal)
Uint32 noOfAttributes = signal->theData[4];
Uint32 fragId = signal->theData[5];
Uint32 noOfNullAttr = signal->theData[7];
- Uint32 schemaVersion = signal->theData[8];
+ /* Uint32 schemaVersion = signal->theData[8];*/
Uint32 noOfKeyAttr = signal->theData[9];
Uint32 noOfNewAttr = signal->theData[10];
diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
index c56e455a42a..4737c8422c4 100644
--- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
+++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
@@ -83,6 +83,9 @@
#define jamEntry() jamEntryLine(90000 + __LINE__)
#endif
+#undef max
+#undef min
+
class Configuration;
class Dbtux : public SimulatedBlock {
diff --git a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
index 2cb129bc591..92410e1a784 100644
--- a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
+++ b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
@@ -14,10 +14,10 @@
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 "DbUtil.hpp"
-#include <new>
-#include <stddef.h>
#include <ndb_version.h>
#include <signaldata/WaitGCP.hpp>
@@ -1303,26 +1303,6 @@ DbUtil::prepareOperation(Signal* signal, PreparePtr prepPtr)
TcKeyReq::setAIInTcKeyReq(requestInfo, 0); // Attrinfo sent separately
prepOpPtr.p->tckey.requestInfo = requestInfo;
- if (operationType == UtilPrepareReq::Read) {
- // ResultSet
- AttrMappingBuffer::ConstDataBufferIterator tmpIt;
-#if 0 //def EVENT_DEBUG
- ResultSetBuffer & rs = prepOpPtr.p->rsInfo;
- ResultSetInfoBuffer::DataBufferIterator it;
- rs.first(it);
- for (prepOpPtr.p->attrMapping.first(tmpIt);
- tmpIt.curr.i != RNIL;
- prepOpPtr.p->attrMapping.next(tmpIt)) {
- AttributeHeader* ah = (AttributeHeader *) tmpIt.data;
- ah->print(stdout);
- AttributeHeader* rsah = (AttributeHeader *) it.data;
- rsah->print(stdout);
- rs.next(it,1);
- printf("%d\n",it.data);
- }
-#endif
- }
-
/****************************
* Confirm completed prepare
****************************/
@@ -1914,7 +1894,6 @@ DbUtil::runOperation(Signal* signal, TransactionPtr & transPtr,
Operation * op = opPtr.p;
const PreparedOperation * pop = op->prepOp;
- Uint32 lastFlag = 0;
if(!transPtr.p->operations.next(opPtr)){
TcKeyReq::setCommitFlag(start, 1); // Last operation
TcKeyReq::setExecuteFlag(start, 1);
@@ -2127,43 +2106,11 @@ DbUtil::execTRANSID_AI(Signal* signal){
/**
* Save result
*/
- Uint32 srcSz = dataLen;
const Uint32 *src = &signal->theData[3];
- const Uint32 segSize = opP->rs.getSegmentSize();
-
-#if 0 //def EVENT_DEBUG
- printf("rsRecv %u, dataLen %u, rsExpect %u\n",
- opP->rsRecv, dataLen, opP->rsExpect);
-#endif
-
ResultSetBuffer::DataBufferIterator rs = opP->rsIterator;
-#if 0 //def EVENT_DEBUG
- for(int i = 0; i < dataLen; i++)
- printf("H'%.8x ", src[i]);
-#endif
-
ndbrequire(opP->rs.import(rs,src,dataLen));
opP->rs.next(rs, dataLen);
-
-#if 0 // replaced this section with import() above
- while(srcSz > segSize){
- ndbrequire(rs.curr.i != RNIL);
- memcpy(rs.data, src, segSize << 2);
- opP->rs.next(rs, segSize);
- srcSz -= segSize;
- // src += segSize * 4; // Bug?
- src += segSize;
- }
-
- if(srcSz > 0){
- jam();
- memcpy(rs.data, src, srcSz << 2);
- rs.curr.i = RNIL;
- rs.data = 0;
- }
-#endif
-
opP->rsIterator = rs;
if(!opP->complete()){
@@ -2171,20 +2118,12 @@ DbUtil::execTRANSID_AI(Signal* signal){
return;
}
-#if 0 //def EVENT_DEBUG
- printf("op complete\n");
-#endif
-
transPtr.p->recv++;
if(!transPtr.p->complete()){
jam();
return;
}
-#if 0 //def EVENT_DEBUG
- printf("trans complete\n");
-#endif
-
finishTransaction(signal, transPtr);
}
diff --git a/ndb/src/kernel/blocks/grep/Grep.cpp b/ndb/src/kernel/blocks/grep/Grep.cpp
index 093e9a225e6..ee506ce922a 100644
--- a/ndb/src/kernel/blocks/grep/Grep.cpp
+++ b/ndb/src/kernel/blocks/grep/Grep.cpp
@@ -1294,7 +1294,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::Code err = (GrepError::Code)ref->err;*/
SubscriptionPtr subPtr;
c_subscriptions.getPtr(subPtr, subData);
diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
index 0e2aa4c6903..f73c1ec5ee7 100644
--- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
@@ -23,20 +23,17 @@
#endif
#endif
+#include <ndb_global.h>
+
#include "Error.hpp"
#include "AsyncFile.hpp"
#include <ErrorHandlingMacros.hpp>
#include <kernel_types.h>
-#include <string.h>
#include <NdbMem.h>
#include <NdbThread.h>
#include <signaldata/FsOpenReq.hpp>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-
#ifdef NDB_LINUX
// This is for pread and pwrite
#ifndef __USE_UNIX98
@@ -44,9 +41,7 @@
#endif
#endif
-#include <NdbUnistd.h>
#if defined NDB_WIN32 || defined NDB_OSE || defined NDB_SOFTOSE
-#include <NdbStdio.h>
#else
// For readv and writev
#include <sys/uio.h>
@@ -566,9 +561,8 @@ AsyncFile::writeReq( Request * request)
if (((i + 1) < request->par.readWrite.numberOfPages)) {
// There are more pages to write
// Check that offsets are consequtive
- if ((page_offset + request->par.readWrite.pages[i].size)
- !=
- request->par.readWrite.pages[i+1].offset) {
+ off_t tmp = page_offset + request->par.readWrite.pages[i].size;
+ if (tmp != request->par.readWrite.pages[i+1].offset) {
// Next page is not aligned with previous, not allowed
DEBUG(ndbout_c("Page offsets are not aligned"));
request->error = EINVAL;
diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp
index b9954ba130f..004752c9543 100644
--- a/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp
@@ -16,10 +16,8 @@
//#define TESTDEBUG 1
-#include <sys/stat.h>
-#include <fcntl.h>
+#include <ndb_global.h>
-#include <string.h>
#include <kernel_types.h>
#include <Pool.hpp>
#include "AsyncFile.hpp"
diff --git a/ndb/src/kernel/blocks/ndbfs/Filename.cpp b/ndb/src/kernel/blocks/ndbfs/Filename.cpp
index c0bc52b4501..494c9c74eb9 100644
--- a/ndb/src/kernel/blocks/ndbfs/Filename.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/Filename.cpp
@@ -14,10 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdlib.h>
-#include <string.h>
-#include <NdbStdio.h>
-#include <NdbUnistd.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include "Filename.hpp"
diff --git a/ndb/src/kernel/blocks/ndbfs/Filename.hpp b/ndb/src/kernel/blocks/ndbfs/Filename.hpp
index 4c3569b5485..29aba79c9dc 100644
--- a/ndb/src/kernel/blocks/ndbfs/Filename.hpp
+++ b/ndb/src/kernel/blocks/ndbfs/Filename.hpp
@@ -52,8 +52,8 @@
//
//===========================================================================
+#include <ndb_global.h>
#include <kernel_types.h>
-#include <NdbUnistd.h>
class Filename
{
diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
index 6e0c2721ca0..435a6a6b208 100644
--- a/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
+++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
@@ -76,7 +76,6 @@
#include "NdbCondition.h"
#include <NdbOut.hpp>
-#include <assert.h>
template <class T>
class MemoryChannel
diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp
index 9f70efcadf7..ca90bc60153 100644
--- a/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp
+++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp
@@ -65,7 +65,6 @@
#include "NdbMutex.h"
#include "NdbCondition.h"
-#include <assert.h>
diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
index 8992a2104e9..36322ffad1e 100644
--- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
@@ -14,8 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <limits.h>
-#include <errno.h>
+#include <ndb_global.h>
#include "Ndbfs.hpp"
#include "AsyncFile.hpp"
@@ -855,7 +854,7 @@ int Ndbfs::translateErrno(int aErrno)
//no space left on device
case ENFILE:
case EDQUOT:
-#ifndef NDB_MACOSX
+#ifdef ENOSR
case ENOSR:
#endif
case ENOSPC:
@@ -873,12 +872,16 @@ int Ndbfs::translateErrno(int aErrno)
return FsRef::fsErrInvalidParameters;
//environment error
case ELOOP:
-#ifndef NDB_MACOSX
+#ifdef ENOLINK
case ENOLINK:
+#endif
+#ifdef EMULTIHOP
case EMULTIHOP:
#endif
-#ifndef NDB_LINUX
+#ifdef EOPNOTSUPP
case EOPNOTSUPP:
+#endif
+#ifdef ESPIPE
case ESPIPE:
#endif
case EPIPE:
diff --git a/ndb/src/kernel/blocks/suma/SumaInit.cpp b/ndb/src/kernel/blocks/suma/SumaInit.cpp
index e9fba5e789c..9f0659942a2 100644
--- a/ndb/src/kernel/blocks/suma/SumaInit.cpp
+++ b/ndb/src/kernel/blocks/suma/SumaInit.cpp
@@ -132,9 +132,9 @@ SumaParticipant::~SumaParticipant()
Suma::Suma(const Configuration & conf) :
SumaParticipant(conf),
+ Restart(*this),
c_nodes(c_nodePool),
- c_runningSubscriptions(c_subCoordinatorPool),
- Restart(*this)
+ c_runningSubscriptions(c_subCoordinatorPool)
{
c_nodePool.setSize(MAX_NDB_NODES);
diff --git a/ndb/src/kernel/error/ErrorReporter.cpp b/ndb/src/kernel/error/ErrorReporter.cpp
index 1aa937f4675..56627cba46f 100644
--- a/ndb/src/kernel/error/ErrorReporter.cpp
+++ b/ndb/src/kernel/error/ErrorReporter.cpp
@@ -15,17 +15,16 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "Error.hpp"
#include "ErrorReporter.hpp"
#include "ErrorMessages.hpp"
#include <FastScheduler.hpp>
#include <DebuggerNames.hpp>
-#include <NdbUnistd.h>
-#include <NdbStdio.h>
#include <NdbHost.h>
#include <NdbConfig.h>
-#include <string.h>
#include <Configuration.hpp>
#define MESSAGE_LENGTH 400
diff --git a/ndb/src/kernel/error/ErrorReporter.hpp b/ndb/src/kernel/error/ErrorReporter.hpp
index f1428821ab0..20340a9602f 100644
--- a/ndb/src/kernel/error/ErrorReporter.hpp
+++ b/ndb/src/kernel/error/ErrorReporter.hpp
@@ -17,9 +17,10 @@
#ifndef ERRORREPORTER_H
#define ERRORREPORTER_H
+#include <ndb_global.h>
+
#include "TimeModule.hpp"
#include "Error.hpp"
-#include <stdio.h>
#include <Emulator.hpp>
diff --git a/ndb/src/kernel/error/TimeModule.cpp b/ndb/src/kernel/error/TimeModule.cpp
index c0f4e40858f..4bd8e3daf99 100644
--- a/ndb/src/kernel/error/TimeModule.cpp
+++ b/ndb/src/kernel/error/TimeModule.cpp
@@ -16,8 +16,8 @@
+#include <ndb_global.h>
#include "TimeModule.hpp"
-#include <time.h>
static const char* cMonth[] = { "x", "January", "February", "Mars", "April", "May", "June",
"July", "August", "September", "October", "November", "December"};
diff --git a/ndb/src/kernel/ndb-main/Main.cpp b/ndb/src/kernel/ndb-main/Main.cpp
index 88fd9d177de..46eb41b0ec6 100644
--- a/ndb/src/kernel/ndb-main/Main.cpp
+++ b/ndb/src/kernel/ndb-main/Main.cpp
@@ -14,6 +14,8 @@
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 <ndb_version.h>
#include "Configuration.hpp"
#include <TransporterRegistry.hpp>
@@ -32,7 +34,6 @@
#include <NodeState.hpp>
#if defined NDB_SOLARIS
-#include <sys/types.h> // For system information
#include <sys/processor.h> // For system informatio
#endif
@@ -41,10 +42,6 @@
#endif
extern EventLogger g_eventLogger;
-#if defined (NDB_LINUX) || defined (NDB_SOLARIS)
-#include <sys/types.h>
-#include <sys/wait.h>
-#endif
void catchsigs(bool ignore); // for process signal handling
extern "C" void handler(int signo); // for process signal handling
@@ -81,10 +78,6 @@ NDB_MAIN(ndb_kernel){
char homePath[255];
NdbConfig_HomePath(homePath, 255);
-#if defined (NDB_LINUX) || defined (NDB_SOLARIS)
- /**
- * This has only been tested with linux & solaris
- */
if (theConfig->getDaemonMode()) {
// Become a daemon
char lockfile[255], logfile[255];
@@ -137,7 +130,6 @@ NDB_MAIN(ndb_kernel){
}
g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid());
-#endif
systemInfo(* theConfig,
theConfig->clusterConfigurationData().SizeAltData.logLevel);
@@ -188,9 +180,9 @@ NDB_MAIN(ndb_kernel){
void
systemInfo(const Configuration & config, const LogLevel & logLevel){
+#ifdef NDB_WIN32
int processors = 0;
int speed;
-#ifdef NDB_WIN32
SYSTEM_INFO sinfo;
GetSystemInfo(&sinfo);
processors = sinfo.dwNumberOfProcessors;
@@ -236,16 +228,25 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){
void
catchsigs(bool ignore){
#if ! defined NDB_SOFTOSE && !defined NDB_OSE
+
+#if defined SIGRTMIN
+ #define MAX_SIG_CATCH SIGRTMIN
+#elif defined NSIG
+ #define MAX_SIG_CATCH NSIG
+#else
+ #error "neither SIGRTMIN or NSIG is defined on this platform, please report bug at bugs.mysql.com"
+#endif
+
// Makes the main process catch process signals, eg installs a
// handler named "handler". "handler" will then be called is instead
// of the defualt process signal handler)
if(ignore){
- for(int i = 1; i<100; i++){
+ for(int i = 1; i < MAX_SIG_CATCH; i++){
if(i != SIGCHLD)
signal(i, SIG_IGN);
- }
+ }
} else {
- for(int i = 1; i<100; i++){
+ for(int i = 1; i < MAX_SIG_CATCH; i++){
signal(i, handler);
}
}
@@ -260,8 +261,10 @@ handler(int sig){
case SIGINT: /* 2 - Interrupt */
case SIGQUIT: /* 3 - Quit */
case SIGTERM: /* 15 - Terminate */
-#ifndef NDB_MACOSX
+#ifdef SIGPWR
case SIGPWR: /* 19 - Power fail */
+#endif
+#ifdef SIGPOLL
case SIGPOLL: /* 22 */
#endif
case SIGSTOP: /* 23 */
@@ -270,6 +273,9 @@ handler(int sig){
case SIGTTOU: /* 27 */
globalData.theRestartFlag = perform_stop;
break;
+#ifdef SIGWINCH
+ case SIGWINCH:
+#endif
case SIGPIPE:
/**
* Can happen in TCP Transporter
diff --git a/ndb/src/kernel/vm/ArrayPool.hpp b/ndb/src/kernel/vm/ArrayPool.hpp
index 4a84047b614..284d29dcefa 100644
--- a/ndb/src/kernel/vm/ArrayPool.hpp
+++ b/ndb/src/kernel/vm/ArrayPool.hpp
@@ -17,12 +17,12 @@
#ifndef ARRAY_POOL_HPP
#define ARRAY_POOL_HPP
+#include <ndb_global.h>
+
#include <pc.hpp>
#include <ErrorReporter.hpp>
#include <NdbMem.h>
#include <Bitmask.hpp>
-#include <assert.h>
-#include <stddef.h>
template <class T> class Array;
template <class T> class SLList;
diff --git a/ndb/src/kernel/vm/ClusterConfiguration.cpp b/ndb/src/kernel/vm/ClusterConfiguration.cpp
index f04081ee3c1..3a6478380d1 100644
--- a/ndb/src/kernel/vm/ClusterConfiguration.cpp
+++ b/ndb/src/kernel/vm/ClusterConfiguration.cpp
@@ -14,6 +14,8 @@
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 "ClusterConfiguration.hpp"
#include <ErrorHandlingMacros.hpp>
@@ -27,9 +29,6 @@
#include <signaldata/TupSizeAltReq.hpp>
#include <signaldata/TuxSizeAltReq.hpp>
-#include <string.h>
-#include <assert.h>
-
ClusterConfiguration::ClusterConfiguration()
{
for (unsigned i= 0; i< MAX_SIZEALT_BLOCKS; i++) // initialize
diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp
index 03495449787..706d75509f2 100644
--- a/ndb/src/kernel/vm/Configuration.cpp
+++ b/ndb/src/kernel/vm/Configuration.cpp
@@ -24,7 +24,6 @@
#include <NdbMem.h>
#include <NdbOut.hpp>
#include <WatchDog.hpp>
-#include <NdbString.h>
#include <getarg.h>
diff --git a/ndb/src/kernel/vm/DLHashTable.hpp b/ndb/src/kernel/vm/DLHashTable.hpp
index f7cd7ae5228..13a9632f8da 100644
--- a/ndb/src/kernel/vm/DLHashTable.hpp
+++ b/ndb/src/kernel/vm/DLHashTable.hpp
@@ -17,9 +17,8 @@
#ifndef DL_HASHTABLE_HPP
#define DL_HASHTABLE_HPP
+#include <ndb_global.h>
#include "ArrayList.hpp"
-#include <assert.h>
-#include <stddef.h>
/**
* DLHashTable implements a hashtable using chaining
diff --git a/ndb/src/kernel/vm/DLHashTable2.hpp b/ndb/src/kernel/vm/DLHashTable2.hpp
index 8386790b0a6..6b166331631 100644
--- a/ndb/src/kernel/vm/DLHashTable2.hpp
+++ b/ndb/src/kernel/vm/DLHashTable2.hpp
@@ -17,10 +17,9 @@
#ifndef DL_HASHTABLE2_HPP
#define DL_HASHTABLE2_HPP
+#include <ndb_global.h>
+
#include "ArrayList.hpp"
-#include <assert.h>
-#include <stddef.h>
-#include <new>
/**
* DLHashTable2 is a DLHashTable variant meant for cases where different
diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp
index a852e045c6e..0d6d3f55acb 100644
--- a/ndb/src/kernel/vm/Emulator.cpp
+++ b/ndb/src/kernel/vm/Emulator.cpp
@@ -14,6 +14,8 @@
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 "Emulator.hpp"
#include <FastScheduler.hpp>
#include <SignalLoggerManager.hpp>
@@ -31,19 +33,12 @@
#include <NdbOut.hpp>
#include <NdbMutex.h>
#include <NdbSleep.h>
-#include <stdlib.h>
#include <new>
extern "C" {
extern void (* ndb_new_handler)();
}
-
-#if defined (NDB_LINUX) || defined (NDB_SOLARIS)
-#include <sys/types.h>
-#include <sys/wait.h>
-#endif
-
/**
* Declare the global variables
*/
diff --git a/ndb/src/kernel/vm/GlobalData.hpp b/ndb/src/kernel/vm/GlobalData.hpp
index ca7dd467750..99b65727374 100644
--- a/ndb/src/kernel/vm/GlobalData.hpp
+++ b/ndb/src/kernel/vm/GlobalData.hpp
@@ -17,11 +17,10 @@
#ifndef GLOBAL_DATA_H
#define GLOBAL_DATA_H
+#include <ndb_global.h>
#include <kernel_types.h>
#include "Prio.hpp"
#include "VMSignal.hpp"
-#include <stdlib.h>
-#include <assert.h>
#include <BlockNumbers.h>
#include <NodeState.hpp>
diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp
index f36b3e43d42..e3f087d7d74 100644
--- a/ndb/src/kernel/vm/SimulatedBlock.cpp
+++ b/ndb/src/kernel/vm/SimulatedBlock.cpp
@@ -14,6 +14,8 @@
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 "SimulatedBlock.hpp"
#include <NdbOut.hpp>
#include <GlobalData.hpp>
@@ -24,8 +26,6 @@
#include <SignalLoggerManager.hpp>
#include <FastScheduler.hpp>
#include <NdbMem.h>
-#include <NdbStdio.h>
-#include <stdarg.h>
#include <signaldata/EventReport.hpp>
#include <signaldata/ContinueFragmented.hpp>
#include <signaldata/NodeStateSignalData.hpp>
diff --git a/ndb/src/kernel/vm/TransporterCallback.cpp b/ndb/src/kernel/vm/TransporterCallback.cpp
index 1fec4ea86bd..3798e4040c8 100644
--- a/ndb/src/kernel/vm/TransporterCallback.cpp
+++ b/ndb/src/kernel/vm/TransporterCallback.cpp
@@ -14,12 +14,13 @@
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 <TransporterCallback.hpp>
#include <TransporterRegistry.hpp>
#include <FastScheduler.hpp>
#include <Emulator.hpp>
#include <ErrorHandlingMacros.hpp>
-#include <stdio.h>
#include "LongSignal.hpp"
diff --git a/ndb/src/kernel/vm/VMSignal.hpp b/ndb/src/kernel/vm/VMSignal.hpp
index d436143c055..45e731f2079 100644
--- a/ndb/src/kernel/vm/VMSignal.hpp
+++ b/ndb/src/kernel/vm/VMSignal.hpp
@@ -17,14 +17,15 @@
#ifndef VMSignal_H
#define VMSignal_H
+#include <ndb_global.h>
+#include <ndb_limits.h>
+#include <kernel_types.h>
+
#include <ErrorReporter.hpp>
#include <NodeBitmask.hpp>
-#include <ndb_limits.h>
-#include <kernel_types.h>
#include <RefConvert.hpp>
#include <TransporterDefinitions.hpp>
-#include <stdlib.h>
/**
* Struct used when sending to multiple blocks
diff --git a/ndb/src/kernel/vm/al_test/arrayListTest.cpp b/ndb/src/kernel/vm/al_test/arrayListTest.cpp
index 39d8170cfc5..bb320106653 100644
--- a/ndb/src/kernel/vm/al_test/arrayListTest.cpp
+++ b/ndb/src/kernel/vm/al_test/arrayListTest.cpp
@@ -16,11 +16,11 @@
+#include <ndb_global.hpp>
+
#include <ArrayList.hpp>
-#include <stdlib.h>
#include <NdbOut.hpp>
#include <NdbTick.h>
-#include <assert.h>
struct A_Listable_Object {
Uint32 next;
diff --git a/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp b/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp
index 8b554d5bb41..e80905121e1 100644
--- a/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp
+++ b/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp
@@ -16,12 +16,11 @@
+#include <ndb_global.h>
+
#include <ArrayList.hpp>
-#include <stdlib.h>
#include <NdbOut.hpp>
#include <NdbTick.h>
-#include <assert.h>
-#include <string.h>
struct A_Poolable_Object {
Uint32 next;
diff --git a/ndb/src/kernel/vm/al_test/main.cpp b/ndb/src/kernel/vm/al_test/main.cpp
index 42c36173b56..23193b50725 100644
--- a/ndb/src/kernel/vm/al_test/main.cpp
+++ b/ndb/src/kernel/vm/al_test/main.cpp
@@ -14,11 +14,11 @@
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 <ArrayList.hpp>
-#include <stdlib.h>
#include <NdbOut.hpp>
#include <NdbTick.h>
-#include <assert.h>
#include <NdbMain.h>
#include "arrayListTest.cpp"
diff --git a/ndb/src/kernel/vm/testCopy/rr.cpp b/ndb/src/kernel/vm/testCopy/rr.cpp
index 2da8383f523..1e8305dfe4c 100644
--- a/ndb/src/kernel/vm/testCopy/rr.cpp
+++ b/ndb/src/kernel/vm/testCopy/rr.cpp
@@ -15,10 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <sched.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdio.h>
int
main(int argc, char * const argv[]){
diff --git a/ndb/src/kernel/vm/testCopy/testCopy.cpp b/ndb/src/kernel/vm/testCopy/testCopy.cpp
index 1b4b24f5934..78a1dab2619 100644
--- a/ndb/src/kernel/vm/testCopy/testCopy.cpp
+++ b/ndb/src/kernel/vm/testCopy/testCopy.cpp
@@ -15,11 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbTick.h>
-#include <ndb_types.h>
-#include <string.h>
-#include <stdlib.h>
#ifdef __NDB_FORTE6
#define HAND
diff --git a/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp b/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp
index def8387e343..5ba59418223 100644
--- a/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp
+++ b/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp
@@ -14,10 +14,12 @@
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 <DataBuffer.hpp>
-#include <stdlib.h>
-#include <string.h>
+
+#undef test
struct Buffer {
Buffer(Uint32 size){ m_sz = size; buffer = new Uint32[m_sz]; m_len = 0;}
diff --git a/ndb/src/kernel/vm/testLongSig/testLongSig.cpp b/ndb/src/kernel/vm/testLongSig/testLongSig.cpp
index 6d421268a0a..af4e2ca6e24 100644
--- a/ndb/src/kernel/vm/testLongSig/testLongSig.cpp
+++ b/ndb/src/kernel/vm/testLongSig/testLongSig.cpp
@@ -15,10 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include <editline/editline.h>
#include <SignalSender.hpp>
-#include <assert.h>
-#include <stdlib.h>
void
print_help(){
diff --git a/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp b/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp
index 20a5d5230fb..e16870edf11 100644
--- a/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp
+++ b/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp
@@ -14,12 +14,13 @@
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 <TransporterDefinitions.hpp>
#include <SimpleProperties.hpp>
#include <LongSignal.hpp>
-#include <stdlib.h>
-#include <string.h>
+
+#undef test
struct Buffer {
Buffer(Uint32 size){ m_sz = size; buffer = new Uint32[m_sz]; m_len = 0;}
diff --git a/ndb/src/mgmapi/Makefile b/ndb/src/mgmapi/Makefile
index fac852dbba8..9e7ba4f5ac7 100644
--- a/ndb/src/mgmapi/Makefile
+++ b/ndb/src/mgmapi/Makefile
@@ -9,7 +9,7 @@ A_LIB := Y
SO_LIB := Y
PIC_LIB := Y
-DIRS := test
+#DIRS := test
LIB_TARGET := MGM_API
LIB_TARGET_ARCHIVES := $(ARCHIVE_TARGET) general portlib
diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp
index 4c1355e8e46..fcdfe943fb1 100644
--- a/ndb/src/mgmapi/mgmapi.cpp
+++ b/ndb/src/mgmapi/mgmapi.cpp
@@ -14,17 +14,13 @@
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>
#include "mgmapi.h"
#include "mgmapi_debug.h"
#include <socket_io.h>
-#include <stdlib.h>
-
-#include <string.h>
-#include <NdbStdio.h>
-#include <NdbString.h>
-#include <errno.h>
#include <NdbOut.hpp>
#include <SocketServer.hpp>
#include <Parser.hpp>
diff --git a/ndb/src/mgmapi/test/keso.c b/ndb/src/mgmapi/test/keso.c
index f4b192e3db8..d5086b20b6a 100644
--- a/ndb/src/mgmapi/test/keso.c
+++ b/ndb/src/mgmapi/test/keso.c
@@ -15,6 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <mgmapi.h>
#ifdef VM_TRACE
@@ -22,9 +24,6 @@
#endif
#include <NdbOut.hpp>
-#include <NdbStdio.h>
-
-#include <stdlib.h>
static int testConnect(NdbMgmHandle h, struct ndb_mgm_reply* reply);
static int testDisconnect(NdbMgmHandle h, struct ndb_mgm_reply* reply);
@@ -60,8 +59,8 @@ struct test_case test_connect_disconnect[] = {
struct test_case tests[] = {
{ "testStatus", &testStatus },
{ "testFilterClusterLog", &testFilterClusterLog },
- //{ "testSetLogLevelClusterLog", &testSetLogLevelClusterLog },
- //{ "testSetLogLevelNode", &testSetLogLevelNode },
+ /*{ "testSetLogLevelClusterLog", &testSetLogLevelClusterLog },*/
+ /*{ "testSetLogLevelNode", &testSetLogLevelNode },*/
{ "testRestartNode", &testRestartNode },
{ "testGetStatPort", &testGetStatPort },
#ifdef VM_TRACE
diff --git a/ndb/src/mgmapi/test/mgmSrvApi.cpp b/ndb/src/mgmapi/test/mgmSrvApi.cpp
index e93c54ae5a7..4a8e38c9ba5 100644
--- a/ndb/src/mgmapi/test/mgmSrvApi.cpp
+++ b/ndb/src/mgmapi/test/mgmSrvApi.cpp
@@ -25,11 +25,9 @@
* Server API" document
*
*****************************************************/
+#include <ndb_global.h>
#include "mgmapi.h"
#include "mgmapi_commands.h"
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp
index 29d25ebf7d3..fba5fda32dd 100644
--- a/ndb/src/mgmclient/CommandInterpreter.cpp
+++ b/ndb/src/mgmclient/CommandInterpreter.cpp
@@ -14,13 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <errno.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <limits.h>
-
-#include <ndb_version.h>
+#include "CommandInterpreter.hpp"
#include <mgmapi.h>
#include <mgmapi_debug.h>
@@ -34,7 +28,6 @@
#endif // HAVE_GLOBAL_REPLICATION
#include "MgmtErrorReporter.hpp"
-#include "CommandInterpreter.hpp"
#include "CpcClient.hpp"
#ifdef NDB_SOLARIS // XXX fix me
diff --git a/ndb/src/mgmclient/CommandInterpreter.hpp b/ndb/src/mgmclient/CommandInterpreter.hpp
index 9049ef39915..796a4e4838e 100644
--- a/ndb/src/mgmclient/CommandInterpreter.hpp
+++ b/ndb/src/mgmclient/CommandInterpreter.hpp
@@ -22,9 +22,7 @@
// Author: Peter Lind
//*****************************************************************************
-#include <NdbStdio.h>
-#include <ndb_types.h>
-#include <stdlib.h>
+#include <ndb_global.h>
#include <Vector.hpp>
#include <editline/editline.h>
diff --git a/ndb/src/mgmclient/CpcClient.cpp b/ndb/src/mgmclient/CpcClient.cpp
index 24eab7194e9..74fa1a828ed 100644
--- a/ndb/src/mgmclient/CpcClient.cpp
+++ b/ndb/src/mgmclient/CpcClient.cpp
@@ -14,14 +14,10 @@
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_types.h>
+#include <ndb_global.h>
#include <editline/editline.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
#include <netdb.h>
-#include <errno.h>
#include <NdbOut.hpp>
#include <NdbTCP.h>
diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp
index bbadaeb5206..2dcadf9369d 100644
--- a/ndb/src/mgmclient/main.cpp
+++ b/ndb/src/mgmclient/main.cpp
@@ -14,9 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/param.h>
+#include <ndb_global.h>
#include <NdbMain.h>
#include <NdbHost.h>
diff --git a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp
index 6b6dc9f1077..32f0adbcf26 100644
--- a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp
+++ b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp
@@ -15,10 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include "../CpcClient.hpp"
#include <Vector.hpp>
-#include <assert.h>
-#include <stdlib.h>
SimpleCpcClient g_client("localhost", 1234);
Vector<SimpleCpcClient::Process> g_procs;
@@ -89,10 +88,16 @@ void define(){
//proc.m_proc.m_stdout = "log.out";
//proc.m_proc.m_stderr = "2>&1";
//proc.m_proc.m_runas = proc.m_host->m_user;
- //proc.m_proc.m_ulimit = "c:unlimited";
- m_proc.m_name.assfmt("%d-%d-%s", getpid(), name++, "test");
- m_proc.m_path.assign("/bin/sleep");
- m_proc.m_args = "600";
+ m_proc.m_ulimit = "c:unlimited";
+ if((rand() & 15) >= 0){
+ m_proc.m_name.assfmt("%d-%d-%s", getpid(), name++, "sleep");
+ m_proc.m_path.assign("/bin/sleep");
+ m_proc.m_args = "600";
+ } else {
+ m_proc.m_name.assfmt("%d-%d-%s", getpid(), name++, "test.sh");
+ m_proc.m_path.assign("/home/jonas/run/cpcd/test.sh");
+ m_proc.m_args = "600";
+ }
g_procs.push_back(m_proc);
Properties reply;
@@ -136,7 +141,7 @@ void list(){
ABORT();
}
- for(int i = 0; i<procs.size(); i++){
+ for(Uint32 i = 0; i<procs.size(); i++){
SimpleCpcClient::Process * p = find(procs[i].m_id);
if(p != 0){
p->m_status = procs[i].m_status;
@@ -144,7 +149,7 @@ void list(){
}
}
SimpleCpcClient::Process* find(int id){
- for(int i = 0; i<g_procs.size(); i++){
+ for(Uint32 i = 0; i<g_procs.size(); i++){
if(g_procs[i].m_id == id)
return &g_procs[i];
}
diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp
index 1e608c05042..8a7293b8434 100644
--- a/ndb/src/mgmsrv/CommandInterpreter.cpp
+++ b/ndb/src/mgmsrv/CommandInterpreter.cpp
@@ -645,6 +645,8 @@ versionCallback(int nodeId, int version, void * anyData, int errCode){
}
break;
+ case NDB_MGM_NODE_TYPE_UNKNOWN:
+ abort();
};
} else {
diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp
index e68aa7da084..3466ee76226 100644
--- a/ndb/src/mgmsrv/CommandInterpreter.hpp
+++ b/ndb/src/mgmsrv/CommandInterpreter.hpp
@@ -21,9 +21,7 @@
// Author: Peter Lind
//*****************************************************************************
-#include <NdbStdio.h>
-#include <ndb_types.h>
-#include <stdlib.h>
+#include <ndb_global.h>
#include <Vector.hpp>
#include <editline/editline.h>
#include <BaseString.hpp>
diff --git a/ndb/src/mgmsrv/Makefile b/ndb/src/mgmsrv/Makefile
index ebf50ecb76e..b10bdb64d30 100644
--- a/ndb/src/mgmsrv/Makefile
+++ b/ndb/src/mgmsrv/Makefile
@@ -6,8 +6,6 @@ BIN_TARGET := mgmtsrvr
BIN_TARGET_LIBS :=
BIN_TARGET_ARCHIVES := mgmapi NDB_API mgmsrvcommon
-LDFLAGS_LOC = -lpthread
-
ifneq ($(USE_EDITLINE), N)
BIN_TARGET_ARCHIVES += editline
DIRS := mkconfig
diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp
index 23ceeb15947..7c2d94c6b7f 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -14,10 +14,12 @@
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 <pthread.h>
+
#include "MgmtSrvr.hpp"
#include "MgmtErrorReporter.hpp"
-#include <ctype.h>
#include <NdbOut.hpp>
#include <AttrType.hpp>
#include <NdbApiSignal.hpp>
@@ -42,15 +44,11 @@
#include <EventLogger.hpp>
#include <DebuggerNames.hpp>
#include <ndb_version.h>
-#include <string.h>
#include "SocketServer.hpp"
#include "NodeLogLevel.hpp"
#include <NdbConfig.h>
-#include <time.h>
-#include <pthread.h>
-
//#define MGM_SRV_DEBUG
#ifdef MGM_SRV_DEBUG
#define DEBUG(x) do ndbout << x << endl; while(0)
diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp
index 4fdf3c99d43..ce8765d6c73 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.hpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.hpp
@@ -20,7 +20,6 @@
#include <kernel_types.h>
#include "Config.hpp"
#include <NdbCondition.h>
-#include <NdbConstant.hpp>
#include <mgmapi.h>
diff --git a/ndb/src/mgmsrv/NodeLogLevel.hpp b/ndb/src/mgmsrv/NodeLogLevel.hpp
index 3e631e57901..3ad758cde99 100644
--- a/ndb/src/mgmsrv/NodeLogLevel.hpp
+++ b/ndb/src/mgmsrv/NodeLogLevel.hpp
@@ -17,7 +17,8 @@
#ifndef NODELOGLEVEL_H
#define NODELOGLEVEL_H
-#include <portlib/NdbConstant.hpp>
+#include <ndb_global.h>
+
#include <signaldata/SetLogLevelOrd.hpp>
/**
diff --git a/ndb/src/mgmsrv/NodeLogLevelList.cpp b/ndb/src/mgmsrv/NodeLogLevelList.cpp
index 7cf6dcc4b7e..6c7c091c1a8 100644
--- a/ndb/src/mgmsrv/NodeLogLevelList.cpp
+++ b/ndb/src/mgmsrv/NodeLogLevelList.cpp
@@ -14,10 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NodeLogLevelList.hpp"
+#include <ndb_global.h>
+#include "NodeLogLevelList.hpp"
#include "NodeLogLevel.hpp"
-#include "NdbStdio.h"
//
// PUBLIC
diff --git a/ndb/src/mgmsrv/convertStrToInt.cpp b/ndb/src/mgmsrv/convertStrToInt.cpp
index 82bdb8e4f2f..e5216047d10 100644
--- a/ndb/src/mgmsrv/convertStrToInt.cpp
+++ b/ndb/src/mgmsrv/convertStrToInt.cpp
@@ -14,9 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
+#include <ndb_global.h>
bool convert(const char* s, int& val) {
diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp
index d10ad8e0f4e..91b443f61a2 100644
--- a/ndb/src/mgmsrv/main.cpp
+++ b/ndb/src/mgmsrv/main.cpp
@@ -14,8 +14,9 @@
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 <signal.h>
-#include <sys/ioctl.h>
#include "MgmtSrvr.hpp"
#include "EventLogger.hpp"
@@ -41,6 +42,7 @@
#include "CommandInterpreter.hpp"
#endif
+#undef DEBUG
#define DEBUG(x) ndbout << x << endl;
const char progname[] = "mgmtsrvr";
@@ -197,7 +199,6 @@ NDB_MAIN(mgmsrv){
goto error_end;
}
-#if defined (NDB_LINUX) || defined (NDB_SOLARIS)
if (glob.daemon) {
// Become a daemon
char homePath[255],lockfile[255], logfile[255];
@@ -209,7 +210,6 @@ NDB_MAIN(mgmsrv){
return 1;
}
}
-#endif
if(!glob.mgmObject->start()){
ndbout_c("Unable to start management server.");
diff --git a/ndb/src/mgmsrv/mkconfig/mkconfig.cpp b/ndb/src/mgmsrv/mkconfig/mkconfig.cpp
index 0e9397e43c0..224c82aa8a1 100644
--- a/ndb/src/mgmsrv/mkconfig/mkconfig.cpp
+++ b/ndb/src/mgmsrv/mkconfig/mkconfig.cpp
@@ -14,15 +14,14 @@
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 <ndb_version.h>
+
#include <NdbMain.h>
#include <Properties.hpp>
-#include <stdlib.h>
#include "InitConfigFileParser.hpp"
-#include "Config.hpp"
-#include <assert.h>
-#include <NdbUnistd.h>
-#include <ndb_version.h>
+#include <Config.hpp>
void usage(const char * prg){
ndbout << "Usage " << prg << ": <Init config> <Binary file>" << endl;
diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp
index 93fb0109669..1b536b6d741 100644
--- a/ndb/src/ndbapi/ClusterMgr.cpp
+++ b/ndb/src/ndbapi/ClusterMgr.cpp
@@ -14,6 +14,10 @@
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 <ndb_limits.h>
+#include <ndb_version.h>
+
#include "TransporterFacade.hpp"
#include "ClusterMgr.hpp"
#include <IPCConfig.hpp>
@@ -23,12 +27,8 @@
#include <NdbSleep.h>
#include <NdbOut.hpp>
#include <NdbTick.h>
-#include <ndb_limits.h>
-#include <stdio.h>
-#include <assert.h>
-#include <ndb_version.h>
#include <signaldata/NodeFailRep.hpp>
#include <signaldata/NFCompleteRep.hpp>
#include <signaldata/ApiRegSignalData.hpp>
diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp
index 36fbc85a875..f6f2106f2aa 100644
--- a/ndb/src/ndbapi/DictCache.cpp
+++ b/ndb/src/ndbapi/DictCache.cpp
@@ -14,12 +14,12 @@
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 "DictCache.hpp"
#include "NdbDictionaryImpl.hpp"
#include <NdbTick.h>
#include <NdbCondition.h>
#include <NdbSleep.h>
-#include <stdlib.h>
LocalDictCache::LocalDictCache(){
m_tableHash.createHashTable();
diff --git a/ndb/src/ndbapi/Makefile b/ndb/src/ndbapi/Makefile
index 932fbd844d2..f4c82e5d6ba 100644
--- a/ndb/src/ndbapi/Makefile
+++ b/ndb/src/ndbapi/Makefile
@@ -31,7 +31,9 @@ SOURCES = \
Ndblist.cpp \
Ndbif.cpp \
Ndbinit.cpp \
- Ndberror.cpp \
+ Ndberr.cpp \
+ ndberror.c \
+ NdbErrorOut.cpp \
NdbConnection.cpp \
NdbConnectionScan.cpp \
NdbOperation.cpp \
diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp
index d7930f32d72..448a29ca485 100644
--- a/ndb/src/ndbapi/Ndb.cpp
+++ b/ndb/src/ndbapi/Ndb.cpp
@@ -21,14 +21,17 @@
Name: Ndb.cpp
******************************************************************************/
+#include <ndb_global.h>
+#include <pthread.h>
+
#include "NdbApiSignal.hpp"
#include "NdbImpl.hpp"
#include "NdbSchemaOp.hpp"
#include "NdbSchemaCon.hpp"
-#include "NdbOperation.hpp"
-#include "NdbConnection.hpp"
-#include "NdbEventOperation.hpp"
-#include "NdbRecAttr.hpp"
+#include <NdbOperation.hpp>
+#include <NdbConnection.hpp>
+#include <NdbEventOperation.hpp>
+#include <NdbRecAttr.hpp>
#include <md5_hash.hpp>
#include <NdbSleep.h>
#include <NdbOut.hpp>
@@ -1221,7 +1224,6 @@ Ndb::pollEvents(int aMillisecondNumber)
#ifdef VM_TRACE
#include <NdbMutex.h>
-#include <stdarg.h>
static NdbMutex print_state_mutex = NDB_MUTEX_INITIALIZER;
static bool
checkdups(NdbConnection** list, unsigned no)
@@ -1243,7 +1245,7 @@ Ndb::printState(const char* fmt, ...)
NdbMutex_Lock(&print_state_mutex);
bool dups = false;
ndbout << buf << " ndb=" << hex << this << dec;
-#ifdef NDB_LINUX
+#ifndef NDB_WIN32
ndbout << " thread=" << (int)pthread_self();
#endif
ndbout << endl;
diff --git a/ndb/src/ndbapi/NdbConnectionScan.cpp b/ndb/src/ndbapi/NdbConnectionScan.cpp
index 67f07d2a8c0..962acc0bdac 100644
--- a/ndb/src/ndbapi/NdbConnectionScan.cpp
+++ b/ndb/src/ndbapi/NdbConnectionScan.cpp
@@ -27,10 +27,12 @@
* Documentation:
* Adjust: 2000-06-12 UABRONM First version.
****************************************************************************/
-#include "Ndb.hpp"
-#include "NdbConnection.hpp"
-#include "NdbOperation.hpp"
-#include "NdbScanOperation.hpp"
+#include <ndb_global.h>
+
+#include <Ndb.hpp>
+#include <NdbConnection.hpp>
+#include <NdbOperation.hpp>
+#include <NdbScanOperation.hpp>
#include "NdbScanReceiver.hpp"
#include "NdbApiSignal.hpp"
#include "TransporterFacade.hpp"
@@ -41,7 +43,6 @@
#include <signaldata/ScanTab.hpp>
#include <NdbOut.hpp>
-#include <assert.h>
// time out for next scan result (-1 is infinite)
// XXX should change default only if non-trivial interpreted program is used
diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp
index ec9a56cda62..b068ea6460f 100644
--- a/ndb/src/ndbapi/NdbDictionary.cpp
+++ b/ndb/src/ndbapi/NdbDictionary.cpp
@@ -646,7 +646,6 @@ NdbDictionary::Dictionary::Dictionary(NdbDictionaryImpl & impl)
: m_impl(impl)
{
}
-#include <assert.h>
NdbDictionary::Dictionary::~Dictionary(){
NdbDictionaryImpl * tmp = &m_impl;
if(this != tmp){
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index bd94ba9b080..02e3ee23f9c 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -35,7 +35,6 @@
#include <AttributeList.hpp>
#include <NdbEventOperation.hpp>
#include "NdbEventOperationImpl.hpp"
-#include <assert.h>
#define DEBUG_PRINT 0
#define INCOMPATIBLE_VERSION -2
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp
index f6b0644ea15..3263a636a79 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp
@@ -33,7 +33,7 @@
class NdbDictObjectImpl {
public:
- int m_version;
+ Uint32 m_version;
NdbDictionary::Object::Status m_status;
bool change();
diff --git a/ndb/include/portlib/NdbStdio.h b/ndb/src/ndbapi/NdbErrorOut.cpp
index 163b7eeef6f..07e0b2fe6e8 100644
--- a/ndb/include/portlib/NdbStdio.h
+++ b/ndb/src/ndbapi/NdbErrorOut.cpp
@@ -14,23 +14,32 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/*
- * NdbStdio.h - stdio.h for ndb
- *
- *
- */
+#include <ndb_global.h>
-#if defined NDB_OSE || defined NDB_SOFTOSE
-/* On OSE Delta the snprintf is declare in outfmt.h */
-#include <outfmt.h>
-#endif
+#include <NdbOut.hpp>
-#include <stdio.h>
+#include <NdbError.hpp>
-#ifdef NDB_WIN32
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
-#define strtok_r(s1, s2, l) strtok(s1, s2)
-#endif
+/**
+ * operators
+ */
+NdbOut &
+operator<<(NdbOut & out, const NdbError & error){
+ if(error.message != 0)
+ out << error.code << ": " << error.message;
+ else
+ out << error.code << ": ";
+ return out;
+}
+
+NdbOut &
+operator<<(NdbOut & out, const NdbError::Status & status){
+ return out << ndberror_status_message((ndberror_status)status);
+}
+
+NdbOut &
+operator<<(NdbOut & out, const NdbError::Classification & classification){
+ return out << ndberror_classification_message((ndberror_classification)classification);
+}
diff --git a/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/ndb/src/ndbapi/NdbEventOperationImpl.cpp
index d167b8205a2..acc726e28c5 100644
--- a/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+++ b/ndb/src/ndbapi/NdbEventOperationImpl.cpp
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-
+#include <ndb_global.h>
+#include <kernel_types.h>
#include "NdbDictionaryImpl.hpp"
#include "API.hpp"
@@ -24,21 +24,12 @@
#include <AttrType.hpp>
#include "NdbApiSignal.hpp"
#include "TransporterFacade.hpp"
-#include <signaldata/GetTabInfo.hpp>
-#include <signaldata/DictTabInfo.hpp>
-#include <signaldata/CreateTable.hpp>
-#include <signaldata/CreateIndx.hpp>
#include <signaldata/CreateEvnt.hpp>
#include <signaldata/SumaImpl.hpp>
-#include <signaldata/DropTable.hpp>
-#include <signaldata/DropIndx.hpp>
-#include <signaldata/ListTables.hpp>
#include <SimpleProperties.hpp>
#include <Bitmask.hpp>
#include <AttributeHeader.hpp>
#include <AttributeList.hpp>
-#include <ndb_types.h>
-#include <kernel_types.h>
#include <NdbError.hpp>
#include <BaseString.hpp>
#include <UtilBuffer.hpp>
diff --git a/ndb/src/ndbapi/NdbOperation.cpp b/ndb/src/ndbapi/NdbOperation.cpp
index eaa2b35965b..ccbfa767542 100644
--- a/ndb/src/ndbapi/NdbOperation.cpp
+++ b/ndb/src/ndbapi/NdbOperation.cpp
@@ -37,7 +37,6 @@
#include "API.hpp"
#include <NdbOut.hpp>
-#include <assert.h>
/******************************************************************************
diff --git a/ndb/src/ndbapi/NdbOperationDefine.cpp b/ndb/src/ndbapi/NdbOperationDefine.cpp
index a1ce25f19d1..18f8b79d12e 100644
--- a/ndb/src/ndbapi/NdbOperationDefine.cpp
+++ b/ndb/src/ndbapi/NdbOperationDefine.cpp
@@ -164,7 +164,6 @@ NdbOperation::readTupleExclusive()
int
NdbOperation::simpleRead()
{
- NdbConnection* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine;
if (theStatus == Init) {
theStatus = OperationDefined;
@@ -193,7 +192,6 @@ NdbOperation::dirtyRead()
int
NdbOperation::committedRead()
{
- NdbConnection* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine;
if (theStatus == Init) {
theStatus = OperationDefined;
diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp
index 1b0ad68b1eb..b2a6f99880c 100644
--- a/ndb/src/ndbapi/NdbOperationExec.cpp
+++ b/ndb/src/ndbapi/NdbOperationExec.cpp
@@ -25,11 +25,12 @@ Version: 1.2
Description:
Documentation:
***************************************************************************/
-#include "NdbOperation.hpp"
-#include "NdbConnection.hpp"
+
+#include <NdbOperation.hpp>
+#include <NdbConnection.hpp>
#include "NdbApiSignal.hpp"
-#include "Ndb.hpp"
-#include "NdbRecAttr.hpp"
+#include <Ndb.hpp>
+#include <NdbRecAttr.hpp>
#include "NdbUtil.hpp"
#include "Interpreter.hpp"
diff --git a/ndb/src/ndbapi/NdbOperationSearch.cpp b/ndb/src/ndbapi/NdbOperationSearch.cpp
index 42f2b1d10d8..e1d5e823077 100644
--- a/ndb/src/ndbapi/NdbOperationSearch.cpp
+++ b/ndb/src/ndbapi/NdbOperationSearch.cpp
@@ -319,7 +319,7 @@ NdbOperation::setTupleId()
return 0;
}
Uint64 tTupleId = theNdb->getTupleIdFromNdb(m_currentTable->m_tableId);
- if (tTupleId == ~0){
+ if (tTupleId == ~(Uint64)0){
setErrorCodeAbort(theNdb->theError.code);
return 0;
}
diff --git a/ndb/src/ndbapi/NdbPoolImpl.cpp b/ndb/src/ndbapi/NdbPoolImpl.cpp
index 08252d26d79..131edc74246 100644
--- a/ndb/src/ndbapi/NdbPoolImpl.cpp
+++ b/ndb/src/ndbapi/NdbPoolImpl.cpp
@@ -15,8 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "NdbPoolImpl.hpp"
-#include <assert.h>
-#include <string.h>
NdbMutex *NdbPool::pool_mutex = NULL;
NdbPool *the_pool = NULL;
diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp
index 11f36fbd2c4..0f7baeac4f5 100644
--- a/ndb/src/ndbapi/NdbRecAttr.cpp
+++ b/ndb/src/ndbapi/NdbRecAttr.cpp
@@ -26,8 +26,8 @@ Description: Interface between TIS and NDB
Documentation:
Adjust: 971206 UABRONM First version
************************************************************************************************/
+#include <ndb_global.h>
#include "NdbRecAttr.hpp"
-#include <stdlib.h>
#include "NdbDictionaryImpl.hpp"
NdbRecAttr::NdbRecAttr() :
diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp
index f753d2f6b34..4db0f30f56c 100644
--- a/ndb/src/ndbapi/NdbScanOperation.cpp
+++ b/ndb/src/ndbapi/NdbScanOperation.cpp
@@ -26,6 +26,7 @@
* Adjust: 2002-04-01 UABMASD First version.
****************************************************************************/
+#include <ndb_global.h>
#include <Ndb.hpp>
#include <NdbScanOperation.hpp>
#include <NdbConnection.hpp>
@@ -33,12 +34,6 @@
#include "NdbApiSignal.hpp"
#include <NdbOut.hpp>
#include "NdbDictionaryImpl.hpp"
-#include <NdbString.h>
-#ifndef NDB_MACOSX
-#include <malloc.h>
-#else
-#include <stdlib.h>
-#endif
NdbScanOperation::NdbScanOperation(Ndb* aNdb) :
NdbCursorOperation(aNdb),
@@ -637,6 +632,24 @@ SetValueRecList::callSetValueFn(SetValueRec& aSetValueRec, NdbOperation& oper)
}
}
+SetValueRec::~SetValueRec()
+{
+ if ((stype == SET_STRING_ATTR1) ||
+ (stype == SET_INT32_ATTR1) ||
+ (stype == SET_UINT32_ATTR1) ||
+ (stype == SET_INT64_ATTR1) ||
+ (stype == SET_UINT64_ATTR1) ||
+ (stype == SET_FLOAT_ATTR1) ||
+ (stype == SET_DOUBLE_ATTR1))
+ free(anAttrName);
+
+ if ((stype == SET_STRING_ATTR1) ||
+ (stype == SET_STRING_ATTR2))
+ free(stringStruct.aStringValue);
+ if (next) delete next;
+ next = 0;
+}
+
int
NdbScanOperation::equal_impl(const NdbColumnImpl* anAttrObject,
const char* aValue,
diff --git a/ndb/src/ndbapi/NdbScanReceiver.hpp b/ndb/src/ndbapi/NdbScanReceiver.hpp
index 5e316719194..72f9e48f02c 100644
--- a/ndb/src/ndbapi/NdbScanReceiver.hpp
+++ b/ndb/src/ndbapi/NdbScanReceiver.hpp
@@ -24,7 +24,6 @@
#include "NdbReceiver.hpp"
#include <NdbOut.hpp>
-#include <assert.h>
class NdbScanReceiver
{
diff --git a/ndb/src/ndbapi/NdbSchemaOp.cpp b/ndb/src/ndbapi/NdbSchemaOp.cpp
index 9f4d7fbcfd4..9e495229661 100644
--- a/ndb/src/ndbapi/NdbSchemaOp.cpp
+++ b/ndb/src/ndbapi/NdbSchemaOp.cpp
@@ -29,6 +29,7 @@ Documentation: Handles createTable and createAttribute calls
Adjust: 980125 UABMNST First version.
020826 EMIKRON New version for new DICT
*****************************************************************************/
+#include <assert.h>
#include "NdbSchemaOp.hpp"
#include "NdbSchemaCon.hpp"
#include "API.hpp"
@@ -139,6 +140,8 @@ NdbSchemaOp::createAttribute( const char* anAttrName,
case String:
col.setType(NdbDictionary::Column::Char);
break;
+ case NoAttrTypeDef:
+ abort();
}
col.setLength(anArraySize);
col.setNullable(nullable);
diff --git a/ndb/src/ndbapi/NdbUtil.hpp b/ndb/src/ndbapi/NdbUtil.hpp
index eeee087d548..6a82af85987 100644
--- a/ndb/src/ndbapi/NdbUtil.hpp
+++ b/ndb/src/ndbapi/NdbUtil.hpp
@@ -29,8 +29,7 @@ Comment:
#ifndef NdbUtil_H
#define NdbUtil_H
-#include <stdlib.h>
-#include <ndb_types.h>
+#include <ndb_global.h>
#include "AttrType.hpp"
class NdbApiSignal;
diff --git a/ndb/src/ndbapi/Ndberr.cpp b/ndb/src/ndbapi/Ndberr.cpp
new file mode 100644
index 00000000000..faa2f00cfce
--- /dev/null
+++ b/ndb/src/ndbapi/Ndberr.cpp
@@ -0,0 +1,75 @@
+/* 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 <NdbError.hpp>
+#include "NdbImpl.hpp"
+#include "NdbDictionaryImpl.hpp"
+#include <NdbSchemaCon.hpp>
+#include <NdbOperation.hpp>
+#include <NdbConnection.hpp>
+
+
+static void
+update(const NdbError & _err){
+ NdbError & error = (NdbError &) _err;
+ ndberror_struct ndberror = (ndberror_struct)error;
+ ndberror_update(&ndberror);
+ error = NdbError(ndberror);
+}
+
+const
+NdbError &
+Ndb::getNdbError(int code){
+ theError.code = code;
+ update(theError);
+ return theError;
+}
+
+const
+NdbError &
+Ndb::getNdbError() const {
+ update(theError);
+ return theError;
+}
+
+const
+NdbError &
+NdbDictionaryImpl::getNdbError() const {
+ update(m_error);
+ return m_error;
+}
+
+const
+NdbError &
+NdbConnection::getNdbError() const {
+ update(theError);
+ return theError;
+}
+
+const
+NdbError &
+NdbOperation::getNdbError() const {
+ update(theError);
+ return theError;
+}
+
+const
+NdbError &
+NdbSchemaCon::getNdbError() const {
+ update(theError);
+ return theError;
+}
diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp
index e334c1bcc39..696dfe68e40 100644
--- a/ndb/src/ndbapi/Ndbif.cpp
+++ b/ndb/src/ndbapi/Ndbif.cpp
@@ -40,7 +40,6 @@
#include <NdbOut.hpp>
#include <NdbTick.h>
-#include <assert.h>
/******************************************************************************
* int init( int aNrOfCon, int aNrOfOp );
diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp
index 9afbbf0df1f..be7acc48d7a 100644
--- a/ndb/src/ndbapi/Ndbinit.cpp
+++ b/ndb/src/ndbapi/Ndbinit.cpp
@@ -55,6 +55,7 @@ Parameters: aDataBase : Name of the database.
Remark: Connect to the database.
***************************************************************************/
Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) :
+ theNdbObjectIdMap(0),
thePreparedTransactionsArray(NULL),
theSentTransactionsArray(NULL),
theCompletedTransactionsArray(NULL),
@@ -89,8 +90,7 @@ Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) :
theFirstTransId(0),
theRestartGCI(0),
theNdbBlockNumber(-1),
- theInitState(NotConstructed),
- theNdbObjectIdMap(0)
+ theInitState(NotConstructed)
{
cgetSignals =0;
cfreeSignals = 0;
diff --git a/ndb/src/ndbapi/ObjectMap.hpp b/ndb/src/ndbapi/ObjectMap.hpp
index a2a8d00b48f..4abb54b5081 100644
--- a/ndb/src/ndbapi/ObjectMap.hpp
+++ b/ndb/src/ndbapi/ObjectMap.hpp
@@ -17,10 +17,8 @@
#ifndef NDB_OBJECT_ID_MAP_HPP
#define NDB_OBJECT_ID_MAP_HPP
-#include <ndb_types.h>
+#include <ndb_global.h>
//#include <NdbMutex.h>
-#include <stdlib.h>
-#include <string.h>
#include <NdbOut.hpp>
//#define DEBUG_OBJECTMAP
diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp
index 746ab169b41..f4a3ae3e87d 100644
--- a/ndb/src/ndbapi/TransporterFacade.cpp
+++ b/ndb/src/ndbapi/TransporterFacade.cpp
@@ -14,8 +14,9 @@
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 <ndb_limits.h>
-#include "AttrType.hpp"
+#include <AttrType.hpp>
#include "TransporterFacade.hpp"
#include "ClusterMgr.hpp"
#include <IPCConfig.hpp>
@@ -25,14 +26,12 @@
#include <NdbOut.hpp>
#include <NdbEnv.h>
#include <NdbSleep.h>
-#include <assert.h>
#include "API.hpp"
#include <ConfigRetriever.hpp>
#include <NdbConfig.h>
#include <ndb_version.h>
#include <SignalLoggerManager.hpp>
-#include <stdlib.h>
#if !defined NDB_OSE && !defined NDB_SOFTOSE
#include <signal.h>
diff --git a/ndb/src/ndbapi/Ndberror.cpp b/ndb/src/ndbapi/ndberror.c
index ee668605f0d..ea7cf4de426 100644
--- a/ndb/src/ndbapi/Ndberror.cpp
+++ b/ndb/src/ndbapi/ndberror.c
@@ -15,40 +15,46 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbError.hpp>
-#include <NdbStdio.h>
-#include <stdarg.h>
+#include <ndb_global.h>
-#include <assert.h>
+#include <ndberror.h>
-struct ErrorBundle {
+typedef struct ErrorBundle {
int code;
- NdbError::Classification classification;
+ ndberror_classification classification;
const char * message;
-};
+} ErrorBundle;
/**
* Shorter names in table below
*/
-static const NdbError::Classification NE = NdbError::NoError;
-static const NdbError::Classification AE = NdbError::ApplicationError;
-static const NdbError::Classification ND = NdbError::NoDataFound;
-static const NdbError::Classification CV = NdbError::ConstraintViolation;
-static const NdbError::Classification SE = NdbError::SchemaError;
-static const NdbError::Classification UD = NdbError::UserDefinedError;
-
-static const NdbError::Classification IS = NdbError::InsufficientSpace;
-static const NdbError::Classification TR = NdbError::TemporaryResourceError;
-static const NdbError::Classification NR = NdbError::NodeRecoveryError;
-static const NdbError::Classification OL = NdbError::OverloadError;
-static const NdbError::Classification TO = NdbError::TimeoutExpired;
-static const NdbError::Classification NS = NdbError::NodeShutdown;
-
-static const NdbError::Classification UR = NdbError::UnknownResultError;
-
-static const NdbError::Classification IE = NdbError::InternalError;
-static const NdbError::Classification NI = NdbError::FunctionNotImplemented;
-static const NdbError::Classification UE = NdbError::UnknownErrorCode;
+
+#define ST_S ndberror_st_success
+#define ST_P ndberror_st_permanent
+#define ST_T ndberror_st_temporary
+#define ST_U ndberror_st_unknown
+
+#define NE ndberror_cl_none
+#define AE ndberror_cl_application
+#define ND ndberror_cl_no_data_found
+#define CV ndberror_cl_constraint_violation
+#define SE ndberror_cl_schema_error
+#define UD ndberror_cl_user_defined
+
+#define IS ndberror_cl_insufficient_space
+#define TR ndberror_cl_temporary_resource
+#define NR ndberror_cl_node_recovery
+#define OL ndberror_cl_overload
+#define TO ndberror_cl_timeout_expired
+#define NS ndberror_cl_node_shutdown
+
+#define UR ndberror_cl_unknown_result
+
+#define IE ndberror_cl_internal_error
+#define NI ndberror_cl_function_not_implemented
+#define UE ndberror_cl_unknown_error_code
+
+static const char* empty_string = "";
static
const
@@ -90,7 +96,7 @@ ErrorBundle ErrorCodes[] = {
* Node shutdown
*/
{ 280, NS, "Transaction aborted due to node shutdown" },
- // This scan trans had an active fragment scan in a LQH which have crashed
+ /* This scan trans had an active fragment scan in a LQH which have crashed */
{ 270, NS, "Transaction aborted due to node shutdown" },
{ 1223, NS, "Read operation aborted due to node shutdown" },
{ 4023, NS, "Transaction aborted due to node shutdown" },
@@ -152,9 +158,9 @@ ErrorBundle ErrorCodes[] = {
* TimeoutExpired
*/
{ 266, TO, "Time-out in NDB, probably caused by deadlock" },
- { 274, TO, "Time-out in NDB, probably caused by deadlock" }, // Scan trans timeout
- { 296, TO, "Time-out in NDB, probably caused by deadlock" }, // Scan trans timeout
- { 297, TO, "Time-out in NDB, probably caused by deadlock" }, // Scan trans timeout, temporary!!
+ { 274, TO, "Time-out in NDB, probably caused by deadlock" }, /* Scan trans timeout */
+ { 296, TO, "Time-out in NDB, probably caused by deadlock" }, /* Scan trans timeout */
+ { 297, TO, "Time-out in NDB, probably caused by deadlock" }, /* Scan trans timeout, temporary!! */
{ 237, TO, "Transaction had timed out when trying to commit it" },
@@ -420,41 +426,60 @@ static
const
int NbErrorCodes = sizeof(ErrorCodes)/sizeof(ErrorBundle);
-struct ErrorStatusClassification {
- NdbError::Status status;
- NdbError::Classification classification;
-};
+typedef struct ErrorStatusMessage {
+ ndberror_status status;
+ const char * message;
+} ErrorStatusMessage;
+
+typedef struct ErrorStatusClassification {
+ ndberror_status status;
+ ndberror_classification classification;
+ const char * message;
+} ErrorStatusClassification;
/**
* Mapping between classification and status
*/
static
const
+ErrorStatusMessage StatusMessageMapping[] = {
+ { ST_S, "Success"},
+ { ST_P, "Permanent error"},
+ { ST_T, "Temporary error"},
+ { ST_U ,"Unknown result"}
+};
+
+static
+const
+int NbStatus = sizeof(StatusMessageMapping)/sizeof(ErrorStatusMessage);
+
+static
+const
ErrorStatusClassification StatusClassificationMapping[] = {
- { NdbError::Success, NdbError::NoError },
- { NdbError::PermanentError, NdbError::ApplicationError },
- { NdbError::PermanentError, NdbError::NoDataFound },
- { NdbError::PermanentError, NdbError::ConstraintViolation },
- { NdbError::PermanentError, NdbError::SchemaError },
- { NdbError::PermanentError, NdbError::UserDefinedError },
- { NdbError::PermanentError, NdbError::InsufficientSpace },
+ { ST_S, NE, "No error"},
+ { ST_P, AE, "Application error"},
+ { ST_P, ND, "No data found"},
+ { ST_P, CV, "Constraint violation"},
+ { ST_P, SE, "Schema error"},
+ { ST_P, UD, "User defined error"},
+ { ST_P, IS, "Insufficient space"},
- { NdbError::TemporaryError, NdbError::TemporaryResourceError },
- { NdbError::TemporaryError, NdbError::NodeRecoveryError },
- { NdbError::TemporaryError, NdbError::OverloadError },
- { NdbError::TemporaryError, NdbError::TimeoutExpired },
- { NdbError::TemporaryError, NdbError::NodeShutdown },
+ { ST_T, TR, "Temporary Resource error"},
+ { ST_T, NR, "Node Recovery error"},
+ { ST_T, OL, "Overload error"},
+ { ST_T, TO, "Timeout expired"},
+ { ST_T, NS, "Node shutdown"},
- { NdbError::UnknownResult , NdbError::UnknownResultError },
- { NdbError::UnknownResult , NdbError::UnknownErrorCode },
+ { ST_U , UR, "Unknown result error"},
+ { ST_U , UE, "Unknown error code"},
- { NdbError::PermanentError, NdbError::InternalError },
- { NdbError::PermanentError, NdbError::FunctionNotImplemented }
+ { ST_P, IE, "Internal error"},
+ { ST_P, NI, "Function not implemented"}
};
static
const
-int Nb = sizeof(StatusClassificationMapping)/sizeof(ErrorStatusClassification);
+int NbClassification = sizeof(StatusClassificationMapping)/sizeof(ErrorStatusClassification);
/**
* Complete all fields of an NdbError given the error code
@@ -462,64 +487,67 @@ int Nb = sizeof(StatusClassificationMapping)/sizeof(ErrorStatusClassification);
*/
static
void
-set(NdbError & error, int code, const char * details, ...){
- error.code = code;
-
- va_list ap;
- va_start(ap, details);
- vsnprintf(error.details, sizeof(error.details), details, ap);
- va_end(ap);
+set(ndberror_struct * error, int code, const char * details, ...){
+ error->code = code;
+ {
+ va_list ap;
+ va_start(ap, details);
+ vsnprintf(error->details, sizeof(error->details), details, ap);
+ va_end(ap);
+ }
}
-static
+
void
-update(const NdbError & _err){
- NdbError & error = (NdbError &) _err;
-
- bool found = false;
- for(int i = 0; i<NbErrorCodes; i++){
- if(ErrorCodes[i].code == error.code){
- error.classification = ErrorCodes[i].classification;
- error.message = ErrorCodes[i].message;
- found = true;
+ndberror_update(ndberror_struct * error){
+
+ int found = 0;
+ int i;
+
+ for(i = 0; i<NbErrorCodes; i++){
+ if(ErrorCodes[i].code == error->code){
+ error->classification = ErrorCodes[i].classification;
+ error->message = ErrorCodes[i].message;
+ found = 1;
break;
}
}
if(!found){
- error.classification = NdbError::UnknownErrorCode;
- error.message = "Unknown error code";
+ error->classification = UE;
+ error->message = "Unknown error code";
}
- found = false;
- for(int i = 0; i<Nb; i++){
- if(StatusClassificationMapping[i].classification == error.classification){
- error.status = StatusClassificationMapping[i].status;
- found = true;
+ found = 0;
+ for(i = 0; i<NbClassification; i++){
+ if(StatusClassificationMapping[i].classification == error->classification){
+ error->status = StatusClassificationMapping[i].status;
+ found = 1;
break;
}
}
if(!found){
- error.status = NdbError::UnknownResult;
+ error->status = ST_U;
}
- error.details = 0;
+ error->details = 0;
}
-bool
+int
checkErrorCodes(){
- for(int i = 0; i<NbErrorCodes; i++)
- for(int j = i+1; j<NbErrorCodes; j++)
+ int i, j;
+ for(i = 0; i<NbErrorCodes; i++)
+ for(j = i+1; j<NbErrorCodes; j++)
if(ErrorCodes[i].code == ErrorCodes[j].code){
printf("ErrorCode %d is defined multiple times!!\n",
ErrorCodes[i].code);
assert(0);
}
- return true;
+ return 1;
}
-static const bool a = checkErrorCodes();
+/*static const int a = checkErrorCodes();*/
#if CHECK_ERRORCODES
int main(void){
@@ -528,108 +556,35 @@ int main(void){
}
#endif
-#include <NdbOut.hpp>
-
-/**
- * operators
- */
-NdbOut &
-operator<<(NdbOut & out, const NdbError & error){
- if(error.message != 0)
- out << error.code << ": " << error.message;
- else
- out << error.code << ": ";
- return out;
+const char *ndberror_status_message(ndberror_status status)
+{
+ int i;
+ for (i= 0; i < NbStatus; i++)
+ if (StatusMessageMapping[i].status == status)
+ return StatusMessageMapping[i].message;
+ return empty_string;
}
-NdbOut &
-operator<<(NdbOut & out, const NdbError::Status & status){
- switch(status) {
- case NdbError::Success: out << "Success"; break;
- case NdbError::TemporaryError: out << "Temporary error"; break;
- case NdbError::PermanentError: out << "Permanent error"; break;
- case NdbError::UnknownResult: out << "Unknown result"; break;
- }
- return out;
+const char *ndberror_classification_message(ndberror_classification classification)
+{
+ int i;
+ for (i= 0; i < NbClassification; i++)
+ if (StatusClassificationMapping[i].classification == classification)
+ return StatusClassificationMapping[i].message;
+ return empty_string;
}
-NdbOut &
-operator<<(NdbOut & out, const NdbError::Classification & classification){
- switch(classification) {
- case NdbError::NoError: out << "No error"; break;
- case NdbError::ApplicationError: out << "Application error"; break;
- case NdbError::NoDataFound: out << "No data found"; break;
- case NdbError::ConstraintViolation: out << "Constraint violation"; break;
- case NdbError::SchemaError: out << "Schema error"; break;
- case NdbError::UserDefinedError: out << "User defined error"; break;
- case NdbError::InsufficientSpace: out << "Insufficient space"; break;
- case NdbError::TemporaryResourceError: out << "Temporary Resource error";
- break;
- case NdbError::NodeRecoveryError: out << "Node Recovery error"; break;
- case NdbError::OverloadError: out << "Overload error"; break;
- case NdbError::TimeoutExpired: out << "Timeout expired"; break;
- case NdbError::UnknownResultError: out << "Unknown result error"; break;
- case NdbError::InternalError: out << "Internal error"; break;
- case NdbError::FunctionNotImplemented: out << "Function not implemented";
- break;
- case NdbError::UnknownErrorCode: out << "Unknown error code"; break;
- case NdbError::NodeShutdown: out << "Node shutdown"; break;
- }
- return out;
-}
+int ndb_error_string(int err_no, char *str, unsigned int size)
+{
+ ndberror_struct error;
+ unsigned int len;
-/******************************************************
- *
- */
-#include "NdbImpl.hpp"
-#include "NdbDictionaryImpl.hpp"
-#include <NdbSchemaCon.hpp>
-#include <NdbOperation.hpp>
-#include <NdbConnection.hpp>
+ error.code = err_no;
+ ndberror_update(&error);
+ len = snprintf(str, size-1, "%s: %s: %s", error.message,
+ ndberror_status_message(error.status), ndberror_classification_message(error.classification));
+ str[size-1]= '\0';
-const
-NdbError &
-Ndb::getNdbError(int code){
- theError.code = code;
- update(theError);
- return theError;
-}
-
-const
-NdbError &
-Ndb::getNdbError() const {
- update(theError);
- return theError;
-}
-
-const
-NdbError &
-NdbDictionaryImpl::getNdbError() const {
- update(m_error);
- return m_error;
+ return len;
}
-
-const
-NdbError &
-NdbConnection::getNdbError() const {
- update(theError);
- return theError;
-}
-
-const
-NdbError &
-NdbOperation::getNdbError() const {
- update(theError);
- return theError;
-}
-
-const
-NdbError &
-NdbSchemaCon::getNdbError() const {
- update(theError);
- return theError;
-}
-
-
-
diff --git a/ndb/src/ndbapi/signal-sender/SignalSender.cpp b/ndb/src/ndbapi/signal-sender/SignalSender.cpp
index d60f6240a9c..e642848dcee 100644
--- a/ndb/src/ndbapi/signal-sender/SignalSender.cpp
+++ b/ndb/src/ndbapi/signal-sender/SignalSender.cpp
@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
#include "SignalSender.hpp"
#include "ConfigRetriever.hpp"
#include <NdbSleep.h>
diff --git a/ndb/src/ndbapi/signal-sender/SignalSender.hpp b/ndb/src/ndbapi/signal-sender/SignalSender.hpp
index fffe027dbdd..e4e6c1931d2 100644
--- a/ndb/src/ndbapi/signal-sender/SignalSender.hpp
+++ b/ndb/src/ndbapi/signal-sender/SignalSender.hpp
@@ -17,11 +17,11 @@
#ifndef SIGNAL_SENDER_HPP
#define SIGNAL_SENDER_HPP
+#include <ndb_global.h>
#include <TransporterDefinitions.hpp>
#include <TransporterFacade.hpp>
#include <ClusterMgr.hpp>
#include <Vector.hpp>
-#include <stdio.h>
struct SimpleSignal {
public:
diff --git a/ndb/src/newtonapi/dba_binding.cpp b/ndb/src/newtonapi/dba_binding.cpp
index 724f54c0e4b..63e48110b1d 100644
--- a/ndb/src/newtonapi/dba_binding.cpp
+++ b/ndb/src/newtonapi/dba_binding.cpp
@@ -367,6 +367,12 @@ matchSize(NdbDictionary::Column::Type t, unsigned b, Size_t s) {
case NdbDictionary::Column::Datetime:
case NdbDictionary::Column::Timespec:
case NdbDictionary::Column::Blob:
+ case NdbDictionary::Column::Tinyint:
+ case NdbDictionary::Column::Tinyunsigned:
+ case NdbDictionary::Column::Smallint:
+ case NdbDictionary::Column::Smallunsigned:
+ case NdbDictionary::Column::Mediumint:
+ case NdbDictionary::Column::Mediumunsigned:
case NdbDictionary::Column::Undefined:
return false;
}
diff --git a/ndb/src/newtonapi/dba_error.cpp b/ndb/src/newtonapi/dba_error.cpp
index 0a154ac1314..f05446522b0 100644
--- a/ndb/src/newtonapi/dba_error.cpp
+++ b/ndb/src/newtonapi/dba_error.cpp
@@ -15,9 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "dba_internal.hpp"
-#include <NdbStdio.h>
-#include <stdarg.h>
static DBA_Error_t latestError = DBA_NO_ERROR;
static DBA_ErrorCode_t latestNdbError = 0;
diff --git a/ndb/src/newtonapi/dba_internal.hpp b/ndb/src/newtonapi/dba_internal.hpp
index a021db40a7d..84ae7ba222b 100644
--- a/ndb/src/newtonapi/dba_internal.hpp
+++ b/ndb/src/newtonapi/dba_internal.hpp
@@ -17,17 +17,16 @@
#ifndef DBA_INTERNAL_HPP
#define DBA_INTERNAL_HPP
+#include <ndb_global.h>
+
extern "C" {
#include "dba.h"
}
#include <NdbApi.hpp>
#include <NdbMutex.h>
-#include <string.h>
#include <NdbOut.hpp>
-#include <stdlib.h>
-
#ifndef INT_MAX
#define INT_MAX 2147483647
#endif
diff --git a/ndb/src/rep/Makefile b/ndb/src/rep/Makefile
index 29482b72687..9688a68ec74 100644
--- a/ndb/src/rep/Makefile
+++ b/ndb/src/rep/Makefile
@@ -12,8 +12,6 @@ BIN_TARGET := ndb_rep
BIN_TARGET_LIBS :=
BIN_TARGET_ARCHIVES += editline repstorage repadapters reprequestor reptransfer mgmapi NDB_API mgmsrvcommon
-LDFLAGS_LOC = -lpthread
-
SOURCES = \
RepMain.cpp \
Requestor.cpp \
diff --git a/ndb/src/rep/RepApiService.cpp b/ndb/src/rep/RepApiService.cpp
index f5d51f7990e..d07f7a59375 100644
--- a/ndb/src/rep/RepApiService.cpp
+++ b/ndb/src/rep/RepApiService.cpp
@@ -23,10 +23,8 @@
#include "RepApiInterpreter.hpp"
#include "repapi/repapi.h"
#include <NdbMutex.h>
-#include <NdbStdio.h>
#include <OutputStream.hpp>
-#include <NdbString.h>
/**
const char * name;
const char * realName;
diff --git a/ndb/src/rep/RepComponents.hpp b/ndb/src/rep/RepComponents.hpp
index 8b24858271b..ff0f29e2128 100644
--- a/ndb/src/rep/RepComponents.hpp
+++ b/ndb/src/rep/RepComponents.hpp
@@ -26,7 +26,6 @@
#include <rep/rep_version.hpp>
-
/**
* Connection data
*/
diff --git a/ndb/src/rep/RepMain.cpp b/ndb/src/rep/RepMain.cpp
index e00f6c0040c..d9f057be9a1 100644
--- a/ndb/src/rep/RepMain.cpp
+++ b/ndb/src/rep/RepMain.cpp
@@ -14,8 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
-#include <stdlib.h>
+#include <ndb_global.h>
#include <NdbApiSignal.hpp>
#include <getarg.h>
diff --git a/ndb/src/rep/Requestor.cpp b/ndb/src/rep/Requestor.cpp
index af16fc33844..3c93a6394a4 100644
--- a/ndb/src/rep/Requestor.cpp
+++ b/ndb/src/rep/Requestor.cpp
@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
#include "Requestor.hpp"
#include "ConfigRetriever.hpp"
diff --git a/ndb/src/rep/Requestor.hpp b/ndb/src/rep/Requestor.hpp
index ba753be60f2..735d2094bde 100644
--- a/ndb/src/rep/Requestor.hpp
+++ b/ndb/src/rep/Requestor.hpp
@@ -17,12 +17,13 @@
#ifndef REQUESTOR_HPP
#define REQUESTOR_HPP
+#include <ndb_global.h>
+
#include <TransporterDefinitions.hpp>
#include <TransporterFacade.hpp>
#include <ClusterMgr.hpp>
#include <API.hpp>
#include <Vector.hpp>
-#include <stdio.h>
#include <GrepError.hpp>
#include <rep/storage/GCIContainer.hpp>
diff --git a/ndb/src/rep/adapters/AppNDB.hpp b/ndb/src/rep/adapters/AppNDB.hpp
index c24774d4ed3..9563a1e41ab 100644
--- a/ndb/src/rep/adapters/AppNDB.hpp
+++ b/ndb/src/rep/adapters/AppNDB.hpp
@@ -18,13 +18,9 @@
#define APPNDB_HPP
#include "NdbApi.hpp"
-#include <string.h>
-#include <assert.h>
-
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
-#include <NdbStdio.h>
#include <NdbTick.h>
#include <NdbThread.h>
diff --git a/ndb/src/rep/adapters/ExtNDB.cpp b/ndb/src/rep/adapters/ExtNDB.cpp
index 5ba6bfbbe6e..eb541cdced9 100644
--- a/ndb/src/rep/adapters/ExtNDB.cpp
+++ b/ndb/src/rep/adapters/ExtNDB.cpp
@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
#include "ExtNDB.hpp"
#include "ConfigRetriever.hpp"
#include <NdbSleep.h>
diff --git a/ndb/src/rep/adapters/ExtNDB.hpp b/ndb/src/rep/adapters/ExtNDB.hpp
index c69f94d9a7e..bcbf51393aa 100644
--- a/ndb/src/rep/adapters/ExtNDB.hpp
+++ b/ndb/src/rep/adapters/ExtNDB.hpp
@@ -17,12 +17,13 @@
#ifndef EXTNDB_HPP
#define EXTNDB_HPP
+#include <ndb_global.h>
+
#include <TransporterDefinitions.hpp>
#include <TransporterFacade.hpp>
#include <ClusterMgr.hpp>
#include <API.hpp>
#include <Vector.hpp>
-#include <stdio.h>
#include <signaldata/RepImpl.hpp>
#include <signaldata/GrepImpl.hpp>
diff --git a/ndb/src/rep/dbug_hack.cpp b/ndb/src/rep/dbug_hack.cpp
index 364325b55ae..74e5f080777 100644
--- a/ndb/src/rep/dbug_hack.cpp
+++ b/ndb/src/rep/dbug_hack.cpp
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdarg.h>
-#include <string.h>
+#include <ndb_global.h>
+
#include <OutputStream.hpp>
#include "NdbOut.hpp"
#include "rep_version.hpp"
@@ -25,6 +25,7 @@ int replogEnabled;
/**
* @todo This should be implemented using MySQLs dbug library
*/
+#if 0
extern "C"
void
DBUG_PRINT(const char * fmt, ...)
@@ -40,6 +41,7 @@ DBUG_PRINT(const char * fmt, ...)
va_end(ap);
#endif
}
+#endif
extern "C"
void
diff --git a/ndb/src/rep/rep_version.hpp b/ndb/src/rep/rep_version.hpp
index 0182f080730..3830f9c351c 100644
--- a/ndb/src/rep/rep_version.hpp
+++ b/ndb/src/rep/rep_version.hpp
@@ -29,7 +29,7 @@
extern "C"
void
-DBUG_PRINT(const char * fmt, ...);
+DBUG_PRINT__(const char * fmt, ...);
extern "C"
void
diff --git a/ndb/src/rep/repapi/repapi.cpp b/ndb/src/rep/repapi/repapi.cpp
index 80274896004..d34ab098c9c 100644
--- a/ndb/src/rep/repapi/repapi.cpp
+++ b/ndb/src/rep/repapi/repapi.cpp
@@ -14,17 +14,12 @@
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>
#include "repapi.h"
//#include "mgmapi_debug.h"
#include <socket_io.h>
-#include <stdlib.h>
-
-#include <string.h>
-#include <NdbStdio.h>
-#include <NdbString.h>
-#include <errno.h>
#include <NdbOut.hpp>
#include <SocketServer.hpp>
#include <Parser.hpp>
diff --git a/ndb/src/rep/state/Interval.cpp b/ndb/src/rep/state/Interval.cpp
index 75697fa7548..8266f19c58d 100644
--- a/ndb/src/rep/state/Interval.cpp
+++ b/ndb/src/rep/state/Interval.cpp
@@ -16,6 +16,8 @@
#include "Interval.hpp"
+#undef min
+#undef max
Uint32 max(Uint32 a, Uint32 b) { return a > b ? a : b; }
Uint32 min(Uint32 a, Uint32 b) { return a < b ? a : b; }
diff --git a/ndb/src/rep/state/RepState.cpp b/ndb/src/rep/state/RepState.cpp
index a34bff25d7f..d8a50961a3c 100644
--- a/ndb/src/rep/state/RepState.cpp
+++ b/ndb/src/rep/state/RepState.cpp
@@ -681,7 +681,7 @@ Properties * RepState::query(QueryCounter counter, Uint32 replicationId)
if(prop == NULL)
return NULL;
NdbMutex_Lock(m_mutex);
- if(counter != (Uint32)-1)
+ if(counter != ~(Uint32)0)
getEpochState((Channel::Position)counter, prop );
prop->put("no_of_nodegroups", m_channel.getNoOfNodeGroups());
prop->put("subid", m_channel.getNoOfNodeGroups());
@@ -714,9 +714,13 @@ RepState::getEpochState(Channel::Position pos, Properties * p)
*/
pos_first--;
pos_last--;
+ first_buf[pos_first]= '\0';
+ last_buf[pos_last]= '\0';
+#if 0
sprintf(first_buf+pos_first,"","");
sprintf(last_buf + pos_last,"","");
-
+#endif
+
p->put("first", first_buf);
p->put("last", last_buf);
diff --git a/ndb/src/rep/storage/GCIBuffer.cpp b/ndb/src/rep/storage/GCIBuffer.cpp
index 5049e47ea66..013600b30a5 100644
--- a/ndb/src/rep/storage/GCIBuffer.cpp
+++ b/ndb/src/rep/storage/GCIBuffer.cpp
@@ -14,9 +14,8 @@
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 "GCIBuffer.hpp"
-#include <stdlib.h>
-#include <assert.h>
/*****************************************************************************
* Constructor / Destructor
diff --git a/ndb/src/rep/storage/GCIBuffer.hpp b/ndb/src/rep/storage/GCIBuffer.hpp
index 5a07b149f81..8a8473d1d49 100644
--- a/ndb/src/rep/storage/GCIBuffer.hpp
+++ b/ndb/src/rep/storage/GCIBuffer.hpp
@@ -18,7 +18,7 @@
#define GCI_BUFFER_HPP
#include "GCIPage.hpp"
-#include "Vector.hpp"
+#include <Vector.hpp>
#include <TransporterDefinitions.hpp>
#include <signaldata/RepImpl.hpp>
diff --git a/ndb/src/rep/storage/GCIContainer.hpp b/ndb/src/rep/storage/GCIContainer.hpp
index 173bb790a57..48cbc66bfbd 100644
--- a/ndb/src/rep/storage/GCIContainer.hpp
+++ b/ndb/src/rep/storage/GCIContainer.hpp
@@ -22,6 +22,7 @@
#include "LogRecord.hpp"
#include "GCIBuffer.hpp"
+#undef swap
#include <list>
#include <iterator>
diff --git a/ndb/src/rep/storage/LogRecord.hpp b/ndb/src/rep/storage/LogRecord.hpp
index ba2632e23c7..a0bf3d52372 100644
--- a/ndb/src/rep/storage/LogRecord.hpp
+++ b/ndb/src/rep/storage/LogRecord.hpp
@@ -17,8 +17,7 @@
#ifndef LOG_RECORD_HPP
#define LOG_RECORD_HPP
-#include <ndb_types.h>
-#include <stdlib.h>
+#include <ndb_global.h>
#include <portlib/NdbMem.h>
/**
diff --git a/ndb/src/rep/storage/NodeGroupInfo.hpp b/ndb/src/rep/storage/NodeGroupInfo.hpp
index 605ccf76a38..3d0499d4425 100644
--- a/ndb/src/rep/storage/NodeGroupInfo.hpp
+++ b/ndb/src/rep/storage/NodeGroupInfo.hpp
@@ -18,12 +18,10 @@
#define NODE_GROUPINFO_HPP
#include <Vector.hpp>
-#include <NdbStdio.h>
#include <NdbTick.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
//#include <NdbSleep.h>
-#include <NdbString.h>
#include "NodeGroup.hpp"
#include <rep/rep_version.hpp>
diff --git a/ndb/src/rep/transfer/TransPS.cpp b/ndb/src/rep/transfer/TransPS.cpp
index 7af53f24415..1f65e95850d 100644
--- a/ndb/src/rep/transfer/TransPS.cpp
+++ b/ndb/src/rep/transfer/TransPS.cpp
@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
#include "ConfigRetriever.hpp"
#include <NdbSleep.h>
diff --git a/ndb/src/rep/transfer/TransPS.hpp b/ndb/src/rep/transfer/TransPS.hpp
index 35823f1eb19..b47f1acfca2 100644
--- a/ndb/src/rep/transfer/TransPS.hpp
+++ b/ndb/src/rep/transfer/TransPS.hpp
@@ -17,12 +17,10 @@
#ifndef TransPS_HPP
#define TransPS_HPP
-#include <NdbStdio.h>
#include <NdbTick.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
-#include <NdbString.h>
#include <TransporterDefinitions.hpp>
#include <TransporterFacade.hpp>
diff --git a/ndb/src/rep/transfer/TransSS.cpp b/ndb/src/rep/transfer/TransSS.cpp
index 5399bfb4e3f..83f4b570330 100644
--- a/ndb/src/rep/transfer/TransSS.cpp
+++ b/ndb/src/rep/transfer/TransSS.cpp
@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
#include "ConfigRetriever.hpp"
diff --git a/ndb/src/rep/transfer/TransSS.hpp b/ndb/src/rep/transfer/TransSS.hpp
index 90f320a079e..6f2089e46ac 100644
--- a/ndb/src/rep/transfer/TransSS.hpp
+++ b/ndb/src/rep/transfer/TransSS.hpp
@@ -17,12 +17,10 @@
#ifndef TransSS_HPP
#define TransSS_HPP
-#include <NdbStdio.h>
#include <NdbTick.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
-#include <NdbString.h>
#include <TransporterDefinitions.hpp>
#include <TransporterFacade.hpp>
diff --git a/ndb/test/include/NDBT_Stats.hpp b/ndb/test/include/NDBT_Stats.hpp
index 15a125dea86..28212bdba17 100644
--- a/ndb/test/include/NDBT_Stats.hpp
+++ b/ndb/test/include/NDBT_Stats.hpp
@@ -17,9 +17,7 @@
#ifndef NDBT_STATS_HPP
#define NDBT_STATS_HPP
-#include <math.h>
-#include <float.h>
-#include <assert.h>
+#include <ndb_global.h>
class NDBT_Stats {
public:
diff --git a/ndb/test/include/NDBT_Table.hpp b/ndb/test/include/NDBT_Table.hpp
index a4482fa8084..950c1f15ff7 100644
--- a/ndb/test/include/NDBT_Table.hpp
+++ b/ndb/test/include/NDBT_Table.hpp
@@ -17,11 +17,11 @@
#ifndef NDBT_TABLE_HPP
#define NDBT_TABLE_HPP
+#include <ndb_global.h>
+
#include <NdbApi.hpp>
#include <NdbOut.hpp>
-#include <string.h>
-
class NDBT_Attribute : public NdbDictionary::Column {
friend class NdbOut& operator <<(class NdbOut&, const NDBT_Attribute &);
public:
diff --git a/ndb/test/include/NDBT_Test.hpp b/ndb/test/include/NDBT_Test.hpp
index 41332bb570c..7a5d14689bc 100644
--- a/ndb/test/include/NDBT_Test.hpp
+++ b/ndb/test/include/NDBT_Test.hpp
@@ -24,7 +24,6 @@
#include <NdbSleep.h>
#include <NdbCondition.h>
#include <NdbTimer.hpp>
-#include <assert.h>
#include <Vector.hpp>
#include <NdbDictionary.hpp>
diff --git a/ndb/test/include/NdbTimer.hpp b/ndb/test/include/NdbTimer.hpp
index 8d9a088b7b5..b0d500b5c2c 100644
--- a/ndb/test/include/NdbTimer.hpp
+++ b/ndb/test/include/NdbTimer.hpp
@@ -17,7 +17,6 @@
#ifndef NDBTIMER_H
#define NDBTIMER_H
-#include <NdbStdio.h>
#include <NdbTick.h>
#include <NdbOut.hpp>
diff --git a/ndb/test/ndbapi/acid2/acid2.cpp b/ndb/test/ndbapi/acid2/acid2.cpp
index 5835b76453e..434a0450daa 100644
--- a/ndb/test/ndbapi/acid2/acid2.cpp
+++ b/ndb/test/ndbapi/acid2/acid2.cpp
@@ -17,7 +17,6 @@
#include <NdbApi.hpp>
#include <NdbOut.hpp>
-#include <NdbStdio.h>
#include <NdbThread.h>
#include <NdbSleep.h>
#include <NdbMutex.h>
diff --git a/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp b/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp
index ee724236855..d84818baf24 100644
--- a/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp
+++ b/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp
@@ -15,8 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp b/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp
index 0b6fc9c1f97..55e9081a598 100644
--- a/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp
+++ b/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp
@@ -15,8 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp b/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp
index 7071de9f63e..ab3e862e8d2 100644
--- a/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp
+++ b/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp
@@ -15,8 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp b/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp
index cfb2c93e4ad..ba8de9e4af1 100644
--- a/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp
+++ b/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp b/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp
index 155a35998bb..0c7d5d72473 100644
--- a/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp
+++ b/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp b/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp
index cc8e2792cbf..13136755de8 100644
--- a/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp
+++ b/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp b/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp
index f2b28d8b057..18881cae216 100644
--- a/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp
+++ b/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp
@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp b/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp
index eaa99e8a79d..55d04888144 100644
--- a/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp
+++ b/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/create_tab/create_tab.cpp b/ndb/test/ndbapi/create_tab/create_tab.cpp
index 2f2911b4ef4..8bb1e7a9572 100644
--- a/ndb/test/ndbapi/create_tab/create_tab.cpp
+++ b/ndb/test/ndbapi/create_tab/create_tab.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp b/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp
index 8e67493c003..59c57396acd 100644
--- a/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp
+++ b/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp b/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp
index 3938cd21f78..0822f3ee999 100644
--- a/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp
+++ b/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp
@@ -24,8 +24,6 @@
#include <NdbTick.h>
#include <NdbOut.hpp>
#include <NdbTimer.hpp>
-#include <string.h>
-#include <NdbStdio.h>
#include <NDBT_Error.hpp>
#include <NdbTest.hpp>
diff --git a/ndb/test/ndbapi/flexBench/flexBench.cpp b/ndb/test/ndbapi/flexBench/flexBench.cpp
index 17d9be73925..809d11086bf 100644
--- a/ndb/test/ndbapi/flexBench/flexBench.cpp
+++ b/ndb/test/ndbapi/flexBench/flexBench.cpp
@@ -51,13 +51,9 @@ Arguments:
#include "NdbApi.hpp"
-#include <string.h>
-#include <assert.h>
-
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
-#include <NdbStdio.h>
#include <NdbTick.h>
#include <NdbTimer.hpp>
#include <NdbThread.h>
@@ -296,7 +292,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
if(useLongKeys){
longKeyAttrName = (char **) malloc(sizeof(char*) * tNoOfLongPK);
- for (int i = 0; i < tNoOfLongPK; i++) {
+ for (Uint32 i = 0; i < tNoOfLongPK; i++) {
longKeyAttrName[i] = (char *) malloc(strlen("KEYATTR ") + 1);
memset(longKeyAttrName[i], 0, strlen("KEYATTR ") + 1);
sprintf(longKeyAttrName[i], "KEYATTR%i", i);
@@ -535,7 +531,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
waitForThreads(pThreadsData);
void * tmp;
- for(int i = 0; i<tNoOfThreads; i++){
+ for(Uint32 i = 0; i<tNoOfThreads; i++){
NdbThread_WaitFor(pThreadsData[i].threadLife, &tmp);
NdbThread_Destroy(&pThreadsData[i].threadLife);
}
@@ -544,7 +540,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
if (useLongKeys == true) {
// Only free these areas if they have been allocated
// Otherwise cores will happen
- for (int i = 0; i < tNoOfLongPK; i++)
+ for (Uint32 i = 0; i < tNoOfLongPK; i++)
free(longKeyAttrName[i]);
free(longKeyAttrName);
} // if
@@ -633,13 +629,13 @@ static void* flexBenchThread(void* pArg)
if(useLongKeys){
// Allocate and populate the longkey array.
longKeyAttrValue = (unsigned ***) malloc(sizeof(unsigned**) * tNoOfOperations );
- for (int n = 0; n < tNoOfOperations; n++)
+ for (Uint32 n = 0; n < tNoOfOperations; n++)
longKeyAttrValue[n] = (unsigned **) malloc(sizeof(unsigned*) * tNoOfLongPK );
- for (int n = 0; n < tNoOfOperations; n++){
- for (int i = 0; i < tNoOfLongPK ; i++) {
+ for (Uint32 n = 0; n < tNoOfOperations; n++){
+ for (Uint32 i = 0; i < tNoOfLongPK ; i++) {
longKeyAttrValue[n][i] = (unsigned *) malloc(sizeof(unsigned) * tSizeOfLongPK);
memset(longKeyAttrValue[n][i], 0, sizeof(unsigned) * tSizeOfLongPK);
- for(int j = 0; j < tSizeOfLongPK; j++) {
+ for(Uint32 j = 0; j < tSizeOfLongPK; j++) {
// Repeat the unique value to fill up the long key.
longKeyAttrValue[n][i][j] = threadBase + n;
}
@@ -649,10 +645,10 @@ static void* flexBenchThread(void* pArg)
int nRefOpOffset = 0 ;
//Assign reference attribute values to memory
- for(int ops = 1 ; ops < tNoOfOperations ; ops++){
+ for(Uint32 ops = 1 ; ops < tNoOfOperations ; ops++){
// Calculate offset value before going into the next loop
nRefOpOffset = tAttributeSize*tNoOfAttributes*(ops-1) ;
- for(int a = 0 ; a < tNoOfAttributes ; a++){
+ for(Uint32 a = 0 ; a < tNoOfAttributes ; a++){
*(int*)&attrRefValue[nRefOpOffset + tAttributeSize*a] =
(int)(threadBase + ops + a) ;
}
@@ -761,7 +757,7 @@ static void* flexBenchThread(void* pArg)
if(useLongKeys){
// Loop the equal call so the complete key is send to the kernel.
- for(int i = 0; i < tNoOfLongPK; i++)
+ for(Uint32 i = 0; i < tNoOfLongPK; i++)
pOps[countTables]->equal(longKeyAttrName[i],
(char *)longKeyAttrValue[count - 1][i], tSizeOfLongPK*4);
}
@@ -927,8 +923,8 @@ static void* flexBenchThread(void* pArg)
if (useLongKeys == true) {
// Only free these areas if they have been allocated
// Otherwise cores will occur
- for (int n = 0; n < tNoOfOperations; n++){
- for (int i = 0; i < tNoOfLongPK; i++) {
+ for (Uint32 n = 0; n < tNoOfOperations; n++){
+ for (Uint32 i = 0; i < tNoOfLongPK; i++) {
free(longKeyAttrValue[n][i]);
}
free(longKeyAttrValue[n]);
@@ -1068,13 +1064,13 @@ static void sleepBeforeStartingTest(int seconds){
static int
createTables(Ndb* pMyNdb){
- for (int i = 0; i < tNoOfAttributes; i++){
+ for (Uint32 i = 0; i < tNoOfAttributes; i++){
snprintf(attrName[i], MAXSTRLEN, "COL%d", i);
}
// Note! Uses only uppercase letters in table name's
// so that we can look at the tables with SQL
- for (int i = 0; i < tNoOfTables; i++){
+ for (Uint32 i = 0; i < tNoOfTables; i++){
if (theStdTableNameFlag == 0){
snprintf(tableName[i], MAXSTRLEN, "TAB%d_%d", i,
(int)(NdbTick_CurrentMillisecond() / 1000));
@@ -1091,7 +1087,7 @@ createTables(Ndb* pMyNdb){
tmpTable.setStoredTable(!theTempTable);
if(useLongKeys){
- for(int i = 0; i < tNoOfLongPK; i++) {
+ for(Uint32 i = 0; i < tNoOfLongPK; i++) {
NdbDictionary::Column col(longKeyAttrName[i]);
col.setType(NdbDictionary::Column::Unsigned);
col.setLength(tSizeOfLongPK);
diff --git a/ndb/test/ndbapi/flexHammer/flexHammer.cpp b/ndb/test/ndbapi/flexHammer/flexHammer.cpp
index f8a519f021a..057efb31e74 100644
--- a/ndb/test/ndbapi/flexHammer/flexHammer.cpp
+++ b/ndb/test/ndbapi/flexHammer/flexHammer.cpp
@@ -57,8 +57,6 @@ Revision history:
#include <NdbTimer.hpp>
#include <NdbTick.h>
#include <NdbTest.hpp>
-#include <string.h>
-#include <assert.h>
#include <NDBT_Error.hpp>
ErrorData * flexHammerErrorData;
diff --git a/ndb/test/ndbapi/flexScan/flexScan.cpp b/ndb/test/ndbapi/flexScan/flexScan.cpp
index 55163a99fbe..19fb6dc5ab0 100644
--- a/ndb/test/ndbapi/flexScan/flexScan.cpp
+++ b/ndb/test/ndbapi/flexScan/flexScan.cpp
@@ -59,12 +59,9 @@
#include <NdbTick.h>
#include <NdbOut.hpp>
#include <NdbTimer.hpp>
-#include <string.h>
-#include <assert.h>
#include <NdbMain.h>
#include <NdbTest.hpp>
#include <NDBT_Error.hpp>
-#include <NdbStdio.h>
#define PKSIZE 1
#define FOREVER 1
diff --git a/ndb/test/ndbapi/flexTT/flexTT.cpp b/ndb/test/ndbapi/flexTT/flexTT.cpp
index 1705f20b706..c45cbd95762 100644
--- a/ndb/test/ndbapi/flexTT/flexTT.cpp
+++ b/ndb/test/ndbapi/flexTT/flexTT.cpp
@@ -15,7 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NdbApi.hpp"
+#include <ndb_global.h>
+
+#include <NdbApi.hpp>
#include <NdbMain.h>
#include <md5_hash.hpp>
@@ -24,9 +26,6 @@
#include <NdbTick.h>
#include <NdbOut.hpp>
#include <NdbTimer.hpp>
-#include <string.h>
-#include <NdbStdio.h>
-#include <stdlib.h>
#include <NdbTest.hpp>
#include <NDBT_Error.hpp>
diff --git a/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp b/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp
index 6a00463339b..7cc883ab3e6 100644
--- a/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp
+++ b/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp
@@ -57,13 +57,9 @@ Arguments:
#include "NdbApi.hpp"
-#include <string.h>
-#include <assert.h>
-
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
-#include <NdbStdio.h>
#include <NdbTick.h>
#include <NdbTimer.hpp>
#include <NdbThread.h>
diff --git a/ndb/test/ndbapi/indexTest/index.cpp b/ndb/test/ndbapi/indexTest/index.cpp
index d0eb490e1a0..508186de529 100644
--- a/ndb/test/ndbapi/indexTest/index.cpp
+++ b/ndb/test/ndbapi/indexTest/index.cpp
@@ -37,9 +37,8 @@
1 - Invalid arguments
* *************************************************** */
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbApi.hpp>
#include <NdbOut.hpp>
#include <NdbTick.h>
diff --git a/ndb/test/ndbapi/indexTest2/index2.cpp b/ndb/test/ndbapi/indexTest2/index2.cpp
index 5a3674f0bbf..e49113d2f1b 100644
--- a/ndb/test/ndbapi/indexTest2/index2.cpp
+++ b/ndb/test/ndbapi/indexTest2/index2.cpp
@@ -37,9 +37,8 @@
1 - Invalid arguments
* *************************************************** */
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbApi.hpp>
#include <NdbOut.hpp>
#include <NdbTick.h>
diff --git a/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp b/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp
index b9d1eca1cc9..a2352edf707 100644
--- a/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp
+++ b/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp
@@ -54,9 +54,6 @@
* *************************************************** */
-#include <NdbStdio.h>
-#include <string.h>
-#include <assert.h>
#include <NdbOut.hpp>
#include <NdbThread.h>
#include <NdbMutex.h>
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp b/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp
index 25eb1830de9..84a93414712 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp
+++ b/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp
@@ -18,8 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <string.h>
+#include <ndb_global.h>
#include "dbGenerator.h"
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp b/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp
index d7506c9dd2c..f613c66d07b 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp
+++ b/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp
@@ -14,10 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <NdbUnistd.h>
+#include <ndb_global.h>
#include <NdbHost.h>
#include <NdbSleep.h>
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h b/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h
index c049cdbad33..22b7f564490 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h
+++ b/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h
@@ -17,8 +17,7 @@
#ifndef MACROS_H
#define MACROS_H
-#include <stdlib.h>
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#define ERROR(x) {ndbout_c((x));}
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp b/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp
index 91a061c7cf4..9e6c5e55e73 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp
+++ b/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp
@@ -17,7 +17,7 @@
#ifndef NDB_ERROR_H
#define NDB_ERROR_H
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include "userInterface.h"
#include <NdbError.hpp>
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp b/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp
index ece82628ba7..fdbc229cc98 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp
+++ b/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp
@@ -18,9 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
+#include <ndb_global.h>
#include <time.h>
#include "ndb_schema.hpp"
@@ -31,7 +29,6 @@
#include <NdbTick.h>
#include <NdbApi.hpp>
#include <NdbOut.hpp>
-#include <NdbStdio.h>
/***************************************************************
* L O C A L C O N S T A N T S *
diff --git a/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h b/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h
index c6ad11016b2..2f4aeb30975 100644
--- a/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h
+++ b/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h
@@ -23,12 +23,6 @@
#include <ndb_types.h>
-/***************************************************************
-* M A C R O S *
-***************************************************************/
-
-typedef Uint32 uint32;
-
/***************************************************************/
/* C O N S T A N T S */
/***************************************************************/
@@ -62,14 +56,14 @@ typedef char GroupName[GROUP_NAME_LENGTH];
typedef char ChangedBy[CHANGED_BY_LENGTH];
typedef char ChangedTime[CHANGED_TIME_LENGTH];
typedef char SessionDetails[SESSION_DETAILS_LENGTH];
-typedef uint32 ServerId;
-typedef uint32 ServerBit;
-typedef uint32 GroupId;
-typedef uint32 Location;
-typedef uint32 Permission;
-
-typedef uint32 Counter;
-typedef uint32 ActiveSessions;
+typedef Uint32 ServerId;
+typedef Uint32 ServerBit;
+typedef Uint32 GroupId;
+typedef Uint32 Location;
+typedef Uint32 Permission;
+
+typedef Uint32 Counter;
+typedef Uint32 ActiveSessions;
typedef unsigned int BranchExecuted;
typedef unsigned int DoRollback;
diff --git a/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c b/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c
index eedcd914d85..7484c7647f5 100644
--- a/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c
+++ b/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c
@@ -18,8 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <string.h>
+#include <ndb_global.h>
#include "dbGenerator.h"
/***************************************************************
diff --git a/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c b/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c
index 6ddf0a47775..4a31db0b4e9 100644
--- a/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c
+++ b/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c
@@ -14,11 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <pthread.h>
+#include <ndb_global.h>
#include <NdbHost.h>
#include <NdbSleep.h>
diff --git a/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c b/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c
index 9f8629ec1f0..42fbb52f3b2 100644
--- a/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c
+++ b/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c
@@ -18,9 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <ndb_global.h>
#include "userInterface.h"
diff --git a/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c b/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c
index 9dde902d006..838ac8a7196 100644
--- a/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c
+++ b/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c
@@ -14,9 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <ndb_global.h>
#include "userInterface.h"
#include "dbPopulate.h"
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c b/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c
index ca8a64ab59c..dd100507016 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c
+++ b/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c
@@ -18,7 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
+#include <ndb_global.h>
#include "userInterface.h"
#include "userHandle.h"
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/macros.h b/ndb/test/ndbapi/lmc-bench/src/user/macros.h
index beb4352c269..363f247b93f 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/macros.h
+++ b/ndb/test/ndbapi/lmc-bench/src/user/macros.h
@@ -17,8 +17,7 @@
#ifndef MACROS_H
#define MACROS_H
-#include <stdlib.h>
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#define ERROR(x) {ndbout_c((x)); }
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp b/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp
index 5f792342ed9..b3aaeac822e 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp
+++ b/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp
@@ -17,7 +17,6 @@
#ifndef NDB_ERROR_H
#define NDB_ERROR_H
-#include <stdio.h>
#include <NdbOut.hpp>
#define error_handler(x,y, z) { \
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp b/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp
index 6a35bccd064..ce3a76cdd59 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp
+++ b/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp
@@ -19,7 +19,7 @@ extern "C" {
#include "user_populate.h"
}
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbApi.hpp>
#include "ndb_schema.hpp"
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c b/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c
index c68f287f5dd..bacf1861dde 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c
+++ b/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c
@@ -18,10 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/time.h>
+#include <ndb_global.h>
#include "userInterface.h"
#include "userHandle.h"
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c b/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c
index 17069b0a042..a2f4787bb0c 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c
+++ b/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c
@@ -18,8 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <string.h>
+#include <ndb_global.h>
#include <time.h>
#include "sql.h"
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp b/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp
index fc3f6955a47..67c4e037215 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp
+++ b/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp
@@ -18,9 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <NdbStdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
+#include <ndb_global.h>
#ifndef NDB_WIN32
#include <sys/time.h>
#endif
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c b/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c
index 17069b0a042..a2f4787bb0c 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c
+++ b/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c
@@ -18,8 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <string.h>
+#include <ndb_global.h>
#include <time.h>
#include "sql.h"
diff --git a/ndb/test/ndbapi/restarter/restarter.cpp b/ndb/test/ndbapi/restarter/restarter.cpp
index ad3507df98a..9a522f5dcac 100644
--- a/ndb/test/ndbapi/restarter/restarter.cpp
+++ b/ndb/test/ndbapi/restarter/restarter.cpp
@@ -26,8 +26,6 @@
#include <NdbRestarter.hpp>
#include <NdbRestarts.hpp>
#include <NDBT.hpp>
-#include <assert.h>
-#include <NdbStdio.h>
int main(int argc, const char** argv){
diff --git a/ndb/test/ndbapi/restarter2/restarter2.cpp b/ndb/test/ndbapi/restarter2/restarter2.cpp
index 71eaf1a9b0f..f2bcf6f8e7b 100644
--- a/ndb/test/ndbapi/restarter2/restarter2.cpp
+++ b/ndb/test/ndbapi/restarter2/restarter2.cpp
@@ -24,8 +24,6 @@
#include <NdbRestarter.hpp>
#include <NDBT.hpp>
-#include <assert.h>
-#include <NdbStdio.h>
int main(int argc, const char** argv){
diff --git a/ndb/test/ndbapi/restarts/restarts.cpp b/ndb/test/ndbapi/restarts/restarts.cpp
index 2f9bab3b233..0ec2883d53c 100644
--- a/ndb/test/ndbapi/restarts/restarts.cpp
+++ b/ndb/test/ndbapi/restarts/restarts.cpp
@@ -25,8 +25,6 @@
#include <NdbRestarts.hpp>
#include <NDBT.hpp>
-#include <assert.h>
-#include <NdbStdio.h>
int main(int argc, const char** argv){
diff --git a/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp b/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp
index 71fa286a21b..ce0aee35e8f 100644
--- a/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp
+++ b/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp
@@ -26,6 +26,8 @@
* *************************************************** */
+#include <ndb_global.h>
+
#include <NdbApi.hpp>
#include <NdbTest.hpp>
#include <NdbOut.hpp>
@@ -36,11 +38,6 @@
#include <NdbTick.h>
#include <random.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <math.h>
-
#define MAX_TIMERS 4
#define MAXSTRLEN 16
#define MAXATTR 64
diff --git a/ndb/test/ndbapi/telco/msa.cpp b/ndb/test/ndbapi/telco/msa.cpp
index f074733dce4..39ddaac2019 100644
--- a/ndb/test/ndbapi/telco/msa.cpp
+++ b/ndb/test/ndbapi/telco/msa.cpp
@@ -14,17 +14,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
-#include <math.h>
+#include <ndb_global.h>
#include <NdbApi.hpp>
#include <NdbCondition.h>
#include <NdbMutex.h>
#include <NdbSleep.h>
-#include <NdbStdio.h>
#include <NdbThread.h>
#include <NdbTick.h>
-#include <NdbString.h>
const char* const c_szDatabaseName = "TEST_DB";
diff --git a/ndb/test/ndbapi/testBlobs/testBlobs.cpp b/ndb/test/ndbapi/testBlobs/testBlobs.cpp
index b8fe51dc1e4..9f959702402 100644
--- a/ndb/test/ndbapi/testBlobs/testBlobs.cpp
+++ b/ndb/test/ndbapi/testBlobs/testBlobs.cpp
@@ -18,13 +18,8 @@
* testBlobs
*/
-#include <new>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <NdbUnistd.h>
-#include <NdbString.h>
-#include <NdbStdio.h>
+#include <ndb_global.h>
+
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbThread.h>
diff --git a/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp b/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp
index fd6570fad0a..b8e0fef6cef 100644
--- a/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp
+++ b/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp
@@ -28,14 +28,12 @@
* Creates tables TB00 to TB15
*/
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
+#include <ndb_global.h>
+
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
#include <NdbTest.hpp>
-#include <NdbStdio.h>
// limits
static int const MaxAttr = 64;
diff --git a/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp b/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp
index 056aa9bf173..7fd2c19d9f7 100644
--- a/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp
+++ b/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp
@@ -31,8 +31,6 @@
#include <UtilTransactions.hpp>
#include <ConfigRetriever.hpp>
#include <ndb_version.h>
-#include <assert.h>
-#include <NdbStdio.h>
#define CHECK(b) if (!(b)) { \
diff --git a/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp
index 68fa6ec5474..a47d9d2099e 100644
--- a/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp
+++ b/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp
@@ -18,17 +18,12 @@
* testOIBasic - ordered index test
*/
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <new>
+#include <ndb_global.h>
+
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
#include <NdbTest.hpp>
-#include <NdbStdio.h>
#include <NdbMutex.h>
#include <NdbCondition.h>
#include <NdbThread.h>
diff --git a/ndb/test/ndbapi/vw_test/bcd.h b/ndb/test/ndbapi/vw_test/bcd.h
index ce1309693c8..d0aaffbd8b7 100644
--- a/ndb/test/ndbapi/vw_test/bcd.h
+++ b/ndb/test/ndbapi/vw_test/bcd.h
@@ -14,8 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <math.h>
-#include <stdio.h>
+#include <ndb_global.h>
struct bcdtab {
char tab[3];
diff --git a/ndb/test/ndbapi/vw_test/cdrserver.cpp b/ndb/test/ndbapi/vw_test/cdrserver.cpp
index 3c3f32e8886..8354d28f53f 100644
--- a/ndb/test/ndbapi/vw_test/cdrserver.cpp
+++ b/ndb/test/ndbapi/vw_test/cdrserver.cpp
@@ -31,28 +31,22 @@
/* must also have the same entry (same port number) in its */
/* ./etc/services file. */
/* **************************************************************** */
+
+#include <ndb_global.h>
+
/******** NDB INCLUDE ******/
#include <NdbApi.hpp>
/***************************/
/*#include <sys/shm.h>*/
-#include <unistd.h>
-#include <stdlib.h>
-#include <strings.h>
#include <pthread.h>
#include <sys/sem.h>
-#include <sys/types.h>
#include <sys/shm.h>
-#include <sys/socket.h>
-#include <errno.h>
#include <netinet/in.h>
#include <signal.h>
-#include <stdio.h>
#include <netdb.h>
#include <time.h>
#include <synch.h>
#include <sched.h>
-#include <limits.h>
-#include <math.h>
extern "C" {
#include "utv.h"
diff --git a/ndb/test/ndbapi/vw_test/size.cpp b/ndb/test/ndbapi/vw_test/size.cpp
index 397cc02f4f6..c506771ebde 100644
--- a/ndb/test/ndbapi/vw_test/size.cpp
+++ b/ndb/test/ndbapi/vw_test/size.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include "utv.h"
int main(void)
diff --git a/ndb/test/newtonapi/basic_test/basic/basic.cpp b/ndb/test/newtonapi/basic_test/basic/basic.cpp
index 90f5bf14acf..bc33400078d 100644
--- a/ndb/test/newtonapi/basic_test/basic/basic.cpp
+++ b/ndb/test/newtonapi/basic_test/basic/basic.cpp
@@ -26,7 +26,6 @@ extern "C" {
#include <NdbOut.hpp>
#include <NdbSleep.h>
#include <NdbMain.h>
-#include <assert.h>
static const
DBA_ColumnDesc_t EmpColDesc[] = {
diff --git a/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp b/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp
index fb26abc65aa..4120cfba864 100644
--- a/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp
+++ b/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp
@@ -26,7 +26,6 @@ extern "C" {
#include <NdbOut.hpp>
#include <NdbSleep.h>
#include <NdbMain.h>
-#include <assert.h>
static const
DBA_ColumnDesc_t EmpColDesc[] = {
diff --git a/ndb/test/newtonapi/basic_test/common.cpp b/ndb/test/newtonapi/basic_test/common.cpp
index 6fd63730832..d4c4e6a74a7 100644
--- a/ndb/test/newtonapi/basic_test/common.cpp
+++ b/ndb/test/newtonapi/basic_test/common.cpp
@@ -16,10 +16,6 @@
#include "common.hpp"
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
NdbOut &
operator << (NdbOut & out, const Employee_t & emp){
diff --git a/ndb/test/newtonapi/basic_test/common.hpp b/ndb/test/newtonapi/basic_test/common.hpp
index e081df723ef..0df8f7e078d 100644
--- a/ndb/test/newtonapi/basic_test/common.hpp
+++ b/ndb/test/newtonapi/basic_test/common.hpp
@@ -17,12 +17,13 @@
#ifndef COMMON_H
#define COMMON_H
+#include <ndb_global.h>
+
extern "C" {
#include <dba.h>
}
#include <NdbOut.hpp>
-#include <stdlib.h>
typedef struct Employee {
UInt32_t EmpNo;
diff --git a/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp b/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp
index fc6dfc40372..2c9cee5be87 100644
--- a/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp
+++ b/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp
@@ -26,7 +26,6 @@ extern "C" {
#include <NdbOut.hpp>
#include <NdbSleep.h>
#include <NdbMain.h>
-#include <assert.h>
static const
DBA_ColumnDesc_t ColDesc[] = {
diff --git a/ndb/test/newtonapi/basic_test/too_basic.cpp b/ndb/test/newtonapi/basic_test/too_basic.cpp
index 9099f0d9154..883aacf8841 100644
--- a/ndb/test/newtonapi/basic_test/too_basic.cpp
+++ b/ndb/test/newtonapi/basic_test/too_basic.cpp
@@ -18,6 +18,9 @@
/****** THIS LINE IS 80 CHARACTERS WIDE - DO *NOT* EXCEED 80 CHARACTERS! ****/
+#include <ndb_global.h>
+#include <NdbOut.hpp>
+
//#include <cfg/cfg_db.h>
//#include <init/init_start_restart.h>
//#include "pcn_types.h"
@@ -27,13 +30,6 @@ extern "C" {
#include <cfg_db.h>
}
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <NdbOut.hpp>
-
-
-
typedef struct Employee {
UInt32_t EmpNo;
diff --git a/ndb/test/newtonapi/perf_test/perf.cpp b/ndb/test/newtonapi/perf_test/perf.cpp
index 81d4cc5fd08..7b818e93a2a 100644
--- a/ndb/test/newtonapi/perf_test/perf.cpp
+++ b/ndb/test/newtonapi/perf_test/perf.cpp
@@ -15,14 +15,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
extern "C" {
#include <dba.h>
}
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
#include <NdbOut.hpp>
#include <NdbSleep.h>
#include <NdbTimer.hpp>
@@ -31,6 +29,9 @@ extern "C" {
#include <NdbMain.h>
#include <time.h>
+#undef min
+#undef max
+
static const int NP_Insert = 0;
static const int NP_Update = 1;
static const int NP_WriteUpdate = 2;
diff --git a/ndb/test/odbc/driver/testOdbcDriver.cpp b/ndb/test/odbc/driver/testOdbcDriver.cpp
index 9731c00eeaf..b856b6a21f2 100644
--- a/ndb/test/odbc/driver/testOdbcDriver.cpp
+++ b/ndb/test/odbc/driver/testOdbcDriver.cpp
@@ -36,12 +36,7 @@
* Test of ODBC and SQL using a fixed set of tables.
*/
-#include <new>
-#include <NdbUnistd.h>
-#include <stdlib.h>
-#include <NdbString.h>
-#include <stdarg.h>
-#include <NdbStdio.h>
+#include <ndb_global.h>
#include <ndb_version.h>
#include <kernel/ndb_limits.h>
#include <Bitmask.hpp>
@@ -49,9 +44,7 @@
#ifdef ndbODBC
#include <NdbApi.hpp>
#endif
-#include <math.h>
#include <sqlext.h>
-#include <assert.h>
#undef BOOL
diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp
index 1ce9124431c..eb8a626dc2b 100644
--- a/ndb/test/run-test/main.cpp
+++ b/ndb/test/run-test/main.cpp
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <getarg.h>
#include <BaseString.hpp>
#include <Parser.hpp>
diff --git a/ndb/test/run-test/run-test.hpp b/ndb/test/run-test/run-test.hpp
index 8387f8638ed..8d00a7b6a55 100644
--- a/ndb/test/run-test/run-test.hpp
+++ b/ndb/test/run-test/run-test.hpp
@@ -24,6 +24,8 @@
#include <mgmapi.h>
#include <CpcClient.hpp>
+#undef MYSQL_CLIENT
+
enum ErrorCodes {
ERR_OK = 0,
ERR_NDB_FAILED = 101,
diff --git a/ndb/test/src/HugoAsynchTransactions.cpp b/ndb/test/src/HugoAsynchTransactions.cpp
index d045032d455..2af22b5f48d 100644
--- a/ndb/test/src/HugoAsynchTransactions.cpp
+++ b/ndb/test/src/HugoAsynchTransactions.cpp
@@ -473,6 +473,10 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
}
}
break;
+ case NO_INSERT:
+ case NO_UPDATE:
+ case NO_DELETE:
+ abort();
}
// Close all transactions
diff --git a/ndb/test/src/HugoCalculator.cpp b/ndb/test/src/HugoCalculator.cpp
index 9e2ba9f143e..55aa96a4909 100644
--- a/ndb/test/src/HugoCalculator.cpp
+++ b/ndb/test/src/HugoCalculator.cpp
@@ -15,8 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "HugoCalculator.hpp"
-#include <assert.h>
-#include <NdbStdio.h>
#include <NDBT.hpp>
/* *************************************************************
@@ -159,7 +157,7 @@ HugoCalculator::verifyRowValues(NDBT_ResultRow* const pRow) const{
<< ", NdbDict::Column::getLength(): " << attr->getLength()
<< endl;
const char* buf2 = pRow->attributeStore(i)->aRef();
- for (int j = 0; j < pRow->attributeStore(i)->arraySize(); j++)
+ for (Uint32 j = 0; j < pRow->attributeStore(i)->arraySize(); j++)
{
g_err << j << ":" << buf[j] << "[" << buf2[j] << "]";
if (buf[j] != buf2[j])
diff --git a/ndb/test/src/HugoOperations.cpp b/ndb/test/src/HugoOperations.cpp
index edcec460ba0..91263aa29b4 100644
--- a/ndb/test/src/HugoOperations.cpp
+++ b/ndb/test/src/HugoOperations.cpp
@@ -652,7 +652,7 @@ void HugoOperations::deallocRows(){
int HugoOperations::saveCopyOfRecord(int numRecords ){
- if (numRecords > rows.size())
+ if (numRecords > (int)rows.size())
return NDBT_FAILED;
for (int i = 0; i < numRecords; i++){
@@ -662,7 +662,7 @@ int HugoOperations::saveCopyOfRecord(int numRecords ){
}
BaseString HugoOperations::getRecordStr(int recordNum){
- if (recordNum > rows.size())
+ if (recordNum > (int)rows.size())
return NULL;
return rows[recordNum]->c_str();
}
@@ -673,7 +673,7 @@ int HugoOperations::getRecordGci(int recordNum){
int HugoOperations::compareRecordToCopy(int numRecords ){
- if (numRecords > rows.size())
+ if (numRecords > (int)rows.size())
return NDBT_FAILED;
if ((unsigned)numRecords > savedRecords.size())
return NDBT_FAILED;
diff --git a/ndb/test/src/HugoTransactions.cpp b/ndb/test/src/HugoTransactions.cpp
index 1293d395974..7f12484ddc8 100644
--- a/ndb/test/src/HugoTransactions.cpp
+++ b/ndb/test/src/HugoTransactions.cpp
@@ -1253,9 +1253,11 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats,
g_info << " UPDATE: ";
recEvent = recUpdateEvent;
break;
+ case NdbDictionary::Event::TE_ALL:
+ abort();
}
- if (pk < records) {
+ if ((int)pk < records) {
recEvent[pk].pk = pk;
recEvent[pk].count++;
}
@@ -1304,7 +1306,7 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats,
if (stats.n_updates > 0) {
stats.n_consecutive++;
}
- for (Uint32 i = 0; i < records/3; i++) {
+ for (Uint32 i = 0; i < (Uint32)records/3; i++) {
if (recInsertEvent[i].pk != i) {
stats.n_consecutive ++;
ndbout << "missing insert pk " << i << endl;
diff --git a/ndb/test/src/NDBT_Error.cpp b/ndb/test/src/NDBT_Error.cpp
index 92c0b2e5c1f..ffacb3eb928 100644
--- a/ndb/test/src/NDBT_Error.cpp
+++ b/ndb/test/src/NDBT_Error.cpp
@@ -17,11 +17,9 @@
/* NDBT_Error.cpp */
/* This program deals with error handling */
-#include <string.h>
-#include <assert.h>
+#include <ndb_global.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
-#include <NdbStdio.h>
#include <NdbTest.hpp>
#include <NDBT_Error.hpp>
#include <NdbSleep.h>
diff --git a/ndb/test/src/NDBT_ResultRow.cpp b/ndb/test/src/NDBT_ResultRow.cpp
index 098e4cfb796..ba46be203e1 100644
--- a/ndb/test/src/NDBT_ResultRow.cpp
+++ b/ndb/test/src/NDBT_ResultRow.cpp
@@ -14,10 +14,8 @@
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 "NDBT_ResultRow.hpp"
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
#include <NdbOut.hpp>
NDBT_ResultRow::NDBT_ResultRow(const NdbDictionary::Table& tab,
@@ -68,6 +66,7 @@ NDBT_ResultRow::attributeStore(const char* name){
return data[i];
}
assert(false);
+ return 0;
}
NdbOut &
@@ -191,7 +190,8 @@ NDBT_ResultRow::clone () const {
NDBT_ResultRow * row = new NDBT_ResultRow(m_table, ad[0]);
row->m_ownData = true;
- for(Uint32 i = 0; i<m_table.getNoOfColumns(); i++){
+ Uint32 noOfColumns = m_table.getNoOfColumns();
+ for(Uint32 i = 0; i < noOfColumns; i++){
row->data[i] = data[i]->clone();
}
diff --git a/ndb/test/src/NDBT_ReturnCodes.cpp b/ndb/test/src/NDBT_ReturnCodes.cpp
index 542547c7a48..5bffc00177f 100644
--- a/ndb/test/src/NDBT_ReturnCodes.cpp
+++ b/ndb/test/src/NDBT_ReturnCodes.cpp
@@ -14,14 +14,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+/* System include files */
+#include <ndb_global.h>
+
#include "NDBT_ReturnCodes.h"
/* Ndb include files */
#include <NdbOut.hpp>
-/* System include files */
-#include <stdlib.h>
-
const char* rcodeToChar(int rcode){
switch (rcode){
case NDBT_OK:
diff --git a/ndb/test/src/NDBT_Table.cpp b/ndb/test/src/NDBT_Table.cpp
index 2bd2c265f10..c520b01c990 100644
--- a/ndb/test/src/NDBT_Table.cpp
+++ b/ndb/test/src/NDBT_Table.cpp
@@ -15,8 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "NDBT_Table.hpp"
-#include <NdbString.h>
-#include <assert.h>
#include <NdbTimer.hpp>
#include <NDBT.hpp>
diff --git a/ndb/test/src/NDBT_Tables.cpp b/ndb/test/src/NDBT_Tables.cpp
index 41a38e4fe44..548e755a3fb 100644
--- a/ndb/test/src/NDBT_Tables.cpp
+++ b/ndb/test/src/NDBT_Tables.cpp
@@ -18,7 +18,6 @@
#include <NDBT_Table.hpp>
#include <NDBT_Tables.hpp>
-#include <assert.h>
/* ******************************************************* */
// Define Ndb standard tables
//
diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp
index 689aae64c81..6cbb69508f5 100644
--- a/ndb/test/src/NdbBackup.cpp
+++ b/ndb/test/src/NdbBackup.cpp
@@ -18,7 +18,6 @@
#include <NdbBackup.hpp>
#include <NdbOut.hpp>
#include <NDBT_Output.hpp>
-#include <assert.h>
#include <NdbConfig.h>
#include <ConfigRetriever.hpp>
#include <ndb_version.h>
@@ -67,7 +66,6 @@ NdbBackup::getFileSystemPathForNode(int _node_id){
/**
* Fetch configuration from management server
*/
- char buf[255];
ConfigRetriever cr;
diff --git a/ndb/test/src/NdbConfig.cpp b/ndb/test/src/NdbConfig.cpp
index d61b74cf62b..3a254bc1577 100644
--- a/ndb/test/src/NdbConfig.cpp
+++ b/ndb/test/src/NdbConfig.cpp
@@ -17,7 +17,6 @@
#include "NdbConfig.hpp"
#include <NdbOut.hpp>
#include <NDBT_Output.hpp>
-#include <assert.h>
#include <NdbConfig.h>
#include <ConfigRetriever.hpp>
#include <ndb_version.h>
@@ -32,7 +31,6 @@ NdbConfig::getPropsForNode(unsigned int node_id,
/**
* Fetch configuration from management server
*/
- char buf[255];
ConfigRetriever cr;
@@ -112,7 +110,6 @@ NdbConfig::getHostName(unsigned int node_id,
/**
* Fetch configuration from management server
*/
- char buf[255];
ConfigRetriever cr;
diff --git a/ndb/test/src/NdbGrep.cpp b/ndb/test/src/NdbGrep.cpp
index 747c62d5bc6..8b7442b0e77 100644
--- a/ndb/test/src/NdbGrep.cpp
+++ b/ndb/test/src/NdbGrep.cpp
@@ -18,7 +18,6 @@
#include <NdbGrep.hpp>
#include <NdbOut.hpp>
#include <NDBT_Output.hpp>
-#include <assert.h>
#include <NdbConfig.h>
#include <ConfigRetriever.hpp>
#include <ndb_version.h>
diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp
index 1df214572c7..cc2fab46cc5 100644
--- a/ndb/test/src/NdbRestarter.cpp
+++ b/ndb/test/src/NdbRestarter.cpp
@@ -24,7 +24,6 @@
#include <random.h>
#include <kernel/ndb_limits.h>
#include <ndb_version.h>
-#include <assert.h>
#define MGMERR(h) \
ndbout << "latest_error="<<ndb_mgm_get_latest_error(h) \
@@ -168,7 +167,7 @@ NdbRestarter::getRandomNotMasterNodeId(int rand){
if(master == -1)
return -1;
- int counter = 0;
+ Uint32 counter = 0;
rand = rand % ndbNodes.size();
while(counter++ < ndbNodes.size() && ndbNodes[rand].node_id == master)
rand = (rand + 1) % ndbNodes.size();
@@ -197,7 +196,7 @@ NdbRestarter::getRandomNodeOtherNodeGroup(int nodeId, int rand){
return -1;
}
- int counter = 0;
+ Uint32 counter = 0;
rand = rand % ndbNodes.size();
while(counter++ < ndbNodes.size() && ndbNodes[rand].node_group == node_group)
rand = (rand + 1) % ndbNodes.size();
diff --git a/ndb/test/tools/hugoCalculator/hugoCalculator.cpp b/ndb/test/tools/hugoCalculator/hugoCalculator.cpp
index 4cb801d3d73..7f2751be2ba 100644
--- a/ndb/test/tools/hugoCalculator/hugoCalculator.cpp
+++ b/ndb/test/tools/hugoCalculator/hugoCalculator.cpp
@@ -14,8 +14,10 @@
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 <NdbOut.hpp>
-#include <stdlib.h>
#include <NdbSleep.h>
#include <NDBT_Tables.hpp>
#include <getarg.h>
diff --git a/ndb/test/tools/hugoFill/hugoFill.cpp b/ndb/test/tools/hugoFill/hugoFill.cpp
index 748623cb253..dee6ce2e6c8 100644
--- a/ndb/test/tools/hugoFill/hugoFill.cpp
+++ b/ndb/test/tools/hugoFill/hugoFill.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp b/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp
index 90c08649ec2..e2c2cd13f00 100644
--- a/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp
+++ b/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp b/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp
index f77dc21bd0b..1855f19796f 100644
--- a/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp
+++ b/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/tools/hugoPkRead/hugoPkRead.cpp b/ndb/test/tools/hugoPkRead/hugoPkRead.cpp
index 2e9c2c35260..50351f08195 100644
--- a/ndb/test/tools/hugoPkRead/hugoPkRead.cpp
+++ b/ndb/test/tools/hugoPkRead/hugoPkRead.cpp
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp b/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp
index 6335c391bc3..ac17ffffee8 100644
--- a/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp
+++ b/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp
@@ -14,8 +14,9 @@
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 <NdbOut.hpp>
-#include <stdlib.h>
#include <NdbSleep.h>
#include <NDBT_Tables.hpp>
#include <getarg.h>
diff --git a/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp b/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp
index 141d01e3aee..e7edc3a991d 100644
--- a/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp
+++ b/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/tools/hugoScanRead/hugoScanRead.cpp b/ndb/test/tools/hugoScanRead/hugoScanRead.cpp
index 2376280d004..47ea8f4a8a7 100644
--- a/ndb/test/tools/hugoScanRead/hugoScanRead.cpp
+++ b/ndb/test/tools/hugoScanRead/hugoScanRead.cpp
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp b/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp
index 56cd3b8c969..3e2255ca0f3 100644
--- a/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp
+++ b/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/tools/restart/restart.cpp b/ndb/test/tools/restart/restart.cpp
index f391aecabe1..88cfb231a72 100644
--- a/ndb/test/tools/restart/restart.cpp
+++ b/ndb/test/tools/restart/restart.cpp
@@ -15,7 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <string.h>
+#include <ndb_global.h>
+
#include <NdbMain.h>
#include <OutputStream.hpp>
#include <NdbOut.hpp>
@@ -24,8 +25,6 @@
#include <NdbRestarter.hpp>
#include <NDBT.hpp>
-#include <assert.h>
-#include <NdbStdio.h>
int main(int argc, const char** argv){
diff --git a/ndb/test/tools/waiter/waiter.cpp b/ndb/test/tools/waiter/waiter.cpp
index 14803fec71d..d57daff3aea 100644
--- a/ndb/test/tools/waiter/waiter.cpp
+++ b/ndb/test/tools/waiter/waiter.cpp
@@ -25,7 +25,6 @@
#include <NdbRestarter.hpp>
#include <NDBT.hpp>
-#include <assert.h>
int main(int argc, const char** argv){
diff --git a/ndb/tools/copy_tab/copy_tab.cpp b/ndb/tools/copy_tab/copy_tab.cpp
index 32cfb0b35ff..33ce8e01d9a 100644
--- a/ndb/tools/copy_tab/copy_tab.cpp
+++ b/ndb/tools/copy_tab/copy_tab.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/tools/cpcc/cpcc.cpp b/ndb/tools/cpcc/cpcc.cpp
index 5a826f250c0..e768d707bbc 100644
--- a/ndb/tools/cpcc/cpcc.cpp
+++ b/ndb/tools/cpcc/cpcc.cpp
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdarg.h>
+#include <ndb_global.h>
#include <getarg.h>
#include "CpcClient.hpp"
#include <NdbEnv.h>
@@ -116,7 +116,7 @@ public:
}
virtual bool evaluate(SimpleCpcClient* c,const SimpleCpcClient::Process & p){
- return p.m_id == id && c == host;
+ return p.m_id == (int)id && c == host;
}
};
diff --git a/ndb/tools/create_index/create_index.cpp b/ndb/tools/create_index/create_index.cpp
index 32da39a5208..dc9e6c606d6 100644
--- a/ndb/tools/create_index/create_index.cpp
+++ b/ndb/tools/create_index/create_index.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/tools/delete_all/delete_all.cpp b/ndb/tools/delete_all/delete_all.cpp
index e78ad4a2e1e..9cbba503e68 100644
--- a/ndb/tools/delete_all/delete_all.cpp
+++ b/ndb/tools/delete_all/delete_all.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/tools/drop_index/drop_index.cpp b/ndb/tools/drop_index/drop_index.cpp
index 146f01113b2..327f15741c9 100644
--- a/ndb/tools/drop_index/drop_index.cpp
+++ b/ndb/tools/drop_index/drop_index.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/tools/drop_tab/drop_tab.cpp b/ndb/tools/drop_tab/drop_tab.cpp
index 5946ada5956..70e5d85aabe 100644
--- a/ndb/tools/drop_tab/drop_tab.cpp
+++ b/ndb/tools/drop_tab/drop_tab.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/tools/list_tables/listTables.cpp b/ndb/tools/list_tables/listTables.cpp
index c14808050c6..41433862304 100644
--- a/ndb/tools/list_tables/listTables.cpp
+++ b/ndb/tools/list_tables/listTables.cpp
@@ -21,8 +21,9 @@
*
*/
-#include <stdarg.h>
+#include <ndb_global.h>
#include <getarg.h>
+
#include <NdbApi.hpp>
#include <NDBT.hpp>
diff --git a/ndb/tools/select_all/select_all.cpp b/ndb/tools/select_all/select_all.cpp
index 32e9d1c6872..34f63a095bb 100644
--- a/ndb/tools/select_all/select_all.cpp
+++ b/ndb/tools/select_all/select_all.cpp
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/tools/select_count/select_count.cpp b/ndb/tools/select_count/select_count.cpp
index 4d281b9bdd5..b1513ad4135 100644
--- a/ndb/tools/select_count/select_count.cpp
+++ b/ndb/tools/select_count/select_count.cpp
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/tools/transproxy/transproxy.cpp b/ndb/tools/transproxy/transproxy.cpp
index 4c1308e63e7..384a8a34f03 100644
--- a/ndb/tools/transproxy/transproxy.cpp
+++ b/ndb/tools/transproxy/transproxy.cpp
@@ -14,14 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdarg.h>
-#include <string.h>
-#include <stdio.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+#include <ndb_global.h>
#include <NdbTCP.h>
#include <NdbOut.hpp>
diff --git a/ndb/tools/verify_index/verify_index.cpp b/ndb/tools/verify_index/verify_index.cpp
index 324bb11cfe4..1295b657e9b 100644
--- a/ndb/tools/verify_index/verify_index.cpp
+++ b/ndb/tools/verify_index/verify_index.cpp
@@ -14,9 +14,8 @@
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 <NdbStdio.h>
-#include <stdlib.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/netware/BUILD/compile-netware-all b/netware/BUILD/compile-netware-all
index 6baff699e94..dbe64e8f97e 100755
--- a/netware/BUILD/compile-netware-all
+++ b/netware/BUILD/compile-netware-all
@@ -11,5 +11,5 @@ path=`dirname $0`
$path/compile-netware-src
$path/compile-netware-standard
$path/compile-netware-debug
-#$path/compile-netware-max
-#$path/compile-netware-max-debug
+$path/compile-netware-max
+$path/compile-netware-max-debug
diff --git a/netware/BUILD/compile-netware-standard b/netware/BUILD/compile-netware-standard
index 45f5021862c..a21ea16a445 100755
--- a/netware/BUILD/compile-netware-standard
+++ b/netware/BUILD/compile-netware-standard
@@ -14,6 +14,7 @@ suffix="standard"
extra_configs=" \
--with-innodb \
+ --enable-thread-safe-client \
"
. $path/compile-netware-END
diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv
index e4e6d509100..6f818b6f7a3 100755
--- a/netware/BUILD/mwenv
+++ b/netware/BUILD/mwenv
@@ -6,9 +6,9 @@
# the default is "F:/mydev"
export MYDEV="WINE_BUILD_DIR"
-export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV;$MYDEV/zlib-1.1.4""
-export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/zlib-1.1.4;$MYDEV/mysql-VERSION/netware/BUILD"
-export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a;knetware.imp"
+export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/fs64/headers;$MYDEV;$MYDEV/zlib-1.1.4"
+export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/fs64/imports;$MYDEV/zlib-1.1.4;$MYDEV/mysql-VERSION/netware/BUILD"
+export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a;neb.imp;zPublics.imp;knetware.imp"
export WINEPATH="$MYDEV/mw/bin"
diff --git a/netware/Makefile.am b/netware/Makefile.am
index 881dafe883e..1f0277ef20e 100644
--- a/netware/Makefile.am
+++ b/netware/Makefile.am
@@ -33,7 +33,8 @@ netware_build_files = client/mysql.def client/mysqladmin.def \
isam/isamlog.def isam/pack_isam.def \
libmysqld/libmysqld.def myisam/myisamchk.def \
myisam/myisamlog.def myisam/myisampack.def \
- sql/mysqld.def
+ sql/mysqld.def extra/mysql_waitpid.def \
+ extra/resolve_stack_dump.def myisam/myisam_ftdump.def
link_sources:
set -x; \
diff --git a/netware/init_db.sql b/netware/init_db.sql
index 063c1815eb1..52e08333a93 100644
--- a/netware/init_db.sql
+++ b/netware/init_db.sql
@@ -20,7 +20,7 @@ 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 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(60) 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)) 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';
diff --git a/netware/my_manage.c b/netware/my_manage.c
index 1c1e75990b4..f5aa3163431 100644
--- a/netware/my_manage.c
+++ b/netware/my_manage.c
@@ -180,7 +180,7 @@ int sleep_until_file_exists(char *pid_file)
Wait for the server on the given port to start.
******************************************************************************/
-int wait_for_server_start(char *bin_dir, char *user, char *password, int port)
+int wait_for_server_start(char *bin_dir, char *user, char *password, int port,char *tmp_dir)
{
arg_list_t al;
int err, i;
@@ -189,7 +189,7 @@ int wait_for_server_start(char *bin_dir, char *user, char *password, int port)
// mysqladmin file
snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir);
- snprintf(trash, PATH_MAX, "/tmp/trash.out");
+ snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir);
// args
init_args(&al);
@@ -283,7 +283,7 @@ int spawn(char *path, arg_list_t *al, int join, char *input,
******************************************************************************/
int stop_server(char *bin_dir, char *user, char *password, int port,
- char *pid_file)
+ char *pid_file,char *tmp_dir)
{
arg_list_t al;
int err, i, argc = 0;
@@ -292,7 +292,7 @@ int stop_server(char *bin_dir, char *user, char *password, int port,
// mysqladmin file
snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir);
- snprintf(trash, PATH_MAX, "/tmp/trash.out");
+ snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir);
// args
init_args(&al);
diff --git a/netware/my_manage.h b/netware/my_manage.h
index 4215ae59a25..480eefbe55a 100644
--- a/netware/my_manage.h
+++ b/netware/my_manage.h
@@ -97,11 +97,11 @@ void free_args(arg_list_t *);
int sleep_until_file_exists(char *);
int sleep_until_file_deleted(char *);
-int wait_for_server_start(char *, char *, char *, int);
+int wait_for_server_start(char *, char *, char *, int,char *);
int spawn(char *, arg_list_t *, int, char *, char *, char *);
-int stop_server(char *, char *, char *, int, char *);
+int stop_server(char *, char *, char *, int, char *,char *);
pid_t get_server_pid(char *);
void kill_server(pid_t pid);
diff --git a/netware/myisam_ftdump.def b/netware/myisam_ftdump.def
new file mode 100644
index 00000000000..259d6617445
--- /dev/null
+++ b/netware/myisam_ftdump.def
@@ -0,0 +1,12 @@
+#------------------------------------------------------------------------------
+# MySQL MyISAM Dump Tool
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+SCREENNAME "MySQL MyISAM Table Dump Tool"
+COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL MyISAM Table Dump Tool"
+VERSION 4, 0
+STACKSIZE 65536
+XDCDATA ../netware/mysql.xdc
+#DEBUG
+
diff --git a/netware/mysql_install_db.c b/netware/mysql_install_db.c
index b4060bfdb7e..355e18b819a 100644
--- a/netware/mysql_install_db.c
+++ b/netware/mysql_install_db.c
@@ -386,7 +386,8 @@ int main(int argc, char **argv)
if (!autoclose) setscreenmode(SCR_NO_MODE);
// header
- printf("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE);
+ printf("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE,
+ MACHINE_TYPE);
// create paths
create_paths();
diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c
index e1a07baca6c..06d5e5985c1 100644
--- a/netware/mysql_test_run.c
+++ b/netware/mysql_test_run.c
@@ -53,6 +53,7 @@
#define TEST_SKIP "[ skip ]"
#define TEST_FAIL "[ fail ]"
#define TEST_BAD "[ bad ]"
+#define TEST_IGNORE "[ignore]"
/******************************************************************************
@@ -69,7 +70,8 @@ int master_port = 9306;
int slave_port = 9307;
// comma delimited list of tests to skip or empty string
-char skip_test[PATH_MAX] = "";
+char skip_test[PATH_MAX] = " lowercase_table3 , system_mysql_db_fix ";
+char ignore_test[PATH_MAX] = "";
char bin_dir[PATH_MAX];
char mysql_test_dir[PATH_MAX];
@@ -107,6 +109,7 @@ int total_pass = 0;
int total_fail = 0;
int total_test = 0;
+int total_ignore = 0;
double total_time = 0;
int use_openssl = FALSE;
@@ -393,7 +396,7 @@ void start_master()
{
sleep_until_file_exists(master_pid);
- if ((err = wait_for_server_start(bin_dir, user, password, master_port)) == 0)
+ if ((err = wait_for_server_start(bin_dir, user, password, master_port,mysql_tmp_dir)) == 0)
{
master_running = TRUE;
}
@@ -582,7 +585,7 @@ void start_slave()
{
sleep_until_file_exists(slave_pid);
- if ((err = wait_for_server_start(bin_dir, user, password, slave_port)) == 0)
+ if ((err = wait_for_server_start(bin_dir, user, password, slave_port,mysql_tmp_dir)) == 0)
{
slave_running = TRUE;
}
@@ -633,7 +636,7 @@ void stop_slave()
if (!slave_running) return;
// stop
- if ((err = stop_server(bin_dir, user, password, slave_port, slave_pid)) == 0)
+ if ((err = stop_server(bin_dir, user, password, slave_port, slave_pid,mysql_tmp_dir)) == 0)
{
slave_running = FALSE;
}
@@ -657,7 +660,7 @@ void stop_master()
// running?
if (!master_running) return;
- if ((err = stop_server(bin_dir, user, password, master_port, master_pid)) == 0)
+ if ((err = stop_server(bin_dir, user, password, master_port, master_pid,mysql_tmp_dir)) == 0)
{
master_running = FALSE;
}
@@ -778,21 +781,31 @@ void run_test(char *test)
char temp[PATH_MAX];
char *rstr;
double elapsed = 0;
- int skip = FALSE;
+ int skip = FALSE, ignore=FALSE;
int restart = FALSE;
int flag = FALSE;
struct stat info;
// single test?
- if (!single_test)
+// if (!single_test)
{
// skip tests in the skip list
snprintf(temp, PATH_MAX, " %s ", test);
skip = (strindex(skip_test, temp) != NULL);
+ if( skip == FALSE )
+ ignore = (strindex(ignore_test, temp) != NULL);
}
- // skip test?
- if (!skip)
+ if(ignore)
+ {
+ // show test
+ log("%-46s ", test);
+
+ // ignore
+ rstr = TEST_IGNORE;
+ ++total_ignore;
+ }
+ else if (!skip) // skip test?
{
char test_file[PATH_MAX];
char master_opt_file[PATH_MAX];
@@ -1148,9 +1161,33 @@ void setup(char *file)
******************************************************************************/
int main(int argc, char **argv)
{
+ int is_ignore_list = 0;
// setup
setup(argv[0]);
+ /* The --ignore option is comma saperated list of test cases to skip and should
+ * be very first command line option to the test suite.
+ * The usage is now:
+ * mysql_test_run --ignore=test1,test2 test3 test4
+ * where test1 and test2 are test cases to ignore
+ * and test3 and test4 are test cases to run. */
+ if( argc >= 2 && !strnicmp(argv[1], "--ignore=", sizeof("--ignore=")-1) )
+ {
+ char *temp, *token;
+ temp=strdup(strchr(argv[1],'=') + 1);
+ for(token=strtok(temp, ","); token != NULL; token=strtok(NULL, ","))
+ {
+ if( strlen(ignore_test) + strlen(token) + 2 <= PATH_MAX-1 )
+ sprintf( ignore_test+strlen(ignore_test), " %s ", token);
+ else
+ {
+ free(temp);
+ die("ignore list too long.");
+ }
+ }
+ free(temp);
+ is_ignore_list = 1;
+ }
// header
log("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE);
@@ -1165,14 +1202,14 @@ int main(int argc, char **argv)
log(HEADER);
log(DASH);
- if (argc > 1)
+ if ( argc > 1 + is_ignore_list )
{
int i;
// single test
single_test = TRUE;
- for (i = 1; i < argc; i++)
+ for (i = 1 + is_ignore_list; i < argc; i++)
{
// run given test
run_test(argv[i]);
diff --git a/netware/mysql_waitpid.def b/netware/mysql_waitpid.def
new file mode 100644
index 00000000000..4d56d29c42f
--- /dev/null
+++ b/netware/mysql_waitpid.def
@@ -0,0 +1,12 @@
+#------------------------------------------------------------------------------
+# Wait for a Program to Terminate
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+#SCREENNAME "MySQL Tool - Wait for a Program to Terminate"
+COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Tool - Wait for a Program to Terminate"
+VERSION 4, 0
+STACKSIZE 65536
+XDCDATA ../netware/mysql.xdc
+#DEBUG
+
diff --git a/netware/resolve_stack_dump.def b/netware/resolve_stack_dump.def
new file mode 100644
index 00000000000..21fd177fbc7
--- /dev/null
+++ b/netware/resolve_stack_dump.def
@@ -0,0 +1,12 @@
+#------------------------------------------------------------------------------
+# Resolve Stack Dump
+#------------------------------------------------------------------------------
+MODULE libc.nlm
+#SCREENNAME "MySQL Stack Dump Resolve Tool"
+COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
+DESCRIPTION "MySQL Stack Dump Resolve Tool"
+VERSION 4, 0
+STACKSIZE 65536
+XDCDATA ../netware/mysql.xdc
+#DEBUG
+
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 0d36fa2affe..341726fd89b 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -87,25 +87,8 @@ do
fi
done
-# Non platform-specific doc files:
-DOC_FILES=" \
- COPYING README LICENSE.doc \
- Docs/mysqlbug.txt \
-";
-
-# Platform-specific doc files:
-if [ $BASE_SYSTEM = "netware" ] ; then
- DOC_FILES="$DOC_FILES \
- README.NW \
- ";
-# For all other platforms:
-else
- DOC_FILES="$DOC_FILES \
- Docs/INSTALL-BINARY MySQLEULA.txt \
- ";
-fi
-
-for i in $DOC_FILES
+for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \
+ MySQLEULA.txt LICENSE.doc README.NW
do
if [ -f $i ]
then
@@ -170,6 +153,7 @@ done
if [ $BASE_SYSTEM = "netware" ] ; then
$CP -r netware/*.pl $BASE/scripts
+ $CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl
fi
for i in \
@@ -186,7 +170,7 @@ do
fi
done
-# convert the libs to .lib for NetWare
+# convert the .a to .lib for NetWare
if [ $BASE_SYSTEM = "netware" ] ; then
for i in $BASE/lib/*.a
do
@@ -241,6 +225,7 @@ $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*
$CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r
if [ $BASE_SYSTEM != "netware" ] ; then
+ chmod a+x $BASE/bin/*
$CP scripts/* $BASE/bin
$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ \@pkgdatadir\@ ./support-files < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db
$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server
@@ -254,6 +239,16 @@ fi
rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh
+
+#
+# Remove system dependent files
+#
+if [ $BASE_SYSTEM = "netware" ] ; then
+ rm -f $BASE/MySQLEULA.txt
+else
+ rm -f $BASE/README.NW
+fi
+
# Make safe_mysqld a symlink to mysqld_safe for backwards portability
# To be removed in MySQL 4.1
if [ $BASE_SYSTEM != "netware" ] ; then
@@ -329,19 +324,7 @@ which_1 ()
exit 1
}
-cd $TMP
-
-if [ $BASE_SYSTEM = "netware" ] ; then
-
- #
- # Create a zip file for NetWare users
- #
-
- if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi
- zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME
- echo "$NEW_NAME.zip created"
-
-else
+if [ $BASE_SYSTEM != "netware" ] ; then
#
# Create the result tar file
@@ -354,6 +337,7 @@ else
fi
echo "Using $tar to create archive"
+ cd $TMP
OPT=cvf
if [ x$SILENT = x1 ] ; then
@@ -362,15 +346,25 @@ else
$tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME
cd $SOURCE
-
echo "Compressing archive"
+ rm -f $NEW_NAME.tar.gz
gzip -9 $NEW_NAME.tar
+ echo "Removing temporary directory"
+ rm -r -f $BASE
echo "$NEW_NAME.tar.gz created"
+else
-fi
+ #
+ # Create a zip file for NetWare users
+ #
-echo "Removing temporary directory"
-rm -r -f $BASE
+ cd $TMP
+ if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi
+ zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME
+ echo "Removing temporary directory"
+ rm -r -f $BASE
+ echo "$NEW_NAME.zip created"
+fi
diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh
index 57612ac8edc..68ba488f3d5 100755
--- a/scripts/make_win_src_distribution.sh
+++ b/scripts/make_win_src_distribution.sh
@@ -326,6 +326,10 @@ fi
if [ -f scripts/mysql_install_db ]; then
print_debug "Initializing the 'data' directory"
scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data
+ if test "$?" = 1
+ then
+ exit 1;
+ fi
fi
#
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 61d173aac05..abde6ecbe73 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -10,6 +10,8 @@
in_rpm=0
windows=0
defaults=""
+tmp_file=/tmp/mysql_install_db.$$
+
case "$1" in
--no-defaults|--defaults-file=*|--defaults-extra-file=*)
defaults="$1"; shift
@@ -212,9 +214,11 @@ then
then
echo "Fill help tables"
fi
- if ! (echo "use mysql;
- "
- cat $fill_help_tables) | eval "$mysqld_install_cmd_line"
+ echo "use mysql;" > $tmp_file
+ cat $tmp_file $fill_help_tables | eval "$mysqld_install_cmd_line"
+ res=$?
+ rm $tmp_file
+ if test $res != 0
then
echo ""
echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!"
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index ab06215c3ac..6388855eaa6 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -7,6 +7,7 @@ use File::Basename;
use File::Path;
use DBI;
use Sys::Hostname;
+use File::Copy;
=head1 NAME
@@ -230,6 +231,10 @@ elsif (defined($tgt_name) && ($tgt_name =~ m:/: || $tgt_name eq '.')) {
elsif ( $opt{suffix} ) {
print "Using copy suffix '$opt{suffix}'\n" unless $opt{quiet};
}
+elsif ( ($^O =~ m/^(NetWare)$/) && defined($tgt_name) && ($tgt_name =~ m:\\: || $tgt_name eq '.'))
+{
+ $tgt_dirname = $tgt_name;
+}
else
{
$tgt_name="" if (!defined($tgt_name));
@@ -421,8 +426,11 @@ foreach my $rdb ( @db_desc ) {
else {
mkdir($tgt_dirpath, 0750) or die "Can't create '$tgt_dirpath': $!\n"
unless -d $tgt_dirpath;
+ if ($^O !~ m/^(NetWare)$/)
+ {
my @f_info= stat "$datadir/$rdb->{src}";
chown $f_info[4], $f_info[5], $tgt_dirpath;
+ }
}
}
}
@@ -578,7 +586,15 @@ sub copy_files {
my @cmd;
print "Copying ".@$files." files...\n" unless $opt{quiet};
- if ($method =~ /^s?cp\b/) { # cp or scp with optional flags
+ if ($^O =~ m/^(NetWare)$/) # on NetWare call PERL copy (slower)
+ {
+ foreach my $file ( @$files )
+ {
+ copy($file, $target."/".basename($file));
+ }
+ }
+ elsif ($method =~ /^s?cp\b/) # cp or scp with optional flags
+ {
my $cp = $method;
# add option to preserve mod time etc of copied files
# not critical, but nice to have
@@ -717,7 +733,7 @@ sub retire_directory {
if ( -d $tgt_oldpath ) {
print "Deleting previous 'old' hotcopy directory ('$tgt_oldpath')\n" unless $opt{quiet};
- rmtree([$tgt_oldpath])
+ rmtree([$tgt_oldpath],0,1);
}
rename($dir, $tgt_oldpath)
or die "Can't rename $dir=>$tgt_oldpath: $!\n";
diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh
index be24e015553..8ec62442b11 100644
--- a/sql-bench/crash-me.sh
+++ b/sql-bench/crash-me.sh
@@ -414,8 +414,7 @@ if ($dbh->do("create table crash_q (a integer, b integer,c1 CHAR(10))") &&
["with add primary key",
"alter table crash_q1 add primary key(c1)"]);
report("Alter table add foreign key",'alter_add_foreign_key',
- "alter table crash_q add constraint f1 foreign key(c1)",
- " references crash_q1(c1)");
+ "alter table crash_q add constraint f1 foreign key(c1) references crash_q1(c1)");
try_and_report("Alter table drop foreign key",'alter_drop_foreign_key',
["with drop constraint",
"alter table crash_q drop constraint f1"],
diff --git a/sql-bench/limits/mysql-4.0.cfg b/sql-bench/limits/mysql-4.0.cfg
index feaa79e43e9..35bdc9fa842 100644
--- a/sql-bench/limits/mysql-4.0.cfg
+++ b/sql-bench/limits/mysql-4.0.cfg
@@ -13,6 +13,8 @@ NEG=yes # update of column= -column
###As far as all queries returned OK, result is YES
Need_cast_for_null=no # Need to cast NULL for arithmetic
### Check if numeric_null (NULL) is 'NULL'
+ ### Check if numeric_null (NULL) is 'NULL'
+ ### Check if numeric_null (NULL) is 'NULL'
alter_add_col=yes # Alter table add column
###< alter table crash_q add d integer
###> OK
@@ -187,6 +189,22 @@ constraint_check=syntax only # Column constraints
###
###< drop table crash_q
###> OK
+ ###< create table crash_q (a int check (a>0))
+ ###> OK
+ ###
+ ###< insert into crash_q values(0)
+ ###> OK
+ ###
+ ###< drop table crash_q
+ ###> OK
+ ###< create table crash_q (a int check (a>0))
+ ###> OK
+ ###
+ ###< insert into crash_q values(0)
+ ###> OK
+ ###
+ ###< drop table crash_q
+ ###> OK
constraint_check_named=syntax only # Named constraints
###< create table crash_q (a int ,b int, constraint abc check (a>b))
###> OK
@@ -196,6 +214,22 @@ constraint_check_named=syntax only # Named constraints
###
###< drop table crash_q
###> OK
+ ###< create table crash_q (a int ,b int, constraint abc check (a>b))
+ ###> OK
+ ###
+ ###< insert into crash_q values(0,0)
+ ###> OK
+ ###
+ ###< drop table crash_q
+ ###> OK
+ ###< create table crash_q (a int ,b int, constraint abc check (a>b))
+ ###> OK
+ ###
+ ###< insert into crash_q values(0,0)
+ ###> OK
+ ###
+ ###< drop table crash_q
+ ###> OK
constraint_check_table=syntax only # Table constraints
###< create table crash_q (a int ,b int, check (a>b))
###> OK
@@ -205,6 +239,22 @@ constraint_check_table=syntax only # Table constraints
###
###< drop table crash_q
###> OK
+ ###< create table crash_q (a int ,b int, check (a>b))
+ ###> OK
+ ###
+ ###< insert into crash_q values(0,0)
+ ###> OK
+ ###
+ ###< drop table crash_q
+ ###> OK
+ ###< create table crash_q (a int ,b int, check (a>b))
+ ###> OK
+ ###
+ ###< insert into crash_q values(0,0)
+ ###> OK
+ ###
+ ###< drop table crash_q
+ ###> OK
constraint_null=yes # NULL constraint (SyBase style)
###< create table crash_q (a int null)
###> OK
@@ -348,6 +398,20 @@ date_format_inresult=iso # Date format in result
###> 2003-08-27
###< delete from crash_me_d
###> OK
+ ###< insert into crash_me_d values( sysdate() )
+ ###> OK
+ ###
+ ###< select a from crash_me_d
+ ###> 2004-05-20
+ ###< delete from crash_me_d
+ ###> OK
+ ###< insert into crash_me_d values( sysdate() )
+ ###> OK
+ ###
+ ###< select a from crash_me_d
+ ###> 2004-05-20
+ ###< delete from crash_me_d
+ ###> OK
date_infinity=error # Supports 'infinity dates
###< create table crash_me2 (a date not null)
###> OK
@@ -460,6 +524,14 @@ drop_requires_cascade=no # drop table require cascade/restrict
###> OK
###< drop table crash_me
###> OK
+ ###< create table crash_me (a integer not null)
+ ###> OK
+ ###< drop table crash_me
+ ###> OK
+ ###< create table crash_me (a integer not null)
+ ###> OK
+ ###< drop table crash_me
+ ###> OK
drop_restrict=yes # drop table with cascade/restrict
###< create table crash_q (a int)
###> OK
@@ -524,6 +596,40 @@ foreign_key=syntax only # foreign keys
###
###< drop table crash_me_qf
###> OK
+ ###< create table crash_me_qf (a integer not null,primary key (a))
+ ###> OK
+ ###
+ ###< create table crash_me_qf2 (a integer not null,foreign key (a) references crash_me_qf (a))
+ ###> OK
+ ###
+ ###< insert into crash_me_qf values (1)
+ ###> OK
+ ###
+ ###< insert into crash_me_qf2 values (2)
+ ###> OK
+ ###
+ ###< drop table crash_me_qf2
+ ###> OK
+ ###
+ ###< drop table crash_me_qf
+ ###> OK
+ ###< create table crash_me_qf (a integer not null,primary key (a))
+ ###> OK
+ ###
+ ###< create table crash_me_qf2 (a integer not null,foreign key (a) references crash_me_qf (a))
+ ###> OK
+ ###
+ ###< insert into crash_me_qf values (1)
+ ###> OK
+ ###
+ ###< insert into crash_me_qf2 values (2)
+ ###> OK
+ ###
+ ###< drop table crash_me_qf2
+ ###> OK
+ ###
+ ###< drop table crash_me_qf
+ ###> OK
full_outer_join=no # full outer join
###< select crash_me.a from crash_me full join crash_me2 ON
### crash_me.a=crash_me2.a
@@ -856,6 +962,10 @@ func_extra_months_between=no # Function MONTHS_BETWEEN
func_extra_noround=no # Function NOROUND
###< select noround(22.6)
###> execute error: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 '(22.6)' at line 1
+ ###< select noround(22.6)
+ ###> execute error: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 '(22.6)' at line 1
+ ###< select noround(22.6)
+ ###> execute error: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 '(22.6)' at line 1
func_extra_not=yes # Function NOT in SELECT
###
###<select not 0
@@ -1150,21 +1260,29 @@ func_odbc_dayname=yes # Function DAYNAME
###
###<select dayname(a) from crash_me_d
###>Saturday
+ ###< insert into crash_me_d values('1997-02-01')
+ ###< insert into crash_me_d values('1997-02-01')
func_odbc_dayofmonth=yes # Function DAYOFMONTH
###< insert into crash_me_d values('1997-02-01')
###
###<select dayofmonth(a) from crash_me_d
###>1
+ ###< insert into crash_me_d values('1997-02-01')
+ ###< insert into crash_me_d values('1997-02-01')
func_odbc_dayofweek=yes # Function DAYOFWEEK
###< insert into crash_me_d values('1997-02-01')
###
###<select dayofweek(a) from crash_me_d
###>7
+ ###< insert into crash_me_d values('1997-02-01')
+ ###< insert into crash_me_d values('1997-02-01')
func_odbc_dayofyear=yes # Function DAYOFYEAR
###< insert into crash_me_d values('1997-02-01')
###
###<select dayofyear(a) from crash_me_d
###>32
+ ###< insert into crash_me_d values('1997-02-01')
+ ###< insert into crash_me_d values('1997-02-01')
func_odbc_degrees=yes # Function DEGREES
###
###<select degrees(6.283185)
@@ -1193,11 +1311,15 @@ func_odbc_hour=yes # Function HOUR
###
###<select hour('12:13:14')
###>12
+ ###< insert into crash_me_t values(20:08:16)
+ ###< insert into crash_me_t values(20:08:16)
func_odbc_hour_time=yes # Function ANSI HOUR
###< insert into crash_me_t values(20:08:16)
###
###<select hour(TIME '12:13:14')
###>12
+ ###< insert into crash_me_t values(20:08:16)
+ ###< insert into crash_me_t values(20:08:16)
func_odbc_ifnull=yes # Function IFNULL
###
###<select ifnull(2,3)
@@ -1252,6 +1374,8 @@ func_odbc_minute=yes # Function MINUTE
###
###<select minute('12:13:14')
###>13
+ ###< insert into crash_me_t values(20:08:16)
+ ###< insert into crash_me_t values(20:08:16)
func_odbc_mod=yes # Function MOD
###
###<select mod(11,7)
@@ -1261,11 +1385,15 @@ func_odbc_month=yes # Function MONTH
###
###<select month(a) from crash_me_d
###>2
+ ###< insert into crash_me_d values('1997-02-01')
+ ###< insert into crash_me_d values('1997-02-01')
func_odbc_monthname=yes # Function MONTHNAME
###< insert into crash_me_d values('1997-02-01')
###
###<select monthname(a) from crash_me_d
###>February
+ ###< insert into crash_me_d values('1997-02-01')
+ ###< insert into crash_me_d values('1997-02-01')
func_odbc_now=yes # Function NOW
###
###<select now()
@@ -1283,6 +1411,8 @@ func_odbc_quarter=yes # Function QUARTER
###
###<select quarter(a) from crash_me_d
###>1
+ ###< insert into crash_me_d values('1997-02-01')
+ ###< insert into crash_me_d values('1997-02-01')
func_odbc_radians=yes # Function RADIANS
###
###<select radians(360)
@@ -1316,6 +1446,8 @@ func_odbc_second=yes # Function SECOND
###
###<select second('12:13:14')
###>14
+ ###< insert into crash_me_t values(20:08:16)
+ ###< insert into crash_me_t values(20:08:16)
func_odbc_sign=yes # Function SIGN
###
###<select sign(-5)
@@ -1374,11 +1506,19 @@ func_odbc_week=USA # WEEK
###<select week('1997-02-01')
###>4
###We expected '5' but got '4'
+ ###<select week('1997-02-01')
+ ###>4
+ ###We expected '5' but got '4'
+ ###<select week('1997-02-01')
+ ###>4
+ ###We expected '5' but got '4'
func_odbc_year=yes # Function YEAR
###< insert into crash_me_d values('1997-02-01')
###
###<select year(a) from crash_me_d
###>1997
+ ###< insert into crash_me_d values('1997-02-01')
+ ###< insert into crash_me_d values('1997-02-01')
func_sql_+=yes # Function +, -, * and /
###
###<select 5*3-4/2+1
@@ -1431,6 +1571,13 @@ func_sql_current_user=with_parenthesis # CURRENT_USER
###
###< select CURRENT_USER()
###> OK
+ ###< select CURRENT_USER
+ ###> OK
+ ###< select CURRENT_USER
+ ###> execute error:Unknown column 'CURRENT_USER' in 'field list'
+ ###
+ ###< select CURRENT_USER()
+ ###> OK
func_sql_extract_sql=yes # Function EXTRACT
###
###<select extract(minute from timestamp '2000-02-23 18:43:12.987')
@@ -1473,6 +1620,16 @@ func_sql_session_user=with_parenthesis # SESSION_USER
###
###< select SESSION_USER()
###> OK
+ ###< select SESSION_USER
+ ###> execute error:Unknown column 'SESSION_USER' in 'field list'
+ ###
+ ###< select SESSION_USER()
+ ###> OK
+ ###< select SESSION_USER
+ ###> execute error:Unknown column 'SESSION_USER' in 'field list'
+ ###
+ ###< select SESSION_USER()
+ ###> OK
func_sql_simple_case=yes # Function simple CASE
###
###<select case 2 when 1 then 'false' when 2 then 'true' end
@@ -1487,6 +1644,16 @@ func_sql_system_user=with_parenthesis # SYSTEM_USER
###
###< select SYSTEM_USER()
###> OK
+ ###< select SYSTEM_USER
+ ###> execute error:Unknown column 'SYSTEM_USER' in 'field list'
+ ###
+ ###< select SYSTEM_USER()
+ ###> OK
+ ###< select SYSTEM_USER
+ ###> execute error:Unknown column 'SYSTEM_USER' in 'field list'
+ ###
+ ###< select SYSTEM_USER()
+ ###> OK
func_sql_trim=yes # Function TRIM
###
###<select trim(trailing from trim(LEADING FROM ' abc '))
@@ -1501,6 +1668,16 @@ func_sql_user=with_parenthesis # USER
###
###< select USER()
###> OK
+ ###< select USER
+ ###> execute error:Unknown column 'USER' in 'field list'
+ ###
+ ###< select USER()
+ ###> OK
+ ###< select USER
+ ###> execute error:Unknown column 'USER' in 'field list'
+ ###
+ ###< select USER()
+ ###> OK
func_where_between=yes # Function BETWEEN
###
###<select a from crash_me where 5 between 4 and 6
@@ -1693,6 +1870,10 @@ group_on_unused=yes # Group on unused column
has_true_false=no # TRUE and FALSE
###< select (1=1)=true
###> execute error:Unknown column 'true' in 'field list'
+ ###< select (1=1)=true
+ ###> OK
+ ###< select (1=1)=true
+ ###> execute error:Unknown column 'true' in 'field list'
having=yes # Having
###<select a from crash_me group by a having a > 0
###>1
@@ -1918,6 +2099,8 @@ max_expressions=1450 # simple expressions
### 5000:FAIL 1000:OK 3000:FAIL 1400:OK 2200:FAIL 1560:FAIL 1432:OK 1496:FAIL 1445:OK 1470:FAIL 1450:OK 1460:FAIL 1452:FAIL 1451:FAIL
max_index=32 # max index
### max_unique_index=32 ,so max_index must be same
+ ### max_unique_index=32 ,so max_index must be same
+ ### max_unique_index=32 ,so max_index must be same
max_index_length=500 # index length
###We are trying (example with N=5):
###create table crash_q (q0 char(5) not null,unique (q0))
@@ -2070,6 +2253,14 @@ no_primary_key=yes # Tables without primary key
###> OK
###< insert into crash_me (a,b) values (1,'a')
###> OK
+ ###< create table crash_me (a integer not null,b char(10) not null)
+ ###> OK
+ ###< insert into crash_me (a,b) values (1,'a')
+ ###> OK
+ ###< create table crash_me (a integer not null,b char(10) not null)
+ ###> OK
+ ###< insert into crash_me (a,b) values (1,'a')
+ ###> OK
not_id_between=no # NOT ID BETWEEN interprets as ID NOT BETWEEN
###< create table crash_me_b (i int)
###> OK
@@ -2083,6 +2274,30 @@ not_id_between=no # NOT ID BETWEEN interprets as ID NOT BETWEEN
###
###< drop table crash_me_b
###> OK
+ ###< create table crash_me_b (i int)
+ ###> OK
+ ###< insert into crash_me_b values(2)
+ ###> OK
+ ###< insert into crash_me_b values(5)
+ ###> OK
+ ###
+ ###<select i from crash_me_b where not i between 1 and 3
+ ###> didn't return any result:
+ ###
+ ###< drop table crash_me_b
+ ###> OK
+ ###< create table crash_me_b (i int)
+ ###> OK
+ ###< insert into crash_me_b values(2)
+ ###> OK
+ ###< insert into crash_me_b values(5)
+ ###> OK
+ ###
+ ###<select i from crash_me_b where not i between 1 and 3
+ ###> didn't return any result:
+ ###
+ ###< drop table crash_me_b
+ ###> OK
null_concat_expr=yes # Is concat('a',NULL) = NULL
###
###<select concat('a',NULL)
@@ -2173,6 +2388,26 @@ position_of_null=first # Where is null values in sorted recordset
###> 2
###> 3
###> 4
+ ###< insert into crash_me_n (i) values(1)
+ ###> OK
+ ###< insert into crash_me_n values(2,2)
+ ###> OK
+ ###< insert into crash_me_n values(3,3)
+ ###> OK
+ ###< insert into crash_me_n values(4,4)
+ ###> OK
+ ###< insert into crash_me_n (i) values(5)
+ ###> OK
+ ###< insert into crash_me_n (i) values(1)
+ ###> OK
+ ###< insert into crash_me_n values(2,2)
+ ###> OK
+ ###< insert into crash_me_n values(3,3)
+ ###> OK
+ ###< insert into crash_me_n values(4,4)
+ ###> OK
+ ###< insert into crash_me_n (i) values(5)
+ ###> OK
position_of_null_desc=last # Where is null values in sorted recordset (DESC)
###< select r from crash_me_n order by r desc
###> 4
@@ -6053,7 +6288,7 @@ select_without_from=yes # SELECT without FROM
###> OK
###
###As far as all queries returned OK, result is YES
-server_version=MySQL 4.0.15 debug log/ # server version
+server_version=MySQL 4.0.20 debug/ # server version
simple_joins=yes # ANSI SQL simple joins
###< select crash_me.a from crash_me, crash_me t0
###> OK
@@ -6223,6 +6458,20 @@ time_format_inresult=iso # Time format in result
###> 19:55:21
###< delete from crash_me_t
###> OK
+ ###< insert into crash_me_t values(CURRENT_TIME)
+ ###> OK
+ ###
+ ###< select a from crash_me_t
+ ###> 13:45:04
+ ###< delete from crash_me_t
+ ###> OK
+ ###< insert into crash_me_t values(CURRENT_TIME)
+ ###> OK
+ ###
+ ###< select a from crash_me_t
+ ###> 13:47:18
+ ###< delete from crash_me_t
+ ###> OK
transactions=yes # transactions
###<select * from crash_q
###>1
diff --git a/sql/Makefile.am b/sql/Makefile.am
index 1d6d424a274..828456c4510 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -49,7 +49,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
mysql_priv.h item_geofunc.h sql_bitmap.h \
procedure.h sql_class.h sql_lex.h sql_list.h \
sql_manager.h sql_map.h sql_string.h unireg.h \
- field.h handler.h \
+ field.h handler.h mysqld_suffix.h \
ha_isammrg.h ha_isam.h ha_myisammrg.h\
ha_heap.h ha_myisam.h ha_berkeley.h ha_innodb.h \
ha_ndbcluster.h opt_range.h protocol.h \
@@ -88,7 +88,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \
sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
slave.cc sql_repl.cc sql_union.cc sql_derived.cc \
client.c sql_client.cc mini_client_errors.c pack.c\
- stacktrace.c repl_failsafe.h repl_failsafe.cc sql_olap.cc\
+ stacktrace.c repl_failsafe.h repl_failsafe.cc \
gstream.cc spatial.cc sql_help.cc protocol_cursor.cc \
examples/ha_example.cc \
sp_head.cc sp_pcontext.cc sp_rcontext.cc sp.cc \
diff --git a/sql/discover.cc b/sql/discover.cc
index e260f44a8db..696be193148 100644
--- a/sql/discover.cc
+++ b/sql/discover.cc
@@ -159,7 +159,6 @@ int create_table_from_handler(const char *db,
error = writefrm(path, frmblob, frmlen);
}
- err:
if (frmblob)
my_free((char*) frmblob,MYF(0));
DBUG_RETURN(error);
diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc
index e2463761e67..2d17caf1a83 100644
--- a/sql/examples/ha_example.cc
+++ b/sql/examples/ha_example.cc
@@ -14,6 +14,55 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+/*
+ ha_example is a stubbed storage engine. It does nothing at this point. It
+ will let you create/open/delete tables but that is all. You can enable it
+ in your buld by doing the following during your build process:
+ ./configure --with-example-storage-engine
+
+ Once this is done mysql will let you create tables with:
+ CREATE TABLE A (...) ENGINE=EXAMPLE;
+
+ The example is setup to use table locks. It implements an example "SHARE"
+ that is inserted into a hash by table name. You can use this to store
+ information of state that any example handler object will be able to see
+ if it is using the same table.
+
+ Please read the object definition in ha_example.h before reading the rest
+ if this file.
+
+ To get an idea of what occurs here is an example select that would do a
+ scan of an entire table:
+ ha_example::store_lock
+ ha_example::external_lock
+ ha_example::info
+ ha_example::rnd_init
+ ha_example::extra
+ ENUM HA_EXTRA_CACHE Cash record in HA_rrnd()
+ ha_example::rnd_next
+ ha_example::rnd_next
+ ha_example::rnd_next
+ ha_example::rnd_next
+ ha_example::rnd_next
+ ha_example::rnd_next
+ ha_example::rnd_next
+ ha_example::rnd_next
+ ha_example::rnd_next
+ ha_example::extra
+ ENUM HA_EXTRA_NO_CACHE End cacheing of records (def)
+ ha_example::external_lock
+ ha_example::extra
+ ENUM HA_EXTRA_RESET Reset database to after open
+
+ In the above example has 9 row called before rnd_next signalled that it was
+ at the end of its data. In the above example the table was already opened
+ (or you would have seen a call to ha_example::open(). Calls to
+ ha_example::extra() are hints as to what will be occuring to the request.
+
+ Happy coding!
+ -Brian
+*/
+
#ifdef __GNUC__
#pragma implementation // gcc: Class implementation
#endif
@@ -24,10 +73,14 @@
#include "ha_example.h"
/* Variables for example share methods */
-pthread_mutex_t example_mutex;
-static HASH example_open_tables;
-static int example_init= 0;
+static HASH example_open_tables; // Hash used to track open tables
+pthread_mutex_t example_mutex; // This is the mutex we use to init the hash
+static int example_init= 0; // Variable for checking the init state of hash
+
+/*
+ Function we use in the creation of our hash to get key.
+*/
static byte* example_get_key(EXAMPLE_SHARE *share,uint *length,
my_bool not_used __attribute__((unused)))
{
@@ -37,7 +90,9 @@ static byte* example_get_key(EXAMPLE_SHARE *share,uint *length,
/*
- Example of simple lock controls.
+ Example of simple lock controls. The "share" it creates is structure we will
+ pass to each example handler. Do you have to have one of these? Well, you have
+ pieces that are used for locking, and they are needed to function.
*/
static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table)
{
@@ -45,6 +100,12 @@ static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table)
uint length;
char *tmp_name;
+ /*
+ So why does this exist? There is no way currently to init a storage engine.
+ Innodb and BDB both have modifications to the server to allow them to
+ do this. Since you will not want to do this, this is probably the next
+ best method.
+ */
if (!example_init)
{
/* Hijack a mutex for init'ing the storage engine */
@@ -101,7 +162,8 @@ error:
/*
- Free lock controls.
+ Free lock controls. We call this whenever we close a table. If the table had
+ the last reference to the share then we free memory associated with it.
*/
static int free_share(EXAMPLE_SHARE *share)
{
@@ -119,10 +181,24 @@ static int free_share(EXAMPLE_SHARE *share)
}
+/*
+ If frm_error() is called then we will use this to to find out what file extentions
+ exist for the storage engine. This is also used by the default rename_table and
+ delete_table method in handler.cc.
+*/
const char **ha_example::bas_ext() const
{ static const char *ext[]= { NullS }; return ext; }
+/*
+ Used for opening tables. The name will be the name of the file.
+ A table is opened when it needs to be opened. For instance
+ when a request comes in for a select on the table (tables are not
+ open and closed for each request, they are cached).
+
+ Called from handler.cc by handler::ha_open(). The server opens all tables by
+ calling ha_open() which then calls the handler specific open().
+*/
int ha_example::open(const char *name, int mode, uint test_if_locked)
{
DBUG_ENTER("ha_example::open");
@@ -134,18 +210,66 @@ int ha_example::open(const char *name, int mode, uint test_if_locked)
DBUG_RETURN(0);
}
+
+/*
+ Closes a table. We call the free_share() function to free any resources
+ that we have allocated in the "shared" structure.
+
+ Called from sql_base.cc, sql_select.cc, and table.cc.
+ In sql_select.cc it is only used to close up temporary tables or during
+ the process where a temporary table is converted over to being a
+ myisam table.
+ For sql_base.cc look at close_data_tables().
+*/
int ha_example::close(void)
{
DBUG_ENTER("ha_example::close");
DBUG_RETURN(free_share(share));
}
+
+/*
+ write_row() inserts a row. No extra() hint is given currently if a bulk load
+ is happeneding. buf() is a byte array of data. You can use the field
+ information to extract the data from the native byte array type.
+ Example of this would be:
+ for (Field **field=table->field ; *field ; field++)
+ {
+ ...
+ }
+
+ See ha_tina.cc for an example of extracting all of the data as strings.
+ ha_berekly.cc has an example of how to store it intact by "packing" it
+ for ha_berkeley's own native storage type.
+
+ See the note for update_row() on auto_increments and timestamps. This
+ case also applied to write_row().
+
+ Called from item_sum.cc, item_sum.cc, sql_acl.cc, sql_insert.cc,
+ sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc, and sql_update.cc.
+*/
int ha_example::write_row(byte * buf)
{
DBUG_ENTER("ha_example::write_row");
DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED);
}
+
+/*
+ Yes, update_row() does what you expect, it updates a row. old_data will have
+ the previous row record in it, while new_data will have the newest data in
+ it.
+ Keep in mind that the server can do updates based on ordering if an ORDER BY
+ clause was used. Consecutive ordering is not guarenteed.
+ Currently new_data will not have an updated auto_increament record, or
+ and updated timestamp field. You can do these for example by doing these:
+ if (table->timestamp_on_update_now)
+ update_timestamp(new_row+table->timestamp_on_update_now-1);
+ if (table->next_number_field && record == table->record[0])
+ update_auto_increment();
+
+ Called from sql_select.cc, sql_acl.cc, sql_update.cc, and sql_insert.cc.
+*/
int ha_example::update_row(const byte * old_data, byte * new_data)
{
@@ -153,12 +277,32 @@ int ha_example::update_row(const byte * old_data, byte * new_data)
DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED);
}
+
+/*
+ This will delete a row. buf will contain a copy of the row to be deleted.
+ The server will call this right after the current row has been called (from
+ either a previous rnd_nexT() or index call).
+ If you keep a pointer to the last row or can access a primary key it will
+ make doing the deletion quite a bit easier.
+ Keep in mind that the server does no guarentee consecutive deletions. ORDER BY
+ clauses can be used.
+
+ Called in sql_acl.cc and sql_udf.cc to manage internal table information.
+ Called in sql_delete.cc, sql_insert.cc, and sql_select.cc. In sql_select it is
+ used for removing duplicates while in insert it is used for REPLACE calls.
+*/
int ha_example::delete_row(const byte * buf)
{
DBUG_ENTER("ha_example::delete_row");
DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED);
}
+
+/*
+ Positions an index cursor to the index specified in the handle. Fetches the
+ row if available. If the key value is null, begin at the first key of the
+ index.
+*/
int ha_example::index_read(byte * buf, const byte * key,
uint key_len __attribute__((unused)),
enum ha_rkey_function find_flag
@@ -168,6 +312,11 @@ int ha_example::index_read(byte * buf, const byte * key,
DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED);
}
+
+/*
+ Positions an index cursor to the index specified in key. Fetches the
+ row if any. This is only used to read whole keys.
+*/
int ha_example::index_read_idx(byte * buf, uint index, const byte * key,
uint key_len __attribute__((unused)),
enum ha_rkey_function find_flag
@@ -178,66 +327,187 @@ int ha_example::index_read_idx(byte * buf, uint index, const byte * key,
}
+/*
+ Used to read forward through the index.
+*/
int ha_example::index_next(byte * buf)
{
DBUG_ENTER("ha_example::index_next");
DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED);
}
+
+/*
+ Used to read backwards through the index.
+*/
int ha_example::index_prev(byte * buf)
{
DBUG_ENTER("ha_example::index_prev");
DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED);
}
+
+/*
+ index_first() asks for the first key in the index.
+
+ Called from opt_range.cc, opt_sum.cc, sql_handler.cc,
+ and sql_select.cc.
+*/
int ha_example::index_first(byte * buf)
{
DBUG_ENTER("ha_example::index_first");
DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED);
}
+
+/*
+ index_last() asks for the last key in the index.
+
+ Called from opt_range.cc, opt_sum.cc, sql_handler.cc,
+ and sql_select.cc.
+*/
int ha_example::index_last(byte * buf)
{
DBUG_ENTER("ha_example::index_last");
DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED);
}
+
+/*
+ rnd_init() is called when the system wants the storage engine to do a table
+ scan.
+ See the example in the introduction at the top of this file to see when
+ rnd_init() is called.
+
+ Called from filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc,
+ and sql_update.cc.
+*/
int ha_example::rnd_init(bool scan)
{
DBUG_ENTER("ha_example::rnd_init");
DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED);
}
+
+/*
+ This is called for each row of the table scan. When you run out of records
+ you should return HA_ERR_END_OF_FILE. Fill buff up with the row information.
+ The Field structure for the table is the key to getting data into buf
+ in a manner that will allow the server to understand it.
+
+ Called from filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc,
+ and sql_update.cc.
+*/
int ha_example::rnd_next(byte *buf)
{
DBUG_ENTER("ha_example::rnd_next");
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
+
+/*
+ position() is called after each call to rnd_next() if the data needs
+ to be ordered. You can do something like the following to store
+ the position:
+ ha_store_ptr(ref, ref_length, current_position);
+
+ The server uses ref to store data. ref_length in the above case is
+ the size needed to store current_position. ref is just a byte array
+ that the server will maintain. If you are using offsets to mark rows, then
+ current_position should be the offset. If it is a primary key like in
+ BDB, then it needs to be a primary key.
+
+ Called from filesort.cc, sql_select.cc, sql_delete.cc and sql_update.cc.
+*/
void ha_example::position(const byte *record)
{
DBUG_ENTER("ha_example::position");
DBUG_VOID_RETURN;
}
+
+/*
+ This is like rnd_next, but you are given a position to use
+ to determine the row. The position will be of the type that you stored in
+ ref. You can use ha_get_ptr(pos,ref_length) to retrieve whatever key
+ or position you saved when position() was called.
+ Called from filesort.cc records.cc sql_insert.cc sql_select.cc sql_update.cc.
+*/
int ha_example::rnd_pos(byte * buf, byte *pos)
{
DBUG_ENTER("ha_example::rnd_pos");
DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED);
}
+
+/*
+ ::info() is used to return information to the optimizer.
+ Currently this table handler doesn't implement most of the fields
+ really needed. SHOW also makes use of this data
+ Another note, you will probably want to have the following in your
+ code:
+ if (records < 2)
+ records = 2;
+ The reason is that the server will optimize for cases of only a single
+ record. If in a table scan you don't know the number of records
+ it will probably be better to set records to two so you can return
+ as many records as you need.
+ Along with records a few more variables you may wish to set are:
+ records
+ deleted
+ data_file_length
+ index_file_length
+ delete_length
+ check_time
+ Take a look at the public variables in handler.h for more information.
+
+ Called in:
+ filesort.cc
+ ha_heap.cc
+ item_sum.cc
+ opt_sum.cc
+ sql_delete.cc
+ sql_delete.cc
+ sql_derived.cc
+ sql_select.cc
+ sql_select.cc
+ sql_select.cc
+ sql_select.cc
+ sql_select.cc
+ sql_show.cc
+ sql_show.cc
+ sql_show.cc
+ sql_show.cc
+ sql_table.cc
+ sql_union.cc
+ sql_update.cc
+
+*/
void ha_example::info(uint flag)
{
DBUG_ENTER("ha_example::info");
DBUG_VOID_RETURN;
}
+
+/*
+ extra() is called whenever the server wishes to send a hint to
+ the storage engine. The myisam engine implements the most hints.
+ ha_innodb.cc has the most exhaustive list of these hints.
+*/
int ha_example::extra(enum ha_extra_function operation)
{
DBUG_ENTER("ha_example::extra");
DBUG_RETURN(0);
}
+
+/*
+ Deprecated and likely to be removed in the future. Storage engines normally
+ just make a call like:
+ ha_example::extra(HA_EXTRA_RESET);
+ to handle it.
+*/
int ha_example::reset(void)
{
DBUG_ENTER("ha_example::reset");
@@ -245,18 +515,71 @@ int ha_example::reset(void)
}
+/*
+ Used to delete all rows in a table. Both for cases of truncate and
+ for cases where the optimizer realizes that all rows will be
+ removed as a result of a SQL statement.
+
+ Called from item_sum.cc by Item_func_group_concat::clear(),
+ Item_sum_count_distinct::clear(), and Item_func_group_concat::clear().
+ Called from sql_delete.cc by mysql_delete().
+ Called from sql_select.cc by JOIN::reinit().
+ Called from sql_union.cc by st_select_lex_unit::exec().
+*/
int ha_example::delete_all_rows()
{
DBUG_ENTER("ha_example::delete_all_rows");
DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED);
}
+
+/*
+ First you should go read the section "locking functions for mysql" in
+ lock.cc to understand this.
+ This create a lock on the table. If you are implementing a storage engine
+ that can handle transacations look at ha_berkely.cc to see how you will
+ want to goo about doing this. Otherwise you should consider calling flock()
+ here.
+
+ Called from lock.cc by lock_external() and unlock_external(). Also called
+ from sql_table.cc by copy_data_between_tables().
+*/
int ha_example::external_lock(THD *thd, int lock_type)
{
DBUG_ENTER("ha_example::external_lock");
DBUG_RETURN(0);
}
+
+/*
+ The idea with handler::store_lock() is the following:
+
+ The statement decided which locks we should need for the table
+ for updates/deletes/inserts we get WRITE locks, for SELECT... we get
+ read locks.
+
+ Before adding the lock into the table lock handler (see thr_lock.c)
+ mysqld calls store lock with the requested locks. Store lock can now
+ modify a write lock to a read lock (or some other lock), ignore the
+ lock (if we don't want to use MySQL table locks at all) or add locks
+ for many tables (like we do when we are using a MERGE handler).
+
+ Berkeley DB for example changes all WRITE locks to TL_WRITE_ALLOW_WRITE
+ (which signals that we are doing WRITES, but we are still allowing other
+ reader's and writer's.
+
+ When releasing locks, store_lock() are also called. In this case one
+ usually doesn't have to do anything.
+
+ In some exceptional cases MySQL may send a request for a TL_IGNORE;
+ This means that we are requesting the same lock as last time and this
+ should also be ignored. (This may happen when someone does a flush
+ table when we have opened a part of the tables, in which case mysqld
+ closes and reopens the tables and tries to get the same locks at last
+ time). In the future we will probably try to remove this.
+
+ Called from lock.cc by get_lock_data().
+*/
THR_LOCK_DATA **ha_example::store_lock(THD *thd,
THR_LOCK_DATA **to,
enum thr_lock_type lock_type)
@@ -267,6 +590,16 @@ THR_LOCK_DATA **ha_example::store_lock(THD *thd,
return to;
}
+/*
+ Used to delete a table. By the time delete_table() has been called all
+ opened references to this table will have been closed (and your globally
+ shared references released. The variable name will just be the name of
+ the table. You will need to remove any files you have created at this point.
+
+ Called from handler.cc by delete_table and ha_create_table(). Only used
+ during create if the table_flag HA_DROP_BEFORE_CREATE was specified for
+ the storage engine.
+*/
int ha_example::delete_table(const char *name)
{
DBUG_ENTER("ha_example::delete_table");
@@ -274,24 +607,44 @@ int ha_example::delete_table(const char *name)
DBUG_RETURN(0);
}
+/*
+ Renames a table from one name to another from alter table call.
+
+ Called from sql_table.cc by mysql_rename_table().
+*/
int ha_example::rename_table(const char * from, const char * to)
{
DBUG_ENTER("ha_example::rename_table ");
DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED);
}
-ha_rows ha_example::records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag)
+/*
+ Given a starting key, and an ending key estimate the number of rows that
+ will exist between the two. end_key may be empty which in case determine
+ if start_key matches any rows.
+
+ Called from opt_range.cc by check_quick_keys().
+*/
+ha_rows ha_example::records_in_range(uint inx, key_range *min_key,
+ key_range *max_key)
{
- DBUG_ENTER("ha_example::records_in_range ");
- DBUG_RETURN(records); // HA_ERR_NOT_IMPLEMENTED
+ DBUG_ENTER("ha_example::records_in_range");
+ DBUG_RETURN(10); // low number to force index usage
}
-int ha_example::create(const char *name, TABLE *table_arg, HA_CREATE_INFO *create_info)
+/*
+ create() is called to create a database. The variable name will have the name
+ of the table. When create() is called you do not need to worry about opening
+ the table. Also, the FRM file will have already been created so adjusting
+ create_info will not do you any good. You can overwrite the frm file at this
+ point if you wish to change the table definition, but there are no methods
+ currently provided for doing that.
+
+ Called from handle.cc by ha_create_table().
+*/
+int ha_example::create(const char *name, TABLE *table_arg,
+ HA_CREATE_INFO *create_info)
{
DBUG_ENTER("ha_example::create");
/* This is not implemented but we want someone to be able that it works. */
diff --git a/sql/examples/ha_example.h b/sql/examples/ha_example.h
index 466632a1795..2228f04284a 100644
--- a/sql/examples/ha_example.h
+++ b/sql/examples/ha_example.h
@@ -14,6 +14,17 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+/*
+ Please read ha_exmple.cc before reading this file.
+ Please keep in mind that the example storage engine implements all methods
+ that are required to be implemented. handler.h has a full list of methods
+ that you can implement.
+*/
+
+/*
+ EXAMPLE_SHARE is a structure that will be shared amoung all open handlers
+ The example implements the minimum of what you will probably need.
+*/
typedef struct st_example_share {
char *table_name;
uint table_name_length,use_count;
@@ -21,6 +32,9 @@ typedef struct st_example_share {
THR_LOCK lock;
} EXAMPLE_SHARE;
+/*
+ Class definition for the storage engine
+*/
class ha_example: public handler
{
THR_LOCK_DATA lock; /* MySQL lock */
@@ -33,17 +47,34 @@ public:
~ha_example()
{
}
- const char *table_type() const { return "EXAMPLE"; }
+ /* The name that will be used for display purposes */
+ const char *table_type() const { return "EXAMPLE"; }
+ /* The name of the index type that will be used for display */
const char *index_type(uint inx) { return "NONE"; }
const char **bas_ext() const;
+ /*
+ This is a list of flags that says what the storage engine
+ implements. The current table flags are documented in
+ table_flags.
+ */
ulong table_flags() const
{
return 0;
}
+ /*
+ This is a list of flags that says how the storage engine
+ implements indexes. The current index flags are documented in
+ handler.h. If you do not implement indexes, just return zero
+ here.
+ */
ulong index_flags(uint inx) const
{
return 0;
}
+ /*
+ unireg.cc will call the following to make sure that the storage engine can
+ handle the data it is about to send.
+ */
uint max_record_length() const { return HA_MAX_REC_LENGTH; }
uint max_keys() const { return 0; }
uint max_key_parts() const { return 0; }
@@ -52,10 +83,15 @@ public:
Called in test_quick_select to determine if indexes should be used.
*/
virtual double scan_time() { return (double) (records+deleted) / 20.0+10; }
- /* The next method will never be called */
+ /*
+ The next method will never be called if you do not implement indexes.
+ */
virtual double read_time(ha_rows rows) { return (double) rows / 20.0+1; }
virtual bool fast_key_read() { return 1;}
+ /*
+ Everything below are methods that we implment in ha_example.cc.
+ */
int open(const char *name, int mode, uint test_if_locked);
int close(void);
int write_row(byte * buf);
@@ -78,10 +114,8 @@ public:
int reset(void);
int external_lock(THD *thd, int lock_type);
int delete_all_rows(void);
- ha_rows records_in_range(int inx, const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag);
+ ha_rows records_in_range(uint inx, key_range *min_key,
+ key_range *max_key);
int delete_table(const char *from);
int rename_table(const char * from, const char * to);
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
diff --git a/sql/field.cc b/sql/field.cc
index fdf314972c8..df9b4f84ae7 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -423,30 +423,11 @@ bool Field::get_time(TIME *ltime)
void Field::store_time(TIME *ltime,timestamp_type type)
{
- char buff[25];
- switch (type) {
- case TIMESTAMP_NONE:
- case TIMESTAMP_DATETIME_ERROR:
- store("",0,&my_charset_bin); // Probably an error
- break;
- case TIMESTAMP_DATE:
- sprintf(buff,"%04d-%02d-%02d", ltime->year,ltime->month,ltime->day);
- store(buff,10,&my_charset_bin);
- break;
- case TIMESTAMP_DATETIME:
- sprintf(buff,"%04d-%02d-%02d %02d:%02d:%02d",
- ltime->year,ltime->month,ltime->day,
- ltime->hour,ltime->minute,ltime->second);
- store(buff,19,&my_charset_bin);
- break;
- case TIMESTAMP_TIME:
- {
- ulong length= my_sprintf(buff, (buff, "%02d:%02d:%02d",
- ltime->hour,ltime->minute,ltime->second));
- store(buff,(uint) length, &my_charset_bin);
- break;
- }
- }
+ char buff[MAX_DATE_REP_LENGTH];
+ String tmp;
+ tmp.set(buff, sizeof(buff), &my_charset_bin);
+ TIME_to_string(ltime, &tmp);
+ store(buff, tmp.length(), &my_charset_bin);
}
@@ -2307,7 +2288,8 @@ int Field_float::store(double nr)
}
else
{
- max_value= (log_10[field_length]-1)/log_10[dec];
+ uint tmp=min(field_length,array_elements(log_10)-1);
+ max_value= (log_10[tmp]-1)/log_10[dec];
/*
The following comparison is needed to not get an overflow if nr
is close to FLT_MAX
@@ -2607,7 +2589,8 @@ int Field_double::store(double nr)
}
else
{
- max_value= (log_10[field_length]-1)/log_10[dec];
+ uint tmp=min(field_length,array_elements(log_10)-1);
+ max_value= (log_10[tmp]-1)/log_10[dec];
if (fabs(nr) < DBL_MAX/10.0e+32)
nr= floor(nr*log_10[dec]+0.5)/log_10[dec];
}
@@ -3928,6 +3911,11 @@ void Field_newdate::sql_type(String &res) const
int Field_datetime::store(const char *from,uint len,CHARSET_INFO *cs)
{
longlong tmp=str_to_datetime(from,len,1);
+ if (tmp < 0)
+ {
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE);
+ tmp= 0;
+ }
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
{
@@ -4250,12 +4238,13 @@ int Field_string::cmp(const char *a_ptr, const char *b_ptr)
like in latin_de 'ae' and 0xe4
*/
return field_charset->coll->strnncollsp(field_charset,
- (const uchar*) a_ptr, field_length,
- (const uchar*) b_ptr, field_length);
+ (const uchar*) a_ptr, field_length,
+ (const uchar*) b_ptr,
+ field_length);
}
return field_charset->coll->strnncoll(field_charset,
- (const uchar*) a_ptr, field_length,
- (const uchar*) b_ptr, field_length);
+ (const uchar*) a_ptr, field_length,
+ (const uchar*) b_ptr, field_length);
}
void Field_string::sort_string(char *to,uint length)
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index df5a45480c6..93ca5b318fa 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -1542,7 +1542,7 @@ int ha_berkeley::index_next_same(byte * buf, const byte *key, uint keylen)
{
error=read_row(cursor->c_get(cursor, &last_key, &row, DB_NEXT),
(char*) buf, active_index, &row, &last_key, 1);
- if (!error && ::key_cmp(table, key, active_index, keylen))
+ if (!error && ::key_cmp_if_same(table, key, active_index, keylen))
error=HA_ERR_END_OF_FILE;
}
DBUG_RETURN(error);
@@ -1987,11 +1987,8 @@ double ha_berkeley::scan_time()
return rows2double(records/3);
}
-ha_rows ha_berkeley::records_in_range(int keynr,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag)
+ha_rows ha_berkeley::records_in_range(uint keynr, key_range *start_key,
+ key_range *end_key)
{
DBT key;
DB_KEY_RANGE start_range, end_range;
@@ -2000,25 +1997,27 @@ ha_rows ha_berkeley::records_in_range(int keynr,
DBUG_ENTER("records_in_range");
if ((start_key && kfile->key_range(kfile,transaction,
- pack_key(&key, keynr, key_buff, start_key,
- start_key_len),
- &start_range,0)) ||
+ pack_key(&key, keynr, key_buff,
+ start_key->key,
+ start_key->length),
+ &start_range,0)) ||
(end_key && kfile->key_range(kfile,transaction,
- pack_key(&key, keynr, key_buff, end_key,
- end_key_len),
+ pack_key(&key, keynr, key_buff,
+ end_key->key,
+ end_key->length),
&end_range,0)))
DBUG_RETURN(HA_BERKELEY_RANGE_COUNT); // Better than returning an error /* purecov: inspected */
if (!start_key)
- start_pos=0.0;
- else if (start_search_flag == HA_READ_KEY_EXACT)
+ start_pos= 0.0;
+ else if (start_key->flag == HA_READ_KEY_EXACT)
start_pos=start_range.less;
else
start_pos=start_range.less+start_range.equal;
if (!end_key)
- end_pos=1.0;
- else if (end_search_flag == HA_READ_BEFORE_KEY)
+ end_pos= 1.0;
+ else if (end_key->flag == HA_READ_BEFORE_KEY)
end_pos=end_range.less;
else
end_pos=end_range.less+end_range.equal;
diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h
index 525c82febd0..249f5ef2370 100644
--- a/sql/ha_berkeley.h
+++ b/sql/ha_berkeley.h
@@ -143,12 +143,7 @@ class ha_berkeley: public handler
int optimize(THD* thd, HA_CHECK_OPT* check_opt);
int check(THD* thd, HA_CHECK_OPT* check_opt);
- ha_rows records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag);
-
+ ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
int create(const char *name, register TABLE *form,
HA_CREATE_INFO *create_info);
int delete_table(const char *name);
diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc
index 47978d647ec..c375614ac95 100644
--- a/sql/ha_heap.cc
+++ b/sql/ha_heap.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -47,12 +47,7 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked)
if (file)
{
/* Initialize variables for the opened table */
- btree_keys.clear_all();
- for (uint i= 0 ; i < table->keys ; i++)
- {
- if (table->key_info[i].algorithm == HA_KEY_ALG_BTREE)
- btree_keys.set_bit(i);
- }
+ set_keys_for_scanning();
}
return (file ? 0 : 1);
}
@@ -62,6 +57,33 @@ int ha_heap::close(void)
return heap_close(file);
}
+
+/*
+ Compute which keys to use for scanning
+
+ SYNOPSIS
+ set_keys_for_scanning()
+ no parameter
+
+ DESCRIPTION
+ Set the bitmap btree_keys, which is used when the upper layers ask
+ which keys to use for scanning. For each btree index the
+ corresponding bit is set.
+
+ RETURN
+ void
+*/
+
+void ha_heap::set_keys_for_scanning(void)
+{
+ btree_keys.clear_all();
+ for (uint i= 0 ; i < table->keys ; i++)
+ {
+ if (table->key_info[i].algorithm == HA_KEY_ALG_BTREE)
+ btree_keys.set_bit(i);
+ }
+}
+
int ha_heap::write_row(byte * buf)
{
statistic_increment(ha_write_count,&LOCK_status);
@@ -207,6 +229,114 @@ int ha_heap::external_lock(THD *thd, int lock_type)
return 0; // No external locking
}
+
+/*
+ Disable indexes.
+
+ SYNOPSIS
+ disable_indexes()
+ mode mode of operation:
+ HA_KEY_SWITCH_NONUNIQ disable all non-unique keys
+ HA_KEY_SWITCH_ALL disable all keys
+ HA_KEY_SWITCH_NONUNIQ_SAVE dis. non-uni. and make persistent
+ HA_KEY_SWITCH_ALL_SAVE dis. all keys and make persistent
+
+ DESCRIPTION
+ Disable indexes and clear keys to use for scanning.
+
+ IMPLEMENTATION
+ HA_KEY_SWITCH_NONUNIQ is not implemented.
+ HA_KEY_SWITCH_NONUNIQ_SAVE is not implemented with HEAP.
+ HA_KEY_SWITCH_ALL_SAVE is not implemented with HEAP.
+
+ RETURN
+ 0 ok
+ HA_ERR_WRONG_COMMAND mode not implemented.
+*/
+
+int ha_heap::disable_indexes(uint mode)
+{
+ int error;
+
+ if (mode == HA_KEY_SWITCH_ALL)
+ {
+ if (!(error= heap_disable_indexes(file)))
+ set_keys_for_scanning();
+ }
+ else
+ {
+ /* mode not implemented */
+ error= HA_ERR_WRONG_COMMAND;
+ }
+ return error;
+}
+
+
+/*
+ Enable indexes.
+
+ SYNOPSIS
+ enable_indexes()
+ mode mode of operation:
+ HA_KEY_SWITCH_NONUNIQ enable all non-unique keys
+ HA_KEY_SWITCH_ALL enable all keys
+ HA_KEY_SWITCH_NONUNIQ_SAVE en. non-uni. and make persistent
+ HA_KEY_SWITCH_ALL_SAVE en. all keys and make persistent
+
+ DESCRIPTION
+ Enable indexes and set keys to use for scanning.
+ The indexes might have been disabled by disable_index() before.
+ The function works only if both data and indexes are empty,
+ since the heap storage engine cannot repair the indexes.
+ To be sure, call handler::delete_all_rows() before.
+
+ IMPLEMENTATION
+ HA_KEY_SWITCH_NONUNIQ is not implemented.
+ HA_KEY_SWITCH_NONUNIQ_SAVE is not implemented with HEAP.
+ HA_KEY_SWITCH_ALL_SAVE is not implemented with HEAP.
+
+ RETURN
+ 0 ok
+ HA_ERR_CRASHED data or index is non-empty. Delete all rows and retry.
+ HA_ERR_WRONG_COMMAND mode not implemented.
+*/
+
+int ha_heap::enable_indexes(uint mode)
+{
+ int error;
+
+ if (mode == HA_KEY_SWITCH_ALL)
+ {
+ if (!(error= heap_enable_indexes(file)))
+ set_keys_for_scanning();
+ }
+ else
+ {
+ /* mode not implemented */
+ error= HA_ERR_WRONG_COMMAND;
+ }
+ return error;
+}
+
+
+/*
+ Test if indexes are disabled.
+
+ SYNOPSIS
+ indexes_are_disabled()
+ no parameters
+
+ RETURN
+ 0 indexes are not disabled
+ 1 all indexes are disabled
+ [2 non-unique indexes are disabled - NOT YET IMPLEMENTED]
+*/
+
+int ha_heap::indexes_are_disabled(void)
+{
+ return heap_indexes_are_disabled(file);
+}
+
THR_LOCK_DATA **ha_heap::store_lock(THD *thd,
THR_LOCK_DATA **to,
enum thr_lock_type lock_type)
@@ -233,28 +363,20 @@ int ha_heap::rename_table(const char * from, const char * to)
return heap_rename(from,to);
}
-ha_rows ha_heap::records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag)
+
+ha_rows ha_heap::records_in_range(uint inx, key_range *min_key,
+ key_range *max_key)
{
- KEY *pos=table->key_info+inx;
- if (pos->algorithm == HA_KEY_ALG_BTREE)
- {
- return hp_rb_records_in_range(file, inx, start_key, start_key_len,
- start_search_flag, end_key, end_key_len,
- end_search_flag);
- }
- else
- {
- if (start_key_len != end_key_len ||
- start_key_len != pos->key_length ||
- start_search_flag != HA_READ_KEY_EXACT ||
- end_search_flag != HA_READ_AFTER_KEY)
- return HA_POS_ERROR; // Can't only use exact keys
- return 10; // Good guess
- }
+ KEY *key=table->key_info+inx;
+ if (key->algorithm == HA_KEY_ALG_BTREE)
+ return hp_rb_records_in_range(file, inx, min_key, max_key);
+
+ if (min_key->length != max_key->length ||
+ min_key->length != key->key_length ||
+ min_key->flag != HA_READ_KEY_EXACT ||
+ max_key->flag != HA_READ_AFTER_KEY)
+ return HA_POS_ERROR; // Can only use exact keys
+ return 10; // Good guess
}
diff --git a/sql/ha_heap.h b/sql/ha_heap.h
index 68406202c76..f55eda91149 100644
--- a/sql/ha_heap.h
+++ b/sql/ha_heap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -61,6 +61,7 @@ class ha_heap: public handler
int open(const char *name, int mode, uint test_if_locked);
int close(void);
+ void set_keys_for_scanning(void);
int write_row(byte * buf);
int update_row(const byte * old_data, byte * new_data);
int delete_row(const byte * buf);
@@ -82,10 +83,10 @@ class ha_heap: public handler
int extra(enum ha_extra_function operation);
int external_lock(THD *thd, int lock_type);
int delete_all_rows(void);
- ha_rows records_in_range(int inx, const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag);
+ int disable_indexes(uint mode);
+ int enable_indexes(uint mode);
+ int indexes_are_disabled(void);
+ ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
int delete_table(const char *from);
int rename_table(const char * from, const char * to);
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 4c4c32691e5..601536ab27e 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -325,6 +325,35 @@ convert_error_code_to_mysql(
}
/*****************************************************************
+If you want to print a thd that is not associated with the current thread,
+you must call this function before reserving the InnoDB kernel_mutex, to
+protect MySQL from setting thd->query NULL. If you print a thd of the current
+thread, we know that MySQL cannot modify thd->query, and it is not necessary
+to call this. Call innobase_mysql_end_print_arbitrary_thd() after you release
+the kernel_mutex.
+NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this
+function! */
+extern "C"
+void
+innobase_mysql_prepare_print_arbitrary_thd(void)
+/*============================================*/
+{
+ VOID(pthread_mutex_lock(&LOCK_thread_count));
+}
+
+/*****************************************************************
+Relases the mutex reserved by innobase_mysql_prepare_print_arbitrary_thd().
+NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this
+function! */
+extern "C"
+void
+innobase_mysql_end_print_arbitrary_thd(void)
+/*========================================*/
+{
+ VOID(pthread_mutex_unlock(&LOCK_thread_count));
+}
+
+/*****************************************************************
Prints info of a THD object (== user session thread) to the
standard output. NOTE that /mysql/innobase/trx/trx0trx.c must contain
the prototype for this function! */
@@ -335,9 +364,11 @@ innobase_mysql_print_thd(
FILE* f, /* in: output stream */
void* input_thd)/* in: pointer to a MySQL THD object */
{
- THD* thd;
+ const THD* thd;
+ const char* s;
+ char buf[301];
- thd = (THD*) input_thd;
+ thd = (const THD*) input_thd;
fprintf(f, "MySQL thread id %lu, query id %lu",
thd->thread_id, thd->query_id);
@@ -356,14 +387,31 @@ innobase_mysql_print_thd(
fputs(thd->user, f);
}
- if (thd->proc_info) {
+ if ((s = thd->proc_info)) {
putc(' ', f);
- fputs(thd->proc_info, f);
+ fputs(s, f);
}
- if (thd->query) {
- putc(' ', f);
- fputs(thd->query, f);
+ if ((s = thd->query)) {
+ /* determine the length of the query string */
+ uint32 i, len;
+
+ len = thd->query_length;
+
+ if (len > 300) {
+ len = 300; /* ADDITIONAL SAFETY: print at most
+ 300 chars to reduce the probability of
+ a seg fault if there is a race in
+ thd->query_length in MySQL; after
+ May 14, 2004 probably no race any more,
+ but better be safe */
+ }
+
+ /* Use strmake to reduce the timeframe
+ for a race, compared to fwrite() */
+ i= (uint) (strmake(buf, s, len) - buf);
+ putc('\n', f);
+ fwrite(buf, 1, i, f);
}
putc('\n', f);
@@ -3928,18 +3976,11 @@ ha_innobase::records_in_range(
/*==========================*/
/* out: estimated number of
rows */
- int keynr, /* in: index number */
- const mysql_byte* start_key, /* in: start key value of the
- range, may also be empty */
- uint start_key_len, /* in: start key val len, may
- also be 0 */
- enum ha_rkey_function start_search_flag,/* in: start search condition
- e.g., 'greater than' */
- const mysql_byte* end_key, /* in: range end key val, may
- also be empty */
- uint end_key_len, /* in: range end key val len,
- may also be 0 */
- enum ha_rkey_function end_search_flag)/* in: range end search cond */
+ uint keynr, /* in: index number */
+ key_range *min_key, /* in: start key value of the
+ range, may also be 0 */
+ key_range *max_key) /* in: range end key val, may
+ also be 0 */
{
row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt;
KEY* key;
@@ -3960,12 +4001,6 @@ ha_innobase::records_in_range(
DBUG_ENTER("records_in_range");
- /* We do not know if MySQL can call this function before calling
- external_lock(). To be safe, update the thd of the current table
- handle. */
-
- update_thd(current_thd);
-
prebuilt->trx->op_info = (char*)"estimating records in index range";
/* In case MySQL calls this in the middle of a SELECT query, release
@@ -3989,17 +4024,21 @@ ha_innobase::records_in_range(
range_start, (byte*) key_val_buff,
(ulint)upd_and_key_val_buff_len,
index,
- (byte*) start_key,
- (ulint) start_key_len);
+ (byte*) (min_key ? min_key->key :
+ (const mysql_byte*) 0),
+ (ulint) (min_key ? min_key->length : 0));
row_sel_convert_mysql_key_to_innobase(
range_end, (byte*) key_val_buff2,
buff2_len, index,
- (byte*) end_key,
- (ulint) end_key_len);
-
- mode1 = convert_search_mode_to_innobase(start_search_flag);
- mode2 = convert_search_mode_to_innobase(end_search_flag);
+ (byte*) (max_key ? max_key->key :
+ (const mysql_byte*) 0),
+ (ulint) (max_key ? max_key->length : 0));
+
+ mode1 = convert_search_mode_to_innobase(min_key ? min_key->flag :
+ HA_READ_KEY_EXACT);
+ mode2 = convert_search_mode_to_innobase(max_key ? max_key->flag :
+ HA_READ_KEY_EXACT);
n_rows = btr_estimate_n_rows_in_range(index, range_start,
mode1, range_end, mode2);
diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h
index 62f5e85b5d4..a33f8974049 100644
--- a/sql/ha_innodb.h
+++ b/sql/ha_innodb.h
@@ -166,11 +166,7 @@ class ha_innobase: public handler
int start_stmt(THD *thd);
void position(byte *record);
- ha_rows records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag);
+ ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
ha_rows estimate_number_of_rows();
int create(const char *name, register TABLE *form,
diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc
index 09c2aeceafc..85ab25a31d9 100644
--- a/sql/ha_isam.cc
+++ b/sql/ha_isam.cc
@@ -382,18 +382,21 @@ int ha_isam::create(const char *name, register TABLE *form,
}
+static key_range no_range= { (byte*) 0, 0, HA_READ_KEY_EXACT };
-ha_rows ha_isam::records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag)
+ha_rows ha_isam::records_in_range(uint inx, key_range *min_key,
+ key_range *max_key)
{
+ /* ISAM checks if 'key' pointer <> 0 to know if there is no range */
+ if (!min_key)
+ min_key= &no_range;
+ if (!max_key)
+ max_key= &no_range;
return (ha_rows) nisam_records_in_range(file,
- inx,
- start_key,start_key_len,
- start_search_flag,
- end_key,end_key_len,
- end_search_flag);
+ (int) inx,
+ min_key->key, min_key->length,
+ min_key->flag,
+ max_key->key, max_key->length,
+ max_key->flag);
}
#endif /* HAVE_ISAM */
diff --git a/sql/ha_isam.h b/sql/ha_isam.h
index 2c8ec274145..8a887ababde 100644
--- a/sql/ha_isam.h
+++ b/sql/ha_isam.h
@@ -70,11 +70,7 @@ class ha_isam: public handler
void info(uint);
int extra(enum ha_extra_function operation);
int external_lock(THD *thd, int lock_type);
- ha_rows records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag);
+ ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index dfb41efa88a..0c43b1f263e 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -810,47 +810,146 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
}
}
+
/*
- disable indexes, making it persistent if requested
+ Disable indexes, making it persistent if requested.
+
SYNOPSIS
- disable_indexes(all, save)
- all disable all indexes
- if not set only non-unique indexes will be disabled
- [all=1 is NOT IMPLEMENTED YET]
- save save the disabled state, so that it will persist
- between queries/threads/reboots
- [save=0 is NOT IMPLEMENTED YET]
+ disable_indexes()
+ mode mode of operation:
+ HA_KEY_SWITCH_NONUNIQ disable all non-unique keys
+ HA_KEY_SWITCH_ALL disable all keys
+ HA_KEY_SWITCH_NONUNIQ_SAVE dis. non-uni. and make persistent
+ HA_KEY_SWITCH_ALL_SAVE dis. all keys and make persistent
+
+ IMPLEMENTATION
+ HA_KEY_SWITCH_NONUNIQ is not implemented.
+ HA_KEY_SWITCH_ALL_SAVE is not implemented.
+
+ RETURN
+ 0 ok
+ HA_ERR_WRONG_COMMAND mode not implemented.
*/
-int ha_myisam::disable_indexes(bool all, bool save)
+
+int ha_myisam::disable_indexes(uint mode)
{
- mi_extra(file, HA_EXTRA_NO_KEYS, 0);
- info(HA_STATUS_CONST); // Read new key info
- return 0;
+ int error;
+
+ if (mode == HA_KEY_SWITCH_ALL)
+ {
+ /* call a storage engine function to switch the key map */
+ error= mi_disable_indexes(file);
+ }
+ else if (mode == HA_KEY_SWITCH_NONUNIQ_SAVE)
+ {
+ mi_extra(file, HA_EXTRA_NO_KEYS, 0);
+ info(HA_STATUS_CONST); // Read new key info
+ error= 0;
+ }
+ else
+ {
+ /* mode not implemented */
+ error= HA_ERR_WRONG_COMMAND;
+ }
+ return error;
}
-int ha_myisam::enable_indexes()
+
+/*
+ Enable indexes, making it persistent if requested.
+
+ SYNOPSIS
+ enable_indexes()
+ mode mode of operation:
+ HA_KEY_SWITCH_NONUNIQ enable all non-unique keys
+ HA_KEY_SWITCH_ALL enable all keys
+ HA_KEY_SWITCH_NONUNIQ_SAVE en. non-uni. and make persistent
+ HA_KEY_SWITCH_ALL_SAVE en. all keys and make persistent
+
+ DESCRIPTION
+ Enable indexes, which might have been disabled by disable_index() before.
+ The modes without _SAVE work only if both data and indexes are empty,
+ since the MyISAM repair would enable them persistently.
+ To be sure in these cases, call handler::delete_all_rows() before.
+
+ IMPLEMENTATION
+ HA_KEY_SWITCH_NONUNIQ is not implemented.
+ HA_KEY_SWITCH_ALL_SAVE is not implemented.
+
+ RETURN
+ 0 ok
+ !=0 Error, among others:
+ HA_ERR_CRASHED data or index is non-empty. Delete all rows and retry.
+ HA_ERR_WRONG_COMMAND mode not implemented.
+*/
+
+int ha_myisam::enable_indexes(uint mode)
{
+ int error;
+
if (file->s->state.key_map == set_bits(ulonglong, file->s->base.keys))
+ {
+ /* All indexes are enabled already. */
return 0;
+ }
- int error=0;
- THD *thd=current_thd;
- MI_CHECK param;
- const char *save_proc_info=thd->proc_info;
- thd->proc_info="Creating index";
- myisamchk_init(&param);
- param.op_name = (char*) "recreating_index";
- param.testflag = (T_SILENT | T_REP_BY_SORT | T_QUICK |
- T_CREATE_MISSING_KEYS);
- param.myf_rw&= ~MY_WAIT_IF_FULL;
- param.sort_buffer_length= thd->variables.myisam_sort_buff_size;
- param.tmpdir=&mysql_tmpdir_list;
- error=repair(thd,param,0) != HA_ADMIN_OK;
- info(HA_STATUS_CONST);
- thd->proc_info=save_proc_info;
+ if (mode == HA_KEY_SWITCH_ALL)
+ {
+ error= mi_enable_indexes(file);
+ /*
+ Do not try to repair on error,
+ as this could make the enabled state persistent,
+ but mode==HA_KEY_SWITCH_ALL forbids it.
+ */
+ }
+ else if (mode == HA_KEY_SWITCH_NONUNIQ_SAVE)
+ {
+ THD *thd=current_thd;
+ MI_CHECK param;
+ const char *save_proc_info=thd->proc_info;
+ thd->proc_info="Creating index";
+ myisamchk_init(&param);
+ param.op_name = (char*) "recreating_index";
+ param.testflag = (T_SILENT | T_REP_BY_SORT | T_QUICK |
+ T_CREATE_MISSING_KEYS);
+ param.myf_rw&= ~MY_WAIT_IF_FULL;
+ param.sort_buffer_length= thd->variables.myisam_sort_buff_size;
+ param.tmpdir=&mysql_tmpdir_list;
+ error=repair(thd,param,0) != HA_ADMIN_OK;
+ info(HA_STATUS_CONST);
+ thd->proc_info=save_proc_info;
+ }
+ else
+ {
+ /* mode not implemented */
+ error= HA_ERR_WRONG_COMMAND;
+ }
return error;
}
+
+/*
+ Test if indexes are disabled.
+
+
+ SYNOPSIS
+ indexes_are_disabled()
+ no parameters
+
+
+ RETURN
+ 0 indexes are not disabled
+ 1 all indexes are disabled
+ [2 non-unique indexes are disabled - NOT YET IMPLEMENTED]
+*/
+
+int ha_myisam::indexes_are_disabled(void)
+{
+
+ return mi_indexes_are_disabled(file);
+}
+
+
/*
prepare for a many-rows insert operation
e.g. - disable indexes (if they can be recreated fast) or
@@ -898,7 +997,8 @@ int ha_myisam::end_bulk_insert()
{
mi_end_bulk_insert(file);
int err=mi_extra(file, HA_EXTRA_NO_CACHE, 0);
- return err ? err : can_enable_indexes ? enable_indexes() : 0;
+ return err ? err : can_enable_indexes ?
+ enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE) : 0;
}
@@ -1415,19 +1515,15 @@ longlong ha_myisam::get_auto_increment()
SYNOPSIS
records_in_range()
inx Index to use
- start_key Start of range. Null pointer if from first key
- start_key_len Length of start key
- start_search_flag Flag if start key should be included or not
- end_key End of range. Null pointer if to last key
- end_key_len Length of end key
- end_search_flag Flag if start key should be included or not
+ min_key Start of range. Null pointer if from first key
+ max_key End of range. Null pointer if to last key
NOTES
- start_search_flag can have one of the following values:
+ min_key.flag can have one of the following values:
HA_READ_KEY_EXACT Include the key in the range
HA_READ_AFTER_KEY Don't include key in range
- end_search_flag can have one of the following values:
+ max_key.flag can have one of the following values:
HA_READ_BEFORE_KEY Don't include key in range
HA_READ_AFTER_KEY Include all 'end_key' values in the range
@@ -1438,18 +1534,10 @@ longlong ha_myisam::get_auto_increment()
the range.
*/
-ha_rows ha_myisam::records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag)
+ha_rows ha_myisam::records_in_range(uint inx, key_range *min_key,
+ key_range *max_key)
{
- return (ha_rows) mi_records_in_range(file,
- inx,
- start_key,start_key_len,
- start_search_flag,
- end_key,end_key_len,
- end_search_flag);
+ return (ha_rows) mi_records_in_range(file, (int) inx, min_key, max_key);
}
diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h
index ca318b02778..77887220903 100644
--- a/sql/ha_myisam.h
+++ b/sql/ha_myisam.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -105,15 +105,12 @@ class ha_myisam: public handler
int extra_opt(enum ha_extra_function operation, ulong cache_size);
int external_lock(THD *thd, int lock_type);
int delete_all_rows(void);
- int disable_indexes(bool all, bool save);
- int enable_indexes();
+ int disable_indexes(uint mode);
+ int enable_indexes(uint mode);
+ int indexes_are_disabled(void);
void start_bulk_insert(ha_rows rows);
int end_bulk_insert();
- ha_rows records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag);
+ ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
void update_create_info(HA_CREATE_INFO *create_info);
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index 041d9eaead3..9aa6d039efb 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -199,20 +199,14 @@ void ha_myisammrg::position(const byte *record)
ha_store_ptr(ref, ref_length, (my_off_t) position);
}
-ha_rows ha_myisammrg::records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag)
+
+ha_rows ha_myisammrg::records_in_range(uint inx, key_range *min_key,
+ key_range *max_key)
{
- return (ha_rows) myrg_records_in_range(file,
- inx,
- start_key,start_key_len,
- start_search_flag,
- end_key,end_key_len,
- end_search_flag);
+ return (ha_rows) myrg_records_in_range(file, (int) inx, min_key, max_key);
}
+
void ha_myisammrg::info(uint flag)
{
MYMERGE_INFO info;
diff --git a/sql/ha_myisammrg.h b/sql/ha_myisammrg.h
index c0f81a77a1e..fd36c78202d 100644
--- a/sql/ha_myisammrg.h
+++ b/sql/ha_myisammrg.h
@@ -70,11 +70,7 @@ class ha_myisammrg: public handler
int rnd_next(byte *buf);
int rnd_pos(byte * buf, byte *pos);
void position(const byte *record);
- ha_rows records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag);
+ ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
my_off_t row_position() { return myrg_position(file); }
void info(uint);
int extra(enum ha_extra_function operation);
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 3bc322878d1..21056ef4a8f 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -2748,22 +2748,19 @@ void ha_ndbcluster::set_dbname(const char *path_name)
ha_rows
-ha_ndbcluster::records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag)
-{
- ha_rows records= 10;
- KEY* key_info= table->key_info + inx;
+ha_ndbcluster::records_in_range(uint inx, key_range *min_key,
+ key_range *max_key)
+{
+ ha_rows records= 10; /* Good guess when you don't know anything */
+ KEY *key_info= table->key_info + inx;
uint key_length= key_info->key_length;
DBUG_ENTER("records_in_range");
- DBUG_PRINT("enter", ("inx: %d", inx));
- DBUG_PRINT("enter", ("start_key: %x, start_key_len: %d", start_key, start_key_len));
- DBUG_PRINT("enter", ("start_search_flag: %d", start_search_flag));
- DBUG_PRINT("enter", ("end_key: %x, end_key_len: %d", end_key, end_key_len));
- DBUG_PRINT("enter", ("end_search_flag: %d", end_search_flag));
+ DBUG_PRINT("enter", ("inx: %u", inx));
+ DBUG_DUMP("start_key", min_key->key, min_key->length);
+ DBUG_DUMP("end_key", max_key->key, max_key->length);
+ DBUG_PRINT("enter", ("start_search_flag: %u end_search_flag: %u",
+ min_key->flag, max_key->flag));
/*
Check that start_key_len is equal to
@@ -2772,7 +2769,7 @@ ha_ndbcluster::records_in_range(int inx,
*/
NDB_INDEX_TYPE idx_type= get_index_type(inx);
if ((idx_type == UNIQUE_INDEX || idx_type == PRIMARY_KEY_INDEX) &&
- start_key_len < key_length)
+ min_key->length < key_length)
{
DBUG_PRINT("warning", ("Tried to use index which required"
"full key length: %d, HA_POS_ERROR",
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index bd601f39fc4..029ebc11e46 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -121,12 +121,7 @@ class ha_ndbcluster: public handler
}
double scan_time();
- ha_rows records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag);
-
+ ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
static Ndb* seize_ndb();
static void release_ndb(Ndb* ndb);
diff --git a/sql/handler.cc b/sql/handler.cc
index 944d3421d75..079ff5ba687 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -103,15 +103,16 @@ TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"",
enum db_type ha_resolve_by_name(const char *name, uint namelen)
{
- if (!my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) {
- return(enum db_type) current_thd->variables.table_type;
+ THD *thd=current_thd;
+ if (thd && !my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) {
+ return (enum db_type) thd->variables.table_type;
}
show_table_type_st *types;
for (types= sys_table_types; types->type; types++)
{
if (!my_strcasecmp(&my_charset_latin1, name, types->type))
- return(enum db_type)types->db_type;
+ return (enum db_type) types->db_type;
}
return DB_TYPE_UNKNOWN;
}
@@ -742,7 +743,7 @@ int ha_delete_table(enum db_type table_type, const char *path)
{
/* Ensure that table handler get path in lower case */
strmov(tmp_path, path);
- my_casedn_str(system_charset_info, tmp_path);
+ my_casedn_str(files_charset_info, tmp_path);
path= tmp_path;
}
int error=file->delete_table(path);
@@ -1184,7 +1185,7 @@ int handler::index_next_same(byte *buf, const byte *key, uint keylen)
int error;
if (!(error=index_next(buf)))
{
- if (key_cmp(table, key, active_index, keylen))
+ if (key_cmp_if_same(table, key, active_index, keylen))
{
table->status=STATUS_NOT_FOUND;
error=HA_ERR_END_OF_FILE;
@@ -1248,7 +1249,7 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
{
/* Ensure that handler gets name in lower case */
strmov(name_buff, name);
- my_casedn_str(system_charset_info, name_buff);
+ my_casedn_str(files_charset_info, name_buff);
name= name_buff;
}
@@ -1390,6 +1391,7 @@ int ha_discover(const char* dbname, const char* name,
read_range_first()
start_key Start key. Is 0 if no min range
end_key End key. Is 0 if no max range
+ eq_range_arg Set to 1 if start_key == end_key
sorted Set to 1 if result should be sorted per key
NOTES
@@ -1403,11 +1405,12 @@ int ha_discover(const char* dbname, const char* name,
int handler::read_range_first(const key_range *start_key,
const key_range *end_key,
- bool sorted)
+ bool eq_range_arg, bool sorted)
{
int result;
DBUG_ENTER("handler::read_range_first");
+ eq_range= eq_range_arg;
end_range= 0;
if (end_key)
{
@@ -1418,7 +1421,6 @@ int handler::read_range_first(const key_range *start_key,
}
range_key_part= table->key_info[active_index].key_part;
-
if (!start_key) // Read first record
result= index_first(table->record[0]);
else
@@ -1440,7 +1442,6 @@ int handler::read_range_first(const key_range *start_key,
SYNOPSIS
read_range_next()
- eq_range Set to 1 if start_key == end_key
NOTES
Record is read into table->record[0]
@@ -1451,17 +1452,19 @@ int handler::read_range_first(const key_range *start_key,
# Error code
*/
-int handler::read_range_next(bool eq_range)
+int handler::read_range_next()
{
int result;
DBUG_ENTER("handler::read_range_next");
if (eq_range)
- result= index_next_same(table->record[0],
- end_range->key,
- end_range->length);
- else
- result= index_next(table->record[0]);
+ {
+ /* We trust that index_next_same always gives a row in range */
+ DBUG_RETURN(index_next_same(table->record[0],
+ end_range->key,
+ end_range->length));
+ }
+ result= index_next(table->record[0]);
if (result)
DBUG_RETURN(result);
DBUG_RETURN(compare_key(end_range) <= 0 ? 0 : HA_ERR_END_OF_FILE);
@@ -1469,16 +1472,18 @@ int handler::read_range_next(bool eq_range)
/*
- Compare if found key is over max-value
+ Compare if found key (in row) is over max-value
SYNOPSIS
compare_key
- range key to compare to row
+ range range to compare to row. May be 0 for no range
NOTES
- For this to work, the row must be stored in table->record[0]
+ See key.cc::key_cmp() for details
RETURN
+ The return value is SIGN(key_in_row - range_key):
+
0 Key is equal to range or 'range' == 0 (no range)
-1 Key is less than range
1 Key is larger than range
@@ -1486,37 +1491,11 @@ int handler::read_range_next(bool eq_range)
int handler::compare_key(key_range *range)
{
- KEY_PART_INFO *key_part= range_key_part;
- uint store_length;
-
+ int cmp;
if (!range)
return 0; // No max range
-
- for (const char *key= (const char*) range->key, *end=key+range->length;
- key < end;
- key+= store_length, key_part++)
- {
- int cmp;
- store_length= key_part->store_length;
- if (key_part->null_bit)
- {
- if (*key)
- {
- if (!key_part->field->is_null())
- return 1;
- continue;
- }
- else if (key_part->field->is_null())
- return 0;
- key++; // Skip null byte
- store_length--;
- }
- if ((cmp=key_part->field->key_cmp((byte*) key, key_part->length)) < 0)
- return -1;
- if (cmp > 0)
- return 1;
- }
- return key_compare_result_on_equal;
+ cmp= key_cmp(range_key_part, range->key, range->length);
+ if (!cmp)
+ cmp= key_compare_result_on_equal;
+ return cmp;
}
-
-
diff --git a/sql/handler.h b/sql/handler.h
index 15fc6a201d8..1cafeedc7ef 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -91,6 +91,13 @@
#define HA_KEY_READ_ONLY 64 /* Support HA_EXTRA_KEYREAD */
+/* operations for disable/enable indexes */
+#define HA_KEY_SWITCH_NONUNIQ 0
+#define HA_KEY_SWITCH_ALL 1
+#define HA_KEY_SWITCH_NONUNIQ_SAVE 2
+#define HA_KEY_SWITCH_ALL_SAVE 3
+
+
/*
Bits in index_ddl_flags(KEY *wanted_index)
for what ddl you can do with index
@@ -227,14 +234,6 @@ typedef struct st_ha_check_opt
} HA_CHECK_OPT;
-typedef struct st_key_range
-{
- const byte *key;
- uint length;
- enum ha_rkey_function flag;
-} key_range;
-
-
class handler :public Sql_alloc
{
protected:
@@ -261,6 +260,7 @@ public:
key_range save_end_range, *end_range;
KEY_PART_INFO *range_key_part;
int key_compare_result_on_equal;
+ bool eq_range;
uint errkey; /* Last dup key */
uint sortkey, key_used_on_scan;
@@ -323,13 +323,14 @@ public:
return (my_errno=HA_ERR_WRONG_COMMAND);
}
virtual int read_range_first(const key_range *start_key,
- const key_range *end_key,
- bool sorted);
- virtual int read_range_next(bool eq_range);
+ const key_range *end_key,
+ bool eq_range, bool sorted);
+ virtual int read_range_next();
int compare_key(key_range *range);
virtual int ft_init()
{ return -1; }
- virtual FT_INFO *ft_init_ext(uint flags,uint inx,const byte *key, uint keylen)
+ virtual FT_INFO *ft_init_ext(uint flags,uint inx,const byte *key,
+ uint keylen)
{ return NULL; }
virtual int ft_read(byte *buf) { return -1; }
virtual int rnd_init(bool scan=1)=0;
@@ -338,11 +339,8 @@ public:
virtual int rnd_pos(byte * buf, byte *pos)=0;
virtual int read_first_row(byte *buf, uint primary_key);
virtual int restart_rnd_next(byte *buf, byte *pos);
- virtual ha_rows records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag)
+ virtual ha_rows records_in_range(uint inx, key_range *min_key,
+ key_range *max_key)
{ return (ha_rows) 10; }
virtual void position(const byte *record)=0;
virtual my_off_t row_position() { return HA_OFFSET_ERROR; }
@@ -373,8 +371,9 @@ public:
*/
virtual int restore(THD* thd, HA_CHECK_OPT* check_opt);
virtual int dump(THD* thd, int fd = -1) { return ER_DUMP_NOT_IMPLEMENTED; }
- virtual int disable_indexes(bool all, bool save) { return HA_ERR_WRONG_COMMAND; }
- virtual int enable_indexes() { return HA_ERR_WRONG_COMMAND; }
+ virtual int disable_indexes(uint mode) { return HA_ERR_WRONG_COMMAND; }
+ virtual int enable_indexes(uint mode) { return HA_ERR_WRONG_COMMAND; }
+ virtual int indexes_are_disabled(void) {return 0;}
virtual void start_bulk_insert(ha_rows rows) {}
virtual int end_bulk_insert() {return 0; }
virtual int discard_or_import_tablespace(my_bool discard) {return -1;}
diff --git a/sql/item.cc b/sql/item.cc
index 8c20d45714f..8dfe40abea8 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -28,6 +28,8 @@ static void mark_as_dependent(THD *thd,
SELECT_LEX *last, SELECT_LEX *current,
Item_ident *item);
+const String my_null_string("NULL", 4, default_charset_info);
+
/*****************************************************************************
** Item functions
*****************************************************************************/
@@ -399,9 +401,14 @@ const char *Item_ident::full_name() const
}
else
{
- tmp=(char*) sql_alloc((uint) strlen(table_name)+
- (uint) strlen(field_name)+2);
- strxmov(tmp,table_name,".",field_name,NullS);
+ if (table_name[0])
+ {
+ tmp= (char*) sql_alloc((uint) strlen(table_name) +
+ (uint) strlen(field_name) + 2);
+ strxmov(tmp, table_name, ".", field_name, NullS);
+ }
+ else
+ tmp= (char*) field_name;
}
return tmp;
}
@@ -648,13 +655,11 @@ default_set_param_func(Item_param *param,
param->set_null();
}
-Item_param::Item_param(unsigned position) :
- value_is_set(FALSE),
+Item_param::Item_param(unsigned pos_in_query_arg) :
+ state(NO_VALUE),
item_result_type(STRING_RESULT),
item_type(STRING_ITEM),
- item_is_time(FALSE),
- long_data_supplied(FALSE),
- pos_in_query(position),
+ pos_in_query(pos_in_query_arg),
set_param_func(default_set_param_func)
{
name= (char*) "?";
@@ -670,74 +675,93 @@ void Item_param::set_null()
{
DBUG_ENTER("Item_param::set_null");
/* These are cleared after each execution by reset() method */
- null_value= value_is_set= 1;
+ max_length= 0;
+ null_value= 1;
+ /*
+ Because of NULL and string values we need to set max_length for each new
+ placeholder value: user can submit NULL for any placeholder type, and
+ string length can be different in each execution.
+ */
+ max_length= 0;
+ decimals= 0;
+ state= NULL_VALUE;
DBUG_VOID_RETURN;
}
-void Item_param::set_int(longlong i)
+void Item_param::set_int(longlong i, uint32 max_length_arg)
{
DBUG_ENTER("Item_param::set_int");
- int_value= (longlong)i;
- item_type= INT_ITEM;
- value_is_set= 1;
+ value.integer= (longlong) i;
+ state= INT_VALUE;
+ max_length= max_length_arg;
+ decimals= 0;
maybe_null= 0;
- DBUG_PRINT("info", ("integer: %lld", int_value));
DBUG_VOID_RETURN;
}
-void Item_param::set_double(double value)
+void Item_param::set_double(double d)
{
DBUG_ENTER("Item_param::set_double");
- real_value=value;
- item_type= REAL_ITEM;
- value_is_set= 1;
+ value.real= d;
+ state= REAL_VALUE;
+ max_length= DBL_DIG + 8;
+ decimals= NOT_FIXED_DEC;
maybe_null= 0;
- DBUG_PRINT("info", ("double: %lg", real_value));
DBUG_VOID_RETURN;
}
-void Item_param::set_value(const char *str, uint length)
-{
- DBUG_ENTER("Item_param::set_value");
- str_value.copy(str,length,default_charset());
- item_type= STRING_ITEM;
- value_is_set= 1;
+void Item_param::set_time(TIME *tm, timestamp_type type, uint32 max_length_arg)
+{
+ DBUG_ENTER("Item_param::set_time");
+
+ value.time= *tm;
+ value.time.time_type= type;
+
+ state= TIME_VALUE;
maybe_null= 0;
- DBUG_PRINT("info", ("string: %s", str_value.ptr()));
+ max_length= max_length_arg;
+ decimals= 0;
DBUG_VOID_RETURN;
}
-void Item_param::set_time(TIME *tm, timestamp_type type)
-{
- ltime.year= tm->year;
- ltime.month= tm->month;
- ltime.day= tm->day;
-
- ltime.hour= tm->hour;
- ltime.minute= tm->minute;
- ltime.second= tm->second;
-
- ltime.second_part= tm->second_part;
-
- ltime.neg= tm->neg;
-
- ltime.time_type= type;
-
- item_is_time= TRUE;
- item_type= STRING_ITEM;
- value_is_set= 1;
+bool Item_param::set_str(const char *str, ulong length)
+{
+ DBUG_ENTER("Item_param::set_str");
+ /*
+ Assign string with no conversion: data is converted only after it's
+ been written to the binary log.
+ */
+ if (str_value.copy(str, length, &my_charset_bin, &my_charset_bin))
+ DBUG_RETURN(TRUE);
+ state= STRING_VALUE;
maybe_null= 0;
+ /* max_length and decimals are set after charset conversion */
+ /* sic: str may be not null-terminated, don't add DBUG_PRINT here */
+ DBUG_RETURN(FALSE);
}
-void Item_param::set_longdata(const char *str, ulong length)
-{
- str_value.append(str,length);
- long_data_supplied= 1;
- value_is_set= 1;
+bool Item_param::set_longdata(const char *str, ulong length)
+{
+ DBUG_ENTER("Item_param::set_longdata");
+
+ /*
+ If client character set is multibyte, end of long data packet
+ may hit at the middle of a multibyte character. Additionally,
+ if binary log is open we must write long data value to the
+ binary log in character set of client. This is why we can't
+ convert long data to connection character set as it comes
+ (here), and first have to concatenate all pieces together,
+ write query to the binary log and only then perform conversion.
+ */
+ if (str_value.append(str, length, &my_charset_bin))
+ DBUG_RETURN(TRUE);
+ state= LONG_DATA_VALUE;
maybe_null= 0;
+
+ DBUG_RETURN(FALSE);
}
@@ -753,9 +777,18 @@ void Item_param::set_longdata(const char *str, ulong length)
*/
void Item_param::reset()
-{
- str_value.set("", 0, &my_charset_bin);
- value_is_set= long_data_supplied= 0;
+{
+ /* Shrink string buffer if it's bigger than max possible CHAR column */
+ if (str_value.alloced_length() > MAX_CHAR_WIDTH)
+ str_value.free();
+ else
+ str_value.length(0);
+ /*
+ We must prevent all charset conversions unless data of str_value
+ has been written to the binary log.
+ */
+ str_value.set_charset(&my_charset_bin);
+ state= NO_VALUE;
maybe_null= 1;
null_value= 0;
}
@@ -764,155 +797,223 @@ void Item_param::reset()
int Item_param::save_in_field(Field *field, bool no_conversions)
{
DBUG_ASSERT(current_thd->command == COM_EXECUTE);
-
- if (null_value)
- return (int) set_field_to_null(field);
-
+
field->set_notnull();
- if (item_result_type == INT_RESULT)
- {
- longlong nr=val_int();
- return field->store(nr);
- }
- if (item_result_type == REAL_RESULT)
- {
- double nr=val();
- return field->store(nr);
- }
- if (item_is_time)
- {
- field->store_time(&ltime, ltime.time_type);
+
+ switch (state) {
+ case INT_VALUE:
+ return field->store(value.integer);
+ case REAL_VALUE:
+ return field->store(value.real);
+ case TIME_VALUE:
+ field->store_time(&value.time, value.time.time_type);
return 0;
+ case STRING_VALUE:
+ case LONG_DATA_VALUE:
+ return field->store(str_value.ptr(), str_value.length(),
+ str_value.charset());
+ case NULL_VALUE:
+ return set_field_to_null(field);
+ case NO_VALUE:
+ default:
+ DBUG_ASSERT(0);
}
- String *result=val_str(&str_value);
- return field->store(result->ptr(),result->length(),field->charset());
+ return 1;
}
+
bool Item_param::get_time(TIME *res)
{
- *res=ltime;
- return 0;
+ if (state == TIME_VALUE)
+ {
+ *res= value.time;
+ return 0;
+ }
+ /*
+ If parameter value isn't supplied assertion will fire in val_str()
+ which is called from Item::get_time().
+ */
+ return Item::get_time(res);
}
+
double Item_param::val()
{
- DBUG_ASSERT(value_is_set == 1);
- int err;
- if (null_value)
+ switch (state) {
+ case REAL_VALUE:
+ return value.real;
+ case INT_VALUE:
+ return (double) value.integer;
+ case STRING_VALUE:
+ case LONG_DATA_VALUE:
+ {
+ int dummy_err;
+ return my_strntod(str_value.charset(), (char*) str_value.ptr(),
+ str_value.length(), (char**) 0, &dummy_err);
+ }
+ case TIME_VALUE:
+ /*
+ This works for example when user says SELECT ?+0.0 and supplies
+ time value for the placeholder.
+ */
+ return (double) TIME_to_ulonglong(&value.time);
+ case NULL_VALUE:
return 0.0;
- switch (item_result_type) {
- case STRING_RESULT:
- return (double) my_strntod(str_value.charset(), (char*) str_value.ptr(),
- str_value.length(), (char**) 0, &err);
- case INT_RESULT:
- return (double)int_value;
default:
- return real_value;
+ DBUG_ASSERT(0);
}
+ return 0.0;
}
longlong Item_param::val_int()
{
- DBUG_ASSERT(value_is_set == 1);
- int err;
- if (null_value)
- return 0;
- switch (item_result_type) {
- case STRING_RESULT:
- return my_strntoll(str_value.charset(),
- str_value.ptr(),str_value.length(),10,
- (char**) 0,&err);
- case REAL_RESULT:
- return (longlong) (real_value+(real_value > 0 ? 0.5 : -0.5));
+ switch (state) {
+ case REAL_VALUE:
+ return (longlong) (value.real + (value.real > 0 ? 0.5 : -0.5));
+ case INT_VALUE:
+ return value.integer;
+ case STRING_VALUE:
+ case LONG_DATA_VALUE:
+ {
+ int dummy_err;
+ return my_strntoll(str_value.charset(), str_value.ptr(),
+ str_value.length(), 10, (char**) 0, &dummy_err);
+ }
+ case TIME_VALUE:
+ return (longlong) TIME_to_ulonglong(&value.time);
+ case NULL_VALUE:
+ return 0;
default:
- return int_value;
+ DBUG_ASSERT(0);
}
+ return 0;
}
String *Item_param::val_str(String* str)
{
- DBUG_ASSERT(value_is_set == 1);
- if (null_value)
- return NULL;
- switch (item_result_type) {
- case INT_RESULT:
- str->set(int_value, &my_charset_bin);
+ switch (state) {
+ case STRING_VALUE:
+ case LONG_DATA_VALUE:
+ return &str_value;
+ case REAL_VALUE:
+ str->set(value.real, NOT_FIXED_DEC, &my_charset_bin);
return str;
- case REAL_RESULT:
- str->set(real_value, 2, &my_charset_bin);
+ case INT_VALUE:
+ str->set(value.integer, &my_charset_bin);
+ return str;
+ case TIME_VALUE:
+ {
+ if (str->reserve(MAX_DATE_REP_LENGTH))
+ break;
+ TIME_to_string(&value.time, str);
return str;
+ }
+ case NULL_VALUE:
+ return NULL;
default:
- return (String*) &str_value;
+ DBUG_ASSERT(0);
}
+ return str;
}
/*
Return Param item values in string format, for generating the dynamic
query used in update/binary logs
+ TODO: change interface and implementation to fill log data in place
+ and avoid one more memcpy/alloc between str and log string.
*/
-String *Item_param::query_val_str(String* str)
+const String *Item_param::query_val_str(String* str) const
{
- DBUG_ASSERT(value_is_set == 1);
- switch (item_result_type) {
- case INT_RESULT:
- case REAL_RESULT:
- return val_str(str);
- default:
- str->set("'", 1, default_charset());
-
- if (!item_is_time)
+ switch (state) {
+ case INT_VALUE:
+ str->set(value.integer, &my_charset_bin);
+ break;
+ case REAL_VALUE:
+ str->set(value.real, NOT_FIXED_DEC, &my_charset_bin);
+ break;
+ case TIME_VALUE:
{
- str->append(str_value);
- const char *from= str->ptr();
- uint32 length= 1;
-
- // Escape misc cases
- char *to= (char *)from, *end= (char *)to+str->length();
- for (to++; to != end ; length++, to++)
- {
- switch(*to) {
- case '\'':
- case '"':
- case '\r':
- case '\n':
- case '\\': // TODO: Add remaining ..
- str->replace(length,0,"\\",1);
- to++; end++; length++;
- break;
- default:
- break;
- }
- }
+ char *buf, *ptr;
+ String tmp;
+ str->length(0);
+ /*
+ TODO: in case of error we need to notify replication
+ that binary log contains wrong statement
+ */
+ if (str->reserve(MAX_DATE_REP_LENGTH+3))
+ break;
+
+ /* Create date string inplace */
+ buf= str->c_ptr_quick();
+ ptr= buf;
+ *ptr++= '\'';
+ tmp.set(ptr, MAX_DATE_REP_LENGTH, &my_charset_bin);
+ tmp.length(0);
+ TIME_to_string(&value.time, &tmp);
+
+ ptr+= tmp.length();
+ *ptr++= '\'';
+ str->length((uint32) (ptr - buf));
+ break;
}
- else
+ case STRING_VALUE:
+ case LONG_DATA_VALUE:
{
- char buff[40];
- String tmp(buff,sizeof(buff), &my_charset_bin);
-
- switch (ltime.time_type) {
- case TIMESTAMP_NONE:
- case TIMESTAMP_DATETIME_ERROR:
- tmp.length(0); // Should never happen
- break;
- case TIMESTAMP_DATE:
- make_date((DATE_TIME_FORMAT*) 0, &ltime, &tmp);
- break;
- case TIMESTAMP_DATETIME:
- make_datetime((DATE_TIME_FORMAT*) 0, &ltime, &tmp);
- break;
- case TIMESTAMP_TIME:
- make_time((DATE_TIME_FORMAT*) 0, &ltime, &tmp);
- break;
- }
- str->append(tmp);
+ char *buf, *ptr;
+ str->length(0);
+ if (str->reserve(str_value.length()*2+3))
+ break;
+
+ buf= str->c_ptr_quick();
+ ptr= buf;
+ *ptr++= '\'';
+ ptr+= escape_string_for_mysql(str_value.charset(), ptr,
+ str_value.ptr(), str_value.length());
+ *ptr++= '\'';
+ str->length(ptr - buf);
+ break;
}
- str->append('\'');
+ case NULL_VALUE:
+ return &my_null_string;
+ default:
+ DBUG_ASSERT(0);
}
return str;
}
+
+
+/*
+ Convert string from client character set to the character set of
+ connection.
+*/
+
+bool Item_param::convert_str_value(THD *thd)
+{
+ bool rc= FALSE;
+ if (state == STRING_VALUE || state == LONG_DATA_VALUE)
+ {
+ /*
+ Check is so simple because all charsets were set up properly
+ in setup_one_conversion_function, where typecode of
+ placeholder was also taken into account: the variables are different
+ here only if conversion is really necessary.
+ */
+ if (value.cs_info.final_character_set_of_str_value !=
+ value.cs_info.character_set_client)
+ {
+ rc= thd->convert_string(&str_value,
+ value.cs_info.character_set_client,
+ value.cs_info.final_character_set_of_str_value);
+ }
+ max_length= str_value.length();
+ decimals= 0;
+ }
+ return rc;
+}
+
/* End of Item_param related */
diff --git a/sql/item.h b/sql/item.h
index 90362e917d3..8847cb35493 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -342,7 +342,10 @@ public:
inline void print(String *str)
{
+ str->reserve(m_name.length+8);
str->append(m_name.str, m_name.length);
+ str->append('@');
+ str->qs_append(m_offset);
}
inline bool send(Protocol *protocol, String *str)
@@ -492,33 +495,63 @@ public:
class Item_param :public Item
{
public:
- bool value_is_set;
- longlong int_value;
- double real_value;
- TIME ltime;
+ enum enum_item_param_state
+ {
+ NO_VALUE, NULL_VALUE, INT_VALUE, REAL_VALUE,
+ STRING_VALUE, TIME_VALUE, LONG_DATA_VALUE
+ } state;
+
+ union
+ {
+ longlong integer;
+ double real;
+ /*
+ Character sets conversion info for string values.
+ Character sets of client and connection defined at bind time are used
+ for all conversions, even if one of them is later changed (i.e.
+ between subsequent calls to mysql_stmt_execute).
+ */
+ struct CONVERSION_INFO
+ {
+ CHARSET_INFO *character_set_client;
+ /*
+ This points at character set of connection if conversion
+ to it is required (i. e. if placeholder typecode is not BLOB).
+ Otherwise it's equal to character_set_client (to simplify
+ check in convert_str_value()).
+ */
+ CHARSET_INFO *final_character_set_of_str_value;
+ } cs_info;
+ TIME time;
+ } value;
+
+ /* Cached values for virtual methods to save us one switch. */
enum Item_result item_result_type;
enum Type item_type;
- enum enum_field_types buffer_type;
- bool item_is_time;
- bool long_data_supplied;
+ /*
+ Offset of placeholder inside statement text. Used to create
+ no-placeholders version of this statement for the binary log.
+ */
uint pos_in_query;
- Item_param(uint position);
+ Item_param(uint pos_in_query_arg);
+
+ enum Item_result result_type () const { return item_result_type; }
enum Type type() const { return item_type; }
+ enum_field_types field_type() const { return MYSQL_TYPE_STRING; }
+
double val();
longlong val_int();
String *val_str(String*);
+ bool get_time(TIME *tm);
int save_in_field(Field *field, bool no_conversions);
+
void set_null();
- void set_int(longlong i);
+ void set_int(longlong i, uint32 max_length_arg);
void set_double(double i);
- void set_value(const char *str, uint length);
- void set_long_str(const char *str, ulong length);
- void set_long_binary(const char *str, ulong length);
- void set_longdata(const char *str, ulong length);
- void set_long_end();
- void set_time(TIME *tm, timestamp_type type);
- bool get_time(TIME *tm);
+ bool set_str(const char *str, ulong length);
+ bool set_longdata(const char *str, ulong length);
+ void set_time(TIME *tm, timestamp_type type, uint32 max_length_arg);
void reset();
/*
Assign placeholder value from bind data.
@@ -528,10 +561,10 @@ public:
*/
void (*set_param_func)(Item_param *param, uchar **pos, ulong len);
- enum Item_result result_type () const
- { return item_result_type; }
- String *query_val_str(String *str);
- enum_field_types field_type() const { return MYSQL_TYPE_STRING; }
+ const String *query_val_str(String *str) const;
+
+ bool convert_str_value(THD *thd);
+
Item *new_item() { return new Item_param(pos_in_query); }
/*
If value for parameter was not set we treat it as non-const
@@ -539,7 +572,7 @@ public:
parameter is constant during execution.
*/
virtual table_map used_tables() const
- { return value_is_set ? (table_map)0 : PARAM_TABLE_BIT; }
+ { return state != NO_VALUE ? (table_map)0 : PARAM_TABLE_BIT; }
void print(String *str) { str->append('?'); }
};
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index afbf0b7163e..446d72ac143 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -221,6 +221,7 @@ void Item_bool_func2::fix_length_and_dec()
{
conv= new Item_func_conv_charset(args[weak],args[strong]->collation.collation);
conv->collation.set(args[weak]->collation.derivation);
+ conv->fix_fields(current_thd, 0, &conv);
}
args[weak]= conv ? conv : args[weak];
}
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 47ca94238ab..c4cb8a7a2f0 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -615,6 +615,7 @@ longlong Item_func_div::val_int()
void Item_func_div::fix_length_and_dec()
{
decimals=max(args[0]->decimals,args[1]->decimals)+2;
+ set_if_smaller(decimals, NOT_FIXED_DEC);
max_length=args[0]->max_length - args[0]->decimals + decimals;
uint tmp=float_length(decimals);
set_if_smaller(max_length,tmp);
@@ -2386,7 +2387,10 @@ longlong user_var_entry::val_int(my_bool *null_value)
case INT_RESULT:
return *(longlong*) value;
case STRING_RESULT:
- return strtoull(value,NULL,10); // String is null terminated
+ {
+ int error;
+ return my_strtoll10(value, (char**) 0, &error);// String is null terminated
+ }
case ROW_RESULT:
DBUG_ASSERT(1); // Impossible
break;
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index c05091cae1f..676d8c1386a 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2587,6 +2587,7 @@ String *Item_func_quote::val_str(String *str)
*to= '\'';
str->length(new_length);
str->set_charset(collation.collation);
+ null_value= 0;
return str;
null:
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index a84d75a5895..48d38c0d602 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -56,10 +56,24 @@ void Item_subselect::init(st_select_lex *select_lex,
DBUG_PRINT("subs", ("select_lex 0x%xl", (ulong) select_lex));
unit= select_lex->master_unit();
- if (select_lex->next_select())
- engine= new subselect_union_engine(unit, result, this);
+ if (unit->item)
+ {
+ /*
+ Item can be changed in JOIN::prepare while engine in JOIN::optimize
+ => we do not copy old_engine here
+ */
+ engine= unit->item->engine;
+ unit->item->engine= 0;
+ unit->item= this;
+ engine->change_item(this, result);
+ }
else
- engine= new subselect_single_select_engine(select_lex, result, this);
+ {
+ if (select_lex->next_select())
+ engine= new subselect_union_engine(unit, result, this);
+ else
+ engine= new subselect_single_select_engine(select_lex, result, this);
+ }
DBUG_VOID_RETURN;
}
@@ -69,11 +83,13 @@ void Item_subselect::cleanup()
Item_result_field::cleanup();
if (old_engine)
{
- engine->cleanup();
+ if (engine)
+ engine->cleanup();
engine= old_engine;
old_engine= 0;
}
- engine->cleanup();
+ if (engine)
+ engine->cleanup();
reset();
value_assigned= 0;
DBUG_VOID_RETURN;
@@ -104,7 +120,7 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref)
{
DBUG_ASSERT(fixed == 0);
engine->set_thd((thd= thd_param));
- stmt= thd->current_statement;
+ arena= thd->current_arena;
char const *save_where= thd->where;
int res= engine->prepare();
@@ -127,7 +143,6 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref)
if (have_to_be_excluded)
engine->exclude();
substitution= 0;
- fixed= 1;
thd->where= "checking transformed subquery";
if (!(*ref)->fixed)
ret= (*ref)->fix_fields(thd, tables, ref);
@@ -316,8 +331,8 @@ Item_singlerow_subselect::select_transformer(JOIN *join)
if (join->conds || join->having)
{
Item *cond;
- if (stmt)
- thd->set_n_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->set_n_backup_item_arena(arena, &backup);
if (!join->having)
cond= join->conds;
@@ -330,15 +345,15 @@ Item_singlerow_subselect::select_transformer(JOIN *join)
new Item_null())))
goto err;
}
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->restore_backup_item_arena(arena, &backup);
return RES_REDUCE;
}
return RES_OK;
err:
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->restore_backup_item_arena(arena, &backup);
return RES_ERROR;
}
@@ -618,8 +633,8 @@ Item_in_subselect::single_value_transformer(JOIN *join,
Statement backup;
thd->where= "scalar IN/ALL/ANY subquery";
- if (stmt)
- thd->set_n_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->set_n_backup_item_arena(arena, &backup);
if (select_lex->item_list.elements > 1)
{
@@ -660,10 +675,20 @@ Item_in_subselect::single_value_transformer(JOIN *join,
item= new Item_sum_min(*select_lex->ref_pointer_array);
}
*select_lex->ref_pointer_array= item;
- select_lex->item_list.empty();
- select_lex->item_list.push_back(item);
+ {
+ List_iterator<Item> it(select_lex->item_list);
+ it++;
+ it.replace(item);
+ }
- // fix_fields call for 'item' will be made during new subquery fix_fields
+ /*
+ Item_sum_(max|min) can't substitute other item => we can use 0 as
+ reference
+ */
+ if (item->fix_fields(thd, join->tables_list, 0))
+ goto err;
+ /* we added aggregate function => we have to change statistic */
+ count_field_types(&join->tmp_table_param, join->all_fields, 0);
subs= new Item_singlerow_subselect(select_lex);
}
@@ -823,21 +848,21 @@ Item_in_subselect::single_value_transformer(JOIN *join,
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_SELECT_REDUCED, warn_buff);
}
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->restore_backup_item_arena(arena, &backup);
DBUG_RETURN(RES_REDUCE);
}
}
}
ok:
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->restore_backup_item_arena(arena, &backup);
DBUG_RETURN(RES_OK);
err:
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->restore_backup_item_arena(arena, &backup);
DBUG_RETURN(RES_ERROR);
}
@@ -855,8 +880,8 @@ Item_in_subselect::row_value_transformer(JOIN *join)
Item *item= 0;
thd->where= "row IN/ALL/ANY subquery";
- if (stmt)
- thd->set_n_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->set_n_backup_item_arena(arena, &backup);
SELECT_LEX *select_lex= join->select_lex;
@@ -940,13 +965,13 @@ Item_in_subselect::row_value_transformer(JOIN *join)
if (join->conds->fix_fields(thd, join->tables_list, 0))
goto err;
}
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->restore_backup_item_arena(arena, &backup);
DBUG_RETURN(RES_OK);
err:
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->restore_backup_item_arena(arena, &backup);
DBUG_RETURN(RES_ERROR);
}
@@ -1422,3 +1447,67 @@ void subselect_indexsubquery_engine::print(String *str)
}
str->append(')');
}
+
+/*
+ change select_result object of engine
+
+ SINOPSYS
+ subselect_single_select_engine::change_result()
+ si new subselect Item
+ res new select_result object
+
+ RETURN
+ 0 OK
+ -1 error
+*/
+
+int subselect_single_select_engine::change_item(Item_subselect *si,
+ select_subselect *res)
+{
+ item= si;
+ result= res;
+ return select_lex->join->change_result(result);
+}
+
+
+/*
+ change select_result object of engine
+
+ SINOPSYS
+ subselect_single_select_engine::change_result()
+ si new subselect Item
+ res new select_result object
+
+ RETURN
+ 0 OK
+ -1 error
+*/
+
+int subselect_union_engine::change_item(Item_subselect *si,
+ select_subselect *res)
+{
+ item= si;
+ int rc= unit->change_result(res, result);
+ result= res;
+ return rc;
+}
+
+
+/*
+ change select_result emulation, never should be called
+
+ SINOPSYS
+ subselect_single_select_engine::change_result()
+ si new subselect Item
+ res new select_result object
+
+ RETURN
+ -1 error
+*/
+
+int subselect_uniquesubquery_engine::change_item(Item_subselect *si,
+ select_subselect *res)
+{
+ DBUG_ASSERT(0);
+ return -1;
+}
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 6d8f5353695..019d43e4819 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -26,7 +26,7 @@ class JOIN;
class select_subselect;
class subselect_engine;
class Item_bool_func2;
-class Statement;
+class Item_arena;
/* base class for subselects */
@@ -36,8 +36,8 @@ class Item_subselect :public Item_result_field
protected:
/* thread handler, will be assigned in fix_fields only */
THD *thd;
- /* prepared statement, or 0 */
- Statement *stmt;
+ /* Item_arena used or 0 */
+ Item_arena *arena;
/* substitution instead of subselect in case of optimization */
Item *substitution;
/* unit of subquery */
@@ -290,6 +290,7 @@ public:
virtual table_map upper_select_const_tables()= 0;
static table_map calc_const_tables(TABLE_LIST *);
virtual void print(String *str)= 0;
+ virtual int change_item(Item_subselect *si, select_subselect *result)= 0;
};
@@ -313,6 +314,7 @@ public:
void exclude();
table_map upper_select_const_tables();
void print (String *str);
+ int change_item(Item_subselect *si, select_subselect *result);
};
@@ -332,6 +334,7 @@ public:
void exclude();
table_map upper_select_const_tables();
void print (String *str);
+ int change_item(Item_subselect *si, select_subselect *result);
};
@@ -360,6 +363,7 @@ public:
void exclude();
table_map upper_select_const_tables() { return 0; }
void print (String *str);
+ int change_item(Item_subselect *si, select_subselect *result);
};
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index c68754f6cae..3275440e522 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -77,15 +77,15 @@ Item_sum::Item_sum(THD *thd, Item_sum *item):
*/
bool Item_sum::save_args_for_prepared_statements(THD *thd)
{
- if (thd->current_statement)
- return save_args(thd->current_statement);
+ if (thd->current_arena && args_copy == 0)
+ return save_args(thd->current_arena);
return 0;
}
-bool Item_sum::save_args(Statement* stmt)
+bool Item_sum::save_args(Item_arena* arena)
{
- if (!(args_copy= (Item**) stmt->alloc(sizeof(Item*)*arg_count)))
+ if (!(args_copy= (Item**) arena->alloc(sizeof(Item*)*arg_count)))
return 1;
memcpy(args_copy, args, sizeof(Item*)*arg_count);
return 0;
@@ -618,6 +618,14 @@ void Item_sum_variance::update_field()
/* min & max */
+void Item_sum_hybrid::clear()
+{
+ sum= 0.0;
+ sum_int= 0;
+ value.length(0);
+ null_value= 1;
+}
+
double Item_sum_hybrid::val()
{
DBUG_ASSERT(fixed == 1);
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 953ff76b65d..ce46e92e6cf 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -23,6 +23,8 @@
#include <my_tree.h>
+class Item_arena;
+
class Item_sum :public Item_result_field
{
public:
@@ -93,7 +95,7 @@ public:
virtual void make_unique() {}
Item *get_tmp_table_item(THD *thd);
bool save_args_for_prepared_statements(THD *);
- bool save_args(Statement* stmt);
+ bool save_args(Item_arena* stmt);
bool walk (Item_processor processor, byte *argument);
};
@@ -448,13 +450,7 @@ class Item_sum_hybrid :public Item_sum
table_map used_tables() const { return used_table_cache; }
bool const_item() const { return !used_table_cache; }
- void clear()
- {
- sum=0.0;
- sum_int=0;
- value.length(0);
- null_value=1;
- }
+ void clear();
double val();
longlong val_int();
void reset_field();
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 2cda5dde3aa..39f67ba24f8 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1140,9 +1140,6 @@ void Item_func_curdate::fix_length_and_dec()
store_now_in_tm(current_thd->query_start(),&start);
- value=(longlong) ((ulong) ((uint) start.tm_year+1900)*10000L+
- ((uint) start.tm_mon+1)*100+
- (uint) start.tm_mday);
/* For getdate */
ltime.year= start.tm_year+1900;
ltime.month= start.tm_mon+1;
@@ -1153,6 +1150,7 @@ void Item_func_curdate::fix_length_and_dec()
ltime.second_part=0;
ltime.neg=0;
ltime.time_type=TIMESTAMP_DATE;
+ value= (longlong) TIME_to_ulonglong_date(&ltime);
}
String *Item_func_curdate::val_str(String *str)
@@ -1211,15 +1209,12 @@ void Item_func_curtime::fix_length_and_dec()
decimals=0;
store_now_in_tm(current_thd->query_start(),&start);
- value=(longlong) ((ulong) ((uint) start.tm_hour)*10000L+
- (ulong) (((uint) start.tm_min)*100L+
- (uint) start.tm_sec));
- ltime.day= 0;
ltime.hour= start.tm_hour;
ltime.minute= start.tm_min;
ltime.second= start.tm_sec;
ltime.second_part= 0;
ltime.neg= 0;
+ value= TIME_to_ulonglong_time(&ltime);
make_time((DATE_TIME_FORMAT *) 0, &ltime, &tmp);
max_length= buff_length= tmp.length();
}
@@ -1262,23 +1257,12 @@ void Item_func_now::fix_length_and_dec()
collation.set(&my_charset_bin);
store_now_in_tm(current_thd->query_start(),&start);
- value=((longlong) ((ulong) ((uint) start.tm_year+1900)*10000L+
- (((uint) start.tm_mon+1)*100+
- (uint) start.tm_mday))*(longlong) 1000000L+
- (longlong) ((ulong) ((uint) start.tm_hour)*10000L+
- (ulong) (((uint) start.tm_min)*100L+
- (uint) start.tm_sec)));
/* For getdate */
- ltime.year= start.tm_year+1900;
- ltime.month= start.tm_mon+1;
- ltime.day= start.tm_mday;
- ltime.hour= start.tm_hour;
- ltime.minute= start.tm_min;
- ltime.second= start.tm_sec;
- ltime.second_part= 0;
- ltime.neg= 0;
+ localtime_to_TIME(&ltime, &start);
ltime.time_type= TIMESTAMP_DATETIME;
+
+ value= (longlong) TIME_to_ulonglong_datetime(&ltime);
make_datetime((DATE_TIME_FORMAT *) 0, &ltime, &tmp);
max_length= buff_length= tmp.length();
@@ -1463,10 +1447,10 @@ uint Item_func_date_format::format_length(const String *format)
String *Item_func_date_format::val_str(String *str)
{
- DBUG_ASSERT(fixed == 1);
String *format;
TIME l_time;
uint size;
+ DBUG_ASSERT(fixed == 1);
if (!is_time_format)
{
@@ -1513,25 +1497,18 @@ null_date:
String *Item_func_from_unixtime::val_str(String *str)
{
- DBUG_ASSERT(fixed == 1);
- struct tm tm_tmp,*start;
- time_t tmp=(time_t) args[0]->val_int();
+ struct tm tm_tmp;
+ time_t tmp;
TIME ltime;
+ DBUG_ASSERT(fixed == 1);
+ tmp= (time_t) args[0]->val_int();
if ((null_value=args[0]->null_value))
goto null_date;
localtime_r(&tmp,&tm_tmp);
- start=&tm_tmp;
-
- ltime.year= start->tm_year+1900;
- ltime.month= start->tm_mon+1;
- ltime.day= start->tm_mday;
- ltime.hour= start->tm_hour;
- ltime.minute= start->tm_min;
- ltime.second= start->tm_sec;
- ltime.second_part= 0;
- ltime.neg=0;
+
+ localtime_to_TIME(&ltime, &tm_tmp);
if (str->alloc(20*MY_CHARSET_BIN_MB_MAXLEN))
goto null_date;
@@ -1546,19 +1523,17 @@ null_date:
longlong Item_func_from_unixtime::val_int()
{
+ TIME ltime;
+ struct tm tm_tmp;
+ time_t tmp;
DBUG_ASSERT(fixed == 1);
- time_t tmp=(time_t) (ulong) args[0]->val_int();
+
+ tmp= (time_t) (ulong) args[0]->val_int();
if ((null_value=args[0]->null_value))
return 0;
- struct tm tm_tmp,*start;
localtime_r(&tmp,&tm_tmp);
- start= &tm_tmp;
- return ((longlong) ((ulong) ((uint) start->tm_year+1900)*10000L+
- (((uint) start->tm_mon+1)*100+
- (uint) start->tm_mday))*LL(1000000)+
- (longlong) ((ulong) ((uint) start->tm_hour)*10000L+
- (ulong) (((uint) start->tm_min)*100L+
- (uint) start->tm_sec)));
+ localtime_to_TIME(&ltime, &tm_tmp);
+ return (longlong) TIME_to_ulonglong_datetime(&ltime);
}
bool Item_func_from_unixtime::get_date(TIME *ltime,
@@ -1567,17 +1542,9 @@ bool Item_func_from_unixtime::get_date(TIME *ltime,
time_t tmp=(time_t) (ulong) args[0]->val_int();
if ((null_value=args[0]->null_value))
return 1;
- struct tm tm_tmp,*start;
+ struct tm tm_tmp;
localtime_r(&tmp,&tm_tmp);
- start= &tm_tmp;
- ltime->year= start->tm_year+1900;
- ltime->month= start->tm_mon+1;
- ltime->day= start->tm_mday;
- ltime->hour= start->tm_hour;
- ltime->minute=start->tm_min;
- ltime->second=start->tm_sec;
- ltime->second_part=0;
- ltime->neg=0;
+ localtime_to_TIME(ltime, &tm_tmp);
return 0;
}
@@ -2054,7 +2021,7 @@ String *Item_date_typecast::val_str(String *str)
if (!get_arg0_date(&ltime,1) && !str->alloc(11))
{
- make_date((DATE_TIME_FORMAT *) 0,&ltime, str);
+ make_date((DATE_TIME_FORMAT *) 0, &ltime, str);
return str;
}
diff --git a/sql/key.cc b/sql/key.cc
index a2c3b2c8989..9425a368669 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -156,9 +156,28 @@ void key_restore(TABLE *table,byte *key,uint idx,uint key_length)
} /* key_restore */
- /* Compare if a key has changed */
+/*
+ Compare if a key has changed
+
+ SYNOPSIS
+ key_cmp_if_same()
+ table TABLE
+ key key to compare to row
+ idx Index used
+ key_length Length of key
+
+ NOTES
+ In theory we could just call field->cmp() for all field types,
+ but as we are only interested if a key has changed (not if the key is
+ larger or smaller than the previous value) we can do things a bit
+ faster by using memcmp() instead.
+
+ RETURN
+ 0 If key is equal
+ 1 Key has changed
+*/
-int key_cmp(TABLE *table,const byte *key,uint idx,uint key_length)
+bool key_cmp_if_same(TABLE *table,const byte *key,uint idx,uint key_length)
{
uint length;
KEY_PART_INFO *key_part;
@@ -281,3 +300,56 @@ bool check_if_key_used(TABLE *table, uint idx, List<Item> &fields)
return check_if_key_used(table, table->primary_key, fields);
return 0;
}
+
+
+/*
+ Compare key in row to a given key
+
+ SYNOPSIS
+ key_cmp()
+ key_part Key part handler
+ key Key to compare to value in table->record[0]
+ key_length length of 'key'
+
+ RETURN
+ The return value is SIGN(key_in_row - range_key):
+
+ 0 Key is equal to range or 'range' == 0 (no range)
+ -1 Key is less than range
+ 1 Key is larger than range
+*/
+
+int key_cmp(KEY_PART_INFO *key_part, const byte *key, uint key_length)
+{
+ uint store_length;
+
+ for (const byte *end=key + key_length;
+ key < end;
+ key+= store_length, key_part++)
+ {
+ int cmp;
+ store_length= key_part->store_length;
+ if (key_part->null_bit)
+ {
+ /* This key part allows null values; NULL is lower than everything */
+ register bool field_is_null= key_part->field->is_null();
+ if (*key) // If range key is null
+ {
+ /* the range is expecting a null value */
+ if (!field_is_null)
+ return 1; // Found key is > range
+ /* null -- exact match, go to next key part */
+ continue;
+ }
+ else if (field_is_null)
+ return -1; // NULL is less than any value
+ key++; // Skip null byte
+ store_length--;
+ }
+ if ((cmp=key_part->field->key_cmp((byte*) key, key_part->length)) < 0)
+ return -1;
+ if (cmp > 0)
+ return 1;
+ }
+ return 0; // Keys are equal
+}
diff --git a/sql/lock.cc b/sql/lock.cc
index 6d9deb8e4c6..723469b255e 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -240,7 +240,7 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock)
{
if (sql_lock->locks[i]->type >= TL_WRITE_ALLOW_READ)
{
- swap(THR_LOCK_DATA *,*lock,sql_lock->locks[i]);
+ swap_variables(THR_LOCK_DATA *, *lock, sql_lock->locks[i]);
lock++;
found++;
}
@@ -259,7 +259,7 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock)
{
if ((uint) sql_lock->table[i]->reginfo.lock_type >= TL_WRITE_ALLOW_READ)
{
- swap(TABLE *,*table,sql_lock->table[i]);
+ swap_variables(TABLE *, *table, sql_lock->table[i]);
table++;
found++;
}
diff --git a/sql/log_event.cc b/sql/log_event.cc
index f0274405ba8..b8d80883451 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1507,7 +1507,9 @@ end:
TEMPORARY TABLE don't suffer from these assignments to 0 as DROP TEMPORARY
TABLE uses the db.table syntax).
*/
- thd->db= thd->query= thd->catalog =0;
+ thd->db= 0; // prevent db from being freed
+ thd->query= 0; // just to be sure
+ thd->query_length= 0;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
// assume no convert for next query unless set explictly
#ifdef TO_BE_REMOVED
@@ -2399,6 +2401,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli,
thd->db= (char*) rewrite_db(db);
DBUG_ASSERT(thd->query == 0);
thd->query= 0; // Should not be needed
+ thd->query_length= 0; // Should not be needed
thd->query_error= 0;
clear_all_errors(thd, rli);
if (!use_rli_only_for_errors)
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 444c335d7a6..f3a55e0cad7 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -323,6 +323,14 @@ void debug_sync_point(const char* lock_name, uint lock_timeout);
#define WEEK_MONDAY_FIRST 1
#define WEEK_YEAR 2
#define WEEK_FIRST_WEEKDAY 4
+/*
+ Required buffer length for make_date, make_time, make_datetime
+ and TIME_to_string functions. Note, that the caller is still
+ responsible to check that given TIME structure has values
+ in valid ranges, otherwise size of the buffer could be not
+ enough.
+*/
+#define MAX_DATE_REP_LENGTH 30
struct st_table;
class THD;
@@ -559,13 +567,10 @@ int mysql_alter_table(THD *thd, char *new_db, char *new_name,
HA_CREATE_INFO *create_info,
TABLE_LIST *table_list,
List<create_field> &fields,
- List<Key> &keys,List<Alter_drop> &drop_list,
- List<Alter_column> &alter_list,
- uint order_num, ORDER *order, uint alter_flags,
+ List<Key> &keys,
+ uint order_num, ORDER *order,
enum enum_duplicates handle_duplicates,
- enum enum_enable_or_disable keys_onoff=LEAVE_AS_IS,
- enum tablespace_op_type tablespace_op=NO_TABLESPACE_OP,
- bool simple_alter=0);
+ ALTER_INFO *alter_info);
int mysql_create_like_table(THD *thd, TABLE_LIST *table,
HA_CREATE_INFO *create_info,
Table_ident *src_table);
@@ -576,7 +581,7 @@ bool mysql_rename_table(enum db_type base,
const char * new_name);
int mysql_create_index(THD *thd, TABLE_LIST *table_list, List<Key> &keys);
int mysql_drop_index(THD *thd, TABLE_LIST *table_list,
- List<Alter_drop> &drop_list);
+ ALTER_INFO *alter_info);
int mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
TABLE_LIST *update_table_list,
Item **conds, uint order_num, ORDER *order);
@@ -681,6 +686,7 @@ void mysql_stmt_reset(THD *thd, char *packet);
void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length);
int check_insert_fields(THD *thd,TABLE *table,List<Item> &fields,
List<Item> &values, ulong counter);
+void reset_stmt_for_execute(THD *thd, LEX *lex);
/* sql_error.cc */
MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, uint code,
@@ -796,11 +802,12 @@ void mysql_print_status(THD *thd);
int find_ref_key(TABLE *form,Field *field, uint *offset);
void key_copy(byte *key,TABLE *form,uint index,uint key_length);
void key_restore(TABLE *form,byte *key,uint index,uint key_length);
-int key_cmp(TABLE *form,const byte *key,uint index,uint key_length);
+bool key_cmp_if_same(TABLE *form,const byte *key,uint index,uint key_length);
void key_unpack(String *to,TABLE *form,uint index);
bool check_if_key_used(TABLE *table, uint idx, List<Item> &fields);
-bool init_errmessage(void);
+int key_cmp(KEY_PART_INFO *key_part, const byte *key, uint key_length);
+bool init_errmessage(void);
void sql_perror(const char *message);
void sql_print_error(const char *format,...)
__attribute__ ((format (printf, 1, 2)));
@@ -899,7 +906,7 @@ extern uint protocol_version, mysqld_port, dropping_tables;
extern uint delay_key_write_options, lower_case_table_names;
extern bool opt_endinfo, using_udf_functions, locked_in_memory;
extern bool opt_using_transactions, mysql_embedded;
-extern bool using_update_log, opt_large_files;
+extern bool using_update_log, opt_large_files, server_id_supplied;
extern bool opt_log, opt_update_log, opt_bin_log, opt_slow_log, opt_error_log;
extern bool opt_disable_networking, opt_skip_show_db;
extern bool volatile abort_loop, shutdown_in_progress, grant_option;
@@ -1040,9 +1047,17 @@ const char *get_date_time_format_str(KNOWN_DATE_TIME_FORMAT *format,
timestamp_type type);
extern bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
timestamp_type type, String *str);
-extern void make_time(DATE_TIME_FORMAT *format, TIME *l_time, String *str);
-void make_date(DATE_TIME_FORMAT *format, TIME *l_time, String *str);
-void make_datetime(DATE_TIME_FORMAT *format, TIME *l_time, String *str);
+void make_datetime(const DATE_TIME_FORMAT *format, const TIME *l_time,
+ String *str);
+void make_date(const DATE_TIME_FORMAT *format, const TIME *l_time,
+ String *str);
+void make_time(const DATE_TIME_FORMAT *format, const TIME *l_time,
+ String *str);
+void TIME_to_string(const TIME *time, String *str);
+ulonglong TIME_to_ulonglong_datetime(const TIME *time);
+ulonglong TIME_to_ulonglong_date(const TIME *time);
+ulonglong TIME_to_ulonglong_time(const TIME *time);
+ulonglong TIME_to_ulonglong(const TIME *time);
int test_if_number(char *str,int *res,bool allow_wildcards);
void change_byte(byte *,uint,char,char);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 4600ad13e6d..e4302a4a9ad 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -22,6 +22,7 @@
#include "sql_repl.h"
#include "repl_failsafe.h"
#include "stacktrace.h"
+#include "mysqld_suffix.h"
#include "mysys_err.h"
#ifdef HAVE_BERKELEY_DB
#include "ha_berkeley.h"
@@ -140,10 +141,27 @@ int deny_severity = LOG_WARNING;
#include <nks/vm.h>
#include <library.h>
#include <monitor.h>
-
+#include <zOmni.h> //For NEB
+#include <neb.h> //For NEB
+#include <nebpub.h> //For NEB
+#include <zEvent.h> //For NSS event structures
+#include <zPublics.h>
+
+static void *neb_consumer_id= NULL; //For storing NEB consumer id
+static char datavolname[256]= {0};
+static VolumeID_t datavolid;
static event_handle_t eh;
static Report_t ref;
+static void *refneb= NULL;
+static int volumeid= -1;
+
+ /* NEB event callback */
+unsigned long neb_event_callback(struct EventBlock *eblock);
+static void registerwithneb();
+static void getvolumename();
+static void getvolumeID(BYTE *volumeName);
#endif /* __NETWARE__ */
+
#ifdef _AIX41
int initgroups(const char *,unsigned int);
@@ -194,22 +212,6 @@ inline void reset_floating_point_exceptions()
extern "C" int gethostname(char *name, int namelen);
#endif
-/* Set prefix for windows binary */
-#ifdef __WIN__
-#undef MYSQL_SERVER_SUFFIX
-#ifdef __NT__
-#if defined(HAVE_BERKELEY_DB)
-#define MYSQL_SERVER_SUFFIX "-max-nt"
-#else
-#define MYSQL_SERVER_SUFFIX "-nt"
-#endif /* ...DB */
-#elif defined(HAVE_BERKELEY_DB)
-#define MYSQL_SERVER_SUFFIX "-max"
-#else
-#define MYSQL_SERVER_SUFFIX ""
-#endif /* __NT__ */
-#endif /* __WIN__ */
-
/* Constants */
@@ -339,7 +341,7 @@ const char *opt_date_time_formats[3];
char *language_ptr, *default_collation_name, *default_character_set_name;
char mysql_data_home_buff[2], *mysql_data_home=mysql_real_data_home;
-char server_version[SERVER_VERSION_LENGTH]=MYSQL_SERVER_VERSION;
+char server_version[SERVER_VERSION_LENGTH];
char *mysqld_unix_port, *opt_mysql_tmpdir;
char *my_bind_addr_str;
const char **errmesg; /* Error messages */
@@ -493,6 +495,7 @@ static void start_signal_handler(void);
extern "C" pthread_handler_decl(signal_hand, arg);
static void mysql_init_variables(void);
static void get_options(int argc,char **argv);
+static void set_server_version(void);
static int init_thread_environment();
static char *get_relative_path(const char *path);
static void fix_paths(void);
@@ -1458,6 +1461,7 @@ static void start_signal_handler(void)
static void check_data_home(const char *path)
{}
+
#elif defined(__NETWARE__)
// down server event callback
@@ -1466,27 +1470,196 @@ void mysql_down_server_cb(void *, void *)
kill_server(0);
}
+
// destroy callback resources
void mysql_cb_destroy(void *)
{
UnRegisterEventNotification(eh); // cleanup down event notification
NX_UNWRAP_INTERFACE(ref);
+
+ /* Deregister NSS volume deactivation event */
+ NX_UNWRAP_INTERFACE(refneb);
+ if (neb_consumer_id)
+ UnRegisterConsumer(neb_consumer_id, NULL);
}
+
// initialize callbacks
void mysql_cb_init()
{
// register for down server event
void *handle = getnlmhandle();
- rtag_t rt = AllocateResourceTag(handle, "MySQL Down Server Callback",
- EventSignature);
+ rtag_t rt= AllocateResourceTag(handle, "MySQL Down Server Callback",
+ EventSignature);
NX_WRAP_INTERFACE((void *)mysql_down_server_cb, 2, (void **)&ref);
- eh = RegisterForEventNotification(rt, EVENT_DOWN_SERVER,
- EVENT_PRIORITY_APPLICATION,
- NULL, ref, NULL);
+ eh= RegisterForEventNotification(rt, EVENT_PRE_DOWN_SERVER,
+ EVENT_PRIORITY_APPLICATION,
+ NULL, ref, NULL);
+
+ /*
+ Register for volume deactivation event
+ Wrap the callback function, as it is called by non-LibC thread
+ */
+ (void)NX_WRAP_INTERFACE(neb_event_callback, 1, &refneb);
+ registerwithneb();
+
NXVmRegisterExitHandler(mysql_cb_destroy, NULL); // clean-up
}
+
+/ *To get the name of the NetWare volume having MySQL data folder */
+
+static void getvolumename()
+{
+ char *p;
+ /*
+ We assume that data path is already set.
+ If not it won't come here. Terminate after volume name
+ */
+ if ((p= strchr(mysql_real_data_home, ':')))
+ strmake(datavolname, mysql_real_data_home,
+ (uint) (p - mysql_real_data_home));
+}
+
+
+/*
+ Registering with NEB for NSS Volume Deactivation event
+*/
+
+static void registerwithneb()
+{
+
+ ConsumerRegistrationInfo reg_info;
+
+ /* Clear NEB registration structure */
+ bzero((char*) &reg_info, sizeof(struct ConsumerRegistrationInfo));
+
+ /* Fill the NEB consumer information structure */
+ reg_info.CRIVersion= 1; // NEB version
+ /* NEB Consumer name */
+ reg_info.CRIConsumerName= (BYTE *) "MySQL Database Server";
+ /* Event of interest */
+ reg_info.CRIEventName= (BYTE *) "NSS.ChangeVolState.Enter";
+ reg_info.CRIUserParameter= NULL; // Consumer Info
+ reg_info.CRIEventFlags= 0; // Event flags
+ /* Consumer NLM handle */
+ reg_info.CRIOwnerID= (LoadDefinitionStructure *)getnlmhandle();
+ reg_info.CRIConsumerESR= NULL; // No consumer ESR required
+ reg_info.CRISecurityToken= 0; // No security token for the event
+ reg_info.CRIConsumerFlags= 0; // SMP_ENABLED_BIT;
+ reg_info.CRIFilterName= 0; // No event filtering
+ reg_info.CRIFilterDataLength= 0; // No filtering data
+ reg_info.CRIFilterData= 0; // No filtering data
+ /* Callback function for the event */
+ (void *)reg_info.CRIConsumerCallback= (void *) refneb;
+ reg_info.CRIOrder= 0; // Event callback order
+ reg_info.CRIConsumerType= CHECK_CONSUMER; // Consumer type
+
+ /* Register for the event with NEB */
+ if (RegisterConsumer(&reg_info))
+ {
+ consoleprintf("Failed to register for NSS Volume Deactivation event \n");
+ return;
+ }
+ /* This ID is required for deregistration */
+ neb_consumer_id= reg_info.CRIConsumerID;
+
+ /* Get MySQL data volume name, stored in global variable datavolname */
+ getvolumename();
+
+ /*
+ Get the NSS volume ID of the MySQL Data volume.
+ Volume ID is stored in a global variable
+ */
+ getvolumeID((BYTE*) datavolname);
+}
+
+
+/*
+ Callback for NSS Volume Deactivation event
+*/
+ulong neb_event_callback(struct EventBlock *eblock)
+{
+ EventChangeVolStateEnter_s *voldata;
+ voldata= (EventChangeVolStateEnter_s *)eblock->EBEventData;
+
+ /* Deactivation of a volume */
+ if ((voldata->oldState == 6 && voldata->newState == 2))
+ {
+ /*
+ Ensure that we bring down MySQL server only for MySQL data
+ volume deactivation
+ */
+ if (!memcmp(&voldata->volID, &datavolid, sizeof(VolumeID_t)))
+ {
+ consoleprintf("MySQL data volume is deactivated, shutting down MySQL Server \n");
+ kill_server(0);
+ }
+ }
+ return 0;
+}
+
+
+/*
+ Function to get NSS volume ID of the MySQL data
+*/
+
+#define ADMIN_VOL_PATH "_ADMIN:/Volumes/"
+
+staticvoid getvolumeID(BYTE *volumeName)
+{
+ char path[zMAX_FULL_NAME];
+ Key_t rootKey= 0, fileKey= 0;
+ QUAD getInfoMask;
+ zInfo_s info;
+ STATUS status;
+
+ /* Get the root key */
+ if ((status= zRootKey(0, &rootKey)) != zOK)
+ {
+ consoleprintf("\nGetNSSVolumeProperties - Failed to get root key, status: %d\n.", (int) status);
+ goto exit;
+ }
+
+ /*
+ Get the file key. This is the key to the volume object in the
+ NSS admin volumes directory.
+ */
+
+ strxmov(path, (const char *) ADMIN_VOL_PATH, (const char *) volumeName,
+ NullS);
+ if ((status= zOpen(rootKey, zNSS_TASK, zNSPACE_LONG|zMODE_UTF8,
+ (BYTE *) path, zRR_READ_ACCESS, &fileKey)) != zOK)
+ {
+ consoleprintf("\nGetNSSVolumeProperties - Failed to get file, status: %d\n.", (int) status);
+ goto exit;
+ }
+
+ getInfoMask= zGET_IDS | zGET_VOLUME_INFO ;
+ if ((status= zGetInfo(fileKey, getInfoMask, sizeof(info),
+ zINFO_VERSION_A, &info)) != zOK)
+ {
+ consoleprintf("\nGetNSSVolumeProperties - Failed in zGetInfo, status: %d\n.", (int) status);
+ goto exit;
+ }
+
+ /* Copy the data to global variable */
+ datavolid.timeLow= info.vol.volumeID.timeLow;
+ datavolid.timeMid= info.vol.volumeID.timeMid;
+ datavolid.timeHighAndVersion= info.vol.volumeID.timeHighAndVersion;
+ datavolid.clockSeqHighAndReserved= info.vol.volumeID.clockSeqHighAndReserved;
+ datavolid.clockSeqLow= info.vol.volumeID.clockSeqLow;
+ /* This is guranteed to be 6-byte length (but sizeof() would be better) */
+ memcpy(datavolid.node, info.vol.volumeID.node, (unsigned int) 6);
+
+exit:
+ if (rootKey)
+ zClose(rootKey);
+ if (fileKey)
+ zClose(fileKey);
+}
+
+
static void init_signals(void)
{
int signals[] = {SIGINT,SIGILL,SIGFPE,SIGSEGV,SIGTERM,SIGABRT};
@@ -1496,6 +1669,7 @@ static void init_signals(void)
mysql_cb_init(); // initialize callbacks
}
+
static void start_signal_handler(void)
{
// Save vm id of this process
@@ -1505,7 +1679,12 @@ static void start_signal_handler(void)
}
-/* Warn if the data is on a Traditional volume */
+/*
+ Warn if the data is on a Traditional volume
+
+ NOTE
+ Already done by mysqld_safe
+*/
static void check_data_home(const char *path)
{
@@ -1955,6 +2134,7 @@ extern "C" pthread_handler_decl(handle_shutdown,arg)
return 0;
}
+
int STDCALL handle_kill(ulong ctrl_type)
{
if (ctrl_type == CTRL_CLOSE_EVENT ||
@@ -2115,18 +2295,11 @@ static int init_common_variables(const char *conf_file_name, int argc,
strmake(pidfile_name, glob_hostname, sizeof(pidfile_name)-5);
strmov(fn_ext(pidfile_name),".pid"); // Add proper extension
-#ifndef DBUG_OFF
- if (!*(MYSQL_SERVER_SUFFIX))
- strmov(strend(server_version),"-debug");
- else
-#endif
- strmov(strend(server_version),MYSQL_SERVER_SUFFIX);
-
load_defaults(conf_file_name, groups, &argc, &argv);
defaults_argv=argv;
get_options(argc,argv);
- if (opt_log || opt_update_log || opt_slow_log || opt_bin_log)
- strcat(server_version,"-log");
+ set_server_version();
+
DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname,
server_version, SYSTEM_TYPE,MACHINE_TYPE));
@@ -2657,14 +2830,14 @@ You should consider changing lower_case_table_names to 1 or 2",
switch (server_id) {
case 1:
sql_print_error("\
-Warning: You have enabled the binary log, but you haven't set server-id:\n\
-Updates will be logged to the binary log, but connections to slaves will\n\
-not be accepted.");
+Warning: You have enabled the binary log, but you haven't set server-id to \
+a non-zero value: we force server id to 1; updates will be logged to the \
+binary log, but connections from slaves will not be accepted.");
break;
case 2:
sql_print_error("\
-Warning: You should set server-id to a non-0 value if master_host is set.\n\
-The server will not act as a slave.");
+Warning: You should set server-id to a non-0 value if master_host is set; \
+we force server id to 2, but this MySQL server will not act as a slave.");
break;
}
#endif
@@ -3802,8 +3975,8 @@ enum options_mysqld
OPT_TIME_FORMAT,
OPT_DATETIME_FORMAT,
OPT_LOG_QUERIES_NOT_USING_INDEXES,
- OPT_PLAN_SEARCH_DEPTH,
- OPT_HEURISTIC
+ OPT_OPTIMIZER_SEARCH_DEPTH,
+ OPT_OPTIMIZER_PRUNE_LEVEL
};
@@ -4428,11 +4601,6 @@ log and this option does nothing anymore.",
"Use stopwords from this file instead of built-in list.",
(gptr*) &ft_stopword_file, (gptr*) &ft_stopword_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"heuristic", OPT_HEURISTIC,
- "Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on rows and read time.",
- (gptr*) &global_system_variables.heuristic,
- (gptr*) &max_system_variables.heuristic,
- 0, GET_ULONG, OPT_ARG, 1, 0, 1, 0, 1, 0},
#ifdef HAVE_INNOBASE_DB
{"innodb_mirrored_log_groups", OPT_INNODB_MIRRORED_LOG_GROUPS,
"Number of identical copies of log groups we keep for the database. Currently this should be set to 1.",
@@ -4673,10 +4841,15 @@ The minimum value for this variable is 4096.",
"If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of files.",
(gptr*) &open_files_limit, (gptr*) &open_files_limit, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, OS_FILE_LIMIT, 0, 1, 0},
- {"plan_search_depth", OPT_PLAN_SEARCH_DEPTH,
+ {"optimizer_prune_level", OPT_OPTIMIZER_PRUNE_LEVEL,
+ "Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows.",
+ (gptr*) &global_system_variables.optimizer_prune_level,
+ (gptr*) &max_system_variables.optimizer_prune_level,
+ 0, GET_ULONG, OPT_ARG, 1, 0, 1, 0, 1, 0},
+ {"optimizer_search_depth", OPT_OPTIMIZER_SEARCH_DEPTH,
"Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Smaller values than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to MAX_TABLES+2, the optimizer will switch to the original find_best (used for testing/comparison).",
- (gptr*) &global_system_variables.plan_search_depth,
- (gptr*) &max_system_variables.plan_search_depth,
+ (gptr*) &global_system_variables.optimizer_search_depth,
+ (gptr*) &max_system_variables.optimizer_search_depth,
0, GET_ULONG, OPT_ARG, MAX_TABLES+1, 0, MAX_TABLES+2, 0, 1, 0},
{"preload_buffer_size", OPT_PRELOAD_BUFFER_SIZE,
"The size of the buffer that is allocated when preloading indexes",
@@ -5040,6 +5213,7 @@ struct show_var_st status_vars[]= {
static void print_version(void)
{
+ set_server_version();
printf("%s Ver %s for %s on %s (%s)\n",my_progname,
server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT);
}
@@ -5556,6 +5730,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_specialflag|=SPECIAL_NO_RESOLVE;
break;
case (int) OPT_SKIP_NETWORKING:
+#if defined(__NETWARE__)
+ sql_perror("Can't start server: skip-networking option is currently not supported on NetWare");
+ exit(1);
+#endif
opt_disable_networking=1;
mysqld_port=0;
break;
@@ -5921,6 +6099,29 @@ static void get_options(int argc,char **argv)
}
+/*
+ Create version name for running mysqld version
+ We automaticly add suffixes -debug, -embedded and -log to the version
+ name to make the version more descriptive.
+ (MYSQL_SERVER_SUFFIX is set by the compilation environment)
+*/
+
+static void set_server_version(void)
+{
+ char *end= strxmov(server_version, MYSQL_SERVER_VERSION,
+ MYSQL_SERVER_SUFFIX_STR, NullS);
+#ifdef EMBEDDED_LIBRARY
+ end= strmov(end, "-embedded");
+#endif
+#ifndef DBUG_OFF
+ if (!strstr(MYSQL_SERVER_SUFFIX_STR, "-debug"))
+ end= strmov(end, "-debug");
+#endif
+ if (opt_log || opt_update_log || opt_slow_log || opt_bin_log)
+ strmov(end, "-log"); // This may slow down system
+}
+
+
static char *get_relative_path(const char *path)
{
if (test_if_hard_path(path) &&
diff --git a/ndb/include/portlib/NdbConstant.hpp b/sql/mysqld_suffix.h
index bd45209d2b5..405c5d855b7 100644
--- a/ndb/include/portlib/NdbConstant.hpp
+++ b/sql/mysqld_suffix.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (C) 2000-2004 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,15 +14,14 @@
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_CONSTANT_HPP
-#define NDB_CONSTANT_HPP
+/*
+ Set MYSQL_SERVER_SUFFIX_STR
+ The following code is quite ugly as there is no portable way to easily set a
+ string to the value of a macro
+*/
-#include <ndb_types.h>
-
-#ifdef NDB_VC98
-#define STATIC_CONST(x) enum { x }
+#ifdef MYSQL_SERVER_SUFFIX
+#define MYSQL_SERVER_SUFFIX_STR STRINGIFY_ARG(MYSQL_SERVER_SUFFIX)
#else
-#define STATIC_CONST(x) static const Uint32 x
-#endif
-
+#define MYSQL_SERVER_SUFFIX_STR MYSQL_SERVER_SUFFIX_DEF
#endif
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 28b9cd79fdd..1ca2a412512 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -646,6 +646,7 @@ QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(THD *thd, TABLE *table, uint key_nr,
{
index= key_nr;
head= table;
+ key_part_info= head->key_info[index].key_part;
my_init_dynamic_array(&ranges, sizeof(QUICK_RANGE*), 16, 16);
if (!no_alloc && !parent_alloc)
@@ -662,7 +663,8 @@ QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(THD *thd, TABLE *table, uint key_nr,
int QUICK_RANGE_SELECT::init()
{
- return (error= file->index_init(index));
+ DBUG_ENTER("QUICK_RANGE_SELECT::init");
+ DBUG_RETURN(error= file->index_init(index));
}
QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT()
@@ -2154,7 +2156,7 @@ tree_or(PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2)
{
/* one tree is index merge tree and another is range tree */
if (tree1->merges.is_empty())
- swap(SEL_TREE*, tree1, tree2);
+ swap_variables(SEL_TREE*, tree1, tree2);
/* add tree2 to tree1->merges, checking if it collapses to ALWAYS */
if (imerge_list_or_tree(param, &tree1->merges, tree2))
@@ -2220,7 +2222,7 @@ key_and(SEL_ARG *key1,SEL_ARG *key2,uint clone_flag)
{
if (key1->part > key2->part)
{
- swap(SEL_ARG *,key1,key2);
+ swap_variables(SEL_ARG *, key1, key2);
clone_flag=swap_clone_flag(clone_flag);
}
// key1->part < key2->part
@@ -2236,7 +2238,7 @@ key_and(SEL_ARG *key1,SEL_ARG *key2,uint clone_flag)
key2->type != SEL_ARG::MAYBE_KEY) ||
key1->type == SEL_ARG::MAYBE_KEY)
{ // Put simple key in key2
- swap(SEL_ARG *,key1,key2);
+ swap_variables(SEL_ARG *, key1, key2);
clone_flag=swap_clone_flag(clone_flag);
}
@@ -2378,7 +2380,7 @@ key_or(SEL_ARG *key1,SEL_ARG *key2)
{
if (key2->use_count == 0 || key1->elements > key2->elements)
{
- swap(SEL_ARG *,key1,key2);
+ swap_variables(SEL_ARG *,key1,key2);
}
else if (!(key1=key1->clone_tree()))
return 0; // OOM
@@ -2619,8 +2621,8 @@ SEL_ARG *
SEL_ARG::insert(SEL_ARG *key)
{
SEL_ARG *element,**par,*last_element;
-
LINT_INIT(par); LINT_INIT(last_element);
+
for (element= this; element != &null_element ; )
{
last_element=element;
@@ -3115,26 +3117,32 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree,
{
if (tmp_min_flag & GEOM_FLAG)
{
- tmp= param->table->file->
- records_in_range((int) keynr, (byte*)(param->min_key),
- min_key_length,
- (ha_rkey_function)(tmp_min_flag ^ GEOM_FLAG),
- (byte *)NullS, 0, HA_READ_KEY_EXACT);
+ key_range min_range;
+ min_range.key= (byte*) param->min_key;
+ min_range.length= min_key_length;
+ /* In this case tmp_min_flag contains the handler-read-function */
+ min_range.flag= (ha_rkey_function) (tmp_min_flag ^ GEOM_FLAG);
+
+ tmp= param->table->file->records_in_range(keynr, &min_range,
+ (key_range*) 0);
}
else
{
- tmp=param->table->file->
- records_in_range((int) keynr,
- (byte*) (!min_key_length ? NullS :
- param->min_key),
- min_key_length,
- tmp_min_flag & NEAR_MIN ?
- HA_READ_AFTER_KEY : HA_READ_KEY_EXACT,
- (byte*) (!max_key_length ? NullS :
- param->max_key),
- max_key_length,
- (tmp_max_flag & NEAR_MAX ?
- HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY));
+ key_range min_range, max_range;
+
+ min_range.key= (byte*) param->min_key;
+ min_range.length= min_key_length;
+ min_range.flag= (tmp_min_flag & NEAR_MIN ? HA_READ_AFTER_KEY :
+ HA_READ_KEY_EXACT);
+ max_range.key= (byte*) param->max_key;
+ max_range.length= max_key_length;
+ max_range.flag= (tmp_max_flag & NEAR_MAX ?
+ HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY);
+ tmp=param->table->file->records_in_range(keynr,
+ (min_key_length ? &min_range :
+ (key_range*) 0),
+ (max_key_length ? &max_range :
+ (key_range*) 0));
}
}
end:
@@ -3563,7 +3571,7 @@ int QUICK_RANGE_SELECT::get_next()
if (range)
{
// Already read through key
- result= file->read_range_next(test(range->flag & EQ_RANGE));
+ result= file->read_range_next();
if (result != HA_ERR_END_OF_FILE)
DBUG_RETURN(result);
}
@@ -3594,6 +3602,7 @@ int QUICK_RANGE_SELECT::get_next()
result= file->read_range_first(range->min_length ? &start_key : 0,
range->max_length ? &end_key : 0,
+ test(range->flag & EQ_RANGE),
sorted);
if (range->flag == (UNIQUE_RANGE | EQ_RANGE))
range=0; // Stop searching
@@ -3871,40 +3880,15 @@ int QUICK_RANGE_SELECT::cmp_next(QUICK_RANGE *range_arg)
int QUICK_RANGE_SELECT::cmp_prev(QUICK_RANGE *range_arg)
{
+ int cmp;
if (range_arg->flag & NO_MIN_RANGE)
return 0; /* key can't be to small */
- KEY_PART *key_part = key_parts;
- uint store_length;
-
- for (char *key = range_arg->min_key, *end = key + range_arg->min_length;
- key < end;
- key += store_length, key_part++)
- {
- int cmp;
- store_length= key_part->store_length;
- if (key_part->null_bit)
- {
- // this key part allows null values; NULL is lower than everything else
- if (*key)
- {
- // the range is expecting a null value
- if (!key_part->field->is_null())
- return 0; // not null -- still inside the range
- continue; // null -- exact match, go to next key part
- }
- else if (key_part->field->is_null())
- return 1; // null -- outside the range
- key++;
- store_length--;
- }
- if ((cmp = key_part->field->key_cmp((byte*) key,
- key_part->length)) > 0)
- return 0;
- if (cmp < 0)
- return 1;
- }
- return (range_arg->flag & NEAR_MIN) ? 1 : 0; // Exact match
+ cmp= key_cmp(key_part_info, (byte*) range_arg->min_key,
+ range_arg->min_length);
+ if (cmp > 0 || cmp == 0 && !(range_arg->flag & NEAR_MIN))
+ return 0;
+ return 1; // outside of range
}
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 30e0fcd7be5..4763600963d 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -148,6 +148,7 @@ protected:
QUICK_RANGE *range;
MEM_ROOT alloc;
KEY_PART *key_parts;
+ KEY_PART_INFO *key_part_info;
int cmp_next(QUICK_RANGE *range);
int cmp_prev(QUICK_RANGE *range);
bool row_in_ranges();
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 4fdcd093132..8c1cd9ce1cb 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -716,7 +716,7 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
static int reckey_in_range(bool max_fl, TABLE_REF *ref, Field* field,
COND *cond, uint range_fl, uint prefix_len)
{
- if (key_cmp(field->table, ref->key_buff, ref->key, prefix_len))
+ if (key_cmp_if_same(field->table, ref->key_buff, ref->key, prefix_len))
return 1;
if (!cond || (range_fl & (max_fl ? NO_MIN_RANGE : NO_MAX_RANGE)))
return 0;
diff --git a/sql/parse_file.cc b/sql/parse_file.cc
index bdf8b6134ec..c2fd69e0767 100644
--- a/sql/parse_file.cc
+++ b/sql/parse_file.cc
@@ -50,27 +50,27 @@ write_escaped_string(IO_CACHE *file, LEX_STRING *val_s)
*/
switch(*ptr) {
case '\\': // escape character
- if (my_b_write(file, "\\\\", 2))
+ if (my_b_append(file, "\\\\", 2))
return TRUE;
break;
case '\n': // parameter value delimiter
- if (my_b_write(file, "\\n", 2))
+ if (my_b_append(file, "\\n", 2))
return TRUE;
break;
case '\0': // problem for some string processing utilites
- if (my_b_write(file, "\\0", 2))
+ if (my_b_append(file, "\\0", 2))
return TRUE;
break;
case 26: // problem for windows utilites (Ctrl-Z)
- if (my_b_write(file, "\\z", 2))
+ if (my_b_append(file, "\\z", 2))
return TRUE;
break;
case '\'': // list of string delimiter
- if (my_b_write(file, "\\\'", 2))
+ if (my_b_append(file, "\\\'", 2))
return TRUE;
break;
default:
- if (my_b_write(file, ptr, 1))
+ if (my_b_append(file, ptr, 1))
return TRUE;
}
}
@@ -106,7 +106,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
case FILE_OPTIONS_STRING:
{
LEX_STRING *val_s= (LEX_STRING *)(base + parameter->offset);
- if (my_b_write(file, val_s->str, val_s->length))
+ if (my_b_append(file, val_s->str, val_s->length))
DBUG_RETURN(TRUE);
break;
}
@@ -119,7 +119,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
case FILE_OPTIONS_ULONGLONG:
{
num.set(*((ulonglong *)(base + parameter->offset)), &my_charset_bin);
- if (my_b_write(file, num.ptr(), num.length()))
+ if (my_b_append(file, num.ptr(), num.length()))
DBUG_RETURN(TRUE);
break;
}
@@ -128,7 +128,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
ulonglong *val_i= (ulonglong *)(base + parameter->offset);
*old_version= (*val_i)++;
num.set(*val_i, &my_charset_bin);
- if (my_b_write(file, num.ptr(), num.length()))
+ if (my_b_append(file, num.ptr(), num.length()))
DBUG_RETURN(TRUE);
break;
}
@@ -141,7 +141,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
get_date(val_s->str, GETDATE_DATE_TIME|GETDATE_GMT|GETDATE_FIXEDLENGTH,
tm);
val_s->length= PARSE_FILE_TIMESTAMPLENGTH;
- if (my_b_write(file, val_s->str, PARSE_FILE_TIMESTAMPLENGTH))
+ if (my_b_append(file, val_s->str, PARSE_FILE_TIMESTAMPLENGTH))
DBUG_RETURN(TRUE);
break;
}
@@ -155,10 +155,10 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
{
num.set((ulonglong)str->length, &my_charset_bin);
// ',' after string to detect list continuation
- if ((!first && my_b_write(file, " ", 1)) ||
- my_b_write(file, "\'", 1) ||
- my_b_write(file, str->str, str->length) ||
- my_b_write(file, "\'", 1))
+ if ((!first && my_b_append(file, " ", 1)) ||
+ my_b_append(file, "\'", 1) ||
+ my_b_append(file, str->str, str->length) ||
+ my_b_append(file, "\'", 1))
{
DBUG_RETURN(TRUE);
}
@@ -222,18 +222,18 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
goto err_w_file;
// write header (file signature)
- if (my_b_write(&file, "TYPE=", 5) ||
- my_b_write(&file, type->str, type->length) ||
- my_b_write(&file, "\n", 1))
+ if (my_b_append(&file, "TYPE=", 5) ||
+ my_b_append(&file, type->str, type->length) ||
+ my_b_append(&file, "\n", 1))
goto err_w_file;
// write parameters to temporary file
for (File_option *param= parameters; param->name.str; param++)
{
- if (my_b_write(&file, param->name.str, param->name.length) ||
- my_b_write(&file, "=", 1) ||
+ if (my_b_append(&file, param->name.str, param->name.length) ||
+ my_b_append(&file, "=", 1) ||
write_parameter(&file, base, param, &old_version) ||
- my_b_write(&file, "\n", 1))
+ my_b_append(&file, "\n", 1))
goto err_w_cache;
}
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 4d0859aed22..b2334b0f356 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -468,6 +468,7 @@ void Protocol::init(THD *thd_arg)
{
thd=thd_arg;
packet= &thd->packet;
+ convert= &thd->convert_buffer;
#ifndef DEBUG_OFF
field_types= 0;
#endif
@@ -704,6 +705,26 @@ bool Protocol_simple::store_null()
#endif
+/*
+ Auxilary function to convert string to the given character set
+ and store in network buffer.
+*/
+
+bool Protocol::store_string_aux(const char *from, uint length,
+ CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
+{
+ /* 'tocs' is set 0 when client issues SET character_set_results=NULL */
+ if (tocs && !my_charset_same(fromcs, tocs) &&
+ fromcs != &my_charset_bin &&
+ tocs != &my_charset_bin)
+ {
+ return convert->copy(from, length, fromcs, tocs) ||
+ net_store_data(convert->ptr(), convert->length());
+ }
+ return net_store_data(from, length);
+}
+
+
bool Protocol_simple::store(const char *from, uint length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
{
@@ -714,15 +735,7 @@ bool Protocol_simple::store(const char *from, uint length,
field_types[field_pos] <= MYSQL_TYPE_GEOMETRY));
field_pos++;
#endif
- if (tocs && !my_charset_same(fromcs, tocs) &&
- (fromcs != &my_charset_bin) &&
- (tocs != &my_charset_bin))
- {
- convert.copy(from, length, fromcs, tocs);
- return net_store_data(convert.ptr(), convert.length());
- }
- else
- return net_store_data(from, length);
+ return store_string_aux(from, length, fromcs, tocs);
}
@@ -737,15 +750,7 @@ bool Protocol_simple::store(const char *from, uint length,
field_types[field_pos] <= MYSQL_TYPE_GEOMETRY));
field_pos++;
#endif
- if (tocs && !my_charset_same(fromcs, tocs) &&
- (fromcs != &my_charset_bin) &&
- (tocs != &my_charset_bin))
- {
- convert.copy(from, length, fromcs, tocs);
- return net_store_data(convert.ptr(), convert.length());
- }
- else
- return net_store_data(from, length);
+ return store_string_aux(from, length, fromcs, tocs);
}
@@ -839,15 +844,7 @@ bool Protocol_simple::store(Field *field)
CHARSET_INFO *tocs= this->thd->variables.character_set_results;
field->val_str(&str);
- if (tocs && !my_charset_same(field->charset(), tocs) &&
- (field->charset() != &my_charset_bin) &&
- (tocs != &my_charset_bin))
- {
- convert.copy(str.ptr(), str.length(), str.charset(), tocs);
- return net_store_data(convert.ptr(), convert.length());
- }
- else
- return net_store_data(str.ptr(), str.length());
+ return store_string_aux(str.ptr(), str.length(), str.charset(), tocs);
}
@@ -960,8 +957,9 @@ void Protocol_prep::prepare_for_resend()
}
-bool Protocol_prep::store(const char *from,uint length, CHARSET_INFO *cs)
+bool Protocol_prep::store(const char *from, uint length, CHARSET_INFO *fromcs)
{
+ CHARSET_INFO *tocs= thd->variables.character_set_results;
#ifndef DEBUG_OFF
DBUG_ASSERT(field_types == 0 ||
field_types[field_pos] == MYSQL_TYPE_DECIMAL ||
@@ -969,7 +967,7 @@ bool Protocol_prep::store(const char *from,uint length, CHARSET_INFO *cs)
field_types[field_pos] <= MYSQL_TYPE_GEOMETRY));
#endif
field_pos++;
- return net_store_data(from, length);
+ return store_string_aux(from, length, fromcs, tocs);
}
bool Protocol_prep::store(const char *from,uint length,
@@ -982,7 +980,7 @@ bool Protocol_prep::store(const char *from,uint length,
field_types[field_pos] <= MYSQL_TYPE_GEOMETRY));
#endif
field_pos++;
- return net_store_data(from, length);
+ return store_string_aux(from, length, fromcs, tocs);
}
bool Protocol_prep::store_null()
diff --git a/sql/protocol.h b/sql/protocol.h
index 52b78a749b3..25efecab712 100644
--- a/sql/protocol.h
+++ b/sql/protocol.h
@@ -30,7 +30,7 @@ class Protocol
protected:
THD *thd;
String *packet;
- String convert;
+ String *convert;
uint field_pos;
#ifndef DEBUG_OFF
enum enum_field_types *field_types;
@@ -42,6 +42,8 @@ protected:
MYSQL_FIELD *next_mysql_field;
MEM_ROOT *alloc;
#endif
+ bool store_string_aux(const char *from, uint length,
+ CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
public:
Protocol() {}
Protocol(THD *thd_arg) { init(thd_arg); }
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index f254ffb3df3..2a5381ae478 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -915,12 +915,14 @@ int load_master_data(THD* thd)
setting active_mi, because init_master_info() sets active_mi with
defaults.
*/
+ int error;
+
if (init_master_info(active_mi, master_info_file, relay_log_info_file,
0))
send_error(thd, ER_MASTER_INFO);
strmake(active_mi->master_log_name, row[0],
sizeof(active_mi->master_log_name));
- active_mi->master_log_pos = strtoull(row[1], (char**) 0, 10);
+ active_mi->master_log_pos= my_strtoll10(row[1], (char**) 0, &error);
/* at least in recent versions, the condition below should be false */
if (active_mi->master_log_pos < BIN_LOG_HEADER_SIZE)
active_mi->master_log_pos = BIN_LOG_HEADER_SIZE;
diff --git a/sql/set_var.cc b/sql/set_var.cc
index cac43836a8f..811c700d527 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -108,6 +108,7 @@ static void fix_max_connections(THD *thd, enum_var_type type);
static int check_max_delayed_threads(THD *thd, set_var *var);
static void fix_thd_mem_root(THD *thd, enum_var_type type);
static void fix_trans_mem_root(THD *thd, enum_var_type type);
+static void fix_server_id(THD *thd, enum_var_type type);
static KEY_CACHE *create_key_cache(const char *name, uint length);
void fix_sql_mode_var(THD *thd, enum_var_type type);
static byte *get_error_count(THD *thd);
@@ -160,7 +161,6 @@ sys_var_str sys_ft_boolean_syntax("ft_boolean_syntax",
sys_update_ftb_syntax,
sys_default_ftb_syntax,
ft_boolean_syntax);
-sys_var_thd_ulong sys_heuristic("heuristic", &SV::heuristic);
sys_var_str sys_init_connect("init_connect", 0,
sys_update_init_connect,
sys_default_init_connect,0);
@@ -263,8 +263,10 @@ sys_var_thd_ulong sys_net_retry_count("net_retry_count",
0, fix_net_retry_count);
sys_var_thd_bool sys_new_mode("new", &SV::new_mode);
sys_var_thd_bool sys_old_passwords("old_passwords", &SV::old_passwords);
-sys_var_thd_ulong sys_plan_search_depth("plan_search_depth",
- &SV::plan_search_depth);
+sys_var_thd_ulong sys_optimizer_prune_level("optimizer_prune_level",
+ &SV::optimizer_prune_level);
+sys_var_thd_ulong sys_optimizer_search_depth("optimizer_search_depth",
+ &SV::optimizer_search_depth);
sys_var_thd_ulong sys_preload_buff_size("preload_buffer_size",
&SV::preload_buff_size);
sys_var_thd_ulong sys_read_buff_size("read_buffer_size",
@@ -311,7 +313,7 @@ sys_query_cache_wlock_invalidate("query_cache_wlock_invalidate",
&SV::query_cache_wlock_invalidate);
#endif /* HAVE_QUERY_CACHE */
sys_var_bool_ptr sys_secure_auth("secure_auth", &opt_secure_auth);
-sys_var_long_ptr sys_server_id("server_id",&server_id);
+sys_var_long_ptr sys_server_id("server_id", &server_id, fix_server_id);
sys_var_bool_ptr sys_slave_compressed_protocol("slave_compressed_protocol",
&opt_slave_compressed_protocol);
#ifdef HAVE_REPLICATION
@@ -445,9 +447,7 @@ sys_var_thd_ulong sys_group_concat_max_len("group_concat_max_len",
sys_var_const_str sys_os("version_compile_os", SYSTEM_TYPE);
/* Global read-only variable describing server license */
-sys_var_const_str sys_license("license", LICENSE);
-
-
+sys_var_const_str sys_license("license", STRINGIFY_ARG(LICENSE));
/*
@@ -491,7 +491,6 @@ sys_var *sys_variables[]=
&sys_ft_boolean_syntax,
&sys_foreign_key_checks,
&sys_group_concat_max_len,
- &sys_heuristic,
&sys_identity,
&sys_init_connect,
&sys_init_slave,
@@ -540,7 +539,8 @@ sys_var *sys_variables[]=
&sys_net_write_timeout,
&sys_new_mode,
&sys_old_passwords,
- &sys_plan_search_depth,
+ &sys_optimizer_prune_level,
+ &sys_optimizer_search_depth,
&sys_preload_buff_size,
&sys_pseudo_thread_id,
&sys_query_alloc_block_size,
@@ -709,7 +709,7 @@ struct show_var_st init_vars[]= {
{sys_log_warnings.name, (char*) &sys_log_warnings, SHOW_SYS},
{sys_long_query_time.name, (char*) &sys_long_query_time, SHOW_SYS},
{sys_low_priority_updates.name, (char*) &sys_low_priority_updates, SHOW_SYS},
- {"lower_case_file_system", (char*) &lower_case_file_system, SHOW_BOOL},
+ {"lower_case_file_system", (char*) &lower_case_file_system, SHOW_MY_BOOL},
{"lower_case_table_names", (char*) &lower_case_table_names, SHOW_INT},
{sys_max_allowed_packet.name,(char*) &sys_max_allowed_packet, SHOW_SYS},
{sys_max_binlog_cache_size.name,(char*) &sys_max_binlog_cache_size, SHOW_SYS},
@@ -750,6 +750,10 @@ struct show_var_st init_vars[]= {
{sys_new_mode.name, (char*) &sys_new_mode, SHOW_SYS},
{sys_old_passwords.name, (char*) &sys_old_passwords, SHOW_SYS},
{"open_files_limit", (char*) &open_files_limit, SHOW_LONG},
+ {sys_optimizer_prune_level.name, (char*) &sys_optimizer_prune_level,
+ SHOW_SYS},
+ {sys_optimizer_search_depth.name,(char*) &sys_optimizer_search_depth,
+ SHOW_SYS},
{"pid_file", (char*) pidfile_name, SHOW_CHAR},
{"port", (char*) &mysqld_port, SHOW_INT},
{sys_preload_buff_size.name, (char*) &sys_preload_buff_size, SHOW_SYS},
@@ -817,8 +821,6 @@ struct show_var_st init_vars[]= {
{"version_compile_machine", (char*) MACHINE_TYPE, SHOW_CHAR},
{sys_os.name, (char*) &sys_os, SHOW_SYS},
{sys_net_wait_timeout.name, (char*) &sys_net_wait_timeout, SHOW_SYS},
- {sys_heuristic.name, (char*) &sys_heuristic, SHOW_SYS},
- {sys_plan_search_depth.name,(char*) &sys_plan_search_depth, SHOW_SYS},
{NullS, NullS, SHOW_LONG}
};
@@ -1142,6 +1144,13 @@ static void fix_trans_mem_root(THD *thd, enum_var_type type)
thd->variables.trans_prealloc_size);
}
+
+static void fix_server_id(THD *thd, enum_var_type type)
+{
+ server_id_supplied = 1;
+}
+
+
bool sys_var_long_ptr::update(THD *thd, set_var *var)
{
ulonglong tmp= var->save_result.ulonglong_value;
@@ -1301,11 +1310,11 @@ bool sys_var_thd_ulonglong::update(THD *thd, set_var *var)
{
ulonglong tmp= var->save_result.ulonglong_value;
- if ((ulonglong) tmp > max_system_variables.*offset)
+ if (tmp > max_system_variables.*offset)
tmp= max_system_variables.*offset;
if (option_limits)
- tmp= (ulong) getopt_ull_limit_value(tmp, option_limits);
+ tmp= getopt_ull_limit_value(tmp, option_limits);
if (var->type == OPT_GLOBAL)
{
/* Lock is needed to make things safe on 32 bit systems */
diff --git a/sql/slave.cc b/sql/slave.cc
index f588e034a10..d652ad0e664 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -165,13 +165,11 @@ int init_slave()
goto err;
}
- /*
- make sure slave thread gets started if server_id is set,
- valid master.info is present, and master_host has not been specified
- */
if (server_id && !master_host && active_mi->host[0])
master_host= active_mi->host;
+ /* If server id is not set, start_slave_thread() will say it */
+
if (master_host && !opt_skip_slave_start)
{
if (start_slave_threads(1 /* need mutex */,
@@ -2694,9 +2692,15 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
set_slave_thread_options(thd);
/*
It's nonsense to constrain the slave threads with max_join_size; if a
- query succeeded on master, we HAVE to execute it.
+ query succeeded on master, we HAVE to execute it. So set
+ OPTION_BIG_SELECTS. Setting max_join_size to HA_POS_ERROR is not enough
+ (and it's not needed if we have OPTION_BIG_SELECTS) because an INSERT
+ SELECT examining more than 4 billion rows would still fail (yes, because
+ when max_join_size is 4G, OPTION_BIG_SELECTS is automatically set, but
+ only for client threads.
*/
- thd->variables.max_join_size= HA_POS_ERROR;
+ thd->options = ((opt_log_slave_updates) ? OPTION_BIN_LOG:0) |
+ OPTION_AUTO_IS_NULL | OPTION_BIG_SELECTS;
thd->client_capabilities = CLIENT_LOCAL_FILES;
thd->real_id=pthread_self();
pthread_mutex_lock(&LOCK_thread_count);
@@ -3403,6 +3407,7 @@ err:
IO_RPL_LOG_NAME, llstr(mi->master_log_pos,llbuff));
VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query = thd->db = 0; // extra safety
+ thd->query_length = 0;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
if (mysql)
{
@@ -3599,6 +3604,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
variables is supposed to set them to 0 before terminating)).
*/
thd->query= thd->db= thd->catalog= 0;
+ thd->query_length = 0;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
thd->proc_info = "Waiting for slave mutex on exit";
pthread_mutex_lock(&rli->run_lock);
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 96e340fa745..c22e57830f8 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -186,8 +186,8 @@ sp_head::operator new(size_t size)
bzero((char *)&own_root, sizeof(own_root));
init_alloc_root(&own_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC);
sp= (sp_head *)alloc_root(&own_root, size);
- sp->m_mem_root= own_root;
-
+ sp->mem_root= own_root;
+ DBUG_PRINT("info", ("mem_root 0x%lx", (ulong) &sp->mem_root));
DBUG_RETURN(sp);
}
@@ -198,16 +198,18 @@ sp_head::operator delete(void *ptr, size_t size)
MEM_ROOT own_root;
sp_head *sp= (sp_head *)ptr;
- DBUG_PRINT("info", ("root: %lx", &sp->m_mem_root));
- memcpy(&own_root, (const void *)&sp->m_mem_root, sizeof(MEM_ROOT));
+ memcpy(&own_root, (const void *)&sp->mem_root, sizeof(MEM_ROOT));
+ DBUG_PRINT("info", ("mem_root 0x%lx moved to 0x%lx",
+ (ulong) &sp->mem_root, (ulong) &own_root));
free_root(&own_root, MYF(0));
DBUG_VOID_RETURN;
}
+
sp_head::sp_head()
- : Sql_alloc(), m_returns_cs(NULL), m_has_return(FALSE), m_simple_case(FALSE),
- m_multi_results(FALSE), m_free_list(NULL)
+ :Item_arena((bool)FALSE), m_returns_cs(NULL), m_has_return(FALSE),
+ m_simple_case(FALSE), m_multi_results(FALSE)
{
DBUG_ENTER("sp_head::sp_head");
@@ -216,6 +218,7 @@ sp_head::sp_head()
DBUG_VOID_RETURN;
}
+
void
sp_head::init(LEX *lex)
{
@@ -359,7 +362,7 @@ sp_head::destroy()
delete i;
delete_dynamic(&m_instr);
m_pcont->destroy();
- free_items(m_free_list);
+ free_items(free_list);
while ((lex= (LEX *)m_lex.pop()))
{
if (lex != &m_thd->main_lex) // We got interrupted and have lex'es left
@@ -392,6 +395,7 @@ sp_head::execute(THD *thd)
if (ctx)
ctx->clear_handler();
thd->query_error= 0;
+ thd->current_arena= this;
do
{
sp_instr *i;
@@ -402,6 +406,8 @@ sp_head::execute(THD *thd)
break;
DBUG_PRINT("execute", ("Instruction %u", ip));
ret= i->execute(thd, &ip);
+ if (i->free_list)
+ cleanup_items(i->free_list);
// Check if an exception has occurred and a handler has been found
// Note: We havo to check even if ret==0, since warnings (and some
// errors don't return a non-zero value.
@@ -430,6 +436,11 @@ sp_head::execute(THD *thd)
done:
DBUG_PRINT("info", ("ret=%d killed=%d query_error=%d",
ret, thd->killed, thd->query_error));
+
+ if (thd->current_arena)
+ cleanup_items(thd->current_arena->free_list);
+ thd->current_arena= 0;
+
if (thd->killed || thd->query_error || thd->net.report_error)
ret= -1;
/* If the DB has changed, the pointer has changed too, but the
@@ -687,21 +698,6 @@ sp_head::restore_lex(THD *thd)
// Update some state in the old one first
oldlex->ptr= sublex->ptr;
oldlex->next_state= sublex->next_state;
- for (sl= sublex->all_selects_list ;
- sl ;
- sl= sl->next_select_in_list())
- {
- // Save WHERE clause pointers to avoid damaging by optimisation
- sl->prep_where= sl->where;
- if (sl->with_wild)
- {
- // Copy item_list. We will restore it before calling the
- // sub-statement, so it's ok to pop them.
- sl->item_list_copy.empty();
- while (Item *it= sl->item_list.pop())
- sl->item_list_copy.push_back(it);
- }
- }
// Collect some data from the sub statement lex.
sp_merge_funs(oldlex, sublex);
@@ -792,19 +788,19 @@ sp_head::set_info(char *definer, uint definerlen,
if (! p)
p= definer; // Weird...
len= p-definer;
- m_definer_user.str= strmake_root(&m_mem_root, definer, len);
+ m_definer_user.str= strmake_root(&mem_root, definer, len);
m_definer_user.length= len;
len= definerlen-len-1;
- m_definer_host.str= strmake_root(&m_mem_root, p+1, len);
+ m_definer_host.str= strmake_root(&mem_root, p+1, len);
m_definer_host.length= len;
m_created= created;
m_modified= modified;
- m_chistics= (st_sp_chistics *)alloc_root(&m_mem_root, sizeof(st_sp_chistics));
+ m_chistics= (st_sp_chistics *)alloc_root(&mem_root, sizeof(st_sp_chistics));
memcpy(m_chistics, chistics, sizeof(st_sp_chistics));
if (m_chistics->comment.length == 0)
m_chistics->comment.str= 0;
else
- m_chistics->comment.str= strmake_root(&m_mem_root,
+ m_chistics->comment.str= strmake_root(&mem_root,
m_chistics->comment.str,
m_chistics->comment.length);
}
@@ -812,26 +808,33 @@ sp_head::set_info(char *definer, uint definerlen,
void
sp_head::reset_thd_mem_root(THD *thd)
{
+ DBUG_ENTER("sp_head::reset_thd_mem_root");
m_thd_root= thd->mem_root;
- thd->mem_root= m_mem_root;
- m_free_list= thd->free_list; // Keep the old list
+ thd->mem_root= mem_root;
+ DBUG_PRINT("info", ("mem_root 0x%lx moved to thd mem root 0x%lx",
+ (ulong) &mem_root, (ulong) &thd->mem_root));
+ free_list= thd->free_list; // Keep the old list
thd->free_list= NULL; // Start a new one
/* Copy the db, since substatements will point to it */
m_thd_db= thd->db;
thd->db= strmake_root(&thd->mem_root, thd->db, thd->db_length);
m_thd= thd;
+ DBUG_VOID_RETURN;
}
void
sp_head::restore_thd_mem_root(THD *thd)
{
- Item *flist= m_free_list; // The old list
- m_free_list= thd->free_list; // Get the new one
+ DBUG_ENTER("sp_head::restore_thd_mem_root");
+ Item *flist= free_list; // The old list
+ set_item_arena(thd); // Get new fre_list and mem_root
+ DBUG_PRINT("info", ("mem_root 0x%lx returned from thd mem root 0x%lx",
+ (ulong) &mem_root, (ulong) &thd->mem_root));
thd->free_list= flist; // Restore the old one
thd->db= m_thd_db; // Restore the original db pointer
- m_mem_root= thd->mem_root;
thd->mem_root= m_thd_root;
m_thd= NULL;
+ DBUG_VOID_RETURN;
}
@@ -861,6 +864,23 @@ sp_head::show_create_procedure(THD *thd)
DBUG_RETURN(res);
}
+
+/*
+ Add instruction to SP
+
+ SYNOPSIS
+ sp_head::add_instr()
+ instr Instruction
+*/
+
+void sp_head::add_instr(sp_instr *instr)
+{
+ instr->free_list= m_thd->free_list;
+ m_thd->free_list= 0;
+ insert_dynamic(&m_instr, (gptr)&instr);
+}
+
+
int
sp_head::show_create_function(THD *thd)
{
@@ -919,7 +939,6 @@ int
sp_instr_stmt::exec_stmt(THD *thd, LEX *lex)
{
LEX *olex; // The other lex
- Item *freelist;
SELECT_LEX *sl;
int res;
@@ -927,94 +946,24 @@ sp_instr_stmt::exec_stmt(THD *thd, LEX *lex)
thd->lex= lex; // Use my own lex
thd->lex->thd = thd; // QQ Not reentrant!
thd->lex->unit.thd= thd; // QQ Not reentrant
- freelist= thd->free_list;
thd->free_list= NULL;
VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_id= query_id++;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
- // Copy WHERE clause pointers to avoid damaging by optimisation
- // Also clear ref_pointer_arrays.
- for (sl= lex->all_selects_list ;
- sl ;
- sl= sl->next_select_in_list())
- {
- if (lex->sql_command == SQLCOM_CREATE_TABLE ||
- lex->sql_command == SQLCOM_INSERT_SELECT)
- { // Destroys sl->table_list.first
- sl->table_list_first_copy= sl->table_list.first;
- }
- if (sl->with_wild)
- {
- // Restore item_list
- // Note: We have to do this before executing the sub-statement,
- // to make sure that the list nodes are in the right
- // memroot.
- List_iterator_fast<Item> li(sl->item_list_copy);
-
- sl->item_list.empty();
- while (Item *it= li++)
- sl->item_list.push_back(it);
- }
- sl->ref_pointer_array= 0;
- if (sl->prep_where)
- sl->where= sl->prep_where->copy_andor_structure(thd);
- for (ORDER *order= (ORDER *)sl->order_list.first ;
- order ;
- order= order->next)
- {
- order->item_copy= order->item;
- }
- for (ORDER *group= (ORDER *)sl->group_list.first ;
- group ;
- group= group->next)
- {
- group->item_copy= group->item;
- }
- }
+ reset_stmt_for_execute(thd, lex);
res= mysql_execute_command(thd);
+ lex->unit.cleanup();
if (thd->lock || thd->open_tables || thd->derived_tables)
{
thd->proc_info="closing tables";
close_thread_tables(thd); /* Free tables */
}
- for (sl= lex->all_selects_list ;
- sl ;
- sl= sl->next_select_in_list())
- {
- TABLE_LIST *tabs;
-
- if (lex->sql_command == SQLCOM_CREATE_TABLE ||
- lex->sql_command == SQLCOM_INSERT_SELECT)
- { // Restore sl->table_list.first
- sl->table_list.first= sl->table_list_first_copy;
- }
- // We have closed all tables, get rid of pointers to them
- for (tabs=(TABLE_LIST *)sl->table_list.first ;
- tabs ;
- tabs= tabs->next)
- {
- tabs->table= NULL;
- }
- for (ORDER *order= (ORDER *)sl->order_list.first ;
- order ;
- order= order->next)
- {
- order->item= order->item_copy;
- }
- for (ORDER *group= (ORDER *)sl->group_list.first ;
- group ;
- group= group->next)
- {
- group->item= group->item_copy;
- }
- }
thd->lex= olex; // Restore the other lex
- thd->free_list= freelist;
return res;
}
diff --git a/sql/sp_head.h b/sql/sp_head.h
index cb2e56adabe..e9ec7068783 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -70,7 +70,7 @@ sp_name *
sp_name_current_db_new(THD *thd, LEX_STRING name);
-class sp_head : public Sql_alloc
+class sp_head :private Item_arena
{
sp_head(const sp_head &); /* Prevent use of these */
void operator=(sp_head &);
@@ -108,7 +108,7 @@ public:
static void *
operator new(size_t size);
- static void
+ static void
operator delete(void *ptr, size_t size);
sp_head();
@@ -123,7 +123,7 @@ public:
int
create(THD *thd);
-
+
virtual ~sp_head();
// Free memory
@@ -142,11 +142,8 @@ public:
int
show_create_function(THD *thd);
- inline void
- add_instr(sp_instr *i)
- {
- insert_dynamic(&m_instr, (gptr)&i);
- }
+ void
+ add_instr(sp_instr *instr);
inline uint
instructions()
@@ -206,9 +203,7 @@ public:
private:
- MEM_ROOT m_mem_root; // My own mem_root
MEM_ROOT m_thd_root; // Temp. store for thd's mem_root
- Item *m_free_list; // Where the items go
THD *m_thd; // Set if we have reset mem_root
char *m_thd_db; // Original thd->db pointer
@@ -251,13 +246,15 @@ class sp_instr : public Sql_alloc
public:
+ Item *free_list; // My Items
+
// Should give each a name or type code for debugging purposes?
sp_instr(uint ip)
- : Sql_alloc(), m_ip(ip)
+ :Sql_alloc(), free_list(0), m_ip(ip)
{}
virtual ~sp_instr()
- {}
+ { free_items(free_list); }
// Execute this instrution. '*nextp' will be set to the index of the next
// instruction to execute. (For most instruction this will be the
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index b532da9006e..dfd54d66fa0 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1033,7 +1033,7 @@ ulong acl_get(const char *host, const char *ip,
end=strmov((tmp_db=strmov(strmov(key, ip ? ip : "")+1,user)+1),db);
if (lower_case_table_names)
{
- my_casedn_str(&my_charset_latin1, tmp_db);
+ my_casedn_str(files_charset_info, tmp_db);
db=tmp_db;
}
key_length=(uint) (end-key);
@@ -1812,8 +1812,8 @@ GRANT_TABLE::GRANT_TABLE(const char *h, const char *d,const char *u,
tname= strdup_root(&memex,t);
if (lower_case_table_names)
{
- my_casedn_str(&my_charset_latin1, db);
- my_casedn_str(&my_charset_latin1, tname);
+ my_casedn_str(files_charset_info, db);
+ my_casedn_str(files_charset_info, tname);
}
key_length =(uint) strlen(d)+(uint) strlen(u)+(uint) strlen(t)+3;
hash_key = (char*) alloc_root(&memex,key_length);
@@ -1847,8 +1847,8 @@ GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs)
}
if (lower_case_table_names)
{
- my_casedn_str(&my_charset_latin1, db);
- my_casedn_str(&my_charset_latin1, tname);
+ my_casedn_str(files_charset_info, db);
+ my_casedn_str(files_charset_info, tname);
}
key_length = ((uint) strlen(db) + (uint) strlen(user) +
(uint) strlen(tname) + 3);
@@ -1899,7 +1899,7 @@ GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs)
}
my_hash_insert(&hash_columns, (byte *) mem_check);
} while (!col_privs->file->index_next(col_privs->record[0]) &&
- !key_cmp(col_privs,key,0,key_len));
+ !key_cmp_if_same(col_privs,key,0,key_len));
}
}
@@ -1997,7 +1997,8 @@ static int replace_column_table(GRANT_TABLE *g_t,
ulong privileges = xx->rights;
bool old_row_exists=0;
key_restore(table,key,0,key_length);
- table->field[4]->store(xx->column.ptr(),xx->column.length(),&my_charset_latin1);
+ table->field[4]->store(xx->column.ptr(),xx->column.length(),
+ &my_charset_latin1);
if (table->file->index_read(table->record[0],(byte*) table->field[0]->ptr,
0, HA_READ_KEY_EXACT))
@@ -2010,9 +2011,10 @@ static int replace_column_table(GRANT_TABLE *g_t,
continue; /* purecov: inspected */
}
old_row_exists = 0;
- restore_record(table,default_values); // Get empty record
+ restore_record(table,default_values); // Get empty record
key_restore(table,key,0,key_length);
- table->field[4]->store(xx->column.ptr(),xx->column.length(), &my_charset_latin1);
+ table->field[4]->store(xx->column.ptr(),xx->column.length(),
+ &my_charset_latin1);
}
else
{
@@ -2120,7 +2122,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
}
}
} while (!table->file->index_next(table->record[0]) &&
- !key_cmp(table,key,0,key_length));
+ !key_cmp_if_same(table,key,0,key_length));
}
end:
@@ -2493,7 +2495,7 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
if (lower_case_table_names && db)
{
strmov(tmp_db,db);
- my_casedn_str(&my_charset_latin1, tmp_db);
+ my_casedn_str(files_charset_info, tmp_db);
db=tmp_db;
}
@@ -3141,7 +3143,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
/* Add first global access grants */
{
- String global(buff,sizeof(buff),&my_charset_latin1);
+ String global(buff,sizeof(buff),system_charset_info);
global.length(0);
global.append("GRANT ",6);
@@ -3166,7 +3168,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
}
}
global.append (" ON *.* TO '",12);
- global.append(lex_user->user.str,lex_user->user.length);
+ global.append(lex_user->user.str, lex_user->user.length,
+ system_charset_info);
global.append ("'@'",3);
global.append(lex_user->host.str,lex_user->host.length);
global.append ('\'');
@@ -3254,7 +3257,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
want_access=acl_db->access;
if (want_access)
{
- String db(buff,sizeof(buff),&my_charset_latin1);
+ String db(buff,sizeof(buff),system_charset_info);
db.length(0);
db.append("GRANT ",6);
@@ -3280,7 +3283,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
db.append (" ON ",4);
append_identifier(thd, &db, acl_db->db, strlen(acl_db->db));
db.append (".* TO '",7);
- db.append(lex_user->user.str,lex_user->user.length);
+ db.append(lex_user->user.str, lex_user->user.length,
+ system_charset_info);
db.append ("'@'",3);
db.append(lex_user->host.str, lex_user->host.length);
db.append ('\'');
@@ -3314,7 +3318,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
ulong table_access= grant_table->privs;
if ((table_access | grant_table->cols) != 0)
{
- String global(buff,sizeof(buff),&my_charset_latin1);
+ String global(buff, sizeof(buff), system_charset_info);
ulong test_access= (table_access | grant_table->cols) & ~GRANT_ACL;
global.length(0);
@@ -3368,7 +3372,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
else
global.append(", ",2);
global.append(grant_column->column,
- grant_column->key_length);
+ grant_column->key_length,
+ system_charset_info);
}
}
if (found_col)
@@ -3384,7 +3389,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
append_identifier(thd, &global, grant_table->tname,
strlen(grant_table->tname));
global.append(" TO '",5);
- global.append(lex_user->user.str,lex_user->user.length);
+ global.append(lex_user->user.str, lex_user->user.length,
+ system_charset_info);
global.append("'@'",3);
global.append(lex_user->host.str,lex_user->host.length);
global.append('\'');
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index 3c9563165fe..68f7d45e81c 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -187,7 +187,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
}
if (str == end && info->integers)
{
- info->ullval = (ulonglong) strtoull(begin ,NULL, 10);
+ char *endpos= (char*) end;
+ int error;
+ info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
if (info->integers == 1)
return 0; // a single number can't be zerofill
info->maybe_zerofill = 1;
@@ -199,7 +201,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
return 0;
if ((str + 1) == end) // number was something like '123[.eE]'
{
- info->ullval = (ulonglong) strtoull(begin, NULL, 10);
+ char *endpos= (char*) str;
+ int error;
+ info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
return 1;
}
if (*str == 'e' || *str == 'E') // number may be something like '1e+50'
@@ -218,7 +222,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
for (str++; *(end - 1) == '0'; end--); // jump over zeros at the end
if (str == end) // number was something like '123.000'
{
- info->ullval = (ulonglong) strtoull(begin, NULL, 10);
+ char *endpos= (char*) str;
+ int error;
+ info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
return 1;
}
for (; str != end && my_isdigit(system_charset_info,*str); str++)
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 190e930deed..e4dc3065b86 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2096,7 +2096,16 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
if (field_name && item->type() == Item::FIELD_ITEM)
{
Item_field *item_field= (Item_field*) item;
- if (!my_strcasecmp(system_charset_info, item_field->name, field_name))
+ /*
+ In case of group_concat() with ORDER BY condition in the QUERY
+ item_field can be field of temporary table without item name
+ (if this field created from expression argument of group_concat()),
+ => we have to check presence of name before compare
+ */
+ if (item_field->name &&
+ (!my_strcasecmp(system_charset_info, item_field->name, field_name) ||
+ !my_strcasecmp(system_charset_info,
+ item_field->field_name, field_name)))
{
if (!table_name)
{
@@ -2158,14 +2167,14 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
{
if (!wild_num)
return 0;
- Statement *stmt= thd->current_statement, backup;
+ Item_arena *arena= thd->current_arena, backup;
/*
If we are in preparing prepared statement phase then we have change
temporary mem_root to statement mem root to save changes of SELECT list
*/
- if (stmt)
- thd->set_n_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->set_n_backup_item_arena(arena, &backup);
reg2 Item *item;
List_iterator<Item> it(fields);
while ( wild_num && (item= it++))
@@ -2178,8 +2187,8 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
if (insert_fields(thd,tables,((Item_field*) item)->db_name,
((Item_field*) item)->table_name, &it))
{
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->restore_backup_item_arena(arena, &backup);
return (-1);
}
if (sum_func_list)
@@ -2194,8 +2203,15 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
wild_num--;
}
}
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
+ if (arena)
+ {
+ /* make * substituting permanent */
+ SELECT_LEX *select_lex= thd->lex->current_select;
+ select_lex->with_wild= 0;
+ select_lex->item_list= fields;
+
+ thd->restore_backup_item_arena(arena, &backup);
+ }
return 0;
}
@@ -2408,12 +2424,17 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name,
int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
{
table_map not_null_tables= 0;
- Statement *stmt= thd->current_statement, backup;
-
+ SELECT_LEX *select_lex= thd->lex->current_select;
+ Item_arena *arena= ((thd->current_arena &&
+ !select_lex->conds_processed_with_permanent_arena) ?
+ thd->current_arena :
+ 0);
+ Item_arena backup;
DBUG_ENTER("setup_conds");
+
thd->set_query_id=1;
- thd->lex->current_select->cond_count= 0;
+ select_lex->cond_count= 0;
if (*conds)
{
thd->where="where clause";
@@ -2436,7 +2457,7 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
table->on_expr->fix_fields(thd, tables, &table->on_expr) ||
table->on_expr->check_cols(1))
DBUG_RETURN(1);
- thd->lex->current_select->cond_count++;
+ select_lex->cond_count++;
/*
If it's a normal join or a LEFT JOIN which can be optimized away
@@ -2447,12 +2468,12 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
!(specialflag & SPECIAL_NO_NEW_FUNC)))
{
table->outer_join= 0;
- if (stmt)
- thd->set_n_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->set_n_backup_item_arena(arena, &backup);
*conds= and_conds(*conds, table->on_expr);
table->on_expr=0;
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->restore_backup_item_arena(arena, &backup);
if ((*conds) && !(*conds)->fixed &&
(*conds)->fix_fields(thd, tables, conds))
DBUG_RETURN(1);
@@ -2460,8 +2481,8 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
}
if (table->natural_join)
{
- if (stmt)
- thd->set_n_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->set_n_backup_item_arena(arena, &backup);
/* Make a join of all fields with have the same name */
TABLE *t1= table->table;
TABLE *t2= table->natural_join->table;
@@ -2491,7 +2512,7 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
t2->used_keys.intersect(t2_field->part_of_key);
}
}
- thd->lex->current_select->cond_count+= cond_and->list.elements;
+ select_lex->cond_count+= cond_and->list.elements;
// to prevent natural join processing during PS re-execution
table->natural_join= 0;
@@ -2500,8 +2521,8 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
{
*conds= and_conds(*conds, cond_and);
// fix_fields() should be made with temporary memory pool
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->restore_backup_item_arena(arena, &backup);
if (*conds && !(*conds)->fixed)
{
if ((*conds)->fix_fields(thd, tables, conds))
@@ -2512,8 +2533,8 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
{
table->on_expr= and_conds(table->on_expr, cond_and);
// fix_fields() should be made with temporary memory pool
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->restore_backup_item_arena(arena, &backup);
if (table->on_expr && !table->on_expr->fixed)
{
if (table->on_expr->fix_fields(thd, tables, &table->on_expr))
@@ -2523,21 +2544,22 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
}
}
- if (stmt)
+ if (arena)
{
/*
We are in prepared statement preparation code => we should store
WHERE clause changing for next executions.
- We do this ON -> WHERE transformation only once per PS statement.
+ We do this ON -> WHERE transformation only once per PS/SP statement.
*/
- thd->lex->current_select->where= *conds;
+ select_lex->where= *conds;
+ select_lex->conds_processed_with_permanent_arena= 1;
}
DBUG_RETURN(test(thd->net.report_error));
err:
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->restore_backup_item_arena(arena, &backup);
DBUG_RETURN(1);
}
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 2cbc1072ebd..50bcca4b57e 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1517,13 +1517,28 @@ ulong Query_cache::init_cache()
VOID(hash_init(&queries, &my_charset_bin, def_query_hash_size, 0, 0,
query_cache_query_get_key, 0, 0));
#ifndef FN_NO_CASE_SENCE
+ /*
+ If lower_case_table_names!=0 then db and table names are already
+ converted to lower case and we can use binary collation for their
+ comparison (no matter if file system case sensitive or not).
+ If we have case-sensitive file system (like on most Unixes) and
+ lower_case_table_names == 0 then we should distinguish my_table
+ and MY_TABLE cases and so again can use binary collation.
+ */
VOID(hash_init(&tables, &my_charset_bin, def_table_hash_size, 0, 0,
query_cache_table_get_key, 0, 0));
#else
- // windows, OS/2 or other case insensitive file names work around
+ /*
+ On windows, OS/2, MacOS X with HFS+ or any other case insensitive
+ file system if lower_case_table_names!=0 we have same situation as
+ in previous case, but if lower_case_table_names==0 then we should
+ not distinguish cases (to be compatible in behavior with underlaying
+ file system) and so should use case insensitive collation for
+ comparison.
+ */
VOID(hash_init(&tables,
lower_case_table_names ? &my_charset_bin :
- system_charset_info,
+ files_charset_info,
def_table_hash_size, 0, 0,query_cache_table_get_key, 0, 0));
#endif
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index f8b2efe911c..7a4f3dff845 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -82,11 +82,84 @@ extern "C" void free_user_var(user_var_entry *entry)
}
+bool key_part_spec::operator==(const key_part_spec& other) const
+{
+ return length == other.length && !strcmp(field_name, other.field_name);
+}
+
+
+/*
+ Test if a foreign key (= generated key) is a prefix of the given key
+ (ignoring key name, key type and order of columns)
+
+ NOTES:
+ This is only used to test if an index for a FOREIGN KEY exists
+
+ IMPLEMENTATION
+ We only compare field names
+
+ RETURN
+ 0 Generated key is a prefix of other key
+ 1 Not equal
+*/
+
+bool foreign_key_prefix(Key *a, Key *b)
+{
+ /* Ensure that 'a' is the generated key */
+ if (a->generated)
+ {
+ if (b->generated && a->columns.elements > b->columns.elements)
+ swap_variables(Key*, a, b); // Put shorter key in 'a'
+ }
+ else
+ {
+ if (!b->generated)
+ return TRUE; // No foreign key
+ swap_variables(Key*, a, b); // Put generated key in 'a'
+ }
+
+ /* Test if 'a' is a prefix of 'b' */
+ if (a->columns.elements > b->columns.elements)
+ return TRUE; // Can't be prefix
+
+ List_iterator<key_part_spec> col_it1(a->columns);
+ List_iterator<key_part_spec> col_it2(b->columns);
+ const key_part_spec *col1, *col2;
+
+#ifdef ENABLE_WHEN_INNODB_CAN_HANDLE_SWAPED_FOREIGN_KEY_COLUMNS
+ while ((col1= col_it1++))
+ {
+ bool found= 0;
+ col_it2.rewind();
+ while ((col2= col_it2++))
+ {
+ if (*col1 == *col2)
+ {
+ found= TRUE;
+ break;
+ }
+ }
+ if (!found)
+ return TRUE; // Error
+ }
+ return FALSE; // Is prefix
+#else
+ while ((col1= col_it1++))
+ {
+ col2= col_it2++;
+ if (!(*col1 == *col2))
+ return TRUE;
+ }
+ return FALSE; // Is prefix
+#endif
+}
+
+
/****************************************************************************
** Thread specific functions
****************************************************************************/
-THD::THD():user_time(0), current_statement(0), is_fatal_error(0),
+THD::THD():user_time(0), current_arena(0), is_fatal_error(0),
last_insert_id_used(0),
insert_id_used(0), rand_used(0), in_lock_tables(0),
global_read_lock(0), bootstrap(0), spcont(NULL)
@@ -447,6 +520,35 @@ bool THD::convert_string(LEX_STRING *to, CHARSET_INFO *to_cs,
/*
+ Convert string from source character set to target character set inplace.
+
+ SYNOPSIS
+ THD::convert_string
+
+ DESCRIPTION
+ Convert string using convert_buffer - buffer for character set
+ conversion shared between all protocols.
+
+ RETURN
+ 0 ok
+ !0 out of memory
+*/
+
+bool THD::convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
+{
+ if (convert_buffer.copy(s->ptr(), s->length(), from_cs, to_cs))
+ return TRUE;
+ /* If convert_buffer >> s copying is more efficient long term */
+ if (convert_buffer.alloced_length() >= convert_buffer.length() * 2 ||
+ !s->is_alloced())
+ {
+ return s->copy(convert_buffer);
+ }
+ s->swap(convert_buffer);
+ return FALSE;
+}
+
+/*
Update some cache variables when character set changes
*/
@@ -1210,23 +1312,47 @@ int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
}
+Item_arena::Item_arena(THD* thd)
+ :free_list(0)
+{
+ init_sql_alloc(&mem_root,
+ thd->variables.query_alloc_block_size,
+ thd->variables.query_prealloc_size);
+}
+
+
+Item_arena::Item_arena()
+ :free_list(0)
+{
+ bzero((char *) &mem_root, sizeof(mem_root));
+}
+
+
+Item_arena::Item_arena(bool init_mem_root)
+ :free_list(0)
+{
+ if (init_mem_root)
+ bzero((char *) &mem_root, sizeof(mem_root));
+}
+
+
+Item_arena::~Item_arena()
+{}
+
+
/*
Statement functions
*/
Statement::Statement(THD *thd)
- :id(++thd->statement_id_counter),
+ :Item_arena(thd),
+ id(++thd->statement_id_counter),
set_query_id(1),
allow_sum_func(0),
lex(&main_lex),
query(0),
- query_length(0),
- free_list(0)
-{
- init_sql_alloc(&mem_root,
- thd->variables.query_alloc_block_size,
- thd->variables.query_prealloc_size);
-}
+ query_length(0)
+{}
/*
This constructor is called when statement is a subobject of THD:
@@ -1235,15 +1361,14 @@ Statement::Statement(THD *thd)
*/
Statement::Statement()
- :id(0),
+ :Item_arena(),
+ id(0),
set_query_id(1),
allow_sum_func(0), /* initialized later */
lex(&main_lex),
query(0), /* these two are set */
- query_length(0), /* in alloc_query() */
- free_list(0)
+ query_length(0) /* in alloc_query() */
{
- bzero((char *) &mem_root, sizeof(mem_root));
}
@@ -1264,14 +1389,14 @@ void Statement::set_statement(Statement *stmt)
}
-void Statement::set_n_backup_item_arena(Statement *set, Statement *backup)
+void Item_arena::set_n_backup_item_arena(Item_arena *set, Item_arena *backup)
{
backup->set_item_arena(this);
set_item_arena(set);
}
-void Statement::restore_backup_item_arena(Statement *set, Statement *backup)
+void Item_arena::restore_backup_item_arena(Item_arena *set, Item_arena *backup)
{
set->set_item_arena(this);
set_item_arena(backup);
@@ -1279,7 +1404,7 @@ void Statement::restore_backup_item_arena(Statement *set, Statement *backup)
init_alloc_root(&backup->mem_root, 0, 0);
}
-void Statement::set_item_arena(Statement *set)
+void Item_arena::set_item_arena(Item_arena *set)
{
mem_root= set->mem_root;
free_list= set->free_list;
diff --git a/sql/sql_class.h b/sql/sql_class.h
index cb8da885b77..1e9b1d04351 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -31,7 +31,7 @@ class sp_rcontext;
class sp_cache;
enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE };
-enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY };
+enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME };
enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_IGNORE, DUP_UPDATE };
enum enum_log_type { LOG_CLOSED, LOG_TO_BE_OPENED, LOG_NORMAL, LOG_NEW, LOG_BIN};
enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON,
@@ -233,6 +233,7 @@ public:
const char *field_name;
uint length;
key_part_spec(const char *name,uint len=0) :field_name(name), length(len) {}
+ bool operator==(const key_part_spec& other) const;
};
@@ -262,12 +263,16 @@ public:
enum ha_key_alg algorithm;
List<key_part_spec> columns;
const char *name;
+ bool generated;
Key(enum Keytype type_par, const char *name_arg, enum ha_key_alg alg_par,
- List<key_part_spec> &cols)
- :type(type_par), algorithm(alg_par), columns(cols), name(name_arg)
+ bool generated_arg, List<key_part_spec> &cols)
+ :type(type_par), algorithm(alg_par), columns(cols), name(name_arg),
+ generated(generated_arg)
{}
~Key() {}
+ /* Equality comparison of keys (ignoring name) */
+ friend bool foreign_key_prefix(Key *a, Key *b);
};
class Table_ident;
@@ -285,7 +290,7 @@ public:
foreign_key(const char *name_arg, List<key_part_spec> &cols,
Table_ident *table, List<key_part_spec> &ref_cols,
uint delete_opt_arg, uint update_opt_arg, uint match_opt_arg)
- :Key(FOREIGN_KEY, name_arg, HA_KEY_ALG_UNDEF, cols),
+ :Key(FOREIGN_KEY, name_arg, HA_KEY_ALG_UNDEF, 0, cols),
ref_table(table), ref_columns(cols),
delete_opt(delete_opt_arg), update_opt(update_opt_arg),
match_opt(match_opt_arg)
@@ -384,6 +389,8 @@ struct system_variables
ulong net_retry_count;
ulong net_wait_timeout;
ulong net_write_timeout;
+ ulong optimizer_prune_level;
+ ulong optimizer_search_depth;
ulong preload_buff_size;
ulong query_cache_type;
ulong read_buff_size;
@@ -392,8 +399,6 @@ struct system_variables
ulong table_type;
ulong tmp_table_size;
ulong tx_isolation;
- ulong heuristic;
- ulong plan_search_depth;
/* Determines which non-standard SQL behaviour should be enabled */
ulong sql_mode;
ulong default_week_format;
@@ -434,6 +439,48 @@ struct system_variables
void free_tmp_table(THD *thd, TABLE *entry);
+class Item_arena
+{
+public:
+ /*
+ List of items created in the parser for this query. Every item puts
+ itself to the list on creation (see Item::Item() for details))
+ */
+ Item *free_list;
+ MEM_ROOT mem_root;
+
+ Item_arena(THD *thd);
+ Item_arena();
+ Item_arena(bool init_mem_root);
+ ~Item_arena();
+
+ inline gptr alloc(unsigned int size) { return alloc_root(&mem_root,size); }
+ inline gptr calloc(unsigned int size)
+ {
+ gptr ptr;
+ if ((ptr=alloc_root(&mem_root,size)))
+ bzero((char*) ptr,size);
+ return ptr;
+ }
+ inline char *strdup(const char *str)
+ { return strdup_root(&mem_root,str); }
+ inline char *strmake(const char *str, uint size)
+ { return strmake_root(&mem_root,str,size); }
+ inline char *memdup(const char *str, uint size)
+ { return memdup_root(&mem_root,str,size); }
+ inline char *memdup_w_gap(const char *str, uint size, uint gap)
+ {
+ gptr ptr;
+ if ((ptr=alloc_root(&mem_root,size+gap)))
+ memcpy(ptr,str,size);
+ return ptr;
+ }
+
+ void set_n_backup_item_arena(Item_arena *set, Item_arena *backup);
+ void restore_backup_item_arena(Item_arena *set, Item_arena *backup);
+ void set_item_arena(Item_arena *set);
+};
+
/*
State of a single command executed against this connection.
One connection can contain a lot of simultaneously running statements,
@@ -448,7 +495,7 @@ void free_tmp_table(THD *thd, TABLE *entry);
be used explicitly.
*/
-class Statement
+class Statement: public Item_arena
{
Statement(const Statement &rhs); /* not implemented: */
Statement &operator=(const Statement &rhs); /* non-copyable */
@@ -489,12 +536,6 @@ public:
*/
char *query;
uint32 query_length; // current query length
- /*
- List of items created in the parser for this query. Every item puts
- itself to the list on creation (see Item::Item() for details))
- */
- Item *free_list;
- MEM_ROOT mem_root;
public:
/* We build without RTTI, so dynamic_cast can't be used. */
@@ -518,31 +559,6 @@ public:
/* return class type */
virtual Type type() const;
- inline gptr alloc(unsigned int size) { return alloc_root(&mem_root,size); }
- inline gptr calloc(unsigned int size)
- {
- gptr ptr;
- if ((ptr=alloc_root(&mem_root,size)))
- bzero((char*) ptr,size);
- return ptr;
- }
- inline char *strdup(const char *str)
- { return strdup_root(&mem_root,str); }
- inline char *strmake(const char *str, uint size)
- { return strmake_root(&mem_root,str,size); }
- inline char *memdup(const char *str, uint size)
- { return memdup_root(&mem_root,str,size); }
- inline char *memdup_w_gap(const char *str, uint size, uint gap)
- {
- gptr ptr;
- if ((ptr=alloc_root(&mem_root,size+gap)))
- memcpy(ptr,str,size);
- return ptr;
- }
-
- void set_n_backup_item_arena(Statement *set, Statement *backup);
- void restore_backup_item_arena(Statement *set, Statement *backup);
- void set_item_arena(Statement *set);
};
@@ -614,11 +630,29 @@ public:
Protocol_prep protocol_prep; // Binary protocol
HASH user_vars; // hash for user variables
String packet; // dynamic buffer for network I/O
+ String convert_buffer; // buffer for charset conversions
struct sockaddr_in remote; // client socket address
struct rand_struct rand; // used for authentication
struct system_variables variables; // Changeable local variables
pthread_mutex_t LOCK_delete; // Locked before thd is deleted
-
+ /*
+ Note that (A) if we set query = NULL, we must at the same time set
+ query_length = 0, and protect the whole operation with the
+ LOCK_thread_count mutex. And (B) we are ONLY allowed to set query to a
+ non-NULL value if its previous value is NULL. We do not need to protect
+ operation (B) with any mutex. To avoid crashes in races, if we do not
+ know that thd->query cannot change at the moment, one should print
+ thd->query like this:
+ (1) reserve the LOCK_thread_count mutex;
+ (2) check if thd->query is NULL;
+ (3) if not NULL, then print at most thd->query_length characters from
+ it. We will see the query_length field as either 0, or the right value
+ for it.
+ Assuming that the write and read of an n-bit memory field in an n-bit
+ computer is atomic, we can avoid races in the above way.
+ This printing is needed at least in SHOW PROCESSLIST and SHOW INNODB
+ STATUS.
+ */
/* all prepared statements and cursors of this connection */
Statement_map stmt_map;
/*
@@ -746,9 +780,9 @@ public:
Vio* active_vio;
#endif
/*
- Current prepared Statement if there one, or 0
+ Current prepared Item_arena if there one, or 0
*/
- Statement *current_statement;
+ Item_arena *current_arena;
/*
next_insert_id is set on SET INSERT_ID= #. This is used as the next
generated auto_increment value in handler.cc
@@ -944,6 +978,9 @@ public:
bool convert_string(LEX_STRING *to, CHARSET_INFO *to_cs,
const char *from, uint from_length,
CHARSET_INFO *from_cs);
+
+ bool convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs);
+
void add_changed_table(TABLE *table);
void add_changed_table(const char *key, long key_length);
CHANGED_TABLE_LIST * changed_table_dup(const char *key, long key_length);
@@ -969,7 +1006,7 @@ public:
inline void allocate_temporary_memory_pool_for_ps_preparing()
{
- DBUG_ASSERT(current_statement!=0);
+ DBUG_ASSERT(current_arena!=0);
/*
We do not want to have in PS memory all that junk,
which will be created by preparation => substitute memory
@@ -978,7 +1015,7 @@ public:
We know that PS memory pool is now copied to THD, we move it back
to allow some code use it.
*/
- current_statement->set_item_arena(this);
+ current_arena->set_item_arena(this);
init_sql_alloc(&mem_root,
variables.query_alloc_block_size,
variables.query_prealloc_size);
@@ -986,12 +1023,16 @@ public:
}
inline void free_temporary_memory_pool_for_ps_preparing()
{
- DBUG_ASSERT(current_statement!=0);
- cleanup_items(current_statement->free_list);
+ DBUG_ASSERT(current_arena!=0);
+ cleanup_items(current_arena->free_list);
free_items(free_list);
close_thread_tables(this); // to close derived tables
free_root(&mem_root, MYF(0));
- set_item_arena(current_statement);
+ set_item_arena(current_arena);
+ }
+ inline bool only_prepare()
+ {
+ return command == COM_PREPARE;
}
};
@@ -1196,7 +1237,6 @@ class select_union :public select_result {
TABLE *table;
COPY_INFO info;
TMP_TABLE_PARAM tmp_table_param;
- bool not_describe;
select_union(TABLE *table_par);
~select_union();
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 300a2a455a4..e2c337e5064 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -18,6 +18,7 @@
/* create and drop of databases */
#include "mysql_priv.h"
+#include <mysys_err.h>
#include "sql_acl.h"
#include "sp.h"
#include <my_dir.h>
@@ -186,7 +187,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
strxmov(path, mysql_data_home, "/", db, NullS);
unpack_dirname(path,path); // Convert if not unix
- if (my_stat(path,&stat_info,MYF(MY_WME)))
+ if (my_stat(path,&stat_info,MYF(0)))
{
if (!(create_options & HA_LEX_CREATE_IF_NOT_EXISTS))
{
@@ -198,6 +199,11 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
}
else
{
+ if (my_errno != ENOENT)
+ {
+ my_error(EE_STAT, MYF(0),path,my_errno);
+ goto exit;
+ }
strend(path)[-1]=0; // Remove last '/' from path
if (my_mkdir(path,0777,MYF(0)) < 0)
{
@@ -365,7 +371,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
{
/* Convert database to lower case */
strmov(tmp_db, db);
- my_casedn_str(system_charset_info, tmp_db);
+ my_casedn_str(files_charset_info, tmp_db);
db= tmp_db;
}
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 9f725c7e17f..b9769e3a940 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -264,10 +264,11 @@ int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
{
TABLE_LIST *delete_table_list= ((TABLE_LIST*) thd->lex->
select_lex.table_list.first);
+ SELECT_LEX *select_lex= &thd->lex->select_lex;
DBUG_ENTER("mysql_prepare_delete");
if (setup_conds(thd, delete_table_list, conds) ||
- setup_ftfuncs(&thd->lex->select_lex))
+ setup_ftfuncs(select_lex))
DBUG_RETURN(-1);
if (find_real_table_in_list(table_list->next,
table_list->db, table_list->real_name))
@@ -275,6 +276,11 @@ int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->real_name);
DBUG_RETURN(-1);
}
+ if (thd->current_arena && select_lex->first_execution)
+ {
+ select_lex->prep_where= select_lex->where;
+ select_lex->first_execution= 0;
+ }
DBUG_RETURN(0);
}
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 2e2ad6786fc..46794f45f3c 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -152,7 +152,7 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
if it is preparation PS only then we do not need real data and we
can skip execution (and parameters is not defined, too)
*/
- if (!thd->current_statement)
+ if (!thd->only_prepare())
{
if (is_union)
{
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 1579ac3b5c8..fcc56cbf9c9 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -103,7 +103,7 @@ int mysql_ha_closeall(THD *thd, TABLE_LIST *tables)
}
static enum enum_ha_read_modes rkey_to_rnext[]=
- { RNEXT, RNEXT, RPREV, RNEXT, RPREV, RNEXT, RPREV, RPREV };
+ { RNEXT_SAME, RNEXT, RPREV, RNEXT, RPREV, RNEXT, RPREV, RPREV };
int mysql_ha_read(THD *thd, TABLE_LIST *tables,
@@ -146,7 +146,12 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
char buff[MAX_FIELD_WIDTH];
String buffer(buff, sizeof(buff), system_charset_info);
uint num_rows;
- it++;
+ byte *key;
+ uint key_len;
+ LINT_INIT(key);
+ LINT_INIT(key_len);
+
+ it++; // Skip first NULL field
insert_fields(thd,tables,tables->db,tables->alias,&it);
@@ -194,13 +199,16 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
DBUG_ASSERT(keyname != 0);
err=table->file->index_prev(table->record[0]);
break;
+ case RNEXT_SAME:
+ /* Continue scan on "(keypart1,keypart2,...)=(c1, c2, ...) */
+ DBUG_ASSERT(keyname != 0);
+ err= table->file->index_next_same(table->record[0], key, key_len);
+ break;
case RKEY:
{
DBUG_ASSERT(keyname != 0);
KEY *keyinfo=table->key_info+keyno;
KEY_PART_INFO *key_part=keyinfo->key_part;
- uint key_len;
- byte *key;
if (key_expr->elements > keyinfo->key_parts)
{
my_printf_error(ER_TOO_MANY_KEY_PARTS,ER(ER_TOO_MANY_KEY_PARTS),
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 5fb525aa9a9..19fb439c5cb 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -408,7 +408,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
(ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
else
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
- (ulong) info.deleted+info.updated, (ulong) thd->cuted_fields);
+ (ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields);
thd->row_count_func= info.copied+info.deleted+info.updated;
::send_ok(thd, thd->row_count_func, (ulonglong)id,buff);
}
@@ -431,7 +431,7 @@ abort:
Prepare items in INSERT statement
SYNOPSIS
- mysql_prepare_update()
+ mysql_prepare_insert()
thd - thread handler
table_list - global table list
insert_table_list - local table list of INSERT SELECT_LEX
@@ -460,6 +460,7 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->real_name);
DBUG_RETURN(-1);
}
+ thd->lex->select_lex.first_execution= 0;
DBUG_RETURN(0);
}
@@ -1579,7 +1580,7 @@ bool select_insert::send_eof()
(ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
else
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
- (ulong) info.deleted+info.updated, (ulong) thd->cuted_fields);
+ (ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields);
thd->row_count_func= info.copied+info.deleted+info.updated;
::send_ok(thd, thd->row_count_func, last_insert_id, buff);
DBUG_RETURN(0);
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 7e38941f344..08b72173cae 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -24,8 +24,6 @@
#include "sp.h"
#include "sp_head.h"
-LEX_STRING tmp_table_alias= {(char*) "tmp-table",8};
-
/* Macros to look like lex */
#define yyGet() *(lex->ptr++)
@@ -997,6 +995,7 @@ void st_select_lex_unit::init_query()
fake_select_lex= 0;
cleaned= 0;
item_list.empty();
+ describe= 0;
found_rows_for_union= 0;
}
@@ -1011,10 +1010,12 @@ void st_select_lex::init_query()
having_fix_field= 0;
resolve_mode= NOMATTER_MODE;
cond_count= with_wild= 0;
+ conds_processed_with_permanent_arena= 0;
ref_pointer_array= 0;
select_n_having_items= 0;
prep_where= 0;
explicit_limit= 0;
+ first_execution= 1;
}
void st_select_lex::init_select()
@@ -1414,7 +1415,9 @@ bool st_select_lex::add_order_to_list(THD *thd, Item *item, bool asc)
bool st_select_lex::add_item_to_list(THD *thd, Item *item)
{
- return item_list.push_back(item);
+ DBUG_ENTER("st_select_lex::add_item_to_list");
+ DBUG_PRINT("info", ("Item: %p", item));
+ DBUG_RETURN(item_list.push_back(item));
}
@@ -1500,12 +1503,12 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
We have to create array in prepared statement memory if it is
prepared statement
*/
- Statement *stmt= thd->current_statement ? thd->current_statement : thd;
+ Item_arena *arena= thd->current_arena ? thd->current_arena : thd;
return (ref_pointer_array=
- (Item **)stmt->alloc(sizeof(Item*) *
- (item_list.elements +
- select_n_having_items +
- order_group_num)* 5)) == 0;
+ (Item **)arena->alloc(sizeof(Item*) *
+ (item_list.elements +
+ select_n_having_items +
+ order_group_num)* 5)) == 0;
}
@@ -1720,6 +1723,7 @@ TABLE_LIST *st_lex::link_first_table_back(TABLE_LIST *tables,
st_select_lex::print is in sql_select.h
st_select_lex_unit::prepare, st_select_lex_unit::exec,
- st_select_lex_unit::cleanup, st_select_lex_unit::reinit_exec_mechanism
+ st_select_lex_unit::cleanup, st_select_lex_unit::reinit_exec_mechanism,
+ st_select_lex_unit::change_result
are in sql_union.cc
*/
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 60965209cc9..8d864c68f25 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -351,6 +351,7 @@ public:
st_select_lex *fake_select_lex;
st_select_lex *union_distinct; /* pointer to the last UNION DISTINCT */
+ bool describe; /* union exec() called for EXPLAIN */
void init_query();
bool create_total_list(THD *thd, st_lex *lex, TABLE_LIST **result);
@@ -383,6 +384,7 @@ public:
void print(String *str);
ulong init_prepare_fake_select_lex(THD *thd);
+ int change_result(select_subselect *result, select_subselect *old_result);
void set_limit(st_select_lex *values, st_select_lex *sl);
friend void mysql_init_query(THD *thd, bool lexonly);
@@ -405,8 +407,6 @@ public:
enum olap_type olap;
SQL_LIST table_list, group_list; /* FROM & GROUP BY clauses */
List<Item> item_list; /* list of fields & expressions */
- List<Item> item_list_copy; /* For SPs */
- byte *table_list_first_copy; /* For SPs */
List<String> interval_list, use_index, *use_index_ptr,
ignore_index, *ignore_index_ptr;
/*
@@ -435,6 +435,11 @@ public:
uint cond_count; /* number of arguments of and/or/xor in where/having */
enum_parsing_place parsing_place; /* where we are parsing expression */
bool with_sum_func; /* sum function indicator */
+ /*
+ PS or SP cond natural joins was alredy processed with permanent
+ arena and all additional items which we need alredy stored in it
+ */
+ bool conds_processed_with_permanent_arena;
ulong table_join_options;
uint in_sum_expr;
@@ -445,6 +450,7 @@ public:
bool having_fix_field;
/* explicit LIMIT clause was used */
bool explicit_limit;
+ bool first_execution; /* first execution in SP or PS */
/*
SELECT for SELECT command st_select_lex. Used to privent scaning
@@ -545,6 +551,20 @@ typedef class st_select_lex SELECT_LEX;
#define ALTER_ORDER 64
#define ALTER_OPTIONS 128
+typedef struct st_alter_info
+{
+ List<Alter_drop> drop_list;
+ List<Alter_column> alter_list;
+ uint flags;
+ enum enum_enable_or_disable keys_onoff;
+ enum tablespace_op_type tablespace_op;
+ bool is_simple;
+
+ st_alter_info(){clear();}
+ void clear(){keys_onoff= LEAVE_AS_IS;tablespace_op= NO_TABLESPACE_OP;}
+ void reset(){drop_list.empty();alter_list.empty();clear();}
+} ALTER_INFO;
+
struct st_sp_chistics
{
LEX_STRING comment;
@@ -585,8 +605,6 @@ typedef struct st_lex
List<key_part_spec> col_list;
List<key_part_spec> ref_list;
- List<Alter_drop> drop_list;
- List<Alter_column> alter_list;
List<String> interval_list;
List<LEX_USER> users_list;
List<LEX_COLUMN> columns;
@@ -614,19 +632,17 @@ typedef struct st_lex
enum enum_tx_isolation tx_isolation;
enum enum_ha_read_modes ha_read_mode;
enum ha_rkey_function ha_rkey_mode;
- enum enum_enable_or_disable alter_keys_onoff;
enum enum_var_type option_type;
- enum tablespace_op_type tablespace_op;
uint uint_geom_type;
uint grant, grant_tot_col, which_columns;
uint fk_delete_opt, fk_update_opt, fk_match_option;
uint slave_thd_opt;
- uint alter_flags;
uint8 describe;
bool drop_if_exists, drop_temporary, local_file;
- bool in_comment, ignore_space, verbose, simple_alter, no_write_to_binlog;
+ bool in_comment, ignore_space, verbose, no_write_to_binlog;
bool derived_tables;
bool safe_to_cache_query;
+ ALTER_INFO alter_info;
sp_head *sphead;
sp_name *spname;
bool sp_lex_in_use; /* Keep track on lex usage in SPs for error handling */
@@ -680,6 +696,4 @@ void lex_end(LEX *lex);
extern pthread_key(LEX*,THR_LEX);
-extern LEX_STRING tmp_table_alias;
-
#define current_lex (current_thd->lex)
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 598f131985c..6e04d00a886 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1493,9 +1493,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
packet++;
length--;
}
+ VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_length= length;
thd->query= packet;
- VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_id= query_id++;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
#ifndef EMBEDDED_LIBRARY
@@ -1511,7 +1511,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->query_rest.length(length);
}
else
- thd->query_rest.copy(length);
+ thd->query_rest.copy(packet, length, thd->query_rest.charset());
break;
#endif /*EMBEDDED_LIBRARY*/
}
@@ -1784,6 +1784,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->proc_info=0;
thd->command=COM_SLEEP;
thd->query=0;
+ thd->query_length=0;
thread_running--;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory
@@ -1824,6 +1825,7 @@ bool alloc_query(THD *thd, char *packet, ulong packet_length)
packet_length--;
}
/* We must allocate some extra memory for query cache */
+ thd->query_length= 0; // Extra safety: Avoid races
if (!(thd->query= (char*) thd->memdup_w_gap((gptr) (packet),
packet_length,
thd->db_length+ 1 +
@@ -1831,7 +1833,10 @@ bool alloc_query(THD *thd, char *packet, ulong packet_length)
return 1;
thd->query[packet_length]=0;
thd->query_length= packet_length;
- thd->packet.shrink(thd->variables.net_buffer_length);// Reclaim some memory
+
+ /* Reclaim some memory */
+ thd->packet.shrink(thd->variables.net_buffer_length);
+ thd->convert_buffer.shrink(thd->variables.net_buffer_length);
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),QUERY_PRIOR);
@@ -2374,14 +2379,10 @@ unsent_create_error:
res= mysql_alter_table(thd, select_lex->db, lex->name,
&lex->create_info,
tables, lex->create_list,
- lex->key_list, lex->drop_list, lex->alter_list,
+ lex->key_list,
select_lex->order_list.elements,
(ORDER *) select_lex->order_list.first,
- lex->alter_flags,
- lex->duplicates,
- lex->alter_keys_onoff,
- lex->tablespace_op,
- lex->simple_alter);
+ lex->duplicates, &lex->alter_info);
}
break;
}
@@ -2518,17 +2519,15 @@ unsent_create_error:
lex->create_list.empty();
lex->key_list.empty();
lex->col_list.empty();
- lex->drop_list.empty();
- lex->alter_list.empty();
+ lex->alter_info.reset();
bzero((char*) &create_info,sizeof(create_info));
create_info.db_type=DB_TYPE_DEFAULT;
create_info.row_type=ROW_TYPE_DEFAULT;
create_info.default_table_charset=default_charset_info;
res= mysql_alter_table(thd, NullS, NullS, &create_info,
tables, lex->create_list,
- lex->key_list, lex->drop_list, lex->alter_list,
- 0, (ORDER *) 0, 0,
- DUP_ERROR);
+ lex->key_list, 0, (ORDER *) 0,
+ DUP_ERROR, &lex->alter_info);
}
else
res = mysql_optimize_table(thd, tables, &lex->check_opt);
@@ -2754,7 +2753,7 @@ unsent_create_error:
if (end_active_trans(thd))
res= -1;
else
- res = mysql_drop_index(thd, tables, lex->drop_list);
+ res = mysql_drop_index(thd, tables, &lex->alter_info);
break;
case SQLCOM_SHOW_DATABASES:
#if defined(DONT_ALLOW_SHOW_COMMANDS)
@@ -3489,7 +3488,7 @@ unsent_create_error:
}
if (res == 0)
- send_ok(thd, thd->row_count_func);
+ send_ok(thd, (thd->row_count_func < 0 ? 0 : thd->row_count_func));
else
goto error; // Substatement should already have sent error
}
@@ -4182,12 +4181,14 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
query_cache_end_of_result(thd);
}
}
+ lex->unit.cleanup();
}
else
{
DBUG_PRINT("info",("Command aborted. Fatal_error: %d",
thd->is_fatal_error));
query_cache_abort(&thd->net);
+ lex->unit.cleanup();
if (thd->lex->sphead)
{
/* Clean up after failed stored procedure/function */
@@ -4260,13 +4261,13 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
{
lex->col_list.push_back(new key_part_spec(field_name,0));
lex->key_list.push_back(new Key(Key::PRIMARY, NullS, HA_KEY_ALG_UNDEF,
- lex->col_list));
+ 0, lex->col_list));
lex->col_list.empty();
}
if (type_modifier & (UNIQUE_FLAG | UNIQUE_KEY_FLAG))
{
lex->col_list.push_back(new key_part_spec(field_name,0));
- lex->key_list.push_back(new Key(Key::UNIQUE, NullS, HA_KEY_ALG_UNDEF,
+ lex->key_list.push_back(new Key(Key::UNIQUE, NullS, HA_KEY_ALG_UNDEF, 0,
lex->col_list));
lex->col_list.empty();
}
@@ -4912,7 +4913,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
mysql_bin_log.new_file(1);
mysql_slow_log.new_file(1);
#ifdef HAVE_REPLICATION
- if (expire_logs_days)
+ if (mysql_bin_log.is_open() && expire_logs_days)
{
long purge_time= time(0) - expire_logs_days*24*60*60;
if (purge_time >= 0)
@@ -5202,8 +5203,9 @@ Item * all_any_subquery_creator(Item *left_expr,
int mysql_create_index(THD *thd, TABLE_LIST *table_list, List<Key> &keys)
{
List<create_field> fields;
- List<Alter_drop> drop;
- List<Alter_column> alter;
+ ALTER_INFO alter_info;
+ alter_info.flags= ALTER_ADD_INDEX;
+ alter_info.is_simple= 0;
HA_CREATE_INFO create_info;
DBUG_ENTER("mysql_create_index");
bzero((char*) &create_info,sizeof(create_info));
@@ -5211,25 +5213,27 @@ int mysql_create_index(THD *thd, TABLE_LIST *table_list, List<Key> &keys)
create_info.default_table_charset= thd->variables.collation_database;
DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name,
&create_info, table_list,
- fields, keys, drop, alter, 0, (ORDER*)0,
- ALTER_ADD_INDEX, DUP_ERROR));
+ fields, keys, 0, (ORDER*)0,
+ DUP_ERROR, &alter_info));
}
-int mysql_drop_index(THD *thd, TABLE_LIST *table_list, List<Alter_drop> &drop)
+int mysql_drop_index(THD *thd, TABLE_LIST *table_list, ALTER_INFO *alter_info)
{
List<create_field> fields;
List<Key> keys;
- List<Alter_column> alter;
HA_CREATE_INFO create_info;
DBUG_ENTER("mysql_drop_index");
bzero((char*) &create_info,sizeof(create_info));
create_info.db_type=DB_TYPE_DEFAULT;
create_info.default_table_charset= thd->variables.collation_database;
+ alter_info->clear();
+ alter_info->flags= ALTER_DROP_INDEX;
+ alter_info->is_simple= 0;
DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name,
&create_info, table_list,
- fields, keys, drop, alter, 0, (ORDER*)0,
- ALTER_DROP_INDEX, DUP_ERROR));
+ fields, keys, 0, (ORDER*)0,
+ DUP_ERROR, alter_info));
}
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index f3ae4052bb4..87fb379321f 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -57,9 +57,9 @@ Long data handling:
- Server gets the long data in pieces with command type 'COM_LONG_DATA'.
- The packet recieved will have the format as:
- [COM_LONG_DATA:1][STMT_ID:4][parameter_number:2][type:2][data]
- - Checks if the type is specified by client, and if yes reads the type,
- and stores the data in that format.
+ [COM_LONG_DATA:1][STMT_ID:4][parameter_number:2][data]
+ - data from the packet is appended to long data value buffer for this
+ placeholder.
- It's up to the client to check for read data ended. The server doesn't
care; and also server doesn't notify to the client that it got the
data or not; if there is any error; then during execute; the error
@@ -77,8 +77,6 @@ Long data handling:
#include <mysql.h>
#endif
-const String my_null_string("NULL", 4, default_charset_info);
-
/******************************************************************************
Prepared_statement: statement which can contain placeholders
******************************************************************************/
@@ -92,7 +90,6 @@ public:
uint last_errno;
char last_error[MYSQL_ERRMSG_SIZE];
bool get_longdata_error;
- bool log_full_query;
#ifndef EMBEDDED_LIBRARY
bool (*set_params)(Prepared_statement *st, uchar *data, uchar *data_end,
uchar *read_pos);
@@ -240,7 +237,7 @@ static ulong get_param_length(uchar **packet, ulong len)
none
*/
-void set_param_tiny(Item_param *param, uchar **pos, ulong len)
+static void set_param_tiny(Item_param *param, uchar **pos, ulong len)
{
#ifndef EMBEDDED_LIBRARY
if (len < 1)
@@ -248,45 +245,55 @@ void set_param_tiny(Item_param *param, uchar **pos, ulong len)
#endif
int8 value= (int8) **pos;
param->set_int(param->unsigned_flag ? (longlong) ((uint8) value) :
- (longlong) value);
+ (longlong) value, 4);
*pos+= 1;
}
-void set_param_short(Item_param *param, uchar **pos, ulong len)
+static void set_param_short(Item_param *param, uchar **pos, ulong len)
{
+ int16 value;
#ifndef EMBEDDED_LIBRARY
if (len < 2)
return;
+ value= sint2korr(*pos);
+#else
+ shortget(value, *pos);
#endif
- int16 value= sint2korr(*pos);
param->set_int(param->unsigned_flag ? (longlong) ((uint16) value) :
- (longlong) value);
+ (longlong) value, 6);
*pos+= 2;
}
-void set_param_int32(Item_param *param, uchar **pos, ulong len)
+static void set_param_int32(Item_param *param, uchar **pos, ulong len)
{
+ int32 value;
#ifndef EMBEDDED_LIBRARY
if (len < 4)
return;
+ value= sint4korr(*pos);
+#else
+ longget(value, *pos);
#endif
- int32 value= sint4korr(*pos);
param->set_int(param->unsigned_flag ? (longlong) ((uint32) value) :
- (longlong) value);
+ (longlong) value, 11);
*pos+= 4;
}
-void set_param_int64(Item_param *param, uchar **pos, ulong len)
+static void set_param_int64(Item_param *param, uchar **pos, ulong len)
{
+ longlong value;
#ifndef EMBEDDED_LIBRARY
if (len < 8)
return;
+ value= (longlong) sint8korr(*pos);
+#else
+ longlongget(value, *pos);
#endif
- param->set_int((longlong)sint8korr(*pos));
+ param->set_int(value, 21);
*pos+= 8;
}
-void set_param_float(Item_param *param, uchar **pos, ulong len)
+static void set_param_float(Item_param *param, uchar **pos, ulong len)
{
#ifndef EMBEDDED_LIBRARY
if (len < 4)
@@ -298,7 +305,7 @@ void set_param_float(Item_param *param, uchar **pos, ulong len)
*pos+= 4;
}
-void set_param_double(Item_param *param, uchar **pos, ulong len)
+static void set_param_double(Item_param *param, uchar **pos, ulong len)
{
#ifndef EMBEDDED_LIBRARY
if (len < 8)
@@ -310,9 +317,11 @@ void set_param_double(Item_param *param, uchar **pos, ulong len)
*pos+= 8;
}
-void set_param_time(Item_param *param, uchar **pos, ulong len)
+#ifndef EMBEDDED_LIBRARY
+static void set_param_time(Item_param *param, uchar **pos, ulong len)
{
ulong length;
+ uint day;
if ((length= get_param_length(pos, len)) >= 8)
{
@@ -322,20 +331,33 @@ void set_param_time(Item_param *param, uchar **pos, ulong len)
/* TODO: why length is compared with 8 here? */
tm.second_part= (length > 8 ) ? (ulong) sint4korr(to+7): 0;
- tm.day= (ulong) sint4korr(to+1);
- tm.hour= (uint) to[5];
+ /*
+ Note, that though ranges of hour, minute and second are not checked
+ here we rely on them being < 256: otherwise
+ we'll get buffer overflow in make_{date,time} functions,
+ which are called when time value is converted to string.
+ */
+ day= (uint) sint4korr(to+1);
+ tm.hour= (uint) to[5] + day * 24;
tm.minute= (uint) to[6];
tm.second= (uint) to[7];
-
- tm.year= tm.month= 0;
+ if (tm.hour > 838)
+ {
+ /* TODO: add warning 'Data truncated' here */
+ tm.hour= 838;
+ tm.minute= 59;
+ tm.second= 59;
+ }
+ tm.day= tm.year= tm.month= 0;
tm.neg= (bool)to[0];
- param->set_time(&tm, TIMESTAMP_TIME);
+ param->set_time(&tm, TIMESTAMP_TIME,
+ MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
}
*pos+= length;
}
-void set_param_datetime(Item_param *param, uchar **pos, ulong len)
+static void set_param_datetime(Item_param *param, uchar **pos, ulong len)
{
uint length;
@@ -346,6 +368,11 @@ void set_param_datetime(Item_param *param, uchar **pos, ulong len)
tm.second_part= (length > 7 ) ? (ulong) sint4korr(to+7): 0;
+ /*
+ Note, that though ranges of hour, minute and second are not checked
+ here we rely on them being < 256: otherwise
+ we'll get buffer overflow in make_{date,time} functions.
+ */
if (length > 4)
{
tm.hour= (uint) to[4];
@@ -360,12 +387,13 @@ void set_param_datetime(Item_param *param, uchar **pos, ulong len)
tm.day= (uint) to[3];
tm.neg= 0;
- param->set_time(&tm, TIMESTAMP_DATETIME);
+ param->set_time(&tm, TIMESTAMP_DATETIME,
+ MAX_DATETIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
}
*pos+= length;
}
-void set_param_date(Item_param *param, uchar **pos, ulong len)
+static void set_param_date(Item_param *param, uchar **pos, ulong len)
{
ulong length;
@@ -373,7 +401,11 @@ void set_param_date(Item_param *param, uchar **pos, ulong len)
{
uchar *to= *pos;
TIME tm;
-
+ /*
+ Note, that though ranges of hour, minute and second are not checked
+ here we rely on them being < 256: otherwise
+ we'll get buffer overflow in make_{date,time} functions.
+ */
tm.year= (uint) sint2korr(to);
tm.month= (uint) to[2];
tm.day= (uint) to[3];
@@ -382,61 +414,171 @@ void set_param_date(Item_param *param, uchar **pos, ulong len)
tm.second_part= 0;
tm.neg= 0;
- param->set_time(&tm, TIMESTAMP_DATE);
+ param->set_time(&tm, TIMESTAMP_DATE,
+ MAX_DATE_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
}
*pos+= length;
}
-void set_param_str(Item_param *param, uchar **pos, ulong len)
+#else/*!EMBEDDED_LIBRARY*/
+void set_param_time(Item_param *param, uchar **pos, ulong len)
+{
+ TIME tm;
+ MYSQL_TIME *to= (MYSQL_TIME*)*pos;
+
+ tm.second_part= to->second_part;
+
+ tm.day= to->day;
+ tm.hour= to->hour;
+ tm.minute= to->minute;
+ tm.second= to->second;
+
+ tm.year= tm.month= 0;
+ tm.neg= to->neg;
+ param->set_time(&tm, TIMESTAMP_TIME,
+ MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
+
+}
+
+void set_param_datetime(Item_param *param, uchar **pos, ulong len)
+{
+ TIME tm;
+ MYSQL_TIME *to= (MYSQL_TIME*)*pos;
+
+ tm.second_part= to->second_part;
+
+ tm.day= to->day;
+ tm.hour= to->hour;
+ tm.minute= to->minute;
+ tm.second= to->second;
+ tm.year= to->year;
+ tm.month= to->month;
+ tm.neg= 0;
+
+ param->set_time(&tm, TIMESTAMP_DATETIME,
+ MAX_DATETIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
+}
+
+void set_param_date(Item_param *param, uchar **pos, ulong len)
+{
+ TIME tm;
+ MYSQL_TIME *to= (MYSQL_TIME*)*pos;
+
+ tm.second_part= to->second_part;
+
+ tm.day= to->day;
+ tm.year= to->year;
+ tm.month= to->month;
+ tm.neg= 0;
+ tm.hour= tm.minute= tm.second= 0;
+ tm.second_part= 0;
+ tm.neg= 0;
+
+ param->set_time(&tm, TIMESTAMP_DATE,
+ MAX_DATE_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
+}
+#endif /*!EMBEDDED_LIBRARY*/
+
+
+static void set_param_str(Item_param *param, uchar **pos, ulong len)
{
ulong length= get_param_length(pos, len);
- param->set_value((const char *)*pos, length);
+ param->set_str((const char *)*pos, length);
*pos+= length;
}
-static void setup_one_conversion_function(Item_param *param, uchar param_type)
+
+#undef get_param_length
+
+static void setup_one_conversion_function(THD *thd, Item_param *param,
+ uchar param_type)
{
switch (param_type) {
- case FIELD_TYPE_TINY:
+ case MYSQL_TYPE_TINY:
param->set_param_func= set_param_tiny;
+ param->item_type= Item::INT_ITEM;
param->item_result_type= INT_RESULT;
break;
- case FIELD_TYPE_SHORT:
+ case MYSQL_TYPE_SHORT:
param->set_param_func= set_param_short;
+ param->item_type= Item::INT_ITEM;
param->item_result_type= INT_RESULT;
break;
- case FIELD_TYPE_LONG:
+ case MYSQL_TYPE_LONG:
param->set_param_func= set_param_int32;
+ param->item_type= Item::INT_ITEM;
param->item_result_type= INT_RESULT;
break;
- case FIELD_TYPE_LONGLONG:
+ case MYSQL_TYPE_LONGLONG:
param->set_param_func= set_param_int64;
+ param->item_type= Item::INT_ITEM;
param->item_result_type= INT_RESULT;
break;
- case FIELD_TYPE_FLOAT:
+ case MYSQL_TYPE_FLOAT:
param->set_param_func= set_param_float;
+ param->item_type= Item::REAL_ITEM;
param->item_result_type= REAL_RESULT;
break;
- case FIELD_TYPE_DOUBLE:
+ case MYSQL_TYPE_DOUBLE:
param->set_param_func= set_param_double;
+ param->item_type= Item::REAL_ITEM;
param->item_result_type= REAL_RESULT;
break;
- case FIELD_TYPE_TIME:
+ case MYSQL_TYPE_TIME:
param->set_param_func= set_param_time;
+ param->item_type= Item::STRING_ITEM;
param->item_result_type= STRING_RESULT;
break;
- case FIELD_TYPE_DATE:
+ case MYSQL_TYPE_DATE:
param->set_param_func= set_param_date;
+ param->item_type= Item::STRING_ITEM;
param->item_result_type= STRING_RESULT;
break;
case MYSQL_TYPE_DATETIME:
case MYSQL_TYPE_TIMESTAMP:
param->set_param_func= set_param_datetime;
+ param->item_type= Item::STRING_ITEM;
param->item_result_type= STRING_RESULT;
break;
- default:
+ case MYSQL_TYPE_TINY_BLOB:
+ case MYSQL_TYPE_MEDIUM_BLOB:
+ case MYSQL_TYPE_LONG_BLOB:
+ case MYSQL_TYPE_BLOB:
param->set_param_func= set_param_str;
+ param->value.cs_info.character_set_client= &my_charset_bin;
+ param->value.cs_info.final_character_set_of_str_value= &my_charset_bin;
+ param->item_type= Item::STRING_ITEM;
param->item_result_type= STRING_RESULT;
+ break;
+ default:
+ /*
+ The client library ensures that we won't get any other typecodes
+ except typecodes above and typecodes for string types. Marking
+ label as 'default' lets us to handle malformed packets as well.
+ */
+ {
+ CHARSET_INFO *fromcs= thd->variables.character_set_client;
+ CHARSET_INFO *tocs= thd->variables.collation_connection;
+ uint32 dummy_offset;
+
+ param->value.cs_info.character_set_client= fromcs;
+
+ /*
+ Setup source and destination character sets so that they
+ are different only if conversion is necessary: this will
+ make later checks easier.
+ */
+ param->value.cs_info.final_character_set_of_str_value=
+ String::needs_conversion(0, fromcs, tocs, &dummy_offset) ?
+ tocs : fromcs;
+ param->set_param_func= set_param_str;
+ /*
+ Exact value of max_length is not known unless data is converted to
+ charset of connection, so we have to set it later.
+ */
+ param->item_type= Item::STRING_ITEM;
+ param->item_result_type= STRING_RESULT;
+ }
}
}
@@ -465,23 +607,21 @@ static bool insert_params_withlog(Prepared_statement *stmt, uchar *null_array,
for (Item_param **it= begin; it < end; ++it)
{
Item_param *param= *it;
- if (param->long_data_supplied)
- res= param->query_val_str(&str);
- else
+ if (param->state != Item_param::LONG_DATA_VALUE)
{
if (is_param_null(null_array, it - begin))
- {
param->set_null();
- res= &my_null_string;
- }
else
{
if (read_pos >= data_end)
DBUG_RETURN(1);
param->set_param_func(param, &read_pos, data_end - read_pos);
- res= param->query_val_str(&str);
}
}
+ res= param->query_val_str(&str);
+ if (param->convert_str_value(thd))
+ DBUG_RETURN(1); /* out of memory */
+
if (query.replace(param->pos_in_query+length, 1, *res))
DBUG_RETURN(1);
@@ -505,7 +645,7 @@ static bool insert_params(Prepared_statement *stmt, uchar *null_array,
for (Item_param **it= begin; it < end; ++it)
{
Item_param *param= *it;
- if (!param->long_data_supplied)
+ if (param->state != Item_param::LONG_DATA_VALUE)
{
if (is_param_null(null_array, it - begin))
param->set_null();
@@ -516,6 +656,8 @@ static bool insert_params(Prepared_statement *stmt, uchar *null_array,
param->set_param_func(param, &read_pos, data_end - read_pos);
}
}
+ if (param->convert_str_value(stmt->thd))
+ DBUG_RETURN(1); /* out of memory */
}
DBUG_RETURN(0);
}
@@ -537,6 +679,7 @@ static bool setup_conversion_functions(Prepared_statement *stmt,
*/
Item_param **it= stmt->param_array;
Item_param **end= it + stmt->param_count;
+ THD *thd= stmt->thd;
for (; it < end; ++it)
{
ushort typecode;
@@ -548,7 +691,7 @@ static bool setup_conversion_functions(Prepared_statement *stmt,
typecode= sint2korr(read_pos);
read_pos+= 2;
(**it).unsigned_flag= test(typecode & signed_bit);
- setup_one_conversion_function(*it, (uchar) (typecode & ~signed_bit));
+ setup_one_conversion_function(thd, *it, (uchar) (typecode & ~signed_bit));
}
}
*data= read_pos;
@@ -559,6 +702,7 @@ static bool setup_conversion_functions(Prepared_statement *stmt,
static bool emb_insert_params(Prepared_statement *stmt)
{
+ THD *thd= stmt->thd;
Item_param **it= stmt->param_array;
Item_param **end= it + stmt->param_count;
MYSQL_BIND *client_param= stmt->thd->client_params;
@@ -568,20 +712,22 @@ static bool emb_insert_params(Prepared_statement *stmt)
for (; it < end; ++it, ++client_param)
{
Item_param *param= *it;
- setup_one_conversion_function(param, client_param->buffer_type);
- if (!param->long_data_supplied)
+ setup_one_conversion_function(thd, param, client_param->buffer_type);
+ if (param->state != Item_param::LONG_DATA_VALUE)
{
if (*client_param->is_null)
param->set_null();
else
{
- uchar *buff= (uchar*)client_param->buffer;
+ uchar *buff= (uchar*) client_param->buffer;
param->set_param_func(param, &buff,
client_param->length ?
*client_param->length :
client_param->buffer_length);
}
}
+ if (param->convert_str_value(thd))
+ DBUG_RETURN(1); /* out of memory */
}
DBUG_RETURN(0);
}
@@ -606,25 +752,22 @@ static bool emb_insert_params_withlog(Prepared_statement *stmt)
for (; it < end; ++it, ++client_param)
{
Item_param *param= *it;
- setup_one_conversion_function(param, client_param->buffer_type);
- if (param->long_data_supplied)
- res= param->query_val_str(&str);
- else
+ setup_one_conversion_function(thd, param, client_param->buffer_type);
+ if (param->state != Item_param::LONG_DATA_VALUE)
{
if (*client_param->is_null)
- {
param->set_null();
- res= &my_null_string;
- }
else
{
- uchar *buff= (uchar*)client_param->buffer;
+ uchar *buff= (uchar*)client_param->buffer;
param->set_param_func(param, &buff,
client_param->length ?
*client_param->length :
client_param->buffer_length);
- res= param->query_val_str(&str);
}
+ res= param->query_val_str(&str);
+ if (param->convert_str_value(thd))
+ DBUG_RETURN(1); /* out of memory */
}
if (query.replace(param->pos_in_query+length, 1, *res))
DBUG_RETURN(1);
@@ -669,7 +812,7 @@ static int mysql_test_insert(Prepared_statement *stmt,
TABLE_LIST *insert_table_list=
(TABLE_LIST*) lex->select_lex.table_list.first;
my_bool update= (lex->value_list.elements ? UPDATE_ACL : 0);
- DBUG_ENTER("mysql_test_insert_fields");
+ DBUG_ENTER("mysql_test_insert");
if ((res= insert_precheck(thd, table_list, update)))
DBUG_RETURN(res);
@@ -725,7 +868,7 @@ error:
Validate UPDATE statement
SYNOPSIS
- mysql_test_delete()
+ mysql_test_update()
stmt prepared statemen handler
tables list of tables queries
@@ -1038,7 +1181,7 @@ end:
/*
- Validate and prepare for execution CRETE TABLE statement
+ Validate and prepare for execution CREATE TABLE statement
SYNOPSIS
mysql_test_create_table()
@@ -1075,7 +1218,7 @@ static int mysql_test_create_table(Prepared_statement *stmt,
/*
- Validate and prepare for execution multy update statement
+ Validate and prepare for execution multi update statement
SYNOPSIS
mysql_test_multiupdate()
@@ -1098,7 +1241,7 @@ static int mysql_test_multiupdate(Prepared_statement *stmt,
/*
- Validate and prepare for execution multy delete statement
+ Validate and prepare for execution multi delete statement
SYNOPSIS
mysql_test_multidelete()
@@ -1270,8 +1413,8 @@ error:
}
/*
- Initialize array of parametes in statement from LEX.
- (We need to have quick access to items by number in mysql_send_longdata).
+ Initialize array of parameters in statement from LEX.
+ (We need to have quick access to items by number in mysql_stmt_get_longdata).
This is to avoid using malloc/realloc in the parser.
*/
@@ -1357,7 +1500,7 @@ void mysql_stmt_prepare(THD *thd, char *packet, uint packet_length)
mysql_log.write(thd, COM_PREPARE, "%s", packet);
- thd->current_statement= stmt;
+ thd->current_arena= stmt;
lex= lex_start(thd, (uchar *) thd->query, thd->query_length);
mysql_init_query(thd);
lex->safe_to_cache_query= 0;
@@ -1381,7 +1524,7 @@ void mysql_stmt_prepare(THD *thd, char *packet, uint packet_length)
stmt->set_item_arena(thd);
thd->set_statement(&thd->stmt_backup);
thd->set_item_arena(&thd->stmt_backup);
- thd->current_statement= 0;
+ thd->current_arena= 0;
if (error)
{
@@ -1389,43 +1532,33 @@ void mysql_stmt_prepare(THD *thd, char *packet, uint packet_length)
thd->stmt_map.erase(stmt);
/* error is sent inside yyparse/send_prepare_results */
}
- else
- {
- SELECT_LEX *sl= stmt->lex->all_selects_list;
- /*
- Save WHERE clause pointers, because they may be changed during query
- optimisation.
- */
- for (; sl; sl= sl->next_select_in_list())
- {
- sl->prep_where= sl->where;
- }
- }
DBUG_VOID_RETURN;
}
/* Reinit statement before execution */
-static void reset_stmt_for_execute(Prepared_statement *stmt)
+void reset_stmt_for_execute(THD *thd, LEX *lex)
{
- THD *thd= stmt->thd;
- SELECT_LEX *sl= stmt->lex->all_selects_list;
+ SELECT_LEX *sl= lex->all_selects_list;
for (; sl; sl= sl->next_select_in_list())
{
- /*
- Copy WHERE clause pointers to avoid damaging they by optimisation
- */
- if (sl->prep_where)
- sl->where= sl->prep_where->copy_andor_structure(thd);
- DBUG_ASSERT(sl->join == 0);
- ORDER *order;
- /* Fix GROUP list */
- for (order= (ORDER *)sl->group_list.first; order; order= order->next)
- order->item= &order->item_ptr;
- /* Fix ORDER list */
- for (order= (ORDER *)sl->order_list.first; order; order= order->next)
- order->item= &order->item_ptr;
+ if (!sl->first_execution)
+ {
+ /*
+ Copy WHERE clause pointers to avoid damaging they by optimisation
+ */
+ if (sl->prep_where)
+ sl->where= sl->prep_where->copy_andor_structure(thd);
+ DBUG_ASSERT(sl->join == 0);
+ ORDER *order;
+ /* Fix GROUP list */
+ for (order= (ORDER *)sl->group_list.first; order; order= order->next)
+ order->item= &order->item_ptr;
+ /* Fix ORDER list */
+ for (order= (ORDER *)sl->order_list.first; order; order= order->next)
+ order->item= &order->item_ptr;
+ }
/*
TODO: When the new table structure is ready, then have a status bit
@@ -1443,7 +1576,6 @@ static void reset_stmt_for_execute(Prepared_statement *stmt)
tables->table= 0;
tables->table_list= 0;
}
-
{
SELECT_LEX_UNIT *unit= sl->master_unit();
unit->unclean();
@@ -1480,7 +1612,6 @@ static void reset_stmt_params(Prepared_statement *stmt)
mysql_stmt_execute()
*/
-
void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
{
ulong stmt_id= uint4korr(packet);
@@ -1492,7 +1623,8 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
packet+= 9; /* stmt_id + 5 bytes of flags */
- if (!(stmt= find_prepared_statement(thd, stmt_id, "execute", SEND_ERROR)))
+ if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_execute",
+ SEND_ERROR)))
DBUG_VOID_RETURN;
DBUG_PRINT("exec_query:", ("%s", stmt->query));
@@ -1506,7 +1638,7 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
thd->stmt_backup.set_statement(thd);
thd->set_statement(stmt);
- reset_stmt_for_execute(stmt);
+ reset_stmt_for_execute(thd, stmt->lex);
#ifndef EMBEDDED_LIBRARY
if (stmt->param_count)
{
@@ -1546,7 +1678,7 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
reset_stmt_params(stmt);
close_thread_tables(thd); // to close derived tables
thd->set_statement(&thd->stmt_backup);
- /*
+ /*
Free Items that were created during this execution of the PS by query
optimizer.
*/
@@ -1556,7 +1688,7 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
set_params_data_err:
reset_stmt_params(stmt);
thd->set_statement(&thd->stmt_backup);
- my_error(ER_WRONG_ARGUMENTS, MYF(0), "mysql_execute");
+ my_error(ER_WRONG_ARGUMENTS, MYF(0), "mysql_stmt_execute");
send_error(thd);
DBUG_VOID_RETURN;
}
@@ -1587,7 +1719,8 @@ void mysql_stmt_reset(THD *thd, char *packet)
DBUG_ENTER("mysql_stmt_reset");
- if (!(stmt= find_prepared_statement(thd, stmt_id, "reset", SEND_ERROR)))
+ if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_reset",
+ SEND_ERROR)))
DBUG_VOID_RETURN;
stmt->get_longdata_error= 0;
@@ -1617,7 +1750,8 @@ void mysql_stmt_free(THD *thd, char *packet)
DBUG_ENTER("mysql_stmt_free");
- if (!(stmt= find_prepared_statement(thd, stmt_id, "close", DONT_SEND_ERROR)))
+ if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_close",
+ DONT_SEND_ERROR)))
DBUG_VOID_RETURN;
/* Statement map deletes statement on erase */
@@ -1645,43 +1779,50 @@ void mysql_stmt_free(THD *thd, char *packet)
to the server. (No checking that we get a 'end of column' in the server)
*/
-void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length)
+void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
{
+ ulong stmt_id;
+ uint param_number;
Prepared_statement *stmt;
+ Item_param *param;
+ char *packet_end= packet + packet_length - 1;
DBUG_ENTER("mysql_stmt_get_longdata");
#ifndef EMBEDDED_LIBRARY
- /* The following should never happen */
- if (packet_length < MYSQL_LONG_DATA_HEADER+1)
+ /* Minimal size of long data packet is 6 bytes */
+ if ((ulong) (packet_end - packet) < MYSQL_LONG_DATA_HEADER)
{
- my_error(ER_WRONG_ARGUMENTS, MYF(0), "get_longdata");
+ my_error(ER_WRONG_ARGUMENTS, MYF(0), "mysql_stmt_send_long_data");
DBUG_VOID_RETURN;
}
#endif
- ulong stmt_id= uint4korr(pos);
- uint param_number= uint2korr(pos+4);
+ stmt_id= uint4korr(packet);
+ packet+= 4;
- if (!(stmt=find_prepared_statement(thd, stmt_id, "get_longdata",
+ if (!(stmt=find_prepared_statement(thd, stmt_id, "mysql_stmt_send_long_data",
DONT_SEND_ERROR)))
DBUG_VOID_RETURN;
+ param_number= uint2korr(packet);
+ packet+= 2;
#ifndef EMBEDDED_LIBRARY
if (param_number >= stmt->param_count)
{
/* Error will be sent in execute call */
stmt->get_longdata_error= 1;
stmt->last_errno= ER_WRONG_ARGUMENTS;
- sprintf(stmt->last_error, ER(ER_WRONG_ARGUMENTS), "get_longdata");
+ sprintf(stmt->last_error, ER(ER_WRONG_ARGUMENTS),
+ "mysql_stmt_send_long_data");
DBUG_VOID_RETURN;
}
- pos+= MYSQL_LONG_DATA_HEADER; // Point to data
#endif
- Item_param *param= stmt->param_array[param_number];
+ param= stmt->param_array[param_number];
+
#ifndef EMBEDDED_LIBRARY
- param->set_longdata(pos, packet_length-MYSQL_LONG_DATA_HEADER-1);
+ param->set_longdata(packet, (ulong) (packet_end - packet));
#else
param->set_longdata(thd->extra_data, thd->extra_length);
#endif
@@ -1695,13 +1836,11 @@ Prepared_statement::Prepared_statement(THD *thd_arg)
param_array(0),
param_count(0),
last_errno(0),
- get_longdata_error(0),
- log_full_query(0)
+ get_longdata_error(0)
{
*last_error= '\0';
if (mysql_bin_log.is_open())
{
- log_full_query= 1;
#ifndef EMBEDDED_LIBRARY
set_params= insert_params_withlog;
#else
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 824edfa93d0..07b70d26997 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000-2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -55,12 +55,12 @@ static void best_access_path(JOIN *join, JOIN_TAB *s, THD *thd,
double record_count, double read_time);
static void optimize_straight_join(JOIN *join, table_map join_tables);
static void greedy_search(JOIN *join, table_map remaining_tables,
- uint depth, uint heuristic);
+ uint depth, uint prune_level);
static void best_extension_by_limited_search(JOIN *join,
table_map remaining_tables,
uint idx, double record_count,
double read_time, uint depth,
- uint heuristic);
+ uint prune_level);
static uint determine_search_depth(JOIN* join);
static int join_tab_cmp(const void* ptr1, const void* ptr2);
/*
@@ -367,7 +367,14 @@ JOIN::prepare(Item ***rref_pointer_array,
Item_subselect::trans_res res;
if ((res= subselect->select_transformer(this)) !=
Item_subselect::RES_OK)
+ {
+ if (thd->current_arena && select_lex->first_execution)
+ {
+ select_lex->prep_where= select_lex->where;
+ select_lex->first_execution= 0;
+ }
DBUG_RETURN((res == Item_subselect::RES_ERROR));
+ }
}
}
@@ -391,7 +398,7 @@ JOIN::prepare(Item ***rref_pointer_array,
{
if (item->with_sum_func)
flag|=1;
- else if (!(flag & 2) && !item->const_item())
+ else if (!(flag & 2) && !item->const_during_execution())
flag|=2;
}
if (flag == 3)
@@ -470,6 +477,11 @@ JOIN::prepare(Item ***rref_pointer_array,
if (alloc_func_list())
goto err;
+ if (thd->current_arena && select_lex->first_execution)
+ {
+ select_lex->prep_where= select_lex->where;
+ select_lex->first_execution= 0;
+ }
DBUG_RETURN(0); // All OK
err:
@@ -689,7 +701,6 @@ JOIN::optimize()
if (!order && org_order)
skip_sort_order= 1;
}
- order= remove_const(this, order, conds, &simple_order);
if (group_list || tmp_table_param.sum_func_count)
{
if (! hidden_group_fields)
@@ -1604,8 +1615,7 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
if (select_lex->linkage != GLOBAL_OPTIONS_TYPE)
{
//here is EXPLAIN of subselect or derived table
- join->result= result;
- if (!join->procedure && result->prepare(join->fields_list, unit))
+ if (join->change_result(result))
{
DBUG_RETURN(-1);
}
@@ -3063,8 +3073,8 @@ best_access_path(JOIN *join,
static void
choose_plan(JOIN *join, table_map join_tables)
{
- uint search_depth= join->thd->variables.plan_search_depth;
- uint heuristic= join->thd->variables.heuristic;
+ uint search_depth= join->thd->variables.optimizer_search_depth;
+ uint prune_level= join->thd->variables.optimizer_prune_level;
DBUG_ENTER("choose_plan");
@@ -3094,7 +3104,7 @@ choose_plan(JOIN *join, table_map join_tables)
if (search_depth == 0)
/* Automatically determine a reasonable value for 'search_depth' */
search_depth= determine_search_depth(join);
- greedy_search(join, join_tables, search_depth, heuristic);
+ greedy_search(join, join_tables, search_depth, prune_level);
}
}
@@ -3245,7 +3255,7 @@ optimize_straight_join(JOIN *join, table_map join_tables)
for the query
remaining_tables set of tables not included into the partial plan yet
search_depth controlls the exhaustiveness of the search
- heuristic the pruning heuristics that should be applied during
+ prune_level the pruning heuristics that should be applied during
search
DESCRIPTION
@@ -3315,7 +3325,7 @@ static void
greedy_search(JOIN *join,
table_map remaining_tables,
uint search_depth,
- uint heuristic)
+ uint prune_level)
{
double record_count= 1.0;
double read_time= 0.0;
@@ -3334,7 +3344,7 @@ greedy_search(JOIN *join,
/* Find the extension of the current QEP with the lowest cost */
join->best_read= DBL_MAX;
best_extension_by_limited_search(join, remaining_tables, idx, record_count,
- read_time, search_depth, heuristic);
+ read_time, search_depth, prune_level);
if (rem_size <= search_depth)
{
@@ -3364,7 +3374,7 @@ greedy_search(JOIN *join,
pos= join->best_ref[++best_idx];
DBUG_ASSERT((pos != NULL)); // should always find 'best_table'
/* move 'best_table' at the first free position in the array of joins */
- swap(JOIN_TAB*, join->best_ref[idx], join->best_ref[best_idx]);
+ swap_variables(JOIN_TAB*, join->best_ref[idx], join->best_ref[best_idx]);
/* compute the cost of the new plan extended with 'best_table' */
record_count*= join->positions[idx].records_read;
@@ -3398,7 +3408,7 @@ greedy_search(JOIN *join,
read_time the cost of the best partial plan
search_depth maximum depth of the recursion and thus size of the found
optimal plan (0 < search_depth <= join->tables+1).
- heuristic pruning heuristics that should be applied during optimization
+ prune_level pruning heuristics that should be applied during optimization
(values: 0 = EXHAUSTIVE, 1 = PRUNE_BY_TIME_OR_ROWS)
DESCRIPTION
@@ -3482,7 +3492,7 @@ greedy_search(JOIN *join,
When 'best_extension_by_limited_search' is called for the first time,
'join->best_read' must be set to the largest possible value (e.g. DBL_MAX).
The actual implementation provides a way to optionally use pruning
- heuristics (controlled by the parameter 'heuristic') to reduce the search
+ heuristic (controlled by the parameter 'prune_level') to reduce the search
space by skipping some partial plans.
The parameter 'search_depth' provides control over the recursion
depth, and thus the size of the resulting optimal plan.
@@ -3498,7 +3508,7 @@ best_extension_by_limited_search(JOIN *join,
double record_count,
double read_time,
uint search_depth,
- uint heuristic)
+ uint prune_level)
{
THD *thd= join->thd;
if (thd->killed) // Abort
@@ -3543,7 +3553,7 @@ best_extension_by_limited_search(JOIN *join,
Prune some less promising partial plans. This heuristic may miss
the optimal QEPs, thus it results in a non-exhaustive search.
*/
- if (heuristic == 1)
+ if (prune_level == 1)
{
if (best_record_count > current_record_count ||
best_read_time > current_read_time ||
@@ -3563,24 +3573,24 @@ best_extension_by_limited_search(JOIN *join,
else
{
DBUG_EXECUTE("opt", print_plan(join, read_time, record_count, idx,
- "prune_by_heuristic"););
+ "pruned_by_heuristic"););
continue;
}
}
if ( (search_depth > 1) && (remaining_tables & ~real_table_bit) )
{ /* Recursively expand the current partial plan */
- swap(JOIN_TAB*, join->best_ref[idx], *pos);
+ swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
best_extension_by_limited_search(join,
remaining_tables & ~real_table_bit,
idx + 1,
current_record_count,
current_read_time,
search_depth - 1,
- heuristic);
+ prune_level);
if (thd->killed)
DBUG_VOID_RETURN;
- swap(JOIN_TAB*, join->best_ref[idx], *pos);
+ swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
}
else
{ /*
@@ -4001,12 +4011,12 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
best_record_count=current_record_count;
best_read_time=current_read_time;
}
- swap(JOIN_TAB*,join->best_ref[idx],*pos);
+ swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
find_best(join,rest_tables & ~real_table_bit,idx+1,
current_record_count,current_read_time);
if (thd->killed)
return;
- swap(JOIN_TAB*,join->best_ref[idx],*pos);
+ swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
}
if (join->select_options & SELECT_STRAIGHT_JOIN)
break; // Don't test all combinations
@@ -5866,6 +5876,9 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
else // if we run out of slots or we are not using tempool
sprintf(path,"%s%s%lx_%lx_%x",mysql_tmpdir,tmp_file_prefix,current_pid,
thd->thread_id, thd->tmp_table++);
+
+ if (lower_case_table_names)
+ my_casedn_str(files_charset_info, path);
if (group)
{
@@ -6504,6 +6517,8 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
goto err2;
if (open_tmp_table(&new_table))
goto err1;
+ if (table->file->indexes_are_disabled())
+ new_table.file->disable_indexes(HA_KEY_SWITCH_ALL);
table->file->index_end();
table->file->rnd_init();
if (table->no_rows)
@@ -7115,8 +7130,8 @@ join_read_prev_same(READ_RECORD *info)
if ((error=table->file->index_prev(table->record[0])))
return report_error(table, error);
- if (key_cmp(table, tab->ref.key_buff, tab->ref.key,
- tab->ref.key_length))
+ if (key_cmp_if_same(table, tab->ref.key_buff, tab->ref.key,
+ tab->ref.key_length))
{
table->status=STATUS_NOT_FOUND;
error= -1;
@@ -10089,7 +10104,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
THD *thd=join->thd;
select_result *result=join->result;
Item *item_null= new Item_null();
- CHARSET_INFO *cs= &my_charset_latin1;
+ CHARSET_INFO *cs= system_charset_info;
DBUG_ENTER("select_describe");
DBUG_PRINT("info", ("Select 0x%lx, type %s, message %s",
(ulong)join->select_lex, join->select_lex->type,
@@ -10100,7 +10115,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
if (message)
{
- item_list.push_back(new Item_int((int32) join->select_lex->select_number));
+ item_list.push_back(new Item_int((int32)
+ join->select_lex->select_number));
item_list.push_back(new Item_string(join->select_lex->type,
strlen(join->select_lex->type), cs));
for (uint i=0 ; i < 7; i++)
@@ -10109,6 +10125,70 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
if (result->send_data(item_list))
join->error= 1;
}
+ else if (join->select_lex == join->unit->fake_select_lex)
+ {
+ /*
+ here we assume that the query will return at least two rows, so we
+ show "filesort" in EXPLAIN. Of course, sometimes we'll be wrong
+ and no filesort will be actually done, but executing all selects in
+ the UNION to provide precise EXPLAIN information will hardly be
+ appreciated :)
+ */
+ char table_name_buffer[NAME_LEN];
+ item_list.empty();
+ /* id */
+ item_list.push_back(new Item_null);
+ /* select_type */
+ item_list.push_back(new Item_string(join->select_lex->type,
+ strlen(join->select_lex->type),
+ cs));
+ /* table */
+ {
+ SELECT_LEX *sl= join->unit->first_select();
+ uint len= 6, lastop= 0;
+ memcpy(table_name_buffer, "<union", 6);
+ for (; sl && len + lastop + 5 < NAME_LEN; sl= sl->next_select())
+ {
+ len+= lastop;
+ lastop= my_snprintf(table_name_buffer + len, NAME_LEN - len,
+ "%u,", sl->select_number);
+ }
+ if (sl || len + lastop >= NAME_LEN)
+ {
+ memcpy(table_name_buffer + len, "...>", 5);
+ len+= 4;
+ }
+ else
+ {
+ len+= lastop;
+ table_name_buffer[len - 1]= '>'; // change ',' to '>'
+ }
+ item_list.push_back(new Item_string(table_name_buffer, len, cs));
+ }
+ /* type */
+ item_list.push_back(new Item_string(join_type_str[JT_ALL],
+ strlen(join_type_str[JT_ALL]),
+ cs));
+ /* possible_keys */
+ item_list.push_back(item_null);
+ /* key*/
+ item_list.push_back(item_null);
+ /* key_len */
+ item_list.push_back(item_null);
+ /* ref */
+ item_list.push_back(item_null);
+ /* rows */
+ item_list.push_back(item_null);
+ /* extra */
+ if (join->unit->global_parameters->order_list.first)
+ item_list.push_back(new Item_string("Using filesort",
+ 14, cs));
+ else
+ item_list.push_back(new Item_string("", 0, cs));
+
+ if (result->send_data(item_list))
+ join->error= 1;
+ }
else
{
table_map used_tables=0;
@@ -10119,7 +10199,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
char buff[512],*buff_ptr=buff;
char buff1[512], buff2[512], buff3[512];
char keylen_str_buf[64];
- char derived_name[64];
+ char table_name_buffer[NAME_LEN];
String tmp1(buff1,sizeof(buff1),cs);
String tmp2(buff2,sizeof(buff2),cs);
String tmp3(buff3,sizeof(buff3),cs);
@@ -10128,8 +10208,10 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
tmp3.length(0);
item_list.empty();
- item_list.push_back(new Item_int((int32)
+ /* id */
+ item_list.push_back(new Item_uint((uint32)
join->select_lex->select_number));
+ /* select_type */
item_list.push_back(new Item_string(join->select_lex->type,
strlen(join->select_lex->type),
cs));
@@ -10141,22 +10223,25 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
else
tab->type = JT_RANGE;
}
+ /* table */
if (table->derived_select_number)
{
/* Derived table name generation */
- int len= my_snprintf(derived_name, sizeof(derived_name)-1,
+ int len= my_snprintf(table_name_buffer, sizeof(table_name_buffer)-1,
"<derived%u>",
table->derived_select_number);
- item_list.push_back(new Item_string(derived_name, len, cs));
+ item_list.push_back(new Item_string(table_name_buffer, len, cs));
}
else
item_list.push_back(new Item_string(table->table_name,
strlen(table->table_name),
cs));
+ /* type */
item_list.push_back(new Item_string(join_type_str[tab->type],
strlen(join_type_str[tab->type]),
cs));
uint j;
+ /* possible_keys */
if (!tab->keys.is_clear_all())
{
for (j=0 ; j < table->keys ; j++)
@@ -10165,7 +10250,9 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
{
if (tmp1.length())
tmp1.append(',');
- tmp1.append(table->key_info[j].name);
+ tmp1.append(table->key_info[j].name,
+ strlen(table->key_info[j].name),
+ system_charset_info);
}
}
}
@@ -10173,6 +10260,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
item_list.push_back(new Item_string(tmp1.ptr(),tmp1.length(),cs));
else
item_list.push_back(item_null);
+ /* key key_len ref */
if (tab->ref.key_parts)
{
KEY *key_info=table->key_info+ tab->ref.key;
@@ -10188,7 +10276,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
{
if (tmp2.length())
tmp2.append(',');
- tmp2.append((*ref)->name());
+ tmp2.append((*ref)->name(), strlen((*ref)->name()),
+ system_charset_info);
}
item_list.push_back(new Item_string(tmp2.ptr(),tmp2.length(),cs));
}
@@ -10257,9 +10346,11 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
item_list.push_back(item_null);
item_list.push_back(item_null);
}
+ /* rows */
item_list.push_back(new Item_int((longlong) (ulonglong)
join->best_positions[i]. records_read,
21));
+ /* extra */
my_bool key_read=table->key_read;
if ((tab->type == JT_NEXT || tab->type == JT_CONST) &&
table->used_keys.is_set(tab->index))
@@ -10324,67 +10415,57 @@ int mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result)
DBUG_ENTER("mysql_explain_union");
int res= 0;
SELECT_LEX *first= unit->first_select();
+
for (SELECT_LEX *sl= first;
sl;
sl= sl->next_select())
{
// drop UNCACHEABLE_EXPLAIN, because it is for internal usage only
uint8 uncacheable= (sl->uncacheable & ~UNCACHEABLE_EXPLAIN);
-
- res= mysql_explain_select(thd, sl,
- (((&thd->lex->select_lex)==sl)?
- ((thd->lex->all_selects_list != sl) ?
- primary_key_name : "SIMPLE"):
- ((sl == first)?
- ((sl->linkage == DERIVED_TABLE_TYPE) ?
- "DERIVED":
- ((uncacheable & UNCACHEABLE_DEPENDENT) ?
- "DEPENDENT SUBQUERY":
- (uncacheable?"UNCACHEABLE SUBQUERY":
- "SUBQUERY"))):
- ((uncacheable & UNCACHEABLE_DEPENDENT) ?
- "DEPENDENT UNION":
- uncacheable?"UNCACHEABLE UNION":
- "UNION"))),
- result);
- if (res)
- break;
-
- }
- if (res > 0 || thd->net.report_error)
- res= -1; // mysql_explain_select do not report error
- DBUG_RETURN(res);
-}
-
-
-int mysql_explain_select(THD *thd, SELECT_LEX *select_lex, char const *type,
- select_result *result)
-{
- DBUG_ENTER("mysql_explain_select");
- DBUG_PRINT("info", ("Select 0x%lx, type %s", (ulong)select_lex, type))
- select_lex->type= type;
- thd->lex->current_select= select_lex;
- SELECT_LEX_UNIT *unit= select_lex->master_unit();
- if (select_lex == unit->global_parameters &&
- unit->first_select()->next_select())
- {
- unit->offset_limit_cnt= 0;
- unit->select_limit_cnt= HA_POS_ERROR;
+ sl->type= (((&thd->lex->select_lex)==sl)?
+ ((thd->lex->all_selects_list != sl) ?
+ primary_key_name : "SIMPLE"):
+ ((sl == first)?
+ ((sl->linkage == DERIVED_TABLE_TYPE) ?
+ "DERIVED":
+ ((uncacheable & UNCACHEABLE_DEPENDENT) ?
+ "DEPENDENT SUBQUERY":
+ (uncacheable?"UNCACHEABLE SUBQUERY":
+ "SUBQUERY"))):
+ ((uncacheable & UNCACHEABLE_DEPENDENT) ?
+ "DEPENDENT UNION":
+ uncacheable?"UNCACHEABLE UNION":
+ "UNION")));
+ sl->options|= SELECT_DESCRIBE;
+ }
+ if (first->next_select())
+ {
+ unit->fake_select_lex->select_number= UINT_MAX; // jost for initialization
+ unit->fake_select_lex->type= "UNION RESULT";
+ unit->fake_select_lex->options|= SELECT_DESCRIBE;
+ if (!(res= unit->prepare(thd, result, SELECT_NO_UNLOCK | SELECT_DESCRIBE)))
+ res= unit->exec();
+ res|= unit->cleanup();
}
else
- unit->set_limit(select_lex, select_lex);
- int res= mysql_select(thd, &select_lex->ref_pointer_array,
- (TABLE_LIST*) select_lex->table_list.first,
- select_lex->with_wild, select_lex->item_list,
- select_lex->where,
- select_lex->order_list.elements +
- select_lex->group_list.elements,
- (ORDER*) select_lex->order_list.first,
- (ORDER*) select_lex->group_list.first,
- select_lex->having,
+ {
+ thd->lex->current_select= first;
+ unit->set_limit(unit->global_parameters, first);
+ res= mysql_select(thd, &first->ref_pointer_array,
+ (TABLE_LIST*) first->table_list.first,
+ first->with_wild, first->item_list,
+ first->where,
+ first->order_list.elements +
+ first->group_list.elements,
+ (ORDER*) first->order_list.first,
+ (ORDER*) first->group_list.first,
+ first->having,
(ORDER*) thd->lex->proc_list.first,
- select_lex->options | thd->options | SELECT_DESCRIBE,
- result, unit, select_lex);
+ first->options | thd->options | SELECT_DESCRIBE,
+ result, unit, first);
+ }
+ if (res > 0 || thd->net.report_error)
+ res= -1; // mysql_explain_select do not report error
DBUG_RETURN(res);
}
@@ -10399,23 +10480,23 @@ void st_select_lex::print(THD *thd, String *str)
//options
if (options & SELECT_STRAIGHT_JOIN)
str->append("straight_join ", 14);
- if ((thd->lex->lock_option & TL_READ_HIGH_PRIORITY) &&
+ if ((thd->lex->lock_option == TL_READ_HIGH_PRIORITY) &&
(this == &thd->lex->select_lex))
str->append("high_priority ", 14);
if (options & SELECT_DISTINCT)
str->append("distinct ", 9);
if (options & SELECT_SMALL_RESULT)
- str->append("small_result ", 13);
+ str->append("sql_small_result ", 17);
if (options & SELECT_BIG_RESULT)
- str->append("big_result ", 11);
+ str->append("sql_big_result ", 15);
if (options & OPTION_BUFFER_RESULT)
- str->append("buffer_result ", 14);
+ str->append("sql_buffer_result ", 18);
if (options & OPTION_FOUND_ROWS)
- str->append("calc_found_rows ", 16);
+ str->append("sql_calc_found_rows ", 20);
if (!thd->lex->safe_to_cache_query)
- str->append("no_cache ", 9);
+ str->append("sql_no_cache ", 13);
if (options & OPTION_TO_QUERY_CACHE)
- str->append("cache ", 6);
+ str->append("sql_cache ", 10);
//Item List
bool first= 1;
@@ -10543,3 +10624,27 @@ void st_select_lex::print(THD *thd, String *str)
// PROCEDURE unsupported here
}
+
+
+/*
+ change select_result object of JOIN
+
+ SYNOPSIS
+ JOIN::change_result()
+ res new select_result object
+
+ RETURN
+ 0 - OK
+ -1 - error
+*/
+
+int JOIN::change_result(select_result *res)
+{
+ DBUG_ENTER("JOIN::change_result");
+ result= res;
+ if (!procedure && result->prepare(fields_list, select_lex->master_unit()))
+ {
+ DBUG_RETURN(-1);
+ }
+ DBUG_RETURN(0);
+}
diff --git a/sql/sql_select.h b/sql/sql_select.h
index b8a56fda757..85033f1e167 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -306,6 +306,7 @@ class JOIN :public Sql_alloc
return (do_send_rows && tmp_table_param.sum_func_count != 0 &&
!group_list);
}
+ int change_result(select_result *result);
};
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 95e9da6ec62..e481a961288 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -422,7 +422,7 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path,
{
if (lower_case_table_names)
{
- if (wild_case_compare(system_charset_info,file->name,wild))
+ if (wild_case_compare(files_charset_info, file->name, wild))
continue;
}
else if (wild_compare(file->name,wild,0))
@@ -1207,7 +1207,7 @@ store_create_info(THD *thd, TABLE *table, String *packet)
{
List<Item> field_list;
char tmp[MAX_FIELD_WIDTH], *for_str, buff[128], *end, *alias;
- String type(tmp, sizeof(tmp),&my_charset_bin);
+ String type(tmp, sizeof(tmp), system_charset_info);
Field **ptr,*field;
uint primary_key;
KEY *key_info;
@@ -1254,7 +1254,7 @@ store_create_info(THD *thd, TABLE *table, String *packet)
type.set(tmp, sizeof(tmp),&my_charset_bin);
field->sql_type(type);
- packet->append(type.ptr(),type.length());
+ packet->append(type.ptr(), type.length(), system_charset_info);
if (field->has_charset() && !limited_mysql_mode && !foreign_db_mode)
{
@@ -1313,7 +1313,7 @@ store_create_info(THD *thd, TABLE *table, String *packet)
else if (field->maybe_null())
packet->append("NULL", 4); // Null as default
else
- packet->append(tmp,0);
+ packet->append(tmp);
}
if (!foreign_db_mode && !limited_mysql_mode &&
@@ -1597,10 +1597,13 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
thd_info->query=0;
if (tmp->query)
{
- /* query_length is always set before tmp->query */
+ /*
+ query_length is always set to 0 when we set query = NULL; see
+ the comment in sql_class.h why this prevents crashes in possible
+ races with query_length
+ */
uint length= min(max_query_length, tmp->query_length);
- thd_info->query=(char*) thd->memdup(tmp->query,length+1);
- thd_info->query[length]=0;
+ thd_info->query=(char*) thd->strmake(tmp->query,length);
}
thread_infos.append(thd_info);
}
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 7c3f9bc5cde..4d85438b03f 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -416,16 +416,18 @@ bool String::append(const String &s)
/*
- Append a latin1 string to the a string of the current character set
+ Append an ASCII string to the a string of the current character set
*/
-
bool String::append(const char *s,uint32 arg_length)
{
- if (!arg_length) // Default argument
- if (!(arg_length= (uint32) strlen(s)))
- return FALSE;
- if (str_charset->mbmaxlen > 1)
+ if (!arg_length)
+ return FALSE;
+
+ /*
+ For an ASCII incompatible string, e.g. UCS-2, we need to convert
+ */
+ if (str_charset->mbminlen > 1)
{
uint32 add_length=arg_length * str_charset->mbmaxlen;
if (realloc(str_length+ add_length))
@@ -434,6 +436,10 @@ bool String::append(const char *s,uint32 arg_length)
s, arg_length, &my_charset_latin1);
return FALSE;
}
+
+ /*
+ For an ASCII compatinble string we can just append.
+ */
if (realloc(str_length+arg_length))
return TRUE;
memcpy(Ptr+str_length,s,arg_length);
@@ -443,29 +449,39 @@ bool String::append(const char *s,uint32 arg_length)
/*
+ Append a 0-terminated ASCII string
+*/
+
+bool String::append(const char *s)
+{
+ return append(s, strlen(s));
+}
+
+
+/*
Append a string in the given charset to the string
with character set recoding
*/
-
bool String::append(const char *s,uint32 arg_length, CHARSET_INFO *cs)
{
- if (!arg_length) // Default argument
- if (!(arg_length= (uint32) strlen(s)))
- return FALSE;
- if (cs != str_charset && str_charset->mbmaxlen > 1)
+ uint32 dummy_offset;
+
+ if (needs_conversion(arg_length, cs, str_charset, &dummy_offset))
{
- uint32 add_length=arg_length * str_charset->mbmaxlen;
- if (realloc(str_length+ add_length))
+ uint32 add_length= arg_length / cs->mbminlen * str_charset->mbmaxlen;
+ if (realloc(str_length + add_length))
return TRUE;
str_length+= copy_and_convert(Ptr+str_length, add_length, str_charset,
s, arg_length, cs);
- return FALSE;
}
- if (realloc(str_length+arg_length))
- return TRUE;
- memcpy(Ptr+str_length,s,arg_length);
- str_length+=arg_length;
+ else
+ {
+ if (realloc(str_length + arg_length))
+ return TRUE;
+ memcpy(Ptr + str_length, s, arg_length);
+ str_length+= arg_length;
+ }
return FALSE;
}
@@ -554,40 +570,6 @@ skip:
}
/*
- Search after a string without regarding to case
- This needs to be replaced when we have character sets per string
-*/
-
-int String::strstr_case(const String &s,uint32 offset)
-{
- if (s.length()+offset <= str_length)
- {
- if (!s.length())
- return ((int) offset); // Empty string is always found
-
- register const char *str = Ptr+offset;
- register const char *search=s.ptr();
- const char *end=Ptr+str_length-s.length()+1;
- const char *search_end=s.ptr()+s.length();
-skip:
- while (str != end)
- {
- if (str_charset->sort_order[*str++] == str_charset->sort_order[*search])
- {
- register char *i,*j;
- i=(char*) str; j=(char*) search+1;
- while (j != search_end)
- if (str_charset->sort_order[*i++] !=
- str_charset->sort_order[*j++])
- goto skip;
- return (int) (str-Ptr) -1;
- }
- }
- }
- return -1;
-}
-
-/*
** Search string from end. Offset is offset to the end of string
*/
@@ -871,3 +853,23 @@ void String::print(String *str)
}
}
}
+
+
+/*
+ Exchange state of this object and argument.
+
+ SYNOPSIS
+ String::swap()
+
+ RETURN
+ Target string will contain state of this object and vice versa.
+*/
+
+void String::swap(String &s)
+{
+ swap_variables(char *, Ptr, s.Ptr);
+ swap_variables(uint32, str_length, s.str_length);
+ swap_variables(uint32, Alloced_length, s.Alloced_length);
+ swap_variables(bool, alloced, s.alloced);
+ swap_variables(CHARSET_INFO*, str_charset, s.str_charset);
+}
diff --git a/sql/sql_string.h b/sql/sql_string.h
index 1c559b597ba..79365b7481b 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -190,13 +190,13 @@ public:
bool copy(const char*s,uint32 arg_length, CHARSET_INFO *csfrom,
CHARSET_INFO *csto);
bool append(const String &s);
- bool append(const char *s,uint32 arg_length=0);
+ bool append(const char *s);
+ bool append(const char *s,uint32 arg_length);
bool append(const char *s,uint32 arg_length, CHARSET_INFO *cs);
bool append(IO_CACHE* file, uint32 arg_length);
bool append_with_prefill(const char *s, uint32 arg_length,
uint32 full_length, char fill_char);
int strstr(const String &search,uint32 offset=0); // Returns offset to substring or -1
- int strstr_case(const String &s,uint32 offset=0);
int strrstr(const String &search,uint32 offset=0); // Returns offset to substring or -1
bool replace(uint32 offset,uint32 arg_length,const char *to,uint32 length);
bool replace(uint32 offset,uint32 arg_length,const String &to);
@@ -301,4 +301,7 @@ public:
return FALSE;
}
void print(String *print);
+
+ /* Swap two string objects. Efficient way to exchange data without memcpy. */
+ void swap(String &s);
};
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index f6087392dc1..d05b5a6cbc7 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (C) 2000-2004 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -635,12 +635,13 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
/* Create keys */
- List_iterator<Key> key_iterator(keys);
+ List_iterator<Key> key_iterator(keys), key_iterator2(keys);
uint key_parts=0, fk_key_count=0;
- List<Key> keys_in_order; // Add new keys here
bool primary_key=0,unique_key=0;
- Key *key;
+ Key *key, *key2;
uint tmp, key_number;
+ /* special marker for keys to be ignored */
+ static char ignore_key[1];
/* Calculate number of key segements */
*key_count= 0;
@@ -673,7 +674,40 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
my_error(ER_TOO_LONG_IDENT, MYF(0), key->name);
DBUG_RETURN(-1);
}
- key_parts+=key->columns.elements;
+ key_iterator2.rewind ();
+ if (key->type != Key::FOREIGN_KEY)
+ {
+ while ((key2 = key_iterator2++) != key)
+ {
+ /*
+ foreign_key_prefix(key, key2) returns 0 if key or key2, or both, is
+ 'generated', and a generated key is a prefix of the other key.
+ Then we do not need the generated shorter key.
+ */
+ if ((key2->type != Key::FOREIGN_KEY &&
+ key2->name != ignore_key &&
+ !foreign_key_prefix(key, key2)))
+ {
+ /* TODO: issue warning message */
+ /* mark that the generated key should be ignored */
+ if (!key2->generated ||
+ (key->generated && key->columns.elements <
+ key2->columns.elements))
+ key->name= ignore_key;
+ else
+ {
+ key2->name= ignore_key;
+ key_parts-= key2->columns.elements;
+ (*key_count)--;
+ }
+ break;
+ }
+ }
+ }
+ if (key->name != ignore_key)
+ key_parts+=key->columns.elements;
+ else
+ (*key_count)--;
if (key->name && !tmp_table &&
!my_strcasecmp(system_charset_info,key->name,primary_key_name))
{
@@ -700,16 +734,26 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
uint key_length=0;
key_part_spec *column;
+ if (key->name == ignore_key)
+ {
+ /* ignore redundant keys */
+ do
+ key=key_iterator++;
+ while (key && key->name == ignore_key);
+ if (!key)
+ break;
+ }
+
switch(key->type){
case Key::MULTIPLE:
- key_info->flags = 0;
+ key_info->flags= 0;
break;
case Key::FULLTEXT:
- key_info->flags = HA_FULLTEXT;
+ key_info->flags= HA_FULLTEXT;
break;
case Key::SPATIAL:
#ifdef HAVE_SPATIAL
- key_info->flags = HA_SPATIAL;
+ key_info->flags= HA_SPATIAL;
break;
#else
my_printf_error(ER_FEATURE_DISABLED,ER(ER_FEATURE_DISABLED),MYF(0),
@@ -720,8 +764,11 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
key_number--; // Skip this key
continue;
default:
- key_info->flags = HA_NOSAME;
+ key_info->flags = HA_NOSAME;
+ break;
}
+ if (key->generated)
+ key_info->flags|= HA_GENERATED_KEY;
key_info->key_parts=(uint8) key->columns.elements;
key_info->key_part=key_part_info;
@@ -745,7 +792,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
*/
/* TODO: Add proper checks if handler supports key_type and algorithm */
- if (key_info->flags == HA_SPATIAL)
+ if (key_info->flags & HA_SPATIAL)
{
if (key_info->key_parts != 1)
{
@@ -1108,6 +1155,8 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
my_snprintf(path, sizeof(path), "%s%s%lx_%lx_%x%s",
mysql_tmpdir, tmp_file_prefix, current_pid, thd->thread_id,
thd->tmp_table++, reg_ext);
+ if (lower_case_table_names)
+ my_casedn_str(files_charset_info, path);
create_info->table_options|=HA_CREATE_DELAY_KEY_WRITE;
}
else
@@ -1339,11 +1388,11 @@ mysql_rename_table(enum db_type base,
{
/* Table handler expects to get all file names as lower case */
strmov(tmp_from, old_name);
- my_casedn_str(system_charset_info, tmp_from);
+ my_casedn_str(files_charset_info, tmp_from);
old_name= tmp_from;
strmov(tmp_to, new_name);
- my_casedn_str(system_charset_info, tmp_to);
+ my_casedn_str(files_charset_info, tmp_to);
new_name= tmp_to;
}
my_snprintf(from, sizeof(from), "%s/%s/%s",
@@ -2030,6 +2079,8 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table,
my_snprintf(dst_path, sizeof(dst_path), "%s%s%lx_%lx_%x%s",
mysql_tmpdir, tmp_file_prefix, current_pid,
thd->thread_id, thd->tmp_table++, reg_ext);
+ if (lower_case_table_names)
+ my_casedn_str(files_charset_info, dst_path);
create_info->table_options|= HA_CREATE_DELAY_KEY_WRITE;
}
else
@@ -2409,14 +2460,10 @@ int mysql_drop_indexes(THD *thd, TABLE_LIST *table_list,
int mysql_alter_table(THD *thd,char *new_db, char *new_name,
HA_CREATE_INFO *create_info,
TABLE_LIST *table_list,
- List<create_field> &fields,
- List<Key> &keys,List<Alter_drop> &drop_list,
- List<Alter_column> &alter_list,
- uint order_num, ORDER *order, uint alter_flags,
+ List<create_field> &fields, List<Key> &keys,
+ uint order_num, ORDER *order,
enum enum_duplicates handle_duplicates,
- enum enum_enable_or_disable keys_onoff,
- enum tablespace_op_type tablespace_op,
- bool simple_alter)
+ ALTER_INFO *alter_info)
{
TABLE *table,*new_table;
int error;
@@ -2441,9 +2488,9 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
mysql_ha_closeall(thd, table_list);
/* DISCARD/IMPORT TABLESPACE is always alone in an ALTER TABLE */
- if (tablespace_op != NO_TABLESPACE_OP)
+ if (alter_info->tablespace_op != NO_TABLESPACE_OP)
DBUG_RETURN(mysql_discard_or_import_tablespace(thd,table_list,
- tablespace_op));
+ alter_info->tablespace_op));
if (!(table=open_ltable(thd,table_list,TL_WRITE_ALLOW_READ)))
DBUG_RETURN(-1);
@@ -2456,10 +2503,10 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
{
if (lower_case_table_names != 2)
{
- my_casedn_str(system_charset_info, new_name_buff);
+ my_casedn_str(files_charset_info, new_name_buff);
new_alias= new_name; // Create lower case table name
}
- my_casedn_str(system_charset_info, new_name);
+ my_casedn_str(files_charset_info, new_name);
}
if (new_db == db &&
!my_strcasecmp(table_alias_charset, new_name_buff, table_name))
@@ -2512,7 +2559,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
create_info->row_type=table->row_type;
thd->proc_info="setup";
- if (simple_alter && !table->tmp_table)
+ if (alter_info->is_simple && !table->tmp_table)
{
error=0;
if (new_name != table_name || new_db != db)
@@ -2538,21 +2585,21 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
if (!error)
{
- switch (keys_onoff) {
+ switch (alter_info->keys_onoff) {
case LEAVE_AS_IS:
break;
case ENABLE:
VOID(pthread_mutex_lock(&LOCK_open));
wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
VOID(pthread_mutex_unlock(&LOCK_open));
- error= table->file->enable_indexes();
+ error= table->file->enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
/* COND_refresh will be signaled in close_thread_tables() */
break;
case DISABLE:
VOID(pthread_mutex_lock(&LOCK_open));
wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
VOID(pthread_mutex_unlock(&LOCK_open));
- error=table->file->disable_indexes(0, 1);
+ error=table->file->disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
/* COND_refresh will be signaled in close_thread_tables() */
break;
}
@@ -2597,9 +2644,9 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
create_info->default_table_charset= table->table_charset;
restore_record(table,default_values); // Empty record for DEFAULT
- List_iterator<Alter_drop> drop_it(drop_list);
+ List_iterator<Alter_drop> drop_it(alter_info->drop_list);
List_iterator<create_field> def_it(fields);
- List_iterator<Alter_column> alter_it(alter_list);
+ List_iterator<Alter_column> alter_it(alter_info->alter_list);
List<create_field> create_list; // Add new fields here
List<Key> key_list; // Add new keys here
create_field *def;
@@ -2703,9 +2750,10 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
find_it.after(def); // Put element after this
}
}
- if (alter_list.elements)
+ if (alter_info->alter_list.elements)
{
- my_error(ER_BAD_FIELD_ERROR,MYF(0),alter_list.head()->name,table_name);
+ my_error(ER_BAD_FIELD_ERROR,MYF(0),alter_info->alter_list.head()->name,
+ table_name);
DBUG_RETURN(-1);
}
if (!create_list.elements)
@@ -2787,6 +2835,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
Key::FULLTEXT : Key::MULTIPLE)),
key_name,
key_info->algorithm,
+ test(key_info->flags & HA_GENERATED_KEY),
key_parts));
}
{
@@ -2804,14 +2853,16 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
}
- if (drop_list.elements)
+ if (alter_info->drop_list.elements)
{
- my_error(ER_CANT_DROP_FIELD_OR_KEY,MYF(0),drop_list.head()->name);
+ my_error(ER_CANT_DROP_FIELD_OR_KEY,MYF(0),
+ alter_info->drop_list.head()->name);
goto err;
}
- if (alter_list.elements)
+ if (alter_info->alter_list.elements)
{
- my_error(ER_CANT_DROP_FIELD_OR_KEY,MYF(0),alter_list.head()->name);
+ my_error(ER_CANT_DROP_FIELD_OR_KEY,MYF(0),
+ alter_info->alter_list.head()->name);
goto err;
}
@@ -2820,7 +2871,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
current_pid, thd->thread_id);
/* Safety fix for innodb */
if (lower_case_table_names)
- my_casedn_str(system_charset_info, tmp_name);
+ my_casedn_str(files_charset_info, tmp_name);
create_info->db_type=new_db_type;
if (!create_info->comment)
create_info->comment=table->comment;
@@ -2984,6 +3035,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
thd->proc_info="rename result table";
my_snprintf(old_name, sizeof(old_name), "%s2-%lx-%lx", tmp_file_prefix,
current_pid, thd->thread_id);
+ if (lower_case_table_names)
+ my_casedn_str(files_charset_info, old_name);
if (new_name != table_name || new_db != db)
{
if (!access(new_name_buff,F_OK))
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index bbe97cf086f..90a43f82a94 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -319,8 +319,10 @@ print_plan(JOIN* join, double read_time, double record_count,
{
join_table= (*plan_nodes);
fputs(join_table->table->real_name, DBUG_FILE);
- fprintf(DBUG_FILE, "(%u,%u,%u)",
- join_table->found_records, join_table->records, join_table->read_time);
+ fprintf(DBUG_FILE, "(%lu,%lu,%lu)",
+ (ulong) join_table->found_records,
+ (ulong) join_table->records,
+ (ulong) join_table->read_time);
fputc(' ', DBUG_FILE);
}
fputc('\n', DBUG_FILE);
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 8136ce44d1d..2b7c0d8f0c0 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -41,7 +41,7 @@ int mysql_union(THD *thd, LEX *lex, select_result *result,
***************************************************************************/
select_union::select_union(TABLE *table_par)
- :table(table_par), not_describe(0)
+ :table(table_par)
{
bzero((char*) &info,sizeof(info));
/*
@@ -120,7 +120,7 @@ bool select_union::flush()
ulong
st_select_lex_unit::init_prepare_fake_select_lex(THD *thd)
{
- ulong options_tmp= thd->options;
+ ulong options_tmp= thd->options | fake_select_lex->options;
thd->lex->current_select= fake_select_lex;
offset_limit_cnt= global_parameters->offset_limit;
select_limit_cnt= global_parameters->select_limit +
@@ -149,6 +149,8 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
select_result *tmp_result;
DBUG_ENTER("st_select_lex_unit::prepare");
+ describe= test(additional_options & SELECT_DESCRIBE);
+
/*
result object should be reassigned even if preparing already done for
max/min subquery (ALL/ANY optimization)
@@ -156,7 +158,26 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
result= sel_result;
if (prepared)
+ {
+ if (describe)
+ {
+ /* fast reinit for EXPLAIN */
+ for (sl= first_select_in_union(); sl; sl= sl->next_select())
+ {
+ sl->join->result= result;
+ select_limit_cnt= HA_POS_ERROR;
+ offset_limit_cnt= 0;
+ if (!sl->join->procedure &&
+ result->prepare(sl->join->fields_list, this))
+ {
+ DBUG_RETURN(1);
+ }
+ sl->join->select_options|= SELECT_DESCRIBE;
+ sl->join->reinit();
+ }
+ }
DBUG_RETURN(0);
+ }
prepared= 1;
res= 0;
@@ -169,8 +190,9 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
{
if (!(tmp_result= union_result= new select_union(0)))
goto err;
- union_result->not_describe= 1;
union_result->tmp_table_param.init();
+ if (describe)
+ tmp_result= sel_result;
}
else
{
@@ -262,27 +284,32 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
thd_arg->lex->current_select= lex_select_save;
if (!item_list.elements)
{
- Statement *stmt= thd->current_statement;
- Statement backup;
- if (stmt)
- thd->set_n_backup_item_arena(stmt, &backup);
+ Item_arena *arena= thd->current_arena;
+ Item_arena backup;
+ if (arena)
+ thd->set_n_backup_item_arena(arena, &backup);
Field **field;
for (field= table->field; *field; field++)
{
Item_field *item= new Item_field(*field);
if (!item || item_list.push_back(item))
{
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
+ if (arena)
+ thd->restore_backup_item_arena(arena, &backup);
DBUG_RETURN(-1);
}
}
- if (stmt)
+ if (arena)
{
- thd->restore_backup_item_arena(stmt, &backup);
+ thd->restore_backup_item_arena(arena, &backup);
/* prepare fake select to initialize it correctly */
ulong options_tmp= init_prepare_fake_select_lex(thd);
+ /*
+ it should be done only once (because item_list builds only onece
+ per statement)
+ */
+ DBUG_ASSERT(fake_select_lex->join == 0);
if (!(fake_select_lex->join= new JOIN(thd, item_list, thd->options,
result)))
{
@@ -324,20 +351,24 @@ int st_select_lex_unit::exec()
ulonglong add_rows=0;
DBUG_ENTER("st_select_lex_unit::exec");
- if (executed && !uncacheable)
+ if (executed && !uncacheable && !describe)
DBUG_RETURN(0);
executed= 1;
- if (uncacheable || !item || !item->assigned())
+ if (uncacheable || !item || !item->assigned() || describe)
{
- if (optimized && item && item->assigned())
+ if (optimized && item)
{
- item->assigned(0); // We will reinit & rexecute unit
- item->reset();
- table->file->delete_all_rows();
+ if (item->assigned())
+ {
+ item->assigned(0); // We will reinit & rexecute unit
+ item->reset();
+ table->file->delete_all_rows();
+ }
+ /* re-enabling indexes for next subselect iteration */
+ if (union_distinct && table->file->enable_indexes(HA_KEY_SWITCH_ALL))
+ DBUG_ASSERT(1);
}
- if (union_distinct) // for subselects
- table->file->extra(HA_EXTRA_CHANGE_KEY_TO_UNIQUE);
for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select())
{
ha_rows records_at_start= 0;
@@ -347,7 +378,7 @@ int st_select_lex_unit::exec()
res= sl->join->reinit();
else
{
- if (sl != global_parameters)
+ if (sl != global_parameters && !describe)
{
offset_limit_cnt= sl->offset_limit;
select_limit_cnt= sl->select_limit+sl->offset_limit;
@@ -359,7 +390,7 @@ int st_select_lex_unit::exec()
We can't use LIMIT at this stage if we are using ORDER BY for the
whole query
*/
- if (sl->order_list.first)
+ if (sl->order_list.first || describe)
select_limit_cnt= HA_POS_ERROR;
else
select_limit_cnt= sl->select_limit+sl->offset_limit;
@@ -389,7 +420,11 @@ int st_select_lex_unit::exec()
records_at_start= table->file->records;
sl->join->exec();
if (sl == union_distinct)
- table->file->extra(HA_EXTRA_CHANGE_KEY_TO_DUP);
+ {
+ if (table->file->disable_indexes(HA_KEY_SWITCH_ALL))
+ DBUG_RETURN(1);
+ table->no_keyread=1;
+ }
res= sl->join->error;
offset_limit_cnt= sl->offset_limit;
if (!res && union_result->flush())
@@ -452,7 +487,9 @@ int st_select_lex_unit::exec()
else
{
JOIN_TAB *tab,*end;
- for (tab=join->join_tab,end=tab+join->tables ; tab != end ; tab++)
+ for (tab=join->join_tab, end=tab+join->tables ;
+ tab && tab != end ;
+ tab++)
{
delete tab->select;
delete tab->quick;
@@ -552,3 +589,32 @@ void st_select_lex_unit::reinit_exec_mechanism()
}
#endif
}
+
+
+/*
+ change select_result object of unit
+
+ SYNOPSIS
+ st_select_lex_unit::change_result()
+ result new select_result object
+ old_result old select_result object
+
+ RETURN
+ 0 - OK
+ -1 - error
+*/
+
+int st_select_lex_unit::change_result(select_subselect *result,
+ select_subselect *old_result)
+{
+ int res= 0;
+ for (SELECT_LEX *sl= first_select_in_union(); sl; sl= sl->next_select())
+ {
+ if (sl->join && sl->join->result == old_result)
+ if ((res= sl->join->change_result(result)))
+ return (res);
+ }
+ if (fake_select_lex && fake_select_lex->join)
+ res= fake_select_lex->join->change_result(result);
+ return (res);
+}
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 918a4c769b4..5c6ed023485 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -425,6 +425,7 @@ int mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
TABLE *table= table_list->table;
TABLE_LIST tables;
List<Item> all_fields;
+ SELECT_LEX *select_lex= &thd->lex->select_lex;
DBUG_ENTER("mysql_prepare_update");
#ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -437,10 +438,10 @@ int mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
if (setup_tables(update_table_list) ||
setup_conds(thd, update_table_list, conds) ||
- thd->lex->select_lex.setup_ref_array(thd, order_num) ||
- setup_order(thd, thd->lex->select_lex.ref_pointer_array,
+ select_lex->setup_ref_array(thd, order_num) ||
+ setup_order(thd, select_lex->ref_pointer_array,
update_table_list, all_fields, all_fields, order) ||
- setup_ftfuncs(&thd->lex->select_lex))
+ setup_ftfuncs(select_lex))
DBUG_RETURN(-1);
/* Check that we are not using table that we are updating in a sub select */
@@ -450,6 +451,11 @@ int mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->real_name);
DBUG_RETURN(-1);
}
+ if (thd->current_arena && select_lex->first_execution)
+ {
+ select_lex->prep_where= select_lex->where;
+ select_lex->first_execution= 0;
+ }
DBUG_RETURN(0);
}
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 0874abaca9c..40c0626b33c 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -977,11 +977,7 @@ create:
THD *thd= YYTHD;
LEX *lex=Lex;
lex->sql_command= SQLCOM_CREATE_TABLE;
- if (!lex->select_lex.add_table_to_list(thd,$5,
- ($2 &
- HA_LEX_CREATE_TMP_TABLE ?
- &tmp_table_alias :
- (LEX_STRING*) 0),
+ if (!lex->select_lex.add_table_to_list(thd, $5, NULL,
TL_OPTION_UPDATING,
(using_update_log ?
TL_READ_NO_INSERT:
@@ -1015,7 +1011,7 @@ create:
{
LEX *lex=Lex;
- lex->key_list.push_back(new Key($2,$4.str, $5, lex->col_list));
+ lex->key_list.push_back(new Key($2,$4.str, $5, 0, lex->col_list));
lex->col_list.empty();
}
| CREATE DATABASE opt_if_not_exists ident
@@ -2218,7 +2214,6 @@ merge_insert_types:
opt_select_from:
opt_limit_clause {}
- | FROM DUAL_SYM {}
| select_from select_lock_type;
udf_func_type:
@@ -2252,25 +2247,29 @@ key_def:
key_type opt_ident key_alg '(' key_list ')'
{
LEX *lex=Lex;
- lex->key_list.push_back(new Key($1,$2, $3, lex->col_list));
+ lex->key_list.push_back(new Key($1,$2, $3, 0, lex->col_list));
lex->col_list.empty(); /* Alloced by sql_alloc */
}
| opt_constraint constraint_key_type opt_ident key_alg '(' key_list ')'
{
LEX *lex=Lex;
const char *key_name= $3 ? $3:$1;
- lex->key_list.push_back(new Key($2, key_name, $4, lex->col_list));
+ lex->key_list.push_back(new Key($2, key_name, $4, 0,
+ lex->col_list));
lex->col_list.empty(); /* Alloced by sql_alloc */
}
| opt_constraint FOREIGN KEY_SYM opt_ident '(' key_list ')' references
{
LEX *lex=Lex;
- lex->key_list.push_back(new foreign_key($4, lex->col_list,
+ lex->key_list.push_back(new foreign_key($4 ? $4:$1, lex->col_list,
$8,
lex->ref_list,
lex->fk_delete_opt,
lex->fk_update_opt,
lex->fk_match_option));
+ lex->key_list.push_back(new Key(Key::MULTIPLE, $4 ? $4 : $1,
+ HA_KEY_ALG_UNDEF, 1,
+ lex->col_list));
lex->col_list.empty(); /* Alloced by sql_alloc */
}
| constraint opt_check_constraint
@@ -2521,25 +2520,25 @@ attribute:
{
LEX *lex=Lex;
lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNIQUE_FLAG;
- lex->alter_flags|= ALTER_ADD_INDEX;
+ lex->alter_info.flags|= ALTER_ADD_INDEX;
}
| opt_primary KEY_SYM
{
LEX *lex=Lex;
lex->type|= PRI_KEY_FLAG | NOT_NULL_FLAG;
- lex->alter_flags|= ALTER_ADD_INDEX;
+ lex->alter_info.flags|= ALTER_ADD_INDEX;
}
| UNIQUE_SYM
{
LEX *lex=Lex;
lex->type|= UNIQUE_FLAG;
- lex->alter_flags|= ALTER_ADD_INDEX;
+ lex->alter_info.flags|= ALTER_ADD_INDEX;
}
| UNIQUE_SYM KEY_SYM
{
LEX *lex=Lex;
lex->type|= UNIQUE_KEY_FLAG;
- lex->alter_flags|= ALTER_ADD_INDEX;
+ lex->alter_info.flags|= ALTER_ADD_INDEX;
}
| COMMENT_SYM TEXT_STRING_sys { Lex->comment= &$2; }
| BINARY { Lex->type|= BINCMP_FLAG; }
@@ -2787,18 +2786,15 @@ alter:
lex->create_list.empty();
lex->key_list.empty();
lex->col_list.empty();
- lex->drop_list.empty();
- lex->alter_list.empty();
lex->select_lex.init_order();
lex->select_lex.db=lex->name=0;
bzero((char*) &lex->create_info,sizeof(lex->create_info));
lex->create_info.db_type= DB_TYPE_DEFAULT;
lex->create_info.default_table_charset= thd->variables.collation_database;
lex->create_info.row_type= ROW_TYPE_NOT_USED;
- lex->alter_keys_onoff=LEAVE_AS_IS;
- lex->tablespace_op=NO_TABLESPACE_OP;
- lex->simple_alter=1;
- lex->alter_flags=0;
+ lex->alter_info.clear();
+ lex->alter_info.is_simple= 1;
+ lex->alter_info.flags= 0;
}
alter_list
{}
@@ -2841,8 +2837,8 @@ alter:
;
alter_list:
- | DISCARD TABLESPACE { Lex->tablespace_op=DISCARD_TABLESPACE; }
- | IMPORT TABLESPACE { Lex->tablespace_op=IMPORT_TABLESPACE; }
+ | DISCARD TABLESPACE { Lex->alter_info.tablespace_op= DISCARD_TABLESPACE; }
+ | IMPORT TABLESPACE { Lex->alter_info.tablespace_op= IMPORT_TABLESPACE; }
| alter_list_item
| alter_list ',' alter_list_item;
@@ -2851,24 +2847,24 @@ add_column:
{
LEX *lex=Lex;
lex->change=0;
- lex->alter_flags|= ALTER_ADD_COLUMN;
+ lex->alter_info.flags|= ALTER_ADD_COLUMN;
};
alter_list_item:
- add_column column_def opt_place { Lex->simple_alter=0; }
+ add_column column_def opt_place { Lex->alter_info.is_simple= 0; }
| ADD key_def
{
LEX *lex=Lex;
- lex->simple_alter=0;
- lex->alter_flags|= ALTER_ADD_INDEX;
+ lex->alter_info.is_simple= 0;
+ lex->alter_info.flags|= ALTER_ADD_INDEX;
}
- | add_column '(' field_list ')' { Lex->simple_alter=0; }
+ | add_column '(' field_list ')' { Lex->alter_info.is_simple= 0; }
| CHANGE opt_column field_ident
{
LEX *lex=Lex;
lex->change= $3.str;
- lex->simple_alter=0;
- lex->alter_flags|= ALTER_CHANGE_COLUMN;
+ lex->alter_info.is_simple= 0;
+ lex->alter_info.flags|= ALTER_CHANGE_COLUMN;
}
field_spec opt_place
| MODIFY_SYM opt_column field_ident
@@ -2878,8 +2874,8 @@ alter_list_item:
lex->default_value= lex->on_update_value= 0;
lex->comment=0;
lex->charset= NULL;
- lex->simple_alter=0;
- lex->alter_flags|= ALTER_CHANGE_COLUMN;
+ lex->alter_info.is_simple= 0;
+ lex->alter_info.flags|= ALTER_CHANGE_COLUMN;
}
type opt_attribute
{
@@ -2897,50 +2893,51 @@ alter_list_item:
| DROP opt_column field_ident opt_restrict
{
LEX *lex=Lex;
- lex->drop_list.push_back(new Alter_drop(Alter_drop::COLUMN,
- $3.str));
- lex->simple_alter=0;
- lex->alter_flags|= ALTER_DROP_COLUMN;
+ lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::COLUMN,
+ $3.str));
+ lex->alter_info.is_simple= 0;
+ lex->alter_info.flags|= ALTER_DROP_COLUMN;
}
- | DROP FOREIGN KEY_SYM opt_ident { Lex->simple_alter=0; }
+ | DROP FOREIGN KEY_SYM opt_ident { Lex->alter_info.is_simple= 0; }
| DROP PRIMARY_SYM KEY_SYM
{
LEX *lex=Lex;
- lex->drop_list.push_back(new Alter_drop(Alter_drop::KEY,
- primary_key_name));
- lex->simple_alter=0;
- lex->alter_flags|= ALTER_DROP_INDEX;
+ lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
+ primary_key_name));
+ lex->alter_info.is_simple= 0;
+ lex->alter_info.flags|= ALTER_DROP_INDEX;
}
| DROP key_or_index field_ident
{
LEX *lex=Lex;
- lex->drop_list.push_back(new Alter_drop(Alter_drop::KEY,
- $3.str));
- lex->simple_alter=0;
- lex->alter_flags|= ALTER_DROP_INDEX;
+ lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
+ $3.str));
+ lex->alter_info.is_simple= 0;
+ lex->alter_info.flags|= ALTER_DROP_INDEX;
}
- | DISABLE_SYM KEYS { Lex->alter_keys_onoff=DISABLE; }
- | ENABLE_SYM KEYS { Lex->alter_keys_onoff=ENABLE; }
+ | DISABLE_SYM KEYS { Lex->alter_info.keys_onoff= DISABLE; }
+ | ENABLE_SYM KEYS { Lex->alter_info.keys_onoff= ENABLE; }
| ALTER opt_column field_ident SET DEFAULT signed_literal
{
LEX *lex=Lex;
- lex->alter_list.push_back(new Alter_column($3.str,$6));
- lex->simple_alter=0;
- lex->alter_flags|= ALTER_CHANGE_COLUMN;
+ lex->alter_info.alter_list.push_back(new Alter_column($3.str,$6));
+ lex->alter_info.is_simple= 0;
+ lex->alter_info.flags|= ALTER_CHANGE_COLUMN;
}
| ALTER opt_column field_ident DROP DEFAULT
{
LEX *lex=Lex;
- lex->alter_list.push_back(new Alter_column($3.str,(Item*) 0));
- lex->simple_alter=0;
- lex->alter_flags|= ALTER_CHANGE_COLUMN;
+ lex->alter_info.alter_list.push_back(new Alter_column($3.str,
+ (Item*) 0));
+ lex->alter_info.is_simple= 0;
+ lex->alter_info.flags|= ALTER_CHANGE_COLUMN;
}
| RENAME opt_to table_ident
{
LEX *lex=Lex;
lex->select_lex.db=$3->db.str;
lex->name= $3->table.str;
- lex->alter_flags|= ALTER_RENAME;
+ lex->alter_info.flags|= ALTER_RENAME;
}
| CONVERT_SYM TO_SYM charset charset_name_or_default opt_collate
{
@@ -2961,19 +2958,19 @@ alter_list_item:
lex->create_info.default_table_charset= $5;
lex->create_info.used_fields|= (HA_CREATE_USED_CHARSET |
HA_CREATE_USED_DEFAULT_CHARSET);
- lex->simple_alter= 0;
+ lex->alter_info.is_simple= 0;
}
| create_table_options_space_separated
{
LEX *lex=Lex;
- lex->simple_alter=0;
- lex->alter_flags|= ALTER_OPTIONS;
+ lex->alter_info.is_simple= 0;
+ lex->alter_info.flags|= ALTER_OPTIONS;
}
| order_clause
{
LEX *lex=Lex;
- lex->simple_alter=0;
- lex->alter_flags|= ALTER_ORDER;
+ lex->alter_info.is_simple= 0;
+ lex->alter_info.flags|= ALTER_ORDER;
};
opt_column:
@@ -3387,17 +3384,19 @@ select_part2:
select_into:
opt_limit_clause {}
- | FROM DUAL_SYM /* oracle compatibility: oracle always requires FROM
- clause, and DUAL is system table without fields.
- Is "SELECT 1 FROM DUAL" any better than
- "SELECT 1" ? Hmmm :) */
| into
| select_from
| into select_from
| select_from into;
select_from:
- FROM join_table_list where_clause group_clause having_clause opt_order_clause opt_limit_clause procedure_clause;
+ FROM join_table_list where_clause group_clause having_clause
+ opt_order_clause opt_limit_clause procedure_clause
+ | FROM DUAL_SYM /* oracle compatibility: oracle always requires FROM
+ clause, and DUAL is system table without fields.
+ Is "SELECT 1 FROM DUAL" any better than
+ "SELECT 1" ? Hmmm :) */
+ ;
select_options:
/* empty*/
@@ -4828,18 +4827,20 @@ delete_limit_clause:
};
ULONG_NUM:
- NUM { $$= strtoul($1.str,NULL,10); }
- | LONG_NUM { $$= (ulong) strtoll($1.str,NULL,10); }
- | ULONGLONG_NUM { $$= (ulong) strtoull($1.str,NULL,10); }
- | REAL_NUM { $$= strtoul($1.str,NULL,10); }
- | FLOAT_NUM { $$= strtoul($1.str,NULL,10); };
+ NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
+ | LONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
+ | ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
+ | REAL_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
+ | FLOAT_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
+ ;
ulonglong_num:
- NUM { $$= (ulonglong) strtoul($1.str,NULL,10); }
- | ULONGLONG_NUM { $$= strtoull($1.str,NULL,10); }
- | LONG_NUM { $$= (ulonglong) strtoll($1.str,NULL,10); }
- | REAL_NUM { $$= strtoull($1.str,NULL,10); }
- | FLOAT_NUM { $$= strtoull($1.str,NULL,10); };
+ NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ | ULONGLONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ | LONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ | REAL_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ | FLOAT_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ ;
procedure_clause:
/* empty */
@@ -4990,9 +4991,9 @@ drop:
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_DROP_INDEX;
- lex->drop_list.empty();
- lex->drop_list.push_back(new Alter_drop(Alter_drop::KEY,
- $3.str));
+ lex->alter_info.drop_list.empty();
+ lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
+ $3.str));
if (!lex->current_select->add_table_to_list(lex->thd, $5, NULL,
TL_OPTION_UPDATING))
YYABORT;
@@ -5927,8 +5928,8 @@ literal:
| TIMESTAMP text_literal { $$ = $2; };
NUM_literal:
- NUM { $$ = new Item_int($1.str, (longlong) strtol($1.str, NULL, 10),$1.length); }
- | LONG_NUM { $$ = new Item_int($1.str, (longlong) strtoll($1.str,NULL,10), $1.length); }
+ NUM { int error; $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length); }
+ | LONG_NUM { int error; $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length); }
| ULONGLONG_NUM { $$ = new Item_uint($1.str, $1.length); }
| REAL_NUM { $$ = new Item_real($1.str, $1.length); }
| FLOAT_NUM { $$ = new Item_float($1.str, $1.length); }
@@ -6207,7 +6208,6 @@ keyword:
| DIRECTORY_SYM {}
| DISCARD {}
| DO_SYM {}
- | DUAL_SYM {}
| DUMPFILE {}
| DUPLICATE_SYM {}
| DYNAMIC_SYM {}
diff --git a/sql/time.cc b/sql/time.cc
index 7fb466f6b97..6d15fa184a1 100644
--- a/sql/time.cc
+++ b/sql/time.cc
@@ -663,11 +663,25 @@ time_t str_to_timestamp(const char *str,uint length)
}
+/*
+ Convert a string to datetime.
+
+ SYNOPSIS
+ str_to_datetime()
+ str String to parse (see str_to_TIME() synopsis)
+ length Length of str
+ fuzzy_date Flags (see str_to_TIME() synopsis)
+
+ RETURN
+ -1 if error
+ datetime value otherwise
+*/
+
longlong str_to_datetime(const char *str,uint length, uint fuzzy_date)
{
TIME l_time;
if (str_to_TIME(str,length,&l_time,fuzzy_date) <= TIMESTAMP_DATETIME_ERROR)
- return(0);
+ return -1;
return (longlong) (l_time.year*LL(10000000000) +
l_time.month*LL(100000000)+
l_time.day*LL(1000000)+
@@ -1241,9 +1255,15 @@ const char *get_date_time_format_str(KNOWN_DATE_TIME_FORMAT *format,
MySQL doesn't support comparing of date/time/datetime strings that
are not in arbutary order as dates are compared as strings in some
context)
+ This functions don't check that given TIME structure members are
+ in valid range. If they are not, return value won't reflect any
+ valid date either. Additionally, make_time doesn't take into
+ account time->day member: it's assumed that days have been converted
+ to hours already.
****************************************************************************/
-void make_time(DATE_TIME_FORMAT *format, TIME *l_time, String *str)
+void make_time(const DATE_TIME_FORMAT *format __attribute__((unused)),
+ const TIME *l_time, String *str)
{
long length= my_sprintf((char*) str->ptr(),
((char*) str->ptr(),
@@ -1257,7 +1277,8 @@ void make_time(DATE_TIME_FORMAT *format, TIME *l_time, String *str)
}
-void make_date(DATE_TIME_FORMAT *format, TIME *l_time, String *str)
+void make_date(const DATE_TIME_FORMAT *format __attribute__((unused)),
+ const TIME *l_time, String *str)
{
long length= my_sprintf((char*) str->ptr(),
((char*) str->ptr(),
@@ -1270,7 +1291,8 @@ void make_date(DATE_TIME_FORMAT *format, TIME *l_time, String *str)
}
-void make_datetime(DATE_TIME_FORMAT *format, TIME *l_time, String *str)
+void make_datetime(const DATE_TIME_FORMAT *format __attribute__((unused)),
+ const TIME *l_time, String *str)
{
long length= my_sprintf((char*) str->ptr(),
((char*) str->ptr(),
@@ -1316,3 +1338,111 @@ void make_truncated_value_warning(THD *thd, const char *str_val,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_TRUNCATED_WRONG_VALUE, warn_buff);
}
+
+
+/* Convert time value to integer in YYYYMMDDHHMMSS format */
+
+ulonglong TIME_to_ulonglong_datetime(const TIME *time)
+{
+ return ((ulonglong) (time->year * 10000UL +
+ time->month * 100UL +
+ time->day) * ULL(1000000) +
+ (ulonglong) (time->hour * 10000UL +
+ time->minute * 100UL +
+ time->second));
+}
+
+
+/* Convert TIME value to integer in YYYYMMDD format */
+
+ulonglong TIME_to_ulonglong_date(const TIME *time)
+{
+ return (ulonglong) (time->year * 10000UL + time->month * 100UL + time->day);
+}
+
+
+/*
+ Convert TIME value to integer in HHMMSS format.
+ This function doesn't take into account time->day member:
+ it's assumed that days have been converted to hours already.
+*/
+
+ulonglong TIME_to_ulonglong_time(const TIME *time)
+{
+ return (ulonglong) (time->hour * 10000UL +
+ time->minute * 100UL +
+ time->second);
+}
+
+
+/*
+ Convert struct TIME (date and time split into year/month/day/hour/...
+ to a number in format YYYYMMDDHHMMSS (DATETIME),
+ YYYYMMDD (DATE) or HHMMSS (TIME).
+
+ SYNOPSIS
+ TIME_to_ulonglong()
+
+ DESCRIPTION
+ The function is used when we need to convert value of time item
+ to a number if it's used in numeric context, i. e.:
+ SELECT NOW()+1, CURDATE()+0, CURTIMIE()+0;
+ SELECT ?+1;
+
+ NOTE
+ This function doesn't check that given TIME structure members are
+ in valid range. If they are not, return value won't reflect any
+ valid date either.
+*/
+
+ulonglong TIME_to_ulonglong(const TIME *time)
+{
+ switch (time->time_type) {
+ case TIMESTAMP_DATETIME:
+ return TIME_to_ulonglong_datetime(time);
+ case TIMESTAMP_DATE:
+ return TIME_to_ulonglong_date(time);
+ case TIMESTAMP_TIME:
+ return TIME_to_ulonglong_time(time);
+ case TIMESTAMP_NONE:
+ case TIMESTAMP_DATETIME_ERROR:
+ return ULL(0);
+ default:
+ DBUG_ASSERT(0);
+ }
+ return 0;
+}
+
+
+/*
+ Convert struct DATE/TIME/DATETIME value to string using built-in
+ MySQL time conversion formats.
+
+ SYNOPSIS
+ TIME_to_string()
+
+ NOTE
+ The string must have at least MAX_DATE_REP_LENGTH bytes reserved.
+*/
+
+void TIME_to_string(const TIME *time, String *str)
+{
+ switch (time->time_type) {
+ case TIMESTAMP_DATETIME:
+ make_datetime((DATE_TIME_FORMAT*) 0, time, str);
+ break;
+ case TIMESTAMP_DATE:
+ make_date((DATE_TIME_FORMAT*) 0, time, str);
+ break;
+ case TIMESTAMP_TIME:
+ make_time((DATE_TIME_FORMAT*) 0, time, str);
+ break;
+ case TIMESTAMP_NONE:
+ case TIMESTAMP_DATETIME_ERROR:
+ str->length(0);
+ str->set_charset(&my_charset_bin);
+ break;
+ default:
+ DBUG_ASSERT(0);
+ }
+}
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index 2bde29ecc47..2071759ddae 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -223,7 +223,7 @@ static uint16 big5strokexfrm(uint16 i)
static int my_strnncoll_big5_internal(const uchar **a_res,
const uchar **b_res, uint length)
{
- const char *a= *a_res, *b= *b_res;
+ const uchar *a= *a_res, *b= *b_res;
while (length--)
{
@@ -236,10 +236,10 @@ static int my_strnncoll_big5_internal(const uchar **a_res,
b+= 2;
length--;
}
- else if (sort_order_big5[(uchar) *a++] !=
- sort_order_big5[(uchar) *b++])
- return ((int) sort_order_big5[(uchar) a[-1]] -
- (int) sort_order_big5[(uchar) b[-1]]);
+ else if (sort_order_big5[*a++] !=
+ sort_order_big5[*b++])
+ return ((int) sort_order_big5[a[-1]] -
+ (int) sort_order_big5[b[-1]]);
}
*a_res= a;
*b_res= b;
@@ -6317,6 +6317,7 @@ CHARSET_INFO my_charset_big5_chinese_ci=
to_lower_big5,
to_upper_big5,
sort_order_big5,
+ NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
@@ -6342,6 +6343,7 @@ CHARSET_INFO my_charset_big5_bin=
to_lower_big5,
to_upper_big5,
sort_order_big5,
+ NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c
index ea0a471ef74..7cac8c7c337 100644
--- a/strings/ctype-bin.c
+++ b/strings/ctype-bin.c
@@ -384,7 +384,9 @@ CHARSET_INFO my_charset_bin =
bin_char_array, /* sort_order */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- "","",
+ NULL, /* sort_order_big*/
+ "",
+ "",
1, /* strxfrm_multiply */
1, /* mbminlen */
1, /* mbmaxlen */
diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c
index f4350f87153..2eb2fac46e9 100644
--- a/strings/ctype-czech.c
+++ b/strings/ctype-czech.c
@@ -593,6 +593,7 @@ CHARSET_INFO my_charset_latin2_czech_ci =
to_lower_czech,
to_upper_czech,
sort_order_czech,
+ NULL, /* sort_order_big*/
tab_8859_2_uni, /* tab_to_uni */
idx_uni_8859_2, /* tab_from_uni */
"","",
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index 7f89b8152e8..8f955c15a73 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -8685,6 +8685,7 @@ CHARSET_INFO my_charset_euckr_korean_ci=
to_lower_euc_kr,
to_upper_euc_kr,
sort_order_euc_kr,
+ NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
@@ -8710,6 +8711,7 @@ CHARSET_INFO my_charset_euckr_bin=
to_lower_euc_kr,
to_upper_euc_kr,
sort_order_euc_kr,
+ NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c
index 55dab3ca2a8..51a9531fbf5 100644
--- a/strings/ctype-extra.c
+++ b/strings/ctype-extra.c
@@ -28,6 +28,7 @@ CHARSET_INFO compiled_charsets[] = {
NULL,
NULL,
NULL,
+ NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index e5dfaf45276..b76511fc4f3 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -5738,6 +5738,7 @@ CHARSET_INFO my_charset_gb2312_chinese_ci=
sort_order_gb2312,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
+ NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
@@ -5762,6 +5763,7 @@ CHARSET_INFO my_charset_gb2312_bin=
sort_order_gb2312,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
+ NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index 1990060e67b..cc0f226d01c 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -2585,7 +2585,7 @@ static uint16 gbksortorder(uint16 i)
int my_strnncoll_gbk_internal(const uchar **a_res, const uchar **b_res,
uint length)
{
- const char *a= *a_res, *b= *b_res;
+ const uchar *a= *a_res, *b= *b_res;
uint a_char,b_char;
while (length--)
@@ -2601,9 +2601,9 @@ int my_strnncoll_gbk_internal(const uchar **a_res, const uchar **b_res,
b+= 2;
length--;
}
- else if (sort_order_gbk[(uchar) *a++] != sort_order_gbk[(uchar) *b++])
- return ((int) sort_order_gbk[(uchar) a[-1]] -
- (int) sort_order_gbk[(uchar) b[-1]]);
+ else if (sort_order_gbk[*a++] != sort_order_gbk[*b++])
+ return ((int) sort_order_gbk[a[-1]] -
+ (int) sort_order_gbk[b[-1]]);
}
*a_res= a;
*b_res= b;
@@ -9968,6 +9968,7 @@ CHARSET_INFO my_charset_gbk_chinese_ci=
sort_order_gbk,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
+ NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
@@ -9992,6 +9993,7 @@ CHARSET_INFO my_charset_gbk_bin=
sort_order_gbk,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
+ NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c
index 7a010c3bef8..0b439964c7c 100644
--- a/strings/ctype-latin1.c
+++ b/strings/ctype-latin1.c
@@ -18,60 +18,6 @@
#include "m_string.h"
#include "m_ctype.h"
-
-static uint16 latin1_uni[256]={
- 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
-0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
-0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
-0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
-0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
-0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
-0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
-0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
-0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
-0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
-0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
-0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
-0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
-0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
-0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
-0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
-0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
-0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
-0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
-0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
-0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
-0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
-0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF,
-0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
-0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
-0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
-0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF
-};
-
-static uchar uni_latin1[]={
-0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
-0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
-0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
-0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
-0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
-0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
-0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
-0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
-0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
-0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
-0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
-0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
-0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF};
-
static uchar ctype_latin1[] = {
0,
32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32,
@@ -149,29 +95,287 @@ static uchar sort_order_latin1[] = {
68, 78, 79, 79, 79, 79, 93,247,216, 85, 85, 85, 89, 89,222,255
};
+/*
+ WL#1494 notes:
+
+ We'll use cp1252 instead of iso-8859-1.
+ cp1252 contains printable characters in the range 0x80-0x9F.
+ In ISO 8859-1, these code points have no associated printable
+ characters. Therefore, by converting from CP1252 to ISO 8859-1,
+ one would lose the euro (for instance). Since most people are
+ unaware of the difference, and since we don't really want a
+ "Windows ANSI" to differ from a "Unix ANSI", we will:
+
+ - continue to pretend the latin1 character set is ISO 8859-1
+ - actually allow the storage of euro etc. so it's actually cp1252
+*/
+
+unsigned short cs_to_uni[256]={
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0000,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021,
+0x02C6,0x2030,0x0160,0x2039,0x0152,0x0000,0x017D,0x0000,
+0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x02DC,0x2122,0x0161,0x203A,0x0153,0x0000,0x017E,0x0178,
+0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
+0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
+0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
+0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
+0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
+0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF,
+0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
+0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
+0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
+0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF
+};
+unsigned char pl00[256]={
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
+0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
+0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,
+0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,
+0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,
+0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,
+0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,
+0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,
+0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,
+0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,
+0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,
+0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,
+0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,
+0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,
+0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+unsigned char pl01[256]={
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x8C,0x9C,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x8A,0x9A,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x9F,0x00,0x00,0x00,0x00,0x8E,0x9E,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x83,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+unsigned char pl02[256]={
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x98,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+unsigned char pl20[256]={
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x96,0x97,0x00,0x00,0x00,
+0x91,0x92,0x82,0x00,0x93,0x94,0x84,0x00,
+0x86,0x87,0x95,0x00,0x00,0x00,0x85,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x89,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x8B,0x9B,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+unsigned char pl21[256]={
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x99,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+unsigned char *uni_to_cs[256]={
+pl00,pl01,pl02,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+pl20,pl21,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
+};
static
-int my_mb_wc_latin1(CHARSET_INFO *cs __attribute__((unused)),
- my_wc_t *wc,
- const unsigned char *str,
- const unsigned char *end)
+int my_mb_wc_latin1(CHARSET_INFO *cs __attribute__((unused)),
+ my_wc_t *wc,
+ const unsigned char *str,
+ const unsigned char *end __attribute__((unused)))
{
if (str >= end)
return MY_CS_TOOFEW(0);
- return ((wc[0]= latin1_uni[*str]) || (!str[0])) ? 1 : MY_CS_ILSEQ;
+ *wc=cs_to_uni[*str];
+ return (!wc[0] && str[0]) ? MY_CS_ILSEQ : 1;
}
static
-int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)),
- my_wc_t wc,
- unsigned char *str,
- unsigned char *end)
+int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)),
+ my_wc_t wc,
+ unsigned char *str,
+ unsigned char *end __attribute__((unused)))
{
+ unsigned char *pl;
+
if (str >= end)
return MY_CS_TOOSMALL;
-
- return ((wc < 256) && ((str[0]=uni_latin1[wc]) || (!wc))) ? 1 : MY_CS_ILUNI;
+
+ pl= uni_to_cs[(wc>>8) & 0xFF];
+ str[0]= pl ? pl[wc & 0xFF] : '\0';
+ return (!str[0] && wc) ? MY_CS_ILUNI : 1;
}
static MY_CHARSET_HANDLER my_charset_handler=
@@ -212,7 +416,8 @@ CHARSET_INFO my_charset_latin1=
to_lower_latin1,
to_upper_latin1,
sort_order_latin1,
- latin1_uni, /* tab_to_uni */
+ NULL, /* sort_order_big*/
+ cs_to_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
1, /* strxfrm_multiply */
@@ -489,7 +694,8 @@ CHARSET_INFO my_charset_latin1_german2_ci=
to_lower_latin1,
to_upper_latin1,
sort_order_latin1_de,
- latin1_uni, /* tab_to_uni */
+ NULL, /* sort_order_big*/
+ cs_to_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
2, /* strxfrm_multiply */
@@ -513,7 +719,8 @@ CHARSET_INFO my_charset_latin1_bin=
to_lower_latin1,
to_upper_latin1,
sort_order_latin1_de,
- latin1_uni, /* tab_to_uni */
+ NULL, /* sort_order_big*/
+ cs_to_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
"",
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index ed772a68845..9b02cd3b3da 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -283,7 +283,7 @@ uint my_well_formed_len_mb(CHARSET_INFO *cs,
while (pos)
{
- if ((mblen= cs->cset->mb_wc(cs, &wc, b, e)) <0)
+ if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <0)
break;
b+= mblen;
pos--;
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index 68cd77f96fc..72666175a1f 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -4474,6 +4474,11 @@ my_wc_mb_sjis(CHARSET_INFO *cs __attribute__((unused)),
if ((int) wc < 0x80)
{
+ if (wc == 0x5c)
+ {
+ code= 0x815f;
+ goto mb;
+ }
s[0]= (uchar) wc;
return 1;
}
@@ -4486,7 +4491,8 @@ my_wc_mb_sjis(CHARSET_INFO *cs __attribute__((unused)),
s[0]= code;
return 1;
}
-
+
+mb:
if (s+2>e)
return MY_CS_TOOSMALL;
@@ -4579,6 +4585,7 @@ CHARSET_INFO my_charset_sjis_japanese_ci=
sort_order_sjis,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
+ NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
@@ -4603,6 +4610,7 @@ CHARSET_INFO my_charset_sjis_bin=
sort_order_sjis,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
+ NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index e04a4dfdc96..1b6b1edc8b9 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -498,7 +498,7 @@ static uint thai2sortable(uchar *tstr, uint len)
l2bias use to control position weight of l2char
example (*=l2char) XX*X must come before X*XX
*/
- memcpy_overlap(p, p+1, tlen-1);
+ memcpy_overlap((char*) p, (char*) (p+1), tlen-1);
tstr[len-1]= l2bias + t_ctype0[1]- L2_GARAN +1;
p--;
continue;
@@ -957,6 +957,7 @@ CHARSET_INFO my_charset_tis620_thai_ci=
sort_order_tis620,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
+ NULL, /* sort_order_big*/
"",
"",
4, /* strxfrm_multiply */
@@ -981,6 +982,7 @@ CHARSET_INFO my_charset_tis620_bin=
sort_order_tis620,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
+ NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index ac805bf0a5a..81073d47554 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -6436,7 +6436,7 @@ uint16 page0FFdata[]= { /* FF00 (3 weights per char) */
0x0DC5,0x0000,0x0000, 0x0DC6,0x0000,0x0000, 0xFBC1,0xFFFE,0x0000,
0xFBC1,0xFFFF,0x0000 };
-uchar ucal[256]={
+uchar uca_length[256]={
4,3,3,4,3,3,3,3,0,3,3,3,3,3,3,3,
3,3,3,3,3,2,3,3,3,3,0,0,0,3,3,3,
5,5,4,3,5,2,3,3,2,2,5,3,0,0,3,3,
@@ -6454,7 +6454,7 @@ uchar ucal[256]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,3,3,4,3,9,3,3
};
-uint16 *ucaw[256]={
+uint16 *uca_weight[256]={
page000data,page001data,page002data,page003data,
page004data,page005data,page006data,page007data,
NULL ,page009data,page00Adata,page00Bdata,
@@ -6533,6 +6533,8 @@ typedef struct my_uca_scanner_st
const uint16 *wbeg; /* Beginning of the current weight string */
const uchar *sbeg; /* Beginning of the input string */
const uchar *send; /* End of the input string */
+ uchar *uca_length;
+ uint16 **uca_weight;
uint16 implicit[2];
int page;
int code;
@@ -6564,6 +6566,8 @@ static void my_uca_scanner_init(my_uca_scanner *scanner,
scanner->sbeg= str;
scanner->send= str + length - 2;
scanner->wbeg= nochar;
+ scanner->uca_length= cs->sort_order;
+ scanner->uca_weight= cs->sort_order_big;
}
@@ -6620,6 +6624,9 @@ static int my_uca_scanner_next(my_uca_scanner *scanner)
do
{
+ uint16 **ucaw= scanner->uca_weight;
+ uchar *ucal= scanner->uca_length;
+
if (scanner->sbeg > scanner->send)
return -1;
@@ -6750,8 +6757,8 @@ static int my_strnncollsp_uca(CHARSET_INFO *cs,
int s_res;
int t_res;
- slen= cs->cset->lengthsp(cs, s, slen);
- tlen= cs->cset->lengthsp(cs, t, tlen);
+ slen= cs->cset->lengthsp(cs, (char*) s, slen);
+ tlen= cs->cset->lengthsp(cs, (char*) t, tlen);
my_uca_scanner_init(&sscanner, cs, s, slen);
my_uca_scanner_init(&tscanner, cs, t, tlen);
@@ -6796,7 +6803,7 @@ static void my_hash_sort_uca(CHARSET_INFO *cs,
int s_res;
my_uca_scanner scanner;
- slen= cs->cset->lengthsp(cs, s, slen);
+ slen= cs->cset->lengthsp(cs, (char*) s, slen);
my_uca_scanner_init(&scanner, cs, s, slen);
while ((s_res= my_uca_scanner_next(&scanner)) >0)
@@ -6866,10 +6873,12 @@ static int my_strnxfrm_uca(CHARSET_INFO *cs,
This fact allows us to use memcmp() safely, on both
little-endian and big-endian machines.
*/
-static int my_uca_charcmp(my_wc_t wc1, my_wc_t wc2)
+static int my_uca_charcmp(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2)
{
size_t page1= wc1 >> MY_UCA_PSHIFT;
size_t page2= wc2 >> MY_UCA_PSHIFT;
+ uchar *ucal= cs->sort_order;
+ uint16 **ucaw= cs->sort_order_big;
size_t length1= ucal[page1];
size_t length2= ucal[page2];
uint16 *weight1= ucaw[page1] + (wc1 & MY_UCA_CMASK) * ucal[page1];
@@ -6943,7 +6952,7 @@ int my_wildcmp_uca(CHARSET_INFO *cs,
}
else
{
- if (my_uca_charcmp(s_wc,w_wc))
+ if (my_uca_charcmp(cs,s_wc,w_wc))
return 1;
}
if (wildstr == wildend)
@@ -7006,7 +7015,7 @@ int my_wildcmp_uca(CHARSET_INFO *cs,
(const uchar*)str_end)) <= 0)
return 1;
- if (!my_uca_charcmp(s_wc,w_wc))
+ if (!my_uca_charcmp(cs,s_wc,w_wc))
break;
str+= scan;
}
@@ -7039,4 +7048,30 @@ MY_COLLATION_HANDLER my_collation_ucs2_uca_handler =
my_hash_sort_uca
};
+CHARSET_INFO my_charset_ucs2_general_uca=
+{
+ 45,0,0, /* number */
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONTEXT,
+ "ucs2", /* cs name */
+ "ucs2_general_uca", /* name */
+ "", /* comment */
+ NULL, /* ctype */
+ NULL, /* to_lower */
+ NULL, /* to_upper */
+ uca_length, /* sort_order */
+ uca_weight, /* sort_order_big*/
+ NULL, /* tab_to_uni */
+ NULL, /* tab_from_uni */
+ "",
+ "",
+ 8, /* strxfrm_multiply */
+ 2, /* mbminlen */
+ 2, /* mbmaxlen */
+ 9, /* min_sort_char */
+ 0xFFFF, /* max_sort_char */
+ &my_charset_ucs2_handler,
+ &my_collation_ucs2_uca_handler
+};
+
+
#endif
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index 59c1706fd26..67340fdd4f4 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1397,7 +1397,7 @@ static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler =
};
-static MY_CHARSET_HANDLER my_charset_ucs2_handler=
+MY_CHARSET_HANDLER my_charset_ucs2_handler=
{
my_ismbchar_ucs2, /* ismbchar */
my_mbcharlen_ucs2, /* mbcharlen */
@@ -1437,6 +1437,7 @@ CHARSET_INFO my_charset_ucs2_general_ci=
to_upper_ucs2, /* sort_order */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
+ NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
@@ -1448,30 +1449,6 @@ CHARSET_INFO my_charset_ucs2_general_ci=
&my_collation_ucs2_general_ci_handler
};
-CHARSET_INFO my_charset_ucs2_general_uca=
-{
- 45,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONTEXT,
- "ucs2", /* cs name */
- "ucs2_general_uca", /* name */
- "", /* comment */
- ctype_ucs2, /* ctype */
- to_lower_ucs2, /* to_lower */
- to_upper_ucs2, /* to_upper */
- to_upper_ucs2, /* sort_order */
- NULL, /* tab_to_uni */
- NULL, /* tab_from_uni */
- "",
- "",
- 8, /* strxfrm_multiply */
- 2, /* mbminlen */
- 2, /* mbmaxlen */
- 9, /* min_sort_char */
- 0xFFFF, /* max_sort_char */
- &my_charset_ucs2_handler,
- &my_collation_ucs2_uca_handler
-};
-
CHARSET_INFO my_charset_ucs2_bin=
{
90,0,0, /* number */
@@ -1483,6 +1460,7 @@ CHARSET_INFO my_charset_ucs2_bin=
to_lower_ucs2, /* to_lower */
to_upper_ucs2, /* to_upper */
to_upper_ucs2, /* sort_order */
+ NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index 51b7cd4f7d7..fd3692553be 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -8474,7 +8474,9 @@ CHARSET_INFO my_charset_ujis_japanese_ci=
sort_order_ujis,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- "","",
+ NULL, /* sort_order_big*/
+ "",
+ "",
1, /* strxfrm_multiply */
1, /* mbminlen */
3, /* mbmaxlen */
@@ -8498,7 +8500,9 @@ CHARSET_INFO my_charset_ujis_bin=
sort_order_ujis,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- "","",
+ NULL, /* sort_order_big*/
+ "",
+ "",
1, /* strxfrm_multiply */
1, /* mbminlen */
3, /* mbmaxlen */
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 82787f2b65f..29d2c5d1358 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -2090,6 +2090,7 @@ CHARSET_INFO my_charset_utf8_general_ci=
to_upper_utf8, /* sort_order */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
+ NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
@@ -2115,6 +2116,7 @@ CHARSET_INFO my_charset_utf8_bin=
to_upper_utf8, /* sort_order */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
+ NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c
index ed6bb877dc8..2eefb570170 100644
--- a/strings/ctype-win1250ch.c
+++ b/strings/ctype-win1250ch.c
@@ -627,6 +627,7 @@ CHARSET_INFO my_charset_cp1250_czech_ci =
to_lower_win1250ch,
to_upper_win1250ch,
sort_order_win1250ch,
+ NULL, /* sort_order_big*/
tab_cp1250_uni, /* tab_to_uni */
idx_uni_cp1250, /* tab_from_uni */
"","",
diff --git a/strings/dump_map.c b/strings/dump_map.c
index f999160d0d4..708d9139f3c 100644
--- a/strings/dump_map.c
+++ b/strings/dump_map.c
@@ -1,13 +1,15 @@
#include <stdio.h>
#include <string.h>
-static void print_short_array(unsigned short *a)
+static void print_short_array(unsigned short *a, size_t width)
{
int i;
printf("{\n");
for (i=0; i<=0xFF; i++)
{
- printf("0x%04X%s%s",(int)a[i],i<0xFF?",":"",(i+1) % 8 ? "" :"\n");
+ const char *fmt= (width==4) ? "0x%04X" : "0x%02X";
+ printf(fmt,(int)a[i]);
+ printf("%s%s",i<0xFF?",":"",(i+1) % 8 ? "" :"\n");
}
printf("};\n");
@@ -41,7 +43,7 @@ int main(void)
}
printf("unsigned short cs_to_uni[256]=");
- print_short_array(touni);
+ print_short_array(touni, 4);
for (i=0;i<=0xFF;i++)
{
@@ -53,7 +55,7 @@ int main(void)
if (fromstat[i])
{
printf("unsigned char pl%02X[256]=",i);
- print_short_array(fromuni+i*256);
+ print_short_array(fromuni+i*256, 2);
}
}
diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c
index 6319fbb4d9f..493d0d63de2 100644
--- a/strings/my_strtoll10.c
+++ b/strings/my_strtoll10.c
@@ -22,9 +22,9 @@
#define ULONGLONG_MAX (~(ulonglong) 0)
#define MAX_NEGATIVE_NUMBER ((ulonglong) LL(0x8000000000000000))
#define INIT_CNT 9
-#define LFACTOR LL(1000000000)
-#define LFACTOR1 LL(10000000000)
-#define LFACTOR2 LL(100000000000)
+#define LFACTOR ULL(1000000000)
+#define LFACTOR1 ULL(10000000000)
+#define LFACTOR2 ULL(100000000000)
static unsigned long lfactor[9]=
{
@@ -113,8 +113,8 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error)
negative= 1;
if (++s == end)
goto no_conv;
- cutoff= MAX_NEGATIVE_NUMBER / LL(100000000000);
- cutoff2= (MAX_NEGATIVE_NUMBER % LL(100000000000)) / 100;
+ cutoff= MAX_NEGATIVE_NUMBER / LFACTOR2;
+ cutoff2= (MAX_NEGATIVE_NUMBER % LFACTOR2) / 100;
cutoff3= MAX_NEGATIVE_NUMBER % 100;
}
else
@@ -125,8 +125,8 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error)
if (++s == end)
goto no_conv;
}
- cutoff= ULONGLONG_MAX / LL(100000000000);
- cutoff2= ULONGLONG_MAX % LL(100000000000) / 100;
+ cutoff= ULONGLONG_MAX / LFACTOR2;
+ cutoff2= ULONGLONG_MAX % LFACTOR2 / 100;
cutoff3= ULONGLONG_MAX % 100;
}
@@ -196,15 +196,15 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error)
goto overflow;
/* Check that we didn't get an overflow with the last digit */
- if (i > cutoff || i == cutoff && (j > cutoff2 || j == cutoff2 &&
- k > cutoff3))
+ if (i > cutoff || (i == cutoff && ((j > cutoff2 || j == cutoff2) &&
+ k > cutoff3)))
goto overflow;
li=i*LFACTOR2+ (ulonglong) j*100 + k;
return (longlong) li;
overflow: /* *endptr is set here */
*error= MY_ERRNO_ERANGE;
- return negative ? LONGLONG_MIN : ULONGLONG_MAX;
+ return negative ? LONGLONG_MIN : (longlong) ULONGLONG_MAX;
end_i:
*endptr= (char*) s;
diff --git a/strings/strings-x86.s b/strings/strings-x86.s
index d316c34febb..30a7517a372 100644
--- a/strings/strings-x86.s
+++ b/strings/strings-x86.s
@@ -43,7 +43,9 @@ bmove_align:
.ba_20: pop %esi
movl %edx,%edi
ret
- .size bmove_align,.end-bmove_align
+
+.bmove_align_end:
+ .size bmove_align,.bmove_align_end-bmove_align
# Move a string from higher to lower
# Arg from_end+1,to_end+1,length
diff --git a/support-files/MacOSX/StartupItem.Description.plist b/support-files/MacOSX/StartupItem.Description.plist
index 1f0023bde0d..e8ceb1ee062 100644
--- a/support-files/MacOSX/StartupItem.Description.plist
+++ b/support-files/MacOSX/StartupItem.Description.plist
@@ -10,6 +10,6 @@
<key>IFPkgDescriptionTitle</key>
<string>MySQL Startup Item</string>
<key>IFPkgDescriptionVersion</key>
- <string>1.0</string>
+ <string>1.1</string>
</dict>
</plist>
diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh
index ba92856df0e..5fdde0d2963 100644
--- a/support-files/my-huge.cnf.sh
+++ b/support-files/my-huge.cnf.sh
@@ -31,6 +31,7 @@ max_allowed_packet = 1M
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
+read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size = 32M
diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh
index ba865a5bfd0..a17ec7b5227 100644
--- a/support-files/my-large.cnf.sh
+++ b/support-files/my-large.cnf.sh
@@ -31,6 +31,7 @@ max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
+read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size= 16M
diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh
index 4650ed06dc1..d50d0717c17 100644
--- a/support-files/my-medium.cnf.sh
+++ b/support-files/my-medium.cnf.sh
@@ -32,6 +32,8 @@ max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
+read_buffer_size = 256K
+read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh
index ca26a10a397..2ae62fb48f1 100644
--- a/support-files/my-small.cnf.sh
+++ b/support-files/my-small.cnf.sh
@@ -31,6 +31,8 @@ key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
+read_buffer_size = 256K
+read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
diff --git a/tests/client_test.c b/tests/client_test.c
index af9818b7f23..21155840115 100644
--- a/tests/client_test.c
+++ b/tests/client_test.c
@@ -2400,7 +2400,8 @@ static void test_long_data_str()
MYSQL_STMT *stmt;
int rc, i;
char data[255];
- long length, length1;
+ long length;
+ ulong length1;
MYSQL_RES *result;
MYSQL_BIND bind[2];
my_bool is_null[2];
@@ -2495,8 +2496,8 @@ static void test_long_data_str1()
MYSQL_STMT *stmt;
int rc, i;
char data[255];
- long length, length1;
- ulong max_blob_length, blob_length;
+ long length;
+ ulong max_blob_length, blob_length, length1;
my_bool true_value;
MYSQL_RES *result;
MYSQL_BIND bind[2];
@@ -3084,7 +3085,7 @@ static void test_bind_result_ext()
char szData[20], bData[20];
ulong szLength, bLength;
MYSQL_BIND bind[8];
- long length[8];
+ ulong length[8];
my_bool is_null[8];
myheader("test_bind_result_ext");
@@ -5376,7 +5377,7 @@ static void test_store_result2()
MYSQL_STMT *stmt;
int rc;
int nData;
- long length;
+ ulong length;
MYSQL_BIND bind[1];
myheader("test_store_result2");
@@ -5621,12 +5622,22 @@ static void test_bind_date_conv(uint row_count)
{
tm[i].neg= 0;
tm[i].second_part= second_part+count;
- tm[i].year= year+count;
- tm[i].month= month+count;
- tm[i].day= day+count;
- tm[i].hour= hour+count;
- tm[i].minute= minute+count;
- tm[i].second= sec+count;
+ if (bind[i].buffer_type != MYSQL_TYPE_TIME)
+ {
+ tm[i].year= year+count;
+ tm[i].month= month+count;
+ tm[i].day= day+count;
+ }
+ else
+ tm[i].year= tm[i].month= tm[i].day= 0;
+ if (bind[i].buffer_type != MYSQL_TYPE_DATE)
+ {
+ tm[i].hour= hour+count;
+ tm[i].minute= minute+count;
+ tm[i].second= sec+count;
+ }
+ else
+ tm[i].hour= tm[i].minute= tm[i].second = 0;
}
rc = mysql_execute(stmt);
check_execute(stmt, rc);
@@ -8094,7 +8105,7 @@ static void test_ts()
MYSQL_TIME ts;
MYSQL_RES *prep_res;
char strts[30];
- long length;
+ ulong length;
int rc, field_count;
char name;
@@ -8974,7 +8985,8 @@ static void test_multi()
char *query;
MYSQL_BIND bind[1];
int rc, i;
- long param= 1, length= 1;
+ long param= 1;
+ ulong length= 1;
myheader("test_multi");
bind[0].buffer_type= MYSQL_TYPE_LONG;
@@ -9100,7 +9112,7 @@ static void test_bind_nagative()
int rc;
MYSQL_BIND bind[1];
long my_val = 0L;
- long my_length = 0L;
+ ulong my_length = 0L;
long my_null = 0L;
myheader("test_insert_select");
@@ -9141,7 +9153,7 @@ static void test_derived()
int rc, i;
MYSQL_BIND bind[1];
long my_val = 0L;
- long my_length = 0L;
+ ulong my_length = 0L;
long my_null = 0L;
const char *query=
"select count(1) from (select f.id from t1 f where f.id=?) as x";
@@ -9595,6 +9607,274 @@ static void test_bug1664()
myquery(rc);
}
+
+static void test_order_param()
+{
+ MYSQL_STMT *stmt;
+ int rc;
+
+ myheader("test_order_param");
+
+ rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
+ myquery(rc);
+
+ rc= mysql_query(mysql,"CREATE TABLE t1(a INT, b char(10))");
+ myquery(rc);
+
+ stmt= mysql_simple_prepare(mysql,
+ "select sum(a) + 200, 1 from t1 \
+union distinct \
+select sum(a) + 200, 1 from t1 \
+group by b ");
+ check_stmt(stmt);
+ mysql_stmt_close(stmt);
+
+ stmt= mysql_simple_prepare(mysql,
+ "select sum(a) + 200, ? from t1 \
+group by b \
+union distinct \
+select sum(a) + 200, 1 from t1 \
+group by b ");
+ check_stmt(stmt);
+ mysql_stmt_close(stmt);
+
+ stmt= mysql_simple_prepare(mysql,
+ "select sum(a) + 200, ? from t1 \
+union distinct \
+select sum(a) + 200, 1 from t1 \
+group by b ");
+ check_stmt(stmt);
+ mysql_stmt_close(stmt);
+
+ rc= mysql_query(mysql, "DROP TABLE t1");
+ myquery(rc);
+}
+
+
+static void test_union_param()
+{
+ MYSQL_STMT *stmt;
+ char *query;
+ int rc, i;
+ MYSQL_BIND bind[2];
+ char my_val[4];
+ ulong my_length = 3L;
+ long my_null = 0L;
+ myheader("test_union_param");
+
+ strcpy(my_val, "abc");
+
+ query= (char*)"select ? as my_col union distinct select ?";
+ stmt= mysql_prepare(mysql, query, strlen(query));
+ check_stmt(stmt);
+
+ /* bind parameters */
+ bind[0].buffer_type= FIELD_TYPE_STRING;
+ bind[0].buffer= &my_val;
+ bind[0].buffer_length= 4;
+ bind[0].length= &my_length;
+ bind[0].is_null= (char*)&my_null;
+ bind[1].buffer_type= FIELD_TYPE_STRING;
+ bind[1].buffer= &my_val;
+ bind[1].buffer_length= 4;
+ bind[1].length= &my_length;
+ bind[1].is_null= (char*)&my_null;
+
+ rc= mysql_bind_param(stmt, bind);
+ check_execute(stmt,rc);
+
+ for (i= 0; i < 3; i++)
+ {
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt,rc);
+ assert(1 == my_process_stmt_result(stmt));
+ }
+
+ mysql_stmt_close(stmt);
+}
+
+
+static void test_ps_i18n()
+{
+ MYSQL_STMT *stmt;
+ int rc;
+ const char *stmt_text;
+ MYSQL_BIND bind_array[2];
+
+ const char *koi8= "îÕ, ÚÁ ÒÙÂÁÌËÕ";
+ const char *cp1251= "Íó, çà ðûáàëêó";
+ char buf1[16], buf2[16];
+ ulong buf1_len, buf2_len;
+
+
+ myheader("test_ps_i18n");
+
+ stmt_text= "DROP TABLE IF EXISTS t1";
+ rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
+ myquery(rc);
+
+ /*
+ Create table with binary columns, set session character set to cp1251,
+ client character set to koi8, and make sure that there is conversion
+ on insert and no conversion on select
+ */
+
+ stmt_text= "CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))";
+
+ rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
+ myquery(rc);
+
+ stmt_text= "SET CHARACTER_SET_CLIENT=koi8r, "
+ "CHARACTER_SET_CONNECTION=cp1251, "
+ "CHARACTER_SET_RESULTS=koi8r";
+
+ rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
+ myquery(rc);
+
+ bzero(bind_array, sizeof(bind_array));
+
+ bind_array[0].buffer_type= MYSQL_TYPE_STRING;
+ bind_array[0].buffer= (char*) koi8;
+ bind_array[0].buffer_length= strlen(koi8);
+
+ bind_array[1].buffer_type= MYSQL_TYPE_STRING;
+ bind_array[1].buffer= (char*) koi8;
+ bind_array[1].buffer_length= strlen(koi8);
+
+ stmt= mysql_stmt_init(mysql);
+ check_stmt(stmt);
+
+ stmt_text= "INSERT INTO t1 (c1, c2) VALUES (?, ?)";
+
+ rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ check_execute(stmt, rc);
+
+ mysql_stmt_bind_param(stmt, bind_array);
+
+ mysql_stmt_send_long_data(stmt, 0, koi8, strlen(koi8));
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ stmt_text= "SELECT c1, c2 FROM t1";
+
+ /* c1 and c2 are binary so no conversion will be done on select */
+ rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ bind_array[0].buffer= buf1;
+ bind_array[0].buffer_length= sizeof(buf1);
+ bind_array[0].length= &buf1_len;
+
+ bind_array[1].buffer= buf2;
+ bind_array[1].buffer_length= sizeof(buf2);
+ bind_array[1].length= &buf2_len;
+
+ mysql_stmt_bind_result(stmt, bind_array);
+
+ rc= mysql_stmt_fetch(stmt);
+ check_execute(stmt, rc);
+
+ assert(buf1_len == strlen(cp1251));
+ assert(buf2_len == strlen(cp1251));
+ assert(!memcmp(buf1, cp1251, buf1_len));
+ assert(!memcmp(buf2, cp1251, buf1_len));
+
+ rc= mysql_stmt_fetch(stmt);
+ assert(rc == MYSQL_NO_DATA);
+
+ stmt_text= "DROP TABLE IF EXISTS t1";
+ rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
+ myquery(rc);
+
+ /*
+ Now create table with two cp1251 columns, set client character
+ set to koi8 and supply columns of one row as string and another as
+ binary data. Binary data must not be converted on insert, and both
+ columns must be converted to client character set on select.
+ */
+
+ stmt_text= "CREATE TABLE t1 (c1 VARCHAR(255) CHARACTER SET cp1251, "
+ "c2 VARCHAR(255) CHARACTER SET cp1251)";
+
+ rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
+ myquery(rc);
+
+ stmt_text= "INSERT INTO t1 (c1, c2) VALUES (?, ?)";
+
+ rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ check_execute(stmt, rc);
+
+ /* this data must be converted */
+ bind_array[0].buffer_type= MYSQL_TYPE_STRING;
+ bind_array[0].buffer= (char*) koi8;
+ bind_array[0].buffer_length= strlen(koi8);
+
+ bind_array[1].buffer_type= MYSQL_TYPE_STRING;
+ bind_array[1].buffer= (char*) koi8;
+ bind_array[1].buffer_length= strlen(koi8);
+
+ mysql_stmt_bind_param(stmt, bind_array);
+
+ mysql_stmt_send_long_data(stmt, 0, koi8, strlen(koi8));
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ /* this data must not be converted */
+ bind_array[0].buffer_type= MYSQL_TYPE_BLOB;
+ bind_array[0].buffer= (char*) cp1251;
+ bind_array[0].buffer_length= strlen(cp1251);
+
+ bind_array[1].buffer_type= MYSQL_TYPE_BLOB;
+ bind_array[1].buffer= (char*) cp1251;
+ bind_array[1].buffer_length= strlen(cp1251);
+
+ mysql_stmt_bind_param(stmt, bind_array);
+
+ mysql_stmt_send_long_data(stmt, 0, cp1251, strlen(cp1251));
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ /* Fetch data and verify that rows are in koi8 */
+
+ stmt_text= "SELECT c1, c2 FROM t1";
+
+ /* c1 and c2 are binary so no conversion will be done on select */
+ rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ bind_array[0].buffer= buf1;
+ bind_array[0].buffer_length= sizeof(buf1);
+ bind_array[0].length= &buf1_len;
+
+ bind_array[1].buffer= buf2;
+ bind_array[1].buffer_length= sizeof(buf2);
+ bind_array[1].length= &buf2_len;
+
+ mysql_stmt_bind_result(stmt, bind_array);
+
+ while ((rc= mysql_stmt_fetch(stmt)) == 0)
+ {
+ assert(buf1_len == strlen(koi8));
+ assert(buf2_len == strlen(koi8));
+ assert(!memcmp(buf1, koi8, buf1_len));
+ assert(!memcmp(buf2, koi8, buf1_len));
+ }
+ assert(rc == MYSQL_NO_DATA);
+ mysql_stmt_close(stmt);
+
+ stmt_text= "DROP TABLE t1";
+ mysql_real_query(mysql, stmt_text, strlen(stmt_text));
+}
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -9828,7 +10108,10 @@ int main(int argc, char **argv)
test_stiny_bug(); /* test a simple conv bug from php */
test_field_misc(); /* check the field info for misc case, bug: #74 */
test_set_option(); /* test the SET OPTION feature, bug #85 */
+ /*TODO HF: here should be NO_EMBEDDED_ACCESS_CHECKS*/
+#ifndef EMBEDDED_LIBRARY
test_prepare_grant(); /* to test the GRANT command, bug #89 */
+#endif
test_frm_bug(); /* test the crash when .frm is invalid, bug #93 */
test_explain_bug(); /* test for the EXPLAIN, bug #115 */
test_decimal_bug(); /* test for the decimal bug */
@@ -9877,6 +10160,10 @@ int main(int argc, char **argv)
test_union2(); /* repeatable execution of union (Bug #3577) */
test_bug1664(); /* test for bugs in mysql_stmt_send_long_data()
call (Bug #1664) */
+ test_union_param();
+ test_order_param(); /* ORDER BY with parameters in select list
+ (Bug #3686 */
+ test_ps_i18n(); /* test for i18n support in binary protocol */
end_time= time((time_t *)0);
total_time+= difftime(end_time, start_time);
diff --git a/tools/mysqlmanager.c b/tools/mysqlmanager.c
index f1efd3be3eb..2e9f980bb5d 100644
--- a/tools/mysqlmanager.c
+++ b/tools/mysqlmanager.c
@@ -21,6 +21,8 @@
Sasha Pachev <sasha@mysql.com>
*/
+#ifndef __NETWARE__
+
#include <my_global.h>
#include <my_pthread.h>
#include <mysql.h>
@@ -1850,3 +1852,16 @@ int main(int argc, char** argv)
else
return daemonize();
}
+
+#else
+
+#include <stdio.h>
+
+int main(void)
+{
+ fprintf(stderr,"This tool has not been ported to NetWare\n");
+ return 0;
+}
+
+#endif /* __NETWARE__ */
+
diff --git a/vio/test-ssl.c b/vio/test-ssl.c
index 84bae5fa0c7..88df6936a1f 100644
--- a/vio/test-ssl.c
+++ b/vio/test-ssl.c
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
-#ifdef HAVE_OPENSSL
+#if defined(HAVE_OPENSSL) && !defined(__NETWARE__)
#include <my_sys.h>
#include <m_string.h>
#include <m_ctype.h>
diff --git a/vio/viossl.c b/vio/viossl.c
index fafe48b7a84..a489cb98f98 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -25,6 +25,31 @@
#ifdef HAVE_OPENSSL
+#ifdef __NETWARE__
+/*
+ The default OpenSSL implementation on NetWare uses WinSock.
+ This code allows us to use the BSD sockets.
+*/
+
+static int SSL_set_fd_bsd(SSL *s, int fd)
+{
+ int result= -1;
+ BIO_METHOD *BIO_s_bsdsocket();
+ BIO *bio;
+
+ if ((bio= BIO_new(BIO_s_bsdsocket())))
+ {
+ result= BIO_set_fd(bio, fd, BIO_NOCLOSE);
+ SSL_set_bio(s, bio, bio);
+ }
+ return result;
+}
+
+#define SSL_set_fd(A, B) SSL_set_fd_bsd((A), (B))
+
+#endif /* __NETWARE__ */
+
+
static void
report_errors()
{
diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c
index 0997e3909db..498d10da0ee 100644
--- a/vio/viosslfactories.c
+++ b/vio/viosslfactories.c
@@ -172,6 +172,35 @@ vio_verify_callback(int ok, X509_STORE_CTX *ctx)
}
+#ifdef __NETWARE__
+
+/* NetWare SSL cleanup */
+void netware_ssl_cleanup()
+{
+ /* free memory from SSL_library_init() */
+ EVP_cleanup();
+
+ /* free global X509 method */
+ X509_STORE_method_cleanup();
+
+ /* free the thread_hash error table */
+ ERR_free_state_table();
+}
+
+
+/* NetWare SSL initialization */
+static void netware_ssl_init()
+{
+ /* initialize OpenSSL library */
+ SSL_library_init();
+
+ /* cleanup OpenSSL library */
+ NXVmRegisterExitHandler(netware_ssl_cleanup, NULL);
+}
+
+#endif /* __NETWARE__ */
+
+
/************************ VioSSLConnectorFd **********************************/
/*
TODO:
@@ -188,7 +217,7 @@ new_VioSSLConnectorFd(const char* key_file,
int verify = SSL_VERIFY_NONE;
struct st_VioSSLConnectorFd* ptr;
int result;
- DH *dh=NULL;
+ DH *dh;
DBUG_ENTER("new_VioSSLConnectorFd");
DBUG_PRINT("enter",
("key_file=%s, cert_file=%s, ca_path=%s, ca_file=%s, cipher=%s",
@@ -202,6 +231,10 @@ new_VioSSLConnectorFd(const char* key_file,
ptr->ssl_method= 0;
/* FIXME: constants! */
+#ifdef __NETWARE__
+ netware_ssl_init();
+#endif
+
if (!ssl_algorithms_added)
{
DBUG_PRINT("info", ("todo: OpenSSL_add_all_algorithms()"));
@@ -279,7 +312,7 @@ new_VioSSLAcceptorFd(const char *key_file,
SSL_VERIFY_CLIENT_ONCE);
struct st_VioSSLAcceptorFd* ptr;
int result;
- DH *dh=NULL;
+ DH *dh;
DBUG_ENTER("new_VioSSLAcceptorFd");
DBUG_PRINT("enter",
("key_file=%s, cert_file=%s, ca_path=%s, ca_file=%s, cipher=%s",
@@ -292,6 +325,10 @@ new_VioSSLAcceptorFd(const char *key_file,
/* FIXME: constants! */
ptr->session_id_context= ptr;
+#ifdef __NETWARE__
+ netware_ssl_init();
+#endif
+
if (!ssl_algorithms_added)
{
DBUG_PRINT("info", ("todo: OpenSSL_add_all_algorithms()"));
diff --git a/zlib/contrib/asm386/zlibvc.dsp b/zlib/contrib/asm386/zlibvc.dsp
index a70d4d4a6b0..63d8fee6511 100644
--- a/zlib/contrib/asm386/zlibvc.dsp
+++ b/zlib/contrib/asm386/zlibvc.dsp
@@ -8,16 +8,16 @@
CFG=zlibvc - 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
!MESSAGE NMAKE /f "zlibvc.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "zlibvc.mak" CFG="zlibvc - Win32 Release"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "zlibvc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "zlibvc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "zlibvc - Win32 ReleaseAxp" (based on\
@@ -26,7 +26,7 @@ CFG=zlibvc - Win32 Release
"Win32 (x86) Dynamic-Link Library")
!MESSAGE "zlibvc - Win32 ReleaseWithoutCrtdll" (based on\
"Win32 (x86) Dynamic-Link Library")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP Scc_ProjName ""
@@ -191,7 +191,7 @@ LINK32=link.exe
# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_1\zlib.dll"
# SUBTRACT LINK32 /pdb:none
-!ENDIF
+!ENDIF
# Begin Target
@@ -216,13 +216,13 @@ SOURCE=.\adler32.c
DEP_CPP_ADLER=\
".\zconf.h"\
".\zlib.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -238,13 +238,13 @@ SOURCE=.\compress.c
DEP_CPP_COMPR=\
".\zconf.h"\
".\zlib.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -260,13 +260,13 @@ SOURCE=.\crc32.c
DEP_CPP_CRC32=\
".\zconf.h"\
".\zlib.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -284,13 +284,13 @@ DEP_CPP_DEFLA=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -307,7 +307,7 @@ SOURCE=.\gvmat32c.c
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -324,13 +324,13 @@ DEP_CPP_GZIO_=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -351,13 +351,13 @@ DEP_CPP_INFBL=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -379,13 +379,13 @@ DEP_CPP_INFCO=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -407,13 +407,13 @@ DEP_CPP_INFFA=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -431,13 +431,13 @@ DEP_CPP_INFLA=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -455,13 +455,13 @@ DEP_CPP_INFTR=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -482,13 +482,13 @@ DEP_CPP_INFUT=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -506,13 +506,13 @@ DEP_CPP_TREES=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -528,13 +528,13 @@ SOURCE=.\uncompr.c
DEP_CPP_UNCOM=\
".\zconf.h"\
".\zlib.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -551,7 +551,7 @@ SOURCE=.\unzip.c
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -568,7 +568,7 @@ SOURCE=.\zip.c
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -593,13 +593,13 @@ DEP_CPP_ZUTIL=\
".\zconf.h"\
".\zlib.h"\
".\zutil.h"\
-
+
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
-!ENDIF
+!ENDIF
# End Source File
# End Group