Mercurial > hg > monetdb-java
comparison tests/JDBC_API_Tester.java @ 854:cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Thu, 18 Jan 2024 16:21:25 +0100 (15 months ago) |
parents | d9a45743536d |
children | 56fe57835912 |
comparison
equal
deleted
inserted
replaced
853:ca7f27763249 | 854:cd365d70c745 |
---|---|
739 "CREATE GLOBAL TEMP TABLE glbl_pk_uc (id1 INT NOT NULL PRIMARY KEY, name1 VARCHAR(99) UNIQUE)"); | 739 "CREATE GLOBAL TEMP TABLE glbl_pk_uc (id1 INT NOT NULL PRIMARY KEY, name1 VARCHAR(99) UNIQUE)"); |
740 | 740 |
741 handleExecuteDDL(stmt, action, "type", "xml", "CREATE TYPE xml EXTERNAL NAME xml"); | 741 handleExecuteDDL(stmt, action, "type", "xml", "CREATE TYPE xml EXTERNAL NAME xml"); |
742 | 742 |
743 try { | 743 try { |
744 final boolean isPostDec2023 = !(dbmsMajorVersion == 11 && dbmsMinorVersion <= 51); // Change 51 into 49 after branch cleanup_types has been merged into default | |
744 DatabaseMetaData dbmd = con.getMetaData(); | 745 DatabaseMetaData dbmd = con.getMetaData(); |
745 | 746 |
746 // inspect the catalog by use of dbmd functions | 747 // inspect the catalog by use of dbmd functions |
747 compareResultSet(dbmd.getCatalogs(), "getCatalogs()", | 748 compareResultSet(dbmd.getCatalogs(), "getCatalogs()", |
748 "Resultset with 1 columns\n" + | 749 "Resultset with 1 columns\n" + |
778 | 779 |
779 compareResultSet(dbmd.getColumns(null, "sys", "table\\_types", null), "getColumns(null, sys, table\\_types, null)", | 780 compareResultSet(dbmd.getColumns(null, "sys", "table\\_types", null), "getColumns(null, sys, table\\_types, null)", |
780 "Resultset with 24 columns\n" + | 781 "Resultset with 24 columns\n" + |
781 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SCOPE_CATALOG SCOPE_SCHEMA SCOPE_TABLE SOURCE_DATA_TYPE IS_AUTOINCREMENT IS_GENERATEDCOLUMN\n" + | 782 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SCOPE_CATALOG SCOPE_SCHEMA SCOPE_TABLE SOURCE_DATA_TYPE IS_AUTOINCREMENT IS_GENERATEDCOLUMN\n" + |
782 "char(1) varchar(1024) varchar(1024) varchar(1024) int varchar(1024) int int int int int varchar(65000) varchar(2048) int int bigint int varchar(3) char(1) char(1) char(1) smallint char(3) varchar(3)\n" + | 783 "char(1) varchar(1024) varchar(1024) varchar(1024) int varchar(1024) int int int int int varchar(65000) varchar(2048) int int bigint int varchar(3) char(1) char(1) char(1) smallint char(3) varchar(3)\n" + |
783 "null sys table_types table_type_id 5 smallint 16 0 0 2 0 null null 0 0 null 1 NO null null null null NO NO\n" + | 784 "null sys table_types table_type_id 5 smallint " + (isPostDec2023 ? "15" : "16") + " 0 0 2 0 null null 0 0 null 1 NO null null null null NO NO\n" + |
784 "null sys table_types table_type_name 12 varchar 25 0 0 0 0 null null 0 0 100 2 NO null null null null NO NO\n"); | 785 "null sys table_types table_type_name 12 varchar 25 0 0 0 0 null null 0 0 100 2 NO null null null null NO NO\n"); |
785 | 786 |
786 compareResultSet(dbmd.getPrimaryKeys(null, "sys", "table\\_types"), "getPrimaryKeys(null, sys, table\\_types)", | 787 compareResultSet(dbmd.getPrimaryKeys(null, "sys", "table\\_types"), "getPrimaryKeys(null, sys, table\\_types)", |
787 "Resultset with 6 columns\n" + | 788 "Resultset with 6 columns\n" + |
788 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + | 789 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
840 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "function_languages", DatabaseMetaData.bestRowTransaction, true), | 841 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "function_languages", DatabaseMetaData.bestRowTransaction, true), |
841 "getBestRowIdentifier(null, sys, function_languages, DatabaseMetaData.bestRowTransaction, true)", | 842 "getBestRowIdentifier(null, sys, function_languages, DatabaseMetaData.bestRowTransaction, true)", |
842 "Resultset with 8 columns\n" + | 843 "Resultset with 8 columns\n" + |
843 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 844 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
844 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 845 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
845 "2 language_id 5 smallint 16 0 0 1\n"); | 846 "2 language_id 5 smallint " + (isPostDec2023 ? "15" : "16") + " 0 0 1\n"); |
846 | 847 |
847 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), | 848 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
848 "getBestRowIdentifier(null, sys, nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", | 849 "getBestRowIdentifier(null, sys, nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
849 "Resultset with 8 columns\n" + | 850 "Resultset with 8 columns\n" + |
850 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 851 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
851 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 852 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
852 "2 id 4 int 32 0 0 1\n"); | 853 "2 id 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
853 | 854 |
854 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), | 855 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
855 "getBestRowIdentifier(null, sys, nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", | 856 "getBestRowIdentifier(null, sys, nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
856 "Resultset with 8 columns\n" + | 857 "Resultset with 8 columns\n" + |
857 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 858 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
858 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 859 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
859 "2 id 4 int 32 0 0 1\n"); | 860 "2 id 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
860 | 861 |
861 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_pk_uc", DatabaseMetaData.bestRowTransaction, true), | 862 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_pk_uc", DatabaseMetaData.bestRowTransaction, true), |
862 "getBestRowIdentifier(null, tmp, tmp_pk_uc, DatabaseMetaData.bestRowTransaction, true)", | 863 "getBestRowIdentifier(null, tmp, tmp_pk_uc, DatabaseMetaData.bestRowTransaction, true)", |
863 "Resultset with 8 columns\n" + | 864 "Resultset with 8 columns\n" + |
864 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 865 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
865 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 866 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
866 "2 id1 4 int 32 0 0 1\n"); | 867 "2 id1 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
867 | 868 |
868 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), | 869 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
869 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", | 870 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
870 "Resultset with 8 columns\n" + | 871 "Resultset with 8 columns\n" + |
871 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 872 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
872 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 873 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
873 "2 id2 4 int 32 0 0 1\n"); | 874 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
874 | 875 |
875 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), | 876 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
876 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", | 877 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
877 "Resultset with 8 columns\n" + | 878 "Resultset with 8 columns\n" + |
878 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 879 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
879 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 880 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
880 "2 id2 4 int 32 0 0 1\n"); | 881 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
881 | 882 |
882 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_pk_uc", DatabaseMetaData.bestRowTransaction, true), | 883 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_pk_uc", DatabaseMetaData.bestRowTransaction, true), |
883 "getBestRowIdentifier(null, tmp, glbl_pk_uc, DatabaseMetaData.bestRowTransaction, true)", | 884 "getBestRowIdentifier(null, tmp, glbl_pk_uc, DatabaseMetaData.bestRowTransaction, true)", |
884 "Resultset with 8 columns\n" + | 885 "Resultset with 8 columns\n" + |
885 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 886 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
886 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 887 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
887 "2 id1 4 int 32 0 0 1\n"); | 888 "2 id1 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
888 | 889 |
889 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), | 890 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
890 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", | 891 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
891 "Resultset with 8 columns\n" + | 892 "Resultset with 8 columns\n" + |
892 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 893 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
893 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 894 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
894 "2 id2 4 int 32 0 0 1\n"); | 895 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
895 | 896 |
896 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), | 897 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
897 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", | 898 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
898 "Resultset with 8 columns\n" + | 899 "Resultset with 8 columns\n" + |
899 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 900 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
900 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 901 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
901 "2 id2 4 int 32 0 0 1\n"); | 902 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
902 | 903 |
903 compareResultSet(dbmd.getTablePrivileges(null, "sys", "table\\_types"), "getTablePrivileges(null, sys, table\\_types)", | 904 compareResultSet(dbmd.getTablePrivileges(null, "sys", "table\\_types"), "getTablePrivileges(null, sys, table\\_types)", |
904 "Resultset with 7 columns\n" + | 905 "Resultset with 7 columns\n" + |
905 "TABLE_CAT TABLE_SCHEM TABLE_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n" + | 906 "TABLE_CAT TABLE_SCHEM TABLE_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n" + |
906 "char(1) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(40) varchar(3)\n" + | 907 "char(1) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(40) varchar(3)\n" + |
1010 sb.append("Failed to createStatement: ").append(e.getMessage()).append("\n"); | 1011 sb.append("Failed to createStatement: ").append(e.getMessage()).append("\n"); |
1011 } | 1012 } |
1012 | 1013 |
1013 /* servers before Jan2022 (11.45) have a problem (server crash and db corruption) | 1014 /* servers before Jan2022 (11.45) have a problem (server crash and db corruption) |
1014 with indexes created on temp tables, so conditionally execute those commands and tests */ | 1015 with indexes created on temp tables, so conditionally execute those commands and tests */ |
1015 boolean testCreateDropIndexOnTmpTables = !(dbmsMajorVersion == 11 && dbmsMinorVersion <= 43); | 1016 final boolean testCreateDropIndexOnTmpTables = !(dbmsMajorVersion == 11 && dbmsMinorVersion <= 43); |
1016 | 1017 |
1017 String action = "Create"; | 1018 String action = "Create"; |
1018 handleExecuteDDL(stmt, action, "schema", "jdbctst", "CREATE SCHEMA jdbctst; SET SCHEMA jdbctst;"); | 1019 handleExecuteDDL(stmt, action, "schema", "jdbctst", "CREATE SCHEMA jdbctst; SET SCHEMA jdbctst;"); |
1019 | 1020 |
1020 String objtype = "table"; | 1021 String objtype = "table"; |
1126 "COMMENT ON FUNCTION sys.env() IS 'sys.env() function comment';"); | 1127 "COMMENT ON FUNCTION sys.env() IS 'sys.env() function comment';"); |
1127 handleExecuteDDL(stmt, action, objtype, "sys.statistics()", | 1128 handleExecuteDDL(stmt, action, objtype, "sys.statistics()", |
1128 "COMMENT ON FUNCTION sys.statistics() IS 'sys.statistics() function comment';"); | 1129 "COMMENT ON FUNCTION sys.statistics() IS 'sys.statistics() function comment';"); |
1129 | 1130 |
1130 try { | 1131 try { |
1132 final boolean isPostDec2023 = !(dbmsMajorVersion == 11 && dbmsMinorVersion <= 51); // Change 51 into 49 after branch cleanup_types has been merged into default | |
1131 // query the catalog by calling DatabaseMetaData methods | 1133 // query the catalog by calling DatabaseMetaData methods |
1132 compareResultSet(dbmd.getCatalogs(), "getCatalogs()", | 1134 compareResultSet(dbmd.getCatalogs(), "getCatalogs()", |
1133 "Resultset with 1 columns\n" + | 1135 "Resultset with 1 columns\n" + |
1134 "TABLE_CAT\n" + | 1136 "TABLE_CAT\n" + |
1135 "char(1)\n"); | 1137 "char(1)\n"); |
1182 | 1184 |
1183 compareResultSet(dbmd.getColumns(null, "jdbctst", "pk\\_uc", null), "getColumns(null, jdbctst, pk\\_uc, null)", | 1185 compareResultSet(dbmd.getColumns(null, "jdbctst", "pk\\_uc", null), "getColumns(null, jdbctst, pk\\_uc, null)", |
1184 "Resultset with 24 columns\n" + | 1186 "Resultset with 24 columns\n" + |
1185 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SCOPE_CATALOG SCOPE_SCHEMA SCOPE_TABLE SOURCE_DATA_TYPE IS_AUTOINCREMENT IS_GENERATEDCOLUMN\n" + | 1187 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SCOPE_CATALOG SCOPE_SCHEMA SCOPE_TABLE SOURCE_DATA_TYPE IS_AUTOINCREMENT IS_GENERATEDCOLUMN\n" + |
1186 "char(1) varchar(1024) varchar(1024) varchar(1024) int varchar(1024) int int int int int varchar(65000) varchar(2048) int int bigint int varchar(3) char(1) char(1) char(1) smallint char(3) varchar(3)\n" + | 1188 "char(1) varchar(1024) varchar(1024) varchar(1024) int varchar(1024) int int int int int varchar(65000) varchar(2048) int int bigint int varchar(3) char(1) char(1) char(1) smallint char(3) varchar(3)\n" + |
1187 "null jdbctst pk_uc id1 4 int 32 0 0 2 0 null null 0 0 null 1 NO null null null null NO NO\n" + | 1189 "null jdbctst pk_uc id1 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 2 0 null null 0 0 null 1 NO null null null null NO NO\n" + |
1188 "null jdbctst pk_uc name1 12 varchar 99 0 0 0 1 null null 0 0 396 2 YES null null null null NO NO\n"); | 1190 "null jdbctst pk_uc name1 12 varchar 99 0 0 0 1 null null 0 0 396 2 YES null null null null NO NO\n"); |
1189 | 1191 |
1190 compareResultSet(dbmd.getColumns(null, "tmp", "tlargechar", null), "getColumns(null, tmp, tlargechar, null)", | 1192 compareResultSet(dbmd.getColumns(null, "tmp", "tlargechar", null), "getColumns(null, tmp, tlargechar, null)", |
1191 "Resultset with 24 columns\n" + | 1193 "Resultset with 24 columns\n" + |
1192 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SCOPE_CATALOG SCOPE_SCHEMA SCOPE_TABLE SOURCE_DATA_TYPE IS_AUTOINCREMENT IS_GENERATEDCOLUMN\n" + | 1194 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SCOPE_CATALOG SCOPE_SCHEMA SCOPE_TABLE SOURCE_DATA_TYPE IS_AUTOINCREMENT IS_GENERATEDCOLUMN\n" + |
1263 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "function_languages", DatabaseMetaData.bestRowTransaction, true), | 1265 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "function_languages", DatabaseMetaData.bestRowTransaction, true), |
1264 "getBestRowIdentifier(null, sys, function_languages, DatabaseMetaData.bestRowTransaction, true)", | 1266 "getBestRowIdentifier(null, sys, function_languages, DatabaseMetaData.bestRowTransaction, true)", |
1265 "Resultset with 8 columns\n" + | 1267 "Resultset with 8 columns\n" + |
1266 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 1268 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
1267 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 1269 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
1268 "2 language_id 5 smallint 16 0 0 1\n"); | 1270 "2 language_id 5 smallint " + (isPostDec2023 ? "15" : "16") + " 0 0 1\n"); |
1269 | 1271 |
1270 compareResultSet(dbmd.getBestRowIdentifier(null, "jdbctst", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), | 1272 compareResultSet(dbmd.getBestRowIdentifier(null, "jdbctst", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
1271 "getBestRowIdentifier(null, jdbctst, nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", | 1273 "getBestRowIdentifier(null, jdbctst, nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
1272 "Resultset with 8 columns\n" + | 1274 "Resultset with 8 columns\n" + |
1273 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 1275 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
1274 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 1276 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
1275 "2 id2 4 int 32 0 0 1\n"); | 1277 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
1276 | 1278 |
1277 compareResultSet(dbmd.getBestRowIdentifier(null, "jdbctst", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), | 1279 compareResultSet(dbmd.getBestRowIdentifier(null, "jdbctst", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
1278 "getBestRowIdentifier(null, jdbctst, nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", | 1280 "getBestRowIdentifier(null, jdbctst, nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
1279 "Resultset with 8 columns\n" + | 1281 "Resultset with 8 columns\n" + |
1280 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 1282 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
1281 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 1283 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
1282 "2 id2 4 int 32 0 0 1\n"); | 1284 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
1283 | 1285 |
1284 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_pk_uc", DatabaseMetaData.bestRowTransaction, true), | 1286 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_pk_uc", DatabaseMetaData.bestRowTransaction, true), |
1285 "getBestRowIdentifier(null, tmp, tmp_pk_uc, DatabaseMetaData.bestRowTransaction, true)", | 1287 "getBestRowIdentifier(null, tmp, tmp_pk_uc, DatabaseMetaData.bestRowTransaction, true)", |
1286 "Resultset with 8 columns\n" + | 1288 "Resultset with 8 columns\n" + |
1287 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 1289 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
1288 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 1290 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
1289 "2 id1 4 int 32 0 0 1\n"); | 1291 "2 id1 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
1290 | 1292 |
1291 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), | 1293 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
1292 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", | 1294 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
1293 "Resultset with 8 columns\n" + | 1295 "Resultset with 8 columns\n" + |
1294 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 1296 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
1295 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 1297 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
1296 "2 id2 4 int 32 0 0 1\n"); | 1298 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
1297 | 1299 |
1298 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), | 1300 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
1299 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", | 1301 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
1300 "Resultset with 8 columns\n" + | 1302 "Resultset with 8 columns\n" + |
1301 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 1303 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
1302 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 1304 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
1303 "2 id2 4 int 32 0 0 1\n"); | 1305 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
1304 | 1306 |
1305 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_pk_uc", DatabaseMetaData.bestRowTransaction, true), | 1307 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_pk_uc", DatabaseMetaData.bestRowTransaction, true), |
1306 "getBestRowIdentifier(null, tmp, glbl_pk_uc, DatabaseMetaData.bestRowTransaction, true)", | 1308 "getBestRowIdentifier(null, tmp, glbl_pk_uc, DatabaseMetaData.bestRowTransaction, true)", |
1307 "Resultset with 8 columns\n" + | 1309 "Resultset with 8 columns\n" + |
1308 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 1310 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
1309 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 1311 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
1310 "2 id1 4 int 32 0 0 1\n"); | 1312 "2 id1 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
1311 | 1313 |
1312 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), | 1314 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
1313 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", | 1315 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
1314 "Resultset with 8 columns\n" + | 1316 "Resultset with 8 columns\n" + |
1315 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 1317 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
1316 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 1318 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
1317 "2 id2 4 int 32 0 0 1\n"); | 1319 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
1318 | 1320 |
1319 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), | 1321 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
1320 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", | 1322 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
1321 "Resultset with 8 columns\n" + | 1323 "Resultset with 8 columns\n" + |
1322 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 1324 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
1323 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 1325 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
1324 "2 id2 4 int 32 0 0 1\n"); | 1326 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
1325 | 1327 |
1326 // also test a table without pk or uc, it should return a row for each column | 1328 // also test a table without pk or uc, it should return a row for each column |
1327 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "schemas", DatabaseMetaData.bestRowTransaction, true), | 1329 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "schemas", DatabaseMetaData.bestRowTransaction, true), |
1328 "getBestRowIdentifier(null, sys, schemas, DatabaseMetaData.bestRowTransaction, true)", | 1330 "getBestRowIdentifier(null, sys, schemas, DatabaseMetaData.bestRowTransaction, true)", |
1329 "Resultset with 8 columns\n" + | 1331 "Resultset with 8 columns\n" + |
1330 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 1332 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
1331 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 1333 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
1332 "2 id 4 int 32 0 0 1\n" + | 1334 "2 id 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n" + |
1333 "2 name 12 varchar 1024 0 0 1\n" + | 1335 "2 name 12 varchar 1024 0 0 1\n" + |
1334 "2 authorization 4 int 32 0 0 1\n" + | 1336 "2 authorization 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n" + |
1335 "2 owner 4 int 32 0 0 1\n" + | 1337 "2 owner 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n" + |
1336 "2 system 16 boolean 1 0 0 1\n"); | 1338 "2 system 16 boolean 1 0 0 1\n"); |
1337 | 1339 |
1338 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "_tables", DatabaseMetaData.bestRowTransaction, true), | 1340 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "_tables", DatabaseMetaData.bestRowTransaction, true), |
1339 "getBestRowIdentifier(null, sys, _tables, DatabaseMetaData.bestRowTransaction, true)", | 1341 "getBestRowIdentifier(null, sys, _tables, DatabaseMetaData.bestRowTransaction, true)", |
1340 "Resultset with 8 columns\n" + | 1342 "Resultset with 8 columns\n" + |
1341 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 1343 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
1342 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 1344 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
1343 "2 id 4 int 32 0 0 1\n" + | 1345 "2 id 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n" + |
1344 "2 name 12 varchar 1024 0 0 1\n" + | 1346 "2 name 12 varchar 1024 0 0 1\n" + |
1345 "2 schema_id 4 int 32 0 0 1\n" + | 1347 "2 schema_id 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n" + |
1346 "2 query 12 varchar 1048576 0 0 1\n" + | 1348 "2 query 12 varchar 1048576 0 0 1\n" + |
1347 "2 type 5 smallint 16 0 0 1\n" + | 1349 "2 type 5 smallint " + (isPostDec2023 ? "15" : "16") + " 0 0 1\n" + |
1348 "2 system 16 boolean 1 0 0 1\n" + | 1350 "2 system 16 boolean 1 0 0 1\n" + |
1349 "2 commit_action 5 smallint 16 0 0 1\n" + | 1351 "2 commit_action 5 smallint " + (isPostDec2023 ? "15" : "16") + " 0 0 1\n" + |
1350 "2 access 5 smallint 16 0 0 1\n"); | 1352 "2 access 5 smallint " + (isPostDec2023 ? "15" : "16") + " 0 0 1\n"); |
1351 | 1353 |
1352 // also test a view (without pk or uc of course), it should return no rows | 1354 // also test a view (without pk or uc of course), it should return no rows |
1353 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "tables", DatabaseMetaData.bestRowTransaction, true), | 1355 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "tables", DatabaseMetaData.bestRowTransaction, true), |
1354 "getBestRowIdentifier(null, sys, tables, DatabaseMetaData.bestRowTransaction, true)", | 1356 "getBestRowIdentifier(null, sys, tables, DatabaseMetaData.bestRowTransaction, true)", |
1355 "Resultset with 8 columns\n" + | 1357 "Resultset with 8 columns\n" + |
1359 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "table\\_types", DatabaseMetaData.bestRowTransaction, false), | 1361 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "table\\_types", DatabaseMetaData.bestRowTransaction, false), |
1360 "getBestRowIdentifier(null, sys, table\\_types, DatabaseMetaData.bestRowTransaction, false)", | 1362 "getBestRowIdentifier(null, sys, table\\_types, DatabaseMetaData.bestRowTransaction, false)", |
1361 "Resultset with 8 columns\n" + | 1363 "Resultset with 8 columns\n" + |
1362 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + | 1364 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
1363 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + | 1365 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
1364 "2 table_type_id 5 smallint 16 0 0 1\n"); | 1366 "2 table_type_id 5 smallint " + (isPostDec2023 ? "15" : "16") + " 0 0 1\n"); |
1365 | 1367 |
1366 compareResultSet(dbmd.getTablePrivileges(null, "sys", "table\\_types"), "getTablePrivileges(null, sys, table\\_types)", | 1368 compareResultSet(dbmd.getTablePrivileges(null, "sys", "table\\_types"), "getTablePrivileges(null, sys, table\\_types)", |
1367 "Resultset with 7 columns\n" + | 1369 "Resultset with 7 columns\n" + |
1368 "TABLE_CAT TABLE_SCHEM TABLE_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n" + | 1370 "TABLE_CAT TABLE_SCHEM TABLE_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n" + |
1369 "char(1) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(40) varchar(3)\n" + | 1371 "char(1) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(40) varchar(3)\n" + |