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

Record actual statement text in error message #345

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,15 @@ protected final QueryResult executeStatement(
throws ClientException {
boolean execute = true;
QueryResult queryResult = null;
String statementText = StringUtils.replaceParameters(statement, values).getStatement();
Instant statementStartTime = Instant.now();

while (execute) {
try {
if (ignoreResults) {
connection.execute(StringUtils.replaceParameters(statement, values).getStatement());
connection.execute(statementText);
} else {
queryResult =
connection.executeQuery(
StringUtils.replaceParameters(statement, values).getStatement());
queryResult = connection.executeQuery(statementText);
}
execute = false;
writeStatementEvent(
Expand All @@ -109,7 +108,7 @@ protected final QueryResult executeStatement(
"Exception executing statement: "
+ statement.getId()
+ ", statement text: "
+ statement.getStatement()
+ statementText
+ "; error message: "
+ e.getMessage();

Expand Down
Loading