Skip to content

Commit

Permalink
Corrected the function compare_order_elements() to make it
Browse files Browse the repository at this point in the history
platform independent.
  • Loading branch information
igorbabaev committed Aug 20, 2017
1 parent d7b45e0 commit a1e444e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mysql-test/r/derived_cond_pushdown.result
Original file line number Diff line number Diff line change
Expand Up @@ -9458,10 +9458,10 @@ EXPLAIN
"window_functions_computation": {
"sorts": {
"filesort": {
"sort_key": "t2.c"
"sort_key": "t2.a, t2.c"
},
"filesort": {
"sort_key": "t2.a, t2.c"
"sort_key": "t2.c"
}
},
"temporary_table": {
Expand Down
3 changes: 2 additions & 1 deletion sql/sql_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ int compare_order_elements(ORDER *ord1, ORDER *ord2)
Item *item2= (*ord2->item)->real_item();
DBUG_ASSERT(item1->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 (ord1->direction == ord2->direction)
Expand Down

0 comments on commit a1e444e

Please sign in to comment.