Skip to content

Commit 4081fd8

Browse files
committed
* Fixed sugar.RemoveRecursive() for column table type
1 parent 68067c3 commit 4081fd8

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
env:
6262
OS: ubuntu-latest
6363
GO: ${{ matrix.go-version }}
64+
YDB_VERSION: ${{ matrix.ydb-version }}
6465
YDB_CONNECTION_STRING: grpc://localhost:2136/local
6566
YDB_CONNECTION_STRING_SECURE: grpcs://localhost:2135/local
6667
YDB_SSL_ROOT_CERTIFICATES_FILE: /tmp/ydb_certs/ca.pem

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Fixed `sugar.RemoveRecursive()` for column table type
2+
13
## v3.48.7
24
* Added `sugar.StackRecord()` helper for stringification of current file path and line
35
* Updated `google.golang.org/grpc` from `v1.49.0` to `v1.53.0` due to vulnerability

sugar/path.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func RemoveRecursive(ctx context.Context, db dbFoRemoveRecursive, pathToRemove s
132132
)
133133
}
134134

135-
case scheme.EntryTable:
135+
case scheme.EntryTable, scheme.EntryColumnTable:
136136
err = db.Table().Do(ctx, func(ctx context.Context, session table.Session) (err error) {
137137
return session.DropTable(ctx, pt)
138138
}, table.WithIdempotent())

tests/integration/sugar_make_remove_recursive_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ package integration
55

66
import (
77
"fmt"
8+
"os"
89
"path"
10+
"strconv"
11+
"strings"
912
"testing"
1013

1114
"github.com/stretchr/testify/require"
@@ -36,6 +39,27 @@ func TestSugarMakeRemoveRecursive(t *testing.T) {
3639
_, err = db.Scripting().Execute(scope.Ctx, query, nil)
3740
require.NoError(t, err)
3841

42+
if v, has := os.LookupEnv("YDB_VERSION"); has {
43+
vv := strings.Split(v, ".")
44+
if len(vv) >= 2 {
45+
year, err := strconv.Atoi(vv[0])
46+
if err == nil {
47+
release, err := strconv.Atoi(vv[1])
48+
if err == nil {
49+
if year >= 23 && release >= 2 {
50+
tablePath = path.Join(testPrefix, "columnTableName")
51+
query = fmt.Sprintf(
52+
"CREATE TABLE `%v` (id Uint64 NOT NULL, PRIMARY KEY (id)) PARTITION BY HASH(id) WITH (STORE = COLUMN)",
53+
tablePath,
54+
)
55+
_, err = db.Scripting().Execute(scope.Ctx, query, nil)
56+
require.NoError(t, err)
57+
}
58+
}
59+
}
60+
}
61+
}
62+
3963
err = db.Topic().Create(scope.Ctx, path.Join(testPrefix, "topic"))
4064
require.NoError(t, err)
4165

0 commit comments

Comments
 (0)