~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

  • Committer: Brian Aker
  • Date: 2009-05-03 22:35:33 UTC
  • mfrom: (997.2.26 mordred)
  • Revision ID: brian@gaz-20090503223533-lv7lwqelv08dnv2j
Merge of Monty's code

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
    struct drizzled_plugin_manifest *plug= plugin_decl(plugin);
158
158
    const CHARSET_INFO * const cs= system_charset_info;
159
159
  
160
 
    restore_record(table, s->default_values);
 
160
    table->restoreRecordAsDefault();
161
161
  
162
162
    table->field[0]->store(plugin_name(plugin)->str,
163
163
                           plugin_name(plugin)->length, cs);
467
467
      field_list.push_back(new Item_field(field));
468
468
    }
469
469
  }
470
 
  restore_record(table, s->default_values);              // Get empty record
 
470
  table->restoreRecordAsDefault();              // Get empty record
471
471
  table->use_all_columns();
472
472
  if (session->protocol->sendFields(&field_list, Protocol::SEND_DEFAULTS))
473
473
    return;
619
619
  bool show_table_options= false;
620
620
  bitset<MAX_FIELDS> *old_bitmap;
621
621
 
622
 
  restore_record(table, s->default_values); // Get empty record
 
622
  table->restoreRecordAsDefault(); // Get empty record
623
623
 
624
624
  if (share->tmp_table)
625
625
    packet->append(STRING_WITH_LEN("CREATE TEMPORARY TABLE "));
1142
1142
      if (! tmp->protocol->isConnected())
1143
1143
        continue;
1144
1144
 
1145
 
      restore_record(table, s->default_values);
 
1145
      table->restoreRecordAsDefault();
1146
1146
      /* ID */
1147
1147
      table->field[0]->store((int64_t) tmp->thread_id, true);
1148
1148
      /* USER */
1525
1525
          assert(0);
1526
1526
          break;
1527
1527
        }
1528
 
        restore_record(table, s->default_values);
 
1528
        table->restoreRecordAsDefault();
1529
1529
        table->field[0]->store(name_buffer, strlen(name_buffer),
1530
1530
                               system_charset_info);
1531
1531
        table->field[1]->store(pos, (uint32_t) (end - pos), system_charset_info);
2495
2495
      List_iterator_fast<LEX_STRING> it_files(table_names);
2496
2496
      while ((table_name= it_files++))
2497
2497
      {
2498
 
        restore_record(table, s->default_values);
 
2498
        table->restoreRecordAsDefault();
2499
2499
        table->field[schema_table->idx_field1]->
2500
2500
          store(db_name->str, db_name->length, system_charset_info);
2501
2501
        table->field[schema_table->idx_field2]->
2621
2621
bool store_schema_shemata(Session* session, Table *table, LEX_STRING *db_name,
2622
2622
                          const CHARSET_INFO * const cs)
2623
2623
{
2624
 
  restore_record(table, s->default_values);
 
2624
  table->restoreRecordAsDefault();
2625
2625
  table->field[1]->store(db_name->str, db_name->length, system_charset_info);
2626
2626
  table->field[2]->store(cs->csname, strlen(cs->csname), system_charset_info);
2627
2627
  table->field[3]->store(cs->name, strlen(cs->name), system_charset_info);
2699
2699
  DRIZZLE_TIME time;
2700
2700
  const CHARSET_INFO * const cs= system_charset_info;
2701
2701
 
2702
 
  restore_record(table, s->default_values);
 
2702
  table->restoreRecordAsDefault();
2703
2703
  table->field[1]->store(db_name->str, db_name->length, cs);
2704
2704
  table->field[2]->store(table_name->str, table_name->length, cs);
2705
2705
  if (res)
3043
3043
 
3044
3044
    count++;
3045
3045
    /* Get default row, with all NULL fields set to NULL */
3046
 
    restore_record(table, s->default_values);
 
3046
    table->restoreRecordAsDefault();
3047
3047
 
3048
3048
    table->field[1]->store(db_name->str, db_name->length, cs);
3049
3049
    table->field[2]->store(table_name->str, table_name->length, cs);
3112
3112
          wild_case_compare(scs, tmp_cs->csname,wild)))
3113
3113
    {
3114
3114
      const char *comment;
3115
 
      restore_record(table, s->default_values);
 
3115
      table->restoreRecordAsDefault();
3116
3116
      table->field[0]->store(tmp_cs->csname, strlen(tmp_cs->csname), scs);
3117
3117
      table->field[1]->store(tmp_cs->name, strlen(tmp_cs->name), scs);
3118
3118
      comment= tmp_cs->comment ? tmp_cs->comment : "";
3150
3150
          wild_case_compare(scs, tmp_cl->name,wild)))
3151
3151
      {
3152
3152
        const char *tmp_buff;
3153
 
        restore_record(table, s->default_values);
 
3153
        table->restoreRecordAsDefault();
3154
3154
        table->field[0]->store(tmp_cl->name, strlen(tmp_cl->name), scs);
3155
3155
        table->field[1]->store(tmp_cl->csname , strlen(tmp_cl->csname), scs);
3156
3156
        table->field[2]->store((int64_t) tmp_cl->number, true);
3186
3186
      if (!tmp_cl || !(tmp_cl->state & MY_CS_AVAILABLE) ||
3187
3187
          !my_charset_same(tmp_cs,tmp_cl))
3188
3188
        continue;
3189
 
      restore_record(table, s->default_values);
 
3189
      table->restoreRecordAsDefault();
3190
3190
      table->field[0]->store(tmp_cl->name, strlen(tmp_cl->name), scs);
3191
3191
      table->field[1]->store(tmp_cl->csname , strlen(tmp_cl->csname), scs);
3192
3192
      if (schema_table_store_record(session, table))
3233
3233
      const char *str;
3234
3234
      for (uint32_t j=0 ; j < key_info->key_parts ; j++,key_part++)
3235
3235
      {
3236
 
        restore_record(table, s->default_values);
 
3236
        table->restoreRecordAsDefault();
3237
3237
        table->field[1]->store(db_name->str, db_name->length, cs);
3238
3238
        table->field[2]->store(table_name->str, table_name->length, cs);
3239
3239
        table->field[3]->store((int64_t) ((key_info->flags &
3275
3275
        uint32_t flags= key_part->field ? key_part->field->flags : 0;
3276
3276
        const char *pos=(char*) ((flags & NOT_NULL_FLAG) ? "" : "YES");
3277
3277
        table->field[12]->store(pos, strlen(pos), cs);
3278
 
        if (!show_table->s->keys_in_use.is_set(i))
 
3278
        if (!show_table->s->keys_in_use.test(i))
3279
3279
          table->field[14]->store(STRING_WITH_LEN("disabled"), cs);
3280
3280
        else
3281
3281
          table->field[14]->store("", 0, cs);
3299
3299
                       uint32_t key_len, const char *con_type, uint32_t con_len)
3300
3300
{
3301
3301
  const CHARSET_INFO * const cs= system_charset_info;
3302
 
  restore_record(table, s->default_values);
 
3302
  table->restoreRecordAsDefault();
3303
3303
  table->field[1]->store(db_name->str, db_name->length, cs);
3304
3304
  table->field[2]->store(key_name, key_len, cs);
3305
3305
  table->field[3]->store(db_name->str, db_name->length, cs);
3417
3417
        if (key_part->field)
3418
3418
        {
3419
3419
          f_idx++;
3420
 
          restore_record(table, s->default_values);
 
3420
          table->restoreRecordAsDefault();
3421
3421
          store_key_column_usage(table, db_name, table_name,
3422
3422
                                 key_info->name,
3423
3423
                                 strlen(key_info->name),
3444
3444
      {
3445
3445
        r_info= it1++;
3446
3446
        f_idx++;
3447
 
        restore_record(table, s->default_values);
 
3447
        table->restoreRecordAsDefault();
3448
3448
        store_key_column_usage(table, db_name, table_name,
3449
3449
                               f_key_info->forein_id->str,
3450
3450
                               f_key_info->forein_id->length,
3484
3484
 
3485
3485
  for (; open_list ; open_list=open_list->next)
3486
3486
  {
3487
 
    restore_record(table, s->default_values);
 
3487
    table->restoreRecordAsDefault();
3488
3488
    table->field[0]->store(open_list->db, strlen(open_list->db), cs);
3489
3489
    table->field[1]->store(open_list->table, strlen(open_list->table), cs);
3490
3490
    table->field[2]->store((int64_t) open_list->in_use, true);
3607
3607
    List_iterator_fast<FOREIGN_KEY_INFO> it(f_key_list);
3608
3608
    while ((f_key_info= it++))
3609
3609
    {
3610
 
      restore_record(table, s->default_values);
 
3610
      table->restoreRecordAsDefault();
3611
3611
      table->field[1]->store(db_name->str, db_name->length, cs);
3612
3612
      table->field[9]->store(table_name->str, table_name->length, cs);
3613
3613
      table->field[2]->store(f_key_info->forein_id->str,