Bug #109461 ALTER TABLE .... ALTER COLUMN throws error
Submitted: 21 Dec 2022 17:43 Modified: 22 Dec 2022 13:36
Reporter: Luuk V Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:8,0.30 OS:Any (Windows)
Assigned to: CPU Architecture:Any

[21 Dec 2022 17:43] Luuk V
Description:
ALTER TABLE fails in the following scene:  

CREATE TABLE re ( 
   file_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, 
   mydate DATE NOT NULL
  );

ALTER TABLE re ALTER column `mydate` DATETIME NOT NULL;

One solution is to change 'ALTER COLUMN' to 'MODIFY COLUMN', like:

ALTER TABLE re MODIFY column `mydate` DATETIME NOT NULL;

How to repeat:
see description...

Suggested fix:
- Change docs, so it will be clear that 'ALTER  COLUMN' should not be used.

OR

- Solve this problem 😉
[22 Dec 2022 13:36] MySQL Verification Team
Hi Mr. V,

Thank you for your bug report.

However, it is not a bug.

Our Reference Manual clearly states that  ........ ALTER COLUMN ....... and ....... MODIFY COLUMN ..... have two very different scopes, with the first one being reduced to the changes for only couple of keywords.

Not a bug.