opencensus-integrations / ocsql

OpenCensus SQL database driver wrapper for Go
https://opencensus.io/integrations/sql/go_sql/
Apache License 2.0
111 stars 27 forks source link

Doesn't support MemSQL with mysql driver #17

Closed bgpat closed 6 years ago

bgpat commented 6 years ago

I've used MemSQL with go-sql-driver/mysql. I tried to trace with ocsql, however below error occurred:

Error 1295: MemSQL does not support server-side prepared statements. Many client drivers support client-side prepared statements which work with MemSQL.

MemSQL requires client-side prepared statements. In golang, we can use with interpolateParams=true. With this parameter, the driver doesn't use Prepare() method.

Queryer is not implemented in the wrapped driver, so the driver executes db.Prepare(). (https://golang.org/src/database/sql/sql.go#L1561)

basvanbeek commented 6 years ago

@bgpat thanks for reporting the issue. I've tested with MemSQL and now it will succeed if using interpolateParams=true.

If you still encounter issues feel free to reopen.

bgpat commented 6 years ago

It has worked in my environt too. Thanks!