diff --git a/accelerated-table-creation.md b/accelerated-table-creation.md index ec3ee720f825c..891fcfbe97c02 100644 --- a/accelerated-table-creation.md +++ b/accelerated-table-creation.md @@ -12,13 +12,9 @@ When accelerated table creation is enabled via [`tidb_enable_fast_create_table`] The merged batch table creation statements are executed within the same transaction, so if one statement of them fails, all of them will fail. -> **Warning:** -> -> This feature is currently an experimental feature and it is not recommended to use in a production environment. This feature might change or be removed without prior notice. If you find a bug, please give feedback by raising an [issue](https://github.com/pingcap/tidb/issues) on GitHub. - ## Compatibility with TiDB tools -- [TiCDC](https://docs.pingcap.com/tidb/stable/ticdc-overview) does not support replicating the tables that are created by `tidb_enable_fast_create_table`. +- Before TiDB v8.3.0, [TiCDC](https://docs.pingcap.com/tidb/stable/ticdc-overview) does not support replicating the tables that are created by `tidb_enable_fast_create_table`. Starting from v8.3.0, TiCDC can properly replicate these tables. ## Limitation @@ -28,6 +24,8 @@ You can now use performance optimization for table creation only in the [`CREATE You can enable or disable performance optimization for creating tables by specifying the value of the system variable [`tidb_enable_fast_create_table`](/system-variables.md#tidb_enable_fast_create_table-new-in-v800). +Starting from TiDB v8.5.0, the accelerated table creation feature is enabled by default for newly created clusters, with `tidb_enable_fast_create_table` set to `ON`. For clusters upgraded from v8.4.0 or earlier versions, the default value of `tidb_enable_fast_create_table` remains unchanged. + To enable performance optimization for creating tables, set the value of this variable to `ON`: ```sql 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/br/br-pitr-manual.md b/br/br-pitr-manual.md index e1019a17168f6..22711ce5dffdd 100644 --- a/br/br-pitr-manual.md +++ b/br/br-pitr-manual.md @@ -356,7 +356,7 @@ Usage example: ```shell tiup br log truncate --until='2022-07-26 21:20:00+0800' \ -–-storage='s3://backup-101/logbackup?access-key=${access-key}&secret-access-key=${secret-access-key}"' +--storage='s3://backup-101/logbackup?access-key=${access-key}&secret-access-key=${secret-access-key}' ``` Expected output: @@ -396,7 +396,7 @@ The `--storage` parameter is used to specify the backup storage address. Current Usage example: ```shell -tiup br log metadata –-storage='s3://backup-101/logbackup?access-key=${access-key}&secret-access-key=${secret-access-key}"' +tiup br log metadata --storage='s3://backup-101/logbackup?access-key=${access-key}&secret-access-key=${secret-access-key}' ``` Expected output: @@ -450,8 +450,8 @@ Usage example: ```shell tiup br restore point --pd="${PD_IP}:2379" ---storage='s3://backup-101/logbackup?access-key=${access-key}&secret-access-key=${secret-access-key}"' ---full-backup-storage='s3://backup-101/snapshot-202205120000?access-key=${access-key}&secret-access-key=${secret-access-key}"' +--storage='s3://backup-101/logbackup?access-key=${access-key}&secret-access-key=${secret-access-key}' +--full-backup-storage='s3://backup-101/snapshot-202205120000?access-key=${access-key}&secret-access-key=${secret-access-key}' Full Restore <--------------------------------------------------------------------------------------------------------------------------------------------------------> 100.00% *** ***["Full Restore success summary"] ****** [total-take=3.112928252s] [restore-data-size(after-compressed)=5.056kB] [Size=5056] [BackupTS=434693927394607136] [total-kv=4] [total-kv-size=290B] [average-speed=93.16B/s] @@ -474,8 +474,8 @@ The following is an example: ```shell tiup br restore point --pd="${PD_IP}:2379" ---storage='s3://backup-101/logbackup?access-key=${ACCESS-KEY}&secret-access-key=${SECRET-ACCESS-KEY}"' ---full-backup-storage='s3://backup-101/snapshot-202205120000?access-key=${ACCESS-KEY}&secret-access-key=${SECRET-ACCESS-KEY}"' +--storage='s3://backup-101/logbackup?access-key=${ACCESS-KEY}&secret-access-key=${SECRET-ACCESS-KEY}' +--full-backup-storage='s3://backup-101/snapshot-202205120000?access-key=${ACCESS-KEY}&secret-access-key=${SECRET-ACCESS-KEY}' --crypter.method aes128-ctr --crypter.key 0123456789abcdef0123456789abcdef --log.crypter.method aes128-ctr @@ -486,10 +486,10 @@ If a log backup is encrypted using a master key, you can decrypt and restore the ```shell tiup br restore point --pd="${PD_IP}:2379" ---storage='s3://backup-101/logbackup?access-key=${ACCESS-KEY}&secret-access-key=${SECRET-ACCESS-KEY}"' ---full-backup-storage='s3://backup-101/snapshot-202205120000?access-key=${ACCESS-KEY}&secret-access-key=${SECRET-ACCESS-KEY}"' +--storage='s3://backup-101/logbackup?access-key=${ACCESS-KEY}&secret-access-key=${SECRET-ACCESS-KEY}' +--full-backup-storage='s3://backup-101/snapshot-202205120000?access-key=${ACCESS-KEY}&secret-access-key=${SECRET-ACCESS-KEY}' --crypter.method aes128-ctr --crypter.key 0123456789abcdef0123456789abcdef --master-key-crypter-method aes128-ctr --master-key "local:///path/to/master.key" -``` \ No newline at end of file +``` 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 b842738b93991..2df51c74725c9 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 10543e431ac38..7e6cb15afb86c 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 6f185651b54d3..aea4246cc9cc8 100644 --- a/foreign-key.md +++ b/foreign-key.md @@ -151,8 +151,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 @@ -190,8 +190,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 @@ -292,8 +292,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 @@ -344,8 +344,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 437dc956084af..4193715ad4ffb 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 @@ -1752,10 +1752,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/pd-control.md b/pd-control.md index 6bd19059fbaaa..74410b0b3a449 100644 --- a/pd-control.md +++ b/pd-control.md @@ -349,6 +349,123 @@ Usage: config set flow-round-by-digit 4 ``` +#### `config [show | set service-middleware