Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
anonymous-matomo-user opened this issue Oct 18, 2012 · 7 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. Critical Indicates the severity of an issue is very critical and the issue has a very high priority.
Milestone

Comments

@anonymous-matomo-user
Copy link

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
Copy link
Member

mattab commented Oct 24, 2012

(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
Copy link
Member

mattab commented Oct 24, 2012

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

@anonymous-matomo-user
Copy link
Author

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

@mattab
Copy link
Member

mattab commented Oct 24, 2012

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

have you tried this patch? it works for me

@anonymous-matomo-user
Copy link
Author

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-matomo-user
Copy link
Author

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
Copy link
Member

mattab commented Oct 24, 2012

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

@anonymous-matomo-user anonymous-matomo-user added this to the 1.9.1 - Piwik 1.9.1 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Critical Indicates the severity of an issue is very critical and the issue has a very high priority.
Projects
None yet
Development

No branches or pull requests

2 participants