You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/09/13 10:05:40 UTC

[GitHub] [incubator-doris] azurenake opened a new issue #6635: [Bug] UDF aes_decrypt doesn't handle null input correctly.

azurenake opened a new issue #6635:
URL: https://github.com/apache/incubator-doris/issues/6635


   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Version
   
   master
   
   ### What's Wrong?
   
   aes_decrypt function should return null for null input, but returns previous result.
   
   
   MySQL [mydb]> CREATE TABLE table3
       -> (
       ->     siteid INT DEFAULT '10',
       ->     citycode SMALLINT,
       ->     username VARCHAR(32) DEFAULT '',
       -> encrypt_key varchar(255) REPLACE NULL,
       ->     pv BIGINT SUM DEFAULT '0'
       -> )
       -> AGGREGATE KEY(siteid, citycode, username)
       -> DISTRIBUTED BY HASH(siteid) BUCKETS 10
       -> PROPERTIES("replication_num" = "1");
   Query OK, 0 rows affected (0.18 sec)
   
   MySQL [mydb]> insert into table3 values (1,1,'aaa',AES_ENCRYPT('aaapw', 'key'),1);
   Query OK, 1 row affected (0.36 sec)
   {'label':'insert_82138fc5d8ca4cce-acaf4a706d0ad72f', 'status':'VISIBLE', 'txnId':'3004'}
   
   MySQL [mydb]> insert into table3 values (2,1,'aaa',null,1);
   Query OK, 1 row affected (0.16 sec)
   {'label':'insert_256160d07fc440a-8d8bc70988f0e67e', 'status':'VISIBLE', 'txnId':'3005'}
   
   
   MySQL [mydb]> select encrypt_key,aes_decrypt(encrypt_key,'key') from table3 order by siteid;
   +------------------+-----------------------------------+
   | encrypt_key      | aes_decrypt(`encrypt_key`, 'key') |
   +------------------+-----------------------------------+
   | ?j▒▒▒K▒^▒▒▒m▒ | aaapw                             |
   | NULL             | aaapw                             |
   +------------------+-----------------------------------+
   2 rows in set (0.02 sec)
   
   
   ### What You Expected?
   
   MySQL [mydb]> select encrypt_key,aes_decrypt(encrypt_key,'key') from table3 order by siteid;
   +------------------+-----------------------------------+
   | encrypt_key      | aes_decrypt(`encrypt_key`, 'key') |
   +------------------+-----------------------------------+
   | ?j▒▒▒K▒^▒▒▒m▒ | aaapw                             |
   | NULL             | NULL                         |
   +------------------+-----------------------------------+
   2 rows in set (0.02 sec)
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] yangzhg closed issue #6635: [Bug] UDF aes_decrypt doesn't handle null input correctly.

Posted by GitBox <gi...@apache.org>.
yangzhg closed issue #6635:
URL: https://github.com/apache/incubator-doris/issues/6635


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org