147 lines
2.6 KiB
Plaintext
147 lines
2.6 KiB
Plaintext
## Tests for mysqlx status variables.
|
|
|
|
## Preamble
|
|
--source include/xplugin_preamble.inc
|
|
--source include/xplugin_create_user.inc
|
|
|
|
# Tests
|
|
|
|
--write_file $MYSQL_TMP_DIR/xpl_status_vars.tmp
|
|
-->sql
|
|
DROP SCHEMA IF EXISTS xtest;
|
|
CREATE SCHEMA xtest;
|
|
CREATE TABLE xtest.xtable (xcolumn VARCHAR(20));
|
|
SHOW STATUS LIKE 'Mysqlx_sessions';
|
|
SHOW STATUS LIKE 'Mysqlx_crud_insert';
|
|
-->endsql
|
|
Mysqlx.Crud.Insert {
|
|
collection {
|
|
name: "xtable"
|
|
schema: "xtest"
|
|
}
|
|
data_model: TABLE
|
|
projection {
|
|
name: "xcolumn"
|
|
}
|
|
row {
|
|
field {
|
|
type: LITERAL
|
|
literal {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "xstring"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-->recvresult
|
|
-->sql
|
|
SHOW STATUS LIKE 'Mysqlx_crud_insert';
|
|
SHOW STATUS LIKE 'Mysqlx_crud_find';
|
|
-->endsql
|
|
Mysqlx.Crud.Find {
|
|
collection {
|
|
name: "xtable"
|
|
schema: "xtest"
|
|
}
|
|
data_model: TABLE
|
|
}
|
|
-->recvresult
|
|
-->sql
|
|
SHOW STATUS LIKE 'Mysqlx_crud_find';
|
|
SHOW STATUS LIKE 'Mysqlx_crud_update';
|
|
-->endsql
|
|
Mysqlx.Crud.Update {
|
|
collection {
|
|
name: "xtable"
|
|
schema: "xtest"
|
|
}
|
|
data_model: TABLE
|
|
criteria {
|
|
type: OPERATOR
|
|
operator {
|
|
name: "=="
|
|
param {
|
|
type: IDENT
|
|
identifier {
|
|
name: "xcolumn"
|
|
}
|
|
}
|
|
param {
|
|
type: LITERAL
|
|
literal {
|
|
type: V_OCTETS
|
|
v_octets {value:"xstring"}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
operation {
|
|
source {
|
|
name: "xcolumn"
|
|
}
|
|
operation: SET
|
|
value {
|
|
type: LITERAL
|
|
literal {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "updated_xstring"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-->recvresult
|
|
-->sql
|
|
SHOW STATUS LIKE 'Mysqlx_crud_update';
|
|
SHOW STATUS LIKE 'Mysqlx_crud_delete';
|
|
-->endsql
|
|
Mysqlx.Crud.Delete {
|
|
collection {
|
|
name: "xtable"
|
|
schema: "xtest"
|
|
}
|
|
data_model: TABLE
|
|
criteria {
|
|
type: OPERATOR
|
|
operator {
|
|
name: "=="
|
|
param {
|
|
type: IDENT
|
|
identifier {
|
|
name: "xcolumn"
|
|
}
|
|
}
|
|
param {
|
|
type: LITERAL
|
|
literal {
|
|
type: V_OCTETS
|
|
v_octets {value:"updated_xstring"}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-->recvresult
|
|
-->sql
|
|
SHOW STATUS LIKE 'Mysqlx_crud_delete';
|
|
SHOW STATUS LIKE 'Mysqlx_stmt_execute_%';
|
|
-->endsql
|
|
Mysqlx.Sql.StmtExecute {
|
|
stmt: "SELECT COUNT(*) FROM xtest.xtable"
|
|
}
|
|
-->recvresult
|
|
-->sql
|
|
SHOW STATUS LIKE 'Mysqlx_stmt_execute_%';
|
|
DROP SCHEMA IF EXISTS xtest;
|
|
-->endsql
|
|
EOF
|
|
|
|
--exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/xpl_status_vars.tmp 2>&1
|
|
|
|
## Cleanup
|
|
--remove_file $MYSQL_TMP_DIR/xpl_status_vars.tmp
|
|
--source include/xplugin_drop_user.inc
|