3839 static PyObject *
3840 PLy_subtransaction_enter(PyObject *self, PyObject *unused)
3841 {
3842 PLySubtransactionData *subxactdata;
3843 MemoryContext oldcontext;
3844 PLySubtransactionObject *subxact = (PLySubtransactionObject *) self;
3845
3846 if (subxact->started)
when considering range: -128 <= value <= -1
taking True path
3847 {
3848 PLy_exception_set(PyExc_ValueError, "this subtransaction has already been entered");
3849 return NULL;
3850 }
3851
3852 if (subxact->exited)
3853 {
3854 PLy_exception_set(PyExc_ValueError, "this subtransaction has already been exited");
3855 return NULL;
3856 }
3857
3858 subxact->started = true;
3859 oldcontext = CurrentMemoryContext;
3860
3861 subxactdata = PLy_malloc(sizeof(*subxactdata));
3862 subxactdata->oldcontext = oldcontext;
3863 subxactdata->oldowner = CurrentResourceOwner;
3864
3865 BeginInternalSubTransaction(NULL);
3866 /* Do not want to leave the previous memory context */
3867 MemoryContextSwitchTo(oldcontext);
3868
3869 explicit_subtransactions = lcons(subxactdata, explicit_subtransactions);
3870
3871 Py_INCREF(self);
3872 return self;
3873 }
returning (PyObject*)NULL without setting an exception
found 3 similar trace(s) to this