[MDEV-28405] main.information_schema_tables fails sporadically with ER_NEED_REPREPARE or extra warning Created: 2022-04-24  Updated: 2022-06-24  Resolved: 2022-04-25

Status: Closed
Project: MariaDB Server
Component/s: Information Schema, Tests
Affects Version/s: 10.2
Fix Version/s: 10.2.44, 10.3.35, 10.4.25, 10.5.16, 10.6.8, 10.7.4, 10.8.3

Type: Bug Priority: Blocker
Reporter: Elena Stepanova Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None


 Description   

Since the commit where it was added, main.information_schema_tables fails sporadically in buildbot and outside.

With ps-protocol it's easily reproducible, run the test with --repeat, it fails within a few attempts:

main.information_schema_tables           [ fail ]
        Test ended at 2022-04-24 21:28:02
 
CURRENT_TEST: main.information_schema_tables
mysqltest: At line 28: query 'SELECT v.* FROM v JOIN INFORMATION_SCHEMA.TABLES WHERE DATA_LENGTH = -1' failed: 1615: Prepared statement needs to be re-prepared
 
The result from queries just before the failure was:
< snip >
#
#
# MDEV-25243 ASAN heap-use-after-free in Item_func_sp::execute_impl upon concurrent view DDL and I_S query with view and function
#
# The originally reported non-deterministic test.
# It did not fail reliably on every run.
CREATE TABLE t (a INT);
INSERT INTO t VALUES (1),(2);
CREATE FUNCTION f(b INT) RETURNS INT RETURN 1;
CREATE VIEW v AS SELECT f(SUM(a)) FROM t;
connect  con1,localhost,root,,test;
LOOP
CREATE OR REPLACE VIEW vv AS SELECT 1;
END LOOP $
connection default;
SELECT v.* FROM v JOIN INFORMATION_SCHEMA.TABLES WHERE DATA_LENGTH = -1;

In was also seen to fail in buildbot in the normal mode, but it seems much less likely:

main.information_schema_tables           w3 [ fail ]
        Test ended at 2022-04-24 10:46:58
 
CURRENT_TEST: main.information_schema_tables
--- /mnt/buildbot/build/mariadb-10.2.44/mysql-test/r/information_schema_tables.result	2022-04-24 09:49:39.000000000 -0400
+++ /mnt/buildbot/build/mariadb-10.2.44/mysql-test/r/information_schema_tables.reject	2022-04-24 10:46:58.795856264 -0400
@@ -21,6 +21,8 @@
 disconnect con1;
 connection default;
 DROP VIEW IF EXISTS vv;
+Warnings:
+Note	1051	Unknown table 'test.vv'
 DROP VIEW v;
 DROP FUNCTION f;
 DROP TABLE t;
 
mysqltest: Result length mismatch


Generated at Thu Feb 08 10:00:29 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.