-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
bug: insert bigint data close to the boundary range, the result set is wrong #1332
Comments
@davidshiz, pls, give out the resul of |
ok, It has been updated, view the above content |
It seems like the similar problem with #1344 |
Simplify the sql:
|
same question mysql> select * from int8_tbl;
+---------------------+---------------------+
| q1 | q2 |
+---------------------+---------------------+
| 9223372036854775807 | 9223372036854775806 |
| NULL | NULL |
| 123 | 456 |
| 123 | 4567890123456789 |
| 4567890123456789 | 123 |
| 4567890123456789 | 4567890123456789 |
| 4567890123456789 | -4567890123456789 |
+---------------------+---------------------+
7 rows in set (0.00 sec)
mysql> SELECT * FROM int8_tbl WHERE q2 >= 4567890123456789;
Empty set (0.00 sec)
|
another similar problem mysql> select * from int8_tbl;
+----------------------+----------------------+
| q1 | q2 |
+----------------------+----------------------+
| -9223372036854775805 | -9223372036854775806 |
+----------------------+----------------------+
1 row in set (0.00 sec)
mysql> select * from int8_tbl where q2 = -9223372036854775807;
+----------------------+----------------------+
| q1 | q2 |
+----------------------+----------------------+
| -9223372036854775805 | -9223372036854775806 |
+----------------------+----------------------+
1 row in set (0.00 sec)
|
Yes, I'm working on this bug now. It seems like sth. wrong happened when do optimizer. |
root cause:
and then when do row filter,
|
…in or not in stoneatom#1332 [summary] In tianmu, pack_int uses uint64_t to store level 2 encode, ranges from [0, uint64_max], so when filter data, the conditions(in code named "pv1, pv2") should be also changed to level 2 encode. e.g.: stored value = actually value - min uint64 upv1 = pv1 - local_min; uint64 upv2 = local_max - local_min; the fixes mainly in funciont "EvaluatePack_BetweenInt". For not int (value): when value < local_min, it should be a special case. Only used when rough check = RS_ALL(no numeric data matchs), but table has null, rough check will be reset RS_SOME.
…ag --> (pv2 < local_min) stoneatom#1332
…in or not in #1332 [summary] In tianmu, pack_int uses uint64_t to store level 2 encode, ranges from [0, uint64_max], so when filter data, the conditions(in code named "pv1, pv2") should be also changed to level 2 encode. e.g.: stored value = actually value - min uint64 upv1 = pv1 - local_min; uint64 upv2 = local_max - local_min; the fixes mainly in funciont "EvaluatePack_BetweenInt". For not int (value): when value < local_min, it should be a special case. Only used when rough check = RS_ALL(no numeric data matchs), but table has null, rough check will be reset RS_SOME.
Have you read the Contributing Guidelines on issues?
Please confirm if bug report does NOT exists already ?
Describe the problem
Expected behavior
How To Reproduce
Environment
Are you interested in submitting a PR to solve the problem?
The text was updated successfully, but these errors were encountered: