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).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xjm’s picture

Title: Permissions Can't be Rebuilt » Support for SQL Server 2008
Category: bug » 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.)
xjm’s picture

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

// PRIOR TO POSTGRESQL 8.0: making a BIT_OR aggregate function
db_query("CREATE AGGREGATE BIT_OR (
  basetype = smallint,
  sfunc = int2or,
  stype = smallint
);");
xjm’s picture

Title: Support for SQL Server 2008 » Support other databases
xjm’s picture

d.novikov’s picture

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

xjm’s picture

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! :)

Chrys’s picture

Issue summary: View changes

TAC is essential for my project. I am using MSSQL. Are there any plans of patching this?

Otherwise I will need to change server :(

karoop’s picture

Status: Active » Needs review
Issue tags: +mssql sqlsrv, +sqlsrv
FileSize
1.55 KB

My stab at rewriting the query to not use the BIT_OR aggregate function. I've done a bit more work on the module and so far it looks like the query does what it's supposed to do.

Found and fixed another issue which is probably also related to using MS SQL - will create another issue and post the patch there.

Status: Needs review » Needs work

The last submitted patch, 8: taxonomy_access-sqlsrv-1266674-1.patch, failed testing.

karoop’s picture

Status: Needs work » Needs review
FileSize
1.57 KB

Corrected an error in the query - hopefully should pass the testing now.