summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorunknown <kent@mysql.com>2006-05-24 00:55:53 +0200
committerunknown <kent@mysql.com>2006-05-24 00:55:53 +0200
commit6a60accef25b70fcc87db20df02c028c6e38c73a (patch)
treeabf866cbea4dcc9f5363defee88ee1d555dde106 /tests
parenta171aa693e7f1c28ce67761621d032704fabde70 (diff)
downloadmariadb-git-6a60accef25b70fcc87db20df02c028c6e38c73a.tar.gz
don't let bugfix for bug#8303 break the bugfix for bug#8378
revert the fix for bug#8303 correct the test for bug#8378 mysql-test/r/ctype_sjis.result: updated mysql-test/t/ctype_sjis.test: updated sql/sql_lex.cc: revert the fix for bug#8303 tests/mysql_client_test.c: correct the test for bug#8378
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index f0566995262..776dc7cb89d 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -11554,25 +11554,26 @@ static void test_bug7990()
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)))
{
@@ -11582,12 +11583,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
}