ZF2 - \\Zend\\Db\\Adapter\\Platform::getQuoteIdentifierSymbol()

本秂侑毒 提交于 2019-12-04 07:15:39

The only solution to this problem was to create new \Zend\Db\Platform\Mysql object and pass it as second parameter to Adapter class when I initiate a connection. This question implies the automatic way of doing it. Why initializing MySQL adapter doesn't attach MySQL platform to it, is something I don't understand - instead it attaches SQL92 platform.

Check the function setConnectionParameters() in Zend\Db\Adapter\Driver\Pdo\Connection

if $params['dsn'] is set the platform is taken from the text before ':'
Example:

$params['dsn'] = mysql:dbname=database;host=db.host.com
Platform name will be 'mysql'

Else, if $params['pdodriver'] is set the platform will be that value
Example:

$params['pdodriver'] = 'mysql'
Platform name will be 'mysql'

Else, if $params['driver'] is set the platform is taken from the text after 'Pdo_'
Example:

$params['driver'] = 'Pdo_Mysql'
Platform name will be 'mysql'

The platform name will decide the connection type an thus the correct quote identifier symbols

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!