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

The following examples show how to use com.alibaba.druid.sql.dialect.mysql.ast.expr.MySqlCharExpr. 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 File: SetHandler.java    From dble with 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 File: SetHandler.java    From dble with 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 File: MySQLItemVisitor.java    From dble with 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);
}