Tab/indentation fixes.
This commit is contained in:
parent
ea445f4a18
commit
044836b048
|
@ -1162,18 +1162,15 @@ char * pdo_sqlsrv_dbh_last_id( pdo_dbh_t *dbh, const char *name, _Out_ size_t* l
|
||||||
temp_stmt.dbh = dbh;
|
temp_stmt.dbh = dbh;
|
||||||
|
|
||||||
// allocate a full driver statement to take advantage of the error handling
|
// allocate a full driver statement to take advantage of the error handling
|
||||||
driver_stmt = core_sqlsrv_create_stmt( driver_dbh, core::allocate_stmt<pdo_sqlsrv_stmt>, NULL /*options_ht*/,
|
driver_stmt = core_sqlsrv_create_stmt( driver_dbh, core::allocate_stmt<pdo_sqlsrv_stmt>, NULL /*options_ht*/, NULL /*valid_stmt_opts*/, pdo_sqlsrv_handle_stmt_error, &temp_stmt TSRMLS_CC );
|
||||||
NULL /*valid_stmt_opts*/, pdo_sqlsrv_handle_stmt_error, &temp_stmt TSRMLS_CC );
|
|
||||||
driver_stmt->set_func( __FUNCTION__ );
|
driver_stmt->set_func( __FUNCTION__ );
|
||||||
|
|
||||||
|
|
||||||
sqlsrv_malloc_auto_ptr<SQLWCHAR> wsql_string;
|
sqlsrv_malloc_auto_ptr<SQLWCHAR> wsql_string;
|
||||||
unsigned int wsql_len;
|
unsigned int wsql_len;
|
||||||
wsql_string = utf16_string_from_mbcs_string( SQLSRV_ENCODING_CHAR, reinterpret_cast<const char*>( last_insert_id_query ),
|
wsql_string = utf16_string_from_mbcs_string( SQLSRV_ENCODING_CHAR, reinterpret_cast<const char*>( last_insert_id_query ), strlen(last_insert_id_query), &wsql_len );
|
||||||
strlen(last_insert_id_query), &wsql_len );
|
|
||||||
|
|
||||||
CHECK_CUSTOM_ERROR( wsql_string == 0, driver_stmt, SQLSRV_ERROR_QUERY_STRING_ENCODING_TRANSLATE,
|
CHECK_CUSTOM_ERROR( wsql_string == 0, driver_stmt, SQLSRV_ERROR_QUERY_STRING_ENCODING_TRANSLATE, get_last_error_message() ) {
|
||||||
get_last_error_message() ) {
|
|
||||||
throw core::CoreException();
|
throw core::CoreException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -167,19 +167,14 @@ sqlsrv_conn* core_sqlsrv_connect( sqlsrv_context& henv_cp, sqlsrv_context& henv_
|
||||||
// connection handle has been allocated using henv_cp, means pooling enabled in a PHP script
|
// connection handle has been allocated using henv_cp, means pooling enabled in a PHP script
|
||||||
if ( henv == &henv_cp )
|
if ( henv == &henv_cp )
|
||||||
{
|
{
|
||||||
r = SQLDriverConnect( conn->handle(), NULL, (SQLCHAR*)conn_str.c_str(),
|
r = SQLDriverConnect( conn->handle(), NULL, (SQLCHAR*)conn_str.c_str(), SQL_NTS, NULL, 0, &output_conn_size, SQL_DRIVER_NOPROMPT );
|
||||||
SQL_NTS, NULL, 0, &output_conn_size, SQL_DRIVER_NOPROMPT );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
r = SQLDriverConnectW( conn->handle(), NULL, reinterpret_cast<SQLWCHAR*>( wconn_string.get() ),
|
r = SQLDriverConnectW( conn->handle(), NULL, reinterpret_cast<SQLWCHAR*>( wconn_string.get() ), static_cast<SQLSMALLINT>( wconn_len ), NULL, 0, &output_conn_size, SQL_DRIVER_NOPROMPT );
|
||||||
static_cast<SQLSMALLINT>( wconn_len ), NULL,
|
|
||||||
0, &output_conn_size, SQL_DRIVER_NOPROMPT );
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
r = SQLDriverConnectW( conn->handle(), NULL, reinterpret_cast<SQLWCHAR*>( wconn_string.get() ),
|
r = SQLDriverConnectW( conn->handle(), NULL, reinterpret_cast<SQLWCHAR*>( wconn_string.get() ), static_cast<SQLSMALLINT>( wconn_len ), NULL, 0, &output_conn_size, SQL_DRIVER_NOPROMPT );
|
||||||
static_cast<SQLSMALLINT>( wconn_len ), NULL,
|
|
||||||
0, &output_conn_size, SQL_DRIVER_NOPROMPT );
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// clear the connection string from memory to remove sensitive data (such as a password).
|
// clear the connection string from memory to remove sensitive data (such as a password).
|
||||||
|
|
Loading…
Reference in a new issue