@@ -61,12 +61,12 @@ class Query_stmt
61
61
return Stmt_op::do_cont ();
62
62
63
63
/*
64
- Note: call to next_result() changes statement state so that it
65
- expects a full reply .
64
+ Note: Changing state to MDATA will tell Stmt_op to expect a full
65
+ reply instead of simple OK .
66
66
*/
67
67
68
68
if (OK == m_state)
69
- m_state = MDATA; // next_result();
69
+ m_state = MDATA;
70
70
71
71
assert (OK != m_state);
72
72
@@ -85,11 +85,17 @@ class Query_stmt
85
85
beforehand).
86
86
87
87
Otherwise, if derived class is used, it is assumed that it overrides
88
- send_cmd() method to to send and prepare a statement on the server. Server
88
+ send_cmd() method to send and prepare a statement on the server. Server
89
89
reply is expected to be a reply to prepare + execute pipeline with first OK
90
90
packet as a reply to the prepare command followed by a reply to the
91
91
statement that was prepared (which is handled as usual by the base
92
92
class).
93
+
94
+ Note: The distinction between the two behaviors is based on the value of
95
+ m_stmt_id member. Normally it should be non-zero but default implementation
96
+ of send_cmd() resets it to 0 and then the "execute already prepared statement"
97
+ path is executed. An overridden snd_cmd() that sends prepare + execute
98
+ pipeline should not reset m_stmt_id.
93
99
*/
94
100
95
101
template <class Base >
@@ -98,7 +104,13 @@ class Prepared
98
104
{
99
105
protected:
100
106
107
+ /*
108
+ Note: m_stmt_id is reset to 0 by reply processing logic. Therefore one
109
+ should not expect that it always contains the original stmt id.
110
+ */
111
+
101
112
uint32_t m_stmt_id=0 ;
113
+
102
114
const Limit *m_limit = nullptr ;
103
115
const protocol::mysqlx::api::Any_list *m_param_list = nullptr ;
104
116
const protocol::mysqlx::api::Args_map *m_param_map = nullptr ;
@@ -493,7 +505,7 @@ typedef Expr_conv_base<
493
505
which involve selecting a subset of rows/documents in the
494
506
table/collection.
495
507
496
- A CRUD operation class which derives from this Select_op_base
508
+ A CRUD operation class which derives from this Cmd_Select
497
509
can be used as selection criteria specification as required
498
510
by protocol object methods.
499
511
0 commit comments