Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sql): add column type validation for ALTER COLUMN statements #3633

Merged
merged 4 commits into from
Aug 15, 2023

Conversation

puzpuzpuz
Copy link
Contributor

@puzpuzpuz puzpuzpuz commented Aug 10, 2023

Closes #3515

Also fixes races around CharSequence usage in AlterOperation. The sequences originated in SqlCompiler and were used after the compiler was returned back to the pool leading to data races. The fix is as simple as keeping the compiler around while we execute the statement (see the OperationExecutor class).

@puzpuzpuz puzpuzpuz added Bug Incorrect or unexpected behavior SQL Issues or changes relating to SQL execution labels Aug 10, 2023
@puzpuzpuz puzpuzpuz self-assigned this Aug 10, 2023
@puzpuzpuz puzpuzpuz changed the title feat(sql): add column type validation for ALTER COLUMN ADD INDEX feat(sql): add column type validation for ALTER COLUMN statements Aug 10, 2023
@puzpuzpuz puzpuzpuz force-pushed the puzpuzpuz_alter_table_char_sequence_race branch from 19ee2a1 to f69b168 Compare August 10, 2023 13:13
Also fixes races around CharSequence usage in AlterOperation. The sequences
originated in SqlCompiler and were used after the compiler was returned
back to the pool leading to data races.
@puzpuzpuz puzpuzpuz force-pushed the puzpuzpuz_alter_table_char_sequence_race branch from f69b168 to 81f547e Compare August 10, 2023 15:07
ideoma
ideoma previously approved these changes Aug 15, 2023
@ideoma
Copy link
Collaborator

ideoma commented Aug 15, 2023

[PR Coverage check]

😍 pass : 45 / 50 (90.00%)

file detail

path covered line new line coverage
🔵 io/questdb/cairo/TableWriter.java 5 7 71.43%
🔵 io/questdb/cairo/wal/OperationExecutor.java 13 16 81.25%
🔵 io/questdb/cairo/wal/WalWriter.java 2 2 100.00%
🔵 io/questdb/cairo/wal/ApplyWal2TableJob.java 9 9 100.00%
🔵 io/questdb/cairo/ColumnPurgeJob.java 2 2 100.00%
🔵 io/questdb/griffin/SqlCompilerImpl.java 14 14 100.00%

@puzpuzpuz
Copy link
Contributor Author

@bluestreak01 the PR is all green and should be ready for review.

@bluestreak01 bluestreak01 merged commit fde5f23 into master Aug 15, 2023
22 checks passed
@bluestreak01 bluestreak01 deleted the puzpuzpuz_alter_table_char_sequence_race branch August 15, 2023 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Incorrect or unexpected behavior SQL Issues or changes relating to SQL execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ALTER COLUMN ADD INDEX on LONG column leads to critical level log message
3 participants