Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#3453 closed Bug (fixed)

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

Reported by: tsfoer Owned by: matt
Priority: critical Milestone: 1.9.1 - Piwik 1.9.1
Component: Core Keywords:
Cc: Sensitive: no

Description

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

Change History (9)

comment:1 Changed 18 months ago by matt (mattab)

  • Milestone changed from 1.9.x - Piwik 1.9.x to 1.9.1 - Piwik 1.9.1

comment:2 Changed 18 months ago by matt (mattab)

  • Owner set to matt

comment:3 Changed 18 months ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from new to closed

(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.

comment:4 Changed 18 months ago by matt (mattab)

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

comment:5 Changed 18 months ago by tsfoer

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

Last edited 18 months ago by tsfoer (previous) (diff)

comment:6 Changed 18 months ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from reopened to closed

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

have you tried this patch? it works for me

comment:7 Changed 18 months ago by tsfoer

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'

comment:8 Changed 18 months ago by tsfoer

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

comment:9 Changed 18 months ago by matt (mattab)

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

Note: See TracTickets for help on using tickets.