mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-03 00:02:25 -05:00
parent
24546133b2
commit
d1497bfb8b
@ -857,6 +857,11 @@ void QgsPostgresFeatureIterator::getFeatureAttribute( int idx, QgsPostgresResult
|
||||
}
|
||||
break;
|
||||
}
|
||||
case QVariant::LongLong:
|
||||
{
|
||||
v = QgsPostgresProvider::convertValue( fld.type(), fld.subType(), QString::number( mConn->getBinaryInt( queryResult, row, col ) ), fld.typeName() );
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
v = QgsPostgresProvider::convertValue( fld.type(), fld.subType(), queryResult.PQgetvalue( row, col ), fld.typeName() );
|
||||
|
@ -1768,7 +1768,14 @@ QVariant QgsPostgresProvider::minimumValue( int index ) const
|
||||
sql = QStringLiteral( "SELECT %1 FROM (%2) foo" ).arg( connectionRO()->fieldExpression( fld ), sql );
|
||||
|
||||
QgsPostgresResult rmin( connectionRO()->PQexec( sql ) );
|
||||
return convertValue( fld.type(), fld.subType(), rmin.PQgetvalue( 0, 0 ), fld.typeName() );
|
||||
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() );
|
||||
}
|
||||
}
|
||||
catch ( PGFieldNotFound )
|
||||
{
|
||||
@ -2033,7 +2040,14 @@ QVariant QgsPostgresProvider::maximumValue( int index ) const
|
||||
|
||||
QgsPostgresResult rmax( connectionRO()->PQexec( sql ) );
|
||||
|
||||
return convertValue( fld.type(), fld.subType(), rmax.PQgetvalue( 0, 0 ), fld.typeName() );
|
||||
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() );
|
||||
}
|
||||
}
|
||||
catch ( PGFieldNotFound )
|
||||
{
|
||||
@ -2070,7 +2084,16 @@ QVariant QgsPostgresProvider::defaultValue( int fieldId ) const
|
||||
QgsPostgresResult res( connectionRO()->PQexec( QStringLiteral( "SELECT %1" ).arg( defVal ) ) );
|
||||
|
||||
if ( res.result() )
|
||||
return convertValue( fld.type(), fld.subType(), res.PQgetvalue( 0, 0 ), fld.typeName() );
|
||||
{
|
||||
if ( fld.type() == QVariant::LongLong )
|
||||
{
|
||||
return convertValue( fld.type(), fld.subType(), QString::number( connectionRO()->getBinaryInt( res, 0, 0 ) ), fld.typeName() );
|
||||
}
|
||||
else
|
||||
{
|
||||
return convertValue( fld.type(), fld.subType(), res.PQgetvalue( 0, 0 ), fld.typeName() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pushError( tr( "Could not execute query" ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user