Open
Conversation
I added --read-only option. If the value of this option is 1 then query parser chooses only select statements from slow log file. Updated percona_playback/query_log/query_log.cc
I removed duplicate contitions from the line 149, because I understand that on this line parser catches only set timestamp commands. But I kept the condition at line 164 because it is important for read-only mode filtering.
dbadapt
suggested changes
Nov 14, 2016
| (*this->nr_entries)++; | ||
| } | ||
|
|
||
Contributor
There was a problem hiding this comment.
Remove trailing spaces on this line
Author
There was a problem hiding this comment.
You are right sir. It is fault of IDE and my careless. I removed all trailing spaces which you commented. You can see on the commit with title "Update query_log.cc 15.11.2016"
| { | ||
| FILE* input_file; | ||
|
|
||
| break; | ||
| } | ||
| tmp_entry->add_query_line(std::string(line)); | ||
| if((is_ro_mode && (strncmp("select", line, strlen("select")) == 0 || strncmp("SELECT", line, strlen("SELECT")) == 0)) || !is_ro_mode) |
Contributor
There was a problem hiding this comment.
Why not use strnicmp() here instead of two compares? why do we need to do two strlen() calls for a static string?
Author
There was a problem hiding this comment.
I corrected this mistake on the commit with title "Update query_log.cc 15.11.2016"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added --read-only option. If the value of this option is 1 then query parser chooses only select statements from slow log file.
Updated percona_playback/query_log/query_log.cc