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 [
"19",
"21",
"23"
]
]
test t1 b 1 9 0.0000 1.6400 1.0000 10 JSON [
"11",
"13",
......@@ -42,7 +42,7 @@ test t1 b 1 9 0.0000 1.6400 1.0000 10 JSON [
"3",
"5",
"7"
]
]
test t1 c 1 9 0.0000 2.0000 1.0000 10 JSON [
"11",
"13",
......@@ -54,7 +54,7 @@ test t1 c 1 9 0.0000 2.0000 1.0000 10 JSON [
"3",
"5",
"7"
]
]
test t1 d 1 25 0.0000 8.0000 1.0000 10 JSON [
"3",
"5",
......@@ -66,7 +66,7 @@ test t1 d 1 25 0.0000 8.0000 1.0000 10 JSON [
"19",
"21",
"23"
]e
]
DELETE FROM mysql.column_stats;
DROP TABLE t1;
create schema world;
......@@ -102,7 +102,7 @@ Code ABW ZWE 25 JSON [
"TMP",
"UKR",
"VIR"
]0
]
Name Afghanistan Zimbabwe 25 JSON [
"Argentina",
"Barbados",
......@@ -129,7 +129,7 @@ Name Afghanistan Zimbabwe 25 JSON [
"Togo",
"Uganda",
"Venezuela"
]a
]
SurfaceArea 0.40 17075400.00 25 JSON [
"36.00",
"151.00",
......@@ -156,7 +156,7 @@ SurfaceArea 0.40 17075400.00 25 JSON [
"1104300.00",
"1648195.00",
"2724900.00"
]
]
Population 0 1277558000 25 JSON [
"1000",
"8000",
......@@ -183,7 +183,7 @@ Population 0 1277558000 25 JSON [
"40377000",
"61399000",
"111506000"
]
]
Capital 1 4074 25 JSON [
"62",
"149",
......@@ -210,7 +210,7 @@ Capital 1 4074 25 JSON [
"3336",
"3426",
"3538"
]
]
ID 1 4079 10 JSON [
"371",
"742",
......@@ -222,7 +222,7 @@ ID 1 4079 10 JSON [
"2967",
"3338",
"3709"
]
]
Name A Coruña (La Coruña) Århus 10 JSON [
"Berdytšiv",
"Clermont-Ferrand",
......@@ -234,7 +234,7 @@ Name A Coruña (La Coruña) Århus 10 JSON [
"Roanoke",
"Split",
"Ulsan"
]
]
Country ABW ZWE 10 JSON [
"BRA",
"CHN",
......@@ -246,7 +246,7 @@ Country ABW ZWE 10 JSON [
"PHL",
"RUS",
"USA"
]
]
Population 42 10500000 10 JSON [
"96002",
"105819",
......@@ -258,7 +258,7 @@ Population 42 10500000 10 JSON [
"288173",
"398300",
"670208"
]
]
Country ABW ZWE 10 JSON [
"BGD",
"CMR",
......@@ -270,7 +270,7 @@ Country ABW ZWE 10 JSON [
"PNG",
"SVK",
"UGA"
]
]
Language Abhyasi [South]Mande 10 JSON [
"Bariba",
"Creole English",
......@@ -294,7 +294,7 @@ Percentage 0.0 99.9 10 JSON [
"17.7",
"45.5",
"87.5"
]q
]
set histogram_type=@save_histogram_type;
set histogram_size=@save_histogram_size;
DROP SCHEMA world;
......@@ -1643,7 +1643,8 @@ std::vector<std::string> bucket_bounds;
}
writer->end_array();
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