Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: preliminary adaptation of gaussdb #12061

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

shanzhuer
Copy link

Preliminary adaptation of gaussdb, sync, query and modify tested.

@cla-bot cla-bot bot added the cla-signed label May 21, 2024
@ecmadao ecmadao changed the title Preliminary adaptation of gaussdb feat: preliminary adaptation of gaussdb May 21, 2024
# Conflicts:
#	backend/api/v1/database_service.go
#	backend/plugin/parser/pg/completion.go
#	backend/runner/taskrun/executor.go
#	frontend/pnpm-lock.yaml
#	frontend/src/types/proto/google/protobuf/descriptor.ts
#	frontend/src/types/proto/store/common.ts
#	frontend/src/types/proto/v1/common.ts
#	frontend/src/types/sql-review-schema.yaml
#	go.sum
#	proto/generated-go/store/activity.pb.go
#	proto/generated-go/store/approval.pb.go
#	proto/generated-go/store/audit_log.pb.go
#	proto/generated-go/store/branch.pb.go
#	proto/generated-go/store/changelist.pb.go
#	proto/generated-go/store/common.pb.go
#	proto/generated-go/store/data_source.pb.go
#	proto/generated-go/store/database.pb.go
#	proto/generated-go/store/export_archive.pb.go
#	proto/generated-go/store/idp.pb.go
#	proto/generated-go/store/instance.pb.go
#	proto/generated-go/store/instance_change_history.pb.go
#	proto/generated-go/store/issue.pb.go
#	proto/generated-go/store/issue_comment.pb.go
#	proto/generated-go/store/plan.pb.go
#	proto/generated-go/store/plan_check_run.pb.go
#	proto/generated-go/store/policy.pb.go
#	proto/generated-go/store/project.pb.go
#	proto/generated-go/store/query_history.pb.go
#	proto/generated-go/store/role.pb.go
#	proto/generated-go/store/setting.pb.go
#	proto/generated-go/store/sheet.pb.go
#	proto/generated-go/store/slow_query.pb.go
#	proto/generated-go/store/task_run.pb.go
#	proto/generated-go/store/user.pb.go
#	proto/generated-go/store/vcs.pb.go
#	proto/generated-go/v1/actuator_service.pb.go
#	proto/generated-go/v1/anomaly_service.pb.go
#	proto/generated-go/v1/audit_log_service.pb.go
#	proto/generated-go/v1/auth_service.pb.go
#	proto/generated-go/v1/branch_service.pb.go
#	proto/generated-go/v1/cel_service.pb.go
#	proto/generated-go/v1/changelist_service.pb.go
#	proto/generated-go/v1/common.pb.go
#	proto/generated-go/v1/database_service.pb.go
#	proto/generated-go/v1/environment_service.pb.go
#	proto/generated-go/v1/iam_policy.pb.go
#	proto/generated-go/v1/idp_service.pb.go
#	proto/generated-go/v1/instance_role_service.pb.go
#	proto/generated-go/v1/instance_service.pb.go
#	proto/generated-go/v1/issue_service.pb.go
#	proto/generated-go/v1/logging_service.pb.go
#	proto/generated-go/v1/org_policy_service.pb.go
#	proto/generated-go/v1/project_service.pb.go
#	proto/generated-go/v1/risk_service.pb.go
#	proto/generated-go/v1/role_service.pb.go
#	proto/generated-go/v1/rollout_service.pb.go
#	proto/generated-go/v1/setting_service.pb.go
#	proto/generated-go/v1/sheet_service.pb.go
#	proto/generated-go/v1/sql_service.pb.go
#	proto/generated-go/v1/subscription_service.pb.go
#	proto/generated-go/v1/vcs_connector_service.pb.go
#	proto/generated-go/v1/vcs_provider_service.pb.go
#	proto/generated-go/v1/worksheet_service.pb.go
@ecmadao
Copy link
Collaborator

ecmadao commented May 21, 2024

Try to merge this PR shanzhuer#1 to resolve the conflict? @shanzhuer

Copy link

socket-security bot commented May 21, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Install scripts npm/[email protected]

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@shanzhuer
Copy link
Author

Try to merge this PR shanzhuer#1 to resolve the conflict? @shanzhuer

thanks a lot!

replace Postgres comments to GaussDB
Copy link
Author

@shanzhuer shanzhuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solved the 2 problems.

backend/api/lsp/completion.go Show resolved Hide resolved
backend/plugin/db/gauss/gauss.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@ecmadao ecmadao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @rebelice maybe help take a look for the plugin?

scripts/.airnotmin.toml Outdated Show resolved Hide resolved
@rebelice
Copy link
Contributor

Thanks for the contribution.
I'll review this PR in two days. It's so large and hard to review. Maybe take a lot of time.

defer tx.Rollback()
// Set the current transaction role to the database owner so that the owner of created objects will be the same as the database owner.
//if _, err := tx.ExecContext(ctx, fmt.Sprintf("SET SESSION AUTHORIZATION '%s';", owner)); err != nil {
if _, err := tx.ExecContext(ctx, "SET SESSION AUTHORIZATION DEFAULT;"); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems no need to run this statement.

@@ -123,7 +123,7 @@ func (d *DBFactory) GetDataSourceDriver(ctx context.Context, instance *store.Ins
case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
// TODO(d): use maria mysqlbinlog for MariaDB.
dbBinDir = d.mysqlBinDir
case storepb.Engine_POSTGRES, storepb.Engine_RISINGWAVE:
case storepb.Engine_POSTGRES, storepb.Engine_RISINGWAVE, storepb.Engine_GAUSSDB:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GaussDB doesn't use pgBinDir actually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants