1
/* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software Foundation,
14
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
16
#ifndef TABLE_SESSION_CONNECT_H
17
#define TABLE_SESSION_CONNECT_H
19
#include "pfs_column_types.h"
20
#include "cursor_by_thread_connect_attr.h"
21
#include "table_helper.h"
23
#define MAX_ATTR_NAME_CHARS 32
24
#define MAX_ATTR_VALUE_CHARS 1024
25
#define MAX_UTF8_BYTES 6
27
/** symbolic names for field offsets, keep in sync with field_types */
36
A row of PERFORMANCE_SCHEMA.SESSION_CONNECT_ATTRS and
37
PERFORMANCE_SCHEMA.SESSION_ACCOUNT_CONNECT_ATTRS.
39
struct row_session_connect_attrs
41
/** Column PROCESS_ID. */
43
/** Column ATTR_NAME. In UTF-8 */
44
char m_attr_name[MAX_ATTR_NAME_CHARS * MAX_UTF8_BYTES];
45
/** Length in bytes of @c m_attr_name. */
46
uint m_attr_name_length;
47
/** Column ATTR_VALUE. In UTF-8 */
48
char m_attr_value[MAX_ATTR_VALUE_CHARS * MAX_UTF8_BYTES];
49
/** Length in bytes of @c m_attr_name. */
50
uint m_attr_value_length;
51
/** Column ORDINAL_POSITION. */
52
ulong m_ordinal_position;
55
class table_session_connect : public cursor_by_thread_connect_attr
58
table_session_connect(const PFS_engine_table_share *share);
61
~table_session_connect();
64
virtual void make_row(PFS_thread *pfs, uint ordinal);
65
virtual bool thread_fits(PFS_thread *thread);
66
virtual int read_row_values(TABLE *table, unsigned char *buf,
67
Field **fields, bool read_all);
69
/** Fields definition. */
70
static TABLE_FIELD_DEF m_field_def;
72
row_session_connect_attrs m_row;
73
/** Safe copy of @c PFS_thread::m_session_connect_attrs. */
74
char *m_copy_session_connect_attrs;
75
/** Safe copy of @c PFS_thread::m_session_connect_attrs_length. */
76
uint m_copy_session_connect_attrs_length;