Fix prepare stmt problems when use slave in trans

This commit is contained in:
Bin Wang 2021-02-10 14:13:01 +08:00 committed by GitHub
parent 2d3fe357f8
commit cd14f39e20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -603,6 +603,12 @@ process_trans_query(network_mysqld_con *con)
} else if (sql_context_is_autocommit_on(context)) {
if (con->is_in_transaction) {
con->server_in_tran_and_auto_commit_received = 1;
if (con->multiple_server_mode) {
if (!proxy_get_backend_ndx(con, BACKEND_TYPE_RW, FALSE)) {
g_critical("%s:serious error when change from slave to master", G_STRLOC);
return PROXY_NO_CONNECTION;
}
}
}
con->is_auto_commit = 1;
con->is_auto_commit_trans_buffered = 0;