Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
abd310a3
Commit
abd310a3
authored
Jun 20, 2003
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow constants in using clauses.
parent
5fc9f3d5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
8 deletions
+38
-8
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+4
-0
src/interfaces/ecpg/ecpglib/execute.c
src/interfaces/ecpg/ecpglib/execute.c
+3
-2
src/interfaces/ecpg/ecpglib/typename.c
src/interfaces/ecpg/ecpglib/typename.c
+3
-1
src/interfaces/ecpg/include/ecpgtype.h
src/interfaces/ecpg/include/ecpgtype.h
+1
-0
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+15
-3
src/interfaces/ecpg/preproc/type.c
src/interfaces/ecpg/preproc/type.c
+11
-0
src/interfaces/ecpg/test/test2.pgc
src/interfaces/ecpg/test/test2.pgc
+1
-2
No files found.
src/interfaces/ecpg/ChangeLog
View file @
abd310a3
...
@@ -1501,6 +1501,10 @@ Thu Jun 19 10:08:26 CEST 2003
...
@@ -1501,6 +1501,10 @@ Thu Jun 19 10:08:26 CEST 2003
- Added missing rdayofweek function for Informix compatibility.
- Added missing rdayofweek function for Informix compatibility.
- Fixed fetch into char pointer.
- Fixed fetch into char pointer.
Fri Jun 20 13:23:07 CEST 2003
- Enabled constants in using clause.
- Set ecpg version to 3.0.0
- Set ecpg version to 3.0.0
- Set ecpg library to 4.0.0
- Set ecpg library to 4.0.0
- Set pgtypes library to 1.0.0
- Set pgtypes library to 1.0.0
...
...
src/interfaces/ecpg/ecpglib/execute.c
View file @
abd310a3
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.1
0 2003/06/15 04:07:58 momjian
Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.1
1 2003/06/20 12:00:59 meskes
Exp $ */
/*
/*
* The aim is to get a simpler inteface to the database routines.
* The aim is to get a simpler inteface to the database routines.
...
@@ -775,6 +775,7 @@ ECPGstore_input(const struct statement * stmt, const struct variable * var,
...
@@ -775,6 +775,7 @@ ECPGstore_input(const struct statement * stmt, const struct variable * var,
*
malloced_p
=
true
;
*
malloced_p
=
true
;
}
}
break
;
break
;
case
ECPGt_const
:
case
ECPGt_char_variable
:
case
ECPGt_char_variable
:
{
{
int
slen
=
strlen
((
char
*
)
var
->
value
);
int
slen
=
strlen
((
char
*
)
var
->
value
);
...
@@ -1214,7 +1215,7 @@ ECPGexecute(struct statement * stmt)
...
@@ -1214,7 +1215,7 @@ ECPGexecute(struct statement * stmt)
{
{
ECPGlog
(
"ECPGexecute line %d: ASYNC NOTIFY of '%s' from backend pid '%d' received
\n
"
,
ECPGlog
(
"ECPGexecute line %d: ASYNC NOTIFY of '%s' from backend pid '%d' received
\n
"
,
stmt
->
lineno
,
notify
->
relname
,
notify
->
be_pid
);
stmt
->
lineno
,
notify
->
relname
,
notify
->
be_pid
);
PQfreemem
(
notify
);
PQfreemem
(
notify
);
}
}
return
status
;
return
status
;
...
...
src/interfaces/ecpg/ecpglib/typename.c
View file @
abd310a3
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/typename.c,v 1.
5 2003/06/17 07:28:22
meskes Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/typename.c,v 1.
6 2003/06/20 12:00:59
meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
#include "postgres_fe.h"
...
@@ -56,6 +56,8 @@ ECPGtype_name(enum ECPGttype typ)
...
@@ -56,6 +56,8 @@ ECPGtype_name(enum ECPGttype typ)
return
"Timestamp"
;
return
"Timestamp"
;
case
ECPGt_interval
:
case
ECPGt_interval
:
return
"Interval"
;
return
"Interval"
;
case
ECPGt_char_const
:
return
"Const"
;
default:
default:
abort
();
abort
();
}
}
...
...
src/interfaces/ecpg/include/ecpgtype.h
View file @
abd310a3
...
@@ -53,6 +53,7 @@ enum ECPGttype
...
@@ -53,6 +53,7 @@ enum ECPGttype
ECPGt_union
,
ECPGt_union
,
ECPGt_descriptor
,
/* sql descriptor, no C variable */
ECPGt_descriptor
,
/* sql descriptor, no C variable */
ECPGt_char_variable
,
ECPGt_char_variable
,
ECPGt_const
,
/* a constant is needed sometimes */
ECPGt_EOIT
,
/* End of insert types. */
ECPGt_EOIT
,
/* End of insert types. */
ECPGt_EORT
,
/* End of result types. */
ECPGt_EORT
,
/* End of result types. */
ECPGt_NO_INDICATOR
/* no indicator */
ECPGt_NO_INDICATOR
/* no indicator */
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
abd310a3
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.23
4 2003/06/19 09:52:11
meskes Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.23
5 2003/06/20 12:00:59
meskes Exp $ */
/* Copyright comment */
/* Copyright comment */
%{
%{
...
@@ -475,7 +475,7 @@ adjust_informix(struct arguments *list)
...
@@ -475,7 +475,7 @@ adjust_informix(struct arguments *list)
%type <str> ECPGGetDescriptorHeader ECPGColLabel single_var_declaration
%type <str> ECPGGetDescriptorHeader ECPGColLabel single_var_declaration
%type <str> reserved_keyword unreserved_keyword ecpg_interval opt_ecpg_using
%type <str> reserved_keyword unreserved_keyword ecpg_interval opt_ecpg_using
%type <str> col_name_keyword func_name_keyword precision opt_scale
%type <str> col_name_keyword func_name_keyword precision opt_scale
%type <str> ECPGTypeName using_list ECPGColLabelCommon
%type <str> ECPGTypeName using_list ECPGColLabelCommon
UsingConst
%type <str> inf_val_list inf_col_list using_descriptor into_descriptor
%type <str> inf_val_list inf_col_list using_descriptor into_descriptor
%type <str> ecpg_into_using
%type <str> ecpg_into_using
...
@@ -5196,7 +5196,19 @@ ecpg_into: INTO into_list { $$ = EMPTY; }
...
@@ -5196,7 +5196,19 @@ ecpg_into: INTO into_list { $$ = EMPTY; }
| into_descriptor { $$ = $1; }
| into_descriptor { $$ = $1; }
;
;
using_list: civar | civar ',' using_list;
using_list: UsingConst | UsingConst ',' using_list;
UsingConst: AllConst
{
if ($1[1] != '?') /* found a constant */
{
char *length = mm_alloc(sizeof("INT_MAX")+1);
sprintf(length, "%d", strlen($1));
add_variable(&argsinsert, new_variable($1, ECPGmake_simple_type(ECPGt_const, length), 0), &no_indicator);
}
}
;
/*
/*
* As long as the prepare statement is not supported by the backend, we will
* As long as the prepare statement is not supported by the backend, we will
...
...
src/interfaces/ecpg/preproc/type.c
View file @
abd310a3
...
@@ -169,6 +169,9 @@ get_type(enum ECPGttype type)
...
@@ -169,6 +169,9 @@ get_type(enum ECPGttype type)
* quoted */
* quoted */
return
(
"ECPGt_char_variable"
);
return
(
"ECPGt_char_variable"
);
break
;
break
;
case
ECPGt_const
:
/* constant string quoted */
return
(
"ECPGt_const"
);
break
;
case
ECPGt_numeric
:
case
ECPGt_numeric
:
return
(
"ECPGt_numeric"
);
return
(
"ECPGt_numeric"
);
break
;
break
;
...
@@ -381,6 +384,14 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
...
@@ -381,6 +384,14 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
sprintf
(
variable
,
"&(%s%s)"
,
prefix
?
prefix
:
""
,
name
);
sprintf
(
variable
,
"&(%s%s)"
,
prefix
?
prefix
:
""
,
name
);
sprintf
(
offset
,
"sizeof(Date)"
);
sprintf
(
offset
,
"sizeof(Date)"
);
break
;
break
;
case
ECPGt_const
:
/*
* just dump the const as string
*/
sprintf
(
variable
,
"
\"
%s
\"
"
,
name
);
sprintf
(
offset
,
"strlen(
\"
%s
\"
)"
,
name
);
break
;
default:
default:
/*
/*
...
...
src/interfaces/ecpg/test/test2.pgc
View file @
abd310a3
...
@@ -27,7 +27,6 @@ exec sql begin declare section;
...
@@ -27,7 +27,6 @@ exec sql begin declare section;
struct birthinfo ind_birth;
struct birthinfo ind_birth;
} ind_personal, *i;
} ind_personal, *i;
ind ind_children;
ind ind_children;
c testname="Petra";
char *query="select name, born, age, married, children from meskes where name = :var1";
char *query="select name, born, age, married, children from meskes where name = :var1";
exec sql end declare section;
exec sql end declare section;
...
@@ -92,7 +91,7 @@ exec sql end declare section;
...
@@ -92,7 +91,7 @@ exec sql end declare section;
exec sql declare prep cursor for MM;
exec sql declare prep cursor for MM;
strcpy(msg, "open");
strcpy(msg, "open");
exec sql open prep using
:testname
;
exec sql open prep using
'Petra'
;
exec sql whenever not found do break;
exec sql whenever not found do break;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment