@@ -672,7 +672,7 @@ bool Item_func_json_exists::fix_length_and_dec(THD *thd)
672672bool Item_func_json_exists::val_bool ()
673673{
674674 json_engine_t je;
675- int array_counters[JSON_DEPTH_LIMIT];
675+ int array_counters[JSON_DEPTH_LIMIT]= { 0 } ;
676676
677677 String *js= args[0 ]->val_json (&tmp_js);
678678
@@ -738,7 +738,7 @@ bool Json_path_extractor::extract(String *str, Item *item_js, Item *item_jp,
738738{
739739 String *js= item_js->val_json (&tmp_js);
740740 int error= 0 ;
741- int array_counters[JSON_DEPTH_LIMIT];
741+ int array_counters[JSON_DEPTH_LIMIT]= { 0 } ;
742742
743743 if (!parsed)
744744 {
@@ -1597,7 +1597,7 @@ bool Item_func_json_contains::val_bool()
15971597
15981598 if (arg_count>2 ) /* Path specified. */
15991599 {
1600- int array_counters[JSON_DEPTH_LIMIT];
1600+ int array_counters[JSON_DEPTH_LIMIT]= { 0 } ;
16011601 if (!path.parsed )
16021602 {
16031603 String *s_p= args[2 ]->val_str (&tmp_path);
@@ -1734,7 +1734,7 @@ longlong Item_func_json_contains_path::val_int()
17341734 result= !mode_one;
17351735 for (n_arg=2 ; n_arg < arg_count; n_arg++)
17361736 {
1737- int array_counters[JSON_DEPTH_LIMIT];
1737+ int array_counters[JSON_DEPTH_LIMIT]= { 0 } ;
17381738 json_path_with_flags *c_path= paths + n_arg - 2 ;
17391739 if (!c_path->parsed )
17401740 {
@@ -2144,7 +2144,7 @@ String *Item_func_json_array_append::val_str(String *str)
21442144
21452145 for (n_arg=1 , n_path=0 ; n_arg < arg_count; n_arg+=2 , n_path++)
21462146 {
2147- int array_counters[JSON_DEPTH_LIMIT];
2147+ int array_counters[JSON_DEPTH_LIMIT]= { 0 } ;
21482148 json_path_with_flags *c_path= paths + n_path;
21492149 if (!c_path->parsed )
21502150 {
@@ -2276,7 +2276,7 @@ String *Item_func_json_array_insert::val_str(String *str)
22762276
22772277 for (n_arg=1 , n_path=0 ; n_arg < arg_count; n_arg+=2 , n_path++)
22782278 {
2279- int array_counters[JSON_DEPTH_LIMIT];
2279+ int array_counters[JSON_DEPTH_LIMIT]= { 0 } ;
22802280 json_path_with_flags *c_path= paths + n_path;
22812281 const char *item_pos;
22822282 int n_item, corrected_n_item;
@@ -3129,7 +3129,7 @@ longlong Item_func_json_length::val_int()
31293129 String *js= args[0 ]->val_json (&tmp_js);
31303130 json_engine_t je;
31313131 uint length= 0 ;
3132- int array_counters[JSON_DEPTH_LIMIT];
3132+ int array_counters[JSON_DEPTH_LIMIT]= { 0 } ;
31333133 int err;
31343134
31353135 if ((null_value= args[0 ]->null_value ))
@@ -3370,7 +3370,7 @@ String *Item_func_json_insert::val_str(String *str)
33703370
33713371 for (n_arg=1 , n_path=0 ; n_arg < arg_count; n_arg+=2 , n_path++)
33723372 {
3373- int array_counters[JSON_DEPTH_LIMIT];
3373+ int array_counters[JSON_DEPTH_LIMIT]= { 0 } ;
33743374 json_path_with_flags *c_path= paths + n_path;
33753375 const char *v_to;
33763376 json_path_step_t *lp;
@@ -3635,7 +3635,7 @@ String *Item_func_json_remove::val_str(String *str)
36353635
36363636 for (n_arg=1 , n_path=0 ; n_arg < arg_count; n_arg++, n_path++)
36373637 {
3638- int array_counters[JSON_DEPTH_LIMIT];
3638+ int array_counters[JSON_DEPTH_LIMIT]= { 0 } ;
36393639 json_path_with_flags *c_path= paths + n_path;
36403640 const char *rem_start= 0 , *rem_end;
36413641 json_path_step_t *lp;
@@ -3858,7 +3858,7 @@ String *Item_func_json_keys::val_str(String *str)
38583858 json_engine_t je;
38593859 String *js= args[0 ]->val_json (&tmp_js);
38603860 uint n_keys= 0 ;
3861- int array_counters[JSON_DEPTH_LIMIT];
3861+ int array_counters[JSON_DEPTH_LIMIT]= { 0 } ;
38623862
38633863 if ((args[0 ]->null_value ))
38643864 goto null_return;
0 commit comments