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
776d5309
Commit
776d5309
authored
May 30, 2003
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create a real prototype function for describe.
parent
a0fed291
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
18 deletions
+32
-18
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+4
-0
src/interfaces/ecpg/ecpglib/descriptor.c
src/interfaces/ecpg/ecpglib/descriptor.c
+8
-1
src/interfaces/ecpg/include/ecpglib.h
src/interfaces/ecpg/include/ecpglib.h
+2
-0
src/interfaces/ecpg/preproc/output.c
src/interfaces/ecpg/preproc/output.c
+2
-2
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+16
-15
No files found.
src/interfaces/ecpg/ChangeLog
View file @
776d5309
...
@@ -1464,6 +1464,10 @@ Fri May 30 10:29:49 CEST 2003
...
@@ -1464,6 +1464,10 @@ Fri May 30 10:29:49 CEST 2003
- Synced parser.
- Synced parser.
- Added a dummy rule for EXEC SQL DESCRIBE that throws an error
- Added a dummy rule for EXEC SQL DESCRIBE that throws an error
message.
message.
Fri May 30 15:19:39 CEST 2003
- Implemented prototype describe function.
- Some minor cleanup/bug fixing.
- Some minor cleanup/bug fixing.
- Set ecpg version to 2.12.0.
- Set ecpg version to 2.12.0.
- Set ecpg library to 3.4.2.
- Set ecpg library to 3.4.2.
...
...
src/interfaces/ecpg/ecpglib/descriptor.c
View file @
776d5309
/* dynamic SQL support routines
/* dynamic SQL support routines
*
*
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.
1 2003/03/16 10:42:53
meskes Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.
2 2003/05/30 13:22:02
meskes Exp $
*/
*/
#include "postgres_fe.h"
#include "postgres_fe.h"
...
@@ -447,3 +447,10 @@ ECPGdescriptor_lvalue(int line, const char *descriptor)
...
@@ -447,3 +447,10 @@ ECPGdescriptor_lvalue(int line, const char *descriptor)
ECPGraise
(
line
,
ECPG_UNKNOWN_DESCRIPTOR
,
(
char
*
)
descriptor
);
ECPGraise
(
line
,
ECPG_UNKNOWN_DESCRIPTOR
,
(
char
*
)
descriptor
);
return
NULL
;
return
NULL
;
}
}
bool
ECPGdescribe
(
int
line
,
bool
input
,
const
char
*
statement
,
...)
{
ECPGlog
(
"ECPGdescribe called on line %d for %s in %s
\n
"
,
line
,
(
input
)
?
"input"
:
"output"
,
statement
);
return
false
;
}
src/interfaces/ecpg/include/ecpglib.h
View file @
776d5309
...
@@ -72,6 +72,8 @@ void ECPGraise(int line, int code, const char *str);
...
@@ -72,6 +72,8 @@ void ECPGraise(int line, int code, const char *str);
bool
ECPGget_desc_header
(
int
,
char
*
,
int
*
);
bool
ECPGget_desc_header
(
int
,
char
*
,
int
*
);
bool
ECPGget_desc
(
int
,
char
*
,
int
,...);
bool
ECPGget_desc
(
int
,
char
*
,
int
,...);
bool
ECPGdescribe
(
int
,
bool
,
const
char
*
,
...);
/* dynamic result allocation */
/* dynamic result allocation */
void
ECPGfree_auto_mem
(
void
);
void
ECPGfree_auto_mem
(
void
);
...
...
src/interfaces/ecpg/preproc/output.c
View file @
776d5309
...
@@ -15,7 +15,7 @@ output_simple_statement(char *cmd)
...
@@ -15,7 +15,7 @@ output_simple_statement(char *cmd)
int
i
,
int
i
,
j
=
strlen
(
cmd
);;
j
=
strlen
(
cmd
);;
/*
do
this char by char as we have to filter '\"' */
/*
output
this char by char as we have to filter '\"' */
for
(
i
=
0
;
i
<
j
;
i
++
)
for
(
i
=
0
;
i
<
j
;
i
++
)
{
{
if
(
cmd
[
i
]
!=
'"'
)
if
(
cmd
[
i
]
!=
'"'
)
...
@@ -111,7 +111,7 @@ output_statement(char *stmt, int mode, char *con)
...
@@ -111,7 +111,7 @@ output_statement(char *stmt, int mode, char *con)
fprintf
(
yyout
,
"{ ECPGdo(__LINE__, %s,
\"
"
,
con
?
con
:
"NULL"
);
fprintf
(
yyout
,
"{ ECPGdo(__LINE__, %s,
\"
"
,
con
?
con
:
"NULL"
);
/*
do
this char by char as we have to filter '\"' */
/*
output
this char by char as we have to filter '\"' */
for
(
i
=
0
;
i
<
j
;
i
++
)
for
(
i
=
0
;
i
<
j
;
i
++
)
{
{
if
(
stmt
[
i
]
!=
'"'
)
if
(
stmt
[
i
]
!=
'"'
)
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
776d5309
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.22
6 2003/05/30 08:39:01
meskes Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.22
7 2003/05/30 13:22:02
meskes Exp $ */
/* Copyright comment */
/* Copyright comment */
%{
%{
...
@@ -438,18 +438,17 @@ create_questionmarks(char *name, bool array)
...
@@ -438,18 +438,17 @@ create_questionmarks(char *name, bool array)
%type <str> ECPGFree ECPGDeclare ECPGVar opt_at enum_definition
%type <str> ECPGFree ECPGDeclare ECPGVar opt_at enum_definition
%type <str> struct_union_type s_struct_union vt_declarations
%type <str> struct_union_type s_struct_union vt_declarations
%type <str> var_declaration type_declaration single_vt_declaration
%type <str> var_declaration type_declaration single_vt_declaration
%type <str> ECPGSetAutocommit on_off variable_declarations
%type <str> ECPGSetAutocommit on_off variable_declarations
ECPGDescribe
%type <str> ECPGAllocateDescr ECPGDeallocateDescr symbol opt_output
%type <str> ECPGAllocateDescr ECPGDeallocateDescr symbol opt_output
%type <str> ECPGGetDescriptorHeader ECPGColLabel single_var_declaration
%type <str> ECPGGetDescriptorHeader ECPGColLabel single_var_declaration
%type <str> reserved_keyword unreserved_keyword ecpg_interval
%type <str> reserved_keyword unreserved_keyword ecpg_interval
%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 variablelist ECPGColLabelCommon c_variable
%type <str> ECPGTypeName variablelist ECPGColLabelCommon c_variable
%type <str> inf_val_list inf_col_list using_descriptor ECPGDescribe
%type <str> inf_val_list inf_col_list using_descriptor into_descriptor
%type <str> into_descriptor
%type <struct_union> s_struct_union_symbol
%type <struct_union> s_struct_union_symbol
%type <descriptor> ECPGGetDescriptor
%type <descriptor> ECPGGetDescriptor
%type <type_enum> simple_type signed_type unsigned_type
%type <type_enum> simple_type signed_type unsigned_type
...
@@ -617,10 +616,12 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); }
...
@@ -617,10 +616,12 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); }
}
}
| ECPGDescribe
| ECPGDescribe
{
{
if (connection)
fprintf(yyout, "{ ECPGdescribe(__LINE__, %s,", $1);
mmerror(PARSE_ERROR, ET_ERROR, "no at option for describe statement.\n");
dump_variables(argsresult, 1);
fputs("ECPGt_EORT);", yyout);
fprintf(yyout, "{ /* ECPGdescribe(__LINE__, %s) */;", $1);
fprintf(yyout, "}");
output_line_number();
/* whenever_action(2); */
/* whenever_action(2); */
free($1);
free($1);
}
}
...
@@ -5186,18 +5187,18 @@ ECPGPrepare: PREPARE name FROM execstring
...
@@ -5186,18 +5187,18 @@ ECPGPrepare: PREPARE name FROM execstring
*/
*/
ECPGDescribe: SQL_DESCRIBE INPUT_P name using_descriptor
ECPGDescribe: SQL_DESCRIBE INPUT_P name using_descriptor
{
{
mmerror(PARSE_ERROR, ET_
ERROR
, "using unsupported describe statement.\n");
mmerror(PARSE_ERROR, ET_
WARNING
, "using unsupported describe statement.\n");
$$ = cat_str(3, make_str("
input"), $3, $4
);
$$ = cat_str(3, make_str("
1, ECPGprepared_statement(\""), $3, make_str("\")")
);
}
}
| SQL_DESCRIBE opt_output name using_descriptor
| SQL_DESCRIBE opt_output name using_descriptor
{
{
mmerror(PARSE_ERROR, ET_
ERROR
, "using unsupported describe statement.\n");
mmerror(PARSE_ERROR, ET_
WARNING
, "using unsupported describe statement.\n");
$$ = cat_str(3,
$2, $3, $4
);
$$ = cat_str(3,
make_str("0, ECPGprepared_statement(\""), $3, make_str("\")")
);
}
}
| SQL_DESCRIBE opt_output name into_descriptor
| SQL_DESCRIBE opt_output name into_descriptor
{
{
mmerror(PARSE_ERROR, ET_
ERROR
, "using unsupported describe statement.\n");
mmerror(PARSE_ERROR, ET_
WARNING
, "using unsupported describe statement.\n");
$$ = cat_str(3,
$2, $3, $4
);
$$ = cat_str(3,
make_str("0, ECPGprepared_statement(\""), $3, make_str("\")")
);
}
}
;
;
...
...
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