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: