Bu sayfa henüz yerel dilinizde mevcut değildir. Daha fazla dil seçeneği eklemek için yoğun bir şekilde çalışıyoruz. Desteğiniz için teşekkür ederiz.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Numeric Data Types

Updated on 2024-12-06 GMT+08:00
Table 1 Integer types

No.

MySQL

GaussDB

Difference

1

BOOL

Supported, with differences

Output format: The output of SELECT TRUE/FALSE in GaussDB is t or f, and that in MySQL is 1 or 0.

MySQL: The BOOL/BOOLEAN type is actually mapped to the TINYINT type.

2

BOOLEAN

Supported, with differences

3

TINYINT[(M)] [UNSIGNED] [ZEROFILL]

Supported, with differences

For details, see the following note.

4

SMALLINT[(M)] [UNSIGNED] [ZEROFILL]

Supported, with differences

For details, see the following note.

5

MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]

Supported, with differences

MySQL requires 3 bytes to store MEDIUMINT data.
  • The signed range is –8388608 to +8388607.
  • The unsigned range is 0 to +16777215.
GaussDB is mapped to the INT type. Four bytes are required for storage. The value range is determined based on boundary values.
  • The signed range is –8388608 to +8388607.
  • The unsigned range is 0 to +16777215.

For other differences, see the following note.

6

INT[(M)] [UNSIGNED] [ZEROFILL]

Supported, with differences

For details, see the following note.

7

INTEGER[(M)] [UNSIGNED] [ZEROFILL]

Supported, with differences

For details, see the following note.

8

BIGINT[(M)] [UNSIGNED] [ZEROFILL]

Supported, with differences

For details, see the following note.

NOTE:
Input formats:
  • MySQL:

    If a character string with multiple decimal points (such as "1.2.3.4.5") is entered, MySQL will misparse the character string in loose mode, throw a warning, and insert the character string into the table successfully. For example, after "1.2.3.4.5" is inserted into the table, the value is 12.

  • GaussDB:

    If a character string with multiple decimal points (such as "1.2.3.4.5") is entered in loose mode, the characters after the second decimal point are truncated as invalid characters, a warning is thrown, and the character string is inserted into the table successfully. For example, after "1.2.3.4.5" is inserted into the table, the value is 1. After "1.6.3.4.5" is inserted into the table, the value is 2.

Example: When CREATE TABLE AS with UNION is used, GaussDB uses the default value of max_length for an integer CONST node, while MySQL calculates the max_length value based on the actual situation.

-- GaussDB
m_db=# CREATE TABLE test_int AS SELECT 1234567 UNION ALL SELECT '456789';
m_db=# DESC test_int;
  Field   |    Type     | Null | Key | Default | Extra 
----------+-------------+------+-----+---------+-------
 ?column? | varchar(11) | YES  |     |         | 
(1 row)
m_db=# DROP TABLE test_int;

-- MySQL
mysql> CREATE TABLE test_int AS SELECT 1234567 UNION ALL SELECT '456789';
mysql> DESC test_int;
+---------+------------+------+-----+---------+-------+
| Field   | Type       | Null | Key | Default | Extra |
+---------+------------+------+-----+---------+-------+
| 1234567 | varchar(7) | NO   |     |         |       |
+---------+------------+------+-----+---------+-------+
1 row in set (0.00 sec)
mysql> DROP TABLE test_int;
Table 2 Arbitrary precision types

No.

MySQL

GaussDB

Difference

1

DECIMAL[(M[,D])] [ZEROFILL]

Supported, with differences

MySQL decimal uses a 9 x 9 array to store values. The integer part and decimal part are stored separately. If the length exceeds the value, the decimal part is truncated first. GaussDB truncates an integer that contains more than 81 digits.

2

NUMERIC[(M[,D])] [ZEROFILL]

Supported, with differences

3

DEC[(M[,D])] [ZEROFILL]

Supported, with differences

4

FIXED[(M[,D])] [ZEROFILL]

Supported, with differences

Table 3 Floating-point types

No.

MySQL

GaussDB

Difference

1

FLOAT[(M,D)] [ZEROFILL]

Supported, with differences

The FLOAT data type does not support partitioned tables with the key partitioning policy.

2

FLOAT(p) [ZEROFILL]

Supported, with differences

The FLOAT data type does not support partitioned tables with the key partitioning policy.

3

DOUBLE[(M,D)] [ZEROFILL]

Supported, with differences

The DOUBLE data type does not support partitioned tables with the key partitioning policy.

4

DOUBLE PRECISION[(M,D)] [ZEROFILL]

Supported, with differences

The DOUBLE PRECISION data type does not support partitioned tables with the key partitioning policy.

5

REAL[(M,D)] [ZEROFILL]

Supported, with differences

The REAL data type does not support partitioned tables with the key partitioning policy.

NOTE:

In the scenario where the driver adopts FLOAT and DOUBLE types with a precision scale, no error is reported when the input data exceeds the range.

Sitemizi ve deneyiminizi iyileştirmek için çerezleri kullanırız. Sitemizde tarama yapmaya devam ederek çerez politikamızı kabul etmiş olursunuz. Daha fazla bilgi edinin

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback