File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
cdk/include/mysql/cdk/foundation Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -283,8 +283,7 @@ size_t str_decode(
283
283
return 0 ;
284
284
285
285
using Transcoder = rapidjson::Transcoder<FROM, TO>;
286
- Mem_stream<char > bytes ((const char *)beg, len);
287
- rapidjson::EncodedInputStream<FROM, Mem_stream<char > > input (bytes);
286
+ Mem_stream<typename FROM::Ch> input ((typename FROM::Ch*)beg, len);
288
287
Str_stream<typename TO::Ch> output (out);
289
288
290
289
while (input.Peek () != ' \0 ' )
@@ -296,7 +295,7 @@ size_t str_decode(
296
295
}
297
296
}
298
297
299
- return bytes .Tell ();
298
+ return input .Tell ();
300
299
}
301
300
302
301
Original file line number Diff line number Diff line change @@ -821,3 +821,19 @@ TEST_F(Bugs, bug29847865)
821
821
EXPECT_EQ (foo.size (), bar.size ());
822
822
EXPECT_EQ (foo, bar);
823
823
}
824
+
825
+ TEST_F (Bugs, bug31656092)
826
+ {
827
+ SKIP_IF_NO_XPLUGIN
828
+
829
+ // first byte is the same as utf BOM mark, however, a valid unicode
830
+ string foo (" \xef\xbc\x88 " );
831
+
832
+ string query;
833
+ query = string (u" select '" ) + foo +string (" '" );
834
+ Row r = get_sess ().sql (query).execute ().fetchOne ();
835
+ string bar = r.get (0 );
836
+
837
+ EXPECT_EQ (foo.size (), bar.size ());
838
+ EXPECT_EQ (foo, bar);
839
+ }
You can’t perform that action at this time.
0 commit comments