-
Notifications
You must be signed in to change notification settings - Fork 567
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main'
- Loading branch information
Showing
5 changed files
with
147 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
changelog: | ||
exclude: | ||
labels: | ||
- ignore-for-release | ||
authors: | ||
- dependabot | ||
categories: | ||
- title: Breaking Changes 🚨 | ||
labels: | ||
- Semver-Major | ||
- breaking-change | ||
- title: Enhancements 🎉 | ||
labels: | ||
- Semver-Minor | ||
- enhancement | ||
- title: Fixes 🐛 | ||
labels: | ||
- Semver-Patch | ||
- fix | ||
- title: Other Changes 🛠 | ||
labels: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package issues | ||
|
||
import ( | ||
"context" | ||
"github.com/ClickHouse/clickhouse-go/v2" | ||
"github.com/ClickHouse/clickhouse-go/v2/lib/driver" | ||
clickhouse_tests "github.com/ClickHouse/clickhouse-go/v2/tests" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
"reflect" | ||
"testing" | ||
) | ||
|
||
func Test955(t *testing.T) { | ||
var ( | ||
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{ | ||
"max_execution_time": 60, | ||
}, nil, &clickhouse.Compression{ | ||
Method: clickhouse.CompressionLZ4, | ||
}) | ||
) | ||
ctx := context.Background() | ||
require.NoError(t, err) | ||
const ddl = ` | ||
CREATE TABLE test_955 ( | ||
Col1 Nullable(UInt64) | ||
) Engine MergeTree() ORDER BY tuple() | ||
` | ||
defer func() { | ||
conn.Exec(ctx, "DROP TABLE IF EXISTS test_955") | ||
}() | ||
require.NoError(t, conn.Exec(ctx, ddl)) | ||
const baseValues = ` | ||
INSERT INTO test_955 VALUES (123), (NULL) | ||
` | ||
require.NoError(t, conn.Exec(ctx, baseValues)) | ||
|
||
rows, err := conn.Query(ctx, "SELECT * FROM test_955") | ||
require.NoError(t, err) | ||
defer func(rows driver.Rows) { | ||
_ = rows.Close() | ||
}(rows) | ||
|
||
records := make([][]any, 0) | ||
for rows.Next() { | ||
record := make([]any, 0, len(rows.ColumnTypes())) | ||
for _, ct := range rows.ColumnTypes() { | ||
record = append(record, reflect.New(ct.ScanType()).Interface()) | ||
} | ||
err = rows.Scan(record...) | ||
require.NoError(t, err) | ||
|
||
records = append(records, record) | ||
} | ||
var value *uint64 | ||
value = nil | ||
assert.Equal(t, value, *records[1][0].(**uint64)) | ||
} |