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

Empty database is not created #110

Closed
tsolodov opened this issue Mar 1, 2018 · 6 comments · Fixed by #403
Closed

Empty database is not created #110

tsolodov opened this issue Mar 1, 2018 · 6 comments · Fixed by #403
Labels

Comments

@tsolodov
Copy link
Contributor

tsolodov commented Mar 1, 2018

Hi,

Here is scenario:

DB EMPTY_DB without any tables.

mydumper 0.9.3, built against MySQL 5.6.21-70.1

mydumper --regex '^(?!(mysql))' --outputdir=/mnt/PATH/
--build-empty-files
-G -E -R --less-locking
--logfile=/tmp/dump.log
--tz-utc
--threads=20
--verbose=4
-u USER -p XXX -h localhost

./myloader -t 10 --verbose=4 -u XXX -h localhost -p XXX -d /mnt/PATH/

I do have a file in /mnt/PATH:

CREATE DATABASE EMPTY_DB /*!40100 DEFAULT CHARACTER SET latin1 */;

but it was not processed by myloader

@maxbube
Copy link
Collaborator

maxbube commented Apr 3, 2018

Hi @tsolodov , that is expected as myloader only creates schemas when restoring a table, so if there is not any table then no schema.

I will review how hard could be to change this behavior.

@tsolodov
Copy link
Contributor Author

tsolodov commented Apr 3, 2018

Thanks for reply!

@jynus
Copy link

jynus commented May 29, 2018

I added here how this can lead to an outage (sadly, not theoretical) https://bugs.launchpad.net/mydumper/+bug/1558164 At the very least, adding a warning on dump would be nice if expected behavior.

@dongdongvs6
Copy link

meet the problem too, is there any solution?

@davidducos
Copy link
Member

I reviewed the code, and it is checking on each table creation if the database exists which might not be the best way of doing this.
I think that we should have a stage of schema creation and then another stage of table creation. If we implement like this, we are going to be able to fix this issue.

@davidducos davidducos added this to the Release 0.10.11 milestone Jul 16, 2021
@davidducos davidducos linked a pull request Sep 23, 2021 that will close this issue
@davidducos
Copy link
Member

#403 imports empty databases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants