summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2006-02-15 11:20:57 -0800
committerunknown <jimw@mysql.com>2006-02-15 11:20:57 -0800
commit44a2ccc152f68a349a53fa65a7048258fc0b8cb9 (patch)
tree9c65a5b6c262a84f2a19272e4fe738a051ce1fee /sql
parentfe98fef92c5981158278aebcbd269a1213dfc2ac (diff)
downloadmariadb-git-44a2ccc152f68a349a53fa65a7048258fc0b8cb9.tar.gz
Bug #16782: Partitions: crash, REPLACE .. on table with PK, DUPLICATE
KEY event. Partitioning wrongly claimed to be able to handle HA_DUPP_POS when it was supported by the underlying storage engine, which resulted in a crash when handling REPLACE statements. mysql-test/r/partition.result: Add new results mysql-test/t/partition.test: Add regression test sql/ha_partition.cc: Fix list of table flags that are not passed through for partitioned tables, and add HA_DUPP_POS to that list. Also, handle HA_EXTRA_FLUSH_CACHE in ha_partition::extra().
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_partition.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 50299dffd85..a71b13bed17 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -359,7 +359,7 @@ int ha_partition::ha_initialise()
other parameters are calculated on demand.
HA_FILE_BASED is always set for partition handler since we use a
special file for handling names of partitions, engine types.
- HA_CAN_GEOMETRY, HA_CAN_FULLTEXT, HA_CAN_SQL_HANDLER,
+ HA_CAN_GEOMETRY, HA_CAN_FULLTEXT, HA_CAN_SQL_HANDLER, HA_DUPP_POS,
HA_CAN_INSERT_DELAYED is disabled until further investigated.
*/
m_table_flags= m_file[0]->table_flags();
@@ -382,8 +382,8 @@ int ha_partition::ha_initialise()
m_pkey_is_clustered= FALSE;
m_table_flags&= file->table_flags();
} while (*(++file_array));
- m_table_flags&= ~(HA_CAN_GEOMETRY & HA_CAN_FULLTEXT &
- HA_CAN_SQL_HANDLER & HA_CAN_INSERT_DELAYED);
+ m_table_flags&= ~(HA_CAN_GEOMETRY | HA_CAN_FULLTEXT | HA_DUPP_POS |
+ HA_CAN_SQL_HANDLER | HA_CAN_INSERT_DELAYED);
m_table_flags|= HA_FILE_BASED | HA_REC_NOT_IN_SEQ;
DBUG_RETURN(0);
}
@@ -4688,6 +4688,7 @@ int ha_partition::extra(enum ha_extra_function operation)
case HA_EXTRA_PREPARE_FOR_UPDATE:
case HA_EXTRA_PREPARE_FOR_DELETE:
case HA_EXTRA_FORCE_REOPEN:
+ case HA_EXTRA_FLUSH_CACHE:
{
if (m_myisam)
DBUG_RETURN(loop_extra(operation));