[DC-1059] Generate Entity From Database Created: 27/Sep/12 Updated: 27/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Draeli | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Problem already report here : https://github.com/symfony/symfony/issues/5617#issuecomment-8934524 |
[DC-1058] Warning: Invalid argument supplied for foreach() in SqlWalker.php line 899 Created: 29/Jul/12 Updated: 29/Jul/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Alexander Cucer | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | paginator | ||
| Environment: |
Linux, Ubuntu 12, php 5.4 |
||
| Description |
|
Hallo, i get the error Here is the line Here are the relations and the query Here is the dump of $assoc before warning array(16) { ["orphanRemoval"]=> |
[DC-1057] Inserts instead of updates for related objects Created: 20/Jul/12 Updated: 20/Jul/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Relations |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Grzegorz Godlewski | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
linux, apache2, php 5.3 |
||
| Description |
|
Ok, so the object relations go like this:
The testing code looks like following: == CODE START == Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml $comp = new Application_Model_Comparison(); /* Filling $comp with data */ for ($i = 0; $i < 10; $i++) { $product = new Application_Model_Product(); // Options referenced in Rules $options = array(); for ($j = 0; $j < 10; $j++) { $param = new Application_Model_Parameter(); for ($k = 0; $k < 10; $k++) { $option = new Application_Model_Option(); $param->Options->add($option); // Register a single option for this parameter if (!isset($options[$j])) { $options[$j] = $option; } } $product->Parameters->add($param); } for ($j = 0; $j < 10; $j++) { $rule = new Application_Model_Rule(); $rule->Option = $options[$j]; $product->Rules->add($rule); } $comp->Products->add($product); } /** * The first save() goes nicely, all objects * are created (INSERTed) */ $comp->save(); // Remove every second product $pCount = $comp->Products->count(); for ($i = 0; $i < $pCount; $i += 2) { $comp->Products->remove($i); } /** * Fails while trying to save * * Comparison->Product->Parameter->Option * INSERT ... `parameter_id` cannot be NULL * * Comparison->Product->Rule * INSERT ... `product_id` cannot be NULL */ $comp->save(); == CODE END == The first save() cleans up the relation information in the graph. All child objects are INSERTED instead of UPDATE. |
[DC-1056] Doctrine is not compatible with PHP 5.4 due to change in serialize() behaviour. Created: 04/Jun/12 Updated: 28/Jan/13 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Record, Relations |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Marcin Gil | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
PHP 5.4+ |
||
| Attachments: |
|
| Description |
|
In PHP 5.4 there is a change in the way the object references are serialized: Quote: This minor change, breaks down serialization of collections when column of type "array" is present - double serialization occurs. |
| Comments |
| Comment by Colin Darie [ 15/Oct/12 ] |
|
I confirm for possible future readers: this patch works perfectly well. (cf github for several forks of doctrine with other bugfixes). |
| Comment by steven [ 27/Jan/13 ] |
|
Hi all, does somebody knows where can I get a copy of the Doctrine 1.2.4 version but running on php 5.4? Thanks |
| Comment by Marcin Gil [ 28/Jan/13 ] |
|
I sent you URL to our private svn repo. |
| Comment by steven [ 28/Jan/13 ] |
|
Thanks, you've saved mi life |
[DC-1055] Bug in select query when executed against postgreSQL Created: 25/May/12 Updated: 25/May/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Damian Bergantinnos | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
symfony-1.4.17 php 5.3.5 apache 2.2.17 WIndows xp/7 PostgreSQL 9.1.2 |
||
| Attachments: |
|
| Description |
|
In the attached Squema run this query against postgreSQL. $lang = 'en'; SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "en" |
[DC-1054] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'b.title' in 'field list' Created: 31/Mar/12 Updated: 31/Mar/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | suriyakala | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
window vista |
||
| Description |
|
this is the my table creation . CREATE TABLE billboard(id BIGINT AUTO_INCREMENT,title VARCHAR (255),country_id BIGINT,zone_id BIGINT,place VARCHAR(255),occassion VARCHAR(255),itinerary VARCHAR(255),created_at DATETIME NOT NULL,description TEXT NOT NULL,PRIMARY KEY(id)) ENGINE=INNODB; public static function getInstance() { return Doctrine_Core::getTable('Billboard'); }this is the my Doctrine Table // public function getBillboardsForAUser($userId, $limit, $offset=0) $query->orderBy('b.created_at DESC') } plz help me what is the problem. |
| Comments |
| Comment by Benjamin Eberlei [ 31/Mar/12 ] |
|
Doctrine 1, not 2 ticket. |
[DC-1053] Renaming a doctrine 'string' field may result in loss of data as the field's type changes. (MySQL) Created: 26/Mar/12 Updated: 26/Mar/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Migrations |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Ben Lancaster | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP 5.3.5-1ubuntu7.2ppa1~lucid with Suhosin-Patch (cli) (built: May 7 2011 03:12:27) |
||
| Description |
|
Consider the following schema: schema.yml MyTable:
columns:
some_text: string
Doctrine creates the table with: CREATE TABLE `my_table` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `some_text` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; Now, the following migration should rename the field from some_text to just_text: <?php class Version1 extends Doctrine_Migration_Base { public function up() { $this->renameColumn('my_table', 'some_text', 'just_text'); } public function down() { $this->renameColumn('my_table', 'just_text', 'some_text'); } } ...however the field gets renamed and the type becomes VARCHAR(255), as the resulting SHOW CREATE TABLE my_table shows: CREATE TABLE `my_table` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `a_varchar` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; Causes data in the column greater than 255 bytes to get truncated |
[DC-1052] limit() get lost on multiple joins Created: 20/Mar/12 Updated: 20/Mar/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Michael Kempf | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
$strSql = UserFeedTable::getInstance() string(1075) "SELECT u.id AS u_id, u.name AS uname, u.image AS uimage, u.lead AS ulead, u.headline AS uheadline, u.sort AS usort, u.is_active AS uis_active, u.is_favorite AS uis_favorite, u.feed_id AS ufeed_id, u.profile_id AS uprofile_id, u.category_id AS ucategory_id, u.created_at AS ucreated_at, u.updated_at AS uupdated_at, f.id AS fid, f.url AS furl, f.name AS fname, f.created_at AS fcreated_at, f.updated_at AS fupdated_at, f2.id AS f2id, f2.lead AS f2lead, f2.description AS f2description, f2.image AS f2image, f2.pub_date AS f2pub_date, f2.link AS f2link, f2.feed_id AS f2feed_id, f2.created_at AS f2created_at, f2.updated_at AS f2updated_at, f3.id AS f3id, f3.profile_id AS f3profile_id, f3.feed_item_id AS f3feed_item_id, f3.created_at AS f3created_at, f3.updated_at AS f3_updated_at FROM user_feed u LEFT JOIN feed f ON u.feed_id = f.id LEFT JOIN feed_item f2 ON f.id = f2.feed_id LEFT JOIN favorite f3 ON f2.id = f3.feed_item_id WHERE u.id IN ('7', '8', '9', '10', '11') AND (u.profile_id = ? AND u.is_active = ?)" As you can see, the limit is missing. |
[DC-1051] Timestampable listener does not set timestamp fields on a copy of a Doctrine_Record Created: 14/Mar/12 Updated: 06/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Timestampable |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Jeremy Johnson | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
The Timestampable Listener only sets the timestamp if the timestamp field has not been modified: if ( ! isset($modified[$createdName])) { $event->getInvoker()->$createdName = $this->getTimestamp('created', $event->getInvoker()->getTable()->getConnection()); } When saving a copy of a Doctrine_Record that doesn't already have the timestamp fields set fails to be updated, leading to integrity constraint violation ("created_at cannot be NULL"). The reason is that all unset fields in the copy are set to an instance of Doctrine_Null, which is considered to be modifed according to the condition tested for above. To fix the issue, I modified the code above to read: if ( ! isset($modified[$createdName]) || $modified[$createdName] instanceof Doctrine_Null) { $event->getInvoker()->$createdName = $this->getTimestamp('created', $event->getInvoker()->getTable()->getConnection()); } |
| Comments |
| Comment by blopblop [ 06/Sep/12 ] |
|
Your fix works great, I have also added the fix for the preupdate function and in one more place in the preinsert function. [code]
if ( ! $this->_options['updated']['disabled'] && $this->_options['updated']['onInsert']) { } } /** * Set updated Timestampable column when a record is updated * * @param Doctrine_Event $evet * @return void */ public function preUpdate(Doctrine_Event $event) { if ( ! $this->_options['updated']['disabled']) { $updatedName = $event->getInvoker() //echo "updatedName: "; var_dump(updatedName); $modified = $event->getInvoker()->getModified(); if ( ! isset($modified[$updatedName]) || $modified[$updatedName] instanceof Doctrine_Null) { $event->getInvoker()->$updatedName = $this->getTimestamp('updated', $event->getInvoker()->getTable()->getConnection()); } } Also there is another problem too. If you dont disable the widgets of the fields updated_at and created_at, sometimes they are sending the date time information in the $form, and the function preUpdate doesnt update the update_at because the date time has been sent. The best option is to disable the widgets and form validation in global scope, here: /**
if (isset($this->validatorSchema['updated_at'])) { unset($this->validatorSchema['updated_at']); }} if (isset($this->widgetSchema)) if (isset($this->widgetSchema['updated_at'])) { unset($this->widgetSchema['updated_at']); } } |
| Comment by blopblop [ 06/Sep/12 ] |
|
fixed |
[DC-1050] Doctrine_Relation_ForeignKey ignores ATTR_COLL_KEY attribute Created: 06/Mar/12 Updated: 07/Mar/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Attributes, Relations |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | 1.2.4 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Uli Hecht | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows 7 64Bit |
||
| Attachments: |
|
| Description |
|
Doctrine_Relation_ForeignKey::fetchRelatedFor() executes the following code at line 70: $coll = $this->getTable() As you can see it accesses the first element by using index "0" in $coll and hence ignores a modified ATTR_COLL_KEY-setting, for instance: $this->setAttribute(Doctrine_Core::ATTR_COLL_KEY, 'id'); Fortunately I had two models (ForeignA and ForeignB) in my project which both have an one-to-one relation to a third model (Main). That helped me finding this bug which causes the following strange behavior: // program 1: $m = new Main(); // program 2: $m = Doctrine_Core::getTable('M1')->findOneBy('name', 'M1'); ------------------------- The big problem about this issue is that behavior is inconsistent. If you don't split the example above into two separate programs/processes you won't have problems, since Doctrine accesses the reference which was stored when calling save(). You will get into trouble using functional tests in Symfony. Since there is only a single process for all requests I wasn't able to reproduce a problem caused by this bug which appeared in the production environment. ------------------------- Edit: Doctrine_Connection::queryOne() is affected as well! A solution is to replace $coll = $this->getTable() by $related = $this->getTable() |
| Comments |
| Comment by Uli Hecht [ 07/Mar/12 ] |
|
Suggested patch |
[DC-1049] error with Timestamp data Validation Created: 26/Feb/12 Updated: 26/Feb/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Validators |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Coiby Xu | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux |
||
| Attachments: |
|
| Description |
|
The default value for timestamp is "0000-00-00 00:00:00", so public function validate($value) $e = explode('T', trim($value)); $dateValidator = Doctrine_Validator::getValidator('date'); if ( ! $dateValidator->validate($date)) { return false; }if ( ! $timeValidator->validate($time)) { return false; }
return true; |
[DC-1048] MSSQL Connection Created: 16/Jan/12 Updated: 16/Jan/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Connection |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | 1.2.4 |
| Type: | Improvement | Priority: | Major |
| Reporter: | Constantine Tkachenko | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Microsoft Windows Server 2008 R2; IIS 7; PHP 2.3.8; Doctrine 1.2.4; Symfony 1.4.16 |
||
| Description |
|
Function spliti(); is deprecated. $field_array = str_ireplace(' as ', ' as ', $field_array); thnx. |
[DC-1047] hardDelete not resetting flag if exception is thrown Created: 06/Jan/12 Updated: 06/Jan/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Behaviors |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Lone Wolf | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
To be honest I don't know wich version I have but I believe it to be 1.2.3 The problem is pretty simple, I was trying to do a hardDelete and if it fails I would do a softDelete. try { $record->hardDelete(); } catch (Exception $e) { if ($e instanceof Doctrine_Connection_Mysql_Exception && $e->getPortableCode() == Doctrine_Core::ERR_CONSTRAINT) { try { $record->delete(); } catch (Exception $e1) { throw $e1; } } else { throw $e; } } But when the first exception is thrown from hardDelete() in Doctrine_Template_SoftDelete(line 84) the listener flag for hardDelete is not set to false, so if I try to do the delete, it will still behave as if it was a hardDelete. The solution would be catch the exception, reset the flag and rethrow it. Hope this info is enough. |
[DC-1046] Connection MSSQL replaceBoundParamsWithInlineValuesInQuery Created: 15/Dec/11 Updated: 15/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.2.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Peter Eisenberg | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Revision: 104 |
||
| Attachments: |
|
| Description |
|
Hello, We found a bug in Doctrine1 MSSQL Connection. Please find the patch for it, I hope it helps to you as well. Kind regards |
| Comments |
| Comment by Peter Eisenberg [ 15/Dec/11 ] |
|
Small changes: please use the following instead of the original: another case you got the following error: Use of undefined constant xxx - assumed xxx. Kind regards, |
[DC-1045] data-load with invalid filename leads to purging of all the data in the database Created: 06/Dec/11 Updated: 06/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Import/Export |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Keszeg Alexandru | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
symfony 1.4 |
||
| Attachments: |
|
| Description |
|
Adding an invalid filename to the data-load task results in purging of all the data in the database. I am attaching a patch that checks the loaded data if there were any values actually loaded from the fixtures. |
[DC-1044] record Line 2430 Unlink method Warning: Illegal offset type in sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php on line 2459 Created: 05/Dec/11 Updated: 05/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Record |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Kyle Clarke | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
When you have a new unpersisted object and you call a method to a referenced object - when calling the unlink() method on referenced object the above error is called. Warning: Illegal offset type in sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php on line 2459 eg $foo = new foo(); $foo->getBar(); This call will bind a reference of Bar against the foo object. $foo->unlink('bar'); As no objects are yet persisted, the unlink method tries to match ids on the objects that do not exist. |
[DC-1043] Error:"When using..ATTR_AUTO_ACCESSOR_OVERRIDE you cannot.. name "data" ..." when running doctrine:build-schema ... except I'm NOT using that word Created: 30/Nov/11 Updated: 01/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Maurice Stephens | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Mac OSX 10.6.8 running MAMP Pro 2.0.5 with PHP 5.3.6 ... this is a local symfony install which is also using the apostrophe cms. |
||
| Description |
|
Was able to resolve this - see comment below - but still think it counts as a bug since the source of the error is so unclear Hello, Which would be clear enough except I'm NOT using "data" as a field name in my schema file: here's what I'm using: sfTravelLodgingLocationsType: lodging_code: { type: string(255) }sfTravelLodgingLocations: name: { type: string(255), notnull: true }address: { type: string(255), notnull: true }city: { type: string(255), notnull: true }distance: { type: integer, notnull: true }phone: { type: string(255), notnull: true }known_2b_sold_out: { type: boolean, notnull: true, default: 0 } relations: I'm assuming this is a misnamed error call ... I have found a few references to that same error in other threads but none that resolve it |
| Comments |
| Comment by Maurice Stephens [ 01/Dec/11 ] |
|
I was able to find a way to override the ATTR_AUTO_ACCESSOR_OVERRIDE with a method in the appConfiguration.class.php file based on this thread ... http://stackoverflow.com/questions/7266293/attr-auto-accessor-override But it is still a difficult error to troubleshoot ... not clear on what the reserved keyword "data" had to do with it ... considering I wasn't even using it in the schema Would be interested in finding some resources that go into detail on the implications of the command line context that symfony relies on |
[DC-1042] submitted form accidentally - PLEASE DELETE Created: 30/Nov/11 Updated: 30/Nov/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Trivial |
| Reporter: | Maurice Stephens | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This was accidentally submitted before being complete ... This one can be deleted ... sorry |
| Comments |
| Comment by Maurice Stephens [ 30/Nov/11 ] |
|
This was accidentally submitted before being complete ... This one can be deleted ... sorry |
[DC-1041] Using ->limit() in conjunction with many-to-many with mysql generates wrong SQL Created: 30/Nov/11 Updated: 30/Nov/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Evgeniy Afonichev | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
mysql |
||
| Description |
|
Using ->limit() in conjunction with many-to-many relationships with mysql leads to strange SQL generated. The condition id IS NULL is added in such case which is not correct at all. Here's example schema User:
columns:
username: { type: string(255) }
relations:
Operators:
foreignAlias: Users
class: Operator
refClass: OperatorUser
Operator:
columns:
username: { type: string(255) }
type: { type: integer }
OperatorUser:
columns:
user_id: { type: integer }
operator_id: { type: integer }
relations:
Operator:
foreignAlias: OperatorUser
User:
foreignAlias: OperatorUser
And here's query which generates wrong SQL Doctrine_Core::getTable('User')
->createQuery('User')
->leftJoin('User.Operators Operator')
->addWhere('Operator.type = ?', 1)
->limit(10)
->offset(0)
->execute()
;
Expected SQL generated: SELECT u.id AS u__id, u.username AS u__username, o.id AS o__id, o.username AS o__username, o.type AS o__type FROM user u LEFT JOIN operator_user o2 ON (u.id = o2.user_id) LEFT JOIN operator o ON o.id = o2.operator_id WHERE (o.type = '1') LIMIT 10 Actual SQL generated: SELECT u.id AS u__id, u.username AS u__username, o.id AS o__id, o.username AS o__username, o.type AS o__type FROM user u LEFT JOIN operator_user o2 ON (u.id = o2.user_id) LEFT JOIN operator o ON o.id = o2.operator_id WHERE u.id IS NULL # is not expected AND (o.type = '1') # there's no LIMIT clause Seems like here's code which causes the bug https://github.com/doctrine/doctrine1/blob/master/lib/Doctrine/Query.php#L1307 |
[DC-1040] allow queries with table joins across different databases Created: 17/Nov/11 Updated: 17/Nov/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | 1.2.3 |
| Type: | Improvement | Priority: | Blocker |
| Reporter: | Fabrice Agnello | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows XP SP3, Apache 2, PHP 5.3, MySQL 5.1.36, Symfony 1.4.8, Doctrine 1.2.3 |
||
| Attachments: |
|
| Description |
|
I'm currently working on a project which relies upon several databases declared in databases.yml in symfony 1.4.8. I was facing an issue that has already been raised by other people, namely that you can't join tables which reference each other among different mysql databases. I've dug a bit in the Doctrine_Query class and came to a solution that is acceptable for us, and allows now to make joins accross databases. Description follows : first change is in the Doctrine_Core class, that gets stuffed with a new constant : this constant allows us to add a new attribute to the databases.yml file as in :
after that, a few changes have been done in the Doctrine_Query class which is attached to this issue for the sake of readability. This may not be optimal, and probably need some regression testing, but it is currently working fine on our test server. after this is done, I was able to issue queries like the following : where the referenced tables are in different databases. The necessary object binding has been done in every model class following the paradigm : Doctrine_Manager::getInstance()->bindComponent('CdcIndInt ', 'gescdc'); I don't know if this description is clear enough, so let me know if something is missing/wrong. |
[DC-1039] Return value of function Doctrine_Tree_NestedSet::fetchRoot($id) Created: 31/Oct/11 Updated: 31/Oct/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Trivial |
| Reporter: | Dmitry Artanov | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
In api documentation about Doctrine_Tree_NestedSet::fetchRoot($id) said - it return void. But this is not true. This function return mixed - bool or model data. |
[DC-1038] Missing Foreign Key Constraint in SQL Created: 24/Sep/11 Updated: 24/Sep/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Stephan | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Hi, I have the problem, that a foreign key constraint is not created in the SQL schema. This occurs, when the primary key is not the column 'id'. Here is an example: User: Address: The foreign key from contacts to users is not created in der SQL schema. But if I delete the attribute 'primary' at the column 'user_id' (and a primary key 'id' will generated), everything is okay. Can you help me please? With kind regards |
[DC-1037] Migration does not quote identifiers when checking migration version Created: 07/Sep/11 Updated: 07/Sep/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Migrations |
| Affects Version/s: | 1.2.3, 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | John Kary | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux version 2.4.21-63.ELsmp (mockbuild@x86-005.build.bos.redhat.com) (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-59)) #1 SMP Wed Oct 28 23:15:46 EDT 2009, Symfony 1.4.14-DEV, Oracle 11g |
||
| Description |
|
I happen to be using Symfony 1.4.14-DEV (r33007) and am trying to setup migrations with Oracle, which is using Doctrine_Core::ATTR_QUOTE_IDENTIFIER. This issue is in core Doctrine. To reproduce: 1. Make a change to your schema.yml ORA-00942: table or view does not exist : SELECT version FROM migration_version. Failing Query: "SELECT version FROM migration_version"
Cause: The current connection is using quoted identifiers, so the query used to create the migration_version table when migrations are first instantiated was properly created as "migration_version" (notice quotes). But the raw SQL query used in Doctrine_Migration::getCurrentVersion() is not quoting the table or column identifiers, so Oracle can't find the table. There are several places in Doctrine_Migration where the table and column identifiers are not quoted, thus breaking migrations when using a database with strict rules on the case of identifiers. Even though I'm developing against Oracle, this also likely affects other drivers. |
| Comments |
| Comment by John Kary [ 07/Sep/11 ] |
|
Pull request open which quotes all identifiers in Doctrine_Migration and fixes this issue: |
[DC-1036] Doctrine_Export_Oracle::alterTable() not properly quoting column identifier for change Created: 07/Sep/11 Updated: 07/Sep/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Import/Export |
| Affects Version/s: | 1.2.2, 1.2.3, 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | John Kary | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This bug was introduced by the person reporting the bug # When trying to generate an ALTER TABLE statement with Doctrine_Core::ATTR_QUOTE_IDENTIFIER enabled, the column identifier is not quoted, and a blank identifier is instead quoted, generating the following SQL: ALTER TABLE "mytable" MODIFY (username "" VARCHAR2(200))
The proper SQL to be generated should be: ALTER TABLE "mytable" MODIFY ("username" VARCHAR2(200)) |
| Comments |
| Comment by John Kary [ 07/Sep/11 ] |
|
Pull request opened with failing test case and bug fix: |
[DC-1035] ORA-01791 due to bad driver name in Doctrine_Adapter_Oracle Created: 01/Sep/11 Updated: 01/Sep/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Connection |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | 1.2.4 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Jayson LE PAPE | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows 7 64 bits, PHP 5.2.11, Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi, Symfony 1.4.13 |
||
| Description |
|
When i execute this code:
$q = Doctrine_Query::create()
->from('AGENT ag')
->leftJoin('ag.CHANTIER_AGENT cag)
->orderBy('ag.nom')
->limit(10)
->execute();
$q2 = Doctrine_Query::create()
->from('AGENT ag')
->leftJoin('ag.CHANTIER_AGENT cag)
->orderBy('ag.nom')
->limit(10)
->execute();
Doctrine executes : SELECT a.pk AS a__pk, a.ts AS a__ts, a.ck_agent AS a__ck_agent, a.matricule AS a__matricule, a.nom AS a__nom, a.prenom AS a__prenom, a.agent_maitrise AS a__agent_maitrise, c.pk AS c__pk, c.ts AS c__ts, c.ck_chantier_agent AS c__ck_chantier_agent, c.ek_chantier AS c__ek_chantier, c.fk_chantier AS c__fk_chantier, c.ek_agent AS c__ek_agent, c.fk_agent AS c__fk_agent FROM AGENT a LEFT JOIN CHANTIER_AGENT c ON a.ck_agent = c.ek_agent WHERE a.ck_agent IN ( SELECT a2.ck_agent FROM ( SELECT DISTINCT a2.ck_agent, a2.nom FROM AGENT a2 LEFT JOIN CHANTIER_AGENT c2 ON a2.ck_agent = c2.ek_agent ORDER BY a2.nom ) a2 WHERE ROWNUM <= 10) ORDER BY a.nom SELECT a.pk AS a__pk, a.ts AS a__ts, a.ck_agent AS a__ck_agent, a.matricule AS a__matricule, a.nom AS a__nom, a.prenom AS a__prenom, a.agent_maitrise AS a__agent_maitrise, c.pk AS c__pk, c.ts AS c__ts, c.ck_chantier_agent AS c__ck_chantier_agent, c.ek_chantier AS c__ek_chantier, c.fk_chantier AS c__fk_chantier, c.ek_agent AS c__ek_agent, c.fk_agent AS c__fk_agent FROM AGENT a LEFT JOIN CHANTIER_AGENT c ON a.ck_agent = c.ek_agent WHERE a.ck_agent IN ( SELECT a2.ck_agent FROM ( SELECT DISTINCT a2.ck_agent FROM AGENT a2 LEFT JOIN CHANTIER_AGENT c2 ON a2.ck_agent = c2.ek_agent ORDER BY a2.nom ) a2 WHERE ROWNUM <= 10) ORDER BY a.nom This causes "Oracle DB Error ORA-01791 not a SELECTed expression" because the sql query don't have a2.nom in SELECT DISTINCT and it's indispensable for ORDER BY a2.nom protected $attributes = array(Doctrine_Core::ATTR_DRIVER_NAME => "oci8", Doctrine_Core::ATTR_ERRMODE => Doctrine_Core::ERRMODE_SILENT); The problem is in Query.php line 1417 : if ($driverName == 'pgsql' || $driverName == 'oracle' || $driverName == 'oci' || $driverName == 'mssql' || $driverName == 'odbc') {
The driver name declared in Doctrine_Adapter_Oracle not in this conditional. protected $attributes = array(Doctrine_Core::ATTR_DRIVER_NAME => "oracle", Doctrine_Core::ATTR_ERRMODE => Doctrine_Core::ERRMODE_SILENT); An other problem is probably located at line 1409 if (($driverName == 'oracle' || $driverName == 'oci') && $this->_isOrderedByJoinedColumn()) { and 1497 if (($driverName == 'oracle' || $driverName == 'oci') && $this->_isOrderedByJoinedColumn()) { if don't correct the declaration of $attributes in Doctrine_Adapter_Oracle. |
[DC-1034] ORA-00904 in Doctrine_Connection_Oracle Created: 01/Sep/11 Updated: 01/Sep/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Connection |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | 1.2.4 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Jayson LE PAPE | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows 7 64 bits, PHP 5.2.11, Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi, Symfony 1.4.13 |
||
| Description |
|
When i execute this code:
$q = Doctrine_Query::create()
->from('AGENT ag')
->leftJoin('ag.CHANTIER_AGENT cag)
->orderBy('ag.nom')
->limit(10)
->offset(10)
->execute();
Doctrine executes : SELECT a.pk AS a__pk, a.ts AS a__ts, a.ck_agent AS a__ck_agent, a.matricule AS a__matricule, a.nom AS a__nom, a.prenom AS a__prenom, a.agent_maitrise AS a__agent_maitrise, c.pk AS c__pk, c.ts AS c__ts, c.ck_chantier_agent AS c__ck_chantier_agent, c.ek_chantier AS c__ek_chantier, c.fk_chantier AS c__fk_chantier, c.ek_agent AS c__ek_agent, c.fk_agent AS c__fk_agent FROM AGENT a LEFT JOIN CHANTIER_AGENT c ON a.ck_agent = c.ek_agent WHERE a.ck_agent IN (SELECT b.ck_agent FROM ( SELECT a.*, ROWNUM AS doctrine_rownum FROM ( SELECT DISTINCT a2.ck_agent, a2.nom FROM AGENT a2 LEFT JOIN CHANTIER_AGENT c2 ON a2.ck_agent = c2.ek_agent ORDER BY a2.nom ) a2 ) b WHERE doctrine_rownum BETWEEN 11 AND 20) ORDER BY a.nom The problem is in function _createLimitSubquery in Doctrine_Connection_Oracle :
$query= 'SELECT '.$this->quoteIdentifier('b').'.'.$column.' FROM ( '.
'SELECT '.$this->quoteIdentifier('a').'.*, ROWNUM AS doctrine_rownum FROM ( '
. $query . ' ) ' . $this->quoteIdentifier('a') . ' '.
' ) ' . $this->quoteIdentifier('b') . ' '.
'WHERE doctrine_rownum BETWEEN ' . $min . ' AND ' . $max;
Error occures, because table name is AGENT and Doctrine give the first letter of the table name for identifier.
$query = 'SELECT '.$this->quoteIdentifier('limb').'.'.$column.' FROM ( '.
'SELECT '.$this->quoteIdentifier('lima').'.*, ROWNUM AS doctrine_rownum FROM ( '
. $query . ' ) ' . $this->quoteIdentifier('lima') . ' '.
' ) ' . $this->quoteIdentifier('limb') . ' '.
'WHERE doctrine_rownum BETWEEN ' . $min . ' AND ' . $max;
|
[DC-1033] [PATCH] Use multibyte version of strtolower Created: 28/Aug/11 Updated: 28/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | Jonas Flodén | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP 5.3.7, Symfony 1.4.13 |
||
| Attachments: |
|
| Description |
|
While trying to develop a new Symfony frontend to an existing database - whcih unfortunately contains non-ascii character names - I ran into a lot of problems where non-ascii characters had been mangled. |
| Comments |
| Comment by Jonas Flodén [ 28/Aug/11 ] |
|
Here is a Git pull request with the same patch: |
[DC-1032] [PATCH] Doctrine_Collection::isModified() does not support deep like Doctrine_Record but probably should Created: 23/Aug/11 Updated: 23/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Relations |
| Affects Version/s: | 1.2.3, 1.2.4 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Trivial |
| Reporter: | Christian Roy | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
$record instanceof Doctrine_Record; Using the $record object I can find out if it has been modified : $record->isModified(). However, the $collection object only support the first level and not the relations of its member records, The improvement would be to allow this method to accept true, like it's $record counterpart, which would return true instead. See attached patch. |
[DC-1031] CLONE -Multiple connections and i18n (raised as unresolved - original ticket marked as resolved) Created: 23/Aug/11 Updated: 28/Mar/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Connection, I18n |
| Affects Version/s: | 1.2.2, 1.2.3 |
| Fix Version/s: | 1.2.3 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | James Bell | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MySQL 5.1.37 symfony 1.4.13 |
||
| Description |
|
I used to work with a single database named "doctrine". The query was working properly. I then decided to use 2 databases so I got my schema like this:
I did setup my connections in config/databases.yml this way:
build-model, build-forms, build-filters and cc got ran. But now, I got an exception saying the "Translation" relation doesn't exist. The Base Models include correctly the bindComponent line:
For now, I managed to kind of fixing it with simply swapping the databases order in my config/databases.yml and it's now working again perfectly. I forgot to mention that in the CategoryTable when i call $this->getConnection()->getName(), it outputs "second" |
| Comments |
| Comment by James Bell [ 23/Aug/11 ] |
|
Original issue: There are some additional comments in there that explain the issue as currently being seen in released versions of Doctrine 1.2. Can I help verify that this is the same ticket? What is needed to help with debug (in addition to the extra information already provided)? |
| Comment by Andy.L [ 28/Mar/12 ] |
|
meet the same issue and it really blocked my project, seems no one will maintain 1.x. I'm considering whether to replace symfony 1.4 with 2.0. |
[DC-1030] [PATCH] doctrine 1.2.4 ADD/DROP CONSTRAINT UNIQUE Created: 19/Aug/11 Updated: 19/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Migrations |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | MichalKJP | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
Hi, Adding/dropping UNIQUE CONSTRAINT doesn't work on PostgreSQL. I'm attaching patch for this problem. Best regards, |
[DC-1029] Extensions of Doctrine_Template_I18n incompatible with Doctrine_Import Created: 18/Aug/11 Updated: 18/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Data Fixtures, I18n, Import/Export |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Trivial |
| Reporter: | Pierrot Evrard | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows 7, XAMPP 1.7.4 with APC and Curl, symfony 1.4.8 |
||
| Attachments: |
|
| Description |
|
Extending Doctrine_Template_I18n class make Doctrine_Import on YAML data with translation fails... Why ? Just because of this line : Doctrine_Import.php, line 135 : In fact, having a template named "Doctrine_Template_I18n" is not strong enough to be sure that the current object has an I18n behavior. The bug is very simple to reproduce : 1. Get a classic I18n fixtures like : Article: 2. Then make a simple extension of the I18n template (do not do anything else but extends the Doctrine_Template_I18n class) : class My_Doctrine_Template_I18n extends Doctrine_Template_I18n {} 3. Load the extension, assign it to your model and try to import your fixtures again. It will not work anymore. Thanks |
| Comments |
| Comment by Pierrot Evrard [ 18/Aug/11 ] |
|
See this patch where to check if the table has the I18n plugin, I check if one of the templates has a getI18n() method. This is probably not strong enough but it can do the job until you find a better solution. Thanks |
| Comment by Pierrot Evrard [ 18/Aug/11 ] |
|
Another possibility to check that templates are I18n template, will be to create an Doctrine_I18n_Interface. Also, every template that include this interface can be considered as I18n templates. What do you think about that ? NB: May the interface can define the method getI18n() to be declared... |
[DC-1028] Doctrine Migrate functions for current version and for creating the migrations table Created: 16/Aug/11 Updated: 16/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Migrations |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Stephen Ostrow | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I always tend to find myself needing to implement migrations after the fact. It would be really nice to have a method of having doctrine creating the migration_version table as well as a method of setting that value and getting that value. This would in-turn allow the implementation in a framework such as symfony to allow you insert the table after the fact, allow you to update the migration version without running the migration and to let you know what version you're currently on. |
[DC-1027] CLONE -Foreign key creation fails with MySQL 5.1.54 Created: 16/Aug/11 Updated: 16/Aug/11 Resolved: 16/Aug/11 |
|
| Status: | Resolved |
| Project: | Doctrine 1 |
| Component/s: | Import/Export |
| Affects Version/s: | 1.2.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Frej Connolly | Assignee: | Jonathan H. Wage |
| Resolution: | Invalid | Votes: | 0 |
| Labels: | None | ||
| Environment: |
gentoo, MySQL 5.0.44-log, Doctrine 1.2, symfony 1.4.4 |
||
| Description |
|
Hi there, When executing symfony doctrine:build --all --and-load on a machine using Mysql 5.0.44 I get the following error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dimension(id)' at line 1. Failing Query: "ALTER TABLE kpi_dimension ADD CONSTRAINT kpi_dimension_dimension_id_dimension_id FOREIGN KEY (dimension_id) REFERENCES dimension(id)". The problem can be fixed by adding a space between the table name and the column name that is referenced. So instead of Since it works fine on MySQL 5.1.37, I normally would file this under Mysql bug. But as the syntax for a foreign key constraint in MySQL mentions this space it should be ok to simply add the space to the script creating the sql for the foreign key. I have not tried any other DBMS though. The patch for the file Export.php is attached. Best regards Claudia |
[DC-1026] PgSQL driver does not create indexes on foreign key columns Created: 08/Aug/11 Updated: 08/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Import/Export |
| Affects Version/s: | 1.2.3, 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Szurovecz János | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Just like in Doctrine 2 (http://www.doctrine-project.org/jira/browse/DBAL-50):
|
[DC-1025] Doctrine is unable to handle table names with spaces Created: 02/Aug/11 Updated: 02/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.1, 1.2.2, 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Daniel Borg | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP Version 5.2.14 |
||
| Attachments: |
|
| Description |
|
When trying to query a table which contains spaces I get the following exception I have attached an simple example to reproduce C:\Documents and Settings\daniel\Dokumenter\NetBeansProjects\test>php doctrineTest.php Fatal error: Uncaught exception 'Doctrine_Query_Exception' with message 'Unknown table alias with' in C:\Doctrine-1.2.3\Doctrine\Query\Abstract.php:856 thrown in C:\Doctrine-1.2.3\Doctrine\Query\Abstract.php on line 856 |
[DC-1024] i am executing Created: 22/Jul/11 Updated: 26/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | cherukuri | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
$query = new Doctrine_Query(); $query->andWhere("s.company_id=".$parentId) |
[DC-1023] i am executing doctrine type query i am geting error please gave me reply my query i am typed in descrition field Created: 24/Jul/11 Updated: 26/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | cherukuri | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
$query = new Doctrine_Query(); |
[DC-1022] Doctrine migration does not set version when MySQL autocommit is false Created: 26/Jul/11 Updated: 26/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Migrations |
| Affects Version/s: | None |
| Fix Version/s: | 1.2.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Adam Fineman | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
RHEL 6.0, mysql 5.1.52 |
||
| Attachments: |
|
| Description |
|
With autocommit set to off in mysqld, Doctrine_Migration::setCurrentVersion() does not have any effect. This is because the method uses raw PDO calls, which are discarded without either autocommit or an explicit COMMIT;. We patched Doctrine as in the attachment. It works for us, but may not be the best general solution. The patch only fixes this one issue. There are likely many areas in Doctrine that rely upon autocommit behavior in MySQL. We will continue to look for them, and supply patches as we find them. However, as we are only concerned about MySQL, our solutions will probably not apply to other PDO drivers. |
[DC-1021] i am executing doctrine type query i am geting error please gave me reply Created: 24/Jul/11 Updated: 24/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | 1.2.4 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | cherukuri | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
windows ,wamp,php |
||
| Description |
|
$query = new Doctrine_Query(); |
[DC-1020] In the Timestampable Listener, the 'alias' behavior option is not used when determining the database fieldname Created: 19/Jul/11 Updated: 19/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Timestampable |
| Affects Version/s: | 1.2.2, 1.2.3, 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Will Mitchell | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP 5.3.5, MySQL 5.5.9; as well as PHP 5.3.6, MySQL 5.0.92 |
||
| Attachments: |
|
| Description |
|
I noticed this issue after setting up timestampable behavior on an aliased column in a legacy table: <?php abstract class Content_Article extends Doctrine_Record { public function setTableDefinition() { $this->setTableName('t_content'); $this->hasColumn('id', 'integer', 11, array('primary' => true, 'autoincrement' => true)); // ... $this->hasColumn('datePost as posted_at', 'timestamp'); $this->hasColumn('dateEdit as updated_at', 'timestamp'); // ... } public function setUp() { // .. $this->actAs('Timestampable', array('created' => array( 'name' => 'datePost', 'alias' => 'posted_at'), 'updated' => array( 'name' => 'dateEdit', 'alias' => 'updated_at'))); } } Before I added timestampable to this model, I was setting the timestamp fields manually, which worked fine. I had to look at the source to find the alias option in the timestampable behavior, since it does not appear to be in the 1.2 documentation. (If this issue is invalid because it's not an officially supported option, I apologize). After I added timestampable to the model, Doctrine began throwing an exception when I tried to save a new record:
It appears that the alias option is used when setting the table definition in the behavior template, but not used by the template's listener when creating, updating, etc. I'm attaching a zip with a copy of the changes I made to fix this in 1.2.4 and a git patch. |
[DC-1019] **REMOVED SPAM** Created: 14/Jul/11 Updated: 23/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Trivial |
| Reporter: | betty akamissnigger | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
*REMOVED SPAM* |
||
| Description |
|
*REMOVED SPAM* |
| Comments |
| Comment by Christian Roy [ 23/Aug/11 ] |
|
This issue was filled with spam text so I removed it. |
[DC-1018] Circular references to named entities break during data importing Created: 14/Jul/11 Updated: 14/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Record |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Mike Seth | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
If the schema specifies that records relate to each other in both directions: {{ Basket: Then a data dump for such a schema won't properly load one of the keys, e.g: {{ Basket: Will result in either fluffiest_kitten_id or basket_id being set to 0 See also ticket |
[DC-1017] Floats persisted in the database are retrieve as strings. Created: 12/Jul/11 Updated: 12/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Grégoire Paris | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 64 bits, php 5.3 |
||
| Description |
|
Someone complained about symfony padding 0's after floats http://stackoverflow.com/questions/6650786/remove-extra-decimal-place-in-float-datatype-on-symfony/6663829 , I think it's a doctrine problem, since the doctrine:dql task seems to have the same problem: >> doctrine executing dql query Here, pixel ratio is defined as a float in the schema.yml file |
[DC-1016] Set method in update query ignores 'false' if passed as boolean Created: 05/Jul/11 Updated: 05/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Paweł Barański | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Symfony 1.4.11 , Ubuntu 11, PHP 5.3 |
||
| Description |
|
I had to define this function: public function deactivate($segment_id) { $query = $this->createQuery() ->update('Segment s') ->set('s.is_active ', false) //not working // ->set('s.is_active ', (int)false) //works ok // ->set('s.is_active ', true) //works ok ->where('s.id = ?', $segment_id); // var_dump($query->getSqlQuery());die; return $query->execute(); }Problem is that when setting a column using boolean false you get invalid SQL query like this: Workaround is to do it like this: set('s.is_active ', (int)false) , but since setting the same column with boolean true works, false should work too. |
[DC-1015] bindComponent not called before inherited classes base definitions Created: 04/Jul/11 Updated: 04/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Inheritance, Schema Files |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Adrian Nowicki | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
symfony 1.4 |
||
| Description |
|
If I define a base model: Entity: and inherited model: Box: Then file with base definition of Box does not contain bindComponent sentence to bind Box model with connection specified for Entity model. |
[DC-1014] Geographical behaviour generates wrong INSERT statement in PostgreSQL if latitude/logitude not specified Created: 01/Jul/11 Updated: 01/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Geographical |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Lorenzo Nicora | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Symphony 1.4, PostgreSQL 8.4.8 |
||
| Description |
[DC-1013] [PATCH] Doctrine ignores unique option for integers (PostgreSQL) Created: 29/Jun/11 Updated: 18/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Import/Export |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Eugene Leonovich | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
This issue is exactly the same as |
| Comments |
| Comment by MichalKJP [ 18/Aug/11 ] |
|
Your patch fixed the problem for me. Thanks! |
[DC-1012] Doctrine_core specified twice in documentation Defining Models -> Join Table Associations Created: 28/Jun/11 Updated: 28/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Minor |
| Reporter: | Justinas | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
$manager->setAttribute(Doctrine_Core::Doctrine_Core::ATTR_QUOTE_IDENTIFIER, true); should be: $manager->setAttribute(Doctrine_Core::ATTR_QUOTE_IDENTIFIER, true); |
[DC-1011] wierd behaviour with setTableName - table name doesn't get set Created: 28/Jun/11 Updated: 28/Jun/11 |
|
| Status: | Reopened |
| Project: | Doctrine 1 |
| Component/s: | Record |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Justinas | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux 2.6.35-28-generic #50-Ubuntu SMP Fri Mar 18 19:00:26 UTC 2011 i686 GNU/Linux |
||
| Attachments: |
|
| Description |
|
if i create class called Attribute_set that extends Doctrine_Record and setTableName in setUpTableDefinintion like in documentation setting up models section, the table name appears not to be set any joins or relations fail. if i set it in the setUp function the setTableName appear working and returns "attribute_sets" table name. This only happens with this particular class, and relations have no effect. I attached class example i'm expiriencing problems with, that should help reproducte this issue |
| Comments |
| Comment by Justinas [ 28/Jun/11 ] |
|
fixed misstype and it appears that it was not the problem, i get the same: Base table or view not found: 1146 Table 'db.doctrine_record_abstract' doesn't exist maybe attribute_set is somekind reserved word in doctrine library ? |
| Comment by Justinas [ 28/Jun/11 ] |
|
the problem appears to come from Doctrine Formatter |
[DC-1010] When putting a subquery in the where clause which includes a join and a limit the limit subquery algorithm mistakenly modifies the subquery Created: 21/Jun/11 Updated: 21/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | will ferrer | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
XP Xamp |
||
| Description |
|
I have fixed this in my own version of doctrine but unfortunately I am to far diverged from the trunk to offer a patch. here is a test case: public function testSubqueryInWhereWithJoinAndLimit() { $q = new Doctrine_Query(); $q->select('u.id'); $q->from('User u'); $q->where('u.id NOT IN (SELECT a.id FROM User u2 LEFT JOIN u2.Album a LIMIT 1)'); $this->assertEqual($q->getSqlQuery(), 'SELECT e.id AS e__id FROM entity e WHERE (e.id NOT IN (SELECT a.id AS a__id FROM entity e2 LEFT JOIN album a ON e2.id = a.user_id WHERE (e2.type = 0) LIMIT 1) AND (e.type = 0))'); } To fix the issue I changed this line in Doctrine_Query as follows: if ( ( ! empty($this->_sqlParts['limit']) || ! empty($this->_sqlParts['offset'])) && $needsSubQuery && $limitSubquery) { = if ( ( ! empty($this->_sqlParts['limit']) || ! empty($this->_sqlParts['offset'])) && $needsSubQuery && $limitSubquery && !$this->isSubquery()) { Hope that helps. Sincerely Will Ferrer |
[DC-1009] save() also updates fields which should not be Created: 08/Jun/11 Updated: 08/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Yan Urquiza | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows server 2003 PHP 5.2.17 / XP PRO 32bits XAMPP PHP 5.3.5 |
||
| Attachments: |
|
| Description |
|
When I want to do a simple update like this : $batches = ExamResultsBatchTable::getInstance()->retrieveByExamBatchStatus(ExamResultsBatch::valid_status_code); If I run this: here is the simpliest case. The same problems are signaled on other tables in the database, but different tables can be impacted by one save() (the execute() query still works fine). Example : 2 foreign tables will be updated , even if the save() action should only concern the main table, and one field (which is not a foreign key). Because save() is used in a lot of different places in our app, I need to find a solution to fix save(), or if not possible to override it to run a execute()like query. Thanks for your help. Yan |
[DC-1008] missing oci_type in Doctrine_Adapter_Statement_Oracle->bindParam Created: 31/May/11 Updated: 31/May/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Tomasz Madeyski | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
in bindParam method there is: After adding SQLT_INT everything is ok |
[DC-1007] Cannot update a field to NULL with MSSQL connection Created: 25/May/11 Updated: 25/May/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Connection |
| Affects Version/s: | None |
| Fix Version/s: | 1.2.4 |
| Type: | Bug | Priority: | Critical |
| Reporter: | guitio2002 | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows 7 32 bits with Apache 2.2.x, PHP 5.2.17, Sql Server 2008, Symfony 1.4.11 and Doctrine 1.2.4 |
||
| Description |
|
When trying to update a field to NULL in a MSSQL database, Doctrine generates the following request: UPDATE table SET fieldThatMustBeNull = , anotherField = 'blabla'; therefore generating a syntax error. A fix would be to override the update method in the Doctrine_Connection_Mssql and add the following behavior: Doctrine_Connection_Mssql public function update(Doctrine_Table $table, array $fields, array $identifier) { if (empty($fields)) { return false; } $set = array(); foreach ($fields as $fieldName => $value) { if ($value instanceof Doctrine_Expression) { $set[] = $this->quoteIdentifier($table->getColumnName($fieldName)) . ' = ' . $value->getSql(); unset($fields[$fieldName]); } else if (is_null($value)) { $set[] = $this->quoteIdentifier($table->getColumnName($fieldName)) . ' = NULL'; unset($fields[$fieldName]); } else { $set[] = $this->quoteIdentifier($table->getColumnName($fieldName)) . ' = ?'; } } $params = array_merge(array_values($fields), array_values($identifier)); $sql = 'UPDATE ' . $this->quoteIdentifier($table->getTableName()) . ' SET ' . implode(', ', $set) . ' WHERE ' . implode(' = ? AND ', $this->quoteMultipleIdentifier($table->getIdentifierColumnNames())) . ' = ?'; return $this->exec($sql, $params); } |
[DC-1006] Custom geometric query error with orderBy Created: 22/May/11 Updated: 22/May/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Attributes |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | 1.2.2 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Leonardo Lazzaro | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Symfony 1.4.11 and Doctrine 1.2.4. Ubuntu 11.04 Apache2 with mod php5. php5 version PHP 5.3.5-1ubuntu7.2 with Suhosin-Patch |
||
| Description |
|
Mi Doctrine_Query with this Geometric Query fails with orderBy , but with where works. $distance = "glength(linestringfromwkb(linestring(GeomFromText('POINT( ".$object->getLatitude()." ".$object->getLongitude() .")'),l.point))) " This works: But this one fails at version 1.2.4, with older version was working. Well the problem is at line 74 of OrderBy.php : the rendered query in the distance has some ".", for example: then the after line 74 in OrderBy tries to search por '58' class. I manually added to DataDict in Mysql.php the POINT datatype (this fix solve me the problem in older versions of Doctrine). |
[DC-1005] Schema importer sometimes overwrites relations (instead of adding them) due to issue with bugfix DC-281 Created: 17/May/11 Updated: 17/May/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Import/Export |
| Affects Version/s: | 1.2.0, 1.2.1, 1.2.2, 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Pelle ten Cate | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The bugfix for When between two tables in a MySQL database there are two relations, one on both sides (i.e. both tables have a FK field to each other), one of the two is overwritten with the second by the schema importer. That is, at one class, there seems to be only one relation instead of both. The issue came in when the decision was made to store all class names in the definition array lower case, as one of the lookups in the array was not updated appropriately. See Doctrine/Import.php (1.2.4) line 416 - 435. In line 427, you can clearly see the change made in 6802 Old: Line 421 however should also have been updated: if (in_array($relation['class'], $relClasses) || isset($definitions[$relation['class']]['relations'][$className])) { This error results in relations that already exist sometimes being overwritten. |
[DC-1004] ATTR_TBLNAME_FORMAT not used when creating models from database Created: 08/May/11 Updated: 08/May/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Import/Export |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | 1.2.3, 1.2.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Robin Parker | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
if you set prefix to "xyz_%s" and have the model "BackgroundColor" it will become the table => "xyz_background_color" The fix (diff):
|
| Comments |
| Comment by Robin Parker [ 08/May/11 ] |
|
The diff output as .diff |
[DC-1003] _processWhereIn does not allow the use of named query parameters Created: 05/May/11 Updated: 06/May/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | None |
| Fix Version/s: | 1.2.4 |
| Type: | Improvement | Priority: | Minor |
| Reporter: | alex pilon | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
karmic, php 5.2.10, apache2 |
||
| Attachments: |
|
| Description |
|
When writing a query such as
you are unable to then
Doctrine complains that you may not mix positional and named query parameters. The attached patch fixes this by checking if the key of the passed in parameter is non numeric and if so setting the "value" of the parameter place holder to the value of the key. |
| Comments |
| Comment by alex pilon [ 05/May/11 ] |
|
I discovered an issue with the above patch. I am working on a better version. |
| Comment by alex pilon [ 06/May/11 ] |
|
Here is a second version.. it is a little bit sloppy. Is there a resource I can find on here that will help me to improve code quality/unit test this? |
[DC-1002] Typos in filename and php tags Created: 02/May/11 Updated: 02/May/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | nervo | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Two typos in Doctrine files prevents usage of symfony core_compile.yml system, or any similar compiler system :
|
[DC-1001] Doctrine Caching page does not mention the "prefix" option Created: 29/Apr/11 Updated: 27/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Caching, Documentation |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Minor |
| Reporter: | Arend van Waart | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
http://www.doctrine-project.org/documentation/manual/1_1/en/caching When not using a prefix with multiple / yet similay projects a mixup of query caching will occur (for example with sfDoctrineGuard queries). This is very easialy fixed with a prefix - but I only realized after two months - that this feature actually existed. There is no mention of this in the documention. A mention of the feature $q = Doctrine_Query::create() Would have helped me and I think it will also help others. |
| Comments |
| Comment by Pablo Grass [ 27/Jun/11 ] |
|
I concur with Arend - mentioning of 'prefix' in the documentation could make this valuable feature much less of a pain to find... |
[DC-1000] Wrong parsing on HAVING clause Created: 28/Apr/11 Updated: 28/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Pierrot Evrard | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
symfony 1.4.12-DEV / Windows XP / Apache 2.0 / MySQL 5.1.37 / PHP 5.3.0 |
||
| Attachments: |
|
| Description |
|
With Doctrine::ATTR_QUOTE_IDENTIFIER enabled, when you launch a query with a complex having clause, Doctrine_Query_Having class does not handle it correctly. By example, when you track the having clause interpretation: $query->addHaving( 'SUM( IF( s.id = ? , 1 , 0 ) ) = 0' , 7 ); At some point, Doctrine_Query_Having at line 70 return something like "`s10`.`id = ?`" instead of "`s10`.`id` = ?". I just fix it using: return $this->query->parseClause($func); instead of: return $this->_parseAliases($func); Now, the parseAliases function is not used anymore... See patch attached... Loops |
[DC-999] Query cache key can be incorrectly generated Created: 28/Apr/11 Updated: 27/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Caching, Query |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Jakub Zalas | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
1. We have two versions of the application on the same server. Situation often happens on shared development machine when one developer adds a field but others don't have in their models yet. It also happens on staging server if it's shared with production. I suspect it only affects queries without explicitly listed fields. To quickly fix the issue in my symfony project I extended Doctrine_Cache_Apc to implement namespaces (https://gist.github.com/944524). More appropriate place to fix it would be Doctrine_Query_Abstract::calculateQueryCacheHash(). |
| Comments |
| Comment by Pablo Grass [ 27/Jun/11 ] |
|
Could this be a duplicate of http://www.doctrine-project.org/jira/browse/DC-389 ? |
[DC-998] MySQL Driver possibly subject to sql injections with PDO::quote() Created: 19/Apr/11 Updated: 23/May/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Connection |
| Affects Version/s: | 1.2.0-ALPHA1, 1.2.0-ALPHA2, 1.2.0-ALPHA3, 1.2.0-BETA1, 1.2.0-BETA2, 1.2.0-BETA3, 1.2.0-RC1, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Anthony Ferrara | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
All |
||
| Description |
|
Prior to 5.3.6, the MySQL PDO driver ignored the character set parameter to options. Due to MySQL's C api (and MySQLND), this is required for the proper function of mysql_real_escape_string() (the C API call). Since PDO uses the mres() C call for PDO::quote(), this means that the quoted string does not take into account the connection character set. Starting with 5.3.6, that was fixed. So now if you pass the proper character set to PDO via driver options, sql injection is impossible while using the PDO::quote() api call. PDO proof of concept $dsn = 'mysql:dbname=INFORMATION_SCHEMA;host=127.0.0.1;charset=GBK;'; $pdo = new PDO($dsn, $user, $pass); $pdo->exec('SET NAMES GBK'); $string = chr(0xbf) . chr(0x27) . ' OR 1 = 1; /*'; $sql = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE ".$pdo->quote($string)." LIMIT 1;"; $stmt = $pdo->query($sql); var_dump($stmt->rowCount()); Expected Result: `int(0)`. There are 2 issues to fix. First, the documentation does not indicate that you can pass the `charset` option to the MySQL Driver. This should be fixed so that users are given the proper option to set character sets. Secondly, `Connection::setCharset()` should be modified for MySQL to throw an exception, since the character set is only safely setable using the DSN with PDO. This is a limitation of the driver and could be asked as a feature request for the PHP core. Either that, or a big warning should be put on the documentation of the API to indicate the unsafe character set change Note that this is the same issue reported for Doctrine2 with link: http://www.doctrine-project.org/jira/browse/DBAL-111 |
| Comments |
| Comment by Fabien Potencier [ 23/May/11 ] |
|
Any news on this one? It has been "fixed" in Doctrine2 and must be also fixed in Doctrine1. |
[DC-997] Doctrine collections are overwritten when created by inner join queries that agree on the WHERE Created: 13/Apr/11 Updated: 13/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Richard Forster | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
OS X 10.6.6 with PHP 5.3.3, Windows with PHP 5.3.1 |
||
| Attachments: |
|
| Description |
|
In brief: In detail: INSERT INTO `tblname` VALUES (1,1,'alpha'),(2,2,'beta'),(3,3,'gamma'),(4,4,'delta'),(5,5,'epsilon'),(6,1,'aleph'); Applying the query: $results1 = Doctrine_Query::create() and then producing output though print 'Results (1): '.count($results1)."\n"; produces the expected: Results (1): 1 Doing a similarly query to a new variable: $results2 = Doctrine_Query::create() and printing with print 'Results (2): '.count($results2)."\n"; produces the expected: Results (2): 1 but printing out the first result object again at this point gives: Results (1): 1 which is unexpected - "aleph" rather than "alpha". If, the second query was altered to ->where('ppa.id = ?', 2) then all three output results are as expected. test.zip contains corresponding test files. |
[DC-996] UPDATE query generate ambiguous statement Created: 13/Apr/11 Updated: 13/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | John | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | None | ||
| Environment: |
MAMP on MacBook Pro 10.6.7, with Symfony 1.4.9 |
||
| Description |
|
When creating an UPDATE query, the table names are not aliased like in a SELECT statement. This causes ambiguous column names when JOINING in an UPDATE. E.g. The generated SQL for this is : Clearly here "updated_at" and "id" are ambiguous columns. Why the tables are not automatically aliased with unique aliases like in a SELECT statement, and the aliases written before the column name ? Thanks. |
[DC-995] Doctrine deprecated in favor of Doctrine_Core - phpdoc Created: 06/Apr/11 Updated: 06/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Minor |
| Reporter: | Pablo Grass | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
all environments |
||
| Description |
|
http://www.doctrine-project.org/projects/orm/1.2/docs/whats-new/en clearly states that the Doctrine class is deprecated - e.g. in order to allow for proper autoloading. @deprecated In favor of Doctrine_Core - this class extends Doctrine_Core for BC |
[DC-994] Doctrine_Data_Import creates unnecessary transactions, big slowdown Created: 05/Apr/11 Updated: 05/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Import/Export |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | Krzysztof Bociurko / ChanibaL | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MySQL, symfony doctrine:load-data |
||
| Attachments: |
|
| Description |
|
While trying to load ~25M data fixtures (one big table with relations to 4 smaller ones, sfGuard included in that, row size around 500 bytes) in Symfony i ended up waiting around 80 minutes, while waiting i looked at what could have make it so dreadfully slow. Turns out, when Doctrine_Data_Load gets UnitOfWorks it executes save() on every new record. Save makes it's own transaction - not a problem if it's nested, but when this is the main transactions, 70000 of them make quite a difference. Remember - one of the main factors of DBMS speed is transactions/second. I patched Doctrine_Data_Import to wrap everything in one transaction, and the results were great - from 80 minutes i got down to around 10. Still, not as fast as it should be but now it's usable. The time difference is notable also in smaller dumps. Patch to speed up loading times included, would be great if you add it to trunk. Please note - i have not checked this patch with any other setup or DBMS, please do so. Also i have noticed something that might be a problem in much larger loads - if wrapping in a single transaction, my total memory usage went up for about 500M higher than in 70000 transactions. At some point, about 5 minutes in the process some kind of garbage collector fired and freed around 1 gig, so perhaps on larger dumps it might be a good idea to wrap the import not in one, but more transactions (like one transaction every 10000 operations). |
[DC-993] Many-to-many Relation defined one way Created: 05/Apr/11 Updated: 05/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Relations |
| Affects Version/s: | 1.2.2, 1.2.3, 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Klaas van der Weij | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MySQL database, Lenny |
||
| Description |
|
When a many-tomany relation has been defined on only one of the end of the relation, and ofcourse in the cross-refClass, things get weird. I'll use the user-groups relation (as found in the documentation) as example. If in the group model has not defined the hasMany, then a user can be instantiated and saved. When instantiated, the relation groups would return an empty array, groups can ben added like: $u = new User(); var_dump($u->groups); $u->groups[] = new Group(); var_dump($u->groups); This would output an empty array, and subsequently an array containing the new group. However, if a user would be retrieved from the database, and the relation groups would be called, then the following message will appear (which is not helpfull at alllll, I've spend hours figuring it out!): Uncaught exception 'Doctrine_Record_UnknownPropertyException' with message 'Unknown record property / related component "groups"' ..... I will never forget this, but it's not described in the documentation and the error is not helping either. So either one of these step hvae to be taken. Or even better, making it work without requiring the hasMany in group, to users. |
[DC-992] I18n - Translated fields are not deleted when record in master table is deleted Created: 03/Apr/11 Updated: 28/Oct/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Behaviors |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Thanasis Fotis | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows XP, xampp 1.7.3 (PHP 5.3.1) |
||
| Description |
|
I have used I18n behavior for my application using the following: public function setTableDefinition() { $this->setTableName('products'); $this->hasColumn('id', 'integer', 4, array('fixed' => true, 'primary' => true, 'autoincrement' => true)); $this->hasColumn('permalink', 'string', 255, array('notnull' => true)); $this->hasColumn('title', 'string', 255, array('notnull' => true)); $this->hasColumn('teaser', 'string', 255, array('notnull' => true)); $this->hasColumn('content', 'clob', 32767); } public function setUp() { $this->actAs('I18n', array( 'fields' => array('title', 'teaser', 'content') ) ); } Doctrine has created two tables db named products and products_translation. Insert and update of the record is working fine but when i perform a deletion of a record, the record is deleted from the products table but the translations stored in products translation table are not deleted. |
| Comments |
| Comment by Justinas [ 28/Oct/11 ] |
|
if you are not using transaction type tables like innoDB you need to set 'appLevelDelete' => TRUE option for I18n $this->actAs('I18n', array( |
[DC-991] Views abstraction model Created: 28/Mar/11 Updated: 28/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Schema Files |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Major |
| Reporter: | Jesus FarÃas Lacroix | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
all |
||
| Description |
|
View abstraction model Hi, i've been using doctrine from about six months, i'm not an expert but i know the basics and this has been enough for me and my web-app requirements. The problem begins cause i need a kind of "dynamic table model" in other words an specific one table's abstraction, i thought implement a view for this purpose, but i can't figure out how define the BaseModel for the view to use it like a table, thus allowing the use of methods like save(), find() and build (logicals) relationships with others entities. in few words: can i build a table model from a query/view?, it is possible? i read the posts from above but this issue still being not realy clear at all for me. me realy will apreciate any help, thanks in advance. Regards. |
[DC-990] Values not escaped Created: 26/Mar/11 Updated: 26/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Nick Bartlett | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
windows and linux OS, mysql database |
||
| Description |
|
When I save inputs from a form, special characters such as single quotes are inserted into the mysql database without being escaped. It's my understanding that doctrine uses PDO and PDO should handle this escaping automatically, but it is not. Is there a configuration setting that I can set with doctrine to enable this? Thanks |
[DC-989] Doctrine_Connection::execute() and Doctrine_Connection::exec() fail if Doctrine_Event::skipOperation() is triggered Created: 22/Mar/11 Updated: 22/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Connection |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | David Dixon | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
In order to generate SQL from migrations, an event listener was attached to the migration system to monitor for preQuery and preExec events. In an attempt to prevent the migration from additionally writing the query to the database, the skipOperation method was triggered, and supposedly allowed for n the execute() and exec() methods of Doctrine_Connection eg. Doctrine_Connection::execute()
$this->getAttribute(Doctrine_Core::ATTR_LISTENER)->preQuery($event);
if ( ! $event->skipOperation) {
$stmt = $this->dbh->query($query);
$this->_count++;
}
$this->getAttribute(Doctrine_Core::ATTR_LISTENER)->postQuery($event);
unfortunately setting this option in the event listener breaks execution of the migration system as the $count/$stmtn variables (used in the methods) are no longer defined, triggering E_NOTICE, and the fetch* methods (eg fetchColumn) also break as they are chaining methods without testing for the return. theerfore, even if the $stmnt variable was created as initially null, the system would still throw an E_FATAL as the NULL variable doest provide the ::fetchColumn() methods (etc). Quite a serious flaw as 2 areas of code do not provide a consistent approach to how to work with events. |
[DC-988] migrations should allow generation of SQL in place of DB manipulation Created: 21/Mar/11 Updated: 21/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Migrations |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | David Dixon | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
At present migrations only allow for direct manipulation of the underlying database. However, many enterprise release processes disallow automated manipulation of databases (especially Oracle) due to a number of reasons (eg placing different objects in different table spaces). Because of this, it is preferable for developers to auto generate SQL and then hand over the specialist DBAs who may then filter/alter as needed on a per-environment basis. this is currently very easy to achieve with initial database query generation, as outputting SQL is an option, but there is no such option for migration scripts. Therefore I would like to request this option to be added to the migration class. |
[DC-987] redundant sql statement in Doctrine_Export_Oracle::_makeAutoincrement() Created: 21/Mar/11 Updated: 21/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Import/Export |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | David Dixon | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
linux, oracle |
||
| Description |
|
line 121-128 of Doctrine_Export_Oracle appears to generate redundant code for creating a primary key constraint as primary keys (defined in schema.yml) are already generated during CREATE TABLE statements. |
[DC-986] createIndexSql and dropConstant do not correct set index name suffix Created: 21/Mar/11 Updated: 23/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Migrations |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | David Dixon | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
linux, oracle |
||
| Description |
|
Current export methods are inconsitent with index/constraint name suffix (defautl %_idx). Both createConstraintSql() and dropIndex() methods correctly set the suffix, but dropConstraint() and createIndexSql() do not. this causes associated down() methods to fail when reverting changes to indexes/constraints Erros occur in : Export.php - lines 137 and 473 |
[DC-985] doctrine migration does not use tblname_format Created: 21/Mar/11 Updated: 21/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Migrations |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | David Dixon | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
linux, oracle |
||
| Description |
|
Migration commands update the database without correcting the default tablename using pre-set tblename_format parameters in databases.yml. There is a method for updating the tablename, but this appears to not be used by any script. |
[DC-984] Pessimistic locking locks entire table rather than record Created: 16/Mar/11 Updated: 13/Dec/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Transactions |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Barry O'Donovan | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Standard LAMP stack using current SVN from http://svn.doctrine-project.org/branches/1.2/lib/Doctrine/Locking/Manager |
||
| Attachments: |
|
| Description |
|
When using pessimistic locking as described in: the locking manager locks the entire table rather than the specific object. This should be clear from the attached patch which corrects the issue (assuming I have correctly interpreted the intention of pessimistic locking!). The current behavior will have worked as expected for users but it will have locked far more than was intended and may thus have affected performance. NB: I can confirm this works for non-composite keys but please review and test for composite keys as I have no such tables to hand. |
| Comments |
| Comment by Barry O'Donovan [ 18/Oct/11 ] |
|
Folks - just wondering if anyone had a chance to look at this as, while not critical, it does appear to be a genuinely major performance issue. |
| Comment by Grégoire Paris [ 13/Dec/12 ] |
|
Duplicate with more information : http://www.doctrine-project.org/jira/browse/DC-185 |
[DC-983] Fixtures loading is repeated for each database connections Created: 08/Mar/11 Updated: 08/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Data Fixtures |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Ludovic Vigouroux | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Bug found when working on project ma-residence.fr. Data loading was repeated twice, and in the second run, empty rows were inserted in database, resulting in major headache in development team. A same flush tree is built for each connections. It results in multiple loops of data load when there is more than one connection. |
| Comments |
| Comment by Ludovic Vigouroux [ 08/Mar/11 ] |
|
A proposition to fix it is on github https://github.com/ludovig/doctrine1 |
[DC-982] Options for building models aren't forwarded from CLI to Manager instance Created: 04/Mar/11 Updated: 04/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Maciej Strzelecki | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I.e.: generate_models_options and classPrefix option isn't forwared from CLI configuration to create table task (which uses the Manager's options). |
[DC-981] Class prefix isn't being appended when importing data Created: 04/Mar/11 Updated: 04/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Cli |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Maciej Strzelecki | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Configuration: Doctrine_Manager::getInstance()->setAttribute(Doctrine_Core::ATTR_MODEL_CLASS_PREFIX, 'Foo_'); Schema: Bar: Fixtures: Bar: Error on importing data: "Couldn't find class Bar." Doctrine should use Foo_Bar class for Bar model instead Bar class. |
[DC-980] Moving all ALTERS queries to the end of generated sql file (task build-sql) Created: 04/Mar/11 Updated: 04/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Cli, Schema Files |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Critical |
| Reporter: | Sergey Eremenko | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
Actual in case of using multi database configuration and foreign keys between them. Now build-sql task generates SQL query for database by database in alphabetical order. It's ugly when we have multidatabase configuration and foreign keys between their tables. It's impossible to do 'import-sql' without errors beucase foreign keys constrains to nonexisting tables are in next database in order. I have added some code to strings 1176-... |
[DC-979] Doctrine save() only checks one level deep on one-to-one relations. Created: 27/Feb/11 Updated: 27/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Record |
| Affects Version/s: | 1.2.1, 1.2.2, 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Robert Cesaric | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MySQL 5.1.38, PHP 5.3.3 |
||
| Description |
|
Updating/saving an object fails when trying to update the nth-level of an existing object/relation where n is more than one level away from the root node of one-to-one relation chain. For example, with the yaml model below the following does not update the name of the Company object: Image->Product->Category->Company->name = "Acme". If "Product" has no changes it appears to stop checking for changes there. If we do a save on a one-to-many relation chain such as the following, it works fine: Company->Category->Product->Image->name = "image1.jpg" I was able to fix this issue by modifying the saveRelatedLocalKeys() function in UnitOfWork.php to use isModified() with deep=true: if ($obj instanceof Doctrine_Record && $obj->isModified(true)) { This works but I'm not sure if changing this has any repercussions on more complex queries. — Company: Category: Product: Image: |
[DC-978] Doctrine_Connection_Mssql dies on modifyLimitSubquery every time Created: 27/Feb/11 Updated: 27/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Connection |
| Affects Version/s: | 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Andrej Pavlovic | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
windows |
||
| Description |
|
Looking at the latest version of Doctrine_Connection_Mssql in git repo: In Doctrine_Query:getLimitSubquery() there is a call to Doctrine_Connection_Mssql::modifyLimitSubquery(). public function modifyLimitSubquery(Doctrine_Table $rootTable, $query, $limit = false, $offset = false, $isManip = false) { return $this->modifyLimitQuery($query, $limit, $offset, $isManip, true); } This in turn calls Doctrine_Connection_Mssql::modifyLimitQuery() wihtout passing the $queryOrigin parameter: public function modifyLimitQuery($query, $limit = false, $offset = false, $isManip = false, $isSubQuery = false, Doctrine_Query $queryOrigin = null) { if ($limit === false || !($limit > 0)) { return $query; } $orderby = stristr($query, 'ORDER BY'); if ($offset !== false && $orderby === false) { throw new Doctrine_Connection_Exception("OFFSET cannot be used in MSSQL without ORDER BY due to emulation reasons."); } $count = intval($limit); $offset = intval($offset); if ($offset < 0) { throw new Doctrine_Connection_Exception("LIMIT argument offset=$offset is not valid"); } $orderbySql = $queryOrigin->getSqlQueryPart('orderby'); $orderbyDql = $queryOrigin->getDqlPart('orderby'); if ($orderby !== false) { $orders = $this->parseOrderBy(implode(', ', $queryOrigin->getDqlPart('orderby'))); for ($i = 0; $i < count($orders); $i++) { ... From just looking at the above code, the query chokes on the first call to a $queryOrigin method. It seems like there is a lot of missing code here which should work with the $query directly when $queryOrigin is not available... What is the point of $orderbySql and $orderbyDql variables when they are not used anywhere? This code looks like it's half way done and untested. |
[DC-977] wrong offset in sfDoctrinePager Created: 21/Feb/11 Updated: 22/Feb/11 Resolved: 22/Feb/11 |
|
| Status: | Resolved |
| Project: | Doctrine 1 |
| Component/s: | Pager |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Pavel Campr | Assignee: | Guilherme Blanco |
| Resolution: | Invalid | Votes: | 0 |
| Labels: | None | ||
| Description |
|
as reported in symfony http://trac.symfony-project.org/ticket/8979 In sfDoctrinePager::init() the offset for the query is determined by the statement: $offset = ($this->getPage() - 1) * $this->getMaxPerPage() Immediately after that, the $this->lastPage value is set: $this->setLastPage(ceil($this->getNbResults() / $this->getMaxPerPage())); However, sfPager::setLastPage() corrects the page number ($this->page) in case $this->getPage() > $this->lastPage. Thus, the calculation of the offset should happen after the $this->setLastPage(...) statement, because $this->getPage() is used. The attached patch (in symfony trac) moves the $offset = ... below the $this->setLastPage(...) line. |
| Comments |
| Comment by Pavel Campr [ 22/Feb/11 ] |
|
sorry, this is not doctrine related issue, it's just symfony |
[DC-976] Invalid long constraint name Created: 19/Feb/11 Updated: 19/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Sébastien Rannou | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
OS: Linux |
||
| Attachments: |
|
| Description |
|
When the constraint's name is too long, a shorter one is generated using information such as the name of the database. If the database's name begins with a numeric value, the constraint name also begins with a numeric value which results in an invalid constraint name. |
[DC-975] Treat sql server error 2601 as Doctrine_Core::ERR_ALREADY_EXISTS Created: 17/Feb/11 Updated: 17/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Connection |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Ben Davies | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Sql server |
||
| Attachments: |
|
| Description |
|
Patch attached to treat sql server error 2601 (Integrity constraint violation) as Doctrine_Core::ERR_ALREADY_EXISTS |
[DC-974] generateFile = true - problematic implementation, see symfony ticket #4522 Created: 17/Feb/11 Updated: 17/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Behaviors |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Georg | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | None | ||
| Environment: |
symfony |
||
| Description |
|
see http://trac.symfony-project.org/ticket/4522 When using a behaviour with generateFile=true, som eproblematic issues occur: Let's take for example i18n: schema.yml 1) The translation model class and it's base class are not created with generate.php (aka symfony doctrine:build --model), but every time a translation model is used. This is not the expected behaviour, because Proposal:
I realize that most development resources are now in the new doctrine, but this issue (especially the apc fragmentation) is a huge problem for me. If you won't fix it, let me know, then I would try to propose a patch. I checked the code, and the building and behaviour internal part of doctrine are not too well documented, and my patch would be far from perfect. |
[DC-973] Statements with empty results are not correctly closed Created: 17/Feb/11 Updated: 17/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Miloslav "adrive" Kmet | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Statements that return no result are not correctly closed in Doctrine_Hydrator_Graph::hydrateResultSet(). Oracle has limited number of opened cursors, and this bug prevents unsing doctrine in batch task like indexing models with sfSolrPlugin. Oracle throws an error `ORA-01000: maximum open cursors exceeded : ` in my case after indexing only 100 records. I'll send a pull request via github for this issue. |
[DC-972] MySQL field aliases with triple ticks Created: 16/Feb/11 Updated: 16/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Roland Huszti | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
MySQL 5, PHP 5 |
||
| Attachments: |
|
| Description |
|
In revision 7691 something has happened. Ever since I updated my Doctrine to that revision all my queries having " ... fieldname AS aliasname ... " go crazy and make the PHP to throw an exception, like this: 'Doctrine_Connection_Mysql_Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 't.`id`' in 'field list'. Failing Query: The problem is that the DQL parser somewhere along the process encapsualtes aliases in ticks, but then it does it again in lib/Doctrine/Formatter.php : quoteIdentifier() , which is called in lib/Doctrine/Connection : quoteIdentifier() , which is called in lib/Doctrine/Query.php : processPendingFields() @ between lines 485 and 512. The problem is that by the time the alias name gets to line 507 it is already encapsualted in ticks, but it does it again. At the end we end up with ```alias``` , which is not good. It only happens to aliases. If I say select('*') or select("t.id, t.name") then it executes properly. Only the aliases couse problems. A test query: $vTerritories = Doctrine_Query::create() MY PROPOSED PATCH: If I change the Formatter::quoteIdentifier() to this: public function quoteIdentifier($str, $checkOption = true) { $tmp = $this->conn->identifier_quoting; // I move up this line to here because I need it if ( (substr($str, 0, 1) == $tmp['start']) && (substr($str, -1) == $tmp['end']) ) return $str; // new line; is it already quoted? if yes, then don't do it again // the rest is unchanged }then it works correctly. Please note I only tested that in MySQL, as we use MySQL in all our projects. |
[DC-971] Tree result sets hydrators are checking for column level not field level Created: 16/Feb/11 Updated: 16/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Nested Set |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Miloslav "adrive" Kmet | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Tree hierarchy hydrators (Doctrine_Collection::toHierarchy and Doctrine_Array_Hierarchy_Driver::hydrateResultSet) are checking wheter the column `level` exists. The level column can be aliased, and for oracle, it is required to do so. Therefor it is better to check, whether the aliased field level exists. Patch included in pull request |
[DC-970] Diff Tool doesn't generate the down() method if a field attribute is changed in YAML Created: 11/Nov/10 Updated: 07/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | taha bayrak | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Doctrine 1.2 |
||
| Description |
|
Diff Tool doesn't generate the down() method if a field attribute is changed in YAML. Below is an example scheme.yaml email:
type: string(255)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
scheme2.yaml email:
type: string(160)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
And below is the generated migration class (down() method is missing): 1239898949_Version39.php class Version39 extends Doctrine_Migration_Base { public function up() { $this->changeColumn('support_tickets', 'email', 'string', '160', array( 'fixed' => '0', 'unsigned' => '', 'primary' => '', 'notnull' => '', 'autoincrement' => '', )); } public function down() { } } |
| Comments |
| Comment by Ton Sharp [ 07/Apr/11 ] |
|
How I can see "changeColumn" doesn't work in the "down" section |
[DC-969] When I add a text field to a mysql table the migration code generated fails Created: 07/May/10 Updated: 23/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Mauro Chojrin | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux, Symfony 1.4, Doctrine 1.2 |
||
| Description |
|
I am using a database designed using schema.yml with a MySql Server. When I add a field of type text the generated code for the migrations (using diff) is as follows: $this->addColumn('<tableName>', '<fieldName>, 'text', '', array( Which produces a MySQL error like this: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1. Failing Query: "ALTER TABLE <tableName> ADD <fieldName> text()" The solution I found was to manipulate manually the generated class to use an addColumn like this: $this->addColumn('<tableName>', '<fieldName>, 'text', null, array( Which would generate an SQL statement like this: ALTER TABLE <tableName> ADD <fieldName> text Which works fine with MySQL, don't know about other RDBMS |
| Comments |
| Comment by Siegfried DuDragon [ 23/Feb/11 ] |
|
My understanding is that you need to put a size to the text so it will choose between tinytext, text, mediumtext, bigtext, so instead of |
[DC-968] I18n and PostgreSQL and DmVersionable Created: 03/Nov/10 Updated: 15/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Sasha | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP 5.3.2, PostgreSQL 8.4.5, Diem 5.1.x |
||
| Description |
|
I am using PHP 5.3.2 and PostgreSQL 8.4.5, Diem passed all checks in green - OK. I started with "A week of Diem Ipsum" and all went ok until I reached building of blog engine. Blog engine example fails in step: php symfony doctrine:migrate with error message: The following errors occurred:
* SQLSTATE[42830]: Invalid foreign key: 7 ERROR: there is no unique constraint matching given keys for referenced table "article_translation". Failing Query: "ALTER TABLE article_translation_version ADD CONSTRAINT article_translation_version_id_article_translation_id FOREIGN KEY (id) REFERENCES article_translation(id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE"
* SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. Failing Query: "CREATE INDEX article_image ON article (image)"
* SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. Failing Query: "CREATE INDEX article_author ON article (author)"
* SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. Failing Query: "CREATE INDEX article_translation_id ON article_translation (id)"
* SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. Failing Query: "CREATE INDEX article_translation_version_id ON article_translation_version (id)"
I removed i18n support in blog engine example and after that migrate went ok. But in Admin interface when I wanted to add SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. Again I reviewed the model and removed DmVersionable, migrated again and after that I could loremize or create articles without errors. Additionally, not related directly to this blog engine example but doctrine related, I noticed errors in Diem Admin interface 500 | Internal Server Error | Doctrine_Connection_Pgsql_Exception
SQLSTATE[08P01]: <>: 7 ERROR: bind message supplies 1 parameters, but prepared statement "pdo_stmt_00000008" requires 2
Are this bugs corrected? |
[DC-967] Problems with fetchArray() combined with leftJoin() by using aliases of columns Created: 13/Feb/11 Updated: 13/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Record |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Arnoldas Lukasevicius | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Symfony Framework v1.3.8, Windows 7 |
||
| Description |
|
They are some strange problems with hydration to array combined with aliases of columns and JOINS. Let's see this example: $q = Doctrine_Query::create ()
->select('c.id AS id, c.path AS path, c.name AS name, cbc.product_count')
->from('Category c')
->leftJoin('c.CategoryBrowserCache cbc');
$categories = $q->fetchArray();
This example will throw exception: "The root class of the query (alias lc) must have at least one field selected." OK. Let's change code a little bit. Let's add alias for cbc.product_count column too: $q = Doctrine_Query::create ()
->select('c.id AS id, c.path AS path, c.name AS name, cbc.product_count AS product_count')
->from('Category c')
->leftJoin('c.CategoryBrowserCache cbc');
$categories = $q->fetchArray();
print_r($categories);
Now code executed without exception, BUT $q->fetchArray() returned only ONE (first) record hydrated to array. Other results were ignored. Let's change code one more time: $q = Doctrine_Query::create ()
->select('c.id, c.path, c.name, cbc.product_count AS product_count')
->from('Category c')
->leftJoin('c.CategoryBrowserCache cbc');
$categories = $q->fetchArray();
print_r($categories);
Like you see I just removed all aliases for columns for Category. Now code will be executed without exceptions, All results will be hydrated into array as expected to be. Actually the same result can be reached by removing at least one alias for any Category column. |
[DC-966] Default Order By incorrectly propagating to relations Created: 12/Feb/11 Updated: 12/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Jason Yang | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows 7 WAMP, PHP 5.3, MySQL 5.1.36, Apache 2.2.11 |
||
| Description |
|
Symfony Version 1.4.9 ORM: Doctrine Schema.yml: Table1: sort_order: { string(255), notnull: true }Table2: value: { string(255), notnull: true } relations: This generates models and I can see the following: BaseTable?1.class.php: $this->option('sort_order', 'sort_order ASC'); BaseTable?2.class.php: No option for sort_order But when I run the following, I get errors: Doctine::getTable('Table1') Error: Column not found: 1054 Unknown column 't2.sort_order' in 'order clause' Looking at the sql executed, it included t1.sort_order ASC, but also incorrectly added t2.sort_order ASC as well even though it was never defined anywhere. I am unsure if this is a Doctrine problem or a symfony one, so I will post i on both bug tracking systems. |
[DC-965] Doctrine is passing timestamps to Doctrine_Validator_Unsigned Created: 11/Feb/11 Updated: 11/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Validators |
| Affects Version/s: | 1.2.2, 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Alex Dean | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian Lenny (5.0.8) with MySQL (5.0.51a-24+lenny5O). Doctrine hosted within CodeIgniter v1.7.2 |
||
| Description |
|
Since April last year I've been unable to use Doctrine Timestampable functionality because I get errors like this:
I've tried lots of different configurations for the timestampable functionality (see my Stack Overflow question for details) to no avail. I've done some further investigation and the reason for the problem is that the timestamps are being sent to Doctrine_Validator_Unsigned for validation; they are then failing the following regexp test: if (preg_match('/[^0-9\-\.]/', $value)) { return false; } I'm not smart enough to figure out why Doctrine is calling an unsigned validation test for these timestamps, so for now I've fixed the problem by hacking the following into Doctrine_Validator_Unsigned: if (preg_match('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $value)) { return true; } Very ugly I know, but when I add this in the rest of the timestamping functionality works perfectly. Would love to get to the bottom of this bug - is particularly strange because nobody else seems to be experiencing it. |
| Comments |
| Comment by Alex Dean [ 11/Feb/11 ] |
|
Added CodeIgniter details to environment |
[DC-964] Alias name error when using interval(MySQL) Created: 03/Feb/11 Updated: 03/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Tibor Erdész | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP Version 5.3.3-1ubuntu9.3; Apache/2.2.16 (Ubuntu); MySQL: 5.1.41; Symfony 1.4; Doctrine 1.2.3 (Revision: 7490) |
||
| Description |
|
I'm using Doctrine with Symfony and i have some troubles when i'm using the mysql command: interval. Here's a detailed explanation: User:
columns:
name: { type: string(255), notnull: true }
nick: { type: string(255), notnull: true, unique: true }
email: { type: string(255), notnull: true, unique: true }
password: { type: string(40), notnull: true }
VirtualConferenceRoom:
columns:
adminId: { type: integer, notnull: true }
name: { type: string(255), notnull: true }
startDate: { type: timestamp, notnull: true }
duration: { type: integer, notnull: true }
relations:
Admin:
class: User
foreign: id
local: adminId
VirtualConferenceRoomUser:
columns:
virtualConferenceRoomId: { type: integer, notnull: true }
userId: { type: integer, notnull: true }
relations:
VirtualConferenceRoom:
class: VirtualConferenceRoom
foreign: id
local: virtualConferenceRoomId
User:
class: User
foreign: id
local: userId
I've generated my model with symfony's built in command(symfony doctrine:build --model --sql) // In the project/lib/model/doctrine/VirtualConferenceRoomTable.class.php which is extends from Doctrine_Table public function getRoomsInProgressByUserId($userId) { return Doctrine_Query::create() ->select('vcr.*') ->from('VirtualConferenceRoom vcr') ->innerJoin('vcr.VirtualConferenceRoomUser vcru') ->where('(vcr.StartDate < now()) and (vcr.StartDate + interval vcr.Duration minute > now()) and vcru.UserId = ?', array($userId)) ->execute(); } When I try to run my app I get an error message: "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'vcr.Duration' in 'where clause'" " SELECT v.id AS v__id, v.userid AS v__userid, v.name AS v__name, v.startdate AS v__startdate, v.duration AS v__duration FROM virtual_conference_room v INNER JOIN virtual_conference_room_user v2 ON v.id = v2.virtualconferenceroomid WHERE (v.startdate < NOW() AND v.startdate + interval vcr.Duration minute > NOW() AND v2.userid = ?) - (2)"
The problem is the vcr.Duration section. If I change my function from: ->where('(vcr.StartDate < now()) and (vcr.StartDate + interval vcr.Duration minute > now()) and vcru.UserId = ?', array($userId))
to: ->where('(vcr.StartDate < now()) and (vcr.StartDate + interval v.Duration minute > now()) and vcru.UserId = ?', array($userId))
it works perfectly. I hope my report is useful and clear and i can help you to improve this great ORM |
| Comments |
| Comment by Tibor Erdész [ 03/Feb/11 ] |
|
Just figured out that I can use notations and I fixed my report. |
[DC-963] Doctrine cache - Salt dissociation Created: 03/Feb/11 Updated: 18/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Caching |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Critical |
| Reporter: | Thomas Tourlourat - Armetiz | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
Doctrine Cache store data into a persistence storage. Regarding APC, Doctrine use a share storage. I'm using a server to host two Doctrine project, a preproduction & production Website. In some case, DQL is the same on both project, but the data model definition isn't. Preproduction convert DQL to SQL using data model definition, and store the SQL result into APC cache refer to the DQL hash. I'm not sure about the quality of this explanation... But I can add some information is needed. The solution of this problem is easy. Just add a SALT to any cache id's. It's a Doctrine_Cache problem, not only a Doctrine_Cache_APC problem.. $cacheDriver = new doctrine_Cache_Apc (); |
| Comments |
| Comment by Thomas Tourlourat - Armetiz [ 03/Feb/11 ] |
|
to complete this bug, I think it's also a problem on DC 2.. |
| Comment by Jaik Dean [ 18/Apr/11 ] |
|
There is already an (undocumented?) option "prefix" that allows this. $cacheDriver = new Doctrine_Cache_Apc(array('prefix' => 'MY UNIQUE SALT')); |
[DC-962] Broken logic when doctrine translates limit's into subqueries, with joins. (with patch) Created: 02/Feb/11 Updated: 02/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Ben Davies | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
All |
||
| Attachments: |
|
| Description |
|
Problem exists when Doctrine formulates a subquery to perform a limit when a join in included. The problem is that the where clause that doctrine creates for the subquery (the WHERE IN clause) is inserted as the first where clause. Consider: select * from table join metadata WITH c = ? where a = ? and b = ? limit 1 with parameters be (1, 2, 3) Doctrine will translate this to
select * from table
join metadata WITH c = ?
where table.id IN (
select id from table
join metadata WITH c = ?
where a = ? and b = ?
limit 1
)
and a = ? and b = ?
Doctrine will duplicate the params (Doctrine_Query_Abstract:969) to (1, 2, 3, 1, 2, 3), but now they are in the wrong order completely. The easy fix is to move the limit subquery to the LAST where clause, which would reuslt in a query like so:
select * from table
join metadata WITH c = ?
where a = ? and b = ?
and table.id IN (
select id from table
join metadata WITH c = ?
where a = ? and b = ?
limit 1
)
Attached is a patch to fix this issue, along with a patch that fixes all unit tests referring to the old query format. |
| Comments |
| Comment by Ben Davies [ 02/Feb/11 ] |
|
upping to blocker since this breaks very basic queries |
[DC-961] Copy uses mutators but does not use accessors Created: 28/Jan/11 Updated: 28/Jan/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Record |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Paul Jones | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I have a column that contains a serialized string of data. The accessor for that column unserializes the data and the mutator serializes. When calling copy the accessor is not used but the mutator is causing the mutator to fail because it receives a string instead of an object as its value. The lines of code creating this problem follow: Record.php public function copy($deep = false) { $data = $this->_data; //does not use accessor ... $ret = $this->_table->create($data); // does use mutator ... } I have currently patched my copy function with the following: // $data = $this->_data $data = $this->toArray(false); |
[DC-960] Bug in OCI8 adapter's freeCursor function causes exception with HYDRATE_ON_DEMAND Created: 26/Jan/11 Updated: 26/Jan/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Connection |
| Affects Version/s: | 1.2.0-ALPHA1, 1.2.0-ALPHA2, 1.2.0-ALPHA3, 1.2.0-BETA1, 1.2.0-BETA2, 1.2.0-BETA3, 1.2.0-RC1, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | vadik56 | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
doctrine, symfony, linux, hpux |
||
| Attachments: |
|
| Description |
|
oci_free_statement should be changed to oci_cancel inside Doctrine_Adapter_Statement_Oracle::closeCursor(). Otherwise exception is thrown if HYDRATE_ON_DEMAND is used followed by foreach loop. Doctrine2 should also be affected by this bug. Change: To: |
[DC-959] DSN style problems in documentation 1.2 Created: 25/Jan/11 Updated: 25/Jan/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Minor |
| Reporter: | Luis Felipe | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MAMP |
||
| Description |
|
This page: http://www.doctrine-project.org/projects/orm/1.2/docs/manual/introduction-to-connections/en states the DSN can either be provided as an associative array or as a string, but it's not true, specially if you're doing lazy connection, because this type of connection only accepts doctrine dsn style and it doesn't seem to know how to handle unix socket type connections (is it correct?). I would suggest the manual clarify that lazy connection will only accept string type dsn and also will not accept socket connections. Related links: |
Non-Equal Nest Relations Not Working - from "Children" side
(DC-952)
|
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Behaviors, Documentation, Nested Set, Relations |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Sub-task | Priority: | Major |
| Reporter: | Daniel Reiche | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP 5.3 / symfony 1.4.9 |
||
| Description |
|
Sorry for the lengthy explanation, couldn't make it more straight forward: I have a model which is similiar to a nestet set but the tree structure needs to overlap: For Model A, every Object A1 can have multiple descendant objects A2 and in turn can be a descendant of multiple objects A0. Since I saw no way to do this with Nested-Set Relations (or Equal-Nested-Sets) I have set up my Model like this: modules: modules_required: I needed to specify the Relations on both tables, to use onDelete/onUpdate CASCADE rules. Generated Models look fine, just as intended. Now the strange part: The point is: Is there a better way to solve my problem? |
| Comments |
| Comment by Daniel Reiche [ 25/Jan/11 ] |
|
forgot to add something: I have done a debug run, to see why these queries are created, when there was no data modified that related to these tables: Doctrine seems to handle my structure internally as a Nested-Set, although I have not specified an actAs: NestedSet or relations: equal: true statement in the model definition. This is not a nested set, as each object can have virtually any other object either as parent or as a child, and additionaly, parent relations can span multiple tree-levels: results in: Object 6 has parents 2 and 4 (where 4 has parent 3 and 3 has parent 2 in turn) This spanning relations seems to cause the guessed nested set to fail. I simply wanted to create an m:n Relation using a Reference table and the fact that both m and n are of the same class should not consider doctrine. |
| Comment by Daniel Reiche [ 26/Jan/11 ] |
|
related to #DC-329: also the h2aEqualable mentioned there does not work, because it does not prevent symfony from issueing the delete queries. It prevents only the UPDATE-Queries, and thus circumvents the MySQL-Error. Nevertheless, data is still corrupted after object save, thus not useable in production. |
[DC-957] MSSQL doctrine inner join group by problem Created: 20/Jan/11 Updated: 20/Jan/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Mehmet Uysal | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
mssql, doctrine 1.2.3 , symfony |
||
| Description |
|
$q = Doctrine_Query::create() SELECT i should create SELECT MSSQL doesnt support this use of group by sql. Id have to be in aggregrate function or group by. I do not need id but doctrine creates it in sql. "invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause." |
[DC-956] Validation error (unique) when inserting an object with Searchable behavior Created: 20/Jan/11 Updated: 20/Jan/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Searchable |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Axel Guckelsberger | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu Linux with Apache 2 and PHP 5.3. |
||
| Description |
|
As soon as one enables the Searchable behavior like the following it is not possible anymore to create or update an entity.
After trying to create a new item the following error message appears (note the record class is called SearchableTest_Model_Article and the primary id column is named articleid):
|
[DC-955] Loading fixtures containing data for Versionable/Searchable Models fails due to Duplicate-Key errors Created: 14/Jan/11 Updated: 14/Jan/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Behaviors, Data Fixtures, Import/Export, Searchable |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Reiche | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
PHP 5.3.3 / symfony 1.4.9-dev / MySQL 5.0 |
||
| Description |
|
Sample schema: Blog: name: string When dumping data of a schema with Versionable and/or Searchable Behaviour, the dump.yml will contain all data, including the *_version and *_index tables. Trying to load the same .yml file results in Duplicate-Key constraint violations, as long as the data for the *_version and *_index tables is present. |
[DC-954] tinyint(1) with default value in schema.yml generates blank default value, gives SQLSTATE[42000] Created: 09/Jan/11 Updated: 09/Jan/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Colin Stuart | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Win7 64-bit |
||
| Description |
|
doing a Foo: results in a blank value generated for the default keyword, and the following error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ENGINE = INNODB' at line 1. Failing Query: "CREATE TABLE foo (id BIGINT AUTO_INCREMENT, bar tinyint(1) DEFAULT , PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ENGINE = INNODB". Failing Query: CREATE TABLE foo (id BIGINT AUTO_INCREMENT, bar tinyint(1) DEFAULT , PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ENGINE = INNODB I've also tried combinations of tinyint, tinyint(4), single-quoting the default value, and different default values. Changing the type to int makes the issue disappear |
[DC-953] Doctrine fails when using link() on OneToMany because of failing save Created: 04/Jan/11 Updated: 04/Jan/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Buster Neece | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP 5.2.10, MySQL database connection |
||
| Attachments: |
|
| Description |
|
I have continually run into a very particular bug when using OneToMany relationships between Doctrine tables. When attempting to call "link()" to generate a relationship between records in related tables, Doctrine attempts to set the ID of the "one" portion of the record to 0, then save it. This is best demonstrated by the sample YML and PHP that I have attached. It establishes a OneToMany relationship where the "one" table has another foreign key constraint. This causes the DB to trigger a foreign key constraint error when Doctrine tries to set the ID to 0, making the error easier to see. From looking into the relevant sections of the codebase, the following appears to be happening:
I've made it this far in looking into it, but for the life of me I can't figure out what is triggering the identifier being reset in this case. I should note, however, that it happens consistently in every such situation on every server I've tested it on. |
| Comments |
| Comment by Buster Neece [ 04/Jan/11 ] |
|
Further research into the issue has revealed the exact area where the problem is being caused: Doctrine_Collection (272): Function "setReference", called from Doctrine_Relation_ForeignKey (80). For each of the elements in the collection (in this case, the related items), that function is setting the "reference field" value to the record being related to. Apparently, it's getting the field names confused, because it's overwriting "id" with a reference to the entire related object, which has a different ID. I can't tell if this is only an issue when both the relation tables use the same identifier ("id"), but this is surely common enough to warrant a fix. |
[DC-952] Non-Equal Nest Relations Not Working - from "Children" side Created: 03/Jan/11 Updated: 24/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Record, Relations |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Paweł Barański | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 4 |
| Labels: | None | ||
| Environment: |
Ubuntu 10.04 + PHP 5.3.3 + Symfony 1.4.8 |
||
| Attachments: |
|
||||||||||
| Sub-Tasks: |
|
| Description |
|
I've copy & pasted example from http://www.doctrine-project.org/projects/orm/1.2/docs/manual/defining-models/1_0#relationships:join-table-associations:self-referencing-nest-relations:non-equal-nest-relations . 1. Add 3 User objects (A,B,C) As a result you will see only C set as Children, and strange situation in database : UserReference Table: parent_id | child_id |
| Comments |
| Comment by Paweł Barański [ 06/Jan/11 ] |
|
Same ticket on symfony trac because I'm not sure whose fault is it http://trac.symfony-project.org/ticket/9398 Also some new error path there |
| Comment by Daniel Reiche [ 24/Mar/11 ] |
|
Test Case of Non-Equal Self-Referencing Relations, based on #DC-329. Failure occures in line 75 of the test case file. This should not happen! |
[DC-951] Error in generating the field size and error in the generation of the date fields for postgres Created: 24/Dec/10 Updated: 24/Dec/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.2 |
| Fix Version/s: | 1.2.4 |
| Type: | New Feature | Priority: | Major |
| Reporter: | fernando guerrero | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
apacha2, linux, Symfony 1.4 |
||
| Description |
|
collaboration of vtamara@pasosdejesus.org and jeronimo0000@gmail.com While we developed a tool with symfony 1.4 and postgresql database we found errors in the generated schema.yml which I describe below 1 - Error in generating of field size of varchars We found the following solution — Doctrine/Import/Pgsql.php.orig 2010-12-23 17:48:00.160271000 -0500
$decl = $this->conn->dataDict->getPortableDeclaration($val); |
[DC-950] Doctrine_Record magic _set() doesn't validate field type for timestamp/datetime/etc.. Created: 23/Dec/10 Updated: 24/Jan/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Record |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Gennady Feldman | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
So I ran into this recently. the magic _set() in Doctrine_Record doesn't check/validate the type of the field. The use case is when you you do something like: The only way to generate the right date/time value is to always format that string with the "right" format. This should be easier and can be easier if it supported either a timestamp (time() or a DateTime() object (just like Symfony plugin does for setDateTimeObject() function). This is just a few lines of code, let me know if I should attach a patch. I would love to see the Doctrine_Record implement this functionality. There's a ton of results on frustrated users trying to figure out how to set the date/time values properly using Doctrine. |
| Comments |
| Comment by Gennady Feldman [ 24/Jan/11 ] |
|
Symfony actually added a work around by writing another function "setDateTimeObject()" to set these fields in a more friendly way. Ideally I would love to see support for time() and date_create() natively in Doctrine. |
[DC-949] (patch)allow Native floats and double precision field types for MySQL, Oracle, Pgsql Created: 09/Dec/10 Updated: 09/Dec/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Attributes |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | Max Blackmer | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Os Independent, MySQL, Oracle, Postgresql |
||
| Attachments: |
|
| Description |
|
This creates a new attribute constant Doctrine_Core::ATTR_USE_NATIVE_FLOAT and Doctrine_Core::ATTR_USE_NATIVE_DOUBLE. This will allow the setting of attributes of use_native_float = true and use_native_double = true. With these set to true in MySQL of the generated sql will no longer Make FLOAT(18,2) and will make it just FLOAT that is a true floating point the same thing with DOUBLE except it is now a true double precision floating point. Proper adjustments are also made to MySQL, Oracle and Postgresql to use native floating point declarations to define both single and double precision floating point data types. I have attached a patch to fix the floating point field types. |
| Comments |
| Comment by Max Blackmer [ 09/Dec/10 ] |
|
Quote from MySQL Manual "For maximum portability, code requiring storage of approximate numeric data values should use FLOAT or DOUBLE PRECISION with no specification of precision or number of digits" http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html |
[DC-948] 3 underscores in my yaml file lead to error Created: 09/Dec/10 Updated: 09/Dec/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Schema Files |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Lawrence Krubner | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux 2.6.31-15-generic #50-Ubuntu SMP Tue Nov 10 14:54:29 UTC 2009 Symfony 1.4 |
||
| Description |
|
I had this yaml: OldAppellations: connection: doctrine tableName: old_appellations columns: appellations___sql: { type: text }appellationsapcode_sql: { type: text }appellationsappellation_sql: { type: text }appellationscolor_sql: { type: text }appellationscountry_sql: { type: text }appellationsregion_sql: { type: text }appellationsregion_for_link_sql: { type: text }appellationssubt_sql: { type: text }appellationstaster_appel_sql: { type: text }appellationstotal_r_sql: { type: text }appellationstype_sql: { type: text }export_record_id_sql: { type: text }I got this error: Notice: Undefined index: o__appellations in /home/lkrubner/dev/tastingnotes/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 302 Then I changed the 3 underscores to 1: appellations_sql: { type: text }I rebuilt the model and the error was gone. More details and screenshots are here: http://www.symfonyexperts.com/question/show/id/178 |
[DC-947] getRandom() method for Doctrine_Table Created: 08/Dec/10 Updated: 08/Dec/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | ddead profile | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Consider adding this method into Doctrine_Table public static function getRandom() It is portable and very useful. |
[DC-946] Oracle Doctrine_RawSql()->count() generates illegal SQL Created: 08/Dec/10 Updated: 06/Aug/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Native SQL |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Lars Pohlmann | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | oracle | ||
| Description |
|
Example RawSQL: $q = new Doctrine_RawSql(); $q->select('{k.*}') ->from('SHP_MANDANT_KATEGORIE k') ->addComponent('k', 'ShpMandantKategorie k') ->where( 'k.id_mandant=' . $this->getIdMandant() ) ->andWhere( 'k.id_parent=' . $this->getIdMandantkategorie() ) ->andWhere( 'k.aktiv=1' ) ->orderBy( 'k.sortorder' ); $q->count() generates: SELECT COUNT(*) as num_results FROM (SELECT DISTINCT k.id_mandantkategorie FROM SHP_MANDANT_KATEGORIE k WHERE k.id_mandant=2 AND k.id_parent=1520 AND k.aktiv=1) as results The illegal Part ist the "as results" at the end... |
| Comments |
| Comment by Lars Pohlmann [ 06/Aug/12 ] |
|
Hi, will this ever be corrected? |
[DC-945] Doctrine_Query::create()->where('table.field =') unexpectedly returns a result Created: 06/Dec/10 Updated: 07/Dec/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | John Huijbers | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP 5.3.0 |
||
| Description |
|
While firing the following query with Doctrine, I did not expect Doctrine to return me a record, however, even though there is a syntax error (in my opinion) it gave me the first record of the table. $q = \Doctrine_Query::create() $r = $q->fetchOne(); Note that the question mark in the where method is ommitted. This will return a User model with an Id of 1. I would expect this to generate an invalid SQL statement (or even fail to pass the DQL validation). Giving the first record doesn't seem to be appropriate in my opinion. |
[DC-944] Precedence problem in SQL generation allows bypass of pending joins Created: 03/Dec/10 Updated: 10/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | 1.2.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Walter Hop | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP 5.2, 5.3 |
||
| Attachments: |
|
| Description |
|
'Pending join conditions' are used by listeners to inject extra SQL conditions into a query. They are often used to add basic constraints on every query. An example is the bundled SoftDelete template. Its listener adds extra constraints such as s.deleted_at IS NULL to a query, to make sure that deleted rows are never retrieved on a query. However, in the emitted SQL, Doctrine_Query does not use parentheses to group normal SQL conditions together. The pending join condition is simply added to the string without encapsulating existing expressions. This makes it possible to bypass the pending join conditions entirely by using the OR operator. Example For instance, the following query exhibits this problem:
This query emits the following SQL:
which returns also a deleted row. Expected behavior One would expect the pending join conditions always to hold, and to have precedence over regularly added SQL conditions. This could be accomplished in the most simple fashion by:
As the existing expressions are now encapsulated by parentheses, it is no longer possible to bypass the pending join conditions injected by the query listener. Full test case details: init.sql create database softdelete;
grant all privileges on softdelete.* to softdelete@localhost identified by 'uahwqeruwer';
use softdelete;
CREATE TABLE soft_delete_test (name VARCHAR(255),
deleted_at DATETIME DEFAULT NULL,
PRIMARY KEY(name)) ENGINE = INNODB;
insert into soft_delete_test values ('fine', null);
insert into soft_delete_test values ('faulty', now());
run.php <?php
require "./1.2.3/lib/Doctrine.php";
spl_autoload_register(array('Doctrine', 'autoload'));
require "SoftDeleteTest.php";
$conn = Doctrine_Manager::connection("mysql://softdelete:uahwqeruwer@localhost/softdelete");
$conn->setAttribute(Doctrine::ATTR_USE_DQL_CALLBACKS, true);
$query = Doctrine_Query::create()
->from("SoftDeleteTest")
->where("name=?", "faulty")
->orWhere("name=?", "faulty");
$found = $query->execute();
foreach ($found as $f) {
echo "ERROR! Found a deleted row: $f->name\n";
}
echo "Done.\n";
SoftDeleteTest.php (copied from Doctrine manual) <?php
class SoftDeleteTest extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('name', 'string', null, array(
'primary' => true
)
);
}
public function setUp()
{
$this->actAs('SoftDelete');
}
}
|
| Comments |
| Comment by Walter Hop [ 03/Dec/10 ] |
|
Fixing quote formatting |
| Comment by Walter Hop [ 03/Dec/10 ] |
|
Final formatting fixes. |
[DC-943] Memory leaks in find* magic methods owing to failure to free queries Created: 03/Dec/10 Updated: 03/Dec/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Garpini | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
The following methods on Doctrine_Table create Doctrine_Query objects that are never free()d: |
| Comments |
| Comment by Garpini [ 03/Dec/10 ] |
|
The attachment contains a patch that addresses the memory leak by free()ing the query objects generated before returning the results of the query. |
[DC-942] fromArray makes unnessesary cals to database Created: 03/Dec/10 Updated: 03/Dec/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Ivo Võsa | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
If I do toArray(true) on record with realtions and later fromArray($array, true) on with same data unnessesary calls to database are made. $message = new Message(); $message->Sender = new User(); // if i leave out this line sender will first get loaded from database and then overwritten with provided data $message->Receiver = new User(); // if i leave out this line receiver will first get loaded from database and then overwritten with provided data $message->fromArray($data); In Doctrine_Record::fromArray() if ($deep && $this->getTable()->hasRelation($key)) { if ( ! $this->$key) { --> data gets loaded from db here, refreshRelated is not even executed. $this->refreshRelated($key); } ... } Is this desired behavour? Wouldnt it be smarter to create empty object automaticly instead of loading it from db? |
[DC-941] Spatial index type for mysql Created: 29/Nov/10 Updated: 29/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Import/Export |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | 1.2.3 |
| Type: | Improvement | Priority: | Major |
| Reporter: | Mishal | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
I'm using doctrine and some of mysql's spatial functions. I need to specify spatial index for my tables. Geometry:
Exporting this definitions throws an exception: Unknown type spatial for index geometry_idx |
[DC-940] Doctrine - loading a YAML fixture with French characters, replaces the accents with junk Created: 26/Nov/10 Updated: 26/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Data Fixtures |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Ramin | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MAC OS X (10.6.5) |
||
| Description |
|
Hi, My Doctrine 1.2 is integrated inside CodeIgniter as a hook and I know that my char-set is utf8 with collation utf8_unicode_ci. I have two YAML files, one for creating the DB and its tables and one to load some test data. My data can contain French accents (çéïë...). In my schama.yml I have correctly specified the collation and char-set: options: I double checked the settings in phpMyAdmin, everything is correct. When I run my doctrine script from commandline to load my fixture to populate one of tables, all the French accents are replaced by junk! Am I missing a setting or configuration or is there a bug in Doctrine? I appreciate any help. Cheers. P.S. Everything else works like a charm |
[DC-939] Patch for Doctrine ..... to identify in some cases autoincremented fields in oracle Created: 25/Nov/10 Updated: 24/Dec/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | 1.2.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Edwin Alexander Herrera Saavedra | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP Version 5.2.4-2ubuntu5.10 |
||
| Description |
|
Patch for Doctrine ..... to identify in some cases autoincremented Doctrine/Import/Oracle.php // Heuristic to check autoincremented fields. $res2 = $this->conn->fetchColumn($q); } return $descr; |
| Comments |
| Comment by Edwin Alexander Herrera Saavedra [ 24/Dec/10 ] |
|
when new tables are created, the auto-increment is shown in all fields of the table in the schema, to avoid this problem has generated the following improvements to a validation of the auto-increment column is only when the primary key Solution found thanks to if($descr[$val['column_name']]['primary']==1){ "; } |
[DC-938] Impossible to use other formats than YAML in data import Created: 25/Nov/10 Updated: 25/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Data Fixtures |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Mael Nison | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
File Doctrine/Data/Import.php, line #80 So, if the file is a .json (for exemple), it will be impossible to load it, even if we have specified "json" as format parameter. The fix would just be to change the line to : |
[DC-937] Cross Schema stored procedures are not recognized Created: 22/Nov/10 Updated: 08/Dec/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | will ferrer | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
XP Xamp |
||
| Attachments: |
|
| Description |
|
When you call a stored procedure from a schema other than that of the current connection: [schema_name].[stored_procedure_name]([stored_procedure_arguments]) doctrine miss understands the string and throws a "Couldn't get short alias for" exception. I fixed this by adding some more regex to the getExpressionOwner method of the Query Class. I will post the patch shortly. Will Ferrer |
| Comments |
| Comment by will ferrer [ 08/Dec/10 ] |
|
Fixed an issue where the code wouldn't work with calls to stored procedure that were nestted in groups in selects. |
[DC-936] json schema import broken Created: 22/Nov/10 Updated: 22/Dec/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | File Parser |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Mael Nison | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PHP 5.3.3-1ubuntu9.1 |
||
| Attachments: |
|
| Description |
|
With a valid Json file : It's due to this line, line, in Doctrine/Parser/Json.php (#65) : It should be: Because casting the result as array will only affect the top-level element. You must use the second parameter of json_decode() to force every objects (including sub-objects) to be converted to indexed arrays. |
| Comments |
| Comment by Mael Nison [ 22/Nov/10 ] |
|
A try to import this file should fail. |
| Comment by Brian Fenton [ 22/Dec/10 ] |
|
I've submitted a pull request w/patch and unit test for this issue using the fix above. I had the same problem in my code on OS X 10.6.4, PHP 5.3.2 |
[DC-935] Doctrine_Task_BuildAllReload does not call generate-models-from-yaml Created: 21/Nov/10 Updated: 21/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Cli |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Brandon Evans | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows Vista 32bit, Apache 2.2.14, PHP 5.3.1 |
||
| Attachments: |
|
| Description |
|
Doctrine_Task_BuildAllReload never calls generate models-from-yaml. This does not coincide with the logic of Doctrine_Task_BuildAll and Doctrine_Task_BuildAllLoad. BuildAllReload suggests that it will be building all (everything) and then reloading the database. Doctrine 1.2.3 - BuildAllReload.php public function __construct($dispatcher = null) { parent::__construct($dispatcher); $this->rebuildDb = new Doctrine_Task_RebuildDb($this->dispatcher); $this->loadData = new Doctrine_Task_LoadData($this->dispatcher); $this->requiredArguments = array_merge($this->requiredArguments, $this->rebuildDb->requiredArguments, $this->loadData->requiredArguments); $this->optionalArguments = array_merge($this->optionalArguments, $this->rebuildDb->optionalArguments, $this->loadData->optionalArguments); } public function execute() { $this->rebuildDb->setArguments($this->getArguments()); $this->rebuildDb->execute(); $this->loadData->setArguments($this->getArguments()); $this->loadData->execute(); } Instead, I think it would be more efficient and understanding to follow the same logic as build-all and build-all-load by calling drop-db and build-all-load. Proposed - BuildAllReload.php public function __construct($dispatcher = null) { parent::__construct($dispatcher); $this->dropDb = new Doctrine_Task_DropDb($this->dispatcher); $this->buildAllLoad = new Doctrine_Task_BuildAllLoad($this->dispatcher); $this->requiredArguments = array_merge($this->requiredArguments, $this->dropDb->requiredArguments, $this->buildAllLoad->requiredArguments); $this->optionalArguments = array_merge($this->optionalArguments, $this->dropDb->optionalArguments, $this->buildAllLoad->optionalArguments); } public function execute() { $this->dropDb->setArguments($this->getArguments()); $this->dropDb->execute(); $this->buildAllLoad->setArguments($this->getArguments()); $this->buildAllLoad->execute(); } I attached a patch with the above changes... I got a little lost in the test area for Doctrine_CLI, so that is not included = ) |
| Comments |
| Comment by Brandon Evans [ 21/Nov/10 ] |
|
Added the proper proposed code this time and also attached patch with better naming. |
[DC-934] One-to-one relationship with cascading deletion and softdelete creates empty records Created: 21/Nov/10 Updated: 29/Nov/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Record |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Rich Sage | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Ubuntu 10.10, PHP 5.3.3 |
||
| Attachments: |
|
| Description |
|
When using softdelete behaviour with cascading deletion on a one-to-one relationship, Doctrine will create a 'child' record if it doesn't exist already, during the cascading deletion. Eg:
Result is:
Is this expected behaviour? I've attached a test case script, tested against export from SVN of Doctrine 1.2.3 that demonstrates this. |
| Comments |
| Comment by marius [ 29/Nov/11 ] |
|
I can confirm this issue on Ubuntu 11.10 PHP 5.3.6-13ubuntu3.2 |
[DC-933] Results from Doctrine_Query::execute inconsistent with results from Doctrine_Query::getSqlQuery() Created: 19/Nov/10 Updated: 28/Feb/11 Resolved: 28/Feb/11 |
|
| Status: | Resolved |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Roger Webb | Assignee: | Guilherme Blanco |
| Resolution: | Invalid | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Redhat Linux, Apache, PHP 5, |
||
| Description |
|
The DQL Query: $query = Doctrine_Query::create() $query->execute Returns only 1 row -------------------------------------------------------------------------------- $query->getSqlQuery() returns: SELECT b.borrowers_date AS b_0, b.borrower_id AS b1, c.first_name AS c2, c.last_name AS c3, c2.first_name AS c24, c2.last_name AS c25, c5.first_name AS c56, c5.last_name AS c57, c4.first_name AS c48, b.current_status AS b_9 FROM borrowers b INNER JOIN user_borrower_assigned u ON b.borrower_id = u.borrower_id AND (u.user_id = 129) INNER JOIN contact_info c ON b.contact_info_id = c.contact_info_id INNER JOIN lo_borrower_assigned l ON b.borrower_id = l.borrower_id INNER JOIN loan_officers l2 ON l.loan_officer_id = l2.loan_officer_id INNER JOIN contact_info c2 ON l2.contact_info_id = c2.contact_info_id INNER JOIN companies c3 ON l2.company_id = c3.company_id INNER JOIN contact_info c4 ON c3.contact_info_id = c4.contact_info_id INNER JOIN realtor_borrower_assigned r ON b.borrower_id = r.borrower_id INNER JOIN realtors r2 ON r.realtor_id = r2.realtor_id INNER JOIN contact_info c5 ON r2.contact_info_id = c5.contact_info_id WHERE (b.current_status != 'finialized' AND b.current_status != 'ignored' AND b.current_status != 'dead') Running this query in PhpMyAdmin returns 1,095 rows. ----------------------------------------------------------------------------------- Results Inconsistent |
| Comments |
| Comment by Roger Webb [ 19/Nov/10 ] |
|
I have stripped the query down to this: ->select(" $query->where("b.current_status != 'finialized'") Results are still consistent with but report above. Classes: class Borrowers extends BaseBorrowers function setUp() { parent::setUp(); $this->hasOne('ContactInfo', array('local' => 'contact_info_id', 'foreign' => 'contact_info_id')); $this->hasOne('LoBorrowerAssigned', array('local' => 'borrower_id', 'foreign' => 'borrower_id')); $this->hasOne('RealtorBorrowerAssigned', array('local' => 'borrower_id', 'foreign' => 'borrower_id')); $this->hasOne('UserBorrowerAssigned', array('local' => 'borrower_id', 'foreign' => 'borrower_id')); $this->unshiftFilter(new Doctrine_Record_Filter_Compound(array('ContactInfo'))); }} class UserBorrowerAssigned extends BaseUserBorrowerAssigned { function setUp() { parent::setUp(); $this->hasOne("Borrowers", array("local" => "borrower_id", "foreign" => "borrower_id")); $this->hasOne("Users", array("local" => "user_id", "foreign" => "user_id")); }} class Users extends BaseUsers { function setUp() { parent::setUp(); $this->hasOne("ContactInfo", array("local" => "contact_info_id", "foreign" => "contact_info_id")); $this->unshiftFilter(new Doctrine_Record_Filter_Compound(array('ContactInfo'))); }} The users class also contains the function that issues the query in question. |
| Comment by Roger Webb [ 28/Feb/11 ] |
|
Non issue. Wasn't familiar with use of Doctrine. |
[DC-932] Queries fail when a model contains underscore and we try to apply a limit Created: 19/Nov/10 Updated: 19/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Noel GUILBERT | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Doctrine 1.2, Symfony 1.4.6, MySQL, Postgresql |
||
| Description |
|
Actually, I've a dead simple schema.yml, with two tables: T_Media: name: string(25) J_Acl: I have some fixtures: J_Acl: And then, the DQL query I want to execute: "From T_Media m INNER JOIN m.J_Acl order by m.created_at limit 1" But if I run this query, for instance in CLI, I got an error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'test_noel.t2__media' doesn't exist. Notes:
|
[DC-931] Newly generated Migration Classes failing to load due to method used to determine class name Created: 19/Nov/10 Updated: 19/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Migrations |
| Affects Version/s: | 1.2.0-ALPHA1, 1.2.0-ALPHA2, 1.2.0-ALPHA3, 1.2.0-BETA1, 1.2.0-BETA2, 1.2.0-BETA3, 1.2.0-RC1, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Adam Benson | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
LAMP |
||
| Description |
|
The loadMigrationClassesFromDirectory() method in Doctrine_Migration uses array_diff on get_declared_classes() between including each classes script. When a new migration class is generated by Doctrine_Core::generateMigrationsFromDiff it's class is loaded, which means loadMigrationClassesFromDirectory silently fails to load the newly generated migration on the same request. This means that scripts that first generate migrations and then apply them must be executed twice - first to generate then to apply. The following example code is used to check if the database has been modifed, generate migrations between the base version and the latest models, and then migrate the database if needed: automigrate.php Doctrine_Core::generateYamlFromModels(ROOT_PATH.'tmp/yaml/', ROOT_PATH.'models/'); $result = Doctrine_Core::generateMigrationsFromDiff(ROOT_PATH.'tmp/migrations/', ROOT_PATH.'data/yaml/', ROOT_PATH.'tmp/yaml/'); unlink(ROOT_PATH.'data/yaml/schema.yml'); rename(ROOT_PATH.'tmp/yaml/schema.yml', ROOT_PATH.'data/yaml/schema.yml'); $migration = new Doctrine_Migration(ROOT_PATH.'tmp/migrations'); $currentVersion = $migration->getCurrentVersion(); $latestVersion = $migration->getLatestVersion(); if ($currentVersion < $latestVersion) { $migration->migrate(); $this->app->addMessage("Database migration completed (from version $currentVersion to version $latestVersion)","success"); } else { $this->app->addMessage("Database is up to date and doesn't require migration (at version $currentVersion)","success"); } |
[DC-930] Complex query with DISTINCT and LIMIT on pgsql causes a SQLSTATE exception - problem in doctrine_subquery_alias Created: 16/Nov/10 Updated: 16/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Jacek Dębowczyk | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
pgsql |
||
| Description |
|
There is a problem in the following code in Doctrine/Query.php (lines 1257-1279) inside the buildSqlQuery() method: $subquery = $this->getLimitSubquery(); // what about composite keys? $idColumnName = $table->getColumnName($table->getIdentifier()); switch (strtolower($this->_conn->getDriverName())) { case 'mysql': [...] case 'pgsql': $subqueryAlias = $this->_conn->quoteIdentifier('doctrine_subquery_alias'); // pgsql needs special nested LIMIT subquery $subquery = 'SELECT ' . $subqueryAlias . '.' . $this->_conn->quoteIdentifier($idColumnName) . ' FROM (' . $subquery . ') AS ' . $subqueryAlias; break; } The above code is executed when a query consist of DISTINCT and LIMIT clauses. The most common situation is using pager. SELECT doctrine_subquery_alias.id FROM ((SELECT DISTINCT d1.id, d2.id FROM ...)) AS doctrine_subquery_alias It, of course, causes the "ambiguous column name" pgsql exception. |
[DC-929] createIndexSql and dropIndexSql don't use the same logic to get the index name Created: 16/Nov/10 Updated: 07/Sep/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Migrations |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Lea Haensenberger | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Postgresql 8.4, Symfony 1.4, Doctrine 1.2 |
||
| Description |
|
In the class Doctrine_Export the functions for creating and dropping indexes do not use the same logic to get the name of the index to be created or dropped. |
| Comments |
| Comment by Lukas Kahwe [ 16/Nov/10 ] |
|
looks to me like this is a bug in index creation. then again fixing the bug will lead to potential BC issues. that being said, anyone affected could "simply" set the index format to empty. also "fixing" the names to the proper format does not require shuffeling around data. so imho the right fix would be to apply the drop naming logic in the create logic. what surprises me is that the main reason for appending _idx by default was that many RDBMS will otherwise break because they do not separate identifiers between constraints and indexes etc and therefore people run into collisions without the postfix. |
| Comment by John Kary [ 07/Sep/11 ] |
[DC-928] [Migrations] Drop not null is not working in Postgres Created: 16/Nov/10 Updated: 16/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Migrations |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Lea Haensenberger | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Postgresql 8.4, Symfony 1.4, Doctrine 1.2 |
||
| Attachments: |
|
| Description |
|
When removing the not null from a column the migration does not change anything in the database. This is due to the following check on line 162 of lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Export/Pgsql.php So if notnull is not there or set to false or '0' or 0 the code does not enter into that if statement and therefore no changes are done to the not null value of the column. |
| Comments |
| Comment by Lukas Kahwe [ 16/Nov/10 ] |
|
@Lea: can you write up a patch for this? would also be nice if you could check if the same issue affects other drivers. |
| Comment by Lea Haensenberger [ 16/Nov/10 ] |
|
Here is a patch (attachment). The generate-migrations-diff Task in Symfony sets 'notnull' to an empty string if it's false in the schema.yml, therefore the check for empty string. I had a quick look at the classes for other DBs, but that seems to be a postgres only issue. |
[DC-927] Query with left join and group clause returns only one row, even though there are multiple results Created: 14/Nov/10 Updated: 19/May/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Bart van den Burg | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 4 |
| Labels: | None | ||
| Environment: |
Windows 7-64 bit |
||
| Description |
|
under certain circumstances, Doctrine will only return one result out of a bunch of results, for example: $ symfony doctrine:dql "from Tafel t, t.Reservering r where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels, count(r.id) reserveringen group by date(t.tijd)" Expected outcome: The query works fine without the left join: |
| Comments |
| Comment by Bart van den Burg [ 14/Nov/10 ] |
|
As you can see, by the way, it does actually say "found 2 results", but then returns only one. |
| Comment by Willem van Duijn [ 08/Feb/11 ] |
|
There are multiple reports from people that are hurt by this bug: http://www.devcomments.com/doctrine-execute-only-returns-one-row-to286270.htm Setting the Hydration-mode to HYDRATE_NONE yields multiple result rows (but is not useful). |
| Comment by Victor Ruiz [ 18/Feb/11 ] |
|
Related in some way with multiple order by clauses. If I remove all of them but one it works, the problem appears when I put more than one order by criteria. |
| Comment by Mike Seth [ 19/May/11 ] |
|
This is a hydration problem that occurs because the ID columns of the joined tables are not SELECT'ed explicitly. The offending code is a loop in the graph base hydrator, but I don't understand it well enough to fix it with any certainty that I don't break anything. |
[DC-926] Doctrine ignored PORTABILITY_FIX_CASE and ATTR_FIELD_CASE settings when building query Created: 12/Nov/10 Updated: 12/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Dziamid Zayankouski | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Tested on CentOS 5, Ubuntu 10.4, MYSQL and MSSQL databases |
||
| Description |
|
Setting: I expect column names in built queries to be uppercase, but they remain to be lowercase. |
[DC-925] missing hasOne() method-call in many-to-many relation Created: 11/Nov/10 Updated: 11/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Relations |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Simon Schick | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian Lenny |
||
| Description |
|
Here's my YAML-file for the model: http://pastie.org/1290649 I'm using the following command to build the whole model: symfony doctrine:build --all --and-load Please have a closer look at the class BaseTicketHasHardware: http://pastie.org/1290737 |
[DC-924] type mismatch for keyfield in column aggregation Created: 11/Nov/10 Updated: 11/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Inheritance |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | 1.2.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Arnaud Morvan | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PostgreSQL |
||
| Description |
|
This is the doc exemple on column aggregation inheritance : Entity: User: Group: But the keyField (type) is created as VARCHAR(255) so PostgreSQL return an error on applying inheritance condition : SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: character varying = integer I found this with symfony sfFilebasePlugin on sfFilebase:create-root task. |
[DC-923] Documentation 1.2 #working-with-models error Created: 10/Nov/10 Updated: 10/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Martin Babic | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 10.4, LAMP |
||
| Description |
|
In documentation There's an error in example code: // test.php // ... $user = new User(); $user->username = 'Some User'; $user->Groups[0]->username = 'Some Group'; $user->Groups[1]->username = 'Some Other Group'; $user->save(); The error is on lines: $user->Groups[0]->username = $user->Groups[1]->username = they shoud be: $user->Groups[0]->name = $user->Groups[1]->name = as there's no username column in schema.yml definition of Group object. |
[DC-922] master-slave replication with i18n behavior Created: 10/Nov/10 Updated: 10/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Behaviors |
| Affects Version/s: | 1.2.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | husen mankada | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
php 5.3, doctrine 1.2, Symfony 1.4, mysql |
||
| Description |
|
I'm trying to use sfDoctrineMasterSlavePlugin for database replication with Symfony 1.4 and PHP 5.3. But facing problem while selecting I18n records and receiving "Unknown relation alias Translation" error. I've also tried same with implementation solution given in master-slave chapter of doctrine cookbook but no success. Is anyone facing same problem with sfDoctrineMasterSlavePlugin and i18n behavio? Is there any solution of the problem? |
[DC-921] The ability to add WITH ROLLUP to a group by in a query Created: 09/Nov/10 Updated: 18/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major |
| Reporter: | will ferrer | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
XP XAMP |
||
| Description |
|
I figured it would be handy to have a WITH ROLLUP be add able to the group by clause. I added this feature but I can't post the patch because my patches are starting to run together - the syntax with in the generated patch would also contain parts of other patches I have posted to jira but have not yet been included in the doctrine svn. I still wanted to make this post because it will give me a ticket number to base my test cases around. Will Ferrer |
| Comments |
| Comment by will ferrer [ 09/Nov/10 ] |
|
In order to illustrate what this patch fixes I am posting my test case for the patch below <?php /* * $Id$ * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see * <http://www.doctrine-project.org>. */ /** * Doctrine_Ticket_DC921_TestCase * * @package Doctrine * @author Will Ferrer * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping * @link www.doctrine-project.org * @since 1.0 * @version $Revision$ */ class Doctrine_Ticket_DC921_TestCase extends Doctrine_UnitTestCase { public function testAggregateValueMappingSupportsLeftJoinsWithRollUp() { $q = new Doctrine_Query(); $q->select('MAX(u.name), u.*, p.*')->from('User u')->leftJoin('u.Phonenumber p')->groupby('u.id'); $q->setWithRollUp(true); $this->assertEqual($q->getSqlQuery(), 'SELECT e.id AS e__id, e.name AS e__name, e.loginname AS e__loginname, e.password AS e__password, e.type AS e__type, e.created AS e__created, e.updated AS e__updated, e.email_id AS e__email_id, p.id AS p__id, p.phonenumber AS p__phonenumber, p.entity_id AS p__entity_id, MAX(e.name) AS e__0 FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0) GROUP BY e.id WITH ROLLUP'); } } |
| Comment by will ferrer [ 18/Nov/10 ] |
|
I have updated my implemenation of this feature. Here is the new test case: <?php /* * $Id$ * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see * <http://www.doctrine-project.org>. */ /** * Doctrine_Ticket_DC921_TestCase * * @package Doctrine * @author Will Ferrer * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping * @link www.doctrine-project.org * @since 1.0 * @version $Revision$ */ class Doctrine_Ticket_DC921_TestCase extends Doctrine_UnitTestCase { public function testAggregateValueMappingSupportsLeftJoinsWithRollUp() { $q = new Doctrine_Query(); $q->select('MAX(u.name), u.*, p.*')->from('User u')->leftJoin('u.Phonenumber p')->groupby('u.id'); $q->withRollUp(); $this->assertEqual($q->getSqlQuery(), 'SELECT e.id AS e__id, e.name AS e__name, e.loginname AS e__loginname, e.password AS e__password, e.type AS e__type, e.created AS e__created, e.updated AS e__updated, e.email_id AS e__email_id, p.id AS p__id, p.phonenumber AS p__phonenumber, p.entity_id AS p__entity_id, MAX(e.name) AS e__0 FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0) GROUP BY e.id WITH ROLLUP'); $this->assertEqual($q->getDql(), 'SELECT MAX(u.name), u.*, p.* FROM User u LEFT JOIN u.Phonenumber p GROUP BY u.id WITH ROLLUP'); } public function testAggregateValueMappingSupportsLeftJoinsWithRollUpDql() { $q = new Doctrine_Query(); $q->parseDqlQuery("SELECT MAX(u.name), u.*, p.* FROM User u LEFT JOIN u.Phonenumber p GROUP BY u.id WITH ROLLUP"); $this->assertEqual($q->getSqlQuery(), 'SELECT e.id AS e__id, e.name AS e__name, e.loginname AS e__loginname, e.password AS e__password, e.type AS e__type, e.created AS e__created, e.updated AS e__updated, e.email_id AS e__email_id, p.id AS p__id, p.phonenumber AS p__phonenumber, p.entity_id AS p__entity_id, MAX(e.name) AS e__0 FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0) GROUP BY e.id WITH ROLLUP'); $this->assertEqual($q->getDql(), 'SELECT MAX(u.name), u.*, p.* FROM User u LEFT JOIN u.Phonenumber p GROUP BY u.id WITH ROLLUP'); } } |
[DC-920] The ability to add sql in the query between the first word and body of the query (allowing "SELECT STRAIGHT_JOIN" etc) Created: 09/Nov/10 Updated: 09/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major |
| Reporter: | will ferrer | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
XP XAMP |
||
| Description |
|
I recently discovered that I could greatly optimize some of the queries that were being run through our system by adding a STRAIGHT_JOIN keyword to the front of the select I added a feature to doctrine which allows me to inject sql into the query in the right place to enable features such as "STRAIGHT_JOIN" but I can't post the patch because my patches are starting to run together – the syntax with in the generated patch would also contain parts of other patches I have posted to jira but have not yet been included in the doctrine svn. I still wanted to make this post because it will give me a ticket number to base my test cases around. Will Ferrer |
| Comments |
| Comment by will ferrer [ 09/Nov/10 ] |
|
In order to show what this patch fixes I am including my test case for the patch below: <?php /* * $Id$ * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see * <http://www.doctrine-project.org>. */ /** * Doctrine_Ticket_DC920_TestCase * * @package Doctrine * @author Will Ferrer * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping * @link www.doctrine-project.org * @since 1.0 * @version $Revision$ */ class Doctrine_Ticket_DC920_TestCase extends Doctrine_UnitTestCase { public function testBeforeBodySelect() { $q = new Doctrine_Query(); $q->parseDqlQuery("SELECT DISTINCT STRAIGHT_JOIN u.name, p.id FROM User u LEFT JOIN u.Phonenumber p ON p.phonenumber = '123 123'"); $this->assertEqual($q->getSqlQuery(), "SELECT DISTINCT STRAIGHT_JOIN e.id AS e__id, e.name AS e__name, p.id AS p__id FROM entity e LEFT JOIN phonenumber p ON (p.phonenumber = '123 123') WHERE (e.type = 0)"); $this->assertEqual($q->getDql(), "SELECT DISTINCT STRAIGHT_JOIN u.name, p.id FROM User u LEFT JOIN u.Phonenumber p ON p.phonenumber = '123 123'"); } public function testBeforeBodySelectNoneDQL() { $q = new Doctrine_Query(); $q->select("DISTINCT STRAIGHT_JOIN u.name, p.id"); $q->from('User u'); $q->leftJoin("u.Phonenumber p ON (p.phonenumber = '123 123')"); $this->assertEqual($q->getSqlQuery(), "SELECT DISTINCT STRAIGHT_JOIN e.id AS e__id, e.name AS e__name, p.id AS p__id FROM entity e LEFT JOIN phonenumber p ON (p.phonenumber = '123 123') WHERE (e.type = 0)"); $this->assertEqual($q->getDql(), "SELECT DISTINCT STRAIGHT_JOIN u.name, p.id FROM User u LEFT JOIN u.Phonenumber p ON (p.phonenumber = '123 123')"); } public function testBeforeBodyDelete() { $q = new Doctrine_Query(); $q->parseDqlQuery('DELETE IGNORE FROM User'); $this->assertEqual($q->getSqlQuery(), 'DELETE IGNORE FROM entity WHERE (type = 0)'); $this->assertEqual($q->getDql(), "DELETE IGNORE FROM User"); } public function testBeforeBodyDeleteNoneDQL() { $q = new Doctrine_Query(); $q->delete('IGNORE'); $q->from('User'); $this->assertEqual($q->getSqlQuery(), 'DELETE IGNORE FROM entity WHERE (type = 0)'); $this->assertEqual($q->getDql(), "DELETE IGNORE FROM User"); } public function testBeforeBodyUpdate() { $q = new Doctrine_Query(); $q->parseDqlQuery("UPDATE IGNORE User u SET u.name = 'someone'"); $this->assertEqual($q->getSqlQuery(), "UPDATE IGNORE entity SET name = 'someone' WHERE (type = 0)"); $this->assertEqual($q->getDql(), "UPDATE IGNORE User u SET u.name = 'someone'"); } public function testBeforeBodyUpdateNonDql() { $q = new Doctrine_Query(); $q->update('IGNORE'); $q->from('User u'); $q->set('name', "'someone'"); $this->assertEqual($q->getSqlQuery(), "UPDATE IGNORE entity SET name = 'someone' WHERE (type = 0)"); $this->assertEqual($q->getDql(), "UPDATE IGNORE User u SET name = 'someone'"); } } |
[DC-919] Import/Pgsql.php: listTableColumns - SQL failure with PostgreSQL Created: 07/Nov/10 Updated: 09/Apr/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Import/Export |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Christian Vogel | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 4 |
| Labels: | None | ||
| Environment: |
Postgres Import Schema |
||
| Attachments: |
|
| Description |
|
Hi, this issue was reported at the symfony project which uses Doctrine 1.2.3: The SQL Statement 'listTableColumns' fails with an SQL-Error "missing from-clause" Even when i turn on the add_missing_from option on the postgres-server it fails with "missing relation". Now it seems to me, you already fixed this bug in the current 1.2 branch, because the current SQL-Statement is different and it works for me in psql/pgadmin. Could you please close this ticket, if you already fixed this issue, or confirm if it's still an issue? error SQLSTATE[42P01]: Undefined table: 7 ERROR: missing FROM-clause entry for table "t" LINE 6: ... t.typtype ... ^. Failing Query: "SELECT ordinal_position as attnum, column_name as field, udt_name as type, data_type as complete_type, t.typtype AS typtype, is_nullable as isnotnull, column_default as default, ( SELECT 't' FROM pg_index, pg_attribute a, pg_class c, pg_type t WHERE c.relname = table_name AND a.attname = column_name AND a.attnum > 0 AND a.attrelid = c.oid AND a.atttypid = t.oid AND c.oid = pg_index.indrelid AND a.attnum = ANY (pg_index.indkey) AND pg_index.indisprimary = 't' AND format_type(a.atttypid, a.atttypmod) NOT LIKE 'information_schema%' ) as pri, character_maximum_length as length FROM information_schema.COLUMNS WHERE table_name = 'matable' ORDER BY ordinal_position" |
| Comments |
| Comment by Nahuel Alejandro Ramos [ 09/Nov/10 ] |
|
We apply the diff patch you submit and works perfect. We are using Doctrine 1.2.3 with PostgreSQL 8.4. |
| Comment by Tim Hemming [ 23/Nov/10 ] |
|
We have applied this patch directly to our server-wide Doctrine library and it works fine. We look forward to it becoming a part of the Doctrine distribution. |
| Comment by Christopher Hotchkiss [ 19/Dec/10 ] |
|
I can confirm that this bug also affects symfony 1.4.8 and the attached fix works perfectly! |
| Comment by David Landgren [ 21/Feb/11 ] |
|
Confirmed to fix crash with symfony 1.3.8 |
| Comment by Cesar Miggiolaro [ 09/Apr/12 ] |
|
I use the version 1.4.17 and also had the error with postgres 9.1. Applying the correction suggested in DIFF. The system worked. |
[DC-918] Causing ORA-01791 when try to sort on relation field and use limit in query to Oracle DB Created: 06/Nov/10 Updated: 06/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Dmitriy | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | None | ||
| Environment: |
Windows 2003 Server, Oracle 10g, Symfony 1.4.8 |
||
| Description |
|
Schema in yml format PrType:
columns:
name: { type: string(255), notnull: true }
PrTypeTranslation:
columns:
id: { type: integer, notnull: true }
name: { type: string(255), notnull: true }
lang: { type: string(255), notnull: true }
relations:
PrType: { onDelete: CASCADE, local: id_id, foreign: id, foreignAlias: Translation }
When i try to execute this code: $q = Doctrine_Query::create()
->from('PrType tp')
->leftJoin('tp.Translation t WITH t.lang = ?', 'ru')
->orderBy('t.name')
->limit(10);
doctrine executes next statement: SELECT "p"."id", "p2"."name" AS "p2__name", "p2"."lang" AS "p2__lang" FROM "pr_type" "p" LEFT JOIN "pr_type_translation" "p2" ON "p"."id" = "p2"."id" AND ("p2"."lang" = :oci_b_var_1) WHERE "p"."id" IN ( SELECT a."id" FROM ( SELECT DISTINCT "p3"."id" FROM "pr_type" "p3" INNER JOIN "pr_type_translation" "p4" ON "p3"."id" = "p4"."id" AND ("p4"."lang" = 'ru') ORDER BY "p4"."name" ) a WHERE ROWNUM <= 10) ORDER BY "p2"."name" This sql code produces next error ORA-01791: not a SELECTed expression Error occures, because (from ORACODE)
|
| Comments |
| Comment by Dmitriy [ 06/Nov/10 ] |
|
Some very similar issue were reported and resolved here http://trac.doctrine-project.org/ticket/1038. |
| Comment by Dmitriy [ 06/Nov/10 ] |
|
Reason of issue was founded. It appears because i'm using oci8 driver, and this drivername not be listed in if statement on line 1401 in Doctrine/Query.php:
LINE 1401: if ($driverName == 'pgsql' || $driverName == 'oracle' || $driverName == 'oci' || $driverName == 'mssql' || $driverName == 'odbc') {
I changed to: LINE 1401: if ($driverName == 'pgsql' || $driverName == 'oracle' || $driverName == 'oci' || $driverName == 'oci8' || $driverName == 'mssql' || $driverName == 'odbc') {
Sorry, but i don't know how to create patch diff file. |
[DC-917] Doctrine take wrong connction Created: 05/Nov/10 Updated: 05/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Connection |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Volodymyr | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I have problems with different connection Doctrine_Manager::getInstance()->bindComponent('Datasource', 'doctrine'); symfony generate me $this->datasources = Doctrine_Core::getTable('datasource') and when i execute it show me error error that can find this table but it take wrong connection by test i tried to add bind component as datasource (first is lower character and it works pretty cool) then i change getTable('datasource') => getTable('Datasource') but it doesn't work public static function test() { return Doctrine_Query::create()->from("Datasource")->execute(); }and it works. |
[DC-916] fetchOne defect Created: 05/Nov/10 Updated: 24/Jan/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | Roman | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
Query fetchOne method now retrieves and hydrates all collection, which can be time consumable. I suggest to add limit 1 in fetchOne method. |
| Comments |
| Comment by Gennady Feldman [ 21/Jan/11 ] |
|
This is a defect. People assume there's an implied limit(1) in the query because of fetchOne(). Please fix this, this is pretty serious stuff. |
| Comment by Gennady Feldman [ 21/Jan/11 ] |
|
Doctrine_Table actually "works around" the issue but explicitly doing limit(1) before doing fetchOne(): public function findOneBy($fieldName, $value, $hydrationMode = null) { return $this->createQuery('dctrn_find') ->where($this->buildFindByWhere($fieldName), (array) $value) ->limit(1) ->fetchOne(array(), $hydrationMode); } |
| Comment by Jonathan H. Wage [ 23/Jan/11 ] |
|
Was this always like this or did it change recently? |
| Comment by Gennady Feldman [ 24/Jan/11 ] |
|
Frankly I have no idea. Also adding a limit(1) shouldn't break anything and is straight forward. We would also want to fix findOneBy not to do limit(1) since fetchOne() should take care of this after the fix is in place. |
[DC-915] The PHP code is invalid in the "Create Table" example; there are missing commas in the array definition. Created: 02/Nov/10 Updated: 07/Sep/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Trivial |
| Reporter: | Matt Alexander | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
The PHP code is invalid in the "Create Table" example; there are missing commas in the array definition. |
| Comments |
| Comment by John Kary [ 07/Sep/11 ] |
|
Submitted pull request with fixes: |
[DC-914] Doctrine_Pager ignores custom COUNT query Created: 02/Nov/10 Updated: 07/Nov/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Pager |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Arnoldas Lukasevicius | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Zend Server CE |
||
| Description |
|
I found some problem when I tried to define custom query for results counting. Defined custom COUNT query is totally ignored and executed default one. I will give you full description of problem bellow. We have following source code: $q_select = Doctrine_Query::create () ->select ( 'DISTINCT p.product_name AS product_name' ) ->from ( 'Product p' ) ->where( 'p.product_name LIKE ?', '%motorola%'); $q_count = Doctrine_Query::create () ->select ( 'COUNT (DISTINCT p.product_name) num_results' ) ->from ( 'Product p' ) ->where( 'p.product_name LIKE ?', '%motorola%'); $pager = new Doctrine_Pager( $q_select, 1, 25 ); $pager->setCountQuery($q_count); Let's check custom query before calling $pager->execute() method: echo $pager->getCountQuery(); Output: SELECT COUNT (DISTINCT p.product_name) num_results FROM Product p WHERE p.product_name LIKE ? Looks like until now is everything is correct. Let's call $pager->execute() method: $products = $pager->execute(); Let's check executed queries using Symfony SQL queries log panel: SELECT COUNT(*) AS num_results FROM product p WHERE p.product_name LIKE '%motorola%' 7.27s, "doctrine" connection SELECT DISTINCT p.product_name AS p__0 FROM product p WHERE (p.product_name LIKE '%motorola%') LIMIT 25 3.25s, "doctrine" connection Executed COUNT query is not same we set using $pager->setCountQuery($q_count). Our defined custom COUNT query is totally ignored and executed default one: INSTEAD OF THIS CUSTOM COUNT QUERY: SELECT COUNT (DISTINCT p.product_name) num_results FROM Product p WHERE p.product_name LIKE '%motorola%' EXECUTED DEFAULT COUNT QUERY: SELECT COUNT(*) AS num_results FROM product p WHERE p.product_name LIKE '%motorola%' |
| Comments |
| Comment by Alex Cardoso [ 07/Nov/11 ] |
|
I found a possible solution to the problem. That occurs not because the Pager countQuery but in a method used inside the Query class. When you set the Query or CountQuery for Pager and execute it, it calls a Query method called count(). This method by yourself call another Query class method named Query::getCountSqlQuery(). This method rather than simply execute the query that you passed earlier, simply create a new query. Below is a possible solution to the problem: Query.php (Doctrine Stable 1.2.4)
--- Query.php 2011-11-07 20:52:48.000000000 -0200
+++ Query.php 2011-11-07 20:51:58.000000000 -0200
@@ -2049,40 +2049,7 @@
if (count($this->_queryComponents) == 1 && empty($having)) {
$q .= $from . $where . $groupby . $having;
} else {
-
- // Subselect fields will contain only the pk of root entity
- $ta = $this->_conn->quoteIdentifier($tableAlias);
-
- $map = $this->getRootDeclaration();
- $idColumnNames = $map['table']->getIdentifierColumnNames();
-
- $pkFields = $ta . '.' . implode(', ' . $ta . '.', $this->_conn->quoteMultipleIdentifier($idColumnNames));
-
- // We need to do some magic in select fields if the query contain anything in having clause
- $selectFields = $pkFields;
-
- if ( ! empty($having)) {
- // For each field defined in select clause
- foreach ($this->_sqlParts['select'] as $field) {
- // We only include aggregate expressions to count query
- // This is needed because HAVING clause will use field aliases
- if (strpos($field, '(') !== false) {
- $selectFields .= ', ' . $field;
- }
- }
- // Add having fields that got stripped out of select
- preg_match_all('/`[a-z0-9_]+`\.`[a-z0-9_]+`/i', $having, $matches, PREG_PATTERN_ORDER);
- if (count($matches[0]) > 0) {
- $selectFields .= ', ' . implode(', ', array_unique($matches[0]));
- }
- }
-
- // If we do not have a custom group by, apply the default one
- if (empty($groupby)) {
- $groupby = ' GROUP BY ' . $pkFields;
- }
-
- $q .= '(SELECT ' . $selectFields . ' FROM ' . $from . $where . $groupby . $having . ') '
+ $q .= '( '.$this->getSqlQuery().' ) '
. $this->_conn->quoteIdentifier('dctrn_count_query');
}
return $q;
|
[DC-913] A way to auto detect what connection should be used to run a query based on what table was used in the from Created: 01/Nov/10 Updated: 01/Nov/10 Resolved: 01/Nov/10 |
|
| Status: | Resolved |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major |
| Reporter: | will ferrer | Assignee: | Guilherme Blanco |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
XP Xamp |
||
| Description |
|
I needed a way to allow my queries to figure out what connection to use based on what table was used in the from. In other words I needed my queries to be able to run on the same connection that the table in the from used, but the way my code is structured I didn't have a convenient way to do this outside of doctrine. I built a feature into doctrine for this I called: autodetectConnection. I will post the patch for this after I build a test case for this ticket. Will Ferrer |
| Comments |
| Comment by will ferrer [ 01/Nov/10 ] |
|
Upon trying to make the test cases for this I looked into the feature I had added further and found that it seems as though doctrine has this ability already. I suspect my addition of this feature was in response to a bug I had which I have since fixed. |
[DC-912] A method that can run in a model when the model is autoloaded Created: 01/Nov/10 Updated: 09/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Record |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major |
| Reporter: | will ferrer | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
XP Xamp |
||
| Attachments: |
|
| Description |
|
For my project I needed to be able to reassign connections to models when they are autoloaded – this had to be able to happen during a conservative model loading process before the models had been instantiated. My solution was to build in a hook to a "autoloadSetUp" method which can be attached to any model (or class that is the base for a model). I will post my patch after I make a test case for it. Will Ferrer |
| Comments |
| Comment by will ferrer [ 02/Nov/10 ] |
|
made test case use a static method |
| Comment by will ferrer [ 09/Nov/10 ] |
|
fixed some compatibility issues with the test case and other test cases |
[DC-911] A way of checking if a model has been loaded via the loaded loadModels method Created: 01/Nov/10 Updated: 02/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major |
| Reporter: | will ferrer | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
XP Xamp |
||
| Attachments: |
|
| Description |
|
I needed a way to check if a model has been loaded — checking to see if the model was included in the _loadedModelFiles property of core. I put in a simple function that allows me to test for this. I will post the patch after building a test case for this ticket. Will Ferrer |
| Comments |
| Comment by will ferrer [ 02/Nov/10 ] |
|
Changed the name of the method to modelLoaded (seemed more appropriate) |
[DC-910] Sub queries do not work properly in the on clause of a join Created: 01/Nov/10 Updated: 02/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | will ferrer | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
XP Xamp |
||
| Attachments: |
|
| Description |
|
When subqueries are used in the on part of a join clause the Doctrine_Query_JoinCondition class does not always create the proper sql. For instance when there are 2 subqueries used in a between doctrine tries to parse the statement as 1 subquery rather 2 subqueries with an "and". I will post my patch that fixes this issue after I make some test cases for it. I also fixed an issue where "(SQL:" syntax was breaking the join as well. Will |
| Comments |
| Comment by will ferrer [ 02/Nov/10 ] |
|
took out some commented code chunks |
[DC-909] Add Some Info to Doctrine Query order by Method Documentation Created: 01/Nov/10 Updated: 01/Nov/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Documentation |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Trivial |
| Reporter: | Isaac Foster | Assignee: |