Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

charset: incorrect result when querying in-txn updates when new collation is enabled #18702

Closed
bb7133 opened this issue Jul 21, 2020 · 1 comment
Assignees
Labels

Comments

@bb7133
Copy link
Member

bb7133 commented Jul 21, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE test.`t` (
  `a` bigint(20) primary key,
  `b` varchar(50) COLLATE utf8_general_ci DEFAULT NULL,
  `c` int,
  `d` int,
    UNIQUE KEY `idx_bc` (`b`, `c`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

INSERT INTO t VALUES (1, 'A', 10, 1);
INSERT INTO t VALUES (2, 'B', 20, 1);

BEGIN;
SELECT * FROM t WHERE c = 10;
UPDATE t SET c = 5 WHERE c = 10;
SELECT * FROM t FORCE INDEX(idx_bc) WHERE b = 'A';
ROLLBACK;

2. What did you expect to see? (Required)

tidb> SELECT * FROM t FORCE INDEX(idx_bc) WHERE b = 'A';
+---+------+------+------+
| a | b    | c    | d    |
+---+------+------+------+
| 1 | A    |    5 |    1 |
+---+------+------+------+
1 row in set (0.01 sec)

3. What did you see instead (Required)

tidb> SELECT * FROM t FORCE INDEX(idx_bc) WHERE b = 'A';
Empty set (0.00 sec)

4. Affected version (Required)

v4.0.0 - v4.0.2

5. Root Cause Analysis

To be filled

@bb7133
Copy link
Member Author

bb7133 commented Jul 22, 2020

Close this issue since it is fixed by #18703

@bb7133 bb7133 closed this as completed Jul 22, 2020
@bb7133 bb7133 removed the priority/P0 The issue has P0 priority. label Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants