diff options
author | Michael Widenius <monty@askmonty.org> | 2011-03-09 19:45:48 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-03-09 19:45:48 +0200 |
commit | e6b0be38f9ea03b4f657b210755f6891ce2a30f0 (patch) | |
tree | b939c86916f6ab3745286dd9e19928e0c4041f13 /mysql-test/r/union.result | |
parent | 251a5fa97598c8f0e7e0759880503d0932ca2918 (diff) | |
download | mariadb-git-e6b0be38f9ea03b4f657b210755f6891ce2a30f0.tar.gz |
Bug fix for lp:732124 union + limit returns wrong result
mysql-test/r/union.result:
Added test for lp:732124
mysql-test/t/union.test:
Added test for lp:732124
sql/sp_rcontext.cc:
Updated function definition for ::send_data()
sql/sp_rcontext.h:
Updated function definition for ::send_data()
sql/sql_analyse.cc:
Test if send_data() returned an error
sql/sql_class.cc:
Updated function definition for ::send_data()
sql/sql_class.h:
Changed select_result::send_data(List<Item> &items) to return -1 in case of duplicate row that should not be counted as part of LIMIT
sql/sql_cursor.cc:
Check if send_data returned error
sql/sql_delete.cc:
Updated function definition for ::send_data()
sql/sql_insert.cc:
Updated function definition for ::send_data()
sql/sql_select.cc:
Don't count rows which send_data() tells you to ignore
sql/sql_union.cc:
Inform caller that the row should be ignored. This is the real bug fix for lp:732124
sql/sql_update.cc:
Updated function definition for ::send_data()
Diffstat (limited to 'mysql-test/r/union.result')
-rw-r--r-- | mysql-test/r/union.result | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 054f416bfd4..d66db1ad211 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -414,7 +414,7 @@ a 5 select found_rows(); found_rows() -6 +5 SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 100 UNION SELECT * FROM t2; a 1 @@ -447,7 +447,7 @@ a 4 select found_rows(); found_rows() -6 +5 SELECT SQL_CALC_FOUND_ROWS * FROM t1 limit 2,2 UNION SELECT * FROM t2; a 3 @@ -1208,9 +1208,12 @@ a b select * from ((select * from t1 limit 1) union (select * from t1 limit 1)) a; a b 1 a +2 b select * from ((select * from t1 limit 1) union (select * from t1 limit 1) union (select * from t1 limit 1)) a; a b 1 a +2 b +3 c select * from ((((select * from t1))) union (select * from t1) union (select * from t1)) a; a b 1 a @@ -1647,4 +1650,17 @@ b 1 2 DROP TABLE t1,t2; +create table t1 (a int); +insert into t1 values (10),(10),(10),(2),(3),(4),(5),(6),(7),(8),(9),(1),(10); +select a from t1 where false UNION select a from t1 limit 8; +a +10 +2 +3 +4 +5 +6 +7 +8 +drop table t1; End of 5.1 tests |