Package com.alibaba.druid.wall.violation

Examples of com.alibaba.druid.wall.violation.IllegalSQLObjectViolation


    }

    @Override
    public boolean visit(SQLSelectStatement x) {
        if (!config.isSelelctAllow()) {
            this.getViolations().add(new IllegalSQLObjectViolation(this.toSQL(x)));
            return false;
        }

        return true;
    }
View Full Code Here


    @Override
    public boolean visit(Limit x) {
        if (x.getRowCount() instanceof SQLNumericLiteralExpr) {
            int rowCount = ((SQLNumericLiteralExpr) x.getRowCount()).getNumber().intValue();
            if (rowCount == 0) {
                this.getViolations().add(new IllegalSQLObjectViolation(this.toSQL(x)));
            }
        }
        return true;
    }
View Full Code Here

        if (varName == null) {
            return false;
        }

        if (config.isVariantCheck() && varName.startsWith("@@")) {
            violations.add(new IllegalSQLObjectViolation(toSQL(x)));
        }

        return false;
    }
View Full Code Here

    }

    @Override
    public boolean visit(MySqlOutFileExpr x) {
        if (!config.isSelectIntoOutfileAllow()) {
            violations.add(new IllegalSQLObjectViolation(toSQL(x)));
        }

        return true;
    }
View Full Code Here

        } else if (x instanceof SQLUpdateStatement) {

        } else if (x instanceof SQLTruncateStatement) {
            if (!config.isTruncateAllow()) {
                violations.add(new IllegalSQLObjectViolation(toSQL(x)));
            }
        } else {
            violations.add(new IllegalSQLObjectViolation(toSQL(x)));
        }
    }
View Full Code Here

    public boolean visit(SQLIdentifierExpr x) {
        String name = x.getName();
        name = WallVisitorUtils.form(name);
        if (config.isVariantCheck() && config.getPermitVariants().contains(name)) {
            getViolations().add(new IllegalSQLObjectViolation(toSQL(x)));
        }
        return true;
    }
View Full Code Here

        } else if (x instanceof SQLDeleteStatement) {

        } else if (x instanceof SQLUpdateStatement) {
        } else if (x instanceof SQLTruncateStatement) {
            if (!config.isTruncateAllow()) {
                violations.add(new IllegalSQLObjectViolation(toSQL(x)));   
            }
        } else {
            violations.add(new IllegalSQLObjectViolation(toSQL(x)));
        }
    }
View Full Code Here

    }

    @Override
    public boolean visit(SQLSelectStatement x) {
        if (!config.isSelelctAllow()) {
            this.getViolations().add(new IllegalSQLObjectViolation(this.toSQL(x)));
            return false;
        }

        return true;
    }
View Full Code Here

    }

    @Override
    public boolean visit(SQLInsertStatement x) {
        if (!config.isInsertAllow()) {
            this.getViolations().add(new IllegalSQLObjectViolation(this.toSQL(x)));
            return false;
        }

        return true;
    }
View Full Code Here

        if (varName == null) {
            return false;
        }

        if (config.isVariantCheck() && varName.startsWith("@@")) {
            violations.add(new IllegalSQLObjectViolation(toSQL(x)));
        }

        return false;
    }
View Full Code Here

TOP

Related Classes of com.alibaba.druid.wall.violation.IllegalSQLObjectViolation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.