Skip to content

Remove quotes from stacktrace to work better with mysqldumpslow#6

Merged
hsource merged 1 commit intomainfrom
harry-quotes
Jun 15, 2024
Merged

Remove quotes from stacktrace to work better with mysqldumpslow#6
hsource merged 1 commit intomainfrom
harry-quotes

Conversation

@hsource
Copy link
Copy Markdown
Contributor

@hsource hsource commented Jun 15, 2024

Motivation

After dumpling slow query logs with our stacktraces using the mysqldumpslow shell script that comes with MySQL/MariaDB, the stacktraces all get truncated to /* stacktrace='S' */ which isn't very useful.

Fix

Just don't surround the stacktraces with a single quote.

Testing

Ran yarn add wanderlog/sqlcommenter-sequelize#harry-quotes and then ran the db/index.test.ts test file and verified the output included the stacktrace:

    expect(query).toMatchInlineSnapshot(`
      "Executing (default): SELECT \`id\` FROM \`Users\` AS \`User\` LIMIT 1; /* stacktrace=
      at doFindOne /Users/harry/Code/itineraries/server/libs/db/index.test.ts:17:3
      at Object.anonymous /Users/harry/Code/itineraries/server/libs/db/index.test.ts:7:5 */"
    `);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant