8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 00:03:02 +01:00

Front ported fix for bug #7128 : Incorrect error message with isc_sql_interprete()

This commit is contained in:
Vlad Khorsun 2022-02-18 14:52:24 +02:00
parent 9ce82b1009
commit f7c3c2ccd7
3 changed files with 10 additions and 5 deletions

View File

@ -19,7 +19,7 @@ FB_IMPL_MSG(DSQL, 19, dsql_cursor_not_found, -502, "34", "000", "Cursor @1 is no
FB_IMPL_MSG(DSQL, 20, dsql_cursor_exists, -502, "24", "000", "Cursor @1 already exists in the current context")
FB_IMPL_MSG(DSQL, 21, dsql_cursor_rel_ambiguous, -502, "34", "000", "Relation @1 is ambiguous in cursor @2")
FB_IMPL_MSG(DSQL, 22, dsql_cursor_rel_not_found, -502, "34", "000", "Relation @1 is not found in cursor @2")
FB_IMPL_MSG(DSQL, 23, dsql_cursor_not_open, -502, "24", "000", "Cursor is not open")
FB_IMPL_MSG(DSQL, 23, dsql_cursor_not_open, -504, "24", "000", "Cursor is not open")
FB_IMPL_MSG(DSQL, 24, dsql_type_not_supp_ext_tab, -607, "HY", "004", "Data type @1 is not supported for EXTERNAL TABLES. Relation '@2', field '@3'")
FB_IMPL_MSG(DSQL, 25, dsql_feature_not_supported_ods, -804, "0A", "000", "Feature not supported on ODS version older than @1.@2")
FB_IMPL_MSG(DSQL, 26, primary_key_required, -660, "22", "000", "Primary key required on table @1")

View File

@ -3833,7 +3833,8 @@ ISC_STATUS rem_port::execute_statement(P_OP op, P_SQLDATA* sqldata, PACKET* send
if (statement->rsr_cursor || statement->rsr_batch)
{
Arg::Gds(isc_dsql_cursor_open_err).raise();
(Arg::Gds(isc_sqlerr) << Arg::Num(-502) <<
Arg::Gds(isc_dsql_cursor_open_err)).raise();
}
InternalMessageBuffer iMsgBuffer(sqldata->p_sqldata_blr.cstr_length,
@ -3989,7 +3990,8 @@ ISC_STATUS rem_port::fetch(P_SQLDATA * sqldata, PACKET* sendL, bool scroll)
sqldata->p_sqldata_blr.cstr_address, msg_length, NULL);
if (!msgBuffer.metadata)
Arg::Gds(isc_dsql_cursor_open_err).raise();
(Arg::Gds(isc_sqlerr) << Arg::Num(-502) <<
Arg::Gds(isc_dsql_cursor_open_err)).raise();
cursor->setDelayedOutputFormat(&status_vector, msgBuffer.metadata);
check(&status_vector);

View File

@ -1258,13 +1258,16 @@ namespace Why
void checkCursorOpened() const
{
if (!statement || !statement->cursor)
Arg::Gds(isc_dsql_cursor_not_open).raise();
(Arg::Gds(isc_sqlerr) << Arg::Num(-504) <<
Arg::Gds(isc_dsql_cursor_err) <<
Arg::Gds(isc_dsql_cursor_not_open)).raise();
}
void checkCursorClosed() const
{
if (statement && statement->cursor)
Arg::Gds(isc_dsql_cursor_open_err).raise();
(Arg::Gds(isc_sqlerr) << Arg::Num(-502) <<
Arg::Gds(isc_dsql_cursor_open_err)).raise();
}
IStatement* getInterface()