[MDEV-23096] DEFAULT() doesn't behave as documented Created: 2020-07-05 Updated: 2020-08-17 Resolved: 2020-08-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Documentation |
| Affects Version/s: | 10.5.5 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Federico Razzoli | Assignee: | Ian Gilfillan |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Documentation for default function says: "If the column has no default value, NULL is returned." https://mariadb.com/kb/en/default/ A test shows that:
This looks like a bug to me.
This makes sense to me because no default != NULL, but in that case the docs should be adjusted. |
| Comments |
| Comment by Ian Gilfillan [ 2020-08-17 ] | |||||
|
The first issue doesn't appear to be a bug, as even with a single expression, no values will be returned as there are no rows:
The 2nd issue has been fixed in the docs. It was changed 7 years ago, but the contributor did not distinguish between NULL and NOT NULL fields. I've expanded the examples to hopefully demonstrate this. |