When using SQL Server, TRUE cannot be used in a select statement. This is seen in masquerade.module on line 765.

  // Check to see if we need admin permission.
  $results = db_query('SELECT TRUE FROM {masquerade_users} WHERE uid_from = :uid_from AND uid_to = :uid_to', array(
    ':uid_from' => $user->uid,
    ':uid_to' => $new_user->uid,
  ));

The patch attached replaces TRUE with 1.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost’s picture

FileSize
582 bytes

Suppose proper fix is taken from core node_type_save()

$is_existing = (bool) db_query_range('SELECT 1 FROM {node_type} WHERE type = :type', 0, 1, array(':type' => $existing_type))->fetchField();
andypost’s picture

Status: Active » Needs review

rady to commit but needs to be tested on sql server

sneyerst’s picture

I have tested your patch with success on a SQL Server database.
Didn't knew there was something like db_query_range().
Thank you for that and also for making this module SQL Server compatible. :-)

andypost’s picture

Status: Needs review » Fixed

Thanx, commited

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

I had the patched version shown in the code-view. Replaced it with the current situation.

  • Commit 3b99932 on 7.x-1.x, 8.x-2.x, 8.x-2.x-admin-menu, 8.x-1.x-1836516 by andypost:
    Issue #1258376 by sneyerst, andypost: Incompatible SQL statement for SQL...

  • Commit 3b99932 on 7.x-1.x, 8.x-2.x, 8.x-2.x-admin-menu, 8.x-1.x-1836516 by andypost:
    Issue #1258376 by sneyerst, andypost: Incompatible SQL statement for SQL...