-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merging Sqlsrv source code from linux to windows #240
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L464 - L473
#ifndef __linux__
L471
#endif
the rest is the same
@@ -18,9 +18,12 @@ | |||
//--------------------------------------------------------------------------------------------------------------------------------- | |||
|
|||
#include "php_sqlsrv.h" | |||
|
|||
#ifndef __linux__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried compiling without these headers on Windows? I've found they're not needed in the PDO_SQLSRV source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I've removed them.
@@ -21,7 +21,9 @@ | |||
|
|||
#include "php_sqlsrv.h" | |||
|
|||
#ifndef __linux__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for windows specifics use #ifdef _WIN32
bool converted = convert_string_from_utf16( encoding, field_name_w, field_name_len_w, ( char** ) &field_name, field_name_len ); | ||
core::SQLColAttributeW ( stmt, i + 1, SQL_DESC_NAME, field_name_w, ( SS_MAXCOLNAMELEN + 1 ) * 2, &field_name_len_w, NULL | ||
TSRMLS_CC ); | ||
#ifdef __linux__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation is off, should be aligned with others
@@ -1821,11 +1821,19 @@ void fetch_fields_common( _Inout_ ss_sqlsrv_stmt* stmt, zend_long fetch_type, _O | |||
sqlsrv_malloc_auto_ptr<char> field_name; | |||
sqlsrv_malloc_auto_ptr<sqlsrv_fetch_field_name> field_names; | |||
field_names = static_cast<sqlsrv_fetch_field_name*>( sqlsrv_malloc( num_cols * sizeof( sqlsrv_fetch_field_name ))); | |||
SQLSRV_ENCODING encoding = (( stmt->encoding() == SQLSRV_ENCODING_DEFAULT ) ? stmt->conn->encoding() : stmt->encoding()); | |||
SQLSRV_ENCODING encoding = (( stmt->encoding() == SQLSRV_ENCODING_DEFAULT ) ? stmt->conn->encoding() : | |||
stmt->encoding()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation and spacing issue, move stmt->encoding in 1 line
core_sqlsrv_get_field( stmt, field_index, sqlsrv_php_type, false, field_value, &field_len, false/*cache_field*/, | ||
&sqlsrv_php_type_out TSRMLS_CC ); | ||
core_sqlsrv_get_field( stmt, static_cast<SQLUSMALLINT>( field_index ), sqlsrv_php_type, false, field_value, &field_len, false/*cache_field*/, | ||
&sqlsrv_php_type_out TSRMLS_CC ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation, &sqlsrv_php_type_out
should be under stmt
, use spaces instead of tabs
@@ -1067,7 +1067,7 @@ PHP_FUNCTION( sqlsrv_get_field ) | |||
sqlsrv_php_type.typeinfo.type = SQLSRV_PHPTYPE_INVALID; | |||
SQLSRV_PHPTYPE sqlsrv_php_type_out = SQLSRV_PHPTYPE_INVALID; | |||
void* field_value = NULL; | |||
int field_index = -1; | |||
zend_long field_index = -1; | |||
SQLLEN field_len = -1; | |||
zval retval_z; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix this indentations here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add sqlsrv config.m4 too
No description provided.