Skip to content

[Bug]: Invisible column clauses are silently ignored #26860

Closed

Description

@Ariznawlll

Version

main at 0676200da47052659cf46ad9e22d67ab9654e393

Environment

Local standalone mo-service (1 CN / 1 TN / 1 Log service), MySQL text protocol.

Reproduction

create database repro;
use repro;

create table t(id int primary key, a int, b int default 30);
insert into t values(1,10,20);

alter table t alter column b set invisible;
show create table t;
select * from t;
insert into t values(2,11);

The CREATE TABLE form is also accepted:

create table t2(id int primary key, secret int invisible);

Actual result

Both visibility clauses report success but are silently ignored:

  • SHOW CREATE TABLE and DESC contain no invisible metadata.
  • SELECT * still returns b/secret.
  • An implicit INSERT still requires values for all columns, so insert into t values(2,11) fails with a column-count mismatch.

The ALTER no-op was reproduced on a normal indexed column, a table's only column, a primary-key column, and a foreign-key column. Explicit selection and FK enforcement continue only because the columns never become invisible.

Expected result

Invisible-column semantics should be applied, or the unsupported syntax should be rejected explicitly. A successful statement must not be a silent no-op.

Suspected cause

The parser emits AlterColumnOptionSetVisibility, but AlterColumn handles only SET DEFAULT and DROP DEFAULT. The visibility branch does not update any column metadata.

Activity

  1. added this to the MO-202608 milestone on Aug 9, 2026
  2. added
    kind/bug
    on Aug 9, 2026
  3. added theissue type on Aug 9, 2026
  4. added
    severity/s0
    and removed on Aug 9, 2026
  5. added
    ai-easy
    on Aug 11, 2026
  6. slyunnn commented on Aug 13, 2026

    @slyunnn

    Regression and Extended Verification for #26860 (2026-08-13)

    This verification is based on the fix in PR #26909. The fix rejects unsupported INVISIBLE column clauses explicitly,
    preventing statements from succeeding while silently leaving columns visible.

    Verification Environment

    What Was Covered

    Scenario Status Result
    Original reproduction: ALTER COLUMN ... SET INVISIBLE OK Returns ERROR 20105: not supported: invisible columns; no silent success.
    Post-error schema and data state OK SHOW CREATE TABLE remains unchanged and SELECT * continues to return the original visible columns.
    Original implicit INSERT shape OK INSERT INTO t VALUES(2,11) returns ERROR 1136, because the rejected ALTER leaves three visible columns.
    Explicit INSERT after rejected ALTER OK INSERT INTO t(id,a) VALUES(2,11) succeeds and applies the default value for b.
    Happy path: VISIBLE in CREATE and ALTER ... SET VISIBLE OK Supported visible-column syntax continues to work.
    Unhappy path: CREATE / ADD / MODIFY / CHANGE with INVISIBLE OK Each form returns ERROR 20105.
    Indexed and foreign-key columns OK SET INVISIBLE is rejected and index/FK metadata remains unchanged.
    Boundary: one-column primary-key table OK SET VISIBLE succeeds; SET INVISIBLE is rejected and the table remains usable.
    MySQL compatibility comparison Not covered MatrixOne intentionally rejects unsupported invisible-column syntax; implementing MySQL invisible-column semantics is outside this issue’s acceptance scope.

    Findings

    • The original issue is not reproducible on the verified latest main.

    • Unsupported INVISIBLE clauses are explicitly rejected instead of being accepted as silent no-ops.

    • Rejected statements do not mutate the table schema, indexes, foreign keys, or existing data.

    • The ERROR 1136 result for the original implicit INSERT is expected: the rejected ALTER does not make the defaulted
      column invisible.

    • No unrelated product failures were observed.

    • The behavioral difference from MySQL invisible-column support is not considered a defect for this issue, because
      explicit rejection is within the accepted fix scope.

    MOTR / BVT Coverage

    Added regression files:

    • suites/14_issue_regression/t/issue_26860_reject_invisible_columns.test
    • suites/14_issue_regression/r/issue_26860_reject_invisible_columns.result

    The test retains the original reproduction and adds coverage for all repaired DDL entry points, supported VISIBLE
    controls, rejected-operation state invariants, indexed/FK scenarios, and a one-column boundary case.

    Validation results:

    ./motr --record 14_issue_regression.issue_26860_reject_invisible_columns -v
    PASS: 29/29 statements

    ./motr 14_issue_regression.issue_26860_reject_invisible_columns -v
    PASS: 29/29 statements

    Final Conclusion

    Fixed. The original silent no-op is no longer reproducible on the latest main. Unsupported INVISIBLE column
    clauses are now explicitly rejected with ERROR 20105: not supported: invisible columns, and rejected statements
    leave table metadata unchanged.

    The MOTR regression was recorded and replayed successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai-easykind/bugseverity/s0

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions