I have already gotten an ibm_db_django backend mostly working with OSQA (after requesting a fix for ibm_db_django). There is still one outstanding bug I am facing, where the "hottest" questions link fails due to a select distinct being performed on the FORUM_NODE table which has LOB fields ('extra','state_string' and 'body') causing the following exception

Django Version: 1.2.3
Python Version: 2.6.1
...
Traceback:
File "/tmp/forum/modules/decorators.py" in __call__
  55.         res = self._callable(*args, **kwargs)
File "/tmp/forum/views/readers.py" in questions
  100.     return question_list(request, Question.objects.all(), _('questions'))
File "/tmp/forum/views/readers.py" in question_list
  180.     'feed_url': feed_url,
File "/tmp/forum/utils/pagination.py" in paginated
  177.         tpl_context[list_name] = _paginated(request, tpl_context[list_name], context)
File "/tmp/forum/utils/pagination.py" in _paginated
  191.         page_obj = paginator.page(page)
File "/tmp/lib/ibm_db_django-1.0.1-py2.5.egg/ibm_db_django/pybase.py" in execute
  100.                     return super( DB2CursorWrapper, self ).execute( operation, parameters )

Exception Type: DatabaseError at /osqa/questions/
Exception Value: [IBM][CLI Driver][DB2/LINUXX8664] SQL0134N  Improper use of a string column, host variable, constant, or function "EXTRA".  SQLSTATE=42907 SQLCODE=-134

With the query attempting to be executed as

SELECT COUNT(*) FROM (SELECT DISTINCT COUNT(T11."ID") AS "NEW_CHILD_COUNT" FROM "FORUM_NODE" LEFT OUTER JOIN "FORUM_NODE" T11 ON ("FORUM_NODE"."ID" = T11."ABS_PARENT_ID") INNER JOIN "FORUM_NODE" T12 ON ("FORUM_NODE"."ID" = T12."ABS_PARENT_ID") WHERE ( "FORUM_NODE"."NODE_TYPE" = ? AND NOT (VARCHAR("FORUM_NODE"."STATE_STRING", 4096) LIKE ? ESCAPE \\'\\\\\\' ) AND NOT ( "FORUM_NODE"."ID" IN (SELECT U1."NODE_ID" FROM "FORUM_NODE_TAGS" U1 WHERE U1."TAG_ID" IN (SELECT U0."ID" FROM "FORUM_TAG" U0 INNER JOIN "FORUM_MARKEDTAG" U1 ON (U0."ID" = U1."TAG_ID") WHERE (NOT ( U0."USED_COUNT" < ? ) AND U1."USER_ID" = ? AND U1."REASON" = ? )))) AND T12."ADDED_AT" > ? ) GROUP BY "FORUM_NODE"."ID", "FORUM_NODE"."TITLE", "FORUM_NODE"."TAGNAMES", "FORUM_NODE"."AUTHOR_ID", "FORUM_NODE"."BODY", "FORUM_NODE"."NODE_TYPE", "FORUM_NODE"."PARENT_ID", "FORUM_NODE"."ABS_PARENT_ID", "FORUM_NODE"."ADDED_AT", "FORUM_NODE"."SCORE", "FORUM_NODE"."STATE_STRING", "FORUM_NODE"."LAST_EDITED_ID", "FORUM_NODE"."LAST_ACTIVITY_BY_ID", "FORUM_NODE"."LAST_ACTIVITY_AT", "FORUM_NODE"."ACTIVE_REVISION_ID", "FORUM_NODE"."EXTRA", "FORUM_NODE"."EXTRA_REF_ID", "FORUM_NODE"."EXTRA_COUNT", "FORUM_NODE"."MARKED") subquery

I tried adding a defer for these fields to the HottestQuestionsSort but the _setup_aggregate_query function appears to use all fields for the annotate function of Query.

Is there another way to workaround this problem (other than removing the hottest link on the questions page) that is not obvious?

Also, is there plans to ever support DB2 (or Oracle which I am assuming would also be subject to this bug) in the long term?

Cheers,

-Paul

asked 19 Jan '11, 18:00

Paul%20Goldsmith's gravatar image

Paul Goldsmith
111
accept rate: 0%


We have no plans to support DB2 explicitly, but we have gone to significant lengths to eliminate all direct SQL from the OSQA codebase in favor of standard Django ORM calls. If DB2 works with Django ORM, then you should be able to use it.

link

answered 20 Jan '11, 00:01

rickross's gravatar image

rickross ♦♦
12.5k2914972
accept rate: 46%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×62
×3
×2

Asked: 19 Jan '11, 18:00

Seen: 361 times

Last updated: 20 Jan '11, 00:01

powered by OSQA