#148 Default values aren't typed in MySQL tables w/ fromDatabase

closed-fixed
Oleg Broytman
MySQL (29)
5
2014-10-26
2006-01-25
Anonymous
No

The default values given in a MySQL table are passed in as string values in
the the 'MySQLConnection.columnsFromSchema' method.

For example, a simple table that describes a column like so:
age INT NOT NULL DEFAULT 0
...will actually create a IntCol object whose default is '0' (stringified zero).

Attached is a local patch I have to handle the various numeric and date/
time columns. Will follow-up with additional tests to verify the changes...

----------

Using Python 2.4.1 and SQLObject r1536

URL: http://svn.colorstudy.com/SQLObject/trunk
Repository UUID: 95a46c32-92d2-0310-94a5-8d71aeb3d4b3
Revision: 1536

Discussion

  • diff file for the changes to mysql/mysqlconnection.py

     
    Attachments
  • Oleg Broytman
    Oleg Broytman
    2006-05-18

    Logged In: YES
    user_id=4799

    The patch is almost good, except for datetime. The patch
    used datetime which is not available in Python 2.2
    (SQLObject still supports Python 2.2). Please use the same
    route as in col.py - check what is available and what is
    prefered by the user.

     
  • Oleg Broytman
    Oleg Broytman
    2014-10-26

    • status: open --> closed-fixed
    • assigned_to: Oleg Broytman