diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp index fccecc7fa3c..3f6b591cbdb 100644 --- a/VC++Files/sql/mysqld.dsp +++ b/VC++Files/sql/mysqld.dsp @@ -110,7 +110,7 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\dbug.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /debug /machine:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /debug /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe" # SUBTRACT LINK32 /pdb:none /debug diff --git a/configure.in b/configure.in index f3d785ff19e..9b0d41d0d8a 100644 --- a/configure.in +++ b/configure.in @@ -2661,6 +2661,9 @@ AC_SUBST(netware_dir) AC_SUBST(linked_netware_sources) AM_CONDITIONAL(HAVE_NETWARE, test "$netware_dir" = "netware") +# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS +export CC CXX CFLAGS CXXFLAGS LD LDFLAGS AR + if test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no" then AC_DEFINE(THREAD) diff --git a/include/config-netware.h b/include/config-netware.h index c4e63056353..3e145f566a1 100644 --- a/include/config-netware.h +++ b/include/config-netware.h @@ -57,6 +57,10 @@ extern "C" { #undef HAVE_CRYPT #endif /* HAVE_OPENSSL */ +/* Configure can't detect this because it uses AC_TRY_RUN */ +#undef HAVE_COMPRESS +#define HAVE_COMPRESS + /* include the old function apis */ #define USE_OLD_FUNCTIONS 1 diff --git a/include/m_string.h b/include/m_string.h index 27da759f2c7..7fc35dc2e48 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -225,7 +225,7 @@ extern long strtol(const char *str, char **ptr, int base); extern ulong strtoul(const char *str, char **ptr, int base); #endif -extern char *int2str(long val, char *dst, int radix, char upcase); +extern char *int2str(long val, char *dst, int radix, int upcase); extern char *int10_to_str(long val,char *dst,int radix); extern char *str2int(const char *src,int radix,long lower,long upper, long *val); diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 5f5060c7464..a27da6d870e 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -1740,7 +1740,7 @@ os_file_pread( os_n_file_reads++; -#ifdef HAVE_PREAD +#if defined(HAVE_PREAD) && !defined(HAVE_BROKEN_PREAD) os_mutex_enter(os_file_count_mutex); os_file_n_pending_preads++; os_mutex_exit(os_file_count_mutex); @@ -1815,7 +1815,7 @@ os_file_pwrite( os_n_file_writes++; -#ifdef HAVE_PWRITE +#if defined(HAVE_PWRITE) && !defined(HAVE_BROKEN_PREAD) os_mutex_enter(os_file_count_mutex); os_file_n_pending_pwrites++; os_mutex_exit(os_file_count_mutex); diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index 5f88122e730..345cd3ceb0c 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -421,7 +421,7 @@ err: } -/* returns 1 if str0 ~= /\/ */ +/* returns 1 if str0 ~= /\bstr1\b/ */ static int _ftb_strstr(const byte *s0, const byte *e0, const byte *s1, const byte *e1, CHARSET_INFO *cs) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 33adfe548da..cd86c69d8f0 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -400,7 +400,7 @@ ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of '' set global myisam_max_sort_file_size=4294967296; show global variables like 'myisam_max_sort_file_size'; Variable_name Value -myisam_max_sort_file_size 4294967296 +myisam_max_sort_file_size MAX_FILE_SIZE set global myisam_max_sort_file_size=default; select @@global.max_user_connections,@@local.max_join_size; @@global.max_user_connections @@session.max_join_size diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index ac88125965a..91e81c5dbe0 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -69,10 +69,10 @@ select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN B select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); -# bug#2708 crash +# bug#2708, bug#3870 crash select * from t1 where MATCH a,b AGAINST('"space model' IN BOOLEAN MODE); - + # boolean w/o index: select * from t1 where MATCH a AGAINST ("search" IN BOOLEAN MODE); diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index a1faa4a4f71..60ebeb045f5 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -291,6 +291,7 @@ set global ft_boolean_syntax = @@init_connect; # variables are set set global myisam_max_sort_file_size=4294967296; +--replace_result 4294967296 MAX_FILE_SIZE 2146435072 MAX_FILE_SIZE show global variables like 'myisam_max_sort_file_size'; set global myisam_max_sort_file_size=default; diff --git a/netware/mysqld_safe.c b/netware/mysqld_safe.c index a815497ac0f..8d4a5c4a296 100644 --- a/netware/mysqld_safe.c +++ b/netware/mysqld_safe.c @@ -67,6 +67,7 @@ void check_data_vol(); void check_setup(); void check_tables(); void mysql_start(int, char*[]); +void parse_setvar(char *arg); /****************************************************************************** @@ -321,7 +322,8 @@ void parse_args(int argc, char *argv[]) OPT_ERR_LOG, OPT_SAFE_LOG, OPT_MYSQLD, - OPT_HELP + OPT_HELP, + OPT_SETVAR }; static struct option options[] = @@ -337,6 +339,7 @@ void parse_args(int argc, char *argv[]) {"safe-log", required_argument, 0, OPT_SAFE_LOG}, {"mysqld", required_argument, 0, OPT_MYSQLD}, {"help", no_argument, 0, OPT_HELP}, + {"set-variable", required_argument, 0, OPT_SETVAR}, {0, 0, 0, 0} }; @@ -384,7 +387,11 @@ void parse_args(int argc, char *argv[]) case OPT_MYSQLD: strcpy(mysqld, optarg); break; - + + case OPT_SETVAR: + parse_setvar(optarg); + break; + case OPT_HELP: usage(); break; @@ -396,6 +403,25 @@ void parse_args(int argc, char *argv[]) } } +/* + parse_setvar(char *arg) + Pasrsing for port just to display the port num on the mysqld_safe screen +*/ +void parse_setvar(char *arg) +{ + char *pos; + + if ((pos= strindex(arg, "port"))) + { + for (; *pos && *pos != '='; pos++) ; + if (*pos) + strcpy(port, pos + 1); + } +} +/****************************************************************************** + + + /****************************************************************************** get_options() @@ -599,32 +625,32 @@ void check_tables() ******************************************************************************/ void mysql_start(int argc, char *argv[]) { - arg_list_t al; - int i, j, err; - struct stat info; - time_t cal; - struct tm lt; - char stamp[PATH_MAX]; - char skip; + arg_list_t al; + int i, j, err; + struct stat info; + time_t cal; + struct tm lt; + char stamp[PATH_MAX]; + char skip; // private options static char *private_options[] = { - "--autoclose", + "--autoclose", "--check-tables", "--help", - "--err-log=", - "--mysqld=", - NULL + "--err-log=", + "--mysqld=", + NULL }; - // args - init_args(&al); - add_arg(&al, "%s", mysqld); - - // parent args - for(i = 1; i < argc; i++) - { + // args + init_args(&al); + add_arg(&al, "%s", mysqld); + + // parent args + for(i = 1; i < argc; i++) + { skip = FALSE; // skip private arguments @@ -633,38 +659,42 @@ void mysql_start(int argc, char *argv[]) if(!strnicmp(argv[i], private_options[j], strlen(private_options[j]))) { skip = TRUE; + consoleprintf("The argument skipped is %s\n",argv[i]); break; } } - - if (!skip) add_arg(&al, "%s", argv[i]); - } - + + if (!skip) + { + add_arg(&al, "%s", argv[i]); + consoleprintf("The final argument is %s\n",argv[i]); + } + } // spawn - do - { - // check the database tables - if (checktables) check_tables(); - - // status + do + { + // check the database tables + if (checktables) check_tables(); + + // status time(&cal); localtime_r(&cal, <); strftime(stamp, PATH_MAX, "%d %b %Y %H:%M:%S", <); log("mysql started : %s\n", stamp); - - // spawn mysqld - spawn(mysqld, &al, TRUE, NULL, NULL, err_log); - } - while (!stat(pid_file, &info)); - - // status + + // spawn mysqld + spawn(mysqld, &al, TRUE, NULL, NULL, err_log); + } + while (!stat(pid_file, &info)); + + // status time(&cal); localtime_r(&cal, <); strftime(stamp, PATH_MAX, "%d %b %Y %H:%M:%S", <); log("mysql stopped : %s\n\n", stamp); - // free args - free_args(&al); + // free args + free_args(&al); } /****************************************************************************** diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 68ba488f3d5..f6102085021 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -302,10 +302,12 @@ do done # -# Fix some windows files +# Fix some windows files to avoid compiler warnings # -./extra/replace std:: "" -- $BASE/sql/sql_yacc.cpp +./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' > $BASE/sql/sql_yacc.cpp-new +mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp + unix_to_dos $BASE/README mv $BASE/README $BASE/README.txt diff --git a/strings/int2str.c b/strings/int2str.c index 39b38ef3e1b..be86e9735ab 100644 --- a/strings/int2str.c +++ b/strings/int2str.c @@ -34,7 +34,7 @@ char NEAR _dig_vec_lower[] = val - value to convert dst - points to buffer where string representation should be stored radix - radix of scale of notation - upcase - flag indicating that whenever we should use upper-case digits + upcase - set to 1 if we should use upper-case digits DESCRIPTION Converts the (long) integer value to its character form and moves it to @@ -52,34 +52,39 @@ char NEAR _dig_vec_lower[] = char * int2str(register long int val, register char *dst, register int radix, - char upcase) + int upcase) { char buffer[65]; register char *p; long int new_val; char *dig_vec= upcase ? _dig_vec_upper : _dig_vec_lower; - if (radix < 0) { - if (radix < -36 || radix > -2) return NullS; - if (val < 0) { + if (radix < 0) + { + if (radix < -36 || radix > -2) + return NullS; + if (val < 0) + { *dst++ = '-'; val = -val; } radix = -radix; - } else { - if (radix > 36 || radix < 2) return NullS; } - /* The slightly contorted code which follows is due to the - fact that few machines directly support unsigned long / and %. - Certainly the VAX C compiler generates a subroutine call. In - the interests of efficiency (hollow laugh) I let this happen - for the first digit only; after that "val" will be in range so - that signed integer division will do. Sorry 'bout that. - CHECK THE CODE PRODUCED BY YOUR C COMPILER. The first % and / - should be unsigned, the second % and / signed, but C compilers - tend to be extraordinarily sensitive to minor details of style. - This works on a VAX, that's all I claim for it. - */ + else if (radix > 36 || radix < 2) + return NullS; + + /* + The slightly contorted code which follows is due to the fact that + few machines directly support unsigned long / and %. Certainly + the VAX C compiler generates a subroutine call. In the interests + of efficiency (hollow laugh) I let this happen for the first digit + only; after that "val" will be in range so that signed integer + division will do. Sorry 'bout that. CHECK THE CODE PRODUCED BY + YOUR C COMPILER. The first % and / should be unsigned, the second + % and / signed, but C compilers tend to be extraordinarily + sensitive to minor details of style. This works on a VAX, that's + all I claim for it. + */ p = &buffer[sizeof(buffer)-1]; *p = '\0'; new_val=(ulong) val / (ulong) radix;