[MDEV-13377] current_timestamp variable being replaced in create table statement Created: 2017-07-24 Updated: 2021-12-08 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Packaging, Temporal Types |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Andrew Ramsay | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | upstream | ||
| Environment: |
windows |
||
| Attachments: |
|
| Description |
|
table definition is being altered by server:
...this is being returned by the server to read:
The brackets appearing after the variable CURRENT_TIMESTAMP are being added (presumably replacing the variable with the function), which causes problems with unexpected changes in the DDL. This does not happen in 10.0.24. |
| Comments |
| Comment by Elena Stepanova [ 2017-07-24 ] | ||||||||||||||||||||||||||||||||||
|
What exactly are the problems that this change causes? | ||||||||||||||||||||||||||||||||||
| Comment by Andrew Ramsay [ 2017-07-24 ] | ||||||||||||||||||||||||||||||||||
|
1.change management thinks a change has occurred as the text is returned differently when interrogating the database compared to DDL used for table creation. I made it minor as there is a workaround, but it still seems that it should remain as specified, if legal DDL, of course. | ||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-07-24 ] | ||||||||||||||||||||||||||||||||||
|
The change was intentional, made in scope of this commit: The syntax with brackets is legal (the standard seems to have it as an option), however, it only offers either CURRENT_TIMESTMP or CURRENT_TIMESTAMP(p), but not CURRENT_TIMESTAMP(). Or maybe it's just the 99th standard, and now things are different. serg, do you want to elaborate on that? (the standard note, and the problem in general – it's not the first time that we hear the complaint about the new syntax) Regarding the examples, 1. I'm not sure what change management is, but if it relies on SHOW CREATE output being identical to the original CREATE TABLE statement, it cannot possibly work, they are in general nothing alike:
Type specification, column flags, index specification, table flags – everything generally looks different. 2. The syntax with brackets is definitely legal and accepted by older versions of the server as well. Moreover, it existed in previous versions, in case a timestamp was specified with milliseconds:
If HeidiSQL has a problem with brackets, it's a bug that needs to be reported to HeidiSQL and when it's fixed, the new version should be wrapped in our Windows packages. | ||||||||||||||||||||||||||||||||||
| Comment by Alice Sherepa [ 2017-07-25 ] | ||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||
| Comment by Juha Pyy [ 2017-07-26 ] | ||||||||||||||||||||||||||||||||||
|
FWIW, there also seems to be bugs in HeidiSQL with handling curtime() and curdate().
..the table is shown in HeidiSQL with incorrect default values:
| ||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-09-19 ] | ||||||||||||||||||||||||||||||||||
|
alice, I think you reported the issue to HeidiSQL, right? If you did, please add a link to the item so we could track it too. I keep the report open, as we'll need to get the new version of HeidiSQL when it's fixed there. |