« Project home page
my little forum
Log in
Register
Search:
Back to the entry by Auge
Post reply
Reply to the message by
Auge
Name:
E-mail:
(optional, won't be displayed directly)
Leave this field empty:
Homepage:
(optional)
Leave this field empty:
Location:
(optional)
Remember me (cookie)
Category:
General
Project organisation
Technics
Design/Themes
Features
Development
Todo
Bugs
German / Deutsch
Spanish / Español
French / Français
Accessibility/UX
Subject:
Formatting help
skip to input
format text bold
[b]bold text[/b]
format text italic
[i]italic text[/i]
insert hyperlink
[link=http://example.com/]link text[/link] / [link]http://example.com/[/link]
set text color
[color=#rgb]colored text[/color]
font size
[size=small]small text[/size]
[size=large]large text[/size]
insert list
[list][*]list item[/list]
insert image
[img]http://example.com/image.jpg[/img]
left: [img=left]http://example.com/image.jpg[/img]
right: [img=right]http://example.com/image.jpg[/img]
thumbnail: [img=thumbnail]http://example.com/image.jpg[/img]
thumbnail left: [img=thumbnail-left]http://example.com/image.jpg[/img]
thumbnail right: [img=thumbnail-right]http://example.com/image.jpg[/img]
upload image
upload image ...
insert TeX code
[tex]TeX code[/tex]
insert code
[inlinecode]code[/inlinecode]
[code]code[/code]
[code=css]code[/code]
[code=html]code[/code]
[code=javascript]code[/code]
[code=perl]code[/code]
[code=php]code[/code]
[code=sql]code[/code]
[code=xml]code[/code]
:-)
;-)
:-P
:-D
:-|
:-(
:yes:
:no:
:ok:
:lol:
:lol2:
:lol3:
:cool:
:surprised:
:angry:
:crying:
:waving:
:confused:
:lookaround:
:clap:
:love:
:tick:
Message:
> Hello > > > Well, the next try :-) > > As first: Thank you for your unintentionally tests. > > > my provider offered a transfer to a new database with MYSQL 5.7 (also possible MYSQL 8, or MariaDB 10.6) and I tried the update. I got these errors: > > > > [code] > > Fehler! > > > > Database error in line 363: Incorrect datetime value: '0000-00-00 00:00:00' for column 'edited' at row 1 > > Database error in line 378: Incorrect date value: '0000-00-00' for column 'birthday' at row 1 > > Database error in line 381: Incorrect date value: '0000-00-00' for column 'birthday' at row 1 > > > > [/code] > > That's the pitfalls of the configuration dependent, possible lax data model of MySQL and the default values for columns that was mostly set by Alex years ago (possibly wíthout the necessary knowledge about the corner cases, i.e. much more stringent configurations of MySQL-servers). > > > The forum itself seems to run, however it shown ugly PHP warnings: > > > > [code] > > Warning: mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given in /PATH/includes/main.inc.php on line 259 > > > > Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /PATH/forum/includes/main.inc.php on line 260 > > > > Warning: mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given in /PATH/forum/includes/main.inc.php on line 262 > > > > Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /PATH/forum/includes/main.inc.php on line 263 > > > > Warning: mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given in /PATH/forum/includes/main.inc.php on line 267 > > > > Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /PATH/forum/includes/main.inc.php on line 268 > > [/code] > > Hmmm, the error in line 259 is the cause of the following errors. This is the complete block in main.inc.php (version 20220803.1). > > [code lang=php] > 259 | $count_result = mysqli_query($connid, "SELECT COUNT(*) FROM " . $db_settings['userdata_table'] . " WHERE activate_code = ''"); > 260 | list($registered_users) = mysqli_fetch_row($count_result); > 261 | > 262 | if ($settings['count_users_online'] > 0) { > 263 | user_online($settings['count_users_online']); > 264 | $count_result = mysqli_query($connid, "SELECT COUNT(*) FROM ".$db_settings['useronline_table']." WHERE user_id > 0"); > 265 | list($registered_users_online) = mysqli_fetch_row($count_result); > 266 | $count_result = mysqli_query($connid, "SELECT COUNT(*) FROM ".$db_settings['useronline_table']." WHERE user_id = 0"); > 267 | list($unregistered_users_online) = mysqli_fetch_row($count_result); > 268 | $total_users_online = $unregistered_users_online + $registered_users_online; > 269 | } > 270 | mysqli_free_result($count_result); > [/code] > > But comparing the line numbers in your error messages with the code one can see, that the messages reports MySQL-errors in lines, where we don't see MySQL-related function calls in the code of version 20220803.1 (as shown above). But when we look into the code of version 2.4.20 (the version from where you started the update) we can see MySQL-related code with a query, that includes columns that are gone with version 2.5. The gone colum is part of the string in the variable [inlinecode]$display_spam_query_and[/inlinecode], that was generated in the previous block, [link=https://github.com/ilosuna/mylittleforum/blob/d5758ff0b17690c09576d695dbd80a52675f6a5f/includes/main.inc.php#L239]beginning with line #239[/link]. > > [code lang=php] > 256 | } else { > 257 | // there are categories > 258 | $count_result = mysqli_query($connid, "SELECT COUNT(*) FROM ".$db_settings['forum_table']." WHERE pid = 0".$display_spam_query_and." AND category IN (".$category_ids_query.")"); > 259 | list($total_threads) = mysqli_fetch_row($count_result); > 260 | mysqli_free_result($count_result); > 261 | $count_result = mysqli_query($connid, "SELECT COUNT(*) FROM ".$db_settings['forum_table']." WHERE category IN (".$category_ids_query.")".$display_spam_query_and); > 262 | list($total_postings) = mysqli_fetch_row($count_result); > 263 | mysqli_free_result($count_result); > 264 | } > 265 | // count spam: > 266 | $count_spam_result = mysqli_query($connid, "SELECT COUNT(*) FROM ".$db_settings['forum_table']." WHERE spam = 1"); > 267 | list($total_spam) = mysqli_fetch_row($count_spam_result); > 268 | mysqli_free_result($count_spam_result); > [/code] > > That said, we have to assume, that you forgot to upload the script file(s) (at least the main.inc.php). > > > [code] > > Warning: Cannot modify header information - headers already sent by (output started at /PATH/forum/includes/main.inc.php:259) in /PATH/forum/index.php on line 208 > > > > Warning: Cannot modify header information - headers already sent by (output started at /PATH/forum/includes/main.inc.php:259) in /PATH/forum/index.php on line 209 > > [/code] > > These are subsequent errors because of the output of the previous error messages. This errors would not occur, if the error in main.inc.php, line 259 would not happen. > > > remarks: > > > > - Before the update attempt today the forum was O.K., but I did a similar try two weeks ago. I cannot confirm that this try did not touch the databases. However this should be unlikely. > > - In the "entries" table there are entries with "0000-00-00 00:00:00" in the edited row. > > - in the "uderdata" table there are entries with "0000-00-00" in the borthday row. > > > > Should I set these entries to NULL manually before updating? > > Generally this is a proper idea, [b]but[/b] I cannot recommend this without knowing the possible side effects (i.e. when a function relies on the format ([inlinecode]0000-00-00 (00:00:00)[/inlinecode]) and does not take a [inlinecode]NULL[/inlinecode] value into account). There are many more places in the database, where setting the default values to [inlinecode]NULL[/inlinecode] would make IMHO much more sense than the current defaults does. > > > Any suggestions? > > I had a few looks into the code of the update script and I have ideas to improve the script without breaking updates, that have aready been made. I will inspect the code with a focus on the date and datetime topics today and will give a report today in the evening or tomorrow. > > Tschö, Auge
E-mail notification on reply of this posting
OK - Submit
Preview