Skip to content

Commit

Permalink
Parse PrepareId from Prepare statement Response (#2448)
Browse files Browse the repository at this point in the history
* Parse PrepareId from Prepare statement Response

Cassandra response for prepare statement contains prepareid of type UUID. Currently this is parsed as string. Added code fix to parse UUID and convert the same to string
  • Loading branch information
vik5jagan authored and medcl committed Sep 6, 2016
1 parent cff60b0 commit 7b104f7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packetbeat/protos/cassandra/internal/gocql/frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,14 @@ func (f *Framer) parseResultPrepared() map[string]interface{} {

result := make(map[string]interface{})

result["prepared_id"] = string((f.decoder).ReadShortBytes())
uuid, err := UUIDFromBytes((f.decoder).ReadShortBytes())

if err != nil {
logp.Err("Error in parsing UUID")
}

result["prepared_id"] = uuid.String()

result["req_meta"] = f.parseResultMetadata(true)

if f.proto < protoVersion2 {
Expand Down

0 comments on commit 7b104f7

Please sign in to comment.