Fixed bug #44325 (mssql_bind not correctly bind empty strings as parameter

value)
This commit is contained in:
Ilia Alshanetsky 2008-03-04 19:38:38 +00:00
parent 08d2ac2ea6
commit 0e17aa0630

View File

@ -2067,14 +2067,19 @@ PHP_FUNCTION(mssql_bind)
/* modify datalen and maxlen according to dbrpcparam documentation */
if ( (type==SQLVARCHAR) || (type==SQLCHAR) || (type==SQLTEXT) ) { /* variable-length type */
if (is_null) {
if (is_null || Z_TYPE_PP(var) == IS_NULL) {
maxlen=0;
datalen=0;
}
else {
} else {
convert_to_string_ex(var);
datalen=Z_STRLEN_PP(var);
value=(LPBYTE)Z_STRVAL_PP(var);
datalen = Z_STRLEN_PP(var);
value = (LPBYTE)Z_STRVAL_PP(var);
if (!datalen) {
datalen = 1;
if (maxlen == -1) {
maxlen = 1;
}
}
}
}
else { /* fixed-length type */