I was testing SiardFromDb with MySQL for a project and found that using a DB user that has been granted full privileges to all databases causes the process to exit with a NullPointerException. I figured out how to work around the problem, but thought I should document it as an issue.
Steps to recreate: I restored a single database on a new MySQL install. For expediency I created a user like this:
CREATE USER 'all'@'localhost' IDENTIFIED BY 'all';
GRANT ALL PRIVILEGES ON *.* to 'all'@'localhost';
The process printed the Meta Data section which showed a list of tables in "testdb" then it continued and listed the system tables as well e.g. "mysql"."db". At the end of the list it printed a NullPointerException and exited without completing. The error did not include a stack trace.
To work around the issue, I created a new user like this, limiting to just the one database:
CREATE USER 'testdb-only'@'localhost' IDENTIFIED BY 'testdb-only';
GRANT ALL PRIVILEGES ON testdb.* TO 'testdb-only'@'localhost';
This completed the export without an error. While trying to figure out a work around, I also created a simple database with one table, and changed the JDBC URL to point to that database, but it still retrieved data from the first database. It seems like the database selection in the JDBC URL was being ignored and it was retrieving everything visible to the user rather than just the one database.
Hope I'm logging this in the correct project - I suspect the issue might be in one of the underlying projects. I was going to try to debug, but I don't have my machine configured for Ant. Happy to provide any additional context.
Hi @karenhanson, thank you for your detailed and clear report. Apologies for the extended response time (over 3 years!). We will investigate and get back to you. Appreciate your patience.
I was testing SiardFromDb with MySQL for a project and found that using a DB user that has been granted full privileges to all databases causes the process to exit with a NullPointerException. I figured out how to work around the problem, but thought I should document it as an issue.
Steps to recreate: I restored a single database on a new MySQL install. For expediency I created a user like this:
I then ran the SiardFromDb command like this:
The process printed the Meta Data section which showed a list of tables in "testdb" then it continued and listed the system tables as well e.g. "mysql"."db". At the end of the list it printed a NullPointerException and exited without completing. The error did not include a stack trace.
To work around the issue, I created a new user like this, limiting to just the one database:
I then ran a command like this:
This completed the export without an error. While trying to figure out a work around, I also created a simple database with one table, and changed the JDBC URL to point to that database, but it still retrieved data from the first database. It seems like the database selection in the JDBC URL was being ignored and it was retrieving everything visible to the user rather than just the one database.
Hope I'm logging this in the correct project - I suspect the issue might be in one of the underlying projects. I was going to try to debug, but I don't have my machine configured for Ant. Happy to provide any additional context.