use of com.alibaba.druid.sql.dialect.postgresql.parser.PGExprParser in project druid by alibaba.
the class BoxTest method test_timestamp.
public void test_timestamp() throws Exception {
String sql = "box '((0,0),(1,1))' + point '(2.0,0)'";
PGExprParser parser = new PGExprParser(sql);
SQLBinaryOpExpr binaryExpr = (SQLBinaryOpExpr) parser.expr();
PGBoxExpr box = (PGBoxExpr) binaryExpr.getLeft();
PGPointExpr point = (PGPointExpr) binaryExpr.getRight();
Assert.assertEquals("BOX '((0,0),(1,1))' + POINT '(2.0,0)'", binaryExpr.toString());
}
use of com.alibaba.druid.sql.dialect.postgresql.parser.PGExprParser in project druid by alibaba.
the class CircleTest method test_timestamp.
public void test_timestamp() throws Exception {
String sql = "circle '((0,0),2)'";
PGExprParser parser = new PGExprParser(sql);
PGCircleExpr expr = (PGCircleExpr) parser.expr();
Assert.assertEquals("circle '((0,0),2)'", expr.toString());
}
use of com.alibaba.druid.sql.dialect.postgresql.parser.PGExprParser in project druid by alibaba.
the class MacAddrTest method test_timestamp.
public void test_timestamp() throws Exception {
String sql = "macaddr '12:34:56:78:90:ab'";
PGExprParser parser = new PGExprParser(sql);
PGMacAddrExpr expr = (PGMacAddrExpr) parser.expr();
Assert.assertEquals("macaddr '12:34:56:78:90:ab'", expr.toString());
}
use of com.alibaba.druid.sql.dialect.postgresql.parser.PGExprParser in project druid by alibaba.
the class BitStringTest method test_timestamp.
public void test_timestamp() throws Exception {
String sql = "B'101'";
PGExprParser parser = new PGExprParser(sql);
SQLBinaryExpr expr = (SQLBinaryExpr) parser.expr();
Assert.assertEquals("B'101'", SQLUtils.toSQLString(expr, JdbcConstants.POSTGRESQL));
}
use of com.alibaba.druid.sql.dialect.postgresql.parser.PGExprParser in project druid by alibaba.
the class BitsTest method test_timestamp.
public void test_timestamp() throws Exception {
String sql = "44::bit(10)";
PGExprParser parser = new PGExprParser(sql);
PGTypeCastExpr expr = (PGTypeCastExpr) parser.expr();
System.out.println(expr.toString());
}
Aggregations