This module currently uses non-standard SQL.

First, there is the case with the WHERE 1. (As mentioned here: http://drupal.org/node/372928).
Using WHERE 1 = 1 is not a good fix either.
Try not using the WHERE case to get all cases.

For example, you have inside of the ipauth_get_uids() function:

<?php
     $which_cached[$which] = TRUE;
     if ($which == 'enabled') {
      $where = 'enabled = 1';
     } else {
      $where = '1';
     }
    $sql = "SELECT DISTINCT uid FROM {ip_authenticator} WHERE " .$where;
?>

Try this instead:

<?php
     $which_cached[$which] = TRUE;
     if ($which == 'enabled') {
      $where = 'WHERE enabled = 1';
     } else {
      $where = '';
     }
    $sql = "SELECT DISTINCT uid FROM {ip_authenticator}  " .$where;
?>

This way the WHERE clause is only included when it needs to be.

Another non-standard issue is the use of DATE_FORMAT(), which if I remember correctly is non-standard MySQL-specific code.

If you want to use non-standard SQL in this way, try using if ($db_type == 'mysql') and supply an else case for standards compliant SQL code.

Attached is a patch that makes these changes.

Comments

grub3’s picture

Still not committed?