1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

fix for the bug #2419: order by ignores rows.

null_ref_key moved to TABLE_REF.
new null range created if necessary.


mysql-test/r/order_by.result:
  fix for the bug #2419: order by ignores rows
mysql-test/t/order_by.test:
  fix for the bug #2419: order by ignores rows
sql/item_subselect.cc:
  fix for the bug #2419: order by ignores rows
sql/opt_range.cc:
  fix for the bug #2419: order by ignores rows
sql/sql_select.cc:
  fix for the bug #2419: order by ignores rows
sql/sql_select.h:
  fix for the bug #2419: order by ignores rows
This commit is contained in:
unknown
2004-01-31 10:04:16 +04:00
parent 150c99dffe
commit abc17f8f3c
6 changed files with 65 additions and 12 deletions

View File

@ -2513,8 +2513,25 @@ QUICK_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, TABLE_REF *ref)
key_part->part_length+=HA_KEY_BLOB_LENGTH;
key_part->null_bit= key_info->key_part[part].null_bit;
}
if (!quick->ranges.push_back(range))
return quick;
if (quick->ranges.push_back(range))
goto err;
if (ref->null_ref_key)
{
QUICK_RANGE *null_range;
*ref->null_ref_key= 1; // Set null byte then create a range
if (!(null_range= new QUICK_RANGE(ref->key_buff, ref->key_length,
ref->key_buff, ref->key_length,
EQ_RANGE)))
goto err;
*ref->null_ref_key= 0; // Clear null byte
/* Do we need to do something with key_parts here? Looks like we don't */
if (quick->ranges.push_back(null_range))
goto err;
}
return quick;
err:
delete quick;