of the 5.3 code line after a merge with 5.2 on 2010-10-28
in order not to allow the cost to access a joined table to be equal
to 0 ever.
Expanded data sets for many test cases to get the same execution plans
as before.
- Fixed problem with oqgraph and 'make dist'
Note that after this merge we have a problem show in join_outer where we examine too many rows in one specific case (related to BUG#57024).
This will be fixed when mwl#128 is merged into 5.3.
Bug#46754: 'rows' field doesn't reflect partition pruning
The EXPLAIN's result in 'rows' field
was evaluated to number of rows when the table was opened
(not from the table cache) and only the partitions left
after pruning was updated with its correct number
of rows.
The evaluation of the 'rows' field was using handler::records()
which is a potentially expensive call, and ignores the partitioning
pruning.
The fix was to use the handlers stats.records after updating it
with ::info(HA_STATUS_VARIABLE) instead.
mysql-test/r/partition_pruning.result:
updated result
mysql-test/t/partition_pruning.test:
Added test.
sql/sql_select.cc:
Use ::info + stats.records instead of ::records().
(regression)
Problem was that partition pruning did not exclude the
last partition if the range was beyond it
(i.e. not using MAXVALUE)
Fix was to not include the last partition if the
partitioning function value was not within the partition
range.
mysql-test/r/partition_innodb.result:
Bug#51830: Incorrect partition pruning on range partition
(regression)
Updated result
mysql-test/r/partition_pruning.result:
Bug#51830: Incorrect partition pruning on range partition
(regression)
Updated result
mysql-test/t/partition_innodb.test:
Bug#51830: Incorrect partition pruning on range partition
(regression)
Added test for pruning in InnoDB, since it does not show
for MyISAM due to 'Impossible WHERE noticed after reading
const tables'.
mysql-test/t/partition_pruning.test:
Bug#51830: Incorrect partition pruning on range partition
(regression)
Added test
sql/sql_partition.cc:
Bug#51830: Incorrect partition pruning on range partition
(regression)
Also increase the partition id if not inside the last partition
(and no MAXVALUE is defined).
Added comments and DBUG_ASSERT.
Problem was when calculating the range of partitions for
pruning.
Solution was to get the calculation correct. I also simplified
it a bit for easier understanding.
mysql-test/r/partition_pruning.result:
Bug#49742: Partition Pruning not working correctly for RANGE
Added results.
mysql-test/t/partition_pruning.test:
Bug#49742: Partition Pruning not working correctly for RANGE
Added tests to prevent regressions.
sql/sql_partition.cc:
Bug#49742: Partition Pruning not working correctly for RANGE
Simplified calculation for partition id for ranges.
Easier to get right and understand.
Added comments.
WL#2474 "Multi Range Read: Change the default MRR implementation to implement new MRR interface"
WL#2475 "Batched range read functions for MyISAM/InnoDb"
"Index condition pushdown for MyISAM/InnoDB"
Igor's fix from sp1r-igor@olga.mysql.com-20080330055902-07614:
There could be observed the following problems:
1. EXPLAIN did not mention pushdown conditions from on expressions in the
'extra' column. As a result if a query had no where conditions pushed
down to a table, but had on conditions pushed to this table the 'extra'
column in the EXPLAIN for the table missed 'using where'.
2. Conditions for ref access were not eliminated from on expressions
though such conditions were eliminated from the where condition.
The problem was in incorrect handling of predicates involving
NULL as a constant value by the range optimizer.
For example, when creating a SEL_ARG node from a condition of
the form "field < const" (which would normally result in the
"NULL < field < const" SEL_ARG), the special case when "const"
is NULL was not taken into account, so "NULL < field < NULL"
was produced for the "field < NULL" condition.
As a result, SEL_ARG structures of this form could not be
further optimized which in turn could lead to incorrectly
constructed SEL_ARG trees. In particular, code assuming SEL_ARG
structures to always form a sequence of ordered disjoint
intervals could enter an infinite loop under some
circumstances.
Fixed by changing get_mm_leaf() so that for any sargable
predicate except "<=>" involving NULL as a constant, "empty"
SEL_ARG is returned, since such a predicate is always false.
mysql-test/r/partition_pruning.result:
Fixed a broken test case.
mysql-test/r/range.result:
Added a test case for bug #47123.
mysql-test/r/subselect.result:
Fixed a broken test cases.
mysql-test/t/range.test:
Added a test case for bug #47123.
sql/opt_range.cc:
Fixed get_mm_leaf() so that for any sargable
predicate except "<=>" involving NULL as a constant, "empty"
SEL_ARG is returned, since such a predicate is always false.
sql/opt_range.cc:
Removed duplicate code (if statement must have been duplicated during earlier merge).
sql/sql_partition.cc:
After mergeing bug#46362 and bug#20577, the NULL partition was also searched
when col = const, fixed by checking if = or range.
Problem was that the partition containing NULL values
was pruned away, since '2001-01-01' < '2001-02-00' but
TO_DAYS('2001-02-00') is NULL.
Added the NULL partition for RANGE/LIST partitioning on TO_DAYS()
function to be scanned too.
Also fixed a bug that added ALLOW_INVALID_DATES to sql_mode
(SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST
partitioned table would add it).
mysql-test/include/partition_date_range.inc:
Bug#20577: Partitions: use of to_days() function leads to selection failures
Added include file to decrease test code duplication
mysql-test/r/partition_pruning.result:
Bug#20577: Partitions: use of to_days() function leads to selection failures
Added test results
mysql-test/r/partition_range.result:
Bug#20577: Partitions: use of to_days() function leads to selection failures
Updated test result.
This fix adds the partition containing NULL values to
the list of partitions to be scanned.
mysql-test/t/partition_pruning.test:
Bug#20577: Partitions: use of to_days() function leads to selection failures
Added test case
sql/item.h:
Bug#20577: Partitions: use of to_days() function leads to selection failures
Added MONOTONIC_*INCREASE_NOT_NULL values to be used by TO_DAYS.
sql/item_timefunc.cc:
Bug#20577: Partitions: use of to_days() function leads to selection failures
Calculate the number of days as return value even for invalid dates.
This is so that pruning can be used even for invalid dates.
sql/opt_range.cc:
Bug#20577: Partitions: use of to_days() function leads to selection failures
Fixed a bug that added ALLOW_INVALID_DATES to sql_mode
(SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST
partitioned table would add it).
sql/partition_info.h:
Bug#20577: Partitions: use of to_days() function leads to selection failures
Resetting ret_null_part when a single partition is to be used, this
to avoid adding the NULL partition.
sql/sql_partition.cc:
Bug#20577: Partitions: use of to_days() function leads to selection failures
Always include the NULL partition if RANGE or LIST.
Use the returned value for the function for pruning, even if
it is marked as NULL, so that even '2000-00-00' can be
used for pruning, even if TO_DAYS('2000-00-00') is NULL.
Changed == to >= in get_next_partition_id_list to avoid
crash if part_iter->part_nums is not correctly setup.
There were a problem since pruning uses the field
for comparison (while evaluate_join_record uses longlong),
resulting in pruning failures when comparing DATE to DATETIME.
Fix was to always comparing DATE vs DATETIME as DATETIME,
by adding ' 00:00:00' to the DATE string.
And adding optimization for comparing with 23:59:59, so that
DATETIME_col > '2001-02-03 23:59:59' ->
TO_DAYS(DATETIME_col) > TO_DAYS('2001-02-03 23:59:59') instead
of '>='.
mysql-test/r/partition_pruning.result:
Bug#46362: Endpoint should be set to false for TO_DAYS(DATE)
Updated result-file
mysql-test/t/partition_pruning.test:
Bug#46362: Endpoint should be set to false for TO_DAYS(DATE)
Added testcases.
sql-common/my_time.c:
Bug#46362: Endpoint should be set to false for TO_DAYS(DATE)
removed duplicate assignment.
sql/item.cc:
Bug#46362: Endpoint should be set to false for TO_DAYS(DATE)
Changed field_is_equal_to_item into field_cmp_to_item, to
better handling DATE vs DATETIME comparision.
sql/item.h:
Bug#46362: Endpoint should be set to false for TO_DAYS(DATE)
Updated comment
sql/item_timefunc.cc:
Bug#46362: Endpoint should be set to false for TO_DAYS(DATE)
Added optimization (pruning) of DATETIME where time-part is
23:59:59
sql/opt_range.cc:
Bug#46362: Endpoint should be set to false for TO_DAYS(DATE)
Using the new stored_field_cmp_to_item for better pruning.
Problem was an errornous date that lead to end partition
was before the start, leading to a crash.
Solution was to check greater or equal instead of only
equal between start and end partition.
NOTE: partitioning pruning handles incorrect dates
differently than index lookup, which can give different
results in a partitioned table versus a non partitioned
table for queries having 'bad' dates in the where clause.
mysql-test/r/partition_pruning.result:
Bug#40972: some sql execution lead the whole databse crashing
Updated result file
mysql-test/t/partition_pruning.test:
Bug#40972: some sql execution lead the whole databse crashing
Added test.
sql/sql_partition.cc:
Bug#40972: some sql execution lead the whole databse crashing
There can be cases where the start/cur partition is greater
than the end partition, so it must not continue, since that
can lead to a crash.
problem was that ha_partition::records was not implemented, thus
using the default handler::records, which is not correct if the engine
does not support HA_STATS_RECORDS_IS_EXACT.
Solution was to implement ha_partition::records as a wrapper around
the underlying partitions records.
The rows column in explain partitions will now include the total
number of records in the partitioned table.
(recommit after removing out-commented code)
- Introduced val_int_endpoint() function which converts between func
argument intervals and func value intervals for monotonic functions.
- Made partition interval analyzer use part_expr->val_int_endpoint()
to check if the edge values should be included.
mysql-test/r/partition_pruning.result:
BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions
- Testcase
mysql-test/t/partition_pruning.test:
BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions
- Testcase
sql/item.cc:
BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions
- Added Item_field::val_int_endpoint() implementation
sql/item.h:
BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions
- Added Item::val_int_endpoint() which converts intervals from argument
space to function value space for unary monotonic functions.
sql/item_timefunc.cc:
BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions
- Added val_int_endpoint() for TO_DAYS and YEAR functions.
sql/item_timefunc.h:
BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions
- Added val_int_endpoint() for TO_DAYS and YEAR functions.
sql/partition_info.h:
BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions
- Removed partition_info::range_analysis_include_bounds as it is no longer
needed.
sql/sql_partition.cc:
BUG#27927: Partition pruning not optimal with TO_DAYS and YEAR functions
- Make partition interval analyzer use part_expr->val_int_endpoint() to
check if the edge values should be included.
In the ha_partition::position() we didn't calculate the number
of the partition of the record. We used m_last_part value instead,
relying on that it is set in other place like previous call of a method
like ::write_row(). In replication we don't call any of these befor
position(). Delete_rows_log_event::do_exec_row calls find_and_fetch_row.
In case of InnoDB-based PARTITION table, we have HA_PRIMARY_KEY_REQUIRED_FOR_POSITION
enabled, so use position() / rnd_pos() calls to fetch the record.
Fixed by adding partition_id calculation to the ha_partition::position()
sql/ha_partition.h:
Bug #28430 Failure in replication of innodb partitioned tables on row/mixed format.
column_bitmaps_signal interface added
sql/ha_partition.cc:
Bug #28430 Failure in replication of innodb partitioned tables on row/mixed format.
Calculate the number of the partition in ha_partition::position().
ha_partition::column_bitmaps_signal() implemented
mysql-test/r/partition_pruning.result:
Bug #28430 Failure in replication of innodb partitioned tables on row/mixed format.
test result fixed
mysql-test/r/partition_bug18198.result:
Disabled a lot of test cases using ascii-function
mysql-test/r/partition_charset.result:
Disabled a lot of test cases using ascii-function
mysql-test/r/partition_error.result:
Disabled a lot of test cases using ascii-function
mysql-test/r/partition_pruning.result:
Disabled a lot of test cases using ascii-function
mysql-test/r/partition_range.result:
Disabled a lot of test cases using ascii-function
mysql-test/t/partition_bug18198.test:
Disabled a lot of test cases using ascii-function
mysql-test/t/partition_charset.test:
Disabled a lot of test cases using ascii-function
mysql-test/t/partition_error.test:
Disabled a lot of test cases using ascii-function
mysql-test/t/partition_pruning.test:
Disabled a lot of test cases using ascii-function
mysql-test/t/partition_range.test:
Disabled a lot of test cases using ascii-function
into dator5.(none):/home/pappa/bug18198
mysql-test/r/partition_pruning.result:
Auto merged
mysql-test/t/partition_pruning.test:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_func.h:
Auto merged
sql/sql_partition.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/item_strfunc.h:
SCCS merged
into sunlight.local:/local_work/tmp_merge-5.1-opt-mysql
mysql-test/r/auto_increment.result:
Auto merged
mysql-test/r/binlog_row_blackhole.result:
Auto merged
mysql-test/r/binlog_stm_blackhole.result:
Auto merged
mysql-test/r/date_formats.result:
Auto merged
mysql-test/r/func_compress.result:
Auto merged
mysql-test/r/func_gconcat.result:
Auto merged
mysql-test/r/func_group.result:
Auto merged
mysql-test/r/func_math.result:
Auto merged
mysql-test/r/func_str.result:
Auto merged
mysql-test/r/func_system.result:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/gis.result:
Auto merged
mysql-test/r/group_by.result:
Auto merged
mysql-test/r/group_min_max.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/r/olap.result:
Auto merged
mysql-test/r/partition_pruning.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/rpl_get_lock.result:
Auto merged
mysql-test/r/rpl_master_pos_wait.result:
Auto merged
mysql-test/r/select.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/type_blob.result:
Auto merged
mysql-test/r/union.result:
Auto merged
mysql-test/r/variables.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/group_min_max.test:
Auto merged
mysql-test/t/partition_pruning.test:
Auto merged
sql/opt_range.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/table.h:
Auto merged
mysql-test/r/partition.result:
Removed test case no longer supported
mysql-test/r/partition_error.result:
Changed behaviour of test case
mysql-test/r/partition_pruning.result:
Changed behaviour of test case
mysql-test/t/partition.test:
Changed behaviour of test case
mysql-test/t/partition_error.test:
Changed behaviour of test case
mysql-test/t/partition_pruning.test:
Changed behaviour of test case
sql/sql_partition.cc:
Ensured PARTITION BY KEY can use any column type
into mysql.com:/home/psergey/mysql-5.1-bug14940-r4
mysql-test/r/partition_pruning.result:
Auto merged
mysql-test/t/partition_pruning.test:
Auto merged
sql/sql_select.cc:
Auto merged
into sunlight.local:/local_work/tmp_merge-5.1-opt-mysql
mysql-test/r/partition_pruning.result:
Auto merged
mysql-test/t/partition_pruning.test:
Auto merged
sql/sql_partition.cc:
Auto merged
sql/sql_select.cc:
Auto merged
- Make the range-et-al optimizer produce E(#table records after table
condition is applied),
- Make the join optimizer use this value,
- Add "filtered" column to EXPLAIN EXTENDED to show
fraction of records left after table condition is applied
- Adjust test results, add comments
mysql-test/r/archive_gis.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/auto_increment.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/bdb_gis.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/bench_count_distinct.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/binlog_stm_blackhole.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/case.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/cast.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/compress.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/ctype_collate.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/ctype_cp1250_ch.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/date_formats.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/distinct.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/fulltext.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_compress.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_crypt.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_default.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_encrypt.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_gconcat.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_group.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_if.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_in.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_like.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_math.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_op.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_regexp.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_set.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_str.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_system.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_test.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_time.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/gis.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/group_by.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/group_min_max.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/having.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/heap.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/heap_hash.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/index_merge.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/index_merge_innodb.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/index_merge_ror.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/innodb_gis.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/insert_update.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/join.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/join_nested.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/key_diff.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/myisam.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/ndb_gis.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/negation_elimination.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/null.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/olap.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/partition_pruning.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/query_cache.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/row.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/rpl_get_lock.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/rpl_master_pos_wait.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/select.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/ssl.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/ssl_compress.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/subselect.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/type_blob.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/union.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/varbinary.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/variables.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/view.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/t/ctype_cp1250_ch.test:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/t/func_like.test:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/t/group_min_max.test:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/t/index_merge_ror.test:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/t/index_merge_ror_cpk.test:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/t/join.test:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/t/partition_pruning.test:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
sql/opt_range.cc:
BUG#14940: Make range/index_merge/group-min-max optimizer produce TABLE::quick_condition_rows -
estimate of #records that will match the table condition.
sql/sql_class.cc:
BUG#14940: Add "filtered" column to output of EXPLAIN EXTENDED
sql/sql_select.cc:
BUG#14940:
- Make the join optimizer to use TABLE::quick_condition_rows=
= E(#table records after filtering with table condition)
- Add "filtered" column to output of EXPLAIN EXTENDED
sql/sql_select.h:
BUG#14940: Added comments
sql/table.h:
BUG#14940: Added comments
- Fix problems in the "Interval walking" partition interval analyzer.
mysql-test/r/partition_pruning.result:
BUG#20257: Add more testcases for partition pruning
mysql-test/t/partition_pruning.test:
BUG#20257: Add more testcases for partition pruning
sql/sql_partition.cc:
BUG#20257: Fix partition pruning for BIGINT UNSIGNED, interval walking:
- provide special handling for an edge case of interval of size 4G-1.
- Store interval size in ulonglong, not uint (it was possible to miss partitions this way)
- In get_next_partition_via_walking(), interpret the value of walked-over field as having the
same "signedness" as field (this is so because this value was obtained by calling field->val_int())
- Remove out of date todo comment.
Problem was with handling NULL values in ranges
mysql-test/r/partition_hash.result:
New partition pruning test cases
mysql-test/r/partition_list.result:
New partition pruning test cases
mysql-test/r/partition_pruning.result:
New partition pruning test cases
mysql-test/r/partition_range.result:
New partition pruning test cases
mysql-test/t/partition_hash.test:
New partition pruning test cases
mysql-test/t/partition_list.test:
New partition pruning test cases
mysql-test/t/partition_pruning.test:
New partition pruning test cases
mysql-test/t/partition_range.test:
New partition pruning test cases
sql/opt_range.cc:
Added comment
sql/sql_partition.cc:
Partition pruning didn't handle ranges with NULL values in a proper manner
- Don't forget to produce "partitions" column for "UNION RESULT" row of EXPLAIN output
mysql-test/r/partition_pruning.result:
BUG#20484: Testcase
mysql-test/t/partition_pruning.test:
BUG#20484: Testcase
The problem appeared because the same values produced different hash
during INSERT and SELECT for VARCHAR data type.
Fix:
VARCHAR required special treatment to avoid hashing of length bytes
(leftmost one or two bytes) as well as trailing bytes beyond real length,
which could contain garbage. Fix is done by introducing hash() - new method
in the Field class.
mysql-test/r/partition_innodb.result:
Adding test case
mysql-test/r/partition_pruning.result:
Fixing test results (results differ due to changes in hash function)
mysql-test/t/partition_innodb.test:
Adding test case
sql/field.cc:
Adding generic hash() method, and a special
method for VARCHAR.
sql/field.h:
Adding prototypes for new methods
sql/key.cc:
Mark columns for write before executinf of set_key_image().
Thanks for Mikael for suggesting this fix.
sql/sql_partition.cc:
Removing old hash code.
Using new methid field->hash() instead.
In select_describe(), make the String object that holds the value of
"partitions" column to "own" the value buffer, so the buffer isn't
prematurely freed.
[this is the second attempt with review fixes]
mysql-test/r/partition_pruning.result:
BUG#19684: Testcase
mysql-test/t/partition_pruning.test:
BUG#19684: Testcase
sql/sql_select.cc:
BUG#19684: Garbage in 'partitions' column in EXPLAIN output:
- Added comment
- Make the String object that holds the value of "partitions" column
to "own" the value buffer, so the buffer isn't prematurely freed.
(for example, such objects can be returned from get_mm_parts() for "string_field = int_val).
Make find_used_partitions_imerge() to handle such SEL_TREE objects.
mysql-test/r/partition_pruning.result:
BUG#19055: testcase
mysql-test/t/partition_pruning.test:
BUG#19055: testcase
into c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug18962
mysql-test/r/partition_pruning.result:
Auto merged
sql/partition_info.cc:
Auto merged
Fixed naming procedures for default partitioning and default subpartitioning
mysql-test/r/partition_pruning.result:
Fixed test cases for new naming of default subpartitions
mysql-test/r/partition_range.result:
New test case
mysql-test/t/partition_range.test:
New test case
sql/partition_info.cc:
Fixed naming procedures for default partitioning and default subpartitioning
sql/partition_info.h:
Fixed naming procedures for default partitioning and default subpartitioning
Added new test case for bug 17946
mysql-test/r/partition_pruning.result:
Added new test case for bug 17946
mysql-test/t/partition_pruning.test:
Added new test case for bug 17946
* Produce right results for conditions that were transformed to "(partitioning_range) AND
(list_of_subpartitioning_ranges)": make each partition id set iterator auto-reset itself
after it has returned all partition ids in the sequence
* Fix "Range mapping" and "Range mapping" partitioning interval analysis functions to
correctly deal with NULL values.
mysql-test/r/partition_pruning.result:
Testcase for BUG#18558
mysql-test/t/partition_pruning.test:
Testcase for BUG#18558
sql/opt_range.cc:
BUG#18558: Move partition set iterator initialization to sql_partition.cc, comment fixes
sql/partition_info.h:
BUG#18558: Make each partition set iterator auto-reset itself after it has returned all
partition ids in the set it enumerates.
sql/sql_partition.cc:
BUG#18558:
- Make each partition set iterator auto-reset itself after it has returned all
partition ids in the set it enumerates.
- Fix partition interval analysis to correctly handle intervals with one or both
NULL bounds.
sql/sql_partition.h:
BUG#18558:
- Make each partition set iterator auto-reset itself after it has returned all
partition ids in the set it enumerates.
- Rename PARTITION_ITERATOR::has_null_value to ret_null_part
obtain partition number, call partition_info->get_part_partition_id() when
the table has subpartitions, and get_partition_id() otherwise. (The bug
was that we were always doing the latter)
mysql-test/r/partition_pruning.result:
Testcase for BUG#18659
mysql-test/t/partition_pruning.test:
Testcase for BUG#18659
- Fix typo bug in SEL_ARG::is_singlepoint()
- In set_up_range_analysis_info(), treat MEDIUMINT as enumerable type just like other integer types
mysql-test/r/partition_pruning.result:
Testcase for BUG#18025
mysql-test/t/partition_pruning.test:
Testcase for BUG#18025
sql/opt_range.cc:
BUG#18025: Fix a typo bug in SEL_ARG::is_singlepoint()
sql/sql_partition.cc:
BUG#18025: In set_up_range_analysis_info(), treat MEDIUMINT as enumerable type just like other integer types.
Final patch
-----------
This WL is about using this bitmap in all parts of the partition handler.
Thus for:
rnd_init/rnd_next
index_init/index_next and all other variants of index scans
read_range_... the various range scans implemented in the partition handler.
Also use those bitmaps in the various other calls that currently loop over all
partitions.
mysql-test/r/partition_pruning.result:
WL# 2986
New results reflecting bitmap being used to determine if a partition is to be
included
mysql-test/t/partition_pruning.test:
WL# 2986
New tests to show bitmap being used in ha_partition
sql/ha_partition.cc:
WL# 2986
Used work from 2682 and removed the partition select code.
Added do {} while loop to any iteration over partitions to now utilise
m_part_info->used_partitions bitmap to determine if a partition should be
used.
sql/ha_partition.h:
WL# 2986
Removed unused member
sql/handler.h:
WL# 2986
Removed unused member
sql/opt_range.cc:
WL# 2986
Added bitmap_clear_all to clear bitmap prior to pruning
DBUG code for testing
sql/sql_partition.cc:
WL# 2986
Changed < to <=, which fixes the problem with edge cases going awry.
- post-...-post review fixes
- Added "integer range walking" that allows to do partition pruning for "a <=? t.field <=? b"
by finding used partitions for a, a+1, a+2, ..., b-1, b.
mysql-test/r/partition_pruning.result:
WL#2985 "Partition Pruning": tests for "integer range walking"
mysql-test/t/partition.test:
WL#2985 "Partition Pruning": post-review fixes
mysql-test/t/partition_pruning.test:
WL#2985 "Partition Pruning": tests for "integer range walking"
sql/handler.h:
WL#2985 "Partition Pruning": "integer range walking":
- class partition_info now has pointers to "partitioning interval analysis" functions
- added "partition set iterator" definitions.
sql/opt_range.cc:
WL#2985 "Partition Pruning": "integer range walking":
- Switched to use "partitioning interval analysis" functions
- Fixed two problems in find_used_partitions() that occur on complicated WHERE clauses.
sql/sql_partition.cc:
WL#2985 "Partition Pruning": "integer range walking":
- Added "partitioning interval analysis" functions: get_part_iter_for_interval_via_mapping,
get_part_iter_for_interval_via_walking,
- Added appropriate partition-set-iterator implementations
- Added a function to set up Partitioning Interval Analysis-related fields in partition_info.
sql/sql_select.cc:
WL#2985 "Partition pruning": added comments.