MySQL floating point truncation warnings ( Resolved Issue )
The issue was created on Friday 02 March, 2007. The issue was added by Mike Pittaro.
We have been bumping into mysql floating point warnings like the following:
python testGraphMySQL.py
/usr/local/python244/lib/python2.4/site-packages/rdflib/store/FOPLRelationalModel/BinaryRelationPartition.py:631: Warning: Truncated incorrect DOUBLE value: 'F'
cursor.execute(query,tuple(unionQueriesParams))
/usr/local/python244/lib/python2.4/site-packages/rdflib/store/MySQL.py:170: Warning: Truncated incorrect DOUBLE value: 'F'
cursor.execute(qStr,tuple(params))
Theres a simple test case below that reproduces the warnings. I ran this under linux 2.6, with python 2.4.4 and MySQL 5.0.19.
mike
---------------------------------
import sys
import MySQLdb
from rdflib import RDF
from rdflib import URIRef, plugin
from rdflib.store import Store
from rdflib.Graph import Graph
from rdflib.Graph import ConjunctiveGraph
from rdflib.Namespace import Namespace
from rdflib.Literal import Literal
if __name__ == "__main__":
id = 'testdb'
db = 'rep2'
usr = 'mikeyp'
pwd = 'mikeyp'
hst = 'localhost'
cfgstr = "db=%s,user=%s,password=%s,host=%s" % (db,usr,pwd,hst)
store = plugin.get('MySQL', Store)(id)
try:
store.open(cfgstr, True)
except Exception, e:
if e.args[0] == 1050:
store.open(cfgstr, False)
else:
print "Exception", str(e)
sys.exit(1)
g = ConjunctiveGraph(store)
s = URIRef('http://test-mysql-warning')
p = Namespace('truncate-incorrect-DOUBLE-value')
o = Literal('arbitray-string', lang='en')
g.add((s, p, o))
g.commit()
pos = g.predicate_objects(s)
for (p, o) in pos:
g.remove((s, p, o))
g.commit()
Comments regarding MySQL floating point truncation warnings
by Daniel Krech on Monday 05 March, 2007:
by Mike Pittaro on Friday 02 March, 2007:
Login to submit a comment.