linux php mssql pdo procedure 환경의 버그
PHP
5.4 (5.4.11) VC9 x86 Non Thread Safe (2013-Jan-16 21:52:05)
sha1: 9f755b8617fccbffc6f807e07752f7371d32301c
Unix ODBC Driver
Microsoft® ODBC Driver 11 for SQL Server® - RedHat Linux
http://www.microsoft.com/en-us/download/details.aspx?id=36437
SQL Server 2012
1) PDO mssql procudure bind 관련 버그 -> 아래 패치 적용하면 정상 동작함
2) php 에서 call 로 부르면 안되고 exec 로 불러야 함 (php.net 예제 틀림)
3) connection string 틀림 (php.net 예제 틀림)
에서 procedure 를 쓸때 버그 있음
https://bugs.php.net/bug.php?id=61777
MS bug here where developer says its SQLLEN:
http://connect.microsoft.com/SQLServer/feedback/details/737751/cannot-bind-
parameters-with-php-pdo-odbc-and-sql-native-client-11-0
diff -ur pdo_odbc-orig pdo_odbc
diff -ur pdo_odbc-orig/odbc_stmt.c pdo_odbc/odbc_stmt.c
--- pdo_odbc-orig/odbc_stmt.c 2009-07-14 19:32:43.000000000 -0700
+++ pdo_odbc/odbc_stmt.c 2009-12-03 16:36:42.000000000 -0800
@@ -279,7 +279,7 @@
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
RETCODE rc;
SWORD sqltype = 0, ctype = 0, scale = 0, nullable = 0;
- UDWORD precision = 0;
+ SQLULEN precision = 0;
pdo_odbc_param *P;
/* we're only interested in parameters for prepared SQL right now */
@@ -546,7 +546,7 @@
zend_bool dyn = FALSE;
RETCODE rc;
SWORD colnamelen;
- SDWORD colsize, displaysize;
+ SQLULEN colsize, displaysize;
rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname,
sizeof(S->cols[colno].colname)-1, &colnamelen,
diff -ur pdo_odbc-orig/php_pdo_odbc_int.h pdo_odbc/php_pdo_odbc_int.h
--- pdo_odbc-orig/php_pdo_odbc_int.h 2008-12-31 03:15:49.000000000 -0800
+++ pdo_odbc/php_pdo_odbc_int.h 2009-12-03 16:37:45.000000000 -0800
@@ -157,7 +157,7 @@
} pdo_odbc_stmt;
typedef struct {
- SQLINTEGER len;
+ SQLLEN len;
SQLSMALLINT paramtype;
char *outbuf;
unsigned is_unicode:1;