diff options
author | unknown <monty@mysql.com> | 2005-10-14 00:04:52 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-10-14 00:04:52 +0300 |
commit | 55a21a3379d337f6eb605cc28baff206aa73bb80 (patch) | |
tree | 7187bdc049ca6658481e5d41b54214c1a5998a6f /sql/sql_class.h | |
parent | d0532c5ce64c2eeda4a498d345d6b809193391bf (diff) | |
download | mariadb-git-55a21a3379d337f6eb605cc28baff206aa73bb80.tar.gz |
Move handling of suffix_length from strnxfrm_bin() to filesort to ensure proper sorting of all kind of binary objects
field::sort_key() now adds length last for varbinary/blob
VARBINARY/BLOB is now sorted by filesort so that shorter strings comes before longer ones
Fixed issues in test cases from last merge
mysql-test/r/select.result:
Change column name in test to get GROUP BY to use the alias
mysql-test/r/type_blob.result:
Test BLOB and VARCHAR sorting
mysql-test/t/select.test:
Change column name in test to get GROUP BY to use the alias
Drop used tables at start of test
Don't use table names 'a', 'b' or 'c'
mysql-test/t/type_blob.test:
Test BLOB and VARCHAR sorting
sql/field.cc:
Store length last in VARBINARY() and BLOB() columns to get shorter strings sorted before longer onces
sql/field.h:
Added method 'sort_length()' to allow one to have length bytes last for VARBINARY/BLOB to get these to sort properly
sql/filesort.cc:
Use 'sort_length()' instead of 'pack_length()' to get length of field.
Store suffix_length last for varbinary (blob) objects.
The above ensures that BLOB/VARBINARY are correctly sorted (shorter strings before longer ones)
sql/sql_class.h:
Added sort suffix length (to get varbinary/blob to sort correctly)
sql/sql_select.cc:
Use sort_length() instead of pack_lengths()
strings/ctype-bin.c:
Don't let strnxfrm_bin store length last
Better to do it in MySQL field object to ensure it's done properly for all cases
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index 48a2837eb04..02afbcfe304 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1899,6 +1899,7 @@ typedef struct st_sort_field { Field *field; /* Field to sort */ Item *item; /* Item if not sorting fields */ uint length; /* Length of sort field */ + uint suffix_length; /* Length suffix (0-4) */ Item_result result_type; /* Type of item */ bool reverse; /* if descending sort */ bool need_strxnfrm; /* If we have to use strxnfrm() */ |