Skip to content
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

Errors with strict mode #160

Open
miken32 opened this issue Aug 28, 2018 · 0 comments
Open

Errors with strict mode #160

miken32 opened this issue Aug 28, 2018 · 0 comments

Comments

@miken32
Copy link
Contributor

miken32 commented Aug 28, 2018

When using the most recent MySQL or MariaDB releases, SQL strict mode defaults to enabled. Trying to insert a customer record fails because there are no default values set for many of the columns, and no values are provided in the query! Without strict mode, an empty value was inserted automatically. I'm sure there problems with many other INSERT queries.

This query will show affected columns (i.e. those that cannot be set to null, but have null as a default value.) Probably many of these want to have no default value because they're required, but others can be updated to have default value of empty string.

SELECT table_name, column_name, column_type
    FROM information_schema.columns
    WHERE table_schema='mya2billing'
        AND is_nullable='NO'
        AND column_default is NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant