Commit d4d53980 authored by Michael Okoko's avatar Michael Okoko Committed by Sergei Petrunia

Fix garbage null values at end of histogram json

Signed-off-by: default avatarMichael Okoko <okokomichaels@outlook.com>
parent a3787358
...@@ -30,7 +30,7 @@ test t1 a 1 25 0.0000 4.0000 1.0000 10 JSON [ ...@@ -30,7 +30,7 @@ test t1 a 1 25 0.0000 4.0000 1.0000 10 JSON [
"19", "19",
"21", "21",
"23" "23"
] ]
test t1 b 1 9 0.0000 1.6400 1.0000 10 JSON [ test t1 b 1 9 0.0000 1.6400 1.0000 10 JSON [
"11", "11",
"13", "13",
...@@ -42,7 +42,7 @@ test t1 b 1 9 0.0000 1.6400 1.0000 10 JSON [ ...@@ -42,7 +42,7 @@ test t1 b 1 9 0.0000 1.6400 1.0000 10 JSON [
"3", "3",
"5", "5",
"7" "7"
] ]
test t1 c 1 9 0.0000 2.0000 1.0000 10 JSON [ test t1 c 1 9 0.0000 2.0000 1.0000 10 JSON [
"11", "11",
"13", "13",
...@@ -54,7 +54,7 @@ test t1 c 1 9 0.0000 2.0000 1.0000 10 JSON [ ...@@ -54,7 +54,7 @@ test t1 c 1 9 0.0000 2.0000 1.0000 10 JSON [
"3", "3",
"5", "5",
"7" "7"
] ]
test t1 d 1 25 0.0000 8.0000 1.0000 10 JSON [ test t1 d 1 25 0.0000 8.0000 1.0000 10 JSON [
"3", "3",
"5", "5",
...@@ -66,7 +66,7 @@ test t1 d 1 25 0.0000 8.0000 1.0000 10 JSON [ ...@@ -66,7 +66,7 @@ test t1 d 1 25 0.0000 8.0000 1.0000 10 JSON [
"19", "19",
"21", "21",
"23" "23"
]e ]
DELETE FROM mysql.column_stats; DELETE FROM mysql.column_stats;
DROP TABLE t1; DROP TABLE t1;
create schema world; create schema world;
...@@ -102,7 +102,7 @@ Code ABW ZWE 25 JSON [ ...@@ -102,7 +102,7 @@ Code ABW ZWE 25 JSON [
"TMP", "TMP",
"UKR", "UKR",
"VIR" "VIR"
]0 ]
Name Afghanistan Zimbabwe 25 JSON [ Name Afghanistan Zimbabwe 25 JSON [
"Argentina", "Argentina",
"Barbados", "Barbados",
...@@ -129,7 +129,7 @@ Name Afghanistan Zimbabwe 25 JSON [ ...@@ -129,7 +129,7 @@ Name Afghanistan Zimbabwe 25 JSON [
"Togo", "Togo",
"Uganda", "Uganda",
"Venezuela" "Venezuela"
]a ]
SurfaceArea 0.40 17075400.00 25 JSON [ SurfaceArea 0.40 17075400.00 25 JSON [
"36.00", "36.00",
"151.00", "151.00",
...@@ -156,7 +156,7 @@ SurfaceArea 0.40 17075400.00 25 JSON [ ...@@ -156,7 +156,7 @@ SurfaceArea 0.40 17075400.00 25 JSON [
"1104300.00", "1104300.00",
"1648195.00", "1648195.00",
"2724900.00" "2724900.00"
] ]
Population 0 1277558000 25 JSON [ Population 0 1277558000 25 JSON [
"1000", "1000",
"8000", "8000",
...@@ -183,7 +183,7 @@ Population 0 1277558000 25 JSON [ ...@@ -183,7 +183,7 @@ Population 0 1277558000 25 JSON [
"40377000", "40377000",
"61399000", "61399000",
"111506000" "111506000"
] ]
Capital 1 4074 25 JSON [ Capital 1 4074 25 JSON [
"62", "62",
"149", "149",
...@@ -210,7 +210,7 @@ Capital 1 4074 25 JSON [ ...@@ -210,7 +210,7 @@ Capital 1 4074 25 JSON [
"3336", "3336",
"3426", "3426",
"3538" "3538"
] ]
ID 1 4079 10 JSON [ ID 1 4079 10 JSON [
"371", "371",
"742", "742",
...@@ -222,7 +222,7 @@ ID 1 4079 10 JSON [ ...@@ -222,7 +222,7 @@ ID 1 4079 10 JSON [
"2967", "2967",
"3338", "3338",
"3709" "3709"
] ]
Name A Coruña (La Coruña) Århus 10 JSON [ Name A Coruña (La Coruña) Århus 10 JSON [
"Berdytšiv", "Berdytšiv",
"Clermont-Ferrand", "Clermont-Ferrand",
...@@ -234,7 +234,7 @@ Name A Coruña (La Coruña) Århus 10 JSON [ ...@@ -234,7 +234,7 @@ Name A Coruña (La Coruña) Århus 10 JSON [
"Roanoke", "Roanoke",
"Split", "Split",
"Ulsan" "Ulsan"
] ]
Country ABW ZWE 10 JSON [ Country ABW ZWE 10 JSON [
"BRA", "BRA",
"CHN", "CHN",
...@@ -246,7 +246,7 @@ Country ABW ZWE 10 JSON [ ...@@ -246,7 +246,7 @@ Country ABW ZWE 10 JSON [
"PHL", "PHL",
"RUS", "RUS",
"USA" "USA"
] ]
Population 42 10500000 10 JSON [ Population 42 10500000 10 JSON [
"96002", "96002",
"105819", "105819",
...@@ -258,7 +258,7 @@ Population 42 10500000 10 JSON [ ...@@ -258,7 +258,7 @@ Population 42 10500000 10 JSON [
"288173", "288173",
"398300", "398300",
"670208" "670208"
] ]
Country ABW ZWE 10 JSON [ Country ABW ZWE 10 JSON [
"BGD", "BGD",
"CMR", "CMR",
...@@ -270,7 +270,7 @@ Country ABW ZWE 10 JSON [ ...@@ -270,7 +270,7 @@ Country ABW ZWE 10 JSON [
"PNG", "PNG",
"SVK", "SVK",
"UGA" "UGA"
] ]
Language Abhyasi [South]Mande 10 JSON [ Language Abhyasi [South]Mande 10 JSON [
"Bariba", "Bariba",
"Creole English", "Creole English",
...@@ -294,7 +294,7 @@ Percentage 0.0 99.9 10 JSON [ ...@@ -294,7 +294,7 @@ Percentage 0.0 99.9 10 JSON [
"17.7", "17.7",
"45.5", "45.5",
"87.5" "87.5"
]q ]
set histogram_type=@save_histogram_type; set histogram_type=@save_histogram_type;
set histogram_size=@save_histogram_size; set histogram_size=@save_histogram_size;
DROP SCHEMA world; DROP SCHEMA world;
...@@ -1643,7 +1643,8 @@ std::vector<std::string> bucket_bounds; ...@@ -1643,7 +1643,8 @@ std::vector<std::string> bucket_bounds;
} }
writer->end_array(); writer->end_array();
histogram->set_size(bucket_bounds.size()); histogram->set_size(bucket_bounds.size());
histogram->set_values((uchar *) writer->output.get_string()->ptr()); Binary_string *json_string = (Binary_string *) writer->output.get_string();
histogram->set_values((uchar *) json_string->c_ptr());
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment