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

3.1.0.0: tcp连接多次运行query失败,restful和ws连接正常 #188

Open
git-az opened this issue Aug 23, 2023 · 4 comments
Open

3.1.0.0: tcp连接多次运行query失败,restful和ws连接正常 #188

git-az opened this issue Aug 23, 2023 · 4 comments

Comments

@git-az
Copy link

git-az commented Aug 23, 2023

  1. docker方式启动tdengine, https://docs.taosdata.com/get-started/docker/
  2. sql.Open("taosSql", dsn), db.Query(sql), 多次执行Query,第一次成功,第二次失败
@sangshuduo
Copy link
Contributor

请提供可以复现问题的代码

@git-az
Copy link
Author

git-az commented Aug 25, 2023

ctx := context.TODO()
db,_ := sql.Open("taosSql", connstr)
conn,_ := db.Conn(ctx)
defer conn.Close()

rows,err := conn.QueryContext(ctx, "SELECT .....")
if err != nil {
/
第二次 执行query,会提示出错,使用 taosRestful 和 taosWS 没问题 */
return err
}
defer rows.Close()

for rows.Next() {
rows.Scan(...)
}
return nil

@git-az
Copy link
Author

git-az commented Aug 25, 2023

taosSql和taosRestful, taosWS的行为不一致

@sangshuduo
Copy link
Contributor

请提供完整的可以复现问题的代码和用于示例问题的建库建表语句

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

No branches or pull requests

2 participants