~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_update.cc

Giant merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
177
177
                 COND *conds,
178
178
                 uint order_num, ORDER *order,
179
179
                 ha_rows limit,
180
 
                 enum enum_duplicates handle_duplicates __attribute__((__unused__)),
 
180
                 enum enum_duplicates handle_duplicates __attribute__((unused)),
181
181
                 bool ignore)
182
182
{
183
183
  bool          using_limit= limit != HA_POS_ERROR;
1046
1046
  Connect fields with tables and create list of tables that are updated
1047
1047
*/
1048
1048
 
1049
 
int multi_update::prepare(List<Item> &not_used_values __attribute__((__unused__)),
1050
 
                          SELECT_LEX_UNIT *lex_unit __attribute__((__unused__)))
 
1049
int multi_update::prepare(List<Item> &not_used_values __attribute__((unused)),
 
1050
                          SELECT_LEX_UNIT *lex_unit __attribute__((unused)))
1051
1051
{
1052
1052
  TABLE_LIST *table_ref;
1053
1053
  SQL_LIST update;
1270
1270
    {
1271
1271
      Field_string *field= new Field_string(tbl->file->ref_length, 0,
1272
1272
                                            tbl->alias, &my_charset_bin);
 
1273
#ifdef OLD
 
1274
      Field_varstring *field= new Field_varstring(tbl->file->ref_length, 0,
 
1275
                                                  tbl->alias, tbl->s, &my_charset_bin);
 
1276
#endif
1273
1277
      if (!field)
1274
1278
        return(1);
1275
1279
      field->init(tbl);
1277
1281
        The field will be converted to varstring when creating tmp table if
1278
1282
        table to be updated was created by mysql 4.1. Deny this.
1279
1283
      */
1280
 
      field->can_alter_field_type= 0;
1281
1284
      Item_field *ifield= new Item_field((Field *) field);
1282
1285
      if (!ifield)
1283
1286
         return(1);
1289
1292
    temp_fields.concat(fields_for_table[cnt]);
1290
1293
 
1291
1294
    /* Make an unique key over the first field to avoid duplicated updates */
1292
 
    bzero((char*) &group, sizeof(group));
 
1295
    memset((char*) &group, 0, sizeof(group));
1293
1296
    group.asc= 1;
1294
1297
    group.item= (Item**) temp_fields.head_ref();
1295
1298
 
1340
1343
}
1341
1344
 
1342
1345
 
1343
 
bool multi_update::send_data(List<Item> &not_used_values __attribute__((__unused__)))
 
1346
bool multi_update::send_data(List<Item> &not_used_values __attribute__((unused)))
1344
1347
{
1345
1348
  TABLE_LIST *cur_table;
1346
1349