diff options
author | unknown <serg@serg.mylan> | 2003-10-06 20:02:27 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2003-10-06 20:02:27 +0200 |
commit | e86fc82cf27303a0fe165b4567291ae228491302 (patch) | |
tree | 053d9dc151c78375331d8f5d7a629f6b115573cf /sql/sql_insert.cc | |
parent | 08a08a67dbde78258e46b0d9bcd387c8419b8fcd (diff) | |
download | mariadb-git-e86fc82cf27303a0fe165b4567291ae228491302.tar.gz |
bug #1434 (and related issues)
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r-- | sql/sql_insert.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 0a83358e8c6..ad08ad6ccd6 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1438,6 +1438,15 @@ select_create::prepare(List<Item> &values) if (!table) DBUG_RETURN(-1); // abort() deletes table + if (table->fields < values.elements) + { + do_not_drop=1; + my_printf_error(ER_WRONG_VALUE_COUNT_ON_ROW, + ER(ER_WRONG_VALUE_COUNT_ON_ROW), + MYF(0),1); + DBUG_RETURN(-1); + } + /* First field to copy */ field=table->field+table->fields - values.elements; @@ -1498,7 +1507,7 @@ bool select_create::send_eof() */ if (!table->tmp_table) hash_delete(&open_cache,(byte*) table); - lock=0; + lock=0; table=0; VOID(pthread_mutex_unlock(&LOCK_open)); } @@ -1519,7 +1528,8 @@ void select_create::abort() enum db_type table_type=table->db_type; if (!table->tmp_table) hash_delete(&open_cache,(byte*) table); - quick_rm_table(table_type,db,name); + if (!do_not_drop) + quick_rm_table(table_type,db,name); table=0; } VOID(pthread_mutex_unlock(&LOCK_open)); |