Skip to content
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

DBAL-239: CI 2 + DOCTRINE 2 + SQLSERVER 2005 PDO_SQLSRV.DLL #1414

Closed
doctrinebot opened this issue Mar 23, 2012 · 6 comments
Closed

DBAL-239: CI 2 + DOCTRINE 2 + SQLSERVER 2005 PDO_SQLSRV.DLL #1414

doctrinebot opened this issue Mar 23, 2012 · 6 comments
Assignees
Labels

Comments

@doctrinebot
Copy link

Jira issue originally created by user stcoid1:

Hi, master...

Please help me,
i was integration : ci2doctrine2pdo_mysql status is OK http://103.28.148.89/ci2doctrine2
php.ini http://103.28.148.89 ===> phpinfo()

But ci2doctrine2pdo_sqlsrv. Show bugs this :

"Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[IMSSP]: This extension requires either the Microsoft SQL Server 2008 Native Client (SP1 or later) or the Microsoft SQL Server 2008 R2 Native Client ODBC Driver to communicate with SQL Server. Neither of those ODBC Drivers are currently installed. Access the following URL to download the Microsoft SQL Server 2008 R2 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712' in C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\DBAL\Driver\PDOConnection.php:36 Stack trace: #0 C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\DBAL\Driver\PDOConnection.php(36): PDO->__construct('sqlsrv:server=B...', 'sa', 'password', Array) #1 C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\DBAL\Driver\PDOSqlsrv\Driver.php(38): Doctrine\DBAL\Driver\PDOConnection->__construct('sqlsrv:server=B...', 'sa', 'password', Array) #2 C:\xampp\htdocs\sqlserver\application\third_party\doct in C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\DBAL\Driver\PDOConnection.php on line 36"

Thanks
GBU

@doctrinebot
Copy link
Author

Comment created by stcoid1:

This Problem is resolve with SQL Server 2008.

But i have new problem, paging is Error

"Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]The multi-part identifier "c0_.group_company_code" could not be bound.' in C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\DBAL\Connection.php:577 Stack trace: #0 C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\DBAL\Connection.php(577): PDO->query('WITH outer_tbl ...') #1 C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\ORM\Query\Exec\SingleSelectExecutor.php(46): Doctrine\DBAL\Connection->executeQuery('WITH outer_tbl ...', Array, Array) #2 C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\ORM\Query.php(274): Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute(Object(Doctrine\DBAL\Connection), Array, Array) #3 C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\ORM\AbstractQuery.php(539): Doctrine\ORM\Query->_doExecute() #4 C:\xampp\htdocs\sqlserver\application\third_party\doctri in C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\DBAL\Connection.php on line 577"

This link http://103.28.148.89/sqlserver/index.php/company*group/posts/list_company*group

Any body help...

Thanks

@doctrinebot
Copy link
Author

Comment created by stcoid1:

Problem Resolve

go into:
Doctrine\DBAL\Platforms\MsSqlPlatform

Find:
$over = preg*replace('/\"[<sup>,]*\".\"([</sup>,]*)\"/i', '"inner*tbl"."$1"', $orderby);

Add before:

                    # Get Columns
                    $columns = array();
                    if(preg*match_all('/([a-zA-Z][0-9]<ins>_\.[a-zA-Z0-9\-_]</ins>)\sAS\s([a-zA-Z0-9\-\*]<ins>)/', $query, $matched)) {
                        for($i=0; $i<count($matched[1]); </ins><ins>$i)
                        {
                            $columns[$matched[1][$i]] = $matched[2][$i];
                        }
                    }

                    # Replace columns with their alias in the "orderby" statement
                    if(preg*match_all('/([a-zA-Z][0-9]</ins>_\.[a-zA-Z0-9\-*]+)\s/i', $orderby, $matches)) {
                        foreach($matches[1] as $column)
                        {
                            $orderby = preg_replace('/'.$column.'/', $columns[$column], $orderby);
                        }
                    }

Thanks on issue this link "http://www.doctrine-project.org/jira/browse/[DBAL-82](http://www.doctrine-project.org/jira/browse/DBAL-82)?page=com.atlassian.jira.plugin.system.issuetabpanels%3Achangehistory-tabpanel"

@doctrinebot
Copy link
Author

Comment created by @beberlei:

CAn you post the query that leads to this error? I cant reproduce it with SQL Server 2008

@doctrinebot
Copy link
Author

Comment created by @beberlei:

This was fixed in other issues already

@doctrinebot
Copy link
Author

Issue was closed with resolution "Duplicate"

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants