From 51c93d987e441e49c6c8b5685c5bb5e52d5c86fb Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Wed, 9 Apr 2025 15:45:53 +0500 Subject: [PATCH] Replaced last_insert_rowid() with MAX(...) because last_insert_rowid() is specific to a database connection, and random modifications are performed by monitoring thread --- test/tap/tests/mysql-reg_test_4867_query_rules-t.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/tap/tests/mysql-reg_test_4867_query_rules-t.cpp b/test/tap/tests/mysql-reg_test_4867_query_rules-t.cpp index 1588a9751..a3cffc435 100644 --- a/test/tap/tests/mysql-reg_test_4867_query_rules-t.cpp +++ b/test/tap/tests/mysql-reg_test_4867_query_rules-t.cpp @@ -388,7 +388,7 @@ int main() { if (!res && mysql_field_count(proxysql_admin) == 0) { mysql_free_result(res); //rule_ids[i] = mysql_insert_id(proxysql_admin); // not supported in admin - MYSQL_QUERY_ON_ERR_CLEANUP(proxysql_admin, "SELECT last_insert_rowid()"); + MYSQL_QUERY_ON_ERR_CLEANUP(proxysql_admin, "SELECT MAX(rule_id) FROM mysql_query_rules"); MYSQL_ROW row; res = mysql_store_result(proxysql_admin); while ((row = mysql_fetch_row(res))) { @@ -412,7 +412,7 @@ int main() { MYSQL_QUERY_ON_ERR_CLEANUP(proxysql_admin, query); MYSQL_RES* res = mysql_store_result(proxysql_admin); if (!res || mysql_num_rows(res) == 0) { - fprintf(stderr, "Rule %d not found", rule_ids[i]); + fprintf(stderr, "Rule %d not found\n", rule_ids[i]); if (res) mysql_free_result(res); continue; } @@ -437,7 +437,7 @@ int main() { } MYSQL_RES* res = mysql_store_result(proxysql_admin); if (!res || mysql_num_rows(res) == 0) { - fprintf(stderr, "Rule %d not found", rule_ids[i]); + fprintf(stderr, "Rule %d not found\n", rule_ids[i]); if (res) mysql_free_result(res); continue; }