mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge connect/10.0 into 10.0
This is a squashed merge.
This commit is contained in:
@@ -55,6 +55,7 @@ extern "C" HINSTANCE s_hModule; // Saved module handle
|
||||
|
||||
TYPCONV GetTypeConv();
|
||||
int GetConvSize();
|
||||
void OdbcClose(PGLOBAL g, PFBLOCK fp);
|
||||
|
||||
/***********************************************************************/
|
||||
/* Some macro's (should be defined elsewhere to be more accessible) */
|
||||
@@ -301,6 +302,13 @@ static void ResetNullValues(CATPARM *cap)
|
||||
} // end of ResetNullValues
|
||||
#endif
|
||||
|
||||
/***********************************************************************/
|
||||
/* Close an ODBC table after a thrown error (called by PlugCloseFile) */
|
||||
/***********************************************************************/
|
||||
void OdbcClose(PGLOBAL g, PFBLOCK fp) {
|
||||
((ODBConn*)fp->File)->Close();
|
||||
} // end of OdbcClose
|
||||
|
||||
/***********************************************************************/
|
||||
/* ODBCColumns: constructs the result blocks containing all columns */
|
||||
/* of an ODBC table that will be retrieved by GetData commands. */
|
||||
@@ -968,6 +976,7 @@ ODBConn::ODBConn(PGLOBAL g, TDBODBC *tdbp)
|
||||
m_Catver = (tdbp) ? tdbp->Catver : 0;
|
||||
m_Rows = 0;
|
||||
m_Fetch = 0;
|
||||
m_Fp = NULL;
|
||||
m_Connect = NULL;
|
||||
m_User = NULL;
|
||||
m_Pwd = NULL;
|
||||
@@ -1137,7 +1146,25 @@ int ODBConn::Open(PCSZ ConnectString, POPARM sop, DWORD options)
|
||||
} else // Connect using SQLConnect
|
||||
Connect();
|
||||
|
||||
/*ver = GetStringInfo(SQL_DRIVER_ODBC_VER);*/
|
||||
/*********************************************************************/
|
||||
/* Link a Fblock. This make possible to automatically close it */
|
||||
/* in case of error (throw). */
|
||||
/*********************************************************************/
|
||||
PDBUSER dbuserp = (PDBUSER)g->Activityp->Aptr;
|
||||
|
||||
m_Fp = (PFBLOCK)PlugSubAlloc(g, NULL, sizeof(FBLOCK));
|
||||
m_Fp->Type = TYPE_FB_ODBC;
|
||||
m_Fp->Fname = NULL;
|
||||
m_Fp->Next = dbuserp->Openlist;
|
||||
dbuserp->Openlist = m_Fp;
|
||||
m_Fp->Count = 1;
|
||||
m_Fp->Length = 0;
|
||||
m_Fp->Memory = NULL;
|
||||
m_Fp->Mode = MODE_ANY;
|
||||
m_Fp->File = this;
|
||||
m_Fp->Handle = 0;
|
||||
|
||||
/*ver = GetStringInfo(SQL_DRIVER_ODBC_VER);*/
|
||||
// Verify support for required functionality and cache info
|
||||
// VerifyConnect(); Deprecated
|
||||
GetConnectInfo();
|
||||
@@ -2340,6 +2367,7 @@ int ODBConn::GetCatInfo(CATPARM *cap)
|
||||
} // endif len
|
||||
|
||||
pval[n] = AllocateValue(g, crp->Type, len);
|
||||
pval[n]->SetNullable(true);
|
||||
|
||||
if (crp->Type == TYPE_STRING) {
|
||||
pbuf[n] = (char*)PlugSubAlloc(g, NULL, len);
|
||||
@@ -2597,4 +2625,7 @@ void ODBConn::Close()
|
||||
m_henv = SQL_NULL_HENV;
|
||||
} // endif m_henv
|
||||
|
||||
if (m_Fp)
|
||||
m_Fp->Count = 0;
|
||||
|
||||
} // end of Close
|
||||
|
Reference in New Issue
Block a user