Commit 3100f891 authored by igor@rurik.mysql.com's avatar igor@rurik.mysql.com

Manual merge

parents 109560c5 d9f66a26
Branches unavailable
Tags unavailable
No related merge requests found
......@@ -163,3 +163,12 @@ select * from t1;
a b
7 7
drop table t1;
CREATE TABLE t1 ( a int PRIMARY KEY );
DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a;
INSERT INTO t1 VALUES (0),(1),(2);
DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1;
SELECT * FROM t1;
a
0
2
DROP TABLE t1;
......@@ -141,3 +141,14 @@ delete t1 from t1 where a = 3;
check table t1;
select * from t1;
drop table t1;
#
# Bug #8392: delete with ORDER BY containing a direct reference to the table
#
CREATE TABLE t1 ( a int PRIMARY KEY );
DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a;
INSERT INTO t1 VALUES (0),(1),(2);
DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1;
SELECT * FROM t1;
DROP TABLE t1;
......@@ -117,6 +117,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, SQL_LIST *order,
bzero((char*) &tables,sizeof(tables));
tables.table = table;
tables.alias = table_list->alias;
table->sort.io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE),
MYF(MY_FAE | MY_ZEROFILL));
......
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