Skip to content

Commit f68cfc7

Browse files
committedMay 27, 2015
ogr provider: limit mysql driver to requested layer
(cherry picked from commit 536135a)
1 parent c165e1f commit f68cfc7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎src/providers/ogr/qgsogrprovider.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,11 @@ QgsOgrProvider::QgsOgrProvider( QString const & uri )
366366
QgsDebugMsg( "mSubsetString: " + mSubsetString );
367367
CPLSetConfigOption( "OGR_ORGANIZE_POLYGONS", "ONLY_CCW" ); // "SKIP" returns MULTIPOLYGONs for multiringed POLYGONs
368368

369+
if ( mFilePath.startsWith( "MySQL:" ) && !mLayerName.isEmpty() )
370+
{
371+
mFilePath += ",tables=" + mLayerName;
372+
}
373+
369374
// first try to open in update mode (unless specified otherwise)
370375
if ( !openReadOnly )
371376
ogrDataSource = OGROpen( TO8F( mFilePath ), true, &ogrDriver );

0 commit comments

Comments
 (0)
Please sign in to comment.