Skip to content

Fix Vtexplains StripComments#5984

Merged
harshit-gangal merged 4 commits intovitessio:masterfrom
planetscale:sa-fix-vtexplain-strip-comments
Apr 2, 2020
Merged

Fix Vtexplains StripComments#5984
harshit-gangal merged 4 commits intovitessio:masterfrom
planetscale:sa-fix-vtexplain-strip-comments

Conversation

@saifalharthi
Copy link
Copy Markdown
Contributor

@saifalharthi saifalharthi commented Mar 27, 2020

Closes #5981
Signed-off-by: Saif Alharthi saif@saifalharthi.me

@saifalharthi saifalharthi requested a review from sougou as a code owner March 27, 2020 19:12
@harshit-gangal
Copy link
Copy Markdown
Member

Issue related #5981

@saifalharthi
Copy link
Copy Markdown
Contributor Author

saifalharthi commented Mar 28, 2020

Thanks @harshit-gangal. Updated the PR description

Signed-off-by: Saif Alharthi <saif@saifalharthi.me>

Modify for better readability

Signed-off-by: Saif Alharthi <saif@saifalharthi.me>

Make sure anything inside qoutations will not be removed

Signed-off-by: Saif Alharthi <saif@saifalharthi.me>

Modity test for readablity

Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
@saifalharthi saifalharthi force-pushed the sa-fix-vtexplain-strip-comments branch from ba91c1f to 1ddeee0 Compare March 28, 2020 16:56
@harshit-gangal
Copy link
Copy Markdown
Member

harshit-gangal commented Mar 29, 2020

I tried below case and got this
test input: "select * from customer where name like 'abc*/la/*xyz'"
got SQL -> select * from customer where name like 'abcxyz'
want -> select * from customer where name like 'abc*/la/*xyz'
is my expectation correct?

Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
@saifalharthi
Copy link
Copy Markdown
Contributor Author

@harshit-gangal Yes, your expectation is correct. I changed the code so it can use the parser. And the previous code if it is not. I am not sure if we should change the tests to display an error the string cannot be parsed. But this seems like a good compromise.

@harshit-gangal
Copy link
Copy Markdown
Member

Let's switch this function to use splitMarginComments and also fix the current issues with that function.

systay and others added 2 commits April 1, 2020 09:41
…rately

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
@saifalharthi
Copy link
Copy Markdown
Contributor Author

I discussed with @sougou about this issue and decided to remove PARTITION so vtexplain can match vitess's current behavior.

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.

sql like select * from t where name like '*//*' in StripComments will lead to a deadloop and a cpu usage raise

3 participants