[Tickets #606] NEW: Typecasting required in whups/lib/Driver/sql.php on Oracle

bugs at bugs.horde.org bugs at bugs.horde.org
Mon Sep 20 04:43:44 PDT 2004


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

Ticket URL: http://bugs.horde.org/ticket/?id=606
-----------------------------------------------------------------------
 Ticket     | 606
 Created By | rvs at angara.ru
 Summary    | Typecasting required in whups/lib/Driver/sql.php on Oracle
 Queue      | Whups
 State      | Unconfirmed
 Priority   | 2. Medium
 Type       | Bug
 Owners     | 
-----------------------------------------------------------------------


rvs at angara.ru (2004-09-20 04:43) wrote:

Attempt to fetch comments, file whups/lib/Driver/sql.php,v 1.195, 
function _getHistory().
The JOINs fail on Oracle, for example line 823:

$join .= 'LEFT JOIN whups_queues ON whups_logs.log_type = \'queue\' AND
whups_logs.log_value = whups_queues.queue_id ';

The clause whups_logs.log_value = whups_queues.queue_id causes an error
ORA-017222: invalid number because whups_queues.queue_id is NUMBER,
whups_logs.log_value is VARCHAR and contains non-numeric values (comments
itself). So implicit type conversion is failed.
Suggest explicit portable typecasting for NUMBER fields in all JOINs,
something like this:

$join .= 'LEFT JOIN whups_queues ON whups_logs.log_type = \'queue\' AND
whups_logs.log_value = cast(whups_queues.queue_id as character) ';





More information about the bugs mailing list