MySQL 8.0.29
Source Code Documentation
pfs_prepared_stmt.h
Go to the documentation of this file.
1/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef PFS_PS_H
24#define PFS_PS_H
25
26/**
27 @file storage/perfschema/pfs_prepared_stmt.h
28 Stored Program data structures (declarations).
29*/
30
31#include <sys/types.h>
32
34#include "my_inttypes.h"
38
39#define PS_NAME_LENGTH NAME_LEN
40
42 /** Column OBJECT_INSTANCE_BEGIN */
43 const void *m_identity;
44
45 /** STATEMENT_ID */
47
48 /** STATEMENT_NAME */
49 char m_stmt_name[PS_NAME_LENGTH];
51
52 /** SQL_TEXT */
53 char m_sqltext[COL_INFO_SIZE];
55
56 /** Column OWNER_THREAD_ID */
58
59 /** Column OWNER_EVENT_ID. */
61
62 /** Column OBJECT_OWNER_TYPE. */
64
65 /** Column OBJECT_OWNER_SCHEMA. */
67
68 /** Column OBJECT_OWNER_NAME. */
70
71 /** COLUMN TIMER_PREPARE. Prepared statement prepare stat. */
73
74 /** COLUMN COUNT_REPREPARE. Prepared statement re-prepare stat. */
76
77 /** COLUMN EXECUTION_ENGINE. */
79
80 /** Prepared statement execution stat. */
82
83 /** Reset data for this record. */
84 void reset_data();
85};
86
87int init_prepared_stmt(const PFS_global_param *param);
88void cleanup_prepared_stmt(void);
89
91
93 void *identity, PFS_thread *thread, PFS_program *pfs_program,
94 PFS_events_statements *pfs_stmt, uint stmt_id, const char *stmt_name,
95 uint stmt_name_length, const char *sqltext, uint sqltext_length);
97#endif
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
Instrumentation helpers for prepared statements.
#define COL_INFO_SIZE
Size of INFO columns, in bytes.
Definition: pfs_column_types.h:70
enum_object_type
Enum values for the various OBJECT_TYPE columns.
Definition: pfs_column_types.h:221
#define PFS_ALIGNED
Definition: pfs_global.h:54
Object names (declarations).
void reset_prepared_stmt_instances()
Definition: pfs_prepared_stmt.cc:68
void cleanup_prepared_stmt(void)
Cleanup table PREPARED_STATEMENTS_INSTANCE.
Definition: pfs_prepared_stmt.cc:56
#define PS_NAME_LENGTH
Definition: pfs_prepared_stmt.h:39
int init_prepared_stmt(const PFS_global_param *param)
Initialize table PREPARED_STATEMENTS_INSTANCE.
Definition: pfs_prepared_stmt.cc:46
void delete_prepared_stmt(PFS_prepared_stmt *pfs_ps)
Definition: pfs_prepared_stmt.cc:134
PFS_prepared_stmt * create_prepared_stmt(void *identity, PFS_thread *thread, PFS_program *pfs_program, PFS_events_statements *pfs_stmt, uint stmt_id, const char *stmt_name, uint stmt_name_length, const char *sqltext, uint sqltext_length)
Definition: pfs_prepared_stmt.cc:72
Stored Program data structures (declarations).
Statistics (declarations).
A statement record.
Definition: pfs_events_statements.h:46
Performance schema global sizing parameters.
Definition: pfs_server.h:112
Base structure for wait instruments.
Definition: pfs_instr.h:88
Definition: pfs_name.h:180
Definition: pfs_prepared_stmt.h:41
PFS_single_stat m_reprepare_stat
COLUMN COUNT_REPREPARE.
Definition: pfs_prepared_stmt.h:75
ulonglong m_stmt_id
STATEMENT_ID.
Definition: pfs_prepared_stmt.h:46
ulonglong m_owner_thread_id
Column OWNER_THREAD_ID.
Definition: pfs_prepared_stmt.h:57
PFS_statement_stat m_execute_stat
Prepared statement execution stat.
Definition: pfs_prepared_stmt.h:81
uint m_sqltext_length
Definition: pfs_prepared_stmt.h:54
PFS_object_name m_owner_object_name
Column OBJECT_OWNER_NAME.
Definition: pfs_prepared_stmt.h:69
PFS_single_stat m_prepare_stat
COLUMN TIMER_PREPARE.
Definition: pfs_prepared_stmt.h:72
ulonglong m_owner_event_id
Column OWNER_EVENT_ID.
Definition: pfs_prepared_stmt.h:60
const void * m_identity
Column OBJECT_INSTANCE_BEGIN.
Definition: pfs_prepared_stmt.h:43
enum_object_type m_owner_object_type
Column OBJECT_OWNER_TYPE.
Definition: pfs_prepared_stmt.h:63
bool m_secondary
COLUMN EXECUTION_ENGINE.
Definition: pfs_prepared_stmt.h:78
PFS_schema_name m_owner_object_schema
Column OBJECT_OWNER_SCHEMA.
Definition: pfs_prepared_stmt.h:66
uint m_stmt_name_length
Definition: pfs_prepared_stmt.h:50
Definition: pfs_program.h:56
Definition: pfs_name.h:113
Single statistic.
Definition: pfs_stat.h:51
Statistics for statement usage.
Definition: pfs_stat.h:375
Instrumented thread implementation.
Definition: pfs_instr.h:372
unsigned int uint
Definition: uca-dump.cc:29