Issue Details (XML | Word | Printable)

Key: CORE-2082
Type: Bug Bug
Status: Open Open
Priority: Trivial Trivial
Assignee: Unassigned
Reporter: Kovalenko Dmitry
Votes: 0
Watchers: 1

If you were logged in you would be able to see more operations.
Firebird Core

BUG at gds__sqlcode

Created: 16/Sep/08 07:10 AM   Updated: 16/Sep/08 07:13 AM
Component/s: API / Client Library
Affects Version/s: 2.5 Alpha 1
Fix Version/s: None

 Description  « Hide
gds.cpp [version 1.265]


if (!have_sqlcode)
 // Now check the hard-coded mapping table of gds_codes to sql_codes
 const SLONG gdscode = *s; // instead a "= status_vector[1];"

 if (gdscode) {

Also, I think, gds__sqlcode must have a control for status_vector bounds. For example:

 const ISC_STATUS* vec_cur=status_vector;
 const ISC_STATUS* const vec_end=status_vector+ISC_STATUS_LENGTH;

 structure::t_value_with_null<ISC_LONG> result;

    if((*vec_cur)==isc_sqlerr) //status vector has the explicit SQL error code
    }//if isc_sqlerr

     // Now check the hard-coded mapping table of gds_codes to sql_codes
     const ISC_LONG x=(*vec_cur)?ISC__GetSqlCodeByGdsCode(*vec_cur):0;
     if(x==0 || x!=ISC_GENERIC_SQLCODE)
    }//if sqlcode.null()

    ++vec_cur; //<gds_code_id>

   }//if isc_arg_gds
    vec_cur+=3; //isc_arg_cstring <len> <str ptr>
   }//if isc_arg_cstring
   //skip: isc_arg_* <item>
 return result.value_or_default(ISC_GENERIC_SQLCODE);

ISC_LONG ISC__GetSqlCodeByGdsCode(const ISC_STATUS GdsCode)
 //decode original error code
 USHORT status_fac = 0;
 USHORT status_class = 0;
 const ISC_STATUS status_err_num=
 if(status_fac==ISC_MSG_FAC__SQL_ERR || status_fac==ISC_MSG_FAC__SQL_WARN)
  return status_err_num;
 if(const TISC_MsgData*
     const pX=ISC__GetMsgData(TFB_Link_ISC_MsgID(status_fac,status_err_num)))
  return pX->SqlCode;

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.