From 8c381ef54bb114e9cbef9d02753f6e4947759bd6 Mon Sep 17 00:00:00 2001 From: robocop Date: Tue, 3 May 2005 04:09:26 +0000 Subject: [PATCH] Better fixes related to field-test bug #1173988, first part. Also, a new, more accurate message has been added to the restoration process. --- src/burp/restore.epp | 54 +++++++++++++++++++++++------------------ src/msgs/facilities.sql | 2 +- src/msgs/messages.sql | 2 ++ 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/src/burp/restore.epp b/src/burp/restore.epp index 6ee6645c7b..742aaa97c4 100644 --- a/src/burp/restore.epp +++ b/src/burp/restore.epp @@ -277,30 +277,30 @@ int RESTORE_restore (const TEXT* file_name, strcpy(index_name, (TEXT *)tdgbl->status_vector[3]); BURP_print_status(tdgbl->status_vector); FOR (REQUEST_HANDLE req_handle3) - IDX IN RDB$INDICES WITH IDX.RDB$INDEX_NAME EQ index_name - { + IDX IN RDB$INDICES WITH IDX.RDB$INDEX_NAME EQ index_name + BURP_verbose(243, index_name, NULL, NULL, NULL, NULL); - MODIFY IDX USING IDX.RDB$INDEX_INACTIVE = TRUE; - } + MODIFY IDX USING + IDX.RDB$INDEX_INACTIVE = TRUE; + END_MODIFY; BURP_print(240, index_name, NULL, NULL, NULL, NULL); - // msg 240 Index \"%s\" failed to activate because: + // msg 240 Index \"%s\" failed to activate because: if ( error_code == isc_no_dup ) { BURP_print(241, NULL, NULL, NULL, NULL, NULL); - // msg 241 The unique index has duplicate values or NULLs + // msg 241 The unique index has duplicate values or NULLs BURP_print(242, NULL, NULL, NULL, NULL, NULL); - // msg 242 Delete or Update duplicate values or NULLs, and activate index with + // msg 242 Delete or Update duplicate values or NULLs, and activate index with } else { BURP_print(244, NULL, NULL, NULL, NULL, NULL); - // msg 244 Not enough disk space to create the sort file for an index + // msg 244 Not enough disk space to create the sort file for an index BURP_print(245, NULL, NULL, NULL, NULL, NULL); - // msg 245 Set the TMP environment variable to a directory on a filesystem that does have enough space, and activate index with + // msg 245 Set the TMP environment variable to a directory on a filesystem that does have enough space, and activate index with } BURP_print(243, index_name, NULL, NULL, NULL, NULL); - /* msg 243 ALTER INDEX \"%s\" ACTIVE; */ - END_MODIFY; + // msg 243 ALTER INDEX \"%s\" ACTIVE; END_FOR; // don't bring the database on-line flag_on_line = false; @@ -330,7 +330,12 @@ int RESTORE_restore (const TEXT* file_name, FOR (REQUEST_HANDLE req_handle1) IDS IN RDB$INDICES WITH IDS.RDB$INDEX_INACTIVE EQ DEFERRED_ACTIVE AND IDS.RDB$FOREIGN_KEY MISSING - MODIFY IDS USING IDS.RDB$INDEX_INACTIVE = FALSE; + + MISC_terminate(IDS.RDB$INDEX_NAME, index_name, + (ULONG) MISC_symbol_length(IDS.RDB$INDEX_NAME, sizeof(IDS.RDB$INDEX_NAME)), + sizeof(index_name)); + MODIFY IDS USING + IDS.RDB$INDEX_INACTIVE = FALSE; END_MODIFY; ON_ERROR general_on_error(); @@ -339,7 +344,7 @@ int RESTORE_restore (const TEXT* file_name, SAVE // existing ON_ERROR continues past error, beck ON_ERROR - BURP_print (173, IDS.RDB$INDEX_NAME, NULL, NULL, NULL, NULL); + BURP_print (173, index_name, NULL, NULL, NULL, NULL); BURP_print_status(isc_status); MODIFY IDS USING IDS.RDB$INDEX_INACTIVE = TRUE; @@ -348,10 +353,8 @@ int RESTORE_restore (const TEXT* file_name, general_on_error (); END_ERROR; END_ERROR; - MISC_terminate(IDS.RDB$INDEX_NAME, index_name, - (ULONG) MISC_symbol_length(IDS.RDB$INDEX_NAME, sizeof(IDS.RDB$INDEX_NAME)), - sizeof(index_name)); - BURP_verbose(122, index_name, NULL, NULL, NULL, NULL); + BURP_verbose(285, index_name, NULL, NULL, NULL, NULL); + // activating and creating deferred index %s END_FOR; ON_ERROR general_on_error (); @@ -379,9 +382,11 @@ int RESTORE_restore (const TEXT* file_name, CNST.RDB$INDEX_NAME EQ IDS.RDB$INDEX_NAME AND IDS.RDB$INDEX_INACTIVE EQ DEFERRED_ACTIVE - + MISC_terminate(IDS.RDB$INDEX_NAME, index_name, + (ULONG) MISC_symbol_length(IDS.RDB$INDEX_NAME, sizeof(IDS.RDB$INDEX_NAME)), + sizeof(index_name)); MODIFY IDS USING - IDS.RDB$INDEX_INACTIVE = FALSE; + IDS.RDB$INDEX_INACTIVE = FALSE; END_MODIFY; ON_ERROR general_on_error (); @@ -390,7 +395,7 @@ int RESTORE_restore (const TEXT* file_name, SAVE // existing ON_ERROR continues past error, beck ON_ERROR - BURP_print (173, IDS.RDB$INDEX_NAME, NULL, NULL, NULL, NULL); + BURP_print (173, index_name, NULL, NULL, NULL, NULL); BURP_print_status(isc_status); MODIFY IDS USING IDS.RDB$INDEX_INACTIVE = TRUE; @@ -399,7 +404,8 @@ int RESTORE_restore (const TEXT* file_name, general_on_error (); END_ERROR; END_ERROR; - BURP_verbose(122, IDS.RDB$INDEX_NAME, NULL, NULL, NULL, NULL); + BURP_verbose(285, index_name, NULL, NULL, NULL, NULL); + // activating and creating deferred index %s END_FOR; ON_ERROR general_on_error (); @@ -457,7 +463,7 @@ int RESTORE_restore (const TEXT* file_name, general_on_error (); END_ERROR; - restore_security_class (procedure->prc_owner, X.RDB$SECURITY_CLASS); + restore_security_class (procedure->prc_owner, X.RDB$SECURITY_CLASS); END_FOR; ON_ERROR @@ -485,8 +491,8 @@ int RESTORE_restore (const TEXT* file_name, general_on_error (); END_ERROR; - restore_security_class (relation->rel_owner, X.RDB$SECURITY_CLASS); - restore_security_class (relation->rel_owner, X.RDB$DEFAULT_CLASS); + restore_security_class (relation->rel_owner, X.RDB$SECURITY_CLASS); + restore_security_class (relation->rel_owner, X.RDB$DEFAULT_CLASS); END_FOR; ON_ERROR diff --git a/src/msgs/facilities.sql b/src/msgs/facilities.sql index 050cda7bcd..d5ddd156ae 100644 --- a/src/msgs/facilities.sql +++ b/src/msgs/facilities.sql @@ -14,7 +14,7 @@ INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('19 */ INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('1996-11-07 13:39:40', 'INSTALL', 10, 1); INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('1996-11-07 13:38:41', 'TEST', 11, 4); -INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('2005-04-29 00:47:30', 'GBAK', 12, 285); +INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('2005-05-01 22:37:35', 'GBAK', 12, 286); INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('2005-04-27 14:20:40', 'SQLERR', 13, 917); INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('1996-11-07 13:38:42', 'SQLWARN', 14, 102); INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('2002-03-05 02:29:03', 'JRD_BUGCHK', 15, 305); diff --git a/src/msgs/messages.sql b/src/msgs/messages.sql index c360a0e84d..14dff4d8da 100644 --- a/src/msgs/messages.sql +++ b/src/msgs/messages.sql @@ -2952,5 +2952,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 ('TIME_PROMPT', 'add_row', 'isql.epp', NULL, 17, 112, NULL, 'Enter %s as H:M:S>', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('TIMESTAMP_PROMPT', 'add_row', 'isql.epp', NULL, 17, 113, NULL, 'Enter %s as Y/MON/D H:MIN:S[.MSEC]>', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('TIME_ERR', 'add_row()', 'isql.epp', NULL, 17, 114, NULL, 'Bad TIMESTAMP: %s', NULL, NULL); +INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('gbak_activating_idx', 'RESTORE_restore', 'restore.epp', NULL, 12, 285, NULL, ' activating and creating deferred index %s', NULL, NULL); + COMMIT WORK;