Skip to content

Commit 2bf93a8

Browse files
committed
Merge 10.3 into 10.4
2 parents 6b5f7dd + 294ac1f commit 2bf93a8

File tree

17 files changed

+282
-177
lines changed

17 files changed

+282
-177
lines changed

extra/mariabackup/xtrabackup.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5723,7 +5723,7 @@ static bool xtrabackup_prepare_func(char** argv)
57235723

57245724
error_cleanup:
57255725
xb_filters_free();
5726-
return ok;
5726+
return ok && !ib::error::was_logged();
57275727
}
57285728

57295729
/**************************************************************************

mysql-test/main/ps.result

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5472,6 +5472,23 @@ drop procedure p;
54725472
drop view v1;
54735473
drop table t1;
54745474
#
5475+
# MDEV-22591 Debug build crashes on EXECUTE IMMEDIATE '... WHERE ?' USING IGNORE
5476+
#
5477+
CREATE TABLE t1 (a INT);
5478+
EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE ?' USING IGNORE;
5479+
ERROR HY000: Default/ignore value is not supported for such parameter usage
5480+
EXECUTE IMMEDIATE 'SELECT * FROM t1 HAVING ?' USING IGNORE;
5481+
ERROR HY000: Default/ignore value is not supported for such parameter usage
5482+
EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE ?' USING 0;
5483+
a
5484+
EXECUTE IMMEDIATE 'SELECT * FROM t1 HAVING ?' USING 0;
5485+
a
5486+
DROP TABLE t1;
5487+
EXECUTE IMMEDIATE 'SHOW DATABASES WHERE ?' USING DEFAULT;
5488+
ERROR HY000: Default/ignore value is not supported for such parameter usage
5489+
EXECUTE IMMEDIATE 'SHOW DATABASES WHERE ?' USING 0;
5490+
Database
5491+
#
54755492
# End of 10.2 tests
54765493
#
54775494
#

mysql-test/main/ps.test

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4914,6 +4914,23 @@ drop procedure p;
49144914
drop view v1;
49154915
drop table t1;
49164916

4917+
4918+
--echo #
4919+
--echo # MDEV-22591 Debug build crashes on EXECUTE IMMEDIATE '... WHERE ?' USING IGNORE
4920+
--echo #
4921+
4922+
CREATE TABLE t1 (a INT);
4923+
--error ER_INVALID_DEFAULT_PARAM
4924+
EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE ?' USING IGNORE;
4925+
--error ER_INVALID_DEFAULT_PARAM
4926+
EXECUTE IMMEDIATE 'SELECT * FROM t1 HAVING ?' USING IGNORE;
4927+
EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE ?' USING 0;
4928+
EXECUTE IMMEDIATE 'SELECT * FROM t1 HAVING ?' USING 0;
4929+
DROP TABLE t1;
4930+
--error ER_INVALID_DEFAULT_PARAM
4931+
EXECUTE IMMEDIATE 'SHOW DATABASES WHERE ?' USING DEFAULT;
4932+
EXECUTE IMMEDIATE 'SHOW DATABASES WHERE ?' USING 0;
4933+
49174934
--echo #
49184935
--echo # End of 10.2 tests
49194936
--echo #

mysql-test/main/sp2.result

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
CREATE DATABASE test1;
2+
CREATE PROCEDURE test1.sp3() BEGIN END;
3+
SHOW PROCEDURE STATUS;
4+
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
5+
mtr add_suppression PROCEDURE root@localhost # # DEFINER utf8 utf8_general_ci latin1_swedish_ci
6+
mtr check_testcase PROCEDURE root@localhost # # DEFINER utf8 utf8_general_ci latin1_swedish_ci
7+
mtr check_warnings PROCEDURE root@localhost # # DEFINER utf8 utf8_general_ci latin1_swedish_ci
8+
mysql AddGeometryColumn PROCEDURE mariadb.sys@localhost # # INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
9+
mysql DropGeometryColumn PROCEDURE mariadb.sys@localhost # # INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
10+
test sp2 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
11+
test1 sp1 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
12+
test1 sp3 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
13+
DROP PROCEDURE sp2;
14+
DROP DATABASE test1;
15+
select count(*) from mysql.event;
16+
count(*)
17+
416
18+
flush tables;
19+
show events;
20+
truncate table mysql.event;

mysql-test/main/sp2.test

Lines changed: 37 additions & 0 deletions
Large diffs are not rendered by default.

mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_frag.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
2020
SET @binlog_fragment_0='012345';
2121
BINLOG @binlog_fragment_0, @binlog_fragment_not_exist;
2222
ERROR 42000: Incorrect argument type to variable 'binlog_fragment_not_exist'
23+
SET @a= '42';
24+
BINLOG @a, @a;
25+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use
2326
# Cleanup
2427
DROP TABLE t;

mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_frag.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ SET @binlog_fragment_0='012345';
4141
--error ER_WRONG_TYPE_FOR_VAR
4242
BINLOG @binlog_fragment_0, @binlog_fragment_not_exist;
4343

44+
# MDEV-22520
45+
SET @a= '42';
46+
--error ER_SYNTAX_ERROR
47+
BINLOG @a, @a;
48+
4449
--echo # Cleanup
4550
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
4651
DROP TABLE t;

sql/sql_binlog.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ int binlog_defragment(THD *thd)
158158
memcpy(const_cast<char*>(thd->lex->comment.str) + gathered_length, entry[k]->value,
159159
entry[k]->length);
160160
gathered_length += entry[k]->length;
161-
update_hash(entry[k], true, NULL, 0, STRING_RESULT, &my_charset_bin, 0);
162161
}
162+
for (uint k=0; k < 2; k++)
163+
update_hash(entry[k], true, NULL, 0, STRING_RESULT, &my_charset_bin, 0);
163164

164165
DBUG_ASSERT(gathered_length == thd->lex->comment.length);
165166

storage/innobase/dict/dict0dict.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,7 +1970,9 @@ dict_index_remove_from_cache_low(
19701970
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
19711971
ut_ad(mutex_own(&dict_sys.mutex));
19721972
ut_ad(table->id);
1973+
#ifdef BTR_CUR_HASH_ADAPT
19731974
ut_ad(!index->freed());
1975+
#endif /* BTR_CUR_HASH_ADAPT */
19741976

19751977
/* No need to acquire the dict_index_t::lock here because
19761978
there can't be any active operations on this index (or table). */

storage/innobase/handler/handler0alter.cc

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,16 +1056,12 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
10561056
@return whether the table will be rebuilt */
10571057
bool need_rebuild () const { return(old_table != new_table); }
10581058

1059-
/** Clear uncommmitted added indexes after a failed operation. */
1060-
void clear_added_indexes()
1061-
{
1062-
for (ulint i = 0; i < num_to_add_index; i++) {
1063-
if (!add_index[i]->is_committed()) {
1064-
add_index[i]->detach_columns();
1065-
add_index[i]->n_fields = 0;
1066-
}
1067-
}
1068-
}
1059+
/** Clear uncommmitted added indexes after a failed operation. */
1060+
void clear_added_indexes()
1061+
{
1062+
for (ulint i= 0; i < num_to_add_index; i++)
1063+
add_index[i]->detach_columns(true);
1064+
}
10691065

10701066
/** Convert table-rebuilding ALTER to instant ALTER. */
10711067
void prepare_instant()

0 commit comments

Comments
 (0)