`from_unixtime/date_format` does not support use a non-constant for `pattern` argument
Open
Nobody has claimed this yet.
affects-5.4
affects-6.1
affects-6.2
affects-6.3
affects-6.4
affects-6.5
affects-6.6
affects-7.0
affects-7.1
affects-7.5
affects-8.1
component/compute
may-affects-4.0
may-affects-5.0
may-affects-5.1
may-affects-5.2
may-affects-5.3
may-affects-6.0
severity/major
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)
mysql> create table test(id int, v1 decimal(20,0), v2 varchar(100));
Query OK, 0 rows affected (0.12 sec)
mysql> alter table test set tiflash replica 1;
Query OK, 0 rows affected (0.17 sec)
mysql> set tidb_enforce_mpp=1;
Query OK, 0 rows affected (0.00 sec)
mysql> select from_unixtime(v1, v2) from test;
ERROR 1105 (HY000): other error for mpp stream: DB::Exception: Argument at index 1 for function dateFormat must be constant
mysql> select date_format(from_unixtime(v1), v2) from test;
ERROR 1105 (HY000): other error for mpp stream: DB::Exception: Second argument for function dateFormat must be String constant
2. What did you expect to see? (Required)
Query executed without error.
3. What did you see instead (Required)
mysql> select from_unixtime(v1, v2) from test;
ERROR 1105 (HY000): other error for mpp stream: DB::Exception: Argument at index 1 for function dateFormat must be constant
mysql> select date_format(from_unixtime(v1), v2) from test;
ERROR 1105 (HY000): other error for mpp stream: DB::Exception: Second argument for function dateFormat must be String constant
4. What is your TiFlash version? (Required)
master@ 3e7832b4b2484047e0954d7bf4e9809a132aadf4
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 reproducing the two queries in the issue and trace the TiFlash implementations or entry points for from_unixtime and date_format. Check how the pattern argument is validated and look for related tests. Done means both queries execute successfully when pattern is supplied by the v2 column, with coverage for these cases.
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
- 38/100