Opened 17 years ago

Closed 13 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: no UI/UX: no

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.

Change History (6)

comment:1 by lcurrea@…, 17 years ago

Keywords: multiple-db-support added

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

comment:2 by slump, 17 years ago

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

comment:3 by Jacob, 16 years ago

Triage Stage: UnreviewedSomeday/Maybe

comment:4 by mrts, 16 years ago

milestone: post-1.0

Definitely not in 1.0 scope.

comment:5 by (none), 15 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:6 by Mikhail Korobov, 13 years ago

Resolution: wontfix
Status: newclosed

This ticket seems to be obsolete.

Note: See TracTickets for help on using tickets.
Back to Top