summaryrefslogtreecommitdiff
path: root/sql/sql_partition.cc
diff options
context:
space:
mode:
authorTatiana A. Nurnberg <azundris@mysql.com>2009-07-31 14:38:18 +0200
committerTatiana A. Nurnberg <azundris@mysql.com>2009-07-31 14:38:18 +0200
commitf6b8b9d2f871ab59e1c5f22712a03603abd61a9b (patch)
tree5beb5e75fef8047c3da0acfcd0d96363fc790e3e /sql/sql_partition.cc
parent7c28ec97a985f3a9e22a2fe5048dc37f61d114a3 (diff)
downloadmariadb-git-f6b8b9d2f871ab59e1c5f22712a03603abd61a9b.tar.gz
Bug#40281, partitioning the general log table crashes the server
We disallow the partitioning of a log table. You could however partition a table first, and then point logging to it. This is not only against the docs, it also crashes the server. We catch this case now.
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r--sql/sql_partition.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 284eaebbe87..a181a6b3f13 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -3824,8 +3824,13 @@ bool mysql_unpack_partition(THD *thd,
Item_field objects.
This is not a nice solution since if the parser uses current_select
for anything else it will corrupt the current LEX object.
+ Also, we need to make sure there even is a select -- if the statement
+ was a "USE ...", current_select will be NULL, but we may still end up
+ here if we try to log to a partitioned table. This is currently
+ unsupported, but should still fail rather than crash!
*/
- thd->lex->current_select= old_lex->current_select;
+ if (!(thd->lex->current_select= old_lex->current_select))
+ goto end;
/*
All Items created is put into a free list on the THD object. This list
is used to free all Item objects after completing a query. We don't