laminas-db icon indicating copy to clipboard operation
laminas-db copied to clipboard

Regression: `PDO::FETCH_COLUMN` were commented and marked as invalid, but it's not

Open fabiang opened this issue 3 years ago • 1 comments

BC Break Report

Q A
Version 2.11.1

Summary

#33 and version 2.11.1 introduced better checking for PDO::FETCH_* constants but marked the constant PDO::FETCH_COLUMN as invalid and commented it out. I guess this was done based on this comment: https://github.com/zendframework/zend-db/pull/296#issuecomment-411081763

I can't find any reason why it should be invalid in the documentation. And based on some research it should be supported by all PDO drivers.

I've also tested if and it returns an array where the values are the value from the selected field for each row. So it should work as expected (only tested with MySQL).

Previous behavior

PDO::FETCH_COLUMN was an valid fetch mode.

Current behavior

Laminas\Db\Adapter\Driver\Pdo\Result throws an exception when PDO::FETCH_COLUMN is used.

How to reproduce

Use any query and set fetch mode to PDO::FETCH_COLUMN.

fabiang avatar Apr 14 '21 14:04 fabiang

This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering Committee. If you have a security issue, please follow our security reporting guidelines. If you wish to take on the role of maintainer, please nominate yourself

If you are looking for an actively maintained package alternative, we recommend:

laminas-bot avatar Apr 14 '21 14:04 laminas-bot