CMssqlCommandBuilder code style fix #1532

Merged
merged 1 commit into from Oct 5, 2012
@@ -178,8 +178,8 @@ public function createUpdateCounterCommand($table,$counters,$criteria)
*/
public function applyLimit($sql, $limit, $offset)
{
- $limit = $limit!==null ? intval($limit) : -1;
- $offset = $offset!==null ? intval($offset) : -1;
+ $limit = $limit!==null ? (int)$limit : -1;
+ $offset = $offset!==null ? (int)$offset : -1;
if ($limit > 0 && $offset <= 0) //just limit
$sql = preg_replace('/^([\s(])*SELECT( DISTINCT)?(?!\s*TOP\s*\()/i',"\\1SELECT\\2 TOP $limit", $sql);
elseif($limit > 0 && $offset > 0)