Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance: Database : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB #35949

Closed
aminweb2 opened this issue Oct 30, 2021 · 7 comments
Assignees

Comments

@aminweb2
Copy link

after upadated joomla 4.0.3 to 4.0.4 , display a error in Maintenance Database:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' AND null = 'NO'' at line 1

System information (as much as possible)

Joomla 4.0.4
Database Version 10.3.31-MariaDB-0ubuntu0.20.04.1
Database Type mysql
PHP Version 7.4.22
Web Server LiteSpeed

@richard67
Copy link
Member

@aminweb2 Do you have any 3rd party extensions installed?

@aminweb2
Copy link
Author

@richard67 of course, but it is not matter. how can find where happen this error?

@richard67
Copy link
Member

richard67 commented Oct 30, 2021

@richard67 of course, but it is not matter.

@aminweb2 I would not ask if it does not matter. In Joomla 4 the database checker checks also for 3rd party extensions.

how can find where happen this error?

There is no easy way for you. If you switch on debug in global configuration you will only find out that it fails in the database checker. But you can give it a try. Switching on debug should cause a stack trace being shown. If so, make a screenshot and post here.

And please let me know which 3rd party extensions you have installed and if possible, if they have update SQL scripts.

And if the database page shows not only the error message, make a screenshot and post it here, too.

Thanks in advance.

@richard67
Copy link
Member

richard67 commented Oct 31, 2021

@aminweb2 I think know where the error happens, but I need some information from you to find what causes it.

What I knowe it that the error is caused by either an ALTER TABLE <tableName> MODIFY <columnName>... or an ALTER TABLE <tableName> CHANGE <columnName>... SQL statement in an update SQL script, with <tableName> being the name of the table and v` being the name of the column to be modified.

It is very likely not an update SQL script of the core but one of a 3rd party extension.

There is either a syntax error in that statement or there is wrong names quoting used for the table or the column name, or a table or column name is a reserved word in SQL and has no names quoting ("`" on MySQL and MariaDB).

You could help me with finding the exact mistake in that SQL script so that I can try to make a fix for the database checker.

Do you have access to the file system of your Joomla installation? If so, could you do following?

  • Search for all files having a file name extension ".sql" in all sub-folders of your Joomla installation and copy them to an empty temporary folder, keeping the folder structure. E.g. if a file administrator/components/com_foobar/sql/updates/somefilename.sql is found, copy it to <tempFolder>/administrator/components/com_foobar/sql/updates/somefilename.sql, with <tempFolder> being the previously mentioned temporary folder, and so on.
  • When all files have been copied, zip (or rar or whatever you have) the temporary folder and send me the zip (or rar) file by email.

Use following email address, replacing the <at>by @: admin<at>richard-fath.de.

Thanks in advance.

@richard67
Copy link
Member

@aminweb2 Or maybe a faster check first: Can you change the code line here https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Schema/ChangeItem.php#L205 in your installation by editing the file?

If so, change catch (\RuntimeException $e) to catch (\Exception $e) and save the change file (and if necessary upload it if you had to download it for editing).

Then go back to the database checker and make a screenshot and post it here.

Thanks in advance.

@richard67
Copy link
Member

@aminweb2 Forget it, no need for you to help me. I have found the error and will provide a fix soon.

@richard67
Copy link
Member

Closing as having a pull request. Please test #35951 . Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants