MySQL 8.0.33
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*/
429};
431
432/**
433 Types of access allowed to tables.
434*/
436 /* Only Read is allowed */
438 /* Read/Truncate allowed but no Update/Insert/Delete. */
440 /* Read/Truncate/Update allowed but no Insert/Delete. */
442 /* Read/Truncate/Insert/UPDATE/Delete allowed. */
445
446/**
447 API to delete/truncate all the rows in a table
448*/
449typedef int (*delete_all_rows_t)(void);
450
451/**
452 API to give number of rows in a table
453
454 @return number of rows.
455*/
456typedef unsigned long long (*get_row_count_t)(void);
457
458/**
459 A share to be initialized by plugin/component code and to be provided
460 to add_table() service method of pfs_plugin_table_v1 service.
461 */
463 public:
464 /* Callback functions list of APIs */
466
467 /* Name of the table to be added */
468 const char *m_table_name;
469 /* Length of the table name */
471
472 /* Table Columns definition */
474 unsigned int m_ref_length;
475
476 /* Access allowed on the table */
478
481};
483
484/**
485 Definition of pfs_plugin_table_v1 service and its methods.
486*/
487BEGIN_SERVICE_DEFINITION(pfs_plugin_table_v1)
488DECLARE_METHOD(int, add_tables,
489 (PFS_engine_table_share_proxy * *st_share,
490 unsigned int share_count));
491
492DECLARE_METHOD(int, delete_tables,
493 (PFS_engine_table_share_proxy * *st_share,
494 unsigned int share_count));
495DECLARE_METHOD(unsigned int, get_parts_found, (PSI_key_reader * reader));
496END_SERVICE_DEFINITION(pfs_plugin_table_v1)
497
498BEGIN_SERVICE_DEFINITION(pfs_plugin_column_tiny_v1)
500DECLARE_METHOD(void, set_unsigned, (PSI_field * f, PSI_utinyint value));
502DECLARE_METHOD(void, get_unsigned, (PSI_field * f, PSI_utinyint *value));
503DECLARE_METHOD(void, read_key,
505 int find_flag));
506DECLARE_METHOD(void, read_key_unsigned,
508 int find_flag));
509DECLARE_METHOD(bool, match_key,
510 (bool record_null, long record_value,
512DECLARE_METHOD(bool, match_key_unsigned,
513 (bool record_null, unsigned long record_value,
515
516END_SERVICE_DEFINITION(pfs_plugin_column_tiny_v1)
517
518BEGIN_SERVICE_DEFINITION(pfs_plugin_column_small_v1)
520DECLARE_METHOD(void, set_unsigned, (PSI_field * f, PSI_usmallint value));
522DECLARE_METHOD(void, get_unsigned, (PSI_field * f, PSI_usmallint *value));
523DECLARE_METHOD(void, read_key,
525 int find_flag));
526DECLARE_METHOD(void, read_key_unsigned,
528 int find_flag));
529DECLARE_METHOD(bool, match_key,
530 (bool record_null, long record_value,
532DECLARE_METHOD(bool, match_key_unsigned,
533 (bool record_null, unsigned long record_value,
535END_SERVICE_DEFINITION(pfs_plugin_column_small_v1)
536
537BEGIN_SERVICE_DEFINITION(pfs_plugin_column_medium_v1)
539DECLARE_METHOD(void, set_unsigned, (PSI_field * f, PSI_umediumint value));
541DECLARE_METHOD(void, get_unsigned, (PSI_field * f, PSI_umediumint *value));
542DECLARE_METHOD(void, read_key,
544 int find_flag));
545DECLARE_METHOD(void, read_key_unsigned,
547 int find_flag));
548DECLARE_METHOD(bool, match_key,
549 (bool record_null, long record_value,
551DECLARE_METHOD(bool, match_key_unsigned,
552 (bool record_null, unsigned long record_value,
554END_SERVICE_DEFINITION(pfs_plugin_column_medium_v1)
555
556BEGIN_SERVICE_DEFINITION(pfs_plugin_column_integer_v1)
557DECLARE_METHOD(void, set, (PSI_field * f, PSI_int value));
558DECLARE_METHOD(void, set_unsigned, (PSI_field * f, PSI_uint value));
559DECLARE_METHOD(void, get, (PSI_field * f, PSI_int *value));
560DECLARE_METHOD(void, get_unsigned, (PSI_field * f, PSI_int *value));
561DECLARE_METHOD(void, read_key,
563 int find_flag));
564DECLARE_METHOD(void, read_key_unsigned,
566 int find_flag));
567DECLARE_METHOD(bool, match_key,
568 (bool record_null, long record_value,
570DECLARE_METHOD(bool, match_key_unsigned,
571 (bool record_null, unsigned long record_value,
573END_SERVICE_DEFINITION(pfs_plugin_column_integer_v1)
574
575BEGIN_SERVICE_DEFINITION(pfs_plugin_column_bigint_v1)
577DECLARE_METHOD(void, set_unsigned, (PSI_field * f, PSI_ubigint value));
579DECLARE_METHOD(void, get_unsigned, (PSI_field * f, PSI_ubigint *value));
580DECLARE_METHOD(void, read_key,
582 int find_flag));
583DECLARE_METHOD(void, read_key_unsigned,
585 int find_flag));
586DECLARE_METHOD(bool, match_key,
587 (bool record_null, long long record_value,
589DECLARE_METHOD(bool, match_key_unsigned,
590 (bool record_null, unsigned long long record_value,
592END_SERVICE_DEFINITION(pfs_plugin_column_bigint_v1)
593
594BEGIN_SERVICE_DEFINITION(pfs_plugin_column_decimal_v1)
597/* No support for indexes. */
598END_SERVICE_DEFINITION(pfs_plugin_column_decimal_v1)
599
600BEGIN_SERVICE_DEFINITION(pfs_plugin_column_float_v1)
602DECLARE_METHOD(void, get, (PSI_field * f, PSI_float *value));
603/* No support for indexes. */
604END_SERVICE_DEFINITION(pfs_plugin_column_float_v1)
605
606BEGIN_SERVICE_DEFINITION(pfs_plugin_column_double_v1)
609/* No support for indexes. */
610END_SERVICE_DEFINITION(pfs_plugin_column_double_v1)
611
612BEGIN_SERVICE_DEFINITION(pfs_plugin_column_string_v2)
613/* CHAR */
614DECLARE_METHOD(void, set_char_utf8mb4,
615 (PSI_field * f, const char *value, unsigned int length));
616DECLARE_METHOD(void, get_char_utf8mb4,
617 (PSI_field * f, char *str, unsigned int *length));
618DECLARE_METHOD(void, read_key_string,
620 int find_flag));
621DECLARE_METHOD(bool, match_key_string,
622 (bool record_null, const char *record_string_value,
623 unsigned int record_string_length, PSI_plugin_key_string *key));
624/* VARCHAR */
625DECLARE_METHOD(void, get_varchar_utf8mb4,
626 (PSI_field * f, char *str, unsigned int *length));
627DECLARE_METHOD(void, set_varchar_utf8mb4, (PSI_field * f, const char *str));
628DECLARE_METHOD(void, set_varchar_utf8mb4_len,
629 (PSI_field * f, const char *str, unsigned int len));
630END_SERVICE_DEFINITION(pfs_plugin_column_string_v2)
631
632BEGIN_SERVICE_DEFINITION(pfs_plugin_column_blob_v1)
633DECLARE_METHOD(void, set, (PSI_field * f, const char *val, unsigned int len));
634DECLARE_METHOD(void, get, (PSI_field * f, char *val, unsigned int *len));
635/* No support for indexes. */
636END_SERVICE_DEFINITION(pfs_plugin_column_blob_v1)
637
638BEGIN_SERVICE_DEFINITION(pfs_plugin_column_enum_v1)
640DECLARE_METHOD(void, get, (PSI_field * f, PSI_enum *value));
641/* No support for indexes. */
642END_SERVICE_DEFINITION(pfs_plugin_column_enum_v1)
643
644BEGIN_SERVICE_DEFINITION(pfs_plugin_column_date_v1)
645DECLARE_METHOD(void, set,
646 (PSI_field * f, const char *str, unsigned int length));
647DECLARE_METHOD(void, get, (PSI_field * f, char *val, unsigned int *len));
648/* No support for indexes. */
649END_SERVICE_DEFINITION(pfs_plugin_column_date_v1)
650
651BEGIN_SERVICE_DEFINITION(pfs_plugin_column_time_v1)
652DECLARE_METHOD(void, set,
653 (PSI_field * f, const char *str, unsigned int length));
654DECLARE_METHOD(void, get, (PSI_field * f, char *val, unsigned int *len));
655/* No support for indexes. */
656END_SERVICE_DEFINITION(pfs_plugin_column_time_v1)
657
658BEGIN_SERVICE_DEFINITION(pfs_plugin_column_datetime_v1)
659DECLARE_METHOD(void, set,
660 (PSI_field * f, const char *str, unsigned int length));
661DECLARE_METHOD(void, get, (PSI_field * f, char *val, unsigned int *len));
662/* No support for indexes. */
663END_SERVICE_DEFINITION(pfs_plugin_column_datetime_v1)
664
665/*
666 SERVICE_DEFINITION(pfs_plugin_column_timestamp_v1)
667 Introduced in MySQL 8.0.14
668 Deprecated in MySQL 8.0.17
669 Status: Deprecated, use version 2 instead.
670*/
671BEGIN_SERVICE_DEFINITION(pfs_plugin_column_timestamp_v1)
672DECLARE_METHOD(void, set,
673 (PSI_field * f, const char *str, unsigned int length));
674DECLARE_METHOD(void, get, (PSI_field * f, char *val, unsigned int *len));
675/* No support for indexes. */
676END_SERVICE_DEFINITION(pfs_plugin_column_timestamp_v1)
677
678/*
679 SERVICE_DEFINITION(pfs_plugin_column_timestamp_v2)
680 Introduced in MySQL 8.0.17
681 Status: Active.
682*/
683BEGIN_SERVICE_DEFINITION(pfs_plugin_column_timestamp_v2)
684DECLARE_METHOD(void, set,
685 (PSI_field * f, const char *str, unsigned int length));
686/* Set time stamp value in microseconds as returned by my_micro_time(). */
687DECLARE_METHOD(void, set2, (PSI_field * f, unsigned long long val));
688DECLARE_METHOD(void, get, (PSI_field * f, char *val, unsigned int *len));
689/* No support for indexes. */
690END_SERVICE_DEFINITION(pfs_plugin_column_timestamp_v2)
691
692BEGIN_SERVICE_DEFINITION(pfs_plugin_column_year_v1)
694DECLARE_METHOD(void, get, (PSI_field * f, PSI_year *value));
695/* No support for indexes. */
696END_SERVICE_DEFINITION(pfs_plugin_column_year_v1)
697
698#endif
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1054
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
static mysql_service_status_t get(reference_caching_cache cache, unsigned service_name_index, const my_h_service **refs) noexcept
Definition: component.cc:113
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:2880
Access_control
Types of access allowed to tables.
Definition: pfs_plugin_table_service.h:435
@ READONLY
Definition: pfs_plugin_table_service.h:437
@ EDITABLE
Definition: pfs_plugin_table_service.h:443
@ UPDATABLE
Definition: pfs_plugin_table_service.h:441
@ TRUNCATABLE
Definition: pfs_plugin_table_service.h:439
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:456
#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:449
#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
PFS_engine_table_proxy()=default
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:462
delete_all_rows_t delete_all_rows
Definition: pfs_plugin_table_service.h:479
const char * m_table_name
Definition: pfs_plugin_table_service.h:468
const char * m_table_definition
Definition: pfs_plugin_table_service.h:473
PFS_engine_table_proxy m_proxy_engine_table
Definition: pfs_plugin_table_service.h:465
unsigned int m_table_name_length
Definition: pfs_plugin_table_service.h:470
enum Access_control m_acl
Definition: pfs_plugin_table_service.h:477
get_row_count_t get_row_count
Definition: pfs_plugin_table_service.h:480
unsigned int m_ref_length
Definition: pfs_plugin_table_service.h:474
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