Actually, I might be misreading the error string.  It looks like the address
field has extra quotes around it too.  Maybe that's just how strings get
formatted in this case and is not the problem...

  -- Scott

On Mon, Jun 30, 2008 at 4:02 PM, Scott Moonen <[EMAIL PROTECTED]> wrote:

> Simon, my guess is that the error doesn't have to do with the truncation
> you see, but that something that is passing the error along is trying to be
> helpful by truncating the string -- one hopes in such a way that the error
> is still evident. :)
>
> Looking at the snippet you've posted, I wonder how the 'gender' field is
> defined.  You are storing the three-character string 'Y' into it (including
> single quotes).  Do you expect to be able to store three characters into it,
> or only one character?
>
>   -- Scott
>
>
> On Mon, Jun 30, 2008 at 3:47 PM, Simon Tite <[EMAIL PROTECTED]> wrote:
>
>>
>> I get the following error when trying to save a model -
>> "userprofile.save()" -
>>
>> (1064, 'You have an error in your SQL syntax; check the manual that
>> corresponds to your MySQL server version for the right syntax to use
>> near \'), `gender` = ("\'F\'",), `hideyear` = (\'0\',), `address` =
>> ("\'97 Rochdale Rd\\\\r\\\\n\' at line 1')
>>
>> The data comes from a form, one of the fields being "address". It
>> would appear that the final part < `address` = ("\'97 Rochdale Rd\\\\r\
>> \\\n\'  > does not have a closing parenthesis.
>>
>> If I put more data into the textbox for the address field, this is the
>> result:
>>
>> ProgrammingError at /form/profile/
>> (1064, 'You have an error in your SQL syntax; check the manual that
>> corresponds to your MySQL server version for the right syntax to use
>> near \'), `gender` = ("\'F\'",), `hideyear` = (\'0\',), `address` =
>> ("\'97 Rochdale Manor Ho\' at line 1')
>>
>> This seems like there is a larger SQL command, which has been
>> truncated at exactly the same character position. This theory is borne
>> out by other experiments: if the address field is left blank, the next
>> field "telephone" is truncated at the same position...
>>
>> This is the version of mySql:-
>>
>> $ mysql -V
>> mysql  Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486) using
>> readline 5.2
>> $
>>
>> I'm using Django trunk 7788, from +/- 0100 GMT today 30/6/2008.
>>
>> So, I wonder how I can look at the full text of the string which is
>> being passed to mySql, and whether anyone knows of any string size
>> limitation in Django SQL statements (this seems unlikely, as I would
>> probably have found it in the forum somewhere: there are lots of posts
>> about error 1064, but none AFAIK seem to reflect my problem), or maybe
>> there is a mySql setting which allows/disallows incomplete lines?
>> Maybe Django was going to follow with the rest of the statement, but
>> mySql threw an error?
>>
>> Hmmm. Think I'll re-read the mySql manual... but in the meantime, does
>> anyone have any ideas?
>> >>
>>
>
>
> --
> http://scott.andstuff.org/ | http://truthadorned.org/




-- 
http://scott.andstuff.org/ | http://truthadorned.org/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to