Skip to content
  • Narayanan Iyer's avatar
    [#863] [V70002] Resolve conflicts during merge of GT.M V7.0-002 into YottaDB master · a65c6220
    Narayanan Iyer authored
    Background
    ----------
    * In general, each conflict section is identified by a sequence of `<<<<<<<`, `=======` and `>>>>>>>`
      markers.
    
      The block of code between the `<<<<<<<` and `=======` markers is code that was changed by YottaDB.
    
      The block of code between the `=======` and `>>>>>>>` markers is code that was changed by GT.M.
    
    * There were a few files where the FIS copyright was the only source of conflict. In that case, the
      FIS copyright change was picked and incorporated in the YottaDB version of the file. Those are not
      listed below.
    
    Changes
    -------
    * CMakeLists.txt : Discarded the GT.M changes to the `version` in this file as has been the procedure
      for prior GT.M release merges.
    
      Additionally, `libstub` was added as a target link library for the `gtmsecshr_real` executable in the
      GT.M side. This change was also discarded since `libstub` had long been removed in the YottaDB side.
    
    * LICENSE : Discarded the GT.M changes to this file as has been the procedure for prior GT.M release merges.
    
    * sr_linux/release_name.h : Incorporated just the `GTM_ZVERSION` macro change from the GT.M side.
      Discarded the rest of the GT.M changes.
    
    * sr_port/advancewindow.c : The GT.M change was to maintain `TREF(last_source_column)` in case of a NUMOFLOW
      error code path. This code path was removed in a prior YottaDB commit so the GT.M change was discarded.
    
    * sr_port/bx_boollit.c : There were 2 conflicts.
      - A `#include "toktyp.h"` was added in the GT.M side. This change was incorporated.
      - A new line to maintain `TREF(last_source_column)` in a code block that was removed in a prior YottaDB
        commit so this change was discarded.
    
    * sr_port/cmd.c : There were 3 conflicts.
      - Beautifying the `cmd_index[]` array lines with comments corresponding to the first letter of the alphabet.
        This change was incorporated while retaining the pre-existing difference that the `~` index in YottaDB
        starts at 76 whereas in GT.M it starts at 77 (before GTMTRIG_ONLY or ARLINK_ONLY +1s happen).
      - A local variable definition of `triple *fetch1` was added. This was incorporated into the YottaDB side.
      - Usages of `curr_fetch_trip` were renamed to `(TREF(fetch_control)).curr_fetch_trip`. This change was
        incorporated in the YottaDB side of the conflict and the GT.M side of the conflict was discarded.
    
    * sr_port/common_startup_init.c : There was 1 conflict.
      - A `#include "deferred_events.h"` was added in the GT.M side. This was in the conflict section.
      - Additionally, `xfer_set_handlers_fnptr` was initialized to `xfer_set_handlers`. An addition in the
        GT.M side. This was NOT in the conflict section. This change had the consequence of bloating the
        `$ydb_dist/gtmsecshrdir/gtmsecshr` size and so this was discarded. This was okay to do because the
        `xfer_set_handlers_fnptr` variable was already initialized in `sr_unix/gtm_startup.c` in the YottaDB
        side. Because of discarding this GT.M change, the GT.M change in the previous bullet too was discarded.
    
    * sr_port/comp_init.c : There was 1 conflict.
      - A GBLREF of `curr_fetch_count` was removed in the GT.M side. This change was incorporated into the
        YottaDB side of the conflict and the GT.M side of the conflict was discarded.
    
    * sr_port/create_fatal_error_zshow_dmp.c : There was 1 conflict.
      - The conflict was in the interface of `jobexam_process()`. This function was changed in the YottaDB side
        as part of #482 to pass the zshow codes as the 2nd parameter. But in GT.M V7.0-002, as part of `GTM-F135292`,
        a similar change was done but where the interface passed the zshow codes as the 3rd parameter. Additionally,
        a `NULL` value of the 3rd parameter implied a `zshow "**` in the GT.M side whereas YottaDB side assumed
        a non-NULL value was passed. The GT.M implementation seemed slightly better so chose that for resolving
        the conflict and discarded the YottaDB side of the conflict. The same was done for conflicts in the
        below files too all of which are related to the same $ZJOBEXAM functionality.
        - sr_port/f_zjobexam.c
        - sr_port/op.h
        - sr_port/op_fnzjobexam.c : The GT.M side did a `MV_FORCE_STR(fmt)` whereas the YottaDB side did not do
          a `MV_FORCE_STR(zshowcodes)`. This meant that if one does a `IF $ZJOBEXAM("filename.txt",undef)` where
          `undef` is the name of an undefined local variable, GT.M V7.0-002 would issue a `%GTM-E-UNDEF` error
          whereas YottaDB would not. The GT.M implementation seemed better in that regard and this was one more
          reason why I chose to retain the GT.M side and discard the YottaDB side of the conflict. A test for
          the UNDEF use case is tracked at YottaDB/DB/YDBTest#572 (comment 1806188799).
        - sr_port/jobexam_process.h : The interface of the `jobexam_process()` and `jobexam_dump()` functions were
          changed back to how GT.M had it with the one exception that `jobexam_dump()` still has a `dev_in_use`
          parameter (which was added as part of a prior YottaDB-only fix).
        - sr_port/jobexam_process.c
    
    * sr_port/merrors.msg :  There were various conflicts due to GT.M side reusing UNUSED message slots for new
      error messages. The GT.M changes were incorporated into the YottaDB side of the conflict and the GT.M
      side then discarded.
    
    * sr_port/mumps.hlp : The GT.M changes were picked and the YottaDB side of the conflict was discarded.
      Additionally, new `GT.M` usages were replaced with `YottaDB`. While at this, did the same GT.M -> YottaDB
      change in the following files which had some new GT.M usages (but they did not show up as conflicts).
      - sr_port/gde.hlp
      - sr_port/mupip.hlp
    
    * sr_port/db_auto_upgrade.c : There were 2 conflicts.
      - Conflict 1 was in the `db_auto_upgrade()` function. The GT.M side had added a `case GDSMV70002:` section
        for auto upgrade handling. And modified the `case GDSMV70001:` section. These were incorporated into the
        YottaDB side as follows.
        - GT.M had no auto upgrade operations for the GDSMV70002 case. But in YottaDB, we need to do YottaDB
          r2.00 related auto upgrade operations (to ensure any changes to the db file header that happened in
          YottaDB r1.* releases are done on the database file header that has only seen a GT.M release so far).
          So the `case GDSMV70002:` section was added under the pre-existing `case GDSMV70001:` case.
        - The `break;` before the `case GDSMR200_V70001:` code path was removed and instead GT.M V7.0-002 auto
          upgrade logic was added in this code path along with a `break;`. An `if` check was added to ensure
          `GDSMV70002` does not go through the V7.0-002 auto upgrade logic again as it does not need this.
        - A new `case GDSMR202_V70002:` code path was added before the pre-existing code block where we had
          an `assert(FALSE);`.
        - A `case GDSMVFILLER27:` was removed as this number was used up by `GDSMV70002`.
      - Conflict 2 was in the `v6_db_auto_upgrade()` function.
        - GT.M had added V70002 related auto upgrade logic (`problksplit` handling). This was incorporated
          into the YottaDB side of the conflict.
    
    * sr_port/deferred_events.c : There were 2 conflicts.
      - GT.M side moved a `DBGDFRDEVNT()` call from a 2nd level nested `if` to a 3rd level nested `if`. The
        YottaDB side of the conflict had the call in the 2nd and 3rd level `if`. So removed it from the 2nd
        level `if`. In additional, GT.M had added a `if (!already_ev_handling)` check. Incorporated this
        into the YottaDB side. The GT.M side had `assert(no_event == outofband || (event_type == outofband));`
        still in it which was removed in a prior YottaDB commit and so I ensured this assert stayed removed
        in the YottaDB side.
      - GT.M side removed the `outofband_action()` function altogether (it nixed `sr_port/outofband_action.c`)
        and instead moved its code into the appropriate `case` blocks in the `async_action()` function. I
        suspect this was done in the GT.M side since there was only one caller of `outofband_action()` and
        it was unnecessary. But in YottaDB, this function is called from various other places (particularly
        the Simple API functions e.g. `ydb_get_s.c`) and so having this function is necessary to avoid code
        duplication. Therefore, I discarded the GT.M changes where it moved the outofband_action() handling
        for a specific `case` into `async_action()`. Instead, I kept the logic the same as before (i.e. to
        invoke `outofband_action()` for various `case` blocks in `async_action()`).
    
        Additionally, GT.M had changed the `case sighup:` handling to set the state to `pending` (instead of
        `active`) so incorporated this change.
    
        Also, GT.M had replaced a `case ttwriterr:` block with `case defer_error:` and so incorporated this
        change. And moved some of this logic into `outofband_action.c` where I also
        removed the `case ttwriterr:` handling.
    
        Also added back the prototype of `outofband_action()` in `sr_port/deferred_events_queue.h` like it
        used to be now that this function is added back in the YottaDB side.
    
        Also replaced pre-existing `(*ztimeout_action_ptr)()` usages with `ztimeout_action()` now that the
        former global variable has been removed in GT.M V7.0-002. This in turn required a line addition of
        `#include "ztimeout_routines.h".
    
    * sr_port/dse_dmp_fhead.c : The conflict was due to an empty line being removed in the GT.M side. This was
      resolved by picking the YottaDB side of the conflict.
    
    * sr_port/ex_tail.c : There was 1 conflict.
      - A new line to maintain `TREF(last_source_column)` in a code block that was removed in a prior YottaDB
        commit so this change was discarded.
    
    * sr_port/expritem.c : There was 1 conflict.
      - GT.M side changed the ~ index of the `svn_index[]` array from 100 to 101 to take the new `SV_ZMALLOCLIM`
        into account. The YottaDB side was correspondingly bumped by one from 107 to 108.
    
    * sr_port/f_incr.c : There was 1 conflict.
      - The GT.M change was to add `|| (NULL == TREF(expr_start)` to an `if` check. That check was already added
        in the YottaDB side in a prior commit where we have an additional `||` check too. So the GT.M change was
        discarded.
    
    * sr_port/gbldefs.c : There was 1 conflict.
      - The GT.M change was to remove `gtm_max_storalloc` and introduce 3 new global variables. This was
        incorporated into the YottaDB side of the conflict.
    
    * sr_port/gdsdbver_sp.h : There was 1 conflict.
      - The YottaDB filler enum `GDSMVFILLER27` (in the middle of the enum list) was removed and replaced
        with the GT.M enum `GDSMV70002`. A new enum `GDSMR202_V70002` was introduced (at the end of the
        enum list) to correspond to YottaDB r2.02 which includes `GDSMV70002` (i.e. GT.M V7.0-002).
    
    * sr_port/gtm_env_init.c : There were 4 conflicts.
      - The GT.M change was to add a `#include "getstorage.h"`. This was incorporated.
      - The GT.M change was to add a `tmp_malloc_limit` local variable declaration. This was incorporated.
      - The GT.M change was to add processing for `GTM_MALLOC_LIMIT`. The corresponding YottaDB change was done
        by calling `ydb_trans_numeric_64(YDBENVINDX_MALLOC_LIMIT,...)`. This also involved implementing
        `ydb_trans_numeric_64()` as a copy of `ydb_trans_numeric()` except that it is the 64-bit version.
        For this, a diff of `trans_numeric()` and `trans_numeric_64()` in the GT.M V7.0-002 code was taken and
        this diff retrofitted into `ydb_trans_numeric()` to form `ydb_trans_numeric_64()`. Note that
        `trans_numeric_64()` was first introduced in GT.M V7.0-000 but as part of cb36c541, there was no need
        for it to be merged so it was skipped then. Now that it is needed, the `ydb_trans_numeric_64()`
        equivalent is implemented in the YottaDB side.
      - The GT.M change was to delete an empty line. This was already done in the YottaDB side so the GT.M side
        of the conflict was just discarded.
    
    * sr_port/gtm_malloc_src.h : There were 4 conflicts.
      - The GT.M change was to `#include 2 header files `deferred_events_queue.h` and `deferred_events.h`.
        This was incorporated.
      - The GT.M change was some rework in the `MALLOC` macro. This was picked and the YottaDB side of the
        conflict was discarded with the one exception of changing `gtmSystemMalloc` usage to `ydbSystemMalloc`.
      - The GT.M change was a new `GBLREF` of `retry_if_expansion_fails`. This was incorporated.
      - The GT.M change was removing a `GBLREF` of `gtm_max_storalloc`. The corresponding `ydb_max_storalloc`
        line in the YottaDB side of the conflict was removed.
    
    * sr_port/have_crit.h : There was 1 conflict.
      - The GT.M change was to add a `INTRPT_IN_RTN_CLEANUP` enum. This was incorporated in the YottaDB code
        by adding it before the YottaDB-ONLY interrupt states.
    
    * sr_port/ins_errtriple.c : There was 1 conflict.
      - The GT.M change was to remove an incorrect `WARNING: fallthrough` comment. This was incorporated in
        the YottaDB side of the conflict and the GT.M side of the conflict was then discarded.
    
    * sr_port/iosocket_open.c : There were 3 conflicts.
      - All conflicts were of the same form and were because of a GT.M change to type cast to `unsigned char`
        before type casting to an `int`. This change was done already in a prior commit in YottaDB so the
        GT.M changes were discarded.
    
    * sr_port/jnl.h : There was 1 conflict.
      - The GT.M side added a `SHM_READ_MEMORY_BARRIER` call before an `if` check of the condition
        `((JBP->phase2_commit_index2 == JBP->phase2_commit_index1)`. This condition was at a different place
        in the YottaDB side so the macro call was inserted just before the `if` check in the YottaDB side
        and the GT.M side of the conflict was discarded.
    
    * sr_port/jnl_write_attempt.c : There was 1 conflict.
      - The GT.M side of the conflict was retrofitted into the YottaDB side (while keeping the previous
        difference of `SLEEP_USEC(1, FALSE)` in GT.M vs `SLEEP_USEC(1, TRUE)` in YottaDB intact).
    
    * sr_port/jobinterrupt_process_cleanup.c : There was 1 conflict.
      - The conflict happened because of cosmetic reasons `{ }` inside `if` was unnecessary since it was
        just 1 line. Therefore picked the GT.M side of the conflict and discarded the YottaDB side.
    
    * sr_port/lke_showlock.c : There was 1 conflict.
      - The GT.M changes were to change a `util_out_print()` call to `util_out_print_args()` call And to
        add a `7,` parameter before the `FLUSH,` parameter in the `util_cm_print()` call. In the YottaDB
        side of the code, the `util_out_print()` call had been changed to a `FPRINTF` in a prior commit
        so that GT.M change was not incorporated. But the `util_cm_print()` GT.M change was.
    
    * sr_port/mdef.h : There were 3 conflicts.
      - GT.M change was to add a `#include <stdbool.h>`. This was incorporated in the YottaDB side.
      - GT.M change was to add a `MINNEGINT4` macro definition. This was incorporated in the YottaDB side.
      - GT.M change was to remove a `bool` typedef. This was already done in a prior commit in the YottaDB
        side so the GT.M change was discarded.
    
    * sr_port/mupip_backup.c : There were 2 conflicts.
      - GT.M change was to add a `#include <mdq.h>`. This was incorporated in the YottaDB side.
      - GT.M change was to add a `region_que_entry` local variable declaration. This was incorporated
        in the YottaDB side.
    
    * sr_port/mvalconv.c : There were 2 conflicts.
      - Both conflicts were due to GT.M V7.0-001 adding checks for -MAXPOSINT4 in `mval2i()` function.
        These changes were already done in a prior YottaDB commit. But they used `-MAXPOSINT4` whereas
        the GT.M changes used `MINNEGINT4`. `-MAXPOSINT4` is equal to `0x80000001` when treated as a signed
        4-byte integer whereas `MINNEGINT4` is `0x80000000`. They differ by 1. The `MINNEGINT4` approach
        allows for 1 more negative value in the range. Otherwise both approaches are the same so I chose
        the GT.M approach to avoid future conflicts in this area. So discarded the YottaDB side of both
        the conflicts.
    
    * sr_port/objlabel.h : The GT.M change was to bump OBJ_UNIX_LABEL from 41 to 42. The conflict was resolved
      by bumping the same macro in the YottaDB side from 11 to 13 and discarding the GT.M side of the conflict.
    
    * sr_port/op_add.c : There were 2 conflicts.
      - GT.M change was cosmetic and addition of DCL_THREADGBL_ACCESS/SETUP_THREADGBL_ACCESS. The latter was
        incorporated into the YottaDB side.
      - GT.M change was cosmetic. This was discarded.
    
    * sr_port/op_div.c : There was 1 conflict.
      - GT.M change was to add DCL_THREADGBL_ACCESS/SETUP_THREADGBL_ACCESS and to enhance an `if` check to
        include `0 == v->m[0]` and add an assert about MV_NUM_APPROX before the `if` check. All of these
        were incorporated into the YottaDB side.
    
    * sr_port/op_fnj3.c : There was 1 conflict.
      - GT.M change was to modify `RTS_ERROR_ABT(...)` calls to `RTS_ERROR_CSA_ABT(NULL, ...)` calls. This
        was incorporated into the YottaDB side in 3 places (YottaDB side had 1 more error code path than
        the GT.M side).
    
    * sr_port/op_fnquery.c : There were 4 conflicts.
      - All those changes were related to adding a `ERR_MAXSTRLEN` error code path in the GT.M side. This
        was already done in the YottaDB side and is a better change in my understanding. See discussion
        at YottaDB/DB/YDBTest#577 (comment 1775232772) for more details.
        So all the GT.M side of the conflicts were discarded.
    
    * sr_port/op_fnview.c : There was 1 conflict.
      - GT.M changes in the `case VTK_YCOLLATE:` just before the conflict simplified the logic needed inside
        the conflict so the YottaDB side of the conflict (which was needed before GT.M V7.0-002) is no longer
        needed and so was removed and the GT.M side of the conflict incorporated.
    
    * sr_port/op_fnzpopulation.c : There was 1 conflict.
      - GT.M changed a `if (arg2->str.len)` to `if (0 < arg2->str.len)`. But such logic no longer exists in
        the YottaDB side of the code (it already handled things in a more elaborate fashion) so the GT.M side
        of the conflict was discarded.
    
    * sr_port/op_idiv.c : There was 1 conflict.
      - GT.M change was to add DCL_THREADGBL_ACCESS/SETUP_THREADGBL_ACCESS and to enhance an `if` check to
        include `0 == v->m[0]` and add an assert about MV_NUM_APPROX before the `if` check. And to replace
        a `RTS_ERROR_ABT(...)` call with `RTS_ERROR_CSA_ABT(NULL, ...)`. All of these were incorporated
        into the YottaDB side.
    
    * sr_port/op_mul.c : There was 1 conflict.
      - GT.M change was to add DCL_THREADGBL_ACCESS/SETUP_THREADGBL_ACCESS. This was incorporated.
    
    * sr_port/op_svget.c : There were 3 conflicts.
      - GT.M change was to add a GBLREF of `zmalloclim`. This was incorporated.
      - GT.M change was to rearrange local variable declarations and add a `director_token` variable. This
        was incorporated.
      - GT.M change was to add `director_token` related save/restore logic around a `s2n()` call for `NUMOFLOW`
        processing. This was incorporated.
    
    * sr_port/op_svput.c : There were 4 conflicts.
      - GT.M change was to add `#include` of 3 header files. This was incorporated.
      - GT.M change was to add a `int` type variable named `tmp`. But in the YottaDB side, there was a `char *`
        typed variable of the same name. So the YottaDB side variable was renamed as `tmpPtr` (the GT.M side
        variable name was kept intact to keep conflicts with future GT.M changes to a minimum).
      - GT.M change was to add a comment in the `case SV_ZMAXTPTIME` code block that negative value are
        equivalent to no timeout. But this comment was already implemented in the YottaDB side in a prior
        commit and so the GT.M change was discarded.
      - GT.M change was to move a `TREF(dollar_ztrap)).str = v->str` line from after to before a call to
        `gtm_newintrinsic()` (to presumably fix GTM-F135433). But this was already fixed by YottaDB as part
        of #520. And so the GT.M side of the change was discarded.
    
    * sr_port/op_unwind.c : There was 1 conflict.
      - GT.M change was to add a `#include "try_event_pop.h"`. This was incorporated.
    
    * sr_port/op_zg1.c : There was 1 conflict.
      - GT.M change was to add a `unwlevels = curlvl - level;` line. This was incorporated.
    
    * sr_port_cm/gtcmtr_initproc.c : There was 1 conflict.
      - GT.M changed the return type from `bool` to `char`. The YottaDB side had already changed this to a
        `cm_op_t` return type in a prior commit. And this is a better change. So discarded the GT.M change.
    
    * sr_port_cm/gtcmtr_lkacquire.c : There was 1 conflict.
      - GT.M changed the return type from `bool` to `char`. The YottaDB side had already changed this to a
        `cm_op_t` return type in a prior commit. And this is a better change. So discarded the GT.M change.
    
    * sr_port_cm/gtcmtr_lkreqimmed.c : There was 1 conflict.
      - GT.M changed the return type from `bool` to `char`. The YottaDB side had already changed this to a
        `cm_op_t` return type in a prior commit. And this is a better change. So discarded the GT.M change.
    
    * sr_port_cm/gtcmtr_lkrequest.c : There was 1 conflict.
      - GT.M changed the return type from `bool` to `char`. The YottaDB side had already changed this to a
        `cm_op_t` return type in a prior commit. And this is a better change. So discarded the GT.M change.
    
    * sr_port_cm/gtcmtr_lkresume.c : There was 1 conflict.
      - GT.M changed the return type from `bool` to `char`. The YottaDB side had already changed this to a
        `cm_op_t` return type in a prior commit. And this is a better change. So discarded the GT.M change.
    
    * sr_port_cm/gtcmtr_protos.h : There was 1 conflict.
      - GT.M changed the return type from `bool` to `char`. The YottaDB side had already changed this to a
        `cm_op_t` return type in a prior commit. And this is a better change. So discarded the GT.M change.
    
    * sr_port_cm/gtcmtr_terminate.c : There was 1 conflict.
      - GT.M changed the return type from `bool` to `char`. The YottaDB side had already changed this to a
        `cm_op_t` return type in a prior commit. And this is a better change. So discarded the GT.M change.
    
    * sr_port/op_zshow.c : There was 1 conflict.
      - GT.M added 4 lines of local variable declarations. Those were incorporated into the YottaDB side.
    
    * sr_port/outofband.h : There was 1 conflict.
      - GT.M changed a `tt_write_error_set` line to a `defer_error_set` line. This was incorporated into
        the YottaDB side.
    
    * sr_port/patstr.c : There was 1 conflict.
      - GT.M rearranged a lot of local variable declarations. The reason there was a conflict was that the
        YottaDB side had removed a `altactive = 0` initialization in a prior commit. But GT.M V7.0-002 made
        that change too. So the conflict was resolved by just picking the GT.M side and discarding the
        YottaDB side.
    
    * sr_port/s2n.c : There was 1 conflict.
      - GT.M added a `u->mvtype |= MV_NUM_APPROX` line. This was incorporated into the YottaDB side.
    
    * sr_port/stack_frame.h : There was 1 conflict.
      - GT.M changed the `dollar_test` variable type from `bool` to a `signed char`. YottaDB had already
        changed it to a `char` in a prior commit. A `char` is the same as a `signed char` but to avoid
        conflicts with future GT.M merges, I picked the GT.M change (over the YottaDB change).
    
    * sr_port/stp_expand_array.c : There were 2 conflicts.
      - GT.M added a declaration for `retry_if_expansion_fails`. This was incorporated.
      - GT.M added an initialization for `retry_if_expansion_fails`. This was incorporated.
    
    * sr_port/stx_error.c : There was 1 conflict.
      - GT.M changed the initialization of `TREF(source_error_found)` from `TRUE` to `(int4)in_error. This
        was incorporated.
    
    * sr_port/svnames.h : There was 1 conflict.
      - GT.M added a `SV_ZMALLOCLIM` enum. This was incorporated and pre-existing YottaDB-only enums
        were rearranged to be after this so all YottaDB-only enums start after all GT.M-only enums.
    
    * sr_port/t_qread.c : There was 1 conflict.
      - GT.M simplified an `if` check to use the `WBTEST_ENABLED` macro. The YottaDB side used `ydb_*`
        global variables while the GT.M side used `gtm_*` variables previously. The macro is defined
        in the YottaDB side to use `ydb_*` variables so the macro change works even for YottaDB and so
        the GT.M change was picked and the YottaDB side of the conflict was discarded.
    
    * sr_port/tp_timeout.c : There was 1 conflict.
      - GT.M side was a cosmetic change (to remove parens around `ETRAP_IN_EFFECT` macro). This was
        incorporated into the YottaDB side.
    
    * sr_port/unary_tail.c : There was 1 conflict.
      - GT.M added a line to maintain `TREF(last_source_column)` in case of a NUMOFLOW error code path.
        This was incorporated into the YottaDB side.
    
    * sr_port/unw_retarg.c : There was 1 conflict.
      - GT.M change was to add a `#include "try_event_pop.h"`. This was incorporated.
    
    * sr_port/view_arg_convert.c : There were 4 conflicts.
      - GT.M added a `len` variable declaration. This was incorporated.
      - GT.M added a `ERR_VIEWARGTOOLONG` error code path. I did not think the YottaDB side needed it since
        it had already handled all of this as part of 8f2bf319 so discarded the GT.M side of the conflict.
      - GT.M added a `/* Nothing beyond the "+/-" */` comment. This was incorporated. It also added a
        `if (NULL == src)` code block that issued a `ERR_VIEWGVN` error. But this was already handled by a
        prior YottaDB commit 8f2bf319 so I discarded this GT.M change.
      - GT.M changed a big code block that has been long removed in the YottaDB side so I discarded the
        GT.M side of the conflict.
    
    * sr_port/wbox_test_init.h : There was 1 conflict.
      - GT.M added a `WBTEST_RTNOBJ_INTEG` white box case. This was incorporated.
    
    * sr_port/zshow.h : There was 1 conflict.
      - GT.M removed a `#ifdef UNIX` for the `ZSHOW_ALL` macro. This was incorporated but the value of the
        macro (which differs in the YottaDB side) was retained to be the YottaDB one. GT.M added a
        `ZSHOW_ALL_ITEMS` macro definition. This was incorporated as well.
    
    * sr_port/zshow_output.c : There were 2 conflicts.
      - GT.M added a `NULL !=` check on `piecestr` after it was set to be the return value of `STRTOK_R`.
        This change was already done in the YottaDB side in a prior commit so the GT.M change was discarded.
        Additionally, GT.M added a `inline` to a comment that now reads `WARNING inline assignment in test`.
        Incorporating this would cause a line to go more than 132 columns and I did not think it worth it
        so discarded this change as well.
      - GT.M added a `NULL !=` check on `piecestr` after it was set to be the return value of `STRTOK_R`.
        This change was already done in the YottaDB side in a prior commit so the GT.M change was discarded.
    
    * sr_port/zshow_svn.c : There was 1 conflict.
      - GT.M added a `zmalloclim` GBLREF. This was incorproated.
    
    * sr_unix/configure.gtc : There were 2 conflicts.
      - GT.M added a `remove_deprecated=1` line after a `chgrp` command. This was incorporated.
      - GT.M added a `Remove deprecated files first if applicable` section. This was incorporated into the
        YottaDB side.
    
    * sr_unix/ctrap_set.c : There was 1 conflict.
      - GT.M changed a `(ctrap != outofband)` check to a `(((CTRLC == ob_char) ? ctrap : sighup) != outofband)`
        check. This was incorporated.
    
    * sr_unix/dm_read.c : There was 1 conflict.
      - GT.M changed code inside an `if` code block that checked for `REC` or `RECALL`. But that block had been
        removed in the YottaDB side by a prior commit. So discarded the GT.M change.
    
    * sr_unix/do_verify.c : There was 1 conflict.
      - GT.M added an `assert(NULL != csp);`. This was incorporated.
    
    * sr_unix/gtm_confstr.c : There were 2 conflicts.
      - GT.M changed the type of `tok_len` and `cmdlen` variables from `unsigned int` to `size_t`. This was
        incorporated.
      - GT.M reworked logic that dealt with `cmdlen` variable. The reason for the conflict was that the
        YottaDB side had changed a `path_tok != NULL` to `NULL != path_tok` (as this is the convention in
        the code base) in a prior commit. To reduce future such conflicts, I discarded the YottaDB side of
        the conflict and picked the GT.M side even if it meant not going with the convention.
    
    * sr_unix/gtm_getmsg.c : There were 2 conflicts.
      - GT.M changed the type of `m_len`, `faclen` and `taglen` variables from `short int` to `size_t` and
        removed the `j` and `sever` variables. This change was incorporated.
      - GT.M changed a `cp += top - cp;` line to `cp += cp_len;`. This was already in the YottaDB side.
        GT.M changed a `msgbuf->len = m_len;` to `msgbuf->len = (int)m_len;`. This was incorporated.
        GT.M changed a `*cp++ = 0;` to a `*cp = 0;` and added a comment and assert before that. This was
        incorporated as well.
    
    * sr_unix/gtm_putmsg_list.c : There was 1 conflict.
      - GT.M changed a `msg_buffer[1024]` declaration to `msg_buffer[PUT_BUFF_SIZE]`. This was incorporated.
    
    * sr_unix/gtm_text_alloc.c : There were 2 conflicts.
      - GT.M removed a `gtm_max_storalloc` GBLREF. The corresponding `ydb_max_storalloc` GBLREF was removed
        from the YottaDB side.
      - GT.M reworked the `TEXT_ALLOC` macro definition. The conflict in the YottaDB side was due to
        `gtm_max_storalloc` vs `ydb_max_storalloc` usages. These usages were anyways being removed by the
        GT.M rework so discarded the YottaDB side of the conflict and picked the GT.M side.
    
    * sr_unix/gtmsecshr.c : There was 1 conflict.
      - GT.M enhanced an assert involving `GTMSECSHR_MESG_TIMEOUT` by adding a `||` condition. But this assert
        was removed in the YottaDB side in a prior commit. So I discarded the GT.M change.
    
    * sr_unix/gtmsource_get_opt.c : There was 1 conflict.
      - GT.M added a `NULL !=` check for the `connect_parm` variable after a `STRTOK_R` call. This change was
        already done in the YottaDB side so the GT.M change was discarded.
    
    * sr_unix/init_gtm.c : There were 2 conflicts.
      - GT.M removed a `#include "ztimeout_routines.h"` line. This was incorporated.
      - GT.M removed `GBLDEF` of 2 variables `ztimeout_action_ptr` and `ztimeout_clear_ptr`. This was
        incorporated.
    
    * sr_unix/iopi_open.c : There was 1 conflict.
      - GT.M change was to just move an entire `case` code block to the left by one tab. Cosmetic.
        This was therefore discarded and the YottaDB side of the conflict kept as is.
    
    * sr_unix/iosocket_pass_local.c : There were 2 conflicts.
      - GT.M changed a `if (-1 != pid)` to `if (-1 < pid)`. This was incorporated.
      - GT.M changed a `if (-1 != pid)` to `if (-1 < pid)`. This was incorporated.
    
    * sr_unix/iott_rdone.c : There was 1 conflict.
      - GT.M changed a lot of local variable declaration lines. The conflict with the YottaDB side was
        due to 2 things. A `int utf8_seen;` line and a `DCL_THREADGBL_ACCESS;` line. So the GT.M side
        of the conflict was picked and these 2 pre-existing YottaDB-only lines were added on top.
    
    * sr_unix/iott_readfl.c : There were 4 conflicts.
      - GT.M had moved a lot of GBLREF lines a few lines above. But YottaDB side had added a few GBLREFs
        of 2 variables `KEY_HOME` and `KEY_END` in those moved lines. The GT.M side of the conflict was
        picked and these 2 YottaDB-only GBLREFs were later added on top.
      - GT.M had rearranged a lot of local variable declarations in the `iott_readfl()` function. The conflict
        was due to the YottaDB side removing the variables `current_32_ptr`, `current_ptr` and adding a
        `utf8_seen` variable declaration. Therefore, the GT.M side of the conflict was chosen and the
        `utf8_seen` variable declaration was added on top.
      - GT.M removed the variable declarations for `keypad_len`, `backspace`, `delete`, `up`, `down`, `right`,
        `left`, `insert_key`, `escape_edit` and `empterm`. These change were incorporated into the YottaDB
        side.
      - GT.M removed a `ch_set` variable declaration and added 4 lines corresponding to declarations for
        variables `inchar`, `current_32_ptr`, `buffer_32_start`, `switch_char` and `asc_inchar`. These
        changes were incorporated except for `current_32_ptr`. The `current_32_ptr` and `current_ptr`
        declarations were removed from the YottaDB side like it was previously (see 2 bullets above).
    
    * sr_unix/ious_open.c : There were 2 conflicts.
      - GT.M added a `Open a device belonging to the user defined nmemonicspace` comment. This was incorporated.
      - GT.M added a comment before a call to `io_get_fgn_driver()`. This call had been removed in a prior
        YottaDB commit so the GT.M change was discarded. GT.M had also added a check for `NULL == disp` before
        checking `disp->open`. This code too had been removed in a prior YottaDB commit so this GT.M change too
        was discarded.
    
    * sr_unix/mu_getlst.c : There were 3 conflicts.
      - GT.M had swapped the order of `fbuff` and `rbuff` variable declarations. This was incorporated even
        though it is a cosmetic change.
      - GT.M moved the comment for a line that invoked the `TOUPPER` macro to before the line. This was a
        cosmetic change so discarded this and preserved the YottaDB side of the conflict (which used the
        `RBUFF_ARRAY_SIZE` macro instead of `ARRAYSIZE`).
      - GT.M moved the comment for a line that invoked the `TOUPPER` macro to before the line. This was a
        cosmetic change so discarded this and preserved the YottaDB side of the conflict (which used the
        `RBUFF_ARRAY_SIZE` macro instead of `ARRAYSIZE`).
    
    * sr_unix/mu_op_open.c : There was 1 conflict.
      - GT.M added a `(int)(unsigned char)` type cast to logic that had been replaced by a much
        better `UPDATE_P_OFFSET` macro call in the YottaDB side in a prior commit. Therefore I
        discarded the GT.M change.
    
    * sr_unix/mu_rndwn_file.c : There were 2 conflicts.
      - GT.M did some cosmetic changes to a comment block. This comment was removed in the YottaDB
        side in a prior commit so discarded the GT.M changes.
      - GT.M added comments before a code block that invoked `INCR_PHASE2_COMMIT_INDEX`. But this code
        had already been removed in the YottaDB side in a prior commit so discarded the GT.M changes.
        While at this, noticed that the `UPDATE_JBP_RSRV_FREEADDR` macro (which is what is invoked in
        the YottaDB side) had a comment mentioning `previous update process`. Fixed this to instead be
        `a process updating the db`.
    
    * sr_unix/mupip_set_file.c : There was 1 conflict.
      - GT.M added declarations for local variables `problksplit_status` and `new_problksplit`. This
        change was incorporated.
    
    * sr_unix/op_fnzsyslog.c : There was 1 conflict.
      - GT.M changed 2 `util_out_print()` calls to `util_out_print_args()`. But this code had already
        been changed in a prior commit to invoke a `util_out_send_oper()` in the YottaDB side. Therefore
        discarded the GT.M changes.
    
    * sr_unix/peekbyname.mpt : There was 1 conflict.
      - GT.M added handling for `_Bool` type. YottaDB had already added this handling in a prior commit.
        Therefore I discarded the GT.M change.
    
    * sr_unix/repl_instance.h : There was 1 conflict.
      - GT.M added a `(unsigned int)` type cast to `trans_name.len` parameter in a `get_full_path()` call.
        This change was incorporated.
    
    * sr_unix/secshr_client.c : There was 1 conflict.
      - GT.M changed an assert involving `CLIENT_ACK_TIMER`. But this assert had been removed in the
        YottaDB side in a prior commit so discarded the GT.M change.
    
    * sr_unix/send_msg.c : There was 1 conflict.
      - GT.M changed a `msg_buffer[1024]` declaration to `msg_buffer[PUT_BUFF_SIZE]`. This was incorporated.
    
    * sr_unix/trigger_parse.c : There were 2 conflicts.
      - GT.M replaced a `do/while` loop with a `while` loop. But the YottaDB side had already been changed
        so the `do/while` loop (which is slightly faster than a while loop because of the lack of any
        checks in the first iteration of the loop) is accurate. It also had asserts to verify the correcntess
        of not doing any `NULL != ptr` check in the first iteration of the `do/while` loop. Therefore discarded
        the GT.M changes in both the conflicts.
    
    * sr_unix/trigger_update.c : There were 3 conflicts.
      - All of them had the GT.M changes discarded for the same reasons as noted for `sr_unix/trigger_parse.c`.
    
    * sr_unix/trigger_upgrade.c : There were 2 conflicts.
      - GT.M had added `assert(0 <= tmpint4);` in 2 places and `assert(0 <= currlabel);` in 1 place. All of
        these were incorproated onto the YottaDB side.
      - GT.M had added `assert(0 <= seq_num);` and `assert(0 < tncount);` in 1 place each. Both these were
        incorporated onto the YottaDB side.
    
    * sr_unix/util_out_print_gtmio.c : There was 1 conflict.
      - GT.M added a `WARNING: UNCHECKED faocnt - internal use only` comment after a `util_out_print_vaparm()`
        call in `util_out_print_gtmio()`. This was incorporated.
    
    * sr_unix/util_output.c : There was 1 conflict.
      - GT.M had added a `default:` code path in a switch/case block. YottaDB had done something
        similar in a prior commit 8c9bac3e but it had set `length` to `MAXINT4` and had added
        an `if` check for this special length. Whereas the GT.M changes set `length` to 0 and also
        set `c` to NULL. The GT.M changes did not require adding a special `if` and so I chose the
        GT.M changes and discarded the 8c9bac3e YottaDB change.
    
    * sr_unix/zl_cmd_qlf.c : There was 1 conflict.
      - GT.M replaced 2 asserts `assert(0 != pblk.l_name);` and `assert(MAX_FN_LEN >= pblk.b_name);` with
        4 asserts and a comment. This change was incorporated into the YottaDB side in the corresponding
        location where those same 2 asserts (that were replaced in the GT.M side) were in use.
    
    * sr_unix/ztimeout_routines.c : There were 6 conflicts.
      - GT.M added a `#ifdef DEBUG_DEFERRED_EVENT` block with some `#include` files. This was incorporated.
      - GT.M added a `%d` argument that displayed `gtm_white_box_test_case_number` in a `DBGFPF` call.
        This was incorporated with a change to use `ydb_white_box_test_case_number` instead.
      - GT.M removed unnecessary `()` around `ETRAP_IN_EFFECT`. Cosmetic change. This was incorporated.
      - GT.M removed `((0 < dollar_ecode.index) && (ETRAP_IN_EFFECT))` as a parameter being displayed in
        the `DBGDFRDEVNT` macro call. It replaced it with just `ETRAP_IN_EFFECT`. But it changed the
        corresponding format string from `trap: %d` to `dec_indx %d, et: %d`. It therefore forgot to
        add a `dollar_ecode.index` as a parameter for the format string. I incorporated that fix into
        the YottaDB side. Additionally, GT.M added a `#ifdef DEBUG_DEFERRED_EVENT` logic to do a
        `namelook()` and `op_zwritesvn()`. This was incorporated. Finally, GT.M added a `%d` argument
        that displayed `gtm_white_box_test_case_number` in a `DBGFPF` call.  This was incorporated with
        a change to use `ydb_white_box_test_case_number` instead.
      - GT.M added a `%d` argument that displayed `gtm_white_box_test_case_number` in a `DBGFPF` call.
        This was incorporated with a change to use `ydb_white_box_test_case_number` instead.
    
    * sr_x86_64/op_fnzextract.s : There was 1 conflict.
      - GT.M added a check for if right index < 0. But a better check than this (that the right index is
        less than the left index) was added in the YottaDB side already in a prior commit (dc052f71).
        Therefore the GT.M change was discarded.
    
    Misc changes after all conflicts were resolved
    ----------------------------------------------
    * The following generated files were automatically updated (using the pre-commit hook) to be in sync
      with the GT.M changes to sr_port/merrors.msg.
      - sr_port/libydberrors.h
      - sr_port/merrors_ansi.h
      - sr_port/merrors_ctl.c
      - sr_port/ydbmerrors.h
    
    * The following generated files were automatically updated (using the pre-commit hook) to be in sync
      with the GT.M changes to sr_unix/ttt.txt. Note that even though GT.M V7.0-002 did change ttt.txt,
      it did change ttt.c too and the very first V7.0-002 merge commit was with conflicts so did not use
      the pre-commit hook which meant that to fix the ttt.c conflict, I regenerated it on the YottaDB side
      faking a cosmetic change to ttt.txt.
      - sr_aarch64/ttt.c
      - sr_armv7l/ttt.c
      - sr_x86_64/ttt.c
    
    * Temporarily restored the following files to pre-merge copies to let the build go fine. These will be
      replaced with the correct versions in a later V70002 commit when they are auto-generated (which
      will be after all tests run fine).
      - sr_x86_64/GTMDefinedTypesInitDebug.m
      - sr_x86_64/GTMDefinedTypesInitRelease.m
    
    Misc fixes to get clean build
    -----------------------------
    All changes described below were done in sections of the code where there were no conflict.
    
    * sr_port/cmd.c : There were YottaDB-only sections of the code where there was no conflict but usages of
      `curr_fetch_trip` existed. Those failed the build and were fixed to instead use
      `(TREF(fetch_control)).curr_fetch_trip` as this was a change in GT.M V7.0-002.
    
    * sr_port/deferred_events.c : A build warning showed up because `dummy` was uninitialized when passed to
      the function `xfer_set_handlers()`. This was fixed by setting it to `0`.
    
    * sr_port/gbldefs.c : The `GBLDEF` of `xfer_set_handlers_fnptr` had the wrong prototype. It had an extra
      `callback` parameter when it should not have had it. This was removed.
    
      This extra parameter was used to pass `deferred_signal_set_fnptr` in the `SET_FORCED_EXIT_STATE` macro
      in `sr_port/have_crit.h`. But now that the extra parameter is no longer passed, there was no need for
      `deferred_signal_set_fnptr` either so a `GBLDEF` of this variable was removed.
    
      Similar changes as the above were done in the following files as well.
      - sr_port/have_crit.h
      - sr_unix/gtm_startup.c
    
    * sr_port/mu_getlst.h : The prototype of a `static` function `usr_reg_que_checkdup()` was declared in this
      header file but only used in `sr_port/mu_getlst.c`. And this caused `gcc` to issue a `[-Wunused-function]`
      warning whenever a .c file that includes `mu_getlst.h` was compiled. This was addressed by moving the
      static function prototype to `sr_port/mu_getlst.c` as that is the only file where the function is used.
    
    * sr_port/updhelper_init.c : A call to `gvcst_init()` was added in the GT.M side. But this had 2 parameters
      where the 2nd parameter was NULL. The YottaDB side does not have the 2nd parameter (and so caused a
      build failure) so the 2nd parameter was removed.
    
    * sr_unix/gtm_text_alloc.c : A `gtmSystemMalloc` usage was added in the GT.M side. This was fixed to be
      `ydbSystemMalloc` instead.
    
    * sr_unix/rtnobj.c : Usages of `gtm_autorelink_ctlmax` were replaced with `ydb_autorelink_ctlmax`.
    a65c6220
This project is licensed under the GNU Affero General Public License v3.0. Learn more
Loading