Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

False positives with Postgres RETURNING queries #12

Open
acim opened this issue May 11, 2022 · 6 comments
Open

False positives with Postgres RETURNING queries #12

acim opened this issue May 11, 2022 · 6 comments

Comments

@acim
Copy link

acim commented May 11, 2022

Postgres queries have options to return values in INSERT and UPDATE queries. It is false positive to replace Query or QueryRow with Execute in such cases.

@1uf3
Copy link
Owner

1uf3 commented May 11, 2022

MySQL add RETURNING v8.0.21
https://dev.mysql.com/doc/refman/8.0/en/keywords.html#keywords-8-0-detailed-R

RETURNING; added in 8.0.21 (nonreserved)

@bconway
Copy link

bconway commented May 12, 2022

I have run into the same false positive with Postgres. Not sure what MySQL versioning has to do with it?

@acim
Copy link
Author

acim commented May 12, 2022

Well, I would say @lufeee means that may be the MySQL problem as well. However, I think this is deeper problem than this because if the first argument of a query is function, this static check always shows falls positive. I would recommend that if test is not absolutely sure, better to show negative.

@1uf3
Copy link
Owner

1uf3 commented May 13, 2022

@acim you mean if you use the golangci-lint, execinquery is always enable. so you should do disable. to @bconway right?

@acim
Copy link
Author

acim commented May 13, 2022

I did so but just wanted to report the bug. Thank you.

@1uf3
Copy link
Owner

1uf3 commented May 13, 2022

OK Thanks for reporting!

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

No branches or pull requests

3 participants