Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
import org.axiondb.jdbc.AxionDataSource
class GroovySQLTest extends GroovyTestCase {
void testGroovySQL() {
dataSource = new AxionDataSource("jdbc:axiondb:foo" + getMethodName());
sql = new groovy.sql.Sql(dataSource);
sql.execute("create table groovytest ( anint integer, astring varchar )");
groovytest = sql.dataSet("groovytest")
groovytest.add( anint:1, astring:"Groovy" )
groovytest.add( anint:2, astring:"rocks" )
// this line messes up things:
Integer id = 0;
sql.eachRow("SELECT * FROM groovytest ORDER BY anint")
{ id = it.anint; } assert id == 2;
}
}
id = 0; works
Integer id; doesn't but generates a different error