Mapepire-IBMi / mapepire-server

Server-side support for Code for IBM i
GNU General Public License v3.0
24 stars 8 forks source link

`isDone` not always being set properly #56

Closed SanjulaGanepola closed 2 months ago

SanjulaGanepola commented 2 months ago

Reproducible using tests cases in https://github.com/Mapepire-IBMi/mapepire-java/pull/40

1. Prepared statement isDone is incorrectly false here:

SqlJob job = new SqlJob();
job.connect(MapepireTest.getCreds()).get();
QueryOptions options = new QueryOptions(false, false, Arrays.asList("TABLE_NAME", "LONG_COMMENT", "CONSTRAINT_NAME"));
Query<Object> query = job.query("SELECT * FROM SAMPLE.SYSCOLUMNS WHERE COLUMN_NAME IN (?, ?, ?)", options);
QueryResult<Object> result = query.execute(30).get();
assertTrue(result.getIsDone());

isDone is correctly true here:

SqlJob job = new SqlJob();
job.connect(MapepireTest.getCreds()).get();
Query<Object> query = job.query("SELECT * FROM SAMPLE.SYSCOLUMNS WHERE COLUMN_NAME IN ('TABLE_NAME', 'LONG_COMMENT', 'CONSTRAINT_NAME')");
QueryResult<Object> result = query.execute(30).get();
assertTrue(result.getIsDone());

2. DROP TABLE query isDone is incorrectly false here:

SqlJob job = new SqlJob();
job.connect(MapepireTest.getCreds()).get();
Query<Object> query = job.query("DROP TABLE IF EXISTS SAMPLE.DELETE");
QueryResult<Object> result = query.execute().get();
assertTrue(result.getIsDone());
SanjulaGanepola commented 2 months ago

The issue seems to still occur after the fix