Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: 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 CreditAttribution: 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.