6.0.0-beta6
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
4/10/26
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#1816] databinding broken on mssql -- Horde_SQL class
*
Your Email Address
*
Spam protection
Enter the letters below:
\ /. ..__.. . . >< |__|| ||\ | | / \| ||__|| \|\__|
Comment
> The buildClause function in Horde_SQL does not correctly handle > 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.
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers