Code Monkey home page Code Monkey logo

doctrine1's Introduction

Doctrine1

About this version

This is a community driven fork of doctrine 1, as official support has been interrupted long time ago.

Do not use it for new projects: this version is great to improve existing symfony1 applications using doctrine1, but Doctrine2 is the way to go today.

Requirements

PHP 5.3 and up.

Installation

Using Composer as dependency management:

composer require friendsofsymfony1/doctrine1 "1.4.*"
composer install

Tests

Prerequisites

  • docker-engine version 17.12.0+
  • docker-compose version 1.20.0+

How to execute all tests on all supported PHP versions and dependencies?

tests/bin/test

When you finish your work day, do not forget to clean up your desk

docker-compose down

Documentation

Read the official doctrine1 documentation

Contributing

You can send pull requests or create an issue.

doctrine1's People

Contributors

alquerci avatar arendvw avatar beberlei avatar cmdeviant avatar connorhu avatar derflocki avatar eabay avatar endeveit avatar estahn avatar gromnan avatar guilhermeblanco avatar iricketson avatar j0k3r avatar jeromemacias avatar jwage avatar miamibc avatar mkopinsky avatar moonraking avatar paddyhamburg avatar pathumhdes avatar thepanz avatar thirsch avatar tlt-miamed avatar tybaze avatar vansante avatar vitaliytv avatar wutsch0 avatar xnatek avatar zkiiito avatar zobzn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar

doctrine1's Issues

Double quoting on select aliases

I'm having the following issue with Doctrine_Core::ATTR_QUOTE_IDENTIFIER config. Queries are being double quoted like this:

SELECT `u`.```id``` AS `u__0` FROM

When I issue the following query:

$query =  Doctrine_Query::create()->select('u.id as user_id')

Digging up on some git logs I found out about this commit on a fork.

Can we merge this up? Have you stumbled upon this issue as well?

Doctrine_Core::HYDRATE_ON_DEMAND not working

Hello, i found an issue, using the doctrine1 fork of LExpress with symfony1.5

I have a pager built. With NbResults 600 (in an example)
then i user the method:
$oCustomers = $pager->getResults(Doctrine_Core::HYDRATE_ON_DEMAND);
that gets us an object: Doctrine_Collection_OnDemand

then i have a while loop:

while ($oCustomer = $oCustomers->current()) {
.....
....
     $oCustomer->free();
     $oCustomers->next();
}

i would suppose to have 600 loops.

i actually have 2!

rolled back in symfony1.4 i confirm having 600 loops.

do you have any idea on the subject?

thanks!

Incompatibility with MySQL 5.7 (Ubuntu 16.04)

In mysql 5.7 it's required to have the order by fields to be present in the select statement when using DISTINCT. This is because the ONLY_FULL_GROUP_BY setting is turned on by default. I couldn't find where to fix this but it seems to be related to the sfPager or sfDoctrinePager, and I'm sure there are other places in the code this could happen.

Here's part of the trace of error:

SQLSTATE[HY000]: General error: 3065 Expression #1 of ORDER BY clause is not in SELECT list, references column 'time_dev.u3.bio' which is not in SELECT list; this is incompatible with DISTINCT. Failing Query: "SELECT DISTINCT u3.id, SUM(u4.value) AS u4__0 FROM user u3 INNER JOIN user_skill u4 ON u3.id = u4.user_id WHERE u3.first_name IS NOT NULL AND u3.cache_thumbs >= 0 AND u3.id IN (1, 14, 22, 35, 58, 79, 87, 91, 97, 101, 125, 178, 190, 235, 261, 267, 277, 280, 287, 341, 410, 438, 483, 488, 489, 492, 496, 510, 526, 562, 573, 579, 1085, 1134, 1147, 1193, 1195, 1285, 1542, 1558, 1643, 1664, 1842, 1843, 2206, 2268, 2387, 2442, 2475, 2491, 2566, 2678, 2714, 3059, 3202, 3258, 3677, 3723, 4176, 4177, 4183, 4187, 4189, 4230, 4244, 4271, 4288, 4322, 4335, 4361, 4362, 4372, 4374, 4388, 4402, 4407, 4419, 4443, 4444, 4450, 4465, 4475, 4484, 4488, 4489, 4510, 4517, 4531, 4538, 4548, 4566, 4573, 4617, 4618, 4621, 4622, 4624, 4631, 4638, 4653, 4664, 4669, 4672, 4673, 4680, 4681, 4690, 4695, 4723, 4738, 4739, 4745, 4772, 4779, 4789, 4796, 4812, 4821, 4822, 4823, 4827, 4847, 4860, 4871, 4877, 4880, 4887, 4913, 4921, 4923, 4944, 4983, 4984, 4987, 5002, 5004, 5007, 5011, 5019, 5021, 5023, 5028, 5029, 5036, 5043, 5056, 5065, 5083, 5095, 5096, 5116, 5137, 5155, 5195, 5204, 5214, 5221, 5231, 5239, 5274, 5275, 5287, 5293, 5299, 5306, 5344, 5345, 5346, 5348, 5354, 5355, 5358, 5359, 5371, 5374, 5394, 5395, 5403, 5408, 5429, 5430, 5434, 5447, 5464, 5474, 5481, 5497, 5514, 5520, 5550, 5551, 5556, 5557, 5558, 5567, 5569, 5610, 5622, 5629, 5633, 5636, 5640, 5641, 5646, 5650, 5674, 5677, 5684, 5696, 5697, 5702, 5714, 5728, 5731, 5735, 5747, 5750, 5761) AND u4.value >= 1 AND u4.skill_id IN (1, 2, 3, 4, 5, 6, 7, 31, 39, 51, 52, 54) GROUP BY u3.username ORDER BY CASE WHEN u3.bio IS NULL OR u3.bio='' THEN 1 ELSE 0 END, u4__0 DESC LIMIT 20"

As a workaround I added

[mysqld]
sql-mode=""

to the my.cnf file and it solves the issue, but I guess that's not a very permanent solution.

Doctrine_Export is trying to commit when there is no active transaction on PHP 8.0

This appears to be an issue in PHP 8.0, with a database like MySQL/MariaDB that has implicit commits.

We're currently in the process of upgrading from PHP 7.4 to 8.0 (then to other 8.x versions, 8.0 is an intermediate update)

Our build process for our test environments involves running doctrine:build --all, which as part of its execution calls sfDoctrineInsertSqlTask. This task ends up calling \Doctrine_Export::exportClasses. This method generates a bunch of DDL commands and runs them inside a transaction, finally calling commit.

In PHP 7.4, this ran into no issues.
In PHP 8.0, we are getting a PDOException with the text "There is no active transaction".

It looks like the root cause of this is the PDO classes internal transaction state tracking becoming out of sync with the database when the database implicitly commits. In 7.4 this used to just be silent and the commit call would essentially be a no-op. In 8.0 the internal transaction state tracking of PDO was updated to begin throwing this exception when it recognized the actual connection was no longer in a transaction.

Here is a related issue with its fix in the modern doctrine/migrations library: doctrine/migrations#1104. For that issue they updated their migration-related commit calls to first check if they were still in an active transaction (and have isTransactional for a more permanent fix).

Given the behavior of exportClasses to almost always contain DDL queries, I think it likely makes sense to check if we're still in a transaction before calling commit. This behavior could also be an override of the exportClasses method in \Doctrine_Export_Mysql. Interested in hearing other thoughts on this or if there's something I missed.

Passing Options to Connection and other Issue

Hi,

We were trying to enable SSL for our MySQL connection by setting up PDO::MYSQL_ATTR_SSL_CA and other attributes, turns out there is no way to achieve it using databases.yml. While there seems to be attributes and an a vague "other" option being used in code, nothing gets passed to the actual connection.

lexpress/doctrine1/lib/Doctrine/Connection.php Line 215 in constructor:

$this->options['other'] = array();
if (isset($adapter['other'])) {
    $this->options['other'] = array(Doctrine_Core::ATTR_PERSISTENT => $adapter['persistent']);
}

First of all, if $adaptor["other"] is being checked, not sure why values in $adaptor["other"] are not being passed on to this->options. Secondly, why would $adaptor["other"] guarantee the presence of $adaptor["persistent"] is beyond me. Clearly seems to be an error.

There is also an issue with getOption method code (Line 262). If the option is not set, the code has no return value, making it a method that can be void and returning a value at the same time. Shouldn't it return null or false?

/**
     * getOption
     *
     * Retrieves option
     *
     * @param string $option
     * @return void
     */
    public function getOption($option)
    {
        if (isset($this->options[$option])) {
            return $this->options[$option];
        }
    }

We had to ultimately use the event doctrine.configure_connection in order to add PDO::MYSQL_ATTR_SSL_CA to the connection's other property in order to get the SSL connection. I think there has to be some way to pass additional options to the connection through databases.yml.

Deprecated Warning on "doctrine:build" results in corrupted base files

The command php symfony doctrine:build --all-classes --application=backend'

results into some deprecated warnings

doctrine generating form classes

PHP Deprecated: strtolower(): Passing null to parameter $string) of type string is deprecated in vendor/friendsofsymfony1/doctrine1/lib/Doctrine/Table.php on line 1182

Afterwords its IN the generated base classes und results in corrupted files.
(because the output is passed there)

Do you know why I got this message ?

Hi,
Do you know why I got this kind of message ?

Fatal error: require(): Failed opening required 'symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Parser/sfYaml/sfYamlConfigHandler.php' (include_path='.:/usr/share/php') in symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php on line 1118

see original issue qdpm/qdpm#2

PHP Notices showing up when trying to build schema yaml from db

Hi,

I am getting the following PHP Notice multiple times when trying to build schema from db

PHP Notice: Undefined index: type in /workspace/virtual_hosts/Daily/lib/vendor/lexpress/doctrine1/lib/Doctrine/Import/Builder.php on line 785

Here's symfony command I'm using:
./symfony doctrine:build-schema

I'm on PHP 7.1.1 running lexpress (Symfony 1.5.7 and Doctrine1-dev-master)

Database Migration does set current version in DB

If u run php symfony doctrine:migrate the tash will so the migration_version table to the current version.

That does not happen anymore.
The value (version) does not change.

Its in the Doctrine/Migration.php: https://github.com/FriendsOfSymfony1/doctrine1/blob/master/lib/Doctrine/Migration.php#L350

                $this->_connection->commit();
                $this->setCurrentVersion($to);

Does not work anymore.

I changed it to:

              $this->setCurrentVersion($to);
              $this->_connection->commit();
                

That works!

If rollback fails, then the original exception is not being thrown.

https://github.com/LExpress/doctrine1/blob/fce1192e87a76e1ddcf69b3defa73e451a816c8c/lib/Doctrine/Connection/UnitOfWork.php#L152

It looks like if the rollback fails with "Rollback failed. There is no active transaction.", then we never find out what the original exception was about.

I have this happening, for whatever reason the rollback fails. Could be improved by wrapping the rollback in another try catch and appending the exception to the previous one. What do you think?

double field typed records always updated in database even no field value changed

When I have a record with a field using double type. After calling the set method on a double field record row is always updated in the database even if the double value has not changed at all.

Detected symfony version: 1.5.14-dev

After some debugging I found that the _isValueModified method in Record.php does not properly check fields with double types. It matches as a string. Adding the double type check (in_array($type, array('decimal', 'float', 'double') into the condition will eliminate this problem.

    protected function _isValueModified($type, $old, $new)
    {
        if ($new instanceof Doctrine_Expression) {
            return true;
        }

        if ($type == 'boolean' && (is_bool($old) || is_numeric($old)) && (is_bool($new) || is_numeric($new)) && $old == $new) {
            return false;
        } else if (in_array($type, array('decimal', 'float', 'double')) && is_numeric($old) && is_numeric($new)) {
            return $old * 100 != $new * 100;
        } else if (in_array($type, array('integer', 'int')) && is_numeric($old) && is_numeric($new)) {
            return $old != $new;
        } else if ($type == 'timestamp' || $type == 'date') {
            $oldStrToTime = @strtotime((string) $old);
            $newStrToTime = @strtotime((string) $new);
            if ($oldStrToTime && $newStrToTime) {
                return $oldStrToTime !== $newStrToTime;
            } else {
                return $old !== $new;
            }
        } else {
            return $old !== $new;
        }
    }

Hydration broken when aliasing a column of a joined relation

After this commit (1d68711) we get a different result for queries where we alias a column of a relation.

$rs = Doctrine_Query::create()
            ->select('c.id, h.hours as hrs')
            ->from('Calculation c')
            ->innerJoin('c.History h')
            ->execute([], Doctrine_Core::HYDRATE_ARRAY);

var_dump($rs);

/*
// After the commit we get:
array(1) {
    [0]=> array(2) {
        ["id"]=> string(5) "1"
        ["hrs"]=> string(4) "3.00"
    }
} 

// Before it was this (and therefore also the expected result):
array(1) {
     [0]=> array(3) {
         ["id"]=> string(5) "1"
         ["hrs"]=> string(4) "3.00"
         ["History"]=> array(2) {
             [0]=> array(2) {
                 ["id"]=> string(4) "1"
                 ["hrs"]=> string(4) "3.00"
             }
             [1]=> array(2) {
                 ["id"]=> string(3) "2"
                 ["hrs"]=> string(4) "2.00"
             }
         }
     }
} 
*/ 

Data type validation can fail for float/double

With commit afc2a25, the validation of float values was changed.
But since the comparison in the validation is now type strict, it can fail on very small float values (e.g. 0.000001), since PHP will represent these float value as "1.0E-6" but compare them against the original string value.
So here, it is better to use a non-strict comparison ("==" instead of "===").

Hydrator Error when using Doctrine_Pager

When using Doctrine_Pager i got this error :

2017/03/18 10:45:24 [error] 4715#4715: *118 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function getLast() on boolean in ....lib/vendor/lexpress/doctrine1/lib/Doctrine/Hydrator/RecordDriver.php:110
Stack trace:
#0 .../lib/vendor/lexpress/doctrine1/lib/Doctrine/Hydrator/Graph.php(269): Doctrine_Hydrator_RecordDriver->setLastElement(Array, false, false, 'nilai', true)
#1 ...

The error is gone with this simple fix in : lib/vendor/lexpress/doctrine1/lib/Doctrine/Hydrator/RecordDriver.php:110

But i'm not sure, if this is the proper solution.

        if (count($coll) > 0) {
			if($prev[$dqlAlias] == null) {
				return ;
			} else {
              $prev[$dqlAlias] = $coll->getLast();
		    }
        }

Access to an undefined property

The phpstan analysis produced 1657 such errors. This could potentially cause a php warning, so this should be fixed in the future.

serialize/unserialize of records with 'array' columns fails

This bug happens only on edge cases. Let me describe the scenario first:

schema.yml:

Model:
  columns:
    details: { type: array, notnull: true }
  options:
    symfony: { form: false, filter: false }
    type: InnoDB


RelatedModel:
  columns:
    model_id: { type: integer(8), unsigned: true, notnull: true }
  relations:
    Model:    { class: Model, foreign: id, local: model_id, foreignAlias: RelatedModels, type: one, foreignType: many }
  options:
    symfony:  { form: false, filter: false }
    type: InnoDB

Important here is that 'Model' contains a column of type 'array' and 'Model' has a 'RelatedModel'.

Now the database content:
The database should contain at least one 'Model' (id: 1) connected with one 'RelatedModel' (id: 1).
The 'Model'.'details' should contain an array with at least 20 entries.

Now lets provoke the error. I found these two methods:

Method 1: Load form database with cache
If this query hits the cache the unserialize will fail.

$foo = ModelTable::getInstance()
    ->createQuery('m')
    ->leftJoin('m.RelatedModels rm')
    ->select('m.id, m.details, rm.id')
    ->where('m.id = ?', 1)
    ->useResultCache(true)
    ->execute();

Method 2: serialize/unserialize with references

$foo = ModelTable::getInstance()
    ->createQuery('m')
    ->leftJoin('m.RelatedModels rm')
    ->select('m.id, m.details, rm.id')
    ->where('m.id = ?', 1)
    ->execute();

$foo->serializeReferences(true);
unserialize(serialize($foo));

both of these examples will create an error similar to this:

>> sfWebDebugLogger  Notice at /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Collection.php on line 176 (unserialize(): Error at offset 596 of 657 bytes)
NOTICE |13:06:01: {sfWebDebugLogger}  Notice at /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Collection.php on line 176 (unserialize(): Error at offset 596 of 657 bytes)

Notice: unserialize(): Error at offset 596 of 657 bytes in /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Collection.php on line 176

Call Stack:
    0.0005     241824   1. {main}() /workdir/symfony:0
    0.3185   25599144   2. sfSymfonyCommandApplication->run() /workdir/symfony:19
    0.3207   25603696   3. sfTask->runFromCLI() /workdir/vendor/lexpress/symfony1/lib/command/sfSymfonyCommandApplication.class.php:76
    0.3207   25605088   4. sfBaseTask->doRun() /workdir/vendor/lexpress/symfony1/lib/task/sfTask.class.php:98
    0.3664   37410728   5. testTask->execute() /workdir/vendor/lexpress/symfony1/lib/task/sfBaseTask.class.php:70
    0.3757   39949400   6. Doctrine_Query_Abstract->execute() /workdir/lib/task/testTask.class.php:45
    0.6709   42200896   7. Doctrine_Query_Abstract->_constructQueryFromCache() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Query/Abstract.php:1085
    0.6709   42200944   8. unserialize() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Query/Abstract.php:1235
    0.6717   42437752   9. Doctrine_Collection->unserialize() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Query/Abstract.php:1235
    0.6717   42437800  10. unserialize() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Collection.php:176
    0.6718   42441352  11. Doctrine_Record->unserialize() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Collection.php:176
    0.6718   42441968  12. unserialize() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Record.php:869
    0.6718   42455632  13. Doctrine_Collection->unserialize() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Record.php:869
    0.6718   42455680  14. unserialize() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Collection.php:176

>> sfWebDebugLogger  Warning at /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Collection.php on line 178 (Invalid argument supplied for foreach())
WARNING|13:06:01: {sfWebDebugLogger}  Warning at /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Collection.php on line 178 (Invalid argument supplied for foreach())

Warning: Invalid argument supplied for foreach() in /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Collection.php on line 178

Call Stack:
    0.0005     241824   1. {main}() /workdir/symfony:0
    0.3185   25599144   2. sfSymfonyCommandApplication->run() /workdir/symfony:19
    0.3207   25603696   3. sfTask->runFromCLI() /workdir/vendor/lexpress/symfony1/lib/command/sfSymfonyCommandApplication.class.php:76
    0.3207   25605088   4. sfBaseTask->doRun() /workdir/vendor/lexpress/symfony1/lib/task/sfTask.class.php:98
    0.3664   37410728   5. testTask->execute() /workdir/vendor/lexpress/symfony1/lib/task/sfBaseTask.class.php:70
    0.3757   39949400   6. Doctrine_Query_Abstract->execute() /workdir/lib/task/testTask.class.php:45
    0.6709   42200896   7. Doctrine_Query_Abstract->_constructQueryFromCache() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Query/Abstract.php:1085
    0.6709   42200944   8. unserialize() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Query/Abstract.php:1235
    0.6717   42437752   9. Doctrine_Collection->unserialize() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Query/Abstract.php:1235
    0.6717   42437800  10. unserialize() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Collection.php:176
    0.6718   42441352  11. Doctrine_Record->unserialize() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Collection.php:176
    0.6718   42441968  12. unserialize() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Record.php:869
    0.6718   42455632  13. Doctrine_Collection->unserialize() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Record.php:869


06.09.2018 01:06:01 - Task ./symfony, t:t caught exception of class Doctrine_Exception with message Couldn't find class /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Table.php 310
#0 /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Table.php(261): Doctrine_Table->initDefinition()
#1 /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Connection.php(1148): Doctrine_Table->__construct(NULL, Object(Doctrine_Connection_Mysql), true)
#2 /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Collection.php(182): Doctrine_Connection->getTable(NULL)
#3 [internal function]: Doctrine_Collection->unserialize('a:6:{s:4:"data"...')
#4 /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Record.php(869): unserialize('a:15:{s:3:"_id"...')
#5 [internal function]: Doctrine_Record->unserialize('a:15:{s:3:"_id"...')
#6 /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Collection.php(176): unserialize('a:6:{s:4:"data"...')
#7 [internal function]: Doctrine_Collection->unserialize('a:6:{s:4:"data"...')
#8 /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Query/Abstract.php(1235): unserialize('a:3:{i:0;C:31:"...')
#9 /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Query/Abstract.php(1085): Doctrine_Query_Abstract->_constructQueryFromCache('a:3:{i:0;C:31:"...')
#10 /workdir/lib/task/testTask.class.php(45): Doctrine_Query_Abstract->execute()
#11 /workdir/vendor/lexpress/symfony1/lib/task/sfBaseTask.class.php(70): testTask->execute(Array, Array)
#12 /workdir/vendor/lexpress/symfony1/lib/task/sfTask.class.php(98): sfBaseTask->doRun(Object(sfCommandManager), NULL)
#13 /workdir/vendor/lexpress/symfony1/lib/command/sfSymfonyCommandApplication.class.php(76): sfTask->runFromCLI(Object(sfCommandManager), NULL)
#14 /workdir/symfony(19): sfSymfonyCommandApplication->run()
#15 {main}

                        
  Couldn't find class   
                        


Fatal error: Call to a member function evictAll() on null in /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Connection.php on line 1267

Call Stack:
    0.0005     241824   1. {main}() /workdir/symfony:0
    1.0430   42803488   2. sfDatabaseManager->shutdown() /workdir/vendor/lexpress/symfony1/lib/database/sfDatabaseManager.class.php:0
    1.0430   42803616   3. sfDoctrineDatabase->shutdown() /workdir/vendor/lexpress/symfony1/lib/database/sfDatabaseManager.class.php:137
    1.0430   42803792   4. Doctrine_Manager->closeConnection() /workdir/vendor/lexpress/symfony1/lib/plugins/sfDoctrinePlugin/lib/database/sfDoctrineDatabase.class.php:152
    1.0430   42803976   5. Doctrine_Connection->close() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Manager.php:583
    1.0430   42804560   6. Doctrine_Connection->clear() /workdir/vendor/lexpress/doctrine1/lib/Doctrine/Connection.php:1296

Doctrine_Adapter_Statement methods signature

We have to figure out why do not follow the methods signature of Doctrine_Adapter_Statement the methods signature of Doctrine_Connection_Statement and PDOStatement.

// Doctrine_Adapter_Statement
public function bindValue($no, $value);
public function fetch();
public function execute();
public function setFetchMode($mode);
// Doctrine_Adapter_Statement_Interface
    public function bindValue($param, $value, $type = null);
    public function execute($params = null);
    public function fetch(
        $fetchStyle = Doctrine_Core::FETCH_BOTH,
        $cursorOrientation = Doctrine_Core::FETCH_ORI_NEXT,
        $cursorOffset = null
    );
    public function setFetchMode($mode, $arg1 = null, $arg2 = null);
  • Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interface
  • There is no Doctrine_Adapter_Statement used anywhere
  • Doctrine_Adapter_Statement_Interface used by Doctrine_Adapter_Statement_Oracle, Doctrine_Adapter_Statement_Mock and Doctrine_Connection_Statement

getLimitSubquery fails if multiple tables are in FROM Clause

For example a query with self join syntax SELECT * FROM example a, example b defined in DQL $query = ExampleTable::createInstance()->createQuery('a')->addFrom('example b'); is ignored by getLimitSubquery from Doctrine_Query in Query.php:1495. Commas are missing between the tables because getLimitSubquery just concats all parts from the FROM clause with a space character. The generated Query fails: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax.

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.