tencent cloud

TDSQL-C for MySQL

Release Notes and Announcements
Release Notes
Product Announcements
Beginner's Guide
Product Introduction
Overview
Strengths
Use Cases
Architecture
Product Specifications
Instance Types
Product Feature List
Database Versions
Regions and AZs
Common Concepts
Use Limits
Suggestions on Usage Specifications
Kernel Features
Kernel Overview
Kernel Version Release Notes
Optimized Kernel Version
Functionality Features
Performance Features
Security Features
Stability Feature
Analysis Engine Features
Inspection and Repair of Kernel Issues
Purchase Guide
Billing Overview
Product Pricing
Creating Cluster
Specification Adjustment Description
Renewal
Payment Overdue
Refund
Change from Pay-as-You-Go to Yearly/Monthly Subscription
Change from Pay-as-You-Go to Serverless Billing
Value-Added Services Billing Overview
Viewing Billing Statements
Getting Started
Database Audit
Overview
Viewing Audit Instance List
Enabling Audit Service
Viewing Audit Logs
Log Shipping
Post-Event Alarm Configuration
Modifying Audit Rule
Modifying Audit Service
Disabling Audit Service
Audit Rule Template
Viewing Audit Task
Authorizing Sub-User to Use Database Audit
Serverless Service
Serverless Introduction
Creating and Managing a Serverless Cluster
Elastic Scaling Management Tool
Serverless Resource Pack
Multi-AZ Deployment
Configuration Change
FAQs
Serverless Cost Estimator
Operation Guide
Operation Overview
Switching Cluster Page View in Console
Database Connection
Instance Management
Configuration Adjustment
Instance Mode Management
Cluster Management
Scaling Instance
Database Proxy
Account Management
Database Management
Database Management Tool
Parameter Configuration
Multi-AZ Deployment
GD
Backup and Restoration
Operation Log
Data Migration
Parallel Query
Columnar Storage Index (CSI)
Analysis Engine
Database Security and Encryption
Monitoring and Alarms
Basic SQL Operations
Connecting to TDSQL-C for MySQL Through SCF
Tag
Practical Tutorial
Classified Protection Practice for Database Audit of TDSQL-C for MySQL
Upgrading Database Version from MySQL 5.7 to 8.0 Through DTS
Usage Instructions for TDSQL-C MySQL
New Version of Console
Implementing Multiple RO Groups with Multiple Database Proxy Connection Addresses
Strengths of Database Proxy
Selecting Billing Mode for Storage Space
Creating Remote Disaster Recovery by DTS
Creating VPC for Cluster
Data Rollback
Solution to High CPU Utilization
How to Authorize Sub-Users to View Monitoring Data
White Paper
Security White Paper
Performance White Paper
Troubleshooting
Connection Issues
Performance Issues
API Documentation
History
Introduction
API Category
Making API Requests
Instance APIs
Multi-Availability Zone APIs
Other APIs
Audit APIs
Database Proxy APIs
Backup and Recovery APIs
Parameter Management APIs
Billing APIs
serverless APIs
Resource Package APIs
Account APIs
Performance Analysis APIs
Data Types
Error Codes
FAQs
Basic Concepts
Purchase and Billing
Compatibility and Format
Connection and Network
Features
Console Operations
Database and Table
Performance and Log
Database Audit
Between TDSQL-C for MySQL and TencentDB for MySQL
Service Agreement
Service Level Agreement
Terms of Service
TDSQL-C Policy
Privacy Policy
Data Privacy and Security Agreement
General References
Standards and Certifications
Glossary
Contact Us

Description of Supported String Functions

PDF
Focus Mode
Font Size
Last updated: 2025-11-26 11:20:54
Currently, the read-only analysis engine supports most of MySQL's string functions, but there are still limitations and incompatibilities in certain scenarios. This document introduces the list of supported string functions in the read-only analysis engine, and enumerates type restrictions on input parameters. Input parameters and functions not mentioned in the document are not supported.

Supported String Function Types

substr Function

Substring extraction function with the following usage methods.
Syntax: substr(str, start)
Supported value types for str: char and varchar.
Supported value types for start: bigint, double, and decimal.
Syntax: substr(str from start)
Supported value types for str: char and varchar.
Supported value types for start: bigint, double, and decimal.
Syntax: substr(string, start, length)
Supported value types for str: char and varchar.
Supported value types for start: bigint, double, and decimal.
Supported value types for length: bigint, double, and decimal.
Syntax: substr(string from start for length)
Supported value types for str: char and varchar.
Supported value types for start: bigint, double, and decimal.
Supported value types for length: bigint, double, and decimal.

char_length Function

String length judgment function, which returns the number of characters in a string.
Syntax: char_length(str)
Supported value types for str: char and varchar.

replace Function

String replacement function.
Syntax: replace(str, from_str, to_str)
Supported value types for str: char and varchar.
Supported value types for from_str: char and varchar.
Supported value types for to_str: char and varchar.

concat Function

String concatenation function.
Syntax: concat(str1, str2, ...)
Supported value types for str1: char and varchar.
Supported value types for str2: char and varchar.

concat_ws Function

String concatenation function with delimiter(s).
Syntax: concat_ws(str1, str2, ...)
Supported value types for str1: char and varchar.
Supported value types for str2: char and varchar.

left Function

A function that returns a specified number of characters starting from the first character of a string.
Syntax: left(str, len)
Supported value types for str1: char and varchar.
Supported value types for len: int, bigint, double, and decimal.

right Function

A function that returns a specified number of characters starting from the last character of a string.
Syntax: right(str, len)
Supported value types for str1: char and varchar.
Supported value types for len: int, bigint, double, and decimal.

ascii Function

A function that converts a character into its ASCII code value.
Syntax: ascii(str)
Supported value types for str1: char and varchar.

length Function

String length judgment function, which returns the number of bytes in a string.
Syntax: length(str)
Supported value types for str1: char and varchar.

trim Function

A function that clears unnecessary characters before and after a string.
Syntax: trim([{BOTH | LEADING | TRAILING} [remstr] FROM] str)
Supported value types for remstr: char and varchar.
Supported value types for str: char and varchar.

ltrim Function

A function that clears unnecessary characters before a string.
Syntax: ltrim(str)
Supported value types for str: char and varchar.

trim Function

Function that removes unnecessary characters before and after a string.
Syntax: trim([{BOTH | LEADING | TRAILING} [remstr] FROM] str)
Supported value types for remstr: char and varchar data.
Supported value types for str: char and varchar data.

ltrim Function

Function that removes unnecessary characters before a string.
Syntax: ltrim(str)
Supported value types for str: char and varchar data.

rtrim Function

A function that clears unnecessary characters after a string.
Syntax: rtrim(str)
Supported value types for str: char and varchar.

position Function

A function that returns the position of a substring.
Syntax: position(substr IN str)
Supported value types for str: char and varchar.
Supported value types for substr: char and varchar.

instr Function

A function that searches for the position of the first occurrence of a string in another string.
Syntax: instr(str, substr)
Supported value types for str: char and varchar.
Supported value types for substr: char and varchar.

locate Function

A function that returns the position of the first occurrence of a substring in a string.
Syntax: locate(str, substr)
Supported value types for str: char and varchar.
Supported value types for substr: char and varchar.

lower Function

A function that returns the lowercase of a string.
Syntax: lower(str)
Supported value types for str: char and varchar.

ucase Function

A function that converts all lowercase letters in a given string to uppercase letters.
Syntax: ucase(str)
Supported value types for str: char and varchar.

upper Function

A function that converts all lowercase letters in a given string to uppercase letters.
Syntax: upper(str)
Supported value types for str: char and varchar.

substring_index Function

A function that supports reverse substring extraction.
Syntax: substring_index(str, delim, count)
Supported value types for str: char and varchar.
Supported value types for delim: char and varchar. It can only be a constant instead of a variable value similar to a field value.
Supported value types for count: int, bigint, double, and decimal. It supports a negative number and can only be a constant instead of a variable value similar to a field value.

lpad Function

A function that pads the beginning of a string to reach a specified length.
Syntax: lpad(str, len, padstr)
Supported value types for str: char and varchar.
Supported value types for len: int, bigint, double, and decimal data. It can only be a constant instead of a variable value similar to a field value.
Supported value types for padstr: char and varchar.

rpad Function

A function that pads the end of a string to reach a specified length.
Syntax: rpad(str, len, padstr)
Supported value types for str: char and varchar.
Supported value types for len: int, bigint, double, and decimal. It can only be a constant.
Supported value types for padstr: char and varchar.

strcmp Function

A function that compares two strings and returns an integer based on the comparison.
Syntax: strcmp(expr1, expr2)
Supported value types for expr1: char and varchar.
Supported value types for expr2: char and varchar.

quote Function

A function that quotes a string with special characters in a query.
Syntax: quote(str)
Supported value types for str: char and varchar.

find_in_set Function

Function that finds the position of the corresponding character in the string. Currently, it only supports strlist as the string type, and does not support the set type.
Syntax: find_in_set(str,strlist)
str: string to be queried.
strlist: The field name parameters are separated by a comma (,), such as (1,2,6,8).

field Function

Function that sorts the query result set in SQL in the specified order.
Syntax: field(str,str2,...)
str: string value specified to be sorted from left to right.

uuid Function

Used to generate a random 36-bit snowflake ID.
Syntax: uuid()
Input parameters are not required.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback