agesys-dev team mailing list archive
-
agesys-dev team
-
Mailing list archive
-
Message #00116
[Bug 1076592] [NEW] reading invalid dates from mysql db raises exception
Public bug reported:
this should not happen because i want to be able to get the data in the
database out of the database even if it is invalid -- the db stores data
and if i store something dumb it should just let me get it back.
the only thing that really needs to change is lines 502-504 in
statement.pyx:
- elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP,
- MYSQL_TYPE_DATE) and d.t.year == 0:
- val = None
+ elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP,
+ MYSQL_TYPE_DATE) and (d.t.year == 0 or d.t.month == 0 or
+ d.t.day == 0):
+ val = PyString_FromStringAndSize(&d.c, c.length)
much better to deliver a meaningless string than a meaningful absence of
data where there wasn't one.
** Affects: oursql
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Agesys
Team, which is subscribed to oursql.
https://bugs.launchpad.net/bugs/1076592
Title:
reading invalid dates from mysql db raises exception
Status in oursql:
New
Bug description:
this should not happen because i want to be able to get the data in
the database out of the database even if it is invalid -- the db
stores data and if i store something dumb it should just let me get it
back.
the only thing that really needs to change is lines 502-504 in
statement.pyx:
- elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP,
- MYSQL_TYPE_DATE) and d.t.year == 0:
- val = None
+ elif c.type in (MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP,
+ MYSQL_TYPE_DATE) and (d.t.year == 0 or d.t.month == 0 or
+ d.t.day == 0):
+ val = PyString_FromStringAndSize(&d.c, c.length)
much better to deliver a meaningless string than a meaningful absence
of data where there wasn't one.
To manage notifications about this bug go to:
https://bugs.launchpad.net/oursql/+bug/1076592/+subscriptions
Follow ups
References