[Tickets #443] NEW: SQL back-end for Preferences doesn't support long strings on Oracle

bugs at bugs.horde.org bugs at bugs.horde.org
Sun Aug 1 19:31:08 PDT 2004


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=443
-----------------------------------------------------------------------
 Ticket     | 443
 Created By | selsky at columbia.edu
 Summary    | SQL back-end for Preferences doesn't support long strings on Oracle
 Queue      | Horde Framework
 State      | Unconfirmed
 Priority   | 1. Low
 Type       | Bug
 Owners     | 
-----------------------------------------------------------------------


selsky at columbia.edu (2004-08-01 19:31) wrote:

I'm using Horde 2.2.5, IMP 3.2.5, and Turba 1.2.2 with Oracle 9.2 as the
database back-end.

I've created my horde_prefs table as follows:

create table horde_prefs (
  pref_uid        varchar2(255) not null,
  pref_scope      varchar2(16) not null ,
  pref_name       varchar2(32) not null,
  pref_value      CLOB,
  constraint PK_HORDE_PREFS primary key (PREF_UID, PREF_SCOPE, PREF_NAME)
)

The CLOB is supposed to store more than 4K characters, but I still get the
following error in horde.log:

[nativecode=ORA-01704: string literal too long] [on line 333 of
"/www/horde/lib/Prefs/sql.php"]

The problem seems to be that CLOBs can only accept >4K characters when bind
variables are used.  This means that prepare/execute
(http://pear.php.net/manual/en/package.database.db.intro-execute.php) must
be used instead of regular queries.

The following patch against Horde 2.x allows strings > 4K characters to be
used.  This should work across databases.  My patch only changes the
"update" and "insert" sections of sql.php.  The "select" sections seem to
work fine, as is.




More information about the bugs mailing list