Skip to content

Commit 7a86c0f

Browse files
committed
fix conflict
1 parent 37e4f80 commit 7a86c0f

File tree

8 files changed

+12
-2586
lines changed

8 files changed

+12
-2586
lines changed

parser/model/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ go_test(
3333
shard_count = 20,
3434
deps = [
3535
"//parser/charset",
36+
"//parser/duration",
3637
"//parser/mysql",
3738
"//parser/terror",
3839
"//parser/types",

parser/model/model.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,6 +1757,9 @@ func (p *PolicyInfo) Clone() *PolicyInfo {
17571757
// DefaultJobInterval sets the default interval between TTL jobs
17581758
const DefaultJobInterval = time.Hour
17591759

1760+
// DefaultJobIntervalStr is the string representation of DefaultJobInterval
1761+
const DefaultJobIntervalStr = "1h"
1762+
17601763
// TTLInfo records the TTL config
17611764
type TTLInfo struct {
17621765
ColumnName CIStr `json:"column"`

parser/model/model_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"time"
2121

2222
"github.com/pingcap/tidb/parser/charset"
23+
"github.com/pingcap/tidb/parser/duration"
2324
"github.com/pingcap/tidb/parser/mysql"
2425
"github.com/pingcap/tidb/parser/types"
2526
"github.com/stretchr/testify/require"
@@ -818,3 +819,10 @@ func TestTTLJobInterval(t *testing.T) {
818819
require.NoError(t, err)
819820
require.Equal(t, time.Hour*200, interval)
820821
}
822+
823+
func TestTTLDefaultJobInterval(t *testing.T) {
824+
// test const `DefaultJobIntervalStr` and `DefaultJobInterval` are consistent.
825+
d, err := duration.ParseDuration(DefaultJobIntervalStr)
826+
require.NoError(t, err)
827+
require.Equal(t, DefaultJobInterval, d)
828+
}

pkg/meta/model/BUILD.bazel

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)