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:

Fillip H.

Staff member
Owner
Developer
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).
 

Nataf

Customer
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:

Nataf

Customer
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).
 

Fillip H.

Staff member
Owner
Developer
Ah I see it now, it's because you have your currency set to 9 decimals. Reduce it to 8 or fewer.
 

Fillip H.

Staff member
Owner
Developer
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.
 

Nataf

Customer
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.
 

Fillip H.

Staff member
Owner
Developer
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.
 

DragonByte Technologies

Company Information
Staff member
Company Info
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.
 
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
3,195
Customer rating
5.00 star(s) 4 ratings
Top