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

queryOne keep loading and no result #20066

Open
lucaguelfi opened this issue Nov 7, 2023 · 2 comments
Open

queryOne keep loading and no result #20066

lucaguelfi opened this issue Nov 7, 2023 · 2 comments

Comments

@lucaguelfi
Copy link

What steps will reproduce the problem?

I installed pdo_informix and edgardmessias/yii2-informix library (ver. 1.1.1) in php 8.2.
I execute a queryOne() on a simple query: select * from tablename

What is the expected result?

I expect to have a single row from table

What do you get instead?

I got an infite loop without any result. The browser keep loading forever

Additional info

If I comment the row
$this->pdoStatement->closeCursor();
at tline 1195 in vendor/yiisoft/yii2/db/Command.php then everyting works fine.

Q A
Yii version 2.0.49.2
PHP version 8.2
Operating system Debian GNU/Linux 10 (buster) on Docker
@xicond
Copy link
Contributor

xicond commented Nov 9, 2023

if you use edgardmessias/yii2-informix
how come it come into yii2 \yii\db\Command::queryInternal
It suppose overrided by edgardmessias/yii2-informix I think,
Or maybe extension pdo_informix has bug

try check this reference
https://www.php.net/manual/en/ref.pdo-informix.php#ref.pdo-informix.features.cursors

PDO_INFORMIX supports scrollable cursors; however, they are not enabled by default. To enable scrollable cursor support, you must either set ENABLESCROLLABLECURSORS=1 in the corresponding ODBC connection settings in odbc.ini or pass the EnableScrollableCursors=1 clause in the DSN connection string.

@lucaguelfi
Copy link
Author

The queryInternal of edgardmessias\yii2-informix\src\Command.php starts with this code:

if ($method !== '') {
    return parent::queryInternal($method, $fetchMode);
}

With queryOne() the $fetchMode is "fetch" so it does not override.

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

2 participants