mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add testcase & remove unused code
This commit is contained in:
-21
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.mysql.ast.statement;
|
||||
|
||||
|
||||
public class MySqlCreateDatabaseStatement {
|
||||
|
||||
}
|
||||
+1
-1
@@ -203,7 +203,7 @@ public class MySqlCreateTableParser extends SQLCreateTableParser {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (identifierEquals("COMMENT")) {
|
||||
if (lexer.token() == Token.COMMENT) {
|
||||
lexer.nextToken();
|
||||
if (lexer.token() == Token.EQ) {
|
||||
lexer.nextToken();
|
||||
|
||||
@@ -553,7 +553,7 @@ public class MySqlExprParser extends SQLExprParser {
|
||||
throw new ParserException("syntax error " + lexer.token() + " " + lexer.stringVal());
|
||||
}
|
||||
|
||||
if (identifierEquals("COMMENT")) {
|
||||
if (lexer.token() == Token.COMMENT) {
|
||||
lexer.nextToken();
|
||||
column.setComment(lexer.stringVal());
|
||||
accept(Token.LITERAL_CHARS);
|
||||
|
||||
@@ -2400,7 +2400,6 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
|
||||
} else if (identifierEquals("COALESCE")) {
|
||||
throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
|
||||
|
||||
} else if (identifierEquals("REORGANIZE")) {
|
||||
throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
|
||||
} else if (identifierEquals("EXCHANGE")) {
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.oracle.ast.stmt;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLExprImpl;
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.dialect.oracle.visitor.OracleASTVisitor;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
public class OracleTableExpr extends SQLExprImpl {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private SQLExpr table;
|
||||
private String dbLink;
|
||||
private SQLName partition;
|
||||
private SQLName subPartition;
|
||||
private final List<SQLName> partitionFor = new ArrayList<SQLName>(1);
|
||||
private final List<SQLName> subPartitionFor = new ArrayList<SQLName>(1);
|
||||
|
||||
public OracleTableExpr(){
|
||||
|
||||
}
|
||||
|
||||
public SQLName getPartition() {
|
||||
return this.partition;
|
||||
}
|
||||
|
||||
public void setPartition(SQLName partition) {
|
||||
this.partition = partition;
|
||||
}
|
||||
|
||||
public SQLName getSubPartition() {
|
||||
return this.subPartition;
|
||||
}
|
||||
|
||||
public void setSubPartition(SQLName subPartition) {
|
||||
this.subPartition = subPartition;
|
||||
}
|
||||
|
||||
public List<SQLName> getSubPartitionFor() {
|
||||
return this.subPartitionFor;
|
||||
}
|
||||
|
||||
public List<SQLName> getPartitionFor() {
|
||||
return this.partitionFor;
|
||||
}
|
||||
|
||||
public SQLExpr getTable() {
|
||||
return this.table;
|
||||
}
|
||||
|
||||
public void setTable(SQLExpr table) {
|
||||
this.table = table;
|
||||
}
|
||||
|
||||
public String getDbLink() {
|
||||
return this.dbLink;
|
||||
}
|
||||
|
||||
public void setDbLink(String dbLink) {
|
||||
this.dbLink = dbLink;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
this.accept0((OracleASTVisitor) visitor);
|
||||
}
|
||||
|
||||
protected void accept0(OracleASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, this.table);
|
||||
}
|
||||
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((dbLink == null) ? 0 : dbLink.hashCode());
|
||||
result = prime * result + ((partition == null) ? 0 : partition.hashCode());
|
||||
result = prime * result + ((partitionFor == null) ? 0 : partitionFor.hashCode());
|
||||
result = prime * result + ((subPartition == null) ? 0 : subPartition.hashCode());
|
||||
result = prime * result + ((subPartitionFor == null) ? 0 : subPartitionFor.hashCode());
|
||||
result = prime * result + ((table == null) ? 0 : table.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
OracleTableExpr other = (OracleTableExpr) obj;
|
||||
if (dbLink == null) {
|
||||
if (other.dbLink != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!dbLink.equals(other.dbLink)) {
|
||||
return false;
|
||||
}
|
||||
if (partition == null) {
|
||||
if (other.partition != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!partition.equals(other.partition)) {
|
||||
return false;
|
||||
}
|
||||
if (partitionFor == null) {
|
||||
if (other.partitionFor != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!partitionFor.equals(other.partitionFor)) {
|
||||
return false;
|
||||
}
|
||||
if (subPartition == null) {
|
||||
if (other.subPartition != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!subPartition.equals(other.subPartition)) {
|
||||
return false;
|
||||
}
|
||||
if (subPartitionFor == null) {
|
||||
if (other.subPartitionFor != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!subPartitionFor.equals(other.subPartitionFor)) {
|
||||
return false;
|
||||
}
|
||||
if (table == null) {
|
||||
if (other.table != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!table.equals(other.table)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.oracle.ast.stmt;
|
||||
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.OracleSQLObjectImpl;
|
||||
|
||||
public abstract class OracleUpdateSetClause extends OracleSQLObjectImpl {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public OracleUpdateSetClause(){
|
||||
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.oracle.ast.stmt;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.dialect.oracle.visitor.OracleASTVisitor;
|
||||
|
||||
public class OracleUpdateSetListClause extends OracleUpdateSetClause {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final List<OracleUpdateSetListItem> items = new ArrayList<OracleUpdateSetListItem>();
|
||||
|
||||
public OracleUpdateSetListClause(){
|
||||
|
||||
}
|
||||
|
||||
public List<OracleUpdateSetListItem> getItems() {
|
||||
return this.items;
|
||||
}
|
||||
|
||||
public void accept0(OracleASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, this.items);
|
||||
}
|
||||
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.oracle.ast.stmt;
|
||||
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.OracleSQLObjectImpl;
|
||||
|
||||
public abstract class OracleUpdateSetListItem extends OracleSQLObjectImpl {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public OracleUpdateSetListItem(){
|
||||
|
||||
}
|
||||
}
|
||||
-59
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.oracle.ast.stmt;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.dialect.oracle.visitor.OracleASTVisitor;
|
||||
|
||||
public class OracleUpdateSetListMultiColumnItem extends OracleUpdateSetListItem {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final List<SQLName> columns = new ArrayList<SQLName>();
|
||||
private OracleSelect subQuery;
|
||||
|
||||
public OracleUpdateSetListMultiColumnItem(){
|
||||
|
||||
}
|
||||
|
||||
public OracleUpdateSetListMultiColumnItem(OracleSelect subQuery){
|
||||
|
||||
this.subQuery = subQuery;
|
||||
}
|
||||
|
||||
public void accept0(OracleASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, this.subQuery);
|
||||
}
|
||||
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
public OracleSelect getSubQuery() {
|
||||
return this.subQuery;
|
||||
}
|
||||
|
||||
public void setSubQuery(OracleSelect subQuery) {
|
||||
this.subQuery = subQuery;
|
||||
}
|
||||
|
||||
public List<SQLName> getColumns() {
|
||||
return this.columns;
|
||||
}
|
||||
}
|
||||
-56
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.oracle.ast.stmt;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.visitor.OracleASTVisitor;
|
||||
|
||||
public class OracleUpdateSetListSingleColumnItem extends OracleUpdateSetListItem {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private SQLExpr column;
|
||||
private SQLExpr value;
|
||||
|
||||
public OracleUpdateSetListSingleColumnItem(){
|
||||
|
||||
}
|
||||
|
||||
public void accept0(OracleASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, this.column);
|
||||
acceptChild(visitor, this.value);
|
||||
}
|
||||
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
public SQLExpr getColumn() {
|
||||
return this.column;
|
||||
}
|
||||
|
||||
public void setColumn(SQLExpr column) {
|
||||
this.column = column;
|
||||
}
|
||||
|
||||
public SQLExpr getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public void setValue(SQLExpr value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.oracle.ast.stmt;
|
||||
|
||||
import com.alibaba.druid.sql.dialect.oracle.visitor.OracleASTVisitor;
|
||||
|
||||
public class OracleUpdateSetValueClause extends OracleUpdateSetClause {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public OracleUpdateSetValueClause(){
|
||||
|
||||
}
|
||||
|
||||
public void accept0(OracleASTVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.oracle.visitor;
|
||||
|
||||
import com.alibaba.druid.sql.ast.expr.SQLObjectCreateExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.OracleDataTypeIntervalDay;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.OracleDataTypeIntervalYear;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.OracleDataTypeTimestamp;
|
||||
@@ -117,12 +116,7 @@ import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectSubqueryTableSo
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectTableReference;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectUnPivot;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSetTransactionStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTableExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTruncateStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListClause;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListMultiColumnItem;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListSingleColumnItem;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetValueClause;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateStatement;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
@@ -148,8 +142,6 @@ public interface OracleASTVisitor extends SQLASTVisitor {
|
||||
|
||||
void endVisit(OracleIntervalExpr x);
|
||||
|
||||
void endVisit(SQLObjectCreateExpr x);
|
||||
|
||||
void endVisit(OracleOrderBy x);
|
||||
|
||||
void endVisit(OracleOuterExpr x);
|
||||
@@ -174,18 +166,8 @@ public interface OracleASTVisitor extends SQLASTVisitor {
|
||||
|
||||
void endVisit(OracleSelectUnPivot x);
|
||||
|
||||
void endVisit(OracleTableExpr x);
|
||||
|
||||
void endVisit(OracleTimestampExpr x);
|
||||
|
||||
void endVisit(OracleUpdateSetListClause x);
|
||||
|
||||
void endVisit(OracleUpdateSetListMultiColumnItem x);
|
||||
|
||||
void endVisit(OracleUpdateSetListSingleColumnItem x);
|
||||
|
||||
void endVisit(OracleUpdateSetValueClause x);
|
||||
|
||||
void endVisit(OracleUpdateStatement x);
|
||||
|
||||
boolean visit(OracleAggregateExpr astNode);
|
||||
@@ -208,8 +190,6 @@ public interface OracleASTVisitor extends SQLASTVisitor {
|
||||
|
||||
boolean visit(OracleIntervalExpr x);
|
||||
|
||||
boolean visit(SQLObjectCreateExpr x);
|
||||
|
||||
boolean visit(OracleOrderBy x);
|
||||
|
||||
boolean visit(OracleOuterExpr x);
|
||||
@@ -234,18 +214,8 @@ public interface OracleASTVisitor extends SQLASTVisitor {
|
||||
|
||||
boolean visit(OracleSelectUnPivot x);
|
||||
|
||||
boolean visit(OracleTableExpr x);
|
||||
|
||||
boolean visit(OracleTimestampExpr x);
|
||||
|
||||
boolean visit(OracleUpdateSetListClause x);
|
||||
|
||||
boolean visit(OracleUpdateSetListMultiColumnItem x);
|
||||
|
||||
boolean visit(OracleUpdateSetListSingleColumnItem x);
|
||||
|
||||
boolean visit(OracleUpdateSetValueClause x);
|
||||
|
||||
boolean visit(OracleUpdateStatement x);
|
||||
|
||||
boolean visit(SampleClause x);
|
||||
|
||||
+6
-78
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.oracle.visitor;
|
||||
|
||||
import com.alibaba.druid.sql.ast.expr.SQLObjectCreateExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.OracleDataTypeIntervalDay;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.OracleDataTypeIntervalYear;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.OracleDataTypeTimestamp;
|
||||
@@ -129,12 +128,7 @@ import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectSubqueryTableSo
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectTableReference;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectUnPivot;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSetTransactionStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTableExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTruncateStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListClause;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListMultiColumnItem;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListSingleColumnItem;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetValueClause;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateStatement;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitorAdapter;
|
||||
|
||||
@@ -197,11 +191,6 @@ public class OracleASTVisitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(SQLObjectCreateExpr x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleOrderBy x) {
|
||||
|
||||
@@ -262,36 +251,11 @@ public class OracleASTVisitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleTableExpr x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleTimestampExpr x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleUpdateSetListClause x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleUpdateSetListMultiColumnItem x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleUpdateSetListSingleColumnItem x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleUpdateSetValueClause x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleUpdateStatement x) {
|
||||
|
||||
@@ -357,12 +321,6 @@ public class OracleASTVisitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(SQLObjectCreateExpr x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleOrderBy x) {
|
||||
|
||||
@@ -435,42 +393,12 @@ public class OracleASTVisitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleTableExpr x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleTimestampExpr x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleUpdateSetListClause x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleUpdateSetListMultiColumnItem x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleUpdateSetListSingleColumnItem x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleUpdateSetValueClause x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleUpdateStatement x) {
|
||||
|
||||
@@ -1384,7 +1312,7 @@ public class OracleASTVisitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleCreateDatabaseDbLinkStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1394,7 +1322,7 @@ public class OracleASTVisitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDropDatabaseLinkStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1404,7 +1332,7 @@ public class OracleASTVisitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDataTypeTimestamp x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1414,7 +1342,7 @@ public class OracleASTVisitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDataTypeIntervalYear x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1424,7 +1352,7 @@ public class OracleASTVisitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDataTypeIntervalDay x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1434,7 +1362,7 @@ public class OracleASTVisitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDropSequenceStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+24
-115
@@ -19,7 +19,6 @@ import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLHint;
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.ast.SQLObject;
|
||||
import com.alibaba.druid.sql.ast.SQLSetQuantifier;
|
||||
import com.alibaba.druid.sql.ast.SQLStatement;
|
||||
@@ -27,7 +26,6 @@ import com.alibaba.druid.sql.ast.expr.SQLAllColumnExpr;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLLiteralExpr;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLMethodInvokeExpr;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLObjectCreateExpr;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLQueryExpr;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLAlterTableItem;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLCharactorDataType;
|
||||
@@ -159,12 +157,7 @@ import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectSubqueryTableSo
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectTableReference;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectUnPivot;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSetTransactionStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTableExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTruncateStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListClause;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListMultiColumnItem;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListSingleColumnItem;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetValueClause;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateStatement;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTOutputVisitor;
|
||||
|
||||
@@ -752,35 +745,6 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(OracleTableExpr x) {
|
||||
x.getTable().accept(this);
|
||||
|
||||
if (x.getPartition() != null) {
|
||||
print(" PARTITION (");
|
||||
x.getPartition().accept(this);
|
||||
print(")");
|
||||
} else {
|
||||
if (x.getPartitionFor().size() > 0) {
|
||||
print(" PARTITION FOR (");
|
||||
for (int i = 0, size = x.getPartitionFor().size(); i < size; ++i) {
|
||||
((SQLName) x.getPartitionFor().get(i)).accept(this);
|
||||
}
|
||||
print(")");
|
||||
} else if (x.getSubPartition() != null) {
|
||||
print(" SUBPARTITION (");
|
||||
x.getSubPartition().accept(this);
|
||||
print(")");
|
||||
} else if (x.getSubPartitionFor().size() > 0) {
|
||||
print(" SUBPARTITION FOR (");
|
||||
for (int i = 0, size = x.getSubPartitionFor().size(); i < size; ++i) {
|
||||
((SQLName) x.getSubPartitionFor().get(i)).accept(this);
|
||||
}
|
||||
print(")");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(OracleTimestampExpr x) {
|
||||
print("TIMESTAMP '");
|
||||
|
||||
@@ -796,32 +760,6 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(OracleUpdateSetListClause x) {
|
||||
print("SET ");
|
||||
printAndAccept(x.getItems(), ", ");
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(OracleUpdateSetListMultiColumnItem x) {
|
||||
print("(");
|
||||
printAndAccept(x.getColumns(), ", ");
|
||||
print(") = (");
|
||||
x.getSubQuery().accept(this);
|
||||
print(")");
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(OracleUpdateSetListSingleColumnItem x) {
|
||||
x.getColumn().accept(this);
|
||||
print(" = ");
|
||||
x.getValue().accept(this);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(OracleUpdateSetValueClause x) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public boolean visit(OracleUpdateStatement x) {
|
||||
print("UPDATE ");
|
||||
printHints(x.getHints());
|
||||
@@ -921,11 +859,6 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(SQLObjectCreateExpr x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleOrderBy x) {
|
||||
|
||||
@@ -986,36 +919,12 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleTableExpr x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleTimestampExpr x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleUpdateSetListClause x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleUpdateSetListMultiColumnItem x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleUpdateSetListSingleColumnItem x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleUpdateSetValueClause x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleUpdateStatement x) {
|
||||
|
||||
@@ -3040,25 +2949,25 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
if (x.isShared()) {
|
||||
print("SHARE ");
|
||||
}
|
||||
|
||||
|
||||
if (x.isPublic()) {
|
||||
print("PUBLIC ");
|
||||
}
|
||||
|
||||
|
||||
print("DATABASE LINK ");
|
||||
|
||||
|
||||
x.getName().accept(this);
|
||||
|
||||
|
||||
if (x.getUser() != null) {
|
||||
print(" CONNECT TO ");
|
||||
x.getUser().accept(this);
|
||||
|
||||
|
||||
if (x.getPassword() != null) {
|
||||
print(" IDENTIFIED BY ");
|
||||
print(x.getPassword());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (x.getAuthenticatedUser() != null) {
|
||||
print(" AUTHENTICATED BY ");
|
||||
x.getAuthenticatedUser().accept(this);
|
||||
@@ -3067,18 +2976,18 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
print(x.getAuthenticatedPassword());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (x.getUsing() != null) {
|
||||
print(" USING ");
|
||||
x.getUsing().accept(this);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleCreateDatabaseDbLinkStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -3089,15 +2998,15 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
}
|
||||
print("DATABASE LINK ");
|
||||
x.getName().accept(this);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDropDatabaseLinkStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public boolean visit(SQLCharactorDataType x) {
|
||||
print(x.getName());
|
||||
if (x.getArguments().size() > 0) {
|
||||
@@ -3120,19 +3029,19 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
x.getArguments().get(0).accept(this);
|
||||
print(")");
|
||||
}
|
||||
|
||||
|
||||
if (x.isWithTimeZone()) {
|
||||
print(" WITH TIME ZONE");
|
||||
} else if (x.isWithLocalTimeZone()) {
|
||||
print(" WITH LOCAL TIME ZONE");
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDataTypeTimestamp x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -3143,15 +3052,15 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
x.getArguments().get(0).accept(this);
|
||||
print(")");
|
||||
}
|
||||
|
||||
|
||||
print(" TO MONTH");
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDataTypeIntervalYear x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -3162,23 +3071,23 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
x.getArguments().get(0).accept(this);
|
||||
print(")");
|
||||
}
|
||||
|
||||
|
||||
print(" TO SECOND");
|
||||
|
||||
|
||||
if (x.getFractionalSeconds().size() > 0) {
|
||||
print("(");
|
||||
x.getFractionalSeconds().get(0).accept(this);
|
||||
print(")");
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDataTypeIntervalDay x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleDropSequenceStatement x) {
|
||||
print("DROP SEQUENCE ");
|
||||
@@ -3188,6 +3097,6 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDropSequenceStatement x) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+6
-79
@@ -26,7 +26,6 @@ import com.alibaba.druid.sql.ast.SQLOrderBy;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLAggregateExpr;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLMethodInvokeExpr;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLObjectCreateExpr;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLPropertyExpr;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLColumnDefinition;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLCreateTableStatement;
|
||||
@@ -150,12 +149,7 @@ import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectSubqueryTableSo
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectTableReference;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectUnPivot;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSetTransactionStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTableExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTruncateStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListClause;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListMultiColumnItem;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListSingleColumnItem;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetValueClause;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateStatement;
|
||||
import com.alibaba.druid.sql.visitor.SchemaStatVisitor;
|
||||
import com.alibaba.druid.stat.TableStat;
|
||||
@@ -447,11 +441,6 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(SQLObjectCreateExpr x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleOrderBy x) {
|
||||
|
||||
@@ -512,36 +501,11 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleTableExpr x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleTimestampExpr x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleUpdateSetListClause x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleUpdateSetListMultiColumnItem x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleUpdateSetListSingleColumnItem x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleUpdateSetValueClause x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleConstraintState astNode) {
|
||||
|
||||
@@ -590,12 +554,6 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(SQLObjectCreateExpr x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleOrderBy x) {
|
||||
return this.visit((SQLOrderBy) x);
|
||||
@@ -718,39 +676,8 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleTableExpr x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleTimestampExpr x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleUpdateSetListClause x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleUpdateSetListMultiColumnItem x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleUpdateSetListSingleColumnItem x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleUpdateSetValueClause x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1824,7 +1751,7 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDropDatabaseLinkStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1834,7 +1761,7 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDataTypeTimestamp x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1844,7 +1771,7 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDataTypeIntervalYear x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1854,9 +1781,9 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDataTypeIntervalDay x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleDropSequenceStatement x) {
|
||||
return false;
|
||||
@@ -1864,6 +1791,6 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDropSequenceStatement x) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.postgresql.ast;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLObjectImpl;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGExpr;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.visitor.PGASTVisitor;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class PGAnalyticWindowing extends SQLObjectImpl implements PGExpr {
|
||||
|
||||
private Type type;
|
||||
private SQLExpr expr;
|
||||
|
||||
public PGAnalyticWindowing(){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
this.accept0((PGASTVisitor) visitor);
|
||||
}
|
||||
|
||||
public void accept0(PGASTVisitor visitor) {
|
||||
//TODO
|
||||
// if (visitor.visit(this)) {
|
||||
// acceptChild(visitor, this.expr);
|
||||
// }
|
||||
// visitor.endVisit(this);
|
||||
}
|
||||
|
||||
public SQLExpr getExpr() {
|
||||
return this.expr;
|
||||
}
|
||||
|
||||
public void setExpr(SQLExpr expr) {
|
||||
this.expr = expr;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public void setType(Type type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static enum Type {
|
||||
ROWS, RANGE;
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.postgresql.ast.expr;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLObjectImpl;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.PGOrderBy;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.visitor.PGASTVisitor;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
public class PGAnalytic extends SQLObjectImpl implements PGExpr {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final List<SQLExpr> partitionBy = new ArrayList<SQLExpr>();
|
||||
private PGOrderBy orderBy;
|
||||
|
||||
|
||||
public PGOrderBy getOrderBy() {
|
||||
return orderBy;
|
||||
}
|
||||
|
||||
public void setOrderBy(PGOrderBy orderBy) {
|
||||
this.orderBy = orderBy;
|
||||
}
|
||||
|
||||
public PGAnalytic(){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
this.accept0((PGASTVisitor) visitor);
|
||||
}
|
||||
|
||||
public void accept0(PGASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, this.partitionBy);
|
||||
acceptChild(visitor, this.orderBy);
|
||||
}
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
|
||||
public List<SQLExpr> getPartitionBy() {
|
||||
return this.partitionBy;
|
||||
}
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.postgresql.ast.stmt;
|
||||
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.PGSQLObjectImpl;
|
||||
|
||||
|
||||
public abstract class PGSQLStatementImpl extends PGSQLObjectImpl implements PGSQLStatement {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -17,7 +17,6 @@ package com.alibaba.druid.sql.dialect.postgresql.visitor;
|
||||
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.PGWithClause;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.PGWithQuery;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGAnalytic;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGParameter;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGDeleteStatement;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGFunctionTableSource;
|
||||
@@ -74,10 +73,6 @@ public interface PGASTVisitor extends SQLASTVisitor {
|
||||
|
||||
boolean visit(PGUpdateStatement x);
|
||||
|
||||
void endVisit(PGAnalytic x);
|
||||
|
||||
boolean visit(PGAnalytic x);
|
||||
|
||||
void endVisit(PGParameter x);
|
||||
|
||||
boolean visit(PGParameter x);
|
||||
|
||||
-11
@@ -17,7 +17,6 @@ package com.alibaba.druid.sql.dialect.postgresql.visitor;
|
||||
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.PGWithClause;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.PGWithQuery;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGAnalytic;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGParameter;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGDeleteStatement;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGFunctionTableSource;
|
||||
@@ -150,16 +149,6 @@ public class PGASTVisitorAdapter extends SQLASTVisitorAdapter implements PGASTVi
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(PGAnalytic x) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(PGAnalytic x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(PGParameter x) {
|
||||
|
||||
|
||||
@@ -15,12 +15,10 @@
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.postgresql.visitor;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLSetQuantifier;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLSelectStatement;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.PGWithClause;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.PGWithQuery;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGAnalytic;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGParameter;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGDeleteStatement;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGFunctionTableSource;
|
||||
@@ -439,30 +437,6 @@ public class PGOutputVisitor extends SQLASTOutputVisitor implements PGASTVisitor
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(PGAnalytic x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(PGAnalytic x) {
|
||||
print(" OVER (");
|
||||
if (x.getPartitionBy().size() > 0) {
|
||||
int mark = 0;
|
||||
for (SQLExpr e : x.getPartitionBy()) {
|
||||
if (mark++ != 0) {
|
||||
print(", ");
|
||||
}
|
||||
e.accept(this);
|
||||
}
|
||||
}
|
||||
if (x.getOrderBy() != null) {
|
||||
x.getOrderBy().accept(this);
|
||||
}
|
||||
print(")");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(PGParameter x) {
|
||||
|
||||
|
||||
-11
@@ -24,7 +24,6 @@ import com.alibaba.druid.sql.ast.statement.SQLSelectStatement;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLTruncateStatement;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.PGWithClause;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.PGWithQuery;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGAnalytic;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.expr.PGParameter;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGDeleteStatement;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGFunctionTableSource;
|
||||
@@ -259,16 +258,6 @@ public class PGSchemaStatVisitor extends SchemaStatVisitor implements PGASTVisit
|
||||
return this.visit((SQLSelectQueryBlock) x);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(PGAnalytic x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(PGAnalytic x) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(PGParameter x) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user