From 8f739cd674ad03cc19f92038bb4e29dd7995a82f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Mar 2003 15:16:51 +0100 Subject: [PATCH 01/23] Do not silently do RESET MASTER when one does 'mysqldump --master-data' ; only do it if the user specifies --delete-master-logs (new option). Safer + fixes bug #159. client/client_priv.h: New option --delete-master-logs for mysqldump client/mysqldump.c: New option --delete-master-logs for mysqldump BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + client/client_priv.h | 3 ++- client/mysqldump.c | 25 +++++++++++++++++-------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 3f58a7aea48..a6699f7c515 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -5,6 +5,7 @@ bar@bar.mysql.r18.ru bar@bar.udmsearch.izhnet.ru bell@sanja.is.com.ua bk@admin.bk +guilhem@mysql.com heikki@donna.mysql.fi heikki@hundin.mysql.fi jani@hynda.mysql.fi diff --git a/client/client_priv.h b/client/client_priv.h index 56eaf311070..147670005f2 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -30,4 +30,5 @@ enum options { OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET, OPT_LOW_PRIORITY, OPT_AUTO_REPAIR, OPT_COMPRESS, OPT_DROP, OPT_LOCKS, OPT_KEYWORDS, OPT_DELAYED, OPT_OPTIMIZE, OPT_FTB, OPT_LTB, OPT_ENC, OPT_O_ENC, OPT_ESC, OPT_TABLES, - OPT_MASTER_DATA, OPT_AUTOCOMMIT, OPT_LOCAL_INFILE}; + OPT_MASTER_DATA, OPT_AUTOCOMMIT, OPT_LOCAL_INFILE, + OPT_DELETE_MASTER_LOGS}; diff --git a/client/mysqldump.c b/client/mysqldump.c index d7d54a13c57..34f01e1581b 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -73,7 +73,8 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick=0, extended_insert = 0, ignore=0,opt_drop=0,opt_keywords=0,opt_lock=0,opt_compress=0, opt_delayed=0,create_options=0,opt_quoted=0,opt_databases=0, opt_alldbs=0,opt_create_db=0,opt_first_slave=0, - opt_autocommit=0,opt_master_data,opt_disable_keys=0,opt_xml=0; + opt_autocommit=0,opt_master_data,opt_disable_keys=0,opt_xml=0, + opt_delete_master_logs=0; static MYSQL mysql_connection,*sock=0; static char insert_pat[12 * 1024],*opt_password=0,*current_user=0, *current_host=0,*path=0,*fields_terminated=0, @@ -101,6 +102,7 @@ static struct option long_options[] = {"debug", optional_argument, 0, '#'}, {"default-character-set", required_argument, 0, OPT_DEFAULT_CHARSET}, {"delayed-insert", no_argument, 0, OPT_DELAYED}, + {"delete-master-logs", no_argument, 0, OPT_DELETE_MASTER_LOGS}, {"disable-keys", no_argument, 0, 'K'}, {"extended-insert", no_argument, 0, 'e'}, {"fields-terminated-by", required_argument, 0, (int) OPT_FTB}, @@ -206,9 +208,12 @@ static void usage(void) --add-locks Add locks around insert statements.\n\ --allow-keywords Allow creation of column names that are keywords.\n\ --delayed-insert Insert rows with INSERT DELAYED.\n\ + --delete-master-logs Issue RESET MASTER on the master just after taking\n\ + the dump, and before unlocking tables.\n\ + This will automatically enable --first-slave.\n\ --master-data This will cause the master position and filename to \n\ - be appended to your output. This will automagically \n\ - enable --first-slave.\n\ + be appended to your output, before unlocking tables.\n\ + This will automatically enable --first-slave.\n\ -F, --flush-logs Flush logs file in server before starting dump.\n\ -f, --force Continue even if we get an sql-error.\n\ -h, --host=... Connect to host.\n"); @@ -317,6 +322,10 @@ static int get_options(int *argc,char ***argv) opt_master_data=1; opt_first_slave=1; break; + case OPT_DELETE_MASTER_LOGS: + opt_delete_master_logs=1; + opt_first_slave=1; + break; case OPT_AUTOCOMMIT: opt_autocommit=1; break; @@ -1489,6 +1498,11 @@ int main(int argc, char **argv) if (opt_first_slave) { + if (opt_delete_master_logs && mysql_query(sock, "FLUSH MASTER")) + { + my_printf_error(0, "Error: Couldn't execute 'FLUSH MASTER': %s", + MYF(0), mysql_error(sock)); + } if (opt_master_data) { if (mysql_query(sock, "SHOW MASTER STATUS") || @@ -1511,11 +1525,6 @@ int main(int argc, char **argv) mysql_free_result(master); } } - if (mysql_query(sock, "FLUSH MASTER")) - { - my_printf_error(0, "Error: Couldn't execute 'FLUSH MASTER': %s", - MYF(0), mysql_error(sock)); - } if (mysql_query(sock, "UNLOCK TABLES")) { my_printf_error(0, "Error: Couldn't execute 'UNLOCK TABLES': %s", From 3b0438c8dd343da6ff77480ce3a814dbc11a0e42 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Mar 2003 23:24:45 +0200 Subject: [PATCH 02/23] Fixed bug that binary log was not locked during a DELETE FROM TABLE_NAME; --- sql/sql_delete.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 278e98533c9..2372e908152 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -30,6 +30,7 @@ int generate_table(THD *thd, TABLE_LIST *table_list, TABLE *locked_table) char path[FN_REFLEN]; int error; TABLE **table_ptr; + my_bool lock_open_locked= 0; DBUG_ENTER("generate_table"); thd->proc_info="generate_table"; @@ -102,7 +103,7 @@ int generate_table(THD *thd, TABLE_LIST *table_list, TABLE *locked_table) error= ha_create_table(path,&create_info,1) ? -1 : 0; if (thd->locked_tables && reopen_tables(thd,1,0)) error= -1; - VOID(pthread_mutex_unlock(&LOCK_open)); + lock_open_locked= 1; // Unlock mutex before return } if (!error) { @@ -114,6 +115,8 @@ int generate_table(THD *thd, TABLE_LIST *table_list, TABLE *locked_table) } send_ok(&thd->net); // This should return record count } + if (lock_open_locked) + VOID(pthread_mutex_unlock(&LOCK_open)); DBUG_RETURN(error ? -1 : 0); } From f9df0feecbdd8c576d043731558a8d1b80b78be2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Mar 2003 14:49:43 +0200 Subject: [PATCH 03/23] A fix for a bug in MyISAM with large number of NULL columns and at least one BLOB column. --- myisam/mi_dynrec.c | 4 ++-- mysql-test/t/myisam.test | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c index c9fe493744d..4f321c268f1 100644 --- a/myisam/mi_dynrec.c +++ b/myisam/mi_dynrec.c @@ -62,8 +62,8 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record) extra=ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+ MI_DYN_DELETE_BLOCK_HEADER+1; - reclength=info->s->base.pack_reclength+ - _my_calc_total_blob_length(info,record)+ extra; + reclength= (info->s->base.pack_reclength+ info->s->base.pack_bits+ + _my_calc_total_blob_length(info,record)+ extra); if (reclength > MI_DYN_MAX_ROW_LENGTH) { my_errno=HA_ERR_TO_BIG_ROW; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 92f22d35b81..c9cb77d2a3a 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -244,7 +244,7 @@ int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974 int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982 int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990 int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998 -int, i999 int, i1000 int) row_format=dynamic; +int, i999 int, i1000 int, b blob) row_format=dynamic; insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -283,6 +283,6 @@ insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "Sergei"); drop table if exists t1; From f4305a899ade995cde96cfe137cca30b668192a8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Mar 2003 19:57:38 -0400 Subject: [PATCH 04/23] fix bug with parameters of LOAD DATA INFILE in exec_event BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + sql/log_event.cc | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 70aaa8d2a52..9d0489e34f8 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -90,6 +90,7 @@ tonu@volk.internalnet tonu@x153.internalnet tonu@x3.internalnet venu@work.mysql.com +vva@eagle.mysql.r18.ru vva@genie.(none) walrus@kishkin.ru walrus@mysql.com diff --git a/sql/log_event.cc b/sql/log_event.cc index e243a953c63..51d9bd74adc 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1858,6 +1858,11 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, String line_term(sql_ex.line_term,sql_ex.line_term_len); String line_start(sql_ex.line_start,sql_ex.line_start_len); String escaped(sql_ex.escaped,sql_ex.escaped_len); + ex.field_term= &field_term; + ex.enclosed= &enclosed; + ex.line_term= &line_term; + ex.line_start= &line_start; + ex.escaped= &escaped; ex.opt_enclosed = (sql_ex.opt_flags & OPT_ENCLOSED_FLAG); if (sql_ex.empty_flags & FIELD_TERM_EMPTY) From 45802e08b1ecb4a5d01ae9a0a24665d55df51f67 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Mar 2003 14:50:29 +0200 Subject: [PATCH 05/23] - Fix for bug #200 (added missing @WRAPLIBS@ to LIBS in libmysqld/examples/Makefile.am (thanks to Christian Hammers from Debian for pointing this out) libmysqld/examples/Makefile.am: - added missing @WRAPLIBS@ to LIBS --- libmysqld/examples/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am index 2b52b133133..f741ddf0191 100644 --- a/libmysqld/examples/Makefile.am +++ b/libmysqld/examples/Makefile.am @@ -10,7 +10,7 @@ link_sources: DEFS = -DEMBEDDED_LIBRARY INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir) \ -I$(top_srcdir) -I$(top_srcdir)/client $(openssl_includes) -LIBS = @LIBS@ +LIBS = @LIBS@ @WRAPLIBS@ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS) mysqltest_SOURCES = mysqltest.c From 3294aac1bf17f7abe25067382c51f127f44d319a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Mar 2003 11:28:20 -0500 Subject: [PATCH 06/23] Add new XDC file for NetWare pre-emption, drop old build scripts, libmysqld.def BitKeeper/deleted/.del-mysqld.xdc~1befdfee55e31716: Delete: netware/mysqld.xdc BitKeeper/deleted/.del-nwbootstrap~f3bc723dad4ed7e: Delete: netware/nwbootstrap BitKeeper/deleted/.del-nwconfigure~86da352b5e031ed9: Delete: netware/nwconfigure BitKeeper/deleted/.del-libmysqld.def~6ca0fa0537a3431c: Delete: netware/libmysqld.def --- netware/libmysqld.def | 65 -------------- netware/{mysqld.xdc => mysql.xdc} | Bin 128 -> 128 bytes netware/nwbootstrap | 145 ------------------------------ netware/nwconfigure | 23 ----- 4 files changed, 233 deletions(-) delete mode 100644 netware/libmysqld.def rename netware/{mysqld.xdc => mysql.xdc} (50%) delete mode 100755 netware/nwbootstrap delete mode 100644 netware/nwconfigure diff --git a/netware/libmysqld.def b/netware/libmysqld.def deleted file mode 100644 index c6615ee971c..00000000000 --- a/netware/libmysqld.def +++ /dev/null @@ -1,65 +0,0 @@ -LIBRARY LIBMYSQLD -DESCRIPTION 'MySQL 4.0 Embedded Server Library' -VERSION 4.0 -EXPORTS - mysql_server_end - mysql_server_init - mysql_use_result - mysql_thread_safe - mysql_thread_id - mysql_store_result - mysql_stat - mysql_shutdown - mysql_select_db - mysql_row_tell - mysql_row_seek - mysql_real_query - mysql_real_connect - mysql_query - mysql_ping - mysql_options - mysql_num_rows - mysql_num_fields - mysql_list_tables - mysql_list_processes - mysql_list_fields - mysql_list_dbs - mysql_kill - mysql_insert_id - mysql_init - mysql_info - mysql_get_server_info - mysql_get_proto_info - mysql_get_host_info - mysql_get_client_info - mysql_free_result - mysql_field_tell - mysql_field_count - mysql_field_seek - mysql_fetch_row - mysql_fetch_lengths - mysql_fetch_fields - mysql_fetch_field_direct - mysql_fetch_field - mysql_escape_string - mysql_real_escape_string - mysql_error - mysql_errno - mysql_eof - mysql_dump_debug_info - mysql_drop_db - mysql_debug - mysql_data_seek - mysql_create_db - mysql_character_set_name - mysql_change_user - mysql_connect - mysql_close - mysql_affected_rows - mysql_thread_init - mysql_thread_end - mysql_send_query - mysql_read_query_result - mysql_refresh - mysql_odbc_escape_string - myodbc_remove_escape diff --git a/netware/mysqld.xdc b/netware/mysql.xdc similarity index 50% rename from netware/mysqld.xdc rename to netware/mysql.xdc index 12a7f6ba2df41eccb047c2884088c022f9395540..a6c430f731455d7031ebd0a467b835fbbea28d7a 100644 GIT binary patch delta 23 RcmZo*Y+#&FAi&Ik3IHk*0u}%O delta 23 RcmZo*Y+#&FAi&6g3IHkb0u%rM diff --git a/netware/nwbootstrap b/netware/nwbootstrap deleted file mode 100755 index 3e4b03de0f5..00000000000 --- a/netware/nwbootstrap +++ /dev/null @@ -1,145 +0,0 @@ -#! /bin/sh - -# show executed commands -# set -x - -# stop on errors -set -e - -BD=`pwd` - -build=0 -build_debug=0 -skip_linux=0 - -# parse arguments -for arg do - case "$arg" in - --build) build=1 ;; - --build-debug) build_debug=1 ;; - --skip-linux) skip_linux=1 ;; - *) echo "$0: unrecognized option: $arg" ;; - esac -done - -# run the auto tools -autotools() -{ - for package in $BD $BD/innobase - do - echo "cd $package" - cd $package - rm -f config.cache - echo "aclocal" - aclocal - echo "autoheader" - autoheader - echo "libtoolize --force" - libtoolize --force - echo "aclocal" - aclocal - echo "automake --add-missing --force-missing" - automake --add-missing --force-missing - echo "autoconf" - autoconf - done - - cd $BD -} - -# check the source direcotry -echo "looking for \"$BD/sql/mysqld.cc\"..." -if test ! -r ./sql/mysqld.cc -then - echo "./netware/nwbootstrap must be started from the top source directory" - exit 1 -fi - -# clean -# make -j 2 -k distclean -rm -f NEW-RPMS/* -rm -f */.deps/*.P - -# make files writeable -chmod -R u+rw,g+rw . - -# skip linux? -if test $skip_linux -ne 1 -then - echo "starting linux build..." - - echo "autotools..." - autotools - - echo "configuring for linux..." - ./configure --without-docs --without-innodb - - echo "building for linux..." - make clean all - - echo "copying required linux binaries..." - rm -f */*.linux - cp extra/comp_err extra/comp_err.linux - cp libmysql/conf_to_src libmysql/conf_to_src.linux - cp libmysql/conf_to_src libmysql_r/conf_to_src.linux - cp sql/gen_lex_hash sql/gen_lex_hash.linux - cp strings/conf_to_src strings/conf_to_src.linux - - echo "cleaning linux build..." - make clean distclean -fi - -echo "starting netware build..." - -# remove stale Makefile.in.bk files -rm -rf Makefile.in.bk - -# start mw enviornment -chmod +x ./netware/nwconfigure -chmod +x ./netware/mw/mwenv -chmod +x ./netware/mw/mwasmnlm -chmod +x ./netware/mw/mwccnlm -chmod +x ./netware/mw/mwldnlm - -. ./netware/mw/mwenv - -# link nwconfigure -rm -f ./nwconfigure -ln ./netware/nwconfigure ./nwconfigure - -# save old builds from previous run -if test -e *.tar.gz -then - rm -f *.tar.gz.old - rename .tar.gz .tar.gz.old *.tar.gz -fi - -echo "autotools..." -autotools - -# debug build -if test $build_debug -eq 1 -then - echo "configuring for netware (debug)..." - ./nwconfigure --with-debug=full - - echo "building for netware (debug)..." - make clean bin-dist - - # mark the debug build - rename .tar.gz -debug.tar.gz *.tar.gz -fi - -# release build -if test $build -eq 1 -then - echo "configuring for netware..." - ./nwconfigure - - echo "building for netware..." - make clean bin-dist -fi - -echo "done" - - diff --git a/netware/nwconfigure b/netware/nwconfigure deleted file mode 100644 index aeb68ada5b8..00000000000 --- a/netware/nwconfigure +++ /dev/null @@ -1,23 +0,0 @@ -#! /bin/sh -CMD="\ - AR='mwldnlm' \ - AR_FLAGS='-type library -o' \ - AS='mwasmnlm' \ - CC='mwccnlm -gccincludes' \ - CFLAGS='-dialect c -proc 686 -bool on -relax_pointers -DUSE_OLD_FUNCTIONS' \ - CXX='mwccnlm -gccincludes' \ - CXXFLAGS='-dialect c++ -proc 686 -bool on -relax_pointers' \ - LD='mwldnlm' \ - LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -flags pseudopreemption' \ - RANLIB=: \ - STRIP=: \ - ./configure --host=i686-pc-netware $* \ - --without-docs \ - --enable-local-infile \ - --with-extra-charsets=all \ - --prefix=N:/mysql \ - " -#rm -f config.cache config.log config.status -echo $CMD -eval $CMD - From 241b6c058dc24f67687a6c9a5e6411066b6a5eca Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Apr 2003 18:19:15 +0200 Subject: [PATCH 07/23] Small-and-safe fix for bug #218: "LOAD DATA INFILE IGNORE is well logged, but read as LOAD DATA INFILE REPLACE" This was just bad && instead of &, but nasty consequences. This should be merged to 4.0 BUT it will not be automatic (some code has moved from log_event.h to log_event.cc, and log_event.cc has changed); please Merging Man, do 'bk grep REPLACE_FLAG' in 4.0/sql to find all the new places. sql/log_event.cc: & instead of && when testing flags sql/slave.cc: & instead of && when testing flags --- sql/log_event.cc | 6 +++--- sql/slave.cc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index c30d03adaf5..7c4c893a823 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -671,9 +671,9 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) fprintf(file, "LOAD DATA INFILE '%s' ", fname); - if(sql_ex.opt_flags && REPLACE_FLAG ) + if(sql_ex.opt_flags & REPLACE_FLAG ) fprintf(file," REPLACE "); - else if(sql_ex.opt_flags && IGNORE_FLAG ) + else if(sql_ex.opt_flags & IGNORE_FLAG ) fprintf(file," IGNORE "); fprintf(file, "INTO TABLE %s ", table_name); @@ -685,7 +685,7 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) if(!(sql_ex.empty_flags & ENCLOSED_EMPTY)) { - if(sql_ex.opt_flags && OPT_ENCLOSED_FLAG ) + if(sql_ex.opt_flags & OPT_ENCLOSED_FLAG ) fprintf(file," OPTIONALLY "); fprintf(file, " ENCLOSED BY "); pretty_print_char(file, sql_ex.enclosed); diff --git a/sql/slave.cc b/sql/slave.cc index 358a908e0cc..ac65bd2bdc3 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1100,9 +1100,9 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len) else { enum enum_duplicates handle_dup = DUP_IGNORE; - if(lev->sql_ex.opt_flags && REPLACE_FLAG) + if(lev->sql_ex.opt_flags & REPLACE_FLAG) handle_dup = DUP_REPLACE; - sql_exchange ex((char*)lev->fname, lev->sql_ex.opt_flags && + sql_exchange ex((char*)lev->fname, lev->sql_ex.opt_flags & DUMPFILE_FLAG ); String field_term(&lev->sql_ex.field_term, 1), enclosed(&lev->sql_ex.enclosed, 1), From 3258bb7248c11d319469a37d2e589b79302d424e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Apr 2003 22:49:40 +0200 Subject: [PATCH 08/23] Sprint task #856 : make table exclusion rules (in replication) apply to GRANT and REVOKE too. For example if replicate-wild-ignore-table=mysql.%, GRANT and REVOKE will not be replicated on the slave. --- sql/sql_acl.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index ee9d3f1c1ea..e8cbba8aefa 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -28,6 +28,9 @@ #include "mysql_priv.h" #include "sql_acl.h" #include "hash_filo.h" +#ifdef HAVE_REPLICATION +#include "sql_repl.h" //for tables_ok() +#endif #include #include #include @@ -2052,6 +2055,15 @@ int mysql_table_grant (THD *thd, TABLE_LIST *table_list, tables[0].lock_type=tables[1].lock_type=tables[2].lock_type=TL_WRITE; tables[0].db=tables[1].db=tables[2].db=(char*) "mysql"; +#ifdef HAVE_REPLICATION + /* + GRANT and REVOKE are applied the slave in/exclusion rules as they are + some kind of updates to the mysql.% tables. + */ + if (thd->slave_thread && table_rules_on && !tables_ok(0, tables)) + DBUG_RETURN(0); +#endif + if (open_and_lock_tables(thd,tables)) { // Should never happen close_thread_tables(thd); /* purecov: deadcode */ @@ -2214,6 +2226,16 @@ int mysql_grant (THD *thd, const char *db, List &list, tables[0].lock_type=tables[1].lock_type=TL_WRITE; tables[0].db=tables[1].db=(char*) "mysql"; tables[0].table=tables[1].table=0; + +#ifdef HAVE_REPLICATION + /* + GRANT and REVOKE are applied the slave in/exclusion rules as they are + some kind of updates to the mysql.% tables. + */ + if (thd->slave_thread && table_rules_on && !tables_ok(0, tables)) + DBUG_RETURN(0); +#endif + if (open_and_lock_tables(thd,tables)) { // This should never happen close_thread_tables(thd); /* purecov: deadcode */ From 584b4caa661aa0f0962cce45f0d54abd79847f3b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Apr 2003 11:29:10 +0300 Subject: [PATCH 09/23] Safer stack checking --- sql/mysqld.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c407fccf00b..bc5334ce674 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2105,7 +2105,7 @@ int main(int argc, char **argv) size_t stack_size= 0; pthread_attr_getstacksize(&connection_attrib, &stack_size); /* We must check if stack_size = 0 as Solaris 2.9 can return 0 here */ - if (stack_size && stack_size != thread_stack) + if (stack_size && stack_size < thread_stack) { if (global_system_variables.log_warnings) sql_print_error("Warning: Asked for %ld thread stack, but got %ld", From 68fc04c4236b57a3a83d5731fb991329d6be95ef Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Apr 2003 12:10:38 +0300 Subject: [PATCH 10/23] Portability fix (for AMD hammer) sql/log.cc: Portability fix (for hammer) --- sql/log.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/log.cc b/sql/log.cc index 5e5d5b9368e..f72917427b7 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1067,6 +1067,7 @@ void sql_print_error(const char *format,...) char buff[1024]; my_vsnprintf(buff,sizeof(buff)-1,format,args); DBUG_PRINT("error",("%s",buff)); + va_start(args,format); } #endif skr=time(NULL); From 2090bc6e4347fe69189302a5b520ae3051785746 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Apr 2003 13:07:42 +0300 Subject: [PATCH 11/23] Fixed bug in memory allocation that could affect 64 bit systems (affected hammer) mysys/my_vsnprintf.c: safety fix sql/log.cc: safety fix --- mysys/my_vsnprintf.c | 9 ++++++++- sql/ha_myisam.cc | 2 +- sql/log.cc | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mysys/my_vsnprintf.c b/mysys/my_vsnprintf.c index ab8edec4d7b..9bc33e28ba1 100644 --- a/mysys/my_vsnprintf.c +++ b/mysys/my_vsnprintf.c @@ -21,13 +21,18 @@ #include #include + int my_snprintf(char* to, size_t n, const char* fmt, ...) { + int result; va_list args; va_start(args,fmt); - return my_vsnprintf(to, n, fmt, args); + result= my_vsnprintf(to, n, fmt, args); + va_end(args); + return result; } + int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) { char *start=to, *end=to+n-1; @@ -79,6 +84,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) return (uint) (to - start); } + #ifdef MAIN static void my_printf(const char * fmt, ...) { @@ -92,6 +98,7 @@ static void my_printf(const char * fmt, ...) va_end(ar); } + int main() { diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 895558320fd..d0d68156bac 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -953,7 +953,7 @@ int ha_myisam::create(const char *name, register TABLE *form, &keydef, form->keys*sizeof(MI_KEYDEF), &keyseg, ((form->key_parts + form->keys) * sizeof(MI_KEYSEG)), - 0))) + NullS))) DBUG_RETURN(1); pos=form->key_info; diff --git a/sql/log.cc b/sql/log.cc index f72917427b7..d189f1f1fe3 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1067,6 +1067,7 @@ void sql_print_error(const char *format,...) char buff[1024]; my_vsnprintf(buff,sizeof(buff)-1,format,args); DBUG_PRINT("error",("%s",buff)); + va_end(args); va_start(args,format); } #endif From 1834b6ff4955a0e7f19638a1abd5de5ab9eaed73 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Apr 2003 13:21:39 +0300 Subject: [PATCH 12/23] Updated results after merge --- mysql-test/r/myisam.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 3a3558eedcb..9a653aff99e 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -246,7 +246,7 @@ int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974 int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982 int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990 int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998 -int, i999 int, i1000 int) row_format=dynamic; +int, i999 int, i1000 int, b blob) row_format=dynamic; insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -285,7 +285,7 @@ insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "Sergei"); drop table if exists t1; CREATE TABLE `t1` ( `post_id` mediumint(8) unsigned NOT NULL auto_increment, From aa588247c6fdeea329e72fc8b62563bab8707f76 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Apr 2003 21:51:14 +0600 Subject: [PATCH 13/23] test-transactions.sh: correct misprint in the test_update sql-bench/test-transactions.sh: correct misprint in the test_update --- sql-bench/test-transactions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-bench/test-transactions.sh b/sql-bench/test-transactions.sh index b081b89fb69..8f92633524f 100644 --- a/sql-bench/test-transactions.sh +++ b/sql-bench/test-transactions.sh @@ -252,7 +252,7 @@ sub test_update for ($id=0 ; $id < $opt_loop_count ; $id++) { - do_query($dbh,"update bench1 set updated=1 where idn=$id"); + do_query($dbh,"update $table set updated=1 where idn=$id"); } $dbh->commit if (!$auto_commit); From 4a1542d056456a872b94d9cece6f148687f24ea7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Apr 2003 12:54:08 -0400 Subject: [PATCH 14/23] added test for replication load data into temporary table with additional options sql/log_event.cc: fix bug #183 (Replication of temporary tables not working) --- mysql-test/r/rpl_loaddata.result | 11 +++++++++++ mysql-test/t/rpl_loaddata.test | 20 +++++++++++++++++++- sql/log_event.cc | 2 +- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/r/rpl_loaddata.result index 27f3d185f63..c1518e8e29a 100644 --- a/mysql-test/r/rpl_loaddata.result +++ b/mysql-test/r/rpl_loaddata.result @@ -6,8 +6,19 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; slave start; create table t1(a int not null auto_increment, b int, primary key(a) ); load data infile '../../std_data/rpl_loaddata.dat' into table t1; +create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60)); +load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' ignore 1 lines; +create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60)); +insert into t3 select * from t2; select * from t1; a b 1 10 2 15 +select * from t3; +day id category name +2003-02-22 2461 b a a a @ %  ' " a +2003-03-22 2161 c asdf +2003-04-22 2416 a bbbbb drop table t1; +drop table t2; +drop table t3; diff --git a/mysql-test/t/rpl_loaddata.test b/mysql-test/t/rpl_loaddata.test index d7fc2a10ca4..2acb67dfce2 100644 --- a/mysql-test/t/rpl_loaddata.test +++ b/mysql-test/t/rpl_loaddata.test @@ -1,16 +1,34 @@ # See if replication of a "LOAD DATA in an autoincrement column" # Honours autoincrement values # i.e. if the master and slave have the same sequence +# +# check replication of load data for temporary tables with additional parameters +# source include/master-slave.inc; create table t1(a int not null auto_increment, b int, primary key(a) ); load data infile '../../std_data/rpl_loaddata.dat' into table t1; + +create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60)); +#load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionaly enclosed by '%' escaped by '@' lines terminated by '\n%%\n' ignore 1 lines; + load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' ignore 1 lines; + +create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60)); +insert into t3 select * from t2; + save_master_pos; connection slave; sync_with_master; -select * from t1; + +select * from t1; +select * from t3; + connection master; + drop table t1; +drop table t2; +drop table t3; + save_master_pos; connection slave; sync_with_master; diff --git a/sql/log_event.cc b/sql/log_event.cc index bb885ead3df..c8eb4026120 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1881,7 +1881,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, ex.skip_lines = skip_lines; List field_list; set_fields(field_list); - thd->slave_proxy_id = thd->thread_id; + thd->slave_proxy_id = thread_id; if (net) { // mysql_load will use thd->net to read the file From 6376b0a8b8c6e2806ed5c63232b9379744eb8601 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Apr 2003 19:55:37 +0300 Subject: [PATCH 15/23] Fixed a bug when printing error messages. stdout and stderr were mixed wrongly sometimes. --- client/mysql.cc | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 377f4f08f63..d7aa0d1404d 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2405,31 +2405,32 @@ select_limit, max_join_size); static int put_info(const char *str,INFO_TYPE info_type,uint error) { + FILE *file= (info_type == INFO_ERROR ? stderr : stdout); static int inited=0; if (status.batch) { if (info_type == INFO_ERROR) { - (void) fflush(stdout); - fprintf(stderr,"ERROR"); + (void) fflush(file); + fprintf(file,"ERROR"); if (error) - (void) fprintf(stderr," %d",error); + (void) fprintf(file," %d",error); if (status.query_start_line && line_numbers) { - (void) fprintf(stderr," at line %lu",status.query_start_line); + (void) fprintf(file," at line %lu",status.query_start_line); if (status.file_name) - (void) fprintf(stderr," in file: '%s'", status.file_name); + (void) fprintf(file," in file: '%s'", status.file_name); } - (void) fprintf(stderr,": %s\n",str); - (void) fflush(stderr); + (void) fprintf(file,": %s\n",str); + (void) fflush(file); if (!ignore_errors) return 1; } else if (info_type == INFO_RESULT && verbose > 1) - tee_puts(str, stdout); + tee_puts(str, file); if (unbuffered) - fflush(stdout); + fflush(file); return info_type == INFO_ERROR ? -1 : 0; } if (!opt_silent || info_type == INFO_ERROR) @@ -2447,17 +2448,17 @@ put_info(const char *str,INFO_TYPE info_type,uint error) putchar('\007'); /* This should make a bell */ vidattr(A_STANDOUT); if (error) - (void) tee_fprintf(stderr, "ERROR %d: ", error); + (void) tee_fprintf(file, "ERROR %d: ", error); else - tee_puts("ERROR: ", stdout); + tee_puts("ERROR: ", file); } else vidattr(A_BOLD); - (void) tee_puts(str, stdout); + (void) tee_puts(str, file); vidattr(A_NORMAL); } if (unbuffered) - fflush(stdout); + fflush(file); return info_type == INFO_ERROR ? -1 : 0; } From 5b67416a0b7b42279cd5ddb8ef53c60f66d59761 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Apr 2003 14:19:09 -0400 Subject: [PATCH 16/23] add test file for rpl_loaddata.test --- mysql-test/std_data/rpl_loaddata2.dat | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 mysql-test/std_data/rpl_loaddata2.dat diff --git a/mysql-test/std_data/rpl_loaddata2.dat b/mysql-test/std_data/rpl_loaddata2.dat new file mode 100644 index 00000000000..7a3d4ea7695 --- /dev/null +++ b/mysql-test/std_data/rpl_loaddata2.dat @@ -0,0 +1,8 @@ +2003-01-21,6328,%a%,%aaaaa% +## +2003-02-22,2461,b,%a a a @@ @% @b ' " a% +## +2003-03-22,2161,%c%,%asdf% +## +2003-04-22,2416,%a%,%bbbbb% +## From dba3a0b03181126cfc46048396b96e5cd768fe5a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Apr 2003 21:19:11 +0300 Subject: [PATCH 17/23] After merge fix sql/log_event.cc: Fixed a wrong && test -> & --- sql/log_event.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 9ed672d8d4e..2040cebf17e 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1146,9 +1146,9 @@ Load_log_event::Load_log_event(THD* thd_arg, sql_exchange* ex, sql_ex.cached_new_format = -1; if (ex->dumpfile) - sql_ex.opt_flags |= DUMPFILE_FLAG; + sql_ex.opt_flags|= DUMPFILE_FLAG; if (ex->opt_enclosed) - sql_ex.opt_flags |= OPT_ENCLOSED_FLAG; + sql_ex.opt_flags|= OPT_ENCLOSED_FLAG; sql_ex.empty_flags = 0; @@ -1159,15 +1159,15 @@ Load_log_event::Load_log_event(THD* thd_arg, sql_exchange* ex, } if (!ex->field_term->length()) - sql_ex.empty_flags |= FIELD_TERM_EMPTY; + sql_ex.empty_flags|= FIELD_TERM_EMPTY; if (!ex->enclosed->length()) - sql_ex.empty_flags |= ENCLOSED_EMPTY; + sql_ex.empty_flags|= ENCLOSED_EMPTY; if (!ex->line_term->length()) - sql_ex.empty_flags |= LINE_TERM_EMPTY; + sql_ex.empty_flags|= LINE_TERM_EMPTY; if (!ex->line_start->length()) - sql_ex.empty_flags |= LINE_START_EMPTY; + sql_ex.empty_flags|= LINE_START_EMPTY; if (!ex->escaped->length()) - sql_ex.empty_flags |= ESCAPED_EMPTY; + sql_ex.empty_flags|= ESCAPED_EMPTY; skip_lines = ex->skip_lines; @@ -1860,9 +1860,8 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, char llbuff[22]; enum enum_duplicates handle_dup = DUP_IGNORE; if (sql_ex.opt_flags & REPLACE_FLAG) - handle_dup = DUP_REPLACE; - sql_exchange ex((char*)fname, sql_ex.opt_flags && - DUMPFILE_FLAG ); + handle_dup= DUP_REPLACE; + sql_exchange ex((char*)fname, sql_ex.opt_flags & DUMPFILE_FLAG); String field_term(sql_ex.field_term,sql_ex.field_term_len); String enclosed(sql_ex.enclosed,sql_ex.enclosed_len); String line_term(sql_ex.line_term,sql_ex.line_term_len); From ecd9e7129186ca1b8617c183a7cb2950ecaa0a78 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Apr 2003 21:19:13 +0300 Subject: [PATCH 18/23] log.cc: Fix bug number 224: do not call ha_report_binlog_offset_and_commit() when a MyISAM table is updated; this also makes CREATE TABLE not to commit an InnoDB transaction, even when binlogging is enabled sql/log.cc: Fix bug number 224: do not call ha_report_binlog_offset_and_commit() when a MyISAM table is updated; this also makes CREATE TABLE not to commit an InnoDB transaction, even when binlogging is enabled --- sql/log.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index 1e903613300..a2ed2b05d4e 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1120,9 +1120,16 @@ bool MYSQL_LOG::write(Log_event* event_info) the table handler commit here, protected by the LOCK_log mutex, because otherwise the transactions may end up in a different order in the table handler log! + + Note that we will NOT call ha_report_binlog_offset_and_commit() if + there are binlog events cached in the transaction cache. That is + because then the log event which we write to the binlog here is + not a transactional event. In versions < 4.0.13 before this fix this + caused an InnoDB transaction to be committed if in the middle there + was a MyISAM event! */ - if (file == &log_file) + if (file == &log_file && !my_b_tell(&thd->transaction.trans_log)) { /* LOAD DATA INFILE in AUTOCOMMIT=1 mode writes to the binlog From e8c9045eebb2aed64e795936bc4cb915b20b8d37 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Apr 2003 20:19:13 +0200 Subject: [PATCH 19/23] Explicit message to warn that logging (e.g. binary) is permanently turned off because of writing problems (such message would have been useful during a recent support task). --- sql/log.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index 1e903613300..2106cd9c3db 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -310,7 +310,10 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, DBUG_RETURN(0); err: - sql_print_error("Could not use %s for logging (error %d)", log_name, errno); + sql_print_error("Could not use %s for logging (error %d). \ +Turning logging off for the whole duration of the MySQL server process. \ +To turn it on again: fix the cause, \ +shutdown the MySQL server and restart it.", log_name, errno); if (file >= 0) my_close(file,MYF(0)); if (index_file_nr >= 0) From e7b3accb4882022e38df175007b27d53a820e8bc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Apr 2003 20:19:14 +0200 Subject: [PATCH 20/23] More honest --master-ssl* options description. As these do nothing yet, better say it and see no traffic on bugs@ and support@. --- sql/mysqld.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index bc5334ce674..6d86346455a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3379,23 +3379,27 @@ struct my_option my_long_options[] = (gptr*) &master_info_file, (gptr*) &master_info_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"master-ssl", OPT_MASTER_SSL, - "Turn SSL on for replication. Be warned that is this is a relatively new feature.", + "Planned to enable the slave to connect to the master using SSL. Does nothing yet.", (gptr*) &master_ssl, (gptr*) &master_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"master-ssl-key", OPT_MASTER_SSL_KEY, - "Master SSL keyfile name. Only applies if you have enabled master-ssl.", + "Master SSL keyfile name. Only applies if you have enabled master-ssl. Does \ +nothing yet.", (gptr*) &master_ssl_key, (gptr*) &master_ssl_key, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"master-ssl-cert", OPT_MASTER_SSL_CERT, - "Master SSL certificate file name. Only applies if you have enabled master-ssl.", + "Master SSL certificate file name. Only applies if you have enabled \ +master-ssl. Does nothing yet.", (gptr*) &master_ssl_cert, (gptr*) &master_ssl_cert, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"master-ssl-capath", OPT_MASTER_SSL_CAPATH, - "Master SSL CA path. Only applies if you have enabled master-ssl.", + "Master SSL CA path. Only applies if you have enabled master-ssl. \ +Does nothing yet.", (gptr*) &master_ssl_capath, (gptr*) &master_ssl_capath, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"master-ssl-cipher", OPT_MASTER_SSL_CIPHER, - "Master SSL cipher. Only applies if you have enabled master-ssl.", + "Master SSL cipher. Only applies if you have enabled master-ssl. \ +Does nothing yet.", (gptr*) &master_ssl_cipher, (gptr*) &master_ssl_capath, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"myisam-recover", OPT_MYISAM_RECOVER, From a31ff43462782e391e6073fd58984d08c11deced Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Apr 2003 02:54:07 +0600 Subject: [PATCH 21/23] crash-me.sh: add sorted_group_by parameter sql-bench/crash-me.sh: add sorted_group_by parameter --- sql-bench/crash-me.sh | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh index 61468d69fb1..ff649acdae4 100644 --- a/sql-bench/crash-me.sh +++ b/sql-bench/crash-me.sh @@ -2734,6 +2734,51 @@ assert("drop table crash_me_n $drop_attr"); +$key = 'sorted_group_by'; +$prompt = 'Group by always sorted'; +if (!defined($limits{$key})) +{ + save_incomplete($key,$prompt); + print "$prompt="; + safe_query_l($key,[ + "create table crash_me_t1 (a int not null, b int not null)", + "insert into crash_me_t1 values (1,1)", + "insert into crash_me_t1 values (1,2)", + "insert into crash_me_t1 values (3,1)", + "insert into crash_me_t1 values (3,2)", + "insert into crash_me_t1 values (2,2)", + "insert into crash_me_t1 values (2,1)", + "create table crash_me_t2 (a int not null, b int not null)", + "create index crash_me_t2_ind on crash_me_t2 (a)", + "insert into crash_me_t2 values (1,3)", + "insert into crash_me_t2 values (3,1)", + "insert into crash_me_t2 values (2,2)", + "insert into crash_me_t2 values (1,1)"]); + + my $bigqry = "select crash_me_t1.a,crash_me_t2.b from ". + "crash_me_t1,crash_me_t2 where crash_me_t1.a=crash_me_t2.a ". + "group by crash_me_t1.a,crash_me_t2.b"; + + my $limit='no'; + my $rs = get_recordset($key,$bigqry); + print_recordset($key,$rs); + if ( defined ($rs)) { + if (compare_recordset($key,$rs,[[1,1],[1,3],[2,2],[3,1]]) eq 0) + { + $limit='yes' + } + } else { + add_log($key,"error: ".$DBI::errstr); + } + + print "$limit\n"; + safe_query_l($key,["drop table crash_me_t1", + "drop table crash_me_t2"]); + save_config_data($key,$limit,$prompt); + +} else { + print "$prompt=$limits{$key} (cashed)\n"; +} # From a65aa6bce3115e7ba5b96c82c39430a9ef765a57 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Apr 2003 10:14:06 +0300 Subject: [PATCH 22/23] log.cc: Fix crash in previous bug fix log.cc reported by Rob Lyon if --skip-innodb is specified sql/log.cc: Fix crash in previous bug fix log.cc reported by Rob Lyon if --skip-innodb is specified --- sql/log.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index 2cb2e37be08..8a5aba5cd34 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1132,7 +1132,8 @@ bool MYSQL_LOG::write(Log_event* event_info) was a MyISAM event! */ - if (file == &log_file && !my_b_tell(&thd->transaction.trans_log)) + if (file == &log_file && opt_using_transactions + && !my_b_tell(&thd->transaction.trans_log)) { /* LOAD DATA INFILE in AUTOCOMMIT=1 mode writes to the binlog From 02270252fe018c8247d501f3bb1ee6a7f1016f07 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Apr 2003 17:43:54 +0200 Subject: [PATCH 23/23] Documented undocumented replication options, now that the manual is up-to-date. --- sql/mysqld.cc | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 6d86346455a..4ae248acb67 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3321,7 +3321,7 @@ struct my_option my_long_options[] = (gptr*) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"log-bin", OPT_BIN_LOG, - "Log queries in new binary format (for replication)", + "Log update queries in binary format", (gptr*) &opt_bin_logname, (gptr*) &opt_bin_logname, 0, GET_STR_ALLOC, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"log-bin-index", OPT_BIN_LOG_INDEX, @@ -3375,7 +3375,8 @@ struct my_option my_long_options[] = (gptr*) &master_retry_count, (gptr*) &master_retry_count, 0, GET_ULONG, REQUIRED_ARG, 3600*24, 0, 0, 0, 0, 0}, {"master-info-file", OPT_MASTER_INFO_FILE, - "The location of the file that remembers where we left off on the master during the replication process. The default is `master.info' in the data directory. You should not need to change this.", + "The location and name of the file that remembers the master and where the I/O replication \ +thread is in the master's binlogs.", (gptr*) &master_info_file, (gptr*) &master_info_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"master-ssl", OPT_MASTER_SSL, @@ -3498,10 +3499,13 @@ Does nothing yet.", {"rpl-recovery-rank", OPT_RPL_RECOVERY_RANK, "Undocumented", (gptr*) &rpl_recovery_rank, (gptr*) &rpl_recovery_rank, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"relay-log", OPT_RELAY_LOG, "Undocumented", + {"relay-log", OPT_RELAY_LOG, + "The location and name to use for relay logs", (gptr*) &opt_relay_logname, (gptr*) &opt_relay_logname, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"relay-log-index", OPT_RELAY_LOG_INDEX, "Undocumented", + {"relay-log-index", OPT_RELAY_LOG_INDEX, + "The location and name to use for the file that keeps a list of the last \ +relay logs", (gptr*) &opt_relaylog_index_name, (gptr*) &opt_relaylog_index_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing).", @@ -3563,10 +3567,14 @@ Does nothing yet.", {"skip-thread-priority", OPT_SKIP_PRIOR, "Don't give threads different priorities.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"relay-log-info-file", OPT_RELAY_LOG_INFO_FILE, "Undocumented", + {"relay-log-info-file", OPT_RELAY_LOG_INFO_FILE, + "The location and name of the file that remembers where the SQL replication \ +thread is in the relay logs", (gptr*) &relay_log_info_file, (gptr*) &relay_log_info_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR, "Undocumented", + {"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR, + "The location where the slave should put its temporary files when \ +replicating a LOAD DATA INFILE command", (gptr*) &slave_load_tmpdir, (gptr*) &slave_load_tmpdir, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"slave-skip-errors", OPT_SLAVE_SKIP_ERRORS, @@ -3892,7 +3900,7 @@ Does nothing yet.", (gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD, IO_SIZE, 0}, {"relay_log_space_limit", OPT_RELAY_LOG_SPACE_LIMIT, - "Max space to use for all relay logs", + "Maximum space to use for all relay logs", (gptr*) &relay_log_space_limit, (gptr*) &relay_log_space_limit, 0, GET_ULL, REQUIRED_ARG, 0L, 0L, (longlong) ULONG_MAX, 0, 1, 0},