summaryrefslogtreecommitdiffstats
path: root/storage/heap/ha_heap.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 13:22:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 13:22:53 +0000
commit347c164c35eddab388009470e6848cb361ac93f8 (patch)
tree2c0c44eac690f510bb0a35b2a13b36d606b77b6b /storage/heap/ha_heap.cc
parentReleasing progress-linux version 1:10.11.7-4~progress7.99u1. (diff)
downloadmariadb-347c164c35eddab388009470e6848cb361ac93f8.tar.xz
mariadb-347c164c35eddab388009470e6848cb361ac93f8.zip
Merging upstream version 1:10.11.8.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'storage/heap/ha_heap.cc')
-rw-r--r--storage/heap/ha_heap.cc32
1 files changed, 8 insertions, 24 deletions
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 5f7f0c1e..404ad22a 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -440,31 +440,22 @@ int ha_heap::external_lock(THD *thd, int lock_type)
SYNOPSIS
disable_indexes()
- mode mode of operation:
- HA_KEY_SWITCH_NONUNIQ disable all non-unique keys
- HA_KEY_SWITCH_ALL disable all keys
- HA_KEY_SWITCH_NONUNIQ_SAVE dis. non-uni. and make persistent
- HA_KEY_SWITCH_ALL_SAVE dis. all keys and make persistent
DESCRIPTION
- Disable indexes and clear keys to use for scanning.
-
- IMPLEMENTATION
- HA_KEY_SWITCH_NONUNIQ is not implemented.
- HA_KEY_SWITCH_NONUNIQ_SAVE is not implemented with HEAP.
- HA_KEY_SWITCH_ALL_SAVE is not implemented with HEAP.
+ See handler::ha_disable_indexes()
RETURN
0 ok
HA_ERR_WRONG_COMMAND mode not implemented.
*/
-int ha_heap::disable_indexes(uint mode)
+int ha_heap::disable_indexes(key_map map, bool persist)
{
int error;
- if (mode == HA_KEY_SWITCH_ALL)
+ if (!persist)
{
+ DBUG_ASSERT(map.is_clear_all());
if (!(error= heap_disable_indexes(file)))
set_keys_for_scanning();
}
@@ -482,11 +473,6 @@ int ha_heap::disable_indexes(uint mode)
SYNOPSIS
enable_indexes()
- mode mode of operation:
- HA_KEY_SWITCH_NONUNIQ enable all non-unique keys
- HA_KEY_SWITCH_ALL enable all keys
- HA_KEY_SWITCH_NONUNIQ_SAVE en. non-uni. and make persistent
- HA_KEY_SWITCH_ALL_SAVE en. all keys and make persistent
DESCRIPTION
Enable indexes and set keys to use for scanning.
@@ -495,10 +481,7 @@ int ha_heap::disable_indexes(uint mode)
since the heap storage engine cannot repair the indexes.
To be sure, call handler::delete_all_rows() before.
- IMPLEMENTATION
- HA_KEY_SWITCH_NONUNIQ is not implemented.
- HA_KEY_SWITCH_NONUNIQ_SAVE is not implemented with HEAP.
- HA_KEY_SWITCH_ALL_SAVE is not implemented with HEAP.
+ See also handler::ha_enable_indexes()
RETURN
0 ok
@@ -506,12 +489,13 @@ int ha_heap::disable_indexes(uint mode)
HA_ERR_WRONG_COMMAND mode not implemented.
*/
-int ha_heap::enable_indexes(uint mode)
+int ha_heap::enable_indexes(key_map map, bool persist)
{
int error;
- if (mode == HA_KEY_SWITCH_ALL)
+ if (!persist)
{
+ DBUG_ASSERT(map.is_prefix(table->s->keys));
if (!(error= heap_enable_indexes(file)))
set_keys_for_scanning();
}