From 788b4e404bbd97ff6b215ae55633e0971f8d19d6 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 10 Aug 2010 12:13:58 +0200 Subject: Bug #55413 mysqltest gives parse error for lines matching "^let.*\\.*;$" Allow escaped quotes also in statements not starting with -- But will not support single unescaped ' or ` --- client/mysqltest.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/mysqltest.cc b/client/mysqltest.cc index d7a302912b4..d8c921e8f18 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -5507,6 +5507,8 @@ int read_line(char *buf, int size) char c, UNINIT_VAR(last_quote); char *p= buf, *buf_end= buf + size - 1; int skip_char= 0; + my_bool have_slash= FALSE; + enum {R_NORMAL, R_Q, R_SLASH_IN_Q, R_COMMENT, R_LINE_START} state= R_LINE_START; DBUG_ENTER("read_line"); @@ -5578,9 +5580,13 @@ int read_line(char *buf, int size) } else if (c == '\'' || c == '"' || c == '`') { - last_quote= c; - state= R_Q; + if (! have_slash) + { + last_quote= c; + state= R_Q; + } } + have_slash= (c == '\\'); break; case R_COMMENT: -- cgit v1.2.1 From 76907f8591d1c8d1fa91eca388304b3fb4d7d4c8 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 25 Aug 2010 10:23:19 +0200 Subject: Bug #52301 Add --protocol to mysqltest Added code resulted in strange linking problem for embedded on Windows Avoided by not doing this for embedded mode It's irrelevant for embedded server anyway, --protocol will be ignored --- client/mysqltest.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'client') diff --git a/client/mysqltest.cc b/client/mysqltest.cc index d7a302912b4..756208a0f96 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -5220,8 +5220,10 @@ void do_connect(struct st_command *command) } #endif +#ifndef EMBEDDED_LIBRARY if (opt_protocol) mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol); +#endif #ifdef HAVE_SMEM if (con_shm) @@ -6179,8 +6181,10 @@ get_one_option(int optid, const struct my_option *opt, print_version(); exit(0); case OPT_MYSQL_PROTOCOL: +#ifndef EMBEDDED_LIBRARY opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, opt->name); +#endif break; case '?': usage(); @@ -7932,8 +7936,10 @@ int main(int argc, char **argv) mysql_options(&con->mysql, MYSQL_SET_CHARSET_DIR, opt_charsets_dir); +#ifndef EMBEDDED_LIBRARY if (opt_protocol) mysql_options(&con->mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol); +#endif #ifdef HAVE_OPENSSL -- cgit v1.2.1