~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/innodb_mysql.result

  • Committer: Brian Aker
  • Date: 2010-08-12 17:21:13 UTC
  • mfrom: (1689.5.5 remove_pthread_calls)
  • Revision ID: brian@tangent.org-20100812172113-i0ox868kcbzjim2h
Merge in removal of pthread dead wrappers.

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;
483
482
show create table t1;
484
483
Table   Create Table
485
484
t1      CREATE TABLE `t1` (
486
 
  `a` INT DEFAULT NULL
487
 
) ENGINE=InnoDB COMMENT='123' COLLATE = utf8_general_ci
 
485
  `a` int DEFAULT NULL
 
486
) ENGINE=InnoDB COMMENT='123'
488
487
drop table t1;
489
488
CREATE TABLE t1 (a CHAR(2), KEY (a)) ENGINE = InnoDB;
490
489
INSERT INTO t1 VALUES ('uk'),('bg');
769
768
id      1
770
769
select_type     SIMPLE
771
770
table   t1
772
 
type    index
 
771
type    range
773
772
possible_keys   bkey
774
773
key     bkey
775
774
key_len 5
776
775
ref     NULL
777
 
rows    32
 
776
rows    16
778
777
Extra   Using where; Using index
779
778
SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY b,a;
780
779
a       b
853
852
key     bkey
854
853
key_len 10
855
854
ref     const,const
856
 
rows    16
 
855
rows    8
857
856
Extra   Using where; Using index
858
857
SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY a;
859
858
a       b       c
882
881
key     bkey
883
882
key_len 10
884
883
ref     const,const
885
 
rows    16
 
884
rows    8
886
885
Extra   Using where; Using index
887
886
SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY b,c,a;
888
887
a       b       c
911
910
key     bkey
912
911
key_len 10
913
912
ref     const,const
914
 
rows    16
 
913
rows    8
915
914
Extra   Using where; Using index
916
915
SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY c,a;
917
916
a       b       c
940
939
show create table t1;
941
940
Table   Create Table
942
941
t1      CREATE TABLE `t1` (
943
 
  `a` TEXT COLLATE utf8_general_ci,
 
942
  `a` text,
944
943
  KEY `a` (`a`(255))
945
 
) ENGINE=InnoDB COLLATE = utf8_general_ci
 
944
) ENGINE=InnoDB
946
945
drop table t1;
947
946
CREATE TABLE t1 (
948
947
a INT,
1022
1021
key     b
1023
1022
key_len 5
1024
1023
ref     const
1025
 
rows    2
 
1024
rows    1
1026
1025
Extra   Using where; Using index
1027
1026
SELECT * FROM t1 WHERE b=2 ORDER BY a ASC;
1028
1027
a       b
1037
1036
key     b
1038
1037
key_len 5
1039
1038
ref     const
1040
 
rows    2
 
1039
rows    1
1041
1040
Extra   Using where; Using index
1042
1041
SELECT * FROM t1 WHERE b=2 ORDER BY a DESC;
1043
1042
a       b
1151
1150
show create table t1;
1152
1151
Table   Create Table
1153
1152
t1      CREATE TABLE `t1` (
1154
 
  `a` VARCHAR(10) COLLATE utf8_general_ci NOT NULL,
1155
 
  `b` VARCHAR(4) COLLATE utf8_general_ci NOT NULL,
 
1153
  `a` varchar(10) NOT NULL,
 
1154
  `b` varchar(4) NOT NULL,
1156
1155
  UNIQUE KEY `bb` (`b`),
1157
1156
  UNIQUE KEY `aa` (`a`(1))
1158
 
) ENGINE=InnoDB COLLATE = utf8_general_ci
 
1157
) ENGINE=InnoDB
1159
1158
drop table t1;
1160
1159
CREATE TABLE t1 (id int, type char(6), d int, INDEX idx(id,d)) ENGINE=InnoDB;
1161
1160
INSERT INTO t1 VALUES 
1172
1171
set @my_innodb_autoextend_increment=@@global.innodb_autoextend_increment;
1173
1172
set global innodb_autoextend_increment=8;
1174
1173
set global innodb_autoextend_increment=@my_innodb_autoextend_increment;
 
1174
set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency;
 
1175
set global innodb_commit_concurrency=0;
 
1176
set global innodb_commit_concurrency=@my_innodb_commit_concurrency;
1175
1177
End of 5.0 tests
1176
1178
CREATE TABLE `t2` (
1177
1179
`k` int NOT NULL auto_increment,
1272
1274
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b)) engine=innodb;
1273
1275
CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d),
1274
1276
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
 
1277
ERROR 42000: Incorrect foreign key definition for 'f2': Key reference and table reference don't match
1276
1278
CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d),
1277
1279
CONSTRAINT c2 FOREIGN KEY (c) REFERENCES t1 (a,b) ON UPDATE NO ACTION) engine=innodb;
1278
1280
ERROR 42000: Incorrect foreign key definition for 'c2': Key reference and table reference don't match
1295
1297
SHOW CREATE TABLE t2;
1296
1298
Table   Create Table
1297
1299
t2      CREATE TABLE `t2` (
1298
 
  `c` INT NOT NULL,
1299
 
  `d` INT NOT NULL,
 
1300
  `c` int NOT NULL,
 
1301
  `d` int NOT NULL,
1300
1302
  PRIMARY KEY (`c`,`d`),
1301
1303
  CONSTRAINT `c1` FOREIGN KEY (`c`) REFERENCES `t1` (`a`) ON DELETE NO ACTION,
1302
1304
  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
 
1305
  CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`c`) REFERENCES `t1` (`a`) ON UPDATE NO ACTION,
 
1306
  CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`c`) REFERENCES `t1` (`a`) ON UPDATE NO ACTION
 
1307
) ENGINE=InnoDB
1306
1308
DROP TABLE t2;
1307
1309
DROP TABLE t1;
1308
1310
create table t1 (a int auto_increment primary key) engine=innodb;
1347
1349
 
1348
1350
DROP TABLE t2;
1349
1351
DROP TABLE t1;
1350
 
SET GLOBAL innodb_lock_wait_timeout=@orig_lock_wait_timeout ;
1351
1352
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'