Hard crashing due to fields not specified in SQL
Steve Albin
steve at steve-albin.com
Thu Jul 5 16:28:02 CDT 2007
In my V4RB 3.0.1 app, I had this SQL:
Select Issues.recid, Issues.nId, Labels.cLabelIdx
FROM Issues, Labels, Sessions, Perfs, IssPerfs
WHERE Sessions.nLabelid = 301
AND Sessions.nSessId = Perfs.nSessId
AND Perfs.nPerfId = IssPerfs.nPerfId
AND Issues.nid = issPerfs.nIssueId
AND Issues.nLabelId = Labels.nId
AND Issues.cFormat = 32
ORDER BY Issues.cCatnum, Issues.cTitleIdx
Everytime my app tried to execute this SQL, I would get a hard crash on the Mac. No exception processing, just a friendly message from OS X that my app is gone. In the Valentina log, this SQL is the last thing in the file with no return object.
I tried the same SQL in VStudio. No problem - works like a charm!
Then I changed the SELECT clause in my app to explicitly specify every field referenced in the WHERE and ORDER BY clause. Below is what I have now:
Select Issues.recid, Issues.nId, Labels.cLabelIdx, sessions.nlabelid, sessions.nsessid,
perfs.nSessid, perfs.nperfid, issperfs.nPerfid, issPerfs.nIssueId, Issues.nLabelId,
Labels.nid, Issues.cFormat, issues.cCatnum, issues.ctitleidx
FROM Issues, Labels, Sessions, Perfs, IssPerfs
WHERE Sessions.nLabelid = 301
AND Sessions.nSessId = Perfs.nSessId
AND Perfs.nPerfId = IssPerfs.nPerfId
AND Issues.nid = issPerfs.nIssueId
AND Issues.nLabelId = Labels.nId
AND Issues.cFormat = 32
ORDER BY Issues.cCatnum, Issues.cTitleIdx
This works fine in my app. No crashing.
The original SQL worked in my old app using V4RB1 and V4RB2.
Three questions:
1) Is it the case now that we need to specify every field we reference in the SELECT clause?
2) Why the hard crash on my app and not VStudio?
3) Should I enter this in Mantis?
Steve
--
Steve Albin - Montclair, NJ
http://www.jazzdiscography.com/
http://www.steve-albin.com/
More information about the Valentina
mailing list