mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Merge branch 'master' of https://github.com/AlibabaTech/druid
This commit is contained in:
@@ -38,6 +38,7 @@ public class OracleSelectTest34 extends OracleTest {
|
||||
|
||||
OracleSchemaStatVisitor visitor = new OracleSchemaStatVisitor();
|
||||
statemen.accept(visitor);
|
||||
|
||||
|
||||
System.out.println("Tables : " + visitor.getTables());
|
||||
System.out.println("fields : " + visitor.getColumns());
|
||||
|
||||
@@ -27,4 +27,6 @@ public class OracleTest extends TestCase {
|
||||
}
|
||||
System.out.println(text);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -28,4 +28,29 @@ public class SQLLexerTest2 extends TestCase {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void test_lexer2() throws Exception {
|
||||
String sql = "SELECT substr('''a''bc',0,3) FROM dual";
|
||||
Lexer lexer = new Lexer(sql);
|
||||
for (;;) {
|
||||
lexer.nextToken();
|
||||
Token tok = lexer.token();
|
||||
|
||||
if (tok == Token.IDENTIFIER) {
|
||||
System.out.println(tok.name() + "\t\t" + lexer.stringVal());
|
||||
} else if (tok == Token.LITERAL_INT) {
|
||||
System.out.println(tok.name() + "\t\t" + lexer.numberString());
|
||||
} else if (tok == Token.LITERAL_CHARS) {
|
||||
System.out.println(tok.name() + "\t\t" + lexer.stringVal());
|
||||
}
|
||||
else {
|
||||
System.out.println(tok.name() + "\t\t\t" + tok.name);
|
||||
}
|
||||
|
||||
if (tok == Token.EOF) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user