@@ -3987,7 +3987,29 @@ private byte[][] getTypeInfo(String mysqlTypeName) throws SQLException {
39873987 rowVal [8 ] = Integer .toString (java .sql .DatabaseMetaData .typeSearchable ).getBytes (); // Searchable
39883988 rowVal [9 ] = s2b (mt .isAllowed (MysqlType .FIELD_FLAG_UNSIGNED ) ? "true" : "false" ); // Unsignable
39893989 rowVal [10 ] = s2b ("false" ); // Fixed Prec Scale
3990- rowVal [11 ] = s2b ("false" ); // Auto Increment
3990+ switch (mt ) {
3991+ case BIGINT :
3992+ case BIGINT_UNSIGNED :
3993+ case BOOLEAN :
3994+ case DOUBLE :
3995+ case DOUBLE_UNSIGNED :
3996+ case FLOAT :
3997+ case FLOAT_UNSIGNED :
3998+ case INT :
3999+ case INT_UNSIGNED :
4000+ case MEDIUMINT :
4001+ case MEDIUMINT_UNSIGNED :
4002+ case SMALLINT :
4003+ case SMALLINT_UNSIGNED :
4004+ case TINYINT :
4005+ case TINYINT_UNSIGNED :
4006+ rowVal [11 ] = s2b ("true" ); // Auto Increment
4007+ break ;
4008+ default :
4009+ rowVal [11 ] = s2b ("false" ); // Auto Increment
4010+ break ;
4011+
4012+ }
39914013 rowVal [12 ] = s2b (mt .getName ()); // Locale Type Name
39924014 switch (mt ) {
39934015 case DECIMAL : // TODO is it right? DECIMAL isn't a floating-point number...
@@ -4038,50 +4060,49 @@ public java.sql.ResultSet getTypeInfo() throws SQLException {
40384060
40394061 ArrayList <Row > tuples = new ArrayList <>();
40404062
4041- /*
4042- * The following are ordered by java.sql.Types, and then by how closely the MySQL type matches the JDBC Type (per spec)
4043- */
4044- tuples .add (new ByteArrayRow (getTypeInfo ("BIT" ), getExceptionInterceptor ()));
4045- tuples .add (new ByteArrayRow (getTypeInfo ("BOOL" ), getExceptionInterceptor ()));
4046- tuples .add (new ByteArrayRow (getTypeInfo ("TINYINT" ), getExceptionInterceptor ()));
4047- tuples .add (new ByteArrayRow (getTypeInfo ("TINYINT UNSIGNED" ), getExceptionInterceptor ()));
40484063 tuples .add (new ByteArrayRow (getTypeInfo ("BIGINT" ), getExceptionInterceptor ()));
40494064 tuples .add (new ByteArrayRow (getTypeInfo ("BIGINT UNSIGNED" ), getExceptionInterceptor ()));
4050- tuples .add (new ByteArrayRow (getTypeInfo ("LONG VARBINARY" ), getExceptionInterceptor ()));
4051- tuples .add (new ByteArrayRow (getTypeInfo ("MEDIUMBLOB" ), getExceptionInterceptor ()));
4052- tuples .add (new ByteArrayRow (getTypeInfo ("LONGBLOB" ), getExceptionInterceptor ()));
4053- tuples .add (new ByteArrayRow (getTypeInfo ("BLOB" ), getExceptionInterceptor ()));
4054- tuples .add (new ByteArrayRow (getTypeInfo ("VARBINARY" ), getExceptionInterceptor ()));
4055- tuples .add (new ByteArrayRow (getTypeInfo ("TINYBLOB" ), getExceptionInterceptor ()));
40564065 tuples .add (new ByteArrayRow (getTypeInfo ("BINARY" ), getExceptionInterceptor ()));
4057- tuples .add (new ByteArrayRow (getTypeInfo ("LONG VARCHAR" ), getExceptionInterceptor ()));
4058- tuples .add (new ByteArrayRow (getTypeInfo ("MEDIUMTEXT" ), getExceptionInterceptor ()));
4059- tuples .add (new ByteArrayRow (getTypeInfo ("LONGTEXT" ), getExceptionInterceptor ()));
4060- tuples .add (new ByteArrayRow (getTypeInfo ("TEXT" ), getExceptionInterceptor ()));
4066+ tuples .add (new ByteArrayRow (getTypeInfo ("BIT" ), getExceptionInterceptor ()));
4067+ tuples .add (new ByteArrayRow (getTypeInfo ("BLOB" ), getExceptionInterceptor ()));
4068+ tuples .add (new ByteArrayRow (getTypeInfo ("BOOL" ), getExceptionInterceptor ()));
40614069 tuples .add (new ByteArrayRow (getTypeInfo ("CHAR" ), getExceptionInterceptor ()));
4062- tuples .add (new ByteArrayRow (getTypeInfo ("ENUM " ), getExceptionInterceptor ()));
4063- tuples .add (new ByteArrayRow (getTypeInfo ("SET " ), getExceptionInterceptor ()));
4070+ tuples .add (new ByteArrayRow (getTypeInfo ("DATE " ), getExceptionInterceptor ()));
4071+ tuples .add (new ByteArrayRow (getTypeInfo ("DATETIME " ), getExceptionInterceptor ()));
40644072 tuples .add (new ByteArrayRow (getTypeInfo ("DECIMAL" ), getExceptionInterceptor ()));
4065- tuples .add (new ByteArrayRow (getTypeInfo ("NUMERIC" ), getExceptionInterceptor ()));
4066- tuples .add (new ByteArrayRow (getTypeInfo ("INTEGER" ), getExceptionInterceptor ()));
4067- tuples .add (new ByteArrayRow (getTypeInfo ("INTEGER UNSIGNED" ), getExceptionInterceptor ()));
4073+ tuples .add (new ByteArrayRow (getTypeInfo ("DOUBLE PRECISION" ), getExceptionInterceptor ()));
4074+ tuples .add (new ByteArrayRow (getTypeInfo ("DOUBLE PRECISION UNSIGNED" ), getExceptionInterceptor ()));
4075+ tuples .add (new ByteArrayRow (getTypeInfo ("DOUBLE" ), getExceptionInterceptor ()));
4076+ tuples .add (new ByteArrayRow (getTypeInfo ("DOUBLE UNSIGNED" ), getExceptionInterceptor ()));
4077+ tuples .add (new ByteArrayRow (getTypeInfo ("ENUM" ), getExceptionInterceptor ()));
4078+ tuples .add (new ByteArrayRow (getTypeInfo ("FLOAT" ), getExceptionInterceptor ()));
40684079 tuples .add (new ByteArrayRow (getTypeInfo ("INT" ), getExceptionInterceptor ()));
40694080 tuples .add (new ByteArrayRow (getTypeInfo ("INT UNSIGNED" ), getExceptionInterceptor ()));
4081+ tuples .add (new ByteArrayRow (getTypeInfo ("INTEGER" ), getExceptionInterceptor ()));
4082+ tuples .add (new ByteArrayRow (getTypeInfo ("INTEGER UNSIGNED" ), getExceptionInterceptor ()));
4083+ tuples .add (new ByteArrayRow (getTypeInfo ("LONG VARBINARY" ), getExceptionInterceptor ()));
4084+ tuples .add (new ByteArrayRow (getTypeInfo ("LONG VARCHAR" ), getExceptionInterceptor ()));
4085+ tuples .add (new ByteArrayRow (getTypeInfo ("LONGBLOB" ), getExceptionInterceptor ()));
4086+ tuples .add (new ByteArrayRow (getTypeInfo ("LONGTEXT" ), getExceptionInterceptor ()));
4087+ tuples .add (new ByteArrayRow (getTypeInfo ("MEDIUMBLOB" ), getExceptionInterceptor ()));
40704088 tuples .add (new ByteArrayRow (getTypeInfo ("MEDIUMINT" ), getExceptionInterceptor ()));
40714089 tuples .add (new ByteArrayRow (getTypeInfo ("MEDIUMINT UNSIGNED" ), getExceptionInterceptor ()));
4090+ tuples .add (new ByteArrayRow (getTypeInfo ("MEDIUMTEXT" ), getExceptionInterceptor ()));
4091+ tuples .add (new ByteArrayRow (getTypeInfo ("NUMERIC" ), getExceptionInterceptor ()));
4092+ tuples .add (new ByteArrayRow (getTypeInfo ("REAL" ), getExceptionInterceptor ()));
4093+ tuples .add (new ByteArrayRow (getTypeInfo ("SET" ), getExceptionInterceptor ()));
40724094 tuples .add (new ByteArrayRow (getTypeInfo ("SMALLINT" ), getExceptionInterceptor ()));
40734095 tuples .add (new ByteArrayRow (getTypeInfo ("SMALLINT UNSIGNED" ), getExceptionInterceptor ()));
4074- tuples .add (new ByteArrayRow (getTypeInfo ("FLOAT" ), getExceptionInterceptor ()));
4075- tuples .add (new ByteArrayRow (getTypeInfo ("DOUBLE" ), getExceptionInterceptor ()));
4076- tuples .add (new ByteArrayRow (getTypeInfo ("DOUBLE PRECISION" ), getExceptionInterceptor ()));
4077- tuples .add (new ByteArrayRow (getTypeInfo ("REAL" ), getExceptionInterceptor ()));
4078- tuples .add (new ByteArrayRow (getTypeInfo ("VARCHAR" ), getExceptionInterceptor ()));
4079- tuples .add (new ByteArrayRow (getTypeInfo ("TINYTEXT" ), getExceptionInterceptor ()));
4080- tuples .add (new ByteArrayRow (getTypeInfo ("DATE" ), getExceptionInterceptor ()));
4081- tuples .add (new ByteArrayRow (getTypeInfo ("YEAR" ), getExceptionInterceptor ()));
4096+ tuples .add (new ByteArrayRow (getTypeInfo ("TEXT" ), getExceptionInterceptor ()));
40824097 tuples .add (new ByteArrayRow (getTypeInfo ("TIME" ), getExceptionInterceptor ()));
4083- tuples .add (new ByteArrayRow (getTypeInfo ("DATETIME" ), getExceptionInterceptor ()));
40844098 tuples .add (new ByteArrayRow (getTypeInfo ("TIMESTAMP" ), getExceptionInterceptor ()));
4099+ tuples .add (new ByteArrayRow (getTypeInfo ("TINYBLOB" ), getExceptionInterceptor ()));
4100+ tuples .add (new ByteArrayRow (getTypeInfo ("TINYINT" ), getExceptionInterceptor ()));
4101+ tuples .add (new ByteArrayRow (getTypeInfo ("TINYINT UNSIGNED" ), getExceptionInterceptor ()));
4102+ tuples .add (new ByteArrayRow (getTypeInfo ("TINYTEXT" ), getExceptionInterceptor ()));
4103+ tuples .add (new ByteArrayRow (getTypeInfo ("VARBINARY" ), getExceptionInterceptor ()));
4104+ tuples .add (new ByteArrayRow (getTypeInfo ("VARCHAR" ), getExceptionInterceptor ()));
4105+ tuples .add (new ByteArrayRow (getTypeInfo ("YEAR" ), getExceptionInterceptor ()));
40854106
40864107 // TODO add missed types (aliases)
40874108
0 commit comments