I am building a django app that uses SQLAlchemy over MySQL. I am using cdecimal instead of the built in Decimal.
In one of my tables, I have a Numeric value column (value = Column(Numeric(10, 5)).
When I create a new entry for this table in my django app, with the following SQL echo:
INSERT INTO my_table (date, value) VALUES (2012-03-11, 875334.670)
This causes the following exception to be thrown upon commit:
_mysql_exceptions.Warning: Out of range value for column 'value' at row 1
When I run the same query in the mysql client, no issues at all.
I even tried wrapping the code that adds the entry with:
import warnings
from sqlalchemy import exc as sa_exc
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=sa_exc.SAWarning)
What is going on?
Thanks!
Here is the issue: