From f543ca9149632b4ed2f922ffcc46b2ba880d14b9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 May 2004 18:26:50 +0200 Subject: [PATCH 1/5] compatibility fix. warning removed --- sql/item_timefunc.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 638bbcf5b3f..ed950a33166 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -56,7 +56,7 @@ static bool get_interval_info(const char *str,uint length,uint count, { longlong value; for (value=0; str != end && isdigit(*str) ; str++) - value=value*10LL + (long) (*str - '0'); + value=value*LL(10) + (long) (*str - '0'); values[i]= value; while (str != end && !isdigit(*str)) str++; @@ -1015,9 +1015,9 @@ bool Item_date_add_interval::get_date(TIME *ltime, bool fuzzy_date) days--; sec+=3600*LL(24); } - ltime->second=sec % 60; - ltime->minute=sec/60 % 60; - ltime->hour=sec/3600; + ltime->second= (uint)(sec % 60); + ltime->minute= (uint)(sec/60 % 60); + ltime->hour= (uint)(sec/3600); daynr= calc_daynr(ltime->year,ltime->month,1) + days; if ((ulonglong) daynr >= 3652424) // Day number from year 0 to 9999-12-31 goto null_date; From 7e41bc959c70de89368bb5b1a487a1ace3c2a635 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 May 2004 14:36:23 +0200 Subject: [PATCH 2/5] don't rely on readdir() returning . and .. first --- sql/sql_base.cc | 8 +++++++- sql/sql_db.cc | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 9f1caca55bc..6bf0b0bd2ba 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2255,9 +2255,15 @@ static void mysql_rm_tmp_tables(void) ** Remove all SQLxxx tables from directory */ - for (idx=2 ; idx < (uint) dirp->number_off_files ; idx++) + for (idx=0 ; idx < (uint) dirp->number_off_files ; idx++) { file=dirp->dir_entry+idx; + + /* skiping . and .. */ + if (file->name[0] == '.' && (!file->name[1] || + (file->name[1] == '.' && !file->name[2]))) + continue; + if (!bcmp(file->name,tmp_file_prefix,tmp_file_prefix_length)) { sprintf(filePath,"%s%s",mysql_tmpdir,file->name); /* purecov: inspected */ diff --git a/sql/sql_db.cc b/sql/sql_db.cc index d91fdbaded0..7dd458a3b5d 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -237,7 +237,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, tot_list_next= &tot_list; - for (uint idx=2 ; + for (uint idx=0 ; idx < (uint) dirp->number_off_files && !thd->killed ; idx++) { @@ -245,6 +245,11 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, char *extension; DBUG_PRINT("info",("Examining: %s", file->name)); + /* skiping . and .. */ + if (file->name[0] == '.' && (!file->name[1] || + (file->name[1] == '.' && !file->name[2]))) + continue; + /* Check if file is a raid directory */ if ((isdigit(file->name[0]) || (file->name[0] >= 'a' && file->name[0] <= 'f')) && From ed3f472a126ded7be137156d9127fafc874cfc3d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 May 2004 15:48:40 +0200 Subject: [PATCH 3/5] Fix for Bug#3357 "If the statement is long, the error message is trunc and important info is lost"; in hard-coded replication messages, always put small-length info (error codes, explanation of the error) at the beginning, so that it is not cut by truncation if the query is very long (which happens if the query goes first). sql/log_event.cc: in hard-coded replication messages, always put small-length info (error codes, explanation of the error) at the beginning, so that it is not cut by truncation if the query is very long (which happens if the query goes first). --- sql/log_event.cc | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 9c8676192a1..7817ccff3d7 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1862,12 +1862,12 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) else { slave_print_error(rli,expected_error, - "query '%s' partially completed on the master \ + "query partially completed on the master \ (error on master: %d) \ and was aborted. There is a chance that your master is inconsistent at this \ point. If you are sure that your master is ok, run this query manually on the\ slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;\ - START SLAVE; .", thd->query, expected_error); + START SLAVE; . Query: '%s'", expected_error, thd->query); thd->query_error= 1; } goto end; @@ -1896,15 +1896,13 @@ point. If you are sure that your master is ok, run this query manually on the\ { slave_print_error(rli, 0, "\ -Query '%s' caused different errors on master and slave. \ +Query caused different errors on master and slave. \ Error on master: '%s' (%d), Error on slave: '%s' (%d). \ -Default database: '%s'", - query, +Default database: '%s'. Query: '%s'", ER_SAFE(expected_error), expected_error, actual_error ? thd->net.last_error: "no error", - actual_error, - print_slave_db_safe(db)); + actual_error, print_slave_db_safe(db), query); thd->query_error= 1; } /* @@ -1919,11 +1917,10 @@ Default database: '%s'", else if (thd->query_error || thd->fatal_error) { slave_print_error(rli,actual_error, - "Error '%s' on query '%s'. Default database: '%s'", + "Error '%s' on query. Default database: '%s'. Query: '%s'", (actual_error ? thd->net.last_error : "unexpected success or fatal error"), - query, - print_slave_db_safe(db)); + print_slave_db_safe(db), query); thd->query_error= 1; } } /* End of if (db_ok(... */ From 40dba5a82f0c52107715f4de6420fd3ba911ed68 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 May 2004 16:35:31 +0200 Subject: [PATCH 4/5] useless fixes for --report-password and --show-slave-auth-info (almost undocumented options), just for beauty of truth. sql/mysqld.cc: correcting sentence (even if option is not really usable, as it depends on report-user and report-password which are undocumented (and will stay like this)). sql/slave.cc: report password when you must report password. --- sql/mysqld.cc | 2 +- sql/slave.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 1bb76363d38..c1ea29caa88 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3674,7 +3674,7 @@ relay logs", "Change the value of a variable. Please note that this option is deprecated;you can set variables directly with --variable-name=value.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"show-slave-auth-info", OPT_SHOW_SLAVE_AUTH_INFO, - "Show user and password in SHOW SLAVE STATUS", + "Show user and password in SHOW SLAVE HOSTS on this master", (gptr*) &opt_show_slave_auth_info, (gptr*) &opt_show_slave_auth_info, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"concurrent-insert", OPT_CONCURRENT_INSERT, diff --git a/sql/slave.cc b/sql/slave.cc index 1facdd818db..c3cbcbab7b2 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1776,7 +1776,7 @@ int register_slave_on_master(MYSQL* mysql) packet.append((char)0); if (report_password) - net_store_data(&packet, report_user); + net_store_data(&packet, report_password); else packet.append((char)0); From e35921a11227223620013b9b3459798ac772204c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 May 2004 21:47:39 -0100 Subject: [PATCH 5/5] Fixes to Windows project files for 4.0.19 VC++Files/client/mysqlclient.dsp: Add strxnmov to project files VC++Files/mysql.dsw: Add dependency to prevent compile error --- VC++Files/client/mysqlclient.dsp | 26 +++++++++++++++----------- VC++Files/mysql.dsw | 3 +++ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/VC++Files/client/mysqlclient.dsp b/VC++Files/client/mysqlclient.dsp index 28693f32e95..77903eaac04 100644 --- a/VC++Files/client/mysqlclient.dsp +++ b/VC++Files/client/mysqlclient.dsp @@ -7,25 +7,25 @@ CFG=mysqlclient - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysqlclient.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysqlclient.mak" CFG="mysqlclient - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "mysqlclient - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "mysqlclient - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=xicl6.exe +CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "mysqlclient - Win32 Release" @@ -48,7 +48,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=xilink6.exe -lib +LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\mysqlclient.lib" @@ -72,11 +72,11 @@ LIB32=xilink6.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=xilink6.exe -lib +LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\mysqlclient.lib" -!ENDIF +!ENDIF # Begin Target @@ -228,7 +228,7 @@ SOURCE=..\mysys\mf_iocache2.c # ADD CPP /Od -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -482,6 +482,10 @@ SOURCE=..\strings\strxmov.c # End Source File # Begin Source File +SOURCE=..\strings\strxnmov.c +# End Source File +# Begin Source File + SOURCE=..\mysys\thr_mutex.c # End Source File # Begin Source File diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index d304ce5cc44..007b9eb61cf 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -38,6 +38,9 @@ Package=<5> Package=<4> {{{ + Begin Project Dependency + Project_Dep_Name mysys + End Project Dependency }}} ###############################################################################