Perl-Dist-Strawberry icon indicating copy to clipboard operation
Perl-Dist-Strawberry copied to clipboard

perl 5.40.1 build: Possibly DBD::Oracle test t/rt85886.t will fail

Open twata1 opened this issue 8 months ago • 19 comments

Hello,

I split my issue with #231 .

Sample fail report: http://www.cpantesters.org/cpan/report/ce9b4119-71da-1014-bef1-a252d96454ce

That test passes in perl 5.40.0 build .

Related to: Failed test rt85886.t after DBI update #182

Thank you,

twata1 avatar Mar 29 '25 10:03 twata1

It would be good to know if this were due to Strawberry Perl or Perl itself. My assumption is the latter but I could be wrong.

Currently the only test runs on CPAN Testers are for Windows. The rest are NAs due to missing Oracle libs.

shawnlaffan avatar Mar 30 '25 01:03 shawnlaffan

The same failure occurs for Perl 5.41.7 built using Visual Studio. That would suggest it is a Perl or DBD::Oracle problem.
https://www.cpantesters.org/cpan/report/26dac408-71e1-1014-8029-bc8b03dff4e4

shawnlaffan avatar Mar 30 '25 01:03 shawnlaffan

I don't have Oracle either, but it It looks to me that fetchall_arrayref() must be returning the string '1', and that perl is correctly identifying it as such. I'm thinking it's a problem with DBI and/or DBD::Oracle.

@twata, have you tried installing DBI from the https://github.com/perl5-dbi/dbi repo ? What version of DBI is your Strawberry-5.40.1 using ?

sisyphus avatar Mar 30 '25 03:03 sisyphus

@sisyphus @twata, have you tried installing DBI from the https://github.com/perl5-dbi/dbi repo ? No.

What version of DBI is your Strawberry-5.40.1 using ? DBI version 1.647. It has been bundled with Strawberry-5.40.1 (strawberry-perl-5.40.1.1-64bit-portable-(dev_5401_20250124_gcc13)) from the beginning.

@shawnlaffan @sisyphus It would be helpful if you could also refer to https://github.com/perl5-dbi/DBD-Oracle/issues/182 .

Thank you,

twata1 avatar Mar 30 '25 04:03 twata1

DBI version 1.647. It has been bundled with Strawberry-5.40.1

Aaah, ok. I don't have that devel version. (Waiting for an official release.).

First thing I would try is the github version of DBI - and keep using it if all DBD::Oracle tests pass.

Otherwise .... is there any version of DBI that will work ok with DBD::Oracle on your SP-5.40.1 ? (1.646 looks a likely one, to me.) If you could establish the latest version of DBI that will work with DBD::Oracle, then Shawn might agree to wind back to that version. But only you can tell us what that version is.

sisyphus avatar Mar 30 '25 07:03 sisyphus

Otherwise .... is there any version of DBI that will work ok with DBD::Oracle on your SP-5.40.1 ? (1.646 looks a likely one, to me.) DBI version 1.645. The build log is attached. build-DBD-Oracle-1.90-with-DBI-1.645.log

I could not build DBI version 1.646 on SP-5.40.1. (See Also. http://fast-matrix.cpantesters.org/?dist=DBI%201.646)

Thank you,

twata1 avatar Mar 30 '25 09:03 twata1

I could not build DBI version 1.646 on SP-5.40.1.

It turns out that I could not build it either, on perl-5.40.0.

However, the github source (which reports itself as 1.648) is building without issue for me. I gather that @Tux is the current maintainer. If we could tell him that the github source is working fine with DBD-Oracle-1.90 on WIndows, then he might be prepared to submit it as a new release to CPAN.

In case you're not really set up to obtain that github source, I will email you a tarball of it as soon as I've finished writing this post.. Maybe you could try building your DBD::Oracle against it, and see how that goes.

sisyphus avatar Mar 30 '25 12:03 sisyphus

@sisyphus I tried git clone from the repository and tested it, but the test did not PASS cleanly. build-DBI-from-git-repositry.log

Relevant part of log:


(snip)

Files=200, Tests=8233, 199 wallclock secs ( 2.02 usr +  0.52 sys =  2.53 CPU)
Result: PASS
'env' is not recognized as an internal or external command,
operable program or batch file.
gmake: [makefile:1414: test] Error 1 (ignored)

C:\home\boxmandev001\dbi>

It is not clear whether the DBD::Oracle test can continue in this state.

twata1 avatar Mar 30 '25 13:03 twata1

Now I will try to test tarball which @sisyphus emailed me.

twata1 avatar Mar 30 '25 13:03 twata1

@sisyphus Thank you for sending me the tarball by email.

Unfortunately, the situation did not change. build logs are attached.

build-DBI-1.648(not-cpan-released).log build-DBD-Oracle-1.90-with-DBI-1.648(not-cpan-released).log

Thank you,

twata1 avatar Mar 30 '25 14:03 twata1

The log files show all tests to be passing. There are some compilation warnings and a slew of uninitialised warnings from Text::Balanced but I cannot see anything that indicates that either DBI or DBI::Oracle do not work for those versions.

shawnlaffan avatar Mar 30 '25 21:03 shawnlaffan

.... I cannot see anything that indicates that either DBI or DBI::Oracle do not work for those versions.

There's no apparent problem with DBI-1.645 (or earlier) and DBD-Oracle-1.90. But DBI-1.646 is unbuildable (out of the box) and, according to the logs that @twata1 has provided, anything later than 1.646 (including current github version) results in DBD-Oracle-1.90 failing that one test in t/rt85886.t.

At least, that's how it appears to me.

sisyphus avatar Mar 30 '25 23:03 sisyphus

.... I cannot see anything that indicates that either DBI or DBI::Oracle do not work for those versions.

There's no apparent problem with DBI-1.645 (or earlier) and DBD-Oracle-1.90. But DBI-1.646 is unbuildable (out of the box) and, according to the logs that @twata1 has provided, anything later than 1.646 (including current github version) results in DBD-Oracle-1.90 failing that one test in t/rt85886.t.

At least, that's how it appears to me.

Thanks Rob. Not sure what I was looking at earlier.

I'm still not convinced it's a Strawberry Perl specific problem, though, given the same failure manifests with a Visual Studio build of Perl 5.41.7 (https://www.cpantesters.org/cpan/report/26dac408-71e1-1014-8029-bc8b03dff4e4).

shawnlaffan avatar Mar 31 '25 03:03 shawnlaffan

I'm still not convinced it's a Strawberry Perl specific problem, though,

Oh, I'm almost certain it's a bug in the relationship between DBI and DBD::Oracle - ie something that needs to be fixed in the DBI source and/or the DBD::Oracle source. Perhaps it could also be a bug in Oracle ... I dunno 'bout that. I think the only decision for you to make is whether SP should ship with DBI-1.647 (knowing that this will cause DBD-Oracle-1.90 to fail a test) or should it ship with DBI-1.645 (which will allow DBD-Oracle-1.90 to build cleanly).

I don't know how significant that failure is, but if perl is receiving a PV when it should be receiving an IV then I can imagine that this might be cause for concern. (It would bother me.)

sisyphus avatar Mar 31 '25 05:03 sisyphus

Thanks Rob. If there are no changes to DBI or DBI::Oracle in the meantime then we can keep DBI at 1.645.

shawnlaffan avatar Mar 31 '25 22:03 shawnlaffan

Summary: the DBD::Oracle test tests on a version that was "static" in DBI from some ancient SVN version and that was only confusing and very very wrong I did suggest a change to the DBD::Oracle test. Easiest workaround for strawberry is to use DBI-1.646 and remove the ifdef from DBD::Oracle in a local patch, as that is only for backward compat

diff --git a/dbdimp.c b/dbdimp.c
index 06ade41..5deb331 100644
--- a/dbdimp.c
+++ b/dbdimp.c
@@ -766,7 +766,6 @@ int dbd_st_bind_col(SV *sth, imp_sth_t *imp_sth, SV *col, SV *ref, IV type, SV *
         imp_sth->fbh[field-1].bind_flags = 0; /* default to none */
     }

-#if DBIXS_REVISION >= 13590
        /* DBIXS 13590 added StrictlyTyped and DiscardString attributes */
        if (attribs) {
                HV *attr_hash;
@@ -790,7 +789,6 @@ int dbd_st_bind_col(SV *sth, imp_sth_t *imp_sth, SV *col, SV *ref, IV type, SV *
                        imp_sth->fbh[field-1].bind_flags |= DBIstcf_DISCARD_STRING;
                }
        }
-#endif  /* DBIXS_REVISION >= 13590 */
        return 1;
 }

diff --git a/oci8.c b/oci8.c
index b01dbe9..7c2f82c 100644
--- a/oci8.c
+++ b/oci8.c
@@ -4189,7 +4189,6 @@ dbd_st_fetch(SV *sth, imp_sth_t *imp_sth){
                                                        --datalen;
                                        }
                                        sv_setpvn(sv, p, (STRLEN)datalen);
-#if DBIXS_REVISION > 13590
                /* If a bind type was specified we use DBI's sql_type_cast
                        to cast it - currently only number types are handled */
                                        if ((fbh->req_type != 0) && (fbh->bind_flags != 0)) {
@@ -4219,7 +4218,6 @@ dbd_st_fetch(SV *sth, imp_sth_t *imp_sth){
                                                }
                                        }
                                        else
-#endif /* DBISTATE_VERSION > 94 */
                                        {
                                                if (CSFORM_IMPLIES_UTF8(imp_dbh, fbh->csform) ){
                                                        SvUTF8_on(sv);

Tux avatar Apr 01 '25 07:04 Tux

Thanks for the update.

We don't currently distribute DBD::Oracle due to build issues (#69) so we'll likely need to stay with DBD 1.645 until DBD::Oracle is updated on CPAN.

shawnlaffan avatar Apr 01 '25 07:04 shawnlaffan

That decision is ok. Just to show above patch result:

DBD-Oracle-git 507 🐧 perl Makefile.PL
Using DBI 1.648 (for perl 5.040001 on x86_64-linux-thread-multi-quadmath) installed in /pro/lib/perl5/site_perl/5.40.1/x86_64-linux-thread-multi-quadmath/auto/DBI/
Configuring DBD::Oracle for perl 5.040001 on linux (x86_64-linux-thread-multi-quadmath)

:

Installing on a linux, Ver#6.13
Using Oracle in /usr/lib/oracle/19.26
DEFINE _SQLPLUS_RELEASE = "1926000000" (CHAR)
Oracle Version 19.26.0.0 (19.26)
Found direct-link candidates: libclntsh.so
Oracle sysliblist:
Found header files in /usr/include/oracle/19.26/client64.
Your LD_LIBRARY_PATH env var is set to '/usr/lib/oracle/19.26/client64/lib:/pro/asql/o91G/bin:/pro/asql/o91G/lib:/usr/lib64:/usr/lib:/pro/tu/bev/lib'

:
:

DBD-Oracle-git 508 🐧 make test

:

t/02versions.t ............ # OCI client library version: 19.26.0.0
t/02versions.t ............ 1/2 # Database version: Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
# Version 19.3.0.0.0 Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production 0

:

All tests successful.
Files=43, Tests=2442, 40 wallclock secs ( 0.42 usr  0.07 sys +  3.64 cusr  1.06 csys =  5.19 CPU)
Result: PASS

DBI ChangeLog:

1.648 - 2025-03-14, H.Merijn Brand
    * Correct sprintf usage for trace_msg (issue#132)
    * Add DBIXS_VERSION & DBIXS_RELEASE to dbixs_rev.h
    * Remove -Wbad-function-cast

1.647 - 2025-01-20, H.Merijn Brand
    * Spellcheck
    * Fix Makefile rules for Changes (Windows case issue)
    * Another example to bind columns (issue#159)
    * Fix fetchall_arrayref for undefined NAME (issue#156)

1.646 - 2025-01-11, H.Merijn Brand
    * Remove "experimental" tag from statistics_info () (issue#134)
    * RT tickets moved to github issues (rwfranks++)
      - All RT tickets now marked as resolved with reference to GitHub issue
    * Fix install issue (issue #168)

Tux avatar Apr 01 '25 07:04 Tux

I can do a DBI-1.648 release whenever you like, but that won't fix the DBD::Oracle issue

Tux avatar Apr 01 '25 07:04 Tux