File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
src/test/java/org/apache/ibatis/jdbc Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ --
2
+ -- Copyright 2009-2012 The MyBatis Team
3
+ --
4
+ -- Licensed under the Apache License, Version 2.0 (the "License");
5
+ -- you may not use this file except in compliance with the License.
6
+ -- You may obtain a copy of the License at
7
+ --
8
+ -- http://www.apache.org/licenses/LICENSE-2.0
9
+ --
10
+ -- Unless required by applicable law or agreed to in writing, software
11
+ -- distributed under the License is distributed on an "AS IS" BASIS,
12
+ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ -- See the License for the specific language governing permissions and
14
+ -- limitations under the License.
15
+ --
16
+
17
+ ALTER TABLE product ALTER COLUMN name varchar (80 ); -- that should not make the ScriptRunner failing
Original file line number Diff line number Diff line change @@ -101,6 +101,25 @@ public void shouldReturnWarningIfEndOfLineTerminatorNotFound() throws Exception
101
101
}
102
102
}
103
103
104
+ @ Test
105
+ public void commentAferStatementDelimiterShouldNotCauseRunnerFail () throws Exception {
106
+ DataSource ds = createUnpooledDataSource (JPETSTORE_PROPERTIES );
107
+ Connection conn = ds .getConnection ();
108
+ ScriptRunner runner = new ScriptRunner (conn );
109
+ runner .setAutoCommit (true );
110
+ runner .setStopOnError (true );
111
+
112
+ String resource = "org/apache/ibatis/jdbc/ScriptCommentAfterEOLTerminator.sql" ;
113
+ Reader reader = Resources .getResourceAsReader (resource );
114
+
115
+ try {
116
+ runner .runScript (reader );
117
+ } catch (Exception e ) {
118
+ e .printStackTrace ();
119
+ fail (e .getMessage ());
120
+ }
121
+ }
122
+
104
123
private void runJPetStoreScripts (ScriptRunner runner ) throws IOException , SQLException {
105
124
runScript (runner , JPETSTORE_DDL );
106
125
runScript (runner , JPETSTORE_DATA );
You can’t perform that action at this time.
0 commit comments