MySQL 9.1.0
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*/
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)
489 (PFS_engine_table_share_proxy * *st_share,
490 unsigned int share_count));
491
493 (PFS_engine_table_share_proxy * *st_share,
494 unsigned int share_count));
496END_SERVICE_DEFINITION(pfs_plugin_table_v1)
497
498BEGIN_SERVICE_DEFINITION(pfs_plugin_column_tiny_v1)
505 int find_flag));
508 int find_flag));
510 (bool record_null, long record_value,
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)
525 int find_flag));
528 int find_flag));
530 (bool record_null, long record_value,
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)
544 int find_flag));
547 int find_flag));
549 (bool record_null, long record_value,
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));
559DECLARE_METHOD(void, get, (PSI_field * f, PSI_int *value));
563 int find_flag));
566 int find_flag));
568 (bool record_null, long record_value,
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)
582 int find_flag));
585 int find_flag));
587 (bool record_null, long long record_value,
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 */
615 (PSI_field * f, const char *value, unsigned int length));
617 (PSI_field * f, char *str, unsigned int *length));
620 int find_flag));
622 (bool record_null, const char *record_string_value,
623 unsigned int record_string_length, PSI_plugin_key_string *key));
624/* VARCHAR */
626 (PSI_field * f, char *str, unsigned int *length));
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/*
699 SERVICE_DEFINITION(pfs_plugin_column_text_v1)
700 Introduced in MySQL 8.0.34
701 Status: Active.
702*/
703BEGIN_SERVICE_DEFINITION(pfs_plugin_column_text_v1)
704DECLARE_METHOD(void, set,
705 (PSI_field * f, const char *str, unsigned int length));
706DECLARE_METHOD(void, get, (PSI_field * f, char *val, unsigned int *len));
707END_SERVICE_DEFINITION(pfs_plugin_column_text_v1)
708
709#endif
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1105
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
static mysql_service_status_t get(THD **thd) noexcept
Definition: mysql_current_thread_reader_all_empty.cc:31
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
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:2884
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: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:456
#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:449
#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
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: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: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