Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails
On Wed, Dec 26, 2012 at 9:55 PM, Daniel Colascione wrote: > On 12/26/12 9:54 PM, Pavel Ivanov wrote: >> I believe you can get this functionality now by compiling SQLite code >> using cygwin compiler, not a Win32 one (and not downloading dll >> library from sqlite.org website). > > The latest sources I checked still have the bug. How do you compile it? Pavel ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails
On 12/26/12 9:54 PM, Pavel Ivanov wrote: > I believe you can get this functionality now by compiling SQLite code > using cygwin compiler, not a Win32 one (and not downloading dll > library from sqlite.org website). The latest sources I checked still have the bug. signature.asc Description: OpenPGP digital signature ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails
I believe you can get this functionality now by compiling SQLite code using cygwin compiler, not a Win32 one (and not downloading dll library from sqlite.org website). Pavel On Wed, Dec 26, 2012 at 9:19 PM, Daniel Colascione wrote: > Creating temporary tables fails in Cygwin SQLite: > > sqlite> CREATE TEMPORARY TABLE foo (bar INT); > Error: unable to open database file > > The reason this operation fails is that SQLite cannot create a > temporary file in "C:\Windows", which GetTempPathW reports as the > system temporary directory. GetTempPathW returns the system temporary > directory when none of the environment variables "TMP", "TEMP", and > "USERPROFILE" is set. In a typical Cygwin environment, these > environment variables are unset from the point of view of Windows > APIs: Cygwin maintains an internal, Cygwin-private environment block > and synchronizes it with the Windows environment block lazily. A > normal Cygwin process that uses SQLite has no reason to initialize its > Windows environment block. > > Programs run under strace or the debugger, however, do receive a > Windows environment block, so temporary table creation appears to work > in programs run using these tools. A user with administrative rights > can also create temporary tables, since he will be able to write to > the Windows directory. > > In a Cygwin environment, SQLite should avoid GetTempPathW and instead > use unixGetTempname to find the temporary directory, translating paths > as appropriate. > > > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Bug in Cygwin SQLite: temporary table creation fails
Creating temporary tables fails in Cygwin SQLite: sqlite> CREATE TEMPORARY TABLE foo (bar INT); Error: unable to open database file The reason this operation fails is that SQLite cannot create a temporary file in "C:\Windows", which GetTempPathW reports as the system temporary directory. GetTempPathW returns the system temporary directory when none of the environment variables "TMP", "TEMP", and "USERPROFILE" is set. In a typical Cygwin environment, these environment variables are unset from the point of view of Windows APIs: Cygwin maintains an internal, Cygwin-private environment block and synchronizes it with the Windows environment block lazily. A normal Cygwin process that uses SQLite has no reason to initialize its Windows environment block. Programs run under strace or the debugger, however, do receive a Windows environment block, so temporary table creation appears to work in programs run using these tools. A user with administrative rights can also create temporary tables, since he will be able to write to the Windows directory. In a Cygwin environment, SQLite should avoid GetTempPathW and instead use unixGetTempname to find the temporary directory, translating paths as appropriate. signature.asc Description: OpenPGP digital signature ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users