summaryrefslogtreecommitdiffstats
path: root/kexi/kexidb/drivers/pqxx
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-05-05 02:29:38 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-05-05 02:29:38 -0500
commitda48979ab0b59f0174b10e3fc1073673ede65428 (patch)
treef566b1adb3e8b6caaeb2b1d9d898aee0c9ab60c1 /kexi/kexidb/drivers/pqxx
parent40de3fbbdbbae0f01e3baf22209b42889afb4caf (diff)
downloadkoffice-da48979ab0b59f0174b10e3fc1073673ede65428.tar.gz
koffice-da48979ab0b59f0174b10e3fc1073673ede65428.zip
Fix FTBFS on newer pqxx versions
Diffstat (limited to 'kexi/kexidb/drivers/pqxx')
-rw-r--r--kexi/kexidb/drivers/pqxx/pqxxdriver.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp b/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp
index fea3fa57..3809cd16 100644
--- a/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp
+++ b/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp
@@ -133,8 +133,10 @@ bool pqxxSqlDriver::isSystemDatabaseName( const TQString& n ) const
//
TQString pqxxSqlDriver::escapeString( const TQString& str) const
{
+ TQString escaped = str;
+ escaped.replace("'", "''");
return TQString::fromLatin1("'")
- + TQString::fromAscii( pqxx::sqlesc(std::string(str.utf8())).c_str() )
+ + escaped
+ TQString::fromLatin1("'");
}
@@ -142,8 +144,10 @@ TQString pqxxSqlDriver::escapeString( const TQString& str) const
//
TQCString pqxxSqlDriver::escapeString( const TQCString& str) const
{
+ TQString escaped = str;
+ escaped.replace("'", "''");
return TQCString("'")
- + TQCString( pqxx::sqlesc(TQString(str).ascii()).c_str() )
+ + TQCString( escaped.ascii() )
+ TQCString("'");
}