-
Notifications
You must be signed in to change notification settings - Fork 93
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
fix(spans): Parse quotes in MySQL #2846
Conversation
Blocked on apache/datafusion-sqlparser-rs#1065. |
scrub_sql_test_with_dialect!( | ||
mysql_escape_quote, | ||
"mysql", | ||
r#"SELECT "Wayne's World""#, | ||
"SELECT %s" | ||
); | ||
|
||
scrub_sql_test_with_dialect!( | ||
mysql_escape_double_quote, | ||
"mysql", | ||
r#"SELECT "{\"json\": \"yes\"}""#, | ||
"SELECT %s" | ||
); |
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.
These tests would previously fail.
fn dialect(&self) -> std::any::TypeId { | ||
self.0.dialect() | ||
} |
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.
This informs the parser to treat the current dialect the same as the wrapped dialect, for example MySQL.
@@ -429,6 +429,10 @@ impl DialectWithParameters { | |||
} | |||
|
|||
impl Dialect for DialectWithParameters { | |||
fn dialect(&self) -> std::any::TypeId { |
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.
nit: should we #[inline]
?
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?
Note: The rustc compiler automatically inlines functions based on internal heuristics. Incorrectly inlining functions can make the program slower, so this attribute should be used with care.
* master: (35 commits) fix(spans): Parse quotes in MySQL (#2846) ref(cardinality): Use a Lua script and in-memory cache for the cardinality limiter (#2849) fix(spans): Detect hex with fallback scrubber (#2868) release: 23.12.0 Revert "ci: Update upload-artifact and download-artifact actions" (#2866) Revert "build: Update axum and http" (#2863) feat(spans): Allow resource.img spans (#2855) build: Update axum and http (#2844) fix(build): Add additional dependencies to the release build (#2858) ci: Update upload-artifact and download-artifact actions (#2861) feat(spans): Parse timestamps from strings (#2857) fix(spans): Scrub integer file extensions (#2856) feat(spans): Remove unused transaction tag from resource metrics (#2853) ref(cardinality): Recover buckets on cardinality limiter failure (#2852) feat(server): Org rate limit per metric bucket (#2836) ref(spans): List metric tags explicitly (#2834) feat(spans): Resource response sizes as measurements (#2845) feat(crons): Add thresholds to monitor config payload (#2842) feat(spans): Allow ingestion of metrics summary on spans (#2823) ref(crons): Add documentation to CheckInMessageType (#2840) ...
* master: feat(processor): Add a metric to track the time of all messages (#2877) build(py): Update to python 3.9 (#2876) fix(spans): Collapse constants in SQL select (#2867) fix(spans): Parse quotes in MySQL (#2846) ref(cardinality): Use a Lua script and in-memory cache for the cardinality limiter (#2849) fix(spans): Detect hex with fallback scrubber (#2868)
The `sqlparser` lib has been on a fork since #2846. We can now go back to the official version because apache/datafusion-sqlparser-rs#1065 has been merged & released.
The `sqlparser` lib has been on a fork since #2846. We can now go back to the official version because apache/datafusion-sqlparser-rs#1065 has been merged & released.
Some of the dialect-specific parsing logic did not apply because we use a wrapped dialect
DialectWithParameters
, which has the wrongtype_id()
.Until apache/datafusion-sqlparser-rs#1065 gets merged, use a fork of
sqlparser
to makeDialectWithParameters
behave like the underlying dialect.ref: #2847