Bug #99005 Flags of column-type-info is different
Submitted: 20 Mar 2020 11:31 Modified: 20 Mar 2020 12:13
Reporter: Samuel Liang Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S2 (Serious)
Version:5.6/5.7/8.0 OS:Any
Assigned to: CPU Architecture:Any

[20 Mar 2020 11:31] Samuel Liang
Description:
When using mysql client with "--column-type-info", the flags value for column count(*) are different between 2 group by queries(with "NOT_NULL NUM" and "NOT_NULL BINARY NUM" respectively as below). From the user's point of view they should be same.

How to repeat:
mysql> create table t1 (c1 int);
Query OK, 0 rows affected (0.08 sec)

mysql> insert into t1 values(1),(2),(3),(4);
Query OK, 4 rows affected (0.01 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql> select count(*) from t1 group by c1;
Field   1:  `count(*)`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       LONGLONG
Collation:  binary (63)
Length:     21
Max_length: 1
Decimals:   0
Flags:      NOT_NULL NUM 

+----------+
| count(*) |
+----------+
|        1 |
|        1 |
|        1 |
|        1 |
+----------+
4 rows in set (0.00 sec)

mysql> select count(*) from t1;
Field   1:  `count(*)`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       LONGLONG
Collation:  binary (63)
Length:     21
Max_length: 1
Decimals:   0
Flags:      NOT_NULL BINARY NUM 

+----------+
| count(*) |
+----------+
|        4 |
+----------+
1 row in set (0.15 sec)
[20 Mar 2020 12:13] MySQL Verification Team
Thank you for the bug report.