diff options
Diffstat (limited to 'ext/pdo_dblib')
-rw-r--r-- | ext/pdo_dblib/dblib_stmt.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c index 263ae6dcb8..9f47f0f7ed 100644 --- a/ext/pdo_dblib/dblib_stmt.c +++ b/ext/pdo_dblib/dblib_stmt.c @@ -203,8 +203,15 @@ static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) } struct pdo_column_data *col = &stmt->columns[colno]; - - col->name = (char*)dbcolname(H->link, colno+1); + + char *fname = (char*)dbcolname(H->link, colno+1); + char computed_buf[16]; + if (*fname) { + col->name = estrdup(fname); + } else { + snprintf(computed_buf,16,"computed%d", colno); + col->name = estrdup(computed_buf); + } col->maxlen = dbcollen(H->link, colno+1); col->namelen = strlen(col->name); col->param_type = PDO_PARAM_STR; |