docs: static QuerySpecification getCheckSelect(Session session, Table t,
              Expression e) {
  
          CompileContext     compileContext = new CompileContext(session);
          QuerySpecification s = new QuerySpecification(compileContext);
  
          s.exprColumns    = new Expression[1];
          s.exprColumns[0] = EXPR_TRUE;
  
          RangeVariable range = new RangeVariable(t, null, null, null,
              compileContext);
  
          s.rangeVariables = new RangeVariable[]{ range };
  
          HsqlList unresolved = e.resolveColumnReferences(s.rangeVariables,
              null);
  
          ExpressionColumn.checkColumnsResolved(unresolved);
          e.resolveTypes(session, null);
  
          if (Type.SQL_BOOLEAN != e.getDataType()) {
              throw Error.error(ErrorCode.X_42568);
          }
  
          Expression condition = new ExpressionLogical(OpTypes.NOT, e);
  
          s.queryCondition = condition;
  
          s.resolveReferences(session);
          s.resolveTypes(session);
  
          return s;
      }