Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 07-01-2005, 12:36 AM
dsboyce8624 dsboyce8624 is offline
 
Join Date: May 2005
Location: New Jersey
Posts: 413
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Invalid Default Value

Okay, with newer version we are not allowed to use DEFAULT '0' like we were and this is causing problems in some older, but still popular hacks. Shoutbox, and Member Album to name a couple.

If we are will to to make the corrections we need to know what changes to make.

In Shoutbox there is this code:

Code:
$query['new'][] = 'CREATE TABLE '.TABLE_PREFIX.'shoutbox_posts (
				  `shoutid` BIGINT (255) UNSIGNED DEFAULT \'0\' AUTO_INCREMENT, 
				  `text` TEXT, 
				  `userid` BIGINT (255) UNSIGNED DEFAULT \'0\', 
				  `username` VARCHAR (255) DEFAULT \'0\', 
				  `ip` VARCHAR (25) DEFAULT \'0\', 
				  `time` BIGINT (20) UNSIGNED DEFAULT \'0\', 
				  `edittime` BIGINT (20) UNSIGNED DEFAULT \'0\', 
				  `edituser` VARCHAR (255) DEFAULT \'0\', 
				  `deleted` TINYINT(1) UNSIGNED DEFAULT \'0\', 
				  PRIMARY KEY(`shoutid`))';

$query['new'][] = 'ALTER TABLE '.TABLE_PREFIX.'usergroup 
				   ADD `shoutboxpermissions` INT(10) UNSIGNED DEFAULT \'0\' NOT NULL,
				   ADD `shouthierarchy` TINYINT(5) UNSIGNED DEFAULT \'0\' NOT NULL,
				   ADD `shoutmaxdaily` TINYINT(5)    UNSIGNED DEFAULT \'0\' NOT NULL';

$query['new'][] = 'ALTER TABLE '.TABLE_PREFIX.'user
				   ADD `shouts` BIGINT(10) UNSIGNED DEFAULT \'0\' NOT NULL,
				   ADD`shoutbanned` TINYINT(1) UNSIGNED DEFAULT \'0\' NOT NULL';
And I know it breaks there, because mine broke there.

There doesn't seem to be any support for this, at least not enough to make it worth mentioning. So, can somebody tell me how to modify these queries so they work?

Thanks a bunch.
Reply With Quote
  #2  
Old 07-01-2005, 07:30 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

New version of what? vB, MySQL?

And what doesn't work, you get an error message?

And please post questions about a hack in the thread about that hack.
Reply With Quote
  #3  
Old 07-01-2005, 03:05 PM
dsboyce8624 dsboyce8624 is offline
 
Join Date: May 2005
Location: New Jersey
Posts: 413
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

New versions of MySQL.

Yes there is an error, Invalid Default Value '0'

This is not about the hack, this is about correcting queries.
Reply With Quote
  #4  
Old 07-01-2005, 03:06 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And what is the exact error you are getting?
Reply With Quote
  #5  
Old 07-01-2005, 03:08 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh just checked those queries now. There is 1 error in them:
[sql] `shoutid` BIGINT (255) UNSIGNED DEFAULT \'0\' AUTO_INCREMENT,
[/sql]
You can not have a default value for an auto increment field. Change that line to:
[sql] `shoutid` BIGINT (255) UNSIGNED AUTO_INCREMENT,
[/sql]
Reply With Quote
  #6  
Old 07-01-2005, 03:12 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually if you would have posted this in the Shoutbox thread, i think someone would have been able to help you much faster, since the answer to your question is already there: https://vborg.vbsupport.ru/showthrea...ent#post639730
Reply With Quote
  #7  
Old 07-02-2005, 02:02 AM
dsboyce8624 dsboyce8624 is offline
 
Join Date: May 2005
Location: New Jersey
Posts: 413
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Beleive it or not, I read the whole damned thing, and missed it.

I guess it was just too much.

Thanks.
Reply With Quote
Reply

Thread Tools
Display Modes

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 05:35 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.06892 seconds
  • Memory Usage 2,208KB
  • Queries Executed 13 (?)
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)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete