Re: Debian Buster -> Bullseye upgrade issue with UTF8?

[email protected] (Simon Cruickshank) Tue, 17 Aug 2021 10:41:46 +0100
Newsgroups perl.dbi.users
Message-ID <CADXRn-iv1SzhjQk4ZMoKGHLPyRMCT9CjDne_niA1qz3C0t4tVQ@mail.gmail.com>
--000000000000797e6905c9be225f
Content-Type: text/plain; charset="UTF-8"

Sorry I was mistaken I actually use CGI::Application::Plugin::Session but I
will look into your suggestion.

Many thanks,

Simon

On Tue, 17 Aug 2021 at 10:14, <[email protected]> wrote:

> 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
>

--000000000000797e6905c9be225f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Sorry I was mistaken I actually use CGI::Application:=
:Plugin::Session but I will look into your suggestion.</div><div><br></div>=
<div>Many thanks,</div><div><br></div><div>Simon<br></div></div><br><div cl=
ass=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, 17 Aug 20=
21 at 10:14, &lt;<a href=3D"mailto:[email protected]">[email protected]</a>=
&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px =
0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi S=
imon<br>
<br>
Did you see the same issue when replacing the deprecated CGI::Session <br>
with my module Data::Session?<br>
<br>
I must confess I don&#39;t expect the latter to fix this particular problem=
.<br>
<br>
---<br>
Cheers<br>
Ron<br>
<a href=3D"http://savage.net.au" rel=3D"noreferrer" target=3D"_blank">savag=
e.net.au</a><br>
<br>
<br>
On 2021-08-17 17:41, Simon Cruickshank wrote:<br>
&gt; I use perl CGI::Session on a Debian buster box, after upgrading to<br>
&gt; Bullseye the website barfs with message :-<br>
&gt; <br>
&gt; DBD::mysql::db do failed: Incorrect string value:<br>
&gt; &#39;\xF9\x08a\x00\x00\x00...&#39; for column `webapp`.`sessions`.`a_s=
ession`<br>
&gt; at row 1 at /usr/share/perl5/CGI/Session<br>
&gt; <br>
&gt; I can recreate the issue without CGI:Session with the following code.<=
br>
&gt; <br>
&gt; #! /usr/bin/perl -w<br>
&gt; use strict;<br>
&gt; use DBI;<br>
&gt; <br>
&gt; my ($dbh, $sth, $count);<br>
&gt; <br>
&gt; $dbh =3D DBI-&gt;connect<br>
&gt; (&quot;DBI:mysql:host=3Dlocalhost;database=3Dwebapp&quot;,&quot;webadm=
in&quot;,&quot;?????????&quot;,<br>
&gt; {PrintError =3D&gt; 0, RaiseError =3D&gt; 1});<br>
&gt; $sth =3D $dbh-&gt;prepare (&quot;insert into sessions values (?,?)&quo=
t;);<br>
&gt; my ($id,$a_session) =3D ($ARGV[0],$ARGV[1]);<br>
&gt; $a_session =3D &quot;\x{F9}&quot;;<br>
&gt; $sth-&gt;execute ($id,$a_session)<br>
&gt; or die $DBI::errstr;<br>
&gt; $sth-&gt;finish ();<br>
&gt; $dbh-&gt;disconnect ();<br>
&gt; exit (0);<br>
&gt; <br>
&gt; So the issue just seems to be with UTF8? This works fine on Buster but=
<br>
&gt; not Bullseye. If I encode_utf8 the string the insert works.<br>
&gt; <br>
&gt; Is this a change in the mysql backend or a change in the DBI?<br>
&gt; <br>
&gt; Any help would be greatly appreciated.<br>
&gt; <br>
&gt; Best Regards,<br>
&gt; <br>
&gt; Simon<br>
</blockquote></div>

--000000000000797e6905c9be225f--