Skip to content

Commit 2472e55

Browse files
committed
IGNITE-14285 Fix sqlline history file location (#8859)
1 parent 17a93f1 commit 2472e55

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

modules/sqlline/bin/sqlline.bat

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ if %MAJOR_JAVA_VER% GEQ 11 (
141141
set CP=%IGNITE_LIBS%
142142
set CP=%CP%;%IGNITE_HOME%\bin\include\sqlline\*
143143

144-
"%JAVA_HOME%\bin\java.exe" %JVM_OPTS% -cp "%CP%" sqlline.SqlLine -d org.apache.ignite.IgniteJdbcThinDriver %*
144+
:: Between version 2 and 3, jline changed the format of its history file. After this change,
145+
:: the Ignite provides --historyfile argument to SQLLine usage
146+
set SQLLINE_HISTORY=%HOMEPATH%\.sqlline\ignite_history
147+
148+
"%JAVA_HOME%\bin\java.exe" %JVM_OPTS% -cp "%CP%" sqlline.SqlLine --historyFile=%SQLLINE_HISTORY% -d org.apache.ignite.IgniteJdbcThinDriver %*
145149

146150
:error_finish

modules/sqlline/bin/sqlline.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,8 @@ CP="${IGNITE_LIBS}"
100100

101101
CP="${CP}${SEP}${IGNITE_HOME_TMP}/bin/include/sqlline/*"
102102

103-
"$JAVA" ${JVM_OPTS} -cp ${CP} sqlline.SqlLine -d org.apache.ignite.IgniteJdbcThinDriver $@
103+
# Between version 2 and 3, jline changed the format of its history file. After this change,
104+
# the Ignite provides --historyfile argument to SQLLine usage
105+
SQLLINE_HISTORY="~/.sqlline/ignite_history"
106+
107+
"$JAVA" ${JVM_OPTS} -cp ${CP} sqlline.SqlLine --historyFile=${SQLLINE_HISTORY} -d org.apache.ignite.IgniteJdbcThinDriver $@

0 commit comments

Comments
 (0)