File tree Expand file tree Collapse file tree 4 files changed +36
-10
lines changed Expand file tree Collapse file tree 4 files changed +36
-10
lines changed Original file line number Diff line number Diff line change @@ -189,21 +189,22 @@ jobs:
189189        mysql-version :
190190          - " 5.7" 
191191          - " 8.0"   #  We have code specific to ^8.0
192-           - " 9.3" 
192+           - " 8.4"   #  LTS
193+           - " 9.4" 
193194        extension :
194195          - " mysqli" 
195196          - " pdo_mysql" 
196197        include :
197198          - config-file-suffix : " -tls" 
198199            php-version : " 8.2" 
199-             mysql-version : " 9.1 " 
200+             mysql-version : " 9.4 " 
200201            extension : " mysqli" 
201202          - config-file-suffix : " -stringify_fetches" 
202203            php-version : " 8.2" 
203-             mysql-version : " 9.1 " 
204+             mysql-version : " 9.4 " 
204205            extension : " pdo_mysql" 
205206          - php-version : " 8.2" 
206-             mysql-version : " 9.1 " 
207+             mysql-version : " 9.4 " 
207208            extension : " mysqli" 
208209
209210  phpunit-mssql :
@@ -246,7 +247,8 @@ jobs:
246247        php-version :
247248          - " 8.2" 
248249          - " 8.3" 
249-           - " 8.4" 
250+           #  The DB2 workflow currently segfaults with PHP 8.4
251+           #  - "8.4"
250252
251253  development-deps :
252254    name : " PHPUnit with PDO_SQLite and development dependencies" 
Original file line number Diff line number Diff line change @@ -1354,6 +1354,16 @@ The following methods have been removed.
13541354
13551355# Upgrade to 3.10  
13561356
1357+ ## Support for new PDO subclasses on PHP 8.4  
1358+ 
1359+ In 3.10.2, we've backported support for new PDO subclasses introduced in PHP 8.4 because not using them
1360+ could trigger deprecation warnings under certain circumstances in PHP 8.5.
1361+ 
1362+ On PHP 8.4, if you call ` getNativeConnection() `  on a connection established through one of the PDO drivers,
1363+ you will get an instance of the new PDO subclasses, e.g. ` Pdo\Mysql `  or ` Pdo\Pgsql `  instead of just ` PDO ` .
1364+ 
1365+ ## Optional ` doctrine/cache `  dependency  
1366+ 
13571367The ` doctrine/cache `  package is now an optional dependency. If you are using the
13581368` Doctrine\DBAL\Cache `  classes, you need to require the ` doctrine/cache `  package
13591369explicitly.
Original file line number Diff line number Diff line change 2222use  Doctrine \DBAL \Exception \UniqueConstraintViolationException ;
2323use  Doctrine \DBAL \Query ;
2424
25+ use  function  str_contains ;
26+ 
2527/** @internal */ 
2628final  class  ExceptionConverter implements  ExceptionConverterInterface
2729{
@@ -31,6 +33,15 @@ final class ExceptionConverter implements ExceptionConverterInterface
3133     */ 
3234    public  function  convert (Exception   $ exception , ?Query   $ query ): DriverException 
3335    {
36+         if  (
37+             $ exception ->getCode () === 1524 
38+             && str_contains ($ exception ->getMessage (), 'Plugin  \'mysql_native_password \' is not loaded ' )
39+         ) {
40+             // Workaround for MySQL 8.4 if we request an unknown user. 
41+             // https://bugs.mysql.com/bug.php?id=114876 
42+             return  new  ConnectionException ($ exception , $ query );
43+         }
44+ 
3445        return  match  ($ exception ->getCode ()) {
3546            1008  => new  DatabaseDoesNotExist ($ exception , $ query ),
3647            1213  => new  DeadlockException ($ exception , $ query ),
Original file line number Diff line number Diff line change 1010use  Doctrine \DBAL \Driver \PDO \Exception \InvalidConfiguration ;
1111use  Doctrine \DBAL \Driver \PDO \PDOConnect ;
1212use  PDO ;
13+ use  Pdo \Pgsql ;
1314use  PDOException ;
1415use  SensitiveParameter ;
1516
1617use  function  is_string ;
1718
19+ use  const  PHP_VERSION_ID ;
20+ 
1821final  class  Driver extends  AbstractPostgreSQLDriver
1922{
2023    use  PDOConnect;
@@ -52,11 +55,11 @@ public function connect(
5255            throw  Exception::new ($ exception );
5356        }
5457
55-         if  ( 
56-             !  isset ( $ driverOptions [ PDO :: PGSQL_ATTR_DISABLE_PREPARES ]) 
57-             ||  $ driverOptions [ PDO ::PGSQL_ATTR_DISABLE_PREPARES ] ===  true 
58-         ) {
59-             $ pdo ->setAttribute (PDO :: PGSQL_ATTR_DISABLE_PREPARES , true );
58+         $ disablePreparesAttr  =  PHP_VERSION_ID  >=  80400 
59+             ? Pgsql:: ATTR_DISABLE_PREPARES 
60+             :  PDO ::PGSQL_ATTR_DISABLE_PREPARES ; 
61+         if  ( $ driverOptions [ $ disablePreparesAttr ] ??  true ) {
62+             $ pdo ->setAttribute ($ disablePreparesAttr  , true );
6063        }
6164
6265        $ connection  = new  Connection ($ pdo );
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments