-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crash in oracle_fdw 2.1.0 #279
Comments
Thanks for the test and the report! Since I don't have the HR schema around, would you mind sending me the |
i'm not very knowledgable about Oracle so i'm not sure how i get that, what i did was to export the whole schema with /u01/app/oracle/product/11.2.0/xe/bin/exp let me know if this is what you need or how to get a sql script with CREATE objects and rows of those objects |
I have been trying to reduce the query as much as possible and have been able to come up with a similar query using our regression test table that also crashes:
The error happens in @yamatattsu, can you see if you can figure out something? |
Hi Laurenz!
I tried the query using PG10.4 and oracle_fdw 2.1.0 but I couldn't get the error. Regards, |
Hi @yamatattsu, I noted that to replicate the failure using typetest1 table you need to add at least one row to it, the one i added was: Also i reproduced the original problem on all versions starting in 9.6 (latest minor version in each case) upto master. For example, in v10 i used 10.5.
Only if you send us a video of your talk ;) enjoy pgconf.eu |
Hi, Jaime and Laurenz,
Thank you. I reproduced it using PG10.5 but I couldn't reproduce it on PG10.4.
Oh, I see. Regards, |
Thanks for the new information. I'll see if I can make any progress with that. |
I just built 10.4 and 10.5 from source, and the query crashed both of them. |
Ah, I have a lead:
The problem is clearly that the Oracle query has |
right, you need at least a.c and a.vc for the query to work:
btw, in a maybe non-related failure i got an ERROR when trying to explain analyze that last query:
|
Jaime, that last error message is covered by the README:
|
The problem is in In But rather than passing @yamatattsu, this is a bit above my head. I'll let you have a go at it (whenever you find the time). Maybe I broke something in 1e53ada... |
is there any advance on this? i can try to do something but this is not at my level i will be like a monkey trying to write a coherent phrase on a keyboard ;) |
Hi All, Happy new year! :) I restart to investigate the problem. I've not checked oracleGetForeignPlan and build_join_oratable yet. [First time]
[Second time]
[Execution plan of the first time]
[Execution plan of the second time]
So, I guess following code is wrong in createQuery() because fdwState->where_clause didn't have all fillter conditions based on Outerrel and Innerrel.
@laurenz, What do you think about that? BTW,
I uploaded it on PGConf.Eu web site last year. Sorry for the delayed response. |
Hi All, Oops, above investigation is wrong, probably. I'll check oracleGetForeignPlan and build_join_oratable tomorrow. Thanks, |
I wonder why there is no error after Explain command execution. [A]
[B]
|
Hi, I checked oraTable and fdw_scan_tlist by using debugger. I share my results to you. :) The results are:
Therefore, [Query]
[Breakpoints]
[Breakpoint 1]
[Breakpoint 2]
[Breakpoint 3]
|
build_join_oratable() couldn't create suitable oraTable when foreignrel->reltarget is empty. Therefore, this fix replaces foreignrel->reltarget with fdw_scan_list as a parameter. Reported by Jaime2ndQuadrant in #279.
Hi Laurenz and Jaime2ndQuadrant, I realized foreignrel->reltarget which is given form PostgreSQL core is empty sometimes. To fix, I replaced the parameter with fdw_scan_tlist because fdw_scan_tlist contains all colmuns in the query. And It seems that the fix works fine since creating suitable oraTable by using fdw_scan_tlist. I commited the patch, if possible, could you check and try the patch? 839b125 Regards, |
Hi @yamatattsu I still haven't tested your patch, but it makes sense... actually i got the same conclusion just wasn't able to code it... will test the patch later today, thanks |
Thank you! Could you add my crasher query from above to the regression tests? |
Hi Laurenz!
Could you add my crasher query from above to the regression tests?
Sure. I'll do that tomorrow, maybe. :)
Regards,
Tatsuro Yamada
|
Hi Laurenz! I created following regression test. Is it fine with you?
Thanks, |
What about simply using my query from here? Then we don't need an extra foreign table. |
at last i could test this (i cherry-picked this into 2.1.0) and it worked just fine, this will be backpatched to older branches with the same bug? good work @yamatattsu and @laurenz |
Thanks for checking. oracle_fdw only has a single persistent branch, and the idea is that the master branch is always kept stable. |
I have been running sqlsmith on postgres with oracle_fdw (2.1.0) and found a crash. I reduced the example as much as i could and i was able to reproduce it from 9.6 upto master (didn't try with other versions).
To reproduce it:
I also attached the stack trace of the crash. Let me know if i can help debugging this in any other way.
gdb.txt
query_crash.txt
The text was updated successfully, but these errors were encountered: