← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 600964] Re: using "search" orm method querying uppercase columns, produces PostgreSQL error "column TABLE.COLUMN does not exist"

 

The latest trunk contains a fix for this bug, so we can close this bug
now (a patch was needed in the read() method too, in addition to
expression.py).

Thanks for reporting this and for providing patches!

PS: I'm afraid such an nice-to-have improvement has very low chances to
be merged in any stable version (5.0 or 6.0), as it would be against all
stable policies.

** Changed in: openobject-server
       Status: Confirmed => Fix Released

** Changed in: openobject-server
    Milestone: None => 6.1

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/600964

Title:
  using "search" orm method querying uppercase columns, produces
  PostgreSQL error "column TABLE.COLUMN does not exist"

Status in OpenERP Server:
  Fix Released

Bug description:
  Using upper case field name causes PostgreSQL error while searching
  it.

  For instance, if you create a new object "custom.object" with an integer field "FIELD" and try searching it with
  self.pool.get('custom.object').search(cr, uid, [('FIELD', '=', 1)])
  PostgreSQL will tell "ERROR:  column custom_object.field does not exist".

  According to PostgreSQL documentation
  http://www.postgresql.org/docs/8.4/static/sql-syntax-lexical.html ,
  "unquoted names are always folded to lower case. For example, the
  identifiers FOO, foo, and "foo" are considered the same by PostgreSQL,
  but "Foo"  and "FOO" are different from these three and each other"

  By first analysis, I solved modifying the "__leaf_to_sql" method of "expression" class ( http://bazaar.launchpad.net/~openerp/openobject-server/trunk/annotate/2458/bin/osv/expression.py#L342 ) replacing every
  %s.%s
  with
  "%s"."%s"

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/600964/+subscriptions