tencent cloud

TDSQL for MySQL

Announcements
Alarm Upgrade
Product Introduction
Overview
Strengths
Use Cases
Regions and AZs
InnoDB engine
Purchase Guide
Billing Overview (InnoDB)
Product Pricing (InnoDB)
Purchase and Upgrade
Refund
Payment Overdue
Backup Space Billing
Getting Started
InnoDB Engine
Operation Guide(InnoDB)
Instance Management
Disaster Recovery Read-Only Instance
Changing Networks
Account Management
Security Management
Slow Query Analysis
Backup and Rollback
Data Migration
Database Audit
Practical Tutorial
Import from Standalone Instance to TDSQL Instance
Import Between TDSQL Instances
Selection of TDSQL Instance and Shard Configuration
Security White Paper
Platform Security Design
Tenant Security Features
Development Guide
InnoDB
API Documentation
History
Introduction
API Category
Security Group APIs
Other APIs
Making API Requests
TDSQL APIs
Data Types
Error Codes
FAQs
InnoDB
General References
Performance Comparison Data for Strong Sync
Glossary
Contact Us

Passthrough SQL

PDF
フォーカスモード
フォントサイズ
最終更新日: 2024-01-06 17:34:56
TDSQL for MySQL parses SQL syntax, which restricts SQL execution. If you want to execute SQL statements supported by MySQL but not by TDSQL on a set, you can pass through the SQL statements.
Note:
The proxy will not parse an SQL statement that is passed through. If it is a passthrough write operation to two sets, distributed transactions will not be used, which may cause inconsistency in extreme cases. Therefore, we recommend you pass through only to one set in a single write operation.
To ensure that the passthrough syntax takes effect, add the -c parameter when connecting to MySQL.
MySQL [test]> repair table test.t1;
ERROR 664 (HY000): Proxy ERROR:SQL is too complex, only applicable to noshard table: Shard table do not support repair
MySQL [test]> /*sets:allsets*/repair table test.t1;
+---------+--------+----------+----------+------------------+
| Table | Op | Msg_type | Msg_text | info |
+---------+--------+----------+----------+------------------+
| test.t1 | repair | status | OK | set_1544429866_3 |
| test.t1 | repair | status | OK | set_1544429718_1 |
+---------+--------+----------+----------+------------------+
2 rows in set (0.01 sec)
Syntax:
sets:set_1,set_2: it is used to specify the sets to which SQL statements will be passed through. The set name can be queried by /*proxy*/show status.
sets:allsets: it indicates that SQL statements will be passed through to all sets.
shardkey:10: it indicates that SQL statements will be passed through to the set according to the specified shardkey.
shardkey_hash:10: it indicates that SQL statements will be passed through to the set where its specified hash value is 10. If shardkey_hash is set to 0, SQL statements will be passed through to the first set.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック