[MCOL-4371] When we declare a column as timestamp a default value is imposed Created: 2020-10-25  Updated: 2021-01-14

Status: Open
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: None
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: Akshat Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

MariaDB 10.4 running on Windows 10 using heidisql 11


Attachments: PNG File create_code.png    

 Description   

Sir,
Steps to reproduce the problem in Heidisql
1. Create a new table
2. Add a field say name char(50) not null
3. Add a field say timex timestamp no null. (Do not set any default value)
4. Click Save.

Now go and view the create code for the table.
It will be
CREATE TABLE `test_null` (
`name` CHAR(50) NOT NULL COLLATE 'latin1_swedish_ci',
`timex` TIMESTAMP NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
;

I can alter the table and remove the ON UPDATE value but I have been unable to remove both default and on update values

While creating table these were not added and have caused an issue. It was damn difficult locating the issue.

If default value in case of not null columns is a compulsion then how is there no default value for the char(50) field. I cannot add a row with a null value in the char() field.

I agree with this behaviour.

But adding a default value automatically is what I consider as a bug


Generated at Thu Feb 08 02:49:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.