Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 2.0.0-BETA2
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Microsoft Windows 7, php 5.3.2, MySQL 5.1.40-community
Description
The /Doctrine/DBAL/Platforms/MySqlPlatform->getListTableForeignKeysSQL() method returns SQL, that causes the following error:
exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1109 Unknown table 'variables' in information_schema' in X:\home\localhost\www\incubator\doctrine2\libraries\Doctrine\DBAL\Connection.php:568
Stack trace:
#0 X:\home\localhost\www\incubator\doctrine2\libraries\Doctrine\DBAL\Connection.php(568): PDO->query('SELECT DISTINCT...')
#1 X:\home\localhost\www\incubator\doctrine2\libraries\Doctrine\DBAL\Connection.php(524): Doctrine\DBAL\Connection->executeQuery('SELECT DISTINCT...', Array)
#2 X:\home\localhost\www\incubator\doctrine2\libraries\Doctrine\DBAL\Schema\AbstractSchemaManager.php(254): Doctrine\DBAL\Connection->fetchAll('SELECT DISTINCT...')
#3 X:\home\localhost\www\incubator\doctrine2\libraries\Doctrine\DBAL\Schema\AbstractSchemaManager.php(214): Doctrine\DBAL\Schema\AbstractSchemaManager->listTableForeignKeys('variables')
#4 X:\home\localhost\www\incubator\doctrine2\libraries\Doctrine\DBAL\Schema\AbstractSchemaManager.php(199): Doctrine\DBAL\Schema\AbstractSchemaManager->listTableDetails('variables')
#5 X:\home\localhost\www\incubator\doctrine2\libraries\Doctrine\ORM\Mapping\Driver\DatabaseDriver.php(155): Doctrine\DBAL\Schema\AbstractSchemaManager->listTables()
#6 X:\home\localhost\www\incubator\doctrine2\libraries\Doctrine\ORM\Mapping\ClassMetadataFactory.php(103): Doctrine\ORM\Mapping\Driver\DatabaseDriver->getAllClassNames()
#7 X:\home\localhost\www\incubator\doctrine2\index.php(53): Doctrine\ORM\Mapping\ClassMetadataFactory->getAllMetadata()
#8 {main}
The sessions table looks like:
CREATE TABLE `sessions` ( `id` char(32) NOT NULL DEFAULT '', `modified` int(11) DEFAULT NULL, `lifetime` int(11) DEFAULT NULL, `data` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
Can you use the sql logger to find out how exactly that failing SQL statement looks like?
$em->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logger\EchoSQLLogger());