Closed (won't fix)
Project:
Views (for Drupal 7)
Version:
5.x-1.6
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Jul 2007 at 13:04 UTC
Updated:
15 Mar 2010 at 18:14 UTC
The following line:
$fieldinfo['field'] = ($len <= 0 ? "term_data.name" : "LEFT(term_data.name, $len)");
is causing error report when Drupal is working on PostgreSQL. Due to PostgreSQL documentation, there is no LEFT() function there.
I am trying to prepare the patch for this, but I am not sure if I be albe to correct it in portable way.
According to , the substr() fuction should be better - it is supported by both database engines.
So the line propably should look like:
$fieldinfo['field'] = ($len <= 0 ? "term_data.name" : "substr(term_data.name, 1, $len)");
Comments
Comment #1
merlinofchaos commentedI'm targetting fixing this for Views 1.7; I played with SUBSTR() but it doesn't work on MySQL 3.23 so we need a more robust solution than just using SUBSTR. Probably a db type check, and probably a Views function to make it easier.
Comment #2
manveru commentedMySQL 3 is hard to support these days, it is no longer maintained by MySQL AB, I hope in Drupal 7 there will no longer be support for this version of MySQL.
I've changed both calls to left() in sql queries to substr() manually and I've got yet another error reported:
pg_query() [function.pg-query]: Query failed: ERROR: column "term_data.tid" must appear in the GROUP BY clause or be used in an aggregate function
I am not sure what I should do with this error.
Comment #3
manveru commentedBecause problem is still active in 1.6 and only God know when 1.7 will be released I suggest to add PostgreSQL function:
That piece of SQL code in my PostgreSQL database solves problem with Views module and its incompability with this really jazzy database.
Comment #4
sunCould you supply this SQL as a patch that adds a module update for PostGreSQL?
Comment #5
esmerel commentedNo patch submitted; issue hasn't been updated in more than a year.