2024-07-25 11:16:06 -07:00
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include "sqlite-vec.h"
|
|
|
|
|
#include "sqlite3.h"
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
Add comprehensive fuzz testing infrastructure with 6 new targets
- Fix numpy.c: tautology bug (|| → &&), infinite loop, and missing
sqlite3_vec_numpy_init call
- Replace tests/fuzz/Makefile: auto-detect clang, add UBSAN, macOS
ld_classic workaround, generic build rules for all 10 targets
- Add 6 new fuzz targets: shadow-corrupt (corrupted shadow tables),
vec0-operations (INSERT/DELETE/query sequences), scalar-functions
(all 18 SQL scalar functions), vec0-create-full (CREATE + lifecycle),
metadata-columns (metadata/auxiliary columns), vec-each (vec_each TVF)
- Add seed corpora for shadow-corrupt, vec0-operations, exec, and json
- Add fuzz-build/fuzz-quick/fuzz-long targets to root Makefile
All 10 targets verified building and running on macOS ARM (Apple Silicon).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 20:33:05 -08:00
|
|
|
extern int sqlite3_vec_numpy_init(sqlite3 *db, char **pzErrMsg,
|
|
|
|
|
const sqlite3_api_routines *pApi);
|
|
|
|
|
|
2024-07-25 11:16:06 -07:00
|
|
|
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|
|
|
|
int rc = SQLITE_OK;
|
|
|
|
|
sqlite3 *db;
|
|
|
|
|
sqlite3_stmt *stmt;
|
|
|
|
|
|
|
|
|
|
rc = sqlite3_open(":memory:", &db);
|
|
|
|
|
assert(rc == SQLITE_OK);
|
|
|
|
|
rc = sqlite3_vec_init(db, NULL, NULL);
|
|
|
|
|
assert(rc == SQLITE_OK);
|
Add comprehensive fuzz testing infrastructure with 6 new targets
- Fix numpy.c: tautology bug (|| → &&), infinite loop, and missing
sqlite3_vec_numpy_init call
- Replace tests/fuzz/Makefile: auto-detect clang, add UBSAN, macOS
ld_classic workaround, generic build rules for all 10 targets
- Add 6 new fuzz targets: shadow-corrupt (corrupted shadow tables),
vec0-operations (INSERT/DELETE/query sequences), scalar-functions
(all 18 SQL scalar functions), vec0-create-full (CREATE + lifecycle),
metadata-columns (metadata/auxiliary columns), vec-each (vec_each TVF)
- Add seed corpora for shadow-corrupt, vec0-operations, exec, and json
- Add fuzz-build/fuzz-quick/fuzz-long targets to root Makefile
All 10 targets verified building and running on macOS ARM (Apple Silicon).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 20:33:05 -08:00
|
|
|
rc = sqlite3_vec_numpy_init(db, NULL, NULL);
|
|
|
|
|
assert(rc == SQLITE_OK);
|
2024-07-25 11:16:06 -07:00
|
|
|
|
|
|
|
|
rc = sqlite3_prepare_v2(db, "select * from vec_npy_each(?)", -1, &stmt, NULL);
|
|
|
|
|
assert(rc == SQLITE_OK);
|
|
|
|
|
sqlite3_bind_blob(stmt, 1, data, size, SQLITE_STATIC);
|
|
|
|
|
rc = sqlite3_step(stmt);
|
Add comprehensive fuzz testing infrastructure with 6 new targets
- Fix numpy.c: tautology bug (|| → &&), infinite loop, and missing
sqlite3_vec_numpy_init call
- Replace tests/fuzz/Makefile: auto-detect clang, add UBSAN, macOS
ld_classic workaround, generic build rules for all 10 targets
- Add 6 new fuzz targets: shadow-corrupt (corrupted shadow tables),
vec0-operations (INSERT/DELETE/query sequences), scalar-functions
(all 18 SQL scalar functions), vec0-create-full (CREATE + lifecycle),
metadata-columns (metadata/auxiliary columns), vec-each (vec_each TVF)
- Add seed corpora for shadow-corrupt, vec0-operations, exec, and json
- Add fuzz-build/fuzz-quick/fuzz-long targets to root Makefile
All 10 targets verified building and running on macOS ARM (Apple Silicon).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 20:33:05 -08:00
|
|
|
while (rc == SQLITE_ROW) {
|
|
|
|
|
rc = sqlite3_step(stmt);
|
2024-07-25 11:16:06 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sqlite3_finalize(stmt);
|
|
|
|
|
sqlite3_close(db);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|