Skip Menu |

This queue is for tickets about the CHI-Driver-DBI CPAN distribution.

Report information
The Basics
Id: 94223
Status: open
Priority: 0/
Queue: CHI-Driver-DBI

People
Owner: Nobody in particular
Requestors: JETEVE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.26
Fixed in: (no value)



Subject: Broken "create_table" with mysql utf8 mode and traditional mode
DBI::Driver::DBI's automatic table (and documentation) is not natively compatible with MySQL's utf8 mode and MySQL TRADITIONAL mode. This prevent cache operation with MySQL settings which use those "correctness settings" How to replicate: - Make sure your MySQL db uses utf8 as its default character set. - Make sure your MySQL connecting dbh is set with mysql_enable_utf8 - Make sure you do 'SET sql_mode = 'TRADITIONAL'' on connection. - Make sure you use the 'create_table' feature. - Use the CHI ->set('bla', 'stuff', 10); and ->get('bla'); -> ERROR setting keys - Remove the TRADITIONAL mode. -> Setting keys work. -> ERROR retrieving values. Fix: Creating the table outside of CHI, replacing TEXT by BLOB works just fine. Probably the documentation needs to be updated too.
Subject: Re: [rt.cpan.org #94223] Broken "create_table" with mysql utf8 mode and traditional mode
Date: Wed, 26 Mar 2014 14:27:23 -0700
To: bug-CHI-Driver-DBI [...] rt.cpan.org
From: Jonathan Swartz <swartz [...] pobox.com>
Is there a fix for this, or is it just something that can't work? On Mar 26, 2014, at 1:53 PM, "Jerome Eteve via RT" <bug-CHI-Driver-DBI@rt.cpan.org> wrote: Show quoted text
> Wed Mar 26 16:53:07 2014: Request 94223 was acted upon. > Transaction: Ticket created by JETEVE > Queue: CHI-Driver-DBI > Subject: Broken "create_table" with mysql utf8 mode and traditional mode > Broken in: 1.26 > Severity: Important > Owner: Nobody > Requestors: JETEVE@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=94223 > > > > DBI::Driver::DBI's automatic table (and documentation) is not natively compatible with MySQL's utf8 mode and MySQL TRADITIONAL mode. > > This prevent cache operation with MySQL settings which use those "correctness settings" > > How to replicate: > > - Make sure your MySQL db uses utf8 as its default character set. > > - Make sure your MySQL connecting dbh is set with mysql_enable_utf8 > > - Make sure you do 'SET sql_mode = 'TRADITIONAL'' on connection. > > - Make sure you use the 'create_table' feature. > > - Use the CHI ->set('bla', 'stuff', 10); and ->get('bla'); > > -> ERROR setting keys > > - Remove the TRADITIONAL mode. > > -> Setting keys work. > > -> ERROR retrieving values. > > Fix: > > Creating the table outside of CHI, replacing TEXT by BLOB works just fine. > > Probably the documentation needs to be updated too. > >
It works just fine if you replace the type of the 'value' column by BLOB (instead of TEXT), as BLOB is designed to hold binary data as opposed to the character set aware TEXT. That's for MySQL, so as far as this issue is concerned, that's a very straight forward fix. It probably didn't surface until now due to the lack of popularity of using those MySQL options. It might be worth checking what's the 'Binary blob type' for other DBs, like Oracle ( http://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#CNCPT513 ), but that's another (potential) issue :) Cheers, Jerome. On Wed Mar 26 17:27:38 2014, swartz@pobox.com wrote: Show quoted text
> Is there a fix for this, or is it just something that can't work? > > On Mar 26, 2014, at 1:53 PM, "Jerome Eteve via RT" <bug-CHI-Driver- > DBI@rt.cpan.org> wrote: >
> > Wed Mar 26 16:53:07 2014: Request 94223 was acted upon. > > Transaction: Ticket created by JETEVE > > Queue: CHI-Driver-DBI > > Subject: Broken "create_table" with mysql utf8 mode and > > traditional mode > > Broken in: 1.26 > > Severity: Important > > Owner: Nobody > > Requestors: JETEVE@cpan.org > > Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=94223 > > > > > > > DBI::Driver::DBI's automatic table (and documentation) is not > > natively compatible with MySQL's utf8 mode and MySQL TRADITIONAL > > mode. > > > > This prevent cache operation with MySQL settings which use those > > "correctness settings" > > > > How to replicate: > > > > - Make sure your MySQL db uses utf8 as its default character set. > > > > - Make sure your MySQL connecting dbh is set with mysql_enable_utf8 > > > > - Make sure you do 'SET sql_mode = 'TRADITIONAL'' on connection. > > > > - Make sure you use the 'create_table' feature. > > > > - Use the CHI ->set('bla', 'stuff', 10); and ->get('bla'); > > > > -> ERROR setting keys > > > > - Remove the TRADITIONAL mode. > > > > -> Setting keys work. > > > > -> ERROR retrieving values. > > > > Fix: > > > > Creating the table outside of CHI, replacing TEXT by BLOB works just > > fine. > > > > Probably the documentation needs to be updated too. > > > >
On Wed Mar 26 17:27:38 2014, swartz@pobox.com wrote: Show quoted text
> Is there a fix for this, or is it just something that can't work?
For existing installations, that can prevent people from turning on those utf8 and TRADITIONAL options. Show quoted text
> On Mar 26, 2014, at 1:53 PM, "Jerome Eteve via RT" <bug-CHI-Driver- > DBI@rt.cpan.org> wrote: >
> > Wed Mar 26 16:53:07 2014: Request 94223 was acted upon. > > Transaction: Ticket created by JETEVE > > Queue: CHI-Driver-DBI > > Subject: Broken "create_table" with mysql utf8 mode and > > traditional mode > > Broken in: 1.26 > > Severity: Important > > Owner: Nobody > > Requestors: JETEVE@cpan.org > > Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=94223 > > > > > > > DBI::Driver::DBI's automatic table (and documentation) is not > > natively compatible with MySQL's utf8 mode and MySQL TRADITIONAL > > mode. > > > > This prevent cache operation with MySQL settings which use those > > "correctness settings" > > > > How to replicate: > > > > - Make sure your MySQL db uses utf8 as its default character set. > > > > - Make sure your MySQL connecting dbh is set with mysql_enable_utf8 > > > > - Make sure you do 'SET sql_mode = 'TRADITIONAL'' on connection. > > > > - Make sure you use the 'create_table' feature. > > > > - Use the CHI ->set('bla', 'stuff', 10); and ->get('bla'); > > > > -> ERROR setting keys > > > > - Remove the TRADITIONAL mode. > > > > -> Setting keys work. > > > > -> ERROR retrieving values. > > > > Fix: > > > > Creating the table outside of CHI, replacing TEXT by BLOB works just > > fine. > > > > Probably the documentation needs to be updated too. > > > >