summaryrefslogtreecommitdiff
path: root/sql/item_jsonfunc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_jsonfunc.cc')
-rw-r--r--sql/item_jsonfunc.cc10
1 files changed, 2 insertions, 8 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index 960a6e9ccc8..40237ab46a6 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -374,17 +374,11 @@ static int path_setup_nwc(json_path_t *p, CHARSET_INFO *i_cs,
longlong Item_func_json_valid::val_int()
{
String *js= args[0]->val_json(&tmp_value);
- json_engine_t je;
if ((null_value= args[0]->null_value))
return 0;
- json_scan_start(&je, js->charset(), (const uchar *) js->ptr(),
- (const uchar *) js->ptr()+js->length());
-
- while (json_scan_next(&je) == 0) {}
-
- return je.s.error == 0;
+ return json_valid(js->ptr(), js->length(), js->charset());
}
@@ -1422,7 +1416,7 @@ null_return:
static int append_json_value(String *str, Item *item, String *tmp_val)
{
- if (item->is_bool_type())
+ if (item->type_handler()->is_bool_type())
{
longlong v_int= item->val_int();
const char *t_f;