Debian Codegraph @

unittest/gunit/xplugin/xpl/mock/sql_session.h

raw symbols SCIP
1 /*
2 * Copyright (c) 2020, 2026, Oracle and/or its affiliates.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License, version 2.0,
6 * as published by the Free Software Foundation.
7 *
8 * This program is designed to work with certain software (including
9 * but not limited to OpenSSL) that is licensed under separate terms,
10 * as designated in a particular file or component or in included license
11 * documentation. The authors of MySQL hereby grant you an additional
12 * permission to link the program and your derivative works with the
13 * separately licensed software that they have either included with
14 * the program or referenced in the documentation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License, version 2.0, for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25
26 #ifndef UNITTEST_GUNIT_XPLUGIN_XPL_MOCK_SQL_SESSION_H_
27 #define UNITTEST_GUNIT_XPLUGIN_XPL_MOCK_SQL_SESSION_H_
28
29 #include <gmock/gmock.h>
30 #include <memory>
31 #include <string>
32 #include <vector>
33
34 #include "plugin/x/src/interface/sql_session.h"
35
36 namespace xpl {
37 namespace test {
38 namespace mock {
39
40 class Sql_session : public iface::Sql_session {
41 public:
42 Sql_session();
43 virtual ~Sql_session() override;
44
45 MOCK_METHOD(ngs::Error_code, set_connection_type, (const Connection_type),
46 (override));
47 MOCK_METHOD(ngs::Error_code, execute_kill_sql_session, (uint64_t),
48 (override));
49 MOCK_METHOD(bool, is_killed, (), (const, override));
50 MOCK_METHOD(bool, password_expired, (), (const, override));
51 MOCK_METHOD(std::string, get_authenticated_user_name, (), (const, override));
52 MOCK_METHOD(std::string, get_authenticated_user_host, (), (const, override));
53 MOCK_METHOD(bool, has_authenticated_user_a_super_priv, (), (const, override));
54 MOCK_METHOD(uint64_t, mysql_session_id, (), (const, override));
55 MOCK_METHOD(ngs::Error_code, authenticate,
56 (const char *, const char *, const char *, const char *,
57 const std::string &, const iface::Authentication &, bool),
58 (override));
59 MOCK_METHOD(ngs::Error_code, execute,
60 (const char *, std::size_t, iface::Resultset *), (override));
61 MOCK_METHOD(ngs::Error_code, execute_sql,
62 (const char *, std::size_t, iface::Resultset *), (override));
63 MOCK_METHOD3(fetch_cursor,
64 ngs::Error_code(const std::uint32_t, const std::uint32_t,
65 iface::Resultset *));
66 MOCK_METHOD(ngs::Error_code, prepare_prep_stmt,
67 (const char *, std::size_t, iface::Resultset *), (override));
68 MOCK_METHOD(ngs::Error_code, deallocate_prep_stmt,
69 (const uint32_t, iface::Resultset *), (override));
70 MOCK_METHOD(ngs::Error_code, execute_prep_stmt,
71 (const uint32_t, const bool, const PS_PARAM *, std::size_t,
72 iface::Resultset *),
73 (override));
74 MOCK_METHOD(ngs::Error_code, attach, (), (override));
75 MOCK_METHOD(ngs::Error_code, detach, (), (override));
76 MOCK_METHOD(ngs::Error_code, reset, (), (override));
77 MOCK_METHOD(bool, is_sql_mode_set, (const std::string &), (override));
78 };
79
80 } // namespace mock
81 } // namespace test
82 } // namespace xpl
83
84 #endif // UNITTEST_GUNIT_XPLUGIN_XPL_MOCK_SQL_SESSION_H_