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

Improvement CORE-5606 - Add expression index name to exception message if computation failed.

This commit is contained in:
Adriano dos Santos Fernandes 2017-09-11 16:42:11 +00:00
parent 4c73f4ac61
commit f924ded403
11 changed files with 31 additions and 4 deletions

View File

@ -1716,6 +1716,8 @@ C --
PARAMETER (GDS__subproc_not_impl = 335545151)
INTEGER*4 GDS__sysf_invalid_hash_algorithm
PARAMETER (GDS__sysf_invalid_hash_algorithm = 335545152)
INTEGER*4 GDS__expression_eval_index
PARAMETER (GDS__expression_eval_index = 335545153)
INTEGER*4 GDS__gfix_db_name
PARAMETER (GDS__gfix_db_name = 335740929)
INTEGER*4 GDS__gfix_invalid_sw

View File

@ -1711,6 +1711,8 @@ const
gds_subproc_not_impl = 335545151;
isc_sysf_invalid_hash_algorithm = 335545152;
gds_sysf_invalid_hash_algorithm = 335545152;
isc_expression_eval_index = 335545153;
gds_expression_eval_index = 335545153;
isc_gfix_db_name = 335740929;
gds_gfix_db_name = 335740929;
isc_gfix_invalid_sw = 335740930;

View File

@ -854,6 +854,7 @@ static const struct {
{"subfunc_not_impl", 335545150},
{"subproc_not_impl", 335545151},
{"sysf_invalid_hash_algorithm", 335545152},
{"expression_eval_index", 335545153},
{"gfix_db_name", 335740929},
{"gfix_invalid_sw", 335740930},
{"gfix_incmp_sw", 335740932},

View File

@ -888,6 +888,7 @@ const ISC_STATUS isc_subproc_defvaldecl = 335545149L;
const ISC_STATUS isc_subfunc_not_impl = 335545150L;
const ISC_STATUS isc_subproc_not_impl = 335545151L;
const ISC_STATUS isc_sysf_invalid_hash_algorithm = 335545152L;
const ISC_STATUS isc_expression_eval_index = 335545153L;
const ISC_STATUS isc_gfix_db_name = 335740929L;
const ISC_STATUS isc_gfix_invalid_sw = 335740930L;
const ISC_STATUS isc_gfix_incmp_sw = 335740932L;
@ -1362,7 +1363,7 @@ const ISC_STATUS isc_trace_switch_user_only = 337182757L;
const ISC_STATUS isc_trace_switch_param_miss = 337182758L;
const ISC_STATUS isc_trace_param_act_notcompat = 337182759L;
const ISC_STATUS isc_trace_mandatory_switch_miss = 337182760L;
const ISC_STATUS isc_err_max = 1306;
const ISC_STATUS isc_err_max = 1307;
#else /* c definitions */
@ -2220,6 +2221,7 @@ const ISC_STATUS isc_err_max = 1306;
#define isc_subfunc_not_impl 335545150L
#define isc_subproc_not_impl 335545151L
#define isc_sysf_invalid_hash_algorithm 335545152L
#define isc_expression_eval_index 335545153L
#define isc_gfix_db_name 335740929L
#define isc_gfix_invalid_sw 335740930L
#define isc_gfix_incmp_sw 335740932L
@ -2694,7 +2696,7 @@ const ISC_STATUS isc_err_max = 1306;
#define isc_trace_switch_param_miss 337182758L
#define isc_trace_param_act_notcompat 337182759L
#define isc_trace_mandatory_switch_miss 337182760L
#define isc_err_max 1306
#define isc_err_max 1307
#endif

View File

@ -857,6 +857,7 @@ Data source : @4"}, /* eds_statement */
{335545150, "Sub-function @1 was declared but not implemented"}, /* subfunc_not_impl */
{335545151, "Sub-procedure @1 was declared but not implemented"}, /* subproc_not_impl */
{335545152, "Invalid HASH algorithm @1"}, /* sysf_invalid_hash_algorithm */
{335545153, "Expression evaluation error for index \"@1\" on table \"@2\""}, /* expression_eval_index */
{335740929, "data base file name (@1) already given"}, /* gfix_db_name */
{335740930, "invalid switch @1"}, /* gfix_invalid_sw */
{335740932, "incompatible switch combination"}, /* gfix_incmp_sw */

View File

@ -853,6 +853,7 @@ static const struct {
{335545150, -901}, /* 830 subfunc_not_impl */
{335545151, -901}, /* 831 subproc_not_impl */
{335545152, -901}, /* 832 sysf_invalid_hash_algorithm */
{335545153, -901}, /* 833 expression_eval_index */
{335740929, -901}, /* 1 gfix_db_name */
{335740930, -901}, /* 2 gfix_invalid_sw */
{335740932, -901}, /* 4 gfix_incmp_sw */

View File

@ -853,6 +853,7 @@ static const struct {
{335545150, "42000"}, // 830 subfunc_not_impl
{335545151, "42000"}, // 831 subproc_not_impl
{335545152, "42000"}, // 832 sysf_invalid_hash_algorithm
{335545153, "42000"}, // 833 expression_eval_index
{335740929, "00000"}, // 1 gfix_db_name
{335740930, "00000"}, // 2 gfix_invalid_sw
{335740932, "00000"}, // 4 gfix_incmp_sw

View File

@ -274,7 +274,7 @@ void IndexErrorContext::raise(thread_db* tdbb, idx_e result, Record* record)
{
fb_assert(result != idx_e_ok);
if (result == idx_e_conversion || result == idx_e_interrupt)
if (result == idx_e_interrupt)
ERR_punt();
const MetaName& relationName = isLocationDefined ? m_location.relation->rel_name : m_relation->rel_name;
@ -297,6 +297,21 @@ void IndexErrorContext::raise(thread_db* tdbb, idx_e result, Record* record)
switch (result)
{
case idx_e_conversion:
{
Arg::StatusVector newVector;
newVector << Arg::Gds(isc_expression_eval_index) <<
Arg::Str(indexName) <<
Arg::Str(relationName);
newVector.append(Arg::StatusVector(tdbb->tdbb_status_vector));
fb_utils::init_status(tdbb->tdbb_status_vector);
ERR_post(newVector);
}
break;
case idx_e_keytoobig:
ERR_post_nothrow(Arg::Gds(isc_imp_exc) <<
Arg::Gds(isc_keytoobig) << Arg::Str(indexName));

View File

@ -1,7 +1,7 @@
/* MAX_NUMBER is the next number to be used, always one more than the highest message number. */
set bulk_insert INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES (?, ?, ?, ?);
--
('2017-07-24 12:10:00', 'JRD', 0, 833)
('2017-09-11 12:30:00', 'JRD', 0, 834)
('2015-03-17 18:33:00', 'QLI', 1, 533)
('2015-01-07 18:01:51', 'GFIX', 3, 134)
('1996-11-07 13:39:40', 'GPRE', 4, 1)

View File

@ -940,6 +940,7 @@ Data source : @4', NULL, NULL)
('subfunc_not_impl', NULL, 'StmtNodes.cpp', NULL, 0, 830, NULL, 'Sub-function @1 was declared but not implemented', NULL, NULL);
('subproc_not_impl', NULL, 'StmtNodes.cpp', NULL, 0, 831, NULL, 'Sub-procedure @1 was declared but not implemented', NULL, NULL);
('sysf_invalid_hash_algorithm', NULL, 'SysFunction.cpp', NULL, 0, 832, NULL, 'Invalid HASH algorithm @1', NULL, NULL);
('expression_eval_index', NULL, 'btr.cpp', NULL, 0, 833, NULL, 'Expression evaluation error for index "@1" on table "@2"', NULL, NULL);
-- QLI
(NULL, NULL, NULL, NULL, 1, 0, NULL, 'expected type', NULL, NULL);
(NULL, NULL, NULL, NULL, 1, 1, NULL, 'bad block type', NULL, NULL);

View File

@ -839,6 +839,7 @@ set bulk_insert INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, FA
(-901, '42', '000', 0, 830, 'subfunc_not_impl', NULL, NULL)
(-901, '42', '000', 0, 831, 'subproc_not_impl', NULL, NULL)
(-901, '42', '000', 0, 832, 'sysf_invalid_hash_algorithm', NULL, NULL)
(-901, '42', '000', 0, 833, 'expression_eval_index', NULL, NULL)
-- GFIX
(-901, '00', '000', 3, 1, 'gfix_db_name', NULL, NULL)
(-901, '00', '000', 3, 2, 'gfix_invalid_sw', NULL, NULL)