PDOException: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: integer = character varying at character 103 HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.: SELECT sap.sid AS sid FROM {session_api} sap LEFT OUTER JOIN {sessions} s ON sap.sid = s.sid WHERE (sap.timestamp < :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 1323691300 ) in session_api_cron() (line 115 of /var/www/sites/all/modules/session_api/session_api.module).

Comments

guenoz’s picture

Replacing the line 112 in session_api.module as follow did not solve the issue as expected

-  $query->leftJoin('sessions', 's', 'sap.sid = s.sid');
+  $query->leftJoin('sessions', 's', 'cast(sap.sid as text) = s.sid');
guenoz’s picture

correct me if I'm wrong but there is something incorrect in the query of session_api_cron():
the leftjoin is unnecessary, I've tested several times, same results with or without it.
And without it, it makes it work with postgresql, so why not getting rid of this line 112 ? ;)

jaydub’s picture

Please try patch in #1058960: Use an expiration logic when clearing sessions on cron as I think that is the issue here.

gold’s picture

Status: Active » Closed (duplicate)

I can confirm that this is a duplicate of #1058960.

Closing.

gold’s picture

I jumped the gun here a little. This patch from Comment #29 on #1058960 does fix the issue here. However, the patch there doesn't actually address the initial issue. The patch is in the wrong place. With the way that thread is going I suspect it's going to stagnate and never actually get resolved as the patches are addressing different issues now.

This patch should be attributed to jaydub

gold’s picture

Status: Closed (duplicate) » Needs review
a.ross’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Status: Needs review » Needs work
StatusFileSize
new0 bytes

That join does not seem to be correct, as the sap.session_id is something like I3EX9J_-d9nfryCPvC6AhOgH1oiI-ch7DwJnifUyphs. It should join on the sid column from both tables.

a.ross’s picture

oops. That is a straight re-roll of the incorrect patch.

a.ross’s picture

Status: Needs work » Closed (duplicate)

In fact I was half wrong, the sid of the sessions table is the same type of string, but it does not correspond to Session API's session_id string. Closing in favor of the other issue.