Skip to content

Commit

Permalink
MFH: Fix for #27594. Comuted columns does not return a column source
Browse files Browse the repository at this point in the history
  • Loading branch information
fmk committed Mar 15, 2004
1 parent ed5a974 commit 210d34a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ext/mssql/php_mssql.c
Expand Up @@ -996,6 +996,7 @@ static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int r

column_types = (int *) emalloc(sizeof(int) * result->num_fields);
for (i=0; i<result->num_fields; i++) {
char *source = NULL;
char *fname = (char *)dbcolname(mssql_ptr->link,i+1);

if (*fname) {
Expand All @@ -1010,8 +1011,11 @@ static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int r
j++;
}
result->fields[i].max_length = dbcollen(mssql_ptr->link,i+1);
result->fields[i].column_source = estrdup(dbcolsource(mssql_ptr->link,i+1));
if (!result->fields[i].column_source) {
source = (char *)dbcolsource(mssql_ptr->link,i+1);
if (source) {
result->fields[i].column_source = estrdup(source);
}
else {
result->fields[i].column_source = empty_string;
}

Expand Down

0 comments on commit 210d34a

Please sign in to comment.