I'm getting an odd error (running MySQLdb 1.2.0 against MySQL 5.0.18 on a SPARC Solaris 8) while attempting to dispatch a simple select against a tables where a hardcoded string is being added to the result set (within the SQL query). In particular, I get this error when I connect with use_unicode=True (which I'm using because I need to have my results return as unicode not strings).
the query:
select
typeTable.member as subject,
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type" as predicate,
typeTable.klass as object,
typeTable.context as context,
typeTable.termComb as termComb,
NULL as objLanguage,
NULL as objDatatype
from
type_statements as typeTable
where
typeTable.klass = "http://purl.org/rss/1.0/channel"
order by subject,predicate,object
The table structure:
CREATE TABLE type_statements (
member text not NULL,
klass text not NULL,
context text not NULL,
termComb tinyint unsigned not NULL,
INDEX member_index (member(100)),
INDEX klass_index (klass(100)),
INDEX c_index (context(50))) TYPE=InnoDB CHARACTER SET utf8
The traceback error I'm getting:
File "/home/ogbujic/lib/python2.4/site-packages/rdflib/store/AbstractSQLStore.py", line 576, in triples
c.execute(q,tuple(parameters))
File "/home/ogbujic/lib/python2.4/site-packages/MySQLdb/cursors.py", line 137, in execute
self.errorhandler(self, exc, value)
File "/home/ogbujic/lib/python2.4/site-packages/MySQLdb/connections.py", line 33, in defaulterrorhandler
raise errorclass, errorvalue
ReferenceError: weakly-referenced object no longer exists
I'm pretty certain the error has to do with the combination of the use of unicode and the fact that a string is being hardcoded into the SELECT result set, but I'm not sure how to proceed.
Chimezie
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm getting an odd error (running MySQLdb 1.2.0 against MySQL 5.0.18 on a SPARC Solaris 8) while attempting to dispatch a simple select against a tables where a hardcoded string is being added to the result set (within the SQL query). In particular, I get this error when I connect with use_unicode=True (which I'm using because I need to have my results return as unicode not strings).
the query:
select
typeTable.member as subject,
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type" as predicate,
typeTable.klass as object,
typeTable.context as context,
typeTable.termComb as termComb,
NULL as objLanguage,
NULL as objDatatype
from
type_statements as typeTable
where
typeTable.klass = "http://purl.org/rss/1.0/channel"
order by subject,predicate,object
The table structure:
CREATE TABLE type_statements (
member text not NULL,
klass text not NULL,
context text not NULL,
termComb tinyint unsigned not NULL,
INDEX member_index (member(100)),
INDEX klass_index (klass(100)),
INDEX c_index (context(50))) TYPE=InnoDB CHARACTER SET utf8
The traceback error I'm getting:
File "/home/ogbujic/lib/python2.4/site-packages/rdflib/store/AbstractSQLStore.py", line 576, in triples
c.execute(q,tuple(parameters))
File "/home/ogbujic/lib/python2.4/site-packages/MySQLdb/cursors.py", line 137, in execute
self.errorhandler(self, exc, value)
File "/home/ogbujic/lib/python2.4/site-packages/MySQLdb/connections.py", line 33, in defaulterrorhandler
raise errorclass, errorvalue
ReferenceError: weakly-referenced object no longer exists
I'm pretty certain the error has to do with the combination of the use of unicode and the fact that a string is being hardcoded into the SELECT result set, but I'm not sure how to proceed.
1.2.1c4 should resolve any unicode issues (was an early 1.2.1 fix)
This error has nothing to do with UNION selects (as I originally thought - hence the title)