summaryrefslogtreecommitdiff
path: root/sql/ha_heap.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-01-16 00:42:52 +0200
committerunknown <monty@hundin.mysql.fi>2002-01-16 00:42:52 +0200
commitf015cbdc7e3427cf0f77012c4ce89f3cf8d5dd5f (patch)
tree890cb295feeab3ebd6413663178be56ec5ed21a2 /sql/ha_heap.cc
parent71a5af5b52642cbe64960275f1994f5a57832ff3 (diff)
downloadmariadb-git-f015cbdc7e3427cf0f77012c4ce89f3cf8d5dd5f.tar.gz
Add support for NULL=NULL in keys (Used in GROUP BY optimization)
Add ISAM to Windows version Fix of test results Fixes for NULL keys in HEAP tables. Docs/manual.texi: Changelog heap/hp_open.c: Add support for NULL=NULL in keys (for GROUP BY) heap/hp_rkey.c: Cleanup heap/hp_write.c: Cleanup include/config-win.h: Add ISAM to Windows version include/my_base.h: Add support for NULL=NULL in keys (for GROUP BY) libmysqld/Makefile.am: Rename of innobase to innodb myisam/mi_write.c: Add support for NULL=NULL in keys (for GROUP BY) BitKeeper/etc/ignore: Added libmysqld/ha_innodb.cc to the ignore list mysql-test/r/group_by.result: Test of NULL keys in HEAP tables mysql-test/r/heap.result: Test of NULL keys in HEAP tables mysql-test/r/null.result: Cleanup mysql-test/r/order_by.result: Fix for result of new ORDER BY optimization mysql-test/t/group_by.test: Test of NULL keys in HEAP tables mysql-test/t/heap.test: Test of NULL keys in HEAP tables mysql-test/t/null.test: Cleanup sql/ha_heap.cc: Add support of NULL keys sql/item_strfunc.h: Fix for BINARY and CAST functions sql/item_timefunc.h: Fix for BINARY and CAST functions sql/sql_parse.cc: Cleanup sql/sql_select.cc: Add support for NULL=NULL in keys (for GROUP BY)
Diffstat (limited to 'sql/ha_heap.cc')
-rw-r--r--sql/ha_heap.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc
index 518a9c38d82..5f482bca1e8 100644
--- a/sql/ha_heap.cc
+++ b/sql/ha_heap.cc
@@ -33,7 +33,7 @@ const char **ha_heap::bas_ext() const
int ha_heap::open(const char *name, int mode, uint test_if_locked)
{
- uint key,part,parts,mem_per_row=0;
+ uint key,parts,mem_per_row=0;
ulong max_rows;
HP_KEYDEF *keydef;
HP_KEYSEG *seg;
@@ -48,24 +48,27 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked)
for (key=0 ; key < table->keys ; key++)
{
KEY *pos=table->key_info+key;
+ KEY_PART_INFO *key_part= pos->key_part;
+ KEY_PART_INFO *key_part_end= key_part+pos->key_parts;
+
mem_per_row += (pos->key_length + (sizeof(char*) * 2));
keydef[key].keysegs=(uint) pos->key_parts;
- keydef[key].flag = (pos->flags & HA_NOSAME);
+ keydef[key].flag = (pos->flags & (HA_NOSAME | HA_NULL_ARE_EQUAL));
keydef[key].seg=seg;
- for (part=0 ; part < pos->key_parts ; part++)
+ for (; key_part != key_part_end ; key_part++, seg++)
{
- uint flag=pos->key_part[part].key_type;
- Field *field=pos->key_part[part].field;
+ uint flag=key_part->key_type;
+ Field *field=key_part->field;
if (!f_is_packed(flag) &&
f_packtype(flag) == (int) FIELD_TYPE_DECIMAL &&
!(flag & FIELDFLAG_BINARY))
seg->type= (int) HA_KEYTYPE_TEXT;
else
seg->type= (int) HA_KEYTYPE_BINARY;
- seg->start=(uint) pos->key_part[part].offset;
- seg->length=(uint) pos->key_part[part].length;
+ seg->start=(uint) key_part->offset;
+ seg->length=(uint) key_part->length;
if (field->null_ptr)
{
seg->null_bit=field->null_bit;
@@ -88,7 +91,8 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked)
table->max_rows : max_rows),
table->min_rows);
my_free((gptr) keydef,MYF(0));
- info(HA_STATUS_NO_LOCK | HA_STATUS_CONST | HA_STATUS_VARIABLE);
+ if (file)
+ info(HA_STATUS_NO_LOCK | HA_STATUS_CONST | HA_STATUS_VARIABLE);
ref_length=sizeof(HEAP_PTR);
return (!file ? errno : 0);
}