← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13139: Event analytics, column quoting

 

------------------------------------------------------------
revno: 13139
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-12-04 14:47:41 +0100
message:
  Event analytics, column quoting
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java	2013-12-04 09:25:21 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java	2013-12-04 13:47:41 +0000
@@ -197,12 +197,12 @@
         
             for ( String item : params.getAsc() )
             {
-                sql += item + " asc,";
+                sql += statementBuilder.columnQuote( item ) + " asc,";
             }
             
             for  ( String item : params.getDesc() )
             {
-                sql += item + " desc,";
+                sql += statementBuilder.columnQuote( item ) + " desc,";
             }
             
             sql = removeLast( sql, 1 ) + " ";
@@ -380,7 +380,7 @@
         {
             if ( item.hasFilter() )
             {                
-                sql += "and lower(" + item.getItem().getUid() + ") " + item.getSqlOperator() + " " + getSqlFilter( item ) + " ";
+                sql += "and lower(" + statementBuilder.columnQuote( item.getItem().getUid() ) + ") " + item.getSqlOperator() + " " + getSqlFilter( item ) + " ";
             }
         }
         
@@ -388,7 +388,7 @@
         {
             if ( filter.hasFilter() )
             {                
-                sql += "and lower(" + filter.getItem().getUid() + ") " + filter.getSqlOperator() + " " + getSqlFilter( filter ) + " ";
+                sql += "and lower(" + statementBuilder.columnQuote( filter.getItem().getUid() ) + ") " + filter.getSqlOperator() + " " + getSqlFilter( filter ) + " ";
             }
         }