Loading...
 

mysql5.7: ttif.value which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Status
Open
Subject
mysql5.7: ttif.value which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Version
12.x
12.x Regression
15.x
15.x Regression
Category
  • Error
  • Regression
Feature
Installer (profiles, upgrades and server-related issues)
Resolution status
Confirmed
Submitted by
Xavi (as xavidp - admin)
Volunteered to solve
Xavier de Pedro
Lastmod by
Xavier de Pedro
Rating
(0)
Description

Applying the profile "Tracker_as_calendar_12" with php 5.6 or php7.0 (on ubuntu 16.04 64 bits with mysql 5.7) produces this type of error:

System error.

The following error message was returned:

Expression #8 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'tiki12svn_trackercalendar.ttif.value' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

The query was:
SELECT tti.*, ttif.`value`, ttf.`type`, `lastModif` as `sortvalue` FROM ( `tiki_tracker_items` tti INNER JOIN `tiki_tracker_item_fields` ttif ON tti.`itemId` = ttif.`itemId` INNER JOIN `tiki_tracker_fields` ttf ON ttf.`fieldId` = ttif.`fieldId`) WHERE tti.`trackerId` = ? and (`status`=? or `status`=?) AND `ttif`.`fieldId` IN( ?,?,?,?,?,? ) GROUP BY tti.`itemId` ORDER BY `sortvalue` desc

Values:

    1
    o
    p
    1
    2
    3
    4
    5
    6

The built query was likely:
SELECT tti.*, ttif.`value`, ttf.`type`, `lastModif` as `sortvalue` FROM ( `tiki_tracker_items` tti INNER JOIN `tiki_tracker_item_fields` ttif ON tti.`itemId` = ttif.`itemId` INNER JOIN `tiki_tracker_fields` ttf ON ttf.`fieldId` = ttif.`fieldId`) WHERE tti.`trackerId` = '1' and (`status`='o' or `status`='p') AND `ttif`.`fieldId` IN( '1','2','3','4','5','6' ) GROUP BY tti.`itemId` ORDER BY `sortvalue` desc

Stacktrace:
* /var/www/html/12.x/tiki-index.php : 0 -> {main}(array ( ))
* /var/www/html/12.x/tiki-index.php : 686 -> __toString(array ( ))
* /var/www/html/12.x/lib/core/Tiki/Render/Lazy.php : 22 -> call_user_func:{/var/www/html/12.x/lib/core/Tiki/Render/Lazy.php:22}(array ( ))
* /var/www/html/12.x/lib/core/Tiki/Render/Lazy.php : 22 -> {closure:/var/www/html/12.x/lib/wiki/renderlib.php:331-341}(array ( ))
* /var/www/html/12.x/lib/wiki/renderlib.php : 334 -> get_parse(array ( ))
* /var/www/html/12.x/lib/wiki/wikilib.php : 488 -> parse_data(array ( ))
* /var/www/html/12.x/lib/tikilib.php : 386 -> parse_data(array ( ))
* /var/www/html/12.x/lib/parser/parserlib.php : 1589 -> parse_first(array ( ))
* /var/www/html/12.x/lib/parser/parserlib.php : 476 -> plugin_execute(array ( ))
* /var/www/html/12.x/lib/parser/parserlib.php : 1018 -> wikiplugin_tabs(array ( ))
* /var/www/html/12.x/lib/wiki-plugins/wikiplugin_tabs.php : 84 -> parse_data(array ( ))
* /var/www/html/12.x/lib/tikilib.php : 386 -> parse_data(array ( ))
* /var/www/html/12.x/lib/parser/parserlib.php : 1589 -> parse_first(array ( ))
* /var/www/html/12.x/lib/parser/parserlib.php : 476 -> plugin_execute(array ( ))
* /var/www/html/12.x/lib/parser/parserlib.php : 1018 -> wikiplugin_trackerlist(array ( ))
* /var/www/html/12.x/lib/wiki-plugins/wikiplugin_trackerlist.php : 1692 -> list_items(array ( ))
* /var/www/html/12.x/lib/trackers/trackerlib.php : 1274 -> fetchAll(array ( ))
* /var/www/html/12.x/lib/core/TikiDb/Bridge.php : 32 -> fetchAll(array ( ))
* /var/www/html/12.x/lib/core/TikiDb/Pdo.php : 109 -> handleQueryError(array ( ))
* /var/www/html/12.x/lib/core/TikiDb.php : 148 -> handle(array ( ))


Same profile applied on older mysql (5.6) and older svn revision works as expected. Reproduced here:
https://demo.tiki.org/12x/tiki-index.php?page=Tracker_as_Calendar_12
u: admin
p: 12345

Solution

fixed in r61023. Applied cheapest fix with ANY_VALUE to the offending columns in the SELECT command, as suggested in https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html. Not a backport since this error is not present in current 15.x or 16.x.


UPDATE: I reverted r61023 in r61164
FIXReverting r61023. Revert My fix of ANY_VALUE function as a workaround for ONLY_FULL_GROUP_BY mode and compatibility with MySQL 5.7, because it is not compatible with MariaDB 10.0.x (function ANY_VALUE() doesn't exist) which can be also the default db engine in some servers. Related: https://jira.mariadb.org/browse/MDEV-10426 .

Workaround

Alternative workaround those using Mysql 5.7:

mysql > SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
Importance
5
Easy to solve?
4
Priority
20
Demonstrate Bug
Please demonstrate your bug on show2.tikiwiki.org

 About show2.tikiwiki.org

To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tikiwiki.org instance. To start, simply select a version and click on "Create show2.tikiwiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tikiwiki.org.

Version: Create show2.tikiwiki.org instance
Ticket ID
5923
Created
Thursday 05 May, 2016 11:23:44 GMT-0000
LastModif
Wednesday 01 February, 2017 00:28:13 GMT-0000

Attachments

 filenamecreatedhitscommentversionfiletype 
No attachments for this item


Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki development and should correspond to documentation keywords.

Each feature in Tiki has a wiki page which regroups all the bugs, requests for enhancements, etc. It is somewhat a form of wiki-based project management. You can also express your interest in a feature by adding it to your profile. You can also try out the Dynamic filter.

Accessibility (WAI & 508)
Accounting
Administration
Ajax
Articles & Submissions
Backlinks
Banner
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Calendar
Category
Chat
Comment
Communication Center
Consistency
Contacts Address book
Contact us
Content template
Contribution
Cookie
Copyright
Credits
Custom Home (and Group Home Page)
Database MySQL - MyISAM
Database MySQL - InnoDB
Date and Time
Debugger Console
Directory (of hyperlinks)
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
DogFood
Draw
Dynamic Content
Preferences
Dynamic Variable
External Authentication
FAQ
Featured links
Feeds (RSS)
File Gallery
Forum
Friendship Network (Community)
Gantt
Group
Groupmail
Help
History
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
jQuery
Kaltura video management
Karma
Live Support
Logs (system & action)
Lost edit protection
Mail-in
Map
Menu
Meta Tag
Missing features
Visual Mapping
Mobile
Mods
Modules
MultiTiki
MyTiki
Newsletter
Notepad
OS independence (Non-Linux, Windows/IIS, Mac, BSD)
Organic Groups (Self-managed Teams)
Packages
Payment
PDF
Performance Speed / Load / Compression / Cache
Permission
Poll
Profiles
Quiz
Rating
Realname
Report
Revision Approval
Scheduler
Score
Search engine optimization (SEO)
Search
Security
Semantic links
Share
Shopping Cart
Shoutbox
Site Identity
Slideshow
Smarty Template
Social Networking
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Staging and Approval
Stats
Survey
Syntax Highlighter (Codemirror)
Tablesorter
Tags
Task
Tell a Friend, alert + Social Bookmarking
Terms and Conditions
Theme
TikiTests
Timesheet
Token Access
Toolbar (Quicktags)
Tours
Trackers
TRIM
User Administration
User Files
User Menu
Watch
Webmail and Groupmail
WebServices
Wiki History, page rename, etc
Wiki plugins extends basic syntax
Wiki syntax text area, parser, etc
Wiki structure (book and table of content)
Workspace and perspectives
WYSIWTSN
WYSIWYCA
WYSIWYG
XMLRPC
XMPP




Useful Tools