summaryrefslogtreecommitdiff
path: root/ext/pdo_dblib
diff options
context:
space:
mode:
authorStanley Sufficool <ssufficool@php.net>2010-09-26 20:16:25 +0000
committerStanley Sufficool <ssufficool@php.net>2010-09-26 20:16:25 +0000
commitdc0736b3ed01de07b897947cacf86f6fa0706fa5 (patch)
treedb5ab430e229969bb5521d66dfcaee6a04253fd5 /ext/pdo_dblib
parent42752c71d4897b66eb7586ba15f4d8af5812a107 (diff)
downloadphp-git-dc0736b3ed01de07b897947cacf86f6fa0706fa5.tar.gz
Update getColumnMeta native types for SQL Server 2008
Diffstat (limited to 'ext/pdo_dblib')
-rw-r--r--ext/pdo_dblib/dblib_stmt.c85
1 files changed, 36 insertions, 49 deletions
diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c
index da45dfc916..429cb3617e 100644
--- a/ext/pdo_dblib/dblib_stmt.c
+++ b/ext/pdo_dblib/dblib_stmt.c
@@ -35,60 +35,47 @@
/* {{{ pdo_dblib_get_field_name
*
- * Taken from php_mssql_get_field_name
+ * Updated for MSSQL 2008 SR2 extended types
*
*/
static char *pdo_dblib_get_field_name(int type)
{
switch (type) {
- case SQLBINARY:
- case SQLVARBINARY:
- return "blob";
- break;
- case SQLCHAR:
- case SQLVARCHAR:
- return "char";
- break;
- case SQLTEXT:
- return "text";
- break;
- case SQLDATETIME:
- case SQLDATETIM4:
- case SQLDATETIMN:
- return "datetime";
- break;
- case SQLDECIMAL:
- case SQLFLT4:
- case SQLFLT8:
- case SQLFLTN:
- return "real";
- break;
- case SQLINT1:
- case SQLINT2:
- case SQLINT4:
- case SQLINTN:
- return "int";
- break;
- case SQLNUMERIC:
- return "numeric";
- break;
- case SQLMONEY:
- case SQLMONEY4:
- case SQLMONEYN:
- return "money";
- break;
- case SQLBIT:
- return "bit";
- break;
- case SQLIMAGE:
- return "image";
- break;
-#ifdef SQLUNIQUE
- case SQLUNIQUE:
- return "uniqueidentifier";
- break;
-#endif
- default:
+ case 34: return "image";
+ case 35: return "text";
+ case 36: return "uniqueidentifier";
+ case 40: return "date";
+ case 41: return "time";
+ case 42: return "datetime2";
+ case 43: return "datetimeoffset";
+ case 48: return "tinyint";
+ case 52: return "smallint";
+ case 56: return "int";
+ case 58: return "smalldatetime";
+ case 59: return "real";
+ case 60: return "money";
+ case 61: return "datetime";
+ case 62: return "float";
+ case 98: return "sql_variant";
+ case 99: return "ntext";
+ case 104: return "bit";
+ case 106: return "decimal";
+ case 108: return "numeric";
+ case 122: return "smallmoney";
+ case 127: return "bigint";
+ //case 240: return "hierarchyid";
+ case 240: return "geometry";
+ //case 240: return "geography";
+ case 165: return "varbinary";
+ case 167: return "varchar";
+ case 173: return "binary";
+ case 175: return "char";
+ case 189: return "timestamp";
+ //case 231: return "sysname";
+ case 231: return "nvarchar";
+ case 239: return "nchar";
+ case 241: return "xml";
+ default:
return "unknown";
break;
}