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

TiFlash throw false positive error when cast is executed in non-readonly statement #7348

Closed
windtalker opened this issue Apr 24, 2023 · 0 comments · Fixed by #7350
Closed

Comments

@windtalker
Copy link
Contributor

windtalker commented Apr 24, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Before execute the example, should set global tidb_enable_tiflash_read_for_write_stmt=on; in TiDB

create table t1(id int, amt decimal(21,3));
create table t2(id int, sumamt decimal(21,3));
insert into t1 values(1,100.333),(1,200),(2,100),(2,200);
alter table t1 set tiflash replica 1;

insert into t2
select /*+ read_from_storage(tiflash[t1]) */
id,cast(sum(amt)/9 as decimal(21,3))
from t1
group by 1;

It throw errors like this

ERROR 1105 (HY000): other error for mpp stream: From MPP<query:<query_ts:1682298546286311977, local_query_id:2, server_id:3778413, start_ts:441004470109995009>,task_id:2>: Code: 0, e.displayText() = DB::
TiFlashException: Truncate error cast decimal as decimal, e.what() = DB::TiFlashException,

But if read from TiKV, the insert success.

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

3. What did you see instead (Required)

4. What is your TiFlash version? (Required)

TiDB v6.5.1

@windtalker windtalker added the type/bug Issue for bug label Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants