Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New Error - Due to Mysql Update?


Mort-lemur

Recommended Posts

Posted

Interesting problem today, - Two Identical sites running on 2.3.4 with identical database structure one site is on mysql 5.5.47-cll the other is running on mysql 5.6.28

 

The second site today went whitepage with the following error:

 

 

1364 - Field 'hostname' doesn't have a default value

insert into whos_online (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url) values ('0', 'Guest', '', '106.221.137.52', '1453131130', '1453131130', '/')

[TEP STOP]

 

To get the site working again I had to make 3 fields (hostname, http_referer and user_agent) in the whos-online table have a null default value (previously a default of "None"

 

Anyone else seen this or can explain?

 

Many Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Posted

I've seen this. Newer versions of MySQL are stricter about having a default value if no value is inserted. You can correct this by adding a default value to the field (as you did) or by making all of the SQL insert/modify commands insert a value for any field that does not have a default.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Posted

@@kymation Thanks for confirming Jim - could this be a 2.3.4 bug?

 

Also am I likely to encounter other errors that I have not yet found due to defaults being empty?

 

Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Posted

Older versions of osCommerce had this problem. I think it's only found in Addons now. But yes, it's possible that some of your code could have this error. You could look at all of the SQL update/append statements in your code, or you could test everything and look for error messages. Either way works.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Posted

@@kymation Thanks Jim - I thought my whos_online table was stock osc 2.3.4 - maybe it has some legacy bits left in there from mods I have done - I wil check

 

Many Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

  • 3 months later...
Posted

There is also another problem can appear if you use a requestlike this

select distinct ........ order by rand(), products_date_added desc

Mysql7 doesnt allow that and you can change by this.

select distinct ........ order by rand(),

or

select  ........ order by rand(), products_date_added desc

i haven't solution for this moment th have the same initial request.


Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...