Skip to content

Commit 16ffe8e

Browse files
committed
[misc] removing metadata getTypeInfo listing BOOL to BOOLEAN change to avoid incompatibility
1 parent 9e53e68 commit 16ffe8e

File tree

3 files changed

+155
-5
lines changed

3 files changed

+155
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
* CONJ-1225 System throws an exception prematurely without checking all available connections
1313
* CONJ-1228 result-set.getObject() on BLOB type returns Blob in place of byte[]
1414
* CONJ-660 new `disconnectOnExpiredPasswords` connection option that controls client behavior when connecting with an expired password.
15-
When set to true (default), the client disconnects if it detects an expired password.
16-
When false, the client maintains the connection and allows setting a new password.
15+
When set to true (default), the client disconnects if it detects an expired password.
16+
When false, the client maintains the connection and allows setting a new password.
1717
* CONJ-1229 Permit executeQuery commands to not return a result-set
1818

1919

src/main/java/org/mariadb/jdbc/DatabaseMetaData.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3022,8 +3022,8 @@ public ResultSet getTypeInfo() {
30223022
"BIT", "-7", "1", "", "", "", "1", "1", "3", "\0", "0", "0", "BIT", "0", "0", "0", "0", "10"
30233023
},
30243024
{
3025-
"BOOLEAN", "-7", "1", "", "", "", "1", "1", "3", "\0", "0", "0", "BOOLEAN", "0", "0", "0",
3026-
"0", "10"
3025+
"BOOL", "-7", "1", "", "", "", "1", "1", "3", "\0", "0", "0", "BOOL", "0", "0", "0", "0",
3026+
"10"
30273027
},
30283028
{
30293029
"TINYINT",
@@ -3654,7 +3654,7 @@ public ResultSet getTypeInfo() {
36543654
});
36553655

36563656
if (connection.getContext().getVersion().isMariaDBServer()
3657-
&& connection.getContext().getVersion().versionGreaterOrEqual(11, 7, 2)) {
3657+
&& connection.getContext().getVersion().versionGreaterOrEqual(11, 7, 1)) {
36583658
datalist.add(
36593659
new String[] {
36603660
"VECTOR",

src/test/java/org/mariadb/jdbc/integration/DatabaseMetadataTest.java

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2053,6 +2053,156 @@ public void testGetTypeInfoBasic() throws SQLException {
20532053
+ " int,SQL_DATETIME_SUB int, NUM_PREC_RADIX int");
20542054
}
20552055

2056+
@Test
2057+
public void testGetTypeInfoDataTYpe() throws SQLException {
2058+
String[] expectedTypes =
2059+
new String[] {
2060+
"BIT",
2061+
"BOOL",
2062+
"TINYINT",
2063+
"TINYINT UNSIGNED",
2064+
"BIGINT",
2065+
"BIGINT UNSIGNED",
2066+
"LONG VARBINARY",
2067+
"MEDIUMBLOB",
2068+
"LONGBLOB",
2069+
"BLOB",
2070+
"TINYBLOB",
2071+
"VARBINARY",
2072+
"BINARY",
2073+
"LONG VARCHAR",
2074+
"MEDIUMTEXT",
2075+
"LONGTEXT",
2076+
"TEXT",
2077+
"TINYTEXT",
2078+
"CHAR",
2079+
"NUMERIC",
2080+
"DECIMAL",
2081+
"INTEGER",
2082+
"INTEGER UNSIGNED",
2083+
"INT",
2084+
"INT UNSIGNED",
2085+
"MEDIUMINT",
2086+
"MEDIUMINT UNSIGNED",
2087+
"SMALLINT",
2088+
"SMALLINT UNSIGNED",
2089+
"FLOAT",
2090+
"DOUBLE",
2091+
"DOUBLE PRECISION",
2092+
"REAL",
2093+
"VARCHAR",
2094+
"ENUM",
2095+
"SET",
2096+
"DATE",
2097+
"TIME",
2098+
"DATETIME",
2099+
"TIMESTAMP"
2100+
};
2101+
if (sharedConn.getContext().getVersion().isMariaDBServer()
2102+
&& sharedConn.getContext().getVersion().versionGreaterOrEqual(10, 7, 0)) {
2103+
// add UUID
2104+
expectedTypes =
2105+
new String[] {
2106+
"BIT",
2107+
"BOOL",
2108+
"TINYINT",
2109+
"TINYINT UNSIGNED",
2110+
"BIGINT",
2111+
"BIGINT UNSIGNED",
2112+
"LONG VARBINARY",
2113+
"MEDIUMBLOB",
2114+
"LONGBLOB",
2115+
"BLOB",
2116+
"TINYBLOB",
2117+
"VARBINARY",
2118+
"BINARY",
2119+
"LONG VARCHAR",
2120+
"MEDIUMTEXT",
2121+
"LONGTEXT",
2122+
"TEXT",
2123+
"TINYTEXT",
2124+
"CHAR",
2125+
"NUMERIC",
2126+
"DECIMAL",
2127+
"INTEGER",
2128+
"INTEGER UNSIGNED",
2129+
"INT",
2130+
"INT UNSIGNED",
2131+
"MEDIUMINT",
2132+
"MEDIUMINT UNSIGNED",
2133+
"SMALLINT",
2134+
"SMALLINT UNSIGNED",
2135+
"FLOAT",
2136+
"DOUBLE",
2137+
"DOUBLE PRECISION",
2138+
"REAL",
2139+
"VARCHAR",
2140+
"ENUM",
2141+
"SET",
2142+
"DATE",
2143+
"TIME",
2144+
"DATETIME",
2145+
"TIMESTAMP",
2146+
"UUID"
2147+
};
2148+
if (sharedConn.getContext().getVersion().isMariaDBServer()
2149+
&& sharedConn.getContext().getVersion().versionGreaterOrEqual(11, 7, 1)) {
2150+
// add VECTOR
2151+
expectedTypes =
2152+
new String[] {
2153+
"BIT",
2154+
"BOOL",
2155+
"TINYINT",
2156+
"TINYINT UNSIGNED",
2157+
"BIGINT",
2158+
"BIGINT UNSIGNED",
2159+
"LONG VARBINARY",
2160+
"MEDIUMBLOB",
2161+
"LONGBLOB",
2162+
"BLOB",
2163+
"TINYBLOB",
2164+
"VARBINARY",
2165+
"VECTOR",
2166+
"BINARY",
2167+
"LONG VARCHAR",
2168+
"MEDIUMTEXT",
2169+
"LONGTEXT",
2170+
"TEXT",
2171+
"TINYTEXT",
2172+
"CHAR",
2173+
"NUMERIC",
2174+
"DECIMAL",
2175+
"INTEGER",
2176+
"INTEGER UNSIGNED",
2177+
"INT",
2178+
"INT UNSIGNED",
2179+
"MEDIUMINT",
2180+
"MEDIUMINT UNSIGNED",
2181+
"SMALLINT",
2182+
"SMALLINT UNSIGNED",
2183+
"FLOAT",
2184+
"DOUBLE",
2185+
"DOUBLE PRECISION",
2186+
"REAL",
2187+
"VARCHAR",
2188+
"ENUM",
2189+
"SET",
2190+
"DATE",
2191+
"TIME",
2192+
"DATETIME",
2193+
"TIMESTAMP",
2194+
"UUID"
2195+
};
2196+
}
2197+
}
2198+
2199+
int i = 0;
2200+
ResultSet rs = sharedConn.getMetaData().getTypeInfo();
2201+
while (rs.next()) {
2202+
assertEquals(expectedTypes[i++], rs.getString(1));
2203+
}
2204+
}
2205+
20562206
@Test
20572207
public void getColumnsTest() throws SQLException {
20582208
// https://jira.mariadb.org/browse/XPT-280

0 commit comments

Comments
 (0)