Code Monkey home page Code Monkey logo

symfony-mssql-bundle's People

Contributors

darkwhispering avatar krzysiekj avatar mm-devmonk avatar slootjes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

krzysiekj s12r

symfony-mssql-bundle's Issues

ConnectionHelper results in AssertionError

Running this in the Dockerphp:7.4-apache image with dblib configured.

PHP: 7.4.12
Symfony: 5.2.3
MSSQL: 12.00.6118

After running the command bin/console dbal:run-sql "SELECT TOP 1 * FROM table I get this response:

In PDOConnection.php line 53:
                             
  [AssertionError (1)]       
  assert($result !== false)

Exception trace:
  at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:53
 assert() at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:53
 Doctrine\DBAL\Driver\PDOConnection->exec() at /var/www/html/vendor/mediamonks/mssql-bundle/Helper/ConnectionHelper.php:16
 MediaMonks\MssqlBundle\Helper\ConnectionHelper::setConnectionOptions() at /var/www/html/vendor/mediamonks/mssql-bundle/Doctrine/DBAL/Driver/PDODblib/Driver.php:70
 MediaMonks\MssqlBundle\Doctrine\DBAL\Driver\PDODblib\Driver->connectUnix() at /var/www/html/vendor/mediamonks/mssql-bundle/Doctrine/DBAL/Driver/PDODblib/Driver.php:34
 MediaMonks\MssqlBundle\Doctrine\DBAL\Driver\PDODblib\Driver->connect() at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:362
 Doctrine\DBAL\Connection->connect() at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1853
 Doctrine\DBAL\Connection->getWrappedConnection() at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1241
 Doctrine\DBAL\Connection->executeQuery() at /var/www/html/vendor/mediamonks/mssql-bundle/Doctrine/DBAL/Connection.php:17
 MediaMonks\MssqlBundle\Doctrine\DBAL\Connection->executeQuery() at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:978
 Doctrine\DBAL\Connection->fetchAllAssociative() at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php:91
 Doctrine\DBAL\Tools\Console\Command\RunSqlCommand->execute() at /var/www/html/vendor/symfony/console/Command/Command.php:256
 Symfony\Component\Console\Command\Command->run() at /var/www/html/vendor/symfony/console/Application.php:989
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/framework-bundle/Console/Application.php:96
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:290
 Symfony\Component\Console\Application->doRun() at /var/www/html/vendor/symfony/framework-bundle/Console/Application.php:82
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/html/vendor/symfony/console/Application.php:166
 Symfony\Component\Console\Application->run() at /var/www/html/bin/console:43

This is triggered when the ConnectionHelper starts running this query:

$connection->exec('SET ANSI_WARNINGS ON');

As a workaround I've created my own class extending MediaMonks\MssqlBundle\Doctrine\DBAL\Driver\PDODblib\Driver and overwriting the connectUnix method to exclude ConnectionHelper::setConnectionOptions($connection);

ConnectionHelper.php updateQuery prepending bindValues with N

In the following code, what was the reason for pre-pending the values with N?

https://github.com/mediamonks/symfony-mssql-bundle/blob/master/Helper/ConnectionHelper.php

  /**
     * @param $query
     * @param array $values
     * @return void|mixed
     */
    public static function updateQuery($query, array $values = [])
    {
        if (PlatformHelper::isWindows()) {
            return $query;
        }

        for ($i = 0, $offset = 0; $pos = strpos($query, '?', $offset); $i++) {
            $offset = $pos + 1;
            if (isset($values[$i]) && is_string($values[$i])) {
                $query = substr_replace($query, 'N?', $pos, 1);
                $offset++;
            }
        }

        return $query;
    }

We're using this bundle on Ubuntu servers, and it's failing due to the pre-pended 'N' on the values, when we remove the isWindows() check is seems to work fine.

Should this logic be here? Was it for an older version of doctrine?

We're using:

        "doctrine/orm": "^2.5.11",
        "doctrine/doctrine-bundle": "^1.6.10",

encoding issue at php7

Hi,

i am using your bundle with no bigger problems so far but when i switched to PHP7 i got some strange encoding issue with persisting my entities. When i create the entity all strings with accents are converted to some kind of chinese, and while editing with properties containing accents there is 500 error (while parsing update database query).

The problem doesnt occur on php5 nor php7 with mysql so i think that might be issue with the bundle. Do you have any idea what might be wrong?

SingleTablePersister issue

I am using your bundle for mssql server support, but we want also to use "single table inheritance" feature from Doctrine, but there is an issue, I found what it is, and I'm asking if it can be fixed in the feature?

The issue is that your bundle overwrite Doctrine\ORM\Persisters\Entity\SingleTablePersister, in different files from "/doctrine/orm/lib/", with MediaMonks\MssqlBundle\Doctrine\ORM\Persisters\Entity\SingleTablePersister, but this class doesn't exists there, so we receive an error. This is done in MediaMonks\MssqlBundle\Composer\ScriptHandler.

So, can this be fixed?

Thank you.
Best regards,
Paul

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.