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
- method returning value accessed by reference - https://github.com/peachpiecompiler/peachpie/issues/234#issuecomment-417310902 - method that returns value is accessed by reference — committed to peachpiecompiler/peachpie by jakubmisek 6 years ago
- implements PDOStatement::errorInfo(), PDOStatement::errorCode(), PDOException::errorInfo ref https://github.com/peachpiecompiler/peachpie/issues/234 — committed to peachpiecompiler/peachpie by jakubmisek 4 years ago
@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:
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).