Skip to content
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

Merged
merged 6 commits into from
Jan 26, 2017
Merged

Merging Sqlsrv source code from linux to windows #240

merged 6 commits into from
Jan 26, 2017

Conversation

yitam
Copy link
Contributor

@yitam yitam commented Jan 19, 2017

No description provided.

Copy link
Contributor

@v-kigos v-kigos left a 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__
Copy link
Contributor

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.

Copy link
Contributor Author

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__

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__

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());

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 );

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;

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

Copy link

@Hadis-Fard Hadis-Fard left a 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

@Hadis-Fard Hadis-Fard merged commit 88a2b05 into microsoft:merged-codebase Jan 26, 2017
@yitam yitam deleted the sqlsrv-linux branch January 27, 2017 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants