'begin transaction' new syntax bug?

Started by Fabien COELHOabout 22 years ago5 messageshackers
Jump to latest
#1Fabien COELHO
coelho@cri.ensmp.fr

It seems to me that new 'begin isolation level ...' syntax does not work
with current cvs head:

#
# old syntax:
#
psql> SELECT VERSION();
version
---------------------------------------------------------------------------
PostgreSQL 7.5devel on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.3
(Debian 20040401)

psql> BEGIN;
BEGIN
psql> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SET
psql> SHOW TRANSACTION ISOLATION LEVEL;
transaction_isolation
-----------------------
serializable

#
# new syntax?
#

psql> BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
BEGIN
psql> SHOW TRANSACTION ISOLATION LEVEL;
transaction_isolation
-----------------------
read committed

I would have expected 'serializable' ?

"If the isolation level or read/write mode is specified, the new
transaction has those characteristics, as if SET TRANSACTION was
executed."

--
Fabien Coelho - coelho@cri.ensmp.fr

#2Bruce Momjian
bruce@momjian.us
In reply to: Fabien COELHO (#1)
Re: 'begin transaction' new syntax bug?

Fabien COELHO wrote:

#
# new syntax?
#

psql> BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
BEGIN
psql> SHOW TRANSACTION ISOLATION LEVEL;
transaction_isolation
-----------------------
read committed

OK, fixed:

test=> BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
BEGIN
test=> SHOW TRANSACTION ISOLATION LEVEL;
transaction_isolation
-----------------------
serializable
(1 row)

I added the ability to use such clauses to BEGIN in January for 7.5, but
I never tested it using SHOW. I thought the START TRANSACTION and BEGIN
code would handle the clause code the same, but BEGIN was ignoring it.

Patch attached and applied.

Thanks for the report.

-- 
  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

Attachments:

/bjm/difftext/plainDownload+7-8
#3Bruce Momjian
bruce@momjian.us
In reply to: Fabien COELHO (#1)
Re: 'begin transaction' new syntax bug?

Please ignore the 'bjm' debug code that was part of the patch. It has
been removed from CVS.

-- 
  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
#4Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#3)
Re: 'begin transaction' new syntax bug?

Christopher Kings-Lynne wrote:

char	   *argstring = flatten_set_variable_args(name, args);
+ printf("bjm:  %s %s\n", name, argstring);
+ fflush(stdout);

Did you really mean to include that? :)

Nope, posted a followup that it was removed in a later commit.

-- 
  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
#5Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Bruce Momjian (#2)
Re: 'begin transaction' new syntax bug?
char	   *argstring = flatten_set_variable_args(name, args);
+ printf("bjm:  %s %s\n", name, argstring);
+ fflush(stdout);

Did you really mean to include that? :)

Chris