Skip to content

Commit

Permalink
sessionctx: change innodb large prefix default (#24555) (#26061)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-srebot committed Jul 14, 2021
1 parent 7874d60 commit e91a8a5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 13 additions & 0 deletions expression/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8238,3 +8238,16 @@ func (s *testIntegrationSuite2) TestIssue25591(c *C) {
rows = tk.MustQuery("select t1.col1, t2.col1, t2.col2 from t1_1 t1 inner join t2_1 t2 on t1.col1 not in (1,t2.col1,t2.col2) order by 1,2,3;")
rows.Check(testkit.Rows())
}

func (s *testIntegrationSuite) TestJiraSetInnoDBDefaultRowFormat(c *C) {
// For issue #23541
// JIRA needs to be able to set this to be happy.
// See: https://nova.moe/run-jira-on-tidb/
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("set global innodb_default_row_format = dynamic")
tk.MustExec("set global innodb_default_row_format = 'dynamic'")
tk.MustQuery("SHOW VARIABLES LIKE 'innodb_default_row_format'").Check(testkit.Rows("innodb_default_row_format dynamic"))
tk.MustQuery("SHOW VARIABLES LIKE 'character_set_server'").Check(testkit.Rows("character_set_server utf8mb4"))
tk.MustQuery("SHOW VARIABLES LIKE 'innodb_file_format'").Check(testkit.Rows("innodb_file_format Barracuda"))
tk.MustQuery("SHOW VARIABLES LIKE 'innodb_large_prefix'").Check(testkit.Rows("innodb_large_prefix ON"))
}
5 changes: 3 additions & 2 deletions sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ var defaultSysVars = []*SysVar{
{ScopeGlobal | ScopeSession, CollationServer, mysql.DefaultCollationName},
{ScopeNone, "have_rtree_keys", "YES"},
{ScopeGlobal, "innodb_old_blocks_pct", "37"},
{ScopeGlobal, "innodb_file_format", "Antelope"},
{ScopeGlobal, "innodb_file_format", "Barracuda"},
{ScopeGlobal, "innodb_default_row_format", "dynamic"},
{ScopeGlobal, "innodb_compression_failure_threshold_pct", "5"},
{ScopeNone, "performance_schema_events_waits_history_long_size", "10000"},
{ScopeGlobal, "innodb_checksum_algorithm", "innodb"},
Expand Down Expand Up @@ -430,7 +431,7 @@ var defaultSysVars = []*SysVar{
{ScopeNone, "version", mysql.ServerVersion},
{ScopeGlobal | ScopeSession, "transaction_alloc_block_size", "8192"},
{ScopeGlobal, "sql_slave_skip_counter", "0"},
{ScopeGlobal, "innodb_large_prefix", "OFF"},
{ScopeGlobal, "innodb_large_prefix", "ON"},
{ScopeNone, "performance_schema_max_cond_classes", "80"},
{ScopeGlobal, "innodb_io_capacity", "200"},
{ScopeGlobal, "max_binlog_cache_size", "18446744073709547520"},
Expand Down

0 comments on commit e91a8a5

Please sign in to comment.