-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DBAL-173: PDO Exception 17 database schema has changed #1333
Comments
Comment created by @beberlei: ARe you using two pdo connections in this initialization script? |
Comment created by mathroc: hi, at the time the bug occurred I couldn't reproduce the bug in a simple script and I gave up I tested it again with sqlite and I still have the problem (with php 5.4 now) here is an archive of some part of the project : https://evangeneer.net/public/doctrine-dbal-173.zip you can reproduce the bug by typing if my code is too messy, I can explain how it works, you can contact me by mail or via jabber : [email protected] |
Comment created by @lsmith77: we seem to be experiencing the same issue jackalope/jackalope-doctrine-dbal#46 (comment) |
Comment created by @beberlei: Its up to the developer to fix this issue imho, there is no way for Doctrine to solve this issue generically without making the code overly complex. The use-case is rather minimal, running a testsuite and changing the db schema using more than one connection in the same request. I don't think we should change the core for this. |
Issue was closed with resolution "Won't Fix" |
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. |
Jira issue originally created by user mathroc:
in a script initializing a database (creating tables and inserting rows into) i have this exception :
{quote}
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 17 database schema has changed' in /home/mathieu/projects/no-pair/library/vendor/doctrine2/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php:618
Stack trace:
#0 /home/mathieu/projects/no-pair/library/vendor/doctrine2/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php(618): PDO->query('SELECT name FRO...')
#1 /home/mathieu/projects/no-pair/library/vendor/doctrine2/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php(571): Doctrine\DBAL\Connection->executeQuery('SELECT name FRO...', Array)
#2 /home/mathieu/projects/no-pair/library/vendor/doctrine2/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php(198): Doctrine\DBAL\Connection->fetchAll('SELECT name FRO...')
#3 /home/mathieu/projects/no-pair/library/vendor/doctrine2/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php(210): Doctrine\DBAL\Schema\AbstractSchemaManager->listTableNames()
#4 /home/mathieu/projects/no-pa in /home/mathieu/projects/no-pair/library/vendor/doctrine2/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php on line 618
{quote}
it's working well with mysql or postgresql.
I don't think it's up to the developper using doctrine to take care of this probem.
As I understand it, when this error happend doctrine should "check for this error and re-execute the query as necessary." ( https://bugs.php.net/bug.php?id=43942 )
apparently it could also be solved in pdo_sqlite by using sqlite3_prepare_v2 instead of sqlite3_prepare. maybe I should fill a bug here too (?)
I'll provide a script reproducing the problem asap
but I don't know if it's better to solve it in doctrine or in pdo-sqlite
The text was updated successfully, but these errors were encountered: