Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0.9
-
None
-
None
Description
SET sql_mode=DEFAULT;
|
PREPARE stmt FROM "SELECT (SELECT DATE'2001-00-00') AS c";
|
EXECUTE stmt;
|
SET sql_mode='no_zero_in_date';
|
EXECUTE stmt;
|
returns:
+------------+
|
| c |
|
+------------+
|
| 2001-00-00 |
|
+------------+
|
1 row in set (0.00 sec)
|
for both EXECUTE.
This is wrong. The second EXECUTE should return NULL.
If I change the script slightly:
SET sql_mode=DEFAULT;
|
PREPARE stmt FROM "SELECT (SELECT DATE('2001-00-00')) AS c";
|
EXECUTE stmt;
|
SET sql_mode='no_zero_in_date';
|
EXECUTE stmt;
|
it correctly returns '2001-00-00' for the first EXECUTE and NULL for the second EXECUTE,
as expected.