-
-
Notifications
You must be signed in to change notification settings - Fork 2k
MDEV-39412: parse error reading tabs in ranges #5049
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
base: bb-12.3-MDEV-39368-test-replay
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,25 +39,29 @@ int main(int args, char **argv) | |
| MEM_ROOT alloc; | ||
| json_engine_t je; | ||
| int rc; | ||
| const char *esc_str_val= "a\bc"; | ||
| init_alloc_root(0, &alloc, 32768, 0, 0); | ||
| mem_root_dynamic_array_init(&alloc, 0, &je.stack, | ||
| sizeof(int), NULL, JSON_DEPTH_DEFAULT, | ||
| JSON_DEPTH_INC, MYF(0)); | ||
| system_charset_info= &my_charset_utf8mb3_bin; | ||
| const char *js_doc="{ \"str_val\": \"abc\", \"double_val\": 1234.5 }"; | ||
| const char *js_doc= "{ \"str_val\": \"abc\", \"double_val\": 1234.5, " | ||
| "\"esc_str_val\": \"a\\bc\" }"; | ||
| json_scan_start(&je, &my_charset_utf8mb3_bin, (const uchar *) js_doc, | ||
| (const uchar *) js_doc + strlen(js_doc)); | ||
|
|
||
| char *parsed_name; | ||
| double parsed_dbl; | ||
| char *parsed_esc_str; | ||
| Read_named_member array[]= { | ||
| {"str_val", Read_string(&alloc, &parsed_name), false}, | ||
| {"str_val", Read_string(&alloc, &parsed_name), false}, | ||
| {"double_val", Read_double(&parsed_dbl), false}, | ||
| {NULL, Read_double(NULL), false } | ||
| }; | ||
| {"esc_str_val", Read_string(&alloc, &parsed_esc_str), false}, | ||
| {NULL, Read_double(NULL), false}}; | ||
| String err_buf; | ||
|
|
||
| rc= json_read_object(&je, array, &err_buf); | ||
| rc= json_read_object(&je, array, &err_buf) || | ||
| strcmp(parsed_esc_str, esc_str_val); | ||
|
Comment on lines
+63
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test change validates that the reader does NOT unescape, which is incorrect for a JSON library. For example, a JSON string
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirm. We should address Gemini's input here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. addressed it. |
||
| ok(!rc, "Basic object read"); | ||
| free_root(&alloc, 0); | ||
| #if 0 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.