fix(keeper): fix sql for log.logs stable

This commit is contained in:
qevolg 2025-02-11 15:04:35 +08:00
parent d772b95f12
commit 45286613d3
2 changed files with 9 additions and 1 deletions

View File

@ -411,9 +411,11 @@ func (p *Processor) Prepare() {
func (p *Processor) withDBName(tableName string) string {
b := pool.BytesPoolGet()
b.WriteByte('`')
b.WriteString(p.db)
b.WriteByte('.')
b.WriteString("`.`")
b.WriteString(tableName)
b.WriteByte('`')
return b.String()
}

View File

@ -119,3 +119,9 @@ func Test_getStatusStr(t *testing.T) {
assert.Equal(t, tt.expected, res)
}
}
func Test_withDBName(t *testing.T) {
processor := &Processor{db: "db"}
res := processor.withDBName("test")
assert.Equal(t, res, "`db`.`test`")
}