[MDEV-25061] CREATE .. SELECT attempts to copy column CHECK constraints from selected columns (and fails sometimes) Created: 2021-03-04 Updated: 2023-04-27 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Create Table |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5, 10.6 |
| Fix Version/s: | 10.4, 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I could not determine whether it is the expected behavior, neither from the standard nor from comparison with MySQL.
So, CREATE .. SELECT has copied the CHECK constraint from the source table's column.
Again, CREATE .. SELECT attempts to copy the constraint on b column, only now it fails with a very confusing error:
If it is intended, it should probably be documented. |
| Comments |
| Comment by Elena Stepanova [ 2021-03-25 ] | |||||||||||||
|
Here is another example (maybe more realistic) of how CREATE .. SELECT fails because of CHECK constraint on a source table.
So, upon CREATE .. SELECT we give a new name to the selected column, but the check constraint is copied as is, with the old name, thus causing the problem. |