mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
Merge rakia:mysql/4.1/B14553
into macbook.gmz:/Users/kgeorge/mysql/work/B14553-4.1-opt
This commit is contained in:
@@ -14,3 +14,14 @@ explain select * from t1 where b is null;
|
||||
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;
|
||||
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY);
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL;
|
||||
a last_insert_id()
|
||||
1 1
|
||||
SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL;
|
||||
a last_insert_id()
|
||||
SELECT sql_no_cache a, last_insert_id() FROM t1;
|
||||
a last_insert_id()
|
||||
1 1
|
||||
DROP TABLE t1;
|
||||
|
@@ -73,3 +73,17 @@ CREATE TABLE t1 ( a INT UNIQUE );
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
INSERT INTO t1 VALUES (1),(1);
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
drop table t1;
|
||||
create table t1(a int auto_increment, key(a));
|
||||
create table t2(a int);
|
||||
insert into t1 (a) values (null);
|
||||
insert into t2 (a) select a from t1 where a is null;
|
||||
insert into t2 (a) select a from t1 where a is null;
|
||||
select * from t2;
|
||||
a
|
||||
1
|
||||
select * from t2;
|
||||
a
|
||||
1
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
|
Reference in New Issue
Block a user