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

Commit61bee9f

Browse files
committed
Split ecpg_execute() in constituent parts
Split the rather long ecpg_execute() function into ecpg_build_params(),ecpg_autostart_transaction(), a smaller ecpg_execute() andecpg_process_output(). There is no user-visible change here, only codereorganization to support future patches.Author: Zoltán BöszörményiReviewed by Antonin Houska. Larger, older versions of this patch werereviewed by Noah Misch and Michael Meskes.
1 parent515d2c5 commit61bee9f

File tree

42 files changed

+625
-556
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+625
-556
lines changed

‎src/interfaces/ecpg/ecpglib/execute.c

Lines changed: 136 additions & 72 deletions
Large diffs are not rendered by default.

‎src/interfaces/ecpg/ecpglib/extern.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ struct statement
6363
char*oldlocale;
6464
intnparams;
6565
char**paramvalues;
66+
PGresult*results;
6667
};
6768

6869
/* structure to store prepared statements for a connection */
@@ -168,10 +169,14 @@ bool ecpg_store_result(const PGresult *results, int act_field,
168169
conststructstatement*stmt,structvariable*var);
169170
boolecpg_store_input(constint,constbool,conststructvariable*,char**,bool);
170171
voidecpg_free_params(structstatement*stmt,boolprint);
171-
voidecpg_do_epilogue(structstatement*);
172172
boolecpg_do_prologue(int,constint,constint,constchar*,constbool,
173173
enumECPG_statement_type,constchar*,va_list,
174174
structstatement**);
175+
boolecpg_build_params(structstatement*);
176+
boolecpg_autostart_transaction(structstatement*stmt);
177+
boolecpg_execute(structstatement*stmt);
178+
boolecpg_process_output(structstatement*,bool);
179+
voidecpg_do_epilogue(structstatement*);
175180
boolecpg_do(constint,constint,constint,constchar*,constbool,
176181
constint,constchar*,va_list);
177182

‎src/interfaces/ecpg/test/expected/compat_informix-describe.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@
66
[NO_PID]: sqlca: code: 0, state: 00000
77
[NO_PID]: ecpg_execute on line 30: using PQexec
88
[NO_PID]: sqlca: code: 0, state: 00000
9-
[NO_PID]:ecpg_execute on line 30: OK: SET
9+
[NO_PID]:ecpg_process_output on line 30: OK: SET
1010
[NO_PID]: sqlca: code: 0, state: 00000
1111
[NO_PID]: ecpg_execute on line 33: query: create table descr_t1 ( id serial primary key , t text ); with 0 parameter(s) on connection regress1
1212
[NO_PID]: sqlca: code: 0, state: 00000
1313
[NO_PID]: ecpg_execute on line 33: using PQexec
1414
[NO_PID]: sqlca: code: 0, state: 00000
15-
[NO_PID]:ecpg_execute on line 33: OK: CREATE TABLE
15+
[NO_PID]:ecpg_process_output on line 33: OK: CREATE TABLE
1616
[NO_PID]: sqlca: code: 0, state: 00000
1717
[NO_PID]: ecpg_execute on line 36: query: insert into descr_t1 ( id , t ) values ( default , 'a' ); with 0 parameter(s) on connection regress1
1818
[NO_PID]: sqlca: code: 0, state: 00000
1919
[NO_PID]: ecpg_execute on line 36: using PQexec
2020
[NO_PID]: sqlca: code: 0, state: 00000
21-
[NO_PID]:ecpg_execute on line 36: OK: INSERT 0 1
21+
[NO_PID]:ecpg_process_output on line 36: OK: INSERT 0 1
2222
[NO_PID]: sqlca: code: 0, state: 00000
2323
[NO_PID]: ecpg_execute on line 37: query: insert into descr_t1 ( id , t ) values ( default , 'b' ); with 0 parameter(s) on connection regress1
2424
[NO_PID]: sqlca: code: 0, state: 00000
2525
[NO_PID]: ecpg_execute on line 37: using PQexec
2626
[NO_PID]: sqlca: code: 0, state: 00000
27-
[NO_PID]:ecpg_execute on line 37: OK: INSERT 0 1
27+
[NO_PID]:ecpg_process_output on line 37: OK: INSERT 0 1
2828
[NO_PID]: sqlca: code: 0, state: 00000
2929
[NO_PID]: ecpg_execute on line 38: query: insert into descr_t1 ( id , t ) values ( default , 'c' ); with 0 parameter(s) on connection regress1
3030
[NO_PID]: sqlca: code: 0, state: 00000
3131
[NO_PID]: ecpg_execute on line 38: using PQexec
3232
[NO_PID]: sqlca: code: 0, state: 00000
33-
[NO_PID]:ecpg_execute on line 38: OK: INSERT 0 1
33+
[NO_PID]:ecpg_process_output on line 38: OK: INSERT 0 1
3434
[NO_PID]: sqlca: code: 0, state: 00000
3535
[NO_PID]: ecpg_execute on line 39: query: insert into descr_t1 ( id , t ) values ( default , 'd' ); with 0 parameter(s) on connection regress1
3636
[NO_PID]: sqlca: code: 0, state: 00000
3737
[NO_PID]: ecpg_execute on line 39: using PQexec
3838
[NO_PID]: sqlca: code: 0, state: 00000
39-
[NO_PID]:ecpg_execute on line 39: OK: INSERT 0 1
39+
[NO_PID]:ecpg_process_output on line 39: OK: INSERT 0 1
4040
[NO_PID]: sqlca: code: 0, state: 00000
4141
[NO_PID]: ECPGtrans on line 42: action "commit"; connection "regress1"
4242
[NO_PID]: sqlca: code: 0, state: 00000
@@ -104,7 +104,7 @@
104104
[NO_PID]: sqlca: code: 0, state: 00000
105105
[NO_PID]: ecpg_execute on line 190: using PQexec
106106
[NO_PID]: sqlca: code: 0, state: 00000
107-
[NO_PID]:ecpg_execute on line 190: OK: DROP TABLE
107+
[NO_PID]:ecpg_process_output on line 190: OK: DROP TABLE
108108
[NO_PID]: sqlca: code: 0, state: 00000
109109
[NO_PID]: ECPGtrans on line 193: action "commit"; connection "regress1"
110110
[NO_PID]: sqlca: code: 0, state: 00000

‎src/interfaces/ecpg/test/expected/compat_informix-rnull.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[NO_PID]: sqlca: code: 0, state: 00000
77
[NO_PID]: ecpg_execute on line 31: using PQexec
88
[NO_PID]: sqlca: code: 0, state: 00000
9-
[NO_PID]:ecpg_execute on line 31: OK: CREATE TABLE
9+
[NO_PID]:ecpg_process_output on line 31: OK: CREATE TABLE
1010
[NO_PID]: sqlca: code: 0, state: 00000
1111
[NO_PID]: ECPGtrans on line 34: action "commit"; connection "regress1"
1212
[NO_PID]: sqlca: code: 0, state: 00000
@@ -28,7 +28,7 @@
2828
[NO_PID]: sqlca: code: 0, state: 00000
2929
[NO_PID]: ecpg_free_params on line 36: parameter 7 = 404.404
3030
[NO_PID]: sqlca: code: 0, state: 00000
31-
[NO_PID]:ecpg_execute on line 36: OK: INSERT 0 1
31+
[NO_PID]:ecpg_process_output on line 36: OK: INSERT 0 1
3232
[NO_PID]: sqlca: code: 0, state: 00000
3333
[NO_PID]: ECPGtrans on line 39: action "commit"; connection "regress1"
3434
[NO_PID]: sqlca: code: 0, state: 00000
@@ -56,15 +56,15 @@
5656
[NO_PID]: sqlca: code: 0, state: 00000
5757
[NO_PID]: ecpg_free_params on line 52: parameter 10 = null
5858
[NO_PID]: sqlca: code: 0, state: 00000
59-
[NO_PID]:ecpg_execute on line 52: OK: INSERT 0 1
59+
[NO_PID]:ecpg_process_output on line 52: OK: INSERT 0 1
6060
[NO_PID]: sqlca: code: 0, state: 00000
6161
[NO_PID]: ECPGtrans on line 55: action "commit"; connection "regress1"
6262
[NO_PID]: sqlca: code: 0, state: 00000
6363
[NO_PID]: ecpg_execute on line 59: query: select c , s , i , b , f , l , dbl , dec , dat , tmp from test where id = 1; with 0 parameter(s) on connection regress1
6464
[NO_PID]: sqlca: code: 0, state: 00000
6565
[NO_PID]: ecpg_execute on line 59: using PQexec
6666
[NO_PID]: sqlca: code: 0, state: 00000
67-
[NO_PID]:ecpg_execute on line 59: correctly got 1 tuples with 10 fields
67+
[NO_PID]:ecpg_process_output on line 59: correctly got 1 tuples with 10 fields
6868
[NO_PID]: sqlca: code: 0, state: 00000
6969
[NO_PID]: ecpg_get_data on line 59: RESULT: abc offset: -1; array: no
7070
[NO_PID]: sqlca: code: 0, state: 00000
@@ -90,7 +90,7 @@
9090
[NO_PID]: sqlca: code: 0, state: 00000
9191
[NO_PID]: ecpg_execute on line 76: using PQexec
9292
[NO_PID]: sqlca: code: 0, state: 00000
93-
[NO_PID]:ecpg_execute on line 76: correctly got 1 tuples with 10 fields
93+
[NO_PID]:ecpg_process_output on line 76: correctly got 1 tuples with 10 fields
9494
[NO_PID]: sqlca: code: 0, state: 00000
9595
[NO_PID]: ecpg_get_data on line 76: RESULT: offset: -1; array: no
9696
[NO_PID]: sqlca: code: 0, state: 00000
@@ -116,7 +116,7 @@
116116
[NO_PID]: sqlca: code: 0, state: 00000
117117
[NO_PID]: ecpg_execute on line 91: using PQexec
118118
[NO_PID]: sqlca: code: 0, state: 00000
119-
[NO_PID]:ecpg_execute on line 91: OK: DROP TABLE
119+
[NO_PID]:ecpg_process_output on line 91: OK: DROP TABLE
120120
[NO_PID]: sqlca: code: 0, state: 00000
121121
[NO_PID]: ECPGtrans on line 92: action "commit"; connection "regress1"
122122
[NO_PID]: sqlca: code: 0, state: 00000

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp