[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-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-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-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-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-651] [PATCH] Doctrine_Record::option('orderBy', ...) of join's right side being applied to refTable in m2m relationship Created: 26/Apr/10 Updated: 31/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Query, Relations |
| Affects Version/s: | 1.2.2, 1.2.3 |
| Fix Version/s: | 1.2.2, 1.2.3, 1.2.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | suhock | Assignee: | Guilherme Blanco |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | None | ||
| Environment: |
CentOS 5.4 |
||
| Attachments: |
|
| Description |
|
When using the Doctrine_Record::option('orderBy', ...) feature on a table definition, where that table is the target of a many-to-many join, the specified orderBy columns are applied to the relation table's alias. So for example, given the following definitions: class User extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('uid', 'integer', null, array('primary' => true)); $this->option('orderBy', 'uid'); } public function setUp() { $this->hasMany('Group as groups', array('refClass' => 'UserGroup', 'local' => 'user_uid', 'foreign' => 'group_id')); } } class Group extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('gid', 'integer', null, array('primary' => true)); } public function setUp() { $this->hasMany('User as users', array('refClass' => 'UserGroup', 'local' => 'group_gid', 'foreign' => 'user_id')); } } class UserGroup extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('user_uid', 'integer', null, array('primary' => true)); $this->hasColumn('group_gid', 'integer', null, array('primary' => true)); } public function setUp() { $this->hasOne('User as user', array('local' => 'user_uid', 'foreign' => 'uid')); $this->hasOne('Group as group', array('local' => 'group_gid', 'foreign' => 'gid')); } } the following queries: $query = Doctrine_Query::create()
->select('u.*')
->from('User u')
->leftJoin('u.groups g WITH g.gid=?', 1);
echo $query->getSqlQuery() . "\n";
$query = Doctrine_Query::create()
->select('g.*')
->from('Group g')
->leftJoin('g.users u WITH u.uid=?', 1);
echo $query->getSqlQuery() . "\n";
will output the following:
The orderBy option() call is applied to the User definition. The SQL for the first query is correct (where User is on the left side of the join). The SQL for the second query (where User is on the right-most side of the join), however, is obviously incorrect (UserGroup doesn't even have a uid column). Basically, User's orderBy option is being applied to both the User table and its respective reference table, UserGroup, when it is the target of a join. After digging through the source for a while, I believe I've come up with a patch for this issue (which should be checked by someone more knowledgeable of Doctrine's internals). Basically, in the Doctrine_Query::buildSqlQuery() function, a call is made to Doctrine_Relation::getOrderByStatement() with the reference table (UserGroup)'s alias (u2), which in turn makes a call to Doctrine_Table::getOrderByStatement() on the referenced table (User), filling in the ORDER BY clause with User columns using UserGroup's alias. My solution was to reorder the logic so that the test for a reference class is made before the initial call to getOrderByStatement() is made. It seems to work against my test case and the test cases in the repository. I'll post my patch momentarily. This bug was first mentioned in the comments in DC-313, but the original ticket comes across as more of a feature request for the hasMany() orderBy feature. |
| Comments |
| Comment by suhock [ 26/Apr/10 ] |
|
attached a test case for this bug |
| Comment by suhock [ 26/Apr/10 ] |
|
patch against /branches/1.2 HEAD (should also work apply to 1.2.2 tag) |
| Comment by Dan Ordille [ 30/Aug/10 ] |
|
I can confirm this as an issue. However I don't think the above patch adequately fixes the problem it seems like with it an order by is still added for the ref column however the relation alias is lost. My query with the patch became I made an another patch that prevents this extra order by clause from being added and have attached it. |
| Comment by suhock [ 21/Sep/10 ] |
|
I tried out the new patch (Query_orderby_relation.diff), but it provides a reversed diff (patching goes from a patched version to the original). After applying it manually, it fails the provided test case and several additional test cases from the repository. The original patch DOES pass the provided test case, when applied against 1.2.2, 1.2.3, or the 1.2 branch from the repository. It does not pass, however, Doctrine_Query_Orderby_TestCase. As the previous poster mentioned, it fails to resolve aliases in instances where the 'orderBy' option is specified in a relation definition. I deleted the original patch and am providing a revised patch (Ticket_DC651.patch) against branch 1.2 HEAD (also works with 1.2.3), which fixes this issue. It passes all working test cases, including Doctrine_Query_Orderby_TestCase and DC651TestCase. |
| Comment by José De Araujo [ 31/Aug/11 ] |
|
I had this issue recently on a application I'm working on as described the oderBy option was applied on the joined table on a column that even doesn't exist in it. I used the DC651 patch provided and it solved the issue, so far I haven't seen any side effect to it. |