Commit 8766627d authored by Sinisa@sinisa.nasamreza.org's avatar Sinisa@sinisa.nasamreza.org
Browse files

Fixes for offset bug in UNION's and making UNION's obey

SELECT_DEFAULT_LIMIT
parent a36bb38b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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
+10 −0
Original line number Diff line number Diff line
@@ -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;
+4 −0
Original line number Diff line number Diff line
@@ -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;
+4 −1
Original line number Diff line number Diff line
@@ -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,