Skip to content
This repository was archived by the owner on Jul 28, 2024. It is now read-only.

Conversation

@mkreckovic
Copy link
Contributor

Fixed wrong SELECT and SHOW queries detection due to leading tabs and spaces.

@pavelevap
Copy link
Collaborator

Good catch! For example this query from WP core is also affected.

Originally I thought that this is handled by WordPress by default, but it is done later :-( VersionPress is using custom method query() before using __wp_query() based on original function which handles queries with strip_invalid_text_from_query() method. Maybe we could take some more inspiration from it, they are using ltrim() and also DESCRIBE, DESC and EXPLAIN queries could be ignored (not very frequent).

PR works for me, thank you @mkreckovic!

@pavelevap pavelevap requested a review from JanVoracek April 25, 2018 09:16
@pavelevap pavelevap added the bug Bugs. For major ones, add "major". label Apr 25, 2018
@pavelevap pavelevap added this to the 4.0 milestone Apr 25, 2018
@candrews
Copy link
Contributor

@borekb can you please take a look and perhaps merge this one?

@borekb borekb removed the request for review from JanVoracek January 28, 2019 14:08
@borekb
Copy link
Member

borekb commented Jan 28, 2019

It looks good to me, sorry for not getting to this earlier. Just to confirm, @candrews, you find the code correct, right?

@candrews
Copy link
Contributor

you find the code correct, right?

Yes - it looks good to me as well.

@borekb
Copy link
Member

borekb commented Jan 29, 2019

Thanks for confirming. I'm going to merge the PR then – props to @mkreckovic!

@borekb borekb merged commit 0bd5eee into versionpress:master Jan 29, 2019
@borekb borekb changed the title Fixed wrong SELECT and SHOW queries detection Fix wrong SELECT and SHOW queries detection Apr 14, 2019
@borekb borekb added scope: core Core VersionPress functionality like tracking actions, creating Git commits, etc. and removed bug Bugs. For major ones, add "major". labels Apr 14, 2019
@borekb borekb added the noteworthy Significant issue or PR, to be highlighted in release notes label Apr 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

noteworthy Significant issue or PR, to be highlighted in release notes scope: core Core VersionPress functionality like tracking actions, creating Git commits, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants