Skip to content

Commit 14c4496

Browse files
authored
Revert "cherry-pick sys variables" (#15560)
Reverts #15330
1 parent 95801d8 commit 14c4496

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

pkg/config/configuration.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,6 @@ var (
162162
defaultLoggerLabelKey = "role"
163163
defaultLoggerLabelVal = "logging_cn"
164164

165-
// default sql_mode
166-
dafaultSqlMode = "ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES"
167-
168165
// default lower_case_table_names
169166
defaultLowerCaseTableNames = "1"
170167
)
@@ -290,9 +287,6 @@ type FrontendParameters struct {
290287

291288
// disable select into
292289
DisableSelectInto bool `toml:"disable-select-into"`
293-
294-
// default sql_mode default value
295-
SqlMode string `toml:"sql-mode"`
296290
}
297291

298292
func (fp *FrontendParameters) SetDefaultValues() {
@@ -408,10 +402,6 @@ func (fp *FrontendParameters) SetDefaultValues() {
408402
if fp.CleanKillQueueInterval == 0 {
409403
fp.CleanKillQueueInterval = defaultCleanKillQueueInterval
410404
}
411-
412-
if fp.SqlMode == "" {
413-
fp.SqlMode = dafaultSqlMode
414-
}
415405
}
416406

417407
func (fp *FrontendParameters) SetMaxMessageSize(size uint64) {

pkg/frontend/session.go

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,19 +1856,6 @@ func (ses *Session) InitGlobalSystemVariables() error {
18561856
pu := ses.GetParameterUnit()
18571857
mp := ses.GetMemPool()
18581858

1859-
updateSqls := ses.getUpdateVariableSqlsByToml()
1860-
for _, sql := range updateSqls {
1861-
_, err = executeSQLInBackgroundSession(
1862-
sysTenantCtx,
1863-
ses,
1864-
mp,
1865-
pu,
1866-
sql)
1867-
if err != nil {
1868-
return err
1869-
}
1870-
}
1871-
18721859
rsset, err = executeSQLInBackgroundSession(
18731860
sysTenantCtx,
18741861
ses,
@@ -1915,19 +1902,6 @@ func (ses *Session) InitGlobalSystemVariables() error {
19151902
pu := ses.GetParameterUnit()
19161903
mp := ses.GetMemPool()
19171904

1918-
updateSqls := ses.getUpdateVariableSqlsByToml()
1919-
for _, sql := range updateSqls {
1920-
_, err = executeSQLInBackgroundSession(
1921-
tenantCtx,
1922-
ses,
1923-
mp,
1924-
pu,
1925-
sql)
1926-
if err != nil {
1927-
return err
1928-
}
1929-
}
1930-
19311905
rsset, err = executeSQLInBackgroundSession(
19321906
tenantCtx,
19331907
ses,
@@ -1969,24 +1943,6 @@ func (ses *Session) InitGlobalSystemVariables() error {
19691943
return err
19701944
}
19711945

1972-
func (ses *Session) getUpdateVariableSqlsByToml() []string {
1973-
updateSqls := make([]string, 0)
1974-
tenantInfo := ses.GetTenantInfo()
1975-
// sql_mode
1976-
if getVariableValue(ses.pu.SV.SqlMode) != gSysVarsDefs["sql_mode"].Default {
1977-
sqlForUpdate := getSqlForUpdateSystemVariableValue(ses.pu.SV.SqlMode, uint64(tenantInfo.GetTenantID()), "sql_mode")
1978-
updateSqls = append(updateSqls, sqlForUpdate)
1979-
}
1980-
1981-
// lower_case_table_names
1982-
if getVariableValue(ses.pu.SV.LowerCaseTableNames) != gSysVarsDefs["lower_case_table_names"].Default {
1983-
sqlForUpdate := getSqlForUpdateSystemVariableValue(getVariableValue(ses.pu.SV.LowerCaseTableNames), uint64(tenantInfo.GetTenantID()), "lower_case_table_names")
1984-
updateSqls = append(updateSqls, sqlForUpdate)
1985-
}
1986-
1987-
return updateSqls
1988-
}
1989-
19901946
func (ses *Session) GetPrivilege() *privilege {
19911947
ses.mu.Lock()
19921948
defer ses.mu.Unlock()

0 commit comments

Comments
 (0)