diff options
author | tsmax2004 <tsmax2004@ydb.tech> | 2023-11-28 17:06:27 +0300 |
---|---|---|
committer | tsmax2004 <tsmax2004@ydb.tech> | 2023-11-28 18:13:26 +0300 |
commit | 5e35ed89257fa2a1d06f1100c05ad41bcb7ef441 (patch) | |
tree | d7cf145a7a4c094848fa12ec7d6ec480c1ed96cd /vendor/github.com/ClickHouse/ch-go/proto/col_fixedstr16_unsafe_gen.go | |
parent | e86f906e854caf259f096dd20f0f09425a178d28 (diff) | |
download | ydb-5e35ed89257fa2a1d06f1100c05ad41bcb7ef441.tar.gz |
Contrib: update vendor/github.com/ClickHouse/ch-go v0.56.1 => v0.58.2
В текущей версии в Аркадии библиотека неверно выводит тип Date32, не хватает этого фикса https://github.com/ClickHouse/clickhouse-go/pull/1069
Diffstat (limited to 'vendor/github.com/ClickHouse/ch-go/proto/col_fixedstr16_unsafe_gen.go')
-rw-r--r-- | vendor/github.com/ClickHouse/ch-go/proto/col_fixedstr16_unsafe_gen.go | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/vendor/github.com/ClickHouse/ch-go/proto/col_fixedstr16_unsafe_gen.go b/vendor/github.com/ClickHouse/ch-go/proto/col_fixedstr16_unsafe_gen.go new file mode 100644 index 0000000000..5d0dbeee33 --- /dev/null +++ b/vendor/github.com/ClickHouse/ch-go/proto/col_fixedstr16_unsafe_gen.go @@ -0,0 +1,45 @@ +//go:build (amd64 || arm64 || riscv64) && !purego + +// Code generated by ./cmd/ch-gen-col, DO NOT EDIT. + +package proto + +import ( + "unsafe" + + "github.com/go-faster/errors" +) + +// DecodeColumn decodes FixedStr16 rows from *Reader. +func (c *ColFixedStr16) DecodeColumn(r *Reader, rows int) error { + if rows == 0 { + return nil + } + *c = append(*c, make([][16]byte, rows)...) + s := *(*slice)(unsafe.Pointer(c)) + const size = 16 + s.Len *= size + s.Cap *= size + dst := *(*[]byte)(unsafe.Pointer(&s)) + if err := r.ReadFull(dst); err != nil { + return errors.Wrap(err, "read full") + } + return nil +} + +// EncodeColumn encodes FixedStr16 rows to *Buffer. +func (c ColFixedStr16) EncodeColumn(b *Buffer) { + v := c + if len(v) == 0 { + return + } + offset := len(b.Buf) + const size = 16 + b.Buf = append(b.Buf, make([]byte, size*len(v))...) + s := *(*slice)(unsafe.Pointer(&v)) + s.Len *= size + s.Cap *= size + src := *(*[]byte)(unsafe.Pointer(&s)) + dst := b.Buf[offset:] + copy(dst, src) +} |