# Test a values of compression capabilities --source include/xplugin_preamble.inc --source include/xplugin_create_user.inc --write_file $MYSQL_TMP_DIR/capabilities_compression.xpl -->import connection.macro -->quiet -->callmacro Verify_its_xprotocol_connection -->macro Set_commpresion_capabilities_1 %KEY1% %VALUE1% %RESULT% -->echo ########################################################## -->echo ## Scenario: %KEY1%=%VALUE1% Mysqlx.Connection.CapabilitiesSet { capabilities { capabilities { name: "compression" value { type: OBJECT obj { fld { key: "%KEY1%" value { type: SCALAR scalar { type: V_STRING v_string { value: "%VALUE1%" } } } } } } } } } -->recvtype %RESULT% -->endmacro -->callmacro Set_commpresion_capabilities_1 algorithm deflate_stream Mysqlx.Ok -->callmacro Set_commpresion_capabilities_1 algorithm lz4_message Mysqlx.Ok -->callmacro Set_commpresion_capabilities_1 algorithm zstd_stream Mysqlx.Ok -->callmacro Set_commpresion_capabilities_1 algorithm wrong Mysqlx.Error -->callmacro Set_commpresion_capabilities_1 wrong deflate_stream Mysqlx.Error EOF --write_file $MYSQL_TMP_DIR/configured_only_on_server.xpl -->import connection.macro -->quiet -->callmacro Verify_its_xprotocol_connection Mysqlx.Connection.CapabilitiesSet { capabilities { capabilities { name: "compression" value { type: OBJECT obj { fld { key: "algorithm" value { type: SCALAR scalar { type: V_STRING v_string { value: "deflate_stream" } } } } } } } } } -->recvtype Mysqlx.Ok -->login x_root -->expecterror 2512 SELECT 1; EOF --write_file $MYSQL_TMP_DIR/invalid_capability.xpl -->import connection.macro -->quiet -->callmacro Verify_its_xprotocol_connection -->echo -->echo # -->echo # I.3.a Mysqlx.Connection.CapabilitiesSet { capabilities { capabilities { name: "compression" value { type: OBJECT obj { } } } } } -->recvtype Mysqlx.Error -->echo -->echo # -->echo # I.3.b Mysqlx.Connection.CapabilitiesSet { capabilities { capabilities { name: "compression" value { type: ARRAY array { } } } } } -->recvtype Mysqlx.Error -->echo -->echo # -->echo # I.3.c Mysqlx.Connection.CapabilitiesSet { capabilities { capabilities { name: "compression" value { type: OBJECT obj { fld { key: "algorithm" value { type: ARRAY array { } } } } } } } } -->recvtype Mysqlx.Error -->echo -->echo # -->echo # I.3.d Mysqlx.Connection.CapabilitiesSet { capabilities { capabilities { name: "compression" value { type: OBJECT obj { fld { key: "algorithm" value { type: SCALAR scalar { type: V_STRING v_string { value: "deflate_stream" } } } } fld { key: "server_max_combine_messages" value { type: ARRAY array { } } } } } } } } -->recvtype Mysqlx.Error -->echo -->echo # -->echo # I.3.e Mysqlx.Connection.CapabilitiesSet { capabilities { capabilities { name: "compression" value { type: OBJECT obj { fld { key: "algorithm" value { type: SCALAR scalar { type: V_STRING v_string { value: "deflate_stream" } } } } fld { key: "server_combine_mixed_messages" value { type: ARRAY array { } } } } } } } } -->recvtype Mysqlx.Error -->echo -->echo # -->echo # I.3.f Mysqlx.Connection.CapabilitiesSet { capabilities { capabilities { name: "compression" value { type: OBJECT obj { fld { key: "algorithm" value { type: SCALAR scalar { type: V_STRING v_string { value: "deflate_stream" } } } } fld { key: "level" value { type: SCALAR scalar { type: V_STRING v_string { value: "1" } } } } } } } } } -->recvtype Mysqlx.Error EOF --echo --echo --echo ## I. Verify CapabilitySet --echo # --echo # 1. Check that server allows only valid algorithm names, other --echo # are rejected --echo # 2. Check that when compression is enabled on server side, --echo # and client didn't enabled compression then an error --echo # is returned by client when it received compressed message --echo # 3. Check if server verifies the "compression" object in CapabilitySet --echo # a. Send compression capability without any configuration --echo # b. Send compression capability with invalid type (not object) --echo # c. Send algorithm capability with invalid type (not scalar) --echo # d. Send server_max_combine_messages capability with invalid type (not scalar) --echo # e. Send server_combine_mixed_messages capability with invalid type (not scalar) --echo # f. Send level capability with invalid type (not integer) --echo --echo # --echo # I.1 exec $MYSQLXTEST -u x_root --password='' -h127.0.0.1 --no-auth --file=$MYSQL_TMP_DIR/capabilities_compression.xpl 2>&1; --echo --echo # --echo # I.2 # Expect CR_X_COMPRESSION_NOT_CONFIGURED # mysqlxtest doesn't know the name of CR_X_ errors, thus # we use error code as number 2512 exec $MYSQLXTEST -u x_root --password='' -h127.0.0.1 --no-auth --expect-error=2512 --file=$MYSQL_TMP_DIR/configured_only_on_server.xpl 2>&1; --echo --echo # --echo # I.3 exec $MYSQLXTEST -u x_root --password='' -h127.0.0.1 --no-auth --file=$MYSQL_TMP_DIR/invalid_capability.xpl 2>&1; ## Cleanup --source ../include/xplugin_cleanup.inc