Skip to content

MYSQL_ATTR_USE_BUFFERED_QUERY is a bool attribute #10320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/pdo_mysql/mysql_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_
break;

case PDO_MYSQL_ATTR_USE_BUFFERED_QUERY:
ZVAL_LONG(return_value, H->buffered);
ZVAL_BOOL(return_value, H->buffered);
break;

case PDO_ATTR_EMULATE_PREPARES:
Expand Down
4 changes: 2 additions & 2 deletions ext/pdo_mysql/tests/bug68371.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $attrs = array(
// Extensive test: default value and set+get values
PDO::ATTR_EMULATE_PREPARES => array(null, 1, 0),
PDO::MYSQL_ATTR_DIRECT_QUERY => array(null, 0, 1),
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => array(null, 0, 1),
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => array(null, false, true),

// Just test the default
PDO::ATTR_AUTOCOMMIT => array(null),
Expand Down Expand Up @@ -73,7 +73,7 @@ OK
int(0)
OK
OK
int(1)
bool(true)
OK
OK
int(1)
Expand Down
6 changes: 3 additions & 3 deletions ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ MySQLPDOTest::skip();
/* TODO - why is this a valid option if getAttribute() does not support it?! */
PDO::ATTR_TIMEOUT => false,
PDO::ATTR_EMULATE_PREPARES => 1,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => 1,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
/* TODO getAttribute() does not handle it */
PDO::MYSQL_ATTR_LOCAL_INFILE => false,
/* TODO getAttribute() does not handle it */
Expand Down Expand Up @@ -144,8 +144,8 @@ MySQLPDOTest::skip();
if ($db->getAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY))
printf("[018] PDO::MYSQL_ATTR_DIRECT_QUERY should be off\n");

set_option_and_check(19, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, 1, 'PDO::MYSQL_ATTR_USE_BUFFERED_QUERY');
set_option_and_check(20, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, 0, 'PDO::MYSQL_ATTR_USE_BUFFERED_QUERY');
set_option_and_check(19, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true, 'PDO::MYSQL_ATTR_USE_BUFFERED_QUERY');
set_option_and_check(20, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false, 'PDO::MYSQL_ATTR_USE_BUFFERED_QUERY');

set_option_and_check(21, PDO::MYSQL_ATTR_LOCAL_INFILE, true, 'PDO::MYSQL_ATTR_LOCAL_INFILE');
set_option_and_check(22, PDO::MYSQL_ATTR_LOCAL_INFILE, false, 'PDO::MYSQL_ATTR_LOCAL_INFILE');
Expand Down