~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Stewart Smith
  • Date: 2010-08-05 16:41:55 UTC
  • mfrom: (1638.9.13)
  • mto: (1720.1.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 1721.
  • Revision ID: stewart@flamingspork.com-20100805164155-7olu6iv6rwoxfsne
Merged store-foreign-key-in-table-proto into show-create-table-using-table-message.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 
 
3
Copyright (c) 2007, 2009, Innobase Oy. All Rights Reserved.
 
4
 
 
5
This program is free software; you can redistribute it and/or modify it under
 
6
the terms of the GNU General Public License as published by the Free Software
 
7
Foundation; version 2 of the License.
 
8
 
 
9
This program is distributed in the hope that it will be useful, but WITHOUT
 
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
12
 
 
13
You should have received a copy of the GNU General Public License along with
 
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
 
16
 
 
17
*****************************************************************************/
 
18
 
 
19
#include "config.h"
 
20
 
 
21
#include "internal_dictionary.h"
 
22
 
 
23
#include "drizzled/current_session.h"
 
24
 
 
25
extern "C" {
 
26
#include "univ.i"
 
27
#include "btr0sea.h"
 
28
#include "os0file.h"
 
29
#include "os0thread.h"
 
30
#include "srv0start.h"
 
31
#include "srv0srv.h"
 
32
#include "trx0roll.h"
 
33
#include "trx0trx.h"
 
34
#include "trx0sys.h"
 
35
#include "mtr0mtr.h"
 
36
#include "row0ins.h"
 
37
#include "row0mysql.h"
 
38
#include "row0sel.h"
 
39
#include "row0upd.h"
 
40
#include "log0log.h"
 
41
#include "lock0lock.h"
 
42
#include "dict0crea.h"
 
43
#include "btr0cur.h"
 
44
#include "btr0btr.h"
 
45
#include "fsp0fsp.h"
 
46
#include "sync0sync.h"
 
47
#include "fil0fil.h"
 
48
#include "trx0xa.h"
 
49
#include "row0merge.h"
 
50
#include "thr0loc.h"
 
51
#include "dict0boot.h"
 
52
#include "ha_prototypes.h"
 
53
#include "ut0mem.h"
 
54
#include "ibuf0ibuf.h"
 
55
#include "mysql_addons.h"
 
56
}
 
57
#include "handler0vars.h"
 
58
 
 
59
using namespace drizzled;
 
60
 
 
61
/*
 
62
 * Fill the dynamic table data_dictionary.INNODB_CMP and INNODB_CMP_RESET
 
63
 *
 
64
 */
 
65
InnodbInternalTables::InnodbInternalTables() :
 
66
  plugin::TableFunction("DATA_DICTIONARY", "INNODB_INTERNAL_TABLES")
 
67
{
 
68
  add_field("TABLE_NAME");
 
69
}
 
70
 
 
71
extern "C" {
 
72
  void my_dict_print_callback(void *ptr, const char *);
 
73
}
 
74
 
 
75
void my_dict_print_callback(void *ptr, const char *table_name)
 
76
{
 
77
  Recorder *myrec= static_cast<Recorder *>(ptr);
 
78
 
 
79
  myrec->push(table_name);
 
80
}
 
81
 
 
82
InnodbInternalTables::Generator::Generator(Field **arg) :
 
83
  plugin::TableFunction::Generator(arg)
 
84
{
 
85
  dict_print_with_callback(my_dict_print_callback, &recorder);
 
86
  recorder.start();
 
87
}
 
88
 
 
89
bool InnodbInternalTables::Generator::populate()
 
90
{
 
91
  std::string table_name;
 
92
  bool more= recorder.next(table_name);
 
93
 
 
94
  if (not more)
 
95
    return false;
 
96
 
 
97
  /* TABLE_NAME */
 
98
  push(table_name);
 
99
 
 
100
  return true;
 
101
}