Skip to content

[seekdb][DDL] Fix crash on ALTER TABLE ADD for generated timestamp column - #1322

Merged
hnwyllmm merged 1 commit into
masterfrom
issue/2026082000118399861
Aug 21, 2026
Merged

[seekdb][DDL] Fix crash on ALTER TABLE ADD for generated timestamp column#1322
hnwyllmm merged 1 commit into
masterfrom
issue/2026082000118399861

Conversation

@hnwyllmm

Copy link
Copy Markdown
Member

Task Description

Fix a crash (SIGSEGV) and client error (ERROR 2013) that occurs in seekdb 1.4 when executing ALTER TABLE ADD to add a generated timestamp column.

Solution Description

The regression was introduced by commit 2bf907c560fa (remove oracle), which modified the short-circuit condition for timestamp columns. This inadvertently allowed generated columns to enter the ordinary timestamp default-value handling path, leading to the crash.

The fix skips the timestamp default-value resolution specifically for generated columns added via ALTER TABLE. This preserves the generated expression as the original default value while maintaining correct behavior for ordinary timestamp columns.

Passed Regressions

  • Built seekdb from the issue branch and executed the following test:
    CREATE TABLE t1 (c1 varchar(100), c2 timestamp AS (c1));
    ALTER TABLE t1 ADD COLUMN c3 timestamp AS (c1);
  • Verified via DESC and SHOW CREATE TABLE that c3 is correctly defined as a timestamp VIRTUAL GENERATED column.
  • Confirmed the observer process remained reachable after the operation.
  • A regression test for adding a normal timestamp column via ALTER TABLE ADD also passed.

Upgrade Compatibility

No compatibility impact. The change only restores the correct handling for generated columns and does not alter the default value behavior of ordinary timestamp columns.

Other Information

  • The MR contains one focused commit.
  • An untracked local file named 2 is unrelated and has been excluded from the changes.
  • Related internal link: DIMA-2026082000118399861

Release Note

Fixed a crash that could occur when using ALTER TABLE ADD to add a generated timestamp column.

@hnwyllmm
hnwyllmm merged commit 33bec38 into oceanbase:master Aug 21, 2026
1 check passed
@hnwyllmm
hnwyllmm deleted the issue/2026082000118399861 branch August 21, 2026 03:12
@hnwyllmm

Copy link
Copy Markdown
Member Author

The mapping Dima issue is [seekdb 1.4: ALTER TABLE ADD generated column (timestamp expression) causes observer SIGSEGV crash (regression from 1.3 to 1.4)]

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants