diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_partition.cc | 7 | ||||
-rw-r--r-- | sql/sql_partition.cc | 7 |
2 files changed, 13 insertions, 1 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 67bc3156260..97ecd70d6f8 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -5381,6 +5381,13 @@ int ha_partition::extra(enum ha_extra_function operation) /* Currently only NDB use the *_CANNOT_BATCH */ break; } + /* + http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations.html + says we no longer support logging to partitioned tables, so we fail + here. + */ + case HA_EXTRA_MARK_AS_LOG_TABLE: + DBUG_RETURN(ER_UNSUPORTED_LOG_ENGINE); default: { /* Temporary crash to discover what is wrong */ 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 |