Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c605285b
Commit
c605285b
authored
Aug 11, 2021
by
Michael Okoko
Committed by
Sergei Petrunia
Jan 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix returned value type for empty json objects
Signed-off-by:
Michael Okoko
<
okokomichaels@outlook.com
>
parent
69f24c23
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
mysql-test/main/statistics_json.result
mysql-test/main/statistics_json.result
+1
-1
sql/sql_statistics.cc
sql/sql_statistics.cc
+1
-2
No files found.
mysql-test/main/statistics_json.result
View file @
c605285b
...
...
@@ -101,7 +101,7 @@ ERROR HY000: Failed to parse histogram, encountered JSON_TYPE '1'.
UPDATE mysql.column_stats SET histogram='{}' WHERE table_name='t1';
FLUSH TABLES;
SELECT * FROM t1;
ERROR HY000: Failed to parse histogram, encountered JSON_TYPE '
3264
1'.
ERROR HY000: Failed to parse histogram, encountered JSON_TYPE '1'.
DELETE FROM mysql.column_stats;
DROP TABLE t1;
create schema world;
...
...
sql/sql_statistics.cc
View file @
c605285b
...
...
@@ -1993,11 +1993,10 @@ bool json_get_array_items(const char *json, const char *json_end, int *value_typ
json_scan_start
(
&
je
,
&
my_charset_utf8mb4_bin
,
(
const
uchar
*
)
json
,
(
const
uchar
*
)
json_end
);
if
(
json_read_value
(
&
je
)
||
je
.
value_type
!=
JSON_VALUE_ARRAY
)
if
(
json_read_value
(
&
je
)
||
(
*
value_type
=
je
.
value_type
)
!=
JSON_VALUE_ARRAY
)
{
return
false
;
}
*
value_type
=
je
.
value_type
;
std
::
string
val
;
while
(
!
json_scan_next
(
&
je
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment