`cast_string_string` in TiFlash standalone test has incorrect behaviour.
Open
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
- start a standalone tiflash:
./tiflash server --config=<tics>/tests/docker/config/tics_dt.toml
- 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
- 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 │
└──────────┴──────┴───────────────────────┘
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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