[patch] sqlite3 can't handle initial data with more than one statement
|Reported by:||jpellerin@…||Owned by:||adrian|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Using django trunk , pysqlite 2.2.2 and sqlite 3.3.5, I can't include more than one statement in my models' initial data files, or sqlite chokes with an error: "You can only execute one statement at a time". Various googlable comments here and elsewhere indicate that there is some magical combination of sqlite version and pysqlite version that will make this work, but I've been unable to find it. Seems likely that others are probably unable also, so I think a workaround in django will be valuable.
Attached is a patch against  django.core.management.py that uses a regular expression to split multiple statements in a model's sql initial data on ;, so that they can be fed to badly-behaving backends one at a time.
Change History (12)
Changed 10 years ago by jpellerin@…
comment:3 Changed 10 years ago by anonymous
- Resolution fixed deleted
- Status changed from closed to reopened
Changed 10 years ago by anonymous
Changed 10 years ago by Landon Fuller <landonf@…>
comment:8 Changed 10 years ago by mtredinnick
- Resolution set to fixed
- Status changed from reopened to closed