MantisBT: master 756a944e

Author Committer Branch Timestamp Parent
Bill Stidham Damien Regad master 2012-09-26 15:04 master 734af2f2
Affected Issues  0014774: Fix issue in tag api with odbc_mssql driver
Changeset

Fix issue in tag api with odbc_mssql driver

This branch of code was put into place to handle a deficiency in the
odbc_mssql driver that doesn't allow for bound subqueries. This is not
needed for the other mssql drivers, yet using db_is_mssql() returns true
for all mssql drivers so code is indiscriminately executed for other
drivers.

$t_params[] init was changed because it only needs to be set once. It is
needed for the query in the mssql condition block for the first query
only to grab the list of tags that aren't specific to this bug.
Afterwards in the second query, $t_params needs to be null or it results
in the database returning an error due to no '?' replacements.
Therefore, after running the first query, we need to set this to null.
If the condition fails and the dbtype is not mssql (or 'odbc_mssql')
then $t_params is already set.

Note: the multiple query setup in the "true" condition is a really bad
way to do this. I'm not going to mess with it, however, since the tag
count probably won't get too high in any general scenario.

Fixes 0014774

Signed-off-by: Damien Regad damien.regad@merckgroup.com

Note, this was simply checked for syntax errors and compliance with
coding guidelines as I don't have access to an MSSQL setup.

mod - core/tag_api.php Diff File