pingcap / pingcap/tiflash

The conv function behaves inconsistently with both tidb and tikv in some cases

Open
#5,168 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component/compute severity/moderate type/bug
Dominant language
C++
Stars
1k
Forks
423
Avg merge
1d 15h
Merged PRs (30d)
24

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)
CREATE TABLE `t1` (
  `id` char(10) NOT NULL,
  PRIMARY KEY (`id`) /*T![clustered_index] NONCLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin 
insert into t1 values ("111");
set @@session.tidb_isolation_read_engines = "tiflash";
select * from t1 where conv(id,90,10) ="111";
2. What did you expect to see? (Required)
mysql> select * from t1 where conv(id,90,10) ="111";
Empty set (0.00 sec)

mysql> select * from t1 where conv(id,90,10) is null;
+-----+
| id  |
+-----+
| 111 |
+-----+
1 row in set (0.00 sec)
3. What did you see instead (Required)
mysql> select * from t1 where conv(id,90,10) ="111";
+-----+
| id  |
+-----+
| 111 |
+-----+
1 row in set (0.01 sec)

mysql> select * from t1 where conv(id,90,10) is null;
Empty set (0.01 sec)
4. What is your TiFlash version? (Required)

6.1.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied CREATE TABLE, INSERT, isolation-setting, and CONV queries against TiFlash 6.1.0 and compare the results with the expected MySQL behavior. Trace the CONV handling in the relevant TiFlash expression path; done means the equality and IS NULL queries produce the expected results, with regression coverage for this reproducer.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.