diff options
author | unknown <mikael/pappa@dator5.(none)> | 2006-08-02 06:40:25 -0400 |
---|---|---|
committer | unknown <mikael/pappa@dator5.(none)> | 2006-08-02 06:40:25 -0400 |
commit | bcd98d512db7957896e44059e1f291c04aca3550 (patch) | |
tree | 0e9eb8d073575cd3767c2f5f7451ad0d62bad9fa /sql/partition_info.h | |
parent | 04a70beb674878d850571102706476c54a258fd5 (diff) | |
download | mariadb-git-bcd98d512db7957896e44059e1f291c04aca3550.tar.gz |
BUG#18198: Fixes to handle VARCHAR strings properly
New methods to handle VARCHAR strings and CHAR's which are not
using a binary collation.
Indentation fixes
Now strings are run through strnxfrm before they are processed
by the partition function
We do not allow collations where strnxfrm expands the string since
we want the resulting string to fit in the same value range as
the original.
mysql-test/r/partition_range.result:
New test cases
mysql-test/t/partition_range.test:
New test cases
sql/partition_info.h:
New methods to handle VARCHAR strings and CHAR's which are not
using a binary collation.
sql/sql_partition.cc:
New methods to handle VARCHAR strings and CHAR's which are not
using a binary collation.
Indentation fixes
Now strings are run through strnxfrm before they are processed
by the partition function
We do not allow collations where strnxfrm expands the string since
we want the resulting string to fit in the same value range as
the original.
Diffstat (limited to 'sql/partition_info.h')
-rw-r--r-- | sql/partition_info.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/sql/partition_info.h b/sql/partition_info.h index 8cc989c0991..91beaf569e0 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -60,7 +60,17 @@ public: same in all subpartitions */ get_subpart_id_func get_subpartition_id; - + + /* + When we have various string fields we might need some preparation + before and clean-up after calling the get_part_id_func's. We need + one such method for get_partition_id and one for + get_part_partition_id and one for get_subpartition_id. + */ + get_part_id_func get_partition_id_charset; + get_part_id_func get_part_partition_id_charset; + get_subpart_id_func get_subpartition_id_charset; + /* NULL-terminated array of fields used in partitioned expression */ Field **part_field_array; /* NULL-terminated array of fields used in subpartitioned expression */ @@ -72,6 +82,16 @@ public: */ Field **full_part_field_array; + /* + When we have a field that requires transformation before calling the + partition functions we must allocate field buffers for the field of + the fields in the partition function. + */ + char **part_field_buffers; + char **subpart_field_buffers; + char **restore_part_field_ptrs; + char **restore_subpart_field_ptrs; + Item *part_expr; Item *subpart_expr; @@ -188,6 +208,8 @@ public: bool is_auto_partitioned; bool from_openfrm; bool has_null_value; + bool includes_charset_field_part; + bool includes_charset_field_subpart; partition_info() @@ -195,6 +217,8 @@ public: get_subpartition_id(NULL), part_field_array(NULL), subpart_field_array(NULL), full_part_field_array(NULL), + part_field_buffers(NULL), subpart_field_buffers(NULL), + restore_part_field_ptrs(NULL), restore_subpart_field_ptrs(NULL), part_expr(NULL), subpart_expr(NULL), item_free_list(NULL), first_log_entry(NULL), exec_log_entry(NULL), frm_log_entry(NULL), list_array(NULL), @@ -217,7 +241,8 @@ public: list_of_part_fields(FALSE), list_of_subpart_fields(FALSE), linear_hash_ind(FALSE), fixed(FALSE), is_auto_partitioned(FALSE), from_openfrm(FALSE), - has_null_value(FALSE) + has_null_value(FALSE), includes_charset_field_part(FALSE), + includes_charset_field_subpart(FALSE) { all_fields_in_PF.clear_all(); all_fields_in_PPF.clear_all(); |