Fix FTBFS on newer pqxx versions

(cherry picked from commit da48979ab0)
v3.5.13-sru
Timothy Pearson 13 years ago committed by Slávek Banko
parent 4b5525c13b
commit 2d30d19f88

@ -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("'");
}

Loading…
Cancel
Save