fix(odc): enable PG-family queryTableOrViewData for GaussDB / openGauss#21
Merged
Conversation
…ryTableOrViewData Two P0 GaussDB / openGauss issues fixed in a single commit because they are discovered together when opening a table in the Workbench: 1. Bug 4a: column editor "type" dropdown is empty. VersionDiffConfigService.getDatatypeList() returns the rows in odc_version_diff_config keyed by db_mode='GAUSSDB' / config_key= 'column_data_type'. R_2_0_0__initialize_version_diff_config.sql had rows for OB_MYSQL / MYSQL / ORACLE / SQL_SERVER but none for GAUSSDB, so the session's dataTypes list was empty and the column type dropdown rendered no options. Append the GAUSSDB row with the PostgreSQL-compatible type catalog (smallint / integer / decimal / varchar / timestamp / json / ...). R_ prefix is a Flyway repeatable migration; restarting ODC re-applies it. 2. Bug 5: "data" tab fails with 400 "Unsupported dialect type, GAUSSDB". ConnectConsoleService.queryTableOrViewData() picks a SqlBuilder by DialectType but had no branch for GAUSSDB, falling through to the final "Unsupported dialect type" throw. Add an isPgFamily() branch (after isMongoDB()) that reuses MySQLSqlBuilder. The generated "SELECT t.* FROM schema.table t LIMIT n" is valid PostgreSQL syntax, so the same builder works for both GAUSSDB and POSTGRESQL. Refs: actiontech/dms-ee#865
…eOrViewData
Previously the PG-family branch in ConnectConsoleService.queryTableOrViewData
reused MySQLSqlBuilder, which wraps identifiers with back-ticks (`schema`.`table`).
openGauss / GaussDB / PostgreSQL reject back-ticks and return SQLState=42601
syntax error at or near "`" when a user clicks the table 'Data' tab.
Switch the PG-family branch to OracleSqlBuilder, whose identifier() wraps with
ASCII double quotes ("schema"."table"), which is the canonical PostgreSQL
identifier-quoting style. Only identifier() / schemaPrefixIfNotBlank() are used
in this code path; OracleSqlBuilder's other Oracle-specific behaviors
(value quoting, default values, LIKE ESCAPE) are not invoked here, so the reuse
is safe.
Fixes actiontech/dms-ee#865
Seechi-Yolo
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR routes the GaussDB / openGauss / PostgreSQL dialects (PG family) through the queryTableOrViewData path with the correct identifier quoting style and seeds the GAUSSDB column data-type catalog.
isPgFamily()branch inConnectConsoleService.queryTableOrViewData()that usesOracleSqlBuilder.OracleSqlBuilder.identifier()wraps identifiers with double quotes ("schema"."table"), matching PostgreSQL syntax. The previously-activeMySQLSqlBuilderproduced back-tick identifiers and triggeredSQLState=42601 syntax error at or near "\"` on openGauss / GaussDB.column_data_typerow forGAUSSDBin the FlywayR_2_0_0__initialize_version_diff_config.sql(usesON DUPLICATE KEY UPDATE, idempotent B-class seed). Without this rowVersionDiffConfigService.getDatatypeList()returns an empty list for GAUSSDB sessions and the column-editor data-type dropdown is blank.Upstream context: this is part of the cross-repo effort to make the ODC SQL Workbench support GaussDB / openGauss. The DMS side (whitelist +
convertDBTypemapping + static fallback fix) is being merged in actiontech/dms#631 and the SQLE driver-type contract test in actiontech/sqle#3318.Test plan
go vet-equivalent for Java:mvn -pl server/odc-service -am compile -DskipTests-> BUILD SUCCESSmvn -pl server/odc-service test-compile -DskipTests-> BUILD SUCCESSbash skills/odc/script/odc.sh build-backend-> BUILD SUCCESS, fat-jar contains bothMySQLSqlBuilderandOracleSqlBuilderreferences inConnectConsoleService.classdb-browser DmSqlBuilderTest24/24 PASS (identifier quoting path)SELECT t.* FROM "schema"."table" t LIMIT 1000for PG-family vsSELECT t.* FROM \schema`.`table` t LIMIT 1000` for MySQL/odc_query/api/v1/info?notLogin=true) all respondedFixes https://github.com/actiontech/dms-ee/issues/865