diff options
author | Jimmy Yang <jimmy.yang@oracle.com> | 2010-06-24 01:49:22 -0700 |
---|---|---|
committer | Jimmy Yang <jimmy.yang@oracle.com> | 2010-06-24 01:49:22 -0700 |
commit | 1082c98d97bda77e3da128aed695bf199b4fb7f3 (patch) | |
tree | 3da4559f02d8aeda7765ac0e7320181056d2bbc1 /storage/innobase | |
parent | 7bfd9ea703b6a8a72b3db5a3c58ed0d58bd6a258 (diff) | |
download | mariadb-git-1082c98d97bda77e3da128aed695bf199b4fb7f3.tar.gz |
Port fix for bug #54044 from mysql-5.1-security to mysql-trunk-security:
------------------------------------------------------------
revno: 3438
committer: Jimmy Yang <jimmy.yang@oracle.com>
branch nick: mysql-5.1-security
timestamp: Thu 2010-06-24 01:20:25 -0700
message:
Fix Bug #54044 Create temporary tables and using innodb crashes.
Diffstat (limited to 'storage/innobase')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 86246e62eee..cbed05f0a5e 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -4143,6 +4143,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: ut_error; } @@ -6190,7 +6195,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 { @@ -6248,7 +6268,7 @@ create_table_def( if (dict_col_name_is_reserved(field->field_name)){ my_error(ER_WRONG_COLUMN_NAME, MYF(0), field->field_name); - +err_col: dict_mem_table_free(table); trx_commit_for_mysql(trx); |