[Bug]: Prepared SHOW TABLES/TABLE STATUS keeps stale plan after database becomes a subscription
I maintainer di solito rispondono entro 1 giorno
@matrix-meow ci sta già lavorando.
Dal 27/11/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- Go
- Stelle
- 1.9k
- Fork
- 312
- Merge medio
- 21h 57m
- PR unite (30g)
- 730
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di matrixorigin/matrixone
-
kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
matrixorigin/matrixone#33363 ·
I maintainer di solito rispondono entro 1 giorno
-
kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
matrixorigin/matrixone#33362 ·
I maintainer di solito rispondono entro 1 giorno
-
SLEEP rejects NULL and negative durations that MySQL acceptsForse già presa @XuPeng-SH l’ha presa 7 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
matrixorigin/matrixone#32653 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: TestChangeWatchProxy loses its first tenant connection during PingContext in Ubuntu CIForse già presa @XuPeng-SH l’ha presa oggi. Apertakind/bug needs-triage
matrixorigin/matrixone#33371 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: TestDaemonClaimSQLRoundTrip exhausts its shared deadline during the stale claim update in Ubuntu CIForse già presa @XuPeng-SH l’ha presa oggi. Apertakind/bug needs-triage
matrixorigin/matrixone#33370 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di matrixorigin/matrixone
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
area/ui-schema good first issue type/bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 4 giorni
-
A vessel you are not flying should draw dim grey, orbit and arrow (ADR 0041), not in its own colourApertaready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
jasonfen/terminal-space-program#1020 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
router-for-me/CLIProxyAPI#8573 ·
I maintainer di solito rispondono entro 9 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sipeed/picoclaw#3477 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno