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

Commitba17165

Browse files
committed
This adds unary plus capability. No grammar changes, per Tom's request.
Marko Kreen
1 parenta6697b3 commitba17165

File tree

10 files changed

+102
-13
lines changed

10 files changed

+102
-13
lines changed

‎src/backend/commands/command.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.131 2001/05/30 13:00:03 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.132 2001/06/0700:09:28 momjian Exp $
1212
*
1313
* NOTES
1414
* The PerformAddAttribute() code, like most of the relation
@@ -176,6 +176,12 @@ PerformPortalFetch(char *name,
176176
if (!portal->atEnd)
177177
{
178178
ExecutorRun(queryDesc,estate,EXEC_FOR, (long)count);
179+
/*
180+
*I use CMD_UPDATE, because no CMD_MOVE or the like
181+
*exists, and I would like to provide the same
182+
*kind of info as CMD_UPDATE
183+
*/
184+
UpdateCommandInfo(CMD_UPDATE,0,estate->es_processed);
179185
if (estate->es_processed>0)
180186
portal->atStart= false;/* OK to back up now */
181187
if (count <=0|| (int)estate->es_processed<count)
@@ -187,6 +193,12 @@ PerformPortalFetch(char *name,
187193
if (!portal->atStart)
188194
{
189195
ExecutorRun(queryDesc,estate,EXEC_BACK, (long)count);
196+
/*
197+
*I use CMD_UPDATE, because no CMD_MOVE or the like
198+
*exists, and I would like to provide the same
199+
*kind of info as CMD_UPDATE
200+
*/
201+
UpdateCommandInfo(CMD_UPDATE,0,estate->es_processed);
190202
if (estate->es_processed>0)
191203
portal->atEnd= false;/* OK to go forward now */
192204
if (count <=0|| (int)estate->es_processed<count)

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.73 2001/06/02 20:18:30 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.74 2001/06/07 00:09:29 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
1515
/*----------
1616
* OLD COMMENTS
1717
*Basic float4 ops:
18-
* float4in, float4out, float4abs, float4um
18+
* float4in, float4out, float4abs, float4um, float4up
1919
*Basic float8 ops:
20-
* float8in, float8out, float8abs, float8um
20+
* float8in, float8out, float8abs, float8um, float8up
2121
*Arithmetic operators:
2222
* float4pl, float4mi, float4mul, float4div
2323
* float8pl, float8mi, float8mul, float8div
@@ -340,6 +340,13 @@ float4um(PG_FUNCTION_ARGS)
340340
PG_RETURN_FLOAT4((float4)-arg1);
341341
}
342342

343+
Datum
344+
float4up(PG_FUNCTION_ARGS)
345+
{
346+
float4arg=PG_GETARG_FLOAT4(0);
347+
PG_RETURN_FLOAT4(arg);
348+
}
349+
343350
Datum
344351
float4larger(PG_FUNCTION_ARGS)
345352
{
@@ -399,6 +406,13 @@ float8um(PG_FUNCTION_ARGS)
399406
PG_RETURN_FLOAT8(result);
400407
}
401408

409+
Datum
410+
float8up(PG_FUNCTION_ARGS)
411+
{
412+
float8arg=PG_GETARG_FLOAT8(0);
413+
PG_RETURN_FLOAT8(arg);
414+
}
415+
402416
Datum
403417
float8larger(PG_FUNCTION_ARGS)
404418
{

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.46 2001/03/22 03:59:51 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.47 2001/06/07 00:09:29 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -563,6 +563,14 @@ int4um(PG_FUNCTION_ARGS)
563563
PG_RETURN_INT32(-arg);
564564
}
565565

566+
Datum
567+
int4up(PG_FUNCTION_ARGS)
568+
{
569+
int32arg=PG_GETARG_INT32(0);
570+
571+
PG_RETURN_INT32(arg);
572+
}
573+
566574
Datum
567575
int4pl(PG_FUNCTION_ARGS)
568576
{
@@ -615,6 +623,14 @@ int2um(PG_FUNCTION_ARGS)
615623
PG_RETURN_INT16(-arg);
616624
}
617625

626+
Datum
627+
int2up(PG_FUNCTION_ARGS)
628+
{
629+
int16arg=PG_GETARG_INT16(0);
630+
631+
PG_RETURN_INT16(arg);
632+
}
633+
618634
Datum
619635
int2pl(PG_FUNCTION_ARGS)
620636
{

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int8.c,v 1.29 2001/03/22 03:59:51 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int8.c,v 1.30 2001/06/07 00:09:29 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -412,6 +412,14 @@ int8um(PG_FUNCTION_ARGS)
412412
PG_RETURN_INT64(-val);
413413
}
414414

415+
Datum
416+
int8up(PG_FUNCTION_ARGS)
417+
{
418+
int64val=PG_GETARG_INT64(0);
419+
420+
PG_RETURN_INT64(val);
421+
}
422+
415423
Datum
416424
int8pl(PG_FUNCTION_ARGS)
417425
{

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
*1998 Jan Wieck
77
*
8-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.41 2001/05/03 19:00:36 tgl Exp $
8+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.42 2001/06/0700:09:29 momjian Exp $
99
*
1010
* ----------
1111
*/
@@ -405,6 +405,19 @@ numeric_uminus(PG_FUNCTION_ARGS)
405405
}
406406

407407

408+
Datum
409+
numeric_uplus(PG_FUNCTION_ARGS)
410+
{
411+
Numericnum=PG_GETARG_NUMERIC(0);
412+
Numericres;
413+
414+
res= (Numeric)palloc(num->varlen);
415+
memcpy(res,num,num->varlen);
416+
417+
PG_RETURN_NUMERIC(res);
418+
}
419+
420+
408421
Datum
409422
numeric_sign(PG_FUNCTION_ARGS)
410423
{

‎src/include/catalog/pg_operator.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: pg_operator.h,v 1.88 2001/03/22 04:00:39 momjian Exp $
11+
* $Id: pg_operator.h,v 1.89 2001/06/0700:09:29 momjian Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -794,6 +794,13 @@ DATA(insert OID = 1889 ( "~" PGUID 0 l t f 0 20 20 0 0 0 0 int8not
794794
DATA(insertOID=1890 ("<<"PGUID0btf2023200000int8shl-- ));
795795
DATA(insertOID=1891 (">>"PGUID0btf2023200000int8shr-- ));
796796

797+
DATA(insertOID=1916 ("+"PGUID0ltf020200000int8up-- ));
798+
DATA(insertOID=1917 ("+"PGUID0ltf021210000int2up-- ));
799+
DATA(insertOID=1918 ("+"PGUID0ltf023230000int4up-- ));
800+
DATA(insertOID=1919 ("+"PGUID0ltf07007000000float4up-- ));
801+
DATA(insertOID=1920 ("+"PGUID0ltf07017010000float8up-- ));
802+
DATA(insertOID=1921 ("+"PGUID0ltf0170017000000numeric_uplus-- ));
803+
797804
/*
798805
* function prototypes
799806
*/

‎src/include/catalog/pg_proc.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: pg_proc.h,v 1.188 2001/05/2409:29:29 petere Exp $
10+
* $Id: pg_proc.h,v 1.189 2001/06/07 00:09:30 momjian Exp $
1111
*
1212
* NOTES
1313
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2614,6 +2614,19 @@ DESCR("binary shift left");
26142614
DATA(insertOID=1909 (int8shrPGUID12fttt2f20"20 23"10000100int8shr- ));
26152615
DESCR("binary shift right");
26162616

2617+
DATA(insertOID=1910 (int8upPGUID12fttt1f20"20"10000100int8up- ));
2618+
DESCR("unary plus");
2619+
DATA(insertOID=1911 (int2upPGUID12fttt1f21"21"10000100int2up- ));
2620+
DESCR("unary plus");
2621+
DATA(insertOID=1912 (int4upPGUID12fttt1f23"23"10000100int4up- ));
2622+
DESCR("unary plus");
2623+
DATA(insertOID=1913 (float4upPGUID12fttt1f700"700"10000100float4up- ));
2624+
DESCR("unary plus");
2625+
DATA(insertOID=1914 (float8upPGUID12fttt1f701"701"10000100float8up- ));
2626+
DESCR("unary plus");
2627+
DATA(insertOID=1915 (numeric_uplusPGUID12fttt1f1700"1700"10000100numeric_uplus- ));
2628+
DESCR("unary plus");
2629+
26172630
/*
26182631
* prototypes for functions pg_proc.c
26192632
*/

‎src/include/utils/builtins.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: builtins.h,v 1.148 2001/03/22 04:01:11 momjian Exp $
10+
* $Id: builtins.h,v 1.149 2001/06/07 00:09:31 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -96,13 +96,15 @@ extern Datum int42le(PG_FUNCTION_ARGS);
9696
externDatumint42gt(PG_FUNCTION_ARGS);
9797
externDatumint42ge(PG_FUNCTION_ARGS);
9898
externDatumint4um(PG_FUNCTION_ARGS);
99+
externDatumint4up(PG_FUNCTION_ARGS);
99100
externDatumint4pl(PG_FUNCTION_ARGS);
100101
externDatumint4mi(PG_FUNCTION_ARGS);
101102
externDatumint4mul(PG_FUNCTION_ARGS);
102103
externDatumint4div(PG_FUNCTION_ARGS);
103104
externDatumint4abs(PG_FUNCTION_ARGS);
104105
externDatumint4inc(PG_FUNCTION_ARGS);
105106
externDatumint2um(PG_FUNCTION_ARGS);
107+
externDatumint2up(PG_FUNCTION_ARGS);
106108
externDatumint2pl(PG_FUNCTION_ARGS);
107109
externDatumint2mi(PG_FUNCTION_ARGS);
108110
externDatumint2mul(PG_FUNCTION_ARGS);
@@ -184,10 +186,12 @@ extern Datum float8in(PG_FUNCTION_ARGS);
184186
externDatumfloat8out(PG_FUNCTION_ARGS);
185187
externDatumfloat4abs(PG_FUNCTION_ARGS);
186188
externDatumfloat4um(PG_FUNCTION_ARGS);
189+
externDatumfloat4up(PG_FUNCTION_ARGS);
187190
externDatumfloat4larger(PG_FUNCTION_ARGS);
188191
externDatumfloat4smaller(PG_FUNCTION_ARGS);
189192
externDatumfloat8abs(PG_FUNCTION_ARGS);
190193
externDatumfloat8um(PG_FUNCTION_ARGS);
194+
externDatumfloat8up(PG_FUNCTION_ARGS);
191195
externDatumfloat8larger(PG_FUNCTION_ARGS);
192196
externDatumfloat8smaller(PG_FUNCTION_ARGS);
193197
externDatumfloat4pl(PG_FUNCTION_ARGS);
@@ -532,6 +536,7 @@ extern Datum numeric_out(PG_FUNCTION_ARGS);
532536
externDatumnumeric(PG_FUNCTION_ARGS);
533537
externDatumnumeric_abs(PG_FUNCTION_ARGS);
534538
externDatumnumeric_uminus(PG_FUNCTION_ARGS);
539+
externDatumnumeric_uplus(PG_FUNCTION_ARGS);
535540
externDatumnumeric_sign(PG_FUNCTION_ARGS);
536541
externDatumnumeric_round(PG_FUNCTION_ARGS);
537542
externDatumnumeric_trunc(PG_FUNCTION_ARGS);

‎src/include/utils/int8.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: int8.h,v 1.25 2001/01/24 19:43:28 momjian Exp $
10+
* $Id: int8.h,v 1.26 2001/06/07 00:09:32 momjian Exp $
1111
*
1212
* NOTES
1313
* These data types are supported on all 64-bit architectures, and may
@@ -66,6 +66,7 @@ extern Datum int28le(PG_FUNCTION_ARGS);
6666
externDatumint28ge(PG_FUNCTION_ARGS);
6767

6868
externDatumint8um(PG_FUNCTION_ARGS);
69+
externDatumint8up(PG_FUNCTION_ARGS);
6970
externDatumint8pl(PG_FUNCTION_ARGS);
7071
externDatumint8mi(PG_FUNCTION_ARGS);
7172
externDatumint8mul(PG_FUNCTION_ARGS);

‎src/interfaces/jdbc/org/postgresql/Connection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
importorg.postgresql.util.*;
1111

1212
/**
13-
* $Id: Connection.java,v 1.16 2001/06/01 20:57:58 momjian Exp $
13+
* $Id: Connection.java,v 1.17 2001/06/07 00:09:32 momjian Exp $
1414
*
1515
* This abstract class is used by org.postgresql.Driver to open either the JDBC1 or
1616
* JDBC2 versions of the Connection class.
@@ -505,7 +505,7 @@ public java.sql.ResultSet ExecSQL(String sql,java.sql.Statement stat) throws SQL
505505
recv_status =pg_stream.ReceiveString(receive_sbuf,8192,getEncoding());
506506

507507
// Now handle the update count correctly.
508-
if(recv_status.startsWith("INSERT") ||recv_status.startsWith("UPDATE") ||recv_status.startsWith("DELETE")) {
508+
if(recv_status.startsWith("INSERT") ||recv_status.startsWith("UPDATE") ||recv_status.startsWith("DELETE") ||recv_status.startsWith("MOVE")) {
509509
try {
510510
update_count =Integer.parseInt(recv_status.substring(1+recv_status.lastIndexOf(' ')));
511511
}catch(NumberFormatExceptionnfe) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp