Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
haoxins committed Feb 15, 2024
1 parent 815df31 commit fb1aa2d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion label.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (field LabelFieldSchema) BuildAddFieldQL(labelName string) string {
}

func (field Label) BuildDropFieldQL(labelName string) string {
return "ALTER TAG " + labelName + " DROP " + field.Field + ";"
return "ALTER TAG " + labelName + " DROP (" + field.Field + ");"
}

type LabelName struct {
Expand Down
2 changes: 1 addition & 1 deletion label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ func TestBuildDropFieldQL(t *testing.T) {
field := Label{
Field: "name",
}
assert.Equal(t, "ALTER TAG account DROP name;", field.BuildDropFieldQL("account"))
assert.Equal(t, "ALTER TAG account DROP (name);", field.BuildDropFieldQL("account"))
}
4 changes: 0 additions & 4 deletions session_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,6 @@ func (pool *SessionPool) ApplyTag(tag LabelSchema) (*ResultSet, error) {
if !found {
// 4.2 Add the not exists field
q := expected.BuildAddFieldQL(tag.Name)
fmt.Println("DEBUG: Add field")
fmt.Println(q)
_, err := pool.ExecuteAndCheck(q)
if err != nil {
return nil, err
Expand All @@ -388,8 +386,6 @@ func (pool *SessionPool) ApplyTag(tag LabelSchema) (*ResultSet, error) {
if redundant {
// 5.1 Remove the not expected field
q := actual.BuildDropFieldQL(tag.Name)
fmt.Println("DEBUG: Remove field")
fmt.Println(q)
_, err := pool.ExecuteAndCheck(q)
if err != nil {
return nil, err
Expand Down

0 comments on commit fb1aa2d

Please sign in to comment.