Skip to content

fix: mysql backslash escaping #373

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

Merged
merged 2 commits into from
Dec 23, 2021

Conversation

vasilev-alex
Copy link
Contributor

Addresses this issue #362

Works only when a raw string provided as input

@coveralls
Copy link

coveralls commented Dec 5, 2021

Pull Request Test Coverage Report for Build 1613258541

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 31 of 33 (93.94%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.04%) to 90.227%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/tokenizer.rs 9 11 81.82%
Files with Coverage Reduction New Missed Lines %
src/tokenizer.rs 1 90.3%
Totals Coverage Status
Change from base Build 1608710431: 0.04%
Covered Lines: 6666
Relevant Lines: 7388

💛 - Coveralls

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution @vasilev-alex ! This PR looks close

@vasilev-alex vasilev-alex force-pushed the mysql-backslash-escaping branch from e212004 to 0be2f3a Compare December 22, 2021 22:16
@vasilev-alex vasilev-alex requested a review from alamb December 22, 2021 22:20
@vasilev-alex vasilev-alex force-pushed the mysql-backslash-escaping branch from 018a4e7 to 8b04b40 Compare December 22, 2021 22:39
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks great -- thank you @vasilev-alex

@@ -176,19 +178,36 @@ fn parse_quote_identifiers() {
}
}

#[test]
fn parse_unterminated_escape() {
let sql = r#"SELECT 'I\'m not fine\'"#;
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

let expr = expr_from_projection(only(&value.projection));
assert_eq!(
*expr,
Expr::Value(Value::SingleQuotedString("I'm fine".to_string()))
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

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.

3 participants