Commit 8fcde93e authored by Aditya A's avatar Aditya A

Bug#14653504 CRASH WHEN TRUNCATING PARTITIONS FROM A VIEW!

ANALYSIS
--------
 
When we open the view using open_new_frm() ,it doesnt set the
table-list->table variable and any access to table_list->table 
will cause a crash.
 
FIX
---
 
Added a check during execution of the alter partition to return 
error if table is view.

[http://rb.no.oracle.com/rb/r/2001/  Approved by Mattias J ]
parent 32863b08
......@@ -141,7 +141,9 @@ bool Alter_table_truncate_partition_statement::execute(THD *thd)
TODO: Add support for TRUNCATE PARTITION for NDB and other
engines supporting native partitioning.
*/
if (first_table->table->s->db_type() != partition_hton)
if (!first_table->table || first_table->view ||
first_table->table->s->db_type() != partition_hton)
{
my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0));
DBUG_RETURN(TRUE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment