Menu

Patch for MySQL 5

Developers
lenggi
2006-05-02
2013-04-25
  • lenggi

    lenggi - 2006-05-02

    Hi there,
    I've recently started using sqlunit together with MySQL 5.0. I really like it and I'd like to thank all those who worked on that project.
    I've noticed some problems with MySQL, particularly because the JDBC driver is quite "rude" when it comes to handling stored procedure calls.
    I encountered an annoying problem when I tried to assign an out parameter to a variable. It turned out to be a simple thing, so I wrote a patch you'll find below.
    Feel free to integrate it in the current code, hope it helps.
    cheers,
    lenggi

    --- net/sourceforge/sqlunit/handlers/CallHandler.java   2005-07-20 17:34:06.000000000 +0200
    +++ /tmp/sqlunit-4.9/src/net/sourceforge/sqlunit/handlers/CallHandler.java      2006-05-02
    21:14:06.000000000 +0200
    @@ -170,8 +170,8 @@
                 }
                 if (params[i].isOutParameter()) {
                     if (SymbolTable.isVariableName(params[i].getValue())) {
    -                    SymbolTable.setValue(SymbolTable.OUT_PARAM + tcs + ":"
    -                        + i + "}", params[i].getValue());
    +                    SymbolTable.setValue(SymbolTable.OUT_PARAM + tcs.hashCode()
    +                                        + ":" + i + "}", params[i].getValue());
                     }
                     String className = TypeMapper.findClassByName(
                         params[i].getType());
    @@ -223,8 +223,8 @@
                     outParam.setId(params[i].getId());
                     outParam.setName(params[i].getName());
                     outParam.setType(params[i].getType());
    -                String outParamSymbol = SymbolTable.removeSymbol(
    -                    SymbolTable.OUT_PARAM + tcs + ":" + i + "}");
    +                String outParamSymbol = SymbolTable.removeSymbol(SymbolTable.OUT_PARAM +
    +                                                                tcs.hashCode() + ":" + i + "}");
                     // get the value from the CallableStatement
                     Object value = tcs.getObject(i + 1);
                     if (value instanceof ResultSet) {

     
    • Sujit Pal

      Sujit Pal - 2006-05-13

      Hi lenggi,

      Thanks for the patch. I am having some trouble with the Sourceforge CVS changeover, will incorporate your patch as soon as I get my local code to update with the latest in the repository.

      -sujit

       
    • Sujit Pal

      Sujit Pal - 2006-06-10

      Hi Lenggi,

      Patched! Sorry about the delay.

      -sujit

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.