- Laravel Version: 5.7.12 (but maybe in every versions)
- PHP Version: 7.2.1
- Database Driver & Version: MySQL 5.6.38
Description:
When an SQL exception is thrown, the bindings are not correctly assigned in the exception's message when one of the values contains a question mark ?.
Steps To Reproduce:
On a simple Laravel install, try to run the following in php artisan tinker :
App\User::create(['foo' => '?', 'email' => 'bar@example.com']);
You should have an Exception like this :
Illuminate/Database/QueryException with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'foo' in 'field list' (SQL: insert into `users` (`foo`, `email`, `updated_at`, `created_at`) values (bar@example.com, 2019-04-17 12:51:12, 2019-04-17 12:51:12, ?))'
Here you can see that the value of email is in foo and that created_at is empty...
Description:
When an SQL exception is thrown, the bindings are not correctly assigned in the exception's message when one of the values contains a question mark
?.Steps To Reproduce:
On a simple Laravel install, try to run the following in
php artisan tinker:You should have an Exception like this :
Here you can see that the value of
emailis infooand thatcreated_atis empty...