Bug MySQL query error [1292]: Truncated incorrect INTEGER value: '-10.00000000'

Status
Not open for further replies.

Nataf

Customer
Hi,

I'm unable to use the credits addon cause each transaction I get the following error:

Code:
XF\Db\Exception: Job XF:ApprovalQueueProcess: MySQL query error [1292]: Truncated incorrect INTEGER value: '-10.00000000' src/XF/Db/AbstractStatement.php:228

UPDATE xf_user
                    SET dbtech_credits_credits = GREATEST(0, CAST(dbtech_credits_credits AS SIGNED) + ?)
                    WHERE user_id = ?
              
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1292, '22007')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1292, '22007')
#2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#3 src/addons/DBTech/Credits/Entity/Transaction.php(199): XF\Db\AbstractAdapter->query('
                    UPDATE xf...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1266): DBTech\Credits\Entity\Transaction->_postSave()
#5 src/addons/DBTech/Credits/Service/Transaction/Approve.php(101): XF\Mvc\Entity\Entity->save()
#6 src/addons/DBTech/Credits/ApprovalQueue/Transaction.php(98): DBTech\Credits\Service\Transaction\Approve->approve()
#7 [internal function]: DBTech\Credits\ApprovalQueue\Transaction->actionApprove(Object(DBTech\Credits\Entity\Transaction))
#8 src/XF/ApprovalQueue/AbstractHandler.php(120): call_user_func_array(Array, Array)
#9 src/XF/Job/ApprovalQueueProcess.php(67): XF\ApprovalQueue\AbstractHandler->performAction('approve', Object(DBTech\Credits\Entity\Transaction))
#10 src/XF.php(589): XF\Job\ApprovalQueueProcess->XF\Job\{closure}()
#11 src/XF/Job/ApprovalQueueProcess.php(68): XF::asVisitor(Object(MMO\Hide\XF\Entity\User), Object(Closure))
#12 src/XF/Job/Manager.php(258): XF\Job\ApprovalQueueProcess->run(8)
#13 src/XF/Job/Manager.php(200): XF\Job\Manager->runJobInternal(Array, 8)
#14 src/XF/Job/Manager.php(116): XF\Job\Manager->runJobEntry(Array, 8)
#15 job.php(22): XF\Job\Manager->runByIds(Array, 8)
#16 {main}


Any idea about how to solve this?

Thanks in advance
 
Last edited:
Can you check the data type of the dbtech_credits_credits column in the xf_user table in your database? It should be DECIMAL(65,8).
 
Hi,

I've reinstalled the addon and now it's working.

Any idea how this happened to prevent future problems?

Thank you fro your prompt response
 
Last edited:
Hi there,

After some time, the error is coming up again. I have checked the dbtech_credits_credits column type and it's decimal(65,8).
 
Ah I see it now, it's because you have your currency set to 9 decimals. Reduce it to 8 or fewer.
 
What version of MySQL are you running? I tried running that query manually, and it worked just fine. This might be a compatibility issue with your version of MySQL.
 
I'm running MySQL 8.0.23 and PHP 7.4.3. When I run this query manually I get no error, only a warning with the message described above. But I don't know why on xenforo it triggers an error.
 
Are you able to show me the transaction row that is pending approval? I'll try inserting it into my dev board and see if I can replicate it.

I'll need the MySQL INSERT statement for the transaction row causing the error.
 
Hello @Nataf,

We hope your ticket regarding DragonByte Credits has been addressed to your satisfaction. This ticket has now been scheduled to be closed.

If your ticket has not been resolved, you can reply to this thread at any point in the next 7 days in order to reopen the ticket, afterwards this thread will be closed.

Please do not reply to this thread if your ticket has been resolved.

Thank you.


- DragonByte Technologies, Ltd.
 
Hello @Nataf,

As we have not heard back from you, your ticket regarding DragonByte Credits has now been closed.

If your ticket has not been resolved, please feel free to start a new support ticket and link back to this ticket.

If you have time, please leave a review on XenForo.com's Resource Manager.

Thank you.


- DragonByte Technologies, Ltd.
 
Status
Not open for further replies.

DragonByte Credits

XenForo 1.5.3+ XenForo 2.0.x XenForo 2.1.x XenForo 2.2.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
4,247
Customer rating
5.00 star(s) 4 ratings
Back
Top