@@ -186,12 +186,13 @@ QgsVectorLayerImport::ImportError QgsPostgresProvider::createEmptyLayer(
186
186
if ( primaryKeyType.isEmpty () )
187
187
{
188
188
primaryKeyType = " serial" ;
189
- /* TODO
190
- // check the feature count to choose if create a serial8 pk field
189
+ # if 0
190
+ // TODO: check the feature count to choose if create a serial8 pk field
191
191
if ( layer->featureCount() > 0xFFFFFF )
192
192
{
193
193
primaryKeyType = "serial8";
194
- }*/
194
+ }
195
+ #endif
195
196
}
196
197
197
198
try
@@ -1153,13 +1154,15 @@ qint64 QgsPostgresProvider::getBinaryInt( PGresult *queryResult, int row, int co
1153
1154
char *p = PQgetvalue ( queryResult, row, col );
1154
1155
size_t s = PQgetlength ( queryResult, row, col );
1155
1156
1157
+ #ifdef QGISDEBUG
1156
1158
QString buf = " " ;
1157
1159
for ( size_t i = 0 ; i < s; i++ )
1158
1160
{
1159
1161
buf += QString ( " %1 " ).arg ( *( unsigned char * )( p + i ), 0 , 16 , QLatin1Char ( ' ' ) );
1160
1162
}
1161
1163
1162
- QgsDebugMsgLevel ( QString ( " int in hex:%1" ).arg ( buf ), 3 );
1164
+ QgsDebugMsgLevel ( QString ( " int in hex:%1" ).arg ( buf ), 4 );
1165
+ #endif
1163
1166
1164
1167
switch ( s )
1165
1168
{
@@ -1191,18 +1194,18 @@ qint64 QgsPostgresProvider::getBinaryInt( PGresult *queryResult, int row, int co
1191
1194
1192
1195
if ( swapEndian )
1193
1196
{
1194
- QgsDebugMsg ( QString ( " swap oid0:%1 oid1:%2" ).arg ( oid0 ).arg ( oid1 ) );
1197
+ QgsDebugMsgLevel ( QString ( " swap oid0:%1 oid1:%2" ).arg ( oid0 ).arg ( oid1 ), 4 );
1195
1198
oid0 = ntohl ( oid0 );
1196
1199
oid1 = ntohl ( oid1 );
1197
1200
}
1198
1201
1199
- QgsDebugMsg ( QString ( " oid0:%1 oid1:%2" ).arg ( oid0 ).arg ( oid1 ) );
1202
+ QgsDebugMsgLevel ( QString ( " oid0:%1 oid1:%2" ).arg ( oid0 ).arg ( oid1 ), 4 );
1200
1203
oid = oid0;
1201
- QgsDebugMsg ( QString ( " oid:%1" ).arg ( oid ) );
1204
+ QgsDebugMsgLevel ( QString ( " oid:%1" ).arg ( oid ), 4 );
1202
1205
oid <<= 32 ;
1203
- QgsDebugMsg ( QString ( " oid:%1" ).arg ( oid ) );
1206
+ QgsDebugMsgLevel ( QString ( " oid:%1" ).arg ( oid ), 4 );
1204
1207
oid |= oid1;
1205
- QgsDebugMsg ( QString ( " oid:%1" ).arg ( oid ) );
1208
+ QgsDebugMsgLevel ( QString ( " oid:%1" ).arg ( oid ), 4 );
1206
1209
}
1207
1210
break ;
1208
1211
@@ -1226,7 +1229,7 @@ bool QgsPostgresProvider::getFeature( PGresult *queryResult, int row, bool fetch
1226
1229
try
1227
1230
{
1228
1231
QgsFeatureId oid = getBinaryInt ( queryResult, row, 0 );
1229
- QgsDebugMsgLevel ( QString ( " oid=%1" ).arg ( oid ), 3 );
1232
+ QgsDebugMsgLevel ( QString ( " oid=%1" ).arg ( oid ), 4 );
1230
1233
1231
1234
feature.setFeatureId ( oid );
1232
1235
feature.clearAttributeMap ();
0 commit comments