From 167fe19d9bde9214f8e8a798f359b0a2093b6be9 Mon Sep 17 00:00:00 2001 From: Sachin Kapse Date: Wed, 25 Mar 2020 21:23:36 +0530 Subject: [PATCH] Code changes for SDENT-167: - Updating metadata.properties and metadata_lc.properties files to hide internal schemas from external JDBC Tools. --- .../internal/impl/jdbc/metadata.properties | 28 +++++++++++-------- .../internal/impl/jdbc/metadata_lc.properties | 4 +++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/gemfirexd/prebuild/src/main/resources/com/pivotal/gemfirexd/internal/impl/jdbc/metadata.properties b/gemfirexd/prebuild/src/main/resources/com/pivotal/gemfirexd/internal/impl/jdbc/metadata.properties index ac4360420..1a9761656 100644 --- a/gemfirexd/prebuild/src/main/resources/com/pivotal/gemfirexd/internal/impl/jdbc/metadata.properties +++ b/gemfirexd/prebuild/src/main/resources/com/pivotal/gemfirexd/internal/impl/jdbc/metadata.properties @@ -132,18 +132,22 @@ getProcedures40=\ # getSchemas=\ SELECT SCHEMANAME AS TABLE_SCHEM, \ - CAST(NULL AS VARCHAR(128)) AS TABLE_CATALOG \ - FROM SYS.SYSSCHEMAS \ - WHERE ((1=1) OR ? IS NOT NULL) \ - AND SCHEMANAME LIKE ? \ -\ -UNION \ -\ - SELECT DISTINCT SCHEMANAME AS TABLE_SCHEM, \ - CAST(NULL AS VARCHAR(128)) AS TABLE_CATALOG \ - FROM SYS.HIVETABLES \ - WHERE SCHEMANAME LIKE ? \ -ORDER BY TABLE_SCHEM + CAST(NULL AS VARCHAR(128)) AS TABLE_CATALOG \ + FROM SYS.SYSSCHEMAS \ + WHERE ((1=1) OR ? IS NOT NULL) \ + AND SCHEMANAME LIKE ? \ + AND SCHEMANAME NOT IN ('NULLID', 'SNAPPY_HIVE_METASTORE','SQLJ','SYSCAT', \ + 'SYSCS_DIAG','SYSCS_UTIL','SYSFUN','SYSIBM','SYSPROC','SYSSTAT') \ + \ + UNION \ + \ + SELECT DISTINCT SCHEMANAME AS TABLE_SCHEM, \ + CAST(NULL AS VARCHAR(128)) AS TABLE_CATALOG \ + FROM SYS.HIVETABLES \ + WHERE SCHEMANAME LIKE ? \ + AND SCHEMANAME NOT IN ('NULLID', 'SNAPPY_HIVE_METASTORE','SQLJ','SYSCAT', \ + 'SYSCS_DIAG','SYSCS_UTIL','SYSFUN','SYSIBM','SYSPROC','SYSSTAT') \ + ORDER BY TABLE_SCHEM # REMIND: presently table_type is a single char, we match JDBC # recommendations closer and make it a more obvious word. diff --git a/gemfirexd/prebuild/src/main/resources/com/pivotal/gemfirexd/internal/impl/jdbc/metadata_lc.properties b/gemfirexd/prebuild/src/main/resources/com/pivotal/gemfirexd/internal/impl/jdbc/metadata_lc.properties index 897c5bc47..64b668917 100644 --- a/gemfirexd/prebuild/src/main/resources/com/pivotal/gemfirexd/internal/impl/jdbc/metadata_lc.properties +++ b/gemfirexd/prebuild/src/main/resources/com/pivotal/gemfirexd/internal/impl/jdbc/metadata_lc.properties @@ -136,6 +136,8 @@ getSchemas=\ FROM SYS.SYSSCHEMAS \ WHERE ((1=1) OR ? IS NOT NULL) \ AND SCHEMANAME LIKE ? \ + AND SCHEMANAME NOT IN ('NULLID', 'SNAPPY_HIVE_METASTORE','SQLJ','SYSCAT', \ + 'SYSCS_DIAG','SYSCS_UTIL','SYSFUN','SYSIBM','SYSPROC','SYSSTAT') \ \ UNION \ \ @@ -143,6 +145,8 @@ UNION \ CAST(NULL AS VARCHAR(128)) AS TABLE_CATALOG \ FROM SYS.HIVETABLES \ WHERE SCHEMANAME LIKE ? \ + AND SCHEMANAME NOT IN ('NULLID', 'SNAPPY_HIVE_METASTORE','SQLJ','SYSCAT', \ + 'SYSCS_DIAG','SYSCS_UTIL','SYSFUN','SYSIBM','SYSPROC','SYSSTAT') \ ORDER BY TABLE_SCHEM # REMIND: presently table_type is a single char, we match JDBC