julianhyde/optiq — pull request #191 by gabrielreid (2014-03-18 14:59:48+00:00)
Title: Rework calendar handling for time-based cols

This change makes is so that ResultSet#getDate(int) (and getTimestamp and getTime) is called on an underlying JDBC connection if no custom calendar is available, instead of calling ResultSet#getDate(int, Calendar) with a null Calendar (the latter causes NPEs in Phoenix, and possibly other JDBC drivers).

In order to get this working, I had to make a number of changes to the OptiqAssert framework as well to allow supplying a custom Calendar. It seems that the HSQLDB ResultSet performs quite differently if you use getTimestamp(int) compared to getTimestamp(int, null). It seems like it would be more ideal to not make the changes to OptiqAssert, but I wasn't able to find a way around it (I'm assuming that this is a bug in HSQLDB).