We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
See symisc/vedis#3. The same code is used in unqlite, and the same bugs exist.
unqlite
There are 3 fixes to be applied: symisc/vedis#5, symisc/vedis#6, symisc/vedis#7
Here is example program to reproduce the issue (it is the vedis version adopted for unqlite)
#include <unqlite.h> #include <stdlib.h> #include <stdio.h> #include <time.h> // generate random bytes of variable (important!) length char *randomBytes(int* len) { *len = rand() % 4 + 1; char *res = (char*)malloc(*len); int i; for (i = 0; i < *len; i++) { res[i] = rand() % 256; } return res; } int main() { unqlite *db; int res = unqlite_open(&db, "test.db", UNQLITE_OPEN_CREATE); if (res != UNQLITE_OK) { printf("Error opening unqlite: %i\n", (int)res); return 0; } srand(time(NULL)); char buffer[255]; unqlite_int64 inout; int block = 0; int count = 0; while(1) { int keyLen; int valLen; char *key = randomBytes(&keyLen); char *val = randomBytes(&valLen); // insert random key res = unqlite_kv_store(db, key, keyLen, val, valLen); if (res != UNQLITE_OK) { printf("Unable to store: %i\n", (int)res); return 0; } // verify it was stored correctly inout = 255; res = unqlite_kv_fetch(db, key, keyLen, &buffer[0], &inout); if (res != UNQLITE_OK) { printf("Unable to fetch: %i", (int)res); return 0; } // generate new random key and delete if it exists free(key); key = randomBytes(&keyLen); inout = 255; res = unqlite_kv_fetch(db, key, keyLen, &buffer[0], &inout); if (res == UNQLITE_OK) { res = unqlite_kv_delete(db, key, keyLen); if (res != UNQLITE_OK) { printf("Unable to delete: %i\n", (int)res); return 0; } } free(key); free(val); count++; if (count > 10000) { block++; count = 0; printf("%i 10K iterations\n", block); } } return 0; }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
See symisc/vedis#3. The same code is used in
unqlite
, and the same bugs exist.There are 3 fixes to be applied: symisc/vedis#5, symisc/vedis#6, symisc/vedis#7
Here is example program to reproduce the issue (it is the vedis version adopted for unqlite)
The text was updated successfully, but these errors were encountered: