Oracle ORA-01451 handling

66 views
Skip to first unread message

Math

unread,
Jan 31, 2012, 10:46:20 AM1/31/12
to South Users
Hello,

A specific handling of ORA-01442 and ORA-01451 errors is present in
south codebase which restart the query without 'NULL' or 'NOT NULL'
part. This is required because Oracle will fail if it is present but
non necessary.

But a modification has since been added (commit 0918d7a8e839) in the
generic execute() method which catch any DatabaseError, dump a fatal
error and immediately exit. This modification prevents the specific
handling of the above Oracle behaviour.

Two fixes are possible :
- remove the exit on DatabaseError exception in all cases
- add a parameter to the execute() method to not catch DatabaseError

I don't know which fix is preferred.

Regards.
-- Math.

Math

unread,
Feb 2, 2012, 11:13:46 AM2/2/12
to South Users
On Jan 31, 4:46 pm, Math <mla...@gmail.com> wrote:
> A specific handling of ORA-01442 and ORA-01451 errors is present in
> south codebase which restart the query without 'NULL' or 'NOT NULL'
> part. This is required because Oracle will fail if it is present but
> non necessary.
>
> But a modification has since been added (commit 0918d7a8e839) in the
> generic execute() method which catch any DatabaseError, dump a fatal
> error and immediately exit. This modification prevents the specific
> handling of the above Oracle behaviour.

I just found that a ticket is already present for this problem:

http://south.aeracode.org/ticket/949

Regards.
-- Math.

Shai Berger

unread,
Mar 1, 2012, 4:43:52 AM3/1/12
to south...@googlegroups.com, Math, Marc Abramowitz
Hi,

I would like to resolve this ticket. I would also like to say that translating
all databae errors to SystemExit is highly dubious practice.

Fixing this (that is, replacing the "sys.exit(1)" on south.db.generic:258 with
"raise") is one of a few fixes required to bring the Oracle backend back to
passing-all-tests.

The change, to exit instead of reraising, was made by Marc Abramowitz (CC'd)
on 2011-10-04; the only comment on the commit is "Print the error message and
exit instead of reraising exception". Marc (or Andrew, or anyone else), do you
care to comment why this is desired?

Thanks,
Shai.

Andrew Godwin

unread,
Mar 1, 2012, 5:52:51 AM3/1/12
to south...@googlegroups.com
On 01/03/12 09:43, Shai Berger wrote:

>
> The change, to exit instead of reraising, was made by Marc Abramowitz (CC'd)
> on 2011-10-04; the only comment on the commit is "Print the error message and
> exit instead of reraising exception". Marc (or Andrew, or anyone else), do you
> care to comment why this is desired?

I have no idea, I'm afraid; I probably didn't do enough code review on
that commit before I merged it.

Andrew

Reply all
Reply to author
Forward
0 new messages