Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Case sensitive error message test #81

Open
dkubb opened this issue Mar 28, 2015 · 0 comments
Open

Case sensitive error message test #81

dkubb opened this issue Mar 28, 2015 · 0 comments

Comments

@dkubb
Copy link
Member

dkubb commented Mar 28, 2015

See: https://github.com/datamapper/do/blob/master/do_jdbc/src/main/java/data_objects/Command.java#L324

In the above code the system checks if the error message is equal to "query does not return results". I'm seeing errors in DM's specs because the error is now being returned as "Query does not return results".

Locally I made the following change:

diff --git a/do_jdbc/src/main/java/data_objects/Command.java b/do_jdbc/src/main/java/data_objects/Command.java
index 6edac92..70be2bc 100644
--- a/do_jdbc/src/main/java/data_objects/Command.java
+++ b/do_jdbc/src/main/java/data_objects/Command.java
@@ -321,7 +321,7 @@ public class Command extends DORubyObject {
         } catch (SQLException sqle) {
             // XXX sqlite3 jdbc driver happily throws an exception if the result set is empty :P
             // this sets up a minimal empty reader
-            if (sqle.getMessage().equals("query does not return results")) {
+            if (sqle.getMessage().toLowerCase().equals("query does not return results")) {

                 // pass the response to the Reader
                 reader.resultSet = resultSet;

And it seemed to resolve the problem I was seeing in the specs.

If there's no problem with this kind of fix I can submit a PR with this change.

dkubb referenced this issue in datamapper/dm-migrations Mar 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant