~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/info_schema/helper_methods.cc

  • Committer: Brian Aker
  • Date: 2009-11-30 19:13:19 UTC
  • mfrom: (1225.1.39 figure)
  • Revision ID: brian@gaz-20091130191319-zyt51fidacic3brf
Merge Padraig

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include <string>
37
37
 
38
38
using namespace std;
 
39
using namespace drizzled;
39
40
 
40
41
static inline void make_upper(char *buf)
41
42
{
49
50
                       enum enum_var_type value_type,
50
51
                       struct system_status_var *status_var,
51
52
                       const char *prefix, Table *table,
52
 
                       bool ucase_names)
 
53
                       bool ucase_names,
 
54
                       plugin::InfoSchemaTable *schema_table)
53
55
{
54
56
  MY_ALIGNED_BYTE_ARRAY(buff_data, SHOW_VAR_FUNC_BUFF_SIZE, int64_t);
55
57
  char * const buff= (char *) &buff_data;
84
86
    if (show_type == SHOW_ARRAY)
85
87
    {
86
88
      show_status_array(session, wild, (SHOW_VAR *) var->value, value_type,
87
 
                        status_var, name_buffer, table, ucase_names);
 
89
                        status_var, name_buffer, table, ucase_names, schema_table);
88
90
    }
89
91
    else
90
92
    {
187
189
          break;
188
190
        }
189
191
        table->restoreRecordAsDefault();
 
192
        table->setWriteSet(0);
 
193
        table->setWriteSet(1);
 
194
        table->setWriteSet(2);
190
195
        table->field[0]->store(name_buffer, strlen(name_buffer),
191
196
                               system_charset_info);
192
197
        table->field[1]->store(pos, (uint32_t) (end - pos), system_charset_info);
194
199
 
195
200
        pthread_mutex_unlock(&LOCK_global_system_variables);
196
201
 
197
 
        if (schema_table_store_record(session, table))
198
 
          return true;
 
202
        schema_table->addRow(table->record[0], table->s->reclength);
199
203
      }
200
204
    }
201
205
  }
203
207
  return false;
204
208
}
205
209
 
206
 
 
207
210
void store_key_column_usage(Table *table, 
208
211
                            LEX_STRING *db_name,
209
212
                            LEX_STRING *table_name, 
214
217
                            int64_t idx)
215
218
{
216
219
  const CHARSET_INFO * const cs= system_charset_info;
 
220
  /* set the appropriate bits in the write bitset */
 
221
  table->setWriteSet(1);
 
222
  table->setWriteSet(2);
 
223
  table->setWriteSet(4);
 
224
  table->setWriteSet(5);
 
225
  table->setWriteSet(6);
 
226
  table->setWriteSet(7);
217
227
  table->field[1]->store(db_name->str, db_name->length, cs);
218
228
  table->field[2]->store(key_name, key_len, cs);
219
229
  table->field[4]->store(db_name->str, db_name->length, cs);