impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tianyi Wang (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-5416: Fix an impala-shell command recursion bug
Date Thu, 14 Sep 2017 20:18:13 GMT
Tianyi Wang has uploaded a new patch set (#2).

Change subject: IMPALA-5416: Fix an impala-shell command recursion bug

IMPALA-5416: Fix an impala-shell command recursion bug

Impala-shell crashes with 2 source commands on the same line and runs
a command multiple times if it shares the same line with a source
The cause is that there is a "cmdqueue" member in cmd library, which is
used to execute commands not directly from user input. When impala-shell
reads a line with multiple commands, it splits the line into multiple
queries and insert them into the queue, and then gives control back to
the eventloop in cmd library. The problem is that a source command
calls execute_query_list(), which executes queries in the cmdqueue as
well. So any query in the cmdqueue will be executed twice. And if there
is unfortunately a source command in the cmdqueue, it will call
execute_query_list() again, and there will be an infinite recursion.
The original purpose of running queued queries in execute_query_list()
is that in non-interactive mode, there is no event loop. And still,
there are queries like "use database" queued by connection setup
procedures, which need to be run before the user query.
This patch avoids running queries from the queue in
execute_query_list(), and for non-interactive mode, runs queued queries
in execute_queries_non_interactive_mode() instead.

Change-Id: I453af2d4694d47e184031cb07ecd2af259ba20f3
M shell/
1 file changed, 4 insertions(+), 2 deletions(-)

  git pull ssh:// refs/changes/63/8063/2
To view, visit
To unsubscribe, visit

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I453af2d4694d47e184031cb07ecd2af259ba20f3
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <>
Gerrit-Reviewer: Thomas Tauber-Marshall <>

View raw message