"\u0000" in sql will lead to invalid message format error
See original GitHub issueINSERT INTO "content"(
"name"
)
VALUES
(
'"1234\u0000"',
);
OK with command line. not OK with ng.
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
"\u0000" in sql will lead to invalid message format error
INSERT INTO "content"( "name" ) VALUES ( '"1234\u0000"', );. OK with command line. not OK with ng. See More.
Read more >Handling Unicode sequences in postgresql - json
\u0000 is the one Unicode code point which is not valid in a string. I see no other way than to sanitize the...
Read more >unsupported Unicode escape sequence, \u0000 cannot be ...
4), it would report the following error: ERROR: unsupported Unicode escape sequence DETAIL: \u0000 cannot be converted to text. CONTEXT: JSON ...
Read more >Removing Null Characters (0x00) From Values in SQL Server
Casting to varbinary returns the character values in the column as hexadecimal. Once the values were converted to hexadecimal I could see the ......
Read more >I am trying to load data in a table with variant column and I am ...
davies (Snowflake) Another thing that I can not use JSON format cause I have to load data in more than one column and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@brianc , @charmander
Guys, I’m afraid this issue was closed prematurely. There is indeed a bug in the driver related specifically to Unicode symbol
\u0000
, which results in throwing errorinvalid message format
.This one works fine:
And these ones throw that error:
This needs to be re-opened, and escalated into a bug.
The error message difference is due to the lack of escaping the backslash in the JS code so the
\u0000
is evaluated in the client, not by the server. This makes the query string itself sent to the backend contain an invalid 0-byte and thus gets rejected differently.Here’s the two situations:
You can see it in the lengths of the strings too:
This does indicate a bug but not directly related to these error messages. The driver shouldn’t be sending strings with zero bytes to the backend as that’s invalid and a potential security issue. I’m going to open a separate issue for rejecting those queries in the client as they violate the FEBE protocol.