Skip to content

Commit 4eb86e6

Browse files
committed
Update tests
1 parent 747195b commit 4eb86e6

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

jdbc/src/test/java/tech/ydb/jdbc/impl/YdbConnectionImplTest.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,10 @@ public void abort() {
534534

535535
@Test
536536
public void testDDLInsideTransaction() throws SQLException {
537-
String createTempTable = QUERIES.withTableName("--jdbc:SCHEME\n"
538-
+ "create table temp_#tableName(id Int32, value Int32, primary key(id))");
539-
String dropTempTable = QUERIES.withTableName("--jdbc:SCHEME\ndrop table temp_#tableName");
537+
String createTempTable = QUERIES.withTableName(
538+
"create table temp_#tableName(id Int32, value Int32, primary key(id))"
539+
);
540+
String dropTempTable = QUERIES.withTableName("drop table temp_#tableName");
540541

541542
try (Statement statement = jdbc.connection().createStatement()) {
542543
statement.execute(SIMPLE_UPSERT);
@@ -555,7 +556,7 @@ public void testDDLInsideTransaction() throws SQLException {
555556
@Test
556557
public void testWarningInIndexUsage() throws SQLException {
557558
try (Statement statement = jdbc.connection().createStatement()) {
558-
statement.execute("--jdbc:SCHEME\n" +
559+
statement.execute("" +
559560
"create table unit_0_indexed (" +
560561
"id Int32, value Int32, " +
561562
"primary key (id), " +
@@ -632,8 +633,7 @@ public void testAnsiLexerForIdea() throws SQLException {
632633
})
633634
public void testUnsupportedByStorageTableTypes(String type) throws SQLException {
634635
String tableName = "unsupported_" + type;
635-
String sql = "--jdbc:SCHEME\n"
636-
+ "create table " + tableName + " (key Int32, payload " + type + ", primary key(key))";
636+
String sql = "create table " + tableName + " (key Int32, payload " + type + ", primary key(key))";
637637

638638
try (Statement statement = jdbc.connection().createStatement()) {
639639
ExceptionAssert.ydbNonRetryable("is not supported by storage", () -> statement.execute(sql));
@@ -649,8 +649,7 @@ public void testUnsupportedByStorageTableTypes(String type) throws SQLException
649649
})
650650
public void testUnsupportedComplexTypes(String type) throws SQLException {
651651
String tableName = "unsupported_" + type.replaceAll("[^a-zA-Z0-9]", "");
652-
String sql = "--jdbc:SCHEME\n"
653-
+ "create table " + tableName + " (key Int32, payload " + type + ", primary key(key))";
652+
String sql = "create table " + tableName + " (key Int32, payload " + type + ", primary key(key))";
654653

655654
try (Statement statement = jdbc.connection().createStatement()) {
656655
ExceptionAssert.ydbNonRetryable("Invalid type for column: payload.",

jdbc/src/test/java/tech/ydb/jdbc/impl/YdbStatementImplTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public void executeSchemeQueryExplicitly() throws SQLException {
277277

278278
@Test
279279
public void executeDataQuery() throws SQLException {
280-
try (ResultSet rs = statement.executeQuery("--jdbc:DATA\nselect 2 + 2")) {
280+
try (ResultSet rs = statement.executeQuery("select 2 + 2")) {
281281
Assertions.assertFalse(rs.isClosed());
282282
TableAssert.assertSelectInt(4, rs);
283283
}
@@ -297,15 +297,15 @@ public void executeDataQueryInTx() throws SQLException {
297297

298298
@Test
299299
public void executeScanQuery() throws SQLException {
300-
try (ResultSet rs = statement.executeQuery("--jdbc:SCAN\n" + "select 2 + 2")) {
300+
try (ResultSet rs = statement.executeQuery("scan select 2 + 2")) {
301301
Assertions.assertFalse(rs.isClosed());
302302
TableAssert.assertSelectInt(4, rs);
303303
}
304304
}
305305

306306
@Test
307307
public void executeScanQueryOnSystemTable() throws SQLException {
308-
try (ResultSet rs = statement.executeQuery("--jdbc:SCAN\n" + "select * from `.sys/partition_stats`")) {
308+
try (ResultSet rs = statement.executeQuery("scan select * from `.sys/partition_stats`")) {
309309
Assertions.assertFalse(rs.isClosed());
310310
}
311311
}

0 commit comments

Comments
 (0)