mehov / mooha

Automatically exported from code.google.com/p/mooha
1 stars 0 forks source link

500 Internal server error #39

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Sync with mysql server 5.5

What is the expected output? What do you see instead?

Fatal error: SyncmlException: Mysql query error: Incorrect integer value: '' 
for column 'item_id' at row 1
 query was: INSERT INTO mooha_items VALUES(4, '', "1308694305", "text/x-vcard", "2.1", "BEGIN:VCARD\nVERSION:2.1\nREV:20101215T135158Z\nN:John ;Rossi;;;\nTEL;CELL:+393201234\nX-CLASS:private\nEND:VCARD\n", 0) in D:\my\www\default\nsync\mooha\inc\MoohaServer.php on line 158
 in D:\my\www\default\nsync\mooha\config.php on line 58

What version of the product are you using? On what operating system?
Downloaded via SVN 22/jun/2011

Please provide any additional information below.
According to mysql documentation 
(http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html), the 
insert on an auto_increment field should be done with NULL or 0. Maybe you 
should change the line 605 of MoohaServer.php

$query = 'INSERT INTO %1$smooha_items VALUES(%2$d, \'\', "%3$s", "%4$s", 
"%5$s", "%6$s", 0)';

with

$query = 'INSERT INTO %1$smooha_items VALUES(%2$d, NULL, "%3$s", "%4$s", 
"%5$s", "%6$s", 0)';

Original issue reported on code.google.com by giovanni...@gmail.com on 21 Jun 2011 at 10:30