Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,15 @@ insert into `odc_version_diff_config`(`config_key`,`db_mode`,`config_value`,`min
'bit:NUMERIC, tinyint:NUMERIC, smallint:NUMERIC, int:NUMERIC, bigint:NUMERIC, decimal:NUMERIC, numeric:NUMERIC, float:NUMERIC, real:NUMERIC, money:NUMERIC, smallmoney:NUMERIC, char:TEXT, varchar:TEXT, nchar:TEXT, nvarchar:TEXT, text:OBJECT, ntext:OBJECT, binary:TEXT, varbinary:TEXT, image:OBJECT, date:DATE, time:TIME, datetime:DATETIME, datetime2:DATETIME, smalldatetime:DATETIME, datetimeoffset:TIMESTAMP, timestamp:OBJECT, uniqueidentifier:OBJECT, xml:OBJECT, sql_variant:OBJECT, hierarchyid:OBJECT, geography:OBJECT, geometry:OBJECT', '0', CURRENT_TIMESTAMP) ON DUPLICATE KEY update `config_key`=`config_key`;
insert into `odc_version_diff_config`(`config_key`,`db_mode`,`config_value`,`min_version`,`gmt_create`) values('support_view','SQL_SERVER','true','0',CURRENT_TIMESTAMP) ON DUPLICATE KEY update `config_key`=`config_key`;
insert into `odc_version_diff_config`(`config_key`,`db_mode`,`config_value`,`min_version`,`gmt_create`) values('support_procedure','SQL_SERVER','true','0',CURRENT_TIMESTAMP) ON DUPLICATE KEY update `config_key`=`config_key`;
insert into `odc_version_diff_config`(`config_key`,`db_mode`,`config_value`,`min_version`,`gmt_create`) values('support_function','SQL_SERVER','true','0',CURRENT_TIMESTAMP) ON DUPLICATE KEY update `config_key`=`config_key`;
insert into `odc_version_diff_config`(`config_key`,`db_mode`,`config_value`,`min_version`,`gmt_create`) values('support_function','SQL_SERVER','true','0',CURRENT_TIMESTAMP) ON DUPLICATE KEY update `config_key`=`config_key`;

-- GaussDB / openGauss column data types (PostgreSQL-compatible)
-- Required so VersionDiffConfigService.getDatatypeList() returns a non-empty list for GAUSSDB sessions.
-- Without this row, session.dataTypes is empty and the column editor's data type dropdown shows no options.
insert into `odc_version_diff_config`(`config_key`,`db_mode`,`config_value`,`min_version`,`gmt_create`) values(
'column_data_type',
'GAUSSDB',
'smallint:NUMERIC, integer:NUMERIC, int:NUMERIC, bigint:NUMERIC, decimal:NUMERIC, numeric:NUMERIC, real:NUMERIC, float:NUMERIC, serial:NUMERIC, bigserial:NUMERIC, char:TEXT, varchar:TEXT, text:OBJECT, bytea:OBJECT, boolean:NUMERIC, date:DATE, time:TIME, timestamp:TIMESTAMP, timestamptz:TIMESTAMP, interval:TEXT, json:OBJECT, jsonb:OBJECT, uuid:OBJECT',
'1.0',
CURRENT_TIMESTAMP
) ON DUPLICATE KEY UPDATE `config_key`=`config_key`;
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,18 @@ public SqlExecuteResult queryTableOrViewData(@NotNull String sessionId,
asyncExecuteReq.setContinueExecutionOnError(true);
asyncExecuteReq.setFullLinkTraceEnabled(false);
return executeQueryTableOrViewData(sessionId, connectionSession, asyncExecuteReq);
} else if (dialectType.isPgFamily()) {
// GaussDB / openGauss / PostgreSQL use PostgreSQL wire protocol, where identifiers
// are quoted with double quotes (e.g. "schema"."table"), NOT MySQL back-ticks.
// Reusing MySQLSqlBuilder here previously produced
// SELECT t.* FROM `schema`.`table` t LIMIT 1000
// which triggered SQLState=42601 syntax error at or near "`" against openGauss.
// OracleSqlBuilder.identifier() wraps identifiers with '"' (see
// StringUtils.ORACLE_IDENTIFIER_WRAP_CHAR), which is exactly what PG expects.
// Only identifier() / schemaPrefixIfNotBlank() are exercised below, so the rest of
// OracleSqlBuilder's Oracle-specific behavior (value quoting, default values,
// LIKE ESCAPE) is never invoked here and is therefore safe to reuse.
sqlBuilder = new OracleSqlBuilder();
} else {
throw new IllegalArgumentException("Unsupported dialect type, " + dialectType);
}
Expand Down