Skip to content

Commit

Permalink
Merge pull request #2 from Microsoft/luke_working
Browse files Browse the repository at this point in the history
Merge from my working branch to add Data-at-Fetch.
  • Loading branch information
lpillar authored Apr 4, 2017
2 parents 110d609 + 3f552ff commit 9c0e9ec
Show file tree
Hide file tree
Showing 22 changed files with 29 additions and 5 deletions.
Binary file modified ODBC 4.0/bin/win32/ODBC32.dll
Binary file not shown.
Binary file modified ODBC 4.0/bin/win32/ODBC32.pdb
Binary file not shown.
Binary file modified ODBC 4.0/bin/win32/ODBCCP32.dll
Binary file not shown.
Binary file modified ODBC 4.0/bin/win32/ODBCCP32.pdb
Binary file not shown.
Binary file modified ODBC 4.0/bin/win32/ODBCINT.dll
Binary file not shown.
Binary file added ODBC 4.0/bin/win32/ODBCTRAC.dll
Binary file not shown.
Binary file added ODBC 4.0/bin/win32/ODBCTRAC.pdb
Binary file not shown.
Binary file modified ODBC 4.0/bin/x64/ODBC32.dll
Binary file not shown.
Binary file modified ODBC 4.0/bin/x64/ODBC32.pdb
Binary file not shown.
Binary file modified ODBC 4.0/bin/x64/ODBCCP32.dll
Binary file not shown.
Binary file modified ODBC 4.0/bin/x64/ODBCCP32.pdb
Binary file not shown.
Binary file modified ODBC 4.0/bin/x64/ODBCINT.dll
Binary file not shown.
Binary file added ODBC 4.0/bin/x64/ODBCTRAC.dll
Binary file not shown.
Binary file added ODBC 4.0/bin/x64/ODBCTRAC.pdb
Binary file not shown.
Binary file added ODBC 4.0/lib/win32/ODBCTRAC.lib
Binary file not shown.
Binary file added ODBC 4.0/lib/x64/ODBCTRAC.lib
Binary file not shown.
1 change: 1 addition & 0 deletions src/odbctest/dlgparms.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ PARAMITEM lpmSQLBindCol[] = {
TEXT("&BufferLength:"), PT_LOG_IN, SQL_C_SLONG, 0, 0, 0, NULL, 0, NULL, 0,0,0, NULL, NULL,
TEXT("Str&Len_or_IndPtr:"),PT_PTR_SDWORD |
PT_LOG_DEFFERED, SQL_C_SLONG, 0, 0, 0, NULL, 0, NULL, 0,0,0, NULL, NULL,
TEXT("Data_at_Fetch"), PT_PTR_UWORD, SQL_C_USHORT, 0, 0, 0, NULL, 0, NULL, 0,0,0, NULL, NULL,
};

PARAMITEM lpmSQLFetch[] = {
Expand Down
1 change: 1 addition & 0 deletions src/odbctest/dlgtmplt.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ CONTROL lptSQLBindCol[] = {
IDE_BC_CBVALUEMAX,0, DLG_EDIT, NULL, idscbValueMax, 0, 4, 0, 0, 0, NULL, 0,0,
IDCK_BC_PCBVALUE, 0, DLG_CKBOX, NULL, idspcbValue, 0, 5, 0, 0, 0, NULL, 0,0,
IDCK_BC_HSTMT , 0, DLG_CKBOX, NULL, idsHstmt, 0, 0, CBO_DFT_ODBC_HANDLE, 0, 0, NULL, 0,0,
IDCK_BC_DATAATFETCH,0, DLG_CKBOX, NULL, idsDataAtFetch, 0, 6, 0, 0, 0, NULL, 0,0
};

CONTROL lptSQLFetch[] = {
Expand Down
25 changes: 21 additions & 4 deletions src/odbctest/fhrslt.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,7 @@ BOOL INTFUN UpdateBoundColumn(lpCONNECTIONINFO lpCI,UWORD icol,SWORD fCType,
//| Returns:
//| The return code from the function
//*---------------------------------------------------------------------------------
static SQLUINTEGER dataAtFetch = SQL_DATA_AT_FETCH;
RETCODE INTFUN lpSQLBindCol(STD_FH_PARMS)
{
RETCODE rc;
Expand All @@ -866,12 +867,12 @@ RETCODE INTFUN lpSQLBindCol(STD_FH_PARMS)
UWORD icol=*(UWORD *)lpParms[1]->lpData;
SWORD fCType=*(SWORD *)lpParms[2]->lpData;
BOOL frgbValueNull=lpParms[3]->fNull;
SDWORD cbValueMax = *(SDWORD *)lpParms[4]->lpData;
SDWORD cbValueMax = *(SDWORD *)lpParms[4]->lpData;
BOOL fpcbValueNull=lpParms[5]->fNull;
SDWORD cbValueMaxUsed=cbValueMax,
SDWORD cbValueMaxUsed=cbValueMax,
cbTotValueMax=0;
PTR rgbValue=NULL;
UNALIGNED INT_PTR *pcbValue=NULL;
PTR rgbValue=NULL;
UNALIGNED INT_PTR *pcbValue=NULL;
SQLHDESC hdesc=NULL;
HSTMT hstmt=NULL;

Expand All @@ -881,6 +882,22 @@ RETCODE INTFUN lpSQLBindCol(STD_FH_PARMS)
if (lpParms[0]->lpData)
hstmt=*(HSTMT *)lpParms[0]->lpData;

if (lpParms[6]->fNull)
{ // Setting Data-at-Fetch
// Log input parameters
LOGPARAMETERS(szFuncName, lpParms, cParms, ci, TRUE);
// Invoke function
rc = SQLBindCol(hstmt,
icol,
fCType,
NULL,
NULL,
&dataAtFetch);
LOGRETURNCODE(NULL, ci, rc);
AUTOLOGERRORSI(ci, rc, hstmt);
return rc;
}

// The memory allocated for the pcbValue is not adjustable. We'll free
// it here and take care of it through the rest of this function handler
FREE_PTR(lpParms[5]->lpData);
Expand Down
5 changes: 4 additions & 1 deletion src/odbctest/gator.rc
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ BEGIN
PUSHBUTTON "&Help",9,203,5,40,14
END

IDD_SQLBINDCOL DIALOG DISCARDABLE 0, 0, 284, 111
IDD_SQLBINDCOL DIALOG DISCARDABLE 0, 0, 284, 125
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "SQLBindCol"
FONT 8, "MS Shell Dlg"
Expand All @@ -1048,6 +1048,8 @@ BEGIN
BS_AUTOCHECKBOX | WS_TABSTOP,8,91,162,10
CONTROL "&StatementHandle:",IDCK_BC_HSTMT,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,8,29,264,10
CONTROL "Data_at_Fetch",IDCK_BC_DATAATFETCH,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,8,105,162,10
PUSHBUTTON "OK",IDOK,149,5,40,14
PUSHBUTTON "Cancel",IDCANCEL,193,5,40,14
PUSHBUTTON "&Help",9,238,5,40,14
Expand Down Expand Up @@ -5127,4 +5129,5 @@ BEGIN
idsParamComma "?,"
idsInsertWCols "insert into %s(%s) values(%s)"
idsDropTable "drop table "
idsDataAtFetch "Sets this column's StrLen_or_Ind ptr to a buffer containing SQL_DATA_AT_FETCH"
END
1 change: 1 addition & 0 deletions src/odbctest/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define IDE_BC_CBVALUEMAX 84
#define IDCK_BC_PCBVALUE 85
#define IDCK_BC_HSTMT 86
#define IDCK_BC_DATAATFETCH 87
#define IDD_SQLCANCEL 100
#define IDCK_C_HSTMT 101
#define IDD_SQLCOLATTRIBUTES 120
Expand Down
1 change: 1 addition & 0 deletions src/odbctest/strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@
#define idsInsertWCols 7040
#define idsDropTable 7041
#define idsDeleteType 7042
#define idsDataAtFetch 7043

// User Option strings (6500 - 6550 reserved)
#define USER_OPT_BASE 6500
Expand Down

0 comments on commit 9c0e9ec

Please sign in to comment.