[MDEV-5025] Merge TO_BASE64() and FROM_BASE64() from MySQL-5.6 Created: 2013-09-17 Updated: 2023-12-31 Resolved: 2013-11-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | 10.0.6 |
| Type: | Task | Priority: | Minor |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
MySQL-5.6 implemented SQL functions TO_BASE64() and FROM_BASE64(). |
| Comments |
| Comment by Alexander Barkov [ 2013-11-14 ] |
|
Merged from MySQL-5.6. to MariaDB-10.0.5 |
| Comment by Tom Miller [ 2023-12-30 ] |
|
TO_BASE64 doesn't work on binaries. With web and HTML being king and embedded images usually being in BASE64, it would be nice if this works. It comes close but does a lot of extra "\" for some reason. Supposedly it works fine in MYSQL. I am not sure if this should be reported as a bug or an enhancement or maybe reconsider doing another merge from MYSQL to get the additional functionality of converting BLOB type along with strings. |
| Comment by roberto spadim [ 2023-12-31 ] |
|
I’m using this for many years with blob, maybe you are using a wrong bytes encoding at client (ut8 or something like it is converting to string) |
| Comment by Tom Miller [ 2023-12-31 ] |
|
CREATE OR REPLACE DATABASE `my-database` CHARACTER SET = 'utf8mb3' COLLATE = 'utf8mb3_general_ci'; There are no instructions on how to properly do this. The help page only talks about converting a string to BASE64, not a BLOB. This converts it every time in the Node.js / Express.js server we use: I copy the string to the webpage and the image shows up every time without error. |