@@ -486,7 +486,7 @@ int database_exec_callback (db_t *db, const char *sql, int (*callback)(void *xda
486486
487487 // Get column names
488488 for (int i = 0 ; i < ncols ; i ++ ) {
489- names [i ] = NameStr (tupdesc -> attrs [ i ]. attname );
489+ names [i ] = NameStr (TupleDescAttr ( tupdesc , i ) -> attname );
490490 }
491491
492492 // Process each row
@@ -711,7 +711,7 @@ int database_debug (db_t *db, bool print_result) {
711711 // PostgreSQL debug information
712712 if (print_result ) {
713713 elog (DEBUG1 , "PostgreSQL SPI debug info:" );
714- elog (DEBUG1 , " SPI_processed: %lu" , SPI_processed );
714+ elog (DEBUG1 , " SPI_processed: %lu" , ( unsigned long ) SPI_processed );
715715 elog (DEBUG1 , " In transaction: %d" , IsTransactionState ());
716716 }
717717 return DBRES_OK ;
@@ -1080,7 +1080,7 @@ int database_pk_names (db_t *db, const char *table_name, char ***names, int *cou
10801080 return DBRES_OK ;
10811081 }
10821082
1083- int n = SPI_processed ;
1083+ uint64_t n = SPI_processed ;
10841084 char * * pk_names = cloudsync_memory_alloc (n * sizeof (char * ));
10851085 if (!pk_names ) return DBRES_NOMEM ;
10861086
@@ -1098,7 +1098,7 @@ int database_pk_names (db_t *db, const char *table_name, char ***names, int *cou
10981098 }
10991099
11001100 * names = pk_names ;
1101- * count = n ;
1101+ * count = ( int ) n ;
11021102 return DBRES_OK ;
11031103}
11041104
@@ -1508,7 +1508,7 @@ int database_column_type (dbvm_t *vm, int index) {
15081508 if (index >= SPI_tuptable -> tupdesc -> natts ) return DBTYPE_NULL ;
15091509
15101510 if (wrapper -> current_row < 0 || wrapper -> current_row >= (int )SPI_processed ) {
1511- elog (DEBUG1 , "databasevm_step no rows current_row=%d processed=%lu" , wrapper -> current_row , SPI_processed );
1511+ elog (DEBUG1 , "databasevm_step no rows current_row=%d processed=%lu" , wrapper -> current_row , ( unsigned long ) SPI_processed );
15121512 return DBTYPE_NULL ;
15131513 }
15141514
0 commit comments