Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit41cba49

Browse files
author
Neil Conway
committed
Implement the <> operator for the tid type. Original patch from Mark
Kirkwood, minor improvements by Neil Conway. The regression tests havebeen updated and the catversion has been bumped.
1 parentc5e0415 commit41cba49

File tree

7 files changed

+41
-8
lines changed

7 files changed

+41
-8
lines changed

‎src/backend/utils/adt/tid.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/tid.c,v 1.49 2005/05/27 00:57:49 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/tid.c,v 1.50 2006/02/26 18:36:21 neilc Exp $
1212
*
1313
* NOTES
1414
* input routine largely stolen from boxin().
@@ -174,7 +174,6 @@ tideq(PG_FUNCTION_ARGS)
174174
arg1->ip_posid==arg2->ip_posid);
175175
}
176176

177-
#ifdefNOT_USED
178177
Datum
179178
tidne(PG_FUNCTION_ARGS)
180179
{
@@ -185,7 +184,6 @@ tidne(PG_FUNCTION_ARGS)
185184
BlockIdGetBlockNumber(&(arg2->ip_blkid))||
186185
arg1->ip_posid!=arg2->ip_posid);
187186
}
188-
#endif
189187

190188
/*
191189
*Functions to get latest tid of a specified tuple.

‎src/include/catalog/catversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
3838
* Portions Copyright (c) 1994, Regents of the University of California
3939
*
40-
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.315 2006/02/12 03:22:19 momjian Exp $
40+
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.316 2006/02/26 18:36:21 neilc Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO200602112
56+
#defineCATALOG_VERSION_NO200602251
5757

5858
#endif

‎src/include/catalog/pg_operator.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.139 2006/02/11 03:32:39 momjian Exp $
11+
* $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.140 2006/02/26 18:36:21 neilc Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -130,6 +130,7 @@ DATA(insert OID = 385 ( "=" PGNSP PGUID b t292916 385 0 0 0 0 0 cide
130130
DATA(insertOID=386 ("="PGNSPPGUIDbt22221638600000int2vectoreqeqseleqjoinsel ));
131131
DATA(insertOID=387 ("="PGNSPPGUIDbf27271638700000tideqeqseleqjoinsel ));
132132
#defineTIDEqualOperator 387
133+
DATA(insertOID=402 ("<>"PGNSPPGUIDbf27271640200000tidneneqselneqjoinsel ));
133134

134135
DATA(insertOID=410 ("="PGNSPPGUIDbt202016410411412412412413int8eqeqseleqjoinsel ));
135136
DATA(insertOID=411 ("<>"PGNSPPGUIDbf2020164114100000int8neneqselneqjoinsel ));

‎src/include/catalog/pg_proc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.397 2006/02/12 03:22:19 momjian Exp $
10+
* $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.398 2006/02/26 18:36:21 neilc Exp $
1111
*
1212
* NOTES
1313
* The script catalog/genbki.sh reads this file and generates .bki
@@ -1598,6 +1598,8 @@ DATA(insert OID = 1293 ( currtid PGNSP PGUID 12 f f t f v 2 27 "26 27" _null
15981598
DESCR("latest tid of a tuple");
15991599
DATA(insertOID=1294 (currtid2PGNSPPGUID12fftfv227"25 27"_null__null__null_currtid_byrelname-_null_ ));
16001600
DESCR("latest tid of a tuple");
1601+
DATA(insertOID=2398 (tidnePGNSPPGUID12fftfi216"27 27"_null__null__null_tidne-_null_ ));
1602+
DESCR("not equal");
16011603

16021604
DATA(insertOID=2168 (pg_database_sizePGNSPPGUID12fftfv120"19"_null__null__null_pg_database_size_name-_null_ ));
16031605
DESCR("Calculate total disk space usage for the specified database");

‎src/include/utils/builtins.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.273 2006/02/11 03:32:41 momjian Exp $
10+
* $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.274 2006/02/26 18:36:22 neilc Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -531,6 +531,7 @@ extern Datum tidout(PG_FUNCTION_ARGS);
531531
externDatumtidrecv(PG_FUNCTION_ARGS);
532532
externDatumtidsend(PG_FUNCTION_ARGS);
533533
externDatumtideq(PG_FUNCTION_ARGS);
534+
externDatumtidne(PG_FUNCTION_ARGS);
534535
externDatumcurrtid_byreloid(PG_FUNCTION_ARGS);
535536
externDatumcurrtid_byrelname(PG_FUNCTION_ARGS);
536537

‎src/test/regress/expected/transactions.out

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,3 +517,28 @@ fetch from foo;
517517
(1 row)
518518

519519
abort;
520+
-- tests for the "tid" type
521+
SELECT '(3, 3)'::tid = '(3, 4)'::tid;
522+
?column?
523+
----------
524+
f
525+
(1 row)
526+
527+
SELECT '(3, 3)'::tid = '(3, 3)'::tid;
528+
?column?
529+
----------
530+
t
531+
(1 row)
532+
533+
SELECT '(3, 3)'::tid <> '(3, 3)'::tid;
534+
?column?
535+
----------
536+
f
537+
(1 row)
538+
539+
SELECT '(3, 3)'::tid <> '(3, 4)'::tid;
540+
?column?
541+
----------
542+
t
543+
(1 row)
544+

‎src/test/regress/sql/transactions.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,3 +325,9 @@ rollback to x;
325325
fetchfrom foo;
326326

327327
abort;
328+
329+
-- tests for the "tid" type
330+
SELECT'(3, 3)'::tid='(3, 4)'::tid;
331+
SELECT'(3, 3)'::tid='(3, 3)'::tid;
332+
SELECT'(3, 3)'::tid<>'(3, 3)'::tid;
333+
SELECT'(3, 3)'::tid<>'(3, 4)'::tid;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp