From 0ed2e577318c5121ac3509ce16b829f37f02a8ed Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Wed, 25 May 2005 11:10:10 +0200 Subject: [PATCH 1/4] Use one err file for each master --- 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 fb90aaa7b59d7437e9a76bc668e4b57e74d35afa Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 25 May 2005 12:56:47 +0300 Subject: [PATCH 2/4] Cleanup during code review Faster detection of wrong table names (like PRN) on windows --- 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 83d430353ea7e95ad83807c7ba079a4eafbd2740 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 26 May 2005 12:09:14 +0200 Subject: [PATCH 3/4] Add ifdefs to control when "#pragma implementation" should be used Added some more ifdefs for "#pragma interface" --- 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 6c00006d2c4f0875054693fe9fc7a5a1fb6f75d6 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 26 May 2005 12:12:36 +0200 Subject: [PATCH 4/4] Fix icc compiler warning --- 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;