From dc6a186659f83736141738424a1f4f287d4b5078 Mon Sep 17 00:00:00 2001 From: "wax@kishkin.ru" <> Date: Mon, 3 Jan 2005 18:37:08 +0500 Subject: [PATCH 01/14] WL#964 added sort of file names for all OS --- .bzrignore | 54 +++++++++++++++++++++++++++++++++ mysql-test/mysql_test_run_new.c | 37 +++++++++++----------- 2 files changed, 72 insertions(+), 19 deletions(-) diff --git a/.bzrignore b/.bzrignore index ee48342fd37..bfa4ef2058c 100644 --- a/.bzrignore +++ b/.bzrignore @@ -948,3 +948,57 @@ client/mysqladmin.c mysql-4.1.8-win-src.zip ndb/include/ndb_version.h ndb/include/ndb_global.h +mysql-test/mysql-test-run.log +mysql-test/r/alter_table.err +mysql-test/r/archive.err +mysql-test/r/bdb-alter-table-1.err +mysql-test/r/bdb-alter-table-2.err +mysql-test/r/bdb-crash.err +mysql-test/r/bdb-deadlock.err +mysql-test/r/bdb.err +mysql-test/r/bdb_cache.err +mysql-test/r/client_test.err +mysql-test/r/csv.err +mysql-test/r/ctype_ucs.err +mysql-test/r/derived.err +mysql-test/r/exampledb.err +mysql-test/r/func_encrypt.err +mysql-test/r/isam.err +mysql-test/r/lowercase_table2.err +mysql-test/r/multi_update.err +mysql-test/r/mysql_protocols.err +mysql-test/r/mysqlbinlog.err +mysql-test/r/mysqlbinlog2.err +mysql-test/r/mysqldump.err +mysql-test/r/mysqltest.err +mysql-test/r/ndb_alter_table.err +mysql-test/r/ndb_autodiscover.err +mysql-test/r/ndb_autodiscover2.err +mysql-test/r/ndb_basic.err +mysql-test/r/ndb_blob.err +mysql-test/r/ndb_cache.err +mysql-test/r/ndb_charset.err +mysql-test/r/ndb_index.err +mysql-test/r/ndb_index_ordered.err +mysql-test/r/ndb_index_unique.err +mysql-test/r/ndb_insert.err +mysql-test/r/ndb_limit.err +mysql-test/r/ndb_lock.err +mysql-test/r/ndb_minmax.err +mysql-test/r/ndb_replace.err +mysql-test/r/ndb_subquery.err +mysql-test/r/ndb_transaction.err +mysql-test/r/ndb_truncate.err +mysql-test/r/ndb_types.err +mysql-test/r/ndb_update.err +mysql-test/r/openssl_1.err +mysql-test/r/ps_1general.err +mysql-test/r/ps_6bdb.err +mysql-test/r/ps_7ndb.err +mysql-test/r/query_cache.err +mysql-test/r/query_cache_merge.err +mysql-test/r/raid.err +mysql-test/r/repair.err +mysql-test/r/replace.err +mysql-test/r/rpl000001.err +mysql-test/r/rpl000015.err diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index fe13d71c1c2..7b77fc5ced8 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -89,15 +89,15 @@ static char master_socket[FN_REFLEN]= "./var/tmp/master.sock"; static char slave_socket[FN_REFLEN]= "./var/tmp/slave.sock"; #endif +#define MAX_COUNT_TESTES 1024 /* comma delimited list of tests to skip or empty string */ #ifndef __WIN__ static char skip_test[FN_REFLEN]= " lowercase_table3 , system_mysql_db_fix "; +#define _stricmp strcasecmp #else /* The most ignore testes contain the calls of system command -*/ -#define MAX_COUNT_TESTES 1024 -/* + lowercase_table3 is disabled by Gerg system_mysql_db_fix is disabled by Gerg sp contains a command system @@ -1437,12 +1437,11 @@ void setup(char *file __attribute__((unused))) /* Compare names of testes for right order */ -#ifdef __WIN__ int compare( const void *arg1, const void *arg2 ) { return _stricmp( * ( char** ) arg1, * ( char** ) arg2 ); } -#endif + /****************************************************************************** @@ -1454,6 +1453,10 @@ int compare( const void *arg1, const void *arg2 ) int main(int argc, char **argv) { int is_ignore_list= 0; + char **names= 0; + char **testes= 0; + int name_index; + int index; /* setup */ setup(argv[0]); @@ -1517,6 +1520,9 @@ int main(int argc, char **argv) else { /* run all tests */ + names= malloc(MAX_COUNT_TESTES*4); + testes= names; + name_index= 0; #ifndef __WIN__ struct dirent *entry; DIR *parent; @@ -1536,8 +1542,11 @@ int main(int argc, char **argv) { /* null terminate at the suffix */ *(test + position - 1)= '\0'; - /* run test */ - run_test(test); + /* insert test */ + *names= malloc(FN_REFLEN); + strcpy(*names,test); + names++; + name_index++; } } closedir(parent); @@ -1549,10 +1558,6 @@ int main(int argc, char **argv) char mask[FN_REFLEN]; char *p; int position; - char **names= 0; - char **testes= 0; - int name_index; - int index; /* single test */ single_test= FALSE; @@ -1564,9 +1569,6 @@ int main(int argc, char **argv) die("Unable to open tests directory."); } - names= malloc(MAX_COUNT_TESTES*4); - testes= names; - name_index= 0; do { @@ -1577,10 +1579,8 @@ int main(int argc, char **argv) /* find the test suffix */ if ((position= strinstr(test, TEST_SUFFIX)) != 0) { - p= test + position - 1; /* null terminate at the suffix */ - *p= 0; - + *(test + position - 1)= '\0'; /* insert test */ *names= malloc(FN_REFLEN); strcpy(*names,test); @@ -1591,7 +1591,7 @@ int main(int argc, char **argv) }while (_findnext(handle,&dir) == 0); _findclose(handle); - +#endif qsort( (void *)testes, name_index, sizeof( char * ), compare ); for (index= 0; index <= name_index; index++) @@ -1601,7 +1601,6 @@ int main(int argc, char **argv) } free(testes); -#endif } /* stop server */ From 76d0f49495ea712054d07affd07f874c84934627 Mon Sep 17 00:00:00 2001 From: "ingo@mysql.com" <> Date: Mon, 3 Jan 2005 20:48:49 +0100 Subject: [PATCH 02/14] Fixed a typo. --- mysys/mf_keycaches.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/mf_keycaches.c b/mysys/mf_keycaches.c index 8bf203e249f..fee3096de52 100644 --- a/mysys/mf_keycaches.c +++ b/mysys/mf_keycaches.c @@ -235,7 +235,7 @@ static my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length, if (my_hash_insert(&hash->hash, (byte*) entry)) { /* This can only happen if hash got out of memory */ - my_delete((char*) entry, MYF(0)); + my_free((char*) entry, MYF(0)); error= 1; goto end; } From 0f835244a6100ba573b166ce25ddd87b7d148dda Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Mon, 3 Jan 2005 23:02:26 +0100 Subject: [PATCH 03/14] Fix typo in crash-me 'MATCHES' test (Bug # 5875) --- sql-bench/crash-me.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh index 8ec62442b11..a40ef8fbc7d 100644 --- a/sql-bench/crash-me.sh +++ b/sql-bench/crash-me.sh @@ -1039,7 +1039,7 @@ try_and_report("Automatic row id", "automatic_rowid", ["MATCH UNIQUE","match_unique", "1 match unique (select a from crash_me)",1,0], ["MATCH","match","1 match (select a from crash_me)",1,0], - ["MATCHES","matches","b matcjhes 'a*'",1,0], + ["MATCHES","matches","b matches 'a*'",1,0], ["NOT BETWEEN","not_between","7 not between 4 and 6",1,0], ["NOT EXISTS","not_exists", "not exists (select * from crash_me where a = 2)",1,0], From 663396653ab5ebed874d7ec89daf6e8e86472c9e Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 4 Jan 2005 01:49:29 +0100 Subject: [PATCH 04/14] Use 'ps xaww' in mysqld_safe (on Linux) so whole command-line is searched for port and/or pid-file parameters. (Bug #5878) --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 1f4d17f8885..270c08679eb 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -322,13 +322,13 @@ do # but should work for the rest of the servers. # The only thing is ps x => redhat 5 gives warnings when using ps -x. # kill -9 is used or the process won't react on the kill. - numofproces=`ps xa | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"` + numofproces=`ps xaww | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"` echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log I=1 while test "$I" -le "$numofproces" do - PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "pid-file=$pid_file" | sed -n '$p'` + PROC=`ps xaww | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "pid-file=$pid_file" | sed -n '$p'` for T in $PROC do From 954d0181ec65595d887bd2953c0b8a4bbd228ef1 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 4 Jan 2005 02:45:01 +0100 Subject: [PATCH 05/14] Make query_cache_wlock_invalidate visible in SHOW VARIABLES (Bug #7594) --- sql/set_var.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/set_var.cc b/sql/set_var.cc index d5aadbfbdab..122daa0ea95 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -593,6 +593,8 @@ struct show_var_st init_vars[]= { {sys_query_cache_limit.name,(char*) &sys_query_cache_limit, SHOW_SYS}, {sys_query_cache_size.name, (char*) &sys_query_cache_size, SHOW_SYS}, {sys_query_cache_type.name, (char*) &sys_query_cache_type, SHOW_SYS}, + {sys_query_cache_wlock_invalidate.name, + (char*) &sys_query_cache_wlock_invalidate, SHOW_SYS}, #endif /* HAVE_QUERY_CACHE */ {sys_query_prealloc_size.name, (char*) &sys_query_prealloc_size, SHOW_SYS}, {sys_range_alloc_block_size.name, (char*) &sys_range_alloc_block_size, From 913f50576956b8b07c161f01aa09979c7dd34b64 Mon Sep 17 00:00:00 2001 From: "paul@kite-hub.kitebird.com" <> Date: Tue, 4 Jan 2005 10:32:42 -0600 Subject: [PATCH 06/14] client.c: Make multi-statements the preferred option name (to coincide with the renaming of the CLIENT_MULTI_RESULTS symbol to CLIENT_MULTI_STATEMENTS). Continue to allow multi-queries for backward compatibility. --- sql-common/client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql-common/client.c b/sql-common/client.c index 87a781e0a0d..b6813ee4cfc 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -882,7 +882,7 @@ static const char *default_options[]= "connect-timeout", "local-infile", "disable-local-infile", "replication-probe", "enable-reads-from-master", "repl-parse-query", "ssl-cipher", "max-allowed-packet", "protocol", "shared-memory-base-name", - "multi-results", "multi-queries", "secure-auth", + "multi-results", "multi-statements", "multi-queries", "secure-auth", NullS }; @@ -1088,9 +1088,10 @@ void mysql_read_default_options(struct st_mysql_options *options, options->client_flag|= CLIENT_MULTI_RESULTS; break; case 31: + case 32: options->client_flag|= CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS; break; - case 32: /* secure-auth */ + case 33: /* secure-auth */ options->secure_auth= TRUE; break; default: From de85fdb78faa8531606e17aa2b2a15d55b5f2b5a Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Tue, 4 Jan 2005 23:07:29 +0100 Subject: [PATCH 07/14] mysql_test_run_new.dsp: Link mysql_test_run_new as console application my_manage.c: The type intptr_t isn't defined for VC 6.0 Changed return type for CreateProcess() to bool mysql_test_run_new.c: The type intptr_t isn't defined for VC 6.0 mysqltest.dsp: Added regex to additional build types for mysqltest mysqldump.dsp: Added mysys.lib for linking mysqldump --- VC++Files/client/mysqldump.dsp | 12 ++++++------ VC++Files/client/mysqltest.dsp | 16 ++++++++-------- VC++Files/mysql-test/mysql_test_run_new.dsp | 4 ++-- mysql-test/my_manage.c | 10 +++++++++- mysql-test/mysql_test_run_new.c | 7 ++++++- 5 files changed, 31 insertions(+), 18 deletions(-) diff --git a/VC++Files/client/mysqldump.dsp b/VC++Files/client/mysqldump.dsp index a1ebdfe11a6..3c955639596 100644 --- a/VC++Files/client/mysqldump.dsp +++ b/VC++Files/client/mysqldump.dsp @@ -51,8 +51,8 @@ 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 /nologo /subsystem:console /machine:I386 -# 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_release/mysqldump.exe" /libpath:"..\lib_release\\" +# 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 mysys.lib /nologo /subsystem:console /machine:I386 +# 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 mysys.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" !ELSEIF "$(CFG)" == "mysqldump - Win32 Debug" @@ -76,8 +76,8 @@ 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 /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\\" +# 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 mysys.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 mysys.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysqldump - Win32 classic" @@ -103,8 +103,8 @@ 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\\" +# 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 mysys.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 mysys.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\" !ENDIF diff --git a/VC++Files/client/mysqltest.dsp b/VC++Files/client/mysqltest.dsp index 1f1613026a9..d04dc5bfce8 100644 --- a/VC++Files/client/mysqltest.dsp +++ b/VC++Files/client/mysqltest.dsp @@ -67,8 +67,8 @@ LINK32=link.exe # PROP Output_Dir ".\classic" # PROP Intermediate_Dir ".\classic" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX -# ADD CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX +# ADD BASE CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX +# ADD CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX # ADD BASE MTL /nologo /tlb".\classic\mysqltest.tlb" /win32 # ADD MTL /nologo /tlb".\classic\mysqltest.tlb" /win32 # ADD BASE RSC /l 1033 /d "NDEBUG" @@ -77,8 +77,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 !ELSEIF "$(CFG)" == "mysqltest - Win32 Release" @@ -92,8 +92,8 @@ LINK32=link.exe # PROP Output_Dir ".\release" # PROP Intermediate_Dir ".\release" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX -# ADD CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX +# ADD BASE CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX +# ADD CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX # ADD BASE MTL /nologo /tlb".\release\mysqltest.tlb" /win32 # ADD MTL /nologo /tlb".\release\mysqltest.tlb" /win32 # ADD BASE RSC /l 1033 /d "NDEBUG" @@ -102,8 +102,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 !ENDIF diff --git a/VC++Files/mysql-test/mysql_test_run_new.dsp b/VC++Files/mysql-test/mysql_test_run_new.dsp index 7e43da20b26..61392b00b94 100644 --- a/VC++Files/mysql-test/mysql_test_run_new.dsp +++ b/VC++Files/mysql-test/mysql_test_run_new.dsp @@ -76,8 +76,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:console !ENDIF diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c index 472b0d32683..1f006f7ab90 100644 --- a/mysql-test/my_manage.c +++ b/mysql-test/my_manage.c @@ -327,7 +327,7 @@ int spawn(char *path, arg_list_t *al, int join, char *input, int spawn(char *path, arg_list_t *al, int join, char *input, char *output, char *error, HANDLE *pid) { - intptr_t result; + bool result; int i; STARTUPINFO startup_info; PROCESS_INFORMATION process_information; @@ -665,7 +665,11 @@ void del_tree(char *dir) rmdir(dir); #else struct _finddata_t parent; +#if defined(_MSC_VER) && _MSC_VER > 1200 intptr_t handle; +#else + long handle; +#endif /* _MSC_VER && _MSC_VER > 1200 */ char temp[FN_REFLEN]; char mask[FN_REFLEN]; @@ -728,7 +732,11 @@ int removef(const char *format, ...) va_list ap; char path[FN_REFLEN]; struct _finddata_t parent; +#if defined(_MSC_VER) && _MSC_VER > 1200 intptr_t handle; +#else + long handle; +#endif /* _MSC_VER && _MSC_VER > 1200 */ char temp[FN_REFLEN]; char *p; diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index fe13d71c1c2..3ffe7b28296 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -37,7 +37,8 @@ #include #endif #ifdef __WIN__ -#include +#include +#include #include #endif @@ -1544,7 +1545,11 @@ int main(int argc, char **argv) } #else struct _finddata_t dir; +#if defined(_MSC_VER) && _MSC_VER > 1200 intptr_t handle; +#else + long handle; +#endif /* _MSC_VER && _MSC_VER > 1200 */ char test[FN_LEN]; char mask[FN_REFLEN]; char *p; From 795736fad60228c828adb7568bb0c2274824e5e9 Mon Sep 17 00:00:00 2001 From: "wax@kishkin.ru" <> Date: Wed, 5 Jan 2005 16:26:53 +0500 Subject: [PATCH 08/14] WL#964 _stricmp was replaved on sting_compare_func added breakes for windows --- mysql-test/mysql_test_run_new.c | 110 +++++++++++++++++++------------- 1 file changed, 67 insertions(+), 43 deletions(-) diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index 7b77fc5ced8..5f949015ee7 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -90,10 +90,20 @@ static char slave_socket[FN_REFLEN]= "./var/tmp/slave.sock"; #endif #define MAX_COUNT_TESTES 1024 + +#ifdef __WIN__ +# define sting_compare_func _stricmp +#else +# ifdef HAVE_STRCASECMP +# define sting_compare_func strcasecmp +# else +# define sting_compare_func strcmp +# endif +#endif + /* comma delimited list of tests to skip or empty string */ #ifndef __WIN__ static char skip_test[FN_REFLEN]= " lowercase_table3 , system_mysql_db_fix "; -#define _stricmp strcasecmp #else /* The most ignore testes contain the calls of system command @@ -1439,7 +1449,7 @@ void setup(char *file __attribute__((unused))) */ int compare( const void *arg1, const void *arg2 ) { - return _stricmp( * ( char** ) arg1, * ( char** ) arg2 ); + return sting_compare_func( * ( char** ) arg1, * ( char** ) arg2 ); } @@ -1520,7 +1530,9 @@ int main(int argc, char **argv) else { /* run all tests */ - names= malloc(MAX_COUNT_TESTES*4); + names= malloc(MAX_COUNT_TESTES*sizeof(void*)); + if (!names) + die("can not allcate memory for sorting"); testes= names; name_index= 0; #ifndef __WIN__ @@ -1540,57 +1552,69 @@ int main(int argc, char **argv) /* find the test suffix */ if ((position= strinstr(test, TEST_SUFFIX)) != 0) { - /* null terminate at the suffix */ - *(test + position - 1)= '\0'; - /* insert test */ - *names= malloc(FN_REFLEN); - strcpy(*names,test); - names++; - name_index++; + if (name_index < MAX_COUNT_TESTES) + { + /* null terminate at the suffix */ + *(test + position - 1)= '\0'; + /* insert test */ + *names= malloc(FN_REFLEN); + strcpy(*names,test); + names++; + name_index++; + } + else + die("can not sort files, array is overloaded"); } } closedir(parent); } #else - struct _finddata_t dir; - intptr_t handle; - char test[FN_LEN]; - char mask[FN_REFLEN]; - char *p; - int position; - - /* single test */ - single_test= FALSE; - - snprintf(mask,FN_REFLEN,"%s/*.test",test_dir); - - if ((handle=_findfirst(mask,&dir)) == -1L) { - die("Unable to open tests directory."); - } + struct _finddata_t dir; + int* handle; + char test[FN_LEN]; + char mask[FN_REFLEN]; + char *p; + int position; + /* single test */ + single_test= FALSE; - do - { - if (!(dir.attrib & _A_SUBDIR)) + snprintf(mask,FN_REFLEN,"%s/*.test",test_dir); + + if ((handle=_findfirst(mask,&dir)) == -1L) { - strcpy(test, strlwr(dir.name)); - - /* find the test suffix */ - if ((position= strinstr(test, TEST_SUFFIX)) != 0) - { - /* null terminate at the suffix */ - *(test + position - 1)= '\0'; - /* insert test */ - *names= malloc(FN_REFLEN); - strcpy(*names,test); - names++; - name_index++; - } + die("Unable to open tests directory."); } - }while (_findnext(handle,&dir) == 0); - _findclose(handle); + + do + { + if (!(dir.attrib & _A_SUBDIR)) + { + strcpy(test, strlwr(dir.name)); + + /* find the test suffix */ + if ((position= strinstr(test, TEST_SUFFIX)) != 0) + { + if (name_index < MAX_COUNT_TESTES) + { + /* null terminate at the suffix */ + *(test + position - 1)= '\0'; + /* insert test */ + *names= malloc(FN_REFLEN); + strcpy(*names,test); + names++; + name_index++; + } + else + die("can not sort files, array is overloaded"); + } + } + }while (_findnext(handle,&dir) == 0); + + _findclose(handle); + } #endif qsort( (void *)testes, name_index, sizeof( char * ), compare ); From 22639defce915ed0ca33654fa3b1d4517a44936c Mon Sep 17 00:00:00 2001 From: "wax@kishkin.ru" <> Date: Wed, 5 Jan 2005 17:14:29 +0500 Subject: [PATCH 09/14] replace position names and testes fixed bug --- mysql-test/mysql_test_run_new.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index ecae0b6ad4d..bdebe912b97 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -1531,10 +1531,10 @@ int main(int argc, char **argv) else { /* run all tests */ - names= malloc(MAX_COUNT_TESTES*sizeof(void*)); - if (!names) + testes= malloc(MAX_COUNT_TESTES*sizeof(void*)); + if (!testes) die("can not allcate memory for sorting"); - testes= names; + names= testes; name_index= 0; #ifndef __WIN__ struct dirent *entry; @@ -1619,7 +1619,7 @@ int main(int argc, char **argv) #endif qsort( (void *)testes, name_index, sizeof( char * ), compare ); - for (index= 0; index <= name_index; index++) + for (index= 0; index < name_index; index++) { run_test(testes[index]); free(testes[index]); From 9fe6813a098e2165db61c0270137f465f069a2dd Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Wed, 5 Jan 2005 16:35:43 +0100 Subject: [PATCH 10/14] my_sleep.c: On Windows my_sleep() always gave a zero microsecond sleep --- mysys/my_sleep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysys/my_sleep.c b/mysys/my_sleep.c index 3de2d2abd13..31eaf7eeb96 100644 --- a/mysys/my_sleep.c +++ b/mysys/my_sleep.c @@ -23,6 +23,8 @@ void my_sleep(ulong m_seconds) { #ifdef __NETWARE__ delay(m_seconds/1000+1); +#elif defined(__WIN__) + Sleep(m_seconds/1000+1); /* Sleep() has millisecond arg */ #elif defined(OS2) DosSleep(m_seconds/1000+1); #elif defined(HAVE_SELECT) From c1593ecf6601fa93882af78100e48e42d19fafd7 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Wed, 5 Jan 2005 19:02:17 +0100 Subject: [PATCH 11/14] Allow DEFAULT_THREAD_STACK to be set via -DDEFAULT_THREAD_STACK=... so our official binary builds for Linux that are built against a static glibc with a 128k thread stack size limit can be compiled with a default that doesn't result in a harmless (but oft-misunderstood) warning message. (Bug #6226) --- include/my_pthread.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/my_pthread.h b/include/my_pthread.h index 40302f48bd5..7620b46e08b 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -624,6 +624,7 @@ extern int pthread_dummy(int); /* All thread specific variables are in the following struct */ #define THREAD_NAME_SIZE 10 +#ifndef DEFAULT_THREAD_STACK #if defined(__ia64__) /* MySQL can survive with 32K, but some glibc libraries require > 128K stack @@ -633,6 +634,7 @@ extern int pthread_dummy(int); #else #define DEFAULT_THREAD_STACK (192*1024L) #endif +#endif struct st_my_thread_var { From 746fd9fdacc52ccc297db7703ea9288b67138167 Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Thu, 6 Jan 2005 11:19:20 +0200 Subject: [PATCH 12/14] os0file.c: Use the fcntl() file flush method on OS X; Apple disabled fsync() for internal disk drives, which caused corruption in power outages; the patch was recommended by an Apple engineer --- innobase/os/os0file.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index aa45030d93b..f02b81b8fd8 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -1763,7 +1763,21 @@ os_file_flush( #else int ret; -#ifdef HAVE_FDATASYNC +#ifdef HAVE_DARWIN_THREADS + /* Apple has disabled fsync() for internal disk drives in OS X. That + caused corruption for a user when he tested a power outage. Let us in + OS X use a nonstandard flush method recommended by an Apple + engineer. */ + + ret = fcntl(file, F_FULLFSYNC, NULL); + + if (ret) { + /* If we are not on a file system that supports this, then + fall back to a plain fsync. */ + + ret = fsync(file); + } +#elif HAVE_FDATASYNC ret = fdatasync(file); #else /* fprintf(stderr, "Flushing to file %p\n", file); */ From 57099ef6c6f14fa3e6b912f1f8884b9b5feb7c54 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 6 Jan 2005 14:35:14 +0100 Subject: [PATCH 13/14] - enable "with-extra-charsets=complex" for the "compile-dist" distribution build (to make the test suite pass) --- BUILD/compile-dist | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BUILD/compile-dist b/BUILD/compile-dist index 2344d4dfffd..ef6302f0d9c 100755 --- a/BUILD/compile-dist +++ b/BUILD/compile-dist @@ -42,5 +42,6 @@ fi --with-embedded-server \ --with-berkeley-db \ --with-innodb \ - --enable-thread-safe-client + --enable-thread-safe-client \ + --with-extra-charsets=complex make From 421738e8ce0382c4d72f36766765c3e49a74d72f Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Thu, 6 Jan 2005 17:08:38 +0200 Subject: [PATCH 14/14] removed unused label --- sql/sql_parse.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 55d26a68116..cd8e73c446d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2429,7 +2429,6 @@ mysql_execute_command(THD *thd) create_table_local); break; -create_error: res= 1; //error reported unsent_create_error: // put tables back for PS rexecuting