• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 Prepared Statements

#1
I get this quite a bit, randomly. From people logged in and people not logged in.

Code:
XF\Db\Exception: MySQL query error [1615]: Prepared statement needs to be re-prepared src/XF/Db/AbstractStatement.php:183
Generated by: Unknown account Oct 13, 2017 at 4:30 PM

Stack trace
#0 src/XF/Db/Mysqli/Statement.php(66): XF\Db\AbstractStatement->getException('MySQL query err...', 1615)
#1 src/XF/Db/AbstractAdapter.php(67): XF\Db\Mysqli\Statement->execute()
#2 src/XF/Mvc/Entity/Finder.php(1105): XF\Db\AbstractAdapter->query('\n\t\t\tSELECT `xf_...')
#3 src/XF/Mvc/Entity/Manager.php(137): XF\Mvc\Entity\Finder->fetchOne()
#4 src/XF/Repository/User.php(24): XF\Mvc\Entity\Manager->find('XF:User', 1, Array)
#5 src/XF/App.php(1466): XF\Repository\User->getVisitor(1, Array)
#6 src/XF/Pub/App.php(77): XF\App->getVisitorFromSession(Object(XF\Session\Session))
#7 src/XF/App.php(1827): XF\Pub\App->start(true)
#8 src/XF.php(328): XF\App->run()
#9 index.php(13): XF::runApp('XF\\Pub\\App')
#10 {main}

Request state
array(4) {
  ["url"] => string(1) "/"
  ["referrer"] => string(22) "https://mycoolsite.com/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
I have changed the domain, mycoolsite.com is not mine.
 

Chris D

XenForo developer
Staff member
#2
Generally this is a server side issue rather than a code issue.

It was a larger problem in some older MySQL versions but I believe when it is seen now changing table_definition_cache is the solution which can be changed in my.cnf or by your host.
 
#3
Generally this is a server side issue rather than a code issue.

It was a larger problem in some older MySQL versions but I believe when it is seen now changing table_definition_cache is the solution which can be changed in my.cnf or by your host.
Thanks for your response, they increased it and now the errors have stopped :)