Skip to content

Commit

Permalink
Merge pull request alibaba#567 from yakolee/master
Browse files Browse the repository at this point in the history
bugfix&update version to 1.0.7
  • Loading branch information
yakolee committed Jun 17, 2014
2 parents b8293d4 + 7c31153 commit c038aea
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/alibaba/druid/VERSION.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@ public MySqlCreateTableStatement parseCrateTable(boolean acceptCreate) {
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();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/support/http/resources/js/doT.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,24 @@ public void test_1() throws Exception {
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());
}
}

0 comments on commit c038aea

Please sign in to comment.