3674 Georgi Kodinov 2009-11-10 [merge]
merge
modified:
mysql-test/r/select.result
mysql-test/r/select_jcl6.result
mysql-test/t/select.test
sql/sql_select.cc
3673 Georgi Kodinov 2009-11-10 [merge]
merged
=== modified file 'mysql-test/r/select.result'
--- a/mysql-test/r/select.result 2009-11-03 09:42:49 +0000
+++ b/mysql-test/r/select.result 2009-11-10 11:39:00 +0000
@@ -4414,6 +4414,20 @@ ROW(a,a) <=> ROW((SELECT 1 FROM t1 WHERE
INTO @var0;
ERROR 21000: Subquery returns more than 1 row
DROP TABLE t1;
+#
+# Bug #48458: simple query tries to allocate enormous amount of
+# memory
+#
+CREATE TABLE t1(a INT NOT NULL, b YEAR);
+INSERT INTO t1 VALUES ();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+CREATE TABLE t2(c INT);
+# Should not err out because of out-of-memory
+SELECT 1 FROM t2 JOIN t1 ON 1=1
+WHERE a != '1' AND NOT a >= b OR NOT ROW(b,a )<> ROW(a,a);
+1
+DROP TABLE t1,t2;
End of 5.0 tests
create table t1(a INT, KEY (a));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
=== modified file 'mysql-test/r/select_jcl6.result'
--- a/mysql-test/r/select_jcl6.result 2009-10-30 15:36:45 +0000
+++ b/mysql-test/r/select_jcl6.result 2009-11-10 11:39:00 +0000
@@ -4418,6 +4418,20 @@ ROW(a,a) <=> ROW((SELECT 1 FROM t1 WHERE
INTO @var0;
ERROR 21000: Subquery returns more than 1 row
DROP TABLE t1;
+#
+# Bug #48458: simple query tries to allocate enormous amount of
+# memory
+#
+CREATE TABLE t1(a INT NOT NULL, b YEAR);
+INSERT INTO t1 VALUES ();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+CREATE TABLE t2(c INT);
+# Should not err out because of out-of-memory
+SELECT 1 FROM t2 JOIN t1 ON 1=1
+WHERE a != '1' AND NOT a >= b OR NOT ROW(b,a )<> ROW(a,a);
+1
+DROP TABLE t1,t2;
End of 5.0 tests
create table t1(a INT, KEY (a));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
=== modified file 'mysql-test/t/select.test'
--- a/mysql-test/t/select.test 2009-10-30 14:51:16 +0000
+++ b/mysql-test/t/select.test 2009-11-10 11:39:00 +0000
@@ -3759,6 +3759,19 @@ INTO @var0;
DROP TABLE t1;
+--echo #
+--echo # Bug #48458: simple query tries to allocate enormous amount of
+--echo # memory
+--echo #
+
+CREATE TABLE t1(a INT NOT NULL, b YEAR);
+INSERT INTO t1 VALUES ();
+CREATE TABLE t2(c INT);
+--echo # Should not err out because of out-of-memory
+SELECT 1 FROM t2 JOIN t1 ON 1=1
+ WHERE a != '1' AND NOT a >= b OR NOT ROW(b,a )<> ROW(a,a);
+DROP TABLE t1,t2;
+
--echo End of 5.0 tests
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc 2009-11-10 10:39:20 +0000
+++ b/sql/sql_select.cc 2009-11-10 11:39:00 +0000
@@ -11670,12 +11670,12 @@ static COND *build_equal_items_for_cond(
{
item_equal->fix_length_and_dec();
item_equal->update_used_tables();
+ set_if_bigger(thd->lex->current_select->max_equal_elems,
+ item_equal->members());
+ return item_equal;
}
- else
- item_equal= (Item_equal *) eq_list.pop();
- set_if_bigger(thd->lex->current_select->max_equal_elems,
- item_equal->members());
- return item_equal;
+
+ return eq_list.pop();
}
else
{
Attachment: [text/bzr-bundle] bzr/joro@sun.com-20091110113900-zz3ww0y5vhrj2080.bundle
| Thread |
|---|
| • bzr push into mysql-pe branch (joro:3673 to 3674) | Georgi Kodinov | 10 Nov |