From 9e636a249102346082f5c0c79e2b3a38ab7eca7d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 May 2005 14:30:22 +0200 Subject: [PATCH 01/56] - Backport of the patch to fix BUG#10687 (Merge engine fails on Windows): applied required patches on top of the 4.1.12 release (will be published as 4.1.12a for Windows) myisammrg/myrg_open.c: - Backport of the patch to fix BUG#10687 (Merge engine fails under Windows): use fn_format to convert pathnames if the files in the merge file have a pathname mysys/my_getwd.c: - Backport of the patch to fix BUG#10687 (Merge engine fails on Windows): Added test to see if FN_LIBCHAR != '/' before doing comparison to avoid redundant comparison sql/ha_myisammrg.cc: - Backport of the patch to fix BUG#10687 (Merge engine fails on Windows): added extra debug output --- myisammrg/myrg_open.c | 4 +++- mysys/my_getwd.c | 5 ++++- sql/ha_myisammrg.cc | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/myisammrg/myrg_open.c b/myisammrg/myrg_open.c index 0dc2f4f9768..f9cdc2bb205 100644 --- a/myisammrg/myrg_open.c +++ b/myisammrg/myrg_open.c @@ -67,7 +67,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) while ((length=my_b_gets(&file,buff,FN_REFLEN-1))) { if ((end=buff+length)[-1] == '\n') - end[-1]='\0'; + *--end='\0'; if (!buff[0]) continue; /* Skip empty lines */ if (buff[0] == '#') @@ -86,6 +86,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) sizeof(name_buff)-1-dir_length)); VOID(cleanup_dirname(buff,name_buff)); } + else + fn_format(buff, buff, "", "", 0); if (!(isam=mi_open(buff,mode,(handle_locking?HA_OPEN_WAIT_IF_LOCKED:0)))) goto err; if (!m_info) /* First file */ diff --git a/mysys/my_getwd.c b/mysys/my_getwd.c index 89f949eca27..5663ceaa60e 100644 --- a/mysys/my_getwd.c +++ b/mysys/my_getwd.c @@ -208,7 +208,10 @@ int test_if_hard_path(register const char *dir_name) my_bool has_path(const char *name) { - return test(strchr(name, FN_LIBCHAR)) + return test(strchr(name, FN_LIBCHAR)) +#if FN_LIBCHAR != '/' + || test(strchr(name,'/')) +#endif #ifdef FN_DEVCHAR || test(strchr(name, FN_DEVCHAR)) #endif diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index 7a5d4fcf0a1..0b160d72aab 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -422,6 +422,7 @@ int ha_myisammrg::create(const char *name, register TABLE *form, } else table_name=(*tbl)->path; + DBUG_PRINT("info",("MyISAM table_name: '%s'", table_name)); *pos++= table_name; } *pos=0; From 4a80acecea64a83b9968ef9de2c2c059eff76273 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 May 2005 14:46:28 +0200 Subject: [PATCH 02/56] - added the cp932 charset support to the Windows builds VC++Files/strings/strings.dsp: - added ctype-cp932.c to the project (new charset) include/config-win.h: - added a HAVE_CHARSET_cp932 #define to enable the cp932 charset on Windows --- VC++Files/strings/strings.dsp | 4 ++++ include/config-win.h | 1 + 2 files changed, 5 insertions(+) diff --git a/VC++Files/strings/strings.dsp b/VC++Files/strings/strings.dsp index c8f3208e822..d1156702956 100644 --- a/VC++Files/strings/strings.dsp +++ b/VC++Files/strings/strings.dsp @@ -113,6 +113,10 @@ SOURCE=".\ctype-bin.c" # End Source File # Begin Source File +SOURCE=".\ctype-cp932.c" +# End Source File +# Begin Source File + SOURCE=".\ctype-czech.c" # End Source File # Begin Source File diff --git a/include/config-win.h b/include/config-win.h index b3865c1fda7..86704c4740b 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -393,6 +393,7 @@ inline double ulonglong2double(ulonglong value) /* #undef HAVE_CHARSET_cp850 */ /* #undef HAVE_CHARSET_cp852 */ /* #undef HAVE_CHARSET_cp866 */ +#define HAVE_CHARSET_cp932 1 /* #undef HAVE_CHARSET_dec8 */ #define HAVE_CHARSET_euckr 1 #define HAVE_CHARSET_gb2312 1 From 3b3cd242a01407866a6a3efe6120ab14a944aab0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 May 2005 15:14:21 +0200 Subject: [PATCH 03/56] - bumped up version number string to 4.1.12a --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 52f368f0c2d..15e6e42138c 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 4.1.12) +AM_INIT_AUTOMAKE(mysql, 4.1.12a) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 From 80a226aa622c4a31a03476d5894e3671f2011bb4 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 May 2005 11:02:39 -0700 Subject: [PATCH 04/56] Fix timeouts with SSL on Windows, and also sync the fastsend implementation with normal socket behavior. (Bug #8572) vio/viossl.c: Sync implementations of *_fastsend() and *_timeout() with viosocket.c --- vio/viossl.c | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/vio/viossl.c b/vio/viossl.c index 773d444063b..043d23f0238 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -128,26 +128,32 @@ int vio_ssl_write(Vio * vio, const gptr buf, int size) int vio_ssl_fastsend(Vio * vio __attribute__((unused))) { - int r= 0; + int r=0; DBUG_ENTER("vio_ssl_fastsend"); -#ifdef IPTOS_THROUGHPUT +#if defined(IPTOS_THROUGHPUT) && !defined(__EMX__) { -#ifndef __EMX__ - int tos = IPTOS_THROUGHPUT; - if (!setsockopt(vio->sd, IPPROTO_IP, IP_TOS, (void *) &tos, sizeof(tos))) -#endif /* !__EMX__ */ - { - int nodelay = 1; - if (setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (void *) &nodelay, - sizeof(nodelay))) { - DBUG_PRINT("warning", - ("Couldn't set socket option for fast send")); - r= -1; - } - } + int tos= IPTOS_THROUGHPUT; + r= setsockopt(vio->sd, IPPROTO_IP, IP_TOS, (void *) &tos, sizeof(tos)); + } +#endif /* IPTOS_THROUGHPUT && !__EMX__ */ + if (!r) + { +#ifdef __WIN__ + BOOL nodelay= 1; + r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (const char*) &nodelay, + sizeof(nodelay)); +#else + int nodelay= 1; + r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (void*) &nodelay, + sizeof(nodelay)); +#endif /* __WIN__ */ + } + if (r) + { + DBUG_PRINT("warning", ("Couldn't set socket option for fast send")); + r= -1; } -#endif /* IPTOS_THROUGHPUT */ DBUG_PRINT("exit", ("%d", r)); DBUG_RETURN(r); } @@ -424,6 +430,11 @@ void vio_ssl_timeout(Vio *vio __attribute__((unused)), uint which __attribute__((unused)), uint timeout __attribute__((unused))) { - /* Not yet implemented (non critical) */ +#ifdef __WIN__ + ulong wait_timeout= (ulong) timeout * 1000; + (void) setsockopt(vio->sd, SOL_SOCKET, + which ? SO_SNDTIMEO : SO_RCVTIMEO, (char*) &wait_timeout, + sizeof(wait_timeout)); +#endif /* __WIN__ */ } #endif /* HAVE_OPENSSL */ From 75e8f8372e4ab63994abaa41d93ed85c4cfeb9d4 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 May 2005 11:11:40 -0700 Subject: [PATCH 05/56] Fix error reporting for 'OPTIMIZE TABLE' on InnoDB tables. (Bug #8135) sql/sql_table.cc: Pass through errors from InnoDB in OPTIMIZE TABLE. --- sql/sql_table.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 67aade519f5..70b20c21cfb 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2052,6 +2052,28 @@ send_result_message: ((result_code= table->table->file->analyze(thd, check_opt)) > 0)) result_code= 0; // analyze went ok } + if (result_code) // either mysql_recreate_table or analyze failed + { + const char *err_msg; + if ((err_msg= thd->net.last_error)) + { + if (!thd->vio_ok()) + { + sql_print_error(err_msg); + } + else + { + /* Hijack the row already in-progress. */ + protocol->store("error", 5, system_charset_info); + protocol->store(err_msg, system_charset_info); + (void)protocol->write(); + /* Start off another row for HA_ADMIN_FAILED */ + protocol->prepare_for_resend(); + protocol->store(table_name, system_charset_info); + protocol->store(operator_name, system_charset_info); + } + } + } result_code= result_code ? HA_ADMIN_FAILED : HA_ADMIN_OK; table->next= save_next; goto send_result_message; From e9cf191ce0c8ac0227ef978787633f6204301732 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 May 2005 22:42:43 +0200 Subject: [PATCH 06/56] - applied more changes to enable the CP932 charset on Windows - fixed linking with zlib VC++Files/client/mysql.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysql_ia64.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqladmin.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqladmin_ia64.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqlcheck.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqlcheck_ia64.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqlclient.dsp: - added ctype-cp932.c to the file list VC++Files/client/mysqlclient_ia64.dsp: - added ctype-cp932.c to the file list VC++Files/client/mysqldump.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqldump_ia64.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqlimport.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqlimport_ia64.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqlshow.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqlshow_ia64.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqltest.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqltest_ia64.dsp: - added zlib.lib to the LINK32 options VC++Files/libmysql/libmysql.dsp: - added ctype-cp932.c to the file list VC++Files/libmysql/libmysql_ia64.dsp: - added ctype-cp932.c to the file list VC++Files/mysql-test/mysql_test_run_new.dsp: - added zlib.lib to the LINK32 options VC++Files/mysql-test/mysql_test_run_new_ia64.dsp: - added zlib.lib to the LINK32 options VC++Files/mysqlbinlog/mysqlbinlog.dsp: - added zlib.lib to the LINK32 options VC++Files/mysqlbinlog/mysqlbinlog_ia64.dsp: - added zlib.lib to the LINK32 options VC++Files/mysqlcheck/mysqlcheck.dsp: - added zlib.lib to the LINK32 options VC++Files/mysqlcheck/mysqlcheck_ia64.dsp: - added zlib.lib to the LINK32 options VC++Files/mysqlmanager/mysqlmanager.dsp: - added zlib.lib to the LINK32 options VC++Files/strings/strings_ia64.dsp: - added ctype-cp932.c to the file list --- VC++Files/client/mysql.dsp | 6 +++--- VC++Files/client/mysql_ia64.dsp | 6 +++--- VC++Files/client/mysqladmin.dsp | 6 +++--- VC++Files/client/mysqladmin_ia64.dsp | 6 +++--- VC++Files/client/mysqlcheck.dsp | 2 +- VC++Files/client/mysqlcheck_ia64.dsp | 2 +- VC++Files/client/mysqlclient.dsp | 4 ++++ VC++Files/client/mysqlclient_ia64.dsp | 4 ++++ VC++Files/client/mysqldump.dsp | 6 +++--- VC++Files/client/mysqldump_ia64.dsp | 6 +++--- VC++Files/client/mysqlimport.dsp | 6 +++--- VC++Files/client/mysqlimport_ia64.dsp | 6 +++--- VC++Files/client/mysqlshow.dsp | 6 +++--- VC++Files/client/mysqlshow_ia64.dsp | 6 +++--- VC++Files/client/mysqltest.dsp | 4 ++-- VC++Files/client/mysqltest_ia64.dsp | 6 +++--- VC++Files/libmysql/libmysql.dsp | 4 ++++ VC++Files/libmysql/libmysql_ia64.dsp | 4 ++++ VC++Files/mysql-test/mysql_test_run_new.dsp | 4 ++-- VC++Files/mysql-test/mysql_test_run_new_ia64.dsp | 4 ++-- VC++Files/mysqlbinlog/mysqlbinlog.dsp | 6 +++--- VC++Files/mysqlbinlog/mysqlbinlog_ia64.dsp | 6 +++--- VC++Files/mysqlcheck/mysqlcheck.dsp | 6 +++--- VC++Files/mysqlcheck/mysqlcheck_ia64.dsp | 6 +++--- VC++Files/mysqlmanager/mysqlmanager.dsp | 4 ++-- VC++Files/strings/strings_ia64.dsp | 4 ++++ 26 files changed, 75 insertions(+), 55 deletions(-) diff --git a/VC++Files/client/mysql.dsp b/VC++Files/client/mysql.dsp index ec16e780d3e..8298e62d8ad 100644 --- a/VC++Files/client/mysql.dsp +++ b/VC++Files/client/mysql.dsp @@ -52,7 +52,7 @@ 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 /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 /debug /machine:I386 /out:"../client_release/mysql.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 zlib.lib /nologo /subsystem:console /debug /machine:I386 /out:"../client_release/mysql.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /incremental:yes !ELSEIF "$(CFG)" == "mysql - Win32 Debug" @@ -78,7 +78,7 @@ 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 /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\\" +# 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 zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysql.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysql - Win32 classic" @@ -106,7 +106,7 @@ BSC32=bscmake.exe 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\\" +# 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 zlib.lib /nologo /subsystem:console /debug /machine:I386 /out:"../client_classic/mysql.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /incremental:yes !ENDIF diff --git a/VC++Files/client/mysql_ia64.dsp b/VC++Files/client/mysql_ia64.dsp index 43bc9fa5b09..3fe2e2a2328 100644 --- a/VC++Files/client/mysql_ia64.dsp +++ b/VC++Files/client/mysql_ia64.dsp @@ -53,7 +53,7 @@ BSC32=bscmake.exe # 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 /nologo /subsystem:console /machine:IX86 /machine:IA64 -# 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 /out:"../client_release/mysql.exe" /libpath:"..\lib_release\\" /machine:IA64 +# 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 zlib.lib /nologo /subsystem:console /debug /out:"../client_release/mysql.exe" /libpath:"..\lib_release\\" /machine:IA64 !ELSEIF "$(CFG)" == "mysql - WinIA64 Debug" @@ -79,7 +79,7 @@ BSC32=bscmake.exe # 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 /nologo /subsystem:console /debug /machine:IA64 -# 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 /out:"../client_debug/mysql.exe" /libpath:"..\lib_debug\\" /machine:IA64 +# 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 zlib.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/mysql.exe" /libpath:"..\lib_debug\\" /machine:IA64 !ELSEIF "$(CFG)" == "mysql - WinIA64 classic" @@ -107,7 +107,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.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 /out:"../client_release/mysql.exe" /libpath:"..\lib_release\\" /machine:IA64 -# 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 /out:"../client_classic/mysql.exe" /libpath:"..\lib_release\\" /machine:IA64 +# 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 zlib.lib /nologo /subsystem:console /debug /out:"../client_classic/mysql.exe" /libpath:"..\lib_release\\" /machine:IA64 !ENDIF diff --git a/VC++Files/client/mysqladmin.dsp b/VC++Files/client/mysqladmin.dsp index 7a0b3bec1a7..b473d104a76 100644 --- a/VC++Files/client/mysqladmin.dsp +++ b/VC++Files/client/mysqladmin.dsp @@ -52,7 +52,7 @@ 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 /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/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 zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqladmin.exe" /libpath:"..\lib_release\\" !ELSEIF "$(CFG)" == "mysqladmin - Win32 Debug" @@ -77,7 +77,7 @@ 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 /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\\" +# 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 zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqladmin.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysqladmin - Win32 classic" @@ -104,7 +104,7 @@ BSC32=bscmake.exe # 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\\" +# 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 zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqladmin.exe" /libpath:"..\lib_release\\" !ENDIF diff --git a/VC++Files/client/mysqladmin_ia64.dsp b/VC++Files/client/mysqladmin_ia64.dsp index 5a5e4a99071..f7823479d5a 100644 --- a/VC++Files/client/mysqladmin_ia64.dsp +++ b/VC++Files/client/mysqladmin_ia64.dsp @@ -53,7 +53,7 @@ BSC32=bscmake.exe # 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 /nologo /subsystem:console /machine:IA64 -# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /out:"../client_release/mysqladmin.exe" /libpath:"..\lib_release\\" /machine:IA64 +# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"../client_release/mysqladmin.exe" /libpath:"..\lib_release\\" /machine:IA64 !ELSEIF "$(CFG)" == "mysqladmin - WinIA64 Debug" @@ -79,7 +79,7 @@ BSC32=bscmake.exe # 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 /nologo /subsystem:console /debug /machine:IA64 -# ADD LINK32 ..\lib_debug\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/mysqladmin.exe" /libpath:"..\lib_debug\\" /machine:IA64 +# ADD LINK32 ..\lib_debug\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/mysqladmin.exe" /libpath:"..\lib_debug\\" /machine:IA64 !ELSEIF "$(CFG)" == "mysqladmin - WinIA64 classic" @@ -107,7 +107,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.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 /out:"../client_release/mysqladmin.exe" /libpath:"..\lib_release\\" /machine:IA64 -# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /out:"../client_classic/mysqladmin.exe" /libpath:"..\lib_release\\" /machine:IA64 +# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"../client_classic/mysqladmin.exe" /libpath:"..\lib_release\\" /machine:IA64 !ENDIF diff --git a/VC++Files/client/mysqlcheck.dsp b/VC++Files/client/mysqlcheck.dsp index 30e7a365f04..399b18d16fc 100644 --- a/VC++Files/client/mysqlcheck.dsp +++ b/VC++Files/client/mysqlcheck.dsp @@ -46,7 +46,7 @@ BSC32=bscmake.exe # 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 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 /pdb:"release/mysqlcheck.pdb" /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 zlib.lib /nologo /subsystem:console /pdb:"release/mysqlcheck.pdb" /machine:I386 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /pdb:none # Begin Target diff --git a/VC++Files/client/mysqlcheck_ia64.dsp b/VC++Files/client/mysqlcheck_ia64.dsp index 4b2c2bb4c46..aa49d86a523 100644 --- a/VC++Files/client/mysqlcheck_ia64.dsp +++ b/VC++Files/client/mysqlcheck_ia64.dsp @@ -49,7 +49,7 @@ BSC32=bscmake.exe # 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 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:IA64 -# 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 /pdb:"release/mysqlcheck.pdb" /machine:IA64 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" /incremental:no +# 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 zlib.lib /nologo /subsystem:console /pdb:"release/mysqlcheck.pdb" /machine:IA64 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" /incremental:no # SUBTRACT LINK32 !ENDIF diff --git a/VC++Files/client/mysqlclient.dsp b/VC++Files/client/mysqlclient.dsp index 75008858e55..599bad92d7f 100644 --- a/VC++Files/client/mysqlclient.dsp +++ b/VC++Files/client/mysqlclient.dsp @@ -151,6 +151,10 @@ SOURCE="..\strings\ctype-czech.c" # End Source File # Begin Source File +SOURCE="..\strings\ctype-cp932.c" +# End Source File +# Begin Source File + SOURCE="..\strings\ctype-euc_kr.c" # End Source File # Begin Source File diff --git a/VC++Files/client/mysqlclient_ia64.dsp b/VC++Files/client/mysqlclient_ia64.dsp index e91245c12b2..3edc979b9dc 100644 --- a/VC++Files/client/mysqlclient_ia64.dsp +++ b/VC++Files/client/mysqlclient_ia64.dsp @@ -151,6 +151,10 @@ SOURCE="..\strings\ctype-czech.c" # End Source File # Begin Source File +SOURCE="..\strings\ctype-cp963.c" +# End Source File +# Begin Source File + SOURCE="..\strings\ctype-euc_kr.c" # End Source File # Begin Source File diff --git a/VC++Files/client/mysqldump.dsp b/VC++Files/client/mysqldump.dsp index 3c955639596..45d1d8777aa 100644 --- a/VC++Files/client/mysqldump.dsp +++ b/VC++Files/client/mysqldump.dsp @@ -52,7 +52,7 @@ 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 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\\" +# 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 zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" !ELSEIF "$(CFG)" == "mysqldump - Win32 Debug" @@ -77,7 +77,7 @@ 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 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\\" +# 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 zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysqldump - Win32 classic" @@ -104,7 +104,7 @@ BSC32=bscmake.exe # 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 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\\" +# 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 zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\" !ENDIF diff --git a/VC++Files/client/mysqldump_ia64.dsp b/VC++Files/client/mysqldump_ia64.dsp index 698cd0b9c2c..79a7059cae5 100644 --- a/VC++Files/client/mysqldump_ia64.dsp +++ b/VC++Files/client/mysqldump_ia64.dsp @@ -53,7 +53,7 @@ BSC32=bscmake.exe # 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 mysys.lib /nologo /subsystem:console /machine:IA64 -# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" /machine:IA64 +# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" /machine:IA64 !ELSEIF "$(CFG)" == "mysqldump - WinIA64 Debug" @@ -79,7 +79,7 @@ BSC32=bscmake.exe # 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 mysys.lib /nologo /subsystem:console /debug /machine:IA64 -# ADD LINK32 ..\lib_debug\dbug.lib ..\lib_debug\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/mysqldump.exe" /libpath:"..\lib_debug\\" /machine:IA64 +# ADD LINK32 ..\lib_debug\dbug.lib ..\lib_debug\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/mysqldump.exe" /libpath:"..\lib_debug\\" /machine:IA64 !ELSEIF "$(CFG)" == "mysqldump - WinIA64 classic" @@ -107,7 +107,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.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 mysys.lib /nologo /subsystem:console /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" /machine:IA64 -# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\" /machine:IA64 +# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\" /machine:IA64 !ENDIF diff --git a/VC++Files/client/mysqlimport.dsp b/VC++Files/client/mysqlimport.dsp index d5fd8557397..1a9b64a0383 100644 --- a/VC++Files/client/mysqlimport.dsp +++ b/VC++Files/client/mysqlimport.dsp @@ -52,7 +52,7 @@ 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 /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/mysqlimport.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 zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlimport.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /incremental:yes !ELSEIF "$(CFG)" == "mysqlimport - Win32 Debug" @@ -78,7 +78,7 @@ 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 /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\\" +# 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 zlib.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" @@ -106,7 +106,7 @@ BSC32=bscmake.exe 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\\" +# 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 zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlimport.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /incremental:yes !ENDIF diff --git a/VC++Files/client/mysqlimport_ia64.dsp b/VC++Files/client/mysqlimport_ia64.dsp index cd8f5523efd..c6f51c0ef6f 100644 --- a/VC++Files/client/mysqlimport_ia64.dsp +++ b/VC++Files/client/mysqlimport_ia64.dsp @@ -53,7 +53,7 @@ BSC32=bscmake.exe # 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 /nologo /subsystem:console /machine:IA64 -# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /out:"../client_release/mysqlimport.exe" /libpath:"..\lib_release\\" /machine:IA64 +# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"../client_release/mysqlimport.exe" /libpath:"..\lib_release\\" /machine:IA64 !ELSEIF "$(CFG)" == "mysqlimport - WinIA64 Debug" @@ -79,7 +79,7 @@ BSC32=bscmake.exe # 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 /nologo /subsystem:console /debug /machine:IA64 -# ADD LINK32 setargv.obj ..\lib_debug\zlib.lib ..\lib_debug\dbug.lib 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 bufferoverflowU.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/mysqlimport.exe" /libpath:"..\lib_debug\\" /machine:IA64 +# ADD LINK32 setargv.obj ..\lib_debug\zlib.lib ..\lib_debug\dbug.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/mysqlimport.exe" /libpath:"..\lib_debug\\" /machine:IA64 !ELSEIF "$(CFG)" == "mysqlimport - WinIA64 classic" @@ -107,7 +107,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.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 /out:"../client_release/mysqlimport.exe" /libpath:"..\lib_release\\" /machine:IA64 -# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /out:"../client_classic/mysqlimport.exe" /libpath:"..\lib_release\\" /machine:IA64 +# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"../client_classic/mysqlimport.exe" /libpath:"..\lib_release\\" /machine:IA64 !ENDIF diff --git a/VC++Files/client/mysqlshow.dsp b/VC++Files/client/mysqlshow.dsp index b9fd0d27e46..855c2dcdf34 100644 --- a/VC++Files/client/mysqlshow.dsp +++ b/VC++Files/client/mysqlshow.dsp @@ -52,7 +52,7 @@ 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 /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/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 zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlshow.exe" /libpath:"..\lib_release\\" !ELSEIF "$(CFG)" == "mysqlshow - Win32 Debug" @@ -77,7 +77,7 @@ 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 /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\\" +# 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 zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlshow.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysqlshow - Win32 classic" @@ -104,7 +104,7 @@ BSC32=bscmake.exe # 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\\" +# 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 zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlshow.exe" /libpath:"..\lib_release\\" !ENDIF diff --git a/VC++Files/client/mysqlshow_ia64.dsp b/VC++Files/client/mysqlshow_ia64.dsp index dd83a3f1ef5..4995f3f9ae8 100644 --- a/VC++Files/client/mysqlshow_ia64.dsp +++ b/VC++Files/client/mysqlshow_ia64.dsp @@ -53,7 +53,7 @@ BSC32=bscmake.exe # 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 /nologo /subsystem:console /machine:IA64 -# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /out:"../client_release/mysqlshow.exe" /libpath:"..\lib_release\\" /machine:IA64 +# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"../client_release/mysqlshow.exe" /libpath:"..\lib_release\\" /machine:IA64 !ELSEIF "$(CFG)" == "mysqlshow - WinIA64 Debug" @@ -79,7 +79,7 @@ BSC32=bscmake.exe # 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 /nologo /subsystem:console /debug /machine:IA64 -# ADD LINK32 ..\lib_debug\zlib.lib ..\lib_debug\dbug.lib 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 bufferoverflowU.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/mysqlshow.exe" /libpath:"..\lib_debug\\" /machine:IA64 +# ADD LINK32 ..\lib_debug\zlib.lib ..\lib_debug\dbug.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/mysqlshow.exe" /libpath:"..\lib_debug\\" /machine:IA64 !ELSEIF "$(CFG)" == "mysqlshow - WinIA64 classic" @@ -107,7 +107,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.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 /out:"../client_release/mysqlshow.exe" /libpath:"..\lib_release\\" /machine:IA64 -# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /out:"../client_classic/mysqlshow.exe" /libpath:"..\lib_release\\" /machine:IA64 +# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"../client_classic/mysqlshow.exe" /libpath:"..\lib_release\\" /machine:IA64 !ENDIF diff --git a/VC++Files/client/mysqltest.dsp b/VC++Files/client/mysqltest.dsp index d04dc5bfce8..e705b17b0f0 100644 --- a/VC++Files/client/mysqltest.dsp +++ b/VC++Files/client/mysqltest.dsp @@ -78,7 +78,7 @@ BSC32=bscmake.exe # 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 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 +# 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 zlib.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" @@ -103,7 +103,7 @@ BSC32=bscmake.exe # 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 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 +# 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 zlib.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/client/mysqltest_ia64.dsp b/VC++Files/client/mysqltest_ia64.dsp index 160683725e6..86edb4ab177 100644 --- a/VC++Files/client/mysqltest_ia64.dsp +++ b/VC++Files/client/mysqltest_ia64.dsp @@ -55,7 +55,7 @@ BSC32=bscmake.exe 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 mysys.lib regex.lib /nologo /subsystem:console /debug /out:"..\client_debug\mysqltest.exe" /libpath:"..\lib_debug\\" # SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 ..\lib_debug\zlib.lib ..\lib_debug\dbug.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 mysqlclient.lib wsock32.lib mysys.lib regex.lib bufferoverflowU.lib /nologo /subsystem:console /incremental:no /debug /out:"..\client_debug\mysqltest.exe" /libpath:"..\lib_debug\\" /machine:IA64 +# ADD LINK32 ..\lib_debug\zlib.lib ..\lib_debug\dbug.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 mysqlclient.lib wsock32.lib mysys.lib regex.lib bufferoverflowU.lib zlib.lib /nologo /subsystem:console /incremental:no /debug /out:"..\client_debug\mysqltest.exe" /libpath:"..\lib_debug\\" /machine:IA64 # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "mysqltest - WinIA64 classic" @@ -84,7 +84,7 @@ BSC32=bscmake.exe 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 mysys.lib regex.lib /nologo /subsystem:console /out:"..\client_classic\mysqltest.exe" /libpath:"..\lib_release\\" # SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 ..\lib_release\zlib.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 mysqlclient.lib wsock32.lib mysys.lib regex.lib bufferoverflowU.lib /nologo /subsystem:console /out:"..\client_classic\mysqltest.exe" /libpath:"..\lib_release\\" /machine:IA64 +# ADD LINK32 ..\lib_release\zlib.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 mysqlclient.lib wsock32.lib mysys.lib regex.lib bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"..\client_classic\mysqltest.exe" /libpath:"..\lib_release\\" /machine:IA64 # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "mysqltest - WinIA64 Release" @@ -113,7 +113,7 @@ BSC32=bscmake.exe 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 mysys.lib regex.lib /nologo /subsystem:console /out:"..\client_release\mysqltest.exe" /libpath:"..\lib_release\\" # SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 ..\lib_release\zlib.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 mysqlclient.lib wsock32.lib mysys.lib regex.lib bufferoverflowU.lib /nologo /subsystem:console /out:"..\client_release\mysqltest.exe" /libpath:"..\lib_release\\" /machine:IA64 +# ADD LINK32 ..\lib_release\zlib.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 mysqlclient.lib wsock32.lib mysys.lib regex.lib bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"..\client_release\mysqltest.exe" /libpath:"..\lib_release\\" /machine:IA64 # SUBTRACT LINK32 /pdb:none !ENDIF diff --git a/VC++Files/libmysql/libmysql.dsp b/VC++Files/libmysql/libmysql.dsp index ce81a3b7435..21e393f137d 100644 --- a/VC++Files/libmysql/libmysql.dsp +++ b/VC++Files/libmysql/libmysql.dsp @@ -143,6 +143,10 @@ SOURCE="..\strings\ctype-czech.c" # End Source File # Begin Source File +SOURCE="..\strings\ctype-cp932.c" +# End Source File +# Begin Source File + SOURCE="..\strings\ctype-euc_kr.c" # End Source File # Begin Source File diff --git a/VC++Files/libmysql/libmysql_ia64.dsp b/VC++Files/libmysql/libmysql_ia64.dsp index 4c4776dfc2f..12932ed3924 100644 --- a/VC++Files/libmysql/libmysql_ia64.dsp +++ b/VC++Files/libmysql/libmysql_ia64.dsp @@ -142,6 +142,10 @@ SOURCE="..\strings\ctype-czech.c" # End Source File # Begin Source File +SOURCE="..\strings\ctype-cp932.c" +# End Source File +# Begin Source File + SOURCE="..\strings\ctype-euc_kr.c" # End Source File # Begin Source File diff --git a/VC++Files/mysql-test/mysql_test_run_new.dsp b/VC++Files/mysql-test/mysql_test_run_new.dsp index 61392b00b94..7fa01d22d11 100644 --- a/VC++Files/mysql-test/mysql_test_run_new.dsp +++ b/VC++Files/mysql-test/mysql_test_run_new.dsp @@ -52,7 +52,7 @@ BSC32=bscmake.exe # 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:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console +# 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 zlib.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console !ELSEIF "$(CFG)" == "mysql_test_run_new - Win32 Release" @@ -77,7 +77,7 @@ BSC32=bscmake.exe # 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: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 +# 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 zlib.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/VC++Files/mysql-test/mysql_test_run_new_ia64.dsp b/VC++Files/mysql-test/mysql_test_run_new_ia64.dsp index a6252d0cb7b..d9bad07dad9 100644 --- a/VC++Files/mysql-test/mysql_test_run_new_ia64.dsp +++ b/VC++Files/mysql-test/mysql_test_run_new_ia64.dsp @@ -54,7 +54,7 @@ BSC32=bscmake.exe 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 /subsystem:console /map /debug /out:"..\mysql-test\mysql_test_run_new.exe" /machine:IA64 # 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 Ws2_32.lib bufferoverflowU.lib /nologo /subsystem:console /incremental:no /map /debug /out:"..\mysql-test\mysql_test_run_new.exe" /machine:IA64 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib bufferoverflowU.lib zlib.lib /nologo /subsystem:console /incremental:no /map /debug /out:"..\mysql-test\mysql_test_run_new.exe" /machine:IA64 # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "mysql_test_run_new - WinIA64 Release" @@ -83,7 +83,7 @@ BSC32=bscmake.exe 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 /subsystem:console /out:"..\mysql-test\mysql_test_run_new.exe" /machine:IA64 # SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 t kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib bufferoverflowU.lib /nologo /subsystem:console /out:"..\mysql-test\mysql_test_run_new.exe" /machine:IA64 +# ADD LINK32 t kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"..\mysql-test\mysql_test_run_new.exe" /machine:IA64 # SUBTRACT LINK32 /pdb:none !ENDIF diff --git a/VC++Files/mysqlbinlog/mysqlbinlog.dsp b/VC++Files/mysqlbinlog/mysqlbinlog.dsp index 8b8895d6f17..1b129072d8e 100644 --- a/VC++Files/mysqlbinlog/mysqlbinlog.dsp +++ b/VC++Files/mysqlbinlog/mysqlbinlog.dsp @@ -51,7 +51,7 @@ 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 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/mysqlbinlog.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 zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlbinlog.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /pdb:none /debug !ELSEIF "$(CFG)" == "mysqlbinlog - Win32 Debug" @@ -76,7 +76,7 @@ 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 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\\" +# 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 zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlbinlog.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysqlbinlog - Win32 classic" @@ -102,7 +102,7 @@ BSC32=bscmake.exe 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\\" +# 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 zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlbinlog.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /pdb:none /debug !ENDIF diff --git a/VC++Files/mysqlbinlog/mysqlbinlog_ia64.dsp b/VC++Files/mysqlbinlog/mysqlbinlog_ia64.dsp index 334c5087365..0bb6e9ed747 100644 --- a/VC++Files/mysqlbinlog/mysqlbinlog_ia64.dsp +++ b/VC++Files/mysqlbinlog/mysqlbinlog_ia64.dsp @@ -52,7 +52,7 @@ BSC32=bscmake.exe # 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 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:IA64 -# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /out:"../client_release/mysqlbinlog.exe" /libpath:"..\lib_release\\" /machine:IA64 +# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"../client_release/mysqlbinlog.exe" /libpath:"..\lib_release\\" /machine:IA64 # SUBTRACT LINK32 /debug !ELSEIF "$(CFG)" == "mysqlbinlog - WinIA64 Debug" @@ -78,7 +78,7 @@ BSC32=bscmake.exe # 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 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:IA64 -# ADD LINK32 ..\lib_debug\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/mysqlbinlog.exe" /libpath:"..\lib_debug\\" /machine:IA64 +# ADD LINK32 ..\lib_debug\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/mysqlbinlog.exe" /libpath:"..\lib_debug\\" /machine:IA64 !ELSEIF "$(CFG)" == "mysqlbinlog - WinIA64 classic" @@ -105,7 +105,7 @@ BSC32=bscmake.exe LINK32=link.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 /out:"../client_release/mysqlbinlog.exe" /libpath:"..\lib_release\\" /machine:IA64 # SUBTRACT BASE LINK32 /debug -# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /out:"../client_classic/mysqlbinlog.exe" /libpath:"..\lib_release\\" /machine:IA64 +# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"../client_classic/mysqlbinlog.exe" /libpath:"..\lib_release\\" /machine:IA64 # SUBTRACT LINK32 /debug !ENDIF diff --git a/VC++Files/mysqlcheck/mysqlcheck.dsp b/VC++Files/mysqlcheck/mysqlcheck.dsp index bd24a14128d..51a817cc067 100644 --- a/VC++Files/mysqlcheck/mysqlcheck.dsp +++ b/VC++Files/mysqlcheck/mysqlcheck.dsp @@ -51,7 +51,7 @@ 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 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/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 zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" !ELSEIF "$(CFG)" == "mysqlcheck - Win32 Debug" @@ -75,7 +75,7 @@ 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 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\\" +# 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 zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlcheck.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysqlcheck - Win32 classic" @@ -100,7 +100,7 @@ BSC32=bscmake.exe # 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\\" +# 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 zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlcheck.exe" /libpath:"..\lib_release\\" !ENDIF diff --git a/VC++Files/mysqlcheck/mysqlcheck_ia64.dsp b/VC++Files/mysqlcheck/mysqlcheck_ia64.dsp index 1f1cf76276f..04f10a2ddb8 100644 --- a/VC++Files/mysqlcheck/mysqlcheck_ia64.dsp +++ b/VC++Files/mysqlcheck/mysqlcheck_ia64.dsp @@ -52,7 +52,7 @@ BSC32=bscmake.exe # 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 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:IA64 -# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" /machine:IA64 +# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" /machine:IA64 !ELSEIF "$(CFG)" == "mysqlcheck - WinIA64 Debug" @@ -77,7 +77,7 @@ BSC32=bscmake.exe # 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 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:IA64 -# ADD LINK32 ..\lib_debug\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/mysqlcheck.exe" /libpath:"..\lib_debug\\" /machine:IA64 +# ADD LINK32 ..\lib_debug\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/mysqlcheck.exe" /libpath:"..\lib_debug\\" /machine:IA64 !ELSEIF "$(CFG)" == "mysqlcheck - WinIA64 classic" @@ -103,7 +103,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.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 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" /machine:IA64 -# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib /nologo /subsystem:console /out:"../client_classic/mysqlcheck.exe" /libpath:"..\lib_release\\" /machine:IA64 +# ADD LINK32 ..\lib_release\zlib.lib 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 bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"../client_classic/mysqlcheck.exe" /libpath:"..\lib_release\\" /machine:IA64 !ENDIF diff --git a/VC++Files/mysqlmanager/mysqlmanager.dsp b/VC++Files/mysqlmanager/mysqlmanager.dsp index 7f92e091904..27aa1a77024 100644 --- a/VC++Files/mysqlmanager/mysqlmanager.dsp +++ b/VC++Files/mysqlmanager/mysqlmanager.dsp @@ -54,7 +54,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 /nologo /subsystem:windows /machine:I386 /out:"../client_release/MySqlManager.exe" +# ADD LINK32 zlib.lib /nologo /subsystem:windows /machine:I386 /out:"../client_release/MySqlManager.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /nodefaultlib !ELSEIF "$(CFG)" == "MySqlManager - Win32 Debug" @@ -83,7 +83,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /incremental:no /debug /machine:I386 /out:"../client_debug/MySqlManager.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib zlib.lib /nologo /subsystem:windows /incremental:no /debug /machine:I386 /out:"../client_debug/MySqlManager.exe" /pdbtype:sept /libpath:"..\lib_debug\\" # SUBTRACT LINK32 /pdb:none !ENDIF diff --git a/VC++Files/strings/strings_ia64.dsp b/VC++Files/strings/strings_ia64.dsp index 6449b2b1355..edbcdee2f11 100644 --- a/VC++Files/strings/strings_ia64.dsp +++ b/VC++Files/strings/strings_ia64.dsp @@ -116,6 +116,10 @@ SOURCE=".\ctype-czech.c" # End Source File # Begin Source File +SOURCE=".\ctype-cp932.c" +# End Source File +# Begin Source File + SOURCE=".\ctype-euc_kr.c" # End Source File # Begin Source File From 1794eb3e2b60494d7f39bde29114b58d2d768165 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 25 May 2005 10:55:21 +0200 Subject: [PATCH 07/56] - one more build fix for zlib.lib - added libpath to the mysql_test_run_new project files VC++Files/mysql-test/mysql_test_run_new.dsp: - added libpath option so that zlib.lib will be found VC++Files/mysql-test/mysql_test_run_new_ia64.dsp: - added libpath option so that zlib.lib will be found --- VC++Files/mysql-test/mysql_test_run_new.dsp | 4 ++-- VC++Files/mysql-test/mysql_test_run_new_ia64.dsp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/VC++Files/mysql-test/mysql_test_run_new.dsp b/VC++Files/mysql-test/mysql_test_run_new.dsp index 7fa01d22d11..467ff939502 100644 --- a/VC++Files/mysql-test/mysql_test_run_new.dsp +++ b/VC++Files/mysql-test/mysql_test_run_new.dsp @@ -52,7 +52,7 @@ BSC32=bscmake.exe # 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:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib zlib.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib zlib.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console !ELSEIF "$(CFG)" == "mysql_test_run_new - Win32 Release" @@ -77,7 +77,7 @@ BSC32=bscmake.exe # 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: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 zlib.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 zlib.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:console !ENDIF diff --git a/VC++Files/mysql-test/mysql_test_run_new_ia64.dsp b/VC++Files/mysql-test/mysql_test_run_new_ia64.dsp index d9bad07dad9..023b38bd3c6 100644 --- a/VC++Files/mysql-test/mysql_test_run_new_ia64.dsp +++ b/VC++Files/mysql-test/mysql_test_run_new_ia64.dsp @@ -54,7 +54,7 @@ BSC32=bscmake.exe 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 /subsystem:console /map /debug /out:"..\mysql-test\mysql_test_run_new.exe" /machine:IA64 # 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 Ws2_32.lib bufferoverflowU.lib zlib.lib /nologo /subsystem:console /incremental:no /map /debug /out:"..\mysql-test\mysql_test_run_new.exe" /machine:IA64 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib bufferoverflowU.lib zlib.lib /nologo /subsystem:console /incremental:no /libpath:"..\lib_debug\" /map /debug /out:"..\mysql-test\mysql_test_run_new.exe" /machine:IA64 # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "mysql_test_run_new - WinIA64 Release" @@ -83,7 +83,7 @@ BSC32=bscmake.exe 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 /subsystem:console /out:"..\mysql-test\mysql_test_run_new.exe" /machine:IA64 # SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 t kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib bufferoverflowU.lib zlib.lib /nologo /subsystem:console /out:"..\mysql-test\mysql_test_run_new.exe" /machine:IA64 +# ADD LINK32 t kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib bufferoverflowU.lib zlib.lib /nologo /subsystem:console /libpath:"..\lib_release\" /out:"..\mysql-test\mysql_test_run_new.exe" /machine:IA64 # SUBTRACT LINK32 /pdb:none !ENDIF From 827db5e40cf4c85e5b57cc4f82aecaab8f02bbcd Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 25 May 2005 11:10:10 +0200 Subject: [PATCH 08/56] Use one err file for each master mysql-test/mysql-test-run.sh: Add master id to end of MASTER_MY_ERR so that both masters doesnt write to the same file. --- mysql-test/mysql-test-run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 4fee560ee44..3f7e7d22200 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -1181,8 +1181,8 @@ start_master() $NOT_FIRST_MASTER_EXTRA_OPTS" fi - CUR_MYERR=$MASTER_MYERR - CUR_MYSOCK=$MASTER_MYSOCK + CUR_MYERR=$MASTER_MYERR$1 + CUR_MYSOCK=$MASTER_MYSOCK$1 # For embedded server we collect the server flags and return if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then From 549f56dc3d7fdae2cf7d8ebfbc8a118bf21f12a0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 25 May 2005 12:56:47 +0300 Subject: [PATCH 09/56] Cleanup during code review Faster detection of wrong table names (like PRN) on windows include/my_sys.h: Added check_if_legal_filename() mysys/my_access.c: Added check_if_legal_filename() Set errno if my_access() fails mysys/my_fopen.c: USe check_if_legal_filename() instead of my_access() to detect wrong file names on windows mysys/my_open.c: USe check_if_legal_filename() instead of my_access() to detect wrong file names on windows sql/sql_lex.cc: Portability fix sql/sql_parse.cc: Simple cleanup sql/sql_repl.cc: Cleanup during code review --- include/my_sys.h | 1 + mysys/my_access.c | 120 ++++++++++++++++++++++++++++++++++++---------- mysys/my_fopen.c | 11 +++-- mysys/my_open.c | 13 +++-- sql/sql_lex.cc | 2 +- sql/sql_parse.cc | 5 +- sql/sql_repl.cc | 36 +++++++------- 7 files changed, 132 insertions(+), 56 deletions(-) diff --git a/include/my_sys.h b/include/my_sys.h index a0a008056ae..70c410e66d8 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -578,6 +578,7 @@ extern int my_access(const char *path, int amode); #else #define my_access access #endif +extern int check_if_legal_filename(const char *path); #ifndef TERMINATE extern void TERMINATE(FILE *file); diff --git a/mysys/my_access.c b/mysys/my_access.c index 6a8887e42a6..28210bdfc7d 100644 --- a/mysys/my_access.c +++ b/mysys/my_access.c @@ -15,39 +15,107 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "mysys_priv.h" +#include #ifdef __WIN__ /* - * Check a file or path for accessability. - * - * SYNOPSIS - * file_access() - * pathpath to check - * amodemode to check - * - * DESCRIPTION - * This function wraps the normal access method because the access - * available in MSVCRT> +reports that filenames such as LPT1 and - * COM1 are valid (they are but should not be so for us). - * - * RETURN VALUES - * 0 ok - * -1 error - */ + Check a file or path for accessability. + + SYNOPSIS + file_access() + path Path to file + amode Access method + + DESCRIPTION + This function wraps the normal access method because the access + available in MSVCRT> +reports that filenames such as LPT1 and + COM1 are valid (they are but should not be so for us). + + RETURN VALUES + 0 ok + -1 error (We use -1 as my_access is mapped to access on other platforms) +*/ + int my_access(const char *path, int amode) { - WIN32_FILE_ATTRIBUTE_DATA fileinfo; - BOOL result; + WIN32_FILE_ATTRIBUTE_DATA fileinfo; + BOOL result; - result = GetFileAttributesEx(path, GetFileExInfoStandard, - &fileinfo); - if (! result) - return -1; - if ((fileinfo.dwFileAttributes & FILE_ATTRIBUTE_READONLY) && - (amode & 2)) - return -1; - return 0; + result= GetFileAttributesEx(path, GetFileExInfoStandard, &fileinfo); + if (! result || + (fileinfo.dwFileAttributes & FILE_ATTRIBUTE_READONLY) && (amode & W_OK)) + { + my_errno= errno= EACCES; + return -1; + } + return 0; } +#endif /* __WIN__ */ + +#if defined(MSDOS) || defined(__WIN__) || defined(__EMX__) + +/* + List of file names that causes problem on windows + + NOTE that one can also not have file names of type CON.TXT +*/ + +static const char *reserved_names[]= +{ + "CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", + "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", + "LPT7", "LPT8", "LPT9", "CLOCK$", + NullS +}; + +#define MAX_RESERVED_NAME_LENGTH 6 + +/* + Check if a path will access a reserverd file name that may cause problems + + SYNOPSIS + check_if_legal_filename + path Path to file + + RETURN + 0 ok + 1 reserved file name +*/ + +int check_if_legal_filename(const char *path) +{ + const char *end; + const char **reserved_name; + DBUG_ENTER("check_if_legal_filename"); + + path+= dirname_length(path); /* To start of filename */ + if (!(end= strchr(path, FN_EXTCHAR))) + end= strend(path); + if (path == end || (uint) (path - end) > MAX_RESERVED_NAME_LENGTH) + DBUG_RETURN(0); /* Simplify inner loop */ + + for (reserved_name= reserved_names; *reserved_name; reserved_name++) + { + const char *name= path; + while (name != end) + { + if (my_toupper(&my_charset_latin1, *path) != + my_toupper(&my_charset_latin1, *name)) + break; + if (name++ == end) + DBUG_RETURN(1); /* Found wrong path */ + } + } + DBUG_RETURN(0); +} #endif + + +#ifdef OS2 +int check_if_legal_filename(const char *path) +{ + return 0; +} +#endif /* OS2 */ diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c index 4310250bd0d..3c6f1b15384 100644 --- a/mysys/my_fopen.c +++ b/mysys/my_fopen.c @@ -39,13 +39,16 @@ FILE *my_fopen(const char *FileName, int Flags, myf MyFlags) very well */ #ifdef __WIN__ - if (! (Flags & O_CREAT) && my_access(FileName, F_OK)) - fd=0; + if (check_if_legal_filename(FileName)) + { + errno= EACCES; + fd= 0; + } else #endif { - make_ftype(type,Flags); - fd = fopen(FileName, type); + make_ftype(type,Flags); + fd = fopen(FileName, type); } if (fd != 0) diff --git a/mysys/my_open.c b/mysys/my_open.c index ea4d99c3e8c..7cf40b57403 100644 --- a/mysys/my_open.c +++ b/mysys/my_open.c @@ -47,12 +47,15 @@ File my_open(const char *FileName, int Flags, myf MyFlags) FileName, Flags, MyFlags)); #if defined(MSDOS) || defined(__WIN__) || defined(__EMX__) || defined(OS2) /* - if we are not creating, then we need to use my_access to make - sure the file exists since Windows doesn't handle files like - "com1.sym" very well + Check that we don't try to open or create a file name that may + cause problems for us in the future (like PRN) */ - if (! (Flags & O_CREAT) && my_access(FileName, F_OK)) - return -1; + if (check_if_legal_filename(FileName)) + { + errno= EACCES; + DBUG_RETURN(my_register_filename(-1, FileName, FILE_BY_OPEN, + EE_FILENOTFOUND, MyFlags)); + } if (Flags & O_SHARE) fd = sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO, MY_S_IREAD | MY_S_IWRITE); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index d6dcd9ce9ae..904b4675c74 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -420,7 +420,7 @@ static const uint signed_longlong_len=19; static const char *unsigned_longlong_str="18446744073709551615"; static const uint unsigned_longlong_len=20; -inline static uint int_token(const char *str,uint length) +static inline uint int_token(const char *str,uint length) { if (length < long_len) // quick normal case return NUM; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c5b429ec8fc..05838b340b8 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2819,8 +2819,8 @@ unsent_create_error: TABLE *table= tables->table; /* Skip first table, which is the table we are inserting in */ - lex->select_lex.table_list.first= (byte*) first_local_table->next; - tables= (TABLE_LIST *) lex->select_lex.table_list.first; + select_lex->table_list.first= (byte*) first_local_table->next; + tables= (TABLE_LIST *) select_lex->table_list.first; first_local_table->next= 0; if (!(res= mysql_prepare_insert(thd, tables, first_local_table, @@ -5389,6 +5389,7 @@ int multi_update_precheck(THD *thd, TABLE_LIST *tables) 1 error (message is sent to user) -1 error (message is not sent to user) */ + int multi_delete_precheck(THD *thd, TABLE_LIST *tables, uint *table_count) { DBUG_ENTER("multi_delete_precheck"); diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 24b78bc9a3d..4249c9e1809 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -152,7 +152,8 @@ File open_binlog(IO_CACHE *log, const char *log_file_name, File file; DBUG_ENTER("open_binlog"); - if ((file = my_open(log_file_name, O_RDONLY | O_BINARY, MYF(MY_WME))) < 0) + if ((file = my_open(log_file_name, O_RDONLY | O_BINARY | O_SHARE, + MYF(MY_WME))) < 0) { sql_print_error("Failed to open log (\ file '%s', errno %d)", log_file_name, my_errno); @@ -1338,13 +1339,11 @@ int show_binlogs(THD* thd) { IO_CACHE *index_file; LOG_INFO cur; - IO_CACHE log; File file; - const char *errmsg= 0; - MY_STAT stat_area; char fname[FN_REFLEN]; List field_list; uint length; + int cur_dir_len; Protocol *protocol= thd->protocol; DBUG_ENTER("show_binlogs"); @@ -1364,34 +1363,35 @@ int show_binlogs(THD* thd) index_file=mysql_bin_log.get_index_file(); mysql_bin_log.get_current_log(&cur); - int cur_dir_len = dirname_length(cur.log_file_name); + cur_dir_len= dirname_length(cur.log_file_name); reinit_io_cache(index_file, READ_CACHE, (my_off_t) 0, 0, 0); /* The file ends with EOF or empty line */ while ((length=my_b_gets(index_file, fname, sizeof(fname))) > 1) { - fname[--length] = '\0'; /* remove the newline */ + int dir_len; + ulonglong file_length= 0; // Length if open fails + fname[--length] = '\0'; // remove the newline protocol->prepare_for_resend(); - int dir_len = dirname_length(fname); - protocol->store(fname + dir_len, length-dir_len, &my_charset_bin); - if(!(strncmp(fname+dir_len, cur.log_file_name+cur_dir_len, length-dir_len))) + dir_len= dirname_length(fname); + length-= dir_len; + protocol->store(fname + dir_len, length, &my_charset_bin); + + if (!(strncmp(fname+dir_len, cur.log_file_name+cur_dir_len, length))) + file_length= cur.pos; /* The active log, use the active position */ + else { - /* this is the active log, use the active position */ - protocol->store((ulonglong) cur.pos); - } else { /* this is an old log, open it and find the size */ - if ((file=open_binlog(&log, fname+dir_len, &errmsg)) >= 0) + if ((file= my_open(fname+dir_len, O_RDONLY | O_SHARE | O_BINARY, + MYF(0))) >= 0) { - protocol->store((ulonglong) my_b_filelength(&log)); - end_io_cache(&log); + file_length= (ulonglong) my_seek(file, 0L, MY_SEEK_END, MYF(0)); my_close(file, MYF(0)); - } else { - /* the file wasn't openable, but 0 is an invalid value anyway */ - protocol->store((ulonglong) 0); } } + protocol->store(file_length); if (protocol->write()) goto err; } From ce11270fc1aad781f066f33d28328bde31487dca Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 25 May 2005 16:24:07 +0200 Subject: [PATCH 10/56] Added a missing "make clean" to the RPM "spec" file which had caused the original 4.1.12 RPMs to be broken. (bug#10674, bug#10681) support-files/mysql.spec.sh: Added a missing "make clean" which had caused the original 4.1.12 RPMs to be broken. (bug#10674, bug#10681) --- support-files/mysql.spec.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 8b880c32051..2354b44f4fa 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -299,6 +299,9 @@ fi (cd libmysql/.libs; tar cf $RBR/shared-libs.tar *.so*) (cd libmysql_r/.libs; tar rf $RBR/shared-libs.tar *.so*) +# Now clean up +make clean + # RPM:s destroys Makefile.in files, so we generate them here # aclocal; autoheader; aclocal; automake; autoconf # (cd innobase && aclocal && autoheader && aclocal && automake && autoconf) @@ -584,6 +587,10 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Wed May 25 2005 Joerg Bruehe + +- Added a "make clean" between separate calls to "BuildMySQL". + * Wed Apr 13 2005 Lenz Grimmer - removed the MySQL manual files (html/ps/texi) - they have been removed From 8ac75806e2a18451198948d7086db8cafe8b0071 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 25 May 2005 20:26:40 -0700 Subject: [PATCH 11/56] Fix table renaming to not lowercase table names for all storage engines when lower_case_table_names == 2, as it did previously for InnoDB and MEMORY. (Bug #9660) mysql-test/r/lowercase_table2.result: Fix results sql/sql_table.cc: Add build_table_path() function to construct the path to a table, and use it to replace nearly all of the places where this was done with similar code. Fix mysql_rename_table() to not lowercase the .frm file name when lower_case_table_names == 2 and the storage engine does not set the HA_FILE_BASED flag (such as InnoDB). --- mysql-test/r/lowercase_table2.result | 12 +-- sql/sql_table.cc | 126 ++++++++++++++++----------- 2 files changed, 79 insertions(+), 59 deletions(-) diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result index 8361b66817a..1015990df9a 100644 --- a/mysql-test/r/lowercase_table2.result +++ b/mysql-test/r/lowercase_table2.result @@ -72,7 +72,7 @@ T1 CREATE TABLE `T1` ( RENAME TABLE T1 TO T2; SHOW TABLES LIKE "T2"; Tables_in_test (T2) -t2 +T2 SELECT * FROM t2; a 1 @@ -83,25 +83,25 @@ t3 RENAME TABLE T3 TO T1; SHOW TABLES LIKE "T1"; Tables_in_test (T1) -t1 +T1 ALTER TABLE T1 add b int; SHOW TABLES LIKE "T1"; Tables_in_test (T1) -t1 +T1 ALTER TABLE T1 RENAME T2; SHOW TABLES LIKE "T2"; Tables_in_test (T2) -t2 +T2 LOCK TABLE T2 WRITE; ALTER TABLE T2 drop b; SHOW TABLES LIKE "T2"; Tables_in_test (T2) -t2 +T2 UNLOCK TABLES; RENAME TABLE T2 TO T1; SHOW TABLES LIKE "T1"; Tables_in_test (T1) -t1 +T1 SELECT * from T1; a 1 diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 67aade519f5..951f89c4917 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -40,6 +40,34 @@ static int copy_data_between_tables(TABLE *from,TABLE *to, uint order_num, ORDER *order, ha_rows *copied,ha_rows *deleted); + +/* + Build the path to a file for a table (or the base path that can + then have various extensions stuck on to it). + + SYNOPSIS + build_table_path() + buff Buffer to build the path into + bufflen sizeof(buff) + db Name of database + table Name of table + ext Filename extension + + RETURN + FALSE Always -- see usage in mysql_create_indexes() + */ + +static bool build_table_path(char *buff, size_t bufflen, const char *db, + const char *table, const char *ext) +{ + strxnmov(buff, bufflen-1, mysql_data_home, "/", db, "/", table, ext, + NullS); + unpack_filename(buff,buff); + return FALSE; +} + + + /* delete (drop) tables. @@ -214,8 +242,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, DBUG_RETURN(-1); alias= (lower_case_table_names == 2) ? table->alias : table->real_name; /* remove form file and isam files */ - strxmov(path, mysql_data_home, "/", db, "/", alias, reg_ext, NullS); - (void) unpack_filename(path,path); + build_table_path(path, sizeof(path), db, alias, reg_ext); } if (drop_temporary || (access(path,F_OK) && ha_create_table_from_engine(thd,db,alias,TRUE))) @@ -295,13 +322,10 @@ int quick_rm_table(enum db_type base,const char *db, { char path[FN_REFLEN]; int error=0; - my_snprintf(path, sizeof(path), "%s/%s/%s%s", - mysql_data_home, db, table_name, reg_ext); - unpack_filename(path,path); + build_table_path(path, sizeof(path), db, table_name, reg_ext); if (my_delete(path,MYF(0))) error=1; /* purecov: inspected */ - my_snprintf(path, sizeof(path), "%s/%s/%s", mysql_data_home, db, table_name); - unpack_filename(path,path); + build_table_path(path, sizeof(path), db, table_name, ""); return ha_delete_table(base,path) || error; } @@ -1299,11 +1323,9 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, if (!create_info->default_table_charset) { HA_CREATE_INFO db_info; - uint length; char path[FN_REFLEN]; - strxmov(path, mysql_data_home, "/", db, NullS); - length= unpack_dirname(path,path); // Convert if not unix - strmov(path+length, MY_DB_OPT_FILE); + /* Abuse build_table_path() to build the path to the db.opt file */ + build_table_path(path, sizeof(path), db, MY_DB_OPT_FILE, ""); load_db_opt(thd, path, &db_info); create_info->default_table_charset= db_info.default_table_charset; } @@ -1317,17 +1339,18 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, /* Check if table exists */ if (create_info->options & HA_LEX_CREATE_TMP_TABLE) { - my_snprintf(path, sizeof(path), "%s%s%lx_%lx_%x%s", - mysql_tmpdir, tmp_file_prefix, current_pid, thd->thread_id, - thd->tmp_table++, reg_ext); + char tmp_table_name[NAME_LEN+1]; + my_snprintf(tmp_table_name, sizeof(tmp_table_name), "%s%lx_%lx_%x", + tmp_file_prefix, current_pid, thd->thread_id, + thd->tmp_table++); if (lower_case_table_names) - my_casedn_str(files_charset_info, path); + my_casedn_str(files_charset_info, tmp_table_name); create_info->table_options|=HA_CREATE_DELAY_KEY_WRITE; + build_table_path(path, sizeof(path), db, tmp_table_name, reg_ext); } else - my_snprintf(path, sizeof(path), "%s/%s/%s%s", mysql_data_home, db, - alias, reg_ext); - unpack_filename(path,path); + build_table_path(path, sizeof(path), db, alias, reg_ext); + /* Check if table already exists */ if ((create_info->options & HA_LEX_CREATE_TMP_TABLE) && find_temporary_table(thd,db,table_name)) @@ -1560,37 +1583,42 @@ mysql_rename_table(enum db_type base, const char *new_db, const char *new_name) { - char from[FN_REFLEN], to[FN_REFLEN]; - char tmp_from[NAME_LEN+1], tmp_to[NAME_LEN+1]; + char from[FN_REFLEN], to[FN_REFLEN], lc_from[FN_REFLEN], lc_to[FN_REFLEN]; + char *from_base= from, *to_base= to; + char tmp_name[NAME_LEN+1]; handler *file=get_new_handler((TABLE*) 0, base); int error=0; DBUG_ENTER("mysql_rename_table"); + build_table_path(from, sizeof(from), old_db, old_name, ""); + build_table_path(to, sizeof(to), new_db, new_name, ""); + + /* + If lower_case_table_names == 2 (case-preserving but case-insensitive + file system) and the storage is not HA_FILE_BASED, we need to provide + a lowercase file name, but we leave the .frm in mixed case. + */ if (lower_case_table_names == 2 && !(file->table_flags() & HA_FILE_BASED)) { - /* Table handler expects to get all file names as lower case */ - strmov(tmp_from, old_name); - my_casedn_str(files_charset_info, tmp_from); - old_name= tmp_from; + strmov(tmp_name, old_name); + my_casedn_str(files_charset_info, tmp_name); + build_table_path(lc_from, sizeof(lc_from), old_db, tmp_name, ""); + from_base= lc_from; - strmov(tmp_to, new_name); - my_casedn_str(files_charset_info, tmp_to); - new_name= tmp_to; + strmov(tmp_name, new_name); + my_casedn_str(files_charset_info, tmp_name); + build_table_path(lc_to, sizeof(lc_to), new_db, tmp_name, ""); + to_base= lc_to; } - my_snprintf(from, sizeof(from), "%s/%s/%s", - mysql_data_home, old_db, old_name); - my_snprintf(to, sizeof(to), "%s/%s/%s", - mysql_data_home, new_db, new_name); - fn_format(from,from,"","",4); - fn_format(to,to, "","",4); - if (!(error=file->rename_table((const char*) from,(const char *) to))) + if (!(error=file->rename_table((const char*) from_base, + (const char *) to_base))) { if (rename_file_ext(from,to,reg_ext)) { error=my_errno; /* Restore old file name */ - file->rename_table((const char*) to,(const char *) from); + file->rename_table((const char*) to_base, (const char *) from_base); } } delete file; @@ -1768,8 +1796,8 @@ static int prepare_for_repair(THD* thd, TABLE_LIST *table_list, if (!(table= table_list->table)) /* if open_ltable failed */ { char name[FN_REFLEN]; - strxmov(name, mysql_data_home, "/", table_list->db, "/", - table_list->real_name, NullS); + build_table_path(name, sizeof(name), table_list->db, + table_list->real_name, ""); if (openfrm(name, "", 0, 0, 0, &tmp_table)) DBUG_RETURN(0); // Can't open frm file table= &tmp_table; @@ -2570,11 +2598,9 @@ int mysql_create_indexes(THD *thd, TABLE_LIST *table_list, List &keys) else { if (table->file->add_index(table, key_info_buffer, key_count)|| - (my_snprintf(path, sizeof(path), "%s/%s/%s%s", mysql_data_home, - table_list->db, (lower_case_table_names == 2) ? - table_list->alias: table_list->real_name, reg_ext) >= - (int) sizeof(path)) || - ! unpack_filename(path, path) || + build_table_path(path, sizeof(path), table_list->db, + (lower_case_table_names == 2) ? + table_list->alias : table_list->real_name, reg_ext) || mysql_create_frm(thd, path, &create_info, fields, key_count, key_info_buffer, table->file)) /* don't need to free((gptr) key_info_buffer);*/ @@ -2672,11 +2698,9 @@ int mysql_drop_indexes(THD *thd, TABLE_LIST *table_list, keys, /*tmp_table*/ 0, db_options, table->file, key_info_buffer, key_count, /*select_field_count*/ 0)|| - (snprintf(path, sizeof(path), "%s/%s/%s%s", mysql_data_home, - table_list->db, (lower_case_table_names == 2)? - table_list->alias: table_list->real_name, reg_ext)>= - (int)sizeof(path))|| - ! unpack_filename(path, path)|| + build_table_path(path, sizeof(path), table_list->db, + (lower_case_table_names == 2) ? + table_list->alias : table_list->real_name, reg_ext) || mysql_create_frm(thd, path, &create_info, fields, key_count, key_info_buffer, table->file)) /*don't need to free((gptr) key_numbers);*/ @@ -3199,9 +3223,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, else { char path[FN_REFLEN]; - my_snprintf(path, sizeof(path), "%s/%s/%s", mysql_data_home, - new_db, tmp_name); - fn_format(path,path,"","",4); + build_table_path(path, sizeof(path), new_db, tmp_name, ""); new_table=open_temporary_table(thd, path, new_db, tmp_name,0); } if (!new_table) @@ -3406,9 +3428,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, shutdown. */ char path[FN_REFLEN]; - my_snprintf(path, sizeof(path), "%s/%s/%s", mysql_data_home, - new_db, table_name); - fn_format(path,path,"","",4); + build_table_path(path, sizeof(path), new_db, table_name); table=open_temporary_table(thd, path, new_db, tmp_name,0); if (table) { From 22944a956350d6276f9a852f78dee2b8126e68c7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 May 2005 12:09:14 +0200 Subject: [PATCH 12/56] Add ifdefs to control when "#pragma implementation" should be used Added some more ifdefs for "#pragma interface" client/sql_string.cc: USE_PRAGMA_IMPLEMENTATION client/sql_string.h: USE_PRAGMA_INTERFACE include/my_global.h: Use pragma implementation for gcc pre version 3 mysys/raid.cc: USE_PRAGMA_IMPLEMENTATION sql/field.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_berkeley.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_blackhole.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_heap.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_innodb.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_isam.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_isammrg.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_myisam.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_myisammrg.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_ndbcluster.cc: USE_PRAGMA_IMPLEMENTATION sql/handler.cc: USE_PRAGMA_IMPLEMENTATION sql/hash_filo.cc: USE_PRAGMA_IMPLEMENTATION sql/item.cc: USE_PRAGMA_IMPLEMENTATION sql/item_cmpfunc.cc: USE_PRAGMA_IMPLEMENTATION sql/item_func.cc: USE_PRAGMA_IMPLEMENTATION sql/item_geofunc.cc: USE_PRAGMA_IMPLEMENTATION sql/item_strfunc.cc: USE_PRAGMA_IMPLEMENTATION sql/item_subselect.cc: USE_PRAGMA_IMPLEMENTATION sql/item_sum.cc: USE_PRAGMA_IMPLEMENTATION sql/item_timefunc.cc: USE_PRAGMA_IMPLEMENTATION sql/item_uniq.cc: USE_PRAGMA_IMPLEMENTATION sql/item_uniq.h: USE_PRAGMA_INTERFACE sql/log_event.cc: USE_PRAGMA_IMPLEMENTATION sql/log_event.h: USE_PRAGMA_INTERFACE sql/opt_range.cc: USE_PRAGMA_IMPLEMENTATION sql/procedure.cc: USE_PRAGMA_IMPLEMENTATION sql/protocol.cc: USE_PRAGMA_IMPLEMENTATION sql/protocol_cursor.cc: USE_PRAGMA_IMPLEMENTATION sql/set_var.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_analyse.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_analyse.h: USE_PRAGMA_INTERFACE sql/sql_class.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_crypt.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_crypt.h: USE_PRAGMA_IMPLEMENTATION sql/sql_list.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_map.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_map.h: USE_PRAGMA_INTERFACE sql/sql_olap.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_select.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_string.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_udf.cc: USE_PRAGMA_IMPLEMENTATION sql/tztime.cc: USE_PRAGMA_IMPLEMENTATION --- client/sql_string.cc | 2 +- client/sql_string.h | 2 +- include/my_global.h | 5 +++++ mysys/raid.cc | 2 +- sql/field.cc | 2 +- sql/ha_berkeley.cc | 2 +- sql/ha_blackhole.cc | 2 +- sql/ha_heap.cc | 2 +- sql/ha_innodb.cc | 2 +- sql/ha_isam.cc | 2 +- sql/ha_isammrg.cc | 2 +- sql/ha_myisam.cc | 2 +- sql/ha_myisammrg.cc | 2 +- sql/ha_ndbcluster.cc | 2 +- sql/handler.cc | 2 +- sql/hash_filo.cc | 2 +- sql/item.cc | 2 +- sql/item_cmpfunc.cc | 2 +- sql/item_func.cc | 2 +- sql/item_geofunc.cc | 2 +- sql/item_strfunc.cc | 2 +- sql/item_subselect.cc | 2 +- sql/item_sum.cc | 2 +- sql/item_timefunc.cc | 2 +- sql/item_uniq.cc | 2 +- sql/item_uniq.h | 2 +- sql/log_event.cc | 2 +- sql/log_event.h | 2 +- sql/opt_range.cc | 2 +- sql/procedure.cc | 2 +- sql/protocol.cc | 2 +- sql/protocol_cursor.cc | 2 +- sql/set_var.cc | 2 +- sql/sql_analyse.cc | 2 +- sql/sql_analyse.h | 2 +- sql/sql_class.cc | 2 +- sql/sql_crypt.cc | 2 +- sql/sql_crypt.h | 2 +- sql/sql_list.cc | 2 +- sql/sql_map.cc | 2 +- sql/sql_map.h | 2 +- sql/sql_olap.cc | 2 +- sql/sql_select.cc | 2 +- sql/sql_string.cc | 2 +- sql/sql_udf.cc | 2 +- sql/tztime.cc | 2 +- 46 files changed, 50 insertions(+), 45 deletions(-) diff --git a/client/sql_string.cc b/client/sql_string.cc index 9dcf19dad1d..690997152f1 100644 --- a/client/sql_string.cc +++ b/client/sql_string.cc @@ -16,7 +16,7 @@ /* This file is originally from the mysql distribution. Coded by monty */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/client/sql_string.h b/client/sql_string.h index aec40466d2b..fd6d3ef59d9 100644 --- a/client/sql_string.h +++ b/client/sql_string.h @@ -16,7 +16,7 @@ /* This file is originally from the mysql distribution. Coded by monty */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_INTERFACE #pragma interface /* gcc class implementation */ #endif diff --git a/include/my_global.h b/include/my_global.h index f059d603976..0f6d9ac13c6 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -48,6 +48,11 @@ #define USE_PRAGMA_INTERFACE #endif +/* Determine when to use "#pragma implementation" */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3) +#define USE_PRAGMA_IMPLEMENTATION +#endif + #if defined(i386) && !defined(__i386__) #define __i386__ #endif diff --git a/mysys/raid.cc b/mysys/raid.cc index 0b688464fb3..62587c438ca 100644 --- a/mysys/raid.cc +++ b/mysys/raid.cc @@ -70,7 +70,7 @@ tonu@mysql.com & monty@mysql.com */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/field.cc b/sql/field.cc index d73257a673f..adb0368384e 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -19,7 +19,7 @@ ** This file implements classes defined in field.h *****************************************************************************/ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 626201a38a6..05cad23b176 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -47,7 +47,7 @@ */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index c9c94b3a9d7..59b3f7102b5 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 033fe86720e..d584c33f061 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 2d2a8f2c3b4..bb3c359ccdb 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -28,7 +28,7 @@ have disables the InnoDB inlining in this file. */ in Windows? */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index 9de532fa7b0..31e9236460f 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_isammrg.cc b/sql/ha_isammrg.cc index 367607eef19..c0e6f665f08 100644 --- a/sql/ha_isammrg.cc +++ b/sql/ha_isammrg.cc @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 7ddb7ca25ed..d8608c6a599 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index 7a5d4fcf0a1..9ba853c49d0 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 53706b4a9ba..eaa0473df1b 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -20,7 +20,7 @@ NDB Cluster */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/handler.cc b/sql/handler.cc index f174f51514e..f14564b6629 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -17,7 +17,7 @@ /* Handler-calling-functions */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/hash_filo.cc b/sql/hash_filo.cc index b85f8054f10..ec200768222 100644 --- a/sql/hash_filo.cc +++ b/sql/hash_filo.cc @@ -20,7 +20,7 @@ ** to usage. */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item.cc b/sql/item.cc index 59785813566..98aeeaa4c99 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 8498ab4800e..337ac949d35 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -17,7 +17,7 @@ /* This file defines all compare functions */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_func.cc b/sql/item_func.cc index 05b76eb1604..3c50e750b41 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -17,7 +17,7 @@ /* This file defines all numerical functions */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 2f00416bddf..c58a9e434c7 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -17,7 +17,7 @@ /* This file defines all spatial functions */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index baba4d9b786..5ca5caf6bdf 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -20,7 +20,7 @@ ** (This shouldn't be needed) */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 301740c50ef..2e4c70ecd5f 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -22,7 +22,7 @@ SUBSELECT TODO: (sql_select.h/sql_select.cc) */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_sum.cc b/sql/item_sum.cc index dd4cda4ff91..fb88fca9a2d 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -17,7 +17,7 @@ /* Sum functions (COUNT, MIN...) */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 23cd9c7ced2..a3cf69035f3 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -17,7 +17,7 @@ /* This file defines all time functions */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_uniq.cc b/sql/item_uniq.cc index 88e0cbbc0e6..0c757c0e3a3 100644 --- a/sql/item_uniq.cc +++ b/sql/item_uniq.cc @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Compability file */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation #endif diff --git a/sql/item_uniq.h b/sql/item_uniq.h index 5582537bdbb..b7e00f9f080 100644 --- a/sql/item_uniq.h +++ b/sql/item_uniq.h @@ -16,7 +16,7 @@ /* Compability file ; This file only contains dummy functions */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_INTERFACE #pragma interface #endif diff --git a/sql/log_event.cc b/sql/log_event.cc index 8a949b81fc1..f2287857d37 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -16,7 +16,7 @@ #ifndef MYSQL_CLIENT -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif #include "mysql_priv.h" diff --git a/sql/log_event.h b/sql/log_event.h index f848f2ae1b9..7ae4e863fc2 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -22,7 +22,7 @@ #undef write // remove pthread.h macro definition, conflict with write() class member #endif -#if defined(__GNUC__) && !defined(MYSQL_CLIENT) +#if defined(USE_PRAGMA_INTERFACE) && !defined(MYSQL_CLIENT) #pragma interface /* gcc class implementation */ #endif diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 33223b83894..bd1befb436f 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -23,7 +23,7 @@ */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/procedure.cc b/sql/procedure.cc index 7779f5ce085..a0042dd879e 100644 --- a/sql/procedure.cc +++ b/sql/procedure.cc @@ -17,7 +17,7 @@ /* Procedures (functions with changes output of select) */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/protocol.cc b/sql/protocol.cc index 91061426f04..6a17ae2f95b 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -19,7 +19,7 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/protocol_cursor.cc b/sql/protocol_cursor.cc index 5f35552c562..b225e06ed32 100644 --- a/sql/protocol_cursor.cc +++ b/sql/protocol_cursor.cc @@ -19,7 +19,7 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/set_var.cc b/sql/set_var.cc index 9f63188c28a..3d3ba6d6ab7 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -48,7 +48,7 @@ new attribute. */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 7ac9a0866df..fb5d0eb0a3f 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -23,7 +23,7 @@ ** - type set is out of optimization yet */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h index 3d1cffecaef..8523b05a1de 100644 --- a/sql/sql_analyse.h +++ b/sql/sql_analyse.h @@ -17,7 +17,7 @@ /* Analyse database */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_INTERFACE #pragma interface /* gcc class implementation */ #endif diff --git a/sql/sql_class.cc b/sql/sql_class.cc index c20d5f79277..805db107370 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -22,7 +22,7 @@ ** *****************************************************************************/ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc index b0b8050e311..f21a109e95d 100644 --- a/sql/sql_crypt.cc +++ b/sql/sql_crypt.cc @@ -23,7 +23,7 @@ needs something like 'ssh'. */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_crypt.h b/sql/sql_crypt.h index 1b27f0a4d27..25bc2d29e1d 100644 --- a/sql/sql_crypt.h +++ b/sql/sql_crypt.h @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_INTERFACE #pragma interface /* gcc class implementation */ #endif diff --git a/sql/sql_list.cc b/sql/sql_list.cc index c99cfb8c918..d57a7dfe4e3 100644 --- a/sql/sql_list.cc +++ b/sql/sql_list.cc @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_map.cc b/sql/sql_map.cc index e7e24f957c6..aac44949d89 100644 --- a/sql/sql_map.cc +++ b/sql/sql_map.cc @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_map.h b/sql/sql_map.h index 632eb6e4f64..bfa6011ac54 100644 --- a/sql/sql_map.h +++ b/sql/sql_map.h @@ -17,7 +17,7 @@ /* interface for memory mapped files */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_INTERFACE #pragma interface /* gcc class implementation */ #endif diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc index 46f1e6c156e..024abb6c74b 100644 --- a/sql/sql_olap.cc +++ b/sql/sql_olap.cc @@ -28,7 +28,7 @@ #ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1 -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_select.cc b/sql/sql_select.cc index fb7f10abb52..7b27879ae28 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -17,7 +17,7 @@ /* mysql_select and join optimization */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_string.cc b/sql/sql_string.cc index c1701e7e9bf..ab2db4aaf53 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -16,7 +16,7 @@ /* This file is originally from the mysql distribution. Coded by monty */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 126d2e5d894..f5b4775ee0b 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -28,7 +28,7 @@ ** dynamic functions, so this shouldn't be a real problem. */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: implement sql_udf.h #endif diff --git a/sql/tztime.cc b/sql/tztime.cc index c45271966f9..8fac054c49c 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -20,7 +20,7 @@ (We will refer to this code as to elsie-code further.) */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif From ab88a1d25a95e04ff0f22ac9e8e3e69d77c428dc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 May 2005 12:12:36 +0200 Subject: [PATCH 13/56] Fix icc compiler warning ndb/src/kernel/blocks/dbtux/Dbtux.hpp: Removed second forward declaration of "struct DescEnt" --- ndb/src/kernel/blocks/dbtux/Dbtux.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp index 2c96271eb5d..3d78fccb780 100644 --- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp +++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp @@ -342,7 +342,6 @@ private: * Complete metadata for one index. The array of attributes has * variable size. */ - struct DescEnt; friend struct DescEnt; struct DescEnt { DescHead m_descHead; From 9181c17c143063bd2714c6524772f5b10d412844 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 May 2005 15:42:24 +0300 Subject: [PATCH 14/56] InnoDB: Check all referencing tables in DROP DATABASE (Bug #10335). innobase/row/row0mysql.c: row_drop_table_for_mysql(): Check all referencing tables when drop_db==TRUE (Bug #10335) --- innobase/row/row0mysql.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index a915200161f..86557315b71 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -2143,6 +2143,7 @@ row_drop_table_for_mysql( foreign = UT_LIST_GET_FIRST(table->referenced_list); while (foreign && foreign->foreign_table == table) { + check_next_foreign: foreign = UT_LIST_GET_NEXT(referenced_list, foreign); } @@ -2171,6 +2172,10 @@ row_drop_table_for_mysql( goto funct_exit; } + if (foreign && trx->check_foreigns) { + goto check_next_foreign; + } + if (table->n_mysql_handles_opened > 0) { ibool added; From 80b0baa7405ddb36637ee7ceeb2b15ff90af6635 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 May 2005 17:30:12 +0300 Subject: [PATCH 15/56] fixed problem with long string results of expressions in UNIONS (BUG#10025) mysql-test/r/union.result: test for Bug #10025 mysql-test/t/union.test: test for Bug #10025 sql/item.cc: set HA_OPTION_PACK_RECORD and change type to MYSQL_TYPE_STRING, to allow correct field creation in case of length more then 255 (creation STRING field with length more then 255) --- mysql-test/r/union.result | 14 ++++++++++++++ mysql-test/t/union.test | 11 +++++++++++ sql/item.cc | 4 ++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index c140ecd26e1..57dfd48b6bd 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -1235,3 +1235,17 @@ show columns from t2; Field Type Null Key Default Extra a varchar(3) YES NULL drop table t2, t1; +CREATE TABLE t1 (a mediumtext); +CREATE TABLE t2 (b varchar(20)); +INSERT INTO t1 VALUES ('a'),('b'); +SELECT left(a,100000000) FROM t1 UNION SELECT b FROM t2; +left(a,100000000) +a +b +create table t3 SELECT left(a,100000000) FROM t1 UNION SELECT b FROM t2; +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `left(a,100000000)` longtext +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop tables t1,t2,t3; diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index b0446e1ea4a..ffc7e718e9d 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -742,3 +742,14 @@ create table t2 select a from t1 union select c from t1; create table t2 select a from t1 union select b from t1; show columns from t2; drop table t2, t1; + +# +# correct conversion long string to TEXT (BUG#10025) +# +CREATE TABLE t1 (a mediumtext); +CREATE TABLE t2 (b varchar(20)); +INSERT INTO t1 VALUES ('a'),('b'); +SELECT left(a,100000000) FROM t1 UNION SELECT b FROM t2; +create table t3 SELECT left(a,100000000) FROM t1 UNION SELECT b FROM t2; +show create table t3; +drop tables t1,t2,t3; diff --git a/sql/item.cc b/sql/item.cc index 59785813566..8bc26c8c679 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3099,8 +3099,8 @@ Field *Item_type_holder::make_field_by_type(TABLE *table) enum_set_typelib, collation.collation); case MYSQL_TYPE_VAR_STRING: table->db_create_options|= HA_OPTION_PACK_RECORD; - return new Field_string(max_length, maybe_null, name, table, - collation.collation); + fld_type= MYSQL_TYPE_STRING; + break; default: break; } From e547fbea68891d61447beaf4263044114318ef6a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 May 2005 10:01:26 -0700 Subject: [PATCH 16/56] Cleanups to patch for bug #9660 after review by Monty. sql/sql_table.cc: Make return value of build_table_path() useful Eliminate some unnecessary casts --- sql/sql_table.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 951f89c4917..411fb420895 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -54,16 +54,16 @@ static int copy_data_between_tables(TABLE *from,TABLE *to, ext Filename extension RETURN - FALSE Always -- see usage in mysql_create_indexes() + 0 Error + # Size of path */ -static bool build_table_path(char *buff, size_t bufflen, const char *db, +static uint build_table_path(char *buff, size_t bufflen, const char *db, const char *table, const char *ext) { strxnmov(buff, bufflen-1, mysql_data_home, "/", db, "/", table, ext, NullS); - unpack_filename(buff,buff); - return FALSE; + return unpack_filename(buff,buff); } @@ -1611,14 +1611,13 @@ mysql_rename_table(enum db_type base, to_base= lc_to; } - if (!(error=file->rename_table((const char*) from_base, - (const char *) to_base))) + if (!(error=file->rename_table(from_base, to_base))) { if (rename_file_ext(from,to,reg_ext)) { error=my_errno; /* Restore old file name */ - file->rename_table((const char*) to_base, (const char *) from_base); + file->rename_table(to_base, from_base); } } delete file; @@ -2600,7 +2599,8 @@ int mysql_create_indexes(THD *thd, TABLE_LIST *table_list, List &keys) if (table->file->add_index(table, key_info_buffer, key_count)|| build_table_path(path, sizeof(path), table_list->db, (lower_case_table_names == 2) ? - table_list->alias : table_list->real_name, reg_ext) || + table_list->alias : table_list->real_name, + reg_ext) != 0 || mysql_create_frm(thd, path, &create_info, fields, key_count, key_info_buffer, table->file)) /* don't need to free((gptr) key_info_buffer);*/ @@ -2700,7 +2700,8 @@ int mysql_drop_indexes(THD *thd, TABLE_LIST *table_list, /*select_field_count*/ 0)|| build_table_path(path, sizeof(path), table_list->db, (lower_case_table_names == 2) ? - table_list->alias : table_list->real_name, reg_ext) || + table_list->alias : table_list->real_name, + reg_ext) != 0 || mysql_create_frm(thd, path, &create_info, fields, key_count, key_info_buffer, table->file)) /*don't need to free((gptr) key_numbers);*/ From 360d1cd06d6ea1a803305a5fcfde5a79c16365b7 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 27 May 2005 12:38:29 +0200 Subject: [PATCH 17/56] don't downgrade the lock for CREATE ... SELECT (bug#6678) --- sql/ha_innodb.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 2d2a8f2c3b4..f0a25fd4f98 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -5420,7 +5420,8 @@ ha_innobase::store_lock( if ((lock_type >= TL_WRITE_CONCURRENT_INSERT && lock_type <= TL_WRITE) && !thd->in_lock_tables - && !thd->tablespace_op) { + && !thd->tablespace_op + && thd->lex->sql_command != SQLCOM_CREATE_TABLE) { lock_type = TL_WRITE_ALLOW_WRITE; } From 755d2018ada199005b70b4836f6fbb56e2e7b892 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 27 May 2005 14:15:08 +0200 Subject: [PATCH 18/56] forgotten s/__GNUC__/USE_PRAGMA_INTERFACE/ causes compilation faliures --- sql/hash_filo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/hash_filo.h b/sql/hash_filo.h index d1672e1a60c..fc48c3b1540 100644 --- a/sql/hash_filo.h +++ b/sql/hash_filo.h @@ -23,7 +23,7 @@ #ifndef HASH_FILO_H #define HASH_FILO_H -#ifdef __GNUC__ +#ifdef USE_PRAGMA_INTERFACE #pragma interface /* gcc class interface */ #endif From 5a548200037183e1afeaccc6bc5f34c09420abe0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 30 May 2005 03:01:51 -0700 Subject: [PATCH 19/56] olap.result, olap.test: Added test cases for bug #7894. sql_select.cc: Fixed bug #7894: GROUP BY queries with ROLLUP returned wrong results for expressions containing group by columns. The fix ensured correct results by replacement of all occurrences of group by fields in non-aggregate expressions for corresponding ref objects and preventing creation of fields in temporary tables for expression containing group by fields. sql/sql_select.cc: Fixed bug #7894: GROUP BY queries with ROLLUP returned wrong results for expressions containing group by columns. The fix ensured correct results by replacement of all occurrences of group by fields in non-aggregate expressions for corresponding ref objects and preventing creation of fields in temporary tables for expression containing group by fields. mysql-test/t/olap.test: Added test cases for bug #7894. mysql-test/r/olap.result: Added test cases for bug #7894. --- mysql-test/r/olap.result | 68 +++++++++++++++++++++++++++- mysql-test/t/olap.test | 30 +++++++++++++ sql/sql_select.cc | 95 +++++++++++++++++++++++++++++++++++++--- 3 files changed, 187 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index 013952403d7..ab84fa5739a 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -248,7 +248,7 @@ concat(':',product,':') sum(profit) avg(profit) :Computer: 6900 1380.0000 :Phone: 10 10.0000 :TV: 600 120.0000 -:TV: 7785 519.0000 +NULL 7785 519.0000 select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube; ERROR 42000: This version of MySQL doesn't yet support 'CUBE' explain select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube; @@ -438,3 +438,69 @@ a SUM(a) SUM(a)+1 CONCAT(SUM(a),'x') SUM(a)+SUM(a) SUM(a) 5 5 6 5x 10 5 NULL 8 9 8x 16 8 DROP TABLE t1; +CREATE TABLE t1 (a int(11)); +INSERT INTO t1 VALUES (1),(2); +SELECT a, a+1, SUM(a) FROM t1 GROUP BY a WITH ROLLUP; +a a+1 SUM(a) +1 2 1 +2 3 2 +NULL NULL 3 +SELECT a+1 FROM t1 GROUP BY a WITH ROLLUP; +a+1 +2 +3 +NULL +SELECT a+SUM(a) FROM t1 GROUP BY a WITH ROLLUP; +a+SUM(a) +2 +4 +NULL +SELECT a, a+1 as b FROM t1 GROUP BY a WITH ROLLUP HAVING b > 2; +a b +2 3 +SELECT a, a+1 as b FROM t1 GROUP BY a WITH ROLLUP HAVING a IS NULL; +a b +NULL NULL +SELECT a, a+1 as b FROM t1 GROUP BY a WITH ROLLUP HAVING b IS NULL; +a b +NULL NULL +SELECT IFNULL(a, 'TEST') FROM t1 GROUP BY a WITH ROLLUP; +IFNULL(a, 'TEST') +1 +2 +TEST +CREATE TABLE t2 (a int, b int); +INSERT INTO t2 VALUES +(1,4), +(2,2), (2,2), +(4,1), (4,1), (4,1), (4,1), +(2,1), (2,1); +SELECT a,b,SUM(b) FROM t2 GROUP BY a,b WITH ROLLUP; +a b SUM(b) +1 4 4 +1 NULL 4 +2 1 2 +2 2 4 +2 NULL 6 +4 1 4 +4 NULL 4 +NULL NULL 14 +SELECT a,b,SUM(b), a+b as c FROM t2 +GROUP BY a,b WITH ROLLUP HAVING c IS NULL; +a b SUM(b) c +1 NULL 4 NULL +2 NULL 6 NULL +4 NULL 4 NULL +NULL NULL 14 NULL +SELECT IFNULL(a, 'TEST'), COALESCE(b, 'TEST') FROM t2 +GROUP BY a, b WITH ROLLUP; +IFNULL(a, 'TEST') COALESCE(b, 'TEST') +1 4 +1 TEST +2 1 +2 2 +2 TEST +4 1 +4 TEST +TEST TEST +DROP TABLE t1,t2; diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test index 09ba537bf3b..b9387d15320 100644 --- a/mysql-test/t/olap.test +++ b/mysql-test/t/olap.test @@ -208,3 +208,33 @@ SELECT a, SUM(a), SUM(a)+1, CONCAT(SUM(a),'x'), SUM(a)+SUM(a), SUM(a) DROP TABLE t1; +# +# Tests for bug #7894: ROLLUP over expressions on group by attributes +# + +CREATE TABLE t1 (a int(11)); +INSERT INTO t1 VALUES (1),(2); + +SELECT a, a+1, SUM(a) FROM t1 GROUP BY a WITH ROLLUP; +SELECT a+1 FROM t1 GROUP BY a WITH ROLLUP; +SELECT a+SUM(a) FROM t1 GROUP BY a WITH ROLLUP; +SELECT a, a+1 as b FROM t1 GROUP BY a WITH ROLLUP HAVING b > 2; +SELECT a, a+1 as b FROM t1 GROUP BY a WITH ROLLUP HAVING a IS NULL; +SELECT a, a+1 as b FROM t1 GROUP BY a WITH ROLLUP HAVING b IS NULL; +SELECT IFNULL(a, 'TEST') FROM t1 GROUP BY a WITH ROLLUP; + +CREATE TABLE t2 (a int, b int); +INSERT INTO t2 VALUES + (1,4), + (2,2), (2,2), + (4,1), (4,1), (4,1), (4,1), + (2,1), (2,1); + +SELECT a,b,SUM(b) FROM t2 GROUP BY a,b WITH ROLLUP; +SELECT a,b,SUM(b), a+b as c FROM t2 + GROUP BY a,b WITH ROLLUP HAVING c IS NULL; +SELECT IFNULL(a, 'TEST'), COALESCE(b, 'TEST') FROM t2 + GROUP BY a, b WITH ROLLUP; + +DROP TABLE t1,t2; + diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 7b27879ae28..4f192b9228e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9164,6 +9164,79 @@ void free_underlaid_joins(THD *thd, SELECT_LEX *select) ROLLUP handling ****************************************************************************/ +/* + Replace occurences of group by fields in an expression by ref items + + SYNOPSIS + change_group_ref() + thd reference to the context + expr expression to make replacement + group_list list of references to group by items + changed out: returns 1 if item contains a replaced field item + + DESCRIPTION + The function replaces occurrences of group by fields in expr + by ref objects for these fields unless they are under aggregate + functions. + + IMPLEMENTATION + The function recursively traverses the tree of the expr expression, + looks for occurrences of the group by fields that are not under + aggregate functions and replaces them for the corresponding ref items. + + NOTES + This substitution is needed GROUP BY queries with ROLLUP if + SELECT list contains expressions over group by attributes. + + EXAMPLES + SELECT a+1 FROM t1 GROUP BY a WITH ROLLUP + SELECT SUM(a)+a FROM t1 GROUP BY a WITH ROLLUP + + RETURN + 0 if ok + 1 on error +*/ + +static bool change_group_ref(THD *thd, Item *expr, ORDER *group_list, + bool *changed) +{ + if (expr->type() != Item::FUNC_ITEM) + return 0; + Item_func *func_item= (Item_func *) expr; + if (func_item->arg_count) + { + Item **arg,**arg_end; + for (arg= func_item->arguments(), + arg_end= func_item->arguments()+func_item->arg_count; + arg != arg_end; arg++) + { + Item *item= *arg; + if (item->type() == Item::FIELD_ITEM || item->type() == Item::REF_ITEM) + { + ORDER *group_tmp; + for (group_tmp= group_list; group_tmp; group_tmp= group_tmp->next) + { + if (item->eq(*group_tmp->item,0)) + { + Item *new_item; + if(!(new_item= new Item_ref(group_tmp->item, 0, item->name))) + return 1; // fatal_error is set + thd->change_item_tree(arg, new_item); + *changed= TRUE; + } + } + } + else if (item->type() == Item::FUNC_ITEM) + { + if (change_group_ref(thd, item, group_list, changed)) + return 1; + } + } + } + return 0; +} + + /* Allocate memory needed for other rollup functions */ bool JOIN::rollup_init() @@ -9208,19 +9281,31 @@ bool JOIN::rollup_init() for (j=0 ; j < fields_list.elements ; j++) rollup.fields[i].push_back(rollup.null_items[i]); } - List_iterator_fast it(fields_list); + List_iterator_fast it(all_fields); Item *item; while ((item= it++)) { ORDER *group_tmp; for (group_tmp= group_list; group_tmp; group_tmp= group_tmp->next) { - if (*group_tmp->item == item) + if (item->eq(*group_tmp->item,0)) item->maybe_null= 1; } + if (item->type() == Item::FUNC_ITEM) + { + bool changed= 0; + if (change_group_ref(thd, item, group_list, &changed)) + return 1; + /* + We have to prevent creation of a field in a temporary table for + an expression that contains GROUP BY attributes. + Marking the expression item as 'with_sum_func' will ensure this. + */ + if (changed) + item->with_sum_func= 1; + } } return 0; - } @@ -9318,14 +9403,14 @@ bool JOIN::rollup_make_fields(List &fields_arg, List &sel_fields, *(*func)= (Item_sum*) item; (*func)++; } - else if (real_fields) + else { /* Check if this is something that is part of this group by */ ORDER *group_tmp; for (group_tmp= start_group, i= pos ; group_tmp ; group_tmp= group_tmp->next, i++) { - if (*group_tmp->item == item) + if (item->eq(*group_tmp->item,0)) { /* This is an element that is used by the GROUP BY and should be From 25841aa9addc20fc28c0392d5447b984b2bc230b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 30 May 2005 05:25:12 -0700 Subject: [PATCH 20/56] sql_select.cc: Post-review modifications for the fix of bug #7894. sql/sql_select.cc: Post-review modifications for the fix of bug #7894. --- sql/sql_select.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 4f192b9228e..0362f097cba 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9197,17 +9197,14 @@ void free_underlaid_joins(THD *thd, SELECT_LEX *select) 1 on error */ -static bool change_group_ref(THD *thd, Item *expr, ORDER *group_list, +static bool change_group_ref(THD *thd, Item_func *expr, ORDER *group_list, bool *changed) { - if (expr->type() != Item::FUNC_ITEM) - return 0; - Item_func *func_item= (Item_func *) expr; - if (func_item->arg_count) + if (expr->arg_count) { Item **arg,**arg_end; - for (arg= func_item->arguments(), - arg_end= func_item->arguments()+func_item->arg_count; + for (arg= expr->arguments(), + arg_end= expr->arguments()+expr->arg_count; arg != arg_end; arg++) { Item *item= *arg; @@ -9228,7 +9225,7 @@ static bool change_group_ref(THD *thd, Item *expr, ORDER *group_list, } else if (item->type() == Item::FUNC_ITEM) { - if (change_group_ref(thd, item, group_list, changed)) + if (change_group_ref(thd, (Item_func *) item, group_list, changed)) return 1; } } @@ -9294,7 +9291,7 @@ bool JOIN::rollup_init() if (item->type() == Item::FUNC_ITEM) { bool changed= 0; - if (change_group_ref(thd, item, group_list, &changed)) + if (change_group_ref(thd, (Item_func *) item, group_list, &changed)) return 1; /* We have to prevent creation of a field in a temporary table for From 7b4385f4725f99ed5115b0f89174fc358498cfe0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 31 May 2005 10:54:33 +0500 Subject: [PATCH 21/56] a fix (bug #7405: group_concat with distinct and rollup => ignores distinct in some rows). sql/item_sum.cc: a fix (bug #7405: group_concat with distinct and rollup => ignores distinct in some rows). Code changed in order to work with rollup extension. --- mysql-test/r/func_gconcat.result | 23 +++++++++++++++++ mysql-test/t/func_gconcat.test | 12 +++++++++ sql/item_sum.cc | 43 +++++++++++--------------------- 3 files changed, 49 insertions(+), 29 deletions(-) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index c1ac1c084df..057822839fa 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -469,3 +469,26 @@ x (select group_concat(x) from r2) 1 1,1 2 2,2 drop table r2; +create table t1 (d int, a int, b int, c int); +insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3); +select a, group_concat(b) from t1 group by a with rollup; +a group_concat(b) +1 3,4,2,1,2 +2 7,3,3 +NULL 3,4,2,1,2,7,3,3 +select a, group_concat(distinct b) from t1 group by a with rollup; +a group_concat(distinct b) +1 3,4,2,1 +2 7,3 +NULL 3,4,2,1,7 +select a, group_concat(b order by b) from t1 group by a with rollup; +a group_concat(b order by b) +1 1,2,2,3,4 +2 3,3,7 +NULL 1,2,2,3,3,3,4,7 +select a, group_concat(distinct b order by b) from t1 group by a with rollup; +a group_concat(distinct b order by b) +1 1,2,3,4 +2 3,7 +NULL 1,2,3,4,7 +drop table t1; diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index d32c8796075..485e8ba143c 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -292,3 +292,15 @@ create table r2 (a int, b int); insert into r2 values (1,1), (2,2); select b x, (select group_concat(x) from r2) from r2; drop table r2; + +# +# Bug #7405: problems with rollup +# + +create table t1 (d int, a int, b int, c int); +insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3); +select a, group_concat(b) from t1 group by a with rollup; +select a, group_concat(distinct b) from t1 group by a with rollup; +select a, group_concat(b order by b) from t1 group by a with rollup; +select a, group_concat(distinct b order by b) from t1 group by a with rollup; +drop table t1; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index fb88fca9a2d..0e252259f53 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1566,7 +1566,6 @@ int group_concat_key_cmp_with_distinct(void* arg, byte* key1, { Item_func_group_concat* grp_item= (Item_func_group_concat*)arg; Item **field_item, **end; - char *record= (char*) grp_item->table->record[0]; for (field_item= grp_item->args, end= field_item + grp_item->arg_count_field; field_item < end; @@ -1581,7 +1580,7 @@ int group_concat_key_cmp_with_distinct(void* arg, byte* key1, if (field) { int res; - uint offset= (uint) (field->ptr - record); + uint offset= field->offset(); if ((res= field->key_cmp(key1 + offset, key2 + offset))) return res; } @@ -1599,7 +1598,6 @@ int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2) { Item_func_group_concat* grp_item= (Item_func_group_concat*) arg; ORDER **order_item, **end; - char *record= (char*) grp_item->table->record[0]; for (order_item= grp_item->order, end=order_item+ grp_item->arg_count_order; order_item < end; @@ -1615,7 +1613,7 @@ int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2) if (field) { int res; - uint offset= (uint) (field->ptr - record); + uint offset= field->offset(); if ((res= field->key_cmp(key1 + offset, key2 + offset))) return (*order_item)->asc ? res : -res; } @@ -1657,7 +1655,6 @@ int dump_leaf_key(byte* key, uint32 count __attribute__((unused)), { char buff[MAX_FIELD_WIDTH]; String tmp((char *)&buff,sizeof(buff),default_charset_info), tmp2; - char *record= (char*) item->table->record[0]; if (item->result.length()) item->result.append(*item->separator); @@ -1677,9 +1674,8 @@ int dump_leaf_key(byte* key, uint32 count __attribute__((unused)), Field *field= show_item->get_tmp_table_field(); String *res; char *save_ptr= field->ptr; - uint offset= (uint) (save_ptr - record); - DBUG_ASSERT(offset < item->table->reclength); - field->ptr= (char *) key + offset; + DBUG_ASSERT(field->offset() < item->table->reclength); + field->ptr= (char *) key + field->offset(); res= field->val_str(&tmp,&tmp2); item->result.append(*res); field->ptr= save_ptr; @@ -1852,12 +1848,6 @@ void Item_func_group_concat::clear() result.copy(); null_value= TRUE; warning_for_row= FALSE; - if (table) - { - table->file->extra(HA_EXTRA_NO_CACHE); - table->file->delete_all_rows(); - table->file->extra(HA_EXTRA_WRITE_CACHE); - } if (tree_mode) reset_tree(tree); } @@ -1870,19 +1860,13 @@ bool Item_func_group_concat::add() copy_fields(tmp_table_param); copy_funcs(tmp_table_param->items_to_copy); - for (uint i= 0; i < arg_count_field; i++) + for (Item **arg= args, **arg_end= args + arg_count_field; + arg < arg_end; arg++) { - Item *show_item= args[i]; - if (!show_item->const_item()) - { - /* - Here we use real_item as we want the original field data that should - be written to table->record[0] - */ - Field *f= show_item->real_item()->get_tmp_table_field(); - if (f->is_null()) + if (!(*arg)->const_item() && + (*arg)->get_tmp_table_field()->is_null_in_record( + (const uchar*) table->record[0])) return 0; // Skip row if it contains null - } } null_value= FALSE; @@ -1945,10 +1929,6 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) null_value= 1; max_length= group_concat_max_len; thd->allow_sum_func= 1; - if (!(tmp_table_param= new TMP_TABLE_PARAM)) - return 1; - /* We'll convert all blobs to varchar fields in the temporary table */ - tmp_table_param->convert_blob_length= group_concat_max_len; tables_list= tables; fixed= 1; return 0; @@ -1967,6 +1947,11 @@ bool Item_func_group_concat::setup(THD *thd) if (select_lex->linkage == GLOBAL_OPTIONS_TYPE) DBUG_RETURN(1); + if (!(tmp_table_param= new TMP_TABLE_PARAM)) + return 1; + /* We'll convert all blobs to varchar fields in the temporary table */ + tmp_table_param->convert_blob_length= group_concat_max_len; + /* push all not constant fields to list and create temp table */ From cf2188ca398e12d4a10c50b069c2243825f9dced Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 31 May 2005 11:08:14 +0200 Subject: [PATCH 22/56] Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement. 1.) Added a new option to mysql_lock_tables() for ignoring FLUSH TABLES. Used the new option in create_table_from_items(). It is necessary to prevent the SELECT table from being reopend. It would get new storage assigned for its fields, while the SELECT part of the command would still use the old (freed) storage. 2.) Protected the CREATE TABLE and CREATE TABLE ... SELECT commands against a global read lock. This prevents a deadlock in CREATE TABLE ... SELECT in conjunction with FLUSH TABLES WITH READ LOCK and avoids the creation of new tables during a global read lock. 3.) Replaced set_protect_against_global_read_lock() and unset_protect_against_global_read_lock() by wait_if_global_read_lock() and start_waiting_global_read_lock() in the INSERT DELAYED handling. mysql-test/r/create.result: Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement. Added test results. mysql-test/t/create.test: Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement. Added tests which do not require concurrency. sql/lock.cc: Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement. Added a new option to mysql_lock_tables() for ignoring FLUSH TABLES. Changed the parameter list. Removed two unnecessary functions. Their functionality is included in wait_if_global_read_lock() and start_waiting_global_read_lock(). sql/mysql_priv.h: Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement. Changed the declaration of mysql_lock_tables(). Added definitions for the new options. sql/sql_acl.cc: Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement. Adjusted mysql_lock_tables() calls to the new argument list. sql/sql_base.cc: Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement. Adjusted mysql_lock_tables() calls to the new argument list. sql/sql_handler.cc: Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement. Adjusted mysql_lock_tables() calls to the new argument list. sql/sql_insert.cc: Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement. Replaced set_protect_against_global_read_lock() and unset_protect_against_global_read_lock() by wait_if_global_read_lock() and start_waiting_global_read_lock() in the INSERT DELAYED handling. Adjusted mysql_lock_tables() calls to the new argument list. sql/sql_parse.cc: Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement. Protected the CREATE TABLE and CREATE TABLE ... SELECT commands against a global read lock. This prevents a deadlock in CREATE TABLE ... SELECT in conjunction with FLUSH TABLES WITH READ LOCK and avoids the creation of new tables during a global read lock. sql/sql_table.cc: Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement. Adjusted mysql_lock_tables() calls to the new argument list. Used the new option in create_table_from_items(). --- mysql-test/r/create.result | 8 +++++ mysql-test/t/create.test | 15 +++++++++ sql/lock.cc | 69 ++++++++++++-------------------------- sql/mysql_priv.h | 7 ++-- sql/sql_acl.cc | 4 +-- sql/sql_base.cc | 6 ++-- sql/sql_handler.cc | 2 +- sql/sql_insert.cc | 24 +++++++++---- sql/sql_parse.cc | 37 ++++++++++++++++++-- sql/sql_table.cc | 2 +- 10 files changed, 108 insertions(+), 66 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 7cb79d5a990..c99ad8960dc 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -228,3 +228,11 @@ create table t1 (a int,,b int); 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 'b int)' at line 1 create table t1 (,b int); 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 'b int)' at line 1 +create table t1 (a int); +create table t1 select * from t1; +INSERT TABLE 't1' isn't allowed in FROM table list +create table t2 union = (t1) select * from t1; +INSERT TABLE 't1' isn't allowed in FROM table list +flush tables with read lock; +unlock tables; +drop table t1; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index c71a1e0c177..ed2c76932da 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -203,3 +203,18 @@ create table t1 (a int,); create table t1 (a int,,b int); --error 1064 create table t1 (,b int); + +# +# Bug#10224 - ANALYZE TABLE crashing with simultaneous +# CREATE ... SELECT statement. +# This tests two additional possible errors and a hang if +# an improper fix is present. +# +create table t1 (a int); +--error 1093 +create table t1 select * from t1; +--error 1093 +create table t2 union = (t1) select * from t1; +flush tables with read lock; +unlock tables; +drop table t1; diff --git a/sql/lock.cc b/sql/lock.cc index 951b0e2ff6a..4c6d7c75ae2 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -79,8 +79,24 @@ static int unlock_external(THD *thd, TABLE **table,uint count); static void print_lock_error(int error); -MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count, - bool ignore_global_read_lock) +/* + Lock tables. + + SYNOPSIS + mysql_lock_tables() + thd The current thread. + tables An array of pointers to the tables to lock. + count The number of tables to lock. + flags Options: + MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK Ignore a global read lock + MYSQL_LOCK_IGNORE_FLUSH Ignore a flush tables. + + RETURN + A lock structure pointer on success. + NULL on error. +*/ + +MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count, uint flags) { MYSQL_LOCK *sql_lock; TABLE *write_lock_used; @@ -91,7 +107,8 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count, if (!(sql_lock = get_lock_data(thd,tables,count, 0,&write_lock_used))) break; - if (global_read_lock && write_lock_used && ! ignore_global_read_lock) + if (global_read_lock && write_lock_used && + ! (flags & MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK)) { /* Someone has issued LOCK ALL TABLES FOR READ and we want a write lock @@ -125,7 +142,7 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count, thd->some_tables_deleted=1; // Try again sql_lock->lock_count=0; // Locks are alread freed } - else if (!thd->some_tables_deleted) + else if (!thd->some_tables_deleted || (flags & MYSQL_LOCK_IGNORE_FLUSH)) { thd->locked=0; break; @@ -868,47 +885,3 @@ void make_global_read_lock_block_commit(THD *thd) } -/* - Set protection against global read lock. - - SYNOPSIS - set_protect_against_global_read_lock() - void - - RETURN - FALSE OK, no global read lock exists. - TRUE Error, global read lock exists already. -*/ - -my_bool set_protect_against_global_read_lock(void) -{ - my_bool global_read_lock_exists; - - pthread_mutex_lock(&LOCK_open); - if (! (global_read_lock_exists= test(global_read_lock))) - protect_against_global_read_lock++; - pthread_mutex_unlock(&LOCK_open); - return global_read_lock_exists; -} - - -/* - Unset protection against global read lock. - - SYNOPSIS - unset_protect_against_global_read_lock() - void - - RETURN - void -*/ - -void unset_protect_against_global_read_lock(void) -{ - pthread_mutex_lock(&LOCK_open); - protect_against_global_read_lock--; - pthread_mutex_unlock(&LOCK_open); - pthread_cond_broadcast(&COND_refresh); -} - - diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 6a25536b3f1..75ec3482d8d 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -766,8 +766,11 @@ extern pthread_t signal_thread; extern struct st_VioSSLAcceptorFd * ssl_acceptor_fd; #endif /* HAVE_OPENSSL */ -MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **table, uint count, - bool ignore_global_read_lock= FALSE); +MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **table, uint count, uint flags); +/* mysql_lock_tables() flags bits */ +#define MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK 0x0001 +#define MYSQL_LOCK_IGNORE_FLUSH 0x0002 + void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock); void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock); void mysql_unlock_some_tables(THD *thd, TABLE **table,uint count); diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index acdd07b2fc5..46b29f252a6 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -177,7 +177,7 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables) ptr[0]= tables[0].table; ptr[1]= tables[1].table; ptr[2]= tables[2].table; - if (!(lock=mysql_lock_tables(thd,ptr,3))) + if (! (lock= mysql_lock_tables(thd, ptr, 3, 0))) { sql_print_error("Fatal error: Can't lock privilege tables: %s", thd->net.last_error); @@ -2514,7 +2514,7 @@ my_bool grant_init(THD *org_thd) TABLE *ptr[2]; // Lock tables for quick update ptr[0]= tables[0].table; ptr[1]= tables[1].table; - if (!(lock=mysql_lock_tables(thd,ptr,2))) + if (! (lock= mysql_lock_tables(thd, ptr, 2, 0))) goto end; t_table = tables[0].table; c_table = tables[1].table; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index c8eb2338294..9c5f73697fd 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1161,7 +1161,7 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh) MYSQL_LOCK *lock; /* We should always get these locks */ thd->some_tables_deleted=0; - if ((lock=mysql_lock_tables(thd,tables,(uint) (tables_ptr-tables)))) + if ((lock= mysql_lock_tables(thd, tables, (uint) (tables_ptr-tables), 0))) { thd->locked_tables=mysql_lock_merge(thd->locked_tables,lock); } @@ -1602,7 +1602,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type) else { if ((table->reginfo.lock_type= lock_type) != TL_UNLOCK) - if (!(thd->lock=mysql_lock_tables(thd,&table_list->table,1))) + if (! (thd->lock= mysql_lock_tables(thd, &table_list->table, 1, 0))) table= 0; } } @@ -1653,7 +1653,7 @@ int lock_tables(THD *thd,TABLE_LIST *tables) return -1; for (table = tables ; table ; table=table->next) *(ptr++)= table->table; - if (!(thd->lock=mysql_lock_tables(thd,start,count))) + if (! (thd->lock= mysql_lock_tables(thd, start, count, 0))) return -1; /* purecov: inspected */ } else diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 5bfcc897fc7..fcdb2aeb668 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -448,7 +448,7 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, send_fields(thd,list,1); HANDLER_TABLES_HACK(thd); - lock= mysql_lock_tables(thd, &tables->table, 1); + lock= mysql_lock_tables(thd, &tables->table, 1, 0); HANDLER_TABLES_HACK(thd); byte *key; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index c6b7b1d6c15..b61c766120e 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -674,10 +674,13 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list) Avoid that a global read lock steps in while we are creating the new thread. It would block trying to open the table. Hence, the DI thread and this thread would wait until after the global - readlock is gone. If the read lock exists already, we leave with - no table and then switch to non-delayed insert. + readlock is gone. Since the insert thread needs to wait for a + global read lock anyway, we do it right now. Note that + wait_if_global_read_lock() sets a protection against a new + global read lock when it succeeds. This needs to be released by + start_waiting_global_read_lock(). */ - if (set_protect_against_global_read_lock()) + if (wait_if_global_read_lock(thd, 0, 1)) goto err; if (!(tmp=new delayed_insert())) { @@ -719,7 +722,11 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list) pthread_cond_wait(&tmp->cond_client,&tmp->mutex); } pthread_mutex_unlock(&tmp->mutex); - unset_protect_against_global_read_lock(); + /* + Release the protection against the global read lock and wake + everyone, who might want to set a global read lock. + */ + start_waiting_global_read_lock(thd); thd->proc_info="got old table"; if (tmp->thd.killed) { @@ -755,7 +762,11 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list) err1: thd->fatal_error= 1; - unset_protect_against_global_read_lock(); + /* + Release the protection against the global read lock and wake + everyone, who might want to set a global read lock. + */ + start_waiting_global_read_lock(thd); err: pthread_mutex_unlock(&LOCK_delayed_create); DBUG_RETURN(0); // Continue with normal insert @@ -1105,7 +1116,8 @@ extern "C" pthread_handler_decl(handle_delayed_insert,arg) handler will close the table and finish when the outstanding inserts are done. */ - if (! (thd->lock= mysql_lock_tables(thd, &di->table, 1, TRUE))) + if (! (thd->lock= mysql_lock_tables(thd, &di->table, 1, + MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK))) { di->dead=thd->killed=1; // Fatal error } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 8f56b7cfcff..aac442d35a2 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1673,6 +1673,24 @@ mysql_execute_command(void) break; } #endif + /* + The create-select command will open and read-lock the select table + and then create, open and write-lock the new table. If a global + read lock steps in, we get a deadlock. The write lock waits for + the global read lock, while the global read lock waits for the + select table to be closed. So we wait until the global readlock is + gone before starting both steps. Note that + wait_if_global_read_lock() sets a protection against a new global + read lock when it succeeds. This needs to be released by + start_waiting_global_read_lock(). We protect the normal CREATE + TABLE in the same way. That way we avoid that a new table is + created during a gobal read lock. + */ + if (wait_if_global_read_lock(thd, 0, 1)) + { + res= -1; + break; + } if (select_lex->item_list.elements) // With select { select_result *result; @@ -1681,7 +1699,7 @@ mysql_execute_command(void) check_dup(tables->db, tables->real_name, tables->next)) { net_printf(&thd->net,ER_INSERT_TABLE_USED,tables->real_name); - DBUG_VOID_RETURN; + goto error1; } if (lex->create_info.used_fields & HA_CREATE_USED_UNION) { @@ -1692,7 +1710,7 @@ mysql_execute_command(void) (TABLE_LIST*)lex->create_info.merge_list.first)) { net_printf(&thd->net, ER_INSERT_TABLE_USED, tab->real_name); - DBUG_VOID_RETURN; + goto error1; } } } @@ -1700,7 +1718,7 @@ mysql_execute_command(void) { TABLE_LIST *table; if (check_table_access(thd, SELECT_ACL, tables->next)) - goto error; // Error message is given + goto error1; // Error message is given /* TODO: Delete the following loop when locks is set by sql_yacc */ for (table = tables->next ; table ; table=table->next) table->lock_type= lex->lock_option; @@ -1737,6 +1755,11 @@ mysql_execute_command(void) if (!res) send_ok(&thd->net); } + /* + Release the protection against the global read lock and wake + everyone, who might want to set a global read lock. + */ + start_waiting_global_read_lock(thd); break; } case SQLCOM_CREATE_INDEX: @@ -2674,6 +2697,14 @@ error: thd->lock= 0; } DBUG_VOID_RETURN; + + error1: + /* + Release the protection against the global read lock and wake + everyone, who might want to set a global read lock. + */ + start_waiting_global_read_lock(thd); + DBUG_VOID_RETURN; } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index e275f902abd..a9af8144df0 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -896,7 +896,7 @@ TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, if (!table) DBUG_RETURN(0); table->reginfo.lock_type=TL_WRITE; - if (!((*lock)=mysql_lock_tables(thd,&table,1))) + if (! ((*lock)= mysql_lock_tables(thd, &table, 1, MYSQL_LOCK_IGNORE_FLUSH))) { VOID(pthread_mutex_lock(&LOCK_open)); hash_delete(&open_cache,(byte*) table); From 2b548fe935b126fb4c0c9bfd109ed7dee778382b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 31 May 2005 18:06:54 +0100 Subject: [PATCH 23/56] Bug#10413 - Invalid column name is not rejected Stop ignoring name parts and check for validity mysql-test/r/create.result: Test for bug#10413 mysql-test/t/create.test: Test for bug#10413 sql/sql_yacc.yy: Bug#10413 Stop ignoring parts of fully qualified names. --- mysql-test/r/create.result | 9 +++++++++ mysql-test/t/create.test | 13 +++++++++++++ sql/sql_yacc.yy | 26 +++++++++++++++++++++++++- 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 103bed598ef..cae5e24df18 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -563,3 +563,12 @@ select * from t2; b 1 drop table t1,t2; +create table t1(column.name int); +ERROR 42000: Incorrect table name 'column' +create table t1(test.column.name int); +ERROR 42000: Incorrect table name 'column' +create table t1(xyz.t1.name int); +ERROR 42000: Incorrect database name 'xyz' +create table t1(t1.name int); +create table t2(test.t2.name int); +drop table t1,t2; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index ce85e530569..dca662a415e 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -460,3 +460,16 @@ insert into t2 values (); select * from t1; select * from t2; drop table t1,t2; + +# +# Bug#10413: Invalid column name is not rejected +# +--error 1103 +create table t1(column.name int); +--error 1103 +create table t1(test.column.name int); +--error 1102 +create table t1(xyz.t1.name int); +create table t1(t1.name int); +create table t2(test.t2.name int); +drop table t1,t2; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index d8a2c997bf8..7585f0b10a0 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -5016,7 +5016,31 @@ simple_ident: field_ident: ident { $$=$1;} - | ident '.' ident { $$=$3;} /* Skip schema name in create*/ + | ident '.' ident '.' ident + { + TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first; + if (my_strcasecmp(table_alias_charset, $1.str, table->db)) + { + net_printf(YYTHD, ER_WRONG_DB_NAME, $1.str); + YYABORT; + } + if (my_strcasecmp(table_alias_charset, $3.str, table->real_name)) + { + net_printf(YYTHD, ER_WRONG_TABLE_NAME, $3.str); + YYABORT; + } + $$=$5; + } + | ident '.' ident + { + TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first; + if (my_strcasecmp(table_alias_charset, $1.str, table->alias)) + { + net_printf(YYTHD, ER_WRONG_TABLE_NAME, $1.str); + YYABORT; + } + $$=$3; + } | '.' ident { $$=$2;} /* For Delphi */; table_ident: From 601b5bca66da5bb7108a13dc55984312f8396475 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 31 May 2005 20:45:41 +0200 Subject: [PATCH 24/56] Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement. After merge fix. --- mysql-test/r/create.result | 5 +++-- mysql-test/t/create.test | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 7bec98b0687..cd8378a504d 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -563,11 +563,12 @@ select * from t2; b 1 drop table t1,t2; +use test; create table t1 (a int); create table t1 select * from t1; -INSERT TABLE 't1' isn't allowed in FROM table list +ERROR HY000: You can't specify target table 't1' for update in FROM clause create table t2 union = (t1) select * from t1; -INSERT TABLE 't1' isn't allowed in FROM table list +ERROR HY000: You can't specify target table 't1' for update in FROM clause flush tables with read lock; unlock tables; drop table t1; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 5677a9cccb2..c37fccef70b 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -467,6 +467,8 @@ drop table t1,t2; # This tests two additional possible errors and a hang if # an improper fix is present. # +connection default; +use test; create table t1 (a int); --error 1093 create table t1 select * from t1; From 0d4b118455b1b97e8adc316407e26a8d734d3f04 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Jun 2005 12:59:10 +0200 Subject: [PATCH 25/56] - removed references to some obsolete files (BUG#10824) - removed obsolete mysql-max.spec.sc RPM spec file (Max is built out of the standard spec file) BitKeeper/deleted/.del-mysql-max.spec.sh~ca055d86585c1010: Delete: support-files/mysql-max.spec.sh configure.in: - removed references to some obsolete files scripts/make_binary_distribution.sh: - removed references to some obsolete files --- configure.in | 8 +- scripts/make_binary_distribution.sh | 3 - support-files/mysql-max.spec.sh | 263 ---------------------------- 3 files changed, 1 insertion(+), 273 deletions(-) delete mode 100644 support-files/mysql-max.spec.sh diff --git a/configure.in b/configure.in index 938f2f5776f..b291200c114 100644 --- a/configure.in +++ b/configure.in @@ -1193,16 +1193,10 @@ EOF # echo -n "making sure specific build files are writable... " for file in \ - Docs/include.texi \ Docs/mysql.info \ - Docs/manual.txt \ - Docs/manual_toc.html \ - Docs/manual.html \ Docs/INSTALL-BINARY \ INSTALL-SOURCE \ - COPYING \ - COPYING.LIB \ - MIRRORS + COPYING do if test -e $file; then chmod +w $file diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 8ea9a16f56b..ffef1648954 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -74,9 +74,6 @@ if [ $BASE_SYSTEM != "netware" ] ; then fi for i in ChangeLog \ - Docs/manual.html \ - Docs/manual.txt \ - Docs/manual_toc.html \ Docs/mysql.info do if [ -f $i ] diff --git a/support-files/mysql-max.spec.sh b/support-files/mysql-max.spec.sh deleted file mode 100644 index 5c4b16f0e9d..00000000000 --- a/support-files/mysql-max.spec.sh +++ /dev/null @@ -1,263 +0,0 @@ -%define mysql_version @VERSION@ -%define shared_lib_version @SHARED_LIB_VERSION@ -%define release 2 -%define mysqld_user mysql - -%define see_base For a description of MySQL see the base MySQL RPM or http://www.mysql.com - -Name: MySQL -Summary: MySQL: a very fast and reliable SQL database engine -Group: Applications/Databases -Summary(pt_BR): MySQL: Um servidor SQL rápido e confiável. -Group(pt_BR): Aplicações/Banco_de_Dados -Version: @MYSQL_NO_DASH_VERSION@ -Release: %{release} -Copyright: GPL / LGPL -Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz -Icon: mysql.gif -URL: http://www.mysql.com/ -Packager: David Axmark , Monty -Provides: msqlormysql MySQL-server -Obsoletes: mysql - -# Think about what you use here since the first step is to -# run a rm -rf -BuildRoot: /var/tmp/mysql-max - -# From the manual -%description -MySQL is a true multi-user, multi-threaded SQL (Structured Query -Language) database server. MySQL is a client/server implementation -that consists of a server daemon (mysqld) and many different client -programs/libraries. - -The main goals of MySQL are speed, robustness and ease of use. MySQL -was originally developed because we needed a SQL server that could -handle very big databases with magnitude higher speed than what any -database vendor could offer to us. And since we did not need all the -features that made their server slow we made our own. We have now been -using MySQL since 1996 in a environment with more than 40 databases, -10,000 tables, of which more than 500 have more than 7 million -rows. This is about 200G of data. - -The base upon which MySQL is built is a set of routines that have been -used in a highly demanding production environment for many -years. While MySQL is still in development, it already offers a rich -and highly useful function set. - -The MySQL-max version differs from the normal MySQL server distribution -in that the BDB and Innobase table handlers are enabled by default. -You can use any normal MySQL client with the MySQL-max server. - -See the documentation for more information. - -%description -l pt_BR -O MySQL é um servidor de banco de dados SQL realmente multiusuário e\ -multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de\ -dados no mundo. O MySQL é uma implementação cliente/servidor que\ -consiste de um servidor chamado mysqld e diversos\ -programas/bibliotecas clientes. Os principais objetivos do MySQL são:\ -velocidade, robustez e facilidade de uso. O MySQL foi originalmente\ -desenvolvido porque nós na Tcx precisávamos de um servidor SQL que\ -pudesse lidar com grandes bases de dados e com uma velocidade muito\ -maior do que a que qualquer vendedor podia nos oferecer. Estamos\ -usando\ -o MySQL desde 1996 em um ambiente com mais de 40 bases de dados com 10.000\ -tabelas, das quais mais de 500 têm mais de 7 milhões de linhas. Isto é o\ -equivalente a aproximadamente 50G de dados críticos. A base da construção do\ -MySQL é uma série de rotinas que foram usadas em um ambiente de produção com\ -alta demanda por muitos anos. Mesmo o MySQL estando ainda em desenvolvimento,\ -ele já oferece um conjunto de funções muito ricas e úteis. Veja a documentação\ -para maiores informações. - -%prep -%setup -n mysql-max-%{mysql_version} -# %setup -T -D -a 1 -n mysql-max-%{mysql_version} - -%build -# The all-static flag is to make the RPM work on different -# distributions. This version tries to put shared mysqlclient libraries -# in a separate package. - -BuildMySQL() { -# The --enable-assembler simply does nothing on systems that does not -# support assembler speedups. -sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \ - CC=\"${MYSQL_BUILD_CC:-egcs}\" \ - CFLAGS=\"${MYSQL_BUILD_CFLAGS:- -O6 -fno-omit-frame-pointer}\" \ - CXX=\"${MYSQL_BUILD_CXX:-egcs}\" \ - CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:- -O6 \ - -felide-constructors -fno-exceptions -fno-rtti \ - -fno-omit-frame-pointer}\" \ - ./configure \ - $* \ - --enable-assembler \ - --with-mysqld-user=%{mysqld_user} \ - --with-unix-socket-path=/var/lib/mysql/mysql.sock \ - --prefix=/ \ - --with-extra-charsets=complex \ - --exec-prefix=/usr \ - --libexecdir=/usr/sbin \ - --sysconfdir=/etc \ - --datadir=/usr/share \ - --localstatedir=/var/lib/mysql \ - --infodir=/usr/info \ - --includedir=/usr/include \ - --mandir=/usr/man \ - --with-berkeley-db \ - --with-innodb \ - --with-comment=\"Official MySQL-Max RPM\"; - # Add this for more debugging support - # --with-debug - # Add this for MyISAM RAID support: - # --with-raid - " - make -} - -# Use the build root for temporary storage of the shared libraries. - -RBR=$RPM_BUILD_ROOT -MBD=$RPM_BUILD_DIR/mysql-max-%{mysql_version} -if test -z "$RBR" -o "$RBR" = "/" -then - echo "RPM_BUILD_ROOT has stupid value" - exit 1 -fi -rm -rf $RBR -mkdir -p $RBR - -#cd $MBD/db-%{db_version}/dist -#./configure --prefix=$RBR/usr/BDB -#make install -# -#echo $RBR $MBD -#cd $MBD - -BuildMySQL "--disable-shared" \ - "--with-mysqld-ldflags='-all-static'" \ - "--with-client-ldflags='-all-static'" - -%install -n mysql-max-%{mysql_version} -RBR=$RPM_BUILD_ROOT -MBD=$RPM_BUILD_DIR/mysql-max-%{mysql_version} -# Ensure that needed directories exists -install -d $RBR/etc/{logrotate.d,rc.d/init.d} -install -d $RBR/var/lib/mysql/mysql -install -d $RBR/usr/share/sql-bench -install -d $RBR/usr/share/mysql-test -install -d $RBR/usr/{sbin,share,man,include} -install -d $RBR/usr/doc/MySQL-%{mysql_version} -install -d $RBR/usr/lib -# Make install -make install DESTDIR=$RBR benchdir_root=/usr/share/ - -# Install logrotate and autostart -install -m644 $MBD/support-files/mysql-log-rotate $RBR/etc/logrotate.d/mysql -install -m755 $MBD/support-files/mysql.server $RBR/etc/rc.d/init.d/mysql - -# Install docs -install -m644 $RPM_BUILD_DIR/mysql-max-%{mysql_version}/Docs/mysql.info \ - $RBR/usr/info/mysql.info -for file in README COPYING COPYING.LIB Docs/manual_toc.html Docs/manual.html \ - Docs/manual.txt Docs/manual.texi Docs/manual.ps \ - support-files/my-huge.cnf support-files/my-large.cnf \ - support-files/my-medium.cnf support-files/my-small.cnf -do - b=`basename $file` - install -m644 $MBD/$file $RBR/usr/doc/MySQL-%{mysql_version}/$b -done - -%pre -if test -x /etc/rc.d/init.d/mysql -then - /etc/rc.d/init.d/mysql stop > /dev/null 2>&1 - echo "Giving mysqld a couple of seconds to exit nicely" - sleep 5 -fi - -%post -mysql_datadir=/var/lib/mysql - -# Create data directory if needed -if test ! -d $mysql_datadir; then mkdir $mysql_datadir; fi -if test ! -d $mysql_datadir/mysql; then mkdir $mysql_datadir/mysql; fi -if test ! -d $mysql_datadir/test; then mkdir $mysql_datadir/test; fi - -# Make MySQL start/shutdown automatically when the machine does it. -/sbin/chkconfig --add mysql - -# Create a MySQL user. Do not report any problems if it already -# exists. This is redhat specific and should be handled more portable -useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" mysql 2> /dev/null || true - -# Change permissions so that the user that will run the MySQL daemon -# owns all database files. -chown -R mysql $mysql_datadir - -# Initiate databases -mysql_install_db -IN-RPM - -# Change permissions again to fix any new files. -chown -R mysql $mysql_datadir - -# Fix permissions for the permission database so that only the user -# can read them. -chmod -R og-rw $mysql_datadir/mysql - -# Restart in the same way that mysqld will be started normally. -/etc/rc.d/init.d/mysql start - -# Allow mysqld_safe to start mysqld and print a message before we exit -sleep 2 - -%preun -if test -x /etc/rc.d/init.d/mysql -then - /etc/rc.d/init.d/mysql stop > /dev/null -fi -# Remove autostart of mysql -if test $1 = 0 -then - /sbin/chkconfig --del mysql -fi -# We do not remove the mysql user since it may still own a lot of -# database files. - -%files -%attr(-, root, root) %doc /usr/doc/MySQL-%{mysql_version}/ - -%attr(755, root, root) /usr/bin/isamchk -%attr(755, root, root) /usr/bin/isamlog -%attr(755, root, root) /usr/bin/pack_isam -%attr(755, root, root) /usr/bin/myisamchk -%attr(755, root, root) /usr/bin/myisamlog -%attr(755, root, root) /usr/bin/myisampack -%attr(755, root, root) /usr/bin/mysql_fix_privilege_tables -%attr(755, root, root) /usr/bin/mysql_convert_table_format -%attr(755, root, root) /usr/bin/mysql_install_db -%attr(755, root, root) /usr/bin/mysql_setpermission -%attr(755, root, root) /usr/bin/mysql_zap -%attr(755, root, root) /usr/bin/mysqlbug -%attr(755, root, root) /usr/bin/mysqltest -%attr(755, root, root) /usr/bin/mysqlhotcopy -%attr(755, root, root) /usr/bin/perror -%attr(755, root, root) /usr/bin/replace -%attr(755, root, root) /usr/bin/resolveip -%attr(755, root, root) /usr/bin/mysqld_safe -%attr(755, root, root) /usr/bin/mysqld_multi -%attr(755, root, root) /usr/bin/my_print_defaults - -%attr(644, root, root) /usr/info/mysql.info* - -%attr(755, root, root) /usr/sbin/mysqld - -%attr(644, root, root) /etc/logrotate.d/mysql -%attr(755, root, root) /etc/rc.d/init.d/mysql - -%attr(755, root, root) /usr/share/mysql/ - -%changelog - -* Fri Apr 13 2001 Monty - First version of mysql-max.spec.sh based on mysql.spec.sh From 6d397aae1a3f82868f21a82fb41b767ca58156d7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Jun 2005 14:20:16 +0200 Subject: [PATCH 26/56] Bug#10602 - LOAD INDEX INTO CACHE deadlocks Fixed two deadlocks. Made minor changes. mysys/mf_keycache.c: Bug#10602 - LOAD INDEX INTO CACHE deadlocks Fixed two deadlocks. Made keycache traces line buffered. Removed unused macro and function. Added comments and trace messages. Fixed two compiler warnings. Fixed some coding style issues. --- mysys/mf_keycache.c | 121 +++++++++++++++++++++++++++++++++----------- 1 file changed, 91 insertions(+), 30 deletions(-) diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index cee1b7eb4e9..f14af44dbb9 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -184,10 +184,18 @@ static void test_key_cache(KEY_CACHE *keycache, static FILE *keycache_debug_log=NULL; static void keycache_debug_print _VARARGS((const char *fmt,...)); #define KEYCACHE_DEBUG_OPEN \ - if (!keycache_debug_log) keycache_debug_log=fopen(KEYCACHE_DEBUG_LOG, "w") + if (!keycache_debug_log) \ + { \ + keycache_debug_log= fopen(KEYCACHE_DEBUG_LOG, "w"); \ + (void) setvbuf(keycache_debug_log, NULL, _IOLBF, BUFSIZ); \ + } #define KEYCACHE_DEBUG_CLOSE \ - if (keycache_debug_log) { fclose(keycache_debug_log); keycache_debug_log=0; } + if (keycache_debug_log) \ + { \ + fclose(keycache_debug_log); \ + keycache_debug_log= 0; \ + } #else #define KEYCACHE_DEBUG_OPEN #define KEYCACHE_DEBUG_CLOSE @@ -213,7 +221,7 @@ static long keycache_thread_id; #define KEYCACHE_THREAD_TRACE_BEGIN(l) \ { struct st_my_thread_var *thread_var= my_thread_var; \ - keycache_thread_id= my_thread_var->id; \ + keycache_thread_id= thread_var->id; \ KEYCACHE_DBUG_PRINT(l,("[thread %ld",keycache_thread_id)) } #define KEYCACHE_THREAD_TRACE_END(l) \ @@ -240,12 +248,10 @@ static int keycache_pthread_cond_wait(pthread_cond_t *cond, static int keycache_pthread_mutex_lock(pthread_mutex_t *mutex); static void keycache_pthread_mutex_unlock(pthread_mutex_t *mutex); static int keycache_pthread_cond_signal(pthread_cond_t *cond); -static int keycache_pthread_cond_broadcast(pthread_cond_t *cond); #else #define keycache_pthread_mutex_lock pthread_mutex_lock #define keycache_pthread_mutex_unlock pthread_mutex_unlock #define keycache_pthread_cond_signal pthread_cond_signal -#define keycache_pthread_cond_broadcast pthread_cond_broadcast #endif /* defined(KEYCACHE_DEBUG) */ static uint next_power(uint value) @@ -508,6 +514,8 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, keycache->can_be_used= 0; while (keycache->cnt_for_resize_op) { + KEYCACHE_DBUG_PRINT("resize_key_cache: wait", + ("suspend thread %ld", thread->id)); keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); } @@ -520,7 +528,11 @@ finish: unlink_from_queue(wqueue, thread); /* Signal for the next resize request to proceeed if any */ if (wqueue->last_thread) + { + KEYCACHE_DBUG_PRINT("resize_key_cache: signal", + ("thread %ld", wqueue->last_thread->next->id)); keycache_pthread_cond_signal(&wqueue->last_thread->next->suspend); + } keycache_pthread_mutex_unlock(&keycache->cache_lock); return blocks; } @@ -544,7 +556,11 @@ static inline void dec_counter_for_resize_op(KEY_CACHE *keycache) struct st_my_thread_var *last_thread; if (!--keycache->cnt_for_resize_op && (last_thread= keycache->resize_queue.last_thread)) + { + KEYCACHE_DBUG_PRINT("dec_counter_for_resize_op: signal", + ("thread %ld", last_thread->next->id)); keycache_pthread_cond_signal(&last_thread->next->suspend); + } } /* @@ -761,8 +777,8 @@ static void release_queue(KEYCACHE_WQUEUE *wqueue) do { thread=next; - keycache_pthread_cond_signal(&thread->suspend); KEYCACHE_DBUG_PRINT("release_queue: signal", ("thread %ld", thread->id)); + keycache_pthread_cond_signal(&thread->suspend); next=thread->next; thread->next= NULL; } @@ -876,7 +892,8 @@ static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot, BLOCK_LINK **pins; KEYCACHE_DBUG_ASSERT(! (block->hash_link && block->hash_link->requests)); - if (!hot && keycache->waiting_for_block.last_thread) { + if (!hot && keycache->waiting_for_block.last_thread) + { /* Signal that in the LRU warm sub-chain an available block has appeared */ struct st_my_thread_var *last_thread= keycache->waiting_for_block.last_thread; @@ -894,6 +911,7 @@ static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot, */ if ((HASH_LINK *) thread->opt_info == hash_link) { + KEYCACHE_DBUG_PRINT("link_block: signal", ("thread %ld", thread->id)); keycache_pthread_cond_signal(&thread->suspend); unlink_from_queue(&keycache->waiting_for_block, thread); block->requests++; @@ -1000,11 +1018,10 @@ static void reg_requests(KEY_CACHE *keycache, BLOCK_LINK *block, int count) linking it to the LRU chain if it's the last request SYNOPSIS - - unreg_block() - keycache pointer to a key cache data structure - block pointer to the block to link to the LRU chain - at_end <-> to link the block at the end of the LRU chain + unreg_request() + keycache pointer to a key cache data structure + block pointer to the block to link to the LRU chain + at_end <-> to link the block at the end of the LRU chain RETURN VALUE none @@ -1086,6 +1103,9 @@ static inline void wait_for_readers(KEY_CACHE *keycache, BLOCK_LINK *block) struct st_my_thread_var *thread= my_thread_var; while (block->hash_link->requests) { + KEYCACHE_DBUG_PRINT("wait_for_readers: wait", + ("suspend thread %ld block %u", + thread->id, BLOCK_NUMBER(block))); block->condvar= &thread->suspend; keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); block->condvar= NULL; @@ -1143,6 +1163,7 @@ static void unlink_hash(KEY_CACHE *keycache, HASH_LINK *hash_link) */ if (page->file == hash_link->file && page->filepos == hash_link->diskpos) { + KEYCACHE_DBUG_PRINT("unlink_hash: signal", ("thread %ld", thread->id)); keycache_pthread_cond_signal(&thread->suspend); unlink_from_queue(&keycache->waiting_for_hash_link, thread); } @@ -1225,6 +1246,8 @@ restart: page.filepos= filepos; thread->opt_info= (void *) &page; link_into_queue(&keycache->waiting_for_hash_link, thread); + KEYCACHE_DBUG_PRINT("get_hash_link: wait", + ("suspend thread %ld", thread->id)); keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); thread->opt_info= NULL; @@ -1343,6 +1366,8 @@ restart: add_to_queue(&block->wqueue[COND_FOR_SAVED], thread); do { + KEYCACHE_DBUG_PRINT("find_key_block: wait", + ("suspend thread %ld", thread->id)); keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); } @@ -1360,7 +1385,9 @@ restart: /* This is a request for a page to be removed from cache */ KEYCACHE_DBUG_PRINT("find_key_block", - ("request for old page in block %u",BLOCK_NUMBER(block))); + ("request for old page in block %u " + "wrmode: %d block->status: %d", + BLOCK_NUMBER(block), wrmode, block->status)); /* Only reading requests can proceed until the old dirty page is flushed, all others are to be suspended, then resubmitted @@ -1379,6 +1406,8 @@ restart: /* Wait until the request can be resubmitted */ do { + KEYCACHE_DBUG_PRINT("find_key_block: wait", + ("suspend thread %ld", thread->id)); keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); } @@ -1448,6 +1477,8 @@ restart: link_into_queue(&keycache->waiting_for_block, thread); do { + KEYCACHE_DBUG_PRINT("find_key_block: wait", + ("suspend thread %ld", thread->id)); keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); } @@ -1528,9 +1559,13 @@ restart: else { /* This is for secondary requests for a new page only */ - page_status= block->hash_link == hash_link && - (block->status & BLOCK_READ) ? - PAGE_READ : PAGE_WAIT_TO_BE_READ; + KEYCACHE_DBUG_PRINT("find_key_block", + ("block->hash_link: %p hash_link: %p " + "block->status: %u", block->hash_link, + hash_link, block->status )); + page_status= (((block->hash_link == hash_link) && + (block->status & BLOCK_READ)) ? + PAGE_READ : PAGE_WAIT_TO_BE_READ); } } keycache->global_cache_read++; @@ -1538,17 +1573,22 @@ restart: else { reg_requests(keycache, block, 1); - page_status = block->hash_link == hash_link && - (block->status & BLOCK_READ) ? - PAGE_READ : PAGE_WAIT_TO_BE_READ; + KEYCACHE_DBUG_PRINT("find_key_block", + ("block->hash_link: %p hash_link: %p " + "block->status: %u", block->hash_link, + hash_link, block->status )); + page_status= (((block->hash_link == hash_link) && + (block->status & BLOCK_READ)) ? + PAGE_READ : PAGE_WAIT_TO_BE_READ); } } KEYCACHE_DBUG_ASSERT(page_status != -1); *page_st=page_status; KEYCACHE_DBUG_PRINT("find_key_block", - ("fd: %u pos %lu page_status %lu", - (uint) file,(ulong) filepos,(uint) page_status)); + ("fd: %u pos %lu block->status %u page_status %lu", + (uint) file, (ulong) filepos, block->status, + (uint) page_status)); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache2", @@ -1604,6 +1644,10 @@ static void read_block(KEY_CACHE *keycache, /* Page is not in buffer yet, is to be read from disk */ keycache_pthread_mutex_unlock(&keycache->cache_lock); + /* + Here other threads may step in and register as secondary readers. + They will register in block->wqueue[COND_FOR_REQUESTED]. + */ got_length= my_pread(block->hash_link->file, block->buffer, read_length, block->hash_link->diskpos, MYF(0)); keycache_pthread_mutex_lock(&keycache->cache_lock); @@ -1634,6 +1678,8 @@ static void read_block(KEY_CACHE *keycache, add_to_queue(&block->wqueue[COND_FOR_REQUESTED], thread); do { + KEYCACHE_DBUG_PRINT("read_block: wait", + ("suspend thread %ld", thread->id)); keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); } @@ -1855,6 +1901,10 @@ int key_cache_insert(KEY_CACHE *keycache, /* The requested page is to be read into the block buffer */ #if !defined(SERIALIZED_READ_FROM_CACHE) keycache_pthread_mutex_unlock(&keycache->cache_lock); + /* + Here other threads may step in and register as secondary readers. + They will register in block->wqueue[COND_FOR_REQUESTED]. + */ #endif /* Copy data from buff */ @@ -1865,9 +1915,15 @@ int key_cache_insert(KEY_CACHE *keycache, #if !defined(SERIALIZED_READ_FROM_CACHE) keycache_pthread_mutex_lock(&keycache->cache_lock); + /* Here we are alone again. */ #endif block->status= BLOCK_READ; block->length= read_length+offset; + KEYCACHE_DBUG_PRINT("key_cache_insert", + ("primary request: new page in cache")); + /* Signal that all pending requests for this now can be processed. */ + if (block->wqueue[COND_FOR_REQUESTED].last_thread) + release_queue(&block->wqueue[COND_FOR_REQUESTED]); } remove_reader(block); @@ -2074,9 +2130,16 @@ static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block) { KEYCACHE_THREAD_TRACE("free block"); KEYCACHE_DBUG_PRINT("free_block", - ("block %u to be freed",BLOCK_NUMBER(block))); + ("block %u to be freed, hash_link %p", + BLOCK_NUMBER(block), block->hash_link)); if (block->hash_link) { + /* + While waiting for readers to finish, new readers might request the + block. But since we set block->status|= BLOCK_REASSIGNED, they + will wait on block->wqueue[COND_FOR_SAVED]. They must be signalled + later. + */ block->status|= BLOCK_REASSIGNED; wait_for_readers(keycache, block); unlink_hash(keycache, block->hash_link); @@ -2102,6 +2165,10 @@ static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block) keycache->free_block_list= block; /* Keep track of the number of currently unused blocks. */ keycache->blocks_unused++; + + /* All pending requests for this page must be resubmitted. */ + if (block->wqueue[COND_FOR_SAVED].last_thread) + release_queue(&block->wqueue[COND_FOR_SAVED]); } @@ -2334,6 +2401,8 @@ restart: add_to_queue(&block->wqueue[COND_FOR_SAVED], thread); do { + KEYCACHE_DBUG_PRINT("flush_key_blocks_int: wait", + ("suspend thread %ld", thread->id)); keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); } @@ -2685,14 +2754,6 @@ static int keycache_pthread_cond_signal(pthread_cond_t *cond) } -static int keycache_pthread_cond_broadcast(pthread_cond_t *cond) -{ - int rc; - KEYCACHE_THREAD_TRACE("signal"); - rc= pthread_cond_broadcast(cond); - return rc; -} - #if defined(KEYCACHE_DEBUG_LOG) From f20c56a9e7cc12a65068392ee733fff2ff4b805a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Jun 2005 09:48:25 -0700 Subject: [PATCH 27/56] Fix handling of NULL fields in FIELD(). (Bug #10944) mysql-test/r/func_str.result: Update results mysql-test/t/func_str.test: Add regression tests sql/item_func.cc: Handle NULL as first argument to FIELD() --- mysql-test/r/func_str.result | 6 ++++++ mysql-test/t/func_str.test | 6 ++++++ sql/item_func.cc | 12 ++++++++---- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 5405dbf53d9..ea1efbc7c0a 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -783,3 +783,9 @@ id aes_decrypt(str, 'bar') 1 foo 2 NULL DROP TABLE t1, t2; +select field(0,NULL,1,0), field("",NULL,"bar",""), field(0.0,NULL,1.0,0.0); +field(0,NULL,1,0) field("",NULL,"bar","") field(0.0,NULL,1.0,0.0) +3 3 3 +select field(NULL,1,2,NULL), field(NULL,1,2,0); +field(NULL,1,2,NULL) field(NULL,1,2,0) +0 0 diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 22028437111..a5536f7a0be 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -521,3 +521,9 @@ SELECT t1.id, aes_decrypt(str, 'bar') FROM t1, t2 WHERE t1.id = t2.id DROP TABLE t1, t2; + +# +# Bug #10944: Mishandling of NULL arguments in FIELD() +# +select field(0,NULL,1,0), field("",NULL,"bar",""), field(0.0,NULL,1.0,0.0); +select field(NULL,1,2,NULL), field(NULL,1,2,0); diff --git a/sql/item_func.cc b/sql/item_func.cc index 3c50e750b41..1300dc6faac 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1488,6 +1488,10 @@ void Item_func_locate::print(String *str) longlong Item_func_field::val_int() { DBUG_ASSERT(fixed == 1); + + if (args[0]->null_value) + return 0; + if (cmp_type == STRING_RESULT) { String *field; @@ -1505,8 +1509,8 @@ longlong Item_func_field::val_int() longlong val= args[0]->val_int(); for (uint i=1; i < arg_count ; i++) { - if (val == args[i]->val_int()) - return (longlong) (i); + if (!args[i]->null_value && val == args[i]->val_int()) + return (longlong) (i); } } else @@ -1514,8 +1518,8 @@ longlong Item_func_field::val_int() double val= args[0]->val(); for (uint i=1; i < arg_count ; i++) { - if (val == args[i]->val()) - return (longlong) (i); + if (!args[i]->null_value && val == args[i]->val()) + return (longlong) (i); } } return 0; From b4953598aa436f926a06cdcb505eb7a4c38bf846 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Jun 2005 14:35:02 -0700 Subject: [PATCH 28/56] Update results of test after merge of bugfix mysql-test/r/rpl_failed_optimize.result: Update results --- mysql-test/r/rpl_failed_optimize.result | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/r/rpl_failed_optimize.result b/mysql-test/r/rpl_failed_optimize.result index 1576ec60500..120bb53ed25 100644 --- a/mysql-test/r/rpl_failed_optimize.result +++ b/mysql-test/r/rpl_failed_optimize.result @@ -9,6 +9,7 @@ BEGIN; INSERT INTO t1 VALUES (1); OPTIMIZE TABLE t1; Table Op Msg_type Msg_text +test.t1 optimize error Lock wait timeout exceeded; try restarting transaction test.t1 optimize status Operation failed OPTIMIZE TABLE non_existing; Table Op Msg_type Msg_text From 4e19af2716b645cec8ca04ea15ddf698ec36927c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Jun 2005 16:03:41 -0700 Subject: [PATCH 29/56] Fix compile error when HAVE_BERKELEY_DB sql/sql_table.cc: Add missing argument --- sql/sql_table.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index f277bc50462..7e80a71beb0 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3451,7 +3451,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, shutdown. */ char path[FN_REFLEN]; - build_table_path(path, sizeof(path), new_db, table_name); + build_table_path(path, sizeof(path), new_db, table_name, ""); table=open_temporary_table(thd, path, new_db, tmp_name,0); if (table) { From 638bb0a2917b966f136f0046234fc40b9407df29 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Jun 2005 16:16:25 -0700 Subject: [PATCH 30/56] Fix --with-bdb to be --with-berkeley-db in BUILD/SETUP.sh BUILD/SETUP.sh: Fix --with-bdb to --with-berkeley-db --- BUILD/SETUP.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 8bb281f20e9..3f8a9ccaf22 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -48,8 +48,8 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch c_warnings="$global_warnings -Wunused" cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" -base_max_configs="--with-innodb --with-bdb --with-ndbcluster --with-archive-storage-engine --with-raid --with-openssl --with-raid --with-vio" -max_leave_isam_configs="--with-innodb --with-bdb --with-ndbcluster --with-archive-storage-engine --with-raid --with-openssl --with-raid --with-vio --with-embedded-server" +base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-raid --with-openssl --with-raid --with-vio" +max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-raid --with-openssl --with-raid --with-vio --with-embedded-server" max_no_es_configs="$max_leave_isam_configs --without-isam" max_configs="$max_no_es_configs --with-embedded-server" From 0218ecf7af9bb7dee577ec01f42f602205ec3483 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Jun 2005 17:34:10 -0700 Subject: [PATCH 31/56] Mainly cleanups for gcc 4.0. Some small pieces from looking at -Wall. Removed a number of dumb things in ha_tina. client/mysqladmin.cc: gcc 4.0 fix sql/examples/ha_archive.cc: Bunch of little cleanups from -Wall and gcc 4.0 fixes sql/examples/ha_example.cc: Noticed that the error call was not quite right. sql/examples/ha_tina.cc: Bunch of cleanups (many of which were quite dumb of me... and I have no earthly idea how they missed everyone's notice). sql/ha_heap.cc: Removed unused variable (-Wall find) sql/item_subselect.cc: Removed unused label. sql/mysqld.cc: Cleanup of unused function and gcc 4.0 bit. sql/opt_range.h: Cleanup for gcc 4.0 sql/repl_failsafe.cc: Cleanup for gcc 4.0 sql/slave.cc: Cleanup for gcc 4.0 sql/sql_acl.cc: Cleanup for gcc 4.0 sql/sql_insert.cc: Cleanedup for gcc 4.0 sql/sql_parse.cc: Cleanedup for gcc 4.0 sql/sql_repl.cc: Removed unused variable sql/sql_select.cc: Cleanedup for gcc 4.0 --- client/mysqladmin.cc | 2 +- sql/examples/ha_archive.cc | 7 +++---- sql/examples/ha_example.cc | 4 +--- sql/examples/ha_tina.cc | 37 ++++++++++++------------------------- sql/ha_heap.cc | 1 - sql/item_subselect.cc | 3 --- sql/mysqld.cc | 8 +------- sql/opt_range.h | 2 +- sql/repl_failsafe.cc | 2 +- sql/slave.cc | 2 +- sql/sql_acl.cc | 10 +++++----- sql/sql_insert.cc | 2 +- sql/sql_parse.cc | 2 -- sql/sql_repl.cc | 1 - sql/sql_select.cc | 4 ++-- 15 files changed, 29 insertions(+), 58 deletions(-) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 0da7d5b3acf..5a4690ea30e 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -271,7 +271,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), option_wait=1; } else - option_wait= ~0; + option_wait= ~(uint)0; break; case '?': case 'I': /* Info */ diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index bc4af0c7dc7..918d85d705d 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -575,7 +575,7 @@ int ha_archive::write_row(byte * buf) written= gzwrite(share->archive_write, buf, table->reclength); DBUG_PRINT("ha_archive::get_row", ("Wrote %d bytes expected %d", written, table->reclength)); share->dirty= TRUE; - if (written != table->reclength) + if (written != (z_off_t)table->reclength) goto error; /* We should probably mark the table as damagaged if the record is written @@ -590,7 +590,7 @@ int ha_archive::write_row(byte * buf) { (*field)->get_ptr(&ptr); written= gzwrite(share->archive_write, ptr, (unsigned)size); - if (written != size) + if (written != (z_off_t)size) goto error; } } @@ -613,7 +613,6 @@ error: int ha_archive::rnd_init(bool scan) { DBUG_ENTER("ha_archive::rnd_init"); - int read; // gzread() returns int, and we use this to check the header /* We rewind the file so that we can read from the beginning if scan */ if (scan) @@ -747,7 +746,7 @@ int ha_archive::rnd_pos(byte * buf, byte *pos) DBUG_ENTER("ha_archive::rnd_pos"); statistic_increment(ha_read_rnd_count,&LOCK_status); current_position= ha_get_ptr(pos, ref_length); - z_off_t seek= gzseek(archive, current_position, SEEK_SET); + (void)gzseek(archive, current_position, SEEK_SET); DBUG_RETURN(get_row(archive, buf)); } diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index cb0780ea74d..35034fc7b28 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -150,10 +150,8 @@ static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table) return share; -error2: - thr_lock_delete(&share->lock); - pthread_mutex_destroy(&share->mutex); error: + pthread_mutex_destroy(&share->mutex); pthread_mutex_unlock(&example_mutex); my_free((gptr) share, MYF(0)); diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index 0345a170c3c..637ecde8f81 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -20,10 +20,10 @@ First off, this is a play thing for me, there are a number of things wrong with it: *) It was designed for csv and therefor its performance is highly questionable. *) Indexes have not been implemented. This is because the files can be traded in - and out of the table directory without having to worry about rebuilding anything. + and out of the table directory without having to worry about rebuilding anything. *) NULLs and "" are treated equally (like a spreadsheet). *) There was in the beginning no point to anyone seeing this other then me, so there - is a good chance that I haven't quite documented it well. + is a good chance that I haven't quite documented it well. *) Less design, more "make it work" Now there are a few cool things with it: @@ -89,12 +89,12 @@ int get_mmap(TINA_SHARE *share, int write) { if (write) share->mapped_file= (byte *)mmap(NULL, share->file_stat.st_size, - PROT_READ|PROT_WRITE, MAP_SHARED, - share->data_file, 0); + PROT_READ|PROT_WRITE, MAP_SHARED, + share->data_file, 0); else share->mapped_file= (byte *)mmap(NULL, share->file_stat.st_size, - PROT_READ, MAP_PRIVATE, - share->data_file, 0); + PROT_READ, MAP_PRIVATE, + share->data_file, 0); if ((share->mapped_file ==(caddr_t)-1)) { /* @@ -144,9 +144,9 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table) { char data_file_name[FN_REFLEN]; if (!my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), - &share, sizeof(*share), - &tmp_name, length+1, - NullS)) + &share, sizeof(*share), + &tmp_name, length+1, + NullS)) { pthread_mutex_unlock(&tina_mutex); return NULL; @@ -341,7 +341,6 @@ int ha_tina::find_current_row(byte *buf) for (Field **field=table->field ; *field ; field++) { - int x; buffer.length(0); mapped_ptr++; // Increment past the first quote for(;mapped_ptr != end_ptr; mapped_ptr++) @@ -735,29 +734,17 @@ int ha_tina::rnd_end() beginning so that we move the smallest amount of data possible. */ qsort(chain, (size_t)(chain_ptr - chain), sizeof(tina_set), (qsort_cmp)sort_set); - for (ptr= chain; ptr < chain_ptr; ptr++) - printf("Chain %d, %d\n", (int)ptr->begin, (int)ptr->end); for (ptr= chain; ptr < chain_ptr; ptr++) { - //memmove(share->mapped_file + ptr->begin, share->mapped_file - //+ ptr->end, length - (size_t)ptr->end); /* We peek a head to see if this is the last chain */ - printf("Delete %d, %d, %d\n", (int)ptr->begin, (int)ptr->end, (int)length); if (ptr+1 == chain_ptr) - { - printf("Shiftina(end) %d(%d) to %d\n", (int)ptr->end, (int)(length - (size_t)ptr->end), (int)ptr->begin); memmove(share->mapped_file + ptr->begin, share->mapped_file + ptr->end, length - (size_t)ptr->end); - } else - { - printf("Shifting %d(%d) to %d\n", (int)ptr->end, (int)((ptr++)->begin - (size_t)ptr->end), (int)ptr->begin); - memmove(share->mapped_file + ptr->begin, share->mapped_file + ptr->end, - (size_t)(ptr++)->begin - (size_t)ptr->end); - } + memmove((caddr_t)share->mapped_file + ptr->begin, (caddr_t)share->mapped_file + ptr->end, + (size_t)((ptr++)->begin - ptr->end)); length= length - (size_t)(ptr->end - ptr->begin); } - printf("Buffer %s\n",share->mapped_file); /* Truncate the file to the new size */ if (my_chsize(share->data_file, length, 0, MYF(MY_WME))) @@ -840,7 +827,7 @@ int ha_tina::create(const char *name, TABLE *table_arg, HA_CREATE_INFO *create_i DBUG_ENTER("ha_tina::create"); if ((create_file= my_create(fn_format(name_buff,name,"",".CSV",MY_REPLACE_EXT|MY_UNPACK_FILENAME),0, - O_RDWR | O_TRUNC,MYF(MY_WME))) < 0) + O_RDWR | O_TRUNC,MYF(MY_WME))) < 0) DBUG_RETURN(-1); my_close(create_file,MYF(0)); diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 033fe86720e..d8e4b3d5a9f 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -484,7 +484,6 @@ int ha_heap::create(const char *name, TABLE *table_arg, for (; key_part != key_part_end; key_part++, seg++) { - uint flag= key_part->key_type; Field *field= key_part->field; if (pos->algorithm == HA_KEY_ALG_BTREE) seg->type= field->key_type(); diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 301740c50ef..23477481472 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -379,9 +379,6 @@ Item_singlerow_subselect::select_transformer(JOIN *join) return RES_REDUCE; } return RES_OK; - -err: - return RES_ERROR; } void Item_singlerow_subselect::store(uint i, Item *item) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 8ade81401aa..5e3142ccf0e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3355,7 +3355,7 @@ static int bootstrap(FILE *file) thd->client_capabilities=0; my_net_init(&thd->net,(st_vio*) 0); thd->max_client_packet_length= thd->net.max_packet; - thd->master_access= ~0; + thd->master_access= ~(ulong)0; thd->thread_id=thread_id++; thread_count++; @@ -5574,12 +5574,6 @@ static void print_version(void) server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT); } -static void use_help(void) -{ - print_version(); - printf("Use '--help' or '--no-defaults --help' for a list of available options\n"); -} - static void usage(void) { if (!(default_charset_info= get_charset_by_csname(default_character_set_name, diff --git a/sql/opt_range.h b/sql/opt_range.h index edecdcc6282..b55bb4708bf 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -143,7 +143,7 @@ class SQL_SELECT :public Sql_alloc { ~SQL_SELECT(); void cleanup(); bool check_quick(THD *thd, bool force_quick_range, ha_rows limit) - { return test_quick_select(thd, key_map(~0), 0, limit, force_quick_range) < 0; } + { return test_quick_select(thd, key_map(~(uint)0), 0, limit, force_quick_range) < 0; } inline bool skip_record() { return cond ? cond->val_int() == 0 : 0; } int test_quick_select(THD *thd, key_map keys, table_map prev_tables, ha_rows limit, bool force_quick_range=0); diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 85a51ba9b51..2d8e8a5bf81 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -71,7 +71,7 @@ static int init_failsafe_rpl_thread(THD* thd) my_net_init(&thd->net, 0); thd->net.read_timeout = slave_net_timeout; thd->max_client_packet_length=thd->net.max_packet; - thd->master_access= ~0; + thd->master_access= ~(ulong)0; thd->priv_user = 0; pthread_mutex_lock(&LOCK_thread_count); thd->thread_id = thread_id++; diff --git a/sql/slave.cc b/sql/slave.cc index 605f8289946..5a2d3af3845 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2577,7 +2577,7 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) thd->client_capabilities = 0; my_net_init(&thd->net, 0); thd->net.read_timeout = slave_net_timeout; - thd->master_access= ~0; + thd->master_access= ~(ulong)0; thd->priv_user = 0; thd->slave_thread = 1; /* diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 02da05d195f..84259b146ad 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1002,7 +1002,7 @@ static void acl_insert_db(const char *user, const char *host, const char *db, ulong acl_get(const char *host, const char *ip, const char *user, const char *db, my_bool db_is_pattern) { - ulong host_access= ~0,db_access= 0; + ulong host_access= ~(ulong)0,db_access= 0; uint i,key_length; char key[ACL_KEY_LENGTH],*tmp_db,*end; acl_entry *entry; @@ -3673,7 +3673,7 @@ int mysql_revoke_all(THD *thd, List &list) } if (replace_user_table(thd, tables[0].table, - *lex_user, ~0, 1, 0)) + *lex_user, ~(ulong)0, 1, 0)) { result= -1; continue; @@ -3700,7 +3700,7 @@ int mysql_revoke_all(THD *thd, List &list) if (!strcmp(lex_user->user.str,user) && !my_strcasecmp(system_charset_info, lex_user->host.str, host)) { - if (!replace_db_table(tables[1].table, acl_db->db, *lex_user, ~0, 1)) + if (!replace_db_table(tables[1].table, acl_db->db, *lex_user, ~(ulong)0, 1)) { /* Don't increment counter as replace_db_table deleted the @@ -3734,7 +3734,7 @@ int mysql_revoke_all(THD *thd, List &list) if (replace_table_table(thd,grant_table,tables[2].table,*lex_user, grant_table->db, grant_table->tname, - ~0, 0, 1)) + ~(ulong)0, 0, 1)) { result= -1; } @@ -3750,7 +3750,7 @@ int mysql_revoke_all(THD *thd, List &list) columns, grant_table->db, grant_table->tname, - ~0, 1)) + ~(ulong)0, 1)) { revoked= 1; continue; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 0258f2c3e07..1d7914c9c76 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1431,7 +1431,7 @@ bool delayed_insert::handle_inserts(void) if (thd.killed || table->version != refresh_version) { thd.killed=1; - max_rows= ~0; // Do as much as possible + max_rows= ~(uint)0; // Do as much as possible } /* diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 80c68dad247..0d67c25cee5 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -561,7 +561,6 @@ bool is_update_query(enum enum_sql_command command) static void time_out_user_resource_limits(THD *thd, USER_CONN *uc) { - bool error= 0; time_t check_time = thd->start_time ? thd->start_time : time(NULL); DBUG_ENTER("time_out_user_resource_limits"); @@ -587,7 +586,6 @@ static bool check_mqh(THD *thd, uint check_command) { #ifndef NO_EMBEDDED_ACCESS_CHECKS bool error= 0; - time_t check_time = thd->start_time ? thd->start_time : time(NULL); USER_CONN *uc=thd->user_connect; DBUG_ENTER("check_mqh"); DBUG_ASSERT(uc != 0); diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 24b78bc9a3d..310c2ea03cd 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1341,7 +1341,6 @@ int show_binlogs(THD* thd) IO_CACHE log; File file; const char *errmsg= 0; - MY_STAT stat_area; char fname[FN_REFLEN]; List field_list; uint length; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index fb7f10abb52..d53609ceaa5 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -34,7 +34,7 @@ const char *join_type_str[]={ "UNKNOWN","system","const","eq_ref","ref", }; const key_map key_map_empty(0); -const key_map key_map_full(~0); +const key_map key_map_full(~(uint)0); static void optimize_keyuse(JOIN *join, DYNAMIC_ARRAY *keyuse_array); static bool make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds, @@ -3450,7 +3450,7 @@ make_simple_join(JOIN *join,TABLE *tmp_table) join_tab->select_cond=0; join_tab->quick=0; join_tab->type= JT_ALL; /* Map through all records */ - join_tab->keys.init(~0); /* test everything in quick */ + join_tab->keys.init(~(uint)0); /* test everything in quick */ join_tab->info=0; join_tab->on_expr=0; join_tab->ref.key = -1; From cee10f979e3bf4a26dca94bd94002b316e400733 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Jun 2005 02:43:32 +0200 Subject: [PATCH 32/56] tztime.cc: Set #pragma implementation" earlier Many files: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION client/sql_string.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION mysys/raid.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/field.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/ha_berkeley.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/ha_blackhole.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/ha_heap.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/ha_innodb.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/ha_isam.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/ha_isammrg.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/ha_myisam.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/ha_myisammrg.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/ha_ndbcluster.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/handler.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/hash_filo.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/item.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/item_cmpfunc.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/item_func.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/item_geofunc.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/item_strfunc.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/item_subselect.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/item_sum.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/item_timefunc.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/item_uniq.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/log_event.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/opt_range.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/procedure.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/protocol.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/protocol_cursor.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/set_var.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/sql_analyse.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/sql_class.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/sql_crypt.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/sql_list.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/sql_map.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/sql_olap.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/examples/ha_archive.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/sql_select.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/sql_string.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/sql_udf.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/examples/ha_example.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/examples/ha_tina.cc: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION sql/tztime.cc: Set #pragma implementation" earlier --- client/sql_string.cc | 3 ++- mysys/raid.cc | 2 ++ sql/examples/ha_archive.cc | 4 +++- sql/examples/ha_example.cc | 4 +++- sql/examples/ha_tina.cc | 4 +++- sql/field.cc | 2 ++ sql/ha_berkeley.cc | 2 ++ sql/ha_blackhole.cc | 2 ++ sql/ha_heap.cc | 2 ++ sql/ha_innodb.cc | 2 ++ sql/ha_isam.cc | 2 ++ sql/ha_isammrg.cc | 2 ++ sql/ha_myisam.cc | 2 ++ sql/ha_myisammrg.cc | 2 ++ sql/ha_ndbcluster.cc | 2 ++ sql/handler.cc | 2 ++ sql/hash_filo.cc | 2 ++ sql/item.cc | 2 ++ sql/item_cmpfunc.cc | 2 ++ sql/item_func.cc | 2 ++ sql/item_geofunc.cc | 2 ++ sql/item_strfunc.cc | 2 ++ sql/item_subselect.cc | 2 ++ sql/item_sum.cc | 2 ++ sql/item_timefunc.cc | 2 ++ sql/item_uniq.cc | 3 +++ sql/log_event.cc | 3 +++ sql/opt_range.cc | 2 ++ sql/procedure.cc | 2 ++ sql/protocol.cc | 2 ++ sql/protocol_cursor.cc | 2 ++ sql/set_var.cc | 2 ++ sql/sql_analyse.cc | 2 ++ sql/sql_class.cc | 2 ++ sql/sql_crypt.cc | 2 ++ sql/sql_list.cc | 2 ++ sql/sql_map.cc | 2 ++ sql/sql_olap.cc | 2 ++ sql/sql_select.cc | 2 ++ sql/sql_string.cc | 3 ++- sql/sql_udf.cc | 2 ++ sql/tztime.cc | 12 +++++++----- 42 files changed, 94 insertions(+), 10 deletions(-) diff --git a/client/sql_string.cc b/client/sql_string.cc index 690997152f1..8f0e46c5eea 100644 --- a/client/sql_string.cc +++ b/client/sql_string.cc @@ -16,11 +16,12 @@ /* This file is originally from the mysql distribution. Coded by monty */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include #include #include #include diff --git a/mysys/raid.cc b/mysys/raid.cc index 62587c438ca..20e70d2d102 100644 --- a/mysys/raid.cc +++ b/mysys/raid.cc @@ -70,6 +70,8 @@ tonu@mysql.com & monty@mysql.com */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index bc4af0c7dc7..51268fd60b3 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -14,7 +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 */ -#ifdef __GNUC__ +#include + +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index cb0780ea74d..b122c4dc83f 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -63,7 +63,9 @@ -Brian */ -#ifdef __GNUC__ +#include + +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index 0345a170c3c..44040ad3b61 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -38,7 +38,9 @@ TODO: -Brian */ -#ifdef __GNUC__ +#include + +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/field.cc b/sql/field.cc index adb0368384e..60287d4003b 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -19,6 +19,8 @@ ** This file implements classes defined in field.h *****************************************************************************/ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 05cad23b176..d4adea4a7b4 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -47,6 +47,8 @@ */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index 59b3f7102b5..a5456d54c1b 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index d584c33f061..83f5203324f 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 3f2e11e8bd1..b3b82df5469 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -28,6 +28,8 @@ have disables the InnoDB inlining in this file. */ in Windows? */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index 31e9236460f..b755c63698f 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_isammrg.cc b/sql/ha_isammrg.cc index c0e6f665f08..7e14ccb43bf 100644 --- a/sql/ha_isammrg.cc +++ b/sql/ha_isammrg.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index d8608c6a599..b4ac8cc777f 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index edb3521470f..3374ee1271a 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index eaa0473df1b..516703112dd 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -20,6 +20,8 @@ NDB Cluster */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/handler.cc b/sql/handler.cc index f14564b6629..d47bb02a58c 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -17,6 +17,8 @@ /* Handler-calling-functions */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/hash_filo.cc b/sql/hash_filo.cc index ec200768222..34f3cd6b035 100644 --- a/sql/hash_filo.cc +++ b/sql/hash_filo.cc @@ -20,6 +20,8 @@ ** to usage. */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item.cc b/sql/item.cc index bff8c1cace6..d32a6581049 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 337ac949d35..f53dcb43e5c 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -17,6 +17,8 @@ /* This file defines all compare functions */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_func.cc b/sql/item_func.cc index 3c50e750b41..e9339877ab7 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -17,6 +17,8 @@ /* This file defines all numerical functions */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index c58a9e434c7..e907c5a0d45 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -17,6 +17,8 @@ /* This file defines all spatial functions */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 5ca5caf6bdf..725712f4e85 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -20,6 +20,8 @@ ** (This shouldn't be needed) */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 2e4c70ecd5f..553b309cfde 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -22,6 +22,8 @@ SUBSELECT TODO: (sql_select.h/sql_select.cc) */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 0e252259f53..9c35fb1d427 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -17,6 +17,8 @@ /* Sum functions (COUNT, MIN...) */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index a3cf69035f3..9f5cd61f95a 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -17,6 +17,8 @@ /* This file defines all time functions */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_uniq.cc b/sql/item_uniq.cc index 0c757c0e3a3..c83373bd8b0 100644 --- a/sql/item_uniq.cc +++ b/sql/item_uniq.cc @@ -15,6 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Compability file */ + +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation #endif diff --git a/sql/log_event.cc b/sql/log_event.cc index f2287857d37..9701ef2ff00 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -16,6 +16,9 @@ #ifndef MYSQL_CLIENT + +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/opt_range.cc b/sql/opt_range.cc index bd1befb436f..7b37f0ce4f7 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -23,6 +23,8 @@ */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/procedure.cc b/sql/procedure.cc index a0042dd879e..10689dd36f6 100644 --- a/sql/procedure.cc +++ b/sql/procedure.cc @@ -17,6 +17,8 @@ /* Procedures (functions with changes output of select) */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/protocol.cc b/sql/protocol.cc index 6a17ae2f95b..835bd986fb8 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -19,6 +19,8 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/protocol_cursor.cc b/sql/protocol_cursor.cc index b225e06ed32..53a03001544 100644 --- a/sql/protocol_cursor.cc +++ b/sql/protocol_cursor.cc @@ -19,6 +19,8 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/set_var.cc b/sql/set_var.cc index 3d3ba6d6ab7..b006dde2b4b 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -48,6 +48,8 @@ new attribute. */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index fb5d0eb0a3f..678bdbb4588 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -23,6 +23,8 @@ ** - type set is out of optimization yet */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 805db107370..ff45b164893 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -22,6 +22,8 @@ ** *****************************************************************************/ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc index f21a109e95d..eda7f0f6bbb 100644 --- a/sql/sql_crypt.cc +++ b/sql/sql_crypt.cc @@ -23,6 +23,8 @@ needs something like 'ssh'. */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_list.cc b/sql/sql_list.cc index d57a7dfe4e3..485c569f49c 100644 --- a/sql/sql_list.cc +++ b/sql/sql_list.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_map.cc b/sql/sql_map.cc index aac44949d89..9baacd1bc4b 100644 --- a/sql/sql_map.cc +++ b/sql/sql_map.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc index 024abb6c74b..a365cbb0614 100644 --- a/sql/sql_olap.cc +++ b/sql/sql_olap.cc @@ -28,6 +28,8 @@ #ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1 +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 0362f097cba..1d42fe49283 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -17,6 +17,8 @@ /* mysql_select and join optimization */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_string.cc b/sql/sql_string.cc index ab2db4aaf53..e5339782f02 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -16,11 +16,12 @@ /* This file is originally from the mysql distribution. Coded by monty */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include #include #include #include diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index f5b4775ee0b..deed806db2a 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -28,6 +28,8 @@ ** dynamic functions, so this shouldn't be a real problem. */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: implement sql_udf.h #endif diff --git a/sql/tztime.cc b/sql/tztime.cc index 8fac054c49c..30ff25f080f 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -20,18 +20,20 @@ (We will refer to this code as to elsie-code further.) */ -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation -#endif - /* We should not include mysql_priv.h in mysql_tzinfo_to_sql utility since it creates unsolved link dependencies on some platforms. */ + +#include + +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation // gcc: Class implementation +#endif + #if !defined(TZINFO2SQL) && !defined(TESTTIME) #include "mysql_priv.h" #else -#include #include #include "tztime.h" #include From 17678a7b885beb59fa808b7ace5cee4a0e21667d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Jun 2005 16:17:44 +0500 Subject: [PATCH 33/56] item_func.cc: set_var.cc: variables.result variables.test Bug #10904 Illegal mix of collations between a system variable and a constant Changing coercibility of system variables to SYSCONST, to be the same with USER(), DATABASE(), etc. sql/item_func.cc: Bug #10904 Illegal mix of collations between a system variable and a constant Changing coercibility of system variables to SYSCONST To be the same with USER(), DATABASE(), etc. --- mysql-test/r/variables.result | 6 ++++++ mysql-test/t/variables.test | 7 +++++++ sql/item_func.cc | 2 +- sql/set_var.cc | 3 ++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 6d4f9055e4e..602750d5033 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -210,6 +210,12 @@ query_prealloc_size 8192 range_alloc_block_size 2048 transaction_alloc_block_size 8192 transaction_prealloc_size 4096 +SELECT @@version LIKE 'non-existent'; +@@version LIKE 'non-existent' +0 +SELECT @@version_compile_os LIKE 'non-existent'; +@@version_compile_os LIKE 'non-existent' +0 set big_tables=OFFF; ERROR 42000: Variable 'big_tables' can't be set to the value of 'OFFF' set big_tables="OFFF"; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 50bcc1c038c..e45218a9ed7 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -115,6 +115,13 @@ set @@query_alloc_block_size=default, @@query_prealloc_size=default; set transaction_alloc_block_size=default, @@transaction_prealloc_size=default; show variables like '%alloc%'; +# +# Bug #10904 Illegal mix of collations between +# a system variable and a constant +# +SELECT @@version LIKE 'non-existent'; +SELECT @@version_compile_os LIKE 'non-existent'; + # The following should give errors --error 1231 diff --git a/sql/item_func.cc b/sql/item_func.cc index 598439c60c1..ad8479c7b0b 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3369,7 +3369,7 @@ Item *get_system_var(THD *thd, enum_var_type var_type, LEX_STRING name, !my_strcasecmp(system_charset_info, name.str, "VERSION")) return new Item_string("@@VERSION", server_version, (uint) strlen(server_version), - system_charset_info); + system_charset_info, DERIVATION_SYSCONST); Item *item; sys_var *var; diff --git a/sql/set_var.cc b/sql/set_var.cc index b006dde2b4b..5564ba096ac 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1606,7 +1606,8 @@ Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base) Item_string *tmp; pthread_mutex_lock(&LOCK_global_system_variables); char *str= (char*) value_ptr(thd, var_type, base); - tmp= new Item_string(str, strlen(str), system_charset_info); + tmp= new Item_string(str, strlen(str), + system_charset_info, DERIVATION_SYSCONST); pthread_mutex_unlock(&LOCK_global_system_variables); return tmp; } From dd3225b22bf8b478361ac795b9f067f4993fd384 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Jun 2005 11:12:58 -0500 Subject: [PATCH 34/56] fixed compile problem by replacing W_OK with F_OK BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + mysys/my_access.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index aad4399302e..ce1e179789e 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -206,6 +206,7 @@ rburnett@bk-internal.mysql.com rburnett@build.mysql.com reggie@bob.(none) reggie@mdk10.(none) +reggie@monster. root@home.(none) root@mc04.(none) root@x3.internalnet diff --git a/mysys/my_access.c b/mysys/my_access.c index 28210bdfc7d..89e90e16f18 100644 --- a/mysys/my_access.c +++ b/mysys/my_access.c @@ -44,7 +44,7 @@ int my_access(const char *path, int amode) result= GetFileAttributesEx(path, GetFileExInfoStandard, &fileinfo); if (! result || - (fileinfo.dwFileAttributes & FILE_ATTRIBUTE_READONLY) && (amode & W_OK)) + (fileinfo.dwFileAttributes & FILE_ATTRIBUTE_READONLY) && (amode & F_OK)) { my_errno= errno= EACCES; return -1; From 28a467c6faeac2e33637ce9bff9670987257a300 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Jun 2005 21:14:14 +0200 Subject: [PATCH 35/56] CommandInterpreter.cpp: Bug #11050 ndb_mgm "show" prints incorrectly after master data node fails ndb/src/mgmclient/CommandInterpreter.cpp: Bug #11050 ndb_mgm "show" prints incorrectly after master data node fails --- ndb/src/mgmclient/CommandInterpreter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index c3b0ee7fe97..34fe57d1fca 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -1176,7 +1176,8 @@ CommandInterpreter::executeShow(char* parameters) api_nodes++; break; case NDB_MGM_NODE_TYPE_NDB: - if (state->node_states[i].dynamic_id < master_id) + if (state->node_states[i].dynamic_id && + state->node_states[i].dynamic_id < master_id) master_id= state->node_states[i].dynamic_id; ndb_nodes++; break; From 1b99948246e35c8d2b25591dcdd8277bb2db3d07 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 01:15:56 +0300 Subject: [PATCH 36/56] Removed duplicated and wrong merged code sql/sql_base.cc: Fixed wrong comment --- sql/sql_base.cc | 2 +- sql/sql_parse.cc | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 98ea4e0adf3..e3c0efb83b8 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1714,7 +1714,7 @@ int open_and_lock_tables(THD *thd, TABLE_LIST *tables) SYNOPSIS open_normal_and_derived_tables thd - thread handler - tables - list of tables for open&locking + tables - list of tables for open RETURN FALSE - ok diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e01ec3d483b..1ee80eea4a9 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2517,11 +2517,6 @@ mysql_execute_command(THD *thd) */ start_waiting_global_read_lock(thd); - // put tables back for PS rexecuting - tables= lex->link_first_table_back(tables, create_table, - create_table_local); - break; - unsent_create_error: // put tables back for PS rexecuting tables= lex->link_first_table_back(tables, create_table, @@ -3694,14 +3689,6 @@ error: thd->lock= 0; } DBUG_VOID_RETURN; - - error1: - /* - Release the protection against the global read lock and wake - everyone, who might want to set a global read lock. - */ - start_waiting_global_read_lock(thd); - DBUG_VOID_RETURN; } From 52b70ceff707657a91787a6b67ce79ca015dcabf Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 09:37:53 +0500 Subject: [PATCH 37/56] ctype_utf8.result, ctype_utf8.test: adding test field.cc: bug#10714 Inserting double value into utf8 column crashes server: sprintf was executed with too big length, which caused crash on some Windows platforms. sql/field.cc: bug#10714 Inserting double value into utf8 column crashes server sprintf was executed with too long length, which cau crashe on Windows. mysql-test/t/ctype_utf8.test: adding test mysql-test/r/ctype_utf8.result: adding test --- mysql-test/r/ctype_utf8.result | 3 +++ mysql-test/t/ctype_utf8.test | 7 +++++++ sql/field.cc | 15 ++++++++------- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index ffdb7cb0f3d..b7aa7c68b67 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -888,3 +888,6 @@ NULL select ifnull(NULL, _utf8'string'); ifnull(NULL, _utf8'string') string +create table t1 (a varchar(255)) default character set utf8; +insert into t1 values (1.0); +drop table t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 02024adb34e..bac6e60c302 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -724,3 +724,10 @@ select ifnull(a,'') from t1; drop table t1; select repeat(_utf8'+',3) as h union select NULL; select ifnull(NULL, _utf8'string'); + +# +# Bug#10714: Inserting double value into utf8 column crashes server +# +create table t1 (a varchar(255)) default character set utf8; +insert into t1 values (1.0); +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index 60287d4003b..21c3fe12bb2 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4981,31 +4981,32 @@ int Field_str::store(double nr) char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE]; uint length; bool use_scientific_notation= TRUE; + uint char_length= field_length / charset()->mbmaxlen; /* Check fabs(nr) against longest value that can be stored in field, which depends on whether the value is < 1 or not, and negative or not */ double anr= fabs(nr); int neg= (nr < 0.0) ? 1 : 0; - if (field_length > 4 && field_length < 32 && - (anr < 1.0 ? anr > 1/(log_10[max(0,field_length-neg-2)]) /* -2 for "0." */ - : anr < log_10[field_length-neg]-1)) + if (char_length > 4 && char_length < 32 && + (anr < 1.0 ? anr > 1/(log_10[max(0,char_length-neg-2)]) /* -2 for "0." */ + : anr < log_10[char_length-neg]-1)) use_scientific_notation= FALSE; length= (uint) my_sprintf(buff, (buff, "%-.*g", (use_scientific_notation ? - max(0, (int)field_length-neg-5) : - field_length), + max(0, (int)char_length-neg-5) : + char_length), nr)); /* +1 below is because "precision" in %g above means the max. number of significant digits, not the output width. Thus the width can be larger than number of significant digits by 1 (for decimal point) - the test for field_length < 5 is for extreme cases, + the test for char_length < 5 is for extreme cases, like inserting 500.0 in char(1) */ - DBUG_ASSERT(field_length < 5 || length <= field_length+1); + DBUG_ASSERT(char_length < 5 || length <= char_length+1); return store((const char *) buff, length, charset()); } From 9979feb35c1a90ac61c09e2a170e59ba40efcaa6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 10:30:58 +0200 Subject: [PATCH 38/56] bundle the check-cpu helper script with source packages. BUG#10696 --- BUILD/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/BUILD/Makefile.am b/BUILD/Makefile.am index 9f3c55c20d5..4e27ffd5e7f 100644 --- a/BUILD/Makefile.am +++ b/BUILD/Makefile.am @@ -19,6 +19,7 @@ EXTRA_DIST = FINISH.sh \ SETUP.sh \ + check-cpu \ compile-alpha \ compile-alpha-ccc \ compile-alpha-cxx \ From 74dd6421777f2046b8e5067f8c918d1f29e9f339 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 11:16:37 +0200 Subject: [PATCH 39/56] sql_repl.cc: Bug #11064 some read error not detected in replication on 64-bit platform sql/sql_repl.cc: Bug #11064 some read error not detected in replication on 64-bit platform BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + sql/sql_repl.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 499e3cdd4f5..185f84cc772 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -110,6 +110,7 @@ mwagner@here.mwagner.org mwagner@ultrafly.mysql.com mwagner@work.mysql.com mysqldev@build.mysql2.com +ndbdev@dl145b.mysql.com nick@mysql.com nick@nick.leippe.com patg@krsna.patg.net diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 9485031c144..ed2d477fc5d 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -84,7 +84,7 @@ static int send_file(THD *thd) char fname[FN_REFLEN+1]; const char *errmsg = 0; int old_timeout; - uint packet_len; + unsigned long packet_len; char buf[IO_SIZE]; // It's safe to alloc this DBUG_ENTER("send_file"); From fcb3be9f633671b860a6daf21d54bd7fe10f287d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 11:21:43 +0200 Subject: [PATCH 40/56] check-cpu fixes/improvements (Bug #11065) - support additional platforms (OpenBSD, Darwin) - make use of /proc/cpuinfo CPU flag information (needed to distinguish EMT64 Xeons from normal ones) - chose the right CPU related options depending on GCC version and target architecture - check if the chosen CPU type is actually supported by the GCC version , fallback to CPUs predecessor until test compile succeeds --- BUILD/check-cpu | 168 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 126 insertions(+), 42 deletions(-) diff --git a/BUILD/check-cpu b/BUILD/check-cpu index 0283c669fb2..3ceb9c269fe 100755 --- a/BUILD/check-cpu +++ b/BUILD/check-cpu @@ -6,113 +6,197 @@ # if test -r /proc/cpuinfo ; then + # on Linux (and others?) we can get detailed CPU information out of /proc cpuinfo="cat /proc/cpuinfo" + + # detect CPU family cpu_family=`$cpuinfo | grep 'family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` if test -z "$cpu_family" ; then cpu_family=`$cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` fi + + # detect CPU vendor and model cpu_vendor=`$cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` model_name=`$cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -1` if test -z "$model_name" ; then model_name=`$cpuinfo | grep 'cpu model' | cut -d ':' -f 2 | head -1` fi + + # fallback: get CPU model from uname output if test -z "$model_name" ; then model_name=`uname -m` fi + + # parse CPU flags + for flag in `$cpuinfo | grep 'flags' | sed -e 's/^flags.*: //'`; do + eval cpu_flag_$flag=yes + done else # Fallback when there is no /proc/cpuinfo case "`uname -s`" in - FreeBSD) + FreeBSD|OpenBSD) cpu_family=`uname -m`; - model_name=`sysctl -b hw.model` + model_name=`sysctl -n hw.model` + ;; + Darwin) + cpu_family=`uname -p` + model_name=`machine` ;; *) cpu_family=`uname -m`; - model_name="unknown"; + model_name=`uname -p`; ;; esac fi -cpu_flag="" -cpu_flag_old="" +# detect CPU shortname as used by gcc options +# this list is not complete, feel free to add further entries +cpu_arg="" case "$cpu_family--$model_name" in + # DEC Alpha Alpha*EV6*) - cpu_flag="ev6"; + cpu_arg="ev6"; ;; + + # Intel ia32 *Xeon*) - cpu_flag="nocona"; + # a Xeon is just another pentium4 ... + # ... unless it has the "lm" (long-mode) flag set, + # in that case it's a Xeon with EM64T support + if [ -z "$cpu_flag_lm" ]; then + cpu_arg="pentium4"; + else + cpu_arg="nocona"; + fi ;; - *Pentium*4*Mobile*CPU*) - cpu_flag="pentium4m"; + *Pentium*4*Mobile*) + cpu_arg="pentium4m"; ;; - *Pentium*4*CPU*) - cpu_flag="pentium4"; + *Pentium*4*) + cpu_arg="pentium4"; ;; - *Pentium*III*Mobile*CPU*) - cpu_flag="pentium3m"; + *Pentium*III*Mobile*) + cpu_arg="pentium3m"; ;; - *Pentium*III*CPU*) - cpu_flag="pentium3"; + *Pentium*III*) + cpu_arg="pentium3"; ;; *Pentium*M*pro*) - cpu_flag="pentium-m"; - cpu_flag_old="pentium"; + cpu_arg="pentium-m"; ;; *Athlon*64*) - cpu_flag="athlon64"; - cpu_flag_old="athlon"; + cpu_arg="athlon64"; ;; *Athlon*) - cpu_flag="athlon"; + cpu_arg="athlon"; ;; + + # Intel ia64 *Itanium*) # Don't need to set any flags for itanium(at the moment) - cpu_flag=""; + cpu_arg=""; ;; - *ppc) - cpu_flag="powerpc"; - no_march=1; + + # + *powerpc*) + cpu_arg=`echo $model_name | sed -e"s/ppc//g"` ;; + + # unknown *) - cpu_flag=""; + cpu_arg=""; ;; esac -if test -z "$cpu_flag"; then + +if test -z "$cpu_arg"; then echo "BUILD/check-cpu: Oops, could not findout what kind of cpu this machine is using." - check_cpu_flags="" + check_cpu_cflags="" return fi -echo "cpu_flag: $cpu_flag" - +# different compiler versions have different option names +# for CPU specific command line options if test -z "$CC" ; then cc="gcc"; else cc=$CC - fi cc_ver=`$cc --version | sed 1q` cc_verno=`echo $cc_ver | sed -e 's/[^0-9. ]//g; s/^ *//g; s/ .*//g'` case "$cc_ver--$cc_verno" in - *GCC*--3.4*|*GCC*--3.5*|*GCC*--4.*) - check_cpu_cflags="-mtune=$cpu_flag -march=$cpu_flag" - ;; *GCC*) - # Fix for older compiler versions - if test -n "$cpu_flag_old"; then - cpu_flag="$cpu_flag_old" - fi - check_cpu_cflags="-mcpu=$cpu_flag -march=$cpu_flag" - if test -n "$no_march"; then - check_cpu_cflags="-mcpu=$cpu_flag" - fi + # different gcc backends (and versions) have different CPU flags + case `gcc -dumpmachine` in + i?86-*) + case "$cc_verno" in + 3.4*|3.5*|4.*) + check_cpu_args='-mtune=$cpu_arg -march=$cpu_arg' + ;; + *) + check_cpu_args='-mcpu=$cpu_arg -march=$cpu_arg' + ;; + esac + ;; + ppc-*) + check_cpu_args='-mcpu=$cpu_arg -mtune=$cpu_arg' + ;; + *) + check_cpu_cflags="" + return + ;; + esac + ;; + 2.95.*) + # GCC 2.95 doesn't expose its name in --version output + check_cpu_args='-m$cpu_arg' ;; *) check_cpu_cflags="" + return ;; esac -echo $check_cpu_cflags + +# now we check whether the compiler really understands the cpu type +touch __test.c + +while [ "$cpu_arg" ] ; do + echo -n testing $cpu_arg "... " + + # compile check + check_cpu_cflags=`eval echo $check_cpu_args` + if $cc -c $check_cpu_cflags __test.c 2>/dev/null; then + echo ok + break; + fi + + echo failed + check_cpu_cflags="" + + # if compile failed: check whether it supports a predecessor of this CPU + # this list is not complete, feel free to add further entries + case "$cpu_arg" in + # Intel ia32 + nocona) cpu_arg=pentium4 ;; + prescott) cpu_arg=pentium4 ;; + pentium4m) cpu_arg=pentium4 ;; + pentium4) cpu_arg=pentium3 ;; + pentium3m) cpu_arg=pentium3 ;; + pentium3) cpu_arg=pentium2 ;; + pentium2) cpu_arg=pentiumpro ;; + pentiumpro) cpu_arg=pentium ;; + pentium) cpu_arg=i486 ;; + i486) cpu_arg=i386 ;; + + # power / powerPC + 7450) cpu_arg=7400 ;; + + *) cpu_arg="" ;; + esac +done + +rm __test.* + From 78fc41727e17807668ab87c41060abf59a6cc2ee Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 15:05:18 +0200 Subject: [PATCH 41/56] *don't* mess with kernel defines, boy. and HAVE_ATOMIC_ADD/HAVE_ATOMIC_SUB is tested in configure --- include/my_global.h | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/include/my_global.h b/include/my_global.h index 0d6f52a3376..f24bcd528ca 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -203,18 +203,6 @@ C_MODE_END #define BAD_MEMCPY #endif -/* In Linux-alpha we have atomic.h if we are using gcc */ -#if defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && defined(__alpha__) && (__GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 95)) && !defined(HAVE_ATOMIC_ADD) -#define HAVE_ATOMIC_ADD -#define HAVE_ATOMIC_SUB -#endif - -/* In Linux-ia64 including atomic.h will give us an error */ -#if (defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && (defined(__ia64__)||defined(__powerpc64__))) || !defined(THREAD) -#undef HAVE_ATOMIC_ADD -#undef HAVE_ATOMIC_SUB -#endif - #if defined(_lint) && !defined(lint) #define lint #endif @@ -276,16 +264,17 @@ C_MODE_END #include #endif #ifdef HAVE_ATOMIC_ADD -#define __SMP__ -#ifdef HAVE_LINUX_CONFIG_H -#include /* May define CONFIG_SMP */ -#endif -#ifndef CONFIG_SMP -#define CONFIG_SMP +#if defined(__ia64__) +#define new my_arg_new +#define need_to_restore_new 1 #endif C_MODE_START #include C_MODE_END +#ifdef need_to_restore_new /* probably safer than #ifdef new */ +#undef new +#undef need_to_restore_new +#endif #endif #include /* Recommended by debian */ /* We need the following to go around a problem with openssl on solaris */ From 7509b50054bbcb6d703f6ce41972d1533614b221 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 21:08:45 +0200 Subject: [PATCH 42/56] after merge fixes --- mysql-test/r/create.result | 14 +++++++++++--- mysql-test/t/create.test | 7 +++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 103bed598ef..a4f5cc517b3 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -497,9 +497,9 @@ drop database mysqltest; select database(); database() NULL -select database(); -database() -NULL +select database(), user(); +database() user() +NULL mysqltest_1@localhost use test; create table t1 (a int, index `primary` (a)); ERROR 42000: Incorrect index name 'primary' @@ -563,3 +563,11 @@ select * from t2; b 1 drop table t1,t2; +create table t1 (a int); +create table t1 select * from t1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +create table t2 union = (t1) select * from t1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +flush tables with read lock; +unlock tables; +drop table t1; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 2ba726f29e2..4644d3db5c5 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -403,8 +403,11 @@ drop database mysqltest; select database(); # Connect without a database -connect (user4,localhost,mysqltest_1,,*NO-ONE*); -select database(); +connect (user1,localhost,mysqltest_1,,*NO-ONE*); +connection user1; +select database(), user(); +connection default; +disconnect user1; # # Test for Bug 856 'Naming a key "Primary" causes trouble' From 72dd44b9dede604b0ffc9acb2458ffde405212af Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 23:46:03 +0300 Subject: [PATCH 43/56] Move USE_PRAGMA_IMPLEMENTATION to proper place Ensure that 'null_value' is not accessed before val() is called in FIELD() functions Fixed initialization of key maps. This fixes some problems with keys when you have more than 64 keys Fixed that ROLLUP don't always create a temporary table. This fix ensures that func_gconcat.test results are now predictable mysql-test/r/func_gconcat.result: Move innodb specific test to innodb.test Changed table name r2 -> t2 More test to see how ROLLUP was optimized mysql-test/r/innodb.result: Moved test here form func_gconcat mysql-test/r/olap.result: New test results after optimization mysql-test/t/func_gconcat.test: Move innodb specific test to innodb.test Changed table name r2 -> t2 More test to see how ROLLUP was optimized mysql-test/t/innodb.test: Moved test here form func_gconcat sql/field.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_berkeley.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_blackhole.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_heap.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_innodb.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_isam.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_isammrg.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_myisam.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_myisammrg.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_ndbcluster.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/handler.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/hash_filo.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_cmpfunc.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_func.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place Ensure that 'null_value' is not accessed before val() is called sql/item_geofunc.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_strfunc.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_subselect.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_sum.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_timefunc.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_uniq.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/log_event.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/mysql_priv.h: Change key_map_full to not be const as we are giving it a proper value on startup sql/mysqld.cc: Move key_map variables here and initialize key_map_full properly sql/opt_range.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/opt_range.h: Fix that test_quick_select() works with any ammount of keys sql/procedure.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/protocol.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/protocol_cursor.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/set_var.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_analyse.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_class.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_crypt.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_insert.cc: Fixed that max_rows is ulong sql/sql_list.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_map.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_olap.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_select.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place Fixed that ROLLUP don't have to always create a temporary table Added new argument to remove_const() to make above possible Fixed some errors that creapt up when we don't always do a temporary table for ROLLUP sql/sql_string.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_table.cc: Simple optimizations Fixed wrong checking of build_table_path() in undef-ed code sql/sql_udf.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_yacc.yy: removed extra {} --- mysql-test/r/func_gconcat.result | 37 ++++++------- mysql-test/r/innodb.result | 12 +++++ mysql-test/r/olap.result | 2 +- mysql-test/t/func_gconcat.test | 27 +++------- mysql-test/t/innodb.test | 15 ++++++ sql/field.cc | 5 +- sql/ha_berkeley.cc | 5 +- sql/ha_blackhole.cc | 9 ++-- sql/ha_heap.cc | 5 +- sql/ha_innodb.cc | 5 +- sql/ha_isam.cc | 10 ++-- sql/ha_isammrg.cc | 5 +- sql/ha_myisam.cc | 5 +- sql/ha_myisammrg.cc | 5 +- sql/ha_ndbcluster.cc | 9 ++-- sql/handler.cc | 5 +- sql/hash_filo.cc | 5 +- sql/item.cc | 5 +- sql/item_cmpfunc.cc | 5 +- sql/item_func.cc | 16 +++--- sql/item_geofunc.cc | 5 +- sql/item_strfunc.cc | 5 +- sql/item_subselect.cc | 5 +- sql/item_sum.cc | 5 +- sql/item_timefunc.cc | 5 +- sql/item_uniq.cc | 9 ++-- sql/log_event.cc | 4 +- sql/mysql_priv.h | 2 +- sql/mysqld.cc | 4 ++ sql/opt_range.cc | 5 +- sql/opt_range.h | 8 ++- sql/procedure.cc | 5 +- sql/protocol.cc | 5 +- sql/protocol_cursor.cc | 5 +- sql/set_var.cc | 5 +- sql/sql_analyse.cc | 5 +- sql/sql_class.cc | 5 +- sql/sql_crypt.cc | 5 +- sql/sql_insert.cc | 8 +-- sql/sql_list.cc | 5 +- sql/sql_map.cc | 5 +- sql/sql_olap.cc | 5 +- sql/sql_select.cc | 90 ++++++++++++++++++++------------ sql/sql_string.cc | 2 - sql/sql_table.cc | 8 +-- sql/sql_udf.cc | 9 ++-- sql/sql_yacc.yy | 1 - 47 files changed, 180 insertions(+), 237 deletions(-) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 057822839fa..7a256edc91a 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -343,18 +343,6 @@ GROUP_CONCAT(b ORDER BY b) First Row Second Row DROP TABLE t1; -CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1; -INSERT INTO t1 VALUES (1),(2),(3); -CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a), -CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1; -INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2); -SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz; -a_id b_list -1 1,2,3 -2 4,5 -3 NULL -DROP TABLE t2; -DROP TABLE t1; CREATE TABLE t1 (A_ID INT NOT NULL,A_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID)); INSERT INTO t1 VALUES (1,'ABC'), (2,'EFG'), (3,'HIJ'); CREATE TABLE t2 (A_ID INT NOT NULL,B_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID,B_DESC)); @@ -462,15 +450,28 @@ SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL; gc NULL DROP TABLE t1; -create table r2 (a int, b int); -insert into r2 values (1,1), (2,2); -select b x, (select group_concat(x) from r2) from r2; -x (select group_concat(x) from r2) +create table t2 (a int, b int); +insert into t2 values (1,1), (2,2); +select b x, (select group_concat(x) from t2) from t2; +x (select group_concat(x) from t2) 1 1,1 2 2,2 -drop table r2; -create table t1 (d int, a int, b int, c int); +drop table t2; +create table t1 (d int not null auto_increment,primary key(d), a int, b int, c int); insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3); +select d,a,b from t1 order by a; +d a b +1 1 3 +2 1 4 +3 1 2 +5 1 1 +6 1 2 +4 2 7 +7 2 3 +8 2 3 +explain select a, group_concat(b) from t1 group by a with rollup; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using filesort select a, group_concat(b) from t1 group by a with rollup; a group_concat(b) 1 3,4,2,1,2 diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 4c983014d4b..3d7e99fa7bc 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1647,3 +1647,15 @@ CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB; SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE); ERROR HY000: The used table type doesn't support FULLTEXT indexes DROP TABLE t1; +CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1),(2),(3); +CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a), +CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2); +SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz; +a_id b_list +1 1,2,3 +2 4,5 +3 NULL +DROP TABLE t2; +DROP TABLE t1; diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index ab84fa5739a..0c6c4684853 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -83,7 +83,7 @@ TV NULL NULL 600 NULL NULL NULL 7785 explain extended select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup; 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 +1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using filesort Warnings: 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; diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 485e8ba143c..5f02db7707c 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -213,21 +213,6 @@ INSERT INTO t1 VALUES (1,'First Row'), (2,'Second Row'); SELECT GROUP_CONCAT(b ORDER BY b) FROM t1 GROUP BY a; DROP TABLE t1; -# -# check null values #1 -# - ---disable_warnings -CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1; -INSERT INTO t1 VALUES (1),(2),(3); -CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a), - CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1; ---enable_warnings -INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2); -SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz; -DROP TABLE t2; -DROP TABLE t1; - # # check null values #2 # @@ -288,17 +273,19 @@ DROP TABLE t1; # # Bug #8656: Crash with group_concat on alias in outer table # -create table r2 (a int, b int); -insert into r2 values (1,1), (2,2); -select b x, (select group_concat(x) from r2) from r2; -drop table r2; +create table t2 (a int, b int); +insert into t2 values (1,1), (2,2); +select b x, (select group_concat(x) from t2) from t2; +drop table t2; # # Bug #7405: problems with rollup # -create table t1 (d int, a int, b int, c int); +create table t1 (d int not null auto_increment,primary key(d), a int, b int, c int); insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3); +select d,a,b from t1 order by a; +explain select a, group_concat(b) from t1 group by a with rollup; select a, group_concat(b) from t1 group by a with rollup; select a, group_concat(distinct b) from t1 group by a with rollup; select a, group_concat(b order by b) from t1 group by a with rollup; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 201489c0ddb..1ce95811fc3 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1187,3 +1187,18 @@ CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB; --error 1214; SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE); DROP TABLE t1; + +# +# check null values #1 +# + +--disable_warnings +CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1),(2),(3); +CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a), + CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1; +--enable_warnings +INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2); +SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz; +DROP TABLE t2; +DROP TABLE t1; diff --git a/sql/field.cc b/sql/field.cc index 21c3fe12bb2..292bbe80362 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -19,13 +19,10 @@ ** This file implements classes defined in field.h *****************************************************************************/ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "sql_select.h" #include #include diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index d4adea4a7b4..35a137df97b 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -47,13 +47,10 @@ */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #ifdef HAVE_BERKELEY_DB #include #include diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index a5456d54c1b..109098948ac 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation -#endif - #include "mysql_priv.h" +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation // gcc: Class implementation +#endif #ifdef HAVE_BLACKHOLE_DB #include "ha_blackhole.h" diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index ef0d0022860..ad0e8819842 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "ha_heap.h" diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index b3b82df5469..2016f58083a 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -28,13 +28,10 @@ have disables the InnoDB inlining in this file. */ in Windows? */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "slave.h" #ifdef HAVE_INNOBASE_DB diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index b755c63698f..b074edf719d 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -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 - -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation -#endif - #include "mysql_priv.h" +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation // gcc: Class implementation +#endif #ifdef HAVE_ISAM #include #include diff --git a/sql/ha_isammrg.cc b/sql/ha_isammrg.cc index 7e14ccb43bf..f6fe1a49e9e 100644 --- a/sql/ha_isammrg.cc +++ b/sql/ha_isammrg.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #ifdef HAVE_ISAM #include #ifndef MASTER diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index b4ac8cc777f..34e6c429a8f 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include #include "ha_myisam.h" diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index 3374ee1271a..1f9e6a71d16 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "ha_myisammrg.h" #ifndef MASTER diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 516703112dd..d361bec8fcc 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -20,13 +20,10 @@ NDB Cluster */ -#include - -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation -#endif - #include "mysql_priv.h" +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation // gcc: Class implementation +#endif #ifdef HAVE_NDBCLUSTER_DB #include diff --git a/sql/handler.cc b/sql/handler.cc index d47bb02a58c..d9db1afff7a 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -17,13 +17,10 @@ /* Handler-calling-functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "ha_heap.h" #include "ha_myisam.h" #include "ha_myisammrg.h" diff --git a/sql/hash_filo.cc b/sql/hash_filo.cc index 34f3cd6b035..a16ff6ac7be 100644 --- a/sql/hash_filo.cc +++ b/sql/hash_filo.cc @@ -20,11 +20,8 @@ ** to usage. */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "hash_filo.h" diff --git a/sql/item.cc b/sql/item.cc index d32a6581049..96fa1a8fac4 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "my_dir.h" diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index f53dcb43e5c..b17c4a9fbf7 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -17,13 +17,10 @@ /* This file defines all compare functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "sql_select.h" diff --git a/sql/item_func.cc b/sql/item_func.cc index ad8479c7b0b..2d16ef5e183 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -17,13 +17,10 @@ /* This file defines all numerical functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "slave.h" // for wait_for_master_pos #include #include @@ -1491,9 +1488,6 @@ longlong Item_func_field::val_int() { DBUG_ASSERT(fixed == 1); - if (args[0]->null_value) - return 0; - if (cmp_type == STRING_RESULT) { String *field; @@ -1509,18 +1503,22 @@ longlong Item_func_field::val_int() else if (cmp_type == INT_RESULT) { longlong val= args[0]->val_int(); + if (args[0]->null_value) + return 0; for (uint i=1; i < arg_count ; i++) { - if (!args[i]->null_value && val == args[i]->val_int()) + if (val == args[i]->val_int() && !args[i]->null_value) return (longlong) (i); } } else { double val= args[0]->val(); + if (args[0]->null_value) + return 0; for (uint i=1; i < arg_count ; i++) { - if (!args[i]->null_value && val == args[i]->val()) + if (val == args[i]->val() && !args[i]->null_value) return (longlong) (i); } } diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index e907c5a0d45..9dbc1724824 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -17,14 +17,11 @@ /* This file defines all spatial functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - #ifdef HAVE_SPATIAL #include diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 725712f4e85..56b06cb02c4 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -20,13 +20,10 @@ ** (This shouldn't be needed) */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #ifdef HAVE_OPENSSL #include diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index f7defd96b04..9bd9eff5ef7 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -22,13 +22,10 @@ SUBSELECT TODO: (sql_select.h/sql_select.cc) */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "sql_select.h" inline Item * and_items(Item* cond, Item *item) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 9c35fb1d427..5c34dc6a603 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -17,14 +17,11 @@ /* Sum functions (COUNT, MIN...) */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - Item_sum::Item_sum(List &list) :arg_count(list.elements) { diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 9f5cd61f95a..b7f9236ce46 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -17,13 +17,10 @@ /* This file defines all time functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include diff --git a/sql/item_uniq.cc b/sql/item_uniq.cc index c83373bd8b0..8e9653aba88 100644 --- a/sql/item_uniq.cc +++ b/sql/item_uniq.cc @@ -16,10 +16,7 @@ /* Compability file */ -#include - -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation -#endif - #include "mysql_priv.h" +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation // gcc: Class implementation +#endif diff --git a/sql/log_event.cc b/sql/log_event.cc index 9701ef2ff00..866a7c21bb4 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -17,12 +17,10 @@ #ifndef MYSQL_CLIENT -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" #include "slave.h" #include #endif /* MYSQL_CLIENT */ diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 5b9e81620ce..0d058190a46 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -37,7 +37,7 @@ typedef ulong key_part_map; /* Used for finding key parts */ /* useful constants */ extern const key_map key_map_empty; -extern const key_map key_map_full; +extern key_map key_map_full; /* Should be threaded as const */ extern const char *primary_key_name; #include "mysql_com.h" diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5e3142ccf0e..44b91fd3530 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -351,6 +351,9 @@ char mysql_real_data_home[FN_REFLEN], *opt_init_connect, *opt_init_slave, def_ft_boolean_syntax[sizeof(ft_boolean_syntax)]; +const key_map key_map_empty(0); +key_map key_map_full(0); // Will be initialized later + const char *opt_date_time_formats[3]; char *language_ptr, *default_collation_name, *default_character_set_name; @@ -5677,6 +5680,7 @@ static void mysql_init_variables(void) mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS; bzero((gptr) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list)); bzero((gptr) &com_stat, sizeof(com_stat)); + key_map_full.set_all(); /* Character sets */ system_charset_info= &my_charset_utf8_general_ci; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 7b37f0ce4f7..4b6e56468d2 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -23,13 +23,10 @@ */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include #include "sql_select.h" diff --git a/sql/opt_range.h b/sql/opt_range.h index b55bb4708bf..87e0315a09e 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -143,10 +143,14 @@ class SQL_SELECT :public Sql_alloc { ~SQL_SELECT(); void cleanup(); bool check_quick(THD *thd, bool force_quick_range, ha_rows limit) - { return test_quick_select(thd, key_map(~(uint)0), 0, limit, force_quick_range) < 0; } + { + key_map tmp; + tmp.set_all(); + return test_quick_select(thd, tmp, 0, limit, force_quick_range) < 0; + } inline bool skip_record() { return cond ? cond->val_int() == 0 : 0; } int test_quick_select(THD *thd, key_map keys, table_map prev_tables, - ha_rows limit, bool force_quick_range=0); + ha_rows limit, bool force_quick_range); }; diff --git a/sql/procedure.cc b/sql/procedure.cc index 10689dd36f6..bd742f645d2 100644 --- a/sql/procedure.cc +++ b/sql/procedure.cc @@ -17,13 +17,10 @@ /* Procedures (functions with changes output of select) */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "procedure.h" #include "sql_analyse.h" // Includes procedure #ifdef USE_PROC_RANGE diff --git a/sql/protocol.cc b/sql/protocol.cc index 835bd986fb8..9a1a05591dd 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -19,13 +19,10 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024; diff --git a/sql/protocol_cursor.cc b/sql/protocol_cursor.cc index 53a03001544..bb6a0eab2ee 100644 --- a/sql/protocol_cursor.cc +++ b/sql/protocol_cursor.cc @@ -19,13 +19,10 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include bool Protocol_cursor::send_fields(List *list, uint flag) diff --git a/sql/set_var.cc b/sql/set_var.cc index 5564ba096ac..b89cdffd4cb 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -48,13 +48,10 @@ new attribute. */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "slave.h" #include diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 678bdbb4588..df66b3c4228 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -23,13 +23,10 @@ ** - type set is out of optimization yet */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "procedure.h" #include "sql_analyse.h" #include diff --git a/sql/sql_class.cc b/sql/sql_class.cc index ff45b164893..fff1e3a3b54 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -22,13 +22,10 @@ ** *****************************************************************************/ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include #include diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc index eda7f0f6bbb..1cfa0eb8570 100644 --- a/sql/sql_crypt.cc +++ b/sql/sql_crypt.cc @@ -23,14 +23,11 @@ needs something like 'ssh'. */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - SQL_CRYPT::SQL_CRYPT(const char *password) { ulong rand_nr[2]; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index b4021943967..718e6b00ddc 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -752,7 +752,7 @@ public: volatile bool status,dead; COPY_INFO info; I_List rows; - uint group_count; + ulong group_count; TABLE_LIST table_list; // Argument delayed_insert() @@ -1420,7 +1420,7 @@ static void free_delayed_insert_blobs(register TABLE *table) bool delayed_insert::handle_inserts(void) { int error; - uint max_rows; + ulong max_rows; bool using_ignore=0, using_bin_log=mysql_bin_log.is_open(); delayed_row *row; DBUG_ENTER("handle_inserts"); @@ -1439,11 +1439,11 @@ bool delayed_insert::handle_inserts(void) } thd.proc_info="insert"; - max_rows=delayed_insert_limit; + max_rows= delayed_insert_limit; if (thd.killed || table->version != refresh_version) { thd.killed=1; - max_rows= ~(uint)0; // Do as much as possible + max_rows= ~(ulong)0; // Do as much as possible } /* diff --git a/sql/sql_list.cc b/sql/sql_list.cc index 485c569f49c..219ff85946e 100644 --- a/sql/sql_list.cc +++ b/sql/sql_list.cc @@ -15,14 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - list_node end_of_list; void free_list(I_List *list) diff --git a/sql/sql_map.cc b/sql/sql_map.cc index 9baacd1bc4b..408938e7639 100644 --- a/sql/sql_map.cc +++ b/sql/sql_map.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #ifdef HAVE_MMAP #include #include diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc index a365cbb0614..5631cf9dcef 100644 --- a/sql/sql_olap.cc +++ b/sql/sql_olap.cc @@ -28,13 +28,10 @@ #ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1 -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "sql_select.h" diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 9661c0c13c9..38e54ed7104 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -17,13 +17,10 @@ /* mysql_select and join optimization */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "sql_select.h" #include @@ -35,9 +32,6 @@ const char *join_type_str[]={ "UNKNOWN","system","const","eq_ref","ref", "ref_or_null","unique_subquery","index_subquery" }; -const key_map key_map_empty(0); -const key_map key_map_full(~(uint)0); - static void optimize_keyuse(JOIN *join, DYNAMIC_ARRAY *keyuse_array); static bool make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds, DYNAMIC_ARRAY *keyuse); @@ -66,7 +60,7 @@ static bool only_eq_ref_tables(JOIN *join, ORDER *order, table_map tables); static void update_depend_map(JOIN *join); static void update_depend_map(JOIN *join, ORDER *order); static ORDER *remove_const(JOIN *join,ORDER *first_order,COND *cond, - bool *simple_order); + bool change_list, bool *simple_order); static int return_zero_rows(JOIN *join, select_result *res,TABLE_LIST *tables, List &fields, bool send_row, uint select_options, const char *info, @@ -613,7 +607,7 @@ JOIN::optimize() /* Optimize distinct away if possible */ { ORDER *org_order= order; - order=remove_const(this, order,conds,&simple_order); + order=remove_const(this, order,conds,1, &simple_order); /* If we are using ORDER BY NULL or ORDER BY const_expression, return result in any order (even if we are using a GROUP BY) @@ -681,8 +675,9 @@ JOIN::optimize() DBUG_RETURN(1); } simple_group= 0; - if (rollup.state == ROLLUP::STATE_NONE) - group_list= remove_const(this, group_list, conds, &simple_group); + group_list= remove_const(this, group_list, conds, + rollup.state == ROLLUP::STATE_NONE, + &simple_group); if (!group_list && group) { order=0; // The output has only one row @@ -694,7 +689,7 @@ JOIN::optimize() if (procedure && procedure->group) { group_list= procedure->group= remove_const(this, procedure->group, conds, - &simple_group); + 1, &simple_group); calc_group_buffer(this, group_list); } @@ -1638,8 +1633,8 @@ static ha_rows get_quick_record_count(THD *thd, SQL_SELECT *select, { select->head=table; table->reginfo.impossible_range=0; - if ((error=select->test_quick_select(thd, *(key_map *)keys,(table_map) 0, - limit)) == 1) + if ((error= select->test_quick_select(thd, *(key_map *)keys,(table_map) 0, + limit, 0)) == 1) DBUG_RETURN(select->quick->records); if (error == -1) { @@ -3452,7 +3447,8 @@ make_simple_join(JOIN *join,TABLE *tmp_table) join_tab->select_cond=0; join_tab->quick=0; join_tab->type= JT_ALL; /* Map through all records */ - join_tab->keys.init(~(uint)0); /* test everything in quick */ + join_tab->keys.init(); + join_tab->keys.set_all(); /* test everything in quick */ join_tab->info=0; join_tab->on_expr=0; join_tab->ref.key = -1; @@ -3684,7 +3680,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) (join->select_options & OPTION_FOUND_ROWS ? HA_POS_ERROR : - join->unit->select_limit_cnt)) < 0) + join->unit->select_limit_cnt), 0) < 0) { /* Before reporting "Impossible WHERE" for the whole query @@ -3697,7 +3693,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) (join->select_options & OPTION_FOUND_ROWS ? HA_POS_ERROR : - join->unit->select_limit_cnt)) < 0) + join->unit->select_limit_cnt),0) < 0) DBUG_RETURN(1); // Impossible WHERE } else @@ -4200,20 +4196,39 @@ static void update_depend_map(JOIN *join, ORDER *order) /* - simple_order is set to 1 if sort_order only uses fields from head table - and the head table is not a LEFT JOIN table + Remove all constants and check if ORDER only contains simple expressions + + SYNOPSIS + remove_const() + join Join handler + first_order List of SORT or GROUP order + cond WHERE statement + change_list Set to 1 if we should remove things from list + If this is not set, then only simple_order is + calculated + simple_order Set to 1 if we are only using simple expressions + + RETURN + Returns new sort order + + simple_order is set to 1 if sort_order only uses fields from head table + and the head table is not a LEFT JOIN table + */ static ORDER * -remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order) +remove_const(JOIN *join,ORDER *first_order, COND *cond, + bool change_list, bool *simple_order) { if (join->tables == join->const_tables) - return 0; // No need to sort - DBUG_ENTER("remove_const"); + return change_list ? 0 : first_order; // No need to sort + ORDER *order,**prev_ptr; table_map first_table= join->join_tab[join->const_tables].table->map; table_map not_const_tables= ~join->const_table_map; table_map ref; + DBUG_ENTER("remove_const"); + prev_ptr= &first_order; *simple_order= join->join_tab[join->const_tables].on_expr ? 0 : 1; @@ -4244,7 +4259,8 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order) } if ((ref=order_tables & (not_const_tables ^ first_table))) { - if (!(order_tables & first_table) && only_eq_ref_tables(join,first_order,ref)) + if (!(order_tables & first_table) && + only_eq_ref_tables(join,first_order, ref)) { DBUG_PRINT("info",("removing: %s", order->item[0]->full_name())); continue; @@ -4253,11 +4269,13 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order) } } } - *prev_ptr= order; // use this entry + if (change_list) + *prev_ptr= order; // use this entry prev_ptr= &order->next; } - *prev_ptr=0; - if (!first_order) // Nothing to sort/group + if (change_list) + *prev_ptr=0; + if (prev_ptr == &first_order) // Nothing to sort/group *simple_order=1; DBUG_PRINT("exit",("simple_order: %d",(int) *simple_order)); DBUG_RETURN(first_order); @@ -6357,7 +6375,7 @@ test_if_quick_select(JOIN_TAB *tab) delete tab->select->quick; tab->select->quick=0; return tab->select->test_quick_select(tab->join->thd, tab->keys, - (table_map) 0, HA_POS_ERROR); + (table_map) 0, HA_POS_ERROR, 0); } @@ -7352,12 +7370,15 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, parameres are set correctly by the range optimizer. */ key_map new_ref_key_map; - new_ref_key_map.clear_all(); /* Force the creation of quick select */ - new_ref_key_map.set_bit(new_ref_key); /* only for new_ref_key. */ + new_ref_key_map.clear_all(); // Force the creation of quick select + new_ref_key_map.set_bit(new_ref_key); // only for new_ref_key. if (select->test_quick_select(tab->join->thd, new_ref_key_map, 0, - (tab->join->select_options & OPTION_FOUND_ROWS) ? - HA_POS_ERROR : tab->join->unit->select_limit_cnt) <= 0) + (tab->join->select_options & + OPTION_FOUND_ROWS) ? + HA_POS_ERROR : + tab->join->unit->select_limit_cnt,0) <= + 0) DBUG_RETURN(0); } ref_key= new_ref_key; @@ -8902,6 +8923,8 @@ bool JOIN::make_sum_func_list(List &field_list, List &send_fields, for (uint i=0 ; i <= send_group_parts ;i++) sum_funcs_end[i]= func; } + else if (rollup.state == ROLLUP::STATE_READY) + DBUG_RETURN(FALSE); // Don't put end marker *func=0; // End marker DBUG_RETURN(FALSE); } @@ -9415,9 +9438,10 @@ bool JOIN::rollup_make_fields(List &fields_arg, List &sel_fields, This is an element that is used by the GROUP BY and should be set to NULL in this level */ + Item_null_result *null_item; item->maybe_null= 1; // Value will be null sometimes - Item_null_result *null_item= rollup.null_items[i]; - null_item->result_field= ((Item_field *) item)->result_field; + null_item= rollup.null_items[i]; + null_item->result_field= item->get_tmp_table_field(); item= null_item; break; } diff --git a/sql/sql_string.cc b/sql/sql_string.cc index e5339782f02..983c2d90a1d 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -17,11 +17,9 @@ /* This file is originally from the mysql distribution. Coded by monty */ #include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - #include #include #include diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7e80a71beb0..3aa6da7ad0c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -325,7 +325,7 @@ int quick_rm_table(enum db_type base,const char *db, build_table_path(path, sizeof(path), db, table_name, reg_ext); if (my_delete(path,MYF(0))) error=1; /* purecov: inspected */ - build_table_path(path, sizeof(path), db, table_name, ""); + *fn_ext(path)= 0; // Remove reg_ext return ha_delete_table(base,path) || error; } @@ -1339,7 +1339,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, /* Check if table exists */ if (create_info->options & HA_LEX_CREATE_TMP_TABLE) { - char tmp_table_name[NAME_LEN+1]; + char tmp_table_name[tmp_file_prefix_length+22+22+22+3]; my_snprintf(tmp_table_name, sizeof(tmp_table_name), "%s%lx_%lx_%x", tmp_file_prefix, current_pid, thd->thread_id, thd->tmp_table++); @@ -2622,7 +2622,7 @@ int mysql_create_indexes(THD *thd, TABLE_LIST *table_list, List &keys) build_table_path(path, sizeof(path), table_list->db, (lower_case_table_names == 2) ? table_list->alias : table_list->real_name, - reg_ext) != 0 || + reg_ext) == 0 || mysql_create_frm(thd, path, &create_info, fields, key_count, key_info_buffer, table->file)) /* don't need to free((gptr) key_info_buffer);*/ @@ -2723,7 +2723,7 @@ int mysql_drop_indexes(THD *thd, TABLE_LIST *table_list, build_table_path(path, sizeof(path), table_list->db, (lower_case_table_names == 2) ? table_list->alias : table_list->real_name, - reg_ext) != 0 || + reg_ext) == 0 || mysql_create_frm(thd, path, &create_info, fields, key_count, key_info_buffer, table->file)) /*don't need to free((gptr) key_numbers);*/ diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index deed806db2a..72c92a5c53a 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -28,13 +28,10 @@ ** dynamic functions, so this shouldn't be a real problem. */ -#include - -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: implement sql_udf.h -#endif - #include "mysql_priv.h" +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation // gcc: Class implementation +#endif #include #ifdef HAVE_DLOPEN diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 7585f0b10a0..bc21649fe54 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4064,7 +4064,6 @@ replace: } insert_field_spec {} - {} ; insert_lock_option: From 61c12aa299890bfbde8d8726c623c7af4eee5ec6 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Jun 2005 07:15:11 +0200 Subject: [PATCH 44/56] after mergemerge --- mysql-test/r/create.result | 8 ++++++++ mysql-test/t/create.test | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index b9dda435b11..de3840447dc 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -563,6 +563,14 @@ select * from t2; b 1 drop table t1,t2; +create table t1 (a int); +create table t1 select * from t1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +create table t2 union = (t1) select * from t1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +flush tables with read lock; +unlock tables; +drop table t1; create table t1(column.name int); ERROR 42000: Incorrect table name 'column' create table t1(test.column.name int); diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index a08603f8efb..b73cd28c71c 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -408,12 +408,12 @@ connection user1; select database(), user(); connection default; disconnect user1; +use test; # # Test for Bug 856 'Naming a key "Primary" causes trouble' # -use test; --error 1280 create table t1 (a int, index `primary` (a)); --error 1280 @@ -470,8 +470,6 @@ drop table t1,t2; # This tests two additional possible errors and a hang if # an improper fix is present. # -connection default; -use test; create table t1 (a int); --error 1093 create table t1 select * from t1; From 0602da4d0ca2b87ac4a6bc5a4686a5741d1db3e2 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Jun 2005 18:14:34 +1000 Subject: [PATCH 45/56] BUG#10948 NDB Replication: Race condition with ALTER/DROP table BUG#9826 Server crash on schema change ("drop table", "alter table") with NDB See note on 10948 for detailed explanation. struct a { void* a; long long b[1]; }; on PPC32 (and 32bit pa risc): 16 on x86: 12 so a malloc(sizeof(void*)+extra_bits) is wrong. Assuming that the long long is 64 bit aligned as non-aligned 64bit accesses are rather expensive on ppc. Thanks to paulus for doing the PPC port of valgrind. Without which I would no doubt still be trying to find this. ndb/src/ndbapi/DictCache.cpp: Fix allocation size for Ndb_local_table_info for architectures such as PPC and PA-RISC (32bit) where struct a { void* a; long long b;}; is 64 bit aligned (i.e. sizeof(struct a)==16) ndb/src/ndbapi/DictCache.hpp: Add warning about having to be the last member in the structure --- ndb/src/ndbapi/DictCache.cpp | 3 ++- ndb/src/ndbapi/DictCache.hpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp index 9cdd68272ad..ccc45a04824 100644 --- a/ndb/src/ndbapi/DictCache.cpp +++ b/ndb/src/ndbapi/DictCache.cpp @@ -24,7 +24,8 @@ Ndb_local_table_info * Ndb_local_table_info::create(NdbTableImpl *table_impl, Uint32 sz) { - Uint32 tot_size= sizeof(NdbTableImpl *) + ((sz+7)>>3)<<3; // round to Uint64 + Uint32 tot_size= sizeof(Ndb_local_table_info) - sizeof(Uint64) + + ((sz+7) & ~7); // round to Uint64 void *data= malloc(tot_size); if (data == 0) return 0; diff --git a/ndb/src/ndbapi/DictCache.hpp b/ndb/src/ndbapi/DictCache.hpp index 58c08a93e61..ca31c345396 100644 --- a/ndb/src/ndbapi/DictCache.hpp +++ b/ndb/src/ndbapi/DictCache.hpp @@ -33,7 +33,7 @@ public: static Ndb_local_table_info *create(NdbTableImpl *table_impl, Uint32 sz=0); static void destroy(Ndb_local_table_info *); NdbTableImpl *m_table_impl; - Uint64 m_local_data[1]; + Uint64 m_local_data[1]; // Must be last member. Used to access extra space. private: Ndb_local_table_info(NdbTableImpl *table_impl); ~Ndb_local_table_info(); From d6e0883b070cbb66a3dc94384816835964025aba Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Jun 2005 14:58:32 +0400 Subject: [PATCH 46/56] Fix show warnings limit 0 and show warnings limit 0, 0. Add test coverage for SHOW WARNINGS LIMIT a, b; mysql-test/r/warnings.result: Add test coverage for SHOW WARNINGS LIMIT a,b mysql-test/t/warnings.test: Add test coverage for SHOW WARNINGS LIMIT a,b sql/sql_error.cc: Fix show warnings limit 0 and show warnings limit 0, 0 --- mysql-test/r/warnings.result | 53 ++++++++++++++++++++++++++++++++++++ mysql-test/t/warnings.test | 22 +++++++++++++++ sql/sql_error.cc | 4 +-- 3 files changed, 77 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index d1d96afa153..e97b309547a 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -179,3 +179,56 @@ drop table t1; set table_type=MYISAM; Warnings: Warning 1287 'table_type' is deprecated; use 'storage_engine' instead +create table t1 (a int); +insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +update t1 set a='abc'; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 +Warning 1265 Data truncated for column 'a' at row 3 +Warning 1265 Data truncated for column 'a' at row 4 +Warning 1265 Data truncated for column 'a' at row 5 +Warning 1265 Data truncated for column 'a' at row 6 +Warning 1265 Data truncated for column 'a' at row 7 +Warning 1265 Data truncated for column 'a' at row 8 +Warning 1265 Data truncated for column 'a' at row 9 +Warning 1265 Data truncated for column 'a' at row 10 +show warnings limit 2, 1; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 3 +show warnings limit 0, 10; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 +Warning 1265 Data truncated for column 'a' at row 3 +Warning 1265 Data truncated for column 'a' at row 4 +Warning 1265 Data truncated for column 'a' at row 5 +Warning 1265 Data truncated for column 'a' at row 6 +Warning 1265 Data truncated for column 'a' at row 7 +Warning 1265 Data truncated for column 'a' at row 8 +Warning 1265 Data truncated for column 'a' at row 9 +Warning 1265 Data truncated for column 'a' at row 10 +show warnings limit 9, 1; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 10 +show warnings limit 10, 1; +Level Code Message +show warnings limit 9, 2; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 10 +show warnings limit 0, 0; +Level Code Message +show warnings limit 1; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 1 +show warnings limit 0; +Level Code Message +show warnings limit 1, 0; +Level Code Message +select * from t1 limit 0; +a +select * from t1 limit 1, 0; +a +select * from t1 limit 0, 0; +a +drop table t1; diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index 2a90f5f637d..6a6d533ad61 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -133,3 +133,25 @@ drop table t1; # Test for deprecated table_type variable # set table_type=MYISAM; + +# +# Tests for show warnings limit a, b +# +create table t1 (a int); +insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +# should generate 10 warnings +update t1 set a='abc'; +show warnings limit 2, 1; +show warnings limit 0, 10; +show warnings limit 9, 1; +show warnings limit 10, 1; +show warnings limit 9, 2; +show warnings limit 0, 0; +show warnings limit 1; +show warnings limit 0; +show warnings limit 1, 0; +# make sure behaviour is consistent with select ... limit +select * from t1 limit 0; +select * from t1 limit 1, 0; +select * from t1 limit 0, 0; +drop table t1; diff --git a/sql/sql_error.cc b/sql/sql_error.cc index d19e9fbdb09..a31e15d0745 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -203,6 +203,8 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show) offset--; continue; } + if (limit-- == 0) + break; protocol->prepare_for_resend(); protocol->store(warning_level_names[err->level], warning_level_length[err->level], system_charset_info); @@ -210,8 +212,6 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show) protocol->store(err->msg, strlen(err->msg), system_charset_info); if (protocol->write()) DBUG_RETURN(1); - if (!--limit) - break; } send_eof(thd); DBUG_RETURN(0); From 062a1b8b4e09c6de8ab592d37567d40d13798875 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 5 Jun 2005 19:38:52 +0200 Subject: [PATCH 47/56] a compiler must see '#pragma implementation' *before* '#pragma interface' (that comes with the #include'd header file) --- client/sql_string.cc | 3 +-- configure.in | 13 ++++++++++++- include/my_global.h | 9 ++------- mysys/raid.cc | 2 -- sql/examples/ha_archive.cc | 2 -- sql/examples/ha_example.cc | 2 -- sql/examples/ha_tina.cc | 2 -- sql/field.cc | 3 ++- sql/ha_berkeley.cc | 4 +++- sql/ha_blackhole.cc | 2 +- sql/ha_heap.cc | 3 ++- sql/ha_innodb.cc | 3 ++- sql/ha_isam.cc | 3 ++- sql/ha_isammrg.cc | 3 ++- sql/ha_myisam.cc | 3 ++- sql/ha_myisammrg.cc | 3 ++- sql/ha_ndbcluster.cc | 3 ++- sql/handler.cc | 3 ++- sql/hash_filo.cc | 3 ++- sql/item.cc | 2 +- sql/item_cmpfunc.cc | 3 ++- sql/item_func.cc | 3 ++- sql/item_geofunc.cc | 2 +- sql/item_strfunc.cc | 3 ++- sql/item_subselect.cc | 3 ++- sql/item_sum.cc | 3 ++- sql/item_timefunc.cc | 3 ++- sql/item_uniq.cc | 3 ++- sql/log_event.cc | 3 ++- sql/opt_range.cc | 3 ++- sql/procedure.cc | 3 ++- sql/protocol.cc | 3 ++- sql/protocol_cursor.cc | 3 ++- sql/set_var.cc | 3 ++- sql/sql_analyse.cc | 3 ++- sql/sql_class.cc | 3 ++- sql/sql_crypt.cc | 3 ++- sql/sql_list.cc | 3 ++- sql/sql_map.cc | 3 ++- sql/sql_olap.cc | 3 ++- sql/sql_select.cc | 3 ++- sql/sql_string.cc | 3 ++- sql/sql_udf.cc | 3 ++- sql/tztime.cc | 3 +-- 44 files changed, 86 insertions(+), 56 deletions(-) diff --git a/client/sql_string.cc b/client/sql_string.cc index 8f0e46c5eea..690997152f1 100644 --- a/client/sql_string.cc +++ b/client/sql_string.cc @@ -16,12 +16,11 @@ /* This file is originally from the mysql distribution. Coded by monty */ -#include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include #include #include #include diff --git a/configure.in b/configure.in index a5c2e7044fe..e685e811c2f 100644 --- a/configure.in +++ b/configure.in @@ -1837,12 +1837,23 @@ if test "$ac_cv_sizeof_off_t" -eq 0 then AC_MSG_ERROR("MySQL needs a off_t type.") fi + +# do we need #pragma interface/#pragma implementation ? +# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin +AC_MSG_CHECKING(the need for @%:@pragma interface/implementation) +# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't +# follow any standard), we'll use well-defined preprocessor macros: +AC_TRY_CPP([ +#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3) +#error USE_PRAGMA_IMPLEMENTATION +#endif +],AC_MSG_RESULT(no) ,AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION") + # This always gives a warning. Ignore it unless you are cross compiling AC_C_BIGENDIAN #---START: Used in for client configure # Check base type of last arg to accept MYSQL_TYPE_ACCEPT - #---END: # Figure out what type of struct rlimit to use with setrlimit MYSQL_TYPE_STRUCT_RLIMIT diff --git a/include/my_global.h b/include/my_global.h index c978bf82b3a..523ecfba74d 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -43,16 +43,11 @@ #define HAVE_ERRNO_AS_DEFINE #endif /* __CYGWIN__ */ -/* Determine when to use "#pragma interface" */ -#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3) +/* to make command line shorter we'll define USE_PRAGMA_INTERFACE here */ +#ifdef USE_PRAGMA_IMPLEMENTATION #define USE_PRAGMA_INTERFACE #endif -/* Determine when to use "#pragma implementation" */ -#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3) -#define USE_PRAGMA_IMPLEMENTATION -#endif - #if defined(i386) && !defined(__i386__) #define __i386__ #endif diff --git a/mysys/raid.cc b/mysys/raid.cc index 20e70d2d102..62587c438ca 100644 --- a/mysys/raid.cc +++ b/mysys/raid.cc @@ -70,8 +70,6 @@ tonu@mysql.com & monty@mysql.com */ -#include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index e58996d3c01..10712c2e3be 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -14,8 +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 - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index 2592d307e37..31e4e97c5c7 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -63,8 +63,6 @@ -Brian */ -#include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index 16e28e5ae85..07e69bfac80 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -38,8 +38,6 @@ TODO: -Brian */ -#include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/field.cc b/sql/field.cc index 292bbe80362..692f123097a 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -19,10 +19,11 @@ ** This file implements classes defined in field.h *****************************************************************************/ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "sql_select.h" #include #include diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 35a137df97b..33f7b6238b0 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -47,10 +47,12 @@ */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" + #ifdef HAVE_BERKELEY_DB #include #include diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index 109098948ac..5b1527aa210 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -15,11 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" #ifdef HAVE_BLACKHOLE_DB #include "ha_blackhole.h" diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index ad0e8819842..4fc0116a26a 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include "ha_heap.h" diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 2016f58083a..3f2e11e8bd1 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -28,10 +28,11 @@ have disables the InnoDB inlining in this file. */ in Windows? */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "slave.h" #ifdef HAVE_INNOBASE_DB diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index b074edf719d..afa7dffa5f4 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -14,10 +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 "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #ifdef HAVE_ISAM #include #include diff --git a/sql/ha_isammrg.cc b/sql/ha_isammrg.cc index f6fe1a49e9e..c0e6f665f08 100644 --- a/sql/ha_isammrg.cc +++ b/sql/ha_isammrg.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #ifdef HAVE_ISAM #include #ifndef MASTER diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 34e6c429a8f..d8608c6a599 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include #include "ha_myisam.h" diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index 1f9e6a71d16..edb3521470f 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include "ha_myisammrg.h" #ifndef MASTER diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index d361bec8fcc..a0080af1dfb 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -20,11 +20,12 @@ NDB Cluster */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" + #ifdef HAVE_NDBCLUSTER_DB #include #include "ha_ndbcluster.h" diff --git a/sql/handler.cc b/sql/handler.cc index d9db1afff7a..f14564b6629 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -17,10 +17,11 @@ /* Handler-calling-functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "ha_heap.h" #include "ha_myisam.h" #include "ha_myisammrg.h" diff --git a/sql/hash_filo.cc b/sql/hash_filo.cc index a16ff6ac7be..ec200768222 100644 --- a/sql/hash_filo.cc +++ b/sql/hash_filo.cc @@ -20,8 +20,9 @@ ** to usage. */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "hash_filo.h" diff --git a/sql/item.cc b/sql/item.cc index 96fa1a8fac4..c96794ff482 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -15,10 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" #include #include "my_dir.h" diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index b17c4a9fbf7..337ac949d35 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -17,10 +17,11 @@ /* This file defines all compare functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include "sql_select.h" diff --git a/sql/item_func.cc b/sql/item_func.cc index 2d16ef5e183..442ef15bba8 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -17,10 +17,11 @@ /* This file defines all numerical functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "slave.h" // for wait_for_master_pos #include #include diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 9dbc1724824..8b856d809d6 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -17,11 +17,11 @@ /* This file defines all spatial functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" #ifdef HAVE_SPATIAL #include diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 56b06cb02c4..5ca5caf6bdf 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -20,10 +20,11 @@ ** (This shouldn't be needed) */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #ifdef HAVE_OPENSSL #include diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 9bd9eff5ef7..ebc08545566 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -22,10 +22,11 @@ SUBSELECT TODO: (sql_select.h/sql_select.cc) */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "sql_select.h" inline Item * and_items(Item* cond, Item *item) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 5c34dc6a603..0e252259f53 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -17,11 +17,12 @@ /* Sum functions (COUNT, MIN...) */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" + Item_sum::Item_sum(List &list) :arg_count(list.elements) { diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index b7f9236ce46..a3cf69035f3 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -17,10 +17,11 @@ /* This file defines all time functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include diff --git a/sql/item_uniq.cc b/sql/item_uniq.cc index 8e9653aba88..7701bbbb63e 100644 --- a/sql/item_uniq.cc +++ b/sql/item_uniq.cc @@ -16,7 +16,8 @@ /* Compability file */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" diff --git a/sql/log_event.cc b/sql/log_event.cc index 866a7c21bb4..a4319f63b83 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -17,10 +17,11 @@ #ifndef MYSQL_CLIENT -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "slave.h" #include #endif /* MYSQL_CLIENT */ diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 4b6e56468d2..bd1befb436f 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -23,10 +23,11 @@ */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include #include "sql_select.h" diff --git a/sql/procedure.cc b/sql/procedure.cc index bd742f645d2..a0042dd879e 100644 --- a/sql/procedure.cc +++ b/sql/procedure.cc @@ -17,10 +17,11 @@ /* Procedures (functions with changes output of select) */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "procedure.h" #include "sql_analyse.h" // Includes procedure #ifdef USE_PROC_RANGE diff --git a/sql/protocol.cc b/sql/protocol.cc index 9a1a05591dd..6a17ae2f95b 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -19,10 +19,11 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024; diff --git a/sql/protocol_cursor.cc b/sql/protocol_cursor.cc index bb6a0eab2ee..b225e06ed32 100644 --- a/sql/protocol_cursor.cc +++ b/sql/protocol_cursor.cc @@ -19,10 +19,11 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include bool Protocol_cursor::send_fields(List *list, uint flag) diff --git a/sql/set_var.cc b/sql/set_var.cc index b89cdffd4cb..0fa9932dbbc 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -48,10 +48,11 @@ new attribute. */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include "slave.h" #include diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index df66b3c4228..fb5d0eb0a3f 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -23,10 +23,11 @@ ** - type set is out of optimization yet */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "procedure.h" #include "sql_analyse.h" #include diff --git a/sql/sql_class.cc b/sql/sql_class.cc index fff1e3a3b54..805db107370 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -22,10 +22,11 @@ ** *****************************************************************************/ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include #include diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc index 1cfa0eb8570..f21a109e95d 100644 --- a/sql/sql_crypt.cc +++ b/sql/sql_crypt.cc @@ -23,11 +23,12 @@ needs something like 'ssh'. */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" + SQL_CRYPT::SQL_CRYPT(const char *password) { ulong rand_nr[2]; diff --git a/sql/sql_list.cc b/sql/sql_list.cc index 219ff85946e..d57a7dfe4e3 100644 --- a/sql/sql_list.cc +++ b/sql/sql_list.cc @@ -15,11 +15,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" + list_node end_of_list; void free_list(I_List *list) diff --git a/sql/sql_map.cc b/sql/sql_map.cc index 408938e7639..aac44949d89 100644 --- a/sql/sql_map.cc +++ b/sql/sql_map.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #ifdef HAVE_MMAP #include #include diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc index 5631cf9dcef..024abb6c74b 100644 --- a/sql/sql_olap.cc +++ b/sql/sql_olap.cc @@ -28,10 +28,11 @@ #ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1 -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "sql_select.h" diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 38e54ed7104..0424cd8fdbb 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -17,10 +17,11 @@ /* mysql_select and join optimization */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "sql_select.h" #include diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 983c2d90a1d..ab2db4aaf53 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -16,10 +16,11 @@ /* This file is originally from the mysql distribution. Coded by monty */ -#include #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include #include #include #include diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 72c92a5c53a..0b84d1b5fb3 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -28,10 +28,11 @@ ** dynamic functions, so this shouldn't be a real problem. */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #ifdef HAVE_DLOPEN diff --git a/sql/tztime.cc b/sql/tztime.cc index 30ff25f080f..b5ebc9f350a 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -25,12 +25,11 @@ it creates unsolved link dependencies on some platforms. */ -#include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include #if !defined(TZINFO2SQL) && !defined(TESTTIME) #include "mysql_priv.h" #else From bfac85343fde7ad4ffbc0bd54d9f36053d574f69 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 5 Jun 2005 20:10:47 +0200 Subject: [PATCH 48/56] mtr_misc.pl, mtr_report.pl: Try kill all children to the mysql-test-run process when exiting mtr_process.pl: Added new function mtr_exit() that try kill all children to the mysql-test-run process when exiting mysql-test-run.pl: Try kill all children to the mysql-test-run process when exiting New --vardir caused problems on Windows Changed faulty calls to error() to mtr_error() mysql-test/mysql-test-run.pl: Try kill all children to the mysql-test-run process when exiting New --vardir caused problems on Windows Changed faulty calls to error() to mtr_error() mysql-test/lib/mtr_report.pl: Try kill all children to the mysql-test-run process when exiting mysql-test/lib/mtr_process.pl: Added new function mtr_exit() that try kill all children to the mysql-test-run process when exiting mysql-test/lib/mtr_misc.pl: Try kill all children to the mysql-test-run process when exiting --- mysql-test/lib/mtr_misc.pl | 2 +- mysql-test/lib/mtr_process.pl | 14 ++++++++++++++ mysql-test/lib/mtr_report.pl | 3 ++- mysql-test/mysql-test-run.pl | 14 ++++++++------ 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index 5f80864d1f7..efa1b3bec21 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -25,7 +25,7 @@ sub mtr_full_hostname () { if ( $hostname !~ /\./ ) { my $address= gethostbyname($hostname) - or die "Couldn't resolve $hostname : $!"; + or mtr_error("Couldn't resolve $hostname : $!"); my $fullname= gethostbyaddr($address, AF_INET); $hostname= $fullname if $fullname; } diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index 78758e54aa4..7bca422773c 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -17,6 +17,7 @@ sub mtr_spawn ($$$$$$); sub mtr_stop_mysqld_servers ($); sub mtr_kill_leftovers (); sub mtr_record_dead_children (); +sub mtr_exit ($); sub sleep_until_file_created ($$$); # static in C @@ -784,4 +785,17 @@ sub sleep_until_file_created ($$$) { } +############################################################################## +# +# When we exit, we kill off all children +# +############################################################################## + +sub mtr_exit ($) { + my $code= shift; + local $SIG{HUP} = 'IGNORE'; + kill('HUP', -$$); + exit($code); +} + 1; diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index cb41549422f..a258d139bb1 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -268,7 +268,8 @@ sub mtr_warning (@) { } sub mtr_error (@) { - die "mysql-test-run: *** ERROR: ",join(" ", @_),"\n"; + print STDERR "mysql-test-run: *** ERROR: ",join(" ", @_),"\n"; + mtr_exit(1); } sub mtr_debug (@) { diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 9d809593ea7..d4fb37c2f96 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -398,7 +398,7 @@ sub main () { } } - exit(0); + mtr_exit(0); } ############################################################################## @@ -568,7 +568,9 @@ sub command_line_setup () { $opt_vardir= "$glob_mysql_test_dir/var"; } - if ( $opt_vardir !~ m,^/, ) + # We make the path absolute, as the server will do a chdir() before usage + unless ( $opt_vardir =~ m,^/, or + ($glob_win32 and $opt_vardir =~ m,^[a-z]:/,i) ) { # Make absolute path, relative test dir $opt_vardir= "$glob_mysql_test_dir/$opt_vardir"; @@ -1295,9 +1297,9 @@ sub install_db ($$) { mtr_report("Installing \u$type Databases"); open(IN, $init_db_sql) - or error("Can't open $init_db_sql: $!"); + or mtr_error("Can't open $init_db_sql: $!"); open(OUT, ">", $init_db_sql_tmp) - or error("Can't write to $init_db_sql_tmp: $!"); + or mtr_error("Can't write to $init_db_sql_tmp: $!"); while () { chomp; @@ -1571,7 +1573,7 @@ sub report_failure_and_restart ($) { { stop_masters_slaves(); } - exit(1); + mtr_exit(1); } # FIXME always terminate on failure?! @@ -2270,5 +2272,5 @@ Options not yet described, or that I want to look into more with-openssl HERE - exit(1); + mtr_exit(1); } From 2da5ba707f445dd140897d158416d1acc9ccff98 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Jun 2005 10:56:20 +1000 Subject: [PATCH 49/56] Fix BUILD/check-cpu for powerpc BUILD/check-cpu: fix for powerpc linux --- BUILD/check-cpu | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/BUILD/check-cpu b/BUILD/check-cpu index 3ceb9c269fe..b970a4b9a5b 100755 --- a/BUILD/check-cpu +++ b/BUILD/check-cpu @@ -28,7 +28,7 @@ if test -r /proc/cpuinfo ; then fi # parse CPU flags - for flag in `$cpuinfo | grep 'flags' | sed -e 's/^flags.*: //'`; do + for flag in `$cpuinfo | grep '^flags' | sed -e 's/^flags.*: //'`; do eval cpu_flag_$flag=yes done else @@ -52,7 +52,6 @@ fi # detect CPU shortname as used by gcc options # this list is not complete, feel free to add further entries cpu_arg="" - case "$cpu_family--$model_name" in # DEC Alpha Alpha*EV6*) @@ -98,9 +97,13 @@ case "$cpu_family--$model_name" in cpu_arg=""; ;; - # + # + *ppc*) + cpu_arg='powerpc' + ;; + *powerpc*) - cpu_arg=`echo $model_name | sed -e"s/ppc//g"` + cpu_arg='powerpc' ;; # unknown @@ -111,7 +114,7 @@ esac if test -z "$cpu_arg"; then - echo "BUILD/check-cpu: Oops, could not findout what kind of cpu this machine is using." + echo "BUILD/check-cpu: Oops, could not find out what kind of cpu this machine is using." check_cpu_cflags="" return fi From 936b9319b8219daffab3bc6650a02801bf53c8bd Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Jun 2005 21:22:23 +0500 Subject: [PATCH 50/56] ctype_cp1250_ch.result, ctype_cp1250_ch.test: Adding test. ctype-win1250ch.c: Bug #9759 Empty result with 'LIKE' and cp1250_czech_cs Wrong min_sort_char fix. strings/ctype-win1250ch.c: Bug #9759 Empty result with 'LIKE' and cp1250_czech_cs Wrong min_sort_char fix. mysql-test/t/ctype_cp1250_ch.test: Adding test. mysql-test/r/ctype_cp1250_ch.result: Adding test. --- mysql-test/r/ctype_cp1250_ch.result | 12 ++++++++++++ mysql-test/t/ctype_cp1250_ch.test | 12 ++++++++++++ strings/ctype-win1250ch.c | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/ctype_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result index 62936b84caf..7b2ca7d7e0e 100644 --- a/mysql-test/r/ctype_cp1250_ch.result +++ b/mysql-test/r/ctype_cp1250_ch.result @@ -7,3 +7,15 @@ SELECT a, length(a), a='', a=' ', a=' ' FROM t1; a length(a) a='' a=' ' a=' ' 0 1 1 1 DROP TABLE t1; +CREATE TABLE t1 ( +popisek varchar(30) collate cp1250_general_ci NOT NULL default '', +PRIMARY KEY (`popisek`) +); +INSERT INTO t1 VALUES ('2005-01-1'); +SELECT * FROM t1 WHERE popisek = '2005-01-1'; +popisek +2005-01-1 +SELECT * FROM t1 WHERE popisek LIKE '2005-01-1'; +popisek +2005-01-1 +drop table t1; diff --git a/mysql-test/t/ctype_cp1250_ch.test b/mysql-test/t/ctype_cp1250_ch.test index 06aea7b9979..814da628fb7 100644 --- a/mysql-test/t/ctype_cp1250_ch.test +++ b/mysql-test/t/ctype_cp1250_ch.test @@ -10,3 +10,15 @@ CREATE TABLE t1 (a char(16)) character set cp1250 collate cp1250_czech_cs; INSERT INTO t1 VALUES (''); SELECT a, length(a), a='', a=' ', a=' ' FROM t1; DROP TABLE t1; + +# +# Bug#9759 Empty result with 'LIKE' and cp1250_czech_cs +# +CREATE TABLE t1 ( + popisek varchar(30) collate cp1250_general_ci NOT NULL default '', + PRIMARY KEY (`popisek`) +); +INSERT INTO t1 VALUES ('2005-01-1'); +SELECT * FROM t1 WHERE popisek = '2005-01-1'; +SELECT * FROM t1 WHERE popisek LIKE '2005-01-1'; +drop table t1; diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index d843971b93f..2a899dfd147 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -550,7 +550,7 @@ static uchar NEAR like_range_prefix_max_win1250ch[] = { 240, 242, 242, 245, 245, 245, 245, 247, 248, 251, 251, 251, 251, 253, 254, 255, }; -#define min_sort_char '\x00' +#define min_sort_char '\x20' #define max_sort_char '\xff' /* From d09d815649cd37ef87e8e31c713a186d1c283414 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Jun 2005 22:17:16 -0400 Subject: [PATCH 51/56] BUG#7967 Fix mysqlhotcopy --record-log-position BitKeeper/etc/ignore: Added scripts/mysqlhotcopy.sh.rej to the ignore list scripts/mysqlhotcopy.sh: BUG#7967 Use fetchrow_hashref() when parsing SHOW SLAVE STATUS so that --record-log-pos option will work with all versions from 3.23 forward and will not break again in the future if additional columns are added. --- .bzrignore | 1 + scripts/mysqlhotcopy.sh | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.bzrignore b/.bzrignore index c9f9f140366..174fc6020f2 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1052,3 +1052,4 @@ vio/test-ssl vio/test-sslclient vio/test-sslserver vio/viotest-ssl +scripts/mysqlhotcopy.sh.rej diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 632174dc41a..1c5cd6a4faf 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -746,9 +746,15 @@ sub record_log_pos { my ($file,$position) = get_row( $dbh, "show master status" ); die "master status is undefined" if !defined $file || !defined $position; - my ($master_host, undef, undef, undef, $log_file, $log_pos ) - = get_row( $dbh, "show slave status" ); - + my $row_hash = get_row_hash( $dbh, "show slave status" ); + my ($master_host, $log_file, $log_pos ); + if ( $dbh->{mysql_serverinfo} =~ /^3\.23/ ) { + ($master_host, $log_file, $log_pos ) + = @{$row_hash}{ qw / Master_Host Log_File Pos / }; + } else { + ($master_host, $log_file, $log_pos ) + = @{$row_hash}{ qw / Master_Host Master_Log_File Read_Master_Log_Pos / }; + } my $hostname = hostname(); $dbh->do( qq{ replace into $table_name @@ -773,6 +779,14 @@ sub get_row { return $sth->fetchrow_array(); } +sub get_row_hash { + my ( $dbh, $sql ) = @_; + + my $sth = $dbh->prepare($sql); + $sth->execute; + return $sth->fetchrow_hashref(); +} + sub scan_raid_dir { my ( $r_db_files, $data_dir, @raid_dir ) = @_; From af72f54b530247582f7f8e907a74d2d0d7ccadb8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Jun 2005 10:25:51 +0200 Subject: [PATCH 52/56] - BUG#10676: don't install "make_win_src_distribution" and "make_win_binary_distribution" when doing "make install" (they are not needed/useful) outside the build tree. Added "mysql_client_test" to the "MySQL-bench" RPM. - some small RPM spec file improvements (more variables than hard-coded values, cleanups) scripts/Makefile.am: - no need to install "make_win_src_distribution" and "make_win_binary_distribution" in "make install" (BUG#10676) support-files/mysql.spec.sh: - added mysql_client_test to the "bench" subpackage (BUG 10676) - use "mysqldatadir" variable instead of hard-coding the path multiple times - use the "mysqld_user" variable on all occasions a user name is referenced - removed (incomplete) Brazilian translations - removed redundant release tags from the subpackage descriptions --- scripts/Makefile.am | 3 +- support-files/mysql.spec.sh | 72 ++++++++++++++----------------------- 2 files changed, 28 insertions(+), 47 deletions(-) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e2ef1bba97c..7614148ae3e 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -33,8 +33,6 @@ bin_SCRIPTS = @server_scripts@ \ mysql_explain_log \ mysql_tableinfo \ mysqld_multi \ - make_win_src_distribution \ - make_win_binary_distribution \ mysql_create_system_tables EXTRA_SCRIPTS = make_binary_distribution.sh \ @@ -86,6 +84,7 @@ CLEANFILES = @server_scripts@ \ mysqldumpslow \ mysqld_multi \ make_win_src_distribution \ + make_win_binary_distribution \ mysql_create_system_tables SUPERCLEANFILES = mysqlbug diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index d023dfa980a..0b48af47389 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -4,8 +4,10 @@ %else %define release 0.glibc23 %endif +%define license GPL %define mysqld_user mysql %define server_suffix -standard +%define mysqldatadir /var/lib/mysql # We don't package all files installed into the build root by intention - # See BUG#998 for details. @@ -16,11 +18,9 @@ Name: MySQL Summary: MySQL: a very fast and reliable SQL database server Group: Applications/Databases -Summary(pt_BR): MySQL: Um servidor SQL rápido e confiável. -Group(pt_BR): Aplicações/Banco_de_Dados Version: @MYSQL_NO_DASH_VERSION@ Release: %{release} -License: GPL +License: %{license} Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz URL: http://www.mysql.com/ Packager: Lenz Grimmer @@ -54,11 +54,8 @@ news and information about the MySQL software. Also please see the documentation and the manual for more information. %package server -Release: %{release} Summary: MySQL: a very fast and reliable SQL database server Group: Applications/Databases -Summary(pt_BR): MySQL: Um servidor SQL rápido e confiável. -Group(pt_BR): Aplicações/Banco_de_Dados Requires: fileutils sh-utils Provides: msqlormysql mysql-server mysql MySQL Obsoletes: MySQL mysql mysql-server @@ -88,11 +85,8 @@ If you want to access and work with the database, you have to install package "MySQL-client" as well! %package client -Release: %{release} Summary: MySQL - Client Group: Applications/Databases -Summary(pt_BR): MySQL - Cliente -Group(pt_BR): Aplicações/Banco_de_Dados Obsoletes: mysql-client Provides: mysql-client @@ -101,11 +95,7 @@ This package contains the standard MySQL clients and administration tools. %{see_base} -%description client -l pt_BR -Este pacote contém os clientes padrão para o MySQL. - %package ndb-storage -Release: %{release} Summary: MySQL - ndbcluster storage engine Group: Applications/Databases @@ -119,7 +109,6 @@ with the MySQL Max server. %{see_base} %package ndb-management -Release: %{release} Summary: MySQL - ndbcluster storage engine management Group: Applications/Databases @@ -131,7 +120,6 @@ one computer in the cluster. %{see_base} %package ndb-tools -Release: %{release} Summary: MySQL - ndbcluster storage engine basic tools Group: Applications/Databases @@ -141,7 +129,6 @@ This package contains ndbcluster storage engine basic tools. %{see_base} %package ndb-extra -Release: %{release} Summary: MySQL - ndbcluster storage engine extra tools Group: Applications/Databases @@ -152,12 +139,9 @@ They should be used with caution. %{see_base} %package bench -Release: %{release} Requires: %{name}-client perl-DBI perl Summary: MySQL - Benchmarks and test system Group: Applications/Databases -Summary(pt_BR): MySQL - Medições de desempenho -Group(pt_BR): Aplicações/Banco_de_Dados Provides: mysql-bench Obsoletes: mysql-bench @@ -166,15 +150,9 @@ This package contains MySQL benchmark scripts and data. %{see_base} -%description bench -l pt_BR -Este pacote contém medições de desempenho de scripts e dados do MySQL. - %package devel -Release: %{release} Summary: MySQL - Development header files and libraries Group: Applications/Databases -Summary(pt_BR): MySQL - Medições de desempenho -Group(pt_BR): Aplicações/Banco_de_Dados Provides: mysql-devel Obsoletes: mysql-devel @@ -184,12 +162,7 @@ necessary to develop MySQL client applications. %{see_base} -%description devel -l pt_BR -Este pacote contém os arquivos de cabeçalho (header files) e bibliotecas -necessárias para desenvolver aplicações clientes do MySQL. - %package shared -Release: %{release} Summary: MySQL - Shared libraries Group: Applications/Databases @@ -198,7 +171,6 @@ This package contains the shared libraries (*.so*) which certain languages and applications need to dynamically load and use MySQL. %package Max -Release: %{release} Summary: MySQL - server with extended functionality Group: Applications/Databases Provides: mysql-Max @@ -222,12 +194,9 @@ the standard MySQL package. Please note that this is a dynamically linked binary! %package embedded -Release: %{release} Requires: %{name}-devel Summary: MySQL - embedded library Group: Applications/Databases -Summary(pt_BR): MySQL - Medições de desempenho -Group(pt_BR): Aplicações/Banco_de_Dados Obsoletes: mysql-embedded %description embedded @@ -271,7 +240,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ --libdir=%{_libdir} \ --sysconfdir=%{_sysconfdir} \ --datadir=%{_datadir} \ - --localstatedir=/var/lib/mysql \ + --localstatedir=%{mysqldatadir} \ --infodir=%{_infodir} \ --includedir=%{_includedir} \ --mandir=%{_mandir} \ @@ -311,7 +280,7 @@ mkdir -p $RBR%{_libdir}/mysql PATH=${MYSQL_BUILD_PATH:-/bin:/usr/bin} export PATH -# Build the 4.0 Max binary (includes BDB and UDFs and therefore +# Build the Max binary (includes BDB and UDFs and therefore # cannot be linked statically against the patched glibc) # Use gcc for C and C++ code (to avoid a dependency on libstdc++ and @@ -336,8 +305,7 @@ BuildMySQL "--enable-shared \ --with-comment=\"MySQL Community Edition - Max (GPL)\" \ --with-server-suffix='-Max'" -# Save everything for debug -# tar cf $RBR/all.tar . +make test # Save mysqld-max mv sql/mysqld sql/mysqld-max @@ -387,13 +355,15 @@ BuildMySQL "--disable-shared \ --without-openssl" nm --numeric-sort sql/mysqld > sql/mysqld.sym +make test + %install RBR=$RPM_BUILD_ROOT MBD=$RPM_BUILD_DIR/mysql-%{mysql_version} # Ensure that needed directories exists install -d $RBR%{_sysconfdir}/{logrotate.d,init.d} -install -d $RBR/var/lib/mysql/mysql +install -d $RBR%{mysqldatadir}/mysql install -d $RBR%{_datadir}/{sql-bench,mysql-test} install -d $RBR%{_includedir} install -d $RBR%{_libdir} @@ -445,7 +415,7 @@ then fi %post server -mysql_datadir=/var/lib/mysql +mysql_datadir=%{mysqldatadir} # Create data directory if needed if test ! -d $mysql_datadir; then mkdir -m755 $mysql_datadir; fi @@ -465,17 +435,17 @@ fi # Create a MySQL user. Do not report any problems if it already # exists. This is redhat specific and should be handled more portable -useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" mysql 2> /dev/null || true +useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" %{mysqld_user} 2> /dev/null || true # Change permissions so that the user that will run the MySQL daemon # owns all database files. -chown -R mysql $mysql_datadir +chown -R %{mysqld_user} $mysql_datadir # Initiate databases -mysql_install_db --rpm --user=mysql +%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user} # Change permissions again to fix any new files. -chown -R mysql $mysql_datadir +chown -R %{mysqld_user} $mysql_datadir # Fix permissions for the permission database so that only the user # can read them. @@ -675,9 +645,10 @@ fi %defattr(-, root, root, 0755) %attr(-, root, root) %{_datadir}/sql-bench %attr(-, root, root) %{_datadir}/mysql-test +%attr(755, root, root) %{_bindir}/mysql_client_test %attr(755, root, root) %{_bindir}/mysqlmanager -%attr(755, root, root) %{_bindir}/mysqlmanager-pwgen %attr(755, root, root) %{_bindir}/mysqlmanagerc +%attr(755, root, root) %{_bindir}/mysqlmanager-pwgen %files Max %defattr(-, root, root, 0755) @@ -692,6 +663,17 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Mon Jun 06 2005 Lenz Grimmer + +- added mysql_client_test to the "bench" subpackage (BUG 10676) + +* Wed Jun 01 2005 Lenz Grimmer + +- use "mysqldatadir" variable instead of hard-coding the path multiple times +- use the "mysqld_user" variable on all occasions a user name is referenced +- removed (incomplete) Brazilian translations +- removed redundant release tags from the subpackage descriptions + * Wed May 25 2005 Joerg Bruehe - Added a "make clean" between separate calls to "BuildMySQL". From c9914ac6ac456386aff36f948fa8036f066612bf Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Jun 2005 13:56:42 +0500 Subject: [PATCH 53/56] Bug#10253: compound index length and utf8 char set produces invalid query results mi_key.c: well_formed_length should be executed before space trimming, not after. ctype_utf8.test: ctype_utf8.result: adding test. myisam/mi_key.c: Bug#10253: ompound index length and utf8 char set produces invalid query results well_formed_length should be executed before space trimming, not after. mysql-test/r/ctype_utf8.result: adding test. adding test. mysql-test/t/ctype_utf8.test: adding test. --- myisam/mi_key.c | 6 +++--- mysql-test/r/ctype_utf8.result | 11 +++++++++++ mysql-test/t/ctype_utf8.test | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/myisam/mi_key.c b/myisam/mi_key.c index b7240f34538..6a8d88f1117 100644 --- a/myisam/mi_key.c +++ b/myisam/mi_key.c @@ -84,7 +84,8 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, pos= (byte*) record+keyseg->start; if (keyseg->flag & HA_SPACE_PACK) { - end=pos+length; + FIX_LENGTH(cs, pos, length, char_length); + end= pos + char_length; if (type != HA_KEYTYPE_NUM) { while (end > pos && end[-1] == ' ') @@ -95,8 +96,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, while (pos < end && pos[0] == ' ') pos++; } - length=(uint) (end-pos); - FIX_LENGTH(cs, pos, length, char_length); + char_length= (uint) (end - pos); store_key_length_inc(key,char_length); memcpy((byte*) key,(byte*) pos,(size_t) char_length); key+=char_length; diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index b7aa7c68b67..ac421ea1717 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -891,3 +891,14 @@ string create table t1 (a varchar(255)) default character set utf8; insert into t1 values (1.0); drop table t1; +create table t1 ( +id int not null, +city varchar(20) not null, +key (city(7),id) +) character set=utf8; +insert into t1 values (1,'Durban North'); +insert into t1 values (2,'Durban'); +select * from t1 where city = 'Durban'; +id city +2 Durban +drop table t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index bac6e60c302..a281558e5a1 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -731,3 +731,17 @@ select ifnull(NULL, _utf8'string'); create table t1 (a varchar(255)) default character set utf8; insert into t1 values (1.0); drop table t1; + +# +# Bug#10253 compound index length and utf8 char set +# produces invalid query results +# +create table t1 ( + id int not null, + city varchar(20) not null, + key (city(7),id) +) character set=utf8; +insert into t1 values (1,'Durban North'); +insert into t1 values (2,'Durban'); +select * from t1 where city = 'Durban'; +drop table t1; From 295a55423ba45ec915cb5e7203005416acedd889 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Jun 2005 05:10:18 -0400 Subject: [PATCH 54/56] Accepted openlogging --- BitKeeper/etc/logging_ok | 1 + 1 file changed, 1 insertion(+) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index ce1e179789e..343fb26c83a 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -47,6 +47,7 @@ dlenev@build.mysql.com dlenev@jabberwock.localdomain dlenev@mysql.com ejonore@mc03.ndb.mysql.com +elliot@mysql.com evgen@moonbone.(none) evgen@moonbone.local gbichot@bk-internal.mysql.com From 4da133cabf43b4c53f33f5d529b2b7d7b43af3d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Jun 2005 03:05:57 -0700 Subject: [PATCH 55/56] sql_select.cc, item_buff.cc, item.h: Fixed bug #11088: a crash for queries with GROUP BY a BLOB column + COUNT(DISTINCT...) due to an attempt to allocate a too large buffer for the BLOB field. Now the size of the buffer is limited by max_sort_length. group_by.test, group_by.result: Added a test case for bug #11088. mysql-test/r/group_by.result: Added a test case for bug #11088. mysql-test/t/group_by.test: Added a test case for bug #11088. sql/item.h: Fixed bug #11088: a crash for queries with GROUP BY a BLOB column + COUNT(DISTINCT...) due to an attempt to allocate a too large buffer for the BLOB fields. Now the size of the buffer is limited by max_sort_length. sql/item_buff.cc: Fixed bug #11088: a crash for queries with GROUP BY a BLOB column + COUNT(DISTINCT...) due to an attempt to allocate a too large buffer for the BLOB fields. Now the size of the buffer is limited by max_sort_length. sql/sql_select.cc: Fixed bug #11088: a crash for queries with GROUP BY a BLOB column + COUNT(DISTINCT...) due to an attempt to allocate a too large buffer for the BLOB fields. Now the size of the buffer is limited by max_sort_length. --- mysql-test/r/group_by.result | 11 +++++++++++ mysql-test/t/group_by.test | 17 +++++++++++++++++ sql/item.h | 4 ++-- sql/item_buff.cc | 9 +++++++-- sql/sql_select.cc | 2 +- 5 files changed, 38 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index b0c00a51722..3e082fa04e3 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -711,3 +711,14 @@ select min(b) from t1; min(b) 3000000000 drop table t1; +CREATE TABLE t1 (id int PRIMARY KEY, user_id int, hostname longtext); +INSERT INTO t1 VALUES +(1, 7, 'cache-dtc-af05.proxy.aol.com'), +(2, 3, 'what.ever.com'), +(3, 7, 'cache-dtc-af05.proxy.aol.com'), +(4, 7, 'cache-dtc-af05.proxy.aol.com'); +SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1 +WHERE hostname LIKE '%aol%' + GROUP BY hostname; +hostname no +cache-dtc-af05.proxy.aol.com 1 diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index fbd39019e6d..21d5abcc287 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -522,3 +522,20 @@ insert into t1 values(3000000000); select * from t1; select min(b) from t1; drop table t1; + +# +# Test for bug #11088: GROUP BY a BLOB colimn with COUNT(DISTINCT column1) +# + +CREATE TABLE t1 (id int PRIMARY KEY, user_id int, hostname longtext); + +INSERT INTO t1 VALUES + (1, 7, 'cache-dtc-af05.proxy.aol.com'), + (2, 3, 'what.ever.com'), + (3, 7, 'cache-dtc-af05.proxy.aol.com'), + (4, 7, 'cache-dtc-af05.proxy.aol.com'); + +SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1 + WHERE hostname LIKE '%aol%' + GROUP BY hostname; + diff --git a/sql/item.h b/sql/item.h index 2edbeef400c..8de2adeb730 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1118,7 +1118,7 @@ class Item_str_buff :public Item_buff Item *item; String value,tmp_value; public: - Item_str_buff(Item *arg) :item(arg),value(arg->max_length) {} + Item_str_buff(THD *thd, Item *arg); bool cmp(void); ~Item_str_buff(); // Deallocate String:s }; @@ -1385,7 +1385,7 @@ public: }; -extern Item_buff *new_Item_buff(Item *item); +extern Item_buff *new_Item_buff(THD *thd, Item *item); extern Item_result item_cmp_type(Item_result a,Item_result b); extern void resolve_const_item(THD *thd, Item **ref, Item *cmp_item); extern bool field_is_equal_to_item(Field *field,Item *item); diff --git a/sql/item_buff.cc b/sql/item_buff.cc index 1559cfe958e..2324205eb65 100644 --- a/sql/item_buff.cc +++ b/sql/item_buff.cc @@ -23,13 +23,13 @@ ** Create right type of item_buffer for an item */ -Item_buff *new_Item_buff(Item *item) +Item_buff *new_Item_buff(THD *thd, Item *item) { if (item->type() == Item::FIELD_ITEM && !(((Item_field *) item)->field->flags & BLOB_FLAG)) return new Item_field_buff((Item_field *) item); if (item->result_type() == STRING_RESULT) - return new Item_str_buff((Item_field *) item); + return new Item_str_buff(thd, (Item_field *) item); if (item->result_type() == INT_RESULT) return new Item_int_buff((Item_field *) item); return new Item_real_buff(item); @@ -42,12 +42,17 @@ Item_buff::~Item_buff() {} ** Return true if values have changed */ +Item_str_buff::Item_str_buff(THD *thd, Item *arg) + :item(arg), value(min(arg->max_length, thd->variables. max_sort_length)) +{} + bool Item_str_buff::cmp(void) { String *res; bool tmp; res=item->val_str(&tmp_value); + res->length(min(res->length(), value.alloced_length())); if (null_value != item->null_value) { if ((null_value= item->null_value)) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 0424cd8fdbb..5b1603b44e2 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8656,7 +8656,7 @@ alloc_group_fields(JOIN *join,ORDER *group) { for (; group ; group=group->next) { - Item_buff *tmp=new_Item_buff(*group->item); + Item_buff *tmp=new_Item_buff(join->thd, *group->item); if (!tmp || join->group_fields.push_front(tmp)) return TRUE; } From 8b15aba810c39e1ea5ca318c8f6ca9dd1d92df3b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Jun 2005 04:21:19 -0700 Subject: [PATCH 56/56] item_buff.cc: Removed an extra space char. sql/item_buff.cc: Removed an extra space char. --- sql/item_buff.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_buff.cc b/sql/item_buff.cc index 2324205eb65..f5e77862e1d 100644 --- a/sql/item_buff.cc +++ b/sql/item_buff.cc @@ -43,7 +43,7 @@ Item_buff::~Item_buff() {} */ Item_str_buff::Item_str_buff(THD *thd, Item *arg) - :item(arg), value(min(arg->max_length, thd->variables. max_sort_length)) + :item(arg), value(min(arg->max_length, thd->variables.max_sort_length)) {} bool Item_str_buff::cmp(void)