diff --git a/plugins/outputs/sql/README.md b/plugins/outputs/sql/README.md index 8863a7b0421a9..1a5d33f4336b3 100644 --- a/plugins/outputs/sql/README.md +++ b/plugins/outputs/sql/README.md @@ -110,7 +110,7 @@ through the convert settings. # text = "TEXT" # timestamp = "TIMESTAMP" # defaultvalue = "TEXT" - # unsigned = "UNSIGNED" + # unsigned = "INT UNSIGNED" # bool = "BOOL" ``` diff --git a/plugins/outputs/sql/sql.go b/plugins/outputs/sql/sql.go index 8598a220c88f7..207726473b77e 100644 --- a/plugins/outputs/sql/sql.go +++ b/plugins/outputs/sql/sql.go @@ -100,7 +100,7 @@ func (p *SQL) deriveDatatype(value interface{}) string { case int64: datatype = p.Convert.Integer case uint64: - datatype = fmt.Sprintf("%s %s", p.Convert.Integer, p.Convert.Unsigned) + datatype = p.Convert.Unsigned case float64: datatype = p.Convert.Real case string: @@ -157,7 +157,7 @@ var sampleConfig = ` # text = "TEXT" # timestamp = "TIMESTAMP" # defaultvalue = "TEXT" - # unsigned = "UNSIGNED" + # unsigned = "INT UNSIGNED" ` func (p *SQL) SampleConfig() string { return sampleConfig } @@ -305,7 +305,7 @@ func newSQL() *SQL { Text: "TEXT", Timestamp: "TIMESTAMP", Defaultvalue: "TEXT", - Unsigned: "UNSIGNED", + Unsigned: "INT UNSIGNED", Bool: "BOOL", }, }