Mercurial > hg > monetdb-java
comparison src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java @ 245:55375d489024
Corrected return values of DatabaseMetaData methods allTablesAreSelectable() and allProceduresAreCallable().
They used to return true but now return false.
This issue is found when analysing bug 6617.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Thu, 28 Jun 2018 18:33:03 +0200 (2018-06-28) |
parents | 68b9452f1215 |
children | 96057ee68017 d4baf8a4b43a |
comparison
equal
deleted
inserted
replaced
243:337a1292fe18 | 245:55375d489024 |
---|---|
105 } | 105 } |
106 return rs; | 106 return rs; |
107 } | 107 } |
108 | 108 |
109 /** | 109 /** |
110 * Can all the procedures returned by getProcedures be called | 110 * Retrieves whether the current user can call all the procedures |
111 * by the current user? | 111 * returned by the method getProcedures. |
112 * | 112 * |
113 * @return true if so | 113 * @return false because we currently return all procedures from sys.functions |
114 * and do not filter on EXECUTE privilege or procedure ownership. | |
114 */ | 115 */ |
115 @Override | 116 @Override |
116 public boolean allProceduresAreCallable() { | 117 public boolean allProceduresAreCallable() { |
117 return true; | 118 return false; |
118 } | 119 } |
119 | 120 |
120 /** | 121 /** |
121 * Can all the tables returned by getTable be SELECTed by | 122 * Retrieves whether the current user can use all the tables |
122 * the current user? | 123 * returned by the method getTables in a SELECT statement. |
123 * | 124 * |
124 * @return true because we only have one user a.t.m. | 125 * @return false because we currently return all tables from sys.tables |
126 * and do not filter on SELECT privilege or table ownership. | |
125 */ | 127 */ |
126 @Override | 128 @Override |
127 public boolean allTablesAreSelectable() { | 129 public boolean allTablesAreSelectable() { |
128 return true; | 130 return false; |
129 } | 131 } |
130 | 132 |
131 /** | 133 /** |
132 * What is the URL for this database? | 134 * What is the URL for this database? |
133 * | 135 * |
1696 * null means that the catalog name should not be used to narrow the search | 1698 * null means that the catalog name should not be used to narrow the search |
1697 * @param schemaPattern - a schema name pattern; must match the schema name as it is stored in the database; | 1699 * @param schemaPattern - a schema name pattern; must match the schema name as it is stored in the database; |
1698 * "" retrieves those without a schema; | 1700 * "" retrieves those without a schema; |
1699 * null means that the schema name should not be used to narrow the search | 1701 * null means that the schema name should not be used to narrow the search |
1700 * @param procedureNamePattern - a procedure name pattern; must match the procedure name as it is stored in the database | 1702 * @param procedureNamePattern - a procedure name pattern; must match the procedure name as it is stored in the database |
1703 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
1701 * @return ResultSet - each row is a procedure description | 1704 * @return ResultSet - each row is a procedure description |
1702 * @throws SQLException if a database access error occurs | 1705 * @throws SQLException if a database access error occurs |
1703 */ | 1706 */ |
1704 @Override | 1707 @Override |
1705 public ResultSet getProcedures( | 1708 public ResultSet getProcedures( |
1805 * null means that the catalog name should not be used to narrow the search | 1808 * null means that the catalog name should not be used to narrow the search |
1806 * @param schemaPattern - a schema name pattern; must match the schema name as it is stored in the database; | 1809 * @param schemaPattern - a schema name pattern; must match the schema name as it is stored in the database; |
1807 * "" retrieves those without a schema; | 1810 * "" retrieves those without a schema; |
1808 * null means that the schema name should not be used to narrow the search | 1811 * null means that the schema name should not be used to narrow the search |
1809 * @param procedureNamePattern - a procedure name pattern; must match the procedure name as it is stored in the database | 1812 * @param procedureNamePattern - a procedure name pattern; must match the procedure name as it is stored in the database |
1813 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
1810 * @param columnNamePattern - a column name pattern; must match the column name as it is stored in the database | 1814 * @param columnNamePattern - a column name pattern; must match the column name as it is stored in the database |
1815 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
1811 * @return ResultSet - each row describes a stored procedure parameter or column | 1816 * @return ResultSet - each row describes a stored procedure parameter or column |
1812 * @throws SQLException if a database-access error occurs | 1817 * @throws SQLException if a database-access error occurs |
1813 * @see #getSearchStringEscape | 1818 * @see #getSearchStringEscape |
1814 */ | 1819 */ |
1815 @Override | 1820 @Override |
1875 | 1880 |
1876 //== this is a helper method which does not belong to the interface | 1881 //== this is a helper method which does not belong to the interface |
1877 | 1882 |
1878 /** | 1883 /** |
1879 * Returns a SQL match part string where depending on the input value we | 1884 * Returns a SQL match part string where depending on the input value we |
1880 * compose an exact match (use =) or match with wildcards (use LIKE) | 1885 * compose an exact match (use =) or match with wildcards (use LIKE) or IS NULL |
1881 * | 1886 * |
1882 * @param in the string to match | 1887 * @param in the string to match |
1883 * @return the SQL match part string | 1888 * @return the SQL match part string |
1884 */ | 1889 */ |
1885 private static final String composeMatchPart(String in) { | 1890 private static final String composeMatchPart(String in) { |
1939 * @param schemaPattern - a schema name pattern; must match the schema name as it is stored | 1944 * @param schemaPattern - a schema name pattern; must match the schema name as it is stored |
1940 * in the database; "" retrieves those without a schema; | 1945 * in the database; "" retrieves those without a schema; |
1941 * null means that the schema name should not be used to narrow the search | 1946 * null means that the schema name should not be used to narrow the search |
1942 * @param tableNamePattern - a table name pattern; must match the table name as it is stored in the database | 1947 * @param tableNamePattern - a table name pattern; must match the table name as it is stored in the database |
1943 * For all tables this should be "%" | 1948 * For all tables this should be "%" |
1949 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
1944 * @param types - a list of table types, which must be from the list of table types returned | 1950 * @param types - a list of table types, which must be from the list of table types returned |
1945 * from getTableTypes(),to include; null returns all types | 1951 * from getTableTypes(),to include; null returns all types |
1946 * @return ResultSet - each row is a table description | 1952 * @return ResultSet - each row is a table description |
1947 * @throws SQLException if a database-access error occurs. | 1953 * @throws SQLException if a database-access error occurs. |
1948 */ | 1954 */ |
2197 * @param schemaPattern - a schema name pattern; must match the schema name as it is stored | 2203 * @param schemaPattern - a schema name pattern; must match the schema name as it is stored |
2198 * in the database; "" retrieves those without a schema; | 2204 * in the database; "" retrieves those without a schema; |
2199 * null means that the schema name should not be used to narrow the search | 2205 * null means that the schema name should not be used to narrow the search |
2200 * @param tableNamePattern - a table name pattern; must match the table name as it is stored in the database | 2206 * @param tableNamePattern - a table name pattern; must match the table name as it is stored in the database |
2201 * For all tables this should be "%" | 2207 * For all tables this should be "%" |
2208 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
2202 * @param columnNamePattern - a column name pattern; must match the column name as it is stored in the database | 2209 * @param columnNamePattern - a column name pattern; must match the column name as it is stored in the database |
2210 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
2203 * @return ResultSet - each row is a column description | 2211 * @return ResultSet - each row is a column description |
2204 * @throws SQLException if a database error occurs | 2212 * @throws SQLException if a database error occurs |
2205 * @see #getSearchStringEscape | 2213 * @see #getSearchStringEscape |
2206 */ | 2214 */ |
2207 @Override | 2215 @Override |
2293 * </OL> | 2301 * </OL> |
2294 * | 2302 * |
2295 * @param catalog a catalog name; "" retrieves those without a catalog | 2303 * @param catalog a catalog name; "" retrieves those without a catalog |
2296 * @param schemaPattern a schema name; "" retrieves those without a schema | 2304 * @param schemaPattern a schema name; "" retrieves those without a schema |
2297 * @param tableNamePattern a table name | 2305 * @param tableNamePattern a table name |
2306 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
2298 * @param columnNamePattern a column name pattern | 2307 * @param columnNamePattern a column name pattern |
2308 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
2299 * @return ResultSet each row is a column privilege description | 2309 * @return ResultSet each row is a column privilege description |
2300 * @see #getSearchStringEscape | 2310 * @see #getSearchStringEscape |
2301 * @throws SQLException if a database error occurs | 2311 * @throws SQLException if a database error occurs |
2302 */ | 2312 */ |
2303 @Override | 2313 @Override |
2392 * </OL> | 2402 * </OL> |
2393 * | 2403 * |
2394 * @param catalog a catalog name; "" retrieves those without a catalog | 2404 * @param catalog a catalog name; "" retrieves those without a catalog |
2395 * @param schemaPattern a schema name pattern; "" retrieves those without a schema | 2405 * @param schemaPattern a schema name pattern; "" retrieves those without a schema |
2396 * @param tableNamePattern a table name pattern | 2406 * @param tableNamePattern a table name pattern |
2407 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
2397 * @return ResultSet each row is a table privilege description | 2408 * @return ResultSet each row is a table privilege description |
2398 * @see #getSearchStringEscape | 2409 * @see #getSearchStringEscape |
2399 * @throws SQLException if a database error occurs | 2410 * @throws SQLException if a database error occurs |
2400 */ | 2411 */ |
2401 @Override | 2412 @Override |
2489 * </OL> | 2500 * </OL> |
2490 * | 2501 * |
2491 * @param catalog a catalog name; "" retrieves those without a catalog | 2502 * @param catalog a catalog name; "" retrieves those without a catalog |
2492 * @param schema a schema name; "" retrieves those without a schema | 2503 * @param schema a schema name; "" retrieves those without a schema |
2493 * @param table a table name | 2504 * @param table a table name |
2505 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
2494 * @param scope the scope of interest; use same values as SCOPE | 2506 * @param scope the scope of interest; use same values as SCOPE |
2495 * @param nullable include columns that are nullable? | 2507 * @param nullable include columns that are nullable? |
2496 * @return ResultSet each row is a column description | 2508 * @return ResultSet each row is a column description |
2497 * @throws SQLException if a database error occurs | 2509 * @throws SQLException if a database error occurs |
2498 */ | 2510 */ |
2575 * </OL> | 2587 * </OL> |
2576 * | 2588 * |
2577 * @param catalog a catalog name; "" retrieves those without a catalog | 2589 * @param catalog a catalog name; "" retrieves those without a catalog |
2578 * @param schema a schema name; "" retrieves those without a schema | 2590 * @param schema a schema name; "" retrieves those without a schema |
2579 * @param table a table name | 2591 * @param table a table name |
2592 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
2580 * @return ResultSet each row is a column description | 2593 * @return ResultSet each row is a column description |
2581 * @throws SQLException if a database error occurs | 2594 * @throws SQLException if a database error occurs |
2582 */ | 2595 */ |
2583 @Override | 2596 @Override |
2584 public ResultSet getVersionColumns( | 2597 public ResultSet getVersionColumns( |
2615 * <LI><B>KEY_SEQ</B> short => sequence number within primary key | 2628 * <LI><B>KEY_SEQ</B> short => sequence number within primary key |
2616 * <LI><B>PK_NAME</B> String => primary key name (may be null) | 2629 * <LI><B>PK_NAME</B> String => primary key name (may be null) |
2617 * </OL> | 2630 * </OL> |
2618 * | 2631 * |
2619 * @param catalog a catalog name; "" retrieves those without a catalog | 2632 * @param catalog a catalog name; "" retrieves those without a catalog |
2620 * @param schema a schema name pattern; "" retrieves those | 2633 * @param schema a schema name pattern; "" retrieves those without a schema |
2621 * without a schema | |
2622 * @param table a table name | 2634 * @param table a table name |
2635 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
2623 * @return ResultSet each row is a primary key column description | 2636 * @return ResultSet each row is a primary key column description |
2624 * @throws SQLException if a database error occurs | 2637 * @throws SQLException if a database error occurs |
2625 */ | 2638 */ |
2626 @Override | 2639 @Override |
2627 public ResultSet getPrimaryKeys( | 2640 public ResultSet getPrimaryKeys( |
2752 * </OL> | 2765 * </OL> |
2753 * | 2766 * |
2754 * @param catalog a catalog name; "" retrieves those without a catalog | 2767 * @param catalog a catalog name; "" retrieves those without a catalog |
2755 * @param schema a schema name pattern; "" retrieves those without a schema | 2768 * @param schema a schema name pattern; "" retrieves those without a schema |
2756 * @param table a table name | 2769 * @param table a table name |
2770 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
2757 * @return ResultSet each row is a primary key column description | 2771 * @return ResultSet each row is a primary key column description |
2758 * @see #getExportedKeys | 2772 * @see #getExportedKeys |
2759 * @throws SQLException if a database error occurs | 2773 * @throws SQLException if a database error occurs |
2760 */ | 2774 */ |
2761 @Override | 2775 @Override |
2836 * </OL> | 2850 * </OL> |
2837 * | 2851 * |
2838 * @param catalog a catalog name; "" retrieves those without a catalog | 2852 * @param catalog a catalog name; "" retrieves those without a catalog |
2839 * @param schema a schema name pattern; "" retrieves those without a schema | 2853 * @param schema a schema name pattern; "" retrieves those without a schema |
2840 * @param table a table name | 2854 * @param table a table name |
2855 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
2841 * @return ResultSet each row is a foreign key column description | 2856 * @return ResultSet each row is a foreign key column description |
2842 * @see #getImportedKeys | 2857 * @see #getImportedKeys |
2843 * @throws SQLException if a database error occurs | 2858 * @throws SQLException if a database error occurs |
2844 */ | 2859 */ |
2845 @Override | 2860 @Override |
2923 * </OL> | 2938 * </OL> |
2924 * | 2939 * |
2925 * @param pcatalog primary key catalog name; "" retrieves those without a catalog | 2940 * @param pcatalog primary key catalog name; "" retrieves those without a catalog |
2926 * @param pschema primary key schema name pattern; "" retrieves those without a schema | 2941 * @param pschema primary key schema name pattern; "" retrieves those without a schema |
2927 * @param ptable primary key table name | 2942 * @param ptable primary key table name |
2943 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
2928 * @param fcatalog foreign key catalog name; "" retrieves those without a catalog | 2944 * @param fcatalog foreign key catalog name; "" retrieves those without a catalog |
2929 * @param fschema foreign key schema name pattern; "" retrieves those without a schema | 2945 * @param fschema foreign key schema name pattern; "" retrieves those without a schema |
2930 * @param ftable koreign key table name | 2946 * @param ftable koreign key table name |
2947 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
2931 * @return ResultSet each row is a foreign key column description | 2948 * @return ResultSet each row is a foreign key column description |
2932 * @throws SQLException if a database error occurs | 2949 * @throws SQLException if a database error occurs |
2933 * @see #getImportedKeys | 2950 * @see #getImportedKeys |
2934 */ | 2951 */ |
2935 @Override | 2952 @Override |
3100 * </OL> | 3117 * </OL> |
3101 * | 3118 * |
3102 * @param catalog a catalog name; "" retrieves those without a catalog | 3119 * @param catalog a catalog name; "" retrieves those without a catalog |
3103 * @param schema a schema name pattern; "" retrieves those without a schema | 3120 * @param schema a schema name pattern; "" retrieves those without a schema |
3104 * @param table a table name | 3121 * @param table a table name |
3122 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
3105 * @param unique when true, return only indices for unique values; | 3123 * @param unique when true, return only indices for unique values; |
3106 * when false, return indices regardless of whether unique or not | 3124 * when false, return indices regardless of whether unique or not |
3107 * @param approximate when true, result is allowed to reflect approximate | 3125 * @param approximate when true, result is allowed to reflect approximate |
3108 * or out of data values; when false, results are requested to be | 3126 * or out of data values; when false, results are requested to be |
3109 * accurate | 3127 * accurate |
3466 * <P><B>Note:</B> If the driver does not support type hierarchies, an | 3484 * <P><B>Note:</B> If the driver does not support type hierarchies, an |
3467 * empty result set is returned. | 3485 * empty result set is returned. |
3468 * | 3486 * |
3469 * @param catalog a catalog name; "" retrieves those without a catalog; | 3487 * @param catalog a catalog name; "" retrieves those without a catalog; |
3470 * <code>null</code> means drop catalog name from the selection criteria | 3488 * <code>null</code> means drop catalog name from the selection criteria |
3471 * @param schemaPattern a schema name pattern; "" retrieves those | 3489 * @param schemaPattern a schema name pattern; "" retrieves those without a schema |
3472 * without a schema | 3490 * @param typeNamePattern a UDT name pattern; may be a fully-qualified name |
3473 * @param typeNamePattern a UDT name pattern; may be a fully-qualified | |
3474 * name | |
3475 * @return a <code>ResultSet</code> object in which a row gives information | 3491 * @return a <code>ResultSet</code> object in which a row gives information |
3476 * about the designated UDT | 3492 * about the designated UDT |
3477 * @throws SQLException if a database access error occurs | 3493 * @throws SQLException if a database access error occurs |
3478 */ | 3494 */ |
3479 @Override | 3495 @Override |
3514 * <P><B>Note:</B> If the driver does not support type hierarchies, an | 3530 * <P><B>Note:</B> If the driver does not support type hierarchies, an |
3515 * empty result set is returned. | 3531 * empty result set is returned. |
3516 * | 3532 * |
3517 * @param catalog a catalog name; "" retrieves those without a catalog; | 3533 * @param catalog a catalog name; "" retrieves those without a catalog; |
3518 * <code>null</code> means drop catalog name from the selection criteria | 3534 * <code>null</code> means drop catalog name from the selection criteria |
3519 * @param schemaPattern a schema name pattern; "" retrieves those | 3535 * @param schemaPattern a schema name pattern; "" retrieves those without a schema |
3520 * without a schema | 3536 * @param tableNamePattern a table name pattern; may be a fully-qualified name |
3521 * @param tableNamePattern a table name pattern; may be a fully-qualified | |
3522 * name | |
3523 * @return a <code>ResultSet</code> object in which each row is a type description | 3537 * @return a <code>ResultSet</code> object in which each row is a type description |
3524 * @throws SQLException if a database access error occurs | 3538 * @throws SQLException if a database access error occurs |
3525 */ | 3539 */ |
3526 @Override | 3540 @Override |
3527 public ResultSet getSuperTables( | 3541 public ResultSet getSuperTables( |
3903 * name as it is stored in the database; "" retrieves those | 3917 * name as it is stored in the database; "" retrieves those |
3904 * without a schema; null means that the schema name should | 3918 * without a schema; null means that the schema name should |
3905 * not be used to narrow the search | 3919 * not be used to narrow the search |
3906 * @param functionNamePattern a function name pattern; must match | 3920 * @param functionNamePattern a function name pattern; must match |
3907 * the function name as it is stored in the database | 3921 * the function name as it is stored in the database |
3922 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
3908 * @return ResultSet - each row is a function description | 3923 * @return ResultSet - each row is a function description |
3909 * @throws SQLException if a database access error occurs | 3924 * @throws SQLException if a database access error occurs |
3910 */ | 3925 */ |
3911 @Override | 3926 @Override |
3912 public ResultSet getFunctions( | 3927 public ResultSet getFunctions( |
4006 * name as it is stored in the database; "" retrieves those | 4021 * name as it is stored in the database; "" retrieves those |
4007 * without a schema; null means that the schema name should | 4022 * without a schema; null means that the schema name should |
4008 * not be used to narrow the search | 4023 * not be used to narrow the search |
4009 * @param functionNamePattern a procedure name pattern; must match the | 4024 * @param functionNamePattern a procedure name pattern; must match the |
4010 * function name as it is stored in the database | 4025 * function name as it is stored in the database |
4026 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
4011 * @param columnNamePattern a parameter name pattern; must match the | 4027 * @param columnNamePattern a parameter name pattern; must match the |
4012 * parameter or column name as it is stored in the database | 4028 * parameter or column name as it is stored in the database |
4029 * Note that our implementation allows this param to be null also (for efficiency as no extra LIKE "%" condition is added to be evaluated). | |
4013 * @return ResultSet - each row describes a user function parameter, | 4030 * @return ResultSet - each row describes a user function parameter, |
4014 * column or return type | 4031 * column or return type |
4015 * @throws SQLException - if a database access error occurs | 4032 * @throws SQLException - if a database access error occurs |
4016 */ | 4033 */ |
4017 @Override | 4034 @Override |