Comments - COM_QUERY

5 years, 9 months ago Meirav Rath

I can't see in your own example, or in a pcap I recorded with Connect/J 2.2.5, these escape characters you're talking about here. Where are they?

 
5 years, 9 months ago Vladislav Vaintroub

escapes are not part of the protocol. It is part of the language, in particular, it is how string literals are defined.

if you have a string which is a single quote, you need to escape it somehow, because you cannot have ''' for that.

 
5 years, 9 months ago Diego Dupin

maybe using another example: selecting binary value 0x0001 result will be :

1A 00 00 00 03 73 65 6C 65 63 74 20 5F 42 49 4E .....select _BIN 41 52 59 20 27

5C 00 01 27 20 61 73 20 61 ARY '\..' as a

the 0x00 character must be escaped with '\'

 
5 years, 9 months ago Meirav Rath

How about what I see in my pcap:

0000 45 00 00 42 00 00 00 00 80 06 6a 1a 0a 02 91 0d E..B......j..... 0010 0a 64 2b 29 fa c3 0c ea 00 00 02 4c 00 00 02 09 .d+)úÃ.ê...L.... 0020 50 10 40 00 46 7d 00 00 03 63 61 6c 6c 20 73 6f P.@.F}...call so 0030 6d 65 6e 61 6d 65 31 28 27 68 65 72 74 7a 65 6c mename1('hertzel 0040 27 29 ')

the ') in the end is part of the query I sent...

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.