[Date Prev][Date Next]
Back-sql and reserved words (ITS#3221)
Full_Name: Paul Koetsier
Submission from: (NULL) (22.214.171.124)
I'm running into a problem with reserved words when trying to use back-sql
together with MaxDB.
When trying to store inetOrgPerson entries in a table, I discovered that "uid"
is a reserved word in MaxDB. I therefore tried storing this attribute in a
column called uitattr. However, when trying to retrieve entries, I noticed that
back-sql was trying to perform a query that uses the attribute name as an alias
and were failing as a result:
backsql_get_attr_values(): error preparing query: SELECT certificateuser.uidattr
AS uid FROM certificateuser WHERE certificateuser.id=?
Return code: -1
Native error code: -7006
SQL engine state: 3006
As MaxDB accepts the use of reserved words as an alias when enclosed in double
quotes, I decided to make the following change to
< backsql_strfcat( &tmps, &tmpslen, "lblblblbcbl",
> backsql_strfcat( &tmps, &tmpslen, "lblcbclblbcbl",
< (ber_len_t)sizeof( " AS " ) - 1, " AS ",
> (ber_len_t)sizeof( " AS " ) - 1, " AS ",
This patch is working fine for me.
Would this be the correct way to resolve the issue?