Bug #23002 | In procedure comments being dropped by mysqldump, and MySQL Administrator backup | ||
---|---|---|---|
Submitted: | 5 Oct 2006 5:39 | Modified: | 12 Nov 2009 15:02 |
Reporter: | Matthew Montgomery | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Workbench | Severity: | S3 (Non-critical) |
Version: | 1.2.16 | OS: | Windows (Windows/Linux) |
Assigned to: | Alexander Musienko | CPU Architecture: | Any |
Tags: | backup. MySQL Administrator, comments, mysqldump, stored procedure, TTREV |
[5 Oct 2006 5:39]
Matthew Montgomery
[19 Oct 2006 8:37]
Konstantin Osipov
Matthew, I can't repeat the bug exactly as you described. In my environment comments are _always_ stripped by MySQL command line client (mysql) before even sending a query to the server. How did you manage to create a procedure with a comment to it? What version of the command line client do you use? Could you please try to repeat your finding using the latest versions of the command line client and the server (5.0 branch). I agree that your findings need to be documented, it's just not clear yet what exactly is there to document.
[19 Oct 2006 13:22]
MySQL Verification Team
I was able to create inline comments into the body of the stored procedure using the "MySQL Query Browser" GUI Tool. These comments were always stripped out using the CLI for me as well.
[12 Oct 2007 2:39]
Leoncio Madruga
To me the problem resides on Administrator Restore, which restores a commented set of Stored Procedures (generated by Backup) but without the comment lines. It is an new behavior of Restore. It worked fine last month. The circumvention is easy. Backup with Administrator and Restore with MySQL Browser, running the Script generated by Backup.
[13 Oct 2007 14:27]
Mark Leith
Bug #31579 was marked as a duplicate of this one.
[26 Oct 2007 13:14]
Stefan Nordhausen
Exact same problem here, using MySQL Administrator version 1.2.12. Leoncio's workaround worked fine, but it also shows that it must be a bug in the administrator, because the Query Browser can restore the comments without problems. Is anyone working on this? If the comments in my procedures are gone after restore, this effectively means a data loss for me. And data loss is certainly NOT something I want to see in a backup utility.
[31 Dec 2007 12:08]
Gleb Shchepa
To keep commentaries the "--comments" switch should be used with mysql client program (The default is --skip-comments (discard comments)): $ ../client/mysql --comments test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 9 Server version: 5.0.54-debug Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> DELIMITER $$ mysql> DROP PROCEDURE IF EXISTS `test`.`TESTPROC`$$ Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> CREATE PROCEDURE `TESTPROC`(val1 INT) -> BEGIN /* Some Comments */ SELECT val1; END$$ Query OK, 0 rows affected (0.00 sec) mysql> DELIMITER ; mysql> SHOW CREATE PROCEDURE TESTPROC\G *************************** 1. row *************************** Procedure: TESTPROC sql_mode: Create Procedure: CREATE DEFINER=``@`` PROCEDURE `TESTPROC`(val1 INT) BEGIN /* Some Comments */ SELECT val1; END 1 row in set (0.00 sec)
[7 Jan 2008 12:03]
Mark Leith
Hi Gleb, Any reason why the default can not be changed to --comments instead of --skip-comments? Having a lossy default seems backwards to me. I know personally that this has been hit by many many people, so would rather that we stored the comments by default rather than discarding them. Cheers, Mark
[7 Jan 2008 13:22]
Tito Brezovacki
I can report the same problem. MySQL Administrator restores procedures without comments while MySQL Query Browser (using the same script made previously by MySQL administrator) restores them correctly. So we can outwit the bug, but it stays active. The backup-restore procedure is not complete (safe, consistent, etc.) until this bug is resolved properly. (Thank you predecessors for the Query Browser workaround :) OS: Linux, Debian Etch mysql-server v5.0.32-Debian_7etch4 mysql-client v14.12 mysql administrator v1.2.12 mysql query browser v1.2.12
[26 Jan 2008 22:46]
Roland Bouman
Hi Leith, Gleb.... --comments? wtf? roland@roland-laptop:~/mysql-5.1.22-dev$ bin/mysql --comments -uroot -h127.0.0.1 bin/mysql: unknown option '--comments' Since when was that added?
[26 Jan 2008 23:08]
Paul DuBois
Roland, http://dev.mysql.com/doc/refman/5.1/en/mysql-command-options.html: --comments, -c Whether to preserve comments in statements sent to the server. The default is --skip-comments (discard comments), enable with --comments (preserve comments). This option was added in MySQL 5.1.23.
[28 Jan 2009 10:15]
noel bristow
is there any way to get MySQL Administrator to restore without stripping out in-procedure comments?
[12 Feb 2009 8:32]
Valeriy Kravchuk
Bug #42782 was marked as a duplicate of this one.
[11 Nov 2009 23:16]
Johannes Taxacher
workbench now uses '--comments' parameter when executing dump-import. will be included in 5.2.7
[12 Nov 2009 15:02]
Tony Bedford
A 'change' entry has been added to the 5.2.7 changelog: In the Administrator tab of MySQL Workbench the Data Dump (Export/Import Data) feature now uses the --comments parameter when executing an import or export operation.