diff options
author | Monty <monty@mariadb.org> | 2016-02-02 13:07:53 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2016-02-02 13:07:53 +0200 |
commit | 11c2d3c3e21642107db625f33c177f09d8ccd3ca (patch) | |
tree | 086455d9163bae04ea602247aaa710204b48b4e9 | |
parent | 52d695fef4f959daf12cc1e4b83907917dddfbe8 (diff) | |
parent | 5cf293fcad0dd78c4e1a797ed1f68fb2cf165b14 (diff) | |
download | mariadb-git-11c2d3c3e21642107db625f33c177f09d8ccd3ca.tar.gz |
Merge branch '10.0' into 10.1
Conflicts:
configure.cmake
-rw-r--r-- | configure.cmake | 1 | ||||
-rw-r--r-- | mysql-test/r/events_bugs.result | 10 | ||||
-rw-r--r-- | mysql-test/r/partition_pruning.result | 18 | ||||
-rw-r--r-- | mysql-test/suite/plugins/r/sql_error_log.result | 10 | ||||
-rw-r--r-- | mysql-test/suite/plugins/t/sql_error_log.test | 18 | ||||
-rw-r--r-- | mysql-test/t/events_bugs.test | 10 | ||||
-rw-r--r-- | mysql-test/t/partition_pruning.test | 19 | ||||
-rw-r--r-- | sql/opt_range.cc | 16 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 2 |
9 files changed, 81 insertions, 23 deletions
diff --git a/configure.cmake b/configure.cmake index d59029df14a..203f49c1a0d 100644 --- a/configure.cmake +++ b/configure.cmake @@ -1091,4 +1091,3 @@ IF(NOT MSVC) HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE ) ENDIF() - diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index 3de6a6e48fc..8920c89fcab 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -91,7 +91,7 @@ create table events_smode_test(ev_name char(10), a date); "This should never insert something" create event ee_16407_2 on schedule every 60 second do begin -select get_lock('ee_16407_2', 60) /*ee_16407_2*/; +select get_lock('ee_16407_2', 60); /*ee_16407_2*/ select release_lock('ee_16407_2'); insert into events_test.events_smode_test values('ee_16407_2','1980-19-02'); end| @@ -100,7 +100,7 @@ ERROR 22007: Incorrect date value: '1980-19-02' for column 'a' at row 1 "This is ok" create event ee_16407_3 on schedule every 60 second do begin -select get_lock('ee_16407_2', 60) /*ee_16407_3*/; +select get_lock('ee_16407_2', 60); /*ee_16407_3*/ select release_lock('ee_16407_2'); insert into events_test.events_smode_test values ('ee_16407_3','1980-02-19'); insert into events_test.events_smode_test values ('ee_16407_3','1980-02-29'); @@ -109,7 +109,7 @@ set sql_mode=""| "This will insert rows but they will be truncated" create event ee_16407_4 on schedule every 60 second do begin -select get_lock('ee_16407_2', 60) /*ee_16407_4*/; +select get_lock('ee_16407_2', 60); /*ee_16407_4*/ select release_lock('ee_16407_2'); insert into events_test.events_smode_test values ('ee_16407_4','10-11-1956'); end| @@ -157,13 +157,13 @@ create procedure ee_16407_5_pendant() begin insert into events_test.events_smode create procedure ee_16407_6_pendant() begin insert into events_test.events_smode_test values('ee_16407_6','2004-02-29'); end| create event ee_16407_5 on schedule every 60 second do begin -select get_lock('ee_16407_5', 60) /*ee_16407_5*/; +select get_lock('ee_16407_5', 60); /*ee_16407_5*/ select release_lock('ee_16407_5'); call events_test.ee_16407_5_pendant(); end| create event ee_16407_6 on schedule every 60 second do begin -select get_lock('ee_16407_5', 60) /*ee_16407_6*/; +select get_lock('ee_16407_5', 60); /*ee_16407_6*/ select release_lock('ee_16407_5'); call events_test.ee_16407_6_pendant(); end| diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result index c6d7c383ce7..fe19473f8e4 100644 --- a/mysql-test/r/partition_pruning.result +++ b/mysql-test/r/partition_pruning.result @@ -3466,3 +3466,21 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 PRIMARY t2 p_1000 ref PRIMARY PRIMARY 8 const 2 Using index 1 PRIMARY t1 p_1000 ALL PRIMARY NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join) drop table t1,t2; +# +# MDEV-9505: Valgrind failure in SEL_ARG::store_min,find_used_partitions,... +# +create table t1 (a int, b char(10), c varchar(5), d int) +partition by range columns(a,b,c) +subpartition by key (c,d) +subpartitions 3 +( partition p0 values less than (1,'abc','abc'), +partition p1 values less than (2,'abc','abc'), +partition p2 values less than (3,'abc','abc'), +partition p3 values less than (4,'abc','abc') +); +insert into t1 values (1,'a','b',1),(2,'a','b',2),(3,'a','b',3); +select * from t1 where (a = 1 AND b < 'd' AND (c = 'b' OR (c = 'c' AND d = 1)) OR +(a = 1 AND b >= 'a' AND (c = 'c' OR (c = 'd' AND d = 2)))); +a b c d +1 a b 1 +drop table t1; diff --git a/mysql-test/suite/plugins/r/sql_error_log.result b/mysql-test/suite/plugins/r/sql_error_log.result index 3086b1f2d1f..a583cf91a83 100644 --- a/mysql-test/suite/plugins/r/sql_error_log.result +++ b/mysql-test/suite/plugins/r/sql_error_log.result @@ -35,6 +35,15 @@ SET SQL_MODE = ''; drop table t1; SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'not_exists' AND TABLE_NAME = 'not_exists'; TABLE_NAME +CREATE procedure e1() +BEGIN +START TRANSACTION; +INSERT INTO test.non_exists VALUES (0,0,0) /* e1 */; +COMMIT; +END| +CALL e1(); +ERROR 42S02: Table 'test.non_exists' doesn't exist +DROP PROCEDURE e1; uninstall plugin SQL_ERROR_LOG; Warnings: Warning 1620 Plugin is busy and will be uninstalled on shutdown @@ -45,3 +54,4 @@ TIME HOSTNAME ERROR 1000: new message : RESIGNAL SQLSTATE '40000' SET MYSQL_ERRNO = 1000, MESSAGE_TEXT = 'new message' TIME HOSTNAME ERROR 1366: Incorrect integer value: 'aa' for column 'id' at row 1 : insert into t1 values ('aa') +TIME HOSTNAME ERROR 1146: Table 'test.non_exists' doesn't exist : INSERT INTO test.non_exists VALUES (0,0,0) /* e1 */ diff --git a/mysql-test/suite/plugins/t/sql_error_log.test b/mysql-test/suite/plugins/t/sql_error_log.test index a28e2d2e259..6c83e9655ce 100644 --- a/mysql-test/suite/plugins/t/sql_error_log.test +++ b/mysql-test/suite/plugins/t/sql_error_log.test @@ -48,6 +48,24 @@ drop table t1; SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'not_exists' AND TABLE_NAME = 'not_exists'; +# +# MDEV-6421 SQL_ERROR_LOG doesn't log comments in Events +# actually testing SP call is enough for that. + +DELIMITER |; + +CREATE procedure e1() +BEGIN + START TRANSACTION; + INSERT INTO test.non_exists VALUES (0,0,0) /* e1 */; + COMMIT; +END| + +DELIMITER ;| +--error ER_NO_SUCH_TABLE +CALL e1(); +DROP PROCEDURE e1; + uninstall plugin SQL_ERROR_LOG; let $MYSQLD_DATADIR= `SELECT @@datadir`; diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index c0157a7727e..df40b840a68 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -306,7 +306,7 @@ create table events_smode_test(ev_name char(10), a date); delimiter |; create event ee_16407_2 on schedule every 60 second do begin - select get_lock('ee_16407_2', 60) /*ee_16407_2*/; + select get_lock('ee_16407_2', 60); /*ee_16407_2*/ select release_lock('ee_16407_2'); insert into events_test.events_smode_test values('ee_16407_2','1980-19-02'); end| @@ -315,7 +315,7 @@ insert into events_test.events_smode_test values ('test','1980-19-02')| --echo "This is ok" create event ee_16407_3 on schedule every 60 second do begin - select get_lock('ee_16407_2', 60) /*ee_16407_3*/; + select get_lock('ee_16407_2', 60); /*ee_16407_3*/ select release_lock('ee_16407_2'); insert into events_test.events_smode_test values ('ee_16407_3','1980-02-19'); insert into events_test.events_smode_test values ('ee_16407_3','1980-02-29'); @@ -324,7 +324,7 @@ set sql_mode=""| --echo "This will insert rows but they will be truncated" create event ee_16407_4 on schedule every 60 second do begin - select get_lock('ee_16407_2', 60) /*ee_16407_4*/; + select get_lock('ee_16407_2', 60); /*ee_16407_4*/ select release_lock('ee_16407_2'); insert into events_test.events_smode_test values ('ee_16407_4','10-11-1956'); end| @@ -412,13 +412,13 @@ create procedure ee_16407_5_pendant() begin insert into events_test.events_smode create procedure ee_16407_6_pendant() begin insert into events_test.events_smode_test values('ee_16407_6','2004-02-29'); end| create event ee_16407_5 on schedule every 60 second do begin - select get_lock('ee_16407_5', 60) /*ee_16407_5*/; + select get_lock('ee_16407_5', 60); /*ee_16407_5*/ select release_lock('ee_16407_5'); call events_test.ee_16407_5_pendant(); end| create event ee_16407_6 on schedule every 60 second do begin - select get_lock('ee_16407_5', 60) /*ee_16407_6*/; + select get_lock('ee_16407_5', 60); /*ee_16407_6*/ select release_lock('ee_16407_5'); call events_test.ee_16407_6_pendant(); end| diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test index 06ef99e1e70..9d72e9c0d01 100644 --- a/mysql-test/t/partition_pruning.test +++ b/mysql-test/t/partition_pruning.test @@ -1517,3 +1517,22 @@ and dept_id in (select dept_id from t2 where COMPANY_ID = 1000); drop table t1,t2; +--echo # +--echo # MDEV-9505: Valgrind failure in SEL_ARG::store_min,find_used_partitions,... +--echo # +create table t1 (a int, b char(10), c varchar(5), d int) +partition by range columns(a,b,c) +subpartition by key (c,d) +subpartitions 3 +( partition p0 values less than (1,'abc','abc'), + partition p1 values less than (2,'abc','abc'), + partition p2 values less than (3,'abc','abc'), + partition p3 values less than (4,'abc','abc') +); + +insert into t1 values (1,'a','b',1),(2,'a','b',2),(3,'a','b',3); +select * from t1 where (a = 1 AND b < 'd' AND (c = 'b' OR (c = 'c' AND d = 1)) OR + (a = 1 AND b >= 'a' AND (c = 'c' OR (c = 'd' AND d = 2)))); +drop table t1; + + diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 7e6753e9bf6..ed7e9a56ae5 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -4336,15 +4336,14 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar) Field **field= (ppar->part_fields)? part_info->part_field_array : part_info->subpart_field_array; bool in_subpart_fields= FALSE; - uint max_key_len= 0; - uint cur_key_len= 0; + uint total_key_len= 0; for (uint part= 0; part < total_parts; part++, key_part++) { key_part->key= 0; key_part->part= part; key_part->length= (uint16)(*field)->key_length(); key_part->store_length= (uint16)get_partition_field_store_length(*field); - cur_key_len += key_part->store_length; + total_key_len += key_part->store_length; DBUG_PRINT("info", ("part %u length %u store_length %u", part, key_part->length, key_part->store_length)); @@ -4370,18 +4369,13 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar) { field= part_info->subpart_field_array; in_subpart_fields= TRUE; - max_key_len= cur_key_len; - cur_key_len= 0; } } range_par->key_parts_end= key_part; - if (cur_key_len > max_key_len) - max_key_len= cur_key_len; - - max_key_len++; /* Take into account the "+1" in QUICK_RANGE::QUICK_RANGE */ - if (!(range_par->min_key= (uchar*)alloc_root(alloc,max_key_len)) || - !(range_par->max_key= (uchar*)alloc_root(alloc,max_key_len))) + total_key_len++; /* Take into account the "+1" in QUICK_RANGE::QUICK_RANGE */ + if (!(range_par->min_key= (uchar*)alloc_root(alloc,total_key_len)) || + !(range_par->max_key= (uchar*)alloc_root(alloc,total_key_len))) { return true; } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 18a981c58c6..e857a3b633a 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3756,7 +3756,7 @@ sp_proc_stmt_statement: if (yychar == YYEMPTY) i->m_query.length= lip->get_ptr() - sp->m_tmp_query; else - i->m_query.length= lip->get_tok_end() - sp->m_tmp_query; + i->m_query.length= lip->get_tok_start() - sp->m_tmp_query;; if (!(i->m_query.str= strmake_root(thd->mem_root, sp->m_tmp_query, i->m_query.length)) || |