~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/alter_table.test

  • Committer: Padraig O'Sullivan
  • Date: 2009-09-13 01:03:01 UTC
  • mto: (1126.9.2 captain-20090915-01)
  • mto: This revision was merged to the branch mainline in revision 1133.
  • Revision ID: osullivan.padraig@gmail.com-20090913010301-tcvvezipx1124acy
Added calls to the dtrace delete begin/end probes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
NAME varchar(80) DEFAULT '' NOT NULL,
40
40
PRIMARY KEY (GROUP_ID,LANG_ID),
41
41
KEY NAME (NAME));
42
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
42
#show table status like "t1";
43
43
ALTER TABLE t1 CHANGE NAME NAME CHAR(80) not null;
44
44
--replace_column 8 #
45
 
show COLUMNS FROM t1;
 
45
SHOW FULL COLUMNS FROM t1;
46
46
DROP TABLE t1;
47
47
 
48
48
#
156
156
#
157
157
 
158
158
CREATE TEMPORARY TABLE t1 (
159
 
  Host varchar(16) NOT NULL default '',
160
 
  User varchar(16) NOT NULL default '',
 
159
  Host varchar(16) binary NOT NULL default '',
 
160
  User varchar(16) binary NOT NULL default '',
161
161
  PRIMARY KEY  (Host,User),
162
162
  KEY  (Host)
163
163
) ENGINE=MyISAM;
164
164
 
165
165
ALTER TABLE t1 DISABLE KEYS;
166
 
#SHOW INDEX FROM t1;
 
166
SHOW INDEX FROM t1;
167
167
INSERT INTO t1 VALUES ('localhost','root'),('localhost','');
168
 
#SHOW INDEX FROM t1;
 
168
SHOW INDEX FROM t1;
169
169
ALTER TABLE t1 ENABLE KEYS;
170
 
#SHOW INDEX FROM t1;
 
170
SHOW INDEX FROM t1;
171
171
CHECK TABLES t1;
172
172
 
173
173
# Test RENAME
201
201
 
202
202
create TEMPORARY table t1 (a int, b int, c int, d int, e int, f int, g int, h int,i int, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
203
203
insert into t1 (a,b,c,d,e,f,g,h,i) values(1,1,1,1,1,1,1,1,1);
204
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
204
--replace_column 3 X 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
205
205
show table status like 't1';
206
206
alter table t1 modify a int;
207
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
207
--replace_column 3 X 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
208
208
show table status like 't1';
209
209
drop table t1;
210
210
create TEMPORARY table t1 (a int not null default 0, b int not null default 0, c int not null default 0, d int not null default 0, e int not null default 0, f int not null default 0, g int not null default 0, h int not null default 0,i int not null default 0, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
211
211
insert into t1 (a) values(1);
212
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
212
--replace_column 3 X 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
213
213
show table status like 't1';
214
214
drop table t1;
215
215
 
383
383
drop table t1;
384
384
 
385
385
#
386
 
# BUG#23404 - ROW_FORMAT=COMPACT option is lost is an index is added to the
 
386
# BUG#23404 - ROW_FORMAT=FIXED option is lost is an index is added to the
387
387
# table
388
388
#
389
 
CREATE TABLE t1(a INT) ROW_FORMAT=COMPACT;
 
389
CREATE TABLE t1(a INT) ROW_FORMAT=FIXED;
390
390
CREATE INDEX i1 ON t1(a);
391
391
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
392
392
SHOW CREATE TABLE t1;
491
491
# Bug#25262 Auto Increment lost when changing Engine type
492
492
#
493
493
 
494
 
create TEMPORARY table t1(id int primary key auto_increment) engine=MEMORY;
 
494
create TEMPORARY table t1(id int primary key auto_increment) engine=heap;
495
495
 
496
496
insert into t1 values (null);
497
497
insert into t1 values (null);
508
508
insert into t1 values (null);
509
509
select * from t1;
510
510
 
511
 
# Alter to MEMORY again
512
 
alter table t1 engine = MEMORY;
 
511
# Alter to heap again
 
512
alter table t1 engine = heap;
513
513
insert into t1 values (null);
514
514
select * from t1;
515
515
 
574
574
# Bug#18038  MySQL server corrupts binary columns data
575
575
#
576
576
 
577
 
CREATE TABLE t1 (s CHAR(8));
 
577
CREATE TABLE t1 (s CHAR(8) BINARY);
578
578
INSERT INTO t1 VALUES ('test');
579
579
SELECT LENGTH(s) FROM t1;
580
 
ALTER TABLE t1 MODIFY s CHAR(10);
 
580
ALTER TABLE t1 MODIFY s CHAR(10) BINARY;
581
581
SELECT LENGTH(s) FROM t1;
582
582
DROP TABLE t1;
583
583