Skip to content

Commit 8b91d19

Browse files
authored
Fix some software rot in the sqlline CLI: (#3502)
* The wrapper script expects the generated script to have the same name, so rename it to match. * The Main class name has changed somewhere along the line. * The log4j XML(!) config file didn't have valid syntax (? directive needs to be at the front) * Upgrade jline to after jline/jline3#688, which turned off JNA, which was crashing on ARM Mac. * Make the convenience launcher go through the class that registers the driver
1 parent 25f4ddf commit 8b91d19

File tree

5 files changed

+5
-8
lines changed

5 files changed

+5
-8
lines changed

fdb-relational-cli/fdb-relational-cli.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ generateGrammarSource {
108108
application {
109109
// https://docs.gradle.org/current/userguide/application_plugin.html
110110
// https://github.com/julianhyde/sqlline
111-
mainClass = "com.apple.relational.cli.sqlline.RelationalSQLLine"
111+
mainClass = "com.apple.foundationdb.relational.cli.sqlline.RelationalSQLLine"
112112
applicationName = "fdb-relational-sqlline"
113113
// JUL => log4j2 https://logging.apache.org/log4j/2.x/log4j-jul/index.html
114114
// TODO: Allow overriding default fdb.cluster file with FDB_CLUSTER_FILE.

fdb-relational-cli/src/main/dist/conf/log4j2.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
12
<!--
23
log4j2.xml
34
@@ -18,7 +19,6 @@
1819
limitations under the License.
1920
-->
2021

21-
<?xml version="1.0" encoding="UTF-8"?>
2222
<Configuration status="INFO">
2323
<Appenders>
2424
<Console name="Console" target="SYSTEM_OUT">

fdb-relational-cli/src/test/java/com/apple/foundationdb/relational/cli/LaunchSQLLine.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
import com.apple.foundationdb.relational.util.ExcludeFromJacocoGeneratedReport;
2424

25-
import java.io.IOException;
26-
2725
/**
2826
* Convenience class for launching sqlline so can run it under the debugger.
2927
* Be aware that the intellij terminal is dodgy. See
@@ -32,10 +30,9 @@
3230
*/
3331
@ExcludeFromJacocoGeneratedReport // Test utility only.
3432
public class LaunchSQLLine {
35-
public static void main(String[] args/*Ignored*/) throws IOException {
33+
public static void main(String[] args/*Ignored*/) throws Exception {
3634
// Read [SQLLINE-80] to see why maxWidth must be set
37-
sqlline.SqlLine.main(new String []{
38-
"-ac", "com.apple.foundationdb.relational.cli.sqlline.Customize",
35+
com.apple.foundationdb.relational.cli.sqlline.RelationalSQLLine.main(new String []{
3936
"-u", "jdbc:embed:/__SYS",
4037
"--maxWidth=160",
4138
});

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ bndtools = "6.3.1"
6161
diffutils = "4.12"
6262
hamcrest = "2.2"
6363
jcommander = "1.81"
64-
jline = "3.19.0"
64+
jline = "3.30.4"
6565
junit = "5.11.3"
6666
junit-platform = "1.7.1"
6767
mockito = "3.7.7"

0 commit comments

Comments
 (0)