mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge pilot.blaudden:/home/msvensson/mysql/bug27438/my50-bug27438
into pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
This commit is contained in:
@ -2307,16 +2307,23 @@ sub check_running_as_root () {
|
||||
close FILE;
|
||||
}
|
||||
|
||||
chmod(oct("0755"), $test_file);
|
||||
unlink($test_file);
|
||||
# Some filesystems( for example CIFS) allows reading a file
|
||||
# although mode was set to 0000, but in that case a stat on
|
||||
# the file will not return 0000
|
||||
my $file_mode= (stat($test_file))[2] & 07777;
|
||||
|
||||
$ENV{'MYSQL_TEST_ROOT'}= "NO";
|
||||
if ($result eq "MySQL")
|
||||
mtr_verbose("result: $result, file_mode: $file_mode");
|
||||
if ($result eq "MySQL" && $file_mode == 0)
|
||||
{
|
||||
mtr_warning("running this script as _root_ will cause some " .
|
||||
"tests to be skipped");
|
||||
$ENV{'MYSQL_TEST_ROOT'}= "YES";
|
||||
}
|
||||
|
||||
chmod(oct("0755"), $test_file);
|
||||
unlink($test_file);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -352,3 +352,13 @@ select c1 mod 50 as result from t1;
|
||||
result
|
||||
6
|
||||
drop table t1;
|
||||
select cast(19999999999999999999 as signed);
|
||||
cast(19999999999999999999 as signed)
|
||||
9223372036854775807
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
select cast(-19999999999999999999 as signed);
|
||||
cast(-19999999999999999999 as signed)
|
||||
-9223372036854775808
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
|
@ -737,4 +737,30 @@ SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1;
|
||||
GROUP_CONCAT(DISTINCT UCASE(b))
|
||||
ONE.1,TWO.2,ONE.3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1( a VARCHAR( 10 ), b INT );
|
||||
INSERT INTO t1 VALUES ( repeat( 'a', 10 ), 1),
|
||||
( repeat( 'b', 10 ), 2);
|
||||
SET group_concat_max_len = 20;
|
||||
SELECT GROUP_CONCAT( a ) FROM t1;
|
||||
GROUP_CONCAT( a )
|
||||
aaaaaaaaaa,bbbbbbbbb
|
||||
Warnings:
|
||||
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
|
||||
SELECT GROUP_CONCAT( DISTINCT a ) FROM t1;
|
||||
GROUP_CONCAT( DISTINCT a )
|
||||
aaaaaaaaaa,bbbbbbbbb
|
||||
Warnings:
|
||||
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
|
||||
SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
|
||||
GROUP_CONCAT( a ORDER BY b )
|
||||
aaaaaaaaaa,bbbbbbbbb
|
||||
Warnings:
|
||||
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
|
||||
SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1;
|
||||
GROUP_CONCAT( DISTINCT a ORDER BY b )
|
||||
aaaaaaaaaa,bbbbbbbbb
|
||||
Warnings:
|
||||
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
|
||||
SET group_concat_max_len = DEFAULT;
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -1330,4 +1330,51 @@ SELECT a,AVG(DISTINCT b) AS average FROM t1 GROUP BY a HAVING average > 50;
|
||||
a average
|
||||
1 32768.5000
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 ( a INT, b INT, KEY(a) );
|
||||
INSERT INTO t1 VALUES (NULL, 1), (NULL, 2);
|
||||
EXPLAIN SELECT MIN(a), MIN(b) FROM t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
|
||||
SELECT MIN(a), MIN(b) FROM t1;
|
||||
MIN(a) MIN(b)
|
||||
NULL 1
|
||||
CREATE TABLE t2( a INT, b INT, c INT, KEY(a, b) );
|
||||
INSERT INTO t2 ( a, b, c ) VALUES ( 1, NULL, 2 ), ( 1, 3, 4 ), ( 1, 4, 4 );
|
||||
EXPLAIN SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref a a 5 const 2 Using where
|
||||
SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
|
||||
MIN(b) MIN(c)
|
||||
3 2
|
||||
CREATE TABLE t3 (a INT, b INT, c int, KEY(a, b));
|
||||
INSERT INTO t3 VALUES (1, NULL, 1), (2, NULL, 2), (2, NULL, 2), (3, NULL, 3);
|
||||
EXPLAIN SELECT MIN(a), MIN(b) FROM t3 where a = 2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
SELECT MIN(a), MIN(b) FROM t3 where a = 2;
|
||||
MIN(a) MIN(b)
|
||||
2 NULL
|
||||
CREATE TABLE t4 (a INT, b INT, c int, KEY(a, b));
|
||||
INSERT INTO t4 VALUES (1, 1, 1), (2, NULL, 2), (2, NULL, 2), (3, 1, 3);
|
||||
EXPLAIN SELECT MIN(a), MIN(b) FROM t4 where a = 2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
SELECT MIN(a), MIN(b) FROM t4 where a = 2;
|
||||
MIN(a) MIN(b)
|
||||
2 NULL
|
||||
SELECT MIN(b), min(c) FROM t4 where a = 2;
|
||||
MIN(b) min(c)
|
||||
NULL 2
|
||||
CREATE TABLE t5( a INT, b INT, KEY( a, b) );
|
||||
INSERT INTO t5 VALUES( 1, 1 ), ( 1, 2 );
|
||||
EXPLAIN SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
|
||||
MIN(a) MIN(b)
|
||||
1 1
|
||||
SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1 and b > 1;
|
||||
MIN(a) MIN(b)
|
||||
1 2
|
||||
DROP TABLE t1, t2, t3, t4, t5;
|
||||
End of 5.0 tests
|
||||
|
@ -144,6 +144,27 @@ SELECT * FROM t1;
|
||||
c1 cnt
|
||||
1a 2
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (
|
||||
a1 decimal(10,0) DEFAULT NULL,
|
||||
a2 blob,
|
||||
a3 time DEFAULT NULL,
|
||||
a4 blob,
|
||||
a5 char(175) DEFAULT NULL,
|
||||
a6 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
a7 tinyblob,
|
||||
INDEX idx (a6,a7(239),a5)
|
||||
) ENGINE=InnoDB;
|
||||
EXPLAIN SELECT a4 FROM t1 WHERE
|
||||
a6=NULL AND
|
||||
a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
EXPLAIN SELECT t1.a4 FROM t1, t1 t WHERE
|
||||
t.a6=t.a6 AND t1.a6=NULL AND
|
||||
t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
DROP TABLE t1;
|
||||
End of 4.1 tests
|
||||
create table t1m (a int) engine=myisam;
|
||||
create table t1i (a int) engine=innodb;
|
||||
|
@ -1114,6 +1114,28 @@ execute stmt;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
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.
|
||||
create table t1 (a varchar(20));
|
||||
insert into t1 values ('foo');
|
||||
@ -1661,4 +1683,13 @@ execute stmt;
|
||||
ERROR 42S22: Unknown column 'y.value' in 'field list'
|
||||
deallocate prepare stmt;
|
||||
drop tables t1;
|
||||
prepare stmt from "create table t1 select ?";
|
||||
set @a=1.0;
|
||||
execute stmt using @a;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`?` decimal(2,1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
End of 5.0 tests.
|
||||
|
@ -1161,3 +1161,44 @@ CALL p1();
|
||||
v_text
|
||||
abc|def
|
||||
DROP PROCEDURE p1;
|
||||
DROP PROCEDURE IF EXISTS bug27415_text_test|
|
||||
DROP PROCEDURE IF EXISTS bug27415_text_test2|
|
||||
CREATE PROCEDURE bug27415_text_test(entity_id_str_in text)
|
||||
BEGIN
|
||||
DECLARE str_remainder text;
|
||||
SET str_remainder = entity_id_str_in;
|
||||
select 'before substr', str_remainder;
|
||||
SET str_remainder = SUBSTRING(str_remainder, 3);
|
||||
select 'after substr', str_remainder;
|
||||
END|
|
||||
CREATE PROCEDURE bug27415_text_test2(entity_id_str_in text)
|
||||
BEGIN
|
||||
DECLARE str_remainder text;
|
||||
DECLARE str_remainder2 text;
|
||||
SET str_remainder2 = entity_id_str_in;
|
||||
select 'before substr', str_remainder2;
|
||||
SET str_remainder = SUBSTRING(str_remainder2, 3);
|
||||
select 'after substr', str_remainder;
|
||||
END|
|
||||
CALL bug27415_text_test('a,b,c')|
|
||||
before substr str_remainder
|
||||
before substr a,b,c
|
||||
after substr str_remainder
|
||||
after substr b,c
|
||||
CALL bug27415_text_test('a,b,c')|
|
||||
before substr str_remainder
|
||||
before substr a,b,c
|
||||
after substr str_remainder
|
||||
after substr b,c
|
||||
CALL bug27415_text_test2('a,b,c')|
|
||||
before substr str_remainder2
|
||||
before substr a,b,c
|
||||
after substr str_remainder
|
||||
after substr b,c
|
||||
CALL bug27415_text_test('a,b,c')|
|
||||
before substr str_remainder
|
||||
before substr a,b,c
|
||||
after substr str_remainder
|
||||
after substr b,c
|
||||
DROP PROCEDURE bug27415_text_test|
|
||||
DROP PROCEDURE bug27415_text_test2|
|
||||
|
@ -530,8 +530,6 @@ count(*)
|
||||
drop table t3, t4|
|
||||
drop procedure bug14210|
|
||||
set @@session.max_heap_table_size=default|
|
||||
drop function if exists bug23333|
|
||||
drop table if exists t1,t2|
|
||||
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
|
||||
CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
|
||||
insert into t2 values (1,1)|
|
||||
@ -551,3 +549,4 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
select count(*),@a from t1 /* must be 1,1 */|
|
||||
count(*) @a
|
||||
1 1
|
||||
drop table t1, t2|
|
||||
|
@ -3,7 +3,7 @@ set @@sql_mode='ansi,traditional';
|
||||
select @@sql_mode;
|
||||
@@sql_mode
|
||||
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
CREATE TABLE t1 (col1 date);
|
||||
INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29');
|
||||
INSERT INTO t1 VALUES('0000-10-31');
|
||||
|
@ -4041,4 +4041,34 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ref a a 5 const 1 Using where; Using index
|
||||
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id));
|
||||
INSERT INTO t1 VALUES
|
||||
(3,'FL'), (2,'GA'), (4,'FL'), (1,'GA'), (5,'NY'), (7,'FL'), (6,'NY');
|
||||
CREATE TABLE t2 (id int NOT NULL, INDEX idx(id));
|
||||
INSERT INTO t2 VALUES (7), (5), (1), (3);
|
||||
SELECT id, st FROM t1
|
||||
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
|
||||
id st
|
||||
3 FL
|
||||
1 GA
|
||||
7 FL
|
||||
SELECT id, st FROM t1
|
||||
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
|
||||
GROUP BY id;
|
||||
id st
|
||||
1 GA
|
||||
3 FL
|
||||
7 FL
|
||||
SELECT id, st FROM t1
|
||||
WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
|
||||
id st
|
||||
2 GA
|
||||
4 FL
|
||||
SELECT id, st FROM t1
|
||||
WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
|
||||
GROUP BY id;
|
||||
id st
|
||||
2 GA
|
||||
4 FL
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.0 tests.
|
||||
|
@ -381,3 +381,33 @@ call test27759();
|
||||
a b a_then_b b_then_a c_then_a
|
||||
2007-04-10 2007-04-11 2007-04-10 2007-04-10 2004-04-09 00:00:00
|
||||
drop procedure test27759;
|
||||
create table t1 (f1 date);
|
||||
insert into t1 values (curdate());
|
||||
select left(f1,10) = curdate() from t1;
|
||||
left(f1,10) = curdate()
|
||||
1
|
||||
drop table t1;
|
||||
create table t1(f1 date);
|
||||
insert into t1 values('01-01-01'),('02-02-02'),('01-01-01'),('02-02-02');
|
||||
set @bug28261='';
|
||||
select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
|
||||
if(@bug28261 = f1, '', @bug28261:= f1)
|
||||
2001-01-01
|
||||
2002-02-02
|
||||
2001-01-01
|
||||
2002-02-02
|
||||
Warnings:
|
||||
Warning 1292 Incorrect date value: '' for column 'f1' at row 1
|
||||
select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
|
||||
if(@bug28261 = f1, '', @bug28261:= f1)
|
||||
2001-01-01
|
||||
2002-02-02
|
||||
2001-01-01
|
||||
2002-02-02
|
||||
select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
|
||||
if(@bug28261 = f1, '', @bug28261:= f1)
|
||||
2001-01-01
|
||||
2002-02-02
|
||||
2001-01-01
|
||||
2002-02-02
|
||||
drop table t1;
|
||||
|
@ -288,3 +288,9 @@ insert into t1 values (10000002383263201056);
|
||||
select c1 mod 50 as result from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #8663 cant use bgint unsigned as input to cast
|
||||
#
|
||||
|
||||
select cast(19999999999999999999 as signed);
|
||||
select cast(-19999999999999999999 as signed);
|
||||
|
@ -507,4 +507,18 @@ SELECT GROUP_CONCAT(DISTINCT UCASE(a)) FROM t1;
|
||||
SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #28273: GROUP_CONCAT and ORDER BY: No warning when result gets truncated.
|
||||
#
|
||||
CREATE TABLE t1( a VARCHAR( 10 ), b INT );
|
||||
INSERT INTO t1 VALUES ( repeat( 'a', 10 ), 1),
|
||||
( repeat( 'b', 10 ), 2);
|
||||
SET group_concat_max_len = 20;
|
||||
SELECT GROUP_CONCAT( a ) FROM t1;
|
||||
SELECT GROUP_CONCAT( DISTINCT a ) FROM t1;
|
||||
SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
|
||||
SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1;
|
||||
SET group_concat_max_len = DEFAULT;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -827,4 +827,38 @@ SELECT a,AVG(DISTINCT b) AS average FROM t1 GROUP BY a HAVING average > 50;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #27573: MIN() on an indexed column which is always NULL sets _other_
|
||||
# results to NULL
|
||||
#
|
||||
CREATE TABLE t1 ( a INT, b INT, KEY(a) );
|
||||
INSERT INTO t1 VALUES (NULL, 1), (NULL, 2);
|
||||
EXPLAIN SELECT MIN(a), MIN(b) FROM t1;
|
||||
SELECT MIN(a), MIN(b) FROM t1;
|
||||
|
||||
CREATE TABLE t2( a INT, b INT, c INT, KEY(a, b) );
|
||||
INSERT INTO t2 ( a, b, c ) VALUES ( 1, NULL, 2 ), ( 1, 3, 4 ), ( 1, 4, 4 );
|
||||
EXPLAIN SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
|
||||
SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
|
||||
|
||||
CREATE TABLE t3 (a INT, b INT, c int, KEY(a, b));
|
||||
INSERT INTO t3 VALUES (1, NULL, 1), (2, NULL, 2), (2, NULL, 2), (3, NULL, 3);
|
||||
EXPLAIN SELECT MIN(a), MIN(b) FROM t3 where a = 2;
|
||||
SELECT MIN(a), MIN(b) FROM t3 where a = 2;
|
||||
|
||||
CREATE TABLE t4 (a INT, b INT, c int, KEY(a, b));
|
||||
INSERT INTO t4 VALUES (1, 1, 1), (2, NULL, 2), (2, NULL, 2), (3, 1, 3);
|
||||
EXPLAIN SELECT MIN(a), MIN(b) FROM t4 where a = 2;
|
||||
SELECT MIN(a), MIN(b) FROM t4 where a = 2;
|
||||
SELECT MIN(b), min(c) FROM t4 where a = 2;
|
||||
|
||||
CREATE TABLE t5( a INT, b INT, KEY( a, b) );
|
||||
INSERT INTO t5 VALUES( 1, 1 ), ( 1, 2 );
|
||||
EXPLAIN SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
|
||||
SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
|
||||
SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1 and b > 1;
|
||||
|
||||
DROP TABLE t1, t2, t3, t4, t5;
|
||||
|
||||
###
|
||||
--echo End of 5.0 tests
|
||||
|
@ -169,6 +169,31 @@ INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #28272: EXPLAIN for SELECT from an empty InnoDB table
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
a1 decimal(10,0) DEFAULT NULL,
|
||||
a2 blob,
|
||||
a3 time DEFAULT NULL,
|
||||
a4 blob,
|
||||
a5 char(175) DEFAULT NULL,
|
||||
a6 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
a7 tinyblob,
|
||||
INDEX idx (a6,a7(239),a5)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
EXPLAIN SELECT a4 FROM t1 WHERE
|
||||
a6=NULL AND
|
||||
a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
|
||||
|
||||
EXPLAIN SELECT t1.a4 FROM t1, t1 t WHERE
|
||||
t.a6=t.a6 AND t1.a6=NULL AND
|
||||
t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 4.1 tests
|
||||
#
|
||||
# Bug #12882 min/max inconsistent on empty table
|
||||
|
@ -1194,6 +1194,24 @@ show create table t1;
|
||||
--enable_warnings
|
||||
drop table t1;
|
||||
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.
|
||||
|
||||
@ -1773,5 +1791,13 @@ execute stmt;
|
||||
deallocate prepare stmt;
|
||||
drop tables t1;
|
||||
|
||||
#
|
||||
# Bug #28509: strange behaviour: passing a decimal value to PS
|
||||
#
|
||||
prepare stmt from "create table t1 select ?";
|
||||
set @a=1.0;
|
||||
execute stmt using @a;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
@ -1367,4 +1367,48 @@ CALL p1();
|
||||
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
#
|
||||
# Bug #27415 Text Variables in stored procedures
|
||||
# If the SP varible was also referenced on the right side
|
||||
# the result was corrupted.
|
||||
#
|
||||
DELIMITER |;
|
||||
|
||||
--disable_warnings
|
||||
DROP PROCEDURE IF EXISTS bug27415_text_test|
|
||||
DROP PROCEDURE IF EXISTS bug27415_text_test2|
|
||||
--enable_warnings
|
||||
|
||||
CREATE PROCEDURE bug27415_text_test(entity_id_str_in text)
|
||||
BEGIN
|
||||
DECLARE str_remainder text;
|
||||
|
||||
SET str_remainder = entity_id_str_in;
|
||||
|
||||
select 'before substr', str_remainder;
|
||||
SET str_remainder = SUBSTRING(str_remainder, 3);
|
||||
select 'after substr', str_remainder;
|
||||
END|
|
||||
|
||||
CREATE PROCEDURE bug27415_text_test2(entity_id_str_in text)
|
||||
BEGIN
|
||||
DECLARE str_remainder text;
|
||||
DECLARE str_remainder2 text;
|
||||
|
||||
SET str_remainder2 = entity_id_str_in;
|
||||
select 'before substr', str_remainder2;
|
||||
SET str_remainder = SUBSTRING(str_remainder2, 3);
|
||||
select 'after substr', str_remainder;
|
||||
END|
|
||||
|
||||
CALL bug27415_text_test('a,b,c')|
|
||||
CALL bug27415_text_test('a,b,c')|
|
||||
CALL bug27415_text_test2('a,b,c')|
|
||||
CALL bug27415_text_test('a,b,c')|
|
||||
|
||||
DROP PROCEDURE bug27415_text_test|
|
||||
DROP PROCEDURE bug27415_text_test2|
|
||||
|
||||
DELIMITER ;|
|
||||
|
||||
# End of 5.0 tests.
|
||||
|
@ -559,12 +559,8 @@ set @@session.max_heap_table_size=default|
|
||||
# breaks stmt-based binlog
|
||||
# Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF()
|
||||
#
|
||||
--disable_warnings
|
||||
drop function if exists bug23333|
|
||||
drop table if exists t1,t2|
|
||||
--enable_warnings
|
||||
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
|
||||
CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
|
||||
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
|
||||
CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
|
||||
|
||||
insert into t2 values (1,1)|
|
||||
|
||||
@ -583,6 +579,7 @@ insert into t2 values (bug23333(),1)|
|
||||
--replace_column 2 # 5 # 6 #
|
||||
show binlog events from 98 /* with fixes for #23333 will show there is the query */|
|
||||
select count(*),@a from t1 /* must be 1,1 */|
|
||||
drop table t1, t2|
|
||||
|
||||
#
|
||||
# BUG#NNNN: New bug synopsis
|
||||
|
@ -7,7 +7,7 @@ set @@sql_mode='ansi,traditional';
|
||||
select @@sql_mode;
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
# Test INSERT with DATE
|
||||
|
@ -2882,4 +2882,28 @@ INSERT INTO t1 VALUES (1,1),(2,1);
|
||||
EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b);
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #28377: grouping query with a correlated subquery in WHERE condition
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id));
|
||||
INSERT INTO t1 VALUES
|
||||
(3,'FL'), (2,'GA'), (4,'FL'), (1,'GA'), (5,'NY'), (7,'FL'), (6,'NY');
|
||||
CREATE TABLE t2 (id int NOT NULL, INDEX idx(id));
|
||||
INSERT INTO t2 VALUES (7), (5), (1), (3);
|
||||
|
||||
SELECT id, st FROM t1
|
||||
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
|
||||
SELECT id, st FROM t1
|
||||
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
|
||||
GROUP BY id;
|
||||
|
||||
SELECT id, st FROM t1
|
||||
WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
|
||||
SELECT id, st FROM t1
|
||||
WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
|
||||
GROUP BY id;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
@ -250,3 +250,24 @@ END;|
|
||||
DELIMITER ;|
|
||||
call test27759();
|
||||
drop procedure test27759;
|
||||
|
||||
#
|
||||
# Bug#28208: Wrong result of a non-const STRING function with a const
|
||||
# DATETIME function.
|
||||
#
|
||||
create table t1 (f1 date);
|
||||
insert into t1 values (curdate());
|
||||
select left(f1,10) = curdate() from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#28261: Wrong DATETIME comparison result when the GET_USER_VAR function
|
||||
# is involved.
|
||||
#
|
||||
create table t1(f1 date);
|
||||
insert into t1 values('01-01-01'),('02-02-02'),('01-01-01'),('02-02-02');
|
||||
set @bug28261='';
|
||||
select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
|
||||
select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
|
||||
select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user