-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
Mapserver 6: Oracle and queryByAttributes doesn't run #4417
Comments
|
Can you post a patch for the options? Steve |
|
Is a diff-result capable for you? This is a diff of "my" maporaclespatial.c against the one of mapserver 6.0.3 This patch just assures, that mapserver runs for me. Example: In line 2291 Oracle answers with an OCI-error in the (legal) case, that the cursor is after the end. This OCI-error is stored in msOracleSpatialHandler.last_oci_status and will newly be found when TRY(...) is called I ask myself:
Sorry for being unspecific. (But it wasn't easy to break it down to this point anyway :-) Thank's for taking care. |
|
I wish I was the main Oracle Spatial author. I'm not familiar with the code and can't test on my end. Will try and get Mike Smith in on this one too. Steve |
|
cc @msmitherdc |
|
cc @aboudreault Alan is back only next week, but hopefully between him and Mike they can sort this out. |
|
Does still anybody take care? |
|
@benediktrothe please try the fix that I just pushed to https://github.com/unicolet/mapserver/compare/oraclespatial |
|
Sorry Umberto. |
|
Please send me the map file, java program and a dataset (oracle exp) so that I can try to reproduce the bug |
|
Here ist the mapfile I use with the small java program to reproduce the bug. Anh here ist the full testprogram: package de.hydrotec.ims;
import java.io.File;
import java.io.IOException;
import edu.umn.gis.mapscript.imageObj;
import edu.umn.gis.mapscript.layerObj;
import edu.umn.gis.mapscript.mapObj;
import edu.umn.gis.mapscript.mapscript;
public class DrawMaps {
public static void main(String argv []) throws IOException {
makeMap(argv);
}
public static void makeMap(String argv []) throws IOException {
mapObj map = new mapObj("small.map");
map.setSize(1000,800);
layerObj gemLayer = map.getLayerByName("Gemeinden");
gemLayer.queryByAttributes(map, null, "Gemeinde_id=2", mapscript.MS_SINGLE);
imageObj img = map.drawQuery();
String fName =File.createTempFile("pic", ".png").toString();
img.save(fName , map);
System.out.println(fName);
}
} |
|
@benediktrothe I got it working now, please confirm |
|
Hi Umberto Thank you. Now this patch works for me fine. Good work. |
fix for #4417: Oracle and queryByAttributes doesn't run
|
This one is sticky. I ust checked out Mapserver 6.2 and the problem rises again. The map file and the testprogram are still capable to reproduce the bug. I'd like to see this in the next Mapserver release. |
|
Benedikr, sorry about this. We reverted the patch because it was breaking Umberto On Friday, November 16, 2012, Benedikt Rothe wrote:
|
|
IRC: We could. But to be honorable I'm not used to it. I prefer slower communication to have more time for mediation:-) If you think it's helpful, make a suggestion... I don't remember the original patch. But I hardly believe, that the suggested patch has any bad side-effects. The difference to the original version is just in resetting "hand->last_oci_status". It's quite unlikely, that other code needs this flag in this situation. Do you know which code was breaking? The patch is important: Without it one cannot use Oracle-Layers with selections. Benedikt |
|
@benediktrothe see #4432 and #4508 |
|
I had a look on #4508
I'm quite confident :-) What to do? There is a new mapserver-testsuite. What about new testcases?
Unfortunately testsuites are a bit awkward, when they need a database... |
|
Sorry for the delay I have now opened a pull request with your patch, could you please give it Regards, On Tue, Nov 20, 2012 at 10:51 AM, Benedikt Rothe
|
|
Hi Umberto I think you asked me to reconfirm this patch, didn'tyou? I do: This patch is what I suggested and it runs fine for me :-) Thank you |
|
yes I did and thanks for taking the time to write a patch. I will merge it On Wed, Dec 12, 2012 at 4:27 PM, Benedikt Rothe notifications@github.comwrote:
|
Oracle and queryByAttributes doesn't run (#4417), patch by Benedikt Rothe Merging: confirmed by Benedikt
fix for MapServer#4417: Oracle and queryByAttributes doesn't run
Oracle and queryByAttributes doesn't run (MapServer#4417), patch by Benedikt Rothe Merging: confirmed by Benedikt
This is an automated commentThis issue has been closed due to lack of activity. This doesn't mean the issue is invalid, it simply got no attention within the last year. Please reopen with missing/relevant information if still valid. Typically, issues fall in this state for one of the following reasons:
|
We are using Mapserver 6.0.3
We think there is a serious problem in the TRY-Method of maporaclespatial.c
SHORT DIAGNOSIS:
I think there is a serious problem in the TRY-Method of maporaclespatial.c.
After the first error in the msOracleSpatialHandler this method will always return 0, which indicates an error.
Therefore mapserver won't work with this msOracleSpatialHandler after the first OCI-error occured with it.
COMPLEX DIAGNOSIS:
A testcase where this becomes a problem is
The layer Gemeinde must be the second layer.
This will fail with the message:
[Fri Aug 03 10:35:58 2012].64000 msOracleSpatialLayerGetShape():
OracleSpatial error. Shape type is null... this probably means a record number was requested that could not have beeen in a result set (as returned by NextShape).
This message occurs while drawing the query-layer (of "Gemeinden").
This message indicates, that there is an problem on converting a Spatial-Geometry to a Mapserver-Geometry in "osGetOrdinates".
Inside "osGetOrdinates" there is an OCI-call surrounded with TRY and this TRY returns 0/error.
In reality the OCI-error already occured while drawing another layer, which used the same msOracleSpatialHandler.
And every layer will cause at least one OCI-Error in msOracleSpatialLayerNextShape when reaching the end of the Cursor!
THERAPY:
Option 1:
In TRY remove the "if (hand->last_oci_status == MS_FAILURE) ..." statement.
Since sequences of OCI-Calls are usually made with TRY() && TRY() ...
this statement seems superflous.
Option 2:
Reset hand->last_oci_status to MS_SUCCESS often.
Reset it in msOracleSpatialLayerNextShape (after moving the cursor)
Rest at the beginning of msOracleSpatialLayerGetShape
I implemented Option 2. After this the test passed.
The text was updated successfully, but these errors were encountered: