diff options
author | unknown <evgen@moonbone.local> | 2005-06-21 20:14:50 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2005-06-21 20:14:50 +0400 |
commit | c4257ae3cee0b97e60ba11c5c68a94f4d3472f5a (patch) | |
tree | 6501029548efdd69348739e2cb1394f4ffb960c0 /sql/filesort.cc | |
parent | aece56e30a3f3f6451d36b6a614ae692840bb4c8 (diff) | |
download | mariadb-git-c4257ae3cee0b97e60ba11c5c68a94f4d3472f5a.tar.gz |
Fix bug #7422 "order by" doesn't work
Field with wrong buffer was used to make sort key, which results in producing
same sort key for all records.
sql/filesort.cc:
Fix bug#7422 "order by" doesn't work
mysql-test/t/view.test:
Test case for bug#7422 "order by" doesn't work
mysql-test/r/view.result:
Test case for bug#7422 "order by" doesn't work
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r-- | sql/filesort.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc index 30ebd8d59e1..75da43afed5 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -631,7 +631,7 @@ static void make_sortkey(register SORTPARAM *param, *to++=1; /* All item->str() to use some extra byte for end null.. */ String tmp((char*) to,sort_field->length+4,cs); - String *res=item->val_str(&tmp); + String *res= item->str_result(&tmp); if (!res) { if (maybe_null) @@ -673,8 +673,8 @@ static void make_sortkey(register SORTPARAM *param, } case INT_RESULT: { - longlong value=item->val_int(); - if (maybe_null) + longlong value= item->val_int_result(); + if (maybe_null) { *to++=1; /* purecov: inspected */ if (item->null_value) @@ -715,7 +715,7 @@ static void make_sortkey(register SORTPARAM *param, } case DECIMAL_RESULT: { - my_decimal dec_buf, *dec_val= item->val_decimal(&dec_buf); + my_decimal dec_buf, *dec_val= item->val_decimal_result(&dec_buf); if (maybe_null) { if (item->null_value) @@ -733,7 +733,7 @@ static void make_sortkey(register SORTPARAM *param, } case REAL_RESULT: { - double value= item->val_real(); + double value= item->val_result(); if (maybe_null) { if (item->null_value) |