summaryrefslogtreecommitdiff
path: root/innobase/row
diff options
context:
space:
mode:
authoraivanov@mysql.com <>2006-04-21 01:07:37 +0400
committeraivanov@mysql.com <>2006-04-21 01:07:37 +0400
commit25d9a75d122d93b25fef61ed37d6bfa3d2a29c13 (patch)
tree31ecaf555285cc75ca6c78a278663dcc1fc1c253 /innobase/row
parent721191c0f9cfd0fabb5e911cf856a79b999767ac (diff)
downloadmariadb-git-25d9a75d122d93b25fef61ed37d6bfa3d2a29c13.tar.gz
Applied innodb-5.0-ss476 snapshot.
Fix BUG#18934: "InnoDB crashes when table uses column like DB_ROW_ID". Also, fix memory leaks in row_create_table_for_mysql() in rare corner cases.
Diffstat (limited to 'innobase/row')
-rw-r--r--innobase/row/row0mysql.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index 937056c300e..89b82882d93 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -1673,7 +1673,9 @@ row_mysql_recover_tmp_table(
if (!ptr) {
/* table name does not begin with "/rsql" */
+ dict_mem_table_free(table);
trx_commit_for_mysql(trx);
+
return(DB_ERROR);
}
else {
@@ -1785,6 +1787,7 @@ row_create_table_for_mysql(
const char* table_name;
ulint table_name_len;
ulint err;
+ ulint i;
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
#ifdef UNIV_SYNC_DEBUG
@@ -1802,6 +1805,7 @@ row_create_table_for_mysql(
"InnoDB: with raw, and innodb_force_... is removed.\n",
stderr);
+ dict_mem_table_free(table);
trx_commit_for_mysql(trx);
return(DB_ERROR);
@@ -1816,11 +1820,25 @@ row_create_table_for_mysql(
"InnoDB: MySQL system tables must be of the MyISAM type!\n",
table->name);
+ dict_mem_table_free(table);
trx_commit_for_mysql(trx);
return(DB_ERROR);
}
+ /* Check that no reserved column names are used. */
+ for (i = 0; i < dict_table_get_n_user_cols(table); i++) {
+ dict_col_t* col = dict_table_get_nth_col(table, i);
+
+ if (dict_col_name_is_reserved(col->name)) {
+
+ dict_mem_table_free(table);
+ trx_commit_for_mysql(trx);
+
+ return(DB_ERROR);
+ }
+ }
+
trx_start_if_not_started(trx);
if (row_mysql_is_recovered_tmp_table(table->name)) {