Bug #9994
Err: Cannot run GET methods on query until it is opened.
100%
History
#1 Updated by Paula Păstrăguș about 1 year ago
- File pt-table.png added
- File err-9810.png added
This error is thrown when performing GET-NEXT on a query like the following:
for each pt where f3 = false and f1 ne 'abc1' and pt.f1 begins 'r' no-lock
Below is the test case and the errors currently raised by FWD:
def var q1 as handle.
def var cWhere as char.
def var h1 as handle.
def var tableName as char initial "pt".
create buffer h1 for table tableName.
create query q1.
q1:set-buffers(h1).
cWhere = "for each pt where f3 = false and f1 ne 'abc1' and pt.f1 begins 'r' no-lock". // -----------> smth with 0 results
q1:query-prepare(cWhere).
q1:QUERY-OPEN().
repeat:
q1:GET-NEXT().
IF q1:QUERY-OFF-END THEN LEAVE.
END.
h1:BUFFER-RELEASE().
q1:QUERY-CLOSE().
FWD Output:
Table definition:
#2 Updated by Alexandru Lungu about 1 year ago
- Assignee set to Stefanel Pezamosca
Paula/Radu, please adjust the priority of this task accordingly.
#3 Updated by Radu Apetrii about 1 year ago
- Priority changed from Normal to Urgent
Unfortunately, I think this is an urgent one. It makes a customer application freeze, and the logs are overly populated because of it.
#4 Updated by Stefanel Pezamosca about 1 year ago
- Priority changed from Urgent to Normal
First observation: The error does not reproduce when using a temp-table.
This works:
Temp-Table testcase
#5 Updated by Stefanel Pezamosca about 1 year ago
- Priority changed from Normal to Urgent
- Status changed from New to WIP
#6 Updated by Stefanel Pezamosca about 1 year ago
I don't get the error as in #9994-1, the query is parsed correctly on my side. Am I missing something? Paula, could you test again and tell what trunk revision you are using?
#7 Updated by Paula Păstrăguș about 1 year ago
- Assignee deleted (
Stefanel Pezamosca)
I m using rev 15907. I'm still able to replicate the issue.
#8 Updated by Paula Păstrăguș about 1 year ago
- Assignee set to Stefanel Pezamosca
#9 Updated by Paula Păstrăguș about 1 year ago
It seems the browser I’m using is messing with the task info a bit :) Sorry for the inconvenience!
#10 Updated by Alexandru Lungu about 1 year ago
Paula Păstrăguș wrote:
I m using rev 15907. I'm still able to replicate the issue.
Please post the DB schema including indexes used. The .df should do the trick.
#11 Updated by Paula Păstrăguș about 1 year ago
I’ve attached the .d and .df files. After importing them, please update the pt table in pgAdmin by adding a new column (f3), and set this new column to false for each record (there are only two records).
Alex, these are the default schemas we’re using with the dataset project. I just updated the table with a new column to match the problematic query.
#12 Updated by Stefanel Pezamosca about 1 year ago
This could be the issue, as the f3 column is added manually and is not part of the .df. Additionally, the f3 property will not be present in the DMO.
#14 Updated by Paula Păstrăguș about 1 year ago
Okay, but this still doesn’t explain why a customer application fails with this exact error when running a query like the one from the test case.
#15 Updated by Stefanel Pezamosca about 1 year ago
As Constantin pointed out in #9810-98, this error also occurs in OE in situations where a field is used but not defined in the schema. There may also be a bug in the customer code.
def temp-table pt field f1 as char.
def var q1 as handle.
def var cWhere as char.
def var h1 as handle.
def var tableName as char initial "pt".
create buffer h1 for table tableName.
create query q1.
q1:set-buffers(h1).
cWhere = "for each pt where f3 = false and f1 ne 'abc1' and pt.f1 begins 'r' no-lock".
q1:query-prepare(cWhere).
q1:QUERY-OPEN().
repeat:
q1:GET-NEXT().
IF q1:QUERY-OFF-END THEN LEAVE.
END.
h1:BUFFER-RELEASE().
q1:QUERY-CLOSE().
message "Done!".
#16 Updated by Stefanel Pezamosca about 1 year ago
Since this task doesn't reflect the actual issue discovered in 9810-100, I think it should be marked as Rejected at this point.
If needed, we'll create a new issue, but it will probably be specific to the customer.
#17 Updated by Paula Păstrăguș about 1 year ago
From my POV, I suggest waiting until we receive a clear response from the customer, as the original task is currently in Feedback.
#18 Updated by Stefanel Pezamosca about 1 year ago
- Status changed from WIP to Feedback
#19 Updated by Stefanel Pezamosca about 1 year ago
This can be closed/rejected.
#20 Updated by Greg Shah about 1 year ago
- Status changed from Feedback to Rejected
- % Done changed from 0 to 100