瀏覽代碼

HPCC-15694 MySQL executed twice for scalar results

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 9 年之前
父節點
當前提交
e8a0b6c35e
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      plugins/mysql/mysqlembed.cpp

+ 2 - 3
plugins/mysql/mysqlembed.cpp

@@ -1445,8 +1445,7 @@ public:
     {
         if (nextParam != stmtInfo->queryInputBindings().numColumns())
             failx("Not enough parameters supplied (%d parameters supplied, but statement has %d bound columns)", nextParam, stmtInfo->queryInputBindings().numColumns());
-        if (!stmtInfo->hasResult())
-            lazyExecute();
+        // We actually do the execute later, when the result is fetched
     }
 protected:
     void lazyExecute()
@@ -1460,7 +1459,7 @@ protected:
     {
         if (!stmtInfo->hasResult() || stmtInfo->queryResultBindings().numColumns() != 1)
             typeError("scalar", NULL);
-        lazyExecute(); // MORE this seems wrong to me  - or at least needs to check not already executed
+        lazyExecute();
         if (!stmtInfo->next())
             typeError("scalar", NULL);
         return stmtInfo->queryResultBindings().queryColumn(0, NULL);