aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/test
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2012-02-10 03:58:57 +0100
committerMichael Meskes <meskes@postgresql.org>2012-02-13 15:49:50 +0100
commit9a4880a0dd3cc94770aae2d372302642990c9fc1 (patch)
treee199abd5bd6dba392d1349fdec80c3620312d4a4 /src/interfaces/ecpg/test
parent21320763a39994021a4ff045ff66f7204bdb6d78 (diff)
downloadpostgresql-9a4880a0dd3cc94770aae2d372302642990c9fc1.tar.gz
postgresql-9a4880a0dd3cc94770aae2d372302642990c9fc1.zip
Do not use the variable name when defining a varchar structure in ecpg.
With a unique counter being added anyway, there is no need anymore to have the variable name listed, too.
Diffstat (limited to 'src/interfaces/ecpg/test')
-rw-r--r--src/interfaces/ecpg/test/expected/preproc-array_of_struct.c14
-rw-r--r--src/interfaces/ecpg/test/expected/preproc-cursor.c20
-rw-r--r--src/interfaces/ecpg/test/expected/preproc-type.c4
-rw-r--r--src/interfaces/ecpg/test/expected/preproc-variable.c8
-rw-r--r--src/interfaces/ecpg/test/preproc/type.pgc2
5 files changed, 24 insertions, 24 deletions
diff --git a/src/interfaces/ecpg/test/expected/preproc-array_of_struct.c b/src/interfaces/ecpg/test/expected/preproc-array_of_struct.c
index 5579ed4132e..9bb09cc38f4 100644
--- a/src/interfaces/ecpg/test/expected/preproc-array_of_struct.c
+++ b/src/interfaces/ecpg/test/expected/preproc-array_of_struct.c
@@ -32,7 +32,7 @@
typedef struct {
#line 12 "array_of_struct.pgc"
- struct varchar_name_1 { int len; char arr[ 50 ]; } name ;
+ struct varchar_1 { int len; char arr[ 50 ]; } name ;
#line 13 "array_of_struct.pgc"
int phone ;
@@ -61,7 +61,7 @@ int main()
typedef struct {
#line 30 "array_of_struct.pgc"
- struct varchar_name_2 { int len; char arr[ 50 ]; } name ;
+ struct varchar_2 { int len; char arr[ 50 ]; } name ;
#line 31 "array_of_struct.pgc"
int phone ;
@@ -95,7 +95,7 @@ int main()
#line 38 "array_of_struct.pgc"
struct customer3 {
#line 36 "array_of_struct.pgc"
- struct varchar_name_3 { int len; char arr[ 50 ]; } name ;
+ struct varchar_3 { int len; char arr[ 50 ]; } name ;
#line 37 "array_of_struct.pgc"
int phone ;
@@ -104,7 +104,7 @@ int main()
#line 43 "array_of_struct.pgc"
struct customer4 {
#line 41 "array_of_struct.pgc"
- struct varchar_name_4 { int len; char arr[ 50 ]; } name ;
+ struct varchar_4 { int len; char arr[ 50 ]; } name ;
#line 42 "array_of_struct.pgc"
int phone ;
@@ -114,7 +114,7 @@ int main()
int r ;
#line 45 "array_of_struct.pgc"
- struct varchar_onlyname_5 { int len; char arr[ 50 ]; } onlyname [ 2 ] ;
+ struct varchar_5 { int len; char arr[ 50 ]; } onlyname [ 2 ] ;
/* exec sql end declare section */
#line 46 "array_of_struct.pgc"
@@ -235,7 +235,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select * from customers limit 1", ECPGt_EOIT,
- ECPGt_varchar,&(custs4.name),(long)50,(long)1,sizeof(struct varchar_name_4),
+ ECPGt_varchar,&(custs4.name),(long)50,(long)1,sizeof(struct varchar_4),
ECPGt_short,&(inds[0].name_ind),(long)1,(long)1,sizeof(short),
ECPGt_int,&(custs4.phone),(long)1,(long)1,sizeof(int),
ECPGt_short,&(inds[0].phone_ind),(long)1,(long)1,sizeof(short), ECPGt_EORT);
@@ -255,7 +255,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
printf( "phone - %d\n", custs4.phone );
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select c from customers limit 2", ECPGt_EOIT,
- ECPGt_varchar,(onlyname),(long)50,(long)2,sizeof(struct varchar_onlyname_5),
+ ECPGt_varchar,(onlyname),(long)50,(long)2,sizeof(struct varchar_5),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 85 "array_of_struct.pgc"
diff --git a/src/interfaces/ecpg/test/expected/preproc-cursor.c b/src/interfaces/ecpg/test/expected/preproc-cursor.c
index 84ba020108a..150fc9a2433 100644
--- a/src/interfaces/ecpg/test/expected/preproc-cursor.c
+++ b/src/interfaces/ecpg/test/expected/preproc-cursor.c
@@ -75,7 +75,7 @@ main (void)
char * curname3 = CURNAME ;
#line 27 "cursor.pgc"
- struct varchar_curname4_1 { int len; char arr[ 50 ]; } curname4 ;
+ struct varchar_1 { int len; char arr[ 50 ]; } curname4 ;
#line 28 "cursor.pgc"
char * curname5 = CURNAME ;
@@ -664,7 +664,7 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "open");
{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "declare $0 cursor for $1",
- ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_curname4_1),
+ ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char_variable,(ECPGprepared_statement("test1", "st_id2", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
@@ -676,7 +676,7 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "fetch from");
{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch from $0",
- ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_curname4_1),
+ ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
@@ -691,7 +691,7 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "fetch");
{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0",
- ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_curname4_1),
+ ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
@@ -706,7 +706,7 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "fetch 1 from");
{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 from $0",
- ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_curname4_1),
+ ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
@@ -724,7 +724,7 @@ if (sqlca.sqlcode < 0) exit (1);}
{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 from $0",
ECPGt_int,&(count),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
- ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_curname4_1),
+ ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
@@ -739,7 +739,7 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "move");
{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "move absolute 0 $0",
- ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_curname4_1),
+ ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 226 "cursor.pgc"
@@ -749,7 +749,7 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "fetch 1");
{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch 1 $0",
- ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_curname4_1),
+ ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
@@ -767,7 +767,7 @@ if (sqlca.sqlcode < 0) exit (1);}
{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "fetch $0 $0",
ECPGt_int,&(count),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
- ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_curname4_1),
+ ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
@@ -782,7 +782,7 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "close");
{ ECPGdo(__LINE__, 0, 1, "test1", 0, ECPGst_normal, "close $0",
- ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_curname4_1),
+ ECPGt_varchar,&(curname4),(long)50,(long)1,sizeof(struct varchar_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 238 "cursor.pgc"
diff --git a/src/interfaces/ecpg/test/expected/preproc-type.c b/src/interfaces/ecpg/test/expected/preproc-type.c
index c18cfd675b4..f913158ff92 100644
--- a/src/interfaces/ecpg/test/expected/preproc-type.c
+++ b/src/interfaces/ecpg/test/expected/preproc-type.c
@@ -93,7 +93,7 @@ main (void)
c ptr = NULL ;
#line 36 "type.pgc"
- struct varchar_vc {
+ struct varchar {
#line 34 "type.pgc"
int len ;
@@ -150,7 +150,7 @@ main (void)
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,&(ptr),(long)0,(long)1,(1)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
- ECPGt_varchar,&(vc),(long)10,(long)1,sizeof(struct varchar_vc),
+ ECPGt_varchar,&(vc),(long)10,(long)1,sizeof(struct varchar),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 68 "type.pgc"
diff --git a/src/interfaces/ecpg/test/expected/preproc-variable.c b/src/interfaces/ecpg/test/expected/preproc-variable.c
index ca3032faca7..32e9778ee68 100644
--- a/src/interfaces/ecpg/test/expected/preproc-variable.c
+++ b/src/interfaces/ecpg/test/expected/preproc-variable.c
@@ -75,7 +75,7 @@ main (void)
#line 27 "variable.pgc"
struct personal_struct {
#line 25 "variable.pgc"
- struct varchar_name_1 { int len; char arr[ BUFFERSIZ ]; } name ;
+ struct varchar_1 { int len; char arr[ BUFFERSIZ ]; } name ;
#line 26 "variable.pgc"
struct birthinfo birth ;
@@ -94,10 +94,10 @@ main (void)
ind ind_children ;
struct t1 {
#line 32 "variable.pgc"
- struct varchar_name_2 { int len; char arr[ BUFFERSIZ ]; } name ;
+ struct varchar_2 { int len; char arr[ BUFFERSIZ ]; } name ;
} ; struct t2 {
#line 32 "variable.pgc"
- struct varchar_name_3 { int len; char arr[ BUFFERSIZ ]; } name ;
+ struct varchar_3 { int len; char arr[ BUFFERSIZ ]; } name ;
} ;/* exec sql end declare section */
#line 33 "variable.pgc"
@@ -207,7 +207,7 @@ if (sqlca.sqlcode < 0) exit (1);}
while (1) {
strcpy(msg, "fetch");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch cur", ECPGt_EOIT,
- ECPGt_varchar,&(p->name),(long)BUFFERSIZ,(long)1,sizeof(struct varchar_name_1),
+ ECPGt_varchar,&(p->name),(long)BUFFERSIZ,(long)1,sizeof(struct varchar_1),
ECPGt_int,&(i->ind_name),(long)1,(long)1,sizeof(int),
ECPGt_long,&(p->birth.born),(long)1,(long)1,sizeof(long),
ECPGt_long,&(i->ind_birth.born),(long)1,(long)1,sizeof(long),
diff --git a/src/interfaces/ecpg/test/preproc/type.pgc b/src/interfaces/ecpg/test/preproc/type.pgc
index 461401c8ee8..359a7f49a0c 100644
--- a/src/interfaces/ecpg/test/preproc/type.pgc
+++ b/src/interfaces/ecpg/test/preproc/type.pgc
@@ -29,7 +29,7 @@ main (void)
struct TBempl empl;
string str;
c ptr = NULL;
- struct varchar_vc
+ struct varchar
{
int len;
char text[10];