summaryrefslogtreecommitdiff
path: root/storage/innobase
diff options
context:
space:
mode:
authorJimmy Yang <jimmy.yang@oracle.com>2010-06-22 19:04:31 -0700
committerJimmy Yang <jimmy.yang@oracle.com>2010-06-22 19:04:31 -0700
commit1ac84a45dfa6f4140ad97b3e026bf756cee6f1cc (patch)
treeb26e4ad0c2813427e2c6809353f54e9da26fd2d6 /storage/innobase
parentd17ee9f8ec5328e9421bd77a335a68b44027b301 (diff)
downloadmariadb-git-1ac84a45dfa6f4140ad97b3e026bf756cee6f1cc.tar.gz
Fix bug #54044, Create temporary tables and using innodb crashes. Screen
out NULL type columns, and return without creating the table. rb://378 approved by Marko
Diffstat (limited to 'storage/innobase')
-rw-r--r--storage/innobase/handler/ha_innodb.cc24
1 files changed, 22 insertions, 2 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 9990d7c28f0..d10fcb8d31e 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -3242,6 +3242,11 @@ get_innobase_type_from_mysql_type(
case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_LONG_BLOB:
return(DATA_BLOB);
+ case MYSQL_TYPE_NULL:
+ /* MySQL currently accepts "NULL" datatype, but will
+ reject such datatype in the next release. We will cope
+ with it and not trigger assertion failure in 5.1 */
+ break;
default:
assert(0);
}
@@ -5263,7 +5268,22 @@ create_table_def(
field = form->field[i];
col_type = get_innobase_type_from_mysql_type(&unsigned_type,
- field);
+ field);
+
+ if (!col_type) {
+ push_warning_printf(
+ (THD*) trx->mysql_thd,
+ MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_CANT_CREATE_TABLE,
+ "Error creating table '%s' with "
+ "column '%s'. Please check its "
+ "column type and try to re-create "
+ "the table with an appropriate "
+ "column type.",
+ table->name, (char*) field->field_name);
+ goto err_col;
+ }
+
if (field->null_ptr) {
nulls_allowed = 0;
} else {
@@ -5320,7 +5340,7 @@ create_table_def(
"different column name.",
table->name, (char*) field->field_name,
(char*) field->field_name);
-
+err_col:
dict_mem_table_free(table);
trx_commit_for_mysql(trx);