Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Branch Name
main
Commit ID
Other Environment Information
- MatrixOne was built from the commit above and started locally with etc/launch/launch.toml.
- MySQL comparison version: 8.0.45.
- Every ALTER operation was repeated on three independently created temporary tables.Actual Behavior
MatrixOne rejects temporary-table ALTER operations that change columns or the
table name:
ADD COLUMN;DROP COLUMN;MODIFY COLUMN;RENAME COLUMN;RENAME TO.
Each operation returns:
alter table for temporary table is not yet implemented
The limitation is narrower than all temporary-table DDL. In the same build,
the following operations work correctly:
- create, read, write, and transaction rollback;
- session-local shadowing of a same-name permanent table;
- automatic removal when the owning connection closes;
CREATE TEMPORARY TABLE ... AS SELECT;CREATE INDEXon a temporary table;ALTER TABLE ... ADD INDEXon a temporary table.
Expected Behavior
MatrixOne should alter a temporary table's columns and name within its owning
session, as MySQL 8.0.45 does. The change should remain session-local and should
not affect a same-name permanent table or another session.
Steps to Reproduce
CREATE DATABASE codex_temp_alter_0907;
USE codex_temp_alter_0907;
CREATE TEMPORARY TABLE tmp_add(id INT PRIMARY KEY, v INT);
ALTER TABLE tmp_add ADD COLUMN extra INT DEFAULT 7;
SHOW CREATE TABLE tmp_add;
CREATE TEMPORARY TABLE tmp_drop(id INT PRIMARY KEY, v INT);
ALTER TABLE tmp_drop DROP COLUMN v;
SHOW CREATE TABLE tmp_drop;
CREATE TEMPORARY TABLE tmp_modify(id INT PRIMARY KEY, v INT);
ALTER TABLE tmp_modify MODIFY COLUMN v BIGINT;
SHOW CREATE TABLE tmp_modify;
CREATE TEMPORARY TABLE tmp_rename_col(id INT PRIMARY KEY, v INT);
ALTER TABLE tmp_rename_col RENAME COLUMN v TO value_col;
SHOW CREATE TABLE tmp_rename_col;
CREATE TEMPORARY TABLE tmp_rename_table(id INT PRIMARY KEY, v INT);
ALTER TABLE tmp_rename_table RENAME TO tmp_renamed;
SHOW CREATE TABLE tmp_renamed;
-- Nearby controls that MatrixOne supports.
CREATE TEMPORARY TABLE tmp_add_idx(id INT PRIMARY KEY, v INT);
ALTER TABLE tmp_add_idx ADD INDEX idx_v(v);
SHOW CREATE TABLE tmp_add_idx;
CREATE TEMPORARY TABLE tmp_create_idx(id INT PRIMARY KEY, v INT);
CREATE INDEX idx_v ON tmp_create_idx(v);
SHOW CREATE TABLE tmp_create_idx;
CREATE TEMPORARY TABLE tmp_ctas AS SELECT 1 AS id, 10 AS v;
SELECT * FROM tmp_ctas;Additional information
The general ALTER builder has an explicit temporary-table NYI guard in
pkg/sql/plan/build_alter_table.go. Index-specific DDL takes a different path
and already succeeds.
This is a remaining temporary-table capability gap after closed feature issue
#23251; that issue covered initial temporary-table implementation rather than
column and rename ALTER operations.
Activity
fix: support altering temporary table columns and names (#28324)
slyunnn commentedon Sep 9, 2026
Regression and extended verification for #28303 (2026-09-09)
Verification Environment
origin/mainatf0c31cd4b830be32442cf329e0a3fb08aa9c16c3—feat(load): add bounded Arrow IPC ingestion path (#28145).fix: support altering temporary table columns and names, merged asad225722a0bc0d0de1e7fdde8ca2cb38807c1a7b. The merge commit is an ancestor of the baseline.mo-servicehosts LOG/HAKeeper, one TN, and one CN. No Proxy and no second CN were used.127.0.0.1:6001; TN127.0.0.1:19000; Log/HAKeeper127.0.0.1:32001.mysqlCLI, PyMySQL, and MOTR/PyMySQL over MySQL wire protocol via TCP to127.0.0.1:6001.What Was Covered
ALTER TABLE ... ADD COLUMN,DROP COLUMN,MODIFY COLUMN,RENAME COLUMN, andRENAME TO.INTtoBIGINTaccepts2147483648, rows survive every successful ALTER, and the renamed column/table remain queryable.tmp_altershadows only its owner connection; same-name permanenttmp_alterandtmp_renamedtables remain unchanged in the other connection before and after the temporary rename.BIGINT2147483648toTINYINTreturnsERROR 1690, while the original temporary table and all3rows remain available.ERROR 1050; the source alias and rows remain intact.BEGINis visible beforeROLLBACK; afterROLLBACK, the old name and original schema/data return and the temporary transaction alias returnsERROR 1146.ALTER TABLE ... ADD INDEXon a temporary table remains usable.mo_catalog.8.0.45comparison and automatic temporary-table removal after connection close; these are unchanged controls, not modified by PR fix: support altering temporary table columns and names #28324.Findings
The
mainbaseline contains the fix and no longer rejects the five column/name ALTER forms for temporary tables. The new behavior preserves owner-session scope, rows, defaults, index behavior, and transactional rollback. Failed conversion and name-collision operations preserve the prior temporary relation instead of leaving a partial replacement.Large-data regression is not required. This issue is a session-local DDL/catalog transformation; it does not depend on row count, block/batch boundaries, memory/spill, concurrency, skew, network transfer, or resource scale. Two seeded rows plus one widened
BIGINTvalue are the minimum stable data set that exercises success, null/default preservation, conversion failure, and rollback without adding unrelated CI cost.MOTR / BVT Coverage
suites/14_issue_regression/t/issue_28303_temp_table_alter.testandsuites/14_issue_regression/r/issue_28303_temp_table_alter.result.38statements with0failures.test/issue-28303-temp-table-alter, commit1d113a5. No issue-specific PR was created.Final Conclusion
Fixed. The current
maincontains the associated fix, and the original scenario plus happy-path, error-preservation, transaction, boundary, session-scope, and index-control verification pass. Large-data regression is not needed for the reasons above.fix: support altering temporary table columns and names (matrixorigin…
fix: support altering temporary table columns and names (matrixorigin…
fix: support altering temporary table columns and names (matrixorigin…
slyunnn commentedon Sep 18, 2026
Regression and extended verification for #28303 (2026-09-18)
Verification Environment
eed6ff8727454fe1ec7ea8cd8d368e08c1deefbd—fix: preserve numeric source types at integer assignment boundaries (#29061).ad225722a0bc0d0de1e7fdde8ca2cb38807c1a7b—fix: temporary table DDL limitations (#28324).2 CN / 1 TN / 1 Log service / Proxy. Proxy6001, CN116001, and CN216002were each reachable.mysql; the DDL sequence was sent as one semicolon-separatedCOM_QUERYrequest.What Was Covered
CREATE TEMPORARY TABLE,INSERT,ALTER ... ADD COLUMN,DROP COLUMN,MODIFY COLUMN,RENAME COLUMN,RENAME TO, and a final aggregate assertion.COUNT(*) = 1 AND MAX(value_col) = 10assertion returned1afterFROM t_renamed.6001, CN116001, and CN216002.test/distributed/cases/temporary/temporary_table_limitation.sqlpassed with130successful,0failed, and7ignored checks.ERROR 1054was reproduced only when the test SQL omittedFROM t_renamed; this is normal SQL name resolution, not a MatrixOne catalog-visibility regression.Findings
The recheck found no regression in #28303 on the latest
main. The previously reported1054came from an invalid aggregate query with no table source. After addingFROM t_renamed, the full multi-statement sequence passed consistently.Large-data regression is not needed: this issue concerns DDL metadata and session behavior, not row count, block/batch boundaries, memory/spill, concurrency, data skew, or network/resource scale.
MOTR / BVT Coverage
No MOTR change was added because existing BVT coverage passed and no product defect or missing stable regression scenario remained after correcting the validation SQL. No new issue branch, commit, or PR is required.
Final Conclusion
Fixed — #28303 remains fixed on the verified latest
main; no new MatrixOne or MOTR change is required.