fix sqlite mutex/vfs/
This commit is contained in:
parent
10aad53661
commit
d246db603c
|
@ -166,6 +166,7 @@ static sqlite3_mutex *rttMutexAlloc(int iType){
|
|||
#if SQLITE_MUTEX_NREF
|
||||
p->id = iType;
|
||||
#endif
|
||||
rt_mutex_init(&p->mutex, "sqlmtx", RT_IPC_FLAG_PRIO);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -404,7 +404,7 @@ static int robust_open(const char *z, int f, mode_t m){
|
|||
sqlite3_log(SQLITE_WARNING,
|
||||
"attempt to open \"%s\" as file descriptor %d", z, fd);
|
||||
fd = -1;
|
||||
if( osOpen("/dev/null", f, m)<0 ) break;
|
||||
if( osOpen("/000111sql.test111000", f, m)<0 ) break;
|
||||
}
|
||||
|
||||
return fd;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,12 +20,18 @@ int test10_main(int argc, char **argv){
|
|||
rt_kprintf("Usage: %s DATABASE SQL-STATEMENT\n", argv[0]);
|
||||
return(1);
|
||||
}
|
||||
rt_kprintf("ready open %s\n", argv[1]);
|
||||
rc = sqlite3_open(argv[1], &db);
|
||||
|
||||
if( rc ){
|
||||
rt_kprintf("Can't open database: %s\n", sqlite3_errmsg(db));
|
||||
sqlite3_close(db);
|
||||
return(1);
|
||||
}
|
||||
else{
|
||||
rt_kprintf("open %s success\n", argv[1]);
|
||||
}
|
||||
rt_kprintf("SQL exec: %s\n", argv[2]);
|
||||
rc = sqlite3_exec(db, argv[2], callback, 0, &zErrMsg);
|
||||
if( rc!=SQLITE_OK ){
|
||||
rt_kprintf("SQL error: %s\n", zErrMsg);
|
||||
|
|
Loading…
Reference in New Issue