Commit a1e444e1 authored by Igor Babaev's avatar Igor Babaev

Corrected the function compare_order_elements() to make it

platform independent.
parent d7b45e01
...@@ -9458,10 +9458,10 @@ EXPLAIN ...@@ -9458,10 +9458,10 @@ EXPLAIN
"window_functions_computation": { "window_functions_computation": {
"sorts": { "sorts": {
"filesort": { "filesort": {
"sort_key": "t2.c" "sort_key": "t2.a, t2.c"
}, },
"filesort": { "filesort": {
"sort_key": "t2.a, t2.c" "sort_key": "t2.c"
} }
}, },
"temporary_table": { "temporary_table": {
......
...@@ -405,7 +405,8 @@ int compare_order_elements(ORDER *ord1, ORDER *ord2) ...@@ -405,7 +405,8 @@ int compare_order_elements(ORDER *ord1, ORDER *ord2)
Item *item2= (*ord2->item)->real_item(); Item *item2= (*ord2->item)->real_item();
DBUG_ASSERT(item1->type() == Item::FIELD_ITEM && DBUG_ASSERT(item1->type() == Item::FIELD_ITEM &&
item2->type() == Item::FIELD_ITEM); item2->type() == Item::FIELD_ITEM);
int cmp= ((Item_field *) item1)->field - ((Item_field *) item2)->field; int cmp= ((Item_field *) item1)->field->field_index -
((Item_field *) item2)->field->field_index;
if (cmp == 0) if (cmp == 0)
{ {
if (ord1->direction == ord2->direction) if (ord1->direction == ord2->direction)
......
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