I have a bit of sql where I query for some room details below. The issue I have is that the name of room 3314 happens to be NULL. In the lua version, the query below fails. If I run the same query in sqlite, I get the single row back correctly with a NULL r.name. How can I get this to work in lua with the NULL value? If I put something in the name column, the lua version starts working.
-- lua mushclient version:
local sql = "SELECT r.name, r.area_id, a.name AS area_name FROM ROOMS r JOIN AREAS a ON a.id = r.area_id WHERE r.id = 3314;"
for name, area_id, area_name in self.db:urows (sql) do
print ("WORKED")
end
--[[
sqlite3 version:
SELECT r.name, r.area_id, a.name AS area_name FROM ROOMS r JOIN AREAS a ON a.id = r.area_id WHERE r.id = 3314;
--]]
-- lua mushclient version:
local sql = "SELECT r.name, r.area_id, a.name AS area_name FROM ROOMS r JOIN AREAS a ON a.id = r.area_id WHERE r.id = 3314;"
for name, area_id, area_name in self.db:urows (sql) do
print ("WORKED")
end
--[[
sqlite3 version:
SELECT r.name, r.area_id, a.name AS area_name FROM ROOMS r JOIN AREAS a ON a.id = r.area_id WHERE r.id = 3314;
--]]