Subject: | Bug with Regex in DBD::Mock::Session |
Date: | Tue, 25 Dec 2012 16:11:22 +0200 |
To: | bug-DBD-Mock [...] rt.cpan.org |
From: | Vitaliy Salnik <sav [...] nevoobrazimo.ru> |
Hi,
I has found the bug in the method _verify_bound_param of DBD::Mock::Session
When I have regexp param in my bound_params I got error.
for example:
$mock_session = DBD::Mock::Session->new('my_session' => (
{
statement => qr/^INSERT INTO bill/,
bound_params => [10.00, 'RUB', qr/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, 0, 'notpayed', 'bank', 12.00, qr/[a-f0-9]{32}/i],
results => [['rows'], []],
},
));
I got error:
DBI Exception: DBD::Mock::st execute failed: Session Error: Bound param 2 do not match in current state in DBD::Mock::Session (my_session)
because in the method _verify_bound_param you always check param as scalar after check it as regex