diff --git a/auto-increment.md b/auto-increment.md index 5bfdbfc99622c..b88cbb886389d 100644 --- a/auto-increment.md +++ b/auto-increment.md @@ -323,7 +323,7 @@ SHOW CREATE TABLE t; | Table | Create Table | +-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | t | CREATE TABLE `t` ( - `a` int(11) NOT NULL AUTO_INCREMENT, + `a` int NOT NULL AUTO_INCREMENT, PRIMARY KEY (`a`) /*T![clustered_index] CLUSTERED */ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=101 /*T![auto_id_cache] AUTO_ID_CACHE=100 */ | +-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/auto-random.md b/auto-random.md index b7b0f78b04420..3929abea33e5d 100644 --- a/auto-random.md +++ b/auto-random.md @@ -82,7 +82,7 @@ tidb> SHOW CREATE TABLE t; | Table | Create Table | +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | t | CREATE TABLE `t` ( - `a` bigint(20) NOT NULL /*T![auto_rand] AUTO_RANDOM(5) */, + `a` bigint NOT NULL /*T![auto_rand] AUTO_RANDOM(5) */, `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) /*T![clustered_index] CLUSTERED */ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T! PRE_SPLIT_REGIONS=2 */ | diff --git a/basic-sql-operations.md b/basic-sql-operations.md index 0ec3909847930..1914d7fdc875d 100644 --- a/basic-sql-operations.md +++ b/basic-sql-operations.md @@ -100,7 +100,7 @@ For example, to create a table named `person` which includes fields such as numb ```sql CREATE TABLE person ( - id INT(11), + id INT, name VARCHAR(255), birthday DATE ); diff --git a/cached-tables.md b/cached-tables.md index bde28b928dad1..94b647061e586 100644 --- a/cached-tables.md +++ b/cached-tables.md @@ -64,7 +64,7 @@ SHOW CREATE TABLE users; | Table | Create Table | +-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | users | CREATE TABLE `users` ( - `id` bigint(20) NOT NULL, + `id` bigint NOT NULL, `name` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /* CACHED ON */ | @@ -170,10 +170,10 @@ SHOW CREATE TABLE mysql.table_cache_meta\G *************************** 1. row *************************** Table: table_cache_meta Create Table: CREATE TABLE `table_cache_meta` ( - `tid` bigint(11) NOT NULL DEFAULT '0', + `tid` bigint NOT NULL DEFAULT '0', `lock_type` enum('NONE','READ','INTEND','WRITE') NOT NULL DEFAULT 'NONE', - `lease` bigint(20) NOT NULL DEFAULT '0', - `oldReadLease` bigint(20) NOT NULL DEFAULT '0', + `lease` bigint NOT NULL DEFAULT '0', + `oldReadLease` bigint NOT NULL DEFAULT '0', PRIMARY KEY (`tid`) /*T![clustered_index] CLUSTERED */ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin 1 row in set (0.00 sec) diff --git a/clustered-indexes.md b/clustered-indexes.md index b2378948ce401..afaa9df5d728e 100644 --- a/clustered-indexes.md +++ b/clustered-indexes.md @@ -106,7 +106,7 @@ mysql> SHOW CREATE TABLE t; | Table | Create Table | +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | t | CREATE TABLE `t` ( - `a` bigint(20) NOT NULL, + `a` bigint NOT NULL, `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) /*T![clustered_index] CLUSTERED */ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin | diff --git a/constraints.md b/constraints.md index 097a0d7e277ee..d9b8c48054678 100644 --- a/constraints.md +++ b/constraints.md @@ -101,9 +101,9 @@ SHOW CREATE TABLE t; | Table | Create Table | +-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | t | CREATE TABLE `t` ( - `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT NULL, + `a` int DEFAULT NULL, + `b` int DEFAULT NULL, + `c` int DEFAULT NULL, CONSTRAINT `c1` CHECK ((`b` > `c`)), CONSTRAINT `t_chk_1` CHECK ((`a` > 10)) /*!80016 NOT ENFORCED */, CONSTRAINT `t_chk_2` CHECK ((1 < `c`)) diff --git a/cost-model.md b/cost-model.md index 7319dfc52bd5f..71445fbdf91e7 100644 --- a/cost-model.md +++ b/cost-model.md @@ -19,9 +19,9 @@ mysql> SHOW CREATE TABLE t; | Table | Create Table | +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | t | CREATE TABLE `t` ( - `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT NULL, + `a` int DEFAULT NULL, + `b` int DEFAULT NULL, + `c` int DEFAULT NULL, KEY `b` (`b`), KEY `c` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin | diff --git a/develop/dev-guide-bookshop-schema-design.md b/develop/dev-guide-bookshop-schema-design.md index 3684c56739a71..445892068725b 100644 --- a/develop/dev-guide-bookshop-schema-design.md +++ b/develop/dev-guide-bookshop-schema-design.md @@ -166,10 +166,10 @@ This table stores the basic information of books. | Field name | Type | Description | |--------------|---------------|------------------------------------------------------------------| -| id | bigint(20) | Unique ID of a book | +| id | bigint | Unique ID of a book | | title | varchar(100) | Title of a book | | type | enum | Type of a book (for example, magazine, animation, or teaching aids) | -| stock | bigint(20) | Stock | +| stock | bigint | Stock | | price | decimal(15,2) | Price | | published_at | datetime | Date of publish | @@ -179,11 +179,11 @@ This table stores basic information of authors. | Field name | Type | Description | |------------|--------------|-------------------------------------------------------| -| id | bigint(20) | Unique ID of an author | +| id | bigint | Unique ID of an author | | name | varchar(100) | Name of an author | -| gender | tinyint(1) | Biological gender (0: female, 1: male, NULL: unknown) | -| birth_year | smallint(6) | Year of birth | -| death_year | smallint(6) | Year of death | +| gender | tinyint | Biological gender (0: female, 1: male, NULL: unknown) | +| birth_year | smallint | Year of birth | +| death_year | smallint | Year of death | ### `users` table @@ -191,7 +191,7 @@ This table stores information of Bookshop users. | Field name | Type | Description | |------------|---------------|-----------------------| -| id | bigint(20) | Unique ID of a user | +| id | bigint | Unique ID of a user | | balance | decimal(15,2) | Balance | | nickname | varchar(100) | Nickname | @@ -212,8 +212,8 @@ An author may write multiple books, and a book may involve more than one author. | Field name | Type | Description | |------------|------------|--------------------------------------------------------------| -| book_id | bigint(20) | Unique ID of a book (linked to [books](#books-table)) | -| author_id | bigint(20) | Unique ID of an author(Link to [authors](#authors-table)) | +| book_id | bigint | Unique ID of a book (linked to [books](#books-table)) | +| author_id | bigint | Unique ID of an author(Link to [authors](#authors-table)) | ### `orders` table @@ -221,10 +221,10 @@ This table stores user purchase information. | Field name | Type | Description | |------------|------------|----------------------------------------------------------------| -| id | bigint(20) | Unique ID of an order | -| book_id | bigint(20) | Unique ID of a book (linked to [books](#books-table)) | -| user_id | bigint(20) | User unique identifier (associated with [users](#users-table)) | -| quantity | tinyint(4) | Purchase quantity | +| id | bigint | Unique ID of an order | +| book_id | bigint | Unique ID of a book (linked to [books](#books-table)) | +| user_id | bigint | User unique identifier (associated with [users](#users-table)) | +| quantity | tinyint | Purchase quantity | | ordered_at | datetime | Purchase time | ## Database initialization script `dbinit.sql` @@ -236,29 +236,29 @@ CREATE DATABASE IF NOT EXISTS `bookshop`; DROP TABLE IF EXISTS `bookshop`.`books`; CREATE TABLE `bookshop`.`books` ( - `id` bigint(20) AUTO_RANDOM NOT NULL, + `id` bigint AUTO_RANDOM NOT NULL, `title` varchar(100) NOT NULL, `type` enum('Magazine', 'Novel', 'Life', 'Arts', 'Comics', 'Education & Reference', 'Humanities & Social Sciences', 'Science & Technology', 'Kids', 'Sports') NOT NULL, `published_at` datetime NOT NULL, - `stock` int(11) DEFAULT '0', + `stock` int DEFAULT '0', `price` decimal(15,2) DEFAULT '0.0', PRIMARY KEY (`id`) CLUSTERED ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; DROP TABLE IF EXISTS `bookshop`.`authors`; CREATE TABLE `bookshop`.`authors` ( - `id` bigint(20) AUTO_RANDOM NOT NULL, + `id` bigint AUTO_RANDOM NOT NULL, `name` varchar(100) NOT NULL, - `gender` tinyint(1) DEFAULT NULL, - `birth_year` smallint(6) DEFAULT NULL, - `death_year` smallint(6) DEFAULT NULL, + `gender` tinyint DEFAULT NULL, + `birth_year` smallint DEFAULT NULL, + `death_year` smallint DEFAULT NULL, PRIMARY KEY (`id`) CLUSTERED ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; DROP TABLE IF EXISTS `bookshop`.`book_authors`; CREATE TABLE `bookshop`.`book_authors` ( - `book_id` bigint(20) NOT NULL, - `author_id` bigint(20) NOT NULL, + `book_id` bigint NOT NULL, + `author_id` bigint NOT NULL, PRIMARY KEY (`book_id`,`author_id`) CLUSTERED ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; @@ -283,10 +283,10 @@ CREATE TABLE `bookshop`.`users` ( DROP TABLE IF EXISTS `bookshop`.`orders`; CREATE TABLE `bookshop`.`orders` ( - `id` bigint(20) AUTO_RANDOM NOT NULL, - `book_id` bigint(20) NOT NULL, - `user_id` bigint(20) NOT NULL, - `quality` tinyint(4) NOT NULL, + `id` bigint AUTO_RANDOM NOT NULL, + `book_id` bigint NOT NULL, + `user_id` bigint NOT NULL, + `quality` tinyint NOT NULL, `ordered_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) CLUSTERED, KEY `orders_book_id_idx` (`book_id`) diff --git a/develop/dev-guide-create-secondary-indexes.md b/develop/dev-guide-create-secondary-indexes.md index 93f783b08a86d..05a6038f40751 100644 --- a/develop/dev-guide-create-secondary-indexes.md +++ b/develop/dev-guide-create-secondary-indexes.md @@ -73,10 +73,10 @@ The fields in the `books` table are as follows: | Field name | Type | Field description | |--------------|---------------|------------------------------------------------------------------| -| id | bigint(20) | Unique ID of the book | +| id | bigint | Unique ID of the book | | title | varchar(100) | Book title | | type | enum | Types of books (for example, magazines, animations, and teaching aids) | -| stock | bigint(20) | Stock | +| stock | bigint | Stock | | price | decimal(15,2) | Price | | published_at | datetime | Date of publishing | @@ -84,11 +84,11 @@ The `books` table is created using the following SQL statement: ```sql CREATE TABLE `bookshop`.`books` ( - `id` bigint(20) AUTO_RANDOM NOT NULL, + `id` bigint AUTO_RANDOM NOT NULL, `title` varchar(100) NOT NULL, `type` enum('Magazine', 'Novel', 'Life', 'Arts', 'Comics', 'Education & Reference', 'Humanities & Social Sciences', 'Science & Technology', 'Kids', 'Sports') NOT NULL, `published_at` datetime NOT NULL, - `stock` int(11) DEFAULT '0', + `stock` int DEFAULT '0', `price` decimal(15,2) DEFAULT '0.0', PRIMARY KEY (`id`) CLUSTERED ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; diff --git a/develop/dev-guide-index-best-practice.md b/develop/dev-guide-index-best-practice.md index 7d242bde1c8cd..ed6675b9d8f5a 100644 --- a/develop/dev-guide-index-best-practice.md +++ b/develop/dev-guide-index-best-practice.md @@ -15,11 +15,11 @@ This section takes the `books` table in the [bookshop](/develop/dev-guide-booksh ```sql CREATE TABLE `books` ( - `id` bigint(20) AUTO_RANDOM NOT NULL, + `id` bigint AUTO_RANDOM NOT NULL, `title` varchar(100) NOT NULL, `type` enum('Magazine', 'Novel', 'Life', 'Arts', 'Comics', 'Education & Reference', 'Humanities & Social Sciences', 'Science & Technology', 'Kids', 'Sports') NOT NULL, `published_at` datetime NOT NULL, - `stock` int(11) DEFAULT '0', + `stock` int DEFAULT '0', `price` decimal(15,2) DEFAULT '0.0', PRIMARY KEY (`id`) CLUSTERED ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; diff --git a/develop/dev-guide-transaction-restraints.md b/develop/dev-guide-transaction-restraints.md index e11359a8ca065..f83b3e035780a 100644 --- a/develop/dev-guide-transaction-restraints.md +++ b/develop/dev-guide-transaction-restraints.md @@ -83,10 +83,10 @@ public class EffectWriteSkew { public static void createDoctorTable(Connection connection) throws SQLException { connection.createStatement().executeUpdate("CREATE TABLE `doctors` (" + - " `id` int(11) NOT NULL," + + " `id` int NOT NULL," + " `name` varchar(255) DEFAULT NULL," + - " `on_call` tinyint(1) DEFAULT NULL," + - " `shift_id` int(11) DEFAULT NULL," + + " `on_call` tinyint DEFAULT NULL," + + " `shift_id` int DEFAULT NULL," + " PRIMARY KEY (`id`)," + " KEY `idx_shift_id` (`shift_id`)" + " ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin"); @@ -307,10 +307,10 @@ func prepareData(db *sql.DB) error { func createDoctorTable(db *sql.DB) error { _, err := db.Exec("CREATE TABLE IF NOT EXISTS `doctors` (" + - " `id` int(11) NOT NULL," + + " `id` int NOT NULL," + " `name` varchar(255) DEFAULT NULL," + - " `on_call` tinyint(1) DEFAULT NULL," + - " `shift_id` int(11) DEFAULT NULL," + + " `on_call` tinyint DEFAULT NULL," + + " `shift_id` int DEFAULT NULL," + " PRIMARY KEY (`id`)," + " KEY `idx_shift_id` (`shift_id`)" + " ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin") @@ -410,10 +410,10 @@ public class EffectWriteSkew { public static void createDoctorTable(Connection connection) throws SQLException { connection.createStatement().executeUpdate("CREATE TABLE `doctors` (" + - " `id` int(11) NOT NULL," + + " `id` int NOT NULL," + " `name` varchar(255) DEFAULT NULL," + - " `on_call` tinyint(1) DEFAULT NULL," + - " `shift_id` int(11) DEFAULT NULL," + + " `on_call` tinyint DEFAULT NULL," + + " `shift_id` int DEFAULT NULL," + " PRIMARY KEY (`id`)," + " KEY `idx_shift_id` (`shift_id`)" + " ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin"); @@ -632,10 +632,10 @@ func prepareData(db *sql.DB) error { func createDoctorTable(db *sql.DB) error { _, err := db.Exec("CREATE TABLE IF NOT EXISTS `doctors` (" + - " `id` int(11) NOT NULL," + + " `id` int NOT NULL," + " `name` varchar(255) DEFAULT NULL," + - " `on_call` tinyint(1) DEFAULT NULL," + - " `shift_id` int(11) DEFAULT NULL," + + " `on_call` tinyint DEFAULT NULL," + + " `shift_id` int DEFAULT NULL," + " PRIMARY KEY (`id`)," + " KEY `idx_shift_id` (`shift_id`)" + " ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin") diff --git a/develop/dev-guide-unique-serial-number-generation.md b/develop/dev-guide-unique-serial-number-generation.md index c8885610337ad..12e12fd174fa2 100644 --- a/develop/dev-guide-unique-serial-number-generation.md +++ b/develop/dev-guide-unique-serial-number-generation.md @@ -43,8 +43,8 @@ The number allocation solution can be understood as bulk acquisition of auto-inc | Field Name | Field Type | Field Description | | -------- | ------------ | ---------------------------- | | `SEQ_NAME` | varchar(128) | The name of the sequence, used to distinguish different applications. | -| `MAX_ID` | bigint(20) | The maximum value of the current sequence that has been allocated. | -| `STEP` | int(11) | The step, which indicates the length of each assigned segment. | +| `MAX_ID` | bigint | The maximum value of the current sequence that has been allocated. | +| `STEP` | int | The step, which indicates the length of each assigned segment. | Every time, the application gets a segment of sequence numbers at the configured step. It updates the database at the same time to persist the maximum value of the current sequence that has been allocated. The processing and allocation of sequence numbers are completed in the application's memory. After a segment of sequence numbers is used up, the application gets a new segment of sequence numbers, which effectively alleviates the pressure on the database write. In practice, you can also adjust the step to control the frequency of database updates. diff --git a/dm/dm-manage-schema.md b/dm/dm-manage-schema.md index 720d635eb3ca7..ed32f4acaafd7 100644 --- a/dm/dm-manage-schema.md +++ b/dm/dm-manage-schema.md @@ -124,7 +124,7 @@ binlog-schema list -s mysql-replica-01 task_single db_single t1 "sources": [ { "result": true, - "msg": "CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin", + "msg": "CREATE TABLE `t1` ( `c1` int NOT NULL, `c2` int DEFAULT NULL, PRIMARY KEY (`c1`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin", "source": "mysql-replica-01", "worker": "127.0.0.1:8262" } @@ -163,8 +163,8 @@ If you want to set the table schema of the ``` `db_single`.`t1` ``` table corres ```sql CREATE TABLE `t1` ( - `c1` int(11) NOT NULL, - `c2` bigint(11) DEFAULT NULL, + `c1` int NOT NULL, + `c2` bigint DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin ``` diff --git a/dm/dm-open-api.md b/dm/dm-open-api.md index ada86e1cbf718..3ca2ea452b20d 100644 --- a/dm/dm-open-api.md +++ b/dm/dm-open-api.md @@ -1615,7 +1615,7 @@ curl -X 'GET' \ { "schema_name": "db1", "table_name": "table1", - "schema_create_sql": "CREATE TABLE `t1` (`id` int(11) NOT NULL AUTO_INCREMENT,PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin" + "schema_create_sql": "CREATE TABLE `t1` (`id` int NOT NULL AUTO_INCREMENT,PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin" } ``` @@ -1637,7 +1637,7 @@ curl -X 'PUT' \ -H 'accept: */*' \ -H 'Content-Type: application/json' \ -d '{ - "sql_content": "CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL, `c3` int(11) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;", + "sql_content": "CREATE TABLE `t1` ( `c1` int DEFAULT NULL, `c2` int DEFAULT NULL, `c3` int DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;", "flush": true, "sync": true }' diff --git a/dm/dm-performance-test.md b/dm/dm-performance-test.md index 06a6bc4600df2..3429ef8c40a86 100644 --- a/dm/dm-performance-test.md +++ b/dm/dm-performance-test.md @@ -27,8 +27,8 @@ Use tables with the following schema for the performance test: ```sql CREATE TABLE `sbtest` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `k` int(11) NOT NULL DEFAULT '0', + `id` int NOT NULL AUTO_INCREMENT, + `k` int NOT NULL DEFAULT '0', `c` char(120) CHARSET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '', `pad` char(60) CHARSET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '', PRIMARY KEY (`id`), diff --git a/dm/dm-table-routing.md b/dm/dm-table-routing.md index 2625c6aaf1fb1..1950dd5d77e19 100644 --- a/dm/dm-table-routing.md +++ b/dm/dm-table-routing.md @@ -116,7 +116,7 @@ To extract the source information of upstream sharded tables to the merged table ```sql CREATE TABLE `test`.`t` ( - a int(11) PRIMARY KEY, + a int PRIMARY KEY, c_table varchar(10) DEFAULT NULL, c_schema varchar(10) DEFAULT NULL, c_source varchar(10) DEFAULT NULL @@ -184,7 +184,7 @@ mysql> select * from test.t; ```sql CREATE TABLE `test`.`t` ( c_table varchar(10) DEFAULT NULL, - a int(11) PRIMARY KEY, + a int PRIMARY KEY, c_schema varchar(10) DEFAULT NULL, c_source varchar(10) DEFAULT NULL ); @@ -194,7 +194,7 @@ CREATE TABLE `test`.`t` ( ```sql CREATE TABLE `test`.`t` ( - a int(11) PRIMARY KEY, + a int PRIMARY KEY, c_table varchar(10) DEFAULT NULL, c_schema varchar(10) DEFAULT NULL, ); @@ -204,9 +204,9 @@ CREATE TABLE `test`.`t` ( ```sql CREATE TABLE `test`.`t` ( - a int(11) PRIMARY KEY, + a int PRIMARY KEY, c_table varchar(10) DEFAULT NULL, - c_schema int(11) DEFAULT NULL, + c_schema int DEFAULT NULL, c_source varchar(10) DEFAULT NULL, ); ``` diff --git a/dm/feature-online-ddl.md b/dm/feature-online-ddl.md index e853ef67ff688..adb01c0e15570 100644 --- a/dm/feature-online-ddl.md +++ b/dm/feature-online-ddl.md @@ -131,8 +131,8 @@ The SQL statements mostly used by pt-osc and the corresponding operation of DM a 1. Create the `_new` table: ```sql - CREATE TABLE `test`.`_test4_new` ( id int(11) NOT NULL AUTO_INCREMENT, - date date DEFAULT NULL, account_id bigint(20) DEFAULT NULL, conversion_price decimal(20,3) DEFAULT NULL, ocpc_matched_conversions bigint(20) DEFAULT NULL, ad_cost decimal(20,3) DEFAULT NULL,cl2 varchar(20) COLLATE utf8mb4_bin NOT NULL,cl1 varchar(20) COLLATE utf8mb4_bin NOT NULL,PRIMARY KEY (id) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ; + CREATE TABLE `test`.`_test4_new` ( id int NOT NULL AUTO_INCREMENT, + date date DEFAULT NULL, account_id bigint DEFAULT NULL, conversion_price decimal(20,3) DEFAULT NULL, ocpc_matched_conversions bigint DEFAULT NULL, ad_cost decimal(20,3) DEFAULT NULL,cl2 varchar(20) COLLATE utf8mb4_bin NOT NULL,cl1 varchar(20) COLLATE utf8mb4_bin NOT NULL,PRIMARY KEY (id) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ; ``` DM does not create the `_test4_new` table. DM deletes the `dm_meta.{task_name}_onlineddl` record in the downstream according to `ghost_schema`, `ghost_table`, and the `server_id` of `dm_worker`, and clears the related information in memory. diff --git a/dm/handle-failed-ddl-statements.md b/dm/handle-failed-ddl-statements.md index 99415b02ee934..55296f8684aab 100644 --- a/dm/handle-failed-ddl-statements.md +++ b/dm/handle-failed-ddl-statements.md @@ -128,7 +128,7 @@ SHOW CREATE TABLE db1.tbl1; | Table | Create Table | +-------+--------------------------------------------------+ | tbl1 | CREATE TABLE `tbl1` ( - `c1` int(11) NOT NULL, + `c1` int NOT NULL, `c2` decimal(11,3) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | @@ -251,7 +251,7 @@ SHOW CREATE TABLE shard_db.shard_table; | Table | Create Table | +-------+-----------------------------------------------------------------------------------------------------------+ | tb | CREATE TABLE `shard_table` ( - `id` int(11) DEFAULT NULL, + `id` int DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin | +-------+-----------------------------------------------------------------------------------------------------------+ @@ -485,7 +485,7 @@ SHOW CREATE TABLE db1.tbl1; | Table | Create Table | +-------+-----------------------------------------------------------------------------------------------------------+ | tb | CREATE TABLE `tbl1` ( - `id` int(11) DEFAULT NULL, + `id` int DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin | +-------+-----------------------------------------------------------------------------------------------------------+ @@ -610,7 +610,7 @@ SHOW CREATE TABLE shard_db.shard_table; | Table | Create Table | +-------+-----------------------------------------------------------------------------------------------------------+ | tb | CREATE TABLE `shard_table` ( - `id` int(11) DEFAULT NULL, + `id` int DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin | +-------+-----------------------------------------------------------------------------------------------------------+ diff --git a/dm/manually-handling-sharding-ddl-locks.md b/dm/manually-handling-sharding-ddl-locks.md index 663547ec5b3d1..0d283a056b390 100644 --- a/dm/manually-handling-sharding-ddl-locks.md +++ b/dm/manually-handling-sharding-ddl-locks.md @@ -173,7 +173,7 @@ SHOW CREATE TABLE shard_db_1.shard_table_1; | Table | Create Table | +---------------+------------------------------------------+ | shard_table_1 | CREATE TABLE `shard_table_1` ( - `c1` int(11) NOT NULL, + `c1` int NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | +---------------+------------------------------------------+ @@ -212,7 +212,7 @@ The operation processes of MySQL and DM are as follows: "mode": "pessimistic" "owner": "mysql-replica-01", "DDLs": [ - "USE `shard_db`; ALTER TABLE `shard_db`.`shard_table` ADD COLUMN `c2` int(11);" + "USE `shard_db`; ALTER TABLE `shard_db`.`shard_table` ADD COLUMN `c2` int;" ], "synced": [ "mysql-replica-01" @@ -267,8 +267,8 @@ The operation processes of MySQL and DM are as follows: | Table | Create Table | +-------------+--------------------------------------------------+ | shard_table | CREATE TABLE `shard_table` ( - `c1` int(11) NOT NULL, - `c2` int(11) DEFAULT NULL, + `c1` int NOT NULL, + `c2` int DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin | +-------------+--------------------------------------------------+ @@ -331,7 +331,7 @@ The operation processes are: "mode": "pessimistic" "owner": "mysql-replica-02", "DDLs": [ - "USE `shard_db`; ALTER TABLE `shard_db`.`shard_table` ADD COLUMN `c2` int(11);" + "USE `shard_db`; ALTER TABLE `shard_db`.`shard_table` ADD COLUMN `c2` int;" ], "synced": [ "mysql-replica-02" diff --git a/dm/shard-merge-best-practices.md b/dm/shard-merge-best-practices.md index 637f97716cc06..a0ad1647063c5 100644 --- a/dm/shard-merge-best-practices.md +++ b/dm/shard-merge-best-practices.md @@ -45,8 +45,8 @@ Assume that the upstream schemas are as follows: ```sql CREATE TABLE `tbl_no_pk` ( - `auto_pk_c1` bigint(20) NOT NULL, - `uk_c2` bigint(20) NOT NULL, + `auto_pk_c1` bigint NOT NULL, + `uk_c2` bigint NOT NULL, `content_c3` text, PRIMARY KEY (`auto_pk_c1`), UNIQUE KEY `uk_c2` (`uk_c2`) @@ -64,8 +64,8 @@ Then you can perform the following steps to fix the `ERROR 1062 (23000): Duplica ```sql CREATE TABLE `tbl_no_pk_2` ( - `auto_pk_c1` bigint(20) NOT NULL, - `uk_c2` bigint(20) NOT NULL, + `auto_pk_c1` bigint NOT NULL, + `uk_c2` bigint NOT NULL, `content_c3` text, INDEX (`auto_pk_c1`), UNIQUE KEY `uk_c2` (`uk_c2`) @@ -88,8 +88,8 @@ Assume that the upstream schemas are as follows: ```sql CREATE TABLE `tbl_multi_pk` ( - `auto_pk_c1` bigint(20) NOT NULL, - `uuid_c2` bigint(20) NOT NULL, + `auto_pk_c1` bigint NOT NULL, + `uuid_c2` bigint NOT NULL, `content_c3` text, PRIMARY KEY (`auto_pk_c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -107,8 +107,8 @@ Then you can perform the following steps to fix the `ERROR 1062 (23000): Duplica ```sql CREATE TABLE `tbl_multi_pk_c2` ( - `auto_pk_c1` bigint(20) NOT NULL, - `uuid_c2` bigint(20) NOT NULL, + `auto_pk_c1` bigint NOT NULL, + `uuid_c2` bigint NOT NULL, `content_c3` text, PRIMARY KEY (`auto_pk_c1`,`uuid_c2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 diff --git a/dumpling-overview.md b/dumpling-overview.md index 97a12fdf89cc7..f90b7b9897890 100644 --- a/dumpling-overview.md +++ b/dumpling-overview.md @@ -198,7 +198,7 @@ You can use the `--compress ` option to compress the CSV and SQL data an ```shell CREATE TABLE `t1` ( - `id` int(11) DEFAULT NULL + `id` int DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; ``` diff --git a/explain-walkthrough.md b/explain-walkthrough.md index 8ff69b18bbea7..0102d76b169a6 100644 --- a/explain-walkthrough.md +++ b/explain-walkthrough.md @@ -138,13 +138,13 @@ SHOW CREATE TABLE trips\G *************************** 1. row *************************** Table: trips Create Table: CREATE TABLE `trips` ( - `trip_id` bigint(20) NOT NULL AUTO_INCREMENT, - `duration` int(11) NOT NULL, + `trip_id` bigint NOT NULL AUTO_INCREMENT, + `duration` int NOT NULL, `start_date` datetime DEFAULT NULL, `end_date` datetime DEFAULT NULL, - `start_station_number` int(11) DEFAULT NULL, + `start_station_number` int DEFAULT NULL, `start_station` varchar(255) DEFAULT NULL, - `end_station_number` int(11) DEFAULT NULL, + `end_station_number` int DEFAULT NULL, `end_station` varchar(255) DEFAULT NULL, `bike_number` varchar(255) DEFAULT NULL, `member_type` varchar(255) DEFAULT NULL, diff --git a/foreign-key.md b/foreign-key.md index 724848ffd64d3..f9f222a6f8d7c 100644 --- a/foreign-key.md +++ b/foreign-key.md @@ -152,8 +152,8 @@ mysql> SHOW CREATE TABLE child\G *************************** 1. row *************************** Table: child Create Table: CREATE TABLE `child` ( - `id` int(11) DEFAULT NULL, - `pid` int(11) DEFAULT NULL, + `id` int DEFAULT NULL, + `pid` int DEFAULT NULL, KEY `idx_pid` (`pid`), CONSTRAINT `fk_1` FOREIGN KEY (`pid`) REFERENCES `test`.`parent` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin @@ -191,8 +191,8 @@ mysql> SHOW CREATE TABLE child\G *************************** 1. row *************************** Table: child Create Table: CREATE TABLE `child` ( - `id` int(11) DEFAULT NULL, - `pid` int(11) DEFAULT NULL, + `id` int DEFAULT NULL, + `pid` int DEFAULT NULL, KEY `idx_pid` (`pid`), CONSTRAINT `fk_1` FOREIGN KEY (`pid`) REFERENCES `test`.`parent` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin @@ -293,8 +293,8 @@ mysql> SHOW CREATE TABLE child\G ***************************[ 1. row ]*************************** Table | child Create Table | CREATE TABLE `child` ( - `id` int(11) DEFAULT NULL, - `pid` int(11) DEFAULT NULL, + `id` int DEFAULT NULL, + `pid` int DEFAULT NULL, KEY `idx_pid` (`pid`), CONSTRAINT `fk_1` FOREIGN KEY (`pid`) REFERENCES `test`.`parent` (`id`) ON DELETE CASCADE /* FOREIGN KEY INVALID */ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin @@ -345,8 +345,8 @@ The output shows that the `child` table does not contain any foreign keys: | Table | Create Table | +-------+-------------------------------------------------------------+ | child | CREATE TABLE `child` ( | -| | `id` int(11) DEFAULT NULL, | -| | `pid` int(11) DEFAULT NULL | +| | `id` int DEFAULT NULL, | +| | `pid` int DEFAULT NULL | | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin | +-------+-------------------------------------------------------------+ ``` diff --git a/functions-and-operators/tidb-functions.md b/functions-and-operators/tidb-functions.md index 2c83abad02d13..91f24fc0038d3 100644 --- a/functions-and-operators/tidb-functions.md +++ b/functions-and-operators/tidb-functions.md @@ -192,7 +192,7 @@ SHOW CREATE TABLE t2\G Table: t2 Create Table: CREATE TABLE `t2` ( `id` binary(36) NOT NULL, - `a` tinyint(3) unsigned NOT NULL, + `a` tinyint unsigned NOT NULL, `v` varchar(512) DEFAULT NULL, PRIMARY KEY (`a`,`id`) /*T![clustered_index] CLUSTERED */ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin diff --git a/migrate-large-mysql-shards-to-tidb.md b/migrate-large-mysql-shards-to-tidb.md index 887c06776f550..f7bc7327affa1 100644 --- a/migrate-large-mysql-shards-to-tidb.md +++ b/migrate-large-mysql-shards-to-tidb.md @@ -45,9 +45,9 @@ Assume that tables 1~4 have the same table structure as follows. ```sql CREATE TABLE `table1` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `sid` bigint(20) NOT NULL, - `pid` bigint(20) NOT NULL, + `id` bigint NOT NULL AUTO_INCREMENT, + `sid` bigint NOT NULL, + `pid` bigint NOT NULL, `comment` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `sid` (`sid`) @@ -60,9 +60,9 @@ For those four tables, the `id` column is the primary key. It is auto-incrementa ```sql CREATE TABLE `table5` ( - `id` bigint(20) NOT NULL, - `sid` bigint(20) NOT NULL, - `pid` bigint(20) NOT NULL, + `id` bigint NOT NULL, + `sid` bigint NOT NULL, + `pid` bigint NOT NULL, `comment` varchar(255) DEFAULT NULL, INDEX (`id`), UNIQUE KEY `sid` (`sid`) @@ -140,9 +140,9 @@ Create `mydb.table5` at downstream. ```sql CREATE TABLE `table5` ( - `id` bigint(20) NOT NULL, - `sid` bigint(20) NOT NULL, - `pid` bigint(20) NOT NULL, + `id` bigint NOT NULL, + `sid` bigint NOT NULL, + `pid` bigint NOT NULL, `comment` varchar(255) DEFAULT NULL, INDEX (`id`), UNIQUE KEY `sid` (`sid`) diff --git a/migrate-small-mysql-shards-to-tidb.md b/migrate-small-mysql-shards-to-tidb.md index 36a08188b0057..c6100ec2a20f6 100644 --- a/migrate-small-mysql-shards-to-tidb.md +++ b/migrate-small-mysql-shards-to-tidb.md @@ -42,9 +42,9 @@ In this example, `sale_01` and `sale_02` have the same table structure as follow ```sql CREATE TABLE `sale_01` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `sid` bigint(20) NOT NULL, - `pid` bigint(20) NOT NULL, + `id` bigint NOT NULL AUTO_INCREMENT, + `sid` bigint NOT NULL, + `pid` bigint NOT NULL, `comment` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `sid` (`sid`) @@ -57,9 +57,9 @@ The `id` column is the primary key, and the `sid` column is the sharding key. Th ```sql CREATE TABLE `sale` ( - `id` bigint(20) NOT NULL, - `sid` bigint(20) NOT NULL, - `pid` bigint(20) NOT NULL, + `id` bigint NOT NULL, + `sid` bigint NOT NULL, + `pid` bigint NOT NULL, `comment` varchar(255) DEFAULT NULL, INDEX (`id`), UNIQUE KEY `sid` (`sid`) diff --git a/migrate-with-more-columns-downstream.md b/migrate-with-more-columns-downstream.md index f60f67e6ceb88..ae36ebad493b7 100644 --- a/migrate-with-more-columns-downstream.md +++ b/migrate-with-more-columns-downstream.md @@ -36,7 +36,7 @@ The following is an example upstream table schema: ```sql # Upstream table schema CREATE TABLE `messages` ( - `id` int(11) NOT NULL, + `id` int NOT NULL, PRIMARY KEY (`id`) ) ``` @@ -46,7 +46,7 @@ The following is an example downstream table schema: ```sql # Downstream table schema CREATE TABLE `messages` ( - `id` int(11) NOT NULL, + `id` int NOT NULL, `message` varchar(255) DEFAULT NULL, # This is the additional column that only exists in the downstream table. PRIMARY KEY (`id`) ) @@ -61,7 +61,7 @@ In such cases, you can use the `binlog-schema` command to set a table schema for ```sql # Upstream table schema CREATE TABLE `messages` ( - `id` int(11) NOT NULL, + `id` int NOT NULL, PRIMARY KEY (`id`) ) ``` diff --git a/mysql-schema/mysql-schema-user.md b/mysql-schema/mysql-schema-user.md index 175d36b3fcfb6..5c4564b5134a8 100644 --- a/mysql-schema/mysql-schema-user.md +++ b/mysql-schema/mysql-schema-user.md @@ -16,54 +16,54 @@ DESC mysql.user; The output is as follows: ``` -+------------------------+----------------------+------+------+-------------------+-------+ -| Field | Type | Null | Key | Default | Extra | -+------------------------+----------------------+------+------+-------------------+-------+ -| Host | char(255) | NO | PRI | NULL | | -| User | char(32) | NO | PRI | NULL | | -| authentication_string | text | YES | | NULL | | -| plugin | char(64) | YES | | NULL | | -| Select_priv | enum('N','Y') | NO | | N | | -| Insert_priv | enum('N','Y') | NO | | N | | -| Update_priv | enum('N','Y') | NO | | N | | -| Delete_priv | enum('N','Y') | NO | | N | | -| Create_priv | enum('N','Y') | NO | | N | | -| Drop_priv | enum('N','Y') | NO | | N | | -| Process_priv | enum('N','Y') | NO | | N | | -| Grant_priv | enum('N','Y') | NO | | N | | -| References_priv | enum('N','Y') | NO | | N | | -| Alter_priv | enum('N','Y') | NO | | N | | -| Show_db_priv | enum('N','Y') | NO | | N | | -| Super_priv | enum('N','Y') | NO | | N | | -| Create_tmp_table_priv | enum('N','Y') | NO | | N | | -| Lock_tables_priv | enum('N','Y') | NO | | N | | -| Execute_priv | enum('N','Y') | NO | | N | | -| Create_view_priv | enum('N','Y') | NO | | N | | -| Show_view_priv | enum('N','Y') | NO | | N | | -| Create_routine_priv | enum('N','Y') | NO | | N | | -| Alter_routine_priv | enum('N','Y') | NO | | N | | -| Index_priv | enum('N','Y') | NO | | N | | -| Create_user_priv | enum('N','Y') | NO | | N | | -| Event_priv | enum('N','Y') | NO | | N | | -| Repl_slave_priv | enum('N','Y') | NO | | N | | -| Repl_client_priv | enum('N','Y') | NO | | N | | -| Trigger_priv | enum('N','Y') | NO | | N | | -| Create_role_priv | enum('N','Y') | NO | | N | | -| Drop_role_priv | enum('N','Y') | NO | | N | | -| Account_locked | enum('N','Y') | NO | | N | | -| Shutdown_priv | enum('N','Y') | NO | | N | | -| Reload_priv | enum('N','Y') | NO | | N | | -| FILE_priv | enum('N','Y') | NO | | N | | -| Config_priv | enum('N','Y') | NO | | N | | -| Create_Tablespace_Priv | enum('N','Y') | NO | | N | | -| Password_reuse_history | smallint(5) unsigned | YES | | NULL | | -| Password_reuse_time | smallint(5) unsigned | YES | | NULL | | -| User_attributes | json | YES | | NULL | | -| Token_issuer | varchar(255) | YES | | NULL | | -| Password_expired | enum('N','Y') | NO | | N | | -| Password_last_changed | timestamp | YES | | CURRENT_TIMESTAMP | | -| Password_lifetime | smallint(5) unsigned | YES | | NULL | | -+------------------------+----------------------+------+------+-------------------+-------+ ++------------------------+-------------------+------+------+-------------------+-------+ +| Field | Type | Null | Key | Default | Extra | ++------------------------+-------------------+------+------+-------------------+-------+ +| Host | char(255) | NO | PRI | NULL | | +| User | char(32) | NO | PRI | NULL | | +| authentication_string | text | YES | | NULL | | +| plugin | char(64) | YES | | NULL | | +| Select_priv | enum('N','Y') | NO | | N | | +| Insert_priv | enum('N','Y') | NO | | N | | +| Update_priv | enum('N','Y') | NO | | N | | +| Delete_priv | enum('N','Y') | NO | | N | | +| Create_priv | enum('N','Y') | NO | | N | | +| Drop_priv | enum('N','Y') | NO | | N | | +| Process_priv | enum('N','Y') | NO | | N | | +| Grant_priv | enum('N','Y') | NO | | N | | +| References_priv | enum('N','Y') | NO | | N | | +| Alter_priv | enum('N','Y') | NO | | N | | +| Show_db_priv | enum('N','Y') | NO | | N | | +| Super_priv | enum('N','Y') | NO | | N | | +| Create_tmp_table_priv | enum('N','Y') | NO | | N | | +| Lock_tables_priv | enum('N','Y') | NO | | N | | +| Execute_priv | enum('N','Y') | NO | | N | | +| Create_view_priv | enum('N','Y') | NO | | N | | +| Show_view_priv | enum('N','Y') | NO | | N | | +| Create_routine_priv | enum('N','Y') | NO | | N | | +| Alter_routine_priv | enum('N','Y') | NO | | N | | +| Index_priv | enum('N','Y') | NO | | N | | +| Create_user_priv | enum('N','Y') | NO | | N | | +| Event_priv | enum('N','Y') | NO | | N | | +| Repl_slave_priv | enum('N','Y') | NO | | N | | +| Repl_client_priv | enum('N','Y') | NO | | N | | +| Trigger_priv | enum('N','Y') | NO | | N | | +| Create_role_priv | enum('N','Y') | NO | | N | | +| Drop_role_priv | enum('N','Y') | NO | | N | | +| Account_locked | enum('N','Y') | NO | | N | | +| Shutdown_priv | enum('N','Y') | NO | | N | | +| Reload_priv | enum('N','Y') | NO | | N | | +| FILE_priv | enum('N','Y') | NO | | N | | +| Config_priv | enum('N','Y') | NO | | N | | +| Create_Tablespace_Priv | enum('N','Y') | NO | | N | | +| Password_reuse_history | smallint unsigned | YES | | NULL | | +| Password_reuse_time | smallint unsigned | YES | | NULL | | +| User_attributes | json | YES | | NULL | | +| Token_issuer | varchar(255) | YES | | NULL | | +| Password_expired | enum('N','Y') | NO | | N | | +| Password_last_changed | timestamp | YES | | CURRENT_TIMESTAMP | | +| Password_lifetime | smallint unsigned | YES | | NULL | | ++------------------------+-------------------+------+------+-------------------+-------+ 44 rows in set (0.00 sec) ``` @@ -107,4 +107,4 @@ The `mysql.user` table contains several fields that can be categorized into thre -Although most of the fields in the TiDB `mysql.user` table also exist in the MySQL `mysql.user` table, the `Token_issuer` field is specific to TiDB. \ No newline at end of file +Although most of the fields in the TiDB `mysql.user` table also exist in the MySQL `mysql.user` table, the `Token_issuer` field is specific to TiDB. diff --git a/partitioned-table.md b/partitioned-table.md index 000345ac13161..c2caa931a860e 100644 --- a/partitioned-table.md +++ b/partitioned-table.md @@ -274,7 +274,7 @@ It creates this table: ``` CREATE TABLE `monthly_report_status` ( - `report_id` int(11) NOT NULL, + `report_id` int NOT NULL, `report_status` varchar(20) NOT NULL, `report_date` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin @@ -1133,7 +1133,7 @@ SHOW CREATE TABLE\G *************************** 1. row *************************** Table: example Create Table: CREATE TABLE `example` ( - `id` int(11) NOT NULL, + `id` int NOT NULL, `data` varchar(1024) DEFAULT NULL, PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin @@ -1737,10 +1737,10 @@ SHOW CREATE TABLE t1\G ``` Table: t1 Create Table: CREATE TABLE `t1` ( - `col1` int(11) NOT NULL, + `col1` int NOT NULL, `col2` date NOT NULL, - `col3` int(11) NOT NULL, - `col4` int(11) NOT NULL, + `col3` int NOT NULL, + `col4` int NOT NULL, UNIQUE KEY `uidx12` (`col1`,`col2`) /*T![global_index] GLOBAL */, UNIQUE KEY `uidx3` (`col3`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin diff --git a/performance-schema/performance-schema-session-connect-attrs.md b/performance-schema/performance-schema-session-connect-attrs.md index eafdc06e924c9..f5fda9c463842 100644 --- a/performance-schema/performance-schema-session-connect-attrs.md +++ b/performance-schema/performance-schema-session-connect-attrs.md @@ -28,14 +28,14 @@ DESCRIBE session_connect_attrs; ``` ``` -+------------------+---------------------+------+-----+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+------------------+---------------------+------+-----+---------+-------+ -| PROCESSLIST_ID | bigint(20) unsigned | NO | | NULL | | -| ATTR_NAME | varchar(32) | NO | | NULL | | -| ATTR_VALUE | varchar(1024) | YES | | NULL | | -| ORDINAL_POSITION | int(11) | YES | | NULL | | -+------------------+---------------------+------+-----+---------+-------+ ++------------------+-----------------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++------------------+-----------------+------+------+---------+-------+ +| PROCESSLIST_ID | bigint unsigned | NO | | NULL | | +| ATTR_NAME | varchar(32) | NO | | NULL | | +| ATTR_VALUE | varchar(1024) | YES | | NULL | | +| ORDINAL_POSITION | int | YES | | NULL | | ++------------------+-----------------+------+------+---------+-------+ ``` You can view the information on session attributes stored in the `SESSION_CONNECT_ATTRS` table as follows: diff --git a/placement-rules-in-sql.md b/placement-rules-in-sql.md index 7a3123c867837..70ecea485ada4 100644 --- a/placement-rules-in-sql.md +++ b/placement-rules-in-sql.md @@ -132,7 +132,7 @@ This section describes how to create, attach, view, modify, and delete placement *************************** 1. row *************************** Table: t1 Create Table: CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL + `a` int DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T![placement] PLACEMENT POLICY=`myplacementpolicy` */ 1 row in set (0.00 sec) ``` diff --git a/post-installation-check.md b/post-installation-check.md index e8e87b2ab0202..6ca5a17cf2d87 100644 --- a/post-installation-check.md +++ b/post-installation-check.md @@ -132,9 +132,9 @@ Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. ```sql CREATE TABLE `tab_tidb` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `name` varchar(20) NOT NULL DEFAULT '', - `age` int(11) NOT NULL DEFAULT 0, + `age` int NOT NULL DEFAULT 0, `version` varchar(20) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `idx_age` (`age`)); diff --git a/sql-plan-replayer.md b/sql-plan-replayer.md index 2dcbb8c4aec14..cb3aafc7fc760 100644 --- a/sql-plan-replayer.md +++ b/sql-plan-replayer.md @@ -167,12 +167,12 @@ After the cluster information is imported, the TiDB cluster is loaded with the r ```sql mysql> desc t; -+-------+---------+------+------+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+-------+---------+------+------+---------+-------+ -| a | int(11) | YES | | NULL | | -| b | int(11) | YES | | NULL | | -+-------+---------+------+------+---------+-------+ ++-------+------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-------+------+------+------+---------+-------+ +| a | int | YES | | NULL | | +| b | int | YES | | NULL | | ++-------+------+------+------+---------+-------+ 2 rows in set (0.01 sec) mysql> explain select * from t where a = 1 or b =1; @@ -302,4 +302,4 @@ After `PLAN REPLAYER CONTINUOUS CAPTURE` is enabled, TiDB asynchronously records ### View the capture results -The method of viewing the capture results of `PLAN REPLAYER CONTINUOUS CAPTURE` is the same as that of [Viewing the capture results of `PLAN REPLAYER CAPTURE`](#view-the-capture-results). \ No newline at end of file +The method of viewing the capture results of `PLAN REPLAYER CONTINUOUS CAPTURE` is the same as that of [Viewing the capture results of `PLAN REPLAYER CAPTURE`](#view-the-capture-results). diff --git a/sql-statements/sql-statement-alter-index.md b/sql-statements/sql-statement-alter-index.md index d060bc1a31a1c..eacc0226c0017 100644 --- a/sql-statements/sql-statement-alter-index.md +++ b/sql-statements/sql-statement-alter-index.md @@ -45,7 +45,7 @@ SHOW CREATE TABLE t1; | +-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | t1 | CREATE TABLE `t1` ( - `c1` int(11) DEFAULT NULL, + `c1` int DEFAULT NULL, UNIQUE KEY `c1` (`c1`) /*!80000 INVISIBLE */ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin | +-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/sql-statements/sql-statement-create-table.md b/sql-statements/sql-statement-create-table.md index 1cf408a2cd7b0..453c6fbbbbeeb 100644 --- a/sql-statements/sql-statement-create-table.md +++ b/sql-statements/sql-statement-create-table.md @@ -178,18 +178,18 @@ mysql> CREATE TABLE t1 (a int); Query OK, 0 rows affected (0.09 sec) mysql> DESC t1; -+-------+---------+------+------+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+-------+---------+------+------+---------+-------+ -| a | int(11) | YES | | NULL | | -+-------+---------+------+------+---------+-------+ ++-------+------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-------+------+------+------+---------+-------+ +| a | int | YES | | NULL | | ++-------+------+------+------+---------+-------+ 1 row in set (0.00 sec) mysql> SHOW CREATE TABLE t1\G *************************** 1. row *************************** Table: t1 Create Table: CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL + `a` int DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin 1 row in set (0.00 sec) @@ -232,7 +232,7 @@ mysql> DESC t1; +-------+--------------+------+------+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------+------+------+---------+----------------+ -| id | bigint(20) | NO | PRI | NULL | auto_increment | +| id | bigint | NO | PRI | NULL | auto_increment | | b | varchar(200) | NO | | NULL | | +-------+--------------+------+------+---------+----------------+ 2 rows in set (0.00 sec) diff --git a/sql-statements/sql-statement-modify-column.md b/sql-statements/sql-statement-modify-column.md index d42b5e62aedd6..545e81619b78d 100644 --- a/sql-statements/sql-statement-modify-column.md +++ b/sql-statements/sql-statement-modify-column.md @@ -95,8 +95,8 @@ SHOW CREATE TABLE t1\G *************************** 1. row *************************** Table: t1 Create Table: CREATE TABLE `t1` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `col1` bigint(20) DEFAULT NULL, + `id` int NOT NULL AUTO_INCREMENT, + `col1` bigint DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=30001 1 row in set (0.00 sec) @@ -145,7 +145,7 @@ SHOW CREATE TABLE t1\G *************************** 1. row *************************** Table: t1 CREATE TABLE `t1` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `col1` varchar(5) DEFAULT NULL, PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=30001 @@ -179,7 +179,7 @@ CREATE TABLE `t1` ( ```sql CREATE TABLE t (a int primary key); - ALTER TABLE t MODIFY COLUMN a INT(10) UNSIGNED; + ALTER TABLE t MODIFY COLUMN a int UNSIGNED; ERROR 8200 (HY000): Unsupported modify column: column has primary key flag ``` diff --git a/sql-statements/sql-statement-rename-index.md b/sql-statements/sql-statement-rename-index.md index 9c27c09400131..4431ec0c41283 100644 --- a/sql-statements/sql-statement-rename-index.md +++ b/sql-statements/sql-statement-rename-index.md @@ -28,8 +28,8 @@ mysql> SHOW CREATE TABLE t1\G *************************** 1. row *************************** Table: t1 Create Table: CREATE TABLE `t1` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `c1` int(11) NOT NULL, + `id` int NOT NULL AUTO_INCREMENT, + `c1` int NOT NULL, PRIMARY KEY (`id`), KEY `col1` (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin @@ -42,8 +42,8 @@ mysql> SHOW CREATE TABLE t1\G *************************** 1. row *************************** Table: t1 Create Table: CREATE TABLE `t1` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `c1` int(11) NOT NULL, + `id` int NOT NULL AUTO_INCREMENT, + `c1` int NOT NULL, PRIMARY KEY (`id`), KEY `c1` (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin diff --git a/sql-statements/sql-statement-show-columns-from.md b/sql-statements/sql-statement-show-columns-from.md index 41de5fb623561..e32cedffa3be9 100644 --- a/sql-statements/sql-statement-show-columns-from.md +++ b/sql-statements/sql-statement-show-columns-from.md @@ -35,51 +35,51 @@ mysql> CREATE VIEW v1 AS SELECT 1; Query OK, 0 rows affected (0.11 sec) mysql> SHOW COLUMNS FROM v1; -+-------+-----------+------+------+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+-------+-----------+------+------+---------+-------+ -| 1 | bigint(1) | YES | | NULL | | -+-------+-----------+------+------+---------+-------+ ++-------+--------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-------+--------+------+------+---------+-------+ +| 1 | bigint | YES | | NULL | | ++-------+--------+------+------+---------+-------+ 1 row in set (0.00 sec) mysql> DESC v1; -+-------+-----------+------+------+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+-------+-----------+------+------+---------+-------+ -| 1 | bigint(1) | YES | | NULL | | -+-------+-----------+------+------+---------+-------+ ++-------+--------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-------+--------+------+------+---------+-------+ +| 1 | bigint | YES | | NULL | | ++-------+--------+------+------+---------+-------+ 1 row in set (0.00 sec) mysql> DESCRIBE v1; -+-------+-----------+------+------+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+-------+-----------+------+------+---------+-------+ -| 1 | bigint(1) | YES | | NULL | | ++-------+--------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-------+--------+------+------+---------+-------+ +| 1 | bigint | YES | | NULL | | +-------+-----------+------+------+---------+-------+ 1 row in set (0.00 sec) mysql> EXPLAIN v1; -+-------+-----------+------+------+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+-------+-----------+------+------+---------+-------+ -| 1 | bigint(1) | YES | | NULL | | -+-------+-----------+------+------+---------+-------+ ++-------+--------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-------+--------+------+------+---------+-------+ +| 1 | bigint | YES | | NULL | | ++-------+--------+------+------+---------+-------+ 1 row in set (0.00 sec) mysql> SHOW FIELDS FROM v1; -+-------+-----------+------+------+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+-------+-----------+------+------+---------+-------+ -| 1 | bigint(1) | YES | | NULL | | -+-------+-----------+------+------+---------+-------+ ++-------+--------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-------+--------+------+------+---------+-------+ +| 1 | bigint | YES | | NULL | | ++-------+--------+------+------+---------+-------+ 1 row in set (0.00 sec) mysql> SHOW FULL COLUMNS FROM v1; -+-------+-----------+-----------+------+------+---------+-------+---------------------------------+---------+ -| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment | -+-------+-----------+-----------+------+------+---------+-------+---------------------------------+---------+ -| 1 | bigint(1) | NULL | YES | | NULL | | select,insert,update,references | | -+-------+-----------+-----------+------+------+---------+-------+---------------------------------+---------+ ++-------+--------+-----------+------+------+---------+-------+---------------------------------+---------+ +| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment | ++-------+--------+-----------+------+------+---------+-------+---------------------------------+---------+ +| 1 | bigint | NULL | YES | | NULL | | select,insert,update,references | | ++-------+--------+-----------+------+------+---------+-------+---------------------------------+---------+ 1 row in set (0.00 sec) mysql> SHOW FULL COLUMNS FROM mysql.user; diff --git a/sql-statements/sql-statement-show-create-table.md b/sql-statements/sql-statement-show-create-table.md index 418eb63ba7321..0999ca209366b 100644 --- a/sql-statements/sql-statement-show-create-table.md +++ b/sql-statements/sql-statement-show-create-table.md @@ -25,7 +25,7 @@ mysql> SHOW CREATE TABLE t1\G *************************** 1. row *************************** Table: t1 Create Table: CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL + `a` int DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin 1 row in set (0.00 sec) ``` diff --git a/sql-statements/sql-statement-show-placement-for.md b/sql-statements/sql-statement-show-placement-for.md index d6dd85cc921ce..99b49e33ef7b8 100644 --- a/sql-statements/sql-statement-show-placement-for.md +++ b/sql-statements/sql-statement-show-placement-for.md @@ -66,7 +66,7 @@ Query OK, 0 rows affected (0.01 sec) ***************************[ 1. row ]*************************** Table | t1 Create Table | CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL + `a` int DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T![placement] PLACEMENT POLICY=`p1` */ 1 row in set (0.00 sec) diff --git a/system-variables.md b/system-variables.md index b020683f80ceb..7681f73cb8298 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1152,7 +1152,7 @@ mysql> SHOW CREATE TABLE t; | Table | Create Table | +-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | t | CREATE TABLE `t` ( - `a` int(11) DEFAULT NULL, + `a` int DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` json DEFAULT NULL, `d` blob DEFAULT NULL, diff --git a/ticdc/integrate-confluent-using-ticdc.md b/ticdc/integrate-confluent-using-ticdc.md index 1cfe340f376bb..aa6de870b107f 100644 --- a/ticdc/integrate-confluent-using-ticdc.md +++ b/ticdc/integrate-confluent-using-ticdc.md @@ -199,8 +199,8 @@ The structure of the `ITEM` table is as follows: ``` CREATE TABLE `item` ( - `i_id` int(11) NOT NULL, - `i_im_id` int(11) DEFAULT NULL, + `i_id` int NOT NULL, + `i_im_id` int DEFAULT NULL, `i_name` varchar(24) DEFAULT NULL, `i_price` decimal(5,2) DEFAULT NULL, `i_data` varchar(50) DEFAULT NULL, diff --git a/ticdc/ticdc-faq.md b/ticdc/ticdc-faq.md index 0e4b78e5ec58f..b227fca2dda80 100644 --- a/ticdc/ticdc-faq.md +++ b/ticdc/ticdc-faq.md @@ -232,7 +232,7 @@ mysql root@127.0.0.1:test> show create table test; | Table | Create Table | +-------+----------------------------------------------------------------------------------+ | test | CREATE TABLE `test` ( | -| | `id` int(11) NOT NULL, | +| | `id` int NOT NULL, | | | `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | | | PRIMARY KEY (`id`) | | | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | diff --git a/tidb-lightning/tidb-lightning-error-resolution.md b/tidb-lightning/tidb-lightning-error-resolution.md index 4d465988a77ca..5aea40dbac6f2 100644 --- a/tidb-lightning/tidb-lightning-error-resolution.md +++ b/tidb-lightning/tidb-lightning-error-resolution.md @@ -101,7 +101,7 @@ CREATE TABLE conflict_error_v3 ( raw_value mediumblob NOT NULL, raw_handle mediumblob NOT NULL, raw_row mediumblob NOT NULL, - kv_type tinyint(1) NOT NULL, + kv_type tinyint NOT NULL, INDEX (task_id, table_name), INDEX (index_name), INDEX (table_name, index_name), @@ -282,7 +282,7 @@ In this example, a data source is prepared with some known errors. table_name: `example`.`t` path: example.t.1.sql offset: 253 - error: failed to cast value as tinyint(4) for column `a` (#1): [types:1690]constant 600 overflows tinyint + error: failed to cast value as tinyint for column `a` (#1): [types:1690]constant 600 overflows tinyint row_data: (600,'six hundred') ``` diff --git a/tidb-lightning/tidb-lightning-physical-import-mode-usage.md b/tidb-lightning/tidb-lightning-physical-import-mode-usage.md index 4e6fcbc7dc784..6caf6e4357817 100644 --- a/tidb-lightning/tidb-lightning-physical-import-mode-usage.md +++ b/tidb-lightning/tidb-lightning-physical-import-mode-usage.md @@ -151,14 +151,14 @@ Suppose an `order_line` table has the following schema: ```sql CREATE TABLE IF NOT EXISTS `order_line` ( - `ol_o_id` int(11) NOT NULL, - `ol_d_id` int(11) NOT NULL, - `ol_w_id` int(11) NOT NULL, - `ol_number` int(11) NOT NULL, - `ol_i_id` int(11) NOT NULL, - `ol_supply_w_id` int(11) DEFAULT NULL, + `ol_o_id` int NOT NULL, + `ol_d_id` int NOT NULL, + `ol_w_id` int NOT NULL, + `ol_number` int NOT NULL, + `ol_i_id` int NOT NULL, + `ol_supply_w_id` int DEFAULT NULL, `ol_delivery_d` datetime DEFAULT NULL, - `ol_quantity` int(11) DEFAULT NULL, + `ol_quantity` int DEFAULT NULL, `ol_amount` decimal(6,2) DEFAULT NULL, `ol_dist_info` char(24) DEFAULT NULL, PRIMARY KEY (`ol_w_id`,`ol_d_id`,`ol_o_id`,`ol_number`) diff --git a/tiflash/use-tiflash-mpp-mode.md b/tiflash/use-tiflash-mpp-mode.md index 7f09ca3be0807..98dbe609e349b 100644 --- a/tiflash/use-tiflash-mpp-mode.md +++ b/tiflash/use-tiflash-mpp-mode.md @@ -130,7 +130,7 @@ mysql> DROP TABLE if exists test.employees; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> CREATE TABLE test.employees -(id int(11) NOT NULL, +(id int NOT NULL, fname varchar(30) DEFAULT NULL, lname varchar(30) DEFAULT NULL, hired date NOT NULL DEFAULT '1970-01-01',