diff --git a/.bzrignore b/.bzrignore index bde19dfdd69..08ef076d278 100644 --- a/.bzrignore +++ b/.bzrignore @@ -2,6 +2,7 @@ *.bb *.bbg *.core +*.d *.da *.gcov *.la @@ -331,6 +332,7 @@ libmysqld/convert.cc libmysqld/derror.cc libmysqld/discover.cc libmysqld/errmsg.c +libmysqld/examples/client_test.c libmysqld/examples/completion_hash.cc libmysqld/examples/completion_hash.h libmysqld/examples/link_sources @@ -632,6 +634,8 @@ ndb/bin/test_cpcd ndb/bin/test_event ndb/bin/verify_index ndb/bin/waiter +ndb/config/autom4te.cache/* +ndb/config/config.mk ndb/examples/ndbapi_example1/ndbapi_example1 ndb/examples/ndbapi_example2/ndbapi_example2 ndb/examples/ndbapi_example3/ndbapi_example3 @@ -645,6 +649,8 @@ ndb/lib/libNEWTON_BASICTEST_COMMON.so ndb/lib/libREP_API.so ndb/lib/libndbclient.so ndb/lib/libndbclient_extra.so +ndb/src/common/mgmcommon/printConfig/*.d +ndb/src/mgmclient/test_cpcd/*.d pull.log regex/re repl-tests/test-repl-ts/repl-timestamp.master.reject diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max index d1c84b93484..ef035b3f023 100755 --- a/BUILD/compile-pentium-valgrind-max +++ b/BUILD/compile-pentium-valgrind-max @@ -3,7 +3,7 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$pentium_cflags $debug_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify" +extra_flags="$pentium_cflags $debug_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max" c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" extra_configs="$pentium_configs $debug_configs" diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index d1165ff984d..b2409deb9f4 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -33,6 +33,7 @@ dlenev@build.mysql.com dlenev@jabberwock.localdomain dlenev@mysql.com ejonore@mc03.ndb.mysql.com +georg@beethoven.local gerberb@ou800.zenez.com gluh@gluh.(none) gluh@gluh.mysql.r18.ru @@ -106,15 +107,18 @@ monty@tik. monty@tik.mysql.fi monty@tramp.mysql.fi monty@work.mysql.com +msvensson@build.mysql.com mwagner@cash.mwagner.org mwagner@evoq.mwagner.org mwagner@work.mysql.com mydev@mysql.com mysql@home.(none) mysqldev@build.mysql2.com +ndbdev@ndbmaster.mysql.com nick@mysql.com nick@nick.leippe.com papa@gbichot.local +patg@krsna.patg.net paul@central.snake.net paul@ice.local paul@ice.snake.net @@ -164,10 +168,13 @@ tim@work.mysql.com timour@mysql.com tom@basil-firewall.home.com tomas@mc05.(none) +tomas@poseidon.(none) tonu@hundin.mysql.fi tonu@volk.internalnet tonu@x153.internalnet tonu@x3.internalnet +tsmith@build.mysql.com +tulin@build.mysql.com ulli@morbus.(none) venu@hundin.mysql.fi venu@myvenu.com diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index 0ca2f97a369..03571593f77 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -11,7 +11,7 @@ $opt_distribution=$opt_user=$opt_config_env=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_tmp=$opt_version_suffix=""; $opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; -$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=0; +$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=$opt_without_ndbcluster=0; GetOptions( "bdb", @@ -56,6 +56,8 @@ GetOptions( "with-other-libc=s", "with-small-disk", "without-embedded", + "clearlogs", + "without-ndbcluster", ) || usage(); usage() if ($opt_help); @@ -140,7 +142,7 @@ $slave_port=$mysql_tcp_port+16; $manager_port=$mysql_tcp_port+1; $mysqladmin_args="--no-defaults -u root --connect_timeout=5 --shutdown_timeout=20"; -if ($opt_stage == 0) +if ($opt_stage == 0 || $opt_clearlogs) { system("mkdir Logs") if (! -d "Logs"); system("mv $log ${log}-old") if (-f $log); @@ -237,18 +239,19 @@ if ($opt_stage <= 1) $opt_config_options.= " --with-raid" if ($opt_raid); $opt_config_options.= " --with-readline" if ($opt_readline); $opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded); + $opt_config_options.= " --without-ndbcluster" if ($opt_without_ndbcluster); $opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster); # Only enable InnoDB when requested (required to be able to # build the "Classic" packages that do not include InnoDB) - if ($opt_innodb) - { - $opt_config_options.= " --with-innodb"; - } - else - { - $opt_config_options.= " --without-innodb"; - } + if ($opt_innodb) + { + $opt_config_options.= " --with-innodb"; + } + else + { + $opt_config_options.= " --without-innodb"; + } if ($opt_with_other_libc) { diff --git a/Build-tools/Do-pkg b/Build-tools/Do-pkg index 2fd1946ed0e..286e33f6dd4 100755 --- a/Build-tools/Do-pkg +++ b/Build-tools/Do-pkg @@ -95,6 +95,7 @@ $SI_DESC= <$SUPFILEDIR/StartupItem.Description.plist>; $SI_PARAMS= <$SUPFILEDIR/StartupParameters.plist>; $SI_POST= <$SUPFILEDIR/StartupItem.postinstall>; $SI_NAME= "MySQLStartupItem"; +$SI_DIR_NAME= "MySQLCOM"; $SI_SCRIPT= <$SUPFILEDIR/MySQL>; @RESOURCES= qw/ ReadMe.txt postinstall preinstall /; @LICENSES= ("$SRCBASEDIR/COPYING","$SRCBASEDIR/MySQLEULA.txt"); @@ -195,16 +196,18 @@ unless ($opt_skip_si) &logger("Cleaning up $RESOURCE_DIR"); &run_command("rm -rf $RESOURCE_DIR/*", "Unable to clean up $RESOURCE_DIR!"); - &logger("Installing MySQL StartupItem files into $PKGROOT/MySQL"); + my $SI_DIR= $PKGROOT . "/" . $SI_DIR_NAME; + &logger("Installing MySQL StartupItem files into $SI_DIR"); unless($opt_dry_run) { - mkdir("$PKGROOT/MySQL") or &abort("Error creating $PKGROOT/MySQL"); - copy("$SI_SCRIPT", "$PKGROOT/MySQL/") + mkdir("$SI_DIR") + or &abort("Error creating $SI_DIR"); + copy("$SI_SCRIPT", "$SI_DIR/") or &abort("Error copying $SI_SCRIPT!"); - chmod(0755, "$PKGROOT/MySQL/" . basename("$SI_SCRIPT")); - copy("$SI_PARAMS", "$PKGROOT/MySQL/") + chmod(0755, "$SI_DIR/" . basename("$SI_SCRIPT")); + copy("$SI_PARAMS", "$SI_DIR/") or &abort("Error copying $SI_PARAMS!"); - chmod(0644, "$PKGROOT/MySQL/" . basename("$SI_PARAMS")); + chmod(0644, "$SI_DIR/" . basename("$SI_PARAMS")); &run_command("chown -R root:wheel $PKGROOT/*", "Cannot chown $PKGROOT!"); copy("$SI_POST", "$RESOURCE_DIR/postinstall") or &abort("Error copying $SI_POST!"); diff --git a/Build-tools/mysql-copyright-2 b/Build-tools/mysql-copyright-2 index 447a2d7c164..e946ed217d1 100755 --- a/Build-tools/mysql-copyright-2 +++ b/Build-tools/mysql-copyright-2 @@ -93,7 +93,7 @@ sub add_copyright { $start_copyright="/* "; $line_copyright= " "; - $end_copyright= " */"; + $end_copyright= "*/"; } elsif ($ARGV =~ /-x86\.s$/) { diff --git a/VC++Files/README.build-files b/VC++Files/README.build-files new file mode 100644 index 00000000000..27624c3dc6f --- /dev/null +++ b/VC++Files/README.build-files @@ -0,0 +1,19 @@ +Some notes about building MySQL with VC++ + +- After bulding all projects, you get the files in the following directories: + +Directory Content + +lib_debug Debug libraries +lib_release Release libraries +lib_classic Embedded server libraries for classic +lib_pro Embedded server libraries for pro +client_debug Debug executables +client_release Client release +client_classic Commerical binaries (classic) +client_pro Commerical binaries (unique for pro version) +include Include files + +The copy_mysql_files.bat script can be used to copy the generated +files to c:\mysql + diff --git a/VC++Files/bdb/bdb.dsp b/VC++Files/bdb/bdb.dsp index 6c4ee47daa2..bd0e644bc2e 100644 --- a/VC++Files/bdb/bdb.dsp +++ b/VC++Files/bdb/bdb.dsp @@ -55,8 +55,8 @@ LIB32=xilink6.exe -lib # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "bdb___Win32_Max" -# PROP BASE Intermediate_Dir "bdb___Win32_Max" +# PROP BASE Output_Dir "max" +# PROP BASE Intermediate_Dir "max" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 @@ -65,7 +65,7 @@ LIB32=xilink6.exe -lib # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../bdb/build_win32" /I "../bdb/include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c # SUBTRACT BASE CPP /Fr -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../bdb" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /Fo"mysys___Win32_Max/" /Fd"mysys___Win32_Max/" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../bdb" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D MYSQL_SERVER_SUFFIX=-max /Fo"max/" /Fd"max/" /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/VC++Files/client/mysql.dsp b/VC++Files/client/mysql.dsp index 4f2cbbb5614..ec16e780d3e 100644 --- a/VC++Files/client/mysql.dsp +++ b/VC++Files/client/mysql.dsp @@ -19,6 +19,7 @@ CFG=mysql - Win32 Debug !MESSAGE !MESSAGE "mysql - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysql - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysql - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -79,12 +80,42 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysql.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +!ELSEIF "$(CFG)" == "mysql - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysql___Win32_classic" +# PROP BASE Intermediate_Dir "mysql___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /WX /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /WX /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../client_release/mysql.exe" /libpath:"..\lib_release\\" +# SUBTRACT BASE LINK32 /incremental:yes +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../client_classic/mysql.exe" /libpath:"..\lib_release\\" +# SUBTRACT LINK32 /incremental:yes + !ENDIF # Begin Target # Name "mysql - Win32 Release" # Name "mysql - Win32 Debug" +# Name "mysql - Win32 classic" # Begin Source File SOURCE=.\completion_hash.cpp @@ -99,6 +130,11 @@ SOURCE=.\mysql.cpp !ELSEIF "$(CFG)" == "mysql - Win32 Debug" +!ELSEIF "$(CFG)" == "mysql - Win32 classic" + +# ADD BASE CPP /Zi /O2 +# ADD CPP /Zi /O2 + !ENDIF # End Source File diff --git a/VC++Files/client/mysqladmin.dsp b/VC++Files/client/mysqladmin.dsp index 2c762cd8a24..a7e4404e253 100644 --- a/VC++Files/client/mysqladmin.dsp +++ b/VC++Files/client/mysqladmin.dsp @@ -19,6 +19,7 @@ CFG=mysqladmin - Win32 Debug !MESSAGE !MESSAGE "mysqladmin - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqladmin - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqladmin - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -78,12 +79,40 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqladmin.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +!ELSEIF "$(CFG)" == "mysqladmin - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqladmin___Win32_classic" +# PROP BASE Intermediate_Dir "mysqladmin___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqladmin.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqladmin.exe" /libpath:"..\lib_release\\" + !ENDIF # Begin Target # Name "mysqladmin - Win32 Release" # Name "mysqladmin - Win32 Debug" +# Name "mysqladmin - Win32 classic" # Begin Source File SOURCE=.\mysqladmin.c diff --git a/VC++Files/client/mysqlclient.dsp b/VC++Files/client/mysqlclient.dsp index 09a06982842..a46c3fd2369 100644 --- a/VC++Files/client/mysqlclient.dsp +++ b/VC++Files/client/mysqlclient.dsp @@ -7,25 +7,25 @@ CFG=mysqlclient - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysqlclient.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysqlclient.mak" CFG="mysqlclient - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "mysqlclient - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "mysqlclient - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysqlclient - Win32 Release" @@ -41,14 +41,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\mysqlclient.lib" @@ -72,11 +72,11 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\mysqlclient.lib" -!ENDIF +!ENDIF # Begin Target @@ -256,7 +256,7 @@ SOURCE=..\mysys\mf_iocache2.c # ADD CPP /Od -!ENDIF +!ENDIF # End Source File # Begin Source File diff --git a/VC++Files/client/mysqldump.dsp b/VC++Files/client/mysqldump.dsp index d36664e09ce..a1ebdfe11a6 100644 --- a/VC++Files/client/mysqldump.dsp +++ b/VC++Files/client/mysqldump.dsp @@ -19,6 +19,7 @@ CFG=mysqldump - Win32 Debug !MESSAGE !MESSAGE "mysqldump - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqldump - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqldump - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -78,12 +79,40 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +!ELSEIF "$(CFG)" == "mysqldump - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqldump___Win32_classic" +# PROP BASE Intermediate_Dir "mysqldump___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\" + !ENDIF # Begin Target # Name "mysqldump - Win32 Release" # Name "mysqldump - Win32 Debug" +# Name "mysqldump - Win32 classic" # Begin Source File SOURCE=.\mysqldump.c @@ -95,6 +124,8 @@ SOURCE=.\mysqldump.c # ADD CPP /W3 # SUBTRACT CPP /YX +!ELSEIF "$(CFG)" == "mysqldump - Win32 classic" + !ENDIF # End Source File diff --git a/VC++Files/client/mysqlimport.dsp b/VC++Files/client/mysqlimport.dsp index a8b239d226f..d5fd8557397 100644 --- a/VC++Files/client/mysqlimport.dsp +++ b/VC++Files/client/mysqlimport.dsp @@ -19,6 +19,7 @@ CFG=mysqlimport - Win32 Debug !MESSAGE !MESSAGE "mysqlimport - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqlimport - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqlimport - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -79,12 +80,42 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlimport.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +!ELSEIF "$(CFG)" == "mysqlimport - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqlimport___Win32_classic" +# PROP BASE Intermediate_Dir "mysqlimport___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlimport.exe" /libpath:"..\lib_release\\" +# SUBTRACT BASE LINK32 /incremental:yes +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlimport.exe" /libpath:"..\lib_release\\" +# SUBTRACT LINK32 /incremental:yes + !ENDIF # Begin Target # Name "mysqlimport - Win32 Release" # Name "mysqlimport - Win32 Debug" +# Name "mysqlimport - Win32 classic" # Begin Source File SOURCE=.\mysqlimport.c diff --git a/VC++Files/client/mysqlshow.dsp b/VC++Files/client/mysqlshow.dsp index 26705465fec..b9fd0d27e46 100644 --- a/VC++Files/client/mysqlshow.dsp +++ b/VC++Files/client/mysqlshow.dsp @@ -19,6 +19,7 @@ CFG=mysqlshow - Win32 Debug !MESSAGE !MESSAGE "mysqlshow - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqlshow - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqlshow - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -78,12 +79,40 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlshow.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +!ELSEIF "$(CFG)" == "mysqlshow - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqlshow___Win32_classic" +# PROP BASE Intermediate_Dir "mysqlshow___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlshow.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlshow.exe" /libpath:"..\lib_release\\" + !ENDIF # Begin Target # Name "mysqlshow - Win32 Release" # Name "mysqlshow - Win32 Debug" +# Name "mysqlshow - Win32 classic" # Begin Source File SOURCE=.\mysqlshow.c diff --git a/VC++Files/comp_err/comp_err.dsp b/VC++Files/comp_err/comp_err.dsp index e28855aed41..5324e1aa7a0 100644 --- a/VC++Files/comp_err/comp_err.dsp +++ b/VC++Files/comp_err/comp_err.dsp @@ -7,24 +7,24 @@ CFG=comp_err - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "comp_err.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "comp_err.mak" CFG="comp_err - Win32 Release" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "comp_err - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -45,9 +45,9 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib_release\mysys.lib wsock32.lib ..\lib_release\strings.lib ..\lib_release\dbug.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBC.lib" /out:"../client_release/comp-err.exe" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib_release\mysys.lib wsock32.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBC.lib" /out:"../client_release/comp-err.exe" # Begin Target # Name "comp_err - Win32 Release" diff --git a/VC++Files/copy_mysql_files.bat b/VC++Files/copy_mysql_files.bat new file mode 100644 index 00000000000..2857fabc312 --- /dev/null +++ b/VC++Files/copy_mysql_files.bat @@ -0,0 +1,80 @@ +REM stop any conflicting service + +net stop mysql + +REM Copy binaries to c:\mysql +REM (We assume we are in build root when executing this script) + +copy lib_debug\libmysql.* c:\mysql\lib\debug +copy lib_debug\zlib.* c:\mysql\lib\debug +copy lib_debug\mysqlclient.lib c:\mysql\lib\debug + +copy lib_release\mysqlclient.lib c:\mysql\lib\opt +copy lib_release\libmysql.* c:\mysql\lib\opt +copy lib_release\zlib.* c:\mysql\lib\opt + +IF "%1"=="classic" goto CLASSIC +IF "%1"=="pro" goto PRO + +REM GPL binaries + +copy client_release\*.exe c:\mysql\bin +copy client_debug\mysqld.exe c:\mysql\bin + +goto REST + +:CLASSIC +REM Classic binaries + +copy client_release\*.exe c:\mysql\bin +copy client_classic\*.exe c:\mysql\bin +copy client_debug\mysqld.exe c:\mysql\bin\mysqld-debug.exe +copy lib_classic\*.* c:\mysql\lib\opt + +goto REST + +:PRO +REM Pro binaries + +copy client_release\*.exe c:\mysql\bin +copy client_classic\*.exe c:\mysql\bin +copy client_pro\*.exe c:\mysql\bin +copy client_debug\mysqld.exe c:\mysql\bin\mysqld-debug.exe +copy lib_pro\*.* c:\mysql\lib\opt + +:REST + +REM +REM Copy include files +REM + +copy include\mysql*.h c:\mysql\include +copy include\errmsg.h c:\mysql\include +copy include\my_sys.h c:\mysql\include +copy include\my_list.h c:\mysql\include +copy include\my_pthread.h c:\mysql\include +copy include\my_dbug.h c:\mysql\include +copy include\m_string.h c:\mysql\include +copy include\m_ctype.h c:\mysql\include +copy include\raid.h c:\mysql\include +copy include\conf*.h c:\mysql\include +copy include\my_global.h c:\mysql\include\my_global.h +copy libmysql\libmysql.def c:\mysql\include + +REM Copy test files + +copy libmysqltest\*.* c:\mysql\examples\libmysqltest +copy libmysqltest\release\myTest.exe c:\mysql\examples\libmysqltest + +REM Copy share, docs etc + +xcopy share\*.* c:\mysql\share /E /Y +xcopy scripts\*.* c:\mysql\scripts /E /Y +xcopy docs\*.* c:\mysql\docs /E /Y +xcopy sql-bench\*.* c:\mysql\bench /E /Y +copy docs\readme c:\mysql\ + +REM Copy privilege tables (Delete old ones as they may be from a newer version) + +del c:\mysql\data\mysql\*.* /Q +xcopy data\mysql\*.* c:\mysql\data\mysql /E /Y diff --git a/VC++Files/dbug/dbug.dsp b/VC++Files/dbug/dbug.dsp index 5db7b05175b..f2962848939 100644 --- a/VC++Files/dbug/dbug.dsp +++ b/VC++Files/dbug/dbug.dsp @@ -19,13 +19,14 @@ CFG=dbug - Win32 Debug !MESSAGE !MESSAGE "dbug - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "dbug - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "dbug - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "dbug - Win32 Release" @@ -41,14 +42,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\dbug.lib" @@ -72,16 +73,42 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\dbug.lib" +!ELSEIF "$(CFG)" == "dbug - Win32 TLS_DEBUG" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "dbug___Win32_TLS_DEBUG" +# PROP BASE Intermediate_Dir "dbug___Win32_TLS_DEBUG" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "dbug___Win32_TLS_DEBUG" +# PROP Intermediate_Dir "dbug___Win32_TLS_DEBUG" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_debug\dbug_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_debug\dbug_tls.lib" + !ENDIF # Begin Target # Name "dbug - Win32 Release" # Name "dbug - Win32 Debug" +# Name "dbug - Win32 TLS_DEBUG" # Begin Source File SOURCE=.\dbug.c diff --git a/VC++Files/heap/heap.dsp b/VC++Files/heap/heap.dsp index 1edeec80e9b..8b72560a8b6 100644 --- a/VC++Files/heap/heap.dsp +++ b/VC++Files/heap/heap.dsp @@ -19,13 +19,15 @@ CFG=heap - Win32 Debug !MESSAGE !MESSAGE "heap - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "heap - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "heap - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library") +!MESSAGE "heap - Win32 TLS" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "heap - Win32 Release" @@ -41,14 +43,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\heap.lib" @@ -72,16 +74,68 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\heap.lib" +!ELSEIF "$(CFG)" == "heap - Win32 TLS_DEBUG" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "heap___Win32_TLS_DEBUG" +# PROP BASE Intermediate_Dir "heap___Win32_TLS_DEBUG" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "heap___Win32_TLS_DEBUG" +# PROP Intermediate_Dir "heap___Win32_TLS_DEBUG" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_debug\heap_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_debug\heap_tls.lib" + +!ELSEIF "$(CFG)" == "heap - Win32 TLS" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "heap___Win32_TLS" +# PROP BASE Intermediate_Dir "heap___Win32_TLS" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "heap___Win32_TLS" +# PROP Intermediate_Dir "heap___Win32_TLS" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_release\heap_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_release\heap_tls.lib" + !ENDIF # Begin Target # Name "heap - Win32 Release" # Name "heap - Win32 Debug" +# Name "heap - Win32 TLS_DEBUG" +# Name "heap - Win32 TLS" # Begin Source File SOURCE=.\_check.c @@ -128,6 +182,13 @@ SOURCE=.\hp_hash.c # SUBTRACT CPP /YX +!ELSEIF "$(CFG)" == "heap - Win32 TLS_DEBUG" + +# SUBTRACT BASE CPP /YX +# SUBTRACT CPP /YX + +!ELSEIF "$(CFG)" == "heap - Win32 TLS" + !ENDIF # End Source File diff --git a/VC++Files/innobase/innobase.dsp b/VC++Files/innobase/innobase.dsp index 713e3153d17..0768b3095ea 100644 --- a/VC++Files/innobase/innobase.dsp +++ b/VC++Files/innobase/innobase.dsp @@ -67,7 +67,7 @@ LIB32=xilink6.exe -lib # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c # SUBTRACT CPP /WX /Fr /YX # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" @@ -91,7 +91,7 @@ LIB32=xilink6.exe -lib # PROP Intermediate_Dir "nt" # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "_LIB" /D "_WIN32" /D "WIN32" /D "NDEBUG" /D "MYSQL_SERVER" /D "_MBCS" /D MYSQL_SERVER_SUFFIX=-nt /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" @@ -115,7 +115,7 @@ LIB32=xilink6.exe -lib # PROP Intermediate_Dir "max_nt" # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "_LIB" /D "_WIN32" /D "WIN32" /D "NDEBUG" /D "MYSQL_SERVER" /D "_MBCS" /D MYSQL_SERVER_SUFFIX=-nt-max /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" @@ -280,10 +280,6 @@ SOURCE=.\os\os0proc.c # End Source File # Begin Source File -SOURCE=.\os\os0shm.c -# End Source File -# Begin Source File - SOURCE=.\os\os0sync.c # End Source File # Begin Source File @@ -388,10 +384,6 @@ SOURCE=.\sync\sync0arr.c # End Source File # Begin Source File -SOURCE=.\sync\sync0ipm.c -# End Source File -# Begin Source File - SOURCE=.\sync\sync0rw.c # End Source File # Begin Source File diff --git a/VC++Files/isam/isam.dsp b/VC++Files/isam/isam.dsp index 12047145f6d..759a1b6ee03 100644 --- a/VC++Files/isam/isam.dsp +++ b/VC++Files/isam/isam.dsp @@ -19,13 +19,15 @@ CFG=isam - Win32 Debug !MESSAGE !MESSAGE "isam - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "isam - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "isam - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library") +!MESSAGE "isam - Win32 TLS" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "isam - Win32 Release" @@ -41,14 +43,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\isam.lib" @@ -72,16 +74,68 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_Debug\isam.lib" +!ELSEIF "$(CFG)" == "isam - Win32 TLS_DEBUG" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "isam___Win32_TLS_DEBUG" +# PROP BASE Intermediate_Dir "isam___Win32_TLS_DEBUG" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "isam___Win32_TLS_DEBUG" +# PROP Intermediate_Dir "isam___Win32_TLS_DEBUG" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_Debug\isam_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_Debug\isam_tls.lib" + +!ELSEIF "$(CFG)" == "isam - Win32 TLS" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "isam___Win32_TLS" +# PROP BASE Intermediate_Dir "isam___Win32_TLS" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "isam___Win32_TLS" +# PROP Intermediate_Dir "isam___Win32_TLS" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_release\isam_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_release\isam_tls.lib" + !ENDIF # Begin Target # Name "isam - Win32 Release" # Name "isam - Win32 Debug" +# Name "isam - Win32 TLS_DEBUG" +# Name "isam - Win32 TLS" # Begin Source File SOURCE=.\_cache.c diff --git a/VC++Files/isamchk/isamchk.dsp b/VC++Files/isamchk/isamchk.dsp index 0e8e2b04bd7..2026be94ea0 100644 --- a/VC++Files/isamchk/isamchk.dsp +++ b/VC++Files/isamchk/isamchk.dsp @@ -19,6 +19,7 @@ CFG=isamchk - Win32 Debug !MESSAGE !MESSAGE "isamchk - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "isamchk - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "isamchk - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x41d /d "NDEBUG" # ADD RSC /l 0x41d /d "NDEBUG" @@ -80,12 +81,42 @@ LINK32=xilink6.exe # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/isamchk.exe" /pdbtype:sept # SUBTRACT LINK32 /verbose /pdb:none +!ELSEIF "$(CFG)" == "isamchk - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "isamchk___Win32_classic" +# PROP BASE Intermediate_Dir "isamchk___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "_CONSOLE" /D "_WINDOWS" /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /D LICENSE=Commercial /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x41d /d "NDEBUG" +# ADD RSC /l 0x41d /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/isamchk.exe" +# SUBTRACT BASE LINK32 /pdb:none +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/isamchk.exe" /libpath:"..\lib_release\\" +# SUBTRACT LINK32 /pdb:none + !ENDIF # Begin Target # Name "isamchk - Win32 Release" # Name "isamchk - Win32 Debug" +# Name "isamchk - Win32 classic" # Begin Source File SOURCE=..\isam\isamchk.c diff --git a/VC++Files/libmysql/libmysql.dsp b/VC++Files/libmysql/libmysql.dsp index 6a91414a45c..c315775443b 100644 --- a/VC++Files/libmysql/libmysql.dsp +++ b/VC++Files/libmysql/libmysql.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "." /I "..\include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "." /I "..\include" /I "../zlib" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /D "NDEBUG" /D "MYSQL_CLIENT" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 @@ -76,7 +76,7 @@ PostBuild_Cmds=xcopy release\libmysql.lib ..\lib_release /y # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "." /I "..\include" /I "../zlib" /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "." /I "..\include" /I "../zlib" /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 @@ -92,7 +92,7 @@ LINK32=xilink6.exe # Begin Special Build Tool SOURCE="$(InputPath)" PostBuild_Desc=Move DLL export lib -PostBuild_Cmds=xcopy ..\lib_debug\libmysql.dll C:\winnt\system32\ /y xcopy debug\libmysql.lib ..\lib_debug\ /y +PostBuild_Cmds=xcopy ..\lib_debug\libmysql.dll %windir%\system32\ /y xcopy debug\libmysql.lib ..\lib_debug\ /y # End Special Build Tool !ENDIF diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp index 9df0eb0f92b..f087c8a7b06 100644 --- a/VC++Files/libmysqld/libmysqld.dsp +++ b/VC++Files/libmysqld/libmysqld.dsp @@ -19,6 +19,8 @@ CFG=libmysqld - Win32 Debug !MESSAGE !MESSAGE "libmysqld - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libmysqld - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libmysqld - Win32 classic" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libmysqld - Win32 pro" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project @@ -43,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /I "../libmysqld" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../libmysqld" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c # SUBTRACT CPP /WX /Fr # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 @@ -54,7 +56,8 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /dll /pdb:none /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" +# SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "libmysqld - Win32 Debug" @@ -70,8 +73,8 @@ LINK32=xilink6.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /I "libmysqld" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c -# SUBTRACT CPP /Fr +# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../libmysqld" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c +# SUBTRACT CPP /X /Fr # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x416 /d "_DEBUG" @@ -81,17 +84,91 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\innodb.lib /nologo /dll /pdb:none /debug /machine:I386 /nodefaultlib:"LIBCMTD" /out:"../lib_debug/libmysqld.dll" /implib:"../lib_debug/libmysqld.lib" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug_tls.lib ..\lib_debug\mysys_tls.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap_tls.lib ..\lib_debug\innodb.lib /nologo /dll /incremental:no /debug /machine:I386 /nodefaultlib:"LIBCMTD" /out:"../lib_debug/libmysqld.dll" /implib:"../lib_debug/libmysqld.lib" /pdbtype:sept +# SUBTRACT LINK32 /pdb:none +!ELSEIF "$(CFG)" == "libmysqld - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "libmysqld___Win32_classic" +# PROP BASE Intermediate_Dir "libmysqld___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../zlib" /D "WIN32" /D "_WINDOWS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "USE_TLS" /D "__WIN__" /D LICENSE=Commerical /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /Fr +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x416 /d "NDEBUG" +# ADD RSC /l 0x416 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" +# SUBTRACT BASE LINK32 /pdb:none +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_classic/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "libmysqld - Win32 pro" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "libmysqld___Win32_pro" +# PROP BASE Intermediate_Dir "libmysqld___Win32_pro" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "pro" +# PROP Intermediate_Dir "pro" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../zlib" /D "WIN32" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "EMBEDDED_LIBRARY" /D "USE_TLS" /D "__WIN__" /D "MYSQL_SERVER" /D LICENSE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /FD /D MYSQL_SERVER_SUFFIX=-pro /c +# SUBTRACT CPP /X /Fr +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x416 /d "NDEBUG" +# ADD RSC /l 0x416 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_classic/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" +# SUBTRACT BASE LINK32 /pdb:none +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_pro/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" +# SUBTRACT LINK32 /pdb:none + !ENDIF # Begin Target # Name "libmysqld - Win32 Release" # Name "libmysqld - Win32 Debug" +# Name "libmysqld - Win32 classic" +# Name "libmysqld - Win32 pro" # Begin Source File -SOURCE=..\libmysql\client.c +SOURCE="..\sql-common\client.c" + +!IF "$(CFG)" == "libmysqld - Win32 Release" + +!ELSEIF "$(CFG)" == "libmysqld - Win32 Debug" + +!ELSEIF "$(CFG)" == "libmysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "libmysqld - Win32 pro" + +!ENDIF + # End Source File # Begin Source File @@ -107,6 +184,14 @@ SOURCE=..\sql\derror.cpp # End Source File # Begin Source File +SOURCE=..\sql\discover.cpp +# End Source File +# Begin Source File + +SOURCE=.\emb_qcache.cpp +# End Source File +# Begin Source File + SOURCE=..\libmysql\errmsg.c # End Source File # Begin Source File @@ -279,7 +364,7 @@ SOURCE=..\sql\opt_sum.cpp # End Source File # Begin Source File -SOURCE=..\libmysql\pack.c +SOURCE="..\sql-common\pack.c" # End Source File # Begin Source File @@ -509,5 +594,21 @@ SOURCE=..\sql\uniques.cpp SOURCE=..\sql\unireg.cpp # End Source File +# Begin Source File + +SOURCE=..\vio\vio.c +# End Source File +# Begin Source File + +SOURCE=..\vio\viosocket.c +# End Source File +# Begin Source File + +SOURCE=..\vio\viossl.c +# End Source File +# Begin Source File + +SOURCE=..\vio\viosslfactories.c +# End Source File # End Target # End Project diff --git a/VC++Files/libmysqltest/myTest.dsp b/VC++Files/libmysqltest/myTest.dsp index 1d3a790edd5..ca0f9e6e147 100644 --- a/VC++Files/libmysqltest/myTest.dsp +++ b/VC++Files/libmysqltest/myTest.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /W3 /O2 /I "..\include" /D "NDEBUG" /D "DBUG_UFF" /D "_CONSOLE" /D "_MBCS" /FD /c +# ADD CPP /nologo /G6 /W3 /O2 /I "..\include" /D "DBUG_UFF" /D "_CONSOLE" /D "_MBCS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" diff --git a/VC++Files/merge/merge.dsp b/VC++Files/merge/merge.dsp index 8a8173fd606..e057bd37924 100644 --- a/VC++Files/merge/merge.dsp +++ b/VC++Files/merge/merge.dsp @@ -25,7 +25,7 @@ CFG=merge - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "merge - Win32 Release" @@ -41,14 +41,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\merge.lib" @@ -72,7 +72,7 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\merge.lib" diff --git a/VC++Files/my_print_defaults/my_print_defaults.dsp b/VC++Files/my_print_defaults/my_print_defaults.dsp index 80178116930..48a75ef7267 100644 --- a/VC++Files/my_print_defaults/my_print_defaults.dsp +++ b/VC++Files/my_print_defaults/my_print_defaults.dsp @@ -7,25 +7,26 @@ CFG=my_print_defaults - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "my_print_defaults.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "my_print_defaults.mak" CFG="my_print_defaults - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "my_print_defaults - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "my_print_defaults - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE "my_print_defaults - Win32 classic" (based on "Win32 (x86) Console Application") +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "my_print_defaults - Win32 Release" @@ -42,13 +43,13 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "NDEBUG" /YX /FD /c # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/my_print_defaults.exe" @@ -72,16 +73,42 @@ LINK32=link.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCMTD.lib" /out:"../client_debug/my_print_defaults.exe" /pdbtype:sept -!ENDIF +!ELSEIF "$(CFG)" == "my_print_defaults - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "my_print_defaults___Win32_classic" +# PROP BASE Intermediate_Dir "my_print_defaults___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "NDEBUG" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "_CONSOLE" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /YX /FD /c +# ADD BASE RSC /l 0x416 /d "NDEBUG" +# ADD RSC /l 0x416 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/my_print_defaults.exe" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/my_print_defaults.exe" /libpath:"..\lib_release\\" + +!ENDIF # Begin Target # Name "my_print_defaults - Win32 Release" # Name "my_print_defaults - Win32 Debug" +# Name "my_print_defaults - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/myisam/myisam.dsp b/VC++Files/myisam/myisam.dsp index 0b386997e5e..77a5315c549 100644 --- a/VC++Files/myisam/myisam.dsp +++ b/VC++Files/myisam/myisam.dsp @@ -19,6 +19,8 @@ CFG=myisam - Win32 Debug !MESSAGE !MESSAGE "myisam - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "myisam - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "myisam - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library") +!MESSAGE "myisam - Win32 TLS" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project @@ -41,7 +43,7 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -74,12 +76,60 @@ LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_Debug\myisam.lib" +!ELSEIF "$(CFG)" == "myisam - Win32 TLS_DEBUG" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "myisam___Win32_TLS_DEBUG" +# PROP BASE Intermediate_Dir "myisam___Win32_TLS_DEBUG" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "myisam___Win32_TLS_DEBUG" +# PROP Intermediate_Dir "myisam___Win32_TLS_DEBUG" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /Fo".\Debug/" /Fd".\Debug/" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /Fo".\Debug/" /Fd".\Debug/" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_Debug\myisam_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_Debug\myisam_tls.lib" + +!ELSEIF "$(CFG)" == "myisam - Win32 TLS" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "myisam___Win32_TLS" +# PROP BASE Intermediate_Dir "myisam___Win32_TLS" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "myisam___Win32_TLS" +# PROP Intermediate_Dir "myisam___Win32_TLS" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_release\myisam_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_release\myisam_tls.lib" + !ENDIF # Begin Target # Name "myisam - Win32 Release" # Name "myisam - Win32 Debug" +# Name "myisam - Win32 TLS_DEBUG" +# Name "myisam - Win32 TLS" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/myisam_ftdump/myisam_ftdump.dsp b/VC++Files/myisam_ftdump/myisam_ftdump.dsp index 12a629091e0..6ff78178600 100755 --- a/VC++Files/myisam_ftdump/myisam_ftdump.dsp +++ b/VC++Files/myisam_ftdump/myisam_ftdump.dsp @@ -7,25 +7,25 @@ CFG=myisam_ftdump - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "myisam_ftdump.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "myisam_ftdump.mak" CFG="myisam_ftdump - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "myisam_ftdump - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "myisam_ftdump - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "myisam_ftdump - Win32 Release" @@ -42,13 +42,13 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj ..\lib_release\zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/myisam_ftdump.exe" @@ -73,11 +73,11 @@ LINK32=link.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_debug\zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisam_ftdump.exe" /pdbtype:sept -!ENDIF +!ENDIF # Begin Target diff --git a/VC++Files/myisamchk/myisamchk.dsp b/VC++Files/myisamchk/myisamchk.dsp index 000e1c11215..4c337e50e71 100644 --- a/VC++Files/myisamchk/myisamchk.dsp +++ b/VC++Files/myisamchk/myisamchk.dsp @@ -19,6 +19,7 @@ CFG=myisamchk - Win32 Debug !MESSAGE !MESSAGE "myisamchk - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "myisamchk - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "myisamchk - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -78,12 +79,40 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisamchk.exe" /pdbtype:sept +!ELSEIF "$(CFG)" == "myisamchk - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "myisamchk___Win32_classic" +# PROP BASE Intermediate_Dir "myisamchk___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FR /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisamchk.exe" +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj ..\lib_release\myisam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/myisamchk.exe" /libpath:"..\lib_release\\" + !ENDIF # Begin Target # Name "myisamchk - Win32 Release" # Name "myisamchk - Win32 Debug" +# Name "myisamchk - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/myisamlog/myisamlog.dsp b/VC++Files/myisamlog/myisamlog.dsp index f251712127b..7c50a8aec9b 100644 --- a/VC++Files/myisamlog/myisamlog.dsp +++ b/VC++Files/myisamlog/myisamlog.dsp @@ -19,6 +19,7 @@ CFG=myisamlog - Win32 Debug !MESSAGE !MESSAGE "myisamlog - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "myisamlog - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "myisamlog - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -80,12 +81,40 @@ LINK32=xilink6.exe # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /pdb:"debug/myisamchk.pdb" /debug /machine:I386 /out:"../client_debug/myisamlog.exe" /pdbtype:sept # SUBTRACT LINK32 /pdb:none +!ELSEIF "$(CFG)" == "myisamlog - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "myisamlog___Win32_classic" +# PROP BASE Intermediate_Dir "myisamlog___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FR /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /pdb:"release/myisamchk.pdb" /machine:I386 /out:"../client_release/myisamlog.exe" +# SUBTRACT BASE LINK32 /pdb:none +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj ..\lib_release\myisam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:"release/myisamchk.pdb" /machine:I386 /out:"../client_classic/myisamlog.exe" /libpath:"..\lib_release\\" +# SUBTRACT LINK32 /pdb:none + !ENDIF # Begin Target # Name "myisamlog - Win32 Release" # Name "myisamlog - Win32 Debug" +# Name "myisamlog - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/myisammrg/myisammrg.dsp b/VC++Files/myisammrg/myisammrg.dsp index b7b613b1542..419d36517c9 100644 --- a/VC++Files/myisammrg/myisammrg.dsp +++ b/VC++Files/myisammrg/myisammrg.dsp @@ -19,13 +19,15 @@ CFG=myisammrg - Win32 Debug !MESSAGE !MESSAGE "myisammrg - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "myisammrg - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "myisammrg - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library") +!MESSAGE "myisammrg - Win32 TLS" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "myisammrg - Win32 Release" @@ -41,13 +43,13 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\myisammrg.lib" @@ -71,16 +73,66 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_Debug\myisammrg.lib" +!ELSEIF "$(CFG)" == "myisammrg - Win32 TLS_DEBUG" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "myisammrg___Win32_TLS_DEBUG" +# PROP BASE Intermediate_Dir "myisammrg___Win32_TLS_DEBUG" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "myisammrg___Win32_TLS_DEBUG" +# PROP Intermediate_Dir "myisammrg___Win32_TLS_DEBUG" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /Fo".\Debug/" /Fd".\Debug/" /FD /c +# SUBTRACT BASE CPP /Fr +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /Fo".\Debug/" /Fd".\Debug/" /FD /c +# SUBTRACT CPP /Fr +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_Debug\myisammrg_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_Debug\myisammrg_tls.lib" + +!ELSEIF "$(CFG)" == "myisammrg - Win32 TLS" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "myisammrg___Win32_TLS" +# PROP BASE Intermediate_Dir "myisammrg___Win32_TLS" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "myisammrg___Win32_TLS" +# PROP Intermediate_Dir "myisammrg___Win32_TLS" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_release\myisammrg_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_release\myisammrg_tls.lib" + !ENDIF # Begin Target # Name "myisammrg - Win32 Release" # Name "myisammrg - Win32 Debug" +# Name "myisammrg - Win32 TLS_DEBUG" +# Name "myisammrg - Win32 TLS" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/myisampack/myisampack.dsp b/VC++Files/myisampack/myisampack.dsp index 3331b6e17f8..7a5870b6862 100644 --- a/VC++Files/myisampack/myisampack.dsp +++ b/VC++Files/myisampack/myisampack.dsp @@ -7,19 +7,20 @@ CFG=myisampack - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "myisampack.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "myisampack.mak" CFG="myisampack - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "myisampack - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "myisampack - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE "myisampack - Win32 classic" (based on "Win32 (x86) Console Application") +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -78,12 +79,38 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisampack.exe" /pdbtype:sept -!ENDIF +!ELSEIF "$(CFG)" == "myisampack - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "myisampack___Win32_classic" +# PROP BASE Intermediate_Dir "myisampack___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FR /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisampack.exe" +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj ..\lib_release\myisam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/myisampack.exe" /libpath:"..\lib_release\\" + +!ENDIF # Begin Target # Name "myisampack - Win32 Release" # Name "myisampack - Win32 Debug" +# Name "myisampack - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index e0df167f58d..61a466174b6 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -41,6 +41,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name mysys End Project Dependency + Begin Project Dependency + Project_Dep_Name strings + End Project Dependency }}} ############################################################################### @@ -824,4 +827,3 @@ Package=<3> }}} ############################################################################### - diff --git a/VC++Files/mysqlbinlog/mysqlbinlog.dsp b/VC++Files/mysqlbinlog/mysqlbinlog.dsp index 914bbcf70a3..8b8895d6f17 100644 --- a/VC++Files/mysqlbinlog/mysqlbinlog.dsp +++ b/VC++Files/mysqlbinlog/mysqlbinlog.dsp @@ -19,6 +19,7 @@ CFG=mysqlbinlog - Win32 Debug !MESSAGE !MESSAGE "mysqlbinlog - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqlbinlog - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqlbinlog - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /I "../sql" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /I "../sql" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -77,12 +78,40 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlbinlog.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +!ELSEIF "$(CFG)" == "mysqlbinlog - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqlbinlog___Win32_classic" +# PROP BASE Intermediate_Dir "mysqlbinlog___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /I "../sql" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /I "../sql" /D "MYSQL_SERVER" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlbinlog.exe" /libpath:"..\lib_release\\" +# SUBTRACT BASE LINK32 /pdb:none /debug +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlbinlog.exe" /libpath:"..\lib_release\\" +# SUBTRACT LINK32 /pdb:none /debug + !ENDIF # Begin Target # Name "mysqlbinlog - Win32 Release" # Name "mysqlbinlog - Win32 Debug" +# Name "mysqlbinlog - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/mysqlcheck/mysqlcheck.dsp b/VC++Files/mysqlcheck/mysqlcheck.dsp index f8487119da3..bd24a14128d 100644 --- a/VC++Files/mysqlcheck/mysqlcheck.dsp +++ b/VC++Files/mysqlcheck/mysqlcheck.dsp @@ -19,6 +19,7 @@ CFG=mysqlcheck - Win32 Debug !MESSAGE !MESSAGE "mysqlcheck - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqlcheck - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqlcheck - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -76,12 +77,38 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlcheck.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +!ELSEIF "$(CFG)" == "mysqlcheck - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqlcheck___Win32_classic" +# PROP BASE Intermediate_Dir "mysqlcheck___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "MYSQL_SERVER" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlcheck.exe" /libpath:"..\lib_release\\" + !ENDIF # Begin Target # Name "mysqlcheck - Win32 Release" # Name "mysqlcheck - Win32 Debug" +# Name "mysqlcheck - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/mysqldemb/mysqldemb.dsp b/VC++Files/mysqldemb/mysqldemb.dsp index 91cd90a65ed..a8207d436a0 100644 --- a/VC++Files/mysqldemb/mysqldemb.dsp +++ b/VC++Files/mysqldemb/mysqldemb.dsp @@ -19,6 +19,8 @@ CFG=mysqldemb - Win32 Debug !MESSAGE !MESSAGE "mysqldemb - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "mysqldemb - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "mysqldemb - Win32 classic" (based on "Win32 (x86) Static Library") +!MESSAGE "mysqldemb - Win32 pro" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project @@ -41,7 +43,7 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "../zlib" /I "../libmysqld" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c +# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" @@ -65,7 +67,7 @@ LIB32=xilink6.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "../zlib" /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "../libmysqld" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "../zlib" /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x416 /d "_DEBUG" # ADD RSC /l 0x416 /d "_DEBUG" @@ -74,7 +76,56 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo +# ADD LIB32 /nologo /out:"../lib_debug/mysqldemb.lib" + +!ELSEIF "$(CFG)" == "mysqldemb - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqldemb___Win32_classic" +# PROP BASE Intermediate_Dir "mysqldemb___Win32_classic" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../zlib" /D "WIN32" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../zlib" /D "WIN32" /D "_LIB" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "USE_TLS" /D "__WIN__" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x416 /d "NDEBUG" +# ADD RSC /l 0x416 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=xilink6.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\lib_classic\mysqldemb.lib" + +!ELSEIF "$(CFG)" == "mysqldemb - Win32 pro" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqldemb___Win32_pro" +# PROP BASE Intermediate_Dir "mysqldemb___Win32_pro" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "pro" +# PROP Intermediate_Dir "pro" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../zlib" /D "WIN32" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../libmysqld" /I "../sql" /I "../zlib" /D "WIN32" /D "_LIB" /D "SIGNAL_WITH_VIO_CLOSE" /D "EMBEDDED_LIBRARY" /D "USE_TLS" /D "__WIN__" /D "USE_SYMDIR" /D "MYSQL_SERVER" /D LICENSE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /FD /D MYSQL_SERVER_SUFFIX=-pro /c +# ADD BASE RSC /l 0x416 /d "NDEBUG" +# ADD RSC /l 0x416 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=xilink6.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\lib_pro\mysqldemb.lib" !ENDIF @@ -82,6 +133,8 @@ LIB32=xilink6.exe -lib # Name "mysqldemb - Win32 Release" # Name "mysqldemb - Win32 Debug" +# Name "mysqldemb - Win32 classic" +# Name "mysqldemb - Win32 pro" # Begin Source File SOURCE=..\sql\derror.cpp diff --git a/VC++Files/mysqlmanager/RES/BITMAP1.BMP b/VC++Files/mysqlmanager/RES/bitmap1.bmp similarity index 100% rename from VC++Files/mysqlmanager/RES/BITMAP1.BMP rename to VC++Files/mysqlmanager/RES/bitmap1.bmp diff --git a/VC++Files/mysqlmanager/RES/BITMAP3.BMP b/VC++Files/mysqlmanager/RES/bitmap3.bmp similarity index 100% rename from VC++Files/mysqlmanager/RES/BITMAP3.BMP rename to VC++Files/mysqlmanager/RES/bitmap3.bmp diff --git a/VC++Files/mysqlmanager/RES/BMP00001.BMP b/VC++Files/mysqlmanager/RES/bmp00001.bmp similarity index 100% rename from VC++Files/mysqlmanager/RES/BMP00001.BMP rename to VC++Files/mysqlmanager/RES/bmp00001.bmp diff --git a/VC++Files/mysqlmanager/RES/BMP00002.BMP b/VC++Files/mysqlmanager/RES/bmp00002.bmp similarity index 100% rename from VC++Files/mysqlmanager/RES/BMP00002.BMP rename to VC++Files/mysqlmanager/RES/bmp00002.bmp diff --git a/VC++Files/mysqlmanager/RES/DATABASE.BMP b/VC++Files/mysqlmanager/RES/database.bmp similarity index 100% rename from VC++Files/mysqlmanager/RES/DATABASE.BMP rename to VC++Files/mysqlmanager/RES/database.bmp diff --git a/VC++Files/mysqlmanager/RES/FONTD.BMP b/VC++Files/mysqlmanager/RES/fontd.bmp similarity index 100% rename from VC++Files/mysqlmanager/RES/FONTD.BMP rename to VC++Files/mysqlmanager/RES/fontd.bmp diff --git a/VC++Files/mysqlmanager/RES/FONTU.BMP b/VC++Files/mysqlmanager/RES/fontu.bmp similarity index 100% rename from VC++Files/mysqlmanager/RES/FONTU.BMP rename to VC++Files/mysqlmanager/RES/fontu.bmp diff --git a/VC++Files/mysqlmanager/RES/QUERY_EX.BMP b/VC++Files/mysqlmanager/RES/query_ex.bmp similarity index 100% rename from VC++Files/mysqlmanager/RES/QUERY_EX.BMP rename to VC++Files/mysqlmanager/RES/query_ex.bmp diff --git a/VC++Files/mysqlmanager/RES/TOOLBAR.BMP b/VC++Files/mysqlmanager/RES/toolbar.bmp similarity index 100% rename from VC++Files/mysqlmanager/RES/TOOLBAR.BMP rename to VC++Files/mysqlmanager/RES/toolbar.bmp diff --git a/VC++Files/mysqlmanager/CHILDFRM.CPP b/VC++Files/mysqlmanager/childfrm.cpp similarity index 100% rename from VC++Files/mysqlmanager/CHILDFRM.CPP rename to VC++Files/mysqlmanager/childfrm.cpp diff --git a/VC++Files/mysqlmanager/CHILDFRM.H b/VC++Files/mysqlmanager/childfrm.h similarity index 100% rename from VC++Files/mysqlmanager/CHILDFRM.H rename to VC++Files/mysqlmanager/childfrm.h diff --git a/VC++Files/mysqlmanager/MAINFRM.CPP b/VC++Files/mysqlmanager/mainfrm.cpp similarity index 100% rename from VC++Files/mysqlmanager/MAINFRM.CPP rename to VC++Files/mysqlmanager/mainfrm.cpp diff --git a/VC++Files/mysqlmanager/MAINFRM.H b/VC++Files/mysqlmanager/mainfrm.h similarity index 100% rename from VC++Files/mysqlmanager/MAINFRM.H rename to VC++Files/mysqlmanager/mainfrm.h diff --git a/VC++Files/mysqlmanager/MySqlManager.dsp b/VC++Files/mysqlmanager/mysqlmanager.dsp similarity index 100% rename from VC++Files/mysqlmanager/MySqlManager.dsp rename to VC++Files/mysqlmanager/mysqlmanager.dsp diff --git a/VC++Files/mysqlmanager/MySqlManager.mak b/VC++Files/mysqlmanager/mysqlmanager.mak similarity index 100% rename from VC++Files/mysqlmanager/MySqlManager.mak rename to VC++Files/mysqlmanager/mysqlmanager.mak diff --git a/VC++Files/mysqlmanager/RESOURCE.H b/VC++Files/mysqlmanager/resource.h similarity index 100% rename from VC++Files/mysqlmanager/RESOURCE.H rename to VC++Files/mysqlmanager/resource.h diff --git a/VC++Files/mysqlmanager/STDAFX.CPP b/VC++Files/mysqlmanager/stdafx.cpp similarity index 100% rename from VC++Files/mysqlmanager/STDAFX.CPP rename to VC++Files/mysqlmanager/stdafx.cpp diff --git a/VC++Files/mysqlmanager/STDAFX.H b/VC++Files/mysqlmanager/stdafx.h similarity index 100% rename from VC++Files/mysqlmanager/STDAFX.H rename to VC++Files/mysqlmanager/stdafx.h diff --git a/VC++Files/mysqlmanager/TOOLSQL.CPP b/VC++Files/mysqlmanager/toolsql.cpp similarity index 100% rename from VC++Files/mysqlmanager/TOOLSQL.CPP rename to VC++Files/mysqlmanager/toolsql.cpp diff --git a/VC++Files/mysqlmanager/TOOLSQL.H b/VC++Files/mysqlmanager/toolsql.h similarity index 100% rename from VC++Files/mysqlmanager/TOOLSQL.H rename to VC++Files/mysqlmanager/toolsql.h diff --git a/VC++Files/mysqlserver/mysqlserver.dsp b/VC++Files/mysqlserver/mysqlserver.dsp index d4f4af454d0..b8d07a4bf34 100644 --- a/VC++Files/mysqlserver/mysqlserver.dsp +++ b/VC++Files/mysqlserver/mysqlserver.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "../libmysqld" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "../libmysqld" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /YX /FD /c # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" BSC32=bscmake.exe diff --git a/VC++Files/mysqlshutdown/mysqlshutdown.dsp b/VC++Files/mysqlshutdown/mysqlshutdown.dsp index f1ea7c7d934..b7802240d42 100644 --- a/VC++Files/mysqlshutdown/mysqlshutdown.dsp +++ b/VC++Files/mysqlshutdown/mysqlshutdown.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /W3 /O2 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD CPP /nologo /G6 /W3 /O2 /D "_WINDOWS" /D "_MBCS" /D "NDEBUG" /FD /c # SUBTRACT CPP /WX /Fr /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 diff --git a/VC++Files/mysqlwatch/mysqlwatch.dsp b/VC++Files/mysqlwatch/mysqlwatch.dsp index 5c209f55e51..ee683c60351 100644 --- a/VC++Files/mysqlwatch/mysqlwatch.dsp +++ b/VC++Files/mysqlwatch/mysqlwatch.dsp @@ -24,7 +24,7 @@ CFG=mysqlwatch - Win32 Release # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -38,13 +38,13 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /W3 /GX- /O2 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD CPP /nologo /G6 /W3 /O2 /D "_WINDOWS" /D "_MBCS" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlwatch.exe" # Begin Target diff --git a/VC++Files/mysys/mysys.dsp b/VC++Files/mysys/mysys.dsp index a7be57d94c0..f42357c2249 100644 --- a/VC++Files/mysys/mysys.dsp +++ b/VC++Files/mysys/mysys.dsp @@ -7,26 +7,28 @@ CFG=mysys - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysys.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysys.mak" CFG="mysys - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "mysys - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "mysys - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "mysys - Win32 Max" (based on "Win32 (x86) Static Library") -!MESSAGE +!MESSAGE "mysys - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library") +!MESSAGE "mysys - Win32 TLS" (based on "Win32 (x86) Static Library") +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysys - Win32 Release" @@ -42,14 +44,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_SYMLINK" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /WX /Fr /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\mysys.lib" @@ -66,14 +68,14 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /D "USE_SYMLINK" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c # SUBTRACT CPP /Fr # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\mysys.lib" @@ -91,7 +93,57 @@ 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=xilink6.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_release\mysys.lib" +# ADD LIB32 /nologo /out:"..\lib_release\mysys-max.lib" + +!ELSEIF "$(CFG)" == "mysys - Win32 TLS_DEBUG" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "mysys___Win32_TLS_DEBUG" +# PROP BASE Intermediate_Dir "mysys___Win32_TLS_DEBUG" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "mysys___Win32_TLS_DEBUG" +# PROP Intermediate_Dir "mysys___Win32_TLS_DEBUG" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c +# SUBTRACT BASE CPP /Fr +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /D "USE_TLS" /FD /c +# SUBTRACT CPP /Fr +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_debug\mysys_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_debug\mysys_tls.lib" + +!ELSEIF "$(CFG)" == "mysys - Win32 TLS" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysys___Win32_TLS" +# PROP BASE Intermediate_Dir "mysys___Win32_TLS" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "mysys___Win32_TLS" +# PROP Intermediate_Dir "mysys___Win32_TLS" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 @@ -99,16 +151,18 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\lib_release\mysys.lib" -# ADD LIB32 /nologo /out:"..\lib_release\mysys-max.lib" +# ADD BASE LIB32 /nologo /out:"..\lib_release\mysys_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_release\mysys_tls.lib" -!ENDIF +!ENDIF # Begin Target # Name "mysys - Win32 Release" # Name "mysys - Win32 Debug" # Name "mysys - Win32 Max" +# Name "mysys - Win32 TLS_DEBUG" +# Name "mysys - Win32 TLS" # Begin Source File SOURCE=.\array.c @@ -121,7 +175,15 @@ SOURCE=.\array.c !ELSEIF "$(CFG)" == "mysys - Win32 Max" -!ENDIF + +!ELSEIF "$(CFG)" == "mysys - Win32 TLS_DEBUG" + +# ADD BASE CPP /FR +# ADD CPP /FR + +!ELSEIF "$(CFG)" == "mysys - Win32 TLS" + +!ENDIF # End Source File # Begin Source File @@ -528,7 +590,14 @@ SOURCE=.\thr_lock.c !ELSEIF "$(CFG)" == "mysys - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysys - Win32 TLS_DEBUG" + +# ADD BASE CPP /D "EXTRA_DEBUG" +# ADD CPP /D "EXTRA_DEBUG" + +!ELSEIF "$(CFG)" == "mysys - Win32 TLS" + +!ENDIF # End Source File # Begin Source File diff --git a/VC++Files/pack_isam/pack_isam.dsp b/VC++Files/pack_isam/pack_isam.dsp index cdcba702e15..f5f8f0bcd7a 100644 --- a/VC++Files/pack_isam/pack_isam.dsp +++ b/VC++Files/pack_isam/pack_isam.dsp @@ -19,6 +19,7 @@ CFG=pack_isam - Win32 Debug !MESSAGE !MESSAGE "pack_isam - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "pack_isam - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "pack_isam - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -77,12 +78,38 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /debug /machine:I386 /out:"../client_debug/pack_isam.exe" /pdbtype:sept +!ELSEIF "$(CFG)" == "pack_isam - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "pack_isam___Win32_classic" +# PROP BASE Intermediate_Dir "pack_isam___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/pack_isam.exe" +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/pack_isam.exe" /libpath:"..\lib_release\\" + !ENDIF # Begin Target # Name "pack_isam - Win32 Release" # Name "pack_isam - Win32 Debug" +# Name "pack_isam - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/perror/perror.dsp b/VC++Files/perror/perror.dsp index 99bd8f67ae2..daa6a4dc4ce 100644 --- a/VC++Files/perror/perror.dsp +++ b/VC++Files/perror/perror.dsp @@ -19,6 +19,7 @@ CFG=perror - Win32 Debug !MESSAGE !MESSAGE "perror - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "perror - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE "perror - Win32 classic" (based on "Win32 (x86) Application") !MESSAGE # Begin Project @@ -43,7 +44,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 @@ -85,12 +86,44 @@ LINK32=xilink6.exe # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /incremental:no /debug /machine:I386 /pdbtype:sept # SUBTRACT LINK32 /pdb:none +!ELSEIF "$(CFG)" == "perror - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "perror___Win32_classic" +# PROP BASE Intermediate_Dir "perror___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "WIN32" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/perror.exe" +# SUBTRACT BASE LINK32 /pdb:none +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/perror.exe" /libpath:"..\lib_release\\" +# SUBTRACT LINK32 /pdb:none + !ENDIF # Begin Target # Name "perror - Win32 Release" # Name "perror - Win32 Debug" +# Name "perror - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/regex/regex.dsp b/VC++Files/regex/regex.dsp index 59b55ffe46f..ecca45178f9 100644 --- a/VC++Files/regex/regex.dsp +++ b/VC++Files/regex/regex.dsp @@ -25,7 +25,7 @@ CFG=regex - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "regex - Win32 Release" @@ -41,14 +41,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "./" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "./" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\regex.lib" @@ -72,7 +72,7 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\regex.lib" diff --git a/VC++Files/replace/replace.dsp b/VC++Files/replace/replace.dsp index 2fe763ff388..6df0f793d92 100644 --- a/VC++Files/replace/replace.dsp +++ b/VC++Files/replace/replace.dsp @@ -19,6 +19,7 @@ CFG=replace - Win32 Debug !MESSAGE !MESSAGE "replace - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "replace - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "replace - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x40b /d "NDEBUG" # ADD RSC /l 0x40b /d "NDEBUG" @@ -79,12 +80,40 @@ LINK32=xilink6.exe # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /machine:I386 /out:"../client_debug/replace.exe" /pdbtype:sept # SUBTRACT LINK32 /debug +!ELSEIF "$(CFG)" == "replace - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "replace___Win32_classic" +# PROP BASE Intermediate_Dir "replace___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x40b /d "NDEBUG" +# ADD RSC /l 0x40b /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/replace.exe" +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/replace.exe" /libpath:"..\lib_release\\" + !ENDIF # Begin Target # Name "replace - Win32 Release" # Name "replace - Win32 Debug" +# Name "replace - Win32 classic" # Begin Source File SOURCE=..\extra\replace.c diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp index 3e168b0feb5..4e7bc644cc4 100644 --- a/VC++Files/sql/mysqld.dsp +++ b/VC++Files/sql/mysqld.dsp @@ -7,28 +7,32 @@ CFG=mysqld - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysqld.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysqld.mak" CFG="mysqld - Win32 Release" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "mysqld - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqld - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "mysqld - Win32 nt" (based on "Win32 (x86) Console Application") !MESSAGE "mysqld - Win32 Max nt" (based on "Win32 (x86) Console Application") !MESSAGE "mysqld - Win32 Max" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE "mysqld - Win32 classic" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqld - Win32 pro" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqld - Win32 classic nt" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqld - Win32 pro nt" (based on "Win32 (x86) Console Application") +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysqld - Win32 Release" @@ -45,14 +49,14 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../zlib" /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../zlib" /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x410 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-opt.exe" # SUBTRACT LINK32 /debug @@ -71,14 +75,14 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c # SUBTRACT CPP /Fr /YX # ADD BASE RSC /l 0x410 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\isam.lib ..\lib_debug\merge.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld.exe" /pdbtype:sept @@ -98,14 +102,14 @@ LINK32=link.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /G5 /MT /W3 /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /D "DBUG_OFF" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-nt /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x410 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\dbug.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /debug /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe" # SUBTRACT LINK32 /pdb:none /debug @@ -126,15 +130,15 @@ LINK32=link.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-nt-max /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe" +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 # SUBTRACT BASE LINK32 /pdb:none /debug # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-max-nt.exe" # SUBTRACT LINK32 /pdb:none /debug @@ -155,19 +159,132 @@ LINK32=link.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-max /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"../client_release/mysqld-opt.exe" +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-max.exe" # SUBTRACT LINK32 /debug -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqld___Win32_classic" +# PROP BASE Intermediate_Dir "mysqld___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D LICENSE=Commercial /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "HAVE_DLOPEN" /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 +# SUBTRACT BASE LINK32 /debug +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_classic/mysqld.exe" /libpath:"..\lib_release" +# SUBTRACT LINK32 /debug + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqld___Win32_pro" +# PROP BASE Intermediate_Dir "mysqld___Win32_pro" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "pro" +# PROP Intermediate_Dir "pro" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "MYSQL_SERVER" /D LICENSE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /D MYSQL_SERVER_SUFFIX=-pro /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 +# SUBTRACT BASE LINK32 /debug +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_pro/mysqld.exe" /libpath:"..\lib_release" +# SUBTRACT LINK32 /debug + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqld___Win32_classic_nt" +# PROP BASE Intermediate_Dir "mysqld___Win32_classic_nt" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic_nt" +# PROP Intermediate_Dir "classic_nt" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "__NT__" /D "DBUG_OFF" /D "NDEBUG" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D LICENSE=Commercial /D MYSQL_SERVER_SUFFIX=-nt /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 +# SUBTRACT BASE LINK32 /debug +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_classic/mysqld-nt.exe" /libpath:"..\lib_release" +# SUBTRACT LINK32 /debug + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqld___Win32_pro_nt" +# PROP BASE Intermediate_Dir "mysqld___Win32_pro_nt" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "pro_nt" +# PROP Intermediate_Dir "pro_nt" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D LICENSE=Commercial /D "NDEBUG" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-pro-nt" /FD +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 +# SUBTRACT BASE LINK32 /debug +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_pro/mysqld-nt.exe" /libpath:"..\lib_release" +# SUBTRACT LINK32 /debug + +!ENDIF # Begin Target @@ -176,6 +293,10 @@ LINK32=link.exe # Name "mysqld - Win32 nt" # Name "mysqld - Win32 Max nt" # Name "mysqld - Win32 Max" +# Name "mysqld - Win32 classic" +# Name "mysqld - Win32 pro" +# Name "mysqld - Win32 classic nt" +# Name "mysqld - Win32 pro nt" # Begin Source File SOURCE=.\client.c @@ -193,7 +314,15 @@ SOURCE=.\client.c !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -213,7 +342,15 @@ SOURCE=.\derror.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -241,7 +378,15 @@ SOURCE=.\field.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -261,7 +406,15 @@ SOURCE=.\field_conv.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -281,7 +434,15 @@ SOURCE=.\filesort.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -333,7 +494,15 @@ SOURCE=.\handler.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -352,7 +521,15 @@ SOURCE=.\hash_filo.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -375,7 +552,15 @@ SOURCE=.\hostname.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -395,7 +580,15 @@ SOURCE=.\init.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -415,7 +608,15 @@ SOURCE=.\item.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -435,7 +636,15 @@ SOURCE=.\item_buff.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -455,7 +664,15 @@ SOURCE=.\item_cmpfunc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -479,6 +696,14 @@ SOURCE=.\item_func.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + !ENDIF # End Source File @@ -507,7 +732,15 @@ SOURCE=.\item_strfunc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -531,7 +764,15 @@ SOURCE=.\item_sum.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -550,7 +791,15 @@ SOURCE=.\item_timefunc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -570,7 +819,15 @@ SOURCE=.\item_uniq.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -590,7 +847,15 @@ SOURCE=.\key.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -610,7 +875,15 @@ SOURCE=.\lock.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -630,7 +903,15 @@ SOURCE=.\log.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -653,7 +934,15 @@ SOURCE=.\mf_iocache.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -677,7 +966,15 @@ SOURCE=.\mysqld.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -700,7 +997,15 @@ SOURCE=.\nt_servc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -723,7 +1028,15 @@ SOURCE=.\opt_range.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -754,7 +1067,15 @@ SOURCE=.\password.c !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -774,7 +1095,15 @@ SOURCE=.\procedure.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -802,7 +1131,15 @@ SOURCE=.\records.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -858,7 +1195,15 @@ SOURCE=.\sql_acl.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -882,7 +1227,15 @@ SOURCE=.\sql_base.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -906,6 +1259,14 @@ SOURCE=.\sql_class.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + !ENDIF # End Source File @@ -938,7 +1299,15 @@ SOURCE=.\sql_db.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -958,7 +1327,15 @@ SOURCE=.\sql_delete.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -998,7 +1375,15 @@ SOURCE=.\sql_insert.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1018,7 +1403,15 @@ SOURCE=.\sql_lex.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1038,7 +1431,15 @@ SOURCE=.\sql_list.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1058,7 +1459,15 @@ SOURCE=.\sql_load.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1082,7 +1491,15 @@ SOURCE=.\sql_map.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1102,7 +1519,15 @@ SOURCE=.\sql_parse.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1134,7 +1559,15 @@ SOURCE=.\sql_select.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1154,7 +1587,15 @@ SOURCE=.\sql_show.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1178,7 +1619,15 @@ SOURCE=.\sql_string.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1198,7 +1647,15 @@ SOURCE=.\sql_table.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1218,7 +1675,15 @@ SOURCE=.\sql_test.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1246,7 +1711,15 @@ SOURCE=.\sql_update.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1266,7 +1739,15 @@ SOURCE=.\sql_yacc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1286,6 +1767,14 @@ SOURCE=.\strfunc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + !ENDIF # End Source File @@ -1310,7 +1799,15 @@ SOURCE=.\thr_malloc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1330,7 +1827,15 @@ SOURCE=.\time.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1354,7 +1859,15 @@ SOURCE=.\unireg.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # End Target diff --git a/VC++Files/strings/strings.dsp b/VC++Files/strings/strings.dsp index 31d548ed59f..c8f3208e822 100644 --- a/VC++Files/strings/strings.dsp +++ b/VC++Files/strings/strings.dsp @@ -26,6 +26,7 @@ CFG=strings - Win32 Debug # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "strings - Win32 Release" @@ -41,7 +42,7 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 @@ -151,7 +152,7 @@ SOURCE=".\ctype-sjis.c" SOURCE=".\ctype-tis620.c" # End Source File # Begin Source File - + SOURCE=".\ctype-uca.c" # End Source File # Begin Source File @@ -192,10 +193,6 @@ SOURCE=.\longlong2str.c # End Source File # Begin Source File -SOURCE=.\strnlen.c -# End Source File -# Begin Source File - SOURCE=.\my_strtoll10.c # End Source File # Begin Source File diff --git a/VC++Files/test1/test1.dsp b/VC++Files/test1/test1.dsp index df4b31d684e..e3be8f7a315 100644 --- a/VC++Files/test1/test1.dsp +++ b/VC++Files/test1/test1.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /W3 /O2 /I "../include" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /W3 /O2 /I "../include" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" diff --git a/VC++Files/thr_test/thr_test.dsp b/VC++Files/thr_test/thr_test.dsp index 0c80de42521..0d2b8e0d24b 100644 --- a/VC++Files/thr_test/thr_test.dsp +++ b/VC++Files/thr_test/thr_test.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x40b /d "NDEBUG" # ADD RSC /l 0x40b /d "NDEBUG" diff --git a/VC++Files/vio/vio.dsp b/VC++Files/vio/vio.dsp index c250e693995..5daa5800dbd 100644 --- a/VC++Files/vio/vio.dsp +++ b/VC++Files/vio/vio.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe diff --git a/VC++Files/zlib/contrib/asm386/zlibvc.dsp b/VC++Files/zlib/contrib/asm386/zlibvc.dsp index a70d4d4a6b0..63d8fee6511 100644 --- a/VC++Files/zlib/contrib/asm386/zlibvc.dsp +++ b/VC++Files/zlib/contrib/asm386/zlibvc.dsp @@ -8,16 +8,16 @@ CFG=zlibvc - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "zlibvc.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "zlibvc.mak" CFG="zlibvc - Win32 Release" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "zlibvc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "zlibvc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "zlibvc - Win32 ReleaseAxp" (based on\ @@ -26,7 +26,7 @@ CFG=zlibvc - Win32 Release "Win32 (x86) Dynamic-Link Library") !MESSAGE "zlibvc - Win32 ReleaseWithoutCrtdll" (based on\ "Win32 (x86) Dynamic-Link Library") -!MESSAGE +!MESSAGE # Begin Project # PROP Scc_ProjName "" @@ -191,7 +191,7 @@ LINK32=link.exe # ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_1\zlib.dll" # SUBTRACT LINK32 /pdb:none -!ENDIF +!ENDIF # Begin Target @@ -216,13 +216,13 @@ SOURCE=.\adler32.c DEP_CPP_ADLER=\ ".\zconf.h"\ ".\zlib.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -238,13 +238,13 @@ SOURCE=.\compress.c DEP_CPP_COMPR=\ ".\zconf.h"\ ".\zlib.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -260,13 +260,13 @@ SOURCE=.\crc32.c DEP_CPP_CRC32=\ ".\zconf.h"\ ".\zlib.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -284,13 +284,13 @@ DEP_CPP_DEFLA=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -307,7 +307,7 @@ SOURCE=.\gvmat32c.c !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -324,13 +324,13 @@ DEP_CPP_GZIO_=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -351,13 +351,13 @@ DEP_CPP_INFBL=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -379,13 +379,13 @@ DEP_CPP_INFCO=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -407,13 +407,13 @@ DEP_CPP_INFFA=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -431,13 +431,13 @@ DEP_CPP_INFLA=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -455,13 +455,13 @@ DEP_CPP_INFTR=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -482,13 +482,13 @@ DEP_CPP_INFUT=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -506,13 +506,13 @@ DEP_CPP_TREES=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -528,13 +528,13 @@ SOURCE=.\uncompr.c DEP_CPP_UNCOM=\ ".\zconf.h"\ ".\zlib.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -551,7 +551,7 @@ SOURCE=.\unzip.c !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -568,7 +568,7 @@ SOURCE=.\zip.c !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -593,13 +593,13 @@ DEP_CPP_ZUTIL=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # End Group diff --git a/VC++Files/zlib/zlib.dsp b/VC++Files/zlib/zlib.dsp index 40aaadaa4e1..6edab34d93c 100644 --- a/VC++Files/zlib/zlib.dsp +++ b/VC++Files/zlib/zlib.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 diff --git a/client/my_readline.h b/client/my_readline.h index 2e716eec4cf..6052d462ab9 100644 --- a/client/my_readline.h +++ b/client/my_readline.h @@ -29,6 +29,6 @@ typedef struct st_line_buffer } LINE_BUFFER; extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file); -extern LINE_BUFFER *batch_readline_command(my_string str); +extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, my_string str); extern char *batch_readline(LINE_BUFFER *buffer); extern void batch_readline_end(LINE_BUFFER *buffer); diff --git a/client/mysql.cc b/client/mysql.cc index 52582481234..01d867cca07 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -371,10 +371,16 @@ int main(int argc,char *argv[]) !(status.line_buff=batch_readline_init(max_allowed_packet+512,stdin))) { free_defaults(defaults_argv); + my_end(0); + exit(1); + } + if (mysql_server_init(0, NULL, (char**) server_default_groups)) + { + free_defaults(defaults_argv); + my_end(0); exit(1); } glob_buffer.realloc(512); - mysql_server_init(0, NULL, (char**) server_default_groups); completion_hash_init(&ht, 128); init_alloc_root(&hash_mem_root, 16384, 0); bzero((char*) &mysql, sizeof(mysql)); @@ -494,7 +500,7 @@ static struct my_option my_long_options[] = "No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. WARNING: options deprecated; use --disable-auto-rehash instead.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"batch", 'B', - "Print results with a tab as separator, each row on new line. Doesn't use history file.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + "Don't use history file. Disable interactive behavior. (Enables --silent)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"character-sets-dir", OPT_CHARSETS_DIR, "Directory where character sets are.", (gptr*) &charsets_dir, (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -515,7 +521,7 @@ static struct my_option my_long_options[] = (gptr*) ¤t_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"delimiter", OPT_DELIMITER, "Delimiter to be used.", (gptr*) &delimiter_str, (gptr*) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"execute", 'e', "Execute command and quit. (Output like with --batch).", 0, + {"execute", 'e', "Execute command and quit. (Disables --force and history file)", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"vertical", 'E', "Print the output of a query (rows) vertically.", (gptr*) &vertical, (gptr*) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, @@ -597,7 +603,7 @@ static struct my_option my_long_options[] = 0, 0, 0}, {"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default.", (gptr*) &opt_reconnect, (gptr*) &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, - {"silent", 's', "Be more silent.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, + {"silent", 's', "Be more silent. Print results with a tab as separator, each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME, @@ -663,6 +669,10 @@ static struct my_option my_long_options[] = static void usage(int version) { + /* Divert all help information on NetWare to logger screen. */ +#ifdef __NETWARE__ +#define printf consoleprintf +#endif printf("%s Ver %s Distrib %s, for %s (%s)\n", my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); if (version) @@ -675,8 +685,13 @@ and you are welcome to modify and redistribute it under the GPL license\n"); my_print_help(my_long_options); print_defaults("my", load_default_groups); my_print_variables(my_long_options); + NETWARE_SET_SCREEN_MODE(1); +#ifdef __NETWARE__ +#undef printf +#endif } + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) @@ -755,10 +770,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'e': status.batch= 1; status.add_to_history= 0; - batch_readline_end(status.line_buff); // If multiple -e - if (!(status.line_buff= batch_readline_command(argument))) + if (!status.line_buff) + ignore_errors= 0; // do it for the first -e only + if (!(status.line_buff= batch_readline_command(status.line_buff, argument))) return 1; - ignore_errors= 0; break; case 'o': if (argument == disabled_my_option) @@ -798,12 +813,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), verbose++; break; case 'B': - if (!status.batch) - { - status.batch= 1; - status.add_to_history= 0; - opt_silent++; // more silent - } + status.batch= 1; + status.add_to_history= 0; + set_if_bigger(opt_silent,1); // more silent break; case 'W': #ifdef __WIN__ @@ -913,6 +925,7 @@ static int read_lines(bool execute_commands) #ifdef __NETWARE__ line=fgets(linebuffer, sizeof(linebuffer)-1, stdin); /* Remove the '\n' */ + if (line) { char *p = strrchr(line, '\n'); if (p != NULL) @@ -928,7 +941,11 @@ static int read_lines(bool execute_commands) line= readline(prompt); #endif /* defined( __WIN__) || defined(OS2) || defined(__NETWARE__) */ - if (opt_outfile) + /* + When Ctrl+d or Ctrl+z is pressed, the line may be NULL on some OS + which may cause coredump. + */ + if (opt_outfile && line) fprintf(OUTFILE, "%s\n", line); } if (!line) // End of file @@ -1108,11 +1125,8 @@ static bool add_line(String &buffer,char *line,char *in_string, } else { - int error= com_go(&buffer, 0); - if (error) - { - return error < 0 ? 0 : 1; // < 0 is not fatal - } + if (com_go(&buffer, 0) > 0) // < 0 is not fatal + return 1; } buffer.length(0); out= line; @@ -1245,7 +1259,6 @@ static void fix_history(String *final_command) static int not_in_history(const char *line) { HIST_ENTRY *oldhist = history_get(history_length); - int num; if (oldhist == 0) return 1; @@ -1595,7 +1608,6 @@ static int com_server_help(String *buffer __attribute__((unused)), const char *server_cmd= buffer->ptr(); char cmd_buf[100]; MYSQL_RES *result; - MYSQL_FIELD *fields; int error; if (help_arg[0] != '\'') @@ -1621,7 +1633,7 @@ static int com_server_help(String *buffer __attribute__((unused)), { unsigned int num_fields= mysql_num_fields(result); my_ulonglong num_rows= mysql_num_rows(result); - fields= mysql_fetch_fields(result); + mysql_fetch_fields(result); if (num_fields==3 && num_rows==1) { if (!(cur= mysql_fetch_row(result))) @@ -2386,10 +2398,8 @@ static int com_quit(String *buffer __attribute__((unused)), char *line __attribute__((unused))) { -#ifdef __NETWARE__ - // let the screen auto close on a normal shutdown - setscreenmode(SCR_AUTOCLOSE_ON_EXIT); -#endif + /* let the screen auto close on a normal shutdown */ + NETWARE_SET_SCREEN_MODE(SCR_AUTOCLOSE_ON_EXIT); status.exit_status=0; return 1; } @@ -2410,6 +2420,10 @@ static int com_shell(String *buffer, char *line __attribute__((unused))) { char *shell_cmd; + + /* Skip space from line begin */ + while (my_isspace(charset_info, *line)) + line++; if (!(shell_cmd = strchr(line, ' '))) { put_info("Usage: \\! shell-command", INFO_ERROR); @@ -2991,7 +3005,7 @@ void tee_fprintf(FILE *file, const char *fmt, ...) { va_list args; - NETWARE_YIELD + NETWARE_YIELD; va_start(args, fmt); (void) vfprintf(file, fmt, args); #ifdef OS2 @@ -3005,7 +3019,7 @@ void tee_fprintf(FILE *file, const char *fmt, ...) void tee_fputs(const char *s, FILE *file) { - NETWARE_YIELD + NETWARE_YIELD; fputs(s, file); #ifdef OS2 fflush( file); @@ -3017,7 +3031,7 @@ void tee_fputs(const char *s, FILE *file) void tee_puts(const char *s, FILE *file) { - NETWARE_YIELD + NETWARE_YIELD; fputs(s, file); fputs("\n", file); #ifdef OS2 diff --git a/client/mysqladmin.c b/client/mysqladmin.c index a2cce3782d6..e6e90fc628c 100644 --- a/client/mysqladmin.c +++ b/client/mysqladmin.c @@ -874,11 +874,13 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) return 0; } +#include static void print_version(void) { printf("%s Ver %s Distrib %s, for %s on %s\n",my_progname,ADMIN_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); + NETWARE_SET_SCREEN_MODE(1); } @@ -921,6 +923,8 @@ static void usage(void) version Get version info from server"); } +#include + static int drop_db(MYSQL *mysql, const char *db) { char name_buff[FN_REFLEN+20], buf[10]; diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 818b402d014..41d1ac883f0 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -61,7 +61,7 @@ static const char *load_default_groups[]= { "mysqlbinlog","client",0 }; void sql_print_error(const char *format, ...); -static bool one_database = 0; +static bool one_database=0, to_last_remote_log= 0; static const char* database= 0; static my_bool force_opt= 0, short_form= 0, remote_opt= 0; static ulonglong offset = 0; @@ -489,6 +489,12 @@ static struct my_option my_long_options[] = {"socket", 'S', "Socket file to use for connection.", (gptr*) &sock, (gptr*) &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"to-last-log", 't', "Requires -R. Will not stop at the end of the \ +requested binlog but rather continue printing until the end of the last \ +binlog of the MySQL server. If you send the output to the same MySQL server, \ +that may lead to an endless loop.", + (gptr*) &to_last_remote_log, (gptr*) &to_last_remote_log, 0, GET_BOOL, + NO_ARG, 0, 0, 0, 0, 0, 0}, {"user", 'u', "Connect to the remote server as username.", (gptr*) &user, (gptr*) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -533,9 +539,12 @@ static void die(const char* fmt, ...) exit(1); } +#include + static void print_version() { printf("%s Ver 3.1 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); + NETWARE_SET_SCREEN_MODE(1); } @@ -554,6 +563,8 @@ the mysql command line client\n\n"); my_print_variables(my_long_options); } +#include + extern "C" my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) @@ -768,7 +779,6 @@ could be out of memory"); len - 1, &error, description_event); if (!ev) - { fprintf(stderr, "Could not construct log event object\n"); DBUG_RETURN(1); } @@ -795,7 +805,7 @@ could be out of memory"); part of our log) and then we will stop when we receive the fake one soon. */ - if (rev->when == 0) + if ((rev->when == 0) && !to_last_remote_log) { if ((rev->ident_len != logname_len) || memcmp(rev->new_log_ident, logname, logname_len)) @@ -809,29 +819,6 @@ could be out of memory"); } if (process_event(&rec_count,&last_event_info,ev,old_off)) DBUG_RETURN(1); - } - else - { - Load_log_event *le= (Load_log_event*)ev; - const char *old_fname= le->fname; - uint old_len= le->fname_len; - File file; - - if ((file= load_processor.prepare_new_file_for_old_format(le,fname)) < 0) - DBUG_RETURN(1); - - if (process_event(&rec_count,&last_event_info,ev,old_off)) - { - my_close(file,MYF(MY_WME)); - DBUG_RETURN(1); - } - if (load_processor.load_old_format_file(net,old_fname,old_len,file)) - { - my_close(file,MYF(MY_WME)); - DBUG_RETURN(1); - } - my_close(file,MYF(MY_WME)); - } /* Let's adjust offset for remote log as for local log to produce similar text. As we don't print the fake Rotate event, all events are diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index aa4c1282cc1..78e82e670f8 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -172,10 +172,13 @@ static void print_result(); static char *fix_table_name(char *dest, char *src); int what_to_do = 0; +#include + static void print_version(void) { printf("%s Ver %s Distrib %s, for %s (%s)\n", my_progname, CHECK_VERSION, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); + NETWARE_SET_SCREEN_MODE(1); } /* print_version */ @@ -206,6 +209,7 @@ static void usage(void) my_print_variables(my_long_options); } /* usage */ +#include static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), diff --git a/client/mysqldump.c b/client/mysqldump.c index 1a0ef713ec7..0366e0da87f 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -241,10 +241,10 @@ static struct my_option my_long_options[] = {"no-data", 'd', "No row information.", (gptr*) &dFlag, (gptr*) &dFlag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"no-set-names", 'N', - "'SET NAMES charset_name' will not be put in the output. Deprecated, use --set-charset or --skip-set-charset to enable/disable charset settings instead", + "Deprecated, use --set-charset or --skip-set-charset to enable/disable charset settings instead", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"set-charset", OPT_SET_CHARSET, - "'SET NAMES charset_name' will be put in the output", + "'SET CHARACTER_SET_CLIENT=default_character_set' will be put in the output", (gptr*) &opt_set_charset, (gptr*) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"set-variable", 'O', @@ -332,11 +332,13 @@ static int dump_all_databases(); static char *quote_name(const char *name, char *buff, my_bool force); static const char *check_if_ignore_table(const char *table_name); +#include static void print_version(void) { printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION, - MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); + MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); + NETWARE_SET_SCREEN_MODE(1); } /* print_version */ @@ -346,8 +348,10 @@ static void short_usage_sub(void) printf("OR %s [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]\n", my_progname); printf("OR %s [OPTIONS] --all-databases [OPTIONS]\n", my_progname); + NETWARE_SET_SCREEN_MODE(1); } + static void usage(void) { print_version(); @@ -367,6 +371,8 @@ static void short_usage(void) printf("For more options, use %s --help\n", my_progname); } +#include + static void write_header(FILE *sql_file, char *db_name) { @@ -1264,18 +1270,32 @@ static char *field_escape(char *to,const char *from,uint length) } /* field_escape */ +static char *alloc_query_str(ulong size) +{ + char *query; + + if (!(query= (char*) my_malloc(size, MYF(MY_WME)))) + { + ignore_errors= 0; /* Fatal error */ + safe_exit(EX_MYSQLERR); /* Force exit */ + } + return query; +} + /* ** dumpTable saves database contents as a series of INSERT statements. */ static void dumpTable(uint numFields, char *table) { - char query[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3]; + char query_buf[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3]; char *result_table, table_buff2[NAME_LEN*2+3], *opt_quoted_table; + char *query= query_buf; MYSQL_RES *res; MYSQL_FIELD *field; MYSQL_ROW row; ulong rownr, row_break, total_length, init_length; const char *table_type; + int error= 0; result_table= quote_name(table,table_buff, 1); opt_quoted_table= quote_name(table, table_buff2, 0); @@ -1321,8 +1341,11 @@ static void dumpTable(uint numFields, char *table) sprintf(buff," FROM %s", result_table); end= strmov(end,buff); if (where) - end= strxmov(end, " WHERE ",where,NullS); - if (mysql_query(sock, query)) + { + query= alloc_query_str((ulong) (strlen(where) + (end - query) + 10)); + end= strxmov(query, query_buf, " WHERE ", where, NullS); + } + if (mysql_real_query(sock, query, (uint) (end - query))) { DBerror(sock, "when executing 'SELECT INTO OUTFILE'"); return; @@ -1339,14 +1362,16 @@ static void dumpTable(uint numFields, char *table) { if (!opt_xml && opt_comments) fprintf(md_result_file,"-- WHERE: %s\n",where); - strxmov(strend(query), " WHERE ",where,NullS); + query= alloc_query_str((ulong) (strlen(where) + strlen(query) + 10)); + strxmov(query, query_buf, " WHERE ", where, NullS); } if (!opt_xml && !opt_compact) fputs("\n", md_result_file); if (mysql_query(sock, query)) { DBerror(sock, "when retrieving data from server"); - return; + error= EX_CONSCHECK; + goto err; } if (quick) res=mysql_use_result(sock); @@ -1355,7 +1380,8 @@ static void dumpTable(uint numFields, char *table) if (!res) { DBerror(sock, "when retrieving data from server"); - return; + error= EX_CONSCHECK; + goto err; } if (verbose) fprintf(stderr, "-- Retrieving rows...\n"); @@ -1363,8 +1389,8 @@ static void dumpTable(uint numFields, char *table) { fprintf(stderr,"%s: Error in field count for table: %s ! Aborting.\n", my_progname, result_table); - safe_exit(EX_CONSCHECK); - return; + error= EX_CONSCHECK; + goto err; } if (opt_disable_keys) @@ -1402,8 +1428,8 @@ static void dumpTable(uint numFields, char *table) sprintf(query,"%s: Not enough fields from table %s! Aborting.\n", my_progname, result_table); fputs(query,stderr); - safe_exit(EX_CONSCHECK); - return; + error= EX_CONSCHECK; + goto err; } if (extended_insert) { @@ -1422,7 +1448,8 @@ static void dumpTable(uint numFields, char *table) if (dynstr_realloc(&extended_row,length * 2+2)) { fputs("Aborting dump (out of memory)",stderr); - safe_exit(EX_EOM); + error= EX_EOM; + goto err; } dynstr_append(&extended_row,"'"); extended_row.length += @@ -1458,7 +1485,8 @@ static void dumpTable(uint numFields, char *table) else if (dynstr_append(&extended_row,"NULL")) { fputs("Aborting dump (out of memory)",stderr); - safe_exit(EX_EOM); + error= EX_EOM; + goto err; } } else @@ -1552,8 +1580,8 @@ static void dumpTable(uint numFields, char *table) result_table, rownr); fputs(query,stderr); - safe_exit(EX_CONSCHECK); - return; + error= EX_CONSCHECK; + goto err; } if (opt_lock) fputs("UNLOCK TABLES;\n", md_result_file); @@ -1563,7 +1591,16 @@ static void dumpTable(uint numFields, char *table) if (opt_autocommit) fprintf(md_result_file, "commit;\n"); mysql_free_result(res); - } + if (query != query_buf) + my_free(query, MYF(MY_ALLOW_ZERO_PTR)); + } + return; + +err: + if (query != query_buf) + my_free(query, MYF(MY_ALLOW_ZERO_PTR)); + safe_exit(error); + return; } /* dumpTable */ diff --git a/client/mysqlimport.c b/client/mysqlimport.c index d47ae48b1ac..ccf7fd9880d 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -147,14 +147,16 @@ static struct my_option my_long_options[] = static const char *load_default_groups[]= { "mysqlimport","client",0 }; +#include + static void print_version(void) { printf("%s Ver %s Distrib %s, for %s (%s)\n" ,my_progname, IMPORT_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); + NETWARE_SET_SCREEN_MODE(1); } - static void usage(void) { print_version(); @@ -173,6 +175,7 @@ file. The SQL command 'LOAD DATA INFILE' is used to import the rows.\n"); my_print_variables(my_long_options); } +#include static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 9dc5c0a30f4..d9e2a1fa92a 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -209,12 +209,16 @@ static struct my_option my_long_options[] = }; +#include + static void print_version(void) { printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,SHOW_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); + NETWARE_SET_SCREEN_MODE(1); } + static void usage(void) { print_version(); @@ -234,6 +238,8 @@ are shown"); my_print_variables(my_long_options); } +#include + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) diff --git a/client/mysqltest.c b/client/mysqltest.c index 2cd395a02b8..be2270850fa 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -109,7 +109,7 @@ MYSQL_MANAGER* manager=0; static char **default_argv; static const char *load_default_groups[]= { "mysqltest","client",0 }; -static char line_buffer[MAX_DELIMITER], *line_buffer_pos= line_buffer;; +static char line_buffer[MAX_DELIMITER], *line_buffer_pos= line_buffer; static FILE* file_stack[MAX_INCLUDE_DEPTH]; static FILE** cur_file; @@ -180,6 +180,17 @@ typedef struct int alloced; } VAR; +#ifdef __NETWARE__ +/* + Netware doesn't proved environment variable substitution that is done + by the shell in unix environments. We do this in the following function: +*/ + +static char *subst_env_var(const char *cmd); +static int my_popen(const char *cmd, const char *mode); +#define popen(A,B) my_popen((A),(B)) +#endif /* __NETWARE__ */ + VAR var_reg[10]; /*Perl/shell-like variable registers */ HASH var_hash; @@ -906,7 +917,7 @@ int do_exec(struct st_query* q) while (fgets(buf, sizeof(buf), res_file)) replace_dynstr_append_mem(ds, buf, strlen(buf)); - + if (glob_replace) free_replace(); @@ -929,6 +940,7 @@ int do_exec(struct st_query* q) DBUG_RETURN(error); } + int var_query_set(VAR* v, const char* p, const char** p_end) { char* end = (char*)((p_end && *p_end) ? *p_end : p + strlen(p)); @@ -3674,3 +3686,101 @@ static void get_replace_column(struct st_query *q) } my_free(start, MYF(0)); } + +#ifdef __NETWARE__ + +/* + Substitute environment variables with text. + + SYNOPSIS + subst_env_var() + arg String that should be substitute + + DESCRIPTION + This function takes a string as an input and replaces the + environment variables, that starts with '$' character, with it value. + + NOTES + Return string must be freed with my_free() + + RETURN + String with environment variables replaced. +*/ + +static char *subst_env_var(const char *str) +{ + char *result; + + result= pos= my_malloc(MAX_QUERY, MYF(MY_FAE)); + while (*str) + { + /* + need this only when we want to provide the functionality of + escaping through \ 'backslash' + if ((result == pos && *str=='$') || + (result != pos && *str=='$' && str[-1] !='\\')) + */ + if (*str == '$') + { + char env_var[256], *env_pos= env_var, *subst; + + /* Search for end of environment variable */ + for (str++; + *str && !isspace(*str) && *str != '\\' && *str != '/' && + *str != '$'; + str++) + *env_pos++ *str; + *env_pos= 0; + + if (!(subst= getenv(env_var))) + { + my_free(result, MYF(0)); + die("MYSQLTEST.NLM: Environment variable %s is not defined\n", + env_var); + } + + /* get the string to be substitued for env_var */ + pos= strmov(pos, subst); + /* Process delimiter in *str again */ + } + else + *pos++= *str++; + } + *pos= 0; + return result; +} + + +/* + popen replacement for Netware + + SYNPOSIS + my_popen() + name Command to execute (with possible env variables) + mode Mode for popen. + + NOTES + Environment variable expansion does not take place for popen function + on NetWare, so we use this function to wrap around popen to do this. + + For the moment we ignore 'mode' and always use 'r0' + + RETURN + # >= 0 File handle + -1 Error +*/ + +#undef popen /* Remove wrapper */ + +int my_popen(const char *cmd, const char *mode __attribute__((unused)) t) +{ + char *subst_cmd; + int res_file; + + subst_cmd= subst_env_var(cmd); + res_file= popen(subst_cmd, "r0"); + my_free(subst_cmd, MYF(0)); + return res_file; +} + +#endif /* __NETWARE__ */ diff --git a/client/readline.cc b/client/readline.cc index f5fbfd8cd0c..52ecb4e5c68 100644 --- a/client/readline.cc +++ b/client/readline.cc @@ -31,7 +31,8 @@ static char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length); LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file) { LINE_BUFFER *line_buff; - if (!(line_buff=(LINE_BUFFER*) my_malloc(sizeof(*line_buff),MYF(MY_WME)))) + if (!(line_buff=(LINE_BUFFER*) + my_malloc(sizeof(*line_buff),MYF(MY_WME | MY_ZEROFILL)))) return 0; if (init_line_buffer(line_buff,fileno(file),IO_SIZE,max_size)) { @@ -67,11 +68,12 @@ void batch_readline_end(LINE_BUFFER *line_buff) } -LINE_BUFFER *batch_readline_command(my_string str) +LINE_BUFFER *batch_readline_command(LINE_BUFFER *line_buff, my_string str) { - LINE_BUFFER *line_buff; - if (!(line_buff=(LINE_BUFFER*) my_malloc(sizeof(*line_buff),MYF(MY_WME)))) - return 0; + if (!line_buff) + if (!(line_buff=(LINE_BUFFER*) + my_malloc(sizeof(*line_buff),MYF(MY_WME | MY_ZEROFILL)))) + return 0; if (init_line_buffer_from_string(line_buff,str)) { my_free((char*) line_buff,MYF(0)); @@ -88,7 +90,6 @@ LINE_BUFFER *batch_readline_command(my_string str) static bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,ulong max_buffer) { - bzero((char*) buffer,sizeof(buffer[0])); buffer->file=file; buffer->bufread=size; buffer->max_size=max_buffer; @@ -100,19 +101,26 @@ init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,ulong max_buffer) return 0; } - +/* + init_line_buffer_from_string can be called on the same buffer + several times. the resulting buffer will contain a + concatenation of all strings separated by spaces +*/ static bool init_line_buffer_from_string(LINE_BUFFER *buffer,my_string str) { - uint length; - bzero((char*) buffer,sizeof(buffer[0])); - length=(uint) strlen(str); - if (!(buffer->buffer=buffer->start_of_line=buffer->end_of_line= - (char*)my_malloc(length+2,MYF(MY_FAE)))) + uint old_length=buffer->end - buffer->buffer; + uint length= (uint) strlen(str); + if (!(buffer->buffer= buffer->start_of_line= buffer->end_of_line= + (char*)my_realloc(buffer->buffer, old_length+length+2, + MYF(MY_FAE|MY_ALLOW_ZERO_PTR)))) return 1; - memcpy(buffer->buffer,str,length); - buffer->buffer[length]='\n'; - buffer->buffer[length+1]=0; - buffer->end=buffer->buffer+length+1; + buffer->end= buffer->buffer + old_length; + if (old_length) + buffer->end[-1]=' '; + memcpy(buffer->end, str, length); + buffer->end[length]= '\n'; + buffer->end[length+1]= 0; + buffer->end+= length+1; buffer->eof=1; buffer->max_size=1; return 0; diff --git a/configure.in b/configure.in index 6cd085d48f3..baa20a42b33 100644 --- a/configure.in +++ b/configure.in @@ -126,8 +126,10 @@ fi # The following hack should ensure that configure doesn't add optimizing # or debugging flags to CFLAGS or CXXFLAGS -CFLAGS="$CFLAGS " -CXXFLAGS="$CXXFLAGS " +# C_EXTRA_FLAGS are flags that are automaticly added to both +# CFLAGS and CXXFLAGS +CFLAGS="$CFLAGS $C_EXTRA_FLAGS " +CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS " dnl Checks for programs. AC_PROG_AWK @@ -1120,8 +1122,8 @@ dnl Is this the right match for DEC OSF on alpha? # Add library dependencies to mysqld_DEPENDENCIES lib_DEPENDENCIES="\$(bdb_libs_with_path) \$(innodb_libs) \$(pstack_libs) \$(innodb_system_libs) \$(openssl_libs)" cat > $filesed << EOF -s,\(^.*\$(MAKE) gen_lex_hash\),#\1, -s,\(\./gen_lex_hash\),\1.linux, +s,\(^.*\$(MAKE) gen_lex_hash\)\$(EXEEXT),#\1, +s,\(\./gen_lex_hash\)\$(EXEEXT),\1.linux, s%\(mysqld_DEPENDENCIES = \) %\1$lib_DEPENDENCIES % EOF ;; @@ -2847,6 +2849,7 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl include/Makefile sql-bench/Makefile tools/Makefile dnl tests/Makefile Docs/Makefile support-files/Makefile dnl support-files/MacOSX/Makefile mysql-test/Makefile dnl + netware/Makefile dnl include/mysql_version.h dnl cmd-line-utils/Makefile dnl cmd-line-utils/libedit/Makefile dnl diff --git a/extra/Makefile.am b/extra/Makefile.am index 0276355ef65..df29a3a6ab7 100644 --- a/extra/Makefile.am +++ b/extra/Makefile.am @@ -14,7 +14,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include +INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include @ndbcluster_includes@ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \ ../dbug/libdbug.a ../strings/libmystrings.a bin_PROGRAMS = replace comp_err perror resolveip my_print_defaults \ diff --git a/extra/perror.c b/extra/perror.c index 10b2442de20..a31889cc26d 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -16,22 +16,34 @@ /* Return error-text for system error messages and nisam messages */ -#define PERROR_VERSION "2.9" +#define PERROR_VERSION "2.10" #include #include #include #include #include +#ifdef HAVE_NDBCLUSTER_DB +#include "../ndb/src/ndbapi/ndberror.c" +#endif static my_bool verbose, print_all_codes; +#ifdef HAVE_NDBCLUSTER_DB +static my_bool ndb_code; +static char ndb_string[1024]; +#endif + static struct my_option my_long_options[] = { {"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"info", 'I', "Synonym for --help.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, +#ifdef HAVE_NDBCLUSTER_DB + {"ndb", 0, "Ndbcluster storage engine specific error codes.", (gptr*) &ndb_code, + (gptr*) &ndb_code, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, +#endif #ifdef HAVE_SYS_ERRLIST {"all", 'a', "Print all the error messages and the number.", (gptr*) &print_all_codes, (gptr*) &print_all_codes, 0, GET_BOOL, NO_ARG, @@ -195,12 +207,37 @@ int main(int argc,char *argv[]) else #endif { + /* + On some system, like NETWARE, strerror(unknown_error) returns a + string 'Unknown Error'. To avoid printing it we try to find the + error string by asking for an impossible big error message. + */ + const char *unknown_error= strerror(10000); + for ( ; argc-- > 0 ; argv++) { + found=0; code=atoi(*argv); - msg = strerror(code); - if (msg) +#ifdef HAVE_NDBCLUSTER_DB + if (ndb_code) + { + if (ndb_error_string(code, ndb_string, 1024) < 0) + msg= 0; + else + msg= ndb_string; + } + else +#endif + msg = strerror(code); + + /* + Don't print message for not existing error messages or for + unknown errors. We test for 'Uknown Errors' just as an + extra safety for Netware + */ + if (msg && strcmp(msg, "Unknown Error") && + (!unknown_error || strcmp(msg, unknown_error))) { found=1; if (verbose) @@ -219,7 +256,7 @@ int main(int argc,char *argv[]) else { if (verbose) - printf("%3d = %s\n",code,msg); + printf("MySql error: %3d = %s\n",code,msg); else puts(msg); } diff --git a/heap/heapdef.h b/heap/heapdef.h index 63109badb05..083765334ab 100644 --- a/heap/heapdef.h +++ b/heap/heapdef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -97,6 +97,7 @@ extern uint hp_rb_null_key_length(HP_KEYDEF *keydef, const byte *key); extern my_bool hp_if_null_in_key(HP_KEYDEF *keyinfo, const byte *record); extern int hp_close(register HP_INFO *info); extern void hp_clear(HP_SHARE *info); +extern void hp_clear_keys(HP_SHARE *info); extern uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, uint k_len); #ifdef THREAD diff --git a/heap/hp_clear.c b/heap/hp_clear.c index e65d3a172c3..4440344f990 100644 --- a/heap/hp_clear.c +++ b/heap/hp_clear.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,13 +29,60 @@ void heap_clear(HP_INFO *info) void hp_clear(HP_SHARE *info) { - uint key; DBUG_ENTER("hp_clear"); if (info->block.levels) VOID(hp_free_level(&info->block,info->block.levels,info->block.root, (byte*) 0)); info->block.levels=0; + hp_clear_keys(info); + info->records=info->deleted=info->data_length=0; + info->blength=1; + info->changed=0; + info->del_link=0; + DBUG_VOID_RETURN; +} + + +/* + Clear all keys. + + SYNOPSIS + heap_clear_keys() + info A pointer to the heap storage engine HP_INFO struct. + + DESCRIPTION + Delete all trees of all indexes and leave them empty. + + RETURN + void +*/ + +void heap_clear_keys(HP_INFO *info) +{ + hp_clear(info->s); +} + + +/* + Clear all keys. + + SYNOPSIS + hp_clear_keys() + info A pointer to the heap storage engine HP_SHARE struct. + + DESCRIPTION + Delete all trees of all indexes and leave them empty. + + RETURN + void +*/ + +void hp_clear_keys(HP_SHARE *info) +{ + uint key; + DBUG_ENTER("hp_clear_keys"); + for (key=0 ; key < info->keys ; key++) { HP_KEYDEF *keyinfo = info->keydef + key; @@ -52,9 +99,95 @@ void hp_clear(HP_SHARE *info) block->last_allocated=0; } } - info->records=info->deleted=info->data_length=info->index_length=0; - info->blength=1; - info->changed=0; - info->del_link=0; + info->index_length=0; DBUG_VOID_RETURN; } + + +/* + Disable all indexes. + + SYNOPSIS + heap_disable_indexes() + info A pointer to the heap storage engine HP_INFO struct. + + DESCRIPTION + Disable and clear (remove contents of) all indexes. + + RETURN + 0 ok +*/ + +int heap_disable_indexes(HP_INFO *info) +{ + HP_SHARE *share= info->s; + + if (share->keys) + { + hp_clear_keys(share); + share->currently_disabled_keys= share->keys; + share->keys= 0; + } + return 0; +} + + +/* + Enable all indexes + + SYNOPSIS + heap_enable_indexes() + info A pointer to the heap storage engine HP_INFO struct. + + DESCRIPTION + Enable all indexes. The indexes might have been disabled + by heap_disable_index() before. + The function works only if both data and indexes are empty, + since the heap storage engine cannot repair the indexes. + To be sure, call handler::delete_all_rows() before. + + RETURN + 0 ok + HA_ERR_CRASHED data or index is non-empty. +*/ + +int heap_enable_indexes(HP_INFO *info) +{ + int error= 0; + HP_SHARE *share= info->s; + + if (share->data_length || share->index_length) + error= HA_ERR_CRASHED; + else + if (share->currently_disabled_keys) + { + share->keys= share->currently_disabled_keys; + share->currently_disabled_keys= 0; + } + return error; +} + + +/* + Test if indexes are disabled. + + SYNOPSIS + heap_indexes_are_disabled() + info A pointer to the heap storage engine HP_INFO struct. + + DESCRIPTION + Test if indexes are disabled. + + RETURN + 0 indexes are not disabled + 1 all indexes are disabled + [2 non-unique indexes are disabled - NOT YET IMPLEMENTED] +*/ + +int heap_indexes_are_disabled(HP_INFO *info) +{ + HP_SHARE *share= info->s; + + return (! share->keys && share->currently_disabled_keys); +} + diff --git a/heap/hp_hash.c b/heap/hp_hash.c index d040f37aea0..38ed581fe58 100644 --- a/heap/hp_hash.c +++ b/heap/hp_hash.c @@ -29,19 +29,15 @@ hp_rb_records_in_range() info HEAP handler inx Index to use - start_key Start of range. Null pointer if from first key - start_key_len Length of start key - start_search_flag Flag if start key should be included or not - end_key End of range. Null pointer if to last key - end_key_len Length of end key - end_search_flag Flag if start key should be included or not + min_key Min key. Is = 0 if no min range + max_key Max key. Is = 0 if no max range NOTES - start_search_flag can have one of the following values: + min_key.flag can have one of the following values: HA_READ_KEY_EXACT Include the key in the range HA_READ_AFTER_KEY Don't include key in range - end_search_flag can have one of the following values: + max_key.flag can have one of the following values: HA_READ_BEFORE_KEY Don't include key in range HA_READ_AFTER_KEY Include all 'end_key' values in the range @@ -52,11 +48,8 @@ the range. */ -ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key, - uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key, uint end_key_len, - enum ha_rkey_function end_search_flag) +ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key, + key_range *max_key) { ha_rows start_pos, end_pos; HP_KEYDEF *keyinfo= info->s->keydef + inx; @@ -67,12 +60,12 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key, info->lastinx= inx; custom_arg.keyseg= keyinfo->seg; custom_arg.search_flag= SEARCH_FIND | SEARCH_SAME; - if (start_key) + if (min_key) { custom_arg.key_length= hp_rb_pack_key(keyinfo, (uchar*) info->recbuf, - (uchar*) start_key, - start_key_len); - start_pos= tree_record_pos(rb_tree, info->recbuf, start_search_flag, + (uchar*) min_key->key, + min_key->length); + start_pos= tree_record_pos(rb_tree, info->recbuf, min_key->flag, &custom_arg); } else @@ -80,11 +73,12 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key, start_pos= 0; } - if (end_key) + if (max_key) { custom_arg.key_length= hp_rb_pack_key(keyinfo, (uchar*) info->recbuf, - (uchar*) end_key, end_key_len); - end_pos= tree_record_pos(rb_tree, info->recbuf, end_search_flag, + (uchar*) max_key->key, + max_key->length); + end_pos= tree_record_pos(rb_tree, info->recbuf, max_key->flag, &custom_arg); } else @@ -100,12 +94,13 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key, (end_pos == start_pos ? (ha_rows) 1 : end_pos - start_pos)); } + /* Search after a record based on a key */ /* Sets info->current_ptr to found record */ /* next_flag: Search=0, next=1, prev =2, same =3 */ byte *hp_search(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *key, - uint nextflag) + uint nextflag) { reg1 HASH_INFO *pos,*prev_ptr; int flag; diff --git a/include/config-netware.h b/include/config-netware.h index 6a7f6291e26..c4e63056353 100644 --- a/include/config-netware.h +++ b/include/config-netware.h @@ -35,7 +35,7 @@ #include #include -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -45,12 +45,18 @@ extern "C" { #undef HAVE_SCHED_H #undef HAVE_SYS_MMAN_H #undef HAVE_SYNCH_H -#undef HAVE_CRYPT #define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 #define HAVE_PTHREAD_SIGMASK 1 #define HAVE_PTHREAD_YIELD_ZERO_ARG 1 #define HAVE_BROKEN_REALPATH 1 +/* no libc crypt() function */ +#ifdef HAVE_OPENSSL + #define HAVE_CRYPT 1 +#else + #undef HAVE_CRYPT +#endif /* HAVE_OPENSSL */ + /* include the old function apis */ #define USE_OLD_FUNCTIONS 1 @@ -66,6 +72,9 @@ extern "C" { /* signal by closing the sockets */ #define SIGNAL_WITH_VIO_CLOSE 1 +/* On NetWare, stack grows towards lower address*/ +#define STACK_DIRECTION -1 + /* default directory information */ #define DEFAULT_MYSQL_HOME "sys:/mysql" #define PACKAGE "mysql" @@ -87,15 +96,20 @@ extern "C" { /* do not use the extended time in LibC sys\stat.h */ #define _POSIX_SOURCE -/* kernal call on NetWare that will only yield if our time slice is up */ +/* Kernel call on NetWare that will only yield if our time slice is up */ void kYieldIfTimeSliceUp(void); -/* some macros for portability */ -#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=(SEC); (ABSTIME).tv_nsec=0; } +/* Some macros for portability */ -#ifdef __cplusplus +#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time(NULL)+(SEC); (ABSTIME).tv_nsec=0; } + +/* extra protection against CPU Hogs on NetWare */ +#define NETWARE_YIELD kYieldIfTimeSliceUp() +/* Screen mode for help texts */ +#define NETWARE_SET_SCREEN_MODE(A) setscreenmode(A) + +#ifdef __cplusplus } #endif #endif /* _config_netware_h */ - diff --git a/include/heap.h b/include/heap.h index c5f2be81fb7..63f2abbabc7 100644 --- a/include/heap.h +++ b/include/heap.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000,2004 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -107,6 +107,7 @@ typedef struct st_heap_share uint reclength; /* Length of one record */ uint changed; uint keys,max_key_length; + uint currently_disabled_keys; /* saved value from "keys" when disabled */ uint open_count; byte *del_link; /* Link to next block with del. rec */ my_string name; /* Name of "memory-file" */ @@ -176,12 +177,13 @@ extern int heap_rprev(HP_INFO *info,byte *record); extern int heap_rfirst(HP_INFO *info,byte *record,int inx); extern int heap_rlast(HP_INFO *info,byte *record,int inx); extern void heap_clear(HP_INFO *info); +extern void heap_clear_keys(HP_INFO *info); +extern int heap_disable_indexes(HP_INFO *info); +extern int heap_enable_indexes(HP_INFO *info); +extern int heap_indexes_are_disabled(HP_INFO *info); extern void heap_update_auto_increment(HP_INFO *info, const byte *record); -ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key, - uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key, uint end_key_len, - enum ha_rkey_function end_search_flag); +ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key, + key_range *max_key); int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key, uint key_len, enum ha_rkey_function find_flag); extern gptr heap_find(HP_INFO *info,int inx,const byte *key); diff --git a/include/help_end.h b/include/help_end.h new file mode 100644 index 00000000000..a63d9e7ca9f --- /dev/null +++ b/include/help_end.h @@ -0,0 +1,6 @@ +#ifdef __NETWARE__ +#undef printf +#undef puts +#undef fputs +#undef putchar +#endif diff --git a/include/help_start.h b/include/help_start.h new file mode 100644 index 00000000000..38bb91f7655 --- /dev/null +++ b/include/help_start.h @@ -0,0 +1,7 @@ +/* Divert all help information on NetWare to logger screen. */ + +#ifdef __NETWARE__ +#define printf consoleprintf +#define puts(s) consoleprintf("%s\n",s) +#define fputs(s,f) puts(s) +#endif diff --git a/include/m_ctype.h b/include/m_ctype.h index 9e69a3c8f91..9502805b017 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -188,7 +188,7 @@ typedef struct my_charset_handler_st } MY_CHARSET_HANDLER; extern MY_CHARSET_HANDLER my_charset_8bit_handler; - +extern MY_CHARSET_HANDLER my_charset_ucs2_handler; typedef struct charset_info_st @@ -204,6 +204,7 @@ typedef struct charset_info_st uchar *to_lower; uchar *to_upper; uchar *sort_order; + uint16 **sort_order_big; uint16 *tab_to_uni; MY_UNI_IDX *tab_from_uni; uchar state_map[256]; diff --git a/include/m_string.h b/include/m_string.h index c86801ae2d2..371e20d130f 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -238,6 +238,7 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error); #if SIZEOF_LONG == SIZEOF_LONG_LONG #define longlong2str(A,B,C) int2str((A),(B),(C)) #define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C)) +#undef strtoll #define strtoll(A,B,C) strtol((A),(B),(C)) #define strtoull(A,B,C) strtoul((A),(B),(C)) #ifndef HAVE_STRTOULL diff --git a/include/my_base.h b/include/my_base.h index 54c739bde23..f912cb4278c 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -191,7 +191,7 @@ enum ha_base_keytype { #define HA_UNIQUE_CHECK 256 /* Check the key for uniqueness */ #define HA_SPATIAL 1024 /* For spatial search */ #define HA_NULL_ARE_EQUAL 2048 /* NULL in key are cmp as equal */ - +#define HA_GENERATED_KEY 8192 /* Automaticly generated key */ /* Automatic bits in key-flag */ @@ -349,6 +349,16 @@ enum data_file_type { STATIC_RECORD,DYNAMIC_RECORD,COMPRESSED_RECORD }; +/* For key ranges */ + +typedef struct st_key_range +{ + const byte *key; + uint length; + enum ha_rkey_function flag; +} key_range; + + /* For number of records */ #ifdef BIG_TABLES #define rows2double(A) ulonglong2double(A) diff --git a/include/my_bitmap.h b/include/my_bitmap.h index 5b3da011f54..a4511bf3414 100644 --- a/include/my_bitmap.h +++ b/include/my_bitmap.h @@ -55,6 +55,12 @@ extern void bitmap_set_bit(MY_BITMAP *map, uint bitmap_bit); extern void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size); extern void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2); extern void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2); + +/* Fast, not thread safe, bitmap functions */ +#define bitmap_fast_set_bit(MAP, BIT) (MAP)->bitmap[(BIT) / 8] |= (1 << ((BIT) & 7)) +#define bitmap_fast_clear_bit(MAP, BIT) (MAP)->bitmap[(BIT) / 8] &= ~ (1 << ((BIT) & 7)) +#define bitmap_fast_is_set(MAP, BIT) (MAP)->bitmap[(BIT) / 8] & (1 << ((BIT) & 7)) + #ifdef __cplusplus } #endif diff --git a/include/my_global.h b/include/my_global.h index 760b196ca8d..af58139fb29 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -73,11 +73,10 @@ #endif #endif /* _WIN32... */ -/* extra protection against CPU Hogs on NetWare */ -#ifdef __NETWARE__ - #define NETWARE_YIELD { kYieldIfTimeSliceUp(); } -#else - #define NETWARE_YIELD { } +/* Some defines to avoid ifdefs in the code */ +#ifndef NETWARE_YIELD +#define NETWARE_YIELD +#define NETWARE_SET_SCREEN_MODE(A) #endif /* @@ -345,6 +344,9 @@ C_MODE_END #define USE_BMOVE512 1 /* Use this unless system bmove is faster */ #endif +#define QUOTE_ARG(x) #x /* Quote argument (before cpp) */ +#define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */ + /* Paranoid settings. Define I_AM_PARANOID if you are paranoid */ #ifdef I_AM_PARANOID #define DONT_ALLOW_USER_CHANGE 1 @@ -389,7 +391,7 @@ typedef unsigned short ushort; #define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1) #define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0) -#define swap(t,a,b) { register t dummy; dummy = a; a = b; b = dummy; } +#define swap_variables(t, a, b) { register t dummy; dummy= a; a= b; b= dummy; } #define test(a) ((a) ? 1 : 0) #define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0) #define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0) diff --git a/include/my_sys.h b/include/my_sys.h index 89dee5b713d..e05df3b6a07 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -770,6 +770,8 @@ extern char *get_charsets_dir(char *buf); extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2); extern my_bool init_compiled_charsets(myf flags); extern void add_compiled_collation(CHARSET_INFO *cs); +extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to, + const char *from, ulong length); #ifdef __WIN__ extern my_bool have_tcpip; /* Is set if tcpip is used */ diff --git a/include/myisam.h b/include/myisam.h index 93e2dc15574..c99e9a30b08 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -231,10 +231,7 @@ extern int mi_extra(struct st_myisam_info *file, enum ha_extra_function function, void *extra_arg); extern ha_rows mi_records_in_range(struct st_myisam_info *info,int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); + key_range *min_key, key_range *max_key); extern int mi_log(int activate_log); extern int mi_is_changed(struct st_myisam_info *info); extern int mi_delete_all_rows(struct st_myisam_info *info); diff --git a/include/myisammrg.h b/include/myisammrg.h index 8b09e1a9231..de8a36c2d0a 100644 --- a/include/myisammrg.h +++ b/include/myisammrg.h @@ -101,10 +101,7 @@ extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function, void *extra_arg); extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv); extern ha_rows myrg_records_in_range(MYRG_INFO *info,int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); + key_range *min_key, key_range *max_key); extern ulonglong myrg_position(MYRG_INFO *info); #ifdef __cplusplus diff --git a/include/mysql.h b/include/mysql.h index 537467336f8..51540a7d89f 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -188,10 +188,11 @@ struct st_mysql_options { my_bool secure_auth; /* function pointers for local infile support */ - int (*local_infile_init)(void **, const char *); + int (*local_infile_init)(void **, const char *, void *); int (*local_infile_read)(void *, char *, unsigned int); void (*local_infile_end)(void *); int (*local_infile_error)(void *, char *, unsigned int); + void *local_infile_userdata; }; enum mysql_status @@ -397,12 +398,14 @@ my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q, void mysql_set_local_infile_handler(MYSQL *mysql, - int (*local_infile_init)(void **, const char *), + int (*local_infile_init)(void **, const char *, + void *), int (*local_infile_read)(void *, char *, unsigned int), void (*local_infile_end)(void *), int (*local_infile_error)(void *, char*, - unsigned int)); + unsigned int), + void *); void mysql_set_local_infile_default(MYSQL *mysql); diff --git a/include/mysql_com.h b/include/mysql_com.h index 9604f4c0b59..b4947a64236 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -36,6 +36,12 @@ #define MYSQL_SERVICENAME "MySQL" #endif /* __WIN__ */ +#if defined(__WIN__) && !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT) && !defined(EMBEDDED_LIBRARY) +#define dll_import_spec __declspec( dllimport ) +#else +#define dll_import_spec +#endif + enum enum_server_command { COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, @@ -311,8 +317,8 @@ typedef struct st_udf_init extern "C" { #endif -extern unsigned long max_allowed_packet; -extern unsigned long net_buffer_length; +dll_import_spec extern unsigned long max_allowed_packet; +dll_import_spec extern unsigned long net_buffer_length; /* These functions are used for authentication by client and server and @@ -364,6 +370,6 @@ char *net_store_length(char *pkg, ulonglong length); #define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */ #define MYSQL_STMT_HEADER 4 -#define MYSQL_LONG_DATA_HEADER 6 +#define MYSQL_LONG_DATA_HEADER 6 #endif diff --git a/include/mysql_embed.h b/include/mysql_embed.h index 8e65087c566..603af8e83b8 100644 --- a/include/mysql_embed.h +++ b/include/mysql_embed.h @@ -30,7 +30,4 @@ #define DONT_USE_RAID -#undef MYSQL_SERVER_SUFFIX -#define MYSQL_SERVER_SUFFIX "-embedded" - #endif /* EMBEDDED_LIBRARY */ diff --git a/include/mysql_version.h.in b/include/mysql_version.h.in index c440c1298d4..dac7ca661d1 100644 --- a/include/mysql_version.h.in +++ b/include/mysql_version.h.in @@ -11,9 +11,7 @@ #define PROTOCOL_VERSION @PROTOCOL_VERSION@ #define MYSQL_SERVER_VERSION "@VERSION@" #define MYSQL_BASE_VERSION "mysqld-@MYSQL_BASE_VERSION@" -#ifndef MYSQL_SERVER_SUFFIX -#define MYSQL_SERVER_SUFFIX "@MYSQL_SERVER_SUFFIX@" -#endif +#define MYSQL_SERVER_SUFFIX_DEF "@MYSQL_SERVER_SUFFIX@" #define FRM_VER @DOT_FRM_VERSION@ #define MYSQL_VERSION_ID @MYSQL_VERSION_ID@ #define MYSQL_PORT @MYSQL_TCP_PORT@ @@ -25,7 +23,7 @@ #endif /* _CUSTOMCONFIG_ */ #ifndef LICENSE -#define LICENSE "GPL" +#define LICENSE GPL #endif /* LICENSE */ #endif /* _mysql_version_h */ diff --git a/include/thr_alarm.h b/include/thr_alarm.h index 0dbb700b4fc..7a10d6886ce 100644 --- a/include/thr_alarm.h +++ b/include/thr_alarm.h @@ -64,7 +64,7 @@ typedef my_bool ALARM; #define init_thr_alarm(A) #define thr_alarm_kill(A) #define resize_thr_alarm(N) -#define end_thr_alarm() +#define end_thr_alarm(A) #else #if defined(__WIN__) diff --git a/include/violite.h b/include/violite.h index e8f30288d34..b4b9f724d89 100644 --- a/include/violite.h +++ b/include/violite.h @@ -55,14 +55,8 @@ int vio_close_pipe(Vio * vio); void vio_delete(Vio* vio); int vio_close(Vio* vio); - -#ifdef EMBEDDED_LIBRARY -void vio_reset(Vio *vio); -#else -void vio_reset(Vio* vio, enum enum_vio_type type, - my_socket sd, HANDLE hPipe, my_bool localhost); -#endif - +void vio_reset(Vio* vio, enum enum_vio_type type, + my_socket sd, HANDLE hPipe, my_bool localhost); int vio_read(Vio *vio, gptr buf, int size); int vio_write(Vio *vio, const gptr buf, int size); int vio_blocking(Vio *vio, my_bool onoff, my_bool *old_mode); diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c index 8388009dc9c..09f5c66f687 100644 --- a/innobase/btr/btr0btr.c +++ b/innobase/btr/btr0btr.c @@ -883,7 +883,7 @@ btr_page_reorganize_low( fprintf(stderr, "InnoDB: Error: page old data size %lu new data size %lu\n" "InnoDB: Error: page old max ins size %lu new max ins size %lu\n" -"InnoDB: Make a detailed bug report and send it to mysql@lists.mysql.com\n", +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", (unsigned long) data_size1, (unsigned long) data_size2, (unsigned long) max_ins_size1, (unsigned long) max_ins_size2); diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c index e67d1d76113..5829cc2c406 100644 --- a/innobase/btr/btr0cur.c +++ b/innobase/btr/btr0cur.c @@ -399,7 +399,7 @@ btr_cur_search_to_nth_level( retry_page_get: page = buf_page_get_gen(space, page_no, rw_latch, guess, buf_mode, - IB__FILE__, __LINE__, + __FILE__, __LINE__, mtr); if (page == NULL) { /* This must be a search to perform an insert; @@ -580,7 +580,7 @@ btr_cur_open_at_index_side( for (;;) { page = buf_page_get_gen(space, page_no, RW_NO_LATCH, NULL, BUF_GET, - IB__FILE__, __LINE__, + __FILE__, __LINE__, mtr); ut_ad(0 == ut_dulint_cmp(tree->id, btr_page_get_index_id(page))); @@ -689,7 +689,7 @@ btr_cur_open_at_rnd_pos( for (;;) { page = buf_page_get_gen(space, page_no, RW_NO_LATCH, NULL, BUF_GET, - IB__FILE__, __LINE__, + __FILE__, __LINE__, mtr); ut_ad(0 == ut_dulint_cmp(tree->id, btr_page_get_index_id(page))); diff --git a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c index f2b03f9f348..9384168df88 100644 --- a/innobase/btr/btr0sea.c +++ b/innobase/btr/btr0sea.c @@ -764,7 +764,7 @@ btr_search_guess_on_hash( success = buf_page_get_known_nowait(latch_mode, page, BUF_MAKE_YOUNG, - IB__FILE__, __LINE__, + __FILE__, __LINE__, mtr); rw_lock_s_unlock(&btr_search_latch); @@ -1048,7 +1048,7 @@ btr_search_drop_page_hash_when_freed( having to fear a deadlock. */ page = buf_page_get_gen(space, page_no, RW_S_LATCH, NULL, - BUF_GET_IF_IN_POOL, IB__FILE__, __LINE__, + BUF_GET_IF_IN_POOL, __FILE__, __LINE__, &mtr); #ifdef UNIV_SYNC_DEBUG diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c index 7a5ef3c5e14..4d83fb4c9f2 100644 --- a/innobase/buf/buf0buf.c +++ b/innobase/buf/buf0buf.c @@ -1048,7 +1048,7 @@ buf_page_get_gen( buf_frame_t* guess, /* in: guessed frame or NULL */ ulint mode, /* in: BUF_GET, BUF_GET_IF_IN_POOL, BUF_GET_NO_LATCH, BUF_GET_NOWAIT */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line where called */ mtr_t* mtr) /* in: mini-transaction */ { @@ -1257,7 +1257,7 @@ buf_page_optimistic_get_func( frames */ dulint modify_clock,/* in: modify clock value if mode is ..._GUESS_ON_CLOCK */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line where called */ mtr_t* mtr) /* in: mini-transaction */ { @@ -1382,7 +1382,7 @@ buf_page_get_known_nowait( ulint rw_latch,/* in: RW_S_LATCH, RW_X_LATCH */ buf_frame_t* guess, /* in: the known page frame */ ulint mode, /* in: BUF_MAKE_YOUNG or BUF_KEEP_OLD */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line where called */ mtr_t* mtr) /* in: mini-transaction */ { @@ -1742,7 +1742,7 @@ buf_page_create( buf_LRU_add_block(block, FALSE); #ifdef UNIV_SYNC_DEBUG - buf_block_buf_fix_inc_debug(block, IB__FILE__, __LINE__); + buf_block_buf_fix_inc_debug(block, __FILE__, __LINE__); #else buf_block_buf_fix_inc(block); #endif diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index b22d93d6bd8..6a6ac2492f8 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -70,7 +70,7 @@ dict_col_reposition_in_cache( /*=========================*/ dict_table_t* table, /* in: table */ dict_col_t* col, /* in: column */ - char* new_name); /* in: new table name */ + const char* new_name); /* in: new table name */ /************************************************************************** Removes a column from the data dictionary hash table. */ static @@ -309,7 +309,7 @@ dict_table_get_index_noninline( /*===========================*/ /* out: index, NULL if does not exist */ dict_table_t* table, /* in: table */ - char* name) /* in: index name */ + const char* name) /* in: index name */ { return(dict_table_get_index(table, name)); } @@ -693,9 +693,10 @@ directory dict_table_get_low is usually the appropriate function. */ dict_table_t* dict_table_get( /*===========*/ - /* out: table, NULL if does not exist */ - char* table_name, /* in: table name */ - trx_t* trx) /* in: transaction handle or NULL */ + /* out: table, NULL if + does not exist */ + const char* table_name, /* in: table name */ + trx_t* trx) /* in: transaction handle or NULL */ { dict_table_t* table; @@ -722,9 +723,10 @@ Returns a table object and increments MySQL open handle count on the table. */ dict_table_t* dict_table_get_and_increment_handle_count( /*======================================*/ - /* out: table, NULL if does not exist */ - char* table_name, /* in: table name */ - trx_t* trx) /* in: transaction handle or NULL */ + /* out: table, NULL if + does not exist */ + const char* table_name, /* in: table name */ + trx_t* trx) /* in: transaction handle or NULL */ { dict_table_t* table; @@ -886,7 +888,7 @@ dict_table_rename_in_cache( /*=======================*/ /* out: TRUE if success */ dict_table_t* table, /* in: table */ - char* new_name, /* in: new name */ + const char* new_name, /* in: new name */ ibool rename_also_foreigns)/* in: in ALTER TABLE we want to preserve the original table name in constraints which reference it */ @@ -1294,7 +1296,7 @@ dict_col_reposition_in_cache( /*=========================*/ dict_table_t* table, /* in: table */ dict_col_t* col, /* in: column */ - char* new_name) /* in: new table name */ + const char* new_name) /* in: new table name */ { ulint fold; @@ -2019,7 +2021,7 @@ dict_foreign_find_index( column types must match */ { dict_index_t* index; - char* col_name; + const char* col_name; ulint i; index = dict_table_get_first_index(table); @@ -2564,14 +2566,14 @@ static char* dict_strip_comments( /*================*/ - /* out, own: SQL string stripped from - comments; the caller must free this - with mem_free()! */ - char* sql_string) /* in: SQL string */ + /* out, own: SQL string stripped from + comments; the caller must free this + with mem_free()! */ + const char* sql_string) /* in: SQL string */ { - char* str; - char* sptr; - char* ptr; + char* str; + const char* sptr; + char* ptr; str = mem_alloc(strlen(sql_string) + 1); @@ -2970,7 +2972,8 @@ col_loop1: } foreign->foreign_table = table; - foreign->foreign_table_name = table->name; + foreign->foreign_table_name = mem_heap_strdup(foreign->heap, + table->name); foreign->foreign_index = index; foreign->n_fields = i; foreign->foreign_col_names = mem_heap_alloc(foreign->heap, @@ -3244,16 +3247,19 @@ allowed to contain more fields than mentioned in the constraint. */ ulint dict_create_foreign_constraints( /*============================*/ - /* out: error code or DB_SUCCESS */ - trx_t* trx, /* in: transaction */ - char* sql_string, /* in: table create or ALTER TABLE - statement where foreign keys are declared like: - FOREIGN KEY (a, b) REFERENCES table2(c, d), - table2 can be written also with the database - name before it: test.table2; the default - database is the database of parameter name */ - char* name) /* in: table full name in the normalized form - database_name/table_name */ + /* out: error code or DB_SUCCESS */ + trx_t* trx, /* in: transaction */ + const char* sql_string, /* in: table create statement where + foreign keys are declared like: + FOREIGN KEY (a, b) REFERENCES + table2(c, d), table2 can be written + also with the database + name before it: test.table2; the + default database id the database of + parameter name */ + const char* name) /* in: table full name in the + normalized form + database_name/table_name */ { char* str; ulint err; @@ -4287,5 +4293,5 @@ dict_index_name_print( fputs("index ", file); ut_print_name(file, index->name); fputs(" of table ", file); - ut_print_name(stderr, index->table_name); + ut_print_name(file, index->table_name); } diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index abb06b15ea7..071a3b4c684 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -27,9 +27,10 @@ Finds the first table name in the given database. */ char* dict_get_first_table_name_in_db( /*============================*/ - /* out, own: table name, NULL if does not exist; - the caller must free the memory in the string! */ - char* name) /* in: database name which ends to '/' */ + /* out, own: table name, NULL if + does not exist; the caller must + free the memory in the string! */ + const char* name) /* in: database name which ends to '/' */ { dict_table_t* sys_tables; btr_pcur_t pcur; @@ -389,8 +390,8 @@ Report that an index field or index for a table has been delete marked. */ static void dict_load_report_deleted_index( - char* name, /* in: table name */ - ulint field) /* in: index field, or ULINT_UNDEFINED */ + const char* name, /* in: table name */ + ulint field) /* in: index field, or ULINT_UNDEFINED */ { fputs("InnoDB: Error: data dictionary entry" " for table ", stderr); @@ -688,12 +689,13 @@ dictionary cache. */ dict_table_t* dict_load_table( /*============*/ - /* out: table, NULL if does not exist; if the table is - stored in an .ibd file, but the file does not exist, - then we set the ibd_file_missing flag TRUE in the table - object we return */ - char* name) /* in: table name in the databasename/tablename - format */ + /* out: table, NULL if does not exist; + if the table is stored in an .ibd file, + but the file does not exist, + then we set the ibd_file_missing flag TRUE + in the table object we return */ + const char* name) /* in: table name in the + databasename/tablename format */ { ibool ibd_file_missing = FALSE; dict_table_t* table; @@ -849,7 +851,7 @@ dict_load_table( "InnoDB: the foreign key table or the referenced table!\n" "InnoDB: The data dictionary of InnoDB is corrupt. You may need to drop\n" "InnoDB: and recreate the foreign key table or the referenced table.\n" -"InnoDB: Send a detailed bug report to mysql@lists.mysql.com\n" +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n" "InnoDB: Latest foreign key error printout:\n%s\n", dict_foreign_err_buf); mutex_exit(&dict_foreign_err_mutex); @@ -1185,8 +1187,8 @@ already in the dictionary cache. */ ulint dict_load_foreigns( /*===============*/ - /* out: DB_SUCCESS or error code */ - char* table_name) /* in: table name */ + /* out: DB_SUCCESS or error code */ + const char* table_name) /* in: table name */ { btr_pcur_t pcur; mem_heap_t* heap; diff --git a/innobase/dict/dict0mem.c b/innobase/dict/dict0mem.c index a4f83ddd657..936b06b1905 100644 --- a/innobase/dict/dict0mem.c +++ b/innobase/dict/dict0mem.c @@ -30,15 +30,14 @@ dict_table_t* dict_mem_table_create( /*==================*/ /* out, own: table object */ - char* name, /* in: table name */ - ulint space, /* in: space where the clustered index of + const char* name, /* in: table name */ + ulint space, /* in: space where the clustered index of the table is placed; this parameter is ignored if the table is made a member of a cluster */ - ulint n_cols) /* in: number of columns */ + ulint n_cols) /* in: number of columns */ { dict_table_t* table; - char* str; mem_heap_t* heap; ut_ad(name); @@ -48,11 +47,9 @@ dict_mem_table_create( table = mem_heap_alloc(heap, sizeof(dict_table_t)); table->heap = heap; - - str = mem_heap_strdup(heap, name); table->type = DICT_TABLE_ORDINARY; - table->name = str; + table->name = mem_heap_strdup(heap, name); table->space = space; table->ibd_file_missing = FALSE; table->tablespace_discarded = FALSE; @@ -103,11 +100,11 @@ dict_table_t* dict_mem_cluster_create( /*====================*/ /* out, own: cluster object */ - char* name, /* in: cluster name */ - ulint space, /* in: space where the clustered indexes + const char* name, /* in: cluster name */ + ulint space, /* in: space where the clustered indexes of the member tables are placed */ - ulint n_cols, /* in: number of columns */ - ulint mix_len) /* in: length of the common key prefix in the + ulint n_cols, /* in: number of columns */ + ulint mix_len)/* in: length of the common key prefix in the cluster */ { dict_table_t* cluster; @@ -127,7 +124,7 @@ void dict_mem_table_make_cluster_member( /*===============================*/ dict_table_t* table, /* in: non-published table */ - char* cluster_name) /* in: cluster name */ + const char* cluster_name) /* in: cluster name */ { table->type = DICT_TABLE_CLUSTER_MEMBER; table->cluster_name = cluster_name; @@ -140,7 +137,7 @@ void dict_mem_table_add_col( /*===================*/ dict_table_t* table, /* in: table */ - char* name, /* in: column name */ + const char* name, /* in: column name */ ulint mtype, /* in: main datatype */ ulint prtype, /* in: precise type */ ulint len, /* in: length */ @@ -174,14 +171,15 @@ Creates an index memory object. */ dict_index_t* dict_mem_index_create( /*==================*/ - /* out, own: index object */ - char* table_name, /* in: table name */ - char* index_name, /* in: index name */ - ulint space, /* in: space where the index tree is placed, - ignored if the index is of the clustered - type */ - ulint type, /* in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed */ - ulint n_fields) /* in: number of fields */ + /* out, own: index object */ + const char* table_name, /* in: table name */ + const char* index_name, /* in: index name */ + ulint space, /* in: space where the index tree is + placed, ignored if the index is of + the clustered type */ + ulint type, /* in: DICT_UNIQUE, + DICT_CLUSTERED, ... ORed */ + ulint n_fields) /* in: number of fields */ { dict_index_t* index; mem_heap_t* heap; @@ -259,7 +257,7 @@ void dict_mem_index_add_field( /*=====================*/ dict_index_t* index, /* in: index */ - char* name, /* in: column name */ + const char* name, /* in: column name */ ulint order, /* in: order criterion; 0 means an ascending order */ ulint prefix_len) /* in: 0 or the column prefix length diff --git a/innobase/eval/eval0eval.c b/innobase/eval/eval0eval.c index a3cd60b86ae..ebb6cb1b7d9 100644 --- a/innobase/eval/eval0eval.c +++ b/innobase/eval/eval0eval.c @@ -725,7 +725,7 @@ eval_predefined( uint_val = (ulint) int_val; } for (tmp = int_len; uint_val > 0; uint_val /= 10) { - data[--tmp] = '0' + (byte)(uint_val % 10); + data[--tmp] = (byte) ('0' + (byte)(uint_val % 10)); } } diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index b9aff246802..28eea0ba188 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -390,11 +390,12 @@ Appends a new file to the chain of files of a space. File must be closed. */ void fil_node_create( /*============*/ - char* name, /* in: file name (file must be closed) */ - ulint size, /* in: file size in database blocks, rounded downwards - to an integer */ - ulint id, /* in: space id where to append */ - ibool is_raw) /* in: TRUE if a raw device or a raw disk partition */ + const char* name, /* in: file name (file must be closed) */ + ulint size, /* in: file size in database blocks, rounded + downwards to an integer */ + ulint id, /* in: space id where to append */ + ibool is_raw) /* in: TRUE if a raw device or + a raw disk partition */ { fil_system_t* system = fil_system; fil_node_t* node; @@ -804,10 +805,10 @@ there is an error, prints an error message to the .err log. */ ibool fil_space_create( /*=============*/ - /* out: TRUE if success */ - char* name, /* in: space name */ - ulint id, /* in: space id */ - ulint purpose)/* in: FIL_TABLESPACE, or FIL_LOG if log */ + /* out: TRUE if success */ + const char* name, /* in: space name */ + ulint id, /* in: space id */ + ulint purpose)/* in: FIL_TABLESPACE, or FIL_LOG if log */ { fil_system_t* system = fil_system; fil_space_t* space; @@ -1542,16 +1543,18 @@ static void fil_op_write_log( /*=============*/ - ulint type, /* in: MLOG_FILE_CREATE, MLOG_FILE_DELETE, or - MLOG_FILE_RENAME */ - ulint space_id, /* in: space id */ - char* name, /* in: table name in the familiar - 'databasename/tablename' format, or the file - path in the case of MLOG_FILE_DELETE */ - char* new_name, /* in: if type is MLOG_FILE_RENAME, the new - table name in the 'databasename/tablename' - format */ - mtr_t* mtr) /* in: mini-transaction handle */ + ulint type, /* in: MLOG_FILE_CREATE, + MLOG_FILE_DELETE, or + MLOG_FILE_RENAME */ + ulint space_id, /* in: space id */ + const char* name, /* in: table name in the familiar + 'databasename/tablename' format, or + the file path in the case of + MLOG_FILE_DELETE */ + const char* new_name, /* in: if type is MLOG_FILE_RENAME, + the new table name in the + 'databasename/tablename' format */ + mtr_t* mtr) /* in: mini-transaction handle */ { byte* log_ptr; @@ -1960,14 +1963,15 @@ tablespace memory cache. */ ibool fil_rename_tablespace( /*==================*/ - /* out: TRUE if success */ - char* old_name, /* in: old table name in the standard - databasename/tablename format of InnoDB, or - NULL if we do the rename based on the space - id only */ - ulint id, /* in: space id */ - char* new_name) /* in: new table name in the standard - databasename/tablename format of InnoDB */ + /* out: TRUE if success */ + const char* old_name, /* in: old table name in the standard + databasename/tablename format of + InnoDB, or NULL if we do the rename + based on the space id only */ + ulint id, /* in: space id */ + const char* new_name) /* in: new table name in the standard + databasename/tablename format + of InnoDB */ { fil_system_t* system = fil_system; ibool success; @@ -2124,15 +2128,16 @@ path '.'. */ ulint fil_create_new_single_table_tablespace( /*===================================*/ - /* out: DB_SUCCESS or error code */ - ulint* space_id, /* in/out: space id; if this is != 0, then - this is an input parameter, otherwise - output */ - char* tablename, /* in: the table name in the usual - databasename/tablename format of InnoDB */ - ulint size) /* in: the initial size of the tablespace file - in pages, must be >= FIL_IBD_FILE_INITIAL_SIZE - */ + /* out: DB_SUCCESS or error code */ + ulint* space_id, /* in/out: space id; if this is != 0, + then this is an input parameter, + otherwise output */ + const char* tablename, /* in: the table name in the usual + databasename/tablename format + of InnoDB */ + ulint size) /* in: the initial size of the + tablespace file in pages, + must be >= FIL_IBD_FILE_INITIAL_SIZE */ { os_file_t file; ibool ret; @@ -2293,12 +2298,12 @@ lsn's just by looking at that flush lsn. */ ibool fil_reset_too_high_lsns( /*====================*/ - /* out: TRUE if success */ - char* name, /* in: table name in the databasename/tablename - format */ - dulint current_lsn) /* in: reset lsn's if the lsn stamped to - FIL_PAGE_FILE_FLUSH_LSN in the first page is - too high */ + /* out: TRUE if success */ + const char* name, /* in: table name in the + databasename/tablename format */ + dulint current_lsn) /* in: reset lsn's if the lsn stamped + to FIL_PAGE_FILE_FLUSH_LSN in the + first page is too high */ { os_file_t file; char* filepath; @@ -2433,10 +2438,10 @@ closes it after we have looked at the space id in it. */ ibool fil_open_single_table_tablespace( /*=============================*/ - /* out: TRUE if success */ - ulint id, /* in: space id */ - char* name) /* in: table name in the databasename/tablename - format */ + /* out: TRUE if success */ + ulint id, /* in: space id */ + const char* name) /* in: table name in the + databasename/tablename format */ { os_file_t file; char* filepath; @@ -2937,20 +2942,22 @@ there may be many tablespaces which are not yet in the memory cache. */ ibool fil_space_for_table_exists_in_mem( /*==============================*/ - /* out: TRUE if a matching tablespace exists - in the memory cache */ - ulint id, /* in: space id */ - char* name, /* in: table name in the standard - 'databasename/tablename' format */ - ibool mark_space, /* in: in crash recovery, at database startup - we mark all spaces which have an associated - table in the InnoDB data dictionary, so that - we can print a warning about orphaned - tablespaces */ - ibool print_error_if_does_not_exist) - /* in: print detailed error information to - the .err log if a matching tablespace is - not found from memory */ + /* out: TRUE if a matching tablespace + exists in the memory cache */ + ulint id, /* in: space id */ + const char* name, /* in: table name in the standard + 'databasename/tablename' format */ + ibool mark_space, /* in: in crash recovery, at database + startup we mark all spaces which have + an associated table in the InnoDB + data dictionary, so that + we can print a warning about orphaned + tablespaces */ + ibool print_error_if_does_not_exist) + /* in: print detailed error + information to the .err log if a + matching tablespace is not found from + memory */ { fil_system_t* system = fil_system; fil_space_t* namespace; diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c index ecdcf08e4c6..9246bb03138 100644 --- a/innobase/ibuf/ibuf0ibuf.c +++ b/innobase/ibuf/ibuf0ibuf.c @@ -2770,7 +2770,7 @@ ibuf_insert_to_index_page( fprintf(stderr, "Bitmap bits %lu\n", (ulong) old_bits); fputs( -"InnoDB: Send a detailed bug report to mysql@lists.mysql.com!\n", stderr); +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr); } } } @@ -2833,7 +2833,7 @@ ibuf_delete_rec( if (!success) { fprintf(stderr, - "InnoDB: ERROR: Send the output to mysql@lists.mysql.com\n" + "InnoDB: ERROR: Submit the output to http://bugs.mysql.com\n" "InnoDB: ibuf cursor restoration fails!\n" "InnoDB: ibuf record inserted to page %lu\n", (ulong) page_no); fflush(stderr); @@ -3025,8 +3025,7 @@ ibuf_merge_or_delete_for_page( "InnoDB: We try to resolve the problem by skipping the insert buffer\n" "InnoDB: merge for this page. Please run CHECK TABLE on your tables\n" "InnoDB: to determine if they are corrupt after this.\n\n" -"InnoDB: Please make a detailed bug report and send it to\n" -"InnoDB: mysql@lists.mysql.com\n\n", +"InnoDB: Please submit a detailed bug report to http://bugs.mysql.com\n\n", (ulong) page_no, (ulong) fil_page_get_type(page)); } @@ -3042,7 +3041,7 @@ loop: if (page) { ibool success = buf_page_get_known_nowait(RW_X_LATCH, page, BUF_KEEP_OLD, - IB__FILE__, __LINE__, + __FILE__, __LINE__, &mtr); ut_a(success); #ifdef UNIV_SYNC_DEBUG diff --git a/innobase/include/Makefile.am b/innobase/include/Makefile.am index 2584357e24a..5ec70da97a2 100644 --- a/innobase/include/Makefile.am +++ b/innobase/include/Makefile.am @@ -32,7 +32,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \ mem0dbg.h mem0dbg.ic mem0mem.h mem0mem.ic mem0pool.h \ mem0pool.ic mtr0log.h mtr0log.ic mtr0mtr.h mtr0mtr.ic \ mtr0types.h os0file.h os0proc.h os0proc.ic \ - os0shm.h os0shm.ic os0sync.h os0sync.ic os0thread.h \ + os0sync.h os0sync.ic os0thread.h \ os0thread.ic page0cur.h page0cur.ic page0page.h \ page0page.ic page0types.h pars0grm.h pars0opt.h \ pars0opt.ic pars0pars.h pars0pars.ic pars0sym.h \ @@ -43,8 +43,8 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \ row0purge.ic row0row.h row0row.ic row0sel.h row0sel.ic \ row0types.h row0uins.h row0uins.ic row0umod.h row0umod.ic \ row0undo.h row0undo.ic row0upd.h row0upd.ic row0vers.h \ - row0vers.ic srv0que.h srv0srv.h srv0srv.ic srv0start.h \ - sync0arr.h sync0arr.ic sync0ipm.h sync0ipm.ic sync0rw.h \ + row0vers.ic srv0srv.h srv0srv.ic srv0start.h \ + sync0arr.h sync0arr.ic sync0rw.h \ sync0rw.ic sync0sync.h sync0sync.ic sync0types.h \ thr0loc.h thr0loc.ic trx0purge.h trx0purge.ic trx0rec.h \ trx0rec.ic trx0roll.h trx0roll.ic trx0rseg.h trx0rseg.ic \ diff --git a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h index 6b8da886045..9590fea1276 100644 --- a/innobase/include/buf0buf.h +++ b/innobase/include/buf0buf.h @@ -132,7 +132,7 @@ to improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed in LA! */ #define buf_page_get(SP, OF, LA, MTR) buf_page_get_gen(\ SP, OF, LA, NULL,\ - BUF_GET, IB__FILE__, __LINE__, MTR) + BUF_GET, __FILE__, __LINE__, MTR) /****************************************************************** Use these macros to bufferfix a page with no latching. Remember not to read the contents of the page unless you know it is safe. Do not modify @@ -141,19 +141,19 @@ error-prone programming not to set a latch, and it should be used with care. */ #define buf_page_get_with_no_latch(SP, OF, MTR) buf_page_get_gen(\ SP, OF, RW_NO_LATCH, NULL,\ - BUF_GET_NO_LATCH, IB__FILE__, __LINE__, MTR) + BUF_GET_NO_LATCH, __FILE__, __LINE__, MTR) /****************************************************************** NOTE! The following macros should be used instead of buf_page_get_gen, to improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed as LA! */ #define buf_page_get_nowait(SP, OF, LA, MTR) buf_page_get_gen(\ SP, OF, LA, NULL,\ - BUF_GET_NOWAIT, IB__FILE__, __LINE__, MTR) + BUF_GET_NOWAIT, __FILE__, __LINE__, MTR) /****************************************************************** NOTE! The following macros should be used instead of buf_page_optimistic_get_func, to improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed as LA! */ #define buf_page_optimistic_get(LA, BL, G, MC, MTR) buf_page_optimistic_get_func(\ - LA, BL, G, MC, IB__FILE__, __LINE__, MTR) + LA, BL, G, MC, __FILE__, __LINE__, MTR) /************************************************************************ This is the general function used to get optimistic access to a database page. */ @@ -168,7 +168,7 @@ buf_page_optimistic_get_func( frames */ dulint modify_clock,/* in: modify clock value if mode is ..._GUESS_ON_CLOCK */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line where called */ mtr_t* mtr); /* in: mini-transaction */ /************************************************************************ @@ -201,7 +201,7 @@ buf_page_get_known_nowait( ulint rw_latch,/* in: RW_S_LATCH, RW_X_LATCH */ buf_frame_t* guess, /* in: the known page frame */ ulint mode, /* in: BUF_MAKE_YOUNG or BUF_KEEP_OLD */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line where called */ mtr_t* mtr); /* in: mini-transaction */ /************************************************************************ @@ -217,7 +217,7 @@ buf_page_get_gen( buf_frame_t* guess, /* in: guessed frame or NULL */ ulint mode, /* in: BUF_GET, BUF_GET_IF_IN_POOL, BUF_GET_NO_LATCH */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line where called */ mtr_t* mtr); /* in: mini-transaction */ /************************************************************************ diff --git a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic index b644afcbdff..4d1173a0d7f 100644 --- a/innobase/include/buf0buf.ic +++ b/innobase/include/buf0buf.ic @@ -585,7 +585,7 @@ buf_page_get_release_on_io( frame = buf_page_get_gen(space, offset, rw_latch, guess, BUF_GET_IF_IN_POOL, - IB__FILE__, __LINE__, + __FILE__, __LINE__, mtr); if (frame != NULL) { diff --git a/innobase/include/data0data.h b/innobase/include/data0data.h index 99d3c297039..e2de13d0520 100644 --- a/innobase/include/data0data.h +++ b/innobase/include/data0data.h @@ -86,7 +86,7 @@ void dfield_set_data( /*============*/ dfield_t* field, /* in: field */ - void* data, /* in: data */ + const void* data, /* in: data */ ulint len); /* in: length or UNIV_SQL_NULL */ /************************************************************************** Writes an SQL null field full of zeros. */ diff --git a/innobase/include/data0data.ic b/innobase/include/data0data.ic index 697a272ccd6..0769372e16f 100644 --- a/innobase/include/data0data.ic +++ b/innobase/include/data0data.ic @@ -93,12 +93,12 @@ void dfield_set_data( /*============*/ dfield_t* field, /* in: field */ - void* data, /* in: data */ + const void* data, /* in: data */ ulint len) /* in: length or UNIV_SQL_NULL */ { ut_ad(field); - field->data = data; + field->data = (void*) data; field->len = len; } diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h index 98636f6e1cb..fe04359d6f1 100644 --- a/innobase/include/dict0dict.h +++ b/innobase/include/dict0dict.h @@ -166,7 +166,7 @@ dict_table_rename_in_cache( /*=======================*/ /* out: TRUE if success */ dict_table_t* table, /* in: table */ - char* new_name, /* in: new name */ + const char* new_name, /* in: new name */ ibool rename_also_foreigns);/* in: in ALTER TABLE we want to preserve the original table name in constraints which reference it */ @@ -210,16 +210,19 @@ fields than mentioned in the constraint. */ ulint dict_create_foreign_constraints( /*============================*/ - /* out: error code or DB_SUCCESS */ - trx_t* trx, /* in: transaction */ - char* sql_string, /* in: table create statement where - foreign keys are declared like: - FOREIGN KEY (a, b) REFERENCES table2(c, d), - table2 can be written also with the database - name before it: test.table2; the default - database id the database of parameter name */ - char* name); /* in: table full name in the normalized form - database_name/table_name */ + /* out: error code or DB_SUCCESS */ + trx_t* trx, /* in: transaction */ + const char* sql_string, /* in: table create statement where + foreign keys are declared like: + FOREIGN KEY (a, b) REFERENCES + table2(c, d), table2 can be written + also with the database + name before it: test.table2; the + default database id the database of + parameter name */ + const char* name); /* in: table full name in the + normalized form + database_name/table_name */ /************************************************************************** Parses the CONSTRAINT id's to be dropped in an ALTER TABLE statement. */ @@ -246,9 +249,10 @@ directory dict_table_get_low is usually the appropriate function. */ dict_table_t* dict_table_get( /*===========*/ - /* out: table, NULL if does not exist */ - char* table_name, /* in: table name */ - trx_t* trx); /* in: transaction handle */ + /* out: table, NULL if + does not exist */ + const char* table_name, /* in: table name */ + trx_t* trx); /* in: transaction handle */ /************************************************************************** Returns a table object and increments MySQL open handle count on the table. */ @@ -256,9 +260,10 @@ Returns a table object and increments MySQL open handle count on the table. dict_table_t* dict_table_get_and_increment_handle_count( /*======================================*/ - /* out: table, NULL if does not exist */ - char* table_name, /* in: table name */ - trx_t* trx); /* in: transaction handle or NULL */ + /* out: table, NULL if + does not exist */ + const char* table_name, /* in: table name */ + trx_t* trx); /* in: transaction handle or NULL */ /************************************************************************** Returns a table object, based on table id, and memoryfixes it. */ @@ -290,8 +295,8 @@ UNIV_INLINE dict_table_t* dict_table_check_if_in_cache_low( /*==============================*/ - /* out: table, NULL if not found */ - char* table_name); /* in: table name */ + /* out: table, NULL if not found */ + const char* table_name); /* in: table name */ /************************************************************************** Gets a table; loads it to the dictionary cache if necessary. A low-level function. */ @@ -299,8 +304,8 @@ UNIV_INLINE dict_table_t* dict_table_get_low( /*===============*/ - /* out: table, NULL if not found */ - char* table_name); /* in: table name */ + /* out: table, NULL if not found */ + const char* table_name); /* in: table name */ /************************************************************************** Returns an index object. */ UNIV_INLINE @@ -309,7 +314,7 @@ dict_table_get_index( /*=================*/ /* out: index, NULL if does not exist */ dict_table_t* table, /* in: table */ - char* name); /* in: index name */ + const char* name); /* in: index name */ /************************************************************************** Returns an index object. */ @@ -318,7 +323,7 @@ dict_table_get_index_noninline( /*===========================*/ /* out: index, NULL if does not exist */ dict_table_t* table, /* in: table */ - char* name); /* in: index name */ + const char* name); /* in: index name */ /************************************************************************** Prints a table data. */ @@ -340,7 +345,7 @@ Prints a table data when we know the table name. */ void dict_table_print_by_name( /*=====================*/ - char* name); + const char* name); #endif /* UNIV_DEBUG */ /************************************************************************** Outputs info on foreign keys of a table. */ diff --git a/innobase/include/dict0dict.ic b/innobase/include/dict0dict.ic index 57ef4b896f5..0f7cc8973db 100644 --- a/innobase/include/dict0dict.ic +++ b/innobase/include/dict0dict.ic @@ -536,8 +536,8 @@ UNIV_INLINE dict_table_t* dict_table_check_if_in_cache_low( /*==============================*/ - /* out: table, NULL if not found */ - char* table_name) /* in: table name */ + /* out: table, NULL if not found */ + const char* table_name) /* in: table name */ { dict_table_t* table; ulint table_fold; @@ -562,8 +562,8 @@ UNIV_INLINE dict_table_t* dict_table_get_low( /*===============*/ - /* out: table, NULL if not found */ - char* table_name) /* in: table name */ + /* out: table, NULL if not found */ + const char* table_name) /* in: table name */ { dict_table_t* table; @@ -642,7 +642,7 @@ dict_table_get_index( /*=================*/ /* out: index, NULL if does not exist */ dict_table_t* table, /* in: table */ - char* name) /* in: index name */ + const char* name) /* in: index name */ { dict_index_t* index = NULL; diff --git a/innobase/include/dict0load.h b/innobase/include/dict0load.h index f7168a0f45f..d4dccb33373 100644 --- a/innobase/include/dict0load.h +++ b/innobase/include/dict0load.h @@ -31,9 +31,10 @@ Finds the first table name in the given database. */ char* dict_get_first_table_name_in_db( /*============================*/ - /* out, own: table name, NULL if does not exist; - the caller must free the memory in the string! */ - char* name); /* in: database name which ends to '/' */ + /* out, own: table name, NULL if + does not exist; the caller must free + the memory in the string! */ + const char* name); /* in: database name which ends to '/' */ /************************************************************************ Loads a table definition and also all its index definitions, and also the cluster definition if the table is a member in a cluster. Also loads @@ -43,11 +44,13 @@ a foreign key references columns in this table. */ dict_table_t* dict_load_table( /*============*/ - /* out: table, NULL if does not exist; if the table is - stored in an .ibd file, but the file does not exist, - then we set the ibd_file_missing flag TRUE in the table - object we return */ - char* name); /* in: table name */ + /* out: table, NULL if does not exist; + if the table is stored in an .ibd file, + but the file does not exist, + then we set the ibd_file_missing flag TRUE + in the table object we return */ + const char* name); /* in: table name in the + databasename/tablename format */ /*************************************************************************** Loads a table object based on the table id. */ @@ -75,8 +78,8 @@ already in the dictionary cache. */ ulint dict_load_foreigns( /*===============*/ - /* out: DB_SUCCESS or error code */ - char* table_name); /* in: table name */ + /* out: DB_SUCCESS or error code */ + const char* table_name); /* in: table name */ /************************************************************************ Prints to the standard output information on all tables found in the data dictionary system table. */ diff --git a/innobase/include/dict0mem.h b/innobase/include/dict0mem.h index 674868c9fce..f141ea9da09 100644 --- a/innobase/include/dict0mem.h +++ b/innobase/include/dict0mem.h @@ -48,27 +48,28 @@ Creates a table memory object. */ dict_table_t* dict_mem_table_create( /*==================*/ - /* out, own: table object */ - char* name, /* in: table name */ - ulint space, /* in: space where the clustered index of - the table is placed; this parameter is - ignored if the table is made a member of - a cluster */ - ulint n_cols); /* in: number of columns */ + /* out, own: table object */ + const char* name, /* in: table name */ + ulint space, /* in: space where the clustered index + of the table is placed; this parameter + is ignored if the table is made + a member of a cluster */ + ulint n_cols); /* in: number of columns */ /************************************************************************** Creates a cluster memory object. */ dict_cluster_t* dict_mem_cluster_create( /*====================*/ - /* out, own: cluster object (where the type - dict_cluster_t == dict_table_t) */ - char* name, /* in: cluster name */ - ulint space, /* in: space where the clustered indexes - of the member tables are placed */ - ulint n_cols, /* in: number of columns */ - ulint mix_len); /* in: length of the common key prefix in the - cluster */ + /* out, own: cluster object (where the + type dict_cluster_t == dict_table_t) */ + const char* name, /* in: cluster name */ + ulint space, /* in: space where the clustered + indexes of the member tables are + placed */ + ulint n_cols, /* in: number of columns */ + ulint mix_len); /* in: length of the common key prefix + in the cluster */ /************************************************************************** Declares a non-published table as a member in a cluster. */ @@ -76,7 +77,7 @@ void dict_mem_table_make_cluster_member( /*===============================*/ dict_table_t* table, /* in: non-published table */ - char* cluster_name); /* in: cluster name */ + const char* cluster_name); /* in: cluster name */ /************************************************************************** Adds a column definition to a table. */ @@ -84,7 +85,7 @@ void dict_mem_table_add_col( /*===================*/ dict_table_t* table, /* in: table */ - char* name, /* in: column name */ + const char* name, /* in: column name */ ulint mtype, /* in: main datatype */ ulint prtype, /* in: precise type */ ulint len, /* in: length */ @@ -95,14 +96,15 @@ Creates an index memory object. */ dict_index_t* dict_mem_index_create( /*==================*/ - /* out, own: index object */ - char* table_name, /* in: table name */ - char* index_name, /* in: index name */ - ulint space, /* in: space where the index tree is placed, - ignored if the index is of the clustered - type */ - ulint type, /* in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed */ - ulint n_fields); /* in: number of fields */ + /* out, own: index object */ + const char* table_name, /* in: table name */ + const char* index_name, /* in: index name */ + ulint space, /* in: space where the index tree is + placed, ignored if the index is of + the clustered type */ + ulint type, /* in: DICT_UNIQUE, + DICT_CLUSTERED, ... ORed */ + ulint n_fields); /* in: number of fields */ /************************************************************************** Adds a field definition to an index. NOTE: does not take a copy of the column name if the field is a column. The memory occupied @@ -112,7 +114,7 @@ void dict_mem_index_add_field( /*=====================*/ dict_index_t* index, /* in: index */ - char* name, /* in: column name */ + const char* name, /* in: column name */ ulint order, /* in: order criterion; 0 means an ascending order */ ulint prefix_len); /* in: 0 or the column prefix length @@ -142,7 +144,7 @@ struct dict_col_struct{ clustered index */ ulint ord_part;/* count of how many times this column appears in ordering fields of an index */ - char* name; /* name */ + const char* name; /* name */ dtype_t type; /* data type */ dict_table_t* table; /* back pointer to table of this column */ ulint aux; /* this is used as an auxiliary variable @@ -154,7 +156,7 @@ struct dict_col_struct{ /* Data structure for a field in an index */ struct dict_field_struct{ dict_col_t* col; /* pointer to the table column */ - char* name; /* name of the column */ + const char* name; /* name of the column */ ulint order; /* flags for ordering this field: DICT_DESCEND, ... */ ulint prefix_len; /* 0 or the length of the column @@ -197,8 +199,8 @@ struct dict_index_struct{ dulint id; /* id of the index */ mem_heap_t* heap; /* memory heap */ ulint type; /* index type */ - char* name; /* index name */ - char* table_name; /* table name */ + const char* name; /* index name */ + const char* table_name; /* table name */ dict_table_t* table; /* back pointer to table */ ulint space; /* space where the index tree is placed */ ulint page_no;/* page number of the index tree root */ @@ -254,12 +256,12 @@ struct dict_foreign_struct{ or DICT_FOREIGN_ON_DELETE_SET_NULL */ char* foreign_table_name;/* foreign table name */ dict_table_t* foreign_table; /* table where the foreign key is */ - char** foreign_col_names;/* names of the columns in the + const char** foreign_col_names;/* names of the columns in the foreign key */ char* referenced_table_name;/* referenced table name */ dict_table_t* referenced_table;/* table where the referenced key is */ - char** referenced_col_names;/* names of the referenced + const char** referenced_col_names;/* names of the referenced columns in the referenced table */ ulint n_fields; /* number of indexes' first fields for which the the foreign key @@ -295,7 +297,7 @@ struct dict_table_struct{ dulint id; /* id of the table or cluster */ ulint type; /* DICT_TABLE_ORDINARY, ... */ mem_heap_t* heap; /* memory heap */ - char* name; /* table name */ + const char* name; /* table name */ ulint space; /* space where the clustered index of the table is placed */ ibool ibd_file_missing;/* TRUE if this is in a single-table @@ -363,7 +365,7 @@ struct dict_table_struct{ byte mix_id_buf[12]; /* mix id of a mixed table written in a compressed form */ - char* cluster_name; /* if the table is a member in a + const char* cluster_name; /* if the table is a member in a cluster, this is the name of the cluster */ /*----------------------*/ ibool does_not_fit_in_memory; diff --git a/innobase/include/fil0fil.h b/innobase/include/fil0fil.h index f7cdeb7f195..b750e9b38f2 100644 --- a/innobase/include/fil0fil.h +++ b/innobase/include/fil0fil.h @@ -132,11 +132,12 @@ Appends a new file to the chain of files of a space. File must be closed. */ void fil_node_create( /*============*/ - char* name, /* in: file name (file must be closed) */ - ulint size, /* in: file size in database blocks, rounded downwards - to an integer */ - ulint id, /* in: space id where to append */ - ibool is_raw);/* in: TRUE if a raw device or a raw disk partition */ + const char* name, /* in: file name (file must be closed) */ + ulint size, /* in: file size in database blocks, rounded + downwards to an integer */ + ulint id, /* in: space id where to append */ + ibool is_raw);/* in: TRUE if a raw device or + a raw disk partition */ /******************************************************************** Drops files from the start of a file space, so that its size is cut by the amount given. */ @@ -155,10 +156,10 @@ there is an error, prints an error message to the .err log. */ ibool fil_space_create( /*=============*/ - /* out: TRUE if success */ - char* name, /* in: space name */ - ulint id, /* in: space id */ - ulint purpose);/* in: FIL_TABLESPACE, or FIL_LOG if log */ + /* out: TRUE if success */ + const char* name, /* in: space name */ + ulint id, /* in: space id */ + ulint purpose);/* in: FIL_TABLESPACE, or FIL_LOG if log */ /*********************************************************************** Frees a space object from a the tablespace memory cache. Closes the files in the chain but does not delete them. */ @@ -327,14 +328,15 @@ tablespace memory cache. */ ibool fil_rename_tablespace( /*==================*/ - /* out: TRUE if success */ - char* old_name, /* in: old table name in the standard - databasename/tablename format of InnoDB, or - NULL if we do the rename based on the space - id only */ - ulint id, /* in: space id */ - char* new_name); /* in: new table name in the standard - databasename/tablename format of InnoDB */ + /* out: TRUE if success */ + const char* old_name, /* in: old table name in the standard + databasename/tablename format of + InnoDB, or NULL if we do the rename + based on the space id only */ + ulint id, /* in: space id */ + const char* new_name); /* in: new table name in the standard + databasename/tablename format + of InnoDB */ /*********************************************************************** Creates a new single-table tablespace to a database directory of MySQL. Database directories are under the 'datadir' of MySQL. The datadir is the @@ -344,14 +346,16 @@ path '.'. */ ulint fil_create_new_single_table_tablespace( /*===================================*/ - /* out: DB_SUCCESS or error code */ - ulint* space_id, /* in/out: space id; if this is != 0, then - this is an input parameter, otherwise - output */ - char* tablename, /* in: the table name in the usual - databasename/tablename format of InnoDB */ - ulint size); /* in: the initial size of the tablespace file - in pages, must be > 0 */ + /* out: DB_SUCCESS or error code */ + ulint* space_id, /* in/out: space id; if this is != 0, + then this is an input parameter, + otherwise output */ + const char* tablename, /* in: the table name in the usual + databasename/tablename format + of InnoDB */ + ulint size); /* in: the initial size of the + tablespace file in pages, + must be >= FIL_IBD_FILE_INITIAL_SIZE */ /************************************************************************ Tries to open a single-table tablespace and checks the space id is right in it. If does not succeed, prints an error message to the .err log. This @@ -362,10 +366,10 @@ protection of the dictionary mutex, so that two users cannot race here. */ ibool fil_open_single_table_tablespace( /*=============================*/ - /* out: TRUE if success */ - ulint id, /* in: space id */ - char* name); /* in: table name in the databasename/tablename - format */ + /* out: TRUE if success */ + ulint id, /* in: space id */ + const char* name); /* in: table name in the + databasename/tablename format */ /************************************************************************ It is possible, though very improbable, that the lsn's in the tablespace to be imported have risen above the current system lsn, if a lengthy purge, ibuf @@ -379,12 +383,12 @@ lsn's just by looking at that flush lsn. */ ibool fil_reset_too_high_lsns( /*====================*/ - /* out: TRUE if success */ - char* name, /* in: table name in the databasename/tablename - format */ - dulint current_lsn); /* in: reset lsn's if the lsn stamped to - FIL_PAGE_FILE_FLUSH_LSN in the first page is - too high */ + /* out: TRUE if success */ + const char* name, /* in: table name in the + databasename/tablename format */ + dulint current_lsn); /* in: reset lsn's if the lsn stamped + to FIL_PAGE_FILE_FLUSH_LSN in the + first page is too high */ /************************************************************************ At the server startup, if we need crash recovery, scans the database directories under the MySQL datadir, looking for .ibd files. Those files are @@ -436,20 +440,22 @@ there may be many tablespaces which are not yet in the memory cache. */ ibool fil_space_for_table_exists_in_mem( /*==============================*/ - /* out: TRUE if a matching tablespace - exists in the memory cache */ - ulint id, /* in: space id */ - char* name, /* in: table name in the standard - 'databasename/tablename' format */ - ibool mark_space, /* in: in crash recovery, at database startup - we mark all spaces which have an associated - table in the InnoDB data dictionary, so that - we can print a warning about orphaned - tablespaces */ - ibool print_error_if_does_not_exist); - /* in: print detailed error information to - the .err log if a matching tablespace is - not found from memory */ + /* out: TRUE if a matching tablespace + exists in the memory cache */ + ulint id, /* in: space id */ + const char* name, /* in: table name in the standard + 'databasename/tablename' format */ + ibool mark_space, /* in: in crash recovery, at database + startup we mark all spaces which have + an associated table in the InnoDB + data dictionary, so that + we can print a warning about orphaned + tablespaces */ + ibool print_error_if_does_not_exist); + /* in: print detailed error + information to the .err log if a + matching tablespace is not found from + memory */ /************************************************************************** Tries to extend a data file so that it would accommodate the number of pages given. The tablespace must be cached in the memory cache. If the space is big diff --git a/innobase/include/mem0mem.h b/innobase/include/mem0mem.h index 89e2a337c99..18bffe5732e 100644 --- a/innobase/include/mem0mem.h +++ b/innobase/include/mem0mem.h @@ -64,14 +64,14 @@ heap creation. */ #define mem_heap_create(N) mem_heap_create_func(\ (N), NULL, MEM_HEAP_DYNAMIC,\ - IB__FILE__, __LINE__) + __FILE__, __LINE__) /****************************************************************** Use this macro instead of the corresponding function! Macro for memory heap creation. */ #define mem_heap_create_in_buffer(N) mem_heap_create_func(\ (N), NULL, MEM_HEAP_BUFFER,\ - IB__FILE__, __LINE__) + __FILE__, __LINE__) /****************************************************************** Use this macro instead of the corresponding function! Macro for memory heap creation. */ @@ -79,7 +79,7 @@ heap creation. */ #define mem_heap_create_in_btr_search(N) mem_heap_create_func(\ (N), NULL, MEM_HEAP_BTR_SEARCH |\ MEM_HEAP_BUFFER,\ - IB__FILE__, __LINE__) + __FILE__, __LINE__) /****************************************************************** Use this macro instead of the corresponding function! Macro for fast memory heap creation. An initial block of memory B is given by the @@ -88,14 +88,14 @@ mem_heap_free. See the parameter comment in mem_heap_create_func below. */ #define mem_heap_fast_create(N, B) mem_heap_create_func(\ (N), (B), MEM_HEAP_DYNAMIC,\ - IB__FILE__, __LINE__) + __FILE__, __LINE__) /****************************************************************** Use this macro instead of the corresponding function! Macro for memory heap freeing. */ #define mem_heap_free(heap) mem_heap_free_func(\ - (heap), IB__FILE__, __LINE__) + (heap), __FILE__, __LINE__) /********************************************************************* NOTE: Use the corresponding macros instead of this function. Creates a memory heap which allocates memory from dynamic space. For debugging @@ -105,26 +105,27 @@ UNIV_INLINE mem_heap_t* mem_heap_create_func( /*=================*/ - /* out, own: memory heap */ - ulint n, /* in: desired start block size, - this means that a single user buffer - of size n will fit in the block, - 0 creates a default size block; - if init_block is not NULL, n tells - its size in bytes */ - void* init_block, /* in: if very fast creation is - wanted, the caller can reserve some - memory from its stack, for example, - and pass it as the the initial block - to the heap: then no OS call of malloc - is needed at the creation. CAUTION: - the caller must make sure the initial - block is not unintentionally erased - (if allocated in the stack), before - the memory heap is explicitly freed. */ - ulint type, /* in: MEM_HEAP_DYNAMIC or MEM_HEAP_BUFFER */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + /* out, own: memory heap */ + ulint n, /* in: desired start block size, + this means that a single user buffer + of size n will fit in the block, + 0 creates a default size block; + if init_block is not NULL, n tells + its size in bytes */ + void* init_block, /* in: if very fast creation is + wanted, the caller can reserve some + memory from its stack, for example, + and pass it as the the initial block + to the heap: then no OS call of malloc + is needed at the creation. CAUTION: + the caller must make sure the initial + block is not unintentionally erased + (if allocated in the stack), before + the memory heap is explicitly freed. */ + ulint type, /* in: MEM_HEAP_DYNAMIC + or MEM_HEAP_BUFFER */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ); /********************************************************************* NOTE: Use the corresponding macro instead of this function. Frees the space @@ -135,7 +136,7 @@ void mem_heap_free_func( /*===============*/ mem_heap_t* heap, /* in, own: heap to be freed */ - char* file_name __attribute__((unused)), + const char* file_name __attribute__((unused)), /* in: file name where freed */ ulint line __attribute__((unused))); /* in: line where freed */ @@ -206,13 +207,13 @@ mem_heap_get_size( Use this macro instead of the corresponding function! Macro for memory buffer allocation */ -#define mem_alloc(N) mem_alloc_func((N), IB__FILE__, __LINE__) +#define mem_alloc(N) mem_alloc_func((N), __FILE__, __LINE__) /****************************************************************** Use this macro instead of the corresponding function! Macro for memory buffer allocation */ #define mem_alloc_noninline(N) mem_alloc_func_noninline(\ - (N), IB__FILE__, __LINE__) + (N), __FILE__, __LINE__) /******************************************************************* NOTE: Use the corresponding macro instead of this function. Allocates a single buffer of memory from the dynamic memory of @@ -222,11 +223,11 @@ UNIV_INLINE void* mem_alloc_func( /*===========*/ - /* out, own: free storage, NULL - if did not succeed */ - ulint n, /* in: desired number of bytes */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + /* out, own: free storage, NULL + if did not succeed */ + ulint n, /* in: desired number of bytes */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ); /******************************************************************* NOTE: Use the corresponding macro instead of this function. @@ -237,17 +238,17 @@ with mem_free. */ void* mem_alloc_func_noninline( /*=====================*/ - /* out, own: free storage, NULL if did not - succeed */ - ulint n, /* in: desired number of bytes */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + /* out, own: free storage, + NULL if did not succeed */ + ulint n, /* in: desired number of bytes */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ); /****************************************************************** Use this macro instead of the corresponding function! Macro for memory buffer freeing */ -#define mem_free(PTR) mem_free_func((PTR), IB__FILE__, __LINE__) +#define mem_free(PTR) mem_free_func((PTR), __FILE__, __LINE__) /******************************************************************* NOTE: Use the corresponding macro instead of this function. Frees a single buffer of storage from @@ -256,9 +257,9 @@ UNIV_INLINE void mem_free_func( /*==========*/ - void* ptr, /* in, own: buffer to be freed */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + void* ptr, /* in, own: buffer to be freed */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ); /******************************************************************* Implements realloc. */ @@ -266,11 +267,12 @@ UNIV_INLINE void* mem_realloc( /*========*/ - /* out, own: free storage, NULL if did not succeed */ - void* buf, /* in: pointer to an old buffer */ - ulint n, /* in: desired number of bytes */ - char* file_name,/* in: file name where called */ - ulint line); /* in: line where called */ + /* out, own: free storage, + NULL if did not succeed */ + void* buf, /* in: pointer to an old buffer */ + ulint n, /* in: desired number of bytes */ + const char* file_name, /* in: file name where called */ + ulint line); /* in: line where called */ /************************************************************************** Duplicates a NUL-terminated string. */ diff --git a/innobase/include/mem0mem.ic b/innobase/include/mem0mem.ic index c250e6948ec..df3dbf9b576 100644 --- a/innobase/include/mem0mem.ic +++ b/innobase/include/mem0mem.ic @@ -16,18 +16,18 @@ Creates a memory heap block where data can be allocated. */ mem_block_t* mem_heap_create_block( /*==================*/ - /* out, own: memory heap block, NULL if did not - succeed */ - mem_heap_t* heap,/* in: memory heap or NULL if first block should - be created */ - ulint n, /* in: number of bytes needed for user data, or - if init_block is not NULL, its size in bytes */ - void* init_block, /* in: init block in fast create, type must be - MEM_HEAP_DYNAMIC */ - ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC or - MEM_HEAP_BUFFER */ - char* file_name,/* in: file name where created */ - ulint line); /* in: line where created */ + /* out, own: memory heap block, + NULL if did not succeed */ + mem_heap_t* heap, /* in: memory heap or NULL if first block + should be created */ + ulint n, /* in: number of bytes needed for user data, or + if init_block is not NULL, its size in bytes */ + void* init_block, /* in: init block in fast create, + type must be MEM_HEAP_DYNAMIC */ + ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC or + MEM_HEAP_BUFFER */ + const char* file_name,/* in: file name where created */ + ulint line); /* in: line where created */ /********************************************************************** Frees a block from a memory heap. */ @@ -377,27 +377,27 @@ UNIV_INLINE mem_heap_t* mem_heap_create_func( /*=================*/ - /* out, own: memory heap */ - ulint n, /* in: desired start block size, - this means that a single user buffer - of size n will fit in the block, - 0 creates a default size block; - if init_block is not NULL, n tells - its size in bytes */ - void* init_block, /* in: if very fast creation is - wanted, the caller can reserve some - memory from its stack, for example, - and pass it as the the initial block - to the heap: then no OS call of malloc - is needed at the creation. CAUTION: - the caller must make sure the initial - block is not unintentionally erased - (if allocated in the stack), before - the memory heap is explicitly freed. */ - ulint type, /* in: MEM_HEAP_DYNAMIC, or MEM_HEAP_BUFFER - possibly ORed to MEM_HEAP_BTR_SEARCH */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + /* out, own: memory heap */ + ulint n, /* in: desired start block size, + this means that a single user buffer + of size n will fit in the block, + 0 creates a default size block; + if init_block is not NULL, n tells + its size in bytes */ + void* init_block, /* in: if very fast creation is + wanted, the caller can reserve some + memory from its stack, for example, + and pass it as the the initial block + to the heap: then no OS call of malloc + is needed at the creation. CAUTION: + the caller must make sure the initial + block is not unintentionally erased + (if allocated in the stack), before + the memory heap is explicitly freed. */ + ulint type, /* in: MEM_HEAP_DYNAMIC + or MEM_HEAP_BUFFER */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ) { mem_block_t* block; @@ -440,10 +440,9 @@ void mem_heap_free_func( /*===============*/ mem_heap_t* heap, /* in, own: heap to be freed */ - char* file_name __attribute__((unused)), + const char* file_name __attribute__((unused)), /* in: file name where freed */ ulint line __attribute__((unused))) - /* in: line where freed */ { mem_block_t* block; mem_block_t* prev_block; @@ -486,11 +485,11 @@ UNIV_INLINE void* mem_alloc_func( /*===========*/ - /* out, own: free storage, NULL if did not - succeed */ - ulint n, /* in: desired number of bytes */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + /* out, own: free storage, NULL + if did not succeed */ + ulint n, /* in: desired number of bytes */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ) { mem_heap_t* heap; @@ -523,9 +522,9 @@ UNIV_INLINE void mem_free_func( /*==========*/ - void* ptr, /* in, own: buffer to be freed */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + void* ptr, /* in, own: buffer to be freed */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ) { mem_heap_t* heap; @@ -569,11 +568,12 @@ UNIV_INLINE void* mem_realloc( /*========*/ - /* out, own: free storage, NULL if did not succeed */ - void* buf, /* in: pointer to an old buffer */ - ulint n, /* in: desired number of bytes */ - char* file_name,/* in: file name where called */ - ulint line) /* in: line where called */ + /* out, own: free storage, + NULL if did not succeed */ + void* buf, /* in: pointer to an old buffer */ + ulint n, /* in: desired number of bytes */ + const char* file_name, /* in: file name where called */ + ulint line) /* in: line where called */ { mem_free(buf); diff --git a/innobase/include/mem0pool.h b/innobase/include/mem0pool.h index 08327d95d37..95cf19676fb 100644 --- a/innobase/include/mem0pool.h +++ b/innobase/include/mem0pool.h @@ -19,8 +19,6 @@ typedef struct mem_pool_struct mem_pool_t; /* The common memory pool */ extern mem_pool_t* mem_comm_pool; -extern ulint mem_out_of_mem_err_msg_count; - /* Memory area header */ struct mem_area_struct{ diff --git a/innobase/include/mtr0mtr.h b/innobase/include/mtr0mtr.h index 73338977b9c..f6dfe23bc41 100644 --- a/innobase/include/mtr0mtr.h +++ b/innobase/include/mtr0mtr.h @@ -198,11 +198,11 @@ mtr_read_dulint( mtr_t* mtr); /* in: mini-transaction handle */ /************************************************************************* This macro locks an rw-lock in s-mode. */ -#define mtr_s_lock(B, MTR) mtr_s_lock_func((B), IB__FILE__, __LINE__,\ +#define mtr_s_lock(B, MTR) mtr_s_lock_func((B), __FILE__, __LINE__,\ (MTR)) /************************************************************************* This macro locks an rw-lock in x-mode. */ -#define mtr_x_lock(B, MTR) mtr_x_lock_func((B), IB__FILE__, __LINE__,\ +#define mtr_x_lock(B, MTR) mtr_x_lock_func((B), __FILE__, __LINE__,\ (MTR)) /************************************************************************* NOTE! Use the macro above! @@ -212,7 +212,7 @@ void mtr_s_lock_func( /*============*/ rw_lock_t* lock, /* in: rw-lock */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line number */ mtr_t* mtr); /* in: mtr */ /************************************************************************* @@ -223,7 +223,7 @@ void mtr_x_lock_func( /*============*/ rw_lock_t* lock, /* in: rw-lock */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line number */ mtr_t* mtr); /* in: mtr */ diff --git a/innobase/include/mtr0mtr.ic b/innobase/include/mtr0mtr.ic index 51112fc0d14..4fc6dd2f6a9 100644 --- a/innobase/include/mtr0mtr.ic +++ b/innobase/include/mtr0mtr.ic @@ -217,7 +217,7 @@ void mtr_s_lock_func( /*============*/ rw_lock_t* lock, /* in: rw-lock */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line number */ mtr_t* mtr) /* in: mtr */ { @@ -236,7 +236,7 @@ void mtr_x_lock_func( /*============*/ rw_lock_t* lock, /* in: rw-lock */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line number */ mtr_t* mtr) /* in: mtr */ { diff --git a/innobase/include/os0file.h b/innobase/include/os0file.h index 3eccfcd3be5..930390241d3 100644 --- a/innobase/include/os0file.h +++ b/innobase/include/os0file.h @@ -177,13 +177,15 @@ and '..' items at the start of the directory listing. */ os_file_dir_t os_file_opendir( /*============*/ - /* out: directory stream, NULL if error */ - char* dirname, /* in: directory name; it must not contain - a trailing '\' or '/' */ - ibool error_is_fatal);/* in: TRUE if we should treat an error as a - fatal error; if we try to open symlinks then - we do not wish a fatal error if it happens - not to be a directory */ + /* out: directory stream, NULL if + error */ + const char* dirname, /* in: directory name; it must not + contain a trailing '\' or '/' */ + ibool error_is_fatal);/* in: TRUE if we should treat an + error as a fatal error; if we try to + open symlinks then we do not wish a + fatal error if it happens not to be + a directory */ /*************************************************************************** Closes a directory stream. */ @@ -201,7 +203,7 @@ os_file_readdir_next_file( /*======================*/ /* out: 0 if ok, -1 if error, 1 if at the end of the directory */ - char* dirname,/* in: directory name or path */ + const char* dirname,/* in: directory name or path */ os_file_dir_t dir, /* in: directory stream */ os_file_stat_t* info); /* in/out: buffer where the info is returned */ /********************************************************************* @@ -213,81 +215,89 @@ fail_if_exists arguments is true. */ ibool os_file_create_directory( /*=====================*/ - /* out: TRUE if call succeeds, FALSE on - error */ - char* pathname, /* in: directory name as null-terminated - string */ - ibool fail_if_exists);/* in: if TRUE, pre-existing directory is - treated as an error. */ + /* out: TRUE if call succeeds, + FALSE on error */ + const char* pathname, /* in: directory name as + null-terminated string */ + ibool fail_if_exists);/* in: if TRUE, pre-existing directory + is treated as an error. */ /******************************************************************** A simple function to open or create a file. */ os_file_t os_file_create_simple( /*==================*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error), or - OS_FILE_CREATE_PATH if new file (if exists, error) and - subdirectories along its path are created (if needed)*/ - ulint access_type,/* in: OS_FILE_READ_ONLY or OS_FILE_READ_WRITE */ - ibool* success);/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file is + opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error), or + OS_FILE_CREATE_PATH if new file + (if exists, error) and subdirectories along + its path are created (if needed)*/ + ulint access_type,/* in: OS_FILE_READ_ONLY or + OS_FILE_READ_WRITE */ + ibool* success);/* out: TRUE if succeed, FALSE if error */ /******************************************************************** A simple function to open or create a file. */ os_file_t os_file_create_simple_no_error_handling( /*====================================*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error) */ - ulint access_type,/* in: OS_FILE_READ_ONLY, OS_FILE_READ_WRITE, or - OS_FILE_READ_ALLOW_DELETE; the last option is used by - a backup program reading the file */ - ibool* success);/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file + is opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error) */ + ulint access_type,/* in: OS_FILE_READ_ONLY, + OS_FILE_READ_WRITE, or + OS_FILE_READ_ALLOW_DELETE; the last option is + used by a backup program reading the file */ + ibool* success);/* out: TRUE if succeed, FALSE if error */ /******************************************************************** Opens an existing file or creates a new. */ os_file_t os_file_create( /*===========*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error), OS_FILE_OVERWRITE - if a new file is created or an old overwritten; - OS_FILE_OPEN_RAW, if a raw device or disk partition - should be opened */ - ulint purpose,/* in: OS_FILE_AIO, if asynchronous, non-buffered i/o - is desired, OS_FILE_NORMAL, if any normal file; - NOTE that it also depends on type, os_aio_.. and srv_.. - variables whether we really use async i/o or - unbuffered i/o: look in the function source code for - the exact rules */ - ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */ - ibool* success);/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file + is opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error), + OS_FILE_OVERWRITE if a new file is created + or an old overwritten; + OS_FILE_OPEN_RAW, if a raw device or disk + partition should be opened */ + ulint purpose,/* in: OS_FILE_AIO, if asynchronous, + non-buffered i/o is desired, + OS_FILE_NORMAL, if any normal file; + NOTE that it also depends on type, os_aio_.. + and srv_.. variables whether we really use + async i/o or unbuffered i/o: look in the + function source code for the exact rules */ + ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */ + ibool* success);/* out: TRUE if succeed, FALSE if error */ /*************************************************************************** Deletes a file. The file has to be closed before calling this. */ ibool os_file_delete( /*===========*/ - /* out: TRUE if success */ - char* name); /* in: file path as a null-terminated string */ + /* out: TRUE if success */ + const char* name); /* in: file path as a null-terminated string */ /*************************************************************************** Deletes a file if it exists. The file has to be closed before calling this. */ @@ -295,8 +305,8 @@ Deletes a file if it exists. The file has to be closed before calling this. */ ibool os_file_delete_if_exists( /*=====================*/ - /* out: TRUE if success */ - char* name); /* in: file path as a null-terminated string */ + /* out: TRUE if success */ + const char* name); /* in: file path as a null-terminated string */ /*************************************************************************** Renames a file (can also move it to another directory). It is safest that the file is closed before calling this function. */ @@ -304,10 +314,10 @@ file is closed before calling this function. */ ibool os_file_rename( /*===========*/ - /* out: TRUE if success */ - char* oldpath, /* in: old file path as a null-terminated - string */ - char* newpath); /* in: new file path */ + /* out: TRUE if success */ + const char* oldpath, /* in: old file path as a + null-terminated string */ + const char* newpath); /* in: new file path */ /*************************************************************************** Closes a file handle. In case of error, error number can be retrieved with os_file_get_last_error. */ @@ -351,7 +361,7 @@ ibool os_file_set_size( /*=============*/ /* out: TRUE if success */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ ulint size, /* in: least significant 32 bits of file @@ -426,10 +436,10 @@ os_file_write( /*==========*/ /* out: TRUE if request was successful, FALSE if fail */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ - void* buf, /* in: buffer from which to write */ + const void* buf, /* in: buffer from which to write */ ulint offset, /* in: least significant 32 bits of file offset where to write */ ulint offset_high,/* in: most significant 32 bits of @@ -442,8 +452,8 @@ ibool os_file_status( /*===========*/ /* out: TRUE if call succeeded */ - char * path, /* in: pathname of the file */ - ibool * exists, /* out: TRUE if file exists */ + const char* path, /* in: pathname of the file */ + ibool* exists, /* out: TRUE if file exists */ os_file_type_t* type); /* out: type of the file (if it exists) */ /******************************************************************** The function os_file_dirname returns a directory component of a @@ -478,7 +488,7 @@ os_file_dirname( /*============*/ /* out, own: directory component of the pathname */ - char* path); /* in: pathname */ + const char* path); /* in: pathname */ /******************************************************************** Creates all missing subdirectories along the given path. */ @@ -487,7 +497,7 @@ os_file_create_subdirs_if_needed( /*=============================*/ /* out: TRUE if call succeeded FALSE otherwise */ - char* path); /* in: path name */ + const char* path); /* in: path name */ /**************************************************************************** Initializes the asynchronous io system. Creates separate aio array for non-ibuf read and write, a third aio array for the ibuf i/o, with just one @@ -527,7 +537,7 @@ os_aio( because i/os are not actually handled until all have been posted: use with great caution! */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ void* buf, /* in: buffer where to read or from which diff --git a/innobase/include/os0shm.h b/innobase/include/os0shm.h deleted file mode 100644 index 250794a976f..00000000000 --- a/innobase/include/os0shm.h +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************** -The interface to the operating system -shared memory primitives - -(c) 1995 Innobase Oy - -Created 9/23/1995 Heikki Tuuri -*******************************************************/ - -#ifndef os0shm_h -#define os0shm_h - -#include "univ.i" - -typedef void* os_shm_t; - - -/******************************************************************** -Creates an area of shared memory. It can be named so that -different processes may access it in the same computer. -If an area with the same name already exists, returns -a handle to that area (where the size of the area is -not changed even if this call requests a different size). -To use the area, it first has to be mapped to the process -address space by os_shm_map. */ - -os_shm_t -os_shm_create( -/*==========*/ - /* out, own: handle to the shared - memory area, NULL if error */ - ulint size, /* in: area size < 4 GB */ - char* name); /* in: name of the area as a null-terminated - string */ -/*************************************************************************** -Frees a shared memory area. The area can be freed only after it -has been unmapped in all the processes where it was mapped. */ - -ibool -os_shm_free( -/*========*/ - /* out: TRUE if success */ - os_shm_t shm); /* in, own: handle to a shared memory area */ -/*************************************************************************** -Maps a shared memory area in the address space of a process. */ - -void* -os_shm_map( -/*=======*/ - /* out: address of the area, NULL if error */ - os_shm_t shm); /* in: handle to a shared memory area */ -/*************************************************************************** -Unmaps a shared memory area from the address space of a process. */ - -ibool -os_shm_unmap( -/*=========*/ - /* out: TRUE if succeed */ - void* addr); /* in: address of the area */ - - -#ifndef UNIV_NONINL -#include "os0shm.ic" -#endif - -#endif diff --git a/innobase/include/os0shm.ic b/innobase/include/os0shm.ic deleted file mode 100644 index cc267544bc9..00000000000 --- a/innobase/include/os0shm.ic +++ /dev/null @@ -1,10 +0,0 @@ -/****************************************************** -The interface to the operating system -shared memory primitives - -(c) 1995 Innobase Oy - -Created 9/23/1995 Heikki Tuuri -*******************************************************/ - - diff --git a/innobase/include/os0sync.h b/innobase/include/os0sync.h index e1cf263216e..d27b1676f1b 100644 --- a/innobase/include/os0sync.h +++ b/innobase/include/os0sync.h @@ -87,9 +87,9 @@ explicitly by calling sync_os_reset_event. */ os_event_t os_event_create( /*============*/ - /* out: the event handle */ - char* name); /* in: the name of the event, if NULL - the event is created without a name */ + /* out: the event handle */ + const char* name); /* in: the name of the event, if NULL + the event is created without a name */ #ifdef __WIN__ /************************************************************* Creates an auto-reset event semaphore, i.e., an event which is automatically @@ -98,9 +98,9 @@ reset when a single thread is released. Works only in Windows. */ os_event_t os_event_create_auto( /*=================*/ - /* out: the event handle */ - char* name); /* in: the name of the event, if NULL - the event is created without a name */ + /* out: the event handle */ + const char* name); /* in: the name of the event, if NULL + the event is created without a name */ #endif /************************************************************** Sets an event semaphore to the signaled state: lets waiting threads @@ -171,9 +171,9 @@ mutex semaphore of InnoDB itself (mutex_t) should be used where possible. */ os_mutex_t os_mutex_create( /*============*/ - /* out: the mutex handle */ - char* name); /* in: the name of the mutex, if NULL - the mutex is created without a name */ + /* out: the mutex handle */ + const char* name); /* in: the name of the mutex, if NULL + the mutex is created without a name */ /************************************************************** Acquires ownership of a mutex semaphore. */ diff --git a/innobase/include/pars0pars.h b/innobase/include/pars0pars.h index 2e86a7e5534..28985e2f9d0 100644 --- a/innobase/include/pars0pars.h +++ b/innobase/include/pars0pars.h @@ -74,8 +74,8 @@ Parses an SQL string returning the query graph. */ que_t* pars_sql( /*=====*/ - /* out, own: the query graph */ - char* str); /* in: SQL string */ + /* out, own: the query graph */ + const char* str); /* in: SQL string */ /***************************************************************** Retrieves characters to the lexical analyzer. */ @@ -92,7 +92,7 @@ Called by yyparse on error. */ void yyerror( /*====*/ - char* s); /* in: error message string */ + const char* s); /* in: error message string */ /************************************************************************* Parses a variable declaration. */ diff --git a/innobase/include/pars0sym.h b/innobase/include/pars0sym.h index 3060fd06c8f..a40523861dd 100644 --- a/innobase/include/pars0sym.h +++ b/innobase/include/pars0sym.h @@ -122,7 +122,7 @@ struct sym_node_struct{ SYM_IMPLICIT_VAR, SYM_LIT, SYM_TABLE, SYM_CURSOR, ... */ - char* name; /* name of an id */ + const char* name; /* name of an id */ ulint name_len; /* id name length */ dict_table_t* table; /* table definition if a table id or a @@ -150,7 +150,7 @@ struct sym_tab_struct{ que_t* query_graph; /* query graph generated by the parser */ - char* sql_string; + const char* sql_string; /* SQL string to parse */ int string_len; /* SQL string length */ diff --git a/innobase/include/que0que.h b/innobase/include/que0que.h index bcd7aed7e88..a438116781f 100644 --- a/innobase/include/que0que.h +++ b/innobase/include/que0que.h @@ -152,17 +152,6 @@ que_run_threads( /*============*/ que_thr_t* thr); /* in: query thread which is run initially */ /************************************************************************** -After signal handling is finished, returns control to a query graph error -handling routine. (Currently, just returns the control to the root of the -graph so that the graph can communicate an error message to the client.) */ - -void -que_fork_error_handle( -/*==================*/ - trx_t* trx, /* in: trx */ - que_t* fork); /* in: query graph which was run before signal - handling started, NULL not allowed */ -/************************************************************************** Handles an SQL error noticed during query thread execution. At the moment, does nothing! */ @@ -181,18 +170,15 @@ a single worker thread to execute it. This function should be used to end the wait state of a query thread waiting for a lock or a stored procedure completion. */ -void +que_thr_t* que_thr_end_wait( /*=============*/ - que_thr_t* thr, /* in: query thread in the + /* out: next query thread to run; + NULL if none */ + que_thr_t* thr); /* in: query thread in the QUE_THR_LOCK_WAIT, or QUE_THR_PROCEDURE_WAIT, or QUE_THR_SIG_REPLY_WAIT state */ - que_thr_t** next_thr); /* in/out: next query thread to run; - if the value which is passed in is - a pointer to a NULL pointer, then the - calling function can start running - a new query thread */ /************************************************************************** Same as que_thr_end_wait, but no parameter next_thr available. */ diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index 0b9f34dda1e..af6d8969cfc 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -316,15 +316,16 @@ fields than mentioned in the constraint. */ int row_table_add_foreign_constraints( /*==============================*/ - /* out: error code or DB_SUCCESS */ - trx_t* trx, /* in: transaction */ - char* sql_string, /* in: table create statement where - foreign keys are declared like: + /* out: error code or DB_SUCCESS */ + trx_t* trx, /* in: transaction */ + const char* sql_string, /* in: table create statement where + foreign keys are declared like: FOREIGN KEY (a, b) REFERENCES table2(c, d), - table2 can be written also with the database - name before it: test.table2 */ - char* name); /* in: table full name in the normalized form - database_name/table_name */ + table2 can be written also with the + database name before it: test.table2 */ + const char* name); /* in: table full name in the + normalized form + database_name/table_name */ /************************************************************************* The master thread in srv0srv.c calls this regularly to drop tables which we must drop in background after queries to them have ended. Such lazy @@ -351,10 +352,10 @@ output by the master thread. */ int row_drop_table_for_mysql( /*=====================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: table name */ - trx_t* trx, /* in: transaction handle */ - ibool drop_db);/* in: TRUE=dropping whole database */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: table name */ + trx_t* trx, /* in: transaction handle */ + ibool drop_db);/* in: TRUE=dropping whole database */ /************************************************************************* Discards the tablespace of a table which stored in an .ibd file. Discarding @@ -382,9 +383,9 @@ discard ongoing operations. */ int row_discard_tablespace_for_mysql( /*=============================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: table name */ - trx_t* trx); /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: table name */ + trx_t* trx); /* in: transaction handle */ /********************************************************************* Imports a tablespace. The space id in the .ibd file must match the space id of the table in the data dictionary. */ @@ -392,28 +393,28 @@ of the table in the data dictionary. */ int row_import_tablespace_for_mysql( /*============================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: table name */ - trx_t* trx); /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: table name */ + trx_t* trx); /* in: transaction handle */ /************************************************************************* Drops a database for MySQL. */ int row_drop_database_for_mysql( /*========================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: database name which ends to '/' */ - trx_t* trx); /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: database name which ends to '/' */ + trx_t* trx); /* in: transaction handle */ /************************************************************************* Renames a table for MySQL. */ int row_rename_table_for_mysql( /*=======================*/ - /* out: error code or DB_SUCCESS */ - char* old_name, /* in: old table name */ - char* new_name, /* in: new table name */ - trx_t* trx); /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* old_name, /* in: old table name */ + const char* new_name, /* in: new table name */ + trx_t* trx); /* in: transaction handle */ /************************************************************************* Checks a table for corruption. */ diff --git a/innobase/include/row0sel.h b/innobase/include/row0sel.h index a35d588ad08..0be224eb255 100644 --- a/innobase/include/row0sel.h +++ b/innobase/include/row0sel.h @@ -144,11 +144,11 @@ consistent read result, or store it to the query cache. */ ibool row_search_check_if_query_cache_permitted( /*======================================*/ - /* out: TRUE if storing or retrieving from - the query cache is permitted */ - trx_t* trx, /* in: transaction object */ - char* norm_name); /* in: concatenation of database name, '/' - char, table name */ + /* out: TRUE if storing or retrieving + from the query cache is permitted */ + trx_t* trx, /* in: transaction object */ + const char* norm_name); /* in: concatenation of database name, + '/' char, table name */ /* A structure for caching column values for prefetched rows */ diff --git a/innobase/include/srv0que.h b/innobase/include/srv0que.h deleted file mode 100644 index 05c339cdd32..00000000000 --- a/innobase/include/srv0que.h +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************** -Server query execution - -(c) 1996 Innobase Oy - -Created 6/5/1996 Heikki Tuuri -*******************************************************/ - - -#ifndef srv0que_h -#define srv0que_h - -#include "univ.i" -#include "que0types.h" - -/************************************************************************** -Checks if there is work to do in the server task queue. If there is, the -thread starts processing a task. Before leaving, it again checks the task -queue and picks a new task if any exists. This is called by a SRV_WORKER -thread. */ - -void -srv_que_task_queue_check(void); -/*==========================*/ -/************************************************************************** -Performs round-robin on the server tasks. This is called by a SRV_WORKER -thread every second or so. */ - -que_thr_t* -srv_que_round_robin( -/*================*/ - /* out: the new (may be == thr) query thread - to run */ - que_thr_t* thr); /* in: query thread */ -/************************************************************************** -Enqueues a task to server task queue and releases a worker thread, if -there exists one suspended. */ - -void -srv_que_task_enqueue( -/*=================*/ - que_thr_t* thr); /* in: query thread */ -/************************************************************************** -Enqueues a task to server task queue and releases a worker thread, if -there exists one suspended. */ - -void -srv_que_task_enqueue_low( -/*=====================*/ - que_thr_t* thr); /* in: query thread */ - -#endif - diff --git a/innobase/include/sync0arr.h b/innobase/include/sync0arr.h index 383d0c69fb2..e7d511f8137 100644 --- a/innobase/include/sync0arr.h +++ b/innobase/include/sync0arr.h @@ -51,7 +51,7 @@ sync_array_reserve_cell( sync_array_t* arr, /* in: wait array */ void* object, /* in: pointer to the object to wait for */ ulint type, /* in: lock request type */ - char* file, /* in: file where requested */ + const char* file, /* in: file where requested */ ulint line, /* in: line where requested */ ulint* index); /* out: index of the reserved cell */ /********************************************************************** diff --git a/innobase/include/sync0ipm.h b/innobase/include/sync0ipm.h deleted file mode 100644 index 3244a6d26de..00000000000 --- a/innobase/include/sync0ipm.h +++ /dev/null @@ -1,113 +0,0 @@ -/****************************************************** -A fast mutex for interprocess synchronization. -mutex_t can be used only within single process, -but ip mutex also between processes. - -(c) 1995 Innobase Oy - -Created 9/30/1995 Heikki Tuuri -*******************************************************/ - -#ifndef sync0ipm_h -#define sync0ipm_h - -#include "univ.i" -#include "os0sync.h" -#include "sync0sync.h" - -typedef struct ip_mutex_hdl_struct ip_mutex_hdl_t; -typedef struct ip_mutex_struct ip_mutex_t; - -/* NOTE! The structure appears here only for the compiler to -know its size. Do not use its fields directly! -The structure used in a fast implementation of -an interprocess mutex. */ - -struct ip_mutex_struct { - mutex_t mutex; /* Ordinary mutex struct */ - ulint waiters; /* This field is set to 1 if - there may be waiters */ -}; - -/* The performance of the ip mutex in NT depends on how often -a thread has to suspend itself waiting for the ip mutex -to become free. The following variable counts system calls -involved. */ - -extern ulint ip_mutex_system_call_count; - -/********************************************************************** -Creates, or rather, initializes -an ip mutex object in a specified shared memory location (which must be -appropriately aligned). The ip mutex is initialized in the reset state. -NOTE! Explicit destroying of the ip mutex with ip_mutex_free -is not recommended -as the mutex resides in shared memory and we cannot make sure that -no process is currently accessing it. Therefore just use -ip_mutex_close to free the operating system event and mutex. */ - -ulint -ip_mutex_create( -/*============*/ - /* out: 0 if succeed */ - ip_mutex_t* ip_mutex, /* in: pointer to shared memory */ - char* name, /* in: name of the ip mutex */ - ip_mutex_hdl_t** handle); /* out, own: handle to the - created mutex; handle exists - in the private address space of - the calling process */ -/********************************************************************** -NOTE! Using this function is not recommended. See the note -on ip_mutex_create. Destroys an ip mutex */ - -void -ip_mutex_free( -/*==========*/ - ip_mutex_hdl_t* handle); /* in, own: ip mutex handle */ -/********************************************************************** -Opens an ip mutex object in a specified shared memory location. -Explicit closing of the ip mutex with ip_mutex_close is necessary to -free the operating system event and mutex created, and the handle. */ - -ulint -ip_mutex_open( -/*==========*/ - /* out: 0 if succeed */ - ip_mutex_t* ip_mutex, /* in: pointer to shared memory */ - char* name, /* in: name of the ip mutex */ - ip_mutex_hdl_t** handle); /* out, own: handle to the - opened mutex */ -/********************************************************************** -Closes an ip mutex. */ - -void -ip_mutex_close( -/*===========*/ - ip_mutex_hdl_t* handle); /* in, own: ip mutex handle */ -/****************************************************************** -Reserves an ip mutex. */ -UNIV_INLINE -ulint -ip_mutex_enter( -/*===========*/ - /* out: 0 if success, - SYNC_TIME_EXCEEDED if timeout */ - ip_mutex_hdl_t* ip_mutex_hdl, /* in: pointer to ip mutex handle */ - ulint time); /* in: maximum time to wait, in - microseconds, or - SYNC_INFINITE_TIME */ -/****************************************************************** -Releases an ip mutex. */ -UNIV_INLINE -void -ip_mutex_exit( -/*==========*/ - ip_mutex_hdl_t* ip_mutex_hdl); /* in: pointer to ip mutex handle */ - - - -#ifndef UNIV_NONINL -#include "sync0ipm.ic" -#endif - -#endif diff --git a/innobase/include/sync0ipm.ic b/innobase/include/sync0ipm.ic deleted file mode 100644 index b8aa87ba6d6..00000000000 --- a/innobase/include/sync0ipm.ic +++ /dev/null @@ -1,182 +0,0 @@ -/****************************************************** -A fast mutex for interprocess synchronization. -mutex_t can be used only within single process, -but ip_mutex_t also between processes. - -(c) 1995 Innobase Oy - -Created 9/30/1995 Heikki Tuuri -*******************************************************/ - -/* An extra structure created in the private address space of each process -which creates or opens the ip mutex. */ - -struct ip_mutex_hdl_struct { - ip_mutex_t* ip_mutex; /* pointer to ip mutex */ - os_event_t released; /* event which signals that the mutex - is released; this is obtained from - create or open of an ip mutex */ - os_mutex_t exclude; /* os mutex obtained when ip mutex is - created or opened */ -}; - - -UNIV_INLINE -ulint -ip_mutex_get_waiters( -volatile ip_mutex_t* ipm); -UNIV_INLINE -void -ip_mutex_set_waiters( -volatile ip_mutex_t* ipm, - ulint flag); -UNIV_INLINE -mutex_t* -ip_mutex_get_mutex( - ip_mutex_t* ipm); - - -/****************************************************************** -Accessor functions for ip mutex. */ -UNIV_INLINE -ulint -ip_mutex_get_waiters( -volatile ip_mutex_t* ipm) -{ - return(ipm->waiters); -} -UNIV_INLINE -void -ip_mutex_set_waiters( -volatile ip_mutex_t* ipm, - ulint flag) -{ - ipm->waiters = flag; -} -UNIV_INLINE -mutex_t* -ip_mutex_get_mutex( - ip_mutex_t* ipm) -{ - return(&(ipm->mutex)); -} - -/****************************************************************** -Reserves an ip mutex. */ -UNIV_INLINE -ulint -ip_mutex_enter( -/*===========*/ - /* out: 0 if success, - SYNC_TIME_EXCEEDED if timeout */ - ip_mutex_hdl_t* ip_mutex_hdl, /* in: pointer to ip mutex handle */ - ulint time) /* in: maximum time to wait, in - microseconds, or - SYNC_INFINITE_TIME */ -{ - mutex_t* mutex; - os_event_t released; - os_mutex_t exclude; - ip_mutex_t* ip_mutex; - ulint loop_count; - ulint ret; - - ip_mutex = ip_mutex_hdl->ip_mutex; - released = ip_mutex_hdl->released; - exclude = ip_mutex_hdl->exclude; - - mutex = ip_mutex_get_mutex(ip_mutex); - - loop_count = 0; -loop: - loop_count++; - ut_ad(loop_count < 15); - - if (mutex_enter_nowait(mutex, IB__FILE__, __LINE__) == 0) { - /* Succeeded! */ - - return(0); - } - - ip_mutex_system_call_count++; - - os_event_reset(released); - - /* Order is important here: FIRST reset event, then set waiters */ - ip_mutex_set_waiters(ip_mutex, 1); - - if (mutex_enter_nowait(mutex, IB__FILE__, __LINE__) == 0) { - /* Succeeded! */ - - return(0); - } - - if (time == SYNC_INFINITE_TIME) { - time = OS_SYNC_INFINITE_TIME; - } - - /* Suspend to wait for release */ - - ip_mutex_system_call_count++; - - ret = os_event_wait_time(released, time); - - ip_mutex_system_call_count++; - - os_mutex_enter(exclude); - ip_mutex_system_call_count++; - os_mutex_exit(exclude); - - if (ret != 0) { - ut_a(ret == OS_SYNC_TIME_EXCEEDED); - - return(SYNC_TIME_EXCEEDED); - } - - goto loop; -} - -/****************************************************************** -Releases an ip mutex. */ -UNIV_INLINE -void -ip_mutex_exit( -/*==========*/ - ip_mutex_hdl_t* ip_mutex_hdl) /* in: pointer to ip mutex handle */ -{ - mutex_t* mutex; - os_event_t released; - os_mutex_t exclude; - ip_mutex_t* ip_mutex; - - ip_mutex = ip_mutex_hdl->ip_mutex; - released = ip_mutex_hdl->released; - exclude = ip_mutex_hdl->exclude; - - mutex = ip_mutex_get_mutex(ip_mutex); - - mutex_exit(mutex); - - if (ip_mutex_get_waiters(ip_mutex) != 0) { - - ip_mutex_set_waiters(ip_mutex, 0); - - /* Order is important here: FIRST reset waiters, - then set event */ - - ip_mutex_system_call_count++; - os_mutex_enter(exclude); - - /* The use of the exclude mutex seems to prevent some - kind of a convoy problem in the test tsproc.c. We do - not know why. */ - - ip_mutex_system_call_count++; - - os_event_set(released); - - ip_mutex_system_call_count++; - - os_mutex_exit(exclude); - } -} diff --git a/innobase/include/sync0rw.h b/innobase/include/sync0rw.h index 82123a529a3..63b01ffac80 100644 --- a/innobase/include/sync0rw.h +++ b/innobase/include/sync0rw.h @@ -62,7 +62,7 @@ location (which must be appropriately aligned). The rw-lock is initialized to the non-locked state. Explicit freeing of the rw-lock with rw_lock_free is necessary only if the memory block containing it is freed. */ -#define rw_lock_create(L) rw_lock_create_func((L), IB__FILE__, __LINE__) +#define rw_lock_create(L) rw_lock_create_func((L), __FILE__, __LINE__) /*=====================*/ /********************************************************************** Creates, or rather, initializes an rw-lock object in a specified memory @@ -74,7 +74,7 @@ void rw_lock_create_func( /*================*/ rw_lock_t* lock, /* in: pointer to memory */ - char* cfile_name, /* in: file name where created */ + const char* cfile_name, /* in: file name where created */ ulint cline); /* in: file line where created */ /********************************************************************** Calling this function is obligatory only if the memory buffer containing @@ -100,19 +100,19 @@ NOTE! The following macros should be used in rw s-locking, not the corresponding function. */ #define rw_lock_s_lock(M) rw_lock_s_lock_func(\ - (M), 0, IB__FILE__, __LINE__) + (M), 0, __FILE__, __LINE__) /****************************************************************** NOTE! The following macros should be used in rw s-locking, not the corresponding function. */ #define rw_lock_s_lock_gen(M, P) rw_lock_s_lock_func(\ - (M), (P), IB__FILE__, __LINE__) + (M), (P), __FILE__, __LINE__) /****************************************************************** NOTE! The following macros should be used in rw s-locking, not the corresponding function. */ #define rw_lock_s_lock_nowait(M) rw_lock_s_lock_func_nowait(\ - (M), IB__FILE__, __LINE__) + (M), __FILE__, __LINE__) /********************************************************************** NOTE! Use the corresponding macro, not directly this function, except if you supply the file name and line number. Lock an rw-lock in shared mode @@ -127,7 +127,7 @@ rw_lock_s_lock_func( rw_lock_t* lock, /* in: pointer to rw-lock */ ulint pass, /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line); /* in: line where requested */ /********************************************************************** NOTE! Use the corresponding macro, not directly this function, except if @@ -139,7 +139,7 @@ rw_lock_s_lock_func_nowait( /*=======================*/ /* out: TRUE if success */ rw_lock_t* lock, /* in: pointer to rw-lock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line); /* in: line where requested */ /********************************************************************** NOTE! Use the corresponding macro, not directly this function! Lock an @@ -151,7 +151,7 @@ rw_lock_x_lock_func_nowait( /*=======================*/ /* out: TRUE if success */ rw_lock_t* lock, /* in: pointer to rw-lock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line); /* in: line where requested */ /********************************************************************** Releases a shared mode lock. */ @@ -186,19 +186,19 @@ NOTE! The following macro should be used in rw x-locking, not the corresponding function. */ #define rw_lock_x_lock(M) rw_lock_x_lock_func(\ - (M), 0, IB__FILE__, __LINE__) + (M), 0, __FILE__, __LINE__) /****************************************************************** NOTE! The following macro should be used in rw x-locking, not the corresponding function. */ #define rw_lock_x_lock_gen(M, P) rw_lock_x_lock_func(\ - (M), (P), IB__FILE__, __LINE__) + (M), (P), __FILE__, __LINE__) /****************************************************************** NOTE! The following macros should be used in rw x-locking, not the corresponding function. */ #define rw_lock_x_lock_nowait(M) rw_lock_x_lock_func_nowait(\ - (M), IB__FILE__, __LINE__) + (M), __FILE__, __LINE__) /********************************************************************** NOTE! Use the corresponding macro, not directly this function! Lock an rw-lock in exclusive mode for the current thread. If the rw-lock is locked @@ -215,7 +215,7 @@ rw_lock_x_lock_func( rw_lock_t* lock, /* in: pointer to rw-lock */ ulint pass, /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line); /* in: line where requested */ /********************************************************************** Releases an exclusive mode lock. */ @@ -253,9 +253,9 @@ UNIV_INLINE void rw_lock_s_lock_direct( /*==================*/ - rw_lock_t* lock /* in: pointer to rw-lock */ - ,char* file_name, /* in: file name where lock requested */ - ulint line /* in: line where requested */ + rw_lock_t* lock, /* in: pointer to rw-lock */ + const char* file_name, /* in: file name where requested */ + ulint line /* in: line where lock requested */ ); /********************************************************************** Low-level function which locks an rw-lock in x-mode when we know that it @@ -265,9 +265,9 @@ UNIV_INLINE void rw_lock_x_lock_direct( /*==================*/ - rw_lock_t* lock /* in: pointer to rw-lock */ - ,char* file_name, /* in: file name where lock requested */ - ulint line /* in: line where requested */ + rw_lock_t* lock, /* in: pointer to rw-lock */ + const char* file_name, /* in: file name where requested */ + ulint line /* in: line where lock requested */ ); /********************************************************************** This function is used in the insert buffer to move the ownership of an @@ -451,10 +451,10 @@ struct rw_lock_struct { #endif /* UNIV_SYNC_DEBUG */ ulint level; /* Level in the global latching order; default SYNC_LEVEL_NONE */ - char* cfile_name; /* File name where lock created */ + const char* cfile_name;/* File name where lock created */ ulint cline; /* Line where created */ - char* last_s_file_name;/* File name where last time s-locked */ - char* last_x_file_name;/* File name where last time x-locked */ + const char* last_s_file_name;/* File name where last s-locked */ + const char* last_x_file_name;/* File name where last x-locked */ ulint last_s_line; /* Line number where last time s-locked */ ulint last_x_line; /* Line number where last time x-locked */ ulint magic_n; @@ -471,7 +471,7 @@ struct rw_lock_debug_struct { ulint pass; /* Pass value given in the lock operation */ ulint lock_type; /* Type of the lock: RW_LOCK_EX, RW_LOCK_SHARED, RW_LOCK_WAIT_EX */ - char* file_name; /* File name where the lock was obtained */ + const char* file_name;/* File name where the lock was obtained */ ulint line; /* Line where the rw-lock was locked */ UT_LIST_NODE_T(rw_lock_debug_t) list; /* Debug structs are linked in a two-way diff --git a/innobase/include/sync0rw.ic b/innobase/include/sync0rw.ic index 8fc93f4a9da..655bd7f6517 100644 --- a/innobase/include/sync0rw.ic +++ b/innobase/include/sync0rw.ic @@ -18,7 +18,7 @@ rw_lock_s_lock_spin( rw_lock_t* lock, /* in: pointer to rw-lock */ ulint pass, /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line); /* in: line where requested */ #ifdef UNIV_SYNC_DEBUG /********************************************************************** @@ -130,7 +130,7 @@ rw_lock_s_lock_low( ulint pass __attribute__((unused)), /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name, /* in: file name where lock requested */ + const char* file_name, /* in: file name where lock requested */ ulint line) /* in: line where requested */ { #ifdef UNIV_SYNC_DEBUG @@ -163,9 +163,9 @@ UNIV_INLINE void rw_lock_s_lock_direct( /*==================*/ - rw_lock_t* lock, /* in: pointer to rw-lock */ - char* file_name,/* in: file name where lock requested */ - ulint line) /* in: line where requested */ + rw_lock_t* lock, /* in: pointer to rw-lock */ + const char* file_name, /* in: file name where requested */ + ulint line) /* in: line where lock requested */ { ut_ad(lock->writer == RW_LOCK_NOT_LOCKED); ut_ad(rw_lock_get_reader_count(lock) == 0); @@ -189,9 +189,9 @@ UNIV_INLINE void rw_lock_x_lock_direct( /*==================*/ - rw_lock_t* lock, /* in: pointer to rw-lock */ - char* file_name, /* in: file name where lock requested */ - ulint line) /* in: line where requested */ + rw_lock_t* lock, /* in: pointer to rw-lock */ + const char* file_name, /* in: file name where requested */ + ulint line) /* in: line where lock requested */ { ut_ad(rw_lock_validate(lock)); ut_ad(rw_lock_get_reader_count(lock) == 0); @@ -223,7 +223,7 @@ rw_lock_s_lock_func( rw_lock_t* lock, /* in: pointer to rw-lock */ ulint pass, /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name, /* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line) /* in: line where requested */ { /* NOTE: As we do not know the thread ids for threads which have @@ -267,7 +267,7 @@ rw_lock_s_lock_func_nowait( /*=======================*/ /* out: TRUE if success */ rw_lock_t* lock, /* in: pointer to rw-lock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line) /* in: line where requested */ { ibool success = FALSE; @@ -304,7 +304,7 @@ rw_lock_x_lock_func_nowait( /*=======================*/ /* out: TRUE if success */ rw_lock_t* lock, /* in: pointer to rw-lock */ - char* file_name, /* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line) /* in: line where requested */ { ibool success = FALSE; diff --git a/innobase/include/sync0sync.h b/innobase/include/sync0sync.h index 0cc48d5f299..4307ca5ba0c 100644 --- a/innobase/include/sync0sync.h +++ b/innobase/include/sync0sync.h @@ -36,7 +36,7 @@ in the reset state. Explicit freeing of the mutex with mutex_free is necessary only if the memory block containing it is freed. */ -#define mutex_create(M) mutex_create_func((M), IB__FILE__, __LINE__) +#define mutex_create(M) mutex_create_func((M), __FILE__, __LINE__) /*===================*/ /********************************************************************** Creates, or rather, initializes a mutex object in a specified memory @@ -48,7 +48,7 @@ void mutex_create_func( /*==============*/ mutex_t* mutex, /* in: pointer to memory */ - char* cfile_name, /* in: file name where created */ + const char* cfile_name, /* in: file name where created */ ulint cline); /* in: file line where created */ /********************************************************************** Calling this function is obligatory only if the memory buffer containing @@ -64,7 +64,7 @@ mutex_free( NOTE! The following macro should be used in mutex locking, not the corresponding function. */ -#define mutex_enter(M) mutex_enter_func((M), IB__FILE__, __LINE__) +#define mutex_enter(M) mutex_enter_func((M), __FILE__, __LINE__) /********************************************************************** A noninlined function that reserves a mutex. In ha_innodb.cc we have disabled inlining of InnoDB functions, and no inlined functions should be called from @@ -80,7 +80,7 @@ corresponding function. */ /* NOTE! currently same as mutex_enter! */ -#define mutex_enter_fast(M) mutex_enter_func((M), IB__FILE__, __LINE__) +#define mutex_enter_fast(M) mutex_enter_func((M), __FILE__, __LINE__) #define mutex_enter_fast_func mutex_enter_func; /********************************************************************** NOTE! Use the corresponding macro in the header file, not this function @@ -92,7 +92,7 @@ void mutex_enter_func( /*=============*/ mutex_t* mutex, /* in: pointer to mutex */ - char* file_name, /* in: file name where locked */ + const char* file_name, /* in: file name where locked */ ulint line); /* in: line where locked */ /************************************************************************ Tries to lock the mutex for the current thread. If the lock is not acquired @@ -103,9 +103,9 @@ mutex_enter_nowait( /*===============*/ /* out: 0 if succeed, 1 if not */ mutex_t* mutex, /* in: pointer to mutex */ - char* file_name, /* in: file name where mutex + const char* file_name, /* in: file name where mutex requested */ - ulint line); /* in: line where requested */ + ulint line); /* in: line where requested */ /********************************************************************** Unlocks a mutex owned by the current thread. */ UNIV_INLINE @@ -470,7 +470,7 @@ struct mutex_struct { #endif /* UNIV_SYNC_DEBUG */ ulint level; /* Level in the global latching order; default SYNC_LEVEL_NONE */ - char* cfile_name; /* File name where mutex created */ + const char* cfile_name;/* File name where mutex created */ ulint cline; /* Line where created */ ulint magic_n; }; diff --git a/innobase/include/sync0sync.ic b/innobase/include/sync0sync.ic index 758c8524f66..ecb498918e2 100644 --- a/innobase/include/sync0sync.ic +++ b/innobase/include/sync0sync.ic @@ -23,7 +23,7 @@ void mutex_spin_wait( /*============*/ mutex_t* mutex, /* in: pointer to mutex */ - char* file_name,/* in: file name where mutex requested */ + const char* file_name,/* in: file name where mutex requested */ ulint line); /* in: line where requested */ #ifdef UNIV_SYNC_DEBUG /********************************************************************** @@ -241,9 +241,9 @@ UNIV_INLINE void mutex_enter_func( /*=============*/ - mutex_t* mutex, /* in: pointer to mutex */ - char* file_name,/* in: file name where locked */ - ulint line) /* in: line where locked */ + mutex_t* mutex, /* in: pointer to mutex */ + const char* file_name, /* in: file name where locked */ + ulint line) /* in: line where locked */ { ut_ad(mutex_validate(mutex)); diff --git a/innobase/include/trx0roll.h b/innobase/include/trx0roll.h index 0d7126c9c57..aa88fc249fc 100644 --- a/innobase/include/trx0roll.h +++ b/innobase/include/trx0roll.h @@ -91,16 +91,12 @@ trx_undo_rec_release( /************************************************************************* Starts a rollback operation. */ -void +que_thr_t* trx_rollback( /*=========*/ + /* out: next query thread to run */ trx_t* trx, /* in: transaction */ - trx_sig_t* sig, /* in: signal starting the rollback */ - que_thr_t** next_thr);/* in/out: next query thread to run; - if the value which is passed in is - a pointer to a NULL pointer, then the - calling function can start running - a new query thread */ + trx_sig_t* sig); /* in: signal starting the rollback */ /*********************************************************************** Rollback or clean up transactions which have no user session. If the transaction already was committed, then we clean up a possible insert @@ -112,17 +108,12 @@ trx_rollback_or_clean_all_without_sess(void); /******************************************************************** Finishes a transaction rollback. */ -void +que_thr_t* trx_finish_rollback_off_kernel( /*===========================*/ + /* out: next query thread to run */ que_t* graph, /* in: undo graph which can now be freed */ - trx_t* trx, /* in: transaction */ - que_thr_t** next_thr);/* in/out: next query thread to run; - if the value which is passed in is - a pointer to a NULL pointer, then the - calling function can start running - a new query thread; if this parameter is - NULL, it is ignored */ + trx_t* trx); /* in: transaction */ /******************************************************************** Builds an undo 'query' graph for a transaction. The actual rollback is performed by executing this query graph like a query subprocedure call. @@ -193,7 +184,7 @@ trx_rollback_to_savepoint_for_mysql( DB_NO_SAVEPOINT, otherwise DB_SUCCESS */ trx_t* trx, /* in: transaction handle */ - char* savepoint_name, /* in: savepoint name */ + const char* savepoint_name, /* in: savepoint name */ ib_longlong* mysql_binlog_cache_pos);/* out: the MySQL binlog cache position corresponding to this savepoint; MySQL needs this @@ -211,7 +202,7 @@ trx_savepoint_for_mysql( /*====================*/ /* out: always DB_SUCCESS */ trx_t* trx, /* in: transaction handle */ - char* savepoint_name, /* in: savepoint name */ + const char* savepoint_name, /* in: savepoint name */ ib_longlong binlog_cache_pos); /* in: MySQL binlog cache position corresponding to this connection at the time of the diff --git a/innobase/include/trx0sys.h b/innobase/include/trx0sys.h index 9987955ec76..7d20455ffdf 100644 --- a/innobase/include/trx0sys.h +++ b/innobase/include/trx0sys.h @@ -258,7 +258,7 @@ replication has proceeded. */ void trx_sys_update_mysql_binlog_offset( /*===============================*/ - char* file_name,/* in: MySQL log file name */ + const char* file_name,/* in: MySQL log file name */ ib_longlong offset, /* in: position in that log file */ ulint field, /* in: offset of the MySQL log info field in the trx sys header */ diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 71269cb1e4e..9b7ac22e617 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -194,9 +194,10 @@ trx_end_lock_wait( /******************************************************************** Sends a signal to a trx object. */ -ibool +que_thr_t* trx_sig_send( /*=========*/ + /* out: next query thread to run */ /* out: TRUE if the signal was successfully delivered */ trx_t* trx, /* in: trx handle */ @@ -206,27 +207,17 @@ trx_sig_send( que_thr_t* receiver_thr, /* in: query thread which wants the reply, or NULL; if type is TRX_SIG_END_WAIT, this must be NULL */ - trx_savept_t* savept, /* in: possible rollback savepoint, or + trx_savept_t* savept); /* in: possible rollback savepoint, or NULL */ - que_thr_t** next_thr); /* in/out: next query thread to run; - if the value which is passed in is - a pointer to a NULL pointer, then the - calling function can start running - a new query thread; if the parameter - is NULL, it is ignored */ /******************************************************************** Send the reply message when a signal in the queue of the trx has been handled. */ -void +que_thr_t* trx_sig_reply( /*==========*/ - trx_sig_t* sig, /* in: signal */ - que_thr_t** next_thr); /* in/out: next query thread to run; - if the value which is passed in is - a pointer to a NULL pointer, then the - calling function can start running - a new query thread */ + /* out: next query thread to run */ + trx_sig_t* sig); /* in: signal */ /******************************************************************** Removes the signal object from a trx signal queue. */ @@ -238,15 +229,11 @@ trx_sig_remove( /******************************************************************** Starts handling of a trx signal. */ -void +que_thr_t* trx_sig_start_handle( /*=================*/ - trx_t* trx, /* in: trx handle */ - que_thr_t** next_thr); /* in/out: next query thread to run; - if the value which is passed in is - a pointer to a NULL pointer, then the - calling function can start running - a new query thread */ + /* out: next query thread to run, or NULL */ + trx_t* trx); /* in: trx handle */ /******************************************************************** Ends signal handling. If the session is in the error state, and trx->graph_before_signal_handling != NULL, returns control to the error @@ -275,13 +262,15 @@ trx_commit_step( que_thr_t* thr); /* in: query thread */ /************************************************************************** Prints info about a transaction to the standard output. The caller must -own the kernel mutex. */ +own the kernel mutex and must have called +innobase_mysql_prepare_print_arbitrary_thd(), unless he knows that MySQL or +InnoDB cannot meanwhile change the info printed here. */ void trx_print( /*======*/ FILE* f, /* in: output stream */ - trx_t* trx); /* in: transaction */ + trx_t* trx); /* in: transaction */ /* Signal to a transaction */ @@ -313,7 +302,7 @@ struct trx_struct{ ulint magic_n; /* All the next fields are protected by the kernel mutex, except the undo logs which are protected by undo_mutex */ - char* op_info; /* English text describing the + const char* op_info; /* English text describing the current operation, or an empty string */ ulint type; /* TRX_USER, TRX_PURGE */ @@ -356,7 +345,7 @@ struct trx_struct{ char** mysql_query_str;/* pointer to the field in mysqld_thd which contains the pointer to the current SQL query string */ - char* mysql_log_file_name; + const char* mysql_log_file_name; /* if MySQL binlog is used, this field contains a pointer to the latest file name; this is NULL if binlog is not @@ -364,7 +353,7 @@ struct trx_struct{ ib_longlong mysql_log_offset;/* if MySQL binlog is used, this field contains the end offset of the binlog entry */ - char* mysql_master_log_file_name; + const char* mysql_master_log_file_name; /* if the database server is a MySQL replication slave, we have here the master binlog name up to which diff --git a/innobase/include/univ.i b/innobase/include/univ.i index cd471a89607..be71d4211b3 100644 --- a/innobase/include/univ.i +++ b/innobase/include/univ.i @@ -242,11 +242,6 @@ contains the sum of the following flag and the locally stored len. */ #define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE) -/* The following definition of __FILE__ removes compiler warnings -associated with const char* / char* mismatches with __FILE__ */ - -#define IB__FILE__ ((char*)__FILE__) - #include #include "ut0dbg.h" #include "ut0ut.h" diff --git a/innobase/include/usr0sess.h b/innobase/include/usr0sess.h index c7bcfb20fed..aeff7191e68 100644 --- a/innobase/include/usr0sess.h +++ b/innobase/include/usr0sess.h @@ -38,7 +38,6 @@ sess_try_close( /* The session handle. All fields are protected by the kernel mutex */ struct sess_struct{ - ulint state; /* state of the session */ trx_t* trx; /* transaction object permanently assigned for the session: the transaction instance designated by the @@ -49,11 +48,6 @@ struct sess_struct{ session */ }; -/* Session states */ -#define SESS_ACTIVE 1 -#define SESS_ERROR 2 /* session contains an error message - which has not yet been communicated - to the client */ #ifndef UNIV_NONINL #include "usr0sess.ic" #endif diff --git a/innobase/include/ut0dbg.h b/innobase/include/ut0dbg.h index 085b4811a73..a155f68bd12 100644 --- a/innobase/include/ut0dbg.h +++ b/innobase/include/ut0dbg.h @@ -27,7 +27,7 @@ extern const char* ut_dbg_msg_stop; if (!((ulint)(EXPR) + ut_dbg_zero)) {\ ut_print_timestamp(stderr);\ fprintf(stderr, ut_dbg_msg_assert_fail,\ - os_thread_pf(os_thread_get_curr_id()), IB__FILE__,\ + os_thread_pf(os_thread_get_curr_id()), __FILE__,\ (ulint)__LINE__);\ fputs("InnoDB: Failing assertion: " #EXPR "\n", stderr);\ fputs(ut_dbg_msg_trap, stderr);\ @@ -36,7 +36,7 @@ extern const char* ut_dbg_msg_stop; }\ if (ut_dbg_stop_threads) {\ fprintf(stderr, ut_dbg_msg_stop,\ - os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\ + os_thread_pf(os_thread_get_curr_id()), __FILE__, (ulint)__LINE__);\ os_thread_sleep(1000000000);\ }\ } while (0) @@ -44,7 +44,7 @@ extern const char* ut_dbg_msg_stop; #define ut_error do {\ ut_print_timestamp(stderr);\ fprintf(stderr, ut_dbg_msg_assert_fail,\ - os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\ + os_thread_pf(os_thread_get_curr_id()), __FILE__, (ulint)__LINE__);\ fprintf(stderr, ut_dbg_msg_trap);\ ut_dbg_stop_threads = TRUE;\ if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL;\ diff --git a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h index b208fac8691..85b99efff68 100644 --- a/innobase/include/ut0mem.h +++ b/innobase/include/ut0mem.h @@ -18,15 +18,15 @@ extern ulint ut_total_allocated_memory; UNIV_INLINE void* -ut_memcpy(void* dest, void* sour, ulint n); +ut_memcpy(void* dest, const void* sour, ulint n); UNIV_INLINE void* -ut_memmove(void* dest, void* sour, ulint n); +ut_memmove(void* dest, const void* sour, ulint n); UNIV_INLINE int -ut_memcmp(void* str1, void* str2, ulint n); +ut_memcmp(const void* str1, const void* str2, ulint n); /************************************************************************** @@ -75,7 +75,7 @@ ut_free_all_mem(void); UNIV_INLINE char* -ut_strcpy(char* dest, char* sour); +ut_strcpy(char* dest, const char* sour); UNIV_INLINE ulint @@ -83,7 +83,7 @@ ut_strlen(const char* str); UNIV_INLINE int -ut_strcmp(void* str1, void* str2); +ut_strcmp(const void* str1, const void* str2); /************************************************************************** Determine the length of a string when it is quoted with ut_strcpyq(). */ @@ -118,27 +118,6 @@ ut_memcpyq( const char* src, /* in: string to be quoted */ ulint len); /* in: length of src */ -/************************************************************************** -Catenates two strings into newly allocated memory. The memory must be freed -using mem_free. */ - -char* -ut_str_catenate( -/*============*/ - /* out, own: catenated null-terminated string */ - char* str1, /* in: null-terminated string */ - char* str2); /* in: null-terminated string */ - -/************************************************************************** -Return a copy of the given string. The returned string must be freed -using mem_free. */ - -char* -ut_strdup( -/*======*/ - /* out, own: cnull-terminated string */ - char* str); /* in: null-terminated string */ - #ifndef UNIV_NONINL #include "ut0mem.ic" #endif diff --git a/innobase/include/ut0mem.ic b/innobase/include/ut0mem.ic index 951d9538424..3bb30a80f22 100644 --- a/innobase/include/ut0mem.ic +++ b/innobase/include/ut0mem.ic @@ -8,28 +8,28 @@ Created 5/30/1994 Heikki Tuuri UNIV_INLINE void* -ut_memcpy(void* dest, void* sour, ulint n) +ut_memcpy(void* dest, const void* sour, ulint n) { return(memcpy(dest, sour, n)); } UNIV_INLINE void* -ut_memmove(void* dest, void* sour, ulint n) +ut_memmove(void* dest, const void* sour, ulint n) { return(memmove(dest, sour, n)); } UNIV_INLINE int -ut_memcmp(void* str1, void* str2, ulint n) +ut_memcmp(const void* str1, const void* str2, ulint n) { return(memcmp(str1, str2, n)); } UNIV_INLINE char* -ut_strcpy(char* dest, char* sour) +ut_strcpy(char* dest, const char* sour) { return(strcpy(dest, sour)); } @@ -43,9 +43,9 @@ ut_strlen(const char* str) UNIV_INLINE int -ut_strcmp(void* str1, void* str2) +ut_strcmp(const void* str1, const void* str2) { - return(strcmp((char*)str1, (char*)str2)); + return(strcmp((const char*)str1, (const char*)str2)); } /************************************************************************** diff --git a/innobase/include/ut0rnd.h b/innobase/include/ut0rnd.h index c8ef0dd4001..aeec5d2f6eb 100644 --- a/innobase/include/ut0rnd.h +++ b/innobase/include/ut0rnd.h @@ -92,17 +92,17 @@ UNIV_INLINE ulint ut_fold_string( /*===========*/ - /* out: folded value */ - char* str); /* in: null-terminated string */ + /* out: folded value */ + const char* str); /* in: null-terminated string */ /***************************************************************** Folds a binary string. */ UNIV_INLINE ulint ut_fold_binary( /*===========*/ - /* out: folded value */ - byte* str, /* in: string of bytes */ - ulint len); /* in: length */ + /* out: folded value */ + const byte* str, /* in: string of bytes */ + ulint len); /* in: length */ /*************************************************************** Looks for a prime number slightly greater than the given argument. The prime is chosen so that it is not near any power of 2. */ diff --git a/innobase/include/ut0rnd.ic b/innobase/include/ut0rnd.ic index 5493c37404a..06d7012f60b 100644 --- a/innobase/include/ut0rnd.ic +++ b/innobase/include/ut0rnd.ic @@ -173,8 +173,8 @@ UNIV_INLINE ulint ut_fold_string( /*===========*/ - /* out: folded value */ - char* str) /* in: null-terminated string */ + /* out: folded value */ + const char* str) /* in: null-terminated string */ { #ifdef UNIV_DEBUG ulint i = 0; @@ -203,9 +203,9 @@ UNIV_INLINE ulint ut_fold_binary( /*===========*/ - /* out: folded value */ - byte* str, /* in: string of bytes */ - ulint len) /* in: length */ + /* out: folded value */ + const byte* str, /* in: string of bytes */ + ulint len) /* in: length */ { ulint i; ulint fold = 0; diff --git a/innobase/include/ut0ut.h b/innobase/include/ut0ut.h index 6c173f5cba9..f4a682c57ec 100644 --- a/innobase/include/ut0ut.h +++ b/innobase/include/ut0ut.h @@ -17,53 +17,6 @@ Created 1/20/1994 Heikki Tuuri typedef time_t ib_time_t; - -/************************************************************ -On the 64-bit Windows we substitute the format string -%l -> %I64 -because we define ulint as unsigned __int64 and lint as __int64 on Windows, -and both the Microsoft and Intel C compilers require the format string -%I64 in that case instead of %l. */ - -int -ut_printf( -/*======*/ - /* out: the number of characters written, or - negative in case of an error */ - const char* format, /* in: format of prints */ - ...); /* in: arguments to be printed */ -/************************************************************ -On the 64-bit Windows we substitute the format string -%l -> %I64 -because we define ulint as unsigned __int64 and lint as __int64 on Windows, -and both the Microsoft and Intel C compilers require the format string -%I64 in that case instead of %l. */ - -int -ut_sprintf( -/*=======*/ - /* out: the number of characters written, or - negative in case of an error */ - char* buf, /* in: buffer where to print */ - const char* format, /* in: format of prints */ - ...); /* in: arguments to be printed */ -/************************************************************ -On the 64-bit Windows we substitute the format string -%l -> %I64 -because we define ulint as unsigned __int64 and lint as __int64 on Windows, -and both the Microsoft and Intel C compilers require the format string -%I64 in that case instead of %l. */ - -int -ut_fprintf( -/*=======*/ - /* out: the number of characters written, or - negative in case of an error */ - FILE* stream, /* in: stream where to print */ - const char* format, /* in: format of prints */ - ...) /* in: arguments to be printed */ - __attribute__((__format__ (__printf__, 2, 3))); - /************************************************************ Gets the high 32 bits in a ulint. That is makes a shift >> 32, but since there seem to be compiler bugs in both gcc and Visual C++, diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index 8805a22bb57..223d9af78d1 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -17,6 +17,32 @@ Created 5/7/1996 Heikki Tuuri #include "dict0mem.h" #include "trx0sys.h" + +/* 2 function prototypes copied from ha_innodb.cc: */ + +/***************************************************************** +If you want to print a thd that is not associated with the current thread, +you must call this function before reserving the InnoDB kernel_mutex, to +protect MySQL from setting thd->query NULL. If you print a thd of the current +thread, we know that MySQL cannot modify thd->query, and it is not necessary +to call this. Call innobase_mysql_end_print_arbitrary_thd() after you release +the kernel_mutex. +NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this +function! */ + +void +innobase_mysql_prepare_print_arbitrary_thd(void); +/*============================================*/ + +/***************************************************************** +Relases the mutex reserved by innobase_mysql_prepare_print_arbitrary_thd(). +NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this +function! */ + +void +innobase_mysql_end_print_arbitrary_thd(void); +/*========================================*/ + /* Restricts the length of search we will do in the waits-for graph of transactions */ #define LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK 1000000 @@ -1629,7 +1655,8 @@ lock_rec_enqueue_waiting( " InnoDB: Error: a record lock wait happens in a dictionary operation!\n" "InnoDB: Table name ", stderr); ut_print_name(stderr, index->table_name); - fputs(". Send a bug report to mysql@lists.mysql.com\n", + fputs(".\n" +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr); } @@ -3269,7 +3296,8 @@ lock_table_enqueue_waiting( " InnoDB: Error: a table lock wait happens in a dictionary operation!\n" "InnoDB: Table name ", stderr); ut_print_name(stderr, table->name); - fputs(". Send a bug report to mysql@lists.mysql.com\n", + fputs(".\n" +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr); } @@ -3889,7 +3917,7 @@ lock_rec_print( page = buf_page_get_gen(space, page_no, RW_NO_LATCH, NULL, BUF_GET_IF_IN_POOL, - IB__FILE__, __LINE__, &mtr); + __FILE__, __LINE__, &mtr); if (page) { page = buf_page_get_nowait(space, page_no, RW_S_LATCH, &mtr); @@ -3975,6 +4003,11 @@ lock_print_info( ulint i; mtr_t mtr; + /* We must protect the MySQL thd->query field with a MySQL mutex, and + because the MySQL mutex must be reserved before the kernel_mutex of + InnoDB, we call innobase_mysql_prepare_print_arbitrary_thd() here. */ + + innobase_mysql_prepare_print_arbitrary_thd(); lock_mutex_enter_kernel(); if (lock_deadlock_found) { @@ -4038,6 +4071,7 @@ loop: if (trx == NULL) { lock_mutex_exit_kernel(); + innobase_mysql_end_print_arbitrary_thd(); ut_ad(lock_validate()); @@ -4102,6 +4136,7 @@ loop: if (load_page_first) { lock_mutex_exit_kernel(); + innobase_mysql_end_print_arbitrary_thd(); mtr_start(&mtr); @@ -4111,6 +4146,7 @@ loop: load_page_first = FALSE; + innobase_mysql_prepare_print_arbitrary_thd(); lock_mutex_enter_kernel(); goto loop; diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c index 4f4220962f0..65fb3466ad5 100644 --- a/innobase/log/log0recv.c +++ b/innobase/log/log0recv.c @@ -1080,7 +1080,7 @@ recv_recover_page( success = buf_page_get_known_nowait(RW_X_LATCH, page, BUF_KEEP_OLD, - IB__FILE__, __LINE__, + __FILE__, __LINE__, &mtr); ut_a(success); @@ -1664,7 +1664,7 @@ recv_compare_spaces( frame = buf_page_get_gen(space1, page_no, RW_S_LATCH, NULL, BUF_GET_IF_IN_POOL, - IB__FILE__, __LINE__, + __FILE__, __LINE__, &mtr); if (frame) { #ifdef UNIV_SYNC_DEBUG @@ -1679,7 +1679,7 @@ recv_compare_spaces( frame = buf_page_get_gen(space2, page_no, RW_S_LATCH, NULL, BUF_GET_IF_IN_POOL, - IB__FILE__, __LINE__, + __FILE__, __LINE__, &mtr); if (frame) { #ifdef UNIV_SYNC_DEBUG diff --git a/innobase/mem/mem0mem.c b/innobase/mem/mem0mem.c index e1b9a762381..c090b25a632 100644 --- a/innobase/mem/mem0mem.c +++ b/innobase/mem/mem0mem.c @@ -92,11 +92,11 @@ with mem_free. */ void* mem_alloc_func_noninline( /*=====================*/ - /* out, own: free storage, NULL if did not - succeed */ - ulint n, /* in: desired number of bytes */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + /* out, own: free storage, + NULL if did not succeed */ + ulint n, /* in: desired number of bytes */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ) { return(mem_alloc_func(n, file_name, line)); @@ -108,18 +108,18 @@ Creates a memory heap block where data can be allocated. */ mem_block_t* mem_heap_create_block( /*==================*/ - /* out, own: memory heap block, NULL if did not - succeed */ - mem_heap_t* heap,/* in: memory heap or NULL if first block should - be created */ - ulint n, /* in: number of bytes needed for user data, or - if init_block is not NULL, its size in bytes */ - void* init_block, /* in: init block in fast create, type must be - MEM_HEAP_DYNAMIC */ - ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC, or - MEM_HEAP_BUFFER possibly ORed to MEM_HEAP_BTR_SEARCH */ - char* file_name,/* in: file name where created */ - ulint line) /* in: line where created */ + /* out, own: memory heap block, + NULL if did not succeed */ + mem_heap_t* heap, /* in: memory heap or NULL if first block + should be created */ + ulint n, /* in: number of bytes needed for user data, or + if init_block is not NULL, its size in bytes */ + void* init_block, /* in: init block in fast create, + type must be MEM_HEAP_DYNAMIC */ + ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC or + MEM_HEAP_BUFFER */ + const char* file_name,/* in: file name where created */ + ulint line) /* in: line where created */ { mem_block_t* block; ulint len; diff --git a/innobase/mem/mem0pool.c b/innobase/mem/mem0pool.c index 7f36b37f734..0227c2d0969 100644 --- a/innobase/mem/mem0pool.c +++ b/innobase/mem/mem0pool.c @@ -97,8 +97,6 @@ struct mem_pool_struct{ /* The common memory pool */ mem_pool_t* mem_comm_pool = NULL; -ulint mem_out_of_mem_err_msg_count = 0; - /* We use this counter to check that the mem pool mutex does not leak; this is to track a strange assertion failure reported at mysql@lists.mysql.com */ @@ -266,8 +264,6 @@ mem_pool_fill_free_list( if (i >= 63) { /* We come here when we have run out of space in the memory pool: */ - - mem_out_of_mem_err_msg_count++; return(FALSE); } @@ -461,17 +457,13 @@ mem_area_free( ulint size; ulint n; - if (mem_out_of_mem_err_msg_count > 0) { - /* It may be that the area was really allocated from the - OS with regular malloc: check if ptr points within - our memory pool */ + /* It may be that the area was really allocated from the OS with + regular malloc: check if ptr points within our memory pool */ - if ((byte*)ptr < pool->buf - || (byte*)ptr >= pool->buf + pool->size) { - ut_free(ptr); + if ((byte*)ptr < pool->buf || (byte*)ptr >= pool->buf + pool->size) { + ut_free(ptr); - return; - } + return; } area = (mem_area_t*) (((byte*)ptr) - MEM_AREA_EXTRA_SIZE); diff --git a/innobase/os/Makefile.am b/innobase/os/Makefile.am index 132ce07c83b..3b09a10efb5 100644 --- a/innobase/os/Makefile.am +++ b/innobase/os/Makefile.am @@ -19,7 +19,7 @@ include ../include/Makefile.i noinst_LIBRARIES = libos.a -libos_a_SOURCES = os0proc.c os0shm.c os0sync.c os0thread.c os0file.c +libos_a_SOURCES = os0proc.c os0sync.c os0thread.c os0file.c EXTRA_PROGRAMS = diff --git a/innobase/os/makefilewin b/innobase/os/makefilewin index 08dba0e5e47..8bc8d08611b 100644 --- a/innobase/os/makefilewin +++ b/innobase/os/makefilewin @@ -1,7 +1,7 @@ include ..\include\makefile.i -os.lib: os0sync.obj os0thread.obj os0shm.obj os0proc.obj os0file.obj - lib -out:..\libs\os.lib os0sync.obj os0thread.obj os0shm.obj os0proc.obj os0file.obj +os.lib: os0sync.obj os0thread.obj os0proc.obj os0file.obj + lib -out:..\libs\os.lib os0sync.obj os0thread.obj os0proc.obj os0file.obj os0sync.obj: os0sync.c $(CCOM) $(CFLW) -c os0sync.c @@ -9,9 +9,6 @@ os0sync.obj: os0sync.c os0thread.obj: os0thread.c $(CCOM) $(CFLW) -c os0thread.c -os0shm.obj: os0shm.c - $(CCOM) $(CFLW) -c os0shm.c - os0proc.obj: os0proc.c $(CCOM) $(CFLW) -c os0proc.c diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 3f14a2158ed..5f5060c7464 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -70,7 +70,7 @@ struct os_aio_slot_struct{ bytes */ ulint offset_high; /* 32 high bits of file offset */ os_file_t file; /* file where to read or write */ - char* name; /* file name or path */ + const char* name; /* file name or path */ ibool io_already_done;/* used only in simulated aio: TRUE if the physical i/o already made and only the slot message @@ -369,7 +369,16 @@ os_file_handle_error( return(FALSE); } -#if !defined(__WIN__) && !defined(UNIV_HOTBACKUP) +#undef USE_FILE_LOCK +#define USE_FILE_LOCK +#if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__FreeBSD__) +/* InnoDB Hot Backup does not lock the data files. + * On Windows, mandatory locking is used. + * On FreeBSD with LinuxThreads, advisory locking does not work properly. + */ +# undef USE_FILE_LOCK +#endif +#ifdef USE_FILE_LOCK /******************************************************************** Obtain an exclusive lock on a file. */ static @@ -378,22 +387,24 @@ os_file_lock( /*=========*/ /* out: 0 on success */ int fd, /* in: file descriptor */ - const char* name) /* in: file name */ + const char* name, /* in: file name */ + uint lock_type) /* in: lock_type */ { struct flock lk; - lk.l_type = F_WRLCK; + lk.l_type = lock_type; lk.l_whence = SEEK_SET; lk.l_start = lk.l_len = 0; if (fcntl(fd, F_SETLK, &lk) == -1) { fprintf(stderr, - "InnoDB: Unable to lock %s", name); + "InnoDB: Unable to lock %s with lock %d, error: %d", + name, lock_type, errno); perror (": fcntl"); close(fd); return(-1); } return 0; } -#endif /* !defined(__WIN__) && !defined(UNIV_HOTBACKUP) */ +#endif /* USE_FILE_LOCK */ /******************************************************************** Does error handling when a file operation fails. */ @@ -404,7 +415,7 @@ os_file_handle_error_no_exit( /* out: TRUE if we should retry the operation */ os_file_t file, /* in: file pointer */ - char* name, /* in: name of a file or NULL */ + const char* name, /* in: name of a file or NULL */ const char* operation)/* in: operation */ { ulint err; @@ -482,13 +493,15 @@ and '..' items at the start of the directory listing. */ os_file_dir_t os_file_opendir( /*============*/ - /* out: directory stream, NULL if error */ - char* dirname, /* in: directory name; it must not contain - a trailing '\' or '/' */ - ibool error_is_fatal) /* in: TRUE if we should treat an error as a - fatal error; if we try to open symlinks then - we do not wish a fatal error if it happens - not to be a directory */ + /* out: directory stream, NULL if + error */ + const char* dirname, /* in: directory name; it must not + contain a trailing '\' or '/' */ + ibool error_is_fatal) /* in: TRUE if we should treat an + error as a fatal error; if we try to + open symlinks then we do not wish a + fatal error if it happens not to be + a directory */ { os_file_dir_t dir; #ifdef __WIN__ @@ -574,7 +587,7 @@ os_file_readdir_next_file( /*======================*/ /* out: 0 if ok, -1 if error, 1 if at the end of the directory */ - char* dirname,/* in: directory name or path */ + const char* dirname,/* in: directory name or path */ os_file_dir_t dir, /* in: directory stream */ os_file_stat_t* info) /* in/out: buffer where the info is returned */ { @@ -693,12 +706,12 @@ fail_if_exists arguments is true. */ ibool os_file_create_directory( /*=====================*/ - /* out: TRUE if call succeeds, FALSE on - error */ - char* pathname, /* in: directory name as null-terminated - string */ - ibool fail_if_exists) /* in: if TRUE, pre-existing directory is - treated as an error. */ + /* out: TRUE if call succeeds, + FALSE on error */ + const char* pathname, /* in: directory name as + null-terminated string */ + ibool fail_if_exists) /* in: if TRUE, pre-existing directory + is treated as an error. */ { #ifdef __WIN__ BOOL rcode; @@ -735,18 +748,21 @@ A simple function to open or create a file. */ os_file_t os_file_create_simple( /*==================*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error), or - OS_FILE_CREATE_PATH if new file (if exists, error) and - subdirectories along its path are created (if needed)*/ - ulint access_type,/* in: OS_FILE_READ_ONLY or OS_FILE_READ_WRITE */ - ibool* success)/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file is + opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error), or + OS_FILE_CREATE_PATH if new file + (if exists, error) and subdirectories along + its path are created (if needed)*/ + ulint access_type,/* in: OS_FILE_READ_ONLY or + OS_FILE_READ_WRITE */ + ibool* success)/* out: TRUE if succeed, FALSE if error */ { #ifdef __WIN__ os_file_t file; @@ -852,8 +868,8 @@ try_again: if (retry) { goto try_again; } -#ifndef UNIV_HOTBACKUP - } else if (os_file_lock(file, name)) { +#ifdef USE_FILE_LOCK + } else if (os_file_lock(file, name, F_WRLCK)) { *success = FALSE; file = -1; #endif @@ -871,18 +887,20 @@ A simple function to open or create a file. */ os_file_t os_file_create_simple_no_error_handling( /*====================================*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error) */ - ulint access_type,/* in: OS_FILE_READ_ONLY, OS_FILE_READ_WRITE, or - OS_FILE_READ_ALLOW_DELETE; the last option is used by - a backup program reading the file */ - ibool* success)/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file + is opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error) */ + ulint access_type,/* in: OS_FILE_READ_ONLY, + OS_FILE_READ_WRITE, or + OS_FILE_READ_ALLOW_DELETE; the last option is + used by a backup program reading the file */ + ibool* success)/* out: TRUE if succeed, FALSE if error */ { #ifdef __WIN__ os_file_t file; @@ -961,8 +979,8 @@ os_file_create_simple_no_error_handling( if (file == -1) { *success = FALSE; -#ifndef UNIV_HOTBACKUP - } else if (os_file_lock(file, name)) { +#ifdef USE_FILE_LOCK + } else if (os_file_lock(file, name, F_WRLCK)) { *success = FALSE; file = -1; #endif @@ -980,25 +998,28 @@ Opens an existing file or creates a new. */ os_file_t os_file_create( /*===========*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode, /* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error), OS_FILE_OVERWRITE - if a new is created or an old overwritten, - OS_FILE_OPEN_RAW, if a raw device or disk partition - should be opened */ - ulint purpose,/* in: OS_FILE_AIO, if asynchronous, non-buffered i/o - is desired, OS_FILE_NORMAL, if any normal file; - NOTE that it also depends on type, os_aio_.. and srv_.. - variables whether we really use async i/o or - unbuffered i/o: look in the function source code for - the exact rules */ - ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */ - ibool* success)/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file + is opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error), + OS_FILE_OVERWRITE if a new file is created + or an old overwritten; + OS_FILE_OPEN_RAW, if a raw device or disk + partition should be opened */ + ulint purpose,/* in: OS_FILE_AIO, if asynchronous, + non-buffered i/o is desired, + OS_FILE_NORMAL, if any normal file; + NOTE that it also depends on type, os_aio_.. + and srv_.. variables whether we really use + async i/o or unbuffered i/o: look in the + function source code for the exact rules */ + ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */ + ibool* success)/* out: TRUE if succeed, FALSE if error */ { #ifdef __WIN__ os_file_t file; @@ -1172,8 +1193,8 @@ try_again: if (retry) { goto try_again; } -#ifndef UNIV_HOTBACKUP - } else if (os_file_lock(file, name)) { +#ifdef USE_FILE_LOCK + } else if (os_file_lock(file, name, F_WRLCK)) { *success = FALSE; file = -1; #endif @@ -1191,8 +1212,8 @@ Deletes a file if it exists. The file has to be closed before calling this. */ ibool os_file_delete_if_exists( /*=====================*/ - /* out: TRUE if success */ - char* name) /* in: file path as a null-terminated string */ + /* out: TRUE if success */ + const char* name) /* in: file path as a null-terminated string */ { #ifdef __WIN__ BOOL ret; @@ -1252,8 +1273,8 @@ Deletes a file. The file has to be closed before calling this. */ ibool os_file_delete( /*===========*/ - /* out: TRUE if success */ - char* name) /* in: file path as a null-terminated string */ + /* out: TRUE if success */ + const char* name) /* in: file path as a null-terminated string */ { #ifdef __WIN__ BOOL ret; @@ -1316,9 +1337,9 @@ ibool os_file_rename( /*===========*/ /* out: TRUE if success */ - char* oldpath, /* in: old file path as a null-terminated + const char* oldpath,/* in: old file path as a null-terminated string */ - char* newpath) /* in: new file path */ + const char* newpath)/* in: new file path */ { #ifdef __WIN__ BOOL ret; @@ -1329,7 +1350,7 @@ os_file_rename( return(TRUE); } - os_file_handle_error(NULL, oldpath, "delete"); + os_file_handle_error(NULL, oldpath, "rename"); return(FALSE); #else @@ -1374,6 +1395,9 @@ os_file_close( #else int ret; +#ifdef USE_FILE_LOCK + (void) os_file_lock(file, "unknown", F_UNLCK); +#endif ret = close(file); if (ret == -1) { @@ -1410,6 +1434,9 @@ os_file_close_no_error_handling( #else int ret; +#ifdef USE_FILE_LOCK + (void) os_file_lock(file, "unknown", F_UNLCK); +#endif ret = close(file); if (ret == -1) { @@ -1499,7 +1526,7 @@ ibool os_file_set_size( /*=============*/ /* out: TRUE if success */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ ulint size, /* in: least significant 32 bits of file @@ -1760,7 +1787,7 @@ os_file_pwrite( /*===========*/ /* out: number of bytes written, -1 if error */ os_file_t file, /* in: handle to a file */ - void* buf, /* in: buffer from where to write */ + const void* buf, /* in: buffer from where to write */ ulint n, /* in: number of bytes to write */ ulint offset, /* in: least significant 32 bits of file offset where to write */ @@ -2040,10 +2067,10 @@ os_file_write( /*==========*/ /* out: TRUE if request was successful, FALSE if fail */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ - void* buf, /* in: buffer from which to write */ + const void* buf, /* in: buffer from which to write */ ulint offset, /* in: least significant 32 bits of file offset where to write */ ulint offset_high, /* in: most significant 32 bits of @@ -2197,7 +2224,7 @@ ibool os_file_status( /*===========*/ /* out: TRUE if call succeeded */ - char* path, /* in: pathname of the file */ + const char* path, /* in: pathname of the file */ ibool* exists, /* out: TRUE if file exists */ os_file_type_t* type) /* out: type of the file (if it exists) */ { @@ -2302,7 +2329,7 @@ os_file_dirname( /*============*/ /* out, own: directory component of the pathname */ - char* path) /* in: pathname */ + const char* path) /* in: pathname */ { char* dir; int i, length, last_slash; @@ -2314,18 +2341,18 @@ os_file_dirname( if (last_slash < 0) { /* no slash in the path, return "." */ - return(ut_strdup((char*)".")); + return(mem_strdup(".")); } /* ok, there is a slash */ if (last_slash == 0) { /* last slash is the first char of the path */ - return(ut_strdup((char*)"/")); + return(mem_strdup("/")); } /* non-trivial directory component */ - dir = ut_strdup(path); + dir = mem_strdup(path); dir[last_slash] = 0; return(dir); @@ -2339,7 +2366,7 @@ os_file_create_subdirs_if_needed( /*=============================*/ /* out: TRUE if call succeeded FALSE otherwise */ - char* path) /* in: path name */ + const char* path) /* in: path name */ { char* subdir; static char rootdir[2] = { OS_FILE_PATH_SEPARATOR, 0 }; @@ -2736,7 +2763,7 @@ os_aio_array_reserve_slot( void* message2,/* in: message to be passed along with the aio operation */ os_file_t file, /* in: file handle */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ void* buf, /* in: buffer where to read or from which to write */ @@ -2983,7 +3010,7 @@ os_aio( because i/os are not actually handled until all have been posted: use with great caution! */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ void* buf, /* in: buffer where to read or from which @@ -3526,6 +3553,7 @@ consecutive_loop: if (n_consecutive == 1) { /* We can use the buffer of the i/o request */ combined_buf = slot->buf; + combined_buf2 = NULL; } else { combined_buf2 = ut_malloc(total_len + UNIV_PAGE_SIZE); @@ -3621,7 +3649,7 @@ consecutive_loop: } } - if (n_consecutive > 1) { + if (combined_buf2) { ut_free(combined_buf2); } diff --git a/innobase/os/os0shm.c b/innobase/os/os0shm.c deleted file mode 100644 index f49aa2922b0..00000000000 --- a/innobase/os/os0shm.c +++ /dev/null @@ -1,152 +0,0 @@ -/****************************************************** -The interface to the operating system -shared memory primitives - -(c) 1995 Innobase Oy - -Created 9/23/1995 Heikki Tuuri -*******************************************************/ - -#include "os0shm.h" -#ifdef UNIV_NONINL -#include "os0shm.ic" -#endif - -#ifdef __WIN__ -#include "windows.h" - -typedef HANDLE os_shm_t; -#endif - -/******************************************************************** -Creates an area of shared memory. It can be named so that -different processes may access it in the same computer. -If an area with the same name already exists, returns -a handle to that area (where the size of the area is -not changed even if this call requests a different size). -To use the area, it first has to be mapped to the process -address space by os_shm_map. */ - -os_shm_t -os_shm_create( -/*==========*/ - /* out, own: handle to the shared - memory area, NULL if error */ - ulint size, /* in: area size < 4 GB */ - char* name) /* in: name of the area as a null-terminated - string */ -{ -#ifdef __WIN__ - os_shm_t shm; - - ut_a(name); - ut_a(size > 0); - ut_a(size < 0xFFFFFFFF); - - /* In Windows NT shared memory is created as a memory mapped - file */ - shm = CreateFileMapping((HANDLE)0xFFFFFFFF, /* use operating system - swap file as the backing - file */ - NULL, /* default security - descriptor */ - PAGE_READWRITE, /* allow reading and - writing */ - 0, /* size must be less - than 4 GB */ - (DWORD)size, - name); - return(shm); -#else - UT_NOT_USED(size); - UT_NOT_USED(name); - - return(NULL); -#endif -} - -/*************************************************************************** -Frees a shared memory area. The area can be freed only after it -has been unmapped in all the processes where it was mapped. */ - -ibool -os_shm_free( -/*========*/ - /* out: TRUE if success */ - os_shm_t shm) /* in, own: handle to a shared memory area */ -{ -#ifdef __WIN__ - - BOOL ret; - - ut_a(shm); - - ret = CloseHandle(shm); - - if (ret) { - return(TRUE); - } else { - return(FALSE); - } -#else - UT_NOT_USED(shm); - - return(FALSE); -#endif -} - -/*************************************************************************** -Maps a shared memory area in the address space of a process. */ - -void* -os_shm_map( -/*=======*/ - /* out: address of the area, NULL if error */ - os_shm_t shm) /* in: handle to a shared memory area */ -{ -#ifdef __WIN__ - void* mem; - - ut_a(shm); - - mem = MapViewOfFile(shm, - FILE_MAP_ALL_ACCESS, /* read and write access - allowed */ - 0, /* map from start of */ - 0, /* area */ - 0); /* map the whole area */ - return(mem); -#else - UT_NOT_USED(shm); - - return(NULL); -#endif -} - -/*************************************************************************** -Unmaps a shared memory area from the address space of a process. */ - -ibool -os_shm_unmap( -/*=========*/ - /* out: TRUE if succeed */ - void* addr) /* in: address of the area */ -{ -#ifdef __WIN__ - BOOL ret; - - ut_a(addr); - - ret = UnmapViewOfFile(addr); - - if (ret) { - return(TRUE); - } else { - return(FALSE); - } -#else - UT_NOT_USED(addr); - - return(FALSE); -#endif -} diff --git a/innobase/os/os0sync.c b/innobase/os/os0sync.c index 7cbaf1f5123..c48c44a4c70 100644 --- a/innobase/os/os0sync.c +++ b/innobase/os/os0sync.c @@ -109,9 +109,9 @@ must be reset explicitly by calling sync_os_reset_event. */ os_event_t os_event_create( /*============*/ - /* out: the event handle */ - char* name) /* in: the name of the event, if NULL - the event is created without a name */ + /* out: the event handle */ + const char* name) /* in: the name of the event, if NULL + the event is created without a name */ { #ifdef __WIN__ os_event_t event; @@ -166,9 +166,9 @@ reset when a single thread is released. Works only in Windows. */ os_event_t os_event_create_auto( /*=================*/ - /* out: the event handle */ - char* name) /* in: the name of the event, if NULL - the event is created without a name */ + /* out: the event handle */ + const char* name) /* in: the name of the event, if NULL + the event is created without a name */ { os_event_t event; @@ -430,9 +430,9 @@ mutex semaphore of InnoDB itself (mutex_t) should be used where possible. */ os_mutex_t os_mutex_create( /*============*/ - /* out: the mutex handle */ - char* name) /* in: the name of the mutex, if NULL - the mutex is created without a name */ + /* out: the mutex handle */ + const char* name) /* in: the name of the mutex, if NULL + the mutex is created without a name */ { #ifdef __WIN__ HANDLE mutex; diff --git a/innobase/pars/pars0lex.l b/innobase/pars/pars0lex.l index 7b65770b3da..0b1af554bed 100644 --- a/innobase/pars/pars0lex.l +++ b/innobase/pars/pars0lex.l @@ -123,7 +123,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* BEGIN(INITIAL); yylval = sym_tab_add_str_lit( pars_sym_tab_global, - stringbuf, stringbuf_len); + (byte*) stringbuf, stringbuf_len); return(PARS_STR_LIT); } } @@ -137,7 +137,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* "SQL" { /* Implicit cursor name */ yylval = sym_tab_add_str_lit(pars_sym_tab_global, - yytext, yyleng); + (byte*) yytext, yyleng); return(PARS_SQL_TOKEN); } diff --git a/innobase/pars/pars0pars.c b/innobase/pars/pars0pars.c index a4124672df0..12451b4d94d 100644 --- a/innobase/pars/pars0pars.c +++ b/innobase/pars/pars0pars.c @@ -1713,7 +1713,8 @@ Called by yyparse on error. */ void yyerror( /*====*/ - char* s __attribute__((unused))) /* in: error message string */ + const char* s __attribute__((unused))) + /* in: error message string */ { ut_ad(s); @@ -1728,8 +1729,8 @@ Parses an SQL string returning the query graph. */ que_t* pars_sql( /*=====*/ - /* out, own: the query graph */ - char* str) /* in: SQL string */ + /* out, own: the query graph */ + const char* str) /* in: SQL string */ { sym_node_t* sym_node; mem_heap_t* heap; diff --git a/innobase/pars/pars0sym.c b/innobase/pars/pars0sym.c index 1a0608ed142..194e6677183 100644 --- a/innobase/pars/pars0sym.c +++ b/innobase/pars/pars0sym.c @@ -217,13 +217,10 @@ sym_tab_add_id( node->common.type = QUE_NODE_SYMBOL; - node->name = mem_heap_alloc(sym_tab->heap, len + 1); node->resolved = FALSE; node->indirection = NULL; - ut_memcpy(node->name, name, len); - node->name[len] = '\0'; - + node->name = mem_heap_strdupl(sym_tab->heap, name, len + 1); node->name_len = len; UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node); diff --git a/innobase/que/que0que.c b/innobase/que/que0que.c index b2608b6d175..08bf7ce3e59 100644 --- a/innobase/que/que0que.c +++ b/innobase/que/que0que.c @@ -12,7 +12,6 @@ Created 5/27/1996 Heikki Tuuri #include "que0que.ic" #endif -#include "srv0que.h" #include "usr0sess.h" #include "trx0trx.h" #include "trx0roll.h" @@ -175,19 +174,15 @@ a single worker thread to execute it. This function should be used to end the wait state of a query thread waiting for a lock or a stored procedure completion. */ -void +que_thr_t* que_thr_end_wait( /*=============*/ - que_thr_t* thr, /* in: query thread in the + /* out: next query thread to run; + NULL if none */ + que_thr_t* thr) /* in: query thread in the QUE_THR_LOCK_WAIT, or QUE_THR_PROCEDURE_WAIT, or QUE_THR_SIG_REPLY_WAIT state */ - que_thr_t** next_thr) /* in/out: next query thread to run; - if the value which is passed in is - a pointer to a NULL pointer, then the - calling function can start running - a new query thread; if NULL is passed - as the parameter, it is ignored */ { ibool was_active; @@ -195,6 +190,8 @@ que_thr_end_wait( ut_ad(mutex_own(&kernel_mutex)); #endif /* UNIV_SYNC_DEBUG */ ut_ad(thr); + ut_ad(next_thr); + ut_ad(*next_thr == NULL); ut_ad((thr->state == QUE_THR_LOCK_WAIT) || (thr->state == QUE_THR_PROCEDURE_WAIT) || (thr->state == QUE_THR_SIG_REPLY_WAIT)); @@ -206,17 +203,8 @@ que_thr_end_wait( que_thr_move_to_run_state(thr); - if (was_active) { - - return; - } - - if (next_thr && *next_thr == NULL) { - *next_thr = thr; - } else { - srv_que_task_enqueue_low(thr); - } -} + return(was_active ? NULL : thr); +} /************************************************************************** Same as que_thr_end_wait, but no parameter next_thr available. */ @@ -253,8 +241,6 @@ que_thr_end_wait_no_next_thr( for the lock to be released: */ srv_release_mysql_thread_if_suspended(thr); - - /* srv_que_task_enqueue_low(thr); */ } /************************************************************************** @@ -355,48 +341,6 @@ que_fork_start_command( return(NULL); } -/************************************************************************** -After signal handling is finished, returns control to a query graph error -handling routine. (Currently, just returns the control to the root of the -graph so that the graph can communicate an error message to the client.) */ - -void -que_fork_error_handle( -/*==================*/ - trx_t* trx __attribute__((unused)), /* in: trx */ - que_t* fork) /* in: query graph which was run before signal - handling started, NULL not allowed */ -{ - que_thr_t* thr; - -#ifdef UNIV_SYNC_DEBUG - ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ - ut_ad(trx->sess->state == SESS_ERROR); - ut_ad(UT_LIST_GET_LEN(trx->reply_signals) == 0); - ut_ad(UT_LIST_GET_LEN(trx->wait_thrs) == 0); - - thr = UT_LIST_GET_FIRST(fork->thrs); - - while (thr != NULL) { - ut_ad(!thr->is_active); - ut_ad(thr->state != QUE_THR_SIG_REPLY_WAIT); - ut_ad(thr->state != QUE_THR_LOCK_WAIT); - - thr->run_node = thr; - thr->prev_node = thr->child; - thr->state = QUE_THR_COMPLETED; - - thr = UT_LIST_GET_NEXT(thrs, thr); - } - - thr = UT_LIST_GET_FIRST(fork->thrs); - - que_thr_move_to_run_state(thr); - - srv_que_task_enqueue_low(thr); -} - /******************************************************************** Tests if all the query threads in the same fork have a given state. */ UNIV_INLINE @@ -765,22 +709,18 @@ this function may only be called from inside que_run_threads or que_thr_check_if_switch! These restrictions exist to make the rollback code easier to maintain. */ static -void +que_thr_t* que_thr_dec_refer_count( /*====================*/ - que_thr_t* thr, /* in: query thread */ - que_thr_t** next_thr) /* in/out: next query thread to run; - if the value which is passed in is - a pointer to a NULL pointer, then the - calling function can start running - a new query thread */ + /* out: next query thread to run */ + que_thr_t* thr) /* in: query thread */ { que_fork_t* fork; trx_t* trx; sess_t* sess; ulint fork_type; - ibool stopped; - + que_thr_t* next_thr = NULL; + fork = thr->common.parent; trx = thr->graph->trx; sess = trx->sess; @@ -791,9 +731,7 @@ que_thr_dec_refer_count( if (thr->state == QUE_THR_RUNNING) { - stopped = que_thr_stop(thr); - - if (!stopped) { + if (!que_thr_stop(thr)) { /* The reason for the thr suspension or wait was already canceled before we came here: continue running the thread */ @@ -801,15 +739,9 @@ que_thr_dec_refer_count( /* fputs("!!!!!!!! Wait already ended: continue thr\n", stderr); */ - if (next_thr && *next_thr == NULL) { - *next_thr = thr; - } else { - srv_que_task_enqueue_low(thr); - } - mutex_exit(&kernel_mutex); - return; + return(thr); } } @@ -825,7 +757,7 @@ que_thr_dec_refer_count( mutex_exit(&kernel_mutex); - return; + return(next_thr); } fork_type = fork->fork_type; @@ -841,7 +773,7 @@ que_thr_dec_refer_count( ut_ad(UT_LIST_GET_LEN(trx->signals) > 0); ut_ad(trx->handling_signals == TRUE); - trx_finish_rollback_off_kernel(fork, trx, next_thr); + next_thr = trx_finish_rollback_off_kernel(fork, trx); } else if (fork_type == QUE_FORK_PURGE) { @@ -863,7 +795,7 @@ que_thr_dec_refer_count( zero, then we start processing a signal; from it we may get a new query thread to run */ - trx_sig_start_handle(trx, next_thr); + next_thr = trx_sig_start_handle(trx); } if (trx->handling_signals && UT_LIST_GET_LEN(trx->signals) == 0) { @@ -872,6 +804,8 @@ que_thr_dec_refer_count( } mutex_exit(&kernel_mutex); + + return(next_thr); } /************************************************************************** @@ -1245,6 +1179,7 @@ loop: /*-------------------------*/ next_thr = que_thr_step(thr); /*-------------------------*/ + ut_a(next_thr == thr || next_thr == NULL); /* Test the effect on performance of adding extra mutex reservations */ @@ -1257,7 +1192,7 @@ loop: loop_count++; if (next_thr != thr) { - que_thr_dec_refer_count(thr, &next_thr); + next_thr = que_thr_dec_refer_count(thr); if (next_thr == NULL) { diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index a3f883b49c6..062f21369a7 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -803,8 +803,7 @@ row_ins_foreign_check_on_constraint( "InnoDB: clustered record ", stderr); rec_print(stderr, clust_rec); fputs("\n" - "InnoDB: Make a detailed bug report and send it\n" - "InnoDB: to mysql@lists.mysql.com\n", stderr); +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr); err = DB_SUCCESS; diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 5432add37f7..61be3a7248e 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -714,7 +714,7 @@ run_again: trx_start_if_not_started(trx); - err = lock_table(0, prebuilt->table, prebuilt->select_lock_type, thr); + err = lock_table(0, prebuilt->table, LOCK_AUTO_INC, thr); trx->error_state = err; @@ -1686,15 +1686,16 @@ constraints which reference this table are ok. */ int row_table_add_foreign_constraints( /*==============================*/ - /* out: error code or DB_SUCCESS */ - trx_t* trx, /* in: transaction */ - char* sql_string, /* in: table create statement where - foreign keys are declared like: + /* out: error code or DB_SUCCESS */ + trx_t* trx, /* in: transaction */ + const char* sql_string, /* in: table create statement where + foreign keys are declared like: FOREIGN KEY (a, b) REFERENCES table2(c, d), - table2 can be written also with the database - name before it: test.table2 */ - char* name) /* in: table full name in the normalized form - database_name/table_name */ + table2 can be written also with the + database name before it: test.table2 */ + const char* name) /* in: table full name in the + normalized form + database_name/table_name */ { ulint err; @@ -1940,9 +1941,9 @@ discard ongoing operations. */ int row_discard_tablespace_for_mysql( /*=============================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: table name */ - trx_t* trx) /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: table name */ + trx_t* trx) /* in: transaction handle */ { dulint new_id; dict_table_t* table; @@ -2071,9 +2072,9 @@ of the table in the data dictionary. */ int row_import_tablespace_for_mysql( /*============================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: table name */ - trx_t* trx) /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: table name */ + trx_t* trx) /* in: transaction handle */ { dict_table_t* table; ibool success; @@ -2177,10 +2178,10 @@ the corresponding monitor output by the master thread. */ int row_drop_table_for_mysql( /*=====================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: table name */ - trx_t* trx, /* in: transaction handle */ - ibool drop_db)/* in: TRUE=dropping whole database */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: table name */ + trx_t* trx, /* in: transaction handle */ + ibool drop_db)/* in: TRUE=dropping whole database */ { dict_foreign_t* foreign; dict_table_t* table; @@ -2519,17 +2520,18 @@ Drops a database for MySQL. */ int row_drop_database_for_mysql( /*========================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: database name which ends to '/' */ - trx_t* trx) /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: database name which ends to '/' */ + trx_t* trx) /* in: transaction handle */ { dict_table_t* table; char* table_name; int err = DB_SUCCESS; + ulint namelen = strlen(name); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); ut_a(name != NULL); - ut_a(name[strlen(name) - 1] == '/'); + ut_a(name[namelen - 1] == '/'); trx->op_info = (char *) "dropping database"; @@ -2538,7 +2540,7 @@ loop: row_mysql_lock_data_dictionary(trx); while ((table_name = dict_get_first_table_name_in_db(name))) { - ut_a(strcmp(table_name, name) == 0); + ut_a(memcmp(table_name, name, namelen) == 0); table = dict_table_get_low(table_name); @@ -2610,10 +2612,10 @@ Renames a table for MySQL. */ int row_rename_table_for_mysql( /*=======================*/ - /* out: error code or DB_SUCCESS */ - char* old_name, /* in: old table name */ - char* new_name, /* in: new table name */ - trx_t* trx) /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* old_name, /* in: old table name */ + const char* new_name, /* in: new table name */ + trx_t* trx) /* in: transaction handle */ { dict_table_t* table; que_thr_t* thr; diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 4c43f75125c..ff9b697c02f 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2410,8 +2410,7 @@ row_sel_get_clust_rec_for_mysql( trx_print(stderr, thr_get_trx(thr)); fputs("\n" - "InnoDB: Make a detailed bug report and send it\n" - "InnoDB: to mysql@lists.mysql.com\n", stderr); +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr); } clust_rec = NULL; @@ -3586,11 +3585,11 @@ consistent read result, or store it to the query cache. */ ibool row_search_check_if_query_cache_permitted( /*======================================*/ - /* out: TRUE if storing or retrieving from - the query cache is permitted */ - trx_t* trx, /* in: transaction object */ - char* norm_name) /* in: concatenation of database name, '/' - char, table name */ + /* out: TRUE if storing or retrieving + from the query cache is permitted */ + trx_t* trx, /* in: transaction object */ + const char* norm_name) /* in: concatenation of database name, + '/' char, table name */ { dict_table_t* table; ibool ret = FALSE; diff --git a/innobase/row/row0umod.c b/innobase/row/row0umod.c index 3c181ed5493..d47227166f3 100644 --- a/innobase/row/row0umod.c +++ b/innobase/row/row0umod.c @@ -441,8 +441,7 @@ row_undo_mod_del_unmark_sec_and_undo_update( putc('\n', stderr); trx_print(stderr, thr_get_trx(thr)); fputs("\n" - "InnoDB: Make a detailed bug report and send it\n" - "InnoDB: to mysql@lists.mysql.com\n", stderr); +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr); } else { btr_cur_t* btr_cur = btr_pcur_get_btr_cur(&pcur); diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c index 82eb112fc77..724e7bf91e7 100644 --- a/innobase/row/row0upd.c +++ b/innobase/row/row0upd.c @@ -1236,8 +1236,7 @@ row_upd_sec_index_entry( trx_print(stderr, thr_get_trx(thr)); fputs("\n" - "InnoDB: Make a detailed bug report and send it\n" - "InnoDB: to mysql@lists.mysql.com\n", stderr); +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr); } else { /* Delete mark the old index record; it can already be delete marked if we return after a lock wait in diff --git a/innobase/srv/Makefile.am b/innobase/srv/Makefile.am index 752683b82b8..37fd73a4bf0 100644 --- a/innobase/srv/Makefile.am +++ b/innobase/srv/Makefile.am @@ -19,6 +19,6 @@ include ../include/Makefile.i noinst_LIBRARIES = libsrv.a -libsrv_a_SOURCES = srv0srv.c srv0que.c srv0start.c +libsrv_a_SOURCES = srv0srv.c srv0start.c EXTRA_PROGRAMS = diff --git a/innobase/srv/srv0que.c b/innobase/srv/srv0que.c deleted file mode 100644 index ac8bd7d0e65..00000000000 --- a/innobase/srv/srv0que.c +++ /dev/null @@ -1,111 +0,0 @@ -/****************************************************** -Server query execution - -(c) 1996 Innobase Oy - -Created 6/5/1996 Heikki Tuuri -*******************************************************/ - -#include "srv0que.h" - -#include "srv0srv.h" -#include "sync0sync.h" -#include "os0thread.h" -#include "usr0sess.h" -#include "que0que.h" - -/************************************************************************** -Checks if there is work to do in the server task queue. If there is, the -thread starts processing a task. Before leaving, it again checks the task -queue and picks a new task if any exists. This is called by a SRV_WORKER -thread. */ - -void -srv_que_task_queue_check(void) -/*==========================*/ -{ - que_thr_t* thr; - - for (;;) { - mutex_enter(&kernel_mutex); - - thr = UT_LIST_GET_FIRST(srv_sys->tasks); - - if (thr == NULL) { - mutex_exit(&kernel_mutex); - - return; - } - - UT_LIST_REMOVE(queue, srv_sys->tasks, thr); - - mutex_exit(&kernel_mutex); - - que_run_threads(thr); - } -} - -/************************************************************************** -Performs round-robin on the server tasks. This is called by a SRV_WORKER -thread every second or so. */ - -que_thr_t* -srv_que_round_robin( -/*================*/ - /* out: the new (may be == thr) query thread - to run */ - que_thr_t* thr) /* in: query thread */ -{ - que_thr_t* new_thr; - - ut_ad(thr); - ut_ad(thr->state == QUE_THR_RUNNING); - - mutex_enter(&kernel_mutex); - - UT_LIST_ADD_LAST(queue, srv_sys->tasks, thr); - - new_thr = UT_LIST_GET_FIRST(srv_sys->tasks); - - mutex_exit(&kernel_mutex); - - return(new_thr); -} - -/************************************************************************** -Enqueues a task to server task queue and releases a worker thread, if there -is a suspended one. */ - -void -srv_que_task_enqueue_low( -/*=====================*/ - que_thr_t* thr) /* in: query thread */ -{ - ut_ad(thr); - -#ifdef UNIV_SYNC_DEBUG - ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ - - UT_LIST_ADD_LAST(queue, srv_sys->tasks, thr); - - srv_release_threads(SRV_WORKER, 1); -} - -/************************************************************************** -Enqueues a task to server task queue and releases a worker thread, if there -is a suspended one. */ - -void -srv_que_task_enqueue( -/*=================*/ - que_thr_t* thr) /* in: query thread */ -{ - ut_ad(thr); - - mutex_enter(&kernel_mutex); - - srv_que_task_enqueue_low(thr); - - mutex_exit(&kernel_mutex); -} diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 7194dfc1d2f..33adcaa14b8 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -32,10 +32,8 @@ Created 10/8/1995 Heikki Tuuri #include "mem0mem.h" #include "mem0pool.h" #include "sync0sync.h" -#include "sync0ipm.h" #include "thr0loc.h" #include "que0que.h" -#include "srv0que.h" #include "log0recv.h" #include "pars0pars.h" #include "usr0sess.h" @@ -1525,13 +1523,6 @@ srv_printf_innodb_monitor( ut_total_allocated_memory, mem_pool_get_reserved(mem_comm_pool)); - if (mem_out_of_mem_err_msg_count > 0) { - fprintf(file, - "Mem allocation has spilled out of additional mem pool" ULINTPF - "times\n", - mem_out_of_mem_err_msg_count); - } - if (srv_use_awe) { fprintf(file, "In addition to that %lu MB of AWE memory allocated\n", diff --git a/innobase/sync/Makefile.am b/innobase/sync/Makefile.am index 4acd4516e35..c95955a733b 100644 --- a/innobase/sync/Makefile.am +++ b/innobase/sync/Makefile.am @@ -19,6 +19,6 @@ include ../include/Makefile.i noinst_LIBRARIES = libsync.a -libsync_a_SOURCES = sync0arr.c sync0ipm.c sync0rw.c sync0sync.c +libsync_a_SOURCES = sync0arr.c sync0rw.c sync0sync.c EXTRA_PROGRAMS = diff --git a/innobase/sync/makefilewin b/innobase/sync/makefilewin index 5809d8e7375..73cff40405a 100644 --- a/innobase/sync/makefilewin +++ b/innobase/sync/makefilewin @@ -1,7 +1,7 @@ include ..\include\makefile.i -sync.lib: sync0sync.obj sync0rw.obj sync0ipm.obj sync0arr.obj - lib -out:..\libs\sync.lib sync0sync.obj sync0rw.obj sync0ipm.obj sync0arr.obj +sync.lib: sync0sync.obj sync0rw.obj sync0arr.obj + lib -out:..\libs\sync.lib sync0sync.obj sync0rw.obj sync0arr.obj sync0sync.obj: sync0sync.c $(CCOM) $(CFLN) -c sync0sync.c @@ -9,9 +9,6 @@ sync0sync.obj: sync0sync.c sync0rw.obj: sync0rw.c $(CCOM) $(CFL) -c sync0rw.c -sync0ipm.obj: sync0ipm.c - $(CCOM) $(CFL) -c sync0ipm.c - sync0arr.obj: sync0arr.c $(CCOM) $(CFL) -c sync0arr.c diff --git a/innobase/sync/sync0arr.c b/innobase/sync/sync0arr.c index 426d7ff9f92..d1644412fbb 100644 --- a/innobase/sync/sync0arr.c +++ b/innobase/sync/sync0arr.c @@ -53,7 +53,7 @@ struct sync_cell_struct { rw_lock_t* old_wait_rw_lock;/* the latest wait rw-lock in cell */ ulint request_type; /* lock type requested on the object */ - char* file; /* in debug version file where + const char* file; /* in debug version file where requested */ ulint line; /* in debug version line where requested */ @@ -329,7 +329,7 @@ sync_array_reserve_cell( sync_array_t* arr, /* in: wait array */ void* object, /* in: pointer to the object to wait for */ ulint type, /* in: lock request type */ - char* file, /* in: file where requested */ + const char* file, /* in: file where requested */ ulint line, /* in: line where requested */ ulint* index) /* out: index of the reserved cell */ { @@ -449,7 +449,6 @@ sync_array_cell_print( { mutex_t* mutex; rw_lock_t* rwlock; - char* str __attribute__((unused)) = NULL; ulint type; type = cell->request_type; diff --git a/innobase/sync/sync0ipm.c b/innobase/sync/sync0ipm.c deleted file mode 100644 index e10e1c85da5..00000000000 --- a/innobase/sync/sync0ipm.c +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************** -A fast mutex for interprocess synchronization. -mutex_t can be used only within single process, -but ip_mutex_t also between processes. - -(c) 1995 Innobase Oy - -Created 9/30/1995 Heikki Tuuri -*******************************************************/ -#include "sync0ipm.h" -#ifdef UNIV_NONINL -#include "sync0ipm.ic" -#endif - -#include "mem0mem.h" - -/* The performance of the ip mutex in NT depends on how often -a thread has to suspend itself waiting for the ip mutex -to become free. The following variable counts system calls -involved. */ - -ulint ip_mutex_system_call_count = 0; - -/********************************************************************** -Creates, or rather, initializes -an ip mutex object in a specified shared memory location (which must be -appropriately aligned). The ip mutex is initialized in the reset state. -NOTE! Explicit destroying of the ip mutex with ip_mutex_free -is not recommended -as the mutex resides in shared memory and we cannot make sure that -no process is currently accessing it. Therefore just use -ip_mutex_close to free the operating system event and mutex. */ - -ulint -ip_mutex_create( -/*============*/ - /* out: 0 if succeed */ - ip_mutex_t* ip_mutex, /* in: pointer to shared memory */ - char* name, /* in: name of the ip mutex */ - ip_mutex_hdl_t** handle) /* out, own: handle to the - created mutex; handle exists - in the private address space of - the calling process */ -{ - mutex_t* mutex; - char* buf; - os_event_t released; - os_mutex_t exclude; - - ip_mutex_set_waiters(ip_mutex, 0); - - buf = mem_alloc(strlen(name) + 20); - - strcpy(buf, name); - strcpy(buf + strlen(name), "_IB_RELS"); - - released = os_event_create(buf); - - if (released == NULL) { - mem_free(buf); - return(1); - } - - strcpy(buf + strlen(name), "_IB_EXCL"); - - exclude = os_mutex_create(buf); - - if (exclude == NULL) { - os_event_free(released); - mem_free(buf); - return(1); - } - - mutex = ip_mutex_get_mutex(ip_mutex); - - mutex_create(mutex); - mutex_set_level(mutex, SYNC_NO_ORDER_CHECK); - - *handle = mem_alloc(sizeof(ip_mutex_hdl_t)); - - (*handle)->ip_mutex = ip_mutex; - (*handle)->released = released; - (*handle)->exclude = exclude; - - mem_free(buf); - - return(0); -} - -/********************************************************************** -NOTE! Using this function is not recommended. See the note -on ip_mutex_create. Destroys an ip mutex */ - -void -ip_mutex_free( -/*==========*/ - ip_mutex_hdl_t* handle) /* in, own: ip mutex handle */ -{ - mutex_free(ip_mutex_get_mutex(handle->ip_mutex)); - - os_event_free(handle->released); - os_mutex_free(handle->exclude); - - mem_free(handle); -} - -/********************************************************************** -Opens an ip mutex object in a specified shared memory location. -Explicit closing of the ip mutex with ip_mutex_close is necessary to -free the operating system event and mutex created, and the handle. */ - -ulint -ip_mutex_open( -/*==========*/ - /* out: 0 if succeed */ - ip_mutex_t* ip_mutex, /* in: pointer to shared memory */ - char* name, /* in: name of the ip mutex */ - ip_mutex_hdl_t** handle) /* out, own: handle to the - opened mutex */ -{ - char* buf; - os_event_t released; - os_mutex_t exclude; - - buf = mem_alloc(strlen(name) + 20); - - strcpy(buf, name); - strcpy(buf + strlen(name), "_IB_RELS"); - - released = os_event_create(buf); - - if (released == NULL) { - mem_free(buf); - return(1); - } - - strcpy(buf + strlen(name), "_IB_EXCL"); - - exclude = os_mutex_create(buf); - - if (exclude == NULL) { - os_event_free(released); - mem_free(buf); - return(1); - } - - *handle = mem_alloc(sizeof(ip_mutex_hdl_t)); - - (*handle)->ip_mutex = ip_mutex; - (*handle)->released = released; - (*handle)->exclude = exclude; - - mem_free(buf); - - return(0); -} - -/********************************************************************** -Closes an ip mutex. */ - -void -ip_mutex_close( -/*===========*/ - ip_mutex_hdl_t* handle) /* in, own: ip mutex handle */ -{ - os_event_free(handle->released); - os_mutex_free(handle->exclude); - - mem_free(handle); -} diff --git a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c index 43f8d646eaa..769eb326ce2 100644 --- a/innobase/sync/sync0rw.c +++ b/innobase/sync/sync0rw.c @@ -89,7 +89,7 @@ void rw_lock_create_func( /*================*/ rw_lock_t* lock, /* in: pointer to memory */ - char* cfile_name, /* in: file name where created */ + const char* cfile_name, /* in: file name where created */ ulint cline) /* in: file line where created */ { /* If this is the very first time a synchronization @@ -213,7 +213,7 @@ rw_lock_s_lock_spin( rw_lock_t* lock, /* in: pointer to rw-lock */ ulint pass, /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name, /* in: file name where lock requested */ + const char* file_name, /* in: file name where lock requested */ ulint line) /* in: line where requested */ { ulint index; /* index of the reserved wait cell */ @@ -324,7 +324,7 @@ rw_lock_x_lock_low( rw_lock_t* lock, /* in: pointer to rw-lock */ ulint pass, /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line) /* in: line where requested */ { #ifdef UNIV_SYNC_DEBUG @@ -429,7 +429,7 @@ rw_lock_x_lock_func( rw_lock_t* lock, /* in: pointer to rw-lock */ ulint pass, /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line) /* in: line where requested */ { ulint index; /* index of the reserved wait cell */ @@ -551,7 +551,7 @@ rw_lock_debug_mutex_enter(void) { loop: if (0 == mutex_enter_nowait(&rw_lock_debug_mutex, - IB__FILE__, __LINE__)) { + __FILE__, __LINE__)) { return; } @@ -560,7 +560,7 @@ loop: rw_lock_debug_waiters = TRUE; if (0 == mutex_enter_nowait(&rw_lock_debug_mutex, - IB__FILE__, __LINE__)) { + __FILE__, __LINE__)) { return; } diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c index c1fb31bc966..31f287b6341 100644 --- a/innobase/sync/sync0sync.c +++ b/innobase/sync/sync0sync.c @@ -201,7 +201,7 @@ void mutex_create_func( /*==============*/ mutex_t* mutex, /* in: pointer to memory */ - char* cfile_name, /* in: file name where created */ + const char* cfile_name, /* in: file name where created */ ulint cline) /* in: file line where created */ { #if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER) @@ -294,10 +294,10 @@ mutex_enter_nowait( /*===============*/ /* out: 0 if succeed, 1 if not */ mutex_t* mutex, /* in: pointer to mutex */ - char* file_name __attribute__((unused)), + const char* file_name __attribute__((unused)), /* in: file name where mutex requested */ - ulint line __attribute__((unused))) + ulint line __attribute__((unused))) /* in: line where requested */ { ut_ad(mutex_validate(mutex)); @@ -357,9 +357,10 @@ for the mutex before suspending the thread. */ void mutex_spin_wait( /*============*/ - mutex_t* mutex, /* in: pointer to mutex */ - char* file_name, /* in: file name where mutex requested */ - ulint line) /* in: line where requested */ + mutex_t* mutex, /* in: pointer to mutex */ + const char* file_name, /* in: file name where + mutex requested */ + ulint line) /* in: line where requested */ { ulint index; /* index of the reserved wait cell */ ulint i; /* spin round count */ diff --git a/innobase/trx/trx0purge.c b/innobase/trx/trx0purge.c index 3d5f0d3f03a..002775eaac1 100644 --- a/innobase/trx/trx0purge.c +++ b/innobase/trx/trx0purge.c @@ -23,7 +23,6 @@ Created 3/26/1996 Heikki Tuuri #include "row0purge.h" #include "row0upd.h" #include "trx0rec.h" -#include "srv0que.h" #include "os0thread.h" /* The global data structure coordinating a purge */ @@ -1060,8 +1059,6 @@ trx_purge(void) mutex_exit(&kernel_mutex); -/* srv_que_task_enqueue(thr2); */ - if (srv_print_thread_releases) { fputs("Starting purge\n", stderr); diff --git a/innobase/trx/trx0rec.c b/innobase/trx/trx0rec.c index 7963bec7f33..382f723a05c 100644 --- a/innobase/trx/trx0rec.c +++ b/innobase/trx/trx0rec.c @@ -823,17 +823,16 @@ trx_undo_update_rec_get_update( if (field_no >= dict_index_get_n_fields(index)) { fprintf(stderr, - "InnoDB: Error: trying to access" - " update undo rec field %lu in ", (ulong) field_no); +"InnoDB: Error: trying to access update undo rec field %lu in ", (ulong) field_no); dict_index_name_print(stderr, index); fprintf(stderr, "\n" - "InnoDB: but index has only %lu fields\n" - "InnoDB: Send a detailed bug report to mysql@lists.mysql.com\n" - "InnoDB: Run also CHECK TABLE ", +"InnoDB: but index has only %lu fields\n" +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n" +"InnoDB: Run also CHECK TABLE ", (ulong) dict_index_get_n_fields(index)); ut_print_name(stderr, index->table_name); fprintf(stderr, "\n" - "InnoDB: n_fields = %lu, i = %lu, ptr %p\n", +"InnoDB: n_fields = %lu, i = %lu, ptr %p\n", (ulong) n_fields, (ulong) i, ptr); return(NULL); } @@ -1067,7 +1066,7 @@ trx_undo_report_row_operation( undo_page = buf_page_get_gen(undo->space, page_no, RW_X_LATCH, undo->guess_page, BUF_GET, - IB__FILE__, __LINE__, + __FILE__, __LINE__, &mtr); #ifdef UNIV_SYNC_DEBUG @@ -1271,8 +1270,7 @@ trx_undo_prev_version_build( " update undo rec for non-clustered ", stderr); dict_index_name_print(stderr, index); fputs("\n" - "InnoDB: Send a detailed bug report to" - " mysql@lists.mysql.com\n" +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n" "InnoDB: index record ", stderr); rec_print(stderr, index_rec); fputs("\n" @@ -1320,11 +1318,9 @@ trx_undo_prev_version_build( " update undo rec for table ", stderr); ut_print_name(stderr, index->table_name); fputs("\n" - "InnoDB: but the table id in the" - " undo record is wrong\n" - "InnoDB: Send a detailed bug report to " - "mysql@lists.mysql.com\n" - "InnoDB: Run also CHECK TABLE ", stderr); +"InnoDB: but the table id in the undo record is wrong\n" +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n" +"InnoDB: Run also CHECK TABLE ", stderr); ut_print_name(stderr, index->table_name); putc('\n', stderr); } diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c index 5c01a5371aa..4343249764e 100644 --- a/innobase/trx/trx0roll.c +++ b/innobase/trx/trx0roll.c @@ -20,7 +20,6 @@ Created 3/26/1996 Heikki Tuuri #include "trx0rec.h" #include "que0que.h" #include "usr0sess.h" -#include "srv0que.h" #include "srv0start.h" #include "row0undo.h" #include "row0mysql.h" @@ -200,7 +199,7 @@ trx_rollback_to_savepoint_for_mysql( DB_NO_SAVEPOINT, otherwise DB_SUCCESS */ trx_t* trx, /* in: transaction handle */ - char* savepoint_name, /* in: savepoint name */ + const char* savepoint_name, /* in: savepoint name */ ib_longlong* mysql_binlog_cache_pos) /* out: the MySQL binlog cache position corresponding to this savepoint; MySQL needs this @@ -265,7 +264,7 @@ trx_savepoint_for_mysql( /*====================*/ /* out: always DB_SUCCESS */ trx_t* trx, /* in: transaction handle */ - char* savepoint_name, /* in: savepoint name */ + const char* savepoint_name, /* in: savepoint name */ ib_longlong binlog_cache_pos) /* in: MySQL binlog cache position corresponding to this connection at the time of the @@ -932,21 +931,15 @@ trx_undo_rec_release( /************************************************************************* Starts a rollback operation. */ -void +que_thr_t* trx_rollback( /*=========*/ + /* out: next query thread to run */ trx_t* trx, /* in: transaction */ - trx_sig_t* sig, /* in: signal starting the rollback */ - que_thr_t** next_thr)/* in/out: next query thread to run; - if the value which is passed in is - a pointer to a NULL pointer, then the - calling function can start running - a new query thread; if the passed value is - NULL, the parameter is ignored */ + trx_sig_t* sig) /* in: signal starting the rollback */ { que_t* roll_graph; que_thr_t* thr; -/* que_thr_t* thr2; */ #ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); @@ -988,18 +981,7 @@ trx_rollback( thr = que_fork_start_command(roll_graph); ut_ad(thr); - -/* thr2 = que_fork_start_command(roll_graph); - - ut_ad(thr2); */ - - if (next_thr && (*next_thr == NULL)) { - *next_thr = thr; -/* srv_que_task_enqueue_low(thr2); */ - } else { - srv_que_task_enqueue_low(thr); -/* srv_que_task_enqueue_low(thr2); */ - } + return(thr); } /******************************************************************** @@ -1071,17 +1053,14 @@ trx_finish_error_processing( /************************************************************************* Finishes a partial rollback operation. */ static -void +que_thr_t* trx_finish_partial_rollback_off_kernel( /*===================================*/ - trx_t* trx, /* in: transaction */ - que_thr_t** next_thr)/* in/out: next query thread to run; - if the value which is passed in is a pointer - to a NULL pointer, then the calling function - can start running a new query thread; if this - parameter is NULL, it is ignored */ + /* out: next query thread to run */ + trx_t* trx) /* in: transaction */ { trx_sig_t* sig; + que_thr_t* next_thr; #ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); @@ -1092,29 +1071,26 @@ trx_finish_partial_rollback_off_kernel( /* Remove the signal from the signal queue and send reply message to it */ - trx_sig_reply(sig, next_thr); + next_thr = trx_sig_reply(sig); trx_sig_remove(trx, sig); trx->que_state = TRX_QUE_RUNNING; + return(next_thr); } /******************************************************************** Finishes a transaction rollback. */ -void +que_thr_t* trx_finish_rollback_off_kernel( /*===========================*/ + /* out: next query thread to run */ que_t* graph, /* in: undo graph which can now be freed */ - trx_t* trx, /* in: transaction */ - que_thr_t** next_thr)/* in/out: next query thread to run; - if the value which is passed in is - a pointer to a NULL pointer, then the - calling function can start running - a new query thread; if this parameter is - NULL, it is ignored */ + trx_t* trx) /* in: transaction */ { trx_sig_t* sig; trx_sig_t* next_sig; + que_thr_t* next_thr; #ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); @@ -1129,15 +1105,13 @@ trx_finish_rollback_off_kernel( if (sig->type == TRX_SIG_ROLLBACK_TO_SAVEPT) { - trx_finish_partial_rollback_off_kernel(trx, next_thr); - - return; + return(trx_finish_partial_rollback_off_kernel(trx)); } else if (sig->type == TRX_SIG_ERROR_OCCURRED) { trx_finish_error_processing(trx); - return; + return(NULL); } #ifdef UNIV_DEBUG @@ -1153,19 +1127,23 @@ trx_finish_rollback_off_kernel( send reply messages to them */ trx->que_state = TRX_QUE_RUNNING; - + + next_thr = NULL; while (sig != NULL) { next_sig = UT_LIST_GET_NEXT(signals, sig); if (sig->type == TRX_SIG_TOTAL_ROLLBACK) { - trx_sig_reply(sig, next_thr); + ut_a(next_thr == NULL); + next_thr = trx_sig_reply(sig); trx_sig_remove(trx, sig); } sig = next_sig; } + + return(next_thr); } /************************************************************************* @@ -1198,7 +1176,6 @@ trx_rollback_step( que_thr_t* thr) /* in: query thread */ { roll_node_t* node; - ibool success; ulint sig_no; trx_savept_t* savept; @@ -1225,19 +1202,13 @@ trx_rollback_step( /* Send a rollback signal to the transaction */ - success = trx_sig_send(thr_get_trx(thr), - sig_no, TRX_SIG_SELF, - thr, savept, NULL); + trx_sig_send(thr_get_trx(thr), sig_no, TRX_SIG_SELF, + thr, savept); thr->state = QUE_THR_SIG_REPLY_WAIT; mutex_exit(&kernel_mutex); - if (!success) { - /* Error in delivering the rollback signal */ - que_thr_handle_error(thr, DB_ERROR, NULL, 0); - } - return(NULL); } diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c index ef068d8d523..7e35e34f014 100644 --- a/innobase/trx/trx0sys.c +++ b/innobase/trx/trx0sys.c @@ -569,7 +569,7 @@ replication has proceeded. */ void trx_sys_update_mysql_binlog_offset( /*===============================*/ - char* file_name,/* in: MySQL log file name */ + const char* file_name,/* in: MySQL log file name */ ib_longlong offset, /* in: position in that log file */ ulint field, /* in: offset of the MySQL log info field in the trx sys header */ @@ -596,7 +596,7 @@ trx_sys_update_mysql_binlog_offset( MLOG_4BYTES, mtr); } - if (0 != strcmp(sys_header + field + TRX_SYS_MYSQL_LOG_NAME, file_name)) { + if (0 != strcmp((char*) (sys_header + field + TRX_SYS_MYSQL_LOG_NAME), file_name)) { mlog_write_string(sys_header + field + TRX_SYS_MYSQL_LOG_NAME, diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index fc0a67278d2..862229ef032 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -897,18 +897,15 @@ trx_assign_read_view( /******************************************************************** Commits a transaction. NOTE that the kernel mutex is temporarily released. */ static -void +que_thr_t* trx_handle_commit_sig_off_kernel( /*=============================*/ - trx_t* trx, /* in: transaction */ - que_thr_t** next_thr) /* in/out: next query thread to run; - if the value which is passed in is - a pointer to a NULL pointer, then the - calling function can start running - a new query thread */ + /* out: next query thread to run */ + trx_t* trx) /* in: transaction */ { trx_sig_t* sig; trx_sig_t* next_sig; + que_thr_t* next_thr = NULL; #ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); @@ -930,7 +927,8 @@ trx_handle_commit_sig_off_kernel( if (sig->type == TRX_SIG_COMMIT) { - trx_sig_reply(sig, next_thr); + ut_a(next_thr == NULL); + next_thr = trx_sig_reply(sig); trx_sig_remove(trx, sig); } @@ -938,6 +936,8 @@ trx_handle_commit_sig_off_kernel( } trx->que_state = TRX_QUE_RUNNING; + + return(next_thr); } /*************************************************************** @@ -999,39 +999,6 @@ trx_lock_wait_to_suspended( trx->que_state = TRX_QUE_RUNNING; } -/*************************************************************** -Moves the query threads in the sig reply wait list of trx to the SUSPENDED -state. */ -static -void -trx_sig_reply_wait_to_suspended( -/*============================*/ - trx_t* trx) /* in: transaction */ -{ - trx_sig_t* sig; - que_thr_t* thr; - -#ifdef UNIV_SYNC_DEBUG - ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ - - sig = UT_LIST_GET_FIRST(trx->reply_signals); - - while (sig != NULL) { - thr = sig->receiver; - - ut_ad(thr->state == QUE_THR_SIG_REPLY_WAIT); - - thr->state = QUE_THR_SUSPENDED; - - sig->receiver = NULL; - - UT_LIST_REMOVE(reply_signals, trx->reply_signals, sig); - - sig = UT_LIST_GET_FIRST(trx->reply_signals); - } -} - /********************************************************************* Checks the compatibility of a new signal with the other signals in the queue. */ @@ -1111,11 +1078,10 @@ trx_sig_is_compatible( /******************************************************************** Sends a signal to a trx object. */ -ibool +que_thr_t* trx_sig_send( /*=========*/ - /* out: TRUE if the signal was - successfully delivered */ + /* out: next query thread to run */ trx_t* trx, /* in: trx handle */ ulint type, /* in: signal type */ ulint sender, /* in: TRX_SIG_SELF or @@ -1123,14 +1089,8 @@ trx_sig_send( que_thr_t* receiver_thr, /* in: query thread which wants the reply, or NULL; if type is TRX_SIG_END_WAIT, this must be NULL */ - trx_savept_t* savept, /* in: possible rollback savepoint, or + trx_savept_t* savept) /* in: possible rollback savepoint, or NULL */ - que_thr_t** next_thr) /* in/out: next query thread to run; - if the value which is passed in is - a pointer to a NULL pointer, then the - calling function can start running - a new query thread; if the parameter - is NULL, it is ignored */ { trx_sig_t* sig; trx_t* receiver_trx; @@ -1140,14 +1100,7 @@ trx_sig_send( ut_ad(mutex_own(&kernel_mutex)); #endif /* UNIV_SYNC_DEBUG */ - if (!trx_sig_is_compatible(trx, type, sender)) { - /* The signal is not compatible with the other signals in - the queue: do nothing */ - - ut_error; - - return(FALSE); - } + ut_a(trx_sig_is_compatible(trx, type, sender)); /* Queue the signal object */ @@ -1181,11 +1134,6 @@ trx_sig_send( sig); } - if (trx->sess->state == SESS_ERROR) { - - trx_sig_reply_wait_to_suspended(trx); - } - if ((sender != TRX_SIG_SELF) || (type == TRX_SIG_BREAK_EXECUTION)) { /* The following call will add a TRX_SIG_ERROR_OCCURRED @@ -1200,10 +1148,10 @@ trx_sig_send( if (UT_LIST_GET_FIRST(trx->signals) == sig) { - trx_sig_start_handle(trx, next_thr); + return(trx_sig_start_handle(trx)); } - return(TRUE); + return(NULL); } /******************************************************************** @@ -1225,27 +1173,18 @@ trx_end_signal_handling( trx->handling_signals = FALSE; trx->graph = trx->graph_before_signal_handling; - - if (trx->graph && (trx->sess->state == SESS_ERROR)) { - - que_fork_error_handle(trx, trx->graph); - } } /******************************************************************** Starts handling of a trx signal. */ -void +que_thr_t* trx_sig_start_handle( /*=================*/ - trx_t* trx, /* in: trx handle */ - que_thr_t** next_thr) /* in/out: next query thread to run; - if the value which is passed in is - a pointer to a NULL pointer, then the - calling function can start running - a new query thread; if the parameter - is NULL, it is ignored */ + /* out: next query thread to run, or NULL */ + trx_t* trx) /* in: trx handle */ { + que_thr_t* next_thr = NULL; trx_sig_t* sig; ulint type; loop: @@ -1261,7 +1200,7 @@ loop: trx_end_signal_handling(trx); - return; + return(next_thr); } if (trx->conc_state == TRX_NOT_STARTED) { @@ -1277,23 +1216,13 @@ loop: trx_lock_wait_to_suspended(trx); } - /* If the session is in the error state and this trx has threads - waiting for reply from signals, moves these threads to the suspended - state, canceling wait reservations; note that if the transaction has - sent a commit or rollback signal to itself, and its session is not in - the error state, then nothing is done here. */ - - if (trx->sess->state == SESS_ERROR) { - trx_sig_reply_wait_to_suspended(trx); - } - /* If there are no running query threads, we can start processing of a signal, otherwise we have to wait until all query threads of this transaction are aware of the arrival of the signal. */ if (trx->n_active_thrs > 0) { - return; + return(NULL); } if (trx->handling_signals == FALSE) { @@ -1307,30 +1236,19 @@ loop: if (type == TRX_SIG_COMMIT) { - trx_handle_commit_sig_off_kernel(trx, next_thr); + next_thr = trx_handle_commit_sig_off_kernel(trx); } else if ((type == TRX_SIG_TOTAL_ROLLBACK) - || (type == TRX_SIG_ROLLBACK_TO_SAVEPT)) { - - trx_rollback(trx, sig, next_thr); - + || (type == TRX_SIG_ROLLBACK_TO_SAVEPT) + || (type == TRX_SIG_ERROR_OCCURRED)) { /* No further signals can be handled until the rollback completes, therefore we return */ - return; - - } else if (type == TRX_SIG_ERROR_OCCURRED) { - - trx_rollback(trx, sig, next_thr); - - /* No further signals can be handled until the rollback - completes, therefore we return */ - - return; + return(trx_rollback(trx, sig)); } else if (type == TRX_SIG_BREAK_EXECUTION) { - trx_sig_reply(sig, next_thr); + next_thr = trx_sig_reply(sig); trx_sig_remove(trx, sig); } else { ut_error; @@ -1343,17 +1261,14 @@ loop: Send the reply message when a signal in the queue of the trx has been handled. */ -void +que_thr_t* trx_sig_reply( /*==========*/ - trx_sig_t* sig, /* in: signal */ - que_thr_t** next_thr) /* in/out: next query thread to run; - if the value which is passed in is - a pointer to a NULL pointer, then the - calling function can start running - a new query thread */ + /* out: next query thread to run */ + trx_sig_t* sig) /* in: signal */ { - trx_t* receiver_trx; + trx_t* receiver_trx; + que_thr_t* next_thr = NULL; ut_ad(sig); #ifdef UNIV_SYNC_DEBUG @@ -1367,13 +1282,13 @@ trx_sig_reply( UT_LIST_REMOVE(reply_signals, receiver_trx->reply_signals, sig); - ut_ad(receiver_trx->sess->state != SESS_ERROR); - - que_thr_end_wait(sig->receiver, next_thr); + next_thr = que_thr_end_wait(sig->receiver); sig->receiver = NULL; } + + return(next_thr); } /******************************************************************** @@ -1429,7 +1344,6 @@ trx_commit_step( { commit_node_t* node; que_thr_t* next_thr; - ibool success; node = thr->run_node; @@ -1444,21 +1358,14 @@ trx_commit_step( node->state = COMMIT_NODE_WAIT; - next_thr = NULL; - thr->state = QUE_THR_SIG_REPLY_WAIT; /* Send the commit signal to the transaction */ - success = trx_sig_send(thr_get_trx(thr), TRX_SIG_COMMIT, - TRX_SIG_SELF, thr, NULL, &next_thr); - - mutex_exit(&kernel_mutex); + next_thr = trx_sig_send(thr_get_trx(thr), TRX_SIG_COMMIT, + TRX_SIG_SELF, thr, NULL); - if (!success) { - /* Error in delivering the commit signal */ - que_thr_handle_error(thr, DB_ERROR, NULL, 0); - } + mutex_exit(&kernel_mutex); return(next_thr); } @@ -1564,7 +1471,9 @@ trx_mark_sql_stat_end( /************************************************************************** Prints info about a transaction to the standard output. The caller must -own the kernel mutex. */ +own the kernel mutex and must have called +innobase_mysql_prepare_print_arbitrary_thd(), unless he knows that MySQL or +InnoDB cannot meanwhile change the info printed here. */ void trx_print( diff --git a/innobase/usr/usr0sess.c b/innobase/usr/usr0sess.c index 359c1552421..cc016f2b823 100644 --- a/innobase/usr/usr0sess.c +++ b/innobase/usr/usr0sess.c @@ -37,8 +37,6 @@ sess_open(void) #endif /* UNIV_SYNC_DEBUG */ sess = mem_alloc(sizeof(sess_t)); - sess->state = SESS_ACTIVE; - sess->trx = trx_create(sess); UT_LIST_INIT(sess->graphs); diff --git a/innobase/ut/ut0dbg.c b/innobase/ut/ut0dbg.c index 3697e31050f..65703ec1c86 100644 --- a/innobase/ut/ut0dbg.c +++ b/innobase/ut/ut0dbg.c @@ -23,7 +23,7 @@ const char* ut_dbg_msg_assert_fail = "InnoDB: Assertion failure in thread %lu in file %s line %lu\n"; const char* ut_dbg_msg_trap = "InnoDB: We intentionally generate a memory trap.\n" -"InnoDB: Send a detailed bug report to mysql@lists.mysql.com.\n" +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com.\n" "InnoDB: If you get repeated assertion failures or crashes, even\n" "InnoDB: immediately after the mysqld startup, there may be\n" "InnoDB: corruption in the InnoDB tablespace. See section 6.1 of\n" diff --git a/innobase/ut/ut0mem.c b/innobase/ut/ut0mem.c index 9d0e63e6099..47b612d757e 100644 --- a/innobase/ut/ut0mem.c +++ b/innobase/ut/ut0mem.c @@ -273,53 +273,3 @@ ut_memcpyq( return(dest); } - -/************************************************************************** -Catenates two strings into newly allocated memory. The memory must be freed -using mem_free. */ - -char* -ut_str_catenate( -/*============*/ - /* out, own: catenated null-terminated string */ - char* str1, /* in: null-terminated string */ - char* str2) /* in: null-terminated string */ -{ - ulint len1; - ulint len2; - char* str; - - len1 = ut_strlen(str1); - len2 = ut_strlen(str2); - - str = mem_alloc(len1 + len2 + 1); - - ut_memcpy(str, str1, len1); - ut_memcpy(str + len1, str2, len2 + 1); - - return(str); -} - -/************************************************************************** -Return a copy of the given string. The returned string must be freed -using mem_free. */ - -char* -ut_strdup( -/*======*/ - /* out, own: cnull-terminated string */ - char* str) /* in: null-terminated string */ -{ - ulint len; - char* copy; - - len = ut_strlen(str); - - copy = mem_alloc(len + 1); - - ut_memcpy(copy, str, len); - - copy[len] = 0; - - return(copy); -} diff --git a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c index 21677e98318..39850227162 100644 --- a/innobase/ut/ut0ut.c +++ b/innobase/ut/ut0ut.c @@ -29,227 +29,6 @@ mysql_get_identifier_quote_char(void); /* out: quote character to be 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++, diff --git a/isam/_search.c b/isam/_search.c index 7b61abfb46b..fbffd6786e1 100644 --- a/isam/_search.c +++ b/isam/_search.c @@ -489,7 +489,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar int alength,blength; if (swap_flag) - swap(uchar*,a,b); + swap_variables(uchar*, a, b); alength= *a++; blength= *b++; if ((flag=(int) (keyseg->base.length-key_length)) < 0) flag=0; @@ -504,7 +504,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar if (*a == '-' && *b == '-') { swap_flag=1; - swap(uchar*,a,b); + swap_variables(uchar*, a, b); } end=a+alength; while (a < end) @@ -531,7 +531,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar if (swap_flag) { end=b+(int) (end-a); - swap(uchar*,a,b); + swap_variables(uchar*, a, b); } while (a < end) if (*a++ != *b++) @@ -550,7 +550,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar } } if (swap_flag) - swap(uchar*,a,b); + swap_variables(uchar*, a, b); break; } #ifdef HAVE_LONG_LONG diff --git a/isam/isamchk.c b/isam/isamchk.c index 8fa6b7ad4c0..513c1ea3a5d 100644 --- a/isam/isamchk.c +++ b/isam/isamchk.c @@ -333,12 +333,16 @@ static struct my_option my_long_options[] = {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; +#include + static void print_version(void) { printf("%s Ver 6.01 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); + NETWARE_SET_SCREEN_MODE(1); } + static void usage(void) { print_version(); @@ -352,6 +356,8 @@ static void usage(void) my_print_variables(my_long_options); } +#include + /* Check table */ static int nisamchk(my_string filename) diff --git a/isam/test2.c b/isam/test2.c index 14a40f39865..4b22f2d679c 100644 --- a/isam/test2.c +++ b/isam/test2.c @@ -526,7 +526,7 @@ int main(int argc, char *argv[]) if (j != 0 && k != 0) { if (j > k) - swap(int,j,k); + swap_variables(int, j, k); sprintf(key,"%6d",j); sprintf(key2,"%6d",k); range_records=nisam_records_in_range(file,0,key,0,HA_READ_AFTER_KEY, diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h index 1c1ff9bac10..1d4f45b729f 100644 --- a/libmysql/client_settings.h +++ b/libmysql/client_settings.h @@ -42,7 +42,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename); void mysql_read_default_options(struct st_mysql_options *options, const char *filename,const char *group); -MYSQL * +MYSQL * STDCALL cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, uint port, const char *unix_socket,ulong client_flag); diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 4ecc1bd0584..63f447ea1b9 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -88,8 +88,6 @@ my_bool net_flush(NET *net); static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data); static void append_wild(char *to,char *end,const char *wild); sig_handler pipe_sig_handler(int sig); -static ulong mysql_sub_escape_string(CHARSET_INFO *charset_info, char *to, - const char *from, ulong length); static my_bool mysql_client_init= 0; static my_bool org_my_init_done= 0; @@ -629,7 +627,7 @@ static int check_license(MYSQL *mysql) MYSQL_RES *res; NET *net= &mysql->net; static const char query[]= "SELECT @@license"; - static const char required_license[]= LICENSE; + static const char required_license[]= STRINGIFY_ARG(LICENSE); if (mysql_real_query(mysql, query, sizeof(query)-1)) { @@ -831,7 +829,8 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename) } /* initialize local infile (open file, usually) */ - if ((*options->local_infile_init)(&li_ptr, net_filename)) + if ((*options->local_infile_init)(&li_ptr, net_filename, + options->local_infile_userdata)) { my_net_write(net,"",0); /* Server needs one packet */ net_flush(net); @@ -915,7 +914,8 @@ typedef struct st_default_local_infile 1 error */ -static int default_local_infile_init(void **ptr, const char *filename) +static int default_local_infile_init(void **ptr, const char *filename, + void *userdata __attribute__ ((unused))) { default_local_infile_data *data; char tmp_name[FN_REFLEN]; @@ -1025,15 +1025,18 @@ default_local_infile_error(void *ptr, char *error_msg, uint error_msg_len) void mysql_set_local_infile_handler(MYSQL *mysql, - int (*local_infile_init)(void **, const char *), + int (*local_infile_init)(void **, const char *, + void *), int (*local_infile_read)(void *, char *, uint), void (*local_infile_end)(void *), - int (*local_infile_error)(void *, char *, uint)) + int (*local_infile_error)(void *, char *, uint), + void *userdata) { mysql->options.local_infile_init= local_infile_init; mysql->options.local_infile_read= local_infile_read; mysql->options.local_infile_end= local_infile_end; mysql->options.local_infile_error= local_infile_error; + mysql->options.local_infile_userdata = userdata; } @@ -1565,73 +1568,14 @@ void my_net_local_init(NET *net) ulong STDCALL mysql_escape_string(char *to,const char *from,ulong length) { - return mysql_sub_escape_string(default_charset_info,to,from,length); + return escape_string_for_mysql(default_charset_info, to, from, length); } ulong STDCALL mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, ulong length) { - return mysql_sub_escape_string(mysql->charset,to,from,length); -} - - -static ulong -mysql_sub_escape_string(CHARSET_INFO *charset_info, char *to, - const char *from, ulong length) -{ - const char *to_start=to; - const char *end; -#ifdef USE_MB - my_bool use_mb_flag=use_mb(charset_info); -#endif - for (end=from+length; from != end ; from++) - { -#ifdef USE_MB - int l; - if (use_mb_flag && (l = my_ismbchar(charset_info, from, end))) - { - while (l--) - *to++ = *from++; - from--; - continue; - } -#endif - switch (*from) { - case 0: /* Must be escaped for 'mysql' */ - *to++= '\\'; - *to++= '0'; - break; - case '\n': /* Must be escaped for logs */ - *to++= '\\'; - *to++= 'n'; - break; - case '\r': - *to++= '\\'; - *to++= 'r'; - break; - case '\\': - *to++= '\\'; - *to++= '\\'; - break; - case '\'': - *to++= '\\'; - *to++= '\''; - break; - case '"': /* Better safe than sorry */ - *to++= '\\'; - *to++= '"'; - break; - case '\032': /* This gives problems on Win32 */ - *to++= '\\'; - *to++= 'Z'; - break; - default: - *to++= *from; - } - } - *to=0; - return (ulong) (to-to_start); + return escape_string_for_mysql(mysql->charset, to, from, length); } @@ -1973,7 +1917,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length) if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE) { /* This is second prepare with another statement */ - char buff[4]; + char buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */ mysql_stmt_free_result(stmt); /* @@ -2348,6 +2292,14 @@ static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length) stmt->insert_id= mysql->insert_id; DBUG_RETURN(0); } + + +static void store_param_type(char **pos, MYSQL_BIND *param) +{ + uint typecode= param->buffer_type | (param->is_unsigned ? 32768 : 0); + int2store(*pos, typecode); + *pos+= 2; +} int cli_stmt_execute(MYSQL_STMT *stmt) @@ -2385,11 +2337,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt) that is sent to the server. */ for (param= stmt->params; param < param_end ; param++) - { - uint typecode= param->buffer_type | (param->is_unsigned ? 32768 : 0); - int2store(net->write_pos, typecode); - net->write_pos+= 2; - } + store_param_type((char**) &net->write_pos, param); } for (param= stmt->params; param < param_end; param++) @@ -2799,25 +2747,27 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, param->param_number); DBUG_RETURN(1); } - /* Mark for execute that the result is already sent */ + + /* + Send long data packet if there is data or we're sending long data + for the first time. + */ if (length || param->long_data_used == 0) { MYSQL *mysql= stmt->mysql; - char *packet, extra_data[MYSQL_LONG_DATA_HEADER]; - + /* Packet header: stmt id (4 bytes), param no (2 bytes) */ + char buff[MYSQL_LONG_DATA_HEADER]; + + int4store(buff, stmt->stmt_id); + int2store(buff + 4, param_number); param->long_data_used= 1; - packet= extra_data; - int4store(packet, stmt->stmt_id); packet+=4; - int2store(packet, param_number); packet+=2; - /* Note that we don't get any ok packet from the server in this case This is intentional to save bandwidth. */ - if ((*mysql->methods->advanced_command)(mysql, COM_LONG_DATA, extra_data, - MYSQL_LONG_DATA_HEADER, data, - length, 1)) + if ((*mysql->methods->advanced_command)(mysql, COM_LONG_DATA, buff, + sizeof(buff), data, length, 1)) { set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, mysql->net.sqlstate); @@ -3724,28 +3674,6 @@ int cli_read_binary_rows(MYSQL_STMT *stmt) mysql= mysql->last_used_con; - if (stmt->update_max_length && !stmt->bind_result_done) - { - /* - We must initalize the bind structure to be able to calculate - max_length - */ - MYSQL_BIND *bind, *end; - MYSQL_FIELD *field; - bzero((char*) stmt->bind, sizeof(*stmt->bind)* stmt->field_count); - - for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields; - bind < end ; - bind++, field++) - { - bind->buffer_type= field->type; - bind->buffer_length=1; - } - - mysql_stmt_bind_result(stmt, stmt->bind); - stmt->bind_result_done= 0; /* No normal bind done */ - } - while ((pkt_len= net_safe_read(mysql)) != packet_error) { cp= net->read_pos; @@ -3763,8 +3691,6 @@ int cli_read_binary_rows(MYSQL_STMT *stmt) memcpy((char *) cur->data, (char *) cp+1, pkt_len-1); cur->length= pkt_len; /* To allow us to do sanity checks */ result->rows++; - if (stmt->update_max_length) - stmt_update_metadata(stmt, cur); } else { @@ -3809,6 +3735,29 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt) result->rows= 0; stmt->data_cursor= NULL; } + + if (stmt->update_max_length && !stmt->bind_result_done) + { + /* + We must initalize the bind structure to be able to calculate + max_length + */ + MYSQL_BIND *bind, *end; + MYSQL_FIELD *field; + bzero((char*) stmt->bind, sizeof(*stmt->bind)* stmt->field_count); + + for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields; + bind < end ; + bind++, field++) + { + bind->buffer_type= field->type; + bind->buffer_length=1; + } + + mysql_stmt_bind_result(stmt, stmt->bind); + stmt->bind_result_done= 0; /* No normal bind done */ + } + if ((*mysql->methods->read_binary_rows)(stmt)) { free_root(&result->alloc, MYF(MY_KEEP_PREALLOC)); @@ -3817,6 +3766,13 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt) DBUG_RETURN(1); } + if (stmt->update_max_length) + { + MYSQL_ROWS *cur= result->data; + for(; cur; cur=cur->next) + stmt_update_metadata(stmt, cur); + } + stmt->data_cursor= result->data; mysql->affected_rows= stmt->affected_rows= result->rows; stmt->read_row_func= stmt_read_row_buffered; @@ -3951,7 +3907,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) mysql->stmts= list_delete(mysql->stmts, &stmt->list); if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE) { - char buff[4]; + char buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */ if (mysql->unbuffered_fetch_owner == &stmt->unbuffered_fetch_cancelled) mysql->unbuffered_fetch_owner= 0; @@ -3986,7 +3942,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt) { - char buff[MYSQL_STMT_HEADER]; + char buff[MYSQL_STMT_HEADER]; /* packet header: 4 bytes for stmt id */ MYSQL *mysql; MYSQL_BIND *param, *param_end; DBUG_ENTER("mysql_stmt_reset"); @@ -3999,7 +3955,7 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt) mysql= stmt->mysql->last_used_con; int4store(buff, stmt->stmt_id); /* Send stmt id to server */ if ((*mysql->methods->advanced_command)(mysql, COM_RESET_STMT, buff, - MYSQL_STMT_HEADER,0,0,0)) + sizeof(buff), 0, 0, 0)) { set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, mysql->net.sqlstate); diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 036a61208ed..29e88eb41f2 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -48,7 +48,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ key.cc lock.cc log.cc log_event.cc sql_state.c \ protocol.cc net_serv.cc opt_range.cc \ opt_sum.cc procedure.cc records.cc sql_acl.cc \ - sql_load.cc sql_olap.cc discover.cc \ + sql_load.cc discover.cc \ sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \ sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \ sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc sql_parse.cc \ @@ -79,25 +79,32 @@ INC_LIB= $(top_builddir)/regex/libregex.a \ $(top_builddir)/vio/libvio.a # -# To make it easy for the end user to use the embedded library we -# generate a total libmysqld.a from all library files, +# To make it easy for the end user to use the embedded library we +# generate a total libmysqld.a from all library files, libmysqld.a: libmysqld_int.a $(INC_LIB) - if test ! -d tmp ; then mkdir tmp ; fi - rm -f $@ libmysqld_int2.a tmp/*.o tmp/*.a - cp $(INC_LIB) tmp - cp libmysqld_int.a libmysqld_int2.a ; \ - cd tmp ; \ - for file in *.a ; do \ - bfile=`basename $$file .a` ; \ - $(AR) x $$file; \ - for obj in *.o ; do mv $$obj $${bfile}_$$obj ; done ; \ - $(AR) q ../libmysqld_int2.a *.o ; \ - rm -f *.o ; \ - done - mv libmysqld_int2.a libmysqld.a - rm -f tmp/* - $(RANLIB) libmysqld.a + if test "$(host_os)" = "netware" ; \ + then \ + $(libmysqld_a_AR) libmysqld.a libmysqld_int.a $(INC_LIB) ; \ + else \ + if test ! -d tmp ; then mkdir tmp ; fi ; \ + rm -f $@ libmysqld_int2.a tmp/*.o tmp/*.a ; \ + cp $(INC_LIB) tmp ; \ + cp libmysqld_int.a libmysqld_int2.a ; \ + cd tmp ; \ + for file in *.a ; do \ + bfile=`basename $$file .a` ; \ + $(AR) x $$file; \ + for obj in *.o ; do mv $$obj $${bfile}_$$obj ; done ; \ + $(AR) q ../libmysqld_int2.a *.o ; \ + rm -f *.o ; \ + done ; \ + cd .. ; \ + mv libmysqld_int2.a libmysqld.a ; \ + rm -f tmp/* ; \ + $(RANLIB) libmysqld.a ; \ + fi + ## XXX: any time the client interface changes, we'll need to bump ## the version info for libmysqld; however, it's possible for the diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc index 0b6416632b7..7d83023abd5 100644 --- a/libmysqld/emb_qcache.cc +++ b/libmysqld/emb_qcache.cc @@ -295,7 +295,7 @@ uint emb_count_querycache_size(THD *thd) cur_row= thd->data->data; n_rows= thd->data->rows; } - result= 4+8 + (42 + 4*n_rows)*mysql->field_count; + result= (uint) (4+8 + (42 + 4*n_rows)*mysql->field_count); for(; field < field_end; field++) { @@ -414,8 +414,8 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src) goto err; thd->data= data; init_alloc_root(&data->alloc, 8192,0); - row= (MYSQL_ROWS *)alloc_root(&data->alloc, rows * sizeof(MYSQL_ROWS) + - rows * (mysql->field_count+1)*sizeof(char*)); + row= (MYSQL_ROWS *)alloc_root(&data->alloc, (uint) (rows * sizeof(MYSQL_ROWS) + + rows * (mysql->field_count+1)*sizeof(char*))); end_row= row + rows; columns= (MYSQL_ROW)end_row; diff --git a/libmysqld/embedded_priv.h b/libmysqld/embedded_priv.h index 1608f4ed4ad..d4316dff63f 100644 --- a/libmysqld/embedded_priv.h +++ b/libmysqld/embedded_priv.h @@ -28,5 +28,6 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db); void *create_embedded_thd(int client_flag, char *db); int check_embedded_connection(MYSQL *mysql); void free_old_query(MYSQL *mysql); +void embedded_get_error(MYSQL *mysql); extern MYSQL_METHODS embedded_methods; C_MODE_END diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am index fe56926039d..b3db54d305a 100644 --- a/libmysqld/examples/Makefile.am +++ b/libmysqld/examples/Makefile.am @@ -1,11 +1,16 @@ -noinst_PROGRAMS = mysqltest mysql +noinst_PROGRAMS = mysqltest mysql client_test client_sources = $(mysqltest_SOURCES) $(mysql_SOURCES) +tests_sources= $(client_test_SOURCES) link_sources: for f in $(client_sources); do \ rm -f $(srcdir)/$$f; \ @LN_CP_F@ $(srcdir)/../../client/$$f $(srcdir)/$$f; \ done; + for f in $(tests_sources); do \ + rm -f $(srcdir)/$$f; \ + @LN_CP_F@ $(srcdir)/../../tests/$$f $(srcdir)/$$f; \ + done; DEFS = -DEMBEDDED_LIBRARY INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir) \ @@ -21,8 +26,12 @@ mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \ my_readline.h sql_string.h completion_hash.h mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) +client_test_LINK = $(CXXLINK) +client_test_SOURCES = client_test.c + clean: rm -f $(client_sources) + rm -f $(tests_sources) # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index cfb50d3907a..2bbca220db9 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -42,6 +42,22 @@ C_MODE_START #include "errmsg.h" #include +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 *list, uint flag) if (!(res=item->val_str(&tmp))) { - client_field->def= strdup_root(field_alloc, ""); client_field->def_length= 0; + client_field->def= strmake_root(field_alloc, "",0); } else { - client_field->def= strdup_root(field_alloc, res->ptr()); client_field->def_length= res->length(); + client_field->def= strmake_root(field_alloc, res->ptr(), + client_field->def_length); } } else diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index 95f745aef5f..db9e828369d 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -232,6 +232,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, DBUG_RETURN(mysql); error: + embedded_get_error(mysql); DBUG_PRINT("error",("message: %u (%s)", mysql->net.last_errno, mysql->net.last_error)); { diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def index c3f757b5f1a..8b2ad8379d6 100644 --- a/libmysqld/libmysqld.def +++ b/libmysqld/libmysqld.def @@ -128,3 +128,5 @@ EXPORTS alloc_root free_root my_read + max_allowed_packet + llstr diff --git a/myisam/ft_nlq_search.c b/myisam/ft_nlq_search.c index 9b42d51ab55..c9caf4f39af 100644 --- a/myisam/ft_nlq_search.c +++ b/myisam/ft_nlq_search.c @@ -90,8 +90,9 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) /* Skip rows inserted by current inserted */ for (r=_mi_search(info, keyinfo, keybuff, keylen, SEARCH_FIND, key_root) ; - (subkeys=ft_sintXkorr(info->lastkey+info->lastkey_length-extra)) > 0 && - !r && info->lastpos >= info->state->data_file_length ; + !r && + (subkeys=ft_sintXkorr(info->lastkey+info->lastkey_length-extra)) > 0 && + info->lastpos >= info->state->data_file_length ; r= _mi_search_next(info, keyinfo, info->lastkey, info->lastkey_length, SEARCH_BIGGER, key_root)) ; diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 2d89efa61f6..ab58a36915e 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -3311,8 +3311,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a) } get_key_full_length_rdonly(val_off, ft_buf->lastkey); - if (val_off == a_len && - mi_compare_text(sort_param->seg->charset, + if (mi_compare_text(sort_param->seg->charset, ((uchar *)a)+1,a_len-1, ft_buf->lastkey+1,val_off-1, 0, 0)==0) { @@ -3320,11 +3319,11 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a) { ft_buf->count++; return sort_insert_key(sort_param,key_block, - ((uchar *)a)+val_off, HA_OFFSET_ERROR); + ((uchar *)a)+a_len, HA_OFFSET_ERROR); } /* storing the key in the buffer. */ - memcpy (ft_buf->buf, (char *)a+val_off, val_len); + memcpy (ft_buf->buf, (char *)a+a_len, val_len); ft_buf->buf+=val_len; if (ft_buf->buf < ft_buf->end) return 0; diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c index 30a4762abe0..f64e774810d 100644 --- a/myisam/mi_dynrec.c +++ b/myisam/mi_dynrec.c @@ -311,7 +311,7 @@ static int update_backward_delete_link(MI_INFO *info, my_off_t delete_block, DBUG_RETURN(1); /* Wrong delete link */ } } - return 0; + DBUG_RETURN(0); } /* Delete datarecord from database */ diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 2c4661c4d3e..53cf87b24b4 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1151,3 +1151,84 @@ int mi_open_keyfile(MYISAM_SHARE *share) return 1; return 0; } + + +/* + Disable all indexes. + + SYNOPSIS + mi_disable_indexes() + info A pointer to the MyISAM storage engine MI_INFO struct. + + DESCRIPTION + Disable all indexes. + + RETURN + 0 ok +*/ + +int mi_disable_indexes(MI_INFO *info) +{ + MYISAM_SHARE *share= info->s; + + share->state.key_map= 0; + return 0; +} + + +/* + Enable all indexes + + SYNOPSIS + mi_enable_indexes() + info A pointer to the MyISAM storage engine MI_INFO struct. + + DESCRIPTION + Enable all indexes. The indexes might have been disabled + by mi_disable_index() before. + The function works only if both data and indexes are empty, + otherwise a repair is required. + To be sure, call handler::delete_all_rows() before. + + RETURN + 0 ok + HA_ERR_CRASHED data or index is non-empty. +*/ + +int mi_enable_indexes(MI_INFO *info) +{ + int error= 0; + MYISAM_SHARE *share= info->s; + + if (share->state.state.data_file_length || + (share->state.state.key_file_length != share->base.keystart)) + error= HA_ERR_CRASHED; + else + share->state.key_map= ((ulonglong) 1L << share->base.keys) - 1; + return error; +} + + +/* + Test if indexes are disabled. + + SYNOPSIS + mi_indexes_are_disabled() + info A pointer to the MyISAM storage engine MI_INFO struct. + + DESCRIPTION + Test if indexes are disabled. + + RETURN + 0 indexes are not disabled + 1 all indexes are disabled + [2 non-unique indexes are disabled - NOT YET IMPLEMENTED] +*/ + +int mi_indexes_are_disabled(MI_INFO *info) +{ + MYISAM_SHARE *share= info->s; + + return (! share->state.key_map && share->base.keys); +} + diff --git a/myisam/mi_range.c b/myisam/mi_range.c index caa57ce6187..db01ada16dd 100644 --- a/myisam/mi_range.c +++ b/myisam/mi_range.c @@ -30,15 +30,27 @@ static uint _mi_keynr(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *page, uchar *keypos,uint *ret_max_key); - /* If start_key = 0 assume read from start */ - /* If end_key = 0 assume read to end */ - /* Returns HA_POS_ERROR on error */ +/* + Estimate how many records there is in a given range -ha_rows mi_records_in_range(MI_INFO *info, int inx, const byte *start_key, - uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key, uint end_key_len, - enum ha_rkey_function end_search_flag) + SYNOPSIS + mi_records_in_range() + info MyISAM handler + inx Index to use + min_key Min key. Is = 0 if no min range + max_key Max key. Is = 0 if no max range + + NOTES + We should ONLY return 0 if there is no rows in range + + RETURN + HA_POS_ERROR error (or we can't estimate number of rows) + number Estimated number of rows +*/ + + +ha_rows mi_records_in_range(MI_INFO *info, int inx, key_range *min_key, + key_range *max_key) { ha_rows start_pos,end_pos,res; DBUG_ENTER("mi_records_in_range"); @@ -54,27 +66,31 @@ ha_rows mi_records_in_range(MI_INFO *info, int inx, const byte *start_key, switch(info->s->keyinfo[inx].key_alg){ case HA_KEY_ALG_RTREE: - { - uchar * key_buff; - if (start_key_len == 0) - start_key_len=USE_WHOLE_KEY; - key_buff=info->lastkey+info->s->base.max_key_length; - start_key_len= _mi_pack_key(info,inx,key_buff,(uchar*) start_key, - start_key_len, (HA_KEYSEG**) 0); - res=rtree_estimate(info, inx, key_buff, start_key_len, myisam_read_vec[start_search_flag]); - res=res?res:1; - break; - } + { + uchar * key_buff; + uint start_key_len; + + key_buff= info->lastkey+info->s->base.max_key_length; + start_key_len= _mi_pack_key(info,inx, key_buff, + (uchar*) min_key->key, min_key->length, + (HA_KEYSEG**) 0); + res= rtree_estimate(info, inx, key_buff, start_key_len, + myisam_read_vec[min_key->flag]); + res= res ? res : 1; /* Don't return 0 */ + break; + } case HA_KEY_ALG_BTREE: default: - start_pos= (start_key ? - _mi_record_pos(info,start_key,start_key_len,start_search_flag) : - (ha_rows) 0); - end_pos= (end_key ? - _mi_record_pos(info,end_key,end_key_len,end_search_flag) : - info->state->records+ (ha_rows) 1); - res=end_pos < start_pos ? (ha_rows) 0 : - (end_pos == start_pos ? (ha_rows) 1 : end_pos-start_pos); + start_pos= (min_key ? + _mi_record_pos(info, min_key->key, min_key->length, + min_key->flag) : + (ha_rows) 0); + end_pos= (max_key ? + _mi_record_pos(info, max_key->key, max_key->length, + max_key->flag) : + info->state->records+ (ha_rows) 1); + res= (end_pos < start_pos ? (ha_rows) 0 : + (end_pos == start_pos ? (ha_rows) 1 : end_pos-start_pos)); if (start_pos == HA_POS_ERROR || end_pos == HA_POS_ERROR) res=HA_POS_ERROR; } diff --git a/myisam/mi_test2.c b/myisam/mi_test2.c index d3c3cc2c492..95c8ce56a13 100644 --- a/myisam/mi_test2.c +++ b/myisam/mi_test2.c @@ -606,13 +606,20 @@ int main(int argc, char *argv[]) mi_status(file,&info,HA_STATUS_VARIABLE); for (i=0 ; i < info.keys ; i++) { + key_range min_key, max_key; if (mi_rfirst(file,read_record,(int) i) || mi_rlast(file,read_record2,(int) i)) goto err; copy_key(file,(uint) i,(uchar*) read_record,(uchar*) key); copy_key(file,(uint) i,(uchar*) read_record2,(uchar*) key2); - range_records=mi_records_in_range(file,(int) i,key,0,HA_READ_KEY_EXACT, - key2,0,HA_READ_AFTER_KEY); + min_key.key= key; + min_key.length= USE_WHOLE_KEY; + min_key.flag= HA_READ_KEY_EXACT; + max_key.key= key2; + max_key.length= USE_WHOLE_KEY; + max_key.flag= HA_READ_AFTER_KEY; + + range_records= mi_records_in_range(file,(int) i, &min_key, &max_key); if (range_records < info.records*8/10 || range_records > info.records*12/10) { @@ -634,12 +641,19 @@ int main(int argc, char *argv[]) for (k=rnd(1000)+1 ; k>0 && key1[k] == 0 ; k--) ; if (j != 0 && k != 0) { + key_range min_key, max_key; if (j > k) - swap(int,j,k); + swap_variables(int, j, k); sprintf(key,"%6d",j); sprintf(key2,"%6d",k); - range_records=mi_records_in_range(file,0,key,0,HA_READ_AFTER_KEY, - key2,0,HA_READ_BEFORE_KEY); + + min_key.key= key; + min_key.length= USE_WHOLE_KEY; + min_key.flag= HA_READ_AFTER_KEY; + max_key.key= key2; + max_key.length= USE_WHOLE_KEY; + max_key.flag= HA_READ_BEFORE_KEY; + range_records= mi_records_in_range(file, 0, &min_key, &max_key); records=0; for (j++ ; j < k ; j++) records+=key1[j]; diff --git a/myisam/myisam_ftdump.c b/myisam/myisam_ftdump.c index 075a0fd19e8..eeee96d0ff2 100644 --- a/myisam/myisam_ftdump.c +++ b/myisam/myisam_ftdump.c @@ -264,15 +264,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), return 0; } +#include static void usage() { printf("Use: myisam_ftdump \n"); my_print_help(my_long_options); my_print_variables(my_long_options); + NETWARE_SET_SCREEN_MODE(1); exit(1); } +#include static void complain(int val) /* Kinda assert :-) */ { diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index cb7c8ae8288..545aadebae8 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -336,10 +336,13 @@ static struct my_option my_long_options[] = }; +#include + static void print_version(void) { printf("%s Ver 2.7 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); + NETWARE_SET_SCREEN_MODE(1); } @@ -452,6 +455,7 @@ static void usage(void) my_print_variables(my_long_options); } +#include /* Read options */ diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index 72260699d1e..d092151aacc 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -684,6 +684,9 @@ uint mi_uniquedef_write(File file, MI_UNIQUEDEF *keydef); char *mi_uniquedef_read(char *ptr, MI_UNIQUEDEF *keydef); uint mi_recinfo_write(File file, MI_COLUMNDEF *recinfo); char *mi_recinfo_read(char *ptr, MI_COLUMNDEF *recinfo); +extern int mi_disable_indexes(MI_INFO *info); +extern int mi_enable_indexes(MI_INFO *info); +extern int mi_indexes_are_disabled(MI_INFO *info); ulong _my_calc_total_blob_length(MI_INFO *info, const byte *record); ha_checksum mi_checksum(MI_INFO *info, const byte *buf); ha_checksum mi_static_checksum(MI_INFO *info, const byte *buf); diff --git a/myisam/myisampack.c b/myisam/myisampack.c index b6d862e38b5..de4bd80805a 100644 --- a/myisam/myisampack.c +++ b/myisam/myisampack.c @@ -266,12 +266,15 @@ static struct my_option my_long_options[] = { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; +#include static void print_version(void) { printf("%s Ver 1.22 for %s on %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); + NETWARE_SET_SCREEN_MODE(1); } + static void usage(void) { print_version(); @@ -290,6 +293,7 @@ static void usage(void) my_print_variables(my_long_options); } +#include static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), diff --git a/myisam/rt_test.c b/myisam/rt_test.c index bbeb8fce2d1..41cc56d4d78 100644 --- a/myisam/rt_test.c +++ b/myisam/rt_test.c @@ -39,8 +39,7 @@ int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused))) } - -int run_test(const char *filename) +static int run_test(const char *filename) { MI_INFO *file; MI_UNIQUEDEF uniquedef; @@ -48,6 +47,7 @@ int run_test(const char *filename) MI_COLUMNDEF recinfo[20]; MI_KEYDEF keyinfo[20]; HA_KEYSEG keyseg[20]; + key_range range; int silent=0; int opt_unique=0; @@ -66,15 +66,12 @@ int run_test(const char *filename) int upd= 10; ha_rows hrows; - - /* Define a column for NULLs and DEL markers*/ recinfo[0].type=FIELD_NORMAL; recinfo[0].length=1; /* For NULL bits */ rec_length=1; - /* Define 2*ndims columns for coordinates*/ for (i=1; i<=2*ndims ;i++){ @@ -83,7 +80,6 @@ int run_test(const char *filename) rec_length+=key_length; } - /* Define a key with 2*ndims segments */ keyinfo[0].seg=keyseg; @@ -101,8 +97,7 @@ int run_test(const char *filename) keyinfo[0].seg[i].language=default_charset_info->number; } - - if(!silent) + if (!silent) printf("- Creating isam-file\n"); bzero((char*) &create_info,sizeof(create_info)); @@ -115,15 +110,11 @@ int run_test(const char *filename) recinfo,uniques,&uniquedef,&create_info,create_flag)) goto err; - - - - if(!silent) + if (!silent) printf("- Open isam-file\n"); if (!(file=mi_open(filename,2,HA_OPEN_ABORT_IF_LOCKED))) goto err; - if (!silent) printf("- Writing key:s\n"); @@ -144,11 +135,9 @@ int run_test(const char *filename) } } - - if((error=read_with_pos(file,silent))) + if ((error=read_with_pos(file,silent))) goto err; - if (!silent) printf("- Reading rows with key\n"); @@ -160,12 +149,12 @@ int run_test(const char *filename) bzero((char*) read_record,MAX_REC_LENGTH); error=mi_rkey(file,read_record,0,record+1,0,HA_READ_MBR_EQUAL); - if(error && error!=HA_ERR_KEY_NOT_FOUND) + if (error && error!=HA_ERR_KEY_NOT_FOUND) { printf(" mi_rkey: %3d errno: %3d\n",error,my_errno); goto err; } - if(error == HA_ERR_KEY_NOT_FOUND) + if (error == HA_ERR_KEY_NOT_FOUND) { print_record(record,mi_position(file)," NOT FOUND\n"); continue; @@ -173,10 +162,6 @@ int run_test(const char *filename) print_record(read_record,mi_position(file),"\n"); } - - - - if (!silent) printf("- Deleting rows\n"); for (i=0; i < nrecords/4; i++) @@ -184,7 +169,7 @@ int run_test(const char *filename) my_errno=0; bzero((char*) read_record,MAX_REC_LENGTH); error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR); - if(error) + if (error) { printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno); goto err; @@ -192,14 +177,13 @@ int run_test(const char *filename) print_record(read_record,mi_position(file),"\n"); error=mi_delete(file,read_record); - if(error) + if (error) { printf("pos: %2d mi_delete: %3d errno: %3d\n",i,error,my_errno); goto err; } } - if (!silent) printf("- Updating rows with position\n"); for (i=0; i < (nrecords - nrecords/4) ; i++) @@ -207,9 +191,9 @@ int run_test(const char *filename) my_errno=0; bzero((char*) read_record,MAX_REC_LENGTH); error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR); - if(error) + if (error) { - if(error==HA_ERR_RECORD_DELETED) + if (error==HA_ERR_RECORD_DELETED) continue; printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno); goto err; @@ -219,19 +203,16 @@ int run_test(const char *filename) printf("\t-> "); print_record(record,mi_position(file),"\n"); error=mi_update(file,read_record,record); - if(error) + if (error) { printf("pos: %2d mi_update: %3d errno: %3d\n",i,error,my_errno); goto err; } } - - if((error=read_with_pos(file,silent))) + if ((error=read_with_pos(file,silent))) goto err; - - if (!silent) printf("- Test mi_rkey then a sequence of mi_rnext_same\n"); @@ -246,25 +227,20 @@ int run_test(const char *filename) print_record(read_record,mi_position(file)," mi_rkey\n"); row_count=1; - - do { - if((error=mi_rnext_same(file,read_record))) + for (;;) + { + if ((error=mi_rnext_same(file,read_record))) { - if(error==HA_ERR_END_OF_FILE) + if (error==HA_ERR_END_OF_FILE) break; printf("mi_next: %3d errno: %3d\n",error,my_errno); goto err; } print_record(read_record,mi_position(file)," mi_rnext_same\n"); row_count++; - }while(1); + } printf(" %d rows\n",row_count); - - - - - if (!silent) printf("- Test mi_rfirst then a sequence of mi_rnext\n"); @@ -277,10 +253,11 @@ int run_test(const char *filename) row_count=1; print_record(read_record,mi_position(file)," mi_frirst\n"); - for(i=0;i "); print_record(record,mi_position(file),"\n"); error=mi_update(file,read_record,record); - if(error) + if (error) { printf("pos: %2d mi_update: %3d errno: %3d\n",i,error,my_errno); goto err; } } - - - if((error=read_with_pos(file,silent))) + if ((error=read_with_pos(file,silent))) goto err; - - if (!silent) printf("- Test mi_rkey then a sequence of mi_rnext_same\n"); @@ -219,25 +204,20 @@ int run_test(const char *filename) print_record(read_record,mi_position(file)," mi_rkey\n"); row_count=1; - - do { - if((error=mi_rnext_same(file,read_record))) + for (;;) + { + if ((error=mi_rnext_same(file,read_record))) { - if(error==HA_ERR_END_OF_FILE) + if (error==HA_ERR_END_OF_FILE) break; printf("mi_next: %3d errno: %3d\n",error,my_errno); goto err; } print_record(read_record,mi_position(file)," mi_rnext_same\n"); row_count++; - }while(1); + } printf(" %d rows\n",row_count); - - - - - if (!silent) printf("- Test mi_rfirst then a sequence of mi_rnext\n"); @@ -251,9 +231,9 @@ int run_test(const char *filename) print_record(read_record,mi_position(file)," mi_frirst\n"); for(i=0;i "); @@ -360,7 +339,6 @@ static void print_record(char * record, my_off_t offs,const char * tail) } - #ifdef NOT_USED static void create_point(char *record,uint rownr) { @@ -447,7 +425,6 @@ static void print_key(const char *key,const char * tail) } - #ifdef NOT_USED static int rtree_CreatePointWKB(double *ords, uint n_dims, uchar *wkb) @@ -489,6 +466,7 @@ static int rtree_CreateLineStringWKB(double *ords, uint n_dims, uint n_points, return 9 + n_points * n_dims * 8; } + static void rtree_PrintWKB(uchar *wkb, uint n_dims) { uint wkb_type; diff --git a/myisammrg/myrg_range.c b/myisammrg/myrg_range.c index 7644ae40c7b..aafdf70525c 100644 --- a/myisammrg/myrg_range.c +++ b/myisammrg/myrg_range.c @@ -16,20 +16,15 @@ #include "myrg_def.h" -ha_rows myrg_records_in_range(MYRG_INFO *info, int inx, const byte *start_key, - uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key, uint end_key_len, - enum ha_rkey_function end_search_flag) +ha_rows myrg_records_in_range(MYRG_INFO *info, int inx, + key_range *min_key, key_range *max_key) { ha_rows records=0, res; MYRG_TABLE *table; for (table=info->open_tables ; table != info->end_table ; table++) { - res=mi_records_in_range(table->table, inx, - start_key, start_key_len, start_search_flag, - end_key, end_key_len, end_search_flag); + res= mi_records_in_range(table->table, inx, min_key, max_key); if (res == HA_POS_ERROR) return HA_POS_ERROR; if (records > HA_POS_ERROR - res) diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index 9541fa6d355..66b24248cf9 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -142,7 +142,7 @@ explain extended select last_insert_id(); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache last_insert_id() AS `last_insert_id()` +Note 1003 select sql_no_cache last_insert_id() AS `last_insert_id()` insert into t1 set i = 254; ERROR 23000: Duplicate entry '254' for key 1 select last_insert_id(); diff --git a/mysql-test/r/bench_count_distinct.result b/mysql-test/r/bench_count_distinct.result index 2b4701389db..fcc0c0948b3 100644 --- a/mysql-test/r/bench_count_distinct.result +++ b/mysql-test/r/bench_count_distinct.result @@ -7,5 +7,5 @@ explain extended select count(distinct n) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL n 4 NULL 200 Using index Warnings: -Note 1003 select high_priority count(distinct test.t1.n) AS `count(distinct n)` from test.t1 +Note 1003 select count(distinct test.t1.n) AS `count(distinct n)` from test.t1 drop table t1; diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index 14b1788ddd6..1aa838140fd 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -27,7 +27,7 @@ explain extended select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" E id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority (case 1 when 1 then _latin1'one' when 2 then _latin1'two' else _latin1'more' end) AS `CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END` +Note 1003 select (case 1 when 1 then _latin1'one' when 2 then _latin1'two' else _latin1'more' end) AS `CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END` select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END; CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END two @@ -66,7 +66,7 @@ explain extended select case a when 1 then 2 when 2 then 3 else 0 end as fcase, id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort Warnings: -Note 1003 select high_priority (case test.t1.a when 1 then 2 when 2 then 3 else 0 end) AS `fcase`,count(0) AS `count(*)` from test.t1 group by (case test.t1.a when 1 then 2 when 2 then 3 else 0 end) +Note 1003 select (case test.t1.a when 1 then 2 when 2 then 3 else 0 end) AS `fcase`,count(0) AS `count(*)` from test.t1 group by (case test.t1.a when 1 then 2 when 2 then 3 else 0 end) select case a when 1 then "one" when 2 then "two" else "nothing" end as fcase, count(*) from t1 group by fcase; fcase count(*) nothing 2 @@ -141,7 +141,7 @@ COALESCE('a' COLLATE latin1_bin,'b'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,coalesce(_latin1'a') AS `COALESCE('a')`,coalesce(1,1.0) AS `COALESCE(1,1.0)`,coalesce(1,_latin1'1') AS `COALESCE(1,'1')`,coalesce(1.1,_latin1'1') AS `COALESCE(1.1,'1')`,coalesce((_latin1'a' collate _latin1'latin1_bin'),_latin1'b') AS `COALESCE('a' COLLATE latin1_bin,'b')` +Note 1003 select coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,coalesce(_latin1'a') AS `COALESCE('a')`,coalesce(1,1.0) AS `COALESCE(1,1.0)`,coalesce(1,_latin1'1') AS `COALESCE(1,'1')`,coalesce(1.1,_latin1'1') AS `COALESCE(1.1,'1')`,coalesce((_latin1'a' collate _latin1'latin1_bin'),_latin1'b') AS `COALESCE('a' COLLATE latin1_bin,'b')` SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index cdeb5b3dc21..6564a3e392b 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -20,7 +20,7 @@ explain extended select ~5, cast(~5 as signed); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority ~(5) AS `~5`,cast(~(5) as signed) AS `cast(~5 as signed)` +Note 1003 select ~(5) AS `~5`,cast(~(5) as signed) AS `cast(~5 as signed)` select cast(5 as unsigned) -6.0; cast(5 as unsigned) -6.0 -1.0 diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result index 8f4ddedbfcf..d4a8beda185 100644 --- a/mysql-test/r/ctype_collate.result +++ b/mysql-test/r/ctype_collate.result @@ -519,7 +519,7 @@ explain extended SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority charset(_latin1'a') AS `charset('a')`,collation(_latin1'a') AS `collation('a')`,coercibility(_latin1'a') AS `coercibility('a')`,(_latin1'a' = _latin1'A') AS `'a'='A'` +Note 1003 select charset(_latin1'a') AS `charset('a')`,collation(_latin1'a') AS `collation('a')`,coercibility(_latin1'a') AS `coercibility('a')`,(_latin1'a' = _latin1'A') AS `'a'='A'` SET CHARACTER SET koi8r; SHOW VARIABLES LIKE 'collation_client'; Variable_name Value diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result new file mode 100644 index 00000000000..a8182438ac4 --- /dev/null +++ b/mysql-test/r/ctype_latin1.result @@ -0,0 +1,298 @@ +drop table if exists t1; +SET NAMES latin1; +CREATE TABLE t1 (a char(1) character set latin1); +INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07); +INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17); +INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27); +INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37); +INSERT INTO t1 VALUES (0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +INSERT INTO t1 VALUES (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47); +INSERT INTO t1 VALUES (0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +INSERT INTO t1 VALUES (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57); +INSERT INTO t1 VALUES (0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +INSERT INTO t1 VALUES (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67); +INSERT INTO t1 VALUES (0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +INSERT INTO t1 VALUES (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77); +INSERT INTO t1 VALUES (0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +INSERT INTO t1 VALUES (0x80),(0x81),(0x82),(0x83),(0x84),(0x85),(0x86),(0x87); +INSERT INTO t1 VALUES (0x88),(0x89),(0x8A),(0x8B),(0x8C),(0x8D),(0x8E),(0x8F); +INSERT INTO t1 VALUES (0x90),(0x91),(0x92),(0x93),(0x94),(0x95),(0x96),(0x97); +INSERT INTO t1 VALUES (0x98),(0x99),(0x9A),(0x9B),(0x9C),(0x9D),(0x9E),(0x9F); +INSERT INTO t1 VALUES (0xA0),(0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7); +INSERT INTO t1 VALUES (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF); +INSERT INTO t1 VALUES (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7); +INSERT INTO t1 VALUES (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF); +INSERT INTO t1 VALUES (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7); +INSERT INTO t1 VALUES (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF); +INSERT INTO t1 VALUES (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7); +INSERT INTO t1 VALUES (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF); +INSERT INTO t1 VALUES (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7); +INSERT INTO t1 VALUES (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF); +INSERT INTO t1 VALUES (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7); +INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF); +SELECT +hex(a), +hex(@u:=convert(a using utf8)), +hex(@l:=convert(@u using latin1)), +a=@l FROM t1; +hex(a) hex(@u:=convert(a using utf8)) hex(@l:=convert(@u using latin1)) a=@l +00 00 00 1 +01 01 01 1 +02 02 02 1 +03 03 03 1 +04 04 04 1 +05 05 05 1 +06 06 06 1 +07 07 07 1 +08 08 08 1 +09 09 09 1 +0A 0A 0A 1 +0B 0B 0B 1 +0C 0C 0C 1 +0D 0D 0D 1 +0E 0E 0E 1 +0F 0F 0F 1 +10 10 10 1 +11 11 11 1 +12 12 12 1 +13 13 13 1 +14 14 14 1 +15 15 15 1 +16 16 16 1 +17 17 17 1 +18 18 18 1 +19 19 19 1 +1A 1A 1A 1 +1B 1B 1B 1 +1C 1C 1C 1 +1D 1D 1D 1 +1E 1E 1E 1 +1F 1F 1F 1 + 1 +21 21 21 1 +22 22 22 1 +23 23 23 1 +24 24 24 1 +25 25 25 1 +26 26 26 1 +27 27 27 1 +28 28 28 1 +29 29 29 1 +2A 2A 2A 1 +2B 2B 2B 1 +2C 2C 2C 1 +2D 2D 2D 1 +2E 2E 2E 1 +2F 2F 2F 1 +30 30 30 1 +31 31 31 1 +32 32 32 1 +33 33 33 1 +34 34 34 1 +35 35 35 1 +36 36 36 1 +37 37 37 1 +38 38 38 1 +39 39 39 1 +3A 3A 3A 1 +3B 3B 3B 1 +3C 3C 3C 1 +3D 3D 3D 1 +3E 3E 3E 1 +3F 3F 3F 1 +40 40 40 1 +41 41 41 1 +42 42 42 1 +43 43 43 1 +44 44 44 1 +45 45 45 1 +46 46 46 1 +47 47 47 1 +48 48 48 1 +49 49 49 1 +4A 4A 4A 1 +4B 4B 4B 1 +4C 4C 4C 1 +4D 4D 4D 1 +4E 4E 4E 1 +4F 4F 4F 1 +50 50 50 1 +51 51 51 1 +52 52 52 1 +53 53 53 1 +54 54 54 1 +55 55 55 1 +56 56 56 1 +57 57 57 1 +58 58 58 1 +59 59 59 1 +5A 5A 5A 1 +5B 5B 5B 1 +5C 5C 5C 1 +5D 5D 5D 1 +5E 5E 5E 1 +5F 5F 5F 1 +60 60 60 1 +61 61 61 1 +62 62 62 1 +63 63 63 1 +64 64 64 1 +65 65 65 1 +66 66 66 1 +67 67 67 1 +68 68 68 1 +69 69 69 1 +6A 6A 6A 1 +6B 6B 6B 1 +6C 6C 6C 1 +6D 6D 6D 1 +6E 6E 6E 1 +6F 6F 6F 1 +70 70 70 1 +71 71 71 1 +72 72 72 1 +73 73 73 1 +74 74 74 1 +75 75 75 1 +76 76 76 1 +77 77 77 1 +78 78 78 1 +79 79 79 1 +7A 7A 7A 1 +7B 7B 7B 1 +7C 7C 7C 1 +7D 7D 7D 1 +7E 7E 7E 1 +7F 7F 7F 1 +80 E282AC 80 1 +81 3F 3F 0 +82 E2809A 82 1 +83 C692 83 1 +84 E2809E 84 1 +85 E280A6 85 1 +86 E280A0 86 1 +87 E280A1 87 1 +88 CB86 88 1 +89 E280B0 89 1 +8A C5A0 8A 1 +8B E280B9 8B 1 +8C C592 8C 1 +8D 3F 3F 0 +8E C5BD 8E 1 +8F 3F 3F 0 +90 3F 3F 0 +91 E28098 91 1 +92 E28099 92 1 +93 E2809C 93 1 +94 E2809D 94 1 +95 E280A2 95 1 +96 E28093 96 1 +97 E28094 97 1 +98 CB9C 98 1 +99 E284A2 99 1 +9A C5A1 9A 1 +9B E280BA 9B 1 +9C C593 9C 1 +9D 3F 3F 0 +9E C5BE 9E 1 +9F C5B8 9F 1 +A0 C2A0 A0 1 +A1 C2A1 A1 1 +A2 C2A2 A2 1 +A3 C2A3 A3 1 +A4 C2A4 A4 1 +A5 C2A5 A5 1 +A6 C2A6 A6 1 +A7 C2A7 A7 1 +A8 C2A8 A8 1 +A9 C2A9 A9 1 +AA C2AA AA 1 +AB C2AB AB 1 +AC C2AC AC 1 +AD C2AD AD 1 +AE C2AE AE 1 +AF C2AF AF 1 +B0 C2B0 B0 1 +B1 C2B1 B1 1 +B2 C2B2 B2 1 +B3 C2B3 B3 1 +B4 C2B4 B4 1 +B5 C2B5 B5 1 +B6 C2B6 B6 1 +B7 C2B7 B7 1 +B8 C2B8 B8 1 +B9 C2B9 B9 1 +BA C2BA BA 1 +BB C2BB BB 1 +BC C2BC BC 1 +BD C2BD BD 1 +BE C2BE BE 1 +BF C2BF BF 1 +C0 C380 C0 1 +C1 C381 C1 1 +C2 C382 C2 1 +C3 C383 C3 1 +C4 C384 C4 1 +C5 C385 C5 1 +C6 C386 C6 1 +C7 C387 C7 1 +C8 C388 C8 1 +C9 C389 C9 1 +CA C38A CA 1 +CB C38B CB 1 +CC C38C CC 1 +CD C38D CD 1 +CE C38E CE 1 +CF C38F CF 1 +D0 C390 D0 1 +D1 C391 D1 1 +D2 C392 D2 1 +D3 C393 D3 1 +D4 C394 D4 1 +D5 C395 D5 1 +D6 C396 D6 1 +D7 C397 D7 1 +D8 C398 D8 1 +D9 C399 D9 1 +DA C39A DA 1 +DB C39B DB 1 +DC C39C DC 1 +DD C39D DD 1 +DE C39E DE 1 +DF C39F DF 1 +E0 C3A0 E0 1 +E1 C3A1 E1 1 +E2 C3A2 E2 1 +E3 C3A3 E3 1 +E4 C3A4 E4 1 +E5 C3A5 E5 1 +E6 C3A6 E6 1 +E7 C3A7 E7 1 +E8 C3A8 E8 1 +E9 C3A9 E9 1 +EA C3AA EA 1 +EB C3AB EB 1 +EC C3AC EC 1 +ED C3AD ED 1 +EE C3AE EE 1 +EF C3AF EF 1 +F0 C3B0 F0 1 +F1 C3B1 F1 1 +F2 C3B2 F2 1 +F3 C3B3 F3 1 +F4 C3B4 F4 1 +F5 C3B5 F5 1 +F6 C3B6 F6 1 +F7 C3B7 F7 1 +F8 C3B8 F8 1 +F9 C3B9 F9 1 +FA C3BA FA 1 +FB C3BB FB 1 +FC C3BC FC 1 +FD C3BD FD 1 +FE C3BE FE 1 +FF C3BF FF 1 +DROP TABLE t1; diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result index 7209c86bb31..ed59de87395 100644 --- a/mysql-test/r/ctype_recoding.result +++ b/mysql-test/r/ctype_recoding.result @@ -82,6 +82,13 @@ Field Type Null Key Default Extra SET CHARACTER SET koi8r; DROP TABLE ÔÁÂÌÉÃÁ; SET CHARACTER SET default; +SET NAMES UTF8; +CREATE TABLE t1 (t text) DEFAULT CHARSET UTF8; +INSERT INTO t1 (t) VALUES ('x'); +SELECT 1 FROM t1 WHERE CONCAT(_latin1'x') = t; +1 +1 +DROP TABLE t1; SET CHARACTER SET koi8r; CREATE DATABASE ÔÅÓÔ; USE ÔÅÓÔ; diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index fba1d9f47e3..b73953823ca 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -331,7 +331,7 @@ explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority makedate(1997,1) AS `makedate(1997,1)`,addtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,subtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,timediff(_latin1'01.01.97 11:59:59.000001 PM',_latin1'31.12.95 11:59:59.000002 PM') AS `timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM")`,cast(str_to_date(_latin1'15-01-2001 12:59:59',_latin1'%d-%m-%Y %H:%i:%S') as time) AS `cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME)`,maketime(23,11,12) AS `maketime(23,11,12)`,microsecond(_latin1'1997-12-31 23:59:59.000001') AS `microsecond("1997-12-31 23:59:59.000001")` +Note 1003 select makedate(1997,1) AS `makedate(1997,1)`,addtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,subtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,timediff(_latin1'01.01.97 11:59:59.000001 PM',_latin1'31.12.95 11:59:59.000002 PM') AS `timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM")`,cast(str_to_date(_latin1'15-01-2001 12:59:59',_latin1'%d-%m-%Y %H:%i:%S') as time) AS `cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME)`,maketime(23,11,12) AS `maketime(23,11,12)`,microsecond(_latin1'1997-12-31 23:59:59.000001') AS `microsecond("1997-12-31 23:59:59.000001")` create table t1 (d date); insert into t1 values ('2004-07-14'),('2005-07-14'); select date_format(d,"%d") from t1 order by 1; diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 81e2cd03d1a..dd4c32403b5 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -94,11 +94,13 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY 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 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 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 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 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 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 ALL NULL NULL NULL NULL NULL drop table t1; CREATE TABLE `t1` ( `N` int(11) unsigned NOT NULL default '0', diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index 02e1ace71e1..d66dec741bd 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -44,3 +44,12 @@ explain select count(*) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away drop table t1; +set names koi8r; +create table ÔÁÂ (ËÏÌ0 int, ËÏÌ1 int, key ÉÎÄ0 (ËÏÌ0), key ÉÎÄ01 (ËÏÌ0,ËÏÌ1)); +insert into ÔÁÂ (ËÏÌ0) values (1); +insert into ÔÁÂ (ËÏÌ0) values (2); +explain select ËÏÌ0 from ÔÁÂ where ËÏÌ0=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE ÔÁÂ ref ÉÎÄ0,ÉÎÄ01 ÉÎÄ0 5 const 1 Using where; Using index +drop table ÔÁÂ; +set names latin1; diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 02850e4d902..3106602e718 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -17,7 +17,7 @@ explain extended select * from t1 where MATCH(a,b) AGAINST ("collections"); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 fulltext a a 0 1 Using where Warnings: -Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'collections')) +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'collections')) select * from t1 where MATCH(a,b) AGAINST ("indexes"); a b Full-text indexes are called collections @@ -78,7 +78,7 @@ explain extended select * from t1 where MATCH(a,b) AGAINST("support -collections id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 fulltext a a 0 1 Using where Warnings: -Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'support -collections' in boolean mode)) +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'support -collections' in boolean mode)) select * from t1 where MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE); a b MySQL has now support for full-text search @@ -142,6 +142,8 @@ a b MySQL has now support for full-text search select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE); a b +select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); +a b select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE); a b select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE); diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index 61aa1c0a497..ef03ec71c69 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -11,7 +11,7 @@ explain extended select uncompress(compress(@test_compress_string)); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))` +Note 1003 select sql_no_cache uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))` select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string); uncompressed_length(compress(@test_compress_string))=length(@test_compress_string) 1 @@ -19,7 +19,7 @@ explain extended select uncompressed_length(compress(@test_compress_string))=len id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache (uncompressed_length(compress((@test_compress_string))) = length((@test_compress_string))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)` +Note 1003 select sql_no_cache (uncompressed_length(compress((@test_compress_string))) = length((@test_compress_string))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)` select uncompressed_length(compress(@test_compress_string)); uncompressed_length(compress(@test_compress_string)) 117 diff --git a/mysql-test/r/func_crypt.result b/mysql-test/r/func_crypt.result index 70ebcf216fb..2ee3e770a2e 100644 --- a/mysql-test/r/func_crypt.result +++ b/mysql-test/r/func_crypt.result @@ -91,4 +91,4 @@ explain extended select password('idkfa '), old_password('idkfa'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority password(_latin1'idkfa ') AS `password('idkfa ')`,old_password(_latin1'idkfa') AS `old_password('idkfa')` +Note 1003 select password(_latin1'idkfa ') AS `password('idkfa ')`,old_password(_latin1'idkfa') AS `old_password('idkfa')` diff --git a/mysql-test/r/func_default.result b/mysql-test/r/func_default.result index fe3f5b9473a..2993d79a870 100644 --- a/mysql-test/r/func_default.result +++ b/mysql-test/r/func_default.result @@ -8,7 +8,7 @@ explain extended select default(str), default(strnull), default(intg), default(r id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 select high_priority default(test.t1.str) AS `default(str)`,default(test.t1.strnull) AS `default(strnull)`,default(test.t1.intg) AS `default(intg)`,default(test.t1.rel) AS `default(rel)` from test.t1 +Note 1003 select default(test.t1.str) AS `default(str)`,default(test.t1.strnull) AS `default(strnull)`,default(test.t1.intg) AS `default(intg)`,default(test.t1.rel) AS `default(rel)` from test.t1 select * from t1 where str <> default(str); str strnull intg rel 0 0 diff --git a/mysql-test/r/func_encrypt.result b/mysql-test/r/func_encrypt.result index abdfda0423f..d32e67fe7d5 100644 --- a/mysql-test/r/func_encrypt.result +++ b/mysql-test/r/func_encrypt.result @@ -138,4 +138,4 @@ explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_dec id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))` +Note 1003 select des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))` diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index dccd87e3d75..60a28e5018f 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -18,7 +18,7 @@ explain extended select grp,group_concat(c) from t1 group by grp; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort Warnings: -Note 1003 select high_priority test.t1.grp AS `grp`,group_concat(test.t1.c seperator ',') AS `group_concat(c)` from test.t1 group by test.t1.grp +Note 1003 select test.t1.grp AS `grp`,group_concat(test.t1.c seperator ',') AS `group_concat(c)` from test.t1 group by test.t1.grp select grp,group_concat(a,c) from t1 group by grp; grp group_concat(a,c) 1 1a @@ -93,7 +93,7 @@ explain extended select grp,group_concat(distinct c order by c desc) from t1 gro id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort Warnings: -Note 1003 select high_priority test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c desc)` from test.t1 group by test.t1.grp +Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c desc)` from test.t1 group by test.t1.grp select grp,group_concat(c order by c separator ",") from t1 group by grp; grp group_concat(c order by c separator ",") 1 a @@ -113,7 +113,7 @@ explain extended select grp,group_concat(distinct c order by c separator ",") fr id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort Warnings: -Note 1003 select high_priority test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c separator ",")` from test.t1 group by test.t1.grp +Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c separator ",")` from test.t1 group by test.t1.grp select grp,group_concat(distinct c order by c desc separator ",") from t1 group by grp; grp group_concat(distinct c order by c desc separator ",") 1 a @@ -301,3 +301,12 @@ a c grp 2 4 4 1 2 5 drop table t1,t2; +CREATE TABLE t1 ( a int ); +CREATE TABLE t2 ( a int ); +INSERT INTO t1 VALUES (1), (2); +INSERT INTO t2 VALUES (1), (2); +SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a; +GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) +1,2 +2,4 +DROP TABLE t1, t2; diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 9fc2eada827..8033e529c56 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -265,7 +265,7 @@ explain extended select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort Warnings: -Note 1003 select high_priority big_result test.t1.a AS `a`,count(test.t1.b) AS `count(b)`,sum(test.t1.b) AS `sum(b)`,avg(test.t1.b) AS `avg(b)`,std(test.t1.b) AS `std(b)`,min(test.t1.b) AS `min(b)`,max(test.t1.b) AS `max(b)`,bit_and(test.t1.b) AS `bit_and(b)`,bit_or(test.t1.b) AS `bit_or(b)`,bit_xor(test.t1.b) AS `bit_xor(b)` from test.t1 group by test.t1.a +Note 1003 select sql_big_result test.t1.a AS `a`,count(test.t1.b) AS `count(b)`,sum(test.t1.b) AS `sum(b)`,avg(test.t1.b) AS `avg(b)`,std(test.t1.b) AS `std(b)`,min(test.t1.b) AS `min(b)`,max(test.t1.b) AS `max(b)`,bit_and(test.t1.b) AS `bit_and(b)`,bit_or(test.t1.b) AS `bit_or(b)`,bit_xor(test.t1.b) AS `bit_xor(b)` from test.t1 group by test.t1.a drop table t1; create table t1 (col int); insert into t1 values (-1), (-2), (-3); diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result index 0a04585d77d..ce26a0bf30a 100644 --- a/mysql-test/r/func_if.result +++ b/mysql-test/r/func_if.result @@ -43,7 +43,7 @@ explain extended select if(u=1,st,binary st) s from t1 where st like "%a%" order id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where; Using filesort Warnings: -Note 1003 select high_priority if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) AS `s` from test.t1 where (test.t1.st like _latin1'%a%') order by if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) +Note 1003 select if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) AS `s` from test.t1 where (test.t1.st like _latin1'%a%') order by if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) select nullif(u=0, 'test') from t1; nullif(u=0, 'test') NULL @@ -57,7 +57,7 @@ explain extended select nullif(u=0, 'test') from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Warnings: -Note 1003 select high_priority nullif((test.t1.u = 0),_latin1'test') AS `nullif(u=0, 'test')` from test.t1 +Note 1003 select nullif((test.t1.u = 0),_latin1'test') AS `nullif(u=0, 'test')` from test.t1 drop table t1; select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test"); NULLIF(NULL,NULL) NULLIF(NULL,1) NULLIF(NULL,1.0) NULLIF(NULL,"test") diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 04b6fc038b0..f66b3dea94b 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -146,7 +146,7 @@ explain extended select * from t1 where 'a' in (a,b,c collate latin1_bin); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where Warnings: -Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 where (_latin1'a' in (test.t1.a,test.t1.b,(test.t1.c collate _latin1'latin1_bin'))) +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 where (_latin1'a' in (test.t1.a,test.t1.b,(test.t1.c collate _latin1'latin1_bin'))) drop table t1; select '1.0' in (1,2); '1.0' in (1,2) diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 9085849e582..12eef4aa881 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -5,7 +5,7 @@ explain extended select floor(5.5),floor(-5.5); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority floor(5.5) AS `floor(5.5)`,floor(-(5.5)) AS `floor(-5.5)` +Note 1003 select floor(5.5) AS `floor(5.5)`,floor(-(5.5)) AS `floor(-5.5)` select ceiling(5.5),ceiling(-5.5); ceiling(5.5) ceiling(-5.5) 6 -5 @@ -13,7 +13,7 @@ explain extended select ceiling(5.5),ceiling(-5.5); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority ceiling(5.5) AS `ceiling(5.5)`,ceiling(-(5.5)) AS `ceiling(-5.5)` +Note 1003 select ceiling(5.5) AS `ceiling(5.5)`,ceiling(-(5.5)) AS `ceiling(-5.5)` select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2), truncate(-52.64,1),truncate(-52.64,-1); truncate(52.64,1) truncate(52.64,2) truncate(52.64,-1) truncate(52.64,-2) truncate(-52.64,1) truncate(-52.64,-1) 52.6 52.64 50 0 -52.6 -50 @@ -21,7 +21,7 @@ explain extended select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),t id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority truncate(52.64,1) AS `truncate(52.64,1)`,truncate(52.64,2) AS `truncate(52.64,2)`,truncate(52.64,-(1)) AS `truncate(52.64,-1)`,truncate(52.64,-(2)) AS `truncate(52.64,-2)`,truncate(-(52.64),1) AS `truncate(-52.64,1)`,truncate(-(52.64),-(1)) AS `truncate(-52.64,-1)` +Note 1003 select truncate(52.64,1) AS `truncate(52.64,1)`,truncate(52.64,2) AS `truncate(52.64,2)`,truncate(52.64,-(1)) AS `truncate(52.64,-1)`,truncate(52.64,-(2)) AS `truncate(52.64,-2)`,truncate(-(52.64),1) AS `truncate(-52.64,1)`,truncate(-(52.64),-(1)) AS `truncate(-52.64,-1)` select round(5.5),round(-5.5); round(5.5) round(-5.5) 6 -6 @@ -29,7 +29,7 @@ explain extended select round(5.5),round(-5.5); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority round(5.5,0) AS `round(5.5)`,round(-(5.5),0) AS `round(-5.5)` +Note 1003 select round(5.5,0) AS `round(5.5)`,round(-(5.5),0) AS `round(-5.5)` select round(5.64,1),round(5.64,2),round(5.64,-1),round(5.64,-2); round(5.64,1) round(5.64,2) round(5.64,-1) round(5.64,-2) 5.6 5.64 10 0 @@ -40,7 +40,7 @@ explain extended select abs(-10), sign(-5), sign(5), sign(0); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)` +Note 1003 select abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)` select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2); log(exp(10)) exp(log(sqrt(10))*2) log(-1) log(NULL) log(1,1) log(3,9) log(-1,2) log(NULL,2) 10.000000 10.000000 NULL NULL NULL 2.000000 NULL NULL @@ -48,7 +48,7 @@ explain extended select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log( id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)` +Note 1003 select log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)` select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); ln(exp(10)) exp(ln(sqrt(10))*2) ln(-1) ln(0) ln(NULL) 10.000000 10.000000 NULL NULL NULL @@ -56,7 +56,7 @@ explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)` +Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)` select log2(8),log2(15),log2(-2),log2(0),log2(NULL); log2(8) log2(15) log2(-2) log2(0) log2(NULL) 3.000000 3.906891 NULL NULL NULL @@ -64,7 +64,7 @@ explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)` +Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)` select log10(100),log10(18),log10(-4),log10(0),log10(NULL); log10(100) log10(18) log10(-4) log10(0) log10(NULL) 2.000000 1.255273 NULL NULL NULL @@ -72,7 +72,7 @@ explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority log10(100) AS `log10(100)`,log10(18) AS `log10(18)`,log10(-(4)) AS `log10(-4)`,log10(0) AS `log10(0)`,log10(NULL) AS `log10(NULL)` +Note 1003 select log10(100) AS `log10(100)`,log10(18) AS `log10(18)`,log10(-(4)) AS `log10(-4)`,log10(0) AS `log10(0)`,log10(NULL) AS `log10(NULL)` select pow(10,log10(10)),power(2,4); pow(10,log10(10)) power(2,4) 10.000000 16.000000 @@ -80,7 +80,7 @@ explain extended select pow(10,log10(10)),power(2,4); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4)` +Note 1003 select pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4)` set @@rand_seed1=10000000,@@rand_seed2=1000000; select rand(999999),rand(); rand(999999) rand() @@ -89,7 +89,7 @@ explain extended select rand(999999),rand(); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache rand(999999) AS `rand(999999)`,rand() AS `rand()` +Note 1003 select sql_no_cache rand(999999) AS `rand(999999)`,rand() AS `rand()` select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(1),acos(0),atan(1); pi() sin(pi()/2) cos(pi()/2) abs(tan(pi())) cot(1) asin(1) acos(0) atan(1) 3.141593 1.000000 0.000000 0.000000 0.64209262 1.570796 1.570796 0.785398 @@ -97,7 +97,7 @@ explain extended select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin( id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority pi() AS `pi()`,sin((pi() / 2)) AS `sin(pi()/2)`,cos((pi() / 2)) AS `cos(pi()/2)`,abs(tan(pi())) AS `abs(tan(pi()))`,(1 / tan(1)) AS `cot(1)`,asin(1) AS `asin(1)`,acos(0) AS `acos(0)`,atan(1) AS `atan(1)` +Note 1003 select pi() AS `pi()`,sin((pi() / 2)) AS `sin(pi()/2)`,cos((pi() / 2)) AS `cos(pi()/2)`,abs(tan(pi())) AS `abs(tan(pi()))`,(1 / tan(1)) AS `cot(1)`,asin(1) AS `asin(1)`,acos(0) AS `acos(0)`,atan(1) AS `atan(1)` select degrees(pi()),radians(360); degrees(pi()) radians(360) 180 6.2831853071796 @@ -123,4 +123,4 @@ explain extended select degrees(pi()),radians(360); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)` +Note 1003 select degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)` diff --git a/mysql-test/r/func_op.result b/mysql-test/r/func_op.result index fb1e715ac3b..6cd975b0911 100644 --- a/mysql-test/r/func_op.result +++ b/mysql-test/r/func_op.result @@ -5,7 +5,7 @@ explain extended select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority (1 + 1) AS `1+1`,(1 - 1) AS `1-1`,(1 + (1 * 2)) AS `1+1*2`,(8 / 5) AS `8/5`,(8 % 5) AS `8%5`,(8 % 5) AS `mod(8,5)`,((8 % 5) | 0) AS `mod(8,5)|0`,(-((1 + 1)) * -(2)) AS `-(1+1)*-2` +Note 1003 select (1 + 1) AS `1+1`,(1 - 1) AS `1-1`,(1 + (1 * 2)) AS `1+1*2`,(8 / 5) AS `8/5`,(8 % 5) AS `8%5`,(8 % 5) AS `mod(8,5)`,((8 % 5) | 0) AS `mod(8,5)|0`,(-((1 + 1)) * -(2)) AS `-(1+1)*-2` select 1 | (1+1),5 & 3,bit_count(7) ; 1 | (1+1) 5 & 3 bit_count(7) 3 1 3 @@ -13,7 +13,7 @@ explain extended select 1 | (1+1),5 & 3,bit_count(7) ; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority (1 | (1 + 1)) AS `1 | (1+1)`,(5 & 3) AS `5 & 3`,bit_count(7) AS `bit_count(7)` +Note 1003 select (1 | (1 + 1)) AS `1 | (1+1)`,(5 & 3) AS `5 & 3`,bit_count(7) AS `bit_count(7)` select 1 << 32,1 << 63, 1 << 64, 4 >> 2, 4 >> 63, 1<< 63 >> 60; 1 << 32 1 << 63 1 << 64 4 >> 2 4 >> 63 1<< 63 >> 60 4294967296 9223372036854775808 0 1 0 8 diff --git a/mysql-test/r/func_regexp.result b/mysql-test/r/func_regexp.result index 323642cab8c..7f977e2782b 100644 --- a/mysql-test/r/func_regexp.result +++ b/mysql-test/r/func_regexp.result @@ -40,7 +40,7 @@ explain extended select * from t1 where xxx regexp('is a test of some long text id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 select high_priority test.t1.xxx AS `xxx` from test.t1 where (test.t1.xxx regexp _latin1'is a test of some long text to') +Note 1003 select test.t1.xxx AS `xxx` from test.t1 where (test.t1.xxx regexp _latin1'is a test of some long text to') select * from t1 where xxx regexp('is a test of some long text to '); xxx this is a test of some long text to see what happens diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result index b101c18f505..4918617f85f 100644 --- a/mysql-test/r/func_set.result +++ b/mysql-test/r/func_set.result @@ -5,7 +5,7 @@ explain extended select INTERVAL(55,10,20,30,40,50,60,70,80,90,100),interval(3,1 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority interval((55,10,20,30,40,50,60,70,80,90,100)) AS `INTERVAL(55,10,20,30,40,50,60,70,80,90,100)`,interval((3,1,(1 + 1),(((1 + 1) + 1) + 1))) AS `interval(3,1,1+1,1+1+1+1)`,field(_latin1'IBM',_latin1'NCA',_latin1'ICL',_latin1'SUN',_latin1'IBM',_latin1'DIGITAL') AS `field("IBM","NCA","ICL","SUN","IBM","DIGITAL")`,field(_latin1'A',_latin1'B',_latin1'C') AS `field("A","B","C")`,elt(2,_latin1'ONE',_latin1'TWO',_latin1'THREE') AS `elt(2,"ONE","TWO","THREE")`,interval((0,1,2,3,4)) AS `interval(0,1,2,3,4)`,(elt(1,1,2,3) | 0) AS `elt(1,1,2,3)|0`,(elt(1,1.1,1.2,1.3) + 0) AS `elt(1,1.1,1.2,1.3)+0` +Note 1003 select interval((55,10,20,30,40,50,60,70,80,90,100)) AS `INTERVAL(55,10,20,30,40,50,60,70,80,90,100)`,interval((3,1,(1 + 1),(((1 + 1) + 1) + 1))) AS `interval(3,1,1+1,1+1+1+1)`,field(_latin1'IBM',_latin1'NCA',_latin1'ICL',_latin1'SUN',_latin1'IBM',_latin1'DIGITAL') AS `field("IBM","NCA","ICL","SUN","IBM","DIGITAL")`,field(_latin1'A',_latin1'B',_latin1'C') AS `field("A","B","C")`,elt(2,_latin1'ONE',_latin1'TWO',_latin1'THREE') AS `elt(2,"ONE","TWO","THREE")`,interval((0,1,2,3,4)) AS `interval(0,1,2,3,4)`,(elt(1,1,2,3) | 0) AS `elt(1,1,2,3)|0`,(elt(1,1.1,1.2,1.3) + 0) AS `elt(1,1.1,1.2,1.3)+0` SELECT INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56); INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56) 1 diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 216e2ed26f2..569b4da0f85 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -305,6 +305,15 @@ i ELT(j, '345', '34') 1 345 2 34 DROP TABLE t1; +create table t1(a char(4)); +insert into t1 values ('one'),(NULL),('two'),('four'); +select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1; +a quote(a) isnull(quote(a)) quote(a) is null ifnull(quote(a), 'n') +one 'one' 0 0 'one' +NULL NULL 1 1 n +two 'two' 0 0 'two' +four 'four' 0 0 'four' +drop table t1; select 1=_latin1'1'; 1=_latin1'1' 1 @@ -622,7 +631,7 @@ explain extended select md5('hello'), sha('abc'), sha1('abc'), soundex(''), 'moo id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority md5(_latin1'hello') AS `md5('hello')`,sha(_latin1'abc') AS `sha('abc')`,sha(_latin1'abc') AS `sha1('abc')`,soundex(_latin1'') AS `soundex('')`,(soundex(_latin1'mood') = soundex(_latin1'mud')) AS `'mood' sounds like 'mud'`,aes_decrypt(aes_encrypt(_latin1'abc',_latin1'1'),_latin1'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')`,concat(_latin1'*',repeat(_latin1' ',5),_latin1'*') AS `concat('*',space(5),'*')`,reverse(_latin1'abc') AS `reverse('abc')`,rpad(_latin1'a',4,_latin1'1') AS `rpad('a',4,'1')`,lpad(_latin1'a',4,_latin1'1') AS `lpad('a',4,'1')`,concat_ws(_latin1',',_latin1'',NULL,_latin1'a') AS `concat_ws(',','',NULL,'a')`,make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a',_latin2'b',_latin2'c')`,elt(2,1) AS `elt(2,1)`,locate(_latin1'a',_latin1'b',2) AS `locate("a","b",2)`,format(130,10) AS `format(130,10)`,char(0) AS `char(0)`,conv(130,16,10) AS `conv(130,16,10)`,hex(130) AS `hex(130)`,(_latin1'HE' collate _latin1'BINARY') AS `binary 'HE'`,export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y',_latin2'n',_latin2' ')`,field((_latin1'b' collate _latin1'latin1_bin'),_latin1'A',_latin1'B') AS `FIELD('b' COLLATE latin1_bin,'A','B')`,find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B',_latin1'a,b,c,d')`,collation(conv(130,16,10)) AS `collation(conv(130,16,10))`,coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))`,length(_latin1'\n \r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,concat(_latin1'monty',_latin1' was here ',_latin1'again') AS `concat('monty',' was here ','again')`,length(_latin1'hello') AS `length('hello')`,char(ascii(_latin1'h')) AS `char(ascii('h'))`,ord(_latin1'h') AS `ord('h')`,quote((1 / 0)) AS `quote(1/0)`,crc32(_latin1'123') AS `crc32("123")`,replace(_latin1'aaaa',_latin1'a',_latin1'b') AS `replace('aaaa','a','b')`,insert(_latin1'txs',2,1,_latin1'hi') AS `insert('txs',2,1,'hi')`,left(_latin2'a',1) AS `left(_latin2'a',1)`,right(_latin2'a',1) AS `right(_latin2'a',1)`,lcase(_latin2'a') AS `lcase(_latin2'a')`,ucase(_latin2'a') AS `ucase(_latin2'a')`,substr(_latin1'abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`,substr_index(_latin1'1abcd;2abcd;3abcd;4abcd',_latin1';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)`,trim(_latin2' a ') AS `trim(_latin2' a ')`,ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`,rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`,decode(encode(repeat(_latin1'a',100000))) AS `decode(encode(repeat("a",100000),"monty"),"monty")` +Note 1003 select md5(_latin1'hello') AS `md5('hello')`,sha(_latin1'abc') AS `sha('abc')`,sha(_latin1'abc') AS `sha1('abc')`,soundex(_latin1'') AS `soundex('')`,(soundex(_latin1'mood') = soundex(_latin1'mud')) AS `'mood' sounds like 'mud'`,aes_decrypt(aes_encrypt(_latin1'abc',_latin1'1'),_latin1'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')`,concat(_latin1'*',repeat(_latin1' ',5),_latin1'*') AS `concat('*',space(5),'*')`,reverse(_latin1'abc') AS `reverse('abc')`,rpad(_latin1'a',4,_latin1'1') AS `rpad('a',4,'1')`,lpad(_latin1'a',4,_latin1'1') AS `lpad('a',4,'1')`,concat_ws(_latin1',',_latin1'',NULL,_latin1'a') AS `concat_ws(',','',NULL,'a')`,make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a',_latin2'b',_latin2'c')`,elt(2,1) AS `elt(2,1)`,locate(_latin1'a',_latin1'b',2) AS `locate("a","b",2)`,format(130,10) AS `format(130,10)`,char(0) AS `char(0)`,conv(130,16,10) AS `conv(130,16,10)`,hex(130) AS `hex(130)`,(_latin1'HE' collate _latin1'BINARY') AS `binary 'HE'`,export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y',_latin2'n',_latin2' ')`,field((_latin1'b' collate _latin1'latin1_bin'),_latin1'A',_latin1'B') AS `FIELD('b' COLLATE latin1_bin,'A','B')`,find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B',_latin1'a,b,c,d')`,collation(conv(130,16,10)) AS `collation(conv(130,16,10))`,coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))`,length(_latin1'\n \r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,concat(_latin1'monty',_latin1' was here ',_latin1'again') AS `concat('monty',' was here ','again')`,length(_latin1'hello') AS `length('hello')`,char(ascii(_latin1'h')) AS `char(ascii('h'))`,ord(_latin1'h') AS `ord('h')`,quote((1 / 0)) AS `quote(1/0)`,crc32(_latin1'123') AS `crc32("123")`,replace(_latin1'aaaa',_latin1'a',_latin1'b') AS `replace('aaaa','a','b')`,insert(_latin1'txs',2,1,_latin1'hi') AS `insert('txs',2,1,'hi')`,left(_latin2'a',1) AS `left(_latin2'a',1)`,right(_latin2'a',1) AS `right(_latin2'a',1)`,lcase(_latin2'a') AS `lcase(_latin2'a')`,ucase(_latin2'a') AS `ucase(_latin2'a')`,substr(_latin1'abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`,substr_index(_latin1'1abcd;2abcd;3abcd;4abcd',_latin1';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)`,trim(_latin2' a ') AS `trim(_latin2' a ')`,ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`,rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`,decode(encode(repeat(_latin1'a',100000))) AS `decode(encode(repeat("a",100000),"monty"),"monty")` SELECT lpad(12345, 5, "#"); lpad(12345, 5, "#") 12345 diff --git a/mysql-test/r/func_system.result b/mysql-test/r/func_system.result index 338902e3f3a..671132428c5 100644 --- a/mysql-test/r/func_system.result +++ b/mysql-test/r/func_system.result @@ -41,7 +41,7 @@ explain extended select database(), user(); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache database() AS `database()`,user() AS `user()` +Note 1003 select sql_no_cache database() AS `database()`,user() AS `user()` create table t1 (version char(40)) select database(), user(), version() as 'version'; show create table t1; Table Create Table diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result index 3a945c0826f..c3fe1de15db 100644 --- a/mysql-test/r/func_test.result +++ b/mysql-test/r/func_test.result @@ -48,7 +48,7 @@ explain extended select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority (3 ^ 11) AS `3 ^ 11`,(1 ^ 1) AS `1 ^ 1`,(1 ^ 0) AS `1 ^ 0`,(1 ^ NULL) AS `1 ^ NULL`,(NULL ^ 1) AS `NULL ^ 1` +Note 1003 select (3 ^ 11) AS `3 ^ 11`,(1 ^ 1) AS `1 ^ 1`,(1 ^ 0) AS `1 ^ 0`,(1 ^ NULL) AS `1 ^ NULL`,(NULL ^ 1) AS `NULL ^ 1` select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL; 1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL 0 1 1 0 NULL NULL NULL @@ -62,7 +62,7 @@ explain extended select 10 % 7, 10 mod 7, 10 div 3; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority (10 % 7) AS `10 % 7`,(10 % 7) AS `10 mod 7`,(10 DIV 3) AS `10 div 3` +Note 1003 select (10 % 7) AS `10 % 7`,(10 % 7) AS `10 mod 7`,(10 DIV 3) AS `10 div 3` select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; (1 << 64)-1 ((1 << 64)-1) DIV 1 ((1 << 64)-1) DIV 2 18446744073709551615 18446744073709551615 9223372036854775807 @@ -70,7 +70,7 @@ explain extended select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority ((1 << 64) - 1) AS `(1 << 64)-1`,(((1 << 64) - 1) DIV 1) AS `((1 << 64)-1) DIV 1`,(((1 << 64) - 1) DIV 2) AS `((1 << 64)-1) DIV 2` +Note 1003 select ((1 << 64) - 1) AS `(1 << 64)-1`,(((1 << 64) - 1) DIV 1) AS `((1 << 64)-1) DIV 1`,(((1 << 64) - 1) DIV 2) AS `((1 << 64)-1) DIV 2` create table t1 (a int); insert t1 values (1); select * from t1 where 1 xor 1; @@ -79,7 +79,7 @@ explain extended select * from t1 where 1 xor 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select high_priority test.t1.a AS `a` from test.t1 where (1 xor 1) +Note 1003 select test.t1.a AS `a` from test.t1 where (1 xor 1) select - a from t1; - a -1 @@ -87,7 +87,7 @@ explain extended select - a from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 select high_priority -(test.t1.a) AS `- a` from test.t1 +Note 1003 select -(test.t1.a) AS `- a` from test.t1 drop table t1; select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; 5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1 @@ -108,7 +108,7 @@ explain extended select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority (_koi8r'a' = (_koi8r'A' collate _latin1'koi8r_general_ci')) AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci` +Note 1003 select (_koi8r'a' = (_koi8r'A' collate _latin1'koi8r_general_ci')) AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci` select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin; _koi8r'a' = _koi8r'A' COLLATE koi8r_bin 0 diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 6a705f8b5cf..e73f300bb50 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -641,7 +641,7 @@ explain extended select period_add("9602",-12),period_diff(199505,"9404"),from_d id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache period_add(_latin1'9602',-(12)) AS `period_add("9602",-12)`,period_diff(199505,_latin1'9404') AS `period_diff(199505,"9404")`,from_days(to_days(_latin1'960101')) AS `from_days(to_days("960101"))`,dayofmonth(_latin1'1997-01-02') AS `dayofmonth("1997-01-02")`,month(_latin1'1997-01-02') AS `month("1997-01-02")`,monthname(_latin1'1972-03-04') AS `monthname("1972-03-04")`,dayofyear(_latin1'0000-00-00') AS `dayofyear("0000-00-00")`,hour(_latin1'1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute(_latin1'23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week(_latin1'1998-03-03',0) AS `WEEK("1998-03-03")`,yearweek(_latin1'2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year(_latin1'98-02-03') AS `year("98-02-03")`,(weekday(to_days(curdate())) - weekday(to_days(now()))) AS `weekday(curdate())-weekday(now())`,dayname(to_days(_latin1'1962-03-03')) AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec(_latin1'0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format(_latin1'1997-01-02 03:04:05',_latin1'%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp(_latin1'1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,(_latin1'1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,(_latin1'1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from _latin1'1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)` +Note 1003 select sql_no_cache period_add(_latin1'9602',-(12)) AS `period_add("9602",-12)`,period_diff(199505,_latin1'9404') AS `period_diff(199505,"9404")`,from_days(to_days(_latin1'960101')) AS `from_days(to_days("960101"))`,dayofmonth(_latin1'1997-01-02') AS `dayofmonth("1997-01-02")`,month(_latin1'1997-01-02') AS `month("1997-01-02")`,monthname(_latin1'1972-03-04') AS `monthname("1972-03-04")`,dayofyear(_latin1'0000-00-00') AS `dayofyear("0000-00-00")`,hour(_latin1'1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute(_latin1'23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week(_latin1'1998-03-03',0) AS `WEEK("1998-03-03")`,yearweek(_latin1'2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year(_latin1'98-02-03') AS `year("98-02-03")`,(weekday(to_days(curdate())) - weekday(to_days(now()))) AS `weekday(curdate())-weekday(now())`,dayname(to_days(_latin1'1962-03-03')) AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec(_latin1'0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format(_latin1'1997-01-02 03:04:05',_latin1'%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp(_latin1'1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,(_latin1'1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,(_latin1'1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from _latin1'1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)` SET @TMP=NOW(); CREATE TABLE t1 (d DATETIME); INSERT INTO t1 VALUES (NOW()); diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index be33c05c578..c2fd7855c85 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -228,7 +228,7 @@ explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelo id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21 Warnings: -Note 1003 select high_priority dimension(test.gis_geometry.g) AS `Dimension(g)`,geometrytype(test.gis_geometry.g) AS `GeometryType(g)`,isempty(test.gis_geometry.g) AS `IsEmpty(g)`,astext(envelope(test.gis_geometry.g)) AS `AsText(Envelope(g))` from test.gis_geometry +Note 1003 select dimension(test.gis_geometry.g) AS `Dimension(g)`,geometrytype(test.gis_geometry.g) AS `GeometryType(g)`,isempty(test.gis_geometry.g) AS `IsEmpty(g)`,astext(envelope(test.gis_geometry.g)) AS `AsText(Envelope(g))` from test.gis_geometry SELECT fid, X(g) FROM gis_point; fid X(g) 101 10 @@ -245,7 +245,7 @@ explain extended select X(g),Y(g) FROM gis_point; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE gis_point ALL NULL NULL NULL NULL 4 Warnings: -Note 1003 select high_priority x(test.gis_point.g) AS `X(g)`,y(test.gis_point.g) AS `Y(g)` from test.gis_point +Note 1003 select x(test.gis_point.g) AS `X(g)`,y(test.gis_point.g) AS `Y(g)` from test.gis_point SELECT fid, AsText(StartPoint(g)) FROM gis_line; fid AsText(StartPoint(g)) 105 POINT(0 0) @@ -280,7 +280,7 @@ explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),Num id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE gis_line ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select high_priority astext(startpoint(test.gis_line.g)) AS `AsText(StartPoint(g))`,astext(endpoint(test.gis_line.g)) AS `AsText(EndPoint(g))`,glength(test.gis_line.g) AS `GLength(g)`,numpoints(test.gis_line.g) AS `NumPoints(g)`,astext(pointn(test.gis_line.g,2)) AS `AsText(PointN(g, 2))`,isclosed(test.gis_line.g) AS `IsClosed(g)` from test.gis_line +Note 1003 select astext(startpoint(test.gis_line.g)) AS `AsText(StartPoint(g))`,astext(endpoint(test.gis_line.g)) AS `AsText(EndPoint(g))`,glength(test.gis_line.g) AS `GLength(g)`,numpoints(test.gis_line.g) AS `NumPoints(g)`,astext(pointn(test.gis_line.g,2)) AS `AsText(PointN(g, 2))`,isclosed(test.gis_line.g) AS `IsClosed(g)` from test.gis_line SELECT fid, AsText(Centroid(g)) FROM gis_polygon; fid AsText(Centroid(g)) 108 POINT(15 15) @@ -310,7 +310,7 @@ explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumI id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select high_priority astext(centroid(test.gis_polygon.g)) AS `AsText(Centroid(g))`,area(test.gis_polygon.g) AS `Area(g)`,astext(exteriorring(test.gis_polygon.g)) AS `AsText(ExteriorRing(g))`,numinteriorrings(test.gis_polygon.g) AS `NumInteriorRings(g)`,astext(interiorringn(test.gis_polygon.g,1)) AS `AsText(InteriorRingN(g, 1))` from test.gis_polygon +Note 1003 select astext(centroid(test.gis_polygon.g)) AS `AsText(Centroid(g))`,area(test.gis_polygon.g) AS `Area(g)`,astext(exteriorring(test.gis_polygon.g)) AS `AsText(ExteriorRing(g))`,numinteriorrings(test.gis_polygon.g) AS `NumInteriorRings(g)`,astext(interiorringn(test.gis_polygon.g,1)) AS `AsText(InteriorRingN(g, 1))` from test.gis_polygon SELECT fid, IsClosed(g) FROM gis_multi_line; fid IsClosed(g) 114 0 @@ -349,7 +349,7 @@ explain extended SELECT fid, NumGeometries(g) from gis_multi_point; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select high_priority test.gis_multi_point.fid AS `fid`,numgeometries(test.gis_multi_point.g) AS `NumGeometries(g)` from test.gis_multi_point +Note 1003 select test.gis_multi_point.fid AS `fid`,numgeometries(test.gis_multi_point.g) AS `NumGeometries(g)` from test.gis_multi_point SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; fid AsText(GeometryN(g, 2)) 111 POINT(10 10) @@ -377,7 +377,7 @@ explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select high_priority test.gis_multi_point.fid AS `fid`,astext(geometryn(test.gis_multi_point.g,2)) AS `AsText(GeometryN(g, 2))` from test.gis_multi_point +Note 1003 select test.gis_multi_point.fid AS `fid`,astext(geometryn(test.gis_multi_point.g,2)) AS `AsText(GeometryN(g, 2))` from test.gis_multi_point SELECT g1.fid as first, g2.fid as second, Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, @@ -397,7 +397,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE g1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort 1 SIMPLE g2 ALL NULL NULL NULL NULL 2 Warnings: -Note 1003 select high_priority test.g1.fid AS `first`,test.g2.fid AS `second`,within(test.g1.g,test.g2.g) AS `w`,contains(test.g1.g,test.g2.g) AS `c`,overlaps(test.g1.g,test.g2.g) AS `o`,equals(test.g1.g,test.g2.g) AS `e`,disjoint(test.g1.g,test.g2.g) AS `d`,touches(test.g1.g,test.g2.g) AS `t`,intersects(test.g1.g,test.g2.g) AS `i`,crosses(test.g1.g,test.g2.g) AS `r` from test.gis_geometrycollection g1 join test.gis_geometrycollection g2 order by test.g1.fid,test.g2.fid +Note 1003 select test.g1.fid AS `first`,test.g2.fid AS `second`,within(test.g1.g,test.g2.g) AS `w`,contains(test.g1.g,test.g2.g) AS `c`,overlaps(test.g1.g,test.g2.g) AS `o`,equals(test.g1.g,test.g2.g) AS `e`,disjoint(test.g1.g,test.g2.g) AS `d`,touches(test.g1.g,test.g2.g) AS `t`,intersects(test.g1.g,test.g2.g) AS `i`,crosses(test.g1.g,test.g2.g) AS `r` from test.gis_geometrycollection g1 join test.gis_geometrycollection g2 order by test.g1.fid,test.g2.fid DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; CREATE TABLE t1 ( gp point, @@ -439,12 +439,12 @@ explain extended SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority astext(geometryfromwkb(aswkb(geometryfromtext(_latin1'POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))))` +Note 1003 select astext(geometryfromwkb(aswkb(geometryfromtext(_latin1'POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))))` explain extended SELECT AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)')))); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority astext(geometryfromwkb(aswkb(geometryfromtext(_latin1'POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)'))))` +Note 1003 select astext(geometryfromwkb(aswkb(geometryfromtext(_latin1'POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)'))))` SELECT SRID(GeomFromText('LineString(1 1,2 2)',101)); SRID(GeomFromText('LineString(1 1,2 2)',101)) 101 @@ -452,12 +452,12 @@ explain extended SELECT SRID(GeomFromText('LineString(1 1,2 2)',101)); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority srid(geometryfromtext(_latin1'LineString(1 1,2 2)',101)) AS `SRID(GeomFromText('LineString(1 1,2 2)',101))` +Note 1003 select srid(geometryfromtext(_latin1'LineString(1 1,2 2)',101)) AS `SRID(GeomFromText('LineString(1 1,2 2)',101))` explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimple(Point(3, 6)); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority issimple(multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,issimple(point(3,6)) AS `issimple(Point(3, 6))` +Note 1003 select issimple(multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,issimple(point(3,6)) AS `issimple(Point(3, 6))` create table t1 (a geometry not null); insert into t1 values (GeomFromText('Point(1 2)')); insert into t1 values ('Garbage'); diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 8b3948e093f..c47530cdc46 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -204,3 +204,27 @@ show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19' drop user mysqltest_1@localhost; +SET NAMES koi8r; +CREATE DATABASE ÂÄ; +USE ÂÄ; +CREATE TABLE ÔÁÂ (ËÏÌ int); +GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT ON `ÂÄ`.* TO 'ÀÚÅÒ'@'localhost' +REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost; +GRANT SELECT ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost' +REVOKE SELECT ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost; +GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT (ËÏÌ) ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost' +REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost; +DROP DATABASE ÂÄ; +SET NAMES latin1; diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index bbe3326fd34..9af7304c167 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -288,7 +288,7 @@ explain extended select sql_big_result spid,sum(userid) from t1 group by spid de id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using filesort Warnings: -Note 1003 select high_priority big_result test.t1.spID AS `spid`,sum(test.t1.userID) AS `sum(userid)` from test.t1 group by test.t1.spID desc +Note 1003 select sql_big_result test.t1.spID AS `spid`,sum(test.t1.userID) AS `sum(userid)` from test.t1 group by test.t1.spID desc explain select sql_big_result spid,sum(userid) from t1 group by spid desc order by null; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using filesort diff --git a/mysql-test/r/handler.result b/mysql-test/r/handler.result index b25150919d6..fddad8dba51 100644 --- a/mysql-test/r/handler.result +++ b/mysql-test/r/handler.result @@ -193,3 +193,15 @@ Ok handler t close; use test; drop table t1; +create table t1 ( a int, b int, INDEX a (a) ); +insert into t1 values (1,2), (2,1); +handler t1 open; +handler t1 read a=(1) where b=2; +a b +1 2 +handler t1 read a=(1) where b=3; +a b +handler t1 read a=(1) where b=1; +a b +handler t1 close; +drop table t1; diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index 7c88776579b..010e86273a2 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -12,7 +12,7 @@ explain extended select count(a) as b from t1 where a=0 having b >=0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select high_priority count(test.t1.a) AS `b` from test.t1 where (test.t1.a = 0) having (count(test.t1.a) >= 0) +Note 1003 select count(test.t1.a) AS `b` from test.t1 where (test.t1.a = 0) having (count(test.t1.a) >= 0) drop table t1; CREATE TABLE t1 ( raw_id int(10) NOT NULL default '0', diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 3c36571a8c2..83d042cd279 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -467,7 +467,7 @@ ERROR 23000: Duplicate entry 'test2' for key 2 select * from t1; id ggid email passwd 1 this will work -4 test2 this will work +3 test2 this will work select * from t1 where id=1; id ggid email passwd 1 this will work @@ -1443,3 +1443,178 @@ drop table t1; create table t1 (a int) engine=innodb; create table t2 like t1; drop table t1,t2; +create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb; +create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create index id on t2 (id); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create index id2 on t2 (id); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + KEY `id2` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop index id2 on t2; +drop index id on t2; +Got one of the listed errors +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create unique index id on t2 (id,id2); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + KEY `t1_id_fk` (`id2`,`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + KEY `t1_id_fk` (`id2`,`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table t2 add index id_test (id), add index id_test2 (id,id2); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + KEY `id_test` (`id`), + KEY `id_test2` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; +ERROR HY000: Can't create table './test/t2.frm' (errno: 150) +create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) NOT NULL auto_increment, + `b` int(11) default NULL, + PRIMARY KEY (`a`), + UNIQUE KEY `b_2` (`b`), + KEY `b` (`b`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) NOT NULL auto_increment, + `b` int(11) default NULL, + PRIMARY KEY (`a`), + UNIQUE KEY `b` (`b`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`), + CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2, t1; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 24 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 0 +create table t1 (a int) engine=innodb; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 25 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 1 +begin; +delete from t1; +commit; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 26 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 1 +drop table t1; diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index 53867bf4546..303d7186015 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -60,12 +60,12 @@ explain extended SELECT *, VALUES(a) FROM t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Warnings: -Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c`,values(test.t1.a) AS `VALUES(a)` from test.t1 +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c`,values(test.t1.a) AS `VALUES(a)` from test.t1 explain extended select * from t1 where values(a); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 DROP TABLE t1; create table t1(a int primary key, b int); insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5); diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index cbd949d6e72..7391f4192bf 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -6,7 +6,7 @@ explain extended select null,\N,isnull(null),isnull(1/0),isnull(1/0 = null),ifnu id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority NULL AS `NULL`,NULL AS `NULL`,isnull(NULL) AS `isnull(null)`,isnull((1 / 0)) AS `isnull(1/0)`,isnull(((1 / 0) = NULL)) AS `isnull(1/0 = null)`,ifnull(NULL,1) AS `ifnull(null,1)`,ifnull(NULL,_latin1'TRUE') AS `ifnull(null,"TRUE")`,ifnull(_latin1'TRUE',_latin1'ERROR') AS `ifnull("TRUE","ERROR")`,isnull((1 / 0)) AS `1/0 is null`,(1 is not null) AS `1 is not null` +Note 1003 select NULL AS `NULL`,NULL AS `NULL`,isnull(NULL) AS `isnull(null)`,isnull((1 / 0)) AS `isnull(1/0)`,isnull(((1 / 0) = NULL)) AS `isnull(1/0 = null)`,ifnull(NULL,1) AS `ifnull(null,1)`,ifnull(NULL,_latin1'TRUE') AS `ifnull(null,"TRUE")`,ifnull(_latin1'TRUE',_latin1'ERROR') AS `ifnull("TRUE","ERROR")`,isnull((1 / 0)) AS `1/0 is null`,(1 is not null) AS `1 is not null` select 1 | NULL,1 & NULL,1+NULL,1-NULL; 1 | NULL 1 & NULL 1+NULL 1-NULL NULL NULL NULL NULL @@ -32,7 +32,7 @@ explain extended select 2 between null and 1,2 between 3 AND NULL,NULL between 1 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority (2 between NULL and 1) AS `2 between null and 1`,(2 between 3 and NULL) AS `2 between 3 AND NULL`,(NULL between 1 and 2) AS `NULL between 1 and 2`,(2 between NULL and 3) AS `2 between NULL and 3`,(2 between 1 and NULL) AS `2 between 1 AND null` +Note 1003 select (2 between NULL and 1) AS `2 between null and 1`,(2 between 3 and NULL) AS `2 between 3 AND NULL`,(NULL between 1 and 2) AS `NULL between 1 and 2`,(2 between NULL and 3) AS `2 between NULL and 3`,(2 between 1 and NULL) AS `2 between 1 AND null` SELECT NULL AND NULL, 1 AND NULL, NULL AND 1, NULL OR NULL, 0 OR NULL, NULL OR 0; NULL AND NULL 1 AND NULL NULL AND 1 NULL OR NULL 0 OR NULL NULL OR 0 NULL NULL NULL NULL NULL NULL @@ -49,7 +49,7 @@ explain extended select inet_ntoa(null),inet_aton(null),inet_aton("122.256"),ine id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority inet_ntoa(NULL) AS `inet_ntoa(null)`,inet_aton(NULL) AS `inet_aton(null)`,inet_aton(_latin1'122.256') AS `inet_aton("122.256")`,inet_aton(_latin1'122.226.') AS `inet_aton("122.226.")`,inet_aton(_latin1'') AS `inet_aton("")` +Note 1003 select inet_ntoa(NULL) AS `inet_ntoa(null)`,inet_aton(NULL) AS `inet_aton(null)`,inet_aton(_latin1'122.256') AS `inet_aton("122.256")`,inet_aton(_latin1'122.226.') AS `inet_aton("122.226.")`,inet_aton(_latin1'') AS `inet_aton("")` create table t1 (x int); insert into t1 values (null); select * from t1 where x != 0; diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index 37e68d8b13e..50048808c39 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -85,7 +85,7 @@ explain extended select product, country_id , year, sum(profit) from t1 group by id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using temporary; Using filesort Warnings: -Note 1003 select high_priority test.t1.product AS `product`,test.t1.country_id AS `country_id`,test.t1.year AS `year`,sum(test.t1.profit) AS `sum(profit)` from test.t1 group by test.t1.product,test.t1.country_id,test.t1.year with rollup +Note 1003 select test.t1.product AS `product`,test.t1.country_id AS `country_id`,test.t1.year AS `year`,sum(test.t1.profit) AS `sum(profit)` from test.t1 group by test.t1.product,test.t1.country_id,test.t1.year with rollup select product, country_id , sum(profit) from t1 group by product desc, country_id with rollup; product country_id sum(profit) TV 1 400 diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 1a10c9c6ce9..694dc26bcde 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -85,6 +85,15 @@ i 1 3 drop table t1; +create table t1 ( pk int primary key, name varchar(255) not null, number varchar(255) not null); +insert into t1 values (1, 'Gamma', '123'), (2, 'Gamma Ext', '123a'), (3, 'Alpha', '001'), (4, 'Beta', '200c'); +select distinct t1.name as 'Building Name',t1.number as 'Building Number' from t1 order by t1.name asc; +Building Name Building Number +Alpha 001 +Beta 200c +Gamma 123 +Gamma Ext 123a +drop table t1; create table t1 (id int not null,col1 int not null,col2 int not null,index(col1)); insert into t1 values(1,2,2),(2,2,1),(3,1,2),(4,1,1),(5,1,4),(6,2,3),(7,3,1),(8,2,4); select * from t1 order by col1,col2; diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 0fa215f1cf5..0baebc745cc 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -305,7 +305,7 @@ explain extended select benchmark(1,1) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select high_priority no_cache benchmark(1,1) AS `benchmark(1,1)` from test.t1 +Note 1003 select sql_no_cache benchmark(1,1) AS `benchmark(1,1)` from test.t1 show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index d1a5dd00370..290e72d3b55 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -249,18 +249,14 @@ explain select count(*) from t1 where x in (1,2); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range x x 5 NULL 2 Using where; Using index drop table t1; -CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1), KEY i2 (key1)); +CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1)); INSERT INTO t1 VALUES (0),(0),(1),(1); CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya)); INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2); explain select * from t1, t2 where (t1.key1 _latin1'')) +Note 1003 select count(0) AS `count(*)`,min(test.t2.fld4) AS `min(fld4)`,max(test.t2.fld4) AS `max(fld4)`,sum(test.t2.fld1) AS `sum(fld1)`,avg(test.t2.fld1) AS `avg(fld1)`,std(test.t2.fld1) AS `std(fld1)`,variance(test.t2.fld1) AS `variance(fld1)` from test.t2 where ((test.t2.companynr = 34) and (test.t2.fld4 <> _latin1'')) select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 3e386d88932..bc1e5af0a81 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -7,7 +7,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1249 Select 2 was reduced during optimisation -Note 1003 select high_priority 2 AS `(select 2)` +Note 1003 select 2 AS `(select 2)` SELECT (SELECT 1) UNION SELECT (SELECT 2); (SELECT 1) 1 @@ -16,10 +16,11 @@ explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1249 Select 2 was reduced during optimisation Note 1249 Select 4 was reduced during optimisation -Note 1003 select high_priority 1 AS `(SELECT 1)` union select 2 AS `(SELECT 2)` +Note 1003 select 1 AS `(SELECT 1)` union select 2 AS `(SELECT 2)` SELECT (SELECT (SELECT 0 UNION SELECT 0)); (SELECT (SELECT 0 UNION SELECT 0)) 0 @@ -28,9 +29,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used 3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1249 Select 2 was reduced during optimisation -Note 1003 select high_priority (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))` +Note 1003 select (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))` SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b; @@ -48,7 +50,7 @@ id select_type table type possible_keys key key_len ref rows Extra Warnings: Note 1276 Field or reference 'a' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select high_priority 1 AS `1` from (select 1 AS `a`) b having ((select b.a AS `a`) = 1) +Note 1003 select 1 AS `1` from (select 1 AS `a`) b having ((select b.a AS `a`) = 1) SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -182,8 +184,9 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using filesort 3 UNION t4 ALL NULL NULL NULL NULL 3 Using where; Using filesort 4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: -Note 1003 (select high_priority test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.b = (select test.t3.a AS `a` from test.t3 order by test.t3.a desc limit 1))) union (select test.t4.a AS `a`,test.t4.b AS `b` from test.t4 where (test.t4.b = (select (max(test.t2.a) * 4) AS `max(t2.a)*4` from test.t2)) order by test.t4.a) +Note 1003 (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.b = (select test.t3.a AS `a` from test.t3 order by test.t3.a desc limit 1))) union (select test.t4.a AS `a`,test.t4.b AS `b` from test.t4 where (test.t4.b = (select (max(test.t2.a) * 4) AS `max(t2.a)*4` from test.t2)) order by test.t4.a) select (select a from t3 where a 1)) tt +Note 1003 select (select test.t3.a AS `a` from test.t3 where (test.t3.a < 8) order by test.t3.a desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,tt.a AS `a` from (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.a > 1)) tt select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1); a 2 @@ -220,7 +223,7 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using where Warnings: Note 1276 Field or reference 't4.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select high_priority test.t4.b AS `b`,(select avg((test.t2.a + (select min(test.t3.a) AS `min(t3.a)` from test.t3 where (test.t3.a >= test.t4.a)))) AS `avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a))` from test.t2) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from test.t4 +Note 1003 select test.t4.b AS `b`,(select avg((test.t2.a + (select min(test.t3.a) AS `min(t3.a)` from test.t3 where (test.t3.a >= test.t4.a)))) AS `avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a))` from test.t2) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from test.t4 select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -266,7 +269,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select high_priority test.t3.a AS `a` from test.t3 where (test.t3.a >= (select min(test.t2.b) from test.t2)) +Note 1003 select test.t3.a AS `a` from test.t3 where (test.t3.a >= (select min(test.t2.b) from test.t2)) select * from t3 where a >= all (select b from t2); a 7 @@ -306,10 +309,11 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 3 DEPENDENT UNION t5 ALL NULL NULL NULL NULL 2 Using where +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 't2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 't2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select high_priority (select test.t1.a AS `a` from test.t1 where (test.t1.a = test.t2.a) union select test.t5.a AS `a` from test.t5 where (test.t5.a = test.t2.a)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,test.t2.a AS `a` from test.t2 +Note 1003 select (select test.t1.a AS `a` from test.t1 where (test.t1.a = test.t2.a) union select test.t5.a AS `a` from test.t5 where (test.t5.a = test.t2.a)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,test.t2.a AS `a` from test.t2 select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -327,7 +331,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 test.t6.clinic_uq 1 Warnings: Note 1276 Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1 -Note 1003 select high_priority test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select test.t7.uq AS `uq`,test.t7.name AS `name` from test.t7 where (test.t7.uq = test.t6.clinic_uq)) +Note 1003 select test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select test.t7.uq AS `uq`,test.t7.name AS `name` from test.t7 where (test.t7.uq = test.t6.clinic_uq)) select * from t1 where a= (select a from t2,t4 where t2.b=t4.b); ERROR 23000: Column: 'a' in field list is ambiguous drop table if exists t1,t2,t3; @@ -362,7 +366,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t8 const PRIMARY PRIMARY 35 const 1 3 SUBQUERY t8 const PRIMARY PRIMARY 35 1 Using index Warnings: -Note 1003 select high_priority test.t8.pseudo AS `pseudo`,(select test.t8.email AS `email` from test.t8 where (test.t8.pseudo = (select test.t8.pseudo AS `pseudo` from test.t8 where (test.t8.pseudo = _latin1'joce')))) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from test.t8 where (test.t8.pseudo = (select test.t8.pseudo AS `pseudo` from test.t8 where (test.t8.pseudo = _latin1'joce'))) +Note 1003 select test.t8.pseudo AS `pseudo`,(select test.t8.email AS `email` from test.t8 where (test.t8.pseudo = (select test.t8.pseudo AS `pseudo` from test.t8 where (test.t8.pseudo = _latin1'joce')))) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from test.t8 where (test.t8.pseudo = (select test.t8.pseudo AS `pseudo` from test.t8 where (test.t8.pseudo = _latin1'joce'))) SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM t8 WHERE pseudo='joce'); ERROR 21000: Operand should contain 1 column(s) @@ -388,13 +392,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL PRIMARY 41 NULL 2 Using where; Using index Warnings: -Note 1003 select high_priority distinct test.t1.date AS `date` from test.t1 where (test.t1.date = 20020803) +Note 1003 select distinct test.t1.date AS `date` from test.t1 where (test.t1.date = 20020803) EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY t1 index NULL PRIMARY 41 NULL 2 Using where; Using index Warnings: -Note 1003 select high_priority (select distinct test.t1.date AS `date` from test.t1 where (test.t1.date = 20020803)) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` +Note 1003 select (select distinct test.t1.date AS `date` from test.t1 where (test.t1.date = 20020803)) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; date 2002-08-03 @@ -413,8 +417,9 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL topic 3 NULL 2 Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: -Note 1003 select high_priority 1 AS `1` from test.t1 +Note 1003 select 1 AS `1` from test.t1 drop table t1; CREATE TABLE `t1` ( `numeropost` mediumint(8) unsigned NOT NULL auto_increment, @@ -534,13 +539,13 @@ EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select high_priority max(test.t1.numreponse) AS `MAX(numreponse)` from test.t1 where (test.t1.numeropost = _latin1'1') +Note 1003 select max(test.t1.numreponse) AS `MAX(numreponse)` from test.t1 where (test.t1.numeropost = _latin1'1') EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select high_priority test.t1.numreponse AS `numreponse` from test.t1 where ((test.t1.numeropost = _latin1'1') and (test.t1.numreponse = 3)) +Note 1003 select test.t1.numreponse AS `numreponse` from test.t1 where ((test.t1.numeropost = _latin1'1') and (test.t1.numreponse = 3)) drop table t1; CREATE TABLE t1 (a int(1)); INSERT INTO t1 VALUES (1); @@ -716,7 +721,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ref id id 5 const 1 Using where; Using index Warnings: Note 1249 Select 2 was reduced during optimisation -Note 1003 select high_priority test.t2.id AS `id` from test.t2 where (test.t2.id = 1) +Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = 1) SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id 1 @@ -729,14 +734,15 @@ id select_type table type possible_keys key key_len ref rows Extra Warnings: Note 1249 Select 3 was reduced during optimisation Note 1249 Select 2 was reduced during optimisation -Note 1003 select high_priority test.t2.id AS `id` from test.t2 where (test.t2.id = (1 + 1)) +Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = (1 + 1)) EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL id 5 NULL 2 Using where; Using index 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: -Note 1003 select high_priority test.t2.id AS `id` from test.t2 where (test.t2.id,(select 1 AS `Not_used` having ((test.t2.id) = (1)) union select 1 AS `Not_used` having ((test.t2.id) = (3)))) +Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id,(select 1 AS `Not_used` having ((test.t2.id) = (1)) union select 1 AS `Not_used` having ((test.t2.id) = (3)))) SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3); id SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 2); @@ -862,7 +868,7 @@ id select_type table type possible_keys key key_len ref rows Extra Warnings: Note 1276 Field or reference 'a' of SELECT #2 was resolved in SELECT #1 Note 1249 Select 2 was reduced during optimisation -Note 1003 select high_priority (test.t1.a + 1) AS `(select a+1)` from test.t1 +Note 1003 select (test.t1.a + 1) AS `(select a+1)` from test.t1 select (select a+1) from t1; (select a+1) 2.5 @@ -884,7 +890,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 Using index 2 DEPENDENT SUBQUERY t2 index_subquery a a 5 func 2 Using index Warnings: -Note 1003 select high_priority test.t1.a AS `a`,(test.t1.a,(((test.t1.a) in t2 on a chicking NULL))) AS `t1.a in (select t2.a from t2)` from test.t1 +Note 1003 select test.t1.a AS `a`,(test.t1.a,(((test.t1.a) in t2 on a chicking NULL))) AS `t1.a in (select t2.a from t2)` from test.t1 CREATE TABLE t3 (a int(11) default '0'); INSERT INTO t3 VALUES (1),(2),(3); SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; @@ -899,7 +905,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 Using where; Using index 2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using where Warnings: -Note 1003 select high_priority test.t1.a AS `a`,(test.t1.a,(select 1 AS `Not_used` from test.t2 join test.t3 where ((test.t3.a = test.t2.a) and (((test.t1.a) = test.t2.a) or isnull(test.t2.a))) having (test.t2.a))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from test.t1 +Note 1003 select test.t1.a AS `a`,(test.t1.a,(select 1 AS `Not_used` from test.t2 join test.t3 where ((test.t3.a = test.t2.a) and (((test.t1.a) = test.t2.a) or isnull(test.t2.a))) having (test.t2.a))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from test.t1 drop table t1,t2,t3; create table t1 (a float); select 10.5 IN (SELECT * from t1 LIMIT 1); @@ -1009,19 +1015,19 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found 2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select high_priority no_cache (select no_cache rand() AS `RAND()` from test.t1) AS `(SELECT RAND() FROM t1)` from test.t1 +Note 1003 select sql_no_cache (select sql_no_cache rand() AS `RAND()` from test.t1) AS `(SELECT RAND() FROM t1)` from test.t1 EXPLAIN EXTENDED SELECT (SELECT ENCRYPT('test') FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found 2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select high_priority no_cache (select no_cache ecrypt(_latin1'test') AS `ENCRYPT('test')` from test.t1) AS `(SELECT ENCRYPT('test') FROM t1)` from test.t1 +Note 1003 select sql_no_cache (select sql_no_cache ecrypt(_latin1'test') AS `ENCRYPT('test')` from test.t1) AS `(SELECT ENCRYPT('test') FROM t1)` from test.t1 EXPLAIN EXTENDED SELECT (SELECT BENCHMARK(1,1) FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found 2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select high_priority no_cache (select no_cache benchmark(1,1) AS `BENCHMARK(1,1)` from test.t1) AS `(SELECT BENCHMARK(1,1) FROM t1)` from test.t1 +Note 1003 select sql_no_cache (select sql_no_cache benchmark(1,1) AS `BENCHMARK(1,1)` from test.t1) AS `(SELECT BENCHMARK(1,1) FROM t1)` from test.t1 drop table t1; CREATE TABLE `t1` ( `mot` varchar(30) character set latin1 NOT NULL default '', @@ -1116,7 +1122,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 UNCACHEABLE SUBQUERY t1 ALL NULL NULL NULL NULL 3 3 UNCACHEABLE SUBQUERY t1 ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select high_priority no_cache test.t1.a AS `a`,(select no_cache (select no_cache rand() AS `rand()` from test.t1 limit 1) AS `(select rand() from t1 limit 1)` from test.t1 limit 1) AS `(select (select rand() from t1 limit 1) from t1 limit 1)` from test.t1 +Note 1003 select sql_no_cache test.t1.a AS `a`,(select sql_no_cache (select sql_no_cache rand() AS `rand()` from test.t1 limit 1) AS `(select rand() from t1 limit 1)` from test.t1 limit 1) AS `(select (select rand() from t1 limit 1) from t1 limit 1)` from test.t1 drop table t1; select t1.Continent, t2.Name, t2.Population from t1 LEFT JOIN t2 ON t1.Code = t2.Country where t2.Population IN (select max(t2.Population) AS Population from t2, t1 where t2.Country = t1.Code group by Continent); ERROR 42S02: Table 'test.t1' doesn't exist @@ -1170,7 +1176,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select high_priority (0,(select 1 AS `Not_used` from test.t1 a)) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 AS `Not_used` from test.t1 a)) AS `0 IN (SELECT 1 FROM t1 a)` INSERT INTO t1 (pseudo) VALUES ('test1'); SELECT 0 IN (SELECT 1 FROM t1 a); 0 IN (SELECT 1 FROM t1 a) @@ -1180,7 +1186,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select high_priority (0,(select 1 AS `Not_used` from test.t1 a)) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 AS `Not_used` from test.t1 a)) AS `0 IN (SELECT 1 FROM t1 a)` drop table t1; CREATE TABLE `t1` ( `i` int(11) NOT NULL default '0', @@ -1224,7 +1230,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref salary salary 5 const 1 Using where 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select high_priority test.t1.id AS `id` from test.t1 where (test.t1.salary = (select max(test.t1.salary) AS `MAX(salary)` from test.t1)) +Note 1003 select test.t1.id AS `id` from test.t1 where (test.t1.salary = (select max(test.t1.salary) AS `MAX(salary)` from test.t1)) drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1291,7 +1297,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 Using where; Using index 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index Warnings: -Note 1003 select high_priority test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on PRIMARY))) +Note 1003 select test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on PRIMARY))) select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1301,7 +1307,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 Using where; Using index 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where Warnings: -Note 1003 select high_priority test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on PRIMARY where (test.t1.b <> 30)))) +Note 1003 select test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on PRIMARY where (test.t1.b <> 30)))) select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1312,7 +1318,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 func 1 Using where 2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 Using where; Using index Warnings: -Note 1003 select high_priority test.t2.a AS `a` from test.t2 where (test.t2.a,(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and ((test.t2.a) = test.t1.a)))) +Note 1003 select test.t2.a AS `a` from test.t2 where (test.t2.a,(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and ((test.t2.a) = test.t1.a)))) drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1330,7 +1336,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index 2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index Warnings: -Note 1003 select high_priority test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on a))) +Note 1003 select test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on a))) select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1340,7 +1346,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index 2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index; Using where Warnings: -Note 1003 select high_priority test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on a where (test.t1.b <> 30)))) +Note 1003 select test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on a where (test.t1.b <> 30)))) select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1351,7 +1357,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 Using index 2 DEPENDENT SUBQUERY t1 ref a a 10 func,test.t3.a 1000 Using where; Using index Warnings: -Note 1003 select high_priority test.t2.a AS `a` from test.t2 where (test.t2.a,(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and ((test.t2.a) = test.t1.a)))) +Note 1003 select test.t2.a AS `a` from test.t2 where (test.t2.a,(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and ((test.t2.a) = test.t1.a)))) insert into t1 values (3,31); select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a @@ -1367,7 +1373,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index 2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index; Using where Warnings: -Note 1003 select high_priority test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on a where (test.t1.b <> 30)))) +Note 1003 select test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on a where (test.t1.b <> 30)))) drop table t1, t2, t3; create table t1 (a int, b int); create table t2 (a int, b int); @@ -1424,7 +1430,7 @@ explain extended (select * from t1); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 (select high_priority test.t1.s1 AS `s1` from test.t1) +Note 1003 (select test.t1.s1 AS `s1` from test.t1) (select * from t1); s1 tttt @@ -1458,25 +1464,25 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: -Note 1003 select high_priority test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from test.t1 +Note 1003 select test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from test.t1 explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: -Note 1003 select high_priority test.t1.s1 AS `s1`,(test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL))) AS `s1 = ANY (SELECT s1 FROM t2)` from test.t1 +Note 1003 select test.t1.s1 AS `s1`,(test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL))) AS `s1 = ANY (SELECT s1 FROM t2)` from test.t1 explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: -Note 1003 select high_priority test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from test.t1 +Note 1003 select test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from test.t1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 1 Using index; Using where Warnings: -Note 1003 select high_priority test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL where (test.t2.s1 < _latin1'a2'))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from test.t1 +Note 1003 select test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL where (test.t2.s1 < _latin1'a2'))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from test.t1 drop table t1,t2; create table t2 (a int, b int); create table t3 (a int); @@ -1491,7 +1497,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select high_priority test.t3.a AS `a` from test.t3 where ((test.t3.a < (select max(test.t2.b) from test.t2))) +Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a < (select max(test.t2.b) from test.t2))) insert into t2 values (2,2), (2,1), (3,3), (3,1); select * from t3 where a > all (select max(b) from t2 group by a); a @@ -1502,7 +1508,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort Warnings: -Note 1003 select high_priority test.t3.a AS `a` from test.t3 where ((test.t3.a <= (select max(test.t2.b) AS `max(b)` from test.t2 group by test.t2.a))) +Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a <= (select max(test.t2.b) AS `max(b)` from test.t2 group by test.t2.a))) drop table t2, t3; CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); @@ -1544,11 +1550,14 @@ e select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); s1 e -explain select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); +explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY t1 system NULL NULL NULL NULL 1 3 UNION t1 system NULL NULL NULL NULL 1 +NULL UNION RESULT ALL NULL NULL NULL NULL NULL +Warnings: +Note 1003 select test.t1.s1 AS `s1` from test.t1 drop table t1; CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874'); @@ -1667,14 +1676,14 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 12 Using where 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where Warnings: -Note 1003 select high_priority test.t1.id AS `id`,test.t1.text AS `text` from test.t1 where not((test.t1.id,(((test.t1.id) in t1 on PRIMARY where (test.t1.id < 8))))) +Note 1003 select test.t1.id AS `id`,test.t1.text AS `text` from test.t1 where not((test.t1.id,(((test.t1.id) in t1 on PRIMARY where (test.t1.id < 8))))) explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY tt ALL NULL NULL NULL NULL 12 Using where 2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 7 Using where; Using index Warnings: Note 1276 Field or reference 'tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 select high_priority test.tt.id AS `id`,test.tt.text AS `text` from test.t1 tt where not(exists(select test.t1.id AS `id` from test.t1 where ((test.t1.id < 8) and ((test.t1.id = test.tt.id) or isnull(test.t1.id))) having (test.t1.id is not null))) +Note 1003 select test.tt.id AS `id`,test.tt.text AS `text` from test.t1 tt where not(exists(select test.t1.id AS `id` from test.t1 where ((test.t1.id < 8) and ((test.t1.id = test.tt.id) or isnull(test.t1.id))) having (test.t1.id is not null))) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -1700,7 +1709,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 Using where Warnings: -Note 1003 select high_priority test.a.id AS `id`,test.a.text AS `text`,test.b.id AS `id`,test.b.text AS `text`,test.c.id AS `id`,test.c.text AS `text` from test.t1 a left join test.t2 b on(((test.a.id = test.b.id) or isnull(test.b.id))) join test.t1 c where (if(isnull(test.b.id),1000,test.b.id) = test.c.id) +Note 1003 select test.a.id AS `id`,test.a.text AS `text`,test.b.id AS `id`,test.b.text AS `text`,test.c.id AS `id`,test.c.text AS `text` from test.t1 a left join test.t2 b on(((test.a.id = test.b.id) or isnull(test.b.id))) join test.t1 c where (if(isnull(test.b.id),1000,test.b.id) = test.c.id) drop table t1,t2; create table t1 (a int); insert into t1 values (1); @@ -1727,3 +1736,92 @@ SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t id c 1 1 2 0 +DROP TABLE t1,t2; +CREATE TABLE t1 ( a int, b int ); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +ALTER TABLE t1 ADD INDEX (a); +SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +DROP TABLE t1; diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index e9861266b78..6792f2f4c2c 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -507,7 +507,7 @@ coercibility(load_file('../../std_data/words.dat')); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache charset(load_file(_latin1'../../std_data/words.dat')) AS `charset(load_file('../../std_data/words.dat'))`,collation(load_file(_latin1'../../std_data/words.dat')) AS `collation(load_file('../../std_data/words.dat'))`,coercibility(load_file(_latin1'../../std_data/words.dat')) AS `coercibility(load_file('../../std_data/words.dat'))` +Note 1003 select sql_no_cache charset(load_file(_latin1'../../std_data/words.dat')) AS `charset(load_file('../../std_data/words.dat'))`,collation(load_file(_latin1'../../std_data/words.dat')) AS `collation(load_file('../../std_data/words.dat'))`,coercibility(load_file(_latin1'../../std_data/words.dat')) AS `coercibility(load_file('../../std_data/words.dat'))` update t1 set imagem=load_file('../../std_data/words.dat') where id=1; select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1; if(imagem is null, "ERROR", "OK") length(imagem) diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index cc29c676283..66eb744e7ce 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -35,6 +35,12 @@ Table Op Msg_type Msg_text test.t1 check status OK delete from t1; insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460"); +Warnings: +Warning 1264 Data truncated, out of range for column 't' at row 14 +Warning 1264 Data truncated, out of range for column 't' at row 15 +Warning 1264 Data truncated, out of range for column 't' at row 16 +Warning 1264 Data truncated, out of range for column 't' at row 17 +Warning 1264 Data truncated, out of range for column 't' at row 18 select * from t1; t 2000-01-01 00:00:00 diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index a0c0e0f5503..f044ced2342 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -70,6 +70,21 @@ select min(a) from t1; min(a) -0.010 drop table t1; +create table t1 (c1 double, c2 varchar(20)); +insert t1 values (121,"16"); +select c1 + c1 * (c2 / 100) as col from t1; +col +140.36 +create table t2 select c1 + c1 * (c2 / 100) as col from t1; +select * from t2; +col +140.36 +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `col` double default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1,t2; create table t1 (a float); insert into t1 values (1); select max(a),min(a),avg(a) from t1; @@ -105,6 +120,18 @@ select min(a) from t1; min(a) -0.010 drop table t1; +create table t1 (a float(200,100), b double(200,100)); +insert t1 values (1.0, 2.0); +select * from t1; +a b +1.000000000000000000000000000000 2.000000000000000000000000000000 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` float(200,30) default NULL, + `b` double(200,30) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' drop table if exists t1; diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 0379405eaa8..0735ea4dc40 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -86,8 +86,9 @@ explain extended (select a,b from t1 limit 2) union all (select a,b from t2 ord id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 2 UNION t2 ALL NULL NULL NULL NULL 4 Using filesort +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Using filesort Warnings: -Note 1003 (select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 limit 2) union all (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 order by test.t2.a limit 1) order by b desc +Note 1003 (select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 limit 2) union all (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 order by test.t2.a limit 1) order by b desc (select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2; a b 1 a @@ -106,21 +107,15 @@ explain select a,b from t1 union all select a,b from t2; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 2 UNION t2 ALL NULL NULL NULL NULL 4 +NULL UNION RESULT ALL NULL NULL NULL NULL NULL explain select xx from t1 union select 1; ERROR 42S22: Unknown column 'xx' in 'field list' explain select a,b from t1 union select 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +ERROR 21000: The used SELECT statements have a different number of columns explain select 1 union select a,b from t1 union select 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 UNION t1 ALL NULL NULL NULL NULL 4 -3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +ERROR 21000: The used SELECT statements have a different number of columns explain select a,b from t1 union select 1 limit 0; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +ERROR 21000: The used SELECT statements have a different number of columns select a,b from t1 into outfile 'skr' union select a,b from t2; ERROR HY000: Wrong usage of UNION and INTO select a,b from t1 order by a union select a,b from t2; @@ -475,8 +470,9 @@ explain extended (select * from t1 where a=1) union (select * from t2 where a=1) id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 2 UNION t2 const PRIMARY PRIMARY 4 const 1 +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: -Note 1003 (select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (test.t1.a = 1)) union (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.a = 1)) +Note 1003 (select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (test.t1.a = 1)) union (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.a = 1)) (select * from t1 where a=5) union (select * from t2 where a=1); a b 1 10 @@ -497,10 +493,12 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 UNION t1 index PRIMARY PRIMARY 4 NULL 4 Using index 2 UNION t2 index PRIMARY PRIMARY 4 NULL 3 Using where; Using index +NULL UNION RESULT 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 ALL NULL NULL NULL NULL NULL drop table t1,t2; create table t1 ( id int not null auto_increment, primary key (id) ,user_name text ); create table t2 ( id int not null auto_increment, primary key (id) ,group_name text ); @@ -950,3 +948,8 @@ a 1 drop table t1, t2; set sql_select_limit=default; +CREATE TABLE t1 (i int(11) default NULL,c char(1) default NULL,KEY i (i)); +CREATE TABLE t2 (i int(11) default NULL,c char(1) default NULL,KEY i (i)); +explain (select * from t1) union (select * from t2) order by not_existing_column; +ERROR 42S22: Unknown column 'not_existing_column' in 'order clause' +drop table t1, t2; diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result index cf001158ae2..26ce91286da 100644 --- a/mysql-test/r/varbinary.result +++ b/mysql-test/r/varbinary.result @@ -15,7 +15,7 @@ explain extended select * from t1 where UNIQ=0x38afba1d73e6a18a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const UNIQ UNIQ 8 const 1 Warnings: -Note 1003 select high_priority test.t1.ID AS `ID`,test.t1.UNIQ AS `UNIQ` from test.t1 where (test.t1.UNIQ = 4084688022709641610) +Note 1003 select test.t1.ID AS `ID`,test.t1.UNIQ AS `UNIQ` from test.t1 where (test.t1.UNIQ = 4084688022709641610) drop table t1; select x'hello'; ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'x'hello'' at line 1 diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 67c1d5b3e33..57fe2577b03 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -48,7 +48,7 @@ explain extended select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache (@t1:=((@t2:=1) + (@t3:=4))) AS `@t1:=(@t2:=1)+@t3:=4`,(@t1) AS `@t1`,(@t2) AS `@t2`,(@t3) AS `@t3` +Note 1003 select sql_no_cache (@t1:=((@t2:=1) + (@t3:=4))) AS `@t1:=(@t2:=1)+@t3:=4`,(@t1) AS `@t1`,(@t2) AS `@t2`,(@t3) AS `@t3` select @t5; @t5 1.23456 @@ -107,7 +107,7 @@ explain extended select last_insert_id(345); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache last_insert_id(345) AS `last_insert_id(345)` +Note 1003 select sql_no_cache last_insert_id(345) AS `last_insert_id(345)` select @@IDENTITY,last_insert_id(), @@identity; @@IDENTITY last_insert_id() @@identity 345 345 345 @@ -115,7 +115,7 @@ explain extended select @@IDENTITY,last_insert_id(), @@identity; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache 345 AS `@@IDENTITY`,last_insert_id() AS `last_insert_id()`,345 AS `@@identity` +Note 1003 select sql_no_cache 345 AS `@@IDENTITY`,last_insert_id() AS `last_insert_id()`,345 AS `@@identity` set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON"; set global concurrent_insert=ON; show variables like 'concurrent_insert'; @@ -421,6 +421,11 @@ set ft_boolean_syntax = @@init_connect; ERROR HY000: Variable 'ft_boolean_syntax' is a GLOBAL variable and should be set with SET GLOBAL set global ft_boolean_syntax = @@init_connect; ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of '' +set global myisam_max_sort_file_size=4294967296; +show global variables like 'myisam_max_sort_file_size'; +Variable_name Value +myisam_max_sort_file_size 4294967296 +set global myisam_max_sort_file_size=default; select @@global.max_user_connections,@@local.max_join_size; @@global.max_user_connections @@session.max_join_size 100 200 diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test new file mode 100644 index 00000000000..14062437428 --- /dev/null +++ b/mysql-test/t/ctype_latin1.test @@ -0,0 +1,55 @@ +# +# Tests with the latin1 character set +# +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# WL 1494: Treat latin1 as cp1252 for unicode conversion +# + +SET NAMES latin1; +CREATE TABLE t1 (a char(1) character set latin1); +INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07); +INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17); +INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27); +INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37); +INSERT INTO t1 VALUES (0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +INSERT INTO t1 VALUES (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47); +INSERT INTO t1 VALUES (0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +INSERT INTO t1 VALUES (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57); +INSERT INTO t1 VALUES (0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +INSERT INTO t1 VALUES (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67); +INSERT INTO t1 VALUES (0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +INSERT INTO t1 VALUES (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77); +INSERT INTO t1 VALUES (0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +INSERT INTO t1 VALUES (0x80),(0x81),(0x82),(0x83),(0x84),(0x85),(0x86),(0x87); +INSERT INTO t1 VALUES (0x88),(0x89),(0x8A),(0x8B),(0x8C),(0x8D),(0x8E),(0x8F); +INSERT INTO t1 VALUES (0x90),(0x91),(0x92),(0x93),(0x94),(0x95),(0x96),(0x97); +INSERT INTO t1 VALUES (0x98),(0x99),(0x9A),(0x9B),(0x9C),(0x9D),(0x9E),(0x9F); +INSERT INTO t1 VALUES (0xA0),(0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7); +INSERT INTO t1 VALUES (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF); +INSERT INTO t1 VALUES (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7); +INSERT INTO t1 VALUES (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF); +INSERT INTO t1 VALUES (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7); +INSERT INTO t1 VALUES (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF); +INSERT INTO t1 VALUES (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7); +INSERT INTO t1 VALUES (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF); +INSERT INTO t1 VALUES (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7); +INSERT INTO t1 VALUES (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF); +INSERT INTO t1 VALUES (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7); +INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF); + +# +# 0x81 0x8D 0x8F 0x90 0x9D are undefined in cp1252 +# +SELECT + hex(a), + hex(@u:=convert(a using utf8)), + hex(@l:=convert(@u using latin1)), + a=@l FROM t1; +DROP TABLE t1; diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test index 40349da8aa9..8ac22e89c2d 100644 --- a/mysql-test/t/ctype_recoding.test +++ b/mysql-test/t/ctype_recoding.test @@ -56,6 +56,13 @@ SET CHARACTER SET koi8r; DROP TABLE ÔÁÂÌÉÃÁ; SET CHARACTER SET default; +# Test for Item_func_conv_charset::fix_fields (bug #3704) +SET NAMES UTF8; +CREATE TABLE t1 (t text) DEFAULT CHARSET UTF8; +INSERT INTO t1 (t) VALUES ('x'); +SELECT 1 FROM t1 WHERE CONCAT(_latin1'x') = t; +DROP TABLE t1; + SET CHARACTER SET koi8r; CREATE DATABASE ÔÅÓÔ; USE ÔÅÓÔ; @@ -71,4 +78,3 @@ SET NAMES koi8r; SELECT hex('ÔÅÓÔ'); SET character_set_connection=cp1251; SELECT hex('ÔÅÓÔ'); - diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test index ff1803368b9..050939e5ad2 100644 --- a/mysql-test/t/explain.test +++ b/mysql-test/t/explain.test @@ -30,3 +30,14 @@ explain select count(*) from t1; insert into t1 values(1); explain select count(*) from t1; drop table t1; + +# +# Bug #3403 Wrong encoding in EXPLAIN SELECT output +# +set names koi8r; +create table ÔÁÂ (ËÏÌ0 int, ËÏÌ1 int, key ÉÎÄ0 (ËÏÌ0), key ÉÎÄ01 (ËÏÌ0,ËÏÌ1)); +insert into ÔÁÂ (ËÏÌ0) values (1); +insert into ÔÁÂ (ËÏÌ0) values (2); +explain select ËÏÌ0 from ÔÁÂ where ËÏÌ0=1; +drop table ÔÁÂ; +set names latin1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 50a3d522e3d..ac88125965a 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -63,6 +63,7 @@ select * from t1 where MATCH a,b AGAINST ('"text search" "now support"' IN BOOL select * from t1 where MATCH a,b AGAINST ('"text search" -"now support"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"text search" +"now support"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE); +select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE); diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 9d99a57afe5..aede2220466 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -179,3 +179,13 @@ select group_concat(c order by (select mid(group_concat(c order by a),1,5) from select a,c,(select group_concat(c order by a) from t2 where a=t1.a) as grp from t1 order by grp; drop table t1,t2; + +# +# group_concat of expression with GROUP BY and external GROUP BY +# +CREATE TABLE t1 ( a int ); +CREATE TABLE t2 ( a int ); +INSERT INTO t1 VALUES (1), (2); +INSERT INTO t2 VALUES (1), (2); +SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a; +DROP TABLE t1, t2; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index c4413c3ef3f..c138b848491 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -172,6 +172,15 @@ INSERT INTO t1 VALUES (1,1),(2,2); SELECT DISTINCT i, ELT(j, '345', '34') FROM t1; DROP TABLE t1; +# +# bug #3756: quote and NULL +# + +create table t1(a char(4)); +insert into t1 values ('one'),(NULL),('two'),('four'); +select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1; +drop table t1; + # # Test collation and coercibility # diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 832541b0f86..6bd2fa0c703 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -148,3 +148,26 @@ grant usage on *.* to mysqltest_1@localhost identified by "password"; grant select, update, insert on test.* to mysqltest@localhost; show grants for mysqltest_1@localhost; drop user mysqltest_1@localhost; + +# +# Bug #3403 Wrong encodin in SHOW GRANTS output +# +SET NAMES koi8r; +CREATE DATABASE ÂÄ; +USE ÂÄ; +CREATE TABLE ÔÁÂ (ËÏÌ int); + +GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost; + +GRANT SELECT ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +REVOKE SELECT ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost; + +GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost; + +DROP DATABASE ÂÄ; +SET NAMES latin1; diff --git a/mysql-test/t/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 similarity index 100% rename from mysql-test/t/rpl_relayrotate-master.opt rename to mysql-test/t/innodb-master.opt diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index e20be83b4b6..e0cc96ccb32 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1044,3 +1044,99 @@ drop table t1; create table t1 (a int) engine=innodb; create table t2 like t1; drop table t1,t2; + +# +# Test of automaticly created foreign keys +# + +create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb; +create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb; +show create table t1; +show create table t2; +create index id on t2 (id); +show create table t2; +create index id2 on t2 (id); +show create table t2; +drop index id2 on t2; +--error 1025,1025 +drop index id on t2; +show create table t2; +drop table t2; + +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb; +show create table t2; +create unique index id on t2 (id,id2); +show create table t2; +drop table t2; + +# Check foreign key columns created in different order than key columns +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +drop table t2; + +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb; +show create table t2; +drop table t2; + +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +drop table t2; + +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb; +show create table t2; +drop table t2; + +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb; +show create table t2; +alter table t2 add index id_test (id), add index id_test2 (id,id2); +show create table t2; +drop table t2; + +# Test error handling +--error 1005 +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; + +# bug#3749 + +create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +drop table t2; +create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +drop table t2, t1; + + +# +# Let us test binlog_cache_use and binlog_cache_disk_use status vars. +# Actually this test has nothing to do with innodb per se, it just requires +# transactional table. +# +show status like "binlog_cache_use"; +show status like "binlog_cache_disk_use"; + +create table t1 (a int) engine=innodb; + +# Now we are going to create transaction which is long enough so its +# transaction binlog will be flushed to disk... +let $1=2000; +disable_query_log; +begin; +while ($1) +{ + eval insert into t1 values( $1 ); + dec $1; +} +commit; +enable_query_log; +show status like "binlog_cache_use"; +show status like "binlog_cache_disk_use"; + +# Transaction which should not be flushed to disk and so should not +# increase binlog_cache_disk_use. +begin; +delete from t1; +commit; +show status like "binlog_cache_use"; +show status like "binlog_cache_disk_use"; + +drop table t1; diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index b45df8eb58e..9d3125efa61 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -71,7 +71,7 @@ show status like 'key_blocks_used'; # Following results differs on 64 and 32 bit systems because of different # pointer sizes, which takes up different amount of space in key cache ---replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED +--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; insert into t1 values (1, 'qqqq'), (11, 'yyyy'); @@ -84,7 +84,7 @@ update t1 set p=2 where p=1; update t2 set i=2 where i=1; show status like 'key_blocks_used'; ---replace_result 1808 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED +--replace_result 1808 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1814 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; cache index t1 key (`primary`) in keycache1; @@ -146,7 +146,7 @@ cache index t1,t2 in default; drop table t1,t2,t3; show status like 'key_blocks_used'; ---replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED +--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; # Cleanup diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index 9ae9c1b5e12..465920deaed 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -79,6 +79,16 @@ select distinct i from t1 order by 1-i; select distinct i from t1 order by mod(i,2),i; drop table t1; +# +# bug#3681 +# + +create table t1 ( pk int primary key, name varchar(255) not null, number varchar(255) not null); +insert into t1 values (1, 'Gamma', '123'), (2, 'Gamma Ext', '123a'), (3, 'Alpha', '001'), (4, 'Beta', '200c'); +select distinct t1.name as 'Building Name',t1.number as 'Building Number' from t1 order by t1.name asc; +drop table t1; + + # # Order by on first index part # diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 51b1f34ee79..4665cd02ed8 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -197,12 +197,11 @@ drop table t1; # # bug #1172 # -CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1), KEY i2 (key1)); +CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1)); INSERT INTO t1 VALUES (0),(0),(1),(1); CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya)); INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2); explain select * from t1, t2 where (t1.key1 any (select s1 from t1); select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); -explain select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); +explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); drop table t1; # @@ -1130,4 +1130,36 @@ INSERT INTO t1 VALUES (1), (2); INSERT INTO t2 VALUES (1); SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id); SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id) ORDER BY t1.id; -DROP TABLE t1,t2 +DROP TABLE t1,t2; + +# +# ALL/ANY test +# +CREATE TABLE t1 ( a int, b int ); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 ); +ALTER TABLE t1 ADD INDEX (a); +SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 ); +DROP TABLE t1; diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index caccf31b32a..d3ddecfc314 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -31,6 +31,14 @@ select a from t1 order by a; select min(a) from t1; drop table t1; +create table t1 (c1 double, c2 varchar(20)); +insert t1 values (121,"16"); +select c1 + c1 * (c2 / 100) as col from t1; +create table t2 select c1 + c1 * (c2 / 100) as col from t1; +select * from t2; +show create table t2; +drop table t1,t2; + # Bug #1022: When a table contains a 'float' field, # and one of the functions MAX, MIN, or AVG is used on that field, # the system crashes. @@ -54,6 +62,12 @@ select a from t1 order by a; select min(a) from t1; drop table t1; +create table t1 (a float(200,100), b double(200,100)); +insert t1 values (1.0, 2.0); +select * from t1; +show create table t1; +drop table t1; + # Errors --error 1063 diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index d9e19571f81..f6006a87d47 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -39,8 +39,11 @@ explain select a,b from t1 union all select a,b from t2; --error 1054 explain select xx from t1 union select 1; +--error 1222 explain select a,b from t1 union select 1; +--error 1222 explain select 1 union select a,b from t1 union select 1; +--error 1222 explain select a,b from t1 union select 1 limit 0; --error 1221 @@ -515,3 +518,12 @@ SET SQL_SELECT_LIMIT=1; select a from t1 union select a from t2 order by a; drop table t1, t2; set sql_select_limit=default; + +# +# nonexisting column in global ORDER BY +# +CREATE TABLE t1 (i int(11) default NULL,c char(1) default NULL,KEY i (i)); +CREATE TABLE t2 (i int(11) default NULL,c char(1) default NULL,KEY i (i)); +--error 1054 +explain (select * from t1) union (select * from t2) order by not_existing_column; +drop table t1, t2; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index a82aa87558a..81bfacf4ee7 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -298,6 +298,14 @@ set ft_boolean_syntax = @@init_connect; --error 1231 set global ft_boolean_syntax = @@init_connect; +# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as +# expected: check that there is no overflow when 64-bit unsigned +# variables are set + +set global myisam_max_sort_file_size=4294967296; +show global variables like 'myisam_max_sort_file_size'; +set global myisam_max_sort_file_size=default; + # # swap # diff --git a/mysys/charset.c b/mysys/charset.c index e58c851cf7c..d801fcdbd76 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -466,7 +466,8 @@ static my_bool init_available_charsets(myf myflags) if (*cs) { set_max_sort_char(*cs); - init_state_maps(*cs); + if (cs[0]->ctype) + init_state_maps(*cs); } } @@ -622,3 +623,61 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name, DBUG_RETURN(cs); } + + +ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to, + const char *from, ulong length) +{ + const char *to_start= to; + const char *end; +#ifdef USE_MB + my_bool use_mb_flag= use_mb(charset_info); +#endif + for (end= from + length; from != end; from++) + { +#ifdef USE_MB + int l; + if (use_mb_flag && (l= my_ismbchar(charset_info, from, end))) + { + while (l--) + *to++= *from++; + from--; + continue; + } +#endif + switch (*from) { + case 0: /* Must be escaped for 'mysql' */ + *to++= '\\'; + *to++= '0'; + break; + case '\n': /* Must be escaped for logs */ + *to++= '\\'; + *to++= 'n'; + break; + case '\r': + *to++= '\\'; + *to++= 'r'; + break; + case '\\': + *to++= '\\'; + *to++= '\\'; + break; + case '\'': + *to++= '\\'; + *to++= '\''; + break; + case '"': /* Better safe than sorry */ + *to++= '\\'; + *to++= '"'; + break; + case '\032': /* This gives problems on Win32 */ + *to++= '\\'; + *to++= 'Z'; + break; + default: + *to++= *from; + } + } + *to= 0; + return (ulong) (to - to_start); +} diff --git a/mysys/default.c b/mysys/default.c index af67520322f..056f686e16f 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -479,6 +479,7 @@ static char *remove_end_comment(char *ptr) return ptr; } +#include void print_defaults(const char *conf_file, const char **groups) { @@ -531,3 +532,5 @@ void print_defaults(const char *conf_file, const char **groups) --defaults-file=# Only read default options from the given file #\n\ --defaults-extra-file=# Read this file after the global files are read"); } + +#include diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c index da16457c299..0f8984e6b3d 100644 --- a/mysys/my_bitmap.c +++ b/mysys/my_bitmap.c @@ -104,7 +104,7 @@ void bitmap_set_bit(MY_BITMAP *map, uint bitmap_bit) { DBUG_ASSERT(map->bitmap && bitmap_bit < map->bitmap_size*8); bitmap_lock(map); - map->bitmap[bitmap_bit / 8] |= (1 << (bitmap_bit & 7)); + bitmap_fast_set_bit(map, bitmap_bit); bitmap_unlock(map); } @@ -144,7 +144,7 @@ void bitmap_clear_bit(MY_BITMAP *map, uint bitmap_bit) { DBUG_ASSERT(map->bitmap && bitmap_bit < map->bitmap_size*8); bitmap_lock(map); - map->bitmap[bitmap_bit / 8] &= ~ (1 << (bitmap_bit & 7)); + bitmap_fast_clear_bit(map, bitmap_bit); bitmap_unlock(map); } @@ -220,7 +220,7 @@ my_bool bitmap_is_set_all(const MY_BITMAP *map) my_bool bitmap_is_set(const MY_BITMAP *map, uint bitmap_bit) { DBUG_ASSERT(map->bitmap && bitmap_bit < map->bitmap_size*8); - return map->bitmap[bitmap_bit / 8] & (1 << (bitmap_bit & 7)); + return bitmap_fast_is_set(map, bitmap_bit); } diff --git a/mysys/my_chsize.c b/mysys/my_chsize.c index 653ea569172..cf26428d65f 100644 --- a/mysys/my_chsize.c +++ b/mysys/my_chsize.c @@ -89,7 +89,7 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags) We should never come here on any modern machine */ VOID(my_seek(fd, newlength, MY_SEEK_SET, MYF(MY_WME+MY_FAE))); - swap(my_off_t, newlength, oldsize); + swap_variables(my_off_t, newlength, oldsize); } #endif diff --git a/mysys/my_compress.c b/mysys/my_compress.c index dd076311188..0e37d2fef9b 100644 --- a/mysys/my_compress.c +++ b/mysys/my_compress.c @@ -68,7 +68,7 @@ byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen) DBUG_PRINT("note",("Packet got longer on compression; Not compressed")); return 0; } - swap(ulong, *len, *complen); /* *len is now packet length */ + swap_variables(ulong, *len, *complen); /* *len is now packet length */ return compbuf; } diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index efd5789968c..8d0b05d55f7 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -790,6 +790,8 @@ static void init_variables(const struct my_option *options) Print help for all options and variables. */ +#include + void my_print_help(const struct my_option *options) { uint col, name_space= 22, comment_space= 57; @@ -920,3 +922,5 @@ void my_print_variables(const struct my_option *options) } } } + +#include diff --git a/mysys/my_handler.c b/mysys/my_handler.c index 35f620ccbcb..de0fba56d21 100644 --- a/mysys/my_handler.c +++ b/mysys/my_handler.c @@ -331,7 +331,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, if (keyseg->flag & HA_REVERSE_SORT) { - swap(uchar*,a,b); + swap_variables(uchar*, a, b); swap_flag=1; /* Remember swap of a & b */ end= a+ (int) (end-b); } @@ -356,8 +356,8 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, if (*b != '-') return -1; a++; b++; - swap(uchar*,a,b); - swap(int,alength,blength); + swap_variables(uchar*, a, b); + swap_variables(int, alength, blength); swap_flag=1-swap_flag; alength--; blength--; end=a+alength; @@ -385,7 +385,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, } if (swap_flag) /* Restore pointers */ - swap(uchar*,a,b); + swap_variables(uchar*, a, b); break; } #ifdef HAVE_LONG_LONG diff --git a/mysys/my_init.c b/mysys/my_init.c index fc178b0308b..da0e6caf96d 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -353,14 +353,16 @@ static my_bool win32_init_tcp_ip() #ifdef __NETWARE__ -/**************************************************************************** - Do basic initialisation for netware needed by most programs -****************************************************************************/ +/* + Basic initialisation for netware +*/ static void netware_init() { char cwd[PATH_MAX], *name; + DBUG_ENTER("netware_init"); + /* init only if we are not a client library */ if (my_progname) { @@ -398,5 +400,7 @@ static void netware_init() } } } + + DBUG_VOID_RETURN; } #endif /* __NETWARE__ */ diff --git a/mysys/my_lock.c b/mysys/my_lock.c index 5058c301adb..8f915d6003a 100644 --- a/mysys/my_lock.c +++ b/mysys/my_lock.c @@ -117,10 +117,12 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length, #if defined(HAVE_FCNTL) { struct flock lock; - lock.l_type= (short) locktype; - lock.l_whence=0L; - lock.l_start=(long) start; - lock.l_len=(long) length; + + lock.l_type= (short) locktype; + lock.l_whence= SEEK_SET; + lock.l_start= (off_t) start; + lock.l_len= (off_t) length; + if (MyFlags & MY_DONT_WAIT) { if (fcntl(fd,F_SETLK,&lock) != -1) /* Check if we can lock */ diff --git a/mysys/my_netware.c b/mysys/my_netware.c index e41dbd0a029..9c604778c2d 100644 --- a/mysys/my_netware.c +++ b/mysys/my_netware.c @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* - Function specific to netware + Functions specific to netware */ #include diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index f10a2210064..2667c0670d8 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -102,16 +102,20 @@ void my_pthread_exit(void *status) NXContext_t ctx; char name[PATH_MAX] = ""; - NXThreadGetContext(tid, &ctx); - NXContextGetName(ctx, name, PATH_MAX); - - /* - "MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread" - with a debug build of LibC the reaper can have different names - */ - if (!strindex(name, "\'s")) + /* Do not call pthread_exit if it is not a LibC thread */ + if (tid != 0) { - pthread_exit(status); + NXThreadGetContext(tid, &ctx); + NXContextGetName(ctx, name, PATH_MAX); + + /* + "MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread" + with a debug build of LibC the reaper can have different names + */ + if (!strindex(name, "\'s")) + { + pthread_exit(status); + } } } #endif diff --git a/mysys/sha1.c b/mysys/sha1.c index 5271b369b6c..d93b4571baf 100644 --- a/mysys/sha1.c +++ b/mysys/sha1.c @@ -342,7 +342,7 @@ static void SHA1ProcessMessageBlock(SHA1_CONTEXT *context) */ -void SHA1PadMessage(SHA1_CONTEXT *context) +static void SHA1PadMessage(SHA1_CONTEXT *context) { /* Check to see if the current message block is too small to hold diff --git a/ndb/Defs.mk b/ndb/Defs.mk index d5a21c64ca9..ac4507562fd 100644 --- a/ndb/Defs.mk +++ b/ndb/Defs.mk @@ -21,62 +21,42 @@ LIBPREFIX := lib fixpath = $1 ar_rcs = $(AR_RCS) $1 $2 #check-odbc = $(findstring sqlext.h, $(wildcard /usr/include/sqlext.h) $(wildcard /usr/local/include/sqlext.h)) -CCFLAGS_TOP += -DHAVE_STRCASECMP - endif ifeq ($(NDB_OS), WIN32) -CCFLAGS_TOP += -DHAVE_STRDUP -NDB_STRLCPY := Y -NDB_STRLCAT := Y SHLIBEXT := dll endif ifeq ($(NDB_OS), LINUX) -CCFLAGS_TOP += -DHAVE_STRDUP -NDB_STRLCAT := Y -NDB_STRLCPY := Y SHLIBEXT := so endif ifeq ($(NDB_OS), SOLARIS) -CCFLAGS_TOP += -DHAVE_STRDUP -NDB_STRLCAT := Y -NDB_STRLCPY := Y SHLIBEXT := so endif ifeq ($(NDB_OS), HPUX) -CCFLAGS_TOP += -DHAVE_STRDUP -NDB_STRLCAT := Y -NDB_STRLCPY := Y SHLIBEXT := sl endif ifeq ($(NDB_OS), MACOSX) -CCFLAGS_TOP += -DHAVE_STRLCAT -CCFLAGS_TOP += -DHAVE_STRLCAT -CCFLAGS_TOP += -DHAVE_STRLCPY -CCFLAGS_TOP += -DNDBOUT_UINTPTR SHLIBEXT := dylib endif ifeq ($(NDB_OS), OSE) -NDB_STRDUP := Y -NDB_STRLCAT := Y -NDB_STRLCPY := Y SHLIBEXT := so endif ifeq ($(NDB_OS), SOFTOSE) -NDB_STRDUP := Y -NDB_STRLCAT := Y -NDB_STRLCPY := Y SHLIBEXT := so endif ifeq ($(NDB_SCI), Y) -CCFLAGS_TOP += -DHAVE_SCI +CCFLAGS_TOP += -DHAVE_NDB_SCI +endif + +ifeq ($(NDB_SHM), Y) +CCFLAGS_TOP += -DHAVE_NDB_SHM endif ifneq ($(findstring OSE, $(NDB_OS)),) diff --git a/ndb/Epilogue.mk b/ndb/Epilogue.mk index dc78a66a1f8..bcdc54a87f1 100644 --- a/ndb/Epilogue.mk +++ b/ndb/Epilogue.mk @@ -227,7 +227,7 @@ CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/util) \ BIN_TARGET_LIBS += logger general portlib endif -CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include) +CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include) -I$(call fixpath,$(NDB_TOP)/../include) ifeq ($(NDB_SCI), Y) BIN_TARGET_LIBS += sisci diff --git a/ndb/Makefile b/ndb/Makefile index 586a430bb17..475914f6120 100644 --- a/ndb/Makefile +++ b/ndb/Makefile @@ -6,6 +6,13 @@ DIRS := src test tools examples replace-targets := all clean NDB_RELEASE := $(shell ../scripts/mysql_config --version) +all: + $(MAKE) -C src + $(MAKE) -C test/src + $(MAKE) -C tools + $(MAKE) -C test/ndbapi/flexBench + $(MAKE) -C test/tools/waiter + include $(NDB_TOP)/Epilogue.mk _libs_test : _bins_src @@ -15,7 +22,7 @@ _bins_src : _libs_src _bins_tools : _bins_src # always release compile except for ndbapi static lib -all: +old-all: $(MAKE) -C src/ndbapi libs $(MAKE) libs NDB_VERSION=RELEASE $(MAKE) bins NDB_VERSION=RELEASE diff --git a/ndb/bin/regression.sh b/ndb/bin/regression.sh index 5e3491af208..5d0531c7460 100644 --- a/ndb/bin/regression.sh +++ b/ndb/bin/regression.sh @@ -294,7 +294,7 @@ executeTest 'testScan -n ScanUpdate2' T6 executeTest 'drop_tab' T6 executeTest 'testScan -n ScanDelete' -executeTest 'drop_all_tab' +executeTest 'drop_all_tabs' executeTest 'testScan -n ScanDelete2' T10 executeTest 'drop_tab' T10 diff --git a/ndb/config/Defs.LINUX.x86.GCC.mk b/ndb/config/Defs.LINUX.x86.GCC.mk index 698b0eb8350..6167a30ff23 100644 --- a/ndb/config/Defs.LINUX.x86.GCC.mk +++ b/ndb/config/Defs.LINUX.x86.GCC.mk @@ -6,9 +6,11 @@ SHELL := /bin/sh C++ := gcc$(GCC_VERSION) CC := gcc$(GCC_VERSION) AR_RCS := $(PURE) ar rcs -SO := gcc$(GCC_VERSION) -shared -lpthread -o +SO := gcc$(GCC_VERSION) -shared -lpthread -o +#SO := gcc$(GCC_VERSION) -shared -o MAKEDEPEND := gcc$(GCC_VERSION) -M +#MAKEDEPEND := gcc$(GCC_VERSION) -M -nostdinc -nostdinc++ PIC := -fPIC RPCGENFLAGS := -M -C -N @@ -27,7 +29,8 @@ else CCFLAGS_WARNINGS = -Wno-long-long -Wall endif # Add these for more warnings -Weffc++ -W -CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS +CCFLAGS_TOP = +#CCFLAGS_TOP = -DSAFE_MUTEX CCFLAGS_TOP += -fno-rtti -fno-exceptions ifeq (RELEASE, $(NDB_VERSION)) @@ -53,4 +56,5 @@ LINK.cc = $(PURE) $(CC) $(CCFLAGS) $(LDFLAGS) LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) -LDFLAGS_LAST = -lpthread -lrt $(NDB_TOP)/src/common/portlib/gcc.cpp +LDFLAGS_LAST = -lrt -lpthread $(NDB_TOP)/src/common/portlib/gcc.cpp +#LDFLAGS_LAST = -lrt $(NDB_TOP)/src/common/portlib/gcc.cpp $(NDB_TOP)/../mysys/libmysys.a $(NDB_TOP)/../dbug/libdbug.a $(NDB_TOP)/../regex/libregex.a $(NDB_TOP)/../strings/libmystrings.a -lpthread diff --git a/ndb/config/GuessConfig.sh b/ndb/config/GuessConfig.sh index d2d8446c704..3caeeaae6d0 100755 --- a/ndb/config/GuessConfig.sh +++ b/ndb/config/GuessConfig.sh @@ -11,6 +11,11 @@ then NDB_SCI=N fi +if [ -z "$NDB_SHM" ] +then + NDB_SHM=N +fi + os=`uname -s` case $os in Linux) diff --git a/ndb/examples/ndbapi_async_example/ndbapi_async.cpp b/ndb/examples/ndbapi_async_example/ndbapi_async.cpp index 685c853c5d5..7abebcc832d 100644 --- a/ndb/examples/ndbapi_async_example/ndbapi_async.cpp +++ b/ndb/examples/ndbapi_async_example/ndbapi_async.cpp @@ -63,20 +63,12 @@ */ +#include + #include #include #include // Used for cout -#ifdef SOLARIS -#include -#include -#endif - -#if defined LINUX || defined MACOSX -#include -#include -#endif - /** * Helper sleep function */ diff --git a/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp b/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp index 186afdb9471..7c3a66326c6 100644 --- a/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp +++ b/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp @@ -85,21 +85,13 @@ */ +#include + #include #include // Used for cout #include -#ifdef SOLARIS -#include -#include -#endif - -#if defined LINUX || defined MACOSX -#include -#include -#endif - /** * Helper sleep function */ diff --git a/ndb/include/debugger/SignalLoggerManager.hpp b/ndb/include/debugger/SignalLoggerManager.hpp index 3d89b399f3b..742bf7d294e 100644 --- a/ndb/include/debugger/SignalLoggerManager.hpp +++ b/ndb/include/debugger/SignalLoggerManager.hpp @@ -24,7 +24,6 @@ #define SignalLoggerManager_H -#include #include #include #include @@ -153,7 +152,7 @@ public: private: bool m_logDistributed; - int m_ownNodeId; + Uint32 m_ownNodeId; FILE * outputStream; int log(int cmd, BlockNumber bno, LogMode logMode); diff --git a/ndb/include/kernel/LogLevel.hpp b/ndb/include/kernel/LogLevel.hpp index 0902f3e488b..3363dc2befd 100644 --- a/ndb/include/kernel/LogLevel.hpp +++ b/ndb/include/kernel/LogLevel.hpp @@ -17,8 +17,7 @@ #ifndef _LOG_LEVEL_HPP #define _LOG_LEVEL_HPP -#include -#include +#include /** * diff --git a/ndb/include/kernel/signaldata/BuildIndx.hpp b/ndb/include/kernel/signaldata/BuildIndx.hpp index 9cf1123cc61..29dfaeb79a6 100644 --- a/ndb/include/kernel/signaldata/BuildIndx.hpp +++ b/ndb/include/kernel/signaldata/BuildIndx.hpp @@ -19,7 +19,6 @@ #include "SignalData.hpp" #include -#include #include /** diff --git a/ndb/include/kernel/signaldata/SignalData.hpp b/ndb/include/kernel/signaldata/SignalData.hpp index 071bd9b9104..511e7d30c21 100644 --- a/ndb/include/kernel/signaldata/SignalData.hpp +++ b/ndb/include/kernel/signaldata/SignalData.hpp @@ -17,11 +17,9 @@ #ifndef SIGNAL_DATA_H #define SIGNAL_DATA_H +#include #include #include -#include -#include -#include #ifndef NDB_ASSERT #ifdef VM_TRACE diff --git a/ndb/include/kernel/signaldata/SignalDataPrint.hpp b/ndb/include/kernel/signaldata/SignalDataPrint.hpp index 588e2893214..17ab07acd4e 100644 --- a/ndb/include/kernel/signaldata/SignalDataPrint.hpp +++ b/ndb/include/kernel/signaldata/SignalDataPrint.hpp @@ -17,8 +17,8 @@ #ifndef SIGNAL_DATA_PRINT_H #define SIGNAL_DATA_PRINT_H +#include #include -#include /** * Typedef for a Signal Data Print Function diff --git a/ndb/include/logger/FileLogHandler.hpp b/ndb/include/logger/FileLogHandler.hpp index ae69a2f5418..08e46c11844 100644 --- a/ndb/include/logger/FileLogHandler.hpp +++ b/ndb/include/logger/FileLogHandler.hpp @@ -19,7 +19,7 @@ #include "LogHandler.hpp" -class File; +class File_class; /** * Logs messages to a file. The log file will be archived depending on @@ -104,7 +104,7 @@ private: int m_maxNoFiles; long m_maxFileSize; unsigned int m_maxLogEntries; - File* m_pLogFile; + File_class* m_pLogFile; }; #endif diff --git a/ndb/include/logger/LogHandler.hpp b/ndb/include/logger/LogHandler.hpp index 8c5c9298f69..8f76783e6b0 100644 --- a/ndb/include/logger/LogHandler.hpp +++ b/ndb/include/logger/LogHandler.hpp @@ -19,7 +19,6 @@ #include "Logger.hpp" -#include // Defines NULL /** * This class is the base class for all log handlers. A log handler is diff --git a/ndb/include/logger/Logger.hpp b/ndb/include/logger/Logger.hpp index 2d12a5b8a6e..d4937c11744 100644 --- a/ndb/include/logger/Logger.hpp +++ b/ndb/include/logger/Logger.hpp @@ -17,8 +17,8 @@ #ifndef Logger_H #define Logger_H +#include #include -#include class LogHandler; class LogHandlerList; diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index c74a046b7e7..0ecb19eaa76 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -80,13 +80,13 @@ extern "C" { * NDB Cluster node types */ enum ndb_mgm_node_type { - NDB_MGM_NODE_TYPE_UNKNOWN = -1, ///< Node type not known - NDB_MGM_NODE_TYPE_API = 0, ///< An application node (API) - NDB_MGM_NODE_TYPE_NDB = 1, ///< A database node (DB) - NDB_MGM_NODE_TYPE_MGM = 2, ///< A management server node (MGM) + NDB_MGM_NODE_TYPE_UNKNOWN = -1, /*/< Node type not known*/ + NDB_MGM_NODE_TYPE_API = 0, /*/< An application node (API)*/ + NDB_MGM_NODE_TYPE_NDB = 1, /*/< A database node (DB)*/ + NDB_MGM_NODE_TYPE_MGM = 2, /*/< A management server node (MGM)*/ - NDB_MGM_NODE_TYPE_MIN = 0, ///< Min valid value - NDB_MGM_NODE_TYPE_MAX = 2 ///< Max valid value + NDB_MGM_NODE_TYPE_MIN = 0, /*/< Min valid value*/ + NDB_MGM_NODE_TYPE_MAX = 2 /*/< Max valid value*/ }; /** diff --git a/ndb/include/mgmcommon/MgmtErrorReporter.hpp b/ndb/include/mgmcommon/MgmtErrorReporter.hpp index acc44b14d8e..925d9e6407a 100644 --- a/ndb/include/mgmcommon/MgmtErrorReporter.hpp +++ b/ndb/include/mgmcommon/MgmtErrorReporter.hpp @@ -22,8 +22,8 @@ //****************************************************************************** +#include // exit #include -#include // exit #define REPORT_WARNING(message) \ ndbout << "WARNING: " << message << endl diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h new file mode 100644 index 00000000000..5e03b972268 --- /dev/null +++ b/ndb/include/ndb_global.h @@ -0,0 +1,89 @@ + +#ifndef NDBGLOBAL_H +#define NDBGLOBAL_H + +#include + +#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) +#define NDB_WIN32 +#else +#undef NDB_WIN32 +#endif + +#include +#include +#include +#include +#ifdef HAVE_STDARG_H +#include +#endif +#ifdef TIME_WITH_SYS_TIME +#include +#endif +#ifdef HAVE_FCNTL_H +#include +#endif +#include +#ifdef HAVE_SYS_STAT_H +#include +#endif +#include +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#ifdef HAVE_SYS_MMAN_H +#include +#endif + +#ifdef NDB_WIN32 +#include +#include + +#define DIR_SEPARATOR "\\" +#define PATH_MAX 256 + +#pragma warning(disable: 4503 4786) +#else + +#define DIR_SEPARATOR "/" + +#endif + +#ifdef NDB_VC98 +#define STATIC_CONST(x) enum { x } +#else +#define STATIC_CONST(x) static const Uint32 x +#endif + +#ifdef __cplusplus +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifndef HAVE_STRDUP +extern char * strdup(const char *s); +#endif + +#ifndef HAVE_STRLCPY +extern size_t strlcpy (char *dst, const char *src, size_t dst_sz); +#endif + +#ifndef HAVE_STRLCAT +extern size_t strlcat (char *dst, const char *src, size_t dst_sz); +#endif + +#ifndef HAVE_STRCASECMP +extern int strcasecmp(const char *s1, const char *s2); +extern int strncasecmp(const char *s1, const char *s2, size_t n); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/ndb/include/ndb_net.h b/ndb/include/ndb_net.h new file mode 100644 index 00000000000..279beb471a7 --- /dev/null +++ b/ndb/include/ndb_net.h @@ -0,0 +1,7 @@ + +#ifndef NDBNET_H +#define NDBNET_H + +#include + +#endif diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h index 40d73b0f230..5e7b952cfc5 100644 --- a/ndb/include/ndb_types.h +++ b/ndb/include/ndb_types.h @@ -18,11 +18,8 @@ * @file ndb_types.h */ -#ifndef SYS_TYPES_H -#define SYS_TYPES_H - -#include -#include +#ifndef NDB_TYPES_H +#define NDB_TYPES_H typedef char Int8; typedef unsigned char Uint8; @@ -36,7 +33,13 @@ typedef unsigned int UintR; #ifdef __SIZE_TYPE__ typedef __SIZE_TYPE__ UintPtr; #else +#include +#ifdef HAVE_STDINT_H #include +#endif +#ifdef HAVE_INTTYPES_H +#include +#endif typedef uintptr_t UintPtr; #endif diff --git a/ndb/include/ndb_version.h b/ndb/include/ndb_version.h index 958dd339f74..9bb6af59590 100644 --- a/ndb/include/ndb_version.h +++ b/ndb/include/ndb_version.h @@ -17,9 +17,6 @@ #ifndef NDB_VERSION_H #define NDB_VERSION_H -#include -#include - #include #define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0)) @@ -47,7 +44,7 @@ * Used by transporter and when communicating with * managment server */ -//#define NDB_VERSION_ID 0 +/*#define NDB_VERSION_ID 0*/ #endif diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp index 59bdd212919..fd6e827ceb4 100644 --- a/ndb/include/ndbapi/Ndb.hpp +++ b/ndb/include/ndbapi/Ndb.hpp @@ -860,9 +860,9 @@ #include #include -#include "AttrType.hpp" +#include #include -#include "NdbDictionary.hpp" +#include class NdbObjectIdMap; class NdbOperation; @@ -1673,7 +1673,7 @@ private: */ struct StartTransactionNodeSelectionData { StartTransactionNodeSelectionData(): - fragment2PrimaryNodeMap(NULL) {}; + fragment2PrimaryNodeMap(0) {}; Uint32 kValue; Uint32 hashValueMask; Uint32 hashpointerValue; diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp index a1532bb2f0e..c775dd5e33d 100644 --- a/ndb/include/ndbapi/NdbConnection.hpp +++ b/ndb/include/ndbapi/NdbConnection.hpp @@ -18,9 +18,8 @@ #define NdbConnection_H #include -#include "AttrType.hpp" +#include #include -#include class NdbConnection; class NdbOperation; diff --git a/ndb/include/ndbapi/NdbError.hpp b/ndb/include/ndbapi/NdbError.hpp index b08dd1041b2..8cde2a8cf38 100644 --- a/ndb/include/ndbapi/NdbError.hpp +++ b/ndb/include/ndbapi/NdbError.hpp @@ -17,6 +17,8 @@ #ifndef NDB_ERROR_HPP #define NDB_ERROR_HPP +#include + /** * @struct NdbError * @brief Contains error information @@ -51,7 +53,7 @@ struct NdbError { * The error code indicate success
* (Includes classification: NdbError::NoError) */ - Success = 0, + Success = ndberror_st_success, /** * The error code indicates a temporary error. @@ -61,7 +63,7 @@ struct NdbError { * NdbError::OverloadError, NdbError::NodeShutdown * and NdbError::TimeoutExpired.) */ - TemporaryError = 1, + TemporaryError = ndberror_st_temporary, /** * The error code indicates a permanent error.
@@ -71,14 +73,14 @@ struct NdbError { * NdbError::UserDefinedError, NdbError::InternalError, and, * NdbError::FunctionNotImplemented.) */ - PermanentError = 2, + PermanentError = ndberror_st_permanent, /** * The result/status is unknown.
* (Includes classifications: NdbError::UnknownResultError, and * NdbError::UnknownErrorCode.) */ - UnknownResult = 3 + UnknownResult = ndberror_st_unknown }; /** @@ -88,85 +90,85 @@ struct NdbError { /** * Success. No error occurred. */ - NoError = 0, + NoError = ndberror_cl_none, /** * Error in application program. */ - ApplicationError = 1, + ApplicationError = ndberror_cl_application, /** * Read operation failed due to missing record. */ - NoDataFound = 2, + NoDataFound = ndberror_cl_no_data_found, /** * E.g. inserting a tuple with a primary key already existing * in the table. */ - ConstraintViolation = 3, + ConstraintViolation = ndberror_cl_constraint_violation, /** * Error in creating table or usage of table. */ - SchemaError = 4, + SchemaError = ndberror_cl_schema_error, /** * Error occurred in interpreted program. */ - UserDefinedError = 5, + UserDefinedError = ndberror_cl_user_defined, /** * E.g. insufficient memory for data or indexes. */ - InsufficientSpace = 6, + InsufficientSpace = ndberror_cl_insufficient_space, /** * E.g. too many active transactions. */ - TemporaryResourceError = 7, + TemporaryResourceError = ndberror_cl_temporary_resource, /** * Temporary failures which are probably inflicted by a node * recovery in progress. Examples: information sent between * application and NDB lost, distribution change. */ - NodeRecoveryError = 8, + NodeRecoveryError = ndberror_cl_node_recovery, /** * E.g. out of log file space. */ - OverloadError = 9, + OverloadError = ndberror_cl_overload, /** * Timeouts, often inflicted by deadlocks in NDB. */ - TimeoutExpired = 10, + TimeoutExpired = ndberror_cl_timeout_expired, /** * Is is unknown whether the transaction was committed or not. */ - UnknownResultError = 11, + UnknownResultError = ndberror_cl_unknown_result, /** * A serious error in NDB has occurred. */ - InternalError = 12, + InternalError = ndberror_cl_internal_error, /** * A function used is not yet implemented. */ - FunctionNotImplemented = 13, + FunctionNotImplemented = ndberror_cl_function_not_implemented, /** * Error handler could not determine correct error code. */ - UnknownErrorCode = 14, + UnknownErrorCode = ndberror_cl_unknown_error_code, /** * Node shutdown */ - NodeShutdown = 15 + NodeShutdown = ndberror_cl_node_shutdown }; /** @@ -204,6 +206,22 @@ struct NdbError { message = 0; details = 0; } + NdbError(const ndberror_struct & ndberror){ + status = (NdbError::Status) ndberror.status; + classification = (NdbError::Classification) ndberror.classification; + code = ndberror.code; + message = ndberror.message; + details = ndberror.details; + } + operator ndberror_struct() const { + ndberror_struct ndberror; + ndberror.status = (ndberror_status_enum) status; + ndberror.classification = (ndberror_classification_enum) classification; + ndberror.code = code; + ndberror.message = message; + ndberror.details = details; + return ndberror; + } }; class NdbOut& operator <<(class NdbOut&, const NdbError &); diff --git a/ndb/include/ndbapi/NdbEventOperation.hpp b/ndb/include/ndbapi/NdbEventOperation.hpp index 911b00b02c4..056e9a58c74 100644 --- a/ndb/include/ndbapi/NdbEventOperation.hpp +++ b/ndb/include/ndbapi/NdbEventOperation.hpp @@ -157,8 +157,8 @@ public: * the attribute, or a NULL pointer * (indicating error). */ - NdbRecAttr *getValue(const char *anAttrName, char *aValue = NULL); - NdbRecAttr *getPreValue(const char *anAttrName, char *aValue = NULL); + NdbRecAttr *getValue(const char *anAttrName, char *aValue = 0); + NdbRecAttr *getPreValue(const char *anAttrName, char *aValue = 0); /** * Retrieves event resultset if available, inserted into the NdbRecAttrs @@ -172,7 +172,7 @@ public: * overflow and *pOverRun will indicate the number of events that have * overwritten. */ - int next(int *pOverRun=NULL); + int next(int *pOverRun=0); /** * In the current implementation a nodefailiure may cause loss of events, diff --git a/ndb/include/ndbapi/NdbOperation.hpp b/ndb/include/ndbapi/NdbOperation.hpp index 4f5f4597937..3c515fe84ef 100644 --- a/ndb/include/ndbapi/NdbOperation.hpp +++ b/ndb/include/ndbapi/NdbOperation.hpp @@ -17,14 +17,11 @@ #ifndef NdbOperation_H #define NdbOperation_H -#include -#include - #include -#include "AttrType.hpp" -#include "NdbError.hpp" -#include "NdbReceiver.hpp" -#include + +#include +#include +#include class Ndb; class NdbApiSignal; @@ -480,8 +477,8 @@ public: * the attribute, or a NULL pointer * (indicating error). */ - NdbRecAttr* getValue(const char* anAttrName, char* aValue = NULL); - NdbRecAttr* getValue(Uint32 anAttrId, char* aValue = NULL); + NdbRecAttr* getValue(const char* anAttrName, char* aValue = 0); + NdbRecAttr* getValue(Uint32 anAttrId, char* aValue = 0); /** * Define an attribute to set or update in query. @@ -925,7 +922,7 @@ protected: virtual int equal_impl(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len); - NdbRecAttr* getValue(const NdbColumnImpl* anAttrObject, char* aValue = NULL); + NdbRecAttr* getValue(const NdbColumnImpl* anAttrObject, char* aValue = 0); int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len); int incValue(const NdbColumnImpl* anAttrObject, Uint32 aValue); int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue); diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp index a5595096bf6..7eeff88671d 100644 --- a/ndb/include/ndbapi/NdbRecAttr.hpp +++ b/ndb/include/ndbapi/NdbRecAttr.hpp @@ -17,9 +17,6 @@ #ifndef NdbRecAttr_H #define NdbRecAttr_H -#include - -#include #include #include "AttrType.hpp" @@ -427,9 +424,9 @@ inline void NdbRecAttr::release() { - if (theStorageX != NULL) { + if (theStorageX != 0) { delete [] theStorageX; - theStorageX = NULL; + theStorageX = 0; } } @@ -437,10 +434,10 @@ inline void NdbRecAttr::init() { - theStorageX = NULL; - theValue = NULL; - theRef = NULL; - theNext = NULL; + theStorageX = 0; + theValue = 0; + theRef = 0; + theNext = 0; theAttrId = 0xFFFF; theNULLind = -1; } @@ -470,7 +467,7 @@ inline bool NdbRecAttr::copyoutRequired() const { - return theRef != theValue && theValue != NULL; + return theRef != theValue && theValue != 0; } inline diff --git a/ndb/include/ndbapi/NdbReceiver.hpp b/ndb/include/ndbapi/NdbReceiver.hpp index 952803f8e70..bc11207a112 100644 --- a/ndb/include/ndbapi/NdbReceiver.hpp +++ b/ndb/include/ndbapi/NdbReceiver.hpp @@ -18,7 +18,7 @@ #define NdbReceiver_H #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL // Not part of public interface -#include +#include class Ndb; class NdbReceiver diff --git a/ndb/include/ndbapi/NdbScanOperation.hpp b/ndb/include/ndbapi/NdbScanOperation.hpp index e041c79d96f..f83669fb616 100644 --- a/ndb/include/ndbapi/NdbScanOperation.hpp +++ b/ndb/include/ndbapi/NdbScanOperation.hpp @@ -172,25 +172,6 @@ SetValueRec::SetValueRec() : { } -inline -SetValueRec::~SetValueRec() -{ - if ((stype == SET_STRING_ATTR1) || - (stype == SET_INT32_ATTR1) || - (stype == SET_UINT32_ATTR1) || - (stype == SET_INT64_ATTR1) || - (stype == SET_UINT64_ATTR1) || - (stype == SET_FLOAT_ATTR1) || - (stype == SET_DOUBLE_ATTR1)) - free(anAttrName); - - if ((stype == SET_STRING_ATTR1) || - (stype == SET_STRING_ATTR2)) - free(stringStruct.aStringValue); - if (next) delete next; - next = 0; -} - class SetValueRecList { public: SetValueRecList(); diff --git a/ndb/include/ndbapi/NdbSchemaOp.hpp b/ndb/include/ndbapi/NdbSchemaOp.hpp index 90837bbc66b..c3a3827a6b4 100644 --- a/ndb/include/ndbapi/NdbSchemaOp.hpp +++ b/ndb/include/ndbapi/NdbSchemaOp.hpp @@ -18,11 +18,9 @@ #define NdbSchemaOp_H #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED -#include +#include "NdbDictionary.hpp" #include "AttrType.hpp" #include "NdbSchemaCon.hpp" -#include -#include "NdbDictionary.hpp" class NdbApiSignal; class Ndb; diff --git a/ndb/include/ndbapi/ndberror.h b/ndb/include/ndbapi/ndberror.h new file mode 100644 index 00000000000..5c2d85b82a6 --- /dev/null +++ b/ndb/include/ndbapi/ndberror.h @@ -0,0 +1,98 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NDBERROR_H +#define NDBERROR_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum +{ + ndberror_st_success = 0, + ndberror_st_temporary = 1, + ndberror_st_permanent = 2, + ndberror_st_unknown = 3 +} ndberror_status_enum; + +typedef enum +{ + ndberror_cl_none = 0, + ndberror_cl_application = 1, + ndberror_cl_no_data_found = 2, + ndberror_cl_constraint_violation = 3, + ndberror_cl_schema_error = 4, + ndberror_cl_user_defined = 5, + ndberror_cl_insufficient_space = 6, + ndberror_cl_temporary_resource = 7, + ndberror_cl_node_recovery = 8, + ndberror_cl_overload = 9, + ndberror_cl_timeout_expired = 10, + ndberror_cl_unknown_result = 11, + ndberror_cl_internal_error = 12, + ndberror_cl_function_not_implemented = 13, + ndberror_cl_unknown_error_code = 14, + ndberror_cl_node_shutdown = 15 +} ndberror_classification_enum; + + +typedef struct { + + /** + * Error status. + */ + ndberror_status_enum status; + + /** + * Error type + */ + ndberror_classification_enum classification; + + /** + * Error code + */ + int code; + + /** + * Error message + */ + const char * message; + + /** + * The detailed description. This is extra information regarding the + * error which is not included in the error message. + * + * @note Is NULL when no details specified + */ + char * details; + +} ndberror_struct; + + +typedef ndberror_status_enum ndberror_status; +typedef ndberror_classification_enum ndberror_classification; + +const char *ndberror_status_message(ndberror_status); +const char *ndberror_classification_message(ndberror_classification); +void ndberror_update(ndberror_struct *); +int ndb_error_string(int err_no, char *str, unsigned int size); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/ndb/include/newtonapi/dba.h b/ndb/include/newtonapi/dba.h index eb5b3f9b5c2..4cfc0ec8eb9 100644 --- a/ndb/include/newtonapi/dba.h +++ b/ndb/include/newtonapi/dba.h @@ -102,11 +102,9 @@ /* --- Include files ---- */ +#include #include -#include - - /* --- Types and definitions --- */ /** diff --git a/ndb/include/newtonapi/defs/pcn_types.h b/ndb/include/newtonapi/defs/pcn_types.h index a823846d7be..eae6c67899d 100644 --- a/ndb/include/newtonapi/defs/pcn_types.h +++ b/ndb/include/newtonapi/defs/pcn_types.h @@ -17,16 +17,9 @@ #ifndef PCN_TYPES_H #define PCN_TYPES_H -#include -#include +#include -#ifdef NDB_MACOSX -typedef unsigned int Size_t; -#elif defined(NDB_SPARC_64) -typedef unsigned int Size_t; -#else typedef size_t Size_t; -#endif typedef int Boolean_t; diff --git a/ndb/include/portlib/NdbMem.h b/ndb/include/portlib/NdbMem.h index 38ad3f60448..0f2de80200e 100644 --- a/ndb/include/portlib/NdbMem.h +++ b/ndb/include/portlib/NdbMem.h @@ -17,8 +17,7 @@ #ifndef NDB_MEM_H #define NDB_MEM_H -#include - +#include #ifdef __cplusplus extern "C" { diff --git a/ndb/include/portlib/NdbMutex.h b/ndb/include/portlib/NdbMutex.h index d2cb6328b03..28adaacb8c4 100644 --- a/ndb/include/portlib/NdbMutex.h +++ b/ndb/include/portlib/NdbMutex.h @@ -17,10 +17,11 @@ #ifndef NDB_MUTEX_H #define NDB_MUTEX_H +#include + #ifdef NDB_WIN32 #include #include -#include #endif #ifdef __cplusplus diff --git a/ndb/include/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h index 6e2f18b61b2..42c34855c39 100644 --- a/ndb/include/portlib/NdbTCP.h +++ b/ndb/include/portlib/NdbTCP.h @@ -17,6 +17,9 @@ #ifndef NDB_TCP_H #define NDB_TCP_H +#include +#include + #if defined NDB_OSE || defined NDB_SOFTOSE /** * Include files needed @@ -24,7 +27,6 @@ #include "inet.h" #include -#include #define NDB_NONBLOCK FNDELAY #define NDB_SOCKET_TYPE int @@ -38,65 +40,13 @@ typedef int socklen_t; #define InetErrno (* inet_errno()) -#endif +#elif NDB_WIN32 -#if defined NDB_SOLARIS || defined NDB_HPUX || defined NDB_IBMAIX || defined NDB_TRU64X -/** - * Include files needed - */ -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#define NDB_NONBLOCK O_NONBLOCK -#define NDB_SOCKET_TYPE int -#define NDB_INVALID_SOCKET -1 -#define NDB_CLOSE_SOCKET(x) close(x) - -#define InetErrno errno - -#endif - -#if defined NDB_LINUX || defined NDB_MACOSX -/** - * Include files needed - */ -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#define NDB_NONBLOCK O_NONBLOCK -#define NDB_SOCKET_TYPE int -#define NDB_INVALID_SOCKET -1 -#define NDB_CLOSE_SOCKET(x) close(x) - -#define InetErrno errno - -#endif - - -#ifdef NDB_WIN32 /** * Include files needed */ #include #include -#include #define InetErrno WSAGetLastError() #define EWOULDBLOCK WSAEWOULDBLOCK @@ -104,14 +54,23 @@ typedef int socklen_t; #define NDB_INVALID_SOCKET INVALID_SOCKET #define NDB_CLOSE_SOCKET(x) closesocket(x) -#endif - -#ifndef NDB_MACOSX -#define NDB_SOCKLEN_T socklen_t #else -#define NDB_SOCKLEN_T int + +/** + * Include files needed + */ +#include + +#define NDB_NONBLOCK O_NONBLOCK +#define NDB_SOCKET_TYPE int +#define NDB_INVALID_SOCKET -1 +#define NDB_CLOSE_SOCKET(x) close(x) + +#define InetErrno errno + #endif +#define NDB_SOCKLEN_T SOCKET_SIZE_TYPE #ifdef __cplusplus extern "C" { diff --git a/ndb/include/portlib/NdbThread.h b/ndb/include/portlib/NdbThread.h index 516022903e3..212f7de9384 100644 --- a/ndb/include/portlib/NdbThread.h +++ b/ndb/include/portlib/NdbThread.h @@ -17,8 +17,7 @@ #ifndef NDB_THREAD_H #define NDB_THREAD_H -#include - +#include #ifdef __cplusplus extern "C" { diff --git a/ndb/include/portlib/NdbTick.h b/ndb/include/portlib/NdbTick.h index 762f65331cc..9bd8eca22bd 100644 --- a/ndb/include/portlib/NdbTick.h +++ b/ndb/include/portlib/NdbTick.h @@ -42,7 +42,7 @@ NDB_TICKS NdbTick_CurrentMillisecond(void); */ int NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros); -//#define TIME_MEASUREMENT + /*#define TIME_MEASUREMENT*/ #ifdef TIME_MEASUREMENT struct MicroSecondTimer { diff --git a/ndb/include/portlib/NdbUnistd.h b/ndb/include/portlib/NdbUnistd.h deleted file mode 100644 index 42f67e2aeb3..00000000000 --- a/ndb/include/portlib/NdbUnistd.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef NDB_UNISTD_H -#define NDB_UNISTD_H - -#ifdef NDB_WIN32 -#include -#include -#include -#include - -#define DIR_SEPARATOR "\\" -#define PATH_MAX 256 - -#pragma warning(disable: 4503 4786) - -#else -#include -#include - -#define DIR_SEPARATOR "/" - -#endif - -#endif diff --git a/ndb/include/transporter/TransporterDefinitions.hpp b/ndb/include/transporter/TransporterDefinitions.hpp index 5bbf7c79491..cb859e310db 100644 --- a/ndb/include/transporter/TransporterDefinitions.hpp +++ b/ndb/include/transporter/TransporterDefinitions.hpp @@ -17,8 +17,8 @@ #ifndef TransporterDefinitions_H #define TransporterDefinitions_H +#include #include -#include #include /** diff --git a/ndb/include/util/BaseString.hpp b/ndb/include/util/BaseString.hpp index a88bd97ffc5..75a1c291594 100644 --- a/ndb/include/util/BaseString.hpp +++ b/ndb/include/util/BaseString.hpp @@ -17,9 +17,7 @@ #ifndef __UTIL_BASESTRING_HPP_INCLUDED__ #define __UTIL_BASESTRING_HPP_INCLUDED__ -#include -#include - +#include #include /** diff --git a/ndb/include/util/Bitmask.hpp b/ndb/include/util/Bitmask.hpp index 1f95d62bcb6..ed981743512 100644 --- a/ndb/include/util/Bitmask.hpp +++ b/ndb/include/util/Bitmask.hpp @@ -17,12 +17,9 @@ #ifndef NDB_BITMASK_H #define NDB_BITMASK_H -#include -#include +#include #ifndef NDB_ASSERT -#include -#include #define NDB_ASSERT(x, s) \ do { if (!(x)) { printf("%s\n", s); abort(); } } while (0) #endif diff --git a/ndb/include/util/File.hpp b/ndb/include/util/File.hpp index fe3d2642b18..3ed0ad7a6f9 100644 --- a/ndb/include/util/File.hpp +++ b/ndb/include/util/File.hpp @@ -17,8 +17,7 @@ #ifndef FILE_H #define FILE_H -#include -#include +#include /** * This class provides a file abstraction . It has operations @@ -26,7 +25,7 @@ * * @version #@ $Id: File.hpp,v 1.5 2002/04/26 13:15:38 ejonore Exp $ */ -class File +class File_class { public: /** @@ -65,7 +64,7 @@ public: /** * Default constructor. */ - File(); + File_class(); /** * Creates a new File with the specified filename and file mode. @@ -76,12 +75,12 @@ public: * @param aFileName a filename. * @param mode the mode which the file should be opened/created with, default "r". */ - File(const char* aFileName, const char* mode = "r"); + File_class(const char* aFileName, const char* mode = "r"); /** * Destructor. */ - ~File(); + ~File_class(); /** * Opens/creates the file. If open() fails then 'errno' and perror() @@ -198,9 +197,9 @@ private: char m_fileName[MAX_FILE_NAME_SIZE]; const char* m_fileMode; /* Prohibit */ - File(const File& aCopy); - File operator = (const File&); - bool operator == (const File&); + File_class (const File_class& aCopy); + File_class operator = (const File_class&); + bool operator == (const File_class&); }; #endif diff --git a/ndb/include/util/InputStream.hpp b/ndb/include/util/InputStream.hpp index 6b4cf262db4..b2a56b1e433 100644 --- a/ndb/include/util/InputStream.hpp +++ b/ndb/include/util/InputStream.hpp @@ -17,7 +17,7 @@ #ifndef INPUT_STREAM_HPP #define INPUT_STREAM_HPP -#include +#include #include /** diff --git a/ndb/include/util/NdbAutoPtr.hpp b/ndb/include/util/NdbAutoPtr.hpp index 2078714d98d..c01650ffc7e 100644 --- a/ndb/include/util/NdbAutoPtr.hpp +++ b/ndb/include/util/NdbAutoPtr.hpp @@ -17,7 +17,7 @@ #ifndef __NDB_AUTO_PTR_HPP #define __NDB_AUTO_PTR_HPP -#include +#include template class NdbAutoPtr { diff --git a/ndb/include/util/NdbString.h b/ndb/include/util/NdbString.h deleted file mode 100644 index 97646f813ac..00000000000 --- a/ndb/include/util/NdbString.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef __NDBSTRING_H_INCLUDED__ -#define __NDBSTRING_H_INCLUDED__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef HAVE_STRDUP -extern char * strdup(const char *s); -#endif - -#ifndef HAVE_STRLCPY -extern size_t strlcpy (char *dst, const char *src, size_t dst_sz); -#endif - -#ifndef HAVE_STRLCAT -extern size_t strlcat (char *dst, const char *src, size_t dst_sz); -#endif - -#ifndef HAVE_STRCASECMP -extern int strcasecmp(const char *s1, const char *s2); -extern int strncasecmp(const char *s1, const char *s2, size_t n); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* !__NDBSTRING_H_INCLUDED__ */ diff --git a/ndb/include/util/OutputStream.hpp b/ndb/include/util/OutputStream.hpp index 9d33ead7eb9..c7e009d4537 100644 --- a/ndb/include/util/OutputStream.hpp +++ b/ndb/include/util/OutputStream.hpp @@ -17,7 +17,7 @@ #ifndef OUTPUT_STREAM_HPP #define OUTPUT_STREAM_HPP -#include +#include #include /** diff --git a/ndb/include/util/Properties.hpp b/ndb/include/util/Properties.hpp index dbdc5f2b480..ff5d1338c79 100644 --- a/ndb/include/util/Properties.hpp +++ b/ndb/include/util/Properties.hpp @@ -17,10 +17,7 @@ #ifndef PROPERTIES_HPP #define PROPERTIES_HPP -#include -#include -#include -#include +#include #include #include diff --git a/ndb/include/util/SimpleProperties.hpp b/ndb/include/util/SimpleProperties.hpp index 37e28ea91d8..d5ebb16bb09 100644 --- a/ndb/include/util/SimpleProperties.hpp +++ b/ndb/include/util/SimpleProperties.hpp @@ -17,8 +17,7 @@ #ifndef SIMPLE_PROPERTIES_HPP #define SIMPLE_PROPERTIES_HPP -#include -#include // offsetof +#include #include /** diff --git a/ndb/include/util/UtilBuffer.hpp b/ndb/include/util/UtilBuffer.hpp index 97821ee3f9b..b357fa0fdf2 100644 --- a/ndb/include/util/UtilBuffer.hpp +++ b/ndb/include/util/UtilBuffer.hpp @@ -17,9 +17,7 @@ #ifndef __BUFFER_HPP_INCLUDED__ #define __BUFFER_HPP_INCLUDED__ -#include -#include -#include +#include /* This class represents a buffer of binary data, where you can append * data at the end, and later read the entire bunch. diff --git a/ndb/include/util/Vector.hpp b/ndb/include/util/Vector.hpp index a717dfecd7e..f60817dab67 100644 --- a/ndb/include/util/Vector.hpp +++ b/ndb/include/util/Vector.hpp @@ -17,9 +17,8 @@ #ifndef NDB_VECTOR_HPP #define NDB_VECTOR_HPP -#include +#include #include -#include template struct Vector { diff --git a/ndb/include/util/getarg.h b/ndb/include/util/getarg.h index 713cf6e4b32..03ed25f6828 100644 --- a/ndb/include/util/getarg.h +++ b/ndb/include/util/getarg.h @@ -52,7 +52,7 @@ #ifndef __GETARG_H__ #define __GETARG_H__ -#include +#include #ifdef __cplusplus extern "C" { diff --git a/ndb/include/util/socket_io.h b/ndb/include/util/socket_io.h index bbd1bf115ae..a0e6c4e369d 100644 --- a/ndb/include/util/socket_io.h +++ b/ndb/include/util/socket_io.h @@ -17,8 +17,9 @@ #ifndef _SOCKET_IO_H #define _SOCKET_IO_H +#include + #include -#include #ifdef __cplusplus extern "C" { diff --git a/ndb/include/util/uucode.h b/ndb/include/util/uucode.h index 138a79fa3ae..f5569d033a5 100644 --- a/ndb/include/util/uucode.h +++ b/ndb/include/util/uucode.h @@ -17,7 +17,7 @@ #ifndef UUCODE_H #define UUCODE_H -#include +#include #ifdef __cplusplus extern "C" { diff --git a/ndb/src/client/odbc/common/Ctx.cpp b/ndb/src/client/odbc/common/Ctx.cpp index 85edbd1a63f..44689657788 100644 --- a/ndb/src/client/odbc/common/Ctx.cpp +++ b/ndb/src/client/odbc/common/Ctx.cpp @@ -14,11 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#include +#include #include #include #include "DiagArea.hpp" diff --git a/ndb/src/client/odbc/common/DataField.cpp b/ndb/src/client/odbc/common/DataField.cpp index 5853f90c08f..dfd4137ffd9 100644 --- a/ndb/src/client/odbc/common/DataField.cpp +++ b/ndb/src/client/odbc/common/DataField.cpp @@ -14,14 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#include -#include +#include #include "DataField.hpp" -#include #ifndef INT_MAX #define INT_MAX (2147483647) diff --git a/ndb/src/client/odbc/common/DataType.cpp b/ndb/src/client/odbc/common/DataType.cpp index 62bd622b9b5..9c9629f1d24 100644 --- a/ndb/src/client/odbc/common/DataType.cpp +++ b/ndb/src/client/odbc/common/DataType.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "DataType.hpp" -#include // SqlType diff --git a/ndb/src/client/odbc/common/OdbcData.cpp b/ndb/src/client/odbc/common/OdbcData.cpp index d2402c7e0ab..2e1bd768aec 100644 --- a/ndb/src/client/odbc/common/OdbcData.cpp +++ b/ndb/src/client/odbc/common/OdbcData.cpp @@ -14,9 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include #include "OdbcData.hpp" OdbcData::OdbcData() : diff --git a/ndb/src/common/debugger/DebuggerNames.cpp b/ndb/src/common/debugger/DebuggerNames.cpp index fdee978ab54..ebe94a6059f 100644 --- a/ndb/src/common/debugger/DebuggerNames.cpp +++ b/ndb/src/common/debugger/DebuggerNames.cpp @@ -14,16 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "DebuggerNames.hpp" #include #include #include -#include -#include -#include - static const char * localSignalNames[MAX_GSN+1]; static SignalDataPrintFunction localPrintFunctions[MAX_GSN+1]; static const char * localBlockNames[NO_OF_BLOCKS]; diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index 12f01890c54..dd957d67383 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "EventLogger.hpp" #include @@ -22,10 +24,6 @@ #include #include #include -#include - -#include -#include // // PUBLIC diff --git a/ndb/src/common/debugger/SignalLoggerManager.cpp b/ndb/src/common/debugger/SignalLoggerManager.cpp index ae6edd5ed71..3839a348222 100644 --- a/ndb/src/common/debugger/SignalLoggerManager.cpp +++ b/ndb/src/common/debugger/SignalLoggerManager.cpp @@ -14,15 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "SignalLoggerManager.hpp" #include -#include -#include -#include -#include -#include - #include SignalLoggerManager::SignalLoggerManager() diff --git a/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp b/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp index 11ee0948c17..84410a2b2db 100644 --- a/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp +++ b/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include diff --git a/ndb/src/common/debugger/signaldata/ContinueB.cpp b/ndb/src/common/debugger/signaldata/ContinueB.cpp index 054909d961e..1be6da86cb1 100644 --- a/ndb/src/common/debugger/signaldata/ContinueB.cpp +++ b/ndb/src/common/debugger/signaldata/ContinueB.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include diff --git a/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp b/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp index 6685345f17a..027f743b5ea 100644 --- a/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp +++ b/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp @@ -26,7 +26,7 @@ printCREATE_FRAGMENTATION_REQ(FILE * output, const Uint32 * theData, fprintf(output, " noOfFragments: %x\n", sig->noOfFragments); fprintf(output, " fragmentNode: %x\n", sig->fragmentNode); if (sig->primaryTableId == RNIL) - fprintf(output, " primaryTableId: none\n", sig->primaryTableId); + fprintf(output, " primaryTableId: none\n"); else fprintf(output, " primaryTableId: %x\n", sig->primaryTableId); return true; diff --git a/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp b/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp index f3b4b97f0fd..2e900de8f70 100644 --- a/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp +++ b/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include diff --git a/ndb/src/common/debugger/signaldata/SystemError.cpp b/ndb/src/common/debugger/signaldata/SystemError.cpp index 5ed7dc6b18d..549c34710a0 100644 --- a/ndb/src/common/debugger/signaldata/SystemError.cpp +++ b/ndb/src/common/debugger/signaldata/SystemError.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include diff --git a/ndb/src/common/editline/editline.c b/ndb/src/common/editline/editline.c index 0529d18b952..1e4c1ecba76 100644 --- a/ndb/src/common/editline/editline.c +++ b/ndb/src/common/editline/editline.c @@ -19,10 +19,10 @@ ** ** Main editing routines for editline library. */ +#include + #include "editline_internal.h" #include -#include -#include /* ** Manifest constants. diff --git a/ndb/src/common/editline/editline_internal.h b/ndb/src/common/editline/editline_internal.h index 93c13e55edc..5ed2b32a873 100644 --- a/ndb/src/common/editline/editline_internal.h +++ b/ndb/src/common/editline/editline_internal.h @@ -19,9 +19,8 @@ ** Internal header file for editline library. */ -#include -#include -#include +#include + #if defined(SYS_UNIX) #include "unix.h" #endif /* defined(SYS_UNIX) */ diff --git a/ndb/src/common/editline/editline_win32.c b/ndb/src/common/editline/editline_win32.c index feef0108523..5083edb7fae 100644 --- a/ndb/src/common/editline/editline_win32.c +++ b/ndb/src/common/editline/editline_win32.c @@ -15,8 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include char* readline(const char* prompt) diff --git a/ndb/src/common/editline/test/testit.c b/ndb/src/common/editline/test/testit.c index 9a7dfb7bbdf..4058f8ae660 100644 --- a/ndb/src/common/editline/test/testit.c +++ b/ndb/src/common/editline/test/testit.c @@ -20,11 +20,7 @@ ** A "micro-shell" to test editline library. ** If given any arguments, commands aren't executed. */ -#include -#include -#include - -#include +#include #include int diff --git a/ndb/src/common/editline/unix.h b/ndb/src/common/editline/unix.h index 582c4888856..37f461b471d 100644 --- a/ndb/src/common/editline/unix.h +++ b/ndb/src/common/editline/unix.h @@ -21,6 +21,5 @@ #define CRLF "\r\n" -#include -#include +#include #include diff --git a/ndb/src/common/logger/FileLogHandler.cpp b/ndb/src/common/logger/FileLogHandler.cpp index f3d547b4fe7..d13dd7b2a78 100644 --- a/ndb/src/common/logger/FileLogHandler.cpp +++ b/ndb/src/common/logger/FileLogHandler.cpp @@ -14,16 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "FileLogHandler.hpp" +#include #include -#include -#include - -#include -#include - // // PUBLIC // @@ -35,7 +29,7 @@ FileLogHandler::FileLogHandler() : m_maxLogEntries(MAX_LOG_ENTRIES) { - m_pLogFile = new File("logger.log", "a+"); + m_pLogFile = new File_class("logger.log", "a+"); } FileLogHandler::FileLogHandler(const char* aFileName, @@ -47,7 +41,7 @@ FileLogHandler::FileLogHandler(const char* aFileName, m_maxFileSize(maxFileSize), m_maxLogEntries(maxLogEntries) { - m_pLogFile = new File(aFileName, "a+"); + m_pLogFile = new File_class(aFileName, "a+"); } FileLogHandler::~FileLogHandler() @@ -166,10 +160,10 @@ FileLogHandler::createNewFile() ::snprintf(newName, sizeof(newName), "%s.%d", m_pLogFile->getName(), fileNo++); - } while (File::exists(newName)); + } while (File_class::exists(newName)); m_pLogFile->close(); - if (!File::rename(m_pLogFile->getName(), newName)) + if (!File_class::rename(m_pLogFile->getName(), newName)) { setErrorCode(errno); rc = false; @@ -201,7 +195,7 @@ FileLogHandler::setFilename(const BaseString &filename) { close(); if(m_pLogFile) delete m_pLogFile; - m_pLogFile = new File(filename.c_str(), "a+"); + m_pLogFile = new File_class(filename.c_str(), "a+"); open(); return true; }; diff --git a/ndb/src/common/logger/LogHandler.cpp b/ndb/src/common/logger/LogHandler.cpp index d1445555e87..83d479c82fd 100644 --- a/ndb/src/common/logger/LogHandler.cpp +++ b/ndb/src/common/logger/LogHandler.cpp @@ -17,9 +17,6 @@ #include "LogHandler.hpp" #include -#include - -#include // // PUBLIC diff --git a/ndb/src/common/logger/LogHandlerList.cpp b/ndb/src/common/logger/LogHandlerList.cpp index f020ad23e56..62495d7566b 100644 --- a/ndb/src/common/logger/LogHandlerList.cpp +++ b/ndb/src/common/logger/LogHandlerList.cpp @@ -17,8 +17,6 @@ #include "LogHandlerList.hpp" #include -#include -#include // // PUBLIC diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp index 6eaafd91854..9c9f1eece18 100644 --- a/ndb/src/common/logger/Logger.cpp +++ b/ndb/src/common/logger/Logger.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include "Logger.hpp" @@ -27,12 +27,6 @@ #include #endif -#include -#include -#include - -#include - // // PUBLIC // diff --git a/ndb/src/common/logger/SysLogHandler.cpp b/ndb/src/common/logger/SysLogHandler.cpp index f3511bf5638..a300c487eb9 100644 --- a/ndb/src/common/logger/SysLogHandler.cpp +++ b/ndb/src/common/logger/SysLogHandler.cpp @@ -17,7 +17,6 @@ #include "SysLogHandler.hpp" #include -#include // // PUBLIC diff --git a/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp b/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp index 22f67d15659..44ee11717b4 100644 --- a/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp +++ b/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "LogHandlerListUnitTest.hpp" #include @@ -22,9 +24,6 @@ #include -#include -#include - typedef bool (*TESTFUNC)(const char*); typedef struct { diff --git a/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp b/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp index 4b0241a0b03..017dcb79c1f 100644 --- a/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp +++ b/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp @@ -25,12 +25,8 @@ #endif #include -#include #include -#include -#include - typedef bool (*TESTFUNC)(const char*); typedef struct { diff --git a/ndb/src/common/mgmcommon/Config.hpp b/ndb/src/common/mgmcommon/Config.hpp index 1314abe004a..284256d9ed6 100644 --- a/ndb/src/common/mgmcommon/Config.hpp +++ b/ndb/src/common/mgmcommon/Config.hpp @@ -23,9 +23,7 @@ #include #include -#include #include -#include #include /** diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp index a3f26454df6..04dc5466bbc 100644 --- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -14,6 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include #include "LocalConfig.hpp" @@ -21,21 +24,15 @@ #include #include -#include -#include #include #include "MgmtErrorReporter.hpp" #include #include -#include -#include -#include #include #include -#include //**************************************************************************** //**************************************************************************** diff --git a/ndb/src/common/mgmcommon/InitConfigFileParser.cpp b/ndb/src/common/mgmcommon/InitConfigFileParser.cpp index 33652fa472c..62c4bd28857 100644 --- a/ndb/src/common/mgmcommon/InitConfigFileParser.cpp +++ b/ndb/src/common/mgmcommon/InitConfigFileParser.cpp @@ -14,16 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "InitConfigFileParser.hpp" -#include -#include #include "Config.hpp" #include "MgmtErrorReporter.hpp" #include #include "ConfigInfo.hpp" -#include -#include -#include const int MAX_LINE_LENGTH = 120; // Max length of line of text in config file static void trim(char *); diff --git a/ndb/src/common/mgmcommon/InitConfigFileParser.hpp b/ndb/src/common/mgmcommon/InitConfigFileParser.hpp index 1e85067396c..f4f27abb055 100644 --- a/ndb/src/common/mgmcommon/InitConfigFileParser.hpp +++ b/ndb/src/common/mgmcommon/InitConfigFileParser.hpp @@ -17,7 +17,8 @@ #ifndef InitConfigFileParser_H #define InitConfigFileParser_H -#include +#include + #include class Config; diff --git a/ndb/src/common/mgmcommon/LocalConfig.hpp b/ndb/src/common/mgmcommon/LocalConfig.hpp index ec7b572e92d..eb676bf9bed 100644 --- a/ndb/src/common/mgmcommon/LocalConfig.hpp +++ b/ndb/src/common/mgmcommon/LocalConfig.hpp @@ -17,10 +17,8 @@ #ifndef LocalConfig_H #define LocalConfig_H -#include -#include +#include #include -#include //**************************************************************************** // Description: The class LocalConfig corresponds to the information possible diff --git a/ndb/src/common/mgmcommon/NdbConfig.c b/ndb/src/common/mgmcommon/NdbConfig.c index b12d9fcfaf9..827ef34a840 100644 --- a/ndb/src/common/mgmcommon/NdbConfig.c +++ b/ndb/src/common/mgmcommon/NdbConfig.c @@ -14,10 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include -#include -#include const char* NdbConfig_HomePath(char* buf, int buflen){ diff --git a/ndb/src/common/mgmcommon/printConfig/printConfig.cpp b/ndb/src/common/mgmcommon/printConfig/printConfig.cpp index 7260a84ce7a..daa287cc44d 100644 --- a/ndb/src/common/mgmcommon/printConfig/printConfig.cpp +++ b/ndb/src/common/mgmcommon/printConfig/printConfig.cpp @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include #include -#include #include void usage(const char * prg){ diff --git a/ndb/src/common/portlib/Makefile b/ndb/src/common/portlib/Makefile index a928fc1e6d7..48f4929a839 100644 --- a/ndb/src/common/portlib/Makefile +++ b/ndb/src/common/portlib/Makefile @@ -4,38 +4,16 @@ DIRS := ifeq ($(NDB_OS), SOFTOSE) DIRS += ose -endif - +else ifeq ($(NDB_OS), OSE) DIRS += ose -endif - -ifeq ($(NDB_OS), SIMCELLO) -DIRS += ose -endif - -ifeq ($(NDB_OS), LINUX) -DIRS += unix -endif - -ifeq ($(NDB_OS), MACOSX) -DIRS += unix -endif - -ifeq ($(NDB_OS), SOLARIS) -DIRS += unix -endif - -ifeq ($(NDB_OS), SOLARIS6) -DIRS += unix -endif - -ifeq ($(NDB_OS), HPUX) -DIRS += unix -endif - +else ifeq ($(NDB_OS), WIN32) DIRS += win32 +else +DIRS += unix +endif +endif endif diff --git a/ndb/src/common/portlib/memtest/memtest.c b/ndb/src/common/portlib/memtest/memtest.c index d23235b7aa2..059a4ec025e 100644 --- a/ndb/src/common/portlib/memtest/memtest.c +++ b/ndb/src/common/portlib/memtest/memtest.c @@ -16,10 +16,8 @@ -#include -#include -#include -#include +#include + long long getMilli(); long long getMicro(); void malloctest(int loopcount, int memsize, int touch); diff --git a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp b/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp index 9e396cd98ee..b1d84131810 100644 --- a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp +++ b/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp @@ -17,6 +17,8 @@ +#include + #include #include #include @@ -27,13 +29,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include - struct ThreadData { diff --git a/ndb/src/common/portlib/mmstest/mmslist.cpp b/ndb/src/common/portlib/mmstest/mmslist.cpp index bd00211445c..05538785293 100644 --- a/ndb/src/common/portlib/mmstest/mmslist.cpp +++ b/ndb/src/common/portlib/mmstest/mmslist.cpp @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include #include #include #include -#include -#include #include /** diff --git a/ndb/src/common/portlib/mmstest/mmstest.cpp b/ndb/src/common/portlib/mmstest/mmstest.cpp index 6ebb5064aaf..9cc7d810985 100644 --- a/ndb/src/common/portlib/mmstest/mmstest.cpp +++ b/ndb/src/common/portlib/mmstest/mmstest.cpp @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include "NdbThread.h" #include #include -#include - NDB_COMMAND(ndbmem, "ndbmem", "ndbmem", "Test the ndbmem functionality", 4096){ ndbout << "Starting test of NdbMem" << endl; diff --git a/ndb/src/common/portlib/ose/NdbCondition.c b/ndb/src/common/portlib/ose/NdbCondition.c index 2ab6e49006b..73a2dbc5d66 100644 --- a/ndb/src/common/portlib/ose/NdbCondition.c +++ b/ndb/src/common/portlib/ose/NdbCondition.c @@ -17,7 +17,6 @@ #include "NdbCondition.h" #include -#include #include #include diff --git a/ndb/src/common/portlib/ose/NdbMem.c b/ndb/src/common/portlib/ose/NdbMem.c index 6d922e4c073..0e38024bbb4 100644 --- a/ndb/src/common/portlib/ose/NdbMem.c +++ b/ndb/src/common/portlib/ose/NdbMem.c @@ -17,7 +17,6 @@ #include "NdbMem.h" -#include #if defined NDB_OSE #include @@ -134,7 +133,6 @@ int NdbMem_MemUnlockAll(){ } #else -#include #include diff --git a/ndb/src/common/portlib/ose/NdbMutex.c b/ndb/src/common/portlib/ose/NdbMutex.c index 859ddefd536..253c0e412ff 100644 --- a/ndb/src/common/portlib/ose/NdbMutex.c +++ b/ndb/src/common/portlib/ose/NdbMutex.c @@ -19,7 +19,6 @@ #include #include -#include NdbMutex* NdbMutex_Create(void) diff --git a/ndb/src/common/portlib/ose/NdbOut.cpp b/ndb/src/common/portlib/ose/NdbOut.cpp index 0ee12249ff5..eb81bc9d971 100644 --- a/ndb/src/common/portlib/ose/NdbOut.cpp +++ b/ndb/src/common/portlib/ose/NdbOut.cpp @@ -14,12 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NdbOut.hpp" -#include -#include -#include -#include +#include +#include "NdbOut.hpp" #if defined NDB_SOFTOSE #include diff --git a/ndb/src/common/portlib/ose/NdbThread.c b/ndb/src/common/portlib/ose/NdbThread.c index 41a5f181c40..e46903a5cce 100644 --- a/ndb/src/common/portlib/ose/NdbThread.c +++ b/ndb/src/common/portlib/ose/NdbThread.c @@ -18,7 +18,6 @@ #include "NdbThread.h" #include #include -#include #include #include diff --git a/ndb/src/common/portlib/test/NdbPortLibTest.cpp b/ndb/src/common/portlib/test/NdbPortLibTest.cpp index 8a5c8f4a878..55b9ccec5f2 100644 --- a/ndb/src/common/portlib/test/NdbPortLibTest.cpp +++ b/ndb/src/common/portlib/test/NdbPortLibTest.cpp @@ -20,7 +20,7 @@ * TODO - Add tests for NdbMem */ - +#include #include "NdbOut.hpp" #include "NdbThread.h" @@ -32,11 +32,6 @@ #include "NdbHost.h" #include "NdbMain.h" -#include -#include -#include -#include - int TestHasFailed; int verbose = 0; diff --git a/ndb/src/common/portlib/unix/NdbCondition.c b/ndb/src/common/portlib/unix/NdbCondition.c index 35b80821052..1d229bdcdef 100644 --- a/ndb/src/common/portlib/unix/NdbCondition.c +++ b/ndb/src/common/portlib/unix/NdbCondition.c @@ -15,16 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#if defined NDB_MACOSX -#include -#else -#include -#endif +#include +#include +#include #include struct NdbCondition @@ -67,8 +61,6 @@ NdbCondition_Wait(struct NdbCondition* p_cond, return result; } -#if defined NDB_SOLARIS || defined NDB_HPUX -#include int NdbCondition_WaitTimeout(struct NdbCondition* p_cond, NdbMutex* p_mutex, @@ -80,7 +72,16 @@ NdbCondition_WaitTimeout(struct NdbCondition* p_cond, if (p_cond == NULL || p_mutex == NULL) return 1; +#ifdef HAVE_CLOCK_GETTIME clock_gettime(CLOCK_REALTIME, &abstime); +#else + { + struct timeval tick_time; + gettimeofday(&tick_time, 0); + abstime.tv_sec = tick_time.tv_sec; + abstime.tv_nsec = tick_time.tv_usec * 1000; + } +#endif if(msecs >= 1000){ secs = msecs / 1000; @@ -98,45 +99,6 @@ NdbCondition_WaitTimeout(struct NdbCondition* p_cond, return result; } -#endif - -#if defined NDB_LINUX || defined NDB_MACOSX -#include -#include - -int -NdbCondition_WaitTimeout(struct NdbCondition* p_cond, - NdbMutex* p_mutex, - int msecs){ - int result; - struct timespec abstime; - struct timeval tick_time; - int secs = 0; - - if (p_cond == NULL || p_mutex == NULL) - return 1; - - gettimeofday(&tick_time, 0); - - if(msecs >= 1000){ - secs = msecs / 1000; - msecs = msecs % 1000; - } - - - abstime.tv_sec = tick_time.tv_sec + secs; - abstime.tv_nsec = tick_time.tv_usec * 1000 + msecs * 1000000; - if (abstime.tv_nsec >= 1000000000) { - abstime.tv_sec += 1; - abstime.tv_nsec -= 1000000000; - } - - result = pthread_cond_timedwait(&p_cond->cond, p_mutex, &abstime); - - return result; -} -#endif - int NdbCondition_Signal(struct NdbCondition* p_cond){ diff --git a/ndb/src/common/portlib/unix/NdbDaemon.c b/ndb/src/common/portlib/unix/NdbDaemon.c index fc114266c9d..186331a4dab 100644 --- a/ndb/src/common/portlib/unix/NdbDaemon.c +++ b/ndb/src/common/portlib/unix/NdbDaemon.c @@ -14,40 +14,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "NdbDaemon.h" -#include - -#ifdef NDB_LINUX -#include -#include -#include -#include -#include -#include -#include -#endif - -#ifdef NDB_SOLARIS -#include -#include -#include -#include -#include -#include -#include -#endif #define NdbDaemon_ErrorSize 500 -#if defined(NDB_LINUX) || defined(NDB_SOLARIS) long NdbDaemon_DaemonPid; int NdbDaemon_ErrorCode; char NdbDaemon_ErrorText[NdbDaemon_ErrorSize]; -#endif + int NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) { - /* XXX fix other unixes */ -#if defined(NDB_LINUX) || defined(NDB_SOLARIS) int lockfd = -1, logfd = -1, n; char buf[64]; @@ -149,11 +126,21 @@ NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) dup2(logfd, 2); close(logfd); } -#endif /* Success */ return 0; } +#if 0 +int +NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) +{ + /* Fail */ + snprintf(NdbDaemon_ErrorText, NdbDaemon_ErrorSize, + "Daemon mode not implemented"); + return -1; +} +#endif + #ifdef NDB_DAEMON_TEST int diff --git a/ndb/src/common/portlib/unix/NdbEnv.c b/ndb/src/common/portlib/unix/NdbEnv.c index b01e3b239ca..d294e0b52ca 100644 --- a/ndb/src/common/portlib/unix/NdbEnv.c +++ b/ndb/src/common/portlib/unix/NdbEnv.c @@ -15,9 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NdbEnv.h" -#include -#include +#include + +#include const char* NdbEnv_GetEnv(const char* name, char * buf, int buflen) { diff --git a/ndb/src/common/portlib/unix/NdbHost.c b/ndb/src/common/portlib/unix/NdbHost.c index 8d2a23fccda..4749bb39ea7 100644 --- a/ndb/src/common/portlib/unix/NdbHost.c +++ b/ndb/src/common/portlib/unix/NdbHost.c @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "NdbHost.h" -#include int NdbHost_GetHostName(char* buf) { diff --git a/ndb/src/common/portlib/unix/NdbMem.c b/ndb/src/common/portlib/unix/NdbMem.c index 3b47494967f..0b06e5b23f1 100644 --- a/ndb/src/common/portlib/unix/NdbMem.c +++ b/ndb/src/common/portlib/unix/NdbMem.c @@ -15,14 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NdbMem.h" +#include -#include -#include -#include -#ifndef NDB_MACOSX -#include -#endif +#include void NdbMem_Create() { @@ -59,19 +54,18 @@ void NdbMem_Free(void* ptr) int NdbMem_MemLockAll(){ -#if defined NDB_MACOSX - return 0; -#else - //return mlockall(MCL_CURRENT | MCL_FUTURE); +#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) return mlockall(MCL_CURRENT); +#else + return -1; #endif } int NdbMem_MemUnlockAll(){ -#if defined NDB_MACOSX - return 0; -#else +#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) return munlockall(); +#else + return -1; #endif } diff --git a/ndb/src/common/portlib/unix/NdbMutex.c b/ndb/src/common/portlib/unix/NdbMutex.c index 3cadc0667e7..50f314d2683 100644 --- a/ndb/src/common/portlib/unix/NdbMutex.c +++ b/ndb/src/common/portlib/unix/NdbMutex.c @@ -15,11 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NdbMutex.h" +#include -#include -#include -#include +#include +#include NdbMutex* NdbMutex_Create(void) { diff --git a/ndb/src/common/portlib/unix/NdbSleep.c b/ndb/src/common/portlib/unix/NdbSleep.c index 35132d7f9c7..8702a25d1b1 100644 --- a/ndb/src/common/portlib/unix/NdbSleep.c +++ b/ndb/src/common/portlib/unix/NdbSleep.c @@ -15,19 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "NdbSleep.h" - -#ifdef NDB_SOLARIS -#include -#include -#endif - -#if defined NDB_LINUX || defined NDB_HPUX || defined NDB_MACOSX -#include -#include -#endif - int NdbSleep_MilliSleep(int milliseconds){ int result = 0; diff --git a/ndb/src/common/portlib/unix/NdbTCP.c b/ndb/src/common/portlib/unix/NdbTCP.c index c2613c211c5..287dc6c2ecd 100644 --- a/ndb/src/common/portlib/unix/NdbTCP.c +++ b/ndb/src/common/portlib/unix/NdbTCP.c @@ -15,10 +15,36 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "NdbTCP.h" +#ifdef NDB_WIN32 +static NdbMutex & LOCK_gethostbyname = * NdbMutex_Create(); +#else +static NdbMutex LOCK_gethostbyname = NDB_MUTEX_INITIALIZER; +#endif -#ifdef NDB_SOLARIS +int +Ndb_getInAddr(struct in_addr * dst, const char *address) { + struct hostent * hostPtr; + NdbMutex_Lock(&LOCK_gethostbyname); + hostPtr = gethostbyname(address); + if (hostPtr != NULL) { + dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr; + NdbMutex_Unlock(&LOCK_gethostbyname); + return 0; + } + NdbMutex_Unlock(&LOCK_gethostbyname); + + /* Try it as aaa.bbb.ccc.ddd. */ + dst->s_addr = inet_addr(address); + if (dst->s_addr != -1) { + return 0; + } + return -1; +} + +#if 0 int Ndb_getInAddr(struct in_addr * dst, const char *address) { struct hostent host, * hostPtr; @@ -38,23 +64,3 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) { return -1; } #endif - -#if defined NDB_LINUX || defined NDB_HPUX || defined NDB_MACOSX -int -Ndb_getInAddr(struct in_addr * dst, const char *address) { - struct hostent * hostPtr; - hostPtr = gethostbyname(address); - if (hostPtr != NULL) { - dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr; - return 0; - } - - /* Try it as aaa.bbb.ccc.ddd. */ - dst->s_addr = inet_addr(address); - if (dst->s_addr != -1) { - return 0; - } - return -1; -} -#endif - diff --git a/ndb/src/common/portlib/unix/NdbThread.c b/ndb/src/common/portlib/unix/NdbThread.c index 3665c4c9159..a5c42f79be8 100644 --- a/ndb/src/common/portlib/unix/NdbThread.c +++ b/ndb/src/common/portlib/unix/NdbThread.c @@ -15,16 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NdbThread.h" +#include +#include #include -#ifdef NDB_MACOSX -#include -#else -#include -#endif -#include -#include -#include #define MAX_THREAD_NAME 16 @@ -94,7 +87,7 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status) if (p_wait_thread == NULL) return 0; - if (p_wait_thread->thread == NULL) + if (p_wait_thread->thread == 0) return 0; result = pthread_join(p_wait_thread->thread, status); diff --git a/ndb/src/common/portlib/unix/NdbTick.c b/ndb/src/common/portlib/unix/NdbTick.c index 5adb4ec80c2..d8f0b6ec27a 100644 --- a/ndb/src/common/portlib/unix/NdbTick.c +++ b/ndb/src/common/portlib/unix/NdbTick.c @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "NdbTick.h" -#include #define NANOSEC_PER_SEC 1000000000 #define MICROSEC_PER_SEC 1000000 @@ -25,7 +25,7 @@ #define MILLISEC_PER_NANOSEC 1000000 -#if defined NDB_SOLARIS || NDB_HPUX +#ifdef HAVE_CLOCK_GETTIME NDB_TICKS NdbTick_CurrentMillisecond(void) { struct timespec tick_time; @@ -44,11 +44,7 @@ NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros){ * micros = t.tv_nsec / 1000; return res; } -#endif - -#if defined NDB_LINUX || NDB_MACOSX -#include -#include +#else NDB_TICKS NdbTick_CurrentMillisecond(void) { struct timeval tick_time; @@ -99,12 +95,12 @@ NdbTick_getMicrosPassed(struct MicroSecondTimer start, ret_value = ((NDB_TICKS)MICROSEC_PER_SEC) * sec_passed; } else if (start.seconds > stop.seconds) { return ret_value; - }//if + } if (start.micro_seconds < stop.micro_seconds) { ret_value += (stop.micro_seconds - start.micro_seconds); } else if (ret_value != (NDB_TICKS)0) { ret_value -= (start.micro_seconds - stop.micro_seconds); - }//if + } return ret_value; } #endif diff --git a/ndb/src/common/portlib/win32/NdbCondition.c b/ndb/src/common/portlib/win32/NdbCondition.c index 12b508cf33b..77869b673de 100644 --- a/ndb/src/common/portlib/win32/NdbCondition.c +++ b/ndb/src/common/portlib/win32/NdbCondition.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include "NdbCondition.h" diff --git a/ndb/src/common/portlib/win32/NdbDaemon.c b/ndb/src/common/portlib/win32/NdbDaemon.c index b96d4c20260..972fb1b88d8 100644 --- a/ndb/src/common/portlib/win32/NdbDaemon.c +++ b/ndb/src/common/portlib/win32/NdbDaemon.c @@ -14,6 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "NdbDaemon.h" #define NdbDaemon_ErrorSize 500 @@ -24,8 +25,10 @@ char NdbDaemon_ErrorText[NdbDaemon_ErrorSize]; int NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) { - // XXX do something - return 0; + /* Fail */ + snprintf(NdbDaemon_ErrorText, NdbDaemon_ErrorSize, + "Daemon mode not implemented"); + return -1; } #ifdef NDB_DAEMON_TEST diff --git a/ndb/src/common/portlib/win32/NdbMem.c b/ndb/src/common/portlib/win32/NdbMem.c index 274dc31353f..ab7123b0a29 100644 --- a/ndb/src/common/portlib/win32/NdbMem.c +++ b/ndb/src/common/portlib/win32/NdbMem.c @@ -16,8 +16,6 @@ #include -#include -#include #include "NdbMem.h" diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/win32/NdbMutex.c index c93384d91db..e797024d5bb 100644 --- a/ndb/src/common/portlib/win32/NdbMutex.c +++ b/ndb/src/common/portlib/win32/NdbMutex.c @@ -19,7 +19,6 @@ #include #include #include -#include #include "NdbMutex.h" diff --git a/ndb/src/common/portlib/win32/NdbThread.c b/ndb/src/common/portlib/win32/NdbThread.c index ae3c74be70d..1f052f034e8 100644 --- a/ndb/src/common/portlib/win32/NdbThread.c +++ b/ndb/src/common/portlib/win32/NdbThread.c @@ -17,7 +17,6 @@ #include #include -#include #include "NdbThread.h" diff --git a/ndb/src/common/transporter/Makefile b/ndb/src/common/transporter/Makefile index 3bd23b627d3..372bf640566 100644 --- a/ndb/src/common/transporter/Makefile +++ b/ndb/src/common/transporter/Makefile @@ -10,7 +10,6 @@ DIRS := basictest perftest SOURCES = \ Transporter.cpp \ SendBuffer.cpp \ - SHM_Transporter.cpp \ TCP_Transporter.cpp \ TransporterRegistry.cpp \ Packer.cpp @@ -20,37 +19,19 @@ DIRS := basictest perftest CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/kernel) \ -I$(call fixpath,$(NDB_TOP)/include/transporter) + +ifeq ($(NDB_SHM), Y) +SOURCES += SHM_Transporter.cpp ifeq ($(NDB_OS), WIN32) SOURCES += SHM_Transporter.win32.cpp -endif - -ifeq ($(NDB_OS), SOLARIS) +else SOURCES += SHM_Transporter.unix.cpp endif - -ifeq ($(NDB_OS), HPUX) -SOURCES += SHM_Transporter.unix.cpp endif -ifeq ($(NDB_OS), MACOSX) -SOURCES += SHM_Transporter.unix.cpp -endif - -ifeq ($(NDB_OS), IBMAIX) -SOURCES += SHM_Transporter.unix.cpp -endif - -ifeq ($(NDB_OS), TRU64X) -SOURCES += SHM_Transporter.unix.cpp -endif - -ifeq ($(NDB_OS), LINUX) -SOURCES += SHM_Transporter.unix.cpp ifeq ($(NDB_SCI), Y) SOURCES += SCI_Transporter.cpp endif -endif - ifneq ($(findstring OSE, $(NDB_OS)),) SOURCES += OSE_Transporter.cpp diff --git a/ndb/src/common/transporter/OSE_Receiver.cpp b/ndb/src/common/transporter/OSE_Receiver.cpp index 558dee92d8d..b7d47b2f88c 100644 --- a/ndb/src/common/transporter/OSE_Receiver.cpp +++ b/ndb/src/common/transporter/OSE_Receiver.cpp @@ -20,7 +20,6 @@ #include "TransporterCallback.hpp" #include #include "TransporterInternalDefinitions.hpp" -#include OSE_Receiver::OSE_Receiver(TransporterRegistry * tr, int _recBufSize, diff --git a/ndb/src/common/transporter/OSE_Transporter.cpp b/ndb/src/common/transporter/OSE_Transporter.cpp index a7a5ed81ce2..c9b0f777319 100644 --- a/ndb/src/common/transporter/OSE_Transporter.cpp +++ b/ndb/src/common/transporter/OSE_Transporter.cpp @@ -23,11 +23,9 @@ #include -#include #include #include #include -#include OSE_Transporter::OSE_Transporter(int _prioASignalSize, int _prioBSignalSize, diff --git a/ndb/src/common/transporter/Packer.cpp b/ndb/src/common/transporter/Packer.cpp index 77bd66d1ba9..fa72af12dac 100644 --- a/ndb/src/common/transporter/Packer.cpp +++ b/ndb/src/common/transporter/Packer.cpp @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "Packer.hpp" #include #include #include -#include - Uint32 TransporterRegistry::unpack(Uint32 * readPtr, Uint32 sizeOfData, diff --git a/ndb/src/common/transporter/SCI_Transporter.cpp b/ndb/src/common/transporter/SCI_Transporter.cpp index 2be857e8115..c52c8a9d8c0 100644 --- a/ndb/src/common/transporter/SCI_Transporter.cpp +++ b/ndb/src/common/transporter/SCI_Transporter.cpp @@ -14,17 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "SCI_Transporter.hpp" -#include #include #include #include -#include #include -#if 0 -#include -#include -#endif + #include "TransporterInternalDefinitions.hpp" #include diff --git a/ndb/src/common/transporter/SHM_Buffer.hpp b/ndb/src/common/transporter/SHM_Buffer.hpp index 43250853fee..32e59dd57a2 100644 --- a/ndb/src/common/transporter/SHM_Buffer.hpp +++ b/ndb/src/common/transporter/SHM_Buffer.hpp @@ -17,10 +17,9 @@ #ifndef SHM_BUFFER_HPP #define SHM_BUFFER_HPP -#include -#include +#include + #include -#include /** * These classes implement a circular buffer diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index f18b775efa4..7c673f93c22 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -15,18 +15,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "SHM_Transporter.hpp" #include "TransporterInternalDefinitions.hpp" #include #include #include -#include -#include - -#ifdef NDB_WIN32 -#include -#else +#ifndef NDB_WIN32 #include #include #endif diff --git a/ndb/src/common/transporter/SHM_Transporter.unix.cpp b/ndb/src/common/transporter/SHM_Transporter.unix.cpp index 975c1191aea..afbf124432e 100644 --- a/ndb/src/common/transporter/SHM_Transporter.unix.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.unix.cpp @@ -15,15 +15,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "SHM_Transporter.hpp" #include "TransporterInternalDefinitions.hpp" #include #include #include -#include - - #include #include diff --git a/ndb/src/common/transporter/SHM_Transporter.win32.cpp b/ndb/src/common/transporter/SHM_Transporter.win32.cpp index 4ba52c9179d..c289a85da0e 100644 --- a/ndb/src/common/transporter/SHM_Transporter.win32.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.win32.cpp @@ -15,14 +15,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "SHM_Transporter.hpp" #include "TransporterInternalDefinitions.hpp" #include #include #include -#include - #include diff --git a/ndb/src/common/transporter/SendBuffer.hpp b/ndb/src/common/transporter/SendBuffer.hpp index 75ef0708e83..63a01f3de24 100644 --- a/ndb/src/common/transporter/SendBuffer.hpp +++ b/ndb/src/common/transporter/SendBuffer.hpp @@ -33,10 +33,9 @@ #include "TransporterDefinitions.hpp" #include -#include #ifdef DEBUG_TRANSPORTER -#include +#include #endif class SendBuffer { diff --git a/ndb/src/common/transporter/TCP_Transporter.cpp b/ndb/src/common/transporter/TCP_Transporter.cpp index 8a7d1741636..99b6a137797 100644 --- a/ndb/src/common/transporter/TCP_Transporter.cpp +++ b/ndb/src/common/transporter/TCP_Transporter.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include "TCP_Transporter.hpp" #include @@ -23,13 +25,9 @@ #if defined NDB_OSE || defined NDB_SOFTOSE #define inet_send inet_send #else -#include #define inet_send send #endif -#include - - #ifdef NDB_WIN32 class ndbstrerror { diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp index 1e19a8375ba..5ca523d5185 100644 --- a/ndb/src/common/transporter/Transporter.cpp +++ b/ndb/src/common/transporter/Transporter.cpp @@ -17,7 +17,6 @@ #include "Transporter.hpp" #include "TransporterInternalDefinitions.hpp" -#include #include Transporter::Transporter(NodeId lNodeId, NodeId rNodeId, diff --git a/ndb/src/common/transporter/TransporterInternalDefinitions.hpp b/ndb/src/common/transporter/TransporterInternalDefinitions.hpp index 18d54ca1e89..624b495422f 100644 --- a/ndb/src/common/transporter/TransporterInternalDefinitions.hpp +++ b/ndb/src/common/transporter/TransporterInternalDefinitions.hpp @@ -21,39 +21,18 @@ #include #endif -#ifdef NDB_SOLARIS #define NDB_TCP_TRANSPORTER -//#define NDB_SCI_TRANSPORTER + +#ifdef HAVE_NDB_SHM #define NDB_SHM_TRANSPORTER -#elif defined NDB_OSE || defined NDB_SOFTOSE -#define NDB_TCP_TRANSPORTER -#define NDB_OSE_TRANSPORTER -#elif defined NDB_LINUX -#define NDB_TCP_TRANSPORTER -#define NDB_SCI_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#elif defined NDB_WIN32 -#define NDB_TCP_TRANSPORTER -#elif defined NDB_HPUX -#define NDB_TCP_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#elif defined NDB_MACOSX -#define NDB_TCP_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#elif defined NDB_IBMAIX -#define NDB_TCP_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#elif defined NDB_TRU64X -#define NDB_TCP_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#else -#error unsupported platform #endif -#ifndef HAVE_SCI -#ifdef NDB_SCI_TRANSPORTER -#undef NDB_SCI_TRANSPORTER +#ifdef HAVE_NDB_SCI +#define NDB_SCI_TRANSPORTER #endif + +#ifdef HAVE_NDB_OSE +#define NDB_OSE_TRANSPORTER #endif #ifdef DEBUG_TRANSPORTER diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index dcd957f40ce..3f98eeed89e 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -14,14 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "TransporterRegistry.hpp" #include "TransporterInternalDefinitions.hpp" #include "Transporter.hpp" -#include -#include - #ifdef NDB_TCP_TRANSPORTER #include "TCP_Transporter.hpp" #endif diff --git a/ndb/src/common/transporter/basictest/basicTransporterTest.cpp b/ndb/src/common/transporter/basictest/basicTransporterTest.cpp index 5d8186badb8..c0a437c4907 100644 --- a/ndb/src/common/transporter/basictest/basicTransporterTest.cpp +++ b/ndb/src/common/transporter/basictest/basicTransporterTest.cpp @@ -14,18 +14,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "TransporterRegistry.hpp" #include "TransporterDefinitions.hpp" #include "TransporterCallback.hpp" #include -#include -#include #include #include #include #include -#include int basePortTCP = 17000; diff --git a/ndb/src/common/transporter/buddy.cpp b/ndb/src/common/transporter/buddy.cpp index c65aad1df2c..dc25e2dc66c 100644 --- a/ndb/src/common/transporter/buddy.cpp +++ b/ndb/src/common/transporter/buddy.cpp @@ -15,9 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "buddy.hpp" -#include -#include - void Chunk256::setFree(bool free){ // Bit 0 of allocationTimeStamp represents if the segment is free or not diff --git a/ndb/src/common/transporter/buddy.hpp b/ndb/src/common/transporter/buddy.hpp index 7272ac884ec..f720e9e61a1 100644 --- a/ndb/src/common/transporter/buddy.hpp +++ b/ndb/src/common/transporter/buddy.hpp @@ -17,8 +17,7 @@ #ifndef BUDDY_H #define BUDDY_H -#include -#include +#include typedef unsigned int Uint32; typedef unsigned short Uint16; diff --git a/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp b/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp index 03ce7ea6df3..803029ee565 100644 --- a/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp +++ b/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp @@ -14,17 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include + #include "sisci_types.h" #include "sisci_api.h" #include "sisci_error.h" //#include "sisci_demolib.h" -#include -#include #include -#include "NdbSleep.h" +#include #define NO_CALLBACK NULL #define NO_FLAGS 0 #define DATA_TRANSFER_READY 8 diff --git a/ndb/src/common/transporter/perftest/perfTransporterTest.cpp b/ndb/src/common/transporter/perftest/perfTransporterTest.cpp index 6d7f7083a48..d33221c2835 100644 --- a/ndb/src/common/transporter/perftest/perfTransporterTest.cpp +++ b/ndb/src/common/transporter/perftest/perfTransporterTest.cpp @@ -14,18 +14,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "TransporterRegistry.hpp" #include "TransporterDefinitions.hpp" #include "TransporterCallback.hpp" #include -#include -#include #include #include #include #include -#include int basePortTCP = 17000; diff --git a/ndb/src/common/transporter/priotest/prioTransporterTest.cpp b/ndb/src/common/transporter/priotest/prioTransporterTest.cpp index 919cc9d7511..0fce6aaad39 100644 --- a/ndb/src/common/transporter/priotest/prioTransporterTest.cpp +++ b/ndb/src/common/transporter/priotest/prioTransporterTest.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "TransporterRegistry.hpp" #include "TransporterDefinitions.hpp" #include "TransporterCallback.hpp" @@ -21,8 +23,6 @@ #include "prioTransporterTest.hpp" -#include -#include #include #include #include diff --git a/ndb/src/common/util/Base64.cpp b/ndb/src/common/util/Base64.cpp index 5f4bbc8645a..482d0b10ad2 100644 --- a/ndb/src/common/util/Base64.cpp +++ b/ndb/src/common/util/Base64.cpp @@ -14,8 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" diff --git a/ndb/src/common/util/BaseString.cpp b/ndb/src/common/util/BaseString.cpp index 1b0eaa1b83c..d15249adf72 100644 --- a/ndb/src/common/util/BaseString.cpp +++ b/ndb/src/common/util/BaseString.cpp @@ -15,11 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* -*- c-basic-offset: 4; -*- */ -#include -#include -#include -#include "BaseString.hpp" -#include +#include +#include BaseString::BaseString() { @@ -340,7 +337,6 @@ BaseString::trim(char * str, const char * delim){ #ifdef TEST_BASE_STRING -#include /* g++ -g -Wall -o tbs -DTEST_BASE_STRING -I$NDB_TOP/include/util \ diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp index ad72b41835d..22d262a0d27 100644 --- a/ndb/src/common/util/File.cpp +++ b/ndb/src/common/util/File.cpp @@ -14,16 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include -#include -#include -#include - -#if defined NDB_OSE || defined NDB_SOFTOSE -#include -#endif - #include // @@ -31,7 +25,7 @@ // bool -File::exists(const char* aFileName) +File_class::exists(const char* aFileName) { bool rc = true; @@ -56,7 +50,7 @@ File::exists(const char* aFileName) } long -File::size(FILE* f) +File_class::size(FILE* f) { long cur_pos = 0, length = 0; @@ -69,23 +63,23 @@ File::size(FILE* f) } bool -File::rename(const char* currFileName, const char* newFileName) +File_class::rename(const char* currFileName, const char* newFileName) { return ::rename(currFileName, newFileName) == 0 ? true : false; } bool -File::remove(const char* aFileName) +File_class::remove(const char* aFileName) { return ::remove(aFileName) == 0 ? true : false; } -File::File() : +File_class::File_class() : m_file(NULL), m_fileMode("r") { } -File::File(const char* aFileName, const char* mode) : +File_class::File_class(const char* aFileName, const char* mode) : m_file(NULL), m_fileMode(mode) { @@ -93,13 +87,13 @@ File::File(const char* aFileName, const char* mode) : } bool -File::open() +File_class::open() { return open(m_fileName, m_fileMode); } bool -File::open(const char* aFileName, const char* mode) +File_class::open(const char* aFileName, const char* mode) { if(m_fileName != aFileName){ /** @@ -116,21 +110,21 @@ File::open(const char* aFileName, const char* mode) return rc; } -File::~File() +File_class::~File_class() { close(); } bool -File::remove() +File_class::remove() { // Close the file first! close(); - return File::remove(m_fileName); + return File_class::remove(m_fileName); } bool -File::close() +File_class::close() { bool rc = true; if (m_file != NULL) @@ -144,55 +138,55 @@ File::close() } int -File::read(void* buf, size_t itemSize, size_t nitems) const +File_class::read(void* buf, size_t itemSize, size_t nitems) const { return ::fread(buf, itemSize, nitems, m_file); } int -File::readChar(char* buf, long start, long length) const +File_class::readChar(char* buf, long start, long length) const { return ::fread((void*)&buf[start], 1, length, m_file); } int -File::readChar(char* buf) +File_class::readChar(char* buf) { return readChar(buf, 0, strlen(buf)); } int -File::write(const void* buf, size_t size, size_t nitems) +File_class::write(const void* buf, size_t size, size_t nitems) { return ::fwrite(buf, size, nitems, m_file); } int -File::writeChar(const char* buf, long start, long length) +File_class::writeChar(const char* buf, long start, long length) { return ::fwrite((const void*)&buf[start], sizeof(char), length, m_file); } int -File::writeChar(const char* buf) +File_class::writeChar(const char* buf) { return writeChar(buf, 0, ::strlen(buf)); } long -File::size() const +File_class::size() const { - return File::size(m_file); + return File_class::size(m_file); } const char* -File::getName() const +File_class::getName() const { return m_fileName; } int -File::flush() const +File_class::flush() const { #if defined NDB_OSE || defined NDB_SOFTOSE ::fflush(m_file); diff --git a/ndb/src/common/util/InputStream.cpp b/ndb/src/common/util/InputStream.cpp index c52b594225d..410e9a70e9c 100644 --- a/ndb/src/common/util/InputStream.cpp +++ b/ndb/src/common/util/InputStream.cpp @@ -15,10 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "InputStream.hpp" #include -#include -#include FileInputStream Stdin(stdin); diff --git a/ndb/src/common/util/Makefile b/ndb/src/common/util/Makefile index b3e33704266..e8ca2b87c20 100644 --- a/ndb/src/common/util/Makefile +++ b/ndb/src/common/util/Makefile @@ -18,15 +18,7 @@ endif ifeq ($(NDB_OS), OSE) SOURCES += NdbErrHnd.cpp endif -ifdef NDB_STRDUP - SOURCES.c += strdup.c -endif -ifdef NDB_STRLCAT - SOURCES.c += strlcat.c -endif -ifdef NDB_STRLCPY - SOURCES.c += strlcpy.c -endif + SOURCES.c += strdup.c strlcat.c strlcpy.c DIRS := testSimpleProperties diff --git a/ndb/src/common/util/NdbErrHnd.cpp b/ndb/src/common/util/NdbErrHnd.cpp index 53df5d702ca..f1c28a7bbdd 100644 --- a/ndb/src/common/util/NdbErrHnd.cpp +++ b/ndb/src/common/util/NdbErrHnd.cpp @@ -18,7 +18,6 @@ #if defined NDB_OSE || defined NDB_SOFTOSE #include -#include #include #include "ose.h" diff --git a/ndb/src/common/util/NdbOut.cpp b/ndb/src/common/util/NdbOut.cpp index 2624bfa04bd..6d76cf22402 100644 --- a/ndb/src/common/util/NdbOut.cpp +++ b/ndb/src/common/util/NdbOut.cpp @@ -14,11 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NdbOut.hpp" -#include -#include -#include -#include +#include + +#include #include static FileOutputStream ndbouts_fileoutputstream(stdout); diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp index dba7012cc0f..e91ade374cf 100644 --- a/ndb/src/common/util/NdbSqlUtil.cpp +++ b/ndb/src/common/util/NdbSqlUtil.cpp @@ -286,7 +286,6 @@ NdbSqlUtil::cmpTimespec(const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 #ifdef NDB_SQL_UTIL_TEST -#include #include #include diff --git a/ndb/src/common/util/OutputStream.cpp b/ndb/src/common/util/OutputStream.cpp index 1143fe00fd1..bf3599dbac9 100644 --- a/ndb/src/common/util/OutputStream.cpp +++ b/ndb/src/common/util/OutputStream.cpp @@ -15,8 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include -#include #include FileOutputStream::FileOutputStream(FILE * file){ diff --git a/ndb/src/common/util/Parser.cpp b/ndb/src/common/util/Parser.cpp index d5c23fe14c1..2e8120f88ce 100644 --- a/ndb/src/common/util/Parser.cpp +++ b/ndb/src/common/util/Parser.cpp @@ -15,14 +15,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "Parser.hpp" -#include #include -#include #include -#include #include +#undef DEBUG #define DEBUG(x) ndbout << x << endl; static void trim(char * str); diff --git a/ndb/src/common/util/Properties.cpp b/ndb/src/common/util/Properties.cpp index 4841d6e5e9e..2ab008142ba 100644 --- a/ndb/src/common/util/Properties.cpp +++ b/ndb/src/common/util/Properties.cpp @@ -14,14 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include -#include -#include -#include -#include - #include /** diff --git a/ndb/src/common/util/SimpleProperties.cpp b/ndb/src/common/util/SimpleProperties.cpp index a118478ba6c..c3980f03c4d 100644 --- a/ndb/src/common/util/SimpleProperties.cpp +++ b/ndb/src/common/util/SimpleProperties.cpp @@ -14,12 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include -#include -#include #include #include -#include #include bool diff --git a/ndb/src/common/util/SocketServer.cpp b/ndb/src/common/util/SocketServer.cpp index 39f46eceed9..a0ec0aaa676 100644 --- a/ndb/src/common/util/SocketServer.cpp +++ b/ndb/src/common/util/SocketServer.cpp @@ -15,17 +15,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "SocketServer.hpp" #include -#include #include #include #include -#include -#include - #define DEBUG(x) ndbout << x << endl; SocketServer::SocketServer(int maxSessions) : diff --git a/ndb/src/common/util/filetest/FileUnitTest.cpp b/ndb/src/common/util/filetest/FileUnitTest.cpp index ebcca26d3d2..b6e7b7e8ec0 100644 --- a/ndb/src/common/util/filetest/FileUnitTest.cpp +++ b/ndb/src/common/util/filetest/FileUnitTest.cpp @@ -18,7 +18,6 @@ #include #include -#include typedef bool (*TESTFUNC)(const char*); diff --git a/ndb/src/common/util/getarg.c b/ndb/src/common/util/getarg.c index 5f792437a65..ae016746987 100644 --- a/ndb/src/common/util/getarg.c +++ b/ndb/src/common/util/getarg.c @@ -32,18 +32,8 @@ * SUCH DAMAGE. */ -#include +#include -#ifdef HAVE_CONFIG_H -#include -RCSID("$KTH: getarg.c,v 1.23 2000/09/01 21:25:54 lha Exp $"); -#endif - -#include -#include -#include -#include -#include #include "getarg.h" #define ISFLAG(X) ((X).type == arg_flag || (X).type == arg_negative_flag) @@ -407,12 +397,12 @@ arg_match_long(struct getargs *args, size_t num_args, } case arg_string: { - *(char**)current->value = optarg + 1; + *(char**)current->value = (char*)optarg + 1; return 0; } case arg_strings: { - add_string((getarg_strings*)current->value, optarg + 1); + add_string((getarg_strings*)current->value, (char*)optarg + 1); return 0; } case arg_flag: diff --git a/ndb/src/common/util/new.cpp b/ndb/src/common/util/new.cpp index a0709a3fa13..889e83edf6f 100644 --- a/ndb/src/common/util/new.cpp +++ b/ndb/src/common/util/new.cpp @@ -1,6 +1,5 @@ -#include -#include +#include extern "C" { void (* ndb_new_handler)() = 0; diff --git a/ndb/src/common/util/random.c b/ndb/src/common/util/random.c index 91da19572e2..286ab093a26 100644 --- a/ndb/src/common/util/random.c +++ b/ndb/src/common/util/random.c @@ -18,16 +18,8 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include -#include -#include +#include -#ifndef NDB_WIN32 -#include -#endif - -#include #include #include diff --git a/ndb/src/common/util/socket_io.cpp b/ndb/src/common/util/socket_io.cpp index 878a9059512..8def7ebe91b 100644 --- a/ndb/src/common/util/socket_io.cpp +++ b/ndb/src/common/util/socket_io.cpp @@ -14,13 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include -#include -#include -#include #include -#include extern "C" int diff --git a/ndb/src/common/util/strdup.c b/ndb/src/common/util/strdup.c index 5291be86b0f..afe2306427e 100644 --- a/ndb/src/common/util/strdup.c +++ b/ndb/src/common/util/strdup.c @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #ifndef HAVE_STRDUP char * diff --git a/ndb/src/common/util/strlcat.c b/ndb/src/common/util/strlcat.c index ccff15da27f..aa282abe48d 100644 --- a/ndb/src/common/util/strlcat.c +++ b/ndb/src/common/util/strlcat.c @@ -31,17 +31,13 @@ * SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include +#include /* RCSID("$KTH: strlcat.c,v 1.1 2000/08/16 01:23:47 lha Exp $"); */ -//#include #ifndef HAVE_STRLCAT + size_t strlcat (char *dst, const char *src, size_t dst_sz) { diff --git a/ndb/src/common/util/strlcpy.c b/ndb/src/common/util/strlcpy.c index 9a3048081ca..97cff177d48 100644 --- a/ndb/src/common/util/strlcpy.c +++ b/ndb/src/common/util/strlcpy.c @@ -31,20 +31,12 @@ * SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include +#include /* RCSID("$KTH: strlcpy.c,v 1.1 2000/08/16 01:23:48 lha Exp $"); */ #ifndef HAVE_STRLCPY -#ifdef NDB_WIN32 -#include -#endif - size_t strlcpy (char *dst, const char *src, size_t dst_sz) { diff --git a/ndb/src/common/util/testProperties/testProperties.cpp b/ndb/src/common/util/testProperties/testProperties.cpp index 4a2999b89c1..3aa2af92c5b 100644 --- a/ndb/src/common/util/testProperties/testProperties.cpp +++ b/ndb/src/common/util/testProperties/testProperties.cpp @@ -14,10 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "Properties.hpp" #include -#include -#include #include "uucode.h" diff --git a/ndb/src/common/util/testSimpleProperties/sp_test.cpp b/ndb/src/common/util/testSimpleProperties/sp_test.cpp index d6dbe2a1502..d4052b64132 100644 --- a/ndb/src/common/util/testSimpleProperties/sp_test.cpp +++ b/ndb/src/common/util/testSimpleProperties/sp_test.cpp @@ -14,10 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "SimpleProperties.hpp" #include -#include -#include Uint32 page[8192]; diff --git a/ndb/src/common/util/uucode.c b/ndb/src/common/util/uucode.c index f862d982204..da34d565153 100644 --- a/ndb/src/common/util/uucode.c +++ b/ndb/src/common/util/uucode.c @@ -15,8 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include /* ENC is the basic 1 character encoding function to make a char printing */ /* DEC is single character decode */ diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index 2ff10f51932..10f621d5db8 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -14,9 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include #include #include @@ -61,7 +59,7 @@ struct NdbUpGradeCompatible { UG_MatchType matchType; }; -//#define TEST_VERSION +/*#define TEST_VERSION*/ #ifndef TEST_VERSION struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { @@ -74,7 +72,7 @@ struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = { void ndbSetOwnVersion() {} -#else // testing purposes +#else /* testing purposes */ struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { { MAKE_VERSION(4,1,5), MAKE_VERSION(4,1,0), UG_Range }, @@ -122,7 +120,7 @@ ndbGetOwnVersion() { #ifndef TEST_VERSION return NDB_VERSION_D; -#else // testing purposes +#else /* testing purposes */ if (ndbOwnVersionTesting == 0) return NDB_VERSION_D; else diff --git a/ndb/src/cw/cpcc-win32/C++/StdAfx.h b/ndb/src/cw/cpcc-win32/C++/StdAfx.h index d84b5811f8d..370d04fb466 100644 --- a/ndb/src/cw/cpcc-win32/C++/StdAfx.h +++ b/ndb/src/cw/cpcc-win32/C++/StdAfx.h @@ -48,15 +48,12 @@ #include // C RunTime Header Files -#include -#include +#include #include #include #include #include #include -#include -#include // Local Header Files #include "resource.h" diff --git a/ndb/src/cw/cpcd/APIService.cpp b/ndb/src/cw/cpcd/APIService.cpp index 9cf17addcc2..caf19ddba0e 100644 --- a/ndb/src/cw/cpcd/APIService.cpp +++ b/ndb/src/cw/cpcd/APIService.cpp @@ -23,7 +23,6 @@ #include "APIService.hpp" #include "CPCD.hpp" #include -#include #include /** diff --git a/ndb/src/cw/cpcd/CPCD.cpp b/ndb/src/cw/cpcd/CPCD.cpp index 8864ccf6e4e..f2878b7dea1 100644 --- a/ndb/src/cw/cpcd/CPCD.cpp +++ b/ndb/src/cw/cpcd/CPCD.cpp @@ -15,11 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include -#include -#include -#include #include "APIService.hpp" #include "CPCD.hpp" diff --git a/ndb/src/cw/cpcd/Monitor.cpp b/ndb/src/cw/cpcd/Monitor.cpp index a96f3509ee8..2935cd0a648 100644 --- a/ndb/src/cw/cpcd/Monitor.cpp +++ b/ndb/src/cw/cpcd/Monitor.cpp @@ -14,9 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include -#include #include #include "CPCD.hpp" diff --git a/ndb/src/cw/cpcd/Process.cpp b/ndb/src/cw/cpcd/Process.cpp index a54c6b8e475..74426306a88 100644 --- a/ndb/src/cw/cpcd/Process.cpp +++ b/ndb/src/cw/cpcd/Process.cpp @@ -14,13 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include -#include -#include -#include #include #include @@ -28,10 +25,9 @@ #include "CPCD.hpp" #include -#include -#include -#include +#ifdef HAVE_GETRLIMIT #include +#endif void CPCD::Process::print(FILE * f){ @@ -108,12 +104,12 @@ bool CPCD::Process::isRunning() { if(m_pid <= 1){ - logger.critical("isRunning(%d) invalid pid: %d", m_id, m_pid); + //logger.critical("isRunning(%d) invalid pid: %d", m_id, m_pid); return false; } /* Check if there actually exists a process with such a pid */ errno = 0; - int s = kill((pid_t) m_pid, 0); /* Sending "signal" 0 to a process only + int s = kill((pid_t)-m_pid, 0); /* Sending "signal" 0 to a process only * checkes if the process actually exists */ if(s != 0) { switch(errno) { @@ -130,7 +126,6 @@ CPCD::Process::isRunning() { } return false; } - return true; } @@ -152,7 +147,6 @@ CPCD::Process::readPid() { f = fopen(filename, "r"); if(f == NULL){ - logger.debug("readPid - %s not found", filename); return -1; /* File didn't exist */ } @@ -213,6 +207,7 @@ setup_environment(const char *env) { static int set_ulimit(const BaseString & pair){ +#ifdef HAVE_GETRLIMIT errno = 0; do { Vector list; @@ -220,42 +215,43 @@ set_ulimit(const BaseString & pair){ if(list.size() != 2){ break; } - - int resource = 0; + + int res; rlim_t value = RLIM_INFINITY; if(!(list[1].trim() == "unlimited")){ value = atoi(list[1].c_str()); } + + struct rlimit rlp; +#define _RLIMIT_FIX(x) { res = getrlimit(x,&rlp); if(!res){ rlp.rlim_cur = value; res = setrlimit(x, &rlp); }} + if(list[0].trim() == "c"){ - resource = RLIMIT_CORE; + _RLIMIT_FIX(RLIMIT_CORE); } else if(list[0] == "d"){ - resource = RLIMIT_DATA; + _RLIMIT_FIX(RLIMIT_DATA); } else if(list[0] == "f"){ - resource = RLIMIT_FSIZE; + _RLIMIT_FIX(RLIMIT_FSIZE); } else if(list[0] == "n"){ - resource = RLIMIT_NOFILE; + _RLIMIT_FIX(RLIMIT_NOFILE); } else if(list[0] == "s"){ - resource = RLIMIT_STACK; + _RLIMIT_FIX(RLIMIT_STACK); } else if(list[0] == "t"){ - resource = RLIMIT_CPU; + _RLIMIT_FIX(RLIMIT_CPU); } else { errno = EINVAL; break; } - struct rlimit rlp; - if(getrlimit(resource, &rlp) != 0){ + if(!res) break; - } - - rlp.rlim_cur = value; - if(setrlimit(resource, &rlp) != 0){ - break; - } + return 0; } while(false); logger.error("Unable to process ulimit: %s(%s)", pair.c_str(), strerror(errno)); return -1; +#else + return 0; // Maybe it's ok anyway... +#endif } void @@ -360,8 +356,8 @@ CPCD::Process::start() { */ switch(pid = fork()) { case 0: /* Child */ - - writePid(getpid()); + setsid(); + writePid(getpgrp()); if(runas(m_runas.c_str()) == 0){ do_exec(); } @@ -386,14 +382,13 @@ CPCD::Process::start() { switch(fork()) { case 0: /* Child */ signal(SIGCHLD, SIG_IGN); - pid_t pid; switch(pid = fork()) { case 0: /* Child */ - writePid(getpid()); + setsid(); + writePid(getpgrp()); if(runas(m_runas.c_str()) != 0){ _exit(1); } - setsid(); do_exec(); _exit(1); /* NOTREACHED */ @@ -424,15 +419,18 @@ CPCD::Process::start() { logger.critical("Unknown process type"); return -1; } - + while(readPid() < 0){ sched_yield(); } - - if(pid != -1 && pid != m_pid){ - logger.error("pid and m_pid don't match: %d %d", pid, m_pid); + + errno = 0; + pid_t pgid = getpgid(pid); + + if(pgid != -1 && pgid != m_pid){ + logger.error("pgid and m_pid don't match: %d %d (%d)", pgid, m_pid, pid); } - + if(isRunning()){ m_status = RUNNING; return 0; @@ -449,33 +447,36 @@ CPCD::Process::stop() { unlink(filename); if(m_pid <= 1){ - logger.critical("Stopping process with bogus pid: %d", m_pid); + logger.critical("Stopping process with bogus pid: %d id: %d", + m_pid, m_id); return; } m_status = STOPPING; - - int ret = kill((pid_t)m_pid, SIGTERM); + + errno = 0; + int ret = kill(-m_pid, SIGTERM); switch(ret) { case 0: - logger.debug("Sent SIGTERM to pid %d", (int)m_pid); + logger.debug("Sent SIGTERM to pid %d", (int)-m_pid); break; default: - logger.debug("kill pid: %d : %s", (int)m_pid, strerror(errno)); + logger.debug("kill pid: %d : %s", (int)-m_pid, strerror(errno)); break; } - + if(isRunning()){ - ret = kill((pid_t)m_pid, SIGKILL); + errno = 0; + ret = kill(-m_pid, SIGKILL); switch(ret) { case 0: - logger.debug("Sent SIGKILL to pid %d", (int)m_pid); + logger.debug("Sent SIGKILL to pid %d", (int)-m_pid); break; default: - logger.debug("kill pid: %d : %s\n", (int)m_pid, strerror(errno)); + logger.debug("kill pid: %d : %s\n", (int)-m_pid, strerror(errno)); break; } - } - + } + m_pid = -1; m_status = STOPPED; } diff --git a/ndb/src/cw/cpcd/common.cpp b/ndb/src/cw/cpcd/common.cpp index 731866b22fd..cb1c0c37183 100644 --- a/ndb/src/cw/cpcd/common.cpp +++ b/ndb/src/cw/cpcd/common.cpp @@ -14,11 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "common.hpp" #include #include -#include -#include #include #include @@ -152,7 +152,10 @@ parse_config_file(struct getargs args[], int num_arg, const Properties& p){ break; } } - if(!found) + if(!found) { printf("Unknown parameter: %s\n", name); + return 1; + } } + return 0; } diff --git a/ndb/src/cw/cpcd/common.hpp b/ndb/src/cw/cpcd/common.hpp index 65fcce05f66..c3d87b8b9f5 100644 --- a/ndb/src/cw/cpcd/common.hpp +++ b/ndb/src/cw/cpcd/common.hpp @@ -17,7 +17,7 @@ #ifndef __CPCD_COMMON_HPP_INCLUDED__ #define __CPCD_COMMON_HPP_INCLUDED__ -#include +#include #include #include diff --git a/ndb/src/cw/cpcd/main.cpp b/ndb/src/cw/cpcd/main.cpp index 8dd4f2b4608..11f6238d5f7 100644 --- a/ndb/src/cw/cpcd/main.cpp +++ b/ndb/src/cw/cpcd/main.cpp @@ -14,9 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include /* Needed for mkdir(2) */ -#include /* Needed for mkdir(2) */ -#include +#include /* Needed for mkdir(2) */ #include #include "CPCD.hpp" diff --git a/ndb/src/cw/test/socketclient/socketClientTest.cpp b/ndb/src/cw/test/socketclient/socketClientTest.cpp index a4a0ed1e933..423c196aa43 100644 --- a/ndb/src/cw/test/socketclient/socketClientTest.cpp +++ b/ndb/src/cw/test/socketclient/socketClientTest.cpp @@ -15,11 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include -#include -#include #include #include #include diff --git a/ndb/src/cw/util/ClientInterface.hpp b/ndb/src/cw/util/ClientInterface.hpp index 764705afacd..66ecfe05197 100644 --- a/ndb/src/cw/util/ClientInterface.hpp +++ b/ndb/src/cw/util/ClientInterface.hpp @@ -16,6 +16,7 @@ #ifndef CLIENT_IF_HPP #define CLIENT_IF_HPP +#include #include #include #include @@ -23,9 +24,6 @@ #include #include "SocketRegistry.hpp" #include "SocketService.hpp" -#include "string.h" -#include -#include class ClientInterface { private: diff --git a/ndb/src/kernel/blocks/backup/FsBuffer.hpp b/ndb/src/kernel/blocks/backup/FsBuffer.hpp index 4b5d95a19a5..2f3c7daae43 100644 --- a/ndb/src/kernel/blocks/backup/FsBuffer.hpp +++ b/ndb/src/kernel/blocks/backup/FsBuffer.hpp @@ -17,10 +17,7 @@ #ifndef FS_BUFFER_HPP #define FS_BUFFER_HPP -#include -#include -#include -#include +#include #define DEBUG(x) diff --git a/ndb/src/kernel/blocks/backup/read.cpp b/ndb/src/kernel/blocks/backup/read.cpp index 8300c74ab43..921c352ea13 100644 --- a/ndb/src/kernel/blocks/backup/read.cpp +++ b/ndb/src/kernel/blocks/backup/read.cpp @@ -15,9 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include #include #include diff --git a/ndb/src/kernel/blocks/backup/restore/Makefile b/ndb/src/kernel/blocks/backup/restore/Makefile index f99e3e3da0d..4c884525d73 100644 --- a/ndb/src/kernel/blocks/backup/restore/Makefile +++ b/ndb/src/kernel/blocks/backup/restore/Makefile @@ -1,12 +1,12 @@ include .defs.mk -TYPE := ndbapi ndbapiclient +TYPE := * BIN_TARGET := restore BIN_TARGET_LIBS := -BIN_TARGET_ARCHIVES := NDB_API general +BIN_TARGET_ARCHIVES := NDB_API -CCFLAGS_LOC = -I.. -I$(NDB_TOP)/src/ndbapi +CCFLAGS_LOC = -I.. -I$(NDB_TOP)/src/ndbapi -I$(NDB_TOP)/include/ndbapi -I$(NDB_TOP)/include/util -I$(NDB_TOP)/include/portlib -I$(NDB_TOP)/include/kernel #ifneq ($(MYSQLCLUSTER_TOP),) #CCFLAGS_LOC +=-I$(MYSQLCLUSTER_TOP)/include -D USE_MYSQL diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.cpp b/ndb/src/kernel/blocks/backup/restore/Restore.cpp index 50eb0df7c56..2c3c1c8df7b 100644 --- a/ndb/src/kernel/blocks/backup/restore/Restore.cpp +++ b/ndb/src/kernel/blocks/backup/restore/Restore.cpp @@ -14,11 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "Restore.hpp" #include "BackupFormat.hpp" #include -#include #include #include @@ -514,7 +512,8 @@ RestoreMetaData::parseTableDescriptor(const Uint32 * data, NdbDictionary::Column::Type type; if(getMajor(m_fileHeader.NdbVersion) < VERSION_3X) { tableImpl->setName(tableName); - for(Uint32 i = 0 ; i < tableImpl->getNoOfColumns(); i++) { + Uint32 noOfColumns = tableImpl->getNoOfColumns(); + for(Uint32 i = 0 ; i < noOfColumns; i++) { type = convertToV3x(tableImpl->getColumn(i)->m_extType, columnTypeMapping, -1); @@ -562,7 +561,7 @@ bool TupleS::prepareRecord(const TableS & tab){ m_currentTable = &tab; for(int i = 0; i +#include #include #include #include #include #include "myVector.hpp" -#include -#include -#include #include #include diff --git a/ndb/src/kernel/blocks/backup/restore/main.cpp b/ndb/src/kernel/blocks/backup/restore/main.cpp index b38f6ab751b..4c15785d5c2 100644 --- a/ndb/src/kernel/blocks/backup/restore/main.cpp +++ b/ndb/src/kernel/blocks/backup/restore/main.cpp @@ -14,7 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "Restore.hpp" #include #include diff --git a/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp b/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp index b16990bda6c..bf721a0b30a 100644 --- a/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp +++ b/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp @@ -15,13 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include + #include #include #include -#include -#include -#include void usage(const char * prg){ diff --git a/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp b/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp index 4c55425bdd7..efa4b9c92c5 100644 --- a/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp +++ b/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp @@ -15,13 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include + #include #include #include -#include -#include -#include void usage(const char * prg){ diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp index d2d166fa03e..540df7b507e 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp @@ -25,11 +25,10 @@ //---------------------------------------------------------------- +#include + #include "records.hpp" -#include -#include -#include -#include + #define RETURN_ERROR 1 #define RETURN_OK 0 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index 887f82308d6..54cb93e9736 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -49,7 +49,7 @@ void Dbtup::execTUPFRAGREQ(Signal* signal) Uint32 noOfAttributes = signal->theData[4]; Uint32 fragId = signal->theData[5]; Uint32 noOfNullAttr = signal->theData[7]; - Uint32 schemaVersion = signal->theData[8]; + /* Uint32 schemaVersion = signal->theData[8];*/ Uint32 noOfKeyAttr = signal->theData[9]; Uint32 noOfNewAttr = signal->theData[10]; diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp index c56e455a42a..4737c8422c4 100644 --- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp +++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp @@ -83,6 +83,9 @@ #define jamEntry() jamEntryLine(90000 + __LINE__) #endif +#undef max +#undef min + class Configuration; class Dbtux : public SimulatedBlock { diff --git a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp index 2cb129bc591..92410e1a784 100644 --- a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp +++ b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp @@ -14,10 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "DbUtil.hpp" -#include -#include #include #include @@ -1303,26 +1303,6 @@ DbUtil::prepareOperation(Signal* signal, PreparePtr prepPtr) TcKeyReq::setAIInTcKeyReq(requestInfo, 0); // Attrinfo sent separately prepOpPtr.p->tckey.requestInfo = requestInfo; - if (operationType == UtilPrepareReq::Read) { - // ResultSet - AttrMappingBuffer::ConstDataBufferIterator tmpIt; -#if 0 //def EVENT_DEBUG - ResultSetBuffer & rs = prepOpPtr.p->rsInfo; - ResultSetInfoBuffer::DataBufferIterator it; - rs.first(it); - for (prepOpPtr.p->attrMapping.first(tmpIt); - tmpIt.curr.i != RNIL; - prepOpPtr.p->attrMapping.next(tmpIt)) { - AttributeHeader* ah = (AttributeHeader *) tmpIt.data; - ah->print(stdout); - AttributeHeader* rsah = (AttributeHeader *) it.data; - rsah->print(stdout); - rs.next(it,1); - printf("%d\n",it.data); - } -#endif - } - /**************************** * Confirm completed prepare ****************************/ @@ -1914,7 +1894,6 @@ DbUtil::runOperation(Signal* signal, TransactionPtr & transPtr, Operation * op = opPtr.p; const PreparedOperation * pop = op->prepOp; - Uint32 lastFlag = 0; if(!transPtr.p->operations.next(opPtr)){ TcKeyReq::setCommitFlag(start, 1); // Last operation TcKeyReq::setExecuteFlag(start, 1); @@ -2127,43 +2106,11 @@ DbUtil::execTRANSID_AI(Signal* signal){ /** * Save result */ - Uint32 srcSz = dataLen; const Uint32 *src = &signal->theData[3]; - const Uint32 segSize = opP->rs.getSegmentSize(); - -#if 0 //def EVENT_DEBUG - printf("rsRecv %u, dataLen %u, rsExpect %u\n", - opP->rsRecv, dataLen, opP->rsExpect); -#endif - ResultSetBuffer::DataBufferIterator rs = opP->rsIterator; -#if 0 //def EVENT_DEBUG - for(int i = 0; i < dataLen; i++) - printf("H'%.8x ", src[i]); -#endif - ndbrequire(opP->rs.import(rs,src,dataLen)); opP->rs.next(rs, dataLen); - -#if 0 // replaced this section with import() above - while(srcSz > segSize){ - ndbrequire(rs.curr.i != RNIL); - memcpy(rs.data, src, segSize << 2); - opP->rs.next(rs, segSize); - srcSz -= segSize; - // src += segSize * 4; // Bug? - src += segSize; - } - - if(srcSz > 0){ - jam(); - memcpy(rs.data, src, srcSz << 2); - rs.curr.i = RNIL; - rs.data = 0; - } -#endif - opP->rsIterator = rs; if(!opP->complete()){ @@ -2171,20 +2118,12 @@ DbUtil::execTRANSID_AI(Signal* signal){ return; } -#if 0 //def EVENT_DEBUG - printf("op complete\n"); -#endif - transPtr.p->recv++; if(!transPtr.p->complete()){ jam(); return; } -#if 0 //def EVENT_DEBUG - printf("trans complete\n"); -#endif - finishTransaction(signal, transPtr); } diff --git a/ndb/src/kernel/blocks/grep/Grep.cpp b/ndb/src/kernel/blocks/grep/Grep.cpp index 093e9a225e6..ee506ce922a 100644 --- a/ndb/src/kernel/blocks/grep/Grep.cpp +++ b/ndb/src/kernel/blocks/grep/Grep.cpp @@ -1294,7 +1294,7 @@ Grep::PSPart::execSUB_REMOVE_REF(Signal* signal) jamEntry(); SubRemoveRef * const ref = (SubRemoveRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - GrepError::Code err = (GrepError::Code)ref->err; + /* GrepError::Code err = (GrepError::Code)ref->err;*/ SubscriptionPtr subPtr; c_subscriptions.getPtr(subPtr, subData); diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp index 0e2aa4c6903..f73c1ec5ee7 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp @@ -23,20 +23,17 @@ #endif #endif +#include + #include "Error.hpp" #include "AsyncFile.hpp" #include #include -#include #include #include #include -#include -#include -#include - #ifdef NDB_LINUX // This is for pread and pwrite #ifndef __USE_UNIX98 @@ -44,9 +41,7 @@ #endif #endif -#include #if defined NDB_WIN32 || defined NDB_OSE || defined NDB_SOFTOSE -#include #else // For readv and writev #include @@ -566,9 +561,8 @@ AsyncFile::writeReq( Request * request) if (((i + 1) < request->par.readWrite.numberOfPages)) { // There are more pages to write // Check that offsets are consequtive - if ((page_offset + request->par.readWrite.pages[i].size) - != - request->par.readWrite.pages[i+1].offset) { + off_t tmp = page_offset + request->par.readWrite.pages[i].size; + if (tmp != request->par.readWrite.pages[i+1].offset) { // Next page is not aligned with previous, not allowed DEBUG(ndbout_c("Page offsets are not aligned")); request->error = EINVAL; diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp index b9954ba130f..004752c9543 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp @@ -16,10 +16,8 @@ //#define TESTDEBUG 1 -#include -#include +#include -#include #include #include #include "AsyncFile.hpp" diff --git a/ndb/src/kernel/blocks/ndbfs/Filename.cpp b/ndb/src/kernel/blocks/ndbfs/Filename.cpp index c0bc52b4501..494c9c74eb9 100644 --- a/ndb/src/kernel/blocks/ndbfs/Filename.cpp +++ b/ndb/src/kernel/blocks/ndbfs/Filename.cpp @@ -14,10 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include +#include + #include #include "Filename.hpp" diff --git a/ndb/src/kernel/blocks/ndbfs/Filename.hpp b/ndb/src/kernel/blocks/ndbfs/Filename.hpp index 4c3569b5485..29aba79c9dc 100644 --- a/ndb/src/kernel/blocks/ndbfs/Filename.hpp +++ b/ndb/src/kernel/blocks/ndbfs/Filename.hpp @@ -52,8 +52,8 @@ // //=========================================================================== +#include #include -#include class Filename { diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp index 6e0c2721ca0..435a6a6b208 100644 --- a/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp +++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp @@ -76,7 +76,6 @@ #include "NdbCondition.h" #include -#include template class MemoryChannel diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp index 9f70efcadf7..ca90bc60153 100644 --- a/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp +++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp @@ -65,7 +65,6 @@ #include "NdbMutex.h" #include "NdbCondition.h" -#include diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp index 8992a2104e9..36322ffad1e 100644 --- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp +++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp @@ -14,8 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include "Ndbfs.hpp" #include "AsyncFile.hpp" @@ -855,7 +854,7 @@ int Ndbfs::translateErrno(int aErrno) //no space left on device case ENFILE: case EDQUOT: -#ifndef NDB_MACOSX +#ifdef ENOSR case ENOSR: #endif case ENOSPC: @@ -873,12 +872,16 @@ int Ndbfs::translateErrno(int aErrno) return FsRef::fsErrInvalidParameters; //environment error case ELOOP: -#ifndef NDB_MACOSX +#ifdef ENOLINK case ENOLINK: +#endif +#ifdef EMULTIHOP case EMULTIHOP: #endif -#ifndef NDB_LINUX +#ifdef EOPNOTSUPP case EOPNOTSUPP: +#endif +#ifdef ESPIPE case ESPIPE: #endif case EPIPE: diff --git a/ndb/src/kernel/blocks/suma/SumaInit.cpp b/ndb/src/kernel/blocks/suma/SumaInit.cpp index e9fba5e789c..9f0659942a2 100644 --- a/ndb/src/kernel/blocks/suma/SumaInit.cpp +++ b/ndb/src/kernel/blocks/suma/SumaInit.cpp @@ -132,9 +132,9 @@ SumaParticipant::~SumaParticipant() Suma::Suma(const Configuration & conf) : SumaParticipant(conf), + Restart(*this), c_nodes(c_nodePool), - c_runningSubscriptions(c_subCoordinatorPool), - Restart(*this) + c_runningSubscriptions(c_subCoordinatorPool) { c_nodePool.setSize(MAX_NDB_NODES); diff --git a/ndb/src/kernel/error/ErrorReporter.cpp b/ndb/src/kernel/error/ErrorReporter.cpp index 1aa937f4675..56627cba46f 100644 --- a/ndb/src/kernel/error/ErrorReporter.cpp +++ b/ndb/src/kernel/error/ErrorReporter.cpp @@ -15,17 +15,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "Error.hpp" #include "ErrorReporter.hpp" #include "ErrorMessages.hpp" #include #include -#include -#include #include #include -#include #include #define MESSAGE_LENGTH 400 diff --git a/ndb/src/kernel/error/ErrorReporter.hpp b/ndb/src/kernel/error/ErrorReporter.hpp index f1428821ab0..20340a9602f 100644 --- a/ndb/src/kernel/error/ErrorReporter.hpp +++ b/ndb/src/kernel/error/ErrorReporter.hpp @@ -17,9 +17,10 @@ #ifndef ERRORREPORTER_H #define ERRORREPORTER_H +#include + #include "TimeModule.hpp" #include "Error.hpp" -#include #include diff --git a/ndb/src/kernel/error/TimeModule.cpp b/ndb/src/kernel/error/TimeModule.cpp index c0f4e40858f..4bd8e3daf99 100644 --- a/ndb/src/kernel/error/TimeModule.cpp +++ b/ndb/src/kernel/error/TimeModule.cpp @@ -16,8 +16,8 @@ +#include #include "TimeModule.hpp" -#include static const char* cMonth[] = { "x", "January", "February", "Mars", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; diff --git a/ndb/src/kernel/ndb-main/Main.cpp b/ndb/src/kernel/ndb-main/Main.cpp index 88fd9d177de..46eb41b0ec6 100644 --- a/ndb/src/kernel/ndb-main/Main.cpp +++ b/ndb/src/kernel/ndb-main/Main.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include "Configuration.hpp" #include @@ -32,7 +34,6 @@ #include #if defined NDB_SOLARIS -#include // For system information #include // For system informatio #endif @@ -41,10 +42,6 @@ #endif extern EventLogger g_eventLogger; -#if defined (NDB_LINUX) || defined (NDB_SOLARIS) -#include -#include -#endif void catchsigs(bool ignore); // for process signal handling extern "C" void handler(int signo); // for process signal handling @@ -81,10 +78,6 @@ NDB_MAIN(ndb_kernel){ char homePath[255]; NdbConfig_HomePath(homePath, 255); -#if defined (NDB_LINUX) || defined (NDB_SOLARIS) - /** - * This has only been tested with linux & solaris - */ if (theConfig->getDaemonMode()) { // Become a daemon char lockfile[255], logfile[255]; @@ -137,7 +130,6 @@ NDB_MAIN(ndb_kernel){ } g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid()); -#endif systemInfo(* theConfig, theConfig->clusterConfigurationData().SizeAltData.logLevel); @@ -188,9 +180,9 @@ NDB_MAIN(ndb_kernel){ void systemInfo(const Configuration & config, const LogLevel & logLevel){ +#ifdef NDB_WIN32 int processors = 0; int speed; -#ifdef NDB_WIN32 SYSTEM_INFO sinfo; GetSystemInfo(&sinfo); processors = sinfo.dwNumberOfProcessors; @@ -236,16 +228,25 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){ void catchsigs(bool ignore){ #if ! defined NDB_SOFTOSE && !defined NDB_OSE + +#if defined SIGRTMIN + #define MAX_SIG_CATCH SIGRTMIN +#elif defined NSIG + #define MAX_SIG_CATCH NSIG +#else + #error "neither SIGRTMIN or NSIG is defined on this platform, please report bug at bugs.mysql.com" +#endif + // Makes the main process catch process signals, eg installs a // handler named "handler". "handler" will then be called is instead // of the defualt process signal handler) if(ignore){ - for(int i = 1; i<100; i++){ + for(int i = 1; i < MAX_SIG_CATCH; i++){ if(i != SIGCHLD) signal(i, SIG_IGN); - } + } } else { - for(int i = 1; i<100; i++){ + for(int i = 1; i < MAX_SIG_CATCH; i++){ signal(i, handler); } } @@ -260,8 +261,10 @@ handler(int sig){ case SIGINT: /* 2 - Interrupt */ case SIGQUIT: /* 3 - Quit */ case SIGTERM: /* 15 - Terminate */ -#ifndef NDB_MACOSX +#ifdef SIGPWR case SIGPWR: /* 19 - Power fail */ +#endif +#ifdef SIGPOLL case SIGPOLL: /* 22 */ #endif case SIGSTOP: /* 23 */ @@ -270,6 +273,9 @@ handler(int sig){ case SIGTTOU: /* 27 */ globalData.theRestartFlag = perform_stop; break; +#ifdef SIGWINCH + case SIGWINCH: +#endif case SIGPIPE: /** * Can happen in TCP Transporter diff --git a/ndb/src/kernel/vm/ArrayPool.hpp b/ndb/src/kernel/vm/ArrayPool.hpp index 4a84047b614..284d29dcefa 100644 --- a/ndb/src/kernel/vm/ArrayPool.hpp +++ b/ndb/src/kernel/vm/ArrayPool.hpp @@ -17,12 +17,12 @@ #ifndef ARRAY_POOL_HPP #define ARRAY_POOL_HPP +#include + #include #include #include #include -#include -#include template class Array; template class SLList; diff --git a/ndb/src/kernel/vm/ClusterConfiguration.cpp b/ndb/src/kernel/vm/ClusterConfiguration.cpp index f04081ee3c1..3a6478380d1 100644 --- a/ndb/src/kernel/vm/ClusterConfiguration.cpp +++ b/ndb/src/kernel/vm/ClusterConfiguration.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "ClusterConfiguration.hpp" #include @@ -27,9 +29,6 @@ #include #include -#include -#include - ClusterConfiguration::ClusterConfiguration() { for (unsigned i= 0; i< MAX_SIZEALT_BLOCKS; i++) // initialize diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 03495449787..706d75509f2 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include diff --git a/ndb/src/kernel/vm/DLHashTable.hpp b/ndb/src/kernel/vm/DLHashTable.hpp index f7cd7ae5228..13a9632f8da 100644 --- a/ndb/src/kernel/vm/DLHashTable.hpp +++ b/ndb/src/kernel/vm/DLHashTable.hpp @@ -17,9 +17,8 @@ #ifndef DL_HASHTABLE_HPP #define DL_HASHTABLE_HPP +#include #include "ArrayList.hpp" -#include -#include /** * DLHashTable implements a hashtable using chaining diff --git a/ndb/src/kernel/vm/DLHashTable2.hpp b/ndb/src/kernel/vm/DLHashTable2.hpp index 8386790b0a6..6b166331631 100644 --- a/ndb/src/kernel/vm/DLHashTable2.hpp +++ b/ndb/src/kernel/vm/DLHashTable2.hpp @@ -17,10 +17,9 @@ #ifndef DL_HASHTABLE2_HPP #define DL_HASHTABLE2_HPP +#include + #include "ArrayList.hpp" -#include -#include -#include /** * DLHashTable2 is a DLHashTable variant meant for cases where different diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp index a852e045c6e..0d6d3f55acb 100644 --- a/ndb/src/kernel/vm/Emulator.cpp +++ b/ndb/src/kernel/vm/Emulator.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "Emulator.hpp" #include #include @@ -31,19 +33,12 @@ #include #include #include -#include #include extern "C" { extern void (* ndb_new_handler)(); } - -#if defined (NDB_LINUX) || defined (NDB_SOLARIS) -#include -#include -#endif - /** * Declare the global variables */ diff --git a/ndb/src/kernel/vm/GlobalData.hpp b/ndb/src/kernel/vm/GlobalData.hpp index ca7dd467750..99b65727374 100644 --- a/ndb/src/kernel/vm/GlobalData.hpp +++ b/ndb/src/kernel/vm/GlobalData.hpp @@ -17,11 +17,10 @@ #ifndef GLOBAL_DATA_H #define GLOBAL_DATA_H +#include #include #include "Prio.hpp" #include "VMSignal.hpp" -#include -#include #include #include diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp index f36b3e43d42..e3f087d7d74 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.cpp +++ b/ndb/src/kernel/vm/SimulatedBlock.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "SimulatedBlock.hpp" #include #include @@ -24,8 +26,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/ndb/src/kernel/vm/TransporterCallback.cpp b/ndb/src/kernel/vm/TransporterCallback.cpp index 1fec4ea86bd..3798e4040c8 100644 --- a/ndb/src/kernel/vm/TransporterCallback.cpp +++ b/ndb/src/kernel/vm/TransporterCallback.cpp @@ -14,12 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include #include #include #include -#include #include "LongSignal.hpp" diff --git a/ndb/src/kernel/vm/VMSignal.hpp b/ndb/src/kernel/vm/VMSignal.hpp index d436143c055..45e731f2079 100644 --- a/ndb/src/kernel/vm/VMSignal.hpp +++ b/ndb/src/kernel/vm/VMSignal.hpp @@ -17,14 +17,15 @@ #ifndef VMSignal_H #define VMSignal_H +#include +#include +#include + #include #include -#include -#include #include #include -#include /** * Struct used when sending to multiple blocks diff --git a/ndb/src/kernel/vm/al_test/arrayListTest.cpp b/ndb/src/kernel/vm/al_test/arrayListTest.cpp index 39d8170cfc5..bb320106653 100644 --- a/ndb/src/kernel/vm/al_test/arrayListTest.cpp +++ b/ndb/src/kernel/vm/al_test/arrayListTest.cpp @@ -16,11 +16,11 @@ +#include + #include -#include #include #include -#include struct A_Listable_Object { Uint32 next; diff --git a/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp b/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp index 8b554d5bb41..e80905121e1 100644 --- a/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp +++ b/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp @@ -16,12 +16,11 @@ +#include + #include -#include #include #include -#include -#include struct A_Poolable_Object { Uint32 next; diff --git a/ndb/src/kernel/vm/al_test/main.cpp b/ndb/src/kernel/vm/al_test/main.cpp index 42c36173b56..23193b50725 100644 --- a/ndb/src/kernel/vm/al_test/main.cpp +++ b/ndb/src/kernel/vm/al_test/main.cpp @@ -14,11 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include -#include #include #include -#include #include #include "arrayListTest.cpp" diff --git a/ndb/src/kernel/vm/testCopy/rr.cpp b/ndb/src/kernel/vm/testCopy/rr.cpp index 2da8383f523..1e8305dfe4c 100644 --- a/ndb/src/kernel/vm/testCopy/rr.cpp +++ b/ndb/src/kernel/vm/testCopy/rr.cpp @@ -15,10 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include -#include -#include -#include int main(int argc, char * const argv[]){ diff --git a/ndb/src/kernel/vm/testCopy/testCopy.cpp b/ndb/src/kernel/vm/testCopy/testCopy.cpp index 1b4b24f5934..78a1dab2619 100644 --- a/ndb/src/kernel/vm/testCopy/testCopy.cpp +++ b/ndb/src/kernel/vm/testCopy/testCopy.cpp @@ -15,11 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include -#include -#include -#include #ifdef __NDB_FORTE6 #define HAND diff --git a/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp b/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp index def8387e343..5ba59418223 100644 --- a/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp +++ b/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp @@ -14,10 +14,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include #include #include -#include -#include + +#undef test struct Buffer { Buffer(Uint32 size){ m_sz = size; buffer = new Uint32[m_sz]; m_len = 0;} diff --git a/ndb/src/kernel/vm/testLongSig/testLongSig.cpp b/ndb/src/kernel/vm/testLongSig/testLongSig.cpp index 6d421268a0a..af4e2ca6e24 100644 --- a/ndb/src/kernel/vm/testLongSig/testLongSig.cpp +++ b/ndb/src/kernel/vm/testLongSig/testLongSig.cpp @@ -15,10 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include -#include -#include void print_help(){ diff --git a/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp b/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp index 20a5d5230fb..e16870edf11 100644 --- a/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp +++ b/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp @@ -14,12 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include #include -#include -#include + +#undef test struct Buffer { Buffer(Uint32 size){ m_sz = size; buffer = new Uint32[m_sz]; m_len = 0;} diff --git a/ndb/src/mgmapi/Makefile b/ndb/src/mgmapi/Makefile index fac852dbba8..9e7ba4f5ac7 100644 --- a/ndb/src/mgmapi/Makefile +++ b/ndb/src/mgmapi/Makefile @@ -9,7 +9,7 @@ A_LIB := Y SO_LIB := Y PIC_LIB := Y -DIRS := test +#DIRS := test LIB_TARGET := MGM_API LIB_TARGET_ARCHIVES := $(ARCHIVE_TARGET) general portlib diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 4c1355e8e46..fcdfe943fb1 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -14,17 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include "mgmapi.h" #include "mgmapi_debug.h" #include -#include - -#include -#include -#include -#include #include #include #include diff --git a/ndb/src/mgmapi/test/keso.c b/ndb/src/mgmapi/test/keso.c index f4b192e3db8..d5086b20b6a 100644 --- a/ndb/src/mgmapi/test/keso.c +++ b/ndb/src/mgmapi/test/keso.c @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #ifdef VM_TRACE @@ -22,9 +24,6 @@ #endif #include -#include - -#include static int testConnect(NdbMgmHandle h, struct ndb_mgm_reply* reply); static int testDisconnect(NdbMgmHandle h, struct ndb_mgm_reply* reply); @@ -60,8 +59,8 @@ struct test_case test_connect_disconnect[] = { struct test_case tests[] = { { "testStatus", &testStatus }, { "testFilterClusterLog", &testFilterClusterLog }, - //{ "testSetLogLevelClusterLog", &testSetLogLevelClusterLog }, - //{ "testSetLogLevelNode", &testSetLogLevelNode }, + /*{ "testSetLogLevelClusterLog", &testSetLogLevelClusterLog },*/ + /*{ "testSetLogLevelNode", &testSetLogLevelNode },*/ { "testRestartNode", &testRestartNode }, { "testGetStatPort", &testGetStatPort }, #ifdef VM_TRACE diff --git a/ndb/src/mgmapi/test/mgmSrvApi.cpp b/ndb/src/mgmapi/test/mgmSrvApi.cpp index e93c54ae5a7..4a8e38c9ba5 100644 --- a/ndb/src/mgmapi/test/mgmSrvApi.cpp +++ b/ndb/src/mgmapi/test/mgmSrvApi.cpp @@ -25,11 +25,9 @@ * Server API" document * *****************************************************/ +#include #include "mgmapi.h" #include "mgmapi_commands.h" -#include -#include -#include #include #include diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 29d25ebf7d3..fba5fda32dd 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -14,13 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#include - -#include +#include "CommandInterpreter.hpp" #include #include @@ -34,7 +28,6 @@ #endif // HAVE_GLOBAL_REPLICATION #include "MgmtErrorReporter.hpp" -#include "CommandInterpreter.hpp" #include "CpcClient.hpp" #ifdef NDB_SOLARIS // XXX fix me diff --git a/ndb/src/mgmclient/CommandInterpreter.hpp b/ndb/src/mgmclient/CommandInterpreter.hpp index 9049ef39915..796a4e4838e 100644 --- a/ndb/src/mgmclient/CommandInterpreter.hpp +++ b/ndb/src/mgmclient/CommandInterpreter.hpp @@ -22,9 +22,7 @@ // Author: Peter Lind //***************************************************************************** -#include -#include -#include +#include #include #include diff --git a/ndb/src/mgmclient/CpcClient.cpp b/ndb/src/mgmclient/CpcClient.cpp index 24eab7194e9..74fa1a828ed 100644 --- a/ndb/src/mgmclient/CpcClient.cpp +++ b/ndb/src/mgmclient/CpcClient.cpp @@ -14,14 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include -#include -#include -#include #include -#include #include #include diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index bbadaeb5206..2dcadf9369d 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -14,9 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include #include #include diff --git a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp index 6b6dc9f1077..32f0adbcf26 100644 --- a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp +++ b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp @@ -15,10 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "../CpcClient.hpp" #include -#include -#include SimpleCpcClient g_client("localhost", 1234); Vector g_procs; @@ -89,10 +88,16 @@ void define(){ //proc.m_proc.m_stdout = "log.out"; //proc.m_proc.m_stderr = "2>&1"; //proc.m_proc.m_runas = proc.m_host->m_user; - //proc.m_proc.m_ulimit = "c:unlimited"; - m_proc.m_name.assfmt("%d-%d-%s", getpid(), name++, "test"); - m_proc.m_path.assign("/bin/sleep"); - m_proc.m_args = "600"; + m_proc.m_ulimit = "c:unlimited"; + if((rand() & 15) >= 0){ + m_proc.m_name.assfmt("%d-%d-%s", getpid(), name++, "sleep"); + m_proc.m_path.assign("/bin/sleep"); + m_proc.m_args = "600"; + } else { + m_proc.m_name.assfmt("%d-%d-%s", getpid(), name++, "test.sh"); + m_proc.m_path.assign("/home/jonas/run/cpcd/test.sh"); + m_proc.m_args = "600"; + } g_procs.push_back(m_proc); Properties reply; @@ -136,7 +141,7 @@ void list(){ ABORT(); } - for(int i = 0; im_status = procs[i].m_status; @@ -144,7 +149,7 @@ void list(){ } } SimpleCpcClient::Process* find(int id){ - for(int i = 0; i -#include -#include +#include #include #include #include diff --git a/ndb/src/mgmsrv/Makefile b/ndb/src/mgmsrv/Makefile index ebf50ecb76e..b10bdb64d30 100644 --- a/ndb/src/mgmsrv/Makefile +++ b/ndb/src/mgmsrv/Makefile @@ -6,8 +6,6 @@ BIN_TARGET := mgmtsrvr BIN_TARGET_LIBS := BIN_TARGET_ARCHIVES := mgmapi NDB_API mgmsrvcommon -LDFLAGS_LOC = -lpthread - ifneq ($(USE_EDITLINE), N) BIN_TARGET_ARCHIVES += editline DIRS := mkconfig diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 23ceeb15947..7c2d94c6b7f 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -14,10 +14,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include "MgmtSrvr.hpp" #include "MgmtErrorReporter.hpp" -#include #include #include #include @@ -42,15 +44,11 @@ #include #include #include -#include #include "SocketServer.hpp" #include "NodeLogLevel.hpp" #include -#include -#include - //#define MGM_SRV_DEBUG #ifdef MGM_SRV_DEBUG #define DEBUG(x) do ndbout << x << endl; while(0) diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 4fdf3c99d43..ce8765d6c73 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -20,7 +20,6 @@ #include #include "Config.hpp" #include -#include #include diff --git a/ndb/src/mgmsrv/NodeLogLevel.hpp b/ndb/src/mgmsrv/NodeLogLevel.hpp index 3e631e57901..3ad758cde99 100644 --- a/ndb/src/mgmsrv/NodeLogLevel.hpp +++ b/ndb/src/mgmsrv/NodeLogLevel.hpp @@ -17,7 +17,8 @@ #ifndef NODELOGLEVEL_H #define NODELOGLEVEL_H -#include +#include + #include /** diff --git a/ndb/src/mgmsrv/NodeLogLevelList.cpp b/ndb/src/mgmsrv/NodeLogLevelList.cpp index 7cf6dcc4b7e..6c7c091c1a8 100644 --- a/ndb/src/mgmsrv/NodeLogLevelList.cpp +++ b/ndb/src/mgmsrv/NodeLogLevelList.cpp @@ -14,10 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NodeLogLevelList.hpp" +#include +#include "NodeLogLevelList.hpp" #include "NodeLogLevel.hpp" -#include "NdbStdio.h" // // PUBLIC diff --git a/ndb/src/mgmsrv/convertStrToInt.cpp b/ndb/src/mgmsrv/convertStrToInt.cpp index 82bdb8e4f2f..e5216047d10 100644 --- a/ndb/src/mgmsrv/convertStrToInt.cpp +++ b/ndb/src/mgmsrv/convertStrToInt.cpp @@ -14,9 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include bool convert(const char* s, int& val) { diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index d10ad8e0f4e..91b443f61a2 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -14,8 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include -#include #include "MgmtSrvr.hpp" #include "EventLogger.hpp" @@ -41,6 +42,7 @@ #include "CommandInterpreter.hpp" #endif +#undef DEBUG #define DEBUG(x) ndbout << x << endl; const char progname[] = "mgmtsrvr"; @@ -197,7 +199,6 @@ NDB_MAIN(mgmsrv){ goto error_end; } -#if defined (NDB_LINUX) || defined (NDB_SOLARIS) if (glob.daemon) { // Become a daemon char homePath[255],lockfile[255], logfile[255]; @@ -209,7 +210,6 @@ NDB_MAIN(mgmsrv){ return 1; } } -#endif if(!glob.mgmObject->start()){ ndbout_c("Unable to start management server."); diff --git a/ndb/src/mgmsrv/mkconfig/mkconfig.cpp b/ndb/src/mgmsrv/mkconfig/mkconfig.cpp index 0e9397e43c0..224c82aa8a1 100644 --- a/ndb/src/mgmsrv/mkconfig/mkconfig.cpp +++ b/ndb/src/mgmsrv/mkconfig/mkconfig.cpp @@ -14,15 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include #include -#include #include "InitConfigFileParser.hpp" -#include "Config.hpp" -#include -#include -#include +#include void usage(const char * prg){ ndbout << "Usage " << prg << ": " << endl; diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp index 93fb0109669..1b536b6d741 100644 --- a/ndb/src/ndbapi/ClusterMgr.cpp +++ b/ndb/src/ndbapi/ClusterMgr.cpp @@ -14,6 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include +#include + #include "TransporterFacade.hpp" #include "ClusterMgr.hpp" #include @@ -23,12 +27,8 @@ #include #include #include -#include -#include -#include -#include #include #include #include diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp index 36fbc85a875..f6f2106f2aa 100644 --- a/ndb/src/ndbapi/DictCache.cpp +++ b/ndb/src/ndbapi/DictCache.cpp @@ -14,12 +14,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "DictCache.hpp" #include "NdbDictionaryImpl.hpp" #include #include #include -#include LocalDictCache::LocalDictCache(){ m_tableHash.createHashTable(); diff --git a/ndb/src/ndbapi/Makefile b/ndb/src/ndbapi/Makefile index 932fbd844d2..f4c82e5d6ba 100644 --- a/ndb/src/ndbapi/Makefile +++ b/ndb/src/ndbapi/Makefile @@ -31,7 +31,9 @@ SOURCES = \ Ndblist.cpp \ Ndbif.cpp \ Ndbinit.cpp \ - Ndberror.cpp \ + Ndberr.cpp \ + ndberror.c \ + NdbErrorOut.cpp \ NdbConnection.cpp \ NdbConnectionScan.cpp \ NdbOperation.cpp \ diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index d7930f32d72..448a29ca485 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -21,14 +21,17 @@ Name: Ndb.cpp ******************************************************************************/ +#include +#include + #include "NdbApiSignal.hpp" #include "NdbImpl.hpp" #include "NdbSchemaOp.hpp" #include "NdbSchemaCon.hpp" -#include "NdbOperation.hpp" -#include "NdbConnection.hpp" -#include "NdbEventOperation.hpp" -#include "NdbRecAttr.hpp" +#include +#include +#include +#include #include #include #include @@ -1221,7 +1224,6 @@ Ndb::pollEvents(int aMillisecondNumber) #ifdef VM_TRACE #include -#include static NdbMutex print_state_mutex = NDB_MUTEX_INITIALIZER; static bool checkdups(NdbConnection** list, unsigned no) @@ -1243,7 +1245,7 @@ Ndb::printState(const char* fmt, ...) NdbMutex_Lock(&print_state_mutex); bool dups = false; ndbout << buf << " ndb=" << hex << this << dec; -#ifdef NDB_LINUX +#ifndef NDB_WIN32 ndbout << " thread=" << (int)pthread_self(); #endif ndbout << endl; diff --git a/ndb/src/ndbapi/NdbConnectionScan.cpp b/ndb/src/ndbapi/NdbConnectionScan.cpp index 67f07d2a8c0..962acc0bdac 100644 --- a/ndb/src/ndbapi/NdbConnectionScan.cpp +++ b/ndb/src/ndbapi/NdbConnectionScan.cpp @@ -27,10 +27,12 @@ * Documentation: * Adjust: 2000-06-12 UABRONM First version. ****************************************************************************/ -#include "Ndb.hpp" -#include "NdbConnection.hpp" -#include "NdbOperation.hpp" -#include "NdbScanOperation.hpp" +#include + +#include +#include +#include +#include #include "NdbScanReceiver.hpp" #include "NdbApiSignal.hpp" #include "TransporterFacade.hpp" @@ -41,7 +43,6 @@ #include #include -#include // time out for next scan result (-1 is infinite) // XXX should change default only if non-trivial interpreted program is used diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index ec9a56cda62..b068ea6460f 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -646,7 +646,6 @@ NdbDictionary::Dictionary::Dictionary(NdbDictionaryImpl & impl) : m_impl(impl) { } -#include NdbDictionary::Dictionary::~Dictionary(){ NdbDictionaryImpl * tmp = &m_impl; if(this != tmp){ diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index bd94ba9b080..02e3ee23f9c 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -35,7 +35,6 @@ #include #include #include "NdbEventOperationImpl.hpp" -#include #define DEBUG_PRINT 0 #define INCOMPATIBLE_VERSION -2 diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp index f6b0644ea15..3263a636a79 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -33,7 +33,7 @@ class NdbDictObjectImpl { public: - int m_version; + Uint32 m_version; NdbDictionary::Object::Status m_status; bool change(); diff --git a/ndb/include/portlib/NdbStdio.h b/ndb/src/ndbapi/NdbErrorOut.cpp similarity index 56% rename from ndb/include/portlib/NdbStdio.h rename to ndb/src/ndbapi/NdbErrorOut.cpp index 163b7eeef6f..07e0b2fe6e8 100644 --- a/ndb/include/portlib/NdbStdio.h +++ b/ndb/src/ndbapi/NdbErrorOut.cpp @@ -14,23 +14,32 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* - * NdbStdio.h - stdio.h for ndb - * - * + +#include + +#include + +#include + +/** + * operators */ +NdbOut & +operator<<(NdbOut & out, const NdbError & error){ + if(error.message != 0) + out << error.code << ": " << error.message; + else + out << error.code << ": "; + return out; +} +NdbOut & +operator<<(NdbOut & out, const NdbError::Status & status){ + return out << ndberror_status_message((ndberror_status)status); +} -#if defined NDB_OSE || defined NDB_SOFTOSE -/* On OSE Delta the snprintf is declare in outfmt.h */ -#include -#endif - -#include - -#ifdef NDB_WIN32 -#define snprintf _snprintf -#define vsnprintf _vsnprintf -#define strtok_r(s1, s2, l) strtok(s1, s2) -#endif +NdbOut & +operator<<(NdbOut & out, const NdbError::Classification & classification){ + return out << ndberror_classification_message((ndberror_classification)classification); +} diff --git a/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/ndb/src/ndbapi/NdbEventOperationImpl.cpp index d167b8205a2..acc726e28c5 100644 --- a/ndb/src/ndbapi/NdbEventOperationImpl.cpp +++ b/ndb/src/ndbapi/NdbEventOperationImpl.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include +#include #include "NdbDictionaryImpl.hpp" #include "API.hpp" @@ -24,21 +24,12 @@ #include #include "NdbApiSignal.hpp" #include "TransporterFacade.hpp" -#include -#include -#include -#include #include #include -#include -#include -#include #include #include #include #include -#include -#include #include #include #include diff --git a/ndb/src/ndbapi/NdbOperation.cpp b/ndb/src/ndbapi/NdbOperation.cpp index eaa2b35965b..ccbfa767542 100644 --- a/ndb/src/ndbapi/NdbOperation.cpp +++ b/ndb/src/ndbapi/NdbOperation.cpp @@ -37,7 +37,6 @@ #include "API.hpp" #include -#include /****************************************************************************** diff --git a/ndb/src/ndbapi/NdbOperationDefine.cpp b/ndb/src/ndbapi/NdbOperationDefine.cpp index a1ce25f19d1..18f8b79d12e 100644 --- a/ndb/src/ndbapi/NdbOperationDefine.cpp +++ b/ndb/src/ndbapi/NdbOperationDefine.cpp @@ -164,7 +164,6 @@ NdbOperation::readTupleExclusive() int NdbOperation::simpleRead() { - NdbConnection* tNdbCon = theNdbCon; int tErrorLine = theErrorLine; if (theStatus == Init) { theStatus = OperationDefined; @@ -193,7 +192,6 @@ NdbOperation::dirtyRead() int NdbOperation::committedRead() { - NdbConnection* tNdbCon = theNdbCon; int tErrorLine = theErrorLine; if (theStatus == Init) { theStatus = OperationDefined; diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp index 1b0ad68b1eb..b2a6f99880c 100644 --- a/ndb/src/ndbapi/NdbOperationExec.cpp +++ b/ndb/src/ndbapi/NdbOperationExec.cpp @@ -25,11 +25,12 @@ Version: 1.2 Description: Documentation: ***************************************************************************/ -#include "NdbOperation.hpp" -#include "NdbConnection.hpp" + +#include +#include #include "NdbApiSignal.hpp" -#include "Ndb.hpp" -#include "NdbRecAttr.hpp" +#include +#include #include "NdbUtil.hpp" #include "Interpreter.hpp" diff --git a/ndb/src/ndbapi/NdbOperationSearch.cpp b/ndb/src/ndbapi/NdbOperationSearch.cpp index 42f2b1d10d8..e1d5e823077 100644 --- a/ndb/src/ndbapi/NdbOperationSearch.cpp +++ b/ndb/src/ndbapi/NdbOperationSearch.cpp @@ -319,7 +319,7 @@ NdbOperation::setTupleId() return 0; } Uint64 tTupleId = theNdb->getTupleIdFromNdb(m_currentTable->m_tableId); - if (tTupleId == ~0){ + if (tTupleId == ~(Uint64)0){ setErrorCodeAbort(theNdb->theError.code); return 0; } diff --git a/ndb/src/ndbapi/NdbPoolImpl.cpp b/ndb/src/ndbapi/NdbPoolImpl.cpp index 08252d26d79..131edc74246 100644 --- a/ndb/src/ndbapi/NdbPoolImpl.cpp +++ b/ndb/src/ndbapi/NdbPoolImpl.cpp @@ -15,8 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "NdbPoolImpl.hpp" -#include -#include NdbMutex *NdbPool::pool_mutex = NULL; NdbPool *the_pool = NULL; diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index 11f36fbd2c4..0f7baeac4f5 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -26,8 +26,8 @@ Description: Interface between TIS and NDB Documentation: Adjust: 971206 UABRONM First version ************************************************************************************************/ +#include #include "NdbRecAttr.hpp" -#include #include "NdbDictionaryImpl.hpp" NdbRecAttr::NdbRecAttr() : diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index f753d2f6b34..4db0f30f56c 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -26,6 +26,7 @@ * Adjust: 2002-04-01 UABMASD First version. ****************************************************************************/ +#include #include #include #include @@ -33,12 +34,6 @@ #include "NdbApiSignal.hpp" #include #include "NdbDictionaryImpl.hpp" -#include -#ifndef NDB_MACOSX -#include -#else -#include -#endif NdbScanOperation::NdbScanOperation(Ndb* aNdb) : NdbCursorOperation(aNdb), @@ -637,6 +632,24 @@ SetValueRecList::callSetValueFn(SetValueRec& aSetValueRec, NdbOperation& oper) } } +SetValueRec::~SetValueRec() +{ + if ((stype == SET_STRING_ATTR1) || + (stype == SET_INT32_ATTR1) || + (stype == SET_UINT32_ATTR1) || + (stype == SET_INT64_ATTR1) || + (stype == SET_UINT64_ATTR1) || + (stype == SET_FLOAT_ATTR1) || + (stype == SET_DOUBLE_ATTR1)) + free(anAttrName); + + if ((stype == SET_STRING_ATTR1) || + (stype == SET_STRING_ATTR2)) + free(stringStruct.aStringValue); + if (next) delete next; + next = 0; +} + int NdbScanOperation::equal_impl(const NdbColumnImpl* anAttrObject, const char* aValue, diff --git a/ndb/src/ndbapi/NdbScanReceiver.hpp b/ndb/src/ndbapi/NdbScanReceiver.hpp index 5e316719194..72f9e48f02c 100644 --- a/ndb/src/ndbapi/NdbScanReceiver.hpp +++ b/ndb/src/ndbapi/NdbScanReceiver.hpp @@ -24,7 +24,6 @@ #include "NdbReceiver.hpp" #include -#include class NdbScanReceiver { diff --git a/ndb/src/ndbapi/NdbSchemaOp.cpp b/ndb/src/ndbapi/NdbSchemaOp.cpp index 9f4d7fbcfd4..9e495229661 100644 --- a/ndb/src/ndbapi/NdbSchemaOp.cpp +++ b/ndb/src/ndbapi/NdbSchemaOp.cpp @@ -29,6 +29,7 @@ Documentation: Handles createTable and createAttribute calls Adjust: 980125 UABMNST First version. 020826 EMIKRON New version for new DICT *****************************************************************************/ +#include #include "NdbSchemaOp.hpp" #include "NdbSchemaCon.hpp" #include "API.hpp" @@ -139,6 +140,8 @@ NdbSchemaOp::createAttribute( const char* anAttrName, case String: col.setType(NdbDictionary::Column::Char); break; + case NoAttrTypeDef: + abort(); } col.setLength(anArraySize); col.setNullable(nullable); diff --git a/ndb/src/ndbapi/NdbUtil.hpp b/ndb/src/ndbapi/NdbUtil.hpp index eeee087d548..6a82af85987 100644 --- a/ndb/src/ndbapi/NdbUtil.hpp +++ b/ndb/src/ndbapi/NdbUtil.hpp @@ -29,8 +29,7 @@ Comment: #ifndef NdbUtil_H #define NdbUtil_H -#include -#include +#include #include "AttrType.hpp" class NdbApiSignal; diff --git a/ndb/src/ndbapi/Ndberr.cpp b/ndb/src/ndbapi/Ndberr.cpp new file mode 100644 index 00000000000..faa2f00cfce --- /dev/null +++ b/ndb/src/ndbapi/Ndberr.cpp @@ -0,0 +1,75 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include +#include "NdbImpl.hpp" +#include "NdbDictionaryImpl.hpp" +#include +#include +#include + + +static void +update(const NdbError & _err){ + NdbError & error = (NdbError &) _err; + ndberror_struct ndberror = (ndberror_struct)error; + ndberror_update(&ndberror); + error = NdbError(ndberror); +} + +const +NdbError & +Ndb::getNdbError(int code){ + theError.code = code; + update(theError); + return theError; +} + +const +NdbError & +Ndb::getNdbError() const { + update(theError); + return theError; +} + +const +NdbError & +NdbDictionaryImpl::getNdbError() const { + update(m_error); + return m_error; +} + +const +NdbError & +NdbConnection::getNdbError() const { + update(theError); + return theError; +} + +const +NdbError & +NdbOperation::getNdbError() const { + update(theError); + return theError; +} + +const +NdbError & +NdbSchemaCon::getNdbError() const { + update(theError); + return theError; +} diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp index e334c1bcc39..696dfe68e40 100644 --- a/ndb/src/ndbapi/Ndbif.cpp +++ b/ndb/src/ndbapi/Ndbif.cpp @@ -40,7 +40,6 @@ #include #include -#include /****************************************************************************** * int init( int aNrOfCon, int aNrOfOp ); diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index 9afbbf0df1f..be7acc48d7a 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -55,6 +55,7 @@ Parameters: aDataBase : Name of the database. Remark: Connect to the database. ***************************************************************************/ Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) : + theNdbObjectIdMap(0), thePreparedTransactionsArray(NULL), theSentTransactionsArray(NULL), theCompletedTransactionsArray(NULL), @@ -89,8 +90,7 @@ Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) : theFirstTransId(0), theRestartGCI(0), theNdbBlockNumber(-1), - theInitState(NotConstructed), - theNdbObjectIdMap(0) + theInitState(NotConstructed) { cgetSignals =0; cfreeSignals = 0; diff --git a/ndb/src/ndbapi/ObjectMap.hpp b/ndb/src/ndbapi/ObjectMap.hpp index a2a8d00b48f..4abb54b5081 100644 --- a/ndb/src/ndbapi/ObjectMap.hpp +++ b/ndb/src/ndbapi/ObjectMap.hpp @@ -17,10 +17,8 @@ #ifndef NDB_OBJECT_ID_MAP_HPP #define NDB_OBJECT_ID_MAP_HPP -#include +#include //#include -#include -#include #include //#define DEBUG_OBJECTMAP diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index 746ab169b41..f4a3ae3e87d 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -14,8 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include -#include "AttrType.hpp" +#include #include "TransporterFacade.hpp" #include "ClusterMgr.hpp" #include @@ -25,14 +26,12 @@ #include #include #include -#include #include "API.hpp" #include #include #include #include -#include #if !defined NDB_OSE && !defined NDB_SOFTOSE #include diff --git a/ndb/src/ndbapi/Ndberror.cpp b/ndb/src/ndbapi/ndberror.c similarity index 73% rename from ndb/src/ndbapi/Ndberror.cpp rename to ndb/src/ndbapi/ndberror.c index ee668605f0d..ea7cf4de426 100644 --- a/ndb/src/ndbapi/Ndberror.cpp +++ b/ndb/src/ndbapi/ndberror.c @@ -15,40 +15,46 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include -#include +#include -struct ErrorBundle { +typedef struct ErrorBundle { int code; - NdbError::Classification classification; + ndberror_classification classification; const char * message; -}; +} ErrorBundle; /** * Shorter names in table below */ -static const NdbError::Classification NE = NdbError::NoError; -static const NdbError::Classification AE = NdbError::ApplicationError; -static const NdbError::Classification ND = NdbError::NoDataFound; -static const NdbError::Classification CV = NdbError::ConstraintViolation; -static const NdbError::Classification SE = NdbError::SchemaError; -static const NdbError::Classification UD = NdbError::UserDefinedError; -static const NdbError::Classification IS = NdbError::InsufficientSpace; -static const NdbError::Classification TR = NdbError::TemporaryResourceError; -static const NdbError::Classification NR = NdbError::NodeRecoveryError; -static const NdbError::Classification OL = NdbError::OverloadError; -static const NdbError::Classification TO = NdbError::TimeoutExpired; -static const NdbError::Classification NS = NdbError::NodeShutdown; +#define ST_S ndberror_st_success +#define ST_P ndberror_st_permanent +#define ST_T ndberror_st_temporary +#define ST_U ndberror_st_unknown -static const NdbError::Classification UR = NdbError::UnknownResultError; +#define NE ndberror_cl_none +#define AE ndberror_cl_application +#define ND ndberror_cl_no_data_found +#define CV ndberror_cl_constraint_violation +#define SE ndberror_cl_schema_error +#define UD ndberror_cl_user_defined -static const NdbError::Classification IE = NdbError::InternalError; -static const NdbError::Classification NI = NdbError::FunctionNotImplemented; -static const NdbError::Classification UE = NdbError::UnknownErrorCode; +#define IS ndberror_cl_insufficient_space +#define TR ndberror_cl_temporary_resource +#define NR ndberror_cl_node_recovery +#define OL ndberror_cl_overload +#define TO ndberror_cl_timeout_expired +#define NS ndberror_cl_node_shutdown + +#define UR ndberror_cl_unknown_result + +#define IE ndberror_cl_internal_error +#define NI ndberror_cl_function_not_implemented +#define UE ndberror_cl_unknown_error_code + +static const char* empty_string = ""; static const @@ -90,7 +96,7 @@ ErrorBundle ErrorCodes[] = { * Node shutdown */ { 280, NS, "Transaction aborted due to node shutdown" }, - // This scan trans had an active fragment scan in a LQH which have crashed + /* This scan trans had an active fragment scan in a LQH which have crashed */ { 270, NS, "Transaction aborted due to node shutdown" }, { 1223, NS, "Read operation aborted due to node shutdown" }, { 4023, NS, "Transaction aborted due to node shutdown" }, @@ -152,9 +158,9 @@ ErrorBundle ErrorCodes[] = { * TimeoutExpired */ { 266, TO, "Time-out in NDB, probably caused by deadlock" }, - { 274, TO, "Time-out in NDB, probably caused by deadlock" }, // Scan trans timeout - { 296, TO, "Time-out in NDB, probably caused by deadlock" }, // Scan trans timeout - { 297, TO, "Time-out in NDB, probably caused by deadlock" }, // Scan trans timeout, temporary!! + { 274, TO, "Time-out in NDB, probably caused by deadlock" }, /* Scan trans timeout */ + { 296, TO, "Time-out in NDB, probably caused by deadlock" }, /* Scan trans timeout */ + { 297, TO, "Time-out in NDB, probably caused by deadlock" }, /* Scan trans timeout, temporary!! */ { 237, TO, "Transaction had timed out when trying to commit it" }, @@ -420,41 +426,60 @@ static const int NbErrorCodes = sizeof(ErrorCodes)/sizeof(ErrorBundle); -struct ErrorStatusClassification { - NdbError::Status status; - NdbError::Classification classification; -}; +typedef struct ErrorStatusMessage { + ndberror_status status; + const char * message; +} ErrorStatusMessage; + +typedef struct ErrorStatusClassification { + ndberror_status status; + ndberror_classification classification; + const char * message; +} ErrorStatusClassification; /** * Mapping between classification and status */ static const -ErrorStatusClassification StatusClassificationMapping[] = { - { NdbError::Success, NdbError::NoError }, - { NdbError::PermanentError, NdbError::ApplicationError }, - { NdbError::PermanentError, NdbError::NoDataFound }, - { NdbError::PermanentError, NdbError::ConstraintViolation }, - { NdbError::PermanentError, NdbError::SchemaError }, - { NdbError::PermanentError, NdbError::UserDefinedError }, - { NdbError::PermanentError, NdbError::InsufficientSpace }, - - { NdbError::TemporaryError, NdbError::TemporaryResourceError }, - { NdbError::TemporaryError, NdbError::NodeRecoveryError }, - { NdbError::TemporaryError, NdbError::OverloadError }, - { NdbError::TemporaryError, NdbError::TimeoutExpired }, - { NdbError::TemporaryError, NdbError::NodeShutdown }, - - { NdbError::UnknownResult , NdbError::UnknownResultError }, - { NdbError::UnknownResult , NdbError::UnknownErrorCode }, - - { NdbError::PermanentError, NdbError::InternalError }, - { NdbError::PermanentError, NdbError::FunctionNotImplemented } +ErrorStatusMessage StatusMessageMapping[] = { + { ST_S, "Success"}, + { ST_P, "Permanent error"}, + { ST_T, "Temporary error"}, + { ST_U ,"Unknown result"} }; static const -int Nb = sizeof(StatusClassificationMapping)/sizeof(ErrorStatusClassification); +int NbStatus = sizeof(StatusMessageMapping)/sizeof(ErrorStatusMessage); + +static +const +ErrorStatusClassification StatusClassificationMapping[] = { + { ST_S, NE, "No error"}, + { ST_P, AE, "Application error"}, + { ST_P, ND, "No data found"}, + { ST_P, CV, "Constraint violation"}, + { ST_P, SE, "Schema error"}, + { ST_P, UD, "User defined error"}, + { ST_P, IS, "Insufficient space"}, + + { ST_T, TR, "Temporary Resource error"}, + { ST_T, NR, "Node Recovery error"}, + { ST_T, OL, "Overload error"}, + { ST_T, TO, "Timeout expired"}, + { ST_T, NS, "Node shutdown"}, + + { ST_U , UR, "Unknown result error"}, + { ST_U , UE, "Unknown error code"}, + + { ST_P, IE, "Internal error"}, + { ST_P, NI, "Function not implemented"} +}; + +static +const +int NbClassification = sizeof(StatusClassificationMapping)/sizeof(ErrorStatusClassification); /** * Complete all fields of an NdbError given the error code @@ -462,64 +487,67 @@ int Nb = sizeof(StatusClassificationMapping)/sizeof(ErrorStatusClassification); */ static void -set(NdbError & error, int code, const char * details, ...){ - error.code = code; - - va_list ap; - va_start(ap, details); - vsnprintf(error.details, sizeof(error.details), details, ap); - va_end(ap); +set(ndberror_struct * error, int code, const char * details, ...){ + error->code = code; + { + va_list ap; + va_start(ap, details); + vsnprintf(error->details, sizeof(error->details), details, ap); + va_end(ap); + } } -static + void -update(const NdbError & _err){ - NdbError & error = (NdbError &) _err; +ndberror_update(ndberror_struct * error){ - bool found = false; - for(int i = 0; icode){ + error->classification = ErrorCodes[i].classification; + error->message = ErrorCodes[i].message; + found = 1; break; } } if(!found){ - error.classification = NdbError::UnknownErrorCode; - error.message = "Unknown error code"; + error->classification = UE; + error->message = "Unknown error code"; } - found = false; - for(int i = 0; iclassification){ + error->status = StatusClassificationMapping[i].status; + found = 1; break; } } if(!found){ - error.status = NdbError::UnknownResult; + error->status = ST_U; } - error.details = 0; + error->details = 0; } -bool +int checkErrorCodes(){ - for(int i = 0; i - -/** - * operators - */ -NdbOut & -operator<<(NdbOut & out, const NdbError & error){ - if(error.message != 0) - out << error.code << ": " << error.message; - else - out << error.code << ": "; - return out; +const char *ndberror_status_message(ndberror_status status) +{ + int i; + for (i= 0; i < NbStatus; i++) + if (StatusMessageMapping[i].status == status) + return StatusMessageMapping[i].message; + return empty_string; } -NdbOut & -operator<<(NdbOut & out, const NdbError::Status & status){ - switch(status) { - case NdbError::Success: out << "Success"; break; - case NdbError::TemporaryError: out << "Temporary error"; break; - case NdbError::PermanentError: out << "Permanent error"; break; - case NdbError::UnknownResult: out << "Unknown result"; break; - } - return out; +const char *ndberror_classification_message(ndberror_classification classification) +{ + int i; + for (i= 0; i < NbClassification; i++) + if (StatusClassificationMapping[i].classification == classification) + return StatusClassificationMapping[i].message; + return empty_string; } -NdbOut & -operator<<(NdbOut & out, const NdbError::Classification & classification){ - switch(classification) { - case NdbError::NoError: out << "No error"; break; - case NdbError::ApplicationError: out << "Application error"; break; - case NdbError::NoDataFound: out << "No data found"; break; - case NdbError::ConstraintViolation: out << "Constraint violation"; break; - case NdbError::SchemaError: out << "Schema error"; break; - case NdbError::UserDefinedError: out << "User defined error"; break; - case NdbError::InsufficientSpace: out << "Insufficient space"; break; - case NdbError::TemporaryResourceError: out << "Temporary Resource error"; - break; - case NdbError::NodeRecoveryError: out << "Node Recovery error"; break; - case NdbError::OverloadError: out << "Overload error"; break; - case NdbError::TimeoutExpired: out << "Timeout expired"; break; - case NdbError::UnknownResultError: out << "Unknown result error"; break; - case NdbError::InternalError: out << "Internal error"; break; - case NdbError::FunctionNotImplemented: out << "Function not implemented"; - break; - case NdbError::UnknownErrorCode: out << "Unknown error code"; break; - case NdbError::NodeShutdown: out << "Node shutdown"; break; - } - return out; +int ndb_error_string(int err_no, char *str, unsigned int size) +{ + ndberror_struct error; + unsigned int len; + + error.code = err_no; + ndberror_update(&error); + + len = snprintf(str, size-1, "%s: %s: %s", error.message, + ndberror_status_message(error.status), ndberror_classification_message(error.classification)); + str[size-1]= '\0'; + + return len; } - -/****************************************************** - * - */ -#include "NdbImpl.hpp" -#include "NdbDictionaryImpl.hpp" -#include -#include -#include - - -const -NdbError & -Ndb::getNdbError(int code){ - theError.code = code; - update(theError); - return theError; -} - -const -NdbError & -Ndb::getNdbError() const { - update(theError); - return theError; -} - -const -NdbError & -NdbDictionaryImpl::getNdbError() const { - update(m_error); - return m_error; -} - -const -NdbError & -NdbConnection::getNdbError() const { - update(theError); - return theError; -} - -const -NdbError & -NdbOperation::getNdbError() const { - update(theError); - return theError; -} - -const -NdbError & -NdbSchemaCon::getNdbError() const { - update(theError); - return theError; -} - - - diff --git a/ndb/src/ndbapi/signal-sender/SignalSender.cpp b/ndb/src/ndbapi/signal-sender/SignalSender.cpp index d60f6240a9c..e642848dcee 100644 --- a/ndb/src/ndbapi/signal-sender/SignalSender.cpp +++ b/ndb/src/ndbapi/signal-sender/SignalSender.cpp @@ -14,7 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "SignalSender.hpp" #include "ConfigRetriever.hpp" #include diff --git a/ndb/src/ndbapi/signal-sender/SignalSender.hpp b/ndb/src/ndbapi/signal-sender/SignalSender.hpp index fffe027dbdd..e4e6c1931d2 100644 --- a/ndb/src/ndbapi/signal-sender/SignalSender.hpp +++ b/ndb/src/ndbapi/signal-sender/SignalSender.hpp @@ -17,11 +17,11 @@ #ifndef SIGNAL_SENDER_HPP #define SIGNAL_SENDER_HPP +#include #include #include #include #include -#include struct SimpleSignal { public: diff --git a/ndb/src/newtonapi/dba_binding.cpp b/ndb/src/newtonapi/dba_binding.cpp index 724f54c0e4b..63e48110b1d 100644 --- a/ndb/src/newtonapi/dba_binding.cpp +++ b/ndb/src/newtonapi/dba_binding.cpp @@ -367,6 +367,12 @@ matchSize(NdbDictionary::Column::Type t, unsigned b, Size_t s) { case NdbDictionary::Column::Datetime: case NdbDictionary::Column::Timespec: case NdbDictionary::Column::Blob: + case NdbDictionary::Column::Tinyint: + case NdbDictionary::Column::Tinyunsigned: + case NdbDictionary::Column::Smallint: + case NdbDictionary::Column::Smallunsigned: + case NdbDictionary::Column::Mediumint: + case NdbDictionary::Column::Mediumunsigned: case NdbDictionary::Column::Undefined: return false; } diff --git a/ndb/src/newtonapi/dba_error.cpp b/ndb/src/newtonapi/dba_error.cpp index 0a154ac1314..f05446522b0 100644 --- a/ndb/src/newtonapi/dba_error.cpp +++ b/ndb/src/newtonapi/dba_error.cpp @@ -15,9 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "dba_internal.hpp" -#include -#include static DBA_Error_t latestError = DBA_NO_ERROR; static DBA_ErrorCode_t latestNdbError = 0; diff --git a/ndb/src/newtonapi/dba_internal.hpp b/ndb/src/newtonapi/dba_internal.hpp index a021db40a7d..84ae7ba222b 100644 --- a/ndb/src/newtonapi/dba_internal.hpp +++ b/ndb/src/newtonapi/dba_internal.hpp @@ -17,17 +17,16 @@ #ifndef DBA_INTERNAL_HPP #define DBA_INTERNAL_HPP +#include + extern "C" { #include "dba.h" } #include #include -#include #include -#include - #ifndef INT_MAX #define INT_MAX 2147483647 #endif diff --git a/ndb/src/rep/Makefile b/ndb/src/rep/Makefile index 29482b72687..9688a68ec74 100644 --- a/ndb/src/rep/Makefile +++ b/ndb/src/rep/Makefile @@ -12,8 +12,6 @@ BIN_TARGET := ndb_rep BIN_TARGET_LIBS := BIN_TARGET_ARCHIVES += editline repstorage repadapters reprequestor reptransfer mgmapi NDB_API mgmsrvcommon -LDFLAGS_LOC = -lpthread - SOURCES = \ RepMain.cpp \ Requestor.cpp \ diff --git a/ndb/src/rep/RepApiService.cpp b/ndb/src/rep/RepApiService.cpp index f5d51f7990e..d07f7a59375 100644 --- a/ndb/src/rep/RepApiService.cpp +++ b/ndb/src/rep/RepApiService.cpp @@ -23,10 +23,8 @@ #include "RepApiInterpreter.hpp" #include "repapi/repapi.h" #include -#include #include -#include /** const char * name; const char * realName; diff --git a/ndb/src/rep/RepComponents.hpp b/ndb/src/rep/RepComponents.hpp index 8b24858271b..ff0f29e2128 100644 --- a/ndb/src/rep/RepComponents.hpp +++ b/ndb/src/rep/RepComponents.hpp @@ -26,7 +26,6 @@ #include - /** * Connection data */ diff --git a/ndb/src/rep/RepMain.cpp b/ndb/src/rep/RepMain.cpp index e00f6c0040c..d9f057be9a1 100644 --- a/ndb/src/rep/RepMain.cpp +++ b/ndb/src/rep/RepMain.cpp @@ -14,8 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include #include diff --git a/ndb/src/rep/Requestor.cpp b/ndb/src/rep/Requestor.cpp index af16fc33844..3c93a6394a4 100644 --- a/ndb/src/rep/Requestor.cpp +++ b/ndb/src/rep/Requestor.cpp @@ -14,7 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "Requestor.hpp" #include "ConfigRetriever.hpp" diff --git a/ndb/src/rep/Requestor.hpp b/ndb/src/rep/Requestor.hpp index ba753be60f2..735d2094bde 100644 --- a/ndb/src/rep/Requestor.hpp +++ b/ndb/src/rep/Requestor.hpp @@ -17,12 +17,13 @@ #ifndef REQUESTOR_HPP #define REQUESTOR_HPP +#include + #include #include #include #include #include -#include #include #include diff --git a/ndb/src/rep/adapters/AppNDB.hpp b/ndb/src/rep/adapters/AppNDB.hpp index c24774d4ed3..9563a1e41ab 100644 --- a/ndb/src/rep/adapters/AppNDB.hpp +++ b/ndb/src/rep/adapters/AppNDB.hpp @@ -18,13 +18,9 @@ #define APPNDB_HPP #include "NdbApi.hpp" -#include -#include - #include #include #include -#include #include #include diff --git a/ndb/src/rep/adapters/ExtNDB.cpp b/ndb/src/rep/adapters/ExtNDB.cpp index 5ba6bfbbe6e..eb541cdced9 100644 --- a/ndb/src/rep/adapters/ExtNDB.cpp +++ b/ndb/src/rep/adapters/ExtNDB.cpp @@ -14,7 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "ExtNDB.hpp" #include "ConfigRetriever.hpp" #include diff --git a/ndb/src/rep/adapters/ExtNDB.hpp b/ndb/src/rep/adapters/ExtNDB.hpp index c69f94d9a7e..bcbf51393aa 100644 --- a/ndb/src/rep/adapters/ExtNDB.hpp +++ b/ndb/src/rep/adapters/ExtNDB.hpp @@ -17,12 +17,13 @@ #ifndef EXTNDB_HPP #define EXTNDB_HPP +#include + #include #include #include #include #include -#include #include #include diff --git a/ndb/src/rep/dbug_hack.cpp b/ndb/src/rep/dbug_hack.cpp index 364325b55ae..74e5f080777 100644 --- a/ndb/src/rep/dbug_hack.cpp +++ b/ndb/src/rep/dbug_hack.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include "NdbOut.hpp" #include "rep_version.hpp" @@ -25,6 +25,7 @@ int replogEnabled; /** * @todo This should be implemented using MySQLs dbug library */ +#if 0 extern "C" void DBUG_PRINT(const char * fmt, ...) @@ -40,6 +41,7 @@ DBUG_PRINT(const char * fmt, ...) va_end(ap); #endif } +#endif extern "C" void diff --git a/ndb/src/rep/rep_version.hpp b/ndb/src/rep/rep_version.hpp index 0182f080730..3830f9c351c 100644 --- a/ndb/src/rep/rep_version.hpp +++ b/ndb/src/rep/rep_version.hpp @@ -29,7 +29,7 @@ extern "C" void -DBUG_PRINT(const char * fmt, ...); +DBUG_PRINT__(const char * fmt, ...); extern "C" void diff --git a/ndb/src/rep/repapi/repapi.cpp b/ndb/src/rep/repapi/repapi.cpp index 80274896004..d34ab098c9c 100644 --- a/ndb/src/rep/repapi/repapi.cpp +++ b/ndb/src/rep/repapi/repapi.cpp @@ -14,17 +14,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include "repapi.h" //#include "mgmapi_debug.h" #include -#include - -#include -#include -#include -#include #include #include #include diff --git a/ndb/src/rep/state/Interval.cpp b/ndb/src/rep/state/Interval.cpp index 75697fa7548..8266f19c58d 100644 --- a/ndb/src/rep/state/Interval.cpp +++ b/ndb/src/rep/state/Interval.cpp @@ -16,6 +16,8 @@ #include "Interval.hpp" +#undef min +#undef max Uint32 max(Uint32 a, Uint32 b) { return a > b ? a : b; } Uint32 min(Uint32 a, Uint32 b) { return a < b ? a : b; } diff --git a/ndb/src/rep/state/RepState.cpp b/ndb/src/rep/state/RepState.cpp index a34bff25d7f..d8a50961a3c 100644 --- a/ndb/src/rep/state/RepState.cpp +++ b/ndb/src/rep/state/RepState.cpp @@ -681,7 +681,7 @@ Properties * RepState::query(QueryCounter counter, Uint32 replicationId) if(prop == NULL) return NULL; NdbMutex_Lock(m_mutex); - if(counter != (Uint32)-1) + if(counter != ~(Uint32)0) getEpochState((Channel::Position)counter, prop ); prop->put("no_of_nodegroups", m_channel.getNoOfNodeGroups()); prop->put("subid", m_channel.getNoOfNodeGroups()); @@ -714,9 +714,13 @@ RepState::getEpochState(Channel::Position pos, Properties * p) */ pos_first--; pos_last--; + first_buf[pos_first]= '\0'; + last_buf[pos_last]= '\0'; +#if 0 sprintf(first_buf+pos_first,"",""); sprintf(last_buf + pos_last,"",""); - +#endif + p->put("first", first_buf); p->put("last", last_buf); diff --git a/ndb/src/rep/storage/GCIBuffer.cpp b/ndb/src/rep/storage/GCIBuffer.cpp index 5049e47ea66..013600b30a5 100644 --- a/ndb/src/rep/storage/GCIBuffer.cpp +++ b/ndb/src/rep/storage/GCIBuffer.cpp @@ -14,9 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "GCIBuffer.hpp" -#include -#include /***************************************************************************** * Constructor / Destructor diff --git a/ndb/src/rep/storage/GCIBuffer.hpp b/ndb/src/rep/storage/GCIBuffer.hpp index 5a07b149f81..8a8473d1d49 100644 --- a/ndb/src/rep/storage/GCIBuffer.hpp +++ b/ndb/src/rep/storage/GCIBuffer.hpp @@ -18,7 +18,7 @@ #define GCI_BUFFER_HPP #include "GCIPage.hpp" -#include "Vector.hpp" +#include #include #include diff --git a/ndb/src/rep/storage/GCIContainer.hpp b/ndb/src/rep/storage/GCIContainer.hpp index 173bb790a57..48cbc66bfbd 100644 --- a/ndb/src/rep/storage/GCIContainer.hpp +++ b/ndb/src/rep/storage/GCIContainer.hpp @@ -22,6 +22,7 @@ #include "LogRecord.hpp" #include "GCIBuffer.hpp" +#undef swap #include #include diff --git a/ndb/src/rep/storage/LogRecord.hpp b/ndb/src/rep/storage/LogRecord.hpp index ba2632e23c7..a0bf3d52372 100644 --- a/ndb/src/rep/storage/LogRecord.hpp +++ b/ndb/src/rep/storage/LogRecord.hpp @@ -17,8 +17,7 @@ #ifndef LOG_RECORD_HPP #define LOG_RECORD_HPP -#include -#include +#include #include /** diff --git a/ndb/src/rep/storage/NodeGroupInfo.hpp b/ndb/src/rep/storage/NodeGroupInfo.hpp index 605ccf76a38..3d0499d4425 100644 --- a/ndb/src/rep/storage/NodeGroupInfo.hpp +++ b/ndb/src/rep/storage/NodeGroupInfo.hpp @@ -18,12 +18,10 @@ #define NODE_GROUPINFO_HPP #include -#include #include #include #include //#include -#include #include "NodeGroup.hpp" #include diff --git a/ndb/src/rep/transfer/TransPS.cpp b/ndb/src/rep/transfer/TransPS.cpp index 7af53f24415..1f65e95850d 100644 --- a/ndb/src/rep/transfer/TransPS.cpp +++ b/ndb/src/rep/transfer/TransPS.cpp @@ -14,7 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "ConfigRetriever.hpp" #include diff --git a/ndb/src/rep/transfer/TransPS.hpp b/ndb/src/rep/transfer/TransPS.hpp index 35823f1eb19..b47f1acfca2 100644 --- a/ndb/src/rep/transfer/TransPS.hpp +++ b/ndb/src/rep/transfer/TransPS.hpp @@ -17,12 +17,10 @@ #ifndef TransPS_HPP #define TransPS_HPP -#include #include #include #include #include -#include #include #include diff --git a/ndb/src/rep/transfer/TransSS.cpp b/ndb/src/rep/transfer/TransSS.cpp index 5399bfb4e3f..83f4b570330 100644 --- a/ndb/src/rep/transfer/TransSS.cpp +++ b/ndb/src/rep/transfer/TransSS.cpp @@ -14,7 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "ConfigRetriever.hpp" diff --git a/ndb/src/rep/transfer/TransSS.hpp b/ndb/src/rep/transfer/TransSS.hpp index 90f320a079e..6f2089e46ac 100644 --- a/ndb/src/rep/transfer/TransSS.hpp +++ b/ndb/src/rep/transfer/TransSS.hpp @@ -17,12 +17,10 @@ #ifndef TransSS_HPP #define TransSS_HPP -#include #include #include #include #include -#include #include #include diff --git a/ndb/test/include/NDBT_Stats.hpp b/ndb/test/include/NDBT_Stats.hpp index 15a125dea86..28212bdba17 100644 --- a/ndb/test/include/NDBT_Stats.hpp +++ b/ndb/test/include/NDBT_Stats.hpp @@ -17,9 +17,7 @@ #ifndef NDBT_STATS_HPP #define NDBT_STATS_HPP -#include -#include -#include +#include class NDBT_Stats { public: diff --git a/ndb/test/include/NDBT_Table.hpp b/ndb/test/include/NDBT_Table.hpp index a4482fa8084..950c1f15ff7 100644 --- a/ndb/test/include/NDBT_Table.hpp +++ b/ndb/test/include/NDBT_Table.hpp @@ -17,11 +17,11 @@ #ifndef NDBT_TABLE_HPP #define NDBT_TABLE_HPP +#include + #include #include -#include - class NDBT_Attribute : public NdbDictionary::Column { friend class NdbOut& operator <<(class NdbOut&, const NDBT_Attribute &); public: diff --git a/ndb/test/include/NDBT_Test.hpp b/ndb/test/include/NDBT_Test.hpp index 41332bb570c..7a5d14689bc 100644 --- a/ndb/test/include/NDBT_Test.hpp +++ b/ndb/test/include/NDBT_Test.hpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/ndb/test/include/NdbTimer.hpp b/ndb/test/include/NdbTimer.hpp index 8d9a088b7b5..b0d500b5c2c 100644 --- a/ndb/test/include/NdbTimer.hpp +++ b/ndb/test/include/NdbTimer.hpp @@ -17,7 +17,6 @@ #ifndef NDBTIMER_H #define NDBTIMER_H -#include #include #include diff --git a/ndb/test/ndbapi/acid2/acid2.cpp b/ndb/test/ndbapi/acid2/acid2.cpp index 5835b76453e..434a0450daa 100644 --- a/ndb/test/ndbapi/acid2/acid2.cpp +++ b/ndb/test/ndbapi/acid2/acid2.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include #include diff --git a/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp b/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp index ee724236855..d84818baf24 100644 --- a/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp +++ b/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp @@ -15,8 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include #include diff --git a/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp b/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp index 0b6fc9c1f97..55e9081a598 100644 --- a/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp +++ b/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp @@ -15,8 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include #include diff --git a/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp b/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp index 7071de9f63e..ab3e862e8d2 100644 --- a/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp +++ b/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp @@ -15,8 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include #include diff --git a/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp b/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp index cfb2c93e4ad..ba8de9e4af1 100644 --- a/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp +++ b/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp b/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp index 155a35998bb..0c7d5d72473 100644 --- a/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp +++ b/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp b/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp index cc8e2792cbf..13136755de8 100644 --- a/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp +++ b/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp b/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp index f2b28d8b057..18881cae216 100644 --- a/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp +++ b/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp @@ -14,7 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include diff --git a/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp b/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp index eaa99e8a79d..55d04888144 100644 --- a/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp +++ b/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/test/ndbapi/create_tab/create_tab.cpp b/ndb/test/ndbapi/create_tab/create_tab.cpp index 2f2911b4ef4..8bb1e7a9572 100644 --- a/ndb/test/ndbapi/create_tab/create_tab.cpp +++ b/ndb/test/ndbapi/create_tab/create_tab.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp b/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp index 8e67493c003..59c57396acd 100644 --- a/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp +++ b/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp b/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp index 3938cd21f78..0822f3ee999 100644 --- a/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp +++ b/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp @@ -24,8 +24,6 @@ #include #include #include -#include -#include #include #include diff --git a/ndb/test/ndbapi/flexBench/flexBench.cpp b/ndb/test/ndbapi/flexBench/flexBench.cpp index 17d9be73925..809d11086bf 100644 --- a/ndb/test/ndbapi/flexBench/flexBench.cpp +++ b/ndb/test/ndbapi/flexBench/flexBench.cpp @@ -51,13 +51,9 @@ Arguments: #include "NdbApi.hpp" -#include -#include - #include #include #include -#include #include #include #include @@ -296,7 +292,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535) if(useLongKeys){ longKeyAttrName = (char **) malloc(sizeof(char*) * tNoOfLongPK); - for (int i = 0; i < tNoOfLongPK; i++) { + for (Uint32 i = 0; i < tNoOfLongPK; i++) { longKeyAttrName[i] = (char *) malloc(strlen("KEYATTR ") + 1); memset(longKeyAttrName[i], 0, strlen("KEYATTR ") + 1); sprintf(longKeyAttrName[i], "KEYATTR%i", i); @@ -535,7 +531,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535) waitForThreads(pThreadsData); void * tmp; - for(int i = 0; iequal(longKeyAttrName[i], (char *)longKeyAttrValue[count - 1][i], tSizeOfLongPK*4); } @@ -927,8 +923,8 @@ static void* flexBenchThread(void* pArg) if (useLongKeys == true) { // Only free these areas if they have been allocated // Otherwise cores will occur - for (int n = 0; n < tNoOfOperations; n++){ - for (int i = 0; i < tNoOfLongPK; i++) { + for (Uint32 n = 0; n < tNoOfOperations; n++){ + for (Uint32 i = 0; i < tNoOfLongPK; i++) { free(longKeyAttrValue[n][i]); } free(longKeyAttrValue[n]); @@ -1068,13 +1064,13 @@ static void sleepBeforeStartingTest(int seconds){ static int createTables(Ndb* pMyNdb){ - for (int i = 0; i < tNoOfAttributes; i++){ + for (Uint32 i = 0; i < tNoOfAttributes; i++){ snprintf(attrName[i], MAXSTRLEN, "COL%d", i); } // Note! Uses only uppercase letters in table name's // so that we can look at the tables with SQL - for (int i = 0; i < tNoOfTables; i++){ + for (Uint32 i = 0; i < tNoOfTables; i++){ if (theStdTableNameFlag == 0){ snprintf(tableName[i], MAXSTRLEN, "TAB%d_%d", i, (int)(NdbTick_CurrentMillisecond() / 1000)); @@ -1091,7 +1087,7 @@ createTables(Ndb* pMyNdb){ tmpTable.setStoredTable(!theTempTable); if(useLongKeys){ - for(int i = 0; i < tNoOfLongPK; i++) { + for(Uint32 i = 0; i < tNoOfLongPK; i++) { NdbDictionary::Column col(longKeyAttrName[i]); col.setType(NdbDictionary::Column::Unsigned); col.setLength(tSizeOfLongPK); diff --git a/ndb/test/ndbapi/flexHammer/flexHammer.cpp b/ndb/test/ndbapi/flexHammer/flexHammer.cpp index f8a519f021a..057efb31e74 100644 --- a/ndb/test/ndbapi/flexHammer/flexHammer.cpp +++ b/ndb/test/ndbapi/flexHammer/flexHammer.cpp @@ -57,8 +57,6 @@ Revision history: #include #include #include -#include -#include #include ErrorData * flexHammerErrorData; diff --git a/ndb/test/ndbapi/flexScan/flexScan.cpp b/ndb/test/ndbapi/flexScan/flexScan.cpp index 55163a99fbe..19fb6dc5ab0 100644 --- a/ndb/test/ndbapi/flexScan/flexScan.cpp +++ b/ndb/test/ndbapi/flexScan/flexScan.cpp @@ -59,12 +59,9 @@ #include #include #include -#include -#include #include #include #include -#include #define PKSIZE 1 #define FOREVER 1 diff --git a/ndb/test/ndbapi/flexTT/flexTT.cpp b/ndb/test/ndbapi/flexTT/flexTT.cpp index 1705f20b706..c45cbd95762 100644 --- a/ndb/test/ndbapi/flexTT/flexTT.cpp +++ b/ndb/test/ndbapi/flexTT/flexTT.cpp @@ -15,7 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NdbApi.hpp" +#include + +#include #include #include @@ -24,9 +26,6 @@ #include #include #include -#include -#include -#include #include #include diff --git a/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp b/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp index 6a00463339b..7cc883ab3e6 100644 --- a/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp +++ b/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp @@ -57,13 +57,9 @@ Arguments: #include "NdbApi.hpp" -#include -#include - #include #include #include -#include #include #include #include diff --git a/ndb/test/ndbapi/indexTest/index.cpp b/ndb/test/ndbapi/indexTest/index.cpp index d0eb490e1a0..508186de529 100644 --- a/ndb/test/ndbapi/indexTest/index.cpp +++ b/ndb/test/ndbapi/indexTest/index.cpp @@ -37,9 +37,8 @@ 1 - Invalid arguments * *************************************************** */ -#include -#include -#include +#include + #include #include #include diff --git a/ndb/test/ndbapi/indexTest2/index2.cpp b/ndb/test/ndbapi/indexTest2/index2.cpp index 5a3674f0bbf..e49113d2f1b 100644 --- a/ndb/test/ndbapi/indexTest2/index2.cpp +++ b/ndb/test/ndbapi/indexTest2/index2.cpp @@ -37,9 +37,8 @@ 1 - Invalid arguments * *************************************************** */ -#include -#include -#include +#include + #include #include #include diff --git a/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp b/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp index b9d1eca1cc9..a2352edf707 100644 --- a/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp +++ b/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp @@ -54,9 +54,6 @@ * *************************************************** */ -#include -#include -#include #include #include #include diff --git a/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp b/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp index 25eb1830de9..84a93414712 100644 --- a/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp +++ b/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp @@ -18,8 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include +#include #include "dbGenerator.h" #include diff --git a/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp b/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp index d7506c9dd2c..f613c66d07b 100644 --- a/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp +++ b/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp @@ -14,10 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include +#include #include #include diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h b/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h index c049cdbad33..22b7f564490 100644 --- a/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h +++ b/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h @@ -17,8 +17,7 @@ #ifndef MACROS_H #define MACROS_H -#include -#include +#include #include #define ERROR(x) {ndbout_c((x));} diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp b/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp index 91a061c7cf4..9e6c5e55e73 100644 --- a/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp +++ b/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp @@ -17,7 +17,7 @@ #ifndef NDB_ERROR_H #define NDB_ERROR_H -#include +#include #include #include "userInterface.h" #include diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp b/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp index ece82628ba7..fdbc229cc98 100644 --- a/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp +++ b/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp @@ -18,9 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include -#include +#include #include #include "ndb_schema.hpp" @@ -31,7 +29,6 @@ #include #include #include -#include /*************************************************************** * L O C A L C O N S T A N T S * diff --git a/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h b/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h index c6ad11016b2..2f4aeb30975 100644 --- a/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h +++ b/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h @@ -23,12 +23,6 @@ #include -/*************************************************************** -* M A C R O S * -***************************************************************/ - -typedef Uint32 uint32; - /***************************************************************/ /* C O N S T A N T S */ /***************************************************************/ @@ -62,14 +56,14 @@ typedef char GroupName[GROUP_NAME_LENGTH]; typedef char ChangedBy[CHANGED_BY_LENGTH]; typedef char ChangedTime[CHANGED_TIME_LENGTH]; typedef char SessionDetails[SESSION_DETAILS_LENGTH]; -typedef uint32 ServerId; -typedef uint32 ServerBit; -typedef uint32 GroupId; -typedef uint32 Location; -typedef uint32 Permission; +typedef Uint32 ServerId; +typedef Uint32 ServerBit; +typedef Uint32 GroupId; +typedef Uint32 Location; +typedef Uint32 Permission; -typedef uint32 Counter; -typedef uint32 ActiveSessions; +typedef Uint32 Counter; +typedef Uint32 ActiveSessions; typedef unsigned int BranchExecuted; typedef unsigned int DoRollback; diff --git a/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c b/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c index eedcd914d85..7484c7647f5 100644 --- a/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c +++ b/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c @@ -18,8 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include +#include #include "dbGenerator.h" /*************************************************************** diff --git a/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c b/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c index 6ddf0a47775..4a31db0b4e9 100644 --- a/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c +++ b/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c @@ -14,11 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#include +#include #include #include diff --git a/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c b/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c index 9f8629ec1f0..42fbb52f3b2 100644 --- a/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c +++ b/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c @@ -18,9 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include -#include +#include #include "userInterface.h" diff --git a/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c b/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c index 9dde902d006..838ac8a7196 100644 --- a/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c +++ b/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c @@ -14,9 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include #include "userInterface.h" #include "dbPopulate.h" diff --git a/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c b/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c index ca8a64ab59c..dd100507016 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c +++ b/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c @@ -18,7 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include +#include #include "userInterface.h" #include "userHandle.h" diff --git a/ndb/test/ndbapi/lmc-bench/src/user/macros.h b/ndb/test/ndbapi/lmc-bench/src/user/macros.h index beb4352c269..363f247b93f 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/macros.h +++ b/ndb/test/ndbapi/lmc-bench/src/user/macros.h @@ -17,8 +17,7 @@ #ifndef MACROS_H #define MACROS_H -#include -#include +#include #include #define ERROR(x) {ndbout_c((x)); } diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp b/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp index 5f792342ed9..b3aaeac822e 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp +++ b/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp @@ -17,7 +17,6 @@ #ifndef NDB_ERROR_H #define NDB_ERROR_H -#include #include #define error_handler(x,y, z) { \ diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp b/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp index 6a35bccd064..ce3a76cdd59 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp +++ b/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp @@ -19,7 +19,7 @@ extern "C" { #include "user_populate.h" } -#include +#include #include #include "ndb_schema.hpp" diff --git a/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c b/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c index c68f287f5dd..bacf1861dde 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c +++ b/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c @@ -18,10 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include -#include -#include +#include #include "userInterface.h" #include "userHandle.h" diff --git a/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c b/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c index 17069b0a042..a2f4787bb0c 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c +++ b/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c @@ -18,8 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include +#include #include #include "sql.h" diff --git a/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp b/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp index fc3f6955a47..67c4e037215 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp +++ b/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp @@ -18,9 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include -#include +#include #ifndef NDB_WIN32 #include #endif diff --git a/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c b/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c index 17069b0a042..a2f4787bb0c 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c +++ b/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c @@ -18,8 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include +#include #include #include "sql.h" diff --git a/ndb/test/ndbapi/restarter/restarter.cpp b/ndb/test/ndbapi/restarter/restarter.cpp index ad3507df98a..9a522f5dcac 100644 --- a/ndb/test/ndbapi/restarter/restarter.cpp +++ b/ndb/test/ndbapi/restarter/restarter.cpp @@ -26,8 +26,6 @@ #include #include #include -#include -#include int main(int argc, const char** argv){ diff --git a/ndb/test/ndbapi/restarter2/restarter2.cpp b/ndb/test/ndbapi/restarter2/restarter2.cpp index 71eaf1a9b0f..f2bcf6f8e7b 100644 --- a/ndb/test/ndbapi/restarter2/restarter2.cpp +++ b/ndb/test/ndbapi/restarter2/restarter2.cpp @@ -24,8 +24,6 @@ #include #include -#include -#include int main(int argc, const char** argv){ diff --git a/ndb/test/ndbapi/restarts/restarts.cpp b/ndb/test/ndbapi/restarts/restarts.cpp index 2f9bab3b233..0ec2883d53c 100644 --- a/ndb/test/ndbapi/restarts/restarts.cpp +++ b/ndb/test/ndbapi/restarts/restarts.cpp @@ -25,8 +25,6 @@ #include #include -#include -#include int main(int argc, const char** argv){ diff --git a/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp b/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp index 71fa286a21b..ce0aee35e8f 100644 --- a/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp +++ b/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp @@ -26,6 +26,8 @@ * *************************************************** */ +#include + #include #include #include @@ -36,11 +38,6 @@ #include #include -#include -#include -#include -#include - #define MAX_TIMERS 4 #define MAXSTRLEN 16 #define MAXATTR 64 diff --git a/ndb/test/ndbapi/telco/msa.cpp b/ndb/test/ndbapi/telco/msa.cpp index f074733dce4..39ddaac2019 100644 --- a/ndb/test/ndbapi/telco/msa.cpp +++ b/ndb/test/ndbapi/telco/msa.cpp @@ -14,17 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include #include #include #include -#include #include #include -#include const char* const c_szDatabaseName = "TEST_DB"; diff --git a/ndb/test/ndbapi/testBlobs/testBlobs.cpp b/ndb/test/ndbapi/testBlobs/testBlobs.cpp index b8fe51dc1e4..9f959702402 100644 --- a/ndb/test/ndbapi/testBlobs/testBlobs.cpp +++ b/ndb/test/ndbapi/testBlobs/testBlobs.cpp @@ -18,13 +18,8 @@ * testBlobs */ -#include -#include -#include -#include -#include -#include -#include +#include + #include #include #include diff --git a/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp b/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp index fd6570fad0a..b8e0fef6cef 100644 --- a/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp +++ b/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp @@ -28,14 +28,12 @@ * Creates tables TB00 to TB15 */ -#include -#include -#include +#include + #include #include #include #include -#include // limits static int const MaxAttr = 64; diff --git a/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp b/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp index 056aa9bf173..7fd2c19d9f7 100644 --- a/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp +++ b/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp @@ -31,8 +31,6 @@ #include #include #include -#include -#include #define CHECK(b) if (!(b)) { \ diff --git a/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp index 68fa6ec5474..a47d9d2099e 100644 --- a/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp +++ b/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp @@ -18,17 +18,12 @@ * testOIBasic - ordered index test */ -#include -#include -#include -#include -#include -#include +#include + #include #include #include #include -#include #include #include #include diff --git a/ndb/test/ndbapi/vw_test/bcd.h b/ndb/test/ndbapi/vw_test/bcd.h index ce1309693c8..d0aaffbd8b7 100644 --- a/ndb/test/ndbapi/vw_test/bcd.h +++ b/ndb/test/ndbapi/vw_test/bcd.h @@ -14,8 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include struct bcdtab { char tab[3]; diff --git a/ndb/test/ndbapi/vw_test/cdrserver.cpp b/ndb/test/ndbapi/vw_test/cdrserver.cpp index 3c3f32e8886..8354d28f53f 100644 --- a/ndb/test/ndbapi/vw_test/cdrserver.cpp +++ b/ndb/test/ndbapi/vw_test/cdrserver.cpp @@ -31,28 +31,22 @@ /* must also have the same entry (same port number) in its */ /* ./etc/services file. */ /* **************************************************************** */ + +#include + /******** NDB INCLUDE ******/ #include /***************************/ /*#include */ -#include -#include -#include #include #include -#include #include -#include -#include #include #include -#include #include #include #include #include -#include -#include extern "C" { #include "utv.h" diff --git a/ndb/test/ndbapi/vw_test/size.cpp b/ndb/test/ndbapi/vw_test/size.cpp index 397cc02f4f6..c506771ebde 100644 --- a/ndb/test/ndbapi/vw_test/size.cpp +++ b/ndb/test/ndbapi/vw_test/size.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include "utv.h" int main(void) diff --git a/ndb/test/newtonapi/basic_test/basic/basic.cpp b/ndb/test/newtonapi/basic_test/basic/basic.cpp index 90f5bf14acf..bc33400078d 100644 --- a/ndb/test/newtonapi/basic_test/basic/basic.cpp +++ b/ndb/test/newtonapi/basic_test/basic/basic.cpp @@ -26,7 +26,6 @@ extern "C" { #include #include #include -#include static const DBA_ColumnDesc_t EmpColDesc[] = { diff --git a/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp b/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp index fb26abc65aa..4120cfba864 100644 --- a/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp +++ b/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp @@ -26,7 +26,6 @@ extern "C" { #include #include #include -#include static const DBA_ColumnDesc_t EmpColDesc[] = { diff --git a/ndb/test/newtonapi/basic_test/common.cpp b/ndb/test/newtonapi/basic_test/common.cpp index 6fd63730832..d4c4e6a74a7 100644 --- a/ndb/test/newtonapi/basic_test/common.cpp +++ b/ndb/test/newtonapi/basic_test/common.cpp @@ -16,10 +16,6 @@ #include "common.hpp" -#include -#include -#include -#include NdbOut & operator << (NdbOut & out, const Employee_t & emp){ diff --git a/ndb/test/newtonapi/basic_test/common.hpp b/ndb/test/newtonapi/basic_test/common.hpp index e081df723ef..0df8f7e078d 100644 --- a/ndb/test/newtonapi/basic_test/common.hpp +++ b/ndb/test/newtonapi/basic_test/common.hpp @@ -17,12 +17,13 @@ #ifndef COMMON_H #define COMMON_H +#include + extern "C" { #include } #include -#include typedef struct Employee { UInt32_t EmpNo; diff --git a/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp b/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp index fc6dfc40372..2c9cee5be87 100644 --- a/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp +++ b/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp @@ -26,7 +26,6 @@ extern "C" { #include #include #include -#include static const DBA_ColumnDesc_t ColDesc[] = { diff --git a/ndb/test/newtonapi/basic_test/too_basic.cpp b/ndb/test/newtonapi/basic_test/too_basic.cpp index 9099f0d9154..883aacf8841 100644 --- a/ndb/test/newtonapi/basic_test/too_basic.cpp +++ b/ndb/test/newtonapi/basic_test/too_basic.cpp @@ -18,6 +18,9 @@ /****** THIS LINE IS 80 CHARACTERS WIDE - DO *NOT* EXCEED 80 CHARACTERS! ****/ +#include +#include + //#include //#include //#include "pcn_types.h" @@ -27,13 +30,6 @@ extern "C" { #include } -#include -#include -#include -#include - - - typedef struct Employee { UInt32_t EmpNo; diff --git a/ndb/test/newtonapi/perf_test/perf.cpp b/ndb/test/newtonapi/perf_test/perf.cpp index 81d4cc5fd08..7b818e93a2a 100644 --- a/ndb/test/newtonapi/perf_test/perf.cpp +++ b/ndb/test/newtonapi/perf_test/perf.cpp @@ -15,14 +15,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + extern "C" { #include } -#include -#include -#include - #include #include #include @@ -31,6 +29,9 @@ extern "C" { #include #include +#undef min +#undef max + static const int NP_Insert = 0; static const int NP_Update = 1; static const int NP_WriteUpdate = 2; diff --git a/ndb/test/odbc/driver/testOdbcDriver.cpp b/ndb/test/odbc/driver/testOdbcDriver.cpp index 9731c00eeaf..b856b6a21f2 100644 --- a/ndb/test/odbc/driver/testOdbcDriver.cpp +++ b/ndb/test/odbc/driver/testOdbcDriver.cpp @@ -36,12 +36,7 @@ * Test of ODBC and SQL using a fixed set of tables. */ -#include -#include -#include -#include -#include -#include +#include #include #include #include @@ -49,9 +44,7 @@ #ifdef ndbODBC #include #endif -#include #include -#include #undef BOOL diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp index 1ce9124431c..eb8a626dc2b 100644 --- a/ndb/test/run-test/main.cpp +++ b/ndb/test/run-test/main.cpp @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include #include diff --git a/ndb/test/run-test/run-test.hpp b/ndb/test/run-test/run-test.hpp index 8387f8638ed..8d00a7b6a55 100644 --- a/ndb/test/run-test/run-test.hpp +++ b/ndb/test/run-test/run-test.hpp @@ -24,6 +24,8 @@ #include #include +#undef MYSQL_CLIENT + enum ErrorCodes { ERR_OK = 0, ERR_NDB_FAILED = 101, diff --git a/ndb/test/src/HugoAsynchTransactions.cpp b/ndb/test/src/HugoAsynchTransactions.cpp index d045032d455..2af22b5f48d 100644 --- a/ndb/test/src/HugoAsynchTransactions.cpp +++ b/ndb/test/src/HugoAsynchTransactions.cpp @@ -473,6 +473,10 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb, } } break; + case NO_INSERT: + case NO_UPDATE: + case NO_DELETE: + abort(); } // Close all transactions diff --git a/ndb/test/src/HugoCalculator.cpp b/ndb/test/src/HugoCalculator.cpp index 9e2ba9f143e..55aa96a4909 100644 --- a/ndb/test/src/HugoCalculator.cpp +++ b/ndb/test/src/HugoCalculator.cpp @@ -15,8 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "HugoCalculator.hpp" -#include -#include #include /* ************************************************************* @@ -159,7 +157,7 @@ HugoCalculator::verifyRowValues(NDBT_ResultRow* const pRow) const{ << ", NdbDict::Column::getLength(): " << attr->getLength() << endl; const char* buf2 = pRow->attributeStore(i)->aRef(); - for (int j = 0; j < pRow->attributeStore(i)->arraySize(); j++) + for (Uint32 j = 0; j < pRow->attributeStore(i)->arraySize(); j++) { g_err << j << ":" << buf[j] << "[" << buf2[j] << "]"; if (buf[j] != buf2[j]) diff --git a/ndb/test/src/HugoOperations.cpp b/ndb/test/src/HugoOperations.cpp index edcec460ba0..91263aa29b4 100644 --- a/ndb/test/src/HugoOperations.cpp +++ b/ndb/test/src/HugoOperations.cpp @@ -652,7 +652,7 @@ void HugoOperations::deallocRows(){ int HugoOperations::saveCopyOfRecord(int numRecords ){ - if (numRecords > rows.size()) + if (numRecords > (int)rows.size()) return NDBT_FAILED; for (int i = 0; i < numRecords; i++){ @@ -662,7 +662,7 @@ int HugoOperations::saveCopyOfRecord(int numRecords ){ } BaseString HugoOperations::getRecordStr(int recordNum){ - if (recordNum > rows.size()) + if (recordNum > (int)rows.size()) return NULL; return rows[recordNum]->c_str(); } @@ -673,7 +673,7 @@ int HugoOperations::getRecordGci(int recordNum){ int HugoOperations::compareRecordToCopy(int numRecords ){ - if (numRecords > rows.size()) + if (numRecords > (int)rows.size()) return NDBT_FAILED; if ((unsigned)numRecords > savedRecords.size()) return NDBT_FAILED; diff --git a/ndb/test/src/HugoTransactions.cpp b/ndb/test/src/HugoTransactions.cpp index 1293d395974..7f12484ddc8 100644 --- a/ndb/test/src/HugoTransactions.cpp +++ b/ndb/test/src/HugoTransactions.cpp @@ -1253,9 +1253,11 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats, g_info << " UPDATE: "; recEvent = recUpdateEvent; break; + case NdbDictionary::Event::TE_ALL: + abort(); } - if (pk < records) { + if ((int)pk < records) { recEvent[pk].pk = pk; recEvent[pk].count++; } @@ -1304,7 +1306,7 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats, if (stats.n_updates > 0) { stats.n_consecutive++; } - for (Uint32 i = 0; i < records/3; i++) { + for (Uint32 i = 0; i < (Uint32)records/3; i++) { if (recInsertEvent[i].pk != i) { stats.n_consecutive ++; ndbout << "missing insert pk " << i << endl; diff --git a/ndb/test/src/NDBT_Error.cpp b/ndb/test/src/NDBT_Error.cpp index 92c0b2e5c1f..ffacb3eb928 100644 --- a/ndb/test/src/NDBT_Error.cpp +++ b/ndb/test/src/NDBT_Error.cpp @@ -17,11 +17,9 @@ /* NDBT_Error.cpp */ /* This program deals with error handling */ -#include -#include +#include #include #include -#include #include #include #include diff --git a/ndb/test/src/NDBT_ResultRow.cpp b/ndb/test/src/NDBT_ResultRow.cpp index 098e4cfb796..ba46be203e1 100644 --- a/ndb/test/src/NDBT_ResultRow.cpp +++ b/ndb/test/src/NDBT_ResultRow.cpp @@ -14,10 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "NDBT_ResultRow.hpp" -#include -#include -#include #include NDBT_ResultRow::NDBT_ResultRow(const NdbDictionary::Table& tab, @@ -68,6 +66,7 @@ NDBT_ResultRow::attributeStore(const char* name){ return data[i]; } assert(false); + return 0; } NdbOut & @@ -191,7 +190,8 @@ NDBT_ResultRow::clone () const { NDBT_ResultRow * row = new NDBT_ResultRow(m_table, ad[0]); row->m_ownData = true; - for(Uint32 i = 0; idata[i] = data[i]->clone(); } diff --git a/ndb/test/src/NDBT_ReturnCodes.cpp b/ndb/test/src/NDBT_ReturnCodes.cpp index 542547c7a48..5bffc00177f 100644 --- a/ndb/test/src/NDBT_ReturnCodes.cpp +++ b/ndb/test/src/NDBT_ReturnCodes.cpp @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* System include files */ +#include + #include "NDBT_ReturnCodes.h" /* Ndb include files */ #include -/* System include files */ -#include - const char* rcodeToChar(int rcode){ switch (rcode){ case NDBT_OK: diff --git a/ndb/test/src/NDBT_Table.cpp b/ndb/test/src/NDBT_Table.cpp index 2bd2c265f10..c520b01c990 100644 --- a/ndb/test/src/NDBT_Table.cpp +++ b/ndb/test/src/NDBT_Table.cpp @@ -15,8 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "NDBT_Table.hpp" -#include -#include #include #include diff --git a/ndb/test/src/NDBT_Tables.cpp b/ndb/test/src/NDBT_Tables.cpp index 41a38e4fe44..548e755a3fb 100644 --- a/ndb/test/src/NDBT_Tables.cpp +++ b/ndb/test/src/NDBT_Tables.cpp @@ -18,7 +18,6 @@ #include #include -#include /* ******************************************************* */ // Define Ndb standard tables // diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp index 689aae64c81..6cbb69508f5 100644 --- a/ndb/test/src/NdbBackup.cpp +++ b/ndb/test/src/NdbBackup.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -67,7 +66,6 @@ NdbBackup::getFileSystemPathForNode(int _node_id){ /** * Fetch configuration from management server */ - char buf[255]; ConfigRetriever cr; diff --git a/ndb/test/src/NdbConfig.cpp b/ndb/test/src/NdbConfig.cpp index d61b74cf62b..3a254bc1577 100644 --- a/ndb/test/src/NdbConfig.cpp +++ b/ndb/test/src/NdbConfig.cpp @@ -17,7 +17,6 @@ #include "NdbConfig.hpp" #include #include -#include #include #include #include @@ -32,7 +31,6 @@ NdbConfig::getPropsForNode(unsigned int node_id, /** * Fetch configuration from management server */ - char buf[255]; ConfigRetriever cr; @@ -112,7 +110,6 @@ NdbConfig::getHostName(unsigned int node_id, /** * Fetch configuration from management server */ - char buf[255]; ConfigRetriever cr; diff --git a/ndb/test/src/NdbGrep.cpp b/ndb/test/src/NdbGrep.cpp index 747c62d5bc6..8b7442b0e77 100644 --- a/ndb/test/src/NdbGrep.cpp +++ b/ndb/test/src/NdbGrep.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp index 1df214572c7..cc2fab46cc5 100644 --- a/ndb/test/src/NdbRestarter.cpp +++ b/ndb/test/src/NdbRestarter.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #define MGMERR(h) \ ndbout << "latest_error="< + #include -#include #include #include #include diff --git a/ndb/test/tools/hugoFill/hugoFill.cpp b/ndb/test/tools/hugoFill/hugoFill.cpp index 748623cb253..dee6ce2e6c8 100644 --- a/ndb/test/tools/hugoFill/hugoFill.cpp +++ b/ndb/test/tools/hugoFill/hugoFill.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp b/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp index 90c08649ec2..e2c2cd13f00 100644 --- a/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp +++ b/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp b/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp index f77dc21bd0b..1855f19796f 100644 --- a/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp +++ b/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/tools/hugoPkRead/hugoPkRead.cpp b/ndb/test/tools/hugoPkRead/hugoPkRead.cpp index 2e9c2c35260..50351f08195 100644 --- a/ndb/test/tools/hugoPkRead/hugoPkRead.cpp +++ b/ndb/test/tools/hugoPkRead/hugoPkRead.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp b/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp index 6335c391bc3..ac17ffffee8 100644 --- a/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp +++ b/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp @@ -14,8 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include -#include #include #include #include diff --git a/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp b/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp index 141d01e3aee..e7edc3a991d 100644 --- a/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp +++ b/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/tools/hugoScanRead/hugoScanRead.cpp b/ndb/test/tools/hugoScanRead/hugoScanRead.cpp index 2376280d004..47ea8f4a8a7 100644 --- a/ndb/test/tools/hugoScanRead/hugoScanRead.cpp +++ b/ndb/test/tools/hugoScanRead/hugoScanRead.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp b/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp index 56cd3b8c969..3e2255ca0f3 100644 --- a/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp +++ b/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/tools/restart/restart.cpp b/ndb/test/tools/restart/restart.cpp index f391aecabe1..88cfb231a72 100644 --- a/ndb/test/tools/restart/restart.cpp +++ b/ndb/test/tools/restart/restart.cpp @@ -15,7 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include + #include #include #include @@ -24,8 +25,6 @@ #include #include -#include -#include int main(int argc, const char** argv){ diff --git a/ndb/test/tools/waiter/waiter.cpp b/ndb/test/tools/waiter/waiter.cpp index 14803fec71d..d57daff3aea 100644 --- a/ndb/test/tools/waiter/waiter.cpp +++ b/ndb/test/tools/waiter/waiter.cpp @@ -25,7 +25,6 @@ #include #include -#include int main(int argc, const char** argv){ diff --git a/ndb/tools/copy_tab/copy_tab.cpp b/ndb/tools/copy_tab/copy_tab.cpp index 32cfb0b35ff..33ce8e01d9a 100644 --- a/ndb/tools/copy_tab/copy_tab.cpp +++ b/ndb/tools/copy_tab/copy_tab.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/tools/cpcc/cpcc.cpp b/ndb/tools/cpcc/cpcc.cpp index 5a826f250c0..e768d707bbc 100644 --- a/ndb/tools/cpcc/cpcc.cpp +++ b/ndb/tools/cpcc/cpcc.cpp @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include "CpcClient.hpp" #include @@ -116,7 +116,7 @@ public: } virtual bool evaluate(SimpleCpcClient* c,const SimpleCpcClient::Process & p){ - return p.m_id == id && c == host; + return p.m_id == (int)id && c == host; } }; diff --git a/ndb/tools/create_index/create_index.cpp b/ndb/tools/create_index/create_index.cpp index 32da39a5208..dc9e6c606d6 100644 --- a/ndb/tools/create_index/create_index.cpp +++ b/ndb/tools/create_index/create_index.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/tools/delete_all/delete_all.cpp b/ndb/tools/delete_all/delete_all.cpp index e78ad4a2e1e..9cbba503e68 100644 --- a/ndb/tools/delete_all/delete_all.cpp +++ b/ndb/tools/delete_all/delete_all.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/tools/drop_index/drop_index.cpp b/ndb/tools/drop_index/drop_index.cpp index 146f01113b2..327f15741c9 100644 --- a/ndb/tools/drop_index/drop_index.cpp +++ b/ndb/tools/drop_index/drop_index.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/tools/drop_tab/drop_tab.cpp b/ndb/tools/drop_tab/drop_tab.cpp index 5946ada5956..70e5d85aabe 100644 --- a/ndb/tools/drop_tab/drop_tab.cpp +++ b/ndb/tools/drop_tab/drop_tab.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/tools/list_tables/listTables.cpp b/ndb/tools/list_tables/listTables.cpp index c14808050c6..41433862304 100644 --- a/ndb/tools/list_tables/listTables.cpp +++ b/ndb/tools/list_tables/listTables.cpp @@ -21,8 +21,9 @@ * */ -#include +#include #include + #include #include diff --git a/ndb/tools/select_all/select_all.cpp b/ndb/tools/select_all/select_all.cpp index 32e9d1c6872..34f63a095bb 100644 --- a/ndb/tools/select_all/select_all.cpp +++ b/ndb/tools/select_all/select_all.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/tools/select_count/select_count.cpp b/ndb/tools/select_count/select_count.cpp index 4d281b9bdd5..b1513ad4135 100644 --- a/ndb/tools/select_count/select_count.cpp +++ b/ndb/tools/select_count/select_count.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/tools/transproxy/transproxy.cpp b/ndb/tools/transproxy/transproxy.cpp index 4c1308e63e7..384a8a34f03 100644 --- a/ndb/tools/transproxy/transproxy.cpp +++ b/ndb/tools/transproxy/transproxy.cpp @@ -14,14 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#include -#include -#include -#include +#include #include #include diff --git a/ndb/tools/verify_index/verify_index.cpp b/ndb/tools/verify_index/verify_index.cpp index 324bb11cfe4..1295b657e9b 100644 --- a/ndb/tools/verify_index/verify_index.cpp +++ b/ndb/tools/verify_index/verify_index.cpp @@ -14,9 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include -#include -#include #include #include diff --git a/netware/BUILD/compile-netware-all b/netware/BUILD/compile-netware-all index 6baff699e94..dbe64e8f97e 100755 --- a/netware/BUILD/compile-netware-all +++ b/netware/BUILD/compile-netware-all @@ -11,5 +11,5 @@ path=`dirname $0` $path/compile-netware-src $path/compile-netware-standard $path/compile-netware-debug -#$path/compile-netware-max -#$path/compile-netware-max-debug +$path/compile-netware-max +$path/compile-netware-max-debug diff --git a/netware/BUILD/compile-netware-standard b/netware/BUILD/compile-netware-standard index 45f5021862c..a21ea16a445 100755 --- a/netware/BUILD/compile-netware-standard +++ b/netware/BUILD/compile-netware-standard @@ -14,6 +14,7 @@ suffix="standard" extra_configs=" \ --with-innodb \ + --enable-thread-safe-client \ " . $path/compile-netware-END diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv index e4e6d509100..6f818b6f7a3 100755 --- a/netware/BUILD/mwenv +++ b/netware/BUILD/mwenv @@ -6,9 +6,9 @@ # the default is "F:/mydev" export MYDEV="WINE_BUILD_DIR" -export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV;$MYDEV/zlib-1.1.4"" -export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/zlib-1.1.4;$MYDEV/mysql-VERSION/netware/BUILD" -export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a;knetware.imp" +export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/fs64/headers;$MYDEV;$MYDEV/zlib-1.1.4" +export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/fs64/imports;$MYDEV/zlib-1.1.4;$MYDEV/mysql-VERSION/netware/BUILD" +export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a;neb.imp;zPublics.imp;knetware.imp" export WINEPATH="$MYDEV/mw/bin" diff --git a/netware/Makefile.am b/netware/Makefile.am index 881dafe883e..1f0277ef20e 100644 --- a/netware/Makefile.am +++ b/netware/Makefile.am @@ -33,7 +33,8 @@ netware_build_files = client/mysql.def client/mysqladmin.def \ isam/isamlog.def isam/pack_isam.def \ libmysqld/libmysqld.def myisam/myisamchk.def \ myisam/myisamlog.def myisam/myisampack.def \ - sql/mysqld.def + sql/mysqld.def extra/mysql_waitpid.def \ + extra/resolve_stack_dump.def myisam/myisam_ftdump.def link_sources: set -x; \ diff --git a/netware/init_db.sql b/netware/init_db.sql index 063c1815eb1..52e08333a93 100644 --- a/netware/init_db.sql +++ b/netware/init_db.sql @@ -20,7 +20,7 @@ INSERT INTO user (host,user) values ('',''); CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions'; -CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(60) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; +CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges'; diff --git a/netware/my_manage.c b/netware/my_manage.c index 1c1e75990b4..f5aa3163431 100644 --- a/netware/my_manage.c +++ b/netware/my_manage.c @@ -180,7 +180,7 @@ int sleep_until_file_exists(char *pid_file) Wait for the server on the given port to start. ******************************************************************************/ -int wait_for_server_start(char *bin_dir, char *user, char *password, int port) +int wait_for_server_start(char *bin_dir, char *user, char *password, int port,char *tmp_dir) { arg_list_t al; int err, i; @@ -189,7 +189,7 @@ int wait_for_server_start(char *bin_dir, char *user, char *password, int port) // mysqladmin file snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir); - snprintf(trash, PATH_MAX, "/tmp/trash.out"); + snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir); // args init_args(&al); @@ -283,7 +283,7 @@ int spawn(char *path, arg_list_t *al, int join, char *input, ******************************************************************************/ int stop_server(char *bin_dir, char *user, char *password, int port, - char *pid_file) + char *pid_file,char *tmp_dir) { arg_list_t al; int err, i, argc = 0; @@ -292,7 +292,7 @@ int stop_server(char *bin_dir, char *user, char *password, int port, // mysqladmin file snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir); - snprintf(trash, PATH_MAX, "/tmp/trash.out"); + snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir); // args init_args(&al); diff --git a/netware/my_manage.h b/netware/my_manage.h index 4215ae59a25..480eefbe55a 100644 --- a/netware/my_manage.h +++ b/netware/my_manage.h @@ -97,11 +97,11 @@ void free_args(arg_list_t *); int sleep_until_file_exists(char *); int sleep_until_file_deleted(char *); -int wait_for_server_start(char *, char *, char *, int); +int wait_for_server_start(char *, char *, char *, int,char *); int spawn(char *, arg_list_t *, int, char *, char *, char *); -int stop_server(char *, char *, char *, int, char *); +int stop_server(char *, char *, char *, int, char *,char *); pid_t get_server_pid(char *); void kill_server(pid_t pid); diff --git a/netware/myisam_ftdump.def b/netware/myisam_ftdump.def new file mode 100644 index 00000000000..259d6617445 --- /dev/null +++ b/netware/myisam_ftdump.def @@ -0,0 +1,12 @@ +#------------------------------------------------------------------------------ +# MySQL MyISAM Dump Tool +#------------------------------------------------------------------------------ +MODULE libc.nlm +SCREENNAME "MySQL MyISAM Table Dump Tool" +COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +DESCRIPTION "MySQL MyISAM Table Dump Tool" +VERSION 4, 0 +STACKSIZE 65536 +XDCDATA ../netware/mysql.xdc +#DEBUG + diff --git a/netware/mysql_install_db.c b/netware/mysql_install_db.c index b4060bfdb7e..355e18b819a 100644 --- a/netware/mysql_install_db.c +++ b/netware/mysql_install_db.c @@ -386,7 +386,8 @@ int main(int argc, char **argv) if (!autoclose) setscreenmode(SCR_NO_MODE); // header - printf("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE); + printf("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, + MACHINE_TYPE); // create paths create_paths(); diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c index e1a07baca6c..06d5e5985c1 100644 --- a/netware/mysql_test_run.c +++ b/netware/mysql_test_run.c @@ -53,6 +53,7 @@ #define TEST_SKIP "[ skip ]" #define TEST_FAIL "[ fail ]" #define TEST_BAD "[ bad ]" +#define TEST_IGNORE "[ignore]" /****************************************************************************** @@ -69,7 +70,8 @@ int master_port = 9306; int slave_port = 9307; // comma delimited list of tests to skip or empty string -char skip_test[PATH_MAX] = ""; +char skip_test[PATH_MAX] = " lowercase_table3 , system_mysql_db_fix "; +char ignore_test[PATH_MAX] = ""; char bin_dir[PATH_MAX]; char mysql_test_dir[PATH_MAX]; @@ -107,6 +109,7 @@ int total_pass = 0; int total_fail = 0; int total_test = 0; +int total_ignore = 0; double total_time = 0; int use_openssl = FALSE; @@ -393,7 +396,7 @@ void start_master() { sleep_until_file_exists(master_pid); - if ((err = wait_for_server_start(bin_dir, user, password, master_port)) == 0) + if ((err = wait_for_server_start(bin_dir, user, password, master_port,mysql_tmp_dir)) == 0) { master_running = TRUE; } @@ -582,7 +585,7 @@ void start_slave() { sleep_until_file_exists(slave_pid); - if ((err = wait_for_server_start(bin_dir, user, password, slave_port)) == 0) + if ((err = wait_for_server_start(bin_dir, user, password, slave_port,mysql_tmp_dir)) == 0) { slave_running = TRUE; } @@ -633,7 +636,7 @@ void stop_slave() if (!slave_running) return; // stop - if ((err = stop_server(bin_dir, user, password, slave_port, slave_pid)) == 0) + if ((err = stop_server(bin_dir, user, password, slave_port, slave_pid,mysql_tmp_dir)) == 0) { slave_running = FALSE; } @@ -657,7 +660,7 @@ void stop_master() // running? if (!master_running) return; - if ((err = stop_server(bin_dir, user, password, master_port, master_pid)) == 0) + if ((err = stop_server(bin_dir, user, password, master_port, master_pid,mysql_tmp_dir)) == 0) { master_running = FALSE; } @@ -778,21 +781,31 @@ void run_test(char *test) char temp[PATH_MAX]; char *rstr; double elapsed = 0; - int skip = FALSE; + int skip = FALSE, ignore=FALSE; int restart = FALSE; int flag = FALSE; struct stat info; // single test? - if (!single_test) +// if (!single_test) { // skip tests in the skip list snprintf(temp, PATH_MAX, " %s ", test); skip = (strindex(skip_test, temp) != NULL); + if( skip == FALSE ) + ignore = (strindex(ignore_test, temp) != NULL); } - // skip test? - if (!skip) + if(ignore) + { + // show test + log("%-46s ", test); + + // ignore + rstr = TEST_IGNORE; + ++total_ignore; + } + else if (!skip) // skip test? { char test_file[PATH_MAX]; char master_opt_file[PATH_MAX]; @@ -1148,9 +1161,33 @@ void setup(char *file) ******************************************************************************/ int main(int argc, char **argv) { + int is_ignore_list = 0; // setup setup(argv[0]); + /* The --ignore option is comma saperated list of test cases to skip and should + * be very first command line option to the test suite. + * The usage is now: + * mysql_test_run --ignore=test1,test2 test3 test4 + * where test1 and test2 are test cases to ignore + * and test3 and test4 are test cases to run. */ + if( argc >= 2 && !strnicmp(argv[1], "--ignore=", sizeof("--ignore=")-1) ) + { + char *temp, *token; + temp=strdup(strchr(argv[1],'=') + 1); + for(token=strtok(temp, ","); token != NULL; token=strtok(NULL, ",")) + { + if( strlen(ignore_test) + strlen(token) + 2 <= PATH_MAX-1 ) + sprintf( ignore_test+strlen(ignore_test), " %s ", token); + else + { + free(temp); + die("ignore list too long."); + } + } + free(temp); + is_ignore_list = 1; + } // header log("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE); @@ -1165,14 +1202,14 @@ int main(int argc, char **argv) log(HEADER); log(DASH); - if (argc > 1) + if ( argc > 1 + is_ignore_list ) { int i; // single test single_test = TRUE; - for (i = 1; i < argc; i++) + for (i = 1 + is_ignore_list; i < argc; i++) { // run given test run_test(argv[i]); diff --git a/netware/mysql_waitpid.def b/netware/mysql_waitpid.def new file mode 100644 index 00000000000..4d56d29c42f --- /dev/null +++ b/netware/mysql_waitpid.def @@ -0,0 +1,12 @@ +#------------------------------------------------------------------------------ +# Wait for a Program to Terminate +#------------------------------------------------------------------------------ +MODULE libc.nlm +#SCREENNAME "MySQL Tool - Wait for a Program to Terminate" +COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +DESCRIPTION "MySQL Tool - Wait for a Program to Terminate" +VERSION 4, 0 +STACKSIZE 65536 +XDCDATA ../netware/mysql.xdc +#DEBUG + diff --git a/netware/resolve_stack_dump.def b/netware/resolve_stack_dump.def new file mode 100644 index 00000000000..21fd177fbc7 --- /dev/null +++ b/netware/resolve_stack_dump.def @@ -0,0 +1,12 @@ +#------------------------------------------------------------------------------ +# Resolve Stack Dump +#------------------------------------------------------------------------------ +MODULE libc.nlm +#SCREENNAME "MySQL Stack Dump Resolve Tool" +COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +DESCRIPTION "MySQL Stack Dump Resolve Tool" +VERSION 4, 0 +STACKSIZE 65536 +XDCDATA ../netware/mysql.xdc +#DEBUG + diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 0d36fa2affe..341726fd89b 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -87,25 +87,8 @@ do fi done -# Non platform-specific doc files: -DOC_FILES=" \ - COPYING README LICENSE.doc \ - Docs/mysqlbug.txt \ -"; - -# Platform-specific doc files: -if [ $BASE_SYSTEM = "netware" ] ; then - DOC_FILES="$DOC_FILES \ - README.NW \ - "; -# For all other platforms: -else - DOC_FILES="$DOC_FILES \ - Docs/INSTALL-BINARY MySQLEULA.txt \ - "; -fi - -for i in $DOC_FILES +for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \ + MySQLEULA.txt LICENSE.doc README.NW do if [ -f $i ] then @@ -170,6 +153,7 @@ done if [ $BASE_SYSTEM = "netware" ] ; then $CP -r netware/*.pl $BASE/scripts + $CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl fi for i in \ @@ -186,7 +170,7 @@ do fi done -# convert the libs to .lib for NetWare +# convert the .a to .lib for NetWare if [ $BASE_SYSTEM = "netware" ] ; then for i in $BASE/lib/*.a do @@ -241,6 +225,7 @@ $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/* $CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then + chmod a+x $BASE/bin/* $CP scripts/* $BASE/bin $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ \@pkgdatadir\@ ./support-files < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server @@ -254,6 +239,16 @@ fi rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh + +# +# Remove system dependent files +# +if [ $BASE_SYSTEM = "netware" ] ; then + rm -f $BASE/MySQLEULA.txt +else + rm -f $BASE/README.NW +fi + # Make safe_mysqld a symlink to mysqld_safe for backwards portability # To be removed in MySQL 4.1 if [ $BASE_SYSTEM != "netware" ] ; then @@ -329,19 +324,7 @@ which_1 () exit 1 } -cd $TMP - -if [ $BASE_SYSTEM = "netware" ] ; then - - # - # Create a zip file for NetWare users - # - - if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi - zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME - echo "$NEW_NAME.zip created" - -else +if [ $BASE_SYSTEM != "netware" ] ; then # # Create the result tar file @@ -354,6 +337,7 @@ else fi echo "Using $tar to create archive" + cd $TMP OPT=cvf if [ x$SILENT = x1 ] ; then @@ -362,15 +346,25 @@ else $tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME cd $SOURCE - echo "Compressing archive" + rm -f $NEW_NAME.tar.gz gzip -9 $NEW_NAME.tar + echo "Removing temporary directory" + rm -r -f $BASE echo "$NEW_NAME.tar.gz created" +else + + # + # Create a zip file for NetWare users + # + + cd $TMP + if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi + zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME + echo "Removing temporary directory" + rm -r -f $BASE + + echo "$NEW_NAME.zip created" fi - -echo "Removing temporary directory" -rm -r -f $BASE - - diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 57612ac8edc..68ba488f3d5 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -326,6 +326,10 @@ fi if [ -f scripts/mysql_install_db ]; then print_debug "Initializing the 'data' directory" scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data + if test "$?" = 1 + then + exit 1; + fi fi # diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 61d173aac05..abde6ecbe73 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -10,6 +10,8 @@ in_rpm=0 windows=0 defaults="" +tmp_file=/tmp/mysql_install_db.$$ + case "$1" in --no-defaults|--defaults-file=*|--defaults-extra-file=*) defaults="$1"; shift @@ -212,9 +214,11 @@ then then echo "Fill help tables" fi - if ! (echo "use mysql; - " - cat $fill_help_tables) | eval "$mysqld_install_cmd_line" + echo "use mysql;" > $tmp_file + cat $tmp_file $fill_help_tables | eval "$mysqld_install_cmd_line" + res=$? + rm $tmp_file + if test $res != 0 then echo "" echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index ab06215c3ac..6388855eaa6 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -7,6 +7,7 @@ use File::Basename; use File::Path; use DBI; use Sys::Hostname; +use File::Copy; =head1 NAME @@ -230,6 +231,10 @@ elsif (defined($tgt_name) && ($tgt_name =~ m:/: || $tgt_name eq '.')) { elsif ( $opt{suffix} ) { print "Using copy suffix '$opt{suffix}'\n" unless $opt{quiet}; } +elsif ( ($^O =~ m/^(NetWare)$/) && defined($tgt_name) && ($tgt_name =~ m:\\: || $tgt_name eq '.')) +{ + $tgt_dirname = $tgt_name; +} else { $tgt_name="" if (!defined($tgt_name)); @@ -421,8 +426,11 @@ foreach my $rdb ( @db_desc ) { else { mkdir($tgt_dirpath, 0750) or die "Can't create '$tgt_dirpath': $!\n" unless -d $tgt_dirpath; + if ($^O !~ m/^(NetWare)$/) + { my @f_info= stat "$datadir/$rdb->{src}"; chown $f_info[4], $f_info[5], $tgt_dirpath; + } } } } @@ -578,7 +586,15 @@ sub copy_files { my @cmd; print "Copying ".@$files." files...\n" unless $opt{quiet}; - if ($method =~ /^s?cp\b/) { # cp or scp with optional flags + if ($^O =~ m/^(NetWare)$/) # on NetWare call PERL copy (slower) + { + foreach my $file ( @$files ) + { + copy($file, $target."/".basename($file)); + } + } + elsif ($method =~ /^s?cp\b/) # cp or scp with optional flags + { my $cp = $method; # add option to preserve mod time etc of copied files # not critical, but nice to have @@ -717,7 +733,7 @@ sub retire_directory { if ( -d $tgt_oldpath ) { print "Deleting previous 'old' hotcopy directory ('$tgt_oldpath')\n" unless $opt{quiet}; - rmtree([$tgt_oldpath]) + rmtree([$tgt_oldpath],0,1); } rename($dir, $tgt_oldpath) or die "Can't rename $dir=>$tgt_oldpath: $!\n"; diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh index be24e015553..8ec62442b11 100644 --- a/sql-bench/crash-me.sh +++ b/sql-bench/crash-me.sh @@ -414,8 +414,7 @@ if ($dbh->do("create table crash_q (a integer, b integer,c1 CHAR(10))") && ["with add primary key", "alter table crash_q1 add primary key(c1)"]); report("Alter table add foreign key",'alter_add_foreign_key', - "alter table crash_q add constraint f1 foreign key(c1)", - " references crash_q1(c1)"); + "alter table crash_q add constraint f1 foreign key(c1) references crash_q1(c1)"); try_and_report("Alter table drop foreign key",'alter_drop_foreign_key', ["with drop constraint", "alter table crash_q drop constraint f1"], diff --git a/sql-bench/limits/mysql-4.0.cfg b/sql-bench/limits/mysql-4.0.cfg index feaa79e43e9..35bdc9fa842 100644 --- a/sql-bench/limits/mysql-4.0.cfg +++ b/sql-bench/limits/mysql-4.0.cfg @@ -13,6 +13,8 @@ NEG=yes # update of column= -column ###As far as all queries returned OK, result is YES Need_cast_for_null=no # Need to cast NULL for arithmetic ### Check if numeric_null (NULL) is 'NULL' + ### Check if numeric_null (NULL) is 'NULL' + ### Check if numeric_null (NULL) is 'NULL' alter_add_col=yes # Alter table add column ###< alter table crash_q add d integer ###> OK @@ -187,6 +189,22 @@ constraint_check=syntax only # Column constraints ### ###< drop table crash_q ###> OK + ###< create table crash_q (a int check (a>0)) + ###> OK + ### + ###< insert into crash_q values(0) + ###> OK + ### + ###< drop table crash_q + ###> OK + ###< create table crash_q (a int check (a>0)) + ###> OK + ### + ###< insert into crash_q values(0) + ###> OK + ### + ###< drop table crash_q + ###> OK constraint_check_named=syntax only # Named constraints ###< create table crash_q (a int ,b int, constraint abc check (a>b)) ###> OK @@ -196,6 +214,22 @@ constraint_check_named=syntax only # Named constraints ### ###< drop table crash_q ###> OK + ###< create table crash_q (a int ,b int, constraint abc check (a>b)) + ###> OK + ### + ###< insert into crash_q values(0,0) + ###> OK + ### + ###< drop table crash_q + ###> OK + ###< create table crash_q (a int ,b int, constraint abc check (a>b)) + ###> OK + ### + ###< insert into crash_q values(0,0) + ###> OK + ### + ###< drop table crash_q + ###> OK constraint_check_table=syntax only # Table constraints ###< create table crash_q (a int ,b int, check (a>b)) ###> OK @@ -205,6 +239,22 @@ constraint_check_table=syntax only # Table constraints ### ###< drop table crash_q ###> OK + ###< create table crash_q (a int ,b int, check (a>b)) + ###> OK + ### + ###< insert into crash_q values(0,0) + ###> OK + ### + ###< drop table crash_q + ###> OK + ###< create table crash_q (a int ,b int, check (a>b)) + ###> OK + ### + ###< insert into crash_q values(0,0) + ###> OK + ### + ###< drop table crash_q + ###> OK constraint_null=yes # NULL constraint (SyBase style) ###< create table crash_q (a int null) ###> OK @@ -348,6 +398,20 @@ date_format_inresult=iso # Date format in result ###> 2003-08-27 ###< delete from crash_me_d ###> OK + ###< insert into crash_me_d values( sysdate() ) + ###> OK + ### + ###< select a from crash_me_d + ###> 2004-05-20 + ###< delete from crash_me_d + ###> OK + ###< insert into crash_me_d values( sysdate() ) + ###> OK + ### + ###< select a from crash_me_d + ###> 2004-05-20 + ###< delete from crash_me_d + ###> OK date_infinity=error # Supports 'infinity dates ###< create table crash_me2 (a date not null) ###> OK @@ -460,6 +524,14 @@ drop_requires_cascade=no # drop table require cascade/restrict ###> OK ###< drop table crash_me ###> OK + ###< create table crash_me (a integer not null) + ###> OK + ###< drop table crash_me + ###> OK + ###< create table crash_me (a integer not null) + ###> OK + ###< drop table crash_me + ###> OK drop_restrict=yes # drop table with cascade/restrict ###< create table crash_q (a int) ###> OK @@ -524,6 +596,40 @@ foreign_key=syntax only # foreign keys ### ###< drop table crash_me_qf ###> OK + ###< create table crash_me_qf (a integer not null,primary key (a)) + ###> OK + ### + ###< create table crash_me_qf2 (a integer not null,foreign key (a) references crash_me_qf (a)) + ###> OK + ### + ###< insert into crash_me_qf values (1) + ###> OK + ### + ###< insert into crash_me_qf2 values (2) + ###> OK + ### + ###< drop table crash_me_qf2 + ###> OK + ### + ###< drop table crash_me_qf + ###> OK + ###< create table crash_me_qf (a integer not null,primary key (a)) + ###> OK + ### + ###< create table crash_me_qf2 (a integer not null,foreign key (a) references crash_me_qf (a)) + ###> OK + ### + ###< insert into crash_me_qf values (1) + ###> OK + ### + ###< insert into crash_me_qf2 values (2) + ###> OK + ### + ###< drop table crash_me_qf2 + ###> OK + ### + ###< drop table crash_me_qf + ###> OK full_outer_join=no # full outer join ###< select crash_me.a from crash_me full join crash_me2 ON ### crash_me.a=crash_me2.a @@ -856,6 +962,10 @@ func_extra_months_between=no # Function MONTHS_BETWEEN func_extra_noround=no # Function NOROUND ###< select noround(22.6) ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(22.6)' at line 1 + ###< select noround(22.6) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(22.6)' at line 1 + ###< select noround(22.6) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(22.6)' at line 1 func_extra_not=yes # Function NOT in SELECT ### ###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') ### ###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 ### ###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 ### ###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') ### ###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 ### ###4 ###We expected '5' but got '4' + ###4 + ###We expected '5' but got '4' func_odbc_year=yes # Function YEAR ###< insert into crash_me_d values('1997-02-01') ### ### 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 ### ### 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 ### ### 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 ### 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 + ### + ### 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 ###