MySQL:如何编写Information Schema Plugin(12)
table->field[COLUMN_SCHEMA_NAME]->store((char*)key+statement_text_length+1
, key_length
,scs );
/*获得结果集所占块的个数*/
first_result_block= query_cache_query->result();
if(first_result_block)
{
/* initialize so we can loop over the result blocks*/
result_block= first_result_block;
result_blocks_count = 1;
result_blocks_size = result_block->length;
result_blocks_size_used = result_block->used;
/* loop over the result blocks*/
while((result_block= result_block->next)!=first_result_block)
{
/* calculate total number of result blocks */
result_blocks_count++;
/* calculate total size of result blocks */
result_blocks_size += result_block->length;
/* calculate total of used size of result blocks */
result_blocks_size_used += result_block->used;
}
}
else
{
result_blocks_count = 0;
result_blocks_size = 0;
result_blocks_size_used = 0;
}
/* 存储块的个数*/
table->field[COLUMN_RESULT_BLOCKS_COUNT]->store( result_blocks_count ,0);
/* 存储总的所占有块的大小*/
table->field[COLUMN_RESULT_BLOCKS_SIZE]->store( result_blocks_size , 0);
/*存储总的已使用块的大小*/
相关新闻>>
- 发表评论
-
- 最新评论 更多>>