Skip to content

Commit 51c93d9

Browse files
committed
Replaced last_insert_rowid() with MAX(...) because last_insert_rowid() is specific to a database connection, and random modifications are performed by monitoring thread
1 parent c48c331 commit 51c93d9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/tap/tests/mysql-reg_test_4867_query_rules-t.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ int main() {
388388
if (!res && mysql_field_count(proxysql_admin) == 0) {
389389
mysql_free_result(res);
390390
//rule_ids[i] = mysql_insert_id(proxysql_admin); // not supported in admin
391-
MYSQL_QUERY_ON_ERR_CLEANUP(proxysql_admin, "SELECT last_insert_rowid()");
391+
MYSQL_QUERY_ON_ERR_CLEANUP(proxysql_admin, "SELECT MAX(rule_id) FROM mysql_query_rules");
392392
MYSQL_ROW row;
393393
res = mysql_store_result(proxysql_admin);
394394
while ((row = mysql_fetch_row(res))) {
@@ -412,7 +412,7 @@ int main() {
412412
MYSQL_QUERY_ON_ERR_CLEANUP(proxysql_admin, query);
413413
MYSQL_RES* res = mysql_store_result(proxysql_admin);
414414
if (!res || mysql_num_rows(res) == 0) {
415-
fprintf(stderr, "Rule %d not found", rule_ids[i]);
415+
fprintf(stderr, "Rule %d not found\n", rule_ids[i]);
416416
if (res) mysql_free_result(res);
417417
continue;
418418
}
@@ -437,7 +437,7 @@ int main() {
437437
}
438438
MYSQL_RES* res = mysql_store_result(proxysql_admin);
439439
if (!res || mysql_num_rows(res) == 0) {
440-
fprintf(stderr, "Rule %d not found", rule_ids[i]);
440+
fprintf(stderr, "Rule %d not found\n", rule_ids[i]);
441441
if (res) mysql_free_result(res);
442442
continue;
443443
}

0 commit comments

Comments
 (0)