Skip to content

'ENCODE' is deprecated and will be removed in a future release. #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gqqnbig opened this issue Feb 21, 2019 · 1 comment
Closed

'ENCODE' is deprecated and will be removed in a future release. #7

gqqnbig opened this issue Feb 21, 2019 · 1 comment

Comments

@gqqnbig
Copy link

gqqnbig commented Feb 21, 2019

https://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html#function_decode

The DES_ENCRYPT() and DES_DECRYPT() functions are deprecated as of MySQL 5.7.6, will be removed in a future MySQL release, and should no longer be used. Consider using AES_ENCRYPT() and AES_DECRYPT() instead.

When I run SELECT BENCHMARK(1000000,ENCODE('hello',RAND())); in command line, it generates 65535 warnings. I think the warnings slows down the execution to 14 seconds. If I change to use AES_DECRYPT, the command returns in 2 seconds.

mysql> status;
--------------
mysql  Ver 14.14 Distrib 5.7.25, for Linux (x86_64) using  EditLine wrapper

Connection id:          4
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.7.25-0ubuntu0.16.04.2 (Ubuntu)
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:            /var/run/mysqld/mysqld.sock
Uptime:                 25 min 2 sec

Threads: 1  Questions: 11  Slow queries: 0  Opens: 107  Flush tables: 1  Open tables: 26  Queries per second avg: 0.007
--------------

mysql> SELECT BENCHMARK(1000000,ENCODE('hello',RAND()));
+-------------------------------------------+
| BENCHMARK(1000000,ENCODE('hello',RAND())) |
+-------------------------------------------+
|                                         0 |
+-------------------------------------------+
1 row in set, 65535 warnings (14.95 sec)

mysql> SELECT BENCHMARK(1000000,AES_ENCRYPT('hello',RAND()));
+------------------------------------------------+
| BENCHMARK(1000000,AES_ENCRYPT('hello',RAND())) |
+------------------------------------------------+
|                                              0 |
+------------------------------------------------+
1 row in set (2.78 sec)

I think you may want to use AES_ENCRYPT.

@odan
Copy link
Collaborator

odan commented Feb 22, 2019

Thank you.

@odan odan closed this as completed Feb 22, 2019
opalenet-adrien pushed a commit to opalenet-adrien/benchmark-php that referenced this issue Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy