summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorunknown <serg@mysql.com>2006-05-24 14:12:19 +0200
committerunknown <serg@mysql.com>2006-05-24 14:12:19 +0200
commit80e7938736019853b1b66d5e4edaf36d9a7d522c (patch)
treec209e576f12c0f0f8ec7b5541596d7d1e2845fad /tests
parent9cffcab4e671ff80003d19fddb9a99726b301069 (diff)
parentf02b0d8afd0aaf881b6a823d05ebd0f7fa0c1af3 (diff)
downloadmariadb-git-80e7938736019853b1b66d5e4edaf36d9a7d522c.tar.gz
Merge mysql.com:/data0/mysqldev/my/mysql-4.1.16a-release
into mysql.com:/data0/mysqldev/my/mysql-4.1.20-release tests/mysql_client_test.c: Auto merged configure.in: merged
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 5133a9013d2..3c54bf50c15 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
}