pingcap / pingcap/tiflash

`cast_string_string` in TiFlash standalone test has incorrect behaviour.

Open
#1,779 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

note that this issue won't reproduce with tidb, it only occurs in tiflash standalone.

reproduce step

  1. start a standalone tiflash:
./tiflash server --config=<tics>/tests/docker/config/tics_dt.toml
  1. create a test file, named cast_string_string_debug.test
# Preparation.
=> DBGInvoke __enable_schema_sync_service('true')

=> DBGInvoke __drop_tidb_table(default, test)
=> drop table if exists default.test

=> DBGInvoke __set_flush_threshold(1000000, 1000000)

# Data.
=> DBGInvoke __mock_tidb_table(default, test, 'a char')
=> DBGInvoke __refresh_schemas()
=> DBGInvoke __put_region(4, 0, 100, default, test)
=> DBGInvoke __raft_insert_row(default, test, 4, 50, '123d')

=> DBGInvoke dag('select count(1) from default.test group by a, cast_string_string(a)', 4, 'encode_type:chunk')
┌─count(1)─┬─a────┬─cast_string_string(a)─┐
│        1 │ 123d │                  123d │
└──────────┴──────┴───────────────────────┘

# Clean up.
=> DBGInvoke __drop_tidb_table(default, test)
=> drop table if exists default.test
  1. run this test:
<tics>/tests/run-test.sh cast_string_string_debug.test

File: delta-merge-test/query/expr/cast_string_string_debug.test
Error line: 15
Error: DBGInvoke dag('select count(1) from default.test group by a, cast_string_string(a)', 4, 'encode_type:chunk')
Result:
  ┌─count(1)─┬─a────┬─cast_string_string(a)─┐
  │        1 │ 123d │                   123 │
  └──────────┴──────┴───────────────────────┘
Expected:
  ┌─count(1)─┬─a────┬─cast_string_string(a)─┐
  │        1 │ 123d │                  123d │
  └──────────┴──────┴───────────────────────┘
  1. tiflash version: master
/Users/lf/flash/tiflash/storage/ch/cmake-build-qz/dbms/src/Server/tiflash version
TiFlash
Release Version: v5.0.0-nightly-52-g2be501e2b-dirty
Edition:         Community
Git Commit Hash: 2be501e2b7ce1529b654e36f22aa3708a16e9c0b
Git Branch:      master
UTC Build Time:  2021-04-15 05:19:55
Profile:         DEBUG

Raft Proxy
Git Commit Hash:   5a8ab3893eebf88c0cf0727a958a4c63f0f29df8
Git Commit Branch: HEAD
UTC Build Time:    2021-04-12 09:53:32
Rust Version:      rustc 1.51.0-nightly (1d0d76f8d 2021-01-24)
Storage Engine:    tiflash
Prometheus Prefix: tiflash_proxy_
Profile:           debug

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 tests/run-test.sh with the provided cast_string_string_debug.test scenario in delta-merge-test/query/expr. Trace the cast_string_string entry point and compare the standalone TiFlash result with the expected output; done means the test preserves the input value 123d rather than producing 123.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.