diff options
author | unknown <gshchepa/uchum@gleb.loc> | 2007-06-24 03:35:27 +0500 |
---|---|---|
committer | unknown <gshchepa/uchum@gleb.loc> | 2007-06-24 03:35:27 +0500 |
commit | 26b526dc608ffb16e46729de6638d1ee9d668907 (patch) | |
tree | d8246af6017c853cb8d2e86ed1cc7972bf2bd9ea /mysql-test/t | |
parent | fdbefa8d528faf8e1d99d251c23c8a77f14b1aa2 (diff) | |
parent | d37471b4ef931a0b945e20753203dbc3a266bcd5 (diff) | |
download | mariadb-git-26b526dc608ffb16e46729de6638d1ee9d668907.tar.gz |
Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into gleb.loc:/home/uchum/work/bk/5.1-opt
libmysql/libmysql.c:
Merge with 5.0-opt.
mysql-test/r/insert_select.result:
Merge with 5.0-opt.
mysql-test/r/mysqlbinlog.result:
Merge with 5.0-opt.
mysql-test/r/rpl_change_master.result:
Merge with 5.0-opt.
mysql-test/r/view.result:
Merge with 5.0-opt.
mysql-test/t/insert_select.test:
Merge with 5.0-opt.
mysql-test/t/mysqlbinlog.test:
Merge with 5.0-opt.
mysql-test/t/rpl_change_master.test:
Merge with 5.0-opt.
mysql-test/t/view.test:
Merge with 5.0-opt.
sql/item.cc:
Merge with 5.0-opt.
sql/item.h:
Merge with 5.0-opt.
sql/log_event.cc:
Merge with 5.0-opt.
sql/sql_select.cc:
Merge with 5.0-opt.
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/insert_select.test | 25 | ||||
-rw-r--r-- | mysql-test/t/metadata.test | 21 | ||||
-rw-r--r-- | mysql-test/t/mysqlbinlog.test | 17 | ||||
-rw-r--r-- | mysql-test/t/rpl_change_master.test | 8 | ||||
-rw-r--r-- | mysql-test/t/view.test | 24 |
5 files changed, 89 insertions, 6 deletions
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index 655b43d65ad..10bc58303ca 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; @@ -319,3 +321,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; diff --git a/mysql-test/t/metadata.test b/mysql-test/t/metadata.test index df4acec2021..65c062399b7 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,v2; +DROP TABLE t1,t2; --echo End of 5.0 tests diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 39a84304ebd..92f4b34da83 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -206,6 +206,19 @@ flush logs; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000010 +# +# 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.000012 | grep 'Query' | sed 's/[0-9]\{1,\}/REMOVED/g' + --echo End of 5.0 tests # @@ -213,7 +226,7 @@ flush logs; # flush logs; --error 1 ---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000012 >/dev/null 2>/dev/null ---exec $MYSQL_BINLOG --force-if-open $MYSQLTEST_VARDIR/log/master-bin.000012 >/dev/null 2>/dev/null +--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000014 >/dev/null 2>/dev/null +--exec $MYSQL_BINLOG --force-if-open $MYSQLTEST_VARDIR/log/master-bin.000014 >/dev/null 2>/dev/null --echo End of 5.1 tests diff --git a/mysql-test/t/rpl_change_master.test b/mysql-test/t/rpl_change_master.test index c031464c95e..c5249e15f71 100644 --- a/mysql-test/t/rpl_change_master.test +++ b/mysql-test/t/rpl_change_master.test @@ -19,12 +19,12 @@ connection slave; --real_sleep 3 # wait for I/O thread to have read updates stop slave; --replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 23 # 33 # -show slave status; +--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # +query_vertical show slave status; change master to master_user='root'; --replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 23 # 33 # -show slave status; +--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # +query_vertical show slave status; start slave; sync_with_master; select * from t1; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 03d7a52c640..c441c7b5efc 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3316,6 +3316,30 @@ 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. # |