From baddf9d32eec2062be376e8e86a2fe3a28f39d5a Mon Sep 17 00:00:00 2001 From: enricovianello Date: Thu, 19 Feb 2015 15:25:38 +0000 Subject: [PATCH] Temporary fix for https://issues.infn.it/jira/browse/STOR-750 --- src/frontend/file_request.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend/file_request.hpp b/src/frontend/file_request.hpp index b83f014..e94cfc6 100644 --- a/src/frontend/file_request.hpp +++ b/src/frontend/file_request.hpp @@ -27,6 +27,7 @@ extern "C" { #include #include #include +#include #include "storm_exception.hpp" #include "srmv2H.h" @@ -152,11 +153,10 @@ class file_request { std::string sqlFormat(bool b){ return b ? "1" : "0"; } + std::string sqlFormat(std::string const& s){ - std::string formatted_s("\'"); - formatted_s += s; - formatted_s += '\''; - return formatted_s; + std::string formatted_s = boost::replace_all_copy(s, "'", "''"); + return '\'' + formatted_s + '\''; } void setFileStorageType(ns1__TFileStorageType type) {