[bugfix](set_var) fix sql level exec_mem_limit does not take effect (#25043)

This commit is contained in:
Guangdong Liu
2023-10-07 20:15:25 +08:00
committed by GitHub
parent cb03703990
commit 26bc749afd

View File

@ -380,7 +380,9 @@ public class Coordinator implements CoordInterface {
this.queryOptions.setResourceLimit(resourceLimit);
}
// set exec mem limit
long memLimit = Env.getCurrentEnv().getAuth().getExecMemLimit(qualifiedUser);
long maxExecMemByte = connectContext.getSessionVariable().getMaxExecMemByte();
long memLimit = maxExecMemByte > 0 ? maxExecMemByte :
Env.getCurrentEnv().getAuth().getExecMemLimit(qualifiedUser);
if (memLimit > 0) {
// overwrite the exec_mem_limit from session variable;
this.queryOptions.setMemLimit(memLimit);