use mysql (pdo) database driver in system config
save an article
Saved article + Reordering of existing articles.
Save failed with the following error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(ORDER BY `ordering`) AS new_ordering,`id` AS `pk__0` FROM mmg7m_content WHERE c' at line 3
4.0dev
Labels |
Added:
?
|
Category | ⇒ | com_content |
Status | New | ⇒ | Information Required |
Build | staging | ⇒ | 4.0-dev |
Can do that later. for now:
The problem is that MysqlQuery has no method selectRowNumber (which is called when we reorder in Table), so it uses DatabaseQuery::selectRowNumber()
and ROW_NUMBER() OVER
causes the mysql error...
https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/database/query.php#L1853
:sigh: Why are we putting code in a base class that isn't database agnostic?
4.0 wrong sync ?
No. 4.0 uses the Framework's Database package. There are architectural differences in the two packages. So in this case the problem is the PDO MySQL query class doesn't extend the MySQLi query class so the method needs to be copied in the appropriate repo.
But that still doesn't address the architectural problem of the concrete implementation in the root query class not being generic/usable for all drivers. If this can't be done in a reusable way then it needs to be made abstract, which sounds like is the case.
Ultimately most of the problem boils down to every change in the CMS repo for the database package never got ported to the Framework (bug fixes or features). So we've had to do a scramble and try to merge years of PRs into the right repo and clearly some stuff didn't get ported over 100% either because it was done in a mad rush or the architectural differences weren't accounted for.
Fortunately 4.x should manage less database drivers
p.s.
you hit the nail
Should be fixed after 09347f4 (more specifically joomla-framework/database@bd0e71e from upstream)
When trying to save a testarticle I got below mentioned error. I do not know how to fix this in the Joomla 4.0 environment. Database is setvto MySQL(PDO)because that's the only setting I can do during installation.
Error
[code]Save failed with the following error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(ORDER BY ordering
) AS new_ordering,id
AS pk__0
FROM si51x_content WHERE c' at line 3[/code]
A few minutes ago I tested the latest 4.0-dev branch and it works on mysql 5.7 by PDO.
You have a link to the latest dev. version you used?
https://github.com/joomla/joomla-cms/archive/4.0-dev.zip should be the latest version.
thanks, will try that one.
Labels |
Added:
J4 Issue
|
Status | Information Required | ⇒ | Discussion |
I am closing this at this time as there has been a lot of work on this and related issues since this was last updated. It can always be re-opened if there is still an issue
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-04-10 12:32:13 |
Closed_By | ⇒ | brianteeman |
In the ExceptionHandler can you add
if ($error instanceof \Joomla\Database\Exception\ExecutionFailureException) { echo $error->getQuery(); }
line? That'll at least print out the query that it's having issues with instead of trying to blindly chase this one.