1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2009 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
* Implementation of helper methods for I_S tables.
27
#include "drizzled/session.h"
28
#include "drizzled/show.h"
29
#include "drizzled/sql_base.h"
30
#include "drizzled/plugin/client.h"
31
#include "drizzled/join_table.h"
32
#include "drizzled/global_charset_info.h"
33
#include "drizzled/pthread_globals.h"
34
#include "drizzled/internal/m_string.h"
35
#include "plugin/myisam/myisam.h" // needed for dflt_key_cache
36
#include "helper_methods.h"
43
using namespace drizzled;
45
static inline void make_upper(char *buf)
48
*buf= my_toupper(system_charset_info, *buf);
51
void store_key_column_usage(Table *table,
53
LEX_STRING *table_name,
60
const CHARSET_INFO * const cs= system_charset_info;
61
/* set the appropriate bits in the write bitset */
62
table->setWriteSet(1);
63
table->setWriteSet(2);
64
table->setWriteSet(4);
65
table->setWriteSet(5);
66
table->setWriteSet(6);
67
table->setWriteSet(7);
68
table->field[1]->store(db_name->str, db_name->length, cs);
69
table->field[2]->store(key_name, key_len, cs);
70
table->field[4]->store(db_name->str, db_name->length, cs);
71
table->field[5]->store(table_name->str, table_name->length, cs);
72
table->field[6]->store(con_type, con_len, cs);
73
table->field[7]->store((int64_t) idx, true);
77
* Function object used for deleting the memory allocated
78
* for the columns contained with the vector of columns.
84
inline void operator()(const T *ptr) const
90
void clearColumns(vector<const drizzled::plugin::ColumnInfo *> &cols)
92
for_each(cols.begin(), cols.end(), DeleteColumns());