Commit 1d8d6bcf authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge pull request #209 from dlsniper/dbal-query-micro-optimization

Added query micro-optimization
parents b1441d42 417ddca2
...@@ -775,9 +775,19 @@ class Connection implements DriverConnection ...@@ -775,9 +775,19 @@ class Connection implements DriverConnection
} }
try { try {
switch (func_num_args()) {
case 1:
$statement = $this->_conn->query($args[0]);
break;
case 2:
$statement = $this->_conn->query($args[0], $args[1]);
break;
default:
$statement = call_user_func_array(array($this->_conn, 'query'), $args); $statement = call_user_func_array(array($this->_conn, 'query'), $args);
break;
}
} catch (\Exception $ex) { } catch (\Exception $ex) {
throw DBALException::driverExceptionDuringQuery($ex, func_get_arg(0)); throw DBALException::driverExceptionDuringQuery($ex, $args[0]);
} }
$statement->setFetchMode($this->_defaultFetchMode); $statement->setFetchMode($this->_defaultFetchMode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment