Skip to content
Permalink
Browse files

Undoing overcorrection on handling bigint min/max values.

  • Loading branch information
espinafre committed Apr 27, 2020
1 parent d1497bf commit c5ac1a4fac60b44636b194afc06cfa74c50c4c54
Showing with 2 additions and 16 deletions.
  1. +2 −16 src/providers/postgres/qgspostgresprovider.cpp
@@ -1768,14 +1768,7 @@ QVariant QgsPostgresProvider::minimumValue( int index ) const
sql = QStringLiteral( "SELECT %1 FROM (%2) foo" ).arg( connectionRO()->fieldExpression( fld ), sql );

QgsPostgresResult rmin( connectionRO()->PQexec( sql ) );
if ( fld.type() == QVariant::LongLong )
{
return convertValue( fld.type(), fld.subType(), QString::number( connectionRO()->getBinaryInt( rmin, 0, 0 ) ), fld.typeName() );
}
else
{
return convertValue( fld.type(), fld.subType(), rmin.PQgetvalue( 0, 0 ), fld.typeName() );
}
return convertValue( fld.type(), fld.subType(), rmin.PQgetvalue( 0, 0 ), fld.typeName() );
}
catch ( PGFieldNotFound )
{
@@ -2040,14 +2033,7 @@ QVariant QgsPostgresProvider::maximumValue( int index ) const

QgsPostgresResult rmax( connectionRO()->PQexec( sql ) );

if ( fld.type() == QVariant::LongLong )
{
return convertValue( fld.type(), fld.subType(), QString::number( connectionRO()->getBinaryInt( rmax, 0, 0 ) ), fld.typeName() );
}
else
{
return convertValue( fld.type(), fld.subType(), rmax.PQgetvalue( 0, 0 ), fld.typeName() );
}
return convertValue( fld.type(), fld.subType(), rmax.PQgetvalue( 0, 0 ), fld.typeName() );
}
catch ( PGFieldNotFound )
{

0 comments on commit c5ac1a4

Please sign in to comment.
You can’t perform that action at this time.