mirror of
https://github.com/php/php-src.git
synced 2026-04-29 11:13:36 +02:00
Fix signed/unsigned warnings in PDO ODBC
Add add skipif to test.
This commit is contained in:
+10
-10
@@ -41,7 +41,7 @@ static int pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *inf
|
||||
|
||||
message = strpprintf(0, "%s (%s[%ld] at %s:%d)",
|
||||
einfo->last_err_msg,
|
||||
einfo->what, einfo->last_error,
|
||||
einfo->what, (long) einfo->last_error,
|
||||
einfo->file, einfo->line);
|
||||
|
||||
add_next_index_long(info, einfo->last_error);
|
||||
@@ -85,8 +85,8 @@ void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement,
|
||||
eh = H->env;
|
||||
}
|
||||
|
||||
rc = SQLGetDiagRec(htype, eh, recno++, einfo->last_state, &einfo->last_error,
|
||||
einfo->last_err_msg, sizeof(einfo->last_err_msg)-1, &errmsgsize);
|
||||
rc = SQLGetDiagRec(htype, eh, recno++, (SQLCHAR *) einfo->last_state, &einfo->last_error,
|
||||
(SQLCHAR *) einfo->last_err_msg, sizeof(einfo->last_err_msg)-1, &errmsgsize);
|
||||
|
||||
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
|
||||
errmsgsize = 0;
|
||||
@@ -110,8 +110,8 @@ void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement,
|
||||
* diagnostic records (which can be generated by PRINT statements
|
||||
* in the query, for instance). */
|
||||
while (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) {
|
||||
char discard_state[6];
|
||||
char discard_buf[1024];
|
||||
SQLCHAR discard_state[6];
|
||||
SQLCHAR discard_buf[1024];
|
||||
SQLINTEGER code;
|
||||
rc = SQLGetDiagRec(htype, eh, recno++, discard_state, &code,
|
||||
discard_buf, sizeof(discard_buf)-1, &errmsgsize);
|
||||
@@ -192,7 +192,7 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, size_t sql_len,
|
||||
}
|
||||
}
|
||||
|
||||
rc = SQLPrepare(S->stmt, (char*)sql, SQL_NTS);
|
||||
rc = SQLPrepare(S->stmt, (SQLCHAR *) sql, SQL_NTS);
|
||||
if (nsql) {
|
||||
efree(nsql);
|
||||
}
|
||||
@@ -230,7 +230,7 @@ static zend_long odbc_handle_doer(pdo_dbh_t *dbh, const char *sql, size_t sql_le
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = SQLExecDirect(stmt, (char *)sql, sql_len);
|
||||
rc = SQLExecDirect(stmt, (SQLCHAR *) sql, sql_len);
|
||||
|
||||
if (rc == SQL_NO_DATA) {
|
||||
/* If SQLExecDirect executes a searched update or delete statement that
|
||||
@@ -442,7 +442,7 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{
|
||||
}
|
||||
|
||||
if (strchr(dbh->data_source, ';')) {
|
||||
char dsnbuf[1024];
|
||||
SQLCHAR dsnbuf[1024];
|
||||
SQLSMALLINT dsnbuflen;
|
||||
|
||||
use_direct = 1;
|
||||
@@ -456,11 +456,11 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{
|
||||
dbh->data_source = dsn;
|
||||
}
|
||||
|
||||
rc = SQLDriverConnect(H->dbc, NULL, (char*)dbh->data_source, strlen(dbh->data_source),
|
||||
rc = SQLDriverConnect(H->dbc, NULL, (SQLCHAR *) dbh->data_source, strlen(dbh->data_source),
|
||||
dsnbuf, sizeof(dsnbuf)-1, &dsnbuflen, SQL_DRIVER_NOPROMPT);
|
||||
}
|
||||
if (!use_direct) {
|
||||
rc = SQLConnect(H->dbc, (char*)dbh->data_source, SQL_NTS, dbh->username, SQL_NTS, dbh->password, SQL_NTS);
|
||||
rc = SQLConnect(H->dbc, (SQLCHAR *) dbh->data_source, SQL_NTS, (SQLCHAR *) dbh->username, SQL_NTS, (SQLCHAR *) dbh->password, SQL_NTS);
|
||||
}
|
||||
|
||||
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
|
||||
|
||||
@@ -567,7 +567,7 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno)
|
||||
SQLULEN colsize;
|
||||
SQLLEN displaysize = 0;
|
||||
|
||||
rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname,
|
||||
rc = SQLDescribeCol(S->stmt, colno+1, (SQLCHAR *) S->cols[colno].colname,
|
||||
sizeof(S->cols[colno].colname)-1, &colnamelen,
|
||||
&S->cols[colno].coltype, &colsize, NULL, NULL);
|
||||
|
||||
@@ -777,7 +777,7 @@ static int odbc_stmt_set_param(pdo_stmt_t *stmt, zend_long attr, zval *val)
|
||||
switch (attr) {
|
||||
case PDO_ATTR_CURSOR_NAME:
|
||||
convert_to_string(val);
|
||||
rc = SQLSetCursorName(S->stmt, Z_STRVAL_P(val), Z_STRLEN_P(val));
|
||||
rc = SQLSetCursorName(S->stmt, (SQLCHAR *) Z_STRVAL_P(val), Z_STRLEN_P(val));
|
||||
|
||||
if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) {
|
||||
return 1;
|
||||
@@ -806,7 +806,7 @@ static int odbc_stmt_get_attr(pdo_stmt_t *stmt, zend_long attr, zval *val)
|
||||
{
|
||||
char buf[256];
|
||||
SQLSMALLINT len = 0;
|
||||
rc = SQLGetCursorName(S->stmt, buf, sizeof(buf), &len);
|
||||
rc = SQLGetCursorName(S->stmt, (SQLCHAR *) buf, sizeof(buf), &len);
|
||||
|
||||
if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) {
|
||||
ZVAL_STRINGL(val, buf, len);
|
||||
|
||||
@@ -3,6 +3,8 @@ PDO ODBC varying character with max/no length
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('pdo_odbc')) print 'skip not loaded';
|
||||
require 'ext/pdo/tests/pdo_test.inc';
|
||||
PDOTest::skip();
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user