Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-24

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1109 Unknown table

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major 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 |
      

        Activity

        Hide
        Hinikato Dubrai added a comment -

        Do you want that bug will be ignored and Doctrine will be worse product?

        SHOW FULL TABLES WHERE Table_type = "BASE TABLE"
        DESCRIBE sessions
        SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = 'sessions' */ WHERE k.table_name = 'sessions' AND table_schema = 'myak' AND `REFERENCED_COLUMN_NAME` is not NULL
        SHOW INDEX FROM sessions
        DESCRIBE system
        SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = 'system' */ WHERE k.table_name = 'system' AND table_schema = 'myak' AND `REFERENCED_COLUMN_NAME` is not NULL
        SHOW INDEX FROM system
        DESCRIBE variables
        SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = 'variables' */ WHERE k.table_name = 'variables' AND table_schema = 'myak' AND `REFERENCED_COLUMN_NAME` is not NULL
        
        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(101): Doctrine\ORM\Mapping\Driver\DatabaseDriver->getAllClassNames()
        #7 X:\home\localhost\www\incubator\doctrine2\index.php(57): Doctrine\ORM\Mapping\ClassMetadataFactory->getAllMetadata()
        #8 {main}
        
        Show
        Hinikato Dubrai added a comment - Do you want that bug will be ignored and Doctrine will be worse product? SHOW FULL TABLES WHERE Table_type = "BASE TABLE" DESCRIBE sessions SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND c.constraint_name = k.constraint_name AND c.table_name = 'sessions' */ WHERE k.table_name = 'sessions' AND table_schema = 'myak' AND `REFERENCED_COLUMN_NAME` is not NULL SHOW INDEX FROM sessions DESCRIBE system SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND c.constraint_name = k.constraint_name AND c.table_name = 'system' */ WHERE k.table_name = 'system' AND table_schema = 'myak' AND `REFERENCED_COLUMN_NAME` is not NULL SHOW INDEX FROM system DESCRIBE variables SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND c.constraint_name = k.constraint_name AND c.table_name = 'variables' */ WHERE k.table_name = 'variables' AND table_schema = 'myak' AND `REFERENCED_COLUMN_NAME` is not NULL 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(101): Doctrine\ORM\Mapping\Driver\DatabaseDriver->getAllClassNames() #7 X:\home\localhost\www\incubator\doctrine2\index.php(57): Doctrine\ORM\Mapping\ClassMetadataFactory->getAllMetadata() #8 {main}
        Hide
        Benjamin Eberlei added a comment -

        Does it seem like me is ignoring this bug? Its not that I am payed to work on Doctrine and have no day-job.

        This looks like a very good re-produce case though, i am looking into it (when i have time )

        Show
        Benjamin Eberlei added a comment - Does it seem like me is ignoring this bug? Its not that I am payed to work on Doctrine and have no day-job. This looks like a very good re-produce case though, i am looking into it (when i have time )
        Hide
        Hinikato Dubrai added a comment -

        Benjamin, thank you!

        Show
        Hinikato Dubrai added a comment - Benjamin, thank you!
        Hide
        Benjamin Eberlei added a comment -

        I cannot reproduce this sorry, can you try again? i have changed that method for several other bugs lately, maybe it is fixed now?

        Show
        Benjamin Eberlei added a comment - I cannot reproduce this sorry, can you try again? i have changed that method for several other bugs lately, maybe it is fixed now?
        Hide
        Benjamin Eberlei added a comment -

        Closed, no additional feedback given.

        Show
        Benjamin Eberlei added a comment - Closed, no additional feedback given.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Hinikato Dubrai
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: