Skip to content

Commit

Permalink
Merge remote-tracking branch 'trunk'
Browse files Browse the repository at this point in the history
Conflicts:
	Changes
  • Loading branch information
yanick committed Oct 31, 2011
2 parents bcb9c71 + 25ca4de commit 82f4c03
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 7 deletions.
20 changes: 20 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
Revision history for DBD::Oracle

Changes in DBD-Oracle XXX

[BUG FIXES]
- if bind_col is called with a TYPE but no bind attributes like
StrictlyTyped or DiscardString are set DBD::Oracle still attempts
to call sql_type_cast which is pointless (Martin J. Evans)
- if bind_col is called with a TYPE other than SQL_NUMERIC,
SQL_INTEGER or SQL_DOUBLE and bind attributes like StrictlyTyped or
DiscardString a warning was not issued that the type is unsupported
and no data was returned (Martin J. Evans)

[DOCUMENTATION]
- Added notes to bind_col documenting the fact that setting a TYPE
does not affect how the column is bound in Oracle, only what
happens after the column data is retrieved (Martin J. Evans)

[OTHER]
- Commented out some functions in oci8.c which were not used to
reduce the size of the driver a little (Martin J. Evans)

Changes in DBD-Oracle 1.34 (31-10-2011)

- promote 1.33_00 to official release
Expand Down
6 changes: 6 additions & 0 deletions Oracle.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4148,6 +4148,12 @@ Returns the number of rows affected for updates, deletes and inserts and -1 for
Binds a Perl variable and/or some attributes to an output column of a SELECT statement.
Column numbers count up from 1. You do not need to bind output columns in order to fetch data.
NOTE: DBD::Oracle does not use the C<$bind_type> to determine how to
bind the column; it uses what Oracle says the data type is. You can
however set a numeric bind type with the bind attributes
StrictlyTyped/DiscardString as these attributes are applied after the
column is retrieved.
See the DBI documentation for a discussion of the optional parameters C<\%attr> and C<$bind_type>
=head3 B<bind_columns>
Expand Down
4 changes: 2 additions & 2 deletions dbdimp.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ char *oci_exe_mode _((ub4 mode));
char *dbd_yes_no _((int yes_no));
char *oci_col_return_codes _((int rc));
char *oci_csform_name _((ub4 attr));
char *oci_sql_function_code_name _((int sqlfncode));
char *oci_ptype_name _((int ptype));
/*char *oci_sql_function_code_name _((int sqlfncode));
char *oci_ptype_name _((int ptype));*/

int dbd_rebind_ph_lob _((SV *sth, imp_sth_t *imp_sth, phs_t *phs));

Expand Down
21 changes: 16 additions & 5 deletions oci8.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int describe_obj_by_tdo(SV *sth,imp_sth_t *imp_sth,fbh_obj_t *obj,ub2 level );
int dump_struct(imp_sth_t *imp_sth,fbh_obj_t *obj,int level);



/*
char *
dbd_yes_no(int yes_no)
{
Expand All @@ -33,6 +33,7 @@ dbd_yes_no(int yes_no)
}
return "No";
}
*/

void
dbd_init_oci(dbistate_t *dbistate)
Expand All @@ -52,6 +53,7 @@ dbd_init_oci_drh(imp_drh_t * imp_drh)

}

/*
char *
oci_sql_function_code_name(int sqlfncode)
{
Expand All @@ -71,7 +73,9 @@ oci_sql_function_code_name(int sqlfncode)
sprintf(SvPVX(sv),"(UNKNOWN SQL FN Code %d)", sqlfncode);
return SvPVX(sv);
}
*/

/*
char *
oci_ptype_name(int ptype)
{
Expand Down Expand Up @@ -104,7 +108,8 @@ oci_ptype_name(int ptype)
sprintf(SvPVX(sv),"(UNKNOWN PTYPE Code %d)", ptype);
return SvPVX(sv);
}

*/

char *
oci_exe_mode(ub4 mode)
{
Expand Down Expand Up @@ -3738,6 +3743,7 @@ dbd_describe(SV *h, imp_sth_t *imp_sth)
AV *
dbd_st_fetch(SV *sth, imp_sth_t *imp_sth){
dTHX;
D_imp_xxh(sth);
sword status;
D_imp_dbh_from_sth;
int num_fields = DBIc_NUM_FIELDS(imp_sth);
Expand Down Expand Up @@ -3927,12 +3933,13 @@ dbd_st_fetch(SV *sth, imp_sth_t *imp_sth){
#if DBIXS_REVISION > 13590
/* If a bind type was specified we use DBI's sql_type_cast
to cast it - currently only number types are handled */
if (fbh->req_type != 0) {
if ((fbh->req_type != 0) && (fbh->bind_flags != 0)) {
int sts;
char errstr[256];

sts = DBIc_DBISTATE(imp_sth)->sql_type_cast_svpv(
aTHX_ sv, fbh->req_type, fbh->bind_flags, NULL);

if (sts == 0) {
sprintf(errstr,
"over/under flow converting column %d to type %"IVdf"",
Expand All @@ -3945,7 +3952,11 @@ dbd_st_fetch(SV *sth, imp_sth_t *imp_sth){
sprintf(errstr,
"unsupported bind type %"IVdf" for column %d",
fbh->req_type, i+1);
return Nullav;
/* issue warning */
DBIh_SET_ERR_CHAR(sth, imp_xxh, "0", 1, errstr, Nullch, Nullch);
if (CSFORM_IMPLIES_UTF8(fbh->csform) ){
SvUTF8_on(sv);
}
}
}
else
Expand Down Expand Up @@ -4669,4 +4680,4 @@ ora_db_version(SV *dbh, imp_dbh_t *imp_dbh)
}
imp_dbh->server_version = vernum;
return vernum;
}
}

0 comments on commit 82f4c03

Please sign in to comment.