114
114
/* XXX these are defined in mysql_priv.h inside #ifdef DRIZZLE_SERVER */
115
bool schema_table_store_record(Session *session, Table *table);
116
115
void localtime_to_TIME(DRIZZLE_TIME *to, struct tm *from);
118
117
/*******************************************************************//**
283
274
fill_innodb_trx_from_cache(
284
275
/*=======================*/
285
276
trx_i_s_cache_t* cache, /*!< in: cache to read from */
286
Session* session,/*!< in: used to call
287
schema_table_store_record() */
288
Table* table) /*!< in/out: fill this table */
277
Table* table, /*!< in/out: fill this table */
278
drizzled::plugin::InfoSchemaTable *schema_table)
351
341
OK(field_store_string(fields[IDX_TRX_QUERY],
352
342
row->trx_query));
354
OK(schema_table_store_record(session, table));
344
schema_table->addRow(table->record[0],
345
table->s->reclength);
481
462
/*=========================*/
482
463
trx_i_s_cache_t* cache, /*!< in: cache to read from */
483
464
Session* session,/*!< in: MySQL client connection */
484
Table* table) /*!< in/out: fill this table */
465
Table* table, /*!< in/out: fill this table */
466
drizzled::plugin::InfoSchemaTable *schema_table)
571
553
OK(field_store_string(fields[IDX_LOCK_DATA],
572
554
row->lock_data));
574
OK(schema_table_store_record(session, table));
556
schema_table->addRow(table->record[0],
557
table->s->reclength);
645
624
fill_innodb_lock_waits_from_cache(
646
625
/*==============================*/
647
626
trx_i_s_cache_t* cache, /*!< in: cache to read from */
648
Session* session,/*!< in: used to call
649
schema_table_store_record() */
650
Table* table) /*!< in/out: fill this table */
627
Table* table, /*!< in/out: fill this table */
628
drizzled::plugin::InfoSchemaTable *schema_table)
734
713
TrxISMethods::fillTable(
735
714
/*======================*/
736
715
Session* session,/*!< in: thread */
737
TableList* tables) /*!< in/out: tables to fill */
716
Table* table, /*!< in/out: tables to fill */
717
drizzled::plugin::InfoSchemaTable *schema_table)
739
719
const char* table_name;
745
725
cache = trx_i_s_cache;
747
727
/* which table we have to fill? */
748
table_name = tables->schema_table_name;
728
table_name = schema_table->getName().c_str();
749
729
/* or table_name = tables->schema_table->table_name; */
751
731
RETURN_IF_INNODB_NOT_STARTED(table_name);
770
750
if (innobase_strcasecmp(table_name, "innodb_trx") == 0) {
772
752
if (fill_innodb_trx_from_cache(
773
cache, session, tables->table) != 0) {
753
cache, table, schema_table) != 0) {
778
758
} else if (innobase_strcasecmp(table_name, "innodb_locks") == 0) {
780
760
if (fill_innodb_locks_from_cache(
781
cache, session, tables->table) != 0) {
761
cache, session, table, schema_table) != 0) {
786
766
} else if (innobase_strcasecmp(table_name, "innodb_lock_waits") == 0) {
788
768
if (fill_innodb_lock_waits_from_cache(
789
cache, session, tables->table) != 0) {
769
cache, table, schema_table) != 0) {
825
805
DRIZZLE_TYPE_LONG,
828
"Compressed Page Size",
808
"Compressed Page Size"),
831
810
drizzled::plugin::ColumnInfo("compress_ops",
832
811
MY_INT32_NUM_DECIMAL_DIGITS,
833
812
DRIZZLE_TYPE_LONG,
836
"Total Number of Compressions",
815
"Total Number of Compressions"),
839
817
drizzled::plugin::ColumnInfo("compress_ops_ok",
840
818
MY_INT32_NUM_DECIMAL_DIGITS,
841
819
DRIZZLE_TYPE_LONG,
844
"Total Number of Successful Compressions",
822
"Total Number of Successful Compressions"),
847
824
drizzled::plugin::ColumnInfo("compress_time",
848
825
MY_INT32_NUM_DECIMAL_DIGITS,
849
826
DRIZZLE_TYPE_LONG,
852
"Total Duration of Compressions in Seconds",
829
"Total Duration of Compressions in Seconds"),
855
831
drizzled::plugin::ColumnInfo("uncompress_ops",
856
832
MY_INT32_NUM_DECIMAL_DIGITS,
857
833
DRIZZLE_TYPE_LONG,
860
"Total Number of Decompressions",
836
"Total Number of Decompressions"),
863
838
drizzled::plugin::ColumnInfo("uncompress_time",
864
839
MY_INT32_NUM_DECIMAL_DIGITS,
865
840
DRIZZLE_TYPE_LONG,
868
"Total Duration of Decompressions in Seconds",
843
"Total Duration of Decompressions in Seconds"),
871
845
drizzled::plugin::ColumnInfo()
881
855
i_s_cmp_fill_low(
882
856
/*=============*/
883
857
Session* session,/*!< in: thread */
884
TableList* tables, /*!< in/out: tables to fill */
858
Table* table, /*!< in/out: tables to fill */
859
drizzled::plugin::InfoSchemaTable *schema_table,
885
860
ibool reset) /*!< in: TRUE=reset cumulated counts */
887
Table* table = (Table *) tables->table;
891
RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
865
RETURN_IF_INNODB_NOT_STARTED(schema_table->getName().c_str());
893
867
for (uint i = 0; i < PAGE_ZIP_NUM_SSIZE - 1; i++) {
894
868
page_zip_stat_t* zip_stat = &page_zip_stat[i];
913
887
memset(zip_stat, 0, sizeof *zip_stat);
916
if (schema_table_store_record(session, table)) {
890
schema_table->addRow(table->record[0],
891
table->s->reclength);
929
901
CmpISMethods::fillTable(
931
903
Session* session,/*!< in: thread */
932
TableList* tables) /*!< in/out: tables to fill */
904
Table* table, /*!< in/out: tables to fill */
905
drizzled::plugin::InfoSchemaTable *schema_table)
934
return(i_s_cmp_fill_low(session, tables, FALSE));
907
return(i_s_cmp_fill_low(session, table, schema_table, FALSE));
937
910
/*******************************************************************//**
941
914
CmpResetISMethods::fillTable(
942
915
/*===============*/
943
916
Session* session,/*!< in: thread */
944
TableList* tables) /*!< in/out: tables to fill */
917
Table* table, /*!< in/out: tables to fill */
918
drizzled::plugin::InfoSchemaTable *schema_table)
946
return(i_s_cmp_fill_low(session, tables, TRUE));
920
return(i_s_cmp_fill_low(session, table, schema_table, TRUE));
949
923
/*******************************************************************//**
990
964
DRIZZLE_TYPE_LONG,
996
969
drizzled::plugin::ColumnInfo("pages_used",
997
970
MY_INT32_NUM_DECIMAL_DIGITS,
998
971
DRIZZLE_TYPE_LONG,
1004
976
drizzled::plugin::ColumnInfo("pages_free",
1005
977
MY_INT32_NUM_DECIMAL_DIGITS,
1006
978
DRIZZLE_TYPE_LONG,
1009
"Currently Available",
981
"Currently Available"),
1012
983
drizzled::plugin::ColumnInfo("relocation_ops",
1013
984
MY_INT64_NUM_DECIMAL_DIGITS,
1014
985
DRIZZLE_TYPE_LONGLONG,
1017
"Total Number of Relocations",
988
"Total Number of Relocations"),
1020
990
drizzled::plugin::ColumnInfo("relocation_time",
1021
991
MY_INT32_NUM_DECIMAL_DIGITS,
1022
992
DRIZZLE_TYPE_LONG,
1025
"Total Duration of Relocations, in Seconds",
995
"Total Duration of Relocations, in Seconds"),
1028
997
drizzled::plugin::ColumnInfo()
1037
1006
i_s_cmpmem_fill_low(
1038
1007
/*================*/
1039
1008
Session* session,/*!< in: thread */
1040
TableList* tables, /*!< in/out: tables to fill */
1009
Table* table, /*!< in/out: tables to fill */
1010
drizzled::plugin::InfoSchemaTable *schema_table,
1041
1011
ibool reset) /*!< in: TRUE=reset cumulated counts */
1043
Table* table = (Table *) tables->table;
1044
1013
int status = 0;
1046
RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
1015
RETURN_IF_INNODB_NOT_STARTED(schema_table->getName().c_str());
1048
1017
buf_pool_mutex_enter();
1082
1049
CmpmemISMethods::fillTable(
1083
1050
/*============*/
1084
1051
Session* session,/*!< in: thread */
1085
TableList* tables) /*!< in/out: tables to fill */
1052
Table* table, /*!< in/out: tables to fill */
1053
drizzled::plugin::InfoSchemaTable *schema_table)
1087
return(i_s_cmpmem_fill_low(session, tables, FALSE));
1055
return(i_s_cmpmem_fill_low(session, table, schema_table, FALSE));
1090
1058
/*******************************************************************//**
1094
1062
CmpmemResetISMethods::fillTable(
1095
1063
/*==================*/
1096
1064
Session* session,/*!< in: thread */
1097
TableList* tables) /*!< in/out: tables to fill */
1065
Table* table, /*!< in/out: tables to fill */
1066
drizzled::plugin::InfoSchemaTable *schema_table)
1099
return(i_s_cmpmem_fill_low(session, tables, TRUE));
1068
return(i_s_cmpmem_fill_low(session, table, schema_table, TRUE));
1102
1071
/*******************************************************************//**