03.patch
text/x-patch
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/interfaces/ecpg/test/expected/sql-binary.c | 13 | 9 |
| src/interfaces/ecpg/test/expected/sql-binary.stderr | 31 | 25 |
| src/interfaces/ecpg/test/sql/binary.pgc | 2 | 0 |
commit ed380002b153f97b8436dc4d8caa9fd638f63c2d
Author: Böszörményi Zoltán <zb@cybertec.at>
Date: Wed Nov 20 10:34:06 2013 +0100
ECPG: Add EXEC SQL CLOSE C to the test.
diff --git a/src/interfaces/ecpg/test/expected/sql-binary.c b/src/interfaces/ecpg/test/expected/sql-binary.c
index 64497b6..9aa11d6 100644
--- a/src/interfaces/ecpg/test/expected/sql-binary.c
+++ b/src/interfaces/ecpg/test/expected/sql-binary.c
@@ -133,15 +133,19 @@ main (void)
printf ("name=%s, accs=%d byte=%s\n", empl.name, empl.accs, empl.byte);
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close C", ECPGt_EOIT, ECPGt_EORT);}
+#line 69 "binary.pgc"
+
+
memset(empl.name, 0, 21L);
ECPGset_var( 1, &( empl.idnum ), __LINE__);\
/* declare B binary cursor for select name , accs , byte from empl where idnum = $1 */
-#line 70 "binary.pgc"
+#line 72 "binary.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare B binary cursor for select name , accs , byte from empl where idnum = $1 ",
ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
-#line 71 "binary.pgc"
+#line 73 "binary.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch B", ECPGt_EOIT,
ECPGt_char,(empl.name),(long)21,(long)1,(21)*sizeof(char),
@@ -150,7 +154,7 @@ main (void)
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(empl.byte),(long)20,(long)1,(20)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
-#line 72 "binary.pgc"
+#line 74 "binary.pgc"
if (sqlca.sqlcode)
{
@@ -159,7 +163,7 @@ main (void)
}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close B", ECPGt_EOIT, ECPGt_EORT);}
-#line 79 "binary.pgc"
+#line 81 "binary.pgc"
/* do not print a.accs because big/little endian will have different outputs here */
@@ -170,17 +174,17 @@ main (void)
ECPGset_var( 2, &( empl.idnum ), __LINE__);\
/* declare A binary cursor for select byte from empl where idnum = $1 */
-#line 87 "binary.pgc"
+#line 89 "binary.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare A binary cursor for select byte from empl where idnum = $1 ",
ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
-#line 88 "binary.pgc"
+#line 90 "binary.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch A", ECPGt_EOIT,
ECPGt_char,&(pointer),(long)0,(long)1,(1)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
-#line 89 "binary.pgc"
+#line 91 "binary.pgc"
if (sqlca.sqlcode)
{
@@ -189,7 +193,7 @@ main (void)
}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close A", ECPGt_EOIT, ECPGt_EORT);}
-#line 96 "binary.pgc"
+#line 98 "binary.pgc"
printf ("pointer=");
@@ -199,7 +203,7 @@ main (void)
free(pointer);
{ ECPGdisconnect(__LINE__, "CURRENT");}
-#line 104 "binary.pgc"
+#line 106 "binary.pgc"
exit (0);
}
diff --git a/src/interfaces/ecpg/test/expected/sql-binary.stderr b/src/interfaces/ecpg/test/expected/sql-binary.stderr
index e164a84..d6b4777 100644
--- a/src/interfaces/ecpg/test/expected/sql-binary.stderr
+++ b/src/interfaces/ecpg/test/expected/sql-binary.stderr
@@ -42,55 +42,61 @@
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 60: RESULT: \001m\000\212 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 71: query: declare B binary cursor for select name , accs , byte from empl where idnum = $1 ; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 69: query: close C; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 71: using PQexecParams
+[NO_PID]: ecpg_execute on line 69: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: free_params on line 71: parameter 1 = 1
+[NO_PID]: ecpg_execute on line 69: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 71: OK: DECLARE CURSOR
+[NO_PID]: ecpg_execute on line 73: query: declare B binary cursor for select name , accs , byte from empl where idnum = $1 ; with 1 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 72: query: fetch B; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 73: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 72: using PQexec
+[NO_PID]: free_params on line 73: parameter 1 = 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 72: correctly got 1 tuples with 3 fields
+[NO_PID]: ecpg_execute on line 73: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 72: RESULT: BINARY offset: -1; array: no
+[NO_PID]: ecpg_execute on line 74: query: fetch B; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 72: RESULT: BINARY offset: -1; array: no
+[NO_PID]: ecpg_execute on line 74: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 72: RESULT: BINARY offset: -1; array: no
+[NO_PID]: ecpg_execute on line 74: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 79: query: close B; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_get_data on line 74: RESULT: BINARY offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 79: using PQexec
+[NO_PID]: ecpg_get_data on line 74: RESULT: BINARY offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 79: OK: CLOSE CURSOR
+[NO_PID]: ecpg_get_data on line 74: RESULT: BINARY offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 88: query: declare A binary cursor for select byte from empl where idnum = $1 ; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 81: query: close B; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 88: using PQexecParams
+[NO_PID]: ecpg_execute on line 81: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: free_params on line 88: parameter 1 = 1
+[NO_PID]: ecpg_execute on line 81: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 88: OK: DECLARE CURSOR
+[NO_PID]: ecpg_execute on line 90: query: declare A binary cursor for select byte from empl where idnum = $1 ; with 1 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 89: query: fetch A; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 90: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 89: using PQexec
+[NO_PID]: free_params on line 90: parameter 1 = 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 89: correctly got 1 tuples with 1 fields
+[NO_PID]: ecpg_execute on line 90: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_store_result on line 89: allocating memory for 1 tuples
+[NO_PID]: ecpg_execute on line 91: query: fetch A; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 89: RESULT: BINARY offset: -1; array: no
+[NO_PID]: ecpg_execute on line 91: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 96: query: close A; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 91: correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 96: using PQexec
+[NO_PID]: ecpg_store_result on line 91: allocating memory for 1 tuples
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 96: OK: CLOSE CURSOR
+[NO_PID]: ecpg_get_data on line 91: RESULT: BINARY offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 98: query: close A; with 0 parameter(s) on connection regress1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 98: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 98: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection regress1 closed
[NO_PID]: sqlca: code: 0, state: 00000
diff --git a/src/interfaces/ecpg/test/sql/binary.pgc b/src/interfaces/ecpg/test/sql/binary.pgc
index 723027d..7cc77d2 100644
--- a/src/interfaces/ecpg/test/sql/binary.pgc
+++ b/src/interfaces/ecpg/test/sql/binary.pgc
@@ -66,6 +66,8 @@ main (void)
printf ("name=%s, accs=%d byte=%s\n", empl.name, empl.accs, empl.byte);
+ EXEC SQL CLOSE C;
+
memset(empl.name, 0, 21L);
EXEC SQL DECLARE B BINARY CURSOR FOR select name, accs, byte from empl where idnum =:empl.idnum;
EXEC SQL OPEN B;