Skip to content

Commit 94ed034

Browse files
author
Julien Pauli
committed
Revert "Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT."
This reverts commit 04115b4.
1 parent 0dbcdce commit 94ed034

File tree

2 files changed

+6
-114
lines changed

2 files changed

+6
-114
lines changed

ext/pdo/pdo_stmt.c

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,36 +2122,12 @@ static PHP_METHOD(PDOStatement, debugDumpParams)
21222122
php_stream_printf(out, "Key: Position #" ZEND_ULONG_FMT ":\n", num);
21232123
}
21242124

2125-
php_stream_printf(out TSRMLS_CC, "paramno=%ld\nname=[%d] \"%.*s\"\nis_param=%d\nparam_type=%d\nis_input_output=%d\n",
2126-
param->paramno, param->namelen, param->namelen, param->name ? param->name : "",
2127-
param->is_param,
2128-
PDO_PARAM_TYPE(param->param_type),
2129-
(param->param_type & PDO_PARAM_INPUT_OUTPUT) == PDO_PARAM_INPUT_OUTPUT);
2130-
2131-
/*
2132-
* Check the type of the parameter and print out the value.
2133-
*
2134-
* Most are self explanatory with the following exceptions:
2135-
* PDO::PARAM_INT evaluates to a long
2136-
* PDO::PARAM_LOB evaluates to a string
2137-
*/
2138-
switch (Z_TYPE_P(param->parameter)) {
2139-
case IS_BOOL:
2140-
php_stream_printf(out TSRMLS_CC, "param_value=%s\n", Z_BVAL_P(param->parameter)?"true":"false");
2141-
break;
2142-
case IS_NULL:
2143-
php_stream_printf(out TSRMLS_CC, "param_value=null\n");
2144-
break;
2145-
case IS_LONG:
2146-
php_stream_printf(out TSRMLS_CC, "param_value=%ld\n", Z_LVAL_P(param->parameter));
2147-
break;
2148-
case IS_STRING:
2149-
php_stream_printf(out TSRMLS_CC, "param_value=%s\n", Z_STRVAL_P(param->parameter));
2150-
break;
2151-
default:
2152-
php_stream_printf(out TSRMLS_CC, "param_value=unknown\n");
2153-
break;
2154-
}
2125+
php_stream_printf(out, "paramno=%pd\nname=[%zd] \"%.*s\"\nis_param=%d\nparam_type=%d\n",
2126+
param->paramno, param->name ? ZSTR_LEN(param->name) : 0, param->name ? (int) ZSTR_LEN(param->name) : 0,
2127+
param->name ? ZSTR_VAL(param->name) : "",
2128+
param->is_param,
2129+
param->param_type);
2130+
21552131
} ZEND_HASH_FOREACH_END();
21562132
}
21572133

ext/pdo/tests/bug_52384.phpt

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)