[MDEV-8839] COLUMN_GET() produces warnings with no data Created: 2015-09-24  Updated: 2015-09-24  Resolved: 2015-09-24

Status: Closed
Project: MariaDB Server
Component/s: Virtual Columns
Affects Version/s: 10.0, 10.1
Fix Version/s: 10.1.8

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Sprint: 10.1.8-3

 Description   

SET @aaa = COLUMN_CREATE('price', 0xF0F1F2F3F4F5F6F7);
SELECT COLUMN_GET(@aaa, 'price' AS DECIMAL) aaa;
SHOW WARNINGS;

returns this warning:

+---------+------+---------------------------------------------------------+
| Level   | Code | Message                                                 |
+---------+------+---------------------------------------------------------+
| Warning | 1918 | Encountered illegal value '' when converting to DECIMAL |
+---------+------+---------------------------------------------------------+

Notice, the empty string in the warning text, instead of the actual data.

The expected result it to escape unreadable data, like it's done everything else, e.g:

SELECT _binary 0xF1F2F3F4F5F6F7 + 0;
SHOW WARNINGS;

+---------+------+------------------------------------------------------------------+
| Level   | Code | Message                                                          |
+---------+------+------------------------------------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: '\xF1\xF2\xF3\xF4\xF5\xF6\xF7' |
+---------+------+------------------------------------------------------------------+


Generated at Thu Feb 08 07:30:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.