From fb1aa2d715c8c1fccae01ec86269626ac408f448 Mon Sep 17 00:00:00 2001 From: Xin Hao Date: Thu, 15 Feb 2024 20:43:55 +0800 Subject: [PATCH] Fix --- label.go | 2 +- label_test.go | 2 +- session_pool.go | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/label.go b/label.go index f3a9b6f8..5ec95ca1 100644 --- a/label.go +++ b/label.go @@ -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 { diff --git a/label_test.go b/label_test.go index 77483b7e..bf355bc5 100644 --- a/label_test.go +++ b/label_test.go @@ -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")) } diff --git a/session_pool.go b/session_pool.go index 963be2db..eb11747f 100644 --- a/session_pool.go +++ b/session_pool.go @@ -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 @@ -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