Commit d5ca940a authored by ram@mysql.r18.ru's avatar ram@mysql.r18.ru

Merge mysql.r18.ru:/usr/home/ram/mysql-4.1.last

into mysql.r18.ru:/usr/home/ram/mysql-4.1
parents 2dae97b1 032a4a92
...@@ -52,6 +52,7 @@ paul@teton.kitebird.com ...@@ -52,6 +52,7 @@ paul@teton.kitebird.com
peter@linux.local peter@linux.local
peter@mysql.com peter@mysql.com
ram@gw.udmsearch.izhnet.ru ram@gw.udmsearch.izhnet.ru
ram@mysql.r18.ru
ram@ram.(none) ram@ram.(none)
root@x3.internalnet root@x3.internalnet
salle@geopard.(none) salle@geopard.(none)
......
...@@ -85,15 +85,24 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, ...@@ -85,15 +85,24 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
memcpy(share->keydef, keydef, (size_t) (sizeof(keydef[0]) * keys)); memcpy(share->keydef, keydef, (size_t) (sizeof(keydef[0]) * keys));
for (i= 0, keyinfo= share->keydef; i < keys; i++, keyinfo++) for (i= 0, keyinfo= share->keydef; i < keys; i++, keyinfo++)
{ {
uint nsegs= keydef[i].keysegs; keyinfo->seg= keyseg;
memcpy(keyseg, keydef[i].seg,
(size_t) (sizeof(keyseg[0]) * keydef[i].keysegs));
keyseg+= keydef[i].keysegs;
if (keydef[i].algorithm == HA_KEY_ALG_BTREE) if (keydef[i].algorithm == HA_KEY_ALG_BTREE)
{ {
/* additional HA_KEYTYPE_END keyseg */
keyseg->type= HA_KEYTYPE_END;
keyseg->length= sizeof(byte*);
keyseg->flag= 0;
keyseg->null_bit= 0;
keyseg++;
init_tree(&keyinfo->rb_tree, 0, 0, sizeof(byte*), init_tree(&keyinfo->rb_tree, 0, 0, sizeof(byte*),
(qsort_cmp2)keys_compare, 1, NULL, NULL); (qsort_cmp2)keys_compare, 1, NULL, NULL);
keyinfo->delete_key= hp_rb_delete_key; keyinfo->delete_key= hp_rb_delete_key;
keyinfo->write_key= hp_rb_write_key; keyinfo->write_key= hp_rb_write_key;
nsegs++;
} }
else else
{ {
...@@ -102,12 +111,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, ...@@ -102,12 +111,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
keyinfo->delete_key= hp_delete_key; keyinfo->delete_key= hp_delete_key;
keyinfo->write_key= hp_write_key; keyinfo->write_key= hp_write_key;
} }
keyinfo->seg= keyseg;
memcpy(keyseg, keydef[i].seg,
(size_t) (sizeof(keyseg[0]) * nsegs));
keyseg+= nsegs;
} }
share->min_records= min_records; share->min_records= min_records;
share->max_records= max_records; share->max_records= max_records;
share->data_length= share->index_length= 0; share->data_length= share->index_length= 0;
......
...@@ -246,11 +246,7 @@ int ha_heap::create(const char *name, TABLE *table, ...@@ -246,11 +246,7 @@ int ha_heap::create(const char *name, TABLE *table,
int error; int error;
for (key= parts= 0; key < table->keys; key++) for (key= parts= 0; key < table->keys; key++)
{
parts+= table->key_info[key].key_parts; parts+= table->key_info[key].key_parts;
if (table->key_info[key].algorithm == HA_KEY_ALG_BTREE)
parts++; /* additional HA_KEYTYPE_END keyseg */
}
if (!(keydef= (HP_KEYDEF*) my_malloc(table->keys * sizeof(HP_KEYDEF) + if (!(keydef= (HP_KEYDEF*) my_malloc(table->keys * sizeof(HP_KEYDEF) +
parts * sizeof(HA_KEYSEG), parts * sizeof(HA_KEYSEG),
...@@ -301,15 +297,6 @@ int ha_heap::create(const char *name, TABLE *table, ...@@ -301,15 +297,6 @@ int ha_heap::create(const char *name, TABLE *table,
seg->null_pos= 0; seg->null_pos= 0;
} }
} }
if (pos->algorithm == HA_KEY_ALG_BTREE)
{
/* additional HA_KEYTYPE_END keyseg */
seg->type= HA_KEYTYPE_END;
seg->length= sizeof(byte*);
seg->flag= 0;
seg->null_bit= 0;
seg++;
}
} }
mem_per_row+= MY_ALIGN(table->reclength + 1, sizeof(char*)); mem_per_row+= MY_ALIGN(table->reclength + 1, sizeof(char*));
max_rows = (ulong) (current_thd->variables.max_heap_table_size / max_rows = (ulong) (current_thd->variables.max_heap_table_size /
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment