Skip to content

Commit 103cb05

Browse files
committed
Fix reconstruct problems for MySQL replay
1 parent a477754 commit 103cb05

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tc_mysql_module.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,20 @@ prepare_for_renew_session(tc_sess_t *s, tc_iph_t *ip, tc_tcph_t *tcp)
226226

227227

228228
static int
229-
proc_when_sess_created(tc_sess_t *s, tc_iph_t *ip, tc_tcph_t *tcp)
229+
proc_when_sess_created(tc_sess_t *s)
230230
{
231-
tc_mysql_session *data = (tc_mysql_session *) tc_pcalloc(s->pool,
232-
sizeof(tc_mysql_session));
231+
tc_mysql_session *data = s->data;
233232

234-
if (data) {
235-
s->data = data;
233+
if (data == NULL) {
234+
data = (tc_mysql_session *) tc_pcalloc(s->pool,
235+
sizeof(tc_mysql_session));
236+
237+
if (data) {
238+
s->data = data;
239+
}
240+
241+
} else {
242+
tc_memzero(data, sizeof(tc_mysql_session));
236243
}
237244

238245
return TC_OK;

0 commit comments

Comments
 (0)