Below is the list of changes that have just been committed into a local
4.1 repository of Sinisa. When Sinisa does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
ChangeSet
1.1581 03/09/13 19:56:58 Sinisa@stripped +4 -0
Fixes for OPTION_FOUND_ROWS in UNION's
sql/sql_union.cc
1.97 03/09/13 19:56:52 Sinisa@stripped +3 -2
Fixes for OPTION_FOUND_ROWS in UNION's
sql/sql_parse.cc
1.294 03/09/13 19:56:52 Sinisa@stripped +1 -1
Fixes for OPTION_FOUND_ROWS in UNION's
mysql-test/r/union.result
1.46 03/09/13 19:56:52 Sinisa@stripped +2 -2
two changes.
First one is due to the proper handling of LIMIT offset, limit in
UNION without all.
Second is a change in behaviour due to the fact that ORDER by in a
UNION without braces is not now applicable to the last SELECT node.
It can not be applied until one bug is fixed (after my vacation).
Should be documented.
mysql-test/r/subselect.result
1.92 03/09/13 19:56:52 Sinisa@stripped +2 -0
A warning added to subselect test due to the recent changes.
UNION in sub-select returns the empty set, which is why this warning is
a mistery to me.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: Sinisa
# Host: sinisa.nasamreza.org
# Root: /mnt/work/mysql-4.1
--- 1.293/sql/sql_parse.cc Thu Sep 11 20:31:37 2003
+++ 1.294/sql/sql_parse.cc Sat Sep 13 19:56:52 2003
@@ -1729,7 +1729,7 @@
if (unit->select_limit_cnt <
(ha_rows) unit->global_parameters->select_limit)
unit->select_limit_cnt= HA_POS_ERROR; // no limit
- if (unit->select_limit_cnt == HA_POS_ERROR)
+ if (unit->select_limit_cnt == HA_POS_ERROR && !select_lex->next_select())
select_lex->options&= ~OPTION_FOUND_ROWS;
if (!(res=open_and_lock_tables(thd,tables)))
--- 1.45/mysql-test/r/union.result Thu Sep 11 19:06:09 2003
+++ 1.46/mysql-test/r/union.result Sat Sep 13 19:56:52 2003
@@ -409,7 +409,7 @@
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2,2;
a
3
-4
+5
select found_rows();
found_rows()
6
@@ -423,7 +423,7 @@
5
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a desc LIMIT 1;
a
-5
+3
(SELECT * FROM t1 ORDER by a) UNION ALL (SELECT * FROM t2 ORDER BY a) ORDER BY A desc LIMIT 4;
a
5
--- 1.96/sql/sql_union.cc Thu Sep 11 19:06:12 2003
+++ 1.97/sql/sql_union.cc Sat Sep 13 19:56:52 2003
@@ -281,7 +281,7 @@
*/
sl->options|= found_rows_for_union;
}
-
+ sl->join->select_options=sl->options;
/*
As far as union share table space we should reassign table map,
which can be spoiled by 'prepare' of JOIN of other UNION parts
@@ -311,6 +311,7 @@
records_at_start= table->file->records;
sl->join->exec();
res= sl->join->error;
+ offset_limit_cnt= sl->offset_limit;
if (!res && union_result->flush())
{
thd->lex.current_select= lex_select_save;
@@ -332,7 +333,7 @@
We get this from the difference of between total number of possible
rows and actual rows added to the temporary table.
*/
- add_rows+= (ha_rows) (thd->limit_found_rows - (ulonglong)
+ add_rows+= (ulonglong) (thd->limit_found_rows - (ulonglong)
((table->file->records - records_at_start)));
}
}
--- 1.91/mysql-test/r/subselect.result Wed Sep 10 09:43:28 2003
+++ 1.92/mysql-test/r/subselect.result Sat Sep 13 19:56:52 2003
@@ -1046,6 +1046,8 @@
) TYPE=MyISAM CHARSET=latin1
drop table t1;
CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a;
+Warnings:
+Warning 1262 Data truncated, NULL supplied to NOT NULL column 'a' at row 1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (