=== modified file 'client/mysql.cc' --- client/mysql.cc 2007-11-05 11:45:55 +0000 +++ client/mysql.cc 2008-05-02 16:14:47 +0000 @@ -1351,37 +1351,6 @@ continue; } } - else if (!*ml_comment && !*in_string && - strlen(pos) >= 10 && - !my_strnncoll(charset_info, (uchar*) pos, 10, - (const uchar*) "delimiter ", 10)) - { - // Flush previously accepted characters - if (out != line) - { - buffer.append(line, (uint32) (out - line)); - out= line; - } - - // Flush possible comments in the buffer - if (!buffer.is_empty()) - { - if (com_go(&buffer, 0) > 0) // < 0 is not fatal - DBUG_RETURN(1); - buffer.length(0); - } - - /* - Delimiter wants the get rest of the given line as argument to - allow one to change ';' to ';;' and back - */ - buffer.append(pos); - if (com_delimiter(&buffer, pos) > 0) - DBUG_RETURN(1); - - buffer.length(0); - break; - } else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter)) { // Found a statement. Continue parsing after the delimiter === modified file 'mysql-test/r/mysql.result' --- mysql-test/r/mysql.result 2007-09-20 08:54:46 +0000 +++ mysql-test/r/mysql.result 2008-05-02 16:14:11 +0000 @@ -38,6 +38,8 @@ t3 Tables_in_test t1 +delimiter +1 _ Test delimiter : from command line a === modified file 'mysql-test/t/mysql_delimiter.sql' --- mysql-test/t/mysql_delimiter.sql 2006-11-22 06:27:06 +0000 +++ mysql-test/t/mysql_delimiter.sql 2008-05-02 16:05:17 +0000 @@ -59,3 +59,9 @@ use test// show tables// delimiter ; # Reset delimiter + +# +# Bug #33812: mysql client incorrectly parsing DELIMITER +# +select a as delimiter from t1 +delimiter ; # Reset delimiter