If this is your first visit, check our documentation. To post, register or login.
Forums / Upgrading Your Zen Cart / Upgrading to 2.x.x / v2.0.0 syntax error updating zen_project_version_history with MariaDB

v2.0.0 syntax error updating zen_project_version_history with MariaDB

Started by oldngrey on 9 Apr 2024, 5:31 AM · Views: 1,195

Results 1 to 8 of 8
9 Apr 2024, 5:31 AM
#1
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
433
Plugin Contributions:
0

Post #1 by oldngrey

Test installation, ZC 2.0.0, no plugins PHP 8.2 and 8.3, importing database from ZC158a.

When performing a test update to v2.0.0 by importing my v1.5.8a database from production
I receive the error

[08-Apr-2024 06:15:40 UTC] MySQL error 1064 encountered during zc_install:
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 '' at line 1
INSERT INTO zen_project_version_history (project_version_key, project_version_major, project_version_minor, project_version_patch, project_version_date_applied, project_version_comment)

The command in question is from lines 282 - 284 in "zc_install\sql\updates\mysql_upgrade_zencart_200.sql" ```
INSERT INTO project_version_history (project_version_key, project_version_major, project_version_minor, project_version_patch, project_version_date_applied, project_version_comment)
SELECT project_version_key, project_version_major, project_version_minor, project_version_patch1 as project_version_patch, project_version_date_applied, project_version_comment
FROM project_version;


If I run the SQL command  from admin | Install SQL patches against the zc158a database before I upgrade with zc_install it works.
If I run the command in PhpMyAdmin it works.

It doesn't matter whether I use a database prefix or not.
I have checked the script for non-ansi chars and reentered the statement. 

I have to assume that it is some obscure MariaDB bug.

OldNGrey
ZC222 PHP 8.4.27
MySQL 11.8.5-MariaDB

10 Apr 2024, 12:50 AM
#2
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Post #2 by carlwhat

OldNGrey:

...
I have to assume that it is some obscure MariaDB bug.

i just think that is a bad assumption...

it works from phpMyAdmin; it works from the install mysql patch; it does not work from the installer...

its rather curious...

it happened to me as well. but i have not been able to figure it out as of yet... i may never... other fish to fry...

but i'm doubtful on your assumption.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

29 Jul 2024, 4:37 PM
#3
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

Post #3 by gothstone

So I'm just getting around to trying 2.0.1 on my dev site and got basicaly the same:

[29-Jul-2024 16:10:44 UTC] MySQL error 1064 encountered during zc_install:
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 '' at line 1
INSERT INTO project_version_history (project_version_key, project_version_major, project_version_minor, project_version_patch, project_version_date_applied, project_version_comment)
---------------

Zen 1.5.8a -> 2.0.1
php 8.3.9
Apache 2.4.62
MariaDB 10.11

Happy to provide any info that will help. Below are the rest of my upgrade exceptions:

(328, '/home/pcs/dev/zc_install/sql/updates/mysql_upgrade_zencart_200.sql', 'Cannot CHANGE column products_length because it does not exist.', '2024-07-29 16:10:41', NULL),
(329, '/home/pcs/dev/zc_install/sql/updates/mysql_upgrade_zencart_200.sql', 'Cannot CHANGE column products_width because it does not exist.', '2024-07-29 16:10:41', NULL),
(330, '/home/pcs/dev/zc_install/sql/updates/mysql_upgrade_zencart_200.sql', 'Cannot CHANGE column products_height because it does not exist.', '2024-07-29 16:10:41', NULL),
(331, '/home/pcs/dev/zc_install/sql/updates/mysql_upgrade_zencart_200.sql', 'Cannot CHANGE column products_ready_to_ship because it does not exist.', '2024-07-29 16:10:41', NULL),
(332, '/home/pcs/dev/zc_install/sql/updates/mysql_upgrade_zencart_200.sql', 'Cannot CHANGE column product_ships_in_own_box because it does not exist.', '2024-07-29 16:10:41', NULL),
(333, '/home/pcs/dev/zc_install/sql/updates/mysql_upgrade_zencart_200.sql', 'Cannot CHANGE column customers_whole because it does not exist.', '2024-07-29 16:10:41', NULL),
(334, '', '1064: 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 \'\' at line 1', '2024-07-29 16:10:44', 'INSERT INTO project_version_history (project_version_key, project_version_major, project_version_minor, project_version_patch, project_version_date_applied, project_version_comment)');

carlwhat:

i just think that is a bad assumption...

it works from phpMyAdmin; it works from the install mysql patch; it does not work from the installer...

its rather curious...

it happened to me as well. but i have not been able to figure it out as of yet... i may never... other fish to fry...

but i'm doubtful on your assumption.

2 + 2 = 5 for extremely large values of 2

Pez Collectors Store •••••••• My Plugins List

29 Jul 2024, 6:08 PM
#4
brittainmark avatar

brittainmark

Totally Zenned

Join Date:
Apr 2009
Posts:
509
Plugin Contributions:
1

Post #4 by brittainmark

This was an issue with zc_database_installer. It was fixed in https://github.com/zencart/zencart/pull/6594 I don't think it has been back ported to 2.0

Mark Brittain
http:\innerlightcrystals.co.uk\sales\

31 Jul 2024, 7:57 PM
#5
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Post #5 by swguy

** Updated: The technique I was using to rebuild the lost records isn't correct; it's best just to leave this.

This issue applies to Zen Cart 2.0.0 and 2.0.1; it will be fixed in Zen Cart 2.1.0 and will be backported to Zen Cart 2.0.2 we do a build of that version.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

1 Aug 2024, 4:48 PM
#6
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

Post #6 by gothstone

Thank all! I have already reimported sql and rerun zc_install with the newer version. That works well. As for the rest of the upgrade exceptions, they appear inevitable. SQL tried to modify a column, then add it. I think one or the other would always fail and its probably intentional.

2 + 2 = 5 for extremely large values of 2

Pez Collectors Store •••••••• My Plugins List

1 Aug 2024, 4:57 PM
#7
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Post #7 by swguy

Did you check project_version_history to ensure the 2.0 records were there? They weren't when I tested it.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

1 Aug 2024, 6:38 PM
#8
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

Post #8 by gothstone

Ah, thank you! I missed that while the new version didn't throw the first error it also didn't inter the data. All better now. :)

2 + 2 = 5 for extremely large values of 2

Pez Collectors Store •••••••• My Plugins List