Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%jvmoption and parameters containing a space #878

Open
allipatev opened this issue Apr 30, 2024 · 0 comments
Open

%jvmoption and parameters containing a space #878

allipatev opened this issue Apr 30, 2024 · 0 comments
Labels
bug Unwanted / harmful behavior

Comments

@allipatev
Copy link

JVM parameters containing a space don't seem to be handled properly in Java UDFs:

CREATE OR REPLACE JAVA SCALAR SCRIPT test.jvmoption_test_no_space() EMITS(res VARCHAR(2000000)) AS

%jvmoption -Dhttp.agent="ABC";

class JVMOPTION_TEST_NO_SPACE {
 static void run(ExaMetadata exa, ExaIterator ctx) throws Exception {

	ctx.emit("Success!");
 }
}
/
;
SELECT
	test.jvmoption_test_no_space()
;
RES     |
--------+
Success!|
CREATE OR REPLACE JAVA SCALAR SCRIPT test.jvmoption_test_with_space() EMITS(res VARCHAR(2000000)) AS

%jvmoption -Dhttp.agent="ABC DEF";

class JVMOPTION_TEST_WITH_SPACE {
 static void run(ExaMetadata exa, ExaIterator ctx) throws Exception {

	ctx.emit("Success!");
 }
}
/
;
select
	test.jvmoption_test_with_space()
;
SQL Error [22002]: VM error: F-UDF-CL-LIB-1125: F-UDF-CL-SL-JAVA-1000: F-UDF-CL-SL-JAVA-1028:
Cannot start the JVM:
unknown error (-1)
(Session: 1797761165926793216)

Splitting seems to happen here: https://github.com/exasol/script-languages/blob/7da3e47941f102b372b2f694e08349cb1eae5f01/exaudfclient/base/javacontainer/javacontainer_impl.cc#L491

Tested on 7.1.24 and 8.26.0.

Also, -Dhttp.agent="ABC" works fine when passed to a java executable directly.

As you know, User Agent could be quite free-form, so please consider supporting JVM parameters containing spaces (actually, it might make sense to support all of " \t\f\v" that are used for splitting).

@tkilias tkilias added the bug Unwanted / harmful behavior label May 2, 2024
tomuben added a commit to exasol/script-languages that referenced this issue Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unwanted / harmful behavior
Projects
None yet
Development

No branches or pull requests

2 participants