diff options
author | Daniele Sciascia <daniele.sciascia@galeracluster.com> | 2022-03-29 14:58:19 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2022-03-30 08:31:18 +0300 |
commit | d59b16dd9605d7caecb454fb9efdaa4dfc5770cc (patch) | |
tree | 72dfb4e69831b84647885ee08fea231ea8d6fe38 | |
parent | 088b37b5eaa8c3198c7f8ea0358d15135833f6bb (diff) | |
download | mariadb-git-d59b16dd9605d7caecb454fb9efdaa4dfc5770cc.tar.gz |
Galera test failure on galera_bf_abort_ps_bind
Fix a possible crash on my_free() due to the use of strdup() versus
my_strdup(), and a memory leak.
Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
-rw-r--r-- | client/mysqltest.cc | 5 | ||||
-rw-r--r-- | mysql-test/suite/galera/disabled.def | 2 | ||||
-rw-r--r-- | mysql-test/suite/galera/r/galera_bf_abort_ps_bind.result | 1 | ||||
-rw-r--r-- | mysql-test/suite/galera/t/galera_bf_abort_ps_bind.test | 2 | ||||
m--------- | wsrep-lib | 0 |
5 files changed, 8 insertions, 2 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 814c07ba60f..0f910d00927 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -8535,7 +8535,10 @@ void run_prepare_stmt(struct st_connection *cn, struct st_command *command, cons separate string */ if (!disable_warnings) + { append_warnings(&ds_prepare_warnings, mysql); + dynstr_free(&ds_prepare_warnings); + } end: DBUG_VOID_RETURN; } @@ -8611,7 +8614,7 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command, else { ps_params[i].buffer_type= MYSQL_TYPE_STRING; - ps_params[i].buffer= strdup(p); + ps_params[i].buffer= my_strdup(p, MYF(MY_WME)); ps_params[i].buffer_length= (unsigned long)strlen(p); } } diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 6db86abaa3b..6e8ee8e17a4 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -36,4 +36,4 @@ partition : MDEV-19958 Galera test failure on galera.partition query_cache: MDEV-15805 Test failure on galera.query_cache versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch galera_bf_abort_at_after_statement : Unstable -galera_bf_abort_ps_bind : MDEV-28193 Galera test failure on galera_bf_abort_ps_bind + diff --git a/mysql-test/suite/galera/r/galera_bf_abort_ps_bind.result b/mysql-test/suite/galera/r/galera_bf_abort_ps_bind.result index adc7da58eae..02f4dd25f7c 100644 --- a/mysql-test/suite/galera/r/galera_bf_abort_ps_bind.result +++ b/mysql-test/suite/galera/r/galera_bf_abort_ps_bind.result @@ -28,6 +28,7 @@ PS_execute; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction PS_execute; commit; +PS_close; select * from t; i j 1 node2 diff --git a/mysql-test/suite/galera/t/galera_bf_abort_ps_bind.test b/mysql-test/suite/galera/t/galera_bf_abort_ps_bind.test index a840f612a82..072a68fc79d 100644 --- a/mysql-test/suite/galera/t/galera_bf_abort_ps_bind.test +++ b/mysql-test/suite/galera/t/galera_bf_abort_ps_bind.test @@ -53,6 +53,8 @@ update t set j='node2' where i=1; --PS_execute commit; +--PS_close + select * from t; drop table t; diff --git a/wsrep-lib b/wsrep-lib -Subproject edd141127c11d78ef073f9f3ca61708821f20b3 +Subproject 23fb8624624c9144c77f3874647fa0f7394b0aa |