[Bug]: Prepared SHOW TABLES/TABLE STATUS keeps stale plan after database becomes a subscription
Los mantenedores suelen responder en 1 día
@matrix-meow ya está trabajando en esto.
Desde el 27/11/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Is there an existing issue for the same bug?
- I have checked the existing issues.
Searched open and closed issues for prepared SHOW TABLES/TABLE STATUS, subscription databases, stale plans, and publication lifecycle. #20596/#20584 cover direct SHOW TABLE STATUS errors for subscription databases, and #30948 covers a zombie database after DROP PUBLICATION. In this reproduction direct and fresh statements both work; only the old prepared statement is stale.
Branch Name
main
Commit ID
c0cef5c9cce2164fedd201c188bfffe4d2d09a96
A read-only check of main snapshot 9bf005bfcd06ef722351bccd9c9a59833ce2b5bd found the relevant PREPARE/SHOW function bodies unchanged. Runtime reproduction is against the commit above.
Other Environment Information
- Hardware parameters: single-CN local deployment
- OS type: macOS
- Others: two subscriber sessions plus the sys publication owner; direct SQL and fresh PREPARE are the correctness controls
Actual Behavior
When an ordinary database is dropped and replaced by a same-name subscription database, old prepared SHOW TABLES and SHOW TABLE STATUS handles continue using the old ordinary-database plan and return empty result sets. Direct SHOW and freshly prepared statements in the same session both return the published table.
Expected Behavior
Changing the database identity or subscription route should invalidate and rebuild the prepared statement. At minimum, old EXECUTE should see the same current published table as direct SHOW and a fresh PREPARE, rather than silently returning an empty set.
Steps to Reproduce
-- As sys:root
CREATE DATABASE pub_db;
CREATE TABLE pub_db.pub_t(id INT PRIMARY KEY);
CREATE ACCOUNT sub ADMIN_NAME='root' IDENTIFIED BY '111';
CREATE PUBLICATION pub DATABASE pub_db TABLE pub_t ACCOUNT sub;
-- Open sessions S1 and S2 as sub:root
-- S1
CREATE DATABASE home_db;
CREATE DATABASE alias;
CREATE TABLE alias.local_t(id INT PRIMARY KEY);
USE home_db;
PREPARE p_tables FROM 'SHOW TABLES FROM alias';
PREPARE p_status FROM 'SHOW TABLE STATUS FROM alias';
EXECUTE p_tables; -- local_t
EXECUTE p_status; -- local_t
-- S2, with autocommit enabled
DROP DATABASE alias;
CREATE DATABASE alias FROM sys PUBLICATION pub;
-- S1
EXECUTE p_tables; -- actual: success, zero rows
EXECUTE p_status; -- actual: success, zero rows
The initial executions intentionally warm both prepared-plan reuse paths before the cross-session database replacement.
Controls
In S1 immediately after the stale executions:
SHOW TABLES FROM alias; -- pub_t
SHOW TABLE STATUS FROM alias; -- pub_t
PREPARE fresh_tables FROM 'SHOW TABLES FROM alias';
EXECUTE fresh_tables; -- pub_t
PREPARE fresh_status FROM 'SHOW TABLE STATUS FROM alias';
EXECUTE fresh_status; -- pub_t
Thus the subscription is not empty and direct subscription metadata handling is working. Two independent MatrixOne processes reproduced the complete old/direct/fresh comparison in two 31-event runs, including successful cleanup of the subscription database, publication, and temporary account.
Additional information
buildShowTables and buildShowTableStatus bake the database route into their rewritten queries at plan-build time. After the ordinary-to-subscription transition, the old prepared plans retain the ordinary-database route, while fresh plans resolve the current subscription metadata. The database identity/subscription change does not invalidate those old plans.
- Lenguaje dominante
- Go
- Estrellas
- 1.9k
- Forks
- 312
- Merge medio
- 21 h 57 min
- PR fusionados (30 d)
- 730
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de matrixorigin/matrixone
-
kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
matrixorigin/matrixone#33363 ·
Los mantenedores suelen responder en 1 día
-
kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
matrixorigin/matrixone#33362 ·
Los mantenedores suelen responder en 1 día
-
SLEEP rejects NULL and negative durations that MySQL acceptsPosiblemente ocupada @XuPeng-SH la tomó hace 7 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
matrixorigin/matrixone#32653 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: TestChangeWatchProxy loses its first tenant connection during PingContext in Ubuntu CIPosiblemente ocupada @XuPeng-SH la tomó hoy. Abiertokind/bug needs-triage
matrixorigin/matrixone#33371 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Bug]: TestDaemonClaimSQLRoundTrip exhausts its shared deadline during the stale claim update in Ubuntu CIPosiblemente ocupada @XuPeng-SH la tomó hoy. Abiertokind/bug needs-triage
matrixorigin/matrixone#33370 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de matrixorigin/matrixone
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
area/ui-schema good first issue type/bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 4 días
-
A vessel you are not flying should draw dim grey, orbit and arrow (ADR 0041), not in its own colourAbiertoready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
jasonfen/terminal-space-program#1020 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
router-for-me/CLIProxyAPI#8573 ·
Los mantenedores suelen responder en 9 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
sipeed/picoclaw#3477 · 1 comentario ·
Los mantenedores suelen responder en 1 día