[Bug]: Prepared SHOW TABLES/TABLE STATUS keeps stale plan after database becomes a subscription
メンテナーはふだん 1 日以内に返信
@matrix-meow がすでに取り組んでいます。
2026年11月27日 から。
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- Go
- スター
- 1.9k
- フォーク
- 312
- 平均マージ
- 21時間 57分
- マージ済み PR(30日)
- 730
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
matrixorigin/matrixone のほかの issue
-
kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
matrixorigin/matrixone#33363 ·
メンテナーはふだん 1 日以内に返信
-
kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
matrixorigin/matrixone#33362 ·
メンテナーはふだん 1 日以内に返信
-
SLEEP rejects NULL and negative durations that MySQL accepts対応中かも @XuPeng-SH が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
matrixorigin/matrixone#32653 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: TestChangeWatchProxy loses its first tenant connection during PingContext in Ubuntu CI対応中かも @XuPeng-SH が今日担当しました。 オープンkind/bug needs-triage
matrixorigin/matrixone#33371 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: TestDaemonClaimSQLRoundTrip exhausts its shared deadline during the stale claim update in Ubuntu CI対応中かも @XuPeng-SH が今日担当しました。 オープンkind/bug needs-triage
matrixorigin/matrixone#33370 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
matrixorigin/matrixone の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
area/ui-schema good first issue type/bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 4 日以内に返信
-
A vessel you are not flying should draw dim grey, orbit and arrow (ADR 0041), not in its own colourオープンready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
jasonfen/terminal-space-program#1020 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
router-for-me/CLIProxyAPI#8573 ·
メンテナーはふだん 9 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
sipeed/picoclaw#3477 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信