COMPILATION LISTING OF SEGMENT rmdb_rq_delete_index Compiled by: Multics PL/I Compiler, Release 29, of July 28, 1986 Compiled at: Honeywell Multics Op. - System M Compiled on: 10/16/86 1349.2 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* *********************************************************** */ 6 rmdb_rq_delete_index: proc (sci_ptr, info_ptr); 7 8 /* 9* . BEGIN_DESCRIPTION 10* This procedure implements the delete_index request of the 11* restructure_mrds_db subsystem. It verifies that the correct 12* number of arguments have been supplied and that a data base has 13* been readied for restructuring. It does not verify that the 14* arguments supplied are actually a relation and attribute in the 15* database, that is left to the rmdb_delete_index procedure which 16* is called to do the actual index deletion. 17* 18* If the database is inconsistent rmdb_execute_undo is called to 19* query the user and execute the request. 20* . END_DESCRIPTION 21* 22* . BEGIN_INFO 23* .05/20/82 delete_index, dli 24* . 25* .Syntax: dli relation_name attribute_name {-control_args} 26* . 27* . 28* .Function: Removes the secondary index for the attribute in the 29* . relation. 30* . 31* . 32* .Arguments: 33* . 34* .relation_name 35* . Name of the relation to be restructured. 36* . 37* .attribute_name 38* . Name of the attribute whose secondary index is to be deleted. 39* . 40* . 41* .Control Arguments: 42* . 43* .brief, fc 44* . Will suppress error reporting if the attribute is not already a 45* . secondary index. 46* . 47* .long, lg 48* . Will report an error if the attribute is not already a secondary 49* . index 50* . 51* . 52* .Notes: 53* . 54* . This request may be run only against a consistent database. If the 55* . database is inconsistent the user will be queried to see if he 56* . wishes to execute the "undo request", this request will make the 57* . database consistent. After the undo request has been executed the 58* . requested index will be deleted. If the undo request fails the user 59* . will be returned to rmdb request level - the index will not be 60* . deleted, in addition the database will be freed. 61* . END_INFO 62* 63* Known Bugs: 64* 65* Other Problems: 66* 67* . HISTORY 68* 82-05-17 Davids: Written 69* 70* 82-05-26 Davids: Added call to rmdb_execute_undo for inconsistent 71* . database and added rmdb_ctl.db_model.ptr to the 72* . calling sequence of rmdb_delete_index. 73* 74* 82-07-01 Roger Lackey : Modified the calls to mu_db_inconsistent to use 75* mdbm_util_$inconsistent_* for binding. 76**/ 77 78 /* PARAMETERS */ 79 80 dcl sci_ptr ptr; /* (input) pointer to the subsystem control info structure */ 81 /* need to be able to pass it to the ssu routines */ 82 dcl info_ptr ptr; /* (input) pointer to the rmdb_ctl structure which is */ 83 /* read only */ 84 85 /* EXTERNAL STATIC */ 86 87 dcl error_table_$action_not_performed fixed bin (35) external static; 88 dcl error_table_$badcall fixed bin (35) external static; 89 90 /* ENTRIES */ 91 92 dcl mdbm_util_$inconsistent_get_info entry (ptr, bit (1), char (*), char (*), char (*)); 93 dcl mdbm_util_$inconsistent_reset entry (ptr); 94 dcl ssu_$abort_line entry options (variable); 95 dcl ssu_$arg_count entry (ptr, fixed bin); 96 dcl ssu_$arg_ptr entry (ptr, fixed bin, ptr, fixed bin (21)); 97 dcl ssu_$print_message entry () options (variable); 98 dcl rmdb_delete_index entry (ptr, char (168), ptr, char (*), char (*), bit (1), char (500), fixed bin (35)); 99 dcl rmdb_execute_undo entry (ptr, char (32), char (168), ptr, char (32), char (100)); 100 101 /* INTERNAL AUTOMATIC */ 102 103 dcl attr_name_len fixed bin (21); /* length of the attribute name argument */ 104 dcl attr_name_ptr ptr; /* pointer to the attribute name argument */ 105 106 dcl code fixed bin (35); /* standard error code */ 107 108 dcl ctl_arg_error bit (1); /* true ==> at least one of the control arguments was in error */ 109 dcl ctl_arg_len fixed bin (21); /* length of a control argument */ 110 dcl ctl_arg_ptr ptr; /* pointer to a control argument */ 111 112 dcl error_message char (500); /* error message returned from rmdb_delete_index */ 113 114 dcl brief_flag bit (1); /* true ==> last control arg had value of -fc or -brief */ 115 116 dcl i fixed bin; /* loop counter for control argument processing */ 117 118 dcl incon_value bit (1); /* true ==> database is inconsistent */ 119 dcl incon_name char (32); /* name of request that caused the db to become inconsistent */ 120 121 dcl nargs fixed bin; /* number of arguments the request was called with */ 122 123 dcl rel_name_len fixed bin (21); /* length of the relation name argument */ 124 dcl rel_name_ptr ptr; /* pointer to the relation name argument */ 125 126 dcl rest_of_undo_request char (100); /* copy of undo request with request, rel, attr names removed */ 127 128 dcl this_is_the_undo_request bit (1); /* true ==> the user typed in the undo request */ 129 130 dcl undo_attr_name char (32) varying; /* name of the attribute in the undo request */ 131 dcl undo_rel_name char (32) varying; /* name of the relation in the undo request */ 132 dcl undo_request char (100); /* rmdb request that will make the db consistent again */ 133 dcl undo_request_name char (32) varying; /* name of the undo request */ 134 135 dcl unused1 char (200); /* unused output parameter from mdbm_util_$inconsistent_get_info */ 136 137 /* BASED */ 138 139 dcl attr_name char (attr_name_len) based (attr_name_ptr); /* name of attribute to be indexed */ 140 dcl ctl_arg char (ctl_arg_len) based (ctl_arg_ptr); /* control argument */ 141 dcl rel_name char (rel_name_len) based (rel_name_ptr); /* name of relation which contains the attribute */ 142 143 /* BUILTINS */ 144 145 dcl after builtin; 146 dcl before builtin; 147 148 /* INCLUDES */ 149 1 1 /* BEGIN - mrds_rmdb_ctl.incl.pl1 */ 1 2 1 3 1 4 1 5 /****^ HISTORY COMMENTS: 1 6* 1) change(82-03-26,Davids), approve(), audit(), install(): 1 7* created 1 8* 2) change(82-05-26,Davids), approve(), audit(), install(): 1 9* added db_model_ptr 1 10* 3) change(82-06-09,Harvey), approve(), audit(), install(): 1 11* deleted ssu_ routines ptr storage 1 12* 4) change(82-08-20,Davids), approve(), audit(), install(): 1 13* added the relmgr like reference and included the rmdb_relmgr_entries 1 14* include file 1 15* 5) change(83-05-24,Davids), approve(), audit(), install(): 1 16* added the saved_res_version_ptr element 1 17* 6) change(84-10-23,Benjamin), approve(), audit(), install(): 1 18* added flags (just database_readied_by_rmdb for now). 1 19* 7) change(85-11-08,Spitzer), approve(85-11-08,MCR7311), 1 20* audit(86-09-02,Blair), install(86-10-16,MR12.0-1187): 1 21* added crossref_file_info. 1 22* END HISTORY COMMENTS */ 1 23 1 24 1 25 dcl 01 rmdb_ctl based (rmdb_ctl_ptr), 1 26 02 version fixed bin, 1 27 02 rmdb_version char (16) varying, 1 28 02 absolute_db_path char (168), 1 29 02 temp_dir_path char (168), 1 30 02 work_area_ptr ptr, 1 31 02 db_model_ptr ptr, 1 32 02 saved_res_version_ptr ptr, 1 33 02 crossref_file_info, 1 34 03 iocb_ptr ptr, 1 35 03 name char (32), 1 36 02 relmgr_entries like rmdb_relmgr_entries, 1 37 02 flags, 1 38 03 database_readied_by_rmdb bit (1) unal, 1 39 03 unused bit (35) unal; 1 40 1 41 dcl RMDB_CTL_VERSION_1 fixed bin init (1) internal static options (constant); 1 42 1 43 dcl rmdb_ctl_ptr ptr; 1 44 1 45 2 1 /* START OF: rmdb_relmgr_entries.incl.pl1 * * * * * * * * * * * * * * * * */ 2 2 2 3 2 4 /****^ HISTORY COMMENTS: 2 5* 1) change(82-08-20,Davids), approve(), audit(), install(): 2 6* written 2 7* 2) change(86-01-28,Spitzer), approve(86-01-28,MCR7311), 2 8* audit(86-09-15,Gilcrease), install(86-10-16,MR12.0-1187): 2 9* add get_tuples_by_spec, put_tuple, put_tuples, create_cursor entry points. 2 10* 3) change(86-08-21,Blair), approve(86-08-21,MCR7311), 2 11* audit(86-09-15,Gilcrease), install(86-10-16,MR12.0-1187): 2 12* Back out the entries get_tuples_by_spec and put_tuples since they aren't 2 13* sufficiently well tested to be reliable. Replace with get_tuple_id and 2 14* get_tuple_by_id. 2 15* END HISTORY COMMENTS */ 2 16 2 17 2 18 dcl 01 rmdb_relmgr_entries based (rmdb_relmgr_entries_ptr), 2 19 02 create_relation entry (char (*), char (*), ptr, ptr, bit (36) aligned, 2 20 bit (36) aligned, fixed bin (35)), 2 21 02 delete_relation entry (char (*), char (*), fixed bin (35)), 2 22 02 open entry (char (*), char (*), bit (36) aligned, fixed bin (35)), 2 23 02 close entry (bit (36) aligned, fixed bin (35)), 2 24 02 create_index entry (bit (36) aligned, ptr, bit (36) aligned, fixed bin (17), 2 25 bit (36) aligned, fixed bin (35)), 2 26 02 delete_index entry (bit (36) aligned, bit (36) aligned, fixed bin (35)), 2 27 02 put_tuple entry (ptr, ptr, bit (36) aligned, fixed bin (35)), 2 28 02 get_tuple_id entry (ptr, ptr, ptr, ptr, fixed bin (35)), 2 29 02 get_tuple_by_id entry (ptr, bit (36) aligned, ptr, ptr, ptr, fixed bin (35)), 2 30 02 create_cursor entry (bit (36) aligned, ptr, ptr, fixed bin (35)); 2 31 2 32 dcl rmdb_relmgr_entries_ptr ptr; 2 33 2 34 /* END OF: rmdb_relmgr_entries.incl.pl1 * * * * * * * * * * * * * * * * */ 1 46 1 47 1 48 1 49 /* END - mrds_rmdb_ctl.incl.pl1 */ 150 151 152 /* 153* Assign initial values 154**/ 155 156 rmdb_ctl_ptr = info_ptr; 157 brief_flag = "0"b; 158 ctl_arg_error = "0"b; 159 this_is_the_undo_request = "0"b; 160 161 162 163 164 /* 165* Determine the number of arguments that this request was called 166* with. At least two arguments are required, the relation name and the 167* attribute name there may also be any number of control arguments 168* which may be either brief or long. 169* 170* If at least two arguments are not supplied issue an error. Note 171* that abort line does not return. 172**/ 173 174 call ssu_$arg_count (sci_ptr, nargs); 175 if nargs < 2 176 then call ssu_$abort_line (sci_ptr, error_table_$badcall, 177 "^/Usage:^/^-delete_index relation_name attribute_name {-brief | -long}^/"); 178 179 180 181 182 183 /* 184* If the absolute_db_path element of the rmdb_ctl structure is null 185* it means that no data base is currently readied for 186* restructuring. This is an error. 187**/ 188 189 if rmdb_ctl.absolute_db_path = "" 190 then call ssu_$abort_line (sci_ptr, error_table_$action_not_performed, 191 "^/There is no currently readied database"); 192 193 /* 194* Get the relation and attribute name arguments and the control 195* arguments. All control arguments will be looked at, any that are 196* in error will be reported. If an incorrect control arg is found 197* then the request will be aborted (along with any other requests 198* on the command line) after all the control arguments have been 199* looked at. 200**/ 201 202 call ssu_$arg_ptr (sci_ptr, 1, rel_name_ptr, rel_name_len); 203 call ssu_$arg_ptr (sci_ptr, 2, attr_name_ptr, attr_name_len); 204 205 do i = 3 to nargs; 206 call ssu_$arg_ptr (sci_ptr, i, ctl_arg_ptr, ctl_arg_len); 207 if ctl_arg = "-brief" | ctl_arg = "-bf" 208 then brief_flag = "1"b; 209 else 210 if ctl_arg = "-long" | ctl_arg = "-lg" 211 then brief_flag = "0"b; 212 else do; 213 ctl_arg_error = "1"b; 214 call ssu_$print_message (sci_ptr, error_table_$badcall, 215 "^/Argument ^i (^a) is not a legal control argument^/", 216 i, ctl_arg); 217 end; 218 end; 219 220 if ctl_arg_error 221 then call ssu_$abort_line (sci_ptr, 0); 222 223 /* 224* If the database is inconsistent then only the undo request may be 225* executed. Since it is possible that the user typed in the undo 226* request himself it must be parsed and compared with what the user 227* typed in. If the two are different rmdb_execute_undo is called to 228* query the user and execute the request. If the user typed in the 229* request himself it will be executed and then the database will be 230* marked as consistent. Note that if rmdb_execute_undo returns then 231* the database is consistent and the index deletion can take place. 232**/ 233 234 call mdbm_util_$inconsistent_get_info (rmdb_ctl.db_model_ptr, incon_value, incon_name, unused1, undo_request); 235 if incon_value 236 then do; 237 undo_request_name = before (undo_request, " "); 238 rest_of_undo_request = after (undo_request, " "); 239 undo_rel_name = before (rest_of_undo_request, " "); 240 rest_of_undo_request = after (rest_of_undo_request, " "); 241 undo_attr_name = before (rest_of_undo_request, " "); 242 if undo_request_name = "delete_index" & 243 undo_rel_name = rel_name & 244 undo_attr_name = attr_name 245 then this_is_the_undo_request = "1"b; 246 else call rmdb_execute_undo (sci_ptr, "delete_index", rmdb_ctl.absolute_db_path, 247 rmdb_ctl.db_model_ptr, incon_name, undo_request); 248 end; 249 250 251 252 253 254 /* 255* Do the actual index creation 256**/ 257 258 call rmdb_delete_index (rmdb_ctl_ptr, rmdb_ctl.absolute_db_path, rmdb_ctl.db_model_ptr, rel_name, attr_name, brief_flag, 259 error_message, code); 260 if code ^= 0 261 then call ssu_$abort_line (sci_ptr, code, error_message); 262 263 264 265 266 267 268 269 270 271 /* 272* If we are executing the undo request directly the database must 273* now be marked as consistent. 274**/ 275 276 if this_is_the_undo_request 277 then call mdbm_util_$inconsistent_reset (rmdb_ctl.db_model_ptr); 278 279 280 281 282 283 284 return; 285 286 287 end rmdb_rq_delete_index; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 10/16/86 1144.3 rmdb_rq_delete_index.pl1 >special_ldd>install>MR12.0-1187>rmdb_rq_delete_index.pl1 150 1 10/16/86 1139.6 mrds_rmdb_ctl.incl.pl1 >special_ldd>install>MR12.0-1187>mrds_rmdb_ctl.incl.pl1 1-46 2 10/16/86 1140.2 rmdb_relmgr_entries.incl.pl1 >special_ldd>install>MR12.0-1187>rmdb_relmgr_entries.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. absolute_db_path 6 based char(168) level 2 packed unaligned dcl 1-25 set ref 189 246* 258* after builtin function dcl 145 ref 238 240 attr_name based char unaligned dcl 139 set ref 242 258* attr_name_len 000100 automatic fixed bin(21,0) dcl 103 set ref 203* 242 258 258 attr_name_ptr 000102 automatic pointer dcl 104 set ref 203* 242 258 before builtin function dcl 146 ref 237 239 241 brief_flag 000307 automatic bit(1) unaligned dcl 114 set ref 157* 207* 209* 258* code 000104 automatic fixed bin(35,0) dcl 106 set ref 258* 260 260* ctl_arg based char unaligned dcl 140 set ref 207 207 209 209 214* ctl_arg_error 000105 automatic bit(1) unaligned dcl 108 set ref 158* 213* 220 ctl_arg_len 000106 automatic fixed bin(21,0) dcl 109 set ref 206* 207 207 209 209 214 214 ctl_arg_ptr 000110 automatic pointer dcl 110 set ref 206* 207 207 209 209 214 db_model_ptr 134 based pointer level 2 dcl 1-25 set ref 234* 246* 258* 276* error_message 000112 automatic char(500) unaligned dcl 112 set ref 258* 260* error_table_$action_not_performed 000010 external static fixed bin(35,0) dcl 87 set ref 189* error_table_$badcall 000012 external static fixed bin(35,0) dcl 88 set ref 175* 214* i 000310 automatic fixed bin(17,0) dcl 116 set ref 205* 206* 214* incon_name 000312 automatic char(32) unaligned dcl 119 set ref 234* 246* incon_value 000311 automatic bit(1) unaligned dcl 118 set ref 234* 235 info_ptr parameter pointer dcl 82 ref 6 156 mdbm_util_$inconsistent_get_info 000014 constant entry external dcl 92 ref 234 mdbm_util_$inconsistent_reset 000016 constant entry external dcl 93 ref 276 nargs 000322 automatic fixed bin(17,0) dcl 121 set ref 174* 175 205 rel_name based char unaligned dcl 141 set ref 242 258* rel_name_len 000323 automatic fixed bin(21,0) dcl 123 set ref 202* 242 258 258 rel_name_ptr 000324 automatic pointer dcl 124 set ref 202* 242 258 rest_of_undo_request 000326 automatic char(100) unaligned dcl 126 set ref 238* 239 240* 240 241 rmdb_ctl based structure level 1 unaligned dcl 1-25 rmdb_ctl_ptr 000526 automatic pointer dcl 1-43 set ref 156* 189 234 246 246 258* 258 258 276 rmdb_delete_index 000030 constant entry external dcl 98 ref 258 rmdb_execute_undo 000032 constant entry external dcl 99 ref 246 rmdb_relmgr_entries based structure level 1 unaligned dcl 2-18 sci_ptr parameter pointer dcl 80 set ref 6 174* 175* 189* 202* 203* 206* 214* 220* 246* 260* ssu_$abort_line 000020 constant entry external dcl 94 ref 175 189 220 260 ssu_$arg_count 000022 constant entry external dcl 95 ref 174 ssu_$arg_ptr 000024 constant entry external dcl 96 ref 202 203 206 ssu_$print_message 000026 constant entry external dcl 97 ref 214 this_is_the_undo_request 000357 automatic bit(1) unaligned dcl 128 set ref 159* 242* 276 undo_attr_name 000360 automatic varying char(32) dcl 130 set ref 241* 242 undo_rel_name 000371 automatic varying char(32) dcl 131 set ref 239* 242 undo_request 000402 automatic char(100) unaligned dcl 132 set ref 234* 237 238 246* undo_request_name 000433 automatic varying char(32) dcl 133 set ref 237* 242 unused1 000444 automatic char(200) unaligned dcl 135 set ref 234* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. RMDB_CTL_VERSION_1 internal static fixed bin(17,0) initial dcl 1-41 rmdb_relmgr_entries_ptr automatic pointer dcl 2-32 NAME DECLARED BY EXPLICIT CONTEXT. rmdb_rq_delete_index 000104 constant entry external dcl 6 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1110 1144 740 1120 Length 1404 740 34 223 147 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME rmdb_rq_delete_index 442 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME rmdb_rq_delete_index 000100 attr_name_len rmdb_rq_delete_index 000102 attr_name_ptr rmdb_rq_delete_index 000104 code rmdb_rq_delete_index 000105 ctl_arg_error rmdb_rq_delete_index 000106 ctl_arg_len rmdb_rq_delete_index 000110 ctl_arg_ptr rmdb_rq_delete_index 000112 error_message rmdb_rq_delete_index 000307 brief_flag rmdb_rq_delete_index 000310 i rmdb_rq_delete_index 000311 incon_value rmdb_rq_delete_index 000312 incon_name rmdb_rq_delete_index 000322 nargs rmdb_rq_delete_index 000323 rel_name_len rmdb_rq_delete_index 000324 rel_name_ptr rmdb_rq_delete_index 000326 rest_of_undo_request rmdb_rq_delete_index 000357 this_is_the_undo_request rmdb_rq_delete_index 000360 undo_attr_name rmdb_rq_delete_index 000371 undo_rel_name rmdb_rq_delete_index 000402 undo_request rmdb_rq_delete_index 000433 undo_request_name rmdb_rq_delete_index 000444 unused1 rmdb_rq_delete_index 000526 rmdb_ctl_ptr rmdb_rq_delete_index THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return_mac ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. mdbm_util_$inconsistent_get_info mdbm_util_$inconsistent_reset rmdb_delete_index rmdb_execute_undo ssu_$abort_line ssu_$arg_count ssu_$arg_ptr ssu_$print_message THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$action_not_performed error_table_$badcall LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 6 000100 156 000111 157 000115 158 000116 159 000117 174 000120 175 000130 189 000160 202 000212 203 000232 205 000252 206 000261 207 000277 209 000314 213 000327 214 000331 218 000371 220 000373 234 000414 235 000446 237 000451 238 000465 239 000503 240 000517 241 000535 242 000551 246 000577 258 000625 260 000700 276 000724 284 000736 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved