Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
685bff04
Commit
685bff04
authored
Jun 13, 2011
by
Howard Chu
Committed by
Quanah Gibson-Mount
Jun 13, 2011
Browse files
ITS#6657/6691 use proper SQL length data type (From Timo Teras @ iki.fi)
parent
6ecdeceb
Changes
4
Hide whitespace changes
Inline
Side-by-side
servers/slapd/back-sql/add.c
View file @
685bff04
...
...
@@ -1217,7 +1217,7 @@ backsql_add( Operation *op, SlapReply *rs )
if
(
!
BACKSQL_IS_ADD
(
oc
->
bom_expect_return
)
)
{
SWORD
ncols
;
SQL
INTEGER
value_len
;
SQL
LEN
value_len
;
if
(
BACKSQL_CREATE_NEEDS_SELECT
(
bi
)
)
{
SQLFreeStmt
(
sth
,
SQL_DROP
);
...
...
servers/slapd/back-sql/back-sql.h
View file @
685bff04
...
...
@@ -183,7 +183,7 @@ typedef struct {
UDWORD
*
col_prec
;
SQLSMALLINT
*
col_type
;
char
**
cols
;
SQL
INTEGER
*
value_len
;
SQL
LEN
*
value_len
;
}
BACKSQL_ROW_NTS
;
/*
...
...
servers/slapd/back-sql/proto-sql.h
View file @
685bff04
...
...
@@ -189,25 +189,25 @@ RETCODE backsql_Prepare( SQLHDBC dbh, SQLHSTMT *sth, const char* query, int time
#define backsql_BindParamStr( sth, par_ind, io, str, maxlen ) \
SQLBindParameter( (sth), (SQLUSMALLINT)(par_ind), \
(io), SQL_C_CHAR, SQL_VARCHAR, \
(SQLU
INTEGER
)(maxlen), 0, (SQLPOINTER)(str), \
(SQL
UINTEGER
)(maxlen), NULL )
(SQLU
LEN
)(maxlen), 0, (SQLPOINTER)(str), \
(SQL
LEN
)(maxlen), NULL )
#define backsql_BindParamBerVal( sth, par_ind, io, bv ) \
SQLBindParameter( (sth), (SQLUSMALLINT)(par_ind), \
(io), SQL_C_CHAR, SQL_VARCHAR, \
(SQLU
INTEGER
)(bv)->bv_len, 0, \
(SQLU
LEN
)(bv)->bv_len, 0, \
(SQLPOINTER)(bv)->bv_val, \
(SQL
UINTEGER
)(bv)->bv_len, NULL )
(SQL
LEN
)(bv)->bv_len, NULL )
#define backsql_BindParamInt( sth, par_ind, io, val ) \
SQLBindParameter( (sth), (SQLUSMALLINT)(par_ind), \
(io), SQL_C_ULONG, SQL_INTEGER, \
0, 0, (SQLPOINTER)(val), 0, (SQL
INTEGER
*)NULL )
0, 0, (SQLPOINTER)(val), 0, (SQL
LEN
*)NULL )
#define backsql_BindParamNumID( sth, par_ind, io, val ) \
SQLBindParameter( (sth), (SQLUSMALLINT)(par_ind), \
(io), BACKSQL_C_NUMID, SQL_INTEGER, \
0, 0, (SQLPOINTER)(val), 0, (SQL
INTEGER
*)NULL )
0, 0, (SQLPOINTER)(val), 0, (SQL
LEN
*)NULL )
#ifdef BACKSQL_ARBITRARY_KEY
#define backsql_BindParamID( sth, par_ind, io, id ) \
...
...
servers/slapd/back-sql/sql-wrap.c
View file @
685bff04
...
...
@@ -148,7 +148,7 @@ backsql_BindRowAsStrings_x( SQLHSTMT sth, BACKSQL_ROW_NTS *row, void *ctx )
}
else
{
SQLCHAR
colname
[
64
];
SQLSMALLINT
name_len
,
col_type
,
col_scale
,
col_null
;
UDWORD
col_prec
;
SQLLEN
col_prec
;
int
i
;
#ifdef BACKSQL_TRACE
...
...
@@ -180,8 +180,8 @@ backsql_BindRowAsStrings_x( SQLHSTMT sth, BACKSQL_ROW_NTS *row, void *ctx )
goto
nomem
;
}
row
->
value_len
=
(
SQL
INTEGER
*
)
ber_memcalloc_x
(
row
->
ncols
,
sizeof
(
SQL
INTEGER
),
ctx
);
row
->
value_len
=
(
SQL
LEN
*
)
ber_memcalloc_x
(
row
->
ncols
,
sizeof
(
SQL
LEN
),
ctx
);
if
(
row
->
value_len
==
NULL
)
{
goto
nomem
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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