mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Reverting testing changes pushed in past commit
This commit is contained in:
parent
e14c4412fd
commit
3d2a732cd3
2 changed files with 15 additions and 2 deletions
|
@ -517,7 +517,20 @@ class Sqlserver extends DboSource {
|
||||||
$offset = intval($offset[1]) + intval($limitVal[1]);
|
$offset = intval($offset[1]) + intval($limitVal[1]);
|
||||||
$rOrder = $this->__switchSort($order);
|
$rOrder = $this->__switchSort($order);
|
||||||
list($order2, $rOrder) = array($this->__mapFields($order), $this->__mapFields($rOrder));
|
list($order2, $rOrder) = array($this->__mapFields($order), $this->__mapFields($rOrder));
|
||||||
return "SELECT * FROM (SELECT {$limit} * FROM (SELECT TOP {$offset} {$fields} FROM {$table} {$alias} {$joins} {$conditions} {$group} {$order}) AS Set1 {$rOrder}) AS Set2 {$order2}";
|
$limit2 = str_replace('TOP', '', $limit);
|
||||||
|
if (!$order) {
|
||||||
|
$order = 'ORDER BY (SELECT NULL)';
|
||||||
|
}
|
||||||
|
|
||||||
|
$pagination = "
|
||||||
|
SELECT {$limit} * FROM (
|
||||||
|
SELECT {$fields}, ROW_NUMBER() OVER ({$order}) AS ssma\$rownum
|
||||||
|
FROM {$table} {$alias} {$joins} {$conditions} {$group}
|
||||||
|
) AS ssma\$sub1
|
||||||
|
WHERE ssma\$sub1.[ssma\$rownum] > {$limit2}
|
||||||
|
ORDER BY ssma\$sub1.[ssma\$rownum]
|
||||||
|
";
|
||||||
|
return $pagination;
|
||||||
} else {
|
} else {
|
||||||
return "SELECT {$limit} {$fields} FROM {$table} {$alias} {$joins} {$conditions} {$group} {$order}";
|
return "SELECT {$limit} {$fields} FROM {$table} {$alias} {$joins} {$conditions} {$group} {$order}";
|
||||||
}
|
}
|
||||||
|
|
|
@ -245,7 +245,7 @@ class ProjectTaskTest extends CakeTestCase {
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
|
|
||||||
$this->assertEqual(Configure::read('Routing.prefixes'), array('my_prefix'));
|
$this->assertEqual(Configure::read('Routing.prefixes'), array('my_prefix'));
|
||||||
@$file->delete();
|
$file->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue