File tree 3 files changed +14
-1
lines changed
3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -348,6 +348,10 @@ Warnings:
348
348
Warning 1292 Truncated incorrect INTEGER value: '-1e+30'
349
349
Warning 1292 Truncated incorrect INTEGER value: '1e+30'
350
350
DROP TABLE t1;
351
+ select isnull(date(NULL)), isnull(cast(NULL as DATE));
352
+ isnull(date(NULL)) isnull(cast(NULL as DATE))
353
+ 1 1
354
+ End of 4.1 tests
351
355
select cast('1.2' as decimal(3,2));
352
356
cast('1.2' as decimal(3,2))
353
357
1.20
Original file line number Diff line number Diff line change @@ -176,7 +176,13 @@ INSERT INTO t1 SET f1 = +1.0e+30 ;
176
176
SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1;
177
177
DROP TABLE t1;
178
178
179
- # End of 4.1 tests
179
+ #
180
+ # Bug #23938: cast(NULL as DATE)
181
+ #
182
+
183
+ select isnull(date(NULL)), isnull(cast(NULL as DATE));
184
+
185
+ --echo End of 4.1 tests
180
186
181
187
182
188
#decimal-related additions
Original file line number Diff line number Diff line change @@ -2542,7 +2542,10 @@ longlong Item_date_typecast::val_int()
2542
2542
DBUG_ASSERT (fixed == 1 );
2543
2543
TIME ltime;
2544
2544
if (args[0 ]->get_date (<ime, TIME_FUZZY_DATE))
2545
+ {
2546
+ null_value= 1 ;
2545
2547
return 0 ;
2548
+ }
2546
2549
return (longlong) (ltime.year * 10000L + ltime.month * 100 + ltime.day );
2547
2550
}
2548
2551
You can’t perform that action at this time.
0 commit comments