~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/innobase/mysql-test/innodb_bug21704.result

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
# Bug#21704: Renaming column does not update FK definition.
3
 
#
4
 
 
5
 
# Test that it's not possible to rename columns participating in a
6
 
# foreign key (either in the referencing or referenced table).
7
 
 
8
 
DROP TABLE IF EXISTS t1;
9
 
DROP TABLE IF EXISTS t2;
10
 
DROP TABLE IF EXISTS t3;
11
 
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ROW_FORMAT=COMPACT ENGINE=INNODB;
12
 
CREATE TABLE t2 (a INT PRIMARY KEY, b INT,
13
 
CONSTRAINT fk1 FOREIGN KEY (a) REFERENCES t1(a))
14
 
ROW_FORMAT=COMPACT ENGINE=INNODB;
15
 
CREATE TABLE t3 (a INT PRIMARY KEY, b INT, KEY(b), C INT,
16
 
CONSTRAINT fk2 FOREIGN KEY (b) REFERENCES t3 (a))
17
 
ROW_FORMAT=COMPACT ENGINE=INNODB;
18
 
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
19
 
INSERT INTO t2 VALUES (1,1),(2,2),(3,3);
20
 
INSERT INTO t3 VALUES (1,1,1),(2,2,2),(3,3,3);
21
 
 
22
 
# Test renaming the column in the referenced table.
23
 
 
24
 
ALTER TABLE t1 CHANGE a c INT;
25
 
ERROR HY000: Error on rename of '#sql-temporary' to './test/t1' (errno: 150)
26
 
# Ensure that online column rename works.
27
 
ALTER TABLE t1 CHANGE b c INT;
28
 
affected rows: 0
29
 
info: Records: 0  Duplicates: 0  Warnings: 0
30
 
 
31
 
# Test renaming the column in the referencing table
32
 
 
33
 
ALTER TABLE t2 CHANGE a c INT;
34
 
ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150)
35
 
# Ensure that online column rename works.
36
 
ALTER TABLE t2 CHANGE b c INT;
37
 
affected rows: 0
38
 
info: Records: 0  Duplicates: 0  Warnings: 0
39
 
 
40
 
# Test with self-referential constraints
41
 
 
42
 
ALTER TABLE t3 CHANGE a d INT;
43
 
ERROR HY000: Error on rename of '#sql-temporary' to './test/t3' (errno: 150)
44
 
ALTER TABLE t3 CHANGE b d INT;
45
 
ERROR HY000: Error on rename of '#sql-temporary' to './test/t3' (errno: 150)
46
 
# Ensure that online column rename works.
47
 
ALTER TABLE t3 CHANGE c d INT;
48
 
affected rows: 0
49
 
info: Records: 0  Duplicates: 0  Warnings: 0
50
 
 
51
 
# Cleanup.
52
 
 
53
 
DROP TABLE t3;
54
 
DROP TABLE t2;
55
 
DROP TABLE t1;