Hi Simon
Did you see the same issue when replacing the deprecated CGI::Session
with my module Data::Session?
I must confess I don't expect the latter to fix this particular problem.
---
Cheers
Ron
savage.net.au
On 2021-08-17 17:41, Simon Cruickshank wrote:
I use perl CGI::Session on a Debian buster box, after upgrading to
Bullseye the website barfs with message :-
DBD::mysql::db do failed: Incorrect string value:
'\xF9\x08a\x00\x00\x00...' for column `webapp`.`sessions`.`a_session`
at row 1 at /usr/share/perl5/CGI/Session
I can recreate the issue without CGI:Session with the following code.
#! /usr/bin/perl -w
use strict;
use DBI;
my ($dbh, $sth, $count);
$dbh = DBI->connect
("DBI:mysql:host=localhost;database=webapp","webadmin","?????????",
{PrintError => 0, RaiseError => 1});
$sth = $dbh->prepare ("insert into sessions values (?,?)");
my ($id,$a_session) = ($ARGV[0],$ARGV[1]);
$a_session = "\x{F9}";
$sth->execute ($id,$a_session)
or die $DBI::errstr;
$sth->finish ();
$dbh->disconnect ();
exit (0);
So the issue just seems to be with UTF8? This works fine on Buster but
not Bullseye. If I encode_utf8 the string the insert works.
Is this a change in the mysql backend or a change in the DBI?
Any help would be greatly appreciated.
Best Regards,
Simon