Procházet zdrojové kódy

Fixed:修复setAttribute bugs

Jinhui Zhu před 5 roky
rodič
revize
bd1abb7ade
1 změnil soubory, kde provedl 2 přidání a 0 odebrání
  1. 2 0
      src/Driver/Pdo/Driver.php

+ 2 - 0
src/Driver/Pdo/Driver.php

@@ -216,6 +216,7 @@ class Driver extends \Qii\Driver\Base implements \Qii\Driver\Intf
      * @param $val
      */
     public function setAttribute($key, $val){
+        $this->db['CURRENT'] = $this->connection->getWriteConnection();
         $this->db['CURRENT']->setAttribute($key, $val);
     }
     /**
@@ -223,6 +224,7 @@ class Driver extends \Qii\Driver\Base implements \Qii\Driver\Intf
      */
     public function transaction()
     {
+        $this->db['CURRENT'] = $this->connection->getWriteConnection();
         return $this->db['CURRENT']->beginTransaction();
     }