summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-02-15 11:31:01 -0800
committerunknown <jimw@mysql.com>2005-02-15 11:31:01 -0800
commit9dad64a129a18e8b9d64edcd5947e9eba88f3c41 (patch)
tree2942069b3c0860fe3aab590bc51515d0f43ab93e /tests
parentae14393e7487f3c8a97f3dc44cab7a2c19cdd0a9 (diff)
downloadmariadb-git-9dad64a129a18e8b9d64edcd5947e9eba88f3c41.tar.gz
Only escape the first character in a sequence of bytes that appears to be
a multibyte character, but was not a valid multibyte character. Refinement of fix for Bug #8378. tests/mysql_client_test.c: Fix test (and fix number) for Bug #8378 mysys/charset.c: Fix to only escape the first character in a sequence that appears to be a multibyte character, but was not a valid one.
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index b7e3e1b3469..7886e0c1884 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -11535,20 +11535,20 @@ static void test_bug6761(void)
/*
Test mysql_real_escape_string() with gbk charset
- The important part is that 0x27 (') is the second-byte in a invvalid
+ The important part is that 0x27 (') is the second-byte in a invalid
two-byte GBK character here. But 0xbf5c is a valid GBK character, so
- it needs to be escaped as 0x5cbf5c27
+ it needs to be escaped as 0x5cbf27
*/
-#define TEST_BUG8317_IN "\xef\xbb\xbf\x27"
-#define TEST_BUG8317_OUT "\xef\xbb\x5c\xbf\x5c\x27"
+#define TEST_BUG8378_IN "\xef\xbb\xbf\x27\xbf\x10"
+#define TEST_BUG8378_OUT "\xef\xbb\x5c\xbf\x5c\x27\x5c\xbf\x10"
-static void test_bug8317()
+static void test_bug8378()
{
MYSQL *lmysql;
- char out[9]; /* strlen(TEST_BUG8317)*2+1 */
+ char out[9]; /* strlen(TEST_BUG8378)*2+1 */
int len;
- myheader("test_bug8317");
+ myheader("test_bug8378");
if (!opt_silent)
fprintf(stdout, "\n Establishing a test connection ...");
@@ -11572,10 +11572,10 @@ static void test_bug8317()
if (!opt_silent)
fprintf(stdout, " OK");
- len= mysql_real_escape_string(lmysql, out, TEST_BUG8317_IN, 4);
+ len= mysql_real_escape_string(lmysql, out, TEST_BUG8378_IN, 4);
/* No escaping should have actually happened. */
- DIE_UNLESS(memcmp(out, TEST_BUG8317_OUT, len) == 0);
+ DIE_UNLESS(memcmp(out, TEST_BUG8378_OUT, len) == 0);
mysql_close(lmysql);
}
@@ -11787,7 +11787,7 @@ static struct my_tests_st my_tests[]= {
{ "test_conversion", test_conversion },
{ "test_rewind", test_rewind },
{ "test_bug6761", test_bug6761 },
- { "test_bug8317", test_bug8317 },
+ { "test_bug8378", test_bug8378 },
{ 0, 0 }
};