mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 00:03:02 +01:00
Fixed CORE-4755 - Parameterized exception: wrong output when number of arguments greater than 7.
This commit is contained in:
parent
d25af9b013
commit
dd2411e576
@ -101,6 +101,10 @@ Parameterized exceptions (FB 3.0)
|
|||||||
end
|
end
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
The maximum number of arguments passed is 10.
|
||||||
|
|
||||||
|
In the exception message, @NN (example: @10) is considered as @1 followed by the literal 0.
|
||||||
|
|
||||||
The status vector is generated using these codes combination:
|
The status vector is generated using these codes combination:
|
||||||
isc_except, <exception number>,
|
isc_except, <exception number>,
|
||||||
isc_formatted_exception, <formatted exception message>, <exception parameters>
|
isc_formatted_exception, <formatted exception message>, <exception parameters>
|
||||||
|
@ -2330,6 +2330,8 @@ C --
|
|||||||
PARAMETER (GDS__dsql_wlock_aggregates = 336397328)
|
PARAMETER (GDS__dsql_wlock_aggregates = 336397328)
|
||||||
INTEGER*4 GDS__dsql_wlock_conflict
|
INTEGER*4 GDS__dsql_wlock_conflict
|
||||||
PARAMETER (GDS__dsql_wlock_conflict = 336397329)
|
PARAMETER (GDS__dsql_wlock_conflict = 336397329)
|
||||||
|
INTEGER*4 GDS__dsql_max_exception_arguments
|
||||||
|
PARAMETER (GDS__dsql_max_exception_arguments = 336397330)
|
||||||
INTEGER*4 GDS__gsec_cant_open_db
|
INTEGER*4 GDS__gsec_cant_open_db
|
||||||
PARAMETER (GDS__gsec_cant_open_db = 336723983)
|
PARAMETER (GDS__gsec_cant_open_db = 336723983)
|
||||||
INTEGER*4 GDS__gsec_switches_error
|
INTEGER*4 GDS__gsec_switches_error
|
||||||
|
@ -1172,6 +1172,7 @@ const
|
|||||||
gds_dsql_firstskip_rows = 336397327;
|
gds_dsql_firstskip_rows = 336397327;
|
||||||
gds_dsql_wlock_aggregates = 336397328;
|
gds_dsql_wlock_aggregates = 336397328;
|
||||||
gds_dsql_wlock_conflict = 336397329;
|
gds_dsql_wlock_conflict = 336397329;
|
||||||
|
gds_dsql_max_exception_arguments = 336397330;
|
||||||
gds_gsec_cant_open_db = 336723983;
|
gds_gsec_cant_open_db = 336723983;
|
||||||
gds_gsec_switches_error = 336723984;
|
gds_gsec_switches_error = 336723984;
|
||||||
gds_gsec_no_op_spec = 336723985;
|
gds_gsec_no_op_spec = 336723985;
|
||||||
|
@ -64,8 +64,8 @@ typedef DoubleQuad SINT128;
|
|||||||
namespace MsgFormat
|
namespace MsgFormat
|
||||||
{
|
{
|
||||||
|
|
||||||
// For now we allow 7 parameters; @1..@7 in MsgPrint.
|
// For now we allow 9 parameters; @1..@9 in MsgPrint.
|
||||||
const FB_SIZE_T SAFEARG_MAX_ARG = 7;
|
const FB_SIZE_T SAFEARG_MAX_ARG = 9;
|
||||||
|
|
||||||
// This is the unit that represents one parameter in the format routines.
|
// This is the unit that represents one parameter in the format routines.
|
||||||
// The user of the routines rarely needs to be concerned with it.
|
// The user of the routines rarely needs to be concerned with it.
|
||||||
|
@ -4060,6 +4060,14 @@ DmlNode* ExceptionNode::parse(thread_db* tdbb, MemoryPool& pool, CompilerScratch
|
|||||||
|
|
||||||
StmtNode* ExceptionNode::dsqlPass(DsqlCompilerScratch* dsqlScratch)
|
StmtNode* ExceptionNode::dsqlPass(DsqlCompilerScratch* dsqlScratch)
|
||||||
{
|
{
|
||||||
|
if (parameters && parameters->items.getCount() > MsgFormat::SAFEARG_MAX_ARG)
|
||||||
|
{
|
||||||
|
status_exception::raise(
|
||||||
|
Arg::Gds(isc_dsql_max_exception_arguments) <<
|
||||||
|
Arg::Num(parameters->items.getCount()) <<
|
||||||
|
Arg::Num(MsgFormat::SAFEARG_MAX_ARG));
|
||||||
|
}
|
||||||
|
|
||||||
ExceptionNode* node = FB_NEW(getPool()) ExceptionNode(getPool());
|
ExceptionNode* node = FB_NEW(getPool()) ExceptionNode(getPool());
|
||||||
if (exception)
|
if (exception)
|
||||||
node->exception = FB_NEW(getPool()) ExceptionItem(getPool(), *exception);
|
node->exception = FB_NEW(getPool()) ExceptionItem(getPool(), *exception);
|
||||||
|
@ -1161,6 +1161,7 @@ static const struct {
|
|||||||
{"dsql_firstskip_rows", 336397327},
|
{"dsql_firstskip_rows", 336397327},
|
||||||
{"dsql_wlock_aggregates", 336397328},
|
{"dsql_wlock_aggregates", 336397328},
|
||||||
{"dsql_wlock_conflict", 336397329},
|
{"dsql_wlock_conflict", 336397329},
|
||||||
|
{"dsql_max_exception_arguments", 336397330},
|
||||||
{"gsec_cant_open_db", 336723983},
|
{"gsec_cant_open_db", 336723983},
|
||||||
{"gsec_switches_error", 336723984},
|
{"gsec_switches_error", 336723984},
|
||||||
{"gsec_no_op_spec", 336723985},
|
{"gsec_no_op_spec", 336723985},
|
||||||
|
@ -1195,6 +1195,7 @@ const ISC_STATUS isc_dsql_wlock_simple = 336397326L;
|
|||||||
const ISC_STATUS isc_dsql_firstskip_rows = 336397327L;
|
const ISC_STATUS isc_dsql_firstskip_rows = 336397327L;
|
||||||
const ISC_STATUS isc_dsql_wlock_aggregates = 336397328L;
|
const ISC_STATUS isc_dsql_wlock_aggregates = 336397328L;
|
||||||
const ISC_STATUS isc_dsql_wlock_conflict = 336397329L;
|
const ISC_STATUS isc_dsql_wlock_conflict = 336397329L;
|
||||||
|
const ISC_STATUS isc_dsql_max_exception_arguments = 336397330L;
|
||||||
const ISC_STATUS isc_gsec_cant_open_db = 336723983L;
|
const ISC_STATUS isc_gsec_cant_open_db = 336723983L;
|
||||||
const ISC_STATUS isc_gsec_switches_error = 336723984L;
|
const ISC_STATUS isc_gsec_switches_error = 336723984L;
|
||||||
const ISC_STATUS isc_gsec_no_op_spec = 336723985L;
|
const ISC_STATUS isc_gsec_no_op_spec = 336723985L;
|
||||||
@ -1297,7 +1298,7 @@ const ISC_STATUS isc_trace_switch_user_only = 337182757L;
|
|||||||
const ISC_STATUS isc_trace_switch_param_miss = 337182758L;
|
const ISC_STATUS isc_trace_switch_param_miss = 337182758L;
|
||||||
const ISC_STATUS isc_trace_param_act_notcompat = 337182759L;
|
const ISC_STATUS isc_trace_param_act_notcompat = 337182759L;
|
||||||
const ISC_STATUS isc_trace_mandatory_switch_miss = 337182760L;
|
const ISC_STATUS isc_trace_mandatory_switch_miss = 337182760L;
|
||||||
const ISC_STATUS isc_err_max = 1241;
|
const ISC_STATUS isc_err_max = 1242;
|
||||||
|
|
||||||
#else /* c definitions */
|
#else /* c definitions */
|
||||||
|
|
||||||
@ -2462,6 +2463,7 @@ const ISC_STATUS isc_err_max = 1241;
|
|||||||
#define isc_dsql_firstskip_rows 336397327L
|
#define isc_dsql_firstskip_rows 336397327L
|
||||||
#define isc_dsql_wlock_aggregates 336397328L
|
#define isc_dsql_wlock_aggregates 336397328L
|
||||||
#define isc_dsql_wlock_conflict 336397329L
|
#define isc_dsql_wlock_conflict 336397329L
|
||||||
|
#define isc_dsql_max_exception_arguments 336397330L
|
||||||
#define isc_gsec_cant_open_db 336723983L
|
#define isc_gsec_cant_open_db 336723983L
|
||||||
#define isc_gsec_switches_error 336723984L
|
#define isc_gsec_switches_error 336723984L
|
||||||
#define isc_gsec_no_op_spec 336723985L
|
#define isc_gsec_no_op_spec 336723985L
|
||||||
@ -2564,7 +2566,7 @@ const ISC_STATUS isc_err_max = 1241;
|
|||||||
#define isc_trace_switch_param_miss 337182758L
|
#define isc_trace_switch_param_miss 337182758L
|
||||||
#define isc_trace_param_act_notcompat 337182759L
|
#define isc_trace_param_act_notcompat 337182759L
|
||||||
#define isc_trace_mandatory_switch_miss 337182760L
|
#define isc_trace_mandatory_switch_miss 337182760L
|
||||||
#define isc_err_max 1241
|
#define isc_err_max 1242
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1164,6 +1164,7 @@ Data source : @4"}, /* eds_statement */
|
|||||||
{336397327, "FIRST/SKIP cannot be used with OFFSET/FETCH or ROWS"}, /* dsql_firstskip_rows */
|
{336397327, "FIRST/SKIP cannot be used with OFFSET/FETCH or ROWS"}, /* dsql_firstskip_rows */
|
||||||
{336397328, "WITH LOCK cannot be used with aggregates"}, /* dsql_wlock_aggregates */
|
{336397328, "WITH LOCK cannot be used with aggregates"}, /* dsql_wlock_aggregates */
|
||||||
{336397329, "WITH LOCK cannot be used with @1"}, /* dsql_wlock_conflict */
|
{336397329, "WITH LOCK cannot be used with @1"}, /* dsql_wlock_conflict */
|
||||||
|
{336397330, "Number of arguments (@1) exceeds the maximum (@2) number of EXCEPTION USING arguments"}, /* dsql_max_exception_arguments */
|
||||||
{336723983, "unable to open database"}, /* gsec_cant_open_db */
|
{336723983, "unable to open database"}, /* gsec_cant_open_db */
|
||||||
{336723984, "error in switch specifications"}, /* gsec_switches_error */
|
{336723984, "error in switch specifications"}, /* gsec_switches_error */
|
||||||
{336723985, "no operation specified"}, /* gsec_no_op_spec */
|
{336723985, "no operation specified"}, /* gsec_no_op_spec */
|
||||||
|
@ -1160,6 +1160,7 @@ static const struct {
|
|||||||
{336397327, -104}, /* 1039 dsql_firstskip_rows */
|
{336397327, -104}, /* 1039 dsql_firstskip_rows */
|
||||||
{336397328, -104}, /* 1040 dsql_wlock_aggregates */
|
{336397328, -104}, /* 1040 dsql_wlock_aggregates */
|
||||||
{336397329, -104}, /* 1041 dsql_wlock_conflict */
|
{336397329, -104}, /* 1041 dsql_wlock_conflict */
|
||||||
|
{336397330, -901}, /* 1042 dsql_max_exception_arguments */
|
||||||
{336723983, -901}, /* 15 gsec_cant_open_db */
|
{336723983, -901}, /* 15 gsec_cant_open_db */
|
||||||
{336723984, -901}, /* 16 gsec_switches_error */
|
{336723984, -901}, /* 16 gsec_switches_error */
|
||||||
{336723985, -901}, /* 17 gsec_no_op_spec */
|
{336723985, -901}, /* 17 gsec_no_op_spec */
|
||||||
|
@ -1160,6 +1160,7 @@ static const struct {
|
|||||||
{336397327, "42000"}, // 1039 dsql_firstskip_rows
|
{336397327, "42000"}, // 1039 dsql_firstskip_rows
|
||||||
{336397328, "42000"}, // 1040 dsql_wlock_aggregates
|
{336397328, "42000"}, // 1040 dsql_wlock_aggregates
|
||||||
{336397329, "42000"}, // 1041 dsql_wlock_conflict
|
{336397329, "42000"}, // 1041 dsql_wlock_conflict
|
||||||
|
{336397330, "07002"}, // 1042 dsql_max_exception_arguments
|
||||||
{336723983, "00000"}, // 15 gsec_cant_open_db
|
{336723983, "00000"}, // 15 gsec_cant_open_db
|
||||||
{336723984, "00000"}, // 16 gsec_switches_error
|
{336723984, "00000"}, // 16 gsec_switches_error
|
||||||
{336723985, "00000"}, // 17 gsec_no_op_spec
|
{336723985, "00000"}, // 17 gsec_no_op_spec
|
||||||
|
@ -10,7 +10,7 @@ set bulk_insert INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUM
|
|||||||
('1996-11-07 13:39:40', 'INSTALL', 10, 1)
|
('1996-11-07 13:39:40', 'INSTALL', 10, 1)
|
||||||
('1996-11-07 13:38:41', 'TEST', 11, 4)
|
('1996-11-07 13:38:41', 'TEST', 11, 4)
|
||||||
('2014-05-09 01:30:36', 'GBAK', 12, 361)
|
('2014-05-09 01:30:36', 'GBAK', 12, 361)
|
||||||
('2014-05-02 19:19:51', 'SQLERR', 13, 1042)
|
('2015-04-29 12:27:00', 'SQLERR', 13, 1043)
|
||||||
('1996-11-07 13:38:42', 'SQLWARN', 14, 613)
|
('1996-11-07 13:38:42', 'SQLWARN', 14, 613)
|
||||||
('2006-09-10 03:04:31', 'JRD_BUGCHK', 15, 307)
|
('2006-09-10 03:04:31', 'JRD_BUGCHK', 15, 307)
|
||||||
('2014-05-07 03:04:46', 'ISQL', 17, 190)
|
('2014-05-07 03:04:46', 'ISQL', 17, 190)
|
||||||
|
@ -2617,6 +2617,7 @@ ERROR: Backup incomplete', NULL, NULL);
|
|||||||
('dsql_firstskip_rows', 'pass1_rse_impl', 'pass1.cpp', NULL, 13, 1039, NULL, 'FIRST/SKIP cannot be used with OFFSET/FETCH or ROWS', NULL, NULL);
|
('dsql_firstskip_rows', 'pass1_rse_impl', 'pass1.cpp', NULL, 13, 1039, NULL, 'FIRST/SKIP cannot be used with OFFSET/FETCH or ROWS', NULL, NULL);
|
||||||
('dsql_wlock_aggregates', 'pass1_rse_impl', 'pass1.cpp', NULL, 13, 1040, NULL, 'WITH LOCK cannot be used with aggregates', NULL, NULL);
|
('dsql_wlock_aggregates', 'pass1_rse_impl', 'pass1.cpp', NULL, 13, 1040, NULL, 'WITH LOCK cannot be used with aggregates', NULL, NULL);
|
||||||
('dsql_wlock_conflict', NULL, 'pass1.cpp', NULL, 13, 1041, NULL, 'WITH LOCK cannot be used with @1', NULL, NULL);
|
('dsql_wlock_conflict', NULL, 'pass1.cpp', NULL, 13, 1041, NULL, 'WITH LOCK cannot be used with @1', NULL, NULL);
|
||||||
|
('dsql_max_exception_arguments', NULL, 'StmtNodes.cpp', NULL, 13, 1042, NULL, 'Number of arguments (@1) exceeds the maximum (@2) number of EXCEPTION USING arguments', NULL, NULL);
|
||||||
-- SQLWARN
|
-- SQLWARN
|
||||||
(NULL, NULL, NULL, NULL, 14, 100, NULL, 'Row not found for fetch, update or delete, or the result of a query is an empty table.', NULL, NULL);
|
(NULL, NULL, NULL, NULL, 14, 100, NULL, 'Row not found for fetch, update or delete, or the result of a query is an empty table.', NULL, NULL);
|
||||||
(NULL, NULL, NULL, NULL, 14, 101, NULL, 'segment buffer length shorter than expected', NULL, NULL);
|
(NULL, NULL, NULL, NULL, 14, 101, NULL, 'segment buffer length shorter than expected', NULL, NULL);
|
||||||
|
@ -1154,6 +1154,7 @@ COMMIT WORK;
|
|||||||
(-104, '42', '000', 13, 1039, 'dsql_firstskip_rows', NULL, NULL)
|
(-104, '42', '000', 13, 1039, 'dsql_firstskip_rows', NULL, NULL)
|
||||||
(-104, '42', '000', 13, 1040, 'dsql_wlock_aggregates', NULL, NULL)
|
(-104, '42', '000', 13, 1040, 'dsql_wlock_aggregates', NULL, NULL)
|
||||||
(-104, '42', '000', 13, 1041, 'dsql_wlock_conflict', NULL, NULL)
|
(-104, '42', '000', 13, 1041, 'dsql_wlock_conflict', NULL, NULL)
|
||||||
|
(-901, '07', '002', 13, 1042, 'dsql_max_exception_arguments', NULL, NULL)
|
||||||
-- GSEC
|
-- GSEC
|
||||||
(-901, '00', '000', 18, 15, 'gsec_cant_open_db', NULL, NULL)
|
(-901, '00', '000', 18, 15, 'gsec_cant_open_db', NULL, NULL)
|
||||||
(-901, '00', '000', 18, 16, 'gsec_switches_error', NULL, NULL)
|
(-901, '00', '000', 18, 16, 'gsec_switches_error', NULL, NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user