~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin.h

  • Committer: Mark Atwood
  • Date: 2008-10-16 11:33:16 UTC
  • mto: (520.1.13 drizzle)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: mark@fallenpegasus.com-20081016113316-ff6jdt31ck90sjdh
an implemention of the errmsg plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#define DRIZZLED_PLUGIN_H
22
22
 
23
23
#include <drizzled/global.h>
24
 
#include <drizzled/lex_string.h>
25
 
#include <drizzled/xid.h>
26
24
 
27
 
class Session;
 
25
class THD;
28
26
class Item;
29
27
 
 
28
#define DRIZZLE_XIDDATASIZE 128
 
29
/**
 
30
  struct st_mysql_xid is binary compatible with the XID structure as
 
31
  in the X/Open CAE Specification, Distributed Transaction Processing:
 
32
  The XA Specification, X/Open Company Ltd., 1991.
 
33
  http://www.opengroup.org/bookstore/catalog/c193.htm
 
34
 
 
35
  @see XID in sql/handler.h
 
36
*/
 
37
struct st_mysql_xid {
 
38
  long formatID;
 
39
  long gtrid_length;
 
40
  long bqual_length;
 
41
  char data[DRIZZLE_XIDDATASIZE];  /* Not \0-terminated */
 
42
};
 
43
typedef struct st_mysql_xid DRIZZLE_XID;
 
44
 
30
45
/*************************************************************************
31
46
  Plugin API. Common for all plugin types.
32
47
*/
34
49
/*
35
50
  The allowable types of plugins
36
51
*/
37
 
enum drizzle_plugin_type {
38
 
  DRIZZLE_DAEMON_PLUGIN,                /* Daemon / Raw */
39
 
  DRIZZLE_STORAGE_ENGINE_PLUGIN,        /* Storage Engine */
40
 
  DRIZZLE_INFORMATION_SCHEMA_PLUGIN,    /* Information Schema */
41
 
  DRIZZLE_UDF_PLUGIN,                   /* User-Defined Function */
42
 
  DRIZZLE_UDA_PLUGIN,                   /* User-Defined Aggregate Function */
43
 
  DRIZZLE_AUDIT_PLUGIN,                 /* Audit */
44
 
  DRIZZLE_LOGGER_PLUGIN,                /* Query Logging */
45
 
  DRIZZLE_ERRMSG_PLUGIN,                /* Error Messages */
46
 
  DRIZZLE_AUTH_PLUGIN,                  /* Authorization */
47
 
  DRIZZLE_CONFIGVAR_PLUGIN,             /* Configuration Variables */
48
 
  DRIZZLE_QCACHE_PLUGIN,                /* Query Cache */
49
 
  DRIZZLE_PARSER_PLUGIN,                /* Language Parser */
50
 
  DRIZZLE_SCHEDULING_PLUGIN,            /* Thread and Session Scheduling */
51
 
  DRIZZLE_PLUGIN_MAX=DRIZZLE_SCHEDULING_PLUGIN
52
 
};
 
52
#define DRIZZLE_DAEMON_PLUGIN          0  /* Daemon / Raw */
 
53
#define DRIZZLE_STORAGE_ENGINE_PLUGIN  1  /* Storage Engine */
 
54
#define DRIZZLE_INFORMATION_SCHEMA_PLUGIN  2  /* Information Schema */
 
55
#define DRIZZLE_UDF_PLUGIN             3  /* User-Defined Function */
 
56
#define DRIZZLE_UDA_PLUGIN             4  /* User-Defined Aggregate Function */
 
57
#define DRIZZLE_AUDIT_PLUGIN           5  /* Audit */
 
58
#define DRIZZLE_LOGGER_PLUGIN          6  /* Query Logging */
 
59
#define DRIZZLE_ERRMSG_PLUGIN          7  /* Error Messages */
 
60
#define DRIZZLE_AUTH_PLUGIN            8  /* Authorization */
 
61
#define DRIZZLE_CONFIGVAR_PLUGIN       9  /* Configuration */
 
62
#define DRIZZLE_QCACHE_PLUGIN         10  /* Query Cache */
53
63
 
54
 
/* The number of plugin types */
55
 
const uint32_t DRIZZLE_MAX_PLUGIN_TYPE_NUM=DRIZZLE_PLUGIN_MAX+1;
 
64
#define DRIZZLE_MAX_PLUGIN_TYPE_NUM   11  /* The number of plugin types */
56
65
 
57
66
/* We use the following strings to define licenses for plugins */
58
 
enum plugin_license_type {
59
 
  PLUGIN_LICENSE_PROPRIETARY,
60
 
  PLUGIN_LICENSE_GPL,
61
 
  PLUGIN_LICENSE_BSD,
62
 
  PLUGIN_LICENSE_MAX=PLUGIN_LICENSE_BSD
63
 
};
 
67
#define PLUGIN_LICENSE_PROPRIETARY 0
 
68
#define PLUGIN_LICENSE_GPL 1
 
69
#define PLUGIN_LICENSE_BSD 2
64
70
 
65
 
const char * const PLUGIN_LICENSE_PROPRIETARY_STRING="PROPRIETARY";
66
 
const char * const PLUGIN_LICENSE_GPL_STRING="GPL";
67
 
const char * const PLUGIN_LICENSE_BSD_STRING="BSD";
 
71
#define PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY"
 
72
#define PLUGIN_LICENSE_GPL_STRING "GPL"
 
73
#define PLUGIN_LICENSE_BSD_STRING "BSD"
68
74
 
69
75
/*
70
76
  Macros for beginning and ending plugin declarations.  Between
105
111
 
106
112
 
107
113
#define SHOW_VAR_FUNC_BUFF_SIZE 1024
108
 
typedef int (*mysql_show_var_func)(Session *, struct st_mysql_show_var *, char *);
 
114
typedef int (*mysql_show_var_func)(THD *, struct st_mysql_show_var *, char *);
109
115
 
110
116
struct st_show_var_func_container {
111
117
  mysql_show_var_func func;
123
129
#define PLUGIN_VAR_ENUM         0x0006
124
130
#define PLUGIN_VAR_SET          0x0007
125
131
#define PLUGIN_VAR_UNSIGNED     0x0080
126
 
#define PLUGIN_VAR_SessionLOCAL     0x0100 /* Variable is per-connection */
 
132
#define PLUGIN_VAR_THDLOCAL     0x0100 /* Variable is per-connection */
127
133
#define PLUGIN_VAR_READONLY     0x0200 /* Server variable is read only */
128
134
#define PLUGIN_VAR_NOSYSVAR     0x0400 /* Not a server variable */
129
135
#define PLUGIN_VAR_NOCMDOPT     0x0800 /* Not a command line option */
138
144
/*
139
145
  SYNOPSIS
140
146
    (*mysql_var_check_func)()
141
 
      session               thread handle
 
147
      thd               thread handle
142
148
      var               dynamic variable being altered
143
149
      save              pointer to temporary storage
144
150
      value             user provided value
154
160
  automatically at the end of the statement.
155
161
*/
156
162
 
157
 
typedef int (*mysql_var_check_func)(Session *session,
 
163
typedef int (*mysql_var_check_func)(THD *thd,
158
164
                                    struct st_mysql_sys_var *var,
159
165
                                    void *save, struct st_mysql_value *value);
160
166
 
161
167
/*
162
168
  SYNOPSIS
163
169
    (*mysql_var_update_func)()
164
 
      session               thread handle
 
170
      thd               thread handle
165
171
      var               dynamic variable being altered
166
172
      var_ptr           pointer to dynamic variable
167
173
      save              pointer to temporary storage
172
178
   and persist it in the provided pointer to the dynamic variable.
173
179
   For example, strings may require memory to be allocated.
174
180
*/
175
 
typedef void (*mysql_var_update_func)(Session *session,
 
181
typedef void (*mysql_var_update_func)(THD *thd,
176
182
                                      struct st_mysql_sys_var *var,
177
183
                                      void *var_ptr, const void *save);
178
184
 
223
229
  TYPELIB *typelib;             \
224
230
} DRIZZLE_SYSVAR_NAME(name)
225
231
 
226
 
#define DECLARE_SessionVAR_FUNC(type) \
227
 
  type *(*resolve)(Session *session, int offset)
 
232
#define DECLARE_THDVAR_FUNC(type) \
 
233
  type *(*resolve)(THD *thd, int offset)
228
234
 
229
 
#define DECLARE_DRIZZLE_SessionVAR_BASIC(name, type) struct { \
 
235
#define DECLARE_DRIZZLE_THDVAR_BASIC(name, type) struct { \
230
236
  DRIZZLE_PLUGIN_VAR_HEADER;      \
231
237
  int offset;                   \
232
238
  const type def_val;           \
233
 
  DECLARE_SessionVAR_FUNC(type);    \
 
239
  DECLARE_THDVAR_FUNC(type);    \
234
240
} DRIZZLE_SYSVAR_NAME(name)
235
241
 
236
 
#define DECLARE_DRIZZLE_SessionVAR_SIMPLE(name, type) struct { \
 
242
#define DECLARE_DRIZZLE_THDVAR_SIMPLE(name, type) struct { \
237
243
  DRIZZLE_PLUGIN_VAR_HEADER;      \
238
244
  int offset;                   \
239
245
  type def_val; type min_val;   \
240
246
  type max_val; type blk_sz;    \
241
 
  DECLARE_SessionVAR_FUNC(type);    \
 
247
  DECLARE_THDVAR_FUNC(type);    \
242
248
} DRIZZLE_SYSVAR_NAME(name)
243
249
 
244
 
#define DECLARE_DRIZZLE_SessionVAR_TYPELIB(name, type) struct { \
 
250
#define DECLARE_DRIZZLE_THDVAR_TYPELIB(name, type) struct { \
245
251
  DRIZZLE_PLUGIN_VAR_HEADER;      \
246
252
  int offset;                   \
247
253
  type def_val;                 \
248
 
  DECLARE_SessionVAR_FUNC(type);    \
 
254
  DECLARE_THDVAR_FUNC(type);    \
249
255
  TYPELIB *typelib;             \
250
256
} DRIZZLE_SYSVAR_NAME(name)
251
257
 
304
310
  PLUGIN_VAR_SET | ((opt) & PLUGIN_VAR_MASK), \
305
311
  #name, comment, check, update, &varname, def, typelib }
306
312
 
307
 
#define DRIZZLE_SessionVAR_BOOL(name, opt, comment, check, update, def) \
308
 
DECLARE_DRIZZLE_SessionVAR_BASIC(name, char) = { \
309
 
  PLUGIN_VAR_BOOL | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
310
 
  #name, comment, check, update, -1, def, NULL}
311
 
 
312
 
#define DRIZZLE_SessionVAR_STR(name, opt, comment, check, update, def) \
313
 
DECLARE_DRIZZLE_SessionVAR_BASIC(name, char *) = { \
314
 
  PLUGIN_VAR_STR | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
315
 
  #name, comment, check, update, -1, def, NULL}
316
 
 
317
 
#define DRIZZLE_SessionVAR_INT(name, opt, comment, check, update, def, min, max, blk) \
318
 
DECLARE_DRIZZLE_SessionVAR_SIMPLE(name, int) = { \
319
 
  PLUGIN_VAR_INT | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
320
 
  #name, comment, check, update, -1, def, min, max, blk, NULL }
321
 
 
322
 
#define DRIZZLE_SessionVAR_UINT(name, opt, comment, check, update, def, min, max, blk) \
323
 
DECLARE_DRIZZLE_SessionVAR_SIMPLE(name, unsigned int) = { \
324
 
  PLUGIN_VAR_INT | PLUGIN_VAR_SessionLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
325
 
  #name, comment, check, update, -1, def, min, max, blk, NULL }
326
 
 
327
 
#define DRIZZLE_SessionVAR_LONG(name, opt, comment, check, update, def, min, max, blk) \
328
 
DECLARE_DRIZZLE_SessionVAR_SIMPLE(name, long) = { \
329
 
  PLUGIN_VAR_LONG | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
330
 
  #name, comment, check, update, -1, def, min, max, blk, NULL }
331
 
 
332
 
#define DRIZZLE_SessionVAR_ULONG(name, opt, comment, check, update, def, min, max, blk) \
333
 
DECLARE_DRIZZLE_SessionVAR_SIMPLE(name, unsigned long) = { \
334
 
  PLUGIN_VAR_LONG | PLUGIN_VAR_SessionLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
335
 
  #name, comment, check, update, -1, def, min, max, blk, NULL }
336
 
 
337
 
#define DRIZZLE_SessionVAR_LONGLONG(name, opt, comment, check, update, def, min, max, blk) \
338
 
DECLARE_DRIZZLE_SessionVAR_SIMPLE(name, int64_t) = { \
339
 
  PLUGIN_VAR_LONGLONG | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
340
 
  #name, comment, check, update, -1, def, min, max, blk, NULL }
341
 
 
342
 
#define DRIZZLE_SessionVAR_ULONGLONG(name, opt, comment, check, update, def, min, max, blk) \
343
 
DECLARE_DRIZZLE_SessionVAR_SIMPLE(name, uint64_t) = { \
344
 
  PLUGIN_VAR_LONGLONG | PLUGIN_VAR_SessionLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
345
 
  #name, comment, check, update, -1, def, min, max, blk, NULL }
346
 
 
347
 
#define DRIZZLE_SessionVAR_ENUM(name, opt, comment, check, update, def, typelib) \
348
 
DECLARE_DRIZZLE_SessionVAR_TYPELIB(name, unsigned long) = { \
349
 
  PLUGIN_VAR_ENUM | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
 
313
#define DRIZZLE_THDVAR_BOOL(name, opt, comment, check, update, def) \
 
314
DECLARE_DRIZZLE_THDVAR_BASIC(name, char) = { \
 
315
  PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
 
316
  #name, comment, check, update, -1, def, NULL}
 
317
 
 
318
#define DRIZZLE_THDVAR_STR(name, opt, comment, check, update, def) \
 
319
DECLARE_DRIZZLE_THDVAR_BASIC(name, char *) = { \
 
320
  PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
 
321
  #name, comment, check, update, -1, def, NULL}
 
322
 
 
323
#define DRIZZLE_THDVAR_INT(name, opt, comment, check, update, def, min, max, blk) \
 
324
DECLARE_DRIZZLE_THDVAR_SIMPLE(name, int) = { \
 
325
  PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
 
326
  #name, comment, check, update, -1, def, min, max, blk, NULL }
 
327
 
 
328
#define DRIZZLE_THDVAR_UINT(name, opt, comment, check, update, def, min, max, blk) \
 
329
DECLARE_DRIZZLE_THDVAR_SIMPLE(name, unsigned int) = { \
 
330
  PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
 
331
  #name, comment, check, update, -1, def, min, max, blk, NULL }
 
332
 
 
333
#define DRIZZLE_THDVAR_LONG(name, opt, comment, check, update, def, min, max, blk) \
 
334
DECLARE_DRIZZLE_THDVAR_SIMPLE(name, long) = { \
 
335
  PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
 
336
  #name, comment, check, update, -1, def, min, max, blk, NULL }
 
337
 
 
338
#define DRIZZLE_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, blk) \
 
339
DECLARE_DRIZZLE_THDVAR_SIMPLE(name, unsigned long) = { \
 
340
  PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
 
341
  #name, comment, check, update, -1, def, min, max, blk, NULL }
 
342
 
 
343
#define DRIZZLE_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, max, blk) \
 
344
DECLARE_DRIZZLE_THDVAR_SIMPLE(name, int64_t) = { \
 
345
  PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
 
346
  #name, comment, check, update, -1, def, min, max, blk, NULL }
 
347
 
 
348
#define DRIZZLE_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, max, blk) \
 
349
DECLARE_DRIZZLE_THDVAR_SIMPLE(name, uint64_t) = { \
 
350
  PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
 
351
  #name, comment, check, update, -1, def, min, max, blk, NULL }
 
352
 
 
353
#define DRIZZLE_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) \
 
354
DECLARE_DRIZZLE_THDVAR_TYPELIB(name, unsigned long) = { \
 
355
  PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
350
356
  #name, comment, check, update, -1, def, NULL, typelib }
351
357
 
352
 
#define DRIZZLE_SessionVAR_SET(name, opt, comment, check, update, def, typelib) \
353
 
DECLARE_DRIZZLE_SessionVAR_TYPELIB(name, uint64_t) = { \
354
 
  PLUGIN_VAR_SET | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
 
358
#define DRIZZLE_THDVAR_SET(name, opt, comment, check, update, def, typelib) \
 
359
DECLARE_DRIZZLE_THDVAR_TYPELIB(name, uint64_t) = { \
 
360
  PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
355
361
  #name, comment, check, update, -1, def, NULL, typelib }
356
362
 
357
363
/* accessor macros */
359
365
#define SYSVAR(name) \
360
366
  (*(DRIZZLE_SYSVAR_NAME(name).value))
361
367
 
362
 
/* when session == null, result points to global value */
363
 
#define SessionVAR(session, name) \
364
 
  (*(DRIZZLE_SYSVAR_NAME(name).resolve(session, DRIZZLE_SYSVAR_NAME(name).offset)))
 
368
/* when thd == null, result points to global value */
 
369
#define THDVAR(thd, name) \
 
370
  (*(DRIZZLE_SYSVAR_NAME(name).resolve(thd, DRIZZLE_SYSVAR_NAME(name).offset)))
365
371
 
366
372
 
367
373
/*
370
376
 
371
377
struct st_mysql_plugin
372
378
{
373
 
  uint32_t type;        /* the plugin type (a DRIZZLE_XXX_PLUGIN value)   */
 
379
  int type;             /* the plugin type (a DRIZZLE_XXX_PLUGIN value)   */
374
380
  const char *name;     /* plugin name (for SHOW PLUGINS)               */
375
381
  const char *version;  /* plugin version (for SHOW PLUGINS)            */
376
382
  const char *author;   /* plugin author (for SHOW PLUGINS)             */
417
423
extern "C" {
418
424
#endif
419
425
 
420
 
int session_in_lock_tables(const Session *session);
421
 
int session_tablespace_op(const Session *session);
422
 
void set_session_proc_info(Session *session, const char *info);
423
 
const char *get_session_proc_info(Session *session);
424
 
int64_t session_test_options(const Session *session, int64_t test_options);
425
 
int session_sql_command(const Session *session);
426
 
void **session_ha_data(const Session *session, const struct handlerton *hton);
427
 
int session_tx_isolation(const Session *session);
428
 
/* Increments the row counter, see Session::row_count */
429
 
void session_inc_row_count(Session *session);
430
 
 
431
 
LEX_STRING *session_make_lex_string(Session *session, LEX_STRING *lex_str,
432
 
                                    const char *str, unsigned int size,
433
 
                                    int allocate_lex_string);
434
 
 
435
 
 
 
426
int thd_in_lock_tables(const THD *thd);
 
427
int thd_tablespace_op(const THD *thd);
 
428
int64_t thd_test_options(const THD *thd, int64_t test_options);
 
429
int thd_sql_command(const THD *thd);
 
430
void **thd_ha_data(const THD *thd, const struct handlerton *hton);
 
431
int thd_tx_isolation(const THD *thd);
 
432
/* Increments the row counter, see THD::row_count */
 
433
void thd_inc_row_count(THD *thd);
436
434
 
437
435
/**
438
436
  Create a temporary file.
458
456
  time-consuming loops, and gracefully abort the operation if it is
459
457
  non-zero.
460
458
 
461
 
  @param session  user thread connection handle
 
459
  @param thd  user thread connection handle
462
460
  @retval 0  the connection is active
463
461
  @retval 1  the connection has been killed
464
462
*/
465
 
int session_killed(const Session *session);
 
463
int thd_killed(const THD *thd);
466
464
 
467
465
 
468
466
/**
469
467
  Return the thread id of a user thread
470
468
 
471
 
  @param session  user thread connection handle
 
469
  @param thd  user thread connection handle
472
470
  @return  thread id
473
471
*/
474
 
unsigned long session_get_thread_id(const Session *session);
 
472
unsigned long thd_get_thread_id(const THD *thd);
475
473
 
476
474
 
477
475
/**
486
484
 
487
485
  @see alloc_root()
488
486
*/
489
 
void *session_alloc(Session *session, unsigned int size);
490
 
/**
491
 
  @see session_alloc()
492
 
*/
493
 
void *session_calloc(Session *session, unsigned int size);
494
 
/**
495
 
  @see session_alloc()
496
 
*/
497
 
char *session_strdup(Session *session, const char *str);
498
 
/**
499
 
  @see session_alloc()
500
 
*/
501
 
char *session_strmake(Session *session, const char *str, unsigned int size);
502
 
/**
503
 
  @see session_alloc()
504
 
*/
505
 
void *session_memdup(Session *session, const void* str, unsigned int size);
 
487
void *thd_alloc(THD *thd, unsigned int size);
 
488
/**
 
489
  @see thd_alloc()
 
490
*/
 
491
void *thd_calloc(THD *thd, unsigned int size);
 
492
/**
 
493
  @see thd_alloc()
 
494
*/
 
495
char *thd_strdup(THD *thd, const char *str);
 
496
/**
 
497
  @see thd_alloc()
 
498
*/
 
499
char *thd_strmake(THD *thd, const char *str, unsigned int size);
 
500
/**
 
501
  @see thd_alloc()
 
502
*/
 
503
void *thd_memdup(THD *thd, const void* str, unsigned int size);
506
504
 
507
505
/**
508
506
  Get the XID for this connection's transaction
509
507
 
510
 
  @param session  user thread connection handle
 
508
  @param thd  user thread connection handle
511
509
  @param xid  location where identifier is stored
512
510
*/
513
 
void session_get_xid(const Session *session, DRIZZLE_XID *xid);
 
511
void thd_get_xid(const THD *thd, DRIZZLE_XID *xid);
514
512
 
515
513
/**
516
514
  Invalidate the query cache for a given table.
517
515
 
518
 
  @param session         user thread connection handle
 
516
  @param thd         user thread connection handle
519
517
  @param key         databasename\\0tablename\\0
520
518
  @param key_length  length of key in bytes, including the NUL bytes
521
519
  @param using_trx   flag: TRUE if using transactions, FALSE otherwise
522
520
*/
523
 
void mysql_query_cache_invalidate4(Session *session,
 
521
void mysql_query_cache_invalidate4(THD *thd,
524
522
                                   const char *key, unsigned int key_length,
525
523
                                   int using_trx);
526
524
 
534
532
*/
535
533
inline
536
534
void *
537
 
session_get_ha_data(const Session *session, const struct handlerton *hton)
 
535
thd_get_ha_data(const THD *thd, const struct handlerton *hton)
538
536
{
539
 
  return *session_ha_data(session, hton);
 
537
  return *thd_ha_data(thd, hton);
540
538
}
541
539
 
542
540
/**
544
542
*/
545
543
inline
546
544
void
547
 
session_set_ha_data(const Session *session, const struct handlerton *hton,
 
545
thd_set_ha_data(const THD *thd, const struct handlerton *hton,
548
546
                const void *ha_data)
549
547
{
550
 
  *session_ha_data(session, hton)= (void*) ha_data;
 
548
  *thd_ha_data(thd, hton)= (void*) ha_data;
551
549
}
552
550
#endif
553
551