Project:Taxonomy Access Control
Version:7.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

I'm using SQL Server 2008.

Here's the error I get when I attempt to rebuild permissions:

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /?q=batch&id=88&op=do StatusText: error ResponseText: PDOException: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]'BIT_OR' is not a recognized built-in function name.: SELECT tadg.[rid] AS [rid], BIT_OR(COALESCE(ta.grant_view, tad.grant_view, tadg.grant_view)) AS grant_view, BIT_OR(COALESCE(ta.grant_update, tad.grant_update, tadg.grant_update)) AS grant_update, BIT_OR(COALESCE(ta.grant_delete, tad.grant_delete, tadg.grant_delete)) AS grant_delete, tadg.rid AS _field_0 FROM {taxonomy_term_data} td INNER JOIN {taxonomy_access_default} tadg ON tadg.vid = 0 LEFT OUTER JOIN {taxonomy_access_default} tad ON tad.vid = td.vid AND tad.rid = tadg.rid LEFT OUTER JOIN {taxonomy_access_term} ta ON ta.tid = td.tid AND ta.rid = tadg.rid INNER JOIN {taxonomy_index} ti ON td.tid = ti.tid WHERE ( ([ti].[nid] = :db_condition_placeholder_0) ) GROUP BY tadg.rid; Array ( [:db_condition_placeholder_0] => 1 ) in _taxonomy_access_node_access_records() (line 1290 of C:\www\sites\all\modules\taxonomy_access\taxonomy_access.module).

Comments

#1

Title:Permissions Can't be Rebuilt» Support for SQL Server 2008
Category:bug report» task
Priority:major» normal

Ah. From 2005 until the present TAC has only needed to supported MySQL-equivalent and Postgres. I should add this on the project page.

There are two possible ways to add support for databases that do not have BIT_OR():

  1. Add BIT_OR() somehow as was done for older versions of Postgres in 6.x and prior (not sure if this is possible).
  2. Refactor base queries somehow to do the logic in software. (This is nontrivial.)

#2

For reference, this is the code that added BIT_OR() for old versions of postgres:

<?php
// PRIOR TO POSTGRESQL 8.0: making a BIT_OR aggregate function
db_query("CREATE AGGREGATE BIT_OR (
  basetype = smallint,
  sfunc = int2or,
  stype = smallint
);"
);
?>

#3

Title:Support for SQL Server 2008» Support other databases

#4

#5

Also the module doesn't work for MSSQL database (sqlsrv driver). Please rewrite queries using Database abstraction layer.

#6

Please rewrite queries using Database abstraction layer.

The queries do use the database abstraction layer. That is not the issue. It's just that many databses don't support for the functionality TAC has used historically. Also, patches welcome! :)

nobody click here