@@ -3987,7 +3987,29 @@ private byte[][] getTypeInfo(String mysqlTypeName) throws SQLException {
3987
3987
rowVal [8 ] = Integer .toString (java .sql .DatabaseMetaData .typeSearchable ).getBytes (); // Searchable
3988
3988
rowVal [9 ] = s2b (mt .isAllowed (MysqlType .FIELD_FLAG_UNSIGNED ) ? "true" : "false" ); // Unsignable
3989
3989
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
+ }
3991
4013
rowVal [12 ] = s2b (mt .getName ()); // Locale Type Name
3992
4014
switch (mt ) {
3993
4015
case DECIMAL : // TODO is it right? DECIMAL isn't a floating-point number...
@@ -4038,50 +4060,49 @@ public java.sql.ResultSet getTypeInfo() throws SQLException {
4038
4060
4039
4061
ArrayList <Row > tuples = new ArrayList <>();
4040
4062
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 ()));
4048
4063
tuples .add (new ByteArrayRow (getTypeInfo ("BIGINT" ), getExceptionInterceptor ()));
4049
4064
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 ()));
4056
4065
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 ()));
4061
4069
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 ()));
4064
4072
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 ()));
4068
4079
tuples .add (new ByteArrayRow (getTypeInfo ("INT" ), getExceptionInterceptor ()));
4069
4080
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 ()));
4070
4088
tuples .add (new ByteArrayRow (getTypeInfo ("MEDIUMINT" ), getExceptionInterceptor ()));
4071
4089
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 ()));
4072
4094
tuples .add (new ByteArrayRow (getTypeInfo ("SMALLINT" ), getExceptionInterceptor ()));
4073
4095
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 ()));
4082
4097
tuples .add (new ByteArrayRow (getTypeInfo ("TIME" ), getExceptionInterceptor ()));
4083
- tuples .add (new ByteArrayRow (getTypeInfo ("DATETIME" ), getExceptionInterceptor ()));
4084
4098
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 ()));
4085
4106
4086
4107
// TODO add missed types (aliases)
4087
4108
0 commit comments