radondb / radon

RadonDB is an open source, cloud-native MySQL database for building global, scalable cloud services
https://radondb.io/
GNU General Public License v3.0
1.8k stars 217 forks source link

*.: add support for alter database stmt #691 #712

Closed hustjieke closed 3 years ago

hustjieke commented 3 years ago

[summary] add "ALTER DATABASE Statement", For MySQL 8.0, support new option "ENCRYPTION" and "READ ONLY " and no longer support "UPGRADE DATA DIRECTORY NAME" feature in 5.7. see:https://dev.mysql.com/doc/refman/8.0/en/alter-database.html

ALTER {DATABASE | SCHEMA} [db_name]
    alter_option ...

alter_option: {
    [DEFAULT] CHARACTER SET [=] charset_name
  | [DEFAULT] COLLATE [=] collation_name
  | [DEFAULT] ENCRYPTION [=] {'Y' | 'N'}
  | READ ONLY [=] {DEFAULT | 0 | 1}
}

[test case] src/proxy/ddl_test.go src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ddl_test.go

[patch codecov] src/proxy/ddl.go 93.9% src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 96.8% src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast_funcs.go 95.5%

codecov[bot] commented 3 years ago

Codecov Report

Merging #712 (dfbf5fe) into master (ed3d531) will increase coverage by 0%. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #712   +/-   ##
=====================================
  Coverage      89%    89%           
=====================================
  Files         131    131           
  Lines        9271   9284   +13     
=====================================
+ Hits         8254   8278   +24     
+ Misses        674    666    -8     
+ Partials      343    340    -3     
Impacted Files Coverage Δ
src/proxy/ddl.go 91% <100%> (+<1%) :arrow_up:
src/executor/engine/merge_join.go 96% <0%> (+1%) :arrow_up:
src/backend/queryz.go 90% <0%> (+3%) :arrow_up:
src/backend/pool.go 91% <0%> (+3%) :arrow_up:
src/backend/connection.go 92% <0%> (+4%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ed3d531...dfbf5fe. Read the comment docs.

BohuTANG commented 3 years ago

LGTM