Transaction_reader not quoting enum values properly

Bug #641687 reported by Patrick Crews
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
High
David Shrewsbury
7.0
Fix Released
High
David Shrewsbury

Bug Description

The file drizzled/message/transaction_reader is not generating proper SQL from INSERT transactions:
As we can see below, the values for all enum columns are not quoted:
col_enum (8th item in the INSERTs), col_enum_key (10th item), etc

The log looks good, but transaction_reader is misinterpreting things.

Also see Bug#641685 - Transaction reader not properly converting all NULL values into usable SQL

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);

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)
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.