1drop table if exists t1; 2drop function if exists foofct; 3drop procedure if exists empty; 4drop procedure if exists foosp; 5drop procedure if exists nicesp; 6drop trigger if exists t1_empty; 7drop trigger if exists t1_bi; 8"Pass 1 : --disable-comments" 91 101 112 122 13foofct("call 1") 14call 1 15Function sql_mode Create Function character_set_client collation_connection Database Collation 16foofct NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `foofct`(x char(20)) RETURNS char(20) CHARSET latin1\nreturn\n\n\n\nx latin1 latin1_swedish_ci latin1_swedish_ci 17foofct("call 2") 18call 2 19Function sql_mode Create Function character_set_client collation_connection Database Collation 20foofct NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `foofct`(x char(20)) RETURNS char(20) CHARSET latin1\nbegin\n \n \n \n\n \n\n \n return x;\nend latin1 latin1_swedish_ci latin1_swedish_ci 21Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation 22empty NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `empty`()\nbegin\nend latin1 latin1_swedish_ci latin1_swedish_ci 23id data 24foo 42 25Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation 26foosp NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `foosp`()\ninsert into test.t1\n\n\n\n\n \n\n \n values ("foo", 42) latin1 latin1_swedish_ci latin1_swedish_ci 27Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation 28nicesp NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `nicesp`(a int)\nbegin\n \n declare b int;\n declare c float;\n\n \n \n\n \nend latin1 latin1_swedish_ci latin1_swedish_ci 29Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation 30t1_empty NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` trigger t1_empty after delete on t1\nfor each row\nbegin\nend latin1 latin1_swedish_ci latin1_swedish_ci 31Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation 32t1_bi NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1\nfor each row\nbegin\n\n\n\n \n declare b int;\n declare c float;\n\n \n \n\n \n set NEW.data := 12;\nend latin1 latin1_swedish_ci latin1_swedish_ci 33id data 34trig 12 35"Pass 2 : --enable-comments" 361 371 382 392 40foofct("call 1") 41call 1 42Function sql_mode Create Function character_set_client collation_connection Database Collation 43foofct NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `foofct`(x char(20)) RETURNS char(20) CHARSET latin1\nreturn\n-- comment 1a\n# comment 1b\n/* comment 1c */\nx # after body, on same line latin1 latin1_swedish_ci latin1_swedish_ci 44foofct("call 2") 45call 2 46Function sql_mode Create Function character_set_client collation_connection Database Collation 47foofct NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `foofct`(x char(20)) RETURNS char(20) CHARSET latin1\nbegin\n -- comment 1a\n # comment 1b\n /*\n comment 1c\n */\n\n -- empty line below\n\n -- empty line above\n return x;\nend latin1 latin1_swedish_ci latin1_swedish_ci 48Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation 49empty NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `empty`()\nbegin\nend latin1 latin1_swedish_ci latin1_swedish_ci 50id data 51foo 42 52Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation 53foosp NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `foosp`()\ninsert into test.t1\n## These comments are part of the procedure body, and should be kept.\n# Comment 2a\n-- Comment 2b\n/* Comment 2c */\n -- empty line below\n\n -- empty line above\n values ("foo", 42) # comment 3, still part of the body latin1 latin1_swedish_ci latin1_swedish_ci 54Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation 55nicesp NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `nicesp`(a int)\nbegin\n -- declare some variables here\n declare b int;\n declare c float;\n\n -- do more stuff here\n -- commented nicely and so on\n\n -- famous last words ...\nend latin1 latin1_swedish_ci latin1_swedish_ci 56Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation 57t1_empty NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` trigger t1_empty after delete on t1\nfor each row\nbegin\nend latin1 latin1_swedish_ci latin1_swedish_ci 58Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation 59t1_bi NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1\nfor each row\nbegin\n# comment 1a\n-- comment 1b\n/*\n comment 1c\n*/\n -- declare some variables here\n declare b int;\n declare c float;\n\n -- do more stuff here\n -- commented nicely and so on\n\n -- famous last words ...\n set NEW.data := 12;\nend latin1 latin1_swedish_ci latin1_swedish_ci 60id data 61trig 12 62End of 5.0 tests 63