Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
statistics.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Sep 2008 at 20:56 UTC
Updated:
8 Dec 2008 at 18:20 UTC
I get a SQL error w/ PostgreSQL 8.3.3 accessing /admin/logs/visitors, the fix is to cast uid to text in the following CONCAT()...
modules/statistics/statistics.module, line 321:
$sql_cnt = "SELECT COUNT(DISTINCT(CONCAT(uid::text, hostname))) FROM {accesslog}";
Comments
Comment #1
pierce commentedi've seen no response to this. its still a problem. again, adding ::text to uid in that statement fixes it for PostgreSQL 8.3, but I have no idea if that works in MySQL.
Comment #2
drummNo, ::text would not work in MySQL. I would say just do COUNT(DISTINCT(uid, hostname)), but "PostgreSQL currently does not support DISTINCT with more than one input expression." according to http://www.postgresql.org/docs/8.2/interactive/sql-expressions.html.
The same query is present in the development version, in statistics.admin.inc. This will have a better chance of getting attention in that version and can be backported once solved. This query was introduced by http://drupal.org/node/48415.
Comment #3
pierce commentedWill MYSQL support...
?
thats valid standard SQL, but I'm not very familiar with mysql's behavior here with regards to casting.
Comment #4
dave reidMarking this as a duplicate of #229051: Top Visitor Page problem with PostgreSQL 8.3.