Details
-
Technical task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3(EOL)
-
None
-
10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18
Description
In order to emulate Oracle's behavior in handling empty strings as NULL, we'll add a new sql_mode flag EMPTY_STRING_IS_NULL.
When this flag is set, we will:
- translate Item_string created in the parser to Item_null
- translate binding an empty string as prepared statement parameters to binding NULL
Note, more NULL handling flags will be added later under terms of separate patch:
- translating empty strings in function return values to NULL
- handling empty strings as equal to NULL in comparison operators
This task is only about literals and PS parameters.
The new flag will be disabled by default.
The new flag will NOT be a part of sql_mode=ORACLE.
In order to activate this behavior, one will have to do:
SET sql_mode='ORACLE,EMPTY_STRING_IS_NULL'; |
Attachments
Issue Links
- relates to
-
MDEV-16471 mysqldump throws "Variable 'sql_mode' can't be set to the value of 'NULL' (1231)"
- Closed
-
MDEV-23253 EMPTY_STRING_IS_NULL: error setting a not-NULL system variable to empty string
- Open
-
MDEV-27744 LPAD in vcol created in ORACLE mode makes table corrupted in non-ORACLE
- Closed