@@ -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 {
@@ -1568,7 +1568,7 @@ bool Item_func_json_contains::val_bool()
15681568
15691569 if (arg_count>2 ) /* Path specified. */
15701570 {
1571- int array_counters[JSON_DEPTH_LIMIT ];
1571+ int array_counters[JSON_DEPTH_LIMIT ]= { 0 } ;
15721572 if (!path.parsed )
15731573 {
15741574 String *s_p= args[2 ]->val_str (&tmp_path);
@@ -1705,7 +1705,7 @@ longlong Item_func_json_contains_path::val_int()
17051705 result= !mode_one;
17061706 for (n_arg=2 ; n_arg < arg_count; n_arg++)
17071707 {
1708- int array_counters[JSON_DEPTH_LIMIT ];
1708+ int array_counters[JSON_DEPTH_LIMIT ]= { 0 } ;
17091709 json_path_with_flags *c_path= paths + n_arg - 2 ;
17101710 if (!c_path->parsed )
17111711 {
@@ -2115,7 +2115,7 @@ String *Item_func_json_array_append::val_str(String *str)
21152115
21162116 for (n_arg=1 , n_path=0 ; n_arg < arg_count; n_arg+=2 , n_path++)
21172117 {
2118- int array_counters[JSON_DEPTH_LIMIT ];
2118+ int array_counters[JSON_DEPTH_LIMIT ]= { 0 } ;
21192119 json_path_with_flags *c_path= paths + n_path;
21202120 if (!c_path->parsed )
21212121 {
@@ -2247,7 +2247,7 @@ String *Item_func_json_array_insert::val_str(String *str)
22472247
22482248 for (n_arg=1 , n_path=0 ; n_arg < arg_count; n_arg+=2 , n_path++)
22492249 {
2250- int array_counters[JSON_DEPTH_LIMIT ];
2250+ int array_counters[JSON_DEPTH_LIMIT ]= { 0 } ;
22512251 json_path_with_flags *c_path= paths + n_path;
22522252 const char *item_pos;
22532253 int n_item, corrected_n_item;
@@ -3100,7 +3100,7 @@ longlong Item_func_json_length::val_int()
31003100 String *js= args[0 ]->val_json (&tmp_js);
31013101 json_engine_t je;
31023102 uint length= 0 ;
3103- int array_counters[JSON_DEPTH_LIMIT ];
3103+ int array_counters[JSON_DEPTH_LIMIT ]= { 0 } ;
31043104 int err;
31053105
31063106 if ((null_value= args[0 ]->null_value ))
@@ -3341,7 +3341,7 @@ String *Item_func_json_insert::val_str(String *str)
33413341
33423342 for (n_arg=1 , n_path=0 ; n_arg < arg_count; n_arg+=2 , n_path++)
33433343 {
3344- int array_counters[JSON_DEPTH_LIMIT ];
3344+ int array_counters[JSON_DEPTH_LIMIT ]= { 0 } ;
33453345 json_path_with_flags *c_path= paths + n_path;
33463346 const char *v_to;
33473347 json_path_step_t *lp;
@@ -3606,7 +3606,7 @@ String *Item_func_json_remove::val_str(String *str)
36063606
36073607 for (n_arg=1 , n_path=0 ; n_arg < arg_count; n_arg++, n_path++)
36083608 {
3609- int array_counters[JSON_DEPTH_LIMIT ];
3609+ int array_counters[JSON_DEPTH_LIMIT ]= { 0 } ;
36103610 json_path_with_flags *c_path= paths + n_path;
36113611 const char *rem_start= 0 , *rem_end;
36123612 json_path_step_t *lp;
@@ -3829,7 +3829,7 @@ String *Item_func_json_keys::val_str(String *str)
38293829 json_engine_t je;
38303830 String *js= args[0 ]->val_json (&tmp_js);
38313831 uint n_keys= 0 ;
3832- int array_counters[JSON_DEPTH_LIMIT ];
3832+ int array_counters[JSON_DEPTH_LIMIT ]= { 0 } ;
38333833
38343834 if ((args[0 ]->null_value ))
38353835 goto null_return;
0 commit comments