Skip to content

Commit 1c4b6af

Browse files
committed
Merge 10.2 into bb-10.2-ext
2 parents 036b9dc + 9d95b86 commit 1c4b6af

File tree

11 files changed

+98
-16
lines changed

11 files changed

+98
-16
lines changed

mysql-test/r/query_cache.result

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,6 +2168,25 @@ show status like "Qcache_hits";
21682168
Variable_name Value
21692169
Qcache_hits 1
21702170
drop table t1;
2171+
#
2172+
# MDEV-15328: MariaDB 10.2.13 Crashes upon CALL PROCEDURE PARAM
2173+
# LAST_INSERT_ID ()
2174+
# (part 2, part 1 is in sp.test)
2175+
#
2176+
create table t1 (a int);
2177+
insert into t1 values (1);
2178+
CREATE FUNCTION foo (i INT UNSIGNED ) RETURNS int deterministic RETURN 1;
2179+
show status like "Qcache_queries_in_cache";
2180+
Variable_name Value
2181+
Qcache_queries_in_cache 0
2182+
SELECT foo( LAST_INSERT_ID() ) from t1;
2183+
foo( LAST_INSERT_ID() )
2184+
1
2185+
show status like "Qcache_queries_in_cache";
2186+
Variable_name Value
2187+
Qcache_queries_in_cache 0
2188+
DROP FUNCTION foo;
2189+
drop table t1;
21712190
restore defaults
21722191
SET GLOBAL query_cache_type= default;
21732192
SET GLOBAL query_cache_size= default;

mysql-test/r/sp.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8337,6 +8337,14 @@ drop procedure p1;
83378337
drop procedure p2;
83388338
drop procedure p3;
83398339
#
8340+
# MDEV-15328: MariaDB 10.2.13 Crashes upon CALL PROCEDURE PARAM
8341+
# LAST_INSERT_ID ()
8342+
# (part 1, part 2 is in query_cache.test)
8343+
#
8344+
CREATE PROCEDURE foo ( IN i INT UNSIGNED ) BEGIN END;
8345+
CALL foo( LAST_INSERT_ID() );
8346+
DROP PROCEDURE foo;
8347+
#
83408348
# Start of 10.3 tests
83418349
#
83428350
#

mysql-test/r/warnings.result

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,15 @@ Error 1062 Duplicate entry '11' for key 'a'
358358

359359
DROP TABLE t1;
360360
DROP FUNCTION f1;
361+
connect con1,localhost,root,,;
362+
SELECT TIME('10:10:10.11111111111');
363+
TIME('10:10:10.11111111111')
364+
10:10:10.111111
365+
Warnings:
366+
Note 1292 Truncated incorrect time value: '10:10:10.11111111111'
367+
disconnect con1;
368+
connect con2,localhost,root,,;
369+
SHOW WARNINGS;
370+
Level Code Message
371+
disconnect con2;
372+
connection default;

mysql-test/r/xa.result

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ INSERT INTO t1 SELECT * FROM t2;
335335
connection default;
336336
REPLACE INTO t2 SELECT * FROM t2;
337337
connection con1;
338-
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
339338
disconnect con1;
340339
connect con2,localhost,root,,test;
341340
INSERT INTO t3 VALUES (1);

mysql-test/t/query_cache.test

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,6 +1767,21 @@ show status like "Qcache_inserts";
17671767
show status like "Qcache_hits";
17681768
drop table t1;
17691769

1770+
--echo #
1771+
--echo # MDEV-15328: MariaDB 10.2.13 Crashes upon CALL PROCEDURE PARAM
1772+
--echo # LAST_INSERT_ID ()
1773+
--echo # (part 2, part 1 is in sp.test)
1774+
--echo #
1775+
1776+
create table t1 (a int);
1777+
insert into t1 values (1);
1778+
CREATE FUNCTION foo (i INT UNSIGNED ) RETURNS int deterministic RETURN 1;
1779+
show status like "Qcache_queries_in_cache";
1780+
SELECT foo( LAST_INSERT_ID() ) from t1;
1781+
show status like "Qcache_queries_in_cache";
1782+
DROP FUNCTION foo;
1783+
drop table t1;
1784+
17701785
--echo restore defaults
17711786
SET GLOBAL query_cache_type= default;
17721787
SET GLOBAL query_cache_size= default;

mysql-test/t/sp.test

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9841,6 +9841,16 @@ drop procedure p1;
98419841
drop procedure p2;
98429842
drop procedure p3;
98439843

9844+
--echo #
9845+
--echo # MDEV-15328: MariaDB 10.2.13 Crashes upon CALL PROCEDURE PARAM
9846+
--echo # LAST_INSERT_ID ()
9847+
--echo # (part 1, part 2 is in query_cache.test)
9848+
--echo #
9849+
9850+
CREATE PROCEDURE foo ( IN i INT UNSIGNED ) BEGIN END;
9851+
CALL foo( LAST_INSERT_ID() );
9852+
DROP PROCEDURE foo;
9853+
98449854
--echo #
98459855
--echo # Start of 10.3 tests
98469856
--echo #

mysql-test/t/warnings-master.opt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--loose-skip-innodb
1+
--loose-skip-innodb --thread-handling=one-thread-per-connection

mysql-test/t/warnings.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,3 +286,15 @@ SHOW WARNINGS;
286286

287287
DROP TABLE t1;
288288
DROP FUNCTION f1;
289+
290+
# MDEV-14581 Warning info not cleared when caching THD
291+
connect (con1,localhost,root,,);
292+
SELECT TIME('10:10:10.11111111111');
293+
disconnect con1;
294+
295+
connect (con2,localhost,root,,);
296+
SHOW WARNINGS;
297+
disconnect con2;
298+
299+
connection default;
300+

mysql-test/t/xa.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ INSERT INTO t1 SELECT * FROM t2;
462462
REPLACE INTO t2 SELECT * FROM t2;
463463

464464
--connection con1
465-
--error ER_LOCK_DEADLOCK
465+
--error 0, ER_LOCK_DEADLOCK, ER_LOCK_WAIT_TIMEOUT
466466
--reap
467467
--disconnect con1
468468

sql/mysqld.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2959,6 +2959,10 @@ static bool cache_thread(THD *thd)
29592959
_db_pop_();
29602960
#endif
29612961

2962+
/* Clear warnings. */
2963+
if (!thd->get_stmt_da()->is_warning_info_empty())
2964+
thd->get_stmt_da()->clear_warning_info(thd->query_id);
2965+
29622966
set_timespec(abstime, THREAD_CACHE_TIMEOUT);
29632967
while (!abort_loop && ! wake_thread && ! kill_cached_threads)
29642968
{

0 commit comments

Comments
 (0)