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

Case sensitive error message test #81

@dkubb

Description

@dkubb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions