Skip to content

Commit

Permalink
postgres provider: improve value quoting
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 6, 2014
1 parent d991ebf commit 7829e7a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/providers/postgres/qgspostgresconn.cpp
Expand Up @@ -772,8 +772,10 @@ QString QgsPostgresConn::quotedValue( QVariant value )
case QVariant::String:
QString v = value.toString();
v.replace( "'", "''" );
v.replace( "\\\"", "\\\\\"" );
return v.prepend( "'" ).append( "'" );
if( v.contains( "\\" ) )
return v.replace( "\\", "\\\\" ).prepend("E'").append("'");
else
return v.prepend( "'" ).append( "'" );
}
}

Expand Down

0 comments on commit 7829e7a

Please sign in to comment.