wind-c / comqtt

A lightweight, high-performance go mqtt server(v3.0|v3.1.1|v5.0) supporting distributed cluster
MIT License
972 stars 53 forks source link

The creation of the prepared statements for the postgresql auth #67

Closed asbjorn closed 1 year ago

asbjorn commented 1 year ago

This auth plugin panic'ed due to a slightly slienced bug in the auth/postgresql.go plugin. When creating the a.authStmt the returned error is disregared: https://github.com/wind-c/comqtt/blob/main/plugin/auth/postgresql/postgresql.go#L97

After adding a check here I saw that sqlx didn't like the syntax of the SQL query. Changed to use $1 instead of '?' fixed the issue.

wind-c commented 1 year ago

good job