Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove quotes from stacktrace to work better with mysqldumpslow #6

Merged
merged 1 commit into from
Jun 15, 2024

Conversation

hsource
Copy link
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