@@ -140,40 +140,61 @@ public void testMultiPartTableNameWithServerProblem() throws Exception {
140
140
public void testMultiPartTableNameWithServerName () throws Exception {
141
141
final String statement =
142
142
"SELECT columnName FROM [server-name\\ server-instance]...tableName" ;
143
- assertSqlCanBeParsedAndDeparsed (statement , false ,
144
- parser -> parser .withSquareBracketQuotation (true ));
143
+ assertSqlCanBeParsedAndDeparsed (
144
+ statement
145
+ , false
146
+ ,parser -> parser
147
+ .withSquareBracketQuotation (true )
148
+ .withSkippingPartsInIdentifiers (true )
149
+ );
145
150
}
146
151
147
152
@ Test
148
153
public void testMultiPartTableNameWithDatabaseNameAndSchemaName () throws Exception {
149
154
final String statement = "SELECT columnName FROM databaseName.schemaName.tableName" ;
150
- Select select = (Select ) parserManager .parse (new StringReader (statement ));
151
-
152
- assertStatementCanBeDeparsedAs (select , statement );
155
+ assertSqlCanBeParsedAndDeparsed (
156
+ statement
157
+ , false
158
+ ,parser -> parser
159
+ .withSquareBracketQuotation (true )
160
+ .withSkippingPartsInIdentifiers (true )
161
+ );
153
162
}
154
163
155
164
@ Test
156
165
public void testMultiPartTableNameWithDatabaseName () throws Exception {
157
166
final String statement = "SELECT columnName FROM databaseName..tableName" ;
158
- Select select = (Select ) parserManager .parse (new StringReader (statement ));
159
-
160
- assertStatementCanBeDeparsedAs (select , statement );
167
+ assertSqlCanBeParsedAndDeparsed (
168
+ statement
169
+ , false
170
+ ,parser -> parser
171
+ .withSquareBracketQuotation (true )
172
+ .withSkippingPartsInIdentifiers (true )
173
+ );
161
174
}
162
175
163
176
@ Test
164
177
public void testMultiPartTableNameWithSchemaName () throws Exception {
165
178
final String statement = "SELECT columnName FROM schemaName.tableName" ;
166
- Select select = (Select ) parserManager .parse (new StringReader (statement ));
167
-
168
- assertStatementCanBeDeparsedAs (select , statement );
179
+ assertSqlCanBeParsedAndDeparsed (
180
+ statement
181
+ , false
182
+ ,parser -> parser
183
+ .withSquareBracketQuotation (true )
184
+ .withSkippingPartsInIdentifiers (true )
185
+ );
169
186
}
170
187
171
188
@ Test
172
189
public void testMultiPartTableNameWithColumnName () throws Exception {
173
190
final String statement = "SELECT columnName FROM tableName" ;
174
- Select select = (Select ) parserManager .parse (new StringReader (statement ));
175
-
176
- assertStatementCanBeDeparsedAs (select , statement );
191
+ assertSqlCanBeParsedAndDeparsed (
192
+ statement
193
+ , false
194
+ ,parser -> parser
195
+ .withSquareBracketQuotation (true )
196
+ .withSkippingPartsInIdentifiers (true )
197
+ );
177
198
}
178
199
179
200
// Select statement statement multipart
@@ -182,9 +203,13 @@ public void testMultiPartColumnNameWithDatabaseNameAndSchemaNameAndTableName()
182
203
throws Exception {
183
204
final String statement =
184
205
"SELECT databaseName.schemaName.tableName.columnName FROM tableName" ;
185
- Select select = (Select ) parserManager .parse (new StringReader (statement ));
186
-
187
- assertStatementCanBeDeparsedAs (select , statement );
206
+ assertSqlCanBeParsedAndDeparsed (
207
+ statement
208
+ , false
209
+ ,parser -> parser
210
+ .withSquareBracketQuotation (true )
211
+ .withSkippingPartsInIdentifiers (true )
212
+ );
188
213
}
189
214
190
215
@ Test
@@ -196,9 +221,13 @@ public void testMultiPartColumnNameWithDatabaseNameAndSchemaName() throws JSQLPa
196
221
@ Test
197
222
public void testMultiPartColumnNameWithDatabaseNameAndTableName () throws Exception {
198
223
final String statement = "SELECT databaseName..tableName.columnName FROM tableName" ;
199
- Select select = (Select ) parserManager .parse (new StringReader (statement ));
200
-
201
- assertStatementCanBeDeparsedAs (select , statement );
224
+ Select select = (Select ) assertSqlCanBeParsedAndDeparsed (
225
+ statement
226
+ , false
227
+ ,parser -> parser
228
+ .withSquareBracketQuotation (true )
229
+ .withSkippingPartsInIdentifiers (true )
230
+ );
202
231
checkMultipartIdentifier (select , "databaseName..tableName.columnName" );
203
232
}
204
233
@@ -217,9 +246,13 @@ public void execute() throws Throwable {
217
246
@ Test
218
247
public void testMultiPartColumnNameWithSchemaNameAndTableName () throws Exception {
219
248
final String statement = "SELECT schemaName.tableName.columnName FROM tableName" ;
220
- Select select = (Select ) parserManager .parse (new StringReader (statement ));
221
-
222
- assertStatementCanBeDeparsedAs (select , statement );
249
+ Select select = (Select ) assertSqlCanBeParsedAndDeparsed (
250
+ statement
251
+ , false
252
+ ,parser -> parser
253
+ .withSquareBracketQuotation (true )
254
+ .withSkippingPartsInIdentifiers (true )
255
+ );
223
256
checkMultipartIdentifier (select , "schemaName.tableName.columnName" );
224
257
}
225
258
@@ -238,18 +271,26 @@ public void execute() throws Throwable {
238
271
@ Test
239
272
public void testMultiPartColumnNameWithTableName () throws Exception {
240
273
final String statement = "SELECT tableName.columnName FROM tableName" ;
241
- Select select = (Select ) parserManager .parse (new StringReader (statement ));
242
-
243
- assertStatementCanBeDeparsedAs (select , statement );
274
+ Select select = (Select ) assertSqlCanBeParsedAndDeparsed (
275
+ statement
276
+ , false
277
+ ,parser -> parser
278
+ .withSquareBracketQuotation (true )
279
+ .withSkippingPartsInIdentifiers (true )
280
+ );
244
281
checkMultipartIdentifier (select , "tableName.columnName" );
245
282
}
246
283
247
284
@ Test
248
285
public void testMultiPartColumnName () throws Exception {
249
286
final String statement = "SELECT columnName FROM tableName" ;
250
- Select select = (Select ) parserManager .parse (new StringReader (statement ));
251
-
252
- assertStatementCanBeDeparsedAs (select , statement );
287
+ Select select = (Select ) assertSqlCanBeParsedAndDeparsed (
288
+ statement
289
+ , false
290
+ ,parser -> parser
291
+ .withSquareBracketQuotation (true )
292
+ .withSkippingPartsInIdentifiers (true )
293
+ );
253
294
checkMultipartIdentifier (select , "columnName" );
254
295
}
255
296
0 commit comments