[kronolith] calendar not displaying events - sql
syntaxerror
Brian Bonnough
brian.bonnough at ce.gatech.edu
Sun Jun 22 15:14:09 PDT 2003
This patch now yields a different error message in the logs, see below.
Also, in the Calendar the Show Calendar drop down does not list any
calendars. However, under Options -> Calendars -> Edit Your Calendars they
do appear correctly, including the one that should be the default.
Creating a completely new database and logging in as admin the calendar
works. However, changing the authentication to imap, the first user to log
in is always listed as the cause of the parse error below (in this case
bb198). Changing the authentication back to sql does not allow it to work
again.
This is the CVS version of horde and kronolith with postgres.
Jun 22 18:00:51 HORDE [error] [kronolith] DB Error: invalid number: SELECT
DISTINCT a.category_id, c.category_name FROM horde_category_attributes a
LEFT JOIN horde_categories c ON a.category_id = c.category_id WHERE
c.group_uid = 'horde.shares.kronolith' AND ((attribute_name = 'owner' AND
attribute_value = 'bb198') OR (attribute_name = 'perm_users' AND
attribute_key = 'bb198' AND CASE WHEN CAST(attribute_value AS VARCHAR) ~
'(-[0-9]+|[0-9]+)' THEN (CAST(attribute_value AS INTEGER) & 2) <> 0 ELSE
FALSE END) OR (attribute_name = 'perm_default' AND CASE WHEN
CAST(attribute_value AS VARCHAR) ~ '(-[0-9]+|[0-9]+)' THEN
(CAST(attribute_value AS INTEGER) & 2) <> 0 ELSE FALSE END))
[nativecode=ERROR: pg_atoi: error in "bb198": can't parse "bb198"
"Eric Rostetter" <eric.rostetter at physics.utexas.edu> wrote in message
news:<1056164757.1298cc0ac9e9e at mail.ph.utexas.edu>...
>Yeah, I had this too. The SQL should work, but doesn't for some reason.
>It doesn't like the "SIMILAR TO" but it should. If you edit
>horde/lib/SQL.php and change the "SIMILAR TO" to "~" it will work. Patch is:
>Index: SQL.php
>===================================================================
>RCS file: /usr/repository/horde/lib/SQL.php,v
>retrieving revision 1.15
>diff -u -r1.15 SQL.php
>--- SQL.php 19 Jun 2003 18:47:44 -0000 1.15
>+++ SQL.php 21 Jun 2003 03:05:22 -0000
>@@ -37,7 +37,7 @@
> switch ($dbh->phptype) {
> case 'pgsql':
> // This should conform completely to SQL99.
>- return sprintf('CASE WHEN CAST(%s AS VARCHAR) SIMILAR TO
>\'(-[0-9]+|[0-9]+)\' THEN (CAST(%s AS INTEGER) %s %d) <> 0 ELSE FALSE END',
>$lhs, $lhs, $op, (int)$rhs);
>+ return sprintf('CASE WHEN CAST(%s AS VARCHAR) ~
>\'(-[0-9]+|[0-9]+)\' THEN (CAST(%s AS INTEGER) %s %d) <> 0 ELSE FALSE END',
>$lhs, $lhs, $op, (int)$rhs);
>
> default:
> return sprintf('%s %s %d', $lhs, $op, (int)$rhs);
>-- Eric Rostetter
>The Department of Physics
>The University of Texas at Austin
>Why get even? Get odd!
>-- Horde developers mailing list
>Frequently Asked Questions: http://horde.org/faq/
>To unsubscribe, mail: dev-unsubscribe at lists.horde.org
--
Brian Bonnough, CISSP
System Support Specialist II
Civil and Environmental Engineering
Georgia Institute of Technology
More information about the kronolith
mailing list