Transaction log does not appear to be capturing FOREIGN KEY information
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Fix Released
|
Medium
|
Stewart Smith | ||
Dexter |
Fix Released
|
Medium
|
Stewart Smith |
Bug Description
The transaction log does not appear to be capturing FOREIGN KEY information, at least as reported by the UDF - print_transacti
This test is in the linked branch:
test-run --suite=
It will not fail, but the .result file / output will allow you to see this.
Test case:
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL, PRIMARY KEY(a), KEY b_key1 (b));
CREATE TABLE t2(a INT NOT NULL, b INT , PRIMARY KEY(a), KEY b_key (b),
CONSTRAINT fk_constraint_t2 FOREIGN KEY (b) REFERENCES t1(b) ON DELETE SET NULL ON UPDATE CASCADE);
SELECT PRINT_TRANSACTI
DROP TABLE t1, t2;
The output for the CREATE TABLE t2 statement from print_transacti
+PRINT_
+transaction_
+ server_id: 1
+ transaction_id: 4
+ START_TIMESTAMP
+ END_TIMESTAMP
+}
+statement {
+ type: CREATE_TABLE
+ START_TIMESTAMP
+ END_TIMESTAMP
+ create_
+ table {
+ name: "t2"
+ engine {
+ name: "InnoDB"
+ }
+ field {
+ name: "a"
+ type: INTEGER
+ constraints {
+ is_nullable: false
+ }
+ }
+ field {
+ name: "b"
+ type: INTEGER
+ options {
+ default_null: true
+ }
+ }
+ indexes {
+ name: "PRIMARY"
+ is_primary: true
+ is_unique: true
+ type: UNKNOWN_INDEX
+ key_length: 4
+ index_part {
+ fieldnr: 0
+ compare_length: 4
+ }
+ options {
+ }
+ }
+ indexes {
+ name: "b_key"
+ is_primary: false
+ is_unique: false
+ type: UNKNOWN_INDEX
+ key_length: 4
+ index_part {
+ fieldnr: 1
+ compare_length: 4
+ }
+ options {
+ null_part_key: true
+ }
+ }
+ type: STANDARD
+ schema: "test"
+ options {
+ collation: "utf8_general_ci"
+ collation_id: 45
+ }
+ CREATE_TIMESTAMP
+ UPDATE_TIMESTAMP
+ }
+ }
+}
Related branches
- Drizzle Merge Team: Pending requested
-
Diff: 470 lines (+257/-45)9 files modifieddrizzled/foreign_key.h (+9/-21)
drizzled/message/include.am (+3/-2)
drizzled/message/statement_transform.cc (+159/-0)
drizzled/message/statement_transform.h (+20/-0)
drizzled/message/table.proto (+24/-4)
drizzled/sql_table.cc (+24/-0)
drizzled/sql_yacc.yy (+14/-14)
drizzled/statement/create_table.h (+3/-3)
plugin/transaction_log/tests/r/replace.result (+1/-1)
Changed in drizzle: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
The parser not collecting this is work that Stewart needs to complete.
The create table code path used in replication, is not the same that is used in SHOW CREATE TABLE.
On Jun 23, 2010, at 4:44 PM, Patrick Crews wrote:
> Public bug reported: on_message: transaction_ log transaction_ log_create ON_MESSAGE( 'transaction. log',(select .TRANSACTION_ LOG_TRANSACTION S)); on_message: TRANSACTION_ MESSAGE( 'transaction. log',(select max(entry_offset) from DATA_DICTIONARY .TRANSACTION_ LOG_TRANSACTION S)) context { table_statement { /bugs.launchpad .net/bugs/ 597910
>
> The transaction log does not appear to be capturing FOREIGN KEY
> information, at least as reported by the UDF -
> print_transacti
>
> This test is in the linked branch:
> test-run --suite=
> It will not fail, but the .result file / output will allow you to see this.
>
> Test case:
> DROP TABLE IF EXISTS t1, t2;
> CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL, PRIMARY KEY(a), KEY b_key1 (b));
>
> CREATE TABLE t2(a INT NOT NULL, b INT , PRIMARY KEY(a), KEY b_key (b),
> CONSTRAINT fk_constraint_t2 FOREIGN KEY (b) REFERENCES t1(b) ON DELETE SET NULL ON UPDATE CASCADE);
>
> SELECT PRINT_TRANSACTI
> max(entry_offset) from DATA_DICTIONARY
>
> DROP TABLE t1, t2;
>
> The output for the CREATE TABLE t2 statement from print_transacti
> +PRINT_
> +transaction_
> + server_id: 1
> + transaction_id: 4
> + START_TIMESTAMP
> + END_TIMESTAMP
> +}
> +statement {
> + type: CREATE_TABLE
> + START_TIMESTAMP
> + END_TIMESTAMP
> + create_
> + table {
> + name: "t2"
> + engine {
> + name: "InnoDB"
> + }
> + field {
> + name: "a"
> + type: INTEGER
> + constraints {
> + is_nullable: false
> + }
> + }
> + field {
> + name: "b"
> + type: INTEGER
> + options {
> + default_null: true
> + }
> + }
> + indexes {
> + name: "PRIMARY"
> + is_primary: true
> + is_unique: true
> + type: UNKNOWN_INDEX
> + key_length: 4
> + index_part {
> + fieldnr: 0
> + compare_length: 4
> + }
> + options {
> + }
> + }
> + indexes {
> + name: "b_key"
> + is_primary: false
> + is_unique: false
> + type: UNKNOWN_INDEX
> + key_length: 4
> + index_part {
> + fieldnr: 1
> + compare_length: 4
> + }
> + options {
> + null_part_key: true
> + }
> + }
> + type: STANDARD
> + schema: "test"
> + options {
> + collation: "utf8_general_ci"
> + collation_id: 45
> + }
> + CREATE_TIMESTAMP
> + UPDATE_TIMESTAMP
> + }
> + }
> +}
>
> ** Affects: drizzle
> Importance: Medium
> Status: Confirmed
>
> ** Branch linked: lp:~patrick-crews/drizzle/transaction_log_tests
>
> ** Changed in: drizzle
> Importance: Undecided => Medium
>
> ** Changed in: drizzle
> Status: New => Confirmed
>
> --
> Transaction log does not appear to be capturing FOREIGN KEY information
> https:/
> You received this bug notification because you are a member of Drizzle-
> developers, which is subscribed to Drizzle.
> ...