Repository navigation
Fix segfault in MySQLDump format on CREATE TABLE without column definitions - #126905
Merged
alexey-milovidov merged 2 commits intoOct 23, 2026
Merged
alexey-milovidov merged 2 commits into
alexey-milovidov merged 2 commits into
Conversation
…efinitions `tryToExtractStructureFromCreateQuery` dereferenced the column list, which is missing for `CREATE TABLE ... LIKE`, and the columns, which are missing when the definition list has only indexes or constraints. Such a `CREATE TABLE` now gives no structure, and the structure is inferred from the `INSERT` data. Closes: ClickHouse#126832
Contributor
|
Workflow [PR], commit [56c89ae] Summary: ✅
AI ReviewSummaryThe PR prevents null dereferences when Final VerdictStatus: ✅ Approve |
`tryToExtractStructureFromCreateQuery` reads the `CREATE TABLE` query up to and including its `;`, but `readFirstCreateAndInsertQueries` then called `skipQuery`, discarding the next statement. In real dumps this is the harmless `/*!40101 SET ... */;` comment, but if an `INSERT` immediately follows the `CREATE TABLE`, its rows were silently lost (or `EMPTY_DATA_PASSED` was thrown if it was the only `INSERT`). This affected both the new recovery paths (`CREATE TABLE ... LIKE`, definitions with only indexes or constraints) and regular `CREATE TABLE` with columns. Address review: ClickHouse#126905 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 23, 2026
clickhouse-gh Bot
added a commit
that referenced
this pull request
Oct 23, 2026
Backport #126905 to 26.10: Fix segfault in `MySQLDump` format on `CREATE TABLE` without column definitions
clickhouse-gh Bot
added a commit
that referenced
this pull request
Oct 23, 2026
Backport #126905 to 26.9: Fix segfault in `MySQLDump` format on `CREATE TABLE` without column definitions
clickhouse-gh Bot
added a commit
that referenced
this pull request
Oct 23, 2026
Backport #126905 to 26.8: Fix segfault in `MySQLDump` format on `CREATE TABLE` without column definitions
alexey-milovidov
added a commit
that referenced
this pull request
Oct 23, 2026
Backport #126905 to 26.3: Fix segfault in `MySQLDump` format on `CREATE TABLE` without column definitions
clickhouse-gh Bot
added a commit
that referenced
this pull request
Oct 24, 2026
Backport #126905 to 26.7: Fix segfault in `MySQLDump` format on `CREATE TABLE` without column definitions
This was referenced Oct 24, 2026
leshikus
pushed a commit
that referenced
this pull request
Nov 13, 2026
…TE TABLE` without column definitions
leshikus
pushed a commit
that referenced
this pull request
Nov 13, 2026
…TE TABLE` without column definitions
leshikus
pushed a commit
that referenced
this pull request
Nov 13, 2026
…TE TABLE` without column definitions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reading a MySQL dump with the
MySQLDumpformat crashed the server with a segmentation fault when the firstCREATE TABLEhad no column definitions:CREATE TABLE ... LIKE ..., or a definition list with only indexes or constraints.tryToExtractStructureFromCreateQuerydereferenced the missing column list. Now such aCREATE TABLEgives no structure, and the structure is inferred from theINSERTdata, as for aCREATE TABLEthat cannot be parsed.Closes: #126832
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix a segmentation fault when reading the
MySQLDumpformat if the dump containsCREATE TABLE ... LIKEor aCREATE TABLEwithout column definitions. The structure is now inferred from theINSERTdata.Workflow [PR]
Sync PR [sync-upstream/pr/126905]
Version info
26.11.1.678-master(included in26.11and later)26.10.2.101,26.9.26.14,26.8.35.10,26.7.38.18,26.3.61.7