From 3e4ff5dcccb7d1e016d12048de2ee94f972d6d13 Mon Sep 17 00:00:00 2001 From: "paul@central.snake.net" <> Date: Thu, 27 Sep 2001 12:25:36 -0500 Subject: [PATCH 1/7] manual.texi correct date error in manual. --- BitKeeper/etc/logging_ok | 1 + Docs/manual.texi | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index efa9faefd05..02c76aa4b4a 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -1 +1,2 @@ Miguel@light.local +paul@central.snake.net diff --git a/Docs/manual.texi b/Docs/manual.texi index 6dd44a79288..8b51e73f9a2 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -12788,7 +12788,7 @@ this may be different than what you are used to.) @item Claws @tab Gwen @tab cat @tab m @tab 1994-03-17 @tab @item Buffy @tab Harold @tab dog @tab f @tab 1989-05-13 @tab @item Fang @tab Benny @tab dog @tab m @tab 1990-08-27 @tab -@item Bowser @tab Diane @tab dog @tab m @tab 1989-08-31 @tab 1995-07-29 +@item Bowser @tab Diane @tab dog @tab m @tab 1998-08-31 @tab 1995-07-29 @item Chirpy @tab Gwen @tab bird @tab f @tab 1998-09-11 @tab @item Whistler @tab Gwen @tab bird @tab @tab 1997-12-09 @tab @item Slim @tab Benny @tab snake @tab m @tab 1996-04-29 @tab From 89f92db6b8a33832a1adb8ecb65fa883e688479c Mon Sep 17 00:00:00 2001 From: "paul@central.snake.net" <> Date: Thu, 27 Sep 2001 12:31:59 -0500 Subject: [PATCH 2/7] manual.texi typo fixes. --- Docs/manual.texi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Docs/manual.texi b/Docs/manual.texi index 8b51e73f9a2..46e7ffcf6c7 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -17191,7 +17191,7 @@ knowing your 'scrambled' password is enough to be able to connect to the MySQL server! @end itemize -MySQL users and they privileges are normally created with the +MySQL users and their privileges are normally created with the @code{GRANT} command. @xref{GRANT}. When you login to a MySQL server with a command line client you @@ -17217,13 +17217,14 @@ mysql -u monty -p database_name Note that in the last example the password is @strong{NOT} 'database_name'. -If you want to use the @code{-p} option to supply a password you should do like this: +If you want to use the @code{-p} option to supply a password you should do so +like this: @example mysql -u monty -pguess database_name @end example -On some system the library call that MySQL uses to prompt for a +On some systems, the library call that MySQL uses to prompt for a password will automatically cut the password to 8 characters. Internally MySQL doesn't have any limit for the length of the password. From 99b58a5aa9ae729d95b00650b8360820bafe3887 Mon Sep 17 00:00:00 2001 From: "monty@tik.mysql.fi" <> Date: Thu, 27 Sep 2001 21:35:35 +0300 Subject: [PATCH 3/7] Cleaned up udf_example.cc and mysql_fix_privilege_tables --- acinclude.m4 | 2 +- scripts/mysql_fix_privilege_tables.sh | 13 ++++++------- sql/udf_example.cc | 25 +++++++++++++++---------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 86eed5e69c7..1eb95e1e9c9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1106,7 +1106,7 @@ changequote([, ])dnl AC_DEFUN(AC_SYS_LARGEFILE, [AC_REQUIRE([AC_CANONICAL_HOST]) AC_ARG_ENABLE(largefile, - [ --disable-large-files Omit support for large files]) + [ --disable-largefile Omit support for large files]) if test "$enable_largefile" != no; then AC_CHECK_TOOL(GETCONF, getconf) AC_SYS_LARGEFILE_FLAGS(CFLAGS) diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 8e9ef509d66..86312fdab52 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -3,8 +3,8 @@ echo "This scripts updates the mysql.user, mysql.db, mysql.host and the" echo "mysql.func table to MySQL 3.22.14 and above." echo "" -echo "This is needed if you want to use the new GRANT functions or" -echo "want to use the more secure passwords." +echo "This is needed if you want to use the new GRANT functions," +echo "CREATE AGGREAGATE 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 a argument!" @@ -15,13 +15,12 @@ host="localhost" # Fix old password format, add File_priv and func table echo "" echo "If your tables are already up to date or partially up to date you will" -echo "get some warnings about 'Duplicated column name' or" -echo "'Table 'func' already exists'. You can safely ignore these!" +echo "get some warnings about 'Duplicated column name'. You can safely ignore these!" @bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql <h_name) - result); return result; } +#endif // defined(HAVE_GETHOSTBYADDR_R) && defined(HAVE_SOLARIS_STYLE_GETHOST) /* ** Syntax for the new aggregate commands are: @@ -777,13 +790,6 @@ char *reverse_lookup(UDF_INIT *initid, UDF_ARGS *args, char *result, ** (this example is provided by Andreas F. Bobak ) */ -extern "C" { -my_bool avgcost_init( UDF_INIT* initid, UDF_ARGS* args, char* message ); -void avgcost_deinit( UDF_INIT* initid ); -void avgcost_reset( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char *error ); -void avgcost_add( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char *error ); -double avgcost( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char *error ); -} struct avgcost_data { @@ -810,7 +816,7 @@ avgcost_init( UDF_INIT* initid, UDF_ARGS* args, char* message ) return 1; } - if ((args->arg_type[0] != INT_RESULT) && (args->arg_type[1] != REAL_RESULT) ) + if ((args->arg_type[0] != INT_RESULT) || (args->arg_type[1] != REAL_RESULT) ) { strcpy( message, @@ -917,5 +923,4 @@ avgcost( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error ) return data->totalprice/double(data->totalquantity); } -#endif // defined(HAVE_GETHOSTBYADDR_R) && defined(HAVE_SOLARIS_STYLE_GETHOST) #endif /* HAVE_DLOPEN */ From a4bc23add63c1eb20e6bb6cd65fa761b2ec2c19b Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Thu, 27 Sep 2001 22:02:37 +0300 Subject: [PATCH 4/7] Fixed bug in counting open files when using many files Fixed bug in JOIN --- Docs/manual.texi | 3 +++ mysql-test/r/join.result | 2 ++ mysql-test/r/null_key.result | 2 +- mysql-test/t/join.test | 23 +++++++++++++++++++++++ mysys/my_open.c | 5 ++--- sql/sql_select.cc | 24 ++++++++++++++---------- 6 files changed, 45 insertions(+), 14 deletions(-) diff --git a/Docs/manual.texi b/Docs/manual.texi index 6dd44a79288..050fd76ab47 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -46853,6 +46853,9 @@ not yet 100% confident in this code. @appendixsubsec Changes in release 3.23.43 @itemize @bullet @item +Fixed unlikely bug, which returned not matching rows, in SELECT with +many tables and multi-column indexes and 'range' type. +@item Fixed a unlikely core-dump bug when doing @code{EXPLAIN SELECT} when using many tables and @code{ORDER BY}. @item diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index 3c5a72edc68..7db456a1af5 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -20,3 +20,5 @@ id catid stateid countyid a 1 2 +a a b +2 2 3 diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index ead1dc29326..d0d59cdebf8 100644 --- a/mysql-test/r/null_key.result +++ b/mysql-test/r/null_key.result @@ -11,7 +11,7 @@ t1 index NULL a 9 NULL 12 where used; Using index table type possible_keys key key_len ref rows Extra t1 range a,b a 9 NULL 3 where used; Using index table type possible_keys key key_len ref rows Extra -t1 ref a,b b 4 const 2 where used +t1 range a,b a 9 NULL 2 where used; Using index table type possible_keys key key_len ref rows Extra t1 ref a,b a 5 const 3 where used; Using index table type possible_keys key key_len ref rows Extra diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index 6fff628ccb9..224db1dd8f0 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -89,3 +89,26 @@ select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using --error 1116 select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a) left join t1 as t32 using (a) left join t1 as t33 using (a) left join t1 as t34 using (a) left join t1 as t35 using (a) left join t1 as t36 using (a) left join t1 as t37 using (a) left join t1 as t38 using (a) left join t1 as t39 using (a) left join t1 as t40 using (a) left join t1 as t41 using (a) left join t1 as t42 using (a) left join t1 as t43 using (a) left join t1 as t44 using (a) left join t1 as t45 using (a) left join t1 as t46 using (a) left join t1 as t47 using (a) left join t1 as t48 using (a) left join t1 as t49 using (a) left join t1 as t50 using (a) left join t1 as t51 using (a) left join t1 as t52 using (a) left join t1 as t53 using (a) left join t1 as t54 using (a) left join t1 as t55 using (a) left join t1 as t56 using (a) left join t1 as t57 using (a) left join t1 as t58 using (a) left join t1 as t59 using (a) left join t1 as t60 using (a) left join t1 as t61 using (a) left join t1 as t62 using (a) left join t1 as t63 using (a) left join t1 as t64 using (a) left join t1 as t65 using (a); drop table t1; + +# +# Simple join test. This failed in 3.23.42, there should have been +# no matches, still three matches were found. +# + +CREATE TABLE t1 ( + a int(11) NOT NULL, + b int(11) NOT NULL, + PRIMARY KEY (a,b) +) TYPE=MyISAM; + +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(2,3); + +CREATE TABLE t2 ( + a int(11) default NULL +) TYPE=MyISAM; + +INSERT INTO t2 VALUES (2),(3); + +SELECT t1.a,t2.a,b FROM t1,t2 WHERE t1.a=t2.a AND (t1.a=1 OR t1.a=2) AND b>=1 AND b<=3; + +DROP TABLE t1, t2; diff --git a/mysys/my_open.c b/mysys/my_open.c index 2ed1af1eca1..748113528a1 100644 --- a/mysys/my_open.c +++ b/mysys/my_open.c @@ -75,8 +75,8 @@ int my_close(File fd, myf MyFlags) pthread_mutex_destroy(&my_file_info[fd].mutex); #endif my_file_info[fd].type = UNOPEN; - my_file_opened--; } + my_file_opened--; pthread_mutex_unlock(&THR_LOCK_open); DBUG_RETURN(err); } /* my_close */ @@ -96,9 +96,8 @@ File my_register_filename(File fd, const char *FileName, enum file_type my_error(EE_OUT_OF_FILERESOURCES, MYF(ME_BELL+ME_WAITTANG), FileName, my_errno); return(-1); -#else - thread_safe_increment(my_file_opened,&THR_LOCK_open); #endif + thread_safe_increment(my_file_opened,&THR_LOCK_open); return(fd); /* safeguard */ } pthread_mutex_lock(&THR_LOCK_open); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 56ba4baed30..e97fa3b0abf 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2258,7 +2258,20 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) { JOIN_TAB *tab=join->join_tab+i; table_map current_map= tab->table->map; + bool use_quick_range=0; used_tables|=current_map; + + if (tab->type == JT_REF && tab->quick && + tab->ref.key_length < tab->quick->max_used_key_length) + { + /* Range uses longer key; Use this instead of ref on key */ + tab->type=JT_ALL; + use_quick_range=1; + tab->use_quick=1; + tab->ref.key_parts=0; // Don't use ref key. + join->best_positions[i].records_read=tab->quick->records; + } + COND *tmp=make_cond_for_table(cond,used_tables,current_map); if (!tmp && tab->quick) { // Outer join @@ -2301,7 +2314,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) if (tab->const_keys && tab->table->reginfo.impossible_range) DBUG_RETURN(1); } - else if (tab->type == JT_ALL) + else if (tab->type == JT_ALL && ! use_quick_range) { if (tab->const_keys && tab->table->reginfo.impossible_range) @@ -2356,15 +2369,6 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) } } } - if (tab->type == JT_REF && sel->quick && - tab->ref.key_length < sel->quick->max_used_key_length) - { - /* Range uses longer key; Use this instead of ref on key */ - tab->type=JT_ALL; - tab->use_quick=1; - tab->ref.key_parts=0; // Don't use ref key. - join->best_positions[i].records_read=sel->quick->records; - } } } } From e17d59d34ae2189cc3059dd3df3dc5158152327f Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Fri, 28 Sep 2001 14:33:52 +0300 Subject: [PATCH 5/7] Fix that postscript generation of the manual works again --- Docs/manual.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/manual.texi b/Docs/manual.texi index eb28dcfcb23..128fd814e31 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -1,4 +1,4 @@ -input texinfo @c -*-texinfo-*- +\input texinfo @c -*-texinfo-*- @c Copyright 1997-2001 TcX AB, Detron HB and MySQL Finland AB @c @c ********************************************************* From a99b7e77cdd839a46f90efdab57c9cc843805393 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Fri, 28 Sep 2001 14:34:52 +0300 Subject: [PATCH 6/7] Update version number --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index a67f05d342f..cfdbe51b987 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! -AM_INIT_AUTOMAKE(mysql, 3.23.42) +AM_INIT_AUTOMAKE(mysql, 3.23.43) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 From 530882c55b39839bb1aab52012073d71c1660951 Mon Sep 17 00:00:00 2001 From: "paul@central.snake.net" <> Date: Fri, 28 Sep 2001 10:49:31 -0500 Subject: [PATCH 7/7] manual.texi typos --- Docs/manual.texi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Docs/manual.texi b/Docs/manual.texi index 128fd814e31..cd730aa321a 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -13948,8 +13948,8 @@ MySQL. Some of the examples use the table @code{shop} to hold the price of each article (item number) for certain traders (dealers). Supposing that each -trader has a single fixed price per article, then (@code{item}, -@code{trader}) is a primary key for the records. +trader has a single fixed price per article, then (@code{article}, +@code{dealer}) is a primary key for the records. Start the command line tool @code{mysql} and select a database: @@ -14158,7 +14158,7 @@ splitting of the concatenated column in the client. @subsection Using user variables You can use MySQL user variables to remember results without -having to store them in a temporary variables in the client. +having to store them in temporary variables in the client. @xref{Variables}. For example, to find the articles with the highest and lowest price you