All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sqlancer.tidb.ast.TiDBOrderingTerm Maven / Gradle / Ivy

Go to download

SQLancer finds logic bugs in Database Management Systems through automatic testing

There is a newer version: 2.0.0
Show newest version
package sqlancer.tidb.ast;

import sqlancer.common.visitor.UnaryOperation;

public class TiDBOrderingTerm implements UnaryOperation, TiDBExpression {

    private final TiDBExpression expr;
    private final boolean asc;

    public TiDBOrderingTerm(TiDBExpression expr, boolean asc) {
        this.expr = expr;
        this.asc = asc;
    }

    @Override
    public TiDBExpression getExpression() {
        return expr;
    }

    @Override
    public String getOperatorRepresentation() {
        return asc ? "ASC" : "DESC";
    }

    @Override
    public OperatorKind getOperatorKind() {
        return OperatorKind.POSTFIX;
    }

    @Override
    public boolean omitBracketsWhenPrinting() {
        return true;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy