Commit d72e1f77 authored by MySQL Build Team's avatar MySQL Build Team

Backport into build-201003230706-5.1.43sp1

> ------------------------------------------------------------
> revno: 3345.2.1
> revision-id: joro@sun.com-20100218084815-53nb9oonzd7r4gmj
> parent: sergey.glukhov@sun.com-20100217121457-jqx19u6x387rgk7e
> committer: Georgi Kodinov <joro@sun.com>
> branch nick: fix-5.1-bugteam
> timestamp: Thu 2010-02-18 10:48:15 +0200
> message:
>   Bug #51049: main.bug39022 fails in mysql-trunk-merge
>   
>   Fixed the test to behave correctly with ps-protocol
>   and binlog format row.

> ------------------------------------------------------------
> revno: 3333.1.6
> revision-id: joro@sun.com-20100129093628-sze9cv0neu0xbabm
> parent: davi.arnaut@sun.com-20100128215140-x0w6fe2de0b28opp
> committer: Georgi Kodinov <joro@sun.com>
> branch nick: B49552-5.1-bugteam
> timestamp: Fri 2010-01-29 11:36:28 +0200
> message:
>   Bug #49552 : sql_buffer_result cause crash + not found records
>     in multitable delete/subquery
>   
>   SQL_BUFFER_RESULT should not have an effect on non-SELECT 
>   statements according to our documentation.
>   Fixed by not passing it through to multi-table DELETE (similarly
>   to how it's done for multi-table UPDATE).
parent d7e9fd7e
......@@ -278,6 +278,18 @@ DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
ERROR 42000: Incorrect number of arguments for FUNCTION test.f1; expected 0, got 1
DROP TABLE t1;
DROP FUNCTION f1;
#
# Bug #49552 : sql_buffer_result cause crash + not found records
# in multitable delete/subquery
#
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1),(2),(3);
SET SESSION SQL_BUFFER_RESULT=1;
DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
SET SESSION SQL_BUFFER_RESULT=DEFAULT;
SELECT * FROM t1;
a
DROP TABLE t1;
End of 5.0 tests
#
# Bug#46958: Assertion in Diagnostics_area::set_ok_status, trigger,
......
......@@ -291,6 +291,21 @@ DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
DROP TABLE t1;
DROP FUNCTION f1;
--echo #
--echo # Bug #49552 : sql_buffer_result cause crash + not found records
--echo # in multitable delete/subquery
--echo #
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1),(2),(3);
SET SESSION SQL_BUFFER_RESULT=1;
DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
SET SESSION SQL_BUFFER_RESULT=DEFAULT;
SELECT * FROM t1;
DROP TABLE t1;
--echo End of 5.0 tests
--echo #
......
......@@ -3350,9 +3350,9 @@ end_with_restore_list:
select_lex->where,
0, (ORDER *)NULL, (ORDER *)NULL, (Item *)NULL,
(ORDER *)NULL,
select_lex->options | thd->options |
(select_lex->options | thd->options |
SELECT_NO_JOIN_CACHE | SELECT_NO_UNLOCK |
OPTION_SETUP_TABLES_DONE,
OPTION_SETUP_TABLES_DONE) & ~OPTION_BUFFER_RESULT,
del_result, unit, select_lex);
res|= thd->is_error();
if (res)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment