From e23018167b5f9f33d730ababd426fc766fd1a2e0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Nov 2003 12:38:09 +0300 Subject: [PATCH 1/8] Word Police law is abided mysql-test/t/range.test: Word Police memo is abided --- mysql-test/t/range.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index a8b7679457b..e09fa73256b 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -236,4 +236,4 @@ SELECT * FROM t1 WHERE a IN(1,2) AND b=5; DROP TABLE t1; -# we expect that optimizer will choose key on A +# we expect that optimizer will choose index on A From e6298f379e642a8e3867c7cb185ae5fa1615b497 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Nov 2003 02:23:13 +0500 Subject: [PATCH 2/8] compile-pentium-gcov: Stop the line wrapping for warnings. it needs for warnings statistic in code coverage BUILD/compile-pentium-gcov: Stop the line wrapping for warnings. it needs for warnings statistic in code coverage --- BUILD/compile-pentium-gcov | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD/compile-pentium-gcov b/BUILD/compile-pentium-gcov index 873d1d0d8e8..0bc7eb2a8fa 100755 --- a/BUILD/compile-pentium-gcov +++ b/BUILD/compile-pentium-gcov @@ -3,7 +3,7 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$pentium_cflags -O2 -fprofile-arcs -ftest-coverage" +extra_flags="$pentium_cflags -O2 -fprofile-arcs -ftest-coverage -fmessage-length=0 " extra_configs="$pentium_configs $debug_configs --disable-shared $static_link" . "$path/FINISH.sh" From 5d8b9b3c6b8987655e50ef4e289d4d3280b3da18 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Nov 2003 02:24:34 +0500 Subject: [PATCH 3/8] compile-pentium-gcov: Stop line wraping for compiler warnings. It needs for warnings statistic in code coverage BUILD/compile-pentium-gcov: Stop line wraping for compiler warnings. It needs for warnings statistic in code coverage --- BUILD/compile-pentium-gcov | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD/compile-pentium-gcov b/BUILD/compile-pentium-gcov index 05cb0bb0d78..a43bc829c20 100755 --- a/BUILD/compile-pentium-gcov +++ b/BUILD/compile-pentium-gcov @@ -3,7 +3,7 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage" +extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage -fmessage-length=0" extra_configs="$pentium_configs $debug_configs --disable-shared $static_link" extra_configs="$extra_configs --with-innodb --with-berkeley-db" From 25f9971aaac1d599856a3b3e1a2b5320b82c08b5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Nov 2003 14:35:08 +0200 Subject: [PATCH 4/8] Fix for Bug #1752 Wrong letter cases. Thanks to Daniel Convissor BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + scripts/mysql_fix_privilege_tables.sql | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index f642821747f..9dea6a7fa44 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -96,6 +96,7 @@ ranger@regul.home.lan root@x3.internalnet salle@geopard.(none) salle@geopard.online.bg +salle@vafla.online.bg sasha@mysql.sashanet.com serg@build.mysql2.com serg@serg.mylan diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 1120f5c89c5..2ea2e5b7373 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -101,7 +101,7 @@ SET @hadShowDbPriv:=0; SELECT @hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%'; ALTER TABLE user -ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER alter_priv, +ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Alter_priv, ADD Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv, ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv, ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, @@ -112,7 +112,7 @@ ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; -- Convert privileges so that users have similar privileges as before -UPDATE user SET show_db_priv= select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv where user<>"" AND @hadShowDbPriv = 0; +UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv=Process_priv, Create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=File_priv where user<>"" AND @hadShowDbPriv = 0; -- Add fields that can be used to limit number of questions and connections From 75392a0d2e4c7f95fa1490fed8203c9f2ffbee48 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Nov 2003 22:33:28 +0100 Subject: [PATCH 5/8] make error message more detailed --- sql/sql_handler.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index a19fcdc2d73..dd8dfb31163 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -232,8 +232,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, { if (err != HA_ERR_KEY_NOT_FOUND && err != HA_ERR_END_OF_FILE) { - sql_print_error("mysql_ha_read: Got error %d when reading table", - err); + sql_print_error("mysql_ha_read: Got error %d when reading table '%s'", + err, tables->real_name); table->file->print_error(err,MYF(0)); goto err; } From 194dbe1a9a53cd1b3f3614a8764f8c35587f70e0 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Nov 2003 19:37:54 -0400 Subject: [PATCH 6/8] fixed bug #1650 "mysql_config --libmysqd-libs misses libwrap" scripts/Makefile.am: added processing of @WRAPLIBS@ in scripts scripts/mysql_config.sh: added @WRAPLIBS@ to embedded_libs option line --- scripts/Makefile.am | 1 + scripts/mysql_config.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e846976eceb..d14d7f38deb 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -114,6 +114,7 @@ SUFFIXES = .sh -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\ -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ -e 's!@''LIBS''@!@LIBS@!' \ + -e 's!@''WRAPLIBS''@!@WRAPLIBS@!' \ -e 's!@''innodb_system_libs''@!@innodb_system_libs@!' \ -e 's!@''openssl_libs''@!@openssl_libs@!' \ -e 's!@''VERSION''@!@VERSION@!' \ diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 6b543bf4a07..051f3fa9c14 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -92,7 +92,7 @@ libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @openssl_libs@" libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` cflags="-I$pkgincludedir @CFLAGS@" include="-I$pkgincludedir" -embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @innodb_system_libs@" +embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_libs@" embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` # Remove some options that a client doesn't have to care about From b57a1dd22731b436c52bddd2fe4f368429ebb59c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Nov 2003 12:59:07 +0200 Subject: [PATCH 7/8] Safety fix for alarms on windows. mysys/thr_alarm.c: Safety fix for alarms on windows sql/mini_client.cc: Added comments --- mysys/thr_alarm.c | 3 ++- sql/mini_client.cc | 17 +++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index f51f27b7f51..564d46aca3a 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -638,7 +638,8 @@ bool thr_got_alarm(thr_alarm_t *alrm_ptr) void thr_end_alarm(thr_alarm_t *alrm_ptr) { thr_alarm_t alrm= *alrm_ptr; - if (alrm->crono) + /* alrm may be zero if thr_alarm aborted with an error */ + if (alrm && alrm->crono) { KillTimer(NULL, alrm->crono); alrm->crono = 0; diff --git a/sql/mini_client.cc b/sql/mini_client.cc index c7beeea37b8..cd56081e6a8 100644 --- a/sql/mini_client.cc +++ b/sql/mini_client.cc @@ -15,13 +15,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* - mini MySQL client to be included into the server to do server to server - commincation by Sasha Pachev + mini MySQL client to be included into the server to do server to server + commincation by Sasha Pachev - Note: all file-global symbols must begin with mc_ , even the static ones, just - in case we decide to make them external at some point - */ + Note: all file-global symbols must begin with mc_ , even the static + ones, just in case we decide to make them external at some point +*/ +#include #define DONT_USE_RAID #if defined(__WIN__) #include @@ -40,7 +41,6 @@ inline int local_thr_alarm(my_bool *A,int B __attribute__((unused)),ALARM *C __a #define thr_got_alarm(A) 0 #endif -#include #include #include #include @@ -597,6 +597,11 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user, sprintf(host_info=buff,ER(CR_TCP_CONNECTION),host); DBUG_PRINT("info",("Server name: '%s'. TCP sock: %d", host,port)); thr_alarm_init(&alarmed); + /* + We don't have to check status for thr_alarm as it's not fatal if + we didn't manage to set an alarm. (In this case the socket call + will just block for a while). + */ thr_alarm(&alarmed, net_read_timeout, &alarm_buff); sock = (my_socket) socket(AF_INET,SOCK_STREAM,0); thr_end_alarm(&alarmed); From 348416e930dd37137fc74f17c67d84d3e7274ce9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Nov 2003 13:06:32 +0200 Subject: [PATCH 8/8] Fix for service names on windows; Now we always put the service name last when we create a service myisam/mi_test2.c: Moved test so that resize_key_cache() is always tested mysys/mf_keycache.c: Fixed comment --- myisam/mi_test2.c | 4 ++-- mysys/mf_keycache.c | 2 +- sql/mysqld.cc | 14 ++++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/myisam/mi_test2.c b/myisam/mi_test2.c index 2a658ca2054..11253f1fdee 100644 --- a/myisam/mi_test2.c +++ b/myisam/mi_test2.c @@ -267,9 +267,9 @@ int main(int argc, char *argv[]) puts("got error from mi_extra(HA_EXTRA_NO_CACHE)"); goto end; } - if (key_cacheing) - resize_key_cache(key_cache_size*2); } + if (key_cacheing) + resize_key_cache(key_cache_size*2); if (!silent) printf("- Delete\n"); diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 4cb3681b8b8..977ca6b11a7 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -669,7 +669,7 @@ static int flush_key_blocks_int(File file, enum flush_type type) Flush all blocks for a specific file to disk SYNOPSIS - flush_all_key_blocks() + flush_key_blocks() file File descriptor type Type of flush operation diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 811984e50b4..5073f8e1c40 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1958,7 +1958,7 @@ extern "C" pthread_handler_decl(handle_shutdown,arg) #endif -const char *load_default_groups[]= { "mysqld","server",MYSQL_BASE_VERSION,0 }; +const char *load_default_groups[]= { "mysqld","server",MYSQL_BASE_VERSION,0,0}; bool open_log(MYSQL_LOG *log, const char *hostname, const char *opt_name, const char *extension, @@ -2561,7 +2561,7 @@ default_service_handling(char **argv, const char *extra_opt) { char path_and_service[FN_REFLEN+FN_REFLEN+32], *pos, *end; - end= path_and_service + sizeof(path_and_service)-1; + end= path_and_service + sizeof(path_and_service)-3; /* We have to quote filename if it contains spaces */ pos= add_quoted_string(path_and_service, file_path, end); @@ -2571,7 +2571,9 @@ default_service_handling(char **argv, *pos++= ' '; pos= add_quoted_string(pos, extra_opt, end); } - *pos= 0; // Ensure end null + /* We must have servicename last */ + *pos++= ' '; + strmake(pos, servicename, (uint) (end+2 - pos)); if (Service.got_service_option(argv, "install")) { @@ -2616,7 +2618,7 @@ int main(int argc, char **argv) if (Service.IsService(argv[1])) { /* start an optional service */ - load_default_groups[0]= argv[1]; + load_default_groups[3]= argv[1]; start_mode= 1; Service.Init(argv[1], mysql_service); return 0; @@ -2624,8 +2626,7 @@ int main(int argc, char **argv) } else if (argc == 3) /* install or remove any optional service */ { - if (!default_service_handling(argv, argv[2], argv[2], file_path, - argv[2])) + if (!default_service_handling(argv, argv[2], argv[2], file_path, "")) return 0; if (Service.IsService(argv[2])) { @@ -2637,6 +2638,7 @@ int main(int argc, char **argv) opt_argc= 2; // Skip service-name opt_argv=argv; start_mode= 1; + load_default_groups[3]= argv[2]; Service.Init(argv[2], mysql_service); return 0; }