summaryrefslogtreecommitdiff
path: root/sql/ha_myisammrg.cc
diff options
context:
space:
mode:
authorjimw@rama.(none) <>2006-07-11 17:28:50 -0700
committerjimw@rama.(none) <>2006-07-11 17:28:50 -0700
commit005c2a05d4657ba71f27a9f2e596b0ae9a97bd74 (patch)
treec614126b30086c98bceee3d353c579a693288480 /sql/ha_myisammrg.cc
parent8f4582db27327a46f0306948b0c3158ddc1c9ffc (diff)
downloadmariadb-git-005c2a05d4657ba71f27a9f2e596b0ae9a97bd74.tar.gz
Bug #17766: The server accepts to create MERGE tables which cannot work
Changed the error reporting (and a crash) when inserting data into a MERGE table that has no underlying tables or no INSERT_METHOD specified by reporting that it is read-only.
Diffstat (limited to 'sql/ha_myisammrg.cc')
-rw-r--r--sql/ha_myisammrg.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index d2fd1a9e28a..a22f74df5de 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -132,6 +132,10 @@ int ha_myisammrg::close(void)
int ha_myisammrg::write_row(byte * buf)
{
statistic_increment(table->in_use->status_var.ha_write_count,&LOCK_status);
+
+ if (file->merge_insert_method == MERGE_INSERT_DISABLED || !file->tables)
+ return (HA_ERR_TABLE_READONLY);
+
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
table->timestamp_field->set_time();
if (table->next_number_field && buf == table->record[0])