Skip to content

Go: Incorrect specification implementation causes traceparent not to work properly #216

@kostyay

Description

@kostyay

So I've been investigating the bug I'm having in this isssue: #211

I was checking the way the query is sent to the database and realized that the current go implementation doesnt follow the specification.
The way the current implementation adds the comments is as such:
/*action=ListUsers,route=router,traceparent=00-ef43f0b3e8c3bf30186961dXXXX-YYYY-01*/

However, the specification states that all values must be single quoted
image

So I added single quotes to all the values that are being sent to the server and suddenly everything started working, so now I'm sending this instead (notice the single quotes on each parameter):
/*action='ListUsers',route='router',traceparent='00-ef43f0b3e8c3bf30186961dXXXX-YYYY-01'*/

This worked and solved the issue.

Based on the nodejs implementation it appears that all values need to be single quoted https://github.com/google/sqlcommenter/blob/master/nodejs/sqlcommenter-nodejs/packages/sqlcommenter-knex/index.js#L95

Attaching the PR to fix it below

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions