mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 00:48:25 +00:00
Merge pull request #3301 from ubermaniac/Sqlserver-trim
Trim $sql before checking for SELECT
This commit is contained in:
commit
d2fa1b444f
1 changed files with 1 additions and 0 deletions
|
@ -760,6 +760,7 @@ class Sqlserver extends DboSource {
|
|||
*/
|
||||
protected function _execute($sql, $params = array(), $prepareOptions = array()) {
|
||||
$this->_lastAffected = false;
|
||||
$sql = trim($sql);
|
||||
if (strncasecmp($sql, 'SELECT', 6) === 0 || preg_match('/^EXEC(?:UTE)?\s/mi', $sql) > 0) {
|
||||
$prepareOptions += array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL);
|
||||
return parent::_execute($sql, $params, $prepareOptions);
|
||||
|
|
Loading…
Add table
Reference in a new issue