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

Use slightly more clear messages during FK violations. Patch submitted by Adriano dos Santos Fernandes

This commit is contained in:
skidder 2004-08-31 22:29:59 +00:00
parent 98f7ce0e2a
commit 56a42f9765
13 changed files with 242 additions and 213 deletions

View File

@ -1086,6 +1086,10 @@ C --
PARAMETER (GDS__concat_overflow = 335544836) PARAMETER (GDS__concat_overflow = 335544836)
INTEGER*4 GDS__bad_substring_param INTEGER*4 GDS__bad_substring_param
PARAMETER (GDS__bad_substring_param = 335544837) PARAMETER (GDS__bad_substring_param = 335544837)
INTEGER*4 GDS__foreign_key_target_doesnt_exist
PARAMETER (GDS__foreign_key_target_doesnt_exist = 335544838)
INTEGER*4 GDS__foreign_key_references_present
PARAMETER (GDS__foreign_key_references_present = 335544839)
INTEGER*4 GDS__gfix_db_name INTEGER*4 GDS__gfix_db_name
PARAMETER (GDS__gfix_db_name = 335740929) PARAMETER (GDS__gfix_db_name = 335740929)
INTEGER*4 GDS__gfix_invalid_sw INTEGER*4 GDS__gfix_invalid_sw

View File

@ -550,6 +550,8 @@ const
gds_bad_shutdown_mode = 335544835; gds_bad_shutdown_mode = 335544835;
gds_concat_overflow = 335544836; gds_concat_overflow = 335544836;
gds_bad_substring_param = 335544837; gds_bad_substring_param = 335544837;
gds_foreign_key_target_doesnt_exist = 335544838;
gds_foreign_key_references_present = 335544839;
gds_gfix_db_name = 335740929; gds_gfix_db_name = 335740929;
gds_gfix_invalid_sw = 335740930; gds_gfix_invalid_sw = 335740930;
gds_gfix_incmp_sw = 335740932; gds_gfix_incmp_sw = 335740932;

View File

@ -539,6 +539,8 @@ static const struct {
{"bad_shutdown_mode", 335544835}, {"bad_shutdown_mode", 335544835},
{"concat_overflow", 335544836}, {"concat_overflow", 335544836},
{"bad_substring_param", 335544837}, {"bad_substring_param", 335544837},
{"foreign_key_target_doesnt_exist", 335544838},
{"foreign_key_references_present", 335544839},
{"gfix_db_name", 335740929}, {"gfix_db_name", 335740929},
{"gfix_invalid_sw", 335740930}, {"gfix_invalid_sw", 335740930},
{"gfix_incmp_sw", 335740932}, {"gfix_incmp_sw", 335740932},

View File

@ -572,6 +572,8 @@ const SLONG isc_invalid_cursor_state = 335544834L;
const SLONG isc_bad_shutdown_mode = 335544835L; const SLONG isc_bad_shutdown_mode = 335544835L;
const SLONG isc_concat_overflow = 335544836L; const SLONG isc_concat_overflow = 335544836L;
const SLONG isc_bad_substring_param = 335544837L; const SLONG isc_bad_substring_param = 335544837L;
const SLONG isc_foreign_key_target_doesnt_exist = 335544838L;
const SLONG isc_foreign_key_references_present = 335544839L;
const SLONG isc_gfix_db_name = 335740929L; const SLONG isc_gfix_db_name = 335740929L;
const SLONG isc_gfix_invalid_sw = 335740930L; const SLONG isc_gfix_invalid_sw = 335740930L;
const SLONG isc_gfix_incmp_sw = 335740932L; const SLONG isc_gfix_incmp_sw = 335740932L;
@ -774,7 +776,7 @@ const SLONG isc_gstat_unexpected_eof = 336920580L;
const SLONG isc_gstat_open_err = 336920605L; const SLONG isc_gstat_open_err = 336920605L;
const SLONG isc_gstat_read_err = 336920606L; const SLONG isc_gstat_read_err = 336920606L;
const SLONG isc_gstat_sysmemex = 336920607L; const SLONG isc_gstat_sysmemex = 336920607L;
const SLONG isc_err_max = 719; const SLONG isc_err_max = 721;
#else /* c definitions */ #else /* c definitions */
@ -1316,6 +1318,8 @@ const SLONG isc_err_max = 719;
#define isc_bad_shutdown_mode 335544835L #define isc_bad_shutdown_mode 335544835L
#define isc_concat_overflow 335544836L #define isc_concat_overflow 335544836L
#define isc_bad_substring_param 335544837L #define isc_bad_substring_param 335544837L
#define isc_foreign_key_target_doesnt_exist 335544838L
#define isc_foreign_key_references_present 335544839L
#define isc_gfix_db_name 335740929L #define isc_gfix_db_name 335740929L
#define isc_gfix_invalid_sw 335740930L #define isc_gfix_invalid_sw 335740930L
#define isc_gfix_incmp_sw 335740932L #define isc_gfix_incmp_sw 335740932L
@ -1518,7 +1522,7 @@ const SLONG isc_err_max = 719;
#define isc_gstat_open_err 336920605L #define isc_gstat_open_err 336920605L
#define isc_gstat_read_err 336920606L #define isc_gstat_read_err 336920606L
#define isc_gstat_sysmemex 336920607L #define isc_gstat_sysmemex 336920607L
#define isc_err_max 719 #define isc_err_max 721
#endif #endif

View File

@ -537,207 +537,209 @@ static const SCHAR * const messages[] = {
"Target shutdown mode is invalid for database \"%s\"", /* 515, bad_shutdown_mode */ "Target shutdown mode is invalid for database \"%s\"", /* 515, bad_shutdown_mode */
"Concatenation overflow. Resulting string cannot exceed 32K in length.", /* 516, concat_overflow */ "Concatenation overflow. Resulting string cannot exceed 32K in length.", /* 516, concat_overflow */
"Invalid %s parameter to SUBSTRING. Only positive integers are allowed.", /* 517, bad_substring_param */ "Invalid %s parameter to SUBSTRING. Only positive integers are allowed.", /* 517, bad_substring_param */
"data base file name (%s) already given", /* 518, gfix_db_name */ "Foreign key reference target does not exist", /* 518, foreign_key_target_doesnt_exist */
"invalid switch %s", /* 519, gfix_invalid_sw */ "Foreign key references are present for the record", /* 519, foreign_key_references_present */
"incompatible switch combination", /* 520, gfix_incmp_sw */ "data base file name (%s) already given", /* 520, gfix_db_name */
"replay log pathname required", /* 521, gfix_replay_req */ "invalid switch %s", /* 521, gfix_invalid_sw */
"number of page buffers for cache required", /* 522, gfix_pgbuf_req */ "incompatible switch combination", /* 522, gfix_incmp_sw */
"numeric value required", /* 523, gfix_val_req */ "replay log pathname required", /* 523, gfix_replay_req */
"positive numeric value required", /* 524, gfix_pval_req */ "number of page buffers for cache required", /* 524, gfix_pgbuf_req */
"number of transactions per sweep required", /* 525, gfix_trn_req */ "numeric value required", /* 525, gfix_val_req */
"\"full\" or \"reserve\" required", /* 526, gfix_full_req */ "positive numeric value required", /* 526, gfix_pval_req */
"user name required", /* 527, gfix_usrname_req */ "number of transactions per sweep required", /* 527, gfix_trn_req */
"password required", /* 528, gfix_pass_req */ "\"full\" or \"reserve\" required", /* 528, gfix_full_req */
"subsystem name", /* 529, gfix_subs_name */ "user name required", /* 529, gfix_usrname_req */
"\"wal\" required", /* 530, gfix_wal_req */ "password required", /* 530, gfix_pass_req */
"number of seconds required", /* 531, gfix_sec_req */ "subsystem name", /* 531, gfix_subs_name */
"numeric value between 0 and 32767 inclusive required", /* 532, gfix_nval_req */ "\"wal\" required", /* 532, gfix_wal_req */
"must specify type of shutdown", /* 533, gfix_type_shut */ "number of seconds required", /* 533, gfix_sec_req */
"please retry, specifying an option", /* 534, gfix_retry */ "numeric value between 0 and 32767 inclusive required", /* 534, gfix_nval_req */
"please retry, giving a database name", /* 535, gfix_retry_db */ "must specify type of shutdown", /* 535, gfix_type_shut */
"internal block exceeds maximum size", /* 536, gfix_exceed_max */ "please retry, specifying an option", /* 536, gfix_retry */
"corrupt pool", /* 537, gfix_corrupt_pool */ "please retry, giving a database name", /* 537, gfix_retry_db */
"virtual memory exhausted", /* 538, gfix_mem_exhausted */ "internal block exceeds maximum size", /* 538, gfix_exceed_max */
"bad pool id", /* 539, gfix_bad_pool */ "corrupt pool", /* 539, gfix_corrupt_pool */
"Transaction state %d not in valid range.", /* 540, gfix_trn_not_valid */ "virtual memory exhausted", /* 540, gfix_mem_exhausted */
"unexpected end of input", /* 541, gfix_unexp_eoi */ "bad pool id", /* 541, gfix_bad_pool */
"failed to reconnect to a transaction in database %s", /* 542, gfix_recon_fail */ "Transaction state %d not in valid range.", /* 542, gfix_trn_not_valid */
"Transaction description item unknown", /* 543, gfix_trn_unknown */ "unexpected end of input", /* 543, gfix_unexp_eoi */
"\"read_only\" or \"read_write\" required", /* 544, gfix_mode_req */ "failed to reconnect to a transaction in database %s", /* 544, gfix_recon_fail */
" -sql_dialect set database dialect n", /* 545, gfix_opt_SQL_dialect */ "Transaction description item unknown", /* 545, gfix_trn_unknown */
"Cannot SELECT RDB$DB_KEY from a stored procedure.", /* 546, dsql_dbkey_from_non_table */ "\"read_only\" or \"read_write\" required", /* 546, gfix_mode_req */
"Precision 10 to 18 changed from DOUBLE PRECISION in SQL dialect 1 to 64-bit scaled integer in SQL dialect 3", /* 547, dsql_transitional_numeric */ " -sql_dialect set database dialect n", /* 547, gfix_opt_SQL_dialect */
"Use of %s expression that returns different results in dialect 1 and dialect 3", /* 548, dsql_dialect_warning_expr */ "Cannot SELECT RDB$DB_KEY from a stored procedure.", /* 548, dsql_dbkey_from_non_table */
"Database SQL dialect %d does not support reference to %s datatype", /* 549, sql_db_dialect_dtype_unsupport */ "Precision 10 to 18 changed from DOUBLE PRECISION in SQL dialect 1 to 64-bit scaled integer in SQL dialect 3", /* 549, dsql_transitional_numeric */
"DB dialect %d and client dialect %d conflict with respect to numeric precision %d.", /* 550, isc_sql_dialect_conflict_num */ "Use of %s expression that returns different results in dialect 1 and dialect 3", /* 550, dsql_dialect_warning_expr */
"WARNING: Numeric literal %s is interpreted as a floating-point", /* 551, dsql_warning_number_ambiguous */ "Database SQL dialect %d does not support reference to %s datatype", /* 551, sql_db_dialect_dtype_unsupport */
"value in SQL dialect 1, but as an exact numeric value in SQL dialect 3.", /* 552, dsql_warning_number_ambiguous1 */ "DB dialect %d and client dialect %d conflict with respect to numeric precision %d.", /* 552, isc_sql_dialect_conflict_num */
"WARNING: NUMERIC and DECIMAL fields with precision 10 or greater are stored", /* 553, dsql_warn_precision_ambiguous */ "WARNING: Numeric literal %s is interpreted as a floating-point", /* 553, dsql_warning_number_ambiguous */
"as approximate floating-point values in SQL dialect 1, but as 64-bit", /* 554, dsql_warn_precision_ambiguous1 */ "value in SQL dialect 1, but as an exact numeric value in SQL dialect 3.", /* 554, dsql_warning_number_ambiguous1 */
"integers in SQL dialect 3.", /* 555, dsql_warn_precision_ambiguous2 */ "WARNING: NUMERIC and DECIMAL fields with precision 10 or greater are stored", /* 555, dsql_warn_precision_ambiguous */
"Ambiguous field name between %s and %s", /* 556, dsql_ambiguous_field_name */ "as approximate floating-point values in SQL dialect 1, but as 64-bit", /* 556, dsql_warn_precision_ambiguous1 */
"External function should have return position between 1 and %d", /* 557, dsql_udf_return_pos_err */ "integers in SQL dialect 3.", /* 557, dsql_warn_precision_ambiguous2 */
"Label %s %s in the current scope", /* 558, dsql_invalid_label */ "Ambiguous field name between %s and %s", /* 558, dsql_ambiguous_field_name */
"Datatypes %sare not comparable in expression %s", /* 559, dsql_datatypes_not_comparable */ "External function should have return position between 1 and %d", /* 559, dsql_udf_return_pos_err */
"SQL role %s does not exist", /* 560, dyn_role_does_not_exist */ "Label %s %s in the current scope", /* 560, dsql_invalid_label */
"user %s has no grant admin option on SQL role %s", /* 561, dyn_no_grant_admin_opt */ "Datatypes %sare not comparable in expression %s", /* 561, dsql_datatypes_not_comparable */
"user %s is not a member of SQL role %s", /* 562, dyn_user_not_role_member */ "SQL role %s does not exist", /* 562, dyn_role_does_not_exist */
"%s is not the owner of SQL role %s", /* 563, dyn_delete_role_failed */ "user %s has no grant admin option on SQL role %s", /* 563, dyn_no_grant_admin_opt */
"%s is a SQL role and not a user", /* 564, dyn_grant_role_to_user */ "user %s is not a member of SQL role %s", /* 564, dyn_user_not_role_member */
"user name %s could not be used for SQL role", /* 565, dyn_inv_sql_role_name */ "%s is not the owner of SQL role %s", /* 565, dyn_delete_role_failed */
"SQL role %s already exists", /* 566, dyn_dup_sql_role */ "%s is a SQL role and not a user", /* 566, dyn_grant_role_to_user */
"keyword %s can not be used as a SQL role name", /* 567, dyn_kywd_spec_for_role */ "user name %s could not be used for SQL role", /* 567, dyn_inv_sql_role_name */
"SQL roles are not supported in on older versions of the database. A backup and restore of the database is required.", /* 568, dyn_roles_not_supported */ "SQL role %s already exists", /* 568, dyn_dup_sql_role */
"Cannot rename domain %s to %s. A domain with that name already exists.", /* 569, dyn_domain_name_exists */ "keyword %s can not be used as a SQL role name", /* 569, dyn_kywd_spec_for_role */
"Cannot rename column %s to %s. A column with that name already exists in table %s.", /* 570, dyn_field_name_exists */ "SQL roles are not supported in on older versions of the database. A backup and restore of the database is required.", /* 570, dyn_roles_not_supported */
"Column %s from table %s is referenced in %s", /* 571, dyn_dependency_exists */ "Cannot rename domain %s to %s. A domain with that name already exists.", /* 571, dyn_domain_name_exists */
"Cannot change datatype for column %s. Changing datatype is not supported for BLOB or ARRAY columns.", /* 572, dyn_dtype_invalid */ "Cannot rename column %s to %s. A column with that name already exists in table %s.", /* 572, dyn_field_name_exists */
"New size specified for column %s must be at least %d characters.", /* 573, dyn_char_fld_too_small */ "Column %s from table %s is referenced in %s", /* 573, dyn_dependency_exists */
"Cannot change datatype for %s. Conversion from base type %s to %s is not supported.", /* 574, dyn_invalid_dtype_conversion */ "Cannot change datatype for column %s. Changing datatype is not supported for BLOB or ARRAY columns.", /* 574, dyn_dtype_invalid */
"Cannot change datatype for column %s from a character type to a non-character type.", /* 575, dyn_dtype_conv_invalid */ "New size specified for column %s must be at least %d characters.", /* 575, dyn_char_fld_too_small */
"Zero length identifiers are not allowed", /* 576, dyn_zero_len_id */ "Cannot change datatype for %s. Conversion from base type %s to %s is not supported.", /* 576, dyn_invalid_dtype_conversion */
"found unknown switch", /* 577, gbak_unknown_switch */ "Cannot change datatype for column %s from a character type to a non-character type.", /* 577, dyn_dtype_conv_invalid */
"page size parameter missing", /* 578, gbak_page_size_missing */ "Zero length identifiers are not allowed", /* 578, dyn_zero_len_id */
"Page size specified (%ld) greater than limit (8192 bytes)", /* 579, gbak_page_size_toobig */ "found unknown switch", /* 579, gbak_unknown_switch */
"redirect location for output is not specified", /* 580, gbak_redir_ouput_missing */ "page size parameter missing", /* 580, gbak_page_size_missing */
"conflicting switches for backup/restore", /* 581, gbak_switches_conflict */ "Page size specified (%ld) greater than limit (8192 bytes)", /* 581, gbak_page_size_toobig */
"device type %s not known", /* 582, gbak_unknown_device */ "redirect location for output is not specified", /* 582, gbak_redir_ouput_missing */
"protection is not there yet", /* 583, gbak_no_protection */ "conflicting switches for backup/restore", /* 583, gbak_switches_conflict */
"page size is allowed only on restore or create", /* 584, gbak_page_size_not_allowed */ "device type %s not known", /* 584, gbak_unknown_device */
"multiple sources or destinations specified", /* 585, gbak_multi_source_dest */ "protection is not there yet", /* 585, gbak_no_protection */
"requires both input and output filenames", /* 586, gbak_filename_missing */ "page size is allowed only on restore or create", /* 586, gbak_page_size_not_allowed */
"input and output have the same name. Disallowed.", /* 587, gbak_dup_inout_names */ "multiple sources or destinations specified", /* 587, gbak_multi_source_dest */
"expected page size, encountered \"%s\"", /* 588, gbak_inv_page_size */ "requires both input and output filenames", /* 588, gbak_filename_missing */
"REPLACE specified, but the first file %s is a database", /* 589, gbak_db_specified */ "input and output have the same name. Disallowed.", /* 589, gbak_dup_inout_names */
"database %s already exists. To replace it, use the -R switch", /* 590, gbak_db_exists */ "expected page size, encountered \"%s\"", /* 590, gbak_inv_page_size */
"device type not specified", /* 591, gbak_unk_device */ "REPLACE specified, but the first file %s is a database", /* 591, gbak_db_specified */
"gds_$blob_info failed", /* 592, gbak_blob_info_failed */ "database %s already exists. To replace it, use the -R switch", /* 592, gbak_db_exists */
"do not understand BLOB INFO item %ld", /* 593, gbak_unk_blob_item */ "device type not specified", /* 593, gbak_unk_device */
"gds_$get_segment failed", /* 594, gbak_get_seg_failed */ "gds_$blob_info failed", /* 594, gbak_blob_info_failed */
"gds_$close_blob failed", /* 595, gbak_close_blob_failed */ "do not understand BLOB INFO item %ld", /* 595, gbak_unk_blob_item */
"gds_$open_blob failed", /* 596, gbak_open_blob_failed */ "gds_$get_segment failed", /* 596, gbak_get_seg_failed */
"Failed in put_blr_gen_id", /* 597, gbak_put_blr_gen_id_failed */ "gds_$close_blob failed", /* 597, gbak_close_blob_failed */
"data type %ld not understood", /* 598, gbak_unk_type */ "gds_$open_blob failed", /* 598, gbak_open_blob_failed */
"gds_$compile_request failed", /* 599, gbak_comp_req_failed */ "Failed in put_blr_gen_id", /* 599, gbak_put_blr_gen_id_failed */
"gds_$start_request failed", /* 600, gbak_start_req_failed */ "data type %ld not understood", /* 600, gbak_unk_type */
" gds_$receive failed", /* 601, gbak_rec_failed */ "gds_$compile_request failed", /* 601, gbak_comp_req_failed */
"gds_$release_request failed", /* 602, gbak_rel_req_failed */ "gds_$start_request failed", /* 602, gbak_start_req_failed */
" gds_$database_info failed", /* 603, gbak_db_info_failed */ " gds_$receive failed", /* 603, gbak_rec_failed */
"Expected database description record", /* 604, gbak_no_db_desc */ "gds_$release_request failed", /* 604, gbak_rel_req_failed */
"failed to create database %s", /* 605, gbak_db_create_failed */ " gds_$database_info failed", /* 605, gbak_db_info_failed */
"RESTORE: decompression length error", /* 606, gbak_decomp_len_error */ "Expected database description record", /* 606, gbak_no_db_desc */
"cannot find table %s", /* 607, gbak_tbl_missing */ "failed to create database %s", /* 607, gbak_db_create_failed */
"Cannot find column for BLOB", /* 608, gbak_blob_col_missing */ "RESTORE: decompression length error", /* 608, gbak_decomp_len_error */
"gds_$create_blob failed", /* 609, gbak_create_blob_failed */ "cannot find table %s", /* 609, gbak_tbl_missing */
"gds_$put_segment failed", /* 610, gbak_put_seg_failed */ "Cannot find column for BLOB", /* 610, gbak_blob_col_missing */
"expected record length", /* 611, gbak_rec_len_exp */ "gds_$create_blob failed", /* 611, gbak_create_blob_failed */
"wrong length record, expected %ld encountered %ld", /* 612, gbak_inv_rec_len */ "gds_$put_segment failed", /* 612, gbak_put_seg_failed */
"expected data attribute", /* 613, gbak_exp_data_type */ "expected record length", /* 613, gbak_rec_len_exp */
"Failed in store_blr_gen_id", /* 614, gbak_gen_id_failed */ "wrong length record, expected %ld encountered %ld", /* 614, gbak_inv_rec_len */
"do not recognize record type %ld", /* 615, gbak_unk_rec_type */ "expected data attribute", /* 615, gbak_exp_data_type */
"Expected backup version 1, 2, or 3. Found %ld", /* 616, gbak_inv_bkup_ver */ "Failed in store_blr_gen_id", /* 616, gbak_gen_id_failed */
"expected backup description record", /* 617, gbak_missing_bkup_desc */ "do not recognize record type %ld", /* 617, gbak_unk_rec_type */
"string truncated", /* 618, gbak_string_trunc */ "Expected backup version 1, 2, or 3. Found %ld", /* 618, gbak_inv_bkup_ver */
" warning -- record could not be restored", /* 619, gbak_cant_rest_record */ "expected backup description record", /* 619, gbak_missing_bkup_desc */
"gds_$send failed", /* 620, gbak_send_failed */ "string truncated", /* 620, gbak_string_trunc */
"no table name for data", /* 621, gbak_no_tbl_name */ " warning -- record could not be restored", /* 621, gbak_cant_rest_record */
"unexpected end of file on backup file", /* 622, gbak_unexp_eof */ "gds_$send failed", /* 622, gbak_send_failed */
"database format %ld is too old to restore to", /* 623, gbak_db_format_too_old */ "no table name for data", /* 623, gbak_no_tbl_name */
"array dimension for column %s is invalid", /* 624, gbak_inv_array_dim */ "unexpected end of file on backup file", /* 624, gbak_unexp_eof */
"Expected XDR record length", /* 625, gbak_xdr_len_expected */ "database format %ld is too old to restore to", /* 625, gbak_db_format_too_old */
"cannot open backup file %s", /* 626, gbak_open_bkup_error */ "array dimension for column %s is invalid", /* 626, gbak_inv_array_dim */
"cannot open status and error output file %s", /* 627, gbak_open_error */ "Expected XDR record length", /* 627, gbak_xdr_len_expected */
"blocking factor parameter missing", /* 628, gbak_missing_block_fac */ "cannot open backup file %s", /* 628, gbak_open_bkup_error */
"expected blocking factor, encountered \"%s\"", /* 629, gbak_inv_block_fac */ "cannot open status and error output file %s", /* 629, gbak_open_error */
"a blocking factor may not be used in conjunction with device CT", /* 630, gbak_block_fac_specified */ "blocking factor parameter missing", /* 630, gbak_missing_block_fac */
"user name parameter missing", /* 631, gbak_missing_username */ "expected blocking factor, encountered \"%s\"", /* 631, gbak_inv_block_fac */
"password parameter missing", /* 632, gbak_missing_password */ "a blocking factor may not be used in conjunction with device CT", /* 632, gbak_block_fac_specified */
" missing parameter for the number of bytes to be skipped", /* 633, gbak_missing_skipped_bytes */ "user name parameter missing", /* 633, gbak_missing_username */
"expected number of bytes to be skipped, encountered \"%s\"", /* 634, gbak_inv_skipped_bytes */ "password parameter missing", /* 634, gbak_missing_password */
"Bad attribute for RDB$CHARACTER_SETS", /* 635, gbak_err_restore_charset */ " missing parameter for the number of bytes to be skipped", /* 635, gbak_missing_skipped_bytes */
"Bad attribute for RDB$COLLATIONS", /* 636, gbak_err_restore_collation */ "expected number of bytes to be skipped, encountered \"%s\"", /* 636, gbak_inv_skipped_bytes */
"Unexpected I/O error while reading from backup file", /* 637, gbak_read_error */ "Bad attribute for RDB$CHARACTER_SETS", /* 637, gbak_err_restore_charset */
"Unexpected I/O error while writing to backup file", /* 638, gbak_write_error */ "Bad attribute for RDB$COLLATIONS", /* 638, gbak_err_restore_collation */
"could not drop database %s (database might be in use)", /* 639, gbak_db_in_use */ "Unexpected I/O error while reading from backup file", /* 639, gbak_read_error */
"System memory exhausted", /* 640, gbak_sysmemex */ "Unexpected I/O error while writing to backup file", /* 640, gbak_write_error */
"Bad attributes for restoring SQL role", /* 641, gbak_restore_role_failed */ "could not drop database %s (database might be in use)", /* 641, gbak_db_in_use */
"SQL role parameter missing", /* 642, gbak_role_op_missing */ "System memory exhausted", /* 642, gbak_sysmemex */
"page buffers parameter missing", /* 643, gbak_page_buffers_missing */ "Bad attributes for restoring SQL role", /* 643, gbak_restore_role_failed */
"expected page buffers, encountered \"%s\"", /* 644, gbak_page_buffers_wrong_param */ "SQL role parameter missing", /* 644, gbak_role_op_missing */
"page buffers is allowed only on restore or create", /* 645, gbak_page_buffers_restore */ "page buffers parameter missing", /* 645, gbak_page_buffers_missing */
"size specification either missing or incorrect for file %s", /* 646, gbak_inv_size */ "expected page buffers, encountered \"%s\"", /* 646, gbak_page_buffers_wrong_param */
"file %s out of sequence", /* 647, gbak_file_outof_sequence */ "page buffers is allowed only on restore or create", /* 647, gbak_page_buffers_restore */
"can't join -- one of the files missing", /* 648, gbak_join_file_missing */ "size specification either missing or incorrect for file %s", /* 648, gbak_inv_size */
" standard input is not supported when using join operation", /* 649, gbak_stdin_not_supptd */ "file %s out of sequence", /* 649, gbak_file_outof_sequence */
"standard output is not supported when using split operation", /* 650, gbak_stdout_not_supptd */ "can't join -- one of the files missing", /* 650, gbak_join_file_missing */
"backup file %s might be corrupt", /* 651, gbak_bkup_corrupt */ " standard input is not supported when using join operation", /* 651, gbak_stdin_not_supptd */
"database file specification missing", /* 652, gbak_unk_db_file_spec */ "standard output is not supported when using split operation", /* 652, gbak_stdout_not_supptd */
"can't write a header record to file %s", /* 653, gbak_hdr_write_failed */ "backup file %s might be corrupt", /* 653, gbak_bkup_corrupt */
"free disk space exhausted", /* 654, gbak_disk_space_ex */ "database file specification missing", /* 654, gbak_unk_db_file_spec */
"file size given (%d) is less than minimum allowed (%d)", /* 655, gbak_size_lt_min */ "can't write a header record to file %s", /* 655, gbak_hdr_write_failed */
"service name parameter missing", /* 656, gbak_svc_name_missing */ "free disk space exhausted", /* 656, gbak_disk_space_ex */
"Cannot restore over current database, must be SYSDBA or owner of the existing database.", /* 657, gbak_not_ownr */ "file size given (%d) is less than minimum allowed (%d)", /* 657, gbak_size_lt_min */
"\"read_only\" or \"read_write\" required", /* 658, gbak_mode_req */ "service name parameter missing", /* 658, gbak_svc_name_missing */
"just data ignore all constraints etc.", /* 659, gbak_just_data */ "Cannot restore over current database, must be SYSDBA or owner of the existing database.", /* 659, gbak_not_ownr */
"restoring data only ignoring foreign key, unique, not null & other constraints", /* 660, gbak_data_only */ "\"read_only\" or \"read_write\" required", /* 660, gbak_mode_req */
"unable to open database", /* 661, gsec_cant_open_db */ "just data ignore all constraints etc.", /* 661, gbak_just_data */
"error in switch specifications", /* 662, gsec_switches_error */ "restoring data only ignoring foreign key, unique, not null & other constraints", /* 662, gbak_data_only */
"no operation specified", /* 663, gsec_no_op_spec */ "unable to open database", /* 663, gsec_cant_open_db */
"no user name specified", /* 664, gsec_no_usr_name */ "error in switch specifications", /* 664, gsec_switches_error */
"add record error", /* 665, gsec_err_add */ "no operation specified", /* 665, gsec_no_op_spec */
"modify record error", /* 666, gsec_err_modify */ "no user name specified", /* 666, gsec_no_usr_name */
"find/modify record error", /* 667, gsec_err_find_mod */ "add record error", /* 667, gsec_err_add */
"record not found for user: %s", /* 668, gsec_err_rec_not_found */ "modify record error", /* 668, gsec_err_modify */
"delete record error", /* 669, gsec_err_delete */ "find/modify record error", /* 669, gsec_err_find_mod */
"find/delete record error", /* 670, gsec_err_find_del */ "record not found for user: %s", /* 670, gsec_err_rec_not_found */
"find/display record error", /* 671, gsec_err_find_disp */ "delete record error", /* 671, gsec_err_delete */
"invalid parameter, no switch defined", /* 672, gsec_inv_param */ "find/delete record error", /* 672, gsec_err_find_del */
"operation already specified", /* 673, gsec_op_specified */ "find/display record error", /* 673, gsec_err_find_disp */
"password already specified", /* 674, gsec_pw_specified */ "invalid parameter, no switch defined", /* 674, gsec_inv_param */
"uid already specified", /* 675, gsec_uid_specified */ "operation already specified", /* 675, gsec_op_specified */
"gid already specified", /* 676, gsec_gid_specified */ "password already specified", /* 676, gsec_pw_specified */
"project already specified", /* 677, gsec_proj_specified */ "uid already specified", /* 677, gsec_uid_specified */
"organization already specified", /* 678, gsec_org_specified */ "gid already specified", /* 678, gsec_gid_specified */
"first name already specified", /* 679, gsec_fname_specified */ "project already specified", /* 679, gsec_proj_specified */
"middle name already specified", /* 680, gsec_mname_specified */ "organization already specified", /* 680, gsec_org_specified */
"last name already specified", /* 681, gsec_lname_specified */ "first name already specified", /* 681, gsec_fname_specified */
"invalid switch specified", /* 682, gsec_inv_switch */ "middle name already specified", /* 682, gsec_mname_specified */
"ambiguous switch specified", /* 683, gsec_amb_switch */ "last name already specified", /* 683, gsec_lname_specified */
"no operation specified for parameters", /* 684, gsec_no_op_specified */ "invalid switch specified", /* 684, gsec_inv_switch */
"no parameters allowed for this operation", /* 685, gsec_params_not_allowed */ "ambiguous switch specified", /* 685, gsec_amb_switch */
"incompatible switches specified", /* 686, gsec_incompat_switch */ "no operation specified for parameters", /* 686, gsec_no_op_specified */
"Invalid user name (maximum 31 bytes allowed)", /* 687, gsec_inv_username */ "no parameters allowed for this operation", /* 687, gsec_params_not_allowed */
"Warning - maximum 8 significant bytes of password used", /* 688, gsec_inv_pw_length */ "incompatible switches specified", /* 688, gsec_incompat_switch */
"database already specified", /* 689, gsec_db_specified */ "Invalid user name (maximum 31 bytes allowed)", /* 689, gsec_inv_username */
"database administrator name already specified", /* 690, gsec_db_admin_specified */ "Warning - maximum 8 significant bytes of password used", /* 690, gsec_inv_pw_length */
"database administrator password already specified", /* 691, gsec_db_admin_pw_specified */ "database already specified", /* 691, gsec_db_specified */
"SQL role name already specified", /* 692, gsec_sql_role_specified */ "database administrator name already specified", /* 692, gsec_db_admin_specified */
"The license file does not exist or could not be opened for read", /* 693, license_no_file */ "database administrator password already specified", /* 693, gsec_db_admin_pw_specified */
"operation already specified", /* 694, license_op_specified */ "SQL role name already specified", /* 694, gsec_sql_role_specified */
"no operation specified", /* 695, license_op_missing */ "The license file does not exist or could not be opened for read", /* 695, license_no_file */
"invalid switch", /* 696, license_inv_switch */ "operation already specified", /* 696, license_op_specified */
"invalid switch combination", /* 697, license_inv_switch_combo */ "no operation specified", /* 697, license_op_missing */
"illegal operation/switch combination", /* 698, license_inv_op_combo */ "invalid switch", /* 698, license_inv_switch */
"ambiguous switch", /* 699, license_amb_switch */ "invalid switch combination", /* 699, license_inv_switch_combo */
"invalid parameter, no switch specified", /* 700, license_inv_parameter */ "illegal operation/switch combination", /* 700, license_inv_op_combo */
"switch does not take any parameter", /* 701, license_param_specified */ "ambiguous switch", /* 701, license_amb_switch */
"switch requires a parameter", /* 702, license_param_req */ "invalid parameter, no switch specified", /* 702, license_inv_parameter */
"syntax error in command line", /* 703, license_syntx_error */ "switch does not take any parameter", /* 703, license_param_specified */
"The certificate was not added. A duplicate ID exists in the license file.", /* 704, license_dup_id */ "switch requires a parameter", /* 704, license_param_req */
"The certificate was not added. Invalid certificate ID / Key combination.", /* 705, license_inv_id_key */ "syntax error in command line", /* 705, license_syntx_error */
"The certificate was not removed. The key does not exist or corresponds to a temporary evaluation license.", /* 706, license_err_remove */ "The certificate was not added. A duplicate ID exists in the license file.", /* 706, license_dup_id */
"An error occurred updating the license file. Operation cancelled.", /* 707, license_err_update */ "The certificate was not added. Invalid certificate ID / Key combination.", /* 707, license_inv_id_key */
"The certificate could not be validated based on the information given. Please recheck the ID and key information.", /* 708, license_err_convert */ "The certificate was not removed. The key does not exist or corresponds to a temporary evaluation license.", /* 708, license_err_remove */
"Operation failed. An unknown error occurred.", /* 709, license_err_unk */ "An error occurred updating the license file. Operation cancelled.", /* 709, license_err_update */
"Add license operation failed, KEY: %s ID: %s", /* 710, license_svc_err_add */ "The certificate could not be validated based on the information given. Please recheck the ID and key information.", /* 710, license_err_convert */
"Remove license operation failed, KEY: %s", /* 711, license_svc_err_remove */ "Operation failed. An unknown error occurred.", /* 711, license_err_unk */
"The evaluation license has already been used on this server. You need to purchase a non-evaluation license.", /* 712, license_eval_exists */ "Add license operation failed, KEY: %s ID: %s", /* 712, license_svc_err_add */
"found unknown switch", /* 713, gstat_unknown_switch */ "Remove license operation failed, KEY: %s", /* 713, license_svc_err_remove */
"please retry, giving a database name", /* 714, gstat_retry */ "The evaluation license has already been used on this server. You need to purchase a non-evaluation license.", /* 714, license_eval_exists */
"Wrong ODS version, expected %d, encountered %d", /* 715, gstat_wrong_ods */ "found unknown switch", /* 715, gstat_unknown_switch */
"Unexpected end of database file.", /* 716, gstat_unexpected_eof */ "please retry, giving a database name", /* 716, gstat_retry */
"Can't open database file %s", /* 717, gstat_open_err */ "Wrong ODS version, expected %d, encountered %d", /* 717, gstat_wrong_ods */
"Can't read a database page", /* 718, gstat_read_err */ "Unexpected end of database file.", /* 718, gstat_unexpected_eof */
"System memory exhausted", /* 719, gstat_sysmemex */ "Can't open database file %s", /* 719, gstat_open_err */
"Can't read a database page", /* 720, gstat_read_err */
"System memory exhausted", /* 721, gstat_sysmemex */
0 /* Null entry to terminate list */ 0 /* Null entry to terminate list */
}; };

View File

@ -738,4 +738,6 @@ static SLONG user_codes[] = {
0, 0,
0, 0,
0, 0,
0,
0,
}; };

View File

@ -536,6 +536,8 @@ static const SSHORT gds__sql_code [] = {
-901 /* 515 bad_shutdown_mode */, -901 /* 515 bad_shutdown_mode */,
-802 /* 516 concat_overflow */, -802 /* 516 concat_overflow */,
-204 /* 517 bad_substring_param */, -204 /* 517 bad_substring_param */,
-530 /* 518 foreign_key_target_doesnt_exist */,
-530 /* 519 foreign_key_references_present */,
-901 /* 1 gfix_db_name */, -901 /* 1 gfix_db_name */,
-901 /* 2 gfix_invalid_sw */, -901 /* 2 gfix_invalid_sw */,
-901 /* 4 gfix_incmp_sw */, -901 /* 4 gfix_incmp_sw */,

View File

@ -203,10 +203,16 @@ void ERR_duplicate_error(IDX_E code,
ERR_punt(); ERR_punt();
break; break;
case idx_e_foreign: case idx_e_foreign_target_doesnt_exist:
ERR_post(isc_foreign_key, ERR_post(isc_foreign_key, isc_arg_string, ERR_cstring(constraint_name),
isc_arg_string, ERR_cstring(constraint_name), isc_arg_string, relation->rel_name,
isc_arg_string, relation->rel_name, 0); isc_arg_gds, isc_foreign_key_target_doesnt_exist, 0);
break;
case idx_e_foreign_references_present:
ERR_post(isc_foreign_key, isc_arg_string, ERR_cstring(constraint_name),
isc_arg_string, relation->rel_name,
isc_arg_gds, isc_foreign_key_references_present, 0);
break; break;
default: default:

View File

@ -37,7 +37,8 @@ enum idx_e {
idx_e_duplicate, idx_e_duplicate,
idx_e_keytoobig, idx_e_keytoobig,
idx_e_conversion, idx_e_conversion,
idx_e_foreign idx_e_foreign_target_doesnt_exist,
idx_e_foreign_references_present
}; };
typedef idx_e IDX_E; typedef idx_e IDX_E;

View File

@ -1130,13 +1130,13 @@ static IDX_E check_partner_index(
result = result =
check_duplicates(tdbb, record, idx, &insertion, relation); check_duplicates(tdbb, record, idx, &insertion, relation);
if (idx->idx_flags & (idx_primary | idx_unique)) if (idx->idx_flags & (idx_primary | idx_unique))
result = result ? idx_e_foreign : idx_e_ok; result = result ? idx_e_foreign_references_present : idx_e_ok;
if (idx->idx_flags & idx_foreign) if (idx->idx_flags & idx_foreign)
result = result ? idx_e_ok : idx_e_foreign; result = result ? idx_e_ok : idx_e_foreign_target_doesnt_exist;
SBM_release(bitmap); SBM_release(bitmap);
} }
else if (idx->idx_flags & idx_foreign) { else if (idx->idx_flags & idx_foreign) {
result = idx_e_foreign; result = idx_e_foreign_target_doesnt_exist;
} }
} }

View File

@ -1,6 +1,6 @@
CONNECT "msg.fdb"; CONNECT "msg.fdb";
INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('2004-02-24 01:05:00', 'JRD', 0, 516); INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('2004-08-28 16:14:00', 'JRD', 0, 519);
INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('1996-11-07 13:38:37', 'QLI', 1, 509); INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('1996-11-07 13:38:37', 'QLI', 1, 509);
INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('1996-11-07 13:38:37', 'GDEF', 2, 345); INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('1996-11-07 13:38:37', 'GDEF', 2, 345);
INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('2004-04-02 21:18:26', 'GFIX', 3, 114); INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('2004-04-02 21:18:26', 'GFIX', 3, 114);

View File

@ -3173,5 +3173,7 @@ INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FL
INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('concat_overflow', NULL, 'evl.cpp', NULL, 0, 516, NULL, 'Concatenation overflow. Resulting string cannot exceed 32K in length.', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('concat_overflow', NULL, 'evl.cpp', NULL, 0, 516, NULL, 'Concatenation overflow. Resulting string cannot exceed 32K in length.', NULL, NULL);
INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('bad_substring_param', NULL, 'evl.cpp', NULL, 0, 517, NULL, 'Invalid %s parameter to SUBSTRING. Only positive integers are allowed.', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('bad_substring_param', NULL, 'evl.cpp', NULL, 0, 517, NULL, 'Invalid %s parameter to SUBSTRING. Only positive integers are allowed.', NULL, NULL);
INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('HLP_SETPLANONLY', 'help', 'isql.epp', NULL, 17, 109, NULL, ' SET HEADING -- toggle display of query column titles', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('HLP_SETPLANONLY', 'help', 'isql.epp', NULL, 17, 109, NULL, ' SET HEADING -- toggle display of query column titles', NULL, NULL);
INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('foreign_key_target_doesnt_exist', 'check_partner_index', 'IDX.C', NULL, 0, 518, NULL, 'Foreign key reference target does not exist', NULL, NULL);
INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('foreign_key_references_present', 'check_partner_index', 'IDX.C', NULL, 0, 519, NULL, 'Foreign key references are present for the record', NULL, NULL);
COMMIT WORK; COMMIT WORK;

View File

@ -720,5 +720,7 @@ INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, NUMBER, FAC_CODE,
INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, NUMBER, FAC_CODE, VMS_CODE, GDS_SYMBOL, SEVERITY, SEVERITY_TEXT) VALUES (-901, NULL, NULL, 515, 0, NULL, 'bad_shutdown_mode', NULL, NULL); INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, NUMBER, FAC_CODE, VMS_CODE, GDS_SYMBOL, SEVERITY, SEVERITY_TEXT) VALUES (-901, NULL, NULL, 515, 0, NULL, 'bad_shutdown_mode', NULL, NULL);
INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, NUMBER, FAC_CODE, VMS_CODE, GDS_SYMBOL, SEVERITY, SEVERITY_TEXT) VALUES (-802, NULL, NULL, 516, 0, NULL, 'concat_overflow', NULL, NULL); INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, NUMBER, FAC_CODE, VMS_CODE, GDS_SYMBOL, SEVERITY, SEVERITY_TEXT) VALUES (-802, NULL, NULL, 516, 0, NULL, 'concat_overflow', NULL, NULL);
INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, NUMBER, FAC_CODE, VMS_CODE, GDS_SYMBOL, SEVERITY, SEVERITY_TEXT) VALUES (-204, NULL, NULL, 517, 0, NULL, 'bad_substring_param', NULL, NULL); INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, NUMBER, FAC_CODE, VMS_CODE, GDS_SYMBOL, SEVERITY, SEVERITY_TEXT) VALUES (-204, NULL, NULL, 517, 0, NULL, 'bad_substring_param', NULL, NULL);
INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, NUMBER, FAC_CODE, VMS_CODE, GDS_SYMBOL, SEVERITY, SEVERITY_TEXT) VALUES (-530, NULL, NULL, 518, 0, NULL, 'foreign_key_target_doesnt_exist', NULL, NULL);
INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, NUMBER, FAC_CODE, VMS_CODE, GDS_SYMBOL, SEVERITY, SEVERITY_TEXT) VALUES (-530, NULL, NULL, 519, 0, NULL, 'foreign_key_references_present', NULL, NULL);
COMMIT WORK; COMMIT WORK;