Details
-
New Feature
-
Status: Stalled (View Workflow)
-
Critical
-
Resolution: Unresolved
-
None
Description
When SQL mode ONLY_FULL_GROUP_BY is enabled (as is default), MariaDB rejects, per the '92 SQL standard, any SELECT queries with (non-aggregated) columns not also listed in the GROUP BY statement with error 1055: "'db.table.column_name' isn't in GROUP_BY".
However, the 2003 spec loosens this restriction with a requirement that the columns need only be functionally dependent:
"17) If T is a grouped table, then let G be the set of grouping columns of T. In each ((value expression)) contained in ((select list)) , each column reference that references a column of T shall reference some column C that is functionally dependent on G or shall be contained in an aggregated argument of a ((set function specification)) whose aggregation query is QS."
Since version 5.7.5, available since late 2014, MySQL supports the detection of functional dependencies in GROUP BY statements. It would be good to see this ported over to MariaDB as well to eliminate the need for redundant double column listing (and presumable performance hit when dependent columns are needlessly iterated for grouping), where functional dependency could be detected. For some useful background, see this entry at the MySQLServerTeam blog, along with Roland Bouman's related write-up .
Since ONLY_FULL_GROUP_BY is now a default both in Maria and MySQL, not porting this to Maria would make migration from MySQL to Maria more involved, forcing either SQL mode or code changes where affected queries are used. (There's a related older ticket mentioning the ANY_VALUE() function to deal with the over-strict mode, however that alone makes for a clunky work-around to over-strict grouping.)
Attachments
Issue Links
- blocks
-
MDEV-28109 ANSI Mode & ONLY_FULL_GROUP_BY
-
- Open
-
- includes
-
MDEV-12867 Full scan despite appropriate index
-
- Stalled
-
-
MDEV-19307 Use functional dependencies when searching for conditions that can be pushed into materialized derived tables
-
- Open
-
-
MDEV-20541 Implement a flag to show if an expression is non-deterministic
-
- Stalled
-
- is duplicated by
-
MDEV-24239 ONLY_FULL_GROUP_BY not restricting ORDER BY
-
- Closed
-
- relates to
-
MDEV-20409 With ONLY_FULL_GROUP_BY work don't correct.
-
- Closed
-
-
MDEV-25133 sql mode ONLY_FULL_GROUP_BY lets query fail when grouping expression contains constant
-
- Open
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
When SQL mode ONLY_FULL_GROUP_BY is enabled (as is default), MariaDB rejects, per the '92 SQL standard, any queries with SELECT columns not also listed in the GROUP BY statement with error 1055: "_'db.table.column_name' isn't in GROUP_BY_".
However, the 2003 spec loosens this restriction with a requirement that the columns need only be functionally dependent: _"17) If T is a grouped table, then let G be the set of grouping columns of T. In each ((value expression)) contained in ((select list)) , each column reference that references a column of T shall reference some column C that is *functionally dependent on G* or shall be contained in an aggregated argument of a ((set function specification)) whose aggregation query is QS."_ Since version 5.7.5, available since late 2014, MySQL supports the detection of functional dependencies. It would be good to see this ported over to MariaDB as well to eliminate the need for redundant double column listing (and performance hit when dependent columns are also iterated for grouping), when functional dependency could be detected. For some useful background, see [this entry|http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/] at the MySQLServerTeam blog, along with Roland Bouman's [related write-up |http://rpbouman.blogspot.co.id/2014/09/mysql-575-group-by-respects-functional.html]. There's a related [older ticket|https://jira.mariadb.org/browse/MDEV-10426] mentioning the ANY_VALUE() function to work around the over-strict mode, however that alone makes for a clunky fix to the over-strict grouping mode. Since ONLY_FULL_GROUP_BY is now a default both in Maria and MySQL, not porting this to Maria would make migration from MySQL more involved, forcing either SQL mode or code changes where affected queries are used. |
When SQL mode ONLY_FULL_GROUP_BY is enabled (as is default), MariaDB rejects, per the '92 SQL standard, any queries with SELECT columns not also listed in the GROUP BY statement with error 1055: "_'db.table.column_name' isn't in GROUP_BY_".
However, the 2003 spec loosens this restriction with a requirement that the columns need only be functionally dependent: _"17) If T is a grouped table, then let G be the set of grouping columns of T. In each ((value expression)) contained in ((select list)) , each column reference that references a column of T shall reference some column C that is *functionally dependent on G* or shall be contained in an aggregated argument of a ((set function specification)) whose aggregation query is QS."_ Since version 5.7.5, available since late 2014, MySQL supports the detection of functional dependencies. It would be good to see this ported over to MariaDB as well to eliminate the need for redundant double column listing (and performance hit when dependent columns are also iterated for grouping), when functional dependency could be detected. For some useful background, see [this entry|http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/] at the MySQLServerTeam blog, along with Roland Bouman's [related write-up |http://rpbouman.blogspot.co.id/2014/09/mysql-575-group-by-respects-functional.html]. There's a related [older ticket|https://jira.mariadb.org/browse/MDEV-10426] mentioning the ANY_VALUE() function to work around the over-strict mode, however that alone makes for a clunky fix to the over-strict grouping mode. Since ONLY_FULL_GROUP_BY is now a default both in Maria and MySQL, not porting this to Maria would make migration from MySQL to Maria more involved, forcing either SQL mode or code changes where affected queries are used. |
Description |
When SQL mode ONLY_FULL_GROUP_BY is enabled (as is default), MariaDB rejects, per the '92 SQL standard, any queries with SELECT columns not also listed in the GROUP BY statement with error 1055: "_'db.table.column_name' isn't in GROUP_BY_".
However, the 2003 spec loosens this restriction with a requirement that the columns need only be functionally dependent: _"17) If T is a grouped table, then let G be the set of grouping columns of T. In each ((value expression)) contained in ((select list)) , each column reference that references a column of T shall reference some column C that is *functionally dependent on G* or shall be contained in an aggregated argument of a ((set function specification)) whose aggregation query is QS."_ Since version 5.7.5, available since late 2014, MySQL supports the detection of functional dependencies. It would be good to see this ported over to MariaDB as well to eliminate the need for redundant double column listing (and performance hit when dependent columns are also iterated for grouping), when functional dependency could be detected. For some useful background, see [this entry|http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/] at the MySQLServerTeam blog, along with Roland Bouman's [related write-up |http://rpbouman.blogspot.co.id/2014/09/mysql-575-group-by-respects-functional.html]. There's a related [older ticket|https://jira.mariadb.org/browse/MDEV-10426] mentioning the ANY_VALUE() function to work around the over-strict mode, however that alone makes for a clunky fix to the over-strict grouping mode. Since ONLY_FULL_GROUP_BY is now a default both in Maria and MySQL, not porting this to Maria would make migration from MySQL to Maria more involved, forcing either SQL mode or code changes where affected queries are used. |
When SQL mode ONLY_FULL_GROUP_BY is enabled (as is default), MariaDB rejects, per the '92 SQL standard, any queries with SELECT columns not also listed in the GROUP BY statement with error 1055: "_'db.table.column_name' isn't in GROUP_BY_".
However, the 2003 spec loosens this restriction with a requirement that the columns need only be functionally dependent: _"17) If T is a grouped table, then let G be the set of grouping columns of T. In each ((value expression)) contained in ((select list)) , each column reference that references a column of T shall reference some column C that is *functionally dependent on G* or shall be contained in an aggregated argument of a ((set function specification)) whose aggregation query is QS."_ Since version 5.7.5, available since late 2014, MySQL supports the detection of functional dependencies. It would be good to see this ported over to MariaDB as well to eliminate the need for redundant double column listing (and performance hit when dependent columns are also iterated for grouping), when functional dependency could be detected. For some useful background, see [this entry|http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/] at the MySQLServerTeam blog, along with Roland Bouman's [related write-up |http://rpbouman.blogspot.co.id/2014/09/mysql-575-group-by-respects-functional.html]. Since ONLY_FULL_GROUP_BY is now a default both in Maria and MySQL, not porting this to Maria would make migration from MySQL to Maria more involved, forcing either SQL mode or code changes where affected queries are used. (There's a related [older ticket|https://jira.mariadb.org/browse/MDEV-10426] mentioning the ANY_VALUE() function to deal with the over-strict mode, however that alone makes for a clunky work-around to the over-strict grouping mode.) |
Description |
When SQL mode ONLY_FULL_GROUP_BY is enabled (as is default), MariaDB rejects, per the '92 SQL standard, any queries with SELECT columns not also listed in the GROUP BY statement with error 1055: "_'db.table.column_name' isn't in GROUP_BY_".
However, the 2003 spec loosens this restriction with a requirement that the columns need only be functionally dependent: _"17) If T is a grouped table, then let G be the set of grouping columns of T. In each ((value expression)) contained in ((select list)) , each column reference that references a column of T shall reference some column C that is *functionally dependent on G* or shall be contained in an aggregated argument of a ((set function specification)) whose aggregation query is QS."_ Since version 5.7.5, available since late 2014, MySQL supports the detection of functional dependencies. It would be good to see this ported over to MariaDB as well to eliminate the need for redundant double column listing (and performance hit when dependent columns are also iterated for grouping), when functional dependency could be detected. For some useful background, see [this entry|http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/] at the MySQLServerTeam blog, along with Roland Bouman's [related write-up |http://rpbouman.blogspot.co.id/2014/09/mysql-575-group-by-respects-functional.html]. Since ONLY_FULL_GROUP_BY is now a default both in Maria and MySQL, not porting this to Maria would make migration from MySQL to Maria more involved, forcing either SQL mode or code changes where affected queries are used. (There's a related [older ticket|https://jira.mariadb.org/browse/MDEV-10426] mentioning the ANY_VALUE() function to deal with the over-strict mode, however that alone makes for a clunky work-around to the over-strict grouping mode.) |
When SQL mode ONLY_FULL_GROUP_BY is enabled (as is default), MariaDB rejects, per the '92 SQL standard, any queries with SELECT columns not also listed in the GROUP BY statement with error 1055: "_'db.table.column_name' isn't in GROUP_BY_".
However, the 2003 spec loosens this restriction with a requirement that the columns need only be functionally dependent: _"17) If T is a grouped table, then let G be the set of grouping columns of T. In each ((value expression)) contained in ((select list)) , each column reference that references a column of T shall reference some column C that is *functionally dependent on G* or shall be contained in an aggregated argument of a ((set function specification)) whose aggregation query is QS."_ Since version 5.7.5, available since late 2014, MySQL supports the detection of functional dependencies. It would be good to see this ported over to MariaDB as well to eliminate the need for redundant double column listing (and performance hit when dependent columns are also iterated for grouping), when functional dependency could be detected. For some useful background, see [this entry|http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/] at the MySQLServerTeam blog, along with Roland Bouman's [related write-up |http://rpbouman.blogspot.co.id/2014/09/mysql-575-group-by-respects-functional.html]. Since ONLY_FULL_GROUP_BY is now a default both in Maria and MySQL, not porting this to Maria would make migration from MySQL to Maria more involved, forcing either SQL mode or code changes where affected queries are used. (There's a related [older ticket|https://jira.mariadb.org/browse/MDEV-10426] mentioning the ANY_VALUE() function to deal with the over-strict mode, however that alone makes for a clunky work-around to over-strict grouping.) |
Description |
When SQL mode ONLY_FULL_GROUP_BY is enabled (as is default), MariaDB rejects, per the '92 SQL standard, any queries with SELECT columns not also listed in the GROUP BY statement with error 1055: "_'db.table.column_name' isn't in GROUP_BY_".
However, the 2003 spec loosens this restriction with a requirement that the columns need only be functionally dependent: _"17) If T is a grouped table, then let G be the set of grouping columns of T. In each ((value expression)) contained in ((select list)) , each column reference that references a column of T shall reference some column C that is *functionally dependent on G* or shall be contained in an aggregated argument of a ((set function specification)) whose aggregation query is QS."_ Since version 5.7.5, available since late 2014, MySQL supports the detection of functional dependencies. It would be good to see this ported over to MariaDB as well to eliminate the need for redundant double column listing (and performance hit when dependent columns are also iterated for grouping), when functional dependency could be detected. For some useful background, see [this entry|http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/] at the MySQLServerTeam blog, along with Roland Bouman's [related write-up |http://rpbouman.blogspot.co.id/2014/09/mysql-575-group-by-respects-functional.html]. Since ONLY_FULL_GROUP_BY is now a default both in Maria and MySQL, not porting this to Maria would make migration from MySQL to Maria more involved, forcing either SQL mode or code changes where affected queries are used. (There's a related [older ticket|https://jira.mariadb.org/browse/MDEV-10426] mentioning the ANY_VALUE() function to deal with the over-strict mode, however that alone makes for a clunky work-around to over-strict grouping.) |
When SQL mode ONLY_FULL_GROUP_BY is enabled (as is default), MariaDB rejects, per the '92 SQL standard, any queries with SELECT columns not also listed in the GROUP BY statement with error 1055: "_'db.table.column_name' isn't in GROUP_BY_".
However, the 2003 spec loosens this restriction with a requirement that the columns need only be functionally dependent: _"17) If T is a grouped table, then let G be the set of grouping columns of T. In each ((value expression)) contained in ((select list)) , each column reference that references a column of T shall reference some column C that is *functionally dependent on G* or shall be contained in an aggregated argument of a ((set function specification)) whose aggregation query is QS."_ Since version 5.7.5, available since late 2014, MySQL supports the detection of functional dependencies in GROUP BY statements. It would be good to see this ported over to MariaDB as well to eliminate the need for redundant double column listing (and presumable performance hit when dependent columns are needlessly iterated for grouping), when functional dependency could be detected. For some useful background, see [this entry|http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/] at the MySQLServerTeam blog, along with Roland Bouman's [related write-up |http://rpbouman.blogspot.co.id/2014/09/mysql-575-group-by-respects-functional.html]. Since ONLY_FULL_GROUP_BY is now a default both in Maria and MySQL, not porting this to Maria would make migration from MySQL to Maria more involved, forcing either SQL mode or code changes where affected queries are used. (There's a related [older ticket|https://jira.mariadb.org/browse/MDEV-10426] mentioning the ANY_VALUE() function to deal with the over-strict mode, however that alone makes for a clunky work-around to over-strict grouping.) |
Description |
When SQL mode ONLY_FULL_GROUP_BY is enabled (as is default), MariaDB rejects, per the '92 SQL standard, any queries with SELECT columns not also listed in the GROUP BY statement with error 1055: "_'db.table.column_name' isn't in GROUP_BY_".
However, the 2003 spec loosens this restriction with a requirement that the columns need only be functionally dependent: _"17) If T is a grouped table, then let G be the set of grouping columns of T. In each ((value expression)) contained in ((select list)) , each column reference that references a column of T shall reference some column C that is *functionally dependent on G* or shall be contained in an aggregated argument of a ((set function specification)) whose aggregation query is QS."_ Since version 5.7.5, available since late 2014, MySQL supports the detection of functional dependencies in GROUP BY statements. It would be good to see this ported over to MariaDB as well to eliminate the need for redundant double column listing (and presumable performance hit when dependent columns are needlessly iterated for grouping), when functional dependency could be detected. For some useful background, see [this entry|http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/] at the MySQLServerTeam blog, along with Roland Bouman's [related write-up |http://rpbouman.blogspot.co.id/2014/09/mysql-575-group-by-respects-functional.html]. Since ONLY_FULL_GROUP_BY is now a default both in Maria and MySQL, not porting this to Maria would make migration from MySQL to Maria more involved, forcing either SQL mode or code changes where affected queries are used. (There's a related [older ticket|https://jira.mariadb.org/browse/MDEV-10426] mentioning the ANY_VALUE() function to deal with the over-strict mode, however that alone makes for a clunky work-around to over-strict grouping.) |
When SQL mode ONLY_FULL_GROUP_BY is enabled (as is default), MariaDB rejects, per the '92 SQL standard, any queries with SELECT columns not also listed in the GROUP BY statement with error 1055: "_'db.table.column_name' isn't in GROUP_BY_".
However, the 2003 spec loosens this restriction with a requirement that the columns need only be functionally dependent: _"17) If T is a grouped table, then let G be the set of grouping columns of T. In each ((value expression)) contained in ((select list)) , each column reference that references a column of T shall reference some column C that is *functionally dependent on G* or shall be contained in an aggregated argument of a ((set function specification)) whose aggregation query is QS."_ Since version 5.7.5, available since late 2014, MySQL supports the detection of functional dependencies in GROUP BY statements. It would be good to see this ported over to MariaDB as well to eliminate the need for redundant double column listing (and presumable performance hit when dependent columns are needlessly iterated for grouping), where functional dependency could be detected. For some useful background, see [this entry|http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/] at the MySQLServerTeam blog, along with Roland Bouman's [related write-up |http://rpbouman.blogspot.co.id/2014/09/mysql-575-group-by-respects-functional.html]. Since ONLY_FULL_GROUP_BY is now a default both in Maria and MySQL, not porting this to Maria would make migration from MySQL to Maria more involved, forcing either SQL mode or code changes where affected queries are used. (There's a related [older ticket|https://jira.mariadb.org/browse/MDEV-10426] mentioning the ANY_VALUE() function to deal with the over-strict mode, however that alone makes for a clunky work-around to over-strict grouping.) |
Description |
When SQL mode ONLY_FULL_GROUP_BY is enabled (as is default), MariaDB rejects, per the '92 SQL standard, any queries with SELECT columns not also listed in the GROUP BY statement with error 1055: "_'db.table.column_name' isn't in GROUP_BY_".
However, the 2003 spec loosens this restriction with a requirement that the columns need only be functionally dependent: _"17) If T is a grouped table, then let G be the set of grouping columns of T. In each ((value expression)) contained in ((select list)) , each column reference that references a column of T shall reference some column C that is *functionally dependent on G* or shall be contained in an aggregated argument of a ((set function specification)) whose aggregation query is QS."_ Since version 5.7.5, available since late 2014, MySQL supports the detection of functional dependencies in GROUP BY statements. It would be good to see this ported over to MariaDB as well to eliminate the need for redundant double column listing (and presumable performance hit when dependent columns are needlessly iterated for grouping), where functional dependency could be detected. For some useful background, see [this entry|http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/] at the MySQLServerTeam blog, along with Roland Bouman's [related write-up |http://rpbouman.blogspot.co.id/2014/09/mysql-575-group-by-respects-functional.html]. Since ONLY_FULL_GROUP_BY is now a default both in Maria and MySQL, not porting this to Maria would make migration from MySQL to Maria more involved, forcing either SQL mode or code changes where affected queries are used. (There's a related [older ticket|https://jira.mariadb.org/browse/MDEV-10426] mentioning the ANY_VALUE() function to deal with the over-strict mode, however that alone makes for a clunky work-around to over-strict grouping.) |
When SQL mode ONLY_FULL_GROUP_BY is enabled (as is default), MariaDB rejects, per the '92 SQL standard, any SELECT queries with (non-aggregated) columns not also listed in the GROUP BY statement with error 1055: "_'db.table.column_name' isn't in GROUP_BY_".
However, the 2003 spec loosens this restriction with a requirement that the columns need only be functionally dependent: _"17) If T is a grouped table, then let G be the set of grouping columns of T. In each ((value expression)) contained in ((select list)) , each column reference that references a column of T shall reference some column C that is *functionally dependent on G* or shall be contained in an aggregated argument of a ((set function specification)) whose aggregation query is QS."_ Since version 5.7.5, available since late 2014, MySQL supports the detection of functional dependencies in GROUP BY statements. It would be good to see this ported over to MariaDB as well to eliminate the need for redundant double column listing (and presumable performance hit when dependent columns are needlessly iterated for grouping), where functional dependency could be detected. For some useful background, see [this entry|http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/] at the MySQLServerTeam blog, along with Roland Bouman's [related write-up |http://rpbouman.blogspot.co.id/2014/09/mysql-575-group-by-respects-functional.html]. Since ONLY_FULL_GROUP_BY is now a default both in Maria and MySQL, not porting this to Maria would make migration from MySQL to Maria more involved, forcing either SQL mode or code changes where affected queries are used. (There's a related [older ticket|https://jira.mariadb.org/browse/MDEV-10426] mentioning the ANY_VALUE() function to deal with the over-strict mode, however that alone makes for a clunky work-around to over-strict grouping.) |
Component/s | Parser [ 10201 ] | |
Component/s | Syntax [ 13909 ] |
Priority | Minor [ 4 ] | Major [ 3 ] |
Assignee | Igor Babaev [ igor ] |
Labels | Compatibility MySQL_575 only_full_group_by sql_mode | Compatibility MySQL_575 gsoc17 only_full_group_by sql_mode |
Fix Version/s | 10.4 [ 22408 ] |
Assignee | Igor Babaev [ igor ] | Varun Gupta [ varun ] |
Fix Version/s | 10.4 [ 22408 ] |
NRE Projects | RM_105_CANDIDATE |
Assignee | Varun Gupta [ varun ] | Galina Shalygina [ shagalla ] |
Fix Version/s | 10.5 [ 23123 ] |
NRE Projects | RM_105_CANDIDATE | RM_105_CANDIDATE RM_105_OPTIMIZER |
Status | Open [ 1 ] | In Progress [ 3 ] |
Due Date | 2019-09-16 |
Link |
This issue is duplicated by |
Link |
This issue is duplicated by |
Link |
This issue relates to |
Priority | Major [ 3 ] | Critical [ 2 ] |
Link | This issue includes MDEV-20541 [ MDEV-20541 ] |
Assignee | Galina Shalygina [ shagalla ] | Igor Babaev [ igor ] |
Due Date | 2019-09-16 |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.5 [ 23123 ] |
Link | This issue includes MDEV-12867 [ MDEV-12867 ] |
Assignee | Igor Babaev [ igor ] | Sergei Golubchik [ serg ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Assignee | Sergei Golubchik [ serg ] | Igor Babaev [ igor ] |
Link | This issue includes MDEV-19307 [ MDEV-19307 ] |
Rank | Ranked lower |
Rank | Ranked lower |
Priority | Critical [ 2 ] | Major [ 3 ] |
Link |
This issue is duplicated by |
Link | This issue relates to MDEV-25133 [ MDEV-25133 ] |
Fix Version/s | 10.7 [ 24805 ] | |
Fix Version/s | 10.6 [ 24028 ] |
Labels | Compatibility MySQL_575 gsoc17 only_full_group_by sql_mode | Compatibility MySQL_575 gsoc17 maybe-10. only_full_group_by sql_mode |
Labels | Compatibility MySQL_575 gsoc17 maybe-10. only_full_group_by sql_mode | Compatibility MySQL_575 gsoc17 maybe-10. maybe-10.7 only_full_group_by sql_mode |
Labels | Compatibility MySQL_575 gsoc17 maybe-10. maybe-10.7 only_full_group_by sql_mode | Compatibility MySQL_575 gsoc17 maybe-10.7 only_full_group_by sql_mode |
Fix Version/s | 10.7 [ 24805 ] |
Workflow | MariaDB v3 [ 78801 ] | MariaDB v4 [ 131667 ] |
Link | This issue blocks MDEV-28109 [ MDEV-28109 ] |
Issue Type | Task [ 3 ] | New Feature [ 2 ] |
Labels | Compatibility MySQL_575 gsoc17 maybe-10.7 only_full_group_by sql_mode | Compatibility MySQL_575 gsoc17 only_full_group_by sql_mode |
Assignee | Igor Babaev [ igor ] | Galina Shalygina [ shagalla ] |
Fix Version/s | 11.6 [ 29515 ] |
Fix Version/s | 11.7 [ 29815 ] | |
Fix Version/s | 11.6 [ 29515 ] |
Assignee | Galina Shalygina [ shagalla ] |
Fix Version/s | 11.8 [ 29921 ] | |
Fix Version/s | 11.7 [ 29815 ] |
Assignee | Sergei Petrunia [ psergey ] |
Fix Version/s | 11.9 [ 29945 ] | |
Fix Version/s | 11.8 [ 29921 ] |
Priority | Major [ 3 ] | Critical [ 2 ] |
Fix Version/s | 12.1 [ 29992 ] | |
Fix Version/s | 12.0 [ 29945 ] |
Fix Version/s | 12.1 [ 29992 ] |
Step I.
Simple SELECTs with GROUP BY.
Find functional dependencies in SELECTs with inner joins.
For each table its determined fields will be stored in special bitmap.
Later fields from the select list of the query will be checked if they depend on determined fields only (or are aggregational functions or constants).
Plan:
1*. Check if all SELECT list fields are already found to be determined (or are aggregational functions or constants).
1. For each table create determined fields bitmap. Mark in bitmaps fields used in GROUP BY.
Remark: ignore expressions in GROUP BY (a+b, a*b, ...). Process them as how they are processed now in ONLY_FULL_GROUP_BY mode.
Further plans: create for such an expressions invisible virtual columns.
2. Create a list of equalities eq_list from the top level of WHERE clause if it is AND level. Or a single equality list if WHERE clause is an equality.
3. Check if fields from bitmaps participate in any equalities. If so and fields that are equal to them aren't contained in bitmaps - add these new fields in bitmaps.
If both equality fields are already in bitmaps - drop this equality from eq_list.
4. Repeat step 3 until no new fields can't be extracted from equalities to be added to bitmaps.
5. Check if SELECT list fields depend on bitmap fields only (or are aggregational functions or constants).