Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-481

Inconsistent Fingerprinting in go-mysql in multi-line comments

    Details

    • Type: Bug
    • Status: Done
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0
    • Component/s: QAN Agent
    • Labels:
      None

      Description

      %> cat main.go
      package main
      
      import (
              "fmt"
              "github.com/percona/go-mysql/query"
      )
      
      func main() {
              q1 := "SELECT * FROM table WHERE field = 'value' /*arbitrary/31*/"
              f1 := query.Fingerprint(q1)
              id1 := query.Id(f1)
              fmt.Println("===== QUERY 1")
              fmt.Println(" q: [", q1, "]")
              fmt.Println(" f: [", f1, "]")
              fmt.Println("id: [", id1, "]")
      
              q2 := "SELECT * FROM table WHERE field = 'value' /*arbitrary31*/"
              f2 := query.Fingerprint(q2)
              id2 := query.Id(f2)
              fmt.Println("===== QUERY 2")
              fmt.Println(" q: [", q2, "]")
              fmt.Println(" f: [", f2, "]")
              fmt.Println("id: [", id2, "]")
      }
      %> go run main.go
      ===== QUERY 1
       q: [ SELECT * FROM table WHERE field = 'value' /*arbitrary/31*/ ]
       f: [ select * from table where field = ? /*arbitrary/?*/ ]
      id: [ F2D4BF522FAE8BE1 ]
      ===== QUERY 2
       q: [ SELECT * FROM table WHERE field = 'value' /*arbitrary31*/ ]
       f: [ select * from table where field = ? ]
      id: [ E19A06BFFDDCE93F ]
      

      These two queries should fingerprint to the same thing.

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                carlos.salguero Carlos Salguero
                Reporter:
                RoomieGunns Ryan Lowe
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: