Commit 7a5b5906 by Sven Klemm

fix quoting

parent bfac6303
......@@ -37,22 +37,22 @@ export default class PostgresQuery {
// remove identifier quoting from identifier to use in metadata queries
unquoteIdentifier(value) {
if (value[0] === '"' && value[value.length - 1] === '"') {
return value.substring(1, value.length - 1).replace('""', '"');
return value.substring(1, value.length - 1).replace(/""/g, '"');
} else {
return value;
}
}
quoteIdentifier(value) {
return '"' + value.replace('"', '""') + '"';
return '"' + value.replace(/"/g, '""') + '"';
}
quoteLiteral(value) {
return "'" + value.replace("'", "''") + "'";
return "'" + value.replace(/'/g, "''") + "'";
}
escapeLiteral(value) {
return value.replace("'", "''");
return value.replace(/'/g, "''");
}
hasTimeGroup() {
......
......@@ -385,7 +385,7 @@ export class PostgresQueryCtrl extends QueryCtrl {
if (addAlias) {
// set initial alias name to column name
partModel = sqlPart.create({ type: 'alias', params: [selectParts[0].params[0].replace('"', '')] });
partModel = sqlPart.create({ type: 'alias', params: [selectParts[0].params[0].replace(/"/g, '')] });
if (selectParts[selectParts.length - 1].def.type === 'alias') {
selectParts[selectParts.length - 1] = partModel;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment