mirror of
https://github.com/MariaDB/server.git
synced 2026-05-01 12:45:41 +02:00
Fix for BUG#7425.
The reported problems were due to two completely unrelated omissions. 1) The file sort procedure didn't correctly create the sort key in make_sortkey when the sortkey was an unsigned integer. 2) The name resolution procedure for column references inside a HAVING clause did not propagate the unsigned_flag of the resolved references. This patch corrects both problems. mysql-test/r/select.result: Added test result for BUG#7425. mysql-test/t/select.test: Added test for BUG#7425. sql/filesort.cc: Take into account whether 'item' represents a signed or an unsigned integer. sql/item.cc: Once an Item_ref is resolved, propagate the unsigned_flag to the resolved item.
This commit is contained in:
parent
ae81d53048
commit
146df30f79
4 changed files with 43 additions and 2 deletions
|
|
@ -656,12 +656,18 @@ static void make_sortkey(register SORTPARAM *param,
|
|||
to[3]= (uchar) (value >> 32);
|
||||
to[2]= (uchar) (value >> 40);
|
||||
to[1]= (uchar) (value >> 48);
|
||||
to[0]= (uchar) (value >> 56) ^ 128; // Fix sign
|
||||
if (item->unsigned_flag) /* Fix sign */
|
||||
to[0]= (uchar) (value >> 56);
|
||||
else
|
||||
to[0]= (uchar) (value >> 56) ^ 128; /* Reverse signbit */
|
||||
#else
|
||||
to[3]= (uchar) value;
|
||||
to[2]= (uchar) (value >> 8);
|
||||
to[1]= (uchar) (value >> 16);
|
||||
to[0]= (uchar) (value >> 24) ^ 128; // Fix sign
|
||||
if (item->unsigned_flag) /* Fix sign */
|
||||
to[0]= (uchar) (value >> 24);
|
||||
else
|
||||
to[0]= (uchar) (value >> 24) ^ 128; /* Reverse signbit */
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue