~drizzle-trunk/drizzle/development

1557 by Brian Aker
Confirmation for bug fix.
1
# 
2
# https://bugs.launchpad.net/drizzle/+bug/385808
3
# 
4
5
create temporary table t1 (v varchar(32) not null);
6
insert into t1 values ('def'),('abc'),('hij'),('3r4f');
7
select * from t1;
8
# Fast alter, no copy performed
9
alter table t1 change v v2 varchar(32);
10
select * from t1;
11
# Fast alter, no copy performed
12
alter table t1 change v2 v varchar(64);
13
select * from t1;
14
update t1 set v = 'lmn' where v = 'hij';
15
select * from t1;
16
# Regular alter table
17
alter table t1 add i int auto_increment not null primary key first;
18
select * from t1;
19
update t1 set i=5 where i=3;
20
select * from t1;
21
alter table t1 change i i bigint;
22
select * from t1;
23
alter table t1 add unique key (i, v);
24
select * from t1 where i between 2 and 4 and v in ('def','3r4f','lmn');
25
drop table t1;
26
27
# (Pulled from MySQL, it had a similar issue)
28
# Bug#38821: Assert table->auto_increment_field_not_null failed in open_table()
29
#
30
CREATE TABLE t1 (a INTEGER AUTO_INCREMENT PRIMARY KEY, b INTEGER NOT NULL);
31
INSERT IGNORE INTO t1 (b) VALUES (5);
32
33
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
34
  SELECT a FROM t1;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
35
--error ER_DUP_ENTRY
1557 by Brian Aker
Confirmation for bug fix.
36
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
37
  SELECT a FROM t1;
1731.3.1 by Lee Bieber
change tests to use enum values instead of error numbers
38
--error ER_DUP_ENTRY
1557 by Brian Aker
Confirmation for bug fix.
39
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
40
  SELECT a FROM t1;
41
42
DROP TABLE t1, t2;