Re: [Django] #28451: Change in Oracle sequence name truncation causes regression when updating existing database

2017-08-22 Thread Django
#28451: Change in Oracle sequence name truncation causes regression when 
updating
existing database
-+-
 Reporter:  Kevin Grinberg   |Owner:  Kevin
 |  Grinberg
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  oracle   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"90be8cf2a4d81005c5c35074ba763f5fd3a56bd1" 90be8cf2]:
 {{{
 #!CommitTicketReference repository=""
 revision="90be8cf2a4d81005c5c35074ba763f5fd3a56bd1"
 [1.11.x] Fixed #28451 -- Restored pre-Django 1.11 Oracle sequence/trigger
 naming.

 Regression in 69b7d4b116e3b70b250c77829e11038d5d55c2a8.

 Backport of c6a3546093bebae8225a2c5b7e0836a2b0617ee5 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/067.e3dc9a03aacc6febbb7791b62d73a22f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28451: Change in Oracle sequence name truncation causes regression when updating existing database

2017-08-22 Thread Django
#28451: Change in Oracle sequence name truncation causes regression when 
updating
existing database
-+-
 Reporter:  Kevin Grinberg   |Owner:  Kevin
 |  Grinberg
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  oracle   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham ):

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


Comment:

 In [changeset:"c6a3546093bebae8225a2c5b7e0836a2b0617ee5" c6a35460]:
 {{{
 #!CommitTicketReference repository=""
 revision="c6a3546093bebae8225a2c5b7e0836a2b0617ee5"
 Fixed #28451 -- Restored pre-Django 1.11 Oracle sequence/trigger naming.

 Regression in 69b7d4b116e3b70b250c77829e11038d5d55c2a8.
 }}}

-- 
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/067.642b53210b03da77d076a681a4b887ad%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28451: Change in Oracle sequence name truncation causes regression when updating existing database

2017-08-22 Thread Django
#28451: Change in Oracle sequence name truncation causes regression when 
updating
existing database
-+-
 Reporter:  Kevin Grinberg   |Owner:  Kevin
 |  Grinberg
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  oracle   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham):

 We'll put the upgrade script here:
 {{{#!python
 from django.db import connection
 from django.db.backends.utils import strip_quotes, truncate_name

 for seq in connection.introspection.sequence_list():
 name_length = 27
 table, column = seq['table'], seq['column']
 if len(table) >= name_length:
 with connection.cursor() as cursor:
 # 1.11.[1-4] format
 old_sq_name = truncate_name('%s_SQ' % strip_quotes(table),
 name_length).upper()
 # pre-1.11, 1.11.5+
 new_sq_name = '%s_SQ' % truncate_name(strip_quotes(table),
 name_length).upper()
 cursor.execute('SELECT sequence_name FROM user_sequences WHERE
 sequence_name=%s', [old_sq_name])
 row = cursor.fetchone()
 if row:
 cursor.execute('RENAME %s TO %s' % (old_sq_name,
 new_sq_name))
 args = {
 'new_tr_name': '%s_TR' %
 truncate_name(strip_quotes(table), name_length).upper(),
 'tbl_name': table.upper(),
 'sq_name': new_sq_name,
 'col_name': column.upper(),
 }
 old_tr_name = truncate_name('%s_TR' % strip_quotes(table),
 name_length).upper()
 cursor.execute('DROP TRIGGER %s' % old_tr_name)
 trigger_sql = """
 CREATE OR REPLACE TRIGGER "%(new_tr_name)s"
 BEFORE INSERT ON %(tbl_name)s
 FOR EACH ROW
 WHEN (new.%(col_name)s IS NULL)
 BEGIN
 SELECT "%(sq_name)s".nextval
 INTO :new.%(col_name)s FROM dual;
 END;
 /""" % args
 cursor.execute(trigger_sql)
 }}}

-- 
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/067.741e0ea27bf3a5aaad8dfc6d67438700%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28451: Change in Oracle sequence name truncation causes regression when updating existing database

2017-08-13 Thread Django
#28451: Change in Oracle sequence name truncation causes regression when 
updating
existing database
-+-
 Reporter:  Kevin Grinberg   |Owner:  Kevin
 |  Grinberg
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  oracle   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Kevin Grinberg):

 PRs - all tests pass under Oracle (the changes don't touch anything else).

 master: https://github.com/django/django/pull/8898
 backport to 1.11.x: https://github.com/django/django/pull/8899

 NB: The migration script in the backport may be a bit unwieldy to put in
 the release notes, particularly given that it likely affects very few
 people (basically ONLY users who created projects with 1.11, are on
 Oracle, and using use_returning_into=False). Is there a better standard
 place to put these sorts of things?

 I also omitted it from the master release notes, since it looks like we
 drop support for older versions of Oracle and stop relying on triggers
 altogether.

-- 
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/067.8ff4c349d68b47bfa91655be01a6d02c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28451: Change in Oracle sequence name truncation causes regression when updating existing database

2017-08-13 Thread Django
#28451: Change in Oracle sequence name truncation causes regression when 
updating
existing database
-+-
 Reporter:  Kevin Grinberg   |Owner:  Kevin
 |  Grinberg
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  oracle   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Kevin Grinberg):

 * 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/067.224948877b79a0a0da82c8d4ea4e17ea%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28451: Change in Oracle sequence name truncation causes regression when updating existing database

2017-08-12 Thread Django
#28451: Change in Oracle sequence name truncation causes regression when 
updating
existing database
-+-
 Reporter:  Kevin Grinberg   |Owner:  Kevin
 |  Grinberg
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  oracle   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Kevin Grinberg):

 * status:  new => assigned
 * cc: Kevin Grinberg (added)
 * owner:  nobody => Kevin Grinberg


-- 
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/067.edce7322961c70d3784faccb64543d68%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28451: Change in Oracle sequence name truncation causes regression when updating existing database

2017-08-11 Thread Django
#28451: Change in Oracle sequence name truncation causes regression when 
updating
existing database
-+-
 Reporter:  Kevin Grinberg   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  oracle   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Kevin Grinberg):

 Shai/Felix: do you think it's critical to provide a migration script as
 part of the fix?

-- 
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/067.7901b4b8517e9170331cfb3506df61f1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28451: Change in Oracle sequence name truncation causes regression when updating existing database

2017-08-11 Thread Django
#28451: Change in Oracle sequence name truncation causes regression when 
updating
existing database
-+-
 Reporter:  Kevin Grinberg   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  oracle   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Shai Berger):

 * cc: Shai Berger (added)


Comment:

 I concur. Note that the change makes the names shorter than necessary --
 the idea behind using `self.max_name_length() - 3` is to save space for
 the `_SQ` suffix, but the change now includes that suffix in the truncated
 text.

 I also think we should similarly revert the analogous change in trigger
 name truncation. I'm not sure we ever use calculated trigger names after
 the trigger is created, however,
 * if we do, then the same considerations as with sequences apply
 * if we don't, then it's better to have consistent code and use the full
 available name length

-- 
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/067.612e1de08778e9a32014eb3e6e1c3d86%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28451: Change in Oracle sequence name truncation causes regression when updating existing database

2017-07-30 Thread Django
#28451: Change in Oracle sequence name truncation causes regression when 
updating
existing database
-+-
 Reporter:  Kevin Grinberg   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  oracle   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by felixxm):

 * cc: felixxm (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/067.3ed2923880ce2becde407e1d8de5235d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28451: Change in Oracle sequence name truncation causes regression when updating existing database

2017-07-30 Thread Django
#28451: Change in Oracle sequence name truncation causes regression when 
updating
existing database
-+-
 Reporter:  Kevin Grinberg   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  oracle   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by felixxm):

 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted


Comment:

 Oracle backend uses `last_insert_id` only when `use_returning_into` is
 disabled manually in database settings (see
 [https://docs.djangoproject.com/en/1.11/ref/databases/#insert-returning-
 into doc]), otherwise `_get_sequence_name` shouldn't affect insert
 operation. Nevertheless, I think we should revert `_get_sequence_name` and
 `_get_trigger_name` to the previous behavior (with suffixes) and add a
 detailed instruction how to change (recreate) objects with wrong names.

-- 
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/067.c47768f097f1c7ff53ef97b5efb628d4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.