polardbxengine/mysql-test/suite/x/t/input_queue.test

174 lines
3.9 KiB
Plaintext

call mtr.add_suppression("Message of size .* received, exceeding the limit of");
--echo Setup
--source include/xplugin_preamble.inc
--source include/xplugin_create_user.inc
USE `test`;
SET GLOBAL Mysqlx_max_allowed_packet=1024;
CREATE TABLE IF NOT EXISTS `first_table`(`column_name` INTEGER DEFAULT 0 NOT NULL);
--write_file $MYSQL_TMP_DIR/mysqlx-input-queue.tmp
-->sql
USE test;
-->endsql
-->macro Buffer_data %SESSION% %PACKET_COMMENT_SIZE%
-->setsession
-->sql
LOCK TABLES `first_table` WRITE;
-->endsql
-->newsession %SESSION% x_root test
Mysqlx.Sql.StmtExecute {
stmt:"LOCK TABLES `first_table` READ;"
namespace: "sql"
}
-->vargen %COMMENT% c %PACKET_COMMENT_SIZE%
-->varsub %COMMENT%
-->echo Test sends 4 messages
-->echo LOCK TABLE stops processing of following commands
-->quiet
Mysqlx.Sql.StmtExecute {
stmt:"SELECT 1 as `First query` /* %COMMENT% */;"
namespace: "sql"
}
Mysqlx.Sql.StmtExecute {
stmt:"SELECT 2 as `Second query`/* %COMMENT% */;"
namespace: "sql"
}
Mysqlx.Sql.StmtExecute {
stmt:"SELECT 3 as `Third query`/* %COMMENT% */;"
namespace: "sql"
}
Mysqlx.Sql.StmtExecute {
stmt:"SELECT 4 as `Fourth query`/* %COMMENT% */;"
namespace: "sql"
}
-->noquiet
-->setsession
-->sql
UNLOCK TABLES;
-->endsql
-->setsession %SESSION%
-->recvresult
-->recvresult
-->recvresult
-->recvresult
-->recvresult
-->echo Bug 21811192 (fixed)
-->echo Lets try if plugin is processing new data
Mysqlx.Sql.StmtExecute {
stmt:"ping"
namespace: "xplugin"
}
-->recvresult
-->closesession %SESSION%
-->endmacro
-->macro Send_two_messages_as_one_and_queue_in_input %SESSION% %PACKET_COMMENT_SIZE%
-->newsession %SESSION% x_root test
-->vargen %COMMENT% c %PACKET_COMMENT_SIZE%
-->varsub %COMMENT%
-->quiet
-->binparse %FIRST% Mysqlx.Sql.StmtExecute {
stmt:"SELECT 1 as `First query`/*%PACKET_COMMENT_SIZE% %COMMENT% */;"
namespace: "sql"
}
-->binparse %SECOND% Mysqlx.Sql.StmtExecute {
stmt:"SELECT 2 as `Second query`;"
namespace: "sql"
}
-->binsend %FIRST%%SECOND%
-->noquiet
-->echo wait for first
-->recvresult
-->echo wait for second
-->recvresult
-->echo Bug 21811192 (fixed)
-->echo Lets try if plugin is processing new data
Mysqlx.Sql.StmtExecute {
stmt:"ping"
namespace: "xplugin"
}
-->recvresult
-->closesession %SESSION%
-->endmacro
-->macro Buffer_config %I1% %I2% %I3%
-->setsession
-->sql
#Buffer uses one additional page
SET GLOBAL Mysqlx_max_allowed_packet=%I2%;
-->endsql
-->endmacro
-->echo Limits are less then page size
-->callmacro Buffer_config 1024 1024 1024
-->callmacro Buffer_data test1 250
-->echo Multiple messages fill the buffer (last one uses extra page)
-->callmacro Buffer_config 4094 4094 4094
-->callmacro Buffer_data test2 1024
-->callmacro Buffer_data test3 2048
-->callmacro Buffer_data test4 3048
-->echo Use 2 page for single message, while receiving second packet wait for first to be processed
-->echo Extra page is used in case of not full loaded first page
-->callmacro Buffer_config 4094 8188 4094
-->callmacro Buffer_data test5 8058
-->callmacro Buffer_config 1024 2024 100
-->callmacro Send_two_messages_as_one_and_queue_in_input test6 1024
-->echo Bug 21839782 (fixed) - no data in buffer for incoming message (infinite loop)
# Current connection shouldn't be impacted by packet change
-->newsession invalid_1 x_root
-->sql
SET GLOBAL mysqlx_max_allowed_packet=1048597;
-->endsql
-->quiet
-->vargen %A% c 1048576
-->quiet
-->echo While sending client could receive CR_BROKEN_PIPE network which could occur
-->echo because xplugin stopped read ops
-->expecterror 0,2007
Mysqlx.Sql.StmtExecute {
stmt: "SELECT 1; /* %A% */"
}
-->recvresult
EOF
--echo Test case
--exec $MYSQLXTEST -u x_root --password='' --file=$MYSQL_TMP_DIR/mysqlx-input-queue.tmp 2>&1
## Cleanup
SET GLOBAL Mysqlx_max_allowed_packet=DEFAULT;
DROP TABLE `first_table`;
--remove_file $MYSQL_TMP_DIR/mysqlx-input-queue.tmp
--source include/xplugin_drop_user.inc