-
Notifications
You must be signed in to change notification settings - Fork 752
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
compatibility mysql insert and select #4883
compatibility mysql insert and select #4883
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thanks for the contribution! Please review the labels and make any necessary changes. |
499ea9a
to
baea4ec
Compare
The error is:
For new setup tools, we should open a PR for |
@mergify update |
✅ Branch has been successfully updated |
use databend_query::sql::DfParser; | ||
use honggfuzz::fuzz; | ||
|
||
fn main() { | ||
loop { | ||
fuzz!(|data: String| { | ||
let _ = DfParser::parse_sql(&data); | ||
let _ = DfParser::parse_sql(&data, SessionType::Fuzz); |
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.
Hmm, how to run fuzz?
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.
Actually, I also have some issues with this file. I'm not sure why we need this file. And can not find where it is used.
To build success, I add a new SessionType Fuzz.
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.
Hi @PsiACE Are we using this for testing now? And how can I use it for databend query?
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.
Fuzz type is not necessary, I think it makes more sense to use it for fuzz testing of existing session types. As for how to run the fuzz test, you can see https://github.com/datafuselabs/databend/blob/main/tools/fuzz/README.md
It is not integrated in CI for now, and I am not sure if there are plans to use it to improve our parser. We have introduced the fuzz test in #700. It has helped us in the past to make some small improvements to the parser or the upstream sqlparser.
Ok(result) | ||
pub fn parse_sql( | ||
sql: &'a str, | ||
typ: SessionType, |
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.
If databend default sql dialect is MySqlDialect
, the problems is?
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.
Then we no need a SessionType
there
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.
If use ClickHouse Client connect Databend server or ClickHouse server SQL like
select “number” will return col value
But use MySQL client it will return a string
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.
tests/suites/0_stateless/00_dummy/00_0000_dummy_select_1.sql
like this test
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.
Double quota is not sql standard(not allowed by Snowflake, Pg, ClickHouse), it's just for MySQL...
So we need this special SessionType
@@ -37,7 +37,7 @@ select * from t3; | |||
select arr[0] from t3; | |||
select arr[5] from t3; | |||
select arr[3][0] from t3; | |||
select arr[4]["k"] from t3; |
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 double-quoted strings cause errors?
391e891
to
11c1772
Compare
11c1772
to
ea57906
Compare
ea57906
to
87870ed
Compare
87870ed
to
d8a7802
Compare
compatibility double quoted for MySQL: ``` insert into t values("xxx"); select * from t where col="xxx"; ```
d8a7802
to
2f95750
Compare
Tips: |
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.
lgtm
I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/
Summary
compatibility double quoted for MySQL:
Changelog
Related Issues
Fixes #4861 #1551