[ 
https://issues.apache.org/jira/browse/RANGER-1955?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16823699#comment-16823699
 ] 

Pradeep Agrawal commented on RANGER-1955:
-----------------------------------------

Patch committed to apache ranger master: 
[https://github.com/apache/ranger/commit/2b593e64afcd64301a8c2fed2ca8ce3b5c157293]

> Wrong quoting in Ranger SQL install scripts
> -------------------------------------------
>
>                 Key: RANGER-1955
>                 URL: https://issues.apache.org/jira/browse/RANGER-1955
>             Project: Ranger
>          Issue Type: Bug
>          Components: Ranger
>    Affects Versions: 0.7.0
>            Reporter: Sören Gutzeit
>            Assignee: Pradeep Agrawal
>            Priority: Minor
>              Labels: installation, sql
>             Fix For: 0.7.0
>
>         Attachments: 
> 0001-RANGER-1955-Wrong-quoting-in-Ranger-SQL-install-scri.patch
>
>
> We had some problems with the SQL installation scripts 
> 007-updateBlankPolicyName.sql and 008-removeTrailingSlash.sql with our 
> current MySQL version 5.7.16.
> The problems are the double quotes. In both scripts, there is this expression 
> included:
> {code:java}
> "%Y%m%d%H%i%s"{code}
> Our MySQL version doesn't like the double quotes in this way, so the 
> execution of the scripts run into an exception:
> {code:java}
> 2017-12-14 17:00:50,721 [I] Patch 007-updateBlankPolicyName.sql is being 
> applied..
>  2017-12-14 17:00:50,721 [JISQL] 
> /usr/lib/jvm/jre-1.8.0-openjdk-1.8.0-1.b12.el7_4.x86_64/bin/java -cp 
> /usr/hdp/2.6.2.0-205/ranger-admin/ews/lib/mysql-connector-java.jar:/usr/hdp/current/ranger-admin/jisql/lib/*
>  org.apache.util.sql.Jisql -driver mysqlconj -cstring 
> jdbc:mysql://xxx/rangert2b -u 'rangert2' -p '********' -noheader -trim -c \; 
> -input 
> /usr/hdp/current/ranger-admin/db/mysql/patches/007-updateBlankPolicyName.sql
>  Error executing: call updateBlankPolicyName(); 
>  com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 
> '%Y%m%d%H%i%s' in 'field list'
>  SQLException : SQL state: 42S22 
> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 
> '%Y%m%d%H%i%s' in 'field list' ErrorCode: 1054
>  2017-12-14 17:00:51,199 [JISQL] 
> /usr/lib/jvm/jre-1.8.0-openjdk-1.8.0-1.b12.el7_4.x86_64/bin/java -cp 
> /usr/hdp/2.6.2.0-205/ranger-admin/ews/lib/mysql-connector-java.jar:/usr/hdp/current/ranger-admin/jisql/lib/*
>  org.apache.util.sql.Jisql -driver mysqlconj -cstring 
> jdbc:mysql://xxx/rangert2b -u 'rangert2' -p '********' -noheader -trim -c \; 
> -query "select version from x_db_version_h where version = '007' and active = 
> 'Y';"
>  2017-12-14 17:00:51,523 [JISQL] 
> /usr/lib/jvm/jre-1.8.0-openjdk-1.8.0-1.b12.el7_4.x86_64/bin/java -cp 
> /usr/hdp/2.6.2.0-205/ranger-admin/ews/lib/mysql-connector-java.jar:/usr/hdp/current/ranger-admin/jisql/lib/*
>  org.apache.util.sql.Jisql -driver mysqlconj -cstring 
> jdbc:mysql://xxx/rangert2b -u 'rangert2' -p '********' -noheader -trim -c \; 
> -query "delete from x_db_version_h where version='007' and active='N' and 
> updated_by='XXX';"
>  2017-12-14 17:00:51,868 [E] 007-updateBlankPolicyName.sql import failed!
> Command failed after 1 tries
> {code}
>   (Install output from Ambari)
>  
> We solved the problem by replacing the double quotes by single quotes (" -> 
> ') and restarted the installation with a new database.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to