This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Japanese community user kindly reported this issue. The entry of blog was posted in Japanese but you can find what's wrong by screenshots. http://d.hatena.ne.jp/shin/20090611/p1 When getPrecision() returns 0 (e.g. in PostgreSQL), validate() of DBReadWriteHelper.java is not working properly. When we try to update text on DB editor (invoked by show data), it causes the following dialog. http://shin.cside.com/diary/2009/0611-04.png It seems that the following codes are not correct. db.dataview/src/org/netbeans/modules/db/dataview/util/DBReadWriteHelper.java: public static Object validate(Object valueObj, DBColumn col) throws DBException { case Types.CHAR: case Types.VARCHAR: case Types.LONGVARCHAR: case -9: //NVARCHAR case -8: //ROWID case -15: //NCHAR if (valueObj.toString().length() > col.getPrecision()) { String colName = col.getQualifiedName(false); String errMsg = "Too large data \'" + valueObj + "\' for column " + colName; throw new DBException(errMsg); } return valueObj; case col.getPrecision() == 0 should be cared for some databases. So "col.getPrecision() != 0 &&" needs to be added. if (col.getPrecision() != 0 && valueObj.toString().length() > col.getPrecision()) {
The hint for patch looks good but I need some information how to reproducible the problem. I tried reproduce it on my PostreSQL database and IDE didn't allow me to make a column which returns 0 from getPrecision(). I guess UI in DB support avoid creating such columns. Please, give my steps how to reproduce. Thanks
Hi Jiri, Thank you very much for evaluation! I'm sorry I don't know how to create such columns - probably it was created outside ide. getPrecision() for 'varchar' and 'text' may return 0. It happens only in PostgreSQL. http://archives.postgresql.org/pgsql-jdbc/2010-01/msg00077.php
Already fixed in NB6.8 Changeset: http://hg.netbeans.org/main-golden/rev/508c41bf7ef8 User: Jiri Rechtacek <jrechtacek@netbeans.org>