Below is the list of changes that have just been committed into a local
5.0 repository of kgeorge. When kgeorge does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-07-29 09:21:29+03:00, gkodinov@stripped +4 -0
Bug #20103: Escaping with backslash does not work
- implement the --no-backslash-escapes option
to disable the special meaning of backslash
at the client side. This is needed to complement
the server-side no_backslash_escapes sql mode.
client/client_priv.h@stripped, 2006-07-29 09:21:21+03:00, gkodinov@stripped +2 -1
Bug #20103: Escaping with backslash does not work
- implement the --no-backslash-escapes option
to disable the special meaning of backslash
at the client side.
client/mysql.cc@stripped, 2006-07-29 09:21:22+03:00, gkodinov@stripped +5 -1
Bug #20103: Escaping with backslash does not work
- implement the --no-backslash-escapes option
to disable the special meaning of backslash
at the client side.
mysql-test/r/mysql_client.result@stripped, 2006-07-29 09:21:23+03:00, gkodinov@stripped +4 -0
Bug #20103: Escaping with backslash does not work
- test case
mysql-test/t/mysql_client.test@stripped, 2006-07-29 09:21:23+03:00, gkodinov@stripped +11 -0
Bug #20103: Escaping with backslash does not work
- test case
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: gkodinov
# Host: macbook.mshome.net
# Root: /Users/kgeorge/mysql/work/B20103-5.0-opt
--- 1.209/client/mysql.cc 2006-07-29 09:21:45 +03:00
+++ 1.210/client/mysql.cc 2006-07-29 09:21:45 +03:00
@@ -139,6 +139,7 @@ static my_bool info_flag=0,ignore_errors
show_warnings = 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0;
+static my_bool no_backslash_escapes=0;
static my_string opt_mysql_unix_port=0;
static int connect_flag=CLIENT_INTERACTIVE;
static char *current_host,*current_db,*current_user=0,*opt_password=0,
@@ -717,6 +718,9 @@ static struct my_option my_long_options[
{"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.",
(gptr*) &show_warnings, (gptr*) &show_warnings, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
+ {"no-backslash-escapes", OPT_NO_BACKSLASH_ESCAPES,
+ "Disables backslash escape processing", (gptr*) &no_backslash_escapes,
+ (gptr*) &no_backslash_escapes, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -1221,7 +1225,7 @@ static bool add_line(String &buffer,char
continue;
}
#endif
- if (!*ml_comment && inchar == '\\')
+ if (!*ml_comment && !no_backslash_escapes && inchar == '\\')
{
// Found possbile one character command like \c
--- 1.44/client/client_priv.h 2006-07-29 09:21:45 +03:00
+++ 1.45/client/client_priv.h 2006-07-29 09:21:45 +03:00
@@ -51,5 +51,6 @@ enum options_client
#endif
OPT_TRIGGERS,
OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE,
- OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_SSL_VERIFY_SERVER_CERT
+ OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_SSL_VERIFY_SERVER_CERT,
+ OPT_NO_BACKSLASH_ESCAPES
};
--- 1.1/mysql-test/r/mysql_client.result 2006-07-29 09:21:45 +03:00
+++ 1.2/mysql-test/r/mysql_client.result 2006-07-29 09:21:45 +03:00
@@ -2,3 +2,7 @@
1
ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
ERROR at line 1: USE must be followed by a database name
+\
+\\
+';
+';
--- 1.1/mysql-test/t/mysql_client.test 2006-07-29 09:21:45 +03:00
+++ 1.2/mysql-test/t/mysql_client.test 2006-07-29 09:21:45 +03:00
@@ -27,3 +27,14 @@
# client comment recognized, but parameter missing => error
--exec echo "use" > $MYSQLTEST_VARDIR/tmp/bug20432.sql
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1
+
+#
+# Bug #20103: Escaping with backslash does not work
+#
+--exec echo "SET SQL_MODE = 'NO_BACKSLASH_ESCAPES';" > $MYSQLTEST_VARDIR/tmp/bug20103.sql
+--exec echo "SELECT '\';" >> $MYSQLTEST_VARDIR/tmp/bug20103.sql
+--exec $MYSQL --no-backslash-escapes < $MYSQLTEST_VARDIR/tmp/bug20103.sql 2>&1
+
+--exec echo "SET SQL_MODE = '';" > $MYSQLTEST_VARDIR/tmp/bug20103.sql
+--exec echo "SELECT '\';';" >> $MYSQLTEST_VARDIR/tmp/bug20103.sql
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20103.sql 2>&1
| Thread |
|---|
| • bk commit into 5.0 tree (gkodinov:1.2222) BUG#20103 | kgeorge | 29 Jul |