1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Temporary commit of merge of MariaDB 10.0-base and MySQL 5.6

This commit is contained in:
Michael Widenius
2012-08-01 17:27:34 +03:00
parent 5a86a61219
commit 1d0f70c2f8
557 changed files with 124450 additions and 30236 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,22 +16,19 @@
#ifndef TABLE_THREADS_H
#define TABLE_THREADS_H
/**
@file storage/perfschema/table_threads.h
Table THREADS (declarations).
*/
#include "pfs_column_types.h"
#include "pfs_engine_table.h"
#include "cursor_by_thread.h"
struct PFS_thread;
/**
@addtogroup Performance_schema_tables
\addtogroup Performance_schema_tables
@{
*/
/** A row of PERFORMANCE_SCHEMA.THREADS. */
/**
A row of PERFORMANCE_SCHEMA.THREADS.
*/
struct row_threads
{
/** Column THREAD_ID. */
@@ -39,29 +36,60 @@ struct row_threads
/** Column PROCESSLIST_ID. */
ulong m_thread_id;
/** Column NAME. */
const char *m_name;
const char* m_name;
/** Length in bytes of @c m_name. */
uint m_name_length;
/** Column PROCESSLIST_USER. */
char m_username[USERNAME_LENGTH];
/** Length in bytes of @c m_username. */
uint m_username_length;
/** Column PROCESSLIST_HOST. */
char m_hostname[HOSTNAME_LENGTH];
/** Length in bytes of @c m_hostname. */
uint m_hostname_length;
/** Column PROCESSLIST_DB. */
char m_dbname[NAME_LEN];
/** Length in bytes of @c m_dbname. */
uint m_dbname_length;
/** Column PROCESSLIST_COMMAND. */
int m_command;
/** Column PROCESSLIST_TIME. */
time_t m_start_time;
/** Column PROCESSLIST_STATE. */
const char* m_processlist_state_ptr;
/** Length in bytes of @c m_processlist_state_ptr. */
uint m_processlist_state_length;
/** Column PROCESSLIST_INFO. */
const char* m_processlist_info_ptr;
/** Length in bytes of @c m_processlist_info_ptr. */
uint m_processlist_info_length;
/** Column INSTRUMENTED. */
bool *m_enabled_ptr;
/** Column PARENT_THREAD_ID. */
ulong m_parent_thread_internal_id;
};
/** Table PERFORMANCE_SCHEMA.THREADS. */
class table_threads : public PFS_engine_table
class table_threads : public cursor_by_thread
{
public:
/** Table share. */
/** Table share */
static PFS_engine_table_share m_share;
/** Table builder */
static PFS_engine_table* create();
virtual int rnd_next();
virtual int rnd_pos(const void *pos);
virtual void reset_position(void);
protected:
virtual int read_row_values(TABLE *table,
unsigned char *buf,
Field **fields,
bool read_all);
virtual int update_row_values(TABLE *table,
const unsigned char *old_buf,
unsigned char *new_buf,
Field **fields);
protected:
table_threads();
@@ -70,7 +98,7 @@ public:
{}
private:
void make_row(PFS_thread *pfs);
virtual void make_row(PFS_thread *pfs);
/** Table share lock. */
static THR_LOCK m_table_lock;
@@ -81,10 +109,6 @@ private:
row_threads m_row;
/** True if the current row exists. */
bool m_row_exists;
/** Current position. */
PFS_simple_index m_pos;
/** Next position. */
PFS_simple_index m_next_pos;
};
/** @} */