Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#2260 closed Bug (fixed)

"piwik_option" table name should be quoted in SQL "version_core" update statement

Reported by: element Owned by:
Priority: normal Milestone: Piwik 1.3
Component: Core Keywords:
Cc: Sensitive: no

Description

I did an upgrade from Piwik 1.1.1 to 1.2.1 and it seemed everything was OK. But several days later I logged in and found that many of the displays gave the error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'visitor_idcookie' in 'field list'

So it became apparent that something had gone wrong with the upgrade. I set the version_core field to 1.1.1 as described in the forum and manually applied the update SQL queries. I found that the last one failed though because of a reserved word use:

UPDATE option SET option_value = "1.2-rc2" WHERE option_name = "version_core";

I don't have a table prefix defined, so the option table's name is simply "option". This is a reserved MySQL word. Quoting it, fixed the problem. Not sure if this was the reason why the original update went bad though. As a second potential issue, shouldn't the option_value be set to 1.2.1 instead of 1.2-rc2? I copied and pasted the SQL statements from the update page.

Change History (5)

comment:1 Changed 3 years ago by vipsoft (robocoder)

  • Milestone set to 1.3 - Piwik 1.3

comment:2 Changed 3 years ago by vipsoft (robocoder)

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

(In [4303]) fixes #2260 - thanks element

comment:3 Changed 3 years ago by vipsoft (robocoder)

Perhaps a proxy server in your network cached an older version? 1.2-rc2 is the pre-release candidate for 1.2.

As far as I can see, the actual 1.2.1 release would have set version_core to 1.2.1.

comment:4 Changed 3 years ago by element

When I went to change it back to 1.1.1 to get the update to run again, it was indeed set to 1.2.1. So I'm not sure why the update SQL statements had 1.2-rc2. I never installed that version either and there shouldn't be any proxy server on my DSL connection. The only thing I can think of is that the copy/paste SQL statements somehow differ from what is actually executed. Wish I could be more helpful on that one, doesn't seem like a major issue though.

comment:5 Changed 3 years ago by vipsoft (robocoder)

to clarify, in the case of an update, the sql shown will include all the intermediate statements. the final result should be 1.2.1.

Note: See TracTickets for help on using tickets.