Fix for error in autocommit off

Поиск
Список
Период
Сортировка
Искать
От
Bruce Momjian
Тема
Fix for error in autocommit off
Дата
Msg-id
200303192024.h2JKOdD07726@candle.pha.pa.us
Список
Дерево обсуждения
Fix for error in autocommit off Bruce Momjian <pgman@candle.pha.pa.us>
Re: Fix for error in autocommit off Tom Lane <tgl@sss.pgh.pa.us>
Re: Fix for error in autocommit off Bruce Momjian <pgman@candle.pha.pa.us>
Re: Fix for error in autocommit off Tom Lane <tgl@sss.pgh.pa.us>
Re: Fix for error in autocommit off Bruce Momjian <pgman@candle.pha.pa.us>
Tom pointed out a problem with our current error handling with
autocommit off:

	SET autocommit TO off;
	lkjasdfasdf;
	SELECT 1;
	COMMIT;

In our current code, SELECT is considred to be in a new transaction. 
This patch fixes that by making the SELECT be part of the aborted
transaction.  Basically we didn't have proper autocommit handling in the
abort function.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/backend/access/transam/xact.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/access/transam/xact.c,v
retrieving revision 1.143
diff -c -c -r1.143 xact.c
*** src/backend/access/transam/xact.c	14 Mar 2003 22:40:31 -0000	1.143
--- src/backend/access/transam/xact.c	19 Mar 2003 20:13:09 -0000
***************
*** 1341,1347 ****
  			 */
  		case TBLOCK_DEFAULT:
  			AbortTransaction();
! 			CleanupTransaction();
  			break;
  
  			/*
--- 1341,1350 ----
  			 */
  		case TBLOCK_DEFAULT:
  			AbortTransaction();
! 			if (autocommit)
! 				CleanupTransaction();
! 			else
! 				s->blockState = TBLOCK_ABORT;
  			break;
  
  			/*
В списке pgsql-hackers по дате отправления
От: Manfred Koizar
Дата:
От: mlw
Дата:
Сообщение: MySQL at .NET conference
FAQ