[DDC-1019] Double quotation mark mysql query error on orm:convert-mapping --from-database Created: 07/Feb/11  Updated: 07/Feb/11  Resolved: 07/Feb/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Tools
Affects Version/s: 2.0.1
Fix Version/s: 2.0.1
Security Level: All

Type: Bug Priority: Major
Reporter: Bernhard Schlas Assignee: Benjamin Eberlei
Resolution: Duplicate Votes: 0
Labels: None
Environment:

ubuntu 10.10 32bit; PHP Version => 5.3.3-1ubuntu9.3; mysql Ver 14.14 Distrib 5.1.49, for debian-linux-gnu (i686) using readline 6.1; Doctrine 2.0.1 git version


Issue Links:
Duplicate
duplicates DBAL-85 Illegal quotes in SHOW FULL TABLES WH... Resolved

 Description   

By executing this command php doctrine orm:convert-mapping --from-database yml yaml/ I get this error:

 
PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'BASE TABLE' in 'where clause'' in doctrine2-orm/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php:577
Stack trace:
#0 doctrine2-orm/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php(577): PDO->query('SHOW FULL TABLE...')
#1 doctrine2-orm/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php(532): Doctrine\DBAL\Connection->executeQuery('SHOW FULL TABLE...', Array)
#2 doctrine2-orm/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php(194): Doctrine\DBAL\Connection->fetchAll('SHOW FULL TABLE...')
#3 doctrine2-orm/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php(76): Doctrine\DBAL\Schema\AbstractSchemaManager->listTableNames()
#4 doctrine2-orm/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php on line 577

After var_dump the $query variable doctrine2-orm/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php on line 577 string(48) "SHOW FULL TABLES WHERE Table_type = "BASE TABLE"" you can see that BASE TABLE is in double quotations marks.
I replaced them with single quotation marks SHOW FULL TABLES WHERE Table_type = 'BASE TABLE' and executed the statement on the mysql server, no error!

Please replace the double quotation marks in the query with single quotation marks.



 Comments   
Comment by Benjamin Eberlei [ 07/Feb/11 ]

This is a duplicate of DBAL-85

Generated at Fri Aug 01 03:49:44 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.