• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 3.x Series
    • Bug
    • Database Errors

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: Database Errors

    • Issue Tools
      • View Changes
    1. issueid=755 August 6, 2009 9:27 PM
      tommythejoat tommythejoat is offline
      Regular Member
      Database Errors
      We get database error reports that finger Vault Wiki

      Here is an example that I believe is typical. They are infrequent, but always seem to happen to new visitors to the wiki. Regular users do not seem to use spcial pages so much. I just noticed the -91 in the display argument to MySQL.
      Code:
      Database error in vBulletin 3.8.3: 
      
      Invalid SQL: 
      
                      SELECT thread.title, thread.threadid, thread.forumid, thread.prefixid 
                      FROM thread AS thread 
                      LEFT JOIN vault_article AS article ON (article.threadid = thread.threadid) 
                      WHERE thread.forumid IN (229,245,239,248,249,241,246,247,250,251,252,253,255,254,243) 
                              
                      ORDER BY thread.title ASC 
                      LIMIT 250,-91; 
      
      MySQL Error   : 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 '-91' at line 7
      
      Error Number  : 1064 
      Request Date  : Thursday, August 6th 2009 @ 05:26:23 PM 
      Error Date    : Thursday, August 6th 2009 @ 05:26:23 PM 
      Script        : http://mb.nawcc.org/showwiki.php?title=Special:Allpages&namespace=&limit=250&offset=250
      Referrer      : http://mb.nawcc.org/showwiki.php?title=Special:Allpages&namespace=Vault+Wiki&limit=250&offset=0
      IP Address    : 209.12.171.82 
      Username      : Hoos 
      Classname     : vB_Database 
      MySQL Version :
    Issue Details
    Issue Number 755
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category Special Pages
    Status Fixed
    Priority 4 - Warnings / Script Errors
    Affected Version 2.5.0
    Fixed Version 2.5.1
    Milestone (none)
    Software DependencyAny
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. August 7, 2009 4:01 AM
      pegasus pegasus is offline
      VaultWiki Team
      This is not possible using standard wiki navigation, only by modifying the Special page URL. Special pages only show X number of results per page. If the user modifies the URL to attempt to view a page that is too high to contain any results, this error will occur.

      For the next build, the user should receive a safe message stating that no results matched their query because of the above reason.
      Reply Reply  
    2. August 12, 2009 10:19 AM
      tommythejoat tommythejoat is offline
      Regular Member
      I probably should wait for the next build, but I got this again this morning and followed up on it.

      If I navigate to Special Pages : AllPages and select 250 as the number of entries to display, I get the normal listing of 250 articles. If I then click on the link that says (next 250), I get the database error. This appears to be a simple miscalculation of the size of the list being displayed. The query has a limit clause and the upper limit is a negative number.

      No editing of any url's is required to generate the error.
      Reply Reply  
    3. August 12, 2009 10:47 AM
      tommythejoat tommythejoat is offline
      Regular Member
      Since this error does not occur on your site, I started checking to see if there were anomalies in my database that might cause this.

      I did find one rather stange thing in forum map. There are many of my wiki forums that are mapped to both namespace id 1 and namespace id 6. I am not clear how this happened, but it does not look like the way it would have been designed.

      Code:
      Full Texts  	namespaceid 	forumid
      	Edit 	Delete 	2 	225
      	Edit 	Delete 	3 	226
      	Edit 	Delete 	4 	227
      	Edit 	Delete 	5 	228
      	Edit 	Delete 	1 	229
      	Edit 	Delete 	6 	229
      	Edit 	Delete 	8 	233
      	Edit 	Delete 	9 	234
      	Edit 	Delete 	6 	237
      	Edit 	Delete 	1 	239
      	Edit 	Delete 	6 	239
      	Edit 	Delete 	1 	241
      	Edit 	Delete 	6 	241
      	Edit 	Delete 	1 	243
      	Edit 	Delete 	6 	243
      	Edit 	Delete 	1 	245
      	Edit 	Delete 	6 	245
      	Edit 	Delete 	1 	246
      	Edit 	Delete 	6 	246
      	Edit 	Delete 	1 	247
      	Edit 	Delete 	6 	247
      	Edit 	Delete 	1 	248
      	Edit 	Delete 	6 	248
      	Edit 	Delete 	1 	249
      	Edit 	Delete 	6 	249
      	Edit 	Delete 	1 	250
      	Edit 	Delete 	6 	250
      	Edit 	Delete 	1 	251
      	Edit 	Delete 	6 	251
      	Edit 	Delete 	1 	252
      	Edit 	Delete 	6 	252
      	Edit 	Delete 	1 	253
      	Edit 	Delete 	6 	253
      	Edit 	Delete 	1 	254
      	Edit 	Delete 	6 	254
      	Edit 	Delete 	1 	255
      	Edit 	Delete 	6 	255
      	Edit 	Delete 	10 	273
      	Edit 	Delete 	0 	275
      	Edit 	Delete 	11 	275
      Reply Reply  
    4. August 12, 2009 4:44 PM
      pegasus pegasus is offline
      VaultWiki Team
      Thanks, while the forum map doesn't affect how Special page navigation is generated, we have fixed the forum map for the next build.

      I can only still get this issue to occur on Special:Allpages by submitting the form at the top, if we're on a later page, and if we change to a namespace that doesn't have that many results. This variation is an issue with the code in Special:Allpages only and will be fixed in the next build of VaultWiki Xpages.

      Until then, in vault/extensions/xpages/special/special_allpages.php, find:
      Code:
      	$limitbits = $parser->construct_limitbits($threadinfo, $limitlower, $urlext);
      Replace with:
      Code:
      	$special = array(
      		'title' => $vbphrase['allpages_title'],
      		'namespaceid' => SPECIAL_SPACE
      	);
      
      	$limitbits = $parser->construct_limitbits($special, $limitlower, $urlext);
      Reply Reply  
    5. August 12, 2009 7:55 PM
      tommythejoat tommythejoat is offline
      Regular Member
      I installed the fix, but it does not appear to have any effect on my board. The bad upper limit is still there.

      In looking at the code, I am confused by the fix. The value of $limit, which is the culprit is generated in the $limitarray by
      Code:
      $limitarray = $parser->generate_limits($totalpages);
      .
      The changed code does not alter the value after the call to generate_limits.
      Reply Reply  
    6. August 13, 2009 1:31 AM
      pegasus pegasus is offline
      VaultWiki Team
      It doesn't. The fix I posted was not the limit fix. It was the Allpages fix because Allpages sends bad form data.

      I think I found the culprit for why this is only happening for you and not on this site. It can only happen if the namespace the Special page searches has whitespace in the title. I believe there is a mismatch occurring when it passes the namespace through the URL because the + character is changed by the server when it reads the URL.

      In your case, it works correctly when the namespace is missing from the URL, but when the namespace "Vault Wiki" is searched (note the + was removed internally by the server), it can't find the namespace because it expects "Vault+Wiki". However, because the namespace was entered, it attempts to make do with the NULL it resolves to. Passing a NULL value to the special permissions tells the Special page to search all forums for results pages. We get a lot of results and the limits are generated likewise, resulting in navigation to a high page.

      Because the namespace resolved to NULL, the URL used for navigation doesn't include a namespace entry. On the next page, the namespace will resolve to the default space "Vault+Wiki" (the next page would circle around again). We now get the appropriate limits and the appropriate number of results. However, the previous page had high limits, and the results page we're requesting may already be too high and trigger the database error.

      I've done some more work with the "+" encoding format in multiple locations throughout VaultWiki, and I believe it should work now.

      In vault/special_plugins.php, find:
      Code:
      		if (
      			in_array($space, $vault->namespaces_lower) AND
      			$space != $titlecache
      		)
      Add before:
      Code:
      		$space = $titlebits[0];
      In vault/special_class_wiki.php, find:
      Code:
      				$this->namespaces_lower["$id"] = strtolower($this->urlencode($text, $id));
      Replace with:
      Code:
      				$temp = strtolower($this->urlencode($text, $id));
      
      				if ($vbulletin->options['vault_spaces'] == 0)
      				{
      					$temp = str_replace('+', ' ', $temp);
      				}
      
      				$this->namespaces_lower["$id"] = $temp;
      In vault/special_class_redirect.php, find:
      Code:
      		$titlebits[0] = $vault->urlencode($titlebits[0]);
      		$vault->fetch_namespace_array(true);
      
      		if (in_array(strtolower($titlebits[0]), $vault->namespaces_lower) AND $titlebits[0] != $text)
      		{
      			$title = $titlebits[1];
      			$hook_namespace = array_search(strtolower($titlebits[0]), $vault->namespaces_lower);
      		}
      Replace with:
      Code:
      		$space = $vault->urlencode($titlebits[0]);
      		$vault->fetch_namespace_array(true);
      
      		if ($this->parser->registry->options['vault_spaces'] == 0)
      		{
      			$space = str_replace('+', ' ', $space);
      		}
      
      		if (in_array(strtolower($space), $vault->namespaces_lower) AND $titlebits[0] != $text)
      		{
      			$title = $titlebits[1];
      			$hook_namespace = array_search(strtolower($space), $vault->namespaces_lower);
      		}
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 9:45 AM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2023 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
    Copyright © 2008 - 2013 VaultWiki Team, Cracked Egg Studios, LLC.