summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <mikael/pappa@dator5.(none)>2006-09-30 17:38:15 -0400
committerunknown <mikael/pappa@dator5.(none)>2006-09-30 17:38:15 -0400
commit417c38db9cf5d94409cbc50f4e2b87345a915e58 (patch)
tree1cb1ca34559e834f40b5625962fae0569aa7a1f5 /sql
parentdc9613ca36c5cf45d43b806eccf1e7368ad076b1 (diff)
downloadmariadb-git-417c38db9cf5d94409cbc50f4e2b87345a915e58.tar.gz
BUG#18198: Partition function handling
Review fixes mysql-test/r/partition_range.result: New test cases mysql-test/t/partition_hash.test: New test cases mysql-test/t/partition_range.test: New test cases sql/item.h: Review fixes sql/partition_info.cc: Review fixes sql/sql_partition.cc: Review fixes
Diffstat (limited to 'sql')
-rw-r--r--sql/item.h14
-rw-r--r--sql/partition_info.cc9
-rw-r--r--sql/sql_partition.cc13
3 files changed, 27 insertions, 9 deletions
diff --git a/sql/item.h b/sql/item.h
index 1f5324f33be..8799fa07eb7 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -831,12 +831,20 @@ public:
Check if a partition function is allowed
SYNOPSIS
check_partition_func_processor()
- int_arg Return argument
+ int_arg Ignored
RETURN VALUE
- 0
+ TRUE Partition function not accepted
+ FALSE Partition function accepted
+
DESCRIPTION
check_partition_func_processor is used to check if a partition function
- uses an allowed function. The default is that an item is not allowed
+ uses an allowed function. An allowed function will always ensure that
+ X=Y guarantees that also part_function(X)=part_function(Y) where X is
+ a set of partition fields and so is Y. The problems comes mainly from
+ character sets where two equal strings can be quite unequal. E.g. the
+ german character for double s is equal to 2 s.
+
+ The default is that an item is not allowed
in a partition function. However all mathematical functions, string
manipulation functions, date functions are allowed. Allowed functions
can never depend on server version, they cannot depend on anything
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 724464125ea..1f84d3f1e83 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -838,11 +838,12 @@ end:
/*
Print error for no partition found
+
SYNOPSIS
print_no_partition_found()
table Table object
+
RETURN VALUES
- NONE
*/
void partition_info::print_no_partition_found(TABLE *table)
@@ -863,10 +864,11 @@ void partition_info::print_no_partition_found(TABLE *table)
Set up buffers and arrays for fields requiring preparation
SYNOPSIS
set_up_charset_field_preps()
- part_info Partition info object
+
RETURN VALUES
TRUE Memory Allocation error
FALSE Success
+
DESCRIPTION
Set up arrays and buffers for fields that require special care for
calculation of partition id. This is used for string fields with
@@ -1025,5 +1027,4 @@ error:
mem_alloc_error(size);
DBUG_RETURN(TRUE);
}
-#endif
- /* WITH_PARTITION_STORAGE_ENGINE */
+#endif /* WITH_PARTITION_STORAGE_ENGINE */
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 796f018e04b..cedd3f6b265 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -1437,9 +1437,11 @@ static uint32 get_part_id_from_linear_hash(longlong hash_value, uint mask,
/*
Check if a particular field is in need of character set
handling for partition functions.
+
SYNOPSIS
field_is_partition_charset()
field The field to check
+
RETURN VALUES
FALSE Not in need of character set handling
TRUE In need of character set handling
@@ -1461,8 +1463,9 @@ bool field_is_partition_charset(Field *field)
/*
- Check that partition function do not contain any forbidden
+ Check that partition function doesn't contain any forbidden
character sets and collations.
+
SYNOPSIS
check_part_func_fields()
ptr Array of Field pointers
@@ -1471,6 +1474,7 @@ bool field_is_partition_charset(Field *field)
RETURN VALUES
FALSE Success
TRUE Error
+
DESCRIPTION
We will check in this routine that the fields of the partition functions
do not contain unallowed parts. It can also be used to check if there
@@ -2390,9 +2394,13 @@ static uint32 get_part_id_linear_key(partition_info *part_info,
/*
Copy to field buffers and set up field pointers
+
SYNOPSIS
copy_to_part_field_buffers()
ptr Array of fields to copy
+ field_bufs Array of field buffers to copy to
+ restore_ptr Array of pointers to restore to
+
RETURN VALUES
NONE
DESCRIPTION
@@ -2451,8 +2459,9 @@ static void copy_to_part_field_buffers(Field **ptr,
SYNOPSIS
restore_part_field_pointers()
ptr Array of fields to restore
+ restore_ptr Array of field pointers to restore to
+
RETURN VALUES
- NONE
*/
static void restore_part_field_pointers(Field **ptr, char **restore_ptr)