archive.php - SQLSTATE[42S22]: Column not found: 1054 Unknown column '-1' in 'field list' #3453

Closed
anonymous-piwik-user opened this Issue Oct 18, 2012 · 7 comments

2 participants

@anonymous-piwik-user

As mentioned in the forum (http://forum.piwik.org/read.php?2,94529) there is a problem with core/RankingQuery.php.

The fix from matt solves the problem:

--- core/RankingQuery.php (revision 7136)
+++ core/RankingQuery.php (revision )
@@ -288,7 +288,7 @@
{
$labelColumnsOthersSwitch[] = "
CASE

  • WHEN counter = $limit THEN \"{$this->othersLabelValue}\"
  • WHEN counter = $limit THEN '{$this->othersLabelValue}' ELSE !$column END AS !$column ";

Now archive.php is running fine. But withing the Transitions plugin, there is still an error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column !'' in 'field list'

The same problem exists with a totaly new and clean install of piwik

My setup:

SuSE Linux Enterprise
PHP 5.3.17 with APC
mysql 5.5.28 x64 Community

@mattab
Piwik Open Source Analytics member

(In [7293]) Fixes #3453 Compatibility with ANSI_QUOTES
If the ANSI_QUOTES SQL mode is enabled, string literals can be quoted only within single quotes because a string quoted within double quotes is interpreted as an identifier.

@mattab
Piwik Open Source Analytics member

(In [7294]) Without debug statement please Refs #3453

@anonymous-piwik-user

There is still a problem with the Transitions plugin:
SQLSTATE[42S22]: Column not found: 1054 Unknown column !'' in 'field list'

@mattab
Piwik Open Source Analytics member

I fixed in: http://dev.piwik.org/trac/changeset/7293#file1

have you tried this patch? it works for me

@anonymous-piwik-user

Yes i did exactly the same patch here without success.

After waiting for 2-3 seconds, i get SQLSTATE[42S22]: Column not found: 1054 Unknown column ' ' in 'field list'

@anonymous-piwik-user

OK.. found it.

You need to change this line
WHEN '.Piwik_Common::REFERER_TYPE_CAMPAIGN.' THEN CONCAT(referer_name, " ", referer_keyword)

to

WHEN '.Piwik_Common::REFERER_TYPE_CAMPAIGN.' THEN CONCAT(referer_name, \' \', referer_keyword)

then everything is working fine

@mattab
Piwik Open Source Analytics member

(In [7302]) Fixes #3453 Thanks for tip tsfoer. ANSI_SQL compatibility. Refs #3332

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment