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
aad21d4c
Commit
aad21d4c
authored
Mar 01, 2019
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix whitespace
parent
97b6f2eb
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
130 additions
and
132 deletions
+130
-132
src/interfaces/ecpg/ecpglib/misc.c
src/interfaces/ecpg/ecpglib/misc.c
+6
-6
src/interfaces/ecpg/ecpglib/prepare.c
src/interfaces/ecpg/ecpglib/prepare.c
+4
-4
src/interfaces/ecpg/test/expected/sql-bytea.c
src/interfaces/ecpg/test/expected/sql-bytea.c
+52
-53
src/interfaces/ecpg/test/expected/sql-bytea.stderr
src/interfaces/ecpg/test/expected/sql-bytea.stderr
+68
-68
src/interfaces/ecpg/test/sql/bytea.pgc
src/interfaces/ecpg/test/sql/bytea.pgc
+0
-1
No files found.
src/interfaces/ecpg/ecpglib/misc.c
View file @
aad21d4c
...
...
@@ -535,13 +535,13 @@ ECPGset_var(int number, void *pointer, int lineno)
struct
sqlca_t
*
sqlca
=
ECPGget_sqlca
();
if
(
sqlca
==
NULL
)
{
ecpg_raise
(
lineno
,
ECPG_OUT_OF_MEMORY
,
ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY
,
NULL
);
return
;
}
{
ecpg_raise
(
lineno
,
ECPG_OUT_OF_MEMORY
,
ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY
,
NULL
);
return
;
}
ecpg_init_sqlca
(
sqlca
);
ecpg_init_sqlca
(
sqlca
);
for
(
ptr
=
ivlist
;
ptr
!=
NULL
;
ptr
=
ptr
->
next
)
{
...
...
src/interfaces/ecpg/ecpglib/prepare.c
View file @
aad21d4c
...
...
@@ -36,11 +36,11 @@ typedef struct
static
int
nextStmtID
=
1
;
static
stmtCacheEntry
*
stmtCacheEntries
=
NULL
;
static
struct
declared_statement
*
g_declared_list
;
static
struct
declared_statement
*
g_declared_list
;
static
bool
deallocate_one
(
int
lineno
,
enum
COMPAT_MODE
c
,
struct
connection
*
con
,
struct
prepared_statement
*
prev
,
struct
prepared_statement
*
this
);
static
struct
declared_statement
*
ecpg_find_declared_statement
(
const
char
*
);
static
struct
declared_statement
*
ecpg_find_declared_statement
(
const
char
*
);
static
bool
isvarchar
(
unsigned
char
c
)
{
...
...
@@ -177,14 +177,14 @@ ECPGprepare(int lineno, const char *connection_name, const bool questionmarks,
struct
connection
*
con
;
struct
prepared_statement
*
this
,
*
prev
;
const
char
*
real_connection_name
=
NULL
;
const
char
*
real_connection_name
=
NULL
;
(
void
)
questionmarks
;
/* quiet the compiler */
real_connection_name
=
ecpg_get_con_name_by_declared_name
(
name
);
if
(
real_connection_name
==
NULL
)
{
/*
/*
* If can't get the connection name by declared name then using connection name
* coming from the parameter connection_name
*/
...
...
src/interfaces/ecpg/test/expected/sql-bytea.c
View file @
aad21d4c
...
...
@@ -80,7 +80,6 @@ main(void)
memset(recv_short_buf.arr, 0x0, sizeof(recv_short_buf.arr)); \
} \
while (0)
ECPGdebug
(
1
,
stderr
);
...
...
@@ -93,71 +92,71 @@ while (0)
}
{
ECPGconnect
(
__LINE__
,
0
,
"ecpg1_regression"
,
NULL
,
NULL
,
NULL
,
0
);
#line 5
8
"bytea.pgc"
#line 5
7
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 5
8
"bytea.pgc"
#line 5
7
"bytea.pgc"
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_normal
,
"create table if not exists test ( data1 bytea , data2 bytea )"
,
ECPGt_EOIT
,
ECPGt_EORT
);
#line
60
"bytea.pgc"
#line
59
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line
60
"bytea.pgc"
#line
59
"bytea.pgc"
{
ECPGprepare
(
__LINE__
,
NULL
,
0
,
"ins_stmt"
,
"insert into test values(?,?)"
);
#line 6
2
"bytea.pgc"
#line 6
1
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 6
2
"bytea.pgc"
#line 6
1
"bytea.pgc"
{
ECPGprepare
(
__LINE__
,
NULL
,
0
,
"sel_stmt"
,
"select data1,data2 from test"
);
#line 6
3
"bytea.pgc"
#line 6
2
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 6
3
"bytea.pgc"
#line 6
2
"bytea.pgc"
ECPGallocate_desc
(
__LINE__
,
"idesc"
);
#line 6
4
"bytea.pgc"
#line 6
3
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();
#line 6
4
"bytea.pgc"
#line 6
3
"bytea.pgc"
ECPGallocate_desc
(
__LINE__
,
"odesc"
);
#line 6
5
"bytea.pgc"
#line 6
4
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();
#line 6
5
"bytea.pgc"
#line 6
4
"bytea.pgc"
/* Test for static sql statement with normal host variable, indicator */
init
();
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_normal
,
"truncate test"
,
ECPGt_EOIT
,
ECPGt_EORT
);
#line 6
9
"bytea.pgc"
#line 6
8
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 6
9
"bytea.pgc"
#line 6
8
"bytea.pgc"
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_normal
,
"insert into test values ( $1 , $2 )"
,
ECPGt_bytea
,
&
(
send_buf
[
0
]),(
long
)
DATA_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_1
),
ECPGt_NO_INDICATOR
,
NULL
,
0L
,
0L
,
0L
,
ECPGt_bytea
,
&
(
send_buf
[
1
]),(
long
)
DATA_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_1
),
ECPGt_NO_INDICATOR
,
NULL
,
0L
,
0L
,
0L
,
ECPGt_EOIT
,
ECPGt_EORT
);
#line
70
"bytea.pgc"
#line
69
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line
70
"bytea.pgc"
#line
69
"bytea.pgc"
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_normal
,
"select data1 , data2 from test"
,
ECPGt_EOIT
,
ECPGt_bytea
,
&
(
recv_buf
[
0
]),(
long
)
DATA_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_2
),
ECPGt_int
,
&
(
ind
[
0
]),(
long
)
1
,(
long
)
1
,
sizeof
(
int
),
ECPGt_bytea
,
&
(
recv_short_buf
),(
long
)
DATA_SIZE
-
LACK_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_4
),
ECPGt_int
,
&
(
ind
[
1
]),(
long
)
1
,(
long
)
1
,
sizeof
(
int
),
ECPGt_EORT
);
#line 7
1
"bytea.pgc"
#line 7
0
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 7
1
"bytea.pgc"
#line 7
0
"bytea.pgc"
dump_binary
(
recv_buf
[
0
].
arr
,
recv_buf
[
0
].
len
,
ind
[
0
]);
dump_binary
(
recv_short_buf
.
arr
,
recv_short_buf
.
len
,
ind
[
1
]);
...
...
@@ -165,38 +164,38 @@ if (sqlca.sqlcode < 0) sqlprint();}
/* Test for variable length array */
init
();
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_normal
,
"truncate test"
,
ECPGt_EOIT
,
ECPGt_EORT
);
#line 7
7
"bytea.pgc"
#line 7
6
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 7
7
"bytea.pgc"
#line 7
6
"bytea.pgc"
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_normal
,
"insert into test values ( $1 , $2 )"
,
ECPGt_bytea
,
&
(
send_buf
[
0
]),(
long
)
DATA_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_1
),
ECPGt_NO_INDICATOR
,
NULL
,
0L
,
0L
,
0L
,
ECPGt_bytea
,
&
(
send_buf
[
1
]),(
long
)
DATA_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_1
),
ECPGt_NO_INDICATOR
,
NULL
,
0L
,
0L
,
0L
,
ECPGt_EOIT
,
ECPGt_EORT
);
#line 7
8
"bytea.pgc"
#line 7
7
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 7
8
"bytea.pgc"
#line 7
7
"bytea.pgc"
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_normal
,
"insert into test values ( $1 , $2 )"
,
ECPGt_bytea
,
&
(
send_buf
[
0
]),(
long
)
DATA_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_1
),
ECPGt_NO_INDICATOR
,
NULL
,
0L
,
0L
,
0L
,
ECPGt_bytea
,
&
(
send_buf
[
1
]),(
long
)
DATA_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_1
),
ECPGt_NO_INDICATOR
,
NULL
,
0L
,
0L
,
0L
,
ECPGt_EOIT
,
ECPGt_EORT
);
#line 7
9
"bytea.pgc"
#line 7
8
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 7
9
"bytea.pgc"
#line 7
8
"bytea.pgc"
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_normal
,
"select data1 from test"
,
ECPGt_EOIT
,
ECPGt_bytea
,
&
(
recv_vlen_buf
),(
long
)
DATA_SIZE
,(
long
)
0
,
sizeof
(
struct
bytea_3
),
ECPGt_NO_INDICATOR
,
NULL
,
0L
,
0L
,
0L
,
ECPGt_EORT
);
#line
80
"bytea.pgc"
#line
79
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line
80
"bytea.pgc"
#line
79
"bytea.pgc"
dump_binary
(
recv_vlen_buf
[
0
].
arr
,
recv_vlen_buf
[
0
].
len
,
0
);
dump_binary
(
recv_vlen_buf
[
1
].
arr
,
recv_vlen_buf
[
1
].
len
,
0
);
...
...
@@ -205,30 +204,30 @@ if (sqlca.sqlcode < 0) sqlprint();}
/* Test for dynamic sql statement with normal host variable, indicator */
init
();
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_normal
,
"truncate test"
,
ECPGt_EOIT
,
ECPGt_EORT
);
#line 8
7
"bytea.pgc"
#line 8
6
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 8
7
"bytea.pgc"
#line 8
6
"bytea.pgc"
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_execute
,
"ins_stmt"
,
ECPGt_bytea
,
&
(
send_buf
[
0
]),(
long
)
DATA_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_1
),
ECPGt_NO_INDICATOR
,
NULL
,
0L
,
0L
,
0L
,
ECPGt_bytea
,
&
(
send_buf
[
1
]),(
long
)
DATA_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_1
),
ECPGt_NO_INDICATOR
,
NULL
,
0L
,
0L
,
0L
,
ECPGt_EOIT
,
ECPGt_EORT
);
#line 8
8
"bytea.pgc"
#line 8
7
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 8
8
"bytea.pgc"
#line 8
7
"bytea.pgc"
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_execute
,
"sel_stmt"
,
ECPGt_EOIT
,
ECPGt_bytea
,
&
(
recv_buf
[
0
]),(
long
)
DATA_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_2
),
ECPGt_int
,
&
(
ind
[
0
]),(
long
)
1
,(
long
)
1
,
sizeof
(
int
),
ECPGt_bytea
,
&
(
recv_short_buf
),(
long
)
DATA_SIZE
-
LACK_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_4
),
ECPGt_int
,
&
(
ind
[
1
]),(
long
)
1
,(
long
)
1
,
sizeof
(
int
),
ECPGt_EORT
);
#line 8
9
"bytea.pgc"
#line 8
8
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 8
9
"bytea.pgc"
#line 8
8
"bytea.pgc"
dump_binary
(
recv_buf
[
0
].
arr
,
recv_buf
[
0
].
len
,
ind
[
0
]);
dump_binary
(
recv_short_buf
.
arr
,
recv_short_buf
.
len
,
ind
[
1
]);
...
...
@@ -236,81 +235,81 @@ if (sqlca.sqlcode < 0) sqlprint();}
/* Test for dynamic sql statement with sql descriptor */
init
();
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_normal
,
"truncate test"
,
ECPGt_EOIT
,
ECPGt_EORT
);
#line 9
5
"bytea.pgc"
#line 9
4
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 9
5
"bytea.pgc"
#line 9
4
"bytea.pgc"
{
ECPGset_desc
(
__LINE__
,
"idesc"
,
1
,
ECPGd_data
,
ECPGt_bytea
,
&
(
send_buf
[
0
]),(
long
)
DATA_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_1
),
ECPGd_EODT
);
#line 9
6
"bytea.pgc"
#line 9
5
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 9
6
"bytea.pgc"
#line 9
5
"bytea.pgc"
{
ECPGset_desc
(
__LINE__
,
"idesc"
,
2
,
ECPGd_data
,
ECPGt_bytea
,
&
(
send_buf
[
1
]),(
long
)
DATA_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_1
),
ECPGd_EODT
);
#line 9
7
"bytea.pgc"
#line 9
6
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 9
7
"bytea.pgc"
#line 9
6
"bytea.pgc"
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_execute
,
"ins_stmt"
,
ECPGt_descriptor
,
"idesc"
,
1L
,
1L
,
1L
,
ECPGt_NO_INDICATOR
,
NULL
,
0L
,
0L
,
0L
,
ECPGt_EOIT
,
ECPGt_EORT
);
#line 9
8
"bytea.pgc"
#line 9
7
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 9
8
"bytea.pgc"
#line 9
7
"bytea.pgc"
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_execute
,
"sel_stmt"
,
ECPGt_EOIT
,
ECPGt_descriptor
,
"odesc"
,
1L
,
1L
,
1L
,
ECPGt_NO_INDICATOR
,
NULL
,
0L
,
0L
,
0L
,
ECPGt_EORT
);
#line 9
9
"bytea.pgc"
#line 9
8
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 9
9
"bytea.pgc"
#line 9
8
"bytea.pgc"
{
ECPGget_desc
(
__LINE__
,
"odesc"
,
1
,
ECPGd_indicator
,
ECPGt_int
,
&
(
ind
[
0
]),(
long
)
1
,(
long
)
1
,
sizeof
(
int
),
ECPGd_data
,
ECPGt_bytea
,
&
(
recv_buf
[
0
]),(
long
)
DATA_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_2
),
ECPGd_EODT
);
#line
100
"bytea.pgc"
#line
99
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line
100
"bytea.pgc"
#line
99
"bytea.pgc"
{
ECPGget_desc
(
__LINE__
,
"odesc"
,
2
,
ECPGd_indicator
,
ECPGt_int
,
&
(
ind
[
1
]),(
long
)
1
,(
long
)
1
,
sizeof
(
int
),
ECPGd_data
,
ECPGt_bytea
,
&
(
recv_short_buf
),(
long
)
DATA_SIZE
-
LACK_SIZE
,(
long
)
1
,
sizeof
(
struct
bytea_4
),
ECPGd_EODT
);
#line 10
1
"bytea.pgc"
#line 10
0
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 10
1
"bytea.pgc"
#line 10
0
"bytea.pgc"
dump_binary
(
recv_buf
[
0
].
arr
,
recv_buf
[
0
].
len
,
ind
[
0
]);
dump_binary
(
recv_short_buf
.
arr
,
recv_short_buf
.
len
,
ind
[
1
]);
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_normal
,
"drop table test"
,
ECPGt_EOIT
,
ECPGt_EORT
);
#line 10
5
"bytea.pgc"
#line 10
4
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 10
5
"bytea.pgc"
#line 10
4
"bytea.pgc"
{
ECPGtrans
(
__LINE__
,
NULL
,
"commit"
);
#line 10
6
"bytea.pgc"
#line 10
5
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 10
6
"bytea.pgc"
#line 10
5
"bytea.pgc"
{
ECPGdisconnect
(
__LINE__
,
"CURRENT"
);
#line 10
7
"bytea.pgc"
#line 10
6
"bytea.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
();}
#line 10
7
"bytea.pgc"
#line 10
6
"bytea.pgc"
return
0
;
...
...
src/interfaces/ecpg/test/expected/sql-bytea.stderr
View file @
aad21d4c
This diff is collapsed.
Click to expand it.
src/interfaces/ecpg/test/sql/bytea.pgc
View file @
aad21d4c
...
...
@@ -43,7 +43,6 @@ exec sql end declare section;
memset(recv_short_buf.arr, 0x0, sizeof(recv_short_buf.arr)); \
} \
while (0)
ECPGdebug(1, stderr);
...
...
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