mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
fix for bug 1044242 symbology bug on where claused PostGIS tables
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@2138 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
575a52aae1
commit
7cf0782112
@ -853,7 +853,15 @@ QString QgsPostgresProvider::getPrimaryKey(){
|
||||
QString QgsPostgresProvider::minValue(int position){
|
||||
// get the field name
|
||||
QgsField fld = attributeFields[position];
|
||||
QString sql = QString("select min(%1) from %2").arg(fld.name()).arg(tableName);
|
||||
QString sql;
|
||||
if(sqlWhereClause.isEmpty())
|
||||
{
|
||||
sql = QString("select min(%1) from %2").arg(fld.name()).arg(tableName);
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = QString("select min(%1) from %2").arg(fld.name()).arg(tableName)+" where "+sqlWhereClause;
|
||||
}
|
||||
PGresult *rmin = PQexec(connection,(const char *)sql);
|
||||
QString minValue = PQgetvalue(rmin,0,0);
|
||||
PQclear(rmin);
|
||||
@ -865,7 +873,15 @@ QString QgsPostgresProvider::minValue(int position){
|
||||
QString QgsPostgresProvider::maxValue(int position){
|
||||
// get the field name
|
||||
QgsField fld = attributeFields[position];
|
||||
QString sql = QString("select max(%1) from %2").arg(fld.name()).arg(tableName);
|
||||
QString sql;
|
||||
if(sqlWhereClause.isEmpty())
|
||||
{
|
||||
sql = QString("select max(%1) from %2").arg(fld.name()).arg(tableName);
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = QString("select max(%1) from %2").arg(fld.name()).arg(tableName)+" where "+sqlWhereClause;
|
||||
}
|
||||
PGresult *rmax = PQexec(connection,(const char *)sql);
|
||||
QString maxValue = PQgetvalue(rmax,0,0);
|
||||
PQclear(rmax);
|
||||
|
Loading…
x
Reference in New Issue
Block a user