[MDEV-12784] Change Item_func_length::print() to display octet_length() rather than length() Created: 2017-05-11  Updated: 2017-05-11  Resolved: 2017-05-11

Status: Closed
Project: MariaDB Server
Component/s: Parser
Fix Version/s: 10.3.1

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: Compatibility

Issue Links:
Blocks
blocks MDEV-12783 sql_mode=ORACLE: Functions LENGTH() a... Closed

 Description   

Currently Item_func_length::print() prints ``length()'':

EXPLAIN EXTENDED SELECT LENGTH('a'), OCTET_LENGTH('a');
SHOW WARNINGS;

+-------+------+------------------------------------------------------------------------+
| Level | Code | Message                                                                |
+-------+------+------------------------------------------------------------------------+
| Note  | 1003 | select length('a') AS `LENGTH('a')`,length('a') AS `OCTET_LENGTH('a')` |
+-------+------+------------------------------------------------------------------------+

We're going to implement MDEV-12783 soon, which will translate LENGTH() to OCTET_LENGTH() or CHAR_LENGTH() depending on sql_mode.

To make the result of Item_func_lengt::print() unambiguously work in virtual columns independently from sql_mode, will change Item_func_length::print() to print ``octet_length()'':

+-------+------+------------------------------------------------------------------------------------+
| Level | Code | Message                                                                            |
+-------+------+------------------------------------------------------------------------------------+
| Note  | 1003 | select octet_length('a') AS `LENGTH('a')`,octet_length('a') AS `OCTET_LENGTH('a')` |
+-------+------+------------------------------------------------------------------------------------+



 Comments   
Comment by Alexander Barkov [ 2017-05-11 ]

Pushed to bb-10.2-ext.

Generated at Thu Feb 08 08:00:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.