mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
fixed issue#949
This commit is contained in:
@@ -71,4 +71,28 @@ public class SQLServerExec_Test extends TestCase {
|
||||
Assert.assertEquals(0, visitor.getColumns().size());
|
||||
}
|
||||
|
||||
/**
|
||||
* add by zz to test execute sp with out type
|
||||
* @throws Exception
|
||||
*/
|
||||
public void test_3() throws Exception {
|
||||
String sql = "EXEC sp_rename @P0 OUT";
|
||||
SQLServerStatementParser parser = new SQLServerStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
|
||||
SQLServerSchemaStatVisitor visitor = new SQLServerSchemaStatVisitor();
|
||||
stmt.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());
|
||||
|
||||
String output = SQLUtils.toSQLString(stmt, JdbcConstants.SQL_SERVER);
|
||||
Assert.assertEquals("EXEC sp_rename @P0 OUT", output);
|
||||
|
||||
Assert.assertEquals(0, visitor.getTables().size());
|
||||
Assert.assertEquals(0, visitor.getColumns().size());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user