Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

no cast to (int) on limit&offset at Zend\Db\Sql\Select.php #5941

Merged
merged 1 commit into from

2 participants

@samsonasik

based on #5940 , I think cast (int) in limit and offst at Zend\Db\Sql\Select.php should be removed too. /cc @ralphschindler

@ralphschindler ralphschindler added the Db label
@ralphschindler ralphschindler added this to the 2.3.0 milestone
@ralphschindler ralphschindler self-assigned this
@ralphschindler ralphschindler referenced this pull request from a commit
@ralphschindler ralphschindler Merge #5941
Merge branch 'hotfix/5941' into develop

* hotfix/5941:
  no cast to (int) on limit&offset at Zend\Db\Sql\Select.php
9a988d0
@ralphschindler ralphschindler merged commit f83c3b0 into from
@ralphschindler
Collaborator

Thanks!

@samsonasik samsonasik deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
4 library/Zend/Db/Sql/Select.php
@@ -854,7 +854,7 @@ protected function processLimit(PlatformInterface $platform, DriverInterface $dr
return null;
}
- $limit = (int) $this->limit;
+ $limit = $this->limit;
if ($driver) {
$sql = $driver->formatParameterName('limit');
@@ -872,7 +872,7 @@ protected function processOffset(PlatformInterface $platform, DriverInterface $d
return null;
}
- $offset = (int) $this->offset;
+ $offset = $this->offset;
if ($driver) {
$parameterContainer->offsetSet('offset', $offset, ParameterContainer::TYPE_INTEGER);
View
14 tests/ZendTest/Db/Sql/SelectTest.php
@@ -1195,6 +1195,19 @@ public function providerData()
$sqlStr46 = 'SELECT SOME_DB_FUNCTION_ONE() AS Expression1, SOME_DB_FUNCTION_TWO() AS "foo"';
$params46 = array();
$internalTests46 = array();
+
+ // limit with big offset and limit
+ $select47 = new Select;
+ $select47->from('foo')->limit("10000000000000000000")->offset("10000000000000000000");
+ $sqlPrep47 = 'SELECT "foo".* FROM "foo" LIMIT ? OFFSET ?';
+ $sqlStr47 = 'SELECT "foo".* FROM "foo" LIMIT \'10000000000000000000\' OFFSET \'10000000000000000000\'';
+ $params47 = array('limit' => 10000000000000000000, 'offset' => 10000000000000000000);
+ $internalTests47 = array(
+ 'processSelect' => array(array(array('"foo".*')), '"foo"'),
+ 'processLimit' => array('?'),
+ 'processOffset' => array('?')
+ );
+
/**
* $select = the select object
* $sqlPrep = the sql as a result of preparation
@@ -1252,6 +1265,7 @@ public function providerData()
array($select44, $sqlPrep44, array(), $sqlStr44, $internalTests44),
array($select45, $sqlPrep45, $params45, $sqlStr45, $internalTests45),
array($select46, $sqlPrep46, $params46, $sqlStr46, $internalTests46),
+ array($select47, $sqlPrep47, $params47, $sqlStr47, $internalTests47),
);
}
}
Something went wrong with that request. Please try again.