Coder Social home page Coder Social logo

DBAL-24: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1109 Unknown table about dbal HOT 12 CLOSED

doctrine avatar doctrine commented on May 18, 2024
DBAL-24: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1109 Unknown table

from dbal.

Comments (12)

doctrinebot avatar doctrinebot commented on May 18, 2024

Comment created by @beberlei:

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());

from dbal.

doctrinebot avatar doctrinebot commented on May 18, 2024

Comment created by hinikato:

Yes.

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

from dbal.

doctrinebot avatar doctrinebot commented on May 18, 2024

Comment created by hinikato:

Sorry, I have replaced the table name, but bug occurs with the 'sessions' table too.

from dbal.

doctrinebot avatar doctrinebot commented on May 18, 2024

Comment created by hinikato:

Hmm., but exception text says that table name is variables, so this table looks like:

CREATE TABLE `variables` (
  `name` varchar(128) NOT NULL DEFAULT '',
  `value` longtext NOT NULL,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

from dbal.

doctrinebot avatar doctrinebot commented on May 18, 2024

Comment created by @beberlei:

But if the exception still references variables then the query from your comment cannot be the one that is failing.

from dbal.

doctrinebot avatar doctrinebot commented on May 18, 2024

Comment created by hinikato:

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}

from dbal.

doctrinebot avatar doctrinebot commented on May 18, 2024

Comment created by @beberlei:

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 ;-))

from dbal.

doctrinebot avatar doctrinebot commented on May 18, 2024

Comment created by hinikato:

Benjamin, thank you!

from dbal.

doctrinebot avatar doctrinebot commented on May 18, 2024

Comment created by @beberlei:

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

from dbal.

doctrinebot avatar doctrinebot commented on May 18, 2024

Comment created by @beberlei:

Closed, no additional feedback given.

from dbal.

doctrinebot avatar doctrinebot commented on May 18, 2024

Issue was closed with resolution "Cannot Reproduce"

from dbal.

github-actions avatar github-actions commented on May 18, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from dbal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.