I tried it and im switched the order with no success. i will try with a basic pdo_mysql & mysqli query with same parameter... if it fails on one or both, should the bugrequest go to http://bugs.mysql.com/ ?
Am Montag, 30. Dezember 2013 09:35:57 UTC+1 schrieb Benjamin Eberlei: > > Can you try adding a ; after SET NAMES UTF8; > > If this is a bug, then of PDO/MySQLnd > > > On Mon, Dec 30, 2013 at 9:31 AM, Torsten Burschka > <[email protected]<javascript:> > > wrote: > >> Hello, >> >> it seems to me like a bug. If i simply use >> >> >> >> >> *array( PDO::MYSQL_ATTR_INIT_COMMAND => ' SET NAMES UTF8',)* >> >> >> as driver option, it works like a charm, but if i switch to >> >> >> >> >> >> * array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET >> sql_mode="STRICT_ALL_TABLES"; SET NAMES UTF8',)* >> >> it will cause an Exception: >> >> Doctrine\DBAL\DBALException File: >> >> /srv/http/www/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:91 >> >> Message: >> >> An exception occurred while executing 'SELECT t0.id AS id1, t0.type AS >> type2, t0.name AS name3 FROM demo t0': >> >> SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other >> unbuffered queries are active. Consider using PDOStatement::fetchAll(). >> Alternatively, if your code is only ever going to run against mysql, you may >> enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY >> attribute. >> >> Stack trace: >> >> #0 /srv/http/www/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(701): >> Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(PDOException), >> 'SELECT t0.id AS...', Array) >> #1 >> /srv/http/www/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php(930): >> Doctrine\DBAL\Connection->executeQuery('SELECT t0.id AS...', Array, Array) >> #2 >> /srv/http/www/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(181): >> Doctrine\ORM\Persisters\BasicEntityPersister->loadAll(Array, NULL, NULL, >> NULL) >> #3 >> /srv/http/www/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(164): >> Doctrine\ORM\EntityRepository->findBy(Array) >> #4 /srv/http/www/module/Core/src/Core/Importer/Demo.php(85): >> Doctrine\ORM\EntityRepository->findAll() >> #5 /srv/http/www/module/Core/src/Core/Importer/Demo.php(45): >> Core\Importer\Demo->loadDemos() >> #6 >> /srv/http/www/module/Backend/src/Backend/Controller/IndexController.php(13): >> Core\Importer\Demo->import() >> #7 >> /srv/http/www/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php(83): >> Backend\Controller\IndexController->indexAction() >> #8 [internal function]: >> Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent)) >> #9 >> /srv/http/www/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): >> call_user_func(Array, Object(Zend\Mvc\MvcEvent)) >> #10 >> /srv/http/www/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207): >> Zend\EventManager\EventManager->triggerListeners('dispatch', >> Object(Zend\Mvc\MvcEvent), Object(Closure)) >> #11 >> /srv/http/www/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php(117): >> Zend\EventManager\EventManager->trigger('dispatch', >> Object(Zend\Mvc\MvcEvent), Object(Closure)) >> #12 >> /srv/http/www/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php(114): >> >> Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), >> Object(Zend\Http\PhpEnvironment\Response)) >> #13 [internal function]: >> Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent)) >> #14 >> /srv/http/www/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): >> call_user_func(Array, Object(Zend\Mvc\MvcEvent)) >> #15 >> /srv/http/www/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207): >> Zend\EventManager\EventManager->triggerListeners('dispatch', >> Object(Zend\Mvc\MvcEvent), Object(Closure)) >> #16 >> /srv/http/www/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php(309): >> Zend\EventManager\EventManager->trigger('dispatch', >> Object(Zend\Mvc\MvcEvent), Object(Closure)) >> #17 /srv/http/www/public/index.php(17): Zend\Mvc\Application->run() >> #18 {main} >> >> >> >> Even if i add PDO::MYSQL_ATTR_USE_BUFFERED_QUERY it doesn't change >> anything >> >> >> >> >> *array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET >> sql_mode="STRICT_ALL_TABLES"; SET NAMES UTF8', >> PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,)* >> >> >> >> And here some connection details: >> >> >> *private* '_isConnected' => boolean true >> *private* '_transactionNestingLevel' => int 0 >> *private* '_transactionIsolationLevel' => int 2 >> *private* '_nestTransactionsWithSavepoints' => null >> *private* '_params' => >> *array* *(size=10)* >> 'driverClass' => string 'Doctrine\DBAL\Driver\PDOMySql\Driver' >> *(length=36)* >> 'wrapperClass' => null >> 'pdo' => null >> 'host' => string 'host' *(length=14)* >> 'port' => string '3306' *(length=4)* >> 'user' => string 'user' *(length=13)* >> 'password' => string 'password' *(length=13)* >> 'dbname' => string 'dbname' *(length=13)* >> 'charset' => string 'utf8' *(length=4)* >> 'driverOptions' => >> *array* *(size=4)* >> 1002 => string 'SET sql_mode="STRICT_ALL_TABLES"; SET NAMES UTF8' >> *(length=48)* >> 1000 => int 1 >> 1003 => int 0 >> 1004 => int 1 >> *protected* '_platform' => >> *object*(*Doctrine\DBAL\Platforms\MySqlPlatform*)[*314*] >> *protected* 'doctrineTypeMapping' => >> *array* *(size=31)* >> 'tinyint' => string 'boolean' *(length=7)* >> 'smallint' => string 'smallint' *(length=8)* >> 'mediumint' => string 'integer' *(length=7)* >> 'int' => string 'integer' *(length=7)* >> 'integer' => string 'integer' *(length=7)* >> 'bigint' => string 'bigint' *(length=6)* >> 'tinytext' => string 'text' *(length=4)* >> 'mediumtext' => string 'text' *(length=4)* >> 'longtext' => string 'text' *(length=4)* >> 'text' => string 'text' *(length=4)* >> 'varchar' => string 'string' *(length=6)* >> 'string' => string 'string' *(length=6)* >> 'char' => string 'string' *(length=6)* >> 'date' => string 'date' *(length=4)* >> 'datetime' => string 'datetime' *(length=8)* >> 'timestamp' => string 'datetime' *(length=8)* >> 'time' => string 'time' *(length=4)* >> 'float' => string 'float' *(length=5)* >> 'double' => string 'float' *(length=5)* >> 'real' => string 'float' *(length=5)* >> 'decimal' => string 'decimal' *(length=7)* >> 'numeric' => string 'decimal' *(length=7)* >> 'year' => string 'date' *(length=4)* >> 'longblob' => string 'blob' *(length=4)* >> 'blob' => string 'blob' *(length=4)* >> 'mediumblob' => string 'blob' *(length=4)* >> 'tinyblob' => string 'blob' *(length=4)* >> 'binary' => string 'blob' *(length=4)* >> 'varbinary' => string 'blob' *(length=4)* >> 'set' => string 'simple_array' *(length=12)* >> 'enum' => string 'string' *(length=6)* >> *protected* 'doctrineTypeComments' => null >> *protected* '_eventManager' => >> *object*(*Doctrine\Common\EventManager*)[*285*] >> *private* '_listeners' => >> *array* *(size=1)* >> 'loadClassMetadata' => >> *array* *(size=1)* >> '00000000633ca8ba000000007337b92a' => >> >> *object*(*Doctrine\ORM\Tools\ResolveTargetEntityListener*)[*284*] >> *private* 'resolveTargetEntities' => >> *array* *(size=0)* >> *empty* >> *protected* '_keywords' => null >> *protected* '_schemaManager' => null >> *protected* '_driver' => >> *object*(*Doctrine\DBAL\Driver\PDOMySql\Driver*)[*311*] >> *private* '_isRollbackOnly' => boolean false >> *protected* 'defaultFetchMode' => int 2 >> >> -- >> You received this message because you are subscribed to the Google Groups >> "doctrine-user" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected]<javascript:> >> . >> Visit this group at http://groups.google.com/group/doctrine-user. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/groups/opt_out.
