Loading...
 
Skip to main content

Bad SQL-Mode

Status
Open
Subject
Bad SQL-Mode
Version
7.x
Category
  • Consistency
  • Feature request
Feature
Database MySQL (MyISAM)
Resolution status
New
Submitted by
hoth
Lastmod by
hoth
Rating
(0)
Description

'ziit_tikiwiki.tf.galleryId' isn't in GROUP BY

Die Abfrage war:
SELECT tab.* FROM SELECT 0 as `isgal`, tf.`fileId` as `id`, tf.`galleryId` as `parentId`, tf.`name`, tf.`description`, tf.`filesize` as `size`, tf.`created`, tf.`filename`, tf.`filetype` as `type`, tf.`user` as `creator`, tf.`author`, tf.`hits`, tf.`lastDownload`, tf.`votes`, tf.`points`, tf.`path`, tf.`reference_url`, tf.`is_reference`, tf.`hash`, tf.`search_data`, tf.`lastModif` as `lastModif`, tf.`lastModifUser` as `last_user`, tf.`lockedby`, tf.`comment`, tf.`deleteAfter`, tf.`maxhits`, tf.`archiveId`, as `visible`, as `public`, tf.`fileId`, tf.`galleryId`, tf.`filesize`, tf.`filetype`, tf.`user`, tf.`lastModifUser`, as `files`, count(tfh.`fileId`) as `nbArchives` FROM `tiki_files` as tf LEFT JOIN `tiki_files` tfh ON (tf.`fileId` = tfh.`archiveId`) WHERE tf.`archiveId`=0 AND tf.`galleryId`=? GROUP BY tf.`fileId`) UNION (SELECT 1 as `isgal`, tfg.`galleryId` as `id`, tfg.`parentId`, tfg.`name`, tfg.`description`, 0 as `size`, tfg.`created`, tfg.`name` as `filename`, tfg.`type`, tfg.`user` as `creator`, as `author`, tfg.`hits`, 0 as `lastDownload`, tfg.`votes`, tfg.`points`, as `path`, as `reference_url`, as `is_reference`, as `hash`, tfg.`name` as `search_data`, tfg.`lastModif` as `lastModif`, as `last_user`, as `lockedby`, as `comment`, as `deleteAfter`, as `maxhits`, 0 as `archiveId`, tfg.`visible`, tfg.`public`, tfg.`galleryId` as `fileId`, tfg.`parentId` as `galleryId`, 0 as `filesize`, tfg.`type` as `filetype`, tfg.`user`, as `lastModifUser`, count(distinct tfc.`fileId`) as `files`, 0 as `nbArchives` FROM `tiki_file_galleries` as tfg LEFT JOIN `tiki_files` tfc ON (tfg.`galleryId` = tfc.`galleryId`) WHERE 1=1 AND tfg.`parentId`=? GROUP BY tfg.`galleryId` as tab ORDER BY `isgal` desc

Solution

Hello,

TikiWiki has a problem with the option "ONLY_FULL_GROUP_BY" in the sql_mode.

Please use "clean" SQL and set sql_mode to "ANSI,TRADITIONAL,ONLY_FULL_GROUP_BY"
=> rewrite the SQL.

Other DBMS (PostgreSQL, Oracle) have the same behaviour.

Regards,
Holger

Importance
4
Priority
20
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
4022
Created
Friday 28 October, 2011 14:17:52 UTC
by hoth
LastModif
Friday 28 October, 2011 14:17:52 UTC


Show PHP error messages