Msphpsql: Unknown type in sqlsrv_buffered_query::sqlsrv_buffered_query When querying extended properties

Created on 17 Jan 2020  路  8Comments  路  Source: microsoft/msphpsql

EXEC sp_addextendedproperty @name=N'MS_Description', @value='Schema table description may contain "quotes" and could be long鈥攙ery long indeed.',@level0type = N'Schema', @level0name = 'dbo',@level1type = N'Table', @level1name = 'test48992550test_table'

SELECT prop.value FROM information_schema.tables tbl LEFT JOIN sys.extended_properties prop ON prop.major_id = object_id(tbl.table_schema + '.' + tbl.table_name) AND prop.minor_id = 0 AND prop.name = 'MS_Description' WHERE tbl.table_type = 'base table' AND tbl.table_schema='dbo' AND tbl.table_name='test48992550test_table'

Produces the error:
Drupal\KernelTests\Core\Database\SchemaTest::testSchema PHPUnit\Framework\Exception: PHP Fatal error: Unknown type in sqlsrv_buffered_query::sqlsrv_buffered_query in /home/travis/build/Beakerboy/drupal-project/web/drivers/lib/Drupal/Driver/Database/sqlsrv/Statement.php on line 67

PHP Driver version or file name
sqlsrv-5.6.1
pdo_sqlsrv-5.6.1

SQL Server version
mssql-server-2019 xenial

Client operating system
Ubuntu

PHP version
7.2.15

bug

All 8 comments

/home/travis/build/Beakerboy/drupal-project/web/drivers/lib/Drupal/Driver/Database/sqlsrv/Statement.php on line 67

hi @Beakerboy please provide few lines before and after this line 67

Wow! Such fast response. Line 67 is the last in this block.

public function execute($args = [], $options = []) {
if (isset($options['fetch'])) {
  if (is_string($options['fetch'])) {
    // Default to an object. Note: db fields will be added to the object
    // before the constructor is run. If you need to assign fields after
    // the constructor is run, see http://drupal.org/node/315092.
    $this->setFetchMode(PDO::FETCH_CLASS, $options['fetch']);
  }
  else {
    $this->setFetchMode($options['fetch']);
  }
}
$logger = $this->dbh->getLogger();
$query_start = microtime(TRUE);

// If parameteres have already been binded
// to the statement and we pass an empty array here
// we will get a PDO Exception.
if (empty($args)) {
  $args = NULL;
}

// Execute the query. Bypass parent override
// and directly call PDOStatement implementation.
$return = PDOStatement::execute($args);

Full file is here(https://github.com/Beakerboy/sqlsrv/blob/Funky-default/drivers/lib/Drupal/Driver/Database/sqlsrv/Statement.php)

I鈥檓 working on the sqlsrv driver for Drupal, trying to get it to pass all the Core Integration tests. The current driver just skips over all schema description functionality, (possibly because of this issue?)

The repository linked above has both an Appveyor (Windows/PHP/IIS) and Travis (Ubuntu/PHP/Apache) Script to install Drupal And run test suites. The error occurs on both.

Thanks for the info @Beakerboy
We will do the investigation and get back to you on this.

At first glance, I can't seem to find sqlsrv_buffered_query::sqlsrv_buffered_query... am I missing something?

I believe the sqlsrv_buffered_query data type is being returned by PDO. Might be similar to this:
https://github.com/Microsoft/msphpsql/issues/51
@david-garcia-garcia is the original maintainer of the Drupal module I鈥檓 working on.

Thanks @Beakerboy I can reproduce the issue in #51 with buffered queries. I'll investigate further and get back to you.

Fixed! Thanks!

Was this page helpful?
0 / 5 - 0 ratings