@@ -74,8 +74,7 @@ |
||
| 74 | 74 | SELECT * FROM mw_mqueue_test WHERE queue = ? AND cname = ? AND rtime = ? |
| 75 | 75 | ORDER BY id LIMIT 1 |
| 76 | 76 | '; |
| 77 | - } |
|
| 78 | - else |
|
| 77 | + } else |
|
| 79 | 78 | { |
| 80 | 79 | $config['sql']['reserve'] = ' |
| 81 | 80 | UPDATE mw_mqueue_test SET cname = ?, rtime = ? WHERE id IN ( |
@@ -110,9 +110,12 @@ |
||
| 110 | 110 | throw new Exception( 'Unable to fork new process: ' . pcntl_strerror( pcntl_get_last_error() ) ); |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - if( $pid === 0 ) // child process |
|
| 113 | + if( $pid === 0 ) { |
|
| 114 | + // child process |
|
| 114 | 115 | { |
| 115 | - $this->list = []; // use own child process list |
|
| 116 | + $this->list = []; |
|
| 117 | + } |
|
| 118 | + // use own child process list |
|
| 116 | 119 | exit( $this->exec( $fcn, $data ) ); |
| 117 | 120 | } |
| 118 | 121 | |
@@ -69,9 +69,12 @@ |
||
| 69 | 69 | */ |
| 70 | 70 | public function execute() : \Aimeos\Base\DB\Result\Iface |
| 71 | 71 | { |
| 72 | - try { |
|
| 72 | + try |
|
| 73 | + { |
|
| 73 | 74 | $result = $this->exec(); |
| 74 | - } catch( \PDOException $e ) { |
|
| 75 | + } |
|
| 76 | + catch( \PDOException $e ) |
|
| 77 | + { |
|
| 75 | 78 | throw new \Aimeos\Base\DB\Exception( $e->getMessage() . ': ' . $this->sql, $e->getCode() ); |
| 76 | 79 | } |
| 77 | 80 | |
@@ -71,9 +71,12 @@ |
||
| 71 | 71 | */ |
| 72 | 72 | public function execute() : \Aimeos\Base\DB\Result\Iface |
| 73 | 73 | { |
| 74 | - try { |
|
| 74 | + try |
|
| 75 | + { |
|
| 75 | 76 | $stmt = $this->exec(); |
| 76 | - } catch( \PDOException $e ) { |
|
| 77 | + } |
|
| 78 | + catch( \PDOException $e ) |
|
| 79 | + { |
|
| 77 | 80 | throw new \Aimeos\Base\DB\Exception( $e->getMessage() . ': ' . $this->sql . json_encode( array_column( $this->binds, 0 ) ), $e->getCode(), $e->errorInfo ); |
| 78 | 81 | } |
| 79 | 82 | |
@@ -69,9 +69,12 @@ |
||
| 69 | 69 | */ |
| 70 | 70 | public function execute() : \Aimeos\Base\DB\Result\Iface |
| 71 | 71 | { |
| 72 | - try { |
|
| 72 | + try |
|
| 73 | + { |
|
| 73 | 74 | $result = $this->getConnection()->getRawObject()->getWrappedConnection()->query( $this->sql ); |
| 74 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
| 75 | + } |
|
| 76 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
| 77 | + { |
|
| 75 | 78 | throw new \Aimeos\Base\DB\Exception( $e->getMessage() . ': ' . $this->sql, $e->getCode() ); |
| 76 | 79 | } |
| 77 | 80 | |
@@ -71,9 +71,12 @@ |
||
| 71 | 71 | */ |
| 72 | 72 | public function execute() : \Aimeos\Base\DB\Result\Iface |
| 73 | 73 | { |
| 74 | - try { |
|
| 74 | + try |
|
| 75 | + { |
|
| 75 | 76 | $result = $this->exec(); |
| 76 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
| 77 | + } |
|
| 78 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
| 79 | + { |
|
| 77 | 80 | throw new \Aimeos\Base\DB\Exception( $e->getMessage() . ': ' . $this->sql . json_encode( array_column( $this->binds, 0 ) ), $e->getCode() ); |
| 78 | 81 | } |
| 79 | 82 | |
@@ -50,9 +50,12 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function affectedRows() : int |
| 52 | 52 | { |
| 53 | - try { |
|
| 53 | + try |
|
| 54 | + { |
|
| 54 | 55 | return $this->result->rowCount(); |
| 55 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
| 56 | + } |
|
| 57 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
| 58 | + { |
|
| 56 | 59 | throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode() ); |
| 57 | 60 | } |
| 58 | 61 | } |
@@ -90,9 +93,12 @@ discard block |
||
| 90 | 93 | */ |
| 91 | 94 | public function finish() : Iface |
| 92 | 95 | { |
| 93 | - try { |
|
| 96 | + try |
|
| 97 | + { |
|
| 94 | 98 | $this->result->free(); |
| 95 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
| 99 | + } |
|
| 100 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
| 101 | + { |
|
| 96 | 102 | throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode() ); |
| 97 | 103 | } |
| 98 | 104 | |
@@ -50,9 +50,12 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function affectedRows() : int |
| 52 | 52 | { |
| 53 | - try { |
|
| 53 | + try |
|
| 54 | + { |
|
| 54 | 55 | return $this->statement->rowCount(); |
| 55 | - } catch( \PDOException $e ) { |
|
| 56 | + } |
|
| 57 | + catch( \PDOException $e ) |
|
| 58 | + { |
|
| 56 | 59 | throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
| 57 | 60 | } |
| 58 | 61 | } |
@@ -67,9 +70,12 @@ discard block |
||
| 67 | 70 | */ |
| 68 | 71 | public function fetch( int $style = \Aimeos\Base\DB\Result\Base::FETCH_ASSOC ) : ?array |
| 69 | 72 | { |
| 70 | - try { |
|
| 73 | + try |
|
| 74 | + { |
|
| 71 | 75 | return $this->statement->fetch( $style ? \PDO::FETCH_ASSOC : \PDO::FETCH_NUM ) ?: null; |
| 72 | - } catch( \PDOException $e ) { |
|
| 76 | + } |
|
| 77 | + catch( \PDOException $e ) |
|
| 78 | + { |
|
| 73 | 79 | throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
| 74 | 80 | } |
| 75 | 81 | } |
@@ -83,9 +89,12 @@ discard block |
||
| 83 | 89 | */ |
| 84 | 90 | public function finish() : Iface |
| 85 | 91 | { |
| 86 | - try { |
|
| 92 | + try |
|
| 93 | + { |
|
| 87 | 94 | $this->statement->closeCursor(); |
| 88 | - } catch( \PDOException $e ) { |
|
| 95 | + } |
|
| 96 | + catch( \PDOException $e ) |
|
| 97 | + { |
|
| 89 | 98 | throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
| 90 | 99 | } |
| 91 | 100 | |
@@ -100,9 +109,12 @@ discard block |
||
| 100 | 109 | */ |
| 101 | 110 | public function nextResult() : bool |
| 102 | 111 | { |
| 103 | - try { |
|
| 112 | + try |
|
| 113 | + { |
|
| 104 | 114 | return $this->statement->nextRowset(); |
| 105 | - } catch( \PDOException $e ) { |
|
| 115 | + } |
|
| 116 | + catch( \PDOException $e ) |
|
| 117 | + { |
|
| 106 | 118 | return false; |
| 107 | 119 | } |
| 108 | 120 | } |
@@ -109,7 +109,8 @@ |
||
| 109 | 109 | |
| 110 | 110 | return array_pop( $this->connections[$name] ); |
| 111 | 111 | } |
| 112 | - catch( \Exception $e ) { |
|
| 112 | + catch( \Exception $e ) |
|
| 113 | + { |
|
| 113 | 114 | throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode() ); |
| 114 | 115 | } |
| 115 | 116 | } |