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

MySQL error when running the application for the first time. #5

Open
Arp-G opened this issue Oct 18, 2020 · 0 comments
Open

MySQL error when running the application for the first time. #5

Arp-G opened this issue Oct 18, 2020 · 0 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Arp-G
Copy link
Owner

Arp-G commented Oct 18, 2020

When running the application sometimes MySQL gives an error like:

%MyXQL.Error{connection_id: 9, message: "(1067) (ER_INVALID_DEFAULT) Invalid default value for 'DateModified'", 
mysql: %{code: 1067, name: :ER_INVALID_DEFAULT}, statement: "CREATE TABLE csvsql_test.ActivityStream (`ItemId` VARCHAR(100), 
`ItemVersion` BIT, `_ItemTimestamp` VARCHAR(100), `ActivityStreamType` INT, `OriginalValue` TEXT, `NewValue` VARCHAR(100), 
`CreatorId` VARCHAR(100), `DateCreated` TIMESTAMP, `ModifierId` VARCHAR(100), `DateModified` TIMESTAMP, `OwnerId` VARCHAR(100));"}

Surprisingly this error disappears most of the time, and the app works fine when stopped and started again just after the error occurs.

As evident from the error message, it has something to do with default values for timestamp columns.

I suspect setting some MySQL modes might have something to do with this error. However, I am not sure, since this error occurs randomly even when testing with the same CSV files.

SET GLOBAL SQL_MODE="NO_BACKSLASH_ESCAPES,NO_ENGINE_SUBSTITUTION,NO_ZERO_IN_DATE";

MySQL docs, regarding the NO_ZERO_IN_DATE mode.

@Arp-G Arp-G added bug Something isn't working help wanted Extra attention is needed labels Oct 18, 2020
@Arp-G Arp-G self-assigned this Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant