revision-id: cd00d03fe2d5b92d4451545e3b15477d027c83d0 (mariadb-10.3.6-113-gcd00d03) parent(s): 3955d2a1539e7e41e3457c99f773d90c90f4f90f author: Igor Babaev committer: Igor Babaev timestamp: 2019-02-10 21:15:48 -0800 message: MDEV-16188 Fixed the code of ha_partition::multi_range_read_info() The code was rewritten in the same way as the code of ha_partition::multi_range_read_info_const() had been rewritten earlier. The fix allowed to run spider.partition_mrr. --- .../sys_vars/r/sysvars_server_embedded,32bit.rdiff | 9 --------- sql/ha_partition.cc | 21 +++++++++++---------- storage/connect/mysql-test/connect/r/xml.result | 2 +- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff index e10b2c5..5d47090 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff @@ -507,15 +507,6 @@ VARIABLE_COMMENT Maximum stored procedure recursion depth NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -2261,7 +2261,7 @@ - VARIABLE_TYPE BIGINT UNSIGNED - VARIABLE_COMMENT The maximum size of the container of a rowid filter - NUMERIC_MIN_VALUE 1024 --NUMERIC_MAX_VALUE 18446744073709551615 -+NUMERIC_MAX_VALUE 4294967295 - NUMERIC_BLOCK_SIZE 1 - ENUM_VALUE_LIST NULL - READ_ONLY NO @@ -2284,7 +2284,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32 diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 7d5c7c4..acf20b4 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -6346,9 +6346,12 @@ ha_rows ha_partition::multi_range_read_info(uint keyno, uint n_ranges, uint i; handler **file; ha_rows rows; + Cost_estimate part_cost; DBUG_ENTER("ha_partition::multi_range_read_info"); DBUG_PRINT("enter", ("partition this: %p", this)); + cost->reset(); + m_mrr_new_full_buffer_size= 0; file= m_file; do @@ -6356,22 +6359,20 @@ ha_rows ha_partition::multi_range_read_info(uint keyno, uint n_ranges, i= (uint)(file - m_file); if (bitmap_is_set(&(m_part_info->read_partitions), (i))) { + ha_rows tmp_rows; m_mrr_buffer_size[i]= 0; - if ((rows= (*file)->multi_range_read_info(keyno, n_ranges, keys, - key_parts, - &m_mrr_buffer_size[i], - mrr_mode, cost))) + part_cost.reset(); + if ((tmp_rows= (*file)->multi_range_read_info(keyno, n_ranges, keys, + key_parts, + &m_mrr_buffer_size[i], + mrr_mode, &part_cost))) DBUG_RETURN(rows); + cost->add(&part_cost); + rows+= tmp_rows; m_mrr_new_full_buffer_size+= m_mrr_buffer_size[i]; } } while (*(++file)); - cost->reset(); - cost->avg_io_cost= 1; - if (*mrr_mode & HA_MRR_INDEX_ONLY) - cost->io_count= keyread_time(keyno, n_ranges, (uint) rows); - else - cost->io_count= read_time(keyno, n_ranges, rows); DBUG_RETURN(0); } diff --git a/storage/connect/mysql-test/connect/r/xml.result b/storage/connect/mysql-test/connect/r/xml.result index 99739b1..6a0c9db 100644 --- a/storage/connect/mysql-test/connect/r/xml.result +++ b/storage/connect/mysql-test/connect/r/xml.result @@ -323,7 +323,7 @@ HEX(c) 3F3F3F3F3F3F3F Warnings: Level Warning Code 1366 -Message Incorrect string value: '\xC3\x81\xC3\x82\xC3\x83...' for column 'c' at row 1 +Message Incorrect string value: '\xC3\x81\xC3\x82\xC3\x83...' for column `test`.`t1`.`c` at row 1 Level Warning Code 1105 Message Out of range value ÁÂÃÄÅÆÇ for column 'c' at row 1