We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
some DbAdapter driver_options can make DbSelect::count() incorrect
PDO::CASE_LOWER can make DbSelect::count() incorrect.
get NOTICE: Undefined index: C on xxxxx
$adapter = new Adapter([ 'driver' => 'pdo_mysql', "driver_options" => [ \PDO::ATTR_CASE => \PDO::CASE_LOWER, ], // other options .... ]); $select = $sql->select(); $dbSelect = new DbSelect($select, xxxx) $dbSelect->count(); // NOTICE: Undefined index: C on xxxxx
// DbSelect::count() public function count() { if ($this->rowCount !== null) { return $this->rowCount; } $select = $this->getSelectCount(); $statement = $this->sql->prepareStatementForSqlObject($select); $result = $statement->execute(); $row = $result->current(); // !!! here return $row['c'] = 10,lower case key $this->rowCount = (int) $row[self::ROW_COUNT_COLUMN_NAME]; return $this->rowCount; }
check lower or upper case key,return the right count
The text was updated successfully, but these errors were encountered:
Fixes laminas#10 : Fix incorrect DbSelect::count() when setted \PDO::…
4f34a05
…ATTR_CASE => \PDO::CASE_LOWER in driver options Signed-off-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
I created PR #11 for it. Haven't added unit test yet ...
Sorry, something went wrong.
Alternative for Fixes laminas#10 : Fix incorrect DbSelect::count() wh…
42d2a19
…en setted \PDO::ATTR_CASE => \PDO::CASE_LOWER in driver options Signed-off-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
Fixed with #11.
Successfully merging a pull request may close this issue.
Bug Report
some DbAdapter driver_options can make DbSelect::count() incorrect
Summary
PDO::CASE_LOWER can make DbSelect::count() incorrect.
Current behavior
get NOTICE: Undefined index: C on xxxxx
How to reproduce
Expected behavior
check lower or upper case key,return the right count
The text was updated successfully, but these errors were encountered: