Re: [Mysql-cocoa-users] NSImage problem
Brought to you by:
sergecohen
|
From: Eric V. <ev...@cl...> - 2007-01-12 17:06:21
|
The max packed size was really the problem !
Thaks for your answer Max
Le 8 janv. 07 =E0 18:34, Eric VERDIN a =E9crit :
> Thanks for you answer.
>
> The max packet size (max_allowed_packet) was 1M and my data size 2,8M.
>
> Now my max packet size is 5M but i have the same error !
>
> 2007-01-08 18:26:57.083 SQLTest[398] Problem in queryString error =20
> code is : 1, query is (truncated) : Insert into nomTable =20
> (nomColonne) VALUES ('<4d4d002a 002acbbe 5562a455 62a45562 a45562a4 =20=
> 5562a455 62a45562 a45562a4 5562a455 62a45562 a45562a4 5562a455 =20
> 62a45562 a45562a4 5562a455 62a45562 a45562a4 5562a455 62a45562 =20
> a45562a4 5562a455 62a45562 a45562a4 5562a455 62a45562 a45562a4 =20
> 5562a455 62a45562 a45562a4 5562a455 62a45562 a45562a4 5562a455 =20
> 62a45562 a45562a4 5562a455 62a45562 a45562a4 5562a455 62a45562 =20
> a45562a4 5562a455 62a45562 a45562a4 5562a455 62a45562 a45562a4 =20
> 5562a455 62a45562 a45562a4 5562a455 62a45562 a45562a4 5562a455 =20
> 62a45562 a45562a4 5562a455 62a45562 a45562a4 5562a455 62a45562 =20
> a45562a4 5562a455 62a45562 a45562a4 5562a455 62a45562 a45562a4 =20
> 5562a455 62a45562 a45562a4 5562a455 62a45562 a45562a4 5562a455 =20
> 62a45562 a45562a4 5562a455 62a45562 a45562a4 5562a455 62a45562 =20
> a45562a4 5562a455 62a45562 a45562a4 5562a455 62a45562 a45562a4 =20
> 5562a455 62a45562 a45562a4 5562a455 62a45562 a45562a4 5562a455 =20
> 62a45562 a45562a4 5562a455 62a45562 a45562a4 5562a455 62a45562 =20
> a45562a4 5562a455 62a45562 a45562a4 5562a455 62a45562-
> 2007-01-08 18:26:57.083 SQLTest[398] Error message is : MySQL =20
> server has gone away
>
> Eric
>
>
> Le 7 janv. 07 =E0 18:33, Max Frazer a =E9crit :
>
>> If everything else works but longblobs, more than likely you =20
>> simply need to increase your max packet size in your mysql cnf file.
>>
>> http://www.vbulletin.com/forum/showthread.php?t=3D103786
>>
>> -Max
>>
>>
>> On Jan 7, 2007, at 3:40 AM, Eric VERDIN wrote:
>>
>>> Hi,
>>>
>>> i use the new version of the framework (3.01) to store int, =20
>>> varchar, float and text without problem.
>>> But i can't insert an image in a longblob.
>>>
>>> I have an 2006 Error (MySQL server has gone away) with 4.1.22 or =20
>>> 5.0.27 version.
>>>
>>> ****************************************
>>>
>>> #import <Cocoa/Cocoa.h>
>>> #import <Foundation/Foundation.h>
>>> #import <MCPKit_bundled/MCPResult.h>
>>> #import <MCPKit_bundled/MCPConnection.h>
>>>
>>> int main(int argc, char *argv[])
>>> {
>>>
>>> NSAutoreleasePool *pool =3D [[NSAutoreleasePool =
alloc] init];
>>> MCPConnection *connection;
>>> MCPResult *result;
>>> NSImage *image;
>>> NSData *tiffData;
>>> NSString *string;
>>> NSString *query;
>>> NSString *nomFichier;
>>> int erreur;
>>> NSString *message;
>>>
>>> nomFichier =3D [[NSString alloc] initWithString:@"~/Pictures/=20
>>> Berlan_1.png"];
>>> nomFichier =3D [nomFichier stringByExpandingTildeInPath];
>>> image =3D [[NSImage alloc] initWithContentsOfFile:nomFichier];
>>> tiffData =3D [image TIFFRepresentation];
>>> =09
>>> connection =3D [[MCPConnection alloc] initToHost:@"localhost" =20=
>>> withLogin:@"" password:@"" usingPort:0];
>>> if (connection !=3D nil)
>>> {
>>> =09
>>> [connection selectDB:@"test_image"];
>>>
>>> string =3D [connection prepareBinaryData:tiffData];
>>> query =3D [[NSString alloc] initWithFormat:@"Insert into =
%@ (%@) =20
>>> VALUES ('%@');",
>>> =
@"nomTable",
>>> =
@"nomColonne",
>>> =
tiffData];
>>> =09
>>> result =3D [connection queryString:query];
>>> erreur =3D [connection getLastErrorID];
>>> message =3D [connection getLastErrorMessage];
>>> =09
>>> [connection release];
>>> [nomFichier release];
>>> [query release];
>>> [image release];
>>> [tiffData release];
>>> =09
>>> }
>>> =09
>>> [pool release];
>>> return 0;
>>>
>>> }
>>>
>>> ****************************************
>>>
>>> Thank you in advance for your help,
>>>
>>> Eric
>>> --------------------------------------------------------------------=20=
>>> -----
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to =20=
>>> share your
>>> opinions on IT & business topics through brief surveys - and earn =20=
>>> cash
>>> http://www.techsay.com/default.php?=20
>>> page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV__________________________=
____=20
>>> _________________
>>> Mysql-cocoa-users mailing list
>>> Mys...@li...
>>> https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users
>>
>> ---------------------------------------------------------------------=20=
>> ----
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to =20
>> share your
>> opinions on IT & business topics through brief surveys - and earn =20
>> cash
>> http://www.techsay.com/default.php?=20
>> page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV___________________________=
____=20
>> ________________
>> Mysql-cocoa-users mailing list
>> Mys...@li...
>> https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users
>
> ----------------------------------------------------------------------=20=
> ---
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to =20
> share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?=20
> page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV____________________________=
____=20
> _______________
> Mysql-cocoa-users mailing list
> Mys...@li...
> https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users
|