• 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 4.x Series
    • Bug
    • MySQL statement prepare error [1064]

    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: MySQL statement prepare error [1064]

    • Issue Tools
      • View Changes
    1. issueid=6016 April 9, 2020 3:36 PM
      Kazyyk Kazyyk is offline
      New Member
      MySQL statement prepare error [1064]
      MySQL related error during first time installation leaves addon uninstaled and processing

      Hello,

      I'm attempting to install VaultWiki for the first time on XenForo 2.1.5 and encounter an error which prevents me from doing so.

      Here is the error msg:
      Code:
           XF\Db\InvalidQueryException: MySQL statement prepare error [1064]: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 src/XF/Db/AbstractStatement.php:228
      Here is the stack trace:
      Code:
      SELECT `f`.* FROM `vw_area_field` `a`  LEFT JOIN `vw_field_definition` `f` ON (`f`.`fieldid` = `a`.`fieldid`)   WHERE `a`.`areaid` = 
      ------------
      
      #0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1064, '42000')
      #1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1064, '42000')
      #2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
      #3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
      #4 src/addons/vw/vw/_core/controller/db/xf2.php(148): XF\Db\AbstractAdapter->query('SELECT `f`.* FR...')
      #5 src/addons/vw/vw/_core/model/db/mysql/vw.php(25): vw_DB_Controller_XF2->query_read('SELECT `f`.* FR...')
      #6 src/addons/vw/vw/_core/model/customfield/vw.php(567): vw_DB_MySQL_Model->select(Array)
      #7 src/addons/vw/vw/_core/model/customfield/vw.php(38): vw_CustomField_Model->definition(-1, NULL)
      #8 src/addons/vw/vw/_core/controller/dm/base/vw.php(776): vw_CustomField_Model->relevant(Array)
      #9 src/addons/vw/vw/_core/controller/dm/base/vw.php(641): vw_DM_Base_Controller->get_relevant_custom_fields()
      #10 src/addons/vw/vw/_core/controller/dm/revision/vw.php(1019): vw_DM_Base_Controller->process_custom_fields()
      #11 src/addons/vw/vw/_core/controller/dm/revision/vw.php(1634): vw_DM_Revision_Controller->process_custom_fields()
      #12 src/addons/vw/vw/XF/Entity/EntityBase.php(490): vw_DM_Revision_Controller->pre_save(true)
      #13 src/XF/Mvc/Entity/Entity.php(1297): vw\vw\XF\Entity\EntityBase->_preSave()
      #14 src/addons/vw/vw/XF/Entity/EntityBase.php(481): XF\Mvc\Entity\Entity->preSave()
      #15 src/addons/vw/vw/_core/controller/dm/xf2.php(348): vw\vw\XF\Entity\EntityBase->vwPreSave()
      #16 src/addons/vw/vw/_core/controller/dm/base/vw.php(870): vw_DM_Controller_XF2->pre_save(NULL)
      #17 src/addons/vw/vw/_core/controller/dm/page/vw.php(1075): vw_DM_Base_Controller->internal_pre_save(Object(vw_DM_Controller_XF2), NULL)
      #18 src/addons/vw/vw/_core/controller/dm/page/vw.php(810): vw_DM_Page_Controller->process_revision()
      #19 src/addons/vw/vw/XF/Entity/EntityBase.php(490): vw_DM_Page_Controller->pre_save(true)
      #20 src/XF/Mvc/Entity/Entity.php(1297): vw\vw\XF\Entity\EntityBase->_preSave()
      #21 src/addons/vw/vw/XF/Entity/EntityBase.php(481): XF\Mvc\Entity\Entity->preSave()
      #22 src/addons/vw/vw/_core/controller/dm/xf2.php(348): vw\vw\XF\Entity\EntityBase->vwPreSave()
      #23 src/addons/vw/vw/_core/controller/dm/index/vw.php(363): vw_DM_Controller_XF2->pre_save()
      #24 src/addons/vw/vw/_core/controller/dm/index/vw.php(347): vw_DM_Index_Controller->internal_pre_save(Object(vw_DM_Controller_XF2), true)
      #25 src/addons/vw/vw/XF/Entity/EntityBase.php(490): vw_DM_Index_Controller->pre_save(true)
      #26 src/XF/Mvc/Entity/Entity.php(1297): vw\vw\XF\Entity\EntityBase->_preSave()
      #27 src/addons/vw/vw/XF/Entity/EntityBase.php(481): XF\Mvc\Entity\Entity->preSave()
      #28 src/addons/vw/vw/XF/Entity/EntityBase.php(536): vw\vw\XF\Entity\EntityBase->vwPreSave()
      #29 src/addons/vw/vw/_core/controller/dm/xf2.php(382): vw\vw\XF\Entity\EntityBase->vwSave()
      #30 src/addons/vw/vw/_install/lib/db/insert/vw.php(309): vw_DM_Controller_XF2->save()
      #31 src/addons/vw/vw/_install/lib/full/steps/vw.php(140): vw_Install_DB_Insert_Controller->execute_dm(Object(vw\vw\Setup\Caller\Install))
      #32 src/addons/vw/vw/Setup.php(300): vw_Install_Full_Steps_Controller->{closure}(Object(vw\vw\Setup\Caller\Install), false)
      #33 src/addons/vw/vw/Setup.php(218): vw\vw\Setup->vwRunStep('install', Object(vw_Install_Full_Steps_Controller_XF2), Array, 8)
      #34 src/XF/Admin/Controller/AddOn.php(398): vw\vw\Setup->install(Array)
      #35 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\AddOn->actionInstall(Object(XF\Mvc\ParameterBag))
      #36 src/XF/Mvc/Dispatcher.php(261): XF\Mvc\Dispatcher->dispatchClass('XF:AddOn', 'Install', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\AddOn), NULL)
      #37 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\AddOn), NULL)
      #38 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
      #39 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
      #40 src/XF.php(391): XF\App->run()
      #41 admin.php(13): XF::runApp('XF\\Admin\\App')
      #42 {main}
      Here is my mysql --version output:
      Code:
      mysql  Ver 15.1 Distrib 5.5.64-MariaDB, for Linux (x86_64) using readline 5.1
      The addon is left stuck as processing or partially installed. I have gone in and dropped all vw_ tables and removed the addon from the in_processing table as well as deleted all files and re-uploaded fresh. The error occurs each time.

      Any assistance greatly appreciated. Thanks.
    Issue Details
    Issue Number 6016
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Install / Upgrade
    Status Fixed
    Priority 2 - Fatal / Database Errors
    Affected Version 4.1.0 RC 2
    Fixed Version 4.1.0 RC 2
    Milestone (none)
    Software DependencyXenForo 2.x
    License TypePaid
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags install, mysql




    1. April 9, 2020 6:21 PM
      pegasus pegasus is offline
      VaultWiki Team
      In src/addons/vw/vw/_core/model/customfield/vw.php, find (2x):
      Code:
      $index = vw_Hard_Core::controller('Fetch')->cached('Index', 0);
      AFTER it, add (each time):
      Code:
      if (!$index) $index = array('pageid' => false);
      Reply Reply  
    2. April 9, 2020 6:28 PM
      pegasus pegasus is offline
      VaultWiki Team
      You will also need to run the following MySQL query in phpMyAdmin:
      Code:
      ALTER TABLE vw_page ADD COLUMN fieldcache BLOB NULL;
      ALTER TABLE vw_feed ADD COLUMN fieldcache BLOB NULL;
      ALTER TABLE vw_redirect ADD COLUMN fieldcache BLOB NULL;
      Reply Reply  
    3. This petition for a change to In Progress was accepted
      April 9, 2020 6:33 PM
      Kazyyk Kazyyk is offline
      New Member
      Hello,

      Thanks for your help. Unfortunately, the issue has changed.
      If you would like me to open a new ticket, let me know.

      I have made the alterations as specified and attempted installation and received this result.

      Here is the new error:
      Code:
      XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'fieldcache' in 'field list' src/XF/Db/AbstractStatement.php:228
      Here is the stacktrace:
      Code:
      INSERT  INTO `vw_page` (`visible`, `areaid`, `creatorid`, `creatorname`, `dateline`, `typelist`, `pageid`, `protect`, `revisionid`, `creator_ip_id`, `tagcache`, `parsedate`, `fieldcache`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      ------------
      
      #0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1054, '42S22')
      #1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1054, '42S22')
      #2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
      #3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
      #4 src/XF/Db/AbstractAdapter.php(221): XF\Db\AbstractAdapter->query('INSERT  INTO `v...', Array)
      #5 src/XF/Mvc/Entity/Entity.php(1452): XF\Db\AbstractAdapter->insert('vw_page', Array, false)
      #6 src/XF/Mvc/Entity/Entity.php(1184): XF\Mvc\Entity\Entity->_saveToSource()
      #7 src/addons/vw/vw/XF/Entity/EntityBase.php(556): XF\Mvc\Entity\Entity->save(false, false)
      #8 src/addons/vw/vw/_core/controller/dm/xf2.php(382): vw\vw\XF\Entity\EntityBase->vwSave()
      #9 src/addons/vw/vw/_core/controller/dm/index/vw.php(215): vw_DM_Controller_XF2->save()
      #10 src/addons/vw/vw/XF/Entity/EntityBase.php(633): vw_DM_Index_Controller->post_save_each()
      #11 src/XF/Mvc/Entity/Entity.php(1208): vw\vw\XF\Entity\EntityBase->_postSave()
      #12 src/addons/vw/vw/XF/Entity/EntityBase.php(556): XF\Mvc\Entity\Entity->save(false, false)
      #13 src/addons/vw/vw/_core/controller/dm/xf2.php(382): vw\vw\XF\Entity\EntityBase->vwSave()
      #14 src/addons/vw/vw/_install/lib/db/insert/vw.php(309): vw_DM_Controller_XF2->save()
      #15 src/addons/vw/vw/_install/lib/full/steps/vw.php(140): vw_Install_DB_Insert_Controller->execute_dm(Object(vw\vw\Setup\Caller\Install))
      #16 src/addons/vw/vw/Setup.php(300): vw_Install_Full_Steps_Controller->{closure}(Object(vw\vw\Setup\Caller\Install), false)
      #17 src/addons/vw/vw/Setup.php(218): vw\vw\Setup->vwRunStep('install', Object(vw_Install_Full_Steps_Controller_XF2), Array, 8)
      #18 src/XF/Admin/Controller/AddOn.php(398): vw\vw\Setup->install(Array)
      #19 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\AddOn->actionInstall(Object(XF\Mvc\ParameterBag))
      #20 src/XF/Mvc/Dispatcher.php(261): XF\Mvc\Dispatcher->dispatchClass('XF:AddOn', 'Install', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\AddOn), NULL)
      #21 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\AddOn), NULL)
      #22 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
      #23 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
      #24 src/XF.php(391): XF\App->run()
      #25 admin.php(13): XF::runApp('XF\\Admin\\App')
      #26 {main}
      Thank you.
       
    4. April 9, 2020 6:37 PM
      pegasus pegasus is offline
      VaultWiki Team
      1054 is an unknown column error. What is the unknown column? If you ran the MySQL query in my previous post I think you should have all columns already.
      Reply Reply  
    5. April 9, 2020 6:41 PM
      Kazyyk Kazyyk is offline
      New Member
      Sorry, I did not see the comment about the SQL queries until afterwards. I've performed the steps in the database and another error has occurred.

      The new error is:
      Code:
           ErrorException: Invalid argument supplied for foreach() src/addons/vw/vw/_core/controller/dm/revision/vw.php:1030
      Here is the StackTrace:
      Code:
          vw\vw\Setup\View->handle_php_error() in src/addons/vw/vw/_core/controller/dm/revision/vw.php at line 1030
          vw_DM_Revision_Controller->process_custom_fields() in src/addons/vw/vw/_core/controller/dm/revision/vw.php at line 1634
          vw_DM_Revision_Controller->pre_save() in src/addons/vw/vw/XF/Entity/EntityBase.php at line 490
          vw\vw\XF\Entity\EntityBase->_preSave() in src/XF/Mvc/Entity/Entity.php at line 1297
          XF\Mvc\Entity\Entity->preSave() in src/addons/vw/vw/XF/Entity/EntityBase.php at line 481
          vw\vw\XF\Entity\EntityBase->vwPreSave() in src/addons/vw/vw/_core/controller/dm/xf2.php at line 348
          vw_DM_Controller_XF2->pre_save() in src/addons/vw/vw/_core/controller/dm/base/vw.php at line 870
          vw_DM_Base_Controller->internal_pre_save() in src/addons/vw/vw/_core/controller/dm/page/vw.php at line 1075
          vw_DM_Page_Controller->process_revision() in src/addons/vw/vw/_core/controller/dm/page/vw.php at line 810
          vw_DM_Page_Controller->pre_save() in src/addons/vw/vw/XF/Entity/EntityBase.php at line 490
          vw\vw\XF\Entity\EntityBase->_preSave() in src/XF/Mvc/Entity/Entity.php at line 1297
          XF\Mvc\Entity\Entity->preSave() in src/addons/vw/vw/XF/Entity/EntityBase.php at line 481
          vw\vw\XF\Entity\EntityBase->vwPreSave() in src/addons/vw/vw/_core/controller/dm/xf2.php at line 348
          vw_DM_Controller_XF2->pre_save() in src/addons/vw/vw/_core/controller/dm/base/vw.php at line 870
          vw_DM_Base_Controller->internal_pre_save() in src/addons/vw/vw/_core/controller/dm/area/vw.php at line 690
          vw_DM_Area_Controller->pre_save() in src/addons/vw/vw/XF/Entity/EntityBase.php at line 490
          vw\vw\XF\Entity\EntityBase->_preSave() in src/XF/Mvc/Entity/Entity.php at line 1297
          XF\Mvc\Entity\Entity->preSave() in src/addons/vw/vw/XF/Entity/EntityBase.php at line 481
          vw\vw\XF\Entity\EntityBase->vwPreSave() in src/addons/vw/vw/XF/Entity/EntityBase.php at line 536
          vw\vw\XF\Entity\EntityBase->vwSave() in src/addons/vw/vw/_core/controller/dm/xf2.php at line 382
          vw_DM_Controller_XF2->save() in src/addons/vw/vw/_install/lib/full/steps/vw.php at line 244
          vw_Install_Full_Steps_Controller->{closure}() in src/addons/vw/vw/Setup.php at line 300
          vw\vw\Setup->vwRunStep() in src/addons/vw/vw/Setup.php at line 218
          vw\vw\Setup->install() in src/XF/Admin/Controller/AddOn.php at line 398
          XF\Admin\Controller\AddOn->actionInstall() in src/XF/Mvc/Dispatcher.php at line 350
          XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 261
          XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
          XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
          XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2184
          XF\App->run() in src/XF.php at line 391
          XF::runApp() in admin.php at line 13
      Thanks.
      Reply Reply  
    6. April 9, 2020 6:52 PM
      pegasus pegasus is offline
      VaultWiki Team
      In src/addons/vw/vw/_core/controller/dm/revision/vw.php, find:
      Code:
      $altfields = $this->instance->get_info('alt_custom_field_values');
      AFTER it, add:
      Code:
      if (!$altfields) return true;
      Reply Reply  
    7. April 9, 2020 7:03 PM
      pegasus pegasus is offline
      VaultWiki Team
      Please also check if your database contains a table called vw_redirect. If it does not exist, here is the MySQL code to create it (you may need to scroll for full code):
      Code:
      CREATE TABLE `vw_redirect` (
       `redirectid` int(10) unsigned NOT NULL AUTO_INCREMENT,
       `areaid` int(10) unsigned NOT NULL DEFAULT '0',
       `prefixid` int(10) unsigned NOT NULL DEFAULT '0',
       `title` varchar(255) NOT NULL DEFAULT '',
       `dateline` int(10) unsigned NOT NULL DEFAULT '0',
       `expires` int(10) unsigned NOT NULL DEFAULT '0',
       `path` text,
       `userid` int(10) unsigned NOT NULL DEFAULT '0',
       `username` varchar(200) NOT NULL DEFAULT '',
       `target` varchar(255) NOT NULL DEFAULT '',
       `targetkey` varchar(255) NOT NULL DEFAULT '',
       `targetprefixid` int(10) unsigned NOT NULL DEFAULT '0',
       `protect` tinyint(3) unsigned NOT NULL DEFAULT '0',
       `visible` tinyint(3) unsigned NOT NULL DEFAULT '0',
       `targetid` int(10) unsigned NOT NULL DEFAULT '0',
       `section` varchar(255) NOT NULL DEFAULT '',
       `sectionkey` varchar(255) NOT NULL DEFAULT '',
       `ip_id` int(10) unsigned NOT NULL DEFAULT '0',
       `tagcache` blob,
       `fieldcache` blob,
       PRIMARY KEY (`redirectid`),
       KEY `areaid` (`areaid`,`visible`,`dateline`),
       KEY `visible` (`visible`,`dateline`),
       KEY `prefixid` (`prefixid`),
       KEY `userid` (`userid`),
       KEY `protect` (`protect`),
       KEY `expires` (`expires`),
       KEY `ip_id` (`ip_id`),
       KEY `targetid` (`targetid`,`sectionkey`(125)),
       KEY `targetkey` (`targetprefixid`,`targetkey`(125),`sectionkey`(50))
      ) ENGINE=MyISAM DEFAULT CHARSET=utf8
      All the fixes in this report are now included with the current build.
      Reply Reply  
    8. April 9, 2020 8:01 PM
      Kazyyk Kazyyk is offline
      New Member
      Hello,

      Thanks again. Everything seems to be working now.
      My database didn't have the vw_redirect table. Seems that it never created it for some reason.
      Thanks for supplying the SQL code to correct that.

      Hope these fixes help others, too.
      Cheers.
      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 1:08 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 © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.