-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
应用程序使用go连接器,查询时报错,程序异常退出(ARM32位处理器)。 #15846
Comments
请确认一下在 ARM32 处理器的机器上,通过 taos shell 能正常数据写入和查询吗? |
@fenghuazzm 通过taos shell使用sql可以正常写入和查询。 |
应用程序通过go连接器,如果查询的时间范围没有数据,就不会报错。如果查询的时间范围有数据就会在github.com/taosdata/driver-go/v2/wrapper.convertFloat(0x9c90053d, 0x0, 0x4, {0xd857b8, 0x1, 0x1})这里类型转换这里报错。 |
@wild-River2016 driver-go 的版本提供下 |
@huskar-t github.com/taosdata/driver-go/v2 v2.0.4这个版本的。 |
@wild-River2016 请使用如下代码进行测试 package main
import (
"database/sql"
"fmt"
"time"
_ "github.com/taosdata/driver-go/v2/taosSql"
)
func main() {
db, err := sql.Open("taosSql", "root:taosdata@tcp(localhost:6030)/")
if err != nil {
panic(err)
}
defer db.Close()
_, err = db.Exec("create database if not exists example_taos_sql")
if err != nil {
panic(err)
}
_, err = db.Exec("create table if not exists example_taos_sql.stb(ts timestamp," +
"c1 bool," +
"c2 tinyint," +
"c3 smallint," +
"c4 int," +
"c5 bigint," +
"c6 tinyint unsigned," +
"c7 smallint unsigned," +
"c8 int unsigned," +
"c9 bigint unsigned," +
"c10 float," +
"c11 double," +
"c12 binary(20)," +
"c13 nchar(20)" +
") tags (info json)")
if err != nil {
panic(err)
}
_, err = db.Exec("create table if not exists example_taos_sql.tb1 using example_taos_sql.stb tags ('{\"name\":\"tb1\"}')")
if err != nil {
panic(err)
}
now := time.Now()
_, err = db.Exec(fmt.Sprintf("insert into example_taos_sql.tb1 values ('%s',true,2,3,4,5,6,7,8,9,10.123,11.123,'binary','nchar')", now.Format(time.RFC3339Nano)))
if err != nil {
panic(err)
}
rows, err := db.Query(fmt.Sprintf("select * from example_taos_sql.tb1 where ts = '%s'", now.Format(time.RFC3339Nano)))
if err != nil {
panic(err)
}
for rows.Next() {
var (
ts time.Time
c1 bool
c2 int8
c3 int16
c4 int32
c5 int64
c6 uint8
c7 uint16
c8 uint32
c9 uint64
c10 float32
c11 float64
c12 string
c13 string
)
err = rows.Scan(
&ts,
&c1,
&c2,
&c3,
&c4,
&c5,
&c6,
&c7,
&c8,
&c9,
&c10,
&c11,
&c12,
&c13,
)
if err != nil {
panic(err)
}
fmt.Println("ts:", ts.Local())
fmt.Println("c1:", c1)
fmt.Println("c2:", c2)
fmt.Println("c3:", c3)
fmt.Println("c4:", c4)
fmt.Println("c5:", c5)
fmt.Println("c6:", c6)
fmt.Println("c7:", c7)
fmt.Println("c8:", c8)
fmt.Println("c9:", c9)
fmt.Println("c10:", c10)
fmt.Println("c11:", c11)
fmt.Println("c12:", c12)
fmt.Println("c13:", c13)
}
} |
@huskar-t 您好,运行结果如下。 |
@wild-River2016 请提供出错时的样本和示例程序 |
@wild-River2016 您好,查询代码如下,使用的是tdengine_gorm |
@huskar-t 您好,根据您提供的测试代码,我把其他的数据类型都去掉了,只保留了float类型。数据表的创建和数据写入正常,查询还是报相同的错误。 测试代码如下
|
@huskar-t 我又基于您提供的测试用例,将其中的部分数据类型删除掉,建表和数据写入正常,查询的时候还是报错。非常奇怪,感觉查询的时候表里缺少某些数据类型,就会报错。 测试代码如下:
|
@wild-River2016 请使用 driver-go/v2 v2.0.5 再试下 |
@huskar-t 可以了,多谢! |
Bug Description
应用程序使用go连接器,查询时报错,程序异常退出(ARM32位处理器)。
To Reproduce
Steps to reproduce the behavior:
Expected Behavior
希望查询能正常返回数据。
请问目前go版本的连接器(github.com/taosdata/driver-go/v2)是否支持arm32位处理器。
Screenshots
下图为报错信息
下图为go连接器报错位置
Environment (please complete the following information):
Additional Context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: