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) {
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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) {
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
Hi Lenggi,
Patched! Sorry about the delay.
-sujit