Browse Source

fix handling of variable interpolation for IN expresions

Sven Klemm 7 years ago
parent
commit
da8696ed95
1 changed files with 2 additions and 2 deletions
  1. 2 2
      public/app/plugins/datasource/postgres/postgres_query.ts

+ 2 - 2
public/app/plugins/datasource/postgres/postgres_query.ts

@@ -48,7 +48,7 @@ export default class PostgresQuery {
   }
 
   quoteLiteral(value) {
-    return "'" + this.escapeLiteral(value) + "'";
+    return "'" + value.replace("'", "''") + "'";
   }
 
   escapeLiteral(value) {
@@ -74,7 +74,7 @@ export default class PostgresQuery {
     }
 
     let escapedValues = _.map(value, this.quoteLiteral);
-    return '(' + escapedValues.join(',') + ')';
+    return escapedValues.join(',');
   }
 
   render(interpolate?) {