~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
# Initialise
2
--disable_warnings
3
drop table if exists t1;
4
--enable_warnings
5
6
#
7
# Test some ODBC compatibility
8
#
9
10
select {fn length("hello")}, { date "1997-10-20" };
11
12
#
13
# Test retreiving row with last insert_id value.
14
#
15
16
create table t1 (a int not null auto_increment,b int not null,primary key (a,b));
17
insert into t1 SET A=NULL,B=1;
18
insert into t1 SET a=null,b=2;
19
select * from t1 where a is null and b=2;
20
select * from t1 where a is null;
21
explain select * from t1 where b is null;
22
drop table t1;
23
24
#
25
# Bug #14553: NULL in WHERE resets LAST_INSERT_ID
26
#
27
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY);
28
INSERT INTO t1 VALUES (NULL);
29
SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL;
30
SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL;
31
SELECT sql_no_cache a, last_insert_id() FROM t1;
32
DROP TABLE t1;
33
34
# End of 4.1 tests