diff options
author | jimw@mysql.com <> | 2005-06-23 18:29:56 -0700 |
---|---|---|
committer | jimw@mysql.com <> | 2005-06-23 18:29:56 -0700 |
commit | 3ccb90c0857653669bfc4e7048821c6dd0fed167 (patch) | |
tree | b5f6e8ddaa771fd03ce4b741cc2723ea99b358ca /libmysql | |
parent | 539d63d09afc91b3286611bee8991d5f257fc226 (diff) | |
download | mariadb-git-3ccb90c0857653669bfc4e7048821c6dd0fed167.tar.gz |
Make status of NO_BACKSLASH_ESCAPES mode known to the client so
it can use it to switch to only quoting apostrophes by doubling
them when it is in effect. (Bug #10214)
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/libmysql.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 8ee11519615..ce47ea21485 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1616,7 +1616,14 @@ ulong STDCALL mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, ulong length) { - return escape_string_for_mysql(mysql->charset, to, 0, from, length); + if (mysql->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES) + { + return escape_quotes_for_mysql(mysql->charset, to, 0, from, length); + } + else + { + return escape_string_for_mysql(mysql->charset, to, 0, from, length); + } } |