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

Show original characters for string literals instead of escaping #675

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

grieve54706
Copy link
Contributor

Resolve #673

Follow Trino
trinodb/trino#18256

Comment on lines +336 to +341
assertSqlFormatter("U&'!+10FFFF!6d4B!8Bd5ABC!6d4B!8Bd5' UESCAPE '!'", "'\uDBFF\uDFFF测试ABC测试'");
assertSqlFormatter("U&'\\+10FFFF\\6D4B\\8BD5\\0041\\0042\\0043\\6D4B\\8BD5'", "'\uDBFF\uDFFF测试ABC测试'");
assertSqlFormatter("U&'\\\\abc\\6D4B'''", "'\\abc测'''");
assertSqlFormatter("'攻殻機動隊'", "'攻殻機動隊'");
assertSqlFormatter("'😂'", "'😂'");
assertSqlFormatter("'시험'", "'시험'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -33,6 +33,7 @@
import static java.util.Objects.requireNonNull;
import static org.assertj.core.api.Assertions.assertThat;

@Test(singleThreaded = true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Reloading DuckDB would be triggered by other test cases (set init-sql). Run tests sequentially to avoid testing failure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another test class, TestDuckDBResource, which uses setDuckDBInitSQL, is already set to singleThreaded. They don't affect each other. We don't need to make any adjustments now. If we encounter any issues in the future, we can then modify the test suite as necessary.

}

StringBuilder builder = new StringBuilder();
if (dialect == DEFAULT || dialect == DUCKDB || dialect == POSTGRES) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw there're some DuckDB-specific behaviors. Do they work well if we remove the dialect?

Copy link
Contributor Author

@grieve54706 grieve54706 Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry. This condition has a test called testDecimalRewrite to cover it by #261. The test is successful after this adjustment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great.

Copy link
Contributor

@goldmedal goldmedal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @grieve54706 LGTM.

@goldmedal goldmedal merged commit daf5a60 into main Jul 18, 2024
4 checks passed
@goldmedal goldmedal deleted the bugfix/non-english branch July 18, 2024 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MySQL(mariadb): Pattern match a varchar column with a non-English scalar value.
2 participants