4

mysqldump wraps my stored procedures in C-style comments:

DELIMITER ;;
/*!50003 CREATE*/ /*!50020 DEFINER=`user`@`localhost`*/ /*!50003 PROCEDURE `insert_cat`(

The reason why is for MySQL extensions:

However, HeidiSQL does not use extensions:

DELIMITER //
CREATE DEFINER=`user`@`localhost` PROCEDURE `insert_cat`(

How can I turn extensions off for mysqldump?

thecodeparadox
  • 86,271
  • 21
  • 138
  • 164
JohnB
  • 18,046
  • 16
  • 98
  • 110
  • possible duplicate of [How can I get rid of these comments in a MySQL dump?](http://stackoverflow.com/questions/1916392/how-can-i-get-rid-of-these-comments-in-a-mysql-dump) – Matt Fenwick Mar 22 '12 at 19:44
  • 1
    @JohnB - I can't tell what you want to do - turn off the comment designators around the conditional execution statements, or stop the conditional execution statements from appearing. Put another way, does HeidiSQL process them and you want her to stop processing them, or does she not process them and you want her to start processing them? If you could "turn off extensions" you wouldn't get the CREATE ... statements, right? – D Mac Mar 22 '12 at 20:07
  • I want `mysqldump` to generate SQL scripts in a similar fashion to HeidiSQL, i.e. without the extension comments, but with `create` statements. Please see the two examples. I don't know how else to say it. – JohnB Mar 22 '12 at 20:18
  • @mattfenwick: even though it's a duplicate, the actual question did not get answered. – Evert Mar 22 '12 at 20:20

1 Answers1

0

I think we're barking up the wrong tree. If I'm understanding what they're saying on their web site, HeidiSQL is an interface to MySQL databases, not a replacement for it.

So the answer is that you still have MySQL running underneath your HeidiSQL interface: don't let HeidiSQL read the dump file, give the dump file (with all the conditional expressions that MySQL knows so well) to MySQL.

D Mac
  • 3,727
  • 1
  • 25
  • 32
  • 1
    You are assuming that the reason I don't want comment extensions in my DDL scripts is because I want to run them from HeidiSQL. That is is not the case. *I just want cleaner DDL scripts.* Call me crazy. – JohnB Mar 23 '12 at 17:01
  • @JonhB - okay, you're "Crazy". I don't really believe that. Do you know that the numbers after the comment openers (e.g. "!50020" in "/*!50020" are MySQL version numbers? It is a conditional expression that is ignored by any insufficiently advance version of MySQL. If you get rid of the conditional expressions, you must be making your own assumptions about what version of MySQL you are running and which of the conditional expressions it can understand. Why do this? (I'm just curious) Also, you could write a rather trivial sed script to remove the comment designations and leave the expressions. – D Mac Mar 23 '12 at 17:30
  • I know what they are for, I just think they are unnecessary. For example: `/*!50003 CREATE*/`, really? I'm trying to version my DDL; I don't think I need those *crazy* comments. Anyway, I discovered Linux version of mysqldump.exe client has cleaner output than Windows client. – JohnB Mar 23 '12 at 20:18