Closed (duplicate)
Project:
Entity API
Version:
7.x-1.0-rc3
Component:
Core integration
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Mar 2013 at 03:49 UTC
Updated:
29 May 2013 at 15:32 UTC
I have a problem related to the collecting fields module, but in the way to solve it I became confused about a part of the query, I'm using MSSQL as DB and the error points to: base.revision_id = revision.revision_id AS default_revision, what this part of the query is indeed to do in a SELECT statement? the database doesn't understand so I removed the part and everything goes OK but it belongs to the "protected function buildQuery" so, it should be use by lots of different functions and the change I did could crash my site.
Please bring me a hand with this. Thank you.
Comments
Comment #1
pabloroberto27 commentedComment #2
rob_johnston commentedI have the same problem that occurs with MSSQL but not mySQL. It can be seen when creating a bean as written in #1917732: Incorrect syntax near '=' when creating a bean on MS SQL Server.
Comment #3
rob_johnston commentedComment #4
pabloroberto27 commentedMySQL accepts this kind of syntax? I have never seen an assignment operator in a SELECT clause, neither in MSSQL nor in MySQL.
Comment #5
rob_johnston commented¡Yo tampoco! I have never seen it, but apparently it is possible because I have run it on MySQL and it produces a column filled with the number 1. I don't know if it will work for every case, but for my bean creation problem I bet the following line should be changed from an "addExpression" to a "condition" (currently line 174 of entity.controller.inc):
And if the column is required for something, add this
This approach fails if a row with a value of zero in the $this->defaultRevisionKey column is required, because they will not be present.
I should say that I'm not at work right now, so I'm writing this without trying any of it.
Comment #6
rob_johnston commentedHi Pablo,
I think I found the solution! Last October, another person posted a patch here:
#1809346: Entity revisions support not working in SQL Server
It looks like it will work for me. Why don't we test that out and if it works for you, mark this issue as a duplicate of that issue and comment that you have reviewed his patch and that it works.
Comment #7
pabloroberto27 commentedThanks a lot Rob,
As you say tha patch works very well so I'm going to close this ticket.
Have a nice day!