From 582d8377784e2662d08bffe94b6947529953ca92 Mon Sep 17 00:00:00 2001 From: asfernandes Date: Sat, 20 Dec 2008 23:50:22 +0000 Subject: [PATCH] Remove trailing spaces from epp files - I had forgot them --- src/alice/alice_meta.epp | 128 +++---- src/burp/backup.epp | 530 ++++++++++++++--------------- src/burp/restore.epp | 576 ++++++++++++++++---------------- src/dsql/array.epp | 36 +- src/dsql/blob.epp | 26 +- src/dudley/exe.epp | 240 ++++++------- src/dudley/extract.epp | 242 +++++++------- src/gpre/gpre_meta.epp | 272 +++++++-------- src/isql/extract.epp | 144 ++++---- src/isql/isql.epp | 370 ++++++++++---------- src/isql/show.epp | 120 +++---- src/msgs/build_file.epp | 8 +- src/msgs/change_msgs.epp | 2 +- src/msgs/check_msgs.epp | 10 +- src/msgs/enter_msgs.epp | 6 +- src/utilities/gsec/security.epp | 8 +- src/utilities/gstat/dba.epp | 68 ++-- src/utilities/stats.epp | 6 +- 18 files changed, 1396 insertions(+), 1396 deletions(-) diff --git a/src/alice/alice_meta.epp b/src/alice/alice_meta.epp index 90712b243e..3dfaa4c3cb 100644 --- a/src/alice/alice_meta.epp +++ b/src/alice/alice_meta.epp @@ -2,28 +2,28 @@ * tab=4 * *____________________________________________________________ - * + * * PROGRAM: Alice (All Else) Utility * MODULE: alice_meta.epp * DESCRIPTION: Metadata lookup routines - * + * * The contents of this file are subject to the Interbase Public * License Version 1.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy * of the License at http://www.Inprise.com/IPL.html - * + * * Software distributed under the License is distributed on an * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express * or implied. See the License for the specific language governing * rights and limitations under the License. - * + * * The Original Code was created by Inprise Corporation * and its predecessors. Portions created by Inprise Corporation are * Copyright (C) Inprise Corporation. - * + * * All Rights Reserved. * Contributor(s): ______________________________________. - * + * * *____________________________________________________________ * @@ -60,9 +60,9 @@ static void parse_fullpath(TDR); static USHORT snarf_blob(ISC_QUAD*, USHORT, TEXT*); -/* - table used to determine capabilities, checking for specific - fields in system relations +/* + table used to determine capabilities, checking for specific + fields in system relations */ struct rfr_tab_t { @@ -83,10 +83,10 @@ static inline void return_error(const ISC_STATUS* user_status) } /*____________________________________________________________ - * + * * Disable WAL for the database forcibly. * Drop all the entries from RDB$LOG_FILES - */ + */ void MET_disable_wal(ISC_STATUS* user_status, isc_db_handle handle) { @@ -96,15 +96,15 @@ void MET_disable_wal(ISC_STATUS* user_status, isc_db_handle handle) if (!(DB = handle)) return; - START_TRANSACTION - ON_ERROR - return_error(user_status); + START_TRANSACTION + ON_ERROR + return_error(user_status); END_ERROR; FOR(REQUEST_HANDLE request) X IN RDB$LOG_FILES ERASE X; - END_FOR - COMMIT + END_FOR + COMMIT ON_ERROR return_error(user_status); END_ERROR; @@ -112,11 +112,11 @@ void MET_disable_wal(ISC_STATUS* user_status, isc_db_handle handle) /*____________________________________________________________ - * + * * Get the state of a transaction, * assuming that the database has * already been attached. - */ + */ void MET_get_state(ISC_STATUS* user_status, TDR trans) { @@ -129,17 +129,17 @@ void MET_get_state(ISC_STATUS* user_status, TDR trans) return; } - START_TRANSACTION - ON_ERROR - return_error(user_status); + START_TRANSACTION + ON_ERROR + return_error(user_status); END_ERROR; FOR(REQUEST_HANDLE request) TRA IN RDB$TRANSACTIONS WITH TRA.RDB$TRANSACTION_ID = trans->tdr_id trans->tdr_state = TRA.RDB$TRANSACTION_STATE; - END_FOR - ON_ERROR + END_FOR + ON_ERROR return_error(user_status); END_ERROR; @@ -148,19 +148,19 @@ void MET_get_state(ISC_STATUS* user_status, TDR trans) return_error(user_status); } - ROLLBACK - ON_ERROR + ROLLBACK + ON_ERROR return_error(user_status); END_ERROR; } /*____________________________________________________________ - * + * * Get the description of a transaction in * limbo, including all associated transactions * in other databases. - */ + */ TDR MET_get_transaction(ISC_STATUS* user_status, isc_db_handle handle, SLONG id) { @@ -171,8 +171,8 @@ TDR MET_get_transaction(ISC_STATUS* user_status, isc_db_handle handle, SLONG id) if (!(DB = handle)) return 0; - START_TRANSACTION - ON_ERROR + START_TRANSACTION + ON_ERROR return_error(user_status); END_ERROR; @@ -184,8 +184,8 @@ TDR MET_get_transaction(ISC_STATUS* user_status, isc_db_handle handle, SLONG id) TRA.RDB$TRANSACTION_ID = id AND TRA.RDB$TRANSACTION_DESCRIPTION NOT MISSING trans = get_description(&TRA.RDB$TRANSACTION_DESCRIPTION); - END_FOR - ON_ERROR + END_FOR + ON_ERROR return_error(user_status); END_ERROR; @@ -195,9 +195,9 @@ TDR MET_get_transaction(ISC_STATUS* user_status, isc_db_handle handle, SLONG id) } } - ROLLBACK - ON_ERROR - return_error(user_status); + ROLLBACK + ON_ERROR + return_error(user_status); END_ERROR; if (trans) @@ -208,10 +208,10 @@ TDR MET_get_transaction(ISC_STATUS* user_status, isc_db_handle handle, SLONG id) /*____________________________________________________________ - * + * * Get the capabilities associated with * the database for a particular transaction. - */ + */ void MET_set_capabilities(ISC_STATUS* user_status, TDR trans) { @@ -220,24 +220,24 @@ void MET_set_capabilities(ISC_STATUS* user_status, TDR trans) if (!(DB = trans->tdr_db_handle)) return; - START_TRANSACTION - ON_ERROR + START_TRANSACTION + ON_ERROR return_error(user_status); END_ERROR; trans->tdr_db_caps = get_capabilities(user_status); - ROLLBACK - ON_ERROR + ROLLBACK + ON_ERROR return_error(user_status); END_ERROR; } /*____________________________________________________________ - * + * * Eat a string with a byte-encoded length. - */ + */ static alice_str* alloc_string(const TEXT** ptr) { @@ -262,17 +262,17 @@ static alice_str* alloc_string(const TEXT** ptr) /*____________________________________________________________ - * + * * Get the capabilities associated with * the database for a particular transaction. - */ + */ static USHORT get_capabilities(ISC_STATUS* user_status) { USHORT capabilities = CAP_none; AliceGlobals* tdgbl = AliceGlobals::getSpecific(); -// Look for desired fields in system relations +// Look for desired fields in system relations FB_API_HANDLE req = 0; for (const rfr_tab_t* rel_field_table = rfr_table; rel_field_table->relation; @@ -282,8 +282,8 @@ static USHORT get_capabilities(ISC_STATUS* user_status) WITH x.RDB$RELATION_NAME = rel_field_table->relation AND x.RDB$FIELD_NAME = rel_field_table->field capabilities |= rel_field_table->bit_mask; - END_FOR - ON_ERROR + END_FOR + ON_ERROR return_error(user_status); END_ERROR; } @@ -298,11 +298,11 @@ static USHORT get_capabilities(ISC_STATUS* user_status) /*____________________________________________________________ - * + * * Get the description of a transaction in * limbo, including all associated transactions * in other databases. - */ + */ static TDR get_description(ISC_QUAD* blob_id) { @@ -329,9 +329,9 @@ static TDR get_description(ISC_QUAD* blob_id) alice_str* host_site = NULL; alice_str* database_path = NULL; -// skip version number +// skip version number ++p; - + TDR ptr = NULL; // silence uninitialized warning SLONG id_length, id; @@ -383,16 +383,16 @@ static TDR get_description(ISC_QUAD* blob_id) /*____________________________________________________________ - * - * Take apart a full remote path specification, + * + * Take apart a full remote path specification, * finding the filename and the remote site. - */ + */ static void parse_fullpath(TDR trans) { AliceGlobals* tdgbl = AliceGlobals::getSpecific(); -// start at the end of the full pathname +// start at the end of the full pathname const TEXT* p = (TEXT*) trans->tdr_fullpath->str_data; const TEXT* const start = p; @@ -400,7 +400,7 @@ static void parse_fullpath(TDR trans) p++; const TEXT* const end = p; -// Check for a named pipes name - \\node\path\db or //node/path/db +// Check for a named pipes name - \\node\path\db or //node/path/db while (p > start && !(*p == '/' && *(p - 1) == '/') && !(*p == '\\' && *(p - 1) == '\\')) @@ -426,7 +426,7 @@ static void parse_fullpath(TDR trans) else { p = end; - /* If not named pipes, check the other protocols + /* If not named pipes, check the other protocols * work backwards until we find a remote protocol specifier */ @@ -438,11 +438,11 @@ static void parse_fullpath(TDR trans) p -= 2; trans->tdr_filename = p + 1; - // now find the last remote node in the chain + // now find the last remote node in the chain while (p > start && (*p == ':' || *p == '^' || *p == '@')) p--; - + USHORT length = 0; for (; p >= start && (*p != '^' && *p != ':' && *p != '@'); ++length) --p; @@ -460,11 +460,11 @@ static void parse_fullpath(TDR trans) /*____________________________________________________________ - * + * * Get a blob into a buffer, returning the - * size of the blob if the passed buffer + * size of the blob if the passed buffer * is not big enough. - */ + */ static USHORT snarf_blob(ISC_QUAD* blob_id, USHORT buffer_length, TEXT* buffer) @@ -483,7 +483,7 @@ static USHORT snarf_blob(ISC_QUAD* blob_id, return 0; } -// get the blob into the buffer, if it fits +// get the blob into the buffer, if it fits TEXT* ptr = buffer; const TEXT* const end = buffer + buffer_length; @@ -500,7 +500,7 @@ static USHORT snarf_blob(ISC_QUAD* blob_id, ptr += returned_length; } -// snarf failed, get length of blob for retry +// snarf failed, get length of blob for retry if (!buffer_length) { diff --git a/src/burp/backup.epp b/src/burp/backup.epp index 53fbf34c47..769366326f 100644 --- a/src/burp/backup.epp +++ b/src/burp/backup.epp @@ -26,7 +26,7 @@ * readonly databases. * 2001.11.20 Claudio Valderrama: fix problem with embedded blanks in * generators and use symbol_length effective length calculation from put_text. - * This minimizes code redundancy and fixes SF Bug #483276. + * This minimizes code redundancy and fixes SF Bug #483276. * 2001.12.15 Claudio Valderrama: copy should run through symbol_length instead * of using just another length calculation algorithm. Callers of put_text, copy * and symbol_length (if used directly) should use sizeof. Changed all callers @@ -91,7 +91,7 @@ inline void put(BurpGlobals* tdgbl, UCHAR c) else MVOL_write(c, &tdgbl->io_cnt, &tdgbl->io_ptr); } - + inline const UCHAR* put_block(BurpGlobals* tdgbl, const UCHAR* p, ULONG n) { return MVOL_write_block (tdgbl, p, n); @@ -172,13 +172,13 @@ enum backup_capabilities // Reads returns NULL and writes do nothing. #ifdef DEBUG -UCHAR debug_on = 0; // able to turn this on in debug mode +UCHAR debug_on = 0; // able to turn this on in debug mode #endif -/* - table used to determine capabilities, checking for specific - fields in system relations +/* + table used to determine capabilities, checking for specific + fields in system relations */ struct rfr_tab_t @@ -194,8 +194,8 @@ struct rfr_tab_t const rfr_tab_t rfr_table[] = { {"RDB$INDICES", "RDB$INDEX_INACTIVE", BCK_idx_inactive}, -/* Backup of V2 triggers no longer supported 1996-Aug-05 David Schnepper - {"RDB$RELATIONS", "RDB$STORE_TRIGGER", BCK_triggers}, +/* Backup of V2 triggers no longer supported 1996-Aug-05 David Schnepper + {"RDB$RELATIONS", "RDB$STORE_TRIGGER", BCK_triggers}, */ {"RDB$RELATIONS", "RDB$EXTERNAL_FILE", BCK_external}, {"RDB$SECURITY_CLASSES", "RDB$SECURITY_CLASS", BCK_security}, @@ -298,7 +298,7 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name) gds_trans = 0; BURP_verbose(130); - // msg 130 starting transaction + // msg 130 starting transaction if (tdgbl->gbl_sw_ignore_limbo) { @@ -326,12 +326,12 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name) - // decide what type of database we've got + // decide what type of database we've got set_capabilities(); - // Write burp record first with other valuable information - // In case of split operation, write a 'split' header first to all the files + // Write burp record first with other valuable information + // In case of split operation, write a 'split' header first to all the files if (tdgbl->action->act_action == ACT_backup_split) { @@ -341,7 +341,7 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name) if (MVOL_split_hdr_write() == FALSE) { BURP_error(269, true, tdgbl->action->act_file->fil_name.c_str()); - // msg 269 can't write a header record to file %s + // msg 269 can't write a header record to file %s } } tdgbl->action->act_file = tdgbl->gbl_sw_files; @@ -349,14 +349,14 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name) MVOL_init_write(dbb_file, file_name, &tdgbl->io_cnt, &tdgbl->io_ptr); - // Write database record + // Write database record write_database(dbb_file); - // Write global fields + // Write global fields BURP_verbose(150); - // msg 150 writing global fields + // msg 150 writing global fields write_global_fields(); if (tdgbl->BCK_capabilities & BCK_ods6) @@ -364,79 +364,79 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name) write_field_dimensions(); BURP_verbose(162); - // msg 162 writing shadow files + // msg 162 writing shadow files write_shadow_files(); } if (tdgbl->BCK_capabilities & BCK_ods8) { - // Write Character Sets + // Write Character Sets BURP_verbose(msgVerbose_write_charsets); write_character_sets(); - // Write Collations + // Write Collations BURP_verbose(msgVerbose_write_collations); write_collations(); } if (tdgbl->BCK_capabilities & BCK_ffmptt) { - // Write functions + // Write functions BURP_verbose(148); - // msg 148 writing functions + // msg 148 writing functions write_functions(); } - // Write relations + // Write relations BURP_verbose(154); - // msg 154 writing relations + // msg 154 writing relations write_relations(); if (tdgbl->BCK_capabilities & BCK_ffmptt) { - // Write types + // Write types BURP_verbose(161); - // msg 161 writing types + // msg 161 writing types write_types(); - // Write filters + // Write filters BURP_verbose(146); - // msg 146 writing filters + // msg 146 writing filters write_filters(); - // Write generators + // Write generators BURP_verbose(164); - // msg 164 writing id generators + // msg 164 writing id generators write_generators(); } if (tdgbl->BCK_capabilities & BCK_ods8) { - // Write procedures + // Write procedures BURP_verbose(192); - // msg 192 writing stored procedures + // msg 192 writing stored procedures write_procedures(); - // Write exceptions + // Write exceptions BURP_verbose(197); - // msg 197 writing exceptions + // msg 197 writing exceptions write_exceptions(); } - // Now go back and write all data + // Now go back and write all data for (burp_rel* relation = tdgbl->relations; relation; relation = relation->rel_next) { put(tdgbl, (UCHAR) (rec_relation_data)); PUT_TEXT(att_relation_name, relation->rel_name); put(tdgbl, (UCHAR) (att_end)); - if (!(relation->rel_flags & REL_view) && + if (!(relation->rel_flags & REL_view) && !(relation->rel_flags & REL_external)) { - + put_index(relation); if (!tdgbl->gbl_sw_meta) put_data(relation); @@ -445,18 +445,18 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name) put(tdgbl, (UCHAR) (rec_relation_end)); } - // now for the new triggers in rdb$triggers + // now for the new triggers in rdb$triggers if (tdgbl->BCK_capabilities & BCK_ffmptt) { BURP_verbose(159); - // msg 159 writing triggers + // msg 159 writing triggers write_triggers(); BURP_verbose(158); - // msg 158 writing trigger messages + // msg 158 writing trigger messages write_trigger_messages(); write_user_privileges(); } - // Last, but not least, go back and add any access control lists + // Last, but not least, go back and add any access control lists if (tdgbl->BCK_capabilities & BCK_security) { @@ -467,7 +467,7 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name) const ULONG l = PUT_TEXT (att_class_security_class, X.RDB$SECURITY_CLASS); MISC_terminate (X.RDB$SECURITY_CLASS, temp, l, sizeof(temp)); BURP_verbose (155, temp); - // msg 155 writing security class %s + // msg 155 writing security class %s put_blr_blob (att_class_acl, X.RDB$ACL); put_source_blob (att_class_description2, att_class_description, X.RDB$DESCRIPTION); @@ -482,28 +482,28 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name) if (tdgbl->BCK_capabilities & BCK_ods8) { - // Write relation constraints + // Write relation constraints BURP_verbose(206); - // msg 206 writing relation constraints + // msg 206 writing relation constraints write_rel_constraints(); - // Write referential constraints + // Write referential constraints BURP_verbose(209); - // msg 209 writing referential constraints + // msg 209 writing referential constraints write_ref_constraints(); - // Write check constraints + // Write check constraints BURP_verbose(210); - // msg 210 writing check constraints + // msg 210 writing check constraints write_check_constraints(); } if (tdgbl->BCK_capabilities & BCK_ods9) { - // Write SQL roles + // Write SQL roles BURP_verbose(248); - // msg 248 writing SQL roles + // msg 248 writing SQL roles write_sql_roles(); } @@ -511,18 +511,18 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name) { // Write names mapping BURP_verbose(296); - // msg 296 writing mapping + // msg 296 writing mapping write_mapping(); } - // Finish up + // Finish up put(tdgbl, (UCHAR) (rec_end)); - + FB_UINT64 cumul_count = MVOL_fini_write(&tdgbl->io_cnt, &tdgbl->io_ptr); BURP_verbose(176, SafeArg() << cumul_count); // msg 176 closing file, committing, and finishing. %ld bytes written - + COMMIT; ON_ERROR general_on_error(); @@ -665,10 +665,10 @@ burp_fld* get_fields( burp_rel* relation) USHORT count = 1; burp_fld* fields = NULL; -/* if we have all capabilities, use the first request to get the - most performance out of the latest engine; if we don't - have one of the capabilities we must use the second set of - requests--this requires more code but it is well worth it +/* if we have all capabilities, use the first request to get the + most performance out of the latest engine; if we don't + have one of the capabilities we must use the second set of + requests--this requires more code but it is well worth it for the performance benefits, especially remotely--deej */ if ((tdgbl->BCK_capabilities & BCK_attributes_v3) && @@ -681,7 +681,7 @@ burp_fld* get_fields( burp_rel* relation) Y IN RDB$FIELDS WITH X.RDB$FIELD_SOURCE = Y.RDB$FIELD_NAME AND X.RDB$RELATION_NAME EQ relation->rel_name - + field = (burp_fld*) BURP_alloc_zero(sizeof(burp_fld)); field->fld_number = count++; field->fld_type = Y.RDB$FIELD_TYPE; @@ -689,14 +689,14 @@ burp_fld* get_fields( burp_rel* relation) field->fld_length = Y.RDB$FIELD_LENGTH; field->fld_scale = Y.RDB$FIELD_SCALE; field->fld_id = X.RDB$FIELD_ID; - + if (!X.RDB$DESCRIPTION.NULL) { blob_id = &X.RDB$DESCRIPTION; if (blob_id->gds_quad_low || blob_id->gds_quad_high) field->fld_description = X.RDB$DESCRIPTION; } - + if (!X.RDB$QUERY_HEADER.NULL) { blob_id = &X.RDB$QUERY_HEADER; @@ -772,10 +772,10 @@ burp_fld* get_fields( burp_rel* relation) field->fld_collation_id = X.RDB$COLLATION_ID; field->fld_flags |= FLD_collate_flag; } - + field->fld_next = fields; fields = field; - + END_FOR; ON_ERROR general_on_error(); @@ -917,10 +917,10 @@ burp_fld* get_fields( burp_rel* relation) general_on_error(); END_ERROR; } - + field->fld_next = fields; fields = field; - + END_FOR; ON_ERROR general_on_error(); @@ -943,7 +943,7 @@ SINT64 get_gen_id( const TEXT* name, SSHORT name_len) * Read id for a generator; * **************************************/ - UCHAR blr_buffer[100]; // enough to fit blr + UCHAR blr_buffer[100]; // enough to fit blr BurpGlobals* tdgbl = BurpGlobals::getSpecific(); @@ -956,7 +956,7 @@ SINT64 get_gen_id( const TEXT* name, SSHORT name_len) */ if (tdgbl->BCK_capabilities & BCK_ods10) { - // build the blr with the right relation name and 64-bit results. + // build the blr with the right relation name and 64-bit results. add_byte(blr, blr_version5); add_byte(blr, blr_begin); add_byte(blr, blr_message); @@ -987,7 +987,7 @@ SINT64 get_gen_id( const TEXT* name, SSHORT name_len) } else { - // build the blr with the right relation name and 32-bit results + // build the blr with the right relation name and 32-bit results add_byte(blr, blr_version4); add_byte(blr, blr_begin); add_byte(blr, blr_message); @@ -1027,7 +1027,7 @@ SINT64 get_gen_id( const TEXT* name, SSHORT name_len) if (isc_compile_request(status_vector, &DB, &gen_id_reqh, blr_length, (const char*) blr_buffer)) { - // if there's no gen_id, never mind ... + // if there's no gen_id, never mind ... return 0; } @@ -1036,7 +1036,7 @@ SINT64 get_gen_id( const TEXT* name, SSHORT name_len) 0)) { BURP_error_redirect(status_vector, 25); - // msg 25 Failed in put_blr_gen_id + // msg 25 Failed in put_blr_gen_id } @@ -1047,7 +1047,7 @@ SINT64 get_gen_id( const TEXT* name, SSHORT name_len) &read_msg1, 0)) { BURP_error_redirect(status_vector, 25); - // msg 25 Failed in put_blr_gen_id + // msg 25 Failed in put_blr_gen_id } } else @@ -1057,7 +1057,7 @@ SINT64 get_gen_id( const TEXT* name, SSHORT name_len) &read_msg0, 0)) { BURP_error_redirect(status_vector, 25); - // msg 25 Failed in put_blr_gen_id + // msg 25 Failed in put_blr_gen_id } read_msg1 = (SINT64) read_msg0; } @@ -1077,7 +1077,7 @@ void get_ranges( burp_fld* field) ************************************** * * Functional description - * Fill in the range low and high bounds by reading + * Fill in the range low and high bounds by reading * the ranges in rdb$field_dimensions. * **************************************/ @@ -1086,20 +1086,20 @@ void get_ranges( burp_fld* field) SLONG* rp = field->fld_ranges; USHORT count = 0; -// Get the array dimensions in the rdb$field_dimensions +// Get the array dimensions in the rdb$field_dimensions FOR (REQUEST_HANDLE tdgbl->handles_get_ranges_req_handle1) - X IN RDB$FIELD_DIMENSIONS - WITH X.RDB$FIELD_NAME EQ field->fld_source - SORTED BY X.RDB$DIMENSION - + X IN RDB$FIELD_DIMENSIONS + WITH X.RDB$FIELD_NAME EQ field->fld_source + SORTED BY X.RDB$DIMENSION + if (count != X.RDB$DIMENSION) BURP_error_redirect (NULL, 52, SafeArg() << field->fld_name); - // msg 52 array dimension for field %s is invalid + // msg 52 array dimension for field %s is invalid *rp++ = X.RDB$LOWER_BOUND; *rp++ = X.RDB$UPPER_BOUND; count++; - + END_FOR; ON_ERROR general_on_error(); @@ -1107,7 +1107,7 @@ void get_ranges( burp_fld* field) if (count != field->fld_dimensions) BURP_error_redirect(NULL, 52, SafeArg() << field->fld_name); - // msg 52 array dimension for field %s is invalid + // msg 52 array dimension for field %s is invalid } @@ -1115,7 +1115,7 @@ void put_array( burp_fld* field, burp_rel* relation, ISC_QUAD* blob_id) { /************************************** * - * p u t _ a r r a y + * p u t _ a r r a y * ************************************** * @@ -1124,11 +1124,11 @@ void put_array( burp_fld* field, burp_rel* relation, ISC_QUAD* blob_id) * **************************************/ SLONG range_buffer[16]; // enough for 16 dimensions - UCHAR blr_buffer[200]; // enough for a sdl with 16 dimensions + UCHAR blr_buffer[200]; // enough for a sdl with 16 dimensions BurpGlobals* tdgbl = BurpGlobals::getSpecific(); -// If the array is null, don't store it. It will be restored as null. +// If the array is null, don't store it. It will be restored as null. if (!blob_id->gds_quad_low && !blob_id->gds_quad_high) return; @@ -1143,7 +1143,7 @@ void put_array( burp_fld* field, burp_rel* relation, ISC_QUAD* blob_id) if (tdgbl->gbl_sw_transportable) xdr_buffer.lstr_length = field_length + 3; -// build the sdl +// build the sdl add_byte(blr, isc_sdl_version1); @@ -1205,7 +1205,7 @@ void put_array( burp_fld* field, burp_rel* relation, ISC_QUAD* blob_id) const USHORT blr_length = blr - blr_buffer; -// compute the range size for each dimension = high_range - low_range +// compute the range size for each dimension = high_range - low_range ULONG slice_length = field_length; for (range = field->fld_ranges; range < end_ranges; range += 2) @@ -1216,7 +1216,7 @@ void put_array( burp_fld* field, burp_rel* relation, ISC_QUAD* blob_id) } UCHAR* slice = BURP_alloc(slice_length); -// allocate space for the XDR representation +// allocate space for the XDR representation if (tdgbl->gbl_sw_transportable) { @@ -1233,7 +1233,7 @@ void put_array( burp_fld* field, burp_rel* relation, ISC_QUAD* blob_id) slice_length, slice, (SLONG*) &return_length)) { BURP_print(81, field->fld_name); - // msg 81 error accessing blob field %s -- continuing + // msg 81 error accessing blob field %s -- continuing BURP_print_status(status_vector); #ifdef DEBUG PRETTY_print_sdl(blr_buffer, NULL, NULL, 0); @@ -1374,19 +1374,19 @@ void put_blob( burp_fld* field, ISC_QUAD& blob_id, ULONG count) BurpGlobals* tdgbl = BurpGlobals::getSpecific(); - // If the blob is null, don't store it. It will be restored as null. + // If the blob is null, don't store it. It will be restored as null. if (UserBlob::blobIsNull(blob_id)) return; - // Open the blob and get it's vital statistics + // Open the blob and get it's vital statistics UserBlob blob(status_vector); if (!blob.open(DB, gds_trans, blob_id)) { BURP_print(81, field->fld_name); - // msg 81 error accessing blob field %s -- continuing + // msg 81 error accessing blob field %s -- continuing BURP_print_status(status_vector); return; } @@ -1394,7 +1394,7 @@ void put_blob( burp_fld* field, ISC_QUAD& blob_id, ULONG count) if (!blob.getInfo(sizeof(blob_items), blob_items, sizeof(blob_info), blob_info)) { BURP_error_redirect(status_vector, 20); - // msg 20 isc_blob_info failed + // msg 20 isc_blob_info failed } put(tdgbl, (UCHAR) (rec_blob)); @@ -1432,12 +1432,12 @@ void put_blob( burp_fld* field, ISC_QUAD& blob_id, ULONG count) default: BURP_error_redirect(NULL, 21, SafeArg() << int(item)); - // msg 21 don't understand blob info item %ld + // msg 21 don't understand blob info item %ld } } // NS: Compute number of chunks we are going to write for stream blob based - // on total blob length and maximum segment size. This way we tend to + // on total blob length and maximum segment size. This way we tend to // preserve maximum internal segment size over backup/restore. I'm not sure // this is beneficial, but let's do it for the moment instead of inventing // our own chunk size. Note, the number of segments returned by information @@ -1453,7 +1453,7 @@ void put_blob( burp_fld* field, ISC_QUAD& blob_id, ULONG count) put_numeric(att_blob_number_segments, segments); put_numeric(att_blob_type, blob_type); - // Allocate a buffer large enough for the largest segment and start grinding. + // Allocate a buffer large enough for the largest segment and start grinding. UCHAR* buffer; if (!max_segment || max_segment <= sizeof(static_buffer)) buffer = static_buffer; @@ -1472,7 +1472,7 @@ void put_blob( burp_fld* field, ISC_QUAD& blob_id, ULONG count) if (status && (status != isc_segment || blob_type == 0)) { BURP_error_redirect(status_vector, 22); - // msg 22 isc_get_segment failed + // msg 22 isc_get_segment failed } put(tdgbl, (UCHAR) (segment_length)); @@ -1486,7 +1486,7 @@ void put_blob( burp_fld* field, ISC_QUAD& blob_id, ULONG count) if (!blob.close()) BURP_error_redirect(status_vector, 23); - // msg 23 isc_close_blob failed + // msg 23 isc_close_blob failed if (buffer != static_buffer) BURP_free(buffer); @@ -1511,25 +1511,25 @@ bool put_blr_blob( SCHAR attribute, ISC_QUAD& blob_id) BurpGlobals* tdgbl = BurpGlobals::getSpecific(); - // If the blob is null, don't store it. It will be restored as null. + // If the blob is null, don't store it. It will be restored as null. if (UserBlob::blobIsNull(blob_id)) return false; - // Open the blob and get it's vital statistics + // Open the blob and get it's vital statistics UserBlob blob(status_vector); if (!blob.open(DB, gds_trans, blob_id)) { BURP_error_redirect(status_vector, 24); - // msg 24 isc_open_blob failed + // msg 24 isc_open_blob failed } if (!blob.getInfo(sizeof(blr_items), blr_items, sizeof(blob_info), blob_info)) { BURP_error_redirect(status_vector, 20); - // msg 20 isc_blob_info failed + // msg 20 isc_blob_info failed } ULONG length = 0; @@ -1555,7 +1555,7 @@ bool put_blr_blob( SCHAR attribute, ISC_QUAD& blob_id) default: BURP_print(79, SafeArg() << int(item)); - // msg 79 don't understand blob info item %ld + // msg 79 don't understand blob info item %ld if (!blob.close()) BURP_error_redirect(status_vector, 23); // msg 23 isc_close_blob failed @@ -1571,14 +1571,14 @@ bool put_blr_blob( SCHAR attribute, ISC_QUAD& blob_id) return false; } - // Rdb sometimes gets the length messed up + // Rdb sometimes gets the length messed up if (length < max_segment) length = max_segment; put_numeric(attribute, (int) length); - // Allocate a buffer large enough for the largest segment and start grinding. + // Allocate a buffer large enough for the largest segment and start grinding. UCHAR* buffer; if (!max_segment || max_segment <= sizeof(static_buffer)) @@ -1738,7 +1738,7 @@ void put_data(burp_rel* relation) default: BURP_error_redirect(NULL, 26, SafeArg() << field->fld_type); - // msg 26 datatype %ld not understood + // msg 26 datatype %ld not understood break; } if (alignment) @@ -1748,7 +1748,7 @@ void put_data(burp_rel* relation) offset += length; } - // Next, build fields for null flags + // Next, build fields for null flags for (field = relation->rel_fields; field; field = field->fld_next) { @@ -1761,24 +1761,24 @@ void put_data(burp_rel* relation) offset += sizeof(SSHORT); } - // Finally, make up an EOF field + // Finally, make up an EOF field - add_byte(blr, blr_short); // eof field - add_byte(blr, 0); // scale for eof field + add_byte(blr, blr_short); // eof field + add_byte(blr, 0); // scale for eof field SSHORT eof_parameter = count++; RCRD_OFFSET record_length = offset; RCRD_OFFSET eof_offset = FB_ALIGN(offset, sizeof(SSHORT)); // To be used later for the buffer size to receive data const FLD_LENGTH length = (USHORT) (eof_offset + sizeof(SSHORT)); - // Build FOR loop, body, and eof handler + // Build FOR loop, body, and eof handler add_byte(blr, blr_for); add_byte(blr, blr_rse); - add_byte(blr, 1); // count of relations + add_byte(blr, 1); // count of relations add_byte(blr, blr_rid); add_word(blr, relation->rel_id); - add_byte(blr, 0); // context variable + add_byte(blr, 0); // context variable add_byte(blr, blr_end); add_byte(blr, blr_send); @@ -1829,7 +1829,7 @@ void put_data(burp_rel* relation) #endif - // Compile request + // Compile request FB_API_HANDLE request = 0; SSHORT blr_length = blr - blr_buffer; @@ -1837,14 +1837,14 @@ void put_data(burp_rel* relation) blr_length, (const SCHAR*) blr_buffer)) { BURP_error_redirect(status_vector, 27); - // msg 27 isc_compile_request failed + // msg 27 isc_compile_request failed isc_print_blr((const char*) blr_buffer, NULL, NULL, 0); } BURP_free(blr_buffer); - + BURP_verbose(142, relation->rel_name); - // msg 142 writing data for relation %s + // msg 142 writing data for relation %s if (isc_start_request(status_vector, &request, &gds_trans, 0)) { @@ -1875,12 +1875,12 @@ void put_data(burp_rel* relation) if (isc_receive(status_vector, &request, 0, length, buffer, 0)) { BURP_error_redirect(status_vector, 29); - // msg 29 isc_receive failed + // msg 29 isc_receive failed } if (!*eof) break; records++; - // Verbose records + // Verbose records if ((records % BACKUP_VERBOSE_INTERVAL) == 0) BURP_verbose(108, SafeArg() << records); @@ -1902,7 +1902,7 @@ void put_data(burp_rel* relation) else if (record_length) put_block(tdgbl, p, record_length); - // Look for any blobs to write + // Look for any blobs to write for (field = relation->rel_fields; field; field = field->fld_next) { @@ -1916,8 +1916,8 @@ void put_data(burp_rel* relation) } } - // Look for any array to write - // we got back the blob_id for the array from isc_receive in the second param. + // Look for any array to write + // we got back the blob_id for the array from isc_receive in the second param. for (field = relation->rel_fields; field; field = field->fld_next) { if (field->fld_flags & FLD_array) @@ -1934,11 +1934,11 @@ void put_data(burp_rel* relation) BURP_free(xdr_buffer.lstr_address); BURP_verbose(108, SafeArg() << records); - // msg 108 %ld records written + // msg 108 %ld records written if (isc_release_request(status_vector, &request)) BURP_error_redirect(status_vector, 30); - // msg 30 isc_release_request failed + // msg 30 isc_release_request failed } @@ -1961,10 +1961,10 @@ void put_index( burp_rel* relation) BurpGlobals* tdgbl = BurpGlobals::getSpecific(); -/* if we have all capabilities, use the first request to get the - most performance out of the latest engine; if we don't - have one of the capabilities we must use the second set of - requests--this requires more code but it is well worth it +/* if we have all capabilities, use the first request to get the + most performance out of the latest engine; if we don't + have one of the capabilities we must use the second set of + requests--this requires more code but it is well worth it for the performance benefits, especially remotely--deej */ if ((tdgbl->BCK_capabilities & BCK_idx_inactive) && @@ -1972,54 +1972,54 @@ void put_index( burp_rel* relation) (tdgbl->BCK_capabilities & BCK_ods8)) { FOR (REQUEST_HANDLE tdgbl->handles_put_index_req_handle1) - X IN RDB$INDICES WITH + X IN RDB$INDICES WITH X.RDB$RELATION_NAME EQ relation->rel_name - + count = 0; FOR (REQUEST_HANDLE tdgbl->handles_put_index_req_handle2) - I_S IN RDB$INDEX_SEGMENTS CROSS - RFR IN RDB$RELATION_FIELDS WITH - I_S.RDB$FIELD_NAME = RFR.RDB$FIELD_NAME AND - I_S.RDB$INDEX_NAME = X.RDB$INDEX_NAME AND - RFR.RDB$RELATION_NAME = relation->rel_name - + I_S IN RDB$INDEX_SEGMENTS CROSS + RFR IN RDB$RELATION_FIELDS WITH + I_S.RDB$FIELD_NAME = RFR.RDB$FIELD_NAME AND + I_S.RDB$INDEX_NAME = X.RDB$INDEX_NAME AND + RFR.RDB$RELATION_NAME = relation->rel_name + count++; - + END_FOR; ON_ERROR general_on_error(); END_ERROR; - - if (count != (ULONG) X.RDB$SEGMENT_COUNT) + + if (count != (ULONG) X.RDB$SEGMENT_COUNT) { BURP_print(180, SafeArg() << X.RDB$INDEX_NAME << count << X.RDB$SEGMENT_COUNT); continue; } - + put(tdgbl, rec_index); const ULONG l = PUT_TEXT (att_index_name, X.RDB$INDEX_NAME); MISC_terminate (X.RDB$INDEX_NAME, temp, l, sizeof(temp)); BURP_verbose (151, temp); - // msg 151 writing index %s + // msg 151 writing index %s put_numeric (att_segment_count, X.RDB$SEGMENT_COUNT); put_numeric (att_index_inactive, X.RDB$INDEX_INACTIVE); put_numeric (att_index_unique_flag, X.RDB$UNIQUE_FLAG); - + FOR (REQUEST_HANDLE tdgbl->handles_put_index_req_handle5) - Y IN RDB$INDEX_SEGMENTS WITH + Y IN RDB$INDEX_SEGMENTS WITH Y.RDB$INDEX_NAME EQ X.RDB$INDEX_NAME SORTED BY Y.RDB$FIELD_POSITION - + PUT_TEXT (att_index_field_name, Y.RDB$FIELD_NAME); - + END_FOR; ON_ERROR general_on_error(); END_ERROR; - + put_source_blob (att_index_description2, att_index_description, X.RDB$DESCRIPTION); put_numeric (att_index_type, X.RDB$INDEX_TYPE); - + if (!X.RDB$EXPRESSION_SOURCE.NULL) put_source_blob (att_index_expression_source, att_index_expression_source, @@ -2030,7 +2030,7 @@ void put_index( burp_rel* relation) if (!X.RDB$FOREIGN_KEY.NULL) PUT_TEXT (att_index_foreign_key, X.RDB$FOREIGN_KEY); put(tdgbl, att_end); - + END_FOR; ON_ERROR general_on_error(); @@ -2039,19 +2039,19 @@ void put_index( burp_rel* relation) else { FOR (REQUEST_HANDLE tdgbl->handles_put_index_req_handle1) - X IN RDB$INDICES WITH + X IN RDB$INDICES WITH X.RDB$RELATION_NAME EQ relation->rel_name - + count = 0; FOR (REQUEST_HANDLE tdgbl->handles_put_index_req_handle2) - I_S IN RDB$INDEX_SEGMENTS WITH + I_S IN RDB$INDEX_SEGMENTS WITH I_S.RDB$INDEX_NAME = X.RDB$INDEX_NAME bool match = false; - + FOR (REQUEST_HANDLE tdgbl->handles_put_index_req_handle3) - RFR IN RDB$RELATION_FIELDS WITH + RFR IN RDB$RELATION_FIELDS WITH I_S.RDB$FIELD_NAME = RFR.RDB$FIELD_NAME AND - RFR.RDB$RELATION_NAME = relation->rel_name + RFR.RDB$RELATION_NAME = relation->rel_name match = true; END_FOR; ON_ERROR @@ -2065,23 +2065,23 @@ void put_index( burp_rel* relation) ON_ERROR general_on_error(); END_ERROR; - - if (count != (ULONG) X.RDB$SEGMENT_COUNT) + + if (count != (ULONG) X.RDB$SEGMENT_COUNT) { BURP_print(180, SafeArg() << X.RDB$INDEX_NAME << count << X.RDB$SEGMENT_COUNT); - continue; + continue; } - + put(tdgbl, rec_index); const ULONG l = PUT_TEXT (att_index_name, X.RDB$INDEX_NAME); MISC_terminate (X.RDB$INDEX_NAME, temp, l, sizeof(temp)); BURP_verbose (151, temp); - // msg 151 writing index %s + // msg 151 writing index %s put_numeric (att_segment_count, X.RDB$SEGMENT_COUNT); if (tdgbl->BCK_capabilities & BCK_idx_inactive) FOR (REQUEST_HANDLE tdgbl->handles_put_index_req_handle4) I IN RDB$INDICES WITH I.RDB$INDEX_NAME = X.RDB$INDEX_NAME - put_numeric (att_index_inactive, I.RDB$INDEX_INACTIVE); + put_numeric (att_index_inactive, I.RDB$INDEX_INACTIVE); END_FOR; ON_ERROR general_on_error(); @@ -2122,7 +2122,7 @@ void put_index( burp_rel* relation) general_on_error(); END_ERROR; put(tdgbl, att_end); - + END_FOR; ON_ERROR general_on_error(); @@ -2303,7 +2303,7 @@ void put_relation( burp_rel* relation) relation->rel_fields = field; } -// Now write the fields in what will become physical backup order +// Now write the fields in what will become physical backup order for (field = relation->rel_fields; field; field = field->fld_next) { @@ -2311,7 +2311,7 @@ void put_relation( burp_rel* relation) const USHORT l = PUT_TEXT(att_field_name, field->fld_name); MISC_terminate(field->fld_name, temp, l, sizeof(temp)); BURP_verbose(144, temp); - // msg 144 writing field %s + // msg 144 writing field %s PUT_TEXT(att_field_source, field->fld_source); if (field->fld_query_name[0]) PUT_TEXT(att_field_query_name, field->fld_query_name); @@ -2366,7 +2366,7 @@ void put_relation( burp_rel* relation) put(tdgbl, (UCHAR) (att_end)); } -// Write out view relations (if a view, of course) +// Write out view relations (if a view, of course) if (relation->rel_flags & REL_view) { @@ -2438,13 +2438,13 @@ bool put_source_blob(SCHAR attribute, if (!blob.open(DB, gds_trans, blob_id)) { BURP_error_redirect(status_vector, 24); - // msg 24 isc_open_blob failed + // msg 24 isc_open_blob failed } if (!blob.getInfo(sizeof(source_items), source_items, sizeof(blob_info), blob_info)) { BURP_error_redirect(status_vector, 20); - // msg 20 isc_blob_info failed + // msg 20 isc_blob_info failed } SLONG length = 0; @@ -2474,7 +2474,7 @@ bool put_source_blob(SCHAR attribute, default: BURP_print(79, SafeArg() << int(item)); - // msg 79 don't understand blob info item %ld + // msg 79 don't understand blob info item %ld if (!blob.close()) { BURP_error_redirect(status_vector, 23); @@ -2489,7 +2489,7 @@ bool put_source_blob(SCHAR attribute, if (!blob.close()) { BURP_error_redirect(status_vector, 23); - // msg 23 isc_close_blob failed + // msg 23 isc_close_blob failed } return false; } @@ -2522,7 +2522,7 @@ bool put_source_blob(SCHAR attribute, if (!blob.close()) BURP_error_redirect(status_vector, 23); - // msg 23 isc_close_blob failed + // msg 23 isc_close_blob failed if (buffer != static_buffer) BURP_free(buffer); @@ -2550,7 +2550,7 @@ int put_text( SCHAR attribute, const TEXT* text, SSHORT size_len) BurpGlobals* tdgbl = BurpGlobals::getSpecific(); const SSHORT l = (SSHORT) MISC_symbol_length(text, (ULONG) size_len); - + put(tdgbl, (UCHAR) (attribute)); put(tdgbl, (UCHAR) (l)); if (l) @@ -2569,7 +2569,7 @@ void set_capabilities(void) ************************************** * * Functional description - * + * * set the capabilities bits for the * database being extracted to avoid * unpleasantness later. @@ -2659,13 +2659,13 @@ void write_check_constraints(void) { /************************************** * - * w r i t e _ c h e c k _ c o n s t r a i n t s + * w r i t e _ c h e c k _ c o n s t r a i n t s * ************************************** * * Functional description * write a record in the burp file for - * each check constraint. + * each check constraint. * **************************************/ isc_req_handle req_handle1 = 0; @@ -2675,7 +2675,7 @@ void write_check_constraints(void) FOR (REQUEST_HANDLE req_handle1) X IN RDB$CHECK_CONSTRAINTS put(tdgbl, rec_chk_constraint); - + PUT_TEXT (att_chk_constraint_name, X.RDB$CONSTRAINT_NAME); if (!X.RDB$TRIGGER_NAME.NULL) PUT_TEXT (att_chk_trigger_name, X.RDB$TRIGGER_NAME); @@ -2684,7 +2684,7 @@ void write_check_constraints(void) ON_ERROR general_on_error(); END_ERROR; - + MISC_release_request_silent(req_handle1); } @@ -2767,7 +2767,7 @@ void write_database( const TEXT* dbb_file) * Functional description * write a physical database record and a * logical database record in the burp file for - * the database itself. + * the database itself. * **************************************/ ISC_STATUS_ARRAY status_vector; @@ -2782,7 +2782,7 @@ void write_database( const TEXT* dbb_file) db_info_items, sizeof(buffer), buffer)) { BURP_error_redirect(status_vector, 31); - // msg 31 isc_database_info failed + // msg 31 isc_database_info failed } USHORT page_size = 0, forced_writes, no_reserve, @@ -2824,8 +2824,8 @@ void write_database( const TEXT* dbb_file) put_numeric(att_page_buffers, page_buffers); break; - case isc_info_error: // old server does not understand new isc_info - break; // parameter and returns isc_info_error. skip it + case isc_info_error: // old server does not understand new isc_info + break; // parameter and returns isc_info_error. skip it case isc_info_db_sql_dialect: SQL_dialect = (USHORT) isc_vax_integer(d, length); @@ -2839,7 +2839,7 @@ void write_database( const TEXT* dbb_file) default: BURP_error_redirect(status_vector, 31); - // msg 31 isc_database_info failed + // msg 31 isc_database_info failed break; } } @@ -2847,16 +2847,16 @@ void write_database( const TEXT* dbb_file) put_asciz(att_file_name, dbb_file); BURP_verbose(77, SafeArg() << dbb_file << page_size); - // msg 77 database %s has a page size of %ld bytes. + // msg 77 database %s has a page size of %ld bytes. put(tdgbl, (UCHAR) (att_end)); put(tdgbl, (UCHAR) (rec_database)); -/* if we have all capabilities, use the first request to get the - most performance out of the latest engine; if we don't - have one of the capabilities we must use the second set of - requests--this requires more code but it is well worth it +/* if we have all capabilities, use the first request to get the + most performance out of the latest engine; if we don't + have one of the capabilities we must use the second set of + requests--this requires more code but it is well worth it for the performance benefits, especially remotely--deej */ if ((tdgbl->BCK_capabilities & BCK_security) && @@ -2994,7 +2994,7 @@ void write_field_dimensions(void) END_ERROR; MISC_release_request_silent(req_handle1); -} +} void write_filters(void) @@ -3041,7 +3041,7 @@ void write_filters(void) void write_functions(void) { /************************************** - * + * * w r i t e _ f u n c t i o n s * ************************************** @@ -3080,7 +3080,7 @@ void write_functions(void) END_ERROR; MISC_release_request_silent(req_handle1); -} +} void write_function_args( GDS_NAME funcptr) @@ -3094,28 +3094,28 @@ void write_function_args( GDS_NAME funcptr) * Functional description * write all arguments for a function. * - **************************************/ + **************************************/ TEXT temp[GDS_NAME_LEN]; BurpGlobals* tdgbl = BurpGlobals::getSpecific(); - /* if we have all capabilities, use the first request to get the - most performance out of the latest engine; if we don't - have one of the capabilities we must use the second set of - requests--this requires more code but it is well worth it + /* if we have all capabilities, use the first request to get the + most performance out of the latest engine; if we don't + have one of the capabilities we must use the second set of + requests--this requires more code but it is well worth it for the performance benefits, especially remotely--deej */ if (tdgbl->BCK_capabilities & BCK_ods10) { FOR (REQUEST_HANDLE tdgbl->handles_write_function_args_req_handle1) - X IN RDB$FUNCTION_ARGUMENTS WITH + X IN RDB$FUNCTION_ARGUMENTS WITH X.RDB$FUNCTION_NAME EQ funcptr put(tdgbl, rec_function_arg); const SSHORT l = PUT_TEXT (att_functionarg_name, X.RDB$FUNCTION_NAME); MISC_terminate (X.RDB$FUNCTION_NAME, temp, l, sizeof(temp)); BURP_verbose (141, temp); - // msg 141 writing argument for function %s + // msg 141 writing argument for function %s put_numeric (att_functionarg_position, X.RDB$ARGUMENT_POSITION); put_numeric (att_functionarg_mechanism, X.RDB$MECHANISM); put_numeric (att_functionarg_field_type, X.RDB$FIELD_TYPE); @@ -3124,7 +3124,7 @@ void write_function_args( GDS_NAME funcptr) put_numeric (att_functionarg_field_sub_type, X.RDB$FIELD_SUB_TYPE); if (!X.RDB$CHARACTER_SET_ID.NULL) put_numeric (att_functionarg_character_set, X.RDB$CHARACTER_SET_ID); - + if (!X.RDB$FIELD_PRECISION.NULL) put_numeric (att_functionarg_field_precision, X.RDB$FIELD_PRECISION); put(tdgbl, att_end); @@ -3136,26 +3136,26 @@ void write_function_args( GDS_NAME funcptr) else { FOR (REQUEST_HANDLE tdgbl->handles_write_function_args_req_handle1) - X IN RDB$FUNCTION_ARGUMENTS WITH + X IN RDB$FUNCTION_ARGUMENTS WITH X.RDB$FUNCTION_NAME EQ funcptr put(tdgbl, rec_function_arg); const SSHORT l = PUT_TEXT (att_functionarg_name, X.RDB$FUNCTION_NAME); MISC_terminate (X.RDB$FUNCTION_NAME, temp, l, sizeof(temp)); BURP_verbose (141, temp); - // msg 141 writing argument for function %s + // msg 141 writing argument for function %s put_numeric (att_functionarg_position, X.RDB$ARGUMENT_POSITION); put_numeric (att_functionarg_mechanism, X.RDB$MECHANISM); put_numeric (att_functionarg_field_type, X.RDB$FIELD_TYPE); put_numeric (att_functionarg_field_scale, X.RDB$FIELD_SCALE); put_numeric (att_functionarg_field_length, X.RDB$FIELD_LENGTH); put_numeric (att_functionarg_field_sub_type, X.RDB$FIELD_SUB_TYPE); - + if (tdgbl->BCK_capabilities & BCK_ods8) { FOR (REQUEST_HANDLE tdgbl->handles_write_function_args_req_handle2) - X2 IN RDB$FUNCTION_ARGUMENTS WITH - X2.RDB$FUNCTION_NAME EQ funcptr AND + X2 IN RDB$FUNCTION_ARGUMENTS WITH + X2.RDB$FUNCTION_NAME EQ funcptr AND X2.RDB$ARGUMENT_POSITION = X.RDB$ARGUMENT_POSITION; if (!X2.RDB$CHARACTER_SET_ID.NULL) @@ -3244,7 +3244,7 @@ void write_generators(void) } MISC_release_request_silent(req_handle1); -} +} void write_global_fields(void) @@ -3257,7 +3257,7 @@ void write_global_fields(void) * * Functional description * write a record in the burp file for - * each global field. + * each global field. * **************************************/ TEXT temp[GDS_NAME_LEN]; @@ -3266,10 +3266,10 @@ void write_global_fields(void) BurpGlobals* tdgbl = BurpGlobals::getSpecific(); - /* if we have all capabilities, use the first request to get the - most performance out of the latest engine; if we don't - have one of the capabilities we must use the second set of - requests--this requires more code but it is well worth it + /* if we have all capabilities, use the first request to get the + most performance out of the latest engine; if we don't + have one of the capabilities we must use the second set of + requests--this requires more code but it is well worth it for the performance benefits, especially remotely--deej */ if ((tdgbl->BCK_capabilities & BCK_attributes_v3) && @@ -3277,8 +3277,8 @@ void write_global_fields(void) (tdgbl->BCK_capabilities & BCK_ods10)) { FOR (REQUEST_HANDLE req_handle1) - X IN RDB$FIELDS WITH - X.RDB$SYSTEM_FLAG NE 1 OR + X IN RDB$FIELDS WITH + X.RDB$SYSTEM_FLAG NE 1 OR X.RDB$SYSTEM_FLAG MISSING put(tdgbl, rec_global_field); @@ -3308,10 +3308,10 @@ void write_global_fields(void) if (X.RDB$SYSTEM_FLAG) put_numeric (att_field_system_flag, X.RDB$SYSTEM_FLAG); put_source_blob (att_field_description2, att_field_description, X.RDB$DESCRIPTION); - + if (X.RDB$EXTERNAL_LENGTH) put_numeric (att_field_external_length, X.RDB$EXTERNAL_LENGTH); - if (X.RDB$EXTERNAL_TYPE) + if (X.RDB$EXTERNAL_TYPE) put_numeric (att_field_external_type, X.RDB$EXTERNAL_TYPE); if (X.RDB$EXTERNAL_SCALE) put_numeric (att_field_external_scale, X.RDB$EXTERNAL_SCALE); @@ -3331,10 +3331,10 @@ void write_global_fields(void) put_numeric (att_field_character_set, X.RDB$CHARACTER_SET_ID); if (!X.RDB$COLLATION_ID.NULL) put_numeric (att_field_collation_id, X.RDB$COLLATION_ID); - + if (!X.RDB$FIELD_PRECISION.NULL) put_numeric (att_field_precision, X.RDB$FIELD_PRECISION); - + put(tdgbl, att_end); END_FOR; @@ -3345,8 +3345,8 @@ void write_global_fields(void) else { FOR (REQUEST_HANDLE req_handle1) - X IN RDB$FIELDS WITH - X.RDB$SYSTEM_FLAG NE 1 OR + X IN RDB$FIELDS WITH + X.RDB$SYSTEM_FLAG NE 1 OR X.RDB$SYSTEM_FLAG MISSING put(tdgbl, rec_global_field); @@ -3381,10 +3381,10 @@ void write_global_fields(void) { FOR (REQUEST_HANDLE req_handle2) F IN RDB$FIELDS WITH F.RDB$FIELD_NAME = X.RDB$FIELD_NAME - + if (F.RDB$EXTERNAL_LENGTH) put_numeric (att_field_external_length, F.RDB$EXTERNAL_LENGTH); - if (F.RDB$EXTERNAL_TYPE) + if (F.RDB$EXTERNAL_TYPE) put_numeric (att_field_external_type, F.RDB$EXTERNAL_TYPE); if (F.RDB$EXTERNAL_SCALE) put_numeric (att_field_external_scale, F.RDB$EXTERNAL_SCALE); @@ -3447,7 +3447,7 @@ void write_global_fields(void) void write_procedures(void) { /************************************** - * + * * w r i t e _ p r o c e d u r e s * ************************************** @@ -3528,7 +3528,7 @@ void write_procedures(void) } MISC_release_request_silent(req_handle1); -} +} void write_procedure_prms( GDS_NAME procptr) @@ -3542,7 +3542,7 @@ void write_procedure_prms( GDS_NAME procptr) * Functional description * write all parameters of a stored procedure. * - **************************************/ + **************************************/ TEXT temp[GDS_NAME_LEN]; BurpGlobals* tdgbl = BurpGlobals::getSpecific(); @@ -3555,7 +3555,7 @@ void write_procedure_prms( GDS_NAME procptr) const SSHORT l = PUT_TEXT (att_procedureprm_name, X.RDB$PARAMETER_NAME); MISC_terminate (X.RDB$PARAMETER_NAME, temp, l, sizeof(temp)); BURP_verbose (194, temp); - // msg 194 writing parameter %s for stored procedure + // msg 194 writing parameter %s for stored procedure put_numeric (att_procedureprm_number, X.RDB$PARAMETER_NUMBER); put_numeric (att_procedureprm_type, X.RDB$PARAMETER_type); PUT_TEXT (att_procedureprm_field_source, X.RDB$FIELD_SOURCE); @@ -3591,7 +3591,7 @@ void write_procedure_prms( GDS_NAME procptr) const SSHORT l = PUT_TEXT (att_procedureprm_name, X.RDB$PARAMETER_NAME); MISC_terminate (X.RDB$PARAMETER_NAME, temp, l, sizeof(temp)); BURP_verbose (194, temp); - // msg 194 writing parameter %s for stored procedure + // msg 194 writing parameter %s for stored procedure put_numeric (att_procedureprm_number, X.RDB$PARAMETER_NUMBER); put_numeric (att_procedureprm_type, X.RDB$PARAMETER_type); PUT_TEXT (att_procedureprm_field_source, X.RDB$FIELD_SOURCE); @@ -3610,13 +3610,13 @@ void write_ref_constraints(void) { /************************************** * - * w r i t e _ r e f _ c o n s t r a i n t s + * w r i t e _ r e f _ c o n s t r a i n t s * ************************************** * * Functional description * write a record in the burp file for - * each referential constraint. + * each referential constraint. * **************************************/ isc_req_handle req_handle1 = 0; @@ -3644,13 +3644,13 @@ void write_rel_constraints(void) { /************************************** * - * w r i t e _ r e l _ c o n s t r a i n t s + * w r i t e _ r e l _ c o n s t r a i n t s * ************************************** * * Functional description * write a record in the burp file for - * each relation constraint. + * each relation constraint. * **************************************/ TEXT temp[GDS_NAME_LEN]; @@ -3664,7 +3664,7 @@ void write_rel_constraints(void) const SSHORT l = PUT_TEXT (att_rel_constraint_name, X.RDB$CONSTRAINT_NAME); MISC_terminate (X.RDB$CONSTRAINT_NAME, temp, l, sizeof(temp)); BURP_verbose (207, temp); - // msg 207 writing constraint %s + // msg 207 writing constraint %s PUT_MESSAGE (att_rel_constraint_type, X.RDB$CONSTRAINT_TYPE); PUT_TEXT (att_rel_constraint_rel_name, X.RDB$RELATION_NAME); PUT_TEXT (att_rel_constraint_defer, X.RDB$DEFERRABLE); @@ -3690,7 +3690,7 @@ void write_relations(void) * * Functional description * write a record in the burp file for - * each relation. + * each relation. * **************************************/ TEXT temp[GDS_NAME_LEN]; @@ -3699,10 +3699,10 @@ void write_relations(void) BurpGlobals* tdgbl = BurpGlobals::getSpecific(); - /* if we have all capabilities, use the first request to get the - most performance out of the latest engine; if we don't - have one of the capabilities we must use the second set of - requests--this requires more code but it is well worth it + /* if we have all capabilities, use the first request to get the + most performance out of the latest engine; if we don't + have one of the capabilities we must use the second set of + requests--this requires more code but it is well worth it for the performance benefits, especially remotely--deej */ if ((tdgbl->BCK_capabilities & BCK_ods8) && @@ -3711,7 +3711,7 @@ void write_relations(void) (tdgbl->BCK_capabilities & BCK_ods11_1)) { FOR (REQUEST_HANDLE req_handle1) - X IN RDB$RELATIONS WITH X.RDB$SYSTEM_FLAG NE 1 OR + X IN RDB$RELATIONS WITH X.RDB$SYSTEM_FLAG NE 1 OR X.RDB$SYSTEM_FLAG MISSING SSHORT flags = 0; @@ -3733,12 +3733,12 @@ void write_relations(void) put_numeric (att_relation_flags, X.RDB$FLAGS); if (!X.RDB$SECURITY_CLASS.NULL) PUT_TEXT (att_relation_security_class, X.RDB$SECURITY_CLASS); - + put_source_blob (att_relation_description2, att_relation_description, X.RDB$DESCRIPTION); put_source_blob (att_relation_view_source2, att_relation_view_source, X.RDB$VIEW_SOURCE); - + put_source_blob (att_relation_ext_description2, att_relation_ext_description, X.RDB$EXTERNAL_DESCRIPTION); PUT_TEXT (att_relation_owner_name, X.RDB$OWNER_NAME); @@ -3746,7 +3746,7 @@ void write_relations(void) { if (!tdgbl->gbl_sw_convert_ext_tables) { - PUT_TEXT(att_relation_ext_file_name, X.RDB$EXTERNAL_FILE); + PUT_TEXT(att_relation_ext_file_name, X.RDB$EXTERNAL_FILE); flags |= REL_external; } } @@ -3770,7 +3770,7 @@ void write_relations(void) else { FOR (REQUEST_HANDLE req_handle1) - X IN RDB$RELATIONS WITH X.RDB$SYSTEM_FLAG NE 1 OR + X IN RDB$RELATIONS WITH X.RDB$SYSTEM_FLAG NE 1 OR X.RDB$SYSTEM_FLAG MISSING SSHORT flags = 0; @@ -3779,7 +3779,7 @@ void write_relations(void) MISC_terminate (X.RDB$RELATION_NAME, temp, l, sizeof(temp)); BURP_verbose (153, temp); /* msg 153 writing relation %.*s */ - + /* RDB$VIEW_BLR must be the first blob field in the backup file. * RESTORE.E makes this assumption in get_relation(). */ @@ -3825,7 +3825,7 @@ void write_relations(void) { if (!tdgbl->gbl_sw_convert_ext_tables) { - PUT_TEXT(att_relation_ext_file_name, R.RDB$EXTERNAL_FILE); + PUT_TEXT(att_relation_ext_file_name, R.RDB$EXTERNAL_FILE); flags |= REL_external; } } @@ -3885,7 +3885,7 @@ void write_shadow_files(void) BurpGlobals* tdgbl = BurpGlobals::getSpecific(); FOR (REQUEST_HANDLE req_handle1) - X IN RDB$FILES + X IN RDB$FILES WITH X.RDB$SHADOW_NUMBER NOT MISSING AND X.RDB$SHADOW_NUMBER NE 0 put(tdgbl, rec_files); @@ -3917,7 +3917,7 @@ void write_sql_roles(void) * * Functional description * write a record in the burp file for - * each SQL roles. + * each SQL roles. * **************************************/ isc_req_handle req_handle1 = 0; @@ -3942,7 +3942,7 @@ void write_sql_roles(void) MISC_terminate (X.RDB$ROLE_NAME, temp, l, sizeof(temp)); BURP_verbose (249, temp); // msg 249 writing SQL role: %s - + END_FOR; ON_ERROR general_on_error(); @@ -3980,7 +3980,7 @@ void write_mapping(void) * * Functional description * write a record in the burp file for - * each names mapping. + * each names mapping. * **************************************/ isc_req_handle req_handle = 0; @@ -4003,7 +4003,7 @@ void write_mapping(void) BURP_verbose (297, ADMIN_ROLE); // msg 297 writing mapping for @1 } - + END_FOR; ON_ERROR general_on_error(); @@ -4030,25 +4030,25 @@ void write_triggers(void) BurpGlobals* tdgbl = BurpGlobals::getSpecific(); - /* if we have all capabilities, use the first request to get the - most performance out of the latest engine; if we don't - have one of the capabilities we must use the second set of - requests--this requires more code but it is well worth it + /* if we have all capabilities, use the first request to get the + most performance out of the latest engine; if we don't + have one of the capabilities we must use the second set of + requests--this requires more code but it is well worth it for the performance benefits, especially remotely--deej */ if (tdgbl->BCK_capabilities & BCK_ods11_1) { FOR (REQUEST_HANDLE req_handle1) - X IN RDB$TRIGGERS WITH - X.RDB$SYSTEM_FLAG NE 1 OR + X IN RDB$TRIGGERS WITH + X.RDB$SYSTEM_FLAG NE 1 OR X.RDB$SYSTEM_FLAG MISSING put(tdgbl, rec_trigger); const SSHORT l = PUT_TEXT (att_trig_name, X.RDB$TRIGGER_NAME); MISC_terminate (X.RDB$TRIGGER_NAME, temp, l, sizeof(temp)); BURP_verbose (156, temp); - // msg 156 writing trigger %s - + // msg 156 writing trigger %s + if (!X.RDB$RELATION_NAME.NULL) PUT_TEXT (att_trig_relation_name, X.RDB$RELATION_NAME); @@ -4059,7 +4059,7 @@ void write_triggers(void) put_source_blob (att_trig_description2, att_trig_description, X.RDB$DESCRIPTION); put_numeric (att_trig_system_flag, X.RDB$SYSTEM_FLAG); put_numeric (att_trig_inactive, X.RDB$TRIGGER_INACTIVE); - + if (!X.RDB$FLAGS.NULL) put_numeric (att_trig_flags, X.RDB$FLAGS); @@ -4068,7 +4068,7 @@ void write_triggers(void) if (!X.RDB$DEBUG_INFO.NULL) put_blr_blob (att_trig_debug_info, X.RDB$DEBUG_INFO); - + put(tdgbl, att_end); END_FOR; @@ -4079,16 +4079,16 @@ void write_triggers(void) else if (tdgbl->BCK_capabilities & BCK_ods8) { FOR (REQUEST_HANDLE req_handle1) - X IN RDB$TRIGGERS WITH - X.RDB$SYSTEM_FLAG NE 1 OR + X IN RDB$TRIGGERS WITH + X.RDB$SYSTEM_FLAG NE 1 OR X.RDB$SYSTEM_FLAG MISSING put(tdgbl, rec_trigger); const SSHORT l = PUT_TEXT (att_trig_name, X.RDB$TRIGGER_NAME); MISC_terminate (X.RDB$TRIGGER_NAME, temp, l, sizeof(temp)); BURP_verbose (156, temp); - // msg 156 writing trigger %s - + // msg 156 writing trigger %s + if (!X.RDB$RELATION_NAME.NULL) PUT_TEXT (att_trig_relation_name, X.RDB$RELATION_NAME); @@ -4099,10 +4099,10 @@ void write_triggers(void) put_source_blob (att_trig_description2, att_trig_description, X.RDB$DESCRIPTION); put_numeric (att_trig_system_flag, X.RDB$SYSTEM_FLAG); put_numeric (att_trig_inactive, X.RDB$TRIGGER_INACTIVE); - + if (!X.RDB$FLAGS.NULL) put_numeric (att_trig_flags, X.RDB$FLAGS); - + put(tdgbl, att_end); END_FOR; @@ -4113,16 +4113,16 @@ void write_triggers(void) else { FOR (REQUEST_HANDLE req_handle1) - X IN RDB$TRIGGERS WITH - X.RDB$SYSTEM_FLAG NE 1 OR + X IN RDB$TRIGGERS WITH + X.RDB$SYSTEM_FLAG NE 1 OR X.RDB$SYSTEM_FLAG MISSING put(tdgbl, rec_trigger); const SSHORT l = PUT_TEXT (att_trig_name, X.RDB$TRIGGER_NAME); MISC_terminate (X.RDB$TRIGGER_NAME, temp, l, sizeof(temp)); BURP_verbose (156, temp); - // msg 156 writing trigger %s - + // msg 156 writing trigger %s + if (!X.RDB$RELATION_NAME.NULL) PUT_TEXT (att_trig_relation_name, X.RDB$RELATION_NAME); @@ -4137,7 +4137,7 @@ void write_triggers(void) if (tdgbl->BCK_capabilities & BCK_ods8) { FOR (REQUEST_HANDLE req_handle2) - Y IN RDB$TRIGGERS WITH + Y IN RDB$TRIGGERS WITH X.RDB$TRIGGER_NAME = Y.RDB$TRIGGER_NAME if (!Y.RDB$FLAGS.NULL) @@ -4219,13 +4219,13 @@ void write_types(void) BurpGlobals* tdgbl = BurpGlobals::getSpecific(); FOR (REQUEST_HANDLE req_handle1) - X IN RDB$TYPES WITH X.RDB$SYSTEM_FLAG NE 1 OR + X IN RDB$TYPES WITH X.RDB$SYSTEM_FLAG NE 1 OR X.RDB$SYSTEM_FLAG MISSING put(tdgbl, rec_system_type); PUT_TEXT (att_type_name, X.RDB$TYPE_NAME); PUT_TEXT (att_type_field_name, X.RDB$FIELD_NAME); BURP_verbose (160, SafeArg() << X.RDB$TYPE_NAME << X.RDB$FIELD_NAME); - // msg 160 writing type %s for field %s + // msg 160 writing type %s for field %s put_numeric (att_type_type, X.RDB$TYPE); put_source_blob (att_type_description2, att_type_description, X.RDB$DESCRIPTION); if (X.RDB$SYSTEM_FLAG) diff --git a/src/burp/restore.epp b/src/burp/restore.epp index 2979934603..de68d6db18 100644 --- a/src/burp/restore.epp +++ b/src/burp/restore.epp @@ -76,7 +76,7 @@ namespace // unnamed, private const int DB_VERSION_DDL4 = 40; // ods4 db const int DB_VERSION_DDL5 = 50; // ods5 db const int DB_VERSION_DDL8 = 80; // ods8 db -const int DB_VERSION_CURRENT = DB_VERSION_DDL8; // IB4.0 is ods8 +const int DB_VERSION_CURRENT = DB_VERSION_DDL8; // IB4.0 is ods8 const int DB_VERSION_DDL9 = 90; // ods9 db, IB5 const int DB_VERSION_DDL10 = 100; // ods10 db, IB6, FB1, FB1.5 const int DB_VERSION_DDL11 = 110; // ods11 db, FB2 @@ -98,9 +98,9 @@ const int burp_msg_fac = 12; enum scan_attr_t { - NO_SKIP = 0, // Not in skipping and scanning mode - BEFORE_SKIP = 1, // After skipping, before scanning next byte for valid attribute - AFTER_SKIP = 2 // After skipping and after scanning next byte for valid attribute + NO_SKIP = 0, // Not in skipping and scanning mode + BEFORE_SKIP = 1, // After skipping, before scanning next byte for valid attribute + AFTER_SKIP = 2 // After skipping and after scanning next byte for valid attribute }; void add_files(BurpGlobals* tdgbl, const char*); @@ -165,7 +165,7 @@ void update_global_field(BurpGlobals* tdgbl); void update_view_dbkey_lengths(BurpGlobals* tdgbl); void general_on_error(); #ifdef DEBUG -UCHAR debug_on = 0; // able to turn this on in the debugger +UCHAR debug_on = 0; // able to turn this on in the debugger #endif #ifdef sparc @@ -273,7 +273,7 @@ int RESTORE_restore (const TEXT* file_name, return FINI_ERROR; BURP_verbose (76); - // msg 76 creating indexes + // msg 76 creating indexes COMMIT; ON_ERROR @@ -315,7 +315,7 @@ int RESTORE_restore (const TEXT* file_name, BURP_print(243, index_name); // msg 243 ALTER INDEX \"%s\" ACTIVE; END_FOR; - // don't bring the database on-line + // don't bring the database on-line tdgbl->flag_on_line = false; break; default: @@ -328,22 +328,22 @@ int RESTORE_restore (const TEXT* file_name, END_ERROR } END_ERROR; - // Activate the indices for foreign keys and do another commit + // Activate the indices for foreign keys and do another commit if (!tdgbl->gbl_sw_deactivate_indexes) { - // Block added to verbose index creation by Toni Martir + // Block added to verbose index creation by Toni Martir // Always try to activate deferred indices - it helps for some broken backups, // and in normal cases doesn't take much time to look for such indices. AP-2008. EXEC SQL SET TRANSACTION ISOLATION LEVEL READ COMMITTED NO_AUTO_UNDO; if (gds_status[1]) EXEC SQL SET TRANSACTION; - // Activate first indexes that are not foreign keys + // Activate first indexes that are not foreign keys FOR (REQUEST_HANDLE req_handle1) IDS IN RDB$INDICES WITH IDS.RDB$INDEX_INACTIVE EQ DEFERRED_ACTIVE AND IDS.RDB$FOREIGN_KEY MISSING - + MISC_terminate(IDS.RDB$INDEX_NAME, index_name, (ULONG) MISC_symbol_length(IDS.RDB$INDEX_NAME, sizeof(IDS.RDB$INDEX_NAME)), sizeof(index_name)); @@ -357,7 +357,7 @@ int RESTORE_restore (const TEXT* file_name, END_ERROR; SAVE - // existing ON_ERROR continues past error, beck + // existing ON_ERROR continues past error, beck ON_ERROR BURP_print (173, index_name); BURP_print_status(isc_status); @@ -386,8 +386,8 @@ int RESTORE_restore (const TEXT* file_name, * activation. * -bsriram, 11-May-1999 BUG: 10016 */ - /* In case error happens creating FK, triggers don't let set - * INACTIVE = TRUE for FK index. Therefore use separate + /* In case error happens creating FK, triggers don't let set + * INACTIVE = TRUE for FK index. Therefore use separate * transaction be able to rollback when needed. * AP, 2005 */ @@ -408,7 +408,7 @@ int RESTORE_restore (const TEXT* file_name, isc_tr_handle activateIndexTran = 0; ISC_STATUS_ARRAY local_status_vector; ISC_STATUS* local_status = local_status_vector; - + START_TRANSACTION activateIndexTran; FOR (TRANSACTION_HANDLE activateIndexTran REQUEST_HANDLE req_handle5) IND1 IN RDB$INDICES WITH IND1.RDB$INDEX_NAME EQ IDS.RDB$INDEX_NAME @@ -422,7 +422,7 @@ int RESTORE_restore (const TEXT* file_name, END_ERROR; MISC_release_request_silent(req_handle5); - if (!fError) + if (!fError) { COMMIT activateIndexTran; ON_ERROR @@ -454,11 +454,11 @@ int RESTORE_restore (const TEXT* file_name, if (tdgbl->global_trans) { BURP_verbose (68); - // msg 68 committing meta data + // msg 68 committing meta data EXEC SQL COMMIT TRANSACTION tdgbl->global_trans; if (gds_status[1]) general_on_error (); - // Check to see if there is a warning + // Check to see if there is a warning if (gds_status[0] == isc_arg_gds && gds_status[1] == 0 && gds_status[2] != isc_arg_end) { @@ -509,7 +509,7 @@ int RESTORE_restore (const TEXT* file_name, MISC_release_request_silent(req_handle4); - // Change ownership of any relations necessary + // Change ownership of any relations necessary for (burp_rel* relation = tdgbl->relations; relation; relation = relation->rel_next) { @@ -541,7 +541,7 @@ int RESTORE_restore (const TEXT* file_name, /* Now that changing ownership of tables is over, it is safe to update the database security class in RDB$DATABASE */ - if (tdgbl->database_security_class[0]) // Do it only if it's not NULL + if (tdgbl->database_security_class[0]) // Do it only if it's not NULL { FOR (REQUEST_HANDLE req_handle1) X IN RDB$DATABASE @@ -567,7 +567,7 @@ int RESTORE_restore (const TEXT* file_name, general_on_error (); END_ERROR; - // Check to see if there is a warning + // Check to see if there is a warning if (gds_status[0] == isc_arg_gds && gds_status[1] == 0 && gds_status[2] != isc_arg_end) { @@ -575,17 +575,17 @@ int RESTORE_restore (const TEXT* file_name, } BURP_verbose (88); - // msg 88 finishing, closing, and going home + // msg 88 finishing, closing, and going home FB_UINT64 cumul_count = MVOL_fini_read(); - // Close database before we attach to it again. + // Close database before we attach to it again. FINISH ON_ERROR general_on_error (); END_ERROR; - // attach database again to put it online + // attach database again to put it online Firebird::ClumpletWriter dpb(Firebird::ClumpletReader::Tagged, MAX_DPB_SIZE, isc_dpb_version1); tdgbl->uSvc->getAddressPath(dpb); @@ -597,20 +597,20 @@ int RESTORE_restore (const TEXT* file_name, if (tdgbl->gbl_sw_user) { - dpb.insertString(isc_dpb_user_name, - tdgbl->gbl_sw_user, + dpb.insertString(isc_dpb_user_name, + tdgbl->gbl_sw_user, strlen(tdgbl->gbl_sw_user)); } if (tdgbl->gbl_sw_password) { - dpb.insertString(tdgbl->uSvc->isService() ? + dpb.insertString(tdgbl->uSvc->isService() ? isc_dpb_password_enc : isc_dpb_password, - tdgbl->gbl_sw_password, + tdgbl->gbl_sw_password, strlen(tdgbl->gbl_sw_password)); } if (tdgbl->gbl_sw_tr_user) { - dpb.insertString(isc_dpb_trusted_auth, + dpb.insertString(isc_dpb_trusted_auth, tdgbl->gbl_sw_tr_user, strlen(tdgbl->gbl_sw_tr_user)); } @@ -621,7 +621,7 @@ int RESTORE_restore (const TEXT* file_name, FB_API_HANDLE db_handle = 0; if (isc_attach_database (tdgbl->status_vector, 0, database_name, - &db_handle, dpb.getBufferLength(), + &db_handle, dpb.getBufferLength(), reinterpret_cast(dpb.getBuffer()))) { general_on_error(); @@ -632,35 +632,35 @@ int RESTORE_restore (const TEXT* file_name, if (!tdgbl->flag_on_line) { BURP_print(246); - // msg 246 Database is not online due to failure to activate one or more indices. + // msg 246 Database is not online due to failure to activate one or more indices. BURP_print(247); - // msg 247 Run gfix -online to bring database online without active indices. + // msg 247 Run gfix -online to bring database online without active indices. return FINI_DB_NOT_ONLINE; } - // If the database is to be restored ReadOnly, set it to read_only now! + // If the database is to be restored ReadOnly, set it to read_only now! if (tdgbl->gbl_sw_mode && tdgbl->gbl_sw_mode_val) { BURP_verbose (280); - // msg 280: setting database to read-only access + // msg 280: setting database to read-only access dpb.reset(isc_dpb_version1); if (tdgbl->gbl_sw_user) { - dpb.insertString(isc_dpb_user_name, - tdgbl->gbl_sw_user, + dpb.insertString(isc_dpb_user_name, + tdgbl->gbl_sw_user, strlen(tdgbl->gbl_sw_user)); } if (tdgbl->gbl_sw_password) { - dpb.insertString(tdgbl->uSvc->isService() ? + dpb.insertString(tdgbl->uSvc->isService() ? isc_dpb_password_enc : isc_dpb_password, - tdgbl->gbl_sw_password, + tdgbl->gbl_sw_password, strlen(tdgbl->gbl_sw_password)); } if (tdgbl->gbl_sw_tr_user) { - dpb.insertString(isc_dpb_trusted_auth, + dpb.insertString(isc_dpb_trusted_auth, tdgbl->gbl_sw_tr_user, strlen(tdgbl->gbl_sw_tr_user)); } @@ -668,7 +668,7 @@ int RESTORE_restore (const TEXT* file_name, dpb.insertByte(isc_dpb_no_db_triggers, 1); if (isc_attach_database (tdgbl->status_vector, 0, database_name, - &db_handle, dpb.getBufferLength(), + &db_handle, dpb.getBufferLength(), reinterpret_cast(dpb.getBuffer()))) { general_on_error(); @@ -721,7 +721,7 @@ void add_files(BurpGlobals* tdgbl, END_ERROR; MISC_release_request_silent(req_handle1); BURP_verbose (57, SafeArg() << file->fil_name.c_str() << start); - // msg 57 adding file %s, starting at page %ld + // msg 57 adding file %s, starting at page %ld } else if (((SLONG) file->fil_length) >= start - 1) file->fil_length -= start - 1; @@ -784,7 +784,7 @@ void bad_attribute(scan_attr_t scan_next_attr, TEXT t_name[128]; fb_msg_format(NULL, burp_msg_fac, type, sizeof(t_name), t_name, dummy); BURP_print (80, SafeArg() << t_name << int(bad_attr)); - // msg 80 don't recognize %s attribute %ld -- continuing + // msg 80 don't recognize %s attribute %ld -- continuing int skip_l = get(tdgbl); if (skip_l) get_skip(tdgbl, skip_l); @@ -796,13 +796,13 @@ void bad_attribute(scan_attr_t scan_next_attr, skip_count = tdgbl->gbl_sw_skip_count; get_skip(tdgbl, skip_count); BURP_print (203, SafeArg() << skip_count << int(bad_attr)); - //msg 203: skipped %d bytes after reading a bad attribute %d + //msg 203: skipped %d bytes after reading a bad attribute %d } else { ++skip_count; BURP_print (205, SafeArg() << skip_count << int(bad_attr)); - // msg 205: skipped %d bytes looking for next valid attribute, encountered attribute %d + // msg 205: skipped %d bytes looking for next valid attribute, encountered attribute %d } scan_next_attr = AFTER_SKIP; } @@ -850,7 +850,7 @@ void check_db_version(BurpGlobals* tdgbl) END_ERROR; } MISC_release_request_silent(req_handle); - + if (tdgbl->RESTORE_ods < DB_VERSION_DDL8) return; @@ -862,7 +862,7 @@ void check_db_version(BurpGlobals* tdgbl) {"RDB$PROCEDURE_PARAMETERS", "RDB$FIELD_NAME", DB_VERSION_DDL11_2}, // FB2.5 {0, 0, 0} }; - + isc_req_handle req_handle2 = 0; for (const rel_field_t* rf = rel_fields; rf->rel; ++rf) { @@ -895,7 +895,7 @@ void create_database(BurpGlobals* tdgbl, * **************************************/ - // Get (physical) database record + // Get (physical) database record ULONG page_size = DEFAULT_PAGE_SIZE; // sweep_interval = -1; @@ -959,13 +959,13 @@ void create_database(BurpGlobals* tdgbl, if (record != rec_database) BURP_error_redirect (NULL, 32); - // msg 32 Expected database description record + // msg 32 Expected database description record if (tdgbl->gbl_sw_page_size && (tdgbl->gbl_sw_page_size < page_size)) { BURP_print (110, SafeArg() << page_size << tdgbl->gbl_sw_page_size); - // msg 110 Reducing the database page size from %ld bytes to %ld bytes + // msg 110 Reducing the database page size from %ld bytes to %ld bytes } if (tdgbl->gbl_sw_page_size) @@ -976,7 +976,7 @@ void create_database(BurpGlobals* tdgbl, if (tdgbl->gbl_sw_no_reserve) no_reserve = tdgbl->gbl_sw_no_reserve; - // Override attribute setting with user requirement + // Override attribute setting with user requirement if (tdgbl->gbl_sw_mode) db_read_only = tdgbl->gbl_sw_mode_val; else @@ -1001,27 +1001,27 @@ void create_database(BurpGlobals* tdgbl, dpb.insertInt(isc_dpb_sweep_interval, sweep_interval); } - // If the database is to be restored "read_only", fillup the data pages + // If the database is to be restored "read_only", fillup the data pages if (no_reserve || db_read_only) { dpb.insertByte(isc_dpb_no_reserve, 1); } if (tdgbl->gbl_sw_user) { - dpb.insertString(isc_dpb_user_name, - tdgbl->gbl_sw_user, + dpb.insertString(isc_dpb_user_name, + tdgbl->gbl_sw_user, strlen(tdgbl->gbl_sw_user)); } if (tdgbl->gbl_sw_password) { - dpb.insertString(tdgbl->uSvc->isService() ? + dpb.insertString(tdgbl->uSvc->isService() ? isc_dpb_password_enc : isc_dpb_password, - tdgbl->gbl_sw_password, + tdgbl->gbl_sw_password, strlen(tdgbl->gbl_sw_password)); } if (tdgbl->gbl_sw_tr_user) { - dpb.insertString(isc_dpb_trusted_auth, + dpb.insertString(isc_dpb_trusted_auth, tdgbl->gbl_sw_tr_user, strlen(tdgbl->gbl_sw_tr_user)); } if (page_buffers) @@ -1029,7 +1029,7 @@ void create_database(BurpGlobals* tdgbl, dpb.insertInt(isc_dpb_set_page_buffers, page_buffers); } - // Turn off sync writes during restore + // Turn off sync writes during restore dpb.insertByte(isc_dpb_force_write, 0); /* @@ -1041,7 +1041,7 @@ void create_database(BurpGlobals* tdgbl, */ dpb.insertByte(isc_dpb_sql_dialect, SQL_dialect_flag ? SQL_dialect : SQL_DIALECT_V5); - // start database up shut down, + // start database up shut down, // use single-user mode to avoid conflicts during restore process dpb.insertByte(isc_dpb_shutdown, isc_dpb_shut_attachment | isc_dpb_shut_single); dpb.insertInt(isc_dpb_shutdown_delay, 0); @@ -1058,23 +1058,23 @@ void create_database(BurpGlobals* tdgbl, } if (isc_create_database (status_vector, 0, file_name, - &DB, dpb.getBufferLength(), - reinterpret_cast(dpb.getBuffer()), + &DB, dpb.getBufferLength(), + reinterpret_cast(dpb.getBuffer()), 0)) { BURP_error_redirect (status_vector, 33, SafeArg() << file_name); - // msg 33 failed to create database %s + // msg 33 failed to create database %s } if (tdgbl->gbl_sw_version) { BURP_print(139, file_name); - // msg 139 Version(s) for database "%s" + // msg 139 Version(s) for database "%s" isc_version(&DB, BURP_output_version, (void*)"\t%s\n"); } BURP_verbose (74, SafeArg() << file_name << page_size); - // msg 74 created database %s, page_size %ld bytes + // msg 74 created database %s, page_size %ld bytes } void decompress(BurpGlobals* tdgbl, @@ -1096,8 +1096,8 @@ void decompress(BurpGlobals* tdgbl, while (p < end) { - // This change was made to restore National Semi-Conductor's corrupted - // gbak file and it is in the code base now. -Andrew + // This change was made to restore National Semi-Conductor's corrupted + // gbak file and it is in the code base now. -Andrew // so count really only to 255 SSHORT count = (SCHAR) get(tdgbl); @@ -1106,7 +1106,7 @@ void decompress(BurpGlobals* tdgbl, if (end - p < count) { BURP_print (202, SafeArg() << count << (end - p)); - // msg 202: adjusting a decompression length error: invalid length %d was adjusted to %d + // msg 202: adjusting a decompression length error: invalid length %d was adjusted to %d count = end - p; } p = get_block(tdgbl, p, count); @@ -1116,7 +1116,7 @@ void decompress(BurpGlobals* tdgbl, if (end + count < p) { BURP_print(202, SafeArg() << count << (p - end)); - // msg 202: adjusting a decompression length error: invalid length %d was adjusted to %d + // msg 202: adjusting a decompression length error: invalid length %d was adjusted to %d count = p - end; } const UCHAR c = get(tdgbl); @@ -1127,7 +1127,7 @@ void decompress(BurpGlobals* tdgbl, if (p > end) { BURP_error_redirect (NULL, 34); - // msg 34 RESTORE: decompression length error + // msg 34 RESTORE: decompression length error } } @@ -1186,7 +1186,7 @@ burp_rel* find_relation(BurpGlobals* tdgbl, } BURP_error_redirect (NULL, 35, SafeArg() << name); - // msg 35 can't find relation %s + // msg 35 can't find relation %s return NULL; } @@ -1240,21 +1240,21 @@ bool get_acl(BurpGlobals* tdgbl, if (!blob_id->gds_quad_high && !blob_id->gds_quad_low) return false; - // Open the blob and get it's vital statistics + // Open the blob and get it's vital statistics ISC_STATUS_ARRAY status_vector; UserBlob blob(status_vector); if (! blob.open(DB, gds_trans, *blob_id)) { - // msg 24 isc_open_blob failed + // msg 24 isc_open_blob failed BURP_error_redirect (status_vector, 24); } UCHAR blob_info[32]; if (!blob.getInfo(sizeof(blr_items), blr_items, sizeof(blob_info), blob_info)) { - // msg 20 isc_blob_info failed + // msg 20 isc_blob_info failed BURP_error_redirect (status_vector, 20); } @@ -1293,7 +1293,7 @@ bool get_acl(BurpGlobals* tdgbl, break; default: - // msg 79 don't understand blob info item %ld + // msg 79 don't understand blob info item %ld BURP_print (79, SafeArg() << int(item)); // CVC: do you return, without closing the blob, dear function??? if (!blob.close()) @@ -1310,12 +1310,12 @@ bool get_acl(BurpGlobals* tdgbl, if (!blob.close()) { BURP_error_redirect (status_vector, 23); - // msg 23 isc_close_blob failed + // msg 23 isc_close_blob failed } return false; } - // Rdb sometimes gets the length messed up + // Rdb sometimes gets the length messed up if (length < max_segment) length = max_segment; @@ -1338,7 +1338,7 @@ bool get_acl(BurpGlobals* tdgbl, if (!blob.close()) { - // msg 23 isc_close_blob failed + // msg 23 isc_close_blob failed BURP_error_redirect (status_vector, 23); } @@ -1353,11 +1353,11 @@ bool get_acl(BurpGlobals* tdgbl, from = buffer; UCHAR* to = new_buffer; - *to++ = *from++; // copy ACL_verion - *to++ = *from++; // copy ACL_id_list - *to++ = *from++; // copy id_person + *to++ = *from++; // copy ACL_verion + *to++ = *from++; // copy ACL_id_list + *to++ = *from++; // copy id_person *to++ = owner_nm_len; - + size_t new_len = 4; //new_len + 4; Previously, new_len was set to zero at the top // from = buffer + id_person_len + 4; redundant, see 2nd loop below. for (SLONG cnt = 0; cnt < owner_nm_len; cnt++) @@ -1375,19 +1375,19 @@ bool get_acl(BurpGlobals* tdgbl, if (!blob.create(DB, gds_trans, *new_blob_id)) { - // msg 37 isc_create_blob failed + // msg 37 isc_create_blob failed BURP_error_redirect (status_vector, 37); } if (!blob.putData(new_len, new_buffer)) { - // msg 38 isc_put_segment failed + // msg 38 isc_put_segment failed BURP_error_redirect (status_vector, 38); } if (!blob.close()) { - // msg 23 isc_close_blob failed + // msg 23 isc_close_blob failed BURP_error_redirect (status_vector, 23); } @@ -1420,7 +1420,7 @@ void get_array(BurpGlobals* tdgbl, lstring xdr_buffer; xdr_buffer.lstr_allocated = 0; - // Pick up attributes + // Pick up attributes SLONG fld_ranges[2 * MAX_DIMENSION]; SLONG slice_length = 0; SLONG *range; @@ -1440,7 +1440,7 @@ void get_array(BurpGlobals* tdgbl, } if (!field) { BURP_error_redirect (NULL, 36); - // msg 36 Can't find field for blob + // msg 36 Can't find field for blob } field_length = field->fld_length; @@ -1461,12 +1461,12 @@ void get_array(BurpGlobals* tdgbl, { if (get_attribute(&attribute, tdgbl) != att_array_range_low) bad_attribute (scan_next_attr, attribute, 58); - // msg 58 array + // msg 58 array else range[0] = get_numeric(tdgbl); if (get_attribute(&attribute, tdgbl) != att_array_range_high) bad_attribute (scan_next_attr, attribute, 58); - // msg 58 array + // msg 58 array else range[1] = get_numeric(tdgbl); slice_length *= (range[1] - range[0] + 1); @@ -1475,7 +1475,7 @@ void get_array(BurpGlobals* tdgbl, default: bad_attribute (scan_next_attr, attribute, 58); - // msg 58 array + // msg 58 array break; } } @@ -1520,7 +1520,7 @@ void get_array(BurpGlobals* tdgbl, (last_element_dim[i1] - field->fld_ranges[i3]) * divisor; i3 += 2; } - + int current_dim; #ifdef DEBUG fprintf(stderr, "\nLast element upper bounds read from backup file:\n"); @@ -1548,7 +1548,7 @@ void get_array(BurpGlobals* tdgbl, UCHAR* blr = blr_buffer; bool dont_write = false; - // build the sdl + // build the sdl add_byte(blr, isc_sdl_version1); @@ -1579,7 +1579,7 @@ void get_array(BurpGlobals* tdgbl, add_byte(blr, isc_sdl_field); add_string(blr, field->fld_name); - // each element spec starts here + // each element spec starts here #ifdef DEBUG fprintf(stderr, "\nBounds written["); @@ -1725,7 +1725,7 @@ void get_array(BurpGlobals* tdgbl, if (tdgbl->gbl_sw_transportable) { if (get_attribute(&attribute, tdgbl) != att_xdr_array) - // msg 55 Expected XDR record length + // msg 55 Expected XDR record length BURP_error_redirect (NULL, 55); else { @@ -1755,13 +1755,13 @@ void get_array(BurpGlobals* tdgbl, if (isc_put_slice (status_vector, &DB, &gds_trans, blob_id, blr_length, reinterpret_cast(blr_buffer), - 0, // param length for subset of an array handling - NULL, // param for subset of an array handling + 0, // param length for subset of an array handling + NULL, // param for subset of an array handling elements_written * field->fld_length, buffer + data_at)) { BURP_print (81, field->fld_name); - // msg 81 error accessing blob field %s -- continuing + // msg 81 error accessing blob field %s -- continuing BURP_print_status (status_vector); #ifdef DEBUG PRETTY_print_sdl (blr_buffer, NULL, NULL, 0); @@ -1778,7 +1778,7 @@ void get_array(BurpGlobals* tdgbl, { /** This is the regular case we've got the entire array **/ UCHAR* blr = blr_buffer; - // build the sdl + // build the sdl add_byte(blr, isc_sdl_version1); @@ -1809,7 +1809,7 @@ void get_array(BurpGlobals* tdgbl, add_byte(blr, isc_sdl_field); add_string(blr, field->fld_name); - // each element spec starts here + // each element spec starts here for (range = fld_ranges, count = 0; range < end_ranges; range += 2, count++) { @@ -1848,7 +1848,7 @@ void get_array(BurpGlobals* tdgbl, { if (get_attribute(&attribute, tdgbl) != att_xdr_array) BURP_error_redirect (NULL, 55); - // msg 55 Expected XDR record length + // msg 55 Expected XDR record length else { xdr_buffer.lstr_allocated = get(tdgbl); @@ -1878,12 +1878,12 @@ void get_array(BurpGlobals* tdgbl, if (isc_put_slice (status_vector, &DB, &gds_trans, blob_id, blr_length, reinterpret_cast(blr_buffer), - 0, // param length for subset of an array handling - NULL, // param for subset of an array handling + 0, // param length for subset of an array handling + NULL, // param for subset of an array handling return_length, buffer)) { BURP_print (81, field->fld_name); - // msg 81 error accessing blob field %s -- continuing + // msg 81 error accessing blob field %s -- continuing BURP_print_status (status_vector); #ifdef DEBUG PRETTY_print_sdl (blr_buffer, NULL, NULL, 0); @@ -1913,7 +1913,7 @@ void get_blob(BurpGlobals* tdgbl, * **************************************/ - // Pick up attributes + // Pick up attributes ULONG segments = 0; USHORT field_number = MAX_USHORT; @@ -1945,12 +1945,12 @@ void get_blob(BurpGlobals* tdgbl, default: bad_attribute(scan_next_attr, attribute, 64); - // msg 64 blob + // msg 64 blob break; } } - // Find the field associated with the blob + // Find the field associated with the blob const burp_fld* field; for (field = fields; field; field = field->fld_next) { if (field->fld_number == field_number) @@ -1959,10 +1959,10 @@ void get_blob(BurpGlobals* tdgbl, if (!field) { BURP_error_redirect (NULL, 36); - // msg 36 Can't find field for blob + // msg 36 Can't find field for blob } - // Create new blob + // Create new blob ISC_QUAD* blob_id = (ISC_QUAD*) ((UCHAR*) record_buffer + field->fld_offset); ISC_STATUS_ARRAY status_vector; @@ -1972,14 +1972,14 @@ void get_blob(BurpGlobals* tdgbl, if (!blob.create(DB, gds_trans, *blob_id, sizeof(blob_desc), blob_desc)) { BURP_error_redirect (status_vector, 37); - // msg 37 isc_create_blob failed + // msg 37 isc_create_blob failed } // Allocate blob buffer if static buffer is too short BlobBuffer static_buffer; UCHAR* buffer = static_buffer.getBuffer(max_segment); - // Eat up blob segments + // Eat up blob segments for (; segments > 0; --segments ) { @@ -1998,7 +1998,7 @@ void get_blob(BurpGlobals* tdgbl, if (!blob.close()) BURP_error_redirect (status_vector, 23); - // msg 23 isc_close_blob failed + // msg 23 isc_close_blob failed } @@ -2020,7 +2020,7 @@ void get_blr_blob(BurpGlobals* tdgbl, size_t length = get_numeric(tdgbl); - // Create new blob + // Create new blob isc_tr_handle local_trans; if (glb_trans && tdgbl->global_trans) @@ -2033,7 +2033,7 @@ void get_blr_blob(BurpGlobals* tdgbl, if (!blob.create(DB, local_trans, blob_id)) { BURP_error_redirect (status_vector, 37); - // msg 37 isc_create_blob failed + // msg 37 isc_create_blob failed } BlobBuffer static_buffer; @@ -2042,7 +2042,7 @@ void get_blr_blob(BurpGlobals* tdgbl, if (length) { UCHAR* p = get_block(tdgbl, buffer, length); - // Make sure it has an eoc + // Make sure it has an eoc if (p[-1] != blr_eoc) { p[0] = blr_eoc; length++; @@ -2052,12 +2052,12 @@ void get_blr_blob(BurpGlobals* tdgbl, if (!blob.putData(length, buffer)) { BURP_error_redirect (status_vector, 38); - // msg 38 isc_put_segment failed + // msg 38 isc_put_segment failed } if (!blob.close()) BURP_error_redirect (status_vector, 23); - // msg 23 isc_close_blob failed + // msg 23 isc_close_blob failed } bool get_character_set(BurpGlobals* tdgbl) @@ -2279,7 +2279,7 @@ bool get_collation(BurpGlobals* tdgbl) X.RDB$COLLATION_ATTRIBUTES = (USHORT) get_numeric(tdgbl); break; - case att_coll_subtype: // No longer used: 93-11-15 DBS + case att_coll_subtype: // No longer used: 93-11-15 DBS // still present to handle V4 R&D gbak files get_numeric(tdgbl); break; @@ -2372,7 +2372,7 @@ bool get_collation(BurpGlobals* tdgbl) X.RDB$COLLATION_ATTRIBUTES = (USHORT) get_numeric(tdgbl); break; - case att_coll_subtype: // No longer used: 93-11-15 DBS + case att_coll_subtype: // No longer used: 93-11-15 DBS // still present to handle V4 R&D gbak files get_numeric(tdgbl); break; @@ -2442,7 +2442,7 @@ rec_type get_data(BurpGlobals* tdgbl, if (tdgbl->gbl_sw_meta) return ignore_data(tdgbl, relation); - // Start by counting the interesting fields + // Start by counting the interesting fields RCRD_OFFSET offset = 0; ULONG length = 0; @@ -2461,7 +2461,7 @@ rec_type get_data(BurpGlobals* tdgbl, if (tdgbl->RESTORE_format >= 2) count += count; - // Time to generate blr to store data. Whoppee. + // Time to generate blr to store data. Whoppee. UCHAR* const blr_buffer = (UCHAR*) BURP_alloc (200 + length + count * 18); UCHAR* blr = blr_buffer; @@ -2469,8 +2469,8 @@ rec_type get_data(BurpGlobals* tdgbl, add_byte(blr, blr_version4); add_byte(blr, blr_begin); add_byte(blr, blr_message); - add_byte(blr, 0); // Message number - add_word(blr, count); // Number of fields, counting eof + add_byte(blr, 0); // Message number + add_word(blr, count); // Number of fields, counting eof // Let's reset count. count = 0; @@ -2480,7 +2480,7 @@ rec_type get_data(BurpGlobals* tdgbl, if (field->fld_flags & FLD_computed) continue; - // arrays are of various fld_types but are really blobs + // arrays are of various fld_types but are really blobs SSHORT dtype = field->fld_type; length = field->fld_length; @@ -2554,7 +2554,7 @@ rec_type get_data(BurpGlobals* tdgbl, default: BURP_error(26, true, SafeArg() << field->fld_type); - // msg 26 datatype %ld not understood + // msg 26 datatype %ld not understood break; } if (alignment) @@ -2564,7 +2564,7 @@ rec_type get_data(BurpGlobals* tdgbl, offset += length; } - // If this is format version 2, build fields for null flags + // If this is format version 2, build fields for null flags if (tdgbl->RESTORE_format >= 2) for (field = relation->rel_fields; field; field = field->fld_next) @@ -2580,14 +2580,14 @@ rec_type get_data(BurpGlobals* tdgbl, length = offset; - // Build STORE statement + // Build STORE statement add_byte(blr, blr_receive); add_byte(blr, 0); add_byte(blr, blr_store); add_byte(blr, blr_relation); add_string(blr, relation->rel_name); - add_byte(blr, 0); // context variable + add_byte(blr, 0); // context variable add_byte(blr, blr_begin); for (field = relation->rel_fields; field; field = field->fld_next) @@ -2617,7 +2617,7 @@ rec_type get_data(BurpGlobals* tdgbl, add_byte(blr, blr_end); add_byte(blr, blr_eoc); - // Compile request + // Compile request #ifdef DEBUG isc_print_blr (reinterpret_cast(blr_buffer), NULL, NULL, 0); @@ -2633,7 +2633,7 @@ rec_type get_data(BurpGlobals* tdgbl, isc_print_blr(reinterpret_cast(blr_buffer), NULL, NULL, 0); if (!tdgbl->gbl_sw_incremental) BURP_error_redirect (status_vector, 27); - // msg 27 isc_compile_request failed + // msg 27 isc_compile_request failed else { BURP_print_status (status_vector); @@ -2646,8 +2646,8 @@ rec_type get_data(BurpGlobals* tdgbl, SSHORT* buffer = NULL; BURP_verbose (124, relation->rel_name); - // msg 124 restoring data for relation %s - + // msg 124 restoring data for relation %s + lstring data; data.lstr_allocated = 0; data.lstr_address = NULL; @@ -2660,7 +2660,7 @@ rec_type get_data(BurpGlobals* tdgbl, { if (get(tdgbl) != att_data_length) BURP_error_redirect (NULL, 39); - // msg 39 expected record length + // msg 39 expected record length USHORT l = (USHORT) get_numeric(tdgbl); if (!tdgbl->gbl_sw_transportable && l != length) { @@ -2669,7 +2669,7 @@ rec_type get_data(BurpGlobals* tdgbl, if (l != old_length) { BURP_error(40, true, SafeArg() << length << l); - // msg 40 wrong length record, expected %ld encountered %ld + // msg 40 wrong length record, expected %ld encountered %ld } } if (!buffer) { @@ -2681,7 +2681,7 @@ rec_type get_data(BurpGlobals* tdgbl, { if (get(tdgbl) != att_xdr_length) BURP_error_redirect (NULL, 55); - // msg 55 Expected XDR record length + // msg 55 Expected XDR record length else { data.lstr_length = l = (USHORT) get_numeric(tdgbl); @@ -2699,7 +2699,7 @@ rec_type get_data(BurpGlobals* tdgbl, p = reinterpret_cast(buffer); if (get(tdgbl) != att_data_data) BURP_error_redirect (NULL, 41); - // msg 41 expected data attribute + // msg 41 expected data attribute if (tdgbl->gbl_sw_compress) decompress (tdgbl, p, l); @@ -2751,23 +2751,23 @@ rec_type get_data(BurpGlobals* tdgbl, if (tdgbl->gbl_sw_incremental) { BURP_print (138, relation->rel_name); - // msg 138 validation error on field in relation %s + // msg 138 validation error on field in relation %s BURP_print_status (status_vector); } else BURP_error_redirect (status_vector, 47); - // msg 47 warning -- record could not be restored + // msg 47 warning -- record could not be restored } else { if (tdgbl->gbl_sw_incremental) { BURP_print (114, relation->rel_name); - // msg 114 restore failed for record in relation %s + // msg 114 restore failed for record in relation %s BURP_print_status (status_vector); } else BURP_error_redirect (status_vector, 48); - // msg 48 isc_send failed + // msg 48 isc_send failed } } if (record != rec_data) @@ -2782,9 +2782,9 @@ rec_type get_data(BurpGlobals* tdgbl, if (tdgbl->gbl_sw_incremental) { BURP_verbose (72, relation->rel_name); - // msg 72 committing data for relation %s + // msg 72 committing data for relation %s COMMIT - // existing ON_ERROR continues past error, beck + // existing ON_ERROR continues past error, beck ON_ERROR /* Fix for bug_no 8055: @@ -2823,9 +2823,9 @@ rec_type get_data(BurpGlobals* tdgbl, /* msg 243 ALTER INDEX \"%s\" ACTIVE; */ END_MODIFY; END_FOR; - // don't bring the database on-line + // don't bring the database on-line tdgbl->flag_on_line = false; - // commit one more time + // commit one more time COMMIT ON_ERROR continue; @@ -2833,15 +2833,15 @@ rec_type get_data(BurpGlobals* tdgbl, break; default: BURP_print (69, relation->rel_name); - // msg 69 commit failed on relation %s + // msg 69 commit failed on relation %s BURP_print_status (tdgbl->status_vector); ROLLBACK; ON_ERROR general_on_error (); END_ERROR; break; - } // end of switch - } // end of while + } // end of switch + } // end of while END_ERROR; EXEC SQL SET TRANSACTION NO_AUTO_UNDO; @@ -2849,7 +2849,7 @@ rec_type get_data(BurpGlobals* tdgbl, EXEC SQL SET TRANSACTION; } BURP_verbose (107, SafeArg() << records); - // msg 107 %ld records restored + // msg 107 %ld records restored return record; } @@ -2877,7 +2877,7 @@ bool get_exception(BurpGlobals* tdgbl) X.RDB$MESSAGE.NULL = TRUE; X.RDB$SYSTEM_FLAG = 0; X.RDB$SYSTEM_FLAG.NULL = FALSE; - + skip_init(&scan_next_attr); while (skip_scan(&scan_next_attr), get_attribute(&attribute, tdgbl) != att_end) { @@ -2887,7 +2887,7 @@ bool get_exception(BurpGlobals* tdgbl) l = GET_TEXT(X.RDB$EXCEPTION_NAME); MISC_terminate (X.RDB$EXCEPTION_NAME, temp, l, sizeof(temp)); BURP_verbose (199, temp); - // msg 199 restoring exception %s + // msg 199 restoring exception %s break; case att_exception_description: @@ -3225,7 +3225,7 @@ bool get_files(BurpGlobals* tdgbl) case att_file_filename: GET_TEXT(X.RDB$FILE_NAME); BURP_verbose (116, X.RDB$FILE_NAME); - // msg 116 restoring file %s + // msg 116 restoring file %s break; case att_file_sequence: @@ -3252,7 +3252,7 @@ bool get_files(BurpGlobals* tdgbl) default: bad_attribute (scan_next_attr, attribute, 85); - // msg 85 file + // msg 85 file break; } } @@ -3284,7 +3284,7 @@ bool get_filter(BurpGlobals* tdgbl) X.RDB$DESCRIPTION.NULL = TRUE; X.RDB$SYSTEM_FLAG = 0; X.RDB$SYSTEM_FLAG.NULL = FALSE; - + skip_init(&scan_next_attr); while (skip_scan(&scan_next_attr), get_attribute(&attribute, tdgbl) != att_end) { @@ -3293,7 +3293,7 @@ bool get_filter(BurpGlobals* tdgbl) case att_filter_name: GET_TEXT(X.RDB$FUNCTION_NAME); BURP_verbose (117, X.RDB$FUNCTION_NAME); - // msg 117 restoring filter %s + // msg 117 restoring filter %s break; case att_filter_description: @@ -3324,7 +3324,7 @@ bool get_filter(BurpGlobals* tdgbl) default: bad_attribute (scan_next_attr, attribute, 87); - // msg 87 filter + // msg 87 filter break; } } @@ -3361,7 +3361,7 @@ bool get_function(BurpGlobals* tdgbl) X.RDB$SYSTEM_FLAG = 0; X.RDB$SYSTEM_FLAG.NULL = FALSE; X.RDB$DESCRIPTION.NULL = TRUE; - + skip_init(&scan_next_attr); while (skip_scan(&scan_next_attr), get_attribute(&attribute, tdgbl) != att_end) { @@ -3371,7 +3371,7 @@ bool get_function(BurpGlobals* tdgbl) l = GET_TEXT(X.RDB$FUNCTION_NAME); MISC_terminate (X.RDB$FUNCTION_NAME, temp, l, sizeof(temp)); BURP_verbose (118, temp); - // msg 118 restoring function %s + // msg 118 restoring function %s break; case att_function_description: @@ -3406,7 +3406,7 @@ bool get_function(BurpGlobals* tdgbl) default: bad_attribute (scan_next_attr, attribute, 89); - // msg 89 function + // msg 89 function break; } } @@ -3423,7 +3423,7 @@ bool get_function(BurpGlobals* tdgbl) } END_ERROR; - // at the end of args for a function is the rec_function_end marker + // at the end of args for a function is the rec_function_end marker while (get(tdgbl) == rec_function_arg) get_function_arg(tdgbl, existFlag); @@ -3446,7 +3446,7 @@ void get_function_arg(BurpGlobals* tdgbl, bool skip_arguments) SSHORT l; TEXT temp[GDS_NAME_LEN]; scan_attr_t scan_next_attr; - + if (skip_arguments) { char buf[MAX_SQL_IDENTIFIER_SIZE]; @@ -3493,7 +3493,7 @@ void get_function_arg(BurpGlobals* tdgbl, bool skip_arguments) default: bad_attribute (scan_next_attr, attribute, 90); - // msg 90 function argument + // msg 90 function argument break; } } @@ -3502,7 +3502,7 @@ void get_function_arg(BurpGlobals* tdgbl, bool skip_arguments) if (tdgbl->RESTORE_ods >= DB_VERSION_DDL10) { - // with RDB$FIELD_PRECISION + // with RDB$FIELD_PRECISION STORE (REQUEST_HANDLE tdgbl->handles_get_function_arg_req_handle1) X IN RDB$FUNCTION_ARGUMENTS X.RDB$FIELD_SUB_TYPE.NULL = TRUE; @@ -3518,7 +3518,7 @@ void get_function_arg(BurpGlobals* tdgbl, bool skip_arguments) l = GET_TEXT(X.RDB$FUNCTION_NAME); MISC_terminate (X.RDB$FUNCTION_NAME, temp, l, sizeof(temp)); BURP_verbose (119, temp); - // msg 119 restoring argument for function %s + // msg 119 restoring argument for function %s break; case att_functionarg_position: @@ -3563,7 +3563,7 @@ void get_function_arg(BurpGlobals* tdgbl, bool skip_arguments) default: bad_attribute (scan_next_attr, attribute, 90); - // msg 90 function argument + // msg 90 function argument break; } } @@ -3574,7 +3574,7 @@ void get_function_arg(BurpGlobals* tdgbl, bool skip_arguments) } else { - // without RDB$FIELD_PRECISION + // without RDB$FIELD_PRECISION STORE (REQUEST_HANDLE tdgbl->handles_get_function_arg_req_handle1) X IN RDB$FUNCTION_ARGUMENTS X.RDB$FIELD_SUB_TYPE.NULL = TRUE; @@ -3589,7 +3589,7 @@ void get_function_arg(BurpGlobals* tdgbl, bool skip_arguments) l = GET_TEXT(X.RDB$FUNCTION_NAME); MISC_terminate (X.RDB$FUNCTION_NAME, temp, l, sizeof(temp)); BURP_verbose (119, temp); - // msg 119 restoring argument for function %s + // msg 119 restoring argument for function %s break; case att_functionarg_position: @@ -3630,7 +3630,7 @@ void get_function_arg(BurpGlobals* tdgbl, bool skip_arguments) default: bad_attribute (scan_next_attr, attribute, 90); - // msg 90 function argument + // msg 90 function argument break; } } @@ -3663,10 +3663,10 @@ bool get_generator(BurpGlobals* tdgbl) scan_attr_t scan_next_attr; skip_init(&scan_next_attr); - + ISC_QUAD gen_desc = {0, 0}; bool got_desc = false; - + while (skip_scan(&scan_next_attr), get_attribute(&attribute, tdgbl) != att_end) { switch (attribute) @@ -3733,7 +3733,7 @@ bool get_global_field(BurpGlobals* tdgbl) if (tdgbl->RESTORE_ods >= DB_VERSION_DDL10) { - // with rdb$field_precision + // with rdb$field_precision STORE (REQUEST_HANDLE tdgbl->handles_get_global_field_req_handle1) X IN RDB$FIELDS @@ -3776,7 +3776,7 @@ bool get_global_field(BurpGlobals* tdgbl) l = GET_TEXT(X.RDB$FIELD_NAME); MISC_terminate (X.RDB$FIELD_NAME, temp, l, sizeof(temp)); BURP_verbose (121, temp); - // msg 121 restoring global field %s + // msg 121 restoring global field %s break; case att_field_query_name: @@ -4075,7 +4075,7 @@ bool get_global_field(BurpGlobals* tdgbl) } else // RESTORE_ods < DB_VERSION_DDL10 { - // without rdb$field_precision + // without rdb$field_precision STORE (REQUEST_HANDLE tdgbl->handles_get_global_field_req_handle1) X IN RDB$FIELDS @@ -4108,7 +4108,7 @@ bool get_global_field(BurpGlobals* tdgbl) X.RDB$CHARACTER_SET_ID.NULL = TRUE; X.RDB$COLLATION_ID.NULL = TRUE; memset (X.RDB$QUERY_NAME, ' ', sizeof(X.RDB$QUERY_NAME)); - + skip_init(&scan_next_attr); while (skip_scan(&scan_next_attr), get_attribute(&attribute, tdgbl) != att_end) { @@ -4118,7 +4118,7 @@ bool get_global_field(BurpGlobals* tdgbl) l = GET_TEXT(X.RDB$FIELD_NAME); MISC_terminate (X.RDB$FIELD_NAME, temp, l, sizeof(temp)); BURP_verbose (121, temp); - // msg 121 restoring global field %s + // msg 121 restoring global field %s break; case att_field_query_name: @@ -4460,7 +4460,7 @@ bool get_index(BurpGlobals* tdgbl, X.RDB$EXPRESSION_BLR.NULL = TRUE; X.RDB$SYSTEM_FLAG = 0; X.RDB$SYSTEM_FLAG.NULL = FALSE; - + skip_init(&scan_next_attr); while (skip_scan(&scan_next_attr), get_attribute(&attribute, tdgbl) != att_end) { @@ -4482,8 +4482,8 @@ bool get_index(BurpGlobals* tdgbl, case att_index_inactive: X.RDB$INDEX_INACTIVE = (USHORT) get_numeric(tdgbl); - // Defer foreign key index activation - // Modified by Toni Martir, all index deferred when verbose + // Defer foreign key index activation + // Modified by Toni Martir, all index deferred when verbose if (tdgbl->gbl_sw_verbose) { if (X.RDB$INDEX_INACTIVE == FALSE) @@ -4537,7 +4537,7 @@ bool get_index(BurpGlobals* tdgbl, case att_index_foreign_key: foreign_index = true; - // Defer foreign key index activation + // Defer foreign key index activation if (X.RDB$INDEX_INACTIVE == FALSE) X.RDB$INDEX_INACTIVE = DEFERRED_ACTIVE; if (tdgbl->gbl_sw_deactivate_indexes) @@ -4548,7 +4548,7 @@ bool get_index(BurpGlobals* tdgbl, default: bad_attribute (scan_next_attr, attribute, 93); - // msg 93 index + // msg 93 index break; } } @@ -4618,10 +4618,10 @@ void get_misc_blob(BurpGlobals* tdgbl, if (!blob.create(DB, local_trans, blob_id)) { BURP_error_redirect (status_vector, 37); - // msg 37 isc_create_blob failed + // msg 37 isc_create_blob failed } - // Allocate blob buffer if static buffer is too short + // Allocate blob buffer if static buffer is too short BlobBuffer static_buffer; UCHAR* buffer = static_buffer.getBuffer(length); @@ -4633,12 +4633,12 @@ void get_misc_blob(BurpGlobals* tdgbl, if (!blob.putData(length, buffer)) { BURP_error_redirect (status_vector, 38); - // msg 38 isc_put_segment failed + // msg 38 isc_put_segment failed } if (!blob.close()) BURP_error_redirect (status_vector, 23); - // msg 23 isc_close_blob failed + // msg 23 isc_close_blob failed } SLONG get_numeric(BurpGlobals* tdgbl) @@ -4730,7 +4730,7 @@ bool get_procedure(BurpGlobals* tdgbl) X.RDB$SYSTEM_FLAG.NULL = FALSE; X.RDB$VALID_BLR.NULL = TRUE; X.RDB$DEBUG_INFO.NULL = TRUE; - + skip_init(&scan_next_attr); while (skip_scan(&scan_next_attr), get_attribute(&attribute, tdgbl) != att_end) { @@ -4742,7 +4742,7 @@ bool get_procedure(BurpGlobals* tdgbl) strcpy (procedure->prc_name, X.RDB$PROCEDURE_NAME); MISC_terminate (X.RDB$PROCEDURE_NAME, temp, l, sizeof(temp)); BURP_verbose (195, temp); - // msg 195 restoring stored procedure %s + // msg 195 restoring stored procedure %s break; case att_procedure_description: @@ -4841,7 +4841,7 @@ bool get_procedure(BurpGlobals* tdgbl) X.RDB$OWNER_NAME.NULL = TRUE; X.RDB$SYSTEM_FLAG = 0; X.RDB$SYSTEM_FLAG.NULL = FALSE; - + skip_init(&scan_next_attr); while (skip_scan(&scan_next_attr), get_attribute(&attribute, tdgbl) != att_end) { @@ -4853,7 +4853,7 @@ bool get_procedure(BurpGlobals* tdgbl) strcpy (procedure->prc_name, X.RDB$PROCEDURE_NAME); MISC_terminate (X.RDB$PROCEDURE_NAME, temp, l, sizeof(temp)); BURP_verbose (195, temp); - // msg 195 restoring stored procedure %s + // msg 195 restoring stored procedure %s break; case att_procedure_description: @@ -4920,9 +4920,9 @@ bool get_procedure(BurpGlobals* tdgbl) ON_ERROR general_on_error (); END_ERROR; - } + } - // at the end of prms for a procedure is the rec_procedure_end marker + // at the end of prms for a procedure is the rec_procedure_end marker while (get(tdgbl) == rec_procedure_prm) get_procedure_prm (tdgbl, procedure_name); @@ -4988,7 +4988,7 @@ bool get_procedure_prm (BurpGlobals* tdgbl, GDS_NAME procptr) l = GET_TEXT(X.RDB$PARAMETER_NAME); MISC_terminate (X.RDB$PARAMETER_NAME, temp, l, sizeof(temp)); BURP_verbose (196, temp); - // msg 196 restoring parameter %s for stored procedure + // msg 196 restoring parameter %s for stored procedure break; case att_procedureprm_type: @@ -5099,7 +5099,7 @@ bool get_procedure_prm (BurpGlobals* tdgbl, GDS_NAME procptr) l = GET_TEXT(X.RDB$PARAMETER_NAME); MISC_terminate (X.RDB$PARAMETER_NAME, temp, l, sizeof(temp)); BURP_verbose (196, temp); - // msg 196 restoring parameter %s for stored procedure + // msg 196 restoring parameter %s for stored procedure break; case att_procedureprm_type: @@ -5276,7 +5276,7 @@ bool get_relation(BurpGlobals* tdgbl) relation->rel_name_length = l; MISC_terminate (relation->rel_name, temp, l, sizeof(temp)); BURP_verbose (167, temp); - // msg 167 restoring relation %s + // msg 167 restoring relation %s break; case att_relation_security_class: @@ -5356,7 +5356,7 @@ bool get_relation(BurpGlobals* tdgbl) } } - // If this is a view and there is a global transaction then use it + // If this is a view and there is a global transaction then use it isc_tr_handle local_trans; if (view_blr_null || !tdgbl->global_trans) local_trans = gds_trans; @@ -5431,7 +5431,7 @@ bool get_relation(BurpGlobals* tdgbl) END_ERROR; } - // Eat up misc. records + // Eat up misc. records burp_fld* field = NULL; burp_fld** ptr = &relation->rel_fields; @@ -5443,12 +5443,12 @@ bool get_relation(BurpGlobals* tdgbl) if (tdgbl->gbl_sw_incremental) { BURP_verbose (170, relation->rel_name); - // msg 170: committing metadata for relation %s + // msg 170: committing metadata for relation %s COMMIT - // existing ON_ERROR continues past error, beck + // existing ON_ERROR continues past error, beck ON_ERROR BURP_print (171, relation->rel_name); - // msg 171: error committing metadata for relation %s + // msg 171: error committing metadata for relation %s BURP_print_status (tdgbl->status_vector); ROLLBACK; ON_ERROR @@ -5474,18 +5474,18 @@ bool get_relation(BurpGlobals* tdgbl) default: BURP_error(43, true, SafeArg() << record); - // msg 43 don't recognize record type %ld + // msg 43 don't recognize record type %ld break; } } - // If we fall thru, there are data records to be gotten + // If we fall thru, there are data records to be gotten /* we can get here only when restoring ancient gbak'ed files where rec_data was once embedded into rec_relation ... otherwise, meta commit happens when we see the first rec_relation_data */ BURP_verbose (68); - // msg 68 committing meta data + // msg 68 committing meta data COMMIT; ON_ERROR @@ -5613,14 +5613,14 @@ bool get_relation_data(BurpGlobals* tdgbl) if (!relation) BURP_error_redirect (NULL, 49); - // msg 49 no relation name for data + // msg 49 no relation name for data - // Eat up misc. records + // Eat up misc. records rec_type record; get_record(&record, tdgbl); SLONG gen_id; - + skip_init(&scan_next_attr); while (skip_scan(&scan_next_attr), true) { @@ -5631,7 +5631,7 @@ bool get_relation_data(BurpGlobals* tdgbl) case rec_data: record = get_data(tdgbl, relation); - // get_data does a GET_RECORD + // get_data does a GET_RECORD break; case rec_gen_id: @@ -5645,14 +5645,14 @@ bool get_relation_data(BurpGlobals* tdgbl) get_record(&record, tdgbl); break; - case rec_trigger: // old style trigger + case rec_trigger: // old style trigger get_trigger_old (tdgbl, relation); get_record(&record, tdgbl); break; default: bad_attribute (scan_next_attr, attribute, 111); - // msg 111 relation + // msg 111 relation get_record(&record, tdgbl); break; } @@ -5688,7 +5688,7 @@ bool get_sql_roles(BurpGlobals* tdgbl) X.RDB$DESCRIPTION.NULL = TRUE; X.RDB$SYSTEM_FLAG = 0; X.RDB$SYSTEM_FLAG.NULL = FALSE; - + skip_init(&scan_next_attr); while (skip_scan(&scan_next_attr), get_attribute(&attribute, tdgbl) != att_end) { @@ -5771,7 +5771,7 @@ bool get_sql_roles(BurpGlobals* tdgbl) else bad_attribute (scan_next_attr, attribute, 250); break; - + default: // msg 250 SQL role bad_attribute (scan_next_attr, attribute, 250); @@ -5825,7 +5825,7 @@ bool get_mapping(BurpGlobals* tdgbl) * * Functional description * Restore mapping to users and roles - * Restricted version - only single + * Restricted version - only single * mapping is accepted * **************************************/ @@ -5884,11 +5884,11 @@ bool get_mapping(BurpGlobals* tdgbl) BURP_verbose(298, ADMIN_ROLE); //msg 298, restoring map @1 Firebird::string sql; - sql.printf("%s ('%s', %d) %s", + sql.printf("%s ('%s', %d) %s", "UPDATE OR INSERT INTO RDB$ROLES(RDB$ROLE_NAME, RDB$SYSTEM_FLAG) VALUES", - ADMIN_ROLE, ROLE_FLAG_MAY_TRUST | ROLE_FLAG_DBO, + ADMIN_ROLE, ROLE_FLAG_MAY_TRUST | ROLE_FLAG_DBO, "MATCHING (RDB$ROLE_NAME)"); - isc_dsql_execute_immediate(tdgbl->status, &tdgbl->db_handle, &tdgbl->tr_handle, + isc_dsql_execute_immediate(tdgbl->status, &tdgbl->db_handle, &tdgbl->tr_handle, sql.length(), sql.c_str(), 1, NULL); if (tdgbl->status[1]) { @@ -5942,9 +5942,9 @@ bool get_security_class(BurpGlobals* tdgbl) STORE (REQUEST_HANDLE tdgbl->handles_get_security_class_req_handle1) X IN RDB$SECURITY_CLASSES - + X.RDB$DESCRIPTION.NULL = TRUE; - + skip_init(&scan_next_attr); while (skip_scan(&scan_next_attr), get_attribute(&attribute, tdgbl) != att_end) { @@ -5965,13 +5965,13 @@ bool get_security_class(BurpGlobals* tdgbl) { MISC_terminate (X.RDB$SECURITY_CLASS, temp, l, sizeof(temp)); BURP_print (234, temp); - // msg 234 Skipped bad security class entry: %s + // msg 234 Skipped bad security class entry: %s break; } MISC_terminate (X.RDB$SECURITY_CLASS, temp, l, sizeof(temp)); BURP_verbose (125, temp); - // msg 125 restoring security class %s + // msg 125 restoring security class %s break; case att_class_acl: @@ -5990,11 +5990,11 @@ bool get_security_class(BurpGlobals* tdgbl) default: bad_attribute (scan_next_attr, attribute, 131); - // msg 131 security class + // msg 131 security class break; } } - // If the security class is not valid ASCII name, don't store it to the + // If the security class is not valid ASCII name, don't store it to the // database. Simply return from here and the entry is discarded. if (!is_valid_sec_class) { @@ -6069,10 +6069,10 @@ void get_source_blob(BurpGlobals* tdgbl, if (!ok) { BURP_error_redirect (status_vector, 37); - // msg 37 isc_create_blob failed + // msg 37 isc_create_blob failed } - // Allocate blob buffer if static buffer is too short + // Allocate blob buffer if static buffer is too short BlobBuffer static_buffer; UCHAR* buffer = static_buffer.getBuffer(length); @@ -6088,13 +6088,13 @@ void get_source_blob(BurpGlobals* tdgbl, if (!blob.putSegment(seg_len, buffer)) { BURP_error_redirect (status_vector, 38); - // msg 38 isc_put_segment failed + // msg 38 isc_put_segment failed } } if (!blob.close()) BURP_error_redirect (status_vector, 23); - // msg 23 isc_close_blob failed + // msg 23 isc_close_blob failed } USHORT get_text(BurpGlobals* tdgbl, @@ -6115,7 +6115,7 @@ USHORT get_text(BurpGlobals* tdgbl, if (length <= l) BURP_error_redirect (NULL, 46); - // msg 46 string truncated + // msg 46 string truncated if (l) text = (TEXT*) get_block(tdgbl, (UCHAR*) text, l); @@ -6145,7 +6145,7 @@ bool get_trigger_old (BurpGlobals* tdgbl, STORE (REQUEST_HANDLE tdgbl->handles_get_trigger_old_req_handle1) X IN RDB$TRIGGERS - + X.RDB$DESCRIPTION.NULL = TRUE; X.RDB$TRIGGER_BLR.NULL = TRUE; X.RDB$TRIGGER_SOURCE.NULL = TRUE; @@ -6178,12 +6178,12 @@ bool get_trigger_old (BurpGlobals* tdgbl, default: bad_attribute (scan_next_attr, attribute, 134); - // msg 134 trigger + // msg 134 trigger break; } } - // fill in rest of attributes unique to new trigger format + // fill in rest of attributes unique to new trigger format TEXT* p = X.RDB$TRIGGER_NAME; const TEXT* const end = p + 31; @@ -6208,7 +6208,7 @@ bool get_trigger_old (BurpGlobals* tdgbl, break; default: bad_attribute (scan_next_attr, attribute, 136); - // msg 136 trigger type + // msg 136 trigger type return 0; } @@ -6217,7 +6217,7 @@ bool get_trigger_old (BurpGlobals* tdgbl, } *p = 0; BURP_verbose (126, X.RDB$TRIGGER_NAME); - // msg 126 restoring trigger %s + // msg 126 restoring trigger %s strncpy (X.RDB$RELATION_NAME, relation->rel_name, GDS_NAME_LEN); strcpy (name, X.RDB$TRIGGER_NAME); X.RDB$TRIGGER_SEQUENCE = TRIGGER_SEQUENCE_DEFAULT; @@ -6230,10 +6230,10 @@ bool get_trigger_old (BurpGlobals* tdgbl, if (tdgbl->gbl_sw_incremental) { COMMIT - // existing ON_ERROR continues past error, beck + // existing ON_ERROR continues past error, beck ON_ERROR BURP_print (94, name); - // msg 94 trigger %s is invalid + // msg 94 trigger %s is invalid BURP_print_status (tdgbl->status_vector); ROLLBACK; ON_ERROR @@ -6316,7 +6316,7 @@ bool get_trigger(BurpGlobals* tdgbl) GET_TEXT(X.RDB$TRIGGER_NAME); strcpy (name, X.RDB$TRIGGER_NAME); BURP_verbose (126, X.RDB$TRIGGER_NAME); - // msg 126 restoring trigger %s + // msg 126 restoring trigger %s break; case att_trig_relation_name: @@ -6369,7 +6369,7 @@ bool get_trigger(BurpGlobals* tdgbl) default: bad_attribute (scan_next_attr, attribute, 134); - // msg 134 trigger + // msg 134 trigger break; } } @@ -6425,7 +6425,7 @@ bool get_trigger(BurpGlobals* tdgbl) GET_TEXT(X.RDB$TRIGGER_NAME); strcpy (name, X.RDB$TRIGGER_NAME); BURP_verbose (126, X.RDB$TRIGGER_NAME); - // msg 126 restoring trigger %s + // msg 126 restoring trigger %s break; case att_trig_relation_name: @@ -6458,7 +6458,7 @@ bool get_trigger(BurpGlobals* tdgbl) default: bad_attribute (scan_next_attr, attribute, 134); - // msg 134 trigger + // msg 134 trigger break; } } @@ -6471,10 +6471,10 @@ bool get_trigger(BurpGlobals* tdgbl) if (tdgbl->gbl_sw_incremental) { COMMIT - // existing ON_ERROR continues past error, beck + // existing ON_ERROR continues past error, beck ON_ERROR BURP_print (94, name); - // msg 94 trigger %s is invalid + // msg 94 trigger %s is invalid BURP_print_status (tdgbl->status_vector); ROLLBACK; ON_ERROR @@ -6526,7 +6526,7 @@ bool get_trigger_message(BurpGlobals* tdgbl) general_on_error (); END_ERROR; BURP_verbose (127, name); - // msg 127 restoring trigger message for %s + // msg 127 restoring trigger message for %s break; case att_trigmsg_number: @@ -6539,7 +6539,7 @@ bool get_trigger_message(BurpGlobals* tdgbl) default: bad_attribute (scan_next_attr, attribute, 135); - // msg 135 trigger message + // msg 135 trigger message break; } } @@ -6564,10 +6564,10 @@ bool get_trigger_message(BurpGlobals* tdgbl) if (tdgbl->gbl_sw_incremental) { COMMIT - // existing ON_ERROR continues past error, beck + // existing ON_ERROR continues past error, beck ON_ERROR BURP_print (94, name); - // msg 94 trigger %s is invalid + // msg 94 trigger %s is invalid BURP_print_status (tdgbl->status_vector); ROLLBACK; ON_ERROR @@ -6601,7 +6601,7 @@ bool get_type(BurpGlobals* tdgbl) STORE (REQUEST_HANDLE tdgbl->handles_get_type_req_handle1) X IN RDB$TYPES - + X.RDB$DESCRIPTION.NULL = TRUE; X.RDB$SYSTEM_FLAG = 0; X.RDB$SYSTEM_FLAG.NULL = FALSE; @@ -6647,7 +6647,7 @@ bool get_type(BurpGlobals* tdgbl) MISC_terminate (X.RDB$TYPE_NAME, temp, l, sizeof(temp)); BURP_verbose (128, SafeArg() << temp << X.RDB$FIELD_NAME); - // msg 128 restoring type %s for field %s + // msg 128 restoring type %s for field %s END_STORE; ON_ERROR @@ -6692,11 +6692,11 @@ bool get_user_privilege(BurpGlobals* tdgbl) switch (attribute) { case att_priv_user: - // default USER_TYPE to USER + // default USER_TYPE to USER flags |= USER_PRIV_USER; GET_TEXT(user); BURP_verbose (123, user); - // msg 123 restoring privilege for user %s + // msg 123 restoring privilege for user %s break; case att_priv_grantor: @@ -6716,7 +6716,7 @@ bool get_user_privilege(BurpGlobals* tdgbl) case att_priv_object_name: flags |= USER_PRIV_OBJECT_NAME; - // default OBJECT_TYPE to RELATION + // default OBJECT_TYPE to RELATION GET_TEXT(relation_name); break; @@ -6737,12 +6737,12 @@ bool get_user_privilege(BurpGlobals* tdgbl) default: bad_attribute (scan_next_attr, attribute, 105); - // msg 105 privilege + // msg 105 privilege break; } } - // Check if object exists + // Check if object exists isc_tr_handle local_trans = 0; bool exists = false; switch (object_type) @@ -6783,7 +6783,7 @@ bool get_user_privilege(BurpGlobals* tdgbl) if (user_type == obj_sql_role || object_type == obj_sql_role) exists = false; } - + if (exists) { if (!local_trans) @@ -6914,7 +6914,7 @@ bool get_view(BurpGlobals* tdgbl, default: bad_attribute (scan_next_attr, attribute, 140); - // msg 140 view + // msg 140 view break; } } @@ -6962,7 +6962,7 @@ void ignore_array(BurpGlobals* tdgbl, } if (!field) BURP_error_redirect (NULL, 36); - // msg 36 Can't find field for blob + // msg 36 Can't find field for blob break; case att_array_dimensions: @@ -6972,12 +6972,12 @@ void ignore_array(BurpGlobals* tdgbl, { if (get_attribute(&attribute, tdgbl) != att_array_range_low) bad_attribute (scan_next_attr, attribute, 58); - // msg 58 array + // msg 58 array else range[0] = get_numeric(tdgbl); if (get_attribute(&attribute, tdgbl) != att_array_range_high) bad_attribute (scan_next_attr, attribute, 58); - // msg 58 array + // msg 58 array else range[1] = get_numeric(tdgbl); } @@ -6985,7 +6985,7 @@ void ignore_array(BurpGlobals* tdgbl, default: bad_attribute (scan_next_attr, attribute, 58); - // msg 58 array + // msg 58 array break; } } @@ -7000,7 +7000,7 @@ void ignore_array(BurpGlobals* tdgbl, { if (get_attribute(&attribute, tdgbl) != att_xdr_array) BURP_error_redirect (NULL, 55); - // msg 55 Expected XDR record length + // msg 55 Expected XDR record length else { lcount = get(tdgbl); @@ -7060,12 +7060,12 @@ void ignore_blob(BurpGlobals* tdgbl) default: bad_attribute (scan_next_attr, attribute, 64); - // msg 64 blob + // msg 64 blob break; } } - // Eat up blob segments + // Eat up blob segments while (--segments >= 0) { @@ -7091,24 +7091,24 @@ rec_type ignore_data(BurpGlobals* tdgbl, **************************************/ ULONG records = 0; rec_type record; - + while (true) { if (get(tdgbl) != att_data_length) BURP_error_redirect (NULL, 39); - // msg 39 expected record length + // msg 39 expected record length USHORT l = (USHORT) get_numeric(tdgbl); if (tdgbl->gbl_sw_transportable) { if (get(tdgbl) != att_xdr_length) BURP_error_redirect (NULL, 55); - // msg 55 Expected XDR record length + // msg 55 Expected XDR record length else l = (USHORT) get_numeric(tdgbl); } if (get(tdgbl) != att_data_data) BURP_error_redirect (NULL, 41); - // msg 41 expected data attribute + // msg 41 expected data attribute if (l) { if (tdgbl->gbl_sw_compress) { @@ -7120,7 +7120,7 @@ rec_type ignore_data(BurpGlobals* tdgbl, get_skip(tdgbl, l); } ++records; - + while (get_record(&record, tdgbl)) { if (record == rec_blob) @@ -7135,7 +7135,7 @@ rec_type ignore_data(BurpGlobals* tdgbl, } BURP_verbose (106, SafeArg() << records); - // msg 106 %ld records ignored + // msg 106 %ld records ignored return record; } @@ -7169,7 +7169,7 @@ void realign(BurpGlobals* tdgbl, // CVC: This code assumes fld_offset < fld_old_offset, // why not use memmove() instead? - // Beware of overlaps here - don't use memcpy + // Beware of overlaps here - don't use memcpy while (l--) { *p++ = *q++; } @@ -7224,7 +7224,7 @@ USHORT recompute_length(BurpGlobals* tdgbl, ULONG length = field->fld_length; // ULONG alignment = 4; useless, see assignment below - // arrays are of various fld_types but are really blobs + // arrays are of various fld_types but are really blobs ULONG dtype = field->fld_type; @@ -7244,7 +7244,7 @@ USHORT recompute_length(BurpGlobals* tdgbl, offset += length; } - // If this is format version 2, build fields for null flags + // If this is format version 2, build fields for null flags if (tdgbl->RESTORE_format >= 2) { @@ -7278,17 +7278,17 @@ bool restore(BurpGlobals* tdgbl, * **************************************/ - // Read burp record first + // Read burp record first MVOL_init_read (tdgbl->gbl_database_file_name, file_name, &tdgbl->RESTORE_format, &tdgbl->io_cnt, &tdgbl->io_ptr); if (tdgbl->gbl_sw_transportable) BURP_verbose (133); - // msg 133 transportable backup -- data in XDR format + // msg 133 transportable backup -- data in XDR format if (tdgbl->gbl_sw_compress) BURP_verbose (61); - // msg 61 backup file is compressed + // msg 61 backup file is compressed // restore only from those backup files created by current or previous GBAK @@ -7316,11 +7316,11 @@ bool restore(BurpGlobals* tdgbl, if (tdgbl->RESTORE_ods < DB_VERSION_CURRENT) { BURP_error(51, true, SafeArg() << tdgbl->RESTORE_ods); - // msg 51 database format %ld is too old to restore to + // msg 51 database format %ld is too old to restore to } BURP_verbose (129); - // msg 129 started transaction + // msg 129 started transaction ATT_TYPE attribute; isc_req_handle req_handle2 = 0, req_handle3 = 0; @@ -7518,13 +7518,13 @@ bool restore(BurpGlobals* tdgbl, flag = true; break; - case rec_system_type: // rdb$types + case rec_system_type: // rdb$types if (!get_type(tdgbl)) return false; flag = true; break; - case rec_filter: // rdb$filters + case rec_filter: // rdb$filters if (!get_filter(tdgbl)) return false; flag = true; @@ -7540,7 +7540,7 @@ bool restore(BurpGlobals* tdgbl, if (flag) { BURP_verbose (68); - // msg 68 committing meta data + // msg 68 committing meta data COMMIT; ON_ERROR general_on_error (); @@ -7554,7 +7554,7 @@ bool restore(BurpGlobals* tdgbl, return false; break; - case rec_trigger: // new trigger type + case rec_trigger: // new trigger type if (!get_trigger(tdgbl)) return false; flag = true; @@ -7598,7 +7598,7 @@ bool restore(BurpGlobals* tdgbl, default: BURP_error(43, true, SafeArg() << record); - // msg 43 don't recognize record type %ld + // msg 43 don't recognize record type %ld break; } } @@ -7606,7 +7606,7 @@ bool restore(BurpGlobals* tdgbl, if (tdgbl->defaultCollations.getCount() > 0) { isc_req_handle req_handle4 = 0; - + FOR (REQUEST_HANDLE req_handle4) CS IN RDB$CHARACTER_SETS @@ -7653,16 +7653,16 @@ bool restore(BurpGlobals* tdgbl, EXEC SQL SET TRANSACTION; } - // put validation clauses for global fields + // put validation clauses for global fields update_global_field(tdgbl); - // Purge shadow metadata if necessary + // Purge shadow metadata if necessary if (tdgbl->gbl_sw_kill) { isc_req_handle req_handle4 = 0; - + FOR (REQUEST_HANDLE req_handle4) FIL IN RDB$FILES WITH FIL.RDB$SHADOW_NUMBER NOT MISSING AND FIL.RDB$SHADOW_NUMBER NE 0 @@ -7849,7 +7849,7 @@ void store_blr_gen_id(BurpGlobals* tdgbl, if (!value) { BURP_verbose (185, SafeArg() << gen_name << 0); - // msg 185 restoring generator %s value: %ld + // msg 185 restoring generator %s value: %ld return; } @@ -7909,27 +7909,27 @@ void store_blr_gen_id(BurpGlobals* tdgbl, const USHORT blr_length = blr - blr_buffer; fb_assert(blr_length <= sizeof(blr_buffer)); - + ISC_STATUS_ARRAY status_vector; if (isc_compile_request (status_vector, &DB, &gen_id_reqh, blr_length, (const SCHAR*) blr_buffer)) { isc_print_blr ((const SCHAR*) blr_buffer, NULL, NULL, 0); BURP_error_redirect (status_vector, 42); - // msg 42 Failed in store_blr_gen_id + // msg 42 Failed in store_blr_gen_id } if (isc_start_request (status_vector, &gen_id_reqh, - &gds_trans, // use the same one generated by gpre + &gds_trans, // use the same one generated by gpre 0)) { isc_print_blr ((const SCHAR*) blr_buffer, NULL, NULL, 0); BURP_error_redirect (status_vector, 42); - // msg 42 Failed in store_blr_gen_id + // msg 42 Failed in store_blr_gen_id } BURP_verbose (185, SafeArg() << gen_name << value); - // msg 185 restoring generator %s value: %ld + // msg 185 restoring generator %s value: %ld isc_release_request (status_vector, &gen_id_reqh); } @@ -8020,21 +8020,21 @@ void update_view_dbkey_lengths(BurpGlobals* tdgbl) ************************************** * * Functional description - * During the restore process VIEWs could - * be created that holds other VIEWs and + * During the restore process VIEWs could + * be created that holds other VIEWs and * which weren't restored yet. * Then the RDB$DBKEY_LENGTH for VIEWs is * calculated wrong. Therefore we need to - * recalculate the DBKEY_LENGTH else we - * get our famous "arithmetic exception, + * recalculate the DBKEY_LENGTH else we + * get our famous "arithmetic exception, * numeric overflow, or string truncation" error. * **************************************/ isc_req_handle req_handle2 = 0; FOR (REQUEST_HANDLE req_handle2) - R IN RDB$RELATIONS - WITH + R IN RDB$RELATIONS + WITH R.RDB$VIEW_BLR NOT MISSING AND (R.RDB$SYSTEM_FLAG NE 1 OR R.RDB$SYSTEM_FLAG MISSING) diff --git a/src/dsql/array.epp b/src/dsql/array.epp index 5e0413fd20..c79c601f9d 100644 --- a/src/dsql/array.epp +++ b/src/dsql/array.epp @@ -26,7 +26,7 @@ * could be returned or a lookup for a blob field could fail. In addition, * a possible buffer overrun due to unchecked bounds was closed. The fc * get_name() as been renamed copy_exact_name(). - * + * * 2002-02-24 Sean Leyne - Code Cleanup of old Win 3.1 port (WINDOWS_ONLY) * * @@ -102,17 +102,17 @@ ISC_STATUS API_ROUTINE isc_array_gen_sdl(ISC_STATUS* status, * Functional description * **************************************/ - + return gen_sdl(status, desc, sdl_buffer_length, &sdl_buffer, sdl_length, false); } - - + + ISC_STATUS API_ROUTINE isc_array_get_slice(ISC_STATUS* status, FB_API_HANDLE* db_handle, FB_API_HANDLE* trans_handle, ISC_QUAD* array_id, const ISC_ARRAY_DESC* desc, - void* array, + void* array, SLONG* slice_length) { /************************************** @@ -182,8 +182,8 @@ ISC_STATUS API_ROUTINE isc_array_lookup_bounds(ISC_STATUS* status, tail->array_bound_lower = (SSHORT)X.RDB$LOWER_BOUND; tail->array_bound_upper = (SSHORT)X.RDB$UPPER_BOUND; ++tail; - END_FOR - ON_ERROR + END_FOR + ON_ERROR ISC_STATUS_ARRAY temp_status; isc_release_request(temp_status, &handle); return UTLD_copy_status(isc_status, status); @@ -221,7 +221,7 @@ ISC_STATUS API_ROUTINE isc_array_put_slice(ISC_STATUS* status, FB_API_HANDLE* trans_handle, ISC_QUAD* array_id, const ISC_ARRAY_DESC* desc, - void* array, + void* array, SLONG* slice_length) { /************************************** @@ -273,7 +273,7 @@ ISC_STATUS API_ROUTINE isc_array_set_desc(ISC_STATUS* status, sizeof(desc->array_desc_field_name)); copy_exact_name (relation_name, desc->array_desc_relation_name, sizeof(desc->array_desc_relation_name)); - + desc->array_desc_flags = 0; desc->array_desc_dimensions = *dimensions; @@ -320,7 +320,7 @@ ISC_STATUS API_ROUTINE isc_array_set_desc(ISC_STATUS* status, desc->array_desc_dtype = blr_quad; break; default: - return error(status, Arg::Gds(isc_sqlerr) << Arg::Num(-804) << + return error(status, Arg::Gds(isc_sqlerr) << Arg::Num(-804) << Arg::Gds(isc_random) << Arg::Str("data type not understood")); } @@ -342,7 +342,7 @@ static void adjust_length( ISC_ARRAY_DESC* desc) **************************************/ } -static void copy_exact_name ( +static void copy_exact_name ( const char* from, char* to, SSHORT bsize) @@ -353,7 +353,7 @@ static void copy_exact_name ( * ************************************** * - * Functional description + * Functional description * Copy null terminated name ot stops at bsize - 1. * CVC: This is just another fc like DYN_terminate. * @@ -374,7 +374,7 @@ static ISC_STATUS error(ISC_STATUS* status, const Arg::StatusVector& v) { /************************************** * - * e r r o r + * e r r o r * ************************************** * @@ -535,9 +535,9 @@ static ISC_STATUS lookup_desc(ISC_STATUS* status, if (global) { copy_exact_name (Y.RDB$FIELD_NAME, global, sizeof(Y.RDB$FIELD_NAME)); } - - END_FOR - ON_ERROR + + END_FOR + ON_ERROR ISC_STATUS_ARRAY temp_status; isc_release_request(temp_status, &handle); return UTLD_copy_status(isc_status, status); @@ -546,7 +546,7 @@ static ISC_STATUS lookup_desc(ISC_STATUS* status, isc_release_request(isc_status, &handle); if (!flag) - return error(status, Arg::Gds(isc_fldnotdef) << Arg::Str(desc->array_desc_field_name) << + return error(status, Arg::Gds(isc_fldnotdef) << Arg::Str(desc->array_desc_field_name) << Arg::Str(desc->array_desc_relation_name)); return error(status, Arg::Gds(FB_SUCCESS)); @@ -573,7 +573,7 @@ static ISC_STATUS stuff_args(gen_t* gen, SSHORT count, ...) return error(gen->gen_status, Arg::Gds(isc_misc_interpreted) << Arg::Str("SDL buffer overflow")); } - // The sdl buffer is too small. Allocate a larger one. + // The sdl buffer is too small. Allocate a larger one. const SSHORT new_len = gen->gen_end - *gen->gen_sdl_ptr + 512 + count; UCHAR* const new_sdl = (UCHAR*) gds__alloc(new_len); diff --git a/src/dsql/blob.epp b/src/dsql/blob.epp index a8c468dd83..97e160c390 100644 --- a/src/dsql/blob.epp +++ b/src/dsql/blob.epp @@ -91,7 +91,7 @@ ISC_STATUS API_ROUTINE isc_blob_gen_bpb( * Functional description * * This function will generate a bpb - * given a to_desc and a from_desc + * given a to_desc and a from_desc * which contain the subtype and * character set information. * @@ -143,16 +143,16 @@ ISC_STATUS API_ROUTINE isc_blob_lookup_desc(ISC_STATUS* status, * character set and segment size information * from the metadata, given a relation/procedure name * and column/parameter name. it will fill in the information - * in the BLOB_DESC. + * in the BLOB_DESC. * ***********************************************/ ISC_STATUS_ARRAY isc_status = {0}; isc_db_handle DB = *db_handle; isc_req_handle handle = 0; - copy_exact_name (field_name, desc->blob_desc_field_name, + copy_exact_name (field_name, desc->blob_desc_field_name, sizeof(desc->blob_desc_field_name)); - copy_exact_name (relation_name, desc->blob_desc_relation_name, + copy_exact_name (relation_name, desc->blob_desc_relation_name, sizeof(desc->blob_desc_relation_name)); bool flag = false; @@ -172,7 +172,7 @@ ISC_STATUS API_ROUTINE isc_blob_lookup_desc(ISC_STATUS* status, copy_exact_name ((UCHAR*) Y.RDB$FIELD_NAME, global, sizeof(Y.RDB$FIELD_NAME)); } - END_FOR + END_FOR ON_ERROR ISC_STATUS_ARRAY temp_status; isc_release_request(temp_status, &handle); @@ -200,7 +200,7 @@ ISC_STATUS API_ROUTINE isc_blob_lookup_desc(ISC_STATUS* status, copy_exact_name ((UCHAR*) Y.RDB$FIELD_NAME, global, sizeof(Y.RDB$FIELD_NAME)); } - END_FOR + END_FOR ON_ERROR ISC_STATUS_ARRAY temp_status; isc_release_request(temp_status, &handle); @@ -209,9 +209,9 @@ ISC_STATUS API_ROUTINE isc_blob_lookup_desc(ISC_STATUS* status, isc_release_request(isc_status, &handle); } - + if (!flag) - return error(status, Arg::Gds(isc_fldnotdef) << Arg::Str((const char *)(desc->blob_desc_field_name)) << + return error(status, Arg::Gds(isc_fldnotdef) << Arg::Str((const char *)(desc->blob_desc_field_name)) << Arg::Str((const char *)(desc->blob_desc_relation_name))); return error(status, Arg::Gds(FB_SUCCESS)); @@ -241,9 +241,9 @@ ISC_STATUS API_ROUTINE isc_blob_set_desc(ISC_STATUS* status, * **************************************/ - copy_exact_name (field_name, desc->blob_desc_field_name, + copy_exact_name (field_name, desc->blob_desc_field_name, sizeof(desc->blob_desc_field_name)); - copy_exact_name (relation_name, desc->blob_desc_relation_name, + copy_exact_name (relation_name, desc->blob_desc_relation_name, sizeof(desc->blob_desc_relation_name)); desc->blob_desc_subtype = subtype; @@ -256,7 +256,7 @@ ISC_STATUS API_ROUTINE isc_blob_set_desc(ISC_STATUS* status, -static void copy_exact_name ( +static void copy_exact_name ( const UCHAR* from, UCHAR* to, SSHORT bsize) @@ -267,7 +267,7 @@ static void copy_exact_name ( * ************************************** * - * Functional description + * Functional description * Copy null terminated name ot stops at bsize - 1. * CVC: This is just another fc like DYN_terminate. * @@ -288,7 +288,7 @@ static ISC_STATUS error(ISC_STATUS* status, const Arg::StatusVector& v) { /************************************** * - * e r r o r + * e r r o r * ************************************** * diff --git a/src/dudley/exe.epp b/src/dudley/exe.epp index 0e83195073..8d5ccbc9ff 100644 --- a/src/dudley/exe.epp +++ b/src/dudley/exe.epp @@ -194,8 +194,8 @@ void EXE_create_database( DBB dbb) const TEXT* file_name = dbb->dbb_name->sym_string; - const SLONG result = isc_attach_database(gds_status, 0, file_name, - &DB, dpb.getBufferLength(), + const SLONG result = isc_attach_database(gds_status, 0, file_name, + &DB, dpb.getBufferLength(), reinterpret_cast(dpb.getBuffer())); if (!dudleyGlob.DDL_replace) { if (!result) { @@ -250,8 +250,8 @@ void EXE_create_database( DBB dbb) dpb.insertInt(isc_dpb_wal_grp_cmt_wait, len); } - if (isc_create_database(gds_status, 0, file_name, &DB, - dpb.getBufferLength(), + if (isc_create_database(gds_status, 0, file_name, &DB, + dpb.getBufferLength(), reinterpret_cast(dpb.getBuffer()), 0)) { DDL_error_abort(gds_status, 21, SafeArg() << file_name); @@ -301,12 +301,12 @@ void EXE_create_database( DBB dbb) /* If there is a description of the database, store it now */ - FOR D IN RDB$DATABASE - MODIFY D USING + FOR D IN RDB$DATABASE + MODIFY D USING if (dbb->dbb_description) { store_text(dbb->dbb_description, &D.RDB$DESCRIPTION); D.RDB$DESCRIPTION.NULL = FALSE; - } + } if (dbb->dbb_security_class) { MOVE_SYMBOL(dbb->dbb_security_class, D.RDB$SECURITY_CLASS); D.RDB$SECURITY_CLASS.NULL = FALSE; @@ -365,8 +365,8 @@ void EXE_drop_database( DBB dbb) } #endif - if (isc_attach_database(gds_status, 0, dbb->dbb_name->sym_string, - &DB, dpb.getBufferLength(), + if (isc_attach_database(gds_status, 0, dbb->dbb_name->sym_string, + &DB, dpb.getBufferLength(), reinterpret_cast(dpb.getBuffer()))) { DDL_error_abort(gds_status, 25); @@ -707,8 +707,8 @@ void EXE_modify_database( DBB dbb) } */ - if (isc_attach_database(gds_status, 0, dbb->dbb_name->sym_string, - &DB, dpb.getBufferLength(), + if (isc_attach_database(gds_status, 0, dbb->dbb_name->sym_string, + &DB, dpb.getBufferLength(), reinterpret_cast(dpb.getBuffer()))) { DDL_error_abort(gds_status, 29, SafeArg() << dbb->dbb_name->sym_string); @@ -798,7 +798,7 @@ void EXE_modify_database( DBB dbb) FOR X IN RDB$LOG_FILES DDL_error_abort(NULL, 333); - // msg 333: Cannot modify log file specification. Drop and redefine log files + // msg 333: Cannot modify log file specification. Drop and redefine log files END_FOR; // add the new log files. @@ -889,7 +889,7 @@ static void add_cache( DBB dbb) // ************************************** bool result = false; - FOR FIL IN RDB$FILES WITH FIL.RDB$FILE_FLAGS EQ FILE_cache + FOR FIL IN RDB$FILES WITH FIL.RDB$FILE_FLAGS EQ FILE_cache result = true; DDL_err(323, SafeArg() << FIL.RDB$FILE_NAME); // msg 323: a shared cache file %s already exists @@ -900,7 +900,7 @@ static void add_cache( DBB dbb) FIL file = dbb->dbb_cache_file; - STORE FIL IN RDB$FILES + STORE FIL IN RDB$FILES MOVE_SYMBOL(file->fil_name, FIL.RDB$FILE_NAME); FIL.RDB$FILE_START = 0; FIL.RDB$FILE_LENGTH = file->fil_length; @@ -1000,7 +1000,7 @@ static void add_files( DBB dbb, FIL files) ************************************** * * Functional description - * Add a file to an existing database. + * Add a file to an existing database. * **************************************/ FIL file, next; @@ -1018,11 +1018,11 @@ static void add_files( DBB dbb, FIL files) against the user given maximum length (if given). */ SLONG length = 0, start = 0; - + if (dbb) { TEXT s[128]; if (isc_database_info(gds_status, &DB, sizeof(alloc_info), alloc_info, - sizeof(s), s) || s[0] != isc_info_allocation) + sizeof(s), s) || s[0] != isc_info_allocation) { DDL_err(38); /* msg 38: isc_database_info failed */ @@ -1333,7 +1333,7 @@ static void add_index( DUDLEY_IDX index) if (!if_any) { DDL_err(43, SafeArg() << index->idx_relation->sym_string); - // msg 43: relation %s doesn't exist + // msg 43: relation %s doesn't exist return; } @@ -1402,7 +1402,7 @@ static void add_index( DUDLEY_IDX index) /* if there wasn't an index record, clean up any orphan index segments */ FOR X IN RDB$INDEX_SEGMENTS - WITH X.RDB$INDEX_NAME = index->idx_name->sym_string + WITH X.RDB$INDEX_NAME = index->idx_name->sym_string ERASE X; END_FOR; @@ -1558,7 +1558,7 @@ static void add_security_class( SCL sec_class) SYM name = sec_class->scl_name; - FOR X IN RDB$SECURITY_CLASSES WITH X.RDB$SECURITY_CLASS EQ name->sym_string + FOR X IN RDB$SECURITY_CLASSES WITH X.RDB$SECURITY_CLASS EQ name->sym_string if_any = true; DDL_err(50, SafeArg() << name->sym_string); /* msg 50: security class %s already exists */ @@ -1567,7 +1567,7 @@ static void add_security_class( SCL sec_class) if (if_any) return; - STORE X IN RDB$SECURITY_CLASSES + STORE X IN RDB$SECURITY_CLASSES MOVE_SYMBOL(name, X.RDB$SECURITY_CLASS); if (sec_class->scl_description) { store_text(sec_class->scl_description, &X.RDB$DESCRIPTION); @@ -1597,12 +1597,12 @@ static void add_trigger( DUDLEY_TRG trigger) FOR F IN RDB$RELATION_FIELDS CROSS V IN RDB$VIEW_RELATIONS WITH F.RDB$RELATION_NAME = V.RDB$VIEW_NAME AND F.RDB$RELATION_NAME = relation->rel_name->sym_string - MODIFY F USING + MODIFY F USING F.RDB$UPDATE_FLAG = TRUE; END_MODIFY; END_FOR; - STORE X IN RDB$TRIGGERS + STORE X IN RDB$TRIGGERS X.RDB$TRIGGER_SOURCE.NULL = TRUE; X.RDB$TRIGGER_BLR.NULL = TRUE; X.RDB$DESCRIPTION.NULL = TRUE; @@ -1617,12 +1617,12 @@ static void add_trigger( DUDLEY_TRG trigger) X.RDB$TRIGGER_SOURCE.NULL = FALSE; store_text(trigger->trg_source, &X.RDB$TRIGGER_SOURCE); } - + if (trigger->trg_statement) { X.RDB$TRIGGER_BLR.NULL = FALSE; store_blr(trigger->trg_statement, &X.RDB$TRIGGER_BLR, NULL); } - + if (trigger->trg_description) { X.RDB$DESCRIPTION.NULL = FALSE; store_text(trigger->trg_description, &X.RDB$DESCRIPTION); @@ -1668,7 +1668,7 @@ static void add_type( TYP fldtype) * **************************************/ - STORE X IN RDB$TYPES + STORE X IN RDB$TYPES X.RDB$DESCRIPTION.NULL = TRUE; MOVE_SYMBOL(fldtype->typ_field_name, X.RDB$FIELD_NAME); MOVE_SYMBOL(fldtype->typ_name, X.RDB$TYPE_NAME); @@ -1702,7 +1702,7 @@ static void add_user_privilege( USERPRIV upriv) /* rdb$owner_name doesn't get filled in until we store the relation */ - FOR X IN RDB$RELATIONS WITH X.RDB$RELATION_NAME EQ upriv->userpriv_relation->sym_string + FOR X IN RDB$RELATIONS WITH X.RDB$RELATION_NAME EQ upriv->userpriv_relation->sym_string strcpy(grantor, X.RDB$OWNER_NAME); if_any = true; END_FOR; @@ -1718,7 +1718,7 @@ static void add_user_privilege( USERPRIV upriv) loop for each privilege, and if update privilege, loop for each field */ for (usr = upriv->userpriv_userlist; usr; usr = usr->usre_next) { - /* start with a fresh copy of privflag and erase each + /* start with a fresh copy of privflag and erase each privilege as we take care of it */ privflag = upriv->userpriv_flags & ~USERPRIV_grant; @@ -1815,7 +1815,7 @@ static void add_view( DUDLEY_REL relation) contexts = rse->nod_arg[s_rse_contexts]; for (i = 0; i < contexts->nod_count; i++) { - STORE X IN RDB$VIEW_RELATIONS + STORE X IN RDB$VIEW_RELATIONS context = (DUDLEY_CTX) contexts->nod_arg[i]->nod_arg[0]; target = context->ctx_relation; MOVE_SYMBOL(relation->rel_name, X.RDB$VIEW_NAME); @@ -1833,7 +1833,7 @@ static void add_view( DUDLEY_REL relation) relation->rel_name->sym_string); /* msg 56: field %s already exists in relation %s */ - STORE X IN RDB$RELATION_FIELDS + STORE X IN RDB$RELATION_FIELDS X.RDB$SECURITY_CLASS.NULL = TRUE; X.RDB$FIELD_POSITION.NULL = TRUE; X.RDB$DESCRIPTION.NULL = TRUE; @@ -1860,7 +1860,7 @@ static void add_view( DUDLEY_REL relation) target->rel_name->sym_string << field->fld_name->sym_string); /* msg 57: field %s doesn't exist in relation %s as referenced in view field %s */ - + X.RDB$VIEW_CONTEXT = context->ctx_context_id; FOR RFR IN RDB$RELATION_FIELDS WITH RFR.RDB$RELATION_NAME EQ target->rel_name->sym_string AND @@ -1948,7 +1948,7 @@ static DUDLEY_FLD check_field( SYM relation, SYM field) SYM symbol = HSH_typed_lookup(X.RDB$FIELD_SOURCE, (USHORT) 0, SYM_global); if (symbol) return (DUDLEY_FLD) symbol->sym_object; - } + } END_FOR; return NULL; @@ -1964,7 +1964,7 @@ static bool check_function( SYM name) ************************************** * * Functional description - * Check function for existence. + * Check function for existence. * **************************************/ bool if_any = false; @@ -1981,7 +1981,7 @@ static bool check_range(DUDLEY_FLD field) { /************************************** * - * c h e c k _ r a n g e + * c h e c k _ r a n g e * ************************************** * @@ -2003,7 +2003,7 @@ static bool check_range(DUDLEY_FLD field) // existance: if neither is an array, life is good // else if there are dimensions they'd better match - FOR X IN RDB$FIELDS WITH X.RDB$FIELD_NAME EQ name + FOR X IN RDB$FIELDS WITH X.RDB$FIELD_NAME EQ name if (!dims) { if (!X.RDB$DIMENSIONS.NULL) DDL_err(302, SafeArg() << name); @@ -2045,7 +2045,7 @@ static bool check_relation( SYM name) ************************************** * * Functional description - * Check relation for existence. + * Check relation for existence. * **************************************/ bool if_any = false; @@ -2121,7 +2121,7 @@ static void drop_cache( DBB dbb) // ************************************** bool found = false; - FOR FIL IN RDB$FILES WITH FIL.RDB$FILE_FLAGS EQ FILE_cache + FOR FIL IN RDB$FILES WITH FIL.RDB$FILE_FLAGS EQ FILE_cache ERASE FIL; found = true; END_FOR; @@ -2131,8 +2131,8 @@ static void drop_cache( DBB dbb) // msg 325: no shared cache file exists to drop if (!dudleyGlob.DDL_errors) { - COMMIT - ON_ERROR + COMMIT + ON_ERROR DDL_db_error(gds_status, 326); // msg 326: error commiting deletion of shared cache file ROLLBACK; @@ -2155,9 +2155,9 @@ static void drop_field( DUDLEY_FLD field) * Drop a field from a relation. First * check that it's not referenced in a * view (other that the current one, if the - * current relation happens to be a view). + * current relation happens to be a view). * If the field is computed, and - * the current reference is not a view, + * the current reference is not a view, * erase the artificially named source field. * **************************************/ @@ -2174,7 +2174,7 @@ static void drop_field( DUDLEY_FLD field) X.RDB$FIELD_SOURCE = Y.RDB$FIELD_SOURCE AND Y.RDB$RELATION_NAME EQ Z.RDB$VIEW_NAME AND X.RDB$RELATION_NAME EQ Z.RDB$RELATION_NAME AND - Y.RDB$VIEW_CONTEXT EQ Z.RDB$VIEW_CONTEXT + Y.RDB$VIEW_CONTEXT EQ Z.RDB$VIEW_CONTEXT DDL_err(60, SafeArg() << field->fld_name->sym_string << relation->rel_name->sym_string << @@ -2192,12 +2192,12 @@ static void drop_field( DUDLEY_FLD field) FOR Y IN RDB$RELATION_FIELDS WITH Y.RDB$FIELD_NAME = X.RDB$BASE_FIELD if_any = true; - END_FOR + END_FOR if (!if_any) { FOR Z IN RDB$FIELDS WITH Z.RDB$FIELD_NAME = X.RDB$FIELD_SOURCE - AND NOT(Z.RDB$COMPUTED_BLR MISSING) + AND NOT(Z.RDB$COMPUTED_BLR MISSING) ERASE Z; END_FOR; } @@ -2226,7 +2226,7 @@ static void drop_filter( FILTER filter) **************************************/ bool if_any = false; - FOR F IN RDB$FILTERS WITH F.RDB$FUNCTION_NAME EQ filter->filter_name->sym_string + FOR F IN RDB$FILTERS WITH F.RDB$FUNCTION_NAME EQ filter->filter_name->sym_string ERASE F; if_any = true; END_FOR; @@ -2260,7 +2260,7 @@ static void drop_function( FUNC function) ERASE FUNCARG; END_FOR; - FOR FUNC IN RDB$FUNCTIONS WITH FUNC.RDB$FUNCTION_NAME EQ name + FOR FUNC IN RDB$FUNCTIONS WITH FUNC.RDB$FUNCTION_NAME EQ name ERASE FUNC; if_any = true; END_FOR; @@ -2308,21 +2308,21 @@ static void drop_global_field( DUDLEY_FLD field) return; FOR X IN RDB$TYPES WITH - X.RDB$FIELD_NAME EQ field->fld_name->sym_string + X.RDB$FIELD_NAME EQ field->fld_name->sym_string ERASE X; END_FOR; FOR X IN RDB$FIELD_DIMENSIONS WITH - X.RDB$FIELD_NAME EQ field->fld_name->sym_string + X.RDB$FIELD_NAME EQ field->fld_name->sym_string ERASE X; END_FOR; FOR X IN RDB$FIELDS WITH - X.RDB$FIELD_NAME EQ field->fld_name->sym_string + X.RDB$FIELD_NAME EQ field->fld_name->sym_string ERASE X; if_any = true; - END_FOR - + END_FOR + if (!if_any) DDL_err(65, SafeArg() << field->fld_name->sym_string); /* msg 65: field %s doesn't exist */ @@ -2347,11 +2347,11 @@ static void drop_index( DUDLEY_IDX index) /* Clean out index segments first. */ - FOR SEG IN RDB$INDEX_SEGMENTS WITH SEG.RDB$INDEX_NAME EQ name + FOR SEG IN RDB$INDEX_SEGMENTS WITH SEG.RDB$INDEX_NAME EQ name ERASE SEG; END_FOR; - FOR IDX IN RDB$INDICES WITH IDX.RDB$INDEX_NAME EQ name + FOR IDX IN RDB$INDICES WITH IDX.RDB$INDEX_NAME EQ name ERASE IDX; if_any = true; END_FOR; @@ -2389,7 +2389,7 @@ static void drop_relation( DUDLEY_REL relation) FOR X IN RDB$RELATIONS WITH X.RDB$RELATION_NAME EQ name if (X.RDB$SYSTEM_FLAG == 1) { DDL_err(68, SafeArg() << name); - // msg 68: can't drop system relation %s + // msg 68: can't drop system relation %s return; } if_any = true; @@ -2403,35 +2403,35 @@ static void drop_relation( DUDLEY_REL relation) /* First, get rid of the relation itself. This will speed things later on. */ - FOR X IN RDB$RELATIONS WITH X.RDB$RELATION_NAME EQ name + FOR X IN RDB$RELATIONS WITH X.RDB$RELATION_NAME EQ name ERASE X; END_FOR; /* Clean out RDB$INDICES, RDB$VIEW_RELATIONS and RDB$RELATION_FIELDS */ FOR IDX IN RDB$INDICES WITH IDX.RDB$RELATION_NAME EQ name - FOR SEG IN RDB$INDEX_SEGMENTS WITH - SEG.RDB$INDEX_NAME EQ IDX.RDB$INDEX_NAME + FOR SEG IN RDB$INDEX_SEGMENTS WITH + SEG.RDB$INDEX_NAME EQ IDX.RDB$INDEX_NAME ERASE SEG; END_FOR; ERASE IDX; END_FOR; - FOR X IN RDB$VIEW_RELATIONS WITH X.RDB$VIEW_NAME EQ name + FOR X IN RDB$VIEW_RELATIONS WITH X.RDB$VIEW_NAME EQ name ERASE X; END_FOR; - FOR X IN RDB$RELATION_FIELDS WITH X.RDB$RELATION_NAME EQ name + FOR X IN RDB$RELATION_FIELDS WITH X.RDB$RELATION_NAME EQ name ERASE X; END_FOR; /* Finally, get rid of any user privileges */ FOR PRIV IN RDB$USER_PRIVILEGES WITH PRIV.RDB$RELATION_NAME EQ name AND - PRIV.RDB$OBJECT_TYPE = obj_relation + PRIV.RDB$OBJECT_TYPE = obj_relation ERASE PRIV; - END_FOR - ON_ERROR + END_FOR + ON_ERROR END_ERROR; } @@ -2452,7 +2452,7 @@ static void drop_security_class( SCL scl_class) SYM name = scl_class->scl_name; - FOR X IN RDB$SECURITY_CLASSES WITH X.RDB$SECURITY_CLASS EQ name->sym_string + FOR X IN RDB$SECURITY_CLASSES WITH X.RDB$SECURITY_CLASS EQ name->sym_string ERASE X; if_any = true; END_FOR; @@ -2480,7 +2480,7 @@ static void drop_shadow( SLONG shadow_number) dudley_lls* first_file = NULL; FOR FIL IN RDB$FILES WITH - FIL.RDB$SHADOW_NUMBER EQ shadow_number + FIL.RDB$SHADOW_NUMBER EQ shadow_number ERASE FIL; SYM string = (SYM) DDL_alloc(SYM_LEN + strlen(FIL.RDB$FILE_NAME)); strcpy(string->sym_name, FIL.RDB$FILE_NAME); @@ -2494,8 +2494,8 @@ static void drop_shadow( SLONG shadow_number) /* msg 71: shadow %ld doesn't exist */ if (!dudleyGlob.DDL_errors) { - COMMIT - ON_ERROR + COMMIT + ON_ERROR DDL_db_error(gds_status, 72); /* msg 72: error commiting deletion of shadow */ ROLLBACK; @@ -2528,7 +2528,7 @@ static void drop_trigger( DUDLEY_TRG trigger) /* Clean out possible trigger messages first. */ - FOR TM IN RDB$TRIGGER_MESSAGES WITH TM.RDB$TRIGGER_NAME EQ name + FOR TM IN RDB$TRIGGER_MESSAGES WITH TM.RDB$TRIGGER_NAME EQ name ERASE TM; END_FOR; @@ -2547,14 +2547,14 @@ static void drop_trigger( DUDLEY_TRG trigger) WITH V.RDB$VIEW_NAME = relation_name FOR F IN RDB$RELATION_FIELDS CROSS T IN RDB$TRIGGERS OVER RDB$RELATION_NAME WITH - F.RDB$RELATION_NAME = V.RDB$VIEW_NAME + F.RDB$RELATION_NAME = V.RDB$VIEW_NAME others = true; END_FOR; if (!others) { FOR F IN RDB$RELATION_FIELDS WITH F.RDB$RELATION_NAME = V.RDB$VIEW_NAME - MODIFY F USING + MODIFY F USING F.RDB$UPDATE_FLAG = FALSE; END_MODIFY; END_FOR; @@ -2609,7 +2609,7 @@ static void drop_type( TYP fldtype) !strncmp(fldtype->typ_name->sym_string, "ALL", 3)) { FOR X IN RDB$TYPES WITH - X.RDB$FIELD_NAME EQ fldtype->typ_field_name->sym_string + X.RDB$FIELD_NAME EQ fldtype->typ_field_name->sym_string ERASE X; END_FOR; @@ -2618,7 +2618,7 @@ static void drop_type( TYP fldtype) FOR X IN RDB$TYPES WITH X.RDB$FIELD_NAME EQ fldtype->typ_field_name->sym_string AND - X.RDB$TYPE_NAME EQ fldtype->typ_name->sym_string + X.RDB$TYPE_NAME EQ fldtype->typ_name->sym_string ERASE X; if_any = true; END_FOR; @@ -2640,7 +2640,7 @@ static void drop_user_privilege( USERPRIV upriv) ************************************** * * Functional description - * Find and delete as many rdb$user_privilege entries + * Find and delete as many rdb$user_privilege entries * as needed for the REVOKE statement. * **************************************/ @@ -2655,7 +2655,7 @@ static void drop_user_privilege( USERPRIV upriv) field entries */ for (usr = upriv->userpriv_userlist; usr; usr = usr->usre_next) { - /* start with a fresh copy of privflag and erase each + /* start with a fresh copy of privflag and erase each privilege as we take care of it */ privflag = upriv->userpriv_flags & ~USERPRIV_grant; @@ -2726,7 +2726,7 @@ static void erase_userpriv( USERPRIV upriv, TEXT * priv, USRE usr, UPFE upf) X.RDB$PRIVILEGE EQ priv AND X.RDB$FIELD_NAME EQ fldname AND X.RDB$RELATION_NAME EQ relname AND - X.RDB$OBJECT_TYPE EQ obj_relation + X.RDB$OBJECT_TYPE EQ obj_relation ERASE X; if_any = true; @@ -2741,7 +2741,7 @@ static void erase_userpriv( USERPRIV upriv, TEXT * priv, USRE usr, UPFE upf) X.RDB$USER_TYPE EQ obj_user AND X.RDB$PRIVILEGE EQ priv AND X.RDB$RELATION_NAME EQ relname AND - X.RDB$OBJECT_TYPE EQ obj_relation + X.RDB$OBJECT_TYPE EQ obj_relation ERASE X; if_any = true; @@ -2831,7 +2831,7 @@ static void get_relations( DBB databaseL) DUDLEY_FLD field; SYM symbol; - FOR R IN RDB$RELATIONS + FOR R IN RDB$RELATIONS relation = (DUDLEY_REL) DDL_alloc(sizeof(dudley_rel)); relation->rel_name = symbol = get_symbol(SYM_relation, R.RDB$RELATION_NAME, (DUDLEY_CTX) relation); @@ -2840,8 +2840,8 @@ static void get_relations( DBB databaseL) relation->rel_next = dudleyGlob.database->dbb_relations; dudleyGlob.database->dbb_relations = relation; relation->rel_system = R.RDB$SYSTEM_FLAG; - FOR RFR IN RDB$RELATION_FIELDS WITH - RFR.RDB$RELATION_NAME = R.RDB$RELATION_NAME + FOR RFR IN RDB$RELATION_FIELDS WITH + RFR.RDB$RELATION_NAME = R.RDB$RELATION_NAME field = (DUDLEY_FLD) DDL_alloc(sizeof(dudley_fld)); field->fld_name = get_symbol(SYM_field, RFR.RDB$FIELD_NAME, (DUDLEY_CTX) field); @@ -2967,8 +2967,8 @@ static void get_triggers( DBB databaseL) DUDLEY_TRG trigger; SYM symbol, rel_name; - FOR T IN RDB$TRIGGERS WITH T.RDB$SYSTEM_FLAG MISSING OR - T.RDB$SYSTEM_FLAG = 0 + FOR T IN RDB$TRIGGERS WITH T.RDB$SYSTEM_FLAG MISSING OR + T.RDB$SYSTEM_FLAG = 0 trigger = (DUDLEY_TRG) DDL_alloc(sizeof(dudley_trg)); trigger->trg_name = symbol = @@ -3016,8 +3016,8 @@ static void get_udfs( DBB dbb) arg->funcarg_length = ARG.RDB$FIELD_LENGTH; arg->funcarg_sub_type = ARG.RDB$FIELD_SUB_TYPE; arg->funcarg_has_sub_type = !(ARG.RDB$FIELD_SUB_TYPE.NULL); - END_FOR - ON_ERROR + END_FOR + ON_ERROR END_ERROR; } @@ -3345,10 +3345,10 @@ static void modify_field( DUDLEY_FLD field) relation = field->fld_relation; SYM name = field->fld_name; - FOR FIRST 1 X IN RDB$RELATION_FIELDS WITH - X.RDB$FIELD_NAME EQ name->sym_string AND - X.RDB$RELATION_NAME EQ relation->rel_name->sym_string - MODIFY X USING + FOR FIRST 1 X IN RDB$RELATION_FIELDS WITH + X.RDB$FIELD_NAME EQ name->sym_string AND + X.RDB$RELATION_NAME EQ relation->rel_name->sym_string + MODIFY X USING if (field->fld_flags & fld_null_description) X.RDB$DESCRIPTION.NULL = TRUE; if (field->fld_flags & fld_null_security_class) @@ -3368,7 +3368,7 @@ static void modify_field( DUDLEY_FLD field) if (field->fld_source) MOVE_SYMBOL(field->fld_source, X.RDB$FIELD_SOURCE); - + if (field->fld_security_class) { MOVE_SYMBOL(field->fld_security_class, X.RDB$SECURITY_CLASS); X.RDB$SECURITY_CLASS.NULL = FALSE; @@ -3394,9 +3394,9 @@ static void modify_field( DUDLEY_FLD field) X.RDB$QUERY_HEADER.NULL = FALSE; } - END_MODIFY + END_MODIFY if_any = true; - END_FOR + END_FOR if (!if_any) DDL_err(82, SafeArg() << name->sym_string); /* msg 82: field %s doesn't exist */ @@ -3420,7 +3420,7 @@ static void modify_global_field( DUDLEY_FLD field) SYM name = field->fld_name; FOR FIRST 1 X IN RDB$FIELDS WITH X.RDB$FIELD_NAME EQ name->sym_string - MODIFY X USING + MODIFY X USING if (field->fld_dtype) { if ((X.RDB$FIELD_TYPE != blr_blob) && (field->fld_dtype != blr_blob)) { if ((check_range(field))) { @@ -3429,7 +3429,7 @@ static void modify_global_field( DUDLEY_FLD field) X.RDB$FIELD_SCALE = field->fld_scale; } } - else if (field->fld_dtype != X.RDB$FIELD_TYPE) + else if (field->fld_dtype != X.RDB$FIELD_TYPE) DDL_err(83, SafeArg() << name->sym_name); /* msg 83: Unauthorized attempt to change field %s to or from blob */ } @@ -3438,37 +3438,37 @@ static void modify_global_field( DUDLEY_FLD field) X.RDB$SYSTEM_FLAG = field->fld_system; else X.RDB$SYSTEM_FLAG = 0; - + if (field->fld_flags & fld_null_description) X.RDB$DESCRIPTION.NULL = TRUE; - + if (field->fld_flags & fld_null_missing_value) X.RDB$MISSING_VALUE.NULL = TRUE; - + if (field->fld_flags & fld_null_query_name) X.RDB$QUERY_NAME.NULL = TRUE; - + if (field->fld_flags & fld_null_query_header) X.RDB$QUERY_HEADER.NULL = TRUE; - + if (field->fld_flags & fld_null_edit_string) X.RDB$EDIT_STRING.NULL = TRUE; - + if (field->fld_flags & fld_null_validation) { X.RDB$VALIDATION_BLR.NULL = TRUE; X.RDB$VALIDATION_SOURCE.NULL = TRUE; } - + if (field->fld_segment_length) { X.RDB$SEGMENT_LENGTH = field->fld_segment_length; X.RDB$SEGMENT_LENGTH.NULL = FALSE; } - + if (field->fld_has_sub_type) { X.RDB$FIELD_SUB_TYPE = field->fld_sub_type; X.RDB$FIELD_SUB_TYPE.NULL = FALSE; } - + if (field->fld_missing) { store_blr(field->fld_missing, &X.RDB$MISSING_VALUE, NULL); X.RDB$MISSING_VALUE.NULL = FALSE; @@ -3495,10 +3495,10 @@ static void modify_global_field( DUDLEY_FLD field) store_query_header(field->fld_query_header, &X.RDB$QUERY_HEADER); X.RDB$QUERY_HEADER.NULL = FALSE; } - END_MODIFY + END_MODIFY if_any = true; - END_FOR - + END_FOR + if (!if_any) DDL_err(84, SafeArg() << name->sym_string); /* msg 84: field %s doesn't exist */ @@ -3521,7 +3521,7 @@ static void modify_index( DUDLEY_IDX index) bool if_any = false; FOR X IN RDB$INDICES WITH X.RDB$INDEX_NAME = index->idx_name->sym_string - MODIFY X USING + MODIFY X USING if (index->idx_flags & IDX_active_flag) { X.RDB$INDEX_INACTIVE = (index->idx_inactive) ? TRUE : FALSE; if (index->idx_flags & IDX_unique_flag) @@ -3570,9 +3570,9 @@ static void modify_relation( DUDLEY_REL relation) } SYM name = relation->rel_name; - FOR FIRST 1 X IN RDB$RELATIONS WITH X.RDB$RELATION_NAME EQ name->sym_string - MODIFY X USING - if (relation->rel_flags & rel_null_security_class) + FOR FIRST 1 X IN RDB$RELATIONS WITH X.RDB$RELATION_NAME EQ name->sym_string + MODIFY X USING + if (relation->rel_flags & rel_null_security_class) X.RDB$SECURITY_CLASS.NULL = TRUE; if (relation->rel_security_class) { MOVE_SYMBOL(relation->rel_security_class, X.RDB$SECURITY_CLASS); @@ -3589,16 +3589,16 @@ static void modify_relation( DUDLEY_REL relation) X.RDB$SYSTEM_FLAG = relation->rel_system; else X.RDB$SYSTEM_FLAG = 0; - + if (relation->rel_filename) { if (X.RDB$EXTERNAL_FILE.NULL) DDL_err(86, SafeArg() << name->sym_string); /* msg 86: relation %s is not external */ MOVE_SYMBOL(relation->rel_filename, X.RDB$EXTERNAL_FILE); } - END_MODIFY + END_MODIFY if_any = true; - END_FOR + END_FOR if (!if_any) DDL_err(87, SafeArg() << name->sym_string); @@ -3624,7 +3624,7 @@ static void modify_trigger( DUDLEY_TRG trigger) FOR FIRST 1 X IN RDB$TRIGGERS WITH X.RDB$TRIGGER_NAME EQ trigger->trg_name->sym_string - MODIFY X USING + MODIFY X USING if (relation = trigger->trg_relation) { TEXT* p = buffer; for (const TEXT* q = X.RDB$RELATION_NAME; *q && *q != ' ';) @@ -3633,7 +3633,7 @@ static void modify_trigger( DUDLEY_TRG trigger) if (strcmp(relation->rel_name->sym_string, buffer)) DDL_err(88, SafeArg() << trigger->trg_name->sym_string); /* msg 88: Invalid attempt to assign trigger %s to a new relation */ - } + } if (trigger->trg_mflag & trg_mflag_onoff) X.RDB$TRIGGER_INACTIVE = trigger->trg_inactive; if (trigger->trg_mflag & trg_mflag_type) @@ -3645,12 +3645,12 @@ static void modify_trigger( DUDLEY_TRG trigger) X.RDB$TRIGGER_SOURCE.NULL = FALSE; store_text(trigger->trg_source, &X.RDB$TRIGGER_SOURCE); } - + if (trigger->trg_statement) { X.RDB$TRIGGER_BLR.NULL = FALSE; store_blr(trigger->trg_statement, &X.RDB$TRIGGER_BLR, NULL); } - + if (trigger->trg_description) { X.RDB$DESCRIPTION.NULL = FALSE; store_text(trigger->trg_description, &X.RDB$DESCRIPTION); @@ -3682,7 +3682,7 @@ static void modify_trigger_msg( TRGMSG trigmsg) FOR FIRST 1 X IN RDB$TRIGGER_MESSAGES WITH X.RDB$TRIGGER_NAME EQ trigmsg->trgmsg_trg_name->sym_string AND X.RDB$MESSAGE_NUMBER = trigmsg->trgmsg_number; - MODIFY X USING + MODIFY X USING MOVE_SYMBOL(trigmsg->trgmsg_text, X.RDB$MESSAGE); END_MODIFY; if_any = true; @@ -3710,7 +3710,7 @@ static void modify_type( TYP fldtype) FOR FIRST 1 X IN RDB$TYPES WITH X.RDB$FIELD_NAME EQ fldtype->typ_field_name->sym_string AND X.RDB$TYPE_NAME EQ fldtype->typ_name->sym_string; - MODIFY X USING + MODIFY X USING X.RDB$TYPE = fldtype->typ_type; if (fldtype->typ_description) { X.RDB$DESCRIPTION.NULL = FALSE; @@ -3918,7 +3918,7 @@ static void store_blr( DUDLEY_NOD node, ISC_QUAD* blob_id, DUDLEY_REL relation) ISC_STATUS_ARRAY status_vector; FB_API_HANDLE handle; - blr.str_current = blr.str_start = + blr.str_current = blr.str_start = reinterpret_cast(gds__alloc(4096)); if (!blr.str_current) DDL_error_abort(NULL, 14); /* msg 14: memory exhausted */ @@ -3987,7 +3987,7 @@ static void store_range( DUDLEY_FLD field) { /************************************** * - * s t o r e _ r a n g e + * s t o r e _ r a n g e * ************************************** * @@ -4009,7 +4009,7 @@ static void store_range( DUDLEY_FLD field) for (range = field->fld_ranges, n = 0; n < field->fld_dimension; range += 2, ++n) { - STORE X IN RDB$FIELD_DIMENSIONS + STORE X IN RDB$FIELD_DIMENSIONS strcpy(X.RDB$FIELD_NAME, name); X.RDB$DIMENSION = n; X.RDB$LOWER_BOUND = range[0]; @@ -4057,7 +4057,7 @@ static void store_userpriv(USERPRIV upriv, * **************************************/ - STORE X IN RDB$USER_PRIVILEGES USING + STORE X IN RDB$USER_PRIVILEGES USING X.RDB$FIELD_NAME.NULL = TRUE; MOVE_SYMBOL(usr->usre_name, X.RDB$USER); diff --git a/src/dudley/extract.epp b/src/dudley/extract.epp index 2eaeb15b3a..439cfd36c8 100644 --- a/src/dudley/extract.epp +++ b/src/dudley/extract.epp @@ -110,7 +110,7 @@ enum EXT_flags { EXT_v4 = 256 }; -/* table used to determine capabilities, checking for specific +/* table used to determine capabilities, checking for specific fields in system relations */ struct rfr_tab_t { @@ -121,7 +121,7 @@ struct rfr_tab_t { static const rfr_tab_t rfr_table[] = { { "RDB$INDICES", "RDB$INDEX_INACTIVE", EXT_idx_inactive }, -/* Obsolete - 1996-Aug-05 David Schnepper +/* Obsolete - 1996-Aug-05 David Schnepper { "RDB$RELATIONS", "RDB$STORE_TRIGGER", EXT_triggers }, */ { "RDB$RELATIONS", "RDB$EXTERNAL_FILE", EXT_external }, @@ -161,7 +161,7 @@ void DDL_ext(void) else output_file = stdout; - if (!(dudleyGlob.DDL_default_user || dudleyGlob.DDL_default_password)) + if (!(dudleyGlob.DDL_default_user || dudleyGlob.DDL_default_password)) { #ifdef TRUSTED_AUTH if (dudleyGlob.DDL_trusted) @@ -290,7 +290,7 @@ static void decompile_blr_literal(const SCHAR* string) } static const SafeArg dummy; - + TEXT* b = buffer; switch (*p++) { @@ -346,12 +346,12 @@ static void extract_acls(void) const TEXT* relname; bool first = true; - - FOR S IN RDB$SECURITY_CLASSES + + FOR S IN RDB$SECURITY_CLASSES if (first) { put_comment(251); /* msg 251: \n\n\tSecurity Class Definitions / GRANT statements\t */ first = false; - } + } USHORT count = 0; /* if there's any rdb$user_privileges entry then we can use GRANT statement */ @@ -426,7 +426,7 @@ static void extract_computed(const TEXT * relation_name, bool first) * Check on the way by that we're not * trying to expand a computed field * that's been copied whole into a - * view. Meaning that if there is a + * view. Meaning that if there is a * view context, skip this field * **************************************/ @@ -436,14 +436,14 @@ static void extract_computed(const TEXT * relation_name, bool first) WITH RFR.RDB$RELATION_NAME = relation_name AND F.RDB$FIELD_NAME = RFR.RDB$FIELD_SOURCE AND F.RDB$COMPUTED_BLR NOT MISSING - SORTED BY RFR.RDB$FIELD_POSITION + SORTED BY RFR.RDB$FIELD_POSITION - if (RFR.RDB$VIEW_CONTEXT) + if (RFR.RDB$VIEW_CONTEXT) continue; - + if (!first) fprintf(output_file, ",\n"); - + first = false; name_trunc(RFR.RDB$FIELD_NAME, s); if (F.RDB$COMPUTED_SOURCE.NULL) { @@ -451,7 +451,7 @@ static void extract_computed(const TEXT * relation_name, bool first) continue; } fprintf(output_file, " %s", s); - + strcpy(s, F.RDB$FIELD_NAME); if (EXT_capabilities & EXT_v3) { FOR FNDA IN RDB$FIELDS WITH FNDA.RDB$FIELD_NAME = s @@ -468,7 +468,7 @@ static void extract_computed(const TEXT * relation_name, bool first) END_FOR; } fprintf(output_file, " computed by ("); - + print_blob(&F.RDB$COMPUTED_SOURCE, 'u'); fprintf(output_file, ")"); if (!RFR.RDB$FIELD_POSITION.NULL) @@ -476,7 +476,7 @@ static void extract_computed(const TEXT * relation_name, bool first) field_attributes(&RFR.RDB$DESCRIPTION, RFR.RDB$QUERY_NAME, &RFR.RDB$QUERY_HEADER, RFR.RDB$EDIT_STRING, RFR.RDB$SYSTEM_FLAG); - + END_FOR; } @@ -502,12 +502,12 @@ static void extract_database(const TEXT * DB_file_nameL) fprintf(output_file, "define database \"%s\"", DB_file_nameL); if (EXT_capabilities & EXT_security) { - FOR D IN RDB$DATABASE + FOR D IN RDB$DATABASE if (!blob_null(D.RDB$DESCRIPTION)) { fprintf(output_file, "\n\t{"); print_blob(&D.RDB$DESCRIPTION, 'u'); fprintf(output_file, "}"); - } + } if (!D.RDB$SECURITY_CLASS.NULL) { name_trunc(D.RDB$SECURITY_CLASS, s); if (*s) @@ -516,17 +516,17 @@ static void extract_database(const TEXT * DB_file_nameL) END_FOR; } else if (EXT_capabilities & EXT_db_description) - FOR D IN RDB$DATABASE + FOR D IN RDB$DATABASE if (!blob_null(D.RDB$DESCRIPTION)) { fprintf(output_file, "\n\t{"); print_blob(&D.RDB$DESCRIPTION, 'u'); fprintf(output_file, "}"); - } + } END_FOR; if (isc_database_info(status_vector, &DB, sizeof(db_items), db_items, sizeof(buffer), buffer)) { - put_error(254, 0); + put_error(254, 0); /* msg 254: ***isc_database_info failed*** */ gds__print_status(status_vector); } @@ -539,12 +539,12 @@ static void extract_database(const TEXT * DB_file_nameL) if (page_size) fprintf(output_file, "\n\tpage_size %"SLONGFORMAT, page_size); } - + if (EXT_capabilities & EXT_files) { if (EXT_capabilities & EXT_v3) { - FOR F IN RDB$FILES WITH F.RDB$SHADOW_NUMBER MISSING OR - F.RDB$SHADOW_NUMBER EQ 0 + FOR F IN RDB$FILES WITH F.RDB$SHADOW_NUMBER MISSING OR + F.RDB$SHADOW_NUMBER EQ 0 name_trunc(F.RDB$FILE_NAME, buffer); fprintf(output_file, "\n\tfile \"%s\" starting at page %ld", buffer, F.RDB$FILE_START); @@ -571,11 +571,11 @@ static void extract_database(const TEXT * DB_file_nameL) FOR F IN RDB$LOG_FILES if (F.RDB$FILE_FLAGS & LOG_overflow) continue; - + if (first_time) { first_time = false; fprintf(output_file, "\n\tlogfile"); - + if (F.RDB$FILE_FLAGS & LOG_default) break; else if (F.RDB$FILE_FLAGS & LOG_serial) @@ -584,21 +584,21 @@ static void extract_database(const TEXT * DB_file_nameL) need_close = true; fprintf(output_file, "\n\t\t("); } - + fprintf(output_file, "\n\t\t\"%s\"", F.RDB$FILE_NAME); } else fprintf(output_file, ",\n\t\t\"%s\"", F.RDB$FILE_NAME); - + if (F.RDB$FILE_LENGTH) fprintf(output_file, " size = %ld", F.RDB$FILE_LENGTH); - + if (F.RDB$FILE_PARTITIONS) fprintf(output_file, " partitions = %d", F.RDB$FILE_PARTITIONS); if (F.RDB$FILE_FLAGS & LOG_raw) fprintf(output_file, " raw"); - + END_FOR; if (need_close) @@ -607,13 +607,13 @@ static void extract_database(const TEXT * DB_file_nameL) FOR F IN RDB$LOG_FILES if (!(F.RDB$FILE_FLAGS & LOG_overflow)) continue; - + fprintf(output_file, "\n\toverflow"); fprintf(output_file, " \"%s\"", F.RDB$FILE_NAME); - + if (F.RDB$FILE_LENGTH) fprintf(output_file, " size = %ld", F.RDB$FILE_LENGTH); - + if (F.RDB$FILE_PARTITIONS) fprintf(output_file, " partitions = %d", F.RDB$FILE_PARTITIONS); @@ -688,12 +688,12 @@ static void extract_fields(void) bool first = true; FOR F IN RDB$FIELDS WITH (F.RDB$SYSTEM_FLAG NE 1 OR F.RDB$SYSTEM_FLAG MISSING) AND - F.RDB$COMPUTED_BLR MISSING SORTED BY F.RDB$FIELD_NAME + F.RDB$COMPUTED_BLR MISSING SORTED BY F.RDB$FIELD_NAME if (first) { put_comment(255); /*msg 255: \n\n\tGlobal Field Definitions\t */ first = false; - } + } name_trunc(F.RDB$FIELD_NAME, s); fprintf(output_file, "define field %s", s); if (F.RDB$FIELD_TYPE == blr_blob) { @@ -734,30 +734,30 @@ static void extract_fields(void) FNDA.RDB$FIELD_SUB_TYPE, 0, NULL); END_FOR; } - + } - + if (!blob_null(F.RDB$VALIDATION_SOURCE)) { fprintf(output_file, "\n\tvalid if ("); print_blob(&F.RDB$VALIDATION_SOURCE, 'u'); fprintf(output_file, ")"); } - + if (!blob_null(F.RDB$MISSING_VALUE)) { fprintf(output_file, "\n\tmissing_value is "); print_blob(&F.RDB$MISSING_VALUE, 'm'); } - + /* if (!blob_null (F.RDB$DEFAULT_VALUE)) default_value (&F.RDB$DEFAULT_VALUE); */ - + field_attributes(&F.RDB$DESCRIPTION, F.RDB$QUERY_NAME, &F.RDB$QUERY_HEADER, F.RDB$EDIT_STRING, F.RDB$SYSTEM_FLAG); fprintf(output_file, ";\n"); - + END_FOR; } @@ -766,7 +766,7 @@ static void extract_filters(void) { /************************************** * - * e x t r a c t _ f i l t e r s + * e x t r a c t _ f i l t e r s * ************************************** * @@ -870,7 +870,7 @@ static void extract_func_args(const TEXT * function_name) p = ","; first = false; } - + fprintf(output_file, "\t\t"); if (FARG.RDB$FIELD_TYPE == blr_blob) fprintf(output_file, " blob"); @@ -886,7 +886,7 @@ static void extract_func_args(const TEXT * function_name) fprintf(output_file, "reference"); else if (FARG.RDB$MECHANISM == FUNCARG_mechanism_sc_array_desc) fprintf(output_file, "scalar_array_descriptor"); - + FOR FUNC IN RDB$FUNCTIONS WITH FUNC.RDB$FUNCTION_NAME = function_name if (FARG.RDB$ARGUMENT_POSITION == FUNC.RDB$RETURN_ARGUMENT) { @@ -894,9 +894,9 @@ static void extract_func_args(const TEXT * function_name) fprintf(output_file, " return_argument"); else fprintf(output_file, " return_value"); - } + } END_FOR; - + END_FOR; } @@ -916,16 +916,16 @@ static void extract_generators(void) TEXT s[32]; bool first = true; - + FOR G IN RDB$GENERATORS WITH (G.RDB$SYSTEM_FLAG NE 1 OR G.RDB$SYSTEM_FLAG MISSING) - SORTED BY G.RDB$GENERATOR_NAME + SORTED BY G.RDB$GENERATOR_NAME if (first) { put_comment(290); /* msg 290: \n\n\tGenerator Definitions\t */ first = false; - } + } name_trunc(G.RDB$GENERATOR_NAME, s); - fprintf(output_file, "\ndefine generator %s;", s); + fprintf(output_file, "\ndefine generator %s;", s); END_FOR; } @@ -949,36 +949,36 @@ static void extract_grants(const TEXT * relname) if (EXT_capabilities & EXT_v4) { FOR U IN RDB$USER_PRIVILEGES WITH U.RDB$RELATION_NAME EQ relname AND U.RDB$OBJECT_TYPE EQ obj_relation - SORTED BY U.RDB$USER, U.RDB$PRIVILEGE + SORTED BY U.RDB$USER, U.RDB$PRIVILEGE switch (U.RDB$PRIVILEGE[0]) { case 'S': user_priv = "SELECT"; break; - + case 'U': user_priv = "UPDATE"; break; - + case 'D': user_priv = "DELETE"; break; - + case 'I': user_priv = "INSERT"; break; - + case 'R': /* None of the interfaces knows about the references privilege. Ignore it for now. */ - + continue; - + default: user_priv = "**unknown**"; break; } - + fprintf(output_file, "\ngrant %s ", user_priv); if (!U.RDB$FIELD_NAME.NULL) { name_trunc(U.RDB$FIELD_NAME, field_name); @@ -990,7 +990,7 @@ static void extract_grants(const TEXT * relname) if (U.RDB$GRANT_OPTION) fprintf(output_file, " with grant option"); fprintf(output_file, ";\n"); - + END_FOR; } else { @@ -999,30 +999,30 @@ static void extract_grants(const TEXT * relname) case 'S': user_priv = "SELECT"; break; - + case 'U': user_priv = "UPDATE"; break; - + case 'D': user_priv = "DELETE"; break; - + case 'I': user_priv = "INSERT"; break; - + case 'R': /* None of the interfaces knows about the references privilege. Ignore it for now. */ - + continue; - + default: user_priv = "**unknown**"; break; } - + fprintf(output_file, "\ngrant %s ", user_priv); if (!U.RDB$FIELD_NAME.NULL) { name_trunc(U.RDB$FIELD_NAME, field_name); @@ -1034,7 +1034,7 @@ static void extract_grants(const TEXT * relname) if (U.RDB$GRANT_OPTION) fprintf(output_file, " with grant option"); fprintf(output_file, ";\n"); - + END_FOR; } } @@ -1062,11 +1062,11 @@ static void extract_indexes(void) FOR I IN RDB$INDICES CROSS R IN RDB$RELATIONS OVER RDB$RELATION_NAME WITH(R.RDB$SYSTEM_FLAG NE 1 OR R.RDB$SYSTEM_FLAG MISSING) - SORTED BY I.RDB$RELATION_NAME, I.RDB$INDEX_NAME + SORTED BY I.RDB$RELATION_NAME, I.RDB$INDEX_NAME if (first) { put_comment(291); /* msg 291: \n\n\tIndex Definitions\t */ first = false; - } + } if (!I.RDB$UNIQUE_FLAG.NULL && I.RDB$UNIQUE_FLAG == 1) p = "unique"; else @@ -1075,37 +1075,37 @@ static void extract_indexes(void) name_trunc(I.RDB$RELATION_NAME, relation); fprintf(output_file, "\ndefine index %s for %s %s", index, relation, p); - + if (!blob_null(I.RDB$DESCRIPTION)) { fprintf(output_file, "\n\t{"); print_blob(&I.RDB$DESCRIPTION, 'u'); fprintf(output_file, "}"); } - + if (EXT_capabilities & EXT_idx_inactive) FOR ACT IN RDB$INDICES WITH ACT.RDB$INDEX_NAME = index - if (ACT.RDB$INDEX_INACTIVE) + if (ACT.RDB$INDEX_INACTIVE) fprintf(output_file, "\ninactive"); END_FOR; - + if (EXT_capabilities & EXT_v3) FOR ACT IN RDB$INDICES WITH ACT.RDB$INDEX_NAME = index if (ACT.RDB$INDEX_TYPE) fprintf(output_file, "\ndescending"); END_FOR; - - + + p = ""; - + FOR I_S IN RDB$INDEX_SEGMENTS WITH I_S.RDB$INDEX_NAME = I.RDB$INDEX_NAME SORTED BY I_S.RDB$FIELD_POSITION name_trunc(I_S.RDB$FIELD_NAME, field); fprintf(output_file, "%s\n\t%s", p, field); p = ","; - + END_FOR; - + fprintf(output_file, ";\n"); END_FOR; } @@ -1131,17 +1131,17 @@ static void extract_relations(void) if (EXT_capabilities & EXT_external) { FOR R IN RDB$RELATIONS WITH (R.RDB$SYSTEM_FLAG NE 1 OR R.RDB$SYSTEM_FLAG MISSING) AND - R.RDB$VIEW_BLR MISSING SORTED BY R.RDB$RELATION_NAME + R.RDB$VIEW_BLR MISSING SORTED BY R.RDB$RELATION_NAME if (first) { put_comment(258); /* msg 258: \n\n\tRelation Definitions\t */ first = false; - } + } name_trunc(R.RDB$RELATION_NAME, s); fprintf(output_file, "\ndefine relation %s", s); - + if (!R.RDB$EXTERNAL_FILE.NULL && name_trunc(R.RDB$EXTERNAL_FILE, s)) fprintf(output_file, "\n\texternal_file \"%s\"", s); - + if (R.RDB$SYSTEM_FLAG) fprintf(output_file, "\n\tsystem_flag %d", R.RDB$SYSTEM_FLAG); if (!blob_null(R.RDB$DESCRIPTION)) { @@ -1156,14 +1156,14 @@ static void extract_relations(void) else { FOR R IN RDB$RELATIONS WITH (R.RDB$SYSTEM_FLAG NE 1 OR R.RDB$SYSTEM_FLAG MISSING) AND - R.RDB$VIEW_BLR MISSING SORTED BY R.RDB$RELATION_NAME + R.RDB$VIEW_BLR MISSING SORTED BY R.RDB$RELATION_NAME if (first) { put_comment(258); /* msg 258: \n\n\tRelation Definitions\t */ first = false; - } + } name_trunc(R.RDB$RELATION_NAME, s); fprintf(output_file, "\ndefine relation %s", s); - + if (R.RDB$SYSTEM_FLAG) fprintf(output_file, "\n\tsystem_flag %d", R.RDB$SYSTEM_FLAG); if (!blob_null(R.RDB$DESCRIPTION)) { @@ -1201,24 +1201,24 @@ static void extract_rfr(const TEXT * relation_name) WITH RFR.RDB$RELATION_NAME = relation_name AND F.RDB$FIELD_NAME = RFR.RDB$FIELD_SOURCE AND F.RDB$COMPUTED_BLR MISSING - SORTED BY RFR.RDB$FIELD_POSITION + SORTED BY RFR.RDB$FIELD_POSITION fprintf(output_file, "%s\n", p); if (first) { p = ","; first = false; } - + name_trunc(RFR.RDB$FIELD_NAME, s); fprintf(output_file, " %s", s); if (strcmp(RFR.RDB$FIELD_NAME, RFR.RDB$FIELD_SOURCE)) { name_trunc(RFR.RDB$FIELD_SOURCE, s); fprintf(output_file, " based on %s", s); } - + if (!RFR.RDB$FIELD_POSITION.NULL) fprintf(output_file, "\tposition %d", RFR.RDB$FIELD_POSITION); - + field_attributes(&RFR.RDB$DESCRIPTION, RFR.RDB$QUERY_NAME, &RFR.RDB$QUERY_HEADER, RFR.RDB$EDIT_STRING, RFR.RDB$SYSTEM_FLAG); @@ -1232,7 +1232,7 @@ static void extract_security(void) { /************************************** * - * e x t r a c t _ s e c u r i t y + * e x t r a c t _ s e c u r i t y * ************************************** * @@ -1245,7 +1245,7 @@ static void extract_security(void) bool first = true; - FOR R IN RDB$RELATIONS + FOR R IN RDB$RELATIONS bool first_field = true; bool modify = false; name_trunc(R.RDB$RELATION_NAME, r); @@ -1260,7 +1260,7 @@ static void extract_security(void) /* extract if security_class is 'SQL$..' but relation_name doesn't match 'SQL$relation_name' */ /* extract if security_class doesn't start with 'SQL$' */ - + if (EXT_capabilities & EXT_v3) { if (strncmp(R.RDB$SECURITY_CLASS, "SQL$", 4) == 0) { int count = 0; @@ -1278,17 +1278,17 @@ static void extract_security(void) continue; } } - + if (first) { put_comment(259); /* msg 259: \n\tAdd Security Classes to Defined Objects\t\n */ first = false; } - + fprintf(output_file, "\nmodify %s %s\n\tsecurity_class %s", p, r, s); modify = true; } - + FOR RFR IN RDB$RELATION_FIELDS WITH RFR.RDB$RELATION_NAME EQ R.RDB$RELATION_NAME AND RFR.RDB$SECURITY_CLASS NOT MISSING @@ -1337,48 +1337,48 @@ static void extract_triggers(void) FOR T IN RDB$TRIGGERS WITH (T.RDB$SYSTEM_FLAG NE 1 OR T.RDB$SYSTEM_FLAG MISSING) - SORTED BY T.RDB$TRIGGER_NAME + SORTED BY T.RDB$TRIGGER_NAME if (first) { put_comment(260); /* msg 260: \n\n\tTrigger Definitions\t */ first = false; - } + } name_trunc(T.RDB$TRIGGER_NAME, st); fprintf(output_file, "\n\ndefine trigger %s", st); name_trunc(T.RDB$RELATION_NAME, s); fprintf(output_file, " for %s\n", s); - + if (T.RDB$TRIGGER_INACTIVE) fprintf(output_file, "\tinactive\n"); - + switch (T.RDB$TRIGGER_TYPE) { case (SSHORT) trg_store: fprintf(output_file, "\tpre store"); break; - + case (SSHORT) trg_post_store: fprintf(output_file, "\tpost store"); break; - + case (SSHORT) trg_modify: fprintf(output_file, "\tpre modify"); break; - + case (SSHORT) trg_post_modify: fprintf(output_file, "\tpost modify"); break; - + case (SSHORT) trg_pre_erase: fprintf(output_file, "\tpre erase"); break; - + case (SSHORT) trg_erase: fprintf(output_file, "\tpost erase"); break; - + default: put_comment(261); /* msg 261: ***** trigger type not understood **** */ } - + fprintf(output_file, " %d:\n", T.RDB$TRIGGER_SEQUENCE); if (T.RDB$TRIGGER_SOURCE.NULL) { put_error(262, st); @@ -1394,7 +1394,7 @@ static void extract_triggers(void) fprintf(output_file, "}"); } extract_trig_msgs(T.RDB$TRIGGER_NAME); - + fprintf(output_file, ";"); END_FOR; } @@ -1436,7 +1436,7 @@ static void extract_trig_msgs(const TEXT * trigger_name) fprintf(output_file, " %c%s%c", quote_char, TM.RDB$MESSAGE, quote_char); END_FOR; -} +} static void extract_view(const TEXT * rel_name, @@ -1519,7 +1519,7 @@ static void extract_views(void) extract_view(V.RDB$RELATION_NAME, &V.RDB$VIEW_SOURCE, &V.RDB$DESCRIPTION, source_null, desc_null, (V.RDB$SYSTEM_FLAG), &first); - + END_FOR; return; } @@ -1581,7 +1581,7 @@ static void extract_views(void) extract_view(V.RDB$RELATION_NAME, &V.RDB$VIEW_SOURCE, &V.RDB$DESCRIPTION, source_null, desc_null, (V.RDB$SYSTEM_FLAG), &first); - + END_FOR; did_any = true; *view_ptr = (*view_ptr)->view_next; @@ -1591,7 +1591,7 @@ static void extract_views(void) } } while (did_any); - // If any views remain, we can't figure out an order so just dump them + // If any views remain, we can't figure out an order so just dump them for (view* viewp = view_list; viewp; viewp = viewp->view_next) { FOR V IN RDB$RELATIONS WITH @@ -1601,7 +1601,7 @@ static void extract_views(void) extract_view(V.RDB$RELATION_NAME, &V.RDB$VIEW_SOURCE, &V.RDB$DESCRIPTION, source_null, desc_null, (V.RDB$SYSTEM_FLAG), &first); - + END_FOR; } } @@ -1740,7 +1740,7 @@ static void format_acl(const SCHAR * string) p += l; } -/* +/* Here we try to decompose the identifier. Views are easy, they're just views. If its not a view, it may be a user/group pair or just the user or just the group. Those are operating system dependant. Otherwise, its an Apollo identifier. @@ -1806,7 +1806,7 @@ static void print_blob(ISC_QUAD* blob_id, TEXT type) * unspecified, "m" for missing values * to decode, "h" meaning query * headers that need formatting and "a" - * for acls. + * for acls. * **************************************/ TEXT buffer[4096]; @@ -1908,7 +1908,7 @@ static void put_comment(USHORT number) ************************************** * * Functional description - * Retrieve a message from the error file, + * Retrieve a message from the error file, * format it, and print it in the output file * but not on the screen * @@ -1930,7 +1930,7 @@ static void put_error(USHORT number, const TEXT* arg1) ************************************** * * Functional description - * Retrieve a message from the error file, + * Retrieve a message from the error file, * format it, and print it in the output file * and on the screen * @@ -2048,9 +2048,9 @@ static void type_scalar(USHORT dtype, if (dim) { TEXT c = '('; - FOR D IN RDB$FIELD_DIMENSIONS WITH - D.RDB$FIELD_NAME EQ field_name - SORTED BY D.RDB$DIMENSION + FOR D IN RDB$FIELD_DIMENSIONS WITH + D.RDB$FIELD_NAME EQ field_name + SORTED BY D.RDB$DIMENSION if (D.RDB$LOWER_BOUND == 1) fprintf(output_file, "%c%ld", c, D.RDB$UPPER_BOUND); else @@ -2099,7 +2099,7 @@ static void view_fields(const TEXT * view_name) AND RFR.RDB$VIEW_CONTEXT != 0 AND VR.RDB$VIEW_NAME = RFR.RDB$RELATION_NAME AND VR.RDB$VIEW_CONTEXT = RFR.RDB$VIEW_CONTEXT - SORTED BY RFR.RDB$FIELD_POSITION + SORTED BY RFR.RDB$FIELD_POSITION if (!first) fprintf(output_file, ",\n"); else @@ -2119,11 +2119,11 @@ static void view_fields(const TEXT * view_name) } if (!RFR.RDB$FIELD_POSITION.NULL) fprintf(output_file, "\tposition %d", RFR.RDB$FIELD_POSITION); - + field_attributes(&RFR.RDB$DESCRIPTION, RFR.RDB$QUERY_NAME, &RFR.RDB$QUERY_HEADER, RFR.RDB$EDIT_STRING, RFR.RDB$SYSTEM_FLAG); - } + } END_FOR; extract_computed(view_name, first); diff --git a/src/gpre/gpre_meta.epp b/src/gpre/gpre_meta.epp index d8d9dd6053..82fe0bd280 100644 --- a/src/gpre/gpre_meta.epp +++ b/src/gpre/gpre_meta.epp @@ -1,28 +1,28 @@ /* * tab=4 *____________________________________________________________ - * + * * PROGRAM: C preprocessor * MODULE: gpre_meta.epp * DESCRIPTION: Meta data interface to system - * + * * The contents of this file are subject to the Interbase Public * License Version 1.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy * of the License at http://www.Inprise.com/IPL.html - * + * * Software distributed under the License is distributed on an * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express * or implied. See the License for the specific language governing * rights and limitations under the License. - * + * * The Original Code was created by Inprise Corporation * and its predecessors. Portions created by Inprise Corporation are * Copyright (C) Inprise Corporation. - * + * * All Rights Reserved. * Contributor(s): ______________________________________. - * + * * *____________________________________________________________ * @@ -83,10 +83,10 @@ static int upcase(const TEXT*, TEXT* const); #endif /*____________________________________________________________ - * + * * Lookup a field by name in a context. * If found, return field block. If not, return NULL. - */ + */ gpre_fld* MET_context_field( gpre_ctx* context, const char* string) { @@ -120,10 +120,10 @@ gpre_fld* MET_context_field( gpre_ctx* context, const char* string) /*____________________________________________________________ - * + * * Initialize meta data access to database. If the * database can't be opened, return false. - */ + */ bool MET_database(dbb* database, bool print_version) { @@ -134,8 +134,8 @@ bool MET_database(dbb* database, bool print_version) isc_info_db_sql_dialect, isc_info_end }; - /* - ** Each info item requested will return + /* + ** Each info item requested will return ** ** 1 byte for the info item tag ** 2 bytes for the length of the information that follows @@ -158,8 +158,8 @@ bool MET_database(dbb* database, bool print_version) return false; } -/* generate a dpb for the attach from the specified - * compiletime user name and password +/* generate a dpb for the attach from the specified + * compiletime user name and password */ Firebird::ClumpletWriter dpb(Firebird::ClumpletReader::Tagged, MAX_DPB_SIZE, isc_dpb_version1); @@ -177,14 +177,14 @@ bool MET_database(dbb* database, bool print_version) } #endif - if (isc_attach_database(gds_status, 0, database->dbb_filename, &DB, - dpb.getBufferLength(), + if (isc_attach_database(gds_status, 0, database->dbb_filename, &DB, + dpb.getBufferLength(), reinterpret_cast(dpb.getBuffer()))) { - /* We failed to attach, try in read only mode just in case + /* We failed to attach, try in read only mode just in case dpb.insertByte(isc_dpb_set_db_readonly, true); - if (isc_attach_database(gds_status, 0, database->dbb_filename, &DB, - dpb.getBufferLength(), + if (isc_attach_database(gds_status, 0, database->dbb_filename, &DB, + dpb.getBufferLength(), reinterpret_cast(dpb.getBuffer()))) { */ isc_print_status(gds_status); @@ -214,7 +214,7 @@ bool MET_database(dbb* database, bool print_version) const UCHAR item = *ptr++; const USHORT length = isc_vax_integer((char*)ptr, sizeof(USHORT)); ptr += sizeof(USHORT); - + switch (item) { case isc_info_base_level: gpreGlob.sw_server_version = (USHORT) ptr[1]; @@ -227,7 +227,7 @@ bool MET_database(dbb* database, bool print_version) case isc_info_db_sql_dialect: gpreGlob.compiletime_db_dialect = isc_vax_integer((char*)ptr, length); break; - + case isc_info_error: /* Error indicates that one of the option was not understood by thr server. Make sure it was @@ -240,7 +240,7 @@ bool MET_database(dbb* database, bool print_version) printf("Internal error: Unexpected isc_info_value %d\n", item); break; - + default: printf("Internal error: Unexpected isc_info_value %d\n", item); break; @@ -281,7 +281,7 @@ bool MET_database(dbb* database, bool print_version) SCHAR buffer[16]; -// get the base level of the engine +// get the base level of the engine if (isc_database_info(gds_status, &DB, sizeof(db_version_info), db_version_info, sizeof(buffer), buffer)) @@ -290,9 +290,9 @@ bool MET_database(dbb* database, bool print_version) return false; } -/* this seems like a lot of rigamarole to read one info item, - * but it provides for easy extensibility in case we need - * more info items later +/* this seems like a lot of rigamarole to read one info item, + * but it provides for easy extensibility in case we need + * more info items later */ const SCHAR* data = buffer; @@ -302,19 +302,19 @@ bool MET_database(dbb* database, bool print_version) data += sizeof(USHORT); switch (item) { - /* This flag indicates the version level of the engine - itself, so we can tell what capabilities the engine + /* This flag indicates the version level of the engine + itself, so we can tell what capabilities the engine code itself (as opposed to the on-disk structure). - Apparently the base level up to now indicated the major - version number, but for 4.1 the base level is being - incremented, so the base level indicates an engine version + Apparently the base level up to now indicated the major + version number, but for 4.1 the base level is being + incremented, so the base level indicates an engine version as follows: 1 == v1.x 2 == v2.x 3 == v3.x 4 == v4.0 only 5 == v4.1 - Note: this info item is so old it apparently uses an + Note: this info item is so old it apparently uses an archaic format, not a standard vax integer format. */ @@ -335,10 +335,10 @@ bool MET_database(dbb* database, bool print_version) /*____________________________________________________________ - * + * * Lookup a domain by name. * Initialize the size of the field. - */ + */ bool MET_domain_lookup(gpre_req* request, gpre_fld* field, const char* string) { @@ -416,7 +416,7 @@ bool MET_domain_lookup(gpre_req* request, gpre_fld* field, const char* string) } else { FOR(REQUEST_HANDLE database->dbb_domain_request) - F IN RDB$FIELDS WITH F.RDB$FIELD_NAME EQ name + F IN RDB$FIELDS WITH F.RDB$FIELD_NAME EQ name found = true; field->fld_length = F.RDB$FIELD_LENGTH; field->fld_scale = F.RDB$FIELD_SCALE; @@ -447,9 +447,9 @@ bool MET_domain_lookup(gpre_req* request, gpre_fld* field, const char* string) /*____________________________________________________________ - * + * * Gets the default value for a domain of an existing table - */ + */ bool MET_get_domain_default(dbb* database, const TEXT* domain_name, @@ -477,7 +477,7 @@ bool MET_get_domain_default(dbb* database, if (!GLOB_FLD.RDB$DEFAULT_VALUE.NULL) { ISC_QUAD* blob_id = &GLOB_FLD.RDB$DEFAULT_VALUE; - // open the blob + // open the blob isc_blob_handle blob_handle = 0; ISC_STATUS stat = isc_open_blob2(status_vect, &DB, &gds_trans, &blob_handle, blob_id, sizeof(blr_bpb), @@ -486,7 +486,7 @@ bool MET_get_domain_default(dbb* database, isc_print_status(status_vect); CPR_exit(FINI_ERROR); } - // fetch segments. Assume buffer is big enough. + // fetch segments. Assume buffer is big enough. TEXT* ptr_in_buffer = buffer; while (true) { @@ -499,7 +499,7 @@ bool MET_get_domain_default(dbb* database, if (!stat) continue; if (stat == isc_segstr_eof) { - // null terminate the buffer + // null terminate the buffer *ptr_in_buffer = 0; break; } @@ -517,7 +517,7 @@ bool MET_get_domain_default(dbb* database, has_default = true; } - else { // default not found + else { // default not found if (gpreGlob.sw_sql_dialect > SQL_DIALECT_V5) buffer[0] = blr_version5; @@ -532,16 +532,16 @@ bool MET_get_domain_default(dbb* database, /*____________________________________________________________ - * + * * Gets the default value for a column of an existing table. * Will check the default for the column of the table, if that is * not present, will check for the default of the relevant domain - * + * * The default blr is returned in buffer. The blr is of the form * blr_version4 blr_literal ..... blr_eoc - * + * * Reads the system tables RDB$FIELDS and RDB$RELATION_FIELDS. - */ + */ bool MET_get_column_default(const gpre_rel* relation, const TEXT* column_name, @@ -570,7 +570,7 @@ bool MET_get_column_default(const gpre_rel* relation, RFR.RDB$FIELD_SOURCE EQ F.RDB$FIELD_NAME AND RFR.RDB$FIELD_NAME EQ name AND RFR.RDB$RELATION_NAME EQ relation->rel_symbol->sym_string - + ISC_QUAD* blob_id; if (!RFR.RDB$DEFAULT_VALUE.NULL) { blob_id = &RFR.RDB$DEFAULT_VALUE; @@ -585,7 +585,7 @@ bool MET_get_column_default(const gpre_rel* relation, } if (has_default) { - // open the blob + // open the blob isc_blob_handle blob_handle = 0; ISC_STATUS stat = isc_open_blob2(status_vect, &DB, &gds_trans, &blob_handle, blob_id, sizeof(blr_bpb), @@ -595,7 +595,7 @@ bool MET_get_column_default(const gpre_rel* relation, CPR_exit(FINI_ERROR); } - // fetch segments. Assuming here that the buffer is big enough. + // fetch segments. Assuming here that the buffer is big enough. TEXT* ptr_in_buffer = buffer; while (true) { @@ -607,7 +607,7 @@ bool MET_get_column_default(const gpre_rel* relation, if (!stat) continue; if (stat == isc_segstr_eof) { - // null terminate the buffer + // null terminate the buffer *ptr_in_buffer = 0; break; } @@ -639,11 +639,11 @@ bool MET_get_column_default(const gpre_rel* relation, /*____________________________________________________________ - * + * * Lookup the fields for the primary key * index on a relation, returning a list * of the fields. - */ + */ gpre_lls* MET_get_primary_key(dbb* database, const TEXT* relation_name) { @@ -673,7 +673,7 @@ gpre_lls* MET_get_primary_key(dbb* database, const TEXT* relation_name) WITH Z.RDB$RELATION_NAME EQ name AND Z.RDB$CONSTRAINT_TYPE EQ "PRIMARY KEY" SORTED BY Y.RDB$FIELD_POSITION - + str* field_name = (str*) MSC_string(Y.RDB$FIELD_NAME); // Strip off any trailing spaces from field name // CVC: This code stops at the first space, even in the middle. @@ -693,10 +693,10 @@ gpre_lls* MET_get_primary_key(dbb* database, const TEXT* relation_name) /*____________________________________________________________ - * + * * Lookup a field by name in a relation. * If found, return field block. If not, return NULL. - */ + */ gpre_fld* MET_field(gpre_rel* relation, const char* string) { @@ -844,9 +844,9 @@ gpre_fld* MET_field(gpre_rel* relation, const char* string) /*____________________________________________________________ - * + * * Return a list of the fields in a relation - */ + */ GPRE_NOD MET_fields(gpre_ctx* context) { @@ -927,9 +927,9 @@ GPRE_NOD MET_fields(gpre_ctx* context) /*____________________________________________________________ - * + * * Shutdown all attached databases. - */ + */ void MET_fini(dbb* end) { @@ -966,10 +966,10 @@ void MET_fini(dbb* end) /*____________________________________________________________ - * + * * Lookup a generator by name. * If found, return string. If not, return NULL. - */ + */ const SCHAR* MET_generator(const TEXT* string, dbb* database) { @@ -987,9 +987,9 @@ const SCHAR* MET_generator(const TEXT* string, dbb* database) /*____________________________________________________________ - * + * * Compute internal datatype and length based on system relation field values. - */ + */ USHORT MET_get_dtype(USHORT blr_dtype, USHORT sub_type, USHORT* length) { @@ -1076,12 +1076,12 @@ USHORT MET_get_dtype(USHORT blr_dtype, USHORT sub_type, USHORT* length) /*____________________________________________________________ - * + * * Lookup a procedure (represented by a token) in a database. * Return a procedure block (if name is found) or NULL. - * + * * This function has been cloned into MET_get_udf - */ + */ gpre_prc* MET_get_procedure(dbb* database, const TEXT* string, const TEXT* owner_name) { @@ -1095,7 +1095,7 @@ gpre_prc* MET_get_procedure(dbb* database, const TEXT* string, const TEXT* owner procedure->prc_database == database && (!owner[0] || (procedure->prc_owner - && !strcmp(owner, procedure->prc_owner->sym_string)))) + && !strcmp(owner, procedure->prc_owner->sym_string)))) { break; } @@ -1191,10 +1191,10 @@ gpre_prc* MET_get_procedure(dbb* database, const TEXT* string, const TEXT* owner /*____________________________________________________________ - * + * * Lookup a relation (represented by a token) in a database. * Return a relation block (if name is found) or NULL. - */ + */ gpre_rel* MET_get_relation(dbb* database, const TEXT* string, const TEXT* owner_name) { @@ -1217,8 +1217,8 @@ gpre_rel* MET_get_relation(dbb* database, const TEXT* string, const TEXT* owner_ /*____________________________________________________________ - * - */ + * + */ INTLSYM MET_get_text_subtype(SSHORT ttype) { @@ -1231,17 +1231,17 @@ INTLSYM MET_get_text_subtype(SSHORT ttype) /*____________________________________________________________ - * + * * Lookup a udf (represented by a token) in a database. * Return a udf block (if name is found) or NULL. - * + * * This function was cloned from MET_get_procedure - */ + */ udf* MET_get_udf(dbb* database, const TEXT* string) { MetIdentifier name(string); - + udf* the_udf = NULL; for (gpre_sym* symbol = HSH_lookup(name); symbol; symbol = symbol->sym_homonym) { @@ -1259,7 +1259,7 @@ udf* MET_get_udf(dbb* database, const TEXT* string) return the_udf; if (database->dbb_flags & DBB_v3) { - // Version of V4 request without new V4 metadata + // Version of V4 request without new V4 metadata FOR(REQUEST_HANDLE database->dbb_udf_request) UDF_DEF IN RDB$FUNCTIONS CROSS UDF_ARG IN RDB$FUNCTION_ARGUMENTS @@ -1293,7 +1293,7 @@ udf* MET_get_udf(dbb* database, const TEXT* string) END_FOR; } else { - // Same request as above, but with V4 metadata also fetched + // Same request as above, but with V4 metadata also fetched FOR(REQUEST_HANDLE database->dbb_udf_request) UDF_DEF IN RDB$FUNCTIONS CROSS UDF_ARG IN RDB$FUNCTION_ARGUMENTS @@ -1340,15 +1340,15 @@ udf* MET_get_udf(dbb* database, const TEXT* string) /*____________________________________________________________ - * - * Return relation if the passed view_name represents a - * view with the passed relation as a base table + * + * Return relation if the passed view_name represents a + * view with the passed relation as a base table * (the relation could be an alias). - */ + */ gpre_rel* MET_get_view_relation(gpre_req* request, const char* view_name, - const char* relation_or_alias, + const char* relation_or_alias, USHORT level) { dbb* database = request->req_database; @@ -1374,7 +1374,7 @@ gpre_rel* MET_get_view_relation(gpre_req* request, return MET_get_relation(database, X.RDB$RELATION_NAME, ""); } - if (relation = MET_get_view_relation(request, X.RDB$RELATION_NAME, + if (relation = MET_get_view_relation(request, X.RDB$RELATION_NAME, relation_or_alias, level + 1)) { return relation; @@ -1387,10 +1387,10 @@ gpre_rel* MET_get_view_relation(gpre_req* request, /*____________________________________________________________ - * + * * Lookup an index for a database. * Return an index block (if name is found) or NULL. - */ + */ IND MET_index(dbb* database, const TEXT* string) { @@ -1431,12 +1431,12 @@ IND MET_index(dbb* database, const TEXT* string) /*____________________________________________________________ - * + * * Load all of the relation names, procedure names * and user defined function names * into the symbol (hash) table. * Includes also charsets and collations. - */ + */ void MET_load_hash_table(dbb* database) { @@ -1454,7 +1454,7 @@ void MET_load_hash_table(dbb* database) } if (database->dbb_transaction) { - // we must have already loaded this one + // we must have already loaded this one return; } @@ -1465,13 +1465,13 @@ void MET_load_hash_table(dbb* database) database->dbb_transaction = gds_trans; -// Determine if the database is V3. +// Determine if the database is V3. bool post_v3_flag = false; FB_API_HANDLE handle = 0; FOR(REQUEST_HANDLE handle) X IN RDB$RELATIONS WITH X.RDB$RELATION_NAME = 'RDB$PROCEDURES' AND - X.RDB$SYSTEM_FLAG = 1 + X.RDB$SYSTEM_FLAG = 1 post_v3_flag = true; END_FOR; @@ -1555,7 +1555,7 @@ void MET_load_hash_table(dbb* database) MSC_symbol(SYM_username, X.RDB$OWNER_NAME, length, NULL); END_FOR ON_ERROR - // assume pre V4 database, no procedures + // assume pre V4 database, no procedures END_ERROR; if (handle) @@ -1625,7 +1625,7 @@ void MET_load_hash_table(dbb* database) /* Pick up all Collation names, might have several collations * for a given character set. * There can also be several alias names for a character set. - */ + */ FOR(REQUEST_HANDLE handle) CHARSET IN RDB$CHARACTER_SETS CROSS COLL IN RDB$COLLATIONS OVER @@ -1670,7 +1670,7 @@ void MET_load_hash_table(dbb* database) END_FOR ON_ERROR - // assume pre V4 database, no collations + // assume pre V4 database, no collations END_ERROR; isc_release_request(gds_status, &handle); @@ -1679,7 +1679,7 @@ void MET_load_hash_table(dbb* database) /* Now pick up all character set names - with the subtype set to * the type of the default collation for the character set. - */ + */ FOR(REQUEST_HANDLE handle) CHARSET IN RDB$CHARACTER_SETS CROSS COLL IN RDB$COLLATIONS WITH CHARSET.RDB$DEFAULT_COLLATE_NAME EQ COLL.RDB$COLLATION_NAME; @@ -1721,14 +1721,14 @@ void MET_load_hash_table(dbb* database) END_FOR ON_ERROR - // assume pre V4 database, no character sets + // assume pre V4 database, no character sets END_ERROR; isc_release_request(gds_status, &handle); if (handle2) isc_release_request(gds_status, &handle2); -// Pick up name of database default character set for SQL +// Pick up name of database default character set for SQL FOR(REQUEST_HANDLE handle) FIRST 1 DBB IN RDB$DATABASE @@ -1743,12 +1743,12 @@ void MET_load_hash_table(dbb* database) CPR_warn("Default character set for database is not known"); END_FOR ON_ERROR - // Assume V3 Db, no default charset + // Assume V3 Db, no default charset END_ERROR; isc_release_request(gds_status, &handle); -// Pick up all generators for the database +// Pick up all generators for the database FOR(REQUEST_HANDLE handle) X IN RDB$GENERATORS @@ -1756,7 +1756,7 @@ void MET_load_hash_table(dbb* database) fb_utils::name_length(X.RDB$GENERATOR_NAME), (gpre_ctx*) database); HSH_insert(symbol); - END_FOR + END_FOR ON_ERROR // Nothing END_ERROR; @@ -1765,7 +1765,7 @@ void MET_load_hash_table(dbb* database) /* now that we have attached to the database, resolve the character set * request (if any) (and if we can) - */ + */ if (database->dbb_c_lc_ctype) { if (get_intl_char_subtype @@ -1788,9 +1788,9 @@ void MET_load_hash_table(dbb* database) /*____________________________________________________________ - * + * * Make a field symbol. - */ + */ gpre_fld* MET_make_field(const SCHAR* name, SSHORT dtype, @@ -1810,9 +1810,9 @@ gpre_fld* MET_make_field(const SCHAR* name, /*____________________________________________________________ - * + * * Make an index symbol. - */ + */ IND MET_make_index(const SCHAR* name) { @@ -1824,9 +1824,9 @@ IND MET_make_index(const SCHAR* name) /*____________________________________________________________ - * + * * Make an relation symbol. - */ + */ gpre_rel* MET_make_relation(const SCHAR* name) { @@ -1839,9 +1839,9 @@ gpre_rel* MET_make_relation(const SCHAR* name) /*____________________________________________________________ - * + * * Lookup a type name for a field. - */ + */ bool MET_type(gpre_fld* field, const TEXT* string, @@ -1865,7 +1865,7 @@ bool MET_type(gpre_fld* field, DB = database->dbb_handle; gds_trans = database->dbb_transaction; -// Force the name to uppercase, using C locale rules for uppercasing +// Force the name to uppercase, using C locale rules for uppercasing UCHAR* p; for (p = buffer; *string && p < &buffer[sizeof(buffer) - 1]; ++p, ++string) @@ -1894,12 +1894,12 @@ bool MET_type(gpre_fld* field, /*____________________________________________________________ - * + * * Lookup an index for a database. - * + * * Return: true if the trigger exists * false otherwise - */ + */ bool MET_trigger_exists(dbb* database, const TEXT* trigger_name) @@ -1910,7 +1910,7 @@ bool MET_trigger_exists(dbb* database, gds_trans = database->dbb_transaction; FOR(REQUEST_HANDLE database->dbb_trigger_request) - TRIG IN RDB$TRIGGERS WITH TRIG.RDB$TRIGGER_NAME EQ name + TRIG IN RDB$TRIGGERS WITH TRIG.RDB$TRIGGER_NAME EQ name return true; END_FOR; @@ -1919,9 +1919,9 @@ bool MET_trigger_exists(dbb* database, /*____________________________________________________________ - * + * * Compute and return the size of the array. - */ + */ static SLONG array_size( gpre_fld* field) { @@ -1939,9 +1939,9 @@ static SLONG array_size( gpre_fld* field) /*____________________________________________________________ - * + * * See if field is array. - */ + */ static void get_array(dbb* database, const TEXT* field_name, gpre_fld* field) { @@ -1969,7 +1969,7 @@ static void get_array(dbb* database, const TEXT* field_name, gpre_fld* field) field->fld_array_info = array_block = (ary*) MSC_alloc(ARY_LEN); //(ary*) MSC_alloc(ARY_LEN(F.RDB$DIMENSIONS)); array_block->ary_dtype = sub_field->fld_dtype; - } + } END_FOR ON_ERROR { database->dbb_flags |= DBB_no_arrays; @@ -2006,29 +2006,29 @@ static void get_array(dbb* database, const TEXT* field_name, gpre_fld* field) // it happened in the past due to buggy DYN code. fb_assert(last_dimension_block); fb_assert(dimension_counter == field_dimensions); - + array_block->ary_dimension_count = last_dimension_block->dim_number + 1; array_block->ary_size = array_size(field); } /*____________________________________________________________ - * + * * Character types can be specified as either: * b) A POSIX style locale name "." * or * c) A simple name (using default collation) * d) A simple name (use charset for collation) - * + * * Given an ASCII7 string which could be any of the above, try to * resolve the name in the order b, c, d. * b) is only tried iff the name contains a period. * (in which case c) and d) are not tried). - * + * * Return: * true if no errors (and *id is set). * false if the name could not be resolved. - */ + */ static bool get_intl_char_subtype( SSHORT* id, @@ -2047,14 +2047,14 @@ static bool get_intl_char_subtype( gds_trans = database->dbb_transaction; const UCHAR* const end_name = name + length; -/* Force key to uppercase, following C locale rules for uppercasing +/* Force key to uppercase, following C locale rules for uppercasing * At the same time, search for the first period in the string (if any) */ UCHAR* period = NULL; UCHAR* p; for (p = buffer; name < end_name && p < (buffer + sizeof(buffer) - 1); - p++, name++) + p++, name++) { *p = UPPER7(*name); if ((*p == '.') && !period) @@ -2079,35 +2079,35 @@ static bool get_intl_char_subtype( /*____________________________________________________________ - * + * * Given ASCII7 name of charset & collation * resolve the specification to a ttype (id) that implements * it. - * + * * Inputs: - * (charset) + * (charset) * ASCII7z name of characterset. * NULL (implying unspecified) means use the character set * for defined for (collation). - * + * * (collation) * ASCII7z name of collation. * NULL means use the default collation for (charset). - * + * * Outputs: - * (*id) + * (*id) * Set to subtype specified by this name. - * + * * Return: * true if no errors (and *id is set). * false if either name not found. * or if names found, but the collation isn't for the specified * character set. - */ + */ static bool resolve_charset_and_collation( SSHORT* id, - const UCHAR* charset, + const UCHAR* charset, const UCHAR* collation) { fb_assert(id != NULL); @@ -2117,7 +2117,7 @@ static bool resolve_charset_and_collation( bool found = false; FB_API_HANDLE request = 0; - + if (collation == NULL) { if (charset == NULL) { FOR(REQUEST_HANDLE request) @@ -2129,7 +2129,7 @@ static bool resolve_charset_and_collation( END_FOR ON_ERROR - // Assume V3 DB, without default character set + // Assume V3 DB, without default character set END_ERROR; isc_release_request(gds_status, &request); @@ -2204,7 +2204,7 @@ static bool resolve_charset_and_collation( #ifdef NOT_USED_OR_REPLACED /*____________________________________________________________ - * + * * Upcase a string into another string. Return * length of string. */ diff --git a/src/isql/extract.epp b/src/isql/extract.epp index db2fc7a2c8..360050dac9 100644 --- a/src/isql/extract.epp +++ b/src/isql/extract.epp @@ -44,7 +44,7 @@ #include #include #include -#include // isdigit +#include // isdigit #include "../jrd/common.h" #include "../jrd/constants.h" #include "../jrd/ibase.h" @@ -336,7 +336,7 @@ int EXTRACT_list_table(const SCHAR* relation_name, END_ERROR; } -// Query to obtain relation detail information +// Query to obtain relation detail information FOR REL IN RDB$RELATIONS CROSS RFR IN RDB$RELATION_FIELDS CROSS @@ -352,7 +352,7 @@ int EXTRACT_list_table(const SCHAR* relation_name, if (first) { first = false; - // Do we need to print domains + // Do we need to print domains if (domain_flag) list_domain_table (relation_name, default_char_set_id); @@ -362,7 +362,7 @@ int EXTRACT_list_table(const SCHAR* relation_name, relation_name, REL.RDB$OWNER_NAME, NEWLINE); - + if (rel_type == rel_global_temp_preserve || rel_type == rel_global_temp_delete) { @@ -372,7 +372,7 @@ int EXTRACT_list_table(const SCHAR* relation_name, { isqlGlob.printf("CREATE TABLE "); } - + if (isqlGlob.db_SQL_dialect > SQL_DIALECT_V6_TRANSITION) { if (new_name) @@ -381,11 +381,11 @@ int EXTRACT_list_table(const SCHAR* relation_name, ISQL_copy_SQL_id (relation_name, SQL_identifier, DBL_QUOTE); isqlGlob.printf("%s ", SQL_identifier); } - else + else { isqlGlob.printf("%s ", new_name ? new_name : relation_name); } - + if (!REL.RDB$EXTERNAL_FILE.NULL) { ISQL_copy_SQL_id (REL.RDB$EXTERNAL_FILE, SQL_identifier2, @@ -447,7 +447,7 @@ int EXTRACT_list_table(const SCHAR* relation_name, } else { - // Look through types array + // Look through types array for (int i = 0; Column_types[i].type; i++) { if (FLD.RDB$FIELD_TYPE == Column_types[i].type) @@ -456,7 +456,7 @@ int EXTRACT_list_table(const SCHAR* relation_name, if (isqlGlob.major_ods >= ODS_VERSION10) { - // Handle Integral subtypes NUMERIC and DECIMAL + // Handle Integral subtypes NUMERIC and DECIMAL if ((FLD.RDB$FIELD_TYPE == SMALLINT) || (FLD.RDB$FIELD_TYPE == INTEGER) || (FLD.RDB$FIELD_TYPE == BIGINT)) @@ -489,7 +489,7 @@ int EXTRACT_list_table(const SCHAR* relation_name, if (!precision_known) { - // Take a stab at numerics and decimals + // Take a stab at numerics and decimals if ((FLD.RDB$FIELD_TYPE == SMALLINT) && (FLD.RDB$FIELD_SCALE < 0)) { @@ -530,7 +530,7 @@ int EXTRACT_list_table(const SCHAR* relation_name, } } - // Catch arrays after printing the type + // Catch arrays after printing the type if (!FLD.RDB$DIMENSIONS.NULL) ISQL_array_dimensions (FLD.RDB$FIELD_NAME); @@ -549,14 +549,14 @@ int EXTRACT_list_table(const SCHAR* relation_name, (USHORT) FLD.RDB$SEGMENT_LENGTH); } - // International character sets + // International character sets if ((FLD.RDB$FIELD_TYPE == T_CHAR || FLD.RDB$FIELD_TYPE == VARCHAR || FLD.RDB$FIELD_TYPE == BLOB) && !FLD.RDB$CHARACTER_SET_ID.NULL) { char_sets[0] = '\0'; - // Override rdb$fields id with relation_fields if present + // Override rdb$fields id with relation_fields if present if (!RFR.RDB$COLLATION_ID.NULL) collation = RFR.RDB$COLLATION_ID; @@ -577,7 +577,7 @@ int EXTRACT_list_table(const SCHAR* relation_name, } - // Handle defaults for columns + // Handle defaults for columns if (!RFR.RDB$DEFAULT_SOURCE.NULL) { @@ -711,7 +711,7 @@ static bool extract_rel_constraints(const char* relation_name) isqlGlob.printf("PRIMARY KEY (%s)", collist); else //if (!strncmp (RELC.RDB$CONSTRAINT_TYPE, "UNIQUE", 6)) // redundant isqlGlob.printf("UNIQUE (%s)", collist); - + // Yes, the same RDB$... naming convention is used for both domains and indices. const bool explicit_index = (isPK && !fb_utils::implicit_pk(IDX.RDB$INDEX_NAME) || !isPK && !fb_utils::implicit_domain(IDX.RDB$INDEX_NAME)) && @@ -734,7 +734,7 @@ static bool extract_rel_constraints(const char* relation_name) ISQL_errmsg(gds_status); return false; END_ERROR; - + return true; } @@ -754,7 +754,7 @@ static void get_procedure_args(const char* proc_name) **************************************/ SCHAR char_sets[86]; -// query to retrieve the parameters. +// query to retrieve the parameters. /* placed the two identical code blocks into one @@ -762,8 +762,8 @@ static void get_procedure_args(const char* proc_name) FSG 18.Nov.2000 */ - // Parameter types 0 = input - // Parameter types 1 = return + // Parameter types 0 = input + // Parameter types 1 = return for (SSHORT ptype = 0; ptype < 2; ptype++) { @@ -804,7 +804,7 @@ static void get_procedure_args(const char* proc_name) if (!PRM2.RDB$PARAMETER_MECHANISM.NULL) prm_mech = (prm_mech_t) PRM2.RDB$PARAMETER_MECHANISM; - END_FOR + END_FOR } char relationName[BUFFER_LENGTH128] = ""; @@ -834,18 +834,18 @@ static void get_procedure_args(const char* proc_name) strcpy(relationField, PRM2.RDB$FIELD_NAME); } - END_FOR + END_FOR } if (first_time) { first_time = false; if (ptype == 0) - { // this is the input part + { // this is the input part isqlGlob.printf("("); } else - { // we are in the output part + { // we are in the output part isqlGlob.printf("RETURNS ("); } } @@ -856,7 +856,7 @@ static void get_procedure_args(const char* proc_name) fb_utils::exact_name(PRM.RDB$PARAMETER_NAME); - // CVC: Parameter names need check for dialect 3, too. + // CVC: Parameter names need check for dialect 3, too. if (isqlGlob.db_SQL_dialect > SQL_DIALECT_V6_TRANSITION) ISQL_copy_SQL_id (PRM.RDB$PARAMETER_NAME, SQL_identifier, DBL_QUOTE); @@ -908,7 +908,7 @@ static void get_procedure_args(const char* proc_name) } else { - // Get column type name to print + // Get column type name to print for (int i = 0; Column_types[i].type; i++) { if (FLD.RDB$FIELD_TYPE == Column_types[i].type) @@ -917,7 +917,7 @@ static void get_procedure_args(const char* proc_name) if (isqlGlob.major_ods >= ODS_VERSION10) { - // Handle Integral subtypes NUMERIC and DECIMAL + // Handle Integral subtypes NUMERIC and DECIMAL if ((FLD.RDB$FIELD_TYPE == SMALLINT) || (FLD.RDB$FIELD_TYPE == INTEGER) || (FLD.RDB$FIELD_TYPE == BIGINT)) @@ -949,7 +949,7 @@ static void get_procedure_args(const char* proc_name) } if (!precision_known) { - // Take a stab at numerics and decimals + // Take a stab at numerics and decimals if ((FLD.RDB$FIELD_TYPE == SMALLINT) && (FLD.RDB$FIELD_SCALE < 0)) { @@ -996,7 +996,7 @@ static void get_procedure_args(const char* proc_name) } } - // Show international character sets and collations + // Show international character sets and collations if (!FLD.RDB$COLLATION_ID.NULL || !FLD.RDB$CHARACTER_SET_ID.NULL) { char_sets[0] = 0; @@ -1040,14 +1040,14 @@ static void get_procedure_args(const char* proc_name) return; END_ERROR; - // If there was at least one param, close parens + // If there was at least one param, close parens if (!first_time) { isqlGlob.printf(")%s", NEWLINE); } - } // end for ptype + } // end for ptype isqlGlob.printf("AS %s", NEWLINE); } @@ -1087,7 +1087,7 @@ static processing_state list_all_grants2(bool show_role_list, **************************************/ bool first_role = true; TEXT prev_owner[44]; - + // Only extract (not show) wants the role list and with escaped quoted identifiers. const bool mangle = show_role_list; @@ -1100,14 +1100,14 @@ static processing_state list_all_grants2(bool show_role_list, SORTED BY XX.RDB$ROLE_NAME bool system_flag = false; - if (isqlGlob.major_ods >= ODS_VERSION11) + if (isqlGlob.major_ods >= ODS_VERSION11) { FOR SF IN RDB$ROLES - WITH SF.RDB$ROLE_NAME = XX.RDB$ROLE_NAME + WITH SF.RDB$ROLE_NAME = XX.RDB$ROLE_NAME AND SF.RDB$SYSTEM_FLAG > 0 - + system_flag = true; - + END_FOR } @@ -1156,7 +1156,7 @@ static processing_state list_all_grants2(bool show_role_list, // This version of cursor gets only sql tables identified by security class // and misses views, getting only null view_source - + char banner[100]; sprintf(banner, "%s/* Grant permissions for this database */%s", NEWLINE, @@ -1317,7 +1317,7 @@ static void list_all_procs() PRC.RDB$PROCEDURE_NAME); get_procedure_args (PRC.RDB$PROCEDURE_NAME); - // Print the procedure body + // Print the procedure body if (!PRC.RDB$PROCEDURE_SOURCE.NULL) SHOW_print_metadata_text_blob (isqlGlob.Out, &PRC.RDB$PROCEDURE_SOURCE); @@ -1367,10 +1367,10 @@ static void list_all_tables(LegacyTables flag, REL.RDB$VIEW_BLR MISSING SORTED BY REL.RDB$RELATION_NAME - // If this is not an SQL table and we aren't doing ALL objects + // If this is not an SQL table and we aren't doing ALL objects if ((REL.RDB$FLAGS.NULL || !(REL.RDB$FLAGS & REL_sql)) && (flag != ALL_objects) ) continue; - // Null terminate name string + // Null terminate name string fb_utils::exact_name(REL.RDB$RELATION_NAME); @@ -1423,7 +1423,7 @@ static void list_all_triggers() if (TRG.RDB$TRIGGER_INACTIVE.NULL) TRG.RDB$TRIGGER_INACTIVE = 0; - // If trigger is not SQL put it in comments + // If trigger is not SQL put it in comments if (!(TRG.RDB$FLAGS & TRG_sql)) isqlGlob.printf("/* "); @@ -1478,7 +1478,7 @@ static void list_all_triggers() if (TRG.RDB$TRIGGER_INACTIVE.NULL) TRG.RDB$TRIGGER_INACTIVE = 0; - // If trigger is not SQL put it in comments + // If trigger is not SQL put it in comments if (!(TRG.RDB$FLAGS & TRG_sql)) isqlGlob.printf("/* "); @@ -1537,7 +1537,7 @@ static void list_check() * **************************************/ - // Query gets the check clauses for triggers stored for check constraints + // Query gets the check clauses for triggers stored for check constraints FOR TRG IN RDB$TRIGGERS CROSS CHK IN RDB$CHECK_CONSTRAINTS WITH @@ -1792,7 +1792,7 @@ static void list_create_db() } isqlGlob.printf("CREATE DATABASE '%s'", isqlGlob.global_Target_db); - // Get the page size from db_info call + // Get the page size from db_info call SCHAR info_buf[20]; // CVC: Finally I got the idea: translate is associated with WISQL that // no longer exists. Localizing the messages means also not printing @@ -1824,10 +1824,10 @@ static void list_create_db() isqlGlob.printf("%s%s", isqlGlob.global_Term, NEWLINE); } -// List secondary files and shadows as alter db and create shadow in comment +// List secondary files and shadows as alter db and create shadow in comment bool first = true; - + FOR FIL IN RDB$FILES SORTED BY FIL.RDB$SHADOW_NUMBER, FIL.RDB$FILE_SEQUENCE @@ -1839,7 +1839,7 @@ static void list_create_db() } first = false; - // reset nulls to zero + // reset nulls to zero if (FIL.RDB$FILE_FLAGS.NULL) FIL.RDB$FILE_FLAGS = 0; @@ -1851,7 +1851,7 @@ static void list_create_db() FIL.RDB$FILE_START = 0; fb_utils::exact_name(FIL.RDB$FILE_NAME); - // Pure secondary files + // Pure secondary files if (FIL.RDB$FILE_FLAGS == 0) { isqlGlob.printf("%sALTER DATABASE ADD FILE '%s'", @@ -1969,7 +1969,7 @@ static void list_domain_table(const SCHAR* table_name, if (isqlGlob.major_ods >= ODS_VERSION10) { - // Handle Integral subtypes NUMERIC and DECIMAL + // Handle Integral subtypes NUMERIC and DECIMAL if ((FLD.RDB$FIELD_TYPE == SMALLINT) || (FLD.RDB$FIELD_TYPE == INTEGER) || (FLD.RDB$FIELD_TYPE == BIGINT)) @@ -2001,7 +2001,7 @@ static void list_domain_table(const SCHAR* table_name, if (!precision_known) { - // Take a stab at numerics and decimals + // Take a stab at numerics and decimals if ((FLD.RDB$FIELD_TYPE == SMALLINT) && (FLD.RDB$FIELD_SCALE < 0)) { sprintf (Print_buffer, "NUMERIC(4, %d)", -FLD.RDB$FIELD_SCALE); @@ -2042,7 +2042,7 @@ static void list_domain_table(const SCHAR* table_name, else if ((FLD.RDB$FIELD_TYPE == T_CHAR) || (FLD.RDB$FIELD_TYPE == VARCHAR)) { - // Length for chars + // Length for chars isqlGlob.printf("(%d)", ISQL_get_field_length(FLD.RDB$FIELD_NAME)); } @@ -2080,7 +2080,7 @@ static void list_domain_table(const SCHAR* table_name, if (FLD.RDB$NULL_FLAG == 1) isqlGlob.printf(" NOT NULL"); - // Bug 8261: Now show the collation order information + // Bug 8261: Now show the collation order information /* Show the collation order if one has been specified. If the collation order is the default for the character set being used, then no collation order will be shown ( because it isn't needed ). @@ -2152,7 +2152,7 @@ static void list_domains(SSHORT default_char_set_id) if (isqlGlob.major_ods >= ODS_VERSION10) { - // Handle Integral subtypes NUMERIC and DECIMAL + // Handle Integral subtypes NUMERIC and DECIMAL if ((FLD.RDB$FIELD_TYPE == SMALLINT) || (FLD.RDB$FIELD_TYPE == INTEGER) || (FLD.RDB$FIELD_TYPE == BIGINT)) @@ -2184,7 +2184,7 @@ static void list_domains(SSHORT default_char_set_id) if (!precision_known) { - // Take a stab at numerics and decimals + // Take a stab at numerics and decimals if ((FLD.RDB$FIELD_TYPE == SMALLINT) && (FLD.RDB$FIELD_SCALE < 0)) { sprintf (Print_buffer, "NUMERIC(4, %d)", -FLD.RDB$FIELD_SCALE); @@ -2225,7 +2225,7 @@ static void list_domains(SSHORT default_char_set_id) else if ((FLD.RDB$FIELD_TYPE == T_CHAR) || (FLD.RDB$FIELD_TYPE == VARCHAR)) { - // Length for chars + // Length for chars isqlGlob.printf("(%d)", ISQL_get_field_length(FLD.RDB$FIELD_NAME)); } @@ -2262,7 +2262,7 @@ static void list_domains(SSHORT default_char_set_id) if (FLD.RDB$NULL_FLAG == 1) isqlGlob.printf(" NOT NULL"); - // Bug 8261: Now show the collation order information + // Bug 8261: Now show the collation order information /* Show the collation order if one has been specified. If the collation order is the default for the character set being used, then no collation order will be shown ( because it isn't needed @@ -2465,13 +2465,13 @@ static void list_foreign() collist, RELC2.RDB$RELATION_NAME); - // Get the column list for the primary key + // Get the column list for the primary key ISQL_get_index_segments (collist, sizeof(collist), RELC2.RDB$INDEX_NAME, true); isqlGlob.printf("(%s)", collist); - // Add the referential actions, if any + // Add the referential actions, if any if (!REFC.RDB$UPDATE_RULE.NULL) { ISQL_truncate_term (REFC.RDB$UPDATE_RULE, @@ -2539,7 +2539,7 @@ static void list_functions() else strcpy(SQL_identifier, FUN.RDB$FUNCTION_NAME); - // Start new function declaration + // Start new function declaration isqlGlob.printf("DECLARE EXTERNAL FUNCTION %s%s", SQL_identifier, NEWLINE); bool firstarg = true; @@ -2548,12 +2548,12 @@ static void list_functions() FUN.RDB$FUNCTION_NAME EQ FNA.RDB$FUNCTION_NAME SORTED BY FNA.RDB$ARGUMENT_POSITION - // Find parameter type + // Find parameter type int i = 0; while (FNA.RDB$FIELD_TYPE != Column_types[i].type) i++; - // Print length where appropriate + // Print length where appropriate if ((FNA.RDB$FIELD_TYPE == T_CHAR) || (FNA.RDB$FIELD_TYPE == VARCHAR) || (FNA.RDB$FIELD_TYPE == CSTRING)) @@ -2605,7 +2605,7 @@ static void list_functions() -FNA1.RDB$FIELD_SCALE); precision_known = true; } - } // if field_precision is not null + } // if field_precision is not null END_FOR ON_ERROR ISQL_errmsg (isc_status); @@ -2615,7 +2615,7 @@ static void list_functions() if (!precision_known) { - // Take a stab at numerics and decimals + // Take a stab at numerics and decimals if ((FNA.RDB$FIELD_TYPE == SMALLINT) && (FNA.RDB$FIELD_SCALE < 0)) { @@ -2637,10 +2637,10 @@ static void list_functions() else sprintf (type_buffer, "%s", Column_types[i].type_name); - } // if !precision_known - } // if T_CHAR or VARCHAR or CSTRING ... else + } // if !precision_known + } // if T_CHAR or VARCHAR or CSTRING ... else - // If a return argument, save it for the end, otherwise print + // If a return argument, save it for the end, otherwise print /* * Changed the following to not return a BLOB by value. @@ -2674,7 +2674,7 @@ static void list_functions() } if (printarg) { - // First arg needs no comma + // First arg needs no comma isqlGlob.printf("%s%s%s", (firstarg ? "" : ", "), type_buffer, UDF_param_types[ptype]); firstarg = false; @@ -2686,13 +2686,13 @@ static void list_functions() return; END_ERROR; - // Print the return type -- All functions return a type + // Print the return type -- All functions return a type isqlGlob.printf("%s%s%s", NEWLINE, return_buffer, NEWLINE); - // Print out entrypoint information + // Print out entrypoint information ISQL_copy_SQL_id(FUN.RDB$ENTRYPOINT, SQL_identifier, SINGLE_QUOTE); ISQL_copy_SQL_id(FUN.RDB$MODULE_NAME, SQL_identifier2, SINGLE_QUOTE); @@ -2782,7 +2782,7 @@ static void list_index() char collist[BUFFER_LENGTH512 * 2]; bool first = true; - + FOR IDX IN RDB$INDICES CROSS RELC IN RDB$RELATIONS OVER RDB$RELATION_NAME WITH (RELC.RDB$SYSTEM_FLAG NE 1 OR RELC.RDB$SYSTEM_FLAG MISSING) @@ -2820,7 +2820,7 @@ static void list_index() IDX.RDB$INDEX_NAME, IDX.RDB$RELATION_NAME); - // Get index expression or column names + // Get index expression or column names if (!IDX.RDB$EXPRESSION_BLR.NULL) { @@ -2857,7 +2857,7 @@ static void list_views() * **************************************/ -// If this is a view, use print_blob to print the view text +// If this is a view, use print_blob to print the view text FOR REL IN RDB$RELATIONS WITH (REL.RDB$SYSTEM_FLAG NE 1 OR REL.RDB$SYSTEM_FLAG MISSING) AND @@ -2882,7 +2882,7 @@ static void list_views() NEWLINE); isqlGlob.printf("CREATE VIEW %s (", SQL_identifier); - // Get column list + // Get column list FOR RFR IN RDB$RELATION_FIELDS WITH RFR.RDB$RELATION_NAME = REL.RDB$RELATION_NAME SORTED BY RFR.RDB$FIELD_POSITION diff --git a/src/isql/isql.epp b/src/isql/isql.epp index da5b04f121..35dd0c136e 100644 --- a/src/isql/isql.epp +++ b/src/isql/isql.epp @@ -40,7 +40,7 @@ 2003-08-15 Fred Polizo, Jr. - Fixed print_item() to correctly print string types as their hex represention for CHARACTER SET OCTETS. 2004-11-16 Damyan Ivanov - bail out on error in non-interactive mode. - + */ #ifdef DARWIN @@ -136,9 +136,9 @@ DATABASE DB = COMPILETIME "yachts.lnk"; IsqlGlobals isqlGlob; #define DIGIT(c) ((c) >= '0' && (c) <= '9') -#define INT64_LIMIT ((((SINT64) 1) << 62) / 5) // same as in cvt.cpp +#define INT64_LIMIT ((((SINT64) 1) << 62) / 5) // same as in cvt.cpp -// Print lengths of numeric values +// Print lengths of numeric values const size_t MAXCHARSET_SIZE = 32; // CHARSET names const int SHORT_LEN = 7; // NUMERIC (4,2) = -327.68 @@ -147,11 +147,11 @@ const int INT64_LEN = 21; // NUMERIC(18,2) = -92233720368547758.08 const int QUAD_LEN = 19; const int FLOAT_LEN = 14; // -1.2345678E+38 const int DOUBLE_LEN = 23; // -1.234567890123456E+300 -const int DATE_LEN = 11; // 11 for date only -const int DATETIME_LEN = 25; // 25 for date-time -const int TIME_ONLY_LEN = 13; // 13 for time only +const int DATE_LEN = 11; // 11 for date only +const int DATETIME_LEN = 25; // 25 for date-time +const int TIME_ONLY_LEN = 13; // 13 for time only const int DATE_ONLY_LEN = 11; -const int UNKNOWN_LEN = 20; // Unknown type: %d +const int UNKNOWN_LEN = 20; // Unknown type: %d const int MAX_TERMS = 10; // max # of terms in an interactive cmd @@ -246,7 +246,7 @@ const switch_info switches[] = static inline bool commit_trans(isc_tr_handle* x) { if (isc_commit_transaction (isc_status, x)) { - ISQL_errmsg (isc_status); + ISQL_errmsg (isc_status); isc_rollback_transaction (isc_status, x); return false; } @@ -377,7 +377,7 @@ bool Trusted_auth = false; #endif bool Version_info = false; -// Utility transaction handle +// Utility transaction handle static isc_tr_handle D__trans; static isc_tr_handle M__trans; static int global_numbufs; // # of cache buffers on connect @@ -482,7 +482,7 @@ inline void set_bpb_for_translation(const unsigned int blob_sub_type) predefined_blob_subtype_bpb[3] = (UCHAR) blob_sub_type; } -// Note that these transaction options aren't understood in Version 3.3 +// Note that these transaction options aren't understood in Version 3.3 static const UCHAR default_tpb[] = { isc_tpb_version1, isc_tpb_write, @@ -491,7 +491,7 @@ static const UCHAR default_tpb[] = }; #ifdef NOT_USED_OR_REPLACED -// CVC: Just in case we need it for R/O operations in the future. +// CVC: Just in case we need it for R/O operations in the future. static const UCHAR batch_tpb[] = { isc_tpb_version3, isc_tpb_read, @@ -572,7 +572,7 @@ int ISQL_main(int argc, argc--; } } -#endif // MU_ISQL +#endif // MU_ISQL TEXT tabname[WORDLENGTH]; tabname[0] = '\0'; @@ -593,7 +593,7 @@ int ISQL_main(int argc, Diag = isqlGlob.Out; else Diag = stdout; - + Help = stdout; if (Merge_stderr) @@ -646,7 +646,7 @@ int ISQL_main(int argc, // Do multi-user cleanup if running in multi-user domain. // qa_mu_cleanup() is NOP in non-multi-user domain. qa_mu_cleanup(); -#endif // MU_ISQL +#endif // MU_ISQL #ifdef DEBUG_GDS_ALLOC // As ISQL can run under windows, all memory should be freed before @@ -738,8 +738,8 @@ bool ISQL_dbcheck() * Return true if connected, false otherwise * * Change from miroslavp on 2005.04.25 - * Value assigned here on Exit_value is not used anywhere in the source - * and cause isql.exe to return 1 in Quiet mode even there is no error. + * Value assigned here on Exit_value is not used anywhere in the source + * and cause isql.exe to return 1 in Quiet mode even there is no error. * If there is error Exit_value is set by callers - so it is removed from here. **************************************/ TEXT errbuf[MSG_LENGTH]; @@ -926,7 +926,7 @@ void ISQL_copy_SQL_id(const TEXT* in_str, ISQL_blankterm has been replaced by fb_utils::exact_name. */ if (escape_char == DBL_QUOTE) { - // Cannot rely on ANSI functions that may be localized. + // Cannot rely on ANSI functions that may be localized. bool need_quotes = *in_str < 'A' || *in_str > 'Z'; TEXT* q1 = output_str; for (const TEXT* p1 = in_str; *p1 && !need_quotes; ++p1, ++q1) @@ -1076,7 +1076,7 @@ void ISQL_warning(ISC_STATUS* status) **************************************/ const ISC_STATUS* vec = status; - fb_assert(vec[1] == 0); // shouldn't be any errors + fb_assert(vec[1] == 0); // shouldn't be any errors //if (!Quiet) { @@ -1308,7 +1308,7 @@ void ISQL_get_default_source(const TEXT* rel_name, } if (rel_name) { - // This is default for a column of a table + // This is default for a column of a table FOR FLD IN RDB$FIELDS CROSS RFR IN RDB$RELATION_FIELDS WITH RFR.RDB$FIELD_SOURCE EQ FLD.RDB$FIELD_NAME AND @@ -1382,7 +1382,7 @@ SLONG ISQL_get_index_segments(TEXT* segs, if (count_only) continue; - // Place a comma and a blank between each segment column name + // Place a comma and a blank between each segment column name fb_utils::exact_name(SEG.RDB$FIELD_NAME); if (isqlGlob.db_SQL_dialect > SQL_DIALECT_V6_TRANSITION && delimited_yes) { @@ -1391,7 +1391,7 @@ SLONG ISQL_get_index_segments(TEXT* segs, else { strcpy (SQL_identifier, SEG.RDB$FIELD_NAME); } - + const size_t len = strlen(SQL_identifier); if (n == 1) @@ -1535,7 +1535,7 @@ bool ISQL_get_null_flag(const TEXT* rel_name, null_flag = false; else { - // If RDB$BASE_FIELD is not null then it is a view column + // If RDB$BASE_FIELD is not null then it is a view column if (RFR.RDB$BASE_FIELD.NULL) { @@ -1556,7 +1556,7 @@ bool ISQL_get_null_flag(const TEXT* rel_name, END_ERROR; } else { - // Domains have only field entries to worry about + // Domains have only field entries to worry about FOR FLD IN RDB$FIELDS WITH FLD.RDB$FIELD_NAME EQ field_name @@ -1625,7 +1625,7 @@ void ISQL_disconnect_database(bool nQuietMode) D__trans = 0; M__trans = 0; gds_trans = 0; - + // CVC: If we aren't connected to a db anymore, then the db's dialect is reset. // This should fix SF Bug #910430. isqlGlob.db_SQL_dialect = 0; @@ -1769,14 +1769,14 @@ void ISQL_print_validation(FILE* fp, bool issql = false; bool firsttime = true; TEXT buffer[BUFFER_LENGTH512]; - + size_t length; while (blob.getSegment(sizeof(buffer) - 1, buffer, length)) { buffer[length] = 0; const TEXT* p = buffer; if (isComputedField) { - // computed field SQL syntax correction + // computed field SQL syntax correction while (fb_isspace(*p)) p++; @@ -1784,7 +1784,7 @@ void ISQL_print_validation(FILE* fp, issql = true; } else { - // Validation SQL syntax correction + // Validation SQL syntax correction while (fb_isspace(*p)) p++; @@ -1870,7 +1870,7 @@ static processing_state add_row(TEXT* tabname) if (!Interactive) return (ps_ERR); - + if (Input_file) return ps_ERR; @@ -1934,7 +1934,7 @@ static processing_state add_row(TEXT* tabname) sqlda->version = SQLDA_VERSION1; sqlda->sqld = sqlda->sqln = n_cols; - // We must re-describe the sqlda, no need to re-prepare + // We must re-describe the sqlda, no need to re-prepare if (isc_dsql_describe(isc_status, &global_Stmt, isqlGlob.SQL_dialect, sqlda)) { ISQL_errmsg(isc_status); @@ -1959,7 +1959,7 @@ static processing_state add_row(TEXT* tabname) sprintf(insertstring, "INSERT INTO %s (", tabname); int i; - + SSHORT i_cols = 0; i = 0; { // scope @@ -1986,7 +1986,7 @@ static processing_state add_row(TEXT* tabname) } } } // scope for MSVC6 - + // Set i_cols to the number of insert columns insertstring[strlen(insertstring) - 1] = ')'; strcat(insertstring, " VALUES ("); @@ -1995,7 +1995,7 @@ static processing_state add_row(TEXT* tabname) if (colnumber[i] != -1) strcat(insertstring, " ?,"); } - // Patch the last character in the string + // Patch the last character in the string insertstring[strlen(insertstring) - 1] = ')'; @@ -2018,7 +2018,7 @@ static processing_state add_row(TEXT* tabname) SCHAR infobuf[BUFFER_LENGTH180]; ISQL_msg_get(ADD_PROMPT, sizeof(infobuf), infobuf); STDERROUT(infobuf); - + TEXT msg[MSG_LENGTH]; SCHAR name[WORDLENGTH]; bool done = false; @@ -2030,7 +2030,7 @@ static processing_state add_row(TEXT* tabname) if (colnumber[i] == -1) continue; - // SQLDA for INSERT statement might have fewer columns + // SQLDA for INSERT statement might have fewer columns const SSHORT j = colnumber[i]; XSQLVAR* ivar = &isqlda->sqlvar[j]; *ivar = *var; @@ -2044,7 +2044,7 @@ static processing_state add_row(TEXT* tabname) const SSHORT type = var->sqltype & ~1; const SSHORT nullable = var->sqltype & 1; - // Prompt with the name and read the line + // Prompt with the name and read the line switch (type) { @@ -2095,7 +2095,7 @@ static processing_state add_row(TEXT* tabname) cmd[4] = '\0'; ISQL_make_upper(cmd); - // If the user writes NULL, put a null in the column + // If the user writes NULL, put a null in the column if (!strcmp(cmd, "NULL")) *ivar->sqlind = -1; @@ -2134,7 +2134,7 @@ static processing_state add_row(TEXT* tabname) unlink(ftmp.c_str()); } } - else // Otherwise just load the named file + else // Otherwise just load the named file { // We can't be sure if it's a TEXT or BINARY file // being loaded. As we aren't sure, we'll @@ -2246,7 +2246,7 @@ static processing_state add_row(TEXT* tabname) break; case SQL_TEXT: - // Force all text to varying + // Force all text to varying ivar->sqltype = SQL_VARYING + nullable; // Fall into: @@ -2273,7 +2273,7 @@ static processing_state add_row(TEXT* tabname) } // Fall into: - // Fall through from SQL_SHORT and SQL_LONG ... + // Fall through from SQL_SHORT and SQL_LONG ... case SQL_INT64: if (type == SQL_INT64) { pi64 = (SINT64*) ISQL_ALLOC(sizeof(SINT64)); @@ -2308,7 +2308,7 @@ static processing_state add_row(TEXT* tabname) } if (done) break; // Nothing else, we found an error. - + if (type == SQL_INT64) *pi64 = n; else if (type == SQL_SHORT) @@ -2413,7 +2413,7 @@ static processing_state blobedit(const TEXT* action, BLOB_edit(&blobid, DB, M__trans, "blob"); else if ((!strcmp(action, "BLOBDUMP")) && (*cmd[2])) { - // If this is a blobdump, make sure there is a file name + // If this is a blobdump, make sure there is a file name // We can't be sure if the BLOB is TEXT or BINARY data, // as we're not sure, we'll dump it in BINARY mode. TEXT path[MAXPATHLEN]; @@ -2606,7 +2606,7 @@ static processing_state bulk_insert_hack(const char* command, XSQLDA** sqldap) } } } - + // If PLAN is set, print out the plan now. if (Plan) { @@ -2618,7 +2618,7 @@ static processing_state bulk_insert_hack(const char* command, XSQLDA** sqldap) const int n_cols = sqlda->sqld; SSHORT* nullind = new SSHORT[n_cols]; PtrSentry nullindSentry(nullind, true); - + int textFieldCounter = 0; { // scope for (int i = 0; i < n_cols; ++i) @@ -2632,7 +2632,7 @@ static processing_state bulk_insert_hack(const char* command, XSQLDA** sqldap) } } } // scope - + // Used to optimize allocations to text fields. Extender* const stringBuffers = textFieldCounter ? new Extender[textFieldCounter] : 0; PtrSentry stringbufSentry(stringBuffers, true); @@ -2657,7 +2657,7 @@ static processing_state bulk_insert_hack(const char* command, XSQLDA** sqldap) // no spaces before, etc. Go to read the next line. if (lastInputLine[0] == '-' && lastInputLine[1] == '-') continue; - + const char* insert = lastInputLine; while (*insert && *insert != '(') ++insert; @@ -2805,7 +2805,7 @@ static processing_state bulk_insert_hack(const char* command, XSQLDA** sqldap) // STDERROUT("Looking for unquoted string in:"); // STDERROUT(insert); //} - + for (bool go = true; go && *insert; ++insert) { switch (*insert) @@ -2848,11 +2848,11 @@ static processing_state bulk_insert_hack(const char* command, XSQLDA** sqldap) default: STDERROUT("Unterminated row, use +++ to put more parameters in another line"); } - + done = true; continue; } - + if (quote) ++lastPos; else @@ -3119,7 +3119,7 @@ static processing_state bulk_insert_hack(const char* command, XSQLDA** sqldap) } if (done) continue; // Nothing else, we found an error. - + if (type == SQL_INT64) *pi64 = n; else if (type == SQL_SHORT) @@ -3151,7 +3151,7 @@ static processing_state bulk_insert_hack(const char* command, XSQLDA** sqldap) if (done) break; - + // Restore "insert" pointer if we needed multi-line hack. if (finder) insert = finder; @@ -3246,9 +3246,9 @@ static processing_state bulk_insert_hack(const char* command, XSQLDA** sqldap) // No need to release each of the variables for next time. // Text is handled by an array of Extender and the others are fixed size // and therefore allocated only once. - + } // while (!done) - + if (done) { // Save whatever we were able to pump, except when the failure was the commit itself. @@ -3259,7 +3259,7 @@ static processing_state bulk_insert_hack(const char* command, XSQLDA** sqldap) else commit_trans(&M__trans); } - + if (D__trans) { if (commit_failureD) @@ -3267,7 +3267,7 @@ static processing_state bulk_insert_hack(const char* command, XSQLDA** sqldap) else commit_trans(&D__trans); } - + TEXT errbuf[MSG_LENGTH]; sprintf(errbuf, "Stopped prematurely due to error in line %d with text:", Filelist->Ifp().indev_aux); @@ -3276,7 +3276,7 @@ static processing_state bulk_insert_hack(const char* command, XSQLDA** sqldap) STDERROUT("Going to EOF"); // Avoid thousands of errors. Assume the file is full of bulk insertion data. Filelist->gotoEof(); - + ret = ps_ERR; } @@ -3291,14 +3291,14 @@ static processing_state bulk_insert_hack(const char* command, XSQLDA** sqldap) ivar->sqldata = 0; } } - + // Explicit just to test. stringbufSentry.clean(); nullindSentry.clean(); // Get rid of the statement handle. isc_dsql_free_statement(isc_status, &global_Stmt, DSQL_close); - + // Statistics printed here upon request if (Stats) @@ -3430,7 +3430,7 @@ static void col_check(const TEXT* tabname, return; } } - + // Query to get array info and computed source not available in the sqlda int i = 0, j = 0; FOR F IN RDB$FIELDS CROSS @@ -3605,7 +3605,7 @@ static processing_state copy_table(TEXT* source, Firebird::PathName ftmp = TempFile::create(SCRATCH); isqlGlob.Out = fopen(ftmp.c_str(), "w+b"); if (!isqlGlob.Out) { - // If we can't open a temp file then bail + // If we can't open a temp file then bail ISQL_msg_get(FILE_OPEN_ERR, errbuf, SafeArg() << ftmp.c_str()); STDERROUT(errbuf); @@ -3629,7 +3629,7 @@ static processing_state copy_table(TEXT* source, ISQL_make_upper(source); } */ - + chop_at(destination, QUOTEDLENGTH); if (destination[0] != DBL_QUOTE) ISQL_make_upper(destination); @@ -3654,7 +3654,7 @@ static processing_state copy_table(TEXT* source, else { fclose(isqlGlob.Out); - // easy to make a copy in another database + // easy to make a copy in another database const TEXT* altdb = isqlGlob.global_Db_name; if (*otherdb) altdb = otherdb; @@ -3707,7 +3707,7 @@ static processing_state create_db(const TEXT* statement, TEXT psw[PASSWORD_LENGTH]; strcpy(local_statement, statement); - + TEXT quote = DBL_QUOTE; const TEXT* p = NULL; @@ -3728,7 +3728,7 @@ static processing_state create_db(const TEXT* statement, } if (q) { - // Set quote to match open quote + // Set quote to match open quote quote = *q; q++; p = strchr(q, quote); @@ -3779,7 +3779,7 @@ static processing_state create_db(const TEXT* statement, return (FAIL); } } - + TEXT errbuf[MSG_LENGTH]; TEXT* temp_str; @@ -3924,7 +3924,7 @@ static processing_state create_db(const TEXT* statement, if (*comment == '\n') ++comment; // skip the newline - + while (*comment && fb_isspace(*comment)) ++comment; } @@ -3996,7 +3996,7 @@ static processing_state create_db(const TEXT* statement, ISQL_get_version(true); - // Start the user transaction + // Start the user transaction if (!M__trans) { if (isc_start_transaction(isc_status, &M__trans, 1, &DB, 0, NULL)) @@ -4007,7 +4007,7 @@ static processing_state create_db(const TEXT* statement, ISQL_errmsg(isc_status); } - // Allocate a new user statement for the database + // Allocate a new user statement for the database if (isc_dsql_allocate_statement(isc_status, &DB, &global_Stmt)) { ISQL_errmsg(isc_status); @@ -4096,7 +4096,7 @@ static void do_isql() const size_t stmtLength = MAX_USHORT; TEXT* statement = stmt.getBuffer(stmtLength); processing_state ret; - + bool done = false; while (!done) { @@ -4136,9 +4136,9 @@ static void do_isql() ret = get_statement(statement, stmtLength, sql_prompt); - // If there is no database yet, remind us of the need to connect + // If there is no database yet, remind us of the need to connect - // But don't execute the statement + // But don't execute the statement if (!isqlGlob.global_Db_name[0] && (ret == CONT)) { if (!Quiet) @@ -4248,7 +4248,7 @@ static void do_isql() Filelist->clear(); if (lastInputLine) free(lastInputLine); - + global_Cols.clear(); // The destructor would do anyway if we don't reach this point. } @@ -4284,7 +4284,7 @@ static processing_state drop_db() gds_trans = 0; global_Stmt = 0; D__trans = 0; - + // CVC: If we aren't connected to a db anymore, then the db's dialect is reset. // This should fix SF Bug #910430. isqlGlob.db_SQL_dialect = 0; @@ -4345,7 +4345,7 @@ static processing_state edit(const TEXT* const* cmd) } } else { - // No file given, edit the temp file + // No file given, edit the temp file Filelist->insertIfp(); // Close the file, edit it, then reopen and read from the top @@ -4397,7 +4397,7 @@ static processing_state end_trans() STDERROUT(infobuf); if (DB && M__trans) { if (isc_commit_transaction(isc_status, &M__trans)) { - // Commit failed, so roll back anyway + // Commit failed, so roll back anyway ISQL_errmsg(isc_status); ret = FAIL; } @@ -4488,7 +4488,7 @@ static processing_state escape(const TEXT* cmd) // If no command given just spawn a shell if (!*shellcmd) shellcmd = emptyCmd; - + int rc = system(shellcmd); #ifdef WIN_NT @@ -4497,7 +4497,7 @@ static processing_state escape(const TEXT* cmd) if (Filelist->sameInputAndOutput()) Filelist->Ofp().setPos(&OfpPos); #endif - + return rc ? FAIL : SKIP; } @@ -4603,10 +4603,10 @@ static processing_state frontend(const TEXT* statement) // In case any default transaction was started - commit it here if (gds_trans) commit_trans(&gds_trans); - + return SKIP; } - + frontend_load_parms(statement, parms, lparms, parm_defaults); char bad_dialect_buf[512]; @@ -4619,11 +4619,11 @@ static processing_state frontend(const TEXT* statement) switch (frontoptions.getCommand(parms[0])) { case FrontOptions::show: - // Transaction for all frontend commands + // Transaction for all frontend commands if (DB && !gds_trans) if (isc_start_transaction(isc_status, &gds_trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); - // Free the frontend command + // Free the frontend command frontend_free_parms(parms, lparms, parm_defaults); return FAIL; } @@ -4636,7 +4636,7 @@ static processing_state frontend(const TEXT* statement) if (DB && !gds_trans) if (isc_start_transaction(isc_status, &gds_trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); - // Free the frontend command + // Free the frontend command frontend_free_parms(parms, lparms, parm_defaults); return FAIL; } @@ -4649,7 +4649,7 @@ static processing_state frontend(const TEXT* statement) if (DB && !gds_trans) if (isc_start_transaction(isc_status, &gds_trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); - // Free the frontend command + // Free the frontend command frontend_free_parms(parms, lparms, parm_defaults); return FAIL; } @@ -4673,26 +4673,26 @@ static processing_state frontend(const TEXT* statement) case FrontOptions::blobview: ret = blobedit(parms[0], lparms); break; - + case FrontOptions::output: ret = newoutput(lparms[1]); break; - + case FrontOptions::shell: ret = escape(cmd); break; - + case FrontOptions::set: ret = frontend_set(cmd, parms, lparms, bad_dialect_buf, bad_dialect); break; - + case FrontOptions::create: if (!strcmp(parms[1], "DATABASE") || !strcmp(parms[1], "SCHEMA")) ret = create_db(cmd, lparms[2]); else ret = CONT; break; - + case FrontOptions::drop: if (!strcmp(parms[1], "DATABASE") || !strcmp(parms[1], "SCHEMA")) if (*parms[2]) @@ -4702,7 +4702,7 @@ static processing_state frontend(const TEXT* statement) else ret = CONT; break; - + case FrontOptions::connect: { const TEXT* psw = NULL; @@ -4777,19 +4777,19 @@ static processing_state frontend(const TEXT* statement) fetch_direction = isc_fetch_first; ret = FETCH; break; - + case FrontOptions::last: fetch_offset = 1; fetch_direction = isc_fetch_last; ret = FETCH; break; - + case FrontOptions::absolute: fetch_direction = isc_fetch_absolute; fetch_offset = atoi(parms[1]); ret = FETCH; break; - + case FrontOptions::relative: fetch_direction = isc_fetch_relative; fetch_offset = atoi(parms[1]); @@ -4800,7 +4800,7 @@ static processing_state frontend(const TEXT* statement) case FrontOptions::edit: ret = edit(lparms); break; - + case FrontOptions::input: // CVC: Set by newinput() below only if successful. //Input_file = true; @@ -4810,15 +4810,15 @@ static processing_state frontend(const TEXT* statement) case FrontOptions::quit: ret = BACKOUT; break; - + case FrontOptions::exit: ret = EXIT; break; - + case FrontOptions::help: ret = help(parms[1]); break; - + #ifdef DEV_BUILD case FrontOptions::passthrough: ret = passthrough(cmd + 11); @@ -4864,7 +4864,7 @@ static void frontend_load_parms(const TEXT* p, TEXT* parms[], TEXT* lparms[], TEXT parm_defaults[][1]) { TEXT buffer[BUFFER_LENGTH256]; - + for (int i = 0; i < MAX_TERMS; ++i) { if (!*p) @@ -4873,7 +4873,7 @@ static void frontend_load_parms(const TEXT* p, TEXT* parms[], TEXT* lparms[], parm_defaults[i][0] = '\0'; continue; } - + bool role_found = false; TEXT* a = buffer; int j = 0; @@ -4991,7 +4991,7 @@ static processing_state frontend_set(const char* cmd, const char* const* parms, // Display current set options if (!*parms[1]) return print_sets(); - + processing_state ret = SKIP; const SetOptions setoptions(options, FB_NELEM(options), SetOptions::wrong); switch (setoptions.getCommand(parms[1])) @@ -4999,21 +4999,21 @@ static processing_state frontend_set(const char* cmd, const char* const* parms, case SetOptions::stat: ret = do_set_command(parms[2], &Stats); break; - + case SetOptions::count: ret = do_set_command(parms[2], &Docount); break; - + case SetOptions::list: ret = do_set_command(parms[2], &List); break; - + case SetOptions::plan: ret = do_set_command(parms[2], &Plan); if (Planonly && !Plan) ret = do_set_command("OFF", &Planonly); break; - + case SetOptions::planonly: ret = do_set_command (parms[2], &Planonly); if ( Planonly && !Plan ) { @@ -5041,7 +5041,7 @@ static processing_state frontend_set(const char* cmd, const char* const* parms, case SetOptions::autoddl: ret = do_set_command(parms[2], &Autocommit); break; - + #ifdef SCROLLABLE_CURSORS case SetOptions::autofetch: ret = do_set_command(parms[2], &Autofetch); @@ -5051,7 +5051,7 @@ static processing_state frontend_set(const char* cmd, const char* const* parms, case SetOptions::width: ret = newsize(parms[2][0] == '"' ? lparms[2] : parms[2], parms[3]); break; - + case SetOptions::transaction: ret = newtrans(cmd); break; @@ -5071,7 +5071,7 @@ static processing_state frontend_set(const char* cmd, const char* const* parms, } } break; - + case SetOptions::names: if (!*parms[2]) { @@ -5090,11 +5090,11 @@ static processing_state frontend_set(const char* cmd, const char* const* parms, fb_utils::copy_terminate(ISQL_charset, parms[2], MAXCHARSET_SIZE); } break; - + case SetOptions::time: ret = do_set_command(parms[2], &Time_display); break; - + //#ifdef DEV_BUILD case SetOptions::sqlda_display: ret = do_set_command(parms[2], &Sqlda_display); @@ -5116,22 +5116,22 @@ static processing_state frontend_set(const char* cmd, const char* const* parms, case SetOptions::statistics: ret = CONT; break; - + case SetOptions::heading: ret = do_set_command(parms[2], &Heading); break; - + case SetOptions::bail: ret = do_set_command(parms[2], &BailOnError); break; - + case SetOptions::bulk_insert: if (*parms[2]) ret = bulk_insert_hack(cmd, global_sqldap); else ret = ps_ERR; break; - + case SetOptions::rowcount: ret = newRowCount((*lparms[2]) ? lparms[2] : "0"); break; @@ -5146,7 +5146,7 @@ static processing_state frontend_set(const char* cmd, const char* const* parms, ret = ps_ERR; break; } - + return ret; } @@ -5284,8 +5284,8 @@ static processing_state get_dialect(const char* const dialect_str, } return ret; } - - + + static processing_state get_statement(TEXT* const statement, const size_t bufsize, const TEXT* statement_prompt) @@ -5339,7 +5339,7 @@ static processing_state get_statement(TEXT* const statement, SSHORT c = getNextInputChar(); switch (c) { case EOF: - // Go back to getc if we get interrupted by a signal. + // Go back to getc if we get interrupted by a signal. if (SYSCALL_INTERRUPTED(errno)) { errno = 0; @@ -5355,12 +5355,12 @@ static processing_state get_statement(TEXT* const statement, ret = FAIL; } - // If we hit EOF at the top of the flist, exit time - + // If we hit EOF at the top of the flist, exit time + if (Filelist->count() == 1) return FOUND_EOF; - // If this is not tmpfile, close it + // If this is not tmpfile, close it if (!Filelist->sameInputAndOutput()) Filelist->Ifp().close(); @@ -5398,7 +5398,7 @@ static processing_state get_statement(TEXT* const statement, break; } - // If in a comment, keep reading + // If in a comment, keep reading if (Interactive && !Input_file || Echo) { if (state == in_block_comment) @@ -5406,7 +5406,7 @@ static processing_state get_statement(TEXT* const statement, ISQL_prompt("--> "); } else if (valuable_count == 0) - { // Ignore a series of nothing at the beginning + { // Ignore a series of nothing at the beginning ISQL_prompt(statement_prompt); } else @@ -5601,7 +5601,7 @@ static void get_str(const TEXT* const input_str, TEXT delimited_char = *b1; b1++; bool done = false; - while (!done) + while (!done) { if (*b1 == delimited_char) { b1++; @@ -5681,7 +5681,7 @@ void ISQL_get_version(bool call_by_create_db) ISQL_errmsg(isc_status); return; } - + const UCHAR* p = buffer; while (*p != isc_info_end && *p != isc_info_truncated && p < buffer + sizeof(buffer)) { @@ -5709,7 +5709,7 @@ void ISQL_get_version(bool call_by_create_db) isqlGlob.prints(bad_dialect_buf); } } - else { // ODS 10 databases + else { // ODS 10 databases switch (global_dialect_spoken) { case SQL_DIALECT_V5: @@ -5740,7 +5740,7 @@ void ISQL_get_version(bool call_by_create_db) // Error indicates an option was not understood by the // remote server. if (*p == isc_info_firebird_version) { - // must be an old or non Firebird server + // must be an old or non Firebird server break; } if (isqlGlob.SQL_dialect && isqlGlob.SQL_dialect != SQL_DIALECT_V5 && Warnings) @@ -5788,7 +5788,7 @@ void ISQL_get_version(bool call_by_create_db) int l = *q++; if (l > limit - q) l = limit - q; - + isqlGlob.printf("%.*s%s", l, q, NEWLINE); q += l; } @@ -5820,7 +5820,7 @@ void ISQL_get_version(bool call_by_create_db) isqlGlob.SQL_dialect = SQL_DIALECT_V5; else if (isqlGlob.major_ods < ODS_VERSION10) isqlGlob.SQL_dialect = global_dialect_spoken; - else if (isqlGlob.SQL_dialect == 0) // client SQL dialect has not been set + else if (isqlGlob.SQL_dialect == 0) // client SQL dialect has not been set isqlGlob.SQL_dialect = global_dialect_spoken; if (global_dialect_spoken > 0) @@ -5912,7 +5912,7 @@ void ISQL_ri_action_print(const TEXT* ri_action_str, if (!strcmp(ref_int->ri_action_name, ri_action_str)) { if (*ref_int->ri_action_print_caps) { - // we have something to print + // we have something to print if (all_caps) isqlGlob.printf("%s %s", ri_action_prefix_str, ref_int->ri_action_print_caps); @@ -5947,7 +5947,7 @@ static bool get_numeric(const UCHAR* string, * **************************************/ SINT64 value = 0; - + SSHORT local_scale = 0, sign = 0; bool digit_seen = false, fraction = false; @@ -5966,7 +5966,7 @@ static bool get_numeric(const UCHAR* string, if (value == INT64_LIMIT) { - // possibility of an overflow + // possibility of an overflow if ((*p > '8' && sign == -1) || (*p > '7' && sign != -1)) return false; @@ -5982,7 +5982,7 @@ static bool get_numeric(const UCHAR* string, { if (fraction) return false; - + fraction = true; } else if (*p == '-' && !digit_seen && !sign && !fraction) @@ -6034,7 +6034,7 @@ static processing_state print_sets() #endif print_set("Access Plan:", Plan); print_set("Access Plan only:", Planonly); - + isqlGlob.printf("%-25s", "Display BLOB type:"); if (Doblob == ALL_BLOBS) isqlGlob.printf("ALL"); @@ -6086,7 +6086,7 @@ static processing_state help(const TEXT* what) // Ordered list of help messages to display. Use -1 to terminate list, // and 0 for an empty blank line static const SSHORT help_ids[] = { - HLP_FRONTEND, // Frontend commands: + HLP_FRONTEND, // Frontend commands: HLP_BLOBDMP, // BLOBDUMP -- dump BLOB to a file HLP_BLOBVIEW, // BLOBVIEW -- view BLOB in text editor HLP_EDIT, // EDIT [] -- edit SQL script file and execute @@ -6104,12 +6104,12 @@ static processing_state help(const TEXT* what) HLP_EXIT, // EXIT -- exit and commit changes HLP_QUIT, // QUIT -- exit and roll back changes 0, - HLP_ALL, // All commands may be abbreviated to letters in CAPitals - -1 // end of list + HLP_ALL, // All commands may be abbreviated to letters in CAPitals + -1 // end of list }; static const SSHORT help_set_ids[] = { - HLP_SETCOM, //Set commands: + HLP_SETCOM, //Set commands: HLP_SET, // SET -- display current SET options HLP_SETAUTO, // SET AUTOddl -- toggle autocommit of DDL statements #ifdef SCROLLABLE_CURSORS @@ -6132,10 +6132,10 @@ static processing_state help(const TEXT* what) HLP_SETTERM, // SET TERM -- change statement terminator string HLP_SETWIDTH, // SET WIDTH [] -- set/unset print width to for column 0, - HLP_ALL, // All commands may be abbreviated to letters in CAPitals - -1 // end of list + HLP_ALL, // All commands may be abbreviated to letters in CAPitals + -1 // end of list }; - + TEXT msg[MSG_LENGTH]; const SSHORT* msgid; if (!strcmp(what, "SET")) { @@ -6172,7 +6172,7 @@ static bool isyesno(const TEXT* buffer) * **********************************************/ - if (!have_trans) { // get the translation if we don't have it already + if (!have_trans) { // get the translation if we don't have it already ISQL_msg_get(YES_ANS, sizeof(yesword), yesword); have_trans = true; } @@ -6239,7 +6239,7 @@ static processing_state newdb(TEXT* dbname, local_psw[0] = 0; local_usr[0] = 0; local_sql_role[0] = 0; - + // Strip quotes if well-intentioned strip_quotes(dbname, isqlGlob.global_Db_name); @@ -6336,13 +6336,13 @@ static processing_state newdb(TEXT* dbname, if (save_database) ISQL_FREE(save_database); - + ISQL_get_version(false); if (*local_sql_role) { switch (isqlGlob.SQL_dialect) { case SQL_DIALECT_V5: - // Uppercase the Sql isqlGlob.Role name + // Uppercase the Sql isqlGlob.Role name ISQL_make_upper(local_sql_role); break; case SQL_DIALECT_V6_TRANSITION: @@ -6393,7 +6393,7 @@ static processing_state newdb(TEXT* dbname, if (start_user_trans) { - // Start the user transaction and default transaction + // Start the user transaction and default transaction if (!M__trans) { if (isc_start_transaction(isc_status, &M__trans, 1, &DB, 0, NULL)) @@ -6405,7 +6405,7 @@ static processing_state newdb(TEXT* dbname, } - // Allocate a new user statement for this database + // Allocate a new user statement for this database global_Stmt = 0; if (isc_dsql_allocate_statement(isc_status, &DB, &global_Stmt)) { @@ -6520,7 +6520,7 @@ static processing_state newoutput(const TEXT* outfile) } } else { - // Revert to stdout + // Revert to stdout if (isqlGlob.Out != stdout) { fclose(isqlGlob.Out); isqlGlob.Out = stdout; @@ -6560,7 +6560,7 @@ static processing_state newsize(const TEXT* colname, if (strlen(colname) > MAX_SQL_IDENTIFIER_LEN) return ps_ERR; - + // If no size is given, remove the entry if (!*sizestr) { @@ -6735,7 +6735,7 @@ static processing_state parse_arg(int argc, // Interpret each command line argument const SCHAR switchchar = '-'; - + #ifdef DEV_BUILD bool istable = false; #endif @@ -6971,7 +6971,7 @@ static processing_state parse_arg(int argc, case SWITCH_QUIET: Quiet = true; break; - + #ifdef TRUSTED_AUTH case SWITCH_TRUSTED: Trusted_auth = true; @@ -7024,7 +7024,7 @@ static processing_state parse_arg(int argc, else { fb_utils::copy_terminate(isqlGlob.global_Db_name, s, sizeof(isqlGlob.global_Db_name)); #ifdef DEV_BUILD - // If there is a table name, it follows + // If there is a table name, it follows if (istable && (s = argv[++i]) && *s) fb_utils::copy_terminate(tabname, s, WORDLENGTH); #endif @@ -7034,7 +7034,7 @@ static processing_state parse_arg(int argc, // Quit the loop of interpreting if we got an error if (ret == ps_ERR) break; - + s = argv[++i]; } @@ -7116,7 +7116,7 @@ static SSHORT print_item(TEXT** s, else if (!strncmp(var->sqlname, "DB_KEY", 6)) { // Special handling for db_keys printed in hex - // Keep a temp buf, d for building the binary string + // Keep a temp buf, d for building the binary string for (const TEXT* t = var->sqldata; t < var->sqldata + var->sqllen; t++) { @@ -7142,7 +7142,7 @@ static SSHORT print_item(TEXT** s, switch (dtype) { case SQL_ARRAY: - // Print blob-ids only here + // Print blob-ids only here blobid = (ISC_QUAD*) var->sqldata; sprintf(blobbuf, "%"xLONGFORMAT":%"xLONGFORMAT, blobid->gds_quad_high, @@ -7152,7 +7152,7 @@ static SSHORT print_item(TEXT** s, case SQL_BLOB: - // Print blob-ids only here + // Print blob-ids only here blobid = (ISC_QUAD*) var->sqldata; sprintf(blobbuf, "%"xLONGFORMAT":%"xLONGFORMAT, blobid->gds_quad_high, @@ -7182,7 +7182,7 @@ static SSHORT print_item(TEXT** s, print_item_numeric(value, length, dscale, str_buf.getBuffer(length)); sprintf(p, "%s ", str_buf.c_str()); if (List) { - str_buf.ltrim(); // Added 1999-03-23 to left-justify in LIST ON mode + str_buf.ltrim(); // Added 1999-03-23 to left-justify in LIST ON mode isqlGlob.printf("%s%s", str_buf.c_str(), NEWLINE); } } @@ -7191,7 +7191,7 @@ static SSHORT print_item(TEXT** s, #ifdef NATIVE_QUAD case SQL_QUAD: if (dscale) { - // Handle floating scale and precision + // Handle floating scale and precision double numeric = *(SQUAD*) var->sqldata; const double exponent = -dscale; @@ -7259,7 +7259,7 @@ static SSHORT print_item(TEXT** s, if (dscale && (!value || (rounded = ceil(fabs(log10(fabs(value))))) < length - 10)) { int precision = 0; - + // CVC: Test values are // select -2.488355210669293e+01 from rdb$database; // select +2.488355210669293e+01 from rdb$database; @@ -7334,11 +7334,11 @@ static SSHORT print_item(TEXT** s, case SQL_TEXT: string = var->sqldata; string[var->sqllen] = '\0'; - // See if it is character set OCTETS + // See if it is character set OCTETS if (var->sqlsubtype == 1) { const SLONG hex_len = 2 * var->sqllen; TEXT* buff2 = (TEXT*) ISQL_ALLOC(hex_len + 1); - // Convert the string to hex digits + // Convert the string to hex digits for (USHORT i = 0; i < var->sqllen; i++) { sprintf(&buff2[i * 2], "%02X", (UCHAR)string[i]); } @@ -7354,7 +7354,7 @@ static SSHORT print_item(TEXT** s, isqlGlob.printf("%s%s", string, NEWLINE); } else { - // Truncate if necessary + // Truncate if necessary if (length < var->sqllen) string[length] = '\0'; sprintf(p, "%-*s ", length, var->sqldata); @@ -7503,7 +7503,7 @@ processing_state ISQL_print_item_blob(FILE* fp, if ((var->sqlsubtype != subtype) && (subtype != ALL_BLOBS)) { ISQL_msg_get(BLOB_SUBTYPE, msg, SafeArg() << subtype << var->sqlsubtype); - // Blob display set to subtype %d. This blob: subtype = %d\n + // Blob display set to subtype %d. This blob: subtype = %d\n ISQL_printf(fp, msg); return CONT; } @@ -7512,7 +7512,7 @@ processing_state ISQL_print_item_blob(FILE* fp, const UCHAR* bpb = NULL; UCHAR bpb_buffer[64]; ISC_BLOB_DESC from_desc; - + const int blob_subtype = var->sqlsubtype; if (blob_subtype == isc_blob_text) { // ASF: Since ODS11.1, BLOBs are automatically transliterated to the client charset. @@ -7567,7 +7567,7 @@ processing_state ISQL_print_item_blob(FILE* fp, size_t length; while (blob.getSegment(sizeof(buffer) - 1, buffer, length)) { - // Special displays for blr or acl subtypes + // Special displays for blr or acl subtypes if (blob_subtype > isc_blob_text && blob_subtype < isc_blob_max_predefined_subtype) { @@ -7620,7 +7620,7 @@ static void print_item_numeric(SINT64 value, } const bool neg = (value < 0); - + // Use one less space than allowed, to leave room for '.' length--; sprintf(buf, "%*" SQUADFORMAT, length, value); @@ -7717,7 +7717,7 @@ static processing_state print_line(XSQLDA* sqlda, for (int i = 0; i < varnum; i++) { const XSQLVAR* var = varlist[i]; if (!(var->sqltype & 1) || *var->sqlind == 0) { - // Print blob title + // Print blob title isqlGlob.printf( "==============================================================================%s", @@ -7743,7 +7743,7 @@ static void print_performance(perf* perf_before) // Translation of report strings. Do not remove "static" modifier. static bool have_report = false; static TEXT report_1[MSG_LENGTH + MSG_LENGTH]; - + perf perf_after; perf_get_info(&DB, &perf_after); if (!have_report) { @@ -8202,16 +8202,16 @@ static int process_statement(const TEXT* string, **************************************/ // Here we actively use the fact that fb_cancel_enable/disable commands may be send many times. - // They are ignored if cancel already has requested state. This let's us disable cancel + // They are ignored if cancel already has requested state. This let's us disable cancel // in the middle of processing, but do not care about special scope for CancelHolder variable. class CancelHolder { public: - CancelHolder() + CancelHolder() { fb_cancel_operation(isc_status, &DB, fb_cancel_enable); } - ~CancelHolder() + ~CancelHolder() { fb_cancel_operation(isc_status, &DB, fb_cancel_disable); } @@ -8279,7 +8279,7 @@ static int process_statement(const TEXT* string, if (isc_status[2] == isc_arg_warning) ISQL_warning(isc_status); - // Find out what kind of statement this is + // Find out what kind of statement this is const int statement_type = process_request_type(); if (!statement_type) return ps_ERR; @@ -8311,7 +8311,7 @@ static int process_statement(const TEXT* string, statement_type == isc_info_sql_stmt_exec_procedure || statement_type == isc_info_sql_stmt_get_segment; - // if PLAN is set, print out the plan now + // if PLAN is set, print out the plan now if (Plan) { process_plan(); @@ -8338,7 +8338,7 @@ static int process_statement(const TEXT* string, } else if (isc_status[2] == isc_arg_warning) { - // check for warnings + // check for warnings ISQL_warning(isc_status); } @@ -8357,7 +8357,7 @@ static int process_statement(const TEXT* string, return ret; } - // Check to see if this is a SET TRANSACTION statement + // Check to see if this is a SET TRANSACTION statement if (statement_type == isc_info_sql_stmt_start_trans) { // CVC: Starting a txn can fail, too. Let's check it, although I @@ -8365,7 +8365,7 @@ static int process_statement(const TEXT* string, // so this place has little chance to be reached. if (newtrans(string) == FAIL) return ps_ERR; - + if (Stats) print_performance(&perf_before); return ret; @@ -8381,11 +8381,11 @@ static int process_statement(const TEXT* string, ret = ps_ERR; } - // check for warnings + // check for warnings if (isc_status[2] == isc_arg_warning) ISQL_warning(isc_status); - // We are executing a commit or rollback, commit default trans + // We are executing a commit or rollback, commit default trans if ((statement_type == isc_info_sql_stmt_commit) || (statement_type == isc_info_sql_stmt_rollback)) @@ -8395,7 +8395,7 @@ static int process_statement(const TEXT* string, ret = ps_ERR; } - // Print statistics report + // Print statistics report if (Docount) { const SLONG count = process_record_count(statement_type); @@ -8425,7 +8425,7 @@ static int process_statement(const TEXT* string, sqlda->version = SQLDA_VERSION1; sqlda->sqld = sqlda->sqln = n_cols; - // We must re-describe the sqlda, no need to re-prepare + // We must re-describe the sqlda, no need to re-prepare if (isc_dsql_describe(isc_status, &global_Stmt, isqlGlob.SQL_dialect, sqlda)) { @@ -8447,10 +8447,10 @@ static int process_statement(const TEXT* string, return ret; if (statement_type != isc_info_sql_stmt_exec_procedure) { - // Otherwise, open the cursor to start things up + // Otherwise, open the cursor to start things up #ifdef SCROLLABLE_CURSORS - // Declare the C cursor for what it is worth + // Declare the C cursor for what it is worth // CVC: isql doesn't do positioned updates, so I assumed declaring a cursor // may be needed if scrollable cursors are enabled in the engine. @@ -8459,7 +8459,7 @@ static int process_statement(const TEXT* string, return (ps_ERR); } - // check for warnings + // check for warnings if (isc_status[2] == isc_arg_warning) ISQL_warning(isc_status); #endif @@ -8469,7 +8469,7 @@ static int process_statement(const TEXT* string, return (ps_ERR); } - // check for warnings + // check for warnings if (isc_status[2] == isc_arg_warning) ISQL_warning(isc_status); @@ -8496,7 +8496,7 @@ static int process_statement(const TEXT* string, TEXT* line = (TEXT*) ISQL_ALLOC(linelength); TEXT* header = 0; TEXT* header2 = 0; - + if (Heading) { header = (TEXT*) ISQL_ALLOC(linelength); @@ -8554,7 +8554,7 @@ static int process_statement(const TEXT* string, if (rowCount != 0 && lines >= rowCount) break; - // Fetch the current cursor + // Fetch the current cursor #ifdef SCROLLABLE_CURSORS if (Autofetch) { @@ -8644,7 +8644,7 @@ static int process_statement(const TEXT* string, if (lines) isqlGlob.printf(NEWLINE); - // Record count printed here upon request + // Record count printed here upon request if (Docount) { TEXT rec_count_msg[MSG_LENGTH]; @@ -8732,7 +8732,7 @@ static int query_abort(const int reason, const int, void*) return TRUE; #else // we do not want to proceed with shutdown except when exit() was called - return FB_FAILURE; + return FB_FAILURE; #endif } diff --git a/src/isql/show.epp b/src/isql/show.epp index 2f898adda3..19e2abdc31 100644 --- a/src/isql/show.epp +++ b/src/isql/show.epp @@ -154,7 +154,7 @@ const SCHAR* Db_trigger_types[] = { }; -enum priv_flag { +enum priv_flag { priv_UNKNOWN = 1, priv_SELECT = 2, priv_INSERT = 4, @@ -409,7 +409,7 @@ bool SHOW_dbb_parameters(FB_API_HANDLE db_handle, break; case isc_info_ods_minor_version: value_out = isc_vax_integer(d, length); - sprintf(info, "ODS = %"SLONGFORMAT".%"SLONGFORMAT"%s", + sprintf(info, "ODS = %"SLONGFORMAT".%"SLONGFORMAT"%s", (SLONG) isqlGlob.major_ods, value_out, NEWLINE); break; @@ -433,7 +433,7 @@ bool SHOW_dbb_parameters(FB_API_HANDLE db_handle, } break; #endif - + case isc_info_truncated: return info > info_buf; // If we got some items, we are (partially) successful. } @@ -514,7 +514,7 @@ static const char* granted_by(char* buffer, const char* grantor) fb_utils::exact_name(owner); reReadDbOwner = false; } - + strcpy(buffer, grantor); fb_utils::exact_name(buffer); if (!strcmp(buffer, owner)) @@ -631,8 +631,8 @@ processing_state SHOW_grants2 (const SCHAR* object, strcpy (SQL_identifier, object); isqlGlob.printf("GRANT %s%s ON %s TO %s%s%s%s%s", - priv_string, col_string, - SQL_identifier, + priv_string, col_string, + SQL_identifier, user_string, with_option, granted_by(buf_grantor, prev_grantor), terminator, NEWLINE); // re-initialize strings @@ -761,9 +761,9 @@ processing_state SHOW_grants2 (const SCHAR* object, else strcpy (SQL_identifier, object); - isqlGlob.printf("GRANT %s%s ON %s TO %s%s%s%s%s", - priv_string, col_string, - SQL_identifier, + isqlGlob.printf("GRANT %s%s ON %s TO %s%s%s%s%s", + priv_string, col_string, + SQL_identifier, user_string, with_option, granted_by(buf_grantor, prev_grantor), terminator, NEWLINE); } @@ -856,7 +856,7 @@ processing_state SHOW_grants2 (const SCHAR* object, strcpy (SQL_identifier, object); isqlGlob.printf("GRANT EXECUTE ON PROCEDURE %s TO %s%s%s%s%s", - SQL_identifier, user_string, with_option, + SQL_identifier, user_string, with_option, granted_by(buf_grantor, PRV.RDB$GRANTOR), terminator, NEWLINE); first = false; @@ -1153,7 +1153,7 @@ processing_state SHOW_metadata(const SCHAR* const* cmd, {ShowOptions::security_class, "SECCLASSES", 6}, {ShowOptions::users, "USERS", 0} }; - + const ShowOptions showoptions(options, FB_NELEM(options), ShowOptions::wrong); @@ -1167,7 +1167,7 @@ processing_state SHOW_metadata(const SCHAR* const* cmd, showoptions.showCommands(isqlGlob.Out); return ps_ERR; } - + processing_state ret = SKIP; // Only show version and show sql dialect work if there is no db attached bool handled = true; @@ -1196,10 +1196,10 @@ processing_state SHOW_metadata(const SCHAR* const* cmd, if (!ISQL_dbcheck()) ret = ps_ERR; } - + if (ret == ps_ERR || handled) return ret; - + TEXT SQL_id_for_grant[BUFFER_LENGTH128]; int key = 0; @@ -1414,7 +1414,7 @@ processing_state SHOW_metadata(const SCHAR* const* cmd, key = NO_FUNCTIONS; } break; - + case ShowOptions::generator: if (*cmd[2] == '"') { remove_delimited_double_quotes(lcmd[2]); @@ -1483,7 +1483,7 @@ processing_state SHOW_metadata(const SCHAR* const* cmd, } } break; - + case ShowOptions::procedure: if (*cmd[2] == '"') { remove_delimited_double_quotes(lcmd[2]); @@ -1499,7 +1499,7 @@ processing_state SHOW_metadata(const SCHAR* const* cmd, key = NO_PROCS; } break; - + case ShowOptions::trigger: if (*cmd[2] == '"') { remove_delimited_double_quotes(lcmd[2]); @@ -1527,7 +1527,7 @@ processing_state SHOW_metadata(const SCHAR* const* cmd, key = NO_TRIGGERS; } break; - + case ShowOptions::check: if (*cmd[2] == '"') { remove_delimited_double_quotes(lcmd[2]); @@ -1549,11 +1549,11 @@ processing_state SHOW_metadata(const SCHAR* const* cmd, key = NO_TABLE; } break; - + case ShowOptions::database: show_db(); break; - + case ShowOptions::comment: ret = show_comments(cmmShow, 0); if (ret == OBJECT_NOT_FOUND) @@ -1575,7 +1575,7 @@ processing_state SHOW_metadata(const SCHAR* const* cmd, key = NO_COLLATIONS; } break; - + case ShowOptions::dependency: if (*cmd[2] == '"') { @@ -1584,11 +1584,11 @@ processing_state SHOW_metadata(const SCHAR* const* cmd, } else ret = show_dependencies(cmd[2]); - + if (ret == OBJECT_NOT_FOUND) key = NO_DEPENDENCIES; break; - + case ShowOptions::security_class: if (*cmd[2] == '"') { @@ -1776,7 +1776,7 @@ static void show_charsets( const SSHORT default_char_set_id = ISQL_get_default_char_set_id(); // If there is a relation_name, this is a real column, look up collation -// in rdb$relation_fields +// in rdb$relation_fields if (relation_name) { FOR RRF IN RDB$RELATION_FIELDS CROSS @@ -1877,7 +1877,7 @@ static void show_proc_charsets( prp_collation_null = PRP2.RDB$COLLATION_ID.NULL; if (!prp_collation_null) collation = PRP2.RDB$COLLATION_ID; - END_FOR + END_FOR } if (prp_collation_null && @@ -1893,7 +1893,7 @@ static void show_proc_charsets( prp_collation_null = RFL.RDB$COLLATION_ID.NULL; if (!prp_collation_null) collation = RFL.RDB$COLLATION_ID; - END_FOR + END_FOR } if (prp_collation_null && !FLD.RDB$COLLATION_ID.NULL) @@ -1937,7 +1937,7 @@ static void show_proc_charsets( else ISQL_get_character_sets(char_set_id, collation, false, char_sets); } - + if (char_sets[0]) { if (doIndent) @@ -2107,7 +2107,7 @@ static void show_comment(const char* objtype, char* name1, char* name2, fb_utils::exact_name(name1); if (name2) fb_utils::exact_name(name2); - + char SQL_identifier2[BUFFER_LENGTH128]; if (escape_quotes && isqlGlob.db_SQL_dialect > SQL_DIALECT_V6_TRANSITION) { @@ -2131,7 +2131,7 @@ static void show_comment(const char* objtype, char* name1, char* name2, isqlGlob.printf("COMMENT ON %-12s %s IS %s", objtype, name1, quot); else isqlGlob.printf("COMMENT ON %-12s %s.%s IS %s", objtype, name1, name2, quot); - + SHOW_print_metadata_text_blob(isqlGlob.Out, blobfld, escape_quotes); isqlGlob.printf("%s%s%s", quot, isqlGlob.global_Term, NEWLINE); } @@ -2558,7 +2558,7 @@ static processing_state show_dependencies(const char* object) { if (!object || !object[0]) return ps_ERR; - + bool missing = true; for (int i = 0; i < FB_NELEM(Object_types); ++i) @@ -2569,7 +2569,7 @@ static processing_state show_dependencies(const char* object) isqlGlob.printf("+++%s", NEWLINE); } } - + return missing ? OBJECT_NOT_FOUND : SKIP; } @@ -2609,7 +2609,7 @@ static processing_state show_dependencies(const char* object, int obj_type) ISQL_errmsg(isc_status); return ps_ERR; END_ERROR; - + if (!missing1) { const char* type_name = Object_types[obj_type]; @@ -2618,7 +2618,7 @@ static processing_state show_dependencies(const char* object, int obj_type) } bool missing2 = true; - + FOR DEP2 IN RDB$DEPENDENCIES WITH DEP2.RDB$DEPENDENT_NAME EQ object AND DEP2.RDB$DEPENDENT_TYPE EQ obj_type @@ -2636,7 +2636,7 @@ static processing_state show_dependencies(const char* object, int obj_type) } else isqlGlob.prints(", "); - + fb_utils::exact_name(DEP2.RDB$DEPENDED_ON_NAME); const char* type_name = Object_types[DEP2.RDB$DEPENDED_ON_TYPE]; if (DEP2.RDB$FIELD_NAME.NULL) @@ -2651,10 +2651,10 @@ static processing_state show_dependencies(const char* object, int obj_type) ISQL_errmsg(isc_status); return ps_ERR; END_ERROR; - + bool missing3 = true; bool is_table = false; - + FOR REL IN RDB$RELATIONS WITH REL.RDB$RELATION_NAME = object AND REL.RDB$VIEW_BLR MISSING AND @@ -2679,7 +2679,7 @@ static processing_state show_dependencies(const char* object, int obj_type) if (FLD.RDB$COMPUTED_BLR.NULL) // redundant continue; - + if (missing3) { if (!target_done) @@ -2688,7 +2688,7 @@ static processing_state show_dependencies(const char* object, int obj_type) isqlGlob.printf("%s[%s:%s]", TAB_AS_SPACES, object, type_name); target_done = true; } - + isqlGlob.prints(NEWLINE); missing3 = false; } @@ -3201,7 +3201,7 @@ static processing_state show_functions(const SCHAR* object, const SSHORT sys_fla else return OBJECT_NOT_FOUND; } - + FOR FUN IN RDB$FUNCTIONS CROSS FNA IN RDB$FUNCTION_ARGUMENTS WITH FUN.RDB$FUNCTION_NAME EQ FNA.RDB$FUNCTION_NAME AND @@ -3768,7 +3768,7 @@ static processing_state show_proc(const SCHAR* procname) prm_default_source_null = PRM2.RDB$DEFAULT_SOURCE.NULL; prm_default_source = PRM2.RDB$DEFAULT_SOURCE; } - END_FOR + END_FOR } char relationName[BUFFER_LENGTH128] = ""; @@ -3792,7 +3792,7 @@ static processing_state show_proc(const SCHAR* procname) fb_utils::exact_name(relationField); } - END_FOR + END_FOR } const bool basedOnColumn = relationName[0] && relationField[0]; @@ -3821,7 +3821,7 @@ static processing_state show_proc(const SCHAR* procname) { show_proc_charsets(PRM.RDB$PROCEDURE_NAME, PRM.RDB$PARAMETER_NAME, true, true, false); } - + if (PRM.RDB$PARAMETER_TYPE == 0) // input, try to show default and make Vlad happy. { if (!prm_default_source_null) @@ -3872,14 +3872,14 @@ static processing_state show_role(const SCHAR* object) SORTED BY X.RDB$ROLE_NAME bool system_flag = false; - if (isqlGlob.major_ods >= ODS_VERSION11) + if (isqlGlob.major_ods >= ODS_VERSION11) { FOR SF IN RDB$ROLES - WITH SF.RDB$ROLE_NAME = X.RDB$ROLE_NAME + WITH SF.RDB$ROLE_NAME = X.RDB$ROLE_NAME AND SF.RDB$SYSTEM_FLAG > 0 - + system_flag = true; - + END_FOR } @@ -3942,7 +3942,7 @@ static processing_state show_role(const SCHAR* object) ISQL_errmsg (isc_status); return ps_ERR; END_ERROR - + if (first) { first = false; @@ -3980,14 +3980,14 @@ static processing_state show_secclass(const char* object, const char* opt) { if (!object || !*object) return ps_ERR; - + const bool detail = opt && (fb_utils::stricmp(opt, "DETAIL") == 0 || fb_utils::stricmp(opt, "DET") == 0); XSQLVAR var; // To trick ISQL_print_item_blob() memset(&var, 0, sizeof(var)); var.sqlsubtype = isc_blob_acl; - + int count = 0; if (strcmp(object, "*") == 0) @@ -4008,10 +4008,10 @@ static processing_state show_secclass(const char* object, const char* opt) ISQL_errmsg(isc_status); return ps_ERR; END_ERROR - + return count ? SKIP : OBJECT_NOT_FOUND; } - + FOR REL IN RDB$RELATIONS CROSS SC IN RDB$SECURITY_CLASSES OVER RDB$SECURITY_CLASS @@ -4068,7 +4068,7 @@ static processing_state show_secclass(const char* object, const char* opt) ISQL_errmsg(isc_status); return ps_ERR; END_ERROR - + FOR PR IN RDB$PROCEDURES CROSS SC IN RDB$SECURITY_CLASSES OVER RDB$SECURITY_CLASS @@ -4274,7 +4274,7 @@ static processing_state show_table( continue; } - // The null flag is either 1 or null (for nullable) + // The null flag is either 1 or null (for nullable) if (RFR.RDB$NULL_FLAG == 1 || FLD.RDB$NULL_FLAG == 1 || (!RFR.RDB$BASE_FIELD.NULL && @@ -4395,7 +4395,7 @@ static processing_state show_table( return ps_ERR; END_ERROR; } - + if (isPK || isUK) // Special handling for PRIMARY KEY and UNIQUE constraints. { FOR IDX IN RDB$INDICES @@ -4413,7 +4413,7 @@ static processing_state show_table( } if (explicit_index) isqlGlob.printf(" %s", RELC1.RDB$INDEX_NAME); - + isqlGlob.prints(NEWLINE); END_FOR ON_ERROR @@ -4662,7 +4662,7 @@ static processing_state show_users() * Show users logged in the database (not users defined for this database). * **************************************/ - + const SCHAR user_items[] = { isc_info_user_names, @@ -4684,7 +4684,7 @@ static processing_state show_users() ovar.sqllen = sizeof(my_user) - 3; const char* getuser = isqlGlob.major_ods < ODS_VERSION10 ? "select user from rdb$database" : "select current_user from rdb$database"; - + /* #ifdef TRUSTED_AUTH //if (Trusted_auth) @@ -4758,11 +4758,11 @@ static processing_state show_users() newline = !newline; } break; - + case isc_info_truncated: if (newline) isqlGlob.printf("\n"); - + ISQL_msg_get(OUTPUT_TRUNCATED, msg); isqlGlob.printf("%s\n", msg); return rc; // If we got some items, we are (partially) successful. @@ -4775,7 +4775,7 @@ static processing_state show_users() if (newline) // Last line was without newline. isqlGlob.printf("\n"); - + return rc; } diff --git a/src/msgs/build_file.epp b/src/msgs/build_file.epp index 80d387004a..acc242f7cd 100644 --- a/src/msgs/build_file.epp +++ b/src/msgs/build_file.epp @@ -180,9 +180,9 @@ int CLIB_ROUTINE main( int argc, char** argv) pathname[len + 1] = 0; } } - + const size_t separator_pos = pathname ? strlen(pathname) : 0; - + /* check for the locale option */ if (!locale) { // no locale given: do the regular US msgs @@ -337,7 +337,7 @@ static USHORT do_msgs( const TEXT* filename, const TEXT* locale, bool sw_warning write_bucket((msgnod*) &header, sizeof(header)); // Write out messages building B-tree - + int warning_counter = 0; USHORT n = 0; ULONG position = 0, prior_code = 0; @@ -499,7 +499,7 @@ static SLONG write_bucket( const msgnod* bucket, USHORT length) fprintf(stderr, "IO error on write()\n"); exit(FINI_ERROR); } - + const SLONG zero_bytes = 0; n = write(global_file, &zero_bytes, padded_length - length); if (n == -1) { diff --git a/src/msgs/change_msgs.epp b/src/msgs/change_msgs.epp index 6540c50613..968553c68b 100644 --- a/src/msgs/change_msgs.epp +++ b/src/msgs/change_msgs.epp @@ -64,7 +64,7 @@ int main( int argc, char **argv) ************************************** * * Functional description - * Top level routine. + * Top level routine. * **************************************/ char facility[20], text[256], module[32], routine[32]; diff --git a/src/msgs/check_msgs.epp b/src/msgs/check_msgs.epp index 204e864511..4093a68953 100644 --- a/src/msgs/check_msgs.epp +++ b/src/msgs/check_msgs.epp @@ -59,7 +59,7 @@ int CLIB_ROUTINE main( int argc, char *argv[]) ************************************** * * Functional description - * Top level routine. + * Top level routine. * **************************************/ TEXT *p, **end_args, db_file[256]; @@ -127,7 +127,7 @@ int CLIB_ROUTINE main( int argc, char *argv[]) isc_encode_date(localtime(&file_stat.st_mtime), (ISC_QUAD*) &date_loc); flag_loc = false; } -/* Earlier the following fclose was closing ind_msg again, due to which +/* Earlier the following fclose was closing ind_msg again, due to which check_messages was crashing with SEGV signal - */ fclose(ind_loc); /* A bug in check_messages is fixed */ } @@ -138,7 +138,7 @@ int CLIB_ROUTINE main( int argc, char *argv[]) if (!flag_jrd) { FOR FIRST 1 X IN FACILITIES WITH - X.FACILITY EQ 'JRD' AND X.LAST_CHANGE GE date_jrd + X.FACILITY EQ 'JRD' AND X.LAST_CHANGE GE date_jrd flag_jrd = true; END_FOR; @@ -146,7 +146,7 @@ int CLIB_ROUTINE main( int argc, char *argv[]) if (!flag_msg) { FOR FIRST 1 X IN FACILITIES WITH - X.LAST_CHANGE GE date_msg + X.LAST_CHANGE GE date_msg flag_msg = true; END_FOR; @@ -154,7 +154,7 @@ int CLIB_ROUTINE main( int argc, char *argv[]) if (!flag_loc) { FOR FIRST 1 T IN TRANSMSGS WITH - T.TRANS_DATE GE date_loc + T.TRANS_DATE GE date_loc flag_loc = true; END_FOR; diff --git a/src/msgs/enter_msgs.epp b/src/msgs/enter_msgs.epp index f8f6201e1d..cd34520712 100644 --- a/src/msgs/enter_msgs.epp +++ b/src/msgs/enter_msgs.epp @@ -68,7 +68,7 @@ int main( int argc, char **argv) ************************************** * * Functional description - * Top level routine. + * Top level routine. * **************************************/ @@ -338,7 +338,7 @@ static bool get_sql_code( SSHORT * sql_code) if (sql_num < 0) { srch_num = 1000 + sql_num; FOR M IN MESSAGES WITH M.FAC_CODE = FAC_SQL_NEGATIVE - AND M.NUMBER = srch_num + AND M.NUMBER = srch_num got_it = true; END_FOR; @@ -346,7 +346,7 @@ static bool get_sql_code( SSHORT * sql_code) else { srch_num = sql_num; FOR M IN MESSAGES WITH M.FAC_CODE = FAC_SQL_POSITIVE - AND M.NUMBER = srch_num + AND M.NUMBER = srch_num got_it = true; END_FOR; diff --git a/src/utilities/gsec/security.epp b/src/utilities/gsec/security.epp index 18e26693d7..f991876ebe 100644 --- a/src/utilities/gsec/security.epp +++ b/src/utilities/gsec/security.epp @@ -61,7 +61,7 @@ SSHORT SECURITY_exec_line(ISC_STATUS* isc_status, * This is used to add and delete users from the user information * database (security2.fdb). It also displays information * about current users and allows modification of current - * users' parameters. + * users' parameters. * Returns 0 on success, otherwise returns a Gsec message number * and the status vector containing the error info. * The syntax is: @@ -189,7 +189,7 @@ SSHORT SECURITY_exec_line(ISC_STATUS* isc_status, changes the current value to the null value */ found = false; - FOR (TRANSACTION_HANDLE trans REQUEST_HANDLE request) U IN USERS + FOR (TRANSACTION_HANDLE trans REQUEST_HANDLE request) U IN USERS WITH U.USER_NAME EQ io_user_data->user_name found = true; MODIFY U USING @@ -257,7 +257,7 @@ SSHORT SECURITY_exec_line(ISC_STATUS* isc_status, if (!fb_utils::stricmp(io_user_data->user_name, SYSDBA_USER_NAME)) ret = GsecMsg23; else { - FOR (TRANSACTION_HANDLE trans REQUEST_HANDLE request) U IN USERS + FOR (TRANSACTION_HANDLE trans REQUEST_HANDLE request) U IN USERS WITH U.USER_NAME EQ io_user_data->user_name found = true; ERASE U @@ -354,7 +354,7 @@ SSHORT SECURITY_exec_line(ISC_STATUS* isc_status, SSHORT ret = SECURITY_exec_line(isc_status, DB, gds_trans, io_user_data, display_func, callback_arg); - // rollback if we have an error using tmp_status to avoid + // rollback if we have an error using tmp_status to avoid // overwriting the error status which the caller wants to see if (ret) { diff --git a/src/utilities/gstat/dba.epp b/src/utilities/gstat/dba.epp index 08ed91485d..a21d2e0028 100644 --- a/src/utilities/gstat/dba.epp +++ b/src/utilities/gstat/dba.epp @@ -183,7 +183,7 @@ struct dba_mem { /* threading declarations for thread data */ -class tdba : public ThreadData +class tdba : public ThreadData { public: explicit tdba(Firebird::UtilSvc* us) @@ -352,7 +352,7 @@ int gstat(Firebird::UtilSvc* uSvc) break; } //in_sw_tab->in_sw_state = true; - + switch (in_sw_tab->in_sw) { case 0: @@ -560,7 +560,7 @@ int gstat(Firebird::UtilSvc* uSvc) /* print continuation file sequence */ dba_print(7); - // msg 7: \n\nDatabase file sequence: + // msg 7: \n\nDatabase file sequence: for (current = tddba->files; current->fil_next; current = current->fil_next) { dba_print(8, SafeArg() << current->fil_string << current->fil_next->fil_string); @@ -572,22 +572,22 @@ int gstat(Firebird::UtilSvc* uSvc) /* Check to make sure that the user accessing the database is either * SYSDBA or owner of the database */ - + Firebird::ClumpletWriter dpb(Firebird::ClumpletReader::Tagged, MAX_DPB_SIZE, isc_dpb_version1); uSvc->getAddressPath(dpb); dpb.insertTag(isc_dpb_gstat_attach); dpb.insertTag(isc_dpb_no_garbage_collect); - if (*username) + if (*username) { dpb.insertString(isc_dpb_user_name, username, strlen(username)); } - if (*password) + if (*password) { dpb.insertString(uSvc->isService() ? isc_dpb_password_enc : isc_dpb_password, password, strlen(password)); } - if (*tr_user) + if (*tr_user) { uSvc->checkService(); dpb.insertString(isc_dpb_trusted_auth, tr_user, strlen(tr_user)); @@ -603,7 +603,7 @@ int gstat(Firebird::UtilSvc* uSvc) } #endif - isc_attach_database(status_vector, 0, connName.c_str(), &DB, dpb.getBufferLength(), + isc_attach_database(status_vector, 0, connName.c_str(), &DB, dpb.getBufferLength(), reinterpret_cast(dpb.getBuffer())); if (status_vector[1]) dba_exit(FINI_ERROR, tddba); @@ -630,7 +630,7 @@ int gstat(Firebird::UtilSvc* uSvc) if (!X.RDB$VIEW_BLR.NULL || !X.RDB$EXTERNAL_FILE.NULL) { continue; } - + dba_rel* relation; if (sw_relation) { @@ -658,7 +658,7 @@ int gstat(Firebird::UtilSvc* uSvc) FOR(TRANSACTION_HANDLE transact1 REQUEST_HANDLE request2) Y IN RDB$PAGES WITH Y.RDB$RELATION_ID EQ relation->rel_id AND - Y.RDB$PAGE_SEQUENCE EQ 0 + Y.RDB$PAGE_SEQUENCE EQ 0 if (Y.RDB$PAGE_TYPE == pag_pointer) { relation->rel_pointer_page = Y.RDB$PAGE_NUMBER; @@ -670,7 +670,7 @@ int gstat(Firebird::UtilSvc* uSvc) ON_ERROR dba_exit(FINI_ERROR, tddba); END_ERROR - + if (sw_index) { FOR(TRANSACTION_HANDLE transact1 REQUEST_HANDLE request3) @@ -715,7 +715,7 @@ int gstat(Firebird::UtilSvc* uSvc) END_ERROR dba_print(10); - // msg 10: \nAnalyzing database pages ...\n + // msg 10: \nAnalyzing database pages ...\n for (dba_rel* relation = tddba->relations; relation; relation = relation->rel_next) @@ -747,7 +747,7 @@ int gstat(Firebird::UtilSvc* uSvc) { dba_print(11, SafeArg() << relation->rel_pointer_page << relation->rel_index_root); - // msg 11: " Primary pointer page: %ld, Index root page: %ld" + // msg 11: " Primary pointer page: %ld, Index root page: %ld" if (sw_record) { double average = (relation->rel_records) ? (double) relation->rel_record_space / @@ -757,7 +757,7 @@ int gstat(Firebird::UtilSvc* uSvc) " Average record length: %s, total records: %ld\n", buf, relation->rel_records); // dba_print(18, SafeArg() << buf << relation->rel_records); - // msg 18: " Average record length: %s, total records: %ld + // msg 18: " Average record length: %s, total records: %ld average = (relation->rel_versions) ? (double) relation->rel_version_space / relation->rel_versions : 0.0; @@ -768,7 +768,7 @@ int gstat(Firebird::UtilSvc* uSvc) relation->rel_max_versions); // dba_print(19, SafeArg() << buf << relation->rel_versions << // relation->rel_max_versions); - // msg 19: " Average version length: %s, total versions: %ld, max versions: %ld + // msg 19: " Average version length: %s, total versions: %ld, max versions: %ld } const double average = (relation->rel_data_pages) ? @@ -777,20 +777,20 @@ int gstat(Firebird::UtilSvc* uSvc) (tddba->page_size - DPG_SIZE)) : 0.0; sprintf((char*) buf, "%.0f%%", average); dba_print(12, SafeArg() << relation->rel_data_pages << - relation->rel_slots << buf); + relation->rel_slots << buf); /* msg 12: " Data pages: %ld, data page slots: %ld, average fill: %s */ dba_print(13); /* msg 13: " Fill distribution:" */ print_distribution("\t", relation->rel_fill_distribution); } uSvc->printf("\n"); - + for (const dba_idx* index = relation->rel_indexes; index; index = index->idx_next) { dba_print(14, SafeArg() << index->idx_name << index->idx_id); - // msg 14: " Index %s (%d)" + // msg 14: " Index %s (%d)" dba_print(15, SafeArg() << index->idx_depth << index->idx_leaf_buckets << index->idx_nodes); - // msg 15: \tDepth: %d, leaf buckets: %ld, nodes: %ld + // msg 15: \tDepth: %d, leaf buckets: %ld, nodes: %ld const double average = (index->idx_nodes) ? (double) index->idx_data_length / index->idx_nodes : 0; sprintf((char*) buf, "%.2f", average); @@ -1069,12 +1069,12 @@ static void analyze_index( dba_rel* relation, dba_idx* index) **************************************/ tdba* tddba = tdba::getSpecific(); - const index_root_page* index_root = + const index_root_page* index_root = (const index_root_page*) db_read(relation->rel_index_root); SLONG page; if (index_root->irt_count <= index->idx_id || - !(page = index_root->irt_rpt[index->idx_id].irt_root)) + !(page = index_root->irt_rpt[index->idx_id].irt_root)) { return; } @@ -1086,7 +1086,7 @@ static void analyze_index( dba_rel* relation, dba_idx* index) UCHAR* pointer; IndexNode node; - while (bucket->btr_level) + while (bucket->btr_level) { pointer = BTreeNode::getPointerFirstNode(const_cast(bucket)); BTreeNode::readNode(&node, pointer, bucket->btr_header.pag_flags, false); @@ -1108,7 +1108,7 @@ static void analyze_index( dba_rel* relation, dba_idx* index) const UCHAR* const firstNode = pointer; while (true) { - pointer = BTreeNode::readNode(&node, pointer, + pointer = BTreeNode::readNode(&node, pointer, bucket->btr_header.pag_flags, true); if (node.isEndBucket || node.isEndLevel) { @@ -1118,7 +1118,7 @@ static void analyze_index( dba_rel* relation, dba_idx* index) ++index->idx_nodes; index->idx_data_length += node.length; const USHORT l = node.length + node.prefix; - + bool dup; if (node.nodePointer == firstNode) { dup = BTreeNode::keyEquality(key_length, key, &node); @@ -1272,7 +1272,7 @@ static void db_error( SLONG status) { sprintf(s, "unknown Windows NT error %ld", status); } - + tddba->uSvc->printf("%s\n", s); dba_exit(FINI_ERROR, tddba); } @@ -1294,7 +1294,7 @@ static dba_fil* db_open(const char* file_name, USHORT file_length) * **************************************/ tdba* tddba = tdba::getSpecific(); - + dba_fil* fil; if (tddba->files) { @@ -1373,7 +1373,7 @@ static const pag* db_read( SLONG page_number) dba_fil* fil; for (fil = tddba->files; page_number > (SLONG) fil->fil_max_page - && fil->fil_next;) + && fil->fil_next;) { fil = fil->fil_next; } @@ -1404,13 +1404,13 @@ static const pag* db_read( SLONG page_number) NULL)) { tddba->uSvc->setServiceStatus(GSTAT_MSG_FAC, 30, SafeArg()); - // msg 30: Can't read a database page + // msg 30: Can't read a database page db_error(GetLastError()); } if (actual_length != tddba->page_size) { tddba->uSvc->setServiceStatus(GSTAT_MSG_FAC, 4, SafeArg()); dba_error(4); - // msg 4: Unexpected end of database file. + // msg 4: Unexpected end of database file. } return tddba->global_buffer; @@ -1498,7 +1498,7 @@ static dba_fil* db_open(const char* file_name, USHORT file_length) if ((fil->fil_desc = open(file_name, O_RDONLY)) == -1) { tddba->uSvc->setServiceStatus(GSTAT_MSG_FAC, 29, SafeArg() << file_name); - // msg 29: Can't open database file %s + // msg 29: Can't open database file %s db_error(errno); } @@ -1542,7 +1542,7 @@ static const pag* db_read( SLONG page_number) dba_fil* fil; for (fil = tddba->files; page_number > (SLONG) fil->fil_max_page - && fil->fil_next;) + && fil->fil_next;) { fil = fil->fil_next; } @@ -1551,7 +1551,7 @@ static const pag* db_read( SLONG page_number) const FB_UINT64 offset = ((FB_UINT64) page_number) * ((FB_UINT64) tddba->page_size); if (lseek (fil->fil_desc, offset, 0) == -1) { tddba->uSvc->setServiceStatus(GSTAT_MSG_FAC, 30, SafeArg()); - // msg 30: Can't read a database page + // msg 30: Can't read a database page db_error(errno); } @@ -1561,13 +1561,13 @@ static const pag* db_read( SLONG page_number) const SSHORT l = read(fil->fil_desc, p, length); if (l < 0) { tddba->uSvc->setServiceStatus(GSTAT_MSG_FAC, 30, SafeArg()); - // msg 30: Can't read a database page + // msg 30: Can't read a database page db_error(errno); } if (!l) { tddba->uSvc->setServiceStatus(GSTAT_MSG_FAC, 4, SafeArg()); dba_error(4); - // msg 4: Unexpected end of database file. + // msg 4: Unexpected end of database file. } p += l; length -= l; diff --git a/src/utilities/stats.epp b/src/utilities/stats.epp index 83f335b3f9..be4b8f8c5c 100644 --- a/src/utilities/stats.epp +++ b/src/utilities/stats.epp @@ -135,7 +135,7 @@ int stats_fetch(SLONG *status_vector, int **db_handle, STATS *stats_ptr) if (isc_database_info(status_vector, db_handle, sizeof(info_request), info_request, sizeof(info_buffer), - info_buffer)) + info_buffer)) { return status_vector[1]; } @@ -152,7 +152,7 @@ int stats_fetch(SLONG *status_vector, int **db_handle, STATS *stats_ptr) status_vector[2] = isc_arg_end; return status_vector[1]; } - + const SCHAR* const end = info_buffer + sizeof(info_buffer); for (const SCHAR* p = info_buffer; p < end && *p != isc_info_end;) { const SSHORT length = gds__vax_integer(p + 1, 2); @@ -352,7 +352,7 @@ static int zap_longs(SLONG* ptr, SSHORT count) *ptr++ = 0; } while (--count); } - + return 0; }