Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyehcf committed Nov 21, 2022
1 parent 9790078 commit e9e9813
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions fe/fe-core/src/test/java/com/starrocks/qe/VariableMgrTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ public void testNormal() throws IllegalAccessException, NoSuchFieldException, Us
}

// Set global variable
SetVar setVar = new SetVar(SetType.GLOBAL, "exec_mem_limit", new IntLiteral(1234L));
SetVar setVar = new SetVar(SetType.GLOBAL, "exec_mem_limit", new IntLiteral(12999934L));
setVar.analyze();
VariableMgr.setVar(var, setVar, false);
Assert.assertEquals(1234L, var.getMaxExecMemByte());
Assert.assertEquals(12999934L, var.getMaxExecMemByte());
var = VariableMgr.newSessionVariable();
Assert.assertEquals(1234L, var.getMaxExecMemByte());
Assert.assertEquals(12999934L, var.getMaxExecMemByte());

SetVar setVar2 = new SetVar(SetType.GLOBAL, "parallel_fragment_exec_instance_num", new IntLiteral(5L));
setVar2.analyze();
Expand All @@ -137,18 +137,18 @@ public void testNormal() throws IllegalAccessException, NoSuchFieldException, Us
Assert.assertEquals("CST", var.getTimeZone());

// Set session variable
setVar = new SetVar(SetType.GLOBAL, "exec_mem_limit", new IntLiteral(1234L));
setVar = new SetVar(SetType.GLOBAL, "exec_mem_limit", new IntLiteral(12999934L));
setVar.analyze();
VariableMgr.setVar(var, setVar, false);
Assert.assertEquals(1234L, var.getMaxExecMemByte());
Assert.assertEquals(12999934L, var.getMaxExecMemByte());

// onlySessionVar
setVar = new SetVar(SetType.GLOBAL, "exec_mem_limit", new IntLiteral(4321L));
setVar = new SetVar(SetType.GLOBAL, "exec_mem_limit", new IntLiteral(12999935L));
setVar.analyze();
VariableMgr.setVar(var, setVar, true);
Assert.assertEquals(4321L, var.getMaxExecMemByte());
Assert.assertEquals(12999935L, var.getMaxExecMemByte());
var = VariableMgr.newSessionVariable();
Assert.assertEquals(1234L, var.getMaxExecMemByte());
Assert.assertEquals(12999934L, var.getMaxExecMemByte());

setVar3 = new SetVar(SetType.SESSION, "time_zone", new StringLiteral("Asia/Jakarta"));
setVar3.analyze();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ public void testSqlSelectLimitSession() throws Exception {
Assert.assertTrue(plan.contains("limit: 8888"));
connectContext.getSessionVariable().setSqlSelectLimit(SessionVariable.DEFAULT_SELECT_LIMIT);

connectContext.getSessionVariable().setSqlSelectLimit(-100);
connectContext.getSessionVariable().setSqlSelectLimit(0);
sql = "select * from test_all_type";
plan = getFragmentPlan(sql);
Assert.assertFalse(plan.contains("limit"));
Expand Down

0 comments on commit e9e9813

Please sign in to comment.