From ddbf9fdc1cc39978add9762f71cd77106e3ce8c4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Aug 2007 18:03:44 +0200 Subject: [PATCH] Don't require a space between "if" and "(". This should also fix "while" and "connect" It's now possible to write "if(" client/mysqltest.c: Don't require a space between for example "if" and "(". This should also fix "while" and "connect" mysql-test/t/mysqltest.test: Remove space between if and ( to check it works --- client/mysqltest.c | 8 ++++++-- mysql-test/t/mysqltest.test | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 543dabf52f0..65e965ef128 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -4814,9 +4814,13 @@ int read_command(struct st_command** command_ptr) if (!(command->query_buf= command->query= my_strdup(p, MYF(MY_WME)))) die("Out of memory"); - /* Calculate first word and first argument */ - for (p= command->query; *p && !my_isspace(charset_info, *p) ; p++) ; + /* Calculate first word length(the command), terminated by space or ( */ + p= command->query; + while (*p && !my_isspace(charset_info, *p) && *p != '(') + p++; command->first_word_len= (uint) (p - command->query); + DBUG_PRINT("info", ("first_word: %.*s", + command->first_word_len, command->query)); /* Skip spaces between command and first argument */ while (*p && my_isspace(charset_info, *p)) diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 791bacd636c..4f9964552d9 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -969,7 +969,7 @@ if (!$counter) echo Counter is not 0, (counter=10); } let $counter=0; -if ($counter) +if($counter) { echo Counter is greater than 0, (counter=0); }