Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c966016

Browse files
minor #35375 [Lock] Don't allow mysqli to be used as it doesn't work (duncan3dc)
This PR was merged into the 4.3 branch. Discussion ---------- [Lock] 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 | Mysqli doesn't support named parameters, so if you pass a doctrine connection using `mysqli` then you get the following error: `You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':id, :token, UNIX_TIMESTAMP() + 300)'` This PR ensures a clear error is provided and suggests to use `pdo_mysql` instead Commits ------- ef3bcda Mysqli doesn't support the named parameters used by PdoStore
2 parents 86ccf32 + ef3bcda commit c966016

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Symfony/Component/Lock/Store/PdoStore.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ private function getDriver(): string
307307
} else {
308308
switch ($this->driver = $con->getDriver()->getName()) {
309309
case 'mysqli':
310+
throw new NotSupportedException(sprintf('The store "%s" does not support the mysqli driver, use pdo_mysql instead.', \get_class($this)));
310311
case 'pdo_mysql':
311312
case 'drizzle_pdo_mysql':
312313
$this->driver = 'mysql';

0 commit comments

Comments
 (0)