File: mysqlx_all_msgs.cc

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (173 lines) | stat: -rw-r--r-- 9,006 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/*
 * Copyright (c) 2015, 2025, Oracle and/or its affiliates.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License, version 2.0,
 * as published by the Free Software Foundation.
 *
 * This program is designed to work with certain software (including
 * but not limited to OpenSSL) that is licensed under separate terms,
 * as designated in a particular file or component or in included license
 * documentation.  The authors of MySQL hereby grant you an additional
 * permission to link the program and your derivative works with the
 * separately licensed software that they have either included with
 * the program or referenced in the documentation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License, version 2.0, for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 */

#include "plugin/x/tests/driver/connector/mysqlx_all_msgs.h"

#include "plugin/x/client/mysqlxclient/xmessage.h"

Message_by_full_name server_msgs_by_full_name;
Message_by_full_name client_msgs_by_full_name;

Message_server_by_name server_msgs_by_name;
Message_client_by_name client_msgs_by_name;

Message_server_by_id server_msgs_by_id;
Message_client_by_id client_msgs_by_id;

static struct init_message_factory {
  template <class C>
  static xcl::XProtocol::Message *create() {
    return new C();
  }

  template <typename T, typename Message_type_id>
  void server_message(Message_type_id id, const std::string &name,
                      const std::string &full_name) {
    server_msgs_by_name[name] = std::make_pair(&create<T>, id);
    server_msgs_by_id[id] = std::make_pair(&create<T>, name);

    if (!full_name.empty()) server_msgs_by_full_name[full_name] = name;
  }

  template <typename T, typename Message_type_id>
  void client_message(Message_type_id id, const std::string &name,
                      const std::string &full_name) {
    client_msgs_by_name[name] = std::make_pair(&create<T>, id);
    client_msgs_by_id[id] = std::make_pair(&create<T>, name);

    if (!full_name.empty()) client_msgs_by_full_name[full_name] = name;
  }

  init_message_factory() {
    server_message<Mysqlx::Connection::Capabilities>(
        Mysqlx::ServerMessages::CONN_CAPABILITIES, "CONN_CAPABILITIES",
        "Mysqlx.Connection.Capabilities");
    server_message<Mysqlx::Session::AuthenticateContinue>(
        Mysqlx::ServerMessages::SESS_AUTHENTICATE_CONTINUE,
        "SESS_AUTHENTICATE_CONTINUE", "Mysqlx.Session.AuthenticateContinue");
    server_message<Mysqlx::Error>(Mysqlx::ServerMessages::ERROR, "ERROR",
                                  "Mysqlx.Error");
    server_message<Mysqlx::Notice::Frame>(Mysqlx::ServerMessages::NOTICE,
                                          "NOTICE", "Mysqlx.Notice.Frame");
    server_message<Mysqlx::Ok>(Mysqlx::ServerMessages::OK, "OK", "Mysqlx.Ok");
    server_message<Mysqlx::Resultset::ColumnMetaData>(
        Mysqlx::ServerMessages::RESULTSET_COLUMN_META_DATA,
        "RESULTSET_COLUMN_META_DATA", "Mysqlx.Resultset.ColumnMetaData");
    server_message<Mysqlx::Resultset::FetchDone>(
        Mysqlx::ServerMessages::RESULTSET_FETCH_DONE, "RESULTSET_FETCH_DONE",
        "Mysqlx.Resultset.FetchDone");
    server_message<Mysqlx::Resultset::FetchDoneMoreOutParams>(
        Mysqlx::ServerMessages::RESULTSET_FETCH_DONE_MORE_OUT_PARAMS,
        "RESULTSET_FETCH_DONE_MORE_OUT_PARAMS",
        "Mysqlx.Resultset.FetchDoneMoreOutParams");
    server_message<Mysqlx::Resultset::FetchDoneMoreResultsets>(
        Mysqlx::ServerMessages::RESULTSET_FETCH_DONE_MORE_RESULTSETS,
        "RESULTSET_FETCH_DONE_MORE_RESULTSETS",
        "Mysqlx.Resultset.FetchDoneMoreResultsets");
    server_message<Mysqlx::Resultset::FetchSuspended>(
        Mysqlx::ServerMessages::RESULTSET_FETCH_SUSPENDED,
        "RESULTSET_FETCH_SUSPENDED", "Mysqlx.Resultset.FetchSuspended");
    server_message<Mysqlx::Resultset::Row>(
        Mysqlx::ServerMessages::RESULTSET_ROW, "RESULTSET_ROW",
        "Mysqlx.Resultset.Row");
    server_message<Mysqlx::Session::AuthenticateOk>(
        Mysqlx::ServerMessages::SESS_AUTHENTICATE_OK, "SESS_AUTHENTICATE_OK",
        "Mysqlx.Session.AuthenticateOk");
    server_message<Mysqlx::Sql::StmtExecuteOk>(
        Mysqlx::ServerMessages::SQL_STMT_EXECUTE_OK, "SQL_STMT_EXECUTE_OK",
        "Mysqlx.Sql.StmtExecuteOk");
    server_message<Mysqlx::Connection::Compression>(
        Mysqlx::ServerMessages::COMPRESSION, "COMPRESSION",
        "Mysqlx.Connection.Compression");

    client_message<Mysqlx::Connection::CapabilitiesGet>(
        Mysqlx::ClientMessages::CON_CAPABILITIES_GET, "CON_CAPABILITIES_GET",
        "Mysqlx.Connection.CapabilitiesGet");
    client_message<Mysqlx::Connection::CapabilitiesSet>(
        Mysqlx::ClientMessages::CON_CAPABILITIES_SET, "CON_CAPABILITIES_SET",
        "Mysqlx.Connection.CapabilitiesSet");
    client_message<Mysqlx::Connection::Close>(Mysqlx::ClientMessages::CON_CLOSE,
                                              "CON_CLOSE",
                                              "Mysqlx.Connection.Close");
    client_message<Mysqlx::Crud::Delete>(Mysqlx::ClientMessages::CRUD_DELETE,
                                         "CRUD_DELETE", "Mysqlx.Crud.Delete");
    client_message<Mysqlx::Crud::Find>(Mysqlx::ClientMessages::CRUD_FIND,
                                       "CRUD_FIND", "Mysqlx.Crud.Find");
    client_message<Mysqlx::Crud::Insert>(Mysqlx::ClientMessages::CRUD_INSERT,
                                         "CRUD_INSERT", "Mysqlx.Crud.Insert");
    client_message<Mysqlx::Crud::Update>(Mysqlx::ClientMessages::CRUD_UPDATE,
                                         "CRUD_UPDATE", "Mysqlx.Crud.Update");
    client_message<Mysqlx::Crud::CreateView>(
        Mysqlx::ClientMessages::CRUD_CREATE_VIEW, "CRUD_CREATE_VIEW",
        "Mysqlx.Crud.CreateView");
    client_message<Mysqlx::Crud::ModifyView>(
        Mysqlx::ClientMessages::CRUD_MODIFY_VIEW, "CRUD_MODIFY_VIEW",
        "Mysqlx.Crud.ModifyView");
    client_message<Mysqlx::Crud::DropView>(
        Mysqlx::ClientMessages::CRUD_DROP_VIEW, "CRUD_DROP_VIEW",
        "Mysqlx.Crud.DropView");
    client_message<Mysqlx::Expect::Close>(Mysqlx::ClientMessages::EXPECT_CLOSE,
                                          "EXPECT_CLOSE",
                                          "Mysqlx.Expect.Close");
    client_message<Mysqlx::Expect::Open>(Mysqlx::ClientMessages::EXPECT_OPEN,
                                         "EXPECT_OPEN", "Mysqlx.Expect.Open");
    client_message<Mysqlx::Session::AuthenticateContinue>(
        Mysqlx::ClientMessages::SESS_AUTHENTICATE_CONTINUE,
        "SESS_AUTHENTICATE_CONTINUE", "Mysqlx.Session.AuthenticateContinue");
    client_message<Mysqlx::Session::AuthenticateStart>(
        Mysqlx::ClientMessages::SESS_AUTHENTICATE_START,
        "SESS_AUTHENTICATE_START", "Mysqlx.Session.AuthenticateStart");
    client_message<Mysqlx::Session::Close>(Mysqlx::ClientMessages::SESS_CLOSE,
                                           "SESS_CLOSE",
                                           "Mysqlx.Session.Close");
    client_message<Mysqlx::Session::Reset>(Mysqlx::ClientMessages::SESS_RESET,
                                           "SESS_RESET",
                                           "Mysqlx.Session.Reset");
    client_message<Mysqlx::Sql::StmtExecute>(
        Mysqlx::ClientMessages::SQL_STMT_EXECUTE, "SQL_STMT_EXECUTE",
        "Mysqlx.Sql.StmtExecute");
    client_message<Mysqlx::Prepare::Prepare>(
        Mysqlx::ClientMessages::PREPARE_PREPARE, "PREPARE_PREPARE",
        "Mysqlx.Prepare.Prepare");
    client_message<Mysqlx::Prepare::Execute>(
        Mysqlx::ClientMessages::PREPARE_EXECUTE, "PREPARE_EXECUTE",
        "Mysqlx.Prepare.Execute");
    client_message<Mysqlx::Prepare::Deallocate>(
        Mysqlx::ClientMessages::PREPARE_DEALLOCATE, "PREPARE_DEALLOCATE",
        "Mysqlx.Prepare.Deallocate");

    client_message<Mysqlx::Cursor::Open>(Mysqlx::ClientMessages::CURSOR_OPEN,
                                         "CURSOR_OPEN", "Mysqlx.Cursor.Open");
    client_message<Mysqlx::Cursor::Fetch>(Mysqlx::ClientMessages::CURSOR_FETCH,
                                          "CURSOR_FETCH",
                                          "Mysqlx.Cursor.Fetch");
    client_message<Mysqlx::Cursor::Close>(Mysqlx::ClientMessages::CURSOR_CLOSE,
                                          "CURSOR_CLOSE",
                                          "Mysqlx.Cursor.Close");
    client_message<Mysqlx::Connection::Compression>(
        Mysqlx::ClientMessages::COMPRESSION, "COMPRESSION",
        "Mysqlx.Connection.Compression");
  }
} init_message_factory;