From 13850dfe6bb422f56a0520caf377b3a12fa13fdf Mon Sep 17 00:00:00 2001 From: lixxxww <941403820@qq.com> Date: Mon, 22 Jan 2024 03:23:52 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=BE=E5=A4=87=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=9B=9E=E4=BC=A0=E7=9A=84sql=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E6=B3=A8=E5=85=A5=E9=9A=90=E6=82=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lixxxww <941403820@qq.com> --- pkg/tdengine/tdengine_log.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/tdengine/tdengine_log.go b/pkg/tdengine/tdengine_log.go index 6aaeab5..f17b296 100644 --- a/pkg/tdengine/tdengine_log.go +++ b/pkg/tdengine/tdengine_log.go @@ -18,8 +18,8 @@ func (s *TdEngine) CreateLogStable() (err error) { // InsertLog 写入数据 func (s *TdEngine) InsertLog(log *TdLog) (err error) { - sql := "INSERT INTO ? USING device_log TAGS ('?') VALUES ('?', '?', '?')" - _, err = s.db.Exec(sql, "log_"+log.Device, log.Device, log.Ts, log.Type, log.Content) + sql := "INSERT INTO log_? USING device_log TAGS (?) VALUES (?, ?, ?)" + _, err = s.db.Exec(sql, log.Device, log.Device, log.Ts, log.Type, log.Content) return }