866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
|
static int vt1_objects_update(sqlite3_vtab*vt,int argc,sqlite3_value**argv,sqlite3_int64*rowid) {
sqlite3_int64 id;
int x,y,z;
if(!main_options['e']) return SQLITE_LOCKED;
if(argc==1) {
// DELETE
id=sqlite3_value_int64(argv[0]);
pfunlink(id);
free(objects[id]);
objects[id]=0;
} else if(sqlite3_value_type(argv[0])==SQLITE_NULL) {
// INSERT
if(sqlite3_value_type(argv[1])!=SQLITE_NULL || sqlite3_value_type(argv[2])!=SQLITE_NULL) return SQLITE_CONSTRAINT_VTAB;
if(sqlite3_value_type(argv[3])==SQLITE_NULL) return SQLITE_CONSTRAINT_NOTNULL;
if(sqlite3_value_type(argv[7])==SQLITE_NULL) return SQLITE_CONSTRAINT_NOTNULL;
if(sqlite3_value_type(argv[11])!=SQLITE_NULL) return SQLITE_CONSTRAINT_VTAB;
if(sqlite3_value_type(argv[12])!=SQLITE_NULL) return SQLITE_CONSTRAINT_VTAB;
|
|
<
<
|
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
|
static int vt1_objects_update(sqlite3_vtab*vt,int argc,sqlite3_value**argv,sqlite3_int64*rowid) {
sqlite3_int64 id;
int x,y,z;
if(!main_options['e']) return SQLITE_LOCKED;
if(argc==1) {
// DELETE
id=sqlite3_value_int64(argv[0]);
objtrash(id);
} else if(sqlite3_value_type(argv[0])==SQLITE_NULL) {
// INSERT
if(sqlite3_value_type(argv[1])!=SQLITE_NULL || sqlite3_value_type(argv[2])!=SQLITE_NULL) return SQLITE_CONSTRAINT_VTAB;
if(sqlite3_value_type(argv[3])==SQLITE_NULL) return SQLITE_CONSTRAINT_NOTNULL;
if(sqlite3_value_type(argv[7])==SQLITE_NULL) return SQLITE_CONSTRAINT_NOTNULL;
if(sqlite3_value_type(argv[11])!=SQLITE_NULL) return SQLITE_CONSTRAINT_VTAB;
if(sqlite3_value_type(argv[12])!=SQLITE_NULL) return SQLITE_CONSTRAINT_VTAB;
|