Re: [Tiki-devel] SQL error with tiki 29.1

ushindi bienvenu <[email protected]> Mon, 6 Apr 2026 00:06:11 +0200
Newsgroups gmane.comp.cms.tiki.devel
Message-ID <CAGLiibpXy=DWsXqx7hVyQrWbQZ=B2ATgXTX__xpyqyoJq68aRw@mail.gmail.com>
--===============0374371537406119547==
Content-Type: multipart/alternative; boundary="000000000000bab8d3064ebdc2c6"

--000000000000bab8d3064ebdc2c6
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Phil,

Thanks for reporting this.

I would like to study the case and try to reproduce it, but the current
information is not enough. Could you please let me know on which page or
action this happened, and whether it was during or after the upgrade?

That would help us investigate further.

Best regards,

usbbush


On Sun, Apr 5, 2026 at 10:40=E2=80=AFPM Philip Jollans <[email protected]> w=
rote:

> Hi,
>
> I got this error after updating to tiki 29.1 (from tiki 25.0)
>
>
> -------------------------------------------------------------------------=
-------------------
> System error.
>
> The following error message was returned:
>
> You have an error in your SQL syntax; check the manual that corresponds t=
o
> 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`, '' as `source`, '' as `files`, tf.`fileId`,
> tf.`galleryId`, tf.`filesize`, tf.`filetype`, tf.`user`,
> tf.`lastModifUser`, 0 as `icon_fileId` FROM `tiki_files` as tf WHERE
> tf.`archiveId`=3D0 AND tf.`created` > ? ORDER BY `isgal` desc, `created` =
desc
> LIMIT 0,
>
> Values:
>
>     1775381416
>
> 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`, '' as `source`, '' as `files`, tf.`fileId`,
> tf.`galleryId`, tf.`filesize`, tf.`filetype`, tf.`user`,
> tf.`lastModifUser`, 0 as `icon_fileId` FROM `tiki_files` as tf WHERE
> tf.`archiveId`=3D0 AND tf.`created` > '1775381416' ORDER BY `isgal` desc,
> `created` desc LIMIT 0,
>
> -------------------------------------------------------------------------=
-------------------
>
>
> I'm pretty sure that the trailing comma is the problem.
>
> I'm also pretty certain that the query comes from FileGalLib.php in the
> function get_files. I hacked the code to remove the comma, using:
> $query =3D preg_replace('/LIMIT\s+(\d+),\s*$/i', 'LIMIT $1', $query);
> but that's not really a solution.
>
> Phil
> _______________________________________________
> TikiWiki-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>

--000000000000bab8d3064ebdc2c6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><p>Hi Phil,</p>
<p>Thanks for reporting this.</p>
<p>I would like to study the case and try to reproduce it, but the current =
information is not enough. Could you please let me know on which page or ac=
tion this happened, and whether it was during or after the upgrade?</p>
<p>That would help us investigate further.</p>
<p>Best regards,<br></p><p>usbbush</p><br></div><br><div class=3D"gmail_quo=
te gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Sun, Apr=
 5, 2026 at 10:40=E2=80=AFPM Philip Jollans &lt;<a href=3D"mailto:phil@joll=
ans.com">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20=
4,204);padding-left:1ex"><u></u>

 =20
  <div>
    <p><font face=3D"Calibri">Hi,</font></p>
    <p><font face=3D"Calibri">I got this error after updating to tiki 29.1
        (from tiki 25.0)</font></p>
    <p><font face=3D"Calibri">---------------------------------------------=
-----------------------------------------------<br>
        System error.<br>
        <br>
        The following error message was returned:<br>
        <br>
        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 &#39;&#39; at line 1<br>
        <br>
        The query was:<br>
        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`,
        &#39;&#39; as `visible`, &#39;&#39; as `public`, &#39;&#39; as `sou=
rce`, &#39;&#39; as `files`,
        tf.`fileId`, tf.`galleryId`, tf.`filesize`, tf.`filetype`,
        tf.`user`, tf.`lastModifUser`, 0 as `icon_fileId` FROM
        `tiki_files` as tf WHERE tf.`archiveId`=3D0 AND tf.`created` &gt;
        ? ORDER BY `isgal` desc, `created` desc LIMIT 0,<br>
        <br>
        Values:<br>
        <br>
        =C2=A0 =C2=A0 1775381416<br>
        <br>
        The built query was likely:<br>
        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`,
        &#39;&#39; as `visible`, &#39;&#39; as `public`, &#39;&#39; as `sou=
rce`, &#39;&#39; as `files`,
        tf.`fileId`, tf.`galleryId`, tf.`filesize`, tf.`filetype`,
        tf.`user`, tf.`lastModifUser`, 0 as `icon_fileId` FROM
        `tiki_files` as tf WHERE tf.`archiveId`=3D0 AND tf.`created` &gt;
        &#39;1775381416&#39; ORDER BY `isgal` desc, `created` desc LIMIT 0,=
=C2=A0<br>
      </font><font face=3D"Calibri">---------------------------------------=
-----------------------------------------------------<br>
        <br>
        <br>
        I&#39;m pretty sure that the trailing comma is the problem.<br>
        <br>
        I&#39;m also pretty certain that the query comes from FileGalLib.ph=
p
        in the function get_files. I hacked the code to remove the
        comma, using:<br>
      </font><font face=3D"monospace">$query =3D
        preg_replace(&#39;/LIMIT\s+(\d+),\s*$/i&#39;, &#39;LIMIT $1&#39;, $=
query);</font><font face=3D"Calibri"><br>
        but that&#39;s not really a solution.</font></p>
    <p><font face=3D"Calibri">Phil</font></p>
  </div>

_______________________________________________<br>
TikiWiki-devel mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">T=
[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel" rel=
=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/listi=
nfo/tikiwiki-devel</a><br>
</blockquote></div></div>

--000000000000bab8d3064ebdc2c6--


--===============0374371537406119547==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============0374371537406119547==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
TikiWiki-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel

--===============0374371537406119547==--