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
fe2e516a
Commit
fe2e516a
authored
Jul 31, 2021
by
Michael Okoko
Committed by
Sergei Petrunia
Jan 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inform test result of zero hist_size for json histogram
Signed-off-by:
Michael Okoko
<
okokomichaels@outlook.com
>
parent
bf4d0dcf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
mysql-test/main/statistics_json.result
mysql-test/main/statistics_json.result
+4
-4
sql/sql_statistics.cc
sql/sql_statistics.cc
+1
-2
sql/sql_statistics.h
sql/sql_statistics.h
+2
-2
No files found.
mysql-test/main/statistics_json.result
View file @
fe2e516a
...
...
@@ -19,7 +19,7 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SELECT * FROM mysql.column_stats WHERE table_name='t1';
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
test t1 a 1 25 0.0000 4.0000
1
.0000 10 JSON [
test t1 a 1 25 0.0000 4.0000
0
.0000 10 JSON [
"3",
"5",
"7",
...
...
@@ -31,7 +31,7 @@ test t1 a 1 25 0.0000 4.0000 1.0000 10 JSON [
"21",
"23"
]
test t1 b 1 9 0.0000 1.6400
1
.0000 10 JSON [
test t1 b 1 9 0.0000 1.6400
0
.0000 10 JSON [
"11",
"13",
"15",
...
...
@@ -43,7 +43,7 @@ test t1 b 1 9 0.0000 1.6400 1.0000 10 JSON [
"5",
"7"
]
test t1 c 1 9 0.0000 2.0000
1
.0000 10 JSON [
test t1 c 1 9 0.0000 2.0000
0
.0000 10 JSON [
"11",
"13",
"15",
...
...
@@ -55,7 +55,7 @@ test t1 c 1 9 0.0000 2.0000 1.0000 10 JSON [
"5",
"7"
]
test t1 d 1 25 0.0000 8.0000
1
.0000 10 JSON [
test t1 d 1 25 0.0000 8.0000
0
.0000 10 JSON [
"3",
"5",
"7",
...
...
sql/sql_statistics.cc
View file @
fe2e516a
...
...
@@ -1283,7 +1283,6 @@ void Histogram_json::init_for_collection(MEM_ROOT *mem_root, Histogram_type htyp
bool
Histogram_json
::
parse
(
MEM_ROOT
*
mem_root
,
Histogram_type
type_arg
,
const
uchar
*
ptr
,
uint
size_arg
)
{
size
=
(
uint8
)
size_arg
;
type
=
type_arg
;
// I think we could use memcpy here, but not sure about how to get the right size
// since we can't depend on size_arg (it's zero for json histograms)
...
...
@@ -1303,7 +1302,7 @@ bool Histogram_json::parse(MEM_ROOT *mem_root, Histogram_type type_arg, const uc
void
Histogram_json
::
serialize
(
Field
*
field
)
{
field
->
store
((
char
*
)
get_values
(),
strlen
((
char
*
)
get_values
()
),
field
->
store
((
char
*
)
values
,
strlen
((
char
*
)
values
),
&
my_charset_bin
);
}
...
...
sql/sql_statistics.h
View file @
fe2e516a
...
...
@@ -372,9 +372,9 @@ class Histogram_json : public Histogram_base
is_available
();
}
void
set_values
(
uchar
*
vals
)
override
{
values
=
(
uchar
*
)
vals
;
}
void
set_values
(
uchar
*
vals
)
override
{
values
=
vals
;
}
uchar
*
get_values
()
override
{
return
(
uchar
*
)
values
;
}
uchar
*
get_values
()
override
{
return
values
;
}
double
range_selectivity
(
double
min_pos
,
double
max_pos
)
override
{
return
0.1
;}
...
...
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