Fixed #19112 - Reduce maximum parameter count test to 2001. #438

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@manfre
Collaborator
manfre commented Oct 11, 2012

Test queries.ConditionalTests.tset_ticket14244 tests the
max_in_list_size() database feature (used by Oracle) to split the SQL 'IN'
clause in to buckets. MSSQL's database driver has a limit of 2100
parameters for the entire query, which fails on this test.

@manfre manfre Fixed #19112 - Reduce maximum parameter count test to 2001.
Test queries.ConditionalTests.tset_ticket14244 tests the
max_in_list_size() database feature (used by Oracle) to split the SQL 'IN'
clause in to buckets. MSSQL's database driver has a limit of 2100
parameters for the entire query, which fails on this test.
bf86cc2
@apollo13
Member

Hmm, since the original issue is oracle specific I think this test should get executed on Oracle only instead of trying to get it working on other databases…

@manfre
Collaborator
manfre commented Oct 24, 2012

Restricting the test only to Oracle is not the correct approach. This is the only test for the max_in_list database feature. Oracle is the only core database backend that uses this, but that doesn't mean the core should intentionally make it more difficult for 3rd party database backends to use the django test suite.

My patch maintains the intent and conditions of the test without forcing 3rd party database backends to duplicate a test for this core database feature.

@apollo13
Member

And what if the next 3rd party db supports even less than mssql?

@manfre
Collaborator
manfre commented Oct 29, 2012

Django already provides supports_1000_query_parameters, so the decision to support some mechanism for a db to hint about its upper query limit. In the unlikely event that another 3rd party db supports more than 1000 and less than 2001, perhaps that feature should be supplemented or replaced to allow the backend to specify its actual upper limit.

This is the only test that I see for max_in_list and restricting the test to only Oracle unnecessarily reduces coverage.

@akaariai
Member
akaariai commented Nov 5, 2012

One could say that the supports_1000_query_parameters is somewhat silly. supported_query_param_count = 2100 for mssql, 1000 for sqlite would work nicely here...

@akaariai
Member

From the sweep-it-under-the-rug department: I am going with the suggested patch. This is far from optimal, but gets this issue solved for now. Later on having a "supported query parameters count" feature should be added to properly support all databases.

I committed a patch manually (with 2050 params, 2001 seemed to be too close to off-by-one error territory).

@akaariai akaariai closed this Feb 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment