~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_update.cc

  • Committer: Brian Aker
  • Date: 2008-08-19 22:40:04 UTC
  • Revision ID: brian@tangent.org-20080819224004-tcgp7mptob0jkfmc
More Table cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <drizzled/sql_select.h>
23
23
#include <drizzled/drizzled_error_messages.h>
24
24
 
25
 
/* Return 0 if row hasn't changed */
26
 
 
27
 
bool compare_record(Table *table)
28
 
{
29
 
  if (table->s->blob_fields + table->s->varchar_fields == 0)
30
 
    return cmp_record(table,record[1]);
31
 
  /* Compare null bits */
32
 
  if (memcmp(table->null_flags,
33
 
             table->null_flags+table->s->rec_buff_length,
34
 
             table->s->null_bytes))
35
 
    return true;                                // Diff in NULL value
36
 
  /* Compare updated fields */
37
 
  for (Field **ptr= table->field ; *ptr ; ptr++)
38
 
  {
39
 
    if (bitmap_is_set(table->write_set, (*ptr)->field_index) &&
40
 
        (*ptr)->cmp_binary_offset(table->s->rec_buff_length))
41
 
      return true;
42
 
  }
43
 
  return false;
44
 
}
45
 
 
46
 
 
47
25
/*
48
26
  check that all fields are real fields
49
27
 
518
496
 
519
497
      found++;
520
498
 
521
 
      if (!can_compare_record || compare_record(table))
 
499
      if (!can_compare_record || table->compare_record())
522
500
      {
523
501
        if (will_batch)
524
502
        {
1385
1363
        return(1);
1386
1364
 
1387
1365
      found++;
1388
 
      if (!can_compare_record || compare_record(table))
 
1366
      if (!can_compare_record || table->compare_record())
1389
1367
      {
1390
1368
        int error;
1391
1369
        if (!updated++)
1627
1605
           copy_field_ptr++)
1628
1606
        (*copy_field_ptr->do_copy)(copy_field_ptr);
1629
1607
 
1630
 
      if (!can_compare_record || compare_record(table))
 
1608
      if (!can_compare_record || table->compare_record())
1631
1609
      {
1632
1610
        if ((local_error=table->file->ha_update_row(table->record[1],
1633
1611
                                                    table->record[0])) &&