summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-10-30 13:53:10 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-10-30 13:53:10 +0200
commit03357ded174c13d941abc37e8c12506d75aaa52d (patch)
tree78aa972b05b2eec7ffaa720cbe10c0751cfecc92
parent066773e2f0fec428713fff25091ecb27922b9d52 (diff)
parent1fddccf676e213f94923f5efaaa76d9793b19a89 (diff)
downloadmariadb-git-03357ded174c13d941abc37e8c12506d75aaa52d.tar.gz
Merge 10.4 into 10.5
m---------libmariadb0
-rw-r--r--mysql-test/main/innodb_ext_key,off.rdiff10
-rw-r--r--mysql-test/main/innodb_ext_key.result6
-rw-r--r--mysql-test/main/innodb_ext_key.test5
-rw-r--r--sql/sql_string.h3
5 files changed, 14 insertions, 10 deletions
diff --git a/libmariadb b/libmariadb
-Subproject 0cdc1656a70c52103b4329debf9ed02ccacfb3c
+Subproject 62427520a5ba20e42fe51f5045062a7a9cadb46
diff --git a/mysql-test/main/innodb_ext_key,off.rdiff b/mysql-test/main/innodb_ext_key,off.rdiff
index 62de75e5c42..4d6c65c9971 100644
--- a/mysql-test/main/innodb_ext_key,off.rdiff
+++ b/mysql-test/main/innodb_ext_key,off.rdiff
@@ -1,9 +1,11 @@
+--- innodb_ext_key.result
++++ innodb_ext_key,off.result
@@ -9,7 +9,7 @@
explain
select count(*) from lineitem where l_orderkey=130 and l_shipdate='1992-07-01';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 8 const,const 1 Using index
-+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 const 5 Using where
++1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 4 const 6 Using where; Using index
flush status;
select count(*) from lineitem where l_orderkey=130 and l_shipdate='1992-07-01';
count(*)
@@ -12,7 +14,7 @@
Handler_read_key 1
Handler_read_last 0
-Handler_read_next 1
-+Handler_read_next 5
++Handler_read_next 6
Handler_read_prev 0
Handler_read_retry 0
Handler_read_rnd 0
@@ -93,7 +95,7 @@
where l_shipdate='1992-07-01' and l_orderkey=130;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
-+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 const 5 Using where
++1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 4 const 6 Using where; Using index
flush status;
select max(l_linenumber) from lineitem
where l_shipdate='1992-07-01' and l_orderkey=130;
@@ -102,7 +104,7 @@
Handler_read_key 1
Handler_read_last 0
-Handler_read_next 0
-+Handler_read_next 5
++Handler_read_next 6
Handler_read_prev 0
Handler_read_retry 0
Handler_read_rnd 0
diff --git a/mysql-test/main/innodb_ext_key.result b/mysql-test/main/innodb_ext_key.result
index 9d2ba10b380..5708cf88934 100644
--- a/mysql-test/main/innodb_ext_key.result
+++ b/mysql-test/main/innodb_ext_key.result
@@ -26,12 +26,12 @@ Handler_read_rnd 0
Handler_read_rnd_deleted 0
Handler_read_rnd_next 0
explain
-select count(*) from lineitem
+select count(*) from lineitem use index(primary)
where l_orderkey=130 and l_linenumber=2 and l_shipdate='1992-07-01';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE lineitem const PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 8 const,const 1
+1 SIMPLE lineitem const PRIMARY PRIMARY 8 const,const 1
flush status;
-select count(*) from lineitem
+select count(*) from lineitem use index(primary)
where l_orderkey=130 and l_linenumber=2 and l_shipdate='1992-07-01';
count(*)
1
diff --git a/mysql-test/main/innodb_ext_key.test b/mysql-test/main/innodb_ext_key.test
index 94d02ed9c37..5fcf6a309b9 100644
--- a/mysql-test/main/innodb_ext_key.test
+++ b/mysql-test/main/innodb_ext_key.test
@@ -17,6 +17,7 @@ use dbt3_s001;
--disable_result_log
--disable_warnings
--source include/dbt3_s001.inc
+ANALYZE TABLE lineitem PERSISTENT FOR COLUMNS() INDEXES();
--enable_warnings
--enable_result_log
--enable_query_log
@@ -28,10 +29,10 @@ select count(*) from lineitem where l_orderkey=130 and l_shipdate='1992-07-01';
show status like 'handler_read%';
explain
-select count(*) from lineitem
+select count(*) from lineitem use index(primary)
where l_orderkey=130 and l_linenumber=2 and l_shipdate='1992-07-01';
flush status;
-select count(*) from lineitem
+select count(*) from lineitem use index(primary)
where l_orderkey=130 and l_linenumber=2 and l_shipdate='1992-07-01';
show status like 'handler_read%';
diff --git a/sql/sql_string.h b/sql/sql_string.h
index d1378e62a97..b3eca118b63 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -314,7 +314,8 @@ public:
}
void q_append(const char *data, size_t data_len)
{
- memcpy(Ptr + str_length, data, data_len);
+ if (data_len)
+ memcpy(Ptr + str_length, data, data_len);
DBUG_ASSERT(str_length <= UINT_MAX32 - data_len);
str_length += (uint)data_len;
}