From dd934da9159a6eb69fdd7fdd91a78c801a0b7caa Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 May 2006 04:37:58 +0200 Subject: [PATCH 1/6] Bug#10418: LOAD_FILE does not behave like in manual if file does not exist load_file() string-function should return NULL rather than throw an error if the file doesn't exist, as per the manual. mysql-test/t/outfile.test: expect NULL rather than error if file given to load_file() doesn't exist mysql-test/t/func_str.test: show that load_file() will return NULL rather than throw an error if file doesn't exist mysql-test/r/outfile.result: expect NULL rather than error if file given to load_file() doesn't exist mysql-test/r/func_str.result: expect NULL rather than error if file given to load_file() doesn't exist sql/item_strfunc.cc: load_file() should return NULL as per the docs if file not found, rather than throw an error --- mysql-test/r/func_str.result | 7 +++++++ mysql-test/r/outfile.result | Bin 959 -> 988 bytes mysql-test/t/func_str.test | 9 ++++++++- mysql-test/t/outfile.test | 1 - sql/item_strfunc.cc | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index ae6578795f6..0609624af18 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1000,3 +1000,10 @@ t 1000000 1 drop table t1; +select load_file("lkjlkj"); +load_file("lkjlkj") +NULL +select ifnull(load_file("lkjlkj"),"it's null"); +ifnull(load_file("lkjlkj"),"it's null") +it's null +End of 4.1 tests diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result index 5eb24a78ef0d0242fcdd2f0ad1dfbf47f9d60dac..bcafae831d560242e84f6ab21d5d454deaf87079 100644 GIT binary patch delta 25 hcmdnbeusU-U&e{cG$y}ic_ptr(), mysql_real_data_home, "", MY_RELATIVE_PATH | MY_UNPACK_FILENAME); - if (!my_stat(path, &stat_info, MYF(MY_WME))) + if (!my_stat(path, &stat_info, MYF(0))) goto err; if (!(stat_info.st_mode & S_IROTH)) From 4a25f40090f1a2ad0124f28e3eb0a9ccbc1cb55c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 May 2006 11:01:50 +0200 Subject: [PATCH 2/6] BUG#16803 "ln -s /dev/null .mysql_history" doesn't work! - Add a check to see if the .mysql_history file a symlink to /dev/null and in such case, skip reading and writing to it. client/mysql.cc: Add check to detect if the "mysql_history" file is a symlink to /dev/null. In that case, don't create histfile variable. That will make read_history and write_history to be skipped. --- client/mysql.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index 7b46aaf67ce..dcf80ff2b0b 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -448,6 +448,14 @@ int main(int argc,char *argv[]) MYF(MY_WME)); if (histfile) sprintf(histfile,"%s/.mysql_history",getenv("HOME")); + char link_name[FN_REFLEN]; + if (my_readlink(link_name, histfile, 0) == 0 && + strncmp(link_name, "/dev/null", 10) == 0) + { + /* The .mysql_history file is a symlink to /dev/null, don't use it */ + my_free(histfile, MYF(MY_ALLOW_ZERO_PTR)); + histfile= 0; + } } if (histfile) { @@ -484,7 +492,7 @@ sig_handler mysql_end(int sig) { mysql_close(&mysql); #ifdef HAVE_READLINE - if (!status.batch && !quick && !opt_html && !opt_xml) + if (!status.batch && !quick && !opt_html && !opt_xml && histfile) { /* write-history */ if (verbose) From 5c6d923f3095f5eca3abaa5277350bec90e4970c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 May 2006 19:47:00 -0700 Subject: [PATCH 3/6] Added a test case for bug #18940:in 5.0 the optimizer chose a worse execution plan than in 4.1 for some queries. It happened due the fact that at some conditions the optimizer always preferred range or full index scan access methods to lookup access methods even when the latter were much cheaper. The problem was not observed in 4.1 for the reported query because the WHERE condition was not of a form that could cause the problem. Equality propagation introduced on 5.0 added an extra predicate and changed the WHERE condition. The new condition provoked the optimizer to make a bad choice. The problem was fixed by the patch for bug 17379. mysql-test/r/select.result: Added a test case for bug #18940. The problem was fixed by the patch for bug 17379. mysql-test/t/select.test: Added a test case for bug #18940. The problem was fixed by the patch for bug 17379. --- mysql-test/r/select.result | 19 +++++++++++++++++++ mysql-test/t/select.test | 21 +++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 3aae29a922e..335637b787f 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3427,3 +3427,22 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE A range PRIMARY PRIMARY 12 NULL 3 Using where 1 SIMPLE B ref PRIMARY PRIMARY 8 const,test.A.e 10 drop table t1, t2; +CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b)); +INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2), +(3,1), (5,1), (8,9), (2,2), (0,9); +CREATE TABLE t2 (c int, d int, f int, INDEX(c,f)); +INSERT INTO t2 VALUES +(1,0,0), (1,0,1), (2,0,0), (2,0,1), (3,0,0), (4,0,1), +(5,0,0), (5,0,1), (6,0,0), (0,0,1), (7,0,0), (7,0,1), +(0,0,0), (0,0,1), (8,0,0), (8,0,1), (9,0,0), (9,0,1); +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY,b b 5 NULL 3 Using where +1 SIMPLE t2 ref c c 5 test.t1.a 2 Using where +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY,b b 5 NULL 3 Using where +1 SIMPLE t2 ref c c 5 test.t1.a 2 Using where +DROP TABLE t1, t2; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 033350d138a..4b6ae921b9b 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2899,3 +2899,24 @@ select 'In next EXPLAIN, B.rows must be exactly 10:' Z; explain select * from t2 A, t2 B where A.a=5 and A.b=5 and A.C<5 and B.a=5 and B.b=A.e and (B.b =1 or B.b = 3 or B.b=5); drop table t1, t2; + +# +#Bug #18940: selection of optimal execution plan caused by equality +# propagation (the bug was fixed by the patch for bug #17379) + +CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b)); +INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2), + (3,1), (5,1), (8,9), (2,2), (0,9); + +CREATE TABLE t2 (c int, d int, f int, INDEX(c,f)); +INSERT INTO t2 VALUES + (1,0,0), (1,0,1), (2,0,0), (2,0,1), (3,0,0), (4,0,1), + (5,0,0), (5,0,1), (6,0,0), (0,0,1), (7,0,0), (7,0,1), + (0,0,0), (0,0,1), (8,0,0), (8,0,1), (9,0,0), (9,0,1); + +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6; +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0; + +DROP TABLE t1, t2; From acf1879938049f2c429d9a4aa7559ec9f495721d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 May 2006 09:13:37 +0200 Subject: [PATCH 4/6] Bug#19709 rpl_tmporary fails on powermacg5 - Don't kill the active connection to the server, instead read the connection id, switch connection and kill the first one from there. mysql-test/r/rpl_temporary.result: Update test result mysql-test/t/rpl_temporary.test: Don't kill our own connection to the server as the result code differs depending on platform. --- mysql-test/r/rpl_temporary.result | 2 -- mysql-test/t/rpl_temporary.test | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/rpl_temporary.result b/mysql-test/r/rpl_temporary.result index 42e7712750c..da85ef5104d 100644 --- a/mysql-test/r/rpl_temporary.result +++ b/mysql-test/r/rpl_temporary.result @@ -109,8 +109,6 @@ create temporary table t102 (id int); set @session.pseudo_thread_id=200; create temporary table t201 (id int); create temporary table `#not_user_table_prefixed_with_hash_sign_no_harm` (id int); -set @con1_id=connection_id(); -kill @con1_id; create table t1(f int); insert into t1 values (1); select * from t1 /* must be 1 */; diff --git a/mysql-test/t/rpl_temporary.test b/mysql-test/t/rpl_temporary.test index facf0d68d2b..7d2222ea79a 100644 --- a/mysql-test/t/rpl_temporary.test +++ b/mysql-test/t/rpl_temporary.test @@ -169,8 +169,18 @@ create temporary table t102 (id int); set @session.pseudo_thread_id=200; create temporary table t201 (id int); create temporary table `#not_user_table_prefixed_with_hash_sign_no_harm` (id int); -set @con1_id=connection_id(); -kill @con1_id; + +# +# Don't kill our own connection to the server as +# the result code differs depending on platform. +# +# Select the id to kill into a variable of mysqltest +let $con1_id= `select connection_id()`; +# Switch connection to avoid killing our own connection +connection master; +--disable_query_log +eval kill $con1_id; +--enable_query_log #now do something to show that slave is ok after DROP temp tables connection master; From f7d265a99c7687c5a22e57824f0abefee6ad24a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 May 2006 11:00:34 +0200 Subject: [PATCH 5/6] Correct spelling errors --- include/sslopt-longopts.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h index f444a7eb7ce..b0769af10fe 100644 --- a/include/sslopt-longopts.h +++ b/include/sslopt-longopts.h @@ -39,7 +39,7 @@ 0, 0, 0, 0, 0, 0}, #ifdef MYSQL_CLIENT {"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT, - "Verify servers \"Common Name\" in it's cert against hostname used when connecting. This option is disabled by default.", + "Verify server's \"Common Name\" in its cert against hostname used when connecting. This option is disabled by default.", (gptr*) &opt_ssl_verify_server_cert, (gptr*) &opt_ssl_verify_server_cert, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif From e52288b5bf86507e0a5cc4aca6d3bd41d79ce63d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 May 2006 12:31:22 +0200 Subject: [PATCH 6/6] merge fixies BUG#10418 4.1 -> 5.0 --- mysql-test/r/outfile.result | Bin 1106 -> 1159 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result index b75b53e51a513e3bc00a8e185e83230c3c2d4f53..040dff576f87ba9c615679088f44846babb424f9 100644 GIT binary patch delta 19 bcmcb_(ayPH1=GZ38k1)+@oZksw3-nBPN4^9 delta 12 TcmZqYyu`6#1=HrcOsg0HA+ZGl