MySQL 8.3.0
Source Code Documentation
client_query_attributes.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2020, 2023, 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 also distributed 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 included with MySQL.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23*/
24
25#ifndef CLIENT_QUERY_ATTRIBUTES_H
26#define CLIENT_QUERY_ATTRIBUTES_H
27
28#include "mysql.h"
29
31 public:
34 /* Assumes that name and value are 0 terminated. */
35 bool push_param(const char *name, const char *value);
36 /* Does not assumes that name and value are 0 terminated. */
37 bool push_param(const char *name, size_t name_length, const char *value,
38 size_t value_length);
40 int set_params_stmt(MYSQL_STMT *stmt);
41
42 void clear(MYSQL *mysql = nullptr);
43
44 private:
45 /* 32 should be enough for everybody */
46 static constexpr int max_count = 32;
47 const char *names[max_count];
49 unsigned count{0};
50};
51
53
54#endif
Definition: client_query_attributes.h:30
unsigned count
Definition: client_query_attributes.h:49
MYSQL_BIND values[max_count]
Definition: client_query_attributes.h:48
static constexpr int max_count
Definition: client_query_attributes.h:46
int set_params_stmt(MYSQL_STMT *stmt)
Definition: client_query_attributes.cc:76
client_query_attributes()=default
bool push_param(const char *name, const char *value)
Definition: client_query_attributes.cc:33
void clear(MYSQL *mysql=nullptr)
Definition: client_query_attributes.cc:83
int set_params(MYSQL *mysql)
Definition: client_query_attributes.cc:69
const char * names[max_count]
Definition: client_query_attributes.h:47
~client_query_attributes()
Definition: client_query_attributes.h:33
client_query_attributes * global_attrs
Definition: client_query_attributes.cc:31
This file defines the client API to MySQL and also the ABI of the dynamically linked libmysqlclient.
Definition: instrumented_condition_variable.h:31
case opt name
Definition: sslopt-case.h:32
Definition: mysql.h:652
Definition: mysql.h:679
Definition: mysql.h:297