From d2852e51a954a4b2a70870bbfb4f470ec02f8330 Mon Sep 17 00:00:00 2001 From: Morgan Douglas Date: Tue, 31 Dec 2024 12:06:37 -0500 Subject: [PATCH] Address swallowed error message Signed-off-by: Morgan Douglas --- db/sqlinterfaces.c | 4 ++-- tests/cdb2sql.test/t02.expected | 1 + tests/cdb2sql.test/t02.sql | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 tests/cdb2sql.test/t02.expected create mode 100644 tests/cdb2sql.test/t02.sql diff --git a/db/sqlinterfaces.c b/db/sqlinterfaces.c index 8616fc9729..b0d5dda21e 100644 --- a/db/sqlinterfaces.c +++ b/db/sqlinterfaces.c @@ -2901,9 +2901,9 @@ static void _prepare_error(struct sqlthdstate *thd, return; } - if(rc == ERR_SQL_PREPARE && !rec->stmt) + if (rc == ERR_SQL_PREPARE && !rec->stmt) { errstr = "no statement"; - if(rc == SQLITE_SCHEMA && rec->stmt && clnt->remsql_set.is_remsql) { + } else if (rc == SQLITE_SCHEMA && rec->stmt && clnt->remsql_set.is_remsql) { errstr = clnt->remsql_set.xerr.errstr; } else if (clnt->fdb_state.xerr.errval) { errstr = clnt->fdb_state.xerr.errstr; diff --git a/tests/cdb2sql.test/t02.expected b/tests/cdb2sql.test/t02.expected new file mode 100644 index 0000000000..1207a24e3f --- /dev/null +++ b/tests/cdb2sql.test/t02.expected @@ -0,0 +1 @@ +[] failed with rc -3 no statement diff --git a/tests/cdb2sql.test/t02.sql b/tests/cdb2sql.test/t02.sql new file mode 100644 index 0000000000..092bc2b041 --- /dev/null +++ b/tests/cdb2sql.test/t02.sql @@ -0,0 +1 @@ +;