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

Column information in error message should take along with database name #11140

Closed
SunRunAway opened this issue Jul 9, 2019 · 2 comments
Closed
Labels
component/expression good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility

Comments

@SunRunAway
Copy link
Contributor

SunRunAway commented Jul 9, 2019

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
mysql> SELECT DISTINCT 
    BIT_LENGTH( NULL ) AS field1 , 
    MIN( ATAN( `col_varchar_20_key`, `col_double_signed` ) ) AS field2 , 
    SECOND( ( ( @A := `col_double_unsigned` ) NOT LIKE `col_decimal_10_4_unsigned_key` ) ) AS field3 
FROM `table60_int_autoinc` 
HAVING MAKETIME( '01:01:40', 'r', field1 ) ;
  1. What did you expect to see?
ERROR 1140 (42000): In aggregated query without GROUP BY, expression #3 of SELECT list contains nonaggregated column 'col_double_unsigned'; this is incompatible with sql_mode=only_full_group_by
  1. What did you see instead?

Column information should be <database>.<table>.<column> format.

ERROR 1140 (42000): In aggregated query without GROUP BY, expression #3 of SELECT list contains nonaggregated column 'randgen_test.table60_int_autoinc.col_double_unsigned'; this is incompatible with sql_mode=only_full_group_by
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

fdbc149

@SunRunAway SunRunAway added type/bug The issue is confirmed as a bug. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility component/expression and removed type/bug The issue is confirmed as a bug. component/expression labels Jul 9, 2019
@gaoxingliang
Copy link
Contributor

I think this issue is fixed by #11406

@ghost
Copy link

ghost commented Aug 4, 2020

Confirming that this has been fixed:

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
 id INT NOT NULL PRIMARY KEY auto_increment,
 b INT NOT NULL,
 c INT NOT NULL
);

INSERT INTO t1 VALUES (NULL, 1, 1), (NULL, 1, 2);
SELECT b, c FROM t1 GROUP BY b;

..

mysql> SELECT b, c FROM t1 GROUP BY b;
ERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test.t1.c' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-870-g2a8b96845
Edition: Community
Git Commit Hash: 2a8b968453520e4fcf9d6ff46c9f23b4ad23feee
Git Branch: master
UTC Build Time: 2020-07-31 08:45:35
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)

I am going to close this issue now. Thanks!

@ghost ghost closed this as completed Aug 4, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility
Projects
None yet
Development

No branches or pull requests

2 participants