Skip to content

Commit

Permalink
fix incorrect version (#13500) (#13710)
Browse files Browse the repository at this point in the history
cp #13500

Co-authored-by: YANGGMM <[email protected]>
  • Loading branch information
sukki37 and YANGGMM authored Dec 21, 2023
1 parent d301ea6 commit 9d710a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/frontend/authenticate.go
Original file line number Diff line number Diff line change
Expand Up @@ -8685,7 +8685,7 @@ func insertRecordToMoMysqlCompatibilityMode(ctx context.Context, ses *Session, s
var dbName string
var err error
variableName := "version_compatibility"
variableValue := "0.7"
variableValue := getVariableValue(ses.GetSysVar("version"))

if createDatabaseStmt, ok := stmt.(*tree.CreateDatabase); ok {
dbName = string(createDatabaseStmt.Name)
Expand Down
12 changes: 6 additions & 6 deletions test/distributed/cases/database/config.result
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ drop database if exists test;
create database test;
select `variable_value` from mo_catalog.mo_mysql_compatibility_mode where dat_name ="test";
variable_value
0.7
8.0.30-MatrixOne-v1.0.0
alter database test set mysql_compatibility_mode = '8.0.30-MatrixOne-v0.7.0';
select `variable_value` from mo_catalog.mo_mysql_compatibility_mode where dat_name ="test";
variable_value
Expand All @@ -13,7 +13,7 @@ create database test;
use test;
select version();
version()
0.7
8.0.30-MatrixOne-v1.0.0
alter database test set mysql_compatibility_mode = '8.0.30-MatrixOne-v0.7.0';
select version();
version()
Expand All @@ -28,20 +28,20 @@ create database test1;
use test;
select version();
version()
0.7
8.0.30-MatrixOne-v1.0.0
alter database test set mysql_compatibility_mode = '8.0.30-MatrixOne-v0.7.0';
select version();
version()
8.0.30-MatrixOne-v0.7.0
use test1;
select version();
version()
0.7
8.0.30-MatrixOne-v1.0.0
alter account config abc set mysql_compatibility_mode = '8.0.30-MatrixOne-v0.8.0';
internal error: do not have privileges to alter account config
select version();
version()
0.7
8.0.30-MatrixOne-v1.0.0
drop database test;
drop database test1;
drop account abc;
Expand Down Expand Up @@ -90,4 +90,4 @@ SELECT @@GLOBAL.sql_mode;
@@sql_mode
STRICT_TRANS_TABLES
set global sql_mode = "ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES";
drop account abc;
drop account abc;
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Tables_in_res_test Table_type
r_test BASE TABLE
select version();
version()
0.7
8.0.30-MatrixOne-v1.0.0
alter database test set mysql_compatibility_mode = '8.0.30-MatrixOne-v0.7.0';
internal error: do not have privilege to execute the statement
select privilege_name, obj_type, privilege_level from mo_catalog.mo_role_privs where privilege_name = 'values';
Expand Down

0 comments on commit 9d710a8

Please sign in to comment.