wmjie / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

Django backend sequence reset likely to fail in real-world situations #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The implementation of sequence_reset_sql() in 
ibm_db_django/django/db/backends/db2/operations.py is extremely fragile. It 
assumes that fewer 
than 10,000 sequential values have been used from the sequence, which is highly 
likely to fail on 
real-world installations.

For a better implementation, consult the existing Django backends for 
PostgreSQL and Oracle, both 
of which select the maximum value in use and increment it to obtain an unused 
value to reset the 
sequence.

Original issue reported on code.google.com by ubernost...@gmail.com on 20 Jun 2009 at 7:04

GoogleCodeExporter commented 9 years ago

Original comment by tarun.pa...@in.ibm.com on 1 Jul 2009 at 6:27

GoogleCodeExporter commented 9 years ago
Thanks for the feedback. Would need little time to investigate this. I agree 
that 10000 
is an unrealistic hardcoded number and accept this as a defect.

Thanks and Regards
Tarun Pasrija
Open Source Application Development
IBM India Software Labs

Original comment by tarun.pa...@in.ibm.com on 1 Jul 2009 at 9:06

GoogleCodeExporter commented 9 years ago
Made necessary changes for this !! Going out in release ibm_db_django - 0.1.4

Thanks for reporting this..
Regards
Tarun Pasrija

Original comment by tarun.pa...@in.ibm.com on 19 Oct 2009 at 6:51