Skip to content

Commit

Permalink
BatchInsert backticks issue tests ClickHouse#1329
Browse files Browse the repository at this point in the history
  • Loading branch information
ramzes642 committed Jun 17, 2024
1 parent 6a8c623 commit d89200f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/issues/1280_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package issues

import (
"context"
"fmt"
"testing"

"github.com/ClickHouse/clickhouse-go/v2"
Expand All @@ -17,9 +18,11 @@ func Test1280(t *testing.T) {
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
env, errEnv = clickhouse_tests.GetTestEnvironment(testSet)
)
ctx := context.Background()
require.NoError(t, err)
require.NoError(t, errEnv)

ddl := "CREATE TABLE values (`id` Int32, `values` Int32) Engine = Memory"
require.NoError(t, conn.Exec(ctx, ddl))
Expand All @@ -40,6 +43,12 @@ func Test1280(t *testing.T) {
{
input: "INSERT INTO values(values)",
},
{
input: "INSERT INTO `values`(values)",
},
{
input: fmt.Sprintf("INSERT INTO `%s`.`values`(values)", env.Database),
},
}

for i, tc := range testCases1 {
Expand Down Expand Up @@ -82,6 +91,12 @@ func Test1280(t *testing.T) {
{
input: `INSERT INTO values(id, values) values (1,2)`,
},
{
input: fmt.Sprintf("INSERT INTO `%s`.`values`(id, values)", env.Database),
},
{
input: fmt.Sprintf("INSERT INTO `%s`.`values`", env.Database),
},
}

for i, tc := range testCases2 {
Expand Down

0 comments on commit d89200f

Please sign in to comment.