Attributes Supported by Data Types
Attributes Supported by Data Types |
---|
NULL |
NOT NULL |
DEFAULT |
ON UPDATE |
PRIMARY KEY |
AUTO_INCREMENT |
CHARACTER SET name |
COLLATE name |
ZEROFILL |
Difference:
During table creation, default values are set for fields of the VARBINARY type. When querying the table structure using DESC or similar methods, GaussDB displays the converted hexadecimal values, whereas MySQL displays original values.
-- GaussDB m_db=# CREATE TABLE test_varbinary(a varbinary(20) DEFAULT 'GaussDB'); CREATE TABLE m_db=# DESC test_varbinary; Field | Type | Null | Key | Default | Extra -------+---------------+------+-----+-------------------+------- a | varbinary(20) | YES | | X'47617573734442' | (1 row) m_db=# DROP TABLE test_varbinary; DROP TABLE -- MySQL mysql> CREATE TABLE test_varbinary(a varbinary(20) DEFAULT 'GaussDB'); Query OK, 0 rows affected (0.02 sec) mysql> DESC test_varbinary; +-------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+---------------+------+-----+---------+-------+ | a | varbinary(20) | YES | | GaussDB | | +-------+---------------+------+-----+---------+-------+ 1 row in set (0.00 sec) mysql> DROP TABLE test_varbinary; Query OK, 0 rows affected (0.01 sec)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot