7
7
import java .util .Iterator ;
8
8
import java .util .List ;
9
9
import java .util .StringTokenizer ;
10
-
11
- import junit .framework .TestCase ;
12
10
import net .sf .jsqlparser .JSQLParserException ;
13
11
import net .sf .jsqlparser .parser .CCJSqlParserManager ;
14
12
import net .sf .jsqlparser .statement .create .table .ColumnDefinition ;
15
13
import net .sf .jsqlparser .statement .create .table .CreateTable ;
16
14
import net .sf .jsqlparser .statement .create .table .Index ;
17
15
import net .sf .jsqlparser .test .TestException ;
18
- import net .sf .jsqlparser .util .TablesNamesFinder ;
19
16
import static net .sf .jsqlparser .test .TestUtils .*;
17
+ import static org .junit .Assert .assertEquals ;
18
+ import static org .junit .Assert .assertFalse ;
19
+ import static org .junit .Assert .assertTrue ;
20
+ import org .junit .Test ;
20
21
21
- public class CreateTableTest extends TestCase {
22
-
23
- private CCJSqlParserManager parserManager = new CCJSqlParserManager ();
22
+ public class CreateTableTest {
24
23
25
- public CreateTableTest (String arg0 ) {
26
- super (arg0 );
27
- }
24
+ private final CCJSqlParserManager parserManager = new CCJSqlParserManager ();
28
25
26
+ @ Test
29
27
public void testCreateTable2 () throws JSQLParserException {
30
28
String statement = "CREATE TABLE testtab (\" test\" varchar (255))" ;
31
29
assertSqlCanBeParsedAndDeparsed (statement );
32
30
}
33
31
32
+ @ Test
34
33
public void testCreateTable3 () throws JSQLParserException {
35
34
String statement = "CREATE TABLE testtab (\" test\" varchar (255), \" test2\" varchar (255))" ;
36
35
assertSqlCanBeParsedAndDeparsed (statement );
37
36
}
38
37
38
+ @ Test
39
39
public void testCreateTableAsSelect () throws JSQLParserException , JSQLParserException , JSQLParserException , JSQLParserException {
40
40
String statement = "CREATE TABLE a AS SELECT col1, col2 FROM b" ;
41
41
assertSqlCanBeParsedAndDeparsed (statement );
42
42
}
43
43
44
+ @ Test
44
45
public void testCreateTableAsSelect2 () throws JSQLParserException {
45
46
String statement = "CREATE TABLE newtable AS WITH a AS (SELECT col1, col3 FROM testtable) SELECT col1, col2, col3 FROM b INNER JOIN a ON b.col1 = a.col1" ;
46
47
assertSqlCanBeParsedAndDeparsed (statement );
47
48
}
48
49
50
+ @ Test
49
51
public void testCreateTable () throws JSQLParserException {
50
52
String statement = "CREATE TABLE mytab (mycol a (10, 20) c nm g, mycol2 mypar1 mypar2 (23,323,3) asdf ('23','123') dasd, "
51
53
+ "PRIMARY KEY (mycol2, mycol)) type = myisam" ;
@@ -61,6 +63,7 @@ public void testCreateTable() throws JSQLParserException {
61
63
assertEquals (statement , "" + createTable );
62
64
}
63
65
66
+ @ Test
64
67
public void testCreateTableUnlogged () throws JSQLParserException {
65
68
String statement = "CREATE UNLOGGED TABLE mytab (mycol a (10, 20) c nm g, mycol2 mypar1 mypar2 (23,323,3) asdf ('23','123') dasd, "
66
69
+ "PRIMARY KEY (mycol2, mycol)) type = myisam" ;
@@ -76,72 +79,88 @@ public void testCreateTableUnlogged() throws JSQLParserException {
76
79
assertEquals (statement , "" + createTable );
77
80
}
78
81
82
+ @ Test
79
83
public void testCreateTableUnlogged2 () throws JSQLParserException {
80
84
String statement = "CREATE UNLOGGED TABLE mytab (mycol a (10, 20) c nm g, mycol2 mypar1 mypar2 (23,323,3) asdf ('23','123') dasd, PRIMARY KEY (mycol2, mycol))" ;
81
85
assertSqlCanBeParsedAndDeparsed (statement );
82
86
}
83
87
88
+ @ Test
84
89
public void testCreateTableForeignKey () throws JSQLParserException {
85
90
String statement = "CREATE TABLE test (id INT UNSIGNED NOT NULL AUTO_INCREMENT, string VARCHAR (20), user_id INT UNSIGNED, PRIMARY KEY (id), FOREIGN KEY (user_id) REFERENCES ra_user(id))" ;
86
91
assertSqlCanBeParsedAndDeparsed (statement );
87
92
}
88
93
94
+ @ Test
89
95
public void testCreateTableForeignKey2 () throws JSQLParserException {
90
96
String statement = "CREATE TABLE test (id INT UNSIGNED NOT NULL AUTO_INCREMENT, string VARCHAR (20), user_id INT UNSIGNED, PRIMARY KEY (id), CONSTRAINT fkIdx FOREIGN KEY (user_id) REFERENCES ra_user(id))" ;
91
97
assertSqlCanBeParsedAndDeparsed (statement );
92
98
}
93
99
100
+ @ Test
94
101
public void testCreateTableForeignKey3 () throws JSQLParserException {
95
102
String statement = "CREATE TABLE test (id INT UNSIGNED NOT NULL AUTO_INCREMENT, string VARCHAR (20), user_id INT UNSIGNED REFERENCES ra_user(id), PRIMARY KEY (id))" ;
96
103
assertSqlCanBeParsedAndDeparsed (statement , true );
97
104
}
98
105
106
+ @ Test
99
107
public void testCreateTableForeignKey4 () throws JSQLParserException {
100
108
String statement = "CREATE TABLE test (id INT UNSIGNED NOT NULL AUTO_INCREMENT, string VARCHAR (20), user_id INT UNSIGNED FOREIGN KEY REFERENCES ra_user(id), PRIMARY KEY (id))" ;
101
109
assertSqlCanBeParsedAndDeparsed (statement , true );
102
110
}
103
111
112
+ @ Test
104
113
public void testCreateTablePrimaryKey () throws JSQLParserException {
105
114
String statement = "CREATE TABLE test (id INT UNSIGNED NOT NULL AUTO_INCREMENT, string VARCHAR (20), user_id INT UNSIGNED, CONSTRAINT pk_name PRIMARY KEY (id))" ;
106
115
assertSqlCanBeParsedAndDeparsed (statement );
107
116
}
108
117
118
+ @ Test
109
119
public void testCreateTableParams () throws JSQLParserException {
110
120
assertSqlCanBeParsedAndDeparsed ("CREATE TEMPORARY TABLE T1 (PROCESSID VARCHAR (32)) ON COMMIT PRESERVE ROWS" );
111
121
}
112
122
123
+ @ Test
113
124
public void testCreateTableUniqueConstraint () throws JSQLParserException {
114
125
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE Activities (_id INTEGER PRIMARY KEY AUTOINCREMENT,uuid VARCHAR(255),user_id INTEGER,sound_id INTEGER,sound_type INTEGER,comment_id INTEGER,type String,tags VARCHAR(255),created_at INTEGER,content_id INTEGER,sharing_note_text VARCHAR(255),sharing_note_created_at INTEGER,UNIQUE (created_at, type, content_id, sound_id, user_id))" , true );
115
126
}
116
127
128
+ @ Test
117
129
public void testCreateTableDefault () throws JSQLParserException {
118
130
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE T1 (id integer default -1)" );
119
131
}
120
132
133
+ @ Test
121
134
public void testCreateTableDefault2 () throws JSQLParserException {
122
135
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE T1 (id integer default 1)" );
123
136
}
124
137
138
+ @ Test
125
139
public void testCreateTableIfNotExists () throws JSQLParserException {
126
140
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE IF NOT EXISTS animals (id INT NOT NULL)" );
127
141
}
128
142
143
+ @ Test
129
144
public void testCreateTableInlinePrimaryKey () throws JSQLParserException {
130
145
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE animals (id INT PRIMARY KEY NOT NULL)" );
131
146
}
132
147
148
+ @ Test
133
149
public void testCreateTableWithRange () throws JSQLParserException {
134
150
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE foo (name character varying (255), range character varying (255), start_range integer, end_range integer)" );
135
151
}
136
152
153
+ @ Test
137
154
public void testCreateTableWithKey () throws JSQLParserException {
138
155
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE bar (key character varying (255) NOT NULL)" );
139
156
}
140
157
158
+ @ Test
141
159
public void testCreateTableWithUniqueKey () throws JSQLParserException {
142
160
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE animals (id INT NOT NULL, name VARCHAR (100) UNIQUE KEY (id))" );
143
161
}
144
162
163
+ @ Test
145
164
public void testCreateTableVeryComplex () throws JSQLParserException {
146
165
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE `wp_commentmeta` ( `meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `comment_id` bigint(20) unsigned NOT NULL DEFAULT '0', `meta_key` varchar(255) DEFAULT NULL, `meta_value` longtext, PRIMARY KEY (`meta_id`), KEY `comment_id` (`comment_id`), KEY `meta_key` (`meta_key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8" , true );
147
166
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE `wp_comments` ( `comment_ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `comment_post_ID` bigint(20) unsigned NOT NULL DEFAULT '0', `comment_author` tinytext NOT NULL, `comment_author_email` varchar(100) NOT NULL DEFAULT '', `comment_author_url` varchar(200) NOT NULL DEFAULT '', `comment_author_IP` varchar(100) NOT NULL DEFAULT '', `comment_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `comment_date_gmt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `comment_content` text NOT NULL, `comment_karma` int(11) NOT NULL DEFAULT '0', `comment_approved` varchar(20) NOT NULL DEFAULT '1', `comment_agent` varchar(255) NOT NULL DEFAULT '', `comment_type` varchar(20) NOT NULL DEFAULT '', `comment_parent` bigint(20) unsigned NOT NULL DEFAULT '0', `user_id` bigint(20) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`comment_ID`), KEY `comment_post_ID` (`comment_post_ID`), KEY `comment_approved_date_gmt` (`comment_approved`,`comment_date_gmt`), KEY `comment_date_gmt` (`comment_date_gmt`), KEY `comment_parent` (`comment_parent`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8" , true );
@@ -156,106 +175,132 @@ public void testCreateTableVeryComplex() throws JSQLParserException {
156
175
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE `wp_users` ( `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `user_login` varchar(60) NOT NULL DEFAULT '', `user_pass` varchar(64) NOT NULL DEFAULT '', `user_nicename` varchar(50) NOT NULL DEFAULT '', `user_email` varchar(100) NOT NULL DEFAULT '', `user_url` varchar(100) NOT NULL DEFAULT '', `user_registered` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `user_activation_key` varchar(60) NOT NULL DEFAULT '', `user_status` int(11) NOT NULL DEFAULT '0', `display_name` varchar(250) NOT NULL DEFAULT '', PRIMARY KEY (`ID`), KEY `user_login_key` (`user_login`), KEY `user_nicename` (`user_nicename`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8" , true );
157
176
}
158
177
178
+ @ Test
159
179
public void testCreateTableArrays () throws JSQLParserException {
160
180
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE sal_emp (name text, pay_by_quarter integer[], schedule text[][])" );
161
181
}
162
182
183
+ @ Test
163
184
public void testCreateTableArrays2 () throws JSQLParserException {
164
185
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE sal_emp (name text, pay_by_quarter integer[5], schedule text[3][2])" );
165
186
}
166
187
188
+ @ Test
167
189
public void testCreateTableColumnValues () throws JSQLParserException {
168
190
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE mytable1 (values INTEGER)" );
169
191
}
170
192
193
+ @ Test
171
194
public void testCreateTableColumnValue () throws JSQLParserException {
172
195
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE mytable1 (value INTEGER)" );
173
196
}
174
197
198
+ @ Test
175
199
public void testCreateTableForeignKey5 () throws JSQLParserException {
176
200
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE IF NOT EXISTS table1 (id INTEGER PRIMARY KEY AUTO_INCREMENT, aid INTEGER REFERENCES accounts ON aid ON DELETE CASCADE, name STRING, lastname STRING)" );
177
201
}
178
202
203
+ @ Test
179
204
public void testCreateTableForeignKey6 () throws JSQLParserException {
180
205
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE test (id long, fkey long references another_table (id))" );
181
206
}
182
207
208
+ @ Test
183
209
public void testMySqlCreateTableOnUpdateCurrentTimestamp () throws JSQLParserException {
184
210
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE test (applied timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP)" );
185
211
}
186
212
213
+ @ Test
187
214
public void testMySqlCreateTableWithConstraintWithCascade () throws JSQLParserException {
188
215
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE table1 (id INT (10) UNSIGNED NOT NULL AUTO_INCREMENT, t2_id INT (10) UNSIGNED DEFAULT NULL, t3_id INT (10) UNSIGNED DEFAULT NULL, t4_id INT (10) UNSIGNED NOT NULL, PRIMARY KEY (id), KEY fkc_table1_t4 (t4_id), KEY fkc_table1_t2 (t2_id), KEY fkc_table1_t3 (t3_id), CONSTRAINT fkc_table1_t2 FOREIGN KEY (t2_id) REFERENCES table_two(t2o_id) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT fkc_table1_t3 FOREIGN KEY (t3_id) REFERENCES table_three(t3o_id) ON UPDATE CASCADE, CONSTRAINT fkc_table1_t4 FOREIGN KEY (t4_id) REFERENCES table_four(t4o_id) ON DELETE CASCADE) ENGINE = InnoDB AUTO_INCREMENT = 8761 DEFAULT CHARSET = utf8" );
189
216
}
190
217
218
+ @ Test
191
219
public void testMySqlCreateTableWithConstraintWithNoAction () throws JSQLParserException {
192
220
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE table1 (id INT (10) UNSIGNED NOT NULL AUTO_INCREMENT, t2_id INT (10) UNSIGNED DEFAULT NULL, t3_id INT (10) UNSIGNED DEFAULT NULL, t4_id INT (10) UNSIGNED NOT NULL, PRIMARY KEY (id), KEY fkc_table1_t4 (t4_id), KEY fkc_table1_t2 (t2_id), KEY fkc_table1_t3 (t3_id), CONSTRAINT fkc_table1_t2 FOREIGN KEY (t2_id) REFERENCES table_two(t2o_id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fkc_table1_t3 FOREIGN KEY (t3_id) REFERENCES table_three(t3o_id) ON UPDATE NO ACTION, CONSTRAINT fkc_table1_t4 FOREIGN KEY (t4_id) REFERENCES table_four(t4o_id) ON DELETE NO ACTION) ENGINE = InnoDB AUTO_INCREMENT = 8761 DEFAULT CHARSET = utf8" );
193
221
}
194
222
223
+ @ Test
195
224
public void testMySqlCreateTableWithTextIndexes () throws JSQLParserException {
196
225
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE table2 (id INT (10) UNSIGNED NOT NULL AUTO_INCREMENT, name TEXT, url TEXT, created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), FULLTEXT KEY idx_table2_name (name)) ENGINE = InnoDB AUTO_INCREMENT = 7334 DEFAULT CHARSET = utf8" );
197
226
}
198
227
228
+ @ Test
199
229
public void testCreateTableWithCheck () throws JSQLParserException {
200
230
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE table2 (id INT (10) NOT NULL, name TEXT, url TEXT, CONSTRAINT name_not_empty CHECK (name <> ''))" );
201
231
}
202
232
233
+ @ Test
203
234
public void testCreateTableIssue270 () throws JSQLParserException {
204
235
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE item (i_item_sk integer NOT NULL, i_item_id character (16) NOT NULL, i_rec_start_date date, i_rec_end_date date, i_item_desc character varying(200), i_current_price numeric(7,2), i_wholesale_cost numeric(7,2), i_brand_id integer, i_brand character(50), i_class_id integer, i_class character(50), i_category_id integer, i_category character(50), i_manufact_id integer, i_manufact character(50), i_size character(20), i_formulation character(20), i_color character(20), i_units character(10), i_container character(10), i_manager_id integer, i_product_name character(50) )" , true );
205
236
}
206
237
238
+ @ Test
207
239
public void testCreateTableIssue270_1 () throws JSQLParserException {
208
240
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE item (i_item_sk integer NOT NULL, i_item_id character (16))" );
209
241
}
210
242
243
+ @ Test
211
244
public void testCreateTempTableIssue293 () throws JSQLParserException {
212
245
assertSqlCanBeParsedAndDeparsed ("CREATE GLOBAL TEMPORARY TABLE T1 (PROCESSID VARCHAR (32))" );
213
246
}
214
247
248
+ @ Test
215
249
public void testCreateTableWithTablespaceIssue247 () throws JSQLParserException {
216
250
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE TABLE1 (COLUMN1 VARCHAR2 (15), COLUMN2 VARCHAR2 (15), CONSTRAINT P_PK PRIMARY KEY (COLUMN1) USING INDEX TABLESPACE \" T_INDEX\" ) TABLESPACE \" T_SPACE\" " );
217
251
}
218
252
253
+ @ Test
219
254
public void testCreateTableWithTablespaceIssue247_1 () throws JSQLParserException {
220
255
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE TABLE1 (COLUMN1 VARCHAR2 (15), COLUMN2 VARCHAR2 (15), CONSTRAINT P_PK PRIMARY KEY (COLUMN1) USING INDEX TABLESPACE \" T_INDEX\" )" );
221
256
}
222
257
258
+ @ Test
223
259
public void testOnDeleteSetNull () throws JSQLParserException {
224
260
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE inventory (inventory_id INT PRIMARY KEY, product_id INT, CONSTRAINT fk_inv_product_id FOREIGN KEY (product_id) REFERENCES products(product_id) ON DELETE SET NULL)" );
225
261
}
226
262
263
+ @ Test
227
264
public void testColumnCheck () throws JSQLParserException {
228
265
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE table1 (col1 INTEGER CHECK (col1 > 100))" );
229
266
}
230
267
268
+ @ Test
231
269
public void testTableReferenceWithSchema () throws JSQLParserException {
232
270
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE table1 (col1 INTEGER REFERENCES schema1.table1)" );
233
271
}
234
272
273
+ @ Test
235
274
public void testNamedColumnConstraint () throws JSQLParserException {
236
275
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE foo (col1 integer CONSTRAINT no_null NOT NULL)" );
237
276
}
238
277
278
+ @ Test
239
279
public void testColumnConstraintWith () throws JSQLParserException {
240
280
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE foo (col1 integer) WITH (fillfactor=70)" );
241
281
}
242
282
283
+ @ Test
243
284
public void testExcludeWhereConstraint () throws JSQLParserException {
244
285
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE foo (col1 integer, EXCLUDE WHERE (col1 > 100))" );
245
286
}
246
287
288
+ @ Test
247
289
public void testTimestampWithoutTimezone () throws JSQLParserException {
248
290
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE abc.tabc (transaction_date TIMESTAMP WITHOUT TIME ZONE)" );
249
291
}
250
292
293
+ @ Test
251
294
public void testCreateUnitonIssue402 () throws JSQLParserException {
252
295
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE temp.abc AS SELECT sku FROM temp.a UNION SELECT sku FROM temp.b" );
253
296
}
254
297
298
+ @ Test
255
299
public void testCreateUnitonIssue402_2 () throws JSQLParserException {
256
300
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE temp.abc AS (SELECT sku FROM temp.a UNION SELECT sku FROM temp.b)" );
257
301
}
258
302
303
+ @ Test
259
304
public void testTimestampWithTimezone () throws JSQLParserException {
260
305
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE country_region ("
261
306
+ "regionid BIGINT NOT NULL CONSTRAINT pk_auth_region PRIMARY KEY, "
@@ -265,34 +310,45 @@ public void testTimestampWithTimezone() throws JSQLParserException {
265
310
+ "CONSTRAINT region_name_unique UNIQUE (region_name))" );
266
311
}
267
312
313
+ @ Test
268
314
public void testCreateTableAsSelect3 () throws JSQLParserException {
269
315
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE public.sales1 AS (SELECT * FROM public.sales)" );
270
316
}
271
317
318
+ @ Test
272
319
public void testQuotedPKColumnsIssue491 () throws JSQLParserException {
273
320
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE `FOO` (`ID` INT64, `NAME` STRING (100)) PRIMARY KEY (`ID`)" );
274
321
}
275
322
323
+ @ Test
276
324
public void testQuotedPKColumnsIssue491_2 () throws JSQLParserException {
277
325
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE `FOO` (`ID` INT64, `NAME` STRING (100), PRIMARY KEY (`ID`))" );
278
326
}
279
327
328
+ @ Test
280
329
public void testKeySyntaxWithLengthColumnParameter () throws JSQLParserException {
281
330
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE basic (BASIC_TITLE varchar (255) NOT NULL, KEY BASIC_TITLE (BASIC_TITLE(255)))" );
282
331
}
283
332
333
+ @ Test
284
334
public void testIssue273Varchar2Byte () throws JSQLParserException {
285
335
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE IF NOT EXISTS \" TABLE_OK\" (\" SOME_FIELD\" VARCHAR2 (256 BYTE))" );
286
336
}
287
-
337
+
338
+ @ Test
288
339
public void testIssue273Varchar2Char () throws JSQLParserException {
289
340
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE IF NOT EXISTS \" TABLE_OK\" (\" SOME_FIELD\" VARCHAR2 (256 CHAR))" );
290
341
}
291
342
343
+ @ Test
344
+ public void testIssue661Partition () throws JSQLParserException {
345
+ assertSqlCanBeParsedAndDeparsed ("CREATE TABLE T_TEST_PARTITION (PART_COLUMN VARCHAR2 (32) NOT NULL, OTHER_COLS VARCHAR2 (10) NOT NULL) TABLESPACE TBS_DATA_01 PARTITION BY HASH (PART_COLUMN) PARTITIONS 4 STORE IN (TBS_DATA_01) COMPRESS" );
346
+ }
347
+
348
+ @ Test
292
349
public void testRUBiSCreateList () throws Exception {
293
350
BufferedReader in = new BufferedReader (new InputStreamReader (CreateTableTest .class .
294
351
getResourceAsStream ("/RUBiS-create-requests.txt" )));
295
- TablesNamesFinder tablesNamesFinder = new TablesNamesFinder ();
296
352
297
353
try {
298
354
int numSt = 1 ;
0 commit comments