diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/rpl_skip_error.result | 2 | ||||
-rw-r--r-- | mysql-test/r/view.result | 24 | ||||
-rw-r--r-- | mysql-test/t/rpl_skip_error.test | 1 | ||||
-rw-r--r-- | mysql-test/t/view.test | 24 |
4 files changed, 50 insertions, 1 deletions
diff --git a/mysql-test/r/rpl_skip_error.result b/mysql-test/r/rpl_skip_error.result index 5e67409a3d7..22ba357ef49 100644 --- a/mysql-test/r/rpl_skip_error.result +++ b/mysql-test/r/rpl_skip_error.result @@ -31,5 +31,5 @@ a 2 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -Waiting for master to send event 127.0.0.1 root MASTER_PORT 1 master-bin.000001 843 slave-relay-bin.000003 981 master-bin.000001 Yes Yes 0 0 843 981 None 0 No 0 +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 843 # # master-bin.000001 Yes Yes 0 0 843 # None 0 No # drop table t1; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 043057f64f7..9adb3f96142 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3476,4 +3476,28 @@ a1 c 2 0 DROP VIEW v1,v2; DROP TABLE t1,t2,t3,t4; +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; +b SUM(a) +3 4 +EXPLAIN SELECT b, SUM(a) FROM v1 WHERE b=3 GROUP BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where +SELECT a, SUM(b) FROM v1 WHERE b=3 GROUP BY a; +a SUM(b) +1 6 +2 3 +EXPLAIN SELECT a, SUM(b) FROM v1 WHERE b=3 GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort +SELECT a, SUM(b) FROM v1 WHERE a=1 GROUP BY a; +a SUM(b) +1 10 +EXPLAIN SELECT a, SUM(b) FROM v1 WHERE a=1 GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where +DROP VIEW v1; +DROP TABLE t1; End of 5.0 tests. diff --git a/mysql-test/t/rpl_skip_error.test b/mysql-test/t/rpl_skip_error.test index 19eb2d8ae5e..baa7a88b8bb 100644 --- a/mysql-test/t/rpl_skip_error.test +++ b/mysql-test/t/rpl_skip_error.test @@ -31,6 +31,7 @@ sync_slave_with_master; connection slave; select @@server_id; select * from t1; +--replace_column 1 # 8 # 9 # 23 # 33 # --replace_result $MASTER_MYPORT MASTER_PORT show slave status; connection master; 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. |