Skip to content

Commit

Permalink
*: remove unnecessary character from sql examples (pingcap#14301)
Browse files Browse the repository at this point in the history
  • Loading branch information
ran-huang authored Jul 31, 2023
1 parent 04c6733 commit 3409f26
Showing 8 changed files with 59 additions and 59 deletions.
8 changes: 4 additions & 4 deletions character-set-and-collation.md
Original file line number Diff line number Diff line change
@@ -147,8 +147,8 @@ The following demonstrates the default behavior when inserting a 4-byte emoji ch

```sql
CREATE TABLE utf8_test (
-> c char(1) NOT NULL
-> ) CHARACTER SET utf8;
c char(1) NOT NULL
) CHARACTER SET utf8;
```

```sql
@@ -157,8 +157,8 @@ Query OK, 0 rows affected (0.09 sec)

```sql
CREATE TABLE utf8m4_test (
-> c char(1) NOT NULL
-> ) CHARACTER SET utf8mb4;
c char(1) NOT NULL
) CHARACTER SET utf8mb4;
```

```sql
30 changes: 15 additions & 15 deletions partitioned-table.md
Original file line number Diff line number Diff line change
@@ -360,13 +360,13 @@ Unlike Range partitioning, List partitioning does not have a similar `MAXVALUE`

```sql
test> CREATE TABLE t (
-> a INT,
-> b INT
-> )
-> PARTITION BY LIST (a) (
-> PARTITION p0 VALUES IN (1, 2, 3),
-> PARTITION p1 VALUES IN (4, 5, 6)
-> );
a INT,
b INT
)
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (1, 2, 3),
PARTITION p1 VALUES IN (4, 5, 6)
);
Query OK, 0 rows affected (0.11 sec)

test> INSERT INTO t VALUES (7, 7);
@@ -1768,10 +1768,10 @@ In `static` mode, TiDB accesses each partition separately using multiple operato
```sql
mysql> create table t1(id int, age int, key(id)) partition by range(id) (
-> partition p0 values less than (100),
-> partition p1 values less than (200),
-> partition p2 values less than (300),
-> partition p3 values less than (400));
partition p0 values less than (100),
partition p1 values less than (200),
partition p2 values less than (300),
partition p3 values less than (400));
Query OK, 0 rows affected (0.01 sec)
mysql> explain select * from t1 where id < 150;
@@ -1821,10 +1821,10 @@ From the above query results, you can see that the `Union` operator in the execu
```sql
mysql> create table t1 (id int, age int, key(id)) partition by range(id)
-> (partition p0 values less than (100),
-> partition p1 values less than (200),
-> partition p2 values less than (300),
-> partition p3 values less than (400));
(partition p0 values less than (100),
partition p1 values less than (200),
partition p2 values less than (300),
partition p3 values less than (400));
Query OK, 0 rows affected (0,08 sec)
mysql> create table t2 (id int, code int);
16 changes: 8 additions & 8 deletions sql-statements/sql-statement-create-binding.md
Original file line number Diff line number Diff line change
@@ -38,11 +38,11 @@ The following example shows how to create a binding according to a SQL statement

```sql
mysql> CREATE TABLE t1 (
-> id INT NOT NULL PRIMARY KEY auto_increment,
-> b INT NOT NULL,
-> pad VARBINARY(255),
-> INDEX(b)
-> );
id INT NOT NULL PRIMARY KEY auto_increment,
b INT NOT NULL,
pad VARBINARY(255),
INDEX(b)
);
Query OK, 0 rows affected (0.07 sec)

mysql> INSERT INTO t1 SELECT NULL, FLOOR(RAND()*1000), RANDOM_BYTES(255) FROM dual;
@@ -95,9 +95,9 @@ mysql> EXPLAIN ANALYZE SELECT * FROM t1 WHERE b = 123;
3 rows in set (0.02 sec)

mysql> CREATE SESSION BINDING FOR
-> SELECT * FROM t1 WHERE b = 123
-> USING
-> SELECT * FROM t1 IGNORE INDEX (b) WHERE b = 123;
SELECT * FROM t1 WHERE b = 123
USING
SELECT * FROM t1 IGNORE INDEX (b) WHERE b = 123;
Query OK, 0 rows affected (0.00 sec)

mysql> EXPLAIN ANALYZE SELECT * FROM t1 WHERE b = 123;
6 changes: 3 additions & 3 deletions sql-statements/sql-statement-create-table.md
Original file line number Diff line number Diff line change
@@ -221,9 +221,9 @@ mysql> DROP TABLE IF EXISTS t1;
Query OK, 0 rows affected (0.22 sec)

mysql> CREATE TABLE IF NOT EXISTS t1 (
-> id BIGINT NOT NULL PRIMARY KEY auto_increment,
-> b VARCHAR(200) NOT NULL
-> );
id BIGINT NOT NULL PRIMARY KEY auto_increment,
b VARCHAR(200) NOT NULL
);
Query OK, 0 rows affected (0.08 sec)

mysql> DESC t1;
16 changes: 8 additions & 8 deletions sql-statements/sql-statement-drop-binding.md
Original file line number Diff line number Diff line change
@@ -34,11 +34,11 @@ The following example shows how to remove a binding according to a SQL statement

```sql
mysql> CREATE TABLE t1 (
-> id INT NOT NULL PRIMARY KEY auto_increment,
-> b INT NOT NULL,
-> pad VARBINARY(255),
-> INDEX(b)
-> );
id INT NOT NULL PRIMARY KEY auto_increment,
b INT NOT NULL,
pad VARBINARY(255),
INDEX(b)
);
Query OK, 0 rows affected (0.07 sec)

mysql> INSERT INTO t1 SELECT NULL, FLOOR(RAND()*1000), RANDOM_BYTES(255) FROM dual;
@@ -91,9 +91,9 @@ mysql> EXPLAIN ANALYZE SELECT * FROM t1 WHERE b = 123;
3 rows in set (0.02 sec)

mysql> CREATE SESSION BINDING FOR
-> SELECT * FROM t1 WHERE b = 123
-> USING
-> SELECT * FROM t1 IGNORE INDEX (b) WHERE b = 123;
SELECT * FROM t1 WHERE b = 123
USING
SELECT * FROM t1 IGNORE INDEX (b) WHERE b = 123;
Query OK, 0 rows affected (0.00 sec)

mysql> EXPLAIN ANALYZE SELECT * FROM t1 WHERE b = 123;
16 changes: 8 additions & 8 deletions sql-statements/sql-statement-show-bindings.md
Original file line number Diff line number Diff line change
@@ -54,11 +54,11 @@ This statement outputs the execution plan bindings at the GLOBAL or SESSION leve

```sql
mysql> CREATE TABLE t1 (
-> id INT NOT NULL PRIMARY KEY auto_increment,
-> b INT NOT NULL,
-> pad VARBINARY(255),
-> INDEX(b)
-> );
id INT NOT NULL PRIMARY KEY auto_increment,
b INT NOT NULL,
pad VARBINARY(255),
INDEX(b)
);
Query OK, 0 rows affected (0.07 sec)

mysql> INSERT INTO t1 SELECT NULL, FLOOR(RAND()*1000), RANDOM_BYTES(255) FROM dual;
@@ -111,9 +111,9 @@ mysql> EXPLAIN ANALYZE SELECT * FROM t1 WHERE b = 123;
3 rows in set (0.02 sec)

mysql> CREATE SESSION BINDING FOR
-> SELECT * FROM t1 WHERE b = 123
-> USING
-> SELECT * FROM t1 IGNORE INDEX (b) WHERE b = 123;
SELECT * FROM t1 WHERE b = 123
USING
SELECT * FROM t1 IGNORE INDEX (b) WHERE b = 123;
Query OK, 0 rows affected (0.00 sec)

mysql> EXPLAIN ANALYZE SELECT * FROM t1 WHERE b = 123;
14 changes: 7 additions & 7 deletions tidb-cloud/migrate-sql-shards.md
Original file line number Diff line number Diff line change
@@ -125,12 +125,12 @@ In this example, the column IDs of the upstream tables `sale_01` and `sale_02` a

```sql
mysql> CREATE TABLE `sales` (
-> `id` bigint(20) NOT NULL ,
-> `uid` varchar(40) NOT NULL,
-> `sale_num` bigint DEFAULT NULL,
-> INDEX (`id`),
-> UNIQUE KEY `ind_uid` (`uid`)
-> );
`id` bigint(20) NOT NULL ,
`uid` varchar(40) NOT NULL,
`sale_num` bigint DEFAULT NULL,
INDEX (`id`),
UNIQUE KEY `ind_uid` (`uid`)
);
Query OK, 0 rows affected (0.17 sec)
```

@@ -406,7 +406,7 @@ The TiDB Cloud console does not provide any feature about incremental data repli
host: "tidb.xxxxxxx.xxxxxxxxx.ap-northeast-1.prod.aws.tidbcloud.com"
port: 4000
user: "root"
password: "${password}" # If the password is not empty, it is recommended to use a dmctl-encrypted cipher.
password: "${password}" # If the password is not empty, it is recommended to use a dmctl-encrypted cipher.
## ******** Function Configuration **********
routes:
12 changes: 6 additions & 6 deletions transaction-overview.md
Original file line number Diff line number Diff line change
@@ -92,9 +92,9 @@ For example:

```sql
mysql> CREATE TABLE t1 (
-> id INT NOT NULL PRIMARY KEY auto_increment,
-> pad1 VARCHAR(100)
-> );
id INT NOT NULL PRIMARY KEY auto_increment,
pad1 VARCHAR(100)
);
Query OK, 0 rows affected (0.09 sec)

mysql> SELECT @@autocommit;
@@ -132,9 +132,9 @@ Autocommit will not apply if a transaction has been explicitly started. In the f

```sql
mysql> CREATE TABLE t2 (
-> id INT NOT NULL PRIMARY KEY auto_increment,
-> pad1 VARCHAR(100)
-> );
id INT NOT NULL PRIMARY KEY auto_increment,
pad1 VARCHAR(100)
);
Query OK, 0 rows affected (0.10 sec)

mysql> SELECT @@autocommit;

0 comments on commit 3409f26

Please sign in to comment.