mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
weave merge mysql-5.1->mysql-5.1-security
This commit is contained in:
@@ -518,21 +518,21 @@ SUCCESS
|
||||
# 12. Read-write statement: IODKU, change 0 rows.
|
||||
#
|
||||
insert t1 set a=2 on duplicate key update a=2;
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
call p_verify_status_increment(2, 2, 1, 0);
|
||||
SUCCESS
|
||||
|
||||
commit;
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
call p_verify_status_increment(2, 2, 1, 0);
|
||||
SUCCESS
|
||||
|
||||
# 13. Read-write statement: INSERT IGNORE, change 0 rows.
|
||||
#
|
||||
insert ignore t1 set a=2;
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
call p_verify_status_increment(2, 2, 1, 0);
|
||||
SUCCESS
|
||||
|
||||
commit;
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
call p_verify_status_increment(2, 2, 1, 0);
|
||||
SUCCESS
|
||||
|
||||
# 14. Read-write statement: INSERT IGNORE, change 1 row.
|
||||
|
@@ -19,13 +19,16 @@ INSERT INTO t1 VALUES();
|
||||
SELECT * FROM t1;
|
||||
a b c d e f
|
||||
0 foo 0000-00-00
|
||||
INSERT INTO t1 VALUES(default,default,default,default,default,default);
|
||||
SELECT * FROM t1;
|
||||
a b c d e f
|
||||
0 foo 0000-00-00
|
||||
0 foo 0000-00-00
|
||||
INSERT INTO t1 VALUES(0,'abc','def','ghi','bar','1999-12-31');
|
||||
SELECT * FROM t1;
|
||||
a b c d e f
|
||||
0 foo 0000-00-00
|
||||
0 foo 0000-00-00
|
||||
0 abc def ghi bar 1999-12-31
|
||||
# === insert failures ===
|
||||
INSERT INTO t1 VALUES(NULL,'ab','a','b','foo','2007-01-01');
|
||||
|
@@ -1301,6 +1301,24 @@ SELECT '2008-02-18' + INTERVAL 1 FRAC_SECOND;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FRAC_SECOND' at line 1
|
||||
SELECT '2008-02-18' - INTERVAL 1 FRAC_SECOND;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FRAC_SECOND' at line 1
|
||||
#
|
||||
# Bug #52315 part 2 : utc_date() crashes when system time > year 2037
|
||||
#
|
||||
SET TIMESTAMP=-147490000;
|
||||
SELECT UTC_TIMESTAMP();
|
||||
SET TIMESTAMP=2147483648;
|
||||
SELECT UTC_TIMESTAMP();
|
||||
SET TIMESTAMP=2147483646;
|
||||
SELECT UTC_TIMESTAMP();
|
||||
SET TIMESTAMP=2147483647;
|
||||
SELECT UTC_TIMESTAMP();
|
||||
SET TIMESTAMP=0;
|
||||
SELECT UTC_TIMESTAMP();
|
||||
SET TIMESTAMP=-1;
|
||||
SELECT UTC_TIMESTAMP();
|
||||
SET TIMESTAMP=1;
|
||||
SELECT UTC_TIMESTAMP();
|
||||
SET TIMESTAMP=0;
|
||||
End of 5.0 tests
|
||||
select date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND);
|
||||
date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND)
|
||||
|
@@ -960,6 +960,18 @@ COUNT(*)
|
||||
2
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests
|
||||
#
|
||||
# Test for bug #58650 "Failing assertion: primary_key_no == -1 ||
|
||||
# primary_key_no == 0".
|
||||
#
|
||||
drop table if exists t1;
|
||||
# The minimal test case.
|
||||
create table t1 (a int not null, b linestring not null, unique key b (b(12)), unique key a (a));
|
||||
drop table t1;
|
||||
# The original test case.
|
||||
create table t1 (a int not null, b linestring not null, unique key b (b(12)));
|
||||
create unique index a on t1(a);
|
||||
drop table t1;
|
||||
create table `t1` (`col002` point)engine=myisam;
|
||||
insert into t1 values (),(),();
|
||||
select min(`col002`) from t1 union select `col002` from t1;
|
||||
|
@@ -4,3 +4,7 @@ select 1;
|
||||
SHOW VARIABLES like 'slave_skip_errors';
|
||||
Variable_name Value
|
||||
slave_skip_errors OFF
|
||||
#
|
||||
# Bug#58026: massive recursion and crash in regular expression handling
|
||||
#
|
||||
SELECT '1' RLIKE RPAD('1', 10000, '(');
|
||||
|
@@ -1638,4 +1638,29 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL a 8 NULL 10 Using index; Using temporary; Using filesort
|
||||
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 Using where
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# Bug #59110: Memory leak of QUICK_SELECT_I allocated memory
|
||||
# and
|
||||
# Bug #59308: Incorrect result for
|
||||
SELECT DISTINCT <col>... ORDER BY <col> DESC
|
||||
|
||||
# Use Valgrind to detect #59110!
|
||||
#
|
||||
CREATE TABLE t1 (a INT,KEY (a));
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
||||
EXPLAIN SELECT DISTINCT a,1 FROM t1 WHERE a <> 1 ORDER BY a DESC;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index a a 5 NULL 10 Using where; Using index; Using filesort
|
||||
SELECT DISTINCT a,1 FROM t1 WHERE a <> 1 ORDER BY a DESC;
|
||||
a 1
|
||||
10 1
|
||||
9 1
|
||||
8 1
|
||||
7 1
|
||||
6 1
|
||||
5 1
|
||||
4 1
|
||||
3 1
|
||||
2 1
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@@ -1666,4 +1666,105 @@ c_key c_notkey
|
||||
1 1
|
||||
3 3
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #57030: 'BETWEEN' evaluation is incorrect
|
||||
#
|
||||
CREATE TABLE t1(pk INT PRIMARY KEY, i4 INT);
|
||||
CREATE UNIQUE INDEX i4_uq ON t1(i4);
|
||||
INSERT INTO t1 VALUES (1,10), (2,20), (3,30);
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 WHERE i4 BETWEEN 10 AND 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 const i4_uq i4_uq 5 const 1
|
||||
SELECT * FROM t1 WHERE i4 BETWEEN 10 AND 10;
|
||||
pk i4
|
||||
1 10
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 WHERE 10 BETWEEN i4 AND i4;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 const i4_uq i4_uq 5 const 1
|
||||
SELECT * FROM t1 WHERE 10 BETWEEN i4 AND i4;
|
||||
pk i4
|
||||
1 10
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 WHERE 10 BETWEEN 10 AND i4;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range i4_uq i4_uq 5 NULL 3 Using where
|
||||
SELECT * FROM t1 WHERE 10 BETWEEN 10 AND i4;
|
||||
pk i4
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 WHERE 10 BETWEEN i4 AND 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range i4_uq i4_uq 5 NULL 1 Using where
|
||||
SELECT * FROM t1 WHERE 10 BETWEEN i4 AND 10;
|
||||
pk i4
|
||||
1 10
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 WHERE 10 BETWEEN 10 AND 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
SELECT * FROM t1 WHERE 10 BETWEEN 10 AND 10;
|
||||
pk i4
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 WHERE 10 BETWEEN 11 AND 11;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||
SELECT * FROM t1 WHERE 10 BETWEEN 11 AND 11;
|
||||
pk i4
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 WHERE 10 BETWEEN 100 AND 0;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||
SELECT * FROM t1 WHERE 10 BETWEEN 100 AND 0;
|
||||
pk i4
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 WHERE i4 BETWEEN 100 AND 0;
|
||||
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
|
||||
SELECT * FROM t1 WHERE i4 BETWEEN 100 AND 0;
|
||||
pk i4
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 WHERE i4 BETWEEN 10 AND 99999999999999999;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range i4_uq i4_uq 5 NULL 2 Using where
|
||||
SELECT * FROM t1 WHERE i4 BETWEEN 10 AND 99999999999999999;
|
||||
pk i4
|
||||
1 10
|
||||
2 20
|
||||
3 30
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 WHERE i4 BETWEEN 999999999999999 AND 30;
|
||||
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
|
||||
SELECT * FROM t1 WHERE i4 BETWEEN 999999999999999 AND 30;
|
||||
pk i4
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 WHERE i4 BETWEEN 10 AND '20';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range i4_uq i4_uq 5 NULL 1 Using where
|
||||
SELECT * FROM t1 WHERE i4 BETWEEN 10 AND '20';
|
||||
pk i4
|
||||
1 10
|
||||
2 20
|
||||
EXPLAIN
|
||||
SELECT * FROM t1, t1 as t2 WHERE t2.pk BETWEEN t1.i4 AND t1.i4;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL i4_uq NULL NULL NULL 3
|
||||
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.i4 1 Using where
|
||||
SELECT * FROM t1, t1 as t2 WHERE t2.pk BETWEEN t1.i4 AND t1.i4;
|
||||
pk i4 pk i4
|
||||
EXPLAIN
|
||||
SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL i4_uq NULL NULL NULL 3
|
||||
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.i4 1 Using where
|
||||
SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk;
|
||||
pk i4 pk i4
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
Reference in New Issue
Block a user