ogr provider: limit mysql driver to requested layer

This commit is contained in:
Juergen E. Fischer 2015-05-09 23:08:08 +02:00
parent e5dbd186d8
commit 536135a3f4

View File

@ -366,6 +366,11 @@ QgsOgrProvider::QgsOgrProvider( QString const & uri )
QgsDebugMsg( "mSubsetString: " + mSubsetString );
CPLSetConfigOption( "OGR_ORGANIZE_POLYGONS", "ONLY_CCW" ); // "SKIP" returns MULTIPOLYGONs for multiringed POLYGONs
if ( mFilePath.startsWith( "MySQL:" ) && !mLayerName.isEmpty() )
{
mFilePath += ",tables=" + mLayerName;
}
// first try to open in update mode (unless specified otherwise)
if ( !openReadOnly )
ogrDataSource = OGROpen( TO8F( mFilePath ), true, &ogrDriver );