diff options
author | Alexey Botchkov <holyfoot@mysql.com> | 2008-10-06 11:05:34 +0500 |
---|---|---|
committer | Alexey Botchkov <holyfoot@mysql.com> | 2008-10-06 11:05:34 +0500 |
commit | 87a77eecacd00402c7313b7484f9b95913c6406f (patch) | |
tree | 17cdbc48450b2577c48346669de0a7ac4b8ee0b3 /sql/opt_range.cc | |
parent | 0d380151e0ec0d484fe3fff6fff4bea8f0af0ca9 (diff) | |
download | mariadb-git-87a77eecacd00402c7313b7484f9b95913c6406f.tar.gz |
Bug#38083 Error-causing row inserted into partitioned table despite error
problems are located in the sql_partition.cc where functions calculation
partition_id don't expect error returned from item->val_int().
Fixed by adding checks to these functions.
Note - it tries to fix more problems than just the reported bug.
per-file comments:
modified:
mysql-test/r/partition.result
Bug#38083 Error-causing row inserted into partitioned table despite error
test result
mysql-test/t/partition.test
Bug#38083 Error-causing row inserted into partitioned table despite error
test case
sql/opt_range.cc
Bug#38083 Error-causing row inserted into partitioned table despite error
get_part_id() call fixed
sql/partition_info.h
Bug#38083 Error-causing row inserted into partitioned table despite error
get_subpart_id_func interface changed.
sql/sql_partition.cc
Bug#38083 Error-causing row inserted into partitioned table despite error
various functions calculationg partition_id and subpart_id didn't expect
an error returned from item->val_int(). Error checks added.
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index d2f098e710c..f228551b586 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3215,10 +3215,12 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree) ppar->subpart_fields);); /* Find the subpartition (it's HASH/KEY so we always have one) */ partition_info *part_info= ppar->part_info; - uint32 subpart_id= part_info->get_subpartition_id(part_info); - + uint32 part_id, subpart_id; + + if (part_info->get_subpartition_id(part_info, &subpart_id)) + return 0; + /* Mark this partition as used in each subpartition. */ - uint32 part_id; while ((part_id= ppar->part_iter.get_next(&ppar->part_iter)) != NOT_A_PARTITION_ID) { |