[MDEV-32876] Allow stored functions in CHECK constraints Created: 2023-11-25 Updated: 2023-11-25 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Federico Razzoli | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | check_constraints, stored_procedures | ||
| Description |
|
We should be able to use stored functions in CHECK constraints:
PostgreSQL and SQL Server allow this. I didn't check other DBMSs. PostgreSQL assumes that the function logic never changes. If you replace the function with a new version, it won't notice if CHECK constraints fail. I think that this is a reasonable limitation. Since MariaDB has a [NOT] DETERMINISTIC clause, it would also be reasonable to only allow DETERMINISTIC functions in CHECK constraints. |