mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into mysql.com:/home/psergey/mysql-5.0-bdb-fix
This commit is contained in:
@ -136,8 +136,8 @@ update ignore t1 set id=1023 where id=1010;
|
|||||||
select * from t1 where parent_id=102 order by parent_id,id;
|
select * from t1 where parent_id=102 order by parent_id,id;
|
||||||
id parent_id level
|
id parent_id level
|
||||||
1008 102 2
|
1008 102 2
|
||||||
1010 102 2
|
|
||||||
1015 102 2
|
1015 102 2
|
||||||
|
1010 102 2
|
||||||
explain select level from t1 where level=1;
|
explain select level from t1 where level=1;
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref level level 1 const X Using index
|
1 SIMPLE t1 ref level level 1 const X Using index
|
||||||
|
@ -2646,7 +2646,11 @@ ha_rows ha_berkeley::estimate_rows_upper_bound()
|
|||||||
int ha_berkeley::cmp_ref(const byte *ref1, const byte *ref2)
|
int ha_berkeley::cmp_ref(const byte *ref1, const byte *ref2)
|
||||||
{
|
{
|
||||||
if (hidden_primary_key)
|
if (hidden_primary_key)
|
||||||
return memcmp(ref1, ref2, BDB_HIDDEN_PRIMARY_KEY_LENGTH);
|
{
|
||||||
|
ulonglong a=uint5korr((char*) ref1);
|
||||||
|
ulonglong b=uint5korr((char*) ref2);
|
||||||
|
return a < b ? -1 : (a > b ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
int result;
|
int result;
|
||||||
Field *field;
|
Field *field;
|
||||||
|
@ -12033,7 +12033,6 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx,
|
|||||||
*/
|
*/
|
||||||
if (!on_primary_key &&
|
if (!on_primary_key &&
|
||||||
(table->file->table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) &&
|
(table->file->table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) &&
|
||||||
table->s->db_type == DB_TYPE_INNODB &&
|
|
||||||
table->s->primary_key != MAX_KEY)
|
table->s->primary_key != MAX_KEY)
|
||||||
{
|
{
|
||||||
on_primary_key= TRUE;
|
on_primary_key= TRUE;
|
||||||
|
@ -782,8 +782,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
|
|||||||
if (ha_option & HA_PRIMARY_KEY_IN_READ_INDEX)
|
if (ha_option & HA_PRIMARY_KEY_IN_READ_INDEX)
|
||||||
{
|
{
|
||||||
field->part_of_key= share->keys_in_use;
|
field->part_of_key= share->keys_in_use;
|
||||||
if (share->db_type == DB_TYPE_INNODB &&
|
if (field->part_of_sortkey.is_set(key))
|
||||||
field->part_of_sortkey.is_set(key))
|
|
||||||
field->part_of_sortkey= share->keys_in_use;
|
field->part_of_sortkey= share->keys_in_use;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user