Skip to content

Commit 528814b

Browse files
rsomla1silvakid
authored andcommitted
Minor fixes in comments
1 parent 8953f17 commit 528814b

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

cdk/mysqlx/stmt.h

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ class Query_stmt
6161
return Stmt_op::do_cont();
6262

6363
/*
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.
6666
*/
6767

6868
if (OK == m_state)
69-
m_state = MDATA; // next_result();
69+
m_state = MDATA;
7070

7171
assert(OK != m_state);
7272

@@ -85,11 +85,17 @@ class Query_stmt
8585
beforehand).
8686
8787
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
8989
reply is expected to be a reply to prepare + execute pipeline with first OK
9090
packet as a reply to the prepare command followed by a reply to the
9191
statement that was prepared (which is handled as usual by the base
9292
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.
9399
*/
94100

95101
template <class Base>
@@ -98,7 +104,13 @@ class Prepared
98104
{
99105
protected:
100106

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+
101112
uint32_t m_stmt_id=0;
113+
102114
const Limit *m_limit = nullptr;
103115
const protocol::mysqlx::api::Any_list *m_param_list = nullptr;
104116
const protocol::mysqlx::api::Args_map *m_param_map = nullptr;
@@ -493,7 +505,7 @@ typedef Expr_conv_base<
493505
which involve selecting a subset of rows/documents in the
494506
table/collection.
495507
496-
A CRUD operation class which derives from this Select_op_base
508+
A CRUD operation class which derives from this Cmd_Select
497509
can be used as selection criteria specification as required
498510
by protocol object methods.
499511

0 commit comments

Comments
 (0)