Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-09-01 Thread Richard Hipp
On Mon, Sep 1, 2014 at 7:04 AM, Andy Ling  wrote:

>
> This can be fixed by changing the patch to something like...
>
> #if OS_VXWORKS
> }else if( errno==0x380003  || errno == 13){ /* ==
> S_dosFsLib_FILE_NOT_FOUND */
>   rc = SQLITE_IOERR_DELETE_NOENT;
> #endif
>
> Although this doesn't feel right having to keep extending the list of
> error codes that are checked.
> I'm not sure what else can be done though. Maybe some compile options that
> let you choose.
>

Please try the patch at
http://www.sqlite.org/src/info/b0f6b91f36b503d8ba8d5257bb194f8c1afb4833 and
see if that fixes the problem.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-09-01 Thread Jan Nijtmans
2014-09-01 13:04 GMT+02:00 Andy Ling :
> Although this doesn't feel right having to keep extending the list of error 
> codes that are checked.
> I'm not sure what else can be done though. Maybe some compile options that 
> let you choose.

Here is a list of possible error-codes I found:
   

The value 13 is listed here as EACCES, I really doubt this one
should be added: If there really is an access problem, I
think that shouldn't be masked.

There are two entries that end with _FILE_NOT_FOUND, the other one is:
1310723  0x140003  S_rt11FsLib_FILE_NOT_FOUND
This suggests that for VxWorks an additional check for 0x140003
might work if you use the rt11 filesystem (whatever that is .)

Other possible candidates:
2686989  0x29000d  S_netDrv_NO_SUCH_FILE_OR_DIR
2949130  0x2d000a  S_nfsDrv_NO_SUCH_FILE_OR_DIR
7602186  0x74000a  S_cdromFsLib_NO_SUCH_FILE_OR_DIRECTORY

The list is not so long, if it helps then it is doable to just add them
all. But feedback on behavior on different file systems is
crucial, I wouldn't just add all of them blindly.

Regards,
Jan Nijtmans
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-09-01 Thread Andy Ling
> -Original Message-
> From: Andy Ling
> Sent: 29 August 2014 16:15
> To: '???'; sqlite-users@sqlite.org
> Subject: RE: Re:RE: [sqlite] HELP sqlite3 used in vxworks has someproblem?
> 
> I would add a printf statement in unixDelete rather than rely on a break point
> working.
> 


I finally had 5 minutes to try this out. I added the following to unixDelete

}else{
  printf ("Error deleting file %s error %d\n", zPath, errno) ;
  rc = unixLogError(SQLITE_IOERR_DELETE, "unlink", zPath);
}

I then ran the following

func call _open "/tgtsvr/testdb.sql" &
func call _execute "CREATE TABLE t (id INTEGER PRIMARY KEY ASC)" &

Where /tgtsvr is a mount of the file system on my Windows PC.  This generates 
the following

Error deleting file /tgtsvr/testdb.sql-wal error 13
Error executing statement CREATE TABLE t (id INTEGER PRIMARY KEY ASC) - disk 
I/O error
Error message disk I/O error

So as suspected, the host file system is returning yet another error code when 
deleting a file that doesn't exist.

This can be fixed by changing the patch to something like...

#if OS_VXWORKS
}else if( errno==0x380003  || errno == 13){ /* == S_dosFsLib_FILE_NOT_FOUND 
*/
  rc = SQLITE_IOERR_DELETE_NOENT;
#endif

Although this doesn't feel right having to keep extending the list of error 
codes that are checked.
I'm not sure what else can be done though. Maybe some compile options that let 
you choose.

Regards

Andy Ling

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-29 Thread Andy Ling
I would add a printf statement in unixDelete rather than rely on a break point 
working.

Of course, it may not be unixDelete that is the problem, we just need to be 
sure.

Do you have a disk on your target system? If you do, perhaps you could try 
creating the database file on that and see if that works. 

Regards

Andy Ling


From: 王庆刚 [mailto:2004wqg2...@163.com] 
Sent: 29 August 2014 15:49
To: Andy Ling; sqlite-users@sqlite.org
Subject: Re:RE: [sqlite] HELP sqlite3 used in vxworks has someproblem?

hi, Andy Ling
     I have removed the SQLITE_ENABLE_LOCKING_STYLE compile option, so it tell 
me the error : disk I/o error.
       but when I set breakpoint in unixdelete funtion , I found it not enter 
the funtion. I do not know why.
      
     You are right! What OS your host system is running (Windows in my case).
        I want to get some information from the unixdelete funtion.

     Regards
     Wang Qinggang


At 2014-08-29 05:30:23, "Andy Ling" <andy.l...@quantel.com> wrote:

Have you removed the SQLITE_ENABLE_LOCKING_STYLE compile option?
 
On my vxWorks system, if I open a new database and create a table it always 
calls unixDelete trying to delete a “database name”-wal file. This doesn’t 
exist so it has to handle the error.
 
This patch that was added ….
 
#if OS_VXWORKS
    }else if( errno==0x380003 ){ /* == S_dosFsLib_FILE_NOT_FOUND */
  rc = SQLITE_IOERR_DELETE_NOENT;
#endif
 
to handle the error code returned by a dosFs filing system. Before adding this 
patch I got the disk I/O error.
 
Because you are using the host filing system I would guess the error code 
returned will be something different.
 
Looking at the WindRiver documentation for the tsfs driver it says….
 
“The routines in this library return the VxWorks error codes that most closely 
match the errnos generated by the corresponding host function.”
 
So it looks like it will depend on what OS your host system is running (Windows 
I assume in your case).
 
Regards
 
Andy Ling
 
 
From: 163 [mailto:2004wqg2...@163.com] 
Sent: 29 August 2014 03:34
To: Andy Ling
Cc: sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?
 
i find it not enter the unixdelete.

发自我的 iPhone

在 2014年8月28日,22:42,Andy Ling <andy.l...@quantel.com> 写道:
Sorry, I meant unixDelete
 
My guess is that because you are using the host filing system vxWorks will be 
setting yet another error code for a file that doesn’t exist. So it will need 
another check adding to unixDelete
 
Regards
 
Andy Ling
 
 
From: 王庆刚 [mailto:2004wqg2...@163.com] 
Sent: 28 August 2014 15:01
To: Andy Ling
Cc: sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re:RE: Re:RE: [sqlite] HELP sqlite3 used in vxworks has someproblem?
 
 
Is unixUnlink  an function? If it is , but I can not find the funtion in 
sqlite3.c.
 
Regards
 
Wang Qinggang
 



 

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-29 Thread 王庆刚
hi, Andy Ling
 I have removed the SQLITE_ENABLE_LOCKING_STYLE compile option, so it tell 
me the error : disk I/o error.
   but when I set breakpoint in unixdelete funtion , I found it not enter 
the funtion. I do not know why.
  
 You are right! What OS your host system is running (Windows in my case).
I want to get some information from the unixdelete funtion.


 Regards
 Wang Qinggang




At 2014-08-29 05:30:23, "Andy Ling" <andy.l...@quantel.com> wrote:


Have you removed the SQLITE_ENABLE_LOCKING_STYLE compile option?

 

On my vxWorks system, if I open a new database and create a table it always 
calls unixDelete trying to delete a “database name”-wal file. This doesn’t 
exist so it has to handle the error.

 

This patch that was added ….

 

#if OS_VXWORKS

}else if( errno==0x380003 ){ /* == S_dosFsLib_FILE_NOT_FOUND */

  rc = SQLITE_IOERR_DELETE_NOENT;

#endif

 

to handle the error code returned by a dosFs filing system. Before adding this 
patch I got the disk I/O error.

 

Because you are using the host filing system I would guess the error code 
returned will be something different.

 

Looking at the WindRiver documentation for the tsfs driver it says….

 

“The routines in this library return the VxWorks error codes that most closely 
match the errnos generated by the corresponding host function.”

 

So it looks like it will depend on what OS your host system is running (Windows 
I assume in your case).

 

Regards

 

Andy Ling

 

 

From: 163 [mailto:2004wqg2...@163.com]
Sent: 29 August 2014 03:34
To: Andy Ling
Cc:sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

 

i find it not enter the unixdelete.

发自我的 iPhone


在 2014年8月28日,22:42,Andy Ling <andy.l...@quantel.com> 写道:

Sorry, I meant unixDelete

 

My guess is that because you are using the host filing system vxWorks will be 
setting yet another error code for a file that doesn’t exist. So it will need 
another check adding to unixDelete

 

Regards

 

Andy Ling

 

 

From:王庆刚 [mailto:2004wqg2...@163.com]
Sent: 28 August 2014 15:01
To: Andy Ling
Cc:sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re:RE: Re:RE: [sqlite] HELP sqlite3 used in vxworks has someproblem?

 

 

Is unixUnlink  an function? If it is , but I can not find the funtion in 
sqlite3.c.

 

Regards

 

Wang Qinggang

 







 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-29 Thread Andy Ling
Have you removed the SQLITE_ENABLE_LOCKING_STYLE compile option?

On my vxWorks system, if I open a new database and create a table it always 
calls unixDelete trying to delete a “database name”-wal file. This doesn’t 
exist so it has to handle the error.

This patch that was added ….

#if OS_VXWORKS
}else if( errno==0x380003 ){ /* == S_dosFsLib_FILE_NOT_FOUND */
  rc = SQLITE_IOERR_DELETE_NOENT;
#endif

to handle the error code returned by a dosFs filing system. Before adding this 
patch I got the disk I/O error.

Because you are using the host filing system I would guess the error code 
returned will be something different.

Looking at the WindRiver documentation for the tsfs driver it says….

“The routines in this library return the VxWorks error codes that most closely 
match the errnos generated by the corresponding host function.”

So it looks like it will depend on what OS your host system is running (Windows 
I assume in your case).

Regards

Andy Ling


From: 163 [mailto:2004wqg2...@163.com]
Sent: 29 August 2014 03:34
To: Andy Ling
Cc: sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

i find it not enter the unixdelete.

发自我的 iPhone

在 2014年8月28日,22:42,Andy Ling 
<andy.l...@quantel.com<mailto:andy.l...@quantel.com>> 写道:
Sorry, I meant unixDelete

My guess is that because you are using the host filing system vxWorks will be 
setting yet another error code for a file that doesn’t exist. So it will need 
another check adding to unixDelete

Regards

Andy Ling


From: 王庆刚 [mailto:2004wqg2...@163.com]
Sent: 28 August 2014 15:01
To: Andy Ling
Cc: sqlite-users@sqlite.org<mailto:sqlite-users@sqlite.org>; Jan Nijtmans
Subject: Re:RE: Re:RE: [sqlite] HELP sqlite3 used in vxworks has someproblem?


Is unixUnlink  an function? If it is , but I can not find the funtion in 
sqlite3.c.

Regards

Wang Qinggang






___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-28 Thread 163
i find it not enter the unixdelete.

发自我的 iPhone

> 在 2014年8月28日,22:42,Andy Ling  写道:
> 
> Sorry, I meant unixDelete
>  
> My guess is that because you are using the host filing system vxWorks will be 
> setting yet another error code for a file that doesn’t exist. So it will need 
> another check adding to unixDelete
>  
> Regards
>  
> Andy Ling
>  
>  
> From: 王庆刚 [mailto:2004wqg2...@163.com] 
> Sent: 28 August 2014 15:01
> To: Andy Ling
> Cc: sqlite-users@sqlite.org; Jan Nijtmans
> Subject: Re:RE: Re:RE: [sqlite] HELP sqlite3 used in vxworks has someproblem?
>  
>  
> Is unixUnlink  an function? If it is , but I can not find the funtion in  
> sqlite3.c.
>  
> Regards
>  
> Wang Qinggang
>  
> 
> 
> 
> 
>  
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-28 Thread Andy Ling
Sorry, I meant unixDelete

My guess is that because you are using the host filing system vxWorks will be 
setting yet another error code for a file that doesn’t exist. So it will need 
another check adding to unixDelete

Regards

Andy Ling


From: 王庆刚 [mailto:2004wqg2...@163.com]
Sent: 28 August 2014 15:01
To: Andy Ling
Cc: sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re:RE: Re:RE: [sqlite] HELP sqlite3 used in vxworks has someproblem?


Is unixUnlink  an function? If it is , but I can not find the funtion in 
sqlite3.c.

Regards

Wang Qinggang





At 2014-08-28 00:03:23, "Andy Ling" 
> wrote:

So you are using a host file system. You should be able to make the open work 
by using

rc = sqlite3_open("host:D:/WindRiver/SqliteOne.db",);

You have to use a path and file name that works in the vxWorks domain.

It shouldn’t be necessary to use �CDSQLITE_ENABLE_LOCKING_STYLE=1. In fact it 
has been said this will probably not work in other areas. So it would be good 
to find out what is causing the disk I/O error. Did you try putting some debug 
in unixUnlink?

Regards

Andy Ling


From: 王庆刚 [mailto:2004wqg2...@163.com]
Sent: 27 August 2014 16:17
To: Andy Ling
Cc: sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re:RE: [sqlite] HELP sqlite3 used in vxworks has someproblem?



Firstly:

I  fixed the disk I/O error by adding -DSQLITE_ENABLE_LOCKING_STYLE=1 to the 
build macro.

Secondly:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);
I change it to the following
cd("host:D:/WindRiver");
rc = sqlite3_open("SqliteOne.db",);
can fix the problem : unable to open the database.


At 2014-08-26 08:55:31, "Andy Ling" 
> wrote:
As I said before, that doesn’t look like a vxWorks path to a file. Are you sure 
D:\\WindRiver really exists? In general vxWorks uses the forward slash (/) as a 
path separator. Is this a remote mounted host file system you are trying to use?

What is your current directory when it works the second time? i.e. what is the 
output from the “pwd” command? Can you use that directory as part of a full 
pathname?

I’m glad you have fixed the disk I/O problem. What did you have to do? Are 
there any more changes that need feeding back into the source?

Regards

Andy Ling


From: 王庆刚 [mailto:2004wqg2...@163.com]
Sent: 26 August 2014 13:44
To: Andy Ling
Cc: sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re:RE: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

hi, Andy Ling:
The error disk I / o error I have resolved ;
but when I used the following code:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);
it tell me  can not find the data base;

when I used the following code:
rc = sqlite3_open("SqliteOne.db",);
It is OK


How could I resolve the prolblem?

At 2014-08-25 11:29:57, "Andy Ling" 
> wrote:
That file name in the first error doesn't look like a vxWorks file. What 
devices have you got mounted. You need to specify a file path that points to 
one of the vxWorks file IO devices. By just specifying the file name in your 
second example it is being created in the current directory.

The second disk I / O error is what I had before applying the patch to 
unixUnlink. The error returned by vxWorks when deleting a file that doesn't 
exist depends on the underlying file system. If it is a POSIX file system it 
should return ENOENT. For dosFS it returns S_dosFsLib_FILE_NOT_FOUND, which in 
vxWorks 6.9 is 0x380003

So if you are using yet another file system, maybe you are getting a different 
error code being set. start by adding a printf to unixUnlink to find out if 
that is your problem.

Regards

Andy Ling

From: 王庆刚 [2004wqg2...@163.com]
Sent: 25 August 2014 13:13
To: sqlite-users@sqlite.org; Andy Ling; Jan 
Nijtmans
Subject: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?
hi
  I modified the code sqlite3.c according to you method, as follow

 

  or   

I test you method in workbench3.2(vxworks6.8) , the build macros which I used 
in build properties is : -DOS_VXWORKS=1 -DSQLITE_THREADSAFE=0  
-DSQLITE_OMIT_LOAD_EXTENSION -DHAVE_UTIME

but it still have some problems.
1.  if I do as follows:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);
it tell me the error  can not open the database.


2.  if I do as follows:
rc = sqlite3_open("SqliteOne.db",);this will be ok .
but when I do the following thing
sql = " create table stu(i int, name text);";
rc = sqlite3_exec(db,sql,NULL,NULL,);
it tell me the error  : disk I / O  error.



在 2014-08-12 

Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-28 Thread 王庆刚


Is unixUnlink  an function? If it is , but I can not find the funtion in 
sqlite3.c.



Regards

 

Wang Qinggang









At 2014-08-28 00:03:23, "Andy Ling"  wrote:


So you are using a host file system. You should be able to make the open work 
by using

 

rc = sqlite3_open("host:D:/WindRiver/SqliteOne.db",);

 

You have to use a path and file name that works in the vxWorks domain.

 

It shouldn’t be necessary to use –DSQLITE_ENABLE_LOCKING_STYLE=1. In fact it 
has been said this will probably not work in other areas. So it would be good 
to find out what is causing the disk I/O error. Did you try putting some debug 
in unixUnlink?

 

Regards

 

Andy Ling

 

 

From:王庆刚 [mailto:2004wqg2...@163.com]
Sent: 27 August 2014 16:17
To: Andy Ling
Cc:sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re:RE: [sqlite] HELP sqlite3 used in vxworks has someproblem?

 



Firstly:


I  fixed the disk I/O error by adding -DSQLITE_ENABLE_LOCKING_STYLE=1 to the 
build macro.
 

Secondly:

rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);

I change it to the following

cd("host:D:/WindRiver");

rc = sqlite3_open("SqliteOne.db",);

can fix the problem : unable to open the database.

 

 

At 2014-08-26 08:55:31, "Andy Ling"  wrote:



As I said before, that doesn’t look like a vxWorks path to a file. Are you sure 
D:\\WindRiver really exists? In general vxWorks uses the forward slash (/) as a 
path separator. Is this a remote mounted host file system you are trying to use?

 

What is your current directory when it works the second time? i.e. what is the 
output from the “pwd” command? Can you use that directory as part of a full 
pathname?

 

I’m glad you have fixed the disk I/O problem. What did you have to do? Are 
there any more changes that need feeding back into the source?

 

Regards

 

Andy Ling

 

 

From:王庆刚 [mailto:2004wqg2...@163.com]
Sent: 26 August 2014 13:44
To: Andy Ling
Cc:sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re:RE: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

 

hi, Andy Ling:

The error disk I / o error I have resolved ;

but when I used the following code:

rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);

it tell me  can not find the data base;

 

when I used the following code:

rc = sqlite3_open("SqliteOne.db",);

It is OK

 

 

How could I resolve the prolblem?



 

At 2014-08-25 11:29:57, "Andy Ling"  wrote:

That file name in the first error doesn't look like a vxWorks file. What 
devices have you got mounted. You need to specify a file path that points to 
one of the vxWorks file IO devices. By just specifying the file name in your 
second example it is being created in the current directory.

The second disk I / O error is what I had before applying the patch to 
unixUnlink. The error returned by vxWorks when deleting a file that doesn't 
exist depends on the underlying file system. If it is a POSIX file system it 
should return ENOENT. For dosFS it returns S_dosFsLib_FILE_NOT_FOUND, which in 
vxWorks 6.9 is 0x380003

So if you are using yet another file system, maybe you are getting a different 
error code being set. start by adding a printf to unixUnlink to find out if 
that is your problem.

Regards

Andy Ling

From:王庆刚 [2004wqg2...@163.com]
Sent: 25 August 2014 13:13
To:sqlite-users@sqlite.org; Andy Ling; Jan Nijtmans
Subject: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

hi

  I modified the code sqlite3.c according to you method, as follow 

 

 

  or    

 

I test you method in workbench3.2(vxworks6.8) , the build macros which I used 
in build properties is : -DOS_VXWORKS=1 -DSQLITE_THREADSAFE=0  
-DSQLITE_OMIT_LOAD_EXTENSION -DHAVE_UTIME

 

but it still have some problems.

1.  if I do as follows:

rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);

it tell me the error  can not open the database.

 

 

2.  if I do as follows:

rc = sqlite3_open("SqliteOne.db",);this will be ok .

but when I do the following thing 

sql = " create table stu(i int, name text);";

rc = sqlite3_exec(db,sql,NULL,NULL,);

it tell me the error  : disk I / O  error.



 


在 2014-08-12 08:10:13,"Jan Nijtmans"  写道:

2014-08-03 9:56 GMT+02:00 Jan Nijtmans :

2014-08-02 16:00 GMT+02:00 王庆刚 <2004wqg2...@163.com>:

> hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for 
> Vxworks6.8 ?
> When I  compile them , there have so many problems .

You can find the necessary changes here:


thanks to Andy Ling.

Still has to be reviewed by the SQLite developers for inclusion in 3.8.6
(not tested yet on other platforms than vxworks, win32/64 and Linux,
there it works fine)

 


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-28 Thread Andy Ling
Sorry, I meant unixDelete

My guess is that because you are using the host filing system vxWorks will be 
setting yet another error code for a file that doesn’t exist. So it will need 
another check adding to unixDelete

Regards

Andy Ling


From: 王庆刚 [mailto:2004wqg2...@163.com]
Sent: 28 August 2014 15:01
To: Andy Ling
Cc: sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re:RE: Re:RE: [sqlite] HELP sqlite3 used in vxworks has someproblem?


Is unixUnlink  an function? If it is , but I can not find the funtion in 
sqlite3.c.

Regards

Wang Qinggang





___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-27 Thread Andy Ling
So you are using a host file system. You should be able to make the open work 
by using

rc = sqlite3_open("host:D:/WindRiver/SqliteOne.db",);

You have to use a path and file name that works in the vxWorks domain.

It shouldn’t be necessary to use �CDSQLITE_ENABLE_LOCKING_STYLE=1. In fact it 
has been said this will probably not work in other areas. So it would be good 
to find out what is causing the disk I/O error. Did you try putting some debug 
in unixUnlink?

Regards

Andy Ling


From: 王庆刚 [mailto:2004wqg2...@163.com]
Sent: 27 August 2014 16:17
To: Andy Ling
Cc: sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re:RE: [sqlite] HELP sqlite3 used in vxworks has someproblem?



Firstly:

I  fixed the disk I/O error by adding -DSQLITE_ENABLE_LOCKING_STYLE=1 to the 
build macro.

Secondly:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);
I change it to the following
cd("host:D:/WindRiver");
rc = sqlite3_open("SqliteOne.db",);
can fix the problem : unable to open the database.


At 2014-08-26 08:55:31, "Andy Ling" 
> wrote:

As I said before, that doesn’t look like a vxWorks path to a file. Are you sure 
D:\\WindRiver really exists? In general vxWorks uses the forward slash (/) as a 
path separator. Is this a remote mounted host file system you are trying to use?

What is your current directory when it works the second time? i.e. what is the 
output from the “pwd” command? Can you use that directory as part of a full 
pathname?

I’m glad you have fixed the disk I/O problem. What did you have to do? Are 
there any more changes that need feeding back into the source?

Regards

Andy Ling


From: 王庆刚 [mailto:2004wqg2...@163.com]
Sent: 26 August 2014 13:44
To: Andy Ling
Cc: sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re:RE: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

hi, Andy Ling:
The error disk I / o error I have resolved ;
but when I used the following code:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);
it tell me  can not find the data base;

when I used the following code:
rc = sqlite3_open("SqliteOne.db",);
It is OK


How could I resolve the prolblem?


At 2014-08-25 11:29:57, "Andy Ling" 
> wrote:
That file name in the first error doesn't look like a vxWorks file. What 
devices have you got mounted. You need to specify a file path that points to 
one of the vxWorks file IO devices. By just specifying the file name in your 
second example it is being created in the current directory.

The second disk I / O error is what I had before applying the patch to 
unixUnlink. The error returned by vxWorks when deleting a file that doesn't 
exist depends on the underlying file system. If it is a POSIX file system it 
should return ENOENT. For dosFS it returns S_dosFsLib_FILE_NOT_FOUND, which in 
vxWorks 6.9 is 0x380003

So if you are using yet another file system, maybe you are getting a different 
error code being set. start by adding a printf to unixUnlink to find out if 
that is your problem.

Regards

Andy Ling

From: 王庆刚 [2004wqg2...@163.com]
Sent: 25 August 2014 13:13
To: sqlite-users@sqlite.org; Andy Ling; Jan 
Nijtmans
Subject: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?
hi
  I modified the code sqlite3.c according to you method, as follow

 

  or   

I test you method in workbench3.2(vxworks6.8) , the build macros which I used 
in build properties is : -DOS_VXWORKS=1 -DSQLITE_THREADSAFE=0  
-DSQLITE_OMIT_LOAD_EXTENSION -DHAVE_UTIME

but it still have some problems.
1.  if I do as follows:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);
it tell me the error  can not open the database.


2.  if I do as follows:
rc = sqlite3_open("SqliteOne.db",);this will be ok .
but when I do the following thing
sql = " create table stu(i int, name text);";
rc = sqlite3_exec(db,sql,NULL,NULL,);
it tell me the error  : disk I / O  error.



在 2014-08-12 08:10:13,"Jan Nijtmans" 
> 写道:
2014-08-03 9:56 GMT+02:00 Jan Nijtmans 
>:
2014-08-02 16:00 GMT+02:00 王庆刚 
<2004wqg2...@163.com>:
> hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for 
> Vxworks6.8 ?
> When I  compile them , there have so many problems .
You can find the necessary changes here:


thanks to Andy Ling.

Still has to be reviewed by the SQLite developers for inclusion in 3.8.6
(not tested yet on other platforms than vxworks, win32/64 and Linux,
there it works fine)


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-27 Thread 王庆刚


Firstly:

I  fixed the disk I/O error by adding -DSQLITE_ENABLE_LOCKING_STYLE=1 to the 
build macro.
 
Secondly:

rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);

I change it to the following

cd("host:D:/WindRiver");

rc = sqlite3_open("SqliteOne.db",);

can fix the problem : unable to open the database.





At 2014-08-26 08:55:31, "Andy Ling"  wrote:


As I said before, that doesn’t look like a vxWorks path to a file. Are you sure 
D:\\WindRiver really exists? In general vxWorks uses the forward slash (/) as a 
path separator. Is this a remote mounted host file system you are trying to use?

 

What is your current directory when it works the second time? i.e. what is the 
output from the “pwd” command? Can you use that directory as part of a full 
pathname?

 

I’m glad you have fixed the disk I/O problem. What did you have to do? Are 
there any more changes that need feeding back into the source?

 

Regards

 

Andy Ling

 

 

From:王庆刚 [mailto:2004wqg2...@163.com]
Sent: 26 August 2014 13:44
To: Andy Ling
Cc:sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re:RE: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

 

hi, Andy Ling:

The error disk I / o error I have resolved ;

but when I used the following code:

rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);

it tell me  can not find the data base;

 

when I used the following code:

rc = sqlite3_open("SqliteOne.db",);

It is OK

 

 

How could I resolve the prolblem?




 

At 2014-08-25 11:29:57, "Andy Ling"  wrote:



That file name in the first error doesn't look like a vxWorks file. What 
devices have you got mounted. You need to specify a file path that points to 
one of the vxWorks file IO devices. By just specifying the file name in your 
second example it is being created in the current directory.

The second disk I / O error is what I had before applying the patch to 
unixUnlink. The error returned by vxWorks when deleting a file that doesn't 
exist depends on the underlying file system. If it is a POSIX file system it 
should return ENOENT. For dosFS it returns S_dosFsLib_FILE_NOT_FOUND, which in 
vxWorks 6.9 is 0x380003

So if you are using yet another file system, maybe you are getting a different 
error code being set. start by adding a printf to unixUnlink to find out if 
that is your problem.

Regards

Andy Ling



From:王庆刚 [2004wqg2...@163.com]
Sent: 25 August 2014 13:13
To:sqlite-users@sqlite.org; Andy Ling; Jan Nijtmans
Subject: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

hi

  I modified the code sqlite3.c according to you method, as follow 

 

 

  or    

 

I test you method in workbench3.2(vxworks6.8) , the build macros which I used 
in build properties is : -DOS_VXWORKS=1 -DSQLITE_THREADSAFE=0  
-DSQLITE_OMIT_LOAD_EXTENSION -DHAVE_UTIME

 

but it still have some problems.

1.  if I do as follows:

rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);

it tell me the error  can not open the database.

 

 

2.  if I do as follows:

rc = sqlite3_open("SqliteOne.db",);this will be ok .

but when I do the following thing 

sql = " create table stu(i int, name text);";

rc = sqlite3_exec(db,sql,NULL,NULL,);

it tell me the error  : disk I / O  error.








在 2014-08-12 08:10:13,"Jan Nijtmans"  写道:



2014-08-03 9:56 GMT+02:00 Jan Nijtmans :

2014-08-02 16:00 GMT+02:00 王庆刚 <2004wqg2...@163.com>:

> hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for 
> Vxworks6.8 ?
> When I  compile them , there have so many problems .

You can find the necessary changes here:


thanks to Andy Ling.

Still has to be reviewed by the SQLite developers for inclusion in 3.8.6
(not tested yet on other platforms than vxworks, win32/64 and Linux,
there it works fine)

 

New attempt here, base on current SQLite trunk:
  

Regards,

  Jan Nijtmans

 

 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-26 Thread Richard Hipp
On Tue, Aug 26, 2014 at 8:44 AM, 王庆刚 <2004wqg2...@163.com> wrote:

> hi, Andy Ling:
> The error disk I / o error I have resolved ;
> but when I used the following code:
> rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);
> it tell me  can not find the data base;
>

Have you tried instead:

 rc = sqlite3_open("D:/WindRiver/SqliteOne.db", );

I do not have access to VxWorks, but as VxWorks is supposed to be POSIX, I
suspect that it would use the POSIX "/" directory separator rather than the
Windows "\\" directory separator.

I'm also suspicious of the "D:" prefix, which I do not believe to be POSIX,
but again, I do not know enough about VxWorks to say whether or not that
will work.



>
> when I used the following code:
> rc = sqlite3_open("SqliteOne.db",);
> It is OK
>
>
> How could I resolve the prolblem?
>
>
>
>
>
>
> At 2014-08-25 11:29:57, "Andy Ling"  wrote:
>
> That file name in the first error doesn't look like a vxWorks file. What
> devices have you got mounted. You need to specify a file path that points
> to one of the vxWorks file IO devices. By just specifying the file name in
> your second example it is being created in the current directory.
>
> The second disk I / O error is what I had before applying the patch to
> unixUnlink. The error returned by vxWorks when deleting a file that doesn't
> exist depends on the underlying file system. If it is a POSIX file system
> it should return ENOENT. For dosFS it returns S_dosFsLib_FILE_NOT_FOUND,
> which in vxWorks 6.9 is 0x380003
>
> So if you are using yet another file system, maybe you are getting a
> different error code being set. start by adding a printf to unixUnlink to
> find out if that is your problem.
>
> Regards
>
> Andy Ling
>
>
>
> From: 王庆刚 [2004wqg2...@163.com]
> Sent: 25 August 2014 13:13
> To:sqlite-users@sqlite.org; Andy Ling; Jan Nijtmans
> Subject: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?
>
>
> hi
>   I modified the code sqlite3.c according to you method, as follow
>
>
>  <
> http://fossil-scm.org/index.html/vpatch?from=dd5743a8239d1ce9=b68f65bb69a098a1>
> or   
>
>
> I test you method in workbench3.2(vxworks6.8) , the build macros which I
> used in build properties is : -DOS_VXWORKS=1 -DSQLITE_THREADSAFE=0
> -DSQLITE_OMIT_LOAD_EXTENSION -DHAVE_UTIME
>
>
> but it still have some problems.
> 1.  if I do as follows:
> rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);
> it tell me the error  can not open the database.
>
>
>
>
> 2.  if I do as follows:
> rc = sqlite3_open("SqliteOne.db",);this will be ok .
> but when I do the following thing
> sql = " create table stu(i int, name text);";
> rc = sqlite3_exec(db,sql,NULL,NULL,);
> it tell me the error  : disk I / O  error.
>
>
>
>
>
>
> 在 2014-08-12 08:10:13,"Jan Nijtmans"  写道:
>
> 2014-08-03 9:56 GMT+02:00 Jan Nijtmans :
>
> 2014-08-02 16:00 GMT+02:00 王庆刚 <2004wqg2...@163.com>:
>
> > hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for
> Vxworks6.8 ?
> > When I  compile them , there have so many problems .
>
>
> You can find the necessary changes here:
> <
> http://fossil-scm.org/index.html/vpatch?from=dd5743a8239d1ce9=b68f65bb69a098a1
> >
> thanks to Andy Ling.
>
> Still has to be reviewed by the SQLite developers for inclusion in 3.8.6
> (not tested yet on other platforms than vxworks, win32/64 and Linux,
> there it works fine)
>
>
>
> New attempt here, base on current SQLite trunk:
>   
>
>
> Regards,
>
>   Jan Nijtmans
>
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-26 Thread Andy Ling
As I said before, that doesn’t look like a vxWorks path to a file. Are you sure 
D:\\WindRiver really exists? In general vxWorks uses the forward slash (/) as a 
path separator. Is this a remote mounted host file system you are trying to use?

What is your current directory when it works the second time? i.e. what is the 
output from the “pwd” command? Can you use that directory as part of a full 
pathname?

I’m glad you have fixed the disk I/O problem. What did you have to do? Are 
there any more changes that need feeding back into the source?

Regards

Andy Ling


From: 王庆刚 [mailto:2004wqg2...@163.com]
Sent: 26 August 2014 13:44
To: Andy Ling
Cc: sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re:RE: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

hi, Andy Ling:
The error disk I / o error I have resolved ;
but when I used the following code:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);
it tell me  can not find the data base;

when I used the following code:
rc = sqlite3_open("SqliteOne.db",);
It is OK


How could I resolve the prolblem?



At 2014-08-25 11:29:57, "Andy Ling" 
> wrote:

That file name in the first error doesn't look like a vxWorks file. What 
devices have you got mounted. You need to specify a file path that points to 
one of the vxWorks file IO devices. By just specifying the file name in your 
second example it is being created in the current directory.

The second disk I / O error is what I had before applying the patch to 
unixUnlink. The error returned by vxWorks when deleting a file that doesn't 
exist depends on the underlying file system. If it is a POSIX file system it 
should return ENOENT. For dosFS it returns S_dosFsLib_FILE_NOT_FOUND, which in 
vxWorks 6.9 is 0x380003

So if you are using yet another file system, maybe you are getting a different 
error code being set. start by adding a printf to unixUnlink to find out if 
that is your problem.

Regards

Andy Ling


From: 王庆刚 [2004wqg2...@163.com]
Sent: 25 August 2014 13:13
To: sqlite-users@sqlite.org; Andy Ling; Jan 
Nijtmans
Subject: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?
hi
  I modified the code sqlite3.c according to you method, as follow

 

  or   

I test you method in workbench3.2(vxworks6.8) , the build macros which I used 
in build properties is : -DOS_VXWORKS=1 -DSQLITE_THREADSAFE=0  
-DSQLITE_OMIT_LOAD_EXTENSION -DHAVE_UTIME

but it still have some problems.
1.  if I do as follows:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);
it tell me the error  can not open the database.


2.  if I do as follows:
rc = sqlite3_open("SqliteOne.db",);this will be ok .
but when I do the following thing
sql = " create table stu(i int, name text);";
rc = sqlite3_exec(db,sql,NULL,NULL,);
it tell me the error  : disk I / O  error.




在 2014-08-12 08:10:13,"Jan Nijtmans" 
> 写道:

2014-08-03 9:56 GMT+02:00 Jan Nijtmans 
>:
2014-08-02 16:00 GMT+02:00 王庆刚 
<2004wqg2...@163.com>:
> hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for 
> Vxworks6.8 ?
> When I  compile them , there have so many problems .
You can find the necessary changes here:


thanks to Andy Ling.

Still has to be reviewed by the SQLite developers for inclusion in 3.8.6
(not tested yet on other platforms than vxworks, win32/64 and Linux,
there it works fine)

New attempt here, base on current SQLite trunk:
  
Regards,
  Jan Nijtmans


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-26 Thread 王庆刚
hi, Andy Ling:
The error disk I / o error I have resolved ;
but when I used the following code:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);
it tell me  can not find the data base;
 
when I used the following code:
rc = sqlite3_open("SqliteOne.db",);
It is OK
 
 
How could I resolve the prolblem?






At 2014-08-25 11:29:57, "Andy Ling"  wrote:

That file name in the first error doesn't look like a vxWorks file. What 
devices have you got mounted. You need to specify a file path that points to 
one of the vxWorks file IO devices. By just specifying the file name in your 
second example it is being created in the current directory.

The second disk I / O error is what I had before applying the patch to 
unixUnlink. The error returned by vxWorks when deleting a file that doesn't 
exist depends on the underlying file system. If it is a POSIX file system it 
should return ENOENT. For dosFS it returns S_dosFsLib_FILE_NOT_FOUND, which in 
vxWorks 6.9 is 0x380003

So if you are using yet another file system, maybe you are getting a different 
error code being set. start by adding a printf to unixUnlink to find out if 
that is your problem.

Regards

Andy Ling



From: 王庆刚 [2004wqg2...@163.com]
Sent: 25 August 2014 13:13
To:sqlite-users@sqlite.org; Andy Ling; Jan Nijtmans
Subject: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?


hi
  I modified the code sqlite3.c according to you method, as follow 


 

  or    


I test you method in workbench3.2(vxworks6.8) , the build macros which I used 
in build properties is : -DOS_VXWORKS=1 -DSQLITE_THREADSAFE=0  
-DSQLITE_OMIT_LOAD_EXTENSION -DHAVE_UTIME


but it still have some problems.
1.  if I do as follows:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);
it tell me the error  can not open the database.




2.  if I do as follows:
rc = sqlite3_open("SqliteOne.db",);this will be ok .
but when I do the following thing 
sql = " create table stu(i int, name text);";
rc = sqlite3_exec(db,sql,NULL,NULL,);
it tell me the error  : disk I / O  error.






在 2014-08-12 08:10:13,"Jan Nijtmans"  写道:

2014-08-03 9:56 GMT+02:00 Jan Nijtmans :

2014-08-02 16:00 GMT+02:00 王庆刚 <2004wqg2...@163.com>:

> hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for 
> Vxworks6.8 ?
> When I  compile them , there have so many problems .


You can find the necessary changes here:


thanks to Andy Ling.

Still has to be reviewed by the SQLite developers for inclusion in 3.8.6
(not tested yet on other platforms than vxworks, win32/64 and Linux,
there it works fine)



New attempt here, base on current SQLite trunk:
  


Regards,

  Jan Nijtmans




___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-25 Thread Andy Ling
That file name in the first error doesn't look like a vxWorks file. What 
devices have you got mounted. You need to specify a file path that points to 
one of the vxWorks file IO devices. By just specifying the file name in your 
second example it is being created in the current directory.

The second disk I / O error is what I had before applying the patch to 
unixUnlink. The error returned by vxWorks when deleting a file that doesn't 
exist depends on the underlying file system. If it is a POSIX file system it 
should return ENOENT. For dosFS it returns S_dosFsLib_FILE_NOT_FOUND, which in 
vxWorks 6.9 is 0x380003

So if you are using yet another file system, maybe you are getting a different 
error code being set. start by adding a printf to unixUnlink to find out if 
that is your problem.

Regards

Andy Ling



From: 王庆刚 [2004wqg2...@163.com]
Sent: 25 August 2014 13:13
To: sqlite-users@sqlite.org; Andy Ling; Jan Nijtmans
Subject: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

hi
  I modified the code sqlite3.c according to you method, as follow

 

  or   

I test you method in workbench3.2(vxworks6.8) , the build macros which I used 
in build properties is : -DOS_VXWORKS=1 -DSQLITE_THREADSAFE=0  
-DSQLITE_OMIT_LOAD_EXTENSION -DHAVE_UTIME

but it still have some problems.
1.  if I do as follows:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);
it tell me the error  can not open the database.


2.  if I do as follows:
rc = sqlite3_open("SqliteOne.db",);this will be ok .
but when I do the following thing
sql = " create table stu(i int, name text);";
rc = sqlite3_exec(db,sql,NULL,NULL,);
it tell me the error  : disk I / O  error.





在 2014-08-12 08:10:13,"Jan Nijtmans"  写道:
2014-08-03 9:56 GMT+02:00 Jan Nijtmans 
>:
2014-08-02 16:00 GMT+02:00 王庆刚 
<2004wqg2...@163.com>:
> hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for 
> Vxworks6.8 ?
> When I  compile them , there have so many problems .

You can find the necessary changes here:


thanks to Andy Ling.

Still has to be reviewed by the SQLite developers for inclusion in 3.8.6
(not tested yet on other platforms than vxworks, win32/64 and Linux,
there it works fine)

New attempt here, base on current SQLite trunk:
  

Regards,
  Jan Nijtmans



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-25 Thread 王庆刚
hi
  I modified the code sqlite3.c according to you method, as follow 


 

  or    


I test you method in workbench3.2(vxworks6.8) , the build macros which I used 
in build properties is : -DOS_VXWORKS=1 -DSQLITE_THREADSAFE=0  
-DSQLITE_OMIT_LOAD_EXTENSION -DHAVE_UTIME


but it still have some problems.
1.  if I do as follows:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",);
it tell me the error  can not open the database.




2.  if I do as follows:
rc = sqlite3_open("SqliteOne.db",);this will be ok .
but when I do the following thing 
sql = " create table stu(i int, name text);";
rc = sqlite3_exec(db,sql,NULL,NULL,);
it tell me the error  : disk I / O  error.






在 2014-08-12 08:10:13,"Jan Nijtmans"  写道:

2014-08-03 9:56 GMT+02:00 Jan Nijtmans :

2014-08-02 16:00 GMT+02:00 王庆刚 <2004wqg2...@163.com>:

> hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for 
> Vxworks6.8 ?
> When I  compile them , there have so many problems .


You can find the necessary changes here:


thanks to Andy Ling.

Still has to be reviewed by the SQLite developers for inclusion in 3.8.6
(not tested yet on other platforms than vxworks, win32/64 and Linux,
there it works fine)



New attempt here, base on current SQLite trunk:
  


Regards,

  Jan Nijtmans

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-14 Thread Andy Ling
That looks like a makefile generated by the vxWorks eclipse based workbench IDE 
tool. The bit that would be based on "user input" is that list of OPTs (the 
source files would be read automatically by adding to the project).

I use a custom build, so don't use these automatically generated files.

As to the options, Richard has said SQLITE_EABLE_LOCKING_STYLE should only be 
needed for Apple users.

So far I have done so little with SQLite that I don't know if I need any of the 
more advanced features. The compile flags I am using are -DHAVE_UTIME 
-DSQLITE_OMIT_LOAD_EXTENSION. This certainly compiles and runs to the point of 
letting me create tables and add and read data. As to locking and threading 
issues, I will find out over the next few months.

Regards

Andy Ling


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Jan Nijtmans [jan.nijtm...@gmail.com]
Sent: 14 August 2014 08:19
To: General Discussion of SQLite Database
Subject: Re: [sqlite]   HELP sqlite3 used in vxworks has someproblem?

2014-08-13 14:31 GMT+02:00 Andy Ling <andy.l...@quantel.com>:

> > From: drhsql...@gmail.com [mailto:drhsql...@gmail.com] On Behalf Of
> Richard Hipp
> > OK, I did find some cases where unlink() is called on files that do not
> exist.
>


> > Anyway, a patch has now been checked in.
>
> Great, thank


Congratulations to Andy and Richard for getting VxWorks
support back into SQLite. Just one more question:

What is the status of the Makefile.vxworks file in
the SQLite source code? Especially line 68
puzzles me, what is SQLITE_ENABLE_LOCKING_STYLE=1
needed for? (User "chw", whoever that is, should be able
to answer that question, since he/she committed this Makefile.vxworks)

<http://www.sqlite.org/src/artifact/034289efa9?ln=68>

Regards,
   Jan Nijtmans
___
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


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-14 Thread Jan Nijtmans
2014-08-13 14:31 GMT+02:00 Andy Ling :

> > From: drhsql...@gmail.com [mailto:drhsql...@gmail.com] On Behalf Of
> Richard Hipp
> > OK, I did find some cases where unlink() is called on files that do not
> exist.
>


> > Anyway, a patch has now been checked in.
>
> Great, thank


Congratulations to Andy and Richard for getting VxWorks
support back into SQLite. Just one more question:

What is the status of the Makefile.vxworks file in
the SQLite source code? Especially line 68
puzzles me, what is SQLITE_ENABLE_LOCKING_STYLE=1
needed for? (User "chw", whoever that is, should be able
to answer that question, since he/she committed this Makefile.vxworks)



Regards,
   Jan Nijtmans
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-13 Thread Andy Ling


> From: drhsql...@gmail.com [mailto:drhsql...@gmail.com] On Behalf Of Richard 
> Hipp
> Sent: 13 August 2014 12:40
> To: Andy Ling
> Cc: General Discussion of SQLite Database
> Subject: Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

> OK, I did find some cases where unlink() is called on files that do not exist.

Some of those very very rare cases :^)

Good to know there aren't more issues to track down.

> Anyway, a patch has now been checked in.

Great, thanks

Andy Ling


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem ?

2014-08-13 Thread Dave Dyer

There's a class of errors that affect lots of programs, where 
backup and/or antivirus software have a file open "unexpectedly",
which causes routine operations such as delete and rename to
fail unexpectedly.

I once promoted a fix for sqlite that combatted these problems
by retrying such unexpected failures instead of reporting the
error immediately.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem ?

2014-08-13 Thread Dave Dyer

There's a class of errors that affect lots of programs, where 
backup and/or antivirus software have a file open "unexpectedly",
which causes routine operations such as delete and rename to
fail unexpectedly.

I once promoted a fix for sqlite that combatted these problems
by retrying such unexpected failures instead of reporting the
error immediately.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-13 Thread Richard Hipp
OK, I did find some cases where unlink() is called on files that do not
exist.  We must have added those within the past couple of years

Anyway, a patch has now been checked in.


On Wed, Aug 13, 2014 at 5:09 AM, Andy Ling <andy.l...@quantel.com> wrote:

>
>
> > -Original Message-
> > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> > boun...@sqlite.org] On Behalf Of Andy Ling
> > Sent: 13 August 2014 10:06
> > To: 'Richard Hipp'
> > Cc: General Discussion of SQLite Database
> > Subject: Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?
> >
> > Then I try and create a table and get an error from unixDelete saying it
> can't
> > delete /ata0:3/testdb.sql-wal. It actually fails twice.
> >
>
> And before someone asks. I did try and create a file called
> /ata0:3/testdb.sql-wal and vxWorks is quite happy to create one.
>
> Regards
>
> Andy Ling
>
>


-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-13 Thread Andy Ling


> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Andy Ling
> Sent: 13 August 2014 10:06
> To: 'Richard Hipp'
> Cc: General Discussion of SQLite Database
> Subject: Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?
> 
> Then I try and create a table and get an error from unixDelete saying it can't
> delete /ata0:3/testdb.sql-wal. It actually fails twice.
> 

And before someone asks. I did try and create a file called 
/ata0:3/testdb.sql-wal and vxWorks is quite happy to create one.

Regards

Andy Ling

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-13 Thread Andy Ling
>  If your build is frequently trying to unlink a file that does not exist, 
> then something is wrong.  We need to figure out what that is and fix it.

I have added some debug.

First I create a brand new database called /ata0:3/testdb.sql

Then I try and create a table and get an error from unixDelete saying it can't 
delete /ata0:3/testdb.sql-wal. It actually fails twice.

My shell output is shown below

Regards

Andy Ling


[quentina]# ls -l
drwxrwxrwx  1 0   032768 Aug 13 09:55 logs/
drwxrwxrwx  1 0   032768 Aug 13 09:55 db/
drwxrwxrwx  1 0   032768 Dec 19  2013 dataLogs/
drwxrwxrwx  1 0   032768 Oct 29  2013 csv/
[quentina]#
[quentina]#
[quentina]# pwd
/ata0:3
[quentina]#
[quentina]# func call _open "/ata0:3/testdb.sql" &
[quentina]# 2014/08/13 10:02:39.00326[stdout] sql_open opening database 
/ata0:3/testdb.sql
2014/08/13 10:02:39.00326[stdout] Database /ata0:3/testdb.sql opened - pDb 
= 0x3ee9c48

[quentina]# ls -l
drwxrwxrwx  1 0   032768 Aug 13 09:55 logs/
drwxrwxrwx  1 0   032768 Aug 13 09:55 db/
drwxrwxrwx  1 0   032768 Dec 19  2013 dataLogs/
drwxrwxrwx  1 0   032768 Oct 29  2013 csv/
-rwxrwxrwx  1 0   00 Aug 13 10:02 testdb.sql
[quentina]# func call _execute "CREATE TABLE t (id INTEGER PRIMARY KEY 
ASC)" &
[quentina]# 2014/08/13 10:03:03.00897[stdout] Spawning sqlExec
2014/08/13 10:03:03.00898[stdout] unixDelete error 0x380003 for file 
/ata0:3/testdb.sql-wal
2014/08/13 10:03:03.00898[stdout] unixDelete error 0x380003 for file 
/ata0:3/testdb.sql-wal
2014/08/13 10:03:03.00913[stdout] Statement CREATE TABLE t (id INTEGER 
PRIMARY KEY ASC) executed

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Andy Ling
OK, thanks.

It isn't limited to 8+3. The dosFs name refers to the FAT nature of the file 
system, not any filename limitations. In fact files don't have to have a 
.extension.

Regards

Andy Ling


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Richard Hipp [d...@sqlite.org]
Sent: 12 August 2014 20:59
To: General Discussion of SQLite Database
Subject: Re: [sqlite]   HELP sqlite3 used in vxworks has someproblem?

On Tue, Aug 12, 2014 at 3:54 PM, Andy Ling <andy.l...@quantel.com> wrote:

>
> I did wonder if SQLite was making any assumptions about current
> directories or the makeup of a file name.
>

No.  Any filename will do.

You have to specify -DSQLITE_ENABLE_8_3_NAMES if your filesystem is limited
to 8+3 filenames, however.

--
D. Richard Hipp
d...@sqlite.org
___
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


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Richard Hipp
On Tue, Aug 12, 2014 at 3:54 PM, Andy Ling  wrote:

>
> I did wonder if SQLite was making any assumptions about current
> directories or the makeup of a file name.
>

No.  Any filename will do.

You have to specify -DSQLITE_ENABLE_8_3_NAMES if your filesystem is limited
to 8+3 filenames, however.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Andy Ling
Our code is already creating lots of files in /ata0:3 without any problem. This 
is quite a mature product that is working well and is exercising the hardware 
and drivers extensively. The database is a new feature to initially provide 
persistence of some data. So I am confident there is nothing wrong with the 
disk or its drivers.

I did wonder if SQLite was making any assumptions about current directories or 
the makeup of a file name. /ata0:3 is an unusual format for a directory name.

Anyway, a simple printf in unixDelete tomorrow will reveal all.

Regards

Andy Ling


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Simon Slavin [slav...@bigfraud.org]
Sent: 12 August 2014 20:16
To: General Discussion of SQLite Database
Subject: Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

On 12 Aug 2014, at 7:46pm, Andy Ling <andy.l...@quantel.com> wrote:

> I can tell you the name of the database file is /ata0:3/testdb.sql and it 
> gets created.

Can you add some commands to one of your apps using the library which create 
and delete a file in '/ata0:3/' and see they work ?  In other words, duplicate 
what SQLite is trying to do in your own code and see if your code has the same 
problem.

Simon.
___
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


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Simon Slavin

On 12 Aug 2014, at 7:46pm, Andy Ling  wrote:

> I can tell you the name of the database file is /ata0:3/testdb.sql and it 
> gets created.

Can you add some commands to one of your apps using the library which create 
and delete a file in '/ata0:3/' and see they work ?  In other words, duplicate 
what SQLite is trying to do in your own code and see if your code has the same 
problem.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Richard Hipp
On Tue, Aug 12, 2014 at 2:46 PM, Andy Ling <andy.l...@quantel.com> wrote:

>  I don't know. The standard debug doesn't print the name, so I will have
> to add something tomorrow.
>
> I can tell you the name of the database file is /ata0:3/testdb.sql and it
> gets created.
>
> It is possible things are working. It is just that the sqlite3_exec is not
> returning SQLITE_OK, so I give up and print an error.
>
> I wonder if before the check was added to unixDelete all unlink errors
> were ignored.
>

No.  The situation is that SQLite very rarely tries to unlink a file that
does not exist.  Very, very rarely.  So the error never came up for the
first eight years.

If your build is frequently trying to unlink a file that does not exist,
then something is wrong.  We need to figure out what that is and fix it.




> So it would have worked just fine and you wouldn't have known it was
> trying to delete files that didn't exist.
>
> I will investigate further tomorrow and let you know the file names.
>
> Regards
>
> Andy Ling
>
>  --
> *From:* drhsql...@gmail.com [drhsql...@gmail.com] on behalf of Richard
> Hipp [d...@sqlite.org]
> *Sent:* 12 August 2014 19:15
>
> *To:* Andy Ling
> *Cc:* General Discussion of SQLite Database; 王庆刚
> *Subject:* Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?
>
>   What is the name of the file that SQLite is trying to delete but which
> does not exist?  And what is the name of the corresponding database file?
> The name of the file that fails unlink() will give us a big clue about what
> is going wrong.
>
>
> On Tue, Aug 12, 2014 at 2:13 PM, Richard Hipp <d...@sqlite.org> wrote:
>
>>
>>
>>
>> On Tue, Aug 12, 2014 at 2:00 PM, Andy Ling <andy.l...@quantel.com> wrote:
>>
>>> Because the file doesn't exist. I assume because this is a brand new
>>> database the file hasn't been created yet.
>>>
>>> I did debug this originally, but I don't remember the file it is trying
>>> to delete. It definitely didn't exist though.
>>>
>>> To some extent it doesn't really matter. The unixDelete function on
>>> vxWorks with dosFs is broken for files that don't exist, so some change is
>>> needed.
>>>
>>
>>  That check to ignore the error when trying to delete a file that does
>> not exist - that check was only added less than 2 years ago, 2012-11-10.
>> So for the first 8 years of its history, billions of instances of SQLite3
>> got along fine without that check.  This is not surprising since an attempt
>> to delete a file that does not exist should only come up in very rare
>> circumstances.
>>
>> So we can update the unixDelete routine for that.
>>
>>  But, the fact that your build of SQLite does not work *at all* without
>> such a change suggests that there are other problems - problems that are
>> being masked, but not resolved, by the unixDelete change.  I'm trying
>> figure out what those other problems are.
>>
>>
>>
>> --
>> D. Richard Hipp
>> d...@sqlite.org
>>
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Andy Ling
I don't know. The standard debug doesn't print the name, so I will have to add 
something tomorrow.

I can tell you the name of the database file is /ata0:3/testdb.sql and it gets 
created.

It is possible things are working. It is just that the sqlite3_exec is not 
returning SQLITE_OK, so I give up and print an error.

I wonder if before the check was added to unixDelete all unlink errors were 
ignored. So it would have worked just fine and you wouldn't have known it was 
trying to delete files that didn't exist.

I will investigate further tomorrow and let you know the file names.

Regards

Andy Ling


From: drhsql...@gmail.com [drhsql...@gmail.com] on behalf of Richard Hipp 
[d...@sqlite.org]
Sent: 12 August 2014 19:15
To: Andy Ling
Cc: General Discussion of SQLite Database; 王庆刚
Subject: Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

What is the name of the file that SQLite is trying to delete but which does not 
exist?  And what is the name of the corresponding database file?  The name of 
the file that fails unlink() will give us a big clue about what is going wrong.


On Tue, Aug 12, 2014 at 2:13 PM, Richard Hipp 
<d...@sqlite.org<mailto:d...@sqlite.org>> wrote:



On Tue, Aug 12, 2014 at 2:00 PM, Andy Ling 
<andy.l...@quantel.com<mailto:andy.l...@quantel.com>> wrote:
Because the file doesn't exist. I assume because this is a brand new database 
the file hasn't been created yet.

I did debug this originally, but I don't remember the file it is trying to 
delete. It definitely didn't exist though.

To some extent it doesn't really matter. The unixDelete function on vxWorks 
with dosFs is broken for files that don't exist, so some change is needed.

That check to ignore the error when trying to delete a file that does not exist 
- that check was only added less than 2 years ago, 2012-11-10.  So for the 
first 8 years of its history, billions of instances of SQLite3 got along fine 
without that check.  This is not surprising since an attempt to delete a file 
that does not exist should only come up in very rare circumstances.

So we can update the unixDelete routine for that.

But, the fact that your build of SQLite does not work *at all* without such a 
change suggests that there are other problems - problems that are being masked, 
but not resolved, by the unixDelete change.  I'm trying figure out what those 
other problems are.



--
D. Richard Hipp
d...@sqlite.org<mailto:d...@sqlite.org>



--
D. Richard Hipp
d...@sqlite.org<mailto:d...@sqlite.org>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Richard Hipp
What is the name of the file that SQLite is trying to delete but which does
not exist?  And what is the name of the corresponding database file?  The
name of the file that fails unlink() will give us a big clue about what is
going wrong.


On Tue, Aug 12, 2014 at 2:13 PM, Richard Hipp  wrote:

>
>
>
> On Tue, Aug 12, 2014 at 2:00 PM, Andy Ling  wrote:
>
>> Because the file doesn't exist. I assume because this is a brand new
>> database the file hasn't been created yet.
>>
>> I did debug this originally, but I don't remember the file it is trying
>> to delete. It definitely didn't exist though.
>>
>> To some extent it doesn't really matter. The unixDelete function on
>> vxWorks with dosFs is broken for files that don't exist, so some change is
>> needed.
>>
>
> That check to ignore the error when trying to delete a file that does not
> exist - that check was only added less than 2 years ago, 2012-11-10.  So
> for the first 8 years of its history, billions of instances of SQLite3 got
> along fine without that check.  This is not surprising since an attempt to
> delete a file that does not exist should only come up in very rare
> circumstances.
>
> So we can update the unixDelete routine for that.
>
> But, the fact that your build of SQLite does not work *at all* without
> such a change suggests that there are other problems - problems that are
> being masked, but not resolved, by the unixDelete change.  I'm trying
> figure out what those other problems are.
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Richard Hipp
On Tue, Aug 12, 2014 at 2:00 PM, Andy Ling  wrote:

> Because the file doesn't exist. I assume because this is a brand new
> database the file hasn't been created yet.
>
> I did debug this originally, but I don't remember the file it is trying to
> delete. It definitely didn't exist though.
>
> To some extent it doesn't really matter. The unixDelete function on
> vxWorks with dosFs is broken for files that don't exist, so some change is
> needed.
>

That check to ignore the error when trying to delete a file that does not
exist - that check was only added less than 2 years ago, 2012-11-10.  So
for the first 8 years of its history, billions of instances of SQLite3 got
along fine without that check.  This is not surprising since an attempt to
delete a file that does not exist should only come up in very rare
circumstances.

So we can update the unixDelete routine for that.

But, the fact that your build of SQLite does not work *at all* without such
a change suggests that there are other problems - problems that are being
masked, but not resolved, by the unixDelete change.  I'm trying figure out
what those other problems are.



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Andy Ling
Because the file doesn't exist. I assume because this is a brand new database 
the file hasn't been created yet. 

I did debug this originally, but I don't remember the file it is trying to 
delete. It definitely didn't exist though. 

To some extent it doesn't really matter. The unixDelete function on vxWorks 
with dosFs is broken for files that don't exist, so some change is needed. The 
patch I sent is what Jan and I came up with. 

Regards 
 
Andy Ling  

From: drhsql...@gmail.com [drhsql...@gmail.com] on behalf of Richard Hipp 
[d...@sqlite.org]
Sent: 12 August 2014 18:01
To: Andy Ling
Cc: General Discussion of SQLite Database; 王庆刚
Subject: Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

On Tue, Aug 12, 2014 at 12:45 PM, Andy Ling 
<andy.l...@quantel.com<mailto:andy.l...@quantel.com>> wrote:
Doing a create table generates a disk I/O error

I open / create a new database with sqlite3_open_v2

  int err = sqlite3_open_v2 (file, , SQLITE_OPEN_READWRITE | 
SQLITE_OPEN_CREATE, "unix-namedsem") ;

Then call sqlite3_exec with “CREATE TABLE t (id INTEGER PRIMARY KEY ASC)”

This generates a disk I/O error. I assume it is trying to remove a temporary 
file.


It might be trying to unlink the rollback journal to commit the transaction.  
But why is that generating an error?  The file exists, so it shouldn't be 
generating a FILE_NOT_FOUND error...


--
D. Richard Hipp
d...@sqlite.org<mailto:d...@sqlite.org>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Richard Hipp
On Tue, Aug 12, 2014 at 12:45 PM, Andy Ling  wrote:

>  Doing a create table generates a disk I/O error
>
>
>
> I open / create a new database with sqlite3_open_v2
>
>
>
>   *int* err = sqlite3_open_v2 (file, , SQLITE_OPEN_READWRITE |
> SQLITE_OPEN_CREATE, "unix-namedsem") ;
>
>
>
> Then call sqlite3_exec with “CREATE TABLE t (id INTEGER PRIMARY KEY ASC)”
>
>
>
> This generates a disk I/O error. I assume it is trying to remove a
> temporary file.
>
>
>
It might be trying to unlink the rollback journal to commit the
transaction.  But why is that generating an error?  The file exists, so it
shouldn't be generating a FILE_NOT_FOUND error...


-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Andy Ling
Doing a create table generates a disk I/O error

I open / create a new database with sqlite3_open_v2

  int err = sqlite3_open_v2 (file, , SQLITE_OPEN_READWRITE | 
SQLITE_OPEN_CREATE, "unix-namedsem") ;

Then call sqlite3_exec with “CREATE TABLE t (id INTEGER PRIMARY KEY ASC)”

This generates a disk I/O error. I assume it is trying to remove a temporary 
file.

Regards

Andy Ling


From: drhsql...@gmail.com [mailto:drhsql...@gmail.com] On Behalf Of Richard Hipp
Sent: 12 August 2014 17:24
To: Andy Ling
Cc: General Discussion of SQLite Database; 王庆刚
Subject: Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?



On Tue, Aug 12, 2014 at 11:40 AM, Andy Ling 
<andy.l...@quantel.com<mailto:andy.l...@quantel.com>> wrote:
> From: drhsql...@gmail.com<mailto:drhsql...@gmail.com> 
> [mailto:drhsql...@gmail.com<mailto:drhsql...@gmail.com>] On Behalf Of Richard 
> Hipp
> Sent: 12 August 2014 15:46

> I put a new snapshot on the download page.  Please try it, *without* 
> SQLITE_ENABLE_LOCKING_MODE.
OK, it builds, but doesn't run.

What are you doing that is causing an unlink() call to fail?  That should be a 
very obscure and infrequent occurrence.  How is this preventing you from 
running simple tests?  What problems does it display?




It is missing the patch to unixDelete. Whilst vxWorks is POSIX compliant, for 
file I/O it is only
compliant if the underlying file system is. We are using dosFs, which isn't. 
This means the error
codes don't match. So we added the following.

static int unixDelete(
  sqlite3_vfs *NotUsed, /* VFS containing this as the xDelete method */
  const char *zPath,/* Name of file to be deleted */
  int dirSync   /* If true, fsync() directory after deleting file */
){
  int rc = SQLITE_OK;
  UNUSED_PARAMETER(NotUsed);
  SimulateIOError(return SQLITE_IOERR_DELETE);
  if( osUnlink(zPath)==(-1) ){
if( errno==ENOENT ){
  rc = SQLITE_IOERR_DELETE_NOENT;
#if OS_VXWORKS
}else if( errno==0x380003 ){ /* == S_dosFsLib_FILE_NOT_FOUND */
  rc = SQLITE_IOERR_DELETE_NOENT;
#endif
}else{
  rc = unixLogError(SQLITE_IOERR_DELETE, "unlink", zPath);
}
With this patch I have run a few simple commands. Created a table, added a few 
rows and listed them.

The compile options I'm using are -DHAVE_UTIME -DSQLITE_OMIT_LOAD_EXTENSION

Regards

Andy Ling


--
D. Richard Hipp
d...@sqlite.org<mailto:d...@sqlite.org>



--
D. Richard Hipp
d...@sqlite.org<mailto:d...@sqlite.org>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Richard Hipp
On Tue, Aug 12, 2014 at 11:40 AM, Andy Ling  wrote:

> > From: drhsql...@gmail.com [mailto:drhsql...@gmail.com] On Behalf Of
> Richard Hipp
> > Sent: 12 August 2014 15:46
>
> > I put a new snapshot on the download page.  Please try it, *without*
> SQLITE_ENABLE_LOCKING_MODE.
>
> OK, it builds, but doesn't run.
>

What are you doing that is causing an unlink() call to fail?  That should
be a very obscure and infrequent occurrence.  How is this preventing you
from running simple tests?  What problems does it display?




>
> It is missing the patch to unixDelete. Whilst vxWorks is POSIX compliant,
> for file I/O it is only
> compliant if the underlying file system is. We are using dosFs, which
> isn't. This means the error
> codes don't match. So we added the following.
>
> static int unixDelete(
>   sqlite3_vfs *NotUsed, /* VFS containing this as the xDelete method */
>   const char *zPath,/* Name of file to be deleted */
>   int dirSync   /* If true, fsync() directory after deleting
> file */
> ){
>   int rc = SQLITE_OK;
>   UNUSED_PARAMETER(NotUsed);
>   SimulateIOError(return SQLITE_IOERR_DELETE);
>   if( osUnlink(zPath)==(-1) ){
> if( errno==ENOENT ){
>   rc = SQLITE_IOERR_DELETE_NOENT;
> #if OS_VXWORKS
> }else if( errno==0x380003 ){ /* == S_dosFsLib_FILE_NOT_FOUND */
>   rc = SQLITE_IOERR_DELETE_NOENT;
> #endif
> }else{
>   rc = unixLogError(SQLITE_IOERR_DELETE, "unlink", zPath);
> }
>
> With this patch I have run a few simple commands. Created a table, added a
> few rows and listed them.
>
> The compile options I'm using are -DHAVE_UTIME -DSQLITE_OMIT_LOAD_EXTENSION
>
> Regards
>
> Andy Ling
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Andy Ling
> From: drhsql...@gmail.com [mailto:drhsql...@gmail.com] On Behalf Of Richard 
> Hipp
> Sent: 12 August 2014 15:46

> I put a new snapshot on the download page.  Please try it, *without* 
> SQLITE_ENABLE_LOCKING_MODE.

OK, it builds, but doesn't run.

It is missing the patch to unixDelete. Whilst vxWorks is POSIX compliant, for 
file I/O it is only
compliant if the underlying file system is. We are using dosFs, which isn't. 
This means the error
codes don't match. So we added the following.

static int unixDelete(
  sqlite3_vfs *NotUsed, /* VFS containing this as the xDelete method */
  const char *zPath,/* Name of file to be deleted */
  int dirSync   /* If true, fsync() directory after deleting file */
){
  int rc = SQLITE_OK;
  UNUSED_PARAMETER(NotUsed);
  SimulateIOError(return SQLITE_IOERR_DELETE);
  if( osUnlink(zPath)==(-1) ){
if( errno==ENOENT ){
  rc = SQLITE_IOERR_DELETE_NOENT;
#if OS_VXWORKS
}else if( errno==0x380003 ){ /* == S_dosFsLib_FILE_NOT_FOUND */
  rc = SQLITE_IOERR_DELETE_NOENT;
#endif
}else{
  rc = unixLogError(SQLITE_IOERR_DELETE, "unlink", zPath);
}

With this patch I have run a few simple commands. Created a table, added a few 
rows and listed them.

The compile options I'm using are -DHAVE_UTIME -DSQLITE_OMIT_LOAD_EXTENSION

Regards

Andy Ling


-- 
D. Richard Hipp
d...@sqlite.org 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Richard Hipp
On Tue, Aug 12, 2014 at 10:38 AM, Andy Ling  wrote:

> 've just downloaded the latest pre-release
> sqlite-amalgamation-201408081749.zip
> a
>

I put a new snapshot on the download page.  Please try it, *without*
SQLITE_ENABLE_LOCKING_MODE.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Andy Ling
> From: drhsql...@gmail.com [mailto:drhsql...@gmail.com] On Behalf Of Richard 
> Hipp
> Sent: 12 August 2014 14:28
> To: Andy Ling
> On Tue, Aug 12, 2014 at 9:23 AM, Andy Ling  wrote:


>> I have been testing
>> the changes Jan has made and at the moment I am happy.


> But we cannot use Jan's changes directly because he lives in a jurisdiction 
> that does not
> recognize the ability of an author to contribute their work into the public 
> domain.  We can
> only use Jan's changes as a guideline for implementing our own changes.
> Do you have any issues with the current code on the tip of trunk?

The patches I applied to 3.8.5 are working OK.
I've lost track a bit of what code I'm running and what I need to download.
So I've just downloaded the latest pre-release 
sqlite-amalgamation-201408081749.zip
and applied the patches below. This builds, but I haven't had a chance to do any
testing yet. Hopefully this matches the changes Jan suggested.

Regards

Andy Ling


*** sqlite3.c   2014-08-08 13:50:06.0 +0100
--- sqlite3vxw.c2014-08-12 15:21:22.0 +0100
***
*** 24161,24167 
  #endif


! #if SQLITE_ENABLE_LOCKING_STYLE
  # include 
  # if OS_VXWORKS
  #  include 
--- 24161,24167 
  #endif


! #if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS
  # include 
  # if OS_VXWORKS
  #  include 
***
*** 24589,24595 
--- 24589,24599 
  ** we are not running as root.
  */
  static int posixFchown(int fd, uid_t uid, gid_t gid){
+ #if OS_VXWORKS
+   return 0;
+ #else
return geteuid() ? 0 : fchown(fd,uid,gid);
+ #endif
  }

  /* Forward reference */
***
*** 24645,24651 
{ "read", (sqlite3_syscall_ptr)read,   0  },
  #define osRead  ((ssize_t(*)(int,void*,size_t))aSyscall[8].pCurrent)

! #if defined(USE_PREAD) || SQLITE_ENABLE_LOCKING_STYLE
{ "pread",(sqlite3_syscall_ptr)pread,  0  },
  #else
{ "pread",(sqlite3_syscall_ptr)0,  0  },
--- 24649,24655 
{ "read", (sqlite3_syscall_ptr)read,   0  },
  #define osRead  ((ssize_t(*)(int,void*,size_t))aSyscall[8].pCurrent)

! #if defined(USE_PREAD) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS)
{ "pread",(sqlite3_syscall_ptr)pread,  0  },
  #else
{ "pread",(sqlite3_syscall_ptr)0,  0  },
***
*** 24662,24668 
{ "write",(sqlite3_syscall_ptr)write,  0  },
  #define osWrite ((ssize_t(*)(int,const 
void*,size_t))aSyscall[11].pCurrent)

! #if defined(USE_PREAD) || SQLITE_ENABLE_LOCKING_STYLE
{ "pwrite",   (sqlite3_syscall_ptr)pwrite, 0  },
  #else
{ "pwrite",   (sqlite3_syscall_ptr)0,  0  },
--- 24666,24672 
{ "write",(sqlite3_syscall_ptr)write,  0  },
  #define osWrite ((ssize_t(*)(int,const 
void*,size_t))aSyscall[11].pCurrent)

! #if defined(USE_PREAD) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS)
{ "pwrite",   (sqlite3_syscall_ptr)pwrite, 0  },
  #else
{ "pwrite",   (sqlite3_syscall_ptr)0,  0  },
***
*** 25564,25572 
--- 25568,25582 
  ** Return TRUE if pFile has been renamed or unlinked since it was first 
opened.
  */
  static int fileHasMoved(unixFile *pFile){
+ #if OS_VXWORKS
+   return pFile->pInode!=0 &&
+
+  pFile->pId!=pFile->pInode->fileId.pId;
+ #else
struct stat buf;
return pFile->pInode!=0 &&
   (osStat(pFile->zPath, )!=0 || 
buf.st_ino!=pFile->pInode->fileId.ino);
+ #endif
  }


***
*** 26709,26715 
/* Otherwise see if some other process holds it. */
if( !reserved ){
  sem_t *pSem = pFile->pInode->pSem;
- struct stat statBuf;

  if( sem_trywait(pSem)==-1 ){
int tErrno = errno;
--- 26719,26724 
***
*** 26762,26768 
  */
  static int semLock(sqlite3_file *id, int eFileLock) {
unixFile *pFile = (unixFile*)id;
-   int fd;
sem_t *pSem = pFile->pInode->pSem;
int rc = SQLITE_OK;

--- 26771,26776 
***
*** 29893,29902 
int isCreate = (flags & SQLITE_OPEN_CREATE);
int isReadonly   = (flags & SQLITE_OPEN_READONLY);
int isReadWrite  = (flags & SQLITE_OPEN_READWRITE);
! #if SQLITE_ENABLE_LOCKING_STYLE
int isAutoProxy  = (flags & SQLITE_OPEN_AUTOPROXY);
  #endif
! #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
struct statfs fsInfo;
  #endif

--- 29901,29910 
int isCreate = (flags & SQLITE_OPEN_CREATE);
int isReadonly   = (flags & SQLITE_OPEN_READONLY);
int isReadWrite  = (flags & SQLITE_OPEN_READWRITE);
! #if SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS
int isAutoProxy  = (flags & SQLITE_OPEN_AUTOPROXY);
  #endif
! #if defined(__APPLE__) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS)
struct statfs fsInfo;
  #endif

***
*** 30062,30068 
noLock = eType!=SQLITE_OPEN_MAIN_DB;


! #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
if( 

Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Richard Hipp
On Tue, Aug 12, 2014 at 9:37 AM, Jan Nijtmans 
wrote:

> 2014-08-12 15:27 GMT+02:00 Richard Hipp :
>
> > But we cannot use Jan's changes directly because he lives in a
> jurisdiction
> > that does not recognize the ability of an author to contribute their work
> > into the public domain.  We can only use Jan's changes as a guideline for
> > implementing our own changes.
> >
>
> At least that's what the famous Lawyer Lawrence Rosen believes.
>
> For another opinion, see:
> 
>
> Unfortunately, I'm not a lawyer :-(
>

Right.  Opinions vary.  Pending clarification of the issue and in view of
the huge number of users that might be impacted if the issue gets resolved
the wrong way, I think it is better to play it safe and not accept patches
from people in non-British-common-law countries for the time being.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Jan Nijtmans
2014-08-12 15:27 GMT+02:00 Richard Hipp :

> But we cannot use Jan's changes directly because he lives in a jurisdiction
> that does not recognize the ability of an author to contribute their work
> into the public domain.  We can only use Jan's changes as a guideline for
> implementing our own changes.
>

At least that's what the famous Lawyer Lawrence Rosen believes.

For another opinion, see:


Unfortunately, I'm not a lawyer :-(

Regards,
Jan Nijtmans
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Richard Hipp
On Tue, Aug 12, 2014 at 9:23 AM, Andy Ling  wrote:

>
>
>  I have been testing
> the changes Jan has made and at the moment I am happy.
>


But we cannot use Jan's changes directly because he lives in a jurisdiction
that does not recognize the ability of an author to contribute their work
into the public domain.  We can only use Jan's changes as a guideline for
implementing our own changes.

Do you have any issues with the current code on the tip of trunk?



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Andy Ling


From: drhsql...@gmail.com [mailto:drhsql...@gmail.com] On Behalf Of Richard Hipp
Sent: 12 August 2014 13:27

> This is very awkward working through a proxy.  If Mr. Ling (or anybody else 
> with access
>  to a VxWorks development system) wants VxWorks support in SQLite, he can 
> come to
>  this mailing list himself and submit suggestions here, where we can ask 
> questions. 
>  No more VxWorks changes without direct communication with actual VxWorks 
> developers.

I am on the list and that was where I made my first requests. As vxWorks has a 
fairly limited
audience, Jan suggested we take it off-list to finalise the required patches. I 
have been testing
the changes Jan has made and at the moment I am happy.

> The first question I have:  Why do VxWorks developers think they also need
>  SQLITE_ENABLE_LOCKING_STYLE support?

I don't. At some point I think someone suggested turning it on to see if it 
helped fix my
compilation problems (one of the errors I had related to semaphores). So I 
reported the
errors I got with it turned on.

If I have any more problems I'll be sure to ask on the list, although responses 
to vxWorks
issues are pretty small :^)

Thanks for all the help so far

Regards

Andy Ling


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Jan Nijtmans
2014-08-12 14:26 GMT+02:00 Richard Hipp :

> This is very awkward working through a proxy.  If Mr. Ling (or anybody else
> with access to a VxWorks development system) wants VxWorks support in
> SQLite, he can come to this mailing list himself and submit suggestions
> here, where we can ask questions.  No more VxWorks changes without direct
> communication with actual VxWorks developers.
>

Original discussion can be found here:



Regards,
   Jan Nijtmans
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Richard Hipp
On Tue, Aug 12, 2014 at 8:10 AM, Jan Nijtmans 
wrote:

> New attempt here, base on current SQLite trunk:
>   
>

I fixed the obvious errors in the fileHasMoved() routine.  But as for the
other patches, I don't understand their purpose and so I'm unwilling to
implement them at this time.

This is very awkward working through a proxy.  If Mr. Ling (or anybody else
with access to a VxWorks development system) wants VxWorks support in
SQLite, he can come to this mailing list himself and submit suggestions
here, where we can ask questions.  No more VxWorks changes without direct
communication with actual VxWorks developers.

The first question I have:  Why do VxWorks developers think they also need
SQLITE_ENABLE_LOCKING_STYLE support?  The SQLITE_ENABLE_LOCKING_STYLE macro
is normally only used by Apple on Macs.  Nobody else uses it, as far as I
am aware.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-12 Thread Jan Nijtmans
2014-08-03 9:56 GMT+02:00 Jan Nijtmans :

> 2014-08-02 16:00 GMT+02:00 王庆刚 <2004wqg2...@163.com>:
> > hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for
> Vxworks6.8 ?
> > When I  compile them , there have so many problems .
>
> You can find the necessary changes here:
> <
> http://fossil-scm.org/index.html/vpatch?from=dd5743a8239d1ce9=b68f65bb69a098a1
> >
> thanks to Andy Ling.
>
> Still has to be reviewed by the SQLite developers for inclusion in 3.8.6
> (not tested yet on other platforms than vxworks, win32/64 and Linux,
> there it works fine)
>

New attempt here, base on current SQLite trunk:
  

Regards,
  Jan Nijtmans
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-04 Thread Andy Ling
> -Original Message-
> 
> 2014-08-02 16:00 GMT+02:00 王庆刚 <2004wqg2...@163.com>:
> > hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for
> Vxworks6.8 ?
> > When I  compile them , there have so many problems .
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> You can find the necessary changes here:
>  scm.org/index.html/vpatch?from=dd5743a8239d1ce9=b68f65bb69a098a
> 1>
> thanks to Andy Ling.
> 

Yes, I build it in Workbench 3.3 and vxWorks 6.9 as part of a RTP. I use the 
compile flags

-DHAVE_UTIME -DSQLITE_OMIT_LOAD_EXTENSION

You can probably make the load extension work if you need it. It requires 
linking to the dynamic linking library.

Regards

Andy Ling


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-03 Thread Jan Nijtmans
2014-08-02 16:00 GMT+02:00 王庆刚 <2004wqg2...@163.com>:
> hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for 
> Vxworks6.8 ?
> When I  compile them , there have so many problems .
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

You can find the necessary changes here:


thanks to Andy Ling.

Still has to be reviewed by the SQLite developers for inclusion in 3.8.6
(not tested yet on other platforms than vxworks, win32/64 and Linux,
there it works fine)

Regards,
Jan Nijtmans
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users