[BUG]: "Invalid parameter number" error when trying to reuse named parameter in Model::find
Describe the bug We can't use one named parameter several times in find() and findFirst() functions because of "Invalid parameter number" error happens.
To Reproduce Steps to reproduce the behavior: We just need to build an SQL command with multiple uses of the same parameter.
$sql = '(:login: IS NOT NULL AND login = :login: AND loginType = :login_type:)';
$bind = [
'login' => 'some-login-value',
'login_type' => 'some-login-type',
];
$params = [$sql, ['bind' => $bind]];
$user = User::findFirst($params);
Expected behavior I expect to use a named parameter as many times as I want in a single SQL command. But instead, I need to rename each use of the parameter to a numbered one, like "login_1", "login_2", etc.
Details
- Phalcon version: 5.0.4
- PHP Version: 8.1.14
- Operating System: Docker
- Installation type: Compiling from source https://github.com/phalcon/cphalcon/archive/v5.0.4.tar.gz
- Zephir version (if any):
- Server: Nginx
- Other related info (Database, table schema): MariaDB
@SliceOfLife look here https://github.com/phalcon/cphalcon/issues/16091
@SliceOfLife look here #16091
Yes. thank you. Current issue is a duplicate of #16091 and #15810