#11165: Data gets truncated when saved
---------------------------+------------------------------------------------
 Reporter:  neoel          |       Owner:  nobody    
   Status:  new            |   Milestone:            
Component:  Uncategorized  |     Version:  1.0       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 I am working on a system to index my music library, and I think I stumbled
 on a bug.
 When a query gets formed quote marks are not entered in the query. here is
 a piece of code where I believe the problem lies.
 Below is the complete code.

 The query is formed with this code:
    INSERT INTO `shoutcast_song` (`path`, `title`) VALUES (%s, %s)
 the data is entered at the values but no quotation marks are found.
 I believe the code should be like this:
    INSERT INTO `shoutcast_song` (`path`, `title`) VALUES ('%s', '%s')


 /var/lib/python-support/python2.5/django/db/models/sql/query.py in
 execute_sql

 1727. except EmptyResultSet:
 1728. if result_type == MULTI:
 1729. return empty_iter()
 1730. else:
 1731. return
 1732.
 1733. cursor = self.connection.cursor()

 1734. cursor.execute(sql, params) ...

 1735.
 1736. if not result_type:
 1737. return cursor
 1738. if result_type == SINGLE:
 1739. if self.ordering_aliases:
 1740. return cursor.fetchone()[:-len(results.ordering_aliases)]

 ▼ Local vars
 Variable        Value
 cursor
 <django.db.backends.util.CursorDebugWrapper object at 0x99fb2ac>
 params
 ("/files/Music/Q/Queens of the Stone Age - Songs For The Deaf/Queens Of
 The Stone Age - Era Vulgaris/Queens of the Stone Age - Queens Of The Stone
 Age/Queens of the Stone Age - Lullabies To Paralyze/Queens Of The Stone
 Age/Queens Of The Stone Age - Rated R/Queens Of The Stone Age - Songs For
 The Deaf [Europe]Queens Of The Stone Age - 01 - You Think I Ain't Worth A
 Dollar, But I Feel Like A Millionaire.mp3", "Queens Of The Stone Age - 01
 - You Think I Ain't Worth A Dollar, But I Feel Like A Millionaire.mp3")
 result_type
 None
 self
 <django.db.models.sql.subqueries.InsertQuery object at 0x99fb18c>
 sql
 'INSERT INTO `shoutcast_song` (`path`, `title`) VALUES (%s, %s)'

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11165>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to