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

Adapt package for framework v2 #86

Merged
merged 6 commits into from Aug 4, 2018
Merged

Adapt package for framework v2 #86

merged 6 commits into from Aug 4, 2018

Conversation

schlessera
Copy link
Member

Fixes #85

@swissspidy
Copy link
Member

Getting the following error now when running the tests:

01. $ wp db import wordpress.sql
    
    ERROR 1067 (42000) at line 14 in file: 'wordpress.sql': Invalid default value for 'comment_date'
    cwd: /var/folders/c1/8bn4rqzx0h1f49bxgmrzk2hm0000gn/T/wp-cli-test-run-search-replace-export.feature.3-5b65b9e29de725.05330330/
    run time: 0.36528205871582
    exit status: 1
    In step `And I run `wp db import wordpress.sql`'.  # vendor/wp-cli/wp-cli-tests/features/steps/when.php:29
    From scenario `Search / replace export to STDOUT'. # features/search-replace-export.feature:3
    Of feature `Search / replace with file export'.

No idea how that got broken.

@wojsmol
Copy link
Contributor

wojsmol commented Aug 4, 2018

missing wp db

@swissspidy
Copy link
Member

@wojsmol Nope, that's not it. Just tested. The format of the exported SQL file really seems to be off.

@swissspidy
Copy link
Member

It's probably because I run MySQL 8 locally, and apparently in strict mode:

mysql> SHOW VARIABLES LIKE 'sql_mode';
+---------------+-----------------------------------------------------------------------------------------------------------------------+
| Variable_name | Value                                                                                                                 |
+---------------+-----------------------------------------------------------------------------------------------------------------------+
| sql_mode      | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION |
+---------------+-----------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

See https://dev.mysql.com/doc/refman/8.0/en/timestamp-initialization.html and https://stackoverflow.com/questions/36374335/error-in-mysql-when-setting-default-value-for-date-or-datetime.

So this is more of a bug in WordPress's default db schema than in this command.

@schlessera schlessera added this to the 1.4.0 milestone Aug 4, 2018
@schlessera schlessera merged commit bc14fe6 into master Aug 4, 2018
@schlessera schlessera deleted the adapt-for-v2 branch August 4, 2018 18:30
danielbachhuber pushed a commit that referenced this pull request Nov 18, 2022
Adapt package for framework v2
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

Successfully merging this pull request may close these issues.

None yet

3 participants