Comments (2)
请提供复现代码
from driver-go.
golang client driver
version:
- github.com/taosdata/driver-go/v3 v3.5.0
varchar 字段能存,但是 client driver 不能读,driver panic, int16 越界长度报错
-
复现方式:
td sql`sql CREATE STABLE `super_for_test` (`ts` TIMESTAMP, `json_value` VARCHAR(40000)) TAGS (`dev_id` VARCHAR(50));` INSERT INTO 'super_for_test_123' USING 'super_for_test' TAGS ('123') ('ts', 'json_value') VALUES (1704881588040, {{字符串len > int16}} );
-
golang clinet
func TestTDPanic(t *testing.T) {
type Tmp struct {
Ts time.Time `json:"ts" db:"ts"`
JsonStr string `json:"json_str" db:"json_value"`
}
rows, err := Ddata.td.Query("select ts, json_value from super_for_test")
require.NoError(t, err)
for rows.Next() {
r := &Tmp{}
var ts time.Time
err = rows.Scan(&ts, &r.JsonStr)
if err != nil {
require.NoError(t, err)
}
fmt.Println(r)
}
//--- FAIL: TestTDPanic (0.07s)
//panic: runtime error: makeslice: len out of range [recovered]
// panic: runtime error: makeslice: len out of range
}
- panic 位置
github.com/taosdata/driver-go/[email protected]/common/parser/block.go:200
func rawConvertBinary(pHeader, pStart uintptr, row int) driver.Value {
offset := *((*int32)(unsafe.Pointer(pHeader + uintptr(row*4))))
if offset == -1 {
return nil
}
currentRow := unsafe.Pointer(pStart + uintptr(offset))
clen := *((*int16)(currentRow))
currentRow = unsafe.Pointer(uintptr(currentRow) + 2)
println("**********: %v", clen)
binaryVal := make([]byte, clen)
for index := int16(0); index < clen; index++ {
binaryVal[index] = *((*byte)(unsafe.Pointer(uintptr(currentRow) + uintptr(index))))
}
return string(binaryVal[:])
}
output:
**********: %v -32767
from driver-go.
Related Issues (20)
- can't run on macbook m2 pro HOT 4
- 关于GO连接器taosRestful时区问题
- 执行SQL时报错: Undefined error: 0
- build constraints exclude all Go files in /root/go/pkg/mod/github.com/taosdata/driver-go/[email protected]/wrapper HOT 1
- 无法正确连接 db
- Tao驱动直接空指针 HOT 2
- go build failed after go mod tidy success. HOT 1
- 编译时提示无法找到taos.h HOT 6
- 集群三节点双副本时RPO不为0.
- Error when connecting to cluster through client.
- macOS交叉编译linux失败 HOT 1
- macos 编译失败, tdengine 2.2.0 版本 HOT 3
- InterpolateParams没有对[]byte和string类型的arg参数进行特殊处理
- 用taosWS方式连接提示 websocket: bad handshake HOT 1
- _ "github.com/taosdata/driver-go/v3/taosSql" 报错 HOT 2
- The schemaless client doesn't check for errors before using the WebSocket client which may be nil.
- TLS Support?
- Go 驱动使用占位符方式执行语句报错(好像不会自动添加双引号)
- 交叉编译ARM32应用报错
- Client Panic On Server Response HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from driver-go.