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

count agg's type infer for decimal property is inaccurate #17367

Closed
lysu opened this issue May 22, 2020 · 1 comment · Fixed by #17368 or #17591
Closed

count agg's type infer for decimal property is inaccurate #17367

lysu opened this issue May 22, 2020 · 1 comment · Fixed by #17368 or #17591
Assignees
Labels
Milestone

Comments

@lysu
Copy link
Contributor

lysu commented May 22, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use MySQL client connect tidb with --column-type-info

execute select count(1) from t; (t can be any table have data)

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

Field   1:  `count(1)`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       LONGLONG
Collation:  binary (63)
Length:     21
Max_length: 1
Decimals:   0
Flags:      NOT_NULL BINARY NUM 


+----------+
| count(1) |
+----------+
|        2 |
+----------+
1 row in set (0.014 sec)

3. What did you see instead (Required)

MySQL [test]> select count(1) from tt;
Field   1:  `count(1)`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       LONGLONG
Collation:  binary (63)
Length:     21
Max_length: 1
Decimals:   31
Flags:      NOT_NULL BINARY NUM 


+----------+
| count(1) |
+----------+
|        2 |
+----------+
1 row in set (0.003 sec)

4. Affected version (Required)

4.0 and master

5. Root Cause Analysis

count agg's type infer for decimal property is unaccurate

@ChenPeng2013
Copy link
Contributor

verified on
master: v4.0.0-beta.2-779-g9e5e2a933
release-4.0: v4.0.2-45-gb4da443a3
release-3.1: v3.1.2-56-g9a1cc53d1
release-3.0: v3.0.16-4-g338a0bd90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants