I have a doctrine program that works great on my development machine but when I move it to my server, it stops working. The main differences between the two machines are one is windows and running mySql 5.5 and the other is linux running MySQL 5.1.
I have pinpointed the failure to the line $this->entityManager->createNativeQuery($dql, $rsm) as the log statement afterwords never occurs.
get_log()->logDebug("query: ".$dql);
$rsm = new ResultSetMappingBuilder($this->entityManager);
get_log()->logDebug("ResultSetMappingBuilder");
var_dump($rsm);
$rsm->addRootEntityFromClassMetadata('D_Post', 'f');
get_log()->logDebug("addRootEntityFromClassMetadata");
$query = $this->entityManager->createNativeQuery($dql, $rsm);
get_log()->logDebug("createNativeQuery");
The sql that is running is
SELECT * FROM (SELECT DISTINCT f.ID,f.post_title, f.post_date, f.post_type,
f.views_count
as score FROM wp_vsideviewpostfilter f ) t ORDER BY t.score DESC,t.post_title
DESC LIMIT 0,10
I can execute the SQL code on the linux machine via a query runner and it executes correctly.
Any ideas as to why this program is failing on the other server?
In my case, the issue was with one of the mappings. Doctrine could not find the D_Post entity mapping. The path to the mapping had a mixture of / and \ in it which is allowed in windows but not in linux.