MySQL 8.0.39
Source Code Documentation
pfs_plugin_table_service.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef PFS_PLUGIN_TABLE_SERVICE_H
25#define PFS_PLUGIN_TABLE_SERVICE_H
26
29
30/**
31 @page EXAMPLE_PLUGIN_COMPONENT Example plugin/component to use this service.
32
33 Any plugin/component, which exposes tables in performance schema,
34 has to provide an implementation of interface PFS_engine_table_proxy.
35
36 As there is no storage engine here to handle table data, plugin/component has
37 to:
38 - maintain storage for table being exposed,
39 - take care of handling any duplicate check (Primary/Unique Key, etc.)
40
41 The following table describes datatypes exposed to plugin/component
42 which should be used to implement columns.
43
44 COLUMN TYPE | TO BE USED | NULL VALUE INDICATION
45 ----------- | ------------ | ---------------------
46 INTEGER | PSI_int | is_null=true
47 TINYINT | PSI_tinyint | -do-
48 SMALLINT | PSI_smallint | -do-
49 BIGINT | PSI_bigint | -do-
50 MEDIUMINT | PSI_mediumint| -do-
51 DECIMAL | PSI_decimal | -do-
52 FLOAT | PSI_float | -do-
53 DOUBLE | PSI_double | -do-
54 ENUM | PSI_enum | -do-
55 YEAR | PSI_year | -do-
56 DATE | char array | length=0
57 TIME | char array | -do-
58 DATETIME | char array | -do-
59 TIMESTAMP | char array | -do-
60 CHAR | char array | -do-
61 VARCHAR | char array | -do-
62 BLOB | char array | -do-
63
64 @section STEPS How to write a plugin/component exposing tables in Performance
65 Schema
66
67 Following are the example implementations of a plugin and a component which
68 uses this pfs_plugin_table_v1 service.
69
70 @subpage EXAMPLE_PLUGIN
71
72 @subpage EXAMPLE_COMPONENT
73*/
74
75/* Define ERRORS */
76#define PFS_HA_ERR_WRONG_COMMAND 131
77#define PFS_HA_ERR_RECORD_DELETED 134
78#define PFS_HA_ERR_END_OF_FILE 137
79#define PFS_HA_ERR_NO_REFERENCED_ROW 151
80#define PFS_HA_ERR_FOUND_DUPP_KEY 121
81#define PFS_HA_ERR_RECORD_FILE_FULL 135
82
83/* Helper macro */
84struct PFS_string {
85 char *str;
86 unsigned int length;
87};
88typedef struct PFS_string PFS_string;
89
90/**
91 This is an opaque structure to denote filed in plugin/component code.
92*/
93typedef struct PSI_field PSI_field;
94/**
95 This is an opaque structure to denote table handle in plugin/component code.
96*/
98/**
99 This is an opaque structure to denote cursor position in plugin/component
100 code.
101*/
102typedef struct PSI_pos PSI_pos;
103/**
104 This is an opaque structure to denote Key Reader in plugin/component code.
105*/
107/**
108 This is an opaque structure to denote Index Handle in plugin/component code.
109*/
111
112struct PSI_long {
113 long val; /* Column value */
114 bool is_null; /* If Column value is NULL */
115};
116typedef struct PSI_long PSI_long;
117
118struct PSI_ulong {
119 unsigned long val; /* Column value */
120 bool is_null; /* If Column value is NULL */
121};
122typedef struct PSI_ulong PSI_ulong;
123
125 long long val; /* Column value */
126 bool is_null /* If Column value is NULL */;
127};
129
131 unsigned long long val; /* Column value */
132 bool is_null /* If Column value is NULL */;
133};
135
137 double val; /* Column value */
138 bool is_null /* If Column value is NULL */;
139};
140typedef struct PSI_double PSI_double;
141
142#define PSI_tinyint PSI_long
143#define PSI_utinyint PSI_ulong
144#define PSI_smallint PSI_long
145#define PSI_usmallint PSI_ulong
146#define PSI_mediumint PSI_long
147#define PSI_umediumint PSI_ulong
148#define PSI_int PSI_long
149#define PSI_uint PSI_ulong
150#define PSI_bigint PSI_longlong
151#define PSI_ubigint PSI_ulonglong
152#define PSI_year PSI_ulong
153#define PSI_enum PSI_ulonglong
154#define PSI_decimal PSI_double
155#define PSI_float PSI_double
156
157/**
158 A structure to denote a key of type long in an index.
159*/
161 /* name of the key column */
162 const char *m_name;
163 /* find flags */
165 /* is column NULL */
167 /* value of the key column */
169};
174
175/**
176 A structure to denote a key of type ulong in an index.
177*/
179 /** Name of the key column */
180 const char *m_name;
181 /** Find flags */
183 /** Column is NULL */
185 /** Value of the key column */
186 unsigned long m_value;
187};
192
193/**
194 A structure to denote a key of type long long in an index.
195*/
197 /** Name of the key column */
198 const char *m_name;
199 /** Find flags */
201 /** Column is NULL */
203 /** Value of the key column */
204 long long m_value;
205};
207
208/**
209 A structure to denote a key of type unsigned long long in an index.
210*/
212 /** Name of the key column */
213 const char *m_name;
214 /** Find flags */
216 /** Column is NULL */
218 /** Value of the key column */
219 unsigned long long m_value;
220};
222
223/**
224 A structure to denote a key of type string in an index.
225*/
227 /* name of the key column */
228 const char *m_name;
229 /* find flags */
231 /* is column null */
233 /* buffer to store key column value */
235 // FIXME: size_t
236 /* length of the key value in buffer */
238 /* buffer size = number of characters * max multibyte length */
240};
242
243/**
244 Api to read the next record.
245 @param handle Table handle.
246
247 @return Operation status
248 @retval 0 Success
249 @retval !=0 Error
250*/
252
253/**
254 API to initialize for random scan or read.
255 @param handle Table handle.
256 @param scan True, if its a random scan.
257 False, if its a random read.
258
259 @return Operation status
260 @retval 0 Success
261 @retval !=0 Error
262*/
263typedef int (*rnd_init_t)(PSI_table_handle *handle, bool scan);
264
265/**
266 API to read row from a position which is set in table handle.
267 @param handle Table handle.
268
269 @return Operation status
270 @retval 0 Success
271 @retval !=0 Error
272*/
274
275/**
276 API to initialize index(es).
277 @param handle Table handle.
278 @param idx Index of the index to be initialized (in case of multiple
279 indexes on table)
280 @param sorted True if he index is sorted (typically a BTREE), false if not
281 sorted (typically a HASH)
282 @param index Initialized index handle.
283
284 @return Operation status
285 @retval 0 Success
286 @retval !=0 Error
287*/
288typedef int (*index_init_t)(PSI_table_handle *handle, unsigned int idx,
289 bool sorted, PSI_index_handle **index);
290/**
291 API to read keys in index.
292 @param index Index handle.
293 @param reader Key reader.
294 @param idx Index of the index to be read.
295 @param find_flag find flag.
296
297 @return Operation status
298 @retval 0 Success
299 @retval !=0 Error
300*/
301typedef int (*index_read_t)(PSI_index_handle *index, PSI_key_reader *reader,
302 unsigned int idx, int find_flag);
303
304/**
305 API to read next record with matching index.
306 @param handle Table handle.
307
308 @return Operation status
309 @retval 0 Success
310 @retval !=0 Error
311*/
313
314/**
315 API to reset cursor position
316 @param handle Table handle.
317*/
319
320/**
321 API to read a column value from table.
322 @param handle Table handle.
323 @param field Field for which value is to be read.
324 @param index Index of field in table column.
325
326 @return Operation status
327 @retval 0 Success
328 @retval !=0 Error
329*/
331 unsigned int index);
332
333/**
334 API to write a column value in table.
335 @param handle Table handle.
336 @param field Field for which value is to be written.
337 @param index Index of field in table column.
338
339 @return Operation status
340 @retval 0 Success
341 @retval !=0 Error
342*/
344 unsigned int index);
345/**
346 API to write a record in table.
347 @param handle Table handle having new record to be written.
348*/
350
351/**
352 API to update a column value in table.
353 @param handle Table handle.
354 @param field Field for which value is to be updated.
355 @param index Index of field in table column.
356
357 @return Operation status
358 @retval 0 Success
359 @retval !=0 Error
360*/
362 unsigned int index);
363/**
364 API to write a record in table.
365 @param handle Table handle having updated record to be updated.
366*/
368
369/**
370 API to delete record from table.
371 @param handle Table handle having record to be deleted.
372*/
374
375/**
376 API to Open a table handle in plugin/component code and reset position
377 pointer when a new table handle in opened in Performance Schema.
378
379 @note The pos argument is a pointer to a pointer which references a
380 buffer which identifies the current position (row) in the table.
381 The value assigned to *pos by the open_table_t function is stored in
382 table_plugin_table::m_pos and also the inherited
383 PFS_engine_table::m_pos_ptr. In PFS_engine_table::get_position(void *ref)
384 and PFS_engine_table::set_position(const void *ref),
385 PFS_engine_table_share::m_ref_length bytes are copied (using memcpy) to/from
386 this buffer to save/restore the current position in the table.
387
388 For this reason, any class/struct object used to hold the current table
389 position and whose address gets assigned to *pos needs to be trivially
390 copyable (std::trivially_copyable<T>::value must be true where T is the
391 type of the object pointed to by *pos), and the
392 PFS_engine_table_share_proxy::m_ref_length member variable (inherited from
393 PFS_engine_table_share) must be set to the correct size for the class/struct
394 used.
395
396 @param pos pos pointer to be updated.
397
398 @return initialized table handle.
399*/
400typedef PSI_table_handle *(*open_table_t)(PSI_pos **pos);
401
402/**
403 API to Close a table handle in plugin/component code and reset position
404 pointer when a table handle in closed in Performance Schema.
405 @param handle table handle
406*/
408
409/**
410 A structure to keep callback functions to be implemented by
411 plugin/component.
412*/
430};
432
433/**
434 Types of access allowed to tables.
435*/
437 /* Only Read is allowed */
439 /* Read/Truncate allowed but no Update/Insert/Delete. */
441 /* Read/Truncate/Update allowed but no Insert/Delete. */
443 /* Read/Truncate/Insert/UPDATE/Delete allowed. */
446
447/**
448 API to delete/truncate all the rows in a table
449*/
450typedef int (*delete_all_rows_t)(void);
451
452/**
453 API to give number of rows in a table
454
455 @return number of rows.
456*/
457typedef unsigned long long (*get_row_count_t)(void);
458
459/**
460 A share to be initialized by plugin/component code and to be provided
461 to add_table() service method of pfs_plugin_table_v1 service.
462 */
464 public:
465 /* Callback functions list of APIs */
467
468 /* Name of the table to be added */
469 const char *m_table_name;
470 /* Length of the table name */
472
473 /* Table Columns definition */
475 unsigned int m_ref_length;
476
477 /* Access allowed on the table */
479
482};
484
485/**
486 Definition of pfs_plugin_table_v1 service and its methods.
487*/
488BEGIN_SERVICE_DEFINITION(pfs_plugin_table_v1)
490 (PFS_engine_table_share_proxy * *st_share,
491 unsigned int share_count));
492
494 (PFS_engine_table_share_proxy * *st_share,
495 unsigned int share_count));
497END_SERVICE_DEFINITION(pfs_plugin_table_v1)
498
499BEGIN_SERVICE_DEFINITION(pfs_plugin_column_tiny_v1)
506 int find_flag));
509 int find_flag));
511 (bool record_null, long record_value,
514 (bool record_null, unsigned long record_value,
516
517END_SERVICE_DEFINITION(pfs_plugin_column_tiny_v1)
518
519BEGIN_SERVICE_DEFINITION(pfs_plugin_column_small_v1)
526 int find_flag));
529 int find_flag));
531 (bool record_null, long record_value,
534 (bool record_null, unsigned long record_value,
536END_SERVICE_DEFINITION(pfs_plugin_column_small_v1)
537
538BEGIN_SERVICE_DEFINITION(pfs_plugin_column_medium_v1)
545 int find_flag));
548 int find_flag));
550 (bool record_null, long record_value,
553 (bool record_null, unsigned long record_value,
555END_SERVICE_DEFINITION(pfs_plugin_column_medium_v1)
556
557BEGIN_SERVICE_DEFINITION(pfs_plugin_column_integer_v1)
558DECLARE_METHOD(void, set, (PSI_field * f, PSI_int value));
560DECLARE_METHOD(void, get, (PSI_field * f, PSI_int *value));
564 int find_flag));
567 int find_flag));
569 (bool record_null, long record_value,
572 (bool record_null, unsigned long record_value,
574END_SERVICE_DEFINITION(pfs_plugin_column_integer_v1)
575
576BEGIN_SERVICE_DEFINITION(pfs_plugin_column_bigint_v1)
583 int find_flag));
586 int find_flag));
588 (bool record_null, long long record_value,
591 (bool record_null, unsigned long long record_value,
593END_SERVICE_DEFINITION(pfs_plugin_column_bigint_v1)
594
595BEGIN_SERVICE_DEFINITION(pfs_plugin_column_decimal_v1)
598/* No support for indexes. */
599END_SERVICE_DEFINITION(pfs_plugin_column_decimal_v1)
600
601BEGIN_SERVICE_DEFINITION(pfs_plugin_column_float_v1)
603DECLARE_METHOD(void, get, (PSI_field * f, PSI_float *value));
604/* No support for indexes. */
605END_SERVICE_DEFINITION(pfs_plugin_column_float_v1)
606
607BEGIN_SERVICE_DEFINITION(pfs_plugin_column_double_v1)
610/* No support for indexes. */
611END_SERVICE_DEFINITION(pfs_plugin_column_double_v1)
612
613BEGIN_SERVICE_DEFINITION(pfs_plugin_column_string_v2)
614/* CHAR */
616 (PSI_field * f, const char *value, unsigned int length));
618 (PSI_field * f, char *str, unsigned int *length));
621 int find_flag));
623 (bool record_null, const char *record_string_value,
624 unsigned int record_string_length, PSI_plugin_key_string *key));
625/* VARCHAR */
627 (PSI_field * f, char *str, unsigned int *length));
630 (PSI_field * f, const char *str, unsigned int len));
631END_SERVICE_DEFINITION(pfs_plugin_column_string_v2)
632
633BEGIN_SERVICE_DEFINITION(pfs_plugin_column_blob_v1)
634DECLARE_METHOD(void, set, (PSI_field * f, const char *val, unsigned int len));
635DECLARE_METHOD(void, get, (PSI_field * f, char *val, unsigned int *len));
636/* No support for indexes. */
637END_SERVICE_DEFINITION(pfs_plugin_column_blob_v1)
638
639BEGIN_SERVICE_DEFINITION(pfs_plugin_column_enum_v1)
641DECLARE_METHOD(void, get, (PSI_field * f, PSI_enum *value));
642/* No support for indexes. */
643END_SERVICE_DEFINITION(pfs_plugin_column_enum_v1)
644
645BEGIN_SERVICE_DEFINITION(pfs_plugin_column_date_v1)
646DECLARE_METHOD(void, set,
647 (PSI_field * f, const char *str, unsigned int length));
648DECLARE_METHOD(void, get, (PSI_field * f, char *val, unsigned int *len));
649/* No support for indexes. */
650END_SERVICE_DEFINITION(pfs_plugin_column_date_v1)
651
652BEGIN_SERVICE_DEFINITION(pfs_plugin_column_time_v1)
653DECLARE_METHOD(void, set,
654 (PSI_field * f, const char *str, unsigned int length));
655DECLARE_METHOD(void, get, (PSI_field * f, char *val, unsigned int *len));
656/* No support for indexes. */
657END_SERVICE_DEFINITION(pfs_plugin_column_time_v1)
658
659BEGIN_SERVICE_DEFINITION(pfs_plugin_column_datetime_v1)
660DECLARE_METHOD(void, set,
661 (PSI_field * f, const char *str, unsigned int length));
662DECLARE_METHOD(void, get, (PSI_field * f, char *val, unsigned int *len));
663/* No support for indexes. */
664END_SERVICE_DEFINITION(pfs_plugin_column_datetime_v1)
665
666/*
667 SERVICE_DEFINITION(pfs_plugin_column_timestamp_v1)
668 Introduced in MySQL 8.0.14
669 Deprecated in MySQL 8.0.17
670 Status: Deprecated, use version 2 instead.
671*/
672BEGIN_SERVICE_DEFINITION(pfs_plugin_column_timestamp_v1)
673DECLARE_METHOD(void, set,
674 (PSI_field * f, const char *str, unsigned int length));
675DECLARE_METHOD(void, get, (PSI_field * f, char *val, unsigned int *len));
676/* No support for indexes. */
677END_SERVICE_DEFINITION(pfs_plugin_column_timestamp_v1)
678
679/*
680 SERVICE_DEFINITION(pfs_plugin_column_timestamp_v2)
681 Introduced in MySQL 8.0.17
682 Status: Active.
683*/
684BEGIN_SERVICE_DEFINITION(pfs_plugin_column_timestamp_v2)
685DECLARE_METHOD(void, set,
686 (PSI_field * f, const char *str, unsigned int length));
687/* Set time stamp value in microseconds as returned by my_micro_time(). */
688DECLARE_METHOD(void, set2, (PSI_field * f, unsigned long long val));
689DECLARE_METHOD(void, get, (PSI_field * f, char *val, unsigned int *len));
690/* No support for indexes. */
691END_SERVICE_DEFINITION(pfs_plugin_column_timestamp_v2)
692
693BEGIN_SERVICE_DEFINITION(pfs_plugin_column_year_v1)
695DECLARE_METHOD(void, get, (PSI_field * f, PSI_year *value));
696/* No support for indexes. */
697END_SERVICE_DEFINITION(pfs_plugin_column_year_v1)
698
699/*
700 SERVICE_DEFINITION(pfs_plugin_column_text_v1)
701 Introduced in MySQL 8.0.34
702 Status: Active.
703*/
704BEGIN_SERVICE_DEFINITION(pfs_plugin_column_text_v1)
705DECLARE_METHOD(void, set,
706 (PSI_field * f, const char *str, unsigned int length));
707DECLARE_METHOD(void, get, (PSI_field * f, char *val, unsigned int *len));
708END_SERVICE_DEFINITION(pfs_plugin_column_text_v1)
709
710#endif
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
void read_key_unsigned(PSI_key_reader *, PSI_plugin_key_ubigint *, int) noexcept
Definition: pfs_plugin_column_bigint_v1_all_empty.cc:40
void set_unsigned(PSI_field *, PSI_ulonglong) noexcept
Definition: pfs_plugin_column_bigint_v1_all_empty.cc:31
void get(PSI_field *, PSI_longlong *) noexcept
Definition: pfs_plugin_column_bigint_v1_all_empty.cc:32
bool match_key(bool, long long, PSI_plugin_key_bigint *) noexcept
Definition: pfs_plugin_column_bigint_v1_all_empty.cc:43
void read_key(PSI_key_reader *, PSI_plugin_key_bigint *, int) noexcept
Definition: pfs_plugin_column_bigint_v1_all_empty.cc:37
void get_unsigned(PSI_field *, PSI_ulonglong *) noexcept
Definition: pfs_plugin_column_bigint_v1_all_empty.cc:34
bool match_key_unsigned(bool, unsigned long long, PSI_plugin_key_ubigint *) noexcept
Definition: pfs_plugin_column_bigint_v1_all_empty.cc:48
void set_char_utf8mb4(PSI_field *, const char *, unsigned int) noexcept
Definition: pfs_plugin_column_string_v2_all_empty.cc:33
void set_varchar_utf8mb4(PSI_field *, const char *) noexcept
Definition: pfs_plugin_column_string_v2_all_empty.cc:49
void set_varchar_utf8mb4_len(PSI_field *, const char *, unsigned int) noexcept
Definition: pfs_plugin_column_string_v2_all_empty.cc:51
bool match_key_string(bool, const char *, unsigned int, PSI_plugin_key_string *) noexcept
Definition: pfs_plugin_column_string_v2_all_empty.cc:42
void get_char_utf8mb4(PSI_field *, char *, unsigned int *) noexcept
Definition: pfs_plugin_column_string_v2_all_empty.cc:35
void get_varchar_utf8mb4(PSI_field *, char *, unsigned int *) noexcept
Definition: pfs_plugin_column_string_v2_all_empty.cc:47
void read_key_string(PSI_key_reader *, PSI_plugin_key_string *, int) noexcept
Definition: pfs_plugin_column_string_v2_all_empty.cc:38
unsigned int get_parts_found(PSI_key_reader *) noexcept
Definition: pfs_plugin_table_v1_all_empty.cc:42
int delete_tables(PFS_engine_table_share_proxy **, unsigned int) noexcept
Definition: pfs_plugin_table_v1_all_empty.cc:39
int add_tables(PFS_engine_table_share_proxy **, unsigned int) noexcept
Definition: pfs_plugin_table_v1_all_empty.cc:33
static int handle(int sql_errno, const char *sqlstate, const char *message, void *state)
Bridge function between the C++ API offered by this module and the C API of the parser service.
Definition: services.cc:64
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2882
Access_control
Types of access allowed to tables.
Definition: pfs_plugin_table_service.h:436
@ READONLY
Definition: pfs_plugin_table_service.h:438
@ EDITABLE
Definition: pfs_plugin_table_service.h:444
@ UPDATABLE
Definition: pfs_plugin_table_service.h:442
@ TRUNCATABLE
Definition: pfs_plugin_table_service.h:440
int(* write_row_values_t)(PSI_table_handle *handle)
API to write a record in table.
Definition: pfs_plugin_table_service.h:349
PSI_plugin_key_uinteger PSI_plugin_key_usmallint
Definition: pfs_plugin_table_service.h:190
PSI_plugin_key_integer PSI_plugin_key_tinyint
Definition: pfs_plugin_table_service.h:171
int(* delete_row_values_t)(PSI_table_handle *handle)
API to delete record from table.
Definition: pfs_plugin_table_service.h:373
int(* index_read_t)(PSI_index_handle *index, PSI_key_reader *reader, unsigned int idx, int find_flag)
API to read keys in index.
Definition: pfs_plugin_table_service.h:301
int(* update_row_values_t)(PSI_table_handle *handle)
API to write a record in table.
Definition: pfs_plugin_table_service.h:367
PSI_plugin_key_integer PSI_plugin_key_smallint
Definition: pfs_plugin_table_service.h:172
#define PSI_float
Definition: pfs_plugin_table_service.h:155
struct PSI_table_handle PSI_table_handle
This is an opaque structure to denote table handle in plugin/component code.
Definition: pfs_plugin_table_service.h:97
#define PSI_tinyint
Definition: pfs_plugin_table_service.h:142
struct PSI_pos PSI_pos
This is an opaque structure to denote cursor position in plugin/component code.
Definition: pfs_plugin_table_service.h:102
PSI_plugin_key_uinteger PSI_plugin_key_utinyint
Definition: pfs_plugin_table_service.h:189
int(* rnd_next_t)(PSI_table_handle *handle)
Api to read the next record.
Definition: pfs_plugin_table_service.h:251
#define PSI_int
Definition: pfs_plugin_table_service.h:148
#define PSI_smallint
Definition: pfs_plugin_table_service.h:144
int(* update_column_value_t)(PSI_table_handle *handle, PSI_field *field, unsigned int index)
API to update a column value in table.
Definition: pfs_plugin_table_service.h:361
int(* read_column_value_t)(PSI_table_handle *handle, PSI_field *field, unsigned int index)
API to read a column value from table.
Definition: pfs_plugin_table_service.h:330
int(* index_next_t)(PSI_table_handle *handle)
API to read next record with matching index.
Definition: pfs_plugin_table_service.h:312
#define PSI_enum
Definition: pfs_plugin_table_service.h:153
PSI_plugin_key_uinteger PSI_plugin_key_umediumint
Definition: pfs_plugin_table_service.h:191
void(* close_table_t)(PSI_table_handle *handle)
API to Close a table handle in plugin/component code and reset position pointer when a table handle i...
Definition: pfs_plugin_table_service.h:407
#define PSI_decimal
Definition: pfs_plugin_table_service.h:154
#define PSI_bigint
Definition: pfs_plugin_table_service.h:150
PSI_table_handle *(* open_table_t)(PSI_pos **pos)
API to Open a table handle in plugin/component code and reset position pointer when a new table handl...
Definition: pfs_plugin_table_service.h:400
#define PSI_year
Definition: pfs_plugin_table_service.h:152
PSI_plugin_key_integer PSI_plugin_key_mediumint
Definition: pfs_plugin_table_service.h:173
int(* write_column_value_t)(PSI_table_handle *handle, PSI_field *field, unsigned int index)
API to write a column value in table.
Definition: pfs_plugin_table_service.h:343
struct PSI_key_reader PSI_key_reader
This is an opaque structure to denote Key Reader in plugin/component code.
Definition: pfs_plugin_table_service.h:106
int(* rnd_init_t)(PSI_table_handle *handle, bool scan)
API to initialize for random scan or read.
Definition: pfs_plugin_table_service.h:263
int(* rnd_pos_t)(PSI_table_handle *handle)
API to read row from a position which is set in table handle.
Definition: pfs_plugin_table_service.h:273
struct PSI_index_handle PSI_index_handle
This is an opaque structure to denote Index Handle in plugin/component code.
Definition: pfs_plugin_table_service.h:110
unsigned long long(* get_row_count_t)(void)
API to give number of rows in a table.
Definition: pfs_plugin_table_service.h:457
#define PSI_utinyint
Definition: pfs_plugin_table_service.h:143
void(* reset_position_t)(PSI_table_handle *handle)
API to reset cursor position.
Definition: pfs_plugin_table_service.h:318
#define PSI_mediumint
Definition: pfs_plugin_table_service.h:146
#define PSI_umediumint
Definition: pfs_plugin_table_service.h:147
int(* delete_all_rows_t)(void)
API to delete/truncate all the rows in a table.
Definition: pfs_plugin_table_service.h:450
#define PSI_uint
Definition: pfs_plugin_table_service.h:149
int(* index_init_t)(PSI_table_handle *handle, unsigned int idx, bool sorted, PSI_index_handle **index)
API to initialize index(es).
Definition: pfs_plugin_table_service.h:288
struct PSI_field PSI_field
This is an opaque structure to denote filed in plugin/component code.
Definition: pfs_plugin_table_service.h:93
#define PSI_usmallint
Definition: pfs_plugin_table_service.h:145
#define PSI_ubigint
Definition: pfs_plugin_table_service.h:151
required string key
Definition: replication_asynchronous_connection_failover.proto:60
#define DECLARE_METHOD(retval, name, args)
Declares a method as a part of the Service definition.
Definition: service.h:103
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86
Specifies macros to define Service Implementations.
A structure to keep callback functions to be implemented by plugin/component.
Definition: pfs_plugin_table_service.h:413
index_next_t index_next
Definition: pfs_plugin_table_service.h:419
PFS_engine_table_proxy()=default
close_table_t close_table
Definition: pfs_plugin_table_service.h:428
rnd_next_t rnd_next
Definition: pfs_plugin_table_service.h:414
reset_position_t reset_position
Definition: pfs_plugin_table_service.h:421
write_row_values_t write_row_values
Definition: pfs_plugin_table_service.h:423
rnd_pos_t rnd_pos
Definition: pfs_plugin_table_service.h:416
write_column_value_t write_column_value
Definition: pfs_plugin_table_service.h:422
read_column_value_t read_column_value
Definition: pfs_plugin_table_service.h:420
update_column_value_t update_column_value
Definition: pfs_plugin_table_service.h:424
rnd_init_t rnd_init
Definition: pfs_plugin_table_service.h:415
update_row_values_t update_row_values
Definition: pfs_plugin_table_service.h:425
index_read_t index_read
Definition: pfs_plugin_table_service.h:418
open_table_t open_table
Definition: pfs_plugin_table_service.h:427
delete_row_values_t delete_row_values
Definition: pfs_plugin_table_service.h:426
index_init_t index_init
Definition: pfs_plugin_table_service.h:417
A share to be initialized by plugin/component code and to be provided to add_table() service method o...
Definition: pfs_plugin_table_service.h:463
delete_all_rows_t delete_all_rows
Definition: pfs_plugin_table_service.h:480
const char * m_table_name
Definition: pfs_plugin_table_service.h:469
const char * m_table_definition
Definition: pfs_plugin_table_service.h:474
PFS_engine_table_proxy m_proxy_engine_table
Definition: pfs_plugin_table_service.h:466
unsigned int m_table_name_length
Definition: pfs_plugin_table_service.h:471
enum Access_control m_acl
Definition: pfs_plugin_table_service.h:478
get_row_count_t get_row_count
Definition: pfs_plugin_table_service.h:481
unsigned int m_ref_length
Definition: pfs_plugin_table_service.h:475
Definition: pfs_plugin_table_service.h:84
unsigned int length
Definition: pfs_plugin_table_service.h:86
char * str
Definition: pfs_plugin_table_service.h:85
Definition: pfs_plugin_table_service.h:136
bool is_null
Definition: pfs_plugin_table_service.h:138
double val
Definition: pfs_plugin_table_service.h:137
Definition: pfs_plugin_table_service.h:112
bool is_null
Definition: pfs_plugin_table_service.h:114
long val
Definition: pfs_plugin_table_service.h:113
Definition: pfs_plugin_table_service.h:124
long long val
Definition: pfs_plugin_table_service.h:125
bool is_null
Definition: pfs_plugin_table_service.h:126
A structure to denote a key of type long long in an index.
Definition: pfs_plugin_table_service.h:196
int m_find_flags
Find flags.
Definition: pfs_plugin_table_service.h:200
long long m_value
Value of the key column.
Definition: pfs_plugin_table_service.h:204
bool m_is_null
Column is NULL.
Definition: pfs_plugin_table_service.h:202
const char * m_name
Name of the key column.
Definition: pfs_plugin_table_service.h:198
A structure to denote a key of type long in an index.
Definition: pfs_plugin_table_service.h:160
const char * m_name
Definition: pfs_plugin_table_service.h:162
bool m_is_null
Definition: pfs_plugin_table_service.h:166
long m_value
Definition: pfs_plugin_table_service.h:168
int m_find_flags
Definition: pfs_plugin_table_service.h:164
A structure to denote a key of type string in an index.
Definition: pfs_plugin_table_service.h:226
unsigned int m_value_buffer_length
Definition: pfs_plugin_table_service.h:237
bool m_is_null
Definition: pfs_plugin_table_service.h:232
unsigned int m_value_buffer_capacity
Definition: pfs_plugin_table_service.h:239
int m_find_flags
Definition: pfs_plugin_table_service.h:230
const char * m_name
Definition: pfs_plugin_table_service.h:228
char * m_value_buffer
Definition: pfs_plugin_table_service.h:234
A structure to denote a key of type unsigned long long in an index.
Definition: pfs_plugin_table_service.h:211
int m_find_flags
Find flags.
Definition: pfs_plugin_table_service.h:215
unsigned long long m_value
Value of the key column.
Definition: pfs_plugin_table_service.h:219
bool m_is_null
Column is NULL.
Definition: pfs_plugin_table_service.h:217
const char * m_name
Name of the key column.
Definition: pfs_plugin_table_service.h:213
A structure to denote a key of type ulong in an index.
Definition: pfs_plugin_table_service.h:178
const char * m_name
Name of the key column.
Definition: pfs_plugin_table_service.h:180
bool m_is_null
Column is NULL.
Definition: pfs_plugin_table_service.h:184
int m_find_flags
Find flags.
Definition: pfs_plugin_table_service.h:182
unsigned long m_value
Value of the key column.
Definition: pfs_plugin_table_service.h:186
Definition: pfs_plugin_table_service.h:118
bool is_null
Definition: pfs_plugin_table_service.h:120
unsigned long val
Definition: pfs_plugin_table_service.h:119
Definition: pfs_plugin_table_service.h:130
unsigned long long val
Definition: pfs_plugin_table_service.h:131
bool is_null
Definition: pfs_plugin_table_service.h:132