[MDEV-19655] Data truncated for column 'date_1' for alter ADD PERIOD FOR date_period command Created: 2019-05-31 Updated: 2021-02-10 Resolved: 2021-02-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Documentation, Versioned Tables |
| Affects Version/s: | 10.4.6 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Shahriyar Rzayev (Inactive) | Assignee: | Ian Gilfillan |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | versioned-table | ||
| Issue Links: |
|
||||||||
| Description |
|
Reading Application-time period tables doc: It is clear that there is alter statement for adding time_period, but if we also have date_period why not to add it using alter as well? If yes it can be added to the DOC as well. Adding columns to table:
Trying to add date_period:
Why? It is not clear. |
| Comments |
| Comment by Elena Stepanova [ 2019-05-31 ] | ||||||||||||||||||||||||||||||||||||||||
|
It is supported. But when you add the period, ALTER attempts to convert the period columns into NOT NULL and, in your case, fails because they already have NULL values inside. I'm not sure what can and should be done about it (or what the standard says about it), leaving it to nikitamalyavin to decide. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Shahriyar Rzayev (Inactive) [ 2019-05-31 ] | ||||||||||||||||||||||||||||||||||||||||
|
Yes indeed it makes null columns not null. Should it altered back to default null if we drop the date_period?
Or it is even better to leave it.
| ||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2019-05-31 ] | ||||||||||||||||||||||||||||||||||||||||
|
> Should it altered back to default null if we drop the date_period? > In fact it is not a big deal - just mention about this in the DOC and clarify a bit how people are going to use this feature.
Suggestions for improving the docs are always welcome, of course. > Another thing is mentioning clearly about constraint as well
| ||||||||||||||||||||||||||||||||||||||||
| Comment by Ian Gilfillan [ 2021-02-10 ] | ||||||||||||||||||||||||||||||||||||||||
|
Extended the documentation with an example. |