Fixed bug #24752 (Unhandled "uniqueidentifier" field type)

Original Patch By: s.sonnenberg[at]coolspot.de
This commit is contained in:
Ilia Alshanetsky 2003-07-23 16:53:26 +00:00
parent 9826911139
commit 1a1826903b
2 changed files with 17 additions and 0 deletions

View File

@ -800,6 +800,15 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
Z_DVAL_P(result) = (double) floatcol8(offset);
Z_TYPE_P(result) = IS_DOUBLE;
break;
#ifdef SQLUNIQUE
case SQLUNIQUE: {
char *data = charcol(offset);
/* uniqueidentifier is a 16-byte binary number */
ZVAL_STRINGL(result, data, 16, 1);
}
break;
#endif
case SQLVARBINARY:
case SQLBINARY:
case SQLIMAGE: {
@ -1468,6 +1477,11 @@ static char *php_mssql_get_field_name(int type)
case SQLIMAGE:
return "image";
break;
#ifdef SQLUNIQUE
case SQLUNIQUE:
return "uniqueidentifier";
break;
#endif
default:
return "unknown";
break;

View File

@ -59,6 +59,9 @@
#define SQLIMAGE SYBIMAGE
#define SQLBINARY SYBBINARY
#define SQLVARBINARY SYBVARBINARY
#ifdef SQLUNIQUE /* FreeTSD 0.61+ */
#define SQLUNIQUE SYBUNIQUE
#endif
#define DBERRHANDLE(a, b) dberrhandle(b)
#define DBMSGHANDLE(a, b) dbmsghandle(b)
#define DBSETOPT(a, b, c) dbsetopt(a, b, c, -1)