summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <serg@mysql.com>2006-05-24 14:22:36 +0200
committerunknown <serg@mysql.com>2006-05-24 14:22:36 +0200
commit6355f74e4d35d457771fe45f8f5331a3174226a4 (patch)
tree5161e5d5de5e25b888b1431d1b03c482421d17c3
parent9972f4bf5d629f29ecce9b41cc7fb00181dab299 (diff)
parente1227d2bd1dea7b8d7d3ff47b7fba8e6ef11cb05 (diff)
downloadmariadb-git-6355f74e4d35d457771fe45f8f5331a3174226a4.tar.gz
Merge mysql.com:/data0/mysqldev/my/mysql-5.0.17c-release
into mysql.com:/data0/mysqldev/my/mysql-5.0.22-release scripts/mysqld_multi.sh: Auto merged sql/sql_lex.cc: Auto merged sql/sql_parse.cc: Auto merged tests/mysql_client_test.c: Auto merged configure.in: merged extra/comp_err.c: merged
-rw-r--r--mysql-test/r/ctype_sjis.result4
-rw-r--r--mysql-test/t/ctype_sjis.test2
-rw-r--r--sql/sql_lex.cc31
-rw-r--r--tests/mysql_client_test.c21
4 files changed, 22 insertions, 36 deletions
diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result
index d1976a516d2..dab5991b505 100644
--- a/mysql-test/r/ctype_sjis.result
+++ b/mysql-test/r/ctype_sjis.result
@@ -172,6 +172,6 @@ c2h
ab_def
drop table t1;
SET NAMES sjis;
-SELECT HEX('@\\') FROM DUAL;
-HEX('@_\')
+SELECT HEX('@\') FROM DUAL;
+HEX('@\')
8DB2939181408C5C
diff --git a/mysql-test/t/ctype_sjis.test b/mysql-test/t/ctype_sjis.test
index 1d807b5e9a8..01e0b334554 100644
--- a/mysql-test/t/ctype_sjis.test
+++ b/mysql-test/t/ctype_sjis.test
@@ -78,6 +78,6 @@ SET collation_connection='sjis_bin';
--character_set sjis
SET NAMES sjis;
-SELECT HEX('@\\') FROM DUAL;
+SELECT HEX('@\') FROM DUAL;
# End of 4.1 tests
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 2b31abd6a50..de9d8b4a209 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -307,18 +307,7 @@ static char *get_text(LEX *lex)
found_escape=1;
if (lex->ptr == lex->end_of_query)
return 0;
-#ifdef USE_MB
- int l;
- if (use_mb(cs) &&
- (l = my_ismbchar(cs,
- (const char *)lex->ptr,
- (const char *)lex->end_of_query))) {
- lex->ptr += l;
- continue;
- }
- else
-#endif
- yySkip();
+ yySkip();
}
else if (c == sep)
{
@@ -347,9 +336,6 @@ static char *get_text(LEX *lex)
{
uchar *to;
- /* Re-use found_escape for tracking state of escapes */
- found_escape= 0;
-
for (to=start ; str != end ; str++)
{
#ifdef USE_MB
@@ -363,8 +349,7 @@ static char *get_text(LEX *lex)
continue;
}
#endif
- if (!found_escape &&
- !(lex->thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) &&
+ if (!(lex->thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) &&
*str == '\\' && str+1 != end)
{
switch(*++str) {
@@ -391,20 +376,14 @@ static char *get_text(LEX *lex)
*to++= '\\'; // remember prefix for wildcard
/* Fall through */
default:
- found_escape= 1;
- str--;
+ *to++= *str;
break;
}
}
- else if (!found_escape && *str == sep)
- {
- found_escape= 1;
- }
+ else if (*str == sep)
+ *to++= *str++; // Two ' or "
else
- {
*to++ = *str;
- found_escape= 0;
- }
}
*to=0;
lex->yytoklen=(uint) (to-start);
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index b1ea5f8ea06..15f919f6a2e 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -12794,25 +12794,26 @@ from t2);");
static void test_bug8378()
{
#if defined(HAVE_CHARSET_gbk) && !defined(EMBEDDED_LIBRARY)
- MYSQL *lmysql;
+ MYSQL *old_mysql=mysql;
char out[9]; /* strlen(TEST_BUG8378)*2+1 */
- int len;
+ char buf[256];
+ int len, rc;
myheader("test_bug8378");
if (!opt_silent)
fprintf(stdout, "\n Establishing a test connection ...");
- if (!(lmysql= mysql_init(NULL)))
+ if (!(mysql= mysql_init(NULL)))
{
myerror("mysql_init() failed");
exit(1);
}
- if (mysql_options(lmysql, MYSQL_SET_CHARSET_NAME, "gbk"))
+ if (mysql_options(mysql, MYSQL_SET_CHARSET_NAME, "gbk"))
{
myerror("mysql_options() failed");
exit(1);
}
- if (!(mysql_real_connect(lmysql, opt_host, opt_user,
+ if (!(mysql_real_connect(mysql, opt_host, opt_user,
opt_password, current_db, opt_port,
opt_unix_socket, 0)))
{
@@ -12822,12 +12823,18 @@ static void test_bug8378()
if (!opt_silent)
fprintf(stdout, " OK");
- len= mysql_real_escape_string(lmysql, out, TEST_BUG8378_IN, 4);
+ len= mysql_real_escape_string(mysql, out, TEST_BUG8378_IN, 4);
/* No escaping should have actually happened. */
DIE_UNLESS(memcmp(out, TEST_BUG8378_OUT, len) == 0);
- mysql_close(lmysql);
+ sprintf(buf, "SELECT '%s'", out);
+ rc=mysql_real_query(mysql, buf, strlen(buf));
+ myquery(rc);
+
+ mysql_close(mysql);
+
+ mysql=old_mysql;
#endif
}