Summary | SQL driver error on PERMS_ROOT with PostgreSQL |
Queue | Horde Framework Packages |
Queue Version | FRAMEWORK_3 |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | chuck (at) horde (dot) org |
Requester | marcus (at) riboflavin (dot) net |
Created | 12/03/2008 (6058 days ago) |
Due | |
Updated | 12/22/2008 (6039 days ago) |
Assigned | 12/08/2008 (6053 days ago) |
Resolved | 12/22/2008 (6039 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | Yes |
State ⇒ Resolved
http://cvs.horde.org/diff.php/framework/Perms/Perms.php?rt=horde&r1=1.106&r2=1.107&ty=u
http://cvs.horde.org/diff.php/framework/Perms/Perms/datatree.php?rt=horde&r1=1.42&r2=1.43&ty=u
http://cvs.horde.org/diff.php/framework/Perms/Perms/sql.php?rt=horde&r1=1.6&r2=1.7&ty=u
http://cvs.horde.org/diff.php/horde/docs/CHANGES?rt=horde&r1=1.1186&r2=1.1187&ty=u
State ⇒ Assigned
Assigned to Chuck Hagenbuch
Priority ⇒ 2. Medium
New Attachment: patch
Patch ⇒ Yes
Milestone ⇒
Summary ⇒ SQL driver error on PERMS_ROOT with PostgreSQL
Type ⇒ Bug
State ⇒ Unconfirmed
Queue ⇒ Horde Framework Packages
made to the sql driver (Horde/Perms/sql.php) getPermissionId method.
The call to the database is made as 'SELECT perm_id FROM horde_perms
WHERE perm_name = ?', but at least with postgresql when the name id
for PERMS_ROOT (-1) is passed, it's interpreted as a number, not a
string, and postgresql complains:
Dec 3 10:25:55 dsl postgres[43453]: [5-3] STATEMENT: SELECT perm_id
FROM horde_perms WHERE perm_name = -1
Dec 3 10:26:10 dsl postgres[42457]: [5-1] ERROR: operator does not
exist: character varying = integer at character 49
Dec 3 10:26:10 dsl postgres[42457]: [5-2] HINT: No operator matches
the given name and argument type(s). You might need to add explicit
type casts.
It seems reasonable to shortcut this (both for this bug and
performance in general) to say if name == PERMS_ROOT return an id of
PERMS_ROOT (works on my install anyway).