Re: [Tiki-devel] Fwd: SQL Query Error

Victor Emanouilov via TikiWiki-devel <[email protected]>
Newsgroups gmane.comp.cms.tiki.devel
Message-ID <[email protected]>
Hi Phil,

It seems either PHP_INT_MAX is not defined in your platform (highly 
unlikely) or a page calls this method without setting maxRecords 
correctly. Can you add 
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) before this line and 
send us the result, so we can see which page is calling the method?

Thanks,
Victor

On 12/30/22 11:00 AM, Phil Jollans wrote:
>
> More about the same error.
>
> I have got past this problem by commenting out line 2735 in filegallib.php
>
> $limit .= ', ' . ($maxRecords == -1 ? PHP_INT_MAX : $maxRecords);
>
> Phil
>
>
>
> -------- Forwarded Message --------
> Subject: 	SQL Query Error
> Date: 	Fri, 30 Dec 2022 09:48:43 +0100
> From: 	Phil Jollans <[email protected]>
> To: 	Tikiwiki developers <[email protected]>
>
>
>
> I am testing tiki 25.0 on a XAMPP before installing it on my server.
>
> I am getting the error
>
>
>   System error.
>
> The following error message was returned:
>
> *
> You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
> *
>
> *The query was:*
>
> *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.`metadata`, tf.`lastModif` as 
> `lastModif`, tf.`lastModifUser` as `last_user`, tf.`lockedby`, 
> tf.`comment`, tf.`deleteAfter`, tf.`maxhits`, tf.`archiveId`, 
> tf.`ocr_state`, '' as `visible`, '' as `public`, tf.`fileId`, 
> tf.`galleryId`, tf.`filesize`, tf.`filetype`, tf.`user`, 
> tf.`lastModifUser`, 0 as `icon_fileId`, '' as `files` FROM 
> `tiki_files` as tf WHERE tf.`archiveId`=0 AND tf.`created` > ? ORDER 
> BY `isgal` desc, `created` desc LIMIT 0, *
>
> *Values:*
>
>  1. 1670774331
>
> *The built query was likely:*
>
> *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.`metadata`, tf.`lastModif` as 
> `lastModif`, tf.`lastModifUser` as `last_user`, tf.`lockedby`, 
> tf.`comment`, tf.`deleteAfter`, tf.`maxhits`, tf.`archiveId`, 
> tf.`ocr_state`, '' as `visible`, '' as `public`, tf.`fileId`, 
> tf.`galleryId`, tf.`filesize`, tf.`filetype`, tf.`user`, 
> tf.`lastModifUser`, 0 as `icon_fileId`, '' as `files` FROM 
> `tiki_files` as tf WHERE tf.`archiveId`=0 AND tf.`created` > 
> '1670774331' ORDER BY `isgal` desc, `created` desc LIMIT 0, *
>
> Can anyone help me with this.
>
> It looks to me like the error is the trailing comma.
>
> If I remove the comma, I can execute the query in PhpMyAdmin.
> With the comma, I get the exact same error.
>
> Phil
>
>
>
>
>
> _______________________________________________
> TikiWiki-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel

_______________________________________________
TikiWiki-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.