From f0d59bf49ebc336d7e1cc40ae35a404dcb8c7006 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Jun 2007 13:19:20 +0300 Subject: Bug #29116: Test "rpl_change_master" returns different counters from relay Updated the test to return columns vertically. mysql-test/r/rpl_change_master.result: Bug #29116: test updated mysql-test/t/rpl_change_master.test: Bug #29116: test updated --- mysql-test/t/rpl_change_master.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/rpl_change_master.test b/mysql-test/t/rpl_change_master.test index e7ae798b1a7..acb34b31ea2 100644 --- a/mysql-test/t/rpl_change_master.test +++ b/mysql-test/t/rpl_change_master.test @@ -14,11 +14,11 @@ select * from t1; --replace_result $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 8 # 9 # 23 # 33 # --replace_column 1 # 33 # -show slave status; +query_vertical show slave status; change master to master_user='root'; --replace_result $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 8 # 9 # 23 # 33 # -show slave status; +query_vertical show slave status; # Will restart from after the values(2), which is bug select release_lock("a"); start slave; -- cgit v1.2.1 From e855bf33b36586c4abca0b905608682f21752b75 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Jun 2007 12:25:07 +0500 Subject: Fixed bug #28898. For a join query with GROUP BY and/or ORDER BY and a view reference in the FROM list the metadata erroneously showed empty table aliases and database names for the view columns. sql/item.h: Fixed bug #28898. Body of Item_ref::get_tmp_table_item method has been moved to item.cc file. mysql-test/t/metadata.test: Updated test case for bug #28898. sql/item.cc: Fixed bug #28898. The Item_ref::get_tmp_table_item method has been modified to copy pointers to the table alias and database name to the new Item_field object created for a field stored in the temporary table. mysql-test/r/metadata.result: Updated test case for bug #28898. sql/sql_select.cc: Fixed bug #28898. The change_to_use_tmp_fields function has been modified to to copy pointers to the table alias and database name from the Item_ref objects to the new Item_field objects created for fields stored in the temporary table. --- mysql-test/t/metadata.test | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/metadata.test b/mysql-test/t/metadata.test index df4acec2021..ed510bc2c89 100644 --- a/mysql-test/t/metadata.test +++ b/mysql-test/t/metadata.test @@ -90,5 +90,26 @@ select a.* from (select 2147483648 as v_large) a; select a.* from (select 214748364 as v_small) a; --disable_metadata +# +# Bug #28898: table alias and database name of VIEW columns is empty in the +# metadata of # SELECT statement where join is executed via temporary table. +# + +CREATE TABLE t1 (c1 CHAR(1)); +CREATE TABLE t2 (c2 CHAR(1)); +CREATE VIEW v1 AS SELECT t1.c1 FROM t1; +CREATE VIEW v2 AS SELECT t2.c2 FROM t2; +INSERT INTO t1 VALUES ('1'), ('2'), ('3'); +INSERT INTO t2 VALUES ('1'), ('2'), ('3'), ('2'); + +--enable_metadata +SELECT v1.c1 FROM v1 JOIN t2 ON c1=c2 ORDER BY 1; +SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2; +SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1; +SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1 ORDER BY v2.c2; +--disable_metadata + +DROP VIEW v1; +DROP TABLE t1,t2; --echo End of 5.0 tests -- cgit v1.2.1 From 8e35de2a908e3aab4c334574be375d00dbbbf8d2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Jun 2007 14:21:48 +0500 Subject: metadata.test, metadata.result: Updated test case for bug #28898. Additional cleanup. mysql-test/t/metadata.test: Updated test case for bug #28898. Additional cleanup. mysql-test/r/metadata.result: Updated test case for bug #28898. Additional cleanup. --- mysql-test/t/metadata.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/metadata.test b/mysql-test/t/metadata.test index ed510bc2c89..65c062399b7 100644 --- a/mysql-test/t/metadata.test +++ b/mysql-test/t/metadata.test @@ -109,7 +109,7 @@ SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1; SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1 ORDER BY v2.c2; --disable_metadata -DROP VIEW v1; +DROP VIEW v1,v2; DROP TABLE t1,t2; --echo End of 5.0 tests -- cgit v1.2.1 From 39bf2b966214eebc79ca13a255c63e9685eab164 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Jun 2007 12:43:14 -0700 Subject: Fixed bug #29104: assertion abort for grouping queries using views. The abort happened when a query contained a conjunctive predicate of the form 'view column = constant' in the WHERE condition and the grouping list also contained a reference to a view column yet a different one. Removed the failing assertion as invalid in a general case. Also fixed a bug that prevented applying some optimization for grouping queries using views. If the WHERE condition of such a query contains a conjunctive condition of the form 'view column = constant' and this view column is used in the grouping list then grouping by this column can be eliminated. The bug blocked performing this elimination. mysql-test/r/view.result: Added a test case for bug #29104. mysql-test/t/view.test: Added a test case for bug #29104. sql/item.cc: Fixed bug #29104: assertion abort for grouping queries using views. The abort happened when a query contained a conjunctive predicate of the form 'view column = constant' in the WHERE condition and the grouping list also contained a reference to a view column yet a different one. Removed the failing assertion as invalid in a general case. Also fixed a bug that prevented applying some optimization for grouping queries using views. If the WHERE condition of such a query contains a conjunctive condition of the form 'view column = constant' and this view column is used in the grouping list then grouping by this column can be eliminated. The bug blocked performing this elimination. This bug was in the function Item_field::eq while the failing assertion was in the function Item_direct_view_ref::eq. --- mysql-test/t/view.test | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 3c370da4139..f670ac8a49d 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3324,4 +3324,28 @@ SELECT * FROM t1; DROP VIEW v1,v2; DROP TABLE t1,t2,t3,t4; +# +# Bug #29104: assertion abort for a query with a view column reference +# in the GROUP BY list and a condition requiring the value +# of another view column to be equal to a constant +# + +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,2), (2,2), (1,3), (1,2); + +CREATE VIEW v1 AS SELECT a, b+1 as b FROM t1; + + +SELECT b, SUM(a) FROM v1 WHERE b=3 GROUP BY b; +EXPLAIN SELECT b, SUM(a) FROM v1 WHERE b=3 GROUP BY b; + +SELECT a, SUM(b) FROM v1 WHERE b=3 GROUP BY a; +EXPLAIN SELECT a, SUM(b) FROM v1 WHERE b=3 GROUP BY a; + +SELECT a, SUM(b) FROM v1 WHERE a=1 GROUP BY a; +EXPLAIN SELECT a, SUM(b) FROM v1 WHERE a=1 GROUP BY a; + +DROP VIEW v1; +DROP TABLE t1; + --echo End of 5.0 tests. -- cgit v1.2.1 From b5eb3fcb821d8dd6a105257b16eed61f168cf5cb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Jun 2007 02:11:28 +0500 Subject: Fixed bug #28293. Occasionally mysqlbinlog --hexdump failed with error: ERROR 1064 (42000) at line ...: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Query thread_id=... exec_time=... error_code=... When the length of hexadecimal dump of binlog header was divisible by 16, commentary sign '#' after header was lost. The Log_event::print_header function has been modified to always finish hexadecimal binlog header with "\n# ". sql/log_event.cc: Fixed bug #28293. The Log_event::print_header function has been modified to always finish hexadecimal binlog header with "\n# ". mysql-test/r/mysqlbinlog.result: Updated test case for bug #28293. mysql-test/t/mysqlbinlog.test: Updated test case for bug #28293. --- mysql-test/t/mysqlbinlog.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index ba161ddbb89..bd90dcfb930 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -203,4 +203,17 @@ flush logs; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000009 +# +# Bug#28293 missed '#' sign in the hex dump when the dump length +# is divisible by 16. +# + +CREATE TABLE t1 (c1 CHAR(10)); +# we need this for getting fixed timestamps inside of this test +flush logs; +INSERT INTO t1 VALUES ('0123456789'); +flush logs; +DROP TABLE t1; +--exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000011 | grep 'Query' | sed 's/[0-9]\{1,\}/REMOVED/g' + --echo End of 5.0 tests -- cgit v1.2.1 From 1bab1ddc553f5ccb836488e473ddcc09e9e77b7d Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 24 Jun 2007 01:20:14 +0500 Subject: Fixed bug #29095. INSERT into table from SELECT from the same table with ORDER BY and LIMIT was inserting other data than sole SELECT ... ORDER BY ... LIMIT returns. One part of the patch for bug #9676 improperly pushed LIMIT to temporary table in the presence of the ORDER BY clause. That part has been removed. sql/sql_select.cc: Fixed bug #29095. One part of the patch for bug #9676 improperly pushed LIMIT to temporary table in the presence of the ORDER BY clause. That part has been removed. mysql-test/t/insert_select.test: Expanded the test case for bug #9676. Created a test case for bug #29095. mysql-test/r/insert_select.result: Expanded the test case for bug #9676. Created a test case for bug #29095. --- mysql-test/t/insert_select.test | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index bbc51be6dc9..bf6dae96847 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -233,7 +233,9 @@ drop table t1,t2; CREATE TABLE t1 (a int PRIMARY KEY); INSERT INTO t1 values (1), (2); +flush status; INSERT INTO t1 SELECT a + 2 FROM t1 LIMIT 1; +show status like 'Handler_read%'; DROP TABLE t1; @@ -332,3 +334,26 @@ INSERT INTO t2 (d) SELECT * FROM t2; DROP TABLE t1,t2; + +# +# Bug #29095: incorrect pushing of LIMIT into the temporary +# table ignoring ORDER BY clause +# + +CREATE TABLE t1 ( + id INT AUTO_INCREMENT PRIMARY KEY, + prev_id INT, + join_id INT DEFAULT 0); + +INSERT INTO t1 (prev_id) VALUES (NULL), (1), (2); +SELECT * FROM t1; + +CREATE TABLE t2 (join_id INT); +INSERT INTO t2 (join_id) VALUES (0); + +INSERT INTO t1 (prev_id) SELECT id + FROM t2 LEFT JOIN t1 ON t1.join_id = t2.join_id + ORDER BY id DESC LIMIT 1; +SELECT * FROM t1; + +DROP TABLE t1,t2; -- cgit v1.2.1