php-debugbar
php-debugbar copied to clipboard
TracedStatement::getSqlWithParameters() getting bindings wrong for SQL statements using BETWEEN
This worked in 1.15.0 and, following an upgrade to the latest 1.16.3 it returning incorrectly Take the following code:
use DebugBar\DataCollector\PDO\TracedStatement;
$query = 'select * from `my_table` where `my_field` between ? and ?';
$bindings = [
'2018-01-01',
'2020-09-01',
];
echo (new TracedStatement($query, $bindings))->getSqlWithParams();
In 1.15.0 it (correctly) returns
select * from `my_table` where `my_field` between <2018-01-01> and <2020-09-01>
In 1.16.3 it (incorrectly) returns
select * from `my_table` where `my_field` between <2018-01-01> and <2018-01-01>
It looks as if the first binding is being put in twice.