diff options
72 files changed, 754 insertions, 285 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 9a092b84a8f..55b82e38d63 100644 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -71,4 +71,6 @@ else make=make fi -CXX=gcc +if test -z $CXX ; then + CXX=gcc +fi diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index add2ac86c81..b83eadcac63 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -276,7 +276,11 @@ if ($opt_stage <= 3) my $flags= ""; log_timestamp(); log_system("rm -fr mysql-3* mysql-4* $pwd/$host/*.tar.gz"); - log_system("nm -n sql/mysqld | gzip -9 -v 2>&1 > sql/mysqld.sym.gz | cat"); + # No need to add the debug symbols, if the binaries are not stripped (saves space) + unless ($opt_with_debug || $opt_no_strip) + { + log_system("nm -n sql/mysqld | gzip -9 -v 2>&1 > sql/mysqld.sym.gz | cat"); + } $flags.= "--no-strip" if ($opt_no_strip || $opt_with_debug); check_system("scripts/make_binary_distribution --tmp=$opt_tmp --suffix=$opt_suffix $flags",".tar.gz created"); diff --git a/Docs/manual_toc.html b/Docs/manual_toc.html new file mode 100644 index 00000000000..b9014e5efb9 --- /dev/null +++ b/Docs/manual_toc.html @@ -0,0 +1,9 @@ +<html> +<head> +<title>Place holder for manual_toc.html</title> +</head> +<body> +This is just a place holder for the autogenerated manual_toc.html +to make "make dist" happy. +</body> +</html> diff --git a/Makefile.am b/Makefile.am index 56aec377afb..b9e0e88ff77 100644 --- a/Makefile.am +++ b/Makefile.am @@ -79,6 +79,10 @@ init-db: all bin-dist: all $(top_builddir)/scripts/make_binary_distribution @MAKE_BINARY_DISTRIBUTION_OPTIONS@ +# Remove BK's "SCCS" subdirectories from source distribution +dist-hook: + rm -rf `find $(distdir) -type d -name SCCS` + tags: support-files/build-tags .PHONY: init-db bin-dist diff --git a/bdb/dist/s_symlink b/bdb/dist/s_symlink index 70efa445521..8c0e12dedd0 100755 --- a/bdb/dist/s_symlink +++ b/bdb/dist/s_symlink @@ -28,46 +28,46 @@ build db_stat/tags ../dist/tags build db_upgrade/tags ../dist/tags build db_verify/tags ../dist/tags build dbm/tags ../dist/tags -build docs_src/api_cxx/Makefile ../api_c/Makefile -build docs_src/api_cxx/m4.seealso ../api_c/m4.seealso -build docs_src/api_cxx/spell.ok ../api_c/spell.ok -build docs_src/api_java/Makefile ../api_c/Makefile -build docs_src/api_java/java_index.so ../api_cxx/cxx_index.so -build docs_src/api_java/m4.seealso ../api_c/m4.seealso -build docs_src/api_java/spell.ok ../api_c/spell.ok -build docs_src/api_tcl/spell.ok ../api_c/spell.ok -build docs_src/ref/am/spell.ok ../spell.ok -build docs_src/ref/am_conf/spell.ok ../spell.ok -build docs_src/ref/arch/spell.ok ../spell.ok -build docs_src/ref/build_unix/spell.ok ../spell.ok -build docs_src/ref/build_vxworks/spell.ok ../spell.ok -build docs_src/ref/build_win/spell.ok ../spell.ok -build docs_src/ref/cam/spell.ok ../spell.ok -build docs_src/ref/debug/spell.ok ../spell.ok -build docs_src/ref/distrib/spell.ok ../spell.ok -build docs_src/ref/dumpload/spell.ok ../spell.ok -build docs_src/ref/env/spell.ok ../spell.ok -build docs_src/ref/install/spell.ok ../spell.ok -build docs_src/ref/intro/spell.ok ../spell.ok -build docs_src/ref/java/spell.ok ../spell.ok -build docs_src/ref/lock/spell.ok ../spell.ok -build docs_src/ref/log/spell.ok ../spell.ok -build docs_src/ref/mp/spell.ok ../spell.ok -build docs_src/ref/perl/spell.ok ../spell.ok -build docs_src/ref/program/spell.ok ../spell.ok -build docs_src/ref/refs/spell.ok ../spell.ok -build docs_src/ref/rpc/spell.ok ../spell.ok -build docs_src/ref/sendmail/spell.ok ../spell.ok -build docs_src/ref/simple_tut/spell.ok ../spell.ok -build docs_src/ref/tcl/spell.ok ../spell.ok -build docs_src/ref/test/spell.ok ../spell.ok -build docs_src/ref/transapp/spell.ok ../spell.ok -build docs_src/ref/txn/spell.ok ../spell.ok -build docs_src/ref/upgrade.2.0/spell.ok ../spell.ok -build docs_src/ref/upgrade.3.0/spell.ok ../spell.ok -build docs_src/ref/upgrade.3.1/spell.ok ../spell.ok -build docs_src/ref/upgrade.3.2/spell.ok ../spell.ok -build docs_src/ref/xa/spell.ok ../spell.ok +# build docs_src/api_cxx/Makefile ../api_c/Makefile +# build docs_src/api_cxx/m4.seealso ../api_c/m4.seealso +# build docs_src/api_cxx/spell.ok ../api_c/spell.ok +# build docs_src/api_java/Makefile ../api_c/Makefile +# build docs_src/api_java/java_index.so ../api_cxx/cxx_index.so +# build docs_src/api_java/m4.seealso ../api_c/m4.seealso +# build docs_src/api_java/spell.ok ../api_c/spell.ok +# build docs_src/api_tcl/spell.ok ../api_c/spell.ok +# build docs_src/ref/am/spell.ok ../spell.ok +# build docs_src/ref/am_conf/spell.ok ../spell.ok +# build docs_src/ref/arch/spell.ok ../spell.ok +# build docs_src/ref/build_unix/spell.ok ../spell.ok +# build docs_src/ref/build_vxworks/spell.ok ../spell.ok +# build docs_src/ref/build_win/spell.ok ../spell.ok +# build docs_src/ref/cam/spell.ok ../spell.ok +# build docs_src/ref/debug/spell.ok ../spell.ok +# build docs_src/ref/distrib/spell.ok ../spell.ok +# build docs_src/ref/dumpload/spell.ok ../spell.ok +# build docs_src/ref/env/spell.ok ../spell.ok +# build docs_src/ref/install/spell.ok ../spell.ok +# build docs_src/ref/intro/spell.ok ../spell.ok +# build docs_src/ref/java/spell.ok ../spell.ok +# build docs_src/ref/lock/spell.ok ../spell.ok +# build docs_src/ref/log/spell.ok ../spell.ok +# build docs_src/ref/mp/spell.ok ../spell.ok +# build docs_src/ref/perl/spell.ok ../spell.ok +# build docs_src/ref/program/spell.ok ../spell.ok +# build docs_src/ref/refs/spell.ok ../spell.ok +# build docs_src/ref/rpc/spell.ok ../spell.ok +# build docs_src/ref/sendmail/spell.ok ../spell.ok +# build docs_src/ref/simple_tut/spell.ok ../spell.ok +# build docs_src/ref/tcl/spell.ok ../spell.ok +# build docs_src/ref/test/spell.ok ../spell.ok +# build docs_src/ref/transapp/spell.ok ../spell.ok +# build docs_src/ref/txn/spell.ok ../spell.ok +# build docs_src/ref/upgrade.2.0/spell.ok ../spell.ok +# build docs_src/ref/upgrade.3.0/spell.ok ../spell.ok +# build docs_src/ref/upgrade.3.1/spell.ok ../spell.ok +# build docs_src/ref/upgrade.3.2/spell.ok ../spell.ok +# build docs_src/ref/xa/spell.ok ../spell.ok build env/tags ../dist/tags build examples_c/tags ../dist/tags build examples_cxx/tags ../dist/tags diff --git a/client/client_priv.h b/client/client_priv.h index b8181245be2..85c99951532 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -37,4 +37,5 @@ enum options { OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET, OPT_SELECT_LIMIT, OPT_MAX_JOIN_SIZE, OPT_SSL_SSL, OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_SHUTDOWN_TIMEOUT, OPT_LOCAL_INFILE, + OPT_DELETE_MASTER_LOGS, OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION, OPT_FRM }; 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; } diff --git a/client/mysqldump.c b/client/mysqldump.c index 7b7c60c3c56..3a66e49a795 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -36,7 +36,7 @@ ** Added --single-transaction option 06/06/2002 by Peter Zaitsev */ -#define DUMP_VERSION "9.07" +#define DUMP_VERSION "9.08" #include <my_global.h> #include <my_sys.h> @@ -77,7 +77,8 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick=0, extended_insert = 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, - tty_password=0,opt_single_transaction=0; + opt_delete_master_logs=0, tty_password=0, + opt_single_transaction=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, @@ -129,6 +130,9 @@ static struct my_option my_long_options[] = {"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED.", (gptr*) &opt_delayed, (gptr*) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"delete-master-logs", OPT_DELETE_MASTER_LOGS, + "Delete logs on master after backup. This will automagically enable --first-slave.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"disable-keys", 'K', "'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", (gptr*) &opt_disable_keys, (gptr*) &opt_disable_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -318,15 +322,20 @@ static void write_footer(FILE *sql_file) fputs("\n", sql_file); } /* write_footer */ + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { - switch(optid) { + switch (optid) { case OPT_MASTER_DATA: 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 'p': if (argument) { @@ -1431,6 +1440,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") || @@ -1452,9 +1466,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", MYF(0), mysql_error(sock)); diff --git a/include/my_global.h b/include/my_global.h index 39b6cada0e3..b6b2dfcda32 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -19,6 +19,11 @@ #ifndef _global_h #define _global_h +#ifndef EMBEDDED_LIBRARY +#define HAVE_REPLICATION +#define HAVE_EXTERNAL_CLIENT +#endif + #if defined( __EMX__) && !defined( MYSQL_SERVER) /* moved here to use below VOID macro redefinition */ #define INCL_BASE diff --git a/innobase/btr/Makefile.am b/innobase/btr/Makefile.am index 6e3dd4fb007..ed61facb695 100644 --- a/innobase/btr/Makefile.am +++ b/innobase/btr/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libbtr.a +noinst_LIBRARIES = libbtr.a libbtr_a_SOURCES = btr0btr.c btr0cur.c btr0pcur.c btr0sea.c diff --git a/innobase/buf/Makefile.am b/innobase/buf/Makefile.am index b1463c2220e..3f56c8b02d7 100644 --- a/innobase/buf/Makefile.am +++ b/innobase/buf/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libbuf.a +noinst_LIBRARIES = libbuf.a libbuf_a_SOURCES = buf0buf.c buf0flu.c buf0lru.c buf0rea.c diff --git a/innobase/com/Makefile.am b/innobase/com/Makefile.am index 27ae396bc6e..a3d2f8a76c6 100644 --- a/innobase/com/Makefile.am +++ b/innobase/com/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libcom.a +noinst_LIBRARIES = libcom.a libcom_a_SOURCES = com0com.c com0shm.c diff --git a/innobase/data/Makefile.am b/innobase/data/Makefile.am index 0e502708e85..eeb6f129de0 100644 --- a/innobase/data/Makefile.am +++ b/innobase/data/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libdata.a +noinst_LIBRARIES = libdata.a libdata_a_SOURCES = data0data.c data0type.c diff --git a/innobase/dict/Makefile.am b/innobase/dict/Makefile.am index 693048b6784..0034d2f8f1e 100644 --- a/innobase/dict/Makefile.am +++ b/innobase/dict/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libdict.a +noinst_LIBRARIES = libdict.a libdict_a_SOURCES = dict0boot.c dict0crea.c dict0dict.c dict0load.c\ dict0mem.c diff --git a/innobase/dyn/Makefile.am b/innobase/dyn/Makefile.am index 79c0000868c..ec33a3c18a9 100644 --- a/innobase/dyn/Makefile.am +++ b/innobase/dyn/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libdyn.a +noinst_LIBRARIES = libdyn.a libdyn_a_SOURCES = dyn0dyn.c diff --git a/innobase/eval/Makefile.am b/innobase/eval/Makefile.am index 5dd0eab4c9b..aebffb91be3 100644 --- a/innobase/eval/Makefile.am +++ b/innobase/eval/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libeval.a +noinst_LIBRARIES = libeval.a libeval_a_SOURCES = eval0eval.c eval0proc.c diff --git a/innobase/fil/Makefile.am b/innobase/fil/Makefile.am index a9473fdb762..dc0baff7d1a 100644 --- a/innobase/fil/Makefile.am +++ b/innobase/fil/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libfil.a +noinst_LIBRARIES = libfil.a libfil_a_SOURCES = fil0fil.c diff --git a/innobase/fsp/Makefile.am b/innobase/fsp/Makefile.am index b3e9ab44d9b..edf06bda0d6 100644 --- a/innobase/fsp/Makefile.am +++ b/innobase/fsp/Makefile.am @@ -18,7 +18,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libfsp.a +noinst_LIBRARIES = libfsp.a libfsp_a_SOURCES = fsp0fsp.c diff --git a/innobase/fut/Makefile.am b/innobase/fut/Makefile.am index a4b1e30e03c..839fdb1580e 100644 --- a/innobase/fut/Makefile.am +++ b/innobase/fut/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libfut.a +noinst_LIBRARIES = libfut.a libfut_a_SOURCES = fut0fut.c fut0lst.c diff --git a/innobase/ha/Makefile.am b/innobase/ha/Makefile.am index ce846d37622..121bafe167d 100644 --- a/innobase/ha/Makefile.am +++ b/innobase/ha/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libha.a +noinst_LIBRARIES = libha.a libha_a_SOURCES = ha0ha.c hash0hash.c diff --git a/innobase/ibuf/Makefile.am b/innobase/ibuf/Makefile.am index 1c1d196c40c..fb813d38ee5 100644 --- a/innobase/ibuf/Makefile.am +++ b/innobase/ibuf/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libibuf.a +noinst_LIBRARIES = libibuf.a libibuf_a_SOURCES = ibuf0ibuf.c diff --git a/innobase/include/Makefile.i b/innobase/include/Makefile.i index 985ec525950..f3e3fbe989e 100644 --- a/innobase/include/Makefile.i +++ b/innobase/include/Makefile.i @@ -1,7 +1,5 @@ # Makefile included in Makefile.am in every subdirectory -libsdir = ../libs - INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../../include -I../../include # Don't update the files from bitkeeper diff --git a/innobase/lock/Makefile.am b/innobase/lock/Makefile.am index f9e1b227f3c..549eb2604e3 100644 --- a/innobase/lock/Makefile.am +++ b/innobase/lock/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = liblock.a +noinst_LIBRARIES = liblock.a liblock_a_SOURCES = lock0lock.c diff --git a/innobase/log/Makefile.am b/innobase/log/Makefile.am index 3910a25ab1a..2dbaf93e6d9 100644 --- a/innobase/log/Makefile.am +++ b/innobase/log/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = liblog.a +noinst_LIBRARIES = liblog.a liblog_a_SOURCES = log0log.c log0recv.c diff --git a/innobase/mach/Makefile.am b/innobase/mach/Makefile.am index 8195831e92e..ce827c8033f 100644 --- a/innobase/mach/Makefile.am +++ b/innobase/mach/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libmach.a +noinst_LIBRARIES = libmach.a libmach_a_SOURCES = mach0data.c diff --git a/innobase/mem/Makefile.am b/innobase/mem/Makefile.am index 84f642e4469..10b7771b580 100644 --- a/innobase/mem/Makefile.am +++ b/innobase/mem/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libmem.a +noinst_LIBRARIES = libmem.a libmem_a_SOURCES = mem0mem.c mem0pool.c diff --git a/innobase/mtr/Makefile.am b/innobase/mtr/Makefile.am index 972dcaca80e..1e93a34ce23 100644 --- a/innobase/mtr/Makefile.am +++ b/innobase/mtr/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libmtr.a +noinst_LIBRARIES = libmtr.a libmtr_a_SOURCES = mtr0mtr.c mtr0log.c diff --git a/innobase/odbc/Makefile.am b/innobase/odbc/Makefile.am index d1a47bd8c18..f4282ba3907 100644 --- a/innobase/odbc/Makefile.am +++ b/innobase/odbc/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libodbc.a +noinst_LIBRARIES = libodbc.a libodbc_a_SOURCES = odbc0odbc.c diff --git a/innobase/os/Makefile.am b/innobase/os/Makefile.am index b06670bc703..132ce07c83b 100644 --- a/innobase/os/Makefile.am +++ b/innobase/os/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libos.a +noinst_LIBRARIES = libos.a libos_a_SOURCES = os0proc.c os0shm.c os0sync.c os0thread.c os0file.c diff --git a/innobase/page/Makefile.am b/innobase/page/Makefile.am index 85fe585a633..2e260787438 100644 --- a/innobase/page/Makefile.am +++ b/innobase/page/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libpage.a +noinst_LIBRARIES = libpage.a libpage_a_SOURCES = page0page.c page0cur.c diff --git a/innobase/pars/Makefile.am b/innobase/pars/Makefile.am index e5611f9dfc6..2356f330486 100644 --- a/innobase/pars/Makefile.am +++ b/innobase/pars/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libpars.a +noinst_LIBRARIES = libpars.a noinst_HEADERS = pars0grm.h diff --git a/innobase/que/Makefile.am b/innobase/que/Makefile.am index b74d4dbf6a0..d9c046b4f4c 100644 --- a/innobase/que/Makefile.am +++ b/innobase/que/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libque.a +noinst_LIBRARIES = libque.a libque_a_SOURCES = que0que.c diff --git a/innobase/read/Makefile.am b/innobase/read/Makefile.am index 16224f4f7f4..7edf2a5a2e1 100644 --- a/innobase/read/Makefile.am +++ b/innobase/read/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libread.a +noinst_LIBRARIES = libread.a libread_a_SOURCES = read0read.c diff --git a/innobase/rem/Makefile.am b/innobase/rem/Makefile.am index ef0cde9bd7a..e2b2fdaf669 100644 --- a/innobase/rem/Makefile.am +++ b/innobase/rem/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = librem.a +noinst_LIBRARIES = librem.a librem_a_SOURCES = rem0rec.c rem0cmp.c diff --git a/innobase/row/Makefile.am b/innobase/row/Makefile.am index e4fcbe8f715..bd09f9a237d 100644 --- a/innobase/row/Makefile.am +++ b/innobase/row/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = librow.a +noinst_LIBRARIES = librow.a librow_a_SOURCES = row0ins.c row0mysql.c row0purge.c row0row.c row0sel.c\ row0uins.c row0umod.c row0undo.c row0upd.c row0vers.c diff --git a/innobase/srv/Makefile.am b/innobase/srv/Makefile.am index b4bdeb7c03b..752683b82b8 100644 --- a/innobase/srv/Makefile.am +++ b/innobase/srv/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libsrv.a +noinst_LIBRARIES = libsrv.a libsrv_a_SOURCES = srv0srv.c srv0que.c srv0start.c diff --git a/innobase/sync/Makefile.am b/innobase/sync/Makefile.am index 7504525bf84..4acd4516e35 100644 --- a/innobase/sync/Makefile.am +++ b/innobase/sync/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libsync.a +noinst_LIBRARIES = libsync.a libsync_a_SOURCES = sync0arr.c sync0ipm.c sync0rw.c sync0sync.c diff --git a/innobase/thr/Makefile.am b/innobase/thr/Makefile.am index 5f42138e734..62c39492c07 100644 --- a/innobase/thr/Makefile.am +++ b/innobase/thr/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libthr.a +noinst_LIBRARIES = libthr.a libthr_a_SOURCES = thr0loc.c diff --git a/innobase/trx/Makefile.am b/innobase/trx/Makefile.am index 63b2c52da33..9e2b3c398e3 100644 --- a/innobase/trx/Makefile.am +++ b/innobase/trx/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libtrx.a +noinst_LIBRARIES = libtrx.a libtrx_a_SOURCES = trx0purge.c trx0rec.c trx0roll.c trx0rseg.c\ trx0sys.c trx0trx.c trx0undo.c diff --git a/innobase/usr/Makefile.am b/innobase/usr/Makefile.am index a71d0d41ac0..bdcc832a76e 100644 --- a/innobase/usr/Makefile.am +++ b/innobase/usr/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libusr.a +noinst_LIBRARIES = libusr.a libusr_a_SOURCES = usr0sess.c diff --git a/innobase/ut/Makefile.am b/innobase/ut/Makefile.am index de3cf41b767..2fdbb99e0f3 100644 --- a/innobase/ut/Makefile.am +++ b/innobase/ut/Makefile.am @@ -17,7 +17,7 @@ include ../include/Makefile.i -libs_LIBRARIES = libut.a +noinst_LIBRARIES = libut.a libut_a_SOURCES = ut0byte.c ut0dbg.c ut0mem.c ut0rnd.c ut0ut.c diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c index d33aa2718b7..dc51269ac35 100644 --- a/myisam/mi_dynrec.c +++ b/myisam/mi_dynrec.c @@ -62,7 +62,7 @@ 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+ + reclength= (info->s->base.pack_reclength + info->s->base.pack_bits + _my_calc_total_blob_length(info,record)+ extra); #ifdef NOT_USED /* We now support big rows */ if (reclength > MI_DYN_MAX_ROW_LENGTH) diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index b129beaac81..80ccb6c7bb8 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -47,7 +47,7 @@ sum(all a) count(all a) avg(all a) std(all a) bit_or(all a) bit_and(all a) min(a 21 6 3.5000 1.7078 7 0 1 6 E select grp, sum(a),count(a),avg(a),std(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1 group by grp; grp sum(a) count(a) avg(a) std(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c) -NULL 0 0 NULL NULL 0 0 NULL NULL +NULL NULL 0 NULL NULL 0 0 NULL NULL 1 1 1 1.0000 0.0000 1 1 1 1 a a 2 5 2 2.5000 0.5000 3 2 2 3 b c 3 15 3 5.0000 0.8165 7 4 4 6 C E @@ -204,3 +204,44 @@ select max(t2.a1) from t1 left outer join t2 on t1.a2=t2.a1 and 1=0 where t2.a1= max(t2.a1) NULL drop table t1,t2; +CREATE TABLE t1 (a int, b int); +select count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1; +count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +0 NULL NULL NULL NULL NULL -1 0 +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +insert into t1 values (1,null); +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +1 0 NULL NULL NULL NULL NULL -1 0 +insert into t1 values (1,null); +insert into t1 values (2,null); +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +1 0 NULL NULL NULL NULL NULL 0 0 +2 0 NULL NULL NULL NULL NULL 0 0 +select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +1 0 NULL NULL NULL NULL NULL -1 0 +2 0 NULL NULL NULL NULL NULL -1 0 +insert into t1 values (2,1); +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +1 0 NULL NULL NULL NULL NULL 0 0 +2 1 1 1.0000 0.0000 1 1 0 1 +select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +1 0 NULL NULL NULL NULL NULL -1 0 +2 1 1 1.0000 0.0000 1 1 1 1 +insert into t1 values (3,1); +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +1 0 NULL NULL NULL NULL NULL 0 0 +2 1 1 1.0000 0.0000 1 1 0 1 +3 1 1 1.0000 0.0000 1 1 1 1 +select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +1 0 NULL NULL NULL NULL NULL -1 0 +2 1 1 1.0000 0.0000 1 1 1 1 +3 1 1 1.0000 0.0000 1 1 1 1 +drop table t1; 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, diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 0907abcbc86..a55e05578e0 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -237,13 +237,18 @@ a show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 -select sql_cache * from t1; +select sql_cache * from t1 union select * from t1; a 1 2 3 set query_cache_type=2; -select sql_cache * from t1; +select sql_cache * from t1 union select * from t1; +a +1 +2 +3 +select * from t1 union select sql_cache * from t1; a 1 2 @@ -253,7 +258,7 @@ Variable_name Value Qcache_hits 4 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 1 +Qcache_queries_in_cache 2 set query_cache_type=on; reset query cache; show status like "Qcache_queries_in_cache"; @@ -576,3 +581,21 @@ show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 drop table t1; +create table t1 (a int); +insert into t1 values (1),(2); +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +select * from t1; +a +1 +2 +SET OPTION SQL_SELECT_LIMIT=1; +select * from t1; +a +1 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +SET OPTION SQL_SELECT_LIMIT=DEFAULT; +drop table t1; diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 1915c2172ad..40d829d3e70 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -126,3 +126,24 @@ select max(t1.a2) from t1 left outer join t2 on t1.a1=10 where t1.a1=20; select max(t1.a2) from t1 left outer join t2 on t1.a1=10 where t1.a1=10; select max(t2.a1) from t1 left outer join t2 on t1.a2=t2.a1 and 1=0 where t2.a1='AAA'; drop table t1,t2; + +# +# Test of group function and NULL values +# + +CREATE TABLE t1 (a int, b int); +select count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1; +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +insert into t1 values (1,null); +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +insert into t1 values (1,null); +insert into t1 values (2,null); +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +insert into t1 values (2,1); +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +insert into t1 values (3,1); +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +drop table t1; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index c96a21e73dd..2ae3c27f699 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -252,7 +252,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, @@ -291,7 +291,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; # diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index f19d3bdc93a..33f226f9253 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -144,9 +144,10 @@ create table t1 (a int not null); insert into t1 values (1),(2),(3); select * from t1; show status like "Qcache_queries_in_cache"; -select sql_cache * from t1; +select sql_cache * from t1 union select * from t1; set query_cache_type=2; -select sql_cache * from t1; +select sql_cache * from t1 union select * from t1; +select * from t1 union select sql_cache * from t1; show status like "Qcache_hits"; show status like "Qcache_queries_in_cache"; set query_cache_type=on; @@ -400,7 +401,6 @@ select * from t1 where id=2; # # Load data invalidation test # - create table t1 (word char(20) not null); select * from t1; show status like "Qcache_queries_in_cache"; @@ -411,7 +411,6 @@ drop table t1; # # INTO OUTFILE/DUMPFILE test # - drop table if exists t1; create table t1 (a int); insert into t1 values (1),(2),(3); @@ -419,4 +418,17 @@ show status like "Qcache_queries_in_cache"; select * from t1 into outfile "query_caceh.out.file"; select * from t1 limit 1 into dumpfile "query_cache.dump.file"; show status like "Qcache_queries_in_cache"; -drop table t1;
\ No newline at end of file +drop table t1; + +# +# test of SQL_SELECT_LIMIT +# +create table t1 (a int); +insert into t1 values (1),(2); +show status like "Qcache_queries_in_cache"; +select * from t1; +SET OPTION SQL_SELECT_LIMIT=1; +select * from t1; +show status like "Qcache_queries_in_cache"; +SET OPTION SQL_SELECT_LIMIT=DEFAULT; +drop table t1; diff --git a/mysys/my_vsnprintf.c b/mysys/my_vsnprintf.c index 7490ab4a9f2..e49b1d0e729 100644 --- a/mysys/my_vsnprintf.c +++ b/mysys/my_vsnprintf.c @@ -23,11 +23,15 @@ 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 +83,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) return (uint) (to - start); } + #ifdef MAIN #define OVERRUN_SENTRY 250 static void my_printf(const char * fmt, ...) @@ -99,6 +104,7 @@ static void my_printf(const char * fmt, ...) va_end(ar); } + int main() { diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 09259779855..526b7ac91b3 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -1,14 +1,5 @@ #!/bin/sh -echo "This scripts updates the mysql.user, mysql.db, mysql.host and the" -echo "mysql.func tables to MySQL 3.22.14 and above." -echo "" -echo "This is needed if you want to use the new GRANT functions," -echo "CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23" -echo "" -echo "If you get 'Access denied' errors, you should run this script again" -echo "and give the MySQL root user password as an argument!" - root_password="$1" host="localhost" user="root" @@ -20,6 +11,21 @@ else cmd="@bindir@/mysql -f --user=$user --password=$root_password --host=$host mysql" fi +# Debian addition +if [ "$1" = "--sql-only" ]; then + root_password="" + cmd="/usr/share/mysql/echo_stderr" +fi + +echo "This scripts updates the mysql.user, mysql.db, mysql.host and the" +echo "mysql.func tables to MySQL 3.22.14 and above." +echo "" +echo "This is needed if you want to use the new GRANT functions," +echo "CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23" +echo "" +echo "If you get 'Access denied' errors, you should run this script again" +echo "and give the MySQL root user password as an argument!" + echo "Converting all privilege tables to MyISAM format" $cmd <<END_OF_DATA ALTER TABLE user type=MyISAM; diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 094b1fbfcd3..e400c27b84c 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -224,7 +224,7 @@ then if test -n "$open_files" then ulimit -n $open_files - args="open-files-limit=$open_files $args" + args="--open-files-limit=$open_files $args" fi if test -n "$core_file_size" then 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"; +} # 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); diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index fd1a115ddff..a1fb09d049b 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -1037,7 +1037,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, &keydef, table_arg->keys*sizeof(MI_KEYDEF), &keyseg, ((table_arg->key_parts + table_arg->keys) * sizeof(MI_KEYSEG)), - 0))) + NullS))) DBUG_RETURN(1); pos=table_arg->key_info; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index b6bbc12efd6..3a513505913 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -175,12 +175,14 @@ Item_sum_hybrid::fix_fields(THD *thd,TABLE_LIST *tables) void Item_sum_sum::reset() { - null_value=0; sum=0.0; Item_sum_sum::add(); + null_value=1; sum=0.0; Item_sum_sum::add(); } bool Item_sum_sum::add() { sum+=args[0]->val(); + if (!args[0]->null_value) + null_value= 0; return 0; } @@ -566,8 +568,10 @@ void Item_sum_sum::reset_field() { double nr=args[0]->val(); // Nulls also return 0 float8store(result_field->ptr,nr); - null_value=0; - result_field->set_notnull(); + if (args[0]->null_value) + result_field->set_null(); + else + result_field->set_notnull(); } @@ -623,7 +627,10 @@ void Item_sum_sum::update_field(int offset) float8get(old_nr,res+offset); nr=args[0]->val(); if (!args[0]->null_value) + { old_nr+=nr; + result_field->set_notnull(); + } float8store(res,old_nr); } diff --git a/sql/item_sum.h b/sql/item_sum.h index 29ac1f1d1b1..2369b5d1d7e 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -92,9 +92,6 @@ public: class Item_sum_int :public Item_sum_num { - void fix_length_and_dec() - { decimals=0; max_length=21; maybe_null=null_value=0; } - public: Item_sum_int(Item *item_par) :Item_sum_num(item_par) {} Item_sum_int(List<Item> &list) :Item_sum_num(list) {} @@ -102,6 +99,8 @@ public: String *val_str(String*str); enum Item_result result_type () const { return INT_RESULT; } unsigned int size_of() { return sizeof(*this);} + void fix_length_and_dec() + { decimals=0; max_length=21; maybe_null=null_value=0; } }; @@ -118,6 +117,7 @@ class Item_sum_sum :public Item_sum_num double val(); void reset_field(); void update_field(int offset); + void no_rows_in_result() {} const char *func_name() const { return "sum"; } unsigned int size_of() { return sizeof(*this);} }; @@ -361,6 +361,8 @@ class Item_sum_bit :public Item_sum_int longlong val_int(); void reset_field(); unsigned int size_of() { return sizeof(*this);} + void fix_length_and_dec() + { decimals=0; max_length=21; unsigned_flag=1; maybe_null=null_value=0; } }; diff --git a/sql/log.cc b/sql/log.cc index 9befcaefb01..8a5aba5cd34 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) @@ -1120,9 +1123,17 @@ 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 && opt_using_transactions + && !my_b_tell(&thd->transaction.trans_log)) { /* LOAD DATA INFILE in AUTOCOMMIT=1 mode writes to the binlog @@ -1560,6 +1571,8 @@ 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 skr=time(NULL); diff --git a/sql/log_event.cc b/sql/log_event.cc index f87a3872324..b627636186b 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -282,9 +282,9 @@ void Load_log_event::pack_info(String* packet) tmp.append("LOAD DATA INFILE '"); tmp.append(fname, fname_len); tmp.append("' ", 2); - if (sql_ex.opt_flags && REPLACE_FLAG ) + if (sql_ex.opt_flags & REPLACE_FLAG) tmp.append(" REPLACE "); - else if (sql_ex.opt_flags && IGNORE_FLAG ) + else if (sql_ex.opt_flags & IGNORE_FLAG) tmp.append(" IGNORE "); tmp.append("INTO TABLE "); @@ -297,7 +297,7 @@ void Load_log_event::pack_info(String* packet) if (sql_ex.enclosed_len) { - if (sql_ex.opt_flags && OPT_ENCLOSED_FLAG ) + if (sql_ex.opt_flags & OPT_ENCLOSED_FLAG ) tmp.append(" OPTIONALLY "); tmp.append( " ENCLOSED BY "); pretty_print_str(&tmp, sql_ex.enclosed, sql_ex.enclosed_len); @@ -1146,28 +1146,28 @@ 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; switch (handle_dup) { - case DUP_IGNORE: sql_ex.opt_flags |= IGNORE_FLAG; break; - case DUP_REPLACE: sql_ex.opt_flags |= REPLACE_FLAG; break; + case DUP_IGNORE: sql_ex.opt_flags|= IGNORE_FLAG; break; + case DUP_REPLACE: sql_ex.opt_flags|= REPLACE_FLAG; break; case DUP_ERROR: break; } 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; @@ -1273,9 +1273,9 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) fprintf(file, "LOAD DATA INFILE '%-*s' ", fname_len, 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); @@ -1287,7 +1287,7 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) if (sql_ex.enclosed) { - 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_str(file, sql_ex.enclosed, sql_ex.enclosed_len); @@ -1859,10 +1859,9 @@ 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 ); + if (sql_ex.opt_flags & REPLACE_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); @@ -1950,6 +1949,10 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, IMPLEMENTATION - To handle the case where the master died without a stop event, we clean up all temporary tables + locks that we got. + However, we don't clean temporary tables if the master was 3.23 + (this is because a 3.23 master writes a Start_log_event at every + binlog rotation; if we were not careful we would remove temp tables + on the slave when FLUSH LOGS is issued on the master). TODO - Remove all active user locks @@ -1960,13 +1963,18 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, int Start_log_event::exec_event(struct st_relay_log_info* rli) { - /* All temporary tables was deleted on the master */ - close_temporary_tables(thd); - /* - If we have old format, load_tmpdir is cleaned up by the I/O thread - */ if (!rli->mi->old_format) + { + /* + If 4.0 master, all temporary tables have been deleted on the master; + if 3.23 master, this is far from sure. + */ + close_temporary_tables(thd); + /* + If we have old format, load_tmpdir is cleaned up by the I/O thread + */ cleanup_load_tmpdir(); + } return Log_event::exec_event(rli); } @@ -1981,7 +1989,14 @@ int Start_log_event::exec_event(struct st_relay_log_info* rli) int Stop_log_event::exec_event(struct st_relay_log_info* rli) { - // do not clean up immediately after rotate event + /* + do not clean up immediately after rotate event; + QQ: this should be a useless test: the only case when it is false is when + shutdown occured just after FLUSH LOGS. It has nothing to do with Rotate? + By the way, immediately after a Rotate + the I/O thread does not write the Stop to the relay log, + so we won't come here in that case. + */ if (rli->master_log_pos > BIN_LOG_HEADER_SIZE) { close_temporary_tables(thd); diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index c6e205f4729..9617d19caae 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -330,7 +330,12 @@ void mysql_execute_command(void); bool do_command(THD *thd); bool dispatch_command(enum enum_server_command command, THD *thd, char* packet, uint packet_length); +#ifndef EMBEDDED_LIBRARY bool check_stack_overrun(THD *thd,char *dummy); +#else +#define check_stack_overrun(A, B) 0 +#endif + bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables); void table_cache_init(void); void table_cache_free(void); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index bc5334ce674..24e343017e2 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,27 +3375,32 @@ 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, - "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, @@ -3494,10 +3499,13 @@ struct my_option my_long_options[] = {"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).", @@ -3554,15 +3562,19 @@ struct my_option my_long_options[] = {"skip-stack-trace", OPT_SKIP_STACK_TRACE, "Don't print a stack trace on failure", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"skip-symlink", OPT_SKIP_SYMLINKS, "Don't allow symlinking of tables", + {"skip-symlink", OPT_SKIP_SYMLINKS, "Don't allow symlinking of tables. Depricated option. Use --skip-symbolic-links instead", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"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, @@ -3594,11 +3606,12 @@ struct my_option my_long_options[] = {"external-locking", OPT_USE_LOCKING, "Use system (external) locking. With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running", (gptr*) &opt_external_locking, (gptr*) &opt_external_locking, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, -#ifdef USE_SYMDIR - {"use-symbolic-links", 's', "Enable symbolic link support", + {"use-symbolic-links", 's', "Enable symbolic link support. Depricated option; Use --symbolic-links instead", + (gptr*) &my_use_symdir, (gptr*) &my_use_symdir, 0, GET_BOOL, NO_ARG, + IF_PURIFY(0,1), 0, 0, 0, 0, 0}, + {"--symbolic-links", 's', "Enable symbolic link support", (gptr*) &my_use_symdir, (gptr*) &my_use_symdir, 0, GET_BOOL, NO_ARG, IF_PURIFY(0,1), 0, 0, 0, 0, 0}, -#endif {"user", 'u', "Run mysqld daemon as user", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit", 0, 0, 0, GET_NO_ARG, @@ -3888,7 +3901,7 @@ struct my_option my_long_options[] = (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}, @@ -4412,9 +4425,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE; myisam_concurrent_insert=0; myisam_recover_options= HA_RECOVER_NONE; - my_disable_symlinks=1; my_use_symdir=0; - have_symlink=SHOW_OPTION_DISABLED; ha_open_options&= ~(HA_OPEN_ABORT_IF_CRASHED | HA_OPEN_DELAY_KEY_WRITE); #ifdef HAVE_QUERY_CACHE query_cache_size=0; @@ -4461,9 +4472,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), test_flags|=TEST_NO_STACKTRACE; break; case (int) OPT_SKIP_SYMLINKS: - my_disable_symlinks=1; my_use_symdir=0; - have_symlink=SHOW_OPTION_DISABLED; break; case (int) OPT_BIND_ADDRESS: if (argument && isdigit(argument[0])) diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 19f68e0b631..79d9041bb6d 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -47,13 +47,6 @@ can't normally do this the client should have a bigger max_allowed_packet. */ -#ifdef MYSQL_SERVER -#define USE_QUERY_CACHE -extern uint test_flags; -extern void query_cache_insert(NET *net, const char *packet, ulong length); -#else -#endif - #if defined(__WIN__) || !defined(MYSQL_SERVER) /* The following is because alarms doesn't work on windows. */ #define NO_ALARM @@ -62,16 +55,23 @@ extern void query_cache_insert(NET *net, const char *packet, ulong length); #ifndef NO_ALARM #include "my_pthread.h" void sql_print_error(const char *format,...); -extern ulong bytes_sent, bytes_received; -extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received; #else -#undef statistic_add -#define statistic_add(A,B,C) #define DONT_USE_THR_ALARM #endif /* NO_ALARM */ #include "thr_alarm.h" +#ifdef MYSQL_SERVER +#define USE_QUERY_CACHE +extern uint test_flags; +extern void query_cache_insert(NET *net, const char *packet, ulong length); +extern ulong bytes_sent, bytes_received; +extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received; +#else +#undef statistic_add +#define statistic_add(A,B,C) +#endif + #define TEST_BLOCKING 8 #define MAX_PACKET_LENGTH (256L*256L*256L-1) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index e8cbba8aefa..8ee210f4e24 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -542,66 +542,79 @@ ulong acl_getroot(THD *thd, const char *host, const char *ip, const char *user, break; case SSL_TYPE_X509: /* Client should have any valid certificate. */ /* - Connections with non-valid certificates are dropped already - in sslaccept() anyway, so we do not check validity here. + We need to check for absence of SSL because without SSL + we should reject connection. */ - if (SSL_get_peer_certificate(vio->ssl_)) + if (vio_type(vio) == VIO_TYPE_SSL && SSL_get_peer_certificate(vio->ssl_)) user_access=acl_user->access; break; case SSL_TYPE_SPECIFIED: /* Client should have specified attrib */ /* - We do not check for absence of SSL because without SSL it does - not pass all checks here anyway. - If cipher name is specified, we compare it to actual cipher in - use. + We need to check for absence of SSL because without SSL + we should reject connection. */ - if (acl_user->ssl_cipher) + if (vio_type(vio) == VIO_TYPE_SSL) { - DBUG_PRINT("info",("comparing ciphers: '%s' and '%s'", - acl_user->ssl_cipher, - SSL_get_cipher(vio->ssl_))); - if (!strcmp(acl_user->ssl_cipher,SSL_get_cipher(vio->ssl_))) - user_access=acl_user->access; - else + if (acl_user->ssl_cipher) { - user_access=NO_ACCESS; - break; + DBUG_PRINT("info",("comparing ciphers: '%s' and '%s'", + acl_user->ssl_cipher, + SSL_get_cipher(vio->ssl_))); + if (!strcmp(acl_user->ssl_cipher,SSL_get_cipher(vio->ssl_))) + user_access=acl_user->access; + else + { + if (global_system_variables.log_warnings) + sql_print_error("X509 ciphers mismatch: should be '%s' but is '%s'", + acl_user->ssl_cipher, + SSL_get_cipher(vio->ssl_)); + user_access=NO_ACCESS; + break; + } } - } - /* Prepare certificate (if exists) */ - DBUG_PRINT("info",("checkpoint 1")); - X509* cert=SSL_get_peer_certificate(vio->ssl_); - DBUG_PRINT("info",("checkpoint 2")); - /* If X509 issuer is speified, we check it... */ - if (acl_user->x509_issuer) - { - DBUG_PRINT("info",("checkpoint 3")); - char *ptr = X509_NAME_oneline(X509_get_issuer_name(cert), 0, 0); - DBUG_PRINT("info",("comparing issuers: '%s' and '%s'", - acl_user->x509_issuer, ptr)); - if (strcmp(acl_user->x509_issuer, ptr)) + /* Prepare certificate (if exists) */ + DBUG_PRINT("info",("checkpoint 1")); + X509* cert=SSL_get_peer_certificate(vio->ssl_); + DBUG_PRINT("info",("checkpoint 2")); + /* If X509 issuer is speified, we check it... */ + if (acl_user->x509_issuer) { - user_access=NO_ACCESS; + DBUG_PRINT("info",("checkpoint 3")); + char *ptr = X509_NAME_oneline(X509_get_issuer_name(cert), 0, 0); + DBUG_PRINT("info",("comparing issuers: '%s' and '%s'", + acl_user->x509_issuer, ptr)); + if (strcmp(acl_user->x509_issuer, ptr)) + { + if (global_system_variables.log_warnings) + sql_print_error("X509 issuer mismatch: should be '%s' but is '%s'", + acl_user->x509_issuer, ptr); + user_access=NO_ACCESS; + free(ptr); + break; + } + user_access=acl_user->access; free(ptr); - break; } - user_access=acl_user->access; - free(ptr); - } - DBUG_PRINT("info",("checkpoint 4")); - /* X509 subject is specified, we check it .. */ - if (acl_user->x509_subject) - { - char *ptr= X509_NAME_oneline(X509_get_subject_name(cert), 0, 0); - DBUG_PRINT("info",("comparing subjects: '%s' and '%s'", - acl_user->x509_subject, ptr)); - if (strcmp(acl_user->x509_subject,ptr)) - user_access=NO_ACCESS; - else - user_access=acl_user->access; - free(ptr); + DBUG_PRINT("info",("checkpoint 4")); + /* X509 subject is specified, we check it .. */ + if (acl_user->x509_subject) + { + char *ptr= X509_NAME_oneline(X509_get_subject_name(cert), 0, 0); + DBUG_PRINT("info",("comparing subjects: '%s' and '%s'", + acl_user->x509_subject, ptr)); + if (strcmp(acl_user->x509_subject,ptr)) + { + if (global_system_variables.log_warnings) + sql_print_error("X509 subject mismatch: '%s' vs '%s'", + acl_user->x509_subject, ptr); + user_access=NO_ACCESS; + } + else + user_access=acl_user->access; + free(ptr); + } + break; } - break; } #else /* HAVE_OPENSSL */ user_access=acl_user->access; diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 64c62345182..59430d6a486 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -743,11 +743,11 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) if (query_cache_size == 0) DBUG_VOID_RETURN; - if ((local_tables = is_cacheable(thd, thd->query_length, + if ((local_tables= is_cacheable(thd, thd->query_length, thd->query, &thd->lex, tables_used))) { - NET *net = &thd->net; - byte flags = (thd->client_capabilities & CLIENT_LONG_FLAG ? 0x80 : 0); + NET *net= &thd->net; + byte flags= (thd->client_capabilities & CLIENT_LONG_FLAG ? 0x80 : 0); STRUCT_LOCK(&structure_guard_mutex); if (query_cache_size == 0) @@ -775,8 +775,10 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) flags|= (byte) thd->variables.convert_set->number(); DBUG_ASSERT(thd->variables.convert_set->number() < 128); } - tot_length=thd->query_length+thd->db_length+2; - thd->query[tot_length-1] = (char) flags; + tot_length= thd->query_length+thd->db_length+2+sizeof(ha_rows); + thd->query[tot_length-1]= (char) flags; + memcpy((void *)(thd->query + (tot_length-sizeof(ha_rows)-1)), + (const void *)&thd->variables.select_limit, sizeof(ha_rows)); /* Check if another thread is processing the same query? */ Query_cache_block *competitor = (Query_cache_block *) @@ -910,7 +912,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) } Query_cache_block *query_block; - tot_length=query_length+thd->db_length+2; + tot_length= query_length+thd->db_length+2+sizeof(ha_rows); if (thd->db_length) { memcpy(sql+query_length+1, thd->db, thd->db_length); @@ -926,15 +928,18 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) Most significant bit - CLIENT_LONG_FLAG, Other - charset number (0 no charset convertion) */ - flags = (thd->client_capabilities & CLIENT_LONG_FLAG ? 0x80 : 0); + flags= (thd->client_capabilities & CLIENT_LONG_FLAG ? 0x80 : 0); if (thd->variables.convert_set != 0) { - flags |= (byte) thd->variables.convert_set->number(); + flags|= (byte) thd->variables.convert_set->number(); DBUG_ASSERT(thd->variables.convert_set->number() < 128); } - sql[tot_length-1] = (char) flags; - query_block = (Query_cache_block *) hash_search(&queries, (byte*) sql, + sql[tot_length-1]= (char) flags; + memcpy((void *)(sql + (tot_length-sizeof(ha_rows)-1)), + (const void *)&thd->variables.select_limit, sizeof(ha_rows)); + query_block= (Query_cache_block *) hash_search(&queries, (byte*) sql, tot_length); + /* Quick abort on unlocked data */ if (query_block == 0 || query_block->query()->result() == 0 || @@ -2439,7 +2444,7 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len, if (lex->sql_command == SQLCOM_SELECT && (thd->variables.query_cache_type == 1 || - (thd->variables.query_cache_type == 2 && (lex->select->options & + (thd->variables.query_cache_type == 2 && (lex->select_lex.options & OPTION_TO_QUERY_CACHE))) && thd->safe_to_cache_query) { diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1bb1fd9d39a..0ffdb68a179 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1029,7 +1029,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd, /* We must allocate some extra memory for query cache */ if (!(thd->query= (char*) thd->memdup_w_gap((gptr) (packet), packet_length, - thd->db_length+2))) + thd->db_length+2+ + sizeof(ha_rows)))) break; thd->query[packet_length]=0; thd->packet.shrink(thd->variables.net_buffer_length);// Reclaim some memory @@ -2696,6 +2697,7 @@ static bool check_merge_table_access(THD *thd, char *db, #define used_stack(A,B) (long) (B - A) #endif +#ifndef EMBEDDED_LIBRARY bool check_stack_overrun(THD *thd,char *buf __attribute__((unused))) { long stack_used; @@ -2709,6 +2711,7 @@ bool check_stack_overrun(THD *thd,char *buf __attribute__((unused))) } return 0; } +#endif /* EMBEDDED_LIBRARY */ #define MY_YACC_INIT 1000 // Start with big alloc #define MY_YACC_MAX 32000 // Because of 'short' diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 6e1cf2e8217..881e59ca53d 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1225,7 +1225,7 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables, case SHOW_RPL_STATUS: net_store_data(&packet2, rpl_status_type[(int)rpl_status]); break; -#ifndef EMBEDDED_LIBRARY +#ifdef HAVE_REPLICATION case SHOW_SLAVE_RUNNING: { LOCK_ACTIVE_MI; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 8d56a403ba3..7cd0b9406ea 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1532,7 +1532,10 @@ select_option: Select->options|= OPTION_FOUND_ROWS; } | SQL_NO_CACHE_SYM { current_thd->safe_to_cache_query=0; } - | SQL_CACHE_SYM { Select->options|= OPTION_TO_QUERY_CACHE; } + | SQL_CACHE_SYM + { + Lex->select_lex.options|= OPTION_TO_QUERY_CACHE; + } | ALL {} ; diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh index 50a14b0fc96..3362d5bd131 100644 --- a/support-files/my-huge.cnf.sh +++ b/support-files/my-huge.cnf.sh @@ -29,29 +29,84 @@ skip-locking set-variable = key_buffer=384M set-variable = max_allowed_packet=1M set-variable = table_cache=512 -set-variable = sort_buffer=2M -set-variable = record_buffer=2M +set-variable = sort_buffer_size=2M +set-variable = read_buffer_size=2M +set-variable = myisam_sort_buffer_size=64M set-variable = thread_cache=8 # Try number of CPU's*2 for thread_concurrency set-variable = thread_concurrency=8 -set-variable = myisam_sort_buffer_size=64M + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "pipe" option) will render mysqld useless! +# +#skip-networking # Replication Master Server (default) -log-bin # required for replication -server-id = 1 # required unique id between 1 and 2^32 - 1 - # defaults to 1 if master-host is not set - # but will not function as a master if omitted +# binary logging is required for replication +log-bin -# Replication Slave Server (comment out master section to use this) -#master-host = # MUST BE SET -#master-user = # MUST BE SET -#master-password = # MUST BE SET -#master-port = # optional--defaults to 3306 -#log-bin # not required for slaves, but recommended -#server-id = 2 # required unique id between 2 and 2^32 - 1 - # (and different from the master) - # defaults to 2 if master-host is set - # but will not function as a slave if omitted +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted +server-id = 1 + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>, +# MASTER_USER=<user>, MASTER_PASSWORD=<password> ; +# +# where you replace <host>, <user>, <password> by quoted strings and +# <port> by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = <hostname> +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = <username> +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = <password> +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = <port> +# +# binary logging - not required for slaves, but recommended +#log-bin # Point the following paths to different dedicated disks #tmpdir = /tmp/ @@ -87,13 +142,13 @@ no-auto-rehash [isamchk] set-variable = key_buffer=256M -set-variable = sort_buffer=256M +set-variable = sort_buffer_size=256M set-variable = read_buffer=2M set-variable = write_buffer=2M [myisamchk] set-variable = key_buffer=256M -set-variable = sort_buffer=256M +set-variable = sort_buffer_size=256M set-variable = read_buffer=2M set-variable = write_buffer=2M diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh index 3c388d611d8..5bc3a8eb0c4 100644 --- a/support-files/my-large.cnf.sh +++ b/support-files/my-large.cnf.sh @@ -29,15 +29,89 @@ skip-locking set-variable = key_buffer=256M set-variable = max_allowed_packet=1M set-variable = table_cache=256 -set-variable = sort_buffer=1M -set-variable = record_buffer=1M +set-variable = sort_buffer_size=1M +set-variable = read_buffer_size=1M set-variable = myisam_sort_buffer_size=64M set-variable = thread_cache=8 # Try number of CPU's*2 for thread_concurrency set-variable = thread_concurrency=8 + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "pipe" option) will render mysqld useless! +# +#skip-networking + +# Replication Master Server (default) +# binary logging is required for replication log-bin + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted server-id = 1 +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>, +# MASTER_USER=<user>, MASTER_PASSWORD=<password> ; +# +# where you replace <host>, <user>, <password> by quoted strings and +# <port> by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = <hostname> +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = <username> +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = <password> +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = <port> +# +# binary logging - not required for slaves, but recommended +#log-bin + +# Point the following paths to different dedicated disks +#tmpdir = /tmp/ +#log-update = /path-to-dedicated-directory/hostname + # Uncomment the following if you are using BDB tables #set-variable = bdb_cache_size=64M #set-variable = bdb_max_lock=100000 @@ -57,10 +131,6 @@ server-id = 1 #innodb_flush_log_at_trx_commit=1 #set-variable = innodb_lock_wait_timeout=50 -# Point the following paths to different dedicated disks -#tmpdir = /tmp/ -#log-update = /path-to-dedicated-directory/hostname - [mysqldump] quick set-variable = max_allowed_packet=16M @@ -72,13 +142,13 @@ no-auto-rehash [isamchk] set-variable = key_buffer=128M -set-variable = sort_buffer=128M +set-variable = sort_buffer_size=128M set-variable = read_buffer=2M set-variable = write_buffer=2M [myisamchk] set-variable = key_buffer=128M -set-variable = sort_buffer=128M +set-variable = sort_buffer_size=128M set-variable = read_buffer=2M set-variable = write_buffer=2M diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh index a92494358cb..084f23cbc94 100644 --- a/support-files/my-medium.cnf.sh +++ b/support-files/my-medium.cnf.sh @@ -30,12 +30,82 @@ skip-locking set-variable = key_buffer=16M set-variable = max_allowed_packet=1M set-variable = table_cache=64 -set-variable = sort_buffer=512K +set-variable = sort_buffer_size=512K set-variable = net_buffer_length=8K set-variable = myisam_sort_buffer_size=8M + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "pipe" option) will render mysqld useless! +# +#skip-networking + +# Replication Master Server (default) +# binary logging is required for replication log-bin + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted server-id = 1 +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>, +# MASTER_USER=<user>, MASTER_PASSWORD=<password> ; +# +# where you replace <host>, <user>, <password> by quoted strings and +# <port> by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = <hostname> +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = <username> +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = <password> +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = <port> +# +# binary logging - not required for slaves, but recommended +#log-bin + # Point the following paths to different dedicated disks #tmpdir = /tmp/ #log-update = /path-to-dedicated-directory/hostname @@ -70,13 +140,13 @@ no-auto-rehash [isamchk] set-variable = key_buffer=20M -set-variable = sort_buffer=20M +set-variable = sort_buffer_size=20M set-variable = read_buffer=2M set-variable = write_buffer=2M [myisamchk] set-variable = key_buffer=20M -set-variable = sort_buffer=20M +set-variable = sort_buffer_size=20M set-variable = read_buffer=2M set-variable = write_buffer=2M diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh index b8941184fe0..b11277c1b4a 100644 --- a/support-files/my-small.cnf.sh +++ b/support-files/my-small.cnf.sh @@ -29,10 +29,18 @@ socket = @MYSQL_UNIX_ADDR@ skip-locking set-variable = key_buffer=16K set-variable = max_allowed_packet=1M -set-variable = thread_stack=64K set-variable = table_cache=4 -set-variable = sort_buffer=64K +set-variable = sort_buffer_size=64K set-variable = net_buffer_length=2K +set-variable = thread_stack=64K + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "pipe" option) will render mysqld useless! +# +#skip-networking server-id = 1 # Uncomment the following if you want to log updates @@ -67,11 +75,11 @@ no-auto-rehash [isamchk] set-variable = key_buffer=8M -set-variable = sort_buffer=8M +set-variable = sort_buffer_size=8M [myisamchk] set-variable = key_buffer=8M -set-variable = sort_buffer=8M +set-variable = sort_buffer_size=8M [mysqlhotcopy] interactive-timeout diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index 7340cff9cad..1e328a4f625 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -10,7 +10,7 @@ # started and shut down when the systems goes down. # Comments to support chkconfig on RedHat Linux -# chkconfig: 2345 90 90 +# chkconfig: 2345 90 20 # description: A very fast and reliable SQL database engine. # Comments to support LSB init script conventions @@ -18,8 +18,8 @@ # Provides: mysql # Required-Start: $local_fs $network $remote_fs # Required-Stop: $local_fs $network $remote_fs -# Default-Start: 3 5 -# Default-Stop: 3 5 +# Default-Start: 2 3 4 5 +# Default-Stop: 2 3 4 5 # Short-Description: start and stop MySQL # Description: MySQL is a very fast and reliable SQL database engine. ### END INIT INFO diff --git a/vio/viossl.c b/vio/viossl.c index cf1c98b5382..0f34a45f9aa 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -281,7 +281,8 @@ int sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* vio, long timeout) SSL_SESSION_set_timeout(SSL_get_session(vio->ssl_), timeout); SSL_set_fd(vio->ssl_,vio->sd); SSL_set_accept_state(vio->ssl_); - if (SSL_do_handshake(vio->ssl_) < 1) + if (SSL_do_handshake(vio->ssl_) < 1 || + SSL_get_verify_result(vio->ssl_) != X509_V_OK) { DBUG_PRINT("error", ("SSL_do_handshake failure")); report_errors(); @@ -354,7 +355,8 @@ int sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* vio, long timeout) SSL_SESSION_set_timeout(SSL_get_session(vio->ssl_), timeout); SSL_set_fd (vio->ssl_, vio->sd); SSL_set_connect_state(vio->ssl_); - if (SSL_do_handshake(vio->ssl_) < 1) + if (SSL_do_handshake(vio->ssl_) < 1 || + SSL_get_verify_result(vio->ssl_) != X509_V_OK) { DBUG_PRINT("error", ("SSL_do_handshake failure")); report_errors(); |