Changeset: e67c1c5f10ee for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e67c1c5f10ee
Modified Files:
        sql/backends/monet5/sql_bincopy.c
Branch: default
Log Message:

Also use fstat for non-trivial fixed width COPY BINARY


diffs (18 lines):

diff --git a/sql/backends/monet5/sql_bincopy.c 
b/sql/backends/monet5/sql_bincopy.c
--- a/sql/backends/monet5/sql_bincopy.c
+++ b/sql/backends/monet5/sql_bincopy.c
@@ -147,6 +147,14 @@ load_fixed_width(BAT *bat, stream *s, co
                goto end;
        }
 
+       if (rows_estimate == 0) {
+               int64_t file_size = getFileSize(s);
+               rows_estimate = (BUN)file_size / record_size;
+               // getFileSize returns 0 if the underlying file could not be 
stat'ed, so
+               // rows_estimate will just still be 0 if anything went wrong 
(io error,
+               // s not a file stream)
+       }
+
        BUN next_increase = rows_estimate;
        BUN max_increase = (1<<27) / record_size;
 
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to