DDC-1385: INDEX BY doesn't work for selects with scalars only #2005

Closed
doctrinebot opened this Issue Sep 21, 2011 · 5 comments

2 participants

@doctrinebot

Jira issue originally created by user strygin:

By scalars-only-selects I mean this:

SELECT c.id, c.name FROM GLocalityBundle:Country c  INDEX by c.id 

The result won't be indexed by c.id, as opposites to this:

SELECT c FROM GLocalityBundle:Country c  INDEX by c.id 

Assuming that GLocalityBundle:Country has several hunders of fields, and you need only two of them, this is very disappointing :(

After diving in the code, due to rigorous separation of entities on objects and scalars, it looks practically impossible even to implement this feature :(
What is this? Bad design?

@doctrinebot

Comment created by @beberlei:

I agree it seems very complex to implement for the Object and ArrayHydrator, however it should be very easy for the getScalarResult() hydrator.

Even more I think there is a general bug with INDEX BY and scalars in Object and ArrayHydrator that has to be evaluated.

@doctrinebot

Comment created by @beberlei:

This PR will fix this issue #151, it is scheduled for 2.2

@doctrinebot

Comment created by @beberlei:

This is fixed in master

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot

Comment created by deatheriam:

This behavior has not changed in the latest 2.2.1. getArrayResult returns an indexed result. getScalarResult returns zero based result. Do I need to create a separate ticket for that issue?

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.2 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment