Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
3.3, 3.4
-
None
Description
test case for unittest/libmariadb/charset.c
#define TEST_BUG8378a_IN "\xa1' + 10 -- "
|
#define TEST_BUG8378a_OUT "\\\xa1\\' + 10 -- "
|
|
|
/* set connection options */
|
struct my_option_st opt_bug8378a[] = { |
{MYSQL_SET_CHARSET_NAME, (char *) "big5"}, |
{0, NULL}
|
};
|
|
|
int bug_8378a(MYSQL *mysql) { |
int rc, len; |
char out[128], buf[256]; |
MYSQL_RES *res;
|
MYSQL_ROW row;
|
|
|
/* MXS-4898: MaxScale sends utf8mb4 in handshake OK packet */ |
SKIP_MAXSCALE;
|
|
|
len= mysql_real_escape_string(mysql, out, TEST_BUG8378a_IN, sizeof(TEST_BUG8378a_IN)-1); |
FAIL_IF(memcmp(out, TEST_BUG8378a_OUT, len), "wrong result"); |
|
|
sprintf(buf, "SELECT '%s' FROM DUAL", out); |
|
|
rc= mysql_query(mysql, buf);
|
check_mysql_rc(rc, mysql);
|
|
|
if ((res= mysql_store_result(mysql))) { |
row= mysql_fetch_row(res);
|
if (memcmp(row[0], TEST_BUG8378a_IN, sizeof(TEST_BUG8378a_IN)-1)) { |
mysql_free_result(res);
|
return FAIL; |
}
|
mysql_free_result(res);
|
} else |
return FAIL; |
|
|
return OK; |
}
|
Reported by Jun Rong
Attachments
Issue Links
- links to