1

I never installed DBI or DBI::SQLite, because they seem to be built into my Perl v5.32 installation. They have been working fine in a script I'm developing, which is now about 300 lines, but I recently ran into an encoding issue. I found the following example lines at https://metacpan.org/pod/DBD::SQLite,

use DBI qw(:sql_types);
use DBD::SQLite::Constants ':dbd_sqlite_string_mode';
$dbh->{sqlite_string_mode} = DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK;

, and it looks like the following variation should solve my problem. (Identical, except that I replace FALLBACK with BYTES.)

use DBI qw(:sql_types);
use DBD::SQLite::Constants ':dbd_sqlite_string_mode';      # line 16
$dbh->{sqlite_string_mode} = DBD_SQLITE_STRING_MODE_UNICODE_BYTES;

However, I get the following error when I run that. (drive backup,.compl is the name of my script file.)

"dbd_sqlite_string_mode" is not defined in %DBD::SQLite::Constants::EXPORT_TAGS at drive backup,.compl line 16.

If I run this from the command line,

cpanm DBD::SQLite::Constants

, it gives me this:

DBD::SQLite::Constants is up to date. (undef)

But, if I run this,

cpanm DBD::SQLite

, it gives me this:

--> Working on DBD::SQLite Fetching http://www.cpan.org/authors/id/I/IS/ISHIGAKI/DBD-SQLite-1.70.tar.gz ... OK Configuring DBD-SQLite-1.70 ... OK Building and testing DBD-SQLite-1.70 ... FAIL ! Installing DBD::SQLite failed. See C:\Users\arnold.cpanm\work\1637612566.1020 0\build.log for details. Retry with --force to force install it.

See below for images of the build log. The first indication of a problem seems to be a warning about "cast from pointer to integer of different size". After that, a lot of things seem to be going wrong. I don't want to force the install.

My OS is Windows 7 x64 Pro. If DBD::SQLite has moved beyond win7, then I can probably work around my encoding issue with Encode, but that approach is more tedious. I would much rather get the DBD::SQLite update to complete successfully, so I can (hopefully) use the handle attribute.

I couldn't figure out how to attach the build log, but here are some images of it. The first one is the beginning. The first indication of a problem is at the very bottom of that image. The second image is contiguous with the first one in the log, and it shows repeating problems. The third image is the end of the log. There are over a thousand of those undefined reference lines before the log comes to an end. Start of the build log Indications of problems End of build log

Arnold Cross
  • 199
  • 1
  • 12
  • 1
    It's not about Windows version, DBD::SQLite 1.70 has passing tests reported on everything from XP to Win10. – hobbs Nov 22 '21 at 23:11
  • 1
    The undefined references of Perl symbols like those are usually indicative of a mismatches in Perl builds between the one that built the module and the one loading it – ikegami Nov 23 '21 at 00:10
  • 1
    *"I couldn't figure out how to attach the build log, but here are some images of it."* : You could upload it somewhere (e.g. pastebin.com, gist.github.com, google.drive, etc.) and provide a link here. This is usually how we include references to longer pieces of output or log files here. – Håkon Hægland Nov 23 '21 at 07:09
  • 1
    According to the [release notes](https://strawberryperl.com/release-notes/5.32.1.1-64bit.html) for Strawberry Perl version 5.32.1, `DBD::SQLite` version 1.66 comes preinstalled – Håkon Hægland Nov 23 '21 at 07:13
  • @Håkon, Good info, thanks. I checked the metacpan page of v1.66, and it is different. (Earlier today I checked, and I could swear it was identical, but I must have accidentally compared the v1.70 page with itself. I'm deleting the comments that I posted at that time.) I'll review the v1.66 page and see if it gives me a solution to my encoding issue. If it does, then there is no reason to update to v1.70. – Arnold Cross Nov 24 '21 at 00:13

1 Answers1

1

I solved my encoding issue using Encode. That solution wasn't as tedious as I expected. DBD::SQLite v1.70 appears to offer much enhanced encoding capabilities over v1.66, but I couldn't get it to install on Perl v5.32.1.1. I don't know if it's supposed to be compatible, but at this point, it doesn't matter to me. v1.66, which comes with Perl v5.32, is working as advertised, and Encode provides the methods that I need for managing my string data.

Arnold Cross
  • 199
  • 1
  • 12