@@ -173,6 +173,19 @@ public void shouldTrimWHEREANDWithCRLFForFirstCondition() throws Exception {
173
173
assertEquals (expected , boundSql .getSql ());
174
174
}
175
175
176
+ @ Test
177
+ public void shouldTrimWHEREANDWithTABForFirstCondition () throws Exception {
178
+ final String expected = "SELECT * FROM BLOG WHERE \t ID = ?" ;
179
+ DynamicSqlSource source = createDynamicSqlSource (
180
+ new TextSqlNode ("SELECT * FROM BLOG" ),
181
+ new WhereSqlNode (new Configuration (),mixedContents (
182
+ new IfSqlNode (mixedContents (new TextSqlNode (" and\t ID = ? " )), "true"
183
+ )
184
+ )));
185
+ BoundSql boundSql = source .getBoundSql (null );
186
+ assertEquals (expected , boundSql .getSql ());
187
+ }
188
+
176
189
@ Test
177
190
public void shouldTrimWHEREORWithLFForFirstCondition () throws Exception {
178
191
final String expected = "SELECT * FROM BLOG WHERE \n ID = ?" ;
@@ -199,6 +212,19 @@ public void shouldTrimWHEREORWithCRLFForFirstCondition() throws Exception {
199
212
assertEquals (expected , boundSql .getSql ());
200
213
}
201
214
215
+ @ Test
216
+ public void shouldTrimWHEREORWithTABForFirstCondition () throws Exception {
217
+ final String expected = "SELECT * FROM BLOG WHERE \t ID = ?" ;
218
+ DynamicSqlSource source = createDynamicSqlSource (
219
+ new TextSqlNode ("SELECT * FROM BLOG" ),
220
+ new WhereSqlNode (new Configuration (),mixedContents (
221
+ new IfSqlNode (mixedContents (new TextSqlNode (" or\t ID = ? " )), "true"
222
+ )
223
+ )));
224
+ BoundSql boundSql = source .getBoundSql (null );
225
+ assertEquals (expected , boundSql .getSql ());
226
+ }
227
+
202
228
@ Test
203
229
public void shouldTrimWHEREInsteadOfORForSecondCondition () throws Exception {
204
230
final String expected = "SELECT * FROM BLOG WHERE NAME = ?" ;
0 commit comments