summaryrefslogtreecommitdiff
path: root/sql/ha_myisammrg.cc
diff options
context:
space:
mode:
authorunknown <jimw@rama.(none)>2006-07-11 17:28:50 -0700
committerunknown <jimw@rama.(none)>2006-07-11 17:28:50 -0700
commit97cdd9df8a67a26335fba3ffbb9daca7b2877b10 (patch)
treec614126b30086c98bceee3d353c579a693288480 /sql/ha_myisammrg.cc
parentc3cb46908c30895e0aafa0f7602370240a3c5a98 (diff)
downloadmariadb-git-97cdd9df8a67a26335fba3ffbb9daca7b2877b10.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. include/my_base.h: Add new handler error mysql-test/r/merge.result: Update results mysql-test/t/merge.test: Add new regression test sql/ha_myisammrg.cc: When trying to insert into a MERGE table with no underlying tables or no INSERT_METHOD, report that it is read-only. sql/handler.cc: Handle new error message
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])