[MDEV-10202] Virtual column value depends on the user who first opens the table Created: 2016-06-09  Updated: 2017-01-24  Resolved: 2017-01-24

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

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


 Description   

This script:

SET NAMES utf8;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT, b INT GENERATED ALWAYS AS (COALESCE('a'='A',a)) VIRTUAL); 
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (0);
SELECT * FROM t1;

returns

+------+------+
| a    | b    |
+------+------+
|    0 |    1 |
+------+------+

Now I flush and reopen the table with a binary session collation:

FLUSH TABLES;
SET NAMES utf8 COLLATE utf8_bin;
SELECT * FROM t1;

It returns:

+------+------+
| a    | b    |
+------+------+
|    0 |    0 |
+------+------+

Now I exit the client and start a new session:

SET NAMES utf8;
SELECT * FROM t1;

It returns:

+------+------+
| a    | b    |
+------+------+
|    0 |    0 |
+------+------+

These results looks wrong. The result of comparison of 'a'='A' depends on the @@collation_connection of the session which opened the table.



 Comments   
Comment by Sergei Golubchik [ 2016-10-16 ]

still an issue in 10.2.2?

Comment by Alexander Barkov [ 2017-01-17 ]

Does not seem to repeat in the latest 10.2.

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