summaryrefslogtreecommitdiff
path: root/heap
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2004-03-18 16:47:16 +0100
committerunknown <ingo@mysql.com>2004-03-18 16:47:16 +0100
commit5b540f0555f556009fd64e4bb48147435785cc25 (patch)
tree2c2200028f63cb26455388c2d9a6aed239fa05f2 /heap
parentbffc3339c5dd71fa810ef44c78d3577a7908c6f2 (diff)
downloadmariadb-git-5b540f0555f556009fd64e4bb48147435785cc25.tar.gz
WL#1648 - Start/Stop Inserting Duplicates Into a Table
Diffstat (limited to 'heap')
-rw-r--r--heap/hp_extra.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/heap/hp_extra.c b/heap/hp_extra.c
index 46e3f529f34..dd41d6c5f19 100644
--- a/heap/hp_extra.c
+++ b/heap/hp_extra.c
@@ -21,6 +21,10 @@
#include "heapdef.h"
+static void heap_extra_keyflag(register HP_INFO *info,
+ enum ha_extra_function function);
+
+
/* set extra flags for database */
int heap_extra(register HP_INFO *info, enum ha_extra_function function)
@@ -41,8 +45,37 @@ int heap_extra(register HP_INFO *info, enum ha_extra_function function)
case HA_EXTRA_READCHECK:
info->opt_flag|= READ_CHECK_USED;
break;
+ case HA_EXTRA_CHANGE_KEY_TO_UNIQUE:
+ case HA_EXTRA_CHANGE_KEY_TO_DUP:
+ heap_extra_keyflag(info, function);
+ break;
default:
break;
}
DBUG_RETURN(0);
} /* heap_extra */
+
+
+/*
+ Start/Stop Inserting Duplicates Into a Table, WL#1648.
+ */
+static void heap_extra_keyflag(register HP_INFO *info,
+ enum ha_extra_function function)
+{
+ uint idx;
+
+ for (idx= 0; idx< info->s->keys; idx++)
+ {
+ switch (function) {
+ case HA_EXTRA_CHANGE_KEY_TO_UNIQUE:
+ info->s->keydef[idx].flag|= HA_NOSAME;
+ break;
+ case HA_EXTRA_CHANGE_KEY_TO_DUP:
+ info->s->keydef[idx].flag&= ~(HA_NOSAME);
+ break;
+ default:
+ break;
+ }
+ }
+}
+