1
0
mirror of https://github.com/MariaDB/server.git synced 2025-05-07 04:01:59 +03:00
unknown c33c92d0f2 Bug #31890 Partitions: ORDER BY DESC in InnoDB not working.
It's not InnoDB specific bug.
Error is in QUEUE code, about the way we handle queue->max_at_top.
It's either '0' or '-2' and we do '^' operation to get the proper
direction. Though queue->compare() function can return '-2' as
a result of comparison sometimes. So we'll get
queue->compare() ^ queue->max_at_top == 0 (when max_at_top is -2)
and _downheap() function code will go wrong way here:
...
    if (next_index < elements &&
        (queue->compare(queue->first_cmp_arg,
                        queue->root[next_index]+offset_to_key,
                        queue->root[next_index+1]+offset_to_key) ^
         queue->max_at_top) > 0)
      next_index++;
...

Fixed by changing max_at_top to be either 1 or -1, doing
'* max_at_top' to get proper direction.


include/queues.h:
  Bug #31890 Partitions: ORDER BY DESC in InnoDB not working
  
  max_at_top policy changed
mysql-test/r/partition.result:
  Bug #31890 Partitions: ORDER BY DESC in InnoDB not working
  
  test result
mysql-test/t/partition.test:
  Bug #31890 Partitions: ORDER BY DESC in InnoDB not working
  
  test case
mysys/queues.c:
  Bug #31890 Partitions: ORDER BY DESC in InnoDB not working.
  
  queue->max_at_top policy changed - now it can either be '1' or '-1'.
  We multiply comparison result on max_at_top to get the proper
  direction.
2007-11-14 22:20:31 +04:00
..
2007-07-30 21:05:56 +05:00
2007-10-18 14:48:04 -07:00
2007-08-07 05:35:20 -04:00
2007-07-05 19:20:14 +02:00
2007-08-02 12:45:56 -07:00
2007-07-23 23:35:43 -07:00
2007-06-28 16:03:01 -07:00
2007-06-28 16:03:01 -07:00
2007-07-06 11:35:10 -07:00
2007-09-26 12:45:08 +02:00
2007-07-11 18:45:35 -07:00
2007-06-20 14:21:48 +05:00
2007-11-02 13:40:34 +03:00
2007-08-31 16:59:07 +05:00
2007-08-31 16:59:07 +05:00
2007-06-13 17:28:59 +02:00
2007-06-13 17:28:59 +02:00
2007-11-13 09:41:59 +04:00
2007-06-13 17:28:59 +02:00
2007-10-23 19:28:47 +05:00
2007-09-24 12:42:44 +02:00
2007-06-06 18:55:21 +05:00
2007-07-14 01:34:46 +05:00
2007-07-15 21:51:36 +04:00