~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_insert.cc

  • Committer: Brian Aker
  • Date: 2008-10-06 03:55:31 UTC
  • mto: This revision was merged to the branch mainline in revision 479.
  • Revision ID: brian@gir.tangent.org-20081006035531-ade3cc3kfwutd35g
uint cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#define my_safe_alloca(size, min_length) my_alloca(size)
35
35
#define my_safe_afree(ptr, size, min_length) my_afree(ptr)
36
36
#else
37
 
#define my_safe_alloca(size, min_length) ((size <= min_length) ? my_alloca(size) : malloc(size))
38
 
#define my_safe_afree(ptr, size, min_length) if (size > min_length) free(ptr)
 
37
#define my_safe_alloca(size, min_length) ((size <= min_length) ? my_alloca(size) : my_malloc(size,MYF(0)))
 
38
#define my_safe_afree(ptr, size, min_length) if (size > min_length) my_free(ptr,MYF(0))
39
39
#endif
40
40
 
41
41
 
236
236
  bool transactional_table, joins_freed= false;
237
237
  bool changed;
238
238
  bool was_insert_delayed= (table_list->lock_type ==  TL_WRITE_DELAYED);
239
 
  uint32_t value_count;
 
239
  uint value_count;
240
240
  ulong counter = 1;
241
241
  uint64_t id;
242
242
  COPY_INFO info;
749
749
 
750
750
        /* Check if there is more uniq keys after field */
751
751
 
752
 
static int last_uniq_key(Table *table,uint32_t keynr)
 
752
static int last_uniq_key(Table *table,uint keynr)
753
753
{
754
754
  while (++keynr < table->s->keys)
755
755
    if (table->key_info[keynr].flags & HA_NOSAME)
803
803
  {
804
804
    while ((error=table->file->ha_write_row(table->record[0])))
805
805
    {
806
 
      uint32_t key_nr;
 
806
      uint key_nr;
807
807
      /*
808
808
        If we do more than one iteration of this loop, from the second one the
809
809
        row will have an explicit value in the autoinc field, which was set at
869
869
            goto err;
870
870
          }
871
871
        }
872
 
        key_copy((unsigned char*) key,table->record[0],table->key_info+key_nr,0);
 
872
        key_copy((uchar*) key,table->record[0],table->key_info+key_nr,0);
873
873
        if ((error=(table->file->index_read_idx_map(table->record[1],key_nr,
874
 
                                                    (unsigned char*) key, HA_WHOLE_KEY,
 
874
                                                    (uchar*) key, HA_WHOLE_KEY,
875
875
                                                    HA_READ_KEY_EXACT))))
876
876
          goto err;
877
877
      }
1215
1215
      while ((item= li++))
1216
1216
      {
1217
1217
        item->transform(&Item::update_value_transformer,
1218
 
                        (unsigned char*)lex->current_select);
 
1218
                        (uchar*)lex->current_select);
1219
1219
      }
1220
1220
    }
1221
1221
 
1386
1386
    fill_record(thd, table->field, values, 1);
1387
1387
}
1388
1388
 
1389
 
void select_insert::send_error(uint32_t errcode,const char *err)
 
1389
void select_insert::send_error(uint errcode,const char *err)
1390
1390
{
1391
1391
  
1392
1392
 
1565
1565
  Table tmp_table;              // Used during 'Create_field()'
1566
1566
  TABLE_SHARE share;
1567
1567
  Table *table= 0;
1568
 
  uint32_t select_field_count= items->elements;
 
1568
  uint select_field_count= items->elements;
1569
1569
  /* Add selected items to field list */
1570
1570
  List_iterator_fast<Item> it(*items);
1571
1571
  Item *item;
1748
1748
      }
1749
1749
 
1750
1750
  private:
1751
 
    virtual int do_postlock(Table **tables, uint32_t count)
 
1751
    virtual int do_postlock(Table **tables, uint count)
1752
1752
    {
1753
1753
      THD *thd= const_cast<THD*>(ptr->get_thd());
1754
1754
      if (int error= decide_logging_format(thd, &all_tables))
1836
1836
}
1837
1837
 
1838
1838
void
1839
 
select_create::binlog_show_create_table(Table **tables, uint32_t count)
 
1839
select_create::binlog_show_create_table(Table **tables, uint count)
1840
1840
{
1841
1841
  /*
1842
1842
    Note 1: In RBR mode, we generate a CREATE TABLE statement for the
1882
1882
}
1883
1883
 
1884
1884
 
1885
 
void select_create::send_error(uint32_t errcode,const char *err)
 
1885
void select_create::send_error(uint errcode,const char *err)
1886
1886
{
1887
1887
  
1888
1888