Adding --include-*/--exclude-* options to ndb_restore

I’ve been working on some new options for ndb_restore which allows to include and exclude databases and/or tables while restoring. The current solution doesn’t really work as documented, or isn’t flexible enough.

Not really my job, but lots of us in MySQL Support are developers. Doing some coding from time to time keeps one sharp!

How it works? Let me show it with some (simplified) examples:

# only restore db1
ndb_restore --include-database="db1" /dir/.../

# only restore db2.t2 (1 table)
ndb_restore --include-tables="db2.t2" /dir/.../

# restore the rest of db2
ndb_restore --include-databases="db2" --exclude-tables="db2.t2" /dir/.../

# restore db3 excluding db1 and db2
ndb_restore --exclude-databases="db1,db2" /dir/.../

This isn’t pushed yet, but if anyone has some comments or wants something more, just comment on the bug report.

Now I have to figure out how to make test cases and push it to MySQL Cluster 6.3 or 6.4.