Skip Menu |

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 62516
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: CAPTTOFU [...] cpan.org
Requestors: bernt.johnsen [...] oracle.com
Cc: pali [...] cpan.org
AdminCc:

Bug Information
Severity: Normal
Broken in: 4.017
Fixed in: 4.041_01



Subject: mysql_to_perl_type is not thread safe
The local variable enum_type in mysql_to_perl_type is declared static and makes the function non-threadsafe. Easy fix: --- a/dbdimp.c +++ b/dbdimp.c @@ -326,7 +326,7 @@ free_param(imp_sth_ph_t *params, int num_params) static enum enum_field_types mysql_to_perl_type(enum enum_field_types type) { - static enum enum_field_types enum_type; + enum enum_field_types enum_type; switch (type) { case MYSQL_TYPE_DOUBLE:
Patrick, can you please take a look at this (very trivial) fix?
On Štv Okt 28 09:41:43 2010, berntm wrote: Show quoted text
> The local variable enum_type in mysql_to_perl_type is declared static > and makes the function non-threadsafe. > > Easy fix: > > --- a/dbdimp.c > +++ b/dbdimp.c > @@ -326,7 +326,7 @@ free_param(imp_sth_ph_t *params, int num_params) > > static enum enum_field_types mysql_to_perl_type(enum enum_field_types type) > { > - static enum enum_field_types enum_type; > + enum enum_field_types enum_type; > > switch (type) { > case MYSQL_TYPE_DOUBLE:
Fixed as part of https://github.com/perl5-dbi/DBD-mysql/pull/67 in 4.041_01.
Reopening, fix was reverted in 4.043.