Bug #688 Should a moveToInsertRow() assign default database values to fields?
Submitted: 19 Jun 2003 16:45 Modified: 20 Jun 2003 7:26
Reporter: David Marquis Email Updates:
Status: Closed Impact on me:
Category:Connector / J Severity:S4 (Feature request)
Version:all ? OS:Any (all)
Assigned to: Mark Matthews CPU Architecture:Any

[19 Jun 2003 16:45] David Marquis
I don't know if it's in the JDBC-spec but,I loose nothing to ask anyways. When a call to moveToInsertRow() is made, should the driver assign default values to every fields on the insert row ?

How to repeat:
id int not null primary key,
isValid ENUM('T','F') DEFAULT 'T'

ResultSet set (...)
set.getBoolean("isValid") always returns false.

Suggested fix:
I know DatabaseMetaData.getColumns returns default values (COLUMN_DEF), so maybe it is not a big deal to gather default values around this code ?
[20 Jun 2003 7:26] Mark Matthews
This is now fixed in the development tree for both 3.0.x and 3.1.x. You can check out a nightly snapshot after 00:00 GMT 21-June-03 from http://mmmysql.sourceforge.net/snapshots/ to test it, or wait for Connector/J 3.0.9 to be released, which should be sometime in the next few days.

Thanks for your bug report!