Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@TenzT
Copy link

@TenzT TenzT commented Nov 5, 2024

Each time the function OCI_DirPathConvert is called, dp->nb_cur rows would be converted, sees dirpath.c:1060 --> dirpath.c:39 in function OcilibDirPathSetArray:

// dirpath.c:39-102
static boolean OcilibDirPathSetArray
(
    OCI_DirPath *dp,
    ub4          row_from
)
{
    ...
    for (row = row_from; row < dp->nb_cur; row++)
    {
           .... 
        /* increment number of item set */
        dp->nb_entries++;
    }
.... 

the final numer connverted in a round shall be doubled:

// dirpath_complete.c: 261-279
                while (nb_conv < SIZE_ARRAY)
                {
                    ...
                    /* convert again */

                    state = OCI_DirPathConvert(dp);

                    nb_conv = OCI_DirPathGetAffectedRows(dp);

So resetting dp->nb_cur is needed to ensure that there would be exactly nb_rows being converted in a round:

// dirpath_complete.c: 263-264
  /* reset dp->nb_cur to the number of remaining rows not converted */
  dp->nb_cur = SIZE_ARRAY - nb_conv;

Consequently, it's also needed that resetting dp->nb_cur to dp->nb_rows every time OcilibDirPathReset is called:

// dirpath_complete.c: 985
dp->nb_cur = dp->nb_rows;

I have verified this fixing in production, wish you accept it. ^_^

@vrogier
Copy link
Owner

vrogier commented Nov 5, 2024

Hi,

Thanks for reporting this.

I unfortunately do not accept pull requests as I did not yet put in place Contributor License Agreement (CLA) for OCILIB.

I will investigate and create an issue for it.
And then will commit a fix for v4.7.7 release.

Regards,

Vincent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants