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.
Build: NetBeans IDE 6.8 (Build 200912041610) VM: Java HotSpot(TM) 64-Bit Server VM, 14.1-b02, Java(TM) SE Runtime Environment, 1.6.0_15-b03 OS: Linux User Comments: schkovich: Opening Procedurures database node. Error was raised when parsing return value of user function. Here is function definition: CREATE DEFINER=`root`@`localhost` FUNCTION `getCitizenship`( userId int unsigned, lng char(2) ) RETURNS varchar(255) CHARSET utf8 BEGIN DECLARE citizenship VARCHAR(255); SET citizenship = ( SELECT c.name FROM countries AS c, country_codes AS cc, languages AS l, users_citizenship AS uc WHERE cc.a2 = uc.citizenship AND l.lng = lng AND l.id = c.lng AND cc.id = c.cc_id AND uc.id = userId ); IF (citizenship IS NULL) THEN RETURN ''; ELSE RETURN citizenship; END IF; END GUEST: create a procedure using decimal(30,0) as parameter. GUEST: Connection to Database schkovich: On opening Procedures folder error is thrown and folder never gets opened. I don't see that there is any error in function which is causing error. Also it would be nice to separate procedures and functions. In my humble opinion there is no better mySql debugger then Illates Stepin. It would be awesome to see Stepin NetBeans plugin. mschovanek: Expanding Procedures node for replica DB. GUEST: try to view stored procedures of mysql server GUEST: Trying to show Procedures from jdbc mysql connection service Stacktrace: java.lang.NumberFormatException: For input string: "255) CHARSET utf8 BEGIN DECLARE citizenship VARCHAR(255); SET citizenship = ( SELECT c.name FROM countries AS c" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:458) at java.lang.Integer.valueOf(Integer.java:554) at com.mysql.jdbc.DatabaseMetaData$TypeDescriptor.<init>(DatabaseMetaData.java:247) at com.mysql.jdbc.DatabaseMetaData.getCallStmtParameterTypes(DatabaseMetaData.java:1652) at com.mysql.jdbc.DatabaseMetaData.getProcedureOrFunctionColumns(DatabaseMetaData.java:4120)
Created attachment 93667 [details] stacktrace
Created attachment 96075 [details] stacktrace NumberFormatException: For input string: "255) CHARSET utf8 BEGIN DECLARE citizenship VARCHAR(255); SET citizenship = ( SELECT c.name FROM countries AS c" This is old problem: http://netbeans.org/bugzilla/show_bug.cgi?id=180018 Opening schema Procedures node throw NumberFormatException. Wrapping each variable, table name, alias and column name with ticks (asci 96) did the trik. Only function definisions are prone to this problem. From doesn function definitions used only three made a problem. Common denominator for those three functions is that names like lng, countries, event where used as variable name, table name or column name However I find that such behaiour is a bit strict.
Caused by bug in MySQL (Connector/J driver) - http://bugs.mysql.com/bug.php?id=35199. The latest driver contains the fix. Need to upgrade to latest MySQL (Connector/J driver). In IDE tracked as https://netbeans.org/bugzilla/show_bug.cgi?id=187893