Skip to content

Commit 22341b8

Browse files
authored
Bulk update integer display width (#19393)
1 parent ab637ac commit 22341b8

46 files changed

Lines changed: 255 additions & 255 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

auto-increment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ SHOW CREATE TABLE t;
323323
| Table | Create Table |
324324
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
325325
| t | CREATE TABLE `t` (
326-
`a` int(11) NOT NULL AUTO_INCREMENT,
326+
`a` int NOT NULL AUTO_INCREMENT,
327327
PRIMARY KEY (`a`) /*T![clustered_index] CLUSTERED */
328328
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=101 /*T![auto_id_cache] AUTO_ID_CACHE=100 */ |
329329
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

auto-random.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ tidb> SHOW CREATE TABLE t;
8282
| Table | Create Table |
8383
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
8484
| t | CREATE TABLE `t` (
85-
`a` bigint(20) NOT NULL /*T![auto_rand] AUTO_RANDOM(5) */,
85+
`a` bigint NOT NULL /*T![auto_rand] AUTO_RANDOM(5) */,
8686
`b` varchar(255) DEFAULT NULL,
8787
PRIMARY KEY (`a`) /*T![clustered_index] CLUSTERED */
8888
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T! PRE_SPLIT_REGIONS=2 */ |

basic-sql-operations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ For example, to create a table named `person` which includes fields such as numb
100100

101101
```sql
102102
CREATE TABLE person (
103-
id INT(11),
103+
id INT,
104104
name VARCHAR(255),
105105
birthday DATE
106106
);

cached-tables.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ SHOW CREATE TABLE users;
6464
| Table | Create Table |
6565
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
6666
| users | CREATE TABLE `users` (
67-
`id` bigint(20) NOT NULL,
67+
`id` bigint NOT NULL,
6868
`name` varchar(100) DEFAULT NULL,
6969
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
7070
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /* CACHED ON */ |
@@ -170,10 +170,10 @@ SHOW CREATE TABLE mysql.table_cache_meta\G
170170
*************************** 1. row ***************************
171171
Table: table_cache_meta
172172
Create Table: CREATE TABLE `table_cache_meta` (
173-
`tid` bigint(11) NOT NULL DEFAULT '0',
173+
`tid` bigint NOT NULL DEFAULT '0',
174174
`lock_type` enum('NONE','READ','INTEND','WRITE') NOT NULL DEFAULT 'NONE',
175-
`lease` bigint(20) NOT NULL DEFAULT '0',
176-
`oldReadLease` bigint(20) NOT NULL DEFAULT '0',
175+
`lease` bigint NOT NULL DEFAULT '0',
176+
`oldReadLease` bigint NOT NULL DEFAULT '0',
177177
PRIMARY KEY (`tid`) /*T![clustered_index] CLUSTERED */
178178
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
179179
1 row in set (0.00 sec)

clustered-indexes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ mysql> SHOW CREATE TABLE t;
106106
| Table | Create Table |
107107
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
108108
| t | CREATE TABLE `t` (
109-
`a` bigint(20) NOT NULL,
109+
`a` bigint NOT NULL,
110110
`b` varchar(255) DEFAULT NULL,
111111
PRIMARY KEY (`a`) /*T![clustered_index] CLUSTERED */
112112
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |

constraints.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ SHOW CREATE TABLE t;
101101
| Table | Create Table |
102102
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
103103
| t | CREATE TABLE `t` (
104-
`a` int(11) DEFAULT NULL,
105-
`b` int(11) DEFAULT NULL,
106-
`c` int(11) DEFAULT NULL,
104+
`a` int DEFAULT NULL,
105+
`b` int DEFAULT NULL,
106+
`c` int DEFAULT NULL,
107107
CONSTRAINT `c1` CHECK ((`b` > `c`)),
108108
CONSTRAINT `t_chk_1` CHECK ((`a` > 10)) /*!80016 NOT ENFORCED */,
109109
CONSTRAINT `t_chk_2` CHECK ((1 < `c`))

cost-model.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ mysql> SHOW CREATE TABLE t;
1919
| Table | Create Table |
2020
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2121
| t | CREATE TABLE `t` (
22-
`a` int(11) DEFAULT NULL,
23-
`b` int(11) DEFAULT NULL,
24-
`c` int(11) DEFAULT NULL,
22+
`a` int DEFAULT NULL,
23+
`b` int DEFAULT NULL,
24+
`c` int DEFAULT NULL,
2525
KEY `b` (`b`),
2626
KEY `c` (`c`)
2727
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |

develop/dev-guide-bookshop-schema-design.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ This table stores the basic information of books.
166166

167167
| Field name | Type | Description |
168168
|--------------|---------------|------------------------------------------------------------------|
169-
| id | bigint(20) | Unique ID of a book |
169+
| id | bigint | Unique ID of a book |
170170
| title | varchar(100) | Title of a book |
171171
| type | enum | Type of a book (for example, magazine, animation, or teaching aids) |
172-
| stock | bigint(20) | Stock |
172+
| stock | bigint | Stock |
173173
| price | decimal(15,2) | Price |
174174
| published_at | datetime | Date of publish |
175175

@@ -179,19 +179,19 @@ This table stores basic information of authors.
179179

180180
| Field name | Type | Description |
181181
|------------|--------------|-------------------------------------------------------|
182-
| id | bigint(20) | Unique ID of an author |
182+
| id | bigint | Unique ID of an author |
183183
| name | varchar(100) | Name of an author |
184-
| gender | tinyint(1) | Biological gender (0: female, 1: male, NULL: unknown) |
185-
| birth_year | smallint(6) | Year of birth |
186-
| death_year | smallint(6) | Year of death |
184+
| gender | tinyint | Biological gender (0: female, 1: male, NULL: unknown) |
185+
| birth_year | smallint | Year of birth |
186+
| death_year | smallint | Year of death |
187187

188188
### `users` table
189189

190190
This table stores information of Bookshop users.
191191

192192
| Field name | Type | Description |
193193
|------------|---------------|-----------------------|
194-
| id | bigint(20) | Unique ID of a user |
194+
| id | bigint | Unique ID of a user |
195195
| balance | decimal(15,2) | Balance |
196196
| nickname | varchar(100) | Nickname |
197197

@@ -212,19 +212,19 @@ An author may write multiple books, and a book may involve more than one author.
212212

213213
| Field name | Type | Description |
214214
|------------|------------|--------------------------------------------------------------|
215-
| book_id | bigint(20) | Unique ID of a book (linked to [books](#books-table)) |
216-
| author_id | bigint(20) | Unique ID of an author(Link to [authors](#authors-table)|
215+
| book_id | bigint | Unique ID of a book (linked to [books](#books-table)) |
216+
| author_id | bigint | Unique ID of an author(Link to [authors](#authors-table)|
217217

218218
### `orders` table
219219

220220
This table stores user purchase information.
221221

222222
| Field name | Type | Description |
223223
|------------|------------|----------------------------------------------------------------|
224-
| id | bigint(20) | Unique ID of an order |
225-
| book_id | bigint(20) | Unique ID of a book (linked to [books](#books-table)) |
226-
| user_id | bigint(20) | User unique identifier (associated with [users](#users-table)) |
227-
| quantity | tinyint(4) | Purchase quantity |
224+
| id | bigint | Unique ID of an order |
225+
| book_id | bigint | Unique ID of a book (linked to [books](#books-table)) |
226+
| user_id | bigint | User unique identifier (associated with [users](#users-table)) |
227+
| quantity | tinyint | Purchase quantity |
228228
| ordered_at | datetime | Purchase time |
229229

230230
## Database initialization script `dbinit.sql`
@@ -236,29 +236,29 @@ CREATE DATABASE IF NOT EXISTS `bookshop`;
236236

237237
DROP TABLE IF EXISTS `bookshop`.`books`;
238238
CREATE TABLE `bookshop`.`books` (
239-
`id` bigint(20) AUTO_RANDOM NOT NULL,
239+
`id` bigint AUTO_RANDOM NOT NULL,
240240
`title` varchar(100) NOT NULL,
241241
`type` enum('Magazine', 'Novel', 'Life', 'Arts', 'Comics', 'Education & Reference', 'Humanities & Social Sciences', 'Science & Technology', 'Kids', 'Sports') NOT NULL,
242242
`published_at` datetime NOT NULL,
243-
`stock` int(11) DEFAULT '0',
243+
`stock` int DEFAULT '0',
244244
`price` decimal(15,2) DEFAULT '0.0',
245245
PRIMARY KEY (`id`) CLUSTERED
246246
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
247247

248248
DROP TABLE IF EXISTS `bookshop`.`authors`;
249249
CREATE TABLE `bookshop`.`authors` (
250-
`id` bigint(20) AUTO_RANDOM NOT NULL,
250+
`id` bigint AUTO_RANDOM NOT NULL,
251251
`name` varchar(100) NOT NULL,
252-
`gender` tinyint(1) DEFAULT NULL,
253-
`birth_year` smallint(6) DEFAULT NULL,
254-
`death_year` smallint(6) DEFAULT NULL,
252+
`gender` tinyint DEFAULT NULL,
253+
`birth_year` smallint DEFAULT NULL,
254+
`death_year` smallint DEFAULT NULL,
255255
PRIMARY KEY (`id`) CLUSTERED
256256
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
257257

258258
DROP TABLE IF EXISTS `bookshop`.`book_authors`;
259259
CREATE TABLE `bookshop`.`book_authors` (
260-
`book_id` bigint(20) NOT NULL,
261-
`author_id` bigint(20) NOT NULL,
260+
`book_id` bigint NOT NULL,
261+
`author_id` bigint NOT NULL,
262262
PRIMARY KEY (`book_id`,`author_id`) CLUSTERED
263263
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
264264

@@ -283,10 +283,10 @@ CREATE TABLE `bookshop`.`users` (
283283

284284
DROP TABLE IF EXISTS `bookshop`.`orders`;
285285
CREATE TABLE `bookshop`.`orders` (
286-
`id` bigint(20) AUTO_RANDOM NOT NULL,
287-
`book_id` bigint(20) NOT NULL,
288-
`user_id` bigint(20) NOT NULL,
289-
`quality` tinyint(4) NOT NULL,
286+
`id` bigint AUTO_RANDOM NOT NULL,
287+
`book_id` bigint NOT NULL,
288+
`user_id` bigint NOT NULL,
289+
`quality` tinyint NOT NULL,
290290
`ordered_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
291291
PRIMARY KEY (`id`) CLUSTERED,
292292
KEY `orders_book_id_idx` (`book_id`)

develop/dev-guide-create-secondary-indexes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,22 @@ The fields in the `books` table are as follows:
7373

7474
| Field name | Type | Field description |
7575
|--------------|---------------|------------------------------------------------------------------|
76-
| id | bigint(20) | Unique ID of the book |
76+
| id | bigint | Unique ID of the book |
7777
| title | varchar(100) | Book title |
7878
| type | enum | Types of books (for example, magazines, animations, and teaching aids) |
79-
| stock | bigint(20) | Stock |
79+
| stock | bigint | Stock |
8080
| price | decimal(15,2) | Price |
8181
| published_at | datetime | Date of publishing |
8282

8383
The `books` table is created using the following SQL statement:
8484

8585
```sql
8686
CREATE TABLE `bookshop`.`books` (
87-
`id` bigint(20) AUTO_RANDOM NOT NULL,
87+
`id` bigint AUTO_RANDOM NOT NULL,
8888
`title` varchar(100) NOT NULL,
8989
`type` enum('Magazine', 'Novel', 'Life', 'Arts', 'Comics', 'Education & Reference', 'Humanities & Social Sciences', 'Science & Technology', 'Kids', 'Sports') NOT NULL,
9090
`published_at` datetime NOT NULL,
91-
`stock` int(11) DEFAULT '0',
91+
`stock` int DEFAULT '0',
9292
`price` decimal(15,2) DEFAULT '0.0',
9393
PRIMARY KEY (`id`) CLUSTERED
9494
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

develop/dev-guide-index-best-practice.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ This section takes the `books` table in the [bookshop](/develop/dev-guide-booksh
1515

1616
```sql
1717
CREATE TABLE `books` (
18-
`id` bigint(20) AUTO_RANDOM NOT NULL,
18+
`id` bigint AUTO_RANDOM NOT NULL,
1919
`title` varchar(100) NOT NULL,
2020
`type` enum('Magazine', 'Novel', 'Life', 'Arts', 'Comics', 'Education & Reference', 'Humanities & Social Sciences', 'Science & Technology', 'Kids', 'Sports') NOT NULL,
2121
`published_at` datetime NOT NULL,
22-
`stock` int(11) DEFAULT '0',
22+
`stock` int DEFAULT '0',
2323
`price` decimal(15,2) DEFAULT '0.0',
2424
PRIMARY KEY (`id`) CLUSTERED
2525
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

0 commit comments

Comments
 (0)