Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
We'll be replacing data type specific constants STRING_ITEM, INT_ITEM, REAL_ITEM, DECIMAL_ITEM, DATE_ITEM to LITERAL_ITEM soon (see MDEV-14630).
Under terms of this task we'll remove usage of STRING_ITEM in Item_func_date_format::fix_length_and_dec() by replacing this condition:
if (arg1->type() == STRING_ITEM) |
to
StringBuffer<STRING_BUFFER_USUAL_SIZE> buffer;
|
String *str;
|
if (args[1]->basic_const_item() && |
(str= args[1]->val_str(&buffer)))
|
The main point in this condition is to catch constants (literals and bound Item_param instances), so calling val_str() can be done directly in fix_length_and_dec() to calculate the result max_length more precisely.
As a good side effect, this change will allow constants of non-string types, to calculate max_length more precisely.
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
- Closed
-
MDEV-14630 Replace {STRING|INT|REAL|DECIMAL|DATE}_ITEM to CONST_ITEM
- Closed