Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1480 closed Bug (fixed)

getTablesInstalled: underscore in prefix matches any character

Reported by: vipsoft Owned by: vipsoft
Priority: normal Milestone: Piwik 0.6.4
Component: Core Keywords:
Cc: Sensitive: no

Description (last modified by vipsoft)

Just as the '%' matches 0 or more characters in a LIKE expression, the '_' matches any character in a LIKE expression.

Create database with table prefix "piwik2".
Delete the config.ini.php.
Rerun installer this time using the table prefix "piwik_".
After submitting the "database setup" form:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'piwik.piwik_site' doesn't exist
Backtrace:

#0 /home/apang/work/piwik/dev/trunk/libs/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/apang/work/piwik/dev/trunk/libs/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array)
#2 /home/apang/work/piwik/dev/trunk/libs/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT idsite F...', Array)
#3 /home/apang/work/piwik/dev/trunk/libs/Zend/Db/Adapter/Abstract.php(706): Zend_Db_Adapter_Pdo_Abstract->query('SELECT idsite F...', Array)
#4 /home/apang/work/piwik/dev/trunk/core/PluginsFunctions/Sql.php(46): Zend_Db_Adapter_Abstract->fetchAll('SELECT idsite F...', Array)
#5 /home/apang/work/piwik/dev/trunk/core/PluginsFunctions/Sql.php(98): Piwik_Sql::fetchAll('SELECT idsite F...', Array)
#6 /home/apang/work/piwik/dev/trunk/plugins/SitesManager/API.php(117): Piwik_FetchAll('SELECT idsite F...')
#7 /home/apang/work/piwik/dev/trunk/core/Access.php(179): Piwik_SitesManager_API->getAllSitesId()
#8 /home/apang/work/piwik/dev/trunk/core/Access.php(191): Piwik_Access->reloadAccessSuperUser()
#9 /home/apang/work/piwik/dev/trunk/core/Piwik.php(1069): Piwik_Access->setSuperUser(true)
#10 /home/apang/work/piwik/dev/trunk/plugins/Installation/Controller.php(327): Piwik::setUserIsSuperUser()
#11 /home/apang/work/piwik/dev/trunk/plugins/Installation/Installation.php(72): Piwik_Installation_Controller->tablesCreation('The configurati...')
#12 [internal function]: Piwik_Installation->dispatch(Object(Piwik_Event_Notification))
#13 /home/apang/work/piwik/dev/trunk/libs/Event/Dispatcher.php(213): call_user_func_array(Array, Array)
#14 /home/apang/work/piwik/dev/trunk/core/PluginsManager.php(389): Event_Dispatcher->addObserver(Array, 'FrontController...')
#15 /home/apang/work/piwik/dev/trunk/core/PluginsManager.php(272): Piwik_PluginsManager->addPluginObservers(Object(Piwik_Installation))
#16 /home/apang/work/piwik/dev/trunk/core/PluginsManager.php(180): Piwik_PluginsManager->reloadPlugins()
#17 /home/apang/work/piwik/dev/trunk/core/FrontController.php(208): Piwik_PluginsManager->loadPlugins(Array)
#18 /home/apang/work/piwik/dev/trunk/index.php(58): Piwik_FrontController->init()
#19 {main}

Change History (3)

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

  • Description modified (diff)
  • Summary changed from Installation regression with existing tables in database (different prefix) to getTablesInstalled: underscore in prefix matches any character

Not a regression.

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

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

(In [2512]) fixes #1480

comment:3 Changed 4 years ago by matt (mattab)

nice one! this bug has been there forever and could never understand where this 'piwik_site already exist' error came from. kuddos!

Note: See TracTickets for help on using tickets.