laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.32k stars 10.95k forks source link

db update failed,but save() method return true #47447

Closed miaotiao closed 1 year ago

miaotiao commented 1 year ago

Laravel Version

10.13.5

PHP Version

8.1.18

Database Driver & Version

MySQL 5.7.22 for centos 7.8 on x86

Description

image

$res is true , but this sql run error.

image

So : Although this SQL statement executed an error, the save method of the model returned true and no exception was thrown

Steps To Reproduce

mysql table structure :

image

driesvints commented 1 year ago

Heya, thanks for reporting.

We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.

laravel new bug-report --github="--public"

Please do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.

Thanks!