Skip Menu |
 

This queue is for tickets about the Apache-Session CPAN distribution.

Report information
The Basics
Id: 1787
Status: stalled
Priority: 0/
Queue: Apache-Session

People
Owner: Nobody in particular
Requestors: tjmather [...] maxmind.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.54
Fixed in: (no value)



Subject: DBD::mysql - Unknown column 'foo' in 'where clause'
Download (untitled) / with headers
text/plain 519b
Hi, This patch is a workaround for a DBD::mysql or MySQL issue. The issue is if a placeholder is "primed" using an integer-type value, and then later used with a string, the placeholder expansion is broken. For more details on the MySQL issue, see: http://marc.theaimsgroup.com/?l=msql-mysql-modules&m=103014432822561&w=2 This manifests itself if you use both integers and strings as session IDs with Apache::Session. The workaround included in the patch is to explicitly set the datatype to DBI::SQL_VARCHAR. -TJ
--- /home/tjmather/Apache-Session-1.54/Session/Store/DBI.pm 2000-07-24 12:01:31.000000000 -0400 +++ DBI.pm 2002-11-14 16:33:09.000000000 -0500 @@ -36,7 +36,7 @@ INSERT INTO sessions (id, a_session) VALUES (?,?)}); } - $self->{insert_sth}->bind_param(1, $session->{data}->{_session_id}); + $self->{insert_sth}->bind_param(1, $session->{data}->{_session_id}, DBI::SQL_VARCHAR); $self->{insert_sth}->bind_param(2, $session->{serialized}); $self->{insert_sth}->execute; @@ -60,7 +60,7 @@ } $self->{update_sth}->bind_param(1, $session->{serialized}); - $self->{update_sth}->bind_param(2, $session->{data}->{_session_id}); + $self->{update_sth}->bind_param(2, $session->{data}->{_session_id}, DBI::SQL_VARCHAR); $self->{update_sth}->execute; @@ -81,7 +81,7 @@ SELECT a_session FROM sessions WHERE id = ?}); } - $self->{materialize_sth}->bind_param(1, $session->{data}->{_session_id}); + $self->{materialize_sth}->bind_param(1, $session->{data}->{_session_id}, DBI::SQL_VARCHAR); $self->{materialize_sth}->execute; @@ -110,7 +110,7 @@ DELETE FROM sessions WHERE id = ?}); } - $self->{remove_sth}->bind_param(1, $session->{data}->{_session_id}); + $self->{remove_sth}->bind_param(1, $session->{data}->{_session_id}, DBI::SQL_VARCHAR); $self->{remove_sth}->execute; $self->{remove_sth}->finish;
Download (untitled) / with headers
text/plain 334b
On Nov 14 17:02:44 2002, TJMATHER wrote: Show quoted text
> This patch is a workaround for a DBD::mysql or MySQL issue. The issue > is if a placeholder is "primed" using an integer-type value, and then > later used with a string, the placeholder expansion is broken.
Is it fixed by using DBD::Mysql 2.9002? -- Alexandr Ciornii, http://chorny.net


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.