From ca991a3889ae36f11c980064e0bc1045a33b43a2 Mon Sep 17 00:00:00 2001 From: "Georgi (Joro) Kodinov" Date: Thu, 16 Jul 2026 15:45:15 +0300 Subject: [PATCH] MDEV-17746: perfschema.dml_threads failed in buildbot with wrong errno The test was trying to update the performance_schema.threads row for the current connection. And if that row was not found or was the same, there's nothing to update hence no update not allowed error. MariaDB has a device to skip calling ha_update_row() if the old and the new records are identical. The connection id is increasing by at least 2 for every test run. Eventually it will hit the constant 12 in the UPDATE and the server will not call ha_update_row() at all and won't get the error. This is not a bug: it's reasonable behavior. Stablizied the test by changing the UPDATE value to connection_id() + const. Co-authored-by: Grok --- mysql-test/suite/perfschema/r/dml_threads.result | 2 +- mysql-test/suite/perfschema/t/dml_threads.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/perfschema/r/dml_threads.result b/mysql-test/suite/perfschema/r/dml_threads.result index c0c7281ba1aee..e464ce18a551c 100644 --- a/mysql-test/suite/perfschema/r/dml_threads.result +++ b/mysql-test/suite/perfschema/r/dml_threads.result @@ -9,7 +9,7 @@ update performance_schema.threads set thread_id=12; ERROR HY000: Invalid performance_schema usage update performance_schema.threads -set thread_id=12 where PROCESSLIST_ID=connection_id(); +set thread_id=connection_id() + 42 where PROCESSLIST_ID=connection_id(); ERROR HY000: Invalid performance_schema usage update performance_schema.threads set instrumented= 'NO' where PROCESSLIST_ID=connection_id(); diff --git a/mysql-test/suite/perfschema/t/dml_threads.test b/mysql-test/suite/perfschema/t/dml_threads.test index f6239d58690de..c6e14e88165b4 100644 --- a/mysql-test/suite/perfschema/t/dml_threads.test +++ b/mysql-test/suite/perfschema/t/dml_threads.test @@ -21,7 +21,7 @@ update performance_schema.threads --error ER_WRONG_PERFSCHEMA_USAGE update performance_schema.threads - set thread_id=12 where PROCESSLIST_ID=connection_id(); + set thread_id=connection_id() + 42 where PROCESSLIST_ID=connection_id(); update performance_schema.threads set instrumented= 'NO' where PROCESSLIST_ID=connection_id();