File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -5623,5 +5623,9 @@ DROP TABLE t2;
56235623DROP TABLE t1;
56245624SET sql_mode=DEFAULT;
56255625#
5626- # End of 10.11 tests
5626+ # MDEV-37740 LOCATE(X,Y,NULL) is not NULL
56275627#
5628+ select locate(1,2,NULL);
5629+ locate(1,2,NULL)
5630+ NULL
5631+ # End of 10.11 tests
Original file line number Diff line number Diff line change @@ -2573,5 +2573,8 @@ DROP TABLE t1;
25732573SET sql_mode=DEFAULT;
25742574
25752575--echo #
2576- --echo # End of 10.11 tests
2576+ --echo # MDEV-37740 LOCATE(X,Y,NULL) is not NULL
25772577--echo #
2578+ select locate(1,2,NULL);
2579+
2580+ --echo # End of 10.11 tests
Original file line number Diff line number Diff line change @@ -3247,7 +3247,10 @@ longlong Item_func_locate::val_int()
32473247 start0= start= args[2 ]->val_int ();
32483248
32493249 if ((start <= 0 ) || (start > a->length ()))
3250+ {
3251+ null_value= args[2 ]->is_null ();
32503252 return 0 ;
3253+ }
32513254 start0--; start--;
32523255
32533256 /* start is now sufficiently valid to pass to charpos function */
You can’t perform that action at this time.
0 commit comments