Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phalcon\Mvc\Model::find() with limit returns no results in Oracle #11217

Closed
rlaffers opened this issue Dec 11, 2015 · 3 comments
Closed

Phalcon\Mvc\Model::find() with limit returns no results in Oracle #11217

rlaffers opened this issue Dec 11, 2015 · 3 comments

Comments

@rlaffers
Copy link
Contributor

Phalcon 2.0.8
Oracle 10g.

There seems to be a problem with the Oracle dialect. When running

        $result = Languages::find(array('limit' => 2));
        echo '<pre>' . var_export($result->toArray(), 1) . '</pre>';

the result is empty. I logged the SQL query produced by this code:

SELECT * FROM (SELECT Z1.*, ROWNUM PHALCON_RN FROM (SELECT LANGUAGE.ID_LANGUAGE, LANGUAGE.TITLE, LANGUAGE.CODE_2, LANGUAGE.CODE_3, LANGUAGE.VALID, LANGUAGE.USER_ACTOR, LANGUAGE.LOCALE FROM COMMON.LANGUAGE) Z1 WHERE ROWNUM <= 0)
[params: Array
(
    [APL0] => 2
)
] 

The param APL0 seems to be ignored - it is not used anywhere in the query.
Also, please note the ROWNUM in Oracle starts at 1, not 0 as reported here.

Language is my model extending \Phalcon\Mvc\Model. It uses columnMap() with the columns listed in the SQL query.

@MLukman
Copy link
Contributor

MLukman commented May 17, 2016

Dear sir, any info on when will this fix be tagged with an actual version (e.g. 2.0.13) and can be downloaded from official site?

@sergeyklay
Copy link
Contributor

PR here #11216

@sergeyklay
Copy link
Contributor

Phalcon does not support Oracle. Refer to #12008

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants