Skip to content

Conversation

madorin
Copy link
Contributor

@madorin madorin commented Nov 4, 2016

Please review someone more initiated in PHP, PDO code.
This fix an old frustrating bug in blob param binding.
Also include proper handling when NULL is passed.

case SQL_BLOB:
case SQL_BLOB: {
if (Z_TYPE_P(parameter) == IS_NULL) {
// Check if this field allow NULL values
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use C style comments.

RECORD_ERROR(stmt);
result = 0;
break;
}
put_cnt += chunk_size;
}

zval_dtor(param);
if (Z_TYPE_P(param) != IS_STRING)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use curly brackets as well, see http://git.php.net/?p=php-src.git;a=blob_plain;f=CODING_STANDARDS;hb=HEAD .

Thanks.

@weltling
Copy link
Contributor

weltling commented Nov 4, 2016

A test is requiered, please add one based on a snippets from tickets.

Thanks.

@madorin
Copy link
Contributor Author

madorin commented Nov 5, 2016

Added test case to reproduce bug #73087

@weltling
Copy link
Contributor

weltling commented Nov 6, 2016

Merged via 3d73f71.

Thanks!

@weltling weltling closed this Nov 6, 2016
@madorin
Copy link
Contributor Author

madorin commented Nov 7, 2016

Anatol, please close also #61895.
It is also related to this fix. Stack trace show that engine hangs on param_dtor.
I examined db metadata / php script and they have blob fields and parameters: TB_NIOKR / ACOMMENT DOM_TEXT.

mariuz added a commit to mariuz/yii2-firebird that referenced this pull request Nov 9, 2016
Fixed by this pull request php/php-src#2183

Thanks to @madorin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants