~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/innodb_mysql.result

  • Committer: Brian Aker
  • Date: 2009-01-24 09:43:35 UTC
  • Revision ID: brian@gir-3.local-20090124094335-6qdtvc35gl5fvivz
Adding in an example singe thread scheduler

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
CREATE TABLE t1 (
144
144
a1 decimal(10,0) DEFAULT NULL,
145
145
a2 blob,
 
146
a3 time DEFAULT NULL,
146
147
a4 blob,
147
148
a5 char(175) DEFAULT NULL,
148
 
a6 timestamp NOT NULL DEFAULT NOW(),
 
149
a6 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
149
150
a7 blob,
150
151
INDEX idx (a6,a7(239),a5)
151
152
) ENGINE=InnoDB;
160
161
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
161
162
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE noticed after reading const tables
162
163
DROP TABLE t1;
163
 
create temporary table t1m (a int) engine = MEMORY;
 
164
create table t1m (a int) engine = MEMORY;
164
165
create table t1i (a int);
165
 
create temporary table t2m (a int) engine = MEMORY;
 
166
create table t2m (a int) engine = MEMORY;
166
167
create table t2i (a int);
167
168
insert into t2m values (5);
168
169
insert into t2i values (5);
212
213
count(*)        min(7)  max(7)
213
214
0       NULL    NULL
214
215
drop table t1m, t1i, t2m, t2i;
215
 
create TEMPORARY table t1 (
 
216
create table t1 (
216
217
a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' '
217
218
) ENGINE = MEMORY;
218
219
insert into t1 (a1, a2, b, c, d) values
488
489
show create table t1;
489
490
Table   Create Table
490
491
t1      CREATE TABLE `t1` (
491
 
  `a` int DEFAULT NULL
 
492
  `a` int
492
493
) ENGINE=InnoDB COMMENT='123'
493
494
drop table t1;
494
495
CREATE TABLE t1 (a CHAR(2), KEY (a)) ENGINE = InnoDB;
514
515
UPDATE t2 SET a = 'us' WHERE a = 'uk';
515
516
SELECT * FROM t2 WHERE a = 'uk';
516
517
a
517
 
CREATE TEMPORARY TABLE t3 (a CHAR(2), KEY (a)) ENGINE = MyISAM;
 
518
CREATE TABLE t3 (a CHAR(2), KEY (a)) ENGINE = MyISAM;
518
519
INSERT INTO t3 VALUES ('uk'),('bg');
519
520
SELECT * FROM t3 WHERE a = 'uk';
520
521
a
527
528
SELECT * FROM t3 WHERE a = 'uk';
528
529
a
529
530
DROP TABLE t1,t2,t3;
 
531
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
 
532
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
 
533
switch to connection c1
 
534
SET AUTOCOMMIT=0;
 
535
INSERT INTO t2 VALUES (1);
 
536
switch to connection c2
 
537
SET AUTOCOMMIT=0;
 
538
LOCK TABLES t1 READ, t2 READ;
 
539
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
 
540
switch to connection c1
 
541
COMMIT;
 
542
INSERT INTO t1 VALUES (1);
 
543
switch to connection default
 
544
SET AUTOCOMMIT=default;
 
545
DROP TABLE t1,t2;
530
546
CREATE TABLE t1 (
531
547
id int NOT NULL auto_increment PRIMARY KEY,
532
548
b int NOT NULL,
537
553
CREATE TABLE t2 (
538
554
b int NOT NULL auto_increment PRIMARY KEY,
539
555
c datetime NOT NULL
540
 
) ENGINE= InnoDB;
 
556
) ENGINE= MyISAM;
541
557
INSERT INTO t2(c) VALUES ('2007-01-01');
542
558
INSERT INTO t2(c) SELECT c FROM t2;
543
559
INSERT INTO t2(c) SELECT c FROM t2;
556
572
INSERT INTO t1(b,c) SELECT b,c FROM t2;
557
573
set @@sort_buffer_size=8192;
558
574
Warnings:
559
 
Error   1292    Truncated incorrect sort_buffer_size value: '8192'
 
575
Warning 1292    Truncated incorrect sort_buffer_size value: '8192'
560
576
SELECT COUNT(*) FROM t1;
561
577
COUNT(*)
562
578
3072
695
711
2
696
712
5
697
713
drop table t1;
 
714
drop table if exists t1;
 
715
create table t1 (a int) engine=innodb;
 
716
alter table t1 alter a set default 1;
 
717
drop table t1;
 
718
 
 
719
Bug#24918 drop table and lock / inconsistent between 
 
720
perm and temp tables
 
721
 
 
722
Check transactional tables under LOCK TABLES
 
723
 
 
724
drop table if exists t24918, t24918_tmp, t24918_trans, t24918_trans_tmp, 
 
725
t24918_access;
 
726
create table t24918_access (id int);
 
727
create table t24918 (id int) engine=myisam;
 
728
create temporary table t24918_tmp (id int) engine=myisam;
 
729
create table t24918_trans (id int) engine=innodb;
 
730
create temporary table t24918_trans_tmp (id int) engine=innodb;
 
731
lock table t24918 write, t24918_tmp write, t24918_trans write, t24918_trans_tmp write;
 
732
drop table t24918;
 
733
select * from t24918_access;
 
734
ERROR HY000: Table 't24918_access' was not locked with LOCK TABLES
 
735
drop table t24918_trans;
 
736
select * from t24918_access;
 
737
ERROR HY000: Table 't24918_access' was not locked with LOCK TABLES
 
738
drop table t24918_trans_tmp;
 
739
select * from t24918_access;
 
740
ERROR HY000: Table 't24918_access' was not locked with LOCK TABLES
 
741
drop table t24918_tmp;
 
742
select * from t24918_access;
 
743
ERROR HY000: Table 't24918_access' was not locked with LOCK TABLES
 
744
unlock tables;
 
745
drop table t24918_access;
698
746
CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY bkey (b)) ENGINE=InnoDB;
699
747
INSERT INTO t1 VALUES (1,2),(3,2),(2,2),(4,2),(5,2),(6,2),(7,2),(8,2);
700
748
INSERT INTO t1 SELECT a + 8, 2 FROM t1;
945
993
alter table t1 add index(a(1024));
946
994
Warnings:
947
995
Warning 1071    Specified key was too long; max key length is 767 bytes
 
996
Warning 1071    Specified key was too long; max key length is 767 bytes
 
997
Warning 1071    Specified key was too long; max key length is 767 bytes
948
998
show create table t1;
949
999
Table   Create Table
950
1000
t1      CREATE TABLE `t1` (
951
1001
  `a` text,
952
 
  KEY `a` (`a`(191))
 
1002
  KEY `a` (`a`())
953
1003
) ENGINE=InnoDB
954
1004
drop table t1;
955
1005
CREATE TABLE t1 (
1132
1182
# - initial check;
1133
1183
 
1134
1184
SELECT table_schema, table_name, row_format
1135
 
FROM data_dictionary.TABLES
 
1185
FROM INFORMATION_SCHEMA.TABLES
1136
1186
WHERE table_schema = DATABASE() AND table_name = 't1';
1137
1187
table_schema    table_name      row_format
1138
 
test    t1      COMPACT
 
1188
test    t1      Compact
1139
1189
 
1140
1190
# - change ROW_FORMAT and check;
1141
1191
 
1142
1192
ALTER TABLE t1 ROW_FORMAT = REDUNDANT;
1143
1193
 
1144
1194
SELECT table_schema, table_name, row_format
1145
 
FROM data_dictionary.TABLES
 
1195
FROM INFORMATION_SCHEMA.TABLES
1146
1196
WHERE table_schema = DATABASE() AND table_name = 't1';
1147
1197
table_schema    table_name      row_format
1148
 
test    t1      REDUNDANT
 
1198
test    t1      Redundant
1149
1199
 
1150
1200
# - that's it, cleanup.
1151
1201
 
1153
1203
create table t1(a char(10) not null, unique key aa(a(1)),
1154
1204
b char(4) not null, unique key bb(b(4))) engine=innodb;
1155
1205
desc t1;
1156
 
Field   Type    Null    Default Default_is_NULL On_Update
1157
 
a       VARCHAR FALSE           FALSE   
1158
 
b       VARCHAR FALSE           FALSE   
 
1206
Field   Type    Null    Key     Default Extra
 
1207
a       varchar(10)     NO      UNI     NULL    
 
1208
b       varchar(4)      NO      PRI     NULL    
1159
1209
show create table t1;
1160
1210
Table   Create Table
1161
1211
t1      CREATE TABLE `t1` (
1162
1212
  `a` varchar(10) NOT NULL,
1163
1213
  `b` varchar(4) NOT NULL,
1164
1214
  UNIQUE KEY `bb` (`b`),
1165
 
  UNIQUE KEY `aa` (`a`(1))
 
1215
  UNIQUE KEY `aa` (`a`())
1166
1216
) ENGINE=InnoDB
1167
1217
drop table t1;
1168
1218
CREATE TABLE t1 (id int, type char(6), d int, INDEX idx(id,d)) ENGINE=InnoDB;
1252
1302
11      15      1
1253
1303
12      20      1
1254
1304
drop table t2;
 
1305
drop table if exists t1, t2;
 
1306
create table t1 (i int);
 
1307
alter table t1 modify i int default 1;
 
1308
alter table t1 modify i int default 2, rename t2;
 
1309
lock table t2 write;
 
1310
alter table t2 modify i int default 3;
 
1311
unlock tables;
 
1312
lock table t2 write;
 
1313
alter table t2 modify i int default 4, rename t1;
 
1314
unlock tables;
 
1315
drop table t1;
 
1316
drop table if exists t1;
 
1317
create table t1 (i int);
 
1318
insert into t1 values ();
 
1319
lock table t1 write;
 
1320
alter table t1 modify i int default 1;
 
1321
insert into t1 values ();
 
1322
select * from t1;
 
1323
i
 
1324
NULL
 
1325
1
 
1326
alter table t1 change i c char(10) default "Two";
 
1327
insert into t1 values ();
 
1328
select * from t1;
 
1329
c
 
1330
NULL
 
1331
1
 
1332
Two
 
1333
unlock tables;
 
1334
select * from t1;
 
1335
c
 
1336
NULL
 
1337
1
 
1338
Two
 
1339
drop tables t1;
1255
1340
create table t1(f1 varchar(5) unique, f2 timestamp NOT NULL DEFAULT
1256
1341
CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
1257
1342
insert into t1(f1) values(1);