Problem/Motivation

Going to the admin page in a Drupal + Oracle configuration i get:

PDOException: SELECT FROM {sessions} sessions (prepared: SELECT FROM "SESSIONS" sessions ) e: SQLSTATE[HY000]: General error: 936 OCIStmtExecute: ORA-00936: missing expression (/opt/workspace/php-5.3.6/ext/pdo_oci/oci_statement.c:148) args: Array ( ) in session_expire_settings() (line 38 of /opt/workspace/drupal/sites/all/modules/session_expire/session_expire.module).

In session_expire.module on line 38 we have.

<?php
// We want a count
  $query = db_select('sessions') ->execute();
  $session_count = $query->countQuery();
?>

Proposed resolution

For compatibility(i'm not sure this works with mysql either) this should be changed to:

<?php
  $session_count = db_select('sessions')
    ->countQuery()
    ->execute()
    ->fetchField();
?>

Remaining tasks

I will add a patch for this.

Comments

sionescu’s picture

StatusFileSize
new543 bytes
sionescu’s picture

Status: Active » Needs review
laurentchardin’s picture

Status: Needs review » Reviewed & tested by the community

+1 on this one... Because this query also crashes with MySQL.

This patch needs to be integrated.

laurentchardin’s picture

Assigned: Unassigned » laurentchardin
StatusFileSize
new706 bytes

Patch rebased.

laurentchardin’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Patch merged in dev.