File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -552,14 +552,16 @@ private function doAdvisoryLock($sessionId)
552552    {
553553        switch  ($ this driver ) {
554554            case  'mysql ' :
555+                 // MySQL 5.7.5 and later enforces a maximum length on lock names of 64 characters. Previously, no limit was enforced. 
556+                 $ lockId\substr ($ sessionId0 , 64 );
555557                // should we handle the return value? 0 on timeout, null on error 
556558                // we use a timeout of 50 seconds which is also the default for innodb_lock_wait_timeout 
557559                $ stmt$ this pdo ->prepare ('SELECT GET_LOCK(:key, 50) ' );
558-                 $ stmtbindValue (':key ' , $ sessionId PDO ::PARAM_STR );
560+                 $ stmtbindValue (':key ' , $ lockId PDO ::PARAM_STR );
559561                $ stmtexecute ();
560562
561563                $ releaseStmt$ this pdo ->prepare ('DO RELEASE_LOCK(:key) ' );
562-                 $ releaseStmtbindValue (':key ' , $ sessionId PDO ::PARAM_STR );
564+                 $ releaseStmtbindValue (':key ' , $ lockId PDO ::PARAM_STR );
563565
564566                return  $ releaseStmt
565567            case  'pgsql ' :
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments