[MDEV-12862] Data type of @a:=1e0 depends on the session character set Created: 2017-05-22  Updated: 2017-05-22  Resolved: 2017-05-22

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 10.1, 10.2, 10.3
Fix Version/s: 10.3.1

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

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed

 Description   

I start mysql --column-type-info test and run this script:

SET NAMES latin1;
CREATE OR REPLACE TABLE t1 AS SELECT @:=1e0;
SELECT * FROM t1;

It reports the following metadata:

Field   1:  `@:=1e0`
Type:       DOUBLE
Collation:  binary (63)
Length:     3
Max_length: 1
Decimals:   31

Now I run the same script, with latin1 changed to utf8:

SET NAMES utf8;
CREATE OR REPLACE TABLE t1 AS SELECT @:=1e0;
SELECT * FROM t1;

Metadata changes to:

Field   1:  `@:=1e0`
Type:       DOUBLE
Collation:  binary (63)
Length:     9
Max_length: 1
Decimals:   31

Notice, it reports length as 3 and 9 for latin1 and utf8 session character sets respectively.
Looks wrong. It should not depent on the session character set.



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

Pushed into bb-10.2-ext

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