Ah maybe that is also interesting to know: i put a breakpoint on the write 
convenience wrapper in sqlite, it is never called.
So it is not that there is a problem with the write function .
It is that there is never an attempt to write anything to the file before it is 
being read...
Which is why i started looking at who might be responsible for writing this, 
but it is a bit hard to debug why something does not happen if you are not 
familiar with the 211k lines of code :)


Regards
Bram

________________________________________
From: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf of 
Bram Peeters [bram.peet...@dekimo.com]
Sent: Saturday, July 28, 2018 17:45
To: SQLite mailing list
Subject: Re: [sqlite] sqlite on freertos/fatfs : SQLITE_NOTADB during create 
table

>An empty file and a file filled with zeros are two different things
The file is empty/has size 0 in the file system.

So the filesystem interface indeed returns SQLITE_IOERR_SHORT_READ.

But the page1 pointer (this is not in the file, but in the structures managed 
by sqlite)  points to a buffer in memory with all 0's (probably cos it is 
malloced somewhere and it does not get filled with contents of the file).

Regards,
Bram





________________________________________
From: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf of 
Clemens Ladisch [clem...@ladisch.de]
Sent: Saturday, July 28, 2018 15:07
To: sqlite-users@mailinglists.sqlite.org
Subject: Re: [sqlite] sqlite on freertos/fatfs : SQLITE_NOTADB during create 
table

Bram Peeters wrote:
> He reads a page from the file in sqlite3PagerSharedLock, but the file is 
> still 0 so the page is all zeros.

An empty file and a file filled with zeros are two different things.

Does the file system return SQLITE_IOERR_SHORT_READ?


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to