summaryrefslogtreecommitdiff
path: root/sql/handler.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/handler.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/handler.cc')
-rw-r--r--sql/handler.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index b40934ea194..0c58950b09f 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -426,6 +426,7 @@ static int ha_init_errors(void)
SETMSG(HA_ERR_NO_CONNECTION, "Could not connect to storage engine");
SETMSG(HA_ERR_TABLE_DEF_CHANGED, ER(ER_TABLE_DEF_CHANGED));
SETMSG(HA_ERR_TABLE_NEEDS_UPGRADE, ER(ER_TABLE_NEEDS_UPGRADE));
+ SETMSG(HA_ERR_TABLE_READONLY, ER(ER_OPEN_AS_READONLY));
/* Register the error messages for use with my_error(). */
return my_error_register(errmsgs, HA_ERR_FIRST, HA_ERR_LAST);
@@ -1799,6 +1800,9 @@ void handler::print_error(int error, myf errflag)
case HA_ERR_TABLE_NEEDS_UPGRADE:
textno=ER_TABLE_NEEDS_UPGRADE;
break;
+ case HA_ERR_TABLE_READONLY:
+ textno= ER_OPEN_AS_READONLY;
+ break;
default:
{
/* The error was "unknown" to this function.