If this is your first visit, check our documentation. To post, register or login.
Forums / Code Matters / Bug Reports / 1.5.8a Missing customer_groups field in DB

1.5.8a Missing customer_groups field in DB

Started by emmqc on 12 Apr 2023, 5:42 PM · Views: 4,429

Results 1 to 20 of 23
12 Apr 2023, 5:42 PM
#1
emmqc avatar

emmqc

New Zenner

Join Date:
Apr 2023
Location:
canada
Posts:
7
Plugin Contributions:
0

1.5.8a Missing customer_groups field in DB

New install , 1.5.8a DB miss customers_groups entry in DB

PHP Fatal error: 1146:Table 'xxx.customer_groups' doesn't exist :: SELECT count() as total FROM (SELECT cg., count(ctg.customer_id) as customer_count FROM customer_groups cg LEFT JOIN customers_to_groups ctg USING (group_id) GROUP BY cg.group_id ORDER BY group_name, group_id) countresults ==> (as called by) /xxxxxxxxxxxxx/includes/classes/split_page_results.php on line 220 <== in /includes/classes/db/mysql/query_factory.php on line 667.

Anyone can bring me a mysql code to add this to my BD plz ??
Look like the installation has missed to add customer_groups fields in DB...
Can't change an email on a customer because of that, page stuck at group and give ;

Customer Groups

WARNING: An Error occurred, please let us know! If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you entered valid data.

thank you..

12 Apr 2023, 8:18 PM
#2
swguy avatar

swguy

Administrator

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

Re: 1.5.8a Missing customer_groups field in DB

Can't repro, no idea how this happened. You can find the SQL for creating the customer_groups table in mysql_zencart.sql in zc_install/sql/install.

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.

12 Apr 2023, 8:39 PM
#3
emmqc avatar

emmqc

New Zenner

Join Date:
Apr 2023
Location:
canada
Posts:
7
Plugin Contributions:
0

Re: 1.5.8a Missing customer_groups field in DB

will look into it, thank you
btw, I do have installed another instance to try and same problem... look like this table are not created..
Ok thank you ..

12 Apr 2023, 8:43 PM
#4
emmqc avatar

emmqc

New Zenner

Join Date:
Apr 2023
Location:
canada
Posts:
7
Plugin Contributions:
0

Re: 1.5.8a Missing customer_groups field in DB

swguy:

Can't repro, no idea how this happened. You can find the SQL for creating the customer_groups table in mysql_zencart.sql in zc_install/sql/install.

I tryed to do manualy in phpmyadmin got this whit the code found on the .sql ;

CREATE TABLE customer_groups (
group_id int UNSIGNED NOT NULL AUTO_INCREMENT,
group_name varchar(191) NOT NULL,
group_comment varchar(255),
date_added timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (group_id),
UNIQUE KEY idx_groupname_zen (group_name)
);
MySQL said: Documentation

#1293 - Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

12 Apr 2023, 8:49 PM
#5
emmqc avatar

emmqc

New Zenner

Join Date:
Apr 2023
Location:
canada
Posts:
7
Plugin Contributions:
0

Re: 1.5.8a Missing customer_groups field in DB

swguy:

Can't repro, no idea how this happened. You can find the SQL for creating the customer_groups table in mysql_zencart.sql in zc_install/sql/install.

I just see that same problem whit customers_to_groups, was not created as well in the db...

Table structure for table customers_to_groups

CREATE TABLE customers_to_groups (
id int UNSIGNED NOT NULL AUTO_INCREMENT,
group_id int UNSIGNED NOT NULL,
customer_id int UNSIGNED NOT NULL,
date_added timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id),
UNIQUE KEY idx_custid_groupid_zen (customer_id, group_id),
KEY idx_groupid_custid_zen (group_id, customer_id)
);

12 Apr 2023, 8:54 PM
#6
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: 1.5.8a Missing customer_groups field in DB

What version of MySQL is being run? If you go to the site's admin's Tools :: Server/Version Info, that tool will tell you/

12 Apr 2023, 9:05 PM
#7
emmqc avatar

emmqc

New Zenner

Join Date:
Apr 2023
Location:
canada
Posts:
7
Plugin Contributions:
0

Re: 1.5.8a Missing customer_groups field in DB

lat9:

What version of MySQL is being run? If you go to the site's admin's Tools :: Server/Version Info, that tool will tell you/

MySQL 5.5.68-MariaDB

12 Apr 2023, 10:02 PM
#8
carlwhat avatar

carlwhat

zennedOut

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

Re: 1.5.8a Missing customer_groups field in DB

emmqc:

MySQL 5.5.68-MariaDB

you will need to upgrade your mysql version.

see this stackoverflow post.

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

13 Apr 2023, 12:14 AM
#9
swguy avatar

swguy

Administrator

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

Re: 1.5.8a Missing customer_groups field in DB

Yep. Zen Cart v1.5.8 requires MySQL 5.7.8+ or MariaDB 10.2.7+ (where “+” means “or newer”)

https://docs.zen-cart.com/user/first_steps/server_requirements/#mysql-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.

13 Apr 2023, 12:15 AM
#10
emmqc avatar

emmqc

New Zenner

Join Date:
Apr 2023
Location:
canada
Posts:
7
Plugin Contributions:
0

Re: 1.5.8a Missing customer_groups field in DB

chezz .. ok thank you..

29 Sep 2023, 11:39 PM
#11
lance_turner avatar

lance_turner

New Zenner

Join Date:
Jul 2016
Posts:
61
Plugin Contributions:
0

Re: 1.5.8a Missing customer_groups field in DB

Have noticed this as well on my recent 1.5.8a install, and my server is running MySQL 10.3.39...

--> PHP Fatal error: 1146:Table 'ledsales_zc_158.6d6_customer_groups' doesn't exist :: SELECT count() as total FROM (SELECT cg., count(ctg.customer_id) as customer_count FROM 6d6_customer_groups cg LEFT JOIN 6d6_customers_to_groups ctg USING (group_id) GROUP BY cg.group_id ORDER BY group_name, group_id) countresults ==> (as called by) /[admin]/includes/classes/split_page_results.php on line 220 <== in /includes/classes/db/mysql/query_factory.php on line 667.

29 Sep 2023, 11:49 PM
#12
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: 1.5.8a Missing customer_groups field in DB

Lance Turner:

Have noticed this as well on my recent 1.5.8a install, and my server is running MySQL 10.3.39...

--> PHP Fatal error: 1146:Table 'ledsales_zc_158.6d6_customer_groups' doesn't exist :: SELECT count() as total FROM (SELECT cg., count(ctg.customer_id) as customer_count FROM 6d6_customer_groups cg LEFT JOIN 6d6_customers_to_groups ctg USING (group_id) GROUP BY cg.group_id ORDER BY group_name, group_id) countresults ==> (as called by) /[admin]/includes/classes/split_page_results.php on line 220 <== in /includes/classes/db/mysql/query_factory.php on line 667.
See the posts above in this thread, starting with post #7.

Short answer: Your site's MySQL server version requires update.

30 Sep 2023, 1:08 AM
#13
lance_turner avatar

lance_turner

New Zenner

Join Date:
Jul 2016
Posts:
61
Plugin Contributions:
0

Re: 1.5.8a Missing customer_groups field in DB

Post says it needs MariaDB 10.2.7 or newer, mine is MariaDB 10.3.39, which would be newer would it not?

30 Sep 2023, 3:44 AM
#14
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: 1.5.8a Missing customer_groups field in DB

Did you try running the two SQL table-inserts identified in posts #4 and #5 in this thread (either via phpMyAdmin or the admins Tools :: Install SQL Patches)?

Was the site a fresh install or an upgrade? Are there any zcInstall*.log files in the site's /logs sub-directory?

30 Sep 2023, 4:51 AM
#15
lance_turner avatar

lance_turner

New Zenner

Join Date:
Jul 2016
Posts:
61
Plugin Contributions:
0

Re: 1.5.8a Missing customer_groups field in DB

No, haven't done those yet, just wondered why the table was missing, seems an odd thing to happen. It was an update from 1.5.7, but the upgrade script ran ok, no issues.

30 Sep 2023, 11:52 AM
#16
lance_turner avatar

lance_turner

New Zenner

Join Date:
Jul 2016
Posts:
61
Plugin Contributions:
0

Re: 1.5.8a Missing customer_groups field in DB

Ok, ran those and all worked fine, thanks.

30 Sep 2023, 12:04 PM
#17
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: 1.5.8a Missing customer_groups field in DB

Lance Turner:

Ok, ran those and all worked fine, thanks.
Were there any zcInstall*.log files generated?

How about the database's upgrade_exceptions table? Any records in there on/around the time of the zc158 upgrade?

1 Oct 2023, 12:02 AM
#18
lance_turner avatar

lance_turner

New Zenner

Join Date:
Jul 2016
Posts:
61
Plugin Contributions:
0

Re: 1.5.8a Missing customer_groups field in DB

The upgrade exceptions table had two for this upgrade, both the same:

1293: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

Logs autodelete after 7 days, so no log file unfortunately.

1 Oct 2023, 12:37 PM
#19
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: 1.5.8a Missing customer_groups field in DB

Lance Turner:

The upgrade exceptions table had two for this upgrade, both the same:

1293: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

Logs autodelete after 7 days, so no log file unfortunately.
From that saved 'exception', it appears that the version of MySQL that was in use when you upgraded was less than that with which you're running with now.

That's the same message that the OP received, running MySQL 5.5.68-MariaDB.

1 Oct 2023, 1:08 PM
#20
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: 1.5.8a Missing customer_groups field in DB

lat9:

From that saved 'exception', it appears that the version of MySQL that was in use when you upgraded was less than that with which you're running with now.

That's the same message that the OP received, running MySQL 5.5.68-MariaDB.
FWIW, I've created an issue on the Zen Cart GitHub (https://github.com/zencart/zencart/issues/6002) so that, hopefully, this and other issues of the like will be corrected in the future.