Skip to content

Commit 86ccf32

Browse files
minor symfony#35473 [Cache] Don't allow mysqli to be used as it doesn't work (duncan3dc)
This PR was merged into the 4.3 branch. Discussion ---------- [Cache] Don't allow mysqli to be used as it doesn't work | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | As discussed in symfony#35375 Mysqli doesn't support named parameters, so if you pass a doctrine connection using `mysqli` then you get errors for any queries using named parameters. This PR ensures a clear error is provided and suggests to use `pdo_mysql` instead Commits ------- a786448 Mysqli doesn't support the named parameters used by PdoAdapter
2 parents d695b43 + a786448 commit 86ccf32

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Symfony/Component/Cache/Traits/PdoTrait.php

+1
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ private function getConnection()
395395
} else {
396396
switch ($this->driver = $this->conn->getDriver()->getName()) {
397397
case 'mysqli':
398+
throw new \LogicException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', \get_class($this)));
398399
case 'pdo_mysql':
399400
case 'drizzle_pdo_mysql':
400401
$this->driver = 'mysql';

0 commit comments

Comments
 (0)