Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unqlite_config with UNQLITE_CONFIG_ERR_LOG is not clearing the content #119

Open
bgh34056 opened this issue Dec 11, 2020 · 0 comments
Open

Comments

@bgh34056
Copy link

bgh34056 commented Dec 11, 2020

Facing this issue with unqlite_config if I unqlite_kv_store fails in a loop . Would like to know how to solve this issue .

Wrapper function for unqlite_config
=============================

static void Fatal(unqlite *pDb,const char *zMsg)
{
if( pDb ){
const char zErr = NULL;
int iLen = 0;
/
Extract the database error log */
unqlite_config(pDb,UNQLITE_CONFIG_ERR_LOG,&zErr,&iLen);
if( iLen > 0 ){
puts(zErr); / Always null termniated */
}else{
if( zMsg ){
puts(zMsg);
}
}

}

Calling from Main
==========================

for(i=0;i<4;i++)
{
/* Store some records /
rc = unqlite_kv_store(pDb,"test",-1,"Hello World",11);
if( rc != UNQLITE_OK ){
/
Insertion fail, extract database error log and exit */
Fatal(pDb,0);
}
}

Prints Coming like this
=========================

IO error while opening the target database file: /home/chandra/lsproj/unqlite-master/trials/tt.db

IO error while opening the target database file: /home/chandra/lsproj/unqlite-master/trials/tt.db
IO error while opening the target database file: /home/chandra/lsproj/unqlite-master/trials/tt.db

IO error while opening the target database file: /home/chandra/lsproj/unqlite-master/trials/tt.db
IO error while opening the target database file: /home/chandra/lsproj/unqlite-master/trials/tt.db
IO error while opening the target database file: /home/chandra/lsproj/unqlite-master/trials/tt.db

IO error while opening the target database file: /home/chandra/lsproj/unqlite-master/trials/tt.db
IO error while opening the target database file: /home/chandra/lsproj/unqlite-master/trials/tt.db
IO error while opening the target database file: /home/chandra/lsproj/unqlite-master/trials/tt.db
IO error while opening the target database file: /home/chandra/lsproj/unqlite-master/trials/tt.db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant