Skip to content

Commit 272625d

Browse files
committed
fix Spider executing one by one commands before SQL
1 parent c34deb4 commit 272625d

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

storage/spider/spd_db_conn.cc

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,8 @@ int spider_db_conn_queue_action(
450450
(!conn->queued_autocommit_val && conn->autocommit != 0)
451451
) &&
452452
!conn->db_conn->set_autocommit_in_bulk_sql() &&
453-
(error_num = spider_dbton[conn->dbton_id].db_util->
454-
append_autocommit(&sql_str, conn->queued_autocommit_val))
453+
(error_num = conn->db_conn->
454+
set_autocommit(conn->queued_autocommit_val, (int *) conn->need_mon))
455455
) {
456456
DBUG_RETURN(error_num);
457457
}
@@ -462,35 +462,38 @@ int spider_db_conn_queue_action(
462462
(!conn->queued_sql_log_off_val && conn->sql_log_off != 0)
463463
) &&
464464
!conn->db_conn->set_sql_log_off_in_bulk_sql() &&
465-
(error_num = spider_dbton[conn->dbton_id].db_util->
466-
append_sql_log_off(&sql_str, conn->queued_sql_log_off_val))
465+
(error_num = conn->db_conn->
466+
set_sql_log_off(conn->queued_sql_log_off_val, (int *) conn->need_mon))
467467
) {
468468
DBUG_RETURN(error_num);
469469
}
470470
if (
471471
conn->queued_wait_timeout &&
472472
conn->queued_wait_timeout_val != conn->wait_timeout &&
473473
!conn->db_conn->set_wait_timeout_in_bulk_sql() &&
474-
(error_num = spider_dbton[conn->dbton_id].db_util->
475-
append_wait_timeout(&sql_str, conn->queued_wait_timeout_val))
474+
(error_num = conn->db_conn->
475+
set_wait_timeout(conn->queued_wait_timeout_val,
476+
(int *) conn->need_mon))
476477
) {
477478
DBUG_RETURN(error_num);
478479
}
479480
if (
480481
conn->queued_sql_mode &&
481482
conn->queued_sql_mode_val != conn->sql_mode &&
482483
!conn->db_conn->set_sql_mode_in_bulk_sql() &&
483-
(error_num = spider_dbton[conn->dbton_id].db_util->
484-
append_sql_mode(&sql_str, conn->queued_sql_mode_val))
484+
(error_num = conn->db_conn->
485+
set_sql_mode(conn->queued_sql_mode_val,
486+
(int *) conn->need_mon))
485487
) {
486488
DBUG_RETURN(error_num);
487489
}
488490
if (
489491
conn->queued_time_zone &&
490492
conn->queued_time_zone_val != conn->time_zone &&
491493
!conn->db_conn->set_time_zone_in_bulk_sql() &&
492-
(error_num = spider_dbton[conn->dbton_id].db_util->
493-
append_time_zone(&sql_str, conn->queued_time_zone_val))
494+
(error_num = conn->db_conn->
495+
set_time_zone(conn->queued_time_zone_val,
496+
(int *) conn->need_mon))
494497
) {
495498
DBUG_RETURN(error_num);
496499
}

0 commit comments

Comments
 (0)