Skip to content

Commit

Permalink
Its EXECUTE not EXECUCUTE
Browse files Browse the repository at this point in the history
Also make the search insensitive as casing bugs are no fun.
  • Loading branch information
markstory committed Feb 10, 2012
1 parent 0cfec52 commit 9c1fa28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/Database/Sqlserver.php
Expand Up @@ -745,7 +745,7 @@ public function lastAffected($source = null) {
*/
protected function _execute($sql, $params = array(), $prepareOptions = array()) {
$this->_lastAffected = false;
if (strncasecmp($sql, 'SELECT', 6) == 0 || preg_match('/^EXEC(?:UCUTE)?\s/m', $sql) > 0) {
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);
}
Expand Down

0 comments on commit 9c1fa28

Please sign in to comment.