Return error when trying to drop an index associated with UNIQUE or PRIMARY KEY constraints

This commit is contained in:
rajajisai
2025-08-05 21:17:25 -07:00
parent 01531be9f4
commit f49575d547

View File

@@ -343,6 +343,15 @@ pub fn translate_drop_index(
)));
}
}
// Return an error if the index is an unique or primary key.
if let Some(idx) = maybe_index {
if idx.unique {
return Err(crate::error::LimboError::InvalidArgument(
"index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped"
.to_string(),
));
}
}
// According to sqlite should emit Null instruction
// but why?