~drizzle-trunk/drizzle/development

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# t/innodb_mysql.test
#
# Last update:
# 2006-07-26 ML test refactored (MySQL 5.1)
#               main testing code t/innodb_mysql.test -> include/mix1.inc              
#

-- source include/have_innodb.inc
let $engine_type= InnoDB;
let $other_engine_type= MEMORY;
# InnoDB does support FOREIGN KEYFOREIGN KEYs
let $test_foreign_keys= 1;
set global innodb_support_xa=default;
--source include/mix1.inc

--echo #
--echo # Test for bug #39932 "create table fails if column for FK is in different
--echo #                      case than in corr index".
--echo #
--disable_warnings
drop tables if exists t1, t2;
--enable_warnings
create table t1 (pk int primary key) engine=InnoDB;
--echo # Even although the below statement uses uppercased field names in
--echo # foreign key definition it still should be able to find explicitly
--echo # created supporting index. So it should succeed and should not
--echo # create any additional supporting indexes.
create table t2 (fk int, key x (fk),
                 constraint x foreign key (FK) references t1 (PK)) engine=InnoDB;
show create table t2;
drop table t2, t1;
--echo #
--echo # Bug#55826: create table .. select crashes with when KILL_BAD_DATA 
--echo #  is returned
--echo #

CREATE TABLE t1(a INT) ENGINE=innodb;
INSERT INTO t1 VALUES (0);
--error ER_TRUNCATED_WRONG_VALUE
CREATE TABLE t2 
  SELECT LEAST((SELECT '' FROM t1),NOW()) FROM `t1`;
DROP TABLE IF EXISTS t1,t2;