@@ -62,6 +62,9 @@ SQLITE_EXTENSION_INIT1
6262# define CSV_NOINLINE
6363#endif
6464
65+ #ifndef SQLITEINT_H
66+ typedef sqlite3_int64 i64 ;
67+ #endif
6568
6669/* Max size of the error message in a CsvReader */
6770#define CSV_MXERR 200
@@ -74,9 +77,9 @@ typedef struct CsvReader CsvReader;
7477struct CsvReader {
7578 FILE * in ; /* Read the CSV text from this input stream */
7679 char * z ; /* Accumulated text for a field */
77- int n ; /* Number of bytes in z */
78- int nAlloc ; /* Space allocated for z[] */
79- int nLine ; /* Current line number */
80+ i64 n ; /* Number of bytes in z */
81+ i64 nAlloc ; /* Space allocated for z[] */
82+ i64 nLine ; /* Current line number */
8083 int bNotFirst ; /* True if prior text has been seen */
8184 int cTerm ; /* Character that terminated the most recent field */
8285 size_t iIn ; /* Next unread character in the input buffer */
@@ -174,7 +177,7 @@ static int csv_getc(CsvReader *p){
174177** Return 0 on success and non-zero if there is an OOM error */
175178static CSV_NOINLINE int csv_resize_and_append (CsvReader * p , char c ){
176179 char * zNew ;
177- int nNew = p -> nAlloc * 2 + 100 ;
180+ i64 nNew = p -> nAlloc * 2 + 100 ;
178181 zNew = sqlite3_realloc64 (p -> z , nNew );
179182 if ( zNew ){
180183 p -> z = zNew ;
@@ -510,7 +513,6 @@ static int csvtabConnect(
510513# define CSV_DATA (azPValue[1])
511514# define CSV_SCHEMA (azPValue[2])
512515
513-
514516 assert ( sizeof (azPValue )== sizeof (azParam ) );
515517 memset (& sRdr , 0 , sizeof (sRdr ));
516518 memset (azPValue , 0 , sizeof (azPValue ));
0 commit comments