Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-05-2003, 06:04 PM
michaelab michaelab is offline
 
Join Date: Jul 2003
Location: Lisbon, Portugal
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Script for recreating deleted "thread" record?

My board is unfortunately suffering rather frequently from phantom thread deletions which are always accompanied by a MySQL error 1030 "got code 127 from table handler". It's infuriating and I guess I have to put it down to the MySQL v4.0.12 corruption bug. My host refuses to upgrade to MySQL v4.0.15 so there's pretty much nothing I can do.

The specifics of what happens is that the "thread" record for the thread goes missing but all the "post" records are still there. The error message I get always contains the threadid. So, what I've been doing is re-inserting the correct thread record based on data from the post table.

Clearly this must be automatable with a script that just takes the threadid as an argument and inserts a thread record based on data from the post table. Before I go and write such a script, has anyone done something like that already?

Thanks,
Michael.
Reply With Quote
  #2  
Old 10-09-2003, 01:00 AM
AKosygin's Avatar
AKosygin AKosygin is offline
 
Join Date: Oct 2003
Location: Los Angeles County
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, if you host refuses to upgrade, you should choose another host. Even if you have a script to fix that problem, it is a band-aid on a shot gun wound. A bad SQL server or bad implementation of it is a disaster waiting to happen.

If the tables are being corrupted, what guarantee do you have that your data will remain intact, much less accessible, in the future? If your host doesn't care about the customer enough to upgrade, then they do not deserve your business.
Reply With Quote
  #3  
Old 10-09-2003, 06:31 AM
michaelab michaelab is offline
 
Join Date: Jul 2003
Location: Lisbon, Portugal
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well - changing hosts is not a trivial matter. In any case, they have now upgraded to MySQL 4.0.15a (without telling me) but at least they did it and it has solved the problem.

Michael.
Reply With Quote
  #4  
Old 10-16-2003, 05:04 PM
michaelab michaelab is offline
 
Join Date: Jul 2003
Location: Lisbon, Portugal
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm - even post 4.0.15a I've had one random thread deletion :\

So, I wrote a little thread recovery script anyway in case I have to do this when I don't have much time.

Takes a threadid and forumid arguments and then recreates the thread record from existing post records. Everything apart from the number of views can be accurately re-created (I set number of views to the replycount * 10 as a rough value).

This script hasn't been tested extensively so it probably doesn't handle a bunch of exceptional conditions. It does do what I need it to do though

btw, you have to stick it (threadrecover.php, attached) in your .../forum/admin directory.

Michael.
Attached Files
File Type: php threadrecover.php (2.4 KB, 12 views)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:27 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08373 seconds
  • Memory Usage 2,203KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (1)postbit_attachment
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete