|
24 | 24 | import static java.sql.RowIdLifetime.ROWID_UNSUPPORTED; |
25 | 25 | import static java.util.Arrays.asList; |
26 | 26 | import static java.util.Collections.singletonList; |
27 | | -import static org.apache.ignite.internal.jdbc.JdbcDatabaseMetataUtils.createObjectListResultSet; |
| 27 | +import static org.apache.ignite.internal.jdbc.JdbcDatabaseMetadataUtils.createObjectListResultSet; |
28 | 28 | import static org.apache.ignite.internal.jdbc.proto.SqlStateCode.CONNECTION_CLOSED; |
29 | 29 |
|
30 | 30 | import java.sql.Connection; |
|
34 | 34 | import java.sql.SQLException; |
35 | 35 | import java.sql.Types; |
36 | 36 | import java.util.ArrayList; |
37 | | -import java.util.Collections; |
38 | 37 | import java.util.LinkedList; |
39 | 38 | import java.util.List; |
40 | 39 | import java.util.concurrent.CancellationException; |
@@ -815,12 +814,6 @@ public boolean dataDefinitionIgnoredInTransactions() { |
815 | 814 | return false; |
816 | 815 | } |
817 | 816 |
|
818 | | - private static ColumnMetadata columnMeta(String name, ColumnType type) { |
819 | | - return new ColumnMetadataImpl(name, type, -1, -1, true, null); |
820 | | - } |
821 | | - |
822 | | - |
823 | | - |
824 | 817 | /** {@inheritDoc} */ |
825 | 818 | @Override |
826 | 819 | public ResultSet getProcedures(String catalog, String schemaPtrn, |
@@ -1009,13 +1002,13 @@ public ResultSet getColumns(String catalog, String schemaPtrn, String tblNamePtr |
1009 | 1002 | columnMeta("TABLE_SCHEM", ColumnType.STRING), // 2 |
1010 | 1003 | columnMeta("TABLE_NAME", ColumnType.STRING), // 3 |
1011 | 1004 | columnMeta("COLUMN_NAME", ColumnType.STRING), // 4 |
1012 | | - columnMeta("DATA_TYPE", ColumnType.INT16), // 5 |
| 1005 | + columnMeta("DATA_TYPE", ColumnType.INT32), // 5 |
1013 | 1006 | columnMeta("TYPE_NAME", ColumnType.STRING), // 6 |
1014 | 1007 | columnMeta("COLUMN_SIZE", ColumnType.INT32), // 7 |
1015 | 1008 | columnMeta("BUFFER_LENGTH", ColumnType.INT32), // 8 |
1016 | 1009 | columnMeta("DECIMAL_DIGITS", ColumnType.INT32), // 9 |
1017 | 1010 | columnMeta("NUM_PREC_RADIX", ColumnType.INT16), // 10 |
1018 | | - columnMeta("NULLABLE", ColumnType.INT16), // 11 |
| 1011 | + columnMeta("NULLABLE", ColumnType.INT32), // 11 |
1019 | 1012 | columnMeta("REMARKS", ColumnType.STRING), // 12 |
1020 | 1013 | columnMeta("COLUMN_DEF", ColumnType.STRING), // 13 |
1021 | 1014 | columnMeta("SQL_DATA_TYPE", ColumnType.INT32), // 14 |
@@ -1378,7 +1371,7 @@ public ResultSet getIndexInfo(String catalog, String schema, String tbl, boolean |
1378 | 1371 | columnMeta("FILTER_CONDITION", ColumnType.STRING)); |
1379 | 1372 |
|
1380 | 1373 | if (!isValidCatalog(catalog)) { |
1381 | | - return createObjectListResultSet(Collections.emptyList(), meta); |
| 1374 | + return createObjectListResultSet(meta); |
1382 | 1375 | } |
1383 | 1376 |
|
1384 | 1377 | throw new UnsupportedOperationException("Index info is not supported yet."); |
@@ -1786,13 +1779,13 @@ public static List<Object> columnRow(JdbcColumnMeta colMeta, int pos) { |
1786 | 1779 | row.add(colMeta.schemaName()); // 2. TABLE_SCHEM |
1787 | 1780 | row.add(colMeta.tableName()); // 3. TABLE_NAME |
1788 | 1781 | row.add(colMeta.columnLabel()); // 4. COLUMN_NAME |
1789 | | - row.add((short) colMeta.dataType()); // 5. DATA_TYPE |
| 1782 | + row.add(colMeta.dataType()); // 5. DATA_TYPE |
1790 | 1783 | row.add(colMeta.dataTypeName()); // 6. TYPE_NAME |
1791 | 1784 | row.add(colMeta.precision() == -1 ? null : colMeta.precision()); // 7. COLUMN_SIZE |
1792 | 1785 | row.add((Integer) null); // 8. BUFFER_LENGTH |
1793 | 1786 | row.add(colMeta.scale() == -1 ? null : colMeta.scale()); // 9. DECIMAL_DIGITS |
1794 | 1787 | row.add(10); // 10. NUM_PREC_RADIX |
1795 | | - row.add(colMeta.isNullable() ? (short) columnNullable : (short) columnNoNulls); // 11. NULLABLE |
| 1788 | + row.add(colMeta.isNullable() ? columnNullable : columnNoNulls); // 11. NULLABLE |
1796 | 1789 | row.add((String) null); // 12. REMARKS |
1797 | 1790 | row.add(colMeta.defaultValue()); // 13. COLUMN_DEF |
1798 | 1791 | row.add(colMeta.dataType()); // 14. SQL_DATA_TYPE |
@@ -1840,4 +1833,8 @@ private void ensureNotClosed() throws SQLException { |
1840 | 1833 | throw new SQLException("Connection is closed.", CONNECTION_CLOSED); |
1841 | 1834 | } |
1842 | 1835 | } |
| 1836 | + |
| 1837 | + private static ColumnMetadata columnMeta(String name, ColumnType type) { |
| 1838 | + return new ColumnMetadataImpl(name, type, -1, -1, true, null); |
| 1839 | + } |
1843 | 1840 | } |
0 commit comments