| 1 |
## Test to verifies compression level functionality from the server side |
| 2 |
# |
| 3 |
|
| 4 |
--write_file $MYSQL_TMP_DIR/compression_level_server.xpl |
| 5 |
-->import assert_status_variable.macro |
| 6 |
-->quiet |
| 7 |
-->title =Verify %OPTION_COMPRESSION_ALGORITHM% at level %OPTION_COMPRESSION_LEVEL% |
| 8 |
|
| 9 |
-->callmacro Assert_status_variable Mysqlx_compression_algorithm %OPTION_COMPRESSION_ALGORITHM% |
| 10 |
-->callmacro Assert_status_variable Mysqlx_compression_level %OPTION_COMPRESSION_LEVEL% |
| 11 |
|
| 12 |
-->noquery_result |
| 13 |
SELECT * FROM xtest.data; |
| 14 |
-->query_result |
| 15 |
|
| 16 |
-->callmacro Assert_status_variable Mysqlx_bytes_received_compressed_payload 0 |
| 17 |
|
| 18 |
-->stmtsql SHOW STATUS LIKE 'Mysqlx_bytes_sent_uncompressed_frame' |
| 19 |
-->recvtovar %UNCOMPRESSED_BYTES% Value |
| 20 |
-->stmtsql SHOW STATUS LIKE 'Mysqlx_bytes_sent_compressed_payload' |
| 21 |
-->recvtovar %COMPRESSED_BYTES% Value |
| 22 |
-->echo Verify [Status variable "Mysqlx_bytes_sent_compressed_payload" needs to be lower than "Mysqlx_bytes_sent_uncompressed_frame"] |
| 23 |
-->assert_gt %UNCOMPRESSED_BYTES% %COMPRESSED_BYTES% |
| 24 |
|
| 25 |
EOF |
| 26 |
|
| 27 |
SET GLOBAL mysqlx_compression_algorithms='DEFLATE_STREAM,LZ4_MESSAGE,ZSTD_STREAM'; |
| 28 |
|
| 29 |
CREATE SCHEMA xtest; |
| 30 |
CREATE TABLE xtest.data(val VARCHAR(256)); |
| 31 |
|
| 32 |
# The data for reciving |
| 33 |
--disable_query_log |
| 34 |
let $row=512; |
| 35 |
while ($row) |
| 36 |
{ |
| 37 |
eval INSERT INTO xtest.data VALUES("Example data for testing compression level"); |
| 38 |
dec $row; |
| 39 |
} |
| 40 |
--enable_query_log |
| 41 |
|