diff --git a/product/en/docs-mtk/v2.0/faqs.md b/product/en/docs-mtk/v2.0/faqs.md index 4873aa903c76de4f3b966929d2a127f1c45c608b..9c0cd14be26fc5de595bfd75fe306f287f52fa88 100644 --- a/product/en/docs-mtk/v2.0/faqs.md +++ b/product/en/docs-mtk/v2.0/faqs.md @@ -73,20 +73,19 @@ The following scenarios exist. ## Empty String and NULL conversions ? -- Oracle '' = null -- DB2 '' != null -- MySQL '' != Null -- PostgreSQL '' != Null +- Oracle `''` = `NULL` +- DB2 `''` != `NULL` +- MySQL `''` != `NULL` +- PostgreSQL `''` != `NULL` - openGauss - - Compatibility type A: '' = null - - Compatibility type PG: '' != null - - Compatibility type B: '' != null -- Informix '' != null + - Compatibility type A: `''` = `NULL` + - Compatibility type PG: `''` != `NULL` + - Compatibility type B: `''` != `NULL` +- Informix `''` != `NULL` -MTK processes databases according to the compatibility mode of the source and target databases. +When the processing method of the target database is inconsistent with the processing method of the source database, MTK will perform data conversion according to the `NOT NULL` constraint of the column. -- '' = null does not process data. -- '' = null converts a string to '' when the column type is `NOT Null`. +If the column has `NOT NULL` constraint, and there is a `''` in the column database, the `''` will be converted to `" "`, and when it is allowed to be `NULL`, it will be converted to `NULL` ## Chr(0) 0x00 Change ? diff --git a/product/en/docs-mtk/v2.0/mtk-db2-to-mysql.md b/product/en/docs-mtk/v2.0/mtk-db2-to-mysql.md index 8e3971ec9dba87a8f4f43b2c79d3635e600fa38c..74dcb37c42137da999c23e6ef8128af0fb066b6f 100644 --- a/product/en/docs-mtk/v2.0/mtk-db2-to-mysql.md +++ b/product/en/docs-mtk/v2.0/mtk-db2-to-mysql.md @@ -22,9 +22,9 @@ date: 2021-03-04 Table/column/index/cons names in mysql do not support suffixes with spaces, mtk will automatically trim the space on the right -### Empty String and Null Problems +### Empty String and NULL Problems -In DB2 and MySQL, null is not equal to an empty string, which does not need to be processed. +In DB2 and MySQL, `NULL` is not equal to an empty string, which does not need to be processed. #### Sequence diff --git a/product/en/docs-mtk/v2.0/mtk-db2-to-openGauss.md b/product/en/docs-mtk/v2.0/mtk-db2-to-openGauss.md index 74fe0855b720d9f65ff053296c4ee81b9ce5df46..835ef1b1d37929ff081862d697aace80686d867b 100644 --- a/product/en/docs-mtk/v2.0/mtk-db2-to-openGauss.md +++ b/product/en/docs-mtk/v2.0/mtk-db2-to-openGauss.md @@ -71,9 +71,9 @@ DB2 character set can be divided into three types, including OS Locale, DB2CODEP In DB2, null is not equal to an empty string. -The compatibility type A in openGauss is different from that in DB2 in that the property "not null" of a column will be converted to `" "` and will be converted to null if permitted in openGauss. +The compatibility type A in openGauss is different from that in DB2 in that the property `NOT NULL` of a column will be converted to `" "` and will be converted to `NULL` if permitted in openGauss. -The compatibility type PG in openGauss is the same as that in DB2 in that null != '' does not need to be processed. +The compatibility type PG in openGauss is the same as that in DB2 in that `NULL` !=`''` does not need to be processed. DBCOMPATIBILITY [ = ] compatibility_type @@ -91,7 +91,7 @@ Therefore, the values **A**, **B**, and **PG** are commonly used. >Note: > - > - For the compatibility type of A, the database considers an empty string as null and replace the data type **DATE** with **TIMESTAMP(0) WITHOUT TIME ZONE**. + > - For the compatibility type of A, the database considers an empty string as `NULL` and replace the data type **DATE** with **TIMESTAMP(0) WITHOUT TIME ZONE**. > - For the compatibility type of B, when a string is converted to an integer type, if an illegal value is entered, it will be converted to 0. However, for other compatibility types, an error will be reported. > - For the compatibility type of PG, CHAR and VARCHAR use character as the string unit. For other compatibility types, byte is used as the string unit. For example, as for UTF-8 character set, CHAR(3) can hold 3 Chinese characters in the compatibility type of PG but only one Chinese character in the other compatibility types. diff --git a/product/en/docs-mtk/v2.0/mtk-mysql-to-openGauss.md b/product/en/docs-mtk/v2.0/mtk-mysql-to-openGauss.md index 209e655d753bc946d59dc9da7d7ae40a20f45cd6..7133e2598deaa3f1fab3c966c6b751483eb6498d 100644 --- a/product/en/docs-mtk/v2.0/mtk-mysql-to-openGauss.md +++ b/product/en/docs-mtk/v2.0/mtk-mysql-to-openGauss.md @@ -36,7 +36,7 @@ Therefore, the values **A**, **B**, and **PG** are commonly used. >Note: > - > - For the compatibility type of A, the database considers an empty string as null and replace the data type **DATE** with **TIMESTAMP(0) WITHOUT TIME ZONE**. + > - For the compatibility type of A, the database considers an empty string as `NULL` and replace the data type **DATE** with **TIMESTAMP(0) WITHOUT TIME ZONE**. > - For the compatibility type of B, when a string is converted to an integer type, if an illegal value is entered, it will be converted to 0. However, for other compatibility types, an error will be reported. > - For the compatibility type of PG, CHAR and VARCHAR use character as the string unit. For other compatibility types, byte is used as the string unit. For example, as for UTF-8 character set, CHAR(3) can hold 3 Chinese characters in the compatibility type of PG but only one Chinese character in the other compatibility types. diff --git a/product/en/docs-mtk/v2.0/mtk-oracle-to-openGauss.md b/product/en/docs-mtk/v2.0/mtk-oracle-to-openGauss.md index 68d7d5b93220dbb67f79a62ec31a24806c70afca..9593718340922191f98b630664db59c29c18c70f 100644 --- a/product/en/docs-mtk/v2.0/mtk-oracle-to-openGauss.md +++ b/product/en/docs-mtk/v2.0/mtk-oracle-to-openGauss.md @@ -98,7 +98,7 @@ The object type is from `OBJECT_TYPE` of `DBA_OBJECT`. ### Empty string problem -In Oracle, an empty string is null. In openGauss, If **dbcompatibility** is set to **A**, an empty string is null. If **dbcompatibility** is set to **PG**, an empty string is not null. +In Oracle, an empty string is `NULL`. In openGauss, If **dbcompatibility** is set to **A**, an empty string is `NULL`. If **dbcompatibility** is set to **PG**, an empty string is `NOT NULL`. DBCOMPATIBILITY [ = ] compatibility_type diff --git a/product/zh/docs-mtk/v2.0/faqs.md b/product/zh/docs-mtk/v2.0/faqs.md index 4ba42122423850e75a5c5a551b8e7c7fd7d677e6..9b4115e958c498235ea659d934c874f4082109b8 100644 --- a/product/zh/docs-mtk/v2.0/faqs.md +++ b/product/zh/docs-mtk/v2.0/faqs.md @@ -71,19 +71,19 @@ Char类型数据需要注意. 如在Oracle里Char(1)迁移到openGauss/MogDB就 ## 存在空字符串和NULL转换? -- Oracle '' = null -- DB2 '' != null -- MySQL '' != Null -- PostgreSQL '' != Null +- Oracle `''` = `NULL` +- DB2 `''` != `NULL` +- MySQL `''` != `NULL` +- PostgreSQL `''` != `NULL` - openGauss - - A 兼容模式下 '' = null - - PG 兼容模式下 '' != null - - B 兼容模式下 '' != null -- Informix '' != null + - A 兼容模式下 `''` = `NULL` + - PG 兼容模式下 `''` != `NULL` + - B 兼容模式下 `''` != `NULL` +- Informix `''` != `NULL` -当目标数据库的处理方式和源数据库不一致时,MTK会根据列的属性进行数据转换. +当目标数据库的处理方式和源数据库处理方式不一致时,MTK会根据列的非空属性进行数据转换. -如列的数据为not null时转为`" "`,允许为null时转为null +如列存在非空约束`NOT NULL`,并且列数据库存在`''`,会把`''`时转为`" "`,允许为`NULL`时转为`NULL` ## 存在 Chr(0) 0x00 ? diff --git a/product/zh/docs-mtk/v2.0/mtk-db2-to-openGauss.md b/product/zh/docs-mtk/v2.0/mtk-db2-to-openGauss.md index a221405bfffeb5282b75e75369294197cf469c99..17d233eb11d50a7eb4e21c6389f26d952e7956e9 100644 --- a/product/zh/docs-mtk/v2.0/mtk-db2-to-openGauss.md +++ b/product/zh/docs-mtk/v2.0/mtk-db2-to-openGauss.md @@ -68,11 +68,11 @@ db2字符集分为是三种级别的字符集,包括操作系统locale,DB2CODE ### 空字符串和NULL问题 -空字符串和NULL问题, DB2 null 不等于 '' +空字符串和NULL问题, DB2 `NULL` 不等于 '' -openGauss A模式下和DB2不一样,需要处理数据 当列的属性为not null时转为`" "`,允许为null时转为null +openGauss A模式下和DB2不一样,需要处理数据 当列的属性为 `NOT NULL` 时转为 `" "`,允许为 `NULL` 时转为 `NULL` -openGauss PG模式下和DB2一样, null != '' 无需处理 +openGauss PG模式下和DB2一样, `NULL` != `''` 无需处理 DBCOMPATIBILITY [ = ] compatibility_type diff --git a/product/zh/docs-mtk/v2.0/mtk-informix-to-openGauss.md b/product/zh/docs-mtk/v2.0/mtk-informix-to-openGauss.md index 3f471e706fb7ffaa143b8208a2fc40991ae6d8e0..6787888185229d0e1334048ea81d1c18868194b3 100644 --- a/product/zh/docs-mtk/v2.0/mtk-informix-to-openGauss.md +++ b/product/zh/docs-mtk/v2.0/mtk-informix-to-openGauss.md @@ -29,13 +29,13 @@ date: 2022-05-28 ### 空字符串和NULL问题 -空字符串和NULL问题, Informix null 不等于 '' +空字符串和NULL问题, Informix `NULL` != `''` -- openGauss A 模式下和 Informix 不一样,需要处理数据 当列的属性为not null时转为`" "`,允许为null时转为null +- openGauss A 模式下和 Informix 不一样,需要处理数据 当列的属性为 `not null` 时转为`" "`,允许为 `NULL` 时转为 `NULL` -- openGauss PG 模式下和 Informix 一样, null != '' 无需处理 +- openGauss PG 模式下和 Informix 一样, `NULL` != `''` 无需处理 -- openGauss B 模式下和 Informix 一样, null != '' 无需处理 +- openGauss B 模式下和 Informix 一样, `NULL` != `''` 无需处理 ### 序列 diff --git a/product/zh/docs-mtk/v2.0/mtk-oracle-to-openGauss.md b/product/zh/docs-mtk/v2.0/mtk-oracle-to-openGauss.md index 2edaf89ed851119299330004f3ea15e82359626f..abeff0e58bcd66a43ae088112dddddf00798bbd7 100644 --- a/product/zh/docs-mtk/v2.0/mtk-oracle-to-openGauss.md +++ b/product/zh/docs-mtk/v2.0/mtk-oracle-to-openGauss.md @@ -93,7 +93,7 @@ date: 2021-03-04 ### 空字符串和NULL问题 -Oracle 里 `''` = `NULL` 。在openGauss dbcompatibility=A的情况下。如果是`pg`兼容模式 `''` ! = `NULL` +Oracle 里 `''` = `NULL` 和 openGauss A兼容模式一致, 和`PG`兼容模式 `''` ! = `NULL` 不一样. DBCOMPATIBILITY [ = ] compatibility_type