mirror of
https://github.com/postgres/postgres.git
synced 2025-05-21 15:54:08 +03:00
1) Not export ODBC 3.0 functions.
2) (Maybe) fix a bug reported by Mika Muntila.
This commit is contained in:
parent
f93449eb34
commit
9f990a73c1
@ -1674,12 +1674,19 @@ copy_statement_with_parameters(StatementClass *stmt)
|
|||||||
|
|
||||||
if (buf)
|
if (buf)
|
||||||
{
|
{
|
||||||
CVT_APPEND_DATA(buf, used);
|
switch (used)
|
||||||
|
{
|
||||||
|
case SQL_NULL_DATA:
|
||||||
|
break;
|
||||||
|
case SQL_NTS:
|
||||||
|
CVT_APPEND_STR(buf);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
CVT_APPEND_DATA(buf, used);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
CVT_APPEND_STR(param_string);
|
CVT_APPEND_STR(param_string);
|
||||||
}
|
|
||||||
|
|
||||||
if (param_sqltype == SQL_BIT)
|
if (param_sqltype == SQL_BIT)
|
||||||
CVT_APPEND_CHAR('\''); /* Close Quote */
|
CVT_APPEND_CHAR('\''); /* Close Quote */
|
||||||
|
@ -230,6 +230,9 @@ dialog:
|
|||||||
|
|
||||||
if (len >= cbConnStrOutMax)
|
if (len >= cbConnStrOutMax)
|
||||||
{
|
{
|
||||||
|
int clen;
|
||||||
|
for (clen = strlen(szConnStrOut) - 1; clen >= 0 && szConnStrOut[clen] != ';'; clen--)
|
||||||
|
szConnStrOut[clen] = '\0';
|
||||||
result = SQL_SUCCESS_WITH_INFO;
|
result = SQL_SUCCESS_WITH_INFO;
|
||||||
conn->errornumber = CONN_TRUNCATED;
|
conn->errornumber = CONN_TRUNCATED;
|
||||||
conn->errormsg = "The buffer was too small for the ConnStrOut.";
|
conn->errormsg = "The buffer was too small for the ConnStrOut.";
|
||||||
|
@ -92,6 +92,8 @@ PGAPI_Error(
|
|||||||
{
|
{
|
||||||
char *msg;
|
char *msg;
|
||||||
int status;
|
int status;
|
||||||
|
BOOL once_again = FALSE;
|
||||||
|
SWORD msglen;
|
||||||
|
|
||||||
mylog("**** PGAPI_Error: henv=%u, hdbc=%u, hstmt=%u <%d>\n", henv, hdbc, hstmt, cbErrorMsgMax);
|
mylog("**** PGAPI_Error: henv=%u, hdbc=%u, hstmt=%u <%d>\n", henv, hdbc, hstmt, cbErrorMsgMax);
|
||||||
|
|
||||||
@ -101,8 +103,6 @@ PGAPI_Error(
|
|||||||
{
|
{
|
||||||
/* CC: return an error of a hstmt */
|
/* CC: return an error of a hstmt */
|
||||||
StatementClass *stmt = (StatementClass *) hstmt;
|
StatementClass *stmt = (StatementClass *) hstmt;
|
||||||
SWORD msglen;
|
|
||||||
BOOL once_again = FALSE;
|
|
||||||
|
|
||||||
if (SC_get_error(stmt, &status, &msg))
|
if (SC_get_error(stmt, &status, &msg))
|
||||||
{
|
{
|
||||||
@ -306,8 +306,15 @@ PGAPI_Error(
|
|||||||
return SQL_NO_DATA_FOUND;
|
return SQL_NO_DATA_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
msglen = strlen(msg);
|
||||||
if (NULL != pcbErrorMsg)
|
if (NULL != pcbErrorMsg)
|
||||||
*pcbErrorMsg = (SWORD) strlen(msg);
|
{
|
||||||
|
*pcbErrorMsg = msglen;
|
||||||
|
if (cbErrorMsgMax == 0)
|
||||||
|
once_again = TRUE;
|
||||||
|
else if (msglen >= cbErrorMsgMax)
|
||||||
|
*pcbErrorMsg = cbErrorMsgMax - 1;
|
||||||
|
}
|
||||||
if ((NULL != szErrorMsg) && (cbErrorMsgMax > 0))
|
if ((NULL != szErrorMsg) && (cbErrorMsgMax > 0))
|
||||||
strncpy_null(szErrorMsg, msg, cbErrorMsgMax);
|
strncpy_null(szErrorMsg, msg, cbErrorMsgMax);
|
||||||
if (NULL != pfNativeError)
|
if (NULL != pfNativeError)
|
||||||
@ -391,7 +398,13 @@ PGAPI_Error(
|
|||||||
return SQL_NO_DATA_FOUND;
|
return SQL_NO_DATA_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SQL_SUCCESS;
|
if (once_again)
|
||||||
|
{
|
||||||
|
conn->errornumber = status;
|
||||||
|
return SQL_SUCCESS_WITH_INFO;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return SQL_SUCCESS;
|
||||||
}
|
}
|
||||||
else if (SQL_NULL_HENV != henv)
|
else if (SQL_NULL_HENV != henv)
|
||||||
{
|
{
|
||||||
|
@ -3614,9 +3614,29 @@ PGAPI_Procedures(
|
|||||||
SWORD cbProcName)
|
SWORD cbProcName)
|
||||||
{
|
{
|
||||||
static char *func = "PGAPI_Procedures";
|
static char *func = "PGAPI_Procedures";
|
||||||
|
StatementClass *stmt = (StatementClass *) hstmt;
|
||||||
|
Int2 result_cols;
|
||||||
|
|
||||||
mylog("%s: entering...\n", func);
|
mylog("%s: entering...\n", func);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* a statement is actually executed, so we'll have to do this
|
||||||
|
* ourselves.
|
||||||
|
*/
|
||||||
|
result_cols = 8;
|
||||||
|
extend_bindings(stmt, result_cols);
|
||||||
|
|
||||||
|
/* set the field names */
|
||||||
|
QR_set_num_fields(stmt->result, result_cols);
|
||||||
|
QR_set_field_info(stmt->result, 0, "PROCEDURE_CAT", PG_TYPE_TEXT, MAX_INFO_STRING);
|
||||||
|
QR_set_field_info(stmt->result, 1, "PROCEDURE_SCHEM", PG_TYPE_TEXT, MAX_INFO_STRING);
|
||||||
|
QR_set_field_info(stmt->result, 2, "PROCEDURE_NAME", PG_TYPE_TEXT, MAX_INFO_STRING);
|
||||||
|
QR_set_field_info(stmt->result, 3, "NUM_INPUT_PARAMS", PG_TYPE_TEXT, MAX_INFO_STRING);
|
||||||
|
QR_set_field_info(stmt->result, 4, "NUM_OUTPUT_PARAMS", PG_TYPE_TEXT, MAX_INFO_STRING);
|
||||||
|
QR_set_field_info(stmt->result, 5, "NUM_RESULT_SET", PG_TYPE_TEXT, MAX_INFO_STRING);
|
||||||
|
QR_set_field_info(stmt->result, 6, "REMARKS", PG_TYPE_TEXT, MAX_INFO_STRING);
|
||||||
|
QR_set_field_info(stmt->result, 7, "PROCEDURE_TYPE", PG_TYPE_INT2, 2);
|
||||||
|
|
||||||
SC_log_error(func, "Function not implemented", (StatementClass *) hstmt);
|
SC_log_error(func, "Function not implemented", (StatementClass *) hstmt);
|
||||||
return SQL_ERROR;
|
return SQL_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -698,7 +698,15 @@ pgtype_length(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_
|
|||||||
/* Character types (and NUMERIC) use the default precision */
|
/* Character types (and NUMERIC) use the default precision */
|
||||||
case PG_TYPE_VARCHAR:
|
case PG_TYPE_VARCHAR:
|
||||||
case PG_TYPE_BPCHAR:
|
case PG_TYPE_BPCHAR:
|
||||||
|
#ifdef MULTIBYTE
|
||||||
|
/* after 7.2 */
|
||||||
|
if (PG_VERSION_GE(SC_get_conn(stmt), 7.2)
|
||||||
|
return 3 * pgtype_precision(stmt, type, col, handle_unknown_size_as);
|
||||||
|
else
|
||||||
|
#else
|
||||||
|
/* CR -> CR/LF */
|
||||||
return 2 * pgtype_precision(stmt, type, col, handle_unknown_size_as);
|
return 2 * pgtype_precision(stmt, type, col, handle_unknown_size_as);
|
||||||
|
#endif /* MULTIBYTE */
|
||||||
default:
|
default:
|
||||||
return pgtype_precision(stmt, type, col, handle_unknown_size_as);
|
return pgtype_precision(stmt, type, col, handle_unknown_size_as);
|
||||||
}
|
}
|
||||||
|
@ -53,28 +53,6 @@ SQLSetPos @68
|
|||||||
SQLSetScrollOptions @69
|
SQLSetScrollOptions @69
|
||||||
SQLTablePrivileges @70
|
SQLTablePrivileges @70
|
||||||
SQLBindParameter @72
|
SQLBindParameter @72
|
||||||
|
|
||||||
SQLAllocHandle @80
|
|
||||||
SQLBindParam @81
|
|
||||||
SQLCloseCursor @82
|
|
||||||
SQLColAttribute @83
|
|
||||||
SQLCopyDesc @84
|
|
||||||
SQLEndTran @85
|
|
||||||
SQLFetchScroll @86
|
|
||||||
SQLFreeHandle @87
|
|
||||||
SQLGetDescField @88
|
|
||||||
SQLGetDescRec @89
|
|
||||||
SQLGetDiagField @90
|
|
||||||
SQLGetDiagRec @91
|
|
||||||
SQLGetEnvAttr @92
|
|
||||||
SQLGetConnectAttr @93
|
|
||||||
SQLGetStmtAttr @94
|
|
||||||
SQLSetConnectAttr @95
|
|
||||||
SQLSetDescField @96
|
|
||||||
SQLSetDescRec @97
|
|
||||||
SQLSetEnvAttr @98
|
|
||||||
SQLSetStmtAttr @99
|
|
||||||
|
|
||||||
SQLDummyOrdinal @199
|
SQLDummyOrdinal @199
|
||||||
dconn_FDriverConnectProc @200
|
dconn_FDriverConnectProc @200
|
||||||
DllMain @201
|
DllMain @201
|
||||||
|
Loading…
x
Reference in New Issue
Block a user