diff --git a/src/jrd/dyn_def.epp b/src/jrd/dyn_def.epp index 5e993af839..25571fe931 100644 --- a/src/jrd/dyn_def.epp +++ b/src/jrd/dyn_def.epp @@ -123,102 +123,6 @@ static bool is_it_user_name(Global*, const Firebird::MetaName&, thread_db*); static USHORT skip_blr_blob(const UCHAR** ptr); -/* -void DYN_define_cache( Global* gbl, const UCHAR** ptr) -{ -// ************************************** -// * -// * D Y N _ d e f i n e _ c a c h e -// * -// ************************************** -// * -// * Functional description -// * Define a database cache file. -// * -// ************************************** - SSHORT id = -1; - - thread_db* tdbb = JRD_get_thread_data(); - Database* dbb = tdbb->tdbb_database; - jrd_req* request = NULL; - - try { - - bool found = false; - id = drq_l_cache; - request = CMP_find_request(tdbb, drq_l_cache, DYN_REQUESTS); - FOR(REQUEST_HANDLE request TRANSACTION_HANDLE gbl->gbl_transaction) - FIL IN RDB$FILES WITH FIL.RDB$FILE_FLAGS EQ FILE_cache - found = true; - END_FOR; - - if (!DYN_REQUEST(drq_l_cache)) { - DYN_REQUEST(drq_l_cache) = request; - } - - if (found) { - goto dyn_punt_148; - } - - request = CMP_find_request(tdbb, drq_s_cache, DYN_REQUESTS); - id = drq_s_cache; - STORE(REQUEST_HANDLE request TRANSACTION_HANDLE gbl->gbl_transaction) - X IN RDB$FILES - GET_STRING(ptr, X.RDB$FILE_NAME); - X.RDB$FILE_FLAGS = FILE_cache; - X.RDB$FILE_FLAGS.NULL = FALSE; - X.RDB$FILE_START = 0; - X.RDB$FILE_START.NULL = FALSE; - X.RDB$FILE_LENGTH.NULL = TRUE; - - UCHAR verb; - while ((verb = *(*ptr)++) != isc_dyn_end) - { - switch (verb) - { - case isc_dyn_file_length: - X.RDB$FILE_LENGTH = DYN_get_number(ptr); - X.RDB$FILE_LENGTH.NULL = FALSE; - break; - - default: - DYN_unsupported_verb(); - } - } - - END_STORE; - - if (!DYN_REQUEST(drq_s_cache)) - { - DYN_REQUEST(drq_s_cache) = request; - } - - } // try - catch (const std::exception& ex) { - Firebird::stuff_exception(tdbb->tdbb_status_vector, ex); - if (id == drq_s_cache) - { - DYN_rundown_request(request, drq_s_cache); - DYN_error_punt(true, 150, NULL, NULL, NULL, NULL, NULL); - // msg 150: STORE RDB$FILES failed - } - else - { - DYN_rundown_request(request, drq_l_cache); - DYN_error_punt(true, 156, NULL, NULL, NULL, NULL, NULL); - // msg 156: Shared cache lookup failed - } - } - - return; - -dyn_punt_148: - DYN_error_punt(false, 148, NULL, NULL, NULL, NULL, NULL); - // msg 148: "Shared cache file already exists" -} -*/ - - void DYN_define_constraint(Global* gbl, const UCHAR** ptr, const Firebird::MetaName* relation_name, @@ -2461,137 +2365,6 @@ void DYN_define_local_field(Global* gbl, } -/* -void DYN_define_log_file( - Global* gbl, - const UCHAR** ptr, - bool first_log_file, bool default_log) -{ -// ************************************** -// * -// * D Y N _ d e f i n e _ l o g _ f i l e -// * -// ************************************** -// * -// * Functional description -// * Define log files for WAL (obsolete). -// * -// ************************************** - thread_db* tdbb = JRD_get_thread_data(); - Database* dbb = tdbb->tdbb_database; - - jrd_req* request = NULL; - SSHORT id = -1; - - try { - - if (first_log_file) - { - bool found = false; - id = drq_l_log_files; - request = CMP_find_request(tdbb, drq_l_log_files, DYN_REQUESTS); - FOR(REQUEST_HANDLE request TRANSACTION_HANDLE gbl->gbl_transaction) - FIL IN RDB$LOG_FILES - found = true; - END_FOR - - if (!DYN_REQUEST(drq_l_log_files)) - DYN_REQUEST(drq_l_log_files) = request; - - if (found) { - goto local_punt_false_151; - } - } - - request = CMP_find_request(tdbb, drq_s_log_files, DYN_REQUESTS); - id = drq_s_log_files; - STORE(REQUEST_HANDLE request TRANSACTION_HANDLE gbl->gbl_transaction) - X IN RDB$LOG_FILES - X.RDB$FILE_LENGTH.NULL = TRUE; - X.RDB$FILE_SEQUENCE.NULL = TRUE; - X.RDB$FILE_PARTITIONS.NULL = TRUE; - X.RDB$FILE_P_OFFSET.NULL = TRUE; - - if (default_log) { - if (dbb->dbb_filename.length() >= sizeof(X.RDB$FILE_NAME)) - DYN_error_punt(false, 159, NULL, NULL, NULL, NULL, NULL); - memcpy(X.RDB$FILE_NAME, dbb->dbb_filename.c_str(), - dbb->dbb_filename.length()); - X.RDB$FILE_NAME[dbb->dbb_filename.length()] = '\0'; - X.RDB$FILE_FLAGS.NULL = FALSE; - X.RDB$FILE_FLAGS = LOG_default | LOG_serial; - } - else { - X.RDB$FILE_FLAGS.NULL = FALSE; - X.RDB$FILE_FLAGS = 0; - GET_STRING(ptr, X.RDB$FILE_NAME); - - UCHAR verb; - while ((verb = *(*ptr)++) != isc_dyn_end) - switch (verb) - { - case isc_dyn_file_length: - X.RDB$FILE_LENGTH = DYN_get_number(ptr); - X.RDB$FILE_LENGTH.NULL = FALSE; - break; - - case isc_dyn_log_file_sequence: - X.RDB$FILE_SEQUENCE.NULL = FALSE; - X.RDB$FILE_SEQUENCE = (SSHORT)DYN_get_number(ptr); - break; - - case isc_dyn_log_file_partitions: - X.RDB$FILE_PARTITIONS.NULL = FALSE; - X.RDB$FILE_PARTITIONS = (SSHORT)DYN_get_number(ptr); - break; - - case isc_dyn_log_file_raw: - X.RDB$FILE_FLAGS |= LOG_raw; - break; - - case isc_dyn_log_file_serial: - X.RDB$FILE_FLAGS |= LOG_serial; - break; - - case isc_dyn_log_file_overflow: - X.RDB$FILE_FLAGS |= LOG_overflow; - break; - - default: - DYN_unsupported_verb(); - } - } - - END_STORE; - - if (!DYN_REQUEST(drq_s_log_files)) { - DYN_REQUEST(drq_s_log_files) = request; - } - - } - catch (const std::exception& ex) { - Firebird::stuff_exception(tdbb->tdbb_status_vector, ex); - if (id == drq_s_log_files) { - DYN_rundown_request(request, drq_s_log_files); - DYN_error_punt(true, 154, NULL, NULL, NULL, NULL, NULL); - // msg 154: STORE RDB$LOG_FILES failed - } - else { - DYN_rundown_request(request, drq_l_log_files); - DYN_error_punt(true, 155, NULL, NULL, NULL, NULL, NULL); - // msg 155: Write ahead log lookup failed - } - } - - return; - -local_punt_false_151: - DYN_error_punt(false, 151, NULL, NULL, NULL, NULL, NULL); - // msg 151: "Write ahead log already exists" -} -*/ - - void DYN_define_parameter( Global* gbl, const UCHAR** ptr, Firebird::MetaName* procedure_name) { /************************************** @@ -4221,12 +3994,12 @@ static bool find_field_source(thread_db* tdbb, jrd_req* request = NULL; -/* CVC: It seems the logic of this function was changed over time. It's unlikely -it will cause a failure that leads to call DYN_error_punt(), unless the request finds -problems due to database corruption or unexpected ODS changes. Under normal -circumstances, it will return either true or false. When true, we found a field source -for the view's name/context/field and are loading this value in the last parameter, -that can be used against rdb$fields' rdb$field_name. */ + /* CVC: It seems the logic of this function was changed over time. It's unlikely + it will cause a failure that leads to call DYN_error_punt(), unless the request finds + problems due to database corruption or unexpected ODS changes. Under normal + circumstances, it will return either true or false. When true, we found a field source + for the view's name/context/field and are loading this value in the last parameter, + that can be used against rdb$fields' rdb$field_name. */ bool found = false; diff --git a/src/jrd/dyn_df_proto.h b/src/jrd/dyn_df_proto.h index 5c5c569600..2053c0bf7f 100644 --- a/src/jrd/dyn_df_proto.h +++ b/src/jrd/dyn_df_proto.h @@ -24,7 +24,6 @@ #ifndef JRD_DYN_DF_PROTO_H #define JRD_DYN_DF_PROTO_H -//void DYN_define_cache(Jrd::Global*, const UCHAR**); void DYN_define_constraint(Jrd::Global*, const UCHAR**, const Firebird::MetaName*, Firebird::MetaName*); void DYN_define_dimension(Jrd::Global*, const UCHAR**, const Firebird::MetaName*, Firebird::MetaName*); void DYN_define_exception(Jrd::Global*, const UCHAR**); @@ -37,7 +36,6 @@ void DYN_define_global_field(Jrd::Global*, const UCHAR**, const Firebird::MetaNa void DYN_define_index(Jrd::Global*, const UCHAR**, const Firebird::MetaName*, UCHAR, Firebird::MetaName*, Firebird::MetaName*, Firebird::MetaName*, UCHAR*); void DYN_define_local_field(Jrd::Global*, const UCHAR**, const Firebird::MetaName*, Firebird::MetaName*); -//void DYN_define_log_file(Jrd::Global*, const UCHAR**, bool, bool); void DYN_define_parameter(Jrd::Global*, const UCHAR**, Firebird::MetaName*); void DYN_define_procedure(Jrd::Global*, const UCHAR**); void DYN_define_relation(Jrd::Global*, const UCHAR**); diff --git a/src/jrd/dyn_mod.epp b/src/jrd/dyn_mod.epp index d2a75e7b08..b4edfe1495 100644 --- a/src/jrd/dyn_mod.epp +++ b/src/jrd/dyn_mod.epp @@ -85,14 +85,9 @@ const int MAX_CHARS_DOUBLE = 22; /* 15 digits + 2 signs + E + decimal + 3 digit const int MAX_CHARS_FLOAT = 13; /* 7 digits + 2 signs + E + decimal + 2 digit exp */ static const UCHAR alloc_info[] = { isc_info_allocation, isc_info_end }; -//static void drop_cache(Global*); static void change_backup_mode(Global*, UCHAR verb); -//static void drop_log(Global*); -// Function not defined in this file MOD 04-July-2002 -// static void modify_lfield_type(Global*, const UCHAR**, TEXT*, TEXT*); - -static void modify_lfield_position(thread_db*, Database*, Global*, +static void modify_lfield_position(thread_db*, Database*, Global*, const Firebird::MetaName&, const Firebird::MetaName&, USHORT, USHORT); static bool check_view_dependency(thread_db*, Database*, Global*, const Firebird::MetaName&, const Firebird::MetaName&); @@ -273,10 +268,6 @@ void DYN_modify_database( Global* gbl, const UCHAR** ptr) if (!DYN_REQUEST(drq_m_database)) DYN_REQUEST(drq_m_database) = request; -//#ifdef SUPERSERVER -// bool first_log_file = true; -//#endif - MODIFY DBB USING UCHAR verb; while ((verb = *(*ptr)++) != isc_dyn_end) @@ -303,55 +294,12 @@ void DYN_modify_database( Global* gbl, const UCHAR** ptr) DYN_define_difference(gbl, ptr); break; -/* -#ifdef SUPERSERVER - case isc_dyn_def_default_log: - DYN_define_log_file(gbl, ptr, first_log_file, true); - break; - - case isc_dyn_def_log_file: - DYN_define_log_file(gbl, ptr, first_log_file, false); - first_log_file = false; - break; -#endif - - case isc_dyn_def_cache_file: - DYN_define_cache(gbl, ptr); - break; - - case isc_dyn_log_group_commit_wait: - DYN_get_number(ptr); // ignore - break; - - case isc_dyn_log_buffer_size: - DYN_get_number(ptr); // ignore - break; - - case isc_dyn_log_check_point_length: - DYN_get_number(ptr); // ignore - break; - - case isc_dyn_log_num_of_buffers: - DYN_get_number(ptr); // ignore - break; - - case isc_dyn_drop_cache: - drop_cache(gbl); - break; -*/ - case isc_dyn_drop_difference: case isc_dyn_begin_backup: case isc_dyn_end_backup: change_backup_mode(gbl, verb); break; -/* - case isc_dyn_drop_log: - drop_log(gbl); - break; -*/ - case isc_dyn_fld_character_set_name: if (GET_STRING(ptr, DBB.RDB$CHARACTER_SET_NAME)) DBB.RDB$CHARACTER_SET_NAME.NULL = FALSE; @@ -2135,56 +2083,6 @@ void DYN_modify_view( Global* gbl, const UCHAR** ptr) } -/* -static void drop_cache( Global* gbl) -{ -// ************************************** -// * -// * d r o p _ c a c h e -// * -// ************************************** -// * -// * Functional description -// * Drop the database cache -// * -// ************************************** - thread_db* tdbb = JRD_get_thread_data(); - Database* dbb = tdbb->tdbb_database; - - jrd_req* request = CMP_find_request(tdbb, drq_d_cache, DYN_REQUESTS); - bool found = false; - - try { - - FOR(REQUEST_HANDLE request TRANSACTION_HANDLE gbl->gbl_transaction) - X IN RDB$FILES WITH X.RDB$FILE_FLAGS EQ FILE_cache - - ERASE X; - found = true; - - END_FOR; - - if (!DYN_REQUEST(drq_d_cache)) { - DYN_REQUEST(drq_d_cache) = request; - } - - } - catch (const std::exception& ex) { - Firebird::stuff_exception(tdbb->tdbb_status_vector, ex); - DYN_rundown_request(request, drq_d_cache); - DYN_error_punt(true, 63, NULL, NULL, NULL, NULL, NULL); - // msg 63: ERASE RDB$FILE failed - } - - if (!found) - { - DYN_error_punt(false, 149, NULL, NULL, NULL, NULL, NULL); - // msg 149: "Shared cache file not found" - } -} -*/ - - static void change_backup_mode( Global* gbl, UCHAR verb) { /************************************** @@ -2303,54 +2201,6 @@ static void change_backup_mode( Global* gbl, UCHAR verb) } -/* -static void drop_log( Global* gbl) -{ -// ************************************** -// * -// * d r o p _ l o g -// * -// ************************************** -// * -// * Functional description -// * Delete all log files -// * -// ************************************** - thread_db* tdbb = JRD_get_thread_data(); - Database* dbb = tdbb->tdbb_database; - - jrd_req* request = CMP_find_request(tdbb, drq_d_log, DYN_REQUESTS); - bool found = false; - - try { - - FOR(REQUEST_HANDLE request TRANSACTION_HANDLE gbl->gbl_transaction) - X IN RDB$LOG_FILES - - ERASE X; - found = true; - END_FOR; - - if (!DYN_REQUEST(drq_d_log)) - DYN_REQUEST(drq_d_log) = request; - - } - catch (const std::exception& ex) { - Firebird::stuff_exception(tdbb->tdbb_status_vector, ex); - DYN_rundown_request(request, drq_d_log); - DYN_error_punt(true, 153, NULL, NULL, NULL, NULL, NULL); - // msg 153: ERASE RDB$LOG_FILE failed - } - - if (!found) - { - DYN_error_punt(false, 152, NULL, NULL, NULL, NULL, NULL); - // msg 152: "Write ahead log not found" - } -} -*/ - - static void modify_lfield_position(thread_db* tdbb, Database* dbb, Global* gbl, @@ -3078,7 +2928,7 @@ void DYN_modify_sql_field(Global* gbl, DYN_error_punt(false, 96, NULL, NULL, NULL, NULL, NULL); /* msg 96: "Local column not found" */ -/* Update any indicies that exist */ + // Update any indices that exist modify_lfield_index(tdbb, dbb, gbl, *relation_name, orig_fld.dyn_fld_name, orig_fld.dyn_fld_name);