~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/innodb_mysql.result

  • Committer: Brian Aker
  • Date: 2010-02-14 01:56:51 UTC
  • mto: (1273.16.5 fix_is)
  • mto: This revision was merged to the branch mainline in revision 1300.
  • Revision ID: brian@gaz-20100214015651-ror9j0xu7dccz0ct
Two fixes for "make dist"

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
set global innodb_support_xa=default;
 
2
set session innodb_support_xa=default;
2
3
SET SESSION STORAGE_ENGINE = InnoDB;
3
 
SET @orig_lock_wait_timeout= @@innodb_lock_wait_timeout;
4
 
SET GLOBAL innodb_lock_wait_timeout=2;
5
4
drop table if exists t1,t2,t3,t1m,t1i,t2m,t2i,t4;
6
5
create table t1 (
7
6
c_id int not null default '0',
316
315
WHERE t1.name LIKE 'A%';
317
316
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
318
317
1       SIMPLE  t1      index   PRIMARY,name    PRIMARY 4       NULL    3       Using where
319
 
1       SIMPLE  t2      ref     fkey    fkey    5       test.t1.id      1       Using where; Using index
 
318
1       SIMPLE  t2      ref     fkey    fkey    5       test.t1.id      1       Using index
320
319
EXPLAIN
321
320
SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
322
321
WHERE t1.name LIKE 'A%' OR FALSE;
347
346
DELETE FROM t1;
348
347
EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
349
348
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
350
 
1       SIMPLE  t1      range   name    name    164     NULL    #       Using where; Using index for group-by
 
349
1       SIMPLE  t1      range   name    name    164     NULL    2       Using where; Using index for group-by
351
350
SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
352
351
name    dept
353
352
DROP TABLE t1;
354
353
drop table if exists t1;
 
354
show variables like 'innodb_rollback_on_timeout';
 
355
Variable_name   Value
 
356
innodb_rollback_on_timeout      OFF
355
357
create table t1 (a int not null primary key) engine = innodb;
356
358
insert into t1 values (1);
357
359
commit;
406
408
tes     1234
407
409
drop table test;
408
410
drop table if exists t1;
 
411
show variables like 'innodb_rollback_on_timeout';
 
412
Variable_name   Value
 
413
innodb_rollback_on_timeout      OFF
409
414
create table t1 (a int not null primary key) engine = innodb;
410
415
insert into t1 values (1);
411
416
commit;
479
484
4       a       2
480
485
drop table t1;
481
486
create table t1(a int) engine=innodb;
482
 
alter table t1 comment='123';
 
487
alter table t1 comment '123';
483
488
show create table t1;
484
489
Table   Create Table
485
490
t1      CREATE TABLE `t1` (
486
 
  `a` INT DEFAULT NULL
487
 
) ENGINE=InnoDB COMMENT='123' COLLATE = utf8_general_ci
 
491
  `a` int DEFAULT NULL
 
492
) ENGINE=InnoDB COMMENT='123'
488
493
drop table t1;
489
494
CREATE TABLE t1 (a CHAR(2), KEY (a)) ENGINE = InnoDB;
490
495
INSERT INTO t1 VALUES ('uk'),('bg');
634
639
drop table t1,t2;
635
640
create table t1(f1 varchar(800) not null, key(f1));
636
641
Warnings:
637
 
Warning 1071    Specified key was too long; max key length is 1023 bytes
 
642
Warning 1071    Specified key was too long; max key length is 767 bytes
638
643
insert into t1 values('aaa');
639
644
drop table t1;
640
645
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c FLOAT, KEY b(b)) ENGINE = INNODB;
654
659
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    128     Using filesort
655
660
DROP TABLE t1;
656
661
drop table if exists t1;
 
662
show variables like 'innodb_rollback_on_timeout';
 
663
Variable_name   Value
 
664
innodb_rollback_on_timeout      OFF
657
665
create table t1 (a int not null primary key) engine = innodb;
658
666
insert into t1 values (1);
659
667
commit;
769
777
id      1
770
778
select_type     SIMPLE
771
779
table   t1
772
 
type    index
 
780
type    range
773
781
possible_keys   bkey
774
782
key     bkey
775
783
key_len 5
776
784
ref     NULL
777
 
rows    32
 
785
rows    16
778
786
Extra   Using where; Using index
779
787
SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY b,a;
780
788
a       b
853
861
key     bkey
854
862
key_len 10
855
863
ref     const,const
856
 
rows    16
 
864
rows    8
857
865
Extra   Using where; Using index
858
866
SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY a;
859
867
a       b       c
882
890
key     bkey
883
891
key_len 10
884
892
ref     const,const
885
 
rows    16
 
893
rows    8
886
894
Extra   Using where; Using index
887
895
SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY b,c,a;
888
896
a       b       c
911
919
key     bkey
912
920
key_len 10
913
921
ref     const,const
914
 
rows    16
 
922
rows    8
915
923
Extra   Using where; Using index
916
924
SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY c,a;
917
925
a       b       c
936
944
insert into t1 values('aaa');
937
945
alter table t1 add index(a(1024));
938
946
Warnings:
939
 
Warning 1071    Specified key was too long; max key length is 1023 bytes
 
947
Warning 1071    Specified key was too long; max key length is 767 bytes
940
948
show create table t1;
941
949
Table   Create Table
942
950
t1      CREATE TABLE `t1` (
943
 
  `a` TEXT COLLATE utf8_general_ci,
944
 
  KEY `a` (`a`(255))
945
 
) ENGINE=InnoDB COLLATE = utf8_general_ci
 
951
  `a` text,
 
952
  KEY `a` (`a`(191))
 
953
) ENGINE=InnoDB
946
954
drop table t1;
947
955
CREATE TABLE t1 (
948
956
a INT,
1022
1030
key     b
1023
1031
key_len 5
1024
1032
ref     const
1025
 
rows    2
 
1033
rows    1
1026
1034
Extra   Using where; Using index
1027
1035
SELECT * FROM t1 WHERE b=2 ORDER BY a ASC;
1028
1036
a       b
1037
1045
key     b
1038
1046
key_len 5
1039
1047
ref     const
1040
 
rows    2
 
1048
rows    1
1041
1049
Extra   Using where; Using index
1042
1050
SELECT * FROM t1 WHERE b=2 ORDER BY a DESC;
1043
1051
a       b
1127
1135
FROM data_dictionary.TABLES
1128
1136
WHERE table_schema = DATABASE() AND table_name = 't1';
1129
1137
table_schema    table_name      row_format
1130
 
test    t1      DEFAULT
 
1138
test    t1      COMPACT
1131
1139
 
1132
1140
# - change ROW_FORMAT and check;
1133
1141
 
1137
1145
FROM data_dictionary.TABLES
1138
1146
WHERE table_schema = DATABASE() AND table_name = 't1';
1139
1147
table_schema    table_name      row_format
1140
 
test    t1      DEFAULT
 
1148
test    t1      REDUNDANT
1141
1149
 
1142
1150
# - that's it, cleanup.
1143
1151
 
1145
1153
create table t1(a char(10) not null, unique key aa(a(1)),
1146
1154
b char(4) not null, unique key bb(b(4))) engine=innodb;
1147
1155
desc t1;
1148
 
Field   Type    Null    Default Default_is_NULL On_Update
1149
 
a       VARCHAR NO              NO      
1150
 
b       VARCHAR NO              NO      
 
1156
Field   Type    Null    Key     Default Extra
 
1157
a       varchar(10)     NO      UNI     NULL    
 
1158
b       varchar(4)      NO      PRI     NULL    
1151
1159
show create table t1;
1152
1160
Table   Create Table
1153
1161
t1      CREATE TABLE `t1` (
1154
 
  `a` VARCHAR(10) COLLATE utf8_general_ci NOT NULL,
1155
 
  `b` VARCHAR(4) COLLATE utf8_general_ci NOT NULL,
 
1162
  `a` varchar(10) NOT NULL,
 
1163
  `b` varchar(4) NOT NULL,
1156
1164
  UNIQUE KEY `bb` (`b`),
1157
1165
  UNIQUE KEY `aa` (`a`(1))
1158
 
) ENGINE=InnoDB COLLATE = utf8_general_ci
 
1166
) ENGINE=InnoDB
1159
1167
drop table t1;
1160
1168
CREATE TABLE t1 (id int, type char(6), d int, INDEX idx(id,d)) ENGINE=InnoDB;
1161
1169
INSERT INTO t1 VALUES 
1172
1180
set @my_innodb_autoextend_increment=@@global.innodb_autoextend_increment;
1173
1181
set global innodb_autoextend_increment=8;
1174
1182
set global innodb_autoextend_increment=@my_innodb_autoextend_increment;
 
1183
set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency;
 
1184
set global innodb_commit_concurrency=0;
 
1185
set global innodb_commit_concurrency=@my_innodb_commit_concurrency;
1175
1186
End of 5.0 tests
1176
1187
CREATE TABLE `t2` (
1177
1188
`k` int NOT NULL auto_increment,
1272
1283
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b)) engine=innodb;
1273
1284
CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d),
1274
1285
CONSTRAINT c2 FOREIGN KEY f2 (c) REFERENCES t1 (a,b) ON UPDATE NO ACTION) engine=innodb;
1275
 
ERROR 42000: Incorrect foreign key definition for 'c2': Key reference and table reference don't match
 
1286
ERROR 42000: Incorrect foreign key definition for 'f2': Key reference and table reference don't match
1276
1287
CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d),
1277
1288
CONSTRAINT c2 FOREIGN KEY (c) REFERENCES t1 (a,b) ON UPDATE NO ACTION) engine=innodb;
1278
1289
ERROR 42000: Incorrect foreign key definition for 'c2': Key reference and table reference don't match
1295
1306
SHOW CREATE TABLE t2;
1296
1307
Table   Create Table
1297
1308
t2      CREATE TABLE `t2` (
1298
 
  `c` INT NOT NULL,
1299
 
  `d` INT NOT NULL,
 
1309
  `c` int NOT NULL,
 
1310
  `d` int NOT NULL,
1300
1311
  PRIMARY KEY (`c`,`d`),
1301
1312
  CONSTRAINT `c1` FOREIGN KEY (`c`) REFERENCES `t1` (`a`) ON DELETE NO ACTION,
1302
1313
  CONSTRAINT `c2` FOREIGN KEY (`c`) REFERENCES `t1` (`a`) ON UPDATE NO ACTION,
1303
 
  CONSTRAINT `f3` FOREIGN KEY (`c`) REFERENCES `t1` (`a`) ON UPDATE NO ACTION,
1304
 
  CONSTRAINT `t2_ibfk_4` FOREIGN KEY (`c`) REFERENCES `t1` (`a`) ON UPDATE NO ACTION
1305
 
) ENGINE=InnoDB COLLATE = utf8_general_ci
 
1314
  CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`c`) REFERENCES `t1` (`a`) ON UPDATE NO ACTION,
 
1315
  CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`c`) REFERENCES `t1` (`a`) ON UPDATE NO ACTION
 
1316
) ENGINE=InnoDB
1306
1317
DROP TABLE t2;
1307
1318
DROP TABLE t1;
1308
1319
create table t1 (a int auto_increment primary key) engine=innodb;
1347
1358
 
1348
1359
DROP TABLE t2;
1349
1360
DROP TABLE t1;
1350
 
SET GLOBAL innodb_lock_wait_timeout=@orig_lock_wait_timeout ;
1351
1361
End of 5.1 tests
1352
 
#
1353
 
# Test for bug #39932 "create table fails if column for FK is in different
1354
 
#                      case than in corr index".
1355
 
#
1356
 
drop tables if exists t1, t2;
1357
 
create table t1 (pk int primary key) engine=InnoDB;
1358
 
# Even although the below statement uses uppercased field names in
1359
 
# foreign key definition it still should be able to find explicitly
1360
 
# created supporting index. So it should succeed and should not
1361
 
# create any additional supporting indexes.
1362
 
create table t2 (fk int, key x (fk),
1363
 
constraint x foreign key (FK) references t1 (PK)) engine=InnoDB;
1364
 
show create table t2;
1365
 
Table   Create Table
1366
 
t2      CREATE TABLE `t2` (
1367
 
  `fk` INT DEFAULT NULL,
1368
 
  KEY `x` (`fk`),
1369
 
  CONSTRAINT `x` FOREIGN KEY (`FK`) REFERENCES `t1` (`PK`)
1370
 
) ENGINE=InnoDB COLLATE = utf8_general_ci
1371
 
drop table t2, t1;
1372
 
#
1373
 
# Bug#55826: create table .. select crashes with when KILL_BAD_DATA 
1374
 
#  is returned
1375
 
#
1376
 
CREATE TABLE t1(a INT) ENGINE=innodb;
1377
 
INSERT INTO t1 VALUES (0);
1378
 
CREATE TABLE t2 
1379
 
SELECT LEAST((SELECT '' FROM t1),NOW()) FROM `t1`;
1380
 
ERROR 22007: Incorrect datetime value: '' for column 'NOW()' at row 1
1381
 
DROP TABLE IF EXISTS t1,t2;
1382
 
Warnings:
1383
 
Note    1051    Unknown table 't2'