Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

Limit and offset methods in Select class incorrectly quote provided values if the type is string #4563

@ptlis

Description

@ptlis

I'm using zend-db 2.1.5 with a mySQL database via PDO.

If you pass the parameters (to limit, offset) as a string the values are quoted and an InvalidQueryException is thrown but if you pass in (or cast to) an int it works correctly.

Strangely if you use the Sql::getSqlStringForSqlObject method the generated query is correct (the values are not quoted).

Testcase:

$table = new TableGateway('some_table', $this->adapter);
$select = $table->getSql()->select();

$select->limit('25');
$select->offset('1');

$table->selectWith($select); // Exception is thrown here

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions