-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Inconsistent result when using hash partition and view #53088
Comments
I tried the result for the statements in the issue:
Even when you try the same view, the result is different. |
And the warning is: tidb> show warnings;
+---------+------+----------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------+
| Warning | 1292 | Truncated incorrect INTEGER value: 'k' |
+---------+------+----------------------------------------+
1 row in set (0.00 sec) |
Seems related to ONLY_FULL_GROUP_BY
|
I consider this as 'not a bug', due to order is not guaranteed when reading from multiple data regions, by default every partition will have its own data range(s). tidb> set @@sql_mode='';
Query OK, 0 rows affected (0.00 sec)
tidb> create table t (a int) partition by hash(a) partitions 2;
Query OK, 0 rows affected (0.08 sec)
tidb> insert into t values (0),(1);
Query OK, 2 rows affected (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 0
tidb> select * from t group by null;
+------+
| a |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
tidb> select * from t group by null;
+------+
| a |
+------+
| 0 |
+------+
1 row in set (0.01 sec)
tidb> select * from t limit 1;
+------+
| a |
+------+
| 0 |
+------+
1 row in set (0.01 sec)
tidb> select * from t limit 1;
+------+
| a |
+------+
| 1 |
+------+
1 row in set (0.00 sec) Please feel free to create a new issue if the |
After some searching, I think the following issues are duplicates of this:
Related bugs: I will fill in the details in #53175 to cover the SQL_MODE handling in VIEWs. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
Two queries should produce same result
3. What did you see instead (Required)
Sometimes queries will produce inconsistent results. The results are unstable.
4. What is your TiDB version? (Required)
8.0.11-TiDB-v8.2.0-alpha-94-g81a7cf5 TiDB Server (Apache License 2.0) Community Edition, MySQL 8.0 compatible
The text was updated successfully, but these errors were encountered: