matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[Bug]: `BIGINT UNSIGNED` type, insert can success, but select abnormal.It is unreasonable.

Open tianyahui-python opened this issue 2 years ago • 1 comments

Is there an existing issue for the same bug?

  • [X] I have checked the existing issues.

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93):
- Hardware parameters:
- OS type:
- Others:

Actual Behavior

CREATE TABLE numbers(pk INTEGER PRIMARY KEY,ui BIGINT UNSIGNED,si BIGINT);

INSERT INTO numbers VALUES (0, 0, -9223372036854775808), (1, 18446744073709551615, 9223372036854775807);

SELECT * FROM numbers WHERE ui=0; error: "Can't cast column from BIGINT UNSIGNED type to BIGINT type because of one or more values in that column. Reason: overflow"

Expected Behavior

SELECT * FROM numbers WHERE ui=0;

mysql> SELECT * FROM numbers WHERE ui=0; +----+------+----------------------+ | pk | ui | si | +----+------+----------------------+ | 0 | 0 | -9223372036854775808 | +----+------+----------------------+

Steps to Reproduce

No response

Additional information

No response

tianyahui-python avatar Aug 12 '22 08:08 tianyahui-python

mysql> SELECT * FROM numbers WHERE ui=0; ERROR 1105 (HY000): Can't cast column from BIGINT UNSIGNED type to BIGINT type because of one or more values in that column. Reason: overflow mysql> update numbers set si=8 WHERE ui=0; ERROR 1105 (HY000): Can't cast column from BIGINT UNSIGNED type to BIGINT type because of one or more values in that column. Reason: overflow mysql> delete from numbers WHERE ui=0; ERROR 1105 (HY000): Can't cast column from BIGINT UNSIGNED type to BIGINT type because of one or more values in that column. Reason: overflow

tianyahui-python avatar Aug 12 '22 10:08 tianyahui-python

Conversion rules are already defined. uint64, int64 will cast as int64, int64. You can use: SELECT * FROM numbers WHERE ui=cast(0 as unsigned);

iamlinjunhong avatar Aug 29 '22 06:08 iamlinjunhong

截屏2022-10-24 16 41 46

tianyahui-python avatar Oct 24 '22 08:10 tianyahui-python

int64 cannot be converted implicitly to uint64 in parser. Can we adjust our plan to fix this issue? @fengttt @aunjgr

domingozhang avatar Nov 28 '22 07:11 domingozhang

not working on this

badboynt1 avatar Dec 09 '22 09:12 badboynt1

https://github.com/matrixorigin/matrixone/pull/6888 already fixed in this pr

badboynt1 avatar Dec 13 '22 09:12 badboynt1

截屏2022-12-15 22 09 26

tianyahui-python avatar Dec 15 '22 14:12 tianyahui-python

Hello @tianyahui-python. The bug issue in the BVT test code has not been removed,issues automatically open.

matrix-meow avatar Dec 15 '22 14:12 matrix-meow

bvt tag no remove. @badboynt1

tianyahui-python avatar Dec 21 '22 01:12 tianyahui-python

截屏2022-12-21 09 44 15

tianyahui-python avatar Dec 21 '22 01:12 tianyahui-python

relation issue: https://github.com/matrixorigin/matrixone/issues/7278

tianyahui-python avatar Dec 21 '22 03:12 tianyahui-python