summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <magnus@neptunus.(none)>2004-05-25 12:25:22 +0200
committerunknown <magnus@neptunus.(none)>2004-05-25 12:25:22 +0200
commit4cb7f4944d48d69e13138e196d3d5f55eb6a94df (patch)
tree53c45c9394c46d7f605d226266e85ee4fd30776f
parentc94b1d606f15a2546f6cb05ea31797d306b09183 (diff)
parentf80e9e042ee33e1debdac1e46992470e495921c9 (diff)
downloadmariadb-git-4cb7f4944d48d69e13138e196d3d5f55eb6a94df.tar.gz
Merge msvensson@bk-internal.mysql.com:/home/bk/mysql-4.1
into neptunus.(none):/home/magnus/mysql-4.1 sql/handler.cc: Auto merged sql/sql_table.cc: Auto merged
-rwxr-xr-xBUILD/compile-pentium-valgrind-max2
-rw-r--r--BitKeeper/etc/logging_ok3
-rwxr-xr-xBuild-tools/Do-compile7
-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.dsp16
-rw-r--r--VC++Files/copy_mysql_files.bat80
-rw-r--r--VC++Files/dbug/dbug.dsp8
-rw-r--r--VC++Files/heap/heap.dsp8
-rw-r--r--VC++Files/innobase/innobase.dsp14
-rw-r--r--VC++Files/isam/isam.dsp8
-rw-r--r--VC++Files/isamchk/isamchk.dsp33
-rw-r--r--VC++Files/libmysql/libmysql.dsp4
-rw-r--r--VC++Files/libmysqld/libmysqld.dsp129
-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.dsp2
-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.dsp8
-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.dsp32
-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.dsp651
-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/mysql.cc16
-rw-r--r--client/mysqlbinlog.cc31
-rw-r--r--client/mysqldump.c61
-rw-r--r--client/mysqltest.c23
-rw-r--r--include/m_string.h1
-rw-r--r--include/my_global.h5
-rw-r--r--include/my_sys.h2
-rw-r--r--include/mysql_com.h2
-rw-r--r--include/mysql_embed.h3
-rw-r--r--include/mysql_version.h.in6
-rw-r--r--innobase/btr/btr0btr.c2
-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.c7
-rw-r--r--innobase/include/Makefile.am4
-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/mem0pool.h2
-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.h4
-rw-r--r--innobase/include/pars0sym.h4
-rw-r--r--innobase/include/row0mysql.h51
-rw-r--r--innobase/include/row0sel.h10
-rw-r--r--innobase/include/sync0ipm.h113
-rw-r--r--innobase/include/sync0ipm.ic182
-rw-r--r--innobase/include/trx0roll.h4
-rw-r--r--innobase/include/trx0sys.h2
-rw-r--r--innobase/include/trx0trx.h12
-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.c40
-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.c183
-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.c4
-rw-r--r--innobase/pars/pars0sym.c5
-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/srv0srv.c8
-rw-r--r--innobase/sync/Makefile.am2
-rw-r--r--innobase/sync/makefilewin7
-rw-r--r--innobase/sync/sync0arr.c1
-rw-r--r--innobase/sync/sync0ipm.c170
-rw-r--r--innobase/trx/trx0rec.c22
-rw-r--r--innobase/trx/trx0roll.c4
-rw-r--r--innobase/trx/trx0sys.c4
-rw-r--r--innobase/trx/trx0trx.c4
-rw-r--r--innobase/ut/ut0dbg.c2
-rw-r--r--innobase/ut/ut0ut.c221
-rw-r--r--isam/_search.c8
-rw-r--r--isam/test2.c2
-rw-r--r--libmysql/libmysql.c165
-rw-r--r--libmysqld/embedded_priv.h1
-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_test2.c2
-rw-r--r--myisam/rt_test.c2
-rw-r--r--mysql-test/r/derived.result4
-rw-r--r--mysql-test/r/fulltext.result2
-rw-r--r--mysql-test/r/func_str.result9
-rw-r--r--mysql-test/r/handler.result12
-rw-r--r--mysql-test/r/innodb.result25
-rw-r--r--mysql-test/r/order_by.result4
-rw-r--r--mysql-test/r/rpl_relayrotate.result15
-rw-r--r--mysql-test/r/rpl_server_id2.result3
-rw-r--r--mysql-test/r/rpl_trunc_binlog.result2
-rw-r--r--mysql-test/r/subselect.result11
-rw-r--r--mysql-test/r/type_datetime.result6
-rw-r--r--mysql-test/r/type_float.result15
-rw-r--r--mysql-test/r/union.result23
-rw-r--r--mysql-test/r/variables.result5
-rw-r--r--mysql-test/t/fulltext.test1
-rw-r--r--mysql-test/t/func_str.test9
-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.test33
-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/rpl_server_id2.test1
-rw-r--r--mysql-test/t/rpl_trunc_binlog.test2
-rw-r--r--mysql-test/t/subselect.test2
-rw-r--r--mysql-test/t/type_float.test8
-rw-r--r--mysql-test/t/union.test12
-rw-r--r--mysql-test/t/variables.test8
-rw-r--r--mysys/charset.c58
-rw-r--r--mysys/my_chsize.c2
-rw-r--r--mysys/my_compress.c2
-rw-r--r--mysys/my_handler.c8
-rw-r--r--mysys/sha1.c2
-rw-r--r--ndb/src/kernel/ndb-main/Main.cpp15
-rw-r--r--scripts/make_binary_distribution.sh1
-rwxr-xr-xscripts/make_win_src_distribution.sh4
-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.h6
-rw-r--r--sql/field.cc34
-rw-r--r--sql/ha_heap.cc2
-rw-r--r--sql/ha_innodb.cc62
-rw-r--r--sql/handler.cc11
-rw-r--r--sql/item.cc415
-rw-r--r--sql/item.h72
-rw-r--r--sql/item_func.cc1
-rw-r--r--sql/item_strfunc.cc1
-rw-r--r--sql/item_timefunc.cc77
-rw-r--r--sql/lock.cc4
-rw-r--r--sql/log_event.cc2
-rw-r--r--sql/mysql_priv.h35
-rw-r--r--sql/mysqld.cc65
-rw-r--r--sql/mysqld_suffix.h27
-rw-r--r--sql/opt_range.cc11
-rw-r--r--sql/protocol.cc58
-rw-r--r--sql/protocol.h4
-rw-r--r--sql/set_var.cc20
-rw-r--r--sql/slave.cc20
-rw-r--r--sql/sql_acl.cc12
-rw-r--r--sql/sql_base.cc4
-rw-r--r--sql/sql_cache.cc19
-rw-r--r--sql/sql_class.cc33
-rw-r--r--sql/sql_class.h26
-rw-r--r--sql/sql_db.cc10
-rw-r--r--sql/sql_handler.cc16
-rw-r--r--sql/sql_insert.cc6
-rw-r--r--sql/sql_lex.cc3
-rw-r--r--sql/sql_lex.h25
-rw-r--r--sql/sql_parse.cc50
-rw-r--r--sql/sql_prepare.cc322
-rw-r--r--sql/sql_select.cc175
-rw-r--r--sql/sql_show.cc11
-rw-r--r--sql/sql_string.cc45
-rw-r--r--sql/sql_string.h3
-rw-r--r--sql/sql_table.cc53
-rw-r--r--sql/sql_union.cc58
-rw-r--r--sql/sql_yacc.yy120
-rw-r--r--sql/time.cc138
-rw-r--r--strings/ctype-big5.c10
-rw-r--r--strings/ctype-gbk.c8
-rw-r--r--strings/ctype-mb.c2
-rw-r--r--strings/ctype-tis620.c2
-rw-r--r--strings/ctype-uca.c6
-rw-r--r--tests/client_test.c272
-rw-r--r--zlib/contrib/asm386/zlibvc.dsp76
240 files changed, 4555 insertions, 2827 deletions
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 c89c60287fd..ab36663aab3 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -106,6 +106,7 @@ 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
@@ -116,6 +117,7 @@ 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
@@ -160,6 +162,7 @@ tim@white.box
tim@work.mysql.com
tom@basil-firewall.home.com
tomas@mc05.(none)
+tomas@poseidon.(none)
tonu@hundin.mysql.fi
tonu@volk.internalnet
tonu@x153.internalnet
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile
index 0ca2f97a369..434b8d2f719 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,6 +239,7 @@ 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
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..509bf02cce5 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,7 +45,7 @@ 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"
# Begin Target
diff --git a/VC++Files/copy_mysql_files.bat b/VC++Files/copy_mysql_files.bat
new file mode 100644
index 00000000000..8f5789b9dfd
--- /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
+xcopy scripts\*.* c:\mysql\scripts /E
+xcopy docs\*.* c:\mysql\docs /E
+xcopy docs\readme c:\mysql\
+xcopy sql-bench\*.* c:\mysql\bench /E
+
+REM Copy privilege tables (Delete old ones as they may be from a newer version)
+
+del c:\mysql\data\mysql\*.* /Q
+copy data\*.* c:\mysql\data
diff --git a/VC++Files/dbug/dbug.dsp b/VC++Files/dbug/dbug.dsp
index 5db7b05175b..8d0ebf2878b 100644
--- a/VC++Files/dbug/dbug.dsp
+++ b/VC++Files/dbug/dbug.dsp
@@ -25,7 +25,7 @@ CFG=dbug - Win32 Debug
# 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 +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\dbug.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\dbug.lib"
diff --git a/VC++Files/heap/heap.dsp b/VC++Files/heap/heap.dsp
index 1edeec80e9b..447777b17ef 100644
--- a/VC++Files/heap/heap.dsp
+++ b/VC++Files/heap/heap.dsp
@@ -25,7 +25,7 @@ CFG=heap - Win32 Debug
# 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 +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\heap.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\heap.lib"
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..3e1dcf9dc35 100644
--- a/VC++Files/isam/isam.dsp
+++ b/VC++Files/isam/isam.dsp
@@ -25,7 +25,7 @@ CFG=isam - Win32 Debug
# 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 +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\isam.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\isam.lib"
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..4721fd7de08 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" /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /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 f6822f0ebc9..0b559a671f4 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 "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
@@ -70,8 +72,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 "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,16 +83,93 @@ 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.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\innodb.lib ..\lib_debug\bdb.lib /nologo /dll /pdb:none /debug /machine:I386 /nodefaultlib:"LIBCMTD" /out:"../lib_debug/libmysqld.dll" /implib:"../lib_debug/libmysqld.lib"
+!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.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 /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.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 /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 LICENCE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /FD /D MYSQL_SEVER_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.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 /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.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 /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="..\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
+
SOURCE="..\strings\ctype-latin1.c"
# End Source File
# Begin Source File
@@ -103,6 +182,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
@@ -191,11 +278,11 @@ SOURCE=..\sql\item_func.cpp
# End Source File
# Begin Source File
-SOURCE=.\item_geofunc.cpp
+SOURCE=..\sql\item_geofunc.cpp
# End Source File
# Begin Source File
-SOURCE=.\item_row.cpp
+SOURCE=..\sql\item_row.cpp
# End Source File
# Begin Source File
@@ -227,6 +314,10 @@ SOURCE=.\lib_sql.cpp
# End Source File
# Begin Source File
+SOURCE=..\libmysql\libmysql.c
+# End Source File
+# Begin Source File
+
SOURCE=.\libmysqld.c
# End Source File
# Begin Source File
@@ -271,7 +362,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
@@ -283,7 +374,7 @@ SOURCE=..\sql\procedure.cpp
# End Source File
# Begin Source File
-SOURCE=.\protocol.cpp
+SOURCE=..\sql\protocol.cpp
# End Source File
# Begin Source File
@@ -351,7 +442,7 @@ SOURCE=..\sql\sql_handler.cpp
# End Source File
# Begin Source File
-SOURCE=.\sql_help.cpp
+SOURCE=..\sql\sql_help.cpp
# End Source File
# Begin Source File
@@ -367,6 +458,10 @@ SOURCE=..\sql\sql_list.cpp
# End Source File
# Begin Source File
+SOURCE=..\sql\sql_load.cpp
+# End Source File
+# Begin Source File
+
SOURCE=..\sql\sql_manager.cpp
# End Source File
# Begin Source File
@@ -473,5 +568,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..14d0fa416bc 100644
--- a/VC++Files/myisam/myisam.dsp
+++ b/VC++Files/myisam/myisam.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/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..909f24f81e9 100644
--- a/VC++Files/myisammrg/myisammrg.dsp
+++ b/VC++Files/myisammrg/myisammrg.dsp
@@ -25,7 +25,7 @@ CFG=myisammrg - Win32 Debug
# 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 +41,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,7 +71,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\myisammrg.lib"
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..5ddea20a614 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 "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 "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /D LICENCE=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 LICENCE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /FD /D MYSQL_SEVER_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..4e167a3973f 100644
--- a/VC++Files/mysys/mysys.dsp
+++ b/VC++Files/mysys/mysys.dsp
@@ -7,26 +7,26 @@
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
# 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 +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" /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 +66,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,18 +91,18 @@ 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
+!ENDIF
# Begin Target
@@ -121,7 +121,7 @@ SOURCE=.\array.c
!ELSEIF "$(CFG)" == "mysys - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -528,7 +528,7 @@ SOURCE=.\thr_lock.c
!ELSEIF "$(CFG)" == "mysys - Win32 Max"
-!ENDIF
+!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 73c08a8fca0..14c16afde9b 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 "HAVE_INNOBASE_DB" /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\innodb.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 LICENCE=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 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\innodb.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 LICENCE=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
@@ -470,20 +687,22 @@ SOURCE=.\item_func.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Debug"
-# ADD CPP /G5 /I "../zlib"
+# ADD CPP /G5
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "mysqld - Win32 nt"
-# ADD CPP /I "../zlib"
-
!ELSEIF "$(CFG)" == "mysqld - Win32 Max nt"
-# ADD CPP /I "../zlib"
-
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-# ADD CPP /I "../zlib"
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
+
+!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
!ENDIF
@@ -513,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
@@ -537,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
@@ -556,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
@@ -576,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
@@ -596,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
@@ -616,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
@@ -636,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
@@ -659,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
@@ -683,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
@@ -706,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
@@ -729,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
@@ -760,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
@@ -780,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
@@ -804,7 +1127,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
@@ -840,7 +1171,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
@@ -864,7 +1203,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
@@ -888,6 +1235,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
@@ -920,7 +1275,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
@@ -940,7 +1303,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
@@ -980,7 +1351,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
@@ -1000,7 +1379,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
@@ -1020,7 +1407,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
@@ -1040,7 +1435,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
@@ -1064,7 +1467,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
@@ -1084,7 +1495,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
@@ -1116,7 +1535,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
@@ -1136,7 +1563,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
@@ -1160,7 +1595,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
@@ -1180,7 +1623,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
@@ -1200,7 +1651,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
@@ -1228,7 +1687,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
@@ -1248,7 +1715,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
@@ -1268,6 +1743,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
@@ -1292,7 +1775,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
@@ -1312,7 +1803,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
@@ -1336,7 +1835,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/mysql.cc b/client/mysql.cc
index ddc6441f08a..d3885645124 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));
@@ -1239,7 +1245,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;
@@ -1589,7 +1594,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] != '\'')
@@ -1615,7 +1619,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)))
@@ -2404,6 +2408,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);
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 0f3260e903d..f8993004467 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -45,7 +45,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;
@@ -440,6 +440,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},
@@ -707,33 +713,34 @@ static int dump_remote_log_entries(const char* logname)
Log_event_type type= ev->get_type_code();
if (!old_format || ( type != LOAD_EVENT && type != CREATE_FILE_EVENT))
{
- /*
- If this is a Rotate event, maybe it's the end of the requested binlog;
- in this case we are done (stop transfer).
- This is suitable for binlogs, not relay logs (but for now we don't read
- relay logs remotely because the server is not able to do that). If one
- day we read relay logs remotely, then we will have a problem with the
- detection below: relay logs contain Rotate events which are about the
- binlogs, so which would trigger the end-detection below.
- */
if (ev->get_type_code() == ROTATE_EVENT)
{
Rotate_log_event *rev= (Rotate_log_event *)ev;
/*
+ mysqld is sending us all its binlogs after the requested one, but we
+ don't want them.
If this is a fake Rotate event, and not about our log, we can stop
transfer. If this a real Rotate event (so it's not about our log,
it's in our log describing the next log), we print it (because it's
part of our log) and then we will stop when we receive the fake one
soon.
+ This is suitable for binlogs, not relay logs (but for now we don't
+ read relay logs remotely because the server is not able to do
+ that). If one day we read relay logs remotely, then we will have a
+ problem with the detection below: relay logs contain Rotate events
+ which are about the binlogs, so which would trigger the end-detection
+ below.
*/
- 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))
DBUG_RETURN(0);
/*
Otherwise, this is a fake Rotate for our log, at the very beginning
- for sure. Skip it.
+ for sure. Skip it, because it was not in the original log. If we
+ are running with to_last_remote_log, we print it, because it serves
+ as a useful marker between binlogs then.
*/
continue;
}
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 20792f8c025..97ae0070e04 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1264,18 +1264,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 +1335,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 +1356,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 +1374,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 +1383,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 +1422,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 +1442,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 +1479,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 +1574,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 +1585,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/mysqltest.c b/client/mysqltest.c
index be5dac1c9d9..303473ef558 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;
@@ -1097,7 +1097,7 @@ int do_sync_with_master2(const char* p)
MYSQL_ROW row;
MYSQL* mysql = &cur_con->mysql;
char query_buf[FN_REFLEN+128];
- int offset = 0;
+ int offset= 0, tries= 0;
int rpl_parse;
if (!master_pos.file[0])
@@ -1112,6 +1112,9 @@ int do_sync_with_master2(const char* p)
sprintf(query_buf, "select master_pos_wait('%s', %ld)", master_pos.file,
master_pos.pos + offset);
+
+wait_for_position:
+
if (mysql_query(mysql, query_buf))
die("line %u: failed in %s: %d: %s", start_lineno, query_buf,
mysql_errno(mysql), mysql_error(mysql));
@@ -1122,8 +1125,20 @@ int do_sync_with_master2(const char* p)
if (!(row = mysql_fetch_row(res)))
die("line %u: empty result in %s", start_lineno, query_buf);
if (!row[0])
- die("line %u: could not sync with master ('%s' returned NULL)",
- start_lineno, query_buf);
+ {
+ /*
+ It may be that the slave SQL thread has not started yet, though START
+ SLAVE has been issued ?
+ */
+ if (tries++ == 3)
+ {
+ die("line %u: could not sync with master ('%s' returned NULL)",
+ start_lineno, query_buf);
+ }
+ sleep(1); /* So at most we will wait 3 seconds and make 4 tries */
+ mysql_free_result(res);
+ goto wait_for_position;
+ }
mysql_free_result(res);
last_result=0;
if (rpl_parse)
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_global.h b/include/my_global.h
index e7d924eb0ca..fafe0425c55 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -338,6 +338,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
@@ -382,7 +385,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 8beaa00eb16..922e6d8cff4 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -762,6 +762,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/mysql_com.h b/include/mysql_com.h
index ada2bd1f679..a1da896af38 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -359,6 +359,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/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/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 7dc0bd98001..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));
}
diff --git a/innobase/include/Makefile.am b/innobase/include/Makefile.am
index 2584357e24a..102d25566da 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 \
@@ -44,7 +44,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.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 \
+ 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/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/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/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 c260557c424..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. */
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/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/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 126aceae1eb..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, __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, __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/trx0roll.h b/innobase/include/trx0roll.h
index 0d7126c9c57..6004551f456 100644
--- a/innobase/include/trx0roll.h
+++ b/innobase/include/trx0roll.h
@@ -193,7 +193,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 +211,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..a8c1df534da 100644
--- a/innobase/include/trx0trx.h
+++ b/innobase/include/trx0trx.h
@@ -275,13 +275,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 +315,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 +358,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 +366,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/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 056d502e858..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);
}
@@ -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/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 79185c30f79..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
@@ -387,15 +387,17 @@ 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);
@@ -413,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;
@@ -491,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__
@@ -583,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 */
{
@@ -702,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;
@@ -744,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;
@@ -862,7 +869,7 @@ try_again:
goto try_again;
}
#ifdef USE_FILE_LOCK
- } else if (os_file_lock(file, name)) {
+ } else if (os_file_lock(file, name, F_WRLCK)) {
*success = FALSE;
file = -1;
#endif
@@ -880,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;
@@ -971,7 +980,7 @@ os_file_create_simple_no_error_handling(
if (file == -1) {
*success = FALSE;
#ifdef USE_FILE_LOCK
- } else if (os_file_lock(file, name)) {
+ } else if (os_file_lock(file, name, F_WRLCK)) {
*success = FALSE;
file = -1;
#endif
@@ -989,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;
@@ -1182,7 +1194,7 @@ try_again:
goto try_again;
}
#ifdef USE_FILE_LOCK
- } else if (os_file_lock(file, name)) {
+ } else if (os_file_lock(file, name, F_WRLCK)) {
*success = FALSE;
file = -1;
#endif
@@ -1200,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;
@@ -1261,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;
@@ -1325,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;
@@ -1338,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
@@ -1383,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) {
@@ -1419,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) {
@@ -1508,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
@@ -1769,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 */
@@ -2049,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
@@ -2206,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) */
{
@@ -2311,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;
@@ -2348,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 };
@@ -2745,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 */
@@ -2992,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
@@ -3535,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);
@@ -3630,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 7e835d9ada1..12451b4d94d 100644
--- a/innobase/pars/pars0pars.c
+++ b/innobase/pars/pars0pars.c
@@ -1729,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/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/srv0srv.c b/innobase/srv/srv0srv.c
index 7194dfc1d2f..c21dfda6265 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -32,7 +32,6 @@ 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"
@@ -1525,13 +1524,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 02a9771be35..d1644412fbb 100644
--- a/innobase/sync/sync0arr.c
+++ b/innobase/sync/sync0arr.c
@@ -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/trx/trx0rec.c b/innobase/trx/trx0rec.c
index 16f9f3d093d..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);
}
@@ -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..e2e4f24b82e 100644
--- a/innobase/trx/trx0roll.c
+++ b/innobase/trx/trx0roll.c
@@ -200,7 +200,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 +265,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/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..8128c8de13e 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -1564,7 +1564,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/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/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/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/libmysql.c b/libmysql/libmysql.c
index a467b7fc9fd..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))
{
@@ -1570,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);
}
@@ -1978,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);
/*
@@ -2353,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)
@@ -2390,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++)
@@ -2804,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);
@@ -3729,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;
@@ -3768,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
{
@@ -3814,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));
@@ -3822,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;
@@ -3956,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;
@@ -3991,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");
@@ -4004,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/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/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 d25ffeedff0..5f20046d1cf 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_test2.c b/myisam/mi_test2.c
index 56d8357536a..95c8ce56a13 100644
--- a/myisam/mi_test2.c
+++ b/myisam/mi_test2.c
@@ -643,7 +643,7 @@ int main(int argc, char *argv[])
{
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);
diff --git a/myisam/rt_test.c b/myisam/rt_test.c
index c1126c1939a..41cc56d4d78 100644
--- a/myisam/rt_test.c
+++ b/myisam/rt_test.c
@@ -39,7 +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;
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/fulltext.result b/mysql-test/r/fulltext.result
index f93f7401081..3106602e718 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -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_str.result b/mysql-test/r/func_str.result
index 4e7df9edefa..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
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/innodb.result b/mysql-test/r/innodb.result
index 700fe1a4111..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
@@ -1595,3 +1595,26 @@ t2 CREATE TABLE `t2` (
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/order_by.result b/mysql-test/r/order_by.result
index 5edffdacc98..694dc26bcde 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -89,10 +89,10 @@ create table t1 ( pk int primary key, name varchar(255) not null, number v
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
-Gamma 123
-Gamma Ext 123a
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);
diff --git a/mysql-test/r/rpl_relayrotate.result b/mysql-test/r/rpl_relayrotate.result
index 96ec06a69aa..bf9bbbb9b93 100644
--- a/mysql-test/r/rpl_relayrotate.result
+++ b/mysql-test/r/rpl_relayrotate.result
@@ -16,19 +16,4 @@ master_pos_wait('master-bin.001',3000)>=0
select * from t1 where a=8000;
a
8000
-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/rpl_server_id2.result b/mysql-test/r/rpl_server_id2.result
index fde7251497a..82ab1ff85a7 100644
--- a/mysql-test/r/rpl_server_id2.result
+++ b/mysql-test/r/rpl_server_id2.result
@@ -4,9 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-drop table if exists t1;
-Warnings:
-Note 1051 Unknown table 't1'
create table t1 (n int);
reset master;
stop slave;
diff --git a/mysql-test/r/rpl_trunc_binlog.result b/mysql-test/r/rpl_trunc_binlog.result
index ad0fb9e5022..085a2937584 100644
--- a/mysql-test/r/rpl_trunc_binlog.result
+++ b/mysql-test/r/rpl_trunc_binlog.result
@@ -10,4 +10,4 @@ reset slave;
start slave;
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_PORT 1 master-bin.000002 4 slave-relay-bin.000002 123 master-bin.000001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. A probable cause is that the master died while writing the transaction to its binary log. 0 79 326 None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 4 slave-relay-bin.000002 123 master-bin.000001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. A probable cause is that the master died while writing the transaction to its binary log. 0 79 # None 0 No #
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 8fe447c59fd..9ad3a5a9cf2 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -16,6 +16,7 @@ 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
@@ -28,6 +29,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
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 (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))`
@@ -182,6 +184,7 @@ 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 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;
@@ -306,6 +309,7 @@ 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
@@ -413,6 +417,7 @@ 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 1 AS `1` from test.t1
drop table t1;
@@ -727,6 +732,7 @@ 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 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);
@@ -1536,11 +1542,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');
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 71ac229601d..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;
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index c85b59be38c..0735ea4dc40 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -86,6 +86,7 @@ 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 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;
@@ -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 NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 UNION NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+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,6 +470,7 @@ 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 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);
@@ -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/variables.result b/mysql-test/r/variables.result
index 290b1fa41cf..33adfe548da 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -397,6 +397,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/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_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/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 47e82db2dc4..e0cc96ccb32 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1106,4 +1106,37 @@ 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/rpl000015.test b/mysql-test/t/rpl000015.test
index 38e0d1bff6c..b0119526deb 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 # 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 4e4e79adf67..0062a67ff1a 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 # 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 7ae0a4dc3c2..8fdccdd068d 100644
--- a/mysql-test/t/rpl_log.test
+++ b/mysql-test/t/rpl_log.test
@@ -89,11 +89,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 # 33 #
show slave status;
diff --git a/mysql-test/t/rpl_log_pos.test b/mysql-test/t/rpl_log_pos.test
index 2e54c98c014..a40736577c8 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 # 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 # 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 # 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 # 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 a28aed52ec8..cbcc115a942 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 # 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 # 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 # 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 # 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 # 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 # 33 #
show slave status;
diff --git a/mysql-test/t/rpl_relayrotate.test b/mysql-test/t/rpl_relayrotate.test
index ca3bff81608..46e6f1bd157 100644
--- a/mysql-test/t/rpl_relayrotate.test
+++ b/mysql-test/t/rpl_relayrotate.test
@@ -60,22 +60,6 @@ select * from t1 where a=8000;
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 0d447b8d1a3..da4d5f0bce1 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 # 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 # 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 # 33 #
show slave status;
# because of concurrent insert, the table may not be up to date
diff --git a/mysql-test/t/rpl_server_id2.test b/mysql-test/t/rpl_server_id2.test
index dc8f733b7ed..7bbac358ada 100644
--- a/mysql-test/t/rpl_server_id2.test
+++ b/mysql-test/t/rpl_server_id2.test
@@ -3,7 +3,6 @@
source include/master-slave.inc;
connection slave;
-drop table if exists t1;
create table t1 (n int);
reset master;
# replicate ourselves
diff --git a/mysql-test/t/rpl_trunc_binlog.test b/mysql-test/t/rpl_trunc_binlog.test
index 32052af9184..2ade41ee96d 100644
--- a/mysql-test/t/rpl_trunc_binlog.test
+++ b/mysql-test/t/rpl_trunc_binlog.test
@@ -21,5 +21,5 @@ start slave;
# can't sync_with_master so we must sleep
sleep 3;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 33 #
+--replace_column 1 # 23 # 33 #
show slave status;
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 94389963ae6..0f461ba5277 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -974,7 +974,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;
#
diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test
index 7d3b90aabeb..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.
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 843a417bb25..a1faa4a4f71 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -286,6 +286,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..c80b00db397 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -622,3 +622,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/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_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/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/src/kernel/ndb-main/Main.cpp b/ndb/src/kernel/ndb-main/Main.cpp
index ef33802cab6..1515a108e35 100644
--- a/ndb/src/kernel/ndb-main/Main.cpp
+++ b/ndb/src/kernel/ndb-main/Main.cpp
@@ -228,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);
}
}
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 3261ec309d4..da83e195943 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -224,6 +224,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
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/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 1044673f8ec..469b82f95fa 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 \
@@ -86,7 +86,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
gen_lex_hash_SOURCES = gen_lex_hash.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.h b/sql/examples/ha_example.h
index ffc4f5b941c..2228f04284a 100644
--- a/sql/examples/ha_example.h
+++ b/sql/examples/ha_example.h
@@ -114,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 1ad7e039363..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);
}
@@ -3930,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)
{
diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc
index 9915dc90dc1..c375614ac95 100644
--- a/sql/ha_heap.cc
+++ b/sql/ha_heap.cc
@@ -375,7 +375,7 @@ ha_rows ha_heap::records_in_range(uint inx, key_range *min_key,
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't only use exact keys
+ return HA_POS_ERROR; // Can only use exact keys
return 10; // Good guess
}
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index ff491a95043..8a40af90541 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);
diff --git a/sql/handler.cc b/sql/handler.cc
index bf5f870e8ff..4a2948e63f8 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);
@@ -1276,7 +1277,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;
}
diff --git a/sql/item.cc b/sql/item.cc
index 11a9e88bdd6..f3a13411fe3 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -27,6 +27,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
*****************************************************************************/
@@ -369,9 +371,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;
}
@@ -618,13 +625,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*) "?";
@@ -640,74 +645,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);
}
@@ -723,9 +747,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;
}
@@ -734,155 +767,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 99a0516e439..ccf8e8685d0 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -393,33 +393,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.
@@ -429,10 +459,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
@@ -440,7 +470,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_func.cc b/sql/item_func.cc
index aaea676fee1..f221e0dcc5c 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -612,6 +612,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);
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_timefunc.cc b/sql/item_timefunc.cc
index e8848243812..45d66addc9f 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1134,9 +1134,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;
@@ -1147,6 +1144,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)
@@ -1205,15 +1203,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();
}
@@ -1256,23 +1251,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();
@@ -1457,10 +1441,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)
{
@@ -1507,25 +1491,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;
@@ -1540,19 +1517,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,
@@ -1561,17 +1536,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;
}
@@ -2035,7 +2002,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/lock.cc b/sql/lock.cc
index 923932a768a..ac689495ca3 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 b3ec1f0fe55..abbccb32034 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1058,6 +1058,7 @@ end:
VOID(pthread_mutex_lock(&LOCK_thread_count));
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
@@ -1674,6 +1675,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 14bd16332ef..fb9ff5be771 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -284,6 +284,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;
@@ -519,13 +527,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);
@@ -536,7 +541,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);
@@ -857,7 +862,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;
@@ -998,9 +1003,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 2d2514b0017..c5e5f881a83 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"
#ifdef HAVE_BERKELEY_DB
#include "ha_berkeley.h"
#endif
@@ -191,22 +192,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 */
@@ -335,7 +320,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 */
@@ -489,6 +474,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);
@@ -2108,18 +2094,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));
@@ -2603,14 +2582,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
@@ -4947,6 +4926,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);
}
@@ -5828,6 +5808,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/sql/mysqld_suffix.h b/sql/mysqld_suffix.h
new file mode 100644
index 00000000000..405c5d855b7
--- /dev/null
+++ b/sql/mysqld_suffix.h
@@ -0,0 +1,27 @@
+/* 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
+ 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 */
+
+/*
+ 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
+*/
+
+#ifdef MYSQL_SERVER_SUFFIX
+#define MYSQL_SERVER_SUFFIX_STR STRINGIFY_ARG(MYSQL_SERVER_SUFFIX)
+#else
+#define MYSQL_SERVER_SUFFIX_STR MYSQL_SERVER_SUFFIX_DEF
+#endif
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 3cc64c35223..a5d2450e551 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1401,7 +1401,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
@@ -1417,7 +1417,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);
}
@@ -1559,7 +1559,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
@@ -2313,7 +2313,7 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree,
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= param->max_key;
+ 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);
@@ -2826,7 +2826,8 @@ int QUICK_SELECT_DESC::cmp_prev(QUICK_RANGE *range_arg)
if (range_arg->flag & NO_MIN_RANGE)
return 0; /* key can't be to small */
- cmp= key_cmp(key_part_info, range_arg->min_key, range_arg->min_length);
+ 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/protocol.cc b/sql/protocol.cc
index a5944af829d..44fc4eff9ad 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -455,6 +455,7 @@ void Protocol::init(THD *thd_arg)
{
thd=thd_arg;
packet= &thd->packet;
+ convert= &thd->convert_buffer;
#ifndef DEBUG_OFF
field_types= 0;
#endif
@@ -691,6 +692,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)
{
@@ -701,15 +722,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);
}
@@ -724,15 +737,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);
}
@@ -826,15 +831,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);
}
@@ -947,8 +944,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 ||
@@ -956,7 +954,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,
@@ -969,7 +967,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 17c8f0d321d..41885ec9f1f 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/set_var.cc b/sql/set_var.cc
index 1205eb17357..b3b0153652b 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -107,6 +107,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);
@@ -307,7 +308,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
@@ -441,9 +442,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));
/*
@@ -703,7 +702,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},
@@ -1134,6 +1133,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;
@@ -1293,11 +1299,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 12fec28ec49..fa17a192b12 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -167,13 +167,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 */,
@@ -2489,13 +2487,17 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
thd->master_access= ~0;
thd->priv_user = 0;
thd->slave_thread = 1;
- thd->options = ((opt_log_slave_updates) ? OPTION_BIN_LOG:0) |
- OPTION_AUTO_IS_NULL;
/*
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);
@@ -3156,6 +3158,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)
{
@@ -3321,6 +3324,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
err:
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));
thd->proc_info = "Waiting for slave mutex on exit";
pthread_mutex_lock(&rli->run_lock);
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index fbd47d4954d..25ff4c5676b 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -953,7 +953,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);
@@ -1733,8 +1733,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);
@@ -1768,8 +1768,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);
@@ -2416,7 +2416,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;
}
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 14a54a410a2..e3fbfb2d0e3 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2103,7 +2103,9 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
=> 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->name, field_name) ||
+ !my_strcasecmp(system_charset_info,
+ item_field->field_name, field_name)))
{
if (!table_name)
{
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index d7d4219c7fd..b9fe61ac48a 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1512,13 +1512,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 f7992c3db9e..9d368db0229 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -106,13 +106,13 @@ bool foreign_key_prefix(Key *a, Key *b)
if (a->generated)
{
if (b->generated && a->columns.elements > b->columns.elements)
- swap(Key*, a, b); // Put shorter key in 'a'
+ swap_variables(Key*, a, b); // Put shorter key in 'a'
}
else
{
if (!b->generated)
return TRUE; // No foreign key
- swap(Key*, a, b); // Put generated key in 'a'
+ swap_variables(Key*, a, b); // Put generated key in 'a'
}
/* Test if 'a' is a prefix of 'b' */
@@ -504,6 +504,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
*/
diff --git a/sql/sql_class.h b/sql/sql_class.h
index e602b7d6d5f..7894cf5fb2c 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -28,7 +28,7 @@ class Load_log_event;
class Slave_log_event;
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,
@@ -594,11 +594,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;
/*
@@ -900,6 +918,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);
@@ -1152,7 +1173,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 bddaebdc0f2..48c355b6cd9 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 <my_dir.h>
#include <m_ctype.h>
@@ -185,7 +186,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))
{
@@ -197,6 +198,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)
{
@@ -366,7 +372,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_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 1bf95b8bded..5032e9c33f0 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -411,7 +411,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);
::send_ok(thd,info.copied+info.deleted+info.updated,(ulonglong)id,buff);
}
free_underlaid_joins(thd, &thd->lex->select_lex);
@@ -433,7 +433,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
@@ -1582,7 +1582,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);
::send_ok(thd,info.copied+info.deleted+info.updated,last_insert_id,buff);
DBUG_RETURN(0);
}
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 1038066f6ef..f98a6b43846 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -22,8 +22,6 @@
#include <m_ctype.h>
#include <hash.h>
-LEX_STRING tmp_table_alias= {(char*) "tmp-table",8};
-
/* Macros to look like lex */
#define yyGet() *(lex->ptr++)
@@ -1007,6 +1005,7 @@ void st_select_lex_unit::init_query()
fake_select_lex= 0;
cleaned= 0;
item_list.empty();
+ describe= 0;
}
void st_select_lex::init_query()
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 557c037c799..92ed53cf814 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -339,6 +339,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);
@@ -531,6 +532,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;
+
/* The state of the lex parsing. This is saved in the THD struct */
typedef struct st_lex
@@ -563,8 +578,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;
@@ -592,19 +605,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;
st_lex() {}
inline void uncacheable(uint8 cause)
{
@@ -641,6 +652,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 e949d40625d..7596e37de93 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1475,9 +1475,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
@@ -1493,7 +1493,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*/
}
@@ -1768,6 +1768,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
@@ -1807,6 +1808,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 +
@@ -1814,7 +1816,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);
@@ -2366,14 +2371,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;
}
@@ -2512,17 +2513,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);
@@ -2752,7 +2751,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)
@@ -4611,7 +4610,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)
@@ -4901,8 +4900,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));
@@ -4910,25 +4910,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 61e5b778b64..18437265e0e 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -76,8 +76,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
******************************************************************************/
@@ -91,7 +89,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);
@@ -239,7 +236,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)
@@ -247,45 +244,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)
@@ -297,7 +304,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)
@@ -309,9 +316,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)
{
@@ -321,20 +330,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;
@@ -345,6 +367,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];
@@ -359,12 +386,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;
@@ -372,7 +400,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];
@@ -381,61 +413,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;
+ }
}
}
@@ -464,23 +606,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);
@@ -504,7 +644,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();
@@ -515,6 +655,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);
}
@@ -536,6 +678,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;
@@ -547,7 +690,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;
@@ -558,6 +701,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;
@@ -567,20 +711,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);
}
@@ -605,25 +751,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);
@@ -668,7 +811,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);
@@ -724,7 +867,7 @@ error:
Validate UPDATE statement
SYNOPSIS
- mysql_test_delete()
+ mysql_test_update()
stmt prepared statemen handler
tables list of tables queries
@@ -1037,7 +1180,7 @@ end:
/*
- Validate and prepare for execution CRETE TABLE statement
+ Validate and prepare for execution CREATE TABLE statement
SYNOPSIS
mysql_test_create_table()
@@ -1074,7 +1217,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()
@@ -1097,7 +1240,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()
@@ -1269,8 +1412,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.
*/
@@ -1472,7 +1615,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);
@@ -1484,7 +1626,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));
@@ -1538,7 +1681,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.
*/
@@ -1548,7 +1691,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;
}
@@ -1579,7 +1722,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;
@@ -1609,7 +1753,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 */
@@ -1637,43 +1782,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
@@ -1687,13 +1839,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 4325edc3502..c3bbae1390c 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -3044,12 +3044,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
@@ -4909,6 +4909,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)
{
@@ -9132,7 +9135,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++)
@@ -9141,6 +9145,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;
@@ -9150,36 +9218,41 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
TABLE *table=tab->table;
char buff[512],*buff_ptr=buff;
char buff1[512], buff2[512];
- char derived_name[64];
+ char table_name_buffer[NAME_LEN];
String tmp1(buff1,sizeof(buff1),cs);
String tmp2(buff2,sizeof(buff2),cs);
tmp1.length(0);
tmp2.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));
if (tab->type == JT_ALL && tab->select && tab->select->quick)
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++)
@@ -9196,6 +9269,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;
@@ -9234,9 +9308,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))
@@ -9301,32 +9377,53 @@ 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;
-
+ 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
+ {
+ thd->lex->current_select= 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,
+ 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
@@ -9334,30 +9431,6 @@ int mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result)
}
-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();
- 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,
- (ORDER*) thd->lex->proc_list.first,
- select_lex->options | thd->options | SELECT_DESCRIBE,
- result, unit, select_lex);
- DBUG_RETURN(res);
-}
-
-
void st_select_lex::print(THD *thd, String *str)
{
if (!thd)
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 51b44af63ec..4fb85d9bab7 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))
@@ -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 8a093738e2b..fb2d1661357 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -450,22 +450,25 @@ bool String::append(const char *s,uint32 arg_length)
bool String::append(const char *s,uint32 arg_length, CHARSET_INFO *cs)
{
- if (!arg_length) // Default argument
- if (!(arg_length= (uint32) strlen(s)))
+ uint32 dummy_offset;
+ uint32 add_length;
+
+ if (!arg_length && !(arg_length= (uint32)strlen(s)))
return FALSE;
- if (cs != str_charset && str_charset->mbmaxlen > 1)
+
+ add_length= arg_length * str_charset->mbmaxlen;
+ if (realloc(str_length + add_length))
+ return TRUE;
+ if (needs_conversion(arg_length, cs, str_charset, &dummy_offset))
{
- uint32 add_length=arg_length * 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
+ {
+ memcpy(Ptr + str_length, s, arg_length);
+ str_length+= arg_length;
+ }
return FALSE;
}
@@ -858,3 +861,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 32333b3b381..c24511a9f74 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -299,4 +299,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 b54c223d35a..8682b98a69a 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1159,6 +1159,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
@@ -1395,11 +1397,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",
@@ -2086,6 +2088,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
@@ -2467,14 +2471,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;
@@ -2499,9 +2499,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);
@@ -2514,10 +2514,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))
@@ -2570,7 +2570,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)
@@ -2596,7 +2596,7 @@ 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:
@@ -2656,9 +2656,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;
@@ -2762,9 +2762,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)
@@ -2864,14 +2865,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;
}
@@ -2880,7 +2883,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;
@@ -3045,6 +3048,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_union.cc b/sql/sql_union.cc
index de3eeec0db0..70c05489f82 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
{
@@ -327,20 +349,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;
@@ -350,7 +376,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;
@@ -362,7 +388,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;
@@ -392,7 +418,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())
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index d7ef1fc8d7f..6b8fb78bd00 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -917,11 +917,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:
@@ -1153,7 +1149,6 @@ merge_insert_types:
opt_select_from:
opt_limit_clause {}
- | FROM DUAL_SYM {}
| select_from select_lock_type;
udf_func_type:
@@ -1460,25 +1455,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; }
@@ -1726,18 +1721,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
{}
@@ -1750,8 +1742,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;
@@ -1760,24 +1752,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
@@ -1787,8 +1779,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
{
@@ -1806,50 +1798,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
{
@@ -1870,19 +1863,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:
@@ -2296,17 +2289,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*/
@@ -3779,9 +3774,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;
@@ -4929,7 +4924,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..ccb8d07e786 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;
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index 1990060e67b..577f8a33275 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;
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-tis620.c b/strings/ctype-tis620.c
index e04a4dfdc96..aecb4f9753c 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;
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index ac805bf0a5a..72c28d92ca8 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -6750,8 +6750,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 +6796,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)
diff --git a/tests/client_test.c b/tests/client_test.c
index c244274a2e7..725d794c4a5 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";
@@ -9453,6 +9465,7 @@ select col1 FROM t1 where col1=2");
myquery(rc);
}
+
/*
This tests for various mysql_send_long_data bugs described in #1664
*/
@@ -9638,6 +9651,230 @@ group by b ");
}
+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
*/
@@ -9871,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 */
@@ -9920,8 +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/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