Fixed sqlserver input to work with case sensitive server collation. (#2749)
Fixed a problem with sqlserver input where database properties are not returned by Telegraf when SQL Server has been set up with a case sensitive server-level collation. * Added bugfix entry to CHANGELOG.md for sqlserver collation input fix.
This commit is contained in:
parent
8cf0dc769b
commit
e2983383e4
|
@ -4,6 +4,8 @@
|
||||||
### Features
|
### Features
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
|
|
||||||
|
- [#2749](https://github.com/influxdata/telegraf/pull/2749): Fixed sqlserver input to work with case sensitive server collation.
|
||||||
|
|
||||||
## v1.3 [unreleased]
|
## v1.3 [unreleased]
|
||||||
|
|
||||||
### Release Notes
|
### Release Notes
|
||||||
|
|
|
@ -843,7 +843,7 @@ FROM (SELECT DISTINCT DatabaseName FROM #Databases) AS bl
|
||||||
SET @DynamicPivotQuery = N'
|
SET @DynamicPivotQuery = N'
|
||||||
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
||||||
, type = ''Database properties''
|
, type = ''Database properties''
|
||||||
, ' + @ColumnName + ', total FROM
|
, ' + @ColumnName + ', Total FROM
|
||||||
(
|
(
|
||||||
SELECT Measurement, DatabaseName, Value
|
SELECT Measurement, DatabaseName, Value
|
||||||
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
||||||
|
@ -856,7 +856,7 @@ UNION ALL
|
||||||
|
|
||||||
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
||||||
, type = ''Database properties''
|
, type = ''Database properties''
|
||||||
, ' + @ColumnName + ', total FROM
|
, ' + @ColumnName + ', Total FROM
|
||||||
(
|
(
|
||||||
SELECT Measurement, DatabaseName, Value
|
SELECT Measurement, DatabaseName, Value
|
||||||
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
||||||
|
@ -869,7 +869,7 @@ UNION ALL
|
||||||
|
|
||||||
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
||||||
, type = ''Database properties''
|
, type = ''Database properties''
|
||||||
, ' + @ColumnName + ', total FROM
|
, ' + @ColumnName + ', Total FROM
|
||||||
(
|
(
|
||||||
SELECT Measurement, DatabaseName, Value
|
SELECT Measurement, DatabaseName, Value
|
||||||
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
||||||
|
@ -883,7 +883,7 @@ UNION ALL
|
||||||
|
|
||||||
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
||||||
, type = ''Database properties''
|
, type = ''Database properties''
|
||||||
, ' + @ColumnName + ', total FROM
|
, ' + @ColumnName + ', Total FROM
|
||||||
(
|
(
|
||||||
SELECT Measurement, DatabaseName, Value
|
SELECT Measurement, DatabaseName, Value
|
||||||
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
||||||
|
@ -896,7 +896,7 @@ UNION ALL
|
||||||
|
|
||||||
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
||||||
, type = ''Database properties''
|
, type = ''Database properties''
|
||||||
, ' + @ColumnName + ', total FROM
|
, ' + @ColumnName + ', Total FROM
|
||||||
(
|
(
|
||||||
SELECT Measurement, DatabaseName, Value
|
SELECT Measurement, DatabaseName, Value
|
||||||
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
||||||
|
@ -909,7 +909,7 @@ UNION ALL
|
||||||
|
|
||||||
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
||||||
, type = ''Database properties''
|
, type = ''Database properties''
|
||||||
, ' + @ColumnName + ', total FROM
|
, ' + @ColumnName + ', Total FROM
|
||||||
(
|
(
|
||||||
SELECT Measurement, DatabaseName, Value
|
SELECT Measurement, DatabaseName, Value
|
||||||
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
||||||
|
@ -922,7 +922,7 @@ UNION ALL
|
||||||
|
|
||||||
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
||||||
, type = ''Database properties''
|
, type = ''Database properties''
|
||||||
, ' + @ColumnName + ', total FROM
|
, ' + @ColumnName + ', Total FROM
|
||||||
(
|
(
|
||||||
SELECT Measurement, DatabaseName, Value
|
SELECT Measurement, DatabaseName, Value
|
||||||
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
||||||
|
@ -935,7 +935,7 @@ UNION ALL
|
||||||
|
|
||||||
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
||||||
, type = ''Database properties''
|
, type = ''Database properties''
|
||||||
, ' + @ColumnName + ', total FROM
|
, ' + @ColumnName + ', Total FROM
|
||||||
(
|
(
|
||||||
SELECT Measurement, DatabaseName, Value
|
SELECT Measurement, DatabaseName, Value
|
||||||
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
||||||
|
@ -948,7 +948,7 @@ UNION ALL
|
||||||
|
|
||||||
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
||||||
, type = ''Database properties''
|
, type = ''Database properties''
|
||||||
, ' + @ColumnName + ', total FROM
|
, ' + @ColumnName + ', Total FROM
|
||||||
(
|
(
|
||||||
SELECT Measurement, DatabaseName, Value
|
SELECT Measurement, DatabaseName, Value
|
||||||
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
||||||
|
@ -961,7 +961,7 @@ UNION ALL
|
||||||
|
|
||||||
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
SELECT measurement = Measurement, servername = REPLACE(@@SERVERNAME, ''\'', '':'')
|
||||||
, type = ''Database properties''
|
, type = ''Database properties''
|
||||||
, ' + @ColumnName + ', total FROM
|
, ' + @ColumnName + ', Total FROM
|
||||||
(
|
(
|
||||||
SELECT Measurement, DatabaseName, Value
|
SELECT Measurement, DatabaseName, Value
|
||||||
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
, Total = (SELECT SUM(Value) FROM #Databases WHERE Measurement = d.Measurement)
|
||||||
|
|
Loading…
Reference in New Issue