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

Why debug info always appears twice for only one sql. #258

Closed
taoyuan opened this issue Jul 31, 2013 · 5 comments
Closed

Why debug info always appears twice for only one sql. #258

taoyuan opened this issue Jul 31, 2013 · 5 comments

Comments

@taoyuan
Copy link

taoyuan commented Jul 31, 2013

Using option { protocol: 'pg', ..., query: { debug: true }} when connect to "postgres" database, and execute any involved query operation, the debug info always appears twice with [SQL/postgres] and [SQL/mysql], like this:

[SQL/postgres] SELECT "guid", "guid", "type", "name", "node_id", "user_id" FROM "device" WHERE "user_id" = '9f08007f-9ed9-462c-8076-f13942beec2d'
[SQL/mysql] SELECT "guid", "guid", "type", "name", "node_id", "user_id" FROM "device" WHERE "user_id" = '9f08007f-9ed9-462c-8076-f13942beec2d'

and the primary key appears twice in SELECT clause also.

@MrSwitch
Copy link

It could be the same issue, but i get the callback fired twice on save.

@dxg
Copy link
Collaborator

dxg commented Aug 1, 2013

I've also seen callbacks [and the save itself] fired twice on models with an association and autoFetch: true. Haven't got around to writing a test case yet.

dresende added a commit that referenced this issue Aug 2, 2013
This also fixes when debug is on and no DDL queries are shown
@dresende
Copy link
Owner

dresende commented Aug 2, 2013

I don't think it's the same issue. Can you please check if the debugs now appear only with "sql/postgres" prefix? If you have more information or an example of a duplicated .save()callback call please post.

@taoyuan
Copy link
Author

taoyuan commented Aug 3, 2013

  1. Yes, "sql/postgres" prefix debugs is ok, only appear once now. But the primary key still appears twice in SELECT clause.
[SQL/postgres] SELECT "id", "id", "name", "lastActive", "createdAt", "updatedAt", "user_id" FROM "Entity" WHERE "id" = 'AE09F657DABF6EA4' LIMIT 1
  1. The issue about .save() callback call twice did not happen in my environment. Maybe should contact @MrSwitch to check this.

@dresende
Copy link
Owner

dresende commented Aug 3, 2013

@MrSwitch do you have an open issue about it? (I can't remember) If not please post a quick example so we can fix it if it still happens. This one about debug lines is done

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

No branches or pull requests

4 participants