When adding a view showing users online a PostgreSQL query is generated which uses IF function that is undefined (I guess the one from MySQL).

Steps to reproduce:

  1. Go to admin/structure/views/add.
  2. Show: users.
  3. Click "Continue" button.
  4. Add filter "User: is online".
  5. Click "Apply" button. (after this point you can already see the error behind the modal)
  6. Click "Apply" button.

The error I get is:
SQLSTATE[42883]: Undefined function: 7 ERROR: function if(boolean, integer, integer) does not exist LINE 7: WHERE (( (users.status <> '0') AND (IF((1462262107 - session... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.

And the SQL query:

SELECT users.name AS users_name, users.uid AS uid, users.created AS users_created
FROM 
{users} users
LEFT JOIN {sessions} sessions ON users.uid = sessions.uid
WHERE (( (users.status <> '0') AND (IF((1462260823 - sessions.timestamp) < 900, 1, 0) = '0') ))
ORDER BY users_created DESC
LIMIT 10 OFFSET 0

Comments

mrjigsaw created an issue.

mrjigsaw’s picture