SQL error with SQLite db engine on Orphan Pages
- Status
- Closed
- Subject
- SQL error with SQLite db engine on Orphan Pages
- Version
- 1.9.x
- Category
- Error
- Feature
- Database independence (Non-Mysql, ADOdb Postgres, Oracle, etc)
- Resolution status
- Out of Date
- Submitted by
- ScottMac
- Volunteered to solve
- ScottMac
- Lastmod by
- Kissaki
- Rating
- Description
Within lib/stats/statslib.php there is a missing space between an identifier and the WHERE token, for SQLite ADOdb strips out the backtick resulting in an SQL error.
After grepping the code I can see that there are a few places that are going to cause this error.
lib/stats/statslib.php
$query_cant = "select count(*) from `tiki_pages` tp left join `tiki_links` tl on tp.`pageName` = tl.`toPage` left join `tiki_structures` ts on tp.`page_id`= ts.`page_id`where tl.`toPage` IS NULL and `ts`.page_id IS NULL";
$query = "select `pageName`, `hits`, `page_size` as `len` ,`lastModif`, `user`, `ip`, `comment`, `version`, `flag` from `tiki_pages` tp left join `tiki_links` tl on tp.`pageName` = tl.`toPage` left join `tiki_structures` ts on tp.`page_id`= ts.`page_id`where tl.`toPage` IS NULL and `ts`.page_id IS NULL $mid order by ".$this->convert_sortmode($sort_mode);lib/faqs/faqlib.php
$query = "delete from `tiki_faqs`where `title`=?";lib/charts/chartlib.php
$query = "delete from `tiki_charts_votes`where `user`=? and `itemId`=?";lib/admin/adminlib.php
$query = "delete from `tiki_dsn`where `name`=? and `dsn`=?";
$query = "delete from `users_permissions`where `permName`=?";
$query = "delete from `tiki_tags`where `tagName`=? and `pageName`=?";- Solution
Add a space between each backtick and WHERE token.
Please upgrade to a recent version of tiki.
If the problem persists, please add a new tracker item.- Importance
- 4
- Priority
- 20
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 1485
- Created
- Tuesday 15 January, 2008 11:54:31 UTC
by Unknown - LastModif
- Saturday 08 August, 2009 19:59:23 UTC