diff --git a/mysys/default.c b/mysys/default.c
index 3a751eb4e299d8e8c97abe4f4587f657210e2ada..d9099a9e505c323bc602546c143042352a5486f5 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -461,7 +461,7 @@ static char *remove_end_comment(char *ptr)
       else if (quote == *ptr)
 	quote= 0;
     }
-    if (!quote && *ptr == '#') /* We are not inside a comment */
+    if (!quote && (*ptr == '#' || *ptr == ';')) // We are not inside a comment
     {
       *ptr= 0;
       return ptr;