summaryrefslogtreecommitdiff
path: root/heap/hp_create.c
diff options
context:
space:
mode:
authorunknown <ram@mysql.r18.ru>2002-11-19 18:48:22 +0400
committerunknown <ram@mysql.r18.ru>2002-11-19 18:48:22 +0400
commit951669f048155a6366a5cecc9cfe3f03ce77a141 (patch)
tree7f170ba71c343515fd58dba426fb8f49a993abf5 /heap/hp_create.c
parent0fb3b8d9abc3eb2e3072c2f8681099e7db0a256e (diff)
downloadmariadb-git-951669f048155a6366a5cecc9cfe3f03ce77a141.tar.gz
fix for byte ordering bug in HEAP rb-tree
Diffstat (limited to 'heap/hp_create.c')
-rw-r--r--heap/hp_create.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/heap/hp_create.c b/heap/hp_create.c
index 6c38d54cb12..40b8202d94f 100644
--- a/heap/hp_create.c
+++ b/heap/hp_create.c
@@ -55,6 +55,22 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
keyinfo->rb_tree.size_of_element++;
}
+ switch (keyinfo->seg[j].type) {
+ case HA_KEYTYPE_SHORT_INT:
+ case HA_KEYTYPE_LONG_INT:
+ case HA_KEYTYPE_FLOAT:
+ case HA_KEYTYPE_DOUBLE:
+ case HA_KEYTYPE_USHORT_INT:
+ case HA_KEYTYPE_ULONG_INT:
+ case HA_KEYTYPE_LONGLONG:
+ case HA_KEYTYPE_ULONGLONG:
+ case HA_KEYTYPE_INT24:
+ case HA_KEYTYPE_UINT24:
+ case HA_KEYTYPE_INT8:
+ keyinfo->seg[j].flag|= HA_SWAP_KEY;
+ default:
+ break;
+ }
}
keyinfo->length= length;
length+= keyinfo->rb_tree.size_of_element +