Skip to content

Commit

Permalink
ignore UNSIGNED mark in TINYINT(1) columns when TINYINT1_IS_BIT is set
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaslac committed Apr 8, 2017
1 parent 908e428 commit b70cbb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static String columnTypeClause(int dataTypeMappingFlags) {
+ "COLUMN_TYPE))";

if ((dataTypeMappingFlags & MariaSelectResultSet.TINYINT1_IS_BIT) > 0) {
upperCaseWithoutSize = " IF(COLUMN_TYPE = 'tinyint(1)', 'BIT', " + upperCaseWithoutSize + ")";
upperCaseWithoutSize = " IF(COLUMN_TYPE like 'tinyint(1)%', 'BIT', " + upperCaseWithoutSize + ")";
}

if ((dataTypeMappingFlags & MariaSelectResultSet.YEAR_IS_DATE_TYPE) == 0) {
Expand Down Expand Up @@ -412,7 +412,7 @@ private String dataTypeClause(String fullTypeColumnName) {
+ " WHEN 'timestamp' THEN " + Types.TIMESTAMP
+ " WHEN 'tinyint' THEN "
+ (((connection.getProtocol().getDataTypeMappingFlags() & MariaSelectResultSet.TINYINT1_IS_BIT) == 0)
? Types.TINYINT : "IF(" + fullTypeColumnName + "='tinyint(1)'," + Types.BIT + "," + Types.TINYINT + ") ")
? Types.TINYINT : "IF(" + fullTypeColumnName + " like 'tinyint(1)%'," + Types.BIT + "," + Types.TINYINT + ") ")
+ " WHEN 'year' THEN "
+ (((connection.getProtocol().getDataTypeMappingFlags() & MariaSelectResultSet.YEAR_IS_DATE_TYPE) == 0)
? Types.SMALLINT : Types.DATE)
Expand Down

0 comments on commit b70cbb3

Please sign in to comment.