Transaction reader not properly converting all NULL values into usable SQL

Bug #641685 reported by Patrick Crews
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
High
Joe Daly
7.0
Fix Released
High
Joe Daly

Bug Description

drizzled/message/transaction_reader is misinterpreting the transaction log contents:

The data below shows that the transaction log itself is capturing the data properly (is_null is noted correctly). However, transaction reader is not reassembling the log into proper SQL - the generated INSERT fails.

Original data:
INSERT INTO `c` VALUES (1,NULL,'',2,'t',NULL,'d','v','','h',3251880405938208768,'v',0,'q',NULL,NULL,'n','h',1,6,'look','TYZGK','b','JRKMQ',NULL);

Transaction_reader output, note how we don't have NULL between 't' and 'd', between NULL and 'n'
INSERT INTO `test`.`c` (`pk`,`col_int_key`,`col_text_not_null_key`,`col_bigint_key`,`col_char_10_not_null`,`col_text_key`,`col_char_10_not_null_key`,`col_enum`,`col_text_not_null`,`col_enum_key`,`col_bigint_not_null_key`,`col_enum_not_null`,`col_int_not_null_key`,`col_char_1024`,`col_int`,`col_text`,`col_enum_not_null_key`,`col_char_10`,`col_bigint_not_null`,`col_int_not_null`,`col_char_1024_not_null`,`col_char_1024_not_null_key`,`col_char_10_key`,`col_char_1024_key`,`col_bigint`) VALUES (1,NULL,'',2,'t',,'d',v,'',h,3251880405938208768,v,0,'q',NULL,,n,'h',1,6,'look','TYZGK','b','JRKMQ',NULL);

statement {
  type: INSERT
  start_timestamp: 1284763044959043
  end_timestamp: 1284763045008367
  insert_header {
    table_metadata {
      schema_name: "test"
      table_name: "c"
    }
    field_metadata {
      type: INTEGER
      name: "pk"
    }
    field_metadata {
      type: INTEGER
      name: "col_int_key"
    }
    field_metadata {
      type: BLOB
      name: "col_text_not_null_key"
    }
    field_metadata {
      type: BIGINT
      name: "col_bigint_key"
    }
    field_metadata {
      type: VARCHAR
      name: "col_char_10_not_null"
    }
    field_metadata {
      type: BLOB
      name: "col_text_key"
    }
    field_metadata {
      type: VARCHAR
      name: "col_char_10_not_null_key"
    }
    field_metadata {
      type: ENUM
      name: "col_enum"
    }
    field_metadata {
      type: BLOB
      name: "col_text_not_null"
    }
    field_metadata {
      type: ENUM
      name: "col_enum_key"
    }
    field_metadata {
      type: BIGINT
      name: "col_bigint_not_null_key"
    }
    field_metadata {
      type: ENUM
      name: "col_enum_not_null"
    }
    field_metadata {
      type: INTEGER
      name: "col_int_not_null_key"
    }
    field_metadata {
      type: VARCHAR
      name: "col_char_1024"
    }
    field_metadata {
      type: INTEGER
      name: "col_int"
    }
    field_metadata {
      type: BLOB
      name: "col_text"
    }
    field_metadata {
      type: ENUM
      name: "col_enum_not_null_key"
    }
    field_metadata {
      type: VARCHAR
      name: "col_char_10"
    }
    field_metadata {
      type: BIGINT
      name: "col_bigint_not_null"
    }
    field_metadata {
      type: INTEGER
      name: "col_int_not_null"
    }
    field_metadata {
      type: VARCHAR
      name: "col_char_1024_not_null"
    }
    field_metadata {
      type: VARCHAR
      name: "col_char_1024_not_null_key"
    }
    field_metadata {
      type: VARCHAR
      name: "col_char_10_key"
    }
    field_metadata {
      type: VARCHAR
      name: "col_char_1024_key"
    }
    field_metadata {
      type: BIGINT
      name: "col_bigint"
    }
  }
  insert_data {
    segment_id: 1
    end_segment: true
    record {
      insert_value: "1"
      insert_value: ""
      insert_value: ""
      insert_value: "2"
      insert_value: "t"
      insert_value: ""
      insert_value: "d"
      insert_value: "v"
      insert_value: ""
      insert_value: "h"
      insert_value: "3251880405938208768"
      insert_value: "v"
      insert_value: "0"
      insert_value: "q"
      insert_value: ""
      insert_value: ""
      insert_value: "n"
      insert_value: "h"
      insert_value: "1"
      insert_value: "6"
      insert_value: "look"
      insert_value: "TYZGK"
      insert_value: "b"
      insert_value: "JRKMQ"
      insert_value: ""
      is_null: false
      is_null: true
      is_null: false
      is_null: false
      is_null: false
      is_null: true
      is_null: false
      is_null: false
      is_null: false
      is_null: false
      is_null: false
      is_null: false
      is_null: false
      is_null: false
      is_null: true
      is_null: true
      is_null: false
      is_null: false
      is_null: false
      is_null: false
      is_null: false
      is_null: false
      is_null: false
      is_null: false
      is_null: true
    }
  }
}

Related branches

Changed in drizzle:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → David Shrewsbury (dshrews)
Revision history for this message
Joe Daly (skinny.moey) wrote :

Ill take a look at this as I made the original null changes

Changed in drizzle:
assignee: David Shrewsbury (dshrews) → Joe Daly (skinny.moey)
Joe Daly (skinny.moey)
Changed in drizzle:
status: Confirmed → Fix Committed
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.