MDEV-39412: parse error reading tabs in ranges#4994
Open
bsrikanth-mariadb wants to merge 1 commit intobb-12.3-MDEV-38805-dev-sprint-work-2from
Open
MDEV-39412: parse error reading tabs in ranges#4994bsrikanth-mariadb wants to merge 1 commit intobb-12.3-MDEV-38805-dev-sprint-work-2from
bsrikanth-mariadb wants to merge 1 commit intobb-12.3-MDEV-38805-dev-sprint-work-2from
Conversation
Note:
while reading from information_schema.optimizer_context one level of unescaping
is already done i.e. (\\t becomes \t or \\\\t becomes \\t)
w.r.t the MDEV, there are 2 problems: -
1.
When reading from the sql script file, json parser is not able to parse
the range value in json_read_value() from json_lib.c
"ranges": [
"(b\t\t\t\t\t\t) <= (b) <= (b???????)"
],
mainly the \t\t stuff, and hence a warning.
It also stops loading the context into memory.
Since, a new table is created with empty data, and without context,
we get Impossible WHERE noticed after reading const tables
2.
There is unescaping call being made in read_string() from sql_json_lib.cc
while parsing of the context. With this \\t was becoming \t.
However, print_range() from opt_range.cc already does escaping of the values.
The value "b\t\t\t" was in fact produced as "\b\\t\\t\\t".
Later, we try to compare range values from the query and the context.
Here a mismatch a found because, in one case there was escaping,
and in the other case escaping got removed.
Solutions
=========
For Problem 1. have escaping for ranges.
This should be done while dumping range values into the context.
For Problem 2. Remove unscaping call in read_string().
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.
Note:
while reading from information_schema.optimizer_context one level of unescaping is already done i.e. (\\t becomes \t or \\\\t becomes \\t)
w.r.t the MDEV, there are 2 problems: -
When reading from the sql script file, json parser is not able to parse the range value in json_read_value() from json_lib.c "ranges": [
"(b\t\t\t\t\t\t) <= (b) <= (b???????)"
],
mainly the \t\t stuff, and hence a warning.
It also stops loading the context into memory.
Since, a new table is created with empty data, and without context, we get Impossible WHERE noticed after reading const tables
There is unescaping call being made in read_string() from sql_json_lib.cc while parsing of the context. With this \\t was becoming \t. However, print_range() from opt_range.cc already does escaping of the values. The value "b\t\t\t" was in fact produced as "b\\t\\t\\t". Later, we try to compare range values from the query and the context.
Here a mismatch a found because, in one case there was escaping, and in the other case escaping got removed.
Solutions
For Problem 1. have escaping for ranges.
This should be done while dumping range values into the context.
For Problem 2. Remove unscaping call in read_string().