Java Code Examples for com.alibaba.druid.sql.dialect.mysql.ast.expr.MySqlCharExpr

The following examples show how to use com.alibaba.druid.sql.dialect.mysql.ast.expr.MySqlCharExpr. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: dble   Source File: SetHandler.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static boolean checkValue(SQLExpr valueExpr, KeyType keyType) {
    if (keyType == KeyType.USER_VARIABLES) {
        return !(valueExpr instanceof SQLQueryExpr);
    }
    return (valueExpr instanceof MySqlCharExpr) || (valueExpr instanceof SQLCharExpr) ||
            (valueExpr instanceof SQLIdentifierExpr) || (valueExpr instanceof SQLIntegerExpr) ||
            (valueExpr instanceof SQLNumberExpr) || (valueExpr instanceof SQLBooleanExpr) ||
            (valueExpr instanceof SQLDefaultExpr) || (valueExpr instanceof SQLNullExpr);
}
 
Example 2
Source Project: dble   Source File: SetHandler.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static String[] parseNamesValue(SQLExpr valueExpr) {
    if (valueExpr instanceof MySqlCharExpr) {
        MySqlCharExpr value = (MySqlCharExpr) valueExpr;
        return new String[]{value.getText().toLowerCase(), StringUtil.removeBackQuote(value.getCollate()).toLowerCase()};
    } else {
        String charset = SetInnerHandler.parseStringValue(valueExpr);
        return new String[]{charset, null};
    }
}
 
Example 3
Source Project: dble   Source File: MySQLItemVisitor.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public void endVisit(MySqlCharExpr x) {
    String value = x.toString();
    item = new ItemString(value);
    item.setItemName(value);
}