Code

Opened 7 years ago

Closed 3 years ago

#3411 closed (wontfix)

[Django Multi DB Tree]: modifying objects via the admin interface generates an operational error

Reported by: jamie@… Owned by: nobody
Component: contrib.admin Version: other branch
Severity: Keywords: admin LogEntry multiple-db-support
Cc: Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Using the Django Multi Database tree, any attempt to modify an object via the admin interface generates the Operational Error (1048, "Column 'action_time' cannot be null") when it attempts to create the django_admin_log log entry.

/usr/lib/python2.4/site-packages/django_mdb_src/django/contrib/admin/views/main.py

LogEntry.objects.log_action(request.user.id, ContentType.objects.get_for_model(model).id, pk_value, str(new_object), ADDITION)


/usr/lib/python2.4/site-packages/django_mdb_src/django/db/backends/util.py in execute

   5. def __init__(self, cursor, db):
   6. self.cursor = cursor
   7. self.db = db
   8.
   9. def execute(self, sql, params=()):
  10. start = time()
  11. try:

  12. return self.cursor.execute(sql, params) ...

  13. finally:
  14. stop = time()
  15. # If params was a list, convert it to a tuple, because string
  16. # formatting with '%' only works with tuples or dicts.
  17. if not isinstance(params, (tuple, dict)):
  18. params = tuple(params)
Local vars
Variable 	Value
params 	
(None, 1L, 10L, 3L, 'niner niner', 1, '')
self 	
<django.db.backends.util.CursorDebugWrapper object at 0xa943ee8c>
sql 	
'INSERT INTO `django_admin_log` (`action_time`,`user_id`,`content_type_id`,`object_id`,`object_repr`,`action_flag`,`change_message`) VALUES (%s,%s,%s,%s,%s,%s,%s)'

If I manually attempt to INSERT this SQL with the params fields for values I get the same error. I've diff'ed all the files in the error chain against headrev and django_mdb tree and don't see any glaring obvious differences that would affect this but clearly I'm missing something. I should also note that only changing my site-packages 'django' symlink from django_src ( headrev ) to django_mdb_src ( mdb tree ) the problem goes away.

Attachments (0)

Change History (6)

comment:1 Changed 7 years ago by lcurrea@…

  • Keywords multiple-db-support added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I'm having the exact same problem. Just wondering if anyone's had a chance to look into it. Thanks!

comment:2 Changed 7 years ago by slump

you can fix it like this:
change the type of the datetime-field to timestamp with default value CURRENT_TIMESTAMP.

comment:3 Changed 6 years ago by jacob

  • Triage Stage changed from Unreviewed to Someday/Maybe

comment:4 Changed 6 years ago by mrts

  • milestone set to post-1.0

Definitely not in 1.0 scope.

comment:5 Changed 5 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:6 Changed 3 years ago by kmike

  • Resolution set to wontfix
  • Status changed from new to closed

This ticket seems to be obsolete.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.