Skip to content

Commit

Permalink
fix: sql unsigned settings
Browse files Browse the repository at this point in the history
Fixes: #10671
  • Loading branch information
powersj committed Feb 17, 2022
1 parent 4c42880 commit c30c735
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugins/outputs/sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ through the convert settings.
# text = "TEXT"
# timestamp = "TIMESTAMP"
# defaultvalue = "TEXT"
# unsigned = "UNSIGNED"
# unsigned = "INT UNSIGNED"
# bool = "BOOL"
```

Expand Down
6 changes: 3 additions & 3 deletions plugins/outputs/sql/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -157,7 +157,7 @@ var sampleConfig = `
# text = "TEXT"
# timestamp = "TIMESTAMP"
# defaultvalue = "TEXT"
# unsigned = "UNSIGNED"
# unsigned = "INT UNSIGNED"
`

func (p *SQL) SampleConfig() string { return sampleConfig }
Expand Down Expand Up @@ -305,7 +305,7 @@ func newSQL() *SQL {
Text: "TEXT",
Timestamp: "TIMESTAMP",
Defaultvalue: "TEXT",
Unsigned: "UNSIGNED",
Unsigned: "INT UNSIGNED",
Bool: "BOOL",
},
}
Expand Down

0 comments on commit c30c735

Please sign in to comment.