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

Certain sequence of queries for JSON outputformat leads to ArrayIndexOutOfBoundsException #447

Closed
snuyanzin opened this issue Oct 20, 2021 · 1 comment

Comments

@snuyanzin
Copy link
Collaborator

case to reproduce

!outputformat json
select 1;
select 1, 2; -- here should be any number of columns which is greater than in a previous query

It will fail as

java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at sqlline.JsonOutputFormat.printRow(JsonOutputFormat.java:43)
	at sqlline.AbstractOutputFormat.print(AbstractOutputFormat.java:32)
	at sqlline.SqlLine.print(SqlLine.java:1773)
	at sqlline.Commands.executeSingleQuery(Commands.java:1139)
	at sqlline.Commands.execute(Commands.java:1079)
	at sqlline.Commands.sql(Commands.java:1033)
	at sqlline.SqlLine.dispatch(SqlLine.java:822)
	at sqlline.SqlLine.begin(SqlLine.java:596)
	at sqlline.SqlLine.start(SqlLine.java:269)
	at sqlline.SqlLine.main(SqlLine.java:208)
@snuyanzin
Copy link
Collaborator Author

merged at 87a8e4f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant