~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Brian Aker
  • Date: 2011-02-18 16:48:57 UTC
  • mfrom: (2180.1.3 drizzle-staging)
  • Revision ID: brian@tangent.org-20110218164857-4n61en8wai9c91gi
Rollup all of Olaf's branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
557
557
  int           timestamps= 0, timestamps_with_niladic= 0;
558
558
  int           dup_no;
559
559
  int           select_field_pos,auto_increment=0;
560
 
  List_iterator<CreateField> it(alter_info->create_list);
561
 
  List_iterator<CreateField> it2(alter_info->create_list);
 
560
  List<CreateField>::iterator it(alter_info->create_list);
 
561
  List<CreateField>::iterator it2(alter_info->create_list);
562
562
  uint32_t total_uneven_bit_length= 0;
563
563
 
564
564
  plugin::StorageEngine *engine= plugin::StorageEngine::findByName(create_proto.engine().name());
652
652
        interval= sql_field->interval= typelib(session->mem_root,
653
653
                                               sql_field->interval_list);
654
654
 
655
 
        List_iterator<String> int_it(sql_field->interval_list);
 
655
        List<String>::iterator int_it(sql_field->interval_list);
656
656
        String conv, *tmp;
657
657
        char comma_buf[4];
658
658
        int comma_length= cs->cset->wc_mb(cs, ',', (unsigned char*) comma_buf,
678
678
          interval->type_lengths[i]= lengthsp;
679
679
          ((unsigned char *)interval->type_names[i])[lengthsp]= '\0';
680
680
        }
681
 
        sql_field->interval_list.empty(); // Don't need interval_list anymore
 
681
        sql_field->interval_list.clear(); // Don't need interval_list anymore
682
682
      }
683
683
 
684
684
      /* DRIZZLE_TYPE_ENUM */
782
782
      (*db_options)|= HA_OPTION_PACK_RECORD;
783
783
    }
784
784
 
785
 
    it2.rewind();
 
785
    it2= alter_info->create_list;
786
786
  }
787
787
 
788
788
  /* record_offset will be increased with 'length-of-null-bits' later */
789
789
  record_offset= 0;
790
790
  null_fields+= total_uneven_bit_length;
791
791
 
792
 
  it.rewind();
 
792
  it= alter_info->create_list;
793
793
  while ((sql_field=it++))
794
794
  {
795
795
    assert(sql_field->charset != 0);
829
829
 
830
830
  /* Create keys */
831
831
 
832
 
  List_iterator<Key> key_iterator(alter_info->key_list);
833
 
  List_iterator<Key> key_iterator2(alter_info->key_list);
 
832
  List<Key>::iterator key_iterator(alter_info->key_list);
 
833
  List<Key>::iterator key_iterator2(alter_info->key_list);
834
834
  uint32_t key_parts=0, fk_key_count=0;
835
835
  bool primary_key=0,unique_key=0;
836
836
  Key *key, *key2;
880
880
    }
881
881
    if (check_identifier_name(&key->name, ER_TOO_LONG_IDENT))
882
882
      return(true);
883
 
    key_iterator2.rewind ();
 
883
    key_iterator2= alter_info->key_list;
884
884
    if (key->type != Key::FOREIGN_KEY)
885
885
    {
886
886
      while ((key2 = key_iterator2++) != key)
933
933
  if (!*key_info_buffer || ! key_part_info)
934
934
    return(true);                               // Out of memory
935
935
 
936
 
  key_iterator.rewind();
 
936
  key_iterator= alter_info->key_list;
937
937
  key_number=0;
938
938
  for (; (key=key_iterator++) ; key_number++)
939
939
  {
992
992
 
993
993
    message::Table::Field *protofield= NULL;
994
994
 
995
 
    List_iterator<Key_part_spec> cols(key->columns), cols2(key->columns);
 
995
    List<Key_part_spec>::iterator cols(key->columns);
 
996
    List<Key_part_spec>::iterator cols2(key->columns);
996
997
    for (uint32_t column_nr=0 ; (column=cols++) ; column_nr++)
997
998
    {
998
999
      uint32_t length;
999
1000
      Key_part_spec *dup_column;
1000
1001
      int proto_field_nr= 0;
1001
1002
 
1002
 
      it.rewind();
 
1003
      it= alter_info->create_list;
1003
1004
      field=0;
1004
1005
      while ((sql_field=it++) && ++proto_field_nr &&
1005
1006
             my_strcasecmp(system_charset_info,
1026
1027
          return(true);
1027
1028
        }
1028
1029
      }
1029
 
      cols2.rewind();
 
1030
      cols2= key->columns;
1030
1031
 
1031
1032
      if (create_proto.field_size() > 0)
1032
1033
        protofield= create_proto.mutable_field(proto_field_nr - 1);
1239
1240
                     (qsort_cmp) sort_keys);
1240
1241
 
1241
1242
  /* Check fields. */
1242
 
  it.rewind();
 
1243
  it= alter_info->create_list;
1243
1244
  while ((sql_field=it++))
1244
1245
  {
1245
1246
    Field::utype type= (Field::utype) MTYP_TYPENR(sql_field->unireg_check);