[MDEV-23079] A fully UTF-8 supported database can't store encrypted string Created: 2020-07-03 Updated: 2020-08-05 Resolved: 2020-08-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Character Sets |
| Affects Version/s: | 10.3.22 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Athens Yan | Assignee: | Alexander Barkov |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | Compatibility | ||
| Environment: |
Ubuntu 20.04 |
||
| Description |
|
I try to use the following Perl script to insert an encrypted text into my table, however error message "Incorrect string value: '\xF5\xE5\x83\xFF\x8A\xE8...' for column `mydb`.`test`.`encrypted_text` at row 1" is returned. It seems that my fully UTF-8 supported database and table cannot store encrypted string characters. However, it is worked flawlessly on older version of MariaDB, such as MariaDB version 10.3.17 on CentOS 8.
Here is my table definition:
|
| Comments |
| Comment by Alexander Barkov [ 2020-08-05 ] |
|
Your script inserts binary data into an utf8mb4 longtext column, which cannot insert any arbitrary sequence of bytes: it has constraints on wellformedness of the inserted data. \xF5\xE5\x83\xFF\x8A\xE8... is not a valid utf8mb4 string. The server cannot insert it into the column of this type. Please use longblob instead. It's hard to say why it worked in earlier versions. Possibly, with the older version the client started with the latin1 character set by default. |