Skip to content

Commit

Permalink
doc: transactional load data stmt (#15694)
Browse files Browse the repository at this point in the history
  • Loading branch information
Oreoxmt authored Jan 10, 2024
1 parent aac7c71 commit 955082e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions sql-statements/sql-statement-load-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,12 @@ The syntax of the `LOAD DATA` statement is compatible with that of MySQL, except
> - For versions from TiDB v4.0.0 to v6.6.0, TiDB commits all rows in one transaction by default. But if you need the `LOAD DATA` statement to commit every fixed number of rows, you can set [`tidb_dml_batch_size`](/system-variables.md#tidb_dml_batch_size) to the desired number of rows.
> - Starting from TiDB v7.0.0, `tidb_dml_batch_size` no longer takes effect on `LOAD DATA`, and TiDB commits all rows in one transaction.
> - After upgrading from TiDB v4.0.0 or earlier versions, `ERROR 8004 (HY000) at line 1: Transaction is too large, size: 100000058` might occur. The recommended way to resolve this error is to increase the [`txn-total-size-limit`](/tidb-configuration-file.md#txn-total-size-limit) value in your `tidb.toml` file.
> - No matter how many rows are committed in a transaction, `LOAD DATA` is not rolled back by the [`ROLLBACK`](/sql-statements/sql-statement-rollback.md) statement in an explicit transaction.
> - The `LOAD DATA` statement is always executed in optimistic transaction mode, regardless of the TiDB transaction mode configuration.
> - For versions earlier than TiDB v7.6.0, no matter how many rows are committed in a transaction, `LOAD DATA` is not rolled back by the [`ROLLBACK`](/sql-statements/sql-statement-rollback.md) statement in an explicit transaction.
> - For versions earlier than TiDB v7.6.0, the `LOAD DATA` statement is always executed in optimistic transaction mode, regardless of the TiDB transaction mode configuration.
> - Starting from v7.6.0, TiDB processes `LOAD DATA` in transactions in the same way as other DML statements:
> - The `LOAD DATA` statement does not commit the current transaction or start a new transaction.
> - The `LOAD DATA` statement is affected by the TiDB transaction mode setting (optimistic or pessimistic transaction).
> - The `LOAD DATA` statement in a transaction can be rolled back by the [`ROLLBACK`](/sql-statements/sql-statement-rollback.md) statement in the transaction.
</CustomContent>

Expand All @@ -170,8 +174,12 @@ The syntax of the `LOAD DATA` statement is compatible with that of MySQL, except
> - For versions from TiDB v4.0.0 to v6.6.0, TiDB commits all rows in one transaction by default. But if you need the `LOAD DATA` statement to commit every fixed number of rows, you can set [`tidb_dml_batch_size`](/system-variables.md#tidb_dml_batch_size) to the desired number of rows.
> - Starting from v7.0.0, `tidb_dml_batch_size` no longer takes effect on `LOAD DATA`, and TiDB commits all rows in one transaction.
> - After upgrading from TiDB v4.0.0 or earlier versions, `ERROR 8004 (HY000) at line 1: Transaction is too large, size: 100000058` might occur. To resolve this error, you can contact [TiDB Cloud Support](https://docs.pingcap.com/tidbcloud/tidb-cloud-support) to increase the [`txn-total-size-limit`](https://docs.pingcap.com/tidb/stable/tidb-configuration-file#txn-total-size-limit) value.
> - No matter how many rows are committed in a transaction, `LOAD DATA` is not rolled back by the [`ROLLBACK`](/sql-statements/sql-statement-rollback.md) statement in an explicit transaction.
> - The `LOAD DATA` statement is always executed in optimistic transaction mode, regardless of the TiDB transaction mode configuration.
> - For versions earlier than TiDB v7.6.0, no matter how many rows are committed in a transaction, `LOAD DATA` is not rolled back by the [`ROLLBACK`](/sql-statements/sql-statement-rollback.md) statement in an explicit transaction.
> - For versions earlier than TiDB v7.6.0, the `LOAD DATA` statement is always executed in optimistic transaction mode, regardless of the TiDB transaction mode configuration.
> - Starting from v7.6.0, TiDB processes `LOAD DATA` in transactions in the same way as other DML statements:
> - The `LOAD DATA` statement does not commit the current transaction or start a new transaction.
> - The `LOAD DATA` statement is affected by the TiDB transaction mode setting (optimistic or pessimistic transaction).
> - The `LOAD DATA` statement in a transaction can be rolled back by the [`ROLLBACK`](/sql-statements/sql-statement-rollback.md) statement in the transaction.
</CustomContent>

Expand Down

0 comments on commit 955082e

Please sign in to comment.