No Code Attached Yet
avatar Globulopolis
Globulopolis
8 Mar 2022

Steps to reproduce the issue

Install component with table updates.
Sample file https://github.com/Globulopolis/Jcomments-4/blob/master/component/administrator/install/sql/updates/mysql/4.0.16.sql

Expected result

No Problems

Actual result

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

...the wrong type or attributes

System information (as much as possible)

Joomla 4.1
MariaDB 10.4.22
PHP 7.4.13

Additional comments

The Update structure button will not help here.

image

avatar Globulopolis Globulopolis - open - 8 Mar 2022
avatar joomla-cms-bot joomla-cms-bot - change - 8 Mar 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 Mar 2022
avatar Globulopolis Globulopolis - change - 8 Mar 2022
Title
[4.1] Maintenance: Database - wrong sql types, error your SQL syntax?
[4.1] Maintenance: Database - wrong sql types, error in your SQL syntax?
avatar Globulopolis Globulopolis - edited - 8 Mar 2022
avatar richard67
richard67 - comment - 9 Mar 2022

@Globulopolis hat's a known limitation of the database checker which results in a false alarm. See #36363 . The solution can be found here: #36363 (comment) , i.e. ask them to change their SQL to:

ALTER TABLE `#__jcomments_subscriptions` CHANGE `hash` `hash` CHAR(32) NOT NULL DEFAULT '';
ALTER TABLE `#__jcomments_subscriptions` CHANGE `source` `source` VARCHAR(100) NOT NULL DEFAULT '';

Let me know if this works for you and if they accept that change. If so, I suggest to close this issue.

avatar richard67
richard67 - comment - 9 Mar 2022

P.S.: For the long term I'm working on a fix, but in the mean time please ask them to change their update SQL as suggested above,

avatar Globulopolis Globulopolis - change - 9 Mar 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-03-09 09:07:45
Closed_By Globulopolis
avatar Globulopolis Globulopolis - close - 9 Mar 2022
avatar Globulopolis
Globulopolis - comment - 9 Mar 2022

Thanks for help @richard67
Suggested solution at #36363 (comment) fixed the problem.

avatar richard67
richard67 - comment - 9 Mar 2022

@Globulopolis You should also check the comments after the one you have linked, e.g. #36363 (comment) .

I.e. in your case it should be like I suggested above, without the "COLUMN" key word:

ALTER TABLE `#__jcomments_subscriptions` CHANGE `hash` `hash` CHAR(32) NOT NULL DEFAULT '';
ALTER TABLE `#__jcomments_subscriptions` CHANGE `source` `source` VARCHAR(100) NOT NULL DEFAULT '';
avatar Globulopolis
Globulopolis - comment - 9 Mar 2022

@richard67 yes, I split the code and test it. All fine. No errors now.

Add a Comment

Login with GitHub to post a comment