multi-row UPDATE causing malformed transaction_log entry

Bug #645330 reported by Patrick Crews
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Won't Fix
High
Unassigned

Bug Description

The following UPDATE statement is wreaking havoc on the transaction log, causing a malformed message to be entered into the log:

UPDATE `bb` SET `col_int` = 0 WHERE `col_bigint` != 9 ORDER BY `col_bigint`,`col_bigint_key`,`col_bigint_not_null`,`col_bigint_not_null_key`,`col_char_10`,`col_char_1024`,`col_char_1024_key`,`col_char_1024_not_null`,`col_char_1024_not_null_key`,`col_char_10_key`,`col_char_10_not_null`,`col_char_10_not_null_key`,`col_enum`,`col_enum_key`,`col_enum_not_null`,`col_enum_not_null_key`,`col_int`,`col_int_key`,`col_int_not_null`,`col_int_not_null_key`,`col_text`,`col_text_key`,`col_text_not_null`,`col_text_not_null_key`,`pk` LIMIT 6 ;
Query OK, 6 rows affected (0.17 sec)
Rows matched: 6 Changed: 6 Warnings: 0

Transaction_log message for this entry:
NOTE how the entry for key_value 205 is missing vital message elements.

A test case will be coming shortly.

drizzle> select print_transaction_message('transaction_log',307074);
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| print_transaction_message('transaction_log',307074) |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| transaction_context {
  server_id: 1
  transaction_id: 251
  start_timestamp: 1285169458246687
  end_timestamp: 1285169458305609
}
statement {
  type: UPDATE
  start_timestamp: 1285169458246691
  end_timestamp: 1285169458305607
  update_header {
    table_metadata {
      schema_name: "test"
      table_name: "bb"
    }
    key_field_metadata {
      type: INTEGER
      name: "pk"
    }
    set_field_metadata {
      type: INTEGER
      name: "col_int"
    }
  }
  update_data {
    segment_id: 1
    end_segment: true
    record {
      key_value: "202"
      after_value: "0"
      is_null: false
    }
    record {
      key_value: "203"
      after_value: "0"
      is_null: false
    }
    record {
      key_value: "204"
      after_value: "0"
      is_null: false
    }
    record {
      key_value: "205"
    }
    record {
      key_value: "206"
      after_value: "0"
      is_null: false
    }
    record {
      key_value: "266"
      after_value: "0"
      is_null: false
    }
  }
}
 |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Tags: replication
Revision history for this message
Patrick Crews (patrick-crews) wrote :

Calling transaction_reader against the log with this entry results in a fatal error:
libprotobuf FATAL /usr/include/google/protobuf/repeated_field.h:412] CHECK failed: (index) < (size()):
Aborted

Revision history for this message
Patrick Crews (patrick-crews) wrote :

This could be related to:
https://bugs.launchpad.net/drizzle/+bug/644529
Transaction_log not properly capturing relevant data for UPDATE statements

Both bugs result in missing data from the log.

However, I am writing this up as a separate bug as this bug results in a log that can't be read by transaction_reader while the other bug merely results in malformed SQL. These could be separate, but we can retest both whenever either has a fix.

Revision history for this message
Patrick Crews (patrick-crews) wrote :

Fixed by the patch for Bug644529

Changed in drizzle:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.