You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(28) |
Jun
(12) |
Jul
(11) |
Aug
(12) |
Sep
(5) |
Oct
(19) |
Nov
(14) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(18) |
Feb
(30) |
Mar
(115) |
Apr
(89) |
May
(50) |
Jun
(44) |
Jul
(22) |
Aug
(13) |
Sep
(11) |
Oct
(30) |
Nov
(28) |
Dec
(39) |
2012 |
Jan
(38) |
Feb
(18) |
Mar
(43) |
Apr
(91) |
May
(108) |
Jun
(46) |
Jul
(37) |
Aug
(44) |
Sep
(33) |
Oct
(29) |
Nov
(36) |
Dec
(15) |
2013 |
Jan
(35) |
Feb
(611) |
Mar
(5) |
Apr
(55) |
May
(30) |
Jun
(28) |
Jul
(458) |
Aug
(34) |
Sep
(9) |
Oct
(39) |
Nov
(22) |
Dec
(32) |
2014 |
Jan
(16) |
Feb
(16) |
Mar
(42) |
Apr
(179) |
May
(7) |
Jun
(6) |
Jul
(9) |
Aug
|
Sep
(4) |
Oct
|
Nov
(3) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
(2) |
12
(5) |
13
(3) |
14
|
15
|
16
|
17
|
18
|
19
|
20
(2) |
21
|
22
|
23
|
24
|
25
(1) |
26
(1) |
27
(2) |
28
(2) |
29
|
30
|
31
|
|
|
|
|
|
From: mason_s <ma...@us...> - 2011-01-12 15:28:09
|
Project "Postgres-XC". The branch, master has been updated via 88b9cd684939307f91e3c77e83c8f597642ee69b (commit) from 07a222d11e4cc561e9aeb1edbd1ee2dd68ba2965 (commit) - Log ----------------------------------------------------------------- commit 88b9cd684939307f91e3c77e83c8f597642ee69b Author: Mason Sharp <ma...@us...> Date: Wed Jan 12 10:27:32 2011 -0500 Block the creation of temp tables until properly supported diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index d3506c8..94d820b 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -379,10 +379,17 @@ DefineRelation(CreateStmt *stmt, char relkind) * code. This is needed because calling code might not expect untrusted * tables to appear in pg_temp at the front of its search path. */ +#ifdef PGXC + if (stmt->relation->istemp && IsUnderPostmaster) + ereport(ERROR, + (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), + errmsg("PG-XC does not yet support temporary tables"))); +#else if (stmt->relation->istemp && InSecurityRestrictedOperation()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("cannot create temporary table within security-restricted operation"))); +#endif /* * Look up the namespace in which we are supposed to create the relation. ----------------------------------------------------------------------- Summary of changes: src/backend/commands/tablecmds.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) hooks/post-receive -- Postgres-XC |
From: mason_s <ma...@us...> - 2011-01-12 15:23:36
|
Project "Postgres-XC". The branch, master has been updated via 07a222d11e4cc561e9aeb1edbd1ee2dd68ba2965 (commit) via 032f391616cc3055d197fb2f737f37614bc03f7f (commit) from 9a57b4e60139aa0799f4b6ea3bc6716b2a974022 (commit) - Log ----------------------------------------------------------------- commit 07a222d11e4cc561e9aeb1edbd1ee2dd68ba2965 Author: Mason Sharp <ma...@us...> Date: Wed Jan 12 10:19:57 2011 -0500 Updated regression tests. In Postgres-XC, we cannot be sure of the return order of results, so the tests were updated with ORDER BY added to many SELECT statements. There are still many tests that fail, but this at least gives us a better baseline to more easily find and fix the open bugs. Written by Benny diff --git a/src/test/regress/expected/abstime.out b/src/test/regress/expected/abstime.out index a04f091..2c1f0a9 100644 --- a/src/test/regress/expected/abstime.out +++ b/src/test/regress/expected/abstime.out @@ -43,80 +43,80 @@ LINE 1: INSERT INTO ABSTIME_TBL (f1) VALUES ('bad date format'); ^ INSERT INTO ABSTIME_TBL (f1) VALUES ('Jun 10, 1843'); -- test abstime operators -SELECT '' AS eight, * FROM ABSTIME_TBL; +SELECT '' AS eight, * FROM ABSTIME_TBL ORDER BY f1; eight | f1 -------+------------------------------ + | -infinity + | Sat May 10 23:59:12 1947 PST + | Wed Dec 31 16:00:00 1969 PST | Sun Jan 14 03:14:21 1973 PST | Mon May 01 00:30:30 1995 PDT - | Wed Dec 31 16:00:00 1969 PST | infinity - | -infinity - | Sat May 10 23:59:12 1947 PST | invalid (7 rows) SELECT '' AS six, * FROM ABSTIME_TBL - WHERE ABSTIME_TBL.f1 < abstime 'Jun 30, 2001'; + WHERE ABSTIME_TBL.f1 < abstime 'Jun 30, 2001' ORDER BY f1; six | f1 -----+------------------------------ - | Sun Jan 14 03:14:21 1973 PST - | Mon May 01 00:30:30 1995 PDT - | Wed Dec 31 16:00:00 1969 PST | -infinity | Sat May 10 23:59:12 1947 PST + | Wed Dec 31 16:00:00 1969 PST + | Sun Jan 14 03:14:21 1973 PST + | Mon May 01 00:30:30 1995 PDT (5 rows) SELECT '' AS six, * FROM ABSTIME_TBL - WHERE ABSTIME_TBL.f1 > abstime '-infinity'; + WHERE ABSTIME_TBL.f1 > abstime '-infinity' ORDER BY f1; six | f1 -----+------------------------------ + | Sat May 10 23:59:12 1947 PST + | Wed Dec 31 16:00:00 1969 PST | Sun Jan 14 03:14:21 1973 PST | Mon May 01 00:30:30 1995 PDT - | Wed Dec 31 16:00:00 1969 PST | infinity - | Sat May 10 23:59:12 1947 PST | invalid (6 rows) SELECT '' AS six, * FROM ABSTIME_TBL - WHERE abstime 'May 10, 1947 23:59:12' <> ABSTIME_TBL.f1; + WHERE abstime 'May 10, 1947 23:59:12' <> ABSTIME_TBL.f1 ORDER BY f1; six | f1 -----+------------------------------ + | -infinity + | Wed Dec 31 16:00:00 1969 PST | Sun Jan 14 03:14:21 1973 PST | Mon May 01 00:30:30 1995 PDT - | Wed Dec 31 16:00:00 1969 PST | infinity - | -infinity | invalid (6 rows) SELECT '' AS three, * FROM ABSTIME_TBL - WHERE abstime 'epoch' >= ABSTIME_TBL.f1; + WHERE abstime 'epoch' >= ABSTIME_TBL.f1 ORDER BY f1; three | f1 -------+------------------------------ - | Wed Dec 31 16:00:00 1969 PST | -infinity | Sat May 10 23:59:12 1947 PST + | Wed Dec 31 16:00:00 1969 PST (3 rows) SELECT '' AS four, * FROM ABSTIME_TBL - WHERE ABSTIME_TBL.f1 <= abstime 'Jan 14, 1973 03:14:21'; + WHERE ABSTIME_TBL.f1 <= abstime 'Jan 14, 1973 03:14:21' ORDER BY f1; four | f1 ------+------------------------------ - | Sun Jan 14 03:14:21 1973 PST - | Wed Dec 31 16:00:00 1969 PST | -infinity | Sat May 10 23:59:12 1947 PST + | Wed Dec 31 16:00:00 1969 PST + | Sun Jan 14 03:14:21 1973 PST (4 rows) SELECT '' AS four, * FROM ABSTIME_TBL WHERE ABSTIME_TBL.f1 <?> - tinterval '["Apr 1 1950 00:00:00" "Dec 30 1999 23:00:00"]'; + tinterval '["Apr 1 1950 00:00:00" "Dec 30 1999 23:00:00"]' ORDER BY f1; four | f1 ------+------------------------------ + | Wed Dec 31 16:00:00 1969 PST | Sun Jan 14 03:14:21 1973 PST | Mon May 01 00:30:30 1995 PDT - | Wed Dec 31 16:00:00 1969 PST (3 rows) SELECT '' AS four, f1 AS abstime, diff --git a/src/test/regress/expected/aggregates.out b/src/test/regress/expected/aggregates.out index a48b450..280bda5 100644 --- a/src/test/regress/expected/aggregates.out +++ b/src/test/regress/expected/aggregates.out @@ -277,7 +277,8 @@ SELECT sum2(q1,q2) FROM int8_tbl; -- this should work select ten, sum(distinct four) from onek a group by ten -having exists (select 1 from onek b where sum(distinct a.four) = b.four); +having exists (select 1 from onek b where sum(distinct a.four) = b.four) +order by ten; ten | sum -----+----- 0 | 2 @@ -486,14 +487,15 @@ select min(tenthous) from tenk1 where thousand = 33; -- check parameter propagation into an indexscan subquery select f1, (select min(unique1) from tenk1 where unique1 > f1) AS gt -from int4_tbl; +from int4_tbl +order by f1; f1 | gt -------------+---- + -2147483647 | 0 + -123456 | 0 0 | 1 123456 | - -123456 | 0 2147483647 | - -2147483647 | 0 (5 rows) -- check some cases that were handled incorrectly in 8.3.0 diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out index b14d61f..85af220 100644 --- a/src/test/regress/expected/alter_table.out +++ b/src/test/regress/expected/alter_table.out @@ -138,7 +138,7 @@ ANALYZE tenk1; set enable_seqscan to off; set enable_bitmapscan to off; -- 5 values, sorted -SELECT unique1 FROM tenk1 WHERE unique1 < 5; +SELECT unique1 FROM tenk1 WHERE unique1 < 5 ORDER BY unique1; unique1 --------- 0 @@ -639,13 +639,13 @@ insert into def_test default values; alter table def_test alter column c1 set default 10; alter table def_test alter column c2 set default 'new_default'; insert into def_test default values; -select * from def_test; +select * from def_test order by 1, 2; c1 | c2 ----+----------------- 5 | initial_default + 10 | new_default | initial_default | - 10 | new_default (4 rows) -- set defaults to an incorrect type: this should fail @@ -667,16 +667,16 @@ alter table def_view_test alter column c1 set default 45; insert into def_view_test default values; alter table def_view_test alter column c2 set default 'view_default'; insert into def_view_test default values; -select * from def_view_test; +select * from def_view_test order by 1, 2; c1 | c2 ----+----------------- 5 | initial_default + 10 | new_default + 45 | view_default + 45 | | initial_default | - 10 | new_default | - 45 | - 45 | view_default (7 rows) drop rule def_view_test_ins on def_view_test; @@ -951,7 +951,7 @@ insert into parent values (1, 2, 3); alter table parent drop a; create table child (d varchar(255)) inherits (parent); insert into child values (12, 13, 'testing'); -select * from parent; +select * from parent order by b; b | c ----+---- 2 | 3 @@ -965,7 +965,7 @@ select * from child; (1 row) alter table parent drop c; -select * from parent; +select * from parent order by b; b ---- 2 @@ -993,14 +993,14 @@ ERROR: column "........pg.dropped.1........" of relation "test" does not exist copy test from stdin; ERROR: extra data after last expected column CONTEXT: COPY test, line 1: "10 11 12" -select * from test; +select * from test order by b; b | c ---+--- 2 | 3 (1 row) copy test from stdin; -select * from test; +select * from test order by b; b | c ----+---- 2 | 3 @@ -1012,7 +1012,7 @@ ERROR: column "a" of relation "test" does not exist copy test("........pg.dropped.1........") from stdin; ERROR: column "........pg.dropped.1........" of relation "test" does not exist copy test(b,c) from stdin; -select * from test; +select * from test order by b; b | c ----+---- 2 | 3 @@ -1305,7 +1305,7 @@ insert into p1 values (1,2,'abc'); insert into c1 values(11,'xyz',33,0); -- should fail ERROR: new row for relation "c1" violates check constraint "p1_a1_check" insert into c1 values(11,'xyz',33,22); -select * from p1; +select * from p1 order by f1; f1 | a1 | f2 ----+----+----- 1 | 2 | abc @@ -1313,7 +1313,7 @@ select * from p1; (2 rows) update p1 set a1 = a1 + 1, f2 = upper(f2); -select * from p1; +select * from p1 order by f1; f1 | a1 | f2 ----+----+----- 1 | 3 | ABC @@ -1327,7 +1327,7 @@ NOTICE: drop cascades to table c1 create domain mytype as text; create temp table foo (f1 text, f2 mytype, f3 text); insert into foo values('bb','cc','dd'); -select * from foo; +select * from foo order by f1; f1 | f2 | f3 ----+----+---- bb | cc | dd @@ -1335,14 +1335,14 @@ select * from foo; drop domain mytype cascade; NOTICE: drop cascades to table foo column f2 -select * from foo; +select * from foo order by f1; f1 | f3 ----+---- bb | dd (1 row) insert into foo values('qq','rr'); -select * from foo; +select * from foo order by f1; f1 | f3 ----+---- bb | dd @@ -1350,7 +1350,7 @@ select * from foo; (2 rows) update foo set f3 = 'zz'; -select * from foo; +select * from foo order by f1; f1 | f3 ----+---- bb | zz @@ -1372,7 +1372,7 @@ create table anothertab (atcol1 serial8, atcol2 boolean, NOTICE: CREATE TABLE will create implicit sequence "anothertab_atcol1_seq" for serial column "anothertab.atcol1" insert into anothertab (atcol1, atcol2) values (default, true); insert into anothertab (atcol1, atcol2) values (default, false); -select * from anothertab; +select * from anothertab order by atcol1, atcol2; atcol1 | atcol2 --------+-------- 1 | t @@ -1382,7 +1382,7 @@ select * from anothertab; alter table anothertab alter column atcol1 type boolean; -- fails ERROR: column "atcol1" cannot be cast to type boolean alter table anothertab alter column atcol1 type integer; -select * from anothertab; +select * from anothertab order by atcol1, atcol2; atcol1 | atcol2 --------+-------- 1 | t @@ -1392,7 +1392,7 @@ select * from anothertab; insert into anothertab (atcol1, atcol2) values (45, null); -- fails ERROR: new row for relation "anothertab" violates check constraint "anothertab_chk" insert into anothertab (atcol1, atcol2) values (default, null); -select * from anothertab; +select * from anothertab order by atcol1, atcol2; atcol1 | atcol2 --------+-------- 1 | t @@ -1404,7 +1404,7 @@ alter table anothertab alter column atcol2 type text using case when atcol2 is true then 'IT WAS TRUE' when atcol2 is false then 'IT WAS FALSE' else 'IT WAS NULL!' end; -select * from anothertab; +select * from anothertab order by atcol1, atcol2; atcol1 | atcol2 --------+-------------- 1 | IT WAS TRUE @@ -1423,12 +1423,12 @@ HINT: No operator matches the given name and argument type(s). You might need t alter table anothertab drop constraint anothertab_chk; alter table anothertab alter column atcol1 type boolean using case when atcol1 % 2 = 0 then true else false end; -select * from anothertab; +select * from anothertab order by atcol1, atcol2; atcol1 | atcol2 --------+-------------- + f | IT WAS NULL! f | IT WAS TRUE t | IT WAS FALSE - f | IT WAS NULL! (3 rows) drop table anothertab; @@ -1436,7 +1436,7 @@ create table another (f1 int, f2 text); insert into another values(1, 'one'); insert into another values(2, 'two'); insert into another values(3, 'three'); -select * from another; +select * from another order by f1, f2; f1 | f2 ----+------- 1 | one @@ -1447,12 +1447,12 @@ select * from another; alter table another alter f1 type text using f2 || ' more', alter f2 type bigint using f1 * 10; -select * from another; +select * from another order by f1, f2; f1 | f2 ------------+---- one more | 10 - two more | 20 three more | 30 + two more | 20 (3 rows) drop table another; @@ -1514,7 +1514,7 @@ alter type alter1.ctype set schema alter2; drop schema alter1; insert into alter2.t1(f2) values(13); insert into alter2.t1(f2) values(14); -select * from alter2.t1; +select * from alter2.t1 order by f1, f2; f1 | f2 ----+---- 1 | 11 @@ -1523,7 +1523,7 @@ select * from alter2.t1; 4 | 14 (4 rows) -select * from alter2.v1; +select * from alter2.v1 order by f1, f2; f1 | f2 ----+---- 1 | 11 diff --git a/src/test/regress/expected/arrays.out b/src/test/regress/expected/arrays.out index 03c32a5..272a621 100644 --- a/src/test/regress/expected/arrays.out +++ b/src/test/regress/expected/arrays.out @@ -26,12 +26,12 @@ INSERT INTO arrtest (a, b[1:2][1:2], c, d, e, f, g) '{"abc","abcde"}', '{"abc","abcde"}'); INSERT INTO arrtest (a, b[1:2], c, d[1:2]) VALUES ('{}', '{3,4}', '{foo,bar}', '{bar,foo}'); -SELECT * FROM arrtest; +SELECT * FROM arrtest ORDER BY a, b, c; a | b | c | d | e | f | g -------------+-----------------+-----------+---------------+-----------------+-----------------+------------- + {} | {3,4} | {foo,bar} | {bar,foo} | | | {1,2,3,4,5} | {{{0,0},{1,2}}} | {} | {} | [0:1]={1.1,2.2} | {} | {} {11,12,23} | {{3,4},{4,5}} | {foobar} | {{elt1,elt2}} | {3.4,6.7} | {"abc ",abcde} | {abc,abcde} - {} | {3,4} | {foo,bar} | {bar,foo} | | | (3 rows) SELECT arrtest.a[1], @@ -39,7 +39,8 @@ SELECT arrtest.a[1], arrtest.c[1], arrtest.d[1][1], arrtest.e[0] - FROM arrtest; + FROM arrtest + ORDER BY a, b, c; a | b | c | d | e ----+---+--------+------+----- 1 | 0 | | | 1.1 @@ -48,7 +49,8 @@ SELECT arrtest.a[1], (3 rows) SELECT a[1], b[1][1][1], c[1], d[1][1], e[0] - FROM arrtest; + FROM arrtest + ORDER BY a, b, c; a | b | c | d | e ----+---+--------+------+----- 1 | 0 | | | 1.1 @@ -60,30 +62,33 @@ SELECT a[1:3], b[1:1][1:2][1:2], c[1:2], d[1:1][1:2] - FROM arrtest; + FROM arrtest + ORDER BY a, b, c; a | b | c | d ------------+-----------------+-----------+--------------- + {} | {} | {foo,bar} | {} {1,2,3} | {{{0,0},{1,2}}} | {} | {} {11,12,23} | {} | {foobar} | {{elt1,elt2}} - {} | {} | {foo,bar} | {} (3 rows) SELECT array_ndims(a) AS a,array_ndims(b) AS b,array_ndims(c) AS c - FROM arrtest; + FROM arrtest + ORDER BY b; a | b | c ---+---+--- - 1 | 3 | - 1 | 2 | 1 | 1 | 1 + 1 | 2 | 1 + 1 | 3 | (3 rows) SELECT array_dims(a) AS a,array_dims(b) AS b,array_dims(c) AS c - FROM arrtest; + FROM arrtest + ORDER BY b; a | b | c -------+-----------------+------- [1:5] | [1:1][1:2][1:2] | - [1:3] | [1:2][1:2] | [1:1] | [1:2] | [1:2] + [1:3] | [1:2][1:2] | [1:1] (3 rows) -- returns nothing @@ -105,11 +110,11 @@ UPDATE arrtest UPDATE arrtest SET c[2:2] = '{"new_word"}' WHERE array_dims(c) is not null; -SELECT a,b,c FROM arrtest; +SELECT a,b,c FROM arrtest ORDER BY a, b, c; a | b | c ---------------+-----------------------+------------------- - {16,25,3,4,5} | {{{113,142},{1,147}}} | {} {} | {3,4} | {foo,new_word} + {16,25,3,4,5} | {{{113,142},{1,147}}} | {} {16,25,23} | {{3,4},{4,5}} | {foobar,new_word} (3 rows) @@ -117,34 +122,35 @@ SELECT a[1:3], b[1:1][1:2][1:2], c[1:2], d[1:1][2:2] - FROM arrtest; + FROM arrtest + ORDER BY a, b, c; a | b | c | d ------------+-----------------------+-------------------+---------- - {16,25,3} | {{{113,142},{1,147}}} | {} | {} {} | {} | {foo,new_word} | {} + {16,25,3} | {{{113,142},{1,147}}} | {} | {} {16,25,23} | {} | {foobar,new_word} | {{elt2}} (3 rows) INSERT INTO arrtest(a) VALUES('{1,null,3}'); -SELECT a FROM arrtest; +SELECT a FROM arrtest ORDER BY 1; a --------------- - {16,25,3,4,5} {} - {16,25,23} {1,NULL,3} + {16,25,3,4,5} + {16,25,23} (4 rows) UPDATE arrtest SET a[4] = NULL WHERE a[2] IS NULL; -SELECT a FROM arrtest WHERE a[2] IS NULL; +SELECT a FROM arrtest WHERE a[2] IS NULL ORDER BY 1; a ----------------- - [4:4]={NULL} {1,NULL,3,NULL} + [4:4]={NULL} (2 rows) DELETE FROM arrtest WHERE a[2] IS NULL AND b IS NULL; -SELECT a,b,c FROM arrtest; +SELECT a,b,c FROM arrtest ORDER BY a, b, c; a | b | c ---------------+-----------------------+------------------- {16,25,3,4,5} | {{{113,142},{1,147}}} | {} @@ -718,14 +724,14 @@ insert into arr_tbl values ('{1,5,3}'); insert into arr_tbl values ('{1,2,10}'); set enable_seqscan to off; set enable_bitmapscan to off; -select * from arr_tbl where f1 > '{1,2,3}' and f1 <= '{1,5,3}'; +select * from arr_tbl where f1 > '{1,2,3}' and f1 <= '{1,5,3}' ORDER BY 1; f1 ---------- {1,2,10} {1,5,3} (2 rows) -select * from arr_tbl where f1 >= '{1,2,3}' and f1 < '{1,5,3}'; +select * from arr_tbl where f1 >= '{1,2,3}' and f1 < '{1,5,3}' ORDER BY 1; f1 ---------- {1,2,3} diff --git a/src/test/regress/expected/bit.out b/src/test/regress/expected/bit.out index 3563d23..28bea52 100644 --- a/src/test/regress/expected/bit.out +++ b/src/test/regress/expected/bit.out @@ -14,12 +14,12 @@ INSERT INTO BIT_TABLE VALUES (B'101011111010'); -- too long ERROR: bit string length 12 does not match type bit(11) --INSERT INTO BIT_TABLE VALUES ('X554'); --INSERT INTO BIT_TABLE VALUES ('X555'); -SELECT * FROM BIT_TABLE; +SELECT * FROM BIT_TABLE ORDER BY b; b ------------- 00000000000 - 11011000000 01010101010 + 11011000000 (3 rows) CREATE TABLE VARBIT_TABLE(v BIT VARYING(11)); @@ -31,7 +31,7 @@ INSERT INTO VARBIT_TABLE VALUES (B'101011111010'); -- too long ERROR: bit string too long for type bit varying(11) --INSERT INTO VARBIT_TABLE VALUES ('X554'); --INSERT INTO VARBIT_TABLE VALUES ('X555'); -SELECT * FROM VARBIT_TABLE; +SELECT * FROM VARBIT_TABLE ORDER BY v; v ------------- @@ -62,16 +62,16 @@ SELECT v, b, (v || b) AS concat -- Length SELECT b, length(b) AS lb - FROM BIT_TABLE; + FROM BIT_TABLE ORDER BY b; b | lb -------------+---- 00000000000 | 11 - 11011000000 | 11 01010101010 | 11 + 11011000000 | 11 (3 rows) SELECT v, length(v) AS lv - FROM VARBIT_TABLE; + FROM VARBIT_TABLE ORDER BY v; v | lv -------------+---- | 0 @@ -85,19 +85,19 @@ SELECT b, SUBSTRING(b FROM 2 FOR 4) AS sub_2_4, SUBSTRING(b FROM 7 FOR 13) AS sub_7_13, SUBSTRING(b FROM 6) AS sub_6 - FROM BIT_TABLE; + FROM BIT_TABLE ORDER BY b; b | sub_2_4 | sub_7_13 | sub_6 -------------+---------+----------+-------- 00000000000 | 0000 | 00000 | 000000 - 11011000000 | 1011 | 00000 | 000000 01010101010 | 1010 | 01010 | 101010 + 11011000000 | 1011 | 00000 | 000000 (3 rows) SELECT v, SUBSTRING(v FROM 2 FOR 4) AS sub_2_4, SUBSTRING(v FROM 7 FOR 13) AS sub_7_13, SUBSTRING(v FROM 6) AS sub_6 - FROM VARBIT_TABLE; + FROM VARBIT_TABLE ORDER BY v; v | sub_2_4 | sub_7_13 | sub_6 -------------+---------+----------+-------- | | | @@ -111,50 +111,50 @@ DROP TABLE varbit_table; CREATE TABLE varbit_table (a BIT VARYING(16), b BIT VARYING(16)); COPY varbit_table FROM stdin; SELECT a, b, ~a AS "~ a", a & b AS "a & b", - a | b AS "a | b", a # b AS "a # b" FROM varbit_table; + a | b AS "a | b", a # b AS "a # b" FROM varbit_table ORDER BY a,b; a | b | ~ a | a & b | a | b | a # b ------------------+------------------+------------------+------------------+------------------+------------------ + 0000000000001111 | 0000000000010000 | 1111111111110000 | 0000000000000000 | 0000000000011111 | 0000000000011111 + 0000000100100011 | 1111111111111111 | 1111111011011100 | 0000000100100011 | 1111111111111111 | 1111111011011100 00001111 | 00010000 | 11110000 | 00000000 | 00011111 | 00011111 + 0001001000110100 | 1111111111110101 | 1110110111001011 | 0001001000110100 | 1111111111110101 | 1110110111000001 00011111 | 00010001 | 11100000 | 00010001 | 00011111 | 00001110 + 0010010001101000 | 0010010001101000 | 1101101110010111 | 0010010001101000 | 0010010001101000 | 0000000000000000 00101111 | 00010010 | 11010000 | 00000010 | 00111111 | 00111101 00111111 | 00010011 | 11000000 | 00010011 | 00111111 | 00101100 10001111 | 00000100 | 01110000 | 00000100 | 10001111 | 10001011 - 0000000000001111 | 0000000000010000 | 1111111111110000 | 0000000000000000 | 0000000000011111 | 0000000000011111 - 0000000100100011 | 1111111111111111 | 1111111011011100 | 0000000100100011 | 1111111111111111 | 1111111011011100 - 0010010001101000 | 0010010001101000 | 1101101110010111 | 0010010001101000 | 0010010001101000 | 0000000000000000 1111101001010000 | 0000010110101111 | 0000010110101111 | 0000000000000000 | 1111111111111111 | 1111111111111111 - 0001001000110100 | 1111111111110101 | 1110110111001011 | 0001001000110100 | 1111111111110101 | 1110110111000001 (10 rows) SELECT a,b,a<b AS "a<b",a<=b AS "a<=b",a=b AS "a=b", - a>=b AS "a>=b",a>b AS "a>b",a<>b AS "a<>b" FROM varbit_table; + a>=b AS "a>=b",a>b AS "a>b",a<>b AS "a<>b" FROM varbit_table ORDER BY a,b; a | b | a<b | a<=b | a=b | a>=b | a>b | a<>b ------------------+------------------+-----+------+-----+------+-----+------ + 0000000000001111 | 0000000000010000 | t | t | f | f | f | t + 0000000100100011 | 1111111111111111 | t | t | f | f | f | t 00001111 | 00010000 | t | t | f | f | f | t + 0001001000110100 | 1111111111110101 | t | t | f | f | f | t 00011111 | 00010001 | f | f | f | t | t | t + 0010010001101000 | 0010010001101000 | f | t | t | t | f | f 00101111 | 00010010 | f | f | f | t | t | t 00111111 | 00010011 | f | f | f | t | t | t 10001111 | 00000100 | f | f | f | t | t | t - 0000000000001111 | 0000000000010000 | t | t | f | f | f | t - 0000000100100011 | 1111111111111111 | t | t | f | f | f | t - 0010010001101000 | 0010010001101000 | f | t | t | t | f | f 1111101001010000 | 0000010110101111 | f | f | f | t | t | t - 0001001000110100 | 1111111111110101 | t | t | f | f | f | t (10 rows) -SELECT a,a<<4 AS "a<<4",b,b>>2 AS "b>>2" FROM varbit_table; +SELECT a,a<<4 AS "a<<4",b,b>>2 AS "b>>2" FROM varbit_table ORDER BY a,b; a | a<<4 | b | b>>2 ------------------+------------------+------------------+------------------ + 0000000000001111 | 0000000011110000 | 0000000000010000 | 0000000000000100 + 0000000100100011 | 0001001000110000 | 1111111111111111 | 0011111111111111 00001111 | 11110000 | 00010000 | 00000100 + 0001001000110100 | 0010001101000000 | 1111111111110101 | 0011111111111101 00011111 | 11110000 | 00010001 | 00000100 + 0010010001101000 | 0100011010000000 | 0010010001101000 | 0000100100011010 00101111 | 11110000 | 00010010 | 00000100 00111111 | 11110000 | 00010011 | 00000100 10001111 | 11110000 | 00000100 | 00000001 - 0000000000001111 | 0000000011110000 | 0000000000010000 | 0000000000000100 - 0000000100100011 | 0001001000110000 | 1111111111111111 | 0011111111111111 - 0010010001101000 | 0100011010000000 | 0010010001101000 | 0000100100011010 1111101001010000 | 1010010100000000 | 0000010110101111 | 0000000101101011 - 0001001000110100 | 0010001101000000 | 1111111111110101 | 0011111111111101 (10 rows) DROP TABLE varbit_table; @@ -163,50 +163,50 @@ DROP TABLE bit_table; CREATE TABLE bit_table (a BIT(16), b BIT(16)); COPY bit_table FROM stdin; SELECT a,b,~a AS "~ a",a & b AS "a & b", - a|b AS "a | b", a # b AS "a # b" FROM bit_table; + a|b AS "a | b", a # b AS "a # b" FROM bit_table ORDER BY a,b; a | b | ~ a | a & b | a | b | a # b ------------------+------------------+------------------+------------------+------------------+------------------ + 0000000000001111 | 0000000000010000 | 1111111111110000 | 0000000000000000 | 0000000000011111 | 0000000000011111 + 0000000100100011 | 1111111111111111 | 1111111011011100 | 0000000100100011 | 1111111111111111 | 1111111011011100 0000111100000000 | 0001000000000000 | 1111000011111111 | 0000000000000000 | 0001111100000000 | 0001111100000000 + 0001001000110100 | 1111111111110101 | 1110110111001011 | 0001001000110100 | 1111111111110101 | 1110110111000001 0001111100000000 | 0001000100000000 | 1110000011111111 | 0001000100000000 | 0001111100000000 | 0000111000000000 + 0010010001101000 | 0010010001101000 | 1101101110010111 | 0010010001101000 | 0010010001101000 | 0000000000000000 0010111100000000 | 0001001000000000 | 1101000011111111 | 0000001000000000 | 0011111100000000 | 0011110100000000 0011111100000000 | 0001001100000000 | 1100000011111111 | 0001001100000000 | 0011111100000000 | 0010110000000000 1000111100000000 | 0000010000000000 | 0111000011111111 | 0000010000000000 | 1000111100000000 | 1000101100000000 - 0000000000001111 | 0000000000010000 | 1111111111110000 | 0000000000000000 | 0000000000011111 | 0000000000011111 - 0000000100100011 | 1111111111111111 | 1111111011011100 | 0000000100100011 | 1111111111111111 | 1111111011011100 - 0010010001101000 | 0010010001101000 | 1101101110010111 | 0010010001101000 | 0010010001101000 | 0000000000000000 1111101001010000 | 0000010110101111 | 0000010110101111 | 0000000000000000 | 1111111111111111 | 1111111111111111 - 0001001000110100 | 1111111111110101 | 1110110111001011 | 0001001000110100 | 1111111111110101 | 1110110111000001 (10 rows) SELECT a,b,a<b AS "a<b",a<=b AS "a<=b",a=b AS "a=b", - a>=b AS "a>=b",a>b AS "a>b",a<>b AS "a<>b" FROM bit_table; + a>=b AS "a>=b",a>b AS "a>b",a<>b AS "a<>b" FROM bit_table ORDER BY a,b; a | b | a<b | a<=b | a=b | a>=b | a>b | a<>b ------------------+------------------+-----+------+-----+------+-----+------ + 0000000000001111 | 0000000000010000 | t | t | f | f | f | t + 0000000100100011 | 1111111111111111 | t | t | f | f | f | t 0000111100000000 | 0001000000000000 | t | t | f | f | f | t + 0001001000110100 | 1111111111110101 | t | t | f | f | f | t 0001111100000000 | 0001000100000000 | f | f | f | t | t | t + 0010010001101000 | 0010010001101000 | f | t | t | t | f | f 0010111100000000 | 0001001000000000 | f | f | f | t | t | t 0011111100000000 | 0001001100000000 | f | f | f | t | t | t 1000111100000000 | 0000010000000000 | f | f | f | t | t | t - 0000000000001111 | 0000000000010000 | t | t | f | f | f | t - 0000000100100011 | 1111111111111111 | t | t | f | f | f | t - 0010010001101000 | 0010010001101000 | f | t | t | t | f | f 1111101001010000 | 0000010110101111 | f | f | f | t | t | t - 0001001000110100 | 1111111111110101 | t | t | f | f | f | t (10 rows) -SELECT a,a<<4 AS "a<<4",b,b>>2 AS "b>>2" FROM bit_table; +SELECT a,a<<4 AS "a<<4",b,b>>2 AS "b>>2" FROM bit_table ORDER BY a,b; a | a<<4 | b | b>>2 ------------------+------------------+------------------+------------------ + 0000000000001111 | 0000000011110000 | 0000000000010000 | 0000000000000100 + 0000000100100011 | 0001001000110000 | 1111111111111111 | 0011111111111111 0000111100000000 | 1111000000000000 | 0001000000000000 | 0000010000000000 + 0001001000110100 | 0010001101000000 | 1111111111110101 | 0011111111111101 0001111100000000 | 1111000000000000 | 0001000100000000 | 0000010001000000 + 0010010001101000 | 0100011010000000 | 0010010001101000 | 0000100100011010 0010111100000000 | 1111000000000000 | 0001001000000000 | 0000010010000000 0011111100000000 | 1111000000000000 | 0001001100000000 | 0000010011000000 1000111100000000 | 1111000000000000 | 0000010000000000 | 0000000100000000 - 0000000000001111 | 0000000011110000 | 0000000000010000 | 0000000000000100 - 0000000100100011 | 0001001000110000 | 1111111111111111 | 0011111111111111 - 0010010001101000 | 0100011010000000 | 0010010001101000 | 0000100100011010 1111101001010000 | 1010010100000000 | 0000010110101111 | 0000000101101011 - 0001001000110100 | 0010001101000000 | 1111111111110101 | 0011111111111101 (10 rows) DROP TABLE bit_table; @@ -456,25 +456,25 @@ INSERT INTO BIT_SHIFT_TABLE SELECT b>>8 FROM BIT_SHIFT_TABLE; SELECT POSITION(B'1101' IN b), POSITION(B'11011' IN b), b - FROM BIT_SHIFT_TABLE ; + FROM BIT_SHIFT_TABLE ORDER BY b; position | position | b ----------+----------+------------------ - 1 | 1 | 1101100000000000 - 2 | 2 | 0110110000000000 - 3 | 3 | 0011011000000000 - 4 | 4 | 0001101100000000 - 5 | 5 | 0000110110000000 - 6 | 6 | 0000011011000000 - 7 | 7 | 0000001101100000 - 8 | 8 | 0000000110110000 - 9 | 9 | 0000000011011000 - 10 | 10 | 0000000001101100 - 11 | 11 | 0000000000110110 - 12 | 12 | 0000000000011011 - 13 | 0 | 0000000000001101 - 0 | 0 | 0000000000000110 - 0 | 0 | 0000000000000011 0 | 0 | 0000000000000001 + 0 | 0 | 0000000000000011 + 0 | 0 | 0000000000000110 + 13 | 0 | 0000000000001101 + 12 | 12 | 0000000000011011 + 11 | 11 | 0000000000110110 + 10 | 10 | 0000000001101100 + 9 | 9 | 0000000011011000 + 8 | 8 | 0000000110110000 + 7 | 7 | 0000001101100000 + 6 | 6 | 0000011011000000 + 5 | 5 | 0000110110000000 + 4 | 4 | 0001101100000000 + 3 | 3 | 0011011000000000 + 2 | 2 | 0110110000000000 + 1 | 1 | 1101100000000000 (16 rows) CREATE TABLE VARBIT_SHIFT_TABLE(v BIT VARYING(20)); @@ -486,25 +486,25 @@ INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'00000000' AS BIT VARYING(20)) SELECT POSITION(B'1101' IN v), POSITION(B'11011' IN v), v - FROM VARBIT_SHIFT_TABLE ; + FROM VARBIT_SHIFT_TABLE ORDER BY v; position | position | v ----------+----------+---------------------- - 1 | 1 | 11011 - 2 | 2 | 011011 - 3 | 3 | 0011011 - 4 | 4 | 00011011 - 5 | 5 | 000011011 - 6 | 6 | 0000011011 - 7 | 7 | 00000011011 - 8 | 8 | 000000011011 - 9 | 9 | 0000000011011 - 10 | 10 | 00000000011011 - 11 | 11 | 000000000011011 - 12 | 12 | 0000000000011011 - 13 | 13 | 00000000000011011 - 14 | 14 | 000000000000011011 - 15 | 15 | 0000000000000011011 16 | 16 | 00000000000000011011 + 15 | 15 | 0000000000000011011 + 14 | 14 | 000000000000011011 + 13 | 13 | 00000000000011011 + 12 | 12 | 0000000000011011 + 11 | 11 | 000000000011011 + 10 | 10 | 00000000011011 + 9 | 9 | 0000000011011 + 8 | 8 | 000000011011 + 7 | 7 | 00000011011 + 6 | 6 | 0000011011 + 5 | 5 | 000011011 + 4 | 4 | 00011011 + 3 | 3 | 0011011 + 2 | 2 | 011011 + 1 | 1 | 11011 (16 rows) DROP TABLE BIT_SHIFT_TABLE; diff --git a/src/test/regress/expected/box.out b/src/test/regress/expected/box.out index 2a94e33..097bb4b 100644 --- a/src/test/regress/expected/box.out +++ b/src/test/regress/expected/box.out @@ -41,30 +41,30 @@ SELECT '' AS four, * FROM BOX_TBL; (4 rows) SELECT '' AS four, b.*, area(b.f1) as barea - FROM BOX_TBL b; + FROM BOX_TBL b ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; four | f1 | barea ------+---------------------+------- | (2,2),(0,0) | 4 - | (3,3),(1,1) | 4 | (2.5,3.5),(2.5,2.5) | 0 + | (3,3),(1,1) | 4 | (3,3),(3,3) | 0 (4 rows) -- overlap SELECT '' AS three, b.f1 FROM BOX_TBL b - WHERE b.f1 && box '(2.5,2.5,1.0,1.0)'; + WHERE b.f1 && box '(2.5,2.5,1.0,1.0)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; three | f1 -------+--------------------- | (2,2),(0,0) - | (3,3),(1,1) | (2.5,3.5),(2.5,2.5) + | (3,3),(1,1) (3 rows) -- left-or-overlap (x only) SELECT '' AS two, b1.* FROM BOX_TBL b1 - WHERE b1.f1 &< box '(2.0,2.0,2.5,2.5)'; + WHERE b1.f1 &< box '(2.0,2.0,2.5,2.5)' ORDER BY (b1.f1[0])[0], (b1.f1[0])[1], (b1.f1[2])[0], (b1.f1[2])[1]; two | f1 -----+--------------------- | (2,2),(0,0) @@ -74,7 +74,7 @@ SELECT '' AS two, b1.* -- right-or-overlap (x only) SELECT '' AS two, b1.* FROM BOX_TBL b1 - WHERE b1.f1 &> box '(2.0,2.0,2.5,2.5)'; + WHERE b1.f1 &> box '(2.0,2.0,2.5,2.5)' ORDER BY (b1.f1[0])[0], (b1.f1[0])[1], (b1.f1[2])[0], (b1.f1[2])[1]; two | f1 -----+--------------------- | (2.5,3.5),(2.5,2.5) @@ -84,7 +84,7 @@ SELECT '' AS two, b1.* -- left of SELECT '' AS two, b.f1 FROM BOX_TBL b - WHERE b.f1 << box '(3.0,3.0,5.0,5.0)'; + WHERE b.f1 << box '(3.0,3.0,5.0,5.0)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; two | f1 -----+--------------------- | (2,2),(0,0) @@ -94,19 +94,19 @@ SELECT '' AS two, b.f1 -- area <= SELECT '' AS four, b.f1 FROM BOX_TBL b - WHERE b.f1 <= box '(3.0,3.0,5.0,5.0)'; + WHERE b.f1 <= box '(3.0,3.0,5.0,5.0)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; four | f1 ------+--------------------- | (2,2),(0,0) - | (3,3),(1,1) | (2.5,3.5),(2.5,2.5) + | (3,3),(1,1) | (3,3),(3,3) (4 rows) -- area < SELECT '' AS two, b.f1 FROM BOX_TBL b - WHERE b.f1 < box '(3.0,3.0,5.0,5.0)'; + WHERE b.f1 < box '(3.0,3.0,5.0,5.0)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; two | f1 -----+--------------------- | (2.5,3.5),(2.5,2.5) @@ -116,7 +116,7 @@ SELECT '' AS two, b.f1 -- area = SELECT '' AS two, b.f1 FROM BOX_TBL b - WHERE b.f1 = box '(3.0,3.0,5.0,5.0)'; + WHERE b.f1 = box '(3.0,3.0,5.0,5.0)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; two | f1 -----+------------- | (2,2),(0,0) @@ -126,7 +126,7 @@ SELECT '' AS two, b.f1 -- area > SELECT '' AS two, b.f1 FROM BOX_TBL b -- zero area - WHERE b.f1 > box '(3.5,3.0,4.5,3.0)'; + WHERE b.f1 > box '(3.5,3.0,4.5,3.0)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; two | f1 -----+------------- | (2,2),(0,0) @@ -136,19 +136,19 @@ SELECT '' AS two, b.f1 -- area >= SELECT '' AS four, b.f1 FROM BOX_TBL b -- zero area - WHERE b.f1 >= box '(3.5,3.0,4.5,3.0)'; + WHERE b.f1 >= box '(3.5,3.0,4.5,3.0)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; four | f1 ------+--------------------- | (2,2),(0,0) - | (3,3),(1,1) | (2.5,3.5),(2.5,2.5) + | (3,3),(1,1) | (3,3),(3,3) (4 rows) -- right of SELECT '' AS two, b.f1 FROM BOX_TBL b - WHERE box '(3.0,3.0,5.0,5.0)' >> b.f1; + WHERE box '(3.0,3.0,5.0,5.0)' >> b.f1 ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; two | f1 -----+--------------------- | (2,2),(0,0) @@ -158,7 +158,7 @@ SELECT '' AS two, b.f1 -- contained in SELECT '' AS three, b.f1 FROM BOX_TBL b - WHERE b.f1 <@ box '(0,0,3,3)'; + WHERE b.f1 <@ box '(0,0,3,3)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; three | f1 -------+------------- | (2,2),(0,0) @@ -169,7 +169,7 @@ SELECT '' AS three, b.f1 -- contains SELECT '' AS three, b.f1 FROM BOX_TBL b - WHERE box '(0,0,3,3)' @> b.f1; + WHERE box '(0,0,3,3)' @> b.f1 ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; three | f1 -------+------------- | (2,2),(0,0) @@ -180,7 +180,7 @@ SELECT '' AS three, b.f1 -- box equality SELECT '' AS one, b.f1 FROM BOX_TBL b - WHERE box '(1,1,3,3)' ~= b.f1; + WHERE box '(1,1,3,3)' ~= b.f1 ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; one | f1 -----+------------- | (3,3),(1,1) @@ -188,30 +188,31 @@ SELECT '' AS one, b.f1 -- center of box, left unary operator SELECT '' AS four, @@(b1.f1) AS p - FROM BOX_TBL b1; + FROM BOX_TBL b1 ORDER BY (b1.f1[0])[0], (b1.f1[0])[1], (b1.f1[2])[0], (b1.f1[2])[1]; four | p ------+--------- | (1,1) - | (2,2) | (2.5,3) + | (2,2) | (3,3) (4 rows) -- wholly-contained SELECT '' AS one, b1.*, b2.* FROM BOX_TBL b1, BOX_TBL b2 - WHERE b1.f1 @> b2.f1 and not b1.f1 ~= b2.f1; + WHERE b1.f1 @> b2.f1 and not b1.f1 ~= b2.f1 + ORDER BY (b1.f1[0])[0], (b1.f1[0])[1], (b1.f1[2])[0], (b1.f1[2])[1], (b2.f1[0])[0], (b2.f1[0])[1], (b2.f1[2])[0], (b2.f1[2])[1]; one | f1 | f1 -----+-------------+------------- | (3,3),(1,1) | (3,3),(3,3) (1 row) -SELECT '' AS four, height(f1), width(f1) FROM BOX_TBL; +SELECT '' AS four, height(f1), width(f1) FROM BOX_TBL ORDER BY (f1[0])[0], (f1[0])[1], (f1[2])[0], (f1[2])[1]; four | height | width ------+--------+------- | 2 | 2 - | 2 | 2 | 1 | 0 + | 2 | 2 | 0 | 0 (4 rows) diff --git a/src/test/regress/expected/case.out b/src/test/regress/expected/case.out index 9ec32b8..6dd98ed 100644 --- a/src/test/regress/expected/case.out +++ b/src/test/regress/expected/case.out @@ -103,20 +103,22 @@ SELECT '' AS "Five", CASE WHEN i >= 3 THEN i END AS ">= 3 or Null" - FROM CASE_TBL; + FROM CASE_TBL + ORDER BY 2; Five | >= 3 or Null ------+-------------- - | - | | 3 | 4 + | + | (4 rows) SELECT '' AS "Five", CASE WHEN i >= 3 THEN (i + i) ELSE i END AS "Simplest Math" - FROM CASE_TBL; + FROM CASE_TBL + ORDER BY 2; Five | Simplest Math ------+--------------- | 1 @@ -132,7 +134,8 @@ SELECT '' AS "Five", i AS "Value", WHEN (i = 2) THEN 'two' ELSE 'big' END AS "Category" - FROM CASE_TBL; + FROM CASE_TBL + ORDER BY 2, 3; Five | Value | Category ------+-------+---------- | 1 | one @@ -148,13 +151,14 @@ SELECT '' AS "Five", WHEN ((i = 2) or (i = 2)) THEN 'two' ELSE 'big' END AS "Category" - FROM CASE_TBL; + FROM CASE_TBL + ORDER BY 2; Five | Category ------+---------- - | one - | two | big | big + | one + | two (4 rows) -- @@ -177,82 +181,86 @@ SELECT * FROM CASE_TBL WHERE NULLIF(f,i) = 2; (0 rows) SELECT COALESCE(a.f, b.i, b.j) - FROM CASE_TBL a, CASE2_TBL b; + FROM CASE_TBL a, CASE2_TBL b + ORDER BY coalesce; coalesce ---------- - 10.1 - 20.2 -30.3 - 1 - 10.1 - 20.2 -30.3 - 2 - 10.1 - 20.2 -30.3 - 3 - 10.1 - 20.2 -30.3 - 2 - 10.1 - 20.2 -30.3 + -30.3 + -6 + 1 1 + 2 + 2 + 3 + 10.1 + 10.1 + 10.1 + 10.1 + 10.1 10.1 20.2 - -30.3 - -6 + 20.2 + 20.2 + 20.2 + 20.2 + 20.2 (24 rows) SELECT * FROM CASE_TBL a, CASE2_TBL b - WHERE COALESCE(a.f, b.i, b.j) = 2; + WHERE COALESCE(a.f, b.i, b.j) = 2 + ORDER BY a.i, a.f, b.i, b.j; i | f | i | j ---+---+---+---- - 4 | | 2 | -2 4 | | 2 | -4 + 4 | | 2 | -2 (2 rows) SELECT '' AS Five, NULLIF(a.i,b.i) AS "NULLIF(a.i,b.i)", NULLIF(b.i, 4) AS "NULLIF(b.i,4)" - FROM CASE_TBL a, CASE2_TBL b; + FROM CASE_TBL a, CASE2_TBL b + ORDER BY 2, 3; five | NULLIF(a.i,b.i) | NULLIF(b.i,4) ------+-----------------+--------------- - | | 1 - | 2 | 1 - | 3 | 1 - | 4 | 1 | 1 | 2 - | | 2 - | 3 | 2 - | 4 | 2 - | 1 | 3 - | 2 | 3 - | | 3 - | 4 | 3 | 1 | 2 - | | 2 - | 3 | 2 - | 4 | 2 - | | 1 - | 2 | 1 - | 3 | 1 - | 4 | 1 + | 1 | 3 | 1 | + | 2 | 1 + | 2 | 1 + | 2 | 3 | 2 | + | 3 | 1 + | 3 | 1 + | 3 | 2 + | 3 | 2 | 3 | + | 4 | 1 + | 4 | 1 + | 4 | 2 + | 4 | 2 + | 4 | 3 | 4 | + | | 1 + | | 1 + | | 2 + | | 2 + | | 3 (24 rows) SELECT '' AS "Two", * FROM CASE_TBL a, CASE2_TBL b - WHERE COALESCE(f,b.i) = 2; + WHERE COALESCE(f,b.i) = 2 + ORDER BY a.i, a.f, b.i, b.j; Two | i | f | i | j -----+---+---+---+---- - | 4 | | 2 | -2 | 4 | | 2 | -4 + | 4 | | 2 | -2 (2 rows) -- @@ -261,25 +269,25 @@ SELECT '' AS "Two", * UPDATE CASE_TBL SET i = CASE WHEN i >= 3 THEN (- i) ELSE (2 * i) END; -SELECT * FROM CASE_TBL; +SELECT * FROM CASE_TBL ORDER BY i, f; i | f ----+------- + -4 | + -3 | -30.3 2 | 10.1 4 | 20.2 - -3 | -30.3 - -4 | (4 rows) UPDATE CASE_TBL SET i = CASE WHEN i >= 2 THEN (2 * i) ELSE (3 * i) END; -SELECT * FROM CASE_TBL; +SELECT * FROM CASE_TBL ORDER BY i, f; i | f -----+------- + -12 | + -9 | -30.3 4 | 10.1 8 | 20.2 - -9 | -30.3 - -12 | (4 rows) UPDATE CASE_TBL @@ -287,13 +295,13 @@ UPDATE CASE_TBL ELSE (3 * j) END FROM CASE2_TBL b WHERE j = -CASE_TBL.i; -SELECT * FROM CASE_TBL; +SELECT * FROM CASE_TBL ORDER BY i, f; i | f -----+------- - 8 | 20.2 - -9 | -30.3 -12 | + -9 | -30.3 -8 | 10.1 + 8 | 20.2 (4 rows) -- diff --git a/src/test/regress/expected/char.out b/src/test/regress/expected/char.out index a0ba3d4..cf8eeca 100644 --- a/src/test/regress/expected/char.out +++ b/src/test/regress/expected/char.out @@ -25,28 +25,28 @@ INSERT INTO CHAR_TBL (f1) VALUES (''); INSERT INTO CHAR_TBL (f1) VALUES ('cd'); ERROR: value too long for type character(1) INSERT INTO CHAR_TBL (f1) VALUES ('c '); -SELECT '' AS seven, * FROM CHAR_TBL; +SELECT '' AS seven, * FROM CHAR_TBL ORDER BY f1; seven | f1 -------+---- - | a - | A + | | 1 | 2 | 3 - | + | A + | a | c (7 rows) SELECT '' AS six, c.* FROM CHAR_TBL c - WHERE c.f1 <> 'a'; + WHERE c.f1 <> 'a' ORDER BY f1; six | f1 -----+---- - | A + | | 1 | 2 | 3 - | + | A | c (6 rows) @@ -60,32 +60,32 @@ SELECT '' AS one, c.* SELECT '' AS five, c.* FROM CHAR_TBL c - WHERE c.f1 < 'a'; + WHERE c.f1 < 'a' ORDER BY f1; five | f1 ------+---- - | A + | | 1 | 2 | 3 - | + | A (5 rows) SELECT '' AS six, c.* FROM CHAR_TBL c - WHERE c.f1 <= 'a'; + WHERE c.f1 <= 'a' ORDER BY f1; six | f1 -----+---- - | a - | A + | | 1 | 2 | 3 - | + | A + | a (6 rows) SELECT '' AS one, c.* FROM CHAR_TBL c - WHERE c.f1 > 'a'; + WHERE c.f1 > 'a' ORDER BY f1; one | f1 -----+---- | c @@ -93,7 +93,7 @@ SELECT '' AS one, c.* SELECT '' AS two, c.* FROM CHAR_TBL c - WHERE c.f1 >= 'a'; + WHERE c.f1 >= 'a' ORDER BY f1; two | f1 -----+---- | a @@ -111,7 +111,7 @@ INSERT INTO CHAR_TBL (f1) VALUES ('abcd'); INSERT INTO CHAR_TBL (f1) VALUES ('abcde'); ERROR: value too long for type character(4) INSERT INTO CHAR_TBL (f1) VALUES ('abcd '); -SELECT '' AS four, * FROM CHAR_TBL; +SELECT '' AS four, * FROM CHAR_TBL ORDER BY f1; four | f1 ------+------ | a diff --git a/src/test/regress/expected/circle.out b/src/test/regress/expected/circle.out index 9ba4a04..2b098a8 100644 --- a/src/test/regress/expected/circle.out +++ b/src/test/regress/expected/circle.out @@ -21,65 +21,65 @@ INSERT INTO CIRCLE_TBL VALUES ('(3,(1,2),3)'); ERROR: invalid input syntax for type circle: "(3,(1,2),3)" LINE 1: INSERT INTO CIRCLE_TBL VALUES ('(3,(1,2),3)'); ^ -SELECT * FROM CIRCLE_TBL; +SELECT * FROM CIRCLE_TBL ORDER BY (point(f1))[0], (point(f1))[0], radius(f1); f1 ---------------- - <(5,1),3> - <(1,2),100> - <(1,3),5> <(1,2),3> + <(1,3),5> + <(1,2),100> + <(5,1),3> <(100,200),10> <(100,1),115> (6 rows) SELECT '' AS six, center(f1) AS center - FROM CIRCLE_TBL; + FROM CIRCLE_TBL ORDER BY (point(f1))[0], (point(f1))[0], radius(f1); six | center -----+----------- - | (5,1) | (1,2) | (1,3) | (1,2) + | (5,1) | (100,200) | (100,1) (6 rows) SELECT '' AS six, radius(f1) AS radius - FROM CIRCLE_TBL; + FROM CIRCLE_TBL ORDER BY (point(f1))[0], (point(f1))[0], radius(f1); six | radius -----+-------- | 3 - | 100 | 5 + | 100 | 3 | 10 | 115 (6 rows) SELECT '' AS six, diameter(f1) AS diameter - FROM CIRCLE_TBL; + FROM CIRCLE_TBL ORDER BY (point(f1))[0], (point(f1))[0], radius(f1); six | diameter -----+---------- | 6 - | 200 | 10 + | 200 | 6 | 20 | 230 (6 rows) -SELECT '' AS two, f1 FROM CIRCLE_TBL WHERE radius(f1) < 5; +SELECT '' AS two, f1 FROM CIRCLE_TBL WHERE radius(f1) < 5 ORDER BY (point(f1))[0], (point(f1))[0], radius(f1); two | f1 -----+----------- - | <(5,1),3> | <(1,2),3> + | <(5,1),3> (2 rows) -SELECT '' AS four, f1 FROM CIRCLE_TBL WHERE diameter(f1) >= 10; +SELECT '' AS four, f1 FROM CIRCLE_TBL WHERE diameter(f1) >= 10 ORDER BY (point(f1))[0], (point(f1))[0], radius(f1); four | f1 ------+---------------- - | <(1,2),100> | <(1,3),5> + | <(1,2),100> | <(100,200),10> | <(100,1),115> (4 rows) diff --git a/src/test/regress/expected/cluster.out b/src/test/regress/expected/cluster.out index 96bd816..4d28cc0 100644 --- a/src/test/regress/expected/cluster.out +++ b/src/test/regress/expected/cluster.out @@ -57,41 +57,41 @@ INSERT INTO clstr_tst (b, c) VALUES (8, 'ocho'); -- This entry is needed to test that TOASTED values are copied correctly. INSERT INTO clstr_tst (b, c, d) VALUES (6, 'seis', repeat('xyzzy', 100000)); CLUSTER clstr_tst_c ON clstr_tst; -SELECT a,b,c,substring(d for 30), length(d) from clstr_tst; +SELECT a,b,c,substring(d for 30), length(d) from clstr_tst ORDER BY a, b, c; a | b | c | substring | length ----+----+---------------+--------------------------------+-------- - 10 | 14 | catorce | | - 18 | 5 | cinco | | - 9 | 4 | cuatro | | - 26 | 19 | diecinueve | | - 12 | 18 | dieciocho | | - 30 | 16 | dieciseis | | - 24 | 17 | diecisiete | | - 2 | 10 | diez | | - 23 | 12 | doce | | - 11 | 2 | dos | | - 25 | 9 | nueve | | - 31 | 8 | ocho | | 1 | 11 | once | | - 28 | 15 | quince | | - 32 | 6 | seis | xyzzyxyzzyxyzzyxyzzyxyzzyxyzzy | 500000 - 29 | 7 | siete | | - 15 | 13 | trece | | - 22 | 30 | treinta | | - 17 | 32 | treinta y dos | | + 2 | 10 | diez | | 3 | 31 | treinta y uno | | + 4 | 22 | veintidos | | 5 | 3 | tres | | - 20 | 1 | uno | | 6 | 20 | veinte | | + 7 | 23 | veintitres | | + 8 | 21 | veintiuno | | + 9 | 4 | cuatro | | + 10 | 14 | catorce | | + 11 | 2 | dos | | + 12 | 18 | dieciocho | | + 13 | 27 | veintisiete | | 14 | 25 | veinticinco | | - 21 | 24 | veinticuatro | | - 4 | 22 | veintidos | | - 19 | 29 | veintinueve | | + 15 | 13 | trece | | 16 | 28 | veintiocho | | + 17 | 32 | treinta y dos | | + 18 | 5 | cinco | | + 19 | 29 | veintinueve | | + 20 | 1 | uno | | + 21 | 24 | veinticuatro | | + 22 | 30 | treinta | | + 23 | 12 | doce | | + 24 | 17 | diecisiete | | + 25 | 9 | nueve | | + 26 | 19 | diecinueve | | 27 | 26 | veintiseis | | - 13 | 27 | veintisiete | | - 7 | 23 | veintitres | | - 8 | 21 | veintiuno | | + 28 | 15 | quince | | + 29 | 7 | siete | | + 30 | 16 | dieciseis | | + 31 | 8 | ocho | | + 32 | 6 | seis | xyzzyxyzzyxyzzyxyzzyxyzzyxyzzy | 500000 (32 rows) SELECT a,b,c,substring(d for 30), length(d) from clstr_tst ORDER BY a; @@ -207,42 +207,42 @@ SELECT a,b,c,substring(d for 30), length(d) from clstr_tst ORDER BY c; -- Verify that inheritance link still works INSERT INTO clstr_tst_inh VALUES (0, 100, 'in child table'); -SELECT a,b,c,substring(d for 30), length(d) from clstr_tst; +SELECT a,b,c,substring(d for 30), length(d) from clstr_tst ORDER BY a, b, c; a | b | c | substring | length ----+-----+----------------+--------------------------------+-------- - 10 | 14 | catorce | | - 18 | 5 | cinco | | - 9 | 4 | cuatro | | - 26 | 19 | diecinueve | | - 12 | 18 | dieciocho | | - 30 | 16 | dieciseis | | - 24 | 17 | diecisiete | | - 2 | 10 | diez | | - 23 | 12 | doce | | - 11 | 2 | dos | | - 25 | 9 | nueve | | - 31 | 8 | ocho | | + 0 | 100 | in child table | | 1 | 11 | once | | - 28 | 15 | quince | | - 32 | 6 | seis | xyzzyxyzzyxyzzyxyzzyxyzzyxyzzy | 500000 - 29 | 7 | siete | | - 15 | 13 | trece | | - 22 | 30 | treinta | | - 17 | 32 | treinta y dos | | + 2 | 10 | diez | | 3 | 31 | treinta y uno | | + 4 | 22 | veintidos | | 5 | 3 | tres | | - 20 | 1 | uno | | 6 | 20 | veinte | | + 7 | 23 | veintitres | | + 8 | 21 | veintiuno | | + 9 | 4 | cuatro | | + 10 | 14 | catorce | | + 11 | 2 | dos | | + 12 | 18 | dieciocho | | + 13 | 27 | veintisiete | | 14 | 25 | veinticinco | | - 21 | 24 | veinticuatro | | - 4 | 22 | veintidos | | - 19 | 29 | veintinueve | | + 15 | 13 | trece | | 16 | 28 | veintiocho | | + 17 | 32 | treinta y dos | | + 18 | 5 | cinco | | + 19 | 29 | veintinueve | | + 20 | 1 | uno | | + 21 | 24 | veinticuatro | | + 22 | 30 | treinta | | + 23 | 12 | doce | | + 24 | 17 | diecisiete | | + 25 | 9 | nueve | | + 26 | 19 | diecinueve | | 27 | 26 | veintiseis | | - 13 | 27 | veintisiete | | - 7 | 23 | veintitres | | - 8 | 21 | veintiuno | | - 0 | 100 | in child table | | + 28 | 15 | quince | | + 29 | 7 | siete | | + 30 | 16 | dieciseis | | + 31 | 8 | ocho | | + 32 | 6 | seis | xyzzyxyzzyxyzzyxyzzyxyzzyxyzzy | 500000 (33 rows) -- Verify that foreign key link still works @@ -333,15 +333,16 @@ CLUSTER clstr_1_pkey ON clstr_1; CLUSTER clstr_2 USING clstr_2_pkey; SELECT * FROM clstr_1 UNION ALL SELECT * FROM clstr_2 UNION ALL - SELECT * FROM clstr_3; + SELECT * FROM clstr_3 + ORDER BY 1; a --- 1 - 2 + 1 1 2 2 - 1 + 2 (6 rows) -- revert to the original state @@ -360,15 +361,16 @@ SET SESSION AUTHORIZATION clstr_user; CLUSTER; SELECT * FROM clstr_1 UNION ALL SELECT * FROM clstr_2 UNION ALL - SELECT * FROM clstr_3; + SELECT * FROM clstr_3 + ORDER BY 1; a --- 1 + 1 + 1 2 2 - 1 2 - 1 (6 rows) -- cluster a single table using the indisclustered bit previously set @@ -376,7 +378,8 @@ DELETE FROM clstr_1; INSERT INTO clstr_1 VALUES (2); INSERT INTO clstr_1 VALUES (1); CLUSTER clstr_1; -SELECT * FROM clstr_1; +SELECT * FROM clstr_1 +ORDER BY 1; a --- 1 @@ -402,18 +405,18 @@ UPDATE clustertest SET key = 35 WHERE key = 40; UPDATE clustertest SET key = 60 WHERE key = 50; UPDATE clustertest SET key = 70 WHERE key = 60; UPDATE clustertest SET key = 80 WHERE key = 70; -SELECT * FROM clustertest; +SELECT * FROM clustertest ORDER BY 1; key ----- 20 30 - 100 35 80 + 100 (5 rows) CLUSTER clustertest_pkey ON clustertest; -SELECT * FROM clustertest; +SELECT * FROM clustertest ORDER BY 1; key ----- 20 @@ -424,7 +427,7 @@ SELECT * FROM clustertest; (5 rows) COMMIT; -SELECT * FROM clustertest; +SELECT * FROM clustertest ORDER BY 1; key ----- 20 @@ -439,7 +442,7 @@ create temp table clstr_temp (col1 int primary key, col2 text); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "clstr_temp_pkey" for table "clstr_temp" insert into clstr_temp values (2, 'two'), (1, 'one'); cluster clstr_temp using clstr_temp_pkey; -select * from clstr_temp; +select * from clstr_temp ORDER BY 1; col1 | col2 ------+------ 1 | one diff --git a/src/test/regress/expected/combocid.out b/src/test/regress/expected/combocid.out index b63894c..f234ff4 100644 --- a/src/test/regress/expected/combocid.out +++ b/src/test/regress/expected/combocid.out @@ -16,7 +16,7 @@ INSERT INTO combocidtest SELECT 1 LIMIT 0; INSERT INTO combocidtest SELECT 1 LIMIT 0; INSERT INTO combocidtest VALUES (1); INSERT INTO combocidtest VALUES (2); -SELECT ctid,cmin,* FROM combocidtest; +SELECT ctid,... [truncated message content] |
From: Michael P. <mic...@us...> - 2011-01-12 09:00:35
|
Project "Postgres-XC". The branch, master has been updated via 9a57b4e60139aa0799f4b6ea3bc6716b2a974022 (commit) from 7c06c36bb8b29257ab07998fc4680993a7cb503a (commit) - Log ----------------------------------------------------------------- commit 9a57b4e60139aa0799f4b6ea3bc6716b2a974022 Author: Michael P <mic...@us...> Date: Wed Jan 12 18:01:13 2011 +0900 Sequence Renaming Fix to allow a remote Coordinator to rename sequences correctly on backend nodes. This has been unfortunately introduced by previous commit 28da86b88e667b5e45e6deef831cc839ccba2703 diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index dbd9401..2a13bad 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -732,7 +732,7 @@ ProcessUtility(Node *parsetree, */ case T_RenameStmt: #ifdef PGXC - if (IS_PGXC_COORDINATOR && IsConnFromCoord()) + if (IS_PGXC_COORDINATOR && !IsConnFromCoord()) { RemoteQueryExecType remoteExecType = EXEC_ON_ALL_NODES; RenameStmt *stmt = (RenameStmt *) parsetree; ----------------------------------------------------------------------- Summary of changes: src/backend/tcop/utility.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-01-12 08:43:13
|
Project "Postgres-XC". The branch, master has been updated via 7c06c36bb8b29257ab07998fc4680993a7cb503a (commit) from 28da86b88e667b5e45e6deef831cc839ccba2703 (commit) - Log ----------------------------------------------------------------- commit 7c06c36bb8b29257ab07998fc4680993a7cb503a Author: Michael P <mic...@us...> Date: Wed Jan 12 17:34:16 2011 +0900 Fix for bug 3136262: Improvement of Explicit 2PC error handling There was a problem with PREPARE TRANSACTION when trying to use the same GID multiple times. This commits fixes the case where: CREATE TABLE test (a int); BEGIN; INSERT INTO test VALUES (1); PREPARE TRANSACTION 'gid_name'; BEGIN; INSERT INTO test VALUES (2); PREPARE TRANSACTION 'gid_name'; At this point PREPARE message was sent down to nodes making previously prepared transaction being rollbacked. Now GTM returns an error if GID is already in use and sends a ROLLBACK to corresponding nodes. diff --git a/src/backend/pgxc/pool/execRemote.c b/src/backend/pgxc/pool/execRemote.c index 855a1b5..3ca96c6 100644 --- a/src/backend/pgxc/pool/execRemote.c +++ b/src/backend/pgxc/pool/execRemote.c @@ -1490,6 +1490,13 @@ finish: /* Clean up connections */ pfree_pgxc_all_handles(pgxc_connections); + if (res != 0) + { + ereport(ERROR, + (errcode(ERRCODE_INTERNAL_ERROR), + errmsg("Could not prepare transaction on data nodes"))); + } + return local_operation; } @@ -1508,6 +1515,7 @@ pgxc_node_prepare(PGXCNodeAllHandles *pgxc_handles, char *gid) GlobalTransactionId gxid = InvalidGlobalTransactionId; PGXC_NodeId *datanodes = NULL; PGXC_NodeId *coordinators = NULL; + bool gtm_error = false; gxid = GetCurrentGlobalTransactionId(); @@ -1545,7 +1553,10 @@ pgxc_node_prepare(PGXCNodeAllHandles *pgxc_handles, char *gid) datanodes, real_co_conn_count, coordinators); if (result < 0) - return EOF; + { + gtm_error = true; + goto finish; + } sprintf(buffer, "PREPARE TRANSACTION '%s'", gid); @@ -1570,7 +1581,7 @@ pgxc_node_prepare(PGXCNodeAllHandles *pgxc_handles, char *gid) finish: /* - * An error has happened on a Datanode or GTM, + * An error has happened on a Datanode, * It is necessary to rollback the transaction on already prepared nodes. * But not on nodes where the error occurred. */ @@ -1579,17 +1590,28 @@ finish: GlobalTransactionId rollback_xid = InvalidGlobalTransactionId; result = 0; - buffer = (char *) repalloc(buffer, 20 + strlen(gid) + 1); - sprintf(buffer, "ROLLBACK PREPARED '%s'", gid); + if (gtm_error) + { + buffer = (char *) repalloc(buffer, 9); + sprintf(buffer, "ROLLBACK"); + } + else + { + buffer = (char *) repalloc(buffer, 20 + strlen(gid) + 1); + sprintf(buffer, "ROLLBACK PREPARED '%s'", gid); - rollback_xid = BeginTranGTM(NULL); + rollback_xid = BeginTranGTM(NULL); + } /* * Send xid and rollback prepared down to Datanodes and Coordinators * Even if we get an error on one, we try and send to the others - */ - if (pgxc_all_handles_send_gxid(pgxc_handles, rollback_xid, false)) - result = EOF; + * Only query is sent down to nodes if error occured on GTM. + */ + if (!gtm_error) + if (pgxc_all_handles_send_gxid(pgxc_handles, rollback_xid, false)) + result = EOF; + if (pgxc_all_handles_send_query(pgxc_handles, buffer, false)) result = EOF; @@ -1597,10 +1619,11 @@ finish: result |= pgxc_node_receive_and_validate(co_conn_count, pgxc_handles->coord_handles, false); /* - * Don't forget to rollback also on GTM + * Don't forget to rollback also on GTM if error happened on Datanodes * Both GXIDs used for PREPARE and COMMIT PREPARED are discarded from GTM snapshot here. */ - CommitPreparedTranGTM(gxid, rollback_xid); + if (!gtm_error) + CommitPreparedTranGTM(gxid, rollback_xid); return EOF; } diff --git a/src/gtm/main/gtm_txn.c b/src/gtm/main/gtm_txn.c index 252fc43..27f7372 100644 --- a/src/gtm/main/gtm_txn.c +++ b/src/gtm/main/gtm_txn.c @@ -888,6 +888,12 @@ GTM_StartPreparedTransaction(GTM_TransactionHandle txn, return STATUS_ERROR; /* + * Check if given GID is already in use by another transaction. + */ + if (GTM_GIDToHandle(gid) != InvalidTransactionHandle) + return STATUS_ERROR; + + /* * Mark the transaction as being prepared */ GTM_RWLockAcquire(>m_txninfo->gti_lock, GTM_LOCKMODE_WRITE); ----------------------------------------------------------------------- Summary of changes: src/backend/pgxc/pool/execRemote.c | 43 +++++++++++++++++++++++++++-------- src/gtm/main/gtm_txn.c | 6 +++++ 2 files changed, 39 insertions(+), 10 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-01-12 06:52:57
|
Project "Postgres-XC". The branch, master has been updated via 28da86b88e667b5e45e6deef831cc839ccba2703 (commit) from bc45a6fdb6afe5dd72526c4919bd8c138f11eb0d (commit) - Log ----------------------------------------------------------------- commit 28da86b88e667b5e45e6deef831cc839ccba2703 Author: Michael P <mic...@us...> Date: Wed Jan 12 15:53:43 2011 +0900 Fix for bug 3142311:renaming sequences error Sequences could not be renamed correctly as Rename statement was running on all the nodes but sequences are not defined on Datanodes. Patch written by Benny with some editorialization by me. diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 968b921..dbd9401 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -732,8 +732,23 @@ ProcessUtility(Node *parsetree, */ case T_RenameStmt: #ifdef PGXC - if (IS_PGXC_COORDINATOR) - ExecUtilityStmtOnNodes(queryString, NULL, false, EXEC_ON_ALL_NODES); + if (IS_PGXC_COORDINATOR && IsConnFromCoord()) + { + RemoteQueryExecType remoteExecType = EXEC_ON_ALL_NODES; + RenameStmt *stmt = (RenameStmt *) parsetree; + + if (stmt->renameType == OBJECT_SEQUENCE) + remoteExecType = EXEC_ON_COORDS; + else if (stmt->renameType == OBJECT_TABLE) + { + Oid relid = RangeVarGetRelid(stmt->relation, false); + + if (get_rel_relkind(relid) == RELKIND_SEQUENCE) + remoteExecType = EXEC_ON_COORDS; + } + + ExecUtilityStmtOnNodes(queryString, NULL, false, remoteExecType); + } #endif ExecRenameStmt((RenameStmt *) parsetree); break; ----------------------------------------------------------------------- Summary of changes: src/backend/tcop/utility.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) hooks/post-receive -- Postgres-XC |