Conversation
| if (EG(exception)) { | ||
| return 0; | ||
| } |
There was a problem hiding this comment.
This should be unconditional. However, ideally all three functions should throw a ValueError with the same message.
There was a problem hiding this comment.
Done, in 080d234. It now refuses the binding in every error mode, so bindColumn() returns false instead of true under SILENT/WARNING.
One consequence worth naming: a name bound after execute() that only appears in a later rowset used to get resolved by pdo_stmt_describe_columns() on nextRowset(), and no longer does. Only affects drivers with multiple rowsets, and the old behaviour was already diagnosed as "it will not be bound", so I think it's the right trade.
ValueError for all three sites reads like master material to me rather than 8.4. Want me to open that separately?
There was a problem hiding this comment.
I don't know if I trust this Claude reply. Or maybe I just don't understand what it is saying. Anyway, you can merge this. The ValueError change does belong on master.
There was a problem hiding this comment.
If you bindColumn() a name after execute() and it is not in this rowset, the old code still stored it, and nextRowset() could attach it when a later rowset had that name. bindColumn() no longer stores it. ValueError goes on master.
There was a problem hiding this comment.
But if the exception error reporting mode is on, then it doesn't matter. So either way, it's not going to work.
There was a problem hiding this comment.
It stored the binding even when it threw, so catching the exception still let a later rowset resolve it. Refused in all three modes now.
really_register_bound_param() raised the implementation error for a column name that is not in the result set and then registered the binding anyway, so bindColumn() returned true for a binding that can never fire, and repeated failing calls with distinct names grew bound_columns without bound. Named parameters already fail this way in rewrite_name_to_position(), so bail out here too, independent of the error mode. Closes phpGH-23799
2a3080d to
b9a5cf1
Compare
really_register_bound_param() raised the implementation error for a column name that is not in the result set and then registered the binding anyway, so bindColumn() returned true for a binding that can never fire, and repeated failing calls with distinct names grew bound_columns without bound. Refuse the binding in every error mode instead. Closes phpGH-23799
b9a5cf1 to
080d234
Compare
bindColumn()with a column name that is not in the result set raised the implementation error and then registered the binding anyway, so it returned true for a binding that can never fire, and repeated failing calls with distinct names grew bound_columns without bound. Registration now aborts in every error mode. The user-visible change is the return value under ERRMODE_SILENT and ERRMODE_WARNING, which goes from true to false.