When editing a node on a PostgreSQL-based Drupal site with Link Intelligence installed, multiple warnings of the following type are generated:

warning: pg_query() [function.pg-query]: Query failed: ERROR: LIMIT #,# syntax is not supported LINE 11: LIMIT 900, 100 ^ HINT: Use separate LIMIT and OFFSET clauses. in /home/friendsofqola/public_html/includes/database.pgsql.inc on line 138.
user warning: query: SELECT r.*, r.path AS pid, k.keyword, k.keyword_stem, p.priority AS page_priority, kwr.kid AS kwr_kid, kwr.priority AS keyword_priority, (r.priority * IF(p.priority >= 0, p.priority, IF(p.type_priority >= 0, p.type_priority, 50)) * IF(kwr.priority >= 0, kwr.priority, 50) / 1250) AS score, n.type AS node_type FROM linkintel_request r JOIN linkintel_keyword k ON k.kid = r.kid LEFT JOIN linkintel_page p ON p.path = r.path LEFT JOIN kwresearch_keyword kwr ON kwr.keyword = k.keyword LEFT JOIN node n ON r.nid = n.nid WHERE r.path NOT IN ('node/24','http://liferenewed.net/sites/default/files/QuickQOLA-1.2.6-install.exe%20','http://www.shopnotforgotten.org/','http://www.shopnotforgotten.org/','http://veteranscrisisline.net/','http://veteranscrisisline.net/') GROUP BY k.keyword ORDER BY score DESC, k.word_count DESC LIMIT 900, 100 in /home/friendsofqola/public_html/sites/all/modules/linkintel/linkintel.module on line 1001.

The problem is that PostgreSQL does not support the MySQL-specific 2-parameter LIMIT syntax. Both MySQL and PostgreSQL, though, support the use of the single-parameter LIMIT with an OFFSET clause. Patch to follow

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ben Coleman’s picture

Status: Active » Needs review
FileSize
1.55 KB

This patch fixes the above problem.

Ben Coleman’s picture

Title: PostgreSQL imcompatibility: LIMIT #,# syntax is not supported » PostgreSQL incompatibility: LIMIT #,# syntax is not supported
Ben Coleman’s picture

Issue summary: View changes

typo fixing