From 24c8a8a2e66407f954c626c0d151e73bbc2ff389 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 4 Mar 2002 17:04:21 +0000 Subject: [PATCH 1/7] apply freebsd/alpha portability patch --- sql/mysqld.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index b3c67fd5126..6011ad210f0 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -112,8 +112,13 @@ typedef fp_except fp_except_t; inline void reset_floating_point_exceptions() { /* Don't fall for overflow, underflow,divide-by-zero or loss of precision */ - fpsetmask(~(FP_X_INV | FP_X_DNML | FP_X_OFL | FP_X_UFL | - FP_X_DZ | FP_X_IMP)); +#if defined(__i386__) + fpsetmask(~(FP_X_INV | FP_X_DNML | FP_X_OFL | FP_X_UFL | FP_X_DZ | + FP_X_IMP)); +#else + fpsetmask(~(FP_X_INV | FP_X_OFL | FP_X_UFL | FP_X_DZ | + FP_X_IMP)); +#endif } #else #define reset_floating_point_exceptions() From 3136a7aeeae947d212cfe14f366e93f327a01faf Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Mar 2002 18:47:50 -0300 Subject: [PATCH 2/7] Fix compiler error on mysqld.cc sql/mysqld.cc: Fix compiler error adding a missed ) --- sql/mysqld.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 1fb39e56840..b82614107ee 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2003,7 +2003,7 @@ The server will not act as a slave."); #ifdef __NT__ if (hPipe == INVALID_HANDLE_VALUE && - (!have_tcpip || opt_disable_networking) + (!have_tcpip || opt_disable_networking)) { sql_print_error("TCP/IP or --enable-named-pipe should be configured on NT OS"); unireg_abort(1); From 10ddd1532674fa3204a5b175f30d2cd5d130d23e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Mar 2002 07:50:14 +1000 Subject: [PATCH 3/7] Fixup of 3.23.50 Windows named pipe changes in manual. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + Docs/manual.texi | 19 +++++++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 53c1cde915e..ab43e471814 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -14,3 +14,4 @@ serg@serg.mysql.com heikki@hundin.mysql.fi jani@hynda.mysql.fi miguel@hegel.local +arjen@fred.bitbike.com diff --git a/Docs/manual.texi b/Docs/manual.texi index 107f26b2fa5..67d99a02735 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -6349,7 +6349,7 @@ Optimized binary with support for symbolic links, BDB and InnoDB tables. Like @code{mysqld-max}, but compiled with support for named pipes. @end multitable -Starting from 3.23.50, named pipes are only enabled if start mysqld with +Starting from 3.23.50, named pipes are only enabled if mysqld is started with @code{--enable-named-pipe}. All of the above binaries are optimized for the Pentium Pro processor but @@ -10337,10 +10337,10 @@ You can force a MySQL client to use named pipes by specifying the @code{--pipe} option or by specifying @code{.} as the host name. Use the @code{--socket} option to specify the name of the pipe. -Note that starting from 3.23.50, named pipes are only enabled if start -mysqld with @code{--enable-named-pipe}. This is because some users have -experienced problems shutting down the MySQL server when one uses named -pipes. +Note that starting from 3.23.50, named pipes are only enabled if mysqld is +started with with @code{--enable-named-pipe}. This is because some users +have experienced problems shutting down the MySQL server when one uses +named pipes. You can test whether or not MySQL is working by executing the following commands: @@ -10621,8 +10621,8 @@ option to the new MySQL clients or create an option file host = localhost @end example -Starting from 3.23.50, named pipes are only enabled if start mysqld with -@code{--enable-named-pipe}. +Starting from 3.23.50, named pipes are only enabled if mysqld is started +with @code{--enable-named-pipe}. @item @code{Access denied for user} error If you get the error @code{Access denied for user: 'some-user@@unknown' @@ -14736,8 +14736,7 @@ which a not fully working lockd() (as on Linux) you will easily get mysqld to deadlock. @item --enable-named-pipe -Enable support for named pipes; This only works on NT and newer windows -versions. +Enable support for named pipes (only on NT/Win2000/XP). @item -T, --exit-info This is a bit mask of different flags one can use for debugging the @@ -46916,7 +46915,7 @@ not yet 100% confident in this code. Fixed some buffer overflow problems when reading startup parameters. @item Because of problems on shutdown we have now disabled named pipes on -windows by default. One can enable this with by starting mysqld with +windows by default. One can enable named pipes by starting mysqld with @code{--enable-named-pipe}. @item Fixed bug when using @code{WHERE key_column = 'J' or key_column='j'}. From 2bddca6226b139b621965dcfa3bd3909c8903153 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Mar 2002 09:34:43 +1000 Subject: [PATCH 4/7] Added InnoDB changes to changelog. --- Docs/manual.texi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Docs/manual.texi b/Docs/manual.texi index 67d99a02735..17c7c945f49 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -46910,8 +46910,17 @@ not yet 100% confident in this code. @node News-3.23.50, News-3.23.49, News-3.23.x, News-3.23.x @appendixsubsec Changes in release 3.23.50 + @itemize @bullet @item +@code{InnoDB} now retains foreign key constraints through @code{ALTER TABLE} +and @code{CREATE/DROP INDEX}. +@item +@code{InnoDB} now allows foreign key constraints to be added through the +@code{ALTER TABLE} syntax. +@item +@code{InnoDB} tables can now be set to automatically grow in size (autoextend). +@item Fixed some buffer overflow problems when reading startup parameters. @item Because of problems on shutdown we have now disabled named pipes on From b344dbc2da2811e6c31274c3aa3b3df56fa0bdf6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Mar 2002 18:35:21 +0200 Subject: [PATCH 5/7] Two bug fixes Docs/manual.texi: Added text fof bug fixes readline/Makefile.am: Bug fix for coredump of mysql program with some Ctrl+keys sql/convert.cc: A bug fix for using SET CHAR... SET on columns > 64K BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + Docs/manual.texi | 5 +++++ readline/Makefile.am | 2 +- sql/convert.cc | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index ab43e471814..bd35c33892e 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -15,3 +15,4 @@ heikki@hundin.mysql.fi jani@hynda.mysql.fi miguel@hegel.local arjen@fred.bitbike.com +sinisa@rhols221.adsl.netsonic.fi diff --git a/Docs/manual.texi b/Docs/manual.texi index 17c7c945f49..f7cee137bc6 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -46768,6 +46768,11 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. @itemize @bullet @item +Fixed @code{SIGINT} and @code{SIGQUIT} problems in mysql.cc +@item +Fixed bug in convert.cc, which is caused by having a wrong net_store_length +linked in CONVERT::store method +@item Multi-table @code{DELETE}. @item Don't support old client protocols prior to MySQL 3.21 any more. diff --git a/readline/Makefile.am b/readline/Makefile.am index e77d7815af2..37e97289e6b 100644 --- a/readline/Makefile.am +++ b/readline/Makefile.am @@ -26,7 +26,7 @@ noinst_HEADERS = rldefs.h histlib.h rlwinsize.h \ EXTRA_DIST= emacs_keymap.c vi_keymap.c -DEFS = -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H +DEFS = -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/sql/convert.cc b/sql/convert.cc index 3e0fbf18ace..2c8b775dca2 100644 --- a/sql/convert.cc +++ b/sql/convert.cc @@ -456,7 +456,7 @@ bool CONVERT::store(String *packet,const char *from,uint length) packet->realloc(packet_length+5+length)) return 1; char *to=(char*) net_store_length((char*) packet->ptr()+packet_length, - length); + (ulonglong)length); for (const char *end=from+length ; from != end ; from++) *to++= to_map[(uchar) *from]; From 389e946182b82917b3a612a280aabfcc6e88db8d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Apr 2002 17:42:01 +0300 Subject: [PATCH 6/7] Fixed help typos in mysql.cc client/mysql.cc: Fixed typos configure.in: Cleanup sql/ha_innobase.cc: Safety patch sql/item_strfunc.cc: cleanup --- client/mysql.cc | 6 +++--- configure.in | 8 ++------ sql/ha_innobase.cc | 11 ++++++----- sql/item_strfunc.cc | 17 ++++++++++------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 60e97bff621..32547a4d138 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -34,7 +34,7 @@ #include "my_readline.h" #include -const char *VER="11.17"; +const char *VER="11.18"; /* Don't try to make a nice table if the data is too big */ #define MAX_COLUMN_LENGTH 1024 @@ -397,12 +397,12 @@ static struct option long_options[] = {"local-infile", optional_argument, 0, OPT_LOCAL_INFILE}, {"no-auto-rehash",no_argument, 0, 'A'}, {"no-named-commands", no_argument, 0, 'g'}, - {"no-tee", no_argument, 0, OPT_NOTEE}, #ifndef __WIN__ {"no-pager", no_argument, 0, OPT_NOPAGER}, {"nopager", no_argument, 0, OPT_NOPAGER}, /* we are kind */ {"pager", optional_argument, 0, OPT_PAGER}, #endif + {"no-tee", no_argument, 0, OPT_NOTEE}, {"notee", no_argument, 0, OPT_NOTEE}, /* we are kind */ {"tee", required_argument, 0, OPT_TEE}, {"one-database", no_argument, 0, 'o'}, @@ -484,7 +484,7 @@ static void usage(int version) still work from the first line.\n\ -G, --enable-named-commands\n\ Named commands are enabled. Opposite to -g.\n\ - -i, --ignore-space Ignore space after function names.\n\ + -i, --ignore-spaces Ignore spaces after function names.\n\ -h, --host=... Connect to host.\n\ -H, --html Produce HTML output.\n\ --local-infile=[1|0] Enable/disable LOAD DATA LOCAL INFILE\n\ diff --git a/configure.in b/configure.in index b55f1f6f726..5e6efe8ea5d 100644 --- a/configure.in +++ b/configure.in @@ -291,19 +291,15 @@ case "$target_os" in if test "$GCC" != "yes"; then # We are using built-in inline function CFLAGS="$CFLAGS -Kalloca" - CXX="$CXX -DNO_CPLUSPLUS_ALLOCA" - else - CXX="$CXX -DNO_CPLUSPLUS_ALLOCA" fi + CXXFLAGS="$CXXFLAGS -DNO_CPLUSPLUS_ALLOCA" ;; sysv5OpenUNIX8*) if test "$GCC" != "yes"; then # We are using built-in inline function CFLAGS="$CFLAGS -Kalloca" - CXX="$CXX -DNO_CPLUSPLUS_ALLOCA" - else - CXX="$CXX -DNO_CPLUSPLUS_ALLOCA" fi + CXXFLAGS="$CXXFLAGS -DNO_CPLUSPLUS_ALLOCA" ;; esac AC_SUBST(CC) diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc index 9159ef3f1c1..a741ffefbb5 100644 --- a/sql/ha_innobase.cc +++ b/sql/ha_innobase.cc @@ -1890,7 +1890,7 @@ ha_innobase::change_active_index( InnoDB */ { row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; - KEY* key; + KEY* key=0; statistic_increment(ha_read_key_count, &LOCK_status); @@ -1911,9 +1911,10 @@ ha_innobase::change_active_index( if (!prebuilt->index) { fprintf(stderr, "InnoDB: Could not find key n:o %u with name %s from dict cache\n" - "InnoDB: for table %s\n", keynr, key->name, prebuilt->table->name); + "InnoDB: for table %s\n", keynr, key ? key->name : "NULL", + prebuilt->table->name); - return(1); + DBUG_RETURN(1); } assert(prebuilt->search_tuple); @@ -1929,7 +1930,7 @@ ha_innobase::change_active_index( build_template(prebuilt, user_thd, table, ROW_MYSQL_WHOLE_ROW); - return(0); + DBUG_RETURN(0); } /************************************************************************** @@ -2812,7 +2813,7 @@ ha_innobase::estimate_number_of_rows(void) estimate = 2 * data_file_length / dict_index_calc_min_rec_len(index); - return((ha_rows) estimate); + DBUG_RETURN((ha_rows) estimate); } /************************************************************************* diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index bd7fde79629..0321d37c0fe 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1720,18 +1720,21 @@ String* Item_func_inet_ntoa::val_str(String* str) uchar buf[8], *p; ulonglong n = (ulonglong) args[0]->val_int(); char num[4]; - // we do not know if args[0] is NULL until we have called - // some val function on it if args[0] is not a constant! + /* + we do not know if args[0] is NULL until we have called + some val function on it if args[0] is not a constant! + */ if ((null_value=args[0]->null_value)) return 0; // Null value + str->length(0); int8store(buf,n); - // now we can assume little endian - // we handle the possibility of an 8-byte IP address - // however, we do not want to confuse those who are just using - // 4 byte ones - + /* + Now we can assume little endian. + We handle the possibility of an 8-byte IP address however, we do + not want to confuse those who are just using 4 byte ones + */ for (p= buf + 8; p > buf+4 && p[-1] == 0 ; p-- ) ; num[3]='.'; while (p-- > buf) From 8bf63614de3e2f09559a952f9f2ad9b7af4ef794 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Apr 2002 14:56:40 +0000 Subject: [PATCH 7/7] fts+const_tables bug fixed --- sql/item_func.cc | 1 + sql/item_func.h | 1 + sql/sql_select.cc | 6 ++++-- sql/table.h | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index e7e8964b07a..ec9244e783e 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2056,6 +2056,7 @@ bool Item_func_match::fix_fields(THD *thd,struct st_table_list *tlist) } const_item_cache=0; table=((Item_field *)fields.head())->field->table; + table->fulltext_searched=1; return 0; } diff --git a/sql/item_func.h b/sql/item_func.h index 4a8f808de57..c0924ba0289 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -880,6 +880,7 @@ public: ft_close_search(ft_handler); if(join_key) table->file->ft_handler=0; + table->fulltext_searched=0; } } } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 1ee0d84e182..673923765ad 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -885,7 +885,8 @@ make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds, s->dependent=(table_map) 0; s->key_dependent=(table_map) 0; if ((table->system || table->file->records <= 1) && ! s->dependent && - !(table->file->option_flag() & HA_NOT_EXACT_COUNT)) + !(table->file->option_flag() & HA_NOT_EXACT_COUNT) && + !table->fulltext_searched) { s->type=JT_SYSTEM; const_table_map|=table->map; @@ -983,7 +984,8 @@ make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds, } while (keyuse->table == table && keyuse->key == key); if (eq_part == PREV_BITS(uint,table->key_info[key].key_parts) && - (table->key_info[key].flags & HA_NOSAME)) + (table->key_info[key].flags & HA_NOSAME) && + !table->fulltext_searched) { if (const_ref == eq_part) { // Found everything for ref. diff --git a/sql/table.h b/sql/table.h index b627a158556..ae785b8a402 100644 --- a/sql/table.h +++ b/sql/table.h @@ -95,6 +95,7 @@ struct st_table { my_bool db_low_byte_first; /* Portable row format */ my_bool locked_by_flush; my_bool locked_by_name; + my_bool fulltext_searched; my_bool crashed; my_bool is_view; Field *next_number_field, /* Set if next_number is activated */