~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_update.cc

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
{
76
76
  Field **field_p;
77
77
  Field *field;
78
 
  uint keynr;
 
78
  uint32_t keynr;
79
79
  MY_BITMAP unique_map; /* Fields in offended unique. */
80
80
  my_bitmap_map unique_map_buf[bitmap_buffer_size(MAX_FIELDS)];
81
81
  
153
153
                 List<Item> &fields,
154
154
                 List<Item> &values,
155
155
                 COND *conds,
156
 
                 uint order_num, order_st *order,
 
156
                 uint32_t order_num, order_st *order,
157
157
                 ha_rows limit,
158
158
                 enum enum_duplicates handle_duplicates __attribute__((unused)),
159
159
                 bool ignore)
165
165
  int           error, loc_error;
166
166
  uint          used_index= MAX_KEY, dup_key_found;
167
167
  bool          need_sort= true;
168
 
  uint          table_count= 0;
 
168
  uint32_t          table_count= 0;
169
169
  ha_rows       updated, found;
170
170
  key_map       old_covering_keys;
171
171
  Table         *table;
334
334
        to update
335
335
        NOTE: filesort will call table->prepare_for_position()
336
336
      */
337
 
      uint         length= 0;
 
337
      uint32_t         length= 0;
338
338
      SORT_FIELD  *sortorder;
339
339
      ha_rows examined_rows;
340
340
 
731
731
    true  error
732
732
*/
733
733
bool mysql_prepare_update(THD *thd, TableList *table_list,
734
 
                         Item **conds, uint order_num, order_st *order)
 
734
                         Item **conds, uint32_t order_num, order_st *order)
735
735
{
736
736
  List<Item> all_fields;
737
737
  SELECT_LEX *select_lex= &thd->lex->select_lex;
823
823
    counter else junk will be assigned here, but then replaced with real
824
824
    count in open_tables()
825
825
  */
826
 
  uint  table_count= lex->table_count;
 
826
  uint32_t  table_count= lex->table_count;
827
827
  const bool using_lock_tables= thd->locked_tables != 0;
828
828
  bool original_multiupdate= (thd->lex->sql_command == SQLCOM_UPDATE_MULTI);
829
829
  bool need_reopen= false;
1028
1028
  Item_field *item;
1029
1029
  List_iterator_fast<Item> field_it(*fields);
1030
1030
  List_iterator_fast<Item> value_it(*values);
1031
 
  uint i, max_fields;
1032
 
  uint leaf_table_count= 0;
 
1031
  uint32_t i, max_fields;
 
1032
  uint32_t leaf_table_count= 0;
1033
1033
  
1034
1034
  thd->count_cuted_fields= CHECK_FIELD_WARN;
1035
1035
  thd->cuted_fields=0L;
1103
1103
  while ((item= (Item_field *) field_it++))
1104
1104
  {
1105
1105
    Item *value= value_it++;
1106
 
    uint offset= item->field->table->pos_in_table_list->shared;
 
1106
    uint32_t offset= item->field->table->pos_in_table_list->shared;
1107
1107
    fields_for_table[offset]->push_back(item);
1108
1108
    values_for_table[offset]->push_back(value);
1109
1109
  }
1209
1209
  for (table_ref= update_tables; table_ref; table_ref= table_ref->next_local)
1210
1210
  {
1211
1211
    Table *table=table_ref->table;
1212
 
    uint cnt= table_ref->shared;
 
1212
    uint32_t cnt= table_ref->shared;
1213
1213
    List<Item> temp_fields;
1214
1214
    order_st     group;
1215
1215
    TMP_TABLE_PARAM *tmp_param;
1299
1299
 
1300
1300
  if (tmp_tables)
1301
1301
  {
1302
 
    for (uint cnt = 0; cnt < table_count; cnt++)
 
1302
    for (uint32_t cnt = 0; cnt < table_count; cnt++)
1303
1303
    {
1304
1304
      if (tmp_tables[cnt])
1305
1305
      {
1323
1323
  for (cur_table= update_tables; cur_table; cur_table= cur_table->next_local)
1324
1324
  {
1325
1325
    Table *table= cur_table->table;
1326
 
    uint offset= cur_table->shared;
 
1326
    uint32_t offset= cur_table->shared;
1327
1327
    /*
1328
1328
      Check if we are using outer join and we didn't find the row
1329
1329
      or if we have already updated this row in the previous call to this
1419
1419
       For updatable VIEW store rowid of the updated table and
1420
1420
       rowids of tables used in the CHECK OPTION condition.
1421
1421
      */
1422
 
      uint field_num= 0;
 
1422
      uint32_t field_num= 0;
1423
1423
      List_iterator_fast<Table> tbl_it(unupdated_check_opt_tables);
1424
1424
      Table *tbl= table;
1425
1425
      do
1456
1456
}
1457
1457
 
1458
1458
 
1459
 
void multi_update::send_error(uint errcode,const char *err)
 
1459
void multi_update::send_error(uint32_t errcode,const char *err)
1460
1460
{
1461
1461
  /* First send error what ever it is ... */
1462
1462
  my_error(errcode, MYF(0), err);
1524
1524
  for (cur_table= update_tables; cur_table; cur_table= cur_table->next_local)
1525
1525
  {
1526
1526
    bool can_compare_record;
1527
 
    uint offset= cur_table->shared;
 
1527
    uint32_t offset= cur_table->shared;
1528
1528
 
1529
1529
    table = cur_table->table;
1530
1530
    if (table == table_to_update)
1581
1581
      /* call rnd_pos() using rowids from temporary table */
1582
1582
      check_opt_it.rewind();
1583
1583
      Table *tbl= table;
1584
 
      uint field_num= 0;
 
1584
      uint32_t field_num= 0;
1585
1585
      do
1586
1586
      {
1587
1587
        if((local_error=