-
Notifications
You must be signed in to change notification settings - Fork 90
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
IGNITE-22120: Sql. Possibility set zero length for character string type #3782
Conversation
assertThrowsSqlException( | ||
STMT_VALIDATION_ERR, | ||
"Length for type VARCHAR must be at least 1", | ||
() -> sql("SELECT '1'::VARCHAR(0)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check an empty string?
...ine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItCreateTableDdlTest.java
Outdated
Show resolved
Hide resolved
if (params.length() == null) { | ||
throw new CatalogValidationException(format(ERR_COL_PARAM_DEFINITION, "Length", params.name(), params.type())); | ||
} | ||
|
||
if (params.length() < 0) { | ||
if (params.length() <= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to append additional tests for add column and alter column with "0" precision ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
...l-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDataTypesTest.java
Show resolved
Hide resolved
modules/sql-engine/src/integrationTest/sql/types/char/test_char_length.test
Outdated
Show resolved
Hide resolved
Update error message.
# Conflicts: # modules/sql-engine/src/integrationTest/sql/types/char/test_char_length.test # modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/IgniteResource.java
modules/sql-engine/src/integrationTest/sql/types/char/test_char_length.test
Outdated
Show resolved
Hide resolved
Update table names in test.
Update column param tests.
https://issues.apache.org/jira/browse/IGNITE-22120
Thank you for submitting the pull request.
To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:
The Review Checklist
- There is a single JIRA ticket related to the pull request.
- The web-link to the pull request is attached to the JIRA ticket.
- The JIRA ticket has the Patch Available state.
- The description of the JIRA ticket explains WHAT was made, WHY and HOW.
- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
Notes