content_image/774235.jpg
<img src='content_image/774235.jpg'>

Statements that use AES_ENCRYPT()  or AES_DECRYPT()  are unsafe for statement-based replication. 

If AES_ENCRYPT()  is invoked from within the mysql  client, binary strings display using hexadecimal notation, depending on the value of the --binary-as-hex . For more information about that option, see Section 4.5.1, “mysql — The MySQL Command-Line Client” . 

• COMPRESS( string_to_compress ) 

Compresses a string and returns the result as a binary string. This function requires MySQL to have been compiled with a compression library such as zlib . Otherwise, the return value is always NULL . The compressed string can be uncompressed with UNCOMPRESS() . 

mysql> SELECT LENGTH(COMPRESS(REPEAT(’a’,1000))); -> 21 mysql> SELECT LENGTH(COMPRESS(’’)); -> 0 mysql> SELECT LENGTH(COMPRESS(’a’)); -> 13 mysql> SELECT LENGTH(COMPRESS(REPEAT(’a’,16))); -> 15 

The compressed string contents are stored the following way: 

•Empty strings are stored as empty strings. 

•Nonempty strings are stored as a 4-byte length of the uncompressed string (low byte first), followed by the compressed string. If the string ends with space, an extra .  character is added to avoid problems with endspace trimming should the result be stored in a CHAR  or VARCHAR  column. (However, use of nonbinary string data types such as CHAR  or VARCHAR  to store compressed strings is not recommended anyway because character set conversion may occur. Use a VARBINARY  or BLOB binary string column instead.) 

If COMPRESS()  is invoked from within the mysql  client, binary strings display using hexadecimal notation, depending on the value of the --binary-as-hex . For more information about that option, see Section 4.5.1, “mysql — The MySQL Command-Line Client” . 

• MD5( str ) 

Calculates an MD5 128-bit checksum for the string. The value is returned as a string of 32 hexadecimal digits, or NULL  if the argument was NULL . The return value can, for example, be used as a hash key. See the notes at the beginning of this section about storing hash values efficiently. 

The return value is a string in the connection character set. 

If FIPS mode is enabled, MD5()  returns NULL . See Section 6.8, “FIPS Support” . 

mysql> SELECT MD5(’testing’); -> ’ae2b1fca515949e5d54fb22b8ed95575’ 

This is the “RSA Data Security, Inc. MD5 Message-Digest Algorithm.” 

See the note regarding the MD5 algorithm at the beginning this section. 

