Comments - ALTER TABLE

 
3 years, 11 months ago lubos dz

Hi, could you please add an example on altering the table with table option? I cannot figure out how to drop "page_checksum" after changing from engine aria to myisam. Nothing seems working, always receiving "You have SQL error in your SQL syntax near .." - tried variations like:

ALTER TABLE 'tbl' PAGE_CHECKSUM = 0 ALTER TABLE 'tbl' PAGE_CHECKSUM 0 ALTER TABLE 'tbl' table_option PAGE_CHECKSUM 0

Using Mariadb 10.3 / centos7. When I execute "Show table status" it shows under "Create_options" : "page_checksum=1". Current engine is myISAM. This option causes table crash during import into another DB. Should be automatically dropped when egine changed from "aria" to "myisam". Thank you.

 
6 years, 4 months ago Adrian Wiik

Tiny typo in the last line of this quote:

alter_specification:
    table_option ...
  | ADD [COLUMN] [IF NOT EXISTS] col_name column_definition
        [FIRST | AFTER col_name ]
  | ADD [COLUMN] [IF NOT EXISTS] (col_name column_definition,...)
  | ADD {INDEX|KEY} [F NOT EXISTS] [index_name]

Missing an I (i) where it says "[F NOT EXISTS]". Should be pretty self explanatory for users, but nevertheless it's good to have correct syntax in documentation.

 
6 years, 3 months ago Michael Widenius

Fixed some time ago. Thanks for the input!

 
6 years, 5 months ago Nick Bolton

The encryption options are all missing in this documentation: ALTER TABLE t1 ENCRYPTED=YES; ALTER TABLE t1 ENCRYPTED=NO; ALTER TABLE t1 ENCRYPTION_KEY_ID=n;

 
9 years ago Paul Weiss

The documentation page for Setting Character Sets and Collations, gives the examples:

ALTER TABLE table_name MODIFY ascii_text_column TEXT CHARACTER SET utf8;
ALTER TABLE table_name MODIFY ascii_varchar_column VARCHAR(M) CHARACTER SET utf8;

However, this page does not include CHARACTER SET or COLLATION in the column_definition specification. Should that be changed?

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.