MySQL Forums
Forum List  »  Perl

Error? on execution of image blob insertion
Posted by: Isaiah Alexander
Date: August 15, 2008 06:42AM

I'm creating a daProxy-Connection: keep-alive
Cache-Control: max-age=0

base including image blobs. All my code seems to work fine, for some images, however on inserting one image the script just dies at execution. The interesting thing is that it returns no error string. The code that it dies on is as follows:


my $sth = $dbh->prepare("INSERT INTO images (ref,name,mime,gal,type,size,data)
VALUES (?,?,?,?,?,?,?)")
|| die "Couldn't prepare statement: " . $dbh->errstr;

$sth->execute($refnum,$name,$mime,$imggal,$type,$imgsize,$data)
|| die "Couldn't execute statement: " . $sth->errstr();



The table creation is done with the following MySQL:

CREATE TABLE `images` (
`ref` VARCHAR(32) NOT NULL,
PRIMARY KEY (`ref`),
`name` TINYTEXT NOT NULL,
`mime` TINYTEXT NOT NULL,
`gal` MEDIUMTEXT NOT NULL,
`size` TINYTEXT NOT NULL,
`type` MEDIUMTEXT NOT NULL,
`desc` TEXT NULL,
`data` LongBLOB NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1



ref is a rand Alpha-Numeric reference 32 chars long

Before I located exactly where the failure occured I thought perhaps that maybe one of the datatypes was undersized, however none of the data is any larger than other data that successfully executed. Since no error string is returned, I have absolutely no idea what the problem is.

ref is a rand 32 char alpha-num string
name is the name of the original file
mime is the mime type, fetched from image magick
gal is the name of the gallery where the image will appear
size is the width x height, separated by an x
type is a short description of the type of image, such as full size, or thumb
data is filled with a scalar made by simply placing the file data in with a while loop

Linux server running Perl 5.8.8, and MySQL 5.0.51a-community

Any ideas on what might be causing this problem, or how I could get more information on what the problem could be, etc would be extremely helpful.

Options: ReplyQuote


Subject
Written By
Posted
Error? on execution of image blob insertion
August 15, 2008 06:42AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.