diff options
-rw-r--r-- | Docs/manual.texi | 10 | ||||
-rw-r--r-- | mysql-test/r/union.result | 10 | ||||
-rw-r--r-- | mysql-test/t/union.test | 4 | ||||
-rw-r--r-- | sql/sql_union.cc | 5 |
4 files changed, 28 insertions, 1 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi index 9a99eb9deff..4b5a8dbb8a9 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -48762,6 +48762,16 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. @itemize @bullet @item +Fixed bug in UNION's with last offset being transposed to total result set +@item +Fixed that DEFAULT_SELECT_LIMIT is always imposed on UNION's result set +@item +Fixed that some SELECT options can appear only in the first SELECT +@item +Fixed bug with LIMIT with UNION, where last select is in the braces +@item +Fixed that fulltext works fine with UNION's +@item Fixed bug with indexless boolean full-text search. @item Fixed bug that sometimes appeared when full-text search was used diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 113f6680167..ef82b414420 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -177,4 +177,14 @@ a 11 12 13 +(select * from t1 limit 2) union (select * from t2 limit 20,3); +a +1 +2 +set SQL_SELECT_LIMIT=2; +(select * from t1 limit 2) union (select * from t2 limit 3); +a +1 +2 +set SQL_SELECT_LIMIT=DEFAULT; drop table t1,t2; diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index f648ebfd48c..086351e9da1 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -84,4 +84,8 @@ insert into t1 values (1),(2),(3),(4),(5); insert into t2 values (11),(12),(13),(14),(15); (select * from t1 limit 2) union (select * from t2 limit 3) limit 4; (select * from t1 limit 2) union (select * from t2 limit 3); +(select * from t1 limit 2) union (select * from t2 limit 20,3); +set SQL_SELECT_LIMIT=2; +(select * from t1 limit 2) union (select * from t2 limit 3); +set SQL_SELECT_LIMIT=DEFAULT; drop table t1,t2; diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 0aca2668941..1658fa701c5 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -186,7 +186,10 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) thd->options&= ~OPTION_FOUND_ROWS; } else - thd->select_limit= HA_POS_ERROR; // no limit + { + thd->offset_limit= 0; + thd->select_limit= thd->default_select_limit; + } if (describe) thd->select_limit= HA_POS_ERROR; // no limit res=mysql_select(thd,&result_table_list, |