-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Form validation strange behavior, SQLSTATE[23000] error #6126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
Yes, as you can see here - https://yadi.sk/i/629sBUhWcq9bc I tried to exec the query directly with PMA and it was the same error occured - https://yadi.sk/i/FNvJs11GcqAMf But then I tried the same query with two rows of parameters - https://yadi.sk/i/qdT1TsEJcqADV and it was made without errors
Are you sure this is correct for mysql? I can't find this in mysql docs, just the "default" keyword. So the query
passes success - https://yadi.sk/i/jxRblRi4cqDEw I thought maybe sql_mode has wrong value,but it's default (empty value). |
It is sql_mode indeed. If it's strict any insertion of incompatible data results in error. If it's not, MySQL tries to convert it somehow (mostly results in wrong data). |
Yeah, it's true. But empty sql_mode value is not strict, is it? My sql_mode value: |
It shouldn't be but it may depend on the OS package. |
out of the yii scope. If you want to ensure a attribute has a specific value, you should set a default value by Yii http://www.yiiframework.com/doc-2.0/guide-tutorial-core-validators.html#default |
Hello.
I have simple mysql table:
And default generated by CRUD Model, Controller and Views without any changes. Model has these validation rules:
When I'm trying to create new category item without filling rate field, Yii throws exception:
Screenshot
I think this is very strange. Do the rate field should init default value before saving to DB, don't it?
The text was updated successfully, but these errors were encountered: