Aladdin - Scala Bugtracking
[#1012] project: api priority: low category: bug
submitter assigned to status date submitted
Iulian Gilles open 2007-03-23 10:31:41.0
subject [contrib #384] Relation.elements.hasNext returns true for empty results
code
/*
* First create the table
*
* mysql -u username --password=password -D test \
* -e "create table Tab(col VARCHAR(100));"
*
*/
import scala.dbc._
import scala.dbc.Syntax._
import syntax.Statement._
import java.net.URI
import scala.compat.Platform


object Test extends Application{
    val db = new Database(
      new Vendor {
        val nativeDriverClass = java.lang.Class.forName("com.mysql.jdbc.Driver")
        val uri = new URI("jdbc:mysql://localhost/test")
        val user = "username"
        val pass = "password"
        val urlProtocolString = "jdbc:mysql"
        val retainedConnections = 1
    
      })

    val res = db.executeStatement({
      select fields ("col" of characterVarying(100)) from "Tab"
    }, true)

    System.out.println(res.elements.hasNext)
}
what happened
Prints:
true

I could not test this one, since I don't have mysql, but I assume there's something wrong there.
what expected Should print: false
[back to overview]
Changes of this bug report
Iulian  edited on  2007-03-23 10:32:36.0