From a12820300f2242e2059f0de3e417543b2143340c Mon Sep 17 00:00:00 2001 From: robocop Date: Tue, 24 Jan 2012 03:04:28 +0000 Subject: [PATCH] Move hardcoded message to the msg db. --- src/common/BigInteger.cpp | 4 ++-- src/include/gen/codetext.h | 1 + src/include/gen/iberror.h | 6 +++-- src/include/gen/ids.h | 44 +++++++++++++++++++++++++++++++++++++ src/include/gen/msgs.h | 1 + src/include/gen/sql_code.h | 1 + src/include/gen/sql_state.h | 1 + src/msgs/facilities2.sql | 4 ++-- src/msgs/messages2.sql | 3 ++- src/msgs/system_errors2.sql | 2 ++ 10 files changed, 60 insertions(+), 7 deletions(-) diff --git a/src/common/BigInteger.cpp b/src/common/BigInteger.cpp index e0beef4026..c639e7538c 100644 --- a/src/common/BigInteger.cpp +++ b/src/common/BigInteger.cpp @@ -48,8 +48,8 @@ namespace Firebird case MP_MEM: BadAlloc::raise(); default: - // Want fancy "Libtommath error in @1 code @2" - (Arg::Gds(isc_random) << "Libtommath error").raise(); + // Libtommath error code @1 in function @2 + (Arg::Gds(isc_libtommath_generic) << Arg::Num(rc) << function).raise(); } } diff --git a/src/include/gen/codetext.h b/src/include/gen/codetext.h index 49c87614ea..896ab42baf 100644 --- a/src/include/gen/codetext.h +++ b/src/include/gen/codetext.h @@ -732,6 +732,7 @@ static const struct { {"ss_out_of_bounds", 335545028}, {"missing_data_structures", 335545029}, {"protect_sys_tab", 335545030}, + {"libtommath_generic", 335545031}, {"gfix_db_name", 335740929}, {"gfix_invalid_sw", 335740930}, {"gfix_incmp_sw", 335740932}, diff --git a/src/include/gen/iberror.h b/src/include/gen/iberror.h index 1386e4e77f..d878dfc9b1 100644 --- a/src/include/gen/iberror.h +++ b/src/include/gen/iberror.h @@ -766,6 +766,7 @@ const ISC_STATUS isc_ee_blr_mismatch_length = 335545027L; const ISC_STATUS isc_ss_out_of_bounds = 335545028L; const ISC_STATUS isc_missing_data_structures = 335545029L; const ISC_STATUS isc_protect_sys_tab = 335545030L; +const ISC_STATUS isc_libtommath_generic = 335545031L; const ISC_STATUS isc_gfix_db_name = 335740929L; const ISC_STATUS isc_gfix_invalid_sw = 335740930L; const ISC_STATUS isc_gfix_incmp_sw = 335740932L; @@ -1207,7 +1208,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 = 1151; +const ISC_STATUS isc_err_max = 1152; #else /* c definitions */ @@ -1943,6 +1944,7 @@ const ISC_STATUS isc_err_max = 1151; #define isc_ss_out_of_bounds 335545028L #define isc_missing_data_structures 335545029L #define isc_protect_sys_tab 335545030L +#define isc_libtommath_generic 335545031L #define isc_gfix_db_name 335740929L #define isc_gfix_invalid_sw 335740930L #define isc_gfix_incmp_sw 335740932L @@ -2384,7 +2386,7 @@ const ISC_STATUS isc_err_max = 1151; #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 1151 +#define isc_err_max 1152 #endif diff --git a/src/include/gen/ids.h b/src/include/gen/ids.h index 84afd1f17d..5671c6705c 100644 --- a/src/include/gen/ids.h +++ b/src/include/gen/ids.h @@ -73,6 +73,7 @@ const USHORT f_fld_precision = 27; const USHORT f_fld_class = 28; const USHORT f_fld_owner = 29; + const USHORT f_fld_schema = 30; // Relation 3 (RDB$INDEX_SEGMENTS) @@ -81,6 +82,7 @@ const USHORT f_seg_field = 1; const USHORT f_seg_position = 2; const USHORT f_seg_statistics = 3; + const USHORT f_seg_schema = 4; // Relation 4 (RDB$INDICES) @@ -98,6 +100,8 @@ const USHORT f_idx_exp_blr = 10; const USHORT f_idx_exp_source = 11; const USHORT f_idx_statistics = 12; + const USHORT f_idx_schema = 13; + const USHORT f_idx_foreign_schema = 14; // Relation 5 (RDB$RELATION_FIELDS) @@ -123,6 +127,8 @@ const USHORT f_rfr_coll_id = 18; const USHORT f_rfr_gen_name = 19; const USHORT f_rfr_identity_type = 20; + const USHORT f_rfr_schema = 21; + const USHORT f_rfr_source_schema = 22; // Relation 6 (RDB$RELATIONS) @@ -144,6 +150,7 @@ const USHORT f_rel_def_class = 14; const USHORT f_rel_flags = 15; const USHORT f_rel_type = 16; + const USHORT f_rel_schema = 17; // Relation 7 (RDB$VIEW_RELATIONS) @@ -154,6 +161,8 @@ const USHORT f_vrl_cname = 3; const USHORT f_vrl_context_type = 4; const USHORT f_vrl_pkg_name = 5; + const USHORT f_vrl_view_schema = 6; + const USHORT f_vrl_rel_schema = 7; // Relation 8 (RDB$FORMATS) @@ -168,6 +177,7 @@ const USHORT f_cls_class = 0; const USHORT f_cls_acl = 1; const USHORT f_cls_desc = 2; + const USHORT f_cls_schema = 3; // Relation 10 (RDB$FILES) @@ -205,6 +215,7 @@ const USHORT f_trg_debug_info = 11; const USHORT f_trg_engine_name = 12; const USHORT f_trg_entry = 13; + const USHORT f_trg_schema = 14; // Relation 13 (RDB$DEPENDENCIES) @@ -215,6 +226,8 @@ const USHORT f_dpd_type = 3; const USHORT f_dpd_o_type = 4; const USHORT f_dpd_pkg_name = 5; + const USHORT f_dpd_schema = 6; + const USHORT f_dpd_on_schema = 7; // Relation 14 (RDB$FUNCTIONS) @@ -239,6 +252,7 @@ const USHORT f_fun_owner = 17; const USHORT f_fun_legacy_flag = 18; const USHORT f_fun_deterministic_flag = 19; + const USHORT f_fun_schema = 20; // Relation 15 (RDB$FUNCTION_ARGUMENTS) @@ -265,6 +279,8 @@ const USHORT f_arg_rname = 19; const USHORT f_arg_sys_flag = 20; const USHORT f_arg_desc = 21; + const USHORT f_arg_schema = 22; + const USHORT f_arg_source_schema = 23; // Relation 16 (RDB$FILTERS) @@ -276,6 +292,7 @@ const USHORT f_flt_input = 4; const USHORT f_flt_output = 5; const USHORT f_flt_sys_flag = 6; + const USHORT f_flt_schema = 7; // Relation 17 (RDB$TRIGGER_MESSAGES) @@ -295,6 +312,8 @@ const USHORT f_prv_fname = 5; const USHORT f_prv_u_type = 6; const USHORT f_prv_o_type = 7; + const USHORT f_prv_user_schema = 8; + const USHORT f_prv_rel_schema = 9; // Relation 19 (RDB$TRANSACTIONS) @@ -313,6 +332,7 @@ const USHORT f_gen_desc = 3; const USHORT f_gen_class = 4; const USHORT f_gen_owner = 5; + const USHORT f_gen_schema = 6; // Relation 21 (RDB$FIELD_DIMENSIONS) @@ -321,6 +341,7 @@ const USHORT f_dims_dim = 1; const USHORT f_dims_lower = 2; const USHORT f_dims_upper = 3; + const USHORT f_dims_schema = 4; // Relation 22 (RDB$RELATION_CONSTRAINTS) @@ -331,6 +352,7 @@ const USHORT f_rcon_dfr = 3; const USHORT f_rcon_idfr = 4; const USHORT f_rcon_iname = 5; + const USHORT f_rcon_schema = 6; // Relation 23 (RDB$REF_CONSTRAINTS) @@ -340,12 +362,14 @@ const USHORT f_refc_match = 2; const USHORT f_refc_upd_rul = 3; const USHORT f_refc_del_rul = 4; + const USHORT f_refc_schema = 5; // Relation 24 (RDB$CHECK_CONSTRAINTS) const USHORT f_ccon_cname = 0; const USHORT f_ccon_tname = 1; + const USHORT f_ccon_schema = 2; // Relation 25 (RDB$LOG_FILES) @@ -378,6 +402,7 @@ const USHORT f_prc_entry = 15; const USHORT f_prc_pkg_name = 16; const USHORT f_prc_private_flag = 17; + const USHORT f_prc_schema = 18; // Relation 27 (RDB$PROCEDURE_PARAMETERS) @@ -397,6 +422,8 @@ const USHORT f_prm_fname = 12; const USHORT f_prm_rname = 13; const USHORT f_prm_pkg_name = 14; + const USHORT f_prm_schema = 15; + const USHORT f_prm_source_schema = 16; // Relation 28 (RDB$CHARACTER_SETS) @@ -412,6 +439,7 @@ const USHORT f_cs_bytes_char = 8; const USHORT f_cs_class = 9; const USHORT f_cs_owner = 10; + const USHORT f_cs_schema = 11; // Relation 29 (RDB$COLLATIONS) @@ -427,6 +455,8 @@ const USHORT f_coll_specific_attr = 8; const USHORT f_coll_class = 9; const USHORT f_coll_owner = 10; + const USHORT f_coll_schema = 11; + const USHORT f_coll_base_collation_schema = 12; // Relation 30 (RDB$EXCEPTIONS) @@ -438,6 +468,7 @@ const USHORT f_xcp_sys_flag = 4; const USHORT f_xcp_class = 5; const USHORT f_xcp_owner = 6; + const USHORT f_xcp_schema = 7; // Relation 31 (RDB$ROLES) @@ -446,6 +477,7 @@ const USHORT f_rol_owner = 1; const USHORT f_rol_desc = 2; const USHORT f_rol_sys_flag = 3; + const USHORT f_rol_schema = 4; // Relation 32 (RDB$BACKUP_HISTORY) @@ -497,6 +529,7 @@ const USHORT f_mon_att_gc = 11; const USHORT f_mon_att_remote_process = 12; const USHORT f_mon_att_stat_id = 13; + const USHORT f_mon_att_schema = 14; // Relation 35 (MON$TRANSACTIONS) @@ -539,6 +572,7 @@ const USHORT f_mon_call_src_column = 7; const USHORT f_mon_call_stat_id = 8; const USHORT f_mon_call_pkg_name = 9; + const USHORT f_mon_call_schema = 10; // Relation 38 (MON$IO_STATS) @@ -592,6 +626,7 @@ const USHORT f_pkg_owner = 4; const USHORT f_pkg_sys_flag = 5; const USHORT f_pkg_desc = 6; + const USHORT f_pkg_schema = 7; // Relation 43 (SEC$USERS) @@ -605,3 +640,12 @@ const USHORT f_sec_last_name = 6; +// Relation 44 (RDB$SCHEMAS) + + const USHORT f_schema_name = 0; + const USHORT f_schema_charset = 1; + const USHORT f_schema_class = 2; + const USHORT f_schema_owner = 3; + const USHORT f_schema_sys_flag = 4; + const USHORT f_schema_desc = 5; + diff --git a/src/include/gen/msgs.h b/src/include/gen/msgs.h index 61be8fafdb..9cfb8ee6d5 100644 --- a/src/include/gen/msgs.h +++ b/src/include/gen/msgs.h @@ -735,6 +735,7 @@ Data source : @4"}, /* eds_statement */ {335545028, "Subscript @1 out of bounds [@2, @3]"}, /* ss_out_of_bounds */ {335545029, "Install incomplete, please read chapter \"Initializing security database\" in Quick Start Guide"}, /* missing_data_structures */ {335545030, "@1 operation is not allowed for system table @2"}, /* protect_sys_tab */ + {335545031, "Libtommath error code @1 in function @2"}, /* libtommath_generic */ {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 */ diff --git a/src/include/gen/sql_code.h b/src/include/gen/sql_code.h index 1ec9b98e9d..aeb9e70435 100644 --- a/src/include/gen/sql_code.h +++ b/src/include/gen/sql_code.h @@ -731,6 +731,7 @@ static const struct { {335545028, -406}, /* 708 ss_out_of_bounds */ {335545029, -902}, /* 709 missing_data_structures */ {335545030, -902}, /* 710 protect_sys_tab */ + {335545031, -901}, /* 711 libtommath_generic */ {335740929, -901}, /* 1 gfix_db_name */ {335740930, -901}, /* 2 gfix_invalid_sw */ {335740932, -901}, /* 4 gfix_incmp_sw */ diff --git a/src/include/gen/sql_state.h b/src/include/gen/sql_state.h index a104f5fe97..8f3b1368a8 100644 --- a/src/include/gen/sql_state.h +++ b/src/include/gen/sql_state.h @@ -731,6 +731,7 @@ static const struct { {335545028, "42000"}, // 708 ss_out_of_bounds {335545029, "28000"}, // 709 missing_data_structures {335545030, "42000"}, // 710 protect_sys_tab + {335545031, "2F000"}, // 711 libtommath_generic {335740929, "00000"}, // 1 gfix_db_name {335740930, "00000"}, // 2 gfix_invalid_sw {335740932, "00000"}, // 4 gfix_incmp_sw diff --git a/src/msgs/facilities2.sql b/src/msgs/facilities2.sql index 47688b581f..d00e3db55c 100644 --- a/src/msgs/facilities2.sql +++ b/src/msgs/facilities2.sql @@ -1,8 +1,8 @@ /* 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 (?, ?, ?, ?); -- -('2012-01-20 11:48:31', 'JRD', 0, 711) -('2012-01-19 04:56:37', 'QLI', 1, 532) +('2012-01-20 11:48:31', 'JRD', 0, 712) +('2012-01-23 20:10:30', 'QLI', 1, 532) ('2009-07-16 05:26:11', 'GFIX', 3, 121) ('1996-11-07 13:39:40', 'GPRE', 4, 1) ('2005-11-05 13:09:00', 'DSQL', 7, 32) diff --git a/src/msgs/messages2.sql b/src/msgs/messages2.sql index fc50ccf943..4a21e107ef 100644 --- a/src/msgs/messages2.sql +++ b/src/msgs/messages2.sql @@ -818,6 +818,7 @@ Data source : @4', NULL, NULL) ('ss_out_of_bounds', NULL, 'sdl.cpp', NULL, 0, 708, NULL, 'Subscript @1 out of bounds [@2, @3]', NULL, NULL) ('missing_data_structures', NULL, 'server.cpp', NULL, 0, 709, NULL, 'Install incomplete, please read chapter "Initializing security database" in Quick Start Guide', NULL, NULL) ('protect_sys_tab', NULL, 'vio.cpp', NULL, 0, 710, NULL, '@1 operation is not allowed for system table @2', NULL, NULL) +('libtommath_generic', 'check', 'BigInteger.cpp', NULL, 0, 711, NULL, 'Libtommath error code @1 in function @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); @@ -1414,7 +1415,7 @@ Roll back all databases or commit databases individually', NULL, NULL); (NULL, 'usage', 'dtr.cpp', NULL, 1, 517, NULL, ' -b(uffers) set page buffers ', NULL, NULL) (NULL, 'usage', 'dtr.cpp', NULL, 1, 518, NULL, ' -f(etch_password) fetch password from file', NULL, NULL) (NULL, 'usage', 'dtr.cpp', NULL, 1, 519, NULL, ' -i(nit_script) startup script ', NULL, NULL) -(NULL, 'usage', 'dtr.cpp', NULL, 1, 520, NULL, ' -nob(anner) do not show the welcome message', NULL, NULL) +(NULL, 'usage', 'dtr.cpp', NULL, 1, 520, NULL, ' -n(obanner) do not show the welcome message', NULL, NULL) (NULL, 'usage', 'dtr.cpp', NULL, 1, 521, NULL, ' -p(assword) user''s password', NULL, NULL) (NULL, 'usage', 'dtr.cpp', NULL, 1, 522, NULL, ' -tra(ce) show internal parser''s tokens', NULL, NULL) (NULL, 'usage', 'dtr.cpp', NULL, 1, 523, NULL, ' -tru(sted_auth) use trusted authentication', NULL, NULL) diff --git a/src/msgs/system_errors2.sql b/src/msgs/system_errors2.sql index 8b1479c175..3e53211849 100644 --- a/src/msgs/system_errors2.sql +++ b/src/msgs/system_errors2.sql @@ -716,6 +716,8 @@ set bulk_insert INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, FA (-406, '42', '000', 0, 708, 'ss_out_of_bounds', NULL, NULL) (-902, '28', '000', 0, 709, 'missing_data_structures', NULL, NULL) (-902, '42', '000', 0, 710, 'protect_sys_tab', NULL, NULL) +-- If you have better SQL code for this, change it. +(-901, '2F', '000', 0, 711, 'libtommath_generic', NULL, NULL) -- GFIX (-901, '00', '000', 3, 1, 'gfix_db_name', NULL, NULL) (-901, '00', '000', 3, 2, 'gfix_invalid_sw', NULL, NULL)