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 return empty result #37253

Open
ChenPeng2013 opened this issue Aug 22, 2022 · 1 comment
Open

tiflash return empty result #37253

ChenPeng2013 opened this issue Aug 22, 2022 · 1 comment
Assignees
Labels
affects-6.1 affects-6.2 affects-6.3 affects-6.4 affects-6.5 component/tiflash may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@ChenPeng2013
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use test;
drop table if exists UK_SIGNED_19366;
CREATE TABLE `UK_SIGNED_19366` (
  `COL1` mediumint unsigned DEFAULT NULL COMMENT 'WITH DEFAULT',
  `COL2` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL,
  `COL4` datetime DEFAULT NULL,
  `COL3` bigint DEFAULT NULL,
  `COL5` float DEFAULT NULL,
  UNIQUE KEY `UK_COL1` (`COL1`) /*!80000 INVISIBLE */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
alter table UK_SIGNED_19366 set tiflash replica 1;
select sleep(3);
insert into UK_SIGNED_19366 values(1951614, "禸陛鎞灗聵枙颽摖鏔薰丿棞暪牱囍悎竊革鸱霺", "2871-01-14 16:48:22", 620923776300889260, 5.23202e37);

prepare stmt from 'SELECT /*+ read_from_storage(tikv[UK_SIGNED_19366] ) */ * FROM UK_SIGNED_19366 WHERE col1 = ? AND COL1 - ? < ?;';
set @a=1951614, @b=4493158, @c=14336206;
execute stmt using @a,@b,@c;

prepare stmt from 'SELECT /*+ read_from_storage(tiflash[UK_SIGNED_19366] ) */ * FROM UK_SIGNED_19366 WHERE col1 = ? AND COL1 - ? < ?;';
set @a=1951614, @b=4493158, @c=14336206;
execute stmt using @a,@b,@c;

SELECT /*+ read_from_storage(tiflash[UK_SIGNED_19366] ) */ * FROM UK_SIGNED_19366 WHERE col1 = 1951614 AND COL1 - 4493158 < 4493158;

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

MySQL [test]> prepare stmt from 'SELECT /*+ read_from_storage(tiflash[UK_SIGNED_19366] ) */ * FROM UK_SIGNED_19366 WHERE col1 = ? AND COL1 - ? < ?;';
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> set @a=1951614, @b=4493158, @c=14336206;
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> execute stmt using @a,@b,@c;
ERROR 1690 (22003): BIGINT value is out of range in '(1951614 - 4493158)' or right result

3. What did you see instead (Required)

MySQL [test]> prepare stmt from 'SELECT /*+ read_from_storage(tikv[UK_SIGNED_19366] ) */ * FROM UK_SIGNED_19366 WHERE col1 = ? AND COL1 - ? < ?;';
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> set @a=1951614, @b=4493158, @c=14336206;
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> execute stmt using @a,@b,@c;
ERROR 1690 (22003): BIGINT value is out of range in '(1951614 - 4493158)'
MySQL [test]>
MySQL [test]> prepare stmt from 'SELECT /*+ read_from_storage(tiflash[UK_SIGNED_19366] ) */ * FROM UK_SIGNED_19366 WHERE col1 = ? AND COL1 - ? < ?;';
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> set @a=1951614, @b=4493158, @c=14336206;
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> execute stmt using @a,@b,@c;
Empty set (0.01 sec)

MySQL [test]>
MySQL [test]> SELECT /*+ read_from_storage(tiflash[UK_SIGNED_19366] ) */ * FROM UK_SIGNED_19366 WHERE col1 = 1951614 AND COL1 - 4493158 < 4493158;
+---------+--------------------------------------------------------------+---------------------+--------------------+------------+
| COL1    | COL2                                                         | COL4                | COL3               | COL5       |
+---------+--------------------------------------------------------------+---------------------+--------------------+------------+
| 1951614 | 禸陛鎞灗聵枙颽摖鏔薰丿棞暪牱囍悎竊革鸱霺                     | 2871-01-14 16:48:22 | 620923776300889260 | 5.23202e37 |
+---------+--------------------------------------------------------------+---------------------+--------------------+------------+
1 row in set (0.01 sec)

4. What is your TiDB version? (Required)

| Release Version: v6.3.0-alpha
Edition: Community
Git Commit Hash: 8b5b724d8a932239303a1d0ba547323eb0e5161b
Git Branch: heads/refs/tags/v6.3.0-alpha
UTC Build Time: 2022-08-19 14:31:05
GoVersion: go1.18.5
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv |
@ChenPeng2013 ChenPeng2013 added type/bug The issue is confirmed as a bug. severity/major component/tiflash labels Aug 22, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 labels Aug 22, 2022
@ChenPeng2013 ChenPeng2013 added the sig/execution SIG execution label Sep 30, 2022
@apollodafoni
Copy link

/label affects-6.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.1 affects-6.2 affects-6.3 affects-6.4 affects-6.5 component/tiflash may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

5 participants