Merge lp:~stewart/drizzle/bug673380 into lp:drizzle/7.0

Proposed by Stewart Smith
Status: Merged
Approved by: Brian Aker
Approved revision: 1921
Merged at revision: 1926
Proposed branch: lp:~stewart/drizzle/bug673380
Merge into: lp:drizzle/7.0
Diff against target: 39 lines (+19/-0)
3 files modified
drizzled/table_proto_write.cc (+6/-0)
tests/r/bug673380_create_table_null_col_type.result (+3/-0)
tests/t/bug673380_create_table_null_col_type.test (+10/-0)
To merge this branch: bzr merge lp:~stewart/drizzle/bug673380
Reviewer Review Type Date Requested Status
Drizzle Developers Pending
Review via email: mp+40505@code.launchpad.net

Description of the change

http://hudson.drizzle.org/view/Drizzle-param/job/drizzle-param/599/

found when I found the innobase fix for this.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'drizzled/table_proto_write.cc'
2--- drizzled/table_proto_write.cc 2010-10-07 05:18:53 +0000
3+++ drizzled/table_proto_write.cc 2010-11-10 08:49:46 +0000
4@@ -96,6 +96,12 @@
5
6 message::Table::Field::FieldType parser_type= attribute->type();
7
8+ if (field_arg->sql_type == DRIZZLE_TYPE_NULL)
9+ {
10+ my_error(ER_CANT_CREATE_TABLE, MYF(ME_BELL+ME_WAITTANG), table_proto.name().c_str(), -1);
11+ return -1;
12+ }
13+
14 attribute->set_type(message::internalFieldTypeToFieldProtoType(field_arg->sql_type));
15
16 switch (attribute->type()) {
17
18=== added file 'tests/r/bug673380_create_table_null_col_type.result'
19--- tests/r/bug673380_create_table_null_col_type.result 1970-01-01 00:00:00 +0000
20+++ tests/r/bug673380_create_table_null_col_type.result 2010-11-10 08:49:46 +0000
21@@ -0,0 +1,3 @@
22+CREATE TEMPORARY TABLE TABLE_54044
23+AS SELECT IF(NULL IS NOT NULL, NULL, NULL);
24+ERROR HY000: Can't create table 'table_54044' (errno: -1)
25
26=== added file 'tests/t/bug673380_create_table_null_col_type.test'
27--- tests/t/bug673380_create_table_null_col_type.test 1970-01-01 00:00:00 +0000
28+++ tests/t/bug673380_create_table_null_col_type.test 2010-11-10 08:49:46 +0000
29@@ -0,0 +1,10 @@
30+# This is the test for bug #54044. Special handle MYSQL_TYPE_NULL type
31+# during create table, so it will not trigger assertion failure.
32+
33+# This 'create table' operation should fail because of
34+# using NULL datatype
35+--error ER_CANT_CREATE_TABLE
36+CREATE TEMPORARY TABLE TABLE_54044
37+ AS SELECT IF(NULL IS NOT NULL, NULL, NULL);
38+
39+

Subscribers

People subscribed via source and target branches