Skip to content

mo-tester writes placeholder column for empty show node list result #199

@Ariznawlll

Description

@Ariznawlll

Background

MatrixOne issue: matrixorigin/matrixone#17598

show node list is internally planned by MatrixOne as select 1 where 0. The MySQL client and JDBC execution do not return a data row for this statement, but mo-tester genrs wrote the ResultSet metadata header into .result, which appeared as an unexpected placeholder 1.

Reproduction

Use a minimal case:

set save_query_result = on;
/* save_result */show node list;
select * from result_scan(last_query_id()) as u;
set save_query_result = off;
/* save_result */show node list;
select * from result_scan(last_query_id()) as u;

Before the fix, mo-tester generated output like:

/* save_result */show node list;
➤ 1[-5,64,0]

This is not a real show node list row; it is the placeholder column metadata from the internal select 1 where 0 rewrite.

Expected behavior

mo-tester should not emit the internal placeholder 1 for an empty show node list ResultSet. It should keep normal empty ResultSet behavior for ordinary SQL such as select 1 where 0.

Fix

PR: #198

The fix normalizes this specific empty show node list placeholder ResultSet to no result and avoids writing null result text in genrs mode.

Verification

  • JAVA_HOME=$(/usr/libexec/java_home -v 20) PATH="$JAVA_HOME/bin:$PATH" mvn -q -DskipTests jar:jar
  • Local minimal case: before fix mo-tester emitted ➤ 1[-5,64,0]; after fix it no longer emits the placeholder 1.
  • Control case select 1 where 0 still preserves its header, so generic empty ResultSet behavior is not changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions