Out of range value for column `min_to_receive` in `sbds_tx_limit_order_creates` table

in utopian-io •  7 years ago  (edited)

Bug description

Today I got this error in my docker logs:

ame": "INFO", "asctime": "2018-01-19T04:39:47.1516336787GMT", 
"filename": "__init__.py", "module": "__init__", "funcName": "adaptive_insert", "lineno": 168,
"msecs": 401.9653797149658, 
"message": "safe_merge_insert failed (raised as a result of Query-invoked autoflush; 
consider using a session.no_autoflush block if this flush is occurring prematurely) (_mysql_exceptions.DataError) (1264, \"Out of range value for column 'min_to_receive' at row 1\")
[SQL: 'INSERT INTO sbds_tx_limit_order_creates (block_num, transaction_num, operation_num, timestamp, owner, orderid, cancel, amount_to_sell, min_to_receive, fill_or_kill, expiration, operation_type) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)'] 
[parameters: (5166963, 1, 1, datetime.datetime(2016, 9, 21, 15, 49, 24), 'ausbitbank', 1474472955, 0, 181.25, 18125000000.0, 0, '1969-12-31T23:59:59', 'limit_order_create')]", 
"name": "sbds.storages.db", "pathname": "/usr/local/lib/python3.5/dist-packages/sbds/storages/db/__init__.py", "process": 37, 
"processName": "ForkPoolWorker-1", "threadName": "MainThread"}

The SBDS tried to insert 18125000000.0 into the column min_to_receive. But I found that the column's length is decimal(15,6).
18125000000.0 is out of range for min_to_receive. The column need at least decimal(17,6).



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Your contribution cannot be approved because it does not follow the Utopian Rules.
Welcome to utopian and thanks for posting, please read our rules before posting, it'll save you ton of time and energy.

  • The repo selected Doesnt have a license File (i know its not like you can add a License file without the write access. But we dont accept Repo's without open-source License)
  • It seems like you are pushing digits out of the bound to create this bug. Although realistic speaking someone entering 18125000000.0 to transfer is not possible.I'm not saying its never possible, It May occur. But it seems like you are trying to Overflow the Decimal buffer.

You can contact us on Discord.

[utopian-moderator]