- Docs Home
- About TiDB
- Quick Start
- Develop
- Overview
- Quick Start
- Build a TiDB Cluster in TiDB Cloud (Developer Tier)
- CRUD SQL in TiDB
- Build a Simple CRUD App with TiDB
- Example Applications
- Connect to TiDB
- Design Database Schema
- Write Data
- Read Data
- Transaction
- Optimize
- Troubleshoot
- Reference
- Cloud Native Development Environment
- Third-party Support
- Deploy
- Software and Hardware Requirements
- Environment Configuration Checklist
- Plan Cluster Topology
- Install and Start
- Verify Cluster Status
- Test Cluster Performance
- Migrate
- Overview
- Migration Tools
- Migration Scenarios
- Migrate from Aurora
- Migrate MySQL of Small Datasets
- Migrate MySQL of Large Datasets
- Migrate and Merge MySQL Shards of Small Datasets
- Migrate and Merge MySQL Shards of Large Datasets
- Migrate from CSV Files
- Migrate from SQL Files
- Migrate from One TiDB Cluster to Another TiDB Cluster
- Migrate from TiDB to MySQL-compatible Databases
- Advanced Migration
- Integrate
- Overview
- Integration Scenarios
- Maintain
- Monitor and Alert
- Troubleshoot
- TiDB Troubleshooting Map
- Identify Slow Queries
- Analyze Slow Queries
- SQL Diagnostics
- Identify Expensive Queries Using Top SQL
- Identify Expensive Queries Using Logs
- Statement Summary Tables
- Troubleshoot Hotspot Issues
- Troubleshoot Increased Read and Write Latency
- Save and Restore the On-Site Information of a Cluster
- Troubleshoot Cluster Setup
- Troubleshoot High Disk I/O Usage
- Troubleshoot Lock Conflicts
- Troubleshoot TiFlash
- Troubleshoot Write Conflicts in Optimistic Transactions
- Troubleshoot Inconsistency Between Data and Indexes
- Performance Tuning
- Tuning Guide
- Configuration Tuning
- System Tuning
- Software Tuning
- SQL Tuning
- Overview
- Understanding the Query Execution Plan
- SQL Optimization Process
- Overview
- Logic Optimization
- Physical Optimization
- Prepare Execution Plan Cache
- Control Execution Plans
- Tutorials
- TiDB Tools
- Overview
- Use Cases
- Download
- TiUP
- Documentation Map
- Overview
- Terminology and Concepts
- Manage TiUP Components
- FAQ
- Troubleshooting Guide
- Command Reference
- Overview
- TiUP Commands
- TiUP Cluster Commands
- Overview
- tiup cluster audit
- tiup cluster check
- tiup cluster clean
- tiup cluster deploy
- tiup cluster destroy
- tiup cluster disable
- tiup cluster display
- tiup cluster edit-config
- tiup cluster enable
- tiup cluster help
- tiup cluster import
- tiup cluster list
- tiup cluster patch
- tiup cluster prune
- tiup cluster reload
- tiup cluster rename
- tiup cluster replay
- tiup cluster restart
- tiup cluster scale-in
- tiup cluster scale-out
- tiup cluster start
- tiup cluster stop
- tiup cluster template
- tiup cluster upgrade
- TiUP DM Commands
- Overview
- tiup dm audit
- tiup dm deploy
- tiup dm destroy
- tiup dm disable
- tiup dm display
- tiup dm edit-config
- tiup dm enable
- tiup dm help
- tiup dm import
- tiup dm list
- tiup dm patch
- tiup dm prune
- tiup dm reload
- tiup dm replay
- tiup dm restart
- tiup dm scale-in
- tiup dm scale-out
- tiup dm start
- tiup dm stop
- tiup dm template
- tiup dm upgrade
- TiDB Cluster Topology Reference
- DM Cluster Topology Reference
- Mirror Reference Guide
- TiUP Components
- PingCAP Clinic Diagnostic Service
- TiDB Operator
- Dumpling
- TiDB Lightning
- TiDB Data Migration
- About TiDB Data Migration
- Architecture
- Quick Start
- Deploy a DM cluster
- Tutorials
- Advanced Tutorials
- Maintain
- Cluster Upgrade
- Tools
- Performance Tuning
- Manage Data Sources
- Manage Tasks
- Export and Import Data Sources and Task Configurations of Clusters
- Handle Alerts
- Daily Check
- Reference
- Architecture
- Command Line
- Configuration Files
- OpenAPI
- Compatibility Catalog
- Secure
- Monitoring and Alerts
- Error Codes
- Glossary
- Example
- Troubleshoot
- Release Notes
- Backup & Restore (BR)
- Point-in-Time Recovery
- TiDB Binlog
- TiCDC
- Dumpling
- sync-diff-inspector
- TiSpark
- Reference
- Cluster Architecture
- Key Monitoring Metrics
- Secure
- Privileges
- SQL
- SQL Language Structure and Syntax
- SQL Statements
ADD COLUMN
ADD INDEX
ADMIN
ADMIN CANCEL DDL
ADMIN CHECKSUM TABLE
ADMIN CHECK [TABLE|INDEX]
ADMIN SHOW DDL [JOBS|QUERIES]
ADMIN SHOW TELEMETRY
ALTER DATABASE
ALTER INDEX
ALTER INSTANCE
ALTER PLACEMENT POLICY
ALTER TABLE
ALTER TABLE COMPACT
ALTER TABLE SET TIFLASH MODE
ALTER USER
ANALYZE TABLE
BACKUP
BATCH
BEGIN
CHANGE COLUMN
COMMIT
CHANGE DRAINER
CHANGE PUMP
CREATE [GLOBAL|SESSION] BINDING
CREATE DATABASE
CREATE INDEX
CREATE PLACEMENT POLICY
CREATE ROLE
CREATE SEQUENCE
CREATE TABLE LIKE
CREATE TABLE
CREATE USER
CREATE VIEW
DEALLOCATE
DELETE
DESC
DESCRIBE
DO
DROP [GLOBAL|SESSION] BINDING
DROP COLUMN
DROP DATABASE
DROP INDEX
DROP PLACEMENT POLICY
DROP ROLE
DROP SEQUENCE
DROP STATS
DROP TABLE
DROP USER
DROP VIEW
EXECUTE
EXPLAIN ANALYZE
EXPLAIN
FLASHBACK TABLE
FLUSH PRIVILEGES
FLUSH STATUS
FLUSH TABLES
GRANT <privileges>
GRANT <role>
INSERT
KILL [TIDB]
LOAD DATA
LOAD STATS
MODIFY COLUMN
PREPARE
RECOVER TABLE
RENAME INDEX
RENAME TABLE
REPLACE
RESTORE
REVOKE <privileges>
REVOKE <role>
ROLLBACK
SAVEPOINT
SELECT
SET DEFAULT ROLE
SET [NAMES|CHARACTER SET]
SET PASSWORD
SET ROLE
SET TRANSACTION
SET [GLOBAL|SESSION] <variable>
SHOW ANALYZE STATUS
SHOW [BACKUPS|RESTORES]
SHOW [GLOBAL|SESSION] BINDINGS
SHOW BUILTINS
SHOW CHARACTER SET
SHOW COLLATION
SHOW [FULL] COLUMNS FROM
SHOW CONFIG
SHOW CREATE PLACEMENT POLICY
SHOW CREATE SEQUENCE
SHOW CREATE TABLE
SHOW CREATE USER
SHOW DATABASES
SHOW DRAINER STATUS
SHOW ENGINES
SHOW ERRORS
SHOW [FULL] FIELDS FROM
SHOW GRANTS
SHOW INDEX [FROM|IN]
SHOW INDEXES [FROM|IN]
SHOW KEYS [FROM|IN]
SHOW MASTER STATUS
SHOW PLACEMENT
SHOW PLACEMENT FOR
SHOW PLACEMENT LABELS
SHOW PLUGINS
SHOW PRIVILEGES
SHOW [FULL] PROCESSSLIST
SHOW PROFILES
SHOW PUMP STATUS
SHOW SCHEMAS
SHOW STATS_HEALTHY
SHOW STATS_HISTOGRAMS
SHOW STATS_META
SHOW STATUS
SHOW TABLE NEXT_ROW_ID
SHOW TABLE REGIONS
SHOW TABLE STATUS
SHOW [FULL] TABLES
SHOW [GLOBAL|SESSION] VARIABLES
SHOW WARNINGS
SHUTDOWN
SPLIT REGION
START TRANSACTION
TABLE
TRACE
TRUNCATE
UPDATE
USE
WITH
- Data Types
- Functions and Operators
- Overview
- Type Conversion in Expression Evaluation
- Operators
- Control Flow Functions
- String Functions
- Numeric Functions and Operators
- Date and Time Functions
- Bit Functions and Operators
- Cast Functions and Operators
- Encryption and Compression Functions
- Locking Functions
- Information Functions
- JSON Functions
- Aggregate (GROUP BY) Functions
- Window Functions
- Miscellaneous Functions
- Precision Math
- Set Operations
- List of Expressions for Pushdown
- TiDB Specific Functions
- Clustered Indexes
- Constraints
- Generated Columns
- SQL Mode
- Table Attributes
- Transactions
- Garbage Collection (GC)
- Views
- Partitioning
- Temporary Tables
- Cached Tables
- Character Set and Collation
- Placement Rules in SQL
- System Tables
mysql
- INFORMATION_SCHEMA
- Overview
ANALYZE_STATUS
CLIENT_ERRORS_SUMMARY_BY_HOST
CLIENT_ERRORS_SUMMARY_BY_USER
CLIENT_ERRORS_SUMMARY_GLOBAL
CHARACTER_SETS
CLUSTER_CONFIG
CLUSTER_HARDWARE
CLUSTER_INFO
CLUSTER_LOAD
CLUSTER_LOG
CLUSTER_SYSTEMINFO
COLLATIONS
COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS
DATA_LOCK_WAITS
DDL_JOBS
DEADLOCKS
ENGINES
INSPECTION_RESULT
INSPECTION_RULES
INSPECTION_SUMMARY
KEY_COLUMN_USAGE
METRICS_SUMMARY
METRICS_TABLES
PARTITIONS
PLACEMENT_POLICIES
PROCESSLIST
REFERENTIAL_CONSTRAINTS
SCHEMATA
SEQUENCES
SESSION_VARIABLES
SLOW_QUERY
STATISTICS
TABLES
TABLE_CONSTRAINTS
TABLE_STORAGE_STATS
TIDB_HOT_REGIONS
TIDB_HOT_REGIONS_HISTORY
TIDB_INDEXES
TIDB_SERVERS_INFO
TIDB_TRX
TIFLASH_REPLICA
TIKV_REGION_PEERS
TIKV_REGION_STATUS
TIKV_STORE_STATUS
USER_PRIVILEGES
VARIABLES_INFO
VIEWS
METRICS_SCHEMA
- UI
- TiDB Dashboard
- Overview
- Maintain
- Access
- Overview Page
- Cluster Info Page
- Top SQL Page
- Key Visualizer Page
- Metrics Relation Graph
- SQL Statements Analysis
- Slow Queries Page
- Cluster Diagnostics
- Monitoring Page
- Search Logs Page
- Instance Profiling
- Session Management and Configuration
- FAQ
- CLI
- Command Line Flags
- Configuration File Parameters
- System Variables
- Storage Engines
- Telemetry
- Errors Codes
- Table Filter
- Schedule Replicas by Topology Labels
- FAQs
- Release Notes
- All Releases
- Release Timeline
- TiDB Versioning
- TiDB Installation Packages
- v6.2
- v6.1
- v6.0
- v5.4
- v5.3
- v5.2
- v5.1
- v5.0
- v4.0
- v3.1
- v3.0
- v2.1
- v2.0
- v1.0
- Glossary
TiDB 4.0.5 Release Notes
Release date: August 31, 2020
TiDB version: 4.0.5
Compatibility Changes
TiDB
New Features
TiKV
- Define error code for errors #8387
TiFlash
- Support the unified log format with TiDB
Tools
Improvements
TiDB
- Optimize the performance of
DecodePlan
for big union queries #18941 - Reduce the number of GC lock scans when the
Region cache miss
error occurs #18876 - Ease the impact of statistical feedback on cluster performance #18772
- Support canceling operations before the RPC response is returned #18580
- Add the HTTP API to generate the TiDB metric profile #18531
- Support scattering partitioned tables #17863
- Add detailed memory usage of each instance in Grafana #18679
- Show the detailed runtime information of the
BatchPointGet
operator in the result ofEXPLAIN
#18892 - Show the detailed runtime information of the
PointGet
operator in the result ofEXPLAIN
#18817 - Warn the potential deadlock for
Consume
inremove()
#18395 - Refine the behaviors of
StrToInt
andStrToFloat
and support converting JSON to thedate
,time
, andtimestamp
types #18159 - Support limiting the memory usage of the
TableReader
operator #18392 - Avoid too many times of backoff when retrying the
batch cop
request #18999 - Improve compatibility for
ALTER TABLE
algorithms #19270 - Make the single partitioned table support
IndexJoin
on the inner side #19151 - Support searching the log file even when the log includes invalid lines #18579
- Optimize the performance of
PD
- Support scattering Regions in stores with special engines (such as TiFlash) #2706
- Support the Region HTTP API to prioritize Region scheduling of a given key range #2687
- Improve the leader distribution after Region scattering #2684
- Add more tests and logs for the TSO request #2678
- Avoid invalid cache updates after the leader of a Region has changed #2672
- Add an option to allow
store.GetLimit
to return the tombstone stores #2743 - Support synchronizing the Region leader change between the PD leader and followers #2795
- Add commands for querying the GC safepoint service #2797
- Replace the
region.Clone
call in filters to improve performance #2801 - Add an option to disable updating Region flow cache to improve the performance of the large cluster #2848
TiFlash
- Add more Grafana panels to display metrics of CPU, I/O, RAM usages and metrics of the storage engine
- Reduce I/O operations by optimizing the processing logic of Raft logs
- Accelerate Region scheduling for the blocked
add partition
DDL statement - Optimize compactions of delta data in DeltaTree to reduce read and write amplification
- Optimize the performance of applying Region snapshots by preprocessing the snapshots using multiple threads
- Optimize the number of opening file descriptors when the read load of TiFlash is low to reduce system resource consumption
- Optimize the number of unnecessary small files created when TiFlash restarts
- Support encryption at rest for data storage
- Support TLS for data transfer
Tools
Bug Fixes
TiDB
- Fix the
should ensure all columns have the same length
error that occurs because theErrTruncate/Overflow
error is incorrectly handled in thebuiltinCastRealAsDecimalSig
function #18967 - Fix the issue that the
pre_split_regions
table option does not work in the partitioned table #18837 - Fix the issue that might cause a large transaction to be terminated prematurely #18813
- Fix the issue that using the
collation
functions get wrong query results #18735 - Fix the bug that the
getAutoIncrementID()
function does not consider thetidb_snapshot
session variable, which might cause the dumper tool to fail with thetable not exist
error #18692 - Fix the
unknown column error
for SQL statement likeselect a from t having t.a
#18434 - Fix the panic issue that writing the 64-bit unsigned type into the hash partitioned table causes overflow and gets an unexpected negative number when the partition key is the integer type #18186
- Fix the wrong behavior of the
char
function #18122 - Fix the issue that the
ADMIN REPAIR TABLE
statement cannot parse integer in the expressions on the range partition #17988 - Fix the wrong behavior of the
SET CHARSET
statement #17289 - Fix the bug caused by the wrong collation setting which leads to the wrong result of the
collation
function #17231 - Fix the issue that
STR_TO_DATE
's handling of the format tokens '%r', '%h' is inconsistent with that of MySQL #18727 - Fix issues that the TiDB version information is inconsistent with that of PD/TiKV in the
cluster_info
table #18413 - Fix the existent checks for pessimistic transactions #19004
- Fix the issue that executing
union select for update
might cause concurrent race #19006 - Fix the wrong query result when
apply
has a child of thePointGet
operator #19046 - Fix the incorrect result that occurs when
IndexLookUp
is in the inner side of theApply
operator #19496 - Fix the incorrect result of
anti-semi-join
queries #19472 - Fix the incorrect result caused by the mistaken usage of
BatchPointGet
#19456 - Fix the incorrect result that occurs when
UnionScan
is in the inner side of theApply
operator #19496 - Fix the panic caused by using the
EXECUTE
statement to print an expensive query log #17419 - Fix the index join error when the join key is
ENUM
orSET
#19235 - Fix the issue that the query range cannot be built when the
NULL
value exists on the index column #19358 - Fix the data race issue caused by updating the global configuration #17964
- Fix the panic issue occurs when modifying the character set in an uppercase schema #19286
- Fix an unexpected error caused by changing the temporary directory during the disk spill action #18970
- Fix the wrong hash key for the decimal type #19131
- Fix the issue that the
PointGet
andBatchPointGet
operators do not consider the partition selection syntax and get incorrect results #19141 - Fix the incorrect results when using the
Apply
operator together with theUnionScan
operator #19104 - Fix the bug that causes the indexed virtual generated column to return wrong value #17989
- Add the lock for runtime statistics to fix a panic caused by concurrent execution #18983
- Fix the
TiKV
PD
- Fix the bug that the TSO request might fail at the time of leader change #2666
- Fix the issue that sometimes Region replicas cannot be scheduled to the optimal state when placement rules are enabled #2720
- Fix the issue that
Balance Leader
does not work when placement rules are enabled #2726 - Fix the issue that unhealthy stores are not filtered from store load statistics #2805
TiFlash
- Fix the issue that TiFlash cannot start normally after upgrading from an earlier version if the name of the database or table contains special characters
- Fix the issue that the TiFlash process can not exit if any exceptions are thrown during initialization
Tools
Backup & Restore (BR)
Dumpling
- Fix the issue that FTWRL lock is not released in time #128
TiCDC
- Fix the issue that the failed
changefeed
cannot be removed #782 - Fix invalid
delete
events by selecting one unique index as the handle index #787 - Fix the bug that GC safepoint is forwarded beyond the checkpoint of stopped
changefeed
#797 - Fix the bug that the network I/O waiting blocks tasks to exit #825
- Fix the bug that some unnecessary data might be mistakenly replicated to the downstream #743
- Fix the issue that the failed
TiDB Lightning
- Fix the syntax error on empty binary/hex literals when using TiDB backend #357
Was this page helpful?