Advertisement:

Author Topic: Updating problem  (Read 2686 times)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 72,350
Re: Updating problem
« Reply #20 on: May 11, 2020, 09:27:27 AM »

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,539
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Updating problem
« Reply #21 on: May 11, 2020, 09:30:49 AM »
So the old default above   eventDate date NOT NULL default '0001-01-01',
Won't work? And needs to be changed?
I just checked 2.1 and uses the same default date.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 72,350
Re: Updating problem
« Reply #22 on: May 11, 2020, 09:58:13 AM »
The birthdate was changed in the members table to 1004-01-01, I assumed this had been changed too for similar reasons (but I stopped caring about the calendar a long time ago)

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,539
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Updating problem
« Reply #23 on: May 11, 2020, 10:38:05 AM »
Ah, you are right. I was doing a quick search on .sql files the code I was looking at was 1.1 upgrade part.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline PD3

  • Semi-Newbie
  • *
  • Posts: 38
Re: Updating problem
« Reply #24 on: May 11, 2020, 10:55:40 AM »
Tried deleting again and running:

Code: [Select]
CREATE TABLE smf_calendar_holidays (
  ID_HOLIDAY smallint(5) unsigned NOT NULL auto_increment,
  eventDate date NOT NULL default '1004-01-01',
  title varchar(30) NOT NULL default '',
  PRIMARY KEY (ID_HOLIDAY),
  KEY eventDate (eventDate)
) ENGINE=MyISAM;

And that brings up this on the My Sql:

Code: [Select]
MySQL returned an empty result set (i.e. zero rows). (Query took 0.0020 seconds.)
CREATE TABLE smf_calendar_holidays ( ID_HOLIDAY smallint(5) unsigned NOT NULL auto_increment, eventDate date NOT NULL default '1004-01-01', title varchar(30) NOT NULL default '', PRIMARY KEY (ID_HOLIDAY), KEY eventDate (eventDate) ) ENGINE=MyISAM

and this on the update.php:

Executing database changes
Please be patient - this may take some time on large forums. The time elapsed increments from the server to show progress is being made!
Executing upgrade script 1 of 3.
Executing: "Updating holidays and calendar..." (5 of 19 - of this script)
Error!
Incorrect date value: '0000-00-00' for column 'eventDate' at row 1

Online shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 2,075
    • sbulen on GitHub
Re: Updating problem
« Reply #25 on: May 11, 2020, 11:05:02 AM »
Turning strict mode off resolves this issue.

You should leave the original logic, the only change needed is to disable strict mode.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline PD3

  • Semi-Newbie
  • *
  • Posts: 38
Re: Updating problem
« Reply #26 on: May 11, 2020, 11:13:18 AM »
Turning strict mode off resolves this issue.

You should leave the original logic, the only change needed is to disable strict mode.

Thanks for the reply, but the server admins say strict mode is not enabled

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 72,350
Re: Updating problem
« Reply #27 on: May 11, 2020, 11:16:47 AM »
Ask them to turn off NO_ZERO_DATE mode.

Offline PD3

  • Semi-Newbie
  • *
  • Posts: 38
Re: Updating problem
« Reply #28 on: May 11, 2020, 11:48:06 AM »
Ask them to turn off NO_ZERO_DATE mode.

They tell me because it's a shared environment they're not prepared to mod the PHP

Online shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 2,075
    • sbulen on GitHub
Re: Updating problem
« Reply #29 on: May 11, 2020, 11:50:00 AM »
I would set it globally to '' at the server level.

smf1.1 provided the capability to address this by adding
Code: [Select]
$mysql_set_mode = true;to Settings.php.  That works, too. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Online shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 2,075
    • sbulen on GitHub
Re: Updating problem
« Reply #30 on: May 11, 2020, 11:50:58 AM »
They tell me because it's a shared environment they're not prepared to mod the PHP

It's not a php setting, it's a mysql setting.

But then try the $mysql_set_mode suggestion from above.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,467
  • Gender: Male
    • i30 Owners Club
Re: Updating problem
« Reply #31 on: May 11, 2020, 12:16:03 PM »
I'd edit the update/upgrade script and remove the restriction from the mysql SESSION variable.

https://github.com/ShamblesX/SMF-Tools/blob/master/RemoveModeFromMysqlSession.php

Code: [Select]
RemoveModeFromMysqlSession ( 'NO_ZERO_DATE' );
or

Code: [Select]
RemoveModeFromMysqlSession ( 'STRICT_TRANS_TABLES' );

Offline PD3

  • Semi-Newbie
  • *
  • Posts: 38
Re: Updating problem
« Reply #32 on: May 11, 2020, 12:34:25 PM »
I'd edit the update/upgrade script and remove the restriction from the mysql SESSION variable.

https://github.com/ShamblesX/SMF-Tools/blob/master/RemoveModeFromMysqlSession.php

Code: [Select]
RemoveModeFromMysqlSession ( 'NO_ZERO_DATE' );
or

Code: [Select]
RemoveModeFromMysqlSession ( 'STRICT_TRANS_TABLES' );

Thanks for the reply. Where do I run that query, on the root_smf structure? I'm a real noob at this, sorry.

Offline PD3

  • Semi-Newbie
  • *
  • Posts: 38
Re: Updating problem
« Reply #33 on: May 11, 2020, 12:37:49 PM »
They tell me because it's a shared environment they're not prepared to mod the PHP

It's not a php setting, it's a mysql setting.

But then try the $mysql_set_mode suggestion from above.

Error
Static analysis:

4 errors were found during analysis.

Unexpected character. (near "$" at position 0)
Unexpected beginning of statement. (near "$" at position 0)
Unexpected beginning of statement. (near "mysql_set_mode" at position 1)
Unexpected beginning of statement. (near "true" at position 18)
SQL query:

$mysql_set_mode = true

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$mysql_set_mode = true' at line 1

Offline doug_ips

  • Full Member
  • ***
  • Posts: 468
Re: Updating problem
« Reply #34 on: May 11, 2020, 12:47:23 PM »
I'd edit the update/upgrade script and remove the restriction from the mysql SESSION variable.

https://github.com/ShamblesX/SMF-Tools/blob/master/RemoveModeFromMysqlSession.php

Code: [Select]
RemoveModeFromMysqlSession ( 'NO_ZERO_DATE' );
or

Code: [Select]
RemoveModeFromMysqlSession ( 'STRICT_TRANS_TABLES' );

Thanks for the reply. Where do I run that query, on the root_smf structure? I'm a real noob at this, sorry.

It is not a query. It is an edit to the upgrade.php file.

They tell me because it's a shared environment they're not prepared to mod the PHP

It's not a php setting, it's a mysql setting.

But then try the $mysql_set_mode suggestion from above.

Error
Static analysis:

4 errors were found during analysis.

Unexpected character. (near "$" at position 0)
Unexpected beginning of statement. (near "$" at position 0)
Unexpected beginning of statement. (near "mysql_set_mode" at position 1)
Unexpected beginning of statement. (near "true" at position 18)
SQL query:

$mysql_set_mode = true

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$mysql_set_mode = true' at line 1

Did you enter the code posted by shawnb61 at your Settings.php file correctly?

Online shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 2,075
    • sbulen on GitHub
Re: Updating problem
« Reply #35 on: May 11, 2020, 01:54:00 PM »
Sorry, forgot the semicolon:
Code: [Select]
$mysql_set_mode = true;
 ::)
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline PD3

  • Semi-Newbie
  • *
  • Posts: 38
Re: Updating problem
« Reply #36 on: May 11, 2020, 02:59:13 PM »
I'd edit the update/upgrade script and remove the restriction from the mysql SESSION variable.

https://github.com/ShamblesX/SMF-Tools/blob/master/RemoveModeFromMysqlSession.php

Code: [Select]
RemoveModeFromMysqlSession ( 'NO_ZERO_DATE' );
or

Code: [Select]
RemoveModeFromMysqlSession ( 'STRICT_TRANS_TABLES' );

Thanks for the reply. Where do I run that query, on the root_smf structure? I'm a real noob at this, sorry.

It is not a query. It is an edit to the upgrade.php file.

Thanks. So if I edit the update file, can I then run it again without damaging anything, even though it's already half way through updating?

Quote
They tell me because it's a shared environment they're not prepared to mod the PHP

It's not a php setting, it's a mysql setting.

But then try the $mysql_set_mode suggestion from above.

Error
Static analysis:

4 errors were found during analysis.

Unexpected character. (near "$" at position 0)
Unexpected beginning of statement. (near "$" at position 0)
Unexpected beginning of statement. (near "mysql_set_mode" at position 1)
Unexpected beginning of statement. (near "true" at position 18)
SQL query:

$mysql_set_mode = true

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$mysql_set_mode = true' at line 1

Did you enter the code posted by shawnb61 at your Settings.php file correctly?

I think so. See attachment. I put the script in the window and then press the 'go' button highlighted.

Offline doug_ips

  • Full Member
  • ***
  • Posts: 468
Re: Updating problem
« Reply #37 on: May 11, 2020, 04:11:49 PM »
I think so. See attachment. I put the script in the window and then press the 'go' button highlighted.

You must add it to your Settings.php file and not run it as a query. Said file can be found in the root of your forum folder, the one that contains the db info.

Offline PD3

  • Semi-Newbie
  • *
  • Posts: 38
Re: Updating problem
« Reply #38 on: May 11, 2020, 06:16:31 PM »
I think so. See attachment. I put the script in the window and then press the 'go' button highlighted.

You must add it to your Settings.php file and not run it as a query. Said file can be found in the root of your forum folder, the one that contains the db info.

Thanks -- noob mistake, I know  ::)

Offline doug_ips

  • Full Member
  • ***
  • Posts: 468
Re: Updating problem
« Reply #39 on: May 11, 2020, 06:50:31 PM »
I think so. See attachment. I put the script in the window and then press the 'go' button highlighted.

You must add it to your Settings.php file and not run it as a query. Said file can be found in the root of your forum folder, the one that contains the db info.

Thanks -- noob mistake, I know  ::)

Do not worry about it. :)