This commit is contained in:
温少
2012-05-17 21:43:50 +08:00
parent a6ab1d846f
commit 0ee9928637
8 changed files with 146 additions and 16 deletions
@@ -72,4 +72,22 @@ public class MTSParserTest extends TestCase {
String output = SQLUtils.toMySqlString(stmt);
Assert.assertEquals("ROLLBACK TO x1", output);
}
public void test_lockTable() throws Exception {
String sql = "LOCK TABLES t1 READ;";
MySqlStatementParser parser = new MySqlStatementParser(sql);
SQLStatement stmt = parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(stmt);
Assert.assertEquals("LOCK TABLES t1 READ", output);
}
public void test_lockTable_1() throws Exception {
String sql = "LOCK TABLES t2 READ LOCAL;";
MySqlStatementParser parser = new MySqlStatementParser(sql);
SQLStatement stmt = parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(stmt);
Assert.assertEquals("LOCK TABLES t2 READ LOCAL", output);
}
}