Skip to content

Commit d59b16d

Browse files
Daniele SciasciaJan Lindström
authored andcommitted
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>
1 parent 088b37b commit d59b16d

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

client/mysqltest.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8535,7 +8535,10 @@ void run_prepare_stmt(struct st_connection *cn, struct st_command *command, cons
85358535
separate string
85368536
*/
85378537
if (!disable_warnings)
8538+
{
85388539
append_warnings(&ds_prepare_warnings, mysql);
8540+
dynstr_free(&ds_prepare_warnings);
8541+
}
85398542
end:
85408543
DBUG_VOID_RETURN;
85418544
}
@@ -8611,7 +8614,7 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
86118614
else
86128615
{
86138616
ps_params[i].buffer_type= MYSQL_TYPE_STRING;
8614-
ps_params[i].buffer= strdup(p);
8617+
ps_params[i].buffer= my_strdup(p, MYF(MY_WME));
86158618
ps_params[i].buffer_length= (unsigned long)strlen(p);
86168619
}
86178620
}

mysql-test/suite/galera/disabled.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ partition : MDEV-19958 Galera test failure on galera.partition
3636
query_cache: MDEV-15805 Test failure on galera.query_cache
3737
versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch
3838
galera_bf_abort_at_after_statement : Unstable
39-
galera_bf_abort_ps_bind : MDEV-28193 Galera test failure on galera_bf_abort_ps_bind
39+

mysql-test/suite/galera/r/galera_bf_abort_ps_bind.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ PS_execute;
2828
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
2929
PS_execute;
3030
commit;
31+
PS_close;
3132
select * from t;
3233
i j
3334
1 node2

mysql-test/suite/galera/t/galera_bf_abort_ps_bind.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ update t set j='node2' where i=1;
5353
--PS_execute
5454
commit;
5555

56+
--PS_close
57+
5658
select * from t;
5759

5860
drop table t;

0 commit comments

Comments
 (0)