Post-merge fix.

This commit is contained in:
igor@olga.mysql.com 2007-05-14 18:26:00 -07:00
parent 25f5e7d999
commit 22dfb9f0f7
2 changed files with 40 additions and 0 deletions

View File

@ -1114,6 +1114,28 @@ execute stmt;
show create table t1; show create table t1;
drop table t1; drop table t1;
deallocate prepare stmt; deallocate prepare stmt;
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (2), (3), (1);
PREPARE st1 FROM
'(SELECT a FROM t1) UNION (SELECT a+10 FROM t1) ORDER BY RAND()*0+a';
EXECUTE st1;
a
1
2
3
11
12
13
EXECUTE st1;
a
1
2
3
11
12
13
DEALLOCATE PREPARE st1;
DROP TABLE t1;
End of 4.1 tests. End of 4.1 tests.
create table t1 (a varchar(20)); create table t1 (a varchar(20));
insert into t1 values ('foo'); insert into t1 values ('foo');

View File

@ -1194,6 +1194,24 @@ show create table t1;
--enable_warnings --enable_warnings
drop table t1; drop table t1;
deallocate prepare stmt; deallocate prepare stmt;
#
#
# Bug #27937: crash on the second execution for prepared statement
# from UNION with ORDER BY an expression containing RAND()
#
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (2), (3), (1);
PREPARE st1 FROM
'(SELECT a FROM t1) UNION (SELECT a+10 FROM t1) ORDER BY RAND()*0+a';
EXECUTE st1;
EXECUTE st1;
DEALLOCATE PREPARE st1;
DROP TABLE t1;
--echo End of 4.1 tests. --echo End of 4.1 tests.