Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: show both error msg and result rows (#12665)

ecmadao9a97aecd3bec
diff --git a/backend/plugin/db/bigquery/bigquery.go b/backend/plugin/db/bigquery/bigquery.go
index e9102e04a6..21499d4d62 100644
--- a/backend/plugin/db/bigquery/bigquery.go
+++ b/backend/plugin/db/bigquery/bigquery.go
@@ -248,8 +248,7 @@ func (d *Driver) querySingleSQL(ctx context.Context, statement string) (*v1pb.Qu
n := len(result.Rows)
if (n&(n-1) == 0) && proto.Size(result) > common.MaximumSQLResultSize {
result.Error = common.MaximumSQLResultSizeExceeded
- result.Latency = durationpb.New(time.Since(startTime))
- return result, nil
+ break
}
}
diff --git a/backend/plugin/db/hive/hive.go b/backend/plugin/db/hive/hive.go
index d181a7a6ff..e0d86510ed 100644
--- a/backend/plugin/db/hive/hive.go
+++ b/backend/plugin/db/hive/hive.go
@@ -259,8 +259,7 @@ func runSingleStatement(ctx context.Context, conn *gohive.Connection, statement
n := len(result.Rows)
if (n&(n-1) == 0) && proto.Size(result) > common.MaximumSQLResultSize {
result.Error = common.MaximumSQLResultSizeExceeded
- result.Latency = durationpb.New(time.Since(startTime))
- return result, nil
+ break
}
}
result.Latency = durationpb.New(time.Since(startTime))
diff --git a/backend/plugin/db/spanner/spanner.go b/backend/plugin/db/spanner/spanner.go
index f308820b90..a8157f16a4 100644
--- a/backend/plugin/db/spanner/spanner.go
+++ b/backend/plugin/db/spanner/spanner.go
@@ -325,8 +325,7 @@ func (d *Driver) querySingleSQL(ctx context.Context, statement string) (*v1pb.Qu
n := len(result.Rows)
if (n&(n-1) == 0) && proto.Size(result) > common.MaximumSQLResultSize {
result.Error = common.MaximumSQLResultSizeExceeded
- result.Latency = durationpb.New(time.Since(startTime))
- return result, nil
+ break
}
row, err = iter.Next()
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
index a96c892892..26bfb6daee 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
@@ -1,5 +1,8 @@
<template>
<template v-if="viewMode === 'RESULT'">
+ <BBAttention v-if="result.error" class="w-full mb-2" :type="'error'">
+ <ErrorView :error="result.error" />
+ </BBAttention>
<div
class="w-full shrink-0 flex flex-row justify-between items-center mb-2 overflow-x-auto"
>
@@ -262,7 +265,7 @@ const { instance: connectedInstance } = useConnectionOfCurrentSQLEditorTab();
const viewMode = computed((): ViewMode => {
const { result } = props;
- if (result.error) {
+ if (result.error && data.value.length === 0) {
return "ERROR";
}
const columnNames = result.columnNames;