Hi,

I have just installed the latest code snapshot on my Postgres-backed Drupal 6 site and get the following in my Postrgres logs:

2010-11-22 22:05:11 MSK FEHLER:  Syntaxfehler bei »A« bei Zeichen 299
2010-11-22 22:05:11 MSK ANWEISUNG:  SELECT DISTINCT(n.nid), bt.name as biblio_type_name, b.biblio_year, b.biblio_date,  CASE
	                    WHEN SUBSTR(n.title,1,1)='"'   THEN LOWER(SUBSTR(n.title,2))
	                    WHEN SUBSTR(n.title,1,1)='\''   THEN LOWER(SUBSTR(n.title,2))
	                    WHEN SUBSTR(n.title,1,2)='A '   THEN LOWER(SUBSTR(n.title,3))
	                    WHEN SUBSTR(n.title,1,3)='An '  THEN LOWER(SUBSTR(n.title,4))
	                    WHEN SUBSTR(n.title,1,4)='The ' THEN LOWER(SUBSTR(n.title,5))
	                    ELSE LOWER(n.title)
	                 END  FROM www_larsgrobe_de_6_node n left join www_XXX_6_biblio b  on n.vid=b.vid  inner join www_XXX_6_biblio_types bt  on b.biblio_type=bt.tid   WHERE n.type='biblio'   ORDER BY b.biblio_year desc, b.biblio_date desc,  CASE
	                    WHEN SUBSTR(n.title,1,1)='"'   THEN LOWER(SUBSTR(n.title,2))
	                    WHEN SUBSTR(n.title,1,1)='\''   THEN LOWER(SUBSTR(n.title,2))
	                    WHEN SUBSTR(n.title,1,2)='A '   THEN LOWER(SUBSTR(n.title,3))
	                    WHEN SUBSTR(n.title,1,3)='An '  THEN LOWER(SUBSTR(n.title,4))
	                    WHEN SUBSTR(n.title,1,4)='The ' THEN LOWER(SUBSTR(n.title,5))
	                    ELSE LOWER(n.title)
	                 END  asc  LIMIT 25 OFFSET 0

This seams to be related to the sort code, as I can display the bibliography when not sorted by date or type - sorting by author works fine.

Cheers, Lars.

Comments

grobe’s picture

grobe’s picture

Hi all, I updated to the latest dev-snapshot as of today, 28th Nov, and the error message for year and type sort order changed to this (Syntaxfehler is syntax error):

    * warning: pg_query(): Query failed: FEHLER: Syntaxfehler bei »A« LINE 4: WHEN SUBSTR(n.title,1,2)='A ' THEN LOW... ^ in /var/www/drupal/drupal-6.19/includes/database.pgsql.inc on line 139.

    * user warning: query: SELECT DISTINCT(n.nid), bt.name as biblio_type_name, bt.name, CASE WHEN SUBSTR(n.title,1,1)='"' THEN LOWER(SUBSTR(n.title,2)) WHEN SUBSTR(n.title,1,1)='\'' THEN LOWER(SUBSTR(n.title,2)) WHEN SUBSTR(n.title,1,2)='A ' THEN LOWER(SUBSTR(n.title,3)) WHEN SUBSTR(n.title,1,3)='An ' THEN LOWER(SUBSTR(n.title,4)) WHEN SUBSTR(n.title,1,4)='The ' THEN LOWER(SUBSTR(n.title,5)) ELSE LOWER(n.title) END FROM XXX_6_node n left join XXX_6_biblio b on n.vid=b.vid inner join XXX_6_biblio_types bt on b.biblio_type=bt.tid WHERE n.type='biblio' ORDER BY bt.name desc, CASE WHEN SUBSTR(n.title,1,1)='"' THEN LOWER(SUBSTR(n.title,2)) WHEN SUBSTR(n.title,1,1)='\'' THEN LOWER(SUBSTR(n.title,2)) WHEN SUBSTR(n.title,1,2)='A ' THEN LOWER(SUBSTR(n.title,3)) WHEN SUBSTR(n.title,1,3)='An ' THEN LOWER(SUBSTR(n.title,4)) WHEN SUBSTR(n.title,1,4)='The ' THEN LOWER(SUBSTR(n.title,5)) ELSE LOWER(n.title) END LIMIT 25 OFFSET 0 in /var/www/drupal/6.x_sites/all/modules/biblio/biblio.pages.inc on line 100.
rjerome’s picture

Sorry, I didn't get a chance to look at this yet. I have a postgresql setup, but it's not currently accessible. I actually have plans to do away with this particular bit of code anyway since it's not very efficient.

liam morland’s picture

Status: Active » Closed (outdated)

This version is no longer maintained. If this issue is still relevant to the Drupal 7 version, please re-open and provide details.