peachpie: PDOStatement is not implemented

Hi again,

when running $pdoObject->query() a NotImplementedException is thrown. I see there is code present in src\PDO\Peachpie.Library.PDO\PDO.cs so I assume the exception is thrown because query() is missing in src\PDO\Peachpie.Library.PDO.MySQL\PDOMySQLDriver.cs

The full exception is this: CLR/System.NotImplementedException Exception thrown: 'System.NotImplementedException' in Peachpie.Library.PDO.dll: 'The method or operation is not implemented.'

Kind regards

  • Tobi

Please note: because Magento is so huge I can not test if every single function is actually called but the following functions are used:

PDO => https://github.com/tobihille/magento-peachpie/blob/master/website/lib/Zend/Db/Adapter/Pdo/Mysql.php and https://github.com/tobihille/magento-peachpie/blob/master/website/lib/Zend/Db/Adapter/Pdo/Abstract.php:

  • setAttribute
  • query (I added the first call to this to make up the missing initStatements in Mysql Connector/NET, if this means trouble we can delay it a bit)
  • lastInsertId
  • exec
  • quote
  • beginTransaction
  • commit
  • rollBack
  • getAttribute
  • prepare
  • getAvailableDrivers (static call)

Statement => https://github.com/tobihille/magento-peachpie/blob/master/website/lib/Zend/Db/Statement.php and https://github.com/tobihille/magento-peachpie/blob/master/website/lib/Zend/Db/Statement/Pdo.php

  • bindParam prepare
  • execute
  • rowCount
  • fetch close
  • setFetchMode
  • fetchAll
  • fetchColumn
  • bindValue
  • closeCursor
  • columnCount
  • errorCode
  • errorInfo
  • bindColumn
  • fetchObject
  • getAttribute
  • getColumnMeta (seems not used)
  • nextRowset
  • setAttribute

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 41 (26 by maintainers)

Commits related to this issue

Most upvoted comments

@tobihille Hello, The first working version of PDO and PDOStatement should be now implemented in peachpie:master. The functions implemented so far: PDO::setAttribute(), query(), prepare(); PDOStatement::execute(), setFetchMode(), fetch() not all fetchModes may be implemented… FETCH_ASSOC, FETCH_OBJ and FETCH_COLUMN should be tested thought. Not all PDO Attributes are implemented as well, however I do not see any of those in your code

I suggest you can test that and we will continue in implementing the rest of PDO.

@jakubmisek thanks for the hint. I updated it to 0.9.0-dev and this issue is gone now, but I still can’t compile, now there is a stack overflow exception happening:

Microsoft ®-Buildmodule, Version 15.7.179.6572 for .NET Core
Copyright © Microsoft Corporation. All rights reserved.

Restore completed in “83,01 ms” for “C:\<my_home>\Documents\webroot\hackathon_m1\website\magento.msbuildproj”. Restore completed in “29,39 ms” for “C:\<my_home>\Documents\webroot\hackathon_m1\webserver\webserver.csproj”. Restore completed in “30,25 ms” for “C:\<my_home>\Documents\webroot\hackathon_m1\website\magento.msbuildproj”. PeachPie PHP Compiler version 0.9.0-dev

Process is terminating due to StackOverflowException. C:\<my_home>.nuget\packages\peachpie.net.sdk\0.9.0-dev\build\Peachpie.NET.Core.Sdk.targets(160,5): error MSB3073: The command “dotnet compile-php @obj\Debug\netcoreapp2.0\compile-php-args.rsp” exited with code -1073741571. [C:\<my_home>\Documents\webroot\hackathon_m1\website\magento.msbuildproj]

Build failed. <the same message once more>

0 Warnings
1 Error

Elapsed time 00:01:21.30

Please note that I have a german installation and translated the strings, if there is a typo somwhere I’m probably the reason 😉

I pushed my current state to https://github.com/tobihille/magento-peachpie if you need it to reproduce the issue (I assume it’s a compiler-issue).

  • Tobi