Details
Description
Dear MariaDB developers,
I encountered a problem when importing from a database dump of itself.
I used this command for the dump:
mysqldump --routines --triggers --events --single-transaction -u root -p --databases my_db > ./my_db_dump.sql
After I got the dump file, and was trying to import the database dump, the MariaDB complains about syntax error on a single line. This line is about the EVENT from the dump.
The offending line looks like this:
/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `expireToken` ON SCHEDULE EVERY 1 DAY STARTS '2014-08-08 14:47:34' ON COMPLETION NOT PRESERVE ENABLE DO DELETE FROM Token WHERE DATE(time_end) < CURRENT_DATE; */ ;;
Notice, there are a lot of "/* */" in this line. If I remove them as the following, the import can finish without any issue, and the database seems to be set up properly after importing:
CREATE DEFINER=`root`@`localhost` EVENT `expireToken` ON SCHEDULE EVERY 1 DAY STARTS '2014-08-08 14:47:34' ON COMPLETION NOT PRESERVE ENABLE DO DELETE FROM Token WHERE DATE(time_end) < CURRENT_DATE;
Do you know what could be the issues here? Is this a bug in MariahDB "mysqldump" command?
Thanks,
Kai
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
The syntax error in the quoted statement is obvious:
...WHERE DATE(time_end) < CURRENT_DATE; */
There should be no semicolon after CURRENT_DATE.
The question is how it appeared there.
You mentioned in the 'Affects Version' field that it's 5.5.40.
I tried to dump an identical event and got an identical dump, but without the semicolon – that is, a valid one.
Which MariaDB package are you using?
Could you please make sure that mysqldump is from the same package/version – run mysqldump --version and see if it says 'Distrib 5.5.40-MariaDB' or alike?