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