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

Commitf9f458b

Browse files
author
Michael Meskes
committed
*** empty log message ***
1 parent2a76aa2 commitf9f458b

File tree

5 files changed

+14
-133
lines changed

5 files changed

+14
-133
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,5 +502,13 @@ Thu Mar 4 19:49:28 CET 1999
502502
Sat Mar 6 14:06:07 CET 1999
503503

504504
- Replaced placeholder ';;' by '?' since this is what standard says.
505+
506+
Mon Mar 8 17:07:14 CET 1999
507+
508+
- Corrected include directives to not include backend stuff.
509+
510+
Tue Mar 9 17:26:28 CET 1999
511+
512+
- Synced preproc.y with gram.y.
505513
- Set library version to 3.0.0
506514
- Set ecpg version to 2.6.0

‎src/interfaces/ecpg/preproc/preproc.y

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ adjust_array(enum ECPGttype type_enum, int *dimension, int *length, int type_dim
758758
%type<str>res_target_listres_target_elres_target_list2
759759
%type<str>res_target_el2opt_idrelation_namedatabase_name
760760
%type<str>access_methodattr_nameclassindex_namenamefunc_name
761-
%type<str>file_namerecipe_nameAexprConstParamNoTypeId
761+
%type<str>file_nameAexprConstParamNoTypeId
762762
%type<str>in_expr_nodesnot_in_expr_nodesa_exprb_expr
763763
%type<str>opt_indirectionexpr_listextract_listextract_arg
764764
%type<str>position_listposition_exprsubstr_listsubstr_from
@@ -787,7 +787,7 @@ adjust_array(enum ECPGttype type_enum, int *dimension, int *length, int type_dim
787787
%type<str>RuleActionBlockRuleActionMultijoin_list
788788
%type<str>RuleStmtopt_columnopt_nameoper_argtypes
789789
%type<str>MathOpRemoveFuncStmtaggr_argtypefor_update_clause
790-
%type<str>RemoveAggrStmtremove_typeRemoveStmtExtendStmtRecipeStmt
790+
%type<str>RemoveAggrStmtremove_typeRemoveStmtExtendStmt
791791
%type<str>RemoveOperStmtRenameStmtall_Opuser_valid_clause
792792
%type<str>VariableSetStmtvar_valuezone_valueVariableShowStmt
793793
%type<str>VariableResetStmtAddAttrStmtalter_clauseDropUserStmt
@@ -874,7 +874,6 @@ stmt: AddAttrStmt{ output_statement($1, 0); }
874874
|UnlistenStmt{ output_statement($1,0); }
875875
|LockStmt{ output_statement($1,0); }
876876
|ProcedureStmt{ output_statement($1,0); }
877-
|RecipeStmt{ output_statement($1,0); }
878877
|RemoveAggrStmt{ output_statement($1,0); }
879878
|RemoveOperStmt{ output_statement($1,0); }
880879
|RemoveFuncStmt{ output_statement($1,0); }
@@ -2149,13 +2148,13 @@ ExtendStmt: EXTEND INDEX index_name where_clause
21492148
*execute recipe <recipeName>
21502149
*
21512150
*****************************************************************************/
2152-
2151+
/* NOT USED
21532152
RecipeStmt: EXECUTE RECIPE recipe_name
21542153
{
21552154
$$ = cat2_str(make1_str("execute recipe"), $3);
21562155
}
21572156
;
2158-
2157+
*/
21592158
/*****************************************************************************
21602159
*
21612160
*QUERY:
@@ -4295,7 +4294,7 @@ name:ColId{ $$ = $1; };
42954294
func_name:ColId{$$ =$1; };
42964295

42974296
file_name:Sconst{$$ =$1; };
4298-
recipe_name:ident{$$ =$1; };
4297+
/* NOT USEDrecipe_name:ident{ $$ = $1; };*/
42994298

43004299
/* Constants
43014300
* Include TRUE/FALSE for SQL3 support. - thomas 1997-10-24
@@ -4414,7 +4413,7 @@ ColId: ident{ $$ = $1; }
44144413
|PRIVILEGES{$$ = make1_str("privileges"); }
44154414
|PROCEDURAL{$$ = make1_str("procedural"); }
44164415
|READ{$$ = make1_str("read"); }
4417-
|RECIPE{$$ = make1_str("recipe"); }
4416+
/* NOT USED| RECIPE{ $$ = make1_str("recipe"); }*/
44184417
|RELATIVE{$$ = make1_str("relative"); }
44194418
|RENAME{$$ = make1_str("rename"); }
44204419
|RETURNS{$$ = make1_str("returns"); }

‎src/interfaces/ecpg/test/test1.pgc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#include <stdio.h>
2-
31
exec sql whenever sqlerror sqlprint;
42

53
exec sql include sqlca;

‎src/interfaces/ecpg/test/test2.pgc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#include <stdio.h>
2-
31
exec sql include header_test;
42

53
exec sql type c is char reference;

‎src/interfaces/ecpg/test/test3.pgc

Lines changed: 0 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,3 @@
1-
#include <stdio.h>
2-
3-
exec sql include header_test;
4-
5-
exec sql type str is varchar[10];
6-
7-
int
8-
main ()
9-
{
10-
typedef struct { long born; short age; } birthinfo;
11-
exec sql type birthinfo is struct { long born; short age; };
12-
exec sql begin declare section;
13-
struct personal_struct{str name;
14-
birthinfo birth;
15-
} personal;
16-
struct personal_indicator {int ind_name;
17-
birthinfo ind_birth;
18-
} ind_personal;
19-
int *ind_married = NULL;
20-
int children;
21-
int ind_children;
22-
str *married = NULL;
23-
char *testname="Petra";
24-
char *query="select name, born, age, married, children from meskes where name = :var1";
25-
exec sql end declare section;
26-
27-
exec sql declare cur cursor for
28-
select name, born, age, married, children from meskes;
29-
30-
char msg[128], command[128];
31-
FILE *dbgs;
32-
33-
if ((dbgs = fopen("log", "w")) != NULL)
34-
ECPGdebug(1, dbgs);
35-
36-
strcpy(msg, "connect");
37-
exec sql connect to unix:postgresql://localhost:5432/mm;
38-
39-
strcpy(msg, "create");
40-
exec sql create table meskes(name char(8), born integer, age smallint, married date, children integer);
41-
42-
strcpy(msg, "insert");
43-
exec sql insert into meskes(name, married, children) values ('Petra', '19900404', 3);
44-
exec sql insert into meskes(name, born, age, married, children) values ('Michael', 19660117, 33, '19900404', 3);
45-
exec sql insert into meskes(name, born, age) values ('Carsten', 19910103, 8);
46-
exec sql insert into meskes(name, born, age) values ('Marc', 19930907, 5);
47-
exec sql insert into meskes(name, born, age) values ('Chris', 19970923, 1);
48-
49-
strcpy(msg, "commit");
50-
exec sql commit;
51-
52-
strcpy(msg, "open");
53-
exec sql open cur;
54-
55-
exec sql whenever not found do break;
56-
57-
while (1) {
58-
strcpy(msg, "fetch");
59-
exec sql fetch in cur into :personal:ind_personal, :married:ind_married, :children:ind_children;
60-
printf("%8.8s", personal.name.arr);
61-
if (ind_personal.ind_birth.born >= 0)
62-
printf(", born %d", personal.birth.born);
63-
if (ind_personal.ind_birth.age >= 0)
64-
printf(", age = %d", personal.birth.age);
65-
if (ind_married >= 0)
66-
printf(", married %10.10s", married->arr);
67-
if (ind_children >= 0)
68-
printf(", children = %d", children);
69-
putchar('\n');
70-
71-
free(married);
72-
married = NULL;
73-
}
74-
75-
strcpy(msg, "close");
76-
exec sql close cur;
77-
78-
/* and now the same query with prepare */
79-
exec sql prepare MM from :query;
80-
exec sql declare prep cursor for MM;
81-
82-
strcpy(msg, "open");
83-
exec sql open prep using :testname;
84-
85-
exec sql whenever not found do break;
86-
87-
while (1) {
88-
strcpy(msg, "fetch");
89-
exec sql fetch in prep into :personal:ind_personal, :married:ind_married, :children:ind_children;
90-
printf("%8.8s", personal.name.arr);
91-
if (ind_personal.ind_birth.born >= 0)
92-
printf(", born %d", personal.birth.born);
93-
if (ind_personal.ind_birth.age >= 0)
94-
printf(", age = %d", personal.birth.age);
95-
if (ind_married >= 0)
96-
printf(", married %10.10s", married->arr);
97-
if (ind_children >= 0)
98-
printf(", children = %d", children);
99-
putchar('\n');
100-
}
101-
102-
free(married);
103-
104-
strcpy(msg, "close");
105-
exec sql close prep;
106-
107-
strcpy(msg, "drop");
108-
exec sql drop table meskes;
109-
110-
strcpy(msg, "commit");
111-
exec sql commit;
112-
113-
strcpy(msg, "disconnect");
114-
115-
exec sql disconnect;
116-
if (dbgs != NULL)
117-
fclose(dbgs);
118-
119-
return (0);
120-
}
121-
#include <stdio.h>
122-
1231
exec sql include header_test;
1242

1253
exec sql type str is varchar[10];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp