Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2014-04-26 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:  fixed
 Severity:  Release blocker  | Triage Stage:  Ready for
 Keywords:  rawsql migrations|  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Aymeric Augustin ):

 In [changeset:"3bb0f118ca375f25cd0c03a5733ee2ef9d79dfa5"]:
 {{{
 #!CommitTicketReference repository=""
 revision="3bb0f118ca375f25cd0c03a5733ee2ef9d79dfa5"
 [1.7.x] Fixed #3214 -- Stopped parsing SQL with regex.

 Avoided introducing a new regex-based SQL splitter in the migrations
 framework, before we're bound by backwards compatibility.

 Adapted this change to the legacy "initial SQL data" feature, even
 though it's already deprecated, in order to facilitate the transition
 to migrations.

 sqlparse becomes mandatory for RunSQL on some databases (all but
 PostgreSQL). There's no API to provide a single statement and tell
 Django not to attempt splitting. Since we have a more robust splitting
 implementation, that seems like a good tradeoff. It's easier to add a
 new keyword argument later if necessary than to remove one.

 Many people contributed to both tickets, thank you all, and especially
 Claude for the review.

 Refs #22401.

 Backport of 8b5b199 from master
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.ef35856c5cfd37619b5c0a2e4a799a59%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2014-04-26 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:  fixed
 Severity:  Release blocker  | Triage Stage:  Ready for
 Keywords:  rawsql migrations|  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Aymeric Augustin ):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"8b5b199e20ad2d8d3e91873ce0cd5d3035e05ece"]:
 {{{
 #!CommitTicketReference repository=""
 revision="8b5b199e20ad2d8d3e91873ce0cd5d3035e05ece"
 Fixed #3214 -- Stopped parsing SQL with regex.

 Avoided introducing a new regex-based SQL splitter in the migrations
 framework, before we're bound by backwards compatibility.

 Adapted this change to the legacy "initial SQL data" feature, even
 though it's already deprecated, in order to facilitate the transition
 to migrations.

 sqlparse becomes mandatory for RunSQL on some databases (all but
 PostgreSQL). There's no API to provide a single statement and tell
 Django not to attempt splitting. Since we have a more robust splitting
 implementation, that seems like a good tradeoff. It's easier to add a
 new keyword argument later if necessary than to remove one.

 Many people contributed to both tickets, thank you all, and especially
 Claude for the review.

 Refs #22401.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.4bcde865f672046930604be3d3b927f3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2014-04-26 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Release blocker  | Triage Stage:  Ready for
 Keywords:  rawsql migrations|  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by aaugustin):

 Thanks a lot for the review!

 I don't think the assert on the number on statements is useful. I'll just
 remove it.

 What matters is that each statement creates an object and that 9 objects
 are created.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.4e4703e97178dc379fb8d9dee1b6c918%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2014-04-26 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Release blocker  | Triage Stage:  Ready for
 Keywords:  rawsql migrations|  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by claudep):

 Thanks Aymeric, nice patch!

 There are however test failures in initial_sql_regress, I had to apply
 this:
 {{{
 --- a/tests/initial_sql_regress/tests.py
 +++ b/tests/initial_sql_regress/tests.py
 @@ -27,7 +27,10 @@ class InitialSQLTests(TestCase):
  """
  connection = connections[DEFAULT_DB_ALIAS]
  custom_sql = custom_sql_for_model(Simple, no_style(), connection)
 -self.assertEqual(len(custom_sql), 9)
 +if connection.features.requires_sqlparse_for_splitting:
 +self.assertEqual(len(custom_sql), 9)
 +else:
 +self.assertEqual(len(custom_sql), 1)
  with connection.cursor() as cursor:
  for sql in custom_sql:
  cursor.execute(sql)
 }}}
 Apart from that, I think it's RFC.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.fa925bce3ad5e73ea675af7a80faa016%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2014-04-26 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Release blocker  | Triage Stage:  Ready for
 Keywords:  rawsql migrations|  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by aaugustin):

 * has_patch:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.9c6e0099eb9cec817082144bc7e19ec7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2014-04-26 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Release blocker  | Triage Stage:  Ready for
 Keywords:  rawsql migrations|  checkin
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by aaugustin):

 * stage:  Accepted => Ready for checkin


Comment:

 I think this is good to go: https://github.com/django/django/pull/2608

 I ran the "test_run_sql" test on all four core database backends with and
 without sqlparse. It's skipped in three cases and passes in five cases.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.15e32bbeb5361808f0cbe52849db3d2b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2014-04-26 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Release blocker  | Triage Stage:  Accepted
 Keywords:  rawsql migrations|  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by aaugustin):

 Oracle seems to choke on `\n`:

 {{{
 DatabaseError: ORA-00911: invalid character
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.89010e625f85f24672a8caaac2cdb06a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2014-04-25 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Release blocker  | Triage Stage:  Accepted
 Keywords:  rawsql migrations|  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by aaugustin):

 The fix #22401 was reverted and it was then closed as a duplicate.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.c87616e0d34e10e25b6cad838c07371e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2014-04-12 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Release blocker  | Triage Stage:  Accepted
 Keywords:  rawsql migrations|  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by claudep):

 In my tentative pull request linked in comment:31, I used the approach
 suggested by Russell in comment:19 (a custom backend method).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.be651e443f222c901350f88a6584962b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2014-04-12 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Release blocker  | Triage Stage:  Accepted
 Keywords:  rawsql migrations|  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by aaugustin):

 It would be interesting to avoid the dependency on sqlparse for backends
 that do not need it. Can we introduce a feature flag
 "execute_supports_multiple_statements"?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.e516e8feb7d13ab1911b83eeb4f9343a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2014-04-12 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Release blocker  | Triage Stage:  Accepted
 Keywords:  rawsql migrations|  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by claudep):

 SQLite: needs splitting
 PostgreSQL: does not need splitting
 MySQL: does not need splitting, but has issues when some multiline SQL
 results are not read (`cursor.nextset()` has to be used to "consume"
 results).
 Oracle: ?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.90431fd028a016ca5aa04b45e8c562a6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2014-04-10 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Release blocker  | Triage Stage:  Accepted
 Keywords:  rawsql migrations|  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by aaugustin):

 * keywords:  rawsql => rawsql migrations
 * needs_better_patch:  1 => 0
 * has_patch:  1 => 0
 * severity:  Normal => Release blocker


Comment:

 This ticket never tells which backend support multiple statements in
 `cursor.execute()` and which don't. It would be interesting to check that
 on the four officially supported databases before going any further...

 

 If indeed some backends need splitting, in order to close this ticket, we
 must implement a similar approach as #22401 in `RunSQL._split_sql`.

 Splitting occurs only when explicitly setting `multiple=True`, which
 Django itself never does, even in the test suite. We should add a test for
 that (and skip it when sqlparse isn't available.

 The patch will be easier if we include it in 1.7 because we won't need a
 deprecation path. Therefore, marking as a release blocker.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.11a34233b7e4fe3050e57f0d33b705c4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2014-04-10 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  rawsql   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by wdoekes):

 Assuming sqlparse does the job, this can indeed be closed. Thanks!

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.980afb35d3fa8c2bd89b23a0482f48a1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2014-04-10 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  rawsql   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by aaugustin):

 At least parts of this must have been fixed in #22401, see
 071c9337750b296d198cced56f3ffad0e176afb6.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.99bd6d273216dc66dbdefb5de5bef4f6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2013-09-26 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  rawsql   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by andrewgodwin):

 Yep, this same bug will still apply to the splitter inside RunSQL (though
 I believe it's marginally better than the old Django one).

 timo: Database-specific SQL data will only work with apps without
 migrations; those with migrations are expected to achieve the same result
 using a migration to load in the data, which is much more portable and
 forwards-compatible.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.0680dc2d3f2fe684db7017ed22a09ec4%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2013-09-25 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  rawsql   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by timo):

 How will the migrations framework handle
 [https://docs.djangoproject.com/en/dev/howto/initial-data/#database-
 backend-specific-sql-data Database-backend-specific SQL data]?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.5b21124bbdaf765d8990087ac2dceca4%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2013-09-18 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  rawsql   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by claudep):

 * needs_better_patch:  0 => 1


Comment:

 Repeating Andrew's answer on the pull request:
 `They should go away, there's a RunSQL operation you can use in migrations
 instead (that accepts either single statements or mutiple ones with its
 own internal splitter regex). I didn't get around to removing the support
 for them on syncdb-type apps, but they'll be ignored if you have
 migrations.`

 We should therefore test (sql like
 
[[https://github.com/claudep/django/blob/7ef5f573f0ee3dc615125c8195bde541c764b782/tests/initial_sql_regress/sql/simple.postgresql_psycopg2.sql|this]])
 and document the new process replacing initial sql before closing this
 ticket (or close this ticket and open new one).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.e4399f578f1b8a3e051fe99143b728fa%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2013-09-15 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  rawsql   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by Dmitri Bogomolov <4glitch@…>):

 * cc: 4glitch@… (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.fa571518d9ec017b5ea2e84f196d3603%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2013-09-09 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  rawsql   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by vzima):

 Replying to [comment:32 claudep]:
 > Question raised by Mark on the PR: `With the migrations support, are
 .sql files even needed any more?`
 I have not check the entire migration and south documentation, but what
 about custom restraints, triggers and functions?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.8a53155c73804d54c8a4854645ea1159%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2013-09-09 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  rawsql   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by vzima):

 * cc: vlastimil@… (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.93fbd8b2acc9fed4a835cba9d745338c%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2013-09-08 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  rawsql   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by claudep):

 Question raised by Mark on the PR: `With the migrations support, are .sql
 files even needed any more?`

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.fe1caec4cdd9b84ced3286884d41fbbf%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2013-08-30 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  rawsql   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by claudep):

 * needs_tests:  1 => 0


Comment:

 https://github.com/django/django/pull/1533

 Open for review!

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.7df70e3faf1be601008c4099aa3c7b53%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2013-08-12 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  rawsql   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  1|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by russellm):

 Sure - it will be fixed as soon as someone presents a patch. There's a
 call to action in [#comment:18 Comment 18] and [#comment:19 Comment 19],
 but nobody has presented a patch that implements that approach AFAICT from
 the rest of the ticket discussion.

 If someone wants this, you're going to have to write the patch.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.298136a1014ff1de625b1e2336439482%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2013-08-12 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  rawsql   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  1|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by ris):

 Can we get this fixed at some point please? It seems quite straightforward
 now and it causes daily pain to so many people.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.bf6780b835a3eac46562d7dd4fbe40c6%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2013-08-01 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  rawsql   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  1|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by sbarre):

 * cc: sbarre (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/086.ee08ef6ca63e37eb43bdc25e2f6a863d%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2012-05-15 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
 Reporter:  shaunc  |Owner:  nobody
 Type:  Bug  |   Status:  reopened
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  rawsql   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  1|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by Xof):

 * cc: Xof (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2011-03-18 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
-+-
   Reporter:  shaunc |Owner:  nobody
|Milestone:
 Status:  reopened   |  Version:  SVN
  Component:  Database   | Keywords:  rawsql
  layer (models, ORM)|Has patch:  1
 Resolution: |  Needs tests:  1
   Triage Stage:  Accepted   |
Needs documentation:  0  |
Patch needs improvement:  0  |
-+-
Changes (by vzima):

 * cc: vlastimil.zima@… (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2010-02-25 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
---+
  Reporter:  shaunc   | Owner:  nobody
Status:  reopened  | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:  rawsql
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  1 
Needs_better_patch:  0 |  
---+
Changes (by wdoekes):

 * cc: walter+dja...@wjd.nu (added)

Comment:

 > As a workaround, multi-line SQL statements have to have someting other
 than whitespace between their semicolons and newline characters. For
 example:
 {{{
 > CREATE OR REPLACE FUNCTION create_post () RETURNS trigger AS $$
 >  BEGIN
 >   NEW.date_created := current_timestamp; --
 >   RETURN NEW; --
 >  END;
 > $$ LANGUAGE plpgsql;
 }}}

 Is that a bug or a feature?

 I was about to file this patch because I was getting quite puzzling
 "Command out of sync error"s because I had a bit of comment after a
 statement:
 {{{
 --- django/core/management/sql.py.orig  2010-02-25 12:32:04.660976707
 +0100
 +++ django/core/management/sql.py   2010-02-25 12:38:06.240954572
 +0100
 @@ -174,7 +174,7 @@

  # Some backends can't execute more than one SQL statement at a time,
  # so split into separate statements.
 -statements = re.compile(r";[ \t]*$", re.M)
 +statements = re.compile(r";[ \t]*(?:--.*)?$", re.M)

  # Find custom SQL, if it's available.
  sql_files = [os.path.join(app_dir, "%s.%s.sql" %
 (opts.object_name.lower(), settings.DATABASE_ENGINE)),
 }}}
 But that fix will break your feature.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2010-02-05 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
---+
  Reporter:  shaunc   | Owner:  nobody
Status:  reopened  | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:  rawsql
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  1 
Needs_better_patch:  0 |  
---+
Comment (by shauncutts):

 Replying to [comment:19 russellm]:

 Souunds good to me... -- Thanks, Russell!

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2010-02-05 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
---+
  Reporter:  shaunc   | Owner:  nobody
Status:  reopened  | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:  rawsql
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  1 
Needs_better_patch:  0 |  
---+
Comment (by russellm):

 Caveat - I'm accepting the "run bulk SQL as a single block if possible"
 idea. I'd rather see a 'execute_bulk_sql' call on the DatabaseOperations
 class than a boolean flag. Making it an overridable method on the backend
 means that the regular expressions/splitting technique can be modified on
 a per-backend basis.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2010-02-05 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
---+
  Reporter:  shaunc   | Owner:  nobody
Status:  reopened  | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:  rawsql
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  1 
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * status:  closed => reopened
  * resolution:  wontfix =>
  * stage:  Design decision needed => Accepted

Comment:

 Replying to [comment:17 akaihola]:
 > Replying to [comment:15 aseer...@mit.edu]:
 > > Curious: Does anyone watching this ticket, know offhand which DB
 backends/engines actually don't support multiple statements?  I tend to
 agree with Shaun that the best long-term fix is to add support into the
 lower-level code.
 >
 > I tested PostgreSQL, SQLite and MySQL on Ubuntu 9.04, and SQLite was the
 only one not supporting multiple statements.
 >
 > Would it make sense to add a
 > {{{
 > django.backends.*.DatabaseFeatures.accepts_multiple_statements
 > }}}
 > attribute and do the `statements.split()` dance only when needed?

 Reopening (and accepting) on the basis of this suggestion. This sounds
 workable to me, although it's the python binding version that is
 important, not the database version itself.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #3214: [patch] raw sql file doesn't recognize quotes correctly

2009-10-02 Thread Django
#3214: [patch] raw sql file doesn't recognize quotes correctly
---+
  Reporter:  shaunc   | Owner:  nobody
Status:  closed| Milestone:
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:  wontfix   |  Keywords:  rawsql
 Stage:  Design decision needed| Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  1 
Needs_better_patch:  0 |  
---+
Comment (by akaihola):

 Replying to [comment:15 aseer...@mit.edu]:
 > Curious: Does anyone watching this ticket, know offhand which DB
 backends/engines actually don't support multiple statements?  I tend to
 agree with Shaun that the best long-term fix is to add support into the
 lower-level code.

 I tested PostgreSQL, SQLite and MySQL on Ubuntu 9.04, and SQLite was the
 only one not supporting multiple statements.

 Would it make sense to add a
 {{{
 django.backends.*.DatabaseFeatures.accepts_multiple_statements
 }}}
 attribute and do the `statements.split()` dance only when needed?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---