[MDEV-18512] using DATETIME(6) as row_start/row_end crashes server Created: 2019-02-08 Updated: 2019-05-20 Resolved: 2019-05-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Versioned Tables |
| Affects Version/s: | 10.3, 10.4 |
| Fix Version/s: | 10.3.16, 10.4.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Eugene Kosov (Inactive) | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
row_start/row_end can only be either TIMESTAMP(6) or BIGINT UNSIGNED. DATETIME(6) should be disallowed. Test case was found here https://stackoverflow.com/questions/52655055/using-datetime-in-mariadb-10-3-9-system-versioned-tables-works-for-rowstart-but |
| Comments |
| Comment by Eugene Kosov (Inactive) [ 2019-02-21 ] | |||||||||||||||||||||||
|
I do not remember whether this should be implemented or disabled. I think it should be disabled as there are no test cases for DATETIME. | |||||||||||||||||||||||
| Comment by Elena Stepanova [ 2019-03-08 ] | |||||||||||||||||||||||
|
As a fancy side-effect, the failure occurs even when a correct type is used in the statement, but it is executed under SQL_MODE which converts timestamp into datetime:
| |||||||||||||||||||||||
| Comment by Eugene Kosov (Inactive) [ 2019-03-11 ] | |||||||||||||||||||||||
|
This is because when sql_mode= 'MAXDB' TIMESTAMP implicitly becomes DATETIME https://github.com/MariaDB/server/blob/88d89ee0bae24b71416c2af4f4c2f2be7b6a033a/sql/sql_yacc.yy#L6946 Is it known to all sql_mode = 'MAXDB' users? Should error message be fixed for such case? | |||||||||||||||||||||||
| Comment by Elena Stepanova [ 2019-03-11 ] | |||||||||||||||||||||||
|
Right, as I said, a side-effect of the SQL_MODE which converts timestamp into datetime. I'm not 100% sure that MAXDB is the only one which features it, but my tests stopped failing after I removed it, so hopefully it is. I don't know if it's known to the users. I'm not sure if there are any users of MAXDB mode. Anyway, I also created a documentation/deprecation bug: | |||||||||||||||||||||||
| Comment by Alexander Barkov [ 2019-05-20 ] | |||||||||||||||||||||||
|
Reviewed and merged to 10.3 |