Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0, 10.1, 10.2
-
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.