You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by pr...@apache.org on 2019/06/25 04:58:35 UTC

[ranger] branch master updated: RANGER-2479: Change test connection preferred SQL statement for Oracle DB Flavor

This is an automated email from the ASF dual-hosted git repository.

pradeep pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new a9b5e51  RANGER-2479: Change test connection preferred SQL statement for Oracle DB Flavor
a9b5e51 is described below

commit a9b5e51b1db5b0ebe5ba43c47ae37227a80e5530
Author: Pradeep <pr...@apache.org>
AuthorDate: Thu Jun 20 18:56:59 2019 +0530

    RANGER-2479: Change test connection preferred SQL statement for Oracle DB Flavor
---
 security-admin/scripts/setup.sh | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/security-admin/scripts/setup.sh b/security-admin/scripts/setup.sh
index 4916828..c3c67bb 100755
--- a/security-admin/scripts/setup.sh
+++ b/security-admin/scripts/setup.sh
@@ -221,7 +221,7 @@ getPropertyFromFile(){
 #Update Properties to File
 #$1 -> propertyName $2 -> newPropertyValue $3 -> fileName
 updatePropertyToFilePy(){
-        python update_property.py $1 $2 $3
+    python update_property.py $1 "${2}" $3
         check_ret_status $? "Update property failed for: " $1
 }
 
@@ -569,6 +569,10 @@ update_properties() {
 		propertyName=ranger.jpa.audit.jdbc.driver
 		newPropertyValue="net.sf.log4jdbc.DriverSpy"
 		updatePropertyToFilePy $propertyName $newPropertyValue $to_file_default
+
+		propertyName=ranger.jpa.jdbc.preferredtestquery
+		newPropertyValue="select 1;"
+		updatePropertyToFilePy $propertyName "${newPropertyValue}" $to_file_default
 	fi
 	if [ "${DB_FLAVOR}" == "ORACLE" ]
 	then
@@ -599,6 +603,10 @@ update_properties() {
 		propertyName=ranger.jpa.audit.jdbc.driver
 		newPropertyValue="oracle.jdbc.OracleDriver"
 		updatePropertyToFilePy $propertyName $newPropertyValue $to_file_default
+
+		propertyName=ranger.jpa.jdbc.preferredtestquery
+		newPropertyValue="select 1 from dual;"
+		updatePropertyToFilePy $propertyName "${newPropertyValue}" $to_file_default
 	fi
 	if [ "${DB_FLAVOR}" == "POSTGRES" ]
 	then
@@ -624,6 +632,10 @@ update_properties() {
 		propertyName=ranger.jpa.audit.jdbc.driver
 		newPropertyValue="org.postgresql.Driver"
 		updatePropertyToFilePy $propertyName $newPropertyValue $to_file_default
+
+		propertyName=ranger.jpa.jdbc.preferredtestquery
+		newPropertyValue="select 1;"
+		updatePropertyToFilePy $propertyName "${newPropertyValue}" $to_file_default
 	fi
 
 	if [ "${DB_FLAVOR}" == "MSSQL" ]
@@ -647,6 +659,10 @@ update_properties() {
 		propertyName=ranger.jpa.audit.jdbc.driver
 		newPropertyValue="com.microsoft.sqlserver.jdbc.SQLServerDriver"
 		updatePropertyToFilePy $propertyName $newPropertyValue $to_file_default
+
+		propertyName=ranger.jpa.jdbc.preferredtestquery
+		newPropertyValue="select 1;"
+		updatePropertyToFilePy $propertyName "${newPropertyValue}" $to_file_default
 	fi
 
 	if [ "${DB_FLAVOR}" == "SQLA" ]
@@ -670,6 +686,10 @@ update_properties() {
 		propertyName=ranger.jpa.audit.jdbc.driver
 		newPropertyValue="sap.jdbc4.sqlanywhere.IDriver"
 		updatePropertyToFilePy $propertyName $newPropertyValue $to_file_default
+
+		propertyName=ranger.jpa.jdbc.preferredtestquery
+		newPropertyValue="select 1;"
+		updatePropertyToFilePy $propertyName "${newPropertyValue}" $to_file_default
 	fi
 
 	if [ "${audit_store}" == "solr" ]