MariaDB root@(none):dyw> alter table tbl modify bi bigint not null default 100; You're about to run a destructive command. Do you want to proceed? (y/n): y Your call! (1265, "Data truncated for column 'bi' at row 1")
MariaDB root@(none):dyw> update tbl set bi=10; You're about to run a destructive command. Do you want to proceed? (y/n): y Your call! Query OK, 4 rows affected Time: 0.011s
MariaDB root@(none):dyw> alter table tbl modify bi bigint not null default 100; You're about to run a destructive command. Do you want to proceed? (y/n): y Your call! Query OK, 0 rows affected Time: 0.055s
MariaDB root@(none):dyw> desc tbl; +-----------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------------+--------------+------+-----+---------+----------------+ | bi | bigint(20) | NO | | 100 | | | id | int(11) | NO | PRI | <null> | auto_increment | | title | varchar(100) | NO | | <null> | | | author | varchar(40) | NO | | <null> | | | submission_date | date | YES | | <null> | | +-----------------+--------------+------+-----+---------+----------------+ 5 rows in set Time: 0.026s
MariaDB root@(none):dyw> alter table tbl alter bi set default 50; You're about to run a destructive command. Do you want to proceed? (y/n): y Your call! Query OK, 0 rows affected Time: 0.012s
MariaDB root@(none):dyw> desc tbl; +-----------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------------+--------------+------+-----+---------+----------------+ | bi | bigint(20) | NO | | 50 | | | id | int(11) | NO | PRI | <null> | auto_increment | | title | varchar(100) | NO | | <null> | | | author | varchar(40) | NO | | <null> | | | submission_date | date | YES | | <null> | | +-----------------+--------------+------+-----+---------+----------------+ 5 rows in set Time: 0.022s
MariaDB root@(none):dyw> alter table tbl alter bi drop default; You're about to run a destructive command. Do you want to proceed? (y/n): y Your call! Query OK, 0 rows affected Time: 0.008s
MariaDB root@(none):dyw> desc tbl; +-----------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------------+--------------+------+-----+---------+----------------+ | bi | bigint(20) | NO | | <null> | | | id | int(11) | NO | PRI | <null> | auto_increment | | title | varchar(100) | NO | | <null> | | | author | varchar(40) | NO | | <null> | | | submission_date | date | YES | | <null> | | +-----------------+--------------+------+-----+---------+----------------+ 5 rows in set Time: 0.022s