summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2012-02-20 22:59:11 +0100
committerMattias Jonsson <mattias.jonsson@oracle.com>2012-02-20 22:59:11 +0100
commit7e21bee031dc8f3623e95c3664d0463f17cffc40 (patch)
tree0efb009bb711ac428314e103e8833b082a31f451 /sql/ha_partition.cc
parent8b0f2c4d7db367c16f84f6a1e71961addb406378 (diff)
downloadmariadb-git-7e21bee031dc8f3623e95c3664d0463f17cffc40.tar.gz
Bug#11761296: 53775: QUERY ON PARTITIONED TABLE RETURNS CACHED
RESULT FROM PREVIOUS TRANSACTION The current Query Cache API is not fully compatible with the partitioning engine. There is no good way to implement support for QC due to: 1) a static callback for ha_partition would need to have access to all partition names and call the underlying callback for each [sub]partition with the correct name. 2) pruning would be impossible, even if one used the ulonglong engine_data due to if engine_data is changed, the table is invalidated by the QC. So the only viable solution to avoid incorrect data is to not allow caching of queries using partitioned tables. (There are some extra changes, due to removal of \r as line break)
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 7c7cf5a4302..7e044b5260e 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -6494,20 +6494,20 @@ int ha_partition::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys)
return ret;
err:
if (file > m_file)
- {
- uint *key_numbers= (uint*) ha_thd()->alloc(sizeof(uint) * num_of_keys);
- KEY *old_key_info= table_arg->key_info;
- uint i;
- /* Use the newly added key_info as table->key_info to remove them. */
- for (i= 0; i < num_of_keys; i++)
- key_numbers[i]= i;
- table_arg->key_info= key_info;
- while (--file >= m_file)
- {
- (void) (*file)->prepare_drop_index(table_arg, key_numbers, num_of_keys);
- (void) (*file)->final_drop_index(table_arg);
- }
- table_arg->key_info= old_key_info;
+ {
+ uint *key_numbers= (uint*) ha_thd()->alloc(sizeof(uint) * num_of_keys);
+ KEY *old_key_info= table_arg->key_info;
+ uint i;
+ /* Use the newly added key_info as table->key_info to remove them. */
+ for (i= 0; i < num_of_keys; i++)
+ key_numbers[i]= i;
+ table_arg->key_info= key_info;
+ while (--file >= m_file)
+ {
+ (void) (*file)->prepare_drop_index(table_arg, key_numbers, num_of_keys);
+ (void) (*file)->final_drop_index(table_arg);
+ }
+ table_arg->key_info= old_key_info;
}
return ret;
}