Skip to content

Commit

Permalink
[misc] test coverage improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Dec 15, 2023
1 parent 3564216 commit 819eeb2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/mariadb/jdbc/DatabaseMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -2401,7 +2401,8 @@ public ResultSet getCatalogs() throws SQLException {

public ResultSet getTableTypes() throws SQLException {
return executeQuery(
"SELECT 'TABLE' TABLE_TYPE "
"SELECT 'SYSTEM TABLE' TABLE_TYPE "
+ "UNION 'TABLE' TABLE_TYPE "
+ "UNION SELECT 'SYSTEM VIEW' TABLE_TYPE "
+ "UNION SELECT 'VIEW' TABLE_TYPE "
+ "UNION SELECT 'LOCAL TEMPORARY' TABLE_TYPE");
Expand Down
13 changes: 13 additions & 0 deletions src/test/java/org/mariadb/jdbc/unit/util/ClientParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,17 @@ public void ClientParser() {
new String[] {"INSERT INTO TABLE(id,val) VALUES (1,2) ONDUPLICATE"},
false);
}

@Test
public void ClientParserInsertFlag() {
assertFalse(ClientParser.parameterParts("WRONG INSERT_COMMAND", true).isInsert());
assertFalse(ClientParser.parameterParts("INSERT_COMMAND WRONG ", true).isInsert());
assertFalse(ClientParser.parameterParts("WRONGINSERT COMMAND", true).isInsert());
assertFalse(ClientParser.parameterParts("WRONG INSERT", true).isInsert());
assertFalse(ClientParser.parameterParts("WRONG small insert", true).isInsert());
assertFalse(ClientParser.parameterParts("INSERT DUPLICATE", true).isInsertDuplicate());
assertFalse(ClientParser.parameterParts("INSERT duplicate", true).isInsertDuplicate());
assertFalse(ClientParser.parameterParts("INSERT _duplicate key", true).isInsertDuplicate());
assertFalse(ClientParser.parameterParts("INSERT duplicate_ key", true).isInsertDuplicate());
}
}

0 comments on commit 819eeb2

Please sign in to comment.