$NetBSD: patch-ao,v 1.2 2007/03/11 18:42:50 adam Exp $

--- sql/sql_lex.cc.orig	2007-03-05 20:21:11.000000000 +0100
+++ sql/sql_lex.cc
@@ -931,6 +931,9 @@ int MYSQLlex(void *arg, void *yythd)
       while (lex->ptr != lex->end_of_query &&
 	     ((c=yyGet()) != '*' || yyPeek() != '/'))
       {
+	if (c == '\0')
+	  return(ABORT_SYM);		// NULLs illegal even in comments
+
 	if (c == '\n')
 	  lex->yylineno++;
       }
