Skip to content

Commit 1eeaf07

Browse files
apstndbclaude
andauthored
test: add test case for DML with THEN RETURN returning no rows (#491)
Add a test case to TestResultLine covering DML statements with a THEN RETURN clause that affect zero rows. Verifies that the output is "Empty set" in verbose mode, consistent with SELECT queries that return no rows. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent af96081 commit 1eeaf07

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cli_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,20 @@ optimizer statistics: auto_20210829_05_22_28UTC
710710
verbose: false,
711711
want: "Empty set (12 msec)\n",
712712
},
713+
{
714+
desc: "DML with THEN RETURN no rows (has result set, is mutation, empty, verbose)",
715+
result: &Result{
716+
TableHeader: toTableHeader("id", "name"), // Has result set from THEN RETURN
717+
AffectedRows: 0,
718+
IsExecutedDML: true,
719+
CommitStats: &sppb.CommitResponse_CommitStats{MutationCount: 0},
720+
Stats: QueryStats{
721+
ElapsedTime: "12 msec",
722+
},
723+
},
724+
verbose: true,
725+
want: "Empty set (12 msec)\n",
726+
},
713727
{
714728
desc: "SHOW VARIABLES (has result set)",
715729
result: &Result{

0 commit comments

Comments
 (0)