Skip to content

Commit

Permalink
support strange mysql quoting
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 30, 2012
1 parent cbef41c commit 93266ac
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -2241,10 +2241,19 @@ QVariant QgsOgrProvider::maximumValue( int index )

QString QgsOgrProvider::quotedIdentifier( QString field )
{
field.replace( '\\', "\\\\" );
field.replace( '"', "\\\"" );
field.replace( "'", "\\'" );
return field.prepend( "\"" ).append( "\"" );
if ( ogrDriverName == "MySQL" )
{
field.replace( '\\', "\\\\" );
field.replace( "`", "``" );
return field.prepend( "`" ).append( "`" );
}
else
{
field.replace( '\\', "\\\\" );
field.replace( '"', "\\\"" );
field.replace( "'", "\\'" );
return field.prepend( "\"" ).append( "\"" );
}
}

bool QgsOgrProvider::syncToDisc()
Expand Down

0 comments on commit 93266ac

Please sign in to comment.