mysql reflection misses double type

Issue #106 resolved
Former user created an issue

MySQL supports double datatype. While performing reflection, it is recognized as MSString (default) which is obviously wrong.

Comments (4)

  1. Former user Account Deleted

    I choose sqltypes.Numeric as base type for MSDouble but it doesn't seem perfectly right. I could be wrong, but I assumed that Numeric is supposed to be "exact" fixed-point number. If this is not the case than Numeric is good base.

    MySQL manual says that DOUBLE has the following syntax:

    DOUBLE[(M,D)]((M,D)) [UNSIGNED](UNSIGNED) [ZEROFILL](ZEROFILL)
    

    It can be created without any precision, so I tweaked __init__ a little bit. It contains raise statement, with most likely the wrong exception type. We should probably raise something different.

    This patch also contains a fix for FLOAT datatype which in MySQL doesn't have precision. To quote mysql manual:

    p represents the precision in bits, but MySQL uses this value only to determine whether to use FLOAT or DOUBLE for the resulting data type
    

    So, if we got FLOAT from "DESCRIBE tablename" it means just FLOAT not FLOAT(10). This FLOAT(10) could actally mean something different to some other database.

  2. Former user Account Deleted

    I'm not sure how this Numeric type without precision is going to work in other parts of the library (or on different engines if this is possible to happen). Do we need another base type?

  3. Former user Account Deleted

    I also found lack of support for tinyint. To enable it add:

    'tinyint' : MSSmallInteger,
    

    into ischema_names dict.

  4. Log in to comment