Menu

float returned as string in mysql5

Help
coyer
2005-12-04
2012-09-19
  • coyer

    coyer - 2005-12-04

    hi,

    when executing something like "select 5/10" (on mysql5) within MySQLdb, the returned result is a string rather a float.
    to be more precise: the field-type is returned as 246 and this is not defined in MySQLdb.

    Adding "246: float" in "converters.py"->"conversions"-dictionary solves this problem for me - but i'm not sure if the field-type of 246 describes alway a float...

    regards

    coyer

     
    • Andy Dustman

      Andy Dustman - 2005-12-04

      It's actually MYSQL_TYPE_NEWDECIMAL=246. Float is mostly sufficent for this, but Python 2.4 also has a Decimal type which would be a better fit.

      Please create a bug for this and I'll try to fix for 1.2.1.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.