Summary | databinding broken on mssql -- Horde_SQL class |
Queue | Horde Base |
Queue Version | 3.0.4 |
Type | Bug |
State | Resolved |
Priority | 3. High |
Owners | |
Requester | luke (at) softserve (dot) com (dot) au |
Created | 04/18/2005 (7400 days ago) |
Due | |
Updated | 04/19/2005 (7399 days ago) |
Assigned | |
Resolved | 04/19/2005 (7399 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
CVS side of it and I couldn't see a similar bug here.
State ⇒ Resolved
State ⇒ Unconfirmed
Priority ⇒ 3. High
Type ⇒ Bug
Summary ⇒ databinding broken on mssql -- Horde_SQL class
Queue ⇒ Horde Base
bitwise operators with mssql. The same code as is implemented for ODBC
should be used against mssql.
Furthermore, there is a bug in the ODBC code ... when $bind = true, it
tries to feed a '?' string through a %d field in sprintf. This forces
the generated SQL to "0" rather than "?", thereby breaking
databinding. It appears the same bug will eventually appear against
oci8 too, as the code is very similar. I've patched this for mssql by
changing:
case 'odbc':
// ODBC must have a valid boolean expression
$query = '(%s & %d) = %d';
if ($bind) {
return array(sprintf(Horde_SQL::escapePrepare($query),
Horde_SQL::escapePrepare($lhs), '?', '?'),
array((int)$rhs, (int)$rhs));
} else {
return sprintf($query, $lhs, (int)$rhs, (int)$rhs);
}
to:
case 'odbc':
case 'mssql':
// ODBC must have a valid boolean expression
if ($bind) {
$query = '(%s & %s) = %s';
return array(sprintf(Horde_SQL::escapePrepare($query),
Horde_SQL::escapePrepare($lhs), '?', '?'),
array((int)$rhs, (int)$rhs));
} else {
$query = '(%s & %d) = %d';
return sprintf($query, $lhs, (int)$rhs, (int)$rhs);
}
Without this fix, no datatree functionality exists.