Description:
After setting NO_ERROR expectation block the xplugin does not allow closing it if an error was detected inside the block in one of previous statements.
Instead of closing the expect block it throws the error.
It goes like this:
Mysqlx.Expect::Open([+no_error])
Mysqlx.PreparedStmt::Execute(stmt_id=1) // Valid STMT - OK
Mysqlx.PreparedStmt::Execute(stmt_id=2) // Invalid STMT - Syntax Error
Mysqlx.PreparedStmt::Execute(stmt_id=3) // Valid STMT - Expecation failed Error
Mysqlx.Expect::Close() // Valid command - Expecation failed Error
How to repeat:
The X protocol data flow is as this:
>>>> Sending message >>>>
of type 24: Mysqlx::Expect::Open
op: EXPECT_CTX_COPY_PREV
cond {
condition_key: 1
op: EXPECT_OP_SET
}
>>>>
<<<< Received message <<<<
of type 0: Mysqlx::Ok
<<<<
>>>> Sending message >>>>
of type 12: Mysqlx::Sql::StmtExecute
stmt: "SELECT 1"
namespace: "sql"
>>>>
<<<< Received message <<<<
of type 12: Mysqlx::Resultset::ColumnMetaData
type: SINT
name: "1"
original_name: ""
table: ""
original_table: ""
schema: ""
catalog: "def"
collation: 0
fractional_digits: 0
length: 1
flags: 16
<<<<
<<<< Received message <<<<
of type 13: Mysqlx::Resultset::Row
field: "\002"
<<<<
<<<< Received message <<<<
of type 14: Mysqlx::Resultset::FetchDone
<<<<
<<<< Received message <<<<
of type 11: Mysqlx::Notice::Frame
type: 3
scope: LOCAL
payload: "\010\004\022\004\010\002\030\000"
<<<<
<<<< Received message <<<<
of type 17: Mysqlx::Sql::StmtExecuteOk
<<<<
>>>> Sending message >>>>
of type 12: Mysqlx::Sql::StmtExecute
stmt: "ERROR SQL"
namespace: "sql"
>>>>
<<<< Received message <<<<
of type 1: Mysqlx::Error
severity: ERROR
code: 1064
msg: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'ERROR SQL\' at line 1"
sql_state: "42000"
<<<<
>>>> Sending message >>>>
of type 12: Mysqlx::Sql::StmtExecute
stmt: "SELECT 2"
namespace: "sql"
>>>>
<<<< Received message <<<<
of type 1: Mysqlx::Error
severity: ERROR
code: 5159
msg: "Expectation failed: no_error"
sql_state: "HY000"
<<<<
>>>> Sending message >>>>
of type 25: Mysqlx::Expect::Close
>>>>
<<<< Received message <<<<
of type 1: Mysqlx::Error
severity: ERROR
code: 5159
msg: "Expectation failed: no_error"
sql_state: "HY000"
<<<<
Description: After setting NO_ERROR expectation block the xplugin does not allow closing it if an error was detected inside the block in one of previous statements. Instead of closing the expect block it throws the error. It goes like this: Mysqlx.Expect::Open([+no_error]) Mysqlx.PreparedStmt::Execute(stmt_id=1) // Valid STMT - OK Mysqlx.PreparedStmt::Execute(stmt_id=2) // Invalid STMT - Syntax Error Mysqlx.PreparedStmt::Execute(stmt_id=3) // Valid STMT - Expecation failed Error Mysqlx.Expect::Close() // Valid command - Expecation failed Error How to repeat: The X protocol data flow is as this: >>>> Sending message >>>> of type 24: Mysqlx::Expect::Open op: EXPECT_CTX_COPY_PREV cond { condition_key: 1 op: EXPECT_OP_SET } >>>> <<<< Received message <<<< of type 0: Mysqlx::Ok <<<< >>>> Sending message >>>> of type 12: Mysqlx::Sql::StmtExecute stmt: "SELECT 1" namespace: "sql" >>>> <<<< Received message <<<< of type 12: Mysqlx::Resultset::ColumnMetaData type: SINT name: "1" original_name: "" table: "" original_table: "" schema: "" catalog: "def" collation: 0 fractional_digits: 0 length: 1 flags: 16 <<<< <<<< Received message <<<< of type 13: Mysqlx::Resultset::Row field: "\002" <<<< <<<< Received message <<<< of type 14: Mysqlx::Resultset::FetchDone <<<< <<<< Received message <<<< of type 11: Mysqlx::Notice::Frame type: 3 scope: LOCAL payload: "\010\004\022\004\010\002\030\000" <<<< <<<< Received message <<<< of type 17: Mysqlx::Sql::StmtExecuteOk <<<< >>>> Sending message >>>> of type 12: Mysqlx::Sql::StmtExecute stmt: "ERROR SQL" namespace: "sql" >>>> <<<< Received message <<<< of type 1: Mysqlx::Error severity: ERROR code: 1064 msg: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'ERROR SQL\' at line 1" sql_state: "42000" <<<< >>>> Sending message >>>> of type 12: Mysqlx::Sql::StmtExecute stmt: "SELECT 2" namespace: "sql" >>>> <<<< Received message <<<< of type 1: Mysqlx::Error severity: ERROR code: 5159 msg: "Expectation failed: no_error" sql_state: "HY000" <<<< >>>> Sending message >>>> of type 25: Mysqlx::Expect::Close >>>> <<<< Received message <<<< of type 1: Mysqlx::Error severity: ERROR code: 5159 msg: "Expectation failed: no_error" sql_state: "HY000" <<<<