mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Merge pull request #567 from yakolee/master
bugfix&update version to 1.0.7
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>1.0.6</version>
|
||||
<version>1.0.7</version>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
<name>druid</name>
|
||||
|
||||
@@ -19,7 +19,7 @@ public final class VERSION {
|
||||
|
||||
public final static int MajorVersion = 1;
|
||||
public final static int MinorVersion = 0;
|
||||
public final static int RevisionVersion = 6;
|
||||
public final static int RevisionVersion = 7;
|
||||
|
||||
public static String getVersionNumber() {
|
||||
return VERSION.MajorVersion + "." + VERSION.MinorVersion + "." + VERSION.RevisionVersion;
|
||||
|
||||
@@ -550,6 +550,10 @@ public class MySqlCreateTableParser extends SQLCreateTableParser {
|
||||
if (lexer.token() == (Token.ON)) {
|
||||
throw new ParserException("TODO");
|
||||
}
|
||||
|
||||
if (lexer.token() == (Token.AS)) {
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
if (lexer.token() == (Token.SELECT)) {
|
||||
SQLSelect query = new MySqlSelectParser(this.exprParser).select();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"use strict";
|
||||
|
||||
var doT = {
|
||||
version: '1.0.6',
|
||||
version: '1.0.7',
|
||||
templateSettings: {
|
||||
evaluate: /\{\{([\s\S]+?\}?)\}\}/g,
|
||||
interpolate: /\{\{=([\s\S]+?)\}\}/g,
|
||||
|
||||
@@ -86,4 +86,24 @@ public class MySqlCreateTableTest extends MysqlTest {
|
||||
Assert.assertEquals(7, visitor.getColumns().size());
|
||||
Assert.assertEquals(0, visitor.getConditions().size());
|
||||
}
|
||||
|
||||
|
||||
public void test_2() throws Exception {
|
||||
String sql = "create table t2 as select * from t1";
|
||||
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
List<SQLStatement> statementList = parser.parseStatementList();
|
||||
SQLStatement statemen = statementList.get(0);
|
||||
print(statementList);
|
||||
|
||||
Assert.assertEquals(1, statementList.size());
|
||||
|
||||
MySqlSchemaStatVisitor visitor = new MySqlSchemaStatVisitor();
|
||||
statemen.accept(visitor);
|
||||
|
||||
System.out.println("Tables : " + visitor.getTables());
|
||||
System.out.println("fields : " + visitor.getColumns());
|
||||
System.out.println("coditions : " + visitor.getConditions());
|
||||
System.out.println("orderBy : " + visitor.getOrderByColumns());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user