From 3dcc015d28afb73cdce20965d859955ea9a2b8ee Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Sat, 15 Feb 2025 01:36:36 +0500 Subject: [PATCH] Code cleanup * Removed async_set_autocommit --- include/PgSQL_Connection.h | 6 +-- lib/PgSQL_Connection.cpp | 86 -------------------------------------- 2 files changed, 1 insertion(+), 91 deletions(-) diff --git a/include/PgSQL_Connection.h b/include/PgSQL_Connection.h index 58c69260d..da96c3b75 100644 --- a/include/PgSQL_Connection.h +++ b/include/PgSQL_Connection.h @@ -425,8 +425,6 @@ class PgSQL_Connection_Placeholder { void set_option_cont(short event); #endif // 0 void set_query(char *stmt, unsigned long length); - - int async_set_autocommit(short event, bool); void stmt_prepare_start(); void stmt_prepare_cont(short event); @@ -486,9 +484,7 @@ public: void reset_session_cont(short event); int async_connect(short event); -#if 0 - int async_set_autocommit(short event, bool ac); -#endif // 0 + int async_query(short event, char* stmt, unsigned long length, MYSQL_STMT** _stmt = NULL, stmt_execute_metadata_t* _stmt_meta = NULL); int async_ping(short event); int async_reset_session(short event); diff --git a/lib/PgSQL_Connection.cpp b/lib/PgSQL_Connection.cpp index 8c80a5ac7..6056be8e6 100644 --- a/lib/PgSQL_Connection.cpp +++ b/lib/PgSQL_Connection.cpp @@ -709,48 +709,6 @@ void PgSQL_Connection_Placeholder::process_rows_in_ASYNC_STMT_EXECUTE_STORE_RESU bytes_info.bytes_recv += total_size; } -int PgSQL_Connection_Placeholder::async_set_autocommit(short event, bool ac) { - PROXY_TRACE(); - assert(pgsql); - assert(ret_mysql); - server_status=parent->status; // we copy it here to avoid race condition. The caller will see this - if (IsServerOffline()) - return -1; - - switch (async_state_machine) { - case ASYNC_SET_AUTOCOMMIT_SUCCESSFUL: - unknown_transaction_status = false; - async_state_machine=ASYNC_IDLE; - return 0; - break; - case ASYNC_SET_AUTOCOMMIT_FAILED: - return -1; - break; - case ASYNC_QUERY_END: - case ASYNC_IDLE: - set_autocommit(ac); - async_state_machine=ASYNC_SET_AUTOCOMMIT_START; - default: - handler(event); - break; - } - - // check again - switch (async_state_machine) { - case ASYNC_SET_AUTOCOMMIT_SUCCESSFUL: - unknown_transaction_status = false; - async_state_machine=ASYNC_IDLE; - return 0; - break; - case ASYNC_SET_AUTOCOMMIT_FAILED: - return -1; - break; - default: - return 1; - break; - } - return 1; -} #endif // 0 // This function check if autocommit=0 and if there are any savepoint. @@ -1980,50 +1938,6 @@ void PgSQL_Connection::async_free_result() { new_result = false; } -#if 0 -int PgSQL_Connection::async_set_autocommit(short event, bool ac) { - PROXY_TRACE(); - assert(pgsql_conn); - server_status = parent->status; // we copy it here to avoid race condition. The caller will see this - if (IsServerOffline()) - return -1; - - switch (async_state_machine) { - case ASYNC_SET_AUTOCOMMIT_SUCCESSFUL: - unknown_transaction_status = false; - async_state_machine = ASYNC_IDLE; - return 0; - break; - case ASYNC_SET_AUTOCOMMIT_FAILED: - return -1; - break; - case ASYNC_QUERY_END: - case ASYNC_IDLE: - set_autocommit(ac); - async_state_machine = ASYNC_SET_AUTOCOMMIT_START; - default: - handler(event); - break; - } - - // check again - switch (async_state_machine) { - case ASYNC_SET_AUTOCOMMIT_SUCCESSFUL: - unknown_transaction_status = false; - async_state_machine = ASYNC_IDLE; - return 0; - break; - case ASYNC_SET_AUTOCOMMIT_FAILED: - return -1; - break; - default: - return 1; - break; - } - return 1; -} -#endif // 0 - bool PgSQL_Connection::IsAutoCommit() { bool ret = true; /*if (pgsql) {