~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/temp_table.result

  • Committer: Stewart Smith
  • Date: 2009-05-15 06:57:12 UTC
  • mto: (991.1.5 for-brian)
  • mto: This revision was merged to the branch mainline in revision 1022.
  • Revision ID: stewart@flamingspork.com-20090515065712-bmionylacjmexmmm
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle.

Also fix DEFAULT keyword handling for auto-increment so that it defaults to
NULL and not 0 so that the following is valid and generates two auto-inc
values:

create table t1 (a int auto_increment primary key)
insert into t1 (a) values (default);
insert into t1 (a) values (default);

Important to note that 0 is no longer magic. So this gives you duplicate
primary key error:

insert into t1 (a) values(0);
insert into t1 (a) values(0);

as you've inserted the explicit value of 0 twice.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
4       e
22
22
5       f
23
23
6       g
24
 
create TEMPORARY TABLE t2 engine=MEMORY select * from t1;
25
 
create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=MEMORY;
 
24
create TEMPORARY TABLE t2 engine=heap select * from t1;
 
25
create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=heap;
26
26
Warnings:
27
27
Note    1050    Table 't2' already exists
28
28
CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null);
29
 
ERROR 42S01: Table 'test.#t1' already exists
 
29
ERROR 42S01: Table 't1' already exists
30
30
ALTER TABLE t1 RENAME t2;
31
 
ERROR 42S01: Table 'test.#t2' already exists
 
31
ERROR 42S01: Table 't2' already exists
32
32
select * from t2;
33
33
a       b
34
34
4       e
77
77
alter table t1 add primary key (a);
78
78
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
79
79
drop table t1;
80
 
CREATE TEMPORARY TABLE t1 (
 
80
CREATE TABLE t1 (
81
81
d datetime default NULL
82
82
) ENGINE=MyISAM;
83
83
INSERT INTO t1 VALUES ('2002-10-24 14:50:32'),('2002-10-24 14:50:33'),('2002-10-24 14:50:34'),('2002-10-24 14:50:34'),('2002-10-24 14:50:34'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:38'),('2002-10-24 14:50:38'),('2002-10-24 14:50:38'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:40'),('2002-10-24 14:50:40'),('2002-10-24 14:50:40');
95
95
2002-10-24 14:50:40
96
96
show status like "created_tmp%tables";
97
97
Variable_name   Value
98
 
Created_tmp_disk_tables #
99
 
Created_tmp_tables      #
 
98
Created_tmp_disk_tables 0
 
99
Created_tmp_tables      1
100
100
drop table t1;
101
101
create table t1 (a int, b int, index(a), index(b));
102
102
create table t2 (c int auto_increment, d varchar(255), primary key (c));
107
107
bar     2
108
108
foo     1
109
109
drop table t1, t2;
 
110
DROP TABLE IF EXISTS t1;
 
111
CREATE TABLE t1 (i INT);
 
112
LOCK TABLE t1 WRITE;
 
113
CREATE TEMPORARY TABLE t1 (i INT);
 
114
The following command should not block
 
115
DROP TEMPORARY TABLE t1;
 
116
DROP TABLE t1;
110
117
CREATE TABLE t1 (i INT);
111
118
CREATE TEMPORARY TABLE t2 (i INT);
112
119
DROP TEMPORARY TABLE t2, t1;
113
120
ERROR 42S02: Unknown table 't1'
114
121
SELECT * FROM t2;
115
 
ERROR 42S02: Unknown table 'test.t2'
 
122
ERROR 42S02: Table 'test.t2' doesn't exist
116
123
SELECT * FROM t1;
117
124
i
118
125
DROP TABLE t1;