CREATE TABLE `t1`
|
(
|
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
`title` VARCHAR(7) NOT NULL
|
)
|
ENGINE=InnoDB;
|
INSERT INTO `t1` (`id`,`title`) VALUES (1,'Title 1'),(2,'Title 2'),(3,'Title 3');
|
|
CREATE TABLE `t2`
|
(
|
`cid` INT UNSIGNED NOT NULL,
|
`access` TINYINT UNSIGNED NOT NULL,
|
PRIMARY KEY(`cid`,`access`)
|
)
|
ENGINE=InnoDB;
|
INSERT INTO `t2` (`cid`,`access`) VALUES (1,1),(1,2),(1,3),(2,4),(2,5),(2,6),(3,7),(3,8),(3,9);
|
|
SET sql_mode='ONLY_FULL_GROUP_BY';
|
SELECT `t1`.*,GROUP_CONCAT(`t2`.access SEPARATOR ',')`access` FROM `t1` JOIN `t2` ON `t1`.`id`=`t2`.`cid` WHERE `t1`.`id`=2 GROUP BY `t1`.`id`;
|
t1.title' isn't in GROUP BY QMYSQL3: Unable to prepare statement
https://dev.mysql.com/doc/refman/8.0/en/group-by-handling.html
SELECT name, address, MAX(age) FROM t GROUP BY name;
|
The query is valid if name is a primary key of t or is a unique NOT NULL column. In such cases, MySQL recognizes that the selected column is functionally dependent on a grouping column. For example, if name is a primary key, its value determines the value of address because each group has only one value of the primary key and thus only one row. As a result, there is no randomness in the choice of address value in a group and no need to reject the query.
In my query, `t1`.`id` is the primary key, and all values after it in` t1`. * will be unique all!
MySQL allows such a request in ONLY_FULL_GROUP_BY mode, MariaDB does not.
In the table `t1` there may be more than a hundred fields and they may change. There is no point in registering each in GROUP BY, it should be enough to register only the primary key!
I consider this behavior a serious error!
- relates to
-
MDEV-11588
Support for ONLY_FULL_GROUP_BY functional dependency
-
-
Stalled
{"report":{"fcp":617.2999999523163,"ttfb":158.79999995231628,"pageVisibility":"visible","entityId":78401,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"11cea65d-ce2e-41ce-9e1d-23a6b00f2075","navigationType":0,"readyForUser":694.3999998569489,"redirectCount":0,"resourceLoadedEnd":637.1999998092651,"resourceLoadedStart":165,"resourceTiming":[{"duration":6.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":165,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":165,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":171.5,"responseStart":0,"secureConnectionStart":0},{"duration":6.400000095367432,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":165.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":165.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":171.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":60.700000047683716,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":165.29999995231628,"connectEnd":165.29999995231628,"connectStart":165.29999995231628,"domainLookupEnd":165.29999995231628,"domainLookupStart":165.29999995231628,"fetchStart":165.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":165.29999995231628,"responseEnd":226,"responseStart":226,"secureConnectionStart":165.29999995231628},{"duration":146.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":165.39999985694885,"connectEnd":165.39999985694885,"connectStart":165.39999985694885,"domainLookupEnd":165.39999985694885,"domainLookupStart":165.39999985694885,"fetchStart":165.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":165.39999985694885,"responseEnd":312,"responseStart":312,"secureConnectionStart":165.39999985694885},{"duration":150.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":165.59999990463257,"connectEnd":165.59999990463257,"connectStart":165.59999990463257,"domainLookupEnd":165.59999990463257,"domainLookupStart":165.59999990463257,"fetchStart":165.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":165.59999990463257,"responseEnd":315.7999999523163,"responseStart":315.7999999523163,"secureConnectionStart":165.59999990463257},{"duration":151.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":165.69999980926514,"connectEnd":165.69999980926514,"connectStart":165.69999980926514,"domainLookupEnd":165.69999980926514,"domainLookupStart":165.69999980926514,"fetchStart":165.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":165.69999980926514,"responseEnd":317.2999999523163,"responseStart":317.2999999523163,"secureConnectionStart":165.69999980926514},{"duration":152.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":165.69999980926514,"connectEnd":165.69999980926514,"connectStart":165.69999980926514,"domainLookupEnd":165.69999980926514,"domainLookupStart":165.69999980926514,"fetchStart":165.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":165.69999980926514,"responseEnd":318.59999990463257,"responseStart":318.59999990463257,"secureConnectionStart":165.69999980926514},{"duration":154.20000004768372,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":165.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":165.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":320,"responseStart":0,"secureConnectionStart":0},{"duration":154,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":166,"connectEnd":166,"connectStart":166,"domainLookupEnd":166,"domainLookupStart":166,"fetchStart":166,"redirectEnd":0,"redirectStart":0,"requestStart":166,"responseEnd":320,"responseStart":320,"secureConnectionStart":166},{"duration":155.79999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":166.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":166.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":321.89999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":155.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":166.19999980926514,"connectEnd":166.19999980926514,"connectStart":166.19999980926514,"domainLookupEnd":166.19999980926514,"domainLookupStart":166.19999980926514,"fetchStart":166.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":166.19999980926514,"responseEnd":321.39999985694885,"responseStart":321.39999985694885,"secureConnectionStart":166.19999980926514},{"duration":461.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":174.39999985694885,"connectEnd":174.39999985694885,"connectStart":174.39999985694885,"domainLookupEnd":174.39999985694885,"domainLookupStart":174.39999985694885,"fetchStart":174.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":174.39999985694885,"responseEnd":635.5,"responseStart":635.5,"secureConnectionStart":174.39999985694885},{"duration":462.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":174.59999990463257,"connectEnd":174.59999990463257,"connectStart":174.59999990463257,"domainLookupEnd":174.59999990463257,"domainLookupStart":174.59999990463257,"fetchStart":174.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":174.59999990463257,"responseEnd":637.1999998092651,"responseStart":637.1999998092651,"secureConnectionStart":174.59999990463257},{"duration":249.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":376.59999990463257,"connectEnd":376.59999990463257,"connectStart":376.59999990463257,"domainLookupEnd":376.59999990463257,"domainLookupStart":376.59999990463257,"fetchStart":376.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":376.59999990463257,"responseEnd":626.1999998092651,"responseStart":626.1999998092651,"secureConnectionStart":376.59999990463257},{"duration":29.899999856948853,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":609.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":609.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":639.3999998569489,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":24,"responseStart":159,"responseEnd":174,"domLoading":162,"domInteractive":807,"domContentLoadedEventStart":807,"domContentLoadedEventEnd":852,"domComplete":1839,"loadEventStart":1839,"loadEventEnd":1840,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":786.8999998569489},{"name":"bigPipe.sidebar-id.end","time":787.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":787.7999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":790.1999998092651},{"name":"activityTabFullyLoaded","time":863.5999999046326}],"measures":[],"correlationId":"5077c31ddfa16d","effectiveType":"4g","downlink":9.6,"rtt":0,"serverDuration":77,"dbReadsTimeInMs":13,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}