from_base64()未解码回原始文本



from_base64((无法正确解码。请参阅下面的问题演示。

mysql> select to_base64('sometext');
+-----------------------+
| to_base64('sometext') |
+-----------------------+
| c29tZXRleHQ=          |
+-----------------------+
1 row in set (0.27 sec)
mysql> select from_base64('c29tZXRleHQ=');
+----------------------------------------------------------+
| from_base64('c29tZXRleHQ=')                              |
+----------------------------------------------------------+
| 0x736F6D6574657874                                       |
+----------------------------------------------------------+
1 row in set (0.00 sec)

这一直有效,直到我转到最新的ubuntu 19.10。服务器版本:8.0.19 MySQL社区服务器-GPL

mysql-版本
mysql版本8.0.19-0ubuntu0.19.10.3,适用于x86_64((Ubuntu((上的Linux

这是因为以下原因。

--binary-as-hex
When this option is given, mysql displays binary data using hexadecimal notation (0xvalue). This occurs whether the overall output dislay format is tabular, vertical, HTML, or XML.
As of MySQL 8.0.19, when mysql operates in interactive mode, this option is enabled by default. In addition, output from the status (or s) command includes this line when the option is enabled implicitly or explicitly:
To disable hexadecimal notation, use --skip-binary-as-hex

MySQL客户端选项

最新更新