mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
ORM doesn't recognize Amazon RDS MariaDB as a MySQL-compatible DB #5860
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @octaharon on GitHub (Jan 25, 2018).
Originally assigned to: @Ocramius on GitHub.
I have a query with something like this:
AND c.date > DATE_SUB( NOW() ,INTERVAL 24 HOUR)and it works perfectly on local MariaDB 10.1
but when I switch to my RDS instance instead (without changing any other configuration), the query got invalidated by orm lexer:
I've run the query manually so I'm sure it's not a DB error itself, but with the query parser, and the only idea that comes to my mind is that it somehow prohibits those functions because they're MySQL-specific.
Can I specify a driver manually or somehow else work around this?
@Ocramius commented on GitHub (Jan 25, 2018):
The query parser is not platform-sensitive. Can you reproduce the crash in
isolation (in a test)?
On 25 Jan 2018 17:50, "Alexander Uskov" notifications@github.com wrote:
I have a query with something like this:
AND c.date > DATE_SUB( NOW() ,INTERVAL 24 HOUR)
and it works perfectly on local MariaDB 10.1
but when I switch to my RDS instance instead (without changing any other
configuration), the query got invalidated by orm lexer:
Doctrine\ORM\Query\QueryException::syntaxError('line 0, col 209: Error:
Expected known function, got 'NOW'', instance of Doctrine\ORM\Query
QueryException)
I've run the query manually so I'm sure it's not a DB error itself, but
with the query parser, and the only idea that comes to my mind is that it
somehow prohibits those functions because they're MySQL-specific.
Can I specify a driver manually or somehow else work around this?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/doctrine/doctrine2/issues/7010, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJakF2Qd0OCJnLHptAiUc4xFhYWJENKks5tOLC7gaJpZM4RtJv6
.
@octaharon commented on GitHub (Jan 25, 2018):
How much of isolation do I need to have? The query is a first-level method of a relevant repository, and according to the stack trace it's being called directly from Symfony controller entrypoint without any prior DDL/DML queries. What I do is just replace "parameters.yml", which literally contains only host/port/user/password, and I don't have any test environment for PHP right now
@Ocramius commented on GitHub (Jan 26, 2018):
Can you get a full trace of the exception above?
@octaharon commented on GitHub (Jan 26, 2018):
And the code is
And my versions are
Settings:
Also I've tested it against RDS MySQL 5.7.19 instance - works fine. So it's clearly particular MariaDB issue
@Ocramius commented on GitHub (Jan 26, 2018):
Looks more like a query parsing issue to me. Do you have the full DQL
string?
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
On Fri, Jan 26, 2018 at 12:49 PM, Alexander Uskov notifications@github.com
wrote:
@octaharon commented on GitHub (Jan 26, 2018):
I've pasted my code in the previous reply, not sure what you mean by "full DQL string"
@Majkl578 commented on GitHub (Jan 27, 2018):
NOW()is not a valid DQL function so it's correct that the parser does not recognize it. DQL only providesCURRENT_DATE/CURRENT_TIME/CURRENT_TIMESTAMP, see https://doctrine-orm.readthedocs.io/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#id3.@octaharon commented on GitHub (Jan 27, 2018):
Seems reasonable, but then how it works on MySQL instance?
@Ocramius commented on GitHub (Jan 28, 2018):
What could be is that one of the dependencies you use is detecting the
platform and manual registering custom DQL queries. Try dumping
EntityManager#getConfiguration()on both systems.On 27 Jan 2018 18:59, "Alexander Uskov" notifications@github.com wrote:
@kojidev commented on GitHub (Mar 11, 2019):
@Ocramius What about issues like that, it sits here for a year now, author apparently forgot about it.
You wrote that it is likely a third party library. Does the issue like that stays here until someone try to reproduce it (which is unlikely to be the same what OP experienced)?
P.S. Is
invalidlabel for issues that are unlikely a doctrine's problem?@Ocramius commented on GitHub (Mar 11, 2019):
@kojiDev if the problem is real and persistent, they stay open. In this case, I'd close it as per @Majkl578's review above.