~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/info_schema/open_tables.cc

  • Committer: Brian Aker
  • Date: 2009-11-29 06:59:57 UTC
  • mfrom: (1225.1.35 figure)
  • mto: This revision was merged to the branch mainline in revision 1256.
  • Revision ID: brian@gaz-20091129065957-nngh4bccsq4ypmwx
MergeĀ PadraigĀ 

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
                                            DRIZZLE_TYPE_VARCHAR,
72
72
                                            0,
73
73
                                            0,
74
 
                                            "Database",
75
 
                                            SKIP_OPEN_TABLE));
 
74
                                            "Database"));
76
75
 
77
76
  columns->push_back(new plugin::ColumnInfo("Table",
78
77
                                            NAME_CHAR_LEN,
79
78
                                            DRIZZLE_TYPE_VARCHAR,
80
79
                                            0,
81
80
                                            0,
82
 
                                            "Table",
83
 
                                            SKIP_OPEN_TABLE));
 
81
                                            "Table"));
84
82
 
85
83
  columns->push_back(new plugin::ColumnInfo("In_use",
86
84
                                            1,
87
85
                                            DRIZZLE_TYPE_LONGLONG,
88
86
                                            0,
89
87
                                            0,
90
 
                                            "In_use",
91
 
                                            SKIP_OPEN_TABLE));
 
88
                                            "In_use"));
92
89
 
93
90
  columns->push_back(new plugin::ColumnInfo("Name_locked",
94
91
                                            4,
95
92
                                            DRIZZLE_TYPE_LONGLONG,
96
93
                                            0,
97
94
                                            0,
98
 
                                            "Name_locked",
99
 
                                            SKIP_OPEN_TABLE));
 
95
                                            "Name_locked"));
100
96
 
101
97
  return columns;
102
98
}
137
133
  delete columns;
138
134
}
139
135
 
140
 
inline bool open_list_store(Table *table, open_table_list_st& open_list);
141
 
inline bool open_list_store(Table *table, open_table_list_st& open_list)
 
136
inline bool open_list_store(Table *table, 
 
137
                            open_table_list_st& open_list,
 
138
                            plugin::InfoSchemaTable *schema_table);
 
139
inline bool open_list_store(Table *table, 
 
140
                            open_table_list_st& open_list,
 
141
                            plugin::InfoSchemaTable *schema_table)
142
142
{
143
143
  table->restoreRecordAsDefault();
 
144
  table->setWriteSet(0);
 
145
  table->setWriteSet(1);
 
146
  table->setWriteSet(2);
 
147
  table->setWriteSet(3);
144
148
  table->field[0]->store(open_list.db.c_str(), open_list.db.length(), system_charset_info);
145
149
  table->field[1]->store(open_list.table.c_str(), open_list.table.length(), system_charset_info);
146
150
  table->field[2]->store((int64_t) open_list.in_use, true);
147
151
  table->field[3]->store((int64_t) open_list.locked, true);
148
 
  if (schema_table_store_record(table->in_use, table))
149
 
    return true;
 
152
  schema_table->addRow(table->record[0], table->s->reclength);
150
153
 
151
154
  return false;
152
155
}
153
156
 
154
 
int OpenTablesISMethods::fillTable(Session *session, TableList *tables)
 
157
int OpenTablesISMethods::fillTable(Session *session, 
 
158
                                   Table *table,
 
159
                                   plugin::InfoSchemaTable *schema_table)
155
160
{
156
161
  const char *wild= session->lex->wild ? session->lex->wild->ptr() : NULL;
157
162
 
158
 
  if ((list_open_tables(session->lex->select_lex.db, wild, open_list_store, tables->table) == true) && session->is_fatal_error)
 
163
  if ((list_open_tables(session->lex->select_lex.db, wild, open_list_store, table, schema_table) == true) && session->is_fatal_error)
159
164
    return 1;
160
165
 
161
166
  return 0;