MySQL 8.0.39
Source Code Documentation
pfs_prepared_stmt.h
Go to the documentation of this file.
1/* Copyright (c) 2013, 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
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#ifndef PFS_PS_H
25#define PFS_PS_H
26
27/**
28 @file storage/perfschema/pfs_prepared_stmt.h
29 Stored Program data structures (declarations).
30*/
31
32#include <sys/types.h>
33
35#include "my_inttypes.h"
39
40#define PS_NAME_LENGTH NAME_LEN
41
43 /** Column OBJECT_INSTANCE_BEGIN */
44 const void *m_identity;
45
46 /** STATEMENT_ID */
48
49 /** STATEMENT_NAME */
50 char m_stmt_name[PS_NAME_LENGTH];
52
53 /** SQL_TEXT */
54 char m_sqltext[COL_INFO_SIZE];
56
57 /** Column OWNER_THREAD_ID */
59
60 /** Column OWNER_EVENT_ID. */
62
63 /** Column OBJECT_OWNER_TYPE. */
65
66 /** Column OBJECT_OWNER_SCHEMA. */
68
69 /** Column OBJECT_OWNER_NAME. */
71
72 /** COLUMN TIMER_PREPARE. Prepared statement prepare stat. */
74
75 /** COLUMN COUNT_REPREPARE. Prepared statement re-prepare stat. */
77
78 /** COLUMN EXECUTION_ENGINE. */
80
81 /** Prepared statement execution stat. */
83
84 /** Reset data for this record. */
85 void reset_data();
86};
87
88int init_prepared_stmt(const PFS_global_param *param);
90
92
94 void *identity, PFS_thread *thread, PFS_program *pfs_program,
95 PFS_events_statements *pfs_stmt, uint stmt_id, const char *stmt_name,
96 uint stmt_name_length, const char *sqltext, uint sqltext_length);
98#endif
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Instrumentation helpers for prepared statements.
#define COL_INFO_SIZE
Size of INFO columns, in bytes.
Definition: pfs_column_types.h:71
enum_object_type
Enum values for the various OBJECT_TYPE columns.
Definition: pfs_column_types.h:222
#define PFS_ALIGNED
Definition: pfs_global.h:57
Object names (declarations).
void reset_prepared_stmt_instances()
Definition: pfs_prepared_stmt.cc:69
#define PS_NAME_LENGTH
Definition: pfs_prepared_stmt.h:40
int init_prepared_stmt(const PFS_global_param *param)
Initialize table PREPARED_STATEMENTS_INSTANCE.
Definition: pfs_prepared_stmt.cc:47
void delete_prepared_stmt(PFS_prepared_stmt *pfs_ps)
Definition: pfs_prepared_stmt.cc:135
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:73
void cleanup_prepared_stmt()
Cleanup table PREPARED_STATEMENTS_INSTANCE.
Definition: pfs_prepared_stmt.cc:57
Stored Program data structures (declarations).
Statistics (declarations).
A statement record.
Definition: pfs_events_statements.h:47
Performance schema global sizing parameters.
Definition: pfs_server.h:113
Base structure for wait instruments.
Definition: pfs_instr.h:89
Definition: pfs_name.h:336
Definition: pfs_prepared_stmt.h:42
PFS_single_stat m_reprepare_stat
COLUMN COUNT_REPREPARE.
Definition: pfs_prepared_stmt.h:76
ulonglong m_stmt_id
STATEMENT_ID.
Definition: pfs_prepared_stmt.h:47
ulonglong m_owner_thread_id
Column OWNER_THREAD_ID.
Definition: pfs_prepared_stmt.h:58
PFS_statement_stat m_execute_stat
Prepared statement execution stat.
Definition: pfs_prepared_stmt.h:82
uint m_sqltext_length
Definition: pfs_prepared_stmt.h:55
PFS_object_name m_owner_object_name
Column OBJECT_OWNER_NAME.
Definition: pfs_prepared_stmt.h:70
PFS_single_stat m_prepare_stat
COLUMN TIMER_PREPARE.
Definition: pfs_prepared_stmt.h:73
ulonglong m_owner_event_id
Column OWNER_EVENT_ID.
Definition: pfs_prepared_stmt.h:61
const void * m_identity
Column OBJECT_INSTANCE_BEGIN.
Definition: pfs_prepared_stmt.h:44
enum_object_type m_owner_object_type
Column OBJECT_OWNER_TYPE.
Definition: pfs_prepared_stmt.h:64
bool m_secondary
COLUMN EXECUTION_ENGINE.
Definition: pfs_prepared_stmt.h:79
PFS_schema_name m_owner_object_schema
Column OBJECT_OWNER_SCHEMA.
Definition: pfs_prepared_stmt.h:67
uint m_stmt_name_length
Definition: pfs_prepared_stmt.h:51
Definition: pfs_program.h:57
Definition: pfs_name.h:186
Single statistic.
Definition: pfs_stat.h:52
Statistics for statement usage.
Definition: pfs_stat.h:376
Instrumented thread implementation.
Definition: pfs_instr.h:373
unsigned int uint
Definition: uca9-dump.cc:75