Difference between revisions of "Issue:Crash on Postgres-based Mediawiki (patch included)"

From FollowTheScore
Jump to: navigation, search
(New page: {{Issue |Type = Bug | Change Request <-- please select |Extension = DPL | Wgraph | aiSee | Call <-- please select |Version = ? |Description = |Status = open }} =...)
 
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
{{Issue
 
{{Issue
  |Type        = Bug | Change Request  <-- please select
+
  |Type        = Bug
  |Extension  = DPL | Wgraph | aiSee | Call <-- please select
+
  |Extension  = DPL
  |Version    = ?
+
  |Version    = 1.7.5
  |Description =  
+
  |Description = SQL errors when using DPL with PostgreSQL (8.3.3) - easy to fix
 
  |Status      = open
 
  |Status      = open
 
}}
 
}}
Line 34: Line 34:
 
  ERROR: LIMIT #,# syntax is not supported HINT: Use separate LIMIT and OFFSET clauses.  
 
  ERROR: LIMIT #,# syntax is not supported HINT: Use separate LIMIT and OFFSET clauses.  
  
This patch corrects the problem, and according to the MySQL manual should be fine there too. (I can't test that, though.)
+
This patch (of DynamicPageList2.php) corrects the problem and it also works in MySQL (I have DLP in production use with this patch with MySQL ''and'' PostgreSQL).  
  
 
  2801c2801
 
  2801c2801

Latest revision as of 05:53, 12 April 2013

Description: SQL errors when using DPL with PostgreSQL (8.3.3) - easy to fix
Extension / Version: DPL   /   1.7.5
Type / Status: Bug   /   open

Problem

1.6.9 fails against a PostgreSQL-based wiki. Example:

 <dpl>
  category=Teams
 </dpl>

...produces:

The DPL extension (version 1.6.9) produced a SQL statement which lead to a Database error.
The reason may be an internal error of DPL or an error which you made,
especially when using DPL options like titleregexp.
Query text is:
SELECT DISTINCT page.page_namespace as page_namespace,page.page_title as page_title, REPLACE(REPLACE(CONCAT(
IF(page.page_namespace=0, , CONCAT(CASE page.page_namespace WHEN 1 THEN 'Talk' WHEN 2 THEN 'User' WHEN 3 THEN 
'User_talk' WHEN 4 THEN 'SHARCNETWiki' WHEN 5 THEN 'SHARCNETWiki_talk' WHEN 6 THEN 'Image' WHEN 7 THEN 'Image_talk' 
WHEN 8 THEN 'MediaWiki' WHEN 9 THEN 'MediaWiki_talk' WHEN 10 THEN 'Template' WHEN 11 THEN 'Template_talk' WHEN 12 
THEN 'Help' WHEN 13 THEN 'Help_talk' WHEN 14 THEN 'Category' WHEN 15 THEN 'Category_talk' END, ':')), 
page.page_title), '_', ' '),'♣','⣣') as sortkey FROM page INNER JOIN categorylinks AS cl0 ON 
page.page_id=cl0.cl_from AND (cl0.cl_to='Teams') WHERE 1=1 AND page.page_is_redirect=0 ORDER BY sortkey ASC LIMIT 0, 
500
Error message is:
ERROR: LIMIT #,# syntax is not supported HINT: Use separate LIMIT and OFFSET clauses. 

This patch (of DynamicPageList2.php) corrects the problem and it also works in MySQL (I have DLP in production use with this patch with MySQL and PostgreSQL).

2801c2801
<               $sSqlWhere .= " LIMIT $iOffset, " . intval( $iCount );
---
>               $sSqlWhere .= " OFFSET $iOffset LIMIT " . intval( $iCount );

Reply