From 9d5e1355f16fa096435b6a49b3a694fc9abd43c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Camacho=20Rodr=C3=ADguez?= Date: Thu, 10 Oct 2024 13:32:59 -0700 Subject: [PATCH] Record actual statement text in error message (#345) --- .../java/com/microsoft/lst_bench/task/TaskExecutor.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/microsoft/lst_bench/task/TaskExecutor.java b/core/src/main/java/com/microsoft/lst_bench/task/TaskExecutor.java index 833a8b0a..504160da 100644 --- a/core/src/main/java/com/microsoft/lst_bench/task/TaskExecutor.java +++ b/core/src/main/java/com/microsoft/lst_bench/task/TaskExecutor.java @@ -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( @@ -109,7 +108,7 @@ protected final QueryResult executeStatement( "Exception executing statement: " + statement.getId() + ", statement text: " - + statement.getStatement() + + statementText + "; error message: " + e.getMessage();