Ticket #208 (closed defect: fixed)
(string->number x 10) expects string but is getting #<sql-null>
Reported by: | gknauth | Owned by: | jaz |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | jaz/mysql.plt | Keywords: | |
Cc: | Version: | (1 5) | |
Racket Version: | 4.2.1.8 |
Description
string->number: expects type <string> as 1st argument, given: #<sql-null>; other arguments were: 10
I get this error with the following:
(query-rows (string-append
"select a.type, "
"a.number, "
"a.due, "
"w.submitted, "
"w.raw_grade, "
"w.adj_grade, "
;"w.extension, "
"a.description "
"from work w "
"join assignment as a on w.fk_assignment=a.id "
"join term as te on te.code='F09' and a.fk_term=te.id "
"join student as s on s.handle='student123' "
"join course as co on co.code='CPTR 346' "
"join class as cl on cl.fk_course=co.id and cl.fk_term=te.id "
"join enrollee as e on w.fk_enrollee=e.id and e.fk_student=s.id and e.fk_class=cl.id "
"order by a.type, a.number"))
I can proceed without the error if I comment out the line:
"w.adj_grade, "
MySQL type of w.adj_grade is float.
I've traced the error to line 1911 of mysql.plt v1.5, inside text-decoder-map.
Apparently x is supposed to be a string, but sometimes it's #<sql-null>.