~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/i_s.cc

  • Committer: Brian Aker
  • Date: 2009-06-16 00:53:22 UTC
  • mto: This revision was merged to the branch mainline in revision 1094.
  • Revision ID: brian@gaz-20090616005322-w0ode4jul9z8s2y9
Partial fix for tests for tmp

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include <drizzled/plugin.h>
32
32
#include <drizzled/field.h>
33
33
#include <drizzled/table.h>
34
 
#include <drizzled/info_schema.h>
35
34
 
36
35
#include "i_s.h"
37
36
 
76
75
InfoSchemaTable *innodb_cmpmem_schema_table= NULL;
77
76
InfoSchemaTable *innodb_cmpmem_reset_schema_table= NULL;
78
77
 
79
 
static TrxISMethods trx_methods;
80
 
static CmpISMethods cmp_methods;
81
 
static CmpResetISMethods cmp_reset_methods;
82
 
static CmpmemISMethods cmpmem_methods;
83
 
static CmpmemResetISMethods cmpmem_reset_methods;
 
78
static const ST_FIELD_INFO END_OF_ST_FIELD_INFO =
 
79
        {STRUCT_FLD(field_name,         NULL),
 
80
         STRUCT_FLD(field_length,       0),
 
81
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_NULL),
 
82
         STRUCT_FLD(value,              0),
 
83
         STRUCT_FLD(field_flags,        0),
 
84
         STRUCT_FLD(old_name,           ""),
 
85
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)};
84
86
 
85
87
/*
86
88
Use the following types mapping:
115
117
void localtime_to_TIME(DRIZZLE_TIME *to, struct tm *from);
116
118
 
117
119
/***********************************************************************
 
120
Common function to fill any of the dynamic tables:
 
121
INFORMATION_SCHEMA.innodb_trx
 
122
INFORMATION_SCHEMA.innodb_locks
 
123
INFORMATION_SCHEMA.innodb_lock_waits */
 
124
static
 
125
int
 
126
trx_i_s_common_fill_table(
 
127
/*======================*/
 
128
                                /* out: 0 on success */
 
129
        Session*                session,        /* in: thread */
 
130
        TableList*      tables, /* in/out: tables to fill */
 
131
        COND*           cond);  /* in: condition (not used) */
 
132
 
 
133
/***********************************************************************
118
134
Unbind a dynamic INFORMATION_SCHEMA table. */
119
135
 
120
136
/***********************************************************************
199
215
}
200
216
 
201
217
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_trx */
202
 
static ColumnInfo       innodb_trx_fields_info[] =
 
218
static ST_FIELD_INFO    innodb_trx_fields_info[] =
203
219
{
204
220
#define IDX_TRX_ID              0
205
 
        ColumnInfo("trx_id",
206
 
                  TRX_ID_MAX_LEN + 1,
207
 
                  DRIZZLE_TYPE_VARCHAR,
208
 
                  0,
209
 
                  0,
210
 
                  "",
211
 
                  SKIP_OPEN_TABLE),
 
221
        {STRUCT_FLD(field_name,         "trx_id"),
 
222
         STRUCT_FLD(field_length,       TRX_ID_MAX_LEN + 1),
 
223
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
224
         STRUCT_FLD(value,              0),
 
225
         STRUCT_FLD(field_flags,        0),
 
226
         STRUCT_FLD(old_name,           ""),
 
227
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
212
228
 
213
229
#define IDX_TRX_STATE           1
214
 
        ColumnInfo("trx_state",
215
 
                  TRX_QUE_STATE_STR_MAX_LEN + 1,
216
 
                  DRIZZLE_TYPE_VARCHAR,
217
 
                  0,
218
 
                  0,
219
 
                  "",
220
 
                  SKIP_OPEN_TABLE),
 
230
        {STRUCT_FLD(field_name,         "trx_state"),
 
231
         STRUCT_FLD(field_length,       TRX_QUE_STATE_STR_MAX_LEN + 1),
 
232
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
233
         STRUCT_FLD(value,              0),
 
234
         STRUCT_FLD(field_flags,        0),
 
235
         STRUCT_FLD(old_name,           ""),
 
236
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
221
237
 
222
238
#define IDX_TRX_STARTED         2
223
 
        ColumnInfo("trx_started",
224
 
                  0,
225
 
                  DRIZZLE_TYPE_DATETIME,
226
 
                  0,
227
 
                  0,
228
 
                  "",
229
 
                  SKIP_OPEN_TABLE),
 
239
        {STRUCT_FLD(field_name,         "trx_started"),
 
240
         STRUCT_FLD(field_length,       0),
 
241
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_DATETIME),
 
242
         STRUCT_FLD(value,              0),
 
243
         STRUCT_FLD(field_flags,        0),
 
244
         STRUCT_FLD(old_name,           ""),
 
245
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
230
246
 
231
247
#define IDX_TRX_REQUESTED_LOCK_ID       3
232
 
        ColumnInfo("trx_requested_lock_id",
233
 
                  TRX_I_S_LOCK_ID_MAX_LEN + 1,
234
 
                  DRIZZLE_TYPE_VARCHAR,
235
 
                  0,
236
 
                  MY_I_S_MAYBE_NULL,
237
 
                  "",
238
 
                  SKIP_OPEN_TABLE),
 
248
        {STRUCT_FLD(field_name,         "trx_requested_lock_id"),
 
249
         STRUCT_FLD(field_length,       TRX_I_S_LOCK_ID_MAX_LEN + 1),
 
250
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
251
         STRUCT_FLD(value,              0),
 
252
         STRUCT_FLD(field_flags,        MY_I_S_MAYBE_NULL),
 
253
         STRUCT_FLD(old_name,           ""),
 
254
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
239
255
 
240
256
#define IDX_TRX_WAIT_STARTED    4
241
 
        ColumnInfo("trx_wait_started",
242
 
                  0,
243
 
                  DRIZZLE_TYPE_DATETIME,
244
 
                  0,
245
 
                  MY_I_S_MAYBE_NULL,
246
 
                  "",
247
 
                  SKIP_OPEN_TABLE),
 
257
        {STRUCT_FLD(field_name,         "trx_wait_started"),
 
258
         STRUCT_FLD(field_length,       0),
 
259
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_DATETIME),
 
260
         STRUCT_FLD(value,              0),
 
261
         STRUCT_FLD(field_flags,        MY_I_S_MAYBE_NULL),
 
262
         STRUCT_FLD(old_name,           ""),
 
263
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
248
264
 
249
265
#define IDX_TRX_WEIGHT          5
250
 
        ColumnInfo("trx_weight",
251
 
                  MY_INT64_NUM_DECIMAL_DIGITS,
252
 
                  DRIZZLE_TYPE_LONGLONG,
253
 
                  0,
254
 
                  MY_I_S_UNSIGNED,
255
 
                  "",
256
 
                  SKIP_OPEN_TABLE),
 
266
        {STRUCT_FLD(field_name,         "trx_weight"),
 
267
         STRUCT_FLD(field_length,       MY_INT64_NUM_DECIMAL_DIGITS),
 
268
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONGLONG),
 
269
         STRUCT_FLD(value,              0),
 
270
         STRUCT_FLD(field_flags,        MY_I_S_UNSIGNED),
 
271
         STRUCT_FLD(old_name,           ""),
 
272
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
257
273
 
258
274
#define IDX_TRX_DRIZZLE_THREAD_ID       6
259
 
        ColumnInfo("trx_mysql_thread_id",
260
 
                  MY_INT64_NUM_DECIMAL_DIGITS,
261
 
                  DRIZZLE_TYPE_LONGLONG,
262
 
                  0,
263
 
                  MY_I_S_UNSIGNED,
264
 
                  "",
265
 
                  SKIP_OPEN_TABLE),
 
275
        {STRUCT_FLD(field_name,         "trx_mysql_thread_id"),
 
276
         STRUCT_FLD(field_length,       MY_INT64_NUM_DECIMAL_DIGITS),
 
277
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONGLONG),
 
278
         STRUCT_FLD(value,              0),
 
279
         STRUCT_FLD(field_flags,        MY_I_S_UNSIGNED),
 
280
         STRUCT_FLD(old_name,           ""),
 
281
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
266
282
 
267
283
#define IDX_TRX_QUERY           7
268
 
        ColumnInfo("trx_query",
269
 
                  TRX_I_S_TRX_QUERY_MAX_LEN,
270
 
                  DRIZZLE_TYPE_VARCHAR,
271
 
                  0,
272
 
                  MY_I_S_MAYBE_NULL,
273
 
                  "",
274
 
                  SKIP_OPEN_TABLE),
 
284
        {STRUCT_FLD(field_name,         "trx_query"),
 
285
         STRUCT_FLD(field_length,       TRX_I_S_TRX_QUERY_MAX_LEN),
 
286
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
287
         STRUCT_FLD(value,              0),
 
288
         STRUCT_FLD(field_flags,        MY_I_S_MAYBE_NULL),
 
289
         STRUCT_FLD(old_name,           ""),
 
290
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
275
291
 
276
 
        ColumnInfo()
 
292
        END_OF_ST_FIELD_INFO
277
293
};
278
294
 
279
295
/***********************************************************************
369
385
{
370
386
        if ((innodb_trx_schema_table= new InfoSchemaTable) == NULL)
371
387
                return(1);
 
388
        memset(innodb_trx_schema_table, 0, sizeof(InfoSchemaTable));
372
389
 
373
 
        innodb_trx_schema_table->setColumnInfo(innodb_trx_fields_info);
374
 
        innodb_trx_schema_table->setInfoSchemaMethods(&trx_methods);
 
390
        innodb_trx_schema_table->setFieldsInfo(innodb_trx_fields_info);
 
391
        innodb_trx_schema_table->fill_table = trx_i_s_common_fill_table;
375
392
        innodb_trx_schema_table->setTableName("INNODB_TRX");
376
393
 
377
394
        return(0);
379
396
 
380
397
 
381
398
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_locks */
382
 
static ColumnInfo innodb_locks_fields_info[] =
 
399
static ST_FIELD_INFO    innodb_locks_fields_info[] =
383
400
{
384
401
#define IDX_LOCK_ID             0
385
 
        ColumnInfo("lock_id",
386
 
                  TRX_I_S_LOCK_ID_MAX_LEN + 1,
387
 
                  DRIZZLE_TYPE_VARCHAR,
388
 
                  0,
389
 
                  0,
390
 
                  "",
391
 
                  SKIP_OPEN_TABLE),
 
402
        {STRUCT_FLD(field_name,         "lock_id"),
 
403
         STRUCT_FLD(field_length,       TRX_I_S_LOCK_ID_MAX_LEN + 1),
 
404
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
405
         STRUCT_FLD(value,              0),
 
406
         STRUCT_FLD(field_flags,        0),
 
407
         STRUCT_FLD(old_name,           ""),
 
408
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
392
409
 
393
410
#define IDX_LOCK_TRX_ID         1
394
 
        ColumnInfo("lock_trx_id",
395
 
                  TRX_ID_MAX_LEN + 1,
396
 
                  DRIZZLE_TYPE_VARCHAR,
397
 
                  0,
398
 
                  0,
399
 
                  "",
400
 
                  SKIP_OPEN_TABLE),
 
411
        {STRUCT_FLD(field_name,         "lock_trx_id"),
 
412
         STRUCT_FLD(field_length,       TRX_ID_MAX_LEN + 1),
 
413
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
414
         STRUCT_FLD(value,              0),
 
415
         STRUCT_FLD(field_flags,        0),
 
416
         STRUCT_FLD(old_name,           ""),
 
417
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
401
418
 
402
419
#define IDX_LOCK_MODE           2
403
 
        ColumnInfo("lock_mode",
 
420
        {STRUCT_FLD(field_name,         "lock_mode"),
404
421
         /* S[,GAP] X[,GAP] IS[,GAP] IX[,GAP] AUTO_INC UNKNOWN */
405
 
                  32,
406
 
                  DRIZZLE_TYPE_VARCHAR,
407
 
                  0,
408
 
                  0,
409
 
                  "",
410
 
                  SKIP_OPEN_TABLE),
 
422
         STRUCT_FLD(field_length,       32),
 
423
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
424
         STRUCT_FLD(value,              0),
 
425
         STRUCT_FLD(field_flags,        0),
 
426
         STRUCT_FLD(old_name,           ""),
 
427
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
411
428
 
412
429
#define IDX_LOCK_TYPE           3
413
 
        ColumnInfo("lock_type",
414
 
                  32, /* RECORD|TABLE|UNKNOWN */
415
 
                  DRIZZLE_TYPE_VARCHAR,
416
 
                  0,
417
 
                  0,
418
 
                  "",
419
 
                  SKIP_OPEN_TABLE),
 
430
        {STRUCT_FLD(field_name,         "lock_type"),
 
431
         STRUCT_FLD(field_length,       32 /* RECORD|TABLE|UNKNOWN */),
 
432
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
433
         STRUCT_FLD(value,              0),
 
434
         STRUCT_FLD(field_flags,        0),
 
435
         STRUCT_FLD(old_name,           ""),
 
436
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
420
437
 
421
438
#define IDX_LOCK_TABLE          4
422
 
        ColumnInfo("lock_table",
423
 
                  1024,
424
 
                  DRIZZLE_TYPE_VARCHAR,
425
 
                  0,
426
 
                  0,
427
 
                  "",
428
 
                  SKIP_OPEN_TABLE),
 
439
        {STRUCT_FLD(field_name,         "lock_table"),
 
440
         STRUCT_FLD(field_length,       1024),
 
441
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
442
         STRUCT_FLD(value,              0),
 
443
         STRUCT_FLD(field_flags,        0),
 
444
         STRUCT_FLD(old_name,           ""),
 
445
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
429
446
 
430
447
#define IDX_LOCK_INDEX          5
431
 
        ColumnInfo("lock_index",
432
 
                  1024,
433
 
                  DRIZZLE_TYPE_VARCHAR,
434
 
                  0,
435
 
                  MY_I_S_MAYBE_NULL,
436
 
                  "",
437
 
                  SKIP_OPEN_TABLE),
 
448
        {STRUCT_FLD(field_name,         "lock_index"),
 
449
         STRUCT_FLD(field_length,       1024),
 
450
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
451
         STRUCT_FLD(value,              0),
 
452
         STRUCT_FLD(field_flags,        MY_I_S_MAYBE_NULL),
 
453
         STRUCT_FLD(old_name,           ""),
 
454
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
438
455
 
439
456
#define IDX_LOCK_SPACE          6
440
 
        ColumnInfo("lock_space",
441
 
                  MY_INT64_NUM_DECIMAL_DIGITS,
442
 
                  DRIZZLE_TYPE_LONGLONG,
443
 
                  0,
444
 
                  MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL,
445
 
                  "",
446
 
                  SKIP_OPEN_TABLE),
 
457
        {STRUCT_FLD(field_name,         "lock_space"),
 
458
         STRUCT_FLD(field_length,       MY_INT64_NUM_DECIMAL_DIGITS),
 
459
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONGLONG),
 
460
         STRUCT_FLD(value,              0),
 
461
         STRUCT_FLD(field_flags,        MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
 
462
         STRUCT_FLD(old_name,           ""),
 
463
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
447
464
 
448
465
#define IDX_LOCK_PAGE           7
449
 
        ColumnInfo("lock_page",
450
 
                  MY_INT64_NUM_DECIMAL_DIGITS,
451
 
                  DRIZZLE_TYPE_LONGLONG,
452
 
                  0,
453
 
                  MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL,
454
 
                  "",
455
 
                  SKIP_OPEN_TABLE),
 
466
        {STRUCT_FLD(field_name,         "lock_page"),
 
467
         STRUCT_FLD(field_length,       MY_INT64_NUM_DECIMAL_DIGITS),
 
468
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONGLONG),
 
469
         STRUCT_FLD(value,              0),
 
470
         STRUCT_FLD(field_flags,        MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
 
471
         STRUCT_FLD(old_name,           ""),
 
472
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
456
473
 
457
474
#define IDX_LOCK_REC            8
458
 
        ColumnInfo("lock_rec",
459
 
                  MY_INT64_NUM_DECIMAL_DIGITS,
460
 
                  DRIZZLE_TYPE_LONGLONG,
461
 
                  0,
462
 
                  MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL,
463
 
                  "",
464
 
                  SKIP_OPEN_TABLE),
 
475
        {STRUCT_FLD(field_name,         "lock_rec"),
 
476
         STRUCT_FLD(field_length,       MY_INT64_NUM_DECIMAL_DIGITS),
 
477
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONGLONG),
 
478
         STRUCT_FLD(value,              0),
 
479
         STRUCT_FLD(field_flags,        MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
 
480
         STRUCT_FLD(old_name,           ""),
 
481
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
465
482
 
466
483
#define IDX_LOCK_DATA           9
467
 
        ColumnInfo("lock_data",
468
 
                  TRX_I_S_LOCK_DATA_MAX_LEN,
469
 
                  DRIZZLE_TYPE_VARCHAR,
470
 
                  0,
471
 
                  MY_I_S_MAYBE_NULL,
472
 
                  "",
473
 
                  SKIP_OPEN_TABLE),
 
484
        {STRUCT_FLD(field_name,         "lock_data"),
 
485
         STRUCT_FLD(field_length,       TRX_I_S_LOCK_DATA_MAX_LEN),
 
486
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
487
         STRUCT_FLD(value,              0),
 
488
         STRUCT_FLD(field_flags,        MY_I_S_MAYBE_NULL),
 
489
         STRUCT_FLD(old_name,           ""),
 
490
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
474
491
 
475
 
        ColumnInfo()
 
492
        END_OF_ST_FIELD_INFO
476
493
};
477
494
 
478
495
/***********************************************************************
592
609
 
593
610
        if ((innodb_locks_schema_table= new InfoSchemaTable) == NULL)
594
611
                return(1);
 
612
        memset(innodb_locks_schema_table, 0, sizeof(InfoSchemaTable));
595
613
 
596
 
        innodb_locks_schema_table->setColumnInfo(innodb_locks_fields_info);
597
 
        innodb_locks_schema_table->setInfoSchemaMethods(&trx_methods);
 
614
        innodb_locks_schema_table->setFieldsInfo(innodb_locks_fields_info);
 
615
        innodb_locks_schema_table->fill_table = trx_i_s_common_fill_table;
598
616
        innodb_locks_schema_table->setTableName("INNODB_LOCKS");
599
617
        return(0);
600
618
}
601
619
 
602
620
 
603
621
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
604
 
static ColumnInfo innodb_lock_waits_fields_info[] =
 
622
static ST_FIELD_INFO    innodb_lock_waits_fields_info[] =
605
623
{
606
624
#define IDX_REQUESTING_TRX_ID   0
607
 
        ColumnInfo("requesting_trx_id",
608
 
                  TRX_ID_MAX_LEN + 1,
609
 
                  DRIZZLE_TYPE_VARCHAR,
610
 
                  0,
611
 
                  0,
612
 
                  "",
613
 
                  SKIP_OPEN_TABLE),
 
625
        {STRUCT_FLD(field_name,         "requesting_trx_id"),
 
626
         STRUCT_FLD(field_length,       TRX_ID_MAX_LEN + 1),
 
627
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
628
         STRUCT_FLD(value,              0),
 
629
         STRUCT_FLD(field_flags,        0),
 
630
         STRUCT_FLD(old_name,           ""),
 
631
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
614
632
 
615
633
#define IDX_REQUESTED_LOCK_ID   1
616
 
        ColumnInfo("requested_lock_id",
617
 
                  TRX_I_S_LOCK_ID_MAX_LEN + 1,
618
 
                  DRIZZLE_TYPE_VARCHAR,
619
 
                  0,
620
 
                  0,
621
 
                  "",
622
 
                  SKIP_OPEN_TABLE),
 
634
        {STRUCT_FLD(field_name,         "requested_lock_id"),
 
635
         STRUCT_FLD(field_length,       TRX_I_S_LOCK_ID_MAX_LEN + 1),
 
636
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
637
         STRUCT_FLD(value,              0),
 
638
         STRUCT_FLD(field_flags,        0),
 
639
         STRUCT_FLD(old_name,           ""),
 
640
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
623
641
 
624
642
#define IDX_BLOCKING_TRX_ID     2
625
 
        ColumnInfo("blocking_trx_id",
626
 
                  TRX_ID_MAX_LEN + 1,
627
 
                  DRIZZLE_TYPE_VARCHAR,
628
 
                  0,
629
 
                  0,
630
 
                  "",
631
 
                  SKIP_OPEN_TABLE),
 
643
        {STRUCT_FLD(field_name,         "blocking_trx_id"),
 
644
         STRUCT_FLD(field_length,       TRX_ID_MAX_LEN + 1),
 
645
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
646
         STRUCT_FLD(value,              0),
 
647
         STRUCT_FLD(field_flags,        0),
 
648
         STRUCT_FLD(old_name,           ""),
 
649
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
632
650
 
633
651
#define IDX_BLOCKING_LOCK_ID    3
634
 
        ColumnInfo("blocking_lock_id",
635
 
                  TRX_I_S_LOCK_ID_MAX_LEN + 1,
636
 
                  DRIZZLE_TYPE_VARCHAR,
637
 
                  0,
638
 
                  0,
639
 
                  "",
640
 
                  SKIP_OPEN_TABLE),
 
652
        {STRUCT_FLD(field_name,         "blocking_lock_id"),
 
653
         STRUCT_FLD(field_length,       TRX_I_S_LOCK_ID_MAX_LEN + 1),
 
654
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_VARCHAR),
 
655
         STRUCT_FLD(value,              0),
 
656
         STRUCT_FLD(field_flags,        0),
 
657
         STRUCT_FLD(old_name,           ""),
 
658
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
641
659
 
642
 
        ColumnInfo()
 
660
        END_OF_ST_FIELD_INFO
643
661
};
644
662
 
645
663
/***********************************************************************
722
740
 
723
741
        if ((innodb_lock_waits_schema_table= new InfoSchemaTable) == NULL)
724
742
                return(1);
 
743
        memset(innodb_lock_waits_schema_table, 0, sizeof(InfoSchemaTable));
725
744
 
726
 
        innodb_lock_waits_schema_table->setColumnInfo(innodb_lock_waits_fields_info);
727
 
        innodb_lock_waits_schema_table->setInfoSchemaMethods(&trx_methods);
 
745
        innodb_lock_waits_schema_table->setFieldsInfo(innodb_lock_waits_fields_info);
 
746
        innodb_lock_waits_schema_table->fill_table = trx_i_s_common_fill_table;
728
747
        innodb_lock_waits_schema_table->setTableName("INNODB_LOCK_WAITS");
729
748
 
730
749
 
737
756
INFORMATION_SCHEMA.innodb_trx
738
757
INFORMATION_SCHEMA.innodb_locks
739
758
INFORMATION_SCHEMA.innodb_lock_waits */
 
759
static
740
760
int
741
 
TrxISMethods::fillTable(
 
761
trx_i_s_common_fill_table(
742
762
/*======================*/
743
763
                                /* out: 0 on success */
744
764
        Session*                session,        /* in: thread */
827
847
}
828
848
 
829
849
/* Fields of the dynamic table information_schema.innodb_cmp. */
830
 
static ColumnInfo       i_s_cmp_fields_info[] =
 
850
static ST_FIELD_INFO    i_s_cmp_fields_info[] =
831
851
{
832
 
        ColumnInfo("page_size",
833
 
                  5,
834
 
                  DRIZZLE_TYPE_LONG,
835
 
                  0,
836
 
                  0,
837
 
                  "Compressed Page Size",
838
 
                  SKIP_OPEN_TABLE),
839
 
 
840
 
        ColumnInfo("compress_ops",
841
 
                  MY_INT32_NUM_DECIMAL_DIGITS,
842
 
                  DRIZZLE_TYPE_LONG,
843
 
                  0,
844
 
                  0,
845
 
                  "Total Number of Compressions",
846
 
                  SKIP_OPEN_TABLE),
847
 
 
848
 
        ColumnInfo("compress_ops_ok",
849
 
                  MY_INT32_NUM_DECIMAL_DIGITS,
850
 
                  DRIZZLE_TYPE_LONG,
851
 
                  0,
852
 
                  0,
853
 
                  "Total Number of Successful Compressions",
854
 
                  SKIP_OPEN_TABLE),
855
 
 
856
 
        ColumnInfo("compress_time",
857
 
                  MY_INT32_NUM_DECIMAL_DIGITS,
858
 
                  DRIZZLE_TYPE_LONG,
859
 
                  0,
860
 
                  0,
861
 
                  "Total Duration of Compressions in Seconds",
862
 
                  SKIP_OPEN_TABLE),
863
 
 
864
 
        ColumnInfo("uncompress_ops",
865
 
                  MY_INT32_NUM_DECIMAL_DIGITS,
866
 
                  DRIZZLE_TYPE_LONG,
867
 
                  0,
868
 
                  0,
869
 
                  "Total Number of Decompressions",
870
 
                  SKIP_OPEN_TABLE),
871
 
 
872
 
        ColumnInfo("uncompress_time",
873
 
                  MY_INT32_NUM_DECIMAL_DIGITS,
874
 
                  DRIZZLE_TYPE_LONG,
875
 
                  0,
876
 
                  0,
877
 
                  "Total Duration of Decompressions in Seconds",
878
 
                  SKIP_OPEN_TABLE),
879
 
 
880
 
        ColumnInfo()
 
852
        {STRUCT_FLD(field_name,         "page_size"),
 
853
         STRUCT_FLD(field_length,       5),
 
854
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONG),
 
855
         STRUCT_FLD(value,              0),
 
856
         STRUCT_FLD(field_flags,        0),
 
857
         STRUCT_FLD(old_name,           "Compressed Page Size"),
 
858
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
 
859
 
 
860
        {STRUCT_FLD(field_name,         "compress_ops"),
 
861
         STRUCT_FLD(field_length,       MY_INT32_NUM_DECIMAL_DIGITS),
 
862
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONG),
 
863
         STRUCT_FLD(value,              0),
 
864
         STRUCT_FLD(field_flags,        0),
 
865
         STRUCT_FLD(old_name,           "Total Number of Compressions"),
 
866
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
 
867
 
 
868
        {STRUCT_FLD(field_name,         "compress_ops_ok"),
 
869
         STRUCT_FLD(field_length,       MY_INT32_NUM_DECIMAL_DIGITS),
 
870
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONG),
 
871
         STRUCT_FLD(value,              0),
 
872
         STRUCT_FLD(field_flags,        0),
 
873
         STRUCT_FLD(old_name,           "Total Number of"
 
874
                                        " Successful Compressions"),
 
875
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
 
876
 
 
877
        {STRUCT_FLD(field_name,         "compress_time"),
 
878
         STRUCT_FLD(field_length,       MY_INT32_NUM_DECIMAL_DIGITS),
 
879
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONG),
 
880
         STRUCT_FLD(value,              0),
 
881
         STRUCT_FLD(field_flags,        0),
 
882
         STRUCT_FLD(old_name,           "Total Duration of Compressions,"
 
883
                    " in Seconds"),
 
884
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
 
885
 
 
886
        {STRUCT_FLD(field_name,         "uncompress_ops"),
 
887
         STRUCT_FLD(field_length,       MY_INT32_NUM_DECIMAL_DIGITS),
 
888
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONG),
 
889
         STRUCT_FLD(value,              0),
 
890
         STRUCT_FLD(field_flags,        0),
 
891
         STRUCT_FLD(old_name,           "Total Number of Decompressions"),
 
892
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
 
893
 
 
894
        {STRUCT_FLD(field_name,         "uncompress_time"),
 
895
         STRUCT_FLD(field_length,       MY_INT32_NUM_DECIMAL_DIGITS),
 
896
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONG),
 
897
         STRUCT_FLD(value,              0),
 
898
         STRUCT_FLD(field_flags,        0),
 
899
         STRUCT_FLD(old_name,           "Total Duration of Decompressions,"
 
900
                    " in Seconds"),
 
901
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
 
902
 
 
903
        END_OF_ST_FIELD_INFO
881
904
};
882
905
 
883
906
 
934
957
 
935
958
/***********************************************************************
936
959
Fill the dynamic table information_schema.innodb_cmp. */
 
960
static
937
961
int
938
 
CmpISMethods::fillTable(
 
962
i_s_cmp_fill(
939
963
/*=========*/
940
964
                                /* out: 0 on success, 1 on failure */
941
965
        Session*                session,        /* in: thread */
947
971
 
948
972
/***********************************************************************
949
973
Fill the dynamic table information_schema.innodb_cmp_reset. */
 
974
static
950
975
int
951
 
CmpResetISMethods::fillTable(
 
976
i_s_cmp_reset_fill(
952
977
/*===============*/
953
978
                                /* out: 0 on success, 1 on failure */
954
979
        Session*                session,        /* in: thread */
970
995
 
971
996
        if ((innodb_cmp_schema_table= new InfoSchemaTable) == NULL)
972
997
                return(1);
973
 
 
974
 
        innodb_cmp_schema_table->setColumnInfo(i_s_cmp_fields_info);
975
 
        innodb_cmp_schema_table->setInfoSchemaMethods(&cmp_methods);
 
998
        memset(innodb_cmp_schema_table, 0, sizeof(InfoSchemaTable));
 
999
 
 
1000
 
 
1001
        innodb_cmp_schema_table->setFieldsInfo(i_s_cmp_fields_info);
 
1002
        innodb_cmp_schema_table->fill_table = i_s_cmp_fill;
976
1003
        innodb_cmp_schema_table->setTableName("INNODB_CMP");
977
1004
 
978
1005
        return(0);
989
1016
 
990
1017
        if ((innodb_cmp_reset_schema_table= new InfoSchemaTable) == NULL)
991
1018
                return(1);
 
1019
        memset(innodb_cmp_reset_schema_table, 0, sizeof(InfoSchemaTable));
992
1020
 
993
 
        innodb_cmp_reset_schema_table->setColumnInfo(i_s_cmp_fields_info);
994
 
        innodb_cmp_reset_schema_table->setInfoSchemaMethods(&cmp_reset_methods);
 
1021
        innodb_cmp_reset_schema_table->setFieldsInfo(i_s_cmp_fields_info);
 
1022
        innodb_cmp_reset_schema_table->fill_table = i_s_cmp_reset_fill;
995
1023
        innodb_cmp_reset_schema_table->setTableName("INNODB_CMP_RESET");
996
1024
 
997
1025
        return(0);
1000
1028
 
1001
1029
 
1002
1030
/* Fields of the dynamic table information_schema.innodb_cmpmem. */
1003
 
static ColumnInfo       i_s_cmpmem_fields_info[] =
 
1031
static ST_FIELD_INFO    i_s_cmpmem_fields_info[] =
1004
1032
{
1005
 
        ColumnInfo("page_size",
1006
 
                  5,
1007
 
                  DRIZZLE_TYPE_LONG,
1008
 
                  0,
1009
 
                  0,
1010
 
                  "Buddy Block Size",
1011
 
                  SKIP_OPEN_TABLE),
1012
 
 
1013
 
        ColumnInfo("pages_used",
1014
 
                  MY_INT32_NUM_DECIMAL_DIGITS,
1015
 
                  DRIZZLE_TYPE_LONG,
1016
 
                  0,
1017
 
                  0,
1018
 
                  "Currently in Use",
1019
 
                  SKIP_OPEN_TABLE),
1020
 
 
1021
 
        ColumnInfo("pages_free",
1022
 
                  MY_INT32_NUM_DECIMAL_DIGITS,
1023
 
                  DRIZZLE_TYPE_LONG,
1024
 
                  0,
1025
 
                  0,
1026
 
                  "Currently Available",
1027
 
                  SKIP_OPEN_TABLE),
1028
 
 
1029
 
        ColumnInfo("relocation_ops",
1030
 
                  MY_INT64_NUM_DECIMAL_DIGITS,
1031
 
                  DRIZZLE_TYPE_LONGLONG,
1032
 
                  0,
1033
 
                  0,
1034
 
                  "Total Number of Relocations",
1035
 
                  SKIP_OPEN_TABLE),
1036
 
 
1037
 
        ColumnInfo("relocation_time",
1038
 
                  MY_INT32_NUM_DECIMAL_DIGITS,
1039
 
                  DRIZZLE_TYPE_LONG,
1040
 
                  0,
1041
 
                  0,
1042
 
                  "Total Duration of Relocations, in Seconds",
1043
 
                  SKIP_OPEN_TABLE),
1044
 
 
1045
 
        ColumnInfo()
 
1033
        {STRUCT_FLD(field_name,         "page_size"),
 
1034
         STRUCT_FLD(field_length,       5),
 
1035
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONG),
 
1036
         STRUCT_FLD(value,              0),
 
1037
         STRUCT_FLD(field_flags,        0),
 
1038
         STRUCT_FLD(old_name,           "Buddy Block Size"),
 
1039
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
 
1040
 
 
1041
        {STRUCT_FLD(field_name,         "pages_used"),
 
1042
         STRUCT_FLD(field_length,       MY_INT32_NUM_DECIMAL_DIGITS),
 
1043
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONG),
 
1044
         STRUCT_FLD(value,              0),
 
1045
         STRUCT_FLD(field_flags,        0),
 
1046
         STRUCT_FLD(old_name,           "Currently in Use"),
 
1047
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
 
1048
 
 
1049
        {STRUCT_FLD(field_name,         "pages_free"),
 
1050
         STRUCT_FLD(field_length,       MY_INT32_NUM_DECIMAL_DIGITS),
 
1051
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONG),
 
1052
         STRUCT_FLD(value,              0),
 
1053
         STRUCT_FLD(field_flags,        0),
 
1054
         STRUCT_FLD(old_name,           "Currently Available"),
 
1055
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
 
1056
 
 
1057
        {STRUCT_FLD(field_name,         "relocation_ops"),
 
1058
         STRUCT_FLD(field_length,       MY_INT64_NUM_DECIMAL_DIGITS),
 
1059
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONGLONG),
 
1060
         STRUCT_FLD(value,              0),
 
1061
         STRUCT_FLD(field_flags,        0),
 
1062
         STRUCT_FLD(old_name,           "Total Number of Relocations"),
 
1063
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
 
1064
 
 
1065
        {STRUCT_FLD(field_name,         "relocation_time"),
 
1066
         STRUCT_FLD(field_length,       MY_INT32_NUM_DECIMAL_DIGITS),
 
1067
         STRUCT_FLD(field_type,         DRIZZLE_TYPE_LONG),
 
1068
         STRUCT_FLD(value,              0),
 
1069
         STRUCT_FLD(field_flags,        0),
 
1070
         STRUCT_FLD(old_name,           "Total Duration of Relocations,"
 
1071
                    " in Seconds"),
 
1072
         STRUCT_FLD(open_method,        SKIP_OPEN_TABLE)},
 
1073
 
 
1074
        END_OF_ST_FIELD_INFO
1046
1075
};
1047
1076
 
1048
1077
/***********************************************************************
1095
1124
 
1096
1125
/***********************************************************************
1097
1126
Fill the dynamic table information_schema.innodb_cmpmem. */
 
1127
static
1098
1128
int
1099
 
CmpmemISMethods::fillTable(
 
1129
i_s_cmpmem_fill(
1100
1130
/*============*/
1101
1131
                                /* out: 0 on success, 1 on failure */
1102
1132
        Session*                session,        /* in: thread */
1108
1138
 
1109
1139
/***********************************************************************
1110
1140
Fill the dynamic table information_schema.innodb_cmpmem_reset. */
 
1141
static
1111
1142
int
1112
 
CmpmemResetISMethods::fillTable(
 
1143
i_s_cmpmem_reset_fill(
1113
1144
/*==================*/
1114
1145
                                /* out: 0 on success, 1 on failure */
1115
1146
        Session*                session,        /* in: thread */
1130
1161
 
1131
1162
        if ((innodb_cmpmem_schema_table= new InfoSchemaTable) == NULL)
1132
1163
                return(1);
 
1164
        memset(innodb_cmpmem_schema_table, 0, sizeof(InfoSchemaTable));
1133
1165
 
1134
 
        innodb_cmpmem_schema_table->setColumnInfo(i_s_cmpmem_fields_info);
1135
 
        innodb_cmpmem_schema_table->setInfoSchemaMethods(&cmpmem_methods);
 
1166
        innodb_cmpmem_schema_table->setFieldsInfo(i_s_cmpmem_fields_info);
 
1167
        innodb_cmpmem_schema_table->fill_table = i_s_cmpmem_fill;
1136
1168
        innodb_cmpmem_schema_table->setTableName("INNODB_CMPMEM");
1137
1169
 
1138
1170
        return(0);
1148
1180
{
1149
1181
        if ((innodb_cmpmem_reset_schema_table= new InfoSchemaTable) == NULL)
1150
1182
                return(1);
 
1183
        memset(innodb_cmpmem_reset_schema_table, 0, sizeof(InfoSchemaTable));
1151
1184
 
1152
 
        innodb_cmpmem_reset_schema_table->setColumnInfo(i_s_cmpmem_fields_info);
1153
 
        innodb_cmpmem_reset_schema_table->setInfoSchemaMethods(&cmpmem_reset_methods);
 
1185
        innodb_cmpmem_reset_schema_table->setFieldsInfo(i_s_cmpmem_fields_info);
 
1186
        innodb_cmpmem_reset_schema_table->fill_table = i_s_cmpmem_reset_fill;
1154
1187
        innodb_cmpmem_reset_schema_table->setTableName("INNODB_CMPMEM_RESET");
1155
1188
 
1156
1189
        return(0);