| Summary | SQL back-end for Preferences doesn't support long strings on Oracle |
| Queue | Horde Framework Packages |
| Type | Bug |
| State | Resolved |
| Priority | 1. Low |
| Owners | |
| Requester | selsky (at) columbia (dot) edu |
| Created | 08/02/2004 (7808 days ago) |
| Due | |
| Updated | 08/11/2004 (7799 days ago) |
| Assigned | |
| Resolved | 08/11/2004 (7799 days ago) |
| Github Issue Link | |
| Github Pull Request | |
| Milestone | |
| Patch | No |
State ⇒ Resolved
(RELENG_2). Thanks!
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ SQL back-end for Preferences doesn't support long strings on Oracle
Queue ⇒ Horde Framework Packages
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.